@getmicdrop/venue-calendar 4.3.60 → 4.3.62
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/README.md +818 -818
- package/dist/{AddOnCard-BzTz2vbx.js → AddOnCard-DAk2utke.js} +2 -2
- package/dist/{CalendarFoundryView-CU34kx17.js → CalendarFoundryView-uG2d_J_1.js} +3246 -3539
- package/dist/{CartView-BU-h3sJN.js → CartView-C3yY3Umt.js} +3 -3
- package/dist/{Checkout-DYCcC-0N.js → Checkout-CtNDr22Y.js} +7 -6
- package/dist/Checkout-D5xQo_-j.js +1974 -0
- package/dist/{CheckoutTimer-BuYZ9k4Q.js → CheckoutTimer-Btjo7PEg.js} +1 -1
- package/dist/{CloseIcon-DtlW0vQT.js → CloseIcon-DKrZf_7a.js} +2 -2
- package/dist/{CollectionView-CXMxxdWQ.js → CollectionView-cwWo1mF3.js} +3 -3
- package/dist/{Event-Cqx8TF2r.js → Event-DTJ0vZr1.js} +5 -5
- package/dist/{EventPage-BptjljMB.js → EventPage-CnOqHn95.js} +3 -3
- package/dist/{Input-C-GyzK2y.js → Input-CLSPTEMv.js} +4 -4
- package/dist/{PasswordInput-BGVvl0X1.js → PasswordInput-BxuPPAe8.js} +1 -1
- package/dist/{RecommendationsRail-Bd_HV1Ou.js → RecommendationsRail-D9S_5rVW.js} +1 -1
- package/dist/Select-CjELEaSF.js +376 -0
- package/dist/{SeriesPage-cRi8ifRa.js → SeriesPage-BTo2IP4b.js} +2 -2
- package/dist/{Success-CjjUwjXy.js → Success-3ivVwkoj.js} +3 -3
- package/dist/api/transformers/venue.d.ts +26 -0
- package/dist/{constants-DWS8C09a.js → constants-CBPzJAKF.js} +2 -0
- package/dist/{de-BEfuIgIj.js → de-B7O-dJsW.js} +2 -0
- package/dist/{es-Bd4g_HxR.js → es-CAjDq_xB.js} +2 -0
- package/dist/{fr-Blc79wvV.js → fr-CcNvBKpw.js} +2 -0
- package/dist/{i18n-CfXVv1y8.js → i18n-DLFy3vxe.js} +14 -14
- package/dist/{id-DzzsiF4d.js → id-CSzRaEmh.js} +2 -0
- package/dist/{it-B4zXRsxu.js → it-C1y4ckE2.js} +2 -0
- package/dist/{ja-eT4_QPKd.js → ja-BkffKruj.js} +2 -0
- package/dist/{ko-B8Fmrldj.js → ko-rUezp1-T.js} +2 -0
- package/dist/locales/4.3.62/flow/de.js +1 -0
- package/dist/locales/4.3.62/flow/es.js +1 -0
- package/dist/locales/4.3.62/flow/fr.js +1 -0
- package/dist/locales/4.3.62/flow/id.js +1 -0
- package/dist/locales/4.3.62/flow/it.js +1 -0
- package/dist/locales/4.3.62/flow/ja.js +1 -0
- package/dist/locales/4.3.62/flow/ko.js +1 -0
- package/dist/locales/4.3.62/flow/nl.js +1 -0
- package/dist/locales/4.3.62/flow/pl.js +1 -0
- package/dist/locales/4.3.62/flow/pt-br.js +1 -0
- package/dist/locales/4.3.62/flow/tr.js +1 -0
- package/dist/locales/4.3.62/flow/zh.js +1 -0
- package/dist/{nl-Dnug8LYt.js → nl-B92Oj0Kq.js} +2 -0
- package/dist/{pl-C3XxoYWF.js → pl-Q8SsShQJ.js} +2 -0
- package/dist/{pt-br-Y40SBe4b.js → pt-br-HJoQU6-m.js} +2 -0
- package/dist/{tr-2zIJ-vq2.js → tr-Cztm2s2I.js} +2 -0
- package/dist/types/index.d.ts +597 -597
- package/dist/venue-Dv8MYjz_.js +17 -0
- package/dist/venue-calendar.es.js +13 -13
- package/dist/venue-calendar.iife.js +34 -34
- package/dist/venue-calendar.umd.js +51 -51
- package/dist/{zh-vNYvCXO7.js → zh-CInFBbgV.js} +2 -0
- package/package.json +2 -2
- package/src/lib/theme.js +222 -222
- package/dist/Checkbox-BtJwg_CF.js +0 -61
- package/dist/Checkout-CpbaR-uS.js +0 -1933
- package/dist/locales/4.3.60/flow/de.js +0 -1
- package/dist/locales/4.3.60/flow/es.js +0 -1
- package/dist/locales/4.3.60/flow/fr.js +0 -1
- package/dist/locales/4.3.60/flow/id.js +0 -1
- package/dist/locales/4.3.60/flow/it.js +0 -1
- package/dist/locales/4.3.60/flow/ja.js +0 -1
- package/dist/locales/4.3.60/flow/ko.js +0 -1
- package/dist/locales/4.3.60/flow/nl.js +0 -1
- package/dist/locales/4.3.60/flow/pl.js +0 -1
- package/dist/locales/4.3.60/flow/pt-br.js +0 -1
- package/dist/locales/4.3.60/flow/tr.js +0 -1
- package/dist/locales/4.3.60/flow/zh.js +0 -1
- package/dist/venue-BBoZBuhu.js +0 -13
- /package/dist/locales/{4.3.60 → 4.3.62}/main/de.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/es.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/fr.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/id.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/it.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/ja.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/ko.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/nl.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/pl.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/pt-br.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/tr.js +0 -0
- /package/dist/locales/{4.3.60 → 4.3.62}/main/zh.js +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,597 +1,597 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeScript definitions for @getmicdrop/venue-calendar
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// ============================================================================
|
|
6
|
-
// Event Data Types
|
|
7
|
-
// ============================================================================
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Event data structure returned from the API or passed to components
|
|
11
|
-
*/
|
|
12
|
-
export interface EventData {
|
|
13
|
-
id: string | number;
|
|
14
|
-
name: string;
|
|
15
|
-
date: string;
|
|
16
|
-
startDateTime?: string;
|
|
17
|
-
endDateTime?: string;
|
|
18
|
-
image?: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
venueId?: string | number;
|
|
21
|
-
venueID?: string | number;
|
|
22
|
-
timeZone?: string;
|
|
23
|
-
location?: string;
|
|
24
|
-
slug?: string;
|
|
25
|
-
status?: 'on_sale' | 'selling_fast' | 'sold_out';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Ticket data structure
|
|
30
|
-
*/
|
|
31
|
-
export interface TicketData {
|
|
32
|
-
id: string | number;
|
|
33
|
-
name: string;
|
|
34
|
-
price: number;
|
|
35
|
-
quantity?: number;
|
|
36
|
-
description?: string;
|
|
37
|
-
available?: number;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// ============================================================================
|
|
41
|
-
// Theme Types
|
|
42
|
-
// ============================================================================
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Theme color configuration using HSL format
|
|
46
|
-
* All values should be HSL strings like "217 91% 60%"
|
|
47
|
-
*/
|
|
48
|
-
export interface ThemeColors {
|
|
49
|
-
/** Brand primary color */
|
|
50
|
-
brandPrimary: string;
|
|
51
|
-
/** Primary text color */
|
|
52
|
-
textPrimary: string;
|
|
53
|
-
/** Secondary text color */
|
|
54
|
-
textSecondary: string;
|
|
55
|
-
/** Tertiary text color */
|
|
56
|
-
textTertiary: string;
|
|
57
|
-
/** Primary background color */
|
|
58
|
-
bgPrimary: string;
|
|
59
|
-
/** Secondary background color */
|
|
60
|
-
bgSecondary: string;
|
|
61
|
-
/** Quaternary background color */
|
|
62
|
-
bgQuaternary: string;
|
|
63
|
-
/** Primary stroke/border color */
|
|
64
|
-
strokePrimary: string;
|
|
65
|
-
/** Secondary stroke/border color */
|
|
66
|
-
strokeSecondary: string;
|
|
67
|
-
/** On sale status color */
|
|
68
|
-
statusOnSale: string;
|
|
69
|
-
/** Selling fast status color */
|
|
70
|
-
statusSellingFast: string;
|
|
71
|
-
/** Sold out status color */
|
|
72
|
-
statusSoldOut: string;
|
|
73
|
-
/** Today's date background color */
|
|
74
|
-
todayBg: string;
|
|
75
|
-
/** Today's date text color */
|
|
76
|
-
todayText: string;
|
|
77
|
-
/** Event dot color for on sale */
|
|
78
|
-
eventDotOnSale: string;
|
|
79
|
-
/** Event dot color for selling fast */
|
|
80
|
-
eventDotSellingFast: string;
|
|
81
|
-
/** Event dot color for sold out */
|
|
82
|
-
eventDotSoldOut: string;
|
|
83
|
-
/** Hover background color */
|
|
84
|
-
hoverBg: string;
|
|
85
|
-
/** Focus ring color */
|
|
86
|
-
focusRing: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Preset themes collection
|
|
91
|
-
*/
|
|
92
|
-
export interface Themes {
|
|
93
|
-
light: ThemeColors;
|
|
94
|
-
dark: ThemeColors;
|
|
95
|
-
highContrast: ThemeColors;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ============================================================================
|
|
99
|
-
// View Option Types
|
|
100
|
-
// ============================================================================
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* View option for the calendar view switcher
|
|
104
|
-
*/
|
|
105
|
-
export interface ViewOption {
|
|
106
|
-
id: number;
|
|
107
|
-
text: string;
|
|
108
|
-
/** @deprecated Not rendered — the view switcher shows `text` only. Kept optional for backward compatibility. */
|
|
109
|
-
icon?: string;
|
|
110
|
-
ariaLabel?: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export type ViewType = 'list' | 'gallery' | 'calendar';
|
|
114
|
-
|
|
115
|
-
// ============================================================================
|
|
116
|
-
// Component Props Interfaces
|
|
117
|
-
// ============================================================================
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Base options for all init functions
|
|
121
|
-
*/
|
|
122
|
-
export interface BaseInitOptions {
|
|
123
|
-
/** CSS selector or HTMLElement to mount the component */
|
|
124
|
-
target: string | HTMLElement;
|
|
125
|
-
/** The venue ID (optional, default: '1') */
|
|
126
|
-
venueId?: string;
|
|
127
|
-
/** The organization ID (optional, default: '1') */
|
|
128
|
-
organizationId?: string;
|
|
129
|
-
/**
|
|
130
|
-
* BCP-47 locale tag (e.g. 'es', 'es-MX'). Selects the bundled locale for the
|
|
131
|
-
* label catalogue; undefined falls back to the browser locale, then English.
|
|
132
|
-
* Threaded through every init entry point (vc#693).
|
|
133
|
-
*/
|
|
134
|
-
locale?: string;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Options for initializing the Venue Calendar component
|
|
139
|
-
*/
|
|
140
|
-
export interface CalendarProps extends BaseInitOptions {
|
|
141
|
-
/** Initial view: 'list', 'gallery', or 'calendar' (default: 'calendar') */
|
|
142
|
-
view?: ViewType;
|
|
143
|
-
/** Array of event objects to display */
|
|
144
|
-
events?: EventData[];
|
|
145
|
-
/** Whether to show view switcher (default: true) */
|
|
146
|
-
showViewOptions?: boolean;
|
|
147
|
-
/** Whether to show month navigation (default: true) */
|
|
148
|
-
showMonthSwitcher?: boolean;
|
|
149
|
-
/** Show the search box even without the view switcher (default: false) */
|
|
150
|
-
showSearch?: boolean;
|
|
151
|
-
/** Gallery/List/Carousel show at most this many events; null = all, with
|
|
152
|
-
* load more on Gallery (default: null) */
|
|
153
|
-
maxItems?: number | null;
|
|
154
|
-
/** Hide card parts; only `false` hides (default: every part shown) */
|
|
155
|
-
eventDetails?: {
|
|
156
|
-
poster?: boolean;
|
|
157
|
-
date?: boolean;
|
|
158
|
-
description?: boolean;
|
|
159
|
-
} | null;
|
|
160
|
-
/** Which show the Featured view spotlights. Falls through to the next
|
|
161
|
-
* upcoming show when the pick is absent or no longer in the feed — a
|
|
162
|
-
* collection pick always falls through, since the event feed carries no
|
|
163
|
-
* collection membership to match on (default: null) */
|
|
164
|
-
featuredItem?: {
|
|
165
|
-
type?: 'event' | 'series' | 'collection';
|
|
166
|
-
id: string | number;
|
|
167
|
-
} | null;
|
|
168
|
-
/** How big each view draws its events: S packs more in, L gives each
|
|
169
|
-
* event more room, M is the default look (default: 'M') */
|
|
170
|
-
size?: 'S' | 'M' | 'L';
|
|
171
|
-
/** Level of the calendar's screen-reader heading: 2 when the host page
|
|
172
|
-
* already carries its h1 (default: 1) */
|
|
173
|
-
headingLevel?: 1 | 2;
|
|
174
|
-
/** How every card draws its poster: 'fit' shows the whole poster, 'fill'
|
|
175
|
-
* crops it to cover the frame (default: 'fit') */
|
|
176
|
-
posterFit?: 'fill' | 'fit';
|
|
177
|
-
/** What fills around a 'fit' poster: a blurred copy of it, or the
|
|
178
|
-
* section's own colour (default: 'blur') */
|
|
179
|
-
posterBackdrop?: 'blur' | 'color';
|
|
180
|
-
/** Opening a show rewrites the host page's title and share tags to the
|
|
181
|
-
* show's, restoring them on close. Both embeds turn it on unless the host
|
|
182
|
-
* sets inject-seo="false" (default for a direct call: false) */
|
|
183
|
-
injectSeo?: boolean;
|
|
184
|
-
/** Current month store (Svelte writable store) */
|
|
185
|
-
currentMonth?: import('svelte/store').Writable<number>;
|
|
186
|
-
/** Current year store (Svelte writable store) */
|
|
187
|
-
currentYear?: import('svelte/store').Writable<number>;
|
|
188
|
-
/** Handler for navigating to next month */
|
|
189
|
-
handleNext?: () => void;
|
|
190
|
-
/** Handler for navigating to previous month */
|
|
191
|
-
handlePrev?: () => void;
|
|
192
|
-
/** Callback function when an event is clicked */
|
|
193
|
-
onEventClick?: (_event: EventData) => void;
|
|
194
|
-
/**
|
|
195
|
-
* Render the show detail / series / collection IN-PLACE on click + deep
|
|
196
|
-
* link instead of navigating the host page (default: true for embeds).
|
|
197
|
-
* Pass false to keep the host responsible for navigation, or supply your
|
|
198
|
-
* own onEventClick to take over click handling entirely.
|
|
199
|
-
*/
|
|
200
|
-
inlineEntityViews?: boolean;
|
|
201
|
-
/**
|
|
202
|
-
* The host's brand scheme, applied on the widget's root so every calendar
|
|
203
|
-
* surface — time buttons included — wears it. null = the default palette.
|
|
204
|
-
*/
|
|
205
|
-
colors?: ColorSchemeColors | null;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Options for initializing the (inline) Event Page.
|
|
210
|
-
*/
|
|
211
|
-
export interface EventPageOptions extends BaseInitOptions {
|
|
212
|
-
/** The event ID to display (the page self-fetches), or pass rawEvent. */
|
|
213
|
-
eventId?: string | number;
|
|
214
|
-
/** Pre-fetched raw event payload (skips the self-fetch). */
|
|
215
|
-
rawEvent?: any;
|
|
216
|
-
/** Event slug (cosmetic). */
|
|
217
|
-
slug?: string;
|
|
218
|
-
/** Callback when the back control is clicked. */
|
|
219
|
-
onNavigateBack?: () => void;
|
|
220
|
-
/** Callback when proceeding to checkout (cart already created). */
|
|
221
|
-
onNavigateToCart?: (
|
|
222
|
-
_id: string | number,
|
|
223
|
-
_slug: string,
|
|
224
|
-
_rawEvent: any
|
|
225
|
-
) => void;
|
|
226
|
-
/** Callback when a series occurrence is clicked. */
|
|
227
|
-
onBuyTickets?: (_eventId: string | number, _slug: string) => void;
|
|
228
|
-
/** i18n label overrides. */
|
|
229
|
-
labels?: Record<string, string>;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Success callback data from checkout
|
|
234
|
-
*/
|
|
235
|
-
export interface CheckoutSuccessData {
|
|
236
|
-
orderId?: string;
|
|
237
|
-
eventId?: string;
|
|
238
|
-
event?: EventData;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Options for initializing the Checkout View
|
|
243
|
-
*/
|
|
244
|
-
export interface CheckoutOptions extends BaseInitOptions {
|
|
245
|
-
/** The event ID to display */
|
|
246
|
-
eventId: string;
|
|
247
|
-
/** The event slug (optional) */
|
|
248
|
-
slug?: string;
|
|
249
|
-
/** Array of available tickets (optional) */
|
|
250
|
-
availableTickets?: TicketData[];
|
|
251
|
-
/** Callback when checkout is successful */
|
|
252
|
-
onSuccess?: (_data: CheckoutSuccessData) => void;
|
|
253
|
-
/** Callback when navigating to success page */
|
|
254
|
-
onNavigateToSuccess?: (_data: CheckoutSuccessData) => void;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Options for initializing the Success View
|
|
259
|
-
*/
|
|
260
|
-
export interface SuccessViewOptions extends BaseInitOptions {
|
|
261
|
-
/** The event ID (optional) */
|
|
262
|
-
eventId?: string;
|
|
263
|
-
/** The event slug (optional) */
|
|
264
|
-
slug?: string;
|
|
265
|
-
/** The order ID (optional) */
|
|
266
|
-
orderId?: string;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Alias for CalendarProps for backward compatibility
|
|
271
|
-
*/
|
|
272
|
-
export type InitOptions = CalendarProps;
|
|
273
|
-
|
|
274
|
-
// ============================================================================
|
|
275
|
-
// Svelte Component Instance
|
|
276
|
-
// ============================================================================
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Svelte component instance returned by init functions
|
|
280
|
-
*/
|
|
281
|
-
export interface SvelteComponentInstance {
|
|
282
|
-
/** Destroy the component and clean up */
|
|
283
|
-
$destroy?: () => void;
|
|
284
|
-
/** Internal cleanup for success listener */
|
|
285
|
-
_successCleanup?: () => void;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// ============================================================================
|
|
289
|
-
// Exported Functions
|
|
290
|
-
// ============================================================================
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Initialize the Venue Calendar component
|
|
294
|
-
* @param options - Configuration options
|
|
295
|
-
* @returns The Svelte component instance, or null if target not found
|
|
296
|
-
*/
|
|
297
|
-
export function initVenueCalendar(
|
|
298
|
-
_options: CalendarProps
|
|
299
|
-
): SvelteComponentInstance | null;
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Initialize the (inline) Event Page.
|
|
303
|
-
* @param options - Configuration options
|
|
304
|
-
* @returns The Svelte component instance, or null if target not found / no event
|
|
305
|
-
*/
|
|
306
|
-
export function initEventPage(
|
|
307
|
-
_options: EventPageOptions
|
|
308
|
-
): SvelteComponentInstance | null;
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Initialize the Checkout View
|
|
312
|
-
* @param options - Configuration options
|
|
313
|
-
* @returns The Svelte component instance, or null if target not found or eventId missing
|
|
314
|
-
*/
|
|
315
|
-
export function initCheckoutView(
|
|
316
|
-
_options: CheckoutOptions
|
|
317
|
-
): SvelteComponentInstance | null;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Alias for initCheckoutView
|
|
321
|
-
*/
|
|
322
|
-
export const initCheckout: typeof initCheckoutView;
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Initialize the Success View
|
|
326
|
-
* @param options - Configuration options
|
|
327
|
-
* @returns The Svelte component instance, or null if target not found
|
|
328
|
-
*/
|
|
329
|
-
export function initSuccessView(
|
|
330
|
-
_options: SuccessViewOptions
|
|
331
|
-
): SvelteComponentInstance | null;
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Alias for initSuccessView
|
|
335
|
-
*/
|
|
336
|
-
export const initSuccess: typeof initSuccessView;
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Auto-mount: Automatically finds and mounts calendar to elements with class 'micdrop-calendar-container'
|
|
340
|
-
*/
|
|
341
|
-
export function autoMount(): void;
|
|
342
|
-
|
|
343
|
-
// ============================================================================
|
|
344
|
-
// Runtime Configuration
|
|
345
|
-
// ============================================================================
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* Opt-in embed integration settings for a venue site embedding the widget.
|
|
349
|
-
*/
|
|
350
|
-
export interface EmbedConfig {
|
|
351
|
-
/**
|
|
352
|
-
* Emit a MICDROP_CHECKOUT_COMPLETE postMessage when an order completes. The
|
|
353
|
-
* payload is non-PII: `{ orderId, eventId }`. Default: false.
|
|
354
|
-
*/
|
|
355
|
-
postMessageOnSuccess?: boolean;
|
|
356
|
-
/**
|
|
357
|
-
* REQUIRED concrete origin (e.g. 'https://venue.example') for the
|
|
358
|
-
* MICDROP_CHECKOUT_COMPLETE message. The message is never posted to '*'; without a
|
|
359
|
-
* concrete absolute origin nothing is sent and a warning is logged.
|
|
360
|
-
*/
|
|
361
|
-
postMessageTargetOrigin?: string | null;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Options for {@link configureVenueCalendar}. All fields are optional — pass
|
|
366
|
-
* only the keys you want to change.
|
|
367
|
-
*/
|
|
368
|
-
export interface ConfigureVenueCalendarOptions {
|
|
369
|
-
/** Called whenever the widget surfaces a caught error (wire into Sentry/Rollbar/etc). */
|
|
370
|
-
onError?: (_error: Error, _context: { source: string }) => void;
|
|
371
|
-
/** Override the backend origin for multi-region setups. */
|
|
372
|
-
apiBaseUrl?: string;
|
|
373
|
-
/** Request timeout in ms, forwarded to the API client. */
|
|
374
|
-
apiTimeout?: number;
|
|
375
|
-
/** Retry count, forwarded to the API client. */
|
|
376
|
-
apiRetries?: number;
|
|
377
|
-
/** Opt-in embed integration settings (see {@link EmbedConfig}). */
|
|
378
|
-
embed?: EmbedConfig;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Configure the calendar widget at runtime: error reporting, API overrides,
|
|
383
|
-
* and the opt-in embed integration (e.g. the MICDROP_CHECKOUT_COMPLETE postMessage).
|
|
384
|
-
* @param options - Configuration options
|
|
385
|
-
*/
|
|
386
|
-
export function configureVenueCalendar(
|
|
387
|
-
_options?: ConfigureVenueCalendarOptions
|
|
388
|
-
): void;
|
|
389
|
-
|
|
390
|
-
// ============================================================================
|
|
391
|
-
// Theme Exports
|
|
392
|
-
// ============================================================================
|
|
393
|
-
|
|
394
|
-
/**
|
|
395
|
-
* Collection of preset themes
|
|
396
|
-
*/
|
|
397
|
-
export const themes: Themes;
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* Light theme preset
|
|
401
|
-
*/
|
|
402
|
-
export const lightTheme: ThemeColors;
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* Dark theme preset
|
|
406
|
-
*/
|
|
407
|
-
export const darkTheme: ThemeColors;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* High contrast theme preset for accessibility
|
|
411
|
-
*/
|
|
412
|
-
export const highContrastTheme: ThemeColors;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Apply a theme to the calendar widget
|
|
416
|
-
* @param theme - Theme object with HSL color values
|
|
417
|
-
* @param container - Optional container element (defaults to document.documentElement)
|
|
418
|
-
*/
|
|
419
|
-
export function applyTheme(
|
|
420
|
-
_theme: Partial<ThemeColors>,
|
|
421
|
-
_container?: HTMLElement
|
|
422
|
-
): void;
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Generate CSS string for embedding themes
|
|
426
|
-
* @param theme - Theme object
|
|
427
|
-
* @returns CSS string with custom properties
|
|
428
|
-
*/
|
|
429
|
-
export function generateThemeCSS(_theme: Partial<ThemeColors>): string;
|
|
430
|
-
|
|
431
|
-
// ============================================================================
|
|
432
|
-
// Brand scheme → calendar CSS variables
|
|
433
|
-
// ============================================================================
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* The builder's saved colour scheme: token name → hex string. Partial schemes
|
|
437
|
-
* are fine — a missing or invalid token is left to the stylesheet's default.
|
|
438
|
-
*/
|
|
439
|
-
export type ColorSchemeColors = Record<string, string>;
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Map a scheme to venue-calendar's CSS variables (`--brand-primary` …) as
|
|
443
|
-
* wrapper-less HSL strings ("209 99% 50%").
|
|
444
|
-
*/
|
|
445
|
-
export function schemeColorsToCSSVars(
|
|
446
|
-
_colors: ColorSchemeColors | null | undefined
|
|
447
|
-
): Record<string, string>;
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Write a scheme onto an element as inline custom properties. Pass the
|
|
451
|
-
* widget's own root: the stylesheet declares the default palette on that root,
|
|
452
|
-
* so a variable set on an ancestor never reaches it. Returns the names written.
|
|
453
|
-
*/
|
|
454
|
-
export function applySchemeColors(
|
|
455
|
-
_colors: ColorSchemeColors | null | undefined,
|
|
456
|
-
_container: HTMLElement
|
|
457
|
-
): string[];
|
|
458
|
-
|
|
459
|
-
/** Remove what applySchemeColors wrote. */
|
|
460
|
-
export function clearSchemeColors(
|
|
461
|
-
_container: HTMLElement,
|
|
462
|
-
_names: string[]
|
|
463
|
-
): void;
|
|
464
|
-
|
|
465
|
-
// ============================================================================
|
|
466
|
-
// Scarcity Canon
|
|
467
|
-
// ============================================================================
|
|
468
|
-
// These MUST be declared by hand. This file is not generated — it is copied
|
|
469
|
-
// verbatim from `src/lib/types/` to `dist/types/` by vite.config.lib.js and is
|
|
470
|
-
// what package.json's "types" points at, so a runtime `export` added to
|
|
471
|
-
// VenueCalendar.js is invisible to TypeScript until it is also declared here.
|
|
472
|
-
// The `exports` map has no wildcard either, so a deep import
|
|
473
|
-
// (`@getmicdrop/venue-calendar/constants/scarcity`) is not an escape hatch.
|
|
474
|
-
// Consumers — notably micdrop-frontend's admin mirror in
|
|
475
|
-
// `src/lib/foundry/settings-tickets/scarcity.ts` — import these from the
|
|
476
|
-
// package ENTRY, and that import only typechecks because of the declarations
|
|
477
|
-
// below. Keep them in sync with `src/lib/constants/scarcity.ts`.
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* Scarcity tier for a ticket. `sold-out` at zero remaining, `urgent` carries an
|
|
481
|
-
* exact count ("Only N left"), `low` is the vague badge, `plenty` no claim.
|
|
482
|
-
*/
|
|
483
|
-
export type ScarcityLevel = 'sold-out' | 'urgent' | 'low' | 'plenty';
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* The sliding-scale knobs behind every scarcity claim in venue-calendar.
|
|
487
|
-
* Percent thresholds bend toward the absolute floor/cap so the claim scales
|
|
488
|
-
* with venue size; `MAX_EXACT_COUNT` caps when an exact count may be revealed.
|
|
489
|
-
*/
|
|
490
|
-
export const SCARCITY_THRESHOLDS: {
|
|
491
|
-
readonly URGENT_PCT: 10;
|
|
492
|
-
readonly LOW_PCT: 20;
|
|
493
|
-
readonly MAX_EXACT_COUNT: 20;
|
|
494
|
-
readonly ABSOLUTE_FLOOR: 5;
|
|
495
|
-
readonly ABSOLUTE_CAP: 30;
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* Compute the scarcity level for a (remaining, total) pair.
|
|
500
|
-
*
|
|
501
|
-
* Returns 'plenty' when `total <= 0` (no percentage to compute — treat as
|
|
502
|
-
* unlimited/unknown capacity, make no claim) and 'sold-out' for remaining <= 0.
|
|
503
|
-
*/
|
|
504
|
-
export function computeScarcityLevel(
|
|
505
|
-
_remaining: number,
|
|
506
|
-
_total: number
|
|
507
|
-
): ScarcityLevel;
|
|
508
|
-
|
|
509
|
-
// ============================================================================
|
|
510
|
-
// Svelte Component Exports
|
|
511
|
-
// ============================================================================
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* VenueCalendar Svelte component (CalendarContainer)
|
|
515
|
-
*/
|
|
516
|
-
export const VenueCalendar: any;
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* Checkout Svelte component
|
|
520
|
-
*/
|
|
521
|
-
export const Checkout: any;
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* CheckoutView alias for Checkout
|
|
525
|
-
*/
|
|
526
|
-
export const CheckoutView: any;
|
|
527
|
-
|
|
528
|
-
/**
|
|
529
|
-
* Success Svelte component
|
|
530
|
-
*/
|
|
531
|
-
export const Success: any;
|
|
532
|
-
|
|
533
|
-
/**
|
|
534
|
-
* EventPage Svelte component — full event page with EventMeta, ScarcityBadge, etc.
|
|
535
|
-
*/
|
|
536
|
-
export const EventPage: any;
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* SeriesPage Svelte component — series landing page with hero, upcoming dates, performers, FAQ sidebar
|
|
540
|
-
*/
|
|
541
|
-
export const SeriesPage: any;
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* SeriesHomeView alias (deprecated — use SeriesPage instead)
|
|
545
|
-
*/
|
|
546
|
-
export const SeriesHomeView: any;
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* CollectionView Svelte component
|
|
550
|
-
*/
|
|
551
|
-
export const CollectionView: any;
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* ViewTicketsEmbed — the buyer's post-purchase ticket view (dice-swipe), as a
|
|
555
|
-
* LOADER: calling it resolves to the component, which is what keeps the view in
|
|
556
|
-
* its own chunk. Takes `{ orderUUID, locale?, labels? }` and self-fetches the
|
|
557
|
-
* order.
|
|
558
|
-
*
|
|
559
|
-
* This file is hand-written, so an export missing from it is invisible until a
|
|
560
|
-
* consumer imports it: the runtime barrel has exported this one since v3.6.0,
|
|
561
|
-
* and micdrop-frontend's apex `/tickets/<orderUUID>` route (MIC-3859) could not
|
|
562
|
-
* type-check against the published package without a local module augmentation.
|
|
563
|
-
* That augmentation can be deleted once a release carrying this line is pinned.
|
|
564
|
-
*/
|
|
565
|
-
export const ViewTicketsEmbed: any;
|
|
566
|
-
|
|
567
|
-
// ============================================================================
|
|
568
|
-
// Default Export
|
|
569
|
-
// ============================================================================
|
|
570
|
-
|
|
571
|
-
declare const _default: {
|
|
572
|
-
initVenueCalendar: typeof initVenueCalendar;
|
|
573
|
-
initEventPage: typeof initEventPage;
|
|
574
|
-
initCheckoutView: typeof initCheckoutView;
|
|
575
|
-
initCheckout: typeof initCheckoutView;
|
|
576
|
-
initSuccessView: typeof initSuccessView;
|
|
577
|
-
initSuccess: typeof initSuccessView;
|
|
578
|
-
autoMount: typeof autoMount;
|
|
579
|
-
VenueCalendar: any;
|
|
580
|
-
themes: Themes;
|
|
581
|
-
lightTheme: ThemeColors;
|
|
582
|
-
darkTheme: ThemeColors;
|
|
583
|
-
highContrastTheme: ThemeColors;
|
|
584
|
-
applyTheme: typeof applyTheme;
|
|
585
|
-
generateThemeCSS: typeof generateThemeCSS;
|
|
586
|
-
Checkout: any;
|
|
587
|
-
CheckoutView: any;
|
|
588
|
-
Success: any;
|
|
589
|
-
/** @deprecated Use Success instead */
|
|
590
|
-
Sucess: any;
|
|
591
|
-
EventPage: any;
|
|
592
|
-
SeriesPage: any;
|
|
593
|
-
SeriesHomeView: any;
|
|
594
|
-
CollectionView: any;
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
export default _default;
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript definitions for @getmicdrop/venue-calendar
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Event Data Types
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Event data structure returned from the API or passed to components
|
|
11
|
+
*/
|
|
12
|
+
export interface EventData {
|
|
13
|
+
id: string | number;
|
|
14
|
+
name: string;
|
|
15
|
+
date: string;
|
|
16
|
+
startDateTime?: string;
|
|
17
|
+
endDateTime?: string;
|
|
18
|
+
image?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
venueId?: string | number;
|
|
21
|
+
venueID?: string | number;
|
|
22
|
+
timeZone?: string;
|
|
23
|
+
location?: string;
|
|
24
|
+
slug?: string;
|
|
25
|
+
status?: 'on_sale' | 'selling_fast' | 'sold_out';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Ticket data structure
|
|
30
|
+
*/
|
|
31
|
+
export interface TicketData {
|
|
32
|
+
id: string | number;
|
|
33
|
+
name: string;
|
|
34
|
+
price: number;
|
|
35
|
+
quantity?: number;
|
|
36
|
+
description?: string;
|
|
37
|
+
available?: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// ============================================================================
|
|
41
|
+
// Theme Types
|
|
42
|
+
// ============================================================================
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Theme color configuration using HSL format
|
|
46
|
+
* All values should be HSL strings like "217 91% 60%"
|
|
47
|
+
*/
|
|
48
|
+
export interface ThemeColors {
|
|
49
|
+
/** Brand primary color */
|
|
50
|
+
brandPrimary: string;
|
|
51
|
+
/** Primary text color */
|
|
52
|
+
textPrimary: string;
|
|
53
|
+
/** Secondary text color */
|
|
54
|
+
textSecondary: string;
|
|
55
|
+
/** Tertiary text color */
|
|
56
|
+
textTertiary: string;
|
|
57
|
+
/** Primary background color */
|
|
58
|
+
bgPrimary: string;
|
|
59
|
+
/** Secondary background color */
|
|
60
|
+
bgSecondary: string;
|
|
61
|
+
/** Quaternary background color */
|
|
62
|
+
bgQuaternary: string;
|
|
63
|
+
/** Primary stroke/border color */
|
|
64
|
+
strokePrimary: string;
|
|
65
|
+
/** Secondary stroke/border color */
|
|
66
|
+
strokeSecondary: string;
|
|
67
|
+
/** On sale status color */
|
|
68
|
+
statusOnSale: string;
|
|
69
|
+
/** Selling fast status color */
|
|
70
|
+
statusSellingFast: string;
|
|
71
|
+
/** Sold out status color */
|
|
72
|
+
statusSoldOut: string;
|
|
73
|
+
/** Today's date background color */
|
|
74
|
+
todayBg: string;
|
|
75
|
+
/** Today's date text color */
|
|
76
|
+
todayText: string;
|
|
77
|
+
/** Event dot color for on sale */
|
|
78
|
+
eventDotOnSale: string;
|
|
79
|
+
/** Event dot color for selling fast */
|
|
80
|
+
eventDotSellingFast: string;
|
|
81
|
+
/** Event dot color for sold out */
|
|
82
|
+
eventDotSoldOut: string;
|
|
83
|
+
/** Hover background color */
|
|
84
|
+
hoverBg: string;
|
|
85
|
+
/** Focus ring color */
|
|
86
|
+
focusRing: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Preset themes collection
|
|
91
|
+
*/
|
|
92
|
+
export interface Themes {
|
|
93
|
+
light: ThemeColors;
|
|
94
|
+
dark: ThemeColors;
|
|
95
|
+
highContrast: ThemeColors;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// View Option Types
|
|
100
|
+
// ============================================================================
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* View option for the calendar view switcher
|
|
104
|
+
*/
|
|
105
|
+
export interface ViewOption {
|
|
106
|
+
id: number;
|
|
107
|
+
text: string;
|
|
108
|
+
/** @deprecated Not rendered — the view switcher shows `text` only. Kept optional for backward compatibility. */
|
|
109
|
+
icon?: string;
|
|
110
|
+
ariaLabel?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type ViewType = 'list' | 'gallery' | 'calendar';
|
|
114
|
+
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// Component Props Interfaces
|
|
117
|
+
// ============================================================================
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Base options for all init functions
|
|
121
|
+
*/
|
|
122
|
+
export interface BaseInitOptions {
|
|
123
|
+
/** CSS selector or HTMLElement to mount the component */
|
|
124
|
+
target: string | HTMLElement;
|
|
125
|
+
/** The venue ID (optional, default: '1') */
|
|
126
|
+
venueId?: string;
|
|
127
|
+
/** The organization ID (optional, default: '1') */
|
|
128
|
+
organizationId?: string;
|
|
129
|
+
/**
|
|
130
|
+
* BCP-47 locale tag (e.g. 'es', 'es-MX'). Selects the bundled locale for the
|
|
131
|
+
* label catalogue; undefined falls back to the browser locale, then English.
|
|
132
|
+
* Threaded through every init entry point (vc#693).
|
|
133
|
+
*/
|
|
134
|
+
locale?: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Options for initializing the Venue Calendar component
|
|
139
|
+
*/
|
|
140
|
+
export interface CalendarProps extends BaseInitOptions {
|
|
141
|
+
/** Initial view: 'list', 'gallery', or 'calendar' (default: 'calendar') */
|
|
142
|
+
view?: ViewType;
|
|
143
|
+
/** Array of event objects to display */
|
|
144
|
+
events?: EventData[];
|
|
145
|
+
/** Whether to show view switcher (default: true) */
|
|
146
|
+
showViewOptions?: boolean;
|
|
147
|
+
/** Whether to show month navigation (default: true) */
|
|
148
|
+
showMonthSwitcher?: boolean;
|
|
149
|
+
/** Show the search box even without the view switcher (default: false) */
|
|
150
|
+
showSearch?: boolean;
|
|
151
|
+
/** Gallery/List/Carousel show at most this many events; null = all, with
|
|
152
|
+
* load more on Gallery (default: null) */
|
|
153
|
+
maxItems?: number | null;
|
|
154
|
+
/** Hide card parts; only `false` hides (default: every part shown) */
|
|
155
|
+
eventDetails?: {
|
|
156
|
+
poster?: boolean;
|
|
157
|
+
date?: boolean;
|
|
158
|
+
description?: boolean;
|
|
159
|
+
} | null;
|
|
160
|
+
/** Which show the Featured view spotlights. Falls through to the next
|
|
161
|
+
* upcoming show when the pick is absent or no longer in the feed — a
|
|
162
|
+
* collection pick always falls through, since the event feed carries no
|
|
163
|
+
* collection membership to match on (default: null) */
|
|
164
|
+
featuredItem?: {
|
|
165
|
+
type?: 'event' | 'series' | 'collection';
|
|
166
|
+
id: string | number;
|
|
167
|
+
} | null;
|
|
168
|
+
/** How big each view draws its events: S packs more in, L gives each
|
|
169
|
+
* event more room, M is the default look (default: 'M') */
|
|
170
|
+
size?: 'S' | 'M' | 'L';
|
|
171
|
+
/** Level of the calendar's screen-reader heading: 2 when the host page
|
|
172
|
+
* already carries its h1 (default: 1) */
|
|
173
|
+
headingLevel?: 1 | 2;
|
|
174
|
+
/** How every card draws its poster: 'fit' shows the whole poster, 'fill'
|
|
175
|
+
* crops it to cover the frame (default: 'fit') */
|
|
176
|
+
posterFit?: 'fill' | 'fit';
|
|
177
|
+
/** What fills around a 'fit' poster: a blurred copy of it, or the
|
|
178
|
+
* section's own colour (default: 'blur') */
|
|
179
|
+
posterBackdrop?: 'blur' | 'color';
|
|
180
|
+
/** Opening a show rewrites the host page's title and share tags to the
|
|
181
|
+
* show's, restoring them on close. Both embeds turn it on unless the host
|
|
182
|
+
* sets inject-seo="false" (default for a direct call: false) */
|
|
183
|
+
injectSeo?: boolean;
|
|
184
|
+
/** Current month store (Svelte writable store) */
|
|
185
|
+
currentMonth?: import('svelte/store').Writable<number>;
|
|
186
|
+
/** Current year store (Svelte writable store) */
|
|
187
|
+
currentYear?: import('svelte/store').Writable<number>;
|
|
188
|
+
/** Handler for navigating to next month */
|
|
189
|
+
handleNext?: () => void;
|
|
190
|
+
/** Handler for navigating to previous month */
|
|
191
|
+
handlePrev?: () => void;
|
|
192
|
+
/** Callback function when an event is clicked */
|
|
193
|
+
onEventClick?: (_event: EventData) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Render the show detail / series / collection IN-PLACE on click + deep
|
|
196
|
+
* link instead of navigating the host page (default: true for embeds).
|
|
197
|
+
* Pass false to keep the host responsible for navigation, or supply your
|
|
198
|
+
* own onEventClick to take over click handling entirely.
|
|
199
|
+
*/
|
|
200
|
+
inlineEntityViews?: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* The host's brand scheme, applied on the widget's root so every calendar
|
|
203
|
+
* surface — time buttons included — wears it. null = the default palette.
|
|
204
|
+
*/
|
|
205
|
+
colors?: ColorSchemeColors | null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Options for initializing the (inline) Event Page.
|
|
210
|
+
*/
|
|
211
|
+
export interface EventPageOptions extends BaseInitOptions {
|
|
212
|
+
/** The event ID to display (the page self-fetches), or pass rawEvent. */
|
|
213
|
+
eventId?: string | number;
|
|
214
|
+
/** Pre-fetched raw event payload (skips the self-fetch). */
|
|
215
|
+
rawEvent?: any;
|
|
216
|
+
/** Event slug (cosmetic). */
|
|
217
|
+
slug?: string;
|
|
218
|
+
/** Callback when the back control is clicked. */
|
|
219
|
+
onNavigateBack?: () => void;
|
|
220
|
+
/** Callback when proceeding to checkout (cart already created). */
|
|
221
|
+
onNavigateToCart?: (
|
|
222
|
+
_id: string | number,
|
|
223
|
+
_slug: string,
|
|
224
|
+
_rawEvent: any
|
|
225
|
+
) => void;
|
|
226
|
+
/** Callback when a series occurrence is clicked. */
|
|
227
|
+
onBuyTickets?: (_eventId: string | number, _slug: string) => void;
|
|
228
|
+
/** i18n label overrides. */
|
|
229
|
+
labels?: Record<string, string>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Success callback data from checkout
|
|
234
|
+
*/
|
|
235
|
+
export interface CheckoutSuccessData {
|
|
236
|
+
orderId?: string;
|
|
237
|
+
eventId?: string;
|
|
238
|
+
event?: EventData;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Options for initializing the Checkout View
|
|
243
|
+
*/
|
|
244
|
+
export interface CheckoutOptions extends BaseInitOptions {
|
|
245
|
+
/** The event ID to display */
|
|
246
|
+
eventId: string;
|
|
247
|
+
/** The event slug (optional) */
|
|
248
|
+
slug?: string;
|
|
249
|
+
/** Array of available tickets (optional) */
|
|
250
|
+
availableTickets?: TicketData[];
|
|
251
|
+
/** Callback when checkout is successful */
|
|
252
|
+
onSuccess?: (_data: CheckoutSuccessData) => void;
|
|
253
|
+
/** Callback when navigating to success page */
|
|
254
|
+
onNavigateToSuccess?: (_data: CheckoutSuccessData) => void;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Options for initializing the Success View
|
|
259
|
+
*/
|
|
260
|
+
export interface SuccessViewOptions extends BaseInitOptions {
|
|
261
|
+
/** The event ID (optional) */
|
|
262
|
+
eventId?: string;
|
|
263
|
+
/** The event slug (optional) */
|
|
264
|
+
slug?: string;
|
|
265
|
+
/** The order ID (optional) */
|
|
266
|
+
orderId?: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Alias for CalendarProps for backward compatibility
|
|
271
|
+
*/
|
|
272
|
+
export type InitOptions = CalendarProps;
|
|
273
|
+
|
|
274
|
+
// ============================================================================
|
|
275
|
+
// Svelte Component Instance
|
|
276
|
+
// ============================================================================
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Svelte component instance returned by init functions
|
|
280
|
+
*/
|
|
281
|
+
export interface SvelteComponentInstance {
|
|
282
|
+
/** Destroy the component and clean up */
|
|
283
|
+
$destroy?: () => void;
|
|
284
|
+
/** Internal cleanup for success listener */
|
|
285
|
+
_successCleanup?: () => void;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ============================================================================
|
|
289
|
+
// Exported Functions
|
|
290
|
+
// ============================================================================
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Initialize the Venue Calendar component
|
|
294
|
+
* @param options - Configuration options
|
|
295
|
+
* @returns The Svelte component instance, or null if target not found
|
|
296
|
+
*/
|
|
297
|
+
export function initVenueCalendar(
|
|
298
|
+
_options: CalendarProps
|
|
299
|
+
): SvelteComponentInstance | null;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Initialize the (inline) Event Page.
|
|
303
|
+
* @param options - Configuration options
|
|
304
|
+
* @returns The Svelte component instance, or null if target not found / no event
|
|
305
|
+
*/
|
|
306
|
+
export function initEventPage(
|
|
307
|
+
_options: EventPageOptions
|
|
308
|
+
): SvelteComponentInstance | null;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Initialize the Checkout View
|
|
312
|
+
* @param options - Configuration options
|
|
313
|
+
* @returns The Svelte component instance, or null if target not found or eventId missing
|
|
314
|
+
*/
|
|
315
|
+
export function initCheckoutView(
|
|
316
|
+
_options: CheckoutOptions
|
|
317
|
+
): SvelteComponentInstance | null;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Alias for initCheckoutView
|
|
321
|
+
*/
|
|
322
|
+
export const initCheckout: typeof initCheckoutView;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Initialize the Success View
|
|
326
|
+
* @param options - Configuration options
|
|
327
|
+
* @returns The Svelte component instance, or null if target not found
|
|
328
|
+
*/
|
|
329
|
+
export function initSuccessView(
|
|
330
|
+
_options: SuccessViewOptions
|
|
331
|
+
): SvelteComponentInstance | null;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Alias for initSuccessView
|
|
335
|
+
*/
|
|
336
|
+
export const initSuccess: typeof initSuccessView;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Auto-mount: Automatically finds and mounts calendar to elements with class 'micdrop-calendar-container'
|
|
340
|
+
*/
|
|
341
|
+
export function autoMount(): void;
|
|
342
|
+
|
|
343
|
+
// ============================================================================
|
|
344
|
+
// Runtime Configuration
|
|
345
|
+
// ============================================================================
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Opt-in embed integration settings for a venue site embedding the widget.
|
|
349
|
+
*/
|
|
350
|
+
export interface EmbedConfig {
|
|
351
|
+
/**
|
|
352
|
+
* Emit a MICDROP_CHECKOUT_COMPLETE postMessage when an order completes. The
|
|
353
|
+
* payload is non-PII: `{ orderId, eventId }`. Default: false.
|
|
354
|
+
*/
|
|
355
|
+
postMessageOnSuccess?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* REQUIRED concrete origin (e.g. 'https://venue.example') for the
|
|
358
|
+
* MICDROP_CHECKOUT_COMPLETE message. The message is never posted to '*'; without a
|
|
359
|
+
* concrete absolute origin nothing is sent and a warning is logged.
|
|
360
|
+
*/
|
|
361
|
+
postMessageTargetOrigin?: string | null;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Options for {@link configureVenueCalendar}. All fields are optional — pass
|
|
366
|
+
* only the keys you want to change.
|
|
367
|
+
*/
|
|
368
|
+
export interface ConfigureVenueCalendarOptions {
|
|
369
|
+
/** Called whenever the widget surfaces a caught error (wire into Sentry/Rollbar/etc). */
|
|
370
|
+
onError?: (_error: Error, _context: { source: string }) => void;
|
|
371
|
+
/** Override the backend origin for multi-region setups. */
|
|
372
|
+
apiBaseUrl?: string;
|
|
373
|
+
/** Request timeout in ms, forwarded to the API client. */
|
|
374
|
+
apiTimeout?: number;
|
|
375
|
+
/** Retry count, forwarded to the API client. */
|
|
376
|
+
apiRetries?: number;
|
|
377
|
+
/** Opt-in embed integration settings (see {@link EmbedConfig}). */
|
|
378
|
+
embed?: EmbedConfig;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Configure the calendar widget at runtime: error reporting, API overrides,
|
|
383
|
+
* and the opt-in embed integration (e.g. the MICDROP_CHECKOUT_COMPLETE postMessage).
|
|
384
|
+
* @param options - Configuration options
|
|
385
|
+
*/
|
|
386
|
+
export function configureVenueCalendar(
|
|
387
|
+
_options?: ConfigureVenueCalendarOptions
|
|
388
|
+
): void;
|
|
389
|
+
|
|
390
|
+
// ============================================================================
|
|
391
|
+
// Theme Exports
|
|
392
|
+
// ============================================================================
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Collection of preset themes
|
|
396
|
+
*/
|
|
397
|
+
export const themes: Themes;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Light theme preset
|
|
401
|
+
*/
|
|
402
|
+
export const lightTheme: ThemeColors;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Dark theme preset
|
|
406
|
+
*/
|
|
407
|
+
export const darkTheme: ThemeColors;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* High contrast theme preset for accessibility
|
|
411
|
+
*/
|
|
412
|
+
export const highContrastTheme: ThemeColors;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* Apply a theme to the calendar widget
|
|
416
|
+
* @param theme - Theme object with HSL color values
|
|
417
|
+
* @param container - Optional container element (defaults to document.documentElement)
|
|
418
|
+
*/
|
|
419
|
+
export function applyTheme(
|
|
420
|
+
_theme: Partial<ThemeColors>,
|
|
421
|
+
_container?: HTMLElement
|
|
422
|
+
): void;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Generate CSS string for embedding themes
|
|
426
|
+
* @param theme - Theme object
|
|
427
|
+
* @returns CSS string with custom properties
|
|
428
|
+
*/
|
|
429
|
+
export function generateThemeCSS(_theme: Partial<ThemeColors>): string;
|
|
430
|
+
|
|
431
|
+
// ============================================================================
|
|
432
|
+
// Brand scheme → calendar CSS variables
|
|
433
|
+
// ============================================================================
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* The builder's saved colour scheme: token name → hex string. Partial schemes
|
|
437
|
+
* are fine — a missing or invalid token is left to the stylesheet's default.
|
|
438
|
+
*/
|
|
439
|
+
export type ColorSchemeColors = Record<string, string>;
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Map a scheme to venue-calendar's CSS variables (`--brand-primary` …) as
|
|
443
|
+
* wrapper-less HSL strings ("209 99% 50%").
|
|
444
|
+
*/
|
|
445
|
+
export function schemeColorsToCSSVars(
|
|
446
|
+
_colors: ColorSchemeColors | null | undefined
|
|
447
|
+
): Record<string, string>;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Write a scheme onto an element as inline custom properties. Pass the
|
|
451
|
+
* widget's own root: the stylesheet declares the default palette on that root,
|
|
452
|
+
* so a variable set on an ancestor never reaches it. Returns the names written.
|
|
453
|
+
*/
|
|
454
|
+
export function applySchemeColors(
|
|
455
|
+
_colors: ColorSchemeColors | null | undefined,
|
|
456
|
+
_container: HTMLElement
|
|
457
|
+
): string[];
|
|
458
|
+
|
|
459
|
+
/** Remove what applySchemeColors wrote. */
|
|
460
|
+
export function clearSchemeColors(
|
|
461
|
+
_container: HTMLElement,
|
|
462
|
+
_names: string[]
|
|
463
|
+
): void;
|
|
464
|
+
|
|
465
|
+
// ============================================================================
|
|
466
|
+
// Scarcity Canon
|
|
467
|
+
// ============================================================================
|
|
468
|
+
// These MUST be declared by hand. This file is not generated — it is copied
|
|
469
|
+
// verbatim from `src/lib/types/` to `dist/types/` by vite.config.lib.js and is
|
|
470
|
+
// what package.json's "types" points at, so a runtime `export` added to
|
|
471
|
+
// VenueCalendar.js is invisible to TypeScript until it is also declared here.
|
|
472
|
+
// The `exports` map has no wildcard either, so a deep import
|
|
473
|
+
// (`@getmicdrop/venue-calendar/constants/scarcity`) is not an escape hatch.
|
|
474
|
+
// Consumers — notably micdrop-frontend's admin mirror in
|
|
475
|
+
// `src/lib/foundry/settings-tickets/scarcity.ts` — import these from the
|
|
476
|
+
// package ENTRY, and that import only typechecks because of the declarations
|
|
477
|
+
// below. Keep them in sync with `src/lib/constants/scarcity.ts`.
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Scarcity tier for a ticket. `sold-out` at zero remaining, `urgent` carries an
|
|
481
|
+
* exact count ("Only N left"), `low` is the vague badge, `plenty` no claim.
|
|
482
|
+
*/
|
|
483
|
+
export type ScarcityLevel = 'sold-out' | 'urgent' | 'low' | 'plenty';
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* The sliding-scale knobs behind every scarcity claim in venue-calendar.
|
|
487
|
+
* Percent thresholds bend toward the absolute floor/cap so the claim scales
|
|
488
|
+
* with venue size; `MAX_EXACT_COUNT` caps when an exact count may be revealed.
|
|
489
|
+
*/
|
|
490
|
+
export const SCARCITY_THRESHOLDS: {
|
|
491
|
+
readonly URGENT_PCT: 10;
|
|
492
|
+
readonly LOW_PCT: 20;
|
|
493
|
+
readonly MAX_EXACT_COUNT: 20;
|
|
494
|
+
readonly ABSOLUTE_FLOOR: 5;
|
|
495
|
+
readonly ABSOLUTE_CAP: 30;
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Compute the scarcity level for a (remaining, total) pair.
|
|
500
|
+
*
|
|
501
|
+
* Returns 'plenty' when `total <= 0` (no percentage to compute — treat as
|
|
502
|
+
* unlimited/unknown capacity, make no claim) and 'sold-out' for remaining <= 0.
|
|
503
|
+
*/
|
|
504
|
+
export function computeScarcityLevel(
|
|
505
|
+
_remaining: number,
|
|
506
|
+
_total: number
|
|
507
|
+
): ScarcityLevel;
|
|
508
|
+
|
|
509
|
+
// ============================================================================
|
|
510
|
+
// Svelte Component Exports
|
|
511
|
+
// ============================================================================
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* VenueCalendar Svelte component (CalendarContainer)
|
|
515
|
+
*/
|
|
516
|
+
export const VenueCalendar: any;
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Checkout Svelte component
|
|
520
|
+
*/
|
|
521
|
+
export const Checkout: any;
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* CheckoutView alias for Checkout
|
|
525
|
+
*/
|
|
526
|
+
export const CheckoutView: any;
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Success Svelte component
|
|
530
|
+
*/
|
|
531
|
+
export const Success: any;
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* EventPage Svelte component — full event page with EventMeta, ScarcityBadge, etc.
|
|
535
|
+
*/
|
|
536
|
+
export const EventPage: any;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* SeriesPage Svelte component — series landing page with hero, upcoming dates, performers, FAQ sidebar
|
|
540
|
+
*/
|
|
541
|
+
export const SeriesPage: any;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* SeriesHomeView alias (deprecated — use SeriesPage instead)
|
|
545
|
+
*/
|
|
546
|
+
export const SeriesHomeView: any;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* CollectionView Svelte component
|
|
550
|
+
*/
|
|
551
|
+
export const CollectionView: any;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* ViewTicketsEmbed — the buyer's post-purchase ticket view (dice-swipe), as a
|
|
555
|
+
* LOADER: calling it resolves to the component, which is what keeps the view in
|
|
556
|
+
* its own chunk. Takes `{ orderUUID, locale?, labels? }` and self-fetches the
|
|
557
|
+
* order.
|
|
558
|
+
*
|
|
559
|
+
* This file is hand-written, so an export missing from it is invisible until a
|
|
560
|
+
* consumer imports it: the runtime barrel has exported this one since v3.6.0,
|
|
561
|
+
* and micdrop-frontend's apex `/tickets/<orderUUID>` route (MIC-3859) could not
|
|
562
|
+
* type-check against the published package without a local module augmentation.
|
|
563
|
+
* That augmentation can be deleted once a release carrying this line is pinned.
|
|
564
|
+
*/
|
|
565
|
+
export const ViewTicketsEmbed: any;
|
|
566
|
+
|
|
567
|
+
// ============================================================================
|
|
568
|
+
// Default Export
|
|
569
|
+
// ============================================================================
|
|
570
|
+
|
|
571
|
+
declare const _default: {
|
|
572
|
+
initVenueCalendar: typeof initVenueCalendar;
|
|
573
|
+
initEventPage: typeof initEventPage;
|
|
574
|
+
initCheckoutView: typeof initCheckoutView;
|
|
575
|
+
initCheckout: typeof initCheckoutView;
|
|
576
|
+
initSuccessView: typeof initSuccessView;
|
|
577
|
+
initSuccess: typeof initSuccessView;
|
|
578
|
+
autoMount: typeof autoMount;
|
|
579
|
+
VenueCalendar: any;
|
|
580
|
+
themes: Themes;
|
|
581
|
+
lightTheme: ThemeColors;
|
|
582
|
+
darkTheme: ThemeColors;
|
|
583
|
+
highContrastTheme: ThemeColors;
|
|
584
|
+
applyTheme: typeof applyTheme;
|
|
585
|
+
generateThemeCSS: typeof generateThemeCSS;
|
|
586
|
+
Checkout: any;
|
|
587
|
+
CheckoutView: any;
|
|
588
|
+
Success: any;
|
|
589
|
+
/** @deprecated Use Success instead */
|
|
590
|
+
Sucess: any;
|
|
591
|
+
EventPage: any;
|
|
592
|
+
SeriesPage: any;
|
|
593
|
+
SeriesHomeView: any;
|
|
594
|
+
CollectionView: any;
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
export default _default;
|