@nivaro/react 0.3.40 → 0.3.42
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/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,39 +1,67 @@
|
|
|
1
|
-
import { reportClientCrash as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { reportClientCrash as c } from "./client-crash.js";
|
|
2
|
+
const d = "Something went wrong — it’s been reported", g = /failed to fetch|load failed|networkerror|network request failed|network error/i;
|
|
3
|
+
function u(e) {
|
|
4
4
|
var s;
|
|
5
|
-
const
|
|
6
|
-
return typeof
|
|
5
|
+
const t = e, o = (t == null ? void 0 : t.status) ?? ((s = t == null ? void 0 : t.response) == null ? void 0 : s.status);
|
|
6
|
+
return typeof o == "number" ? o : null;
|
|
7
7
|
}
|
|
8
|
-
function f(
|
|
9
|
-
return !(
|
|
8
|
+
function f(e) {
|
|
9
|
+
return !(e instanceof Error) || u(e) != null || e.response != null || g.test(e.message) ? !1 : e instanceof TypeError || e instanceof ReferenceError || e instanceof RangeError;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
function
|
|
11
|
+
const l = /^(bad request|unauthorized|forbidden|not found|conflict|unprocessable entity|too many requests|internal server error|bad gateway|service unavailable|gateway timeout)$/i;
|
|
12
|
+
function h(e) {
|
|
13
13
|
var s;
|
|
14
|
-
const
|
|
15
|
-
for (const
|
|
16
|
-
const n =
|
|
17
|
-
if (typeof n == "string" && n.trim() && !
|
|
14
|
+
const t = e, o = [(s = t == null ? void 0 : t.response) == null ? void 0 : s.data, t == null ? void 0 : t.response];
|
|
15
|
+
for (const r of o) {
|
|
16
|
+
const n = r == null ? void 0 : r.error;
|
|
17
|
+
if (typeof n == "string" && n.trim() && !l.test(n.trim())) return n.trim();
|
|
18
18
|
}
|
|
19
|
-
for (const
|
|
20
|
-
const n =
|
|
19
|
+
for (const r of o) {
|
|
20
|
+
const n = r == null ? void 0 : r.message;
|
|
21
21
|
if (typeof n == "string" && n.trim()) return n.trim();
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return
|
|
25
|
+
function p(e, t = "Failed") {
|
|
26
|
+
const o = h(e);
|
|
27
|
+
return o || (f(e) ? d : e instanceof Error ? w(e.message) ? m(u(e)) ?? t : e.message || t : typeof e == "string" && e.trim() ? e : t);
|
|
28
28
|
}
|
|
29
|
-
const i =
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
const i = {
|
|
30
|
+
400: "That request could not be completed",
|
|
31
|
+
401: "You are signed out",
|
|
32
|
+
403: "You do not have access to do this",
|
|
33
|
+
404: "That could not be found",
|
|
34
|
+
408: "The server took too long to answer",
|
|
35
|
+
409: "This changed while you were working on it",
|
|
36
|
+
413: "That is too large to send",
|
|
37
|
+
422: "Some values need fixing",
|
|
38
|
+
423: "Someone else is working on this",
|
|
39
|
+
429: "Too many requests in a short time",
|
|
40
|
+
500: "Something went wrong on the server",
|
|
41
|
+
502: "The server is not answering right now",
|
|
42
|
+
503: "The server is not answering right now",
|
|
43
|
+
504: "The server took too long to answer"
|
|
44
|
+
};
|
|
45
|
+
function m(e) {
|
|
46
|
+
return e == null ? null : i[e] ?? (e >= 500 ? i[500] : e >= 400 ? i[400] : null);
|
|
47
|
+
}
|
|
48
|
+
function w(e) {
|
|
49
|
+
if (typeof e != "string") return !1;
|
|
50
|
+
const t = e.trim();
|
|
51
|
+
return /^request failed with status( code)? \d{3}$/i.test(t) || l.test(t) || /^(payload too large|request entity too large|locked|request timeout)$/i.test(t);
|
|
52
|
+
}
|
|
53
|
+
const a = /* @__PURE__ */ new WeakSet();
|
|
54
|
+
function S(e, t) {
|
|
55
|
+
!e || !f(t) || a.has(t) || (a.add(t), c(e, t, null).catch(() => {
|
|
32
56
|
}));
|
|
33
57
|
}
|
|
34
58
|
export {
|
|
35
|
-
|
|
59
|
+
d as SOMETHING_WENT_WRONG,
|
|
60
|
+
i as STATUS_TITLES,
|
|
61
|
+
u as errorStatusOf,
|
|
62
|
+
w as isBareStatusText,
|
|
36
63
|
f as isCodeError,
|
|
37
|
-
|
|
38
|
-
|
|
64
|
+
S as reportCodeError,
|
|
65
|
+
m as statusTitle,
|
|
66
|
+
p as userErrorMessage
|
|
39
67
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function b(s, i) {
|
|
2
|
+
const r = String(s ?? "").toLowerCase(), n = String(i ?? "").toLowerCase();
|
|
3
|
+
return n.includes("user") || n.includes("avatar") || n.includes("owner") ? "avatar" : n.includes("status") || n.includes("badge") || n.includes("select-dropdown") ? "badge" : r === "boolean" || n.includes("toggle") || n.includes("checkbox") ? "bool" : r === "date" || r === "datetime" || r === "timestamp" || r === "time" ? "date" : r === "integer" || r === "biginteger" || r === "float" || r === "decimal" ? "number" : r === "text" || n.includes("textarea") || n.includes("rich") ? "long" : r === "uuid" ? "short" : "text";
|
|
4
|
+
}
|
|
5
|
+
function g(s, i) {
|
|
6
|
+
const r = Math.sin((s + 1) * 12.9898 + (i + 1) * 78.233) * 43758.5453;
|
|
7
|
+
return r - Math.floor(r);
|
|
8
|
+
}
|
|
9
|
+
function h(s, i, r) {
|
|
10
|
+
const n = g(i, r);
|
|
11
|
+
switch (s) {
|
|
12
|
+
case "number":
|
|
13
|
+
return `${Math.round(36 + n * 28)}px`;
|
|
14
|
+
case "date":
|
|
15
|
+
return `${Math.round(72 + n * 10)}px`;
|
|
16
|
+
case "badge":
|
|
17
|
+
return `${Math.round(52 + n * 26)}px`;
|
|
18
|
+
case "avatar":
|
|
19
|
+
return "20px";
|
|
20
|
+
case "bool":
|
|
21
|
+
return "14px";
|
|
22
|
+
case "short":
|
|
23
|
+
return `${Math.round(30 + n * 30)}%`;
|
|
24
|
+
case "long":
|
|
25
|
+
return `${Math.round(60 + n * 35)}%`;
|
|
26
|
+
default:
|
|
27
|
+
return `${Math.round(45 + n * 45)}%`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function _(s, i, r = {}) {
|
|
31
|
+
const n = new Map(i.map((o) => [o.field, o]));
|
|
32
|
+
return s.map((o) => {
|
|
33
|
+
const l = n.get(o.split(".")[0]);
|
|
34
|
+
return { key: o, shape: b(l == null ? void 0 : l.type, l == null ? void 0 : l.interface), width: r[o] ?? null };
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const m = [3, 4, 6, 12];
|
|
38
|
+
function y(s, i = {}) {
|
|
39
|
+
if (!s || !Array.isArray(s.groups) || !Array.isArray(s.assignments)) return null;
|
|
40
|
+
const r = i.maxSections ?? 6, n = i.maxFields ?? 16, o = [...s.groups].filter((t) => t.visibility_mode === "new_only" ? !!i.isNew : t.visibility_mode === "existing_only" ? !i.isNew : !0).sort((t, e) => (t.sort ?? 0) - (e.sort ?? 0)), l = o.filter((t) => t.type === "tab" && t.container_id == null), d = l[0] ?? null, f = (t) => s.assignments.filter(
|
|
41
|
+
(e) => (e.group_key ?? null) === t && e.is_visible !== !1 && e.is_visible !== 0 && !!e.field
|
|
42
|
+
).sort((e, u) => (e.sort ?? 0) - (u.sort ?? 0)).slice(0, n).map((e) => {
|
|
43
|
+
const u = e.widget_id != null || /^__.*__$/.test(e.field), a = m.includes(Number(e.col_span)) ? Number(e.col_span) : 12;
|
|
44
|
+
return { key: e.field, span: u ? Math.max(a, 6) : a, ...u ? { tall: u } : {} };
|
|
45
|
+
}), c = [], p = (t) => {
|
|
46
|
+
const e = f(t.key);
|
|
47
|
+
e.length && c.push({ key: t.key, label: t.label ?? null, fields: e });
|
|
48
|
+
};
|
|
49
|
+
if (d) {
|
|
50
|
+
const t = f(d.key);
|
|
51
|
+
t.length && c.push({ key: d.key, label: null, fields: t });
|
|
52
|
+
for (const e of o)
|
|
53
|
+
e.type === "section" && e.container_id != null && e.container_id === d.id && p(e);
|
|
54
|
+
} else {
|
|
55
|
+
const t = f(null), e = s.ungrouped_sort ?? -1;
|
|
56
|
+
let u = t.length === 0;
|
|
57
|
+
for (const a of o)
|
|
58
|
+
a.type !== "section" && a.type !== "metadata" || (!u && (a.sort ?? 0) > e && (c.push({ key: "__ungrouped__", label: null, fields: t }), u = !0), p(a));
|
|
59
|
+
u || c.push({ key: "__ungrouped__", label: null, fields: t });
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
tabs: l.map((t) => t.label || t.key).slice(0, 8),
|
|
63
|
+
sections: c.slice(0, r)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
h as cellWidth,
|
|
68
|
+
y as formSkeletonFromLayout,
|
|
69
|
+
g as jitter,
|
|
70
|
+
b as shapeForField,
|
|
71
|
+
_ as skeletonColumnsFrom
|
|
72
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const f = 3e3, l = 3e3, c = 40;
|
|
2
|
+
function u(t) {
|
|
3
|
+
if (!Number.isFinite(t) || t < 0) return "0";
|
|
4
|
+
if (t >= 1e6) {
|
|
5
|
+
const o = Math.round(t / 1e5) / 10;
|
|
6
|
+
return `${o % 1 === 0 ? o.toFixed(0) : o.toFixed(1)} million`;
|
|
7
|
+
}
|
|
8
|
+
return Math.round(t).toLocaleString("en-US");
|
|
9
|
+
}
|
|
10
|
+
function s(t) {
|
|
11
|
+
const o = t.replace(/[_-]+/g, " ").trim();
|
|
12
|
+
return o ? o.split(/\s+/).map((e) => e === e.toUpperCase() ? e : e[0].toUpperCase() + e.slice(1)).join(" ") : t;
|
|
13
|
+
}
|
|
14
|
+
function a(t, o) {
|
|
15
|
+
return t.noun ? t.noun : o.collection ? o.collection.replace(/_/g, " ") : null;
|
|
16
|
+
}
|
|
17
|
+
function d(t, o = {}) {
|
|
18
|
+
var r;
|
|
19
|
+
if (!(t != null && t.found) || !t.kind) return null;
|
|
20
|
+
const e = a(o, t);
|
|
21
|
+
switch (t.kind) {
|
|
22
|
+
case "slot": {
|
|
23
|
+
const n = t.position ?? null;
|
|
24
|
+
return n && n > 1 ? `Waiting for a free slot — busy right now (${n - 1} ahead of you)` : n === 1 ? "Waiting for a free slot — busy right now (you are next)" : "Waiting for a free slot — busy right now";
|
|
25
|
+
}
|
|
26
|
+
case "external":
|
|
27
|
+
return t.subject ? `Waiting for ${s(t.subject)}` : "Waiting for a partner system";
|
|
28
|
+
case "query":
|
|
29
|
+
case "widget": {
|
|
30
|
+
const n = ((r = o.label) == null ? void 0 : r.trim()) || (t.subject ? s(t.subject) : t.kind === "widget" ? "this widget" : "the query");
|
|
31
|
+
return t.shared ? `Someone else is running ${n} too — sharing their answer` : t.kind === "widget" ? `Working out ${n} — not cached yet` : `Running ${n} — not cached yet`;
|
|
32
|
+
}
|
|
33
|
+
case "database": {
|
|
34
|
+
const n = o.knownRows ?? t.table_rows ?? null, i = t.rows_so_far && t.rows_so_far > 0 ? ` — ${u(t.rows_so_far)} so far` : "";
|
|
35
|
+
return n && n > 0 ? `Reading ${u(n)} ${e ?? "records"}${i}` : e ? `Reading ${e} from the database${i}` : `Reading from the database${i}`;
|
|
36
|
+
}
|
|
37
|
+
case "auth":
|
|
38
|
+
return "Checking your sign-in";
|
|
39
|
+
default:
|
|
40
|
+
return e ? `Preparing ${e}` : null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function g(t) {
|
|
44
|
+
const o = Math.max(0, Math.floor(t / 1e3));
|
|
45
|
+
return o < 60 ? `${o}s` : `${Math.floor(o / 60)}m ${String(o % 60).padStart(2, "0")}s`;
|
|
46
|
+
}
|
|
47
|
+
function h(t) {
|
|
48
|
+
let o = null;
|
|
49
|
+
for (const [, e] of t) {
|
|
50
|
+
const r = e == null ? void 0 : e.total;
|
|
51
|
+
typeof r == "number" && Number.isFinite(r) && r > 0 && (o = Math.max(o ?? 0, r));
|
|
52
|
+
}
|
|
53
|
+
return o;
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
f as SLOW_REASON_AFTER_MS,
|
|
57
|
+
c as SLOW_REASON_MAX_POLLS,
|
|
58
|
+
l as SLOW_REASON_POLL_MS,
|
|
59
|
+
g as elapsedLabel,
|
|
60
|
+
u as formatCount,
|
|
61
|
+
h as knownTotalFrom,
|
|
62
|
+
d as slowReasonText
|
|
63
|
+
};
|