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

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 (68) hide show
  1. package/dist/{SectionLibraryVisualEditorProvider-DN65KSX7.js → SectionLibraryVisualEditorProvider-DJezMczO.js} +9772 -9578
  2. package/dist/cli/assets/directory-locator-source/components/contentBlocks/image/styling.ts +22 -19
  3. package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.test.tsx +1 -1
  4. package/dist/cli/assets/directory-locator-source/components/sections/locator/Locator.tsx +44 -0
  5. package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorRadius.test.ts +418 -0
  6. package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorResultCard.tsx +25 -0
  7. package/dist/cli/assets/directory-locator-source/components/sections/locator/LocatorWrapper.tsx +58 -25
  8. package/dist/cli/assets/directory-locator-source/sectionLibrarySupport.ts +4 -0
  9. package/dist/cli/yextve.js +3 -3
  10. package/dist/{createYextFieldTransforms-CrIkiJ_X.d.ts → createYextFieldTransforms-B3f0jVg6.d.ts} +36 -17
  11. package/dist/index.d.ts +19 -10
  12. package/dist/locales/platform/cs/visual-editor.json +4 -0
  13. package/dist/locales/platform/da/visual-editor.json +4 -0
  14. package/dist/locales/platform/de/visual-editor.json +4 -0
  15. package/dist/locales/platform/en/visual-editor.json +4 -0
  16. package/dist/locales/platform/en-GB/visual-editor.json +4 -0
  17. package/dist/locales/platform/es/visual-editor.json +4 -0
  18. package/dist/locales/platform/et/visual-editor.json +4 -0
  19. package/dist/locales/platform/fi/visual-editor.json +4 -0
  20. package/dist/locales/platform/fr/visual-editor.json +4 -0
  21. package/dist/locales/platform/hr/visual-editor.json +4 -0
  22. package/dist/locales/platform/hu/visual-editor.json +4 -0
  23. package/dist/locales/platform/it/visual-editor.json +4 -0
  24. package/dist/locales/platform/ja/visual-editor.json +4 -0
  25. package/dist/locales/platform/lt/visual-editor.json +4 -0
  26. package/dist/locales/platform/lv/visual-editor.json +4 -0
  27. package/dist/locales/platform/nb/visual-editor.json +4 -0
  28. package/dist/locales/platform/nl/visual-editor.json +4 -0
  29. package/dist/locales/platform/pl/visual-editor.json +4 -0
  30. package/dist/locales/platform/pt/visual-editor.json +4 -0
  31. package/dist/locales/platform/ro/visual-editor.json +4 -0
  32. package/dist/locales/platform/sk/visual-editor.json +4 -0
  33. package/dist/locales/platform/sv/visual-editor.json +4 -0
  34. package/dist/locales/platform/tr/visual-editor.json +4 -0
  35. package/dist/locales/platform/zh/visual-editor.json +4 -0
  36. package/dist/locales/platform/zh-TW/visual-editor.json +4 -0
  37. package/dist/plugin/plugin.js +2 -1
  38. package/dist/plugin/vite-plugin/layout-generation/modelProxy.d.ts +1 -1
  39. package/dist/section-library-support.js +77 -77
  40. package/dist/sectionLibrarySupport.d.ts +2 -2
  41. package/dist/{visual-editor-Bs3wAslG.js → visual-editor-89bNoCOk.js} +4 -0
  42. package/dist/{visual-editor-sOPDMkOR.js → visual-editor-8Okvw03s.js} +25 -21
  43. package/dist/{visual-editor-vomNdlNO.js → visual-editor-B-9-8VqT.js} +40 -36
  44. package/dist/{visual-editor-DjTEbi-1.js → visual-editor-BEiQqs_Z.js} +4 -0
  45. package/dist/{visual-editor-D7VeTRK_.js → visual-editor-BPOG2TRh.js} +4 -0
  46. package/dist/{visual-editor-DkHhrFsX.js → visual-editor-BWDv00Sj.js} +19 -15
  47. package/dist/{visual-editor-zKhC7_0C.js → visual-editor-BfzO6vuG.js} +25 -21
  48. package/dist/{visual-editor-Duishbsa.js → visual-editor-BmfXE4Nt.js} +19 -15
  49. package/dist/{visual-editor-QpGupjY5.js → visual-editor-C5aegP-t.js} +73 -69
  50. package/dist/{visual-editor-CHWtMtlu.js → visual-editor-C7Ne5NW6.js} +39 -35
  51. package/dist/{visual-editor-DtL-Zuv_.js → visual-editor-CJMynoK2.js} +40 -36
  52. package/dist/{visual-editor-CtQwadxQ.js → visual-editor-C_SC4gLo.js} +4 -0
  53. package/dist/{visual-editor-ClC6hoz3.js → visual-editor-CiE_sZgp.js} +37 -33
  54. package/dist/{visual-editor-C9TLeAzP.js → visual-editor-Crc50YSl.js} +24 -20
  55. package/dist/{visual-editor-BK6fTU7k.js → visual-editor-DSYNp8sQ.js} +4 -0
  56. package/dist/{visual-editor-CcfUKpnd.js → visual-editor-DVI-AF67.js} +26 -22
  57. package/dist/{visual-editor-qJW0uCiQ.js → visual-editor-D_Xqs07E.js} +57 -53
  58. package/dist/{visual-editor-tPb7n5l8.js → visual-editor-DcNe0Txh.js} +25 -21
  59. package/dist/{visual-editor-LXMNWXry.js → visual-editor-DuH1uy-p.js} +57 -53
  60. package/dist/{visual-editor-DTE5kxrA.js → visual-editor-DuxrpEsM.js} +20 -16
  61. package/dist/{visual-editor-_TatCCAS.js → visual-editor-TsYZAz_J.js} +4 -0
  62. package/dist/{visual-editor-6mKs9VUe.js → visual-editor-bjHpuHcP.js} +20 -16
  63. package/dist/{visual-editor-gjpr-NAN.js → visual-editor-d-SdfYpR.js} +25 -21
  64. package/dist/{visual-editor-gEaWoNRu.js → visual-editor-dWLAQOr6.js} +4 -0
  65. package/dist/{visual-editor-BruRrJYN.js → visual-editor-yqgcCbY4.js} +4 -0
  66. package/dist/visual-editor.css +1 -1
  67. package/dist/visual-editor.js +4512 -4481
  68. package/package.json +3 -3
@@ -37,7 +37,7 @@ import { resolveLocalizedAssetImage } from "../../../types/images.ts";
37
37
  import {
38
38
  getPreferredDistanceUnit,
39
39
  toMeters,
40
- toMiles,
40
+ fromMeters,
41
41
  } from "../../../utils/i18n/distance.ts";
42
42
  import { resolveComponentData } from "../../../utils/resolveComponentData.tsx";
