@yext/visual-editor 1.4.14 → 2.0.0-beta.10

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.
Files changed (234) hide show
  1. package/dist/SectionLibraryVisualEditorProvider-DN65KSX7.js +119824 -0
  2. package/dist/SectionLibraryVisualEditorProvider.css +1 -0
  3. package/dist/cli/assets/directory-locator-source/components/contentBlocks/Address.tsx +251 -0
  4. package/dist/cli/assets/directory-locator-source/components/contentBlocks/HeadingText.tsx +147 -0
  5. package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursStatus.tsx +157 -0
  6. package/dist/cli/assets/directory-locator-source/components/contentBlocks/HoursTable.tsx +164 -0
  7. package/dist/cli/assets/directory-locator-source/components/contentBlocks/MapboxStaticMap.tsx +205 -0
  8. package/dist/cli/assets/directory-locator-source/components/contentBlocks/Phone.tsx +155 -0
  9. package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/EmptyImageState.tsx +168 -0
  10. package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/Image.tsx +275 -0
  11. package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/styling.ts +66 -0
  12. package/dist/cli/assets/directory-locator-source/components/contentBlocks/index.ts +13 -0
  13. package/dist/cli/assets/directory-locator-source/components/sections/Breadcrumbs.tsx +298 -0
  14. package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.test.tsx +872 -0
  15. package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx +298 -0
  16. package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryCard.tsx +507 -0
  17. package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx +499 -0
  18. package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.test.tsx +226 -0
  19. package/dist/cli/assets/directory-locator-source/components/sections/directory/directoryChildReference.tsx +98 -0
  20. package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.test.tsx +147 -0
  21. package/dist/cli/assets/directory-locator-source/components/sections/locator/Filters.tsx +691 -0
  22. package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.test.tsx +1551 -0
  23. package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.tsx +541 -0
  24. package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorFields.test.ts +43 -0
  25. package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorResultCard.tsx +1594 -0
  26. package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorWrapper.tsx +1157 -0
  27. package/dist/cli/assets/directory-locator-source/components/sections/locator/Map.tsx +304 -0
  28. package/dist/cli/assets/directory-locator-source/components/sections/locator/MapPinIcon.tsx +160 -0
  29. package/dist/cli/assets/directory-locator-source/components/sections/locator/Results.tsx +267 -0
  30. package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +277 -0
  31. package/dist/cli/yextve.js +16992 -0
  32. package/dist/createYextFieldTransforms-CrIkiJ_X.d.ts +2157 -0
  33. package/dist/index.d.ts +534 -6352
  34. package/dist/locales/page/cs/visual-editor.json +85 -0
  35. package/dist/locales/page/da/visual-editor.json +73 -0
  36. package/dist/locales/page/de/visual-editor.json +73 -0
  37. package/dist/locales/page/en/visual-editor.json +73 -0
  38. package/dist/locales/page/en-GB/visual-editor.json +73 -0
  39. package/dist/locales/page/es/visual-editor.json +79 -0
  40. package/dist/locales/page/et/visual-editor.json +73 -0
  41. package/dist/locales/page/fi/visual-editor.json +73 -0
  42. package/dist/locales/page/fr/visual-editor.json +79 -0
  43. package/dist/locales/page/hr/visual-editor.json +79 -0
  44. package/dist/locales/page/hu/visual-editor.json +73 -0
  45. package/dist/locales/page/it/visual-editor.json +79 -0
  46. package/dist/locales/page/ja/visual-editor.json +73 -0
  47. package/dist/locales/page/lt/visual-editor.json +85 -0
  48. package/dist/locales/page/lv/visual-editor.json +77 -0
  49. package/dist/locales/page/nb/visual-editor.json +73 -0
  50. package/dist/locales/page/nl/visual-editor.json +73 -0
  51. package/dist/locales/page/pl/visual-editor.json +85 -0
  52. package/dist/locales/page/pt/visual-editor.json +79 -0
  53. package/dist/locales/page/ro/visual-editor.json +79 -0
  54. package/dist/locales/page/sk/visual-editor.json +85 -0
  55. package/dist/locales/page/sv/visual-editor.json +73 -0
  56. package/dist/locales/page/tr/visual-editor.json +73 -0
  57. package/dist/locales/page/zh/visual-editor.json +73 -0
  58. package/dist/locales/page/zh-TW/visual-editor.json +73 -0
  59. package/dist/locales/platform/cs/visual-editor.json +651 -0
  60. package/dist/locales/platform/da/visual-editor.json +625 -0
  61. package/dist/locales/platform/de/visual-editor.json +625 -0
  62. package/dist/locales/platform/en/visual-editor.json +625 -0
  63. package/dist/locales/platform/en-GB/visual-editor.json +625 -0
  64. package/dist/locales/platform/es/visual-editor.json +638 -0
  65. package/dist/locales/platform/et/visual-editor.json +625 -0
  66. package/dist/locales/platform/fi/visual-editor.json +625 -0
  67. package/dist/locales/platform/fr/visual-editor.json +638 -0
  68. package/dist/locales/platform/hr/visual-editor.json +638 -0
  69. package/dist/locales/platform/hu/visual-editor.json +625 -0
  70. package/dist/locales/platform/it/visual-editor.json +638 -0
  71. package/dist/locales/platform/ja/visual-editor.json +625 -0
  72. package/dist/locales/platform/lt/visual-editor.json +651 -0
  73. package/dist/locales/platform/lv/visual-editor.json +633 -0
  74. package/dist/locales/platform/nb/visual-editor.json +625 -0
  75. package/dist/locales/platform/nl/visual-editor.json +625 -0
  76. package/dist/locales/platform/pl/visual-editor.json +651 -0
  77. package/dist/locales/platform/pt/visual-editor.json +638 -0
  78. package/dist/locales/platform/ro/visual-editor.json +638 -0
  79. package/dist/locales/platform/sk/visual-editor.json +651 -0
  80. package/dist/locales/platform/sv/visual-editor.json +625 -0
  81. package/dist/locales/platform/tr/visual-editor.json +625 -0
  82. package/dist/locales/platform/zh/visual-editor.json +625 -0
  83. package/dist/locales/platform/zh-TW/visual-editor.json +625 -0
  84. package/dist/plugin/internal/layoutGeneration/limits.d.ts +28 -0
  85. package/dist/plugin/internal/sectionLibraryValidation/builtInTranslationResources.d.ts +3 -0
  86. package/dist/plugin/internal/sectionLibraryValidation/stages/api/api.d.ts +7 -0
  87. package/dist/plugin/internal/sectionLibraryValidation/stages/api/libraryMetadata.d.ts +7 -0
  88. package/dist/plugin/internal/sectionLibraryValidation/stages/code/importRules.d.ts +13 -0
  89. package/dist/plugin/internal/sectionLibraryValidation/stages/code/validateCode.d.ts +10 -0
  90. package/dist/plugin/internal/sectionLibraryValidation/stages/code/xssRules.d.ts +7 -0
  91. package/dist/plugin/internal/sectionLibraryValidation/stages/structure/structure.d.ts +7 -0
  92. package/dist/plugin/internal/sectionLibraryValidation/types.d.ts +48 -0
  93. package/dist/plugin/internal/sectionLibraryValidation/validateSectionLibrary.d.ts +8 -0
  94. package/dist/plugin/internal/sectionLibraryValidation/validationError.d.ts +6 -0
  95. package/dist/plugin/plugin.js +7013 -5873
  96. package/dist/plugin/types/entityFields.d.ts +21 -0
  97. package/dist/plugin/types/generationPrompts.d.ts +19 -0
  98. package/dist/plugin/types/generationSettings.d.ts +12 -0
  99. package/dist/plugin/types/images.d.ts +62 -0
  100. package/dist/plugin/types/sectionLibrary.d.ts +101 -0
  101. package/dist/plugin/types/types.d.ts +204 -0
  102. package/dist/plugin/types/videos.d.ts +24 -0
  103. package/dist/plugin/utils/i18n/locales.d.ts +5 -0
  104. package/dist/plugin/utils/i18n/translationResources.d.ts +41 -0
  105. package/dist/plugin/utils/normalizeLocale.d.ts +8 -0
  106. package/dist/plugin/utils/plainText.d.ts +6 -0
  107. package/dist/plugin/vite-plugin/index.d.ts +2 -0
  108. package/dist/plugin/vite-plugin/layout-generation/generationLogger.d.ts +5 -0
  109. package/dist/plugin/vite-plugin/layout-generation/generationReports.d.ts +13 -0
  110. package/dist/plugin/vite-plugin/layout-generation/middleware.d.ts +14 -0
  111. package/dist/plugin/vite-plugin/layout-generation/modelProxy.d.ts +9 -0
  112. package/dist/plugin/vite-plugin/layout-generation/prompts.d.ts +17 -0
  113. package/dist/plugin/vite-plugin/layout-generation/settings.d.ts +3 -0
  114. package/dist/plugin/vite-plugin/local-editor/artifacts.d.ts +20 -0
  115. package/dist/plugin/vite-plugin/local-editor/config.d.ts +11 -0
  116. package/dist/plugin/vite-plugin/local-editor/data.d.ts +12 -0
  117. package/dist/plugin/vite-plugin/local-editor/entityFields.d.ts +13 -0
  118. package/dist/plugin/vite-plugin/local-editor/fixtureData.d.ts +12 -0
  119. package/dist/plugin/vite-plugin/local-editor/generatedFiles.d.ts +33 -0
  120. package/dist/plugin/vite-plugin/local-editor/server.d.ts +34 -0
  121. package/dist/plugin/vite-plugin/local-editor/types.d.ts +125 -0
  122. package/dist/plugin/vite-plugin/local-editor/utils.d.ts +16 -0
  123. package/dist/plugin/vite-plugin/plugin.d.ts +8 -0
  124. package/dist/plugin/vite-plugin/section-library/migrationRegistry.d.ts +6 -0
  125. package/dist/plugin/vite-plugin/section-library/sectionFrontmatter.d.ts +3 -0
  126. package/dist/plugin/vite-plugin/section-library/sectionLibraryGenerator.d.ts +21 -0
  127. package/dist/plugin/vite-plugin/section-library/sharedComponentRegistry.d.ts +16 -0
  128. package/dist/section-library-support.js +178 -0
  129. package/dist/sectionLibrarySupport.d.ts +703 -0
  130. package/dist/style.css +1 -1
  131. package/dist/visual-editor-6mKs9VUe.js +842 -0
  132. package/dist/visual-editor-BK6fTU7k.js +804 -0
  133. package/dist/visual-editor-BXYlpe7B.js +145 -0
  134. package/dist/visual-editor-BruRrJYN.js +804 -0
  135. package/dist/visual-editor-Bs3wAslG.js +804 -0
  136. package/dist/visual-editor-Bxy81Ezy.js +145 -0
  137. package/dist/visual-editor-C0vq2BRM.js +145 -0
  138. package/dist/visual-editor-C9TLeAzP.js +804 -0
  139. package/dist/visual-editor-CCgmYV5S.js +169 -0
  140. package/dist/visual-editor-CERViyTJ.js +145 -0
  141. package/dist/visual-editor-CHWtMtlu.js +823 -0
  142. package/dist/visual-editor-CcfUKpnd.js +804 -0
  143. package/dist/visual-editor-CjORnP1D.js +169 -0
  144. package/dist/visual-editor-ClC6hoz3.js +804 -0
  145. package/dist/visual-editor-CmomGJB8.js +157 -0
  146. package/dist/visual-editor-CtQwadxQ.js +842 -0
  147. package/dist/visual-editor-Cymg8ID2.js +169 -0
  148. package/dist/visual-editor-D2Hk1nhM.js +145 -0
  149. package/dist/visual-editor-D7VeTRK_.js +816 -0
  150. package/dist/visual-editor-D8MRFn5x.js +157 -0
  151. package/dist/visual-editor-DOXtCqRv.js +145 -0
  152. package/dist/visual-editor-DQEd3xwY.js +145 -0
  153. package/dist/visual-editor-DTE5kxrA.js +804 -0
  154. package/dist/visual-editor-DUngIOnE.js +157 -0
  155. package/dist/visual-editor-DeZVZYfd.js +169 -0
  156. package/dist/visual-editor-DfJMZpiP.js +145 -0
  157. package/dist/visual-editor-DgAsQK9D.js +145 -0
  158. package/dist/visual-editor-Dhi__-7_.js +145 -0
  159. package/dist/visual-editor-DjTEbi-1.js +842 -0
  160. package/dist/visual-editor-DjdqpJU-.js +145 -0
  161. package/dist/visual-editor-DkHhrFsX.js +804 -0
  162. package/dist/visual-editor-DtL-Zuv_.js +804 -0
  163. package/dist/visual-editor-Duishbsa.js +842 -0
  164. package/dist/visual-editor-DvuH3jyL.js +157 -0
  165. package/dist/visual-editor-LXMNWXry.js +823 -0
  166. package/dist/visual-editor-QpGupjY5.js +823 -0
  167. package/dist/visual-editor-TfVDfO5_.js +145 -0
  168. package/dist/visual-editor-W_ZDmMFn.js +145 -0
  169. package/dist/visual-editor-_TatCCAS.js +804 -0
  170. package/dist/visual-editor-b7ALusk8.js +145 -0
  171. package/dist/visual-editor-erGXf3kS.js +157 -0
  172. package/dist/visual-editor-gEaWoNRu.js +804 -0
  173. package/dist/visual-editor-gjpr-NAN.js +804 -0
  174. package/dist/visual-editor-qJW0uCiQ.js +804 -0
  175. package/dist/visual-editor-sOPDMkOR.js +823 -0
  176. package/dist/visual-editor-tPb7n5l8.js +823 -0
  177. package/dist/visual-editor-vomNdlNO.js +804 -0
  178. package/dist/visual-editor-xnDHZFuO.js +153 -0
  179. package/dist/visual-editor-yiWZqIH0.js +157 -0
  180. package/dist/visual-editor-zKhC7_0C.js +823 -0
  181. package/dist/visual-editor.css +1 -0
  182. package/dist/visual-editor.js +18578 -137536
  183. package/package.json +50 -26
  184. package/dist/editor.css +0 -1
  185. package/dist/visual-editor-6pnSx-yp.js +0 -223
  186. package/dist/visual-editor-9ZW3nq5u.js +0 -247
  187. package/dist/visual-editor-B1RXDqNi.js +0 -1063
  188. package/dist/visual-editor-BAahiZ1l.js +0 -223
  189. package/dist/visual-editor-BC2LjdoF.js +0 -223
  190. package/dist/visual-editor-BPnfBfk1.js +0 -1051
  191. package/dist/visual-editor-BQiE5eVW.js +0 -1051
  192. package/dist/visual-editor-BTv-6Pnk.js +0 -1051
  193. package/dist/visual-editor-BUWp03gX.js +0 -235
  194. package/dist/visual-editor-Bb3c6iGV.js +0 -223
  195. package/dist/visual-editor-BipczqTj.js +0 -1075
  196. package/dist/visual-editor-BlIUd_n_.js +0 -1051
  197. package/dist/visual-editor-BoPLXEu2.js +0 -223
  198. package/dist/visual-editor-Bzmpi_9a.js +0 -1063
  199. package/dist/visual-editor-C38IiBTR.js +0 -235
  200. package/dist/visual-editor-C9tacnim.js +0 -247
  201. package/dist/visual-editor-CVa3iu5h.js +0 -1051
  202. package/dist/visual-editor-CXTL8Ik0.js +0 -1051
  203. package/dist/visual-editor-CYeahjFX.js +0 -231
  204. package/dist/visual-editor-CZ2SM6Jc.js +0 -1063
  205. package/dist/visual-editor-CZDmQI-A.js +0 -1063
  206. package/dist/visual-editor-C_cHJ6BN.js +0 -1051
  207. package/dist/visual-editor-Cf3nFbw3.js +0 -235
  208. package/dist/visual-editor-CiR0metz.js +0 -1051
  209. package/dist/visual-editor-CoX_NnS-.js +0 -223
  210. package/dist/visual-editor-Cu8II23Y.js +0 -223
  211. package/dist/visual-editor-CvXFxocc.js +0 -1063
  212. package/dist/visual-editor-Cxu6nkib.js +0 -1051
  213. package/dist/visual-editor-D-3VVfjR.js +0 -223
  214. package/dist/visual-editor-D-ktbg7q.js +0 -223
  215. package/dist/visual-editor-D9G5eAAU.js +0 -1051
  216. package/dist/visual-editor-D9MrqEya.js +0 -223
  217. package/dist/visual-editor-DAKXBbjV.js +0 -1075
  218. package/dist/visual-editor-DBmJk7ZR.js +0 -235
  219. package/dist/visual-editor-DG-c2LU9.js +0 -1051
  220. package/dist/visual-editor-DI_Vk989.js +0 -1051
  221. package/dist/visual-editor-DOOYgnjP.js +0 -235
  222. package/dist/visual-editor-DRx3Ax_O.js +0 -1075
  223. package/dist/visual-editor-DZ66sria.js +0 -1051
  224. package/dist/visual-editor-DZTPhYcr.js +0 -247
  225. package/dist/visual-editor-DcH7WJVI.js +0 -223
  226. package/dist/visual-editor-DdYXgEbR.js +0 -1059
  227. package/dist/visual-editor-DeWzgcue.js +0 -1063
  228. package/dist/visual-editor-Dm5ZNn8C.js +0 -223
  229. package/dist/visual-editor-DqLCIWPQ.js +0 -1051
  230. package/dist/visual-editor-NoU28r5Y.js +0 -223
  231. package/dist/visual-editor-WjrJ9nPc.js +0 -235
  232. package/dist/visual-editor-_h-sdbID.js +0 -223
  233. package/dist/visual-editor-r4gSQqFM.js +0 -1075
  234. package/dist/visual-editor-ujQ29mao.js +0 -247
