@yext/visual-editor 1.0.0-beta.0 → 1.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.
@@ -45,7 +45,7 @@ export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = (
45
45
  viewport: "width=device-width, initial-scale=1",
46
46
  tags: [
47
47
  {
48
- type: "link",
48
+ type: "link" as TagType,
49
49
  attributes: {
50
50
  rel: "icon",
51
51
  type: "image/x-icon",
@@ -54,7 +54,7 @@ export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = (
54
54
  ...(data.document.siteDomain
55
55
  ? [
56
56
  {
57
- type: "link",
57
+ type: "link" as TagType,
58
58
  attributes: {
59
59
  rel: "canonical",
60
60
  href: getCanonicalUrl(data),
@@ -403,9 +403,9 @@ import {
403
403
  defaultThemeConfig,
404
404
  locatorConfig,
405
405
  getSchema,
406
+ getCanonicalUrl,
406
407
  migrate,
407
408
  migrationRegistry,
408
- getCanonicalUrl,
409
409
  } from "@yext/visual-editor";
410
410
  import { AnalyticsProvider, SchemaWrapper } from "@yext/pages-components";
411
411
  import mapboxPackageJson from "mapbox-gl/package.json";
@@ -424,7 +424,7 @@ export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = (
424
424
  viewport: "width=device-width, initial-scale=1",
425
425
  tags: [
426
426
  {
427
- type: "link",
427
+ type: "link" as TagType,
428
428
  attributes: {
429
429
  rel: "icon",
430
430
  type: "image/x-icon",
@@ -433,7 +433,7 @@ export const getHeadConfig: GetHeadConfig<TemplateRenderProps> = (
433
433
  ...(data.document.siteDomain
434
434
  ? [
435
435
  {
436
- type: "link",
436
+ type: "link" as TagType,
437
437
  attributes: {
438
438
  rel: "canonical",
439
439
  href: getCanonicalUrl(data),
@@ -522,7 +522,11 @@ const Locator: Template<TemplateRenderProps> = (props) => {
522
522
  <VisualEditorProvider templateProps={props}>
523
523
  <Render
524
524
  config={locatorConfig}
525
- data={data}
525
+ data={migrate(
526
+ JSON.parse(document.__.layout),
527
+ migrationRegistry,
528
+ locatorConfig
529
+ )}
526
530
  metadata={{ streamDocument: document }}
527
531
  />
528
532
  </VisualEditorProvider>
@@ -694,8 +698,7 @@ export default Locator;
694
698
  styles: {
695
699
  variant: "primary",
696
700
  presetImage: "app-store"
697
- },
698
- fieldsToHide: ["styles.displayType"]
701
+ }
699
702
  }
700
703
  }
701
704
  ],
@@ -981,9 +984,9 @@ export default Locator;
981
984
  constantValueEnabled: !0
982
985
  }
983
986
  },
984
- styles: { aspectRatio: 1.78, width: 640 },
987
+ styles: { aspectRatio: 1.78, width: 490 },
985
988
  variant: "classic",
986
- className: "max-w-full sm:max-w-initial md:max-w-[350px] lg:max-w-none rounded-image-borderRadius"
989
+ className: "mx-auto max-w-full md:max-w-[350px] lg:max-w-[calc(min(calc(100vw-1.5rem),var(--maxWidth-pageSection-contentWidth))-350px)] rounded-image-borderRadius"
987
990
  }
988
991
  }
989
992
  ],
@@ -1168,12 +1171,13 @@ export default Locator;
1168
1171
  }
1169
1172
  }
1170
1173
  ],
1171
- ServicesListSlot: [
1174
+ TextListSlot: [
1172
1175
  {
1173
- type: "ServicesListSlot",
1176
+ type: "TextListSlot",
1174
1177
  props: {
1175
1178
  id: "ServicesListSlot-2ab9809e-7c31-4a55-934d-2dd7d2f3b105",
1176
- list: { field: "services", constantValue: [] }
1179
+ list: { field: "services", constantValue: [] },
1180
+ commaSeparated: !1
1177
1181
  }
1178
1182
  }
1179
1183
  ]
@@ -1867,7 +1871,7 @@ export default Locator;
1867
1871
  data: {
1868
1872
  date: {
1869
1873
  field: "",
1870
- constantValue: "July 22, 2022",
1874
+ constantValue: "2022-08-02T14:00:00",
1871
1875
  constantValueEnabled: !0
1872
1876
  },
1873
1877
  endDate: {
@@ -1953,7 +1957,7 @@ export default Locator;
1953
1957
  data: {
1954
1958
  date: {
1955
1959
  field: "",
1956
- constantValue: "July 22, 2022",
1960
+ constantValue: "2022-08-02T14:00:00",
1957
1961
  constantValueEnabled: !0
1958
1962
  },
1959
1963
  endDate: {
@@ -2039,7 +2043,7 @@ export default Locator;
2039
2043
  data: {
2040
2044
  date: {
2041
2045
  field: "",
2042
- constantValue: "July 22, 2022",
2046
+ constantValue: "2022-08-02T14:00:00",
2043
2047
  constantValueEnabled: !0
2044
2048
  },
2045
2049
  endDate: {
@@ -2425,7 +2429,7 @@ export default Locator;
2425
2429
  {
2426
2430
  number: {
2427
2431
  field: "",
2428
- constantValue: "(202) 770-6619 ",
2432
+ constantValue: "+12027706619",
2429
2433
  constantValueEnabled: !0
2430
2434
  },
2431
2435
  label: {
@@ -2439,7 +2443,7 @@ export default Locator;
2439
2443
  phoneFormat: "domestic",
2440
2444
  includePhoneHyperlink: !0
2441
2445
  },
2442
- eventName: "phone0"
2446
+ eventName: "card0-phone"
2443
2447
  }
2444
2448
  }
2445
2449
  ],
@@ -2458,7 +2462,7 @@ export default Locator;
2458
2462
  styles: {
2459
2463
  listLength: 1
2460
2464
  },
2461
- eventName: "email0"
2465
+ eventName: "card0-email"
2462
2466
  }
2463
2467
  }
2464
2468
  ],
@@ -2486,7 +2490,7 @@ export default Locator;
2486
2490
  variant: "primary",
2487
2491
  presetImage: "app-store"
2488
2492
  },
2489
- eventName: "cta0"
2493
+ eventName: "card0-cta"
2490
2494
  }
2491
2495
  }
2492
2496
  ]
@@ -2590,7 +2594,7 @@ export default Locator;
2590
2594
  {
2591
2595
  number: {
2592
2596
  field: "",
2593
- constantValue: "(202) 770-6619 ",
2597
+ constantValue: "+12027706619",
2594
2598
  constantValueEnabled: !0
2595
2599
  },
2596
2600
  label: {
@@ -2604,7 +2608,7 @@ export default Locator;
2604
2608
  phoneFormat: "domestic",
2605
2609
  includePhoneHyperlink: !0
2606
2610
  },
2607
- eventName: "phone1"
2611
+ eventName: "card1-phone"
2608
2612
  }
2609
2613
  }
2610
2614
  ],
@@ -2621,7 +2625,7 @@ export default Locator;
2621
2625
  }
2622
2626
  },
2623
2627
  styles: { listLength: 1 },
2624
- eventName: "email1"
2628
+ eventName: "card1-email"
2625
2629
  }
