@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,5 +1,5 @@
1
1
  require("./chunk-9hOWP6kD.cjs");
2
- require("./FluidProvider-BNL_Apw2.cjs");
2
+ require("./FluidProvider-BE05KBep.cjs");
3
3
  require("./ScreenRenderer-aYfgv6mR.cjs");
4
4
  require("./account-api-context-DZP9IiGg.cjs");
5
5
  require("./store-api-context-D1gZn22Z.cjs");
@@ -41,7 +41,8 @@ require("./SpacerWidget-CI3to-88.cjs");
41
41
  require("./TableWidget-b7hKDTJk.cjs");
42
42
  require("./ToDoWidget-CQ_zTbhz.cjs");
43
43
  require("./VideoWidget-Bc6ZAAaA.cjs");
44
- const require_MessagingScreen = require("./MessagingScreen-CxpLlTW_.cjs");
44
+ require("./ScreenHeaderContext-oIu5Bvhs.cjs");
45
+ const require_MessagingScreen = require("./MessagingScreen-CKWiOb9l.cjs");
45
46
  require("./dist-DbRTQ2QF.cjs");
46
47
  require("./es-UfEBhcZD.cjs");
47
48
  exports.MessagingScreen = require_MessagingScreen.MessagingScreen;
@@ -1,6 +1,9 @@
1
1
  import { a as __toESM, i as __require, n as __commonJSMin, r as __exportAll, t as useDropzone } from "./es-BkP8gyWU.mjs";
2
- import { n as useFluidContext, u as ApiError } from "./FluidProvider-Dg-eouRw.mjs";
2
+ import { n as useFluidContext, u as ApiError } from "./FluidProvider-FtpwIsLB.mjs";
3
3
  import { $ as DropdownMenuSeparator, En as Button, Ft as isAfter, Gt as endOfMonth, It as format$1, J as DropdownMenuContent, Jt as differenceInCalendarDays, Kt as differenceInCalendarMonths, L as Input, Mt as subDays, Nt as isSameYear, Pn as cn, Pt as isBefore, R as IconToggle, X as DropdownMenuLabel, Xt as normalizeDates, Y as DropdownMenuItem, Yt as startOfDay, an as millisecondsInHour, at as DialogClose, b as fluidToast, ht as PopoverTrigger, i as TooltipTrigger, in as constructFrom, it as Dialog, jt as Calendar$1, mt as PopoverContent, n as TooltipContent, nn as addDays, on as millisecondsInMinute, ot as DialogContent, pt as Popover, q as DropdownMenu, qt as isSameDay, r as TooltipProvider, rn as toDate, rt as DropdownMenuTrigger, t as Tooltip, tn as addMonths, v as SpinnerWithText, z as IconButton } from "./src-CCqVyAdS.mjs";
