+ {selectedOption.icon && (
+

+ )}
+ {option.icon && (
+

+ )}
{option.label}
{colorHexValue && (
diff --git a/packages/visual-editor/src/internal/types/combobox.ts b/packages/visual-editor/src/internal/types/combobox.ts
index 7cb7361ce..8fe943ca3 100644
--- a/packages/visual-editor/src/internal/types/combobox.ts
+++ b/packages/visual-editor/src/internal/types/combobox.ts
@@ -2,6 +2,7 @@ export type ComboboxOption = {
label: string;
value: any;
color?: string; // ex. "bg-palette-primary-light"
+ icon?: string;
};
export type ComboboxOptionGroup = {
diff --git a/packages/visual-editor/src/utils/locator.ts b/packages/visual-editor/src/utils/locator.ts
new file mode 100644
index 000000000..ba3933a09
--- /dev/null
+++ b/packages/visual-editor/src/utils/locator.ts
@@ -0,0 +1,22 @@
+import { StreamDocument } from "./types/StreamDocument.ts";
+
+export const getLocatorSourcePageSetsEntityTypes = (
+ entityDocument: StreamDocument
+): string[] | undefined => {
+ const locatorSourcePageSets = entityDocument.__?.locatorSourcePageSets;
+ if (locatorSourcePageSets) {
+ try {
+ const pageSetMap = JSON.parse(locatorSourcePageSets) as Record<
+ string,
+ { entityType?: string }
+ >;
+ const entityTypes = Object.values(pageSetMap)
+ .map((entry) => entry.entityType)
+ .filter((entityType): entityType is string => !!entityType);
+ return Array.from(new Set(entityTypes));
+ } catch {
+ console.error("Failed to parse locatorSourcePageSets for entity types.");
+ }
+ }
+ return undefined;
+};
diff --git a/packages/visual-editor/src/utils/types/StreamDocument.ts b/packages/visual-editor/src/utils/types/StreamDocument.ts
index c95007b1f..7ef5aa826 100644
--- a/packages/visual-editor/src/utils/types/StreamDocument.ts
+++ b/packages/visual-editor/src/utils/types/StreamDocument.ts
@@ -17,6 +17,7 @@ export type StreamDocument = {
visualEditorConfig?: string;
isPrimaryLocale?: boolean; // deprecated, use pathInfo.primaryLocale instead
entityPageSetUrlTemplates?: string;
+ locatorSourcePageSets?: string;
};
};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3b19e952b..ed4baa0ce 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -79,6 +79,9 @@ importers:
packages/visual-editor:
dependencies:
+ "@mapbox/maki":
+ specifier: ^8.0.0
+ version: 8.2.0
"@microsoft/api-documenter":
specifier: ^7.26.29
version: 7.26.32(@types/node@20.19.11)
@@ -2104,6 +2107,12 @@ packages:
}
engines: { node: ">= 0.6" }
+ "@mapbox/maki@8.2.0":
+ resolution:
+ {
+ integrity: sha512-sTd/fEBfkBSidVwwtbijHZYJC7NhqvgLrXzSRHgxbLi52x4IciyTVUufqvJr8oIChw7hT7MIBHu5fyqrrpfFdA==,
+ }
+
"@mapbox/mapbox-gl-supported@2.0.1":
resolution:
{
@@ -12508,6 +12517,8 @@ snapshots:
"@mapbox/jsonlint-lines-primitives@2.0.2": {}
+ "@mapbox/maki@8.2.0": {}
+
"@mapbox/mapbox-gl-supported@2.0.1": {}
"@mapbox/point-geometry@0.1.0": {}