@nivaro/react 0.3.99 → 0.3.101

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 (60) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useFormSchema.js +82 -85
  3. package/dist/hooks/useSessionRecorder.js +206 -175
  4. package/dist/index.d.ts +84 -16
  5. package/dist/index.js +627 -622
  6. package/dist/lib/commands.js +15 -11
  7. package/dist/shared/components/ActivityEntry.js +5 -5
  8. package/dist/shared/components/CollectionBrowserView.js +516 -503
  9. package/dist/shared/components/ItemEditForm.js +3471 -3465
  10. package/dist/shared/components/JobsTray.js +76 -61
  11. package/dist/shared/components/MyWorkView.js +133 -126
  12. package/dist/shared/components/NotificationBell.js +322 -289
  13. package/dist/shared/components/RecordCompare.js +38 -40
  14. package/dist/shared/components/RecordReadView.js +119 -119
  15. package/dist/shared/components/TipLayer.js +56 -41
  16. package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
  17. package/dist/shared/components/integrations/console/SignalCard.js +40 -40
  18. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
  19. package/dist/shared/components/integrations/console/drill/status.js +23 -18
  20. package/dist/shared/components/item-edit/InlineGridField.js +45 -45
  21. package/dist/shared/components/item-edit/InlineTableField.js +750 -749
  22. package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
  23. package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
  24. package/dist/shared/components/item-edit/RecordInsights.js +86 -86
  25. package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
  26. package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
  27. package/dist/shared/components/item-edit/header-path-preview.js +46 -34
  28. package/dist/shared/components/item-edit/related-missing.js +75 -19
  29. package/dist/shared/components/notifications/DeliveryChips.js +1 -2
  30. package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
  31. package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
  32. package/dist/shared/components/panels/BackgroundMove.js +242 -0
  33. package/dist/shared/components/panels/MoveAdvisory.js +204 -0
  34. package/dist/shared/components/panels/PipelinePanel.js +1459 -1220
  35. package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
  36. package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
  37. package/dist/shared/components/profile/DayTimeline.js +145 -140
  38. package/dist/shared/components/profile/PersonAccess.js +679 -383
  39. package/dist/shared/components/profile/PersonActivity.js +404 -427
  40. package/dist/shared/components/profile/PersonDidPanel.js +248 -134
  41. package/dist/shared/components/profile/PersonProfile.js +33 -32
  42. package/dist/shared/components/profile/journey-view.js +166 -0
  43. package/dist/shared/lib/activity-sentence.js +319 -236
  44. package/dist/shared/lib/commands.js +18 -14
  45. package/dist/shared/lib/error-hints.js +1 -1
  46. package/dist/shared/lib/job-failure-text.js +12 -0
  47. package/dist/shared/lib/jobs-tray.js +60 -41
  48. package/dist/shared/lib/move-failure.js +19 -0
  49. package/dist/shared/lib/obligation-banner.js +22 -21
  50. package/dist/shared/lib/partner-failure.js +83 -0
  51. package/dist/shared/lib/prefetch.js +73 -73
  52. package/dist/shared/lib/replay-checkout.js +18 -13
  53. package/dist/shared/lib/replay-context.js +90 -77
  54. package/dist/shared/lib/replay-idle.js +21 -0
  55. package/dist/shared/lib/replay-socket.js +21 -17
  56. package/dist/shared/lib/rum.js +56 -51
  57. package/dist/shared/lib/safe-error.js +17 -13
  58. package/dist/shared/lib/stale-chunk.js +69 -26
  59. package/dist/shared/lib/system-collections.js +20 -0
  60. package/package.json +1 -1
