@nivaro/react 0.3.117 → 0.3.119

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.
Files changed (138) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4451 -4385
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +88 -85
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +245 -141
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -1,166 +1,190 @@
1
1
  import { jsxs as t, jsx as s } from "react/jsx-runtime";
2
- import { useQueryClient as K, useQuery as O } from "@tanstack/react-query";
3
- import { Split as L, Loader2 as P } from "lucide-react";
4
- import { useState as $ } from "react";
5
- import { toast as Q } from "sonner";
6
- import { useNivaroClient as T, useItemNavigation as j } from "../../context.js";
7
- import { post as _ } from "../../lib/commands.js";
8
- import { toastError as A } from "../../lib/error-toast.js";
9
- import { canOfferLineSplit as E, lineSplitBlocker as z, lineSplitPath as D, lineSplitKey as G } from "../../lib/line-split.js";
10
- import { fetchCollectionMeta as H, queryKeys as J } from "../../lib/query-keys.js";
11
- import { cn as R } from "../../lib/utils.js";
12
- import { Popover as V, PopoverTrigger as W, PopoverContent as X } from "../ui/popover.js";
13
- function Y(e) {
14
- const r = typeof (e == null ? void 0 : e.singular) == "string" ? e.singular.trim() : "";
15
- return r ? r.toLowerCase() : "record";
2
+ import { useQueryClient as P, useQuery as Q } from "@tanstack/react-query";
3
+ import { Split as j, Loader2 as _ } from "lucide-react";
4
+ import { useState as v } from "react";
5
+ import { toast as A } from "sonner";
6
+ import { useNivaroClient as E, useItemNavigation as R } from "../../context.js";
7
+ import { post as W } from "../../lib/commands.js";
8
+ import { describeError as z } from "../../lib/error-message.js";
9
+ import { canOfferLineSplit as D, lineSplitBlocker as G, lineSplitPath as H, lineSplitKey as J } from "../../lib/line-split.js";
10
+ import { noteOwnWrite as O } from "../../lib/own-writes.js";
11
+ import { fetchCollectionMeta as V, queryKeys as X } from "../../lib/query-keys.js";
12
+ import { cn as Y } from "../../lib/utils.js";
13
+ import { Popover as Z, PopoverTrigger as F, PopoverContent as U } from "../ui/popover.js";
14
+ function I(e) {
15
+ const n = typeof (e == null ? void 0 : e.singular) == "string" ? e.singular.trim() : "";
16
+ return n ? n.toLowerCase() : "record";
16
17
  }
17
- const c = (e, r) => `${e} ${r}${e === 1 ? "" : "s"}`;
18
- function le({
18
+ const f = (e, n) => `${e} ${n}${e === 1 ? "" : "s"}`;
19
+ function pe({
19
20
  parentCollection: e,
20
- parentId: r,
21
- lineCollection: m,
22
- linkField: p,
21
+ parentId: n,
22
+ lineCollection: l,
23
+ linkField: b,
23
24
  selectedIds: o,
24
- selectedUnsaved: f,
25
- totalSaved: x,
26
- unsavedEdits: M,
27
- onMoved: S
25
+ selectedUnsaved: w,
26
+ totalSaved: k,
27
+ unsavedEdits: B,
28
+ onMoved: C
28
29
  }) {
29
- const y = T(), g = K(), { open: q } = j(), [v, u] = $(!1), [a, w] = $(!1), { data: h } = O({
30
- queryKey: J.collectionMeta(e),
31
- queryFn: () => H(y, e),
30
+ const N = E(), $ = P(), { open: K } = R(), [M, x] = v(!1), [d, S] = v(!1), [r, u] = v(null), { data: y } = Q({
31
+ queryKey: X.collectionMeta(e),
32
+ queryFn: () => V(N, e),
32
33
  staleTime: 10 * 6e4
33
34
  });
34
- if (!h || !E(h.browser_config, m, p)) return null;
35
- const n = Y(h), i = o.length + f, b = z({
35
+ if (!y || !D(y.browser_config, l, b)) return null;
36
+ const a = I(y), c = o.length + w, g = G({
36
37
  selectedSaved: o.length,
37
- selectedUnsaved: f,
38
- totalSaved: x,
39
- unsavedEdits: M
40
- }), k = Math.max(0, x - o.length), C = async () => {
41
- var l;
42
- w(!0);
38
+ selectedUnsaved: w,
39
+ totalSaved: k,
40
+ unsavedEdits: B
41
+ }), q = Math.max(0, k - o.length), T = async () => {
42
+ var m;
43
+ S(!0), u(null);
44
+ for (const p of o) O(l, p, 6e4);
43
45
  try {
44
- const d = (await y.request(
45
- _(D(e, r), {
46
- relation: G(m, p),
46
+ const i = (await N.request(
47
+ W(H(e, n), {
48
+ relation: J(l, b),
47
49
  line_ids: o
48
50
  })
49
51
  )).data;
50
- u(!1), S(o), g.invalidateQueries({ queryKey: ["o2m-rows", m, p, r] }), g.invalidateQueries({ queryKey: ["comments-related"] });
51
- const B = `a new ${n}`;
52
- Q.success(`Moved ${c(d.moved, "line")} to ${B}`, {
53
- description: (((l = d.link_failures) == null ? void 0 : l.length) ?? 0) > 0 ? "Some linked values did not copy — check the new one." : "Both now say where the lines went.",
52
+ for (const L of o) O(l, L, 6e4);
53
+ x(!1), C(o), $.invalidateQueries({ queryKey: ["o2m-rows", l, b, n] }), $.invalidateQueries({ queryKey: ["comments-related"] });
54
+ const h = `a new ${a}`;
55
+ A.success(`Moved ${f(i.moved, "line")} to ${h}`, {
56
+ description: (((m = i.link_failures) == null ? void 0 : m.length) ?? 0) > 0 ? "Some linked values did not copy — check the new one." : "Both now say where the lines went.",
54
57
  duration: 1e4,
55
- ...d.readable ? {
58
+ ...i.readable ? {
56
59
  action: {
57
- label: `Open the new ${n}`,
58
- onClick: () => q({ collection: e, itemId: String(d.id) })
60
+ label: `Open the new ${a}`,
61
+ onClick: () => K({ collection: e, itemId: String(i.id) })
59
62
  }
60
63
  } : {}
61
64
  });
62
- } catch (N) {
63
- A(N, "The lines could not be moved");
65
+ } catch (p) {
66
+ const i = z(p, "The lines could not be moved"), h = i.status ?? 0;
67
+ u({ text: i.title, final: h >= 400 && h < 500 });
64
68
  } finally {
65
- w(!1);
69
+ S(!1);
66
70
  }
67
71
  };
68
- return /* @__PURE__ */ t(V, { open: v, onOpenChange: (l) => !a && u(l), children: [
69
- /* @__PURE__ */ s(W, { asChild: !0, children: /* @__PURE__ */ t(
70
- "button",
71
- {
72
- type: "button",
73
- "data-split-lines": !0,
74
- "data-tip": `Move the ticked lines to a new ${n} with the same details`,
75
- className: R(
76
- "inline-flex h-6 items-center gap-1 rounded border px-2 font-medium transition-colors",
77
- v ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan" : "border-slate-200 text-slate-700 hover:border-nvr-cyan hover:text-nvr-cyan dark:border-border dark:text-slate-200"
78
- ),
79
- children: [
80
- /* @__PURE__ */ s(L, { className: "h-3 w-3 rotate-90", "aria-hidden": "true" }),
81
- "Move ",
82
- i,
83
- " to a new ",
84
- n,
85
- "…"
86
- ]
87
- }
88
- ) }),
89
- /* @__PURE__ */ t(
90
- X,
91
- {
92
- align: "start",
93
- className: "w-[320px] max-w-[calc(100vw-2rem)] p-0",
94
- "data-split-lines-panel": !0,
95
- children: [
96
- /* @__PURE__ */ t("div", { className: "space-y-2 p-3", children: [
97
- /* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
72
+ return /* @__PURE__ */ t(
73
+ Z,
74
+ {
75
+ open: M,
76
+ onOpenChange: (m) => {
77
+ d || (x(m), m || u(null));
78
+ },
79
+ children: [
80
+ /* @__PURE__ */ s(F, { asChild: !0, children: /* @__PURE__ */ t(
81
+ "button",
82
+ {
83
+ type: "button",
84
+ "data-split-lines": !0,
85
+ "data-tip": `Move the ticked lines to a new ${a} with the same details`,
86
+ className: Y(
87
+ "inline-flex h-6 items-center gap-1 rounded border px-2 font-medium transition-colors",
88
+ M ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-cyan" : "border-slate-200 text-slate-700 hover:border-nvr-cyan hover:text-nvr-cyan dark:border-border dark:text-slate-200"
89
+ ),
90
+ children: [
91
+ /* @__PURE__ */ s(j, { className: "h-3 w-3 rotate-90", "aria-hidden": "true" }),
98
92
  "Move ",
99
- c(i, "line"),
93
+ c,
100
94
  " to a new ",
101
- n
102
- ] }),
103
- /* @__PURE__ */ t("ul", { className: "space-y-1 text-[12px] leading-snug text-slate-600 dark:text-muted-foreground", children: [
104
- /* @__PURE__ */ t("li", { children: [
105
- "A new ",
106
- n,
107
- " is made with this one’s details and starts at the first step."
108
- ] }),
109
- /* @__PURE__ */ t("li", { children: [
110
- "The ticked ",
111
- i === 1 ? "line moves" : "lines move",
112
- " with ",
113
- i === 1 ? "its" : "their",
114
- " ",
115
- "history. ",
116
- k > 0 ? `${c(k, "line")} stay here.` : ""
95
+ a,
96
+ "…"
97
+ ]
98
+ }
99
+ ) }),
100
+ /* @__PURE__ */ t(
101
+ U,
102
+ {
103
+ align: "start",
104
+ className: "w-[320px] max-w-[calc(100vw-2rem)] p-0",
105
+ "data-split-lines-panel": !0,
106
+ children: [
107
+ /* @__PURE__ */ t("div", { className: "space-y-2 p-3", children: [
108
+ /* @__PURE__ */ t("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
109
+ "Move ",
110
+ f(c, "line"),
111
+ " to a new ",
112
+ a
113
+ ] }),
114
+ /* @__PURE__ */ t("ul", { className: "space-y-1 text-[12px] leading-snug text-slate-600 dark:text-muted-foreground", children: [
115
+ /* @__PURE__ */ t("li", { children: [
116
+ "A new ",
117
+ a,
118
+ " is made with this one’s details and starts at the first step."
119
+ ] }),
120
+ /* @__PURE__ */ t("li", { children: [
121
+ "The ticked ",
122
+ c === 1 ? "line moves" : "lines move",
123
+ " with ",
124
+ c === 1 ? "its" : "their",
125
+ " ",
126
+ "history. ",
127
+ q > 0 ? `${f(q, "line")} stay here.` : ""
128
+ ] }),
129
+ /* @__PURE__ */ t("li", { children: [
130
+ "Both ",
131
+ a,
132
+ "s get a note naming the other."
133
+ ] })
134
+ ] }),
135
+ r && /* @__PURE__ */ s(
136
+ "p",
137
+ {
138
+ role: "alert",
139
+ className: "rounded border border-rose-200 bg-rose-50 px-2 py-1.5 text-[12px] text-rose-800 dark:border-rose-800/60 dark:bg-rose-950/30 dark:text-rose-200",
140
+ "data-split-lines-refused": !0,
141
+ children: r.text
142
+ }
143
+ ),
144
+ g && !r && /* @__PURE__ */ s(
145
+ "p",
146
+ {
147
+ className: "rounded border border-amber-200 bg-amber-50 px-2 py-1.5 text-[12px] text-amber-800 dark:border-amber-800/60 dark:bg-amber-950/30 dark:text-amber-200",
148
+ "data-split-lines-blocker": !0,
149
+ children: g
150
+ }
151
+ )
117
152
  ] }),
118
- /* @__PURE__ */ t("li", { children: [
119
- "Both ",
120
- n,
121
- "s get a note naming the other."
153
+ /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-3 py-2 dark:border-border", children: [
154
+ /* @__PURE__ */ s(
155
+ "button",
156
+ {
157
+ type: "button",
158
+ onClick: () => {
159
+ x(!1), u(null);
160
+ },
161
+ disabled: d,
162
+ className: "h-7 px-2 text-[12px] text-slate-600 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",
163
+ children: r != null && r.final ? "Close" : "Cancel"
164
+ }
165
+ ),
166
+ !(r != null && r.final) && /* @__PURE__ */ t(
167
+ "button",
168
+ {
169
+ type: "button",
170
+ onClick: () => void T(),
171
+ disabled: d || !!g,
172
+ "data-split-lines-confirm": !0,
173
+ className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
174
+ children: [
175
+ d && /* @__PURE__ */ s(_, { className: "h-3 w-3 animate-spin", "aria-hidden": "true" }),
176
+ d ? "Moving…" : r ? "Try again" : `Move ${f(c, "line")}`
177
+ ]
178
+ }
179
+ )
122
180
  ] })
123
- ] }),
124
- b && /* @__PURE__ */ s(
125
- "p",
126
- {
127
- className: "rounded border border-amber-200 bg-amber-50 px-2 py-1.5 text-[12px] text-amber-800 dark:border-amber-800/60 dark:bg-amber-950/30 dark:text-amber-200",
128
- "data-split-lines-blocker": !0,
129
- children: b
130
- }
131
- )
132
- ] }),
133
- /* @__PURE__ */ t("div", { className: "flex justify-end gap-2 border-t border-slate-100 px-3 py-2 dark:border-border", children: [
134
- /* @__PURE__ */ s(
135
- "button",
136
- {
137
- type: "button",
138
- onClick: () => u(!1),
139
- disabled: a,
140
- className: "h-7 px-2 text-[12px] text-slate-500 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
141
- children: "Cancel"
142
- }
143
- ),
144
- /* @__PURE__ */ t(
145
- "button",
146
- {
147
- type: "button",
148
- onClick: () => void C(),
149
- disabled: a || !!b,
150
- "data-split-lines-confirm": !0,
151
- className: "inline-flex h-7 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
152
- children: [
153
- a && /* @__PURE__ */ s(P, { className: "h-3 w-3 animate-spin", "aria-hidden": "true" }),
154
- a ? "Moving…" : `Move ${c(i, "line")}`
155
- ]
156
- }
157
- )
158
- ] })
159
- ]
160
- }
161
- )
162
- ] });
181
+ ]
182
+ }
183
+ )
184
+ ]
185
+ }
186
+ );
163
187
  }
164
188
  export {
165
- le as SplitLinesButton
189
+ pe as SplitLinesButton
166
190
  };
@@ -124,7 +124,7 @@ function ve({
124
124
  },
125
125
  className: "inline-flex cursor-pointer items-center",
126
126
  children: [
127
- /* @__PURE__ */ t("span", { className: s ? "flex -space-x-1" : "flex -space-x-2", children: v.map((n) => /* @__PURE__ */ t(ue, { user: n, avatarCls: C }, n.id)) }),
127
+ /* @__PURE__ */ t("span", { className: "flex -space-x-1", children: v.map((n) => /* @__PURE__ */ t(ue, { user: n, avatarCls: C }, n.id)) }),
128
128
  N > 0 && /* @__PURE__ */ l("span", { className: "ml-1 rounded-full bg-slate-200 px-1.5 py-0.5 text-[10.5px] font-bold leading-none text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: [
129
129
  "+",
130
130
  N
@@ -0,0 +1,6 @@
1
+ function o(n, r, e) {
2
+ return !e || !n || n === "original" ? !1 : !r.some((i) => String(i.id) === n);
3
+ }
4
+ export {
5
+ o as addendumViewGone
6
+ };
@@ -1,77 +1,92 @@
1
- import { jsxs as E, jsx as m } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as v } from "react/jsx-runtime";
2
2
  import { FileX as F } from "lucide-react";
3
- import { useRef as S, useState as w, useEffect as v } from "react";
4
- const b = 6e3, R = 600, N = 15e3, a = (t) => t.toLowerCase();
5
- function _(t, i, f, g = Date.now()) {
6
- if (t == null) return { arrived: [], gone: [] };
7
- const l = (n) => {
8
- const d = f.get(a(n));
9
- return d != null && g - d < N;
10
- }, h = new Set(t.map(a)), c = new Set(i.map(a));
3
+ import { useRef as S, useState as h, useEffect as b } from "react";
4
+ const N = 6e3, R = 600, _ = 15e3, a = (e) => e.toLowerCase();
5
+ function k(e, r, l, m = Date.now()) {
6
+ if (e == null) return { arrived: [], gone: [] };
7
+ const c = (o) => {
8
+ const u = l.get(a(o));
9
+ return u != null && m - u < _;
10
+ }, g = new Set(e.map(a)), d = new Set(r.map(a));
11
11
  return {
12
- arrived: i.filter((n) => !h.has(a(n)) && !l(n)),
13
- gone: t.filter((n) => !c.has(a(n)) && !l(n))
12
+ arrived: r.filter((o) => !g.has(a(o)) && !c(o)),
13
+ gone: e.filter((o) => !d.has(a(o)) && !c(o))
14
14
  };
15
15
  }
16
- function M(t, i) {
17
- t.current.set(a(i), Date.now());
16
+ function L(e, r) {
17
+ e.current.set(a(r), Date.now());
18
18
  }
19
- function O(t, i) {
20
- const f = S(null), [g, l] = w(() => /* @__PURE__ */ new Set()), [h, c] = w([]), [n, d] = w(() => /* @__PURE__ */ new Set()), p = S(/* @__PURE__ */ new Set()), x = (o, s) => {
21
- const e = setTimeout(() => {
22
- p.current.delete(e), o();
23
- }, s);
24
- p.current.add(e);
25
- }, k = t == null ? null : [...t].map(a).sort().join(",");
26
- return v(() => {
27
- if (t == null) return;
28
- const { arrived: o, gone: s } = _(f.current, t, i.current);
29
- f.current = [...t], o.length > 0 && (l((e) => /* @__PURE__ */ new Set([...e, ...o])), c((e) => e.filter((r) => !o.some((u) => a(u) === a(r)))), x(
30
- () => l((e) => {
31
- const r = new Set(e);
32
- for (const u of o) r.delete(u);
33
- return r;
19
+ function M(e, r) {
20
+ const l = S(null), [m, c] = h(() => /* @__PURE__ */ new Set()), [g, d] = h([]), [o, u] = h(() => /* @__PURE__ */ new Set()), w = S(/* @__PURE__ */ new Set()), p = (s, i) => {
21
+ const t = setTimeout(() => {
22
+ w.current.delete(t), s();
23
+ }, i);
24
+ w.current.add(t);
25
+ }, E = e == null ? null : [...e].map(a).sort().join(",");
26
+ return b(() => {
27
+ if (e == null) return;
28
+ const { arrived: s, gone: i } = k(l.current, e, r.current);
29
+ l.current = [...e], s.length > 0 && (c((t) => /* @__PURE__ */ new Set([...t, ...s])), d((t) => t.filter((n) => !s.some((f) => a(f) === a(n)))), p(
30
+ () => c((t) => {
31
+ const n = new Set(t);
32
+ for (const f of s) n.delete(f);
33
+ return n;
34
34
  }),
35
35
  2e3
36
- )), s.length > 0 && (c((e) => [...e, ...s.filter((r) => !e.includes(r))]), x(
37
- () => d((e) => /* @__PURE__ */ new Set([...e, ...s])),
38
- b - R
39
- ), x(() => {
40
- c((e) => e.filter((r) => !s.includes(r))), d((e) => {
41
- const r = new Set(e);
42
- for (const u of s) r.delete(u);
43
- return r;
36
+ )), i.length > 0 && (d((t) => [...t, ...i.filter((n) => !t.includes(n))]), p(
37
+ () => u((t) => /* @__PURE__ */ new Set([...t, ...i])),
38
+ N - R
39
+ ), p(() => {
40
+ d((t) => t.filter((n) => !i.includes(n))), u((t) => {
41
+ const n = new Set(t);
42
+ for (const f of i) n.delete(f);
43
+ return n;
44
44
  });
45
- }, b));
46
- }, [k]), v(() => {
47
- const o = p.current;
45
+ }, N));
46
+ }, [E]), b(() => {
47
+ const s = w.current;
48
48
  return () => {
49
- for (const s of o) clearTimeout(s);
50
- o.clear();
49
+ for (const i of s) clearTimeout(i);
50
+ s.clear();
51
51
  };
52
- }, []), { fresh: g, removed: h, leaving: n };
52
+ }, []), { fresh: m, removed: g, leaving: o };
53
53
  }
54
- function j({ name: t, leaving: i }) {
55
- return /* @__PURE__ */ E(
54
+ function O(e) {
55
+ const r = e == null ? void 0 : e.user_name;
56
+ return typeof r == "string" && r.trim() ? r.trim() : null;
57
+ }
58
+ function C({
59
+ name: e,
60
+ leaving: r,
61
+ by: l
62
+ }) {
63
+ return /* @__PURE__ */ x(
56
64
  "div",
57
65
  {
58
66
  "data-file-removed": !0,
59
67
  "aria-live": "polite",
60
- className: `flex items-center gap-2 rounded-lg border border-dashed border-slate-200 p-2 transition-opacity duration-500 motion-reduce:transition-none dark:border-border ${i ? "opacity-0" : "opacity-100"}`,
68
+ className: `flex items-center gap-2 rounded-lg border border-dashed border-slate-300 p-2 transition-opacity duration-500 motion-reduce:transition-none dark:border-border ${r ? "opacity-0" : "opacity-100"}`,
61
69
  children: [
62
- /* @__PURE__ */ m("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ m(F, { className: "h-4 w-4 text-slate-400 dark:text-muted-foreground" }) }),
63
- /* @__PURE__ */ m("p", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-500 line-through decoration-slate-300 dark:text-muted-foreground dark:decoration-border", children: t }),
64
- /* @__PURE__ */ m("span", { className: "shrink-0 rounded bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-muted-foreground", children: "Removed" })
70
+ /* @__PURE__ */ v("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ v(F, { className: "h-4 w-4 text-slate-400 dark:text-muted-foreground" }) }),
71
+ /* @__PURE__ */ x("div", { className: "min-w-0 flex-1", children: [
72
+ /* @__PURE__ */ v("p", { className: "truncate text-[12px] text-slate-500 line-through decoration-slate-300 dark:text-muted-foreground dark:decoration-border", children: e }),
73
+ /* @__PURE__ */ x("p", { className: "mt-0.5 text-[10.5px] text-slate-500 dark:text-slate-400", "data-file-removed-by": !0, children: [
74
+ "Removed",
75
+ l ? ` by ${l}` : "",
76
+ " · just now"
77
+ ] })
78
+ ] })
65
79
  ]
66
80
  }
67
81
  );
68
82
  }
69
83
  export {
70
- N as OWN_FILE_CHANGE_MS,
84
+ _ as OWN_FILE_CHANGE_MS,
71
85
  R as REMOVED_FADE_MS,
72
- b as REMOVED_SHOW_MS,
73
- j as RemovedFileRow,
74
- _ as diffFileIds,
75
- M as noteOwnFileChange,
76
- O as useLiveFileList
86
+ N as REMOVED_SHOW_MS,
87
+ C as RemovedFileRow,
88
+ k as diffFileIds,
89
+ O as lastWriterName,
90
+ L as noteOwnFileChange,
91
+ M as useLiveFileList
77
92
  };