@yext/visual-editor 1.1.0-alpha.2 → 1.1.0-alpha.4

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 (79) hide show
  1. package/dist/index.d.ts +23 -1
  2. package/dist/plugin/plugin.js +46 -1
  3. package/dist/{visual-editor-DKMO6Cx1.js → visual-editor-2APozeFg.js} +299 -291
  4. package/dist/{visual-editor-v7c7z5Iz.js → visual-editor-43vng_Qf.js} +306 -298
  5. package/dist/visual-editor-6brnk1dc.js +193 -0
  6. package/dist/{visual-editor-CSaqnwdr.js → visual-editor-B-cxn9Zo.js} +321 -313
  7. package/dist/visual-editor-BA7dQAHX.js +193 -0
  8. package/dist/{visual-editor-ByXo0gnp.js → visual-editor-BC7HlBkl.js} +299 -291
  9. package/dist/visual-editor-BK2pmoC4.js +193 -0
  10. package/dist/{visual-editor-B1Es6dVl.js → visual-editor-BMJo-2Dx.js} +311 -303
  11. package/dist/visual-editor-BN7ZE3Ob.js +205 -0
  12. package/dist/visual-editor-BTpekLd4.js +205 -0
  13. package/dist/visual-editor-Bctil6we.js +193 -0
  14. package/dist/{visual-editor-Dk50XMPP.js → visual-editor-BiCeftd3.js} +303 -295
  15. package/dist/visual-editor-Bip0ocIS.js +193 -0
  16. package/dist/{visual-editor-Bpx3Omw3.js → visual-editor-Bs2lEgS2.js} +305 -297
  17. package/dist/{visual-editor-Bm56fUn7.js → visual-editor-ByOvY1Wy.js} +306 -298
  18. package/dist/visual-editor-C26VZrLz.js +193 -0
  19. package/dist/visual-editor-C3Oq114H.js +205 -0
  20. package/dist/visual-editor-CEkiOT-U.js +193 -0
  21. package/dist/visual-editor-CQdNePf4.js +205 -0
  22. package/dist/{visual-editor-baiBIgD3.js → visual-editor-CQfyX6WR.js} +302 -294
  23. package/dist/visual-editor-CQuxAKah.js +205 -0
  24. package/dist/visual-editor-CTL6UoZK.js +217 -0
  25. package/dist/visual-editor-CYxri0B-.js +193 -0
  26. package/dist/{visual-editor-DTz4usp4.js → visual-editor-CaEMvyVi.js} +302 -294
  27. package/dist/{visual-editor-9sp7NuQx.js → visual-editor-CbTNXujd.js} +311 -303
  28. package/dist/visual-editor-CjzKal3b.js +205 -0
  29. package/dist/{visual-editor-rSO9NRf2.js → visual-editor-D7cewNBM.js} +316 -308
  30. package/dist/visual-editor-D9stmAYr.js +193 -0
  31. package/dist/{visual-editor-CFWbwX3U.js → visual-editor-DBE_-hVM.js} +307 -299
  32. package/dist/visual-editor-DKfXnNUa.js +217 -0
  33. package/dist/visual-editor-DTLe23pu.js +193 -0
  34. package/dist/visual-editor-DbEdIUAy.js +217 -0
  35. package/dist/{visual-editor-Chy6HJPX.js → visual-editor-DbUB40ph.js} +302 -294
  36. package/dist/{visual-editor-BS69QQkF.js → visual-editor-DeC-frRl.js} +307 -299
  37. package/dist/{visual-editor-Bogfx1aq.js → visual-editor-Diwd4zcr.js} +302 -294
  38. package/dist/visual-editor-DkF8PTV4.js +217 -0
  39. package/dist/{visual-editor-DSAW9Nkq.js → visual-editor-DlyU_6p9.js} +297 -289
  40. package/dist/visual-editor-Dnl0sbuA.js +205 -0
  41. package/dist/visual-editor-DpFmrzKq.js +193 -0
  42. package/dist/visual-editor-DsUDDDXe.js +193 -0
  43. package/dist/{visual-editor-DuOMqtGX.js → visual-editor-Dvt9Cdlc.js} +323 -315
  44. package/dist/visual-editor-MjwOnPGF.js +193 -0
  45. package/dist/{visual-editor-BGQW-koH.js → visual-editor-XbqxT8ql.js} +307 -299
  46. package/dist/{visual-editor-rmf2mtgY.js → visual-editor-elwsOlLc.js} +307 -299
  47. package/dist/{visual-editor-DHcPuiFn.js → visual-editor-fQcDUXRH.js} +295 -287
  48. package/dist/{visual-editor-DVZv0BN3.js → visual-editor-ilT5eJgq.js} +313 -305
  49. package/dist/{visual-editor-CYUs-WIo.js → visual-editor-lg5ZsjR9.js} +310 -302
  50. package/dist/{visual-editor-U5ta2fMi.js → visual-editor-oUZKgy02.js} +302 -294
  51. package/dist/{visual-editor-Dal_zEMP.js → visual-editor-ubhd-KyU.js} +289 -281
  52. package/dist/visual-editor-uzAZ4PTA.js +193 -0
  53. package/dist/visual-editor.js +13124 -12862
  54. package/package.json +2 -2
  55. package/dist/visual-editor-85pPXURx.js +0 -201
  56. package/dist/visual-editor-BDpjzPLY.js +0 -201
  57. package/dist/visual-editor-BQhtkby-.js +0 -189
  58. package/dist/visual-editor-BS0YO5MP.js +0 -189
  59. package/dist/visual-editor-BSA1vco6.js +0 -201
  60. package/dist/visual-editor-BT5mUoay.js +0 -189
  61. package/dist/visual-editor-BZjvV6My.js +0 -189
  62. package/dist/visual-editor-BfcTynlY.js +0 -189
  63. package/dist/visual-editor-BfjQHprU.js +0 -189
  64. package/dist/visual-editor-Bve5G158.js +0 -201
  65. package/dist/visual-editor-C3Dc3VrO.js +0 -189
  66. package/dist/visual-editor-C7V7kkUZ.js +0 -213
  67. package/dist/visual-editor-CB9wEKya.js +0 -189
  68. package/dist/visual-editor-CIpBWO4A.js +0 -201
  69. package/dist/visual-editor-CZ1ZA14Q.js +0 -189
  70. package/dist/visual-editor-Ch4Zke4f.js +0 -213
  71. package/dist/visual-editor-CmxC7ZcD.js +0 -213
  72. package/dist/visual-editor-CpNdLEta.js +0 -213
  73. package/dist/visual-editor-D77wkUoT.js +0 -201
  74. package/dist/visual-editor-DgAov8Dt.js +0 -189
  75. package/dist/visual-editor-DlP_fDh8.js +0 -189
  76. package/dist/visual-editor-DnmYWiLW.js +0 -189
  77. package/dist/visual-editor-DtJSbin8.js +0 -201
  78. package/dist/visual-editor-H2GDRXKn.js +0 -189
  79. package/dist/visual-editor-lHSSkq6t.js +0 -189
