@linktr.ee/messaging-react 1.28.0-rc-1776225927 → 1.28.0-rc-1776231821

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.
Files changed (49) hide show
  1. package/dist/{Creator-D38dWn2X.js → Creator-BFpHsh2u.js} +23 -23
  2. package/dist/Creator-BFpHsh2u.js.map +1 -0
  3. package/dist/MediaPlayer-DXz4IBLx.js +313 -0
  4. package/dist/MediaPlayer-DXz4IBLx.js.map +1 -0
  5. package/dist/{Visitor-BG-9-3HU.js → Visitor-C1Fcrgd6.js} +5 -5
  6. package/dist/Visitor-C1Fcrgd6.js.map +1 -0
  7. package/dist/assets/index.css +1 -1
  8. package/dist/index.d.ts +8 -12
  9. package/dist/index.js +27 -35
  10. package/dist/index.js.map +1 -1
  11. package/package.json +1 -2
  12. package/src/components/CustomMessage/index.tsx +0 -1
  13. package/src/components/LockedAttachment/components/Creator.tsx +2 -8
  14. package/src/components/LockedAttachment/components/MediaPlayer.tsx +50 -28
  15. package/src/components/LockedAttachment/components/Visitor.tsx +3 -6
  16. package/src/components/LockedAttachment/index.tsx +7 -7
  17. package/src/components/LockedAttachment/types.ts +0 -3
  18. package/dist/Creator-D38dWn2X.js.map +0 -1
  19. package/dist/MediaPlayer-DE9MC6k6.js +0 -599
  20. package/dist/MediaPlayer-DE9MC6k6.js.map +0 -1
  21. package/dist/Preview-DqAv16NS.js +0 -87
  22. package/dist/Preview-DqAv16NS.js.map +0 -1
  23. package/dist/Visitor-BG-9-3HU.js.map +0 -1
  24. package/dist/dash.all.min-Duv4lvGS.js +0 -18858
  25. package/dist/dash.all.min-Duv4lvGS.js.map +0 -1
  26. package/dist/hls-Bogc7CBn.js +0 -21710
  27. package/dist/hls-Bogc7CBn.js.map +0 -1
  28. package/dist/index-Da-xN4Yq.js +0 -16142
  29. package/dist/index-Da-xN4Yq.js.map +0 -1
  30. package/dist/index-Dj9rqWcU.js +0 -69
  31. package/dist/index-Dj9rqWcU.js.map +0 -1
  32. package/dist/mixin-B6jYfIcp.js +0 -808
  33. package/dist/mixin-B6jYfIcp.js.map +0 -1
  34. package/dist/react-BxlQMOfz.js +0 -419
  35. package/dist/react-BxlQMOfz.js.map +0 -1
  36. package/dist/react-COAP-MIW.js +0 -377
  37. package/dist/react-COAP-MIW.js.map +0 -1
  38. package/dist/react-Cn4WlMcl.js +0 -3108
  39. package/dist/react-Cn4WlMcl.js.map +0 -1
  40. package/dist/react-CwTJArKY.js +0 -459
  41. package/dist/react-CwTJArKY.js.map +0 -1
  42. package/dist/react-DkfS_atT.js +0 -373
  43. package/dist/react-DkfS_atT.js.map +0 -1
  44. package/dist/react-Pea5fum1.js +0 -286
  45. package/dist/react-Pea5fum1.js.map +0 -1
  46. package/dist/react-RiBbsUDd.js +0 -534
  47. package/dist/react-RiBbsUDd.js.map +0 -1
  48. package/dist/react-dS1WBxxz.js +0 -238
  49. package/dist/react-dS1WBxxz.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -230,8 +230,6 @@ export declare interface ChannelViewProps {
230
230
  }
231
231
 
