@fluid-app/portal-sdk 0.1.232 → 0.1.234

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 (39) hide show
  1. package/dist/{FluidProvider-BNL_Apw2.cjs → FluidProvider-BE05KBep.cjs} +3 -2
  2. package/dist/FluidProvider-BE05KBep.cjs.map +1 -0
  3. package/dist/{FluidProvider-Dg-eouRw.mjs → FluidProvider-FtpwIsLB.mjs} +3 -2
  4. package/dist/FluidProvider-FtpwIsLB.mjs.map +1 -0
  5. package/dist/{MessagingScreen-CxpLlTW_.cjs → MessagingScreen-CKWiOb9l.cjs} +210 -105
  6. package/dist/MessagingScreen-CKWiOb9l.cjs.map +1 -0
  7. package/dist/{MessagingScreen-BMoCh4MT.cjs → MessagingScreen-CWEQmvOg.cjs} +3 -2
  8. package/dist/{MessagingScreen-Q17pdhUz.mjs → MessagingScreen-CWSeAq3b.mjs} +210 -105
  9. package/dist/MessagingScreen-CWSeAq3b.mjs.map +1 -0
  10. package/dist/{ProfileScreen-CHsIDbg8.mjs → ProfileScreen-Bt5GLOa5.mjs} +2 -2
  11. package/dist/{ProfileScreen-CHsIDbg8.mjs.map → ProfileScreen-Bt5GLOa5.mjs.map} +1 -1
  12. package/dist/{ProfileScreen-BSWw10cc.cjs → ProfileScreen-YqVWD0hn.cjs} +2 -2
  13. package/dist/{ProfileScreen-CVOS2By3.cjs → ProfileScreen-dAFNEWhY.cjs} +2 -2
  14. package/dist/{ProfileScreen-CVOS2By3.cjs.map → ProfileScreen-dAFNEWhY.cjs.map} +1 -1
  15. package/dist/{ShareablesScreen-DfrTNnRw.cjs → ShareablesScreen-DJ1yd3qu.cjs} +13 -17
  16. package/dist/ShareablesScreen-DJ1yd3qu.cjs.map +1 -0
  17. package/dist/{ShareablesScreen-DHKFnIOE.mjs → ShareablesScreen-DNjpEjLv.mjs} +13 -17
  18. package/dist/ShareablesScreen-DNjpEjLv.mjs.map +1 -0
  19. package/dist/{ShareablesScreen-DQjgnn2x.cjs → ShareablesScreen-DzswDadv.cjs} +1 -1
  20. package/dist/{ShopScreen-CFR2O1jn.cjs → ShopScreen-C3jX_bWM.cjs} +2 -2
  21. package/dist/{ShopScreen-CLN8FFiL.mjs → ShopScreen-DbTrIjfp.mjs} +2 -2
  22. package/dist/{ShopScreen-CLN8FFiL.mjs.map → ShopScreen-DbTrIjfp.mjs.map} +1 -1
  23. package/dist/{ShopScreen-jk3Y3-x8.cjs → ShopScreen-DozZEXVi.cjs} +2 -2
  24. package/dist/{ShopScreen-jk3Y3-x8.cjs.map → ShopScreen-DozZEXVi.cjs.map} +1 -1
  25. package/dist/index.cjs +35 -21
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +5 -0
  28. package/dist/index.d.cts.map +1 -1
  29. package/dist/index.d.mts +5 -0
  30. package/dist/index.d.mts.map +1 -1
  31. package/dist/index.mjs +35 -21
  32. package/dist/index.mjs.map +1 -1
  33. package/package.json +11 -11
  34. package/dist/FluidProvider-BNL_Apw2.cjs.map +0 -1
  35. package/dist/FluidProvider-Dg-eouRw.mjs.map +0 -1
  36. package/dist/MessagingScreen-CxpLlTW_.cjs.map +0 -1
  37. package/dist/MessagingScreen-Q17pdhUz.mjs.map +0 -1
  38. package/dist/ShareablesScreen-DHKFnIOE.mjs.map +0 -1
  39. package/dist/ShareablesScreen-DfrTNnRw.cjs.map +0 -1
@@ -1,6 +1,9 @@
1
1
  const require_chunk = require("./chunk-9hOWP6kD.cjs");
2
- const require_FluidProvider = require("./FluidProvider-BNL_Apw2.cjs");
2
+ const require_FluidProvider = require("./FluidProvider-BE05KBep.cjs");
3
3
  const require_src = require("./src-DpFIi-nj.cjs");
