@aravindc26/velu 0.11.10 → 0.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/engine/lib/velu.ts +19 -10
package/package.json
CHANGED
package/src/engine/lib/velu.ts
CHANGED
|
@@ -936,21 +936,30 @@ export function getContextualOptions(): VeluContextualOption[] {
|
|
|
936
936
|
const raw = config.contextual?.options;
|
|
937
937
|
|
|
938
938
|
const ids = raw ?? DEFAULT_CONTEXTUAL_OPTIONS;
|
|
939
|
+
const options: VeluContextualOption[] = [];
|
|
939
940
|
|
|
940
|
-
|
|
941
|
+
ids.forEach((entry, index) => {
|
|
941
942
|
if (typeof entry === 'string') {
|
|
942
943
|
const preset = CONTEXTUAL_PRESETS[entry];
|
|
943
|
-
if (!preset) return
|
|
944
|
-
|
|
944
|
+
if (!preset) return;
|
|
945
|
+
options.push({ id: entry, title: preset.title, description: preset.description, type: 'builtin' });
|
|
946
|
+
return;
|
|
945
947
|
}
|
|
946
|
-
|
|
948
|
+
|
|
949
|
+
const title = trimString(entry.title);
|
|
950
|
+
const href = trimString(entry.href);
|
|
951
|
+
if (!title || !href) return;
|
|
952
|
+
|
|
953
|
+
options.push({
|
|
947
954
|
id: `custom-${index}`,
|
|
948
|
-
title
|
|
949
|
-
description: entry.description ?? '',
|
|
950
|
-
href
|
|
951
|
-
type: 'custom'
|
|
952
|
-
};
|
|
953
|
-
})
|
|
955
|
+
title,
|
|
956
|
+
description: trimString(entry.description) ?? '',
|
|
957
|
+
href,
|
|
958
|
+
type: 'custom',
|
|
959
|
+
});
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
return options;
|
|
954
963
|
}
|
|
955
964
|
|
|
956
965
|
export function getSiteOrigin(): string {
|