4
+ import { n as useScreenHeaderActions, r as useScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-Cemdo7bM.mjs";
5
+ import { t as useAccount } from "./use-account-CBMPhhs7.mjs";
6
+ import { t as useStore } from "./use-store-By_7tzrN.mjs";
4
7
  import { C as PluginKey, D as Node$2, E as Mark$1, O as Schema$1, S as Plugin, T as Fragment$2, _ as index$1, a as useEditor, b as Decoration, c as Mark, d as escapeForRegEx, f as findChildrenInRange, g as getMarksBetween, h as getHTMLFromFragment, i as ReactRenderer, l as Node$1, m as getChangedRanges, o as Placeholder, p as getAttributes, r as EditorContent, s as Extension, t as StarterKit, u as combineTransactionSteps, v as markPasteRule, w as DOMParser, x as DecorationSet, y as mergeAttributes } from "./dist-PbA1vxAz.mjs";
5
8
  import * as React$1 from "react";
6
9
  import React, { Children, Component, Fragment, createContext, createElement, forwardRef, isValidElement, memo, startTransition, use, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useEffectEvent, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useOptimistic, useRef, useState, useSyncExternalStore } from "react";
@@ -903,11 +906,24 @@ function subMonths(date, amount, options) {
903
906
  //#endregion
904
907
  //#region src/messaging/use-messaging-auth.ts
905
908
  function useMessagingAuth() {
909
+ const accountQuery = useAccount();
910
+ const storeQuery = useStore();
911
+ const account = accountQuery.data;
912
+ const recipientId = account?.recipient_id ?? null;
906
913
  return {
907
- recipientId: null,
908
- companyId: null,
909
- currentUser: null,
910
- isLoading: false
914
+ recipientId,
915
+ companyId: storeQuery.data?.id ?? null,
916
+ currentUser: account && recipientId != null ? {
917
+ id: account.id,
918
+ recipientId,
919
+ firstName: account.first_name,
920
+ lastName: account.last_name,
921
+ email: account.email,
922
+ affiliateId: account.id,
923
+ ...account.avatar_url != null && { imageUrl: account.avatar_url }
924
+ } : null,
925
+ isLoading: accountQuery.isLoading || storeQuery.isLoading,
926
+ isError: accountQuery.isError || storeQuery.isError
911
927
  };
912
928
  }
913
929
  //#endregion
@@ -928,7 +944,9 @@ var MessagingApiError = class extends ApiError {
928
944
  * Arrays: key[]=val, nested objects: key[subkey]=val
929
945
  */
930
946
  function buildUrl(baseUrl, endpoint, params) {
931
- const url = new URL(`${baseUrl}${endpoint}`);
947
+ const path = `${baseUrl}${endpoint}`;
948
+ if (typeof window === "undefined" && !/^https?:/i.test(path)) throw new Error("messaging-api-client: relative baseUrl is not supported outside the browser");
949
+ const url = /^https?:/i.test(path) ? new URL(path) : new URL(path, window.location.origin);
932
950
  if (!params) return url.toString();
933
951
  for (const [key, value] of Object.entries(params)) {
934
952
  if (value === void 0 || value === null) continue;
@@ -4182,6 +4200,21 @@ function goodTry(tryFn) {
4182
4200
  //#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
4183
4201
  var use_local_storage_state_default = useLocalStorageState;
4184
4202
  //#endregion
4203
+ //#region ../../messaging/ui/src/utils/render-helpers.tsx
4204
+ /**
4205
+ * Default image renderer using a plain <img> tag.
4206
+ * Used as a fallback when no framework-specific renderImage is provided.
4207
+ */
4208
+ function defaultRenderImage(props) {
4209
+ return /* @__PURE__ */ jsx("img", {
4210
+ src: props.src,
4211
+ alt: props.alt,
4212
+ width: props.width,
4213
+ height: props.height,
4214
+ className: props.className
4215
+ });
4216
+ }
4217
+ //#endregion
4185
4218
  //#region ../../messaging/ui/src/utils/avatar-utils.ts
4186
4219
  const AVATAR_COLORS = [
4187
4220
  "#6d7989",
@@ -4277,19 +4310,84 @@ function GroupAvatars({ conversation, currentUserId, groupSize = GROUP_MAX, rend
4277
4310
  });
4278
4311
  }
4279
4312
  //#endregion
4280
- //#region ../../messaging/ui/src/utils/render-helpers.tsx
4281
- /**
4282
- * Default image renderer using a plain <img> tag.
4283
- * Used as a fallback when no framework-specific renderImage is provided.
4284
- */
4285
- function defaultRenderImage(props) {
4286
- return /* @__PURE__ */ jsx("img", {
4287
- src: props.src,
4288
- alt: props.alt,
4289
- width: props.width,
4290
- height: props.height,
4291
- className: props.className
4292
- });
4313
+ //#region ../../messaging/ui/src/app/MessagesHeaderActions.tsx
4314
+ function MessagesHeaderActions({ conversation, currentUser, navigation, renderImage }) {
4315
+ if (!conversation || !currentUser) return null;
4316
+ const affiliateId = currentUser.affiliateId;
4317
+ const messageType = getMessageType(conversation).type;
4318
+ const conversationId = conversation.id;
4319
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
4320
+ (messageType === "broadcast" || messageType === "private-channel" || messageType === "public-channel") && /* @__PURE__ */ jsx(GroupAvatars, {
4321
+ conversation,
4322
+ currentUserId: affiliateId,
4323
+ renderImage
4324
+ }),
4325
+ /* @__PURE__ */ jsxs("div", {
4326
+ className: clsx$1("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"),
4327
+ children: [
4328
+ messageType === "public-channel" && /* @__PURE__ */ jsx(Eye, { className: "size-3 text-blue-700" }),
4329
+ messageType === "sms" && /* @__PURE__ */ jsx(Phone, { className: "size-3 text-green-700" }),
4330
+ messageType === "email" && /* @__PURE__ */ jsx(Mail, { className: "size-3 text-pink-600" }),
4331
+ messageType === "private-channel" && /* @__PURE__ */ jsx(Lock, { className: "size-2.5 text-purple-700" }),
4332
+ messageType === "broadcast" && /* @__PURE__ */ jsx(Megaphone, { className: "size-3 text-gray-700" })
4333
+ ]
4334
+ }),
4335
+ /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
4336
+ asChild: true,
4337
+ children: /* @__PURE__ */ jsx(IconButton, {
4338
+ size: "icon-xs",
4339
+ "aria-label": "More options",
4340
+ icon: EllipsisVertical
4341
+ })
4342
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
4343
+ align: "end",
4344
+ className: "w-60 p-0",
4345
+ children: [/* @__PURE__ */ jsx(DropdownMenuLabel, {
4346
+ className: "border-b border-gray-200 px-4 py-3 text-sm font-semibold text-slate-700",
4347
+ children: "Channel Options"
4348
+ }), /* @__PURE__ */ jsxs("div", {
4349
+ className: "px-0 py-1",
4350
+ children: [
4351
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
4352
+ disabled: true,
4353
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
4354
+ children: [/* @__PURE__ */ jsx(User, { className: "size-4 text-gray-500" }), "Channel Details"]
4355
+ }),
4356
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
4357
+ disabled: true,
4358
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
4359
+ children: [/* @__PURE__ */ jsx(Settings, { className: "size-4 text-gray-500" }), "Channel Settings"]
4360
+ }),
4361
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
4362
+ disabled: true,
4363
+ className: "mx-1.5 my-0 gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
4364
+ children: [/* @__PURE__ */ jsx(BellOff, { className: "size-4 text-gray-500" }), "Mute Channel"]
4365
+ }),
4366
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
4367
+ onSelect: () => navigation.navigate({
4368
+ view: "pins",
4369
+ conversationId
4370
+ }),
4371
+ className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
4372
+ children: [
4373
+ /* @__PURE__ */ jsx(Pin, { className: "size-4 text-gray-500" }),
4374
+ "Pinned Messages",
4375
+ (conversation.pinned_messages_count ?? 0) > 0 && /* @__PURE__ */ jsx("span", {
4376
+ className: "ml-auto text-xs text-gray-500",
4377
+ children: conversation.pinned_messages_count ?? 0
4378
+ })
4379
+ ]
4380
+ }),
4381
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "mx-0 my-1" }),
4382
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
4383
+ disabled: true,
4384
+ 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",
4385
+ children: [/* @__PURE__ */ jsx(LogOut, { className: "size-4 text-red-500" }), "Leave Channel"]
4386
+ })
4387
+ ]
4388
+ })]
4389
+ })] })
4390
+ ] });
4293
4391
  }
