@nivaro/react 0.3.67 → 0.3.68

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 (26) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +836 -835
  5. package/dist/shared/components/ConformanceView.js +34 -34
  6. package/dist/shared/components/ReportView.js +196 -196
  7. package/dist/shared/components/SlaRulesView.js +36 -36
  8. package/dist/shared/components/chat/ChatPanel.js +484 -487
  9. package/dist/shared/components/chat/ChatViews.js +66 -66
  10. package/dist/shared/components/chat/RoomParts.js +159 -157
  11. package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
  12. package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
  13. package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
  14. package/dist/shared/components/item-edit/FieldRow.js +87 -87
  15. package/dist/shared/components/item-edit/FilePickerField.js +281 -297
  16. package/dist/shared/components/item-edit/RecordInsights.js +90 -91
  17. package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
  18. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
  19. package/dist/shared/components/panels/AddendumPanel.js +409 -411
  20. package/dist/shared/components/panels/CommentPanel.js +169 -162
  21. package/dist/shared/components/panels/PipelinePanel.js +75 -75
  22. package/dist/shared/components/panels/RevisionsPanel.js +103 -103
  23. package/dist/shared/components/queue/QueueWorklist.js +142 -141
  24. package/dist/shared/lib/format-value.js +15 -15
  25. package/dist/shared/lib/utils.js +58 -53
  26. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { formatDateTime as s, formatRelative as m } from "./utils.js";
2
- const a = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], c = /* @__PURE__ */ new Set(["true", "1", "yes", "y"]), l = /* @__PURE__ */ new Set(["false", "0", "no", "n"]);
1
+ import { formatDateTime as s, toLocalDateString as a, formatRelative as m } from "./utils.js";
2
+ const c = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], l = /* @__PURE__ */ new Set(["true", "1", "yes", "y"]), h = /* @__PURE__ */ new Set(["false", "0", "no", "n"]);
3
3
  function u(t) {
4
4
  return String(t).padStart(2, "0");
5
5
  }
@@ -12,7 +12,7 @@ function f(t, e) {
12
12
  case "YY":
13
13
  return String(r.getFullYear()).slice(-2);
14
14
  case "MMM":
15
- return a[r.getMonth()];
15
+ return c[r.getMonth()];
16
16
  case "MM":
17
17
  return u(r.getMonth() + 1);
18
18
  case "DD":
@@ -36,10 +36,10 @@ function f(t, e) {
36
36
  }
37
37
  });
38
38
  }
