@whop/embedded-components-vanilla-js 0.0.11 → 0.0.13-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.d.ts +416 -5
- package/dist/url.js +3 -3
- package/dist/url.js.map +1 -1
- package/dist/url.mjs +3 -3
- package/dist/url.mjs.map +1 -1
- package/package.json +1 -1
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
declare const locales: readonly ["en"];
|
|
2
2
|
type I18nSupportedLocale = (typeof locales)[number];
|
|
3
3
|
|
|
4
|
+
type CustomEventDetail<F> = F extends (ev: CustomEvent<infer D>) => void ? D : never;
|
|
5
|
+
type TypedEvent<Events, K extends keyof Events> = (Events[K] extends (...args: infer P) => unknown ? P[0] : never) & {
|
|
6
|
+
type: K;
|
|
7
|
+
};
|
|
8
|
+
type TypedEventUnion<Events, EventKeys extends keyof Events> = {
|
|
9
|
+
[K in EventKeys]: TypedEvent<Events, K>;
|
|
10
|
+
}[EventKeys];
|
|
11
|
+
interface TypedEventCreatorFn<Events, EventKeys extends keyof Events> {
|
|
12
|
+
<K extends EventKeys>(type: K, detail: CustomEventDetail<Events[K]>): TypedEvent<Events, K>;
|
|
13
|
+
_phantom?: [Events, EventKeys];
|
|
14
|
+
}
|
|
15
|
+
type InferEvent<Fn> = Fn extends TypedEventCreatorFn<infer Events, infer EventKeys> ? TypedEventUnion<Events, EventKeys> : never;
|
|
16
|
+
|
|
4
17
|
/**
|
|
5
18
|
* A CSS property value.
|
|
6
19
|
*/
|
|
@@ -228,6 +241,400 @@ interface WhopElement<ElementOptions, ElementEvents extends ListenerSignature<El
|
|
|
228
241
|
getSnapshot: () => ElementSnapshot;
|
|
229
242
|
}
|
|
230
243
|
|
|
244
|
+
/**
|
|
245
|
+
* Events emitted by the ChatElement.
|
|
246
|
+
*
|
|
247
|
+
* Listen to these events using the `on()` method or by passing callback functions in the options.
|
|
248
|
+
*/
|
|
249
|
+
interface ChatElementEvents {
|
|
250
|
+
/**
|
|
251
|
+
* Emitted when an error occurs during element initialization or operation.
|
|
252
|
+
* @param error - The error that occurred
|
|
253
|
+
*/
|
|
254
|
+
error: (error: unknown) => void;
|
|
255
|
+
/**
|
|
256
|
+
* Emitted when the element has finished loading and is ready for user interaction.
|
|
257
|
+
* @param element - The element instance
|
|
258
|
+
*/
|
|
259
|
+
ready: (element: ChatElement) => void;
|
|
260
|
+
/**
|
|
261
|
+
* Emitted when the element's options are updated via `updateOptions()`.
|
|
262
|
+
* @param options - The updated options object
|
|
263
|
+
*/
|
|
264
|
+
optionsUpdated: (options: ChatElementOptions) => void;
|
|
265
|
+
/**
|
|
266
|
+
* Emitted when the element's internal state changes.
|
|
267
|
+
* @param snapshot - The current state snapshot
|
|
268
|
+
*/
|
|
269
|
+
snapshot: (snapshot: ChatElementSnapshot) => void;
|
|
270
|
+
/**
|
|
271
|
+
* Emitted when the user clicks on a profile.
|
|
272
|
+
* @param ev - The event containing the `username` in `ev.detail`.
|
|
273
|
+
*/
|
|
274
|
+
profileClick: (ev: CustomEvent<{
|
|
275
|
+
username: string;
|
|
276
|
+
}>) => void;
|
|
277
|
+
/**
|
|
278
|
+
* Emitted when the user clicks on a link.
|
|
279
|
+
* @param ev - The event containing the `url` in `ev.detail`.
|
|
280
|
+
*/
|
|
281
|
+
linkClick: (ev: CustomEvent<{
|
|
282
|
+
url: string;
|
|
283
|
+
}>) => void;
|
|
284
|
+
/**
|
|
285
|
+
* Emitted when the user sends a message.
|
|
286
|
+
* @param ev - The event containing the `message` in `ev.detail`.
|
|
287
|
+
*/
|
|
288
|
+
messageSent: (ev: CustomEvent<{
|
|
289
|
+
content: string;
|
|
290
|
+
}>) => void;
|
|
291
|
+
}
|
|
292
|
+
declare const createTypedEvent$1: TypedEventCreatorFn<ChatElementEvents, "profileClick" | "linkClick" | "messageSent">;
|
|
293
|
+
type ChatElementEvent = InferEvent<typeof createTypedEvent$1>;
|
|
294
|
+
/**
|
|
295
|
+
* Configuration options for the ChatElement.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```typescript
|
|
299
|
+
* const element = session.createElement("chat-element", {
|
|
300
|
+
* channelId: "feed_XXXXXXXXXXXXXX",
|
|
301
|
+
* onReady: (element) => {
|
|
302
|
+
* console.log("Chat element is ready");
|
|
303
|
+
* },
|
|
304
|
+
* });
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
interface ChatElementOptions {
|
|
308
|
+
/**
|
|
309
|
+
* The ID of the chat channel to connect to.
|
|
310
|
+
*/
|
|
311
|
+
channelId: string;
|
|
312
|
+
/**
|
|
313
|
+
* The ID of the message to deep link to.
|
|
314
|
+
*/
|
|
315
|
+
deeplinkToPostId?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Callback fired when the element has finished loading and is ready for interaction.
|
|
318
|
+
* This is equivalent to listening to the `ready` event.
|
|
319
|
+
* @param element - The element instance
|
|
320
|
+
*/
|
|
321
|
+
onReady?: (element: ChatElement) => void;
|
|
322
|
+
/**
|
|
323
|
+
* Callback fired when a chat element event is emitted.
|
|
324
|
+
* @param event - The chat element event
|
|
325
|
+
*/
|
|
326
|
+
onEvent?: (event: ChatElementEvent) => void;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Represents the current state of the ChatElement.
|
|
330
|
+
*
|
|
331
|
+
* Use `element.getSnapshot()` to get the current state, or listen to the `snapshot` event for changes.
|
|
332
|
+
*/
|
|
333
|
+
interface ChatElementSnapshot {
|
|
334
|
+
/**
|
|
335
|
+
* The current loading state of the element.
|
|
336
|
+
* - `"loading"` - The element is initializing
|
|
337
|
+
* - `"ready"` - The element is fully loaded and interactive
|
|
338
|
+
*/
|
|
339
|
+
state: "loading" | "ready";
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* A UI element that displays a chat interface.
|
|
343
|
+
*
|
|
344
|
+
* @example Basic usage
|
|
345
|
+
* ```typescript
|
|
346
|
+
* // Create the element
|
|
347
|
+
* const element = session.createElement("chat-element", {
|
|
348
|
+
* channelId: "feed_XXXXXXXXXXXXXX",
|
|
349
|
+
* onReady: () => {
|
|
350
|
+
* console.log("Chat element is ready");
|
|
351
|
+
* },
|
|
352
|
+
* });
|
|
353
|
+
*
|
|
354
|
+
* // Mount it to a container
|
|
355
|
+
* element.mount("#chat-container");
|
|
356
|
+
* ```
|
|
357
|
+
*
|
|
358
|
+
* @example Listening to events
|
|
359
|
+
* ```typescript
|
|
360
|
+
* const element = session.createElement("chat-element", {
|
|
361
|
+
* channelId: "feed_XXXXXXXXXXXXXX",
|
|
362
|
+
* });
|
|
363
|
+
*
|
|
364
|
+
* element.on("ready", () => {
|
|
365
|
+
* console.log("Chat element is ready");
|
|
366
|
+
* });
|
|
367
|
+
*
|
|
368
|
+
* element.on("profileClick", (ev) => {
|
|
369
|
+
* console.log("Profile clicked:", ev.detail.username);
|
|
370
|
+
* });
|
|
371
|
+
*
|
|
372
|
+
* element.on("linkClick", (ev) => {
|
|
373
|
+
* console.log("Link clicked:", ev.detail.url);
|
|
374
|
+
* });
|
|
375
|
+
*
|
|
376
|
+
* element.on("messageSent", (ev) => {
|
|
377
|
+
* console.log("Message sent:", ev.detail.content);
|
|
378
|
+
* });
|
|
379
|
+
*
|
|
380
|
+
* element.mount("#chat-container");
|
|
381
|
+
* ```
|
|
382
|
+
*/
|
|
383
|
+
type ChatElement = WhopElement<ChatElementOptions, ChatElementEvents, ChatElementSnapshot>;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Events emitted by the DmListElement.
|
|
387
|
+
*
|
|
388
|
+
* Listen to these events using the `on()` method or by passing callback functions in the options.
|
|
389
|
+
*/
|
|
390
|
+
interface DmsListElementEvents {
|
|
391
|
+
/**
|
|
392
|
+
* Emitted when an error occurs during element initialization or operation.
|
|
393
|
+
* @param error - The error that occurred
|
|
394
|
+
*/
|
|
395
|
+
error: (error: unknown) => void;
|
|
396
|
+
/**
|
|
397
|
+
* Emitted when the element has finished loading and is ready for user interaction.
|
|
398
|
+
* @param element - The element instance
|
|
399
|
+
*/
|
|
400
|
+
ready: (element: DmsListElement) => void;
|
|
401
|
+
/**
|
|
402
|
+
* Emitted when the element's options are updated via `updateOptions()`.
|
|
403
|
+
* @param options - The updated options object
|
|
404
|
+
*/
|
|
405
|
+
optionsUpdated: (options: DmsListElementOptions) => void;
|
|
406
|
+
/**
|
|
407
|
+
* Emitted when the element's internal state changes.
|
|
408
|
+
* @param snapshot - The current state snapshot
|
|
409
|
+
*/
|
|
410
|
+
snapshot: (snapshot: DmsListElementSnapshot) => void;
|
|
411
|
+
/**
|
|
412
|
+
* Emitted when the user clicks a channel.
|
|
413
|
+
* @param ev - The event containing the `id` in `ev.detail`.
|
|
414
|
+
*/
|
|
415
|
+
channelSelected: (ev: CustomEvent<{
|
|
416
|
+
id: string;
|
|
417
|
+
}>) => void;
|
|
418
|
+
}
|
|
419
|
+
declare const createTypedEvent: TypedEventCreatorFn<DmsListElementEvents, "channelSelected">;
|
|
420
|
+
type DmsListElementEvent = InferEvent<typeof createTypedEvent>;
|
|
421
|
+
/**
|
|
422
|
+
* Configuration options for the DmsListElement.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```typescript
|
|
426
|
+
* const element = session.createElement("dms-list-element", {
|
|
427
|
+
* onReady: (element) => {
|
|
428
|
+
* console.log("Dms list element is ready");
|
|
429
|
+
* },
|
|
430
|
+
* });
|
|
431
|
+
* ```
|
|
432
|
+
*/
|
|
433
|
+
interface DmsListElementOptions {
|
|
434
|
+
/**
|
|
435
|
+
* The company ID to filter the channels by.
|
|
436
|
+
*/
|
|
437
|
+
companyId?: string;
|
|
438
|
+
/**
|
|
439
|
+
* The ID of the currently selected channel.
|
|
440
|
+
*/
|
|
441
|
+
selectedChannel?: string;
|
|
442
|
+
/**
|
|
443
|
+
* Callback fired when the element has finished loading and is ready for interaction.
|
|
444
|
+
* This is equivalent to listening to the `ready` event.
|
|
445
|
+
* @param element - The element instance
|
|
446
|
+
*/
|
|
447
|
+
onReady?: (element: DmsListElement) => void;
|
|
448
|
+
/**
|
|
449
|
+
* Callback fired when a dms list element event is emitted.
|
|
450
|
+
* @param event - The dms list element event
|
|
451
|
+
*/
|
|
452
|
+
onEvent?: (event: DmsListElementEvent) => void;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Represents the current state of the DmsListElement.
|
|
456
|
+
*
|
|
457
|
+
* Use `element.getSnapshot()` to get the current state, or listen to the `snapshot` event for changes.
|
|
458
|
+
*/
|
|
459
|
+
interface DmsListElementSnapshot {
|
|
460
|
+
/**
|
|
461
|
+
* The current loading state of the element.
|
|
462
|
+
* - `"loading"` - The element is initializing
|
|
463
|
+
* - `"ready"` - The element is fully loaded and interactive
|
|
464
|
+
*/
|
|
465
|
+
state: "loading" | "ready";
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* A UI element that displays a dms list.
|
|
469
|
+
*
|
|
470
|
+
* @example Basic usage
|
|
471
|
+
* ```typescript
|
|
472
|
+
* // Create the element
|
|
473
|
+
* const element = session.createElement("dms-list-element", {
|
|
474
|
+
* onReady: (element) => {
|
|
475
|
+
* console.log("Dms list element is ready");
|
|
476
|
+
* },
|
|
477
|
+
* });
|
|
478
|
+
*
|
|
479
|
+
* // Mount it to a container
|
|
480
|
+
* element.mount("#dms-list-container");
|
|
481
|
+
* ```
|
|
482
|
+
*
|
|
483
|
+
* @example Listening to events
|
|
484
|
+
* ```typescript
|
|
485
|
+
* const element = session.createElement("dms-list-element", {});
|
|
486
|
+
*
|
|
487
|
+
* element.on("ready", () => {
|
|
488
|
+
* console.log("Dms list element is ready");
|
|
489
|
+
* });
|
|
490
|
+
*
|
|
491
|
+
* element.on("channelSelected", (ev) => {
|
|
492
|
+
* console.log("Channel selected:", ev.detail.id);
|
|
493
|
+
* });
|
|
494
|
+
*
|
|
495
|
+
* element.mount("#dms-list-container");
|
|
496
|
+
* ```
|
|
497
|
+
*/
|
|
498
|
+
type DmsListElement = WhopElement<DmsListElementOptions, DmsListElementEvents, DmsListElementSnapshot>;
|
|
499
|
+
|
|
500
|
+
type Token = string | Promise<string | null> | null;
|
|
501
|
+
type GetToken = (opts: {
|
|
502
|
+
abortSignal: AbortSignal;
|
|
503
|
+
}) => Token;
|
|
504
|
+
|
|
505
|
+
/** elements types */
|
|
506
|
+
|
|
507
|
+
interface ChatSessionOptions {
|
|
508
|
+
/**
|
|
509
|
+
* The token to use for the session. If a function is provided, it will be called and awaited to get the token.
|
|
510
|
+
* When a function is provided, the token will be refreshed automatically before it expires.
|
|
511
|
+
*
|
|
512
|
+
* if a string is provided, it will be used as the token and not refreshed automatically. However you can update the token at runtime by
|
|
513
|
+
* calling `updateOptions` with a new token.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```ts
|
|
517
|
+
* // with a static token
|
|
518
|
+
* async function createChatSession() {
|
|
519
|
+
* const token = await fetch("/api/token")
|
|
520
|
+
* .then(res => res.json())
|
|
521
|
+
* .then(data => data.token)
|
|
522
|
+
* return new ChatSession({ token })
|
|
523
|
+
* }
|
|
524
|
+
*
|
|
525
|
+
* // with a dynamic function
|
|
526
|
+
* function createChatSession() {
|
|
527
|
+
* return new ChatSession({
|
|
528
|
+
* token: () => {
|
|
529
|
+
* return await fetch("/api/token")
|
|
530
|
+
* .then(res => res.json())
|
|
531
|
+
* .then(data => data.token)
|
|
532
|
+
* }
|
|
533
|
+
* })
|
|
534
|
+
* }
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
token: Token | GetToken;
|
|
538
|
+
}
|
|
539
|
+
interface ExpandedChatSessionOptions extends ChatSessionOptions {
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Events emitted by the ChatSession.
|
|
543
|
+
*
|
|
544
|
+
* Listen to these events using the `on()` method.
|
|
545
|
+
*/
|
|
546
|
+
interface ChatSessionEvents {
|
|
547
|
+
/**
|
|
548
|
+
* Emitted when the session options are updated via `updateOptions()`.
|
|
549
|
+
* @param options - The updated options object
|
|
550
|
+
*/
|
|
551
|
+
optionsUpdated: (options: ExpandedChatSessionOptions) => void;
|
|
552
|
+
/**
|
|
553
|
+
* Emitted when the authentication token is refreshed.
|
|
554
|
+
* @param token - The new token
|
|
555
|
+
*/
|
|
556
|
+
tokenRefreshed: (token: string) => void;
|
|
557
|
+
/**
|
|
558
|
+
* Emitted when token refresh fails.
|
|
559
|
+
* @param error - The error that occurred
|
|
560
|
+
*/
|
|
561
|
+
tokenRefreshError: (error: unknown) => void;
|
|
562
|
+
/**
|
|
563
|
+
* Emitted when an error occurs during session operation.
|
|
564
|
+
* @param error - The error that occurred
|
|
565
|
+
*/
|
|
566
|
+
error: (error: unknown) => void;
|
|
567
|
+
/**
|
|
568
|
+
* Emitted when the session is ready and authenticated.
|
|
569
|
+
*/
|
|
570
|
+
ready: () => void;
|
|
571
|
+
}
|
|
572
|
+
type ChatSessionElements = {
|
|
573
|
+
"chat-element": [ChatElementOptions, ChatElement];
|
|
574
|
+
"dms-list-element": [DmsListElementOptions, DmsListElement];
|
|
575
|
+
};
|
|
576
|
+
/**
|
|
577
|
+
* Manages authentication and creates chat elements.
|
|
578
|
+
*
|
|
579
|
+
* @example Basic usage
|
|
580
|
+
* ```typescript
|
|
581
|
+
* const session = whopElements.createChatSession({
|
|
582
|
+
* token: async () => {
|
|
583
|
+
* const response = await fetch("/api/token");
|
|
584
|
+
* const data = await response.json();
|
|
585
|
+
* return data.token;
|
|
586
|
+
* },
|
|
587
|
+
* });
|
|
588
|
+
*
|
|
589
|
+
* session.on("ready", () => {
|
|
590
|
+
* console.log("Session is ready");
|
|
591
|
+
* });
|
|
592
|
+
* ```
|
|
593
|
+
*
|
|
594
|
+
* @example Creating elements
|
|
595
|
+
* ```typescript
|
|
596
|
+
* const chatElement = session.createElement("chat-element", {
|
|
597
|
+
* channelId: "feed_XXXXXXXXXXXXXX",
|
|
598
|
+
* });
|
|
599
|
+
* chatElement.mount("#chat-container");
|
|
600
|
+
* ```
|
|
601
|
+
*/
|
|
602
|
+
interface ChatSession extends TypedEmitter<ChatSessionEvents> {
|
|
603
|
+
/**
|
|
604
|
+
* Update the session options after initialization.
|
|
605
|
+
*
|
|
606
|
+
* Changes will be propagated to all active elements.
|
|
607
|
+
*
|
|
608
|
+
* @param options - Partial options object with the values to update
|
|
609
|
+
*/
|
|
610
|
+
updateOptions: (options: Partial<ChatSessionOptions>) => void;
|
|
611
|
+
/**
|
|
612
|
+
* Destroy the session and clean up all mounted elements.
|
|
613
|
+
*
|
|
614
|
+
* Call this when you no longer need the session to free up resources.
|
|
615
|
+
*/
|
|
616
|
+
destroy: () => void;
|
|
617
|
+
/**
|
|
618
|
+
* Create a new element instance.
|
|
619
|
+
*
|
|
620
|
+
* @param type - The element type (e.g., "chat-element")
|
|
621
|
+
* @param options - Element-specific configuration options
|
|
622
|
+
* @returns The created element instance
|
|
623
|
+
*
|
|
624
|
+
* @example
|
|
625
|
+
* ```typescript
|
|
626
|
+
* const element = session.createElement("chat-element", {
|
|
627
|
+
* channelId: "feed_XXXXXXXXXXXXXX",
|
|
628
|
+
* onReady: () => console.log("Element ready"),
|
|
629
|
+
* });
|
|
630
|
+
* element.mount("#chat-container");
|
|
631
|
+
* ```
|
|
632
|
+
*/
|
|
633
|
+
createElement<T extends keyof ChatSessionElements>(type: T | {
|
|
634
|
+
type: T;
|
|
635
|
+
}, options: ChatSessionElements[T][0]): ChatSessionElements[T][1];
|
|
636
|
+
}
|
|
637
|
+
|
|
231
638
|
/**
|
|
232
639
|
* Events emitted by the AddPayoutMethodElement.
|
|
233
640
|
*
|
|
@@ -2501,9 +2908,6 @@ interface ModalContainer {
|
|
|
2501
2908
|
|
|
2502
2909
|
/** elements types */
|
|
2503
2910
|
|
|
2504
|
-
type GetToken = (opts: {
|
|
2505
|
-
abortSignal: AbortSignal;
|
|
2506
|
-
}) => Promise<string | null> | string | null;
|
|
2507
2911
|
interface PayoutsSessionOptions {
|
|
2508
2912
|
/**
|
|
2509
2913
|
* The token to use for the session. If a function is provided, it will be called and awaited to get the token.
|
|
@@ -2534,7 +2938,7 @@ interface PayoutsSessionOptions {
|
|
|
2534
2938
|
* }
|
|
2535
2939
|
* ```
|
|
2536
2940
|
*/
|
|
2537
|
-
token:
|
|
2941
|
+
token: Token | GetToken;
|
|
2538
2942
|
/**
|
|
2539
2943
|
* The currency to use in the Elements
|
|
2540
2944
|
*
|
|
@@ -2907,6 +3311,13 @@ interface WhopElements extends TypedEmitter<WhopElementsEvents> {
|
|
|
2907
3311
|
* @returns A PayoutsSession instance for creating payout elements
|
|
2908
3312
|
*/
|
|
2909
3313
|
createPayoutsSession: (options: PayoutsSessionOptions) => PayoutsSession;
|
|
3314
|
+
/**
|
|
3315
|
+
* Create a new chat session for managing chat elements.
|
|
3316
|
+
*
|
|
3317
|
+
* @param options - Configuration options for the chat session
|
|
3318
|
+
* @returns A ChatSession instance for creating chat elements
|
|
3319
|
+
*/
|
|
3320
|
+
createChatSession: (options: ChatSessionOptions) => ChatSession;
|
|
2910
3321
|
/**
|
|
2911
3322
|
* Update the WhopElements configuration after initialization.
|
|
2912
3323
|
*
|
|
@@ -2934,4 +3345,4 @@ interface WhopElementsEvents {
|
|
|
2934
3345
|
optionsUpdated: (options: WhopElementsOptions) => void;
|
|
2935
3346
|
}
|
|
2936
3347
|
|
|
2937
|
-
export type { AddPayoutMethodElement, AddPayoutMethodElementOptions, AddPayoutMethodElementSnapshot, Appearance, AutomaticWithdrawElement, AutomaticWithdrawElementOptions, AutomaticWithdrawElementSnapshot, BalanceElement, BalanceElementOptions, BalanceElementSnapshot, BnplReserveBalanceBreakdownElement, BnplReserveBalanceBreakdownElementOptions, BnplReserveBalanceBreakdownElementSnapshot, ChangeAccountCountryElement, ChangeAccountCountryElementOptions, ChangeAccountCountryElementSnapshot, ExpandedPayoutsSessionOptions, GenerateWithdrawalReceiptElement, GenerateWithdrawalReceiptElementOptions, GenerateWithdrawalReceiptElementSnapshot,
|
|
3348
|
+
export type { AddPayoutMethodElement, AddPayoutMethodElementOptions, AddPayoutMethodElementSnapshot, Appearance, AutomaticWithdrawElement, AutomaticWithdrawElementOptions, AutomaticWithdrawElementSnapshot, BalanceElement, BalanceElementOptions, BalanceElementSnapshot, BnplReserveBalanceBreakdownElement, BnplReserveBalanceBreakdownElementOptions, BnplReserveBalanceBreakdownElementSnapshot, ChangeAccountCountryElement, ChangeAccountCountryElementOptions, ChangeAccountCountryElementSnapshot, ChatElement, ChatElementEvent, ChatElementOptions, ChatElementSnapshot, ChatSession, ChatSessionElements, ChatSessionEvents, ChatSessionOptions, DmsListElement, DmsListElementEvent, DmsListElementOptions, DmsListElementSnapshot, ExpandedChatSessionOptions, ExpandedPayoutsSessionOptions, GenerateWithdrawalReceiptElement, GenerateWithdrawalReceiptElementOptions, GenerateWithdrawalReceiptElementSnapshot, I18nSupportedLocale, PayoutsSession, PayoutsSessionElements, PayoutsSessionEvents, PayoutsSessionOptions, RegularReserveBalanceBreakdownElement, RegularReserveBalanceBreakdownElementOptions, RegularReserveBalanceBreakdownElementSnapshot, ResetAccountElement, ResetAccountElementOptions, ResetAccountElementSnapshot, StatusBannerElement, StatusBannerElementOptions, StatusBannerElementSnapshot, StatusBannerType, TotalBalanceBreakdownElement, TotalBalanceBreakdownElementOptions, TotalBalanceBreakdownElementSnapshot, VerifyElement, VerifyElementOptions, VerifyElementSnapshot, WhopElement, WhopElements, WhopElementsConstructor, WhopElementsEnvironment, WhopElementsEvents, WhopElementsOptions, WithdrawButtonElement, WithdrawButtonElementOptions, WithdrawElement, WithdrawElementOptions, WithdrawElementSnapshot, WithdrawalBreakdownElement, WithdrawalBreakdownElementOptions, WithdrawalBreakdownElementSnapshot, WithdrawalsElement, WithdrawalsElementOptions, WithdrawalsElementSnapshot };
|
package/dist/url.js
CHANGED
|
@@ -24,10 +24,10 @@ __export(url_exports, {
|
|
|
24
24
|
getScriptUrl: () => getScriptUrl
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(url_exports);
|
|
27
|
-
const getOrigin = () => "https://0-0-
|
|
27
|
+
const getOrigin = () => "https://0-0-13-beta-2.elements.whop.com/";
|
|
28
28
|
const getScriptUrl = () => {
|
|
29
29
|
return new URL(`/release/elements.js`, getOrigin()).toString();
|
|
30
30
|
};
|
|
31
|
-
const ORIGIN = "https://0-0-
|
|
32
|
-
const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-
|
|
31
|
+
const ORIGIN = "https://0-0-13-beta-2.elements.whop.com/";
|
|
32
|
+
const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-2.elements.whop.com/").toString();
|
|
33
33
|
//# sourceMappingURL=url.js.map
|
package/dist/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/url.ts"],"sourcesContent":["declare const _ELEMENTS_ORIGIN: string;\n\nexport const getOrigin = (): string => _ELEMENTS_ORIGIN;\n\nexport const getScriptUrl = (): string => {\n\treturn new URL(`/release/elements.js`, getOrigin()).toString();\n};\n\n// Backwards compatibility exports\nexport const ORIGIN = _ELEMENTS_ORIGIN;\nexport const SCRIPT_URL = new URL(`/release/elements.js`, _ELEMENTS_ORIGIN).toString();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,YAAY,MAAc;AAEhC,MAAM,eAAe,MAAc;AACzC,SAAO,IAAI,IAAI,wBAAwB,UAAU,CAAC,EAAE,SAAS;AAC9D;AAGO,MAAM,SAAS;AACf,MAAM,aAAa,IAAI,IAAI,wBAAwB,
|
|
1
|
+
{"version":3,"sources":["../src/url.ts"],"sourcesContent":["declare const _ELEMENTS_ORIGIN: string;\n\nexport const getOrigin = (): string => _ELEMENTS_ORIGIN;\n\nexport const getScriptUrl = (): string => {\n\treturn new URL(`/release/elements.js`, getOrigin()).toString();\n};\n\n// Backwards compatibility exports\nexport const ORIGIN = _ELEMENTS_ORIGIN;\nexport const SCRIPT_URL = new URL(`/release/elements.js`, _ELEMENTS_ORIGIN).toString();\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,YAAY,MAAc;AAEhC,MAAM,eAAe,MAAc;AACzC,SAAO,IAAI,IAAI,wBAAwB,UAAU,CAAC,EAAE,SAAS;AAC9D;AAGO,MAAM,SAAS;AACf,MAAM,aAAa,IAAI,IAAI,wBAAwB,0CAAgB,EAAE,SAAS;","names":[]}
|
package/dist/url.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const getOrigin = ()=>"https://0-0-
|
|
1
|
+
const getOrigin = ()=>"https://0-0-13-beta-2.elements.whop.com/";
|
|
2
2
|
const getScriptUrl = ()=>{
|
|
3
3
|
return new URL(`/release/elements.js`, getOrigin()).toString();
|
|
4
4
|
};
|
|
5
|
-
const ORIGIN = "https://0-0-
|
|
6
|
-
const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-
|
|
5
|
+
const ORIGIN = "https://0-0-13-beta-2.elements.whop.com/";
|
|
6
|
+
const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-2.elements.whop.com/").toString();
|
|
7
7
|
export { ORIGIN, SCRIPT_URL, getOrigin, getScriptUrl };
|
package/dist/url.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/url.ts"],"sourcesContent":["declare const _ELEMENTS_ORIGIN: string;\n\nexport const getOrigin = (): string => _ELEMENTS_ORIGIN;\n\nexport const getScriptUrl = (): string => {\n\treturn new URL(`/release/elements.js`, getOrigin()).toString();\n};\n\n// Backwards compatibility exports\nexport const ORIGIN = _ELEMENTS_ORIGIN;\nexport const SCRIPT_URL = new URL(`/release/elements.js`, _ELEMENTS_ORIGIN).toString();\n"],"mappings":"AAEO,MAAM,YAAY,MAAc;AAEhC,MAAM,eAAe,MAAc;AACzC,SAAO,IAAI,IAAI,wBAAwB,UAAU,CAAC,EAAE,SAAS;AAC9D;AAGO,MAAM,SAAS;AACf,MAAM,aAAa,IAAI,IAAI,wBAAwB,
|
|
1
|
+
{"version":3,"sources":["../src/url.ts"],"sourcesContent":["declare const _ELEMENTS_ORIGIN: string;\n\nexport const getOrigin = (): string => _ELEMENTS_ORIGIN;\n\nexport const getScriptUrl = (): string => {\n\treturn new URL(`/release/elements.js`, getOrigin()).toString();\n};\n\n// Backwards compatibility exports\nexport const ORIGIN = _ELEMENTS_ORIGIN;\nexport const SCRIPT_URL = new URL(`/release/elements.js`, _ELEMENTS_ORIGIN).toString();\n"],"mappings":"AAEO,MAAM,YAAY,MAAc;AAEhC,MAAM,eAAe,MAAc;AACzC,SAAO,IAAI,IAAI,wBAAwB,UAAU,CAAC,EAAE,SAAS;AAC9D;AAGO,MAAM,SAAS;AACf,MAAM,aAAa,IAAI,IAAI,wBAAwB,0CAAgB,EAAE,SAAS;","names":[]}
|