@yext/pages-components 1.0.0 → 1.0.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.
@@ -1,5 +1,5 @@
1
1
  import _n from "react";
2
- import { n as sr, a as cr, b as Nn, m as K, d as B, s as On, p as bn, r as Ce, e as Me, f as Cn, h as En, i as he, k as fr, l as pr, o as hr, q as de, t as xn, u as dr, v as mr } from "./index-DaOqO1Xz.js";
2
+ import { n as sr, a as cr, b as Nn, m as K, d as B, s as On, p as bn, r as Ce, e as Me, f as Cn, h as En, i as he, k as fr, l as pr, o as hr, q as de, t as xn, u as dr, v as mr } from "./index-ChSAX9jE.js";
3
3
  function gr(n) {
4
4
  const t = [];
5
5
  let e = -1;
package/dist/index.d.cts CHANGED
@@ -90,6 +90,15 @@ interface GetDirectionsConfig {
90
90
  provider?: MapProvider$1;
91
91
  route?: boolean;
92
92
  }
93
+ /**
94
+ * Type definition for coordinate
95
+ *
96
+ * @public
97
+ */
98
+ interface DirectionCoordinate {
99
+ latitude: number;
100
+ longitude: number;
101
+ }
93
102
 
94
103
  /**
95
104
  * Renders an HTML address based from the Yext Knowledge Graph. Example of using the component to render
@@ -116,10 +125,11 @@ declare const Address: ({ address, lines, separator, ...props }: AddressProps) =
116
125
  * @param listings - List of available Yext Listings
117
126
  * @param googlePlaceId - Google Place ID
118
127
  * @param config - Options for determining URL
128
+ * @param coordinates - Coordinates of location, if provided will be used instead of address or listings
119
129
  *
120
130
  * @returns Maps service url
121
131
  */
122
- declare const getDirections: (address?: AddressType, listings?: ListingType[], googlePlaceId?: string, config?: GetDirectionsConfig) => string | undefined;
132
+ declare const getDirections: (address?: AddressType, listings?: ListingType[], googlePlaceId?: string, config?: GetDirectionsConfig, coordinate?: DirectionCoordinate) => string | undefined;
123
133
 
124
134
  /**
125
135
  * The shape of the data passed directly to the different template functions with the
@@ -139,6 +149,8 @@ type TrackProps = {
139
149
  eventName?: string;
140
150
  amount?: number;
141
151
  currency?: string;
152
+ customTags?: Record<string, string>;
153
+ customValues?: Record<string, number>;
142
154
  };
143
155
  /**
144
156
  * The AnalyticsMethod interface specifies the methods that can be used with
@@ -209,14 +221,10 @@ interface AnalyticsProviderProps {
209
221
  disableSessionTracking?: boolean | undefined;
210
222
  /**
211
223
  * enableDebugging can be set to true if you want to expose tracked events
212
- * in the developer console.
224
+ * in the Browser's developer console. When true, events will only be logged
225
+ * and will NOT be fired/sent through the Analytics SDK.
213
226
  */
214
227
  enableDebugging?: boolean | undefined;
215
- /**
216
- * isProduction() will evaluate to true if the event is fired from any of
217
- * provided domains in productionDomains.
218
- */
219
- productionDomains?: string[];
220
228
  }
221
229
  /**
222
230
  * AnalyticsScopeProps defines the component properties required by the
@@ -329,6 +337,11 @@ declare const useIdentify: () => ((visitor: Record<string, string>) => void) | u
329
337
  * @public
330
338
  */
331
339
  declare function AnalyticsProvider(props: PropsWithChildren<AnalyticsProviderProps>): JSX.Element;
340
+ /**
341
+ * This will look for the xYextDebug parameter and if it is present,
342
+ * enable analytics debugging.
343
+ */
344
+ declare function debuggingParamDetected(): boolean;
332
345
 
333
346
  /**
334
347
  * The useScope hook will return the current scope from the Analytics Scope. For
@@ -535,6 +548,16 @@ interface LinkConfig extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<
535
548
  currency?: string;
536
549
  /** The monetary value of the event. */
537
550
  amount?: number;
