@yext/visual-editor 1.4.11 → 2.0.0-beta.2
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/dist/SectionLibraryVisualEditorProvider-fUGYIhyC.js +108668 -0
- package/dist/SectionLibraryVisualEditorProvider.css +1 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/Address.tsx +251 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HeadingText.tsx +147 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursStatus.tsx +157 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursTable.tsx +164 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/MapboxStaticMap.tsx +205 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/Phone.tsx +155 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/EmptyImageState.tsx +168 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/Image.tsx +275 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/styling.ts +66 -0
- package/dist/cli/assets/directory-locator-source/components/contentBlocks/index.ts +13 -0
- package/dist/cli/assets/directory-locator-source/components/sections/Breadcrumbs.tsx +298 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.test.tsx +872 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx +260 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryCard.tsx +507 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx +491 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.test.tsx +226 -0
- package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.tsx +98 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.test.tsx +147 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.tsx +691 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.test.tsx +1551 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.tsx +541 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorFields.test.ts +43 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorResultCard.tsx +1594 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorWrapper.tsx +1157 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Map.tsx +304 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/MapPinIcon.tsx +160 -0
- package/dist/cli/assets/directory-locator-source/components/sections/locator/Results.tsx +267 -0
- package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +245 -0
- package/dist/cli/yextve.js +16895 -0
- package/dist/index.d.ts +542 -6311
- package/dist/locales/page/cs/visual-editor.json +85 -0
- package/dist/locales/page/da/visual-editor.json +73 -0
- package/dist/locales/page/de/visual-editor.json +73 -0
- package/dist/locales/page/en/visual-editor.json +73 -0
- package/dist/locales/page/en-GB/visual-editor.json +73 -0
- package/dist/locales/page/es/visual-editor.json +79 -0
- package/dist/locales/page/et/visual-editor.json +73 -0
- package/dist/locales/page/fi/visual-editor.json +73 -0
- package/dist/locales/page/fr/visual-editor.json +79 -0
- package/dist/locales/page/hr/visual-editor.json +79 -0
- package/dist/locales/page/hu/visual-editor.json +73 -0
- package/dist/locales/page/it/visual-editor.json +79 -0
- package/dist/locales/page/ja/visual-editor.json +73 -0
- package/dist/locales/page/lt/visual-editor.json +85 -0
- package/dist/locales/page/lv/visual-editor.json +77 -0
- package/dist/locales/page/nb/visual-editor.json +73 -0
- package/dist/locales/page/nl/visual-editor.json +73 -0
- package/dist/locales/page/pl/visual-editor.json +85 -0
- package/dist/locales/page/pt/visual-editor.json +79 -0
- package/dist/locales/page/ro/visual-editor.json +79 -0
- package/dist/locales/page/sk/visual-editor.json +85 -0
- package/dist/locales/page/sv/visual-editor.json +73 -0
- package/dist/locales/page/tr/visual-editor.json +73 -0
- package/dist/locales/page/zh/visual-editor.json +73 -0
- package/dist/locales/page/zh-TW/visual-editor.json +73 -0
- package/dist/locales/platform/cs/visual-editor.json +531 -0
- package/dist/locales/platform/da/visual-editor.json +519 -0
- package/dist/locales/platform/de/visual-editor.json +519 -0
- package/dist/locales/platform/en/visual-editor.json +519 -0
- package/dist/locales/platform/en-GB/visual-editor.json +519 -0
- package/dist/locales/platform/es/visual-editor.json +525 -0
- package/dist/locales/platform/et/visual-editor.json +519 -0
- package/dist/locales/platform/fi/visual-editor.json +519 -0
- package/dist/locales/platform/fr/visual-editor.json +525 -0
- package/dist/locales/platform/hr/visual-editor.json +525 -0
- package/dist/locales/platform/hu/visual-editor.json +519 -0
- package/dist/locales/platform/it/visual-editor.json +525 -0
- package/dist/locales/platform/ja/visual-editor.json +519 -0
- package/dist/locales/platform/lt/visual-editor.json +531 -0
- package/dist/locales/platform/lv/visual-editor.json +523 -0
- package/dist/locales/platform/nb/visual-editor.json +519 -0
- package/dist/locales/platform/nl/visual-editor.json +519 -0
- package/dist/locales/platform/pl/visual-editor.json +531 -0
- package/dist/locales/platform/pt/visual-editor.json +525 -0
- package/dist/locales/platform/ro/visual-editor.json +525 -0
- package/dist/locales/platform/sk/visual-editor.json +531 -0
- package/dist/locales/platform/sv/visual-editor.json +519 -0
- package/dist/locales/platform/tr/visual-editor.json +519 -0
- package/dist/locales/platform/zh/visual-editor.json +519 -0
- package/dist/locales/platform/zh-TW/visual-editor.json +519 -0
- package/dist/locatorEntityTypes-s4dmT9l5.d.ts +1850 -0
- package/dist/plugin/internal/sectionLibraryValidation/builtInTranslationResources.d.ts +3 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/api/api.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/api/libraryMetadata.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/importRules.d.ts +13 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/validateCode.d.ts +10 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/code/xssRules.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/stages/structure/structure.d.ts +7 -0
- package/dist/plugin/internal/sectionLibraryValidation/types.d.ts +48 -0
- package/dist/plugin/internal/sectionLibraryValidation/validateSectionLibrary.d.ts +8 -0
- package/dist/plugin/internal/sectionLibraryValidation/validationError.d.ts +6 -0
- package/dist/plugin/plugin.js +2233 -5786
- package/dist/plugin/types/entityFields.d.ts +21 -0
- package/dist/plugin/types/images.d.ts +62 -0
- package/dist/plugin/types/sectionLibrary.d.ts +94 -0
- package/dist/plugin/types/types.d.ts +204 -0
- package/dist/plugin/types/videos.d.ts +24 -0
- package/dist/plugin/utils/i18n/locales.d.ts +5 -0
- package/dist/plugin/utils/i18n/translationResources.d.ts +41 -0
- package/dist/plugin/utils/normalizeLocale.d.ts +8 -0
- package/dist/plugin/utils/plainText.d.ts +6 -0
- package/dist/plugin/vite-plugin/index.d.ts +2 -0
- package/dist/plugin/vite-plugin/local-editor/artifacts.d.ts +18 -0
- package/dist/plugin/vite-plugin/local-editor/config.d.ts +11 -0
- package/dist/plugin/vite-plugin/local-editor/data.d.ts +10 -0
- package/dist/plugin/vite-plugin/local-editor/entityFields.d.ts +13 -0
- package/dist/plugin/vite-plugin/local-editor/fixtureData.d.ts +12 -0
- package/dist/plugin/vite-plugin/local-editor/generatedFiles.d.ts +34 -0
- package/dist/plugin/vite-plugin/local-editor/server.d.ts +18 -0
- package/dist/plugin/vite-plugin/local-editor/types.d.ts +109 -0
- package/dist/plugin/vite-plugin/local-editor/utils.d.ts +16 -0
- package/dist/plugin/vite-plugin/plugin.d.ts +8 -0
- package/dist/plugin/vite-plugin/section-library/migrationRegistry.d.ts +6 -0
- package/dist/plugin/vite-plugin/section-library/sectionFrontmatter.d.ts +3 -0
- package/dist/plugin/vite-plugin/section-library/sectionLibraryGenerator.d.ts +21 -0
- package/dist/plugin/vite-plugin/section-library/sharedComponentRegistry.d.ts +16 -0
- package/dist/section-library-support.js +158 -0
- package/dist/sectionLibrarySupport.d.ts +282 -0
- package/dist/style.css +1 -1
- package/dist/visual-editor-2Y77HmqL.js +718 -0
- package/dist/visual-editor-7P4U2T4q.js +694 -0
- package/dist/visual-editor-AXgoU7J5.js +694 -0
- package/dist/visual-editor-B-8ROr4n.js +694 -0
- package/dist/visual-editor-BDozYwKy.js +702 -0
- package/dist/visual-editor-BGMk-qTN.js +718 -0
- package/dist/visual-editor-BIqNAAcB.js +718 -0
- package/dist/visual-editor-BPI_dyYw.js +694 -0
- package/dist/visual-editor-BXYlpe7B.js +145 -0
- package/dist/visual-editor-Bkgub-3w.js +694 -0
- package/dist/visual-editor-Bo-tmHFc.js +694 -0
- package/dist/visual-editor-BuYrclmi.js +706 -0
- package/dist/visual-editor-Bxy81Ezy.js +145 -0
- package/dist/visual-editor-C0vq2BRM.js +145 -0
- package/dist/visual-editor-CCLIvOCf.js +694 -0
- package/dist/visual-editor-CCgmYV5S.js +169 -0
- package/dist/visual-editor-CE2J5pWp.js +694 -0
- package/dist/visual-editor-CERViyTJ.js +145 -0
- package/dist/visual-editor-CY2YjlX9.js +706 -0
- package/dist/visual-editor-CcuA4NSE.js +694 -0
- package/dist/visual-editor-Cd8yeRID.js +718 -0
- package/dist/visual-editor-CjORnP1D.js +169 -0
- package/dist/visual-editor-CmomGJB8.js +157 -0
- package/dist/visual-editor-CpCR_bSp.js +706 -0
- package/dist/visual-editor-Cymg8ID2.js +169 -0
- package/dist/visual-editor-D2Hk1nhM.js +145 -0
- package/dist/visual-editor-D8MRFn5x.js +157 -0
- package/dist/visual-editor-D96X4hBl.js +706 -0
- package/dist/visual-editor-DOXtCqRv.js +145 -0
- package/dist/visual-editor-DQEd3xwY.js +145 -0
- package/dist/visual-editor-DUngIOnE.js +157 -0
- package/dist/visual-editor-Dd-aD1iL.js +694 -0
- package/dist/visual-editor-DeZVZYfd.js +169 -0
- package/dist/visual-editor-DfJMZpiP.js +145 -0
- package/dist/visual-editor-DgAsQK9D.js +145 -0
- package/dist/visual-editor-Dhi__-7_.js +145 -0
- package/dist/visual-editor-DjN3MVkl.js +694 -0
- package/dist/visual-editor-DjdqpJU-.js +145 -0
- package/dist/visual-editor-DqddYaYq.js +694 -0
- package/dist/visual-editor-DrCmls4W.js +694 -0
- package/dist/visual-editor-DvuH3jyL.js +157 -0
- package/dist/visual-editor-TfVDfO5_.js +145 -0
- package/dist/visual-editor-VcrEkFyd.js +706 -0
- package/dist/visual-editor-W_ZDmMFn.js +145 -0
- package/dist/visual-editor-b7ALusk8.js +145 -0
- package/dist/visual-editor-bauJ9beX.js +694 -0
- package/dist/visual-editor-erGXf3kS.js +157 -0
- package/dist/visual-editor-hVELayZs.js +706 -0
- package/dist/visual-editor-xnDHZFuO.js +153 -0
- package/dist/visual-editor-yiWZqIH0.js +157 -0
- package/dist/visual-editor.css +1 -0
- package/dist/visual-editor.js +15074 -137463
- package/package.json +46 -25
- package/dist/editor.css +0 -1
- package/dist/visual-editor-1QC8zZX_.js +0 -221
- package/dist/visual-editor-5C5XV5rL.js +0 -221
- package/dist/visual-editor-B8-FoFxc.js +0 -1049
- package/dist/visual-editor-BJgCpnYV.js +0 -1073
- package/dist/visual-editor-BKLiin5z.js +0 -1049
- package/dist/visual-editor-BWbqw_QE.js +0 -233
- package/dist/visual-editor-Bb6upvTE.js +0 -221
- package/dist/visual-editor-BcZCBLFh.js +0 -1049
- package/dist/visual-editor-BecDYKH8.js +0 -1049
- package/dist/visual-editor-BllAUu_T.js +0 -1073
- package/dist/visual-editor-BmaYFuCe.js +0 -233
- package/dist/visual-editor-BnPFkJlo.js +0 -221
- package/dist/visual-editor-BoIXa-xl.js +0 -245
- package/dist/visual-editor-BtDJICJp.js +0 -1073
- package/dist/visual-editor-BwxWyr_L.js +0 -221
- package/dist/visual-editor-Bz7BlR_j.js +0 -221
- package/dist/visual-editor-CC0RAmib.js +0 -1049
- package/dist/visual-editor-CDY9slY9.js +0 -1061
- package/dist/visual-editor-CFebs6R8.js +0 -1049
- package/dist/visual-editor-CNL0HyVh.js +0 -1049
- package/dist/visual-editor-CYnzwNwX.js +0 -229
- package/dist/visual-editor-CZH605TK.js +0 -233
- package/dist/visual-editor-Cada46ZF.js +0 -1049
- package/dist/visual-editor-CheComxC.js +0 -1061
- package/dist/visual-editor-CuA8h_Xv.js +0 -221
- package/dist/visual-editor-CuRmgs-p.js +0 -245
- package/dist/visual-editor-D9_YWQQY.js +0 -1073
- package/dist/visual-editor-D9w4wRG8.js +0 -245
- package/dist/visual-editor-D9xTiOC0.js +0 -221
- package/dist/visual-editor-DA7CixSl.js +0 -1061
- package/dist/visual-editor-DAnBQ9H_.js +0 -221
- package/dist/visual-editor-DF8RsMvq.js +0 -233
- package/dist/visual-editor-DLrKYx7j.js +0 -1061
- package/dist/visual-editor-DQJc_Xok.js +0 -233
- package/dist/visual-editor-DTZFGKm7.js +0 -221
- package/dist/visual-editor-DXebihTA.js +0 -233
- package/dist/visual-editor-DZ4U1fk-.js +0 -221
- package/dist/visual-editor-Dg7P-vDv.js +0 -1057
- package/dist/visual-editor-Dh2cuwWt.js +0 -1049
- package/dist/visual-editor-DpetyO9o.js +0 -1049
- package/dist/visual-editor-Duav2tXb.js +0 -1061
- package/dist/visual-editor-DvYsu_s9.js +0 -221
- package/dist/visual-editor-DwlX3nnZ.js +0 -221
- package/dist/visual-editor-Dz5s66Og.js +0 -221
- package/dist/visual-editor-E57fPJMD.js +0 -1049
- package/dist/visual-editor-Fy_uEJju.js +0 -1061
- package/dist/visual-editor-G8e2TllW.js +0 -1049
- package/dist/visual-editor-HkfpXRw7.js +0 -1049
- package/dist/visual-editor-ZKG4e_Ey.js +0 -1049
- package/dist/visual-editor-rZRnDwgU.js +0 -245
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { YextSchemaField } from "../../types/entityFields.ts";
|
|
2
|
+
import type { PageSetType } from "../../types/sectionLibrary.ts";
|
|
3
|
+
export type LocalEditorOptions = {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type LocalEditorDefaults = {
|
|
7
|
+
layoutId?: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
entityId?: string;
|
|
10
|
+
};
|
|
11
|
+
export type LocalEditorStreamField = string | {
|
|
12
|
+
name: string;
|
|
13
|
+
fullObject?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type LocalEditorStreamDefinition = {
|
|
16
|
+
fields?: LocalEditorStreamField[];
|
|
17
|
+
} & Record<string, unknown>;
|
|
18
|
+
export type LocalEditorPagesStream = {
|
|
19
|
+
$id?: string;
|
|
20
|
+
fields: string[];
|
|
21
|
+
filter?: {
|
|
22
|
+
entityIds?: string[];
|
|
23
|
+
entityTypes?: string[];
|
|
24
|
+
savedFilterIds?: string[];
|
|
25
|
+
};
|
|
26
|
+
localization?: {
|
|
27
|
+
locales?: string[];
|
|
28
|
+
primary?: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type LocalEditorLayoutConfig = {
|
|
32
|
+
defaults?: Omit<LocalEditorDefaults, "layoutId">;
|
|
33
|
+
stream?: LocalEditorStreamDefinition;
|
|
34
|
+
};
|
|
35
|
+
export type LocalEditorConfig = {
|
|
36
|
+
defaults?: LocalEditorDefaults;
|
|
37
|
+
/** Environment values injected into every local-editor stream document. */
|
|
38
|
+
env?: Record<string, string>;
|
|
39
|
+
pageSetTypes?: Partial<Record<PageSetType, LocalEditorLayoutConfig>>;
|
|
40
|
+
layouts?: Record<string, LocalEditorLayoutConfig>;
|
|
41
|
+
};
|
|
42
|
+
export type LocalEditorLayoutDefaults = {
|
|
43
|
+
entityId?: string;
|
|
44
|
+
locale?: string;
|
|
45
|
+
defaultLayoutData?: unknown;
|
|
46
|
+
};
|
|
47
|
+
export type ResolvedLocalEditorLayoutConfig = {
|
|
48
|
+
layoutId: string;
|
|
49
|
+
dataTemplateName: string;
|
|
50
|
+
pageSetType: PageSetType;
|
|
51
|
+
dataSource: "stream" | "fixture";
|
|
52
|
+
defaults: Omit<LocalEditorDefaults, "layoutId">;
|
|
53
|
+
stream?: LocalEditorStreamDefinition;
|
|
54
|
+
defaultLayoutData?: unknown;
|
|
55
|
+
};
|
|
56
|
+
export type LocalEditorDocumentIndexEntry = {
|
|
57
|
+
layoutId: string;
|
|
58
|
+
entityId: string;
|
|
59
|
+
displayName: string;
|
|
60
|
+
locale: string;
|
|
61
|
+
filePath?: string;
|
|
62
|
+
fileName: string;
|
|
63
|
+
document?: Record<string, unknown>;
|
|
64
|
+
};
|
|
65
|
+
export type LocalEditorEntityOption = {
|
|
66
|
+
entityId: string;
|
|
67
|
+
displayName: string;
|
|
68
|
+
locales: string[];
|
|
69
|
+
};
|
|
70
|
+
export type LocalEditorManifestResponse = {
|
|
71
|
+
layouts: string[];
|
|
72
|
+
pageSetTypeByLayout: Record<string, PageSetType>;
|
|
73
|
+
dataSourceByLayout: Record<string, "stream" | "fixture">;
|
|
74
|
+
entitiesByLayout: Record<string, LocalEditorEntityOption[]>;
|
|
75
|
+
layoutDefaults: Record<string, LocalEditorLayoutDefaults>;
|
|
76
|
+
defaults: LocalEditorDefaults;
|
|
77
|
+
diagnostics: string[];
|
|
78
|
+
streamConfigPath: string;
|
|
79
|
+
localDataPath: string;
|
|
80
|
+
};
|
|
81
|
+
export type LocalEditorDocumentResponse = {
|
|
82
|
+
document: Record<string, unknown> | null;
|
|
83
|
+
/** Whether a Locator document uses built-in fixture data or real Search. */
|
|
84
|
+
locatorDataSource?: "fixture" | "real";
|
|
85
|
+
entityFields: {
|
|
86
|
+
fields: YextSchemaField[];
|
|
87
|
+
displayNames: Record<string, string>;
|
|
88
|
+
};
|
|
89
|
+
diagnostics: string[];
|
|
90
|
+
};
|
|
91
|
+
export type LocalEditorContext = {
|
|
92
|
+
diagnostics: string[];
|
|
93
|
+
streamConfigPath: string;
|
|
94
|
+
localDataPath: string;
|
|
95
|
+
layouts: string[];
|
|
96
|
+
defaults: LocalEditorDefaults;
|
|
97
|
+
env: Record<string, string>;
|
|
98
|
+
layoutDefaults: Record<string, LocalEditorLayoutDefaults>;
|
|
99
|
+
layoutStreams: Record<string, LocalEditorStreamDefinition | undefined>;
|
|
100
|
+
pageSetTypeByLayout: Record<string, PageSetType>;
|
|
101
|
+
dataSourceByLayout: Record<string, "stream" | "fixture">;
|
|
102
|
+
entitiesByLayout: Record<string, LocalEditorEntityOption[]>;
|
|
103
|
+
documents: LocalEditorDocumentIndexEntry[];
|
|
104
|
+
};
|
|
105
|
+
export type ResolvedLocalEditorConfig = {
|
|
106
|
+
defaults: LocalEditorDefaults;
|
|
107
|
+
env: Record<string, string>;
|
|
108
|
+
layouts: ResolvedLocalEditorLayoutConfig[];
|
|
109
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether a value is a non-array object.
|
|
3
|
+
*/
|
|
4
|
+
export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Reads and parses JSON, rethrowing parse failures with a path-aware message.
|
|
7
|
+
*/
|
|
8
|
+
export declare const readJsonFile: <T>(filePath: string, description: string) => T;
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes unknown thrown values into a printable error message.
|
|
11
|
+
*/
|
|
12
|
+
export declare const toErrorMessage: (error: unknown) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Writes a file only when its contents have changed.
|
|
15
|
+
*/
|
|
16
|
+
export declare const writeFileIfChanged: (filePath: string, contents: string) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
import type { LocalEditorOptions } from "./local-editor/types.ts";
|
|
3
|
+
export type VisualEditorPluginOptions = {
|
|
4
|
+
/** @deprecated This option is ignored because Section Library builds are always enabled. */
|
|
5
|
+
sectionLibrary?: boolean;
|
|
6
|
+
localEditor?: LocalEditorOptions;
|
|
7
|
+
};
|
|
8
|
+
export declare const yextVisualEditorPlugin: (options?: VisualEditorPluginOptions) => Plugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class MigrationRegistryValidationError extends Error {
|
|
2
|
+
readonly rule: string;
|
|
3
|
+
constructor(rule: string, message: string);
|
|
4
|
+
}
|
|
5
|
+
/** Validates the section library's migration registry and returns its length. */
|
|
6
|
+
export declare const readMigrationRegistryLength: (sourcePath: string) => number | undefined;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SectionLibraryLayout } from "../../types/sectionLibrary.ts";
|
|
2
|
+
/** A Section Library layout and its metadata. */
|
|
3
|
+
type Layout = SectionLibraryLayout;
|
|
4
|
+
/** Section Library files and metadata generated for a build. */
|
|
5
|
+
type GeneratedSectionLibrary = {
|
|
6
|
+
generatedFiles: string[];
|
|
7
|
+
manifestSource?: string;
|
|
8
|
+
layouts: Layout[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Generates the temporary Pages source files and build metadata for a Section
|
|
12
|
+
* Library. The files exist only while Vite runs. It returns no files when the
|
|
13
|
+
* starter has no library metadata.
|
|
14
|
+
*
|
|
15
|
+
* 1. Read and validate the library, section, shared-registry, and layout source.
|
|
16
|
+
* 2. Generate one Puck config, Pages render template, and editor template per layout.
|
|
17
|
+
* 3. Write build metadata and return the Section Library artifact manifest.
|
|
18
|
+
*/
|
|
19
|
+
export declare const generateSectionLibraryFiles: (rootDir: string, sectionLibraryRevisionId?: string) => GeneratedSectionLibrary;
|
|
20
|
+
export declare const cleanupGeneratedSectionLibraryFiles: (generatedFiles: string[]) => void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SharedHiddenPuckComponentRegistry } from "../../types/sectionLibrary.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Reads the optional `shared/componentRegistry.ts` Section Library contract.
|
|
4
|
+
*
|
|
5
|
+
* 1. Read the static component and root metadata. The registry is not executed,
|
|
6
|
+
* and its internal component source files are not inspected.
|
|
7
|
+
* 2. Validate IDs and page-set types used by saved Puck slot data.
|
|
8
|
+
* 3. Return the metadata used to register hidden internal components without
|
|
9
|
+
* adding them to editor menus.
|
|
10
|
+
*
|
|
11
|
+
* The file must export `sharedComponentMetadata`, `sharedComponentConfigs`,
|
|
12
|
+
* `sharedRootConfigs`, `sharedRootAllowedComponentIds`, and
|
|
13
|
+
* `sharedRootPageSetTypes`. It returns `undefined` only when the optional
|
|
14
|
+
* registry file does not exist.
|
|
15
|
+
*/
|
|
16
|
+
export declare const readSharedComponentRegistry: (sourcePath: string) => SharedHiddenPuckComponentRegistry | undefined;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { bI as y, bL as C, bJ as S, bK as E, bo as h, cs as P, aT as v, bS as A, b1 as I, bu as M, aO as L, bP as f, by as F, cl as D, cn as O, co as R, cm as V, Q as x, cy as B, cz as k, b0 as w, aq as W, cc as _, b3 as z, b4 as H, b5 as U, b8 as Y, bY as N, b7 as G, bs as Q, bc as q, cq as j, T as K, bp as Z, aF as $, cM as X, cN as J, W as ee, _ as se, Z as ae, U as te, X as oe, dd as re, cQ as ne, bf as ie, al as le, cU as de, aZ as ce, bj as pe, bQ as be, cY as ge, b_ as me, bZ as ue, br as Te, bn as ye, cp as Ce, f as Se, bA as Ee, de as he, bB as Pe, df as ve, bG as Ae, bM as Ie, cb as Me, dg as Le, c6 as fe, dh as Fe, bR as De, d1 as Oe, bz as Re, di as Ve, bF as xe, bE as Be, aS as ke, bb as we, c1 as We, d4 as _e, dj as ze, b6 as He, dk as Ue, b2 as Ye, bh as Ne, b9 as Ge, c2 as Qe, dl as qe, bX as je, dm as Ke, dn as Ze, m as $e, ak as Xe, d6 as Je, be as es, dp as ss, M as as, c7 as ts, a$ as os, a_ as rs, bt as ns, dq as is, dr as ls, ba as ds, bO as cs, d as ps, c as bs, bi as gs, bq as ms, aY as us, db as Ts, c3 as ys, c4 as Cs, bx as Ss, aR as Es, bl as hs, ac as Ps, R as vs, bm as As, ds as Is, b$ as Ms, u as Ls, an as fs, bv as Fs, bk as Ds, c0 as Os } from "./SectionLibraryVisualEditorProvider-fUGYIhyC.js";
|
|
2
|
+
import { setDeep as d } from "@puckeditor/core";
|
|
3
|
+
function b(s, e) {
|
|
4
|
+
return c(e)[s] ?? null;
|
|
5
|
+
}
|
|
6
|
+
const c = (s) => s.substring(1).split("&").map((e) => e.split("=")).reduce((e, a) => a.length === 2 ? {
|
|
7
|
+
...e,
|
|
8
|
+
[a[0]]: decodeURIComponent(a[1].replace(/\+/g, "%20"))
|
|
9
|
+
} : e, {}), g = (s, e) => {
|
|
10
|
+
const a = s.props.slots.SectionHeadingSlot?.[0]?.props?.styles?.level, t = s.props.slots.CardsWrapperSlot?.[0]?.props?.slots?.CardSlot, o = a < 6 ? a + 1 : "span";
|
|
11
|
+
return t && (s.props.slots.CardsWrapperSlot[0].props.slots.CardSlot = t.map(
|
|
12
|
+
(n) => d(
|
|
13
|
+
n,
|
|
14
|
+
`props.slots.${e}[0].props.styles.semanticLevelOverride`,
|
|
15
|
+
o
|
|
16
|
+
)
|
|
17
|
+
)), s;
|
|
18
|
+
}, m = (s, e, a) => {
|
|
19
|
+
const t = s.parent?.props.styles || {}, o = e.props.parentStyles || {};
|
|
20
|
+
if (a.some(
|
|
21
|
+
(r) => t[r] !== o[r]
|
|
22
|
+
)) {
|
|
23
|
+
const r = a.reduce(
|
|
24
|
+
(i, l) => (i[l] = t[l], i),
|
|
25
|
+
{ ...o }
|
|
26
|
+
);
|
|
27
|
+
return d(e, "props.parentStyles", r);
|
|
28
|
+
}
|
|
29
|
+
return e;
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
y as Accordion,
|
|
33
|
+
C as AccordionContent,
|
|
34
|
+
S as AccordionItem,
|
|
35
|
+
E as AccordionTrigger,
|
|
36
|
+
h as Background,
|
|
37
|
+
P as BackgroundProvider,
|
|
38
|
+
v as Body,
|
|
39
|
+
A as Button,
|
|
40
|
+
I as CTA,
|
|
41
|
+
M as CardContextProvider,
|
|
42
|
+
L as ComponentErrorBoundary,
|
|
43
|
+
f as ConstantValueModeToggler,
|
|
44
|
+
F as DEFAULT_ENTITY_TYPE,
|
|
45
|
+
D as DropdownMenu,
|
|
46
|
+
O as DropdownMenuContent,
|
|
47
|
+
R as DropdownMenuItem,
|
|
48
|
+
V as DropdownMenuTrigger,
|
|
49
|
+
x as EditorButton,
|
|
50
|
+
B as EmbeddedFieldStringInputFromEntity,
|
|
51
|
+
k as EmbeddedFieldStringInputFromOptions,
|
|
52
|
+
w as EntityField,
|
|
53
|
+
W as EntityTooltipsProvider,
|
|
54
|
+
_ as FOOD_DELIVERY_SERVICES,
|
|
55
|
+
z as Heading,
|
|
56
|
+
H as HoursStatusAtom,
|
|
57
|
+
U as HoursTableAtom,
|
|
58
|
+
Y as Image,
|
|
59
|
+
N as MapPinIcon,
|
|
60
|
+
G as MaybeLink,
|
|
61
|
+
Q as PageSection,
|
|
62
|
+
q as PhoneAtom,
|
|
63
|
+
j as SectionLibraryVisualEditorProvider,
|
|
64
|
+
K as TARGET_ORIGINS,
|
|
65
|
+
Z as TemplatePropsContext,
|
|
66
|
+
$ as ThemeOptions,
|
|
67
|
+
X as TimestampAtom,
|
|
68
|
+
J as TimestampOption,
|
|
69
|
+
ee as Tooltip,
|
|
70
|
+
se as TooltipArrow,
|
|
71
|
+
ae as TooltipContent,
|
|
72
|
+
te as TooltipProvider,
|
|
73
|
+
oe as TooltipTrigger,
|
|
74
|
+
re as VIEWPORT_BREAKPOINTS,
|
|
75
|
+
ne as VideoAtom,
|
|
76
|
+
ie as VisibilityWrapper,
|
|
77
|
+
le as YextAutoField,
|
|
78
|
+
de as YextEntityFieldSelector,
|
|
79
|
+
ce as backgroundColors,
|
|
80
|
+
pe as bindSlots,
|
|
81
|
+
be as buildLocatorDisplayOptions,
|
|
82
|
+
ge as buttonVariants,
|
|
83
|
+
me as createSearchAnalyticsConfig,
|
|
84
|
+
ue as createSearchHeadlessConfig,
|
|
85
|
+
Te as createSlottedItemSource,
|
|
86
|
+
ye as deepMerge,
|
|
87
|
+
Ce as fetchLocalesToPathsForEntity,
|
|
88
|
+
Se as findField,
|
|
89
|
+
Ee as formatDistance,
|
|
90
|
+
he as formatPhoneNumber,
|
|
91
|
+
g as forwardHeadingLevel,
|
|
92
|
+
Pe as fromMeters,
|
|
93
|
+
ve as gatherSlotStyles,
|
|
94
|
+
Ae as getBackgroundColorClasses,
|
|
95
|
+
Ie as getBackgroundColorStyle,
|
|
96
|
+
Me as getCTAType,
|
|
97
|
+
Le as getDisplayValue,
|
|
98
|
+
fe as getEntityTypeLabel,
|
|
99
|
+
Fe as getImageAltText,
|
|
100
|
+
De as getLocatorEntityTypeSourceMap,
|
|
101
|
+
Oe as getPageMetadata,
|
|
102
|
+
Re as getPreferredDistanceUnit,
|
|
103
|
+
Ve as getRandomPlaceholderImageObject,
|
|
104
|
+
xe as getTextColorClass,
|
|
105
|
+
Be as getTextColorStyle,
|
|
106
|
+
ke as getThemeColorCssValue,
|
|
107
|
+
we as getThemeValue,
|
|
108
|
+
b as getValueFromQueryString,
|
|
109
|
+
We as getViewport,
|
|
110
|
+
_e as headingVariants,
|
|
111
|
+
ze as hexToRGB,
|
|
112
|
+
He as imgSizesHelper,
|
|
113
|
+
Ue as isColorContrastWcagCompliant,
|
|
114
|
+
Ye as isCtaVariantWithColor,
|
|
115
|
+
Ne as isDirectoryGrid,
|
|
116
|
+
Ge as isLocalizedAssetImage,
|
|
117
|
+
Qe as isLocatorEntityType,
|
|
118
|
+
qe as isNonNormalizableLinkType,
|
|
119
|
+
je as isVisualEditorTestEnv,
|
|
120
|
+
Ke as linkTypeOptions,
|
|
121
|
+
Ze as loadTranslationDictionary,
|
|
122
|
+
$e as mergeMeta,
|
|
123
|
+
Xe as msg,
|
|
124
|
+
Je as normalizeLink,
|
|
125
|
+
es as normalizeSlug,
|
|
126
|
+
ss as presetImageIcons,
|
|
127
|
+
as as pt,
|
|
128
|
+
ts as resolveBreadcrumbs,
|
|
129
|
+
os as resolveComponentData,
|
|
130
|
+
rs as resolveDataFromParent,
|
|
131
|
+
ns as resolveDirectoryListChildren,
|
|
132
|
+
is as resolveDirectoryRootProps,
|
|
133
|
+
ls as resolveField,
|
|
134
|
+
ds as resolveLocalizedAssetImage,
|
|
135
|
+
cs as resolveLocatorResultUrl,
|
|
136
|
+
ps as resolveUrlTemplate,
|
|
137
|
+
bs as resolveUrlTemplateOfChild,
|
|
138
|
+
gs as sortAlphabetically,
|
|
139
|
+
ms as syncLinkedSlotMappedCards,
|
|
140
|
+
m as syncParentStyles,
|
|
141
|
+
us as themeManagerCn,
|
|
142
|
+
Ts as toKilometers,
|
|
143
|
+
ys as toMeters,
|
|
144
|
+
Cs as toMiles,
|
|
145
|
+
Ss as toPuckFields,
|
|
146
|
+
Es as useBackground,
|
|
147
|
+
hs as useCardContext,
|
|
148
|
+
Ps as useDocument,
|
|
149
|
+
vs as useEntityTooltips,
|
|
150
|
+
As as useGetCardSlots,
|
|
151
|
+
Is as useParentCardStyles,
|
|
152
|
+
Ms as usePreviewWindow,
|
|
153
|
+
Ls as useReceiveMessage,
|
|
154
|
+
fs as useSendMessageToParent,
|
|
155
|
+
Fs as useTemplateMetadata,
|
|
156
|
+
Ds as useTemplateProps,
|
|
157
|
+
Os as useWindowWidth
|
|
158
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { g as ThemeColor, a as StreamDocument, ck as SlotMappedCardsData, a2 as SectionLibraryTranslationLoaders, S as StreamFields, c as TailwindConfig, a$ as PresetImageType } from './locatorEntityTypes-s4dmT9l5.js';
|
|
2
|
+
export { a3 as Accordion, a4 as AccordionContent, a5 as AccordionItem, a6 as AccordionTrigger, a7 as AssetImageType, a1 as AssetVideo, a8 as Background, a9 as BackgroundProps, aa as BackgroundProvider, B as BasicSelectorField, ac as Body, p as BodyProps, ae as Button, af as ButtonProps, ag as CTA, t as CTAProps, i as CTAVariant, cl as ConstantValueModeToggler, cm as DEFAULT_ENTITY_TYPE, am as DropdownMenu, an as DropdownMenuContent, ao as DropdownMenuItem, ap as DropdownMenuTrigger, aq as EmbeddedFieldStringInputFromEntity, ar as EmbeddedFieldStringInputFromOptions, cn as EmbeddedStringOption, at as EntityField, co as EntityTooltipsProvider, az as FOOD_DELIVERY_SERVICES, cp as FieldResolution, cq as FieldTypeData, aD as Heading, k as HeadingLevel, H as HeadingProps, aF as HoursStatusAtom, aG as HoursStatusAtomProps, aH as HoursTableAtom, aI as HoursTableAtomProps, aJ as Image, J as ImageField, l as ImageFillType, cr as ImagePayload, aM as ImageProps, n as ImgSizesByBreakpoint, cs as LocatorConfig, L as LocatorEntityType, aQ as MaybeLink, aR as MaybeLinkProps, M as MsgString, aT as MultiSelectorOption, q as MultiSelectorValue, aW as PageSection, aX as PageSectionProps, aZ as PhoneAtom, a_ as PhoneAtomProps, b3 as RenderYextEntityFieldSelectorProps, ct as RootConfig, ba as TemplatePropsContext, f as ThemeOptions, bd as TimestampAtom, be as TimestampAtomProps, bf as TimestampOption, m as TranslatableAssetImage, j as TranslatableString, bk as VideoAtom, bl as VideoAtomProps, bn as VisibilityWrapper, bq as YextArrayField, br as YextAutoField, bs as YextCTAField, Y as YextComponentConfig, bt as YextCustomFieldRenderProps, h as YextEntityField, bu as YextEntityFieldSelector, bv as YextFieldDefinition, bw as YextFieldMap, bx as YextFields, by as YextObjectField, bz as YextPuckField, bC as backgroundColors, bD as bindSlots, cu as buildLocatorDisplayOptions, bF as buttonVariants, bH as createSearchAnalyticsConfig, bI as createSearchHeadlessConfig, bJ as createSlottedItemSource, bK as deepMerge, bN as fetchLocalesToPathsForEntity, cv as findField, cw as formatDistance, cx as formatPhoneNumber, cy as fromMeters, cz as getBackgroundColorClasses, cA as getBackgroundColorStyle, cB as getCTAType, cC as getDisplayValue, cD as getEntityTypeLabel, cE as getImageAltText, cF as getLocatorEntityTypeSourceMap, bR as getPageMetadata, bS as getPreferredDistanceUnit, cG as getTextColorClass, cH as getTextColorStyle, bU as getThemeColorCssValue, bW as headingVariants, cI as hexToRGB, bX as imgSizesHelper, cJ as isColorContrastWcagCompliant, cK as isCtaVariantWithColor, bZ as isLocalizedAssetImage, cL as isLocatorEntityType, cM as isNonNormalizableLinkType, cN as loadTranslationDictionary, b_ as mergeMeta, b$ as msg, c0 as normalizeLink, c1 as normalizeSlug, c3 as pt, c4 as resolveBreadcrumbs, c5 as resolveComponentData, c6 as resolveDataFromParent, cO as resolveDirectoryRootProps, cP as resolveField, c7 as resolveLocalizedAssetImage, c8 as resolveUrlTemplate, c9 as resolveUrlTemplateOfChild, cb as themeManagerCn, ce as toKilometers, cQ as toMeters, cR as toMiles, cf as toPuckFields, cg as useBackground, ch as useDocument, cS as useEntityTooltips, cT as useTemplateMetadata, cj as useTemplateProps } from './locatorEntityTypes-s4dmT9l5.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import { Slot, useGetPuck, ComponentData } from '@puckeditor/core';
|
|
6
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
7
|
+
import { VariantProps } from 'class-variance-authority';
|
|
8
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
9
|
+
import 'clsx';
|
|
10
|
+
import '@yext/pages-components';
|
|
11
|
+
import '@yext/search-headless-react';
|
|
12
|
+
import '@yext/search-ui-react';
|
|
13
|
+
import '@radix-ui/react-dropdown-menu';
|
|
14
|
+
import 'react-i18next';
|
|
15
|
+
import 'i18next';
|
|
16
|
+
|
|
17
|
+
declare const MapPinIcon: ({ color, resultIndex, icon, iconWidth, disableContrastIcon, aspectRatio, selected, }: {
|
|
18
|
+
color?: ThemeColor;
|
|
19
|
+
resultIndex?: number;
|
|
20
|
+
icon?: string;
|
|
21
|
+
iconWidth: number;
|
|
22
|
+
disableContrastIcon?: boolean;
|
|
23
|
+
aspectRatio?: number;
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
}) => React.JSX.Element;
|
|
26
|
+
|
|
27
|
+
type CardContextType<T extends Record<string, any>> = {
|
|
28
|
+
sharedCardProps: T | undefined;
|
|
29
|
+
setSharedCardProps: React__default.Dispatch<React__default.SetStateAction<T | undefined>>;
|
|
30
|
+
};
|
|
31
|
+
declare const CardContextProvider: <T extends Record<string, any>>({ children, parentStyles, }: {
|
|
32
|
+
children: React__default.ReactNode;
|
|
33
|
+
parentStyles?: unknown;
|
|
34
|
+
}) => React__default.JSX.Element;
|
|
35
|
+
declare const useCardContext: <T extends Record<string, any>>() => CardContextType<T>;
|
|
36
|
+
declare const useParentCardStyles: <T>() => T | undefined;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* useGetSlotProps hooks into the puck state to retrieve the unprocessed slot props.
|
|
40
|
+
* Only works in-editor, otherwise returns undefined.
|
|
41
|
+
* @returns slotStyles: a mapping of slot prop names to their shared values. Includes all props in the styles section.
|
|
42
|
+
* @returns getPuck a function to retrieve the puck state
|
|
43
|
+
* @returns slotProps the raw slot data from puck
|
|
44
|
+
*/
|
|
45
|
+
type UseGetCardSlotsResult<T extends {
|
|
46
|
+
slots: Record<string, Slot>;
|
|
47
|
+
}> = {
|
|
48
|
+
slotStyles: Record<string, T extends {
|
|
49
|
+
styles: infer S;
|
|
50
|
+
} ? S : Record<string, unknown>>;
|
|
51
|
+
getPuck?: ReturnType<typeof useGetPuck>;
|
|
52
|
+
slotProps?: T["slots"];
|
|
53
|
+
};
|
|
54
|
+
declare const useGetCardSlots: <T extends {
|
|
55
|
+
slots: Record<string, Slot>;
|
|
56
|
+
}>(id: string) => UseGetCardSlotsResult<T>;
|
|
57
|
+
declare const gatherSlotStyles: (slotProps: Record<string, Slot>) => {
|
|
58
|
+
[k: string]: any;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns the preview iframe's window when available, otherwise the main window.
|
|
63
|
+
* Safe to use on live pages without the preview iframe.
|
|
64
|
+
*/
|
|
65
|
+
declare const usePreviewWindow: () => Window | null;
|
|
66
|
+
|
|
67
|
+
declare const VIEWPORT_BREAKPOINTS: {
|
|
68
|
+
readonly md: 768;
|
|
69
|
+
readonly lg: 1024;
|
|
70
|
+
};
|
|
71
|
+
declare const getViewport: (width: number) => {
|
|
72
|
+
isMobile: boolean;
|
|
73
|
+
isTablet: boolean;
|
|
74
|
+
isDesktop: boolean;
|
|
75
|
+
};
|
|
76
|
+
declare const useWindowWidth: (externalWindow?: Window | null) => number;
|
|
77
|
+
|
|
78
|
+
declare const buttonVariants: (props?: ({
|
|
79
|
+
variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | "small_link" | "puckSelect" | null | undefined;
|
|
80
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
81
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
82
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
83
|
+
asChild?: boolean;
|
|
84
|
+
}
|
|
85
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
86
|
+
|
|
87
|
+
declare const linkTypeOptions: () => {
|
|
88
|
+
label: string;
|
|
89
|
+
value: string;
|
|
90
|
+
}[];
|
|
91
|
+
|
|
92
|
+
declare const isDirectoryGrid: (children: unknown) => boolean;
|
|
93
|
+
declare const sortAlphabetically: <T extends Record<string, any>>(directoryChildren: T[], sortBy: string) => T[];
|
|
94
|
+
|
|
95
|
+
interface PlaceholderImageOptions {
|
|
96
|
+
/** If provided, returns this URL to ensure stability (prevents re-fetching) */
|
|
97
|
+
existingUrl?: string;
|
|
98
|
+
/** Width in pixels to append to the URL */
|
|
99
|
+
width?: number;
|
|
100
|
+
/** Height in pixels to append to the URL */
|
|
101
|
+
height?: number;
|
|
102
|
+
/** Aspect ratio (width/height). If width is provided but height is not, height will be calculated. If height is provided but width is not, width will be calculated. */
|
|
103
|
+
aspectRatio?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Gets a random placeholder image object with default metadata.
|
|
107
|
+
* @param options - Options for generating the placeholder image. Can include existingConstantValue for stability, or width/height/aspectRatio for dimensions.
|
|
108
|
+
* @returns A randomly selected placeholder image object with url, or reuses existing URL if provided
|
|
109
|
+
*/
|
|
110
|
+
declare function getRandomPlaceholderImageObject(options?: PlaceholderImageOptions & {
|
|
111
|
+
/** If provided with a URL, uses it to ensure stability (prevents re-fetching) */
|
|
112
|
+
existingConstantValue?: {
|
|
113
|
+
url?: string;
|
|
114
|
+
width?: number;
|
|
115
|
+
height?: number;
|
|
116
|
+
aspectRatio?: number;
|
|
117
|
+
};
|
|
118
|
+
}): {
|
|
119
|
+
url: string;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Reads a theme CSS variable value in both editor and page-generation contexts.
|
|
124
|
+
*/
|
|
125
|
+
declare const getThemeValue: (variableName: string, streamDocument?: StreamDocument | Record<string, any>) => string | undefined;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Retrieves the value of a query string param from the URL's query string. If it doesn't exist,
|
|
129
|
+
* return null.
|
|
130
|
+
*/
|
|
131
|
+
declare function getValueFromQueryString(name: string, queryString: string): string | null;
|
|
132
|
+
|
|
133
|
+
interface SlotMappedCardWrapperType<TMappings extends Record<string, unknown>> {
|
|
134
|
+
data: SlotMappedCardsData<TMappings>;
|
|
135
|
+
slots: {
|
|
136
|
+
CardSlot: Slot;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface CardWrapper {
|
|
141
|
+
slots: {
|
|
142
|
+
CardSlot: Slot;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Reads the section heading level from `SectionHeadingSlot` and passes the
|
|
147
|
+
* next semantic level into each card's destination heading slot. When the
|
|
148
|
+
* section heading is already `h6`, card headings are rendered as `span` so the
|
|
149
|
+
* document outline does not exceed valid heading levels.
|
|
150
|
+
*/
|
|
151
|
+
declare const forwardHeadingLevel: <T extends CardWrapper>(data: Record<string, any>, destinationHeadingSlotKey: string) => Record<string, any>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Slot-mapped card reconciliation helpers.
|
|
155
|
+
*
|
|
156
|
+
* 1. Reconcile manual cards against stored card references and preserve authored slots.
|
|
157
|
+
* 2. Reconcile linked cards against resolved item counts while preserving card structure.
|
|
158
|
+
* 3. Normalize ids and clear stale `parentData` at the card and child-slot levels.
|
|
159
|
+
*/
|
|
160
|
+
type CardWithId = ComponentData<{
|
|
161
|
+
id?: string;
|
|
162
|
+
index?: number;
|
|
163
|
+
parentData?: unknown;
|
|
164
|
+
slots?: Record<string, Array<{
|
|
165
|
+
props?: Record<string, unknown>;
|
|
166
|
+
}>>;
|
|
167
|
+
}>;
|
|
168
|
+
/**
|
|
169
|
+
* Reconciles linked slot-backed cards against the resolved item list.
|
|
170
|
+
*
|
|
171
|
+
* 1. Grow or shrink the current card list to match the number of resolved
|
|
172
|
+
* linked items.
|
|
173
|
+
* 2. Preserve existing card instances when possible so slot-level styling and
|
|
174
|
+
* structure survive linked-data updates.
|
|
175
|
+
* 3. Update each card's index and card-level `parentData` so downstream card
|
|
176
|
+
* components can bind the resolved item into their internal slots.
|
|
177
|
+
*/
|
|
178
|
+
declare const syncLinkedSlotMappedCards: <TMappedItem, TCard extends CardWithId>({ items, currentCards, createCard, toParentData, normalizeId, }: {
|
|
179
|
+
items: TMappedItem[];
|
|
180
|
+
currentCards: TCard[];
|
|
181
|
+
createCard: (id: string, index: number) => TCard;
|
|
182
|
+
toParentData: (item: TMappedItem) => TCard["props"]["parentData"];
|
|
183
|
+
normalizeId?: (id: string) => string;
|
|
184
|
+
}) => (TCard & {
|
|
185
|
+
props: {
|
|
186
|
+
index: number;
|
|
187
|
+
parentData: TCard["props"]["parentData"];
|
|
188
|
+
id: string;
|
|
189
|
+
slots?: {
|
|
190
|
+
[x: string]: {
|
|
191
|
+
props?: {
|
|
192
|
+
[x: string]: unknown;
|
|
193
|
+
} | undefined;
|
|
194
|
+
}[];
|
|
195
|
+
} | undefined;
|
|
196
|
+
};
|
|
197
|
+
})[];
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Synchronizes specific style properties from the parent component to the child component's data.
|
|
201
|
+
* To be used in resolveData:(data, params) of child components.
|
|
202
|
+
*
|
|
203
|
+
* @param params - The parameters object containing the parent component's props.
|
|
204
|
+
* @param updatedData - The current data of the child component.
|
|
205
|
+
* @param keys - An array of style property keys to synchronize from the parent to the child.
|
|
206
|
+
* @returns The updated child component data with synchronized styles if changes were detected; otherwise, returns the original data.
|
|
207
|
+
*/
|
|
208
|
+
declare const syncParentStyles: (params: any, updatedData: any, keys: string[]) => any;
|
|
209
|
+
|
|
210
|
+
declare const resolveDirectoryListChildren: (streamDocument: StreamDocument, child: {
|
|
211
|
+
slug?: string;
|
|
212
|
+
}) => string | undefined;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Resolves the URL for a locator result from the stream document.
|
|
216
|
+
*/
|
|
217
|
+
declare function resolveLocatorResultUrl(profile: any, streamDocument: StreamDocument, relativePrefixToRoot?: string): string | undefined;
|
|
218
|
+
|
|
219
|
+
type Payload = Record<string, any>;
|
|
220
|
+
type Status = "success" | "error";
|
|
221
|
+
type PostMessage = {
|
|
222
|
+
payload: Payload;
|
|
223
|
+
};
|
|
224
|
+
type ReceivePayload = {
|
|
225
|
+
status: Status;
|
|
226
|
+
payload?: Payload;
|
|
227
|
+
};
|
|
228
|
+
type MessageStatus = Status | "pending";
|
|
229
|
+
type EventHandler = (respond: (data: ReceivePayload) => unknown, payload: Payload) => unknown;
|
|
230
|
+
declare const TARGET_ORIGINS: string[];
|
|
231
|
+
/**
|
|
232
|
+
* A hook that allows sending a postMessage from an iframe to its parent window. Additionally,
|
|
233
|
+
* it listens for a response from the parent (two way communication) to update its status.
|
|
234
|
+
* @param messageName - The message name to listen on
|
|
235
|
+
* @param targetOrigins - The origin urls the message can be posted to and received from
|
|
236
|
+
*/
|
|
237
|
+
declare const useSendMessageToParent: (messageName: string, targetOrigins: string[]) => {
|
|
238
|
+
sendToParent: (data?: PostMessage) => void;
|
|
239
|
+
status: MessageStatus;
|
|
240
|
+
};
|
|
241
|
+
/**
|
|
242
|
+
* A hook to receive a postMessage request, either in a parent window or an iframe. It is
|
|
243
|
+
* the receiving end for {@link useSendMessageToParent}.
|
|
244
|
+
* The eventHandler if fired when a message is received, which contains a payload and callback
|
|
245
|
+
* function. The receiver can choose to do something with the payload as well as send a
|
|
246
|
+
* status and payload back to the publisher.
|
|
247
|
+
* @param messageName - The message name to listen on
|
|
248
|
+
* @param targetOrigins - The origin urls the message can be posted to and received from
|
|
249
|
+
* @param eventHandler - The function that will be called when the event is triggered
|
|
250
|
+
*/
|
|
251
|
+
declare const useReceiveMessage: (messageName: string, targetOrigins: string[], eventHandler: EventHandler) => void;
|
|
252
|
+
|
|
253
|
+
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
254
|
+
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
255
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
256
|
+
declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
257
|
+
interface TooltipContentProps extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {
|
|
258
|
+
zoomWithViewport?: boolean;
|
|
259
|
+
}
|
|
260
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
261
|
+
|
|
262
|
+
interface ComponentErrorBoundaryProps {
|
|
263
|
+
children: React__default.ReactNode;
|
|
264
|
+
isEditing?: boolean;
|
|
265
|
+
resetKeys?: any[];
|
|
266
|
+
}
|
|
267
|
+
declare const ComponentErrorBoundary: ({ children, isEditing, resetKeys, }: ComponentErrorBoundaryProps) => React__default.JSX.Element;
|
|
268
|
+
|
|
269
|
+
type SectionLibraryVisualEditorProviderProps<T> = {
|
|
270
|
+
templateProps: T;
|
|
271
|
+
translationLoaders?: SectionLibraryTranslationLoaders;
|
|
272
|
+
entityFields?: StreamFields | null;
|
|
273
|
+
tailwindConfig?: TailwindConfig;
|
|
274
|
+
children: React__default.ReactNode;
|
|
275
|
+
};
|
|
276
|
+
declare const SectionLibraryVisualEditorProvider: <T extends Record<string, any>>({ templateProps, translationLoaders, entityFields, tailwindConfig, children, }: SectionLibraryVisualEditorProviderProps<T>) => React__default.JSX.Element;
|
|
277
|
+
|
|
278
|
+
declare const isVisualEditorTestEnv: () => boolean;
|
|
279
|
+
|
|
280
|
+
declare const presetImageIcons: Record<PresetImageType, React__default.ReactNode>;
|
|
281
|
+
|
|
282
|
+
export { CardContextProvider, ComponentErrorBoundary, Button as EditorButton, MapPinIcon, PresetImageType, SectionLibraryVisualEditorProvider, type SlotMappedCardWrapperType, StreamDocument, TARGET_ORIGINS, ThemeColor, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, VIEWPORT_BREAKPOINTS, forwardHeadingLevel, gatherSlotStyles, getRandomPlaceholderImageObject, getThemeValue, getValueFromQueryString, getViewport, isDirectoryGrid, isVisualEditorTestEnv, linkTypeOptions, presetImageIcons, resolveDirectoryListChildren, resolveLocatorResultUrl, sortAlphabetically, syncLinkedSlotMappedCards, syncParentStyles, useCardContext, useGetCardSlots, useParentCardStyles, usePreviewWindow, useReceiveMessage, useSendMessageToParent, useWindowWidth };
|