4
+ const require_ScreenHeaderContext = require("./ScreenHeaderContext-oIu5Bvhs.cjs");
5
+ const require_use_account = require("./use-account-DcBCP06c.cjs");
6
+ const require_use_store = require("./use-store-lOOUcpRT.cjs");
4
7
  const require_format = require("./format-CytB2M00.cjs");
5
8
  const require_dist = require("./dist-DbRTQ2QF.cjs");
6
9
  const require_es = require("./es-UfEBhcZD.cjs");
@@ -19,11 +22,24 @@ let node_path = require("node:path");
19
22
  let node_url = require("node:url");
20
23
  //#region src/messaging/use-messaging-auth.ts
21
24
  function useMessagingAuth() {
25
+ const accountQuery = require_use_account.useAccount();
26
+ const storeQuery = require_use_store.useStore();
27
+ const account = accountQuery.data;
28
+ const recipientId = account?.recipient_id ?? null;
22
29
  return {
23
- recipientId: null,
24
- companyId: null,
25
- currentUser: null,
26
- isLoading: false
30
+ recipientId,
31
+ companyId: storeQuery.data?.id ?? null,
32
+ currentUser: account && recipientId != null ? {
33
+ id: account.id,
34
+ recipientId,
35
+ firstName: account.first_name,
36
+ lastName: account.last_name,
37
+ email: account.email,
38
+ affiliateId: account.id,
39
+ ...account.avatar_url != null && { imageUrl: account.avatar_url }
40
+ } : null,
41
+ isLoading: accountQuery.isLoading || storeQuery.isLoading,
42
+ isError: accountQuery.isError || storeQuery.isError
27
43
  };
28
44
  }
29
45
  //#endregion