551
+ /**
552
+ * Up to 10 pairs matching custom string keys to string values to associate with the event.
553
+ * Keys are case-insensitive; values are case-sensitive.
554
+ */
555
+ customTags?: Record<string, string>;
556
+ /**
557
+ * Up to 10 pairs matching custom string keys to number values to associate with the event.
558
+ * Keys are case-insensitive.
559
+ */
560
+ customValues?: Record<string, number>;
538
561
  }
539
562
  /**
540
563
  * The shape of the data passed to {@link Link} when directly passing an HREF to the Link component.
@@ -1307,4 +1330,4 @@ declare const LeafletMaps: any;
1307
1330
  */
1308
1331
  declare const MapQuestMaps: any;
1309
1332
 
1310
- export { Address, type AddressLine, type AddressLineProps, type AddressProps, type AddressType, Analytics, AnalyticsContext, AnalyticsProvider, AnalyticsScopeProvider, BaiduMaps, BingMaps, type CTA, type CTAWithChildrenLinkProps, type CTAWithoutChildrenLinkProps, type ClusterTemplateProps, Clusterer, type ClustererContextType, type ClustererProps, type ComplexImageType, type Coordinate, Coordinate$1 as CoordinateClass, Day, type DayOfWeekNames, type DayType, type GetDirectionsConfig, GoogleMaps, type HREFLinkProps, type HolidayType, HoursStatus, HoursTable, type HoursTableDayData, type HoursTableProps, type HoursType, Image, type ImageLayout, ImageLayoutOption, type ImageProps, type ImageType, type IntervalType, LeafletMaps, LegacyRichText, LexicalRichText, type LexicalRichTextProps, Link, type LinkProps, type LinkType, LinkTypes, type ListingPublisher, ListingPublisherOption, type ListingType, LocationMap, type LocationMapProps, Map, type MapContextType, type MapProps, type MapProvider$1 as MapProvider, MapProviderOption, MapQuestMaps, MapboxMaps, Marker, type MarkerProps, type PinStoreType, type ThumbnailType, type WeekType, getDirections, useAnalytics, useClusterContext, useIdentify, useMapContext, usePageView, useScope, useTrack };
1333
+ export { Address, type AddressLine, type AddressLineProps, type AddressProps, type AddressType, Analytics, AnalyticsContext, AnalyticsProvider, AnalyticsScopeProvider, BaiduMaps, BingMaps, type CTA, type CTAWithChildrenLinkProps, type CTAWithoutChildrenLinkProps, type ClusterTemplateProps, Clusterer, type ClustererContextType, type ClustererProps, type ComplexImageType, type Coordinate, Coordinate$1 as CoordinateClass, Day, type DayOfWeekNames, type DayType, type DirectionCoordinate, type GetDirectionsConfig, GoogleMaps, type HREFLinkProps, type HolidayType, HoursStatus, HoursTable, type HoursTableDayData, type HoursTableProps, type HoursType, Image, type ImageLayout, ImageLayoutOption, type ImageProps, type ImageType, type IntervalType, LeafletMaps, LegacyRichText, LexicalRichText, type LexicalRichTextProps, Link, type LinkProps, type LinkType, LinkTypes, type ListingPublisher, ListingPublisherOption, type ListingType, LocationMap, type LocationMapProps, Map, type MapContextType, type MapProps, type MapProvider$1 as MapProvider, MapProviderOption, MapQuestMaps, MapboxMaps, Marker, type MarkerProps, type PinStoreType, type ThumbnailType, type WeekType, debuggingParamDetected, getDirections, useAnalytics, useClusterContext, useIdentify, useMapContext, usePageView, useScope, useTrack };
package/dist/index.d.ts CHANGED
@@ -90,6 +90,15 @@ interface GetDirectionsConfig {
90
90
  provider?: MapProvider$1;
91
91
  route?: boolean;
92
92
  }
93
+ /**
94
+ * Type definition for coordinate
95
+ *
96
+ * @public
97
+ */
98
+ interface DirectionCoordinate {
99
+ latitude: number;
100
+ longitude: number;
101
+ }
93
102
 