43
43
  import {
@@ -168,6 +168,7 @@ const LocatorInternal = ({
168
168
  keywordsDisplayName,
169
169
  },
170
170
  mapStartingLocation,
171
+ defaultSearchRadius,
171
172
  resultCard: resultCardConfigs,
172
173
  distanceDisplay,
173
174
  pageHeading,
@@ -197,6 +198,13 @@ const LocatorInternal = ({
197
198
  const windowWidth = useWindowWidth(previewWindow);
198
199
  const { isMobile } = getViewport(windowWidth);
199
200
  const preferredUnit = getPreferredDistanceUnit(i18n.language);
201
+ // Puck emits 0 when its number field is cleared; only positive radii override Search.
202
+ const configuredRadiusMeters =
203
+ defaultSearchRadius?.value && defaultSearchRadius.value > 0
204
+ ? toMeters(defaultSearchRadius.value, defaultSearchRadius.unit)
205
+ : undefined;
206
+ const defaultRadiusMeters =
207
+ configuredRadiusMeters ?? toMeters(DEFAULT_RADIUS, preferredUnit);
200
208
  const streamDocument = useDocument();
201
209
  const entityTypeSourceMap = getLocatorEntityTypeSourceMap(streamDocument);
202
210
  const entityTypes =
@@ -251,7 +259,7 @@ const LocatorInternal = ({
251
259
  number | null
252
260
  >(null);
253
261
  /** Radius of the current location filter before a distance option is applied */
254
- const apiFilterRadius = React.useRef<number | null>(null);
262
+ const baseFilterRadius = React.useRef<number | null>(null);
255
263
 
256
264
  const handleDrag: OnDragHandler = (center, bounds) => {
257
265
  setMapCenter({
@@ -298,7 +306,9 @@ const LocatorInternal = ({
298
306
  matcher: Matcher.Near,
299
307
  },
300
308
  };
301
- apiFilterRadius.current = mapRadius;
309
+ baseFilterRadius.current = mapRadius;
310
+ setSelectedDistanceOption(null);
311
+ setSelectedDistanceMeters(null);
302
312
  searchActions.setStaticFilters([locationFilter, openNowFilter]);
303
313
  searchActions.executeVerticalQuery();
304
314
  setSearchState("loading");
@@ -316,14 +326,19 @@ const LocatorInternal = ({
316
326
 
317
327
  const handleCurrentLocationClick = (position: GeolocationPosition) => {
318
328
  const { latitude, longitude, accuracy } = position.coords;
319
- const radius = Math.max(accuracy, toMeters(DEFAULT_RADIUS, preferredUnit));
329
+ baseFilterRadius.current = Math.max(accuracy, defaultRadiusMeters);
330
+ const radius = Math.max(
331
+ accuracy,
332
+ showDistanceOptions && selectedDistanceMeters
333
+ ? selectedDistanceMeters
334
+ : defaultRadiusMeters
335
+ );
320
336
  const locationFilter = buildNearLocationFilterFromCoords(
321
337
  latitude,
322
338
  longitude,
323
339
  radius,
324
340
  t("currentLocation", "Current Location")
325
341
  );
326
- apiFilterRadius.current = radius;
327
342
  const nonLocationFilters = (searchFilters.static || []).filter(
328
343
  (staticFilter) =>
329
344
  staticFilter.filter.kind !== "fieldValue" ||
@@ -369,12 +384,12 @@ const LocatorInternal = ({
369
384
  switch (filter.matcher) {
370
385
  case Matcher.Near: {
371
386
  nearFilterValue = filter.value as NearFilterValue;
372
- apiFilterRadius.current = nearFilterValue.radius;
373
- // only overwrite radius from filter if display options are enabled
387
+ baseFilterRadius.current =
388
+ configuredRadiusMeters ?? nearFilterValue.radius;
374
389
  const radius =
375
390
  showDistanceOptions && selectedDistanceMeters
376
391
  ? selectedDistanceMeters
377
- : nearFilterValue.radius;
392
+ : baseFilterRadius.current;
378
393
  locationFilter = buildNearLocationFilterFromPrevious(
379
394
  nearFilterValue,
380
395
  newDisplayName,
@@ -383,7 +398,7 @@ const LocatorInternal = ({
383
398
  break;
384
399
  }
385
400
  case Matcher.Equals: {
386
- apiFilterRadius.current = null;
401
+ baseFilterRadius.current = null;
387
402
  locationFilter = buildEqualsLocationFilter(filter, newDisplayName);
388
403
  break;
389
404
  }
@@ -407,7 +422,11 @@ const LocatorInternal = ({
407
422
  latitude: nearFilterValue.lat,
408
423
  longitude: nearFilterValue.lng,
409
424
  });
410
- setMapRadius(nearFilterValue.radius);
425
+ setMapRadius(
426
+ showDistanceOptions && selectedDistanceMeters
427
+ ? selectedDistanceMeters
428
+ : (baseFilterRadius.current ?? nearFilterValue.radius)
429
+ );
411
430
  }
412
431
  };
413
432
 
@@ -608,7 +627,8 @@ const LocatorInternal = ({
608
627
  const radius =
609
628
  showDistanceOptions && selectedDistanceMeters
610
629
  ? selectedDistanceMeters
611
- : toMeters(DEFAULT_RADIUS, preferredUnit);
630
+ : defaultRadiusMeters;
631
+ baseFilterRadius.current = defaultRadiusMeters;
612
632
  // default location filter to configured starting location or NYC
613
633
  let initialLocationFilter = buildNearLocationFilterFromCoords(
614
634
  initialMapCenter.latitude,
@@ -634,7 +654,6 @@ const LocatorInternal = ({
634
654
  ) {
635
655
  const filterValue = initialLocationFilter.filter
636
656
  .value as NearFilterValue;
637
- apiFilterRadius.current = filterValue.radius;
638
657
  const nextCenterCoords: Coordinate = {
639
658
  longitude: filterValue.lng,
640
659
  latitude: filterValue.lat,
@@ -680,11 +699,15 @@ const LocatorInternal = ({
680
699
  switch (resultFilter.matcher) {
681
700
  case Matcher.Near: {
682
701
  const filterFromResult = resultFilter.value as NearFilterValue;
702
+ baseFilterRadius.current =
703
+ configuredRadiusMeters ?? filterFromResult.radius;
683
704
  initialLocationFilter = buildNearLocationFilterFromPrevious(
684
705
  filterFromResult,
685
- firstResult.value
706
+ firstResult.value,
707
+ showDistanceOptions && selectedDistanceMeters
708
+ ? selectedDistanceMeters
709
+ : baseFilterRadius.current
686
710
  );
687
- apiFilterRadius.current = filterFromResult.radius;
688
711
  return true;
689
712
  }
690
713
  case Matcher.Equals: {
@@ -692,7 +715,7 @@ const LocatorInternal = ({
692
715
  resultFilter,
693
716
  firstResult.value
694
717
  );
695
- apiFilterRadius.current = null;
718
+ baseFilterRadius.current = null;
696
719
  return true;
697
720
  }
698
721
  default: {
@@ -712,6 +735,9 @@ const LocatorInternal = ({
712
735
  ? parseCoordinateQuery(initialLocationParam)
713
736
  : undefined;
714
737
  if (coordinates) {
738
+ baseFilterRadius.current = coordinates.radius;
739
+ setSelectedDistanceOption(null);
740
+ setSelectedDistanceMeters(null);
715
741
  initialLocationFilter = buildNearLocationFilterFromCoords(
716
742
  coordinates.lat,
717
743
  coordinates.lng,
@@ -741,6 +767,10 @@ const LocatorInternal = ({
741
767
  }
742
768
  const lat = location.coords.latitude;
743
769
  const lng = location.coords.longitude;
770
+ baseFilterRadius.current = Math.max(
771
+ location.coords.accuracy,
772
+ defaultRadiusMeters
773
+ );
744
774
  setShowCurrentLocationButton(true);
745
775
 
746
776
  // Try to reverse-geocode the coordinates to a human-readable place name using Mapbox
@@ -770,7 +800,7 @@ const LocatorInternal = ({
770
800
  initialLocationFilter = buildNearLocationFilterFromCoords(
771
801
  lat,
772
802
  lng,
773
- radius,
803
+ Math.max(location.coords.accuracy, radius),
774
804
  displayName
775
805
  );
776
806
  }
@@ -790,7 +820,13 @@ const LocatorInternal = ({
790
820
  return () => {
791
821
  isCancelled = true;
792
822
  };
793
- }, [urlNavigationVersion, initialMapCenter, searchActions]);
823
+ }, [
824
+ urlNavigationVersion,
825
+ initialMapCenter,
826
+ searchActions,
827
+ configuredRadiusMeters,
828
+ defaultRadiusMeters,
829
+ ]);
794
830
 
795
831
  const handleOpenNowClick = (selected: boolean) => {
796
832
  if (selected === isOpenNowSelected) {
@@ -875,10 +911,10 @@ const LocatorInternal = ({
875
911
  if (selectedDistanceOption === distance) {
876
912
  setSelectedDistanceMeters(null);
877
913
  setSelectedDistanceOption(null);
878
- // revert to API radius (or default if none was found) if user clicks the same distance again
914
+ // Restore the current location's base radius when deselecting a distance.
879
915
  updatedFilters = updateRadiusInNearFiltersOnLocationField(
880
916
  existingFilters,
881
- apiFilterRadius.current ?? toMeters(DEFAULT_RADIUS, preferredUnit)
917
+ baseFilterRadius.current ?? defaultRadiusMeters
882
918
  );
883
919
  } else {
884
920
  setSelectedDistanceOption(distance);
@@ -894,10 +930,10 @@ const LocatorInternal = ({
894
930
 
895
931
  const handleClearFiltersClick = () => {
896
932
  const existingFilters = searchFilters.static || [];
897
- // revert to API radius (or default if none was found)
933
+ // Restore the current location's base radius.
898
934
  const partiallyUpdatedFilters = updateRadiusInNearFiltersOnLocationField(
899
935
  existingFilters,
900
- apiFilterRadius.current ?? toMeters(DEFAULT_RADIUS, preferredUnit)
936
+ baseFilterRadius.current ?? defaultRadiusMeters
901
937
  );
902
938
  const updatedFilters = deselectOpenNowFilters(partiallyUpdatedFilters);
903
939
 
@@ -1011,10 +1047,7 @@ const LocatorInternal = ({
1011
1047
  showCurrentLocationButton={showCurrentLocationButton}
1012
1048
  geolocationProps={{
1013
1049
  handleClick: handleCurrentLocationClick,
1014
- radius:
1015
- preferredUnit === "mile"
1016
- ? DEFAULT_RADIUS
1017
- : toMiles(DEFAULT_RADIUS), // this component uses miles, not meters
1050
+ radius: fromMeters(defaultRadiusMeters, "mile"),
1018
1051
  }}
1019
1052
  />
1020
1053
  </div>
@@ -90,6 +90,10 @@ export {
90
90
  type ImageField,
91
91
  type ImagePayload,
92
92
  } from "./fields/ImageField.tsx";
93
+ export {
94
+ type OptionalField,
95
+ type OptionalFieldContext,
96
+ } from "./fields/OptionalField.tsx";
93
97
  export { type BasicSelectorField } from "./fields/BasicSelectorField.tsx";
94
98
  export {
95
99
  type MultiSelectorOption,
@@ -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.10",
12234
+ version: "2.0.0-beta.12",
12235
12235
  author: "sprumo@yext.com",
12236
12236
  repository: {
12237
12237
  type: "git",
@@ -12283,7 +12283,7 @@ var package_default = {
12283
12283
  test: "pnpm run test:editor && pnpm run test:components",
12284
12284
  "test:pageGeneration:browser": "vitest run --config vitest.pageGenerationTest.config.ts",
12285
12285
  "test:editor": "vitest run --exclude './src/components/**/*.test.tsx' --browser.enabled false",
12286
- "test:components": "vitest run --dir ./src/components",
12286
+ "test:components": "vitest run --dir ./src/components --exclude '**/*.test.ts'",
12287
12287
  "test:components:local": "./scripts/localScreenshots.sh",
12288
12288
  prettier: "prettier --write --cache .",
12289
12289
  lint: "oxlint --fix --ignore-pattern 'src/vite-plugin/templates/*'",
@@ -12384,7 +12384,7 @@ var package_default = {
12384
12384
  jsdom: "^24.1.1",
12385
12385
  "lint-staged": "^15.2.7",
12386
12386
  pixelmatch: "^7.1.0",
12387
- playwright: "1.55.1",
12387
+ playwright: "1.65.0",
12388
12388
  pngjs: "^7.0.0",
12389
12389
  prettier: "^3.3.3",
12390
12390
  prompts: "^2.4.2",
@@ -1145,18 +1145,20 @@ type MultiSelectorFieldProps<T extends MultiSelectorOptionValue> = FieldProps<Mu
1145
1145
  */
1146
1146
  declare function MultiSelectorFieldOverride<T extends MultiSelectorOptionValue>({ field, value, onChange, id, readOnly, }: MultiSelectorFieldProps<T>): React.JSX.Element;
1147
1147
 
1148
- type OptionalNumberValue = number | string | null | undefined;
1149
- type OptionalNumberField = BaseField & {
1150
- type: "optionalNumber";
1151
- /** Returns a number or undefined before rendering. */
1152
- transform?: boolean;
1153
- label?: string | MsgString;
1154
- hideNumberFieldRadioLabel: string | MsgString;
1155
- showNumberFieldRadioLabel: string | MsgString;
1156
- defaultCustomValue: number;
1148
+ type CustomValue = string | number | boolean | null | Record<string, unknown> | unknown[];
1149
+ type OptionalFieldContext = {
1150
+ locale: string;
1157
1151
  };
1158
- type OptionalNumberFieldProps = FieldProps<OptionalNumberField, OptionalNumberValue>;
1159
- declare const OptionalNumberFieldOverride: ({ field, value, onChange, }: OptionalNumberFieldProps) => React__default.JSX.Element;
1152
+ /** Wraps a field without changing its value shape. Undefined selects Automatic. */
1153
+ interface OptionalField<Value = CustomValue> extends BaseField {
1154
+ type: "optional";
1155
+ label?: string | MsgString;
1156
+ automaticLabel?: string | MsgString;
1157
+ customLabel?: string | MsgString;
1158
+ field: YextFieldDefinition;
1159
+ /** Evaluated only when Custom is first selected without a remembered value. */
1160
+ defaultCustomValue: Value | ((context: OptionalFieldContext) => Value);
1161
+ }
1160
1162
 
1161
1163
  /** Generation limits supplied by ALPHA, independently of prompt wording. */
1162
1164
  declare const generationSettingsSchema: z.ZodObject<{
@@ -1317,13 +1319,17 @@ declare const StyledButtonFieldOverride: ({ field, value, onChange, }: StyledBut
1317
1319
 
1318
1320
  type StyledImageValue = {
1319
1321
  borderRadius: ImageBorderRadius | "default";
1322
+ /** A positive ratio, or "default" to inherit the component's sizing. */
1323
+ aspectRatio?: number | "default";
1320
1324
  };
1321
1325
  type StyledImageField = BaseField & {
1322
1326
  type: "styledImage";
1323
- /** Converts the authored border radius into CSS styles. */
1327
+ /** Converts the authored border radius and aspect ratio into CSS styles. */
1324
1328
  transform?: boolean;
1325
1329
  label?: string | MsgString;
1326
1330
  visible?: boolean;
1331
+ /** Shows the aspect-ratio control. Defaults to false. */
1332
+ includeAspectRatio?: boolean;
1327
1333
  };
1328
1334
  type StyledImageFieldProps = FieldProps<StyledImageField, StyledImageValue>;
1329
1335
  declare const StyledImageFieldOverride: ({ field, value, onChange, }: StyledImageFieldProps) => React__default.JSX.Element;
@@ -1522,7 +1528,7 @@ type FieldTransformContext = {
1522
1528
  itemDocument?: unknown;
1523
1529
  };
1524
1530
 
1525
- declare const alwaysTransformedFieldTypes: readonly ["code", "themeColor"];
1531
+ declare const alwaysTransformedFieldTypes: readonly ["code", "themeColor", "optional"];
1526
1532
 
1527
1533
  /** Maps explicit entity-field formats to their render-value conversion. */
1528
1534
  declare const entityFieldFormatters: {
@@ -1566,6 +1572,9 @@ type ResolvedRepeatedItem<Value, Definitions> = Value extends readonly (infer It
1566
1572
  type ResolvedRepeatedFieldValue<Value, Definition> = YextFieldDefinition["type"] extends (Definition extends {
1567
1573
  type: infer FieldType;
1568
1574
  } ? FieldType : never) ? ResolvedRepeatedValue<Value> : Definition extends {
1575
+ type: "optional";
1576
+ field: infer Wrapped;
1577
+ } ? Value extends undefined ? undefined : ResolvedRepeatedFieldValue<Value, Wrapped> : Definition extends {
1569
1578
  type: "object";
1570
1579
  objectFields: infer Fields;
1571
1580
  } ? ResolvedRepeatedItem<Value, Fields> : Definition extends {
@@ -1591,7 +1600,9 @@ type TransformedFieldValues<Value, Definition> = {
1591
1600
  value: infer Selection;
1592
1601
  }[];
1593
1602
  } ? Exclude<Selection, undefined>[] : never;
1594
- optionalNumber: number | undefined;
1603
+ optional: Definition extends {
1604
+ field: infer Wrapped;
1605
+ } ? Value extends undefined ? undefined : TransformedFieldValue<Value, Wrapped> : Value;
1595
1606
  ctaSelector: LocalizedRenderValue<EnhancedTranslatableCTA> | undefined;
1596
1607
  entityField: Definition extends {
1597
1608
  format: infer Format;
@@ -1635,7 +1646,7 @@ type YextPuckFields = {
1635
1646
  multiSelector: MultiSelectorField;
1636
1647
  fontSizeSelector: FontSizeSelectorField;
1637
1648
  image: ImageField;
1638
- optionalNumber: OptionalNumberField;
1649
+ optional: OptionalField;
1639
1650
  styledButton: StyledButtonField;
1640
1651
  styledImage: StyledImageField;
1641
1652
  styledLink: StyledLinkField;
@@ -1661,12 +1672,20 @@ type YextObjectField<Props extends {
1661
1672
  };
1662
1673
  type YextCustomFieldRenderProps<ValueType> = Parameters<CustomField<ValueType>["render"]>[0];
1663
1674
  type YextFieldDefinition<ValueType = any> = Field<ValueType, YextPuckField> | Field<NonNullable<ValueType>, YextPuckField> | YextPuckField | (ValueType extends Record<string, any>[] ? YextArrayField<ValueType> : never) | (ValueType extends Record<string, any> ? YextObjectField<ValueType> : never);
1675
+ /**
1676
+ * Puck 0.24's deep slot mapper expands intersections such as CSS's `string & {}`
1677
+ * into string-method objects. Normalize broad primitives before Puck traverses
1678
+ * them, while retaining literal unions, brands, and Puck's built-in leaf types.
1679
+ */
1680
+ type NormalizePuckPrimitives<Value> = Value extends string ? string extends Value ? string : Value : Value extends number ? number extends Value ? number : Value : Value extends Date | RegExp | Error | Function ? Value : Value extends object ? {
1681
+ [Key in keyof Value]: NormalizePuckPrimitives<Value[Key]>;
1682
+ } : Value;
1664
1683
  type YextComponentConfig<Props extends DefaultComponentProps = DefaultComponentProps, TransformFields = {}> = Omit<ComponentConfig<{
1665
1684
  props: Props;
1666
1685
  fields: YextPuckFields;
1667
1686
  }>, "fields" | "resolveFields" | "render"> & {
1668
1687
  render: ComponentConfig<{
1669
- props: YextTransformedProps<Props, TransformFields>;
1688
+ props: NormalizePuckPrimitives<YextTransformedProps<Props, TransformFields>>;
1670
1689
  fields: YextPuckFields;
1671
1690
  }>["render"];
1672
1691
  fields?: YextFields<Props>;
@@ -2154,4 +2173,4 @@ declare function createYextFieldTransforms(streamDocument: StreamDocument, local
2154
2173
  type: string;
2155
2174
  }>>;
2156
2175
 
2157
- export { type StyledPageSectionValue as $, type AiPageGeneration as A, type BasicSelectorField as B, type CreateItemSourceOptions as C, type DateTimeSelectorField as D, type EntityFieldTypes as E, type FontRegistry as F, EntityFieldSelectorFieldOverride as G, type HeadingProps as H, type ItemSourceInstance as I, MultiSelectorFieldOverride as J, type FontSizeSelectorField as K, type LocatorEntityType as L, type MsgString as M, ImageFieldOverride as N, type OptionalNumberField as O, type ProductPrice as P, type StyledButtonField as Q, type RichText as R, type StreamFields as S, type TranslationDictionary as T, type StyledButtonValue as U, type StyledImageField as V, type StyledImageValue as W, type StyledLinkField as X, type YextFieldMap as Y, type StyledLinkValue as Z, type StyledPageSectionField as _, type StreamDocument as a, type MultiSelectorOption as a$, type StyledTextField as a0, type TranslatableStringField as a1, type VideoField as a2, type AssetVideo as a3, type SectionLibraryTranslationLoaders as a4, Accordion as a5, AccordionContent as a6, AccordionItem as a7, AccordionTrigger as a8, type AssetImageType as a9, type FAQStruct as aA, FOOD_DELIVERY_SERVICES as aB, type FieldGenerationMetadata as aC, type Font as aD, FontSizeSelectorFieldOverride as aE, type FoodDeliveryServiceType as aF, type GenerationPromptBundle as aG, type GenerationSettings as aH, Heading as aI, type HeroSectionType as aJ, HoursStatusAtom as aK, type HoursStatusAtomProps as aL, HoursTableAtom as aM, type HoursTableAtomProps as aN, Image as aO, type ImageContentData as aP, type ImageField as aQ, type ImageProps as aR, type InsightSectionType as aS, type InsightStruct as aT, type LayoutGenerationMetadata as aU, type LocalizedAssetImage as aV, MaybeLink as aW, type MaybeLinkProps as aX, MaybeRTF as aY, type MaybeRTFProps as aZ, type MultiSelectorField as a_, Background as aa, type BackgroundProps as ab, BackgroundProvider as ac, BasicSelectorFieldOverride as ad, Body as ae, type BreadcrumbLink as af, Button as ag, type ButtonProps as ah, CTA as ai, type CTASelectorField as aj, CodeFieldOverride as ak, type ComprehensiveCTAField as al, type CreateSlottedItemSourceOptions as am, DateTimeSelectorFieldOverride as an, DropdownMenu as ao, DropdownMenuContent as ap, DropdownMenuItem as aq, DropdownMenuTrigger as ar, EmbeddedFieldStringInputFromEntity as as, EmbeddedFieldStringInputFromOptions as at, type EnhancedTranslatableCTA as au, EntityField as av, type EntityFieldSelectorField as aw, type EventSectionType as ax, type EventStruct as ay, type FAQSectionType as az, type ThemeConfig as b, fetchLocalesToPathsForEntity as b$, type MultiSelectorOptionValue as b0, type MultiSelectorOptions as b1, OptionalNumberFieldOverride as b2, PageSection as b3, type PageSectionProps as b4, type PersonStruct as b5, PhoneAtom as b6, type PhoneAtomProps as b7, type PresetImageType as b8, type ProductSectionType as b9, VisibilityWrapper as bA, VisualEditorComponentsContentPath as bB, VisualEditorThemeClassSafelist as bC, type YextArrayField as bD, YextAutoField as bE, type YextCTAField as bF, type YextCustomFieldRenderProps as bG, YextEntityFieldSelector as bH, type YextFieldDefinition as bI, type YextFields as bJ, type YextObjectField as bK, type YextPuckField as bL, type YextSchemaField as bM, type YextSchemaFieldDefinition as bN, type YextTransformedProps as bO, backgroundColors as bP, bindSlots as bQ, bodyVariants as bR, buttonVariants as bS, constructFontSelectOptions as bT, createSearchAnalyticsConfig as bU, createSearchHeadlessConfig as bV, createSlottedItemSource as bW, createYextFieldTransforms as bX, deepMerge as bY, defaultFonts as bZ, defaultThemeTailwindExtensions as b_, type ProductStruct as ba, type PromoSectionType as bb, type RenderYextEntityFieldSelectorProps as bc, type ResolvedThemeColor as bd, type RichTextStyleOverrides as be, type SlottedItemSourceGenerationMetadata as bf, StyledButtonFieldOverride as bg, StyledImageFieldOverride as bh, StyledLinkFieldOverride as bi, StyledPageSectionFieldOverride as bj, StyledTextFieldOverride as bk, type TeamSectionType as bl, TemplatePropsContext as bm, type TestimonialSectionType as bn, type TestimonialStruct as bo, ThemeColorFieldOverride as bp, TimestampAtom as bq, type TimestampAtomProps as br, TimestampOption as bs, type TranslatableCTA as bt, TranslatableStringFieldOverride as bu, type TranslationLoader as bv, type TranslationLoaders as bw, VideoAtom as bx, type VideoAtomProps as by, VideoFieldOverride as bz, type TailwindConfig as c, isColorContrastWcagCompliant as c$, generationPromptBundleSchema as c0, generationSettingsSchema as c1, getDefaultForegroundColor as c2, getFontWeightOptions as c3, getFontWeightOverrideOptions as c4, getPageMetadata as c5, getPreferredDistanceUnit as c6, getSurfaceColorStyle as c7, getThemeColorCssValue as c8, getThemeColorHexValue as c9, type SlotMappedCardsData as cA, type ComboboxOptionGroup as cB, ConstantValueModeToggler as cC, DEFAULT_ENTITY_TYPE as cD, type EmbeddedStringOption as cE, EntityTooltipsProvider as cF, type FieldResolution as cG, type FieldTypeData as cH, type ImagePayload as cI, LOCATOR_ENTITY_TYPES as cJ, type LocatorConfig as cK, type RootConfig as cL, buildLocatorDisplayOptions as cM, findField as cN, formatDistance as cO, formatPhoneNumber as cP, fromMeters as cQ, getBackgroundColorClasses as cR, getBackgroundColorStyle as cS, getCTAType as cT, getDisplayValue as cU, getEntityTypeLabel as cV, getImageAltText as cW, getLocatorEntityTypeSourceMap as cX, getTextColorClass as cY, getTextColorStyle as cZ, hexToRGB as c_, headingVariants as ca, imgSizesHelper as cb, isDarkColor as cc, isLocalizedAssetImage as cd, mergeMeta as ce, msg as cf, normalizeLink as cg, normalizeSlug as ch, normalizeThemeColorToken as ci, pt as cj, resolveBreadcrumbs as ck, resolveComponentData as cl, resolveDataFromParent as cm, resolveLocalizedAssetImage as cn, resolveUrlTemplate as co, resolveUrlTemplateOfChild as cp, resolveYextEntityField as cq, themeManagerCn as cr, themeManagerTwMergeConfiguration as cs, themeResolver as ct, toKilometers as cu, toPuckFields as cv, useBackground as cw, useDocument as cx, usePlatformTranslation as cy, useTemplateProps as cz, type ComponentRegistry as d, isCtaVariantWithColor as d0, isLocatorEntityType as d1, isNonNormalizableLinkType as d2, loadTranslationDictionary as d3, resolveDirectoryRootProps as d4, resolveField as d5, toMeters as d6, toMiles as d7, useEntityTooltips as d8, useTemplateMetadata as d9, type TranslatableRichText as e, ThemeOptions as f, type ThemeColor as g, type YextComponentConfig as h, type YextEntityField as i, type CTAVariant as j, type TranslatableString as k, type HeadingLevel as l, type ImageFillType as m, type TranslatableAssetImage as n, type ImgSizesByBreakpoint as o, type SlottedItemSourceInstance as p, type BodyProps as q, type MultiSelectorValue as r, type StyledTextValue as s, type ComprehensiveCTAValue as t, type ResolvedComprehensiveCTAValue as u, type CTAProps as v, type ThemeColorField as w, CTASelectorFieldOverride as x, type CodeField as y, ComprehensiveCTAFieldOverride as z };
2176
+ export { type StyledPageSectionValue as $, type AiPageGeneration as A, type BasicSelectorField as B, type CreateItemSourceOptions as C, type DateTimeSelectorField as D, type EntityFieldTypes as E, type FontRegistry as F, EntityFieldSelectorFieldOverride as G, type HeadingProps as H, type ItemSourceInstance as I, MultiSelectorFieldOverride as J, type FontSizeSelectorField as K, type LocatorEntityType as L, type MsgString as M, ImageFieldOverride as N, type OptionalField as O, type ProductPrice as P, type StyledButtonField as Q, type RichText as R, type StreamFields as S, type TranslationDictionary as T, type StyledButtonValue as U, type StyledImageField as V, type StyledImageValue as W, type StyledLinkField as X, type YextFieldMap as Y, type StyledLinkValue as Z, type StyledPageSectionField as _, type StreamDocument as a, type MultiSelectorOption as a$, type StyledTextField as a0, type TranslatableStringField as a1, type VideoField as a2, type AssetVideo as a3, type SectionLibraryTranslationLoaders as a4, Accordion as a5, AccordionContent as a6, AccordionItem as a7, AccordionTrigger as a8, type AssetImageType as a9, type FAQStruct as aA, FOOD_DELIVERY_SERVICES as aB, type FieldGenerationMetadata as aC, type Font as aD, FontSizeSelectorFieldOverride as aE, type FoodDeliveryServiceType as aF, type GenerationPromptBundle as aG, type GenerationSettings as aH, Heading as aI, type HeroSectionType as aJ, HoursStatusAtom as aK, type HoursStatusAtomProps as aL, HoursTableAtom as aM, type HoursTableAtomProps as aN, Image as aO, type ImageContentData as aP, type ImageField as aQ, type ImageProps as aR, type InsightSectionType as aS, type InsightStruct as aT, type LayoutGenerationMetadata as aU, type LocalizedAssetImage as aV, MaybeLink as aW, type MaybeLinkProps as aX, MaybeRTF as aY, type MaybeRTFProps as aZ, type MultiSelectorField as a_, Background as aa, type BackgroundProps as ab, BackgroundProvider as ac, BasicSelectorFieldOverride as ad, Body as ae, type BreadcrumbLink as af, Button as ag, type ButtonProps as ah, CTA as ai, type CTASelectorField as aj, CodeFieldOverride as ak, type ComprehensiveCTAField as al, type CreateSlottedItemSourceOptions as am, DateTimeSelectorFieldOverride as an, DropdownMenu as ao, DropdownMenuContent as ap, DropdownMenuItem as aq, DropdownMenuTrigger as ar, EmbeddedFieldStringInputFromEntity as as, EmbeddedFieldStringInputFromOptions as at, type EnhancedTranslatableCTA as au, EntityField as av, type EntityFieldSelectorField as aw, type EventSectionType as ax, type EventStruct as ay, type FAQSectionType as az, type ThemeConfig as b, fetchLocalesToPathsForEntity as b$, type MultiSelectorOptionValue as b0, type MultiSelectorOptions as b1, type OptionalFieldContext as b2, PageSection as b3, type PageSectionProps as b4, type PersonStruct as b5, PhoneAtom as b6, type PhoneAtomProps as b7, type PresetImageType as b8, type ProductSectionType as b9, VisibilityWrapper as bA, VisualEditorComponentsContentPath as bB, VisualEditorThemeClassSafelist as bC, type YextArrayField as bD, YextAutoField as bE, type YextCTAField as bF, type YextCustomFieldRenderProps as bG, YextEntityFieldSelector as bH, type YextFieldDefinition as bI, type YextFields as bJ, type YextObjectField as bK, type YextPuckField as bL, type YextSchemaField as bM, type YextSchemaFieldDefinition as bN, type YextTransformedProps as bO, backgroundColors as bP, bindSlots as bQ, bodyVariants as bR, buttonVariants as bS, constructFontSelectOptions as bT, createSearchAnalyticsConfig as bU, createSearchHeadlessConfig as bV, createSlottedItemSource as bW, createYextFieldTransforms as bX, deepMerge as bY, defaultFonts as bZ, defaultThemeTailwindExtensions as b_, type ProductStruct as ba, type PromoSectionType as bb, type RenderYextEntityFieldSelectorProps as bc, type ResolvedThemeColor as bd, type RichTextStyleOverrides as be, type SlottedItemSourceGenerationMetadata as bf, StyledButtonFieldOverride as bg, StyledImageFieldOverride as bh, StyledLinkFieldOverride as bi, StyledPageSectionFieldOverride as bj, StyledTextFieldOverride as bk, type TeamSectionType as bl, TemplatePropsContext as bm, type TestimonialSectionType as bn, type TestimonialStruct as bo, ThemeColorFieldOverride as bp, TimestampAtom as bq, type TimestampAtomProps as br, TimestampOption as bs, type TranslatableCTA as bt, TranslatableStringFieldOverride as bu, type TranslationLoader as bv, type TranslationLoaders as bw, VideoAtom as bx, type VideoAtomProps as by, VideoFieldOverride as bz, type TailwindConfig as c, isColorContrastWcagCompliant as c$, generationPromptBundleSchema as c0, generationSettingsSchema as c1, getDefaultForegroundColor as c2, getFontWeightOptions as c3, getFontWeightOverrideOptions as c4, getPageMetadata as c5, getPreferredDistanceUnit as c6, getSurfaceColorStyle as c7, getThemeColorCssValue as c8, getThemeColorHexValue as c9, type SlotMappedCardsData as cA, type ComboboxOptionGroup as cB, ConstantValueModeToggler as cC, DEFAULT_ENTITY_TYPE as cD, type EmbeddedStringOption as cE, EntityTooltipsProvider as cF, type FieldResolution as cG, type FieldTypeData as cH, type ImagePayload as cI, LOCATOR_ENTITY_TYPES as cJ, type LocatorConfig as cK, type RootConfig as cL, buildLocatorDisplayOptions as cM, findField as cN, formatDistance as cO, formatPhoneNumber as cP, fromMeters as cQ, getBackgroundColorClasses as cR, getBackgroundColorStyle as cS, getCTAType as cT, getDisplayValue as cU, getEntityTypeLabel as cV, getImageAltText as cW, getLocatorEntityTypeSourceMap as cX, getTextColorClass as cY, getTextColorStyle as cZ, hexToRGB as c_, headingVariants as ca, imgSizesHelper as cb, isDarkColor as cc, isLocalizedAssetImage as cd, mergeMeta as ce, msg as cf, normalizeLink as cg, normalizeSlug as ch, normalizeThemeColorToken as ci, pt as cj, resolveBreadcrumbs as ck, resolveComponentData as cl, resolveDataFromParent as cm, resolveLocalizedAssetImage as cn, resolveUrlTemplate as co, resolveUrlTemplateOfChild as cp, resolveYextEntityField as cq, themeManagerCn as cr, themeManagerTwMergeConfiguration as cs, themeResolver as ct, toKilometers as cu, toPuckFields as cv, useBackground as cw, useDocument as cx, usePlatformTranslation as cy, useTemplateProps as cz, type ComponentRegistry as d, isCtaVariantWithColor as d0, isLocatorEntityType as d1, isNonNormalizableLinkType as d2, loadTranslationDictionary as d3, resolveDirectoryRootProps as d4, resolveField as d5, toMeters as d6, toMiles as d7, useEntityTooltips as d8, useTemplateMetadata as d9, type TranslatableRichText as e, ThemeOptions as f, type ThemeColor as g, type YextComponentConfig as h, type YextEntityField as i, type CTAVariant as j, type TranslatableString as k, type HeadingLevel as l, type ImageFillType as m, type TranslatableAssetImage as n, type ImgSizesByBreakpoint as o, type SlottedItemSourceInstance as p, type BodyProps as q, type MultiSelectorValue as r, type StyledTextValue as s, type ComprehensiveCTAValue as t, type ResolvedComprehensiveCTAValue as u, type CTAProps as v, type ThemeColorField as w, CTASelectorFieldOverride as x, type CodeField as y, ComprehensiveCTAFieldOverride as z };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as StreamFields, a as StreamDocument, T as TranslationDictionary, b as ThemeConfig, P as ProductPrice, A as AiPageGeneration, Y as YextFieldMap, C as CreateItemSourceOptions, I as ItemSourceInstance, c as TailwindConfig, E as EntityFieldTypes, d as ComponentRegistry, e as TranslatableRichText, M as MsgString, R as RichText, f as ThemeOptions, g as ThemeColor, h as YextComponentConfig, i as YextEntityField, j as CTAVariant, k as TranslatableString, H as HeadingProps, l as HeadingLevel, m as ImageFillType, n as TranslatableAssetImage, o as ImgSizesByBreakpoint, B as BasicSelectorField, p as SlottedItemSourceInstance, L as LocatorEntityType, q as BodyProps, r as MultiSelectorValue, s as StyledTextValue, t as ComprehensiveCTAValue, u as ResolvedComprehensiveCTAValue, v as CTAProps, F as FontRegistry, w as ThemeColorField, x as CTASelectorFieldOverride, y as CodeField, z as ComprehensiveCTAFieldOverride, D as DateTimeSelectorField, G as EntityFieldSelectorFieldOverride, J as MultiSelectorFieldOverride, K as FontSizeSelectorField, N as ImageFieldOverride, O as OptionalNumberField, Q as StyledButtonField, U as StyledButtonValue, V as StyledImageField, W as StyledImageValue, X as StyledLinkField, Z as StyledLinkValue, _ as StyledPageSectionField, $ as StyledPageSectionValue, a0 as StyledTextField, a1 as TranslatableStringField, a2 as VideoField, a3 as AssetVideo, a4 as SectionLibraryTranslationLoaders } from './createYextFieldTransforms-CrIkiJ_X.js';
2
- export { a5 as Accordion, a6 as AccordionContent, a7 as AccordionItem, a8 as AccordionTrigger, a9 as AssetImageType, aa as Background, ab as BackgroundProps, ac as BackgroundProvider, ad as BasicSelectorFieldOverride, ae as Body, af as BreadcrumbLink, ag as Button, ah as ButtonProps, ai as CTA, aj as CTASelectorField, ak as CodeFieldOverride, al as ComprehensiveCTAField, am as CreateSlottedItemSourceOptions, an as DateTimeSelectorFieldOverride, ao as DropdownMenu, ap as DropdownMenuContent, aq as DropdownMenuItem, ar as DropdownMenuTrigger, as as EmbeddedFieldStringInputFromEntity, at as EmbeddedFieldStringInputFromOptions, au as EnhancedTranslatableCTA, av as EntityField, aw as EntityFieldSelectorField, ax as EventSectionType, ay as EventStruct, az as FAQSectionType, aA as FAQStruct, aB as FOOD_DELIVERY_SERVICES, aC as FieldGenerationMetadata, aD as Font, aE as FontSizeSelectorFieldOverride, aF as FoodDeliveryServiceType, aG as GenerationPromptBundle, aH as GenerationSettings, aI as Heading, aJ as HeroSectionType, aK as HoursStatusAtom, aL as HoursStatusAtomProps, aM as HoursTableAtom, aN as HoursTableAtomProps, aO as Image, aP as ImageContentData, aQ as ImageField, aR as ImageProps, aS as InsightSectionType, aT as InsightStruct, aU as LayoutGenerationMetadata, aV as LocalizedAssetImage, aW as MaybeLink, aX as MaybeLinkProps, aY as MaybeRTF, aZ as MaybeRTFProps, a_ as MultiSelectorField, a$ as MultiSelectorOption, b0 as MultiSelectorOptionValue, b1 as MultiSelectorOptions, b2 as OptionalNumberFieldOverride, b3 as PageSection, b4 as PageSectionProps, b5 as PersonStruct, b6 as PhoneAtom, b7 as PhoneAtomProps, b8 as PresetImageType, b9 as ProductSectionType, ba as ProductStruct, bb as PromoSectionType, bc as RenderYextEntityFieldSelectorProps, bd as ResolvedThemeColor, be as RichTextStyleOverrides, bf as SlottedItemSourceGenerationMetadata, bg as StyledButtonFieldOverride, bh as StyledImageFieldOverride, bi as StyledLinkFieldOverride, bj as StyledPageSectionFieldOverride, bk as StyledTextFieldOverride, bl as TeamSectionType, bm as TemplatePropsContext, bn as TestimonialSectionType, bo as TestimonialStruct, bp as ThemeColorFieldOverride, bq as TimestampAtom, br as TimestampAtomProps, bs as TimestampOption, bt as TranslatableCTA, bu as TranslatableStringFieldOverride, bv as TranslationLoader, bw as TranslationLoaders, bx as VideoAtom, by as VideoAtomProps, bz as VideoFieldOverride, bA as VisibilityWrapper, bB as VisualEditorComponentsContentPath, bC as VisualEditorThemeClassSafelist, bD as YextArrayField, bE as YextAutoField, bF as YextCTAField, bG as YextCustomFieldRenderProps, bH as YextEntityFieldSelector, bI as YextFieldDefinition, bJ as YextFields, bK as YextObjectField, bL as YextPuckField, bM as YextSchemaField, bN as YextSchemaFieldDefinition, bO as YextTransformedProps, bP as backgroundColors, bQ as bindSlots, bR as bodyVariants, bS as buttonVariants, bT as constructFontSelectOptions, bU as createSearchAnalyticsConfig, bV as createSearchHeadlessConfig, bW as createSlottedItemSource, bX as createYextFieldTransforms, bY as deepMerge, bZ as defaultFonts, b_ as defaultThemeTailwindExtensions, b$ as fetchLocalesToPathsForEntity, c0 as generationPromptBundleSchema, c1 as generationSettingsSchema, c2 as getDefaultForegroundColor, c3 as getFontWeightOptions, c4 as getFontWeightOverrideOptions, c5 as getPageMetadata, c6 as getPreferredDistanceUnit, c7 as getSurfaceColorStyle, c8 as getThemeColorCssValue, c9 as getThemeColorHexValue, ca as headingVariants, cb as imgSizesHelper, cc as isDarkColor, cd as isLocalizedAssetImage, ce as mergeMeta, cf as msg, cg as normalizeLink, ch as normalizeSlug, ci as normalizeThemeColorToken, cj as pt, ck as resolveBreadcrumbs, cl as resolveComponentData, cm as resolveDataFromParent, cn as resolveLocalizedAssetImage, co as resolveUrlTemplate, cp as resolveUrlTemplateOfChild, cq as resolveYextEntityField, cr as themeManagerCn, cs as themeManagerTwMergeConfiguration, ct as themeResolver, cu as toKilometers, cv as toPuckFields, cw as useBackground, cx as useDocument, cy as usePlatformTranslation, cz as useTemplateProps } from './createYextFieldTransforms-CrIkiJ_X.js';
1
+ import { S as StreamFields, a as StreamDocument, T as TranslationDictionary, b as ThemeConfig, P as ProductPrice, A as AiPageGeneration, Y as YextFieldMap, C as CreateItemSourceOptions, I as ItemSourceInstance, c as TailwindConfig, E as EntityFieldTypes, d as ComponentRegistry, e as TranslatableRichText, M as MsgString, R as RichText, f as ThemeOptions, g as ThemeColor, h as YextComponentConfig, i as YextEntityField, j as CTAVariant, k as TranslatableString, H as HeadingProps, l as HeadingLevel, m as ImageFillType, n as TranslatableAssetImage, o as ImgSizesByBreakpoint, B as BasicSelectorField, p as SlottedItemSourceInstance, L as LocatorEntityType, q as BodyProps, r as MultiSelectorValue, s as StyledTextValue, t as ComprehensiveCTAValue, u as ResolvedComprehensiveCTAValue, v as CTAProps, F as FontRegistry, w as ThemeColorField, x as CTASelectorFieldOverride, y as CodeField, z as ComprehensiveCTAFieldOverride, D as DateTimeSelectorField, G as EntityFieldSelectorFieldOverride, J as MultiSelectorFieldOverride, K as FontSizeSelectorField, N as ImageFieldOverride, O as OptionalField, Q as StyledButtonField, U as StyledButtonValue, V as StyledImageField, W as StyledImageValue, X as StyledLinkField, Z as StyledLinkValue, _ as StyledPageSectionField, $ as StyledPageSectionValue, a0 as StyledTextField, a1 as TranslatableStringField, a2 as VideoField, a3 as AssetVideo, a4 as SectionLibraryTranslationLoaders } from './createYextFieldTransforms-B3f0jVg6.js';
2
+ export { a5 as Accordion, a6 as AccordionContent, a7 as AccordionItem, a8 as AccordionTrigger, a9 as AssetImageType, aa as Background, ab as BackgroundProps, ac as BackgroundProvider, ad as BasicSelectorFieldOverride, ae as Body, af as BreadcrumbLink, ag as Button, ah as ButtonProps, ai as CTA, aj as CTASelectorField, ak as CodeFieldOverride, al as ComprehensiveCTAField, am as CreateSlottedItemSourceOptions, an as DateTimeSelectorFieldOverride, ao as DropdownMenu, ap as DropdownMenuContent, aq as DropdownMenuItem, ar as DropdownMenuTrigger, as as EmbeddedFieldStringInputFromEntity, at as EmbeddedFieldStringInputFromOptions, au as EnhancedTranslatableCTA, av as EntityField, aw as EntityFieldSelectorField, ax as EventSectionType, ay as EventStruct, az as FAQSectionType, aA as FAQStruct, aB as FOOD_DELIVERY_SERVICES, aC as FieldGenerationMetadata, aD as Font, aE as FontSizeSelectorFieldOverride, aF as FoodDeliveryServiceType, aG as GenerationPromptBundle, aH as GenerationSettings, aI as Heading, aJ as HeroSectionType, aK as HoursStatusAtom, aL as HoursStatusAtomProps, aM as HoursTableAtom, aN as HoursTableAtomProps, aO as Image, aP as ImageContentData, aQ as ImageField, aR as ImageProps, aS as InsightSectionType, aT as InsightStruct, aU as LayoutGenerationMetadata, aV as LocalizedAssetImage, aW as MaybeLink, aX as MaybeLinkProps, aY as MaybeRTF, aZ as MaybeRTFProps, a_ as MultiSelectorField, a$ as MultiSelectorOption, b0 as MultiSelectorOptionValue, b1 as MultiSelectorOptions, b2 as OptionalFieldContext, b3 as PageSection, b4 as PageSectionProps, b5 as PersonStruct, b6 as PhoneAtom, b7 as PhoneAtomProps, b8 as PresetImageType, b9 as ProductSectionType, ba as ProductStruct, bb as PromoSectionType, bc as RenderYextEntityFieldSelectorProps, bd as ResolvedThemeColor, be as RichTextStyleOverrides, bf as SlottedItemSourceGenerationMetadata, bg as StyledButtonFieldOverride, bh as StyledImageFieldOverride, bi as StyledLinkFieldOverride, bj as StyledPageSectionFieldOverride, bk as StyledTextFieldOverride, bl as TeamSectionType, bm as TemplatePropsContext, bn as TestimonialSectionType, bo as TestimonialStruct, bp as ThemeColorFieldOverride, bq as TimestampAtom, br as TimestampAtomProps, bs as TimestampOption, bt as TranslatableCTA, bu as TranslatableStringFieldOverride, bv as TranslationLoader, bw as TranslationLoaders, bx as VideoAtom, by as VideoAtomProps, bz as VideoFieldOverride, bA as VisibilityWrapper, bB as VisualEditorComponentsContentPath, bC as VisualEditorThemeClassSafelist, bD as YextArrayField, bE as YextAutoField, bF as YextCTAField, bG as YextCustomFieldRenderProps, bH as YextEntityFieldSelector, bI as YextFieldDefinition, bJ as YextFields, bK as YextObjectField, bL as YextPuckField, bM as YextSchemaField, bN as YextSchemaFieldDefinition, bO as YextTransformedProps, bP as backgroundColors, bQ as bindSlots, bR as bodyVariants, bS as buttonVariants, bT as constructFontSelectOptions, bU as createSearchAnalyticsConfig, bV as createSearchHeadlessConfig, bW as createSlottedItemSource, bX as createYextFieldTransforms, bY as deepMerge, bZ as defaultFonts, b_ as defaultThemeTailwindExtensions, b$ as fetchLocalesToPathsForEntity, c0 as generationPromptBundleSchema, c1 as generationSettingsSchema, c2 as getDefaultForegroundColor, c3 as getFontWeightOptions, c4 as getFontWeightOverrideOptions, c5 as getPageMetadata, c6 as getPreferredDistanceUnit, c7 as getSurfaceColorStyle, c8 as getThemeColorCssValue, c9 as getThemeColorHexValue, ca as headingVariants, cb as imgSizesHelper, cc as isDarkColor, cd as isLocalizedAssetImage, ce as mergeMeta, cf as msg, cg as normalizeLink, ch as normalizeSlug, ci as normalizeThemeColorToken, cj as pt, ck as resolveBreadcrumbs, cl as resolveComponentData, cm as resolveDataFromParent, cn as resolveLocalizedAssetImage, co as resolveUrlTemplate, cp as resolveUrlTemplateOfChild, cq as resolveYextEntityField, cr as themeManagerCn, cs as themeManagerTwMergeConfiguration, ct as themeResolver, cu as toKilometers, cv as toPuckFields, cw as useBackground, cx as useDocument, cy as usePlatformTranslation, cz as useTemplateProps } from './createYextFieldTransforms-B3f0jVg6.js';
3
3
  import * as React$1 from 'react';
4
4
  import React__default from 'react';
5
5
  import * as _puckeditor_core from '@puckeditor/core';
@@ -738,6 +738,11 @@ interface LocatorResultCardProps {
738
738
  showCountry?: boolean;
739
739
  /** Whether to show the "Get Directions" link */
740
740
  showGetDirectionsLink: boolean;
741
+ /**
742
+ * Whether to open the Get Directions link in a new tab.
743
+ * @defaultValue false
744
+ */
745
+ openInNewTab?: boolean;
741
746
  /** Whether the address block is visible in live mode */
742
747
  liveVisibility: boolean;
743
748
  };
@@ -892,6 +897,16 @@ interface LocatorProps {
892
897
  /** The optional display name for the Keywords facet. */
893
898
  keywordsDisplayName?: TranslatableString;
894
899
  };
900
+ /**
901
+ * The default radius for nearby-location searches. Leave unset to use Search's
902
+ * suggested radius, or 25 in the locale's preferred unit for coordinate searches.
903
+ * Visitor-selected distances and explicit map/URL search areas take precedence.
904
+ * Geographic boundary filters are unaffected.
905
+ */
906
+ defaultSearchRadius?: {
907
+ value?: number;
908
+ unit: "mile" | "kilometer";
909
+ };
895
910
  /**
896
911
  * The starting location for the map.
897
912
  */
@@ -1194,13 +1209,7 @@ declare const YextPuckFieldOverrides: {
1194
1209
  readOnly?: boolean;
1195
1210
  }) => React$1.JSX.Element;
1196
1211
  image: typeof ImageFieldOverride;
1197
- optionalNumber: ({ field, value, onChange, }: {
1198
- field: OptionalNumberField;
1199
- value: string | number | null | undefined;
1200
- id?: string;
1201
- onChange: (value: string | number | null | undefined, uiState?: Partial<_puckeditor_core.UiState>) => void;
1202
- readOnly?: boolean;
1203
- }) => React$1.JSX.Element;
1212
+ optional: ({ field, value, onChange, readOnly, }: _puckeditor_core.FieldProps<OptionalField, (string | number | boolean | unknown[] | Record<string, unknown> | null) | undefined>) => React$1.JSX.Element;
1204
1213
  styledButton: ({ field, value, onChange, }: {
1205
1214
  field: StyledButtonField;
1206
1215
  value: StyledButtonValue;
@@ -1285,4 +1294,4 @@ type LocalEditorShellProps = {
1285
1294
 
1286
1295
  declare const LocalEditorShell: ({ apiBasePath, routePath, componentRegistry, tailwindConfig, themeConfig, sectionLibraryMigrationRegistry, translationLoaders, chatEnabled, }: LocalEditorShellProps) => React__default.JSX.Element;
1287
1296
 
1288
- export { Address, type AddressProps, type AggregateRating, AssetVideo, BasicSelectorField, BodyProps, type BreadcrumbsData, BreadcrumbsSection, type BreadcrumbsSectionProps, type BreadcrumbsStyles, CTASelectorFieldOverride, CTAVariant, CodeField, type ComponentField, ComponentFields, ComprehensiveCTA, ComprehensiveCTAFieldOverride, type ComprehensiveCTARenderProps as ComprehensiveCTAProps, ComprehensiveCTAValue, CreateItemSourceOptions, CustomCodeSection, type CustomCodeSectionProps, DateTimeSelectorField, Directory, DirectoryCard, type DirectoryCardProps, DirectoryGrid, type DirectoryGridProps, DirectoryList, type DirectoryProps, type DirectoryStyles, Editor, EntityFieldSelectorFieldOverride, FontRegistry, FontSizeSelectorField, GTMBody, HeadingLevel, HeadingProps, HeadingText, type HeadingTextProps, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableProps, ImageFieldOverride, ImageFillType, ImageWrapper, type ImageWrapperProps, ImgSizesByBreakpoint, ItemSourceInstance, KnowledgeGraphIcon, LanguageDropdown, type LanguageDropdownProps, type LocalDevOptions, LocalEditorShell, type Location, LocatorComponent, type LocatorProps, LocatorResultCard, type LocatorResultCardProps, MainContent, type MainContentProps, MapboxStaticMap, MapboxStaticMapComponent, type MapboxStaticProps, type Metadata, type Migration, type MigrationAction, type MigrationRegistry, MultiSelectorFieldOverride, MultiSelectorValue, type NearbyLocationDoc, type NearbyLocationsResponse, OptionalNumberField, Phone, type PhoneProps, ProductPrice, ResolvedComprehensiveCTAValue, ReviewStars, type ReviewStarsProps, RichText, type SectionConfig, SectionLibraryTranslationLoaders, SlottedItemSourceInstance, SpacingSelector, StreamDocument, StyledButtonField, StyledButtonValue, StyledImageField, StyledImageValue, StyledLinkField, StyledLinkValue, StyledPageSectionField, StyledPageSectionValue, type StyledPlainTextProps, type StyledRichTextProps, StyledTextComponent, StyledTextElement, StyledTextField, StyledTextValue, TailwindConfigContext, ThemeColor, ThemeColorField, ThemeConfig, ThemeOptions, TranslatableAssetImage, TranslatableRichText, TranslatableRichTextField, TranslatableString, TranslatableStringField, TranslationDictionary, VideoField, VisualEditorProvider, VisualEditorRender, type VisualEditorRenderProps, YextComponentConfig, YextEntityField, YextFieldMap, YextPuckFieldOverrides, addHeadingAlignmentMigration, applyAnalytics, applyCertifiedFacts, applyHeaderScript, applyTheme, createDefaultThemeConfig, createItemSource, createStyledTextConfig, defaultThemeConfig, filterMaxWidths, formatCurrency, getAggregateRating, getAnalyticsScopeHash, getCanonicalUrl, getDefaultRTF, getDirectoryParents, getMaxWidthOptions, getSchema, getStyledTextStyle, i18nPageInstance, i18nPlatformInstance, injectTranslations, mapStyleField, mapboxStaticMapStyleOptions, migrate, migrationRegistry, parseDocumentForLanguageDropdown, renderStyledRichText, useEntityFields, useNearbyLocations, type useNearbyLocationsOptions, useOverflow, usePlatformBridgeDocument, usePlatformBridgeEntityFields, useTailwindConfig };
1297
+ export { Address, type AddressProps, type AggregateRating, AssetVideo, BasicSelectorField, BodyProps, type BreadcrumbsData, BreadcrumbsSection, type BreadcrumbsSectionProps, type BreadcrumbsStyles, CTASelectorFieldOverride, CTAVariant, CodeField, type ComponentField, ComponentFields, ComprehensiveCTA, ComprehensiveCTAFieldOverride, type ComprehensiveCTARenderProps as ComprehensiveCTAProps, ComprehensiveCTAValue, CreateItemSourceOptions, CustomCodeSection, type CustomCodeSectionProps, DateTimeSelectorField, Directory, DirectoryCard, type DirectoryCardProps, DirectoryGrid, type DirectoryGridProps, DirectoryList, type DirectoryProps, type DirectoryStyles, Editor, EntityFieldSelectorFieldOverride, FontRegistry, FontSizeSelectorField, GTMBody, HeadingLevel, HeadingProps, HeadingText, type HeadingTextProps, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableProps, ImageFieldOverride, ImageFillType, ImageWrapper, type ImageWrapperProps, ImgSizesByBreakpoint, ItemSourceInstance, KnowledgeGraphIcon, LanguageDropdown, type LanguageDropdownProps, type LocalDevOptions, LocalEditorShell, type Location, LocatorComponent, type LocatorProps, LocatorResultCard, type LocatorResultCardProps, MainContent, type MainContentProps, MapboxStaticMap, MapboxStaticMapComponent, type MapboxStaticProps, type Metadata, type Migration, type MigrationAction, type MigrationRegistry, MultiSelectorFieldOverride, MultiSelectorValue, type NearbyLocationDoc, type NearbyLocationsResponse, OptionalField, Phone, type PhoneProps, ProductPrice, ResolvedComprehensiveCTAValue, ReviewStars, type ReviewStarsProps, RichText, type SectionConfig, SectionLibraryTranslationLoaders, SlottedItemSourceInstance, SpacingSelector, StreamDocument, StyledButtonField, StyledButtonValue, StyledImageField, StyledImageValue, StyledLinkField, StyledLinkValue, StyledPageSectionField, StyledPageSectionValue, type StyledPlainTextProps, type StyledRichTextProps, StyledTextComponent, StyledTextElement, StyledTextField, StyledTextValue, TailwindConfigContext, ThemeColor, ThemeColorField, ThemeConfig, ThemeOptions, TranslatableAssetImage, TranslatableRichText, TranslatableRichTextField, TranslatableString, TranslatableStringField, TranslationDictionary, VideoField, VisualEditorProvider, VisualEditorRender, type VisualEditorRenderProps, YextComponentConfig, YextEntityField, YextFieldMap, YextPuckFieldOverrides, addHeadingAlignmentMigration, applyAnalytics, applyCertifiedFacts, applyHeaderScript, applyTheme, createDefaultThemeConfig, createItemSource, createStyledTextConfig, defaultThemeConfig, filterMaxWidths, formatCurrency, getAggregateRating, getAnalyticsScopeHash, getCanonicalUrl, getDefaultRTF, getDirectoryParents, getMaxWidthOptions, getSchema, getStyledTextStyle, i18nPageInstance, i18nPlatformInstance, injectTranslations, mapStyleField, mapboxStaticMapStyleOptions, migrate, migrationRegistry, parseDocumentForLanguageDropdown, renderStyledRichText, useEntityFields, useNearbyLocations, type useNearbyLocationsOptions, useOverflow, usePlatformBridgeDocument, usePlatformBridgeEntityFields, useTailwindConfig };
@@ -132,9 +132,11 @@
132
132
  "data": "Data",
133
133
  "dataAttributes": "Atributy dat",
134
134
  "dayOfWeekFormat": "Formát dne týdne",
135
+ "defaultSearchRadius": "Výchozí poloměr vyhledávání",
135
136
  "directoryListBackgroundColor": "Barva pozadí seznamu adresářů",
136
137
  "directoryRootLinkLabel": "Štítek kořenového odkazu na adresář",
137
138
  "distanceDisplay": "Zobrazení vzdálenosti",
139
+ "distanceUnit": "Jednotka vzdálenosti",
138
140
  "dynamicFilters": "Dynamické filtry",
139
141
  "email": "E-mail",
140
142
  "entityType": "Typ entity",
@@ -174,6 +176,7 @@
174
176
  "openInNewTab": "Otevřít na nové kartě",
175
177
  "options": {
176
178
  "aspectRatio": "Poměr stran",
179
+ "automatic": "Automatický",
177
180
  "base_text size": "Báze",
178
181
  "bothDistances": "Obě vzdálenosti",
179
182
  "bottom_direction": "Dole",
@@ -289,6 +292,7 @@
289
292
  "presetImage": "Přednastavený obrázek",
290
293
  "primaryCTA": "Primární CTA",
291
294
  "primaryHeading": "Primární nadpis",
295
+ "radius": "Poloměr",
292
296
  "resultCard": "Karta výsledků",
293
297
  "scope": "Rozsah",
294
298
  "secondaryCTA": "Sekundární CTA",
@@ -132,9 +132,11 @@
132
132
  "data": "Data",
133
133
  "dataAttributes": "Dataattributter",
134
134
  "dayOfWeekFormat": "Ugeformat",
135
+ "defaultSearchRadius": "Standardradius for søgning",
135
136
  "directoryListBackgroundColor": "Directory List Baggrundsfarve",
136
137
  "directoryRootLinkLabel": "Directory Root Link Label",
137
138
  "distanceDisplay": "Afstandsvisning",
139
+ "distanceUnit": "Afstandsenhed",
138
140
  "dynamicFilters": "Dynamiske filtre",
139
141
  "email": "E -mail",
140
142
  "entityType": "Enhedstype",
@@ -174,6 +176,7 @@
174
176
  "openInNewTab": "Åbn i ny fane",
175
177
  "options": {
176
178
  "aspectRatio": "Aspektforhold",
179
+ "automatic": "Automatisk",
177
180
  "base_text size": "Basis",
178
181
  "bothDistances": "Begge afstande",
179
182
  "bottom_direction": "Nederst",
@@ -289,6 +292,7 @@
289
292
  "presetImage": "Forudindstillet billede",
290
293
  "primaryCTA": "Primær CTA",
291
294
  "primaryHeading": "Primær overskrift",
295
+ "radius": "Radius",
292
296
  "resultCard": "Resultatkort",
293
297
  "scope": "Omfang",
294
298
  "secondaryCTA": "Sekundær CTA",
@@ -132,9 +132,11 @@
132
132
  "data": "Daten",
133
133
  "dataAttributes": "Datenattribute",
134
134
  "dayOfWeekFormat": "Wochentagsformat",
135
+ "defaultSearchRadius": "Standardsuchradius",
135
136
  "directoryListBackgroundColor": "Hintergrundfarbe der Verzeichnisliste",
136
137
  "directoryRootLinkLabel": "Link-Label für Directory-Root",
137
138
  "distanceDisplay": "Entfernungsanzeige",
139
+ "distanceUnit": "Entfernungseinheit",
138
140
  "dynamicFilters": "Dynamische Filter",
139
141
  "email": "E-Mail",
140
142
  "entityType": "Entitätstyp",
@@ -174,6 +176,7 @@
174
176
  "openInNewTab": "In neuem Tab öffnen",
175
177
  "options": {
176
178
  "aspectRatio": "Seitenverhältnis",
179
+ "automatic": "Automatisch",
177
180
  "base_text size": "Base",
178
181
  "bothDistances": "Beide Entfernungen",
179
182
  "bottom_direction": "Unten",
@@ -289,6 +292,7 @@
289
292
  "presetImage": "Voreingestelltes Bild",
290
293
  "primaryCTA": "Primärer CTA",
291
294
  "primaryHeading": "Primäre Überschrift",
295
+ "radius": "Radius",
292
296
  "resultCard": "Ergebniskarte",
293
297
  "scope": "Umfang",
294
298
  "secondaryCTA": "Sekundärer CTA",
@@ -132,9 +132,11 @@
132
132
  "data": "Data",
133
133
  "dataAttributes": "Data Attributes",
134
134
  "dayOfWeekFormat": "Day of Week Format",
135
+ "defaultSearchRadius": "Default Search Radius",
135
136
  "directoryListBackgroundColor": "Directory List Background Color",
136
137
  "directoryRootLinkLabel": "Directory Root Link Label",
137
138
  "distanceDisplay": "Distance Display",
139
+ "distanceUnit": "Distance Unit",
138
140
  "dynamicFilters": "Dynamic Filters",
139
141
  "email": "Email",
140
142
  "entityType": "Entity Type",
@@ -174,6 +176,7 @@
174
176
  "openInNewTab": "Open in new tab",
175
177
  "options": {
176
178
  "aspectRatio": "Aspect Ratio",
179
+ "automatic": "Automatic",
177
180
  "base_text size": "Base",
178
181
  "bothDistances": "Both Distances",
179
182
  "bottom_direction": "Bottom",
@@ -289,6 +292,7 @@
289
292
  "presetImage": "Preset Image",
290
293
  "primaryCTA": "Primary CTA",
291
294
  "primaryHeading": "Primary Heading",
295
+ "radius": "Radius",
292
296
  "resultCard": "Result Card",
293
297
  "scope": "Scope",
294
298
  "secondaryCTA": "Secondary CTA",
@@ -132,9 +132,11 @@
132
132
  "data": "Data",
133
133
  "dataAttributes": "Data Attributes",
134
134
  "dayOfWeekFormat": "Day of Week Format",
135
+ "defaultSearchRadius": "Default Search Radius",
135
136
  "directoryListBackgroundColor": "Directory List Background Color",
136
137
  "directoryRootLinkLabel": "Directory Root Link Label",
137
138
  "distanceDisplay": "Distance Display",
139
+ "distanceUnit": "Distance Unit",
138
140
  "dynamicFilters": "Dynamic Filters",
139
141
  "email": "Email",
140
142
  "entityType": "Entity Type",
@@ -174,6 +176,7 @@
174
176
  "openInNewTab": "Open in new tab",
175
177
  "options": {
176
178
  "aspectRatio": "Aspect Ratio",
179
+ "automatic": "Automatic",
177
180
  "base_text size": "Base",
178
181
  "bothDistances": "Both Distances",
179
182
  "bottom_direction": "Bottom",
@@ -289,6 +292,7 @@
289
292
  "presetImage": "Preset Image",
290
293
  "primaryCTA": "Primary CTA",
291
294
  "primaryHeading": "Primary Heading",
295
+ "radius": "Radius",
292
296
  "resultCard": "Result Card",
293
297
  "scope": "Scope",
294
298
  "secondaryCTA": "Secondary CTA",