2626
2630
  }
2627
2631
  ],
@@ -2649,7 +2653,7 @@ export default Locator;
2649
2653
  variant: "primary",
2650
2654
  presetImage: "app-store"
2651
2655
  },
2652
- eventName: "cta1"
2656
+ eventName: "card1-cta"
2653
2657
  }
2654
2658
  }
2655
2659
  ]
@@ -2753,7 +2757,7 @@ export default Locator;
2753
2757
  {
2754
2758
  number: {
2755
2759
  field: "",
2756
- constantValue: "(202) 770-6619 ",
2760
+ constantValue: "+12027706619",
2757
2761
  constantValueEnabled: !0
2758
2762
  },
2759
2763
  label: {
@@ -2767,7 +2771,7 @@ export default Locator;
2767
2771
  phoneFormat: "domestic",
2768
2772
  includePhoneHyperlink: !0
2769
2773
  },
2770
- eventName: "phone2"
2774
+ eventName: "card2-phone"
2771
2775
  }
2772
2776
  }
2773
2777
  ],
@@ -2784,7 +2788,7 @@ export default Locator;
2784
2788
  }
2785
2789
  },
2786
2790
  styles: { listLength: 1 },
2787
- eventName: "email2"
2791
+ eventName: "card2-email"
2788
2792
  }
2789
2793
  }
2790
2794
  ],
@@ -2812,7 +2816,7 @@ export default Locator;
2812
2816
  variant: "primary",
2813
2817
  presetImage: "app-store"
2814
2818
  },
2815
- eventName: "cta2"
2819
+ eventName: "card2-cta"
2816
2820
  }
2817
2821
  }
2818
2822
  ]
@@ -2893,6 +2897,10 @@ export default Locator;
2893
2897
  textColor: "text-black"
2894
2898
  }
2895
2899
  },
2900
+ conditionalRender: {
2901
+ hasCategory: !0,
2902
+ hasPublishTime: !0
2903
+ },
2896
2904
  slots: {
2897
2905
  ImageSlot: [
2898
2906
  {
@@ -3015,7 +3023,10 @@ export default Locator;
3015
3023
  entityField: {
3016
3024
  field: "",
3017
3025
  constantValue: {
3018
- label: "Read More",
3026
+ label: {
3027
+ en: "Read More",
3028
+ hasLocalizedValue: "true"
3029
+ },
3019
3030
  link: "#",
3020
3031
  linkType: "URL",
3021
3032
  ctaType: "textAndLink"
@@ -3026,7 +3037,8 @@ export default Locator;
3026
3037
  styles: {
3027
3038
  variant: "primary",
3028
3039
  presetImage: "app-store"
3029
- }
3040
+ },
3041
+ eventName: "cta0"
3030
3042
  }
3031
3043
  }
3032
3044
  ]
@@ -3043,6 +3055,10 @@ export default Locator;
3043
3055
  textColor: "text-black"
3044
3056
  }