94
103
  /**
95
104
  * Renders an HTML address based from the Yext Knowledge Graph. Example of using the component to render
@@ -116,10 +125,11 @@ declare const Address: ({ address, lines, separator, ...props }: AddressProps) =
116
125
  * @param listings - List of available Yext Listings
117
126
  * @param googlePlaceId - Google Place ID
118
127
  * @param config - Options for determining URL
128
+ * @param coordinates - Coordinates of location, if provided will be used instead of address or listings
119
129
  *
120
130
  * @returns Maps service url
121
131
  */
122
- declare const getDirections: (address?: AddressType, listings?: ListingType[], googlePlaceId?: string, config?: GetDirectionsConfig) => string | undefined;
132
+ declare const getDirections: (address?: AddressType, listings?: ListingType[], googlePlaceId?: string, config?: GetDirectionsConfig, coordinate?: DirectionCoordinate) => string | undefined;
123
133
 
124
134
  /**
125
135
  * The shape of the data passed directly to the different template functions with the
@@ -139,6 +149,8 @@ type TrackProps = {
139
149
  eventName?: string;
140
150
  amount?: number;
141
151
  currency?: string;
152
+ customTags?: Record<string, string>;
153
+ customValues?: Record<string, number>;
142
154
  };
143
155
  /**
144
156
  * The AnalyticsMethod interface specifies the methods that can be used with
@@ -209,14 +221,10 @@ interface AnalyticsProviderProps {
209
221
  disableSessionTracking?: boolean | undefined;
210
222
  /**
211
223
  * enableDebugging can be set to true if you want to expose tracked events
212
- * in the developer console.
224
+ * in the Browser's developer console. When true, events will only be logged
225
+ * and will NOT be fired/sent through the Analytics SDK.
213
226
  */
214
227
  enableDebugging?: boolean | undefined;
215
- /**
216
- * isProduction() will evaluate to true if the event is fired from any of
217
- * provided domains in productionDomains.
218
- */
219
- productionDomains?: string[];
220
228
  }
221
229
  /**
222
230
  * AnalyticsScopeProps defines the component properties required by the
@@ -329,6 +337,11 @@ declare const useIdentify: () => ((visitor: Record<string, string>) => void) | u
329
337
  * @public
330
338
  */
331
339
  declare function AnalyticsProvider(props: PropsWithChildren<AnalyticsProviderProps>): JSX.Element;
340
+ /**
341
+ * This will look for the xYextDebug parameter and if it is present,
342
+ * enable analytics debugging.
343
+ */
344
+ declare function debuggingParamDetected(): boolean;
332
345
 
333
346
  /**
334
347
  * The useScope hook will return the current scope from the Analytics Scope. For
@@ -535,6 +548,16 @@ interface LinkConfig extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<
535
548
  currency?: string;
536
549
  /** The monetary value of the event. */
537
550
  amount?: number;
551
+ /**
552
+ * Up to 10 pairs matching custom string keys to string values to associate with the event.
553
+ * Keys are case-insensitive; values are case-sensitive.
554
+ */
555
+ customTags?: Record<string, string>;
556
+ /**
557
+ * Up to 10 pairs matching custom string keys to number values to associate with the event.
558
+ * Keys are case-insensitive.
559
+ */
560
+ customValues?: Record<string, number>;
538
561
  }
539
562
  /**
540
563
  * The shape of the data passed to {@link Link} when directly passing an HREF to the Link component.
@@ -1307,4 +1330,4 @@ declare const LeafletMaps: any;
1307
1330
  */
1308
1331
  declare const MapQuestMaps: any;
1309
1332
 