package/dist/index.d.ts CHANGED
@@ -852,6 +852,7 @@ declare function resolveComponentData(data: TranslatableString | TranslatableRic
852
852
  output: "plainText";
853
853
  }): string;
854
854
  declare function resolveComponentData<T>(data: YextEntityField<T>, locale: string, streamDocument?: Record<string, any>): T | undefined;
855
+ declare function resolveComponentData(data: TranslatableAssetImage | YextEntityField<TranslatableAssetImage>, locale: string, streamDocument?: Record<string, any>): TranslatableAssetImage | undefined;
855
856
 
856
857
  declare const resolveYextEntityField: <T>(streamDocument: any, entityField: YextEntityField<T>, locale?: string) => T | undefined;
857
858
 
@@ -1267,7 +1268,7 @@ declare const CTA: (props: CTAProps) => react_jsx_runtime.JSX.Element | null;
1267
1268
  declare const headingVariants: (props?: ({
1268
1269
  level?: 2 | 1 | 3 | 4 | 5 | 6 | null | undefined;
1269
1270
  fontSize?: "default" | "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null | undefined;
1270
- weight?: "default" | "400" | "100" | "200" | "300" | "500" | "600" | "700" | "800" | "900" | null | undefined;
1271
+ weight?: "default" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | null | undefined;
1271
1272
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1272
1273
  interface HeadingProps extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">, VariantProps<typeof headingVariants> {
1273
1274
  level: HeadingLevel;
@@ -1289,6 +1290,11 @@ interface ImageProps {
1289
1290
  /** sizes attribute of the underlying img tag */
1290
1291
  sizes?: string;
1291
1292
  loading?: "lazy" | "eager";
1293
+ /**
1294
+ * Entity data used to resolve embedded fields.
1295
+ * Defaults to the stream document if not provided.
1296
+ */
1297
+ streamDocumentOverride?: Record<string, any>;
1292
1298
  }
1293
1299
  declare const Image: React.FC<ImageProps>;
1294
1300
  type ImgSizesByBreakpoint = {
@@ -2531,6 +2537,10 @@ interface LocatorResultCardProps {
2531
2537
  * @defaultValue "name"
2532
2538
  */
2533
2539
  field: DynamicOptionsSingleSelectorType<string>;
2540
+ /** Static value for the primary heading */
2541
+ constantValue?: TranslatableString;
2542
+ /** Whether to use the static value for the primary heading */
2543
+ constantValueEnabled?: boolean;
2534
2544
  /** The heading level for the primary heading */
2535
2545
  headingLevel: HeadingLevel;
2536
2546
  /**
@@ -2543,6 +2553,10 @@ interface LocatorResultCardProps {
2543
2553
  secondaryHeading: {
2544
2554
  /** The field from the data to use for the secondary heading */
2545
2555
  field: DynamicOptionsSingleSelectorType<string>;
2556
+ /** Static value for the secondary heading */
2557
+ constantValue?: TranslatableString;
2558
+ /** Whether to use the static value for the secondary heading */
2559
+ constantValueEnabled?: boolean;
2546
2560
  /** The variant for the secondary heading */
2547
2561
  variant: BodyProps["variant"];
2548
2562
  /** Whether the secondary heading is visible in live mode */
@@ -2552,6 +2566,10 @@ interface LocatorResultCardProps {
2552
2566
  tertiaryHeading: {
2553
2567
  /** The field from the data to use for the tertiary heading */
2554
2568
  field: DynamicOptionsSingleSelectorType<string>;
2569
+ /** Static value for the tertiary heading */
2570
+ constantValue?: TranslatableString;
2571
+ /** Whether to use the static value for the tertiary heading */
2572
+ constantValueEnabled?: boolean;
2555
2573
  /** The variant for the tertiary heading */
2556
2574
  variant: BodyProps["variant"];
2557
2575
  /** Whether the tertiary heading is visible in live mode */
@@ -2635,6 +2653,10 @@ interface LocatorResultCardProps {
2635
2653
  image: {
2636
2654
  /** The field from the data to use for the image */
2637
2655
  field: DynamicOptionsSingleSelectorType<string>;
2656
+ /** Static value for the image */
2657
+ constantValue?: TranslatableAssetImage;
2658
+ /** Whether to use the static value for the image */
2659
+ constantValueEnabled?: boolean;
2638
2660
  /** Whether the image block is visible in live mode */
2639
2661
  liveVisibility: boolean;
2640
2662
  };
@@ -141,11 +141,23 @@ const Location: Template<TemplateRenderProps> = (props) => {
141
141
  document?._additionalLayoutCategories
142
142
  );
143
143
 
144
+ let requireAnalyticsOptIn = false;
145
+ if (document.__?.visualEditorConfig) {
146
+ try {
147
+ requireAnalyticsOptIn =
148
+ JSON.parse(document.__.visualEditorConfig)?.requireAnalyticsOptIn ??
149
+ false;
150
+ } catch (e) {
151
+ console.error("Failed to parse visualEditorConfig JSON:", e);
152
+ }
153
+ }
154
+
144
155
  return (
145
156
  <AnalyticsProvider
146
157
  apiKey={document?._env?.YEXT_PUBLIC_VISUAL_EDITOR_APP_API_KEY}
147
158
  templateData={props}
148
159
  currency="USD"
160
+ requireOptIn={requireAnalyticsOptIn}
149
161
  >
150
162
  <VisualEditorProvider templateProps={props}>
151
163
  <Render
@@ -386,11 +398,23 @@ const Directory: Template<TemplateRenderProps> = (props) => {
386
398
  console.error("Failed to parse layout JSON:", e);
387
399
  }
388
400
 
401
+ let requireAnalyticsOptIn = false;
402
+ if (document.__?.visualEditorConfig) {
403
+ try {
404
+ requireAnalyticsOptIn =
405
+ JSON.parse(document.__.visualEditorConfig)?.requireAnalyticsOptIn ??
406
+ false;
407
+ } catch (e) {
408
+ console.error("Failed to parse visualEditorConfig JSON:", e);
409
+ }
410
+ }
411
+
389
412
  return (
390
413
  <AnalyticsProvider
391
414
  apiKey={document?._env?.YEXT_PUBLIC_VISUAL_EDITOR_APP_API_KEY}
392
415
  templateData={props}
393
416
  currency="USD"
417
+ requireOptIn={requireAnalyticsOptIn}
394
418
  >
395
419
  <VisualEditorProvider templateProps={props}>
396
420
  <Render
@@ -537,6 +561,17 @@ const Locator: Template<TemplateRenderProps> = (props) => {
537
561
  console.error("Failed to parse layout JSON:", e);
538
562
  }
539
563
 
564
+ let requireAnalyticsOptIn = false;
565
+ if (document.__?.visualEditorConfig) {
566
+ try {
567
+ requireAnalyticsOptIn =
568
+ JSON.parse(document.__.visualEditorConfig)?.requireAnalyticsOptIn ??
569
+ false;
570
+ } catch (e) {
571
+ console.error("Failed to parse visualEditorConfig JSON:", e);
572
+ }
573
+ }
574
+
540
575
  return (
541
576
  <>
542
577
  <script
@@ -552,6 +587,7 @@ const Locator: Template<TemplateRenderProps> = (props) => {
552
587
  apiKey={document?._env?.YEXT_PUBLIC_VISUAL_EDITOR_APP_API_KEY}
553
588
  templateData={props}
554
589
  currency="USD"
590
+ requireOptIn={requireAnalyticsOptIn}
555
591
  >
556
592
  <VisualEditorProvider templateProps={props}>
557
593
  <Render
@@ -2590,7 +2626,8 @@ export default Locator;
2590
2626
  backgroundColor: {
2591
2627
  bgColor: "bg-palette-primary-light",
2592
2628
  textColor: "text-black"
2593
- }
2629
+ },
2630
+ showSectionHeading: !0
2594
2631
  },
2595
2632
  data: {
2596
2633
  field: "",
@@ -6100,15 +6137,21 @@ export default Locator;
6100
6137
  resultCard: {
6101
6138
  primaryHeading: {
6102
6139
  field: { selection: { value: "name" } },
6140
+ constantValue: "",
6141
+ constantValueEnabled: !1,
6103
6142
  headingLevel: 3
6104
6143
  },
6105
6144
  secondaryHeading: {
6106
6145
  field: { selection: { value: "name" } },
6146
+ constantValue: "",
6147
+ constantValueEnabled: !1,
6107
6148
  variant: "base",
6108
6149
  liveVisibility: !1
6109
6150
  },
6110
6151
  tertiaryHeading: {
6111
6152
  field: { selection: { value: "name" } },
6153
+ constantValue: "",
6154
+ constantValueEnabled: !1,
6112
6155
  variant: "base",
6113
6156
  liveVisibility: !1
6114
6157
  },
@@ -6150,6 +6193,8 @@ export default Locator;
6150
6193
  },
6151
6194
  image: {
6152
6195
  field: { selection: { value: "headshot" } },
6196
+ constantValue: { url: "", height: 0, width: 0 },
6197
+ constantValueEnabled: !1,
6153
6198
  liveVisibility: !1
6154
6199
  }
6155
6200
  }