@nivaro/react 0.3.100 → 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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +46 -3
- package/dist/index.js +623 -620
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/ItemEditForm.js +2708 -2704
- package/dist/shared/components/JobsTray.js +74 -63
- package/dist/shared/components/NotificationBell.js +80 -73
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/panels/BackgroundMove.js +152 -85
- package/dist/shared/components/panels/PipelinePanel.js +602 -594
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +16 -6
- package/dist/shared/lib/obligation-banner.js +16 -16
- package/dist/shared/lib/partner-failure.js +44 -32
- 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
|
+
};
|