@nivaro/react 0.3.52 → 0.3.53

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 (34) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +47 -3
  4. package/dist/shared/components/ItemEditForm.js +3851 -3821
  5. package/dist/shared/components/NotificationBell.js +163 -150
  6. package/dist/shared/components/PageRenderer.js +600 -549
  7. package/dist/shared/components/ProfileView.js +36 -34
  8. package/dist/shared/components/QueryStatStrip.js +96 -89
  9. package/dist/shared/components/QueryTable.js +214 -215
  10. package/dist/shared/components/ReportView.js +548 -529
  11. package/dist/shared/components/alerts/AlertManagerView.js +346 -320
  12. package/dist/shared/components/item-edit/CatalogPickerField.js +1300 -1219
  13. package/dist/shared/components/item-edit/FieldAffordances.js +145 -136
  14. package/dist/shared/components/item-edit/FieldRenderer.js +366 -326
  15. package/dist/shared/components/item-edit/InlineTableField.js +3047 -2932
  16. package/dist/shared/components/item-edit/NestedRelationEditor.js +149 -143
  17. package/dist/shared/components/item-edit/PlanGrid.js +718 -705
  18. package/dist/shared/components/item-edit/SummaryPanel.js +351 -337
  19. package/dist/shared/components/item-edit/line-qty.js +115 -53
  20. package/dist/shared/components/item-edit/save-refusal.js +18 -18
  21. package/dist/shared/components/item-edit/usePersonalDefaults.js +210 -207
  22. package/dist/shared/components/panels/CommentPanel.js +204 -197
  23. package/dist/shared/components/panels/ItemLockBanner.js +318 -291
  24. package/dist/shared/components/panels/PipelinePanel.js +1388 -1218
  25. package/dist/shared/components/panels/RecordIntegrityBanner.js +201 -172
  26. package/dist/shared/components/panels/RevisionsPanel.js +101 -106
  27. package/dist/shared/components/panels/TransitionRequirementsDialog.js +564 -534
  28. package/dist/shared/components/panels/requirement-side-effects.js +46 -29
  29. package/dist/shared/components/queue/QueueItemSheet.js +219 -146
  30. package/dist/shared/components/queue/QueueWorklist.js +738 -730
  31. package/dist/shared/components/widgets/ReviewListWidget.js +236 -201
  32. package/dist/shared/lib/activity-sentence.js +236 -227
  33. package/dist/shared/lib/record-ref.js +43 -34
  34. package/package.json +1 -1
@@ -1,72 +1,81 @@
1
- import { get as a } from "./commands.js";
2
- const s = /^[A-Za-z_][A-Za-z0-9_]*$/;
3
- function c(n) {
1
+ import { get as c } from "./commands.js";
2
+ const o = /^[A-Za-z_][A-Za-z0-9_]*$/;
3
+ function a(n) {
4
4
  const t = n == null ? void 0 : n.friendly_id_field;
5
- return typeof t == "string" && t !== "id" && s.test(t) ? t : null;
5
+ return typeof t == "string" && t !== "id" && o.test(t) ? t : null;
6
6
  }
7
- function o(n) {
7
+ function s(n) {
8
8
  if (n == null || typeof n == "object") return null;
9
9
  const t = String(n).trim();
10
10
  return t === "" ? null : t;
11
11
  }
12
12
  function d(n, t) {
13
- const e = c(n);
14
- return e && t ? o(t[e]) : null;
13
+ const r = a(n);
14
+ return r && t ? s(t[r]) : null;
15
15
  }
16
16
  function y(n) {
17
17
  const t = n == null ? void 0 : n.url_alias_fields;
18
- let e = t;
18
+ let r = t;
19
19
  if (typeof t == "string")
20
20
  try {
21
- e = JSON.parse(t);
21
+ r = JSON.parse(t);
22
22
  } catch {
23
- e = [];
23
+ r = [];
24
24
  }
25
- return Array.isArray(e) ? e.filter((i) => typeof i == "string" && s.test(i)) : [];
25
+ return Array.isArray(r) ? r.filter((e) => typeof e == "string" && o.test(e)) : [];
26
26
  }
27
- function p(n, t) {
27
+ function g(n, t) {
28
28
  if (!t) return null;
29
- const e = y(n);
30
- let i;
31
- if (e.length > 0) {
32
- const r = e.map((l) => o(t[l]));
33
- if (r.some((l) => l == null)) return null;
34
- i = r.join("-");
29
+ const r = y(n);
30
+ let e;
31
+ if (r.length > 0) {
32
+ const i = r.map((l) => s(t[l]));
33
+ if (i.some((l) => l == null)) return null;
34
+ e = i.join("-");
35
35
  } else
36
- i = d(n, t);
37
- return !i || /^\d+$/.test(i) || /^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(i) || i === "new" || i.includes("/") ? null : i;
36
+ e = d(n, t);
37
+ return !e || /^\d+$/.test(e) || /^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e) || e === "new" || e.includes("/") ? null : e;
38
38
  }
39
- async function h(n, t, e, i, r) {
40
- var u;
41
- const l = p(e, i);
42
- if (!l) return String(r);
39
+ async function S(n, t, r, e, i) {
40
+ var f;
41
+ const l = g(r, e);
42
+ if (!l) return String(i);
43
43
  try {
44
- const f = await n.request(
45
- a(`/items/${t}/by-slug/${encodeURIComponent(l)}`, { fields: "id" })
44
+ const u = await n.request(
45
+ c(`/items/${t}/by-slug/${encodeURIComponent(l)}`, { fields: "id" })
46
46
  );
47
- return String(((u = f == null ? void 0 : f.data) == null ? void 0 : u.id) ?? "") === String(r) ? l : String(r);
47
+ return String(((f = u == null ? void 0 : u.data) == null ? void 0 : f.id) ?? "") === String(i) ? l : String(i);
48
48
  } catch {
49
- return String(r);
49
+ return String(i);
50
50
  }
51
51
  }
52
52
  async function w(n) {
53
53
  const t = typeof navigator < "u" ? navigator.clipboard : void 0;
54
54
  if (!t) return;
55
- const e = globalThis.ClipboardItem;
56
- if (e && typeof t.write == "function")
55
+ const r = globalThis.ClipboardItem;
56
+ if (r && typeof t.write == "function")
57
57
  try {
58
58
  await t.write([
59
- new e({ "text/plain": n.then((i) => new Blob([i], { type: "text/plain" })) })
59
+ new r({ "text/plain": n.then((e) => new Blob([e], { type: "text/plain" })) })
60
60
  ]);
61
61
  return;
62
62
  } catch {
63
63
  }
64
64
  await t.writeText(await n);
65
65
  }
66
+ function p(n) {
67
+ return /^No [\w ]+ number( · |$)/.test(String(n ?? ""));
68
+ }
69
+ function h(n) {
70
+ const t = String(n.label ?? "").trim();
71
+ return !t || p(t) ? null : t;
72
+ }
66
73
  export {
67
- p as aliasSegmentOf,
74
+ g as aliasSegmentOf,
75
+ h as copyIdText,
68
76
  w as copyWhenReady,
69
- c as friendlyIdFieldOf,
77
+ a as friendlyIdFieldOf,
70
78
  d as friendlyIdOf,
71
- h as shareableRecordId
79
+ p as isNoNumberLabel,
80
+ S as shareableRecordId
72
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.3.52",
3
+ "version": "0.3.53",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",