@@ -44,7 +60,9 @@ var MessagingApiError = class extends require_FluidProvider.ApiError {
44
60
  * Arrays: key[]=val, nested objects: key[subkey]=val
45
61
  */
46
62
  function buildUrl(baseUrl, endpoint, params) {
47
- const url = new URL(`${baseUrl}${endpoint}`);
63
+ const path = `${baseUrl}${endpoint}`;
64
+ if (typeof window === "undefined" && !/^https?:/i.test(path)) throw new Error("messaging-api-client: relative baseUrl is not supported outside the browser");
65
+ const url = /^https?:/i.test(path) ? new URL(path) : new URL(path, window.location.origin);
48
66
  if (!params) return url.toString();
49
67
  for (const [key, value] of Object.entries(params)) {
50
68
  if (value === void 0 || value === null) continue;
@@ -3319,6 +3337,21 @@ function goodTry(tryFn) {
3319
3337
  //#region ../../../node_modules/.pnpm/use-local-storage-state@19.5.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/use-local-storage-state/index.js
3320
3338
  var use_local_storage_state_default = useLocalStorageState;
3321
3339
  //#endregion
3340
+ //#region ../../messaging/ui/src/utils/render-helpers.tsx
3341
+ /**
3342
+ * Default image renderer using a plain <img> tag.
3343
+ * Used as a fallback when no framework-specific renderImage is provided.
3344
+ */
3345
+ function defaultRenderImage(props) {
3346
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
3347
+ src: props.src,
3348
+ alt: props.alt,
3349
+ width: props.width,
3350
+ height: props.height,
3351
+ className: props.className
3352
+ });
3353
+ }
3354
+ //#endregion
3322
3355
  //#region ../../messaging/ui/src/utils/avatar-utils.ts
3323
3356
  const AVATAR_COLORS = [
3324
3357
  "#6d7989",
@@ -3414,19 +3447,84 @@ function GroupAvatars({ conversation, currentUserId, groupSize = GROUP_MAX, rend
3414
3447
  });
3415
3448
  }
3416
3449
  //#endregion
3417
- //#region ../../messaging/ui/src/utils/render-helpers.tsx
3418
- /**
3419
- * Default image renderer using a plain <img> tag.
3420
- * Used as a fallback when no framework-specific renderImage is provided.
3421
- */
3422
- function defaultRenderImage(props) {
3423
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
3424
- src: props.src,
3425
- alt: props.alt,
3426
- width: props.width,
3427
- height: props.height,
3428
- className: props.className
3429
- });
3450
+ //#region ../../messaging/ui/src/app/MessagesHeaderActions.tsx
3451
+ function MessagesHeaderActions({ conversation, currentUser, navigation, renderImage }) {
3452
+ if (!conversation || !currentUser) return null;
3453
+ const affiliateId = currentUser.affiliateId;
3454
+ const messageType = getMessageType(conversation).type;
3455
+ const conversationId = conversation.id;
3456
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3457
+ (messageType === "broadcast" || messageType === "private-channel" || messageType === "public-channel") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupAvatars, {
3458
+ conversation,
3459
+ currentUserId: affiliateId,
3460
+ renderImage
3461
+ }),
3462
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3463
+ className: (0, clsx.default)("flex size-6 items-center justify-center rounded-sm border empty:hidden", messageType === "public-channel" && "border-blue-200 bg-blue-50", messageType === "sms" && "border-green-200 bg-green-50", messageType === "email" && "border-pink-200 bg-pink-50", messageType === "private-channel" && "border-purple-200 bg-purple-50", messageType === "broadcast" && "border-gray-200 bg-gray-50"),
3464
+ children: [
3465
+ messageType === "public-channel" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Eye, { className: "size-3 text-blue-700" }),
3466
+ messageType === "sms" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Phone, { className: "size-3 text-green-700" }),
3467
+ messageType === "email" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Mail, { className: "size-3 text-pink-600" }),
3468
+ messageType === "private-channel" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Lock, { className: "size-2.5 text-purple-700" }),
3469
+ messageType === "broadcast" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Megaphone, { className: "size-3 text-gray-700" })
3470
+ ]
3471
+ }),
3472
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
3473
+ asChild: true,
3474
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.IconButton, {
3475
+ size: "icon-xs",
3476
+ "aria-label": "More options",
3477
+ icon: lucide_react.EllipsisVertical
3478
+ })
3479
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuContent, {
3480
+ align: "end",
3481
+ className: "w-60 p-0",
3482
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuLabel, {
3483
+ className: "border-b border-gray-200 px-4 py-3 text-sm font-semibold text-slate-700",
3484
+ children: "Channel Options"
3485
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3486
+ className: "px-0 py-1",
3487
+ children: [
3488
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3489
+ disabled: true,
3490
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
3491
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.User, { className: "size-4 text-gray-500" }), "Channel Details"]
3492
+ }),
3493
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3494
+ disabled: true,
3495
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
3496
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Settings, { className: "size-4 text-gray-500" }), "Channel Settings"]
3497
+ }),
3498
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3499
+ disabled: true,
3500
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
3501
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.BellOff, { className: "size-4 text-gray-500" }), "Mute Channel"]
3502
+ }),
3503
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3504
+ onSelect: () => navigation.navigate({
3505
+ view: "pins",
3506
+ conversationId
3507
+ }),
3508
+ className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
3509
+ children: [
3510
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pin, { className: "size-4 text-gray-500" }),
3511
+ "Pinned Messages",
3512
+ (conversation.pinned_messages_count ?? 0) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3513
+ className: "ml-auto text-xs text-gray-500",
3514
+ children: conversation.pinned_messages_count ?? 0
3515
+ })
3516
+ ]
3517
+ }),
3518
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuSeparator, { className: "mx-0 my-1" }),
3519
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3520
+ disabled: true,
3521
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-red-500 focus:text-red-500",
3522
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LogOut, { className: "size-4 text-red-500" }), "Leave Channel"]
3523
+ })
3524
+ ]
3525
+ })]
3526
+ })] })
3527
+ ] });
3430
3528
  }
3431
3529
  //#endregion
3432
3530
  //#region ../../messaging/ui/src/app/MessagesTopBar.tsx
@@ -3438,17 +3536,13 @@ function getPageTitleFromRoute(route) {
3438
3536
  default: return;
3439
3537
  }
3440
3538
  }
3441
- function MessagesTopBar({ renderSidebarTrigger, renderBreadcrumb, history, onToast }) {
3539
+ function MessagesTopBar({ renderSidebarTrigger, renderBreadcrumb, history }) {
3442
3540
  const { auth, renderImage: contextRenderImage } = useMessagingApp();
3443
3541
  const navigation = useMessagingNavigation();
3444
3542
  const currentRoute = navigation.currentRoute;
3445
3543
  const renderImage = contextRenderImage ?? defaultRenderImage;
3446
- const conversationId = "conversationId" in currentRoute ? currentRoute.conversationId : 0;
3447
- const { data: conversation } = useConversation(conversationId);
3544
+ const { data: conversation } = useConversation("conversationId" in currentRoute ? currentRoute.conversationId : 0);
3448
3545
  const currentUser = auth.currentUser;
3449
- const affiliateId = currentUser?.affiliateId;
3450
- const otherUsers = conversation?.recipients.filter((r) => r.receivable_id !== affiliateId);
3451
- const { type: messageType } = conversation ? getMessageType(conversation) : {};
3452
3546
  const pageTitle = getPageTitleFromRoute(currentRoute);
3453
3547
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3454
3548
  className: "flex w-full items-center justify-between p-4",
@@ -3479,80 +3573,14 @@ function MessagesTopBar({ renderSidebarTrigger, renderBreadcrumb, history, onToa
3479
3573
  children: pageTitle
3480
3574
  })
3481
3575
  }) : null]
