@whop/embedded-components-vanilla-js 0.0.13-beta.3 → 0.0.13-beta.5

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.
@@ -14,6 +14,16 @@ interface TypedEventCreatorFn<Events, EventKeys extends keyof Events> {
14
14
  }
15
15
  type InferEvent<Fn> = Fn extends TypedEventCreatorFn<infer Events, infer EventKeys> ? TypedEventUnion<Events, EventKeys> : never;
16
16
 
17
+ interface EmptyStateOptions {
18
+ image?: {
19
+ url: string;
20
+ width?: number;
21
+ height?: number;
22
+ };
23
+ title?: string;
24
+ description?: string;
25
+ }
26
+
17
27
  /**
18
28
  * A CSS property value.
19
29
  */
@@ -269,10 +279,10 @@ interface ChatElementEvents {
269
279
  snapshot: (snapshot: ChatElementSnapshot) => void;
270
280
  /**
271
281
  * Emitted when the user clicks on a profile.
272
- * @param ev - The event containing the `username` in `ev.detail`.
282
+ * @param ev - The event containing the `id` in `ev.detail`.
273
283
  */
274
284
  profileClick: (ev: CustomEvent<{
275
- username: string;
285
+ id: string;
276
286
  }>) => void;
277
287
  /**
278
288
  * Emitted when the user clicks on a link.
@@ -288,8 +298,15 @@ interface ChatElementEvents {
288
298
  messageSent: (ev: CustomEvent<{
289
299
  content: string;
290
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;
291
308
  }
292
- declare const createTypedEvent$1: TypedEventCreatorFn<ChatElementEvents, "profileClick" | "linkClick" | "messageSent">;
309
+ declare const createTypedEvent$1: TypedEventCreatorFn<ChatElementEvents, "profileClick" | "linkClick" | "messageSent" | "experienceClick">;
293
310
  type ChatElementEvent = InferEvent<typeof createTypedEvent$1>;
294
311
  /**
295
312
  * Configuration options for the ChatElement.
@@ -313,6 +330,16 @@ interface ChatElementOptions {
313
330
  * The ID of the message to deep link to.
314
331
  */
315
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;
316
343
  /**
317
344
  * Callback fired when the element has finished loading and is ready for interaction.
318
345
  * This is equivalent to listening to the `ready` event.
@@ -366,7 +393,7 @@ interface ChatElementSnapshot {
366
393
  * });
367
394
  *
368
395
  * element.on("profileClick", (ev) => {
369
- * console.log("Profile clicked:", ev.detail.username);
396
+ * console.log("Profile clicked:", ev.detail.id);
370
397
  * });
371
398
  *
372
399
  * element.on("linkClick", (ev) => {
@@ -377,6 +404,10 @@ interface ChatElementSnapshot {
377
404
  * console.log("Message sent:", ev.detail.content);
378
405
  * });
379
406
  *
407
+ * element.on("experienceClick", (ev) => {
408
+ * console.log("Experience clicked:", ev.detail.id);
409
+ * });
410
+ *
380
411
  * element.mount("#chat-container");
381
412
  * ```
382
413
  */
@@ -439,6 +470,10 @@ interface DmsListElementOptions {
439
470
  * The ID of the currently selected channel.
440
471
  */
441
472
  selectedChannel?: string;
473
+ /**
474
+ * Custom empty state displayed when there are no channels.
475
+ */
476
+ emptyState?: EmptyStateOptions;
442
477
  /**
443
478
  * Callback fired when the element has finished loading and is ready for interaction.
444
479
  * This is equivalent to listening to the `ready` event.
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-13-beta-3.elements.whop.com/";
27
+ const getOrigin = () => "https://0-0-13-beta-5.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-13-beta-3.elements.whop.com/";
32
- const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-3.elements.whop.com/").toString();
31
+ const ORIGIN = "https://0-0-13-beta-5.elements.whop.com/";
32
+ const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-5.elements.whop.com/").toString();
33
33
  //# sourceMappingURL=url.js.map
package/dist/url.mjs CHANGED
@@ -1,7 +1,7 @@
1
- const getOrigin = ()=>"https://0-0-13-beta-3.elements.whop.com/";
1
+ const getOrigin = ()=>"https://0-0-13-beta-5.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-13-beta-3.elements.whop.com/";
6
- const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-3.elements.whop.com/").toString();
5
+ const ORIGIN = "https://0-0-13-beta-5.elements.whop.com/";
6
+ const SCRIPT_URL = new URL(`/release/elements.js`, "https://0-0-13-beta-5.elements.whop.com/").toString();
7
7
  export { ORIGIN, SCRIPT_URL, getOrigin, getScriptUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whop/embedded-components-vanilla-js",
3
- "version": "0.0.13-beta.3",
3
+ "version": "0.0.13-beta.5",
4
4
  "description": "Whop Elements loading utility",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",