@whop/embedded-components-vanilla-js 0.0.12 → 0.0.13-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,29 @@
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
+
17
+ interface EmptyStateOptions {
18
+ image?: {
19
+ url: string;
20
+ width?: number;
21
+ height?: number;
22
+ };
23
+ title?: string;
24
+ description?: string;
25
+ }
26
+
4
27
  /**
5
28
  * A CSS property value.
6
29
  */
@@ -228,6 +251,425 @@ interface WhopElement<ElementOptions, ElementEvents extends ListenerSignature<El
228
251
  getSnapshot: () => ElementSnapshot;
229
252
  }
230
253
 
254
+ /**
255
+ * Events emitted by the ChatElement.
256
+ *
257
+ * Listen to these events using the `on()` method or by passing callback functions in the options.
258
+ */
259
+ interface ChatElementEvents {
260
+ /**
261
+ * Emitted when an error occurs during element initialization or operation.
262
+ * @param error - The error that occurred
263
+ */
264
+ error: (error: unknown) => void;
265
+ /**
266
+ * Emitted when the element has finished loading and is ready for user interaction.
267
+ * @param element - The element instance
268
+ */
269
+ ready: (element: ChatElement) => void;
270
+ /**
271
+ * Emitted when the element's options are updated via `updateOptions()`.
272
+ * @param options - The updated options object
273
+ */
274
+ optionsUpdated: (options: ChatElementOptions) => void;
275
+ /**
276
+ * Emitted when the element's internal state changes.
277
+ * @param snapshot - The current state snapshot
278
+ */
279
+ snapshot: (snapshot: ChatElementSnapshot) => void;
280
+ /**
281
+ * Emitted when the user clicks on a profile.
282
+ * @param ev - The event containing the `id` in `ev.detail`.
283
+ */
284
+ profileClick: (ev: CustomEvent<{
285
+ id: string;
286
+ }>) => void;
287
+ /**
288
+ * Emitted when the user clicks on a link.
289
+ * @param ev - The event containing the `url` in `ev.detail`.
290
+ */
291
+ linkClick: (ev: CustomEvent<{
292
+ url: string;
293
+ }>) => void;
294
+ /**
295
+ * Emitted when the user sends a message.
296
+ * @param ev - The event containing the `message` in `ev.detail`.
297
+ */
298
+ messageSent: (ev: CustomEvent<{
299
+ content: string;
300
+ }>) => void;
301
+ /**
302
+ * Emitted when the user clicks on an experience mention.
303
+ * @param ev - The event containing the `id` in `ev.detail`.
304
+ */
305
+ experienceClick: (ev: CustomEvent<{
306
+ id: string;
307
+ }>) => void;
308
+ }
309
+ declare const createTypedEvent$1: TypedEventCreatorFn<ChatElementEvents, "profileClick" | "linkClick" | "messageSent" | "experienceClick">;
310
+ type ChatElementEvent = InferEvent<typeof createTypedEvent$1>;
311
+ /**
312
+ * Configuration options for the ChatElement.
313
+ *
314
+ * @example
315
+ * ```typescript
316
+ * const element = session.createElement("chat-element", {
317
+ * channelId: "feed_XXXXXXXXXXXXXX",
318
+ * onReady: (element) => {
319
+ * console.log("Chat element is ready");
320
+ * },
321
+ * });
322
+ * ```
323
+ */
324
+ interface ChatElementOptions {
325
+ /**
326
+ * The ID of the chat channel to connect to.
327
+ */
328
+ channelId: string;
329
+ /**
330
+ * The ID of the message to deep link to.
331
+ */
332
+ deeplinkToPostId?: string;
333
+ /**
334
+ * Disables link navigation.
335
+ * Listen to the `linkClick` event to handle navigation yourself.
336
+ * @default false
337
+ */
338
+ disableNavigation?: boolean;
339
+ /**
340
+ * Custom empty state displayed when there are no messages.
341
+ */
342
+ emptyState?: EmptyStateOptions;
343
+ /**
344
+ * Callback fired when the element has finished loading and is ready for interaction.
345
+ * This is equivalent to listening to the `ready` event.
346
+ * @param element - The element instance
347
+ */
348
+ onReady?: (element: ChatElement) => void;
349
+ /**
350
+ * Callback fired when a chat element event is emitted.
351
+ * @param event - The chat element event
352
+ */
353
+ onEvent?: (event: ChatElementEvent) => void;
354
+ }
355
+ /**
356
+ * Represents the current state of the ChatElement.
357
+ *
358
+ * Use `element.getSnapshot()` to get the current state, or listen to the `snapshot` event for changes.
359
+ */
360
+ interface ChatElementSnapshot {
361
+ /**
362
+ * The current loading state of the element.
363
+ * - `"loading"` - The element is initializing
364
+ * - `"ready"` - The element is fully loaded and interactive
365
+ */
366
+ state: "loading" | "ready";
367
+ }
368
+ /**
369
+ * A UI element that displays a chat interface.
370
+ *
371
+ * @example Basic usage
372
+ * ```typescript
373
+ * // Create the element
374
+ * const element = session.createElement("chat-element", {
375
+ * channelId: "feed_XXXXXXXXXXXXXX",
376
+ * onReady: () => {
377
+ * console.log("Chat element is ready");
378
+ * },
379
+ * });
380
+ *
381
+ * // Mount it to a container
382
+ * element.mount("#chat-container");
383
+ * ```
384
+ *
385
+ * @example Listening to events
386
+ * ```typescript
387
+ * const element = session.createElement("chat-element", {
388
+ * channelId: "feed_XXXXXXXXXXXXXX",
389
+ * });
390
+ *
391
+ * element.on("ready", () => {
392
+ * console.log("Chat element is ready");
393
+ * });
394
+ *
395
+ * element.on("profileClick", (ev) => {
396
+ * console.log("Profile clicked:", ev.detail.id);
397
+ * });
398
+ *
399
+ * element.on("linkClick", (ev) => {
400
+ * console.log("Link clicked:", ev.detail.url);
401
+ * });
402
+ *
403
+ * element.on("messageSent", (ev) => {
404
+ * console.log("Message sent:", ev.detail.content);
405
+ * });
406
+ *
407
+ * element.on("experienceClick", (ev) => {
408
+ * console.log("Experience clicked:", ev.detail.id);
409
+ * });
410
+ *
411
+ * element.mount("#chat-container");
412
+ * ```
413
+ */
414
+ type ChatElement = WhopElement<ChatElementOptions, ChatElementEvents, ChatElementSnapshot>;
415
+
416
+ /**
417
+ * Events emitted by the DmListElement.
418
+ *
419
+ * Listen to these events using the `on()` method or by passing callback functions in the options.
420
+ */
421
+ interface DmsListElementEvents {
422
+ /**
423
+ * Emitted when an error occurs during element initialization or operation.
424
+ * @param error - The error that occurred
425
+ */
426
+ error: (error: unknown) => void;
427
+ /**
428
+ * Emitted when the element has finished loading and is ready for user interaction.
429
+ * @param element - The element instance
430
+ */
431
+ ready: (element: DmsListElement) => void;
432
+ /**
433
+ * Emitted when the element's options are updated via `updateOptions()`.
434
+ * @param options - The updated options object
435
+ */
436
+ optionsUpdated: (options: DmsListElementOptions) => void;
437
+ /**
438
+ * Emitted when the element's internal state changes.
439
+ * @param snapshot - The current state snapshot
440
+ */
441
+ snapshot: (snapshot: DmsListElementSnapshot) => void;
442
+ /**
443
+ * Emitted when the user clicks a channel.
444
+ * @param ev - The event containing the `id` in `ev.detail`.
445
+ */
446
+ channelSelected: (ev: CustomEvent<{
447
+ id: string;
448
+ }>) => void;
449
+ }
450
+ declare const createTypedEvent: TypedEventCreatorFn<DmsListElementEvents, "channelSelected">;
451
+ type DmsListElementEvent = InferEvent<typeof createTypedEvent>;
452
+ /**
453
+ * Configuration options for the DmsListElement.
454
+ *
455
+ * @example
456
+ * ```typescript
457
+ * const element = session.createElement("dms-list-element", {
458
+ * onReady: (element) => {
459
+ * console.log("Dms list element is ready");
460
+ * },
461
+ * });
462
+ * ```
463
+ */
464
+ interface DmsListElementOptions {
465
+ /**
466
+ * The company ID to filter the channels by.
467
+ */
468
+ companyId?: string;
469
+ /**
470
+ * The ID of the currently selected channel.
471
+ */
472
+ selectedChannel?: string;
473
+ /**
474
+ * Custom empty state displayed when there are no channels.
475
+ */
476
+ emptyState?: EmptyStateOptions;
477
+ /**
478
+ * Callback fired when the element has finished loading and is ready for interaction.
479
+ * This is equivalent to listening to the `ready` event.
480
+ * @param element - The element instance
481
+ */
482
+ onReady?: (element: DmsListElement) => void;
483
+ /**
484
+ * Callback fired when a dms list element event is emitted.
485
+ * @param event - The dms list element event
486
+ */
487
+ onEvent?: (event: DmsListElementEvent) => void;
488
+ }
489
+ /**
490
+ * Represents the current state of the DmsListElement.
491
+ *
492
+ * Use `element.getSnapshot()` to get the current state, or listen to the `snapshot` event for changes.
493
+ */
494
+ interface DmsListElementSnapshot {
495
+ /**
496
+ * The current loading state of the element.
497
+ * - `"loading"` - The element is initializing
498
+ * - `"ready"` - The element is fully loaded and interactive
499
+ */
500
+ state: "loading" | "ready";
501
+ }
502
+ /**
503
+ * A UI element that displays a dms list.
504
+ *
505
+ * @example Basic usage
506
+ * ```typescript
507
+ * // Create the element
508
+ * const element = session.createElement("dms-list-element", {
509
+ * onReady: (element) => {
510
+ * console.log("Dms list element is ready");
511
+ * },
512
+ * });
513
+ *
514
+ * // Mount it to a container
515
+ * element.mount("#dms-list-container");
516
+ * ```
517
+ *
518
+ * @example Listening to events
519
+ * ```typescript
520
+ * const element = session.createElement("dms-list-element", {});
521
+ *
522
+ * element.on("ready", () => {
523
+ * console.log("Dms list element is ready");
524
+ * });
525
+ *
526
+ * element.on("channelSelected", (ev) => {
527
+ * console.log("Channel selected:", ev.detail.id);
528
+ * });
529
+ *
530
+ * element.mount("#dms-list-container");
531
+ * ```
532
+ */
533
+ type DmsListElement = WhopElement<DmsListElementOptions, DmsListElementEvents, DmsListElementSnapshot>;
534
+
535
+ type Token = string | Promise<string | null> | null;
536
+ type GetToken = (opts: {
537
+ abortSignal: AbortSignal;
538
+ }) => Token;
539
+
540
+ /** elements types */
541
+
542
+ interface ChatSessionOptions {
543
+ /**
544
+ * The token to use for the session. If a function is provided, it will be called and awaited to get the token.
545
+ * When a function is provided, the token will be refreshed automatically before it expires.
546
+ *
547
+ * 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
548
+ * calling `updateOptions` with a new token.
549
+ *
550
+ * @example
551
+ * ```ts
552
+ * // with a static token
553
+ * async function createChatSession() {
554
+ * const token = await fetch("/api/token")
555
+ * .then(res => res.json())
556
+ * .then(data => data.token)
557
+ * return new ChatSession({ token })
558
+ * }
559
+ *
560
+ * // with a dynamic function
561
+ * function createChatSession() {
562
+ * return new ChatSession({
563
+ * token: () => {
564
+ * return await fetch("/api/token")
565
+ * .then(res => res.json())
566
+ * .then(data => data.token)
567
+ * }
568
+ * })
569
+ * }
570
+ * ```
571
+ */
572
+ token: Token | GetToken;
573
+ }
574
+ interface ExpandedChatSessionOptions extends ChatSessionOptions {
575
+ }
576
+ /**
577
+ * Events emitted by the ChatSession.
578
+ *
579
+ * Listen to these events using the `on()` method.
580
+ */
581
+ interface ChatSessionEvents {
582
+ /**
583
+ * Emitted when the session options are updated via `updateOptions()`.
584
+ * @param options - The updated options object
585
+ */
586
+ optionsUpdated: (options: ExpandedChatSessionOptions) => void;
587
+ /**
588
+ * Emitted when the authentication token is refreshed.
589
+ * @param token - The new token
590
+ */
591
+ tokenRefreshed: (token: string) => void;
592
+ /**
593
+ * Emitted when token refresh fails.
594
+ * @param error - The error that occurred
595
+ */
596
+ tokenRefreshError: (error: unknown) => void;
597
+ /**
598
+ * Emitted when an error occurs during session operation.
599
+ * @param error - The error that occurred
600
+ */
601
+ error: (error: unknown) => void;
602
+ /**
603
+ * Emitted when the session is ready and authenticated.
604
+ */
605
+ ready: () => void;
606
+ }
607
+ type ChatSessionElements = {
608
+ "chat-element": [ChatElementOptions, ChatElement];
609
+ "dms-list-element": [DmsListElementOptions, DmsListElement];
610
+ };
611
+ /**
612
+ * Manages authentication and creates chat elements.
613
+ *
614
+ * @example Basic usage
615
+ * ```typescript
616
+ * const session = whopElements.createChatSession({
617
+ * token: async () => {
618
+ * const response = await fetch("/api/token");
619
+ * const data = await response.json();
620
+ * return data.token;
621
+ * },
622
+ * });
623
+ *
624
+ * session.on("ready", () => {
625
+ * console.log("Session is ready");
626
+ * });
627
+ * ```
628
+ *
629
+ * @example Creating elements
630
+ * ```typescript
631
+ * const chatElement = session.createElement("chat-element", {
632
+ * channelId: "feed_XXXXXXXXXXXXXX",
633
+ * });
634
+ * chatElement.mount("#chat-container");
635
+ * ```
636
+ */
637
+ interface ChatSession extends TypedEmitter<ChatSessionEvents> {
638
+ /**
639
+ * Update the session options after initialization.
640
+ *
641
+ * Changes will be propagated to all active elements.
642
+ *
643
+ * @param options - Partial options object with the values to update
644
+ */
645
+ updateOptions: (options: Partial<ChatSessionOptions>) => void;
646
+ /**
647
+ * Destroy the session and clean up all mounted elements.
648
+ *
649
+ * Call this when you no longer need the session to free up resources.
650
+ */
651
+ destroy: () => void;
652
+ /**
653
+ * Create a new element instance.
654
+ *
655
+ * @param type - The element type (e.g., "chat-element")
656
+ * @param options - Element-specific configuration options
657
+ * @returns The created element instance
658
+ *
659
+ * @example
660
+ * ```typescript
661
+ * const element = session.createElement("chat-element", {
662
+ * channelId: "feed_XXXXXXXXXXXXXX",
663
+ * onReady: () => console.log("Element ready"),
664
+ * });
665
+ * element.mount("#chat-container");
666
+ * ```
667
+ */
668
+ createElement<T extends keyof ChatSessionElements>(type: T | {
669
+ type: T;
670
+ }, options: ChatSessionElements[T][0]): ChatSessionElements[T][1];
671
+ }
672
+
231
673
  /**
232
674
  * Events emitted by the AddPayoutMethodElement.
233
675
  *
@@ -2501,9 +2943,6 @@ interface ModalContainer {
2501
2943
 
2502
2944
  /** elements types */