3045
3057
  },
3058
+ conditionalRender: {
3059
+ hasCategory: !0,
3060
+ hasPublishTime: !0
3061
+ },
3046
3062
  slots: {
3047
3063
  ImageSlot: [
3048
3064
  {
@@ -3165,7 +3181,10 @@ export default Locator;
3165
3181
  entityField: {
3166
3182
  field: "",
3167
3183
  constantValue: {
3168
- label: "Read More",
3184
+ label: {
3185
+ en: "Read More",
3186
+ hasLocalizedValue: "true"
3187
+ },
3169
3188
  link: "#",
3170
3189
  linkType: "URL",
3171
3190
  ctaType: "textAndLink"
@@ -3176,7 +3195,8 @@ export default Locator;
3176
3195
  styles: {
3177
3196
  variant: "primary",
3178
3197
  presetImage: "app-store"
3179
- }
3198
+ },
3199
+ eventName: "cta1"
3180
3200
  }
3181
3201
  }
3182
3202
  ]
@@ -3193,6 +3213,10 @@ export default Locator;
3193
3213
  textColor: "text-black"
3194
3214
  }
3195
3215
  },
3216
+ conditionalRender: {
3217
+ hasCategory: !0,
3218
+ hasPublishTime: !0
3219
+ },
3196
3220
  slots: {
3197
3221
  ImageSlot: [
3198
3222
  {
@@ -3315,7 +3339,10 @@ export default Locator;
3315
3339
  entityField: {
3316
3340
  field: "",
3317
3341
  constantValue: {
3318
- label: "Read More",
3342
+ label: {
3343
+ en: "Read More",
3344
+ hasLocalizedValue: "true"
3345
+ },
3319
3346
  link: "#",
3320
3347
  linkType: "URL",
3321
3348
  ctaType: "textAndLink"
@@ -3326,7 +3353,8 @@ export default Locator;
3326
3353
  styles: {
3327
3354
  variant: "primary",
3328
3355
  presetImage: "app-store"
3329
- }
3356
+ },
3357
+ eventName: "cta2"
3330
3358
  }
3331
3359
  }
3332
3360
  ]
@@ -4318,17 +4346,9 @@ export default Locator;
4318
4346
  {
4319
4347
  type: "CopyrightMessageSlot",
4320
4348
  props: {
4321
- id: "CopyrightMessageSlot-a693ff67-53de-4654-a9bb-b6be0ef0af77",
4322
- data: {
4323
- text: {
4324
- field: "",
4325
- constantValue: {
4326
- en: "",
4327
- hasLocalizedValue: "true"
4328
- },
4329
- constantValueEnabled: !0
4330
- }
4331
- }
4349
+ id: "CopyrightMessageSlot-e0142469-df41-4ed7-9213-6a1ae84433e0",
4350
+ data: { text: { en: "", hasLocalizedValue: "true" } },
4351
+ alignment: "left"
4332
4352
  }
4333
4353
  }
4334
4354
  ]
@@ -4466,7 +4486,7 @@ export default Locator;
4466
4486
  variant: "primary",
4467
4487
  presetImage: "app-store"
4468
4488
  },
4469
- fieldsToHide: ["styles.displayType"]
4489
+ eventName: "primaryCta"
4470
4490
  }
4471
4491
  }
4472
4492
  ],
@@ -4494,7 +4514,8 @@ export default Locator;
4494
4514
  styles: {
4495
4515
  variant: "secondary",
4496
4516
  presetImage: "app-store"
4497
- }
4517
+ },
4518
+ eventName: "secondaryCta"
4498
4519
  }
4499
4520
  }
4500
4521
  ]
@@ -5058,17 +5079,9 @@ export default Locator;
5058
5079
  {
5059
5080
  type: "CopyrightMessageSlot",
5060
5081
  props: {
5061
- id: "CopyrightMessageSlot-a693ff67-53de-4654-a9bb-b6be0ef0af77",
5062
- data: {
5063
- text: {
5064
- field: "",
5065
- constantValue: {
5066
- en: "",
5067
- hasLocalizedValue: "true"
5068
- },
5069
- constantValueEnabled: !0
5070
- }
5071
- }
5082
+ id: "CopyrightMessageSlot-e0142469-df41-4ed7-9213-6a1ae84433e0",
5083
+ data: { text: { en: "", hasLocalizedValue: "true" } },
5084
+ alignment: "left"
5072
5085
  }
5073
5086
  }
5074
5087
  ]