@fluid-app/portal-sdk 0.1.773 → 0.1.775
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.
- package/dist/{MessagingScreen-S4baDPu5.mjs → MessagingScreen-9bvuUG70.mjs} +21 -16
- package/dist/{MessagingScreen-S4baDPu5.mjs.map → MessagingScreen-9bvuUG70.mjs.map} +1 -1
- package/dist/{MessagingScreen-D40YBLhk.cjs → MessagingScreen-Bf1Uuk27.cjs} +21 -16
- package/dist/{MessagingScreen-D40YBLhk.cjs.map → MessagingScreen-Bf1Uuk27.cjs.map} +1 -1
- package/dist/{MessagingScreen-DcUKEzmk.cjs → MessagingScreen-D3Wis6JL.cjs} +1 -1
- package/dist/{MessagingScreen-CCu7cvFm.mjs → MessagingScreen-DuH4iPAY.mjs} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +2 -2
|
@@ -37967,28 +37967,33 @@ function MessageReactions({ reactions: rawReactions, my_reaction, onUnreact, onR
|
|
|
37967
37967
|
if (userHasReactedA !== splitEmojis(my_reaction).includes(emojiB)) return userHasReactedA ? -1 : 1;
|
|
37968
37968
|
return emojiA.localeCompare(emojiB);
|
|
37969
37969
|
}).map(([clickedEmoji, count]) => {
|
|
37970
|
+
const currentReactionEmojis = splitEmojis(my_reaction);
|
|
37971
|
+
const isMine = currentReactionEmojis.includes(clickedEmoji);
|
|
37972
|
+
const remainingReaction = generateSortedEmojiStringFromArray(currentReactionEmojis.filter((emoji) => emoji !== clickedEmoji));
|
|
37973
|
+
const clickHandler = isMine && remainingReaction === "" ? onUnreact : onReact;
|
|
37970
37974
|
return /* @__PURE__ */ jsxs(m.button, {
|
|
37975
|
+
disabled: !clickHandler,
|
|
37971
37976
|
layoutId: prefersReducedMotion ? void 0 : `reaction-${id}-${clickedEmoji}`,
|
|
37972
37977
|
layout: prefersReducedMotion ? false : "position",
|
|
37973
37978
|
initial: prefersReducedMotion ? false : { opacity: 0 },
|
|
37974
37979
|
animate: prefersReducedMotion ? void 0 : { opacity: 1 },
|
|
37975
37980
|
exit: prefersReducedMotion ? void 0 : { opacity: 0 },
|
|
37976
|
-
className: twMerge("relative z-10 flex h-6 items-center gap-1.5 overflow-clip rounded-md border",
|
|
37981
|
+
className: twMerge("relative z-10 flex h-6 items-center gap-1.5 overflow-clip rounded-md border", isMine ? "border-[color:var(--messaging-border,var(--color-gray-200))] bg-[color:var(--messaging-muted,var(--color-gray-100))] px-1.5 text-[color:var(--messaging-muted-foreground,var(--color-gray-400))] hover:bg-[color:var(--messaging-muted,var(--color-gray-200))] active:border-[color:var(--messaging-border,var(--color-gray-300))] active:bg-[color:var(--messaging-muted,var(--color-gray-300))]" : "border-[color:var(--messaging-border,var(--color-gray-200))] bg-[color:var(--messaging-background,var(--color-white))] px-1.5 text-[color:var(--messaging-muted-foreground,var(--color-gray-400))] hover:bg-[color:var(--messaging-muted,var(--color-gray-200))] active:border-[color:var(--messaging-border,var(--color-gray-300))] active:bg-[color:var(--messaging-muted,var(--color-gray-300))]"),
|
|
37977
37982
|
style: { "--emoji": `"${clickedEmoji}"` },
|
|
37978
37983
|
onClick: () => {
|
|
37979
|
-
|
|
37980
|
-
|
|
37981
|
-
|
|
37982
|
-
|
|
37983
|
-
|
|
37984
|
-
}
|
|
37984
|
+
if (isMine) if (remainingReaction === "") onUnreact?.();
|
|
37985
|
+
else onReact?.(remainingReaction);
|
|
37986
|
+
else {
|
|
37987
|
+
const newReactionString = generateSortedEmojiStringFromArray([...currentReactionEmojis, clickedEmoji]);
|
|
37988
|
+
onReact?.(newReactionString);
|
|
37989
|
+
}
|
|
37985
37990
|
},
|
|
37986
37991
|
children: [/* @__PURE__ */ jsx("div", { children: clickedEmoji }), /* @__PURE__ */ jsx(AnimateNumber, {
|
|
37987
37992
|
className: "text-xs font-medium",
|
|
37988
37993
|
children: count
|
|
37989
37994
|
})]
|
|
37990
37995
|
}, clickedEmoji);
|
|
37991
|
-
}), /* @__PURE__ */ jsx(m.div, {
|
|
37996
|
+
}), onReact && /* @__PURE__ */ jsx(m.div, {
|
|
37992
37997
|
layout: prefersReducedMotion ? false : "position",
|
|
37993
37998
|
layoutId: prefersReducedMotion ? void 0 : `emoji-picker-trigger-${id}`,
|
|
37994
37999
|
initial: prefersReducedMotion ? false : { opacity: 0 },
|
|
@@ -38157,7 +38162,7 @@ function Timestamp({ children: timestamp, className = "", displayMode = "auto" }
|
|
|
38157
38162
|
}
|
|
38158
38163
|
//#endregion
|
|
38159
38164
|
//#region ../../messaging/ui/src/components/Message.tsx
|
|
38160
|
-
function Message({ conversation, message, isGrouped, highlightType = "auto", renderProfileTrigger, renderProfileContent, renderImage, onPinError, onCopyLinkSuccess, onCopyLinkError, getMessageLink }) {
|
|
38165
|
+
function Message({ conversation, message, isGrouped, highlightType = "auto", renderProfileTrigger, renderProfileContent, renderImage, onPinError, onCopyLinkSuccess, onCopyLinkError, getMessageLink, canUpdate = true }) {
|
|
38161
38166
|
const { t } = useMessagingTranslation();
|
|
38162
38167
|
const isMobile = useIsMobile() === true;
|
|
38163
38168
|
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
@@ -38239,7 +38244,7 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
38239
38244
|
/* @__PURE__ */ jsx("div", { className: cn("absolute inset-0 top-4 -z-10 group-hover/message:bg-[color:var(--messaging-muted,var(--color-gray-50))]", pinned && highlightType === "auto" && "bg-amber-50 group-hover/message:bg-amber-100/75", highlightType === "search" && "bg-[color:var(--messaging-primary-tint,var(--color-blue-50))] group-hover/message:bg-[color:var(--messaging-primary-tint,var(--color-blue-100))]/75") }),
|
|
38240
38245
|
/* @__PURE__ */ jsxs("div", {
|
|
38241
38246
|
className: cn("text-muted-foreground md:border-border md:bg-background visible absolute top-2 right-2 flex items-center gap-1 rounded-full bg-transparent p-0 md:invisible md:top-0 md:right-4 md:rounded-md md:border md:p-1 md:shadow-lg md:group-hover/message:visible", emojiPickerOpen && "visible", optionsOpen && "visible"),
|
|
38242
|
-
children: [conversation.type !== "SmsConversation" && conversation.type !== "EmailConversation" && /* @__PURE__ */ jsxs(Popover, {
|
|
38247
|
+
children: [canUpdate && conversation.type !== "SmsConversation" && conversation.type !== "EmailConversation" && /* @__PURE__ */ jsxs(Popover, {
|
|
38243
38248
|
modal: false,
|
|
38244
38249
|
open: emojiPickerOpen,
|
|
38245
38250
|
onOpenChange: setEmojiPickerOpen,
|
|
@@ -38274,11 +38279,11 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
38274
38279
|
open: optionsOpen,
|
|
38275
38280
|
onOpenChange: setOptionsOpen,
|
|
38276
38281
|
title: t("header_more_options"),
|
|
38277
|
-
actions: [{
|
|
38282
|
+
actions: [...canUpdate ? [{
|
|
38278
38283
|
id: "pin",
|
|
38279
38284
|
label: pinned ? t("message_unpin") : t("message_pin"),
|
|
38280
38285
|
onSelect: () => setPin(!pinned)
|
|
38281
|
-
}, {
|
|
38286
|
+
}] : [], {
|
|
38282
38287
|
id: "copy-link",
|
|
38283
38288
|
label: t("message_copy_link"),
|
|
38284
38289
|
onSelect: () => void copyMessageLink()
|
|
@@ -38295,7 +38300,7 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
38295
38300
|
sideOffset: 8,
|
|
38296
38301
|
alignOffset: -6,
|
|
38297
38302
|
className: "w-60",
|
|
38298
|
-
children: [/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
38303
|
+
children: [canUpdate && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
38299
38304
|
onSelect: () => {
|
|
38300
38305
|
setPin(!pinned);
|
|
38301
38306
|
setOptionsOpen(false);
|
|
@@ -38350,8 +38355,8 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
38350
38355
|
/* @__PURE__ */ jsx(MessageReactions, {
|
|
38351
38356
|
reactions: message.reaction_stats,
|
|
38352
38357
|
my_reaction: message.reaction,
|
|
38353
|
-
onUnreact: removeReaction,
|
|
38354
|
-
onReact: addReaction
|
|
38358
|
+
onUnreact: canUpdate ? removeReaction : void 0,
|
|
38359
|
+
onReact: canUpdate ? addReaction : void 0
|
|
38355
38360
|
})
|
|
38356
38361
|
]
|
|
38357
38362
|
})
|
|
@@ -58683,4 +58688,4 @@ const messagingScreenPropertySchema = {
|
|
|
58683
58688
|
//#endregion
|
|
58684
58689
|
export { BottomNavVisibilityProvider as a, useMessagingAuth as i, messagingScreenPropertySchema as n, useBottomNavHidden as o, useMessagingConfig as r, MessagingScreen as t };
|
|
58685
58690
|
|
|
58686
|
-
//# sourceMappingURL=MessagingScreen-
|
|
58691
|
+
//# sourceMappingURL=MessagingScreen-9bvuUG70.mjs.map
|