@yext/visual-editor 2.0.0-beta.5 → 2.0.0-beta.7
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-Cx0HVYVV.js → SectionLibraryVisualEditorProvider-DKUR2CCF.js} +21914 -15283
- 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 +5 -0
- package/dist/cli/yextve.js +203 -186
- package/dist/index.d.ts +14 -4
- package/dist/locales/platform/cs/visual-editor.json +120 -3
- package/dist/locales/platform/da/visual-editor.json +106 -3
- package/dist/locales/platform/de/visual-editor.json +106 -3
- package/dist/locales/platform/en/visual-editor.json +106 -3
- package/dist/locales/platform/en-GB/visual-editor.json +106 -3
- package/dist/locales/platform/es/visual-editor.json +113 -3
- package/dist/locales/platform/et/visual-editor.json +106 -3
- package/dist/locales/platform/fi/visual-editor.json +106 -3
- package/dist/locales/platform/fr/visual-editor.json +113 -3
- package/dist/locales/platform/hr/visual-editor.json +113 -3
- package/dist/locales/platform/hu/visual-editor.json +106 -3
- package/dist/locales/platform/it/visual-editor.json +113 -3
- package/dist/locales/platform/ja/visual-editor.json +106 -3
- package/dist/locales/platform/lt/visual-editor.json +120 -3
- package/dist/locales/platform/lv/visual-editor.json +110 -3
- package/dist/locales/platform/nb/visual-editor.json +106 -3
- package/dist/locales/platform/nl/visual-editor.json +106 -3
- package/dist/locales/platform/pl/visual-editor.json +120 -3
- package/dist/locales/platform/pt/visual-editor.json +113 -3
- package/dist/locales/platform/ro/visual-editor.json +113 -3
- package/dist/locales/platform/sk/visual-editor.json +120 -3
- package/dist/locales/platform/sv/visual-editor.json +106 -3
- package/dist/locales/platform/tr/visual-editor.json +106 -3
- package/dist/locales/platform/zh/visual-editor.json +106 -3
- package/dist/locales/platform/zh-TW/visual-editor.json +106 -3
- package/dist/{locatorEntityTypes-Cx069o6O.d.ts → locatorEntityTypes-CBKnACVV.d.ts} +61 -2
- package/dist/plugin/internal/layoutGeneration/limits.d.ts +28 -0
- package/dist/plugin/plugin.js +6784 -2065
- 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 +107 -105
- package/dist/sectionLibrarySupport.d.ts +61 -4
- package/dist/visual-editor-6mKs9VUe.js +842 -0
- package/dist/{visual-editor-C4_3sOZk.js → visual-editor-BK6fTU7k.js} +339 -235
- package/dist/{visual-editor-DHjY21yq.js → visual-editor-BruRrJYN.js} +351 -247
- package/dist/visual-editor-Bs3wAslG.js +804 -0
- package/dist/{visual-editor-Bbydkr0I.js → visual-editor-C9TLeAzP.js} +355 -251
- package/dist/{visual-editor-DjSURqT_.js → visual-editor-CHWtMtlu.js} +365 -254
- package/dist/{visual-editor-fiR-iLFH.js → visual-editor-CcfUKpnd.js} +352 -248
- package/dist/visual-editor-ClC6hoz3.js +804 -0
- package/dist/visual-editor-CtQwadxQ.js +842 -0
- package/dist/{visual-editor-B0RChJAU.js → visual-editor-D7VeTRK_.js} +358 -250
- package/dist/{visual-editor-U1Pe_9_s.js → visual-editor-DTE5kxrA.js} +341 -237
- package/dist/{visual-editor-CKGz4dG0.js → visual-editor-DjTEbi-1.js} +370 -252
- package/dist/{visual-editor-DdRZ_kR_.js → visual-editor-DkHhrFsX.js} +343 -239
- 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-BYcvKUJc.js → visual-editor-_TatCCAS.js} +358 -254
- package/dist/visual-editor-gEaWoNRu.js +804 -0
- package/dist/{visual-editor-BhN3aRjm.js → visual-editor-gjpr-NAN.js} +358 -254
- package/dist/{visual-editor-DZxcSdwZ.js → visual-editor-qJW0uCiQ.js} +342 -238
- 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 +14054 -7278
- package/package.json +7 -4
- package/dist/visual-editor-09Llsq7g.js +0 -712
- package/dist/visual-editor-2ORuu8_g.js +0 -712
- package/dist/visual-editor-B2kjEXp2.js +0 -712
- package/dist/visual-editor-BAapOoWM.js +0 -724
- package/dist/visual-editor-BHd18M8g.js +0 -712
- package/dist/visual-editor-BIm0S65w.js +0 -724
- package/dist/visual-editor-BiWbsaWp.js +0 -700
- package/dist/visual-editor-BlP1VpUW.js +0 -724
- package/dist/visual-editor-CPhXp-Gz.js +0 -700
- package/dist/visual-editor-CtqYqY5l.js +0 -700
- package/dist/visual-editor-Jkut-qXP.js +0 -700
- package/dist/visual-editor-Ln4QTSN0.js +0 -700
- package/dist/visual-editor-WZ5gb_gc.js +0 -712
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}
|
|
@@ -243,3 +243,8 @@ export { loadTranslationDictionary } from "./utils/i18n/translationResources.ts"
|
|
|
243
243
|
export { isVisualEditorTestEnv } from "./components/testing/utils.ts";
|
|
244
244
|
export { fetchLocalesToPathsForEntity } from "./utils/api/fetchLocalesToPathsForEntity.ts";
|
|
245
245
|
export { presetImageIcons } from "./utils/presetImageIcons.tsx";
|
|
246
|
+
export {
|
|
247
|
+
createPuckGenerationCatalog,
|
|
248
|
+
withGenerationCatalog,
|
|
249
|
+
} from "./utils/createPuckGenerationCatalog.ts";
|
|
250
|
+
export type { LayoutGenerationMetadata as ComponentGenerationMetadata } from "./fields/fields.ts";
|