@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.
Files changed (151) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +367 -2
  4. package/dist/index.js +645 -616
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/stale-chunk.js +60 -0
  150. package/dist/shared/lib/worker-socket.js +200 -0
  151. package/package.json +1 -1
@@ -0,0 +1,184 @@
1
+ import { jsxs as b, jsx as s } from "react/jsx-runtime";
2
+ import { Clapperboard as v, Square as y } from "lucide-react";
3
+ import { useState as k, useRef as m, useEffect as M } from "react";
4
+ import { cn as N } from "../../lib/utils.js";
5
+ import { useScreenCapture as S } from "../help-videos/recorder/useScreenCapture.js";
6
+ const g = 6e4, w = "chat-clip", F = "chat-clip-poster";
7
+ function _(r, n) {
8
+ var l, c;
9
+ const t = Array.isArray(r) ? r.map(String) : [];
10
+ if (!t.includes(w) || n && !n.startsWith("video/")) return null;
11
+ const e = ((l = t.find((i) => i.startsWith("poster:"))) == null ? void 0 : l.slice(7)) ?? null, o = Number((c = t.find((i) => i.startsWith("duration:"))) == null ? void 0 : c.slice(9));
12
+ return {
13
+ poster: e && /^[0-9a-f-]{36}$/i.test(e) ? e : null,
14
+ durationMs: o > 0 ? o : null
15
+ };
16
+ }
17
+ function A(r, n) {
18
+ const t = [w, `duration:${Math.max(0, Math.round(n))}`];
19
+ return r && t.push(`poster:${r}`), t;
20
+ }
21
+ function $(r = /* @__PURE__ */ new Date()) {
22
+ const n = (t) => String(t).padStart(2, "0");
23
+ return `Screen clip ${r.getFullYear()}-${n(r.getMonth() + 1)}-${n(r.getDate())} ${n(r.getHours())}.${n(r.getMinutes())}.${n(r.getSeconds())}.webm`;
24
+ }
25
+ function C(r) {
26
+ if (!r) return "";
27
+ const n = Math.max(1, Math.round(r / 1e3));
28
+ return n < 60 ? `${n} s` : `${Math.floor(n / 60)}:${String(n % 60).padStart(2, "0")}`;
29
+ }
30
+ function R() {
31
+ var r;
32
+ return typeof navigator < "u" && !!((r = navigator.mediaDevices) != null && r.getDisplayMedia) && typeof MediaRecorder < "u";
33
+ }
34
+ async function L(r, n = 640) {
35
+ if (typeof document > "u") return null;
36
+ const t = URL.createObjectURL(r);
37
+ try {
38
+ const e = document.createElement("video");
39
+ e.muted = !0, e.playsInline = !0, e.preload = "auto", e.src = t, await new Promise((d, h) => {
40
+ const f = setTimeout(() => h(new Error("timeout")), 4e3);
41
+ e.onloadeddata = () => {
42
+ clearTimeout(f), d();
43
+ }, e.onerror = () => {
44
+ clearTimeout(f), h(new Error("decode"));
45
+ };
46
+ }), e.currentTime === 0 && Number.isFinite(e.duration) && (e.currentTime = Math.min(0.2, e.duration / 2), await new Promise((d) => {
47
+ e.onseeked = () => d(), setTimeout(d, 800);
48
+ }));
49
+ const o = e.videoWidth || 640, l = e.videoHeight || 360, c = Math.min(1, n / o), i = document.createElement("canvas");
50
+ i.width = Math.round(o * c), i.height = Math.round(l * c);
51
+ const a = i.getContext("2d");
52
+ return a ? (a.drawImage(e, 0, 0, i.width, i.height), await new Promise((d) => i.toBlob(d, "image/png"))) : null;
53
+ } catch {
54
+ return null;
55
+ } finally {
56
+ URL.revokeObjectURL(t);
57
+ }
58
+ }
59
+ function j({
60
+ onClip: r,
61
+ disabled: n
62
+ }) {
63
+ const [t, e] = k("idle"), o = m([]), l = m("video/webm"), c = m(!1), i = m(() => {
64
+ }), a = S({
65
+ onLimit: () => i.current(),
66
+ onSharingEnded: () => i.current()
67
+ }), d = async () => {
68
+ if (c.current || !a.isLive()) return;
69
+ c.current = !0, e("finishing");
70
+ const u = Math.min(g, a.meta().duration_ms);
71
+ await a.halt();
72
+ const p = new Blob(o.current, { type: l.current });
73
+ o.current = [];
74
+ const x = p.size ? await L(p) : null;
75
+ p.size && r({ file: new File([p], $(), { type: l.current }), poster: x, durationMs: u }), e("idle"), c.current = !1;
76
+ };
77
+ i.current = () => void d();
78
+ const h = a.elapsed;
79
+ M(() => {
80
+ t === "recording" && h >= g && i.current();
81
+ }, [h, t]);
82
+ const f = async () => {
83
+ if (t === "idle") {
84
+ e("asking"), a.reset(), o.current = [];
85
+ try {
86
+ l.current = await a.acquire({ source: "screen", useMic: !0, micId: "default" });
87
+ } catch {
88
+ a.release(), e("idle");
89
+ return;
90
+ }
91
+ a.arm(l.current, (u) => {
92
+ u.size && o.current.push(u);
93
+ }), a.begin(!1), e("recording");
94
+ }
95
+ };
96
+ if (!R()) return null;
97
+ if (t === "recording" || t === "finishing") {
98
+ const u = Math.max(0, g - a.elapsed), p = Math.min(100, a.elapsed / g * 100);
99
+ return /* @__PURE__ */ b(
100
+ "button",
101
+ {
102
+ type: "button",
103
+ onClick: () => void d(),
104
+ disabled: t === "finishing",
105
+ className: "relative flex h-7 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border border-red-300 bg-red-50 px-2 text-[11px] font-medium text-red-700 transition-colors hover:bg-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-60 dark:border-red-500/40 dark:bg-red-500/10 dark:text-red-200 dark:hover:bg-red-500/20",
106
+ "aria-label": t === "finishing" ? "Finishing the clip" : "Stop recording the clip",
107
+ "data-chat-clip": t,
108
+ children: [
109
+ /* @__PURE__ */ s(
110
+ "span",
111
+ {
112
+ className: "absolute inset-y-0 left-0 bg-red-200/60 transition-[width] duration-200 ease-linear dark:bg-red-500/20",
113
+ style: { width: `${p}%` },
114
+ "aria-hidden": !0
115
+ }
116
+ ),
117
+ /* @__PURE__ */ b("span", { className: "relative flex h-2 w-2", children: [
118
+ /* @__PURE__ */ s("span", { className: "absolute inline-flex h-full w-full rounded-full bg-red-500 opacity-60 motion-safe:animate-ping" }),
119
+ /* @__PURE__ */ s("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-red-500" })
120
+ ] }),
121
+ /* @__PURE__ */ s("span", { className: "relative tabular-nums", children: t === "finishing" ? "Saving…" : `${Math.ceil(u / 1e3)} s left` }),
122
+ /* @__PURE__ */ s(y, { className: "relative h-3 w-3 fill-current", strokeWidth: 2 })
123
+ ]
124
+ }
125
+ );
126
+ }
127
+ return /* @__PURE__ */ s(
128
+ "button",
129
+ {
130
+ type: "button",
131
+ onClick: () => void f(),
132
+ disabled: n || t === "asking",
133
+ className: N(
134
+ "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-200/70 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-40 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
135
+ t === "asking" && "text-nvr-cyan"
136
+ ),
137
+ "aria-label": "Record a screen clip (up to 60 seconds)",
138
+ "data-tip": "Record a screen clip — up to 60 s, with your microphone",
139
+ "data-chat-clip": "idle",
140
+ children: /* @__PURE__ */ s(v, { className: "h-4 w-4", strokeWidth: 2 })
141
+ }
142
+ );
143
+ }
144
+ function B({
145
+ url: r,
146
+ poster: n,
147
+ name: t,
148
+ durationMs: e,
149
+ action: o
150
+ }) {
151
+ return /* @__PURE__ */ b("span", { className: "relative inline-block max-w-[320px]", "data-chat-clip-player": !0, children: [
152
+ /* @__PURE__ */ s(
153
+ "video",
154
+ {
155
+ src: r,
156
+ poster: n ?? void 0,
157
+ controls: !0,
158
+ playsInline: !0,
159
+ preload: n ? "none" : "metadata",
160
+ className: "block max-h-[220px] w-full rounded-lg border border-slate-200 bg-[#0f172a] dark:border-border",
161
+ "aria-label": t
162
+ }
163
+ ),
164
+ /* @__PURE__ */ b("span", { className: "pointer-events-none absolute left-2 top-2 inline-flex items-center gap-1 rounded bg-black/55 px-1.5 py-0.5 text-[10.5px] font-medium text-white", children: [
165
+ /* @__PURE__ */ s(v, { className: "h-3 w-3", strokeWidth: 2 }),
166
+ "Clip",
167
+ e ? ` · ${C(e)}` : ""
168
+ ] }),
169
+ o && /* @__PURE__ */ s("span", { className: "absolute right-1 top-1", children: o })
170
+ ] });
171
+ }
172
+ export {
173
+ g as CLIP_MAX_MS,
174
+ F as CLIP_POSTER_TAG,
175
+ w as CLIP_TAG,
176
+ B as ClipPlayer,
177
+ j as ScreenClipButton,
178
+ R as canRecordClip,
179
+ $ as clipFileName,
180
+ _ as clipInfo,
181
+ A as clipTags,
182
+ C as formatClipLength,
183
+ L as posterFromBlob
184
+ };