2503
2945
 
2504
- type GetToken = (opts: {
2505
- abortSignal: AbortSignal;
2506
- }) => Promise<string | null> | string | null;
2507
2946
  interface PayoutsSessionOptions {
2508
2947
  /**
2509
2948
  * The token to use for the session. If a function is provided, it will be called and awaited to get the token.
@@ -2534,7 +2973,7 @@ interface PayoutsSessionOptions {
2534
2973
  * }
2535
2974
  * ```
2536
2975
  */
2537
- token: string | Promise<string | null> | null | GetToken;
2976
+ token: Token | GetToken;
2538
2977
  /**
2539
2978
  * The currency to use in the Elements
2540
2979
  *
@@ -2907,6 +3346,13 @@ interface WhopElements extends TypedEmitter<WhopElementsEvents> {
2907
3346
  * @returns A PayoutsSession instance for creating payout elements
2908
3347
  */
2909
3348
  createPayoutsSession: (options: PayoutsSessionOptions) => PayoutsSession;
3349
+ /**
3350
+ * Create a new chat session for managing chat elements.
3351
+ *
3352
+ * @param options - Configuration options for the chat session
3353
+ * @returns A ChatSession instance for creating chat elements
3354
+ */
3355
+ createChatSession: (options: ChatSessionOptions) => ChatSession;
2910
3356
  /**
2911
3357
  * Update the WhopElements configuration after initialization.
2912
3358
  *
@@ -2934,4 +3380,4 @@ interface WhopElementsEvents {
2934
3380
  optionsUpdated: (options: WhopElementsOptions) => void;
2935
3381
  }
2936
3382
 
2937
- export type { AddPayoutMethodElement, AddPayoutMethodElementOptions, AddPayoutMethodElementSnapshot, Appearance, AutomaticWithdrawElement, AutomaticWithdrawElementOptions, AutomaticWithdrawElementSnapshot, BalanceElement, BalanceElementOptions, BalanceElementSnapshot, BnplReserveBalanceBreakdownElement, BnplReserveBalanceBreakdownElementOptions, BnplReserveBalanceBreakdownElementSnapshot, ChangeAccountCountryElement, ChangeAccountCountryElementOptions, ChangeAccountCountryElementSnapshot, ExpandedPayoutsSessionOptions, GenerateWithdrawalReceiptElement, GenerateWithdrawalReceiptElementOptions, GenerateWithdrawalReceiptElementSnapshot, GetToken, 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 };
3383
+ 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-12.elements.whop.com/";
27
+ const getOrigin = () => "https://0-0-13-beta-10.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-12.elements.whop.com/";
32
- const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-12.elements.whop.com/").toString();
31
+ const ORIGIN = "https://0-0-13-beta-10.elements.whop.com/";
32
+ const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-10.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,mCAAgB,EAAE,SAAS;","names":[]}
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,2CAAgB,EAAE,SAAS;","names":[]}
package/dist/url.mjs CHANGED
@@ -1,7 +1,7 @@
1
- const getOrigin = ()=>"https://0-0-12.elements.whop.com/";
1
+ const getOrigin = ()=>"https://0-0-13-beta-10.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-12.elements.whop.com/";
6
- const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-12.elements.whop.com/").toString();
5
+ const ORIGIN = "https://0-0-13-beta-10.elements.whop.com/";
6
+ const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-10.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,mCAAgB,EAAE,SAAS;","names":[]}
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,2CAAgB,EAAE,SAAS;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whop/embedded-components-vanilla-js",
3
- "version": "0.0.12",
3
+ "version": "0.0.13-beta.10",
4
4
  "description": "Whop Elements loading utility",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",