3482
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3576
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3483
3577
  className: "flex items-center gap-4",
3484
- children: [
3485
- (messageType === "broadcast" || messageType === "private-channel" || messageType === "public-channel") && conversation && otherUsers && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(GroupAvatars, {
3486
- conversation,
3487
- currentUserId: affiliateId,
3488
- renderImage
3489
- }),
3490
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3491
- className: (0, clsx.default)("flex size-6 items-center justify-center rounded-sm border empty:hidden", messageType === "public-channel" && "border-blue-200 bg-blue-50", messageType === "sms" && "border-green-200 bg-green-50", messageType === "email" && "border-pink-200 bg-pink-50", messageType === "private-channel" && "border-purple-200 bg-purple-50", messageType === "broadcast" && "border-gray-200 bg-gray-50"),
3492
- children: [
3493
- messageType === "public-channel" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Eye, { className: "size-3 text-blue-700" }),
3494
- messageType === "sms" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Phone, { className: "size-3 text-green-700" }),
3495
- messageType === "email" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Mail, { className: "size-3 text-pink-600" }),
3496
- messageType === "private-channel" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Lock, { className: "size-2.5 text-purple-700" }),
3497
- messageType === "broadcast" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Megaphone, { className: "size-3 text-gray-700" })
3498
- ]
3499
- }),
3500
- conversation && currentUser ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenu, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuTrigger, {
3501
- asChild: true,
3502
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.IconButton, {
3503
- size: "icon-xs",
3504
- "aria-label": "More options",
3505
- icon: lucide_react.EllipsisVertical
3506
- })
3507
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuContent, {
3508
- align: "end",
3509
- className: "w-60 p-0",
3510
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuLabel, {
3511
- className: "border-b border-gray-200 px-4 py-3 text-sm font-semibold text-slate-700",
3512
- children: "Channel Options"
3513
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3514
- className: "px-0 py-1",
3515
- children: [
3516
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3517
- className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700 opacity-50",
3518
- onSelect: () => onToast?.("channel details coming soon"),
3519
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.User, { className: "size-4 text-gray-500" }), "Channel Details"]
3520
- }),
3521
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3522
- className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700 opacity-50",
3523
- onSelect: () => onToast?.("channel settings coming soon"),
3524
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Settings, { className: "size-4 text-gray-500" }), "Channel Settings"]
3525
- }),
3526
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3527
- className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700 opacity-50",
3528
- onSelect: () => onToast?.("mute channel coming soon"),
3529
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.BellOff, { className: "size-4 text-gray-500" }), "Mute Channel"]
3530
- }),
3531
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3532
- onSelect: () => navigation.navigate({
3533
- view: "pins",
3534
- conversationId
3535
- }),
3536
- className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
3537
- children: [
3538
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Pin, { className: "size-4 text-gray-500" }),
3539
- "Pinned Messages",
3540
- (conversation.pinned_messages_count ?? 0) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3541
- className: "ml-auto text-xs text-gray-500",
3542
- children: conversation.pinned_messages_count ?? 0
3543
- })
3544
- ]
3545
- }),
3546
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.DropdownMenuSeparator, { className: "mx-0 my-1" }),
3547
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
3548
- className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-red-500 opacity-50 focus:text-red-500",
3549
- onSelect: () => onToast?.("leave channel coming soon"),
3550
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LogOut, { className: "size-4 text-red-500" }), "Leave Channel"]
3551
- })
3552
- ]
3553
- })] })
3554
- })] }) : null
3555
- ]
3578
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessagesHeaderActions, {
3579
+ conversation,
3580
+ currentUser,
3581
+ navigation,
3582
+ renderImage
3583
+ })
3556
3584
  })]
3557
3585
  });
3558
3586
  }