232
232
  declare interface CreatorCardProps extends LockedAttachmentBaseProps {
233
- title?: string;
234
- /** When true, shows interactive media preview (composing state). When false/omitted, shows static thumbnail (sent/sold state). */
235
233
  isPreview?: boolean;
236
234
  placeholderTitle?: string;
237
235
  placeholderAmountText?: string;
@@ -277,24 +275,17 @@ export declare const formatRelativeTime: (date: Date) => string;
277
275
 
278
276
  export declare const LockedAttachment: (props: LockedAttachmentProps) => JSX_2.Element;
279
277
 
280
- /** Shared fields for creator and visitor locked-attachment cards (internal). */
281
278
  declare interface LockedAttachmentBaseProps {
282
279
  title?: string;
283
280
  mimeType?: string;
284
- /** Preview image. Video/image: pass blurred version. Audio/document: pass unblurred version. */
285
281
  thumbnail?: string;
286
- /** Unlocked media URL. Undefined while locked or pending unlock. */
287
282
  source?: string;
288
283
  detail?: string;
289
284
  amountText?: string;
290
285
  paymentStatus?: PaymentStatus;
291
286
  }
292
287
 
293
- export declare type LockedAttachmentProps = ({
294
- isCreator: true;
295
- } & CreatorCardProps) | ({
296
- isCreator?: false;
297
- } & VisitorCardProps);
288
+ export declare type LockedAttachmentProps = (CreatorCardProps & Never<VisitorCardProps, 'onUnlock' | 'onDownload'>) | (VisitorCardProps & Never<CreatorCardProps, 'isPreview' | 'placeholderTitle' | 'placeholderAmountText' | 'onDismiss'>);
298
289
 
299
290
  export declare interface LockedAttachmentSource {
300
291
  source: string;
@@ -429,6 +420,10 @@ export declare interface MessagingShellProps extends ChannelViewPassthroughProps
429
420
  renderMessagePreview?: (message: LocalMessage | undefined, defaultPreview?: string) => React.ReactNode;
430
421
  }
431
422
 
423
+ declare type Never<T, K extends keyof T = keyof T> = {
424
+ [P in K]?: never;
425
+ };
426
+
432
427
  /**
433
428
  * Generic participant interface for different host environments
434
429
  */
@@ -523,14 +518,15 @@ export declare const useParticipants: (participantSource: ParticipantSource, opt
523
518
  };
524
519
 
525
520
  declare interface VisitorCardProps extends LockedAttachmentBaseProps {
526
- title?: string;
527
521
  /**
528
522
  * Called when the visitor clicks Unlock. Return the resolved source URL.
529
523
  * The component manages loading state and sets source internally on resolution.
530
524
  * Omit to hide the Unlock button.
531
525
  */
532
526
  onUnlock?: () => Promise<LockedAttachmentSource>;
533
- /** Called when the visitor clicks Download on an unlocked card. */
527
+ /**
528
+ * Called when the visitor clicks Download on an unlocked card.
529
+ */
534
530
  onDownload?: () => void;
535
531
  }
536
532
 
package/dist/index.js CHANGED
@@ -620,7 +620,7 @@ const bs = ({
620
620
  customProfileContent: N,
621
621
  customChannelActions: S
622
622
  }) => {
623
- var D, $, z, ee, le, ie, ce;
623
+ var D, G, z, ee, le, ie, ce;
624
624
  const { service: m, debug: I } = Me(), [o, v] = T(!1), [k, y] = T(!1), [w, _] = T(!1), R = U(async () => {
625
625
  var A;
626
626
  if (!(!m || !((A = n == null ? void 0 : n.user) != null && A.id)))
@@ -687,7 +687,7 @@ const bs = ({
687
687
  );
688
688
  };
689
689
  if (!n) return null;
690
- const C = (($ = n.user) == null ? void 0 : $.name) || ((z = n.user) == null ? void 0 : z.id) || "Unknown member", p = (ee = n.user) == null ? void 0 : ee.image, O = (le = n.user) == null ? void 0 : le.email, q = (ie = n.user) == null ? void 0 : ie.username, Z = O || (q ? `linktr.ee/${q}` : void 0), Q = ((ce = n.user) == null ? void 0 : ce.id) || "unknown";
690
+ const C = ((G = n.user) == null ? void 0 : G.name) || ((z = n.user) == null ? void 0 : z.id) || "Unknown member", p = (ee = n.user) == null ? void 0 : ee.image, O = (le = n.user) == null ? void 0 : le.email, q = (ie = n.user) == null ? void 0 : ie.username, Z = O || (q ? `linktr.ee/${q}` : void 0), Q = ((ce = n.user) == null ? void 0 : ce.id) || "unknown";
691
691
  return (
692
692
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
693
693
  /* @__PURE__ */ e(
@@ -821,20 +821,13 @@ function ps(t) {
821
821
  }, [s, n == null ? void 0 : n.userID, t.id, r]);
822
822
  return { selected: r, voteUp: l, voteDown: d };
823
823
  }
824
- const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => import("./Visitor-BG-9-3HU.js")), Ze = () => /* @__PURE__ */ e(
824
+ const ys = F.lazy(() => import("./Creator-BFpHsh2u.js")), vs = F.lazy(() => import("./Visitor-C1Fcrgd6.js")), Ze = () => /* @__PURE__ */ e(
825
825
  "div",
826
826
  {
827
827
  className: "w-[280px] min-h-[200px] animate-pulse rounded-3xl bg-black/[0.06] shadow-[0px_0px_0px_1px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04)]",
828
828
  "aria-hidden": !0
829
829
  }
830
- ), ws = (t) => {
831
- if (t.isCreator) {
832
- const { isCreator: r, ...l } = t;
833
- return /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Ze, {}), children: /* @__PURE__ */ e(ys, { ...l }) });
834
- }
835
- const { isCreator: s, ...n } = t;
836
- return /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Ze, {}), children: /* @__PURE__ */ e(vs, { ...n }) });
837
- }, _s = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
830
+ ), ws = (t) => t.onUnlock != null || t.onDownload != null ? /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Ze, {}), children: /* @__PURE__ */ e(vs, { ...t }) }) : /* @__PURE__ */ e($e, { fallback: /* @__PURE__ */ e(Ze, {}), children: /* @__PURE__ */ e(ys, { ...t }) }), _s = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
838
831
  "path",
