@yext/pages-components 1.2.4 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-FFY3Y364.js +1 -0
- package/dist/debugger-3ZMPVPKH.js +1 -0
- package/dist/debugger-GQLPSISB.css +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +15 -60
- package/dist/index.js +4 -57
- package/package.json +29 -55
- package/dist/debugger-BAemb18m.js +0 -316
- package/dist/debugger-DjyiKj4B.cjs +0 -1
- package/dist/index-3y1PqoZ5.js +0 -21016
- package/dist/index-B7cF4XII.js +0 -6744
- package/dist/index-BE0QKqrR.cjs +0 -61
- package/dist/index-O3Mt_gby.cjs +0 -14
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -2009
package/dist/index.d.cts
DELETED
|
@@ -1,2009 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Action } from '@yext/analytics';
|
|
3
|
-
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { PropsWithChildren, ReactElement } from 'react';
|
|
5
|
-
import { EditorThemeClasses } from 'lexical';
|
|
6
|
-
import { DateTime } from 'luxon';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The type definition for an address.
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
interface AddressType {
|
|
14
|
-
line1: string;
|
|
15
|
-
line2?: string;
|
|
16
|
-
line3?: string;
|
|
17
|
-
city: string;
|
|
18
|
-
region?: string;
|
|
19
|
-
postalCode: string;
|
|
20
|
-
countryCode: string;
|
|
21
|
-
sublocality?: string;
|
|
22
|
-
extraDescription?: string;
|
|
23
|
-
localizedRegionName?: string;
|
|
24
|
-
localizedCountryName?: string;
|
|
25
|
-
}
|
|
26
|
-
type AddressLine = (keyof AddressType | ",")[];
|
|
27
|
-
/**
|
|
28
|
-
* The shape of the data passed to {@link Address}.
|
|
29
|
-
*
|
|
30
|
-
* @public
|
|
31
|
-
*/
|
|
32
|
-
interface AddressProps extends React.HTMLProps<HTMLDivElement> {
|
|
33
|
-
address: AddressType;
|
|
34
|
-
lines?: AddressLine[];
|
|
35
|
-
separator?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The shape of the data passed to {@link AddressLine}.
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
*/
|
|
42
|
-
type AddressLineProps = {
|
|
43
|
-
address: AddressType;
|
|
44
|
-
line: AddressLine;
|
|
45
|
-
separator?: string;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* The available listing publishers
|
|
49
|
-
*
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
declare const ListingPublisherOption: {
|
|
53
|
-
readonly GOOGLEMYBUSINESS: "GOOGLEMYBUSINESS";
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* The type definition for the listing publisher
|
|
57
|
-
*
|
|
58
|
-
* @public
|
|
59
|
-
*/
|
|
60
|
-
type ListingPublisher = (typeof ListingPublisherOption)[keyof typeof ListingPublisherOption];
|
|
61
|
-
/**
|
|
62
|
-
* The type definition for a Listing
|
|
63
|
-
*
|
|
64
|
-
* @public
|
|
65
|
-
*/
|
|
66
|
-
interface ListingType {
|
|
67
|
-
listingUrl: string;
|
|
68
|
-
publisher?: ListingPublisher;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* The available map providers
|
|
72
|
-
*
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
declare const MapProviderOption: {
|
|
76
|
-
readonly GOOGLE: "google";
|
|
77
|
-
readonly APPLE: "apple";
|
|
78
|
-
readonly BING: "bing";
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* The type definition for the map provider
|
|
82
|
-
*
|
|
83
|
-
* @public
|
|
84
|
-
*/
|
|
85
|
-
type MapProvider$1 = (typeof MapProviderOption)[keyof typeof MapProviderOption];
|
|
86
|
-
/**
|
|
87
|
-
* The Yext profile fields used to create a getDirections URL
|
|
88
|
-
*/
|
|
89
|
-
interface GetDirectionsConfig {
|
|
90
|
-
provider?: MapProvider$1;
|
|
91
|
-
route?: boolean;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Type definition for coordinate
|
|
95
|
-
*
|
|
96
|
-
* @public
|
|
97
|
-
*/
|
|
98
|
-
interface DirectionCoordinate {
|
|
99
|
-
latitude: number;
|
|
100
|
-
longitude: number;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Renders an HTML address based from the Yext Knowledge Graph. Example of using the component to render
|
|
105
|
-
* a location entity's address from Yext Knowledge Graph:
|
|
106
|
-
* ```
|
|
107
|
-
* import { Address } from "@yext/pages/components";
|
|
108
|
-
*
|
|
109
|
-
* const address = (<Address address={document.address} />);
|
|
110
|
-
* --> 1101 Wilson Blvd., Suite 2300,
|
|
111
|
-
* Arlington, VA, 22201,
|
|
112
|
-
* US
|
|
113
|
-
* const customAddress = (<Address address={document.address} lines={[['line1', 'city', 'region']]} />);
|
|
114
|
-
* --> 1101 Wilson Blvd., Arlington, VA
|
|
115
|
-
* ```
|
|
116
|
-
*
|
|
117
|
-
* @public
|
|
118
|
-
*/
|
|
119
|
-
declare const Address: ({ address, lines, separator, ...props }: AddressProps) => react_jsx_runtime.JSX.Element;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Get a third-party maps url for a Yext location
|
|
123
|
-
*
|
|
124
|
-
* @param address - Yext address
|
|
125
|
-
* @param listings - List of available Yext Listings
|
|
126
|
-
* @param googlePlaceId - Google Place ID
|
|
127
|
-
* @param config - Options for determining URL
|
|
128
|
-
* @param coordinates - Coordinates of location, if provided will be used instead of address or listings
|
|
129
|
-
*
|
|
130
|
-
* @returns Maps service url
|
|
131
|
-
*/
|
|
132
|
-
declare const getDirections: (address?: AddressType, listings?: ListingType[], googlePlaceId?: string, config?: GetDirectionsConfig, coordinate?: DirectionCoordinate) => string | undefined;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* The shape of the data passed directly to the different template functions with the
|
|
136
|
-
* exception of the render function (getPath, getHeadConfig, etc).
|
|
137
|
-
*
|
|
138
|
-
* @public
|
|
139
|
-
*/
|
|
140
|
-
interface TemplateProps<T = Record<string, any>> {
|
|
141
|
-
/** The entire document returned after applying the stream to a single entity */
|
|
142
|
-
document: T;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
type TrackProps = {
|
|
146
|
-
action: Action;
|
|
147
|
-
destinationUrl?: string;
|
|
148
|
-
scope?: string;
|
|
149
|
-
eventName: string;
|
|
150
|
-
amount?: number;
|
|
151
|
-
currency?: string;
|
|
152
|
-
customTags?: Record<string, string>;
|
|
153
|
-
customValues?: Record<string, number>;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* The AnalyticsMethod interface specifies the methods that can be used with
|
|
157
|
-
* the Analytics Provider.
|
|
158
|
-
*
|
|
159
|
-
*/
|
|
160
|
-
interface AnalyticsMethods {
|
|
161
|
-
/**
|
|
162
|
-
* The track method will send a generic analytics event to Yext.
|
|
163
|
-
*
|
|
164
|
-
* @param eventName - the name of the event, will appear in Yext's Report Builder UI
|
|
165
|
-
* @param conversionData - optional details for tracking an event as a conversion
|
|
166
|
-
*/
|
|
167
|
-
track(props: TrackProps): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* The identify method will allow you to tie analytics events to a specific user.
|
|
170
|
-
*
|
|
171
|
-
* @param visitor - the Visitor object
|
|
172
|
-
*/
|
|
173
|
-
identify(visitor: Record<string, string>): void;
|
|
174
|
-
/**
|
|
175
|
-
* The pageView method will track a pageview event.
|
|
176
|
-
*/
|
|
177
|
-
pageView(): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* The optIn method should be called when a user opts into analytics tracking,
|
|
180
|
-
* e.g. via a Consent Management Banner or other opt-in method.
|
|
181
|
-
*/
|
|
182
|
-
optIn(): Promise<void>;
|
|
183
|
-
/**
|
|
184
|
-
* Use the getDebugEnabled method to retrieve whether debugging is on or off.
|
|
185
|
-
*/
|
|
186
|
-
getDebugEnabled(): boolean;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* The AnalyticsProviderProps interface represents the component properties
|
|
190
|
-
* to be passed into the AnalyticsProvider.
|
|
191
|
-
*
|
|
192
|
-
* @public
|
|
193
|
-
*/
|
|
194
|
-
interface AnalyticsProviderProps {
|
|
195
|
-
/**
|
|
196
|
-
* The API Key or OAuth for accessing the Analytics Events API
|
|
197
|
-
*/
|
|
198
|
-
apiKey: string;
|
|
199
|
-
/**
|
|
200
|
-
* The TemplateProps that come from the rendering system
|
|
201
|
-
*/
|
|
202
|
-
templateData: TemplateProps;
|
|
203
|
-
/**
|
|
204
|
-
* The ISO 4217 currency code of the currency the value is expressed in.
|
|
205
|
-
* For example, "USD" for US dollars.
|
|
206
|
-
*
|
|
207
|
-
* For more information see https://www.iso.org/iso-4217-currency-codes.html.
|
|
208
|
-
*/
|
|
209
|
-
currency: string;
|
|
210
|
-
/**
|
|
211
|
-
* requireOptIn should be set to true if your compliance requirements require
|
|
212
|
-
* you to put all marketing analytics behind a user opt-in banner or if you
|
|
213
|
-
* use a Compliance Management tool of some kind.
|
|
214
|
-
*/
|
|
215
|
-
requireOptIn?: boolean | undefined;
|
|
216
|
-
/**
|
|
217
|
-
* disableSessionTracking will set sessionId to undefined in the event payload
|
|
218
|
-
* when a user does any trackable action on your site, such as a page view,
|
|
219
|
-
* click, etc.
|
|
220
|
-
*/
|
|
221
|
-
disableSessionTracking?: boolean | undefined;
|
|
222
|
-
/**
|
|
223
|
-
* enableDebugging can be set to true if you want to expose tracked events
|
|
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.
|
|
226
|
-
*/
|
|
227
|
-
enableDebugging?: boolean | undefined;
|
|
228
|
-
/**
|
|
229
|
-
* productionDomains is an optional list of domains that analytics should fire on. If your production site is hosted by Yext then this field is not required. It is only necessary if this code is being run in the context of a Yext module.
|
|
230
|
-
*/
|
|
231
|
-
productionDomains?: string[];
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* AnalyticsScopeProps defines the component properties required by the
|
|
235
|
-
* AnalyticsScopeProvider component.
|
|
236
|
-
*
|
|
237
|
-
* @public
|
|
238
|
-
*/
|
|
239
|
-
interface AnalyticsScopeProps {
|
|
240
|
-
/**
|
|
241
|
-
* The string to prepend to all analytics events that come from components
|
|
242
|
-
* below the AnalyticsScopeProvider component in the tree.
|
|
243
|
-
*/
|
|
244
|
-
name: string;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* The Analytics class creates a stateful facade in front of the \@yext/analytics
|
|
249
|
-
* Library's pagesAnalyticsProvider class. It takes in some data from the
|
|
250
|
-
* template configuration and uses it to provide configuration to the
|
|
251
|
-
* pagesAnalyticsProvider.
|
|
252
|
-
*
|
|
253
|
-
* Additionally, it provides handlers for controlling user opt-in for compliance
|
|
254
|
-
* requirements as well as for debugging, enabling conversion tracking, saving
|
|
255
|
-
* user identity information, and creating named analytics scopes for
|
|
256
|
-
* easy tagging.
|
|
257
|
-
*
|
|
258
|
-
* @public
|
|
259
|
-
*/
|
|
260
|
-
declare class Analytics implements AnalyticsMethods {
|
|
261
|
-
private apiKey;
|
|
262
|
-
private defaultCurrency;
|
|
263
|
-
private templateData;
|
|
264
|
-
private productionDomains?;
|
|
265
|
-
private enableDebugging;
|
|
266
|
-
private _optedIn;
|
|
267
|
-
private _sessionTrackingEnabled;
|
|
268
|
-
private _analyticsEventService;
|
|
269
|
-
private _pageViewFired;
|
|
270
|
-
/**
|
|
271
|
-
* Creates an Analytics instance, will fire a pageview event if requireOptin
|
|
272
|
-
* is false
|
|
273
|
-
*
|
|
274
|
-
* @param apiKey - the Yext API key for authorizing analytics events
|
|
275
|
-
* @param defaultCurrency - the ISO 4217 currency code to use for valued events
|
|
276
|
-
* @param templateData - template data object from the pages system
|
|
277
|
-
* @param requireOptIn - boolean, set to true if you require user opt in before tracking analytics
|
|
278
|
-
* @param disableSessionTracking - turns off session tracking
|
|
279
|
-
* @param productionDomains - the domains to fire Yext analytics on. Only necessary if this code is being run in the context of a Yext module.
|
|
280
|
-
* @param enableDebugging - turns debug mode on meaning requests are logged instead
|
|
281
|
-
*/
|
|
282
|
-
constructor(apiKey: string, defaultCurrency: string, templateData: TemplateProps, requireOptIn?: boolean, disableSessionTracking?: boolean, productionDomains?: string[] | undefined, enableDebugging?: boolean);
|
|
283
|
-
private makeReporter;
|
|
284
|
-
private canTrack;
|
|
285
|
-
/** {@inheritDoc AnalyticsMethods.identify} */
|
|
286
|
-
identify(visitor: Record<string, string>): void;
|
|
287
|
-
/** {@inheritDoc AnalyticsMethods.async} */
|
|
288
|
-
optIn(): Promise<void>;
|
|
289
|
-
/** {@inheritDoc AnalyticsMethods.async} */
|
|
290
|
-
pageView(): Promise<void>;
|
|
291
|
-
/** {@inheritDoc AnalyticsMethods.track} */
|
|
292
|
-
track(props: TrackProps): Promise<void>;
|
|
293
|
-
/** {@inheritDoc AnalyticsMethods.getDebugEnabled} */
|
|
294
|
-
getDebugEnabled(): boolean;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Default react context for use with Yext Analytics.
|
|
299
|
-
*
|
|
300
|
-
* @public
|
|
301
|
-
*/
|
|
302
|
-
declare const AnalyticsContext: React$1.Context<AnalyticsMethods | null>;
|
|
303
|
-
|
|
304
|
-
declare global {
|
|
305
|
-
interface Window {
|
|
306
|
-
setAnalyticsOptIn: () => void;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* The useAnalytics hook can be used anywhere in the tree below a configured
|
|
311
|
-
* AnalyticsProvider. Calling it will return an object to give you access to
|
|
312
|
-
* the analytics convenience methods for use in your components,
|
|
313
|
-
* such as track(), pageView(), optIn() etc.
|
|
314
|
-
*
|
|
315
|
-
* @public
|
|
316
|
-
*/
|
|
317
|
-
declare function useAnalytics(): AnalyticsMethods | null;
|
|
318
|
-
/**
|
|
319
|
-
* Simpler hook that just returns the analytics track() method.
|
|
320
|
-
*
|
|
321
|
-
* @public
|
|
322
|
-
*/
|
|
323
|
-
declare const useTrack: () => ((props: TrackProps) => Promise<void>) | undefined;
|
|
324
|
-
/**
|
|
325
|
-
* Simpler hook that just returns the analytics pageView method
|
|
326
|
-
*
|
|
327
|
-
* @public
|
|
328
|
-
*/
|
|
329
|
-
declare const usePageView: () => (() => Promise<void>) | undefined;
|
|
330
|
-
/**
|
|
331
|
-
* Simpler hook that just returns the analytics identify method
|
|
332
|
-
*
|
|
333
|
-
* @public
|
|
334
|
-
*/
|
|
335
|
-
declare const useIdentify: () => ((visitor: Record<string, string>) => void) | undefined;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* The main Analytics component for you to use. Sets up the proper react context
|
|
339
|
-
* and bootstraps the Analytics reporter.
|
|
340
|
-
*
|
|
341
|
-
* @param props - A PropsWithChildren that implements AnalyticsProviderProps
|
|
342
|
-
*
|
|
343
|
-
* @public
|
|
344
|
-
*/
|
|
345
|
-
declare function AnalyticsProvider(props: PropsWithChildren<AnalyticsProviderProps>): React.ReactElement;
|
|
346
|
-
/**
|
|
347
|
-
* This will look for the xYextDebug parameter and if it is present,
|
|
348
|
-
* enable analytics debugging.
|
|
349
|
-
*/
|
|
350
|
-
declare function debuggingParamDetected(): boolean;
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* The useScope hook will return the current scope from the Analytics Scope. For
|
|
354
|
-
* use within the context of an AnalyticsScopeProvider for scoping analytics events.
|
|
355
|
-
*/
|
|
356
|
-
declare const useScope: () => string;
|
|
357
|
-
/**
|
|
358
|
-
* The AnalyticsScopeProvider will allow you to pre-pend a given string to all
|
|
359
|
-
* events that happen in the node tree below where setScope is called.
|
|
360
|
-
* For example, if you call setScope('header') and there is an `a` element
|
|
361
|
-
* below whose onClick calls `track('my link')` the calculated event name
|
|
362
|
-
* that will be sent to Yext Analytics is `header_mylink`
|
|
363
|
-
*
|
|
364
|
-
* @param props - AnalyticsScopeProps
|
|
365
|
-
*/
|
|
366
|
-
declare function AnalyticsScopeProvider(props: PropsWithChildren<AnalyticsScopeProps>): React.ReactElement;
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* The type definition for a thumbnail.
|
|
370
|
-
*
|
|
371
|
-
* @public
|
|
372
|
-
*/
|
|
373
|
-
type ThumbnailType = {
|
|
374
|
-
height: number;
|
|
375
|
-
width: number;
|
|
376
|
-
url: string;
|
|
377
|
-
};
|
|
378
|
-
/**
|
|
379
|
-
* The type definition for a complex image.
|
|
380
|
-
*
|
|
381
|
-
* @public
|
|
382
|
-
*/
|
|
383
|
-
type ComplexImageType = {
|
|
384
|
-
image: {
|
|
385
|
-
alternateText?: string;
|
|
386
|
-
height: number;
|
|
387
|
-
width: number;
|
|
388
|
-
url: string;
|
|
389
|
-
thumbnails?: ThumbnailType[];
|
|
390
|
-
};
|
|
391
|
-
};
|
|
392
|
-
/**
|
|
393
|
-
* The type definition for an image.
|
|
394
|
-
*
|
|
395
|
-
* @public
|
|
396
|
-
*/
|
|
397
|
-
type ImageType = {
|
|
398
|
-
alternateText?: string;
|
|
399
|
-
height: number;
|
|
400
|
-
width: number;
|
|
401
|
-
url: string;
|
|
402
|
-
};
|
|
403
|
-
/**
|
|
404
|
-
* Layout option on the Image component.
|
|
405
|
-
*
|
|
406
|
-
* @public
|
|
407
|
-
*/
|
|
408
|
-
declare const ImageLayoutOption: {
|
|
409
|
-
/**
|
|
410
|
-
* The the default layout if one is not specified. An image will be scaled down to fit the
|
|
411
|
-
* container but not exceed the absolute size of the image.
|
|
412
|
-
*/
|
|
413
|
-
readonly INTRINSIC: "intrinsic";
|
|
414
|
-
/**
|
|
415
|
-
* Shows the image in a fixed size. `width` or `height` must be passed in. If both `width` and
|
|
416
|
-
* `height` are passed in, but the aspect ratio does not match the aspect ratio of the image,
|
|
417
|
-
* the image will be centered. This behavior can be adjusted using the `objectFit` and
|
|
418
|
-
* `objectPosition` props of the `style` rpop.
|
|
419
|
-
*/
|
|
420
|
-
readonly FIXED: "fixed";
|
|
421
|
-
/** Shows the image in a fixed aspect ratio. The `aspectRatio` prop must be provided. */
|
|
422
|
-
readonly ASPECT: "aspect";
|
|
423
|
-
/** Always fills the image to 100% of the container's width. */
|
|
424
|
-
readonly FILL: "fill";
|
|
425
|
-
};
|
|
426
|
-
/**
|
|
427
|
-
* The type definition for the image layout.
|
|
428
|
-
*
|
|
429
|
-
* @public
|
|
430
|
-
*/
|
|
431
|
-
type ImageLayout = (typeof ImageLayoutOption)[keyof typeof ImageLayoutOption];
|
|
432
|
-
/**
|
|
433
|
-
* The shape of the data passed to {@link Image}.
|
|
434
|
-
*/
|
|
435
|
-
interface BaseImageProps {
|
|
436
|
-
/** The image field from Knowledge Graph. */
|
|
437
|
-
image: ComplexImageType | ImageType;
|
|
438
|
-
/** Overrides the className on the underlying img tag. */
|
|
439
|
-
className?: string;
|
|
440
|
-
/** Specifies how the image is rendered. */
|
|
441
|
-
layout?: ImageLayout;
|
|
442
|
-
/** The absolute width of the image. Only impacts if layout is set to "fixed". */
|
|
443
|
-
width?: number;
|
|
444
|
-
/** The absolute height of the image. Only impacts if layout is set to "fixed". */
|
|
445
|
-
height?: number;
|
|
446
|
-
/** The aspect ratio of the image. Only impacts if layout is set to "aspect". */
|
|
447
|
-
aspectRatio?: number;
|
|
448
|
-
/** A pass through react component that is displayed when the image is loading. */
|
|
449
|
-
placeholder?: React$1.ReactNode;
|
|
450
|
-
/** Pass through props that are on the native HTML img tag. The Image component may not work if src and/or srcsets are included. */
|
|
451
|
-
imgOverrides?: Record<string, unknown>;
|
|
452
|
-
/** The pass through style of the underlying img tag. */
|
|
453
|
-
style?: React$1.CSSProperties;
|
|
454
|
-
/** Set the loading state of the image. */
|
|
455
|
-
loading?: "eager" | "lazy";
|
|
456
|
-
/** Cloudflare Image transformations */
|
|
457
|
-
imageTransformations?: ImageTransformations;
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* The shape of the data passed to {@link Image} when layout is {@link ImageLayoutOption.INTRINSIC},
|
|
461
|
-
* {@link ImageLayoutOption.FILL} or not provided.
|
|
462
|
-
*/
|
|
463
|
-
interface OtherImageProps extends BaseImageProps {
|
|
464
|
-
/** Specifies how the image is rendered. */
|
|
465
|
-
layout?: "intrinsic" | "fill";
|
|
466
|
-
}
|
|
467
|
-
/**
|
|
468
|
-
* The shape of the data passed to {@link Image} when layout is {@link ImageLayoutOption.FIXED}.
|
|
469
|
-
* Extends the {@link BaseImageProps} interface and has the additions of a width and height,
|
|
470
|
-
* at least one of which must be specified.
|
|
471
|
-
*/
|
|
472
|
-
interface FixedImageProps extends BaseImageProps {
|
|
473
|
-
/** Specifies how the image is rendered. */
|
|
474
|
-
layout: "fixed";
|
|
475
|
-
/** The absolute width of the image. Only impacts if layout is set to "fixed". */
|
|
476
|
-
width?: number;
|
|
477
|
-
/** The absolute height of the image. Only impacts if layout is set to "fixed". */
|
|
478
|
-
height?: number;
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* The shape of the data passed to {@link Image} when layout is {@link ImageLayoutOption.ASPECT}.
|
|
482
|
-
* Extends the {@link BaseImageProps} interface and has the additions of a required aspectRatio.
|
|
483
|
-
*/
|
|
484
|
-
interface AspectImageProps extends BaseImageProps {
|
|
485
|
-
/** Specifies how the image is rendered. */
|
|
486
|
-
layout: "aspect";
|
|
487
|
-
/** The aspect ratio of the image. Only impacts if layout is set to "aspect". */
|
|
488
|
-
aspectRatio: number;
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Cloudflare Image transformations
|
|
492
|
-
* See: https://developers.cloudflare.com/images/transform-images/transform-via-url
|
|
493
|
-
*/
|
|
494
|
-
type ImageTransformations = {
|
|
495
|
-
/** Affects interpretation of width and height */
|
|
496
|
-
fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
|
|
497
|
-
/** Image file format. Defaults to undefined, which uses webp if supported, original extension otherwise. */
|
|
498
|
-
format?: "avif" | "webp" | "jpeg";
|
|
499
|
-
/** Specifies how an image should be cropped with fit=cover or fit=crop. */
|
|
500
|
-
gravity?: "auto" | "left" | "right" | "top" | "bottom";
|
|
501
|
-
/** Quality of the image. Between 1 and 100. Defaults to 85. */
|
|
502
|
-
quality?: number;
|
|
503
|
-
};
|
|
504
|
-
/**
|
|
505
|
-
* The shape of the data passed to {@link Image}.
|
|
506
|
-
*
|
|
507
|
-
* @public
|
|
508
|
-
*/
|
|
509
|
-
type ImageProps = OtherImageProps | FixedImageProps | AspectImageProps;
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Renders an image based from the Yext Knowledge Graph. Example of using the component to render
|
|
513
|
-
* simple and complex image fields from Yext Knowledge Graph:
|
|
514
|
-
* ```
|
|
515
|
-
* import { Image } from "@yext/pages/components";
|
|
516
|
-
*
|
|
517
|
-
* const simpleImage = (<Image image={document.logo} />);
|
|
518
|
-
* const complexImage = (<Image image={document.photoGallery[0]} />);
|
|
519
|
-
* ```
|
|
520
|
-
*
|
|
521
|
-
* @public
|
|
522
|
-
*/
|
|
523
|
-
declare const Image: ({ image, className, width, height, aspectRatio, layout, placeholder, imgOverrides, style, imageTransformations, loading, }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* Parses a raw a.mktgcdn.com type url and returns its corresponding dyn.mktgcdn.com version.
|
|
527
|
-
* If the raw url cannot be parsed, it's simply returned as-is and used as a passthrough.
|
|
528
|
-
*/
|
|
529
|
-
declare const getImageUrl: (rawUrl: string, width: number, height: number, imageTransformations?: ImageTransformations) => string | undefined;
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
* Type of link types that might be received from the platform.
|
|
533
|
-
*
|
|
534
|
-
* @public
|
|
535
|
-
*/
|
|
536
|
-
type LinkType = "URL" | "Email" | "EMAIL" | "Phone" | "PHONE" | "DRIVING_DIRECTIONS" | "CLICK_TO_WEBSITE" | "OTHER";
|
|
537
|
-
/**
|
|
538
|
-
* Type for CTA field
|
|
539
|
-
* Note that when coming from the platform the label will always be a string
|
|
540
|
-
* but ReactNode allows for more general usage.
|
|
541
|
-
*
|
|
542
|
-
* @public
|
|
543
|
-
*/
|
|
544
|
-
interface CTA {
|
|
545
|
-
link: string;
|
|
546
|
-
label?: React.ReactNode;
|
|
547
|
-
linkType?: LinkType;
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* Configuration options available for any usages of the Link component.
|
|
551
|
-
*/
|
|
552
|
-
interface LinkConfig extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
|
|
553
|
-
/** Obfuscates the href and label. */
|
|
554
|
-
obfuscate?: boolean;
|
|
555
|
-
/** The custom name of the event. */
|
|
556
|
-
eventName?: string;
|
|
557
|
-
/** Scope the specific link event. Overrides the scope set by the provider. */
|
|
558
|
-
scope?: string;
|
|
559
|
-
/**
|
|
560
|
-
* The ISO 4217 currency code of the currency the value is expressed in.
|
|
561
|
-
* Overrides the defaultCurrency set on the provider.
|
|
562
|
-
* For example, "USD" for US dollars.
|
|
563
|
-
*
|
|
564
|
-
* For more information see https://www.iso.org/iso-4217-currency-codes.html.
|
|
565
|
-
*/
|
|
566
|
-
currency?: string;
|
|
567
|
-
/** The monetary value of the event. */
|
|
568
|
-
amount?: number;
|
|
569
|
-
/**
|
|
570
|
-
* Up to 10 pairs matching custom string keys to string values to associate with the event.
|
|
571
|
-
* Keys are case-insensitive; values are case-sensitive.
|
|
572
|
-
*/
|
|
573
|
-
customTags?: Record<string, string>;
|
|
574
|
-
/**
|
|
575
|
-
* Up to 10 pairs matching custom string keys to number values to associate with the event.
|
|
576
|
-
* Keys are case-insensitive.
|
|
577
|
-
*/
|
|
578
|
-
customValues?: Record<string, number>;
|
|
579
|
-
}
|
|
580
|
-
/**
|
|
581
|
-
* The shape of the data passed to {@link Link} when directly passing an HREF to the Link component.
|
|
582
|
-
*
|
|
583
|
-
* @public
|
|
584
|
-
*/
|
|
585
|
-
interface HREFLinkProps extends LinkConfig {
|
|
586
|
-
href: string;
|
|
587
|
-
cta?: never;
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* The shape of the data passed to {@link Link} when using a CTA field, and not overriding children.
|
|
591
|
-
*
|
|
592
|
-
* @public
|
|
593
|
-
*/
|
|
594
|
-
interface CTAWithChildrenLinkProps extends LinkConfig {
|
|
595
|
-
href?: never;
|
|
596
|
-
cta: CTA;
|
|
597
|
-
children?: React.ReactNode;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* The shape of the data passed to {@link Link} when using a CTA field, and overriding children.
|
|
601
|
-
*
|
|
602
|
-
* @public
|
|
603
|
-
*/
|
|
604
|
-
interface CTAWithoutChildrenLinkProps extends LinkConfig {
|
|
605
|
-
href?: never;
|
|
606
|
-
cta: Omit<CTA, "label">;
|
|
607
|
-
children: React.ReactNode;
|
|
608
|
-
}
|
|
609
|
-
/**
|
|
610
|
-
* The shape of the data passed to {@link Link} when using a CTA field.
|
|
611
|
-
*/
|
|
612
|
-
type CTALinkProps = CTAWithChildrenLinkProps | CTAWithoutChildrenLinkProps;
|
|
613
|
-
/**
|
|
614
|
-
* The shape of the data passed to {@link Link}.
|
|
615
|
-
*
|
|
616
|
-
* @public
|
|
617
|
-
*/
|
|
618
|
-
type LinkProps = CTALinkProps | HREFLinkProps;
|
|
619
|
-
|
|
620
|
-
/**
|
|
621
|
-
* Renders an anchor tag using either a directly provided HREF or from a field in the Yext Knowledge Graph.
|
|
622
|
-
*
|
|
623
|
-
* Example of using the component to render
|
|
624
|
-
* a link with and without sourcing from a knowledge graph field:
|
|
625
|
-
*
|
|
626
|
-
* @example
|
|
627
|
-
* ```ts
|
|
628
|
-
* import { Link } from "@yext/pages/components";
|
|
629
|
-
*
|
|
630
|
-
* <Link href="/search">Locator</Link>
|
|
631
|
-
* <Link cta={document.c_exampleCTA} />
|
|
632
|
-
* <Link cta={{link: "https://www.yext.com", label: "Click Here", linkType: "URL"}} />
|
|
633
|
-
* ```
|
|
634
|
-
*
|
|
635
|
-
* @public
|
|
636
|
-
*/
|
|
637
|
-
declare const Link: React$1.ForwardRefExoticComponent<(Omit<HREFLinkProps, "ref"> | Omit<CTAWithChildrenLinkProps, "ref"> | Omit<CTAWithoutChildrenLinkProps, "ref">) & React$1.RefAttributes<HTMLAnchorElement>>;
|
|
638
|
-
|
|
639
|
-
declare enum Unit {
|
|
640
|
-
DEGREE = "deg",
|
|
641
|
-
KILOMETER = "km",
|
|
642
|
-
MILE = "mi",
|
|
643
|
-
RADIAN = "r"
|
|
644
|
-
}
|
|
645
|
-
declare enum Projection {
|
|
646
|
-
MERCATOR = "mercator",
|
|
647
|
-
SPHERICAL = "spherical"
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* This class represents a point on a sphere defined by latitude and longitude.
|
|
652
|
-
* Latitude is a degree number in the range [-90, 90].
|
|
653
|
-
* Longitude is a degree number without limits but is normalized to [-180, 180).
|
|
654
|
-
*/
|
|
655
|
-
declare class Coordinate$1 {
|
|
656
|
-
_lat: number;
|
|
657
|
-
_lon: number;
|
|
658
|
-
/**
|
|
659
|
-
* Constructor takes either 1 or 2 arguments.
|
|
660
|
-
* 2 arguments: latitude and longitude.
|
|
661
|
-
* 1 argument: an object with at least one {@link LATITUDE_ALIASES | latitude alias}
|
|
662
|
-
* and one one {@link LONGITUDE_ALIASES | longitude alias}.
|
|
663
|
-
* @param longitude - Optional only if the first argument is a {@link Coordinate}-like object
|
|
664
|
-
*/
|
|
665
|
-
constructor(latitudeOrObject: number | object, long?: number);
|
|
666
|
-
/**
|
|
667
|
-
* Degrees latitude in the range [-90, 90].
|
|
668
|
-
* If setting a value outside this range, it will be set to -90 or 90, whichever is closer.
|
|
669
|
-
*/
|
|
670
|
-
get latitude(): number;
|
|
671
|
-
set latitude(newLat: number);
|
|
672
|
-
/**
|
|
673
|
-
* Degrees longitude in the range [-Infinity, Infinity].
|
|
674
|
-
*/
|
|
675
|
-
get longitude(): number;
|
|
676
|
-
set longitude(newLon: number);
|
|
677
|
-
/**
|
|
678
|
-
* Degrees longitude in the range [-180, 180).
|
|
679
|
-
* If the coordinate's longitude is outside this range, the equivalent value within it is used.
|
|
680
|
-
* Examples: 123 =\> 123, 270 =\> -90, -541 =\> 179
|
|
681
|
-
*/
|
|
682
|
-
get normalLon(): number;
|
|
683
|
-
/**
|
|
684
|
-
* Add distance to the coordinate to change its position.
|
|
685
|
-
* @param latDist - latitude distance
|
|
686
|
-
* @param lonDist - longitude distance
|
|
687
|
-
* @param unit - The unit of latDist and lonDist
|
|
688
|
-
* @param projection - The projection of Earth (not relevant when using a physical distance unit, e.g. Mile)
|
|
689
|
-
*/
|
|
690
|
-
add(latDist: number, lonDist: number, unit?: Unit, projection?: Projection): void;
|
|
691
|
-
/**
|
|
692
|
-
* Calculate the distance from this coordinate to another coordinate.
|
|
693
|
-
* @param unit - The unit of distance
|
|
694
|
-
* @param projection - The projection of Earth (not relevant when using a physical distance unit, e.g. Mile)
|
|
695
|
-
* @returns Distance in the requested unit
|
|
696
|
-
*/
|
|
697
|
-
distanceTo(coordinate: Coordinate$1, unit?: Unit, projection?: Projection): number;
|
|
698
|
-
/**
|
|
699
|
-
* Test if this coordinate has the same latitude and longitude as another.
|
|
700
|
-
*/
|
|
701
|
-
equals(coordinate: Coordinate$1): boolean;
|
|
702
|
-
/**
|
|
703
|
-
* Get the coordinate as a string that can be used in a search query.
|
|
704
|
-
* Example: \{latitude: -45, longitude: 123\} =\> '-45,123'
|
|
705
|
-
*/
|
|
706
|
-
searchQueryString(): string;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
/**
|
|
710
|
-
* This class represents a bounded coordinate region of a sphere.
|
|
711
|
-
* The bounds are defined by two {@link Coordinates}: southwest and northeast.
|
|
712
|
-
* If the northeast coordinate does not have a greater latitude and longitude than the soutwest
|
|
713
|
-
* coordinate, the behavior of this object is undefined.
|
|
714
|
-
*/
|
|
715
|
-
declare class GeoBounds {
|
|
716
|
-
_ne: Coordinate$1;
|
|
717
|
-
_sw: Coordinate$1;
|
|
718
|
-
/**
|
|
719
|
-
* Create a new {@link GeoBounds} with minimal area that
|
|
720
|
-
* contains all the given coordinates
|
|
721
|
-
*/
|
|
722
|
-
static fit(coordinates: Coordinate$1[]): GeoBounds;
|
|
723
|
-
/**
|
|
724
|
-
* @param sw - Southwest coordinate
|
|
725
|
-
* @param ne - Northeast coordinate
|
|
726
|
-
*/
|
|
727
|
-
constructor(sw: Coordinate$1, ne: Coordinate$1);
|
|
728
|
-
/**
|
|
729
|
-
* Northeast coordinate
|
|
730
|
-
*/
|
|
731
|
-
get ne(): Coordinate$1;
|
|
732
|
-
set ne(newNE: Coordinate$1);
|
|
733
|
-
/**
|
|
734
|
-
* Southwest coordinate
|
|
735
|
-
*/
|
|
736
|
-
get sw(): Coordinate$1;
|
|
737
|
-
set sw(newSW: Coordinate$1);
|
|
738
|
-
/**
|
|
739
|
-
* Whether the coordinate lies within the region defined by the bounds.
|
|
740
|
-
* {@link Normalized | longitudes} are used for the
|
|
741
|
-
* bounds and the coordinate.
|
|
742
|
-
*/
|
|
743
|
-
contains(coordinate: Coordinate$1): boolean;
|
|
744
|
-
/**
|
|
745
|
-
* Extend the bounds if necessary so that the coordinate is contained by them.
|
|
746
|
-
*/
|
|
747
|
-
extend(coordinate: Coordinate$1): void;
|
|
748
|
-
/**
|
|
749
|
-
* Calculate the center of the bounds using the given projection.
|
|
750
|
-
* To find the visual center on a Mercator map, use Projection.MERCATOR.
|
|
751
|
-
* To find the center for geolocation or geosearch purposes, use Projection.SPHERICAL.
|
|
752
|
-
*/
|
|
753
|
-
getCenter(projection?: Projection): Coordinate$1;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* {@link ProviderMap} options class
|
|
758
|
-
*/
|
|
759
|
-
declare class ProviderMapOptions {
|
|
760
|
-
/**
|
|
761
|
-
* @param wrapper - The wrapper element that the map will be inserted into
|
|
762
|
-
*/
|
|
763
|
-
providerMapClass: typeof ProviderMap;
|
|
764
|
-
wrapper: HTMLElement | null;
|
|
765
|
-
controlEnabled: boolean;
|
|
766
|
-
panHandler: PanHandler;
|
|
767
|
-
panStartHandler: PanStartHandler;
|
|
768
|
-
providerOptions: {
|
|
769
|
-
[key: string]: any;
|
|
770
|
-
};
|
|
771
|
-
iframeWindow: Window | undefined;
|
|
772
|
-
apiKey: string | undefined;
|
|
773
|
-
constructor(provider: MapProvider, wrapper: HTMLElement | null);
|
|
774
|
-
/**
|
|
775
|
-
* @param controlEnabled - Whether the user can interact with the map
|
|
776
|
-
*/
|
|
777
|
-
withControlEnabled(controlEnabled: boolean): ProviderMapOptions;
|
|
778
|
-
/**
|
|
779
|
-
* @param panHandler - Function called after the map bounds change
|
|
780
|
-
*/
|
|
781
|
-
withPanHandler(panHandler: PanHandler): ProviderMapOptions;
|
|
782
|
-
/**
|
|
783
|
-
* @param panStartHandler - Function called before the map bounds change
|
|
784
|
-
*/
|
|
785
|
-
withPanStartHandler(panStartHandler: PanStartHandler): ProviderMapOptions;
|
|
786
|
-
/**
|
|
787
|
-
* @param providerOptions - A free-form object used to set any additional provider-specific
|
|
788
|
-
* options, usually by passing the object to the map's constructor
|
|
789
|
-
*/
|
|
790
|
-
withProviderOptions(providerOptions: object): ProviderMapOptions;
|
|
791
|
-
/**
|
|
792
|
-
* @param iframeWindow - The window of the iframe that the map will be rendered in.
|
|
793
|
-
* This is only necessary if the map is being rendered in an iframe.
|
|
794
|
-
*/
|
|
795
|
-
withIframeWindow(iframeWindow: Window | undefined): ProviderMapOptions;
|
|
796
|
-
/**
|
|
797
|
-
* @param apiKey - The API key to use for the map provider, if required.
|
|
798
|
-
*/
|
|
799
|
-
withApiKey(apiKey: string | undefined): ProviderMapOptions;
|
|
800
|
-
/**
|
|
801
|
-
* @returns An instance of a subclass of {@link ProviderMap}
|
|
802
|
-
* for the given {@link MapProvider}
|
|
803
|
-
*/
|
|
804
|
-
build(): ProviderMap;
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* This class is an interface that should be implemented for each map provider, such as Google Maps.
|
|
808
|
-
* It is used as an API for a {@link Map} to control a
|
|
809
|
-
* provider-specific map instance. Ideally, this class should have minimal functionality so that
|
|
810
|
-
* adding a new provider is easy and behavior is as consistent as possible across all providers.
|
|
811
|
-
*/
|
|
812
|
-
declare class ProviderMap {
|
|
813
|
-
/**
|
|
814
|
-
* The constructor creates a map instance using the provider's API and initializes it with all the
|
|
815
|
-
* given options. See {@link ProviderMapOptions}
|
|
816
|
-
* for the supported options.
|
|
817
|
-
*/
|
|
818
|
-
_panHandler: PanHandler;
|
|
819
|
-
_panStartHandler: PanStartHandler;
|
|
820
|
-
constructor(options: ProviderMapOptions);
|
|
821
|
-
/**
|
|
822
|
-
* The current center of the map
|
|
823
|
-
*/
|
|
824
|
-
getCenter(): Coordinate$1;
|
|
825
|
-
/**
|
|
826
|
-
* Zoom level complies with the specifications in {@link Map#getZoom}
|
|
827
|
-
* @returns The current zoom level of the map
|
|
828
|
-
*/
|
|
829
|
-
getZoom(): number;
|
|
830
|
-
/**
|
|
831
|
-
* @param coordinate - The new center for the map
|
|
832
|
-
* @param animated - Whether to transition smoothly to the new center
|
|
833
|
-
*/
|
|
834
|
-
setCenter(_: Coordinate$1, __: boolean): void;
|
|
835
|
-
/**
|
|
836
|
-
* Zoom level complies with the specifications in {@link Map#getZoom}
|
|
837
|
-
* @param zoom - The new zoom level for the map
|
|
838
|
-
* @param animated - Whether to transition smoothly to the new zoom
|
|
839
|
-
*/
|
|
840
|
-
setZoom(_: number, __: boolean): void;
|
|
841
|
-
/**
|
|
842
|
-
* @param center - Must be convertible to {@link Coordinate}
|
|
843
|
-
* @param animated - Whether to transition smoothly to the new bounds
|
|
844
|
-
* @see ProviderMap#setZoom
|
|
845
|
-
* @see ProviderMap#setCenter
|
|
846
|
-
*/
|
|
847
|
-
setZoomCenter(zoom: number, center: Coordinate$1, animated: boolean): void;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
/**
|
|
851
|
-
* {@link ProviderPin} options class
|
|
852
|
-
*/
|
|
853
|
-
declare class ProviderPinOptions {
|
|
854
|
-
providerPinClass: typeof ProviderPin;
|
|
855
|
-
clickHandler: PinClickHandler;
|
|
856
|
-
focusHandler: PinFocusHandler;
|
|
857
|
-
hoverHandler: PinHoverHandler;
|
|
858
|
-
icons: {
|
|
859
|
-
[key: string]: string;
|
|
860
|
-
};
|
|
861
|
-
hasPinUrl: boolean;
|
|
862
|
-
constructor(provider: MapProvider);
|
|
863
|
-
/**
|
|
864
|
-
* @param clickHandler - Function called when the pin is clicked
|
|
865
|
-
*/
|
|
866
|
-
withClickHandler(clickHandler: PinClickHandler): ProviderPinOptions;
|
|
867
|
-
/**
|
|
868
|
-
* @param focusHandler - Function called when the pin becomes (un)focused
|
|
869
|
-
*/
|
|
870
|
-
withFocusHandler(focusHandler: PinFocusHandler): ProviderPinOptions;
|
|
871
|
-
/**
|
|
872
|
-
* @param hoverHandler - Function called when the pin becomes (un)hovered
|
|
873
|
-
*/
|
|
874
|
-
withHoverHandler(hoverHandler: PinHoverHandler): ProviderPinOptions;
|
|
875
|
-
/**
|
|
876
|
-
* Similar to {@link MapPinOptions#withIcon},
|
|
877
|
-
* but all icons are given as a map of key =\> icon. If a provider pin instance needs an icon to be
|
|
878
|
-
* a specialized class rather than a simple URL, the icons in this object can be converted in this
|
|
879
|
-
* function and assigned back to the icons object instead of being recreated from the URL every
|
|
880
|
-
* time the pin's icon changes.
|
|
881
|
-
* @param icons - Map of a string key to the URL or data URI of an image
|
|
882
|
-
*/
|
|
883
|
-
withIcons(icons: {
|
|
884
|
-
[key: string]: string;
|
|
885
|
-
}): ProviderPinOptions;
|
|
886
|
-
/**
|
|
887
|
-
* @param hasPinUrl - Pass through from MapPin class
|
|
888
|
-
* @returns
|
|
889
|
-
*/
|
|
890
|
-
withHasPinUrl(hasPinUrl: boolean): this;
|
|
891
|
-
/**
|
|
892
|
-
* @returns An instance of a subclass of {@link ProviderPin}
|
|
893
|
-
* for the given {@link MapProvider}
|
|
894
|
-
*/
|
|
895
|
-
build(): ProviderPin;
|
|
896
|
-
}
|
|
897
|
-
/**
|
|
898
|
-
* This class is an interface that should be implemented for each map provider, such as Google Maps.
|
|
899
|
-
* It is used as an API for a {@link MapPin} to control a
|
|
900
|
-
* provider-specific pin instance. Ideally, this class should have minimal functionality so that
|
|
901
|
-
* adding a new provider is easy and behavior is as consistent as possible across all providers.
|
|
902
|
-
*/
|
|
903
|
-
declare class ProviderPin {
|
|
904
|
-
_clickHandler: PinClickHandler;
|
|
905
|
-
_focusHandler: PinFocusHandler;
|
|
906
|
-
_hoverHandler: PinHoverHandler;
|
|
907
|
-
_icons: {
|
|
908
|
-
[key: string]: string;
|
|
909
|
-
};
|
|
910
|
-
/**
|
|
911
|
-
* The constructor creates a pin instance using the provider's API and initializes it with all the
|
|
912
|
-
* given options. See {@link ProviderPinOptions}
|
|
913
|
-
* for the supported options.
|
|
914
|
-
*/
|
|
915
|
-
constructor(options: ProviderPinOptions);
|
|
916
|
-
/**
|
|
917
|
-
* @param coordinate - The position of the pin
|
|
918
|
-
*/
|
|
919
|
-
setCoordinate(_: Coordinate$1): void;
|
|
920
|
-
/**
|
|
921
|
-
* Remove the pin from its current map and, if newMap is not null, add it to the new map.
|
|
922
|
-
* @param newMap - The new map -- if null, the pin will not be
|
|
923
|
-
* shown on any map
|
|
924
|
-
* @param currentMap - The current map -- if null, the pin is
|
|
925
|
-
* not shown on any map
|
|
926
|
-
*/
|
|
927
|
-
setMap(_: Map$1 | null, __: Map$1 | null): void;
|
|
928
|
-
/**
|
|
929
|
-
* Apply the given properties to modify the appearance of the pin.
|
|
930
|
-
* @see PinProperties
|
|
931
|
-
*/
|
|
932
|
-
setProperties(_: PinProperties): void;
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
type ProviderLoadFunction = (resolve: () => void, reject: () => void, apiKey: string, options: object) => void;
|
|
936
|
-
/**
|
|
937
|
-
* {@link MapProvider} options class
|
|
938
|
-
*/
|
|
939
|
-
declare class MapProviderOptions {
|
|
940
|
-
loadFunction: ProviderLoadFunction;
|
|
941
|
-
mapClass: typeof ProviderMap;
|
|
942
|
-
pinClass: typeof ProviderPin;
|
|
943
|
-
providerName: string;
|
|
944
|
-
constructor();
|
|
945
|
-
withLoadFunction(loadFunction: ProviderLoadFunction): MapProviderOptions;
|
|
946
|
-
/**
|
|
947
|
-
* @param mapClass - Subclass of {@link ProviderMap}
|
|
948
|
-
* for the provider
|
|
949
|
-
*/
|
|
950
|
-
withMapClass(mapClass: typeof ProviderMap): MapProviderOptions;
|
|
951
|
-
/**
|
|
952
|
-
* @param pinClass - Subclass of {@link ProviderPin} for the provider
|
|
953
|
-
*/
|
|
954
|
-
withPinClass(pinClass: typeof ProviderPin): MapProviderOptions;
|
|
955
|
-
/**
|
|
956
|
-
* @param providerName - Name of the map provider
|
|
957
|
-
*/
|
|
958
|
-
withProviderName(providerName: string): MapProviderOptions;
|
|
959
|
-
build(): MapProvider;
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* This class is used for loading the API for a map provider such as Google Maps and creating {@link ProviderMap}
|
|
963
|
-
* and {@link ProviderPin} instances.
|
|
964
|
-
* Provider map implementations return an instance of this class for their provider that you can use
|
|
965
|
-
* to load the API and pass in to {@link MapOptions} and {@link MapPinOptions} objects as the provider.
|
|
966
|
-
* Example using {@link GoogleMaps}, an instance of this
|
|
967
|
-
* class: GoogleMaps.load().then(() =\> map = new MapOptions().withProvider(GoogleMaps).build());
|
|
968
|
-
*/
|
|
969
|
-
declare class MapProvider {
|
|
970
|
-
_loadFunction: ProviderLoadFunction;
|
|
971
|
-
_mapClass: typeof ProviderMap;
|
|
972
|
-
_pinClass: typeof ProviderPin;
|
|
973
|
-
_providerName: string;
|
|
974
|
-
_loadPromise: Promise<void>;
|
|
975
|
-
_resolveLoad?: () => void;
|
|
976
|
-
_rejectLoad?: () => void;
|
|
977
|
-
_apiKey: string;
|
|
978
|
-
_loadInvoked: boolean;
|
|
979
|
-
_loaded: boolean;
|
|
980
|
-
_options: any;
|
|
981
|
-
constructor(options: MapProviderOptions);
|
|
982
|
-
/**
|
|
983
|
-
* Returns true if the map provider has been successfully loaded
|
|
984
|
-
*/
|
|
985
|
-
get loaded(): boolean;
|
|
986
|
-
/**
|
|
987
|
-
* @see ~MapProviderOptions#withMapClass
|
|
988
|
-
*/
|
|
989
|
-
getMapClass(): typeof ProviderMap;
|
|
990
|
-
/**
|
|
991
|
-
* @see MapProviderOptions#withPinClass
|
|
992
|
-
*/
|
|
993
|
-
getPinClass(): typeof ProviderPin;
|
|
994
|
-
/**
|
|
995
|
-
* @see MapProviderOptions#withProviderName
|
|
996
|
-
*/
|
|
997
|
-
getProviderName(): string;
|
|
998
|
-
/**
|
|
999
|
-
* Call {@link loadFunction}
|
|
1000
|
-
* and resolve or reject when loading succeeds or fails
|
|
1001
|
-
* @param apiKey - Provider API key -- uses value from {@link MapProvider#setLoadOptions}
|
|
1002
|
-
* if not passed
|
|
1003
|
-
* @param options - Additional provider-specific options -- uses value from {@link MapProvider#setLoadOptions}
|
|
1004
|
-
* if not passed
|
|
1005
|
-
*/
|
|
1006
|
-
load(apiKey?: string, options?: any): Promise<void>;
|
|
1007
|
-
/**
|
|
1008
|
-
* Resolves or rejects when the map provider has loaded successfully or unsuccessfully
|
|
1009
|
-
*/
|
|
1010
|
-
ready(): Promise<void>;
|
|
1011
|
-
/**
|
|
1012
|
-
* Set the API key and provider options used on load. Does nothing if load was already called.
|
|
1013
|
-
* @param apiKey - Provider API key
|
|
1014
|
-
* @param options - Additional provider-specific options
|
|
1015
|
-
*/
|
|
1016
|
-
setLoadOptions(apiKey: string, options?: object | null): void;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
/**
|
|
1020
|
-
* This class is used to set the appearance of a {@link MapPin}.
|
|
1021
|
-
* Most properties are supported by all providers, but some are only supported by providers that
|
|
1022
|
-
* implement {@link HTMLProviderPin}.
|
|
1023
|
-
*/
|
|
1024
|
-
declare class PinProperties {
|
|
1025
|
-
_anchorX: number;
|
|
1026
|
-
_anchorY: number;
|
|
1027
|
-
_height: number;
|
|
1028
|
-
_icon: string;
|
|
1029
|
-
_srText: string;
|
|
1030
|
-
_width: number;
|
|
1031
|
-
_zIndex: number;
|
|
1032
|
-
_class: string;
|
|
1033
|
-
_element: HTMLElement | null;
|
|
1034
|
-
constructor();
|
|
1035
|
-
/**
|
|
1036
|
-
* @returns The point in the pin that should be positioned over the coordinate, from 0
|
|
1037
|
-
* (left edge) to 1 (right edge)
|
|
1038
|
-
*/
|
|
1039
|
-
getAnchorX(): number;
|
|
1040
|
-
/**
|
|
1041
|
-
* @returns The point in the pin that should be positioned over the coordinate, from 0
|
|
1042
|
-
* (top edge) to 1 (bottom edge)
|
|
1043
|
-
*/
|
|
1044
|
-
getAnchorY(): number;
|
|
1045
|
-
/**
|
|
1046
|
-
* {@link HTMLProviderPins} only
|
|
1047
|
-
* @returns The class of the wrapper element for an HTML pin
|
|
1048
|
-
*/
|
|
1049
|
-
getClass(): string;
|
|
1050
|
-
/**
|
|
1051
|
-
* {@link HTMLProviderPins} only
|
|
1052
|
-
* @returns The HTML pin element
|
|
1053
|
-
*/
|
|
1054
|
-
getElement(): HTMLElement | null;
|
|
1055
|
-
/**
|
|
1056
|
-
* @returns The pixel height of the pin
|
|
1057
|
-
*/
|
|
1058
|
-
getHeight(): number;
|
|
1059
|
-
/**
|
|
1060
|
-
* This returns a string key that can be used with {@link MapPin#getIcon}
|
|
1061
|
-
* to get the icon image for a pin.
|
|
1062
|
-
* @returns The unique name of the icon
|
|
1063
|
-
*/
|
|
1064
|
-
getIcon(): string;
|
|
1065
|
-
/**
|
|
1066
|
-
* @returns The text that a screen reader reads when focused on the pin
|
|
1067
|
-
*/
|
|
1068
|
-
getSRText(): string;
|
|
1069
|
-
/**
|
|
1070
|
-
* @returns The pixel width of the pin
|
|
1071
|
-
*/
|
|
1072
|
-
getWidth(): number;
|
|
1073
|
-
/**
|
|
1074
|
-
* @returns The z-index of the pin
|
|
1075
|
-
*/
|
|
1076
|
-
getZIndex(): number;
|
|
1077
|
-
/**
|
|
1078
|
-
* @see PinProperties#getAnchorX
|
|
1079
|
-
*/
|
|
1080
|
-
setAnchorX(anchorX: number): PinProperties;
|
|
1081
|
-
/**
|
|
1082
|
-
* @see PinProperties#getAnchorY
|
|
1083
|
-
*/
|
|
1084
|
-
setAnchorY(anchorY: number): PinProperties;
|
|
1085
|
-
/**
|
|
1086
|
-
* @see PinProperties#getClass
|
|
1087
|
-
*/
|
|
1088
|
-
setClass(className: string): PinProperties;
|
|
1089
|
-
/**
|
|
1090
|
-
* @see PinProperties#getElement
|
|
1091
|
-
*/
|
|
1092
|
-
setElement(element: HTMLElement): PinProperties;
|
|
1093
|
-
/**
|
|
1094
|
-
* @see PinProperties#getHeight
|
|
1095
|
-
*/
|
|
1096
|
-
setHeight(height: number): PinProperties;
|
|
1097
|
-
/**
|
|
1098
|
-
* @see PinProperties#getIcon
|
|
1099
|
-
*/
|
|
1100
|
-
setIcon(icon: string): PinProperties;
|
|
1101
|
-
/**
|
|
1102
|
-
* @see PinProperties#getSRText
|
|
1103
|
-
*/
|
|
1104
|
-
setSRText(srText: string): PinProperties;
|
|
1105
|
-
/**
|
|
1106
|
-
* @see PinProperties#getWidth
|
|
1107
|
-
*/
|
|
1108
|
-
setWidth(width: number): PinProperties;
|
|
1109
|
-
/**
|
|
1110
|
-
* @see PinProperties#getZIndex
|
|
1111
|
-
*/
|
|
1112
|
-
setZIndex(zIndex: number): PinProperties;
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
type PropertiesForStatus = (status: object) => PinProperties;
|
|
1116
|
-
type PinClickHandler = () => void;
|
|
1117
|
-
type PinFocusHandler = (focused: boolean) => void;
|
|
1118
|
-
type PinHoverHandler = (hovered: boolean) => void;
|
|
1119
|
-
/**
|
|
1120
|
-
* {@link MapPin} options class
|
|
1121
|
-
*/
|
|
1122
|
-
declare class MapPinOptions {
|
|
1123
|
-
/**
|
|
1124
|
-
* Initialize with default options
|
|
1125
|
-
*/
|
|
1126
|
-
coordinate: Coordinate$1;
|
|
1127
|
-
hideOffscreen: boolean;
|
|
1128
|
-
icons: {
|
|
1129
|
-
[key: string]: string;
|
|
1130
|
-
};
|
|
1131
|
-
propertiesForStatus: PropertiesForStatus;
|
|
1132
|
-
provider: MapProvider | null;
|
|
1133
|
-
type: string;
|
|
1134
|
-
hasPinUrl: boolean;
|
|
1135
|
-
constructor();
|
|
1136
|
-
/**
|
|
1137
|
-
* @param coordinate - Must be convertible to {@link Coordinate}
|
|
1138
|
-
*/
|
|
1139
|
-
withCoordinate(coordinate: Coordinate$1): MapPinOptions;
|
|
1140
|
-
/**
|
|
1141
|
-
* @param hideOffscreen - If true, the pin will only be rendered if it's in the visible
|
|
1142
|
-
* portion of the map to improve performance
|
|
1143
|
-
*/
|
|
1144
|
-
withHideOffscreen(hideOffscreen: boolean): MapPinOptions;
|
|
1145
|
-
/**
|
|
1146
|
-
* @param key - The unique name for the icon, used in {@link PinProperties#getIcon}
|
|
1147
|
-
* and {@link PinProperties#setIcon}
|
|
1148
|
-
* @param icon - The URL or data URI of the icon image
|
|
1149
|
-
*/
|
|
1150
|
-
withIcon(key: string, icon: string): MapPinOptions;
|
|
1151
|
-
withPropertiesForStatus(propertiesForStatus: PropertiesForStatus): MapPinOptions;
|
|
1152
|
-
withProvider(provider: MapProvider | null): MapPinOptions;
|
|
1153
|
-
/**
|
|
1154
|
-
* @param hasPinUrl - If true, the pin's HTML element will be a div instead of a button since there is a nested anchor tag within the pin. This will fix current accessibility issues.
|
|
1155
|
-
*/
|
|
1156
|
-
withHasPinUrl(hasPinUrl: boolean): MapPinOptions;
|
|
1157
|
-
/**
|
|
1158
|
-
* @param type - A string describing the type of the pin
|
|
1159
|
-
*/
|
|
1160
|
-
withType(type: string): MapPinOptions;
|
|
1161
|
-
build(): MapPin;
|
|
1162
|
-
}
|
|
1163
|
-
/**
|
|
1164
|
-
* A pin for a {@link Map} that displays at a given {@link Coordinate}.
|
|
1165
|
-
* A MapPin can be displayed on at most one Map at a time. Pins support event handlers for clicking,
|
|
1166
|
-
* hovering, and focusing. The pin can change its appearance based on its current status, which is
|
|
1167
|
-
* changed by {@link setStatus}.
|
|
1168
|
-
*/
|
|
1169
|
-
declare class MapPin {
|
|
1170
|
-
_coordinate: Coordinate$1;
|
|
1171
|
-
_hideOffscreen: boolean;
|
|
1172
|
-
_icons: {
|
|
1173
|
-
[key: string]: string;
|
|
1174
|
-
};
|
|
1175
|
-
_propertiesForStatus: PropertiesForStatus;
|
|
1176
|
-
_type: string;
|
|
1177
|
-
_clickHandler: PinClickHandler;
|
|
1178
|
-
_focusHandler: PinFocusHandler;
|
|
1179
|
-
_hoverHandler: PinHoverHandler;
|
|
1180
|
-
_hidden: boolean;
|
|
1181
|
-
_cancelHiddenUpdater: () => void;
|
|
1182
|
-
_map: Map$1 | null;
|
|
1183
|
-
_pin: ProviderPin;
|
|
1184
|
-
_status: object;
|
|
1185
|
-
constructor(options: MapPinOptions);
|
|
1186
|
-
/**
|
|
1187
|
-
* @returns The coordinate of the pin
|
|
1188
|
-
*/
|
|
1189
|
-
getCoordinate(): Coordinate$1;
|
|
1190
|
-
/**
|
|
1191
|
-
* Get the icon for a string key, such as 'default', 'hovered', or 'selected'
|
|
1192
|
-
* @param key - The unique name of the icon
|
|
1193
|
-
* @returns The URL or data URI of the icon image
|
|
1194
|
-
* @see MapPinOptions#withIcon
|
|
1195
|
-
*/
|
|
1196
|
-
getIcon(key: string): string;
|
|
1197
|
-
/**
|
|
1198
|
-
* @returns The map that the pin is currently on, or null if
|
|
1199
|
-
* not on a map
|
|
1200
|
-
*/
|
|
1201
|
-
getMap(): Map$1 | null;
|
|
1202
|
-
/**
|
|
1203
|
-
* Intended for internal use only
|
|
1204
|
-
* @returns The pin's {@link ProviderPin}
|
|
1205
|
-
* instance
|
|
1206
|
-
*/
|
|
1207
|
-
getProviderPin(): ProviderPin;
|
|
1208
|
-
/**
|
|
1209
|
-
* @returns The string describing the type of pin
|
|
1210
|
-
*/
|
|
1211
|
-
getType(): string;
|
|
1212
|
-
/**
|
|
1213
|
-
* Remove this pin from its current map, if on one.
|
|
1214
|
-
*/
|
|
1215
|
-
remove(): void;
|
|
1216
|
-
/**
|
|
1217
|
-
* Set a handler function for when the pin is clicked, replacing any previously set click handler.
|
|
1218
|
-
*/
|
|
1219
|
-
setClickHandler(clickHandler: PinClickHandler): void;
|
|
1220
|
-
/**
|
|
1221
|
-
* @param coordinate - Must be convertible to {@link Coordinate}
|
|
1222
|
-
*/
|
|
1223
|
-
setCoordinate(coordinate: Coordinate$1): void;
|
|
1224
|
-
/**
|
|
1225
|
-
* Set a handler function for when the pin is (un)focused, replacing any previously set focus handler.
|
|
1226
|
-
*/
|
|
1227
|
-
setFocusHandler(focusHandler: PinFocusHandler): void;
|
|
1228
|
-
/**
|
|
1229
|
-
* Set a handler function for when the pin is (un)hovered, replacing any previously set hover handler.
|
|
1230
|
-
*/
|
|
1231
|
-
setHoverHandler(hoverHandler: PinHoverHandler): void;
|
|
1232
|
-
/**
|
|
1233
|
-
* Add the pin to a map, removing it from its current map if on one.
|
|
1234
|
-
*/
|
|
1235
|
-
setMap(map: Map$1 | null): void;
|
|
1236
|
-
/**
|
|
1237
|
-
* Assign all properties in an object to the pin's status.
|
|
1238
|
-
* Example: if the pin's status is \{ a: true, b: true \}, passing in \{ a: false, c: true \} will
|
|
1239
|
-
* change the pin's status to \{ a: false, b: true, c: true \}
|
|
1240
|
-
*/
|
|
1241
|
-
setStatus(status: object): void;
|
|
1242
|
-
/**
|
|
1243
|
-
* Add or remove the pin from the map based on whether its coordinate is within the current bounds
|
|
1244
|
-
*/
|
|
1245
|
-
_hideIfOffscreen(): void;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
type PaddingFunction = () => number;
|
|
1249
|
-
type PanHandler = (previousBounds?: GeoBounds, currentBounds?: GeoBounds) => void;
|
|
1250
|
-
type PanStartHandler = (currentBounds?: GeoBounds) => void;
|
|
1251
|
-
type PaddingObject = {
|
|
1252
|
-
bottom?: number | PaddingFunction;
|
|
1253
|
-
left?: number | PaddingFunction;
|
|
1254
|
-
right?: number | PaddingFunction;
|
|
1255
|
-
top?: number | PaddingFunction;
|
|
1256
|
-
};
|
|
1257
|
-
/**
|
|
1258
|
-
* {@link Map} options class
|
|
1259
|
-
*/
|
|
1260
|
-
declare class MapOptions {
|
|
1261
|
-
controlEnabled: boolean;
|
|
1262
|
-
defaultCenter: Coordinate$1;
|
|
1263
|
-
defaultZoom: number;
|
|
1264
|
-
legendPins: MapPin[];
|
|
1265
|
-
padding: PaddingObject;
|
|
1266
|
-
panHandler: PanHandler;
|
|
1267
|
-
panStartHandler: PanStartHandler;
|
|
1268
|
-
provider: MapProvider | null;
|
|
1269
|
-
providerOptions: ProviderMapOptions | object;
|
|
1270
|
-
singlePinZoom: number;
|
|
1271
|
-
wrapper: HTMLElement | null;
|
|
1272
|
-
iframeWindow: Window | undefined;
|
|
1273
|
-
apiKey: string | undefined;
|
|
1274
|
-
/**
|
|
1275
|
-
* Initialize with default options
|
|
1276
|
-
*/
|
|
1277
|
-
constructor();
|
|
1278
|
-
/**
|
|
1279
|
-
* @param controlEnabled - Whether the user can move and zoom the map
|
|
1280
|
-
*/
|
|
1281
|
-
withControlEnabled(controlEnabled: boolean): MapOptions;
|
|
1282
|
-
/**
|
|
1283
|
-
* @param defaultCenter - The center on initial load and
|
|
1284
|
-
* when calling {@link Map#fitCoordinates} with an empty array
|
|
1285
|
-
*/
|
|
1286
|
-
withDefaultCenter(defaultCenter: Coordinate$1): MapOptions;
|
|
1287
|
-
/**
|
|
1288
|
-
* @param defaultZoom - The zoom on initial load and when calling {@link Map#fitCoordinates}
|
|
1289
|
-
* with an empty array
|
|
1290
|
-
*/
|
|
1291
|
-
withDefaultZoom(defaultZoom: number): MapOptions;
|
|
1292
|
-
/**
|
|
1293
|
-
* GENERATOR TODO Map legend not yet implemented
|
|
1294
|
-
* @param legendPins - Pins used to construct the map legend
|
|
1295
|
-
*/
|
|
1296
|
-
withLegendPins(legendPins: MapPin[]): MapOptions;
|
|
1297
|
-
/**
|
|
1298
|
-
* Padding is used by {@link Map#fitCoordinates}.
|
|
1299
|
-
* Padding can either be constant values or funtions that return a padding value.
|
|
1300
|
-
* See {@link Map#setPadding} for more information.
|
|
1301
|
-
* @see {@link Map#setPadding}
|
|
1302
|
-
*/
|
|
1303
|
-
withPadding(padding: {
|
|
1304
|
-
bottom: number | PaddingFunction;
|
|
1305
|
-
left: number | PaddingFunction;
|
|
1306
|
-
right: number | PaddingFunction;
|
|
1307
|
-
top: number | PaddingFunction;
|
|
1308
|
-
}): MapOptions;
|
|
1309
|
-
withPanHandler(panHandler: PanHandler): MapOptions;
|
|
1310
|
-
withPanStartHandler(panStartHandler: PanStartHandler): MapOptions;
|
|
1311
|
-
/**
|
|
1312
|
-
* The {@link MapProvider} must be loaded before
|
|
1313
|
-
* constructing the {@link Map}.
|
|
1314
|
-
*/
|
|
1315
|
-
withProvider(provider: MapProvider): MapOptions;
|
|
1316
|
-
/**
|
|
1317
|
-
* @param providerOptions - A free-form object used to set any additional provider-specific
|
|
1318
|
-
* options in the {@link ProviderMap}
|
|
1319
|
-
*/
|
|
1320
|
-
withProviderOptions(providerOptions: object): MapOptions;
|
|
1321
|
-
/**
|
|
1322
|
-
* @param singlePinZoom - The zoom when calling {@link Map#fitCoordinates}
|
|
1323
|
-
* with an array containing one coordinate
|
|
1324
|
-
*/
|
|
1325
|
-
withSinglePinZoom(singlePinZoom: number): MapOptions;
|
|
1326
|
-
/**
|
|
1327
|
-
* @param wrapper - The wrapper element that the map will be inserted into. The
|
|
1328
|
-
* existing contents of the element will be removed.
|
|
1329
|
-
*/
|
|
1330
|
-
withWrapper(wrapper: HTMLElement | null): MapOptions;
|
|
1331
|
-
/**
|
|
1332
|
-
* @param iframeWindow - The window of the iframe that the map will be rendered in.
|
|
1333
|
-
* This is only necessary if the map is being rendered in an iframe.
|
|
1334
|
-
*/
|
|
1335
|
-
withIframeWindow(iframeWindow: Window | undefined): MapOptions;
|
|
1336
|
-
/**
|
|
1337
|
-
* @param apiKey - The API key to use for the map provider, if required.
|
|
1338
|
-
*/
|
|
1339
|
-
withApiKey(apiKey: string | undefined): MapOptions;
|
|
1340
|
-
build(): Map$1;
|
|
1341
|
-
}
|
|
1342
|
-
/**
|
|
1343
|
-
* An interactive map that supports various map providers, such as Google Maps and Mapbox, with a
|
|
1344
|
-
* single API. Code written using this class functions approximately the same regardless of the map
|
|
1345
|
-
* provider used. Any map provider can be supported via an instance of {@link MapProvider}.
|
|
1346
|
-
*/
|
|
1347
|
-
declare class Map$1 {
|
|
1348
|
-
/**
|
|
1349
|
-
* The {@link MapProvider} for the map must be loaded
|
|
1350
|
-
* before calling this constructor.
|
|
1351
|
-
*/
|
|
1352
|
-
_defaultCenter: Coordinate$1;
|
|
1353
|
-
_defaultZoom: number;
|
|
1354
|
-
_legendPins: MapPin[];
|
|
1355
|
-
_padding: PaddingObject;
|
|
1356
|
-
_provider: MapProvider | null;
|
|
1357
|
-
_singlePinZoom: number;
|
|
1358
|
-
_wrapper: HTMLElement | null;
|
|
1359
|
-
_cachedBounds: GeoBounds | null;
|
|
1360
|
-
_resolveIdle: () => void;
|
|
1361
|
-
_resolveMoving: () => void;
|
|
1362
|
-
_idlePromise: Promise<void>;
|
|
1363
|
-
_panHandlerRunning: boolean;
|
|
1364
|
-
_panStartHandlerRunning: boolean;
|
|
1365
|
-
_currentBounds: GeoBounds;
|
|
1366
|
-
_movingPromise?: Promise<void>;
|
|
1367
|
-
_panHandler?: PanHandler;
|
|
1368
|
-
_panStartHandler?: PanStartHandler;
|
|
1369
|
-
_map: ProviderMap;
|
|
1370
|
-
constructor(options: MapOptions);
|
|
1371
|
-
/**
|
|
1372
|
-
* Set the map bounds so that all the given coordinates are within the {@link padded}
|
|
1373
|
-
* view.
|
|
1374
|
-
* @param animated - Whether to transition smoothly to the new bounds
|
|
1375
|
-
* @param maxZoom - The max zoom level after fitting. Uses {@link singlePinZoom}
|
|
1376
|
-
* by default.
|
|
1377
|
-
*/
|
|
1378
|
-
fitCoordinates(coordinates: Coordinate$1[], animated?: boolean, maxZoom?: number): void;
|
|
1379
|
-
/**
|
|
1380
|
-
* Get the current visible region of the map. If the map is zoomed out to show multiple copies of
|
|
1381
|
-
* the world, the longitude bounds will be outside [-180, 180) but the center will always be
|
|
1382
|
-
* within [-180, 180).
|
|
1383
|
-
*/
|
|
1384
|
-
getBounds(): GeoBounds;
|
|
1385
|
-
/**
|
|
1386
|
-
* @returns The center of the current visible region of
|
|
1387
|
-
* the map
|
|
1388
|
-
*/
|
|
1389
|
-
getCenter(): Coordinate$1;
|
|
1390
|
-
/**
|
|
1391
|
-
* Intended for internal use only
|
|
1392
|
-
* @returns The map's {@link ProviderMap}
|
|
1393
|
-
* instance
|
|
1394
|
-
*/
|
|
1395
|
-
getProviderMap(): ProviderMap;
|
|
1396
|
-
/**
|
|
1397
|
-
* To standardize zoom for all providers, zoom level is calculated with this formula:
|
|
1398
|
-
* zoom = log2(pixel width of equator) - 8.
|
|
1399
|
-
* At zoom = 0, the entire world is 256 pixels wide.
|
|
1400
|
-
* At zoom = 1, the entire world is 512 pixels wide.
|
|
1401
|
-
* Zoom 2 → 1024 pixels, zoom 3 → 2056 pixels, etc.
|
|
1402
|
-
* Negative and non-integer zoom levels are valid and follow the formula.
|
|
1403
|
-
* @returns The current zoom level of the map
|
|
1404
|
-
*/
|
|
1405
|
-
getZoom(): number;
|
|
1406
|
-
/**
|
|
1407
|
-
* Returns when the map is not moving.
|
|
1408
|
-
* Use map.idle().then(callback) to run callback immediately if the map is currently idle or once
|
|
1409
|
-
* the map becomes idle if it's not.
|
|
1410
|
-
*/
|
|
1411
|
-
idle(): Promise<void>;
|
|
1412
|
-
/**
|
|
1413
|
-
* Returns when the map is moving.
|
|
1414
|
-
* Use map.moving().then(callback) to run callback immediately if the map is currently moving or
|
|
1415
|
-
* once the map starts moving if it's not.
|
|
1416
|
-
*/
|
|
1417
|
-
moving(): Promise<void>;
|
|
1418
|
-
/**
|
|
1419
|
-
* @returns A {@link MapPinOptions}
|
|
1420
|
-
* instance with the same provider as this map
|
|
1421
|
-
*/
|
|
1422
|
-
newPinOptions(): MapPinOptions;
|
|
1423
|
-
/**
|
|
1424
|
-
* Called when the map has finished moving, at most once per animation frame.
|
|
1425
|
-
* Passes the current and previous bounds to the custom pan handler given by {@link MapOptions#withPanHandler}
|
|
1426
|
-
*/
|
|
1427
|
-
panHandler(): void;
|
|
1428
|
-
/**
|
|
1429
|
-
* Called when the map has started moving, at most once per animation frame.
|
|
1430
|
-
* Passes the current bounds to the custom pan handler given by {@link MapOptions#withPanStartHandler}
|
|
1431
|
-
*/
|
|
1432
|
-
panStartHandler(): void;
|
|
1433
|
-
/**
|
|
1434
|
-
* @param bounds - bounds.ne: The northeast corner of the bounds -- must be convertible to {@link Coordinate}
|
|
1435
|
-
* bounds.se: The southwest corner of the bounds -- must be convertible to {@link Coordinate}
|
|
1436
|
-
* @param animated - Whether to transition smoothly to the new bounds
|
|
1437
|
-
* @param padding - padding.bottom: Minimum number of pixels between the map's bottom edge and a pin
|
|
1438
|
-
* padding.left: Minimum number of pixels between the map's left edge and a pin
|
|
1439
|
-
* padding.right: Minimum number of pixels between the map's right edge and a pin
|
|
1440
|
-
* padding.top: Minimum number of pixels between the map's top edge and a pin
|
|
1441
|
-
*/
|
|
1442
|
-
setBounds({ ne, sw }: GeoBounds, animated?: boolean, padding?: {
|
|
1443
|
-
bottom?: number | PaddingFunction;
|
|
1444
|
-
left?: number | PaddingFunction;
|
|
1445
|
-
right?: number | PaddingFunction;
|
|
1446
|
-
top?: number | PaddingFunction;
|
|
1447
|
-
}, maxZoom?: number): void;
|
|
1448
|
-
/**
|
|
1449
|
-
* @param coordinate - Must be convertible to {@link Coordinate}
|
|
1450
|
-
* @param animated - Whether to transition smoothly to the new center
|
|
1451
|
-
*/
|
|
1452
|
-
setCenter(coordinate: object, animated?: boolean): void;
|
|
1453
|
-
/**
|
|
1454
|
-
* Padding is used by {@link Map#fitCoordinates}.
|
|
1455
|
-
* Padding can either be constant values or funtions that return a padding value.
|
|
1456
|
-
* Constant values are good if the map should always have the same padding on every breakpoint.
|
|
1457
|
-
* Functions are useful if the map should have different padding at different breakpoints/layouts.
|
|
1458
|
-
* The function can check window.innerWidth or any other condition before returning a number.
|
|
1459
|
-
* @param padding - padding.bottom: Minimum number of pixels between the map's bottom edge and a pin
|
|
1460
|
-
* padding.left: Minimum number of pixels between the map's left edge and a pin
|
|
1461
|
-
* padding.right: Minimum number of pixels between the map's right edge and a pin
|
|
1462
|
-
* padding.top: Minimum number of pixels between the map's top edge and a pin
|
|
1463
|
-
*/
|
|
1464
|
-
setPadding({ bottom, left, right, top, }: {
|
|
1465
|
-
bottom?: number | PaddingFunction;
|
|
1466
|
-
left?: number | PaddingFunction;
|
|
1467
|
-
right?: number | PaddingFunction;
|
|
1468
|
-
top?: number | PaddingFunction;
|
|
1469
|
-
}): Map$1;
|
|
1470
|
-
setPanHandler(panHandler: PanHandler): void;
|
|
1471
|
-
setPanStartHandler(panStartHandler: PanStartHandler): void;
|
|
1472
|
-
/**
|
|
1473
|
-
* @param animated - Whether to transition smoothly to the new zoom
|
|
1474
|
-
* @see Map#getZoom
|
|
1475
|
-
*/
|
|
1476
|
-
setZoom(zoom: number, animated?: boolean): void;
|
|
1477
|
-
/**
|
|
1478
|
-
* @param center - Must be convertible to {@link Coordinate}
|
|
1479
|
-
* @param animated - Whether to transition smoothly to the new bounds
|
|
1480
|
-
* @see Map#setZoom
|
|
1481
|
-
* @see Map#setCenter
|
|
1482
|
-
*/
|
|
1483
|
-
setZoomCenter(zoom: number, center: Coordinate$1, animated?: boolean): void;
|
|
1484
|
-
/**
|
|
1485
|
-
* Set the map state to idle
|
|
1486
|
-
*/
|
|
1487
|
-
_setIdle(): void;
|
|
1488
|
-
/**
|
|
1489
|
-
* Set the map state to moving
|
|
1490
|
-
*/
|
|
1491
|
-
_setMoving(): void;
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
interface Coordinate {
|
|
1495
|
-
latitude: number;
|
|
1496
|
-
longitude: number;
|
|
1497
|
-
}
|
|
1498
|
-
interface MapContextType {
|
|
1499
|
-
map: Map$1;
|
|
1500
|
-
provider: MapProvider;
|
|
1501
|
-
}
|
|
1502
|
-
interface MapProps {
|
|
1503
|
-
apiKey?: string;
|
|
1504
|
-
bounds?: Coordinate[];
|
|
1505
|
-
className?: string;
|
|
1506
|
-
clientKey?: string;
|
|
1507
|
-
children?: any;
|
|
1508
|
-
controls?: boolean;
|
|
1509
|
-
defaultCenter?: Coordinate;
|
|
1510
|
-
defaultZoom?: number;
|
|
1511
|
-
mapRef?: React__default.MutableRefObject<Map$1 | null>;
|
|
1512
|
-
padding?: {
|
|
1513
|
-
bottom: number | PaddingFunction;
|
|
1514
|
-
left: number | PaddingFunction;
|
|
1515
|
-
right: number | PaddingFunction;
|
|
1516
|
-
top: number | PaddingFunction;
|
|
1517
|
-
};
|
|
1518
|
-
panHandler?: PanHandler;
|
|
1519
|
-
panStartHandler?: PanStartHandler;
|
|
1520
|
-
provider?: MapProvider;
|
|
1521
|
-
providerOptions?: {
|
|
1522
|
-
[key: string]: any;
|
|
1523
|
-
};
|
|
1524
|
-
singleZoom?: number;
|
|
1525
|
-
iframeId?: string;
|
|
1526
|
-
}
|
|
1527
|
-
interface MarkerProps {
|
|
1528
|
-
children?: React__default.ReactElement;
|
|
1529
|
-
coordinate: Coordinate;
|
|
1530
|
-
hideOffscreen?: boolean;
|
|
1531
|
-
icon?: React__default.ReactElement;
|
|
1532
|
-
id: string;
|
|
1533
|
-
onClick?: (id: string) => void;
|
|
1534
|
-
onHover?: (hovered: boolean, id: string) => void;
|
|
1535
|
-
onFocus?: (focused: boolean, id: string) => void;
|
|
1536
|
-
statusOptions?: {
|
|
1537
|
-
[key: string]: boolean;
|
|
1538
|
-
};
|
|
1539
|
-
zIndex?: number;
|
|
1540
|
-
hasPinUrl?: boolean;
|
|
1541
|
-
}
|
|
1542
|
-
type ClusterTemplateProps = {
|
|
1543
|
-
count?: number;
|
|
1544
|
-
};
|
|
1545
|
-
type ClustererProps = {
|
|
1546
|
-
clusterRadius?: number;
|
|
1547
|
-
children: React__default.ReactElement[] | React__default.ReactElement;
|
|
1548
|
-
ClusterTemplate?: (props: ClusterTemplateProps) => React__default.ReactElement;
|
|
1549
|
-
};
|
|
1550
|
-
type PinStoreType = {
|
|
1551
|
-
id: string;
|
|
1552
|
-
pin: MapPin;
|
|
1553
|
-
};
|
|
1554
|
-
interface ClustererContextType {
|
|
1555
|
-
clusters: PinStoreType[][];
|
|
1556
|
-
clusterIds: string[];
|
|
1557
|
-
setPinStore: React__default.Dispatch<React__default.SetStateAction<PinStoreType[]>>;
|
|
1558
|
-
}
|
|
1559
|
-
|
|
1560
|
-
declare function useMapContext(): Map$1;
|
|
1561
|
-
declare const Map: ({ apiKey, bounds, children, className, clientKey, controls, defaultCenter, defaultZoom, mapRef, padding, panHandler, panStartHandler, provider, providerOptions, singleZoom, iframeId, }: MapProps) => react_jsx_runtime.JSX.Element;
|
|
1562
|
-
|
|
1563
|
-
declare const Marker: ({ children, coordinate, hideOffscreen, id, icon, onClick, onFocus, onHover, zIndex, hasPinUrl, }: MarkerProps) => React__default.ReactElement | null;
|
|
1564
|
-
|
|
1565
|
-
declare function useClusterContext(): ClustererContextType;
|
|
1566
|
-
declare const Clusterer: ({ clusterRadius, children, ClusterTemplate, }: ClustererProps) => react_jsx_runtime.JSX.Element;
|
|
1567
|
-
|
|
1568
|
-
interface LocationMapProps extends MapProps {
|
|
1569
|
-
children?: React.ReactElement;
|
|
1570
|
-
coordinate: Coordinate;
|
|
1571
|
-
linkSameTab?: boolean;
|
|
1572
|
-
pinUrl?: string;
|
|
1573
|
-
onClick?: (id: string) => void;
|
|
1574
|
-
onHover?: (hovered: boolean, id: string) => void;
|
|
1575
|
-
onFocus?: (focused: boolean, id: string) => void;
|
|
1576
|
-
}
|
|
1577
|
-
|
|
1578
|
-
declare const LocationMap: ({ children, coordinate, linkSameTab, pinUrl, onClick, onHover, onFocus, ...mapProps }: LocationMapProps) => react_jsx_runtime.JSX.Element;
|
|
1579
|
-
|
|
1580
|
-
/**
|
|
1581
|
-
* The shape of data passed to {@link LexicalRichText}.
|
|
1582
|
-
*/
|
|
1583
|
-
interface LexicalRichTextProps {
|
|
1584
|
-
/** A JSON-serialized Lexical Dev AST. */
|
|
1585
|
-
serializedAST: string;
|
|
1586
|
-
/** CSS Class names for the various Lexical Node types. */
|
|
1587
|
-
nodeClassNames?: EditorThemeClasses;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
/**
|
|
1591
|
-
* @deprecated Use the stream's .html version instead with `dangerouslySetInnerHTML`.
|
|
1592
|
-
* ```jsx
|
|
1593
|
-
* <div dangerouslySetInnerHTML={{ __html: c_lrt.html }} />
|
|
1594
|
-
* ```
|
|
1595
|
-
*
|
|
1596
|
-
* Renders a read-only view of a Lexical Rich Text field. Styling for the various
|
|
1597
|
-
* types of Rich Text element can be optionally provided. If not provided, Yext default
|
|
1598
|
-
* styling will be applied.
|
|
1599
|
-
*
|
|
1600
|
-
* Note: This component currently only supports rendering on the client side.
|
|
1601
|
-
*/
|
|
1602
|
-
declare function LexicalRichText({ serializedAST, nodeClassNames, }: LexicalRichTextProps): react_jsx_runtime.JSX.Element;
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* A Component for rendering the legacy rich text field. This field's value
|
|
1606
|
-
* is stored as "Yext" Markdown.
|
|
1607
|
-
*/
|
|
1608
|
-
declare const LegacyRichText: (props: {
|
|
1609
|
-
markdown: string;
|
|
1610
|
-
}) => ReactElement<any, string | React$1.JSXElementConstructor<any>> | null;
|
|
1611
|
-
|
|
1612
|
-
declare class HoursInterval {
|
|
1613
|
-
end: DateTime;
|
|
1614
|
-
start: DateTime;
|
|
1615
|
-
/**
|
|
1616
|
-
* @param date - DateTime the DateTime for the day on which the interval starts
|
|
1617
|
-
* @param interval - the Yext Streams interval data
|
|
1618
|
-
*/
|
|
1619
|
-
constructor(date: DateTime, interval: IntervalType, zone: string);
|
|
1620
|
-
/**
|
|
1621
|
-
* @param date - A moment in time
|
|
1622
|
-
* @returns boolean - True if the given moment is within the interval
|
|
1623
|
-
*/
|
|
1624
|
-
contains(date: DateTime): boolean;
|
|
1625
|
-
/**
|
|
1626
|
-
* @param opts - intl.DateTimeFormatOptions
|
|
1627
|
-
* @param locale - defaults to 'en-US'
|
|
1628
|
-
* @returns string - representation of this interval's start time
|
|
1629
|
-
*/
|
|
1630
|
-
getStartTime(locale?: string, opts?: Intl.DateTimeFormatOptions): string;
|
|
1631
|
-
/**
|
|
1632
|
-
* @param opts - intl.DateTimeFormatOptions
|
|
1633
|
-
* @param locale - defaults to 'en-US'
|
|
1634
|
-
* @returns string representation of this interval's end time
|
|
1635
|
-
*/
|
|
1636
|
-
getEndTime(locale?: string, opts?: Intl.DateTimeFormatOptions): string;
|
|
1637
|
-
/**
|
|
1638
|
-
* @returns boolean if this interval and 'other' have the same start/end
|
|
1639
|
-
*/
|
|
1640
|
-
timeIsEqualTo(other: HoursInterval): boolean;
|
|
1641
|
-
/**
|
|
1642
|
-
* @returns boolean if this interval is 24 hours
|
|
1643
|
-
*/
|
|
1644
|
-
is24h(): boolean;
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
interface WeekType {
|
|
1648
|
-
monday?: DayType;
|
|
1649
|
-
tuesday?: DayType;
|
|
1650
|
-
wednesday?: DayType;
|
|
1651
|
-
thursday?: DayType;
|
|
1652
|
-
friday?: DayType;
|
|
1653
|
-
saturday?: DayType;
|
|
1654
|
-
sunday?: DayType;
|
|
1655
|
-
}
|
|
1656
|
-
interface DayType {
|
|
1657
|
-
isClosed?: boolean;
|
|
1658
|
-
openIntervals?: IntervalType[];
|
|
1659
|
-
}
|
|
1660
|
-
interface HolidayType extends DayType {
|
|
1661
|
-
date: string;
|
|
1662
|
-
isRegularHours?: boolean;
|
|
1663
|
-
}
|
|
1664
|
-
interface IntervalType {
|
|
1665
|
-
start: string;
|
|
1666
|
-
end: string;
|
|
1667
|
-
}
|
|
1668
|
-
interface HoursType extends WeekType {
|
|
1669
|
-
holidayHours?: HolidayType[];
|
|
1670
|
-
reopenDate?: string;
|
|
1671
|
-
}
|
|
1672
|
-
type DayOfWeekNames = {
|
|
1673
|
-
[Property in keyof WeekType]?: string;
|
|
1674
|
-
};
|
|
1675
|
-
interface HoursTableProps {
|
|
1676
|
-
/** Hours data from Yext Streams */
|
|
1677
|
-
hours: HoursType;
|
|
1678
|
-
/** Label for each day of week, ordered starting from Sunday */
|
|
1679
|
-
dayOfWeekNames?: DayOfWeekNames;
|
|
1680
|
-
/** Set the day of the first row of the table */
|
|
1681
|
-
startOfWeek?: keyof DayOfWeekNames | "today";
|
|
1682
|
-
timeOptions?: Intl.DateTimeFormatOptions;
|
|
1683
|
-
/** Combine adjacent rows (days) with the same intervals */
|
|
1684
|
-
collapseDays?: boolean;
|
|
1685
|
-
/** Override rendering for the interval on each table row */
|
|
1686
|
-
intervalStringsBuilderFn?: (h: HoursTableDayData, t?: Intl.DateTimeFormatOptions) => string[];
|
|
1687
|
-
/** Override values for hardcoded strings */
|
|
1688
|
-
intervalTranslations?: HoursTableIntervalTranslations;
|
|
1689
|
-
className?: string;
|
|
1690
|
-
}
|
|
1691
|
-
interface HoursTableIntervalTranslations {
|
|
1692
|
-
/** Displayed when an interval is marked as closed */
|
|
1693
|
-
isClosed?: string;
|
|
1694
|
-
/** Displayed when an interval is marked as open 24 hours */
|
|
1695
|
-
open24Hours?: string;
|
|
1696
|
-
/** Displayed when there is a reopen date set */
|
|
1697
|
-
reopenDate?: string;
|
|
1698
|
-
/** Sets the locale for time interval formatting */
|
|
1699
|
-
timeFormatLocale?: string;
|
|
1700
|
-
}
|
|
1701
|
-
interface HoursTableDayData {
|
|
1702
|
-
dayName: string;
|
|
1703
|
-
intervals: HoursInterval[];
|
|
1704
|
-
isToday: boolean;
|
|
1705
|
-
startDay: Day;
|
|
1706
|
-
endDay: Day;
|
|
1707
|
-
}
|
|
1708
|
-
declare enum Day {
|
|
1709
|
-
Monday = "MONDAY",
|
|
1710
|
-
Tuesday = "TUESDAY",
|
|
1711
|
-
Wednesday = "WEDNESDAY",
|
|
1712
|
-
Thursday = "THURSDAY",
|
|
1713
|
-
Friday = "FRIDAY",
|
|
1714
|
-
Saturday = "SATURDAY",
|
|
1715
|
-
Sunday = "SUNDAY"
|
|
1716
|
-
}
|
|
1717
|
-
interface StatusParams {
|
|
1718
|
-
/** Whether the entity is currently open */
|
|
1719
|
-
isOpen: boolean;
|
|
1720
|
-
/** The first interval that contains the current time */
|
|
1721
|
-
currentInterval: HoursInterval | null;
|
|
1722
|
-
/** The next interval that hasn't started */
|
|
1723
|
-
futureInterval: HoursInterval | null;
|
|
1724
|
-
/** Formatting intended for the "time" part of this component "Open Now - closes at [[5:00PM]] Monday" */
|
|
1725
|
-
timeOptions?: Intl.DateTimeFormatOptions;
|
|
1726
|
-
/** Formatting intended for the "day" part of this component "Open Now - closes at 5:00PM [[Monday]]" */
|
|
1727
|
-
dayOptions?: Intl.DateTimeFormatOptions;
|
|
1728
|
-
}
|
|
1729
|
-
interface TemplateParams {
|
|
1730
|
-
/** Override rendering for the "current" part of this component "[[Open Now]] - closes at 5:00PM Monday" */
|
|
1731
|
-
currentTemplate?: (s: StatusParams) => React.ReactNode;
|
|
1732
|
-
/** Override rendering for the "separator" part of this component "Open Now [[-]] closes at 5:00PM Monday" */
|
|
1733
|
-
separatorTemplate?: (s: StatusParams) => React.ReactNode;
|
|
1734
|
-
/** FutureTemplate override rendering for the "future" part of this component "Open Now - [[closes at]] 5:00PM Monday" */
|
|
1735
|
-
futureTemplate?: (s: StatusParams) => React.ReactNode;
|
|
1736
|
-
/** Override rendering for the "time" part of this component "Open Now - closes at [[5:00PM]] Monday" */
|
|
1737
|
-
timeTemplate?: (s: StatusParams) => React.ReactNode;
|
|
1738
|
-
/** Override rendering for the "dayOfWeek" part of this component "Open Now - closes at 5:00PM [[Monday]]" */
|
|
1739
|
-
dayOfWeekTemplate?: (s: StatusParams) => React.ReactNode;
|
|
1740
|
-
}
|
|
1741
|
-
interface StatusTemplateParams extends StatusParams, TemplateParams {
|
|
1742
|
-
}
|
|
1743
|
-
interface HoursStatusProps extends TemplateParams {
|
|
1744
|
-
/** Hours data from Yext Streams */
|
|
1745
|
-
hours: HoursType;
|
|
1746
|
-
/** The IANA or UTC Offset timezone of the hours data from Yext Streams */
|
|
1747
|
-
timezone: string;
|
|
1748
|
-
/** Formatting for the "time" part of this component "Open Now - closes at [[5:00PM]] Monday" */
|
|
1749
|
-
timeOptions?: Intl.DateTimeFormatOptions;
|
|
1750
|
-
/** Formatting for the "day" part of this component "Open Now - closes at 5:00PM [[Monday]]" */
|
|
1751
|
-
dayOptions?: Intl.DateTimeFormatOptions;
|
|
1752
|
-
/** Completely override rendering for this component */
|
|
1753
|
-
statusTemplate?: (s: StatusParams) => React.ReactNode;
|
|
1754
|
-
className?: string;
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
declare const HoursStatus: React__default.FC<HoursStatusProps>;
|
|
1758
|
-
|
|
1759
|
-
declare const HoursTable: React__default.FC<HoursTableProps>;
|
|
1760
|
-
|
|
1761
|
-
declare const SchemaWrapper: (json: any) => string;
|
|
1762
|
-
|
|
1763
|
-
declare const BaseSchema: (document: Record<string, any>, schemaType: string) => {
|
|
1764
|
-
"@context": string;
|
|
1765
|
-
"@type": string;
|
|
1766
|
-
name: string;
|
|
1767
|
-
} | undefined;
|
|
1768
|
-
|
|
1769
|
-
declare const Event: (document: Record<string, any>, schemaType?: string) => any;
|
|
1770
|
-
|
|
1771
|
-
declare const LocalBusiness: (document: Record<string, any>, schemaType?: string) => {
|
|
1772
|
-
description: any;
|
|
1773
|
-
telephone: any;
|
|
1774
|
-
email: any;
|
|
1775
|
-
image?: undefined;
|
|
1776
|
-
openingHours?: undefined;
|
|
1777
|
-
address?: {
|
|
1778
|
-
"@type": string;
|
|
1779
|
-
streetAddress: string;
|
|
1780
|
-
addressLocality: string;
|
|
1781
|
-
addressRegion: string | undefined;
|
|
1782
|
-
postalCode: string;
|
|
1783
|
-
addressCountry: string;
|
|
1784
|
-
} | undefined;
|
|
1785
|
-
"@context"?: string | undefined;
|
|
1786
|
-
"@type"?: string | undefined;
|
|
1787
|
-
name?: string | undefined;
|
|
1788
|
-
} | {
|
|
1789
|
-
description: any;
|
|
1790
|
-
telephone: any;
|
|
1791
|
-
email: any;
|
|
1792
|
-
image: string[];
|
|
1793
|
-
openingHours?: undefined;
|
|
1794
|
-
address?: {
|
|
1795
|
-
"@type": string;
|
|
1796
|
-
streetAddress: string;
|
|
1797
|
-
addressLocality: string;
|
|
1798
|
-
addressRegion: string | undefined;
|
|
1799
|
-
postalCode: string;
|
|
1800
|
-
addressCountry: string;
|
|
1801
|
-
} | undefined;
|
|
1802
|
-
"@context"?: string | undefined;
|
|
1803
|
-
"@type"?: string | undefined;
|
|
1804
|
-
name?: string | undefined;
|
|
1805
|
-
} | {
|
|
1806
|
-
description: any;
|
|
1807
|
-
telephone: any;
|
|
1808
|
-
email: any;
|
|
1809
|
-
image?: undefined;
|
|
1810
|
-
openingHours: string[];
|
|
1811
|
-
address?: {
|
|
1812
|
-
"@type": string;
|
|
1813
|
-
streetAddress: string;
|
|
1814
|
-
addressLocality: string;
|
|
1815
|
-
addressRegion: string | undefined;
|
|
1816
|
-
postalCode: string;
|
|
1817
|
-
addressCountry: string;
|
|
1818
|
-
} | undefined;
|
|
1819
|
-
"@context"?: string | undefined;
|
|
1820
|
-
"@type"?: string | undefined;
|
|
1821
|
-
name?: string | undefined;
|
|
1822
|
-
} | {
|
|
1823
|
-
description: any;
|
|
1824
|
-
telephone: any;
|
|
1825
|
-
email: any;
|
|
1826
|
-
image: string[];
|
|
1827
|
-
openingHours: string[];
|
|
1828
|
-
address?: {
|
|
1829
|
-
"@type": string;
|
|
1830
|
-
streetAddress: string;
|
|
1831
|
-
addressLocality: string;
|
|
1832
|
-
addressRegion: string | undefined;
|
|
1833
|
-
postalCode: string;
|
|
1834
|
-
addressCountry: string;
|
|
1835
|
-
} | undefined;
|
|
1836
|
-
"@context"?: string | undefined;
|
|
1837
|
-
"@type"?: string | undefined;
|
|
1838
|
-
name?: string | undefined;
|
|
1839
|
-
};
|
|
1840
|
-
|
|
1841
|
-
declare const Product: (document: Record<string, any>, schemaType?: string) => any;
|
|
1842
|
-
|
|
1843
|
-
type RTF2 = {
|
|
1844
|
-
json?: Record<string, any>;
|
|
1845
|
-
};
|
|
1846
|
-
type FAQ = PlainTextFAQ | RichTextFAQ;
|
|
1847
|
-
type PlainTextFAQ = {
|
|
1848
|
-
question: string;
|
|
1849
|
-
answer: string;
|
|
1850
|
-
};
|
|
1851
|
-
type RichTextFAQ = {
|
|
1852
|
-
question: string;
|
|
1853
|
-
answerV2: RTF2;
|
|
1854
|
-
};
|
|
1855
|
-
declare function getRichTextContent(answer: RTF2): string;
|
|
1856
|
-
declare const FAQPage: (data: FAQ[]) => {
|
|
1857
|
-
"@context": string;
|
|
1858
|
-
"@type": string;
|
|
1859
|
-
mainEntity: ({
|
|
1860
|
-
"@type": string;
|
|
1861
|
-
name: string;
|
|
1862
|
-
acceptedAnswer: {
|
|
1863
|
-
"@type": string;
|
|
1864
|
-
text: string;
|
|
1865
|
-
};
|
|
1866
|
-
} | undefined)[];
|
|
1867
|
-
} | undefined;
|
|
1868
|
-
|
|
1869
|
-
type Location = {
|
|
1870
|
-
name?: string;
|
|
1871
|
-
address?: AddressType;
|
|
1872
|
-
};
|
|
1873
|
-
declare const AddressSchema: (address?: AddressType) => false | {
|
|
1874
|
-
address: {
|
|
1875
|
-
"@type": string;
|
|
1876
|
-
streetAddress: string;
|
|
1877
|
-
addressLocality: string;
|
|
1878
|
-
addressRegion: string | undefined;
|
|
1879
|
-
postalCode: string;
|
|
1880
|
-
addressCountry: string;
|
|
1881
|
-
};
|
|
1882
|
-
};
|
|
1883
|
-
declare const LocationSchema: (location?: Location) => false | {
|
|
1884
|
-
address?: {
|
|
1885
|
-
"@type": string;
|
|
1886
|
-
streetAddress: string;
|
|
1887
|
-
addressLocality: string;
|
|
1888
|
-
addressRegion: string | undefined;
|
|
1889
|
-
postalCode: string;
|
|
1890
|
-
addressCountry: string;
|
|
1891
|
-
} | undefined;
|
|
1892
|
-
"@type": string;
|
|
1893
|
-
name: string | undefined;
|
|
1894
|
-
};
|
|
1895
|
-
|
|
1896
|
-
type OpeningHoursSpecification = {
|
|
1897
|
-
"@type": "OpeningHoursSpecification";
|
|
1898
|
-
dayOfWeek?: string | string[];
|
|
1899
|
-
opens?: string;
|
|
1900
|
-
closes?: string;
|
|
1901
|
-
validFrom?: string;
|
|
1902
|
-
validThrough?: string;
|
|
1903
|
-
};
|
|
1904
|
-
declare const OpeningHoursSchema: (hours?: HoursType) => {
|
|
1905
|
-
openingHours?: undefined;
|
|
1906
|
-
} | {
|
|
1907
|
-
openingHours: string[];
|
|
1908
|
-
};
|
|
1909
|
-
declare const OpeningHoursSpecificationSchema: (hours?: HoursType) => {
|
|
1910
|
-
openingHoursSpecification?: OpeningHoursSpecification[];
|
|
1911
|
-
specialOpeningHoursSpecification?: OpeningHoursSpecification[];
|
|
1912
|
-
};
|
|
1913
|
-
|
|
1914
|
-
type Offer = {
|
|
1915
|
-
url?: string;
|
|
1916
|
-
priceCurrency?: string;
|
|
1917
|
-
price?: string;
|
|
1918
|
-
priceValidUntil?: string;
|
|
1919
|
-
itemCondition?: string;
|
|
1920
|
-
availability?: (typeof availabilityOptions)[number];
|
|
1921
|
-
};
|
|
1922
|
-
declare const availabilityOptions: string[];
|
|
1923
|
-
declare const OfferSchema: (offer?: Offer) => false | {
|
|
1924
|
-
offers: {
|
|
1925
|
-
"@type": string;
|
|
1926
|
-
url: string | undefined;
|
|
1927
|
-
priceCurrency: string | undefined;
|
|
1928
|
-
price: string | undefined;
|
|
1929
|
-
priceValidUntil: string | undefined;
|
|
1930
|
-
itemCondition: string | undefined;
|
|
1931
|
-
availability: string | undefined;
|
|
1932
|
-
};
|
|
1933
|
-
};
|
|
1934
|
-
|
|
1935
|
-
type Organization = {
|
|
1936
|
-
name?: string;
|
|
1937
|
-
url?: string;
|
|
1938
|
-
};
|
|
1939
|
-
declare const PerformerSchema: (performers?: string[]) => false | {
|
|
1940
|
-
performer: {
|
|
1941
|
-
"@type": string;
|
|
1942
|
-
name: string;
|
|
1943
|
-
};
|
|
1944
|
-
};
|
|
1945
|
-
declare const OrganizationSchema: (org?: Organization) => false | {
|
|
1946
|
-
organizer: {
|
|
1947
|
-
url?: string | undefined;
|
|
1948
|
-
"@type": string;
|
|
1949
|
-
name: string | undefined;
|
|
1950
|
-
};
|
|
1951
|
-
};
|
|
1952
|
-
|
|
1953
|
-
type PhotoGallery = Photo[];
|
|
1954
|
-
type Photo = {
|
|
1955
|
-
image: ImageType;
|
|
1956
|
-
};
|
|
1957
|
-
declare const PhotoGallerySchema: (gallery?: PhotoGallery) => {
|
|
1958
|
-
image?: undefined;
|
|
1959
|
-
} | {
|
|
1960
|
-
image: string[];
|
|
1961
|
-
};
|
|
1962
|
-
declare const PhotoSchema: (photo?: Photo) => false | {
|
|
1963
|
-
image: string;
|
|
1964
|
-
};
|
|
1965
|
-
|
|
1966
|
-
type Review = {
|
|
1967
|
-
ratingValue?: string;
|
|
1968
|
-
bestRating?: string;
|
|
1969
|
-
author?: string;
|
|
1970
|
-
};
|
|
1971
|
-
type AggregateRating = {
|
|
1972
|
-
ratingValue?: string;
|
|
1973
|
-
reviewCount?: string;
|
|
1974
|
-
};
|
|
1975
|
-
declare const ReviewSchema: (review?: Review) => false | {
|
|
1976
|
-
review: {
|
|
1977
|
-
author?: {
|
|
1978
|
-
"@type": string;
|
|
1979
|
-
name: string;
|
|
1980
|
-
} | undefined;
|
|
1981
|
-
"@type": string;
|
|
1982
|
-
reviewRating: {
|
|
1983
|
-
"@type": string;
|
|
1984
|
-
ratingValue: string | undefined;
|
|
1985
|
-
bestRating: string | undefined;
|
|
1986
|
-
};
|
|
1987
|
-
};
|
|
1988
|
-
};
|
|
1989
|
-
declare const AggregateRatingSchema: (rating?: AggregateRating) => {
|
|
1990
|
-
aggregateRating: {
|
|
1991
|
-
"@type": string;
|
|
1992
|
-
ratingValue: string | undefined;
|
|
1993
|
-
reviewCount: string | undefined;
|
|
1994
|
-
};
|
|
1995
|
-
} | undefined;
|
|
1996
|
-
|
|
1997
|
-
declare const BaiduMaps: MapProvider;
|
|
1998
|
-
|
|
1999
|
-
declare const BingMaps: MapProvider;
|
|
2000
|
-
|
|
2001
|
-
declare const GoogleMaps: MapProvider;
|
|
2002
|
-
|
|
2003
|
-
declare const MapboxMaps: MapProvider;
|
|
2004
|
-
|
|
2005
|
-
declare const LeafletMaps: MapProvider;
|
|
2006
|
-
|
|
2007
|
-
declare const MapQuestMaps: MapProvider;
|
|
2008
|
-
|
|
2009
|
-
export { Address, type AddressLine, type AddressLineProps, type AddressProps, AddressSchema, type AddressType, type AggregateRating, AggregateRatingSchema, Analytics, AnalyticsContext, AnalyticsProvider, AnalyticsScopeProvider, BaiduMaps, BaseSchema, 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, Event, FAQPage, type GetDirectionsConfig, GoogleMaps, type HREFLinkProps, type HolidayType, HoursStatus, type HoursStatusProps, HoursTable, type HoursTableDayData, type HoursTableIntervalTranslations, type HoursTableProps, type HoursType, Image, type ImageLayout, ImageLayoutOption, type ImageProps, type ImageTransformations, type ImageType, type IntervalType, LeafletMaps, LegacyRichText, LexicalRichText, type LexicalRichTextProps, Link, type LinkProps, type LinkType, type ListingPublisher, ListingPublisherOption, type ListingType, LocalBusiness, type Location, LocationMap, type LocationMapProps, LocationSchema, Map, type MapContextType, type MapProps, type MapProvider$1 as MapProvider, MapProviderOption, MapQuestMaps, MapboxMaps, Marker, type MarkerProps, type Offer, OfferSchema, OpeningHoursSchema, OpeningHoursSpecificationSchema, type Organization, OrganizationSchema, PerformerSchema, type PhotoGallery, PhotoGallerySchema, PhotoSchema, type PinStoreType, Product, type Review, ReviewSchema, SchemaWrapper, type StatusParams, type StatusTemplateParams, type TemplateParams, type ThumbnailType, type WeekType, debuggingParamDetected, getDirections, getImageUrl, getRichTextContent, useAnalytics, useClusterContext, useIdentify, useMapContext, usePageView, useScope, useTrack };
|