@fluid-app/portal-sdk 0.1.773 → 0.1.774
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
|
@@ -39873,28 +39873,33 @@ function MessageReactions({ reactions: rawReactions, my_reaction, onUnreact, onR
|
|
|
39873
39873
|
if (userHasReactedA !== splitEmojis(my_reaction).includes(emojiB)) return userHasReactedA ? -1 : 1;
|
|
39874
39874
|
return emojiA.localeCompare(emojiB);
|
|
39875
39875
|
}).map(([clickedEmoji, count]) => {
|
|
39876
|
+
const currentReactionEmojis = splitEmojis(my_reaction);
|
|
39877
|
+
const isMine = currentReactionEmojis.includes(clickedEmoji);
|
|
39878
|
+
const remainingReaction = generateSortedEmojiStringFromArray(currentReactionEmojis.filter((emoji) => emoji !== clickedEmoji));
|
|
39879
|
+
const clickHandler = isMine && remainingReaction === "" ? onUnreact : onReact;
|
|
39876
39880
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(m.button, {
|
|
39881
|
+
disabled: !clickHandler,
|
|
39877
39882
|
layoutId: prefersReducedMotion ? void 0 : `reaction-${id}-${clickedEmoji}`,
|
|
39878
39883
|
layout: prefersReducedMotion ? false : "position",
|
|
39879
39884
|
initial: prefersReducedMotion ? false : { opacity: 0 },
|
|
39880
39885
|
animate: prefersReducedMotion ? void 0 : { opacity: 1 },
|
|
39881
39886
|
exit: prefersReducedMotion ? void 0 : { opacity: 0 },
|
|
39882
|
-
className: (0, tailwind_merge.twMerge)("relative z-10 flex h-6 items-center gap-1.5 overflow-clip rounded-md border",
|
|
39887
|
+
className: (0, tailwind_merge.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))]"),
|
|
39883
39888
|
style: { "--emoji": `"${clickedEmoji}"` },
|
|
39884
39889
|
onClick: () => {
|
|
39885
|
-
|
|
39886
|
-
|
|
39887
|
-
|
|
39888
|
-
|
|
39889
|
-
|
|
39890
|
-
}
|
|
39890
|
+
if (isMine) if (remainingReaction === "") onUnreact?.();
|
|
39891
|
+
else onReact?.(remainingReaction);
|
|
39892
|
+
else {
|
|
39893
|
+
const newReactionString = generateSortedEmojiStringFromArray([...currentReactionEmojis, clickedEmoji]);
|
|
39894
|
+
onReact?.(newReactionString);
|
|
39895
|
+
}
|
|
39891
39896
|
},
|
|
39892
39897
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: clickedEmoji }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AnimateNumber, {
|
|
39893
39898
|
className: "text-xs font-medium",
|
|
39894
39899
|
children: count
|
|
39895
39900
|
})]
|
|
39896
39901
|
}, clickedEmoji);
|
|
39897
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(m.div, {
|
|
39902
|
+
}), onReact && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(m.div, {
|
|
39898
39903
|
layout: prefersReducedMotion ? false : "position",
|
|
39899
39904
|
layoutId: prefersReducedMotion ? void 0 : `emoji-picker-trigger-${id}`,
|
|
39900
39905
|
initial: prefersReducedMotion ? false : { opacity: 0 },
|
|
@@ -40063,7 +40068,7 @@ function Timestamp({ children: timestamp, className = "", displayMode = "auto" }
|
|
|
40063
40068
|
}
|
|
40064
40069
|
//#endregion
|
|
40065
40070
|
//#region ../../messaging/ui/src/components/Message.tsx
|
|
40066
|
-
function Message({ conversation, message, isGrouped, highlightType = "auto", renderProfileTrigger, renderProfileContent, renderImage, onPinError, onCopyLinkSuccess, onCopyLinkError, getMessageLink }) {
|
|
40071
|
+
function Message({ conversation, message, isGrouped, highlightType = "auto", renderProfileTrigger, renderProfileContent, renderImage, onPinError, onCopyLinkSuccess, onCopyLinkError, getMessageLink, canUpdate = true }) {
|
|
40067
40072
|
const { t } = useMessagingTranslation();
|
|
40068
40073
|
const isMobile = useIsMobile() === true;
|
|
40069
40074
|
const [emojiPickerOpen, setEmojiPickerOpen] = (0, react.useState)(false);
|
|
@@ -40145,7 +40150,7 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
40145
40150
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_src.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") }),
|
|
40146
40151
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
40147
40152
|
className: require_src.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"),
|
|
40148
|
-
children: [conversation.type !== "SmsConversation" && conversation.type !== "EmailConversation" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Popover, {
|
|
40153
|
+
children: [canUpdate && conversation.type !== "SmsConversation" && conversation.type !== "EmailConversation" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.Popover, {
|
|
40149
40154
|
modal: false,
|
|
40150
40155
|
open: emojiPickerOpen,
|
|
40151
40156
|
onOpenChange: setEmojiPickerOpen,
|
|
@@ -40180,11 +40185,11 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
40180
40185
|
open: optionsOpen,
|
|
40181
40186
|
onOpenChange: setOptionsOpen,
|
|
40182
40187
|
title: t("header_more_options"),
|
|
40183
|
-
actions: [{
|
|
40188
|
+
actions: [...canUpdate ? [{
|
|
40184
40189
|
id: "pin",
|
|
40185
40190
|
label: pinned ? t("message_unpin") : t("message_pin"),
|
|
40186
40191
|
onSelect: () => setPin(!pinned)
|
|
40187
|
-
}, {
|
|
40192
|
+
}] : [], {
|
|
40188
40193
|
id: "copy-link",
|
|
40189
40194
|
label: t("message_copy_link"),
|
|
40190
40195
|
onSelect: () => void copyMessageLink()
|
|
@@ -40201,7 +40206,7 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
40201
40206
|
sideOffset: 8,
|
|
40202
40207
|
alignOffset: -6,
|
|
40203
40208
|
className: "w-60",
|
|
40204
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
|
|
40209
|
+
children: [canUpdate && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DropdownMenuItem, {
|
|
40205
40210
|
onSelect: () => {
|
|
40206
40211
|
setPin(!pinned);
|
|
40207
40212
|
setOptionsOpen(false);
|
|
@@ -40256,8 +40261,8 @@ function Message({ conversation, message, isGrouped, highlightType = "auto", ren
|
|
|
40256
40261
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageReactions, {
|
|
40257
40262
|
reactions: message.reaction_stats,
|
|
40258
40263
|
my_reaction: message.reaction,
|
|
40259
|
-
onUnreact: removeReaction,
|
|
40260
|
-
onReact: addReaction
|
|
40264
|
+
onUnreact: canUpdate ? removeReaction : void 0,
|
|
40265
|
+
onReact: canUpdate ? addReaction : void 0
|
|
40261
40266
|
})
|
|
40262
40267
|
]
|
|
40263
40268
|
})
|
|
@@ -61279,4 +61284,4 @@ Object.defineProperty(exports, "useMessagingConfig", {
|
|
|
61279
61284
|
}
|
|
61280
61285
|
});
|
|
61281
61286
|
|
|
61282
|
-
//# sourceMappingURL=MessagingScreen-
|
|
61287
|
+
//# sourceMappingURL=MessagingScreen-Bf1Uuk27.cjs.map
|