@getmicdrop/venue-calendar 4.0.83 → 4.0.86
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 +740 -740
- package/dist/{CartView-DBrUqLSR.js → CartView-e2hG7cOV.js} +5 -5
- package/dist/CartView-e2hG7cOV.js.map +1 -0
- package/dist/{Checkout-BAtOdBIM.js → Checkout-BpTUMyLk.js} +7 -7
- package/dist/Checkout-BpTUMyLk.js.map +1 -0
- package/dist/Checkout-DmnOMwhl.js +809 -0
- package/dist/Checkout-DmnOMwhl.js.map +1 -0
- package/dist/{CheckoutTimer-CayvrAa9.js → CheckoutTimer-Dv0c-X6O.js} +4 -4
- package/dist/CheckoutTimer-Dv0c-X6O.js.map +1 -0
- package/dist/{CollectionView-kk90OMFq.js → CollectionView-CyxK6aI9.js} +5 -5
- package/dist/CollectionView-CyxK6aI9.js.map +1 -0
- package/dist/{Event-N959l6uT.js → Event-Cw7b9UEd.js} +1125 -1125
- package/dist/Event-Cw7b9UEd.js.map +1 -0
- package/dist/{EventPage-DaEMiLjY.js → EventPage-BKtFiZL1.js} +7 -7
- package/dist/EventPage-BKtFiZL1.js.map +1 -0
- package/dist/{Heading-A_nixT3L.js → Heading-D0grC8vd.js} +2 -2
- package/dist/{Heading-A_nixT3L.js.map → Heading-D0grC8vd.js.map} +1 -1
- package/dist/{ModalHeader-CxMVzApa.js → ModalHeader-V5AlK1dt.js} +2 -2
- package/dist/{ModalHeader-CxMVzApa.js.map → ModalHeader-V5AlK1dt.js.map} +1 -1
- package/dist/{ScarcityBadge-CiF-JsPl.js → ScarcityBadge-Co7gZXuW.js} +2 -2
- package/dist/ScarcityBadge-Co7gZXuW.js.map +1 -0
- package/dist/{SeriesPage-CQJHrpTH.js → SeriesPage-USYe3APQ.js} +5 -5
- package/dist/SeriesPage-USYe3APQ.js.map +1 -0
- package/dist/{Success-R-1NhLjx.js → Success-C387RvIY.js} +7 -7
- package/dist/Success-C387RvIY.js.map +1 -0
- package/dist/{Text-F6D2QvI6.js → Text-ZUPglf_o.js} +2 -2
- package/dist/{Text-F6D2QvI6.js.map → Text-ZUPglf_o.js.map} +1 -1
- package/dist/{VenueCalendar-DdRkxjxd.js → VenueCalendar-tmWZSmhT.js} +451 -449
- package/dist/VenueCalendar-tmWZSmhT.js.map +1 -0
- package/dist/{ViewTicketsEmbed-BwvS8VgE.js → ViewTicketsEmbed--091XJJn.js} +4 -4
- package/dist/ViewTicketsEmbed--091XJJn.js.map +1 -0
- package/dist/api/api.cjs +1 -1
- package/dist/api/api.cjs.map +1 -1
- package/dist/api/api.mjs +18 -15
- package/dist/api/api.mjs.map +1 -1
- package/dist/api/gift-cards.d.ts +3 -2
- package/dist/{data-toggle-store.svelte-D9XyVwDW.js → data-toggle-store.svelte-Bn0h8FT_.js} +2 -2
- package/dist/data-toggle-store.svelte-Bn0h8FT_.js.map +1 -0
- package/dist/{labels-DG5wh_vD.js → labels-C7Znep_T.js} +3 -3
- package/dist/labels-C7Znep_T.js.map +1 -0
- package/dist/seo/seo.cjs.map +1 -1
- package/dist/seo/seo.mjs.map +1 -1
- package/dist/{transform-C5S2acqv.js → transform-BxgTZDAD.js} +2 -2
- package/dist/transform-BxgTZDAD.js.map +1 -0
- package/dist/types/index.d.ts +442 -442
- package/dist/venue-calendar.css +1 -1
- package/dist/venue-calendar.es.js +2 -2
- package/dist/venue-calendar.iife.js +20 -20
- package/dist/venue-calendar.iife.js.map +1 -1
- package/dist/venue-calendar.umd.js +19 -19
- package/dist/venue-calendar.umd.js.map +1 -1
- package/package.json +170 -171
- package/src/lib/theme.js +222 -222
- package/dist/CartView-DBrUqLSR.js.map +0 -1
- package/dist/Checkout-BAtOdBIM.js.map +0 -1
- package/dist/Checkout-BEcmGOZm.js +0 -789
- package/dist/Checkout-BEcmGOZm.js.map +0 -1
- package/dist/CheckoutTimer-CayvrAa9.js.map +0 -1
- package/dist/CollectionView-kk90OMFq.js.map +0 -1
- package/dist/Event-N959l6uT.js.map +0 -1
- package/dist/EventPage-DaEMiLjY.js.map +0 -1
- package/dist/ScarcityBadge-CiF-JsPl.js.map +0 -1
- package/dist/SeriesPage-CQJHrpTH.js.map +0 -1
- package/dist/Success-R-1NhLjx.js.map +0 -1
- package/dist/VenueCalendar-DdRkxjxd.js.map +0 -1
- package/dist/ViewTicketsEmbed-BwvS8VgE.js.map +0 -1
- package/dist/data-toggle-store.svelte-D9XyVwDW.js.map +0 -1
- package/dist/labels-DG5wh_vD.js.map +0 -1
- package/dist/transform-C5S2acqv.js.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,442 +1,442 @@
|
|
|
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
|
-
icon: string;
|
|
109
|
-
ariaLabel?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export type ViewType = 'list' | 'gallery' | 'calendar';
|
|
113
|
-
|
|
114
|
-
// ============================================================================
|
|
115
|
-
// Component Props Interfaces
|
|
116
|
-
// ============================================================================
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Base options for all init functions
|
|
120
|
-
*/
|
|
121
|
-
export interface BaseInitOptions {
|
|
122
|
-
/** CSS selector or HTMLElement to mount the component */
|
|
123
|
-
target: string | HTMLElement;
|
|
124
|
-
/** The venue ID (optional, default: '1') */
|
|
125
|
-
venueId?: string;
|
|
126
|
-
/** The organization ID (optional, default: '1') */
|
|
127
|
-
organizationId?: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Options for initializing the Venue Calendar component
|
|
132
|
-
*/
|
|
133
|
-
export interface CalendarProps extends BaseInitOptions {
|
|
134
|
-
/** Initial view: 'list', 'gallery', or 'calendar' (default: 'calendar') */
|
|
135
|
-
view?: ViewType;
|
|
136
|
-
/** Array of event objects to display */
|
|
137
|
-
events?: EventData[];
|
|
138
|
-
/** Whether to show view switcher (default: true) */
|
|
139
|
-
showViewOptions?: boolean;
|
|
140
|
-
/** Whether to show month navigation (default: true) */
|
|
141
|
-
showMonthSwitcher?: boolean;
|
|
142
|
-
/** Current month store (Svelte writable store) */
|
|
143
|
-
currentMonth?: import('svelte/store').Writable<number>;
|
|
144
|
-
/** Current year store (Svelte writable store) */
|
|
145
|
-
currentYear?: import('svelte/store').Writable<number>;
|
|
146
|
-
/** Handler for navigating to next month */
|
|
147
|
-
handleNext?: () => void;
|
|
148
|
-
/** Handler for navigating to previous month */
|
|
149
|
-
handlePrev?: () => void;
|
|
150
|
-
/** Callback function when an event is clicked */
|
|
151
|
-
onEventClick?: (event: EventData) => void;
|
|
152
|
-
/**
|
|
153
|
-
* Render the show detail / series / collection IN-PLACE on click + deep
|
|
154
|
-
* link instead of navigating the host page (default: true for embeds).
|
|
155
|
-
* Pass false to keep the host responsible for navigation, or supply your
|
|
156
|
-
* own onEventClick to take over click handling entirely.
|
|
157
|
-
*/
|
|
158
|
-
inlineEntityViews?: boolean;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Options for initializing the (inline) Event Page.
|
|
163
|
-
*/
|
|
164
|
-
export interface EventPageOptions extends BaseInitOptions {
|
|
165
|
-
/** The event ID to display (the page self-fetches), or pass rawEvent. */
|
|
166
|
-
eventId?: string | number;
|
|
167
|
-
/** Pre-fetched raw event payload (skips the self-fetch). */
|
|
168
|
-
rawEvent?: any;
|
|
169
|
-
/** Event slug (cosmetic). */
|
|
170
|
-
slug?: string;
|
|
171
|
-
/** Callback when the back control is clicked. */
|
|
172
|
-
onNavigateBack?: () => void;
|
|
173
|
-
/** Callback when proceeding to checkout (cart already created). */
|
|
174
|
-
onNavigateToCart?: (id: string | number, slug: string, rawEvent: any) => void;
|
|
175
|
-
/** Callback when a series occurrence is clicked. */
|
|
176
|
-
onBuyTickets?: (eventId: string | number, slug: string) => void;
|
|
177
|
-
/** i18n label overrides. */
|
|
178
|
-
labels?: Record<string, string>;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Success callback data from checkout
|
|
183
|
-
*/
|
|
184
|
-
export interface CheckoutSuccessData {
|
|
185
|
-
orderId?: string;
|
|
186
|
-
eventId?: string;
|
|
187
|
-
event?: EventData;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Options for initializing the Checkout View
|
|
192
|
-
*/
|
|
193
|
-
export interface CheckoutOptions extends BaseInitOptions {
|
|
194
|
-
/** The event ID to display */
|
|
195
|
-
eventId: string;
|
|
196
|
-
/** The event slug (optional) */
|
|
197
|
-
slug?: string;
|
|
198
|
-
/** Array of available tickets (optional) */
|
|
199
|
-
availableTickets?: TicketData[];
|
|
200
|
-
/** Callback when checkout is successful */
|
|
201
|
-
onSuccess?: (data: CheckoutSuccessData) => void;
|
|
202
|
-
/** Callback when navigating to success page */
|
|
203
|
-
onNavigateToSuccess?: (data: CheckoutSuccessData) => void;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Options for initializing the Success View
|
|
208
|
-
*/
|
|
209
|
-
export interface SuccessViewOptions extends BaseInitOptions {
|
|
210
|
-
/** The event ID (optional) */
|
|
211
|
-
eventId?: string;
|
|
212
|
-
/** The event slug (optional) */
|
|
213
|
-
slug?: string;
|
|
214
|
-
/** The order ID (optional) */
|
|
215
|
-
orderId?: string;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Alias for CalendarProps for backward compatibility
|
|
220
|
-
*/
|
|
221
|
-
export type InitOptions = CalendarProps;
|
|
222
|
-
|
|
223
|
-
// ============================================================================
|
|
224
|
-
// Svelte Component Instance
|
|
225
|
-
// ============================================================================
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Svelte component instance returned by init functions
|
|
229
|
-
*/
|
|
230
|
-
export interface SvelteComponentInstance {
|
|
231
|
-
/** Destroy the component and clean up */
|
|
232
|
-
$destroy?: () => void;
|
|
233
|
-
/** Internal cleanup for success listener */
|
|
234
|
-
_successCleanup?: () => void;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// ============================================================================
|
|
238
|
-
// Exported Functions
|
|
239
|
-
// ============================================================================
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Initialize the Venue Calendar component
|
|
243
|
-
* @param options - Configuration options
|
|
244
|
-
* @returns The Svelte component instance, or null if target not found
|
|
245
|
-
*/
|
|
246
|
-
export function initVenueCalendar(options: CalendarProps): SvelteComponentInstance | null;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Initialize the (inline) Event Page.
|
|
250
|
-
* @param options - Configuration options
|
|
251
|
-
* @returns The Svelte component instance, or null if target not found / no event
|
|
252
|
-
*/
|
|
253
|
-
export function initEventPage(options: EventPageOptions): SvelteComponentInstance | null;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Initialize the Checkout View
|
|
257
|
-
* @param options - Configuration options
|
|
258
|
-
* @returns The Svelte component instance, or null if target not found or eventId missing
|
|
259
|
-
*/
|
|
260
|
-
export function initCheckoutView(options: CheckoutOptions): SvelteComponentInstance | null;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Alias for initCheckoutView
|
|
264
|
-
*/
|
|
265
|
-
export const initCheckout: typeof initCheckoutView;
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Initialize the Success View
|
|
269
|
-
* @param options - Configuration options
|
|
270
|
-
* @returns The Svelte component instance, or null if target not found
|
|
271
|
-
*/
|
|
272
|
-
export function initSuccessView(options: SuccessViewOptions): SvelteComponentInstance | null;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Alias for initSuccessView
|
|
276
|
-
*/
|
|
277
|
-
export const initSuccess: typeof initSuccessView;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Auto-mount: Automatically finds and mounts calendar to elements with class 'micdrop-calendar-container'
|
|
281
|
-
*/
|
|
282
|
-
export function autoMount(): void;
|
|
283
|
-
|
|
284
|
-
// ============================================================================
|
|
285
|
-
// Runtime Configuration
|
|
286
|
-
// ============================================================================
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Opt-in embed integration settings for a venue site embedding the widget.
|
|
290
|
-
*/
|
|
291
|
-
export interface EmbedConfig {
|
|
292
|
-
/**
|
|
293
|
-
* Emit a 'checkout-complete' postMessage when an order completes. The
|
|
294
|
-
* payload is non-PII: `{ orderId, eventId }`. Default: false.
|
|
295
|
-
*/
|
|
296
|
-
postMessageOnSuccess?: boolean;
|
|
297
|
-
/**
|
|
298
|
-
* REQUIRED concrete origin (e.g. 'https://venue.example') for the
|
|
299
|
-
* 'checkout-complete' message. The message is never posted to '*'; without a
|
|
300
|
-
* concrete absolute origin nothing is sent and a warning is logged.
|
|
301
|
-
*/
|
|
302
|
-
postMessageTargetOrigin?: string | null;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Options for {@link configureVenueCalendar}. All fields are optional — pass
|
|
307
|
-
* only the keys you want to change.
|
|
308
|
-
*/
|
|
309
|
-
export interface ConfigureVenueCalendarOptions {
|
|
310
|
-
/** Called whenever the widget surfaces a caught error (wire into Sentry/Rollbar/etc). */
|
|
311
|
-
onError?: (error: Error, context: { source: string }) => void;
|
|
312
|
-
/** Override the backend origin for multi-region setups. */
|
|
313
|
-
apiBaseUrl?: string;
|
|
314
|
-
/** Request timeout in ms, forwarded to the API client. */
|
|
315
|
-
apiTimeout?: number;
|
|
316
|
-
/** Retry count, forwarded to the API client. */
|
|
317
|
-
apiRetries?: number;
|
|
318
|
-
/** Opt-in embed integration settings (see {@link EmbedConfig}). */
|
|
319
|
-
embed?: EmbedConfig;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Configure the calendar widget at runtime: error reporting, API overrides,
|
|
324
|
-
* and the opt-in embed integration (e.g. the 'checkout-complete' postMessage).
|
|
325
|
-
* @param options - Configuration options
|
|
326
|
-
*/
|
|
327
|
-
export function configureVenueCalendar(options?: ConfigureVenueCalendarOptions): void;
|
|
328
|
-
|
|
329
|
-
// ============================================================================
|
|
330
|
-
// Theme Exports
|
|
331
|
-
// ============================================================================
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Collection of preset themes
|
|
335
|
-
*/
|
|
336
|
-
export const themes: Themes;
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Light theme preset
|
|
340
|
-
*/
|
|
341
|
-
export const lightTheme: ThemeColors;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Dark theme preset
|
|
345
|
-
*/
|
|
346
|
-
export const darkTheme: ThemeColors;
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* High contrast theme preset for accessibility
|
|
350
|
-
*/
|
|
351
|
-
export const highContrastTheme: ThemeColors;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Apply a theme to the calendar widget
|
|
355
|
-
* @param theme - Theme object with HSL color values
|
|
356
|
-
* @param container - Optional container element (defaults to document.documentElement)
|
|
357
|
-
*/
|
|
358
|
-
export function applyTheme(theme: Partial<ThemeColors>, container?: HTMLElement): void;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Generate CSS string for embedding themes
|
|
362
|
-
* @param theme - Theme object
|
|
363
|
-
* @returns CSS string with custom properties
|
|
364
|
-
*/
|
|
365
|
-
export function generateThemeCSS(theme: Partial<ThemeColors>): string;
|
|
366
|
-
|
|
367
|
-
// ============================================================================
|
|
368
|
-
// Svelte Component Exports
|
|
369
|
-
// ============================================================================
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* VenueCalendar Svelte component (CalendarContainer)
|
|
373
|
-
*/
|
|
374
|
-
export const VenueCalendar: any;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Checkout Svelte component
|
|
379
|
-
*/
|
|
380
|
-
export const Checkout: any;
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* CheckoutView alias for Checkout
|
|
384
|
-
*/
|
|
385
|
-
export const CheckoutView: any;
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Success Svelte component
|
|
389
|
-
*/
|
|
390
|
-
export const Success: any;
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* EventPage Svelte component — full event page with DateSelectorGrouped, EventMeta, ScarcityBadge, etc.
|
|
394
|
-
*/
|
|
395
|
-
export const EventPage: any;
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* SeriesPage Svelte component — series landing page with hero, upcoming dates, performers, FAQ sidebar
|
|
399
|
-
*/
|
|
400
|
-
export const SeriesPage: any;
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* SeriesHomeView alias (deprecated — use SeriesPage instead)
|
|
404
|
-
*/
|
|
405
|
-
export const SeriesHomeView: any;
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* CollectionView Svelte component
|
|
409
|
-
*/
|
|
410
|
-
export const CollectionView: any;
|
|
411
|
-
|
|
412
|
-
// ============================================================================
|
|
413
|
-
// Default Export
|
|
414
|
-
// ============================================================================
|
|
415
|
-
|
|
416
|
-
declare const _default: {
|
|
417
|
-
initVenueCalendar: typeof initVenueCalendar;
|
|
418
|
-
initEventPage: typeof initEventPage;
|
|
419
|
-
initCheckoutView: typeof initCheckoutView;
|
|
420
|
-
initCheckout: typeof initCheckoutView;
|
|
421
|
-
initSuccessView: typeof initSuccessView;
|
|
422
|
-
initSuccess: typeof initSuccessView;
|
|
423
|
-
autoMount: typeof autoMount;
|
|
424
|
-
VenueCalendar: any;
|
|
425
|
-
themes: Themes;
|
|
426
|
-
lightTheme: ThemeColors;
|
|
427
|
-
darkTheme: ThemeColors;
|
|
428
|
-
highContrastTheme: ThemeColors;
|
|
429
|
-
applyTheme: typeof applyTheme;
|
|
430
|
-
generateThemeCSS: typeof generateThemeCSS;
|
|
431
|
-
Checkout: any;
|
|
432
|
-
CheckoutView: any;
|
|
433
|
-
Success: any;
|
|
434
|
-
/** @deprecated Use Success instead */
|
|
435
|
-
Sucess: any;
|
|
436
|
-
EventPage: any;
|
|
437
|
-
SeriesPage: any;
|
|
438
|
-
SeriesHomeView: any;
|
|
439
|
-
CollectionView: any;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
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
|
+
icon: string;
|
|
109
|
+
ariaLabel?: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type ViewType = 'list' | 'gallery' | 'calendar';
|
|
113
|
+
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// Component Props Interfaces
|
|
116
|
+
// ============================================================================
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Base options for all init functions
|
|
120
|
+
*/
|
|
121
|
+
export interface BaseInitOptions {
|
|
122
|
+
/** CSS selector or HTMLElement to mount the component */
|
|
123
|
+
target: string | HTMLElement;
|
|
124
|
+
/** The venue ID (optional, default: '1') */
|
|
125
|
+
venueId?: string;
|
|
126
|
+
/** The organization ID (optional, default: '1') */
|
|
127
|
+
organizationId?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Options for initializing the Venue Calendar component
|
|
132
|
+
*/
|
|
133
|
+
export interface CalendarProps extends BaseInitOptions {
|
|
134
|
+
/** Initial view: 'list', 'gallery', or 'calendar' (default: 'calendar') */
|
|
135
|
+
view?: ViewType;
|
|
136
|
+
/** Array of event objects to display */
|
|
137
|
+
events?: EventData[];
|
|
138
|
+
/** Whether to show view switcher (default: true) */
|
|
139
|
+
showViewOptions?: boolean;
|
|
140
|
+
/** Whether to show month navigation (default: true) */
|
|
141
|
+
showMonthSwitcher?: boolean;
|
|
142
|
+
/** Current month store (Svelte writable store) */
|
|
143
|
+
currentMonth?: import('svelte/store').Writable<number>;
|
|
144
|
+
/** Current year store (Svelte writable store) */
|
|
145
|
+
currentYear?: import('svelte/store').Writable<number>;
|
|
146
|
+
/** Handler for navigating to next month */
|
|
147
|
+
handleNext?: () => void;
|
|
148
|
+
/** Handler for navigating to previous month */
|
|
149
|
+
handlePrev?: () => void;
|
|
150
|
+
/** Callback function when an event is clicked */
|
|
151
|
+
onEventClick?: (event: EventData) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Render the show detail / series / collection IN-PLACE on click + deep
|
|
154
|
+
* link instead of navigating the host page (default: true for embeds).
|
|
155
|
+
* Pass false to keep the host responsible for navigation, or supply your
|
|
156
|
+
* own onEventClick to take over click handling entirely.
|
|
157
|
+
*/
|
|
158
|
+
inlineEntityViews?: boolean;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Options for initializing the (inline) Event Page.
|
|
163
|
+
*/
|
|
164
|
+
export interface EventPageOptions extends BaseInitOptions {
|
|
165
|
+
/** The event ID to display (the page self-fetches), or pass rawEvent. */
|
|
166
|
+
eventId?: string | number;
|
|
167
|
+
/** Pre-fetched raw event payload (skips the self-fetch). */
|
|
168
|
+
rawEvent?: any;
|
|
169
|
+
/** Event slug (cosmetic). */
|
|
170
|
+
slug?: string;
|
|
171
|
+
/** Callback when the back control is clicked. */
|
|
172
|
+
onNavigateBack?: () => void;
|
|
173
|
+
/** Callback when proceeding to checkout (cart already created). */
|
|
174
|
+
onNavigateToCart?: (id: string | number, slug: string, rawEvent: any) => void;
|
|
175
|
+
/** Callback when a series occurrence is clicked. */
|
|
176
|
+
onBuyTickets?: (eventId: string | number, slug: string) => void;
|
|
177
|
+
/** i18n label overrides. */
|
|
178
|
+
labels?: Record<string, string>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Success callback data from checkout
|
|
183
|
+
*/
|
|
184
|
+
export interface CheckoutSuccessData {
|
|
185
|
+
orderId?: string;
|
|
186
|
+
eventId?: string;
|
|
187
|
+
event?: EventData;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Options for initializing the Checkout View
|
|
192
|
+
*/
|
|
193
|
+
export interface CheckoutOptions extends BaseInitOptions {
|
|
194
|
+
/** The event ID to display */
|
|
195
|
+
eventId: string;
|
|
196
|
+
/** The event slug (optional) */
|
|
197
|
+
slug?: string;
|
|
198
|
+
/** Array of available tickets (optional) */
|
|
199
|
+
availableTickets?: TicketData[];
|
|
200
|
+
/** Callback when checkout is successful */
|
|
201
|
+
onSuccess?: (data: CheckoutSuccessData) => void;
|
|
202
|
+
/** Callback when navigating to success page */
|
|
203
|
+
onNavigateToSuccess?: (data: CheckoutSuccessData) => void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Options for initializing the Success View
|
|
208
|
+
*/
|
|
209
|
+
export interface SuccessViewOptions extends BaseInitOptions {
|
|
210
|
+
/** The event ID (optional) */
|
|
211
|
+
eventId?: string;
|
|
212
|
+
/** The event slug (optional) */
|
|
213
|
+
slug?: string;
|
|
214
|
+
/** The order ID (optional) */
|
|
215
|
+
orderId?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Alias for CalendarProps for backward compatibility
|
|
220
|
+
*/
|
|
221
|
+
export type InitOptions = CalendarProps;
|
|
222
|
+
|
|
223
|
+
// ============================================================================
|
|
224
|
+
// Svelte Component Instance
|
|
225
|
+
// ============================================================================
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Svelte component instance returned by init functions
|
|
229
|
+
*/
|
|
230
|
+
export interface SvelteComponentInstance {
|
|
231
|
+
/** Destroy the component and clean up */
|
|
232
|
+
$destroy?: () => void;
|
|
233
|
+
/** Internal cleanup for success listener */
|
|
234
|
+
_successCleanup?: () => void;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ============================================================================
|
|
238
|
+
// Exported Functions
|
|
239
|
+
// ============================================================================
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Initialize the Venue Calendar component
|
|
243
|
+
* @param options - Configuration options
|
|
244
|
+
* @returns The Svelte component instance, or null if target not found
|
|
245
|
+
*/
|
|
246
|
+
export function initVenueCalendar(options: CalendarProps): SvelteComponentInstance | null;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Initialize the (inline) Event Page.
|
|
250
|
+
* @param options - Configuration options
|
|
251
|
+
* @returns The Svelte component instance, or null if target not found / no event
|
|
252
|
+
*/
|
|
253
|
+
export function initEventPage(options: EventPageOptions): SvelteComponentInstance | null;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Initialize the Checkout View
|
|
257
|
+
* @param options - Configuration options
|
|
258
|
+
* @returns The Svelte component instance, or null if target not found or eventId missing
|
|
259
|
+
*/
|
|
260
|
+
export function initCheckoutView(options: CheckoutOptions): SvelteComponentInstance | null;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Alias for initCheckoutView
|
|
264
|
+
*/
|
|
265
|
+
export const initCheckout: typeof initCheckoutView;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Initialize the Success View
|
|
269
|
+
* @param options - Configuration options
|
|
270
|
+
* @returns The Svelte component instance, or null if target not found
|
|
271
|
+
*/
|
|
272
|
+
export function initSuccessView(options: SuccessViewOptions): SvelteComponentInstance | null;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Alias for initSuccessView
|
|
276
|
+
*/
|
|
277
|
+
export const initSuccess: typeof initSuccessView;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Auto-mount: Automatically finds and mounts calendar to elements with class 'micdrop-calendar-container'
|
|
281
|
+
*/
|
|
282
|
+
export function autoMount(): void;
|
|
283
|
+
|
|
284
|
+
// ============================================================================
|
|
285
|
+
// Runtime Configuration
|
|
286
|
+
// ============================================================================
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Opt-in embed integration settings for a venue site embedding the widget.
|
|
290
|
+
*/
|
|
291
|
+
export interface EmbedConfig {
|
|
292
|
+
/**
|
|
293
|
+
* Emit a 'checkout-complete' postMessage when an order completes. The
|
|
294
|
+
* payload is non-PII: `{ orderId, eventId }`. Default: false.
|
|
295
|
+
*/
|
|
296
|
+
postMessageOnSuccess?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* REQUIRED concrete origin (e.g. 'https://venue.example') for the
|
|
299
|
+
* 'checkout-complete' message. The message is never posted to '*'; without a
|
|
300
|
+
* concrete absolute origin nothing is sent and a warning is logged.
|
|
301
|
+
*/
|
|
302
|
+
postMessageTargetOrigin?: string | null;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Options for {@link configureVenueCalendar}. All fields are optional — pass
|
|
307
|
+
* only the keys you want to change.
|
|
308
|
+
*/
|
|
309
|
+
export interface ConfigureVenueCalendarOptions {
|
|
310
|
+
/** Called whenever the widget surfaces a caught error (wire into Sentry/Rollbar/etc). */
|
|
311
|
+
onError?: (error: Error, context: { source: string }) => void;
|
|
312
|
+
/** Override the backend origin for multi-region setups. */
|
|
313
|
+
apiBaseUrl?: string;
|
|
314
|
+
/** Request timeout in ms, forwarded to the API client. */
|
|
315
|
+
apiTimeout?: number;
|
|
316
|
+
/** Retry count, forwarded to the API client. */
|
|
317
|
+
apiRetries?: number;
|
|
318
|
+
/** Opt-in embed integration settings (see {@link EmbedConfig}). */
|
|
319
|
+
embed?: EmbedConfig;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Configure the calendar widget at runtime: error reporting, API overrides,
|
|
324
|
+
* and the opt-in embed integration (e.g. the 'checkout-complete' postMessage).
|
|
325
|
+
* @param options - Configuration options
|
|
326
|
+
*/
|
|
327
|
+
export function configureVenueCalendar(options?: ConfigureVenueCalendarOptions): void;
|
|
328
|
+
|
|
329
|
+
// ============================================================================
|
|
330
|
+
// Theme Exports
|
|
331
|
+
// ============================================================================
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Collection of preset themes
|
|
335
|
+
*/
|
|
336
|
+
export const themes: Themes;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Light theme preset
|
|
340
|
+
*/
|
|
341
|
+
export const lightTheme: ThemeColors;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Dark theme preset
|
|
345
|
+
*/
|
|
346
|
+
export const darkTheme: ThemeColors;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* High contrast theme preset for accessibility
|
|
350
|
+
*/
|
|
351
|
+
export const highContrastTheme: ThemeColors;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Apply a theme to the calendar widget
|
|
355
|
+
* @param theme - Theme object with HSL color values
|
|
356
|
+
* @param container - Optional container element (defaults to document.documentElement)
|
|
357
|
+
*/
|
|
358
|
+
export function applyTheme(theme: Partial<ThemeColors>, container?: HTMLElement): void;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Generate CSS string for embedding themes
|
|
362
|
+
* @param theme - Theme object
|
|
363
|
+
* @returns CSS string with custom properties
|
|
364
|
+
*/
|
|
365
|
+
export function generateThemeCSS(theme: Partial<ThemeColors>): string;
|
|
366
|
+
|
|
367
|
+
// ============================================================================
|
|
368
|
+
// Svelte Component Exports
|
|
369
|
+
// ============================================================================
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* VenueCalendar Svelte component (CalendarContainer)
|
|
373
|
+
*/
|
|
374
|
+
export const VenueCalendar: any;
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Checkout Svelte component
|
|
379
|
+
*/
|
|
380
|
+
export const Checkout: any;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* CheckoutView alias for Checkout
|
|
384
|
+
*/
|
|
385
|
+
export const CheckoutView: any;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Success Svelte component
|
|
389
|
+
*/
|
|
390
|
+
export const Success: any;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* EventPage Svelte component — full event page with DateSelectorGrouped, EventMeta, ScarcityBadge, etc.
|
|
394
|
+
*/
|
|
395
|
+
export const EventPage: any;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* SeriesPage Svelte component — series landing page with hero, upcoming dates, performers, FAQ sidebar
|
|
399
|
+
*/
|
|
400
|
+
export const SeriesPage: any;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* SeriesHomeView alias (deprecated — use SeriesPage instead)
|
|
404
|
+
*/
|
|
405
|
+
export const SeriesHomeView: any;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* CollectionView Svelte component
|
|
409
|
+
*/
|
|
410
|
+
export const CollectionView: any;
|
|
411
|
+
|
|
412
|
+
// ============================================================================
|
|
413
|
+
// Default Export
|
|
414
|
+
// ============================================================================
|
|
415
|
+
|
|
416
|
+
declare const _default: {
|
|
417
|
+
initVenueCalendar: typeof initVenueCalendar;
|
|
418
|
+
initEventPage: typeof initEventPage;
|
|
419
|
+
initCheckoutView: typeof initCheckoutView;
|
|
420
|
+
initCheckout: typeof initCheckoutView;
|
|
421
|
+
initSuccessView: typeof initSuccessView;
|
|
422
|
+
initSuccess: typeof initSuccessView;
|
|
423
|
+
autoMount: typeof autoMount;
|
|
424
|
+
VenueCalendar: any;
|
|
425
|
+
themes: Themes;
|
|
426
|
+
lightTheme: ThemeColors;
|
|
427
|
+
darkTheme: ThemeColors;
|
|
428
|
+
highContrastTheme: ThemeColors;
|
|
429
|
+
applyTheme: typeof applyTheme;
|
|
430
|
+
generateThemeCSS: typeof generateThemeCSS;
|
|
431
|
+
Checkout: any;
|
|
432
|
+
CheckoutView: any;
|
|
433
|
+
Success: any;
|
|
434
|
+
/** @deprecated Use Success instead */
|
|
435
|
+
Sucess: any;
|
|
436
|
+
EventPage: any;
|
|
437
|
+
SeriesPage: any;
|
|
438
|
+
SeriesHomeView: any;
|
|
439
|
+
CollectionView: any;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
export default _default;
|