@yext/visual-editor 2.0.0-beta.6 → 2.0.0-beta.8
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-D48NB__d.js → SectionLibraryVisualEditorProvider-B4oMQHkI.js} +37301 -28992
- package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx +39 -1
- package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx +13 -5
- package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +9 -0
- package/dist/cli/yextve.js +17 -3
- package/dist/{locatorEntityTypes-Cx069o6O.d.ts → createYextFieldTransforms-CPEwasy9.d.ts} +299 -27
- package/dist/index.d.ts +38 -67
- package/dist/locales/platform/cs/visual-editor.json +120 -0
- package/dist/locales/platform/da/visual-editor.json +106 -0
- package/dist/locales/platform/de/visual-editor.json +106 -0
- package/dist/locales/platform/en/visual-editor.json +106 -0
- package/dist/locales/platform/en-GB/visual-editor.json +106 -0
- package/dist/locales/platform/es/visual-editor.json +113 -0
- package/dist/locales/platform/et/visual-editor.json +106 -0
- package/dist/locales/platform/fi/visual-editor.json +106 -0
- package/dist/locales/platform/fr/visual-editor.json +113 -0
- package/dist/locales/platform/hr/visual-editor.json +113 -0
- package/dist/locales/platform/hu/visual-editor.json +106 -0
- package/dist/locales/platform/it/visual-editor.json +113 -0
- package/dist/locales/platform/ja/visual-editor.json +106 -0
- package/dist/locales/platform/lt/visual-editor.json +120 -0
- package/dist/locales/platform/lv/visual-editor.json +110 -0
- package/dist/locales/platform/nb/visual-editor.json +106 -0
- package/dist/locales/platform/nl/visual-editor.json +106 -0
- package/dist/locales/platform/pl/visual-editor.json +120 -0
- package/dist/locales/platform/pt/visual-editor.json +113 -0
- package/dist/locales/platform/ro/visual-editor.json +113 -0
- package/dist/locales/platform/sk/visual-editor.json +120 -0
- package/dist/locales/platform/sv/visual-editor.json +106 -0
- package/dist/locales/platform/tr/visual-editor.json +106 -0
- package/dist/locales/platform/zh/visual-editor.json +106 -0
- package/dist/locales/platform/zh-TW/visual-editor.json +106 -0
- package/dist/plugin/internal/layoutGeneration/limits.d.ts +28 -0
- package/dist/plugin/plugin.js +6795 -2063
- package/dist/plugin/types/generationPrompts.d.ts +19 -0
- package/dist/plugin/types/generationSettings.d.ts +12 -0
- package/dist/plugin/types/sectionLibrary.d.ts +11 -4
- package/dist/plugin/vite-plugin/layout-generation/generationLogger.d.ts +5 -0
- package/dist/plugin/vite-plugin/layout-generation/generationReports.d.ts +13 -0
- package/dist/plugin/vite-plugin/layout-generation/middleware.d.ts +14 -0
- package/dist/plugin/vite-plugin/layout-generation/modelProxy.d.ts +9 -0
- package/dist/plugin/vite-plugin/layout-generation/prompts.d.ts +17 -0
- package/dist/plugin/vite-plugin/layout-generation/settings.d.ts +3 -0
- package/dist/plugin/vite-plugin/local-editor/artifacts.d.ts +4 -2
- package/dist/plugin/vite-plugin/local-editor/data.d.ts +2 -0
- package/dist/plugin/vite-plugin/local-editor/generatedFiles.d.ts +2 -3
- package/dist/plugin/vite-plugin/local-editor/server.d.ts +17 -1
- package/dist/plugin/vite-plugin/local-editor/types.d.ts +18 -2
- package/dist/plugin/vite-plugin/plugin.d.ts +1 -1
- package/dist/section-library-support.js +122 -118
- package/dist/sectionLibrarySupport.d.ts +61 -4
- package/dist/visual-editor-6mKs9VUe.js +842 -0
- package/dist/{visual-editor-DC1pCUtq.js → visual-editor-BK6fTU7k.js} +335 -228
- package/dist/{visual-editor-BKK2RKRg.js → visual-editor-BruRrJYN.js} +342 -235
- package/dist/visual-editor-Bs3wAslG.js +804 -0
- package/dist/{visual-editor-aXXSZO_i.js → visual-editor-C9TLeAzP.js} +355 -248
- package/dist/{visual-editor-bEaD2J5r.js → visual-editor-CHWtMtlu.js} +364 -250
- package/dist/{visual-editor-EZ39Q-Cf.js → visual-editor-CcfUKpnd.js} +346 -239
- package/dist/visual-editor-ClC6hoz3.js +804 -0
- package/dist/visual-editor-CtQwadxQ.js +842 -0
- package/dist/{visual-editor-Dpc4OfjE.js → visual-editor-D7VeTRK_.js} +358 -247
- package/dist/{visual-editor-DM0HkCii.js → visual-editor-DTE5kxrA.js} +351 -244
- package/dist/{visual-editor-5YEXG9DH.js → visual-editor-DjTEbi-1.js} +370 -249
- package/dist/{visual-editor-DKurZtUt.js → visual-editor-DkHhrFsX.js} +341 -234
- package/dist/visual-editor-DtL-Zuv_.js +804 -0
- package/dist/visual-editor-Duishbsa.js +842 -0
- package/dist/visual-editor-LXMNWXry.js +823 -0
- package/dist/visual-editor-QpGupjY5.js +823 -0
- package/dist/visual-editor-_TatCCAS.js +804 -0
- package/dist/{visual-editor-BQsdxhUz.js → visual-editor-gEaWoNRu.js} +352 -245
- package/dist/{visual-editor-1L5yvx9x.js → visual-editor-gjpr-NAN.js} +358 -251
- package/dist/{visual-editor-BZSN_IFr.js → visual-editor-qJW0uCiQ.js} +366 -259
- package/dist/visual-editor-sOPDMkOR.js +823 -0
- package/dist/visual-editor-tPb7n5l8.js +823 -0
- package/dist/visual-editor-vomNdlNO.js +804 -0
- package/dist/visual-editor-zKhC7_0C.js +823 -0
- package/dist/visual-editor.css +1 -1
- package/dist/visual-editor.js +12865 -9706
- package/package.json +6 -3
- package/dist/visual-editor-7MhH35_G.js +0 -709
- package/dist/visual-editor-BZiKZha2.js +0 -709
- package/dist/visual-editor-C3JS3OQU.js +0 -697
- package/dist/visual-editor-CGPLMAQn.js +0 -721
- package/dist/visual-editor-CIo2noVV.js +0 -709
- package/dist/visual-editor-CX5aaC7B.js +0 -709
- package/dist/visual-editor-CZouujLr.js +0 -697
- package/dist/visual-editor-CdwYNJ-y.js +0 -721
- package/dist/visual-editor-CwLtLH7t.js +0 -697
- package/dist/visual-editor-HIaH9B9G.js +0 -697
- package/dist/visual-editor-J0zs1Agv.js +0 -721
- package/dist/visual-editor-SYachtCo.js +0 -709
- package/dist/visual-editor-VsL3_PCS.js +0 -697
package/dist/cli/assets/directory-locator-source/components/sections/directory/Directory.tsx
CHANGED
|
@@ -35,6 +35,13 @@ export interface DirectoryStyles {
|
|
|
35
35
|
* The color of links in the directory list layout.
|
|
36
36
|
*/
|
|
37
37
|
linkColor?: ThemeColor;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The casing of directory list labels. Default uses the link theme transform,
|
|
41
|
+
* falling back to title case.
|
|
42
|
+
* @defaultValue default
|
|
43
|
+
*/
|
|
44
|
+
textTransform?: "none" | "default" | "lowercase" | "uppercase" | "capitalize";
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
export interface DirectoryProps {
|
|
@@ -81,6 +88,26 @@ const directoryFields: YextFields<DirectoryProps> = {
|
|
|
81
88
|
label: msg("fields.linkColor", "Link Color"),
|
|
82
89
|
options: "SITE_COLOR",
|
|
83
90
|
},
|
|
91
|
+
textTransform: {
|
|
92
|
+
type: "select",
|
|
93
|
+
label: msg("theme.textTransform.textTransform", "Text Transform"),
|
|
94
|
+
options: [
|
|
95
|
+
{ label: msg("fields.options.none", "None"), value: "none" },
|
|
96
|
+
{ label: msg("fields.options.default", "Default"), value: "default" },
|
|
97
|
+
{
|
|
98
|
+
label: msg("theme.textTransform.lowercase", "Lowercase"),
|
|
99
|
+
value: "lowercase",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: msg("theme.textTransform.uppercase", "Uppercase"),
|
|
103
|
+
value: "uppercase",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: msg("theme.textTransform.capitalize", "Capitalize"),
|
|
107
|
+
value: "capitalize",
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
84
111
|
},
|
|
85
112
|
},
|
|
86
113
|
slots: {
|
|
@@ -130,6 +157,7 @@ const DirectoryComponent: PuckComponent<DirectoryProps> = ({
|
|
|
130
157
|
directoryChildren={streamDocument.dm_directoryChildren}
|
|
131
158
|
relativePrefixToRoot={relativePrefixToRoot ?? ""}
|
|
132
159
|
linkColor={styles.linkColor}
|
|
160
|
+
textTransform={styles.textTransform}
|
|
133
161
|
backgroundColor={styles.listBackgroundColor}
|
|
134
162
|
/>
|
|
135
163
|
)}
|
|
@@ -157,8 +185,17 @@ export const Directory: YextComponentConfig<DirectoryProps> = {
|
|
|
157
185
|
"styles.objectFields.listBackgroundColor.visible",
|
|
158
186
|
false
|
|
159
187
|
);
|
|
188
|
+
const listFieldsHidden = setDeep(
|
|
189
|
+
updatedFields,
|
|
190
|
+
"styles.objectFields.linkColor.visible",
|
|
191
|
+
false
|
|
192
|
+
);
|
|
160
193
|
return toPuckFields(
|
|
161
|
-
setDeep(
|
|
194
|
+
setDeep(
|
|
195
|
+
listFieldsHidden,
|
|
196
|
+
"styles.objectFields.textTransform.visible",
|
|
197
|
+
false
|
|
198
|
+
)
|
|
162
199
|
);
|
|
163
200
|
}
|
|
164
201
|
return toPuckFields(directoryFields);
|
|
@@ -167,6 +204,7 @@ export const Directory: YextComponentConfig<DirectoryProps> = {
|
|
|
167
204
|
styles: {
|
|
168
205
|
backgroundColor: backgroundColors.background1.value,
|
|
169
206
|
listBackgroundColor: backgroundColors.background1.value,
|
|
207
|
+
textTransform: "default",
|
|
170
208
|
},
|
|
171
209
|
slots: {
|
|
172
210
|
TitleSlot: [
|
package/dist/cli/assets/directory-locator-source/components/sections/directory/DirectoryWrapper.tsx
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
TooltipTrigger,
|
|
47
47
|
} from "../../../internal/puck/ui/Tooltip.tsx";
|
|
48
48
|
import { FaInfoCircle } from "react-icons/fa";
|
|
49
|
+
import type { DirectoryStyles } from "./Directory.tsx";
|
|
49
50
|
import { useTemplateMetadata } from "../../../internal/hooks/useMessageReceivers.ts";
|
|
50
51
|
|
|
51
52
|
export type DirectoryGridProps = {
|
|
@@ -239,6 +240,7 @@ export const DirectoryList = ({
|
|
|
239
240
|
relativePrefixToRoot,
|
|
240
241
|
backgroundColor,
|
|
241
242
|
linkColor,
|
|
243
|
+
textTransform = "default",
|
|
242
244
|
}: {
|
|
243
245
|
streamDocument: StreamDocument;
|
|
244
246
|
directoryChildren: {
|
|
@@ -256,6 +258,7 @@ export const DirectoryList = ({
|
|
|
256
258
|
relativePrefixToRoot: string;
|
|
257
259
|
backgroundColor: ThemeColor;
|
|
258
260
|
linkColor?: ThemeColor;
|
|
261
|
+
textTransform?: DirectoryStyles["textTransform"];
|
|
259
262
|
}) => {
|
|
260
263
|
const sortedDirectoryChildren = sortAlphabetically(
|
|
261
264
|
[...directoryChildren],
|
|
@@ -264,8 +267,14 @@ export const DirectoryList = ({
|
|
|
264
267
|
const linkTextTransformValue = (
|
|
265
268
|
getThemeValue("--textTransform-link-textTransform", streamDocument) ?? ""
|
|
266
269
|
).toLowerCase();
|
|
267
|
-
const
|
|
268
|
-
|
|
270
|
+
const resolvedTextTransform =
|
|
271
|
+
textTransform === "default"
|
|
272
|
+
? !linkTextTransformValue ||
|
|
273
|
+
linkTextTransformValue === "none" ||
|
|
274
|
+
linkTextTransformValue === "normal"
|
|
275
|
+
? "capitalize"
|
|
276
|
+
: "var(--textTransform-link-textTransform)"
|
|
277
|
+
: textTransform;
|
|
269
278
|
|
|
270
279
|
return (
|
|
271
280
|
<PageSection verticalPadding="sm" background={backgroundColor}>
|
|
@@ -301,9 +310,8 @@ export const DirectoryList = ({
|
|
|
301
310
|
>
|
|
302
311
|
<Body
|
|
303
312
|
style={{
|
|
304
|
-
textTransform:
|
|
305
|
-
|
|
306
|
-
: ("var(--textTransform-link-textTransform)" as React.CSSProperties["textTransform"]),
|
|
313
|
+
textTransform:
|
|
314
|
+
resolvedTextTransform as React.CSSProperties["textTransform"],
|
|
307
315
|
}}
|
|
308
316
|
>
|
|
309
317
|
{label}
|
|
@@ -100,6 +100,8 @@ export {
|
|
|
100
100
|
toPuckFields,
|
|
101
101
|
type YextArrayField,
|
|
102
102
|
type YextComponentConfig,
|
|
103
|
+
type YextTransformedProps,
|
|
104
|
+
type ResolvedComprehensiveCTAValue,
|
|
103
105
|
type YextCustomFieldRenderProps,
|
|
104
106
|
type YextFieldDefinition,
|
|
105
107
|
type YextFieldMap,
|
|
@@ -108,6 +110,8 @@ export {
|
|
|
108
110
|
type YextPuckField,
|
|
109
111
|
} from "./fields/fields.ts";
|
|
110
112
|
export { YextAutoField } from "./fields/YextAutoField.tsx";
|
|
113
|
+
export { MaybeRTF } from "./components/helpers/maybeRTF.tsx";
|
|
114
|
+
export { createYextFieldTransforms } from "./fields/fieldTransforms/index.ts";
|
|
111
115
|
export { BackgroundProvider, useBackground } from "./hooks/useBackground.tsx";
|
|
112
116
|
export {
|
|
113
117
|
CardContextProvider,
|
|
@@ -243,3 +247,8 @@ export { loadTranslationDictionary } from "./utils/i18n/translationResources.ts"
|
|
|
243
247
|
export { isVisualEditorTestEnv } from "./components/testing/utils.ts";
|
|
244
248
|
export { fetchLocalesToPathsForEntity } from "./utils/api/fetchLocalesToPathsForEntity.ts";
|
|
245
249
|
export { presetImageIcons } from "./utils/presetImageIcons.tsx";
|
|
250
|
+
export {
|
|
251
|
+
createPuckGenerationCatalog,
|
|
252
|
+
withGenerationCatalog,
|
|
253
|
+
} from "./utils/createPuckGenerationCatalog.ts";
|
|
254
|
+
export type { LayoutGenerationMetadata as ComponentGenerationMetadata } from "./fields/fields.ts";
|
package/dist/cli/yextve.js
CHANGED
|
@@ -12231,7 +12231,7 @@ import { fileURLToPath as fileURLToPath3 } from "url";
|
|
|
12231
12231
|
var package_default = {
|
|
12232
12232
|
name: "@yext/visual-editor",
|
|
12233
12233
|
description: "Component library for Yext Pages Visual Editor",
|
|
12234
|
-
version: "2.0.0-beta.
|
|
12234
|
+
version: "2.0.0-beta.8",
|
|
12235
12235
|
author: "sprumo@yext.com",
|
|
12236
12236
|
repository: {
|
|
12237
12237
|
type: "git",
|
|
@@ -12281,6 +12281,7 @@ var package_default = {
|
|
|
12281
12281
|
"build:cli": "tsup --config tsup.config.ts",
|
|
12282
12282
|
build: "pnpm run build:components && pnpm run build:plugin && pnpm run build:cli",
|
|
12283
12283
|
test: "pnpm run test:editor && pnpm run test:components",
|
|
12284
|
+
"test:pageGeneration:browser": "vitest run --config vitest.pageGenerationTest.config.ts",
|
|
12284
12285
|
"test:editor": "vitest run --exclude './src/components/**/*.test.tsx' --browser.enabled false",
|
|
12285
12286
|
"test:components": "vitest run --dir ./src/components",
|
|
12286
12287
|
"test:components:local": "./scripts/localScreenshots.sh",
|
|
@@ -12303,8 +12304,9 @@ var package_default = {
|
|
|
12303
12304
|
"i18n:update": "pnpm run i18n:extract:platform && pnpm run i18n:extract:page && pnpm run i18n:translate:platform && pnpm run i18n:propagate:page && pnpm run i18n:lint"
|
|
12304
12305
|
},
|
|
12305
12306
|
dependencies: {
|
|
12307
|
+
"@json-render/core": "^0.21.0",
|
|
12306
12308
|
"@mapbox/maki": "^8.2.0",
|
|
12307
|
-
"@puckeditor/core": "0.
|
|
12309
|
+
"@puckeditor/core": "0.24.0",
|
|
12308
12310
|
"@radix-ui/react-accordion": "^1.2.3",
|
|
12309
12311
|
"@radix-ui/react-alert-dialog": "^1.1.1",
|
|
12310
12312
|
"@radix-ui/react-dialog": "^1.1.13",
|
|
@@ -12340,7 +12342,8 @@ var package_default = {
|
|
|
12340
12342
|
"ts-morph": "22.0.0",
|
|
12341
12343
|
tsx: "^4.22.4",
|
|
12342
12344
|
typescript: "^5.5.4",
|
|
12343
|
-
uuid: "11.0.3"
|
|
12345
|
+
uuid: "11.0.3",
|
|
12346
|
+
zod: "^4.6.5"
|
|
12344
12347
|
},
|
|
12345
12348
|
engines: {
|
|
12346
12349
|
node: "^20.6.0 || ^22 || ^24"
|
|
@@ -16605,6 +16608,17 @@ var readLayout = (layoutDirectory, addIssue) => {
|
|
|
16605
16608
|
} else {
|
|
16606
16609
|
throw new Error("must set a supported pageSetType");
|
|
16607
16610
|
}
|
|
16611
|
+
const defaultGenerationSectionIds = metadataValue.defaultGenerationSectionIds;
|
|
16612
|
+
if (defaultGenerationSectionIds !== void 0) {
|
|
16613
|
+
if (!Array.isArray(defaultGenerationSectionIds) || defaultGenerationSectionIds.some(
|
|
16614
|
+
(sectionId) => typeof sectionId !== "string" || !sectionId.trim()
|
|
16615
|
+
)) {
|
|
16616
|
+
throw new Error(
|
|
16617
|
+
"defaultGenerationSectionIds must be an array of non-empty section IDs."
|
|
16618
|
+
);
|
|
16619
|
+
}
|
|
16620
|
+
metadata.defaultGenerationSectionIds = defaultGenerationSectionIds;
|
|
16621
|
+
}
|
|
16608
16622
|
if (!safeSectionLibraryIdPattern.test(metadata.id)) {
|
|
16609
16623
|
throw new Error(`Layout ID is not valid: ${metadata.id}`);
|
|
16610
16624
|
}
|