@liveblocks/react-ui 2.14.0 → 2.15.0
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/_private/index.d.mts +24 -22
- package/dist/_private/index.d.ts +24 -22
- package/dist/_private/index.js +1 -0
- package/dist/_private/index.js.map +1 -1
- package/dist/_private/index.mjs +1 -0
- package/dist/_private/index.mjs.map +1 -1
- package/dist/components/Comment.js +358 -256
- package/dist/components/Comment.js.map +1 -1
- package/dist/components/Comment.mjs +334 -232
- package/dist/components/Comment.mjs.map +1 -1
- package/dist/components/Composer.js +308 -225
- package/dist/components/Composer.js.map +1 -1
- package/dist/components/Composer.mjs +288 -206
- package/dist/components/Composer.mjs.map +1 -1
- package/dist/components/HistoryVersionSummary.js +28 -32
- package/dist/components/HistoryVersionSummary.js.map +1 -1
- package/dist/components/HistoryVersionSummary.mjs +27 -31
- package/dist/components/HistoryVersionSummary.mjs.map +1 -1
- package/dist/components/HistoryVersionSummaryList.js +11 -9
- package/dist/components/HistoryVersionSummaryList.js.map +1 -1
- package/dist/components/HistoryVersionSummaryList.mjs +10 -8
- package/dist/components/HistoryVersionSummaryList.mjs.map +1 -1
- package/dist/components/InboxNotification.js +202 -143
- package/dist/components/InboxNotification.js.map +1 -1
- package/dist/components/InboxNotification.mjs +180 -121
- package/dist/components/InboxNotification.mjs.map +1 -1
- package/dist/components/InboxNotificationList.js +19 -14
- package/dist/components/InboxNotificationList.js.map +1 -1
- package/dist/components/InboxNotificationList.mjs +17 -12
- package/dist/components/InboxNotificationList.mjs.map +1 -1
- package/dist/components/Thread.js +104 -86
- package/dist/components/Thread.js.map +1 -1
- package/dist/components/Thread.mjs +93 -75
- package/dist/components/Thread.mjs.map +1 -1
- package/dist/components/internal/Attachment.js +161 -113
- package/dist/components/internal/Attachment.js.map +1 -1
- package/dist/components/internal/Attachment.mjs +150 -102
- package/dist/components/internal/Attachment.mjs.map +1 -1
- package/dist/components/internal/Attribution.js +15 -13
- package/dist/components/internal/Attribution.js.map +1 -1
- package/dist/components/internal/Attribution.mjs +15 -13
- package/dist/components/internal/Attribution.mjs.map +1 -1
- package/dist/components/internal/Avatar.js +27 -20
- package/dist/components/internal/Avatar.js.map +1 -1
- package/dist/components/internal/Avatar.mjs +23 -16
- package/dist/components/internal/Avatar.mjs.map +1 -1
- package/dist/components/internal/Button.js +5 -4
- package/dist/components/internal/Button.js.map +1 -1
- package/dist/components/internal/Button.mjs +4 -3
- package/dist/components/internal/Button.mjs.map +1 -1
- package/dist/components/internal/Dropdown.js +27 -19
- package/dist/components/internal/Dropdown.js.map +1 -1
- package/dist/components/internal/Dropdown.mjs +26 -18
- package/dist/components/internal/Dropdown.mjs.map +1 -1
- package/dist/components/internal/Emoji.js +4 -3
- package/dist/components/internal/Emoji.js.map +1 -1
- package/dist/components/internal/Emoji.mjs +3 -2
- package/dist/components/internal/Emoji.mjs.map +1 -1
- package/dist/components/internal/EmojiPicker.js +96 -72
- package/dist/components/internal/EmojiPicker.js.map +1 -1
- package/dist/components/internal/EmojiPicker.mjs +90 -66
- package/dist/components/internal/EmojiPicker.mjs.map +1 -1
- package/dist/components/internal/Icon.js +5 -4
- package/dist/components/internal/Icon.js.map +1 -1
- package/dist/components/internal/Icon.mjs +5 -4
- package/dist/components/internal/Icon.mjs.map +1 -1
- package/dist/components/internal/InboxNotificationThread.js +53 -38
- package/dist/components/internal/InboxNotificationThread.js.map +1 -1
- package/dist/components/internal/InboxNotificationThread.mjs +53 -38
- package/dist/components/internal/InboxNotificationThread.mjs.map +1 -1
- package/dist/components/internal/List.js +8 -6
- package/dist/components/internal/List.js.map +1 -1
- package/dist/components/internal/List.mjs +6 -4
- package/dist/components/internal/List.mjs.map +1 -1
- package/dist/components/internal/Room.js +8 -6
- package/dist/components/internal/Room.js.map +1 -1
- package/dist/components/internal/Room.mjs +7 -5
- package/dist/components/internal/Room.mjs.map +1 -1
- package/dist/components/internal/Tooltip.js +49 -33
- package/dist/components/internal/Tooltip.js.map +1 -1
- package/dist/components/internal/Tooltip.mjs +46 -30
- package/dist/components/internal/Tooltip.mjs.map +1 -1
- package/dist/components/internal/User.js +8 -6
- package/dist/components/internal/User.js.map +1 -1
- package/dist/components/internal/User.mjs +7 -5
- package/dist/components/internal/User.mjs.map +1 -1
- package/dist/components.js +12 -29
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +6 -5
- package/dist/components.mjs.map +1 -1
- package/dist/config.js +16 -12
- package/dist/config.js.map +1 -1
- package/dist/config.mjs +13 -9
- package/dist/config.mjs.map +1 -1
- package/dist/icons/ArrowDown.js +7 -6
- package/dist/icons/ArrowDown.js.map +1 -1
- package/dist/icons/ArrowDown.mjs +7 -6
- package/dist/icons/ArrowDown.mjs.map +1 -1
- package/dist/icons/ArrowUp.js +7 -6
- package/dist/icons/ArrowUp.js.map +1 -1
- package/dist/icons/ArrowUp.mjs +7 -6
- package/dist/icons/ArrowUp.mjs.map +1 -1
- package/dist/icons/Attachment.js +7 -6
- package/dist/icons/Attachment.js.map +1 -1
- package/dist/icons/Attachment.mjs +7 -6
- package/dist/icons/Attachment.mjs.map +1 -1
- package/dist/icons/Bold.js +7 -6
- package/dist/icons/Bold.js.map +1 -1
- package/dist/icons/Bold.mjs +7 -6
- package/dist/icons/Bold.mjs.map +1 -1
- package/dist/icons/Check.js +7 -6
- package/dist/icons/Check.js.map +1 -1
- package/dist/icons/Check.mjs +7 -6
- package/dist/icons/Check.mjs.map +1 -1
- package/dist/icons/Code.js +7 -6
- package/dist/icons/Code.js.map +1 -1
- package/dist/icons/Code.mjs +7 -6
- package/dist/icons/Code.mjs.map +1 -1
- package/dist/icons/Cross.js +12 -8
- package/dist/icons/Cross.js.map +1 -1
- package/dist/icons/Cross.mjs +12 -8
- package/dist/icons/Cross.mjs.map +1 -1
- package/dist/icons/Delete.js +7 -6
- package/dist/icons/Delete.js.map +1 -1
- package/dist/icons/Delete.mjs +7 -6
- package/dist/icons/Delete.mjs.map +1 -1
- package/dist/icons/Edit.js +7 -6
- package/dist/icons/Edit.js.map +1 -1
- package/dist/icons/Edit.mjs +7 -6
- package/dist/icons/Edit.mjs.map +1 -1
- package/dist/icons/Ellipsis.js +21 -16
- package/dist/icons/Ellipsis.js.map +1 -1
- package/dist/icons/Ellipsis.mjs +21 -16
- package/dist/icons/Ellipsis.mjs.map +1 -1
- package/dist/icons/Emoji.js +25 -18
- package/dist/icons/Emoji.js.map +1 -1
- package/dist/icons/Emoji.mjs +25 -18
- package/dist/icons/Emoji.mjs.map +1 -1
- package/dist/icons/EmojiAdd.js +28 -20
- package/dist/icons/EmojiAdd.js.map +1 -1
- package/dist/icons/EmojiAdd.mjs +28 -20
- package/dist/icons/EmojiAdd.mjs.map +1 -1
- package/dist/icons/Italic.js +7 -6
- package/dist/icons/Italic.js.map +1 -1
- package/dist/icons/Italic.mjs +7 -6
- package/dist/icons/Italic.mjs.map +1 -1
- package/dist/icons/Mention.js +12 -8
- package/dist/icons/Mention.js.map +1 -1
- package/dist/icons/Mention.mjs +12 -8
- package/dist/icons/Mention.mjs.map +1 -1
- package/dist/icons/Resolve.js +14 -10
- package/dist/icons/Resolve.js.map +1 -1
- package/dist/icons/Resolve.mjs +14 -10
- package/dist/icons/Resolve.mjs.map +1 -1
- package/dist/icons/Resolved.js +16 -12
- package/dist/icons/Resolved.js.map +1 -1
- package/dist/icons/Resolved.mjs +16 -12
- package/dist/icons/Resolved.mjs.map +1 -1
- package/dist/icons/Restore.js +12 -8
- package/dist/icons/Restore.js.map +1 -1
- package/dist/icons/Restore.mjs +12 -8
- package/dist/icons/Restore.mjs.map +1 -1
- package/dist/icons/Search.js +7 -6
- package/dist/icons/Search.js.map +1 -1
- package/dist/icons/Search.mjs +7 -6
- package/dist/icons/Search.mjs.map +1 -1
- package/dist/icons/Send.js +7 -6
- package/dist/icons/Send.js.map +1 -1
- package/dist/icons/Send.mjs +7 -6
- package/dist/icons/Send.mjs.map +1 -1
- package/dist/icons/Spinner.js +8 -7
- package/dist/icons/Spinner.js.map +1 -1
- package/dist/icons/Spinner.mjs +8 -7
- package/dist/icons/Spinner.mjs.map +1 -1
- package/dist/icons/Strikethrough.js +7 -6
- package/dist/icons/Strikethrough.js.map +1 -1
- package/dist/icons/Strikethrough.mjs +7 -6
- package/dist/icons/Strikethrough.mjs.map +1 -1
- package/dist/icons/Warning.js +14 -10
- package/dist/icons/Warning.js.map +1 -1
- package/dist/icons/Warning.mjs +14 -10
- package/dist/icons/Warning.mjs.map +1 -1
- package/dist/icons/index.js +42 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/index.mjs +19 -0
- package/dist/icons/index.mjs.map +1 -0
- package/dist/index.d.mts +14 -12
- package/dist/index.d.ts +14 -12
- package/dist/overrides.js +65 -36
- package/dist/overrides.js.map +1 -1
- package/dist/overrides.mjs +59 -12
- package/dist/overrides.mjs.map +1 -1
- package/dist/primitives/Comment/index.js +75 -66
- package/dist/primitives/Comment/index.js.map +1 -1
- package/dist/primitives/Comment/index.mjs +71 -62
- package/dist/primitives/Comment/index.mjs.map +1 -1
- package/dist/primitives/Composer/contexts.js +11 -11
- package/dist/primitives/Composer/index.js +343 -284
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Composer/index.mjs +262 -203
- package/dist/primitives/Composer/index.mjs.map +1 -1
- package/dist/primitives/Composer/utils.js +20 -21
- package/dist/primitives/Composer/utils.js.map +1 -1
- package/dist/primitives/Composer/utils.mjs +4 -5
- package/dist/primitives/Composer/utils.mjs.map +1 -1
- package/dist/primitives/EmojiPicker/contexts.js +3 -3
- package/dist/primitives/EmojiPicker/index.js +160 -142
- package/dist/primitives/EmojiPicker/index.js.map +1 -1
- package/dist/primitives/EmojiPicker/index.mjs +122 -104
- package/dist/primitives/EmojiPicker/index.mjs.map +1 -1
- package/dist/primitives/FileSize.js +9 -7
- package/dist/primitives/FileSize.js.map +1 -1
- package/dist/primitives/FileSize.mjs +7 -5
- package/dist/primitives/FileSize.mjs.map +1 -1
- package/dist/primitives/Timestamp.js +12 -10
- package/dist/primitives/Timestamp.js.map +1 -1
- package/dist/primitives/Timestamp.mjs +7 -5
- package/dist/primitives/Timestamp.mjs.map +1 -1
- package/dist/primitives/index.d.mts +24 -23
- package/dist/primitives/index.d.ts +24 -23
- package/dist/primitives/internal/Emoji.js +7 -5
- package/dist/primitives/internal/Emoji.js.map +1 -1
- package/dist/primitives/internal/Emoji.mjs +6 -4
- package/dist/primitives/internal/Emoji.mjs.map +1 -1
- package/dist/shared.js +2 -7
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +2 -7
- package/dist/shared.mjs.map +1 -1
- package/dist/slate/plugins/auto-links.mjs +1 -1
- package/dist/slate/plugins/custom-links.mjs +1 -1
- package/dist/slate/plugins/mentions.mjs +1 -1
- package/dist/utils/Persist.js +19 -18
- package/dist/utils/Persist.js.map +1 -1
- package/dist/utils/Persist.mjs +7 -6
- package/dist/utils/Persist.mjs.map +1 -1
- package/dist/utils/Portal.js +5 -4
- package/dist/utils/Portal.js.map +1 -1
- package/dist/utils/Portal.mjs +4 -3
- package/dist/utils/Portal.mjs.map +1 -1
- package/dist/utils/use-controllable-state.js +5 -5
- package/dist/utils/use-index.js +7 -7
- package/dist/utils/use-initial.js +2 -2
- package/dist/utils/use-interval.js +4 -4
- package/dist/utils/use-latest.js +3 -3
- package/dist/utils/use-observable.js +2 -2
- package/dist/utils/use-refs.js +2 -2
- package/dist/utils/use-rerender.js +2 -2
- package/dist/utils/use-visible.js +24 -2
- package/dist/utils/use-visible.js.map +1 -1
- package/dist/utils/use-visible.mjs +23 -2
- package/dist/utils/use-visible.mjs.map +1 -1
- package/dist/utils/use-window-focus.js +2 -2
- package/dist/utils/use-window-focus.js.map +1 -1
- package/dist/utils/use-window-focus.mjs +1 -1
- package/dist/utils/use-window-focus.mjs.map +1 -1
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/dist/version.mjs +2 -2
- package/dist/version.mjs.map +1 -1
- package/package.json +10 -25
- package/dist/utils/use-id.js +0 -29
- package/dist/utils/use-id.js.map +0 -1
- package/dist/utils/use-id.mjs +0 -27
- package/dist/utils/use-id.mjs.map +0 -1
- package/dist/utils/use-layout-effect.js +0 -8
- package/dist/utils/use-layout-effect.js.map +0 -1
- package/dist/utils/use-layout-effect.mjs +0 -6
- package/dist/utils/use-layout-effect.mjs.map +0 -1
- package/dist/utils/use-transition.js +0 -16
- package/dist/utils/use-transition.js.map +0 -1
- package/dist/utils/use-transition.mjs +0 -14
- package/dist/utils/use-transition.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var core = require('@liveblocks/core');
|
|
5
|
-
var react = require('@liveblocks/react');
|
|
5
|
+
var react$1 = require('@liveblocks/react');
|
|
6
6
|
var reactSlot = require('@radix-ui/react-slot');
|
|
7
7
|
var TooltipPrimitive = require('@radix-ui/react-tooltip');
|
|
8
|
-
var
|
|
8
|
+
var react = require('react');
|
|
9
9
|
var components = require('../components.js');
|
|
10
10
|
var Check = require('../icons/Check.js');
|
|
11
11
|
var Delete = require('../icons/Delete.js');
|
|
@@ -26,7 +26,8 @@ var Tooltip = require('./internal/Tooltip.js');
|
|
|
26
26
|
var User = require('./internal/User.js');
|
|
27
27
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
"use client";
|
|
30
|
+
const InboxNotificationLayout = react.forwardRef(
|
|
30
31
|
({
|
|
31
32
|
inboxNotification,
|
|
32
33
|
children,
|
|
@@ -47,10 +48,10 @@ const InboxNotificationLayout = React.forwardRef(
|
|
|
47
48
|
const $ = overrides.useOverrides(overrides$1);
|
|
48
49
|
const { Anchor } = components.useComponents(components$1);
|
|
49
50
|
const Component = asChild ? reactSlot.Slot : Anchor;
|
|
50
|
-
const [isMoreActionOpen, setMoreActionOpen] =
|
|
51
|
-
const markInboxNotificationAsRead = react.useMarkInboxNotificationAsRead();
|
|
52
|
-
const deleteInboxNotification = react.useDeleteInboxNotification();
|
|
53
|
-
const handleClick =
|
|
51
|
+
const [isMoreActionOpen, setMoreActionOpen] = react.useState(false);
|
|
52
|
+
const markInboxNotificationAsRead = react$1.useMarkInboxNotificationAsRead();
|
|
53
|
+
const deleteInboxNotification = react$1.useDeleteInboxNotification();
|
|
54
|
+
const handleClick = react.useCallback(
|
|
54
55
|
(event) => {
|
|
55
56
|
onClick?.(event);
|
|
56
57
|
const shouldMarkAsReadOnClick = markAsReadOnClick ?? Boolean(href);
|
|
@@ -67,99 +68,140 @@ const InboxNotificationLayout = React.forwardRef(
|
|
|
67
68
|
unread
|
|
68
69
|
]
|
|
69
70
|
);
|
|
70
|
-
const stopPropagation =
|
|
71
|
+
const stopPropagation = react.useCallback((event) => {
|
|
71
72
|
event.stopPropagation();
|
|
72
73
|
}, []);
|
|
73
|
-
const preventDefaultAndStopPropagation =
|
|
74
|
+
const preventDefaultAndStopPropagation = react.useCallback(
|
|
74
75
|
(event) => {
|
|
75
76
|
event.preventDefault();
|
|
76
77
|
event.stopPropagation();
|
|
77
78
|
},
|
|
78
79
|
[]
|
|
79
80
|
);
|
|
80
|
-
const handleMoreClick =
|
|
81
|
+
const handleMoreClick = react.useCallback((event) => {
|
|
81
82
|
event.preventDefault();
|
|
82
83
|
event.stopPropagation();
|
|
83
84
|
setMoreActionOpen((open) => !open);
|
|
84
85
|
}, []);
|
|
85
|
-
const handleMarkAsRead =
|
|
86
|
+
const handleMarkAsRead = react.useCallback(() => {
|
|
86
87
|
markInboxNotificationAsRead(inboxNotification.id);
|
|
87
88
|
}, [inboxNotification.id, markInboxNotificationAsRead]);
|
|
88
|
-
const handleDelete =
|
|
89
|
+
const handleDelete = react.useCallback(() => {
|
|
89
90
|
deleteInboxNotification(inboxNotification.id);
|
|
90
91
|
}, [inboxNotification.id, deleteInboxNotification]);
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
92
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive.TooltipProvider, {
|
|
93
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Component, {
|
|
94
|
+
className: classNames.classNames(
|
|
95
|
+
"lb-root lb-inbox-notification",
|
|
96
|
+
showActions === "hover" && "lb-inbox-notification:show-actions-hover",
|
|
97
|
+
isMoreActionOpen && "lb-inbox-notification:action-open",
|
|
98
|
+
className
|
|
99
|
+
),
|
|
100
|
+
dir: $.dir,
|
|
101
|
+
"data-unread": unread ? "" : void 0,
|
|
102
|
+
"data-kind": inboxNotification.kind,
|
|
103
|
+
onClick: handleClick,
|
|
104
|
+
href,
|
|
105
|
+
...props,
|
|
106
|
+
ref: forwardedRef,
|
|
107
|
+
children: [
|
|
108
|
+
aside && /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
109
|
+
className: "lb-inbox-notification-aside",
|
|
110
|
+
children: aside
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
113
|
+
className: "lb-inbox-notification-content",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
116
|
+
className: "lb-inbox-notification-header",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
119
|
+
className: "lb-inbox-notification-title",
|
|
120
|
+
children: title
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
123
|
+
className: "lb-inbox-notification-details",
|
|
124
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("span", {
|
|
125
|
+
className: "lb-inbox-notification-details-labels",
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsxRuntime.jsx(Timestamp.Timestamp, {
|
|
128
|
+
locale: $.locale,
|
|
129
|
+
date,
|
|
130
|
+
className: "lb-date lb-inbox-notification-date"
|
|
131
|
+
}),
|
|
132
|
+
unread && /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
133
|
+
className: "lb-inbox-notification-unread-indicator",
|
|
134
|
+
role: "presentation"
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
})
|
|
138
|
+
}),
|
|
139
|
+
showActions && /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
140
|
+
className: "lb-inbox-notification-actions",
|
|
141
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Dropdown.Dropdown, {
|
|
142
|
+
open: isMoreActionOpen,
|
|
143
|
+
onOpenChange: setMoreActionOpen,
|
|
144
|
+
align: "end",
|
|
145
|
+
content: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
146
|
+
children: [
|
|
147
|
+
unread ? /* @__PURE__ */ jsxRuntime.jsxs(Dropdown.DropdownItem, {
|
|
148
|
+
onSelect: handleMarkAsRead,
|
|
149
|
+
onClick: stopPropagation,
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx(Check.CheckIcon, {
|
|
152
|
+
className: "lb-dropdown-item-icon"
|
|
153
|
+
}),
|
|
154
|
+
$.INBOX_NOTIFICATION_MARK_AS_READ
|
|
155
|
+
]
|
|
156
|
+
}) : null,
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Dropdown.DropdownItem, {
|
|
158
|
+
onSelect: handleDelete,
|
|
159
|
+
onClick: stopPropagation,
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsxRuntime.jsx(Delete.DeleteIcon, {
|
|
162
|
+
className: "lb-dropdown-item-icon"
|
|
163
|
+
}),
|
|
164
|
+
$.INBOX_NOTIFICATION_DELETE
|
|
165
|
+
]
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
}),
|
|
169
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, {
|
|
170
|
+
content: $.INBOX_NOTIFICATION_MORE,
|
|
171
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive.DropdownMenuTrigger, {
|
|
172
|
+
asChild: true,
|
|
173
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Button.Button, {
|
|
174
|
+
className: "lb-inbox-notification-action",
|
|
175
|
+
onClick: handleMoreClick,
|
|
176
|
+
onPointerDown: preventDefaultAndStopPropagation,
|
|
177
|
+
onPointerUp: preventDefaultAndStopPropagation,
|
|
178
|
+
"aria-label": $.INBOX_NOTIFICATION_MORE,
|
|
179
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Ellipsis.EllipsisIcon, {
|
|
180
|
+
className: "lb-button-icon"
|
|
181
|
+
})
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
190
|
+
className: "lb-inbox-notification-body",
|
|
191
|
+
children
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
})
|
|
197
|
+
});
|
|
156
198
|
}
|
|
157
199
|
);
|
|
158
200
|
function InboxNotificationIcon({
|
|
159
201
|
className,
|
|
160
202
|
...props
|
|
161
203
|
}) {
|
|
162
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
163
205
|
className: classNames.classNames("lb-inbox-notification-icon", className),
|
|
164
206
|
...props
|
|
165
207
|
});
|
|
@@ -168,12 +210,12 @@ function InboxNotificationAvatar({
|
|
|
168
210
|
className,
|
|
169
211
|
...props
|
|
170
212
|
}) {
|
|
171
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, {
|
|
172
214
|
className: classNames.classNames("lb-inbox-notification-avatar", className),
|
|
173
215
|
...props
|
|
174
216
|
});
|
|
175
217
|
}
|
|
176
|
-
const InboxNotificationThread =
|
|
218
|
+
const InboxNotificationThread = react.forwardRef(
|
|
177
219
|
({
|
|
178
220
|
inboxNotification,
|
|
179
221
|
href,
|
|
@@ -185,10 +227,10 @@ const InboxNotificationThread = React.forwardRef(
|
|
|
185
227
|
...props
|
|
186
228
|
}, forwardedRef) => {
|
|
187
229
|
const $ = overrides.useOverrides(overrides$1);
|
|
188
|
-
const thread = react.useInboxNotificationThread(inboxNotification.id);
|
|
230
|
+
const thread = react$1.useInboxNotificationThread(inboxNotification.id);
|
|
189
231
|
const currentUserId = shared.useCurrentUserId();
|
|
190
|
-
const { info } = react.useRoomInfo(inboxNotification.roomId);
|
|
191
|
-
const contents =
|
|
232
|
+
const { info } = react$1.useRoomInfo(inboxNotification.roomId);
|
|
233
|
+
const contents = react.useMemo(() => {
|
|
192
234
|
const contents2 = InboxNotificationThread$1.generateInboxNotificationThreadContents(
|
|
193
235
|
inboxNotification,
|
|
194
236
|
thread,
|
|
@@ -201,35 +243,34 @@ const InboxNotificationThread = React.forwardRef(
|
|
|
201
243
|
case "comments": {
|
|
202
244
|
const reversedUserIds = [...contents2.userIds].reverse();
|
|
203
245
|
const firstUserId = reversedUserIds[0];
|
|
204
|
-
const aside2 = /* @__PURE__ */
|
|
246
|
+
const aside2 = /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationAvatar, {
|
|
205
247
|
userId: firstUserId
|
|
206
248
|
});
|
|
207
249
|
const title2 = $.INBOX_NOTIFICATION_THREAD_COMMENTS_LIST(
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
values: reversedUserIds.map((userId) => /* @__PURE__ */
|
|
210
|
-
key: userId,
|
|
250
|
+
/* @__PURE__ */ jsxRuntime.jsx(List.List, {
|
|
251
|
+
values: reversedUserIds.map((userId) => /* @__PURE__ */ jsxRuntime.jsx(User.User, {
|
|
211
252
|
userId,
|
|
212
253
|
replaceSelf: true
|
|
213
|
-
})),
|
|
254
|
+
}, userId)),
|
|
214
255
|
formatRemaining: $.LIST_REMAINING_USERS,
|
|
215
256
|
truncate: InboxNotificationThread$1.INBOX_NOTIFICATION_THREAD_MAX_COMMENTS - 1,
|
|
216
257
|
locale: $.locale
|
|
217
258
|
}),
|
|
218
|
-
showRoomName ? /* @__PURE__ */
|
|
259
|
+
showRoomName ? /* @__PURE__ */ jsxRuntime.jsx(Room.Room, {
|
|
219
260
|
roomId: thread.roomId
|
|
220
261
|
}) : void 0,
|
|
221
262
|
reversedUserIds.length
|
|
222
263
|
);
|
|
223
|
-
const content2 = /* @__PURE__ */
|
|
224
|
-
className: "lb-inbox-notification-comments"
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
})
|
|
264
|
+
const content2 = /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
265
|
+
className: "lb-inbox-notification-comments",
|
|
266
|
+
children: contents2.comments.map((comment) => /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationThread$1.InboxNotificationComment, {
|
|
267
|
+
comment,
|
|
268
|
+
showHeader: contents2.comments.length > 1,
|
|
269
|
+
showAttachments,
|
|
270
|
+
showReactions,
|
|
271
|
+
overrides: overrides$1
|
|
272
|
+
}, comment.id))
|
|
273
|
+
});
|
|
233
274
|
return {
|
|
234
275
|
unread: contents2.unread,
|
|
235
276
|
date: contents2.date,
|
|
@@ -243,28 +284,27 @@ const InboxNotificationThread = React.forwardRef(
|
|
|
243
284
|
case "mention": {
|
|
244
285
|
const mentionUserId = contents2.userIds[0];
|
|
245
286
|
const mentionComment = contents2.comments[0];
|
|
246
|
-
const aside2 = /* @__PURE__ */
|
|
287
|
+
const aside2 = /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationAvatar, {
|
|
247
288
|
userId: mentionUserId
|
|
248
289
|
});
|
|
249
290
|
const title2 = $.INBOX_NOTIFICATION_THREAD_MENTION(
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
key: mentionUserId,
|
|
291
|
+
/* @__PURE__ */ jsxRuntime.jsx(User.User, {
|
|
252
292
|
userId: mentionUserId
|
|
253
|
-
}),
|
|
254
|
-
showRoomName ? /* @__PURE__ */
|
|
293
|
+
}, mentionUserId),
|
|
294
|
+
showRoomName ? /* @__PURE__ */ jsxRuntime.jsx(Room.Room, {
|
|
255
295
|
roomId: thread.roomId
|
|
256
296
|
}) : void 0
|
|
257
297
|
);
|
|
258
|
-
const content2 = /* @__PURE__ */
|
|
259
|
-
className: "lb-inbox-notification-comments"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
})
|
|
298
|
+
const content2 = /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
299
|
+
className: "lb-inbox-notification-comments",
|
|
300
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationThread$1.InboxNotificationComment, {
|
|
301
|
+
comment: mentionComment,
|
|
302
|
+
showHeader: false,
|
|
303
|
+
showAttachments,
|
|
304
|
+
showReactions,
|
|
305
|
+
overrides: overrides$1
|
|
306
|
+
}, mentionComment.id)
|
|
307
|
+
});
|
|
268
308
|
return {
|
|
269
309
|
unread: contents2.unread,
|
|
270
310
|
date: contents2.date,
|
|
@@ -291,7 +331,7 @@ const InboxNotificationThread = React.forwardRef(
|
|
|
291
331
|
showReactions,
|
|
292
332
|
thread
|
|
293
333
|
]);
|
|
294
|
-
const resolvedHref =
|
|
334
|
+
const resolvedHref = react.useMemo(() => {
|
|
295
335
|
const resolvedHref2 = href ?? info?.url;
|
|
296
336
|
return resolvedHref2 ? url.generateURL(resolvedHref2, void 0, contents?.commentId) : void 0;
|
|
297
337
|
}, [contents?.commentId, href, info?.url]);
|
|
@@ -299,7 +339,7 @@ const InboxNotificationThread = React.forwardRef(
|
|
|
299
339
|
return null;
|
|
300
340
|
}
|
|
301
341
|
const { aside, title, content, date, unread } = contents;
|
|
302
|
-
return /* @__PURE__ */
|
|
342
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationLayout, {
|
|
303
343
|
inboxNotification,
|
|
304
344
|
aside,
|
|
305
345
|
title,
|
|
@@ -310,11 +350,12 @@ const InboxNotificationThread = React.forwardRef(
|
|
|
310
350
|
showActions,
|
|
311
351
|
markAsReadOnClick: false,
|
|
312
352
|
...props,
|
|
313
|
-
ref: forwardedRef
|
|
314
|
-
|
|
353
|
+
ref: forwardedRef,
|
|
354
|
+
children: content
|
|
355
|
+
});
|
|
315
356
|
}
|
|
316
357
|
);
|
|
317
|
-
const InboxNotificationTextMention =
|
|
358
|
+
const InboxNotificationTextMention = react.forwardRef(
|
|
318
359
|
({
|
|
319
360
|
inboxNotification,
|
|
320
361
|
showActions = "hover",
|
|
@@ -323,20 +364,19 @@ const InboxNotificationTextMention = React.forwardRef(
|
|
|
323
364
|
...props
|
|
324
365
|
}, ref) => {
|
|
325
366
|
const $ = overrides.useOverrides(overrides$1);
|
|
326
|
-
const unread =
|
|
367
|
+
const unread = react.useMemo(() => {
|
|
327
368
|
return !inboxNotification.readAt || inboxNotification.notifiedAt > inboxNotification.readAt;
|
|
328
369
|
}, [inboxNotification.notifiedAt, inboxNotification.readAt]);
|
|
329
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationLayout, {
|
|
330
371
|
inboxNotification,
|
|
331
|
-
aside: /* @__PURE__ */
|
|
372
|
+
aside: /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationAvatar, {
|
|
332
373
|
userId: inboxNotification.createdBy
|
|
333
374
|
}),
|
|
334
375
|
title: $.INBOX_NOTIFICATION_TEXT_MENTION(
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
-
key: inboxNotification.createdBy,
|
|
376
|
+
/* @__PURE__ */ jsxRuntime.jsx(User.User, {
|
|
337
377
|
userId: inboxNotification.createdBy
|
|
338
|
-
}),
|
|
339
|
-
showRoomName ? /* @__PURE__ */
|
|
378
|
+
}, inboxNotification.createdBy),
|
|
379
|
+
showRoomName ? /* @__PURE__ */ jsxRuntime.jsx(Room.Room, {
|
|
340
380
|
roomId: inboxNotification.roomId
|
|
341
381
|
}) : void 0
|
|
342
382
|
),
|
|
@@ -349,7 +389,7 @@ const InboxNotificationTextMention = React.forwardRef(
|
|
|
349
389
|
});
|
|
350
390
|
}
|
|
351
391
|
);
|
|
352
|
-
const InboxNotificationCustom =
|
|
392
|
+
const InboxNotificationCustom = react.forwardRef(
|
|
353
393
|
({
|
|
354
394
|
inboxNotification,
|
|
355
395
|
showActions = "hover",
|
|
@@ -359,10 +399,10 @@ const InboxNotificationCustom = React.forwardRef(
|
|
|
359
399
|
overrides,
|
|
360
400
|
...props
|
|
361
401
|
}, forwardedRef) => {
|
|
362
|
-
const unread =
|
|
402
|
+
const unread = react.useMemo(() => {
|
|
363
403
|
return !inboxNotification.readAt || inboxNotification.notifiedAt > inboxNotification.readAt;
|
|
364
404
|
}, [inboxNotification.notifiedAt, inboxNotification.readAt]);
|
|
365
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationLayout, {
|
|
366
406
|
inboxNotification,
|
|
367
407
|
aside,
|
|
368
408
|
title,
|
|
@@ -371,28 +411,47 @@ const InboxNotificationCustom = React.forwardRef(
|
|
|
371
411
|
overrides,
|
|
372
412
|
showActions,
|
|
373
413
|
...props,
|
|
374
|
-
ref: forwardedRef
|
|
375
|
-
|
|
414
|
+
ref: forwardedRef,
|
|
415
|
+
children
|
|
416
|
+
});
|
|
376
417
|
}
|
|
377
418
|
);
|
|
378
|
-
const InboxNotificationCustomMissing =
|
|
379
|
-
return /* @__PURE__ */
|
|
419
|
+
const InboxNotificationCustomMissing = react.forwardRef(({ inboxNotification, ...props }, forwardedRef) => {
|
|
420
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(InboxNotificationCustom, {
|
|
380
421
|
inboxNotification,
|
|
381
422
|
...props,
|
|
382
|
-
title: /* @__PURE__ */
|
|
383
|
-
|
|
423
|
+
title: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
424
|
+
children: [
|
|
425
|
+
"Custom notification kind ",
|
|
426
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", {
|
|
427
|
+
children: inboxNotification.kind
|
|
428
|
+
}),
|
|
429
|
+
" is not handled"
|
|
430
|
+
]
|
|
431
|
+
}),
|
|
432
|
+
aside: /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationIcon, {
|
|
433
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Warning.WarningIcon, {})
|
|
434
|
+
}),
|
|
384
435
|
ref: forwardedRef,
|
|
385
|
-
"data-missing": ""
|
|
386
|
-
|
|
436
|
+
"data-missing": "",
|
|
437
|
+
children: [
|
|
438
|
+
"Notifications of this kind won\u2019t be displayed in production. Use the",
|
|
439
|
+
" ",
|
|
440
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", {
|
|
441
|
+
children: "kinds"
|
|
442
|
+
}),
|
|
443
|
+
" prop to define how they should be rendered."
|
|
444
|
+
]
|
|
445
|
+
});
|
|
387
446
|
});
|
|
388
447
|
const inboxNotificationKindsWarnings = /* @__PURE__ */ new Set();
|
|
389
448
|
const InboxNotification = Object.assign(
|
|
390
|
-
|
|
449
|
+
react.forwardRef(
|
|
391
450
|
({ inboxNotification, kinds, ...props }, forwardedRef) => {
|
|
392
451
|
switch (inboxNotification.kind) {
|
|
393
452
|
case "thread": {
|
|
394
453
|
const ResolvedInboxNotificationThread = kinds?.thread ?? InboxNotificationThread;
|
|
395
|
-
return /* @__PURE__ */
|
|
454
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ResolvedInboxNotificationThread, {
|
|
396
455
|
inboxNotification,
|
|
397
456
|
...props,
|
|
398
457
|
ref: forwardedRef
|
|
@@ -400,7 +459,7 @@ const InboxNotification = Object.assign(
|
|
|
400
459
|
}
|
|
401
460
|
case "textMention": {
|
|
402
461
|
const ResolvedInboxNotificationTextMention = kinds?.textMention ?? InboxNotificationTextMention;
|
|
403
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ResolvedInboxNotificationTextMention, {
|
|
404
463
|
inboxNotification,
|
|
405
464
|
...props,
|
|
406
465
|
ref: forwardedRef
|
|
@@ -416,7 +475,7 @@ const InboxNotification = Object.assign(
|
|
|
416
475
|
`Custom notification kind "${inboxNotification.kind}" is not handled so notifications of this kind will not be displayed in production. Use the kinds prop to define how they should be rendered.`
|
|
417
476
|
);
|
|
418
477
|
}
|
|
419
|
-
return /* @__PURE__ */
|
|
478
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InboxNotificationCustomMissing, {
|
|
420
479
|
inboxNotification,
|
|
421
480
|
...props,
|
|
422
481
|
ref: forwardedRef
|
|
@@ -425,7 +484,7 @@ const InboxNotification = Object.assign(
|
|
|
425
484
|
return null;
|
|
426
485
|
}
|
|
427
486
|
}
|
|
428
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ResolvedInboxNotificationCustom, {
|
|
429
488
|
inboxNotification,
|
|
430
489
|
...props,
|
|
431
490
|
ref: forwardedRef
|