@@ -4069,7 +4097,7 @@ function useScrollerRef() {
4069
4097
  if (!context) throw new Error("useScrollerRef must be used within MessagingLayout");
4070
4098
  return context;
4071
4099
  }
4072
- function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures = true, canUseMyDownline = false, downlineData }) {
4100
+ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures = true, canUseMyDownline = false, downlineData, hideTopBar = false }) {
4073
4101
  const navigation = useMessagingNavigation();
4074
4102
  const [isDragging, setIsDragging] = (0, react.useState)(false);
4075
4103
  const sidebarRef = (0, react.useRef)(null);
@@ -4181,7 +4209,7 @@ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNew
4181
4209
  const initialLoadInProgress = currentRoute.view === "index" && (result.isLoading || isLoadingAnnouncementChannel);
4182
4210
  const userWithoutChannels = currentRoute.view === "index" && !firstEntry && !announcementChannel && !result.isLoading && !isLoadingAnnouncementChannel;
4183
4211
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4184
- className: "relative grid h-full w-full grid-rows-[auto_1fr] select-none",
4212
+ className: hideTopBar ? "relative grid h-full w-full grid-rows-[1fr] select-none" : "relative grid h-full w-full grid-rows-[auto_1fr] select-none",
4185
4213
  style: {
4186
4214
  gridTemplateColumns: `minmax(150px, min(50vw, var(--sidebar-width))) 1fr`,
4187
4215
  "--sidebar-width": `${sidebarWidth}px`
@@ -4192,7 +4220,7 @@ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNew
4192
4220
  background: transparent;
4193
4221
  }
4194
4222
  ` }),
4195
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4223
+ !hideTopBar && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4196
4224
  className: "col-span-2 border-b border-gray-200 bg-white",
4197
4225
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessagesTopBar, {})
4198
4226
  }),
@@ -4221,7 +4249,7 @@ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNew
4221
4249
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4222
4250
  className: "absolute z-50 h-full w-1 cursor-col-resize place-self-end bg-transparent hover:bg-blue-500 hover:opacity-50",
4223
4251
  style: {
4224
- gridRow: "2 / -1",
4252
+ gridRow: hideTopBar ? "1 / -1" : "2 / -1",
4225
4253
  gridColumn: "1 / 2"
4226
4254
  },
4227
4255
  onMouseDown: handleMouseDown
@@ -57254,7 +57282,7 @@ function ScheduledMessagesView({ onToast }) {
57254
57282
  }
57255
57283
  //#endregion
57256
57284
  //#region ../../messaging/ui/src/app/MessagingApp.tsx
57257
- function MessagingApp({ api, auth, websocketUrl, token, renderImage, renderProfileTrigger, onNavigate, initialRoute, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures, canUseMyDownline, downlineData, topBar, messagesViewProps, newMessageViewProps, onToast, getMessageLink, renderProfileContent, children }) {
57285
+ function MessagingApp({ api, auth, websocketUrl, token, renderImage, renderProfileTrigger, onNavigate, initialRoute, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures, canUseMyDownline, downlineData, topBar, messagesViewProps, newMessageViewProps, onToast, getMessageLink, renderProfileContent, hideTopBar, children }) {
57258
57286
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MessagingAppProvider, {
57259
57287
  api,
57260
57288
  auth,
@@ -57278,6 +57306,7 @@ function MessagingApp({ api, auth, websocketUrl, token, renderImage, renderProfi
57278
57306
  showAdminFeatures,
57279
57307
  canUseMyDownline,
57280
57308
  downlineData,
57309
+ hideTopBar,
57281
57310
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessagingRouter, {
57282
57311
  messagesViewProps,
57283
57312
  newMessageViewProps,
@@ -57327,6 +57356,66 @@ zod.z.object({
57327
57356
  url: zod.z.string().min(1, "Link is required").url("Please enter a valid URL")
57328
57357
  });
57329
57358
  //#endregion
57359
+ //#region src/messaging/MessagingHeaderBridge.tsx
57360
+ /**
57361
+ * Bridges messaging header content from inside <MessagingApp> into the
57362
+ * portal shell's <ScreenHeader>. Render this as a child of <MessagingApp>
57363
+ * with `hideTopBar` set, and the messaging UI's own <MessagesTopBar /> is
57364
+ * suppressed in favour of populating the existing portal header.
57365
+ *
57366
+ * Right-hand actions are delegated to <MessagesHeaderActions /> from
57367
+ * messaging-ui so this stays in sync with <MessagesTopBar />. The breadcrumbs
57368
+ * are owned here because the portal shell shows them differently from the
57369
+ * messaging-ui's inline page-title fallback.
57370
+ */
57371
+ const ROUTE_TITLES = {
57372
+ pins: "Pinned Messages",
57373
+ new: "New Message",
57374
+ scheduled: "Scheduled Messages"
57375
+ };
57376
+ function fallbackRenderImage(props) {
57377
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
57378
+ src: props.src,
57379
+ alt: props.alt,
57380
+ width: props.width,
57381
+ height: props.height,
57382
+ className: props.className
57383
+ });
57384
+ }
57385
+ function MessagingHeaderBridge() {
57386
+ const { auth, renderImage: contextRenderImage } = useMessagingApp();
57387
+ const navigation = useMessagingNavigation();
57388
+ const { currentRoute } = navigation;
57389
+ const { data: conversation } = useConversation("conversationId" in currentRoute ? currentRoute.conversationId : 0);
57390
+ const renderImage = contextRenderImage ?? fallbackRenderImage;
57391
+ const currentUser = auth.currentUser;
57392
+ const conversationName = conversation?.name;
57393
+ const routeTitle = ROUTE_TITLES[currentRoute.view];
57394
+ require_ScreenHeaderContext.useScreenHeaderBreadcrumbs((0, react.useMemo)(() => {
57395
+ if (routeTitle) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
57396
+ className: "text-foreground text-lg font-semibold",
57397
+ children: routeTitle
57398
+ });
57399
+ if (conversationName) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", {
57400
+ className: "text-foreground truncate text-lg font-semibold",
57401
+ children: conversationName
57402
+ });
57403
+ return null;
57404
+ }, [routeTitle, conversationName]));
57405
+ require_ScreenHeaderContext.useScreenHeaderActions((0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessagesHeaderActions, {
57406
+ conversation,
57407
+ currentUser,
57408
+ navigation,
57409
+ renderImage
57410
+ }), [
57411
+ conversation,
57412
+ currentUser,
57413
+ navigation,
57414
+ renderImage
57415
+ ]));
57416
+ return null;
57417
+ }
57418
+ //#endregion
57330
57419
  //#region src/screens/MessagingScreen.tsx
57331
57420
  function renderImage(props) {
57332
57421
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
@@ -57397,6 +57486,20 @@ function MessagingScreen({ onToast, filestackApiKey, websocketUrl: websocketUrlO
57397
57486
  children: "Loading messaging..."
57398
57487
  })
57399
57488
  });
57489
+ if (messagingAuth.isError) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
57490
+ ...divProps,
57491
+ className: `flex h-full items-center justify-center ${divProps.className ?? ""}`,
57492
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
57493
+ className: "border-border max-w-sm rounded-lg border border-dashed p-8 text-center",
57494
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
57495
+ className: "text-foreground text-xl font-semibold",
57496
+ children: "Messaging"
57497
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
57498
+ className: "text-muted-foreground mt-2",
57499
+ children: "Couldn't load messaging. Please refresh to try again."
57500
+ })]
57501
+ })
57502
+ });
57400
57503
  if (!messagingAuth.recipientId) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
57401
57504
  ...divProps,
57402
57505
  className: `flex h-full items-center justify-center ${divProps.className ?? ""}`,
@@ -57422,6 +57525,7 @@ function MessagingScreen({ onToast, filestackApiKey, websocketUrl: websocketUrlO
57422
57525
  renderImage,
57423
57526
  showAdminFeatures: false,
57424
57527
  onToast: effectiveToast,
57528
+ hideTopBar: true,
57425
57529
  messagesViewProps: {
57426
57530
  uploader,
57427
57531
  saveDrafts: true,
@@ -57430,7 +57534,8 @@ function MessagingScreen({ onToast, filestackApiKey, websocketUrl: websocketUrlO
57430
57534
  newMessageViewProps: {
57431
57535
  searchUsers,
57432
57536
  searchChannels
57433
- }
57537
+ },
57538
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessagingHeaderBridge, {})
57434
57539
  })
57435
57540
  });
57436
57541
  }
@@ -57475,4 +57580,4 @@ Object.defineProperty(exports, "useMessagingConfig", {
57475
57580
  }
57476
57581
  });
57477
57582
 
57478
- //# sourceMappingURL=MessagingScreen-CxpLlTW_.cjs.map
57583
+ //# sourceMappingURL=MessagingScreen-CKWiOb9l.cjs.map