39
- function h(t, e) {
39
+ function p(t, e) {
40
40
  if (e.type === "count") return t;
41
41
  if (e.type === "datetime")
42
- return e.template !== "relative" && /h|H/.test(e.template) ? s(t) || t : f(t, e.template);
42
+ return e.template !== "relative" && /h|H/.test(e.template) ? s(t) || t : e.template !== "relative" && /D/.test(e.template) && /M/.test(e.template) && /Y/.test(e.template) ? a(t) || t : f(t, e.template);
43
43
  if (e.type === "number") {
44
44
  const r = Number(t);
45
45
  if (Number.isNaN(r) || t.trim() === "") return t;
@@ -51,14 +51,14 @@ function h(t, e) {
51
51
  return `${e.prefix ?? ""}${i}${e.suffix ?? ""}`;
52
52
  }
53
53
  const n = t.trim().toLowerCase();
54
- return c.has(n) ? e.true_label : l.has(n) ? e.false_label : t;
54
+ return l.has(n) ? e.true_label : h.has(n) ? e.false_label : t;
55
55
  }
56
56
  function N(t, e) {
57
57
  if (!t) return t;
58
58
  const n = t.match(/ \+\d+ more$/), r = n ? n[0] : "";
59
- return (r ? t.slice(0, -r.length) : t).split(", ").map((o) => h(o, e)).join(", ") + r;
59
+ return (r ? t.slice(0, -r.length) : t).split(", ").map((o) => p(o, e)).join(", ") + r;
60
60
  }
61
- function p(t, e = 2) {
61
+ function M(t, e = 2) {
62
62
  const n = typeof t == "string" ? (() => {
63
63
  try {
64
64
  return JSON.parse(t);
@@ -68,8 +68,8 @@ function p(t, e = 2) {
68
68
  })() : t ?? {}, r = Number(n.precision);
69
69
  return Number.isFinite(r) ? Math.min(Math.max(Math.trunc(r), 0), 10) : e;
70
70
  }
71
- function b(t, e) {
72
- const n = p(t);
71
+ function Y(t, e) {
72
+ const n = M(t);
73
73
  return e === "currency" ? {
74
74
  style: "currency",
75
75
  currency: "USD",
@@ -77,16 +77,16 @@ function b(t, e) {
77
77
  maximumFractionDigits: n
78
78
  } : { maximumFractionDigits: n };
79
79
  }
80
- function D(t, e) {
80
+ function b(t, e) {
81
81
  if (e && e.length > 0 && e.length < 50) return e.length;
82
82
  if (!t || t === "—") return (e == null ? void 0 : e.length) ?? 0;
83
83
  const n = t.match(/\+(\d+) more$/);
84
84
  return n ? t.replace(/ \+\d+ more$/, "").split(", ").filter(Boolean).length + Number(n[1]) : t.split(", ").filter(Boolean).length;
85
85
  }
86
86
  export {
87
- D as countFromResolved,
87
+ b as countFromResolved,
88
88
  N as formatMultiValue,
89
- h as formatValue,
90
- b as numericIntlOptions,
91
- p as precisionOf
89
+ p as formatValue,
90
+ Y as numericIntlOptions,
91
+ M as precisionOf
92
92
  };
@@ -1,31 +1,31 @@
1
- import { clsx as d } from "clsx";
2
- import * as h from "lucide-react";
3
- import { twMerge as N } from "tailwind-merge";
4
- import { serverNow as D } from "./server-clock.js";
5
- function M(...t) {
6
- return N(d(t));
7
- }
8
- let u = null;
9
- function b(t) {
1
+ import { clsx as h } from "clsx";
2
+ import * as N from "lucide-react";
3
+ import { twMerge as D } from "tailwind-merge";
4
+ import { serverNow as g } from "./server-clock.js";
5
+ function F(...t) {
6
+ return D(h(t));
7
+ }
8
+ let o = null;
9
+ function M(t) {
10
10
  if (t)
11
11
  try {
12
12
  new Intl.DateTimeFormat("en-US", { timeZone: t });
13
13
  } catch {
14
14
  return;
15
15
  }
16
- u = t;
16
+ o = t;
17
17
  }
18
18
  function I() {
19
- return u;
19
+ return o;
20
20
  }
21
- const g = /* @__PURE__ */ new Set(["1899-12-30", "1900-01-01"]);
22
- function m(t) {
21
+ const _ = /* @__PURE__ */ new Set(["1899-12-30", "1900-01-01"]);
22
+ function f(t) {
23
23
  if (t == null || t === "") return !1;
24
24
  const n = t instanceof Date ? Number.isNaN(t.getTime()) ? "" : t.toISOString() : String(t);
25
- return g.has(n.slice(0, 10));
25
+ return _.has(n.slice(0, 10));
26
26
  }
27
- function _(t, n) {
28
- if (m(t)) return "";
27
+ function b(t, n) {
28
+ if (f(t)) return "";
29
29
  const e = typeof t == "string" ? t.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/) : null, r = e ? new Date(Number(e[1]), Number(e[2]) - 1, Number(e[3])) : new Date(t);
30
30
  return new Intl.DateTimeFormat("en-US", {
31
31
  month: "short",
@@ -33,20 +33,25 @@ function _(t, n) {
33
33
  year: "numeric",
34
34
  // Calendar-day values never shift zones; real timestamps follow the
35
35
  // user's preferred zone when one is set.
36
- ...e || !u ? {} : { timeZone: u },
36
+ ...e || !o ? {} : { timeZone: o },
37
37
  ...n
38
38
  }).format(r);
39
39
  }
40
40
  function L(t) {
41
- if (m(t)) return "";
41
+ if (f(t)) return "";
42
42
  const n = t instanceof Date ? null : String(t), e = n == null ? void 0 : n.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/), r = e ? new Date(Number(e[1]), Number(e[2]) - 1, Number(e[3])) : t instanceof Date ? t : new Date(String(t));
43
- return Number.isNaN(r.getTime()) ? String(t) : (e && r.setFullYear(Number(e[1])), r.toLocaleDateString());
43
+ return Number.isNaN(r.getTime()) ? String(t) : (e && r.setFullYear(Number(e[1])), new Intl.DateTimeFormat("en-US", {
44
+ month: "short",
45
+ day: "numeric",
46
+ year: "numeric",
47
+ ...e || !o ? {} : { timeZone: o }
48
+ }).format(r));
44
49
  }
45
- function S(t) {
50
+ function m(t) {
46
51
  if (t == null || t === "") return "";
47
52
  const n = t instanceof Date ? t : new Date(t);
48
53
  return Number.isNaN(n.getTime()) ? String(t) : new Intl.DateTimeFormat("en-US", {
49
- ...u ? { timeZone: u } : {},
54
+ ...o ? { timeZone: o } : {},
50
55
  month: "short",
51
56
  day: "numeric",
52
57
  year: "numeric",
@@ -54,11 +59,11 @@ function S(t) {
54
59
  minute: "2-digit"
55
60
  }).format(n);
56
61
  }
57
- let f = "relative", a = "en-US", s = !1;
62
+ let s = "relative", a = "en-US", l = !1;
58
63
  function x(t) {
59
- f = t === "exact" ? "exact" : "relative";
64
+ s = t === "exact" ? "exact" : "relative";
60
65
  }
61
- function U(t) {
66
+ function y(t) {
62
67
  if (t != null && t.locale)
63
68
  try {
64
69
  new Intl.NumberFormat(t.locale), a = t.locale;
@@ -66,9 +71,9 @@ function U(t) {
66
71
  }
67
72
  else
68
73
  a = "en-US";
69
- s = (t == null ? void 0 : t.compact) === !0;
74
+ l = (t == null ? void 0 : t.compact) === !0;
70
75
  }
71
- function y(t, n) {
76
+ function U(t, n) {
72
77
  const e = n.trim().toLowerCase();
73
78
  if (!e) return !0;
74
79
  const r = t.toLowerCase();
@@ -81,72 +86,72 @@ function E(t) {
81
86
  if (n < 48) return `${Math.round(n)}h`;
82
87
  const e = n / 24;
83
88
  if (e < 7) {
84
- const o = Math.floor(e), c = Math.round(n - o * 24);
85
- return c > 0 ? `${o}d ${c}h` : `${o}d`;
89
+ const u = Math.floor(e), c = Math.round(n - u * 24);
90
+ return c > 0 ? `${u}d ${c}h` : `${u}d`;
86
91
  }
87
92
  if (e < 60) return `${Math.round(e)}d`;
88
93
  const r = Math.floor(e / 30), i = Math.round(e - r * 30);
89
94
  return i > 0 ? `${r}mo ${i}d` : `${r}mo`;
90
95
  }
91
96
  function C(t) {
92
- if (f === "exact") return S(t);
93
- const n = new Date(t), e = D() - n.getTime(), r = Math.floor(e / 6e4);
97
+ if (s === "exact") return m(t);
98
+ const n = new Date(t), e = g() - n.getTime(), r = Math.floor(e / 6e4);
94
99
  if (r < 1) return "just now";
95
100
  if (r < 60) return `${r}m ago`;
96
101
  const i = Math.floor(r / 60);
97
102
  if (i < 24) return `${i}h ago`;
98
- const o = Math.floor(i / 24);
99
- return o < 7 ? `${o}d ago` : _(n);
103
+ const u = Math.floor(i / 24);
104
+ return u < 7 ? `${u}d ago` : m(n);
100
105
  }
101
106
  function T(t) {
102
107
  return t.replace(/_/g, " ").replace(/\b\w/g, (n) => n.toUpperCase());
103
108
  }
104
- const l = {
109
+ const d = {
105
110
  _and: [
106
111
  { is_redacted: { _eq: !1 } },
107
112
  { _or: [{ status: { _neq: "suspended" } }, { status: { _null: !0 } }] }
108
113
  ]
109
- }, $ = {
110
- _and: [...l._and, { account_kind: { _null: !0 } }]
114
+ }, S = {
115
+ _and: [...d._and, { account_kind: { _null: !0 } }]
111
116
  };
112
117
  function O(t) {
113
- return t ? l : $;
118
+ return t ? d : S;
114
119
  }
115
- function A(t) {
120
+ function Z(t) {
116
121
  const n = String(t ?? "");
117
122
  return n.startsWith("$t:") ? T(n.slice(3).replace(/-/g, "_")) : n;
118
123
  }
119
- function R(t) {
120
- return t == null ? "—" : s && Math.abs(t) >= 1e4 ? new Intl.NumberFormat(a, {
124
+ function A(t) {
125
+ return t == null ? "—" : l && Math.abs(t) >= 1e4 ? new Intl.NumberFormat(a, {
121
126
  notation: "compact",
122
127
  maximumFractionDigits: 1
123
128
  }).format(t) : t.toLocaleString(a);
124
129
  }
125
- function Z(t) {
130
+ function R(t) {
126
131
  return t == null ? "—" : t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(2)} GB`;
127
132
  }
128
133
  function B(t) {
129
134
  if (!t) return null;
130
135
  const n = t.split("-").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("");
131
- return h[n];
136
+ return N[n];
132
137
  }
133
138
  export {
134
- l as ACTIVE_USER_OPTION_FILTER,
135
- $ as PEOPLE_USER_OPTION_FILTER,
136
- A as choiceLabel,
137
- M as cn,
138
- _ as formatDate,
139
- S as formatDateTime,
140
- Z as formatFileSize,
141
- R as formatNumber,
139
+ d as ACTIVE_USER_OPTION_FILTER,
140
+ S as PEOPLE_USER_OPTION_FILTER,
141
+ Z as choiceLabel,
142
+ F as cn,
143
+ b as formatDate,
144
+ m as formatDateTime,
145
+ R as formatFileSize,
146
+ A as formatNumber,
142
147
  C as formatRelative,
143
148
  I as getDisplayTimezone,
144
149
  E as humanHours,
145
- m as isNullDate,
146
- y as matchesAllTokens,
150
+ f as isNullDate,
151
+ U as matchesAllTokens,
147
152
  B as resolveCollectionIcon,
148
- b as setDisplayTimezone,
149
- U as setNumberFormat,
153
+ M as setDisplayTimezone,
154
+ y as setNumberFormat,
150
155
  x as setTimeDisplay,
151
156
  T as titleCase,
152
157
  L as toLocalDateString,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.3.67",
3
+ "version": "0.3.68",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",