4294
4392
  //#endregion
4295
4393
  //#region ../../messaging/ui/src/app/MessagesTopBar.tsx
@@ -4301,17 +4399,13 @@ function getPageTitleFromRoute(route) {
4301
4399
  default: return;
4302
4400
  }
4303
4401
  }
4304
- function MessagesTopBar({ renderSidebarTrigger, renderBreadcrumb, history, onToast }) {
4402
+ function MessagesTopBar({ renderSidebarTrigger, renderBreadcrumb, history }) {
4305
4403
  const { auth, renderImage: contextRenderImage } = useMessagingApp();
4306
4404
  const navigation = useMessagingNavigation();
4307
4405
  const currentRoute = navigation.currentRoute;
4308
4406
  const renderImage = contextRenderImage ?? defaultRenderImage;
4309
- const conversationId = "conversationId" in currentRoute ? currentRoute.conversationId : 0;
4310
- const { data: conversation } = useConversation(conversationId);
4407
+ const { data: conversation } = useConversation("conversationId" in currentRoute ? currentRoute.conversationId : 0);
4311
4408
  const currentUser = auth.currentUser;
4312
- const affiliateId = currentUser?.affiliateId;
4313
- const otherUsers = conversation?.recipients.filter((r) => r.receivable_id !== affiliateId);
4314
- const { type: messageType } = conversation ? getMessageType(conversation) : {};
4315
4409
  const pageTitle = getPageTitleFromRoute(currentRoute);
4316
4410
  return /* @__PURE__ */ jsxs("div", {
4317
4411
  className: "flex w-full items-center justify-between p-4",
@@ -4342,80 +4436,14 @@ function MessagesTopBar({ renderSidebarTrigger, renderBreadcrumb, history, onToa
4342
4436
  children: pageTitle
4343
4437
  })
4344
4438
  }) : null]
4345
- }), /* @__PURE__ */ jsxs("div", {
4439
+ }), /* @__PURE__ */ jsx("div", {
4346
4440
  className: "flex items-center gap-4",
4347
- children: [
4348
- (messageType === "broadcast" || messageType === "private-channel" || messageType === "public-channel") && conversation && otherUsers && /* @__PURE__ */ jsx(GroupAvatars, {
4349
- conversation,
4350
- currentUserId: affiliateId,
4351
- renderImage
4352
- }),
4353
- /* @__PURE__ */ jsxs("div", {
4354
- className: clsx$1("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"),
4355
- children: [
4356
- messageType === "public-channel" && /* @__PURE__ */ jsx(Eye, { className: "size-3 text-blue-700" }),
4357
- messageType === "sms" && /* @__PURE__ */ jsx(Phone, { className: "size-3 text-green-700" }),
4358
- messageType === "email" && /* @__PURE__ */ jsx(Mail, { className: "size-3 text-pink-600" }),
4359
- messageType === "private-channel" && /* @__PURE__ */ jsx(Lock, { className: "size-2.5 text-purple-700" }),
4360
- messageType === "broadcast" && /* @__PURE__ */ jsx(Megaphone, { className: "size-3 text-gray-700" })
4361
- ]
4362
- }),
4363
- conversation && currentUser ? /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
4364
- asChild: true,
4365
- children: /* @__PURE__ */ jsx(IconButton, {
4366
- size: "icon-xs",
4367
- "aria-label": "More options",
4368
- icon: EllipsisVertical
4369
- })
4370
- }), /* @__PURE__ */ jsx(DropdownMenuContent, {
4371
- align: "end",
4372
- className: "w-60 p-0",
4373
- children: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, {
4374
- className: "border-b border-gray-200 px-4 py-3 text-sm font-semibold text-slate-700",
4375
- children: "Channel Options"
4376
- }), /* @__PURE__ */ jsxs("div", {
4377
- className: "px-0 py-1",
4378
- children: [
4379
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
4380
- 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",
4381
- onSelect: () => onToast?.("channel details coming soon"),
4382
- children: [/* @__PURE__ */ jsx(User, { className: "size-4 text-gray-500" }), "Channel Details"]
4383
- }),
4384
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
4385
- 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",
4386
- onSelect: () => onToast?.("channel settings coming soon"),
4387
- children: [/* @__PURE__ */ jsx(Settings, { className: "size-4 text-gray-500" }), "Channel Settings"]
4388
- }),
4389
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
4390
- 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",
4391
- onSelect: () => onToast?.("mute channel coming soon"),
4392
- children: [/* @__PURE__ */ jsx(BellOff, { className: "size-4 text-gray-500" }), "Mute Channel"]
4393
- }),
4394
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
4395
- onSelect: () => navigation.navigate({
4396
- view: "pins",
4397
- conversationId
4398
- }),
4399
- className: "mx-1.5 my-0 cursor-pointer gap-2 rounded-md px-2.5 py-[9px] text-sm font-medium text-slate-700",
4400
- children: [
4401
- /* @__PURE__ */ jsx(Pin, { className: "size-4 text-gray-500" }),
4402
- "Pinned Messages",
4403
- (conversation.pinned_messages_count ?? 0) > 0 && /* @__PURE__ */ jsx("span", {
4404
- className: "ml-auto text-xs text-gray-500",
4405
- children: conversation.pinned_messages_count ?? 0
4406
- })
4407
- ]
4408
- }),
4409
- /* @__PURE__ */ jsx(DropdownMenuSeparator, { className: "mx-0 my-1" }),
4410
- /* @__PURE__ */ jsxs(DropdownMenuItem, {
4411
- 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",
4412
- onSelect: () => onToast?.("leave channel coming soon"),
4413
- children: [/* @__PURE__ */ jsx(LogOut, { className: "size-4 text-red-500" }), "Leave Channel"]
4414
- })
4415
- ]
4416
- })] })
4417
- })] }) : null
4418
- ]
4441
+ children: /* @__PURE__ */ jsx(MessagesHeaderActions, {
4442
+ conversation,
4443
+ currentUser,
4444
+ navigation,
4445
+ renderImage
4446
+ })
4419
4447
  })]