1310
- export { Address, type AddressLine, type AddressLineProps, type AddressProps, type AddressType, Analytics, AnalyticsContext, AnalyticsProvider, AnalyticsScopeProvider, BaiduMaps, BingMaps, type CTA, type CTAWithChildrenLinkProps, type CTAWithoutChildrenLinkProps, type ClusterTemplateProps, Clusterer, type ClustererContextType, type ClustererProps, type ComplexImageType, type Coordinate, Coordinate$1 as CoordinateClass, Day, type DayOfWeekNames, type DayType, type GetDirectionsConfig, GoogleMaps, type HREFLinkProps, type HolidayType, HoursStatus, HoursTable, type HoursTableDayData, type HoursTableProps, type HoursType, Image, type ImageLayout, ImageLayoutOption, type ImageProps, type ImageType, type IntervalType, LeafletMaps, LegacyRichText, LexicalRichText, type LexicalRichTextProps, Link, type LinkProps, type LinkType, LinkTypes, type ListingPublisher, ListingPublisherOption, type ListingType, LocationMap, type LocationMapProps, Map, type MapContextType, type MapProps, type MapProvider$1 as MapProvider, MapProviderOption, MapQuestMaps, MapboxMaps, Marker, type MarkerProps, type PinStoreType, type ThumbnailType, type WeekType, getDirections, useAnalytics, useClusterContext, useIdentify, useMapContext, usePageView, useScope, useTrack };
1333
+ export { Address, type AddressLine, type AddressLineProps, type AddressProps, type AddressType, Analytics, AnalyticsContext, AnalyticsProvider, AnalyticsScopeProvider, BaiduMaps, BingMaps, type CTA, type CTAWithChildrenLinkProps, type CTAWithoutChildrenLinkProps, type ClusterTemplateProps, Clusterer, type ClustererContextType, type ClustererProps, type ComplexImageType, type Coordinate, Coordinate$1 as CoordinateClass, Day, type DayOfWeekNames, type DayType, type DirectionCoordinate, type GetDirectionsConfig, GoogleMaps, type HREFLinkProps, type HolidayType, HoursStatus, HoursTable, type HoursTableDayData, type HoursTableProps, type HoursType, Image, type ImageLayout, ImageLayoutOption, type ImageProps, type ImageType, type IntervalType, LeafletMaps, LegacyRichText, LexicalRichText, type LexicalRichTextProps, Link, type LinkProps, type LinkType, LinkTypes, type ListingPublisher, ListingPublisherOption, type ListingType, LocationMap, type LocationMapProps, Map, type MapContextType, type MapProps, type MapProvider$1 as MapProvider, MapProviderOption, MapQuestMaps, MapboxMaps, Marker, type MarkerProps, type PinStoreType, type ThumbnailType, type WeekType, debuggingParamDetected, getDirections, useAnalytics, useClusterContext, useIdentify, useMapContext, usePageView, useScope, useTrack };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CPtU5eOw.cjs");exports.Address=e.Address;exports.Analytics=e.Analytics;exports.AnalyticsContext=e.AnalyticsContext;exports.AnalyticsProvider=e.AnalyticsProvider;exports.AnalyticsScopeProvider=e.AnalyticsScopeProvider;exports.BaiduMaps=e.BaiduMaps;exports.BingMaps=e.BingMaps;exports.Clusterer=e.Clusterer;exports.CoordinateClass=e.Coordinate;exports.Day=e.Day;exports.GoogleMaps=e.GoogleMaps;exports.HoursStatus=e.HoursStatus;exports.HoursTable=e.HoursTable;exports.Image=e.Image;exports.ImageLayoutOption=e.ImageLayoutOption;exports.LeafletMaps=e.LeafletMaps;exports.LegacyRichText=e.LegacyRichText;exports.LexicalRichText=e.LexicalRichText;exports.Link=e.Link;exports.LinkTypes=e.LinkTypes;exports.ListingPublisherOption=e.ListingPublisherOption;exports.LocationMap=e.LocationMap;exports.Map=e.Map;exports.MapProviderOption=e.MapProviderOption;exports.MapQuestMaps=e.MapQuestMaps;exports.MapboxMaps=e.MapboxMaps;exports.Marker=e.Marker;exports.getDirections=e.getDirections;exports.useAnalytics=e.useAnalytics;exports.useClusterContext=e.useClusterContext;exports.useIdentify=e.useIdentify;exports.useMapContext=e.useMapContext;exports.usePageView=e.usePageView;exports.useScope=e.useScope;exports.useTrack=e.useTrack;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-LU9eqw2L.cjs");exports.Address=e.Address;exports.Analytics=e.Analytics;exports.AnalyticsContext=e.AnalyticsContext;exports.AnalyticsProvider=e.AnalyticsProvider;exports.AnalyticsScopeProvider=e.AnalyticsScopeProvider;exports.BaiduMaps=e.BaiduMaps;exports.BingMaps=e.BingMaps;exports.Clusterer=e.Clusterer;exports.CoordinateClass=e.Coordinate;exports.Day=e.Day;exports.GoogleMaps=e.GoogleMaps;exports.HoursStatus=e.HoursStatus;exports.HoursTable=e.HoursTable;exports.Image=e.Image;exports.ImageLayoutOption=e.ImageLayoutOption;exports.LeafletMaps=e.LeafletMaps;exports.LegacyRichText=e.LegacyRichText;exports.LexicalRichText=e.LexicalRichText;exports.Link=e.Link;exports.LinkTypes=e.LinkTypes;exports.ListingPublisherOption=e.ListingPublisherOption;exports.LocationMap=e.LocationMap;exports.Map=e.Map;exports.MapProviderOption=e.MapProviderOption;exports.MapQuestMaps=e.MapQuestMaps;exports.MapboxMaps=e.MapboxMaps;exports.Marker=e.Marker;exports.debuggingParamDetected=e.debuggingParamDetected;exports.getDirections=e.getDirections;exports.useAnalytics=e.useAnalytics;exports.useClusterContext=e.useClusterContext;exports.useIdentify=e.useIdentify;exports.useMapContext=e.useMapContext;exports.usePageView=e.usePageView;exports.useScope=e.useScope;exports.useTrack=e.useTrack;
@@ -1,4 +1,4 @@
1
- import { A as e, x as t, y as i, E as o, G as r, Y as n, Z as p, Q as u, a2 as c, X as M, _ as l, V as y, W as x, I as L, H as d, a0 as g, U as C, T as A, J as P, K as T, L as k, S as I, N as O, M as S, a1 as b, $ as f, P as h, w as m, z as v, R as B, D, O as H, C as R, F as w, B as G } from "./index-DaOqO1Xz.js";
1
+ import { A as e, x as t, y as i, E as o, H as r, Z as n, _ as p, R as u, a3 as c, Y as M, $ as l, W as g, X as y, I as d, J as x, a1 as L, V as C, U as A, K as P, N as T, L as b, T as k, O as m, M as D, a2 as I, a0 as O, Q as S, F as f, w as h, z as v, S as B, D as H, P as R, C as w, G, B as Q } from "./index-ChSAX9jE.js";
2
2
  export {
3
3
  e as Address,
4
4
  t as Analytics,
@@ -11,28 +11,29 @@ export {
11
11
  c as CoordinateClass,
12
12
  M as Day,
13
13
  l as GoogleMaps,
14
- y as HoursStatus,
15
- x as HoursTable,
16
- L as Image,
17
- d as ImageLayoutOption,
18
- g as LeafletMaps,
14
+ g as HoursStatus,
15
+ y as HoursTable,
16
+ d as Image,
17
+ x as ImageLayoutOption,
18
+ L as LeafletMaps,
19
19
  C as LegacyRichText,
20
20
  A as LexicalRichText,
21
21
  P as Link,
22
22
  T as LinkTypes,
23
- k as ListingPublisherOption,
24
- I as LocationMap,
25
- O as Map,
26
- S as MapProviderOption,
27
- b as MapQuestMaps,
28
- f as MapboxMaps,
29
- h as Marker,
30
- m as getDirections,
23
+ b as ListingPublisherOption,
24
+ k as LocationMap,
25
+ m as Map,
26
+ D as MapProviderOption,
27
+ I as MapQuestMaps,
28
+ O as MapboxMaps,
29
+ S as Marker,
30
+ f as debuggingParamDetected,
31
+ h as getDirections,
31
32
  v as useAnalytics,
32
33
  B as useClusterContext,
33
- D as useIdentify,
34
- H as useMapContext,
35
- R as usePageView,
36
- w as useScope,
37
- G as useTrack
34
+ H as useIdentify,
35
+ R as useMapContext,
36
+ w as usePageView,
37
+ G as useScope,
38
+ Q as useTrack
38
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yext/pages-components",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A React component library that supports Yext Pages development",
5
5
  "author": "sumo@yext.com",
6
6
  "license": "BSD-3-Clause",