@@ -0,0 +1,12 @@
1
+ import type { ResolvedLocalEditorLayoutConfig } from "./types.ts";
2
+ type FixtureDocument = Record<string, unknown>;
3
+ export declare const MAX_LOCAL_EDITOR_DIRECTORY_CHILD_COUNT = 100;
4
+ /**
5
+ * Builds local-only Directory and Locator documents for layouts that cannot
6
+ * get documents from `yext pages generate-test-data`.
7
+ */
8
+ export declare const createLocalEditorFixtureDocuments: (layouts: ResolvedLocalEditorLayoutConfig[], directoryChildCount?: number) => Array<{
9
+ layoutId: string;
10
+ document: FixtureDocument;
11
+ }>;
12
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { PageSetType } from "../../types/sectionLibrary.ts";
2
+ import type { LocalEditorStreamDefinition } from "./types.ts";
3
+ export declare const DEFAULT_LOCAL_EDITOR_STREAM_CONFIG_PATH = "stream.config.ts";
4
+ export declare const LOCAL_EDITOR_API_BASE_PATH = "/__yext_visual_editor/local-editor";
5
+ export declare const LOCAL_EDITOR_DATA_TEMPLATE_PREFIX = "local-editor-data-";
6
+ export declare const LEGACY_LOCAL_EDITOR_DATA_TEMPLATE_PATH = "src/templates/local-editor-data.tsx";
7
+ /**
8
+ * Builds the generated data-template name used for one local-editor template.
9
+ */
10
+ export declare const buildLocalEditorDataTemplateName: (layoutId: string) => string;
11
+ /**
12
+ * Returns the generated `src/templates/*.tsx` path for one local-editor data
13
+ * template.
14
+ */
15
+ export declare const buildLocalEditorDataTemplatePath: (layoutId: string) => string;
16
+ /**
17
+ * Resolves a local-editor file path against the consumer root when needed.
18
+ */
19
+ export declare const toAbsoluteLocalEditorPath: (rootDir: string, filePath: string) => string;
20
+ /**
21
+ * Creates the default Local Editor stream configuration when a starter does
22
+ * not provide one. The starter owns the generated file after this write.
23
+ */
24
+ export declare const ensureLocalEditorStreamConfig: (rootDir: string) => void;
25
+ /**
26
+ * Injects template-specific placeholders into generated local-editor data
27
+ * template source.
28
+ */
29
+ export declare const buildLocalEditorDataTemplateSource: (templateSource: string, stream: LocalEditorStreamDefinition | undefined, layoutId: string, pageSetType: PageSetType) => string;
30
+ /**
31
+ * Returns whether a template file was generated by the local-editor flow.
32
+ */
33
+ export declare const isGeneratedLocalEditorTemplate: (templatePath: string) => boolean;
@@ -0,0 +1,34 @@
1
+ import type { IncomingMessage } from "node:http";
2
+ import type { SectionLibraryLayout } from "../../types/sectionLibrary.ts";
3
+ type JsonResponseWriter = {
4
+ setHeader: (name: string, value: string) => void;
5
+ end: (chunk?: string) => void;
6
+ statusCode: number;
7
+ };
8
+ /**
9
+ * Handles requests for the local-editor JSON API endpoints.
10
+ *
11
+ * Returns whether the request was handled so the Vite middleware stack can
12
+ * fall through for non-local-editor routes.
13
+ */
14
+ export declare const handleLocalEditorRequest: (requestUrl: string, response: JsonResponseWriter, layouts: SectionLibraryLayout[]) => Promise<boolean>;
15
+ /**
16
+ * Writes a JSON response using the minimal response interface needed by the
17
+ * local-editor server hooks.
18
+ */
19
+ export declare const sendJsonResponse: (response: JsonResponseWriter, payload: unknown, statusCode?: number) => void;
20
+ type JsonRequestBody = {
21
+ ok: true;
22
+ payload: unknown;
23
+ bodyBytes: number;
24
+ } | {
25
+ ok: false;
26
+ status: 400 | 413;
27
+ bodyBytes: number;
28
+ parseError?: string;
29
+ };
30
+ /** Read parsed middleware bodies or bounded UTF-8 streams using the same limits. */
31
+ export declare const readJsonRequestBody: (request: IncomingMessage & {
32
+ body?: unknown;
33
+ }, maxBytes: number) => Promise<JsonRequestBody>;
34
+ export {};
@@ -0,0 +1,125 @@
1
+ import type { GenerationSettings } from "../../types/generationSettings.ts";
2
+ import type { YextSchemaField } from "../../types/entityFields.ts";
3
+ import type { PageSetType } from "../../types/sectionLibrary.ts";
4
+ export type LocalEditorOptions = {
5
+ enabled?: boolean;
6
+ /** Enables layout generation and its local logs. Defaults to false. */
7
+ layoutGenerationEnabled?: boolean;
8
+ /** Model used by the local json-render generation endpoint. */
9
+ generationModel?: string;
10
+ /** Override local generation limits; omitted values retain the local defaults. */
11
+ generationSettings?: {
12
+ attemptTimeoutMs?: GenerationSettings["attemptTimeoutMs"];
13
+ maxOutputTokens?: Partial<GenerationSettings["maxOutputTokens"]>;
14
+ };
15
+ /**
16
+ * Path to the TypeScript prompt bundle in your ALPHA checkout, absolute or relative
17
+ * to the Vite root. Required for local AI generation.
18
+ */
19
+ generationPromptsPath?: string;
20
+ };
21
+ type LocalEditorDefaults = {
22
+ layoutId?: string;
23
+ locale?: string;
24
+ entityId?: string;
25
+ };
26
+ type LocalEditorStreamField = string | {
27
+ name: string;
28
+ fullObject?: boolean;
29
+ };
30
+ export type LocalEditorStreamDefinition = {
31
+ fields?: LocalEditorStreamField[];
32
+ } & Record<string, unknown>;
33
+ export type LocalEditorPagesStream = {
34
+ $id?: string;
35
+ fields: string[];
36
+ filter?: {
37
+ entityIds?: string[];
38
+ entityTypes?: string[];
39
+ savedFilterIds?: string[];
40
+ };
41
+ localization?: {
42
+ locales?: string[];
43
+ primary?: true;
44
+ };
45
+ };
46
+ export type LocalEditorLayoutConfig = {
47
+ defaults?: Omit<LocalEditorDefaults, "layoutId">;
48
+ stream?: LocalEditorStreamDefinition;
49
+ };
50
+ export type LocalEditorConfig = {
51
+ defaults?: LocalEditorDefaults;
52
+ /** Environment values injected into every local-editor stream document. */
53
+ env?: Record<string, string>;
54
+ pageSetTypes?: Partial<Record<PageSetType, LocalEditorLayoutConfig>>;
55
+ layouts?: Record<string, LocalEditorLayoutConfig>;
56
+ };
57
+ export type LocalEditorLayoutDefaults = {
58
+ entityId?: string;
59
+ locale?: string;
60
+ defaultLayoutData?: unknown;
61
+ };
62
+ export type ResolvedLocalEditorLayoutConfig = {
63
+ layoutId: string;
64
+ dataTemplateName: string;
65
+ pageSetType: PageSetType;
66
+ dataSource: "stream" | "fixture";
67
+ defaults: Omit<LocalEditorDefaults, "layoutId">;
68
+ stream?: LocalEditorStreamDefinition;
69
+ defaultLayoutData?: unknown;
70
+ };
71
+ export type LocalEditorDocumentIndexEntry = {
72
+ layoutId: string;
73
+ entityId: string;
74
+ displayName: string;
75
+ locale: string;
76
+ filePath?: string;
77
+ fileName: string;
78
+ document?: Record<string, unknown>;
79
+ };
80
+ export type LocalEditorEntityOption = {
81
+ entityId: string;
82
+ displayName: string;
83
+ locales: string[];
84
+ };
85
+ export type LocalEditorManifestResponse = {
86
+ layouts: string[];
87
+ pageSetTypeByLayout: Record<string, PageSetType>;
88
+ dataSourceByLayout: Record<string, "stream" | "fixture">;
89
+ entitiesByLayout: Record<string, LocalEditorEntityOption[]>;
90
+ layoutDefaults: Record<string, LocalEditorLayoutDefaults>;
91
+ defaults: LocalEditorDefaults;
92
+ diagnostics: string[];
93
+ streamConfigPath: string;
94
+ localDataPath: string;
95
+ };
96
+ export type LocalEditorDocumentResponse = {
97
+ document: Record<string, unknown> | null;
98
+ /** Whether a Locator document uses built-in fixture data or real Search. */
99
+ locatorDataSource?: "fixture" | "real";
100
+ entityFields: {
101
+ fields: YextSchemaField[];
102
+ displayNames: Record<string, string>;
103
+ };
104
+ diagnostics: string[];
105
+ };
106
+ export type LocalEditorContext = {
107
+ diagnostics: string[];
108
+ streamConfigPath: string;
109
+ localDataPath: string;
110
+ layouts: string[];
111
+ defaults: LocalEditorDefaults;
112
+ env: Record<string, string>;
113
+ layoutDefaults: Record<string, LocalEditorLayoutDefaults>;
114
+ layoutStreams: Record<string, LocalEditorStreamDefinition | undefined>;
115
+ pageSetTypeByLayout: Record<string, PageSetType>;
116
+ dataSourceByLayout: Record<string, "stream" | "fixture">;
117
+ entitiesByLayout: Record<string, LocalEditorEntityOption[]>;
118
+ documents: LocalEditorDocumentIndexEntry[];
119
+ };
120
+ export type ResolvedLocalEditorConfig = {
121
+ defaults: LocalEditorDefaults;
122
+ env: Record<string, string>;
123
+ layouts: ResolvedLocalEditorLayoutConfig[];
124
+ };
125
+ export {};
@@ -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 type { 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,3 @@
1
+ import { type SectionConfig } from "../../types/sectionLibrary.ts";
2
+ /** Reads the static SectionConfig metadata from one section source file. */
3
+ export declare const extractSectionConfigFrontmatter: (sourcePath: string, componentName: string) => SectionConfig;
@@ -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,178 @@
1
+ import { ck as b, cn as C, cl as h, cm as y, c0 as E, d2 as P, by as v, cu as I, bI as A, c6 as F, bt as L, cr as M, ca as f, cX as D, cZ as x, c_ as O, cY as V, aK as R, d8 as Z, d9 as k, bH as w, b6 as B, cO as Y, bK as G, bL as W, bM as _, bP as H, dU as N, cA as U, bO as z, cM as K, c4 as $, bT as j, d0 as Q, T as X, c1 as q, bk as J, dp as ee, dq as ae, ax as se, aA as te, az as oe, aw as re, ay as ne, dV as ie, dt as le, bU as ce, aI as de, dx as pe, dW as me, dX as ge, bE as ue, bX as Se, cs as Te, dB as be, dY as Ce, U as he, cC as ye, cB as Ee, c3 as Pe, b5 as ve, dZ as Ie, b$ as Ae, d_ as Fe, d$ as Le, c$ as Me, f as fe, cc as De, e0 as xe, cd as Oe, e1 as Ve, ci as Re, co as Ze, e2 as ke, e3 as we, cK as Be, e4 as Ye, ct as Ge, dI as We, cb as _e, e5 as He, ch as Ne, cg as Ue, bx as ze, bS as Ke, cF as $e, dL as je, e6 as Qe, e7 as Xe, e8 as qe, bN as Je, e9 as ea, ea as aa, bJ as sa, bV as ta, bQ as oa, cG as ra, eb as na, cz as ia, ec as la, ed as ca, m as da, aD as pa, dN as ma, j as ga, ee as ua, Y as Sa, g as Ta, ef as ba, bG as Ca, bF as ha, c5 as ya, eg as Ea, eh as Pa, bR as va, cq as Ia, d as Aa, c as Fa, ei as La, ej as Ma, bW as fa, c2 as Da, bD as xa, dS as Oa, cH as Va, cI as Ra, c9 as Za, ek as ka, el as wa, bw as Ba, bZ as Ya, aF as Ga, av as Wa, b_ as _a, em as Ha, cD as Na, u as Ua, aG as za, c7 as Ka, bY as $a, cE as ja, en as Qa, eo as Xa } from "./SectionLibraryVisualEditorProvider-DN65KSX7.js";
2
+ import { setDeep as c } from "@puckeditor/core";
3
+ function m(a, e) {
4
+ return d(e)[a] ?? null;
5
+ }
6
+ const d = (a) => a.substring(1).split("&").map((e) => e.split("=")).reduce((e, s) => s.length === 2 ? {
7
+ ...e,
8
+ [s[0]]: decodeURIComponent(s[1].replace(/\+/g, "%20"))
9
+ } : e, {}), g = (a, e) => {
10
+ const s = a.props.slots.SectionHeadingSlot?.[0]?.props?.styles?.level, t = a.props.slots.CardsWrapperSlot?.[0]?.props?.slots?.CardSlot, o = s < 6 ? s + 1 : "span";
11
+ return t && (a.props.slots.CardsWrapperSlot[0].props.slots.CardSlot = t.map(
12
+ (r) => r.props.slots?.[e]?.[0]?.props ? c(
13
+ r,
14
+ `props.slots.${e}[0].props.styles.semanticLevelOverride`,
15
+ o
16
+ ) : r
17
+ )), a;
18
+ }, u = (a, e, s) => {
19
+ const t = a.parent?.props.styles || {}, o = e.props.parentStyles || {};
20
+ if (s.some(
21
+ (n) => t[n] !== o[n]
22
+ )) {
23
+ const n = s.reduce(
24
+ (i, l) => (i[l] = t[l], i),
25
+ { ...o }
26
+ );
27
+ return c(e, "props.parentStyles", n);
28
+ }
29
+ return e;
30
+ };
31
+ export {
32
+ b as Accordion,
33
+ C as AccordionContent,
34
+ h as AccordionItem,
35
+ y as AccordionTrigger,
36
+ E as Background,
37
+ P as BackgroundProvider,
38
+ v as Body,
39
+ I as Button,
40
+ A as CTA,
41
+ F as CardContextProvider,
42
+ L as ComponentErrorBoundary,
43
+ M as ConstantValueModeToggler,
44
+ f as DEFAULT_ENTITY_TYPE,
45
+ D as DropdownMenu,
46
+ x as DropdownMenuContent,
47
+ O as DropdownMenuItem,
48
+ V as DropdownMenuTrigger,
49
+ R as EditorButton,
50
+ Z as EmbeddedFieldStringInputFromEntity,
51
+ k as EmbeddedFieldStringInputFromOptions,
52
+ w as EntityField,
53
+ B as EntityTooltipsProvider,
54
+ Y as FOOD_DELIVERY_SERVICES,
55
+ G as Heading,
56
+ W as HoursStatusAtom,
57
+ _ as HoursTableAtom,
58
+ H as Image,
59
+ N as LOCATOR_ENTITY_TYPES,
60
+ U as MapPinIcon,
61
+ z as MaybeLink,
62
+ K as MaybeRTF,
63
+ $ as PageSection,
64
+ j as PhoneAtom,
65
+ Q as SectionLibraryVisualEditorProvider,
66
+ X as TARGET_ORIGINS,
67
+ q as TemplatePropsContext,
68
+ J as ThemeOptions,
69
+ ee as TimestampAtom,
70
+ ae as TimestampOption,
71
+ se as Tooltip,
72
+ te as TooltipArrow,
73
+ oe as TooltipContent,
74
+ re as TooltipProvider,
75
+ ne as TooltipTrigger,
76
+ ie as VIEWPORT_BREAKPOINTS,
77
+ le as VideoAtom,
78
+ ce as VisibilityWrapper,
79
+ de as YextAutoField,
80
+ pe as YextEntityFieldSelector,
81
+ me as assetImageZodSchema,
82
+ ge as backgroundColorZodSchema,
83
+ ue as backgroundColors,
84
+ Se as bindSlots,
85
+ Te as buildLocatorDisplayOptions,
86
+ be as buttonVariants,
87
+ Ce as comprehensiveCtaZodSchema,
88
+ he as createPuckGenerationCatalog,
89
+ ye as createSearchAnalyticsConfig,
90
+ Ee as createSearchHeadlessConfig,
91
+ Pe as createSlottedItemSource,
92
+ ve as createYextFieldTransforms,
93
+ Ie as ctaSelectorZodSchema,
94
+ Ae as deepMerge,
95
+ Fe as enhancedCtaZodSchema,
96
+ Le as entityFieldZodSchema,
97
+ Me as fetchLocalesToPathsForEntity,
98
+ fe as findField,
99
+ De as formatDistance,
100
+ xe as formatPhoneNumber,
101
+ g as forwardHeadingLevel,
102
+ Oe as fromMeters,
103
+ Ve as gatherSlotStyles,
104
+ Re as getBackgroundColorClasses,
105
+ Ze as getBackgroundColorStyle,
106
+ ke as getCTAType,
107
+ we as getDisplayValue,
108
+ Be as getEntityTypeLabel,
109
+ Ye as getImageAltText,
110
+ Ge as getLocatorEntityTypeSourceMap,
111
+ We as getPageMetadata,
112
+ _e as getPreferredDistanceUnit,
113
+ He as getRandomPlaceholderImageObject,
114
+ Ne as getTextColorClass,
115
+ Ue as getTextColorStyle,
116
+ ze as getThemeColorCssValue,
117
+ Ke as getThemeValue,
118
+ m as getValueFromQueryString,
119
+ $e as getViewport,
120
+ je as headingVariants,
121
+ Qe as hexToRGB,
122
+ Xe as hoursZodSchema,
123
+ qe as imageZodSchema,
124
+ Je as imgSizesHelper,
125
+ ea as inferFieldZodSchema,
126
+ aa as isColorContrastWcagCompliant,
127
+ sa as isCtaVariantWithColor,
128
+ ta as isDirectoryGrid,
129
+ oa as isLocalizedAssetImage,
130
+ ra as isLocatorEntityType,
131
+ na as isNonNormalizableLinkType,
132
+ ia as isVisualEditorTestEnv,
133
+ la as linkTypeOptions,
134
+ ca as loadTranslationDictionary,
135
+ da as mergeMeta,
136
+ pa as msg,
137
+ ma as normalizeLink,
138
+ ga as normalizeSlug,
139
+ ua as presetImageIcons,
140
+ Sa as pt,
141
+ Ta as resolveBreadcrumbs,
142
+ ba as resolveCanonicalSelectorGroups,
143
+ Ca as resolveComponentData,
144
+ ha as resolveDataFromParent,
145
+ ya as resolveDirectoryListChildren,
146
+ Ea as resolveDirectoryRootProps,
147
+ Pa as resolveField,
148
+ va as resolveLocalizedAssetImage,
149
+ Ia as resolveLocatorResultUrl,
150
+ Aa as resolveUrlTemplate,
151
+ Fa as resolveUrlTemplateOfChild,
152
+ La as richTextZodSchema,
153
+ Ma as siteColorZodSchema,
154
+ fa as sortAlphabetically,
155
+ Da as syncLinkedSlotMappedCards,
156
+ u as syncParentStyles,
157
+ xa as themeManagerCn,
158
+ Oa as toKilometers,
159
+ Va as toMeters,
160
+ Ra as toMiles,
161
+ Za as toPuckFields,
162
+ ka as translatableRichTextZodSchema,
163
+ wa as translatableStringZodSchema,
164
+ Ba as useBackground,
165
+ Ya as useCardContext,
166
+ Ga as useDocument,
167
+ Wa as useEntityTooltips,
168
+ _a as useGetCardSlots,
169
+ Ha as useParentCardStyles,
170
+ Na as usePreviewWindow,
171
+ Ua as useReceiveMessage,
172
+ za as useSendMessageToParent,
173
+ Ka as useTemplateMetadata,
174
+ $a as useTemplateProps,
175
+ ja as useWindowWidth,
176
+ Qa as widthZodSchema,
177
+ Xa as withGenerationCatalog
178
+ };