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