839
832
  {
840
833
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -909,7 +902,7 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
909
902
  MessageDeleted: Z = Et,
910
903
  MessageIsThreadReplyInChannelButtonIndicator: Q = St,
911
904
  MessageRepliesCountButton: D = It,
912
- ReminderNotification: $ = Mt,
905
+ ReminderNotification: G = Mt,
913
906
  StreamedMessageText: z = kt,
914
907
  PinIndicator: ee
915
908
  } = pt("CustomMessage"), le = Tt(o), ie = Dt(o), ce = Le(
@@ -928,11 +921,11 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
928
921
  const P = !k && !!o.reply_count, H = !k && o.show_in_channel && o.parent_id, Y = o.status === "failed" && ((be = o.error) == null ? void 0 : be.status) !== 403, te = Lt(o);
929
922
  let se;
930
923
  Y ? se = () => N(o) : te && (se = () => R(!0));
931
- const G = I(), de = L(
924
+ const $ = I(), de = L(
932
925
  "str-chat__message str-chat__message-simple",
933
926
  `str-chat__message--${o.type}`,
934
927
  `str-chat__message--${o.status}`,
935
- G ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
928
+ $ ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
936
929
  o.text ? "str-chat__message--has-text" : "has-no-text",
937
930
  {
938
931
  "str-chat__message--has-attachment": le,
@@ -945,7 +938,7 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
945
938
  "str-chat__virtual-message__wrapper--first": c,
946
939
  "str-chat__virtual-message__wrapper--group": g
947
940
  }
948
- ), fe = o.poll_id && y.polls.fromState(o.poll_id), ne = gs(o), J = Be(o), ge = fs(o), me = !!(A != null && A.length && !o.quoted_message), xe = J && G && me;
941
+ ), fe = o.poll_id && y.polls.fromState(o.poll_id), ne = gs(o), J = Be(o), ge = fs(o), me = !!(A != null && A.length && !o.quoted_message), xe = J && $ && me;
949
942
  return /* @__PURE__ */ i(he, { children: [
950
943
  d && /* @__PURE__ */ e(
951
944
  p,
@@ -963,7 +956,7 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
963
956
  ),
964
957
  /* @__PURE__ */ i("div", { className: de, children: [
965
958
  ee && /* @__PURE__ */ e(ee, {}),
966
- !!x && /* @__PURE__ */ e($, { reminder: x }),
959
+ !!x && /* @__PURE__ */ e(G, { reminder: x }),
967
960
  o.user && /* @__PURE__ */ e(
968
961
  oe,
969
962
  {
@@ -994,7 +987,6 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
994
987
  /* @__PURE__ */ e(
995
988
  ws,
996
989
  {
997
- isCreator: G,
998
990
  title: (X = o.metadata) == null ? void 0 : X.attachment_title,
999
991
  mimeType: (Ce = o.metadata) == null ? void 0 : Ce.attachment_mime_type,
1000
992
  thumbnail: (Ne = o.metadata) == null ? void 0 : Ne.attachment_thumbnail,
@@ -1016,7 +1008,7 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
1016
1008
  {
1017
1009
  message: o,
1018
1010
  hasAttachment: me,
1019
- isMyMessage: G
1011
+ isMyMessage: $
1020
1012
  }
1021
1013
  ),
1022
1014
  fe && /* @__PURE__ */ e(Pt, { poll: fe }),
@@ -1041,7 +1033,7 @@ const ys = F.lazy(() => import("./Creator-D38dWn2X.js")), vs = F.lazy(() => impo
1041
1033
  {
1042
1034
  message: o,
1043
1035
  hasAttachment: me,
1044
- isMyMessage: G
1036
+ isMyMessage: $
1045
1037
  }
1046
1038
  ),
1047
1039
  n && J && /* @__PURE__ */ e(
@@ -1601,8 +1593,8 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1601
1593
  }) => {
1602
1594
  const f = U(
1603
1595
  async (E, C, p) => {
1604
- var $;
1605
- const O = (($ = t.data) == null ? void 0 : $.chatbot_paused) === !0, q = m && !O, Z = {
1596
+ var G;
1597
+ const O = ((G = t.data) == null ? void 0 : G.chatbot_paused) === !0, q = m && !O, Z = {
1606
1598
  ...C,
1607
1599
  ...q && { silent: !0 },
1608
1600
  ...I && {
@@ -2039,7 +2031,7 @@ const on = ({
2039
2031
  error: Z,
2040
2032
  refreshConnection: Q,
2041
2033
  debug: D
2042
- } = as(), [$, z] = T(null), [ee, le] = T(!1), [ie, ce] = T(!1), [A, P] = T(!1), [H, Y] = T(/* @__PURE__ */ new Set()), [te, se] = T(0), [G, de] = T(!1), [fe, ne] = T(null), J = K(null), {
2034
+ } = as(), [G, z] = T(null), [ee, le] = T(!1), [ie, ce] = T(!1), [A, P] = T(!1), [H, Y] = T(/* @__PURE__ */ new Set()), [te, se] = T(0), [$, de] = T(!1), [fe, ne] = T(null), J = K(null), {
2043
2035
  participantSource: ge,
2044
2036
  participantLabel: me = "participants",
2045
2037
  showDeleteConversation: xe = !0
@@ -2163,8 +2155,8 @@ const on = ({
2163
2155
  },
2164
2156
  [l]
2165
2157
  ), Ne = U(() => {
2166
- G || z(null);
2167
- }, [G]), pe = U(
2158
+ $ || z(null);
2159
+ }, [$]), pe = U(
2168
2160
  async (M) => {
2169
2161
  var V;
2170
2162
  if (C)
@@ -2208,7 +2200,7 @@ const on = ({
2208
2200
  D && console.log("[MessagingShell] Blocking participant:", M), z(null), de(!1), ae.current = null, await X();
2209
2201
  },
2210
2202
  [X, D]
2211
- ), ve = !!$;
2203
+ ), ve = !!G;
2212
2204
  return q ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : Z ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(Ee, { message: Z, onBack: Q }) }) : !O || !p ? /* @__PURE__ */ e("div", { className: L("h-full", s), children: /* @__PURE__ */ e(
2213
2205
  Ee,
2214
2206
  {
@@ -2230,18 +2222,18 @@ const on = ({
2230
2222
  className: L(
2231
2223
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2232
2224
  {
2233
- "!hidden": h === !1 || G,
2225
+ "!hidden": h === !1 || $,
2234
2226
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2235
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !G && ve,
2227
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !$ && ve,
2236
2228
  // Show on mobile when no channel selected, use same wide width on desktop
2237
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !G && !ve
2229
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !$ && !ve
2238
2230
  }
2239
2231
  ),
2240
2232
  children: /* @__PURE__ */ e(
2241
2233
  at,
2242
2234
  {
2243
2235
  onChannelSelect: Ce,
2244
- selectedChannel: $ || void 0,
2236
+ selectedChannel: G || void 0,
2245
2237
  filters: be,
2246
2238
  channelRenderFilterFn: N,
2247
2239
  customEmptyStateIndicator: S,
@@ -2257,17 +2249,17 @@ const on = ({
2257
2249
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2258
2250
  {
2259
2251
  // In direct conversation mode (or waiting for it), always show (full width)
2260
- flex: G || ve || a,
2252
+ flex: $ || ve || a,
2261
2253
  // Normal mode: hide on mobile when no channel selected
2262
- "hidden lg:flex": !G && !ve && !a
2254
+ "hidden lg:flex": !$ && !ve && !a
2263
2255
  }
2264
2256
  ),
2265
- children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2257
+ children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2266
2258
  lt,
2267
2259
  {
2268
- channel: $,
2260
+ channel: G,
2269
2261
  onBack: Ne,
2270
- showBackButton: !G,
2262
+ showBackButton: !$,
2271
2263
  renderMessageInputActions: n,
2272
2264
  renderConversationFooter: r,
2273
2265
  renderChannelBanner: x,
@@ -2287,7 +2279,7 @@ const on = ({
2287
2279
  customChannelActions: f,
2288
2280
  renderMessage: E
2289
2281
  },
2290
- $.id
2282
+ G.id
2291
2283
  ) }) : a ? (
2292
2284
  // Show loading while creating/loading direct conversation channel
2293
2285
  /* @__PURE__ */ e(Se, {})