4420
4448
  });
4421
4449
  }
@@ -4932,7 +4960,7 @@ function useScrollerRef() {
4932
4960
  if (!context) throw new Error("useScrollerRef must be used within MessagingLayout");
4933
4961
  return context;
4934
4962
  }
4935
- function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures = true, canUseMyDownline = false, downlineData }) {
4963
+ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures = true, canUseMyDownline = false, downlineData, hideTopBar = false }) {
4936
4964
  const navigation = useMessagingNavigation();
4937
4965
  const [isDragging, setIsDragging] = useState(false);
4938
4966
  const sidebarRef = useRef(null);
@@ -5044,7 +5072,7 @@ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNew
5044
5072
  const initialLoadInProgress = currentRoute.view === "index" && (result.isLoading || isLoadingAnnouncementChannel);
5045
5073
  const userWithoutChannels = currentRoute.view === "index" && !firstEntry && !announcementChannel && !result.isLoading && !isLoadingAnnouncementChannel;
5046
5074
  return /* @__PURE__ */ jsxs("div", {
5047
- className: "relative grid h-full w-full grid-rows-[auto_1fr] select-none",
5075
+ 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",
5048
5076
  style: {
5049
5077
  gridTemplateColumns: `minmax(150px, min(50vw, var(--sidebar-width))) 1fr`,
5050
5078
  "--sidebar-width": `${sidebarWidth}px`
@@ -5055,7 +5083,7 @@ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNew
5055
5083
  background: transparent;
5056
5084
  }
5057
5085
  ` }),
5058
- /* @__PURE__ */ jsx("div", {
5086
+ !hideTopBar && /* @__PURE__ */ jsx("div", {
5059
5087
  className: "col-span-2 border-b border-gray-200 bg-white",
5060
5088
  children: /* @__PURE__ */ jsx(MessagesTopBar, {})
5061
5089
  }),
@@ -5084,7 +5112,7 @@ function MessagingLayout({ children, topBar, renderLockedDownlineItem, renderNew
5084
5112
  /* @__PURE__ */ jsx("div", {
5085
5113
  className: "absolute z-50 h-full w-1 cursor-col-resize place-self-end bg-transparent hover:bg-blue-500 hover:opacity-50",
5086
5114
  style: {
5087
- gridRow: "2 / -1",
5115
+ gridRow: hideTopBar ? "1 / -1" : "2 / -1",
5088
5116
  gridColumn: "1 / 2"
5089
5117
  },
5090
5118
  onMouseDown: handleMouseDown
@@ -54442,7 +54470,7 @@ function ScheduledMessagesView({ onToast }) {
54442
54470
  }
54443
54471
  //#endregion
54444
54472
  //#region ../../messaging/ui/src/app/MessagingApp.tsx
54445
- function MessagingApp({ api, auth, websocketUrl, token, renderImage, renderProfileTrigger, onNavigate, initialRoute, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures, canUseMyDownline, downlineData, topBar, messagesViewProps, newMessageViewProps, onToast, getMessageLink, renderProfileContent, children }) {
54473
+ function MessagingApp({ api, auth, websocketUrl, token, renderImage, renderProfileTrigger, onNavigate, initialRoute, renderLockedDownlineItem, renderNewChannelSidebar, showAdminFeatures, canUseMyDownline, downlineData, topBar, messagesViewProps, newMessageViewProps, onToast, getMessageLink, renderProfileContent, hideTopBar, children }) {
54446
54474
  return /* @__PURE__ */ jsxs(MessagingAppProvider, {
54447
54475
  api,
54448
54476
  auth,
@@ -54466,6 +54494,7 @@ function MessagingApp({ api, auth, websocketUrl, token, renderImage, renderProfi
54466
54494
  showAdminFeatures,
54467
54495
  canUseMyDownline,
54468
54496
  downlineData,
54497
+ hideTopBar,
54469
54498
  children: /* @__PURE__ */ jsx(MessagingRouter, {
54470
54499
  messagesViewProps,
54471
54500
  newMessageViewProps,
@@ -54515,6 +54544,66 @@ z.object({
54515
54544
  url: z.string().min(1, "Link is required").url("Please enter a valid URL")
54516
54545
  });
54517
54546
  //#endregion
54547
+ //#region src/messaging/MessagingHeaderBridge.tsx
54548
+ /**
54549
+ * Bridges messaging header content from inside <MessagingApp> into the
54550
+ * portal shell's <ScreenHeader>. Render this as a child of <MessagingApp>
54551
+ * with `hideTopBar` set, and the messaging UI's own <MessagesTopBar /> is
54552
+ * suppressed in favour of populating the existing portal header.
54553
+ *
54554
+ * Right-hand actions are delegated to <MessagesHeaderActions /> from
54555
+ * messaging-ui so this stays in sync with <MessagesTopBar />. The breadcrumbs
54556
+ * are owned here because the portal shell shows them differently from the
54557
+ * messaging-ui's inline page-title fallback.
54558
+ */
54559
+ const ROUTE_TITLES = {
54560
+ pins: "Pinned Messages",
54561
+ new: "New Message",
54562
+ scheduled: "Scheduled Messages"
54563
+ };
54564
+ function fallbackRenderImage(props) {
54565
+ return /* @__PURE__ */ jsx("img", {
54566
+ src: props.src,
54567
+ alt: props.alt,
54568
+ width: props.width,
54569
+ height: props.height,
54570
+ className: props.className
54571
+ });
54572
+ }
54573
+ function MessagingHeaderBridge() {
54574
+ const { auth, renderImage: contextRenderImage } = useMessagingApp();
54575
+ const navigation = useMessagingNavigation();
54576
+ const { currentRoute } = navigation;
54577
+ const { data: conversation } = useConversation("conversationId" in currentRoute ? currentRoute.conversationId : 0);
54578
+ const renderImage = contextRenderImage ?? fallbackRenderImage;
54579
+ const currentUser = auth.currentUser;
54580
+ const conversationName = conversation?.name;
54581
+ const routeTitle = ROUTE_TITLES[currentRoute.view];
54582
+ useScreenHeaderBreadcrumbs(useMemo(() => {
54583
+ if (routeTitle) return /* @__PURE__ */ jsx("h1", {
54584
+ className: "text-foreground text-lg font-semibold",
54585
+ children: routeTitle
54586
+ });
54587
+ if (conversationName) return /* @__PURE__ */ jsx("h1", {
54588
+ className: "text-foreground truncate text-lg font-semibold",
54589
+ children: conversationName
54590
+ });
54591
+ return null;
54592
+ }, [routeTitle, conversationName]));
54593
+ useScreenHeaderActions(useMemo(() => /* @__PURE__ */ jsx(MessagesHeaderActions, {
54594
+ conversation,
54595
+ currentUser,
54596
+ navigation,
54597
+ renderImage
54598
+ }), [
54599
+ conversation,
54600
+ currentUser,
54601
+ navigation,
54602
+ renderImage
54603
+ ]));
54604
+ return null;
54605
+ }
54606
+ //#endregion
54518
54607
  //#region src/screens/MessagingScreen.tsx
54519
54608
  var MessagingScreen_exports = /* @__PURE__ */ __exportAll({
54520
54609
  MessagingScreen: () => MessagingScreen,
@@ -54589,6 +54678,20 @@ function MessagingScreen({ onToast, filestackApiKey, websocketUrl: websocketUrlO
54589
54678
  children: "Loading messaging..."
54590
54679
  })
54591
54680
  });
54681
+ if (messagingAuth.isError) return /* @__PURE__ */ jsx("div", {
54682
+ ...divProps,
54683
+ className: `flex h-full items-center justify-center ${divProps.className ?? ""}`,
54684
+ children: /* @__PURE__ */ jsxs("div", {
54685
+ className: "border-border max-w-sm rounded-lg border border-dashed p-8 text-center",
54686
+ children: [/* @__PURE__ */ jsx("h2", {
54687
+ className: "text-foreground text-xl font-semibold",
54688
+ children: "Messaging"
54689
+ }), /* @__PURE__ */ jsx("p", {
54690
+ className: "text-muted-foreground mt-2",
54691
+ children: "Couldn't load messaging. Please refresh to try again."
54692
+ })]
54693
+ })
54694
+ });
54592
54695
  if (!messagingAuth.recipientId) return /* @__PURE__ */ jsx("div", {
54593
54696
  ...divProps,
54594
54697
  className: `flex h-full items-center justify-center ${divProps.className ?? ""}`,
@@ -54614,6 +54717,7 @@ function MessagingScreen({ onToast, filestackApiKey, websocketUrl: websocketUrlO
54614
54717
  renderImage,
54615
54718
  showAdminFeatures: false,
54616
54719
  onToast: effectiveToast,
54720
+ hideTopBar: true,
54617
54721
  messagesViewProps: {
54618
54722
  uploader,
54619
54723
  saveDrafts: true,
@@ -54622,7 +54726,8 @@ function MessagingScreen({ onToast, filestackApiKey, websocketUrl: websocketUrlO
54622
54726
  newMessageViewProps: {
54623
54727
  searchUsers,
54624
54728
  searchChannels
54625
- }
54729
+ },
54730
+ children: /* @__PURE__ */ jsx(MessagingHeaderBridge, {})
54626
54731
  })
54627
54732
  });
54628
54733
  }
@@ -54638,4 +54743,4 @@ const messagingScreenPropertySchema = {
54638
54743
  //#endregion
54639
54744
  export { useMessagingConfig as a, createFluidFileUploader as i, MessagingScreen_exports as n, useMessagingAuth as o, messagingScreenPropertySchema as r, MessagingScreen as t };
54640
54745
 
54641
- //# sourceMappingURL=MessagingScreen-Q17pdhUz.mjs.map
54746
+ //# sourceMappingURL=MessagingScreen-CWSeAq3b.mjs.map