@@ -0,0 +1,166 @@
1
+ import { getDisplayTimezone as b } from "../../lib/utils.js";
2
+ const C = {
3
+ ai: "AI",
4
+ api: "API",
5
+ csv: "CSV",
6
+ erp: "ERP",
7
+ id: "ID",
8
+ mcp: "MCP",
9
+ pdf: "PDF",
10
+ sla: "SLA",
11
+ sql: "SQL",
12
+ sso: "SSO",
13
+ ui: "UI"
14
+ };
15
+ function k(e) {
16
+ const t = e.split(/[\s_.:-]+/).filter(Boolean).map((n) => C[n.toLowerCase()] ?? n.toLowerCase()).join(" ");
17
+ return t ? t.charAt(0).toUpperCase() + t.slice(1) : "";
18
+ }
19
+ function y(e) {
20
+ return /^\d+$/.test(e) || /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e) || /^[A-Za-z0-9_-]{20,}$/.test(e) || /\d/.test(e) && /^[A-Z0-9-]+$/.test(e);
21
+ }
22
+ function L(e) {
23
+ return /ies$/i.test(e) ? e.replace(/ies$/i, "y") : /(ss|us|is)$/i.test(e) ? e : /(x|ch|sh)es$/i.test(e) ? e.replace(/es$/i, "") : /s$/i.test(e) ? e.slice(0, -1) : e;
24
+ }
25
+ function _(e) {
26
+ try {
27
+ return decodeURIComponent(e);
28
+ } catch {
29
+ return e;
30
+ }
31
+ }
32
+ const S = (e) => {
33
+ const t = _(e).trim();
34
+ return t && /^[A-Za-z0-9 _-]{1,40}$/.test(t) && !y(t) ? k(t) : null;
35
+ }, m = (e) => {
36
+ const t = S(e);
37
+ return t ? `${t} tab` : null;
38
+ }, h = {
39
+ addendum: () => "Addendum open",
40
+ tab: m,
41
+ p: m,
42
+ section: m,
43
+ view: m,
44
+ focus: S,
45
+ edit: () => "Editing",
46
+ watch: () => "Watching a video",
47
+ recording: () => "Watching a recording",
48
+ ticket: () => "Ticket open",
49
+ q: () => "Searching",
50
+ search: () => "Searching",
51
+ autofill: () => "From a document",
52
+ prefill: () => "Prefilled"
53
+ };
54
+ function A(e) {
55
+ var n;
56
+ const t = [];
57
+ for (const i of e.split("&")) {
58
+ const [r, ...a] = i.split("="), s = (n = h[_(r ?? "").toLowerCase()]) == null ? void 0 : n.call(h, a.join("="));
59
+ s && !t.includes(s) && t.push(s);
60
+ }
61
+ return t.length ? t.join(" · ") : null;
62
+ }
63
+ function v(e) {
64
+ const [t, ...n] = String(e ?? "").split("?"), i = t.split("#")[0].split("/").filter(Boolean).map(_), r = A(n.join("?").split("#")[0]), [a, s, u] = i;
65
+ if ((a === "records" || a === "collections") && s && /^[A-Za-z_]\w*$/.test(s)) {
66
+ const o = k(s.replace(/^(nivaro|directus)_/, "")), l = L(o);
67
+ return u ? u === "new" ? {
68
+ title: `New ${l.toLowerCase()}`,
69
+ section: o,
70
+ detail: r,
71
+ kind: "new-record",
72
+ key: `new:${s}`
73
+ } : {
74
+ title: `A ${l.toLowerCase()} record`,
75
+ section: o,
76
+ detail: r,
77
+ kind: "record",
78
+ key: `record:${s}:${u.toLowerCase()}`
79
+ } : { title: o, section: "List", detail: r, kind: "list", key: `list:${s}` };
80
+ }
81
+ if (a === "queues" && s)
82
+ return {
83
+ title: "A queue",
84
+ section: "Queue",
85
+ detail: r,
86
+ kind: "queue",
87
+ key: `queue:${s.toLowerCase()}`
88
+ };
89
+ const d = i.filter((o) => !y(o)).map(k).filter(Boolean), f = `page:${i.join("/").toLowerCase()}`;
90
+ return d.length ? {
91
+ title: d[d.length - 1],
92
+ section: d.length > 1 ? d[0] : null,
93
+ detail: r,
94
+ kind: "page",
95
+ key: f
96
+ } : { title: "Home", section: null, detail: r, kind: "page", key: f };
97
+ }
98
+ const $ = (e) => new Date(e).getTime();
99
+ function q(e) {
100
+ const t = [...e].sort((o, l) => $(o.entered_at) - $(l.entered_at)), n = t.length > 1 ? t.filter((o) => o.duration_seconds !== 0) : t, i = n.length ? n : t.slice(-1), r = [];
101
+ for (const o of i) {
102
+ const l = o.label ?? v(o.path), c = r[r.length - 1], p = l.detail;
103
+ if (c && c.label.key === l.key) {
104
+ c.visits++, c.seconds = o.duration_seconds == null ? c.seconds : (c.seconds ?? 0) + o.duration_seconds, c.open = o.duration_seconds == null, p && !c.details.includes(p) && c.details.push(p), !c.label.record && l.record && (c.label = { ...l, detail: c.label.detail });
105
+ continue;
106
+ }
107
+ r.push({
108
+ label: l,
109
+ path: o.path,
110
+ app: o.app ?? "admin",
111
+ start: o.entered_at,
112
+ seconds: o.duration_seconds,
113
+ visits: 1,
114
+ details: p ? [p] : [],
115
+ open: o.duration_seconds == null
116
+ });
117
+ }
118
+ const a = t[0], s = t[t.length - 1], u = a ? $(a.entered_at) : 0, d = s ? $(s.entered_at) + (s.duration_seconds ?? 0) * 1e3 : 0, f = Math.max(u, d);
119
+ return {
120
+ rows: r,
121
+ skipped: t.length - i.length,
122
+ views: t.length,
123
+ start: a ? new Date(u).toISOString() : "",
124
+ end: a ? new Date(f).toISOString() : "",
125
+ seconds: Math.round((f - u) / 1e3)
126
+ };
127
+ }
128
+ function w(e) {
129
+ const t = new Intl.DateTimeFormat("en-US", {
130
+ hour: "numeric",
131
+ minute: "2-digit",
132
+ ...b() ? { timeZone: b() } : {}
133
+ }).formatToParts(new Date(e)), n = (i) => {
134
+ var r;
135
+ return ((r = t.find((a) => a.type === i)) == null ? void 0 : r.value) ?? "";
136
+ };
137
+ return { time: `${n("hour")}:${n("minute")}`, period: n("dayPeriod") };
138
+ }
139
+ function g(e) {
140
+ const { time: t, period: n } = w(e);
141
+ return n ? `${t} ${n}` : t;
142
+ }
143
+ function D(e, t) {
144
+ const n = w(e), i = w(t);
145
+ return n.time === i.time && n.period === i.period ? g(e) : n.period === i.period ? `${n.time} – ${i.time}${i.period ? ` ${i.period}` : ""}` : `${g(e)} – ${g(t)}`;
146
+ }
147
+ function P(e) {
148
+ if (e == null || !Number.isFinite(e)) return "";
149
+ const t = Math.max(0, Math.round(e));
150
+ if (t < 1) return "<1s";
151
+ if (t < 60) return `${t}s`;
152
+ const n = Math.floor(t / 60);
153
+ if (n < 10) return t % 60 ? `${n}m ${t % 60}s` : `${n}m`;
154
+ if (n < 60) return `${n}m`;
155
+ const i = Math.floor(n / 60);
156
+ return n % 60 ? `${i}h ${n % 60}m` : `${i}h`;
157
+ }
158
+ export {
159
+ v as fallbackJourneyLabel,
160
+ g as fmtClock,
161
+ P as fmtDuration,
162
+ D as fmtSpan,
163
+ q as foldJourneySession,
164
+ y as isIdLike,
165
+ k as words
166
+ };