@nivaro/react 0.2.54 → 0.2.56
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +367 -2
- package/dist/index.js +645 -616
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,57 +1,59 @@
|
|
|
1
|
-
import { jsxs as t, jsx as e, Fragment as
|
|
2
|
-
import { Megaphone as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { toast as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Command as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsxs as t, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { Megaphone as M, X as $, Link2 as G, Plus as X, Check as q, UserPlus as K, History as Q } from "lucide-react";
|
|
3
|
+
import { useState as p } from "react";
|
|
4
|
+
import { toast as C } from "sonner";
|
|
5
|
+
import { cn as d, formatRelative as V } from "../../lib/utils.js";
|
|
6
|
+
import { Command as U, CommandInput as R, CommandList as I, CommandEmpty as J, CommandGroup as L, CommandItem as P } from "../ui/command.js";
|
|
7
|
+
import { Popover as W, PopoverTrigger as j, PopoverContent as D } from "../ui/popover.js";
|
|
8
|
+
import { SimpleSelect as Y } from "../ui/SimpleSelect.js";
|
|
9
|
+
import { useChannelAdmin as Z, useChatRoles as B } from "./chat-core.js";
|
|
10
|
+
import { useTeams as ee, useBulkInvite as te, useChannelAudit as ae } from "./chat-hooks.js";
|
|
11
|
+
function A(l, s) {
|
|
12
|
+
var r;
|
|
13
|
+
return ((r = l == null ? void 0 : l.response) == null ? void 0 : r.error) ?? s;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function ue({
|
|
15
16
|
channel: l,
|
|
16
17
|
th: s,
|
|
17
|
-
isAdmin:
|
|
18
|
+
isAdmin: r
|
|
18
19
|
}) {
|
|
19
|
-
const { update:
|
|
20
|
+
const { update: h } = Z(l.id), b = B(), [f, o] = p(!!l.announce), [u, w] = p(l.mention_policy ?? "owner"), [c, v] = p(l.description ?? ""), [N, g] = p(l.links ?? []), [n, y] = p(l.welcome_note ?? ""), [S, E] = p(
|
|
20
21
|
(l.default_roles ?? []).map((a) => String(a).toUpperCase())
|
|
21
|
-
),
|
|
22
|
+
), O = N.filter((a) => a.url.trim()), z = f !== !!l.announce || u !== (l.mention_policy ?? "owner") || c !== (l.description ?? "") || n !== (l.welcome_note ?? "") || JSON.stringify(O) !== JSON.stringify(l.links ?? []) || r && JSON.stringify([...S].sort()) !== JSON.stringify((l.default_roles ?? []).map((a) => String(a).toUpperCase()).sort()), F = () => h.mutate(
|
|
22
23
|
{
|
|
23
|
-
announce:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
announce: f,
|
|
25
|
+
mention_policy: u,
|
|
26
|
+
description: c.trim() || null,
|
|
27
|
+
links: O.map((a) => ({
|
|
26
28
|
label: a.label.trim() || a.url.trim(),
|
|
27
29
|
url: a.url.trim()
|
|
28
30
|
})),
|
|
29
|
-
welcome_note:
|
|
30
|
-
...
|
|
31
|
+
welcome_note: n.trim() || null,
|
|
32
|
+
...r ? { default_roles: S } : {}
|
|
31
33
|
},
|
|
32
34
|
{
|
|
33
|
-
onSuccess: () =>
|
|
34
|
-
onError: (a) =>
|
|
35
|
+
onSuccess: () => C.success("Channel settings saved"),
|
|
36
|
+
onError: (a) => C.error(A(a, "Could not save the channel settings"))
|
|
35
37
|
}
|
|
36
|
-
),
|
|
37
|
-
var
|
|
38
|
-
return ((
|
|
38
|
+
), T = (a) => {
|
|
39
|
+
var i;
|
|
40
|
+
return ((i = b.find((m) => String(m.id).toUpperCase() === a)) == null ? void 0 : i.name) ?? "Unknown role";
|
|
39
41
|
};
|
|
40
|
-
return /* @__PURE__ */ t("div", { className:
|
|
42
|
+
return /* @__PURE__ */ t("div", { className: d("space-y-3 border-t pt-3", s.divider), "data-chat-channel-extras": !0, children: [
|
|
41
43
|
/* @__PURE__ */ t("label", { className: "flex items-start gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
42
44
|
/* @__PURE__ */ e(
|
|
43
45
|
"input",
|
|
44
46
|
{
|
|
45
47
|
type: "checkbox",
|
|
46
|
-
checked:
|
|
47
|
-
onChange: (a) =>
|
|
48
|
+
checked: f,
|
|
49
|
+
onChange: (a) => o(a.target.checked),
|
|
48
50
|
className: "mt-0.5",
|
|
49
51
|
"data-chat-channel-announce": !0
|
|
50
52
|
}
|
|
51
53
|
),
|
|
52
54
|
/* @__PURE__ */ t("span", { children: [
|
|
53
55
|
/* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1 font-medium", children: [
|
|
54
|
-
/* @__PURE__ */ e(
|
|
56
|
+
/* @__PURE__ */ e(M, { className: "h-3.5 w-3.5" }),
|
|
55
57
|
" Announcements only"
|
|
56
58
|
] }),
|
|
57
59
|
/* @__PURE__ */ t("span", { className: "block text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
@@ -61,16 +63,34 @@ function ce({
|
|
|
61
63
|
] })
|
|
62
64
|
] })
|
|
63
65
|
] }),
|
|
66
|
+
l.id !== 0 && /* @__PURE__ */ t("div", { "data-chat-channel-mention-policy": !0, children: [
|
|
67
|
+
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Who can use @channel and @here" }),
|
|
68
|
+
/* @__PURE__ */ e(
|
|
69
|
+
Y,
|
|
70
|
+
{
|
|
71
|
+
value: u,
|
|
72
|
+
onChange: w,
|
|
73
|
+
ariaLabel: "Who can use @channel and @here",
|
|
74
|
+
className: "h-8 w-full max-w-[280px] text-[12px]",
|
|
75
|
+
options: [
|
|
76
|
+
{ value: "owner", label: "Channel owner and admins" },
|
|
77
|
+
{ value: "members", label: "Every member" },
|
|
78
|
+
{ value: "admins", label: "Admins only" }
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-[11px] leading-snug text-slate-500 dark:text-slate-400", children: "They notify everyone in the channel (@here: everyone online). From anyone else they post as plain text and notify nobody." })
|
|
83
|
+
] }),
|
|
64
84
|
/* @__PURE__ */ t("label", { className: "block", children: [
|
|
65
|
-
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-400", children: "Description" }),
|
|
85
|
+
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Description" }),
|
|
66
86
|
/* @__PURE__ */ e(
|
|
67
87
|
"textarea",
|
|
68
88
|
{
|
|
69
|
-
value:
|
|
70
|
-
onChange: (a) =>
|
|
89
|
+
value: c,
|
|
90
|
+
onChange: (a) => v(a.target.value),
|
|
71
91
|
rows: 3,
|
|
72
92
|
placeholder: "What people should know before posting here",
|
|
73
|
-
className:
|
|
93
|
+
className: d(
|
|
74
94
|
"w-full resize-none rounded-md px-2 py-1.5 text-[12.5px] outline-none",
|
|
75
95
|
s.input
|
|
76
96
|
),
|
|
@@ -79,17 +99,17 @@ function ce({
|
|
|
79
99
|
)
|
|
80
100
|
] }),
|
|
81
101
|
/* @__PURE__ */ t("div", { children: [
|
|
82
|
-
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-400", children: "Links" }),
|
|
83
|
-
|
|
102
|
+
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Links" }),
|
|
103
|
+
N.map((a, i) => (
|
|
84
104
|
// biome-ignore lint/suspicious/noArrayIndexKey: rows are edited in place and have no id
|
|
85
105
|
/* @__PURE__ */ t("div", { className: "mb-1 flex items-center gap-1", children: [
|
|
86
106
|
/* @__PURE__ */ e(
|
|
87
107
|
"input",
|
|
88
108
|
{
|
|
89
109
|
value: a.label,
|
|
90
|
-
onChange: (m) =>
|
|
110
|
+
onChange: (m) => g((k) => k.map((x, _) => _ === i ? { ...x, label: m.target.value } : x)),
|
|
91
111
|
placeholder: "Label",
|
|
92
|
-
className:
|
|
112
|
+
className: d("h-7 w-[38%] rounded-md px-2 text-[12px] outline-none", s.input),
|
|
93
113
|
"aria-label": "Link label"
|
|
94
114
|
}
|
|
95
115
|
),
|
|
@@ -97,9 +117,9 @@ function ce({
|
|
|
97
117
|
"input",
|
|
98
118
|
{
|
|
99
119
|
value: a.url,
|
|
100
|
-
onChange: (m) =>
|
|
120
|
+
onChange: (m) => g((k) => k.map((x, _) => _ === i ? { ...x, url: m.target.value } : x)),
|
|
101
121
|
placeholder: "https://… or /reports/…",
|
|
102
|
-
className:
|
|
122
|
+
className: d(
|
|
103
123
|
"h-7 min-w-0 flex-1 rounded-md px-2 text-[12px] outline-none",
|
|
104
124
|
s.input
|
|
105
125
|
),
|
|
@@ -110,41 +130,41 @@ function ce({
|
|
|
110
130
|
"button",
|
|
111
131
|
{
|
|
112
132
|
type: "button",
|
|
113
|
-
onClick: () =>
|
|
133
|
+
onClick: () => g((m) => m.filter((k, x) => x !== i)),
|
|
114
134
|
className: "rounded p-1 text-slate-400 hover:text-red-500",
|
|
115
135
|
"aria-label": "Remove link",
|
|
116
|
-
children: /* @__PURE__ */ e(
|
|
136
|
+
children: /* @__PURE__ */ e($, { className: "h-3 w-3" })
|
|
117
137
|
}
|
|
118
138
|
)
|
|
119
|
-
] },
|
|
139
|
+
] }, i)
|
|
120
140
|
)),
|
|
121
|
-
|
|
141
|
+
N.length < 10 && /* @__PURE__ */ t(
|
|
122
142
|
"button",
|
|
123
143
|
{
|
|
124
144
|
type: "button",
|
|
125
|
-
onClick: () =>
|
|
126
|
-
className:
|
|
145
|
+
onClick: () => g((a) => [...a, { label: "", url: "" }]),
|
|
146
|
+
className: d(
|
|
127
147
|
"inline-flex items-center gap-1 text-[11.5px] font-medium",
|
|
128
148
|
s.accentText
|
|
129
149
|
),
|
|
130
150
|
"data-chat-channel-add-link": !0,
|
|
131
151
|
children: [
|
|
132
|
-
/* @__PURE__ */ e(
|
|
152
|
+
/* @__PURE__ */ e(G, { className: "h-3 w-3" }),
|
|
133
153
|
" Add a link"
|
|
134
154
|
]
|
|
135
155
|
}
|
|
136
156
|
)
|
|
137
157
|
] }),
|
|
138
158
|
/* @__PURE__ */ t("label", { className: "block", children: [
|
|
139
|
-
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-400", children: "Welcome note — shown once to each new member" }),
|
|
159
|
+
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Welcome note — shown once to each new member" }),
|
|
140
160
|
/* @__PURE__ */ e(
|
|
141
161
|
"textarea",
|
|
142
162
|
{
|
|
143
|
-
value:
|
|
144
|
-
onChange: (a) =>
|
|
163
|
+
value: n,
|
|
164
|
+
onChange: (a) => y(a.target.value),
|
|
145
165
|
rows: 3,
|
|
146
166
|
placeholder: "Say hello, point people at the pinned messages, explain the ground rules",
|
|
147
|
-
className:
|
|
167
|
+
className: d(
|
|
148
168
|
"w-full resize-none rounded-md px-2 py-1.5 text-[12.5px] outline-none",
|
|
149
169
|
s.input
|
|
150
170
|
),
|
|
@@ -152,66 +172,66 @@ function ce({
|
|
|
152
172
|
}
|
|
153
173
|
)
|
|
154
174
|
] }),
|
|
155
|
-
|
|
156
|
-
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-400", children: "Join automatically — everyone with these roles" }),
|
|
175
|
+
r && /* @__PURE__ */ t("div", { children: [
|
|
176
|
+
/* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Join automatically — everyone with these roles" }),
|
|
157
177
|
/* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
158
|
-
|
|
178
|
+
S.map((a) => /* @__PURE__ */ t(
|
|
159
179
|
"span",
|
|
160
180
|
{
|
|
161
|
-
className:
|
|
181
|
+
className: d(
|
|
162
182
|
"inline-flex h-6 items-center gap-1 rounded-full px-2 text-[11px]",
|
|
163
183
|
s.accentSoft
|
|
164
184
|
),
|
|
165
185
|
children: [
|
|
166
|
-
|
|
186
|
+
T(a),
|
|
167
187
|
/* @__PURE__ */ e(
|
|
168
188
|
"button",
|
|
169
189
|
{
|
|
170
190
|
type: "button",
|
|
171
|
-
onClick: () =>
|
|
172
|
-
"aria-label": `Remove ${
|
|
173
|
-
children: /* @__PURE__ */ e(
|
|
191
|
+
onClick: () => E((i) => i.filter((m) => m !== a)),
|
|
192
|
+
"aria-label": `Remove ${T(a)}`,
|
|
193
|
+
children: /* @__PURE__ */ e($, { className: "h-3 w-3" })
|
|
174
194
|
}
|
|
175
195
|
)
|
|
176
196
|
]
|
|
177
197
|
},
|
|
178
198
|
a
|
|
179
199
|
)),
|
|
180
|
-
/* @__PURE__ */ t(
|
|
181
|
-
/* @__PURE__ */ e(
|
|
200
|
+
/* @__PURE__ */ t(W, { children: [
|
|
201
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ t(
|
|
182
202
|
"button",
|
|
183
203
|
{
|
|
184
204
|
type: "button",
|
|
185
205
|
className: "inline-flex h-6 items-center gap-1 rounded-full border border-slate-200 px-2 text-[11px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
186
206
|
"data-chat-channel-default-roles": !0,
|
|
187
207
|
children: [
|
|
188
|
-
/* @__PURE__ */ e(
|
|
208
|
+
/* @__PURE__ */ e(X, { className: "h-3 w-3" }),
|
|
189
209
|
" Role"
|
|
190
210
|
]
|
|
191
211
|
}
|
|
192
212
|
) }),
|
|
193
|
-
/* @__PURE__ */ e(
|
|
194
|
-
/* @__PURE__ */ e(
|
|
195
|
-
/* @__PURE__ */ t(
|
|
196
|
-
/* @__PURE__ */ e(
|
|
197
|
-
/* @__PURE__ */ e(
|
|
198
|
-
const
|
|
213
|
+
/* @__PURE__ */ e(D, { align: "start", className: "w-[240px] p-0", children: /* @__PURE__ */ t(U, { children: [
|
|
214
|
+
/* @__PURE__ */ e(R, { placeholder: "Search roles…" }),
|
|
215
|
+
/* @__PURE__ */ t(I, { children: [
|
|
216
|
+
/* @__PURE__ */ e(J, { children: "No role found" }),
|
|
217
|
+
/* @__PURE__ */ e(L, { children: b.map((a) => {
|
|
218
|
+
const i = String(a.id).toUpperCase(), m = S.includes(i);
|
|
199
219
|
return /* @__PURE__ */ t(
|
|
200
|
-
|
|
220
|
+
P,
|
|
201
221
|
{
|
|
202
222
|
value: a.name,
|
|
203
|
-
onSelect: () =>
|
|
223
|
+
onSelect: () => E((k) => m ? k.filter((x) => x !== i) : [...k, i]),
|
|
204
224
|
children: [
|
|
205
225
|
/* @__PURE__ */ e(
|
|
206
|
-
|
|
226
|
+
q,
|
|
207
227
|
{
|
|
208
|
-
className:
|
|
228
|
+
className: d("mr-1.5 h-3.5 w-3.5", m ? "opacity-100" : "opacity-0")
|
|
209
229
|
}
|
|
210
230
|
),
|
|
211
231
|
a.name
|
|
212
232
|
]
|
|
213
233
|
},
|
|
214
|
-
|
|
234
|
+
i
|
|
215
235
|
);
|
|
216
236
|
}) })
|
|
217
237
|
] })
|
|
@@ -224,65 +244,65 @@ function ce({
|
|
|
224
244
|
"button",
|
|
225
245
|
{
|
|
226
246
|
type: "button",
|
|
227
|
-
disabled: !
|
|
228
|
-
onClick:
|
|
229
|
-
className:
|
|
247
|
+
disabled: !z || h.isPending,
|
|
248
|
+
onClick: F,
|
|
249
|
+
className: d(
|
|
230
250
|
"rounded-md px-2.5 py-1 text-[12px] font-medium disabled:opacity-40",
|
|
231
251
|
s.action
|
|
232
252
|
),
|
|
233
253
|
"data-chat-channel-extras-save": !0,
|
|
234
|
-
children:
|
|
254
|
+
children: h.isPending ? "Saving…" : "Save these settings"
|
|
235
255
|
}
|
|
236
256
|
)
|
|
237
257
|
] });
|
|
238
258
|
}
|
|
239
|
-
function
|
|
240
|
-
const [
|
|
241
|
-
|
|
259
|
+
function xe({ channelId: l, th: s }) {
|
|
260
|
+
const [r, h] = p(!1), b = ee(r), f = B(), o = te(l), [u, w] = p(null), [c, v] = p(null), N = (n) => n.kind === "team" ? { team_id: n.id } : { role_id: n.id }, g = (n) => {
|
|
261
|
+
w(n), v(null), o.mutate(
|
|
242
262
|
{ ...N(n), dry_run: !0 },
|
|
243
263
|
{
|
|
244
|
-
onSuccess: (
|
|
245
|
-
onError: (
|
|
264
|
+
onSuccess: (y) => v({ would_add: y.would_add ?? 0, skipped: y.skipped }),
|
|
265
|
+
onError: (y) => C.error(A(y, "Could not count who that would add"))
|
|
246
266
|
}
|
|
247
267
|
);
|
|
248
268
|
};
|
|
249
269
|
return /* @__PURE__ */ t("div", { "data-chat-bulk-invite": !0, children: [
|
|
250
|
-
/* @__PURE__ */ t(
|
|
251
|
-
/* @__PURE__ */ e(
|
|
270
|
+
/* @__PURE__ */ t(W, { open: r, onOpenChange: h, children: [
|
|
271
|
+
/* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ t(
|
|
252
272
|
"button",
|
|
253
273
|
{
|
|
254
274
|
type: "button",
|
|
255
|
-
className:
|
|
275
|
+
className: d(
|
|
256
276
|
"inline-flex items-center gap-1 text-[11.5px] font-medium",
|
|
257
277
|
s.accentText
|
|
258
278
|
),
|
|
259
279
|
children: [
|
|
260
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" }),
|
|
261
281
|
" Add a team or role"
|
|
262
282
|
]
|
|
263
283
|
}
|
|
264
284
|
) }),
|
|
265
|
-
/* @__PURE__ */ e(
|
|
266
|
-
/* @__PURE__ */ e(
|
|
267
|
-
/* @__PURE__ */ t(
|
|
268
|
-
/* @__PURE__ */ e(
|
|
269
|
-
|
|
270
|
-
|
|
285
|
+
/* @__PURE__ */ e(D, { align: "start", className: "w-[260px] p-0", children: /* @__PURE__ */ t(U, { children: [
|
|
286
|
+
/* @__PURE__ */ e(R, { placeholder: "Search teams and roles…" }),
|
|
287
|
+
/* @__PURE__ */ t(I, { children: [
|
|
288
|
+
/* @__PURE__ */ e(J, { children: "Nothing found" }),
|
|
289
|
+
b.length > 0 && /* @__PURE__ */ e(L, { heading: "Teams", children: b.map((n) => /* @__PURE__ */ e(
|
|
290
|
+
P,
|
|
271
291
|
{
|
|
272
292
|
value: `team ${n.name}`,
|
|
273
293
|
onSelect: () => {
|
|
274
|
-
|
|
294
|
+
h(!1), g({ kind: "team", id: n.id, name: n.name });
|
|
275
295
|
},
|
|
276
296
|
children: n.name
|
|
277
297
|
},
|
|
278
298
|
`t${n.id}`
|
|
279
299
|
)) }),
|
|
280
|
-
/* @__PURE__ */ e(
|
|
281
|
-
|
|
300
|
+
/* @__PURE__ */ e(L, { heading: "Roles", children: f.map((n) => /* @__PURE__ */ e(
|
|
301
|
+
P,
|
|
282
302
|
{
|
|
283
303
|
value: `role ${n.name}`,
|
|
284
304
|
onSelect: () => {
|
|
285
|
-
|
|
305
|
+
h(!1), g({ kind: "role", id: String(n.id), name: n.name });
|
|
286
306
|
},
|
|
287
307
|
children: n.name
|
|
288
308
|
},
|
|
@@ -291,13 +311,13 @@ function me({ channelId: l, th: s }) {
|
|
|
291
311
|
] })
|
|
292
312
|
] }) })
|
|
293
313
|
] }),
|
|
294
|
-
u && /* @__PURE__ */ e("div", { className:
|
|
314
|
+
u && /* @__PURE__ */ e("div", { className: d("mt-1.5 rounded-lg border p-2 text-[12px]", s.divider), children: c ? c.would_add === 0 ? /* @__PURE__ */ t("p", { className: "text-slate-600 dark:text-slate-300", children: [
|
|
295
315
|
"Everyone in ",
|
|
296
316
|
u.name,
|
|
297
317
|
" is already here",
|
|
298
318
|
c.skipped ? ` (${c.skipped} skipped)` : "",
|
|
299
319
|
"."
|
|
300
|
-
] }) : /* @__PURE__ */ t(
|
|
320
|
+
] }) : /* @__PURE__ */ t(H, { children: [
|
|
301
321
|
/* @__PURE__ */ t("p", { className: "text-slate-700 dark:text-slate-200", children: [
|
|
302
322
|
"Adds ",
|
|
303
323
|
c.would_add,
|
|
@@ -314,14 +334,14 @@ function me({ channelId: l, th: s }) {
|
|
|
314
334
|
"button",
|
|
315
335
|
{
|
|
316
336
|
type: "button",
|
|
317
|
-
disabled:
|
|
318
|
-
onClick: () =>
|
|
337
|
+
disabled: o.isPending,
|
|
338
|
+
onClick: () => o.mutate(N(u), {
|
|
319
339
|
onSuccess: (n) => {
|
|
320
|
-
|
|
340
|
+
C.success(`Added ${n.added ?? 0} to the channel`), w(null), v(null);
|
|
321
341
|
},
|
|
322
|
-
onError: (n) =>
|
|
342
|
+
onError: (n) => C.error(A(n, "Could not add them"))
|
|
323
343
|
}),
|
|
324
|
-
className:
|
|
344
|
+
className: d("h-7 rounded-md px-2 text-[11.5px] font-medium", s.action),
|
|
325
345
|
"data-chat-bulk-invite-confirm": !0,
|
|
326
346
|
children: [
|
|
327
347
|
"Add ",
|
|
@@ -334,7 +354,7 @@ function me({ channelId: l, th: s }) {
|
|
|
334
354
|
{
|
|
335
355
|
type: "button",
|
|
336
356
|
onClick: () => {
|
|
337
|
-
|
|
357
|
+
w(null), v(null);
|
|
338
358
|
},
|
|
339
359
|
className: "h-7 rounded-md px-2 text-[11.5px] text-slate-600 hover:bg-muted dark:text-slate-300",
|
|
340
360
|
children: "Cancel"
|
|
@@ -348,7 +368,7 @@ function me({ channelId: l, th: s }) {
|
|
|
348
368
|
] }) })
|
|
349
369
|
] });
|
|
350
370
|
}
|
|
351
|
-
const
|
|
371
|
+
const ne = {
|
|
352
372
|
"chat-channel-create": "created the channel",
|
|
353
373
|
"chat-channel-update": "changed settings",
|
|
354
374
|
"chat-channel-join": "joined",
|
|
@@ -358,46 +378,46 @@ const ee = {
|
|
|
358
378
|
"chat-channel-bulk-invite": "added a group of people",
|
|
359
379
|
"chat-message-delete": "deleted a message"
|
|
360
380
|
};
|
|
361
|
-
function
|
|
362
|
-
const [
|
|
381
|
+
function be({ channelId: l, th: s }) {
|
|
382
|
+
const [r, h] = p(!1), { rows: b, loading: f } = ae(l, r);
|
|
363
383
|
return /* @__PURE__ */ t("div", { "data-chat-channel-audit": !0, children: [
|
|
364
384
|
/* @__PURE__ */ t(
|
|
365
385
|
"button",
|
|
366
386
|
{
|
|
367
387
|
type: "button",
|
|
368
|
-
onClick: () =>
|
|
369
|
-
"aria-expanded":
|
|
388
|
+
onClick: () => h((o) => !o),
|
|
389
|
+
"aria-expanded": r,
|
|
370
390
|
className: "inline-flex items-center gap-1 text-[11.5px] font-medium text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-white",
|
|
371
391
|
children: [
|
|
372
|
-
/* @__PURE__ */ e(
|
|
392
|
+
/* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }),
|
|
373
393
|
" ",
|
|
374
|
-
|
|
394
|
+
r ? "Hide channel history" : "Channel history"
|
|
375
395
|
]
|
|
376
396
|
}
|
|
377
397
|
),
|
|
378
|
-
|
|
398
|
+
r && /* @__PURE__ */ e("div", { className: d("mt-1.5 max-h-60 overflow-y-auto rounded-lg border", s.divider), children: f ? /* @__PURE__ */ e("p", { className: "p-2 text-[11.5px] text-slate-500", children: "Loading…" }) : b.length === 0 ? /* @__PURE__ */ e("p", { className: "p-2 text-[11.5px] text-slate-500", children: "No changes recorded yet." }) : b.map((o) => /* @__PURE__ */ t(
|
|
379
399
|
"div",
|
|
380
400
|
{
|
|
381
|
-
className:
|
|
401
|
+
className: d("border-b px-2 py-1.5 text-[11.5px] last:border-b-0", s.divider),
|
|
382
402
|
children: [
|
|
383
403
|
/* @__PURE__ */ t("p", { className: "text-slate-700 dark:text-slate-200", children: [
|
|
384
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children:
|
|
404
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: o.user_name ?? "Someone" }),
|
|
385
405
|
" ",
|
|
386
|
-
|
|
406
|
+
ne[o.action] ?? o.action.replace(/^chat-/, "").replace(/-/g, " "),
|
|
387
407
|
/* @__PURE__ */ t("span", { className: "ml-1 text-slate-400", children: [
|
|
388
408
|
"· ",
|
|
389
|
-
|
|
409
|
+
V(o.at)
|
|
390
410
|
] })
|
|
391
411
|
] }),
|
|
392
|
-
|
|
412
|
+
o.comment && /* @__PURE__ */ e("p", { className: "truncate text-[11px] text-slate-500 dark:text-slate-400", children: o.comment })
|
|
393
413
|
]
|
|
394
414
|
},
|
|
395
|
-
|
|
415
|
+
o.id
|
|
396
416
|
)) })
|
|
397
417
|
] });
|
|
398
418
|
}
|
|
399
419
|
export {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
420
|
+
xe as BulkInvitePanel,
|
|
421
|
+
be as ChannelAuditLog,
|
|
422
|
+
ue as ChannelExtrasEditor
|
|
403
423
|
};
|