@nivaro/react 0.3.48 → 0.3.50

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 (52) hide show
  1. package/dist/components/InlineGridField.js +166 -105
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +25 -1
  5. package/dist/shared/components/CellCopyLayer.js +81 -44
  6. package/dist/shared/components/CollectionBrowserView.js +306 -297
  7. package/dist/shared/components/DataTable.js +3 -3
  8. package/dist/shared/components/FulfilmentPill.js +98 -78
  9. package/dist/shared/components/ItemEditForm.js +4682 -4570
  10. package/dist/shared/components/NotificationSourcesCard.js +151 -147
  11. package/dist/shared/components/ProfileView.js +72 -70
  12. package/dist/shared/components/QueryTable.js +462 -333
  13. package/dist/shared/components/imports/ImportConsole.js +4 -4
  14. package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +1144 -1127
  16. package/dist/shared/components/item-edit/CloneDialog.js +192 -142
  17. package/dist/shared/components/item-edit/FieldRenderer.js +127 -126
  18. package/dist/shared/components/item-edit/FieldRow.js +236 -226
  19. package/dist/shared/components/item-edit/HeaderTools.js +118 -113
  20. package/dist/shared/components/item-edit/InlineGridField.js +92 -90
  21. package/dist/shared/components/item-edit/InlineTableField.js +3091 -2942
  22. package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
  23. package/dist/shared/components/item-edit/PlanGrid.js +162 -162
  24. package/dist/shared/components/item-edit/PolishFields.js +169 -162
  25. package/dist/shared/components/item-edit/RelationCombobox.js +186 -181
  26. package/dist/shared/components/item-edit/SummaryPanel.js +148 -135
  27. package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
  28. package/dist/shared/components/item-edit/helpers.js +181 -155
  29. package/dist/shared/components/item-edit/line-midair.js +201 -0
  30. package/dist/shared/components/item-edit/soft-rules.js +27 -0
  31. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  32. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
  33. package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
  34. package/dist/shared/components/notifications/DeliveryChips.js +9 -9
  35. package/dist/shared/components/panels/ItemLockBanner.js +414 -358
  36. package/dist/shared/components/panels/PipelinePanel.js +1171 -975
  37. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  38. package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
  39. package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
  40. package/dist/shared/components/profile/PersonProfile.js +23 -21
  41. package/dist/shared/components/profile/SignedInDevices.js +126 -0
  42. package/dist/shared/components/queue/QueueItemSheet.js +38 -37
  43. package/dist/shared/components/queue/QueueWorklist.js +870 -827
  44. package/dist/shared/components/queue/column-chooser.js +21 -0
  45. package/dist/shared/components/queue/live-state-aspect.js +6 -0
  46. package/dist/shared/components/support/SupportView.js +1 -1
  47. package/dist/shared/components/ui/number-draft-input.js +93 -0
  48. package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
  49. package/dist/shared/lib/edit-lock-fields.js +7 -0
  50. package/dist/shared/lib/error-hints.js +1 -0
  51. package/dist/shared/lib/reimport-visibility.js +10 -0
  52. package/package.json +1 -1
@@ -1,18 +1,19 @@
1
- import { jsxs as n, jsx as d } from "react/jsx-runtime";
2
- import { AlertCircle as v, X as N } from "lucide-react";
3
- import { useState as x } from "react";
4
- import { cn as u } from "../../lib/utils.js";
5
- const p = 6;
6
- function L({
7
- items: r,
8
- onJump: h,
9
- onDismiss: b
1
+ import { jsxs as n, jsx as r } from "react/jsx-runtime";
2
+ import { AlertCircle as S, X as L, Check as I } from "lucide-react";
3
+ import { useState as p, useRef as j } from "react";
4
+ import { cn as s } from "../../lib/utils.js";
5
+ const b = 6;
6
+ function M({
7
+ items: d,
8
+ onJump: k,
9
+ onDismiss: g
10
10
  }) {
11
- const [f, s] = x(!1), [o, k] = x(0);
12
- if (r.length === 0) return null;
13
- const t = r.length, l = new Set(r.map((e) => e.location).filter(Boolean)), g = l.size > 1 || l.size === 1 && r.some((e) => !e.location), i = f ? r : r.slice(0, p), c = t - i.length, m = (e) => {
14
- const a = r[e];
15
- a && (h(a.field), k((e + 1) % t), e + 1 >= p && s(!0));
11
+ const [v, c] = p(!1), [l, N] = p(0), m = j(/* @__PURE__ */ new Map());
12
+ for (const e of d) m.current.set(e.field, e);
13
+ if (d.length === 0) return null;
14
+ const t = d.length, w = new Set(d.map((e) => e.field)), a = [...m.current.values()], x = new Set(a.map((e) => e.location).filter(Boolean)), y = x.size > 1 || x.size === 1 && a.some((e) => !e.location), u = v ? a : a.slice(0, b), h = a.length - u.length, f = (e) => {
15
+ const o = d[e];
16
+ o && (k(o.field), N((e + 1) % t), e + 1 >= b && c(!0));
16
17
  };
17
18
  return /* @__PURE__ */ n(
18
19
  "div",
@@ -23,7 +24,7 @@ function L({
23
24
  className: "rounded-lg border border-red-200 bg-red-50 px-4 py-2.5 dark:border-red-500/30 dark:bg-red-400/10",
24
25
  children: [
25
26
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
26
- /* @__PURE__ */ d(v, { className: "h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400", "aria-hidden": !0 }),
27
+ /* @__PURE__ */ r(S, { className: "h-3.5 w-3.5 shrink-0 text-red-600 dark:text-red-400", "aria-hidden": !0 }),
27
28
  /* @__PURE__ */ n("span", { className: "text-[12.5px] font-medium text-red-800 dark:text-red-300", children: [
28
29
  "Can’t save yet — ",
29
30
  t,
@@ -37,63 +38,79 @@ function L({
37
38
  "button",
38
39
  {
39
40
  type: "button",
40
- onClick: () => m(o),
41
+ onClick: () => f(l % t),
41
42
  "data-validation-next": !0,
42
43
  className: "ml-1 inline-flex h-6 items-center gap-1 rounded-md border border-red-300 bg-white px-2 text-[11px] font-medium text-red-800 hover:bg-red-100 dark:border-red-500/40 dark:bg-transparent dark:text-red-200 dark:hover:bg-red-400/20",
43
44
  children: [
44
45
  "Next issue (",
45
- o + 1,
46
+ l % t + 1,
46
47
  "/",
47
48
  t,
48
49
  ") →"
49
50
  ]
50
51
  }
51
52
  ),
52
- /* @__PURE__ */ d(
53
+ /* @__PURE__ */ r(
53
54
  "button",
54
55
  {
55
56
  type: "button",
56
- onClick: b,
57
+ onClick: g,
57
58
  "aria-label": "Dismiss",
58
59
  className: "ml-auto rounded p-0.5 text-red-500 hover:bg-red-100 hover:text-red-700 dark:text-red-400 dark:hover:bg-red-400/20",
59
- children: /* @__PURE__ */ d(N, { className: "h-3.5 w-3.5" })
60
+ children: /* @__PURE__ */ r(L, { className: "h-3.5 w-3.5" })
60
61
  }
61
62
  )
62
63
  ] }),
63
- /* @__PURE__ */ d("ul", { className: "nvr-stagger-direct mt-1.5 space-y-0.5", children: i.map((e, a) => /* @__PURE__ */ n(
64
- "li",
65
- {
66
- className: u(
67
- "nvr-section-enter flex items-baseline gap-2 rounded-sm px-1 -mx-1 text-[12px]",
68
- a === o && t > 1 && "bg-red-100/70 dark:bg-red-400/15"
69
- ),
70
- children: [
71
- /* @__PURE__ */ d(
72
- "button",
73
- {
74
- type: "button",
75
- onClick: () => m(a),
76
- className: "shrink-0 font-medium text-red-800 underline decoration-dotted underline-offset-2 hover:decoration-solid dark:text-red-300",
77
- children: e.label
78
- }
64
+ /* @__PURE__ */ r("ul", { className: "nvr-stagger-direct mt-1.5 space-y-0.5", children: u.map((e) => {
65
+ const o = d.findIndex((C) => C.field === e.field), i = !w.has(e.field);
66
+ return /* @__PURE__ */ n(
67
+ "li",
68
+ {
69
+ "data-validation-fixed": i ? "" : void 0,
70
+ className: s(
71
+ "nvr-section-enter flex items-baseline gap-2 rounded-sm px-1 -mx-1 text-[12px]",
72
+ !i && o === l % t && t > 1 && "bg-red-100/70 dark:bg-red-400/15"
79
73
  ),
80
- /* @__PURE__ */ d("span", { className: "min-w-0 flex-1 text-red-800/90 dark:text-red-200/90", children: e.message }),
81
- g && e.location && /* @__PURE__ */ d("span", { className: "shrink-0 text-[11px] text-red-600/80 dark:text-red-400/70", children: e.location })
82
- ]
83
- },
84
- e.field
85
- )) }),
86
- c > 0 && /* @__PURE__ */ n(
74
+ children: [
75
+ i ? /* @__PURE__ */ n("span", { className: "inline-flex shrink-0 items-center gap-1 font-medium text-emerald-700 line-through decoration-emerald-600/60 dark:text-emerald-400", children: [
76
+ /* @__PURE__ */ r(I, { className: "h-3 w-3 shrink-0 no-underline", "aria-hidden": !0 }),
77
+ e.label
78
+ ] }) : /* @__PURE__ */ r(
79
+ "button",
80
+ {
81
+ type: "button",
82
+ onClick: () => f(o),
83
+ className: "shrink-0 font-medium text-red-800 underline decoration-dotted underline-offset-2 hover:decoration-solid dark:text-red-300",
84
+ children: e.label
85
+ }
86
+ ),
87
+ /* @__PURE__ */ r(
88
+ "span",
89
+ {
90
+ className: s(
91
+ "min-w-0 flex-1",
92
+ i ? "text-emerald-700/80 dark:text-emerald-400/80" : "text-red-800/90 dark:text-red-200/90"
93
+ ),
94
+ children: i ? "Fixed" : e.message
95
+ }
96
+ ),
97
+ y && e.location && /* @__PURE__ */ r("span", { className: "shrink-0 text-[11px] text-red-600/80 dark:text-red-400/70", children: e.location })
98
+ ]
99
+ },
100
+ e.field
101
+ );
102
+ }) }),
103
+ h > 0 && /* @__PURE__ */ n(
87
104
  "button",
88
105
  {
89
106
  type: "button",
90
- onClick: () => s(!0),
91
- className: u(
107
+ onClick: () => c(!0),
108
+ className: s(
92
109
  "mt-1 text-[11.5px] font-medium text-red-700 underline decoration-dotted underline-offset-2 dark:text-red-300"
93
110
  ),
94
111
  children: [
95
112
  "Show ",
96
- c,
113
+ h,
97
114
  " more"
98
115
  ]
99
116
  }
@@ -103,5 +120,5 @@ function L({
103
120
  );
104
121
  }
105
122
  export {
106
- L as ValidationSummary
123
+ M as ValidationSummary
107
124
  };
@@ -1,207 +1,232 @@
1
- import { useRef as b, useEffect as w, useState as E } from "react";
2
- import { useNivaroClient as N, useParentDraft as P } from "../../context.js";
3
- import { get as j } from "../../lib/commands.js";
4
- import { htmlToText as I } from "../../lib/sanitize-html.js";
5
- function L(t, n) {
6
- if (!t) {
7
- const i = [n.first_name, n.last_name].filter((l) => l != null && String(l).trim() !== "").join(" ");
1
+ import { useRef as O, useEffect as A, useState as E } from "react";
2
+ import { useNivaroClient as I, useParentDraft as J } from "../../context.js";
3
+ import { get as q } from "../../lib/commands.js";
4
+ import { htmlToText as C } from "../../lib/sanitize-html.js";
5
+ function z(e, t) {
6
+ if (!e) {
7
+ const i = [t.first_name, t.last_name].filter((l) => l != null && String(l).trim() !== "").join(" ");
8
8
  return String(
9
- n.name ?? n.title ?? n.label ?? n.type ?? n.description ?? (i || null) ?? n.email ?? n.id ?? ""
9
+ t.name ?? t.title ?? t.label ?? t.type ?? t.description ?? (i || null) ?? t.email ?? t.id ?? ""
10
10
  );
11
11
  }
12
- return t.replace(/\{\{([^}]+)\}\}/g, (i, l) => {
13
- const f = l.trim().split(".");
14
- let s = n;
15
- for (const d of f) {
12
+ return e.replace(/\{\{([^}]+)\}\}/g, (i, l) => {
13
+ const c = l.trim().split(".");
14
+ let s = t;
15
+ for (const u of c) {
16
16
  if (s == null || typeof s != "object") {
17
17
  s = null;
18
18
  break;
19
19
  }
20
- s = s[d];
20
+ s = s[u];
21
21
  }
22
22
  return String(s ?? "");
23
23
  });
24
24
  }
25
- function T(t) {
26
- if (t == null) return null;
27
- if (typeof t == "object") return t;
28
- if (typeof t != "string") return null;
25
+ function T(e) {
26
+ if (e == null) return null;
27
+ if (typeof e == "object") return e;
28
+ if (typeof e != "string") return null;
29
29
  try {
30
- return JSON.parse(t);
30
+ return JSON.parse(e);
31
31
  } catch {
32
32
  return null;
33
33
  }
34
34
  }
35
- function q(t) {
36
- const n = T(t);
37
- return Array.isArray(n == null ? void 0 : n.cascade_filters) ? n.cascade_filters : [];
35
+ function D(e) {
36
+ const t = T(e);
37
+ return Array.isArray(t == null ? void 0 : t.cascade_filters) ? t.cascade_filters : [];
38
38
  }
39
- function M(t) {
40
- var d, h;
41
- let n;
42
- const i = [], l = [], f = [], s = (o, a) => {
43
- if (n || (n = {}), o.filter_is_m2m)
44
- n[o.filter_column] = { _some: a };
39
+ function K(e) {
40
+ var u, b;
41
+ let t;
42
+ const i = [], l = [], c = [], s = (o, a) => {
43
+ if (t || (t = {}), o.filter_is_m2m)
44
+ t[o.filter_column] = { _some: a };
45
45
  else if (o.filter_column.includes(".")) {
46
- const p = o.filter_column.split(".");
47
- let _ = a;
48
- for (let u = p.length - 1; u >= 1; u--) _ = { [p[u]]: _ };
49
- n[p[0]] = o.filter_via_many ? { _some: _ } : _;
46
+ const _ = o.filter_column.split(".");
47
+ let f = a;
48
+ for (let m = _.length - 1; m >= 1; m--) f = { [_[m]]: f };
49
+ t[_[0]] = o.filter_via_many ? { _some: f } : f;
50
50
  } else
51
- n[o.filter_column] = a;
51
+ t[o.filter_column] = a;
52
52
  };
53
- for (const o of t.rules) {
54
- if ((d = t.skipParent) != null && d.call(t, o.parent_field)) continue;
55
- const a = t.parentValue(o.parent_field);
53
+ for (const o of e.rules) {
54
+ if ((u = e.skipParent) != null && u.call(e, o.parent_field)) continue;
55
+ const a = e.parentValue(o.parent_field);
56
56
  if (a != null && a !== "" && !(Array.isArray(a) && a.length === 0)) {
57
- let _ = a;
57
+ let f = a;
58
58
  if (o.value_map && typeof o.value_map == "object") {
59
- const y = o.value_map, m = (e) => y[String(e)] ?? o.value_map_default ?? e;
60
- _ = Array.isArray(a) ? [
59
+ const y = o.value_map, w = (n) => y[String(n)] ?? o.value_map_default ?? n;
60
+ f = Array.isArray(a) ? [
61
61
  ...new Set(
62
- a.flatMap((e) => {
63
- const r = m(e);
62
+ a.flatMap((n) => {
63
+ const r = w(n);
64
64
  return Array.isArray(r) ? r : [r];
65
65
  })
66
66
  )
67
- ] : m(a);
67
+ ] : w(a);
68
68
  }
69
- const u = Array.isArray(_) ? { _in: _ } : { _eq: _ };
70
- s(o, o.filter_is_m2m ? { id: u } : u), i.push(String(o.parent_field));
69
+ const m = Array.isArray(f) ? { _in: f } : { _eq: f };
70
+ s(o, o.filter_is_m2m ? { id: m } : m), i.push(String(o.parent_field));
71
71
  } else {
72
- l.push(String(o.parent_field)), o.show_all_if_no_parent === !1 && f.push(String(o.parent_field));
73
- const _ = o.value_map || (h = t.parentOptionFilter) == null ? void 0 : h.call(t, o.parent_field);
74
- _ && s(o, _);
72
+ l.push(String(o.parent_field)), o.show_all_if_no_parent === !1 && c.push(String(o.parent_field));
73
+ const f = o.value_map || (b = e.parentOptionFilter) == null ? void 0 : b.call(e, o.parent_field);
74
+ f && s(o, f);
75
75
  }
76
76
  }
77
- return { filter: n, satisfiedParents: i, unsatisfiedParents: l, missingRequiredParents: f };
77
+ return { filter: t, satisfiedParents: i, unsatisfiedParents: l, missingRequiredParents: c };
78
78
  }
79
- function z(t, n, i) {
80
- const l = (e) => n.some(
81
- (r) => r.many_collection === i && r.many_field === e && !r.junction_field || r.one_collection === i && r.one_field === e
82
- ), f = /* @__PURE__ */ new Map();
83
- for (const e of t) {
84
- if (e.hidden) continue;
85
- const r = q(e.dependency_config);
86
- r.length && l(e.field) && f.set(e.field, r);
79
+ function W(e, t, i) {
80
+ const l = (n) => t.some(
81
+ (r) => r.many_collection === i && r.many_field === n && !r.junction_field || r.one_collection === i && r.one_field === n
82
+ ), c = /* @__PURE__ */ new Map();
83
+ for (const n of e) {
84
+ if (n.hidden) continue;
85
+ const r = D(n.dependency_config);
86
+ r.length && l(n.field) && c.set(n.field, r);
87
87
  }
88
- const s = new Set(f.keys());
89
- for (const e of f.values())
90
- for (const r of e) l(r.parent_field) && s.add(r.parent_field);
91
- const d = (e, r) => [...r].filter((c) => c !== e && (f.get(c) ?? []).some((g) => g.parent_field === e)), h = new Set(t.filter((e) => e.required).map((e) => e.field)), o = (e) => h.has(e) && (f.get(e) ?? []).some((r) => r.show_all_if_no_parent !== !0), a = new Set(
92
- [...s].filter((e) => d(e, s).length === 0 && !o(e))
93
- ), p = new Set([...s].filter((e) => !a.has(e))), _ = new Set(
94
- [...p].filter((e) => d(e, p).length > 0 || f.has(e))
95
- ), u = [...p].filter((e) => {
96
- if (!_.has(e)) return !1;
97
- const r = d(e, s);
98
- return r.length === 0 || r.some((c) => p.has(c));
88
+ const s = new Set(c.keys());
89
+ for (const n of c.values())
90
+ for (const r of n) l(r.parent_field) && s.add(r.parent_field);
91
+ const u = (n, r) => [...r].filter((S) => S !== n && (c.get(S) ?? []).some((k) => k.parent_field === n)), b = new Set(e.filter((n) => n.required).map((n) => n.field)), o = (n) => b.has(n) && (c.get(n) ?? []).some((r) => r.show_all_if_no_parent !== !0), a = new Set(
92
+ [...s].filter((n) => u(n, s).length === 0 && !o(n))
93
+ ), _ = new Set([...s].filter((n) => !a.has(n))), f = new Set(
94
+ [..._].filter((n) => u(n, _).length > 0 || c.has(n))
95
+ ), m = [..._].filter((n) => {
96
+ if (!f.has(n)) return !1;
97
+ const r = u(n, s);
98
+ return r.length === 0 || r.some((S) => _.has(S));
99
99
  });
100
- if (u.length > 0) {
100
+ if (m.length > 0) {
101
101
  s.clear();
102
- for (const e of u) s.add(e);
102
+ for (const n of m) s.add(n);
103
103
  }
104
- const y = [], m = new Set(s);
105
- for (; m.size; ) {
106
- let e = null, r = Number.POSITIVE_INFINITY;
107
- for (const c of [...m].sort()) {
108
- const g = (f.get(c) ?? []).filter((S) => s.has(S.parent_field));
109
- if (g.filter(
110
- (S) => S.show_all_if_no_parent === !1 && !y.includes(S.parent_field)
104
+ const y = [], w = new Set(s);
105
+ for (; w.size; ) {
106
+ let n = null, r = Number.POSITIVE_INFINITY;
107
+ for (const S of [...w].sort()) {
108
+ const k = (c.get(S) ?? []).filter((g) => s.has(g.parent_field));
109
+ if (k.filter(
110
+ (g) => g.show_all_if_no_parent === !1 && !y.includes(g.parent_field)
111
111
  ).length > 0) continue;
112
- const A = new Set(
113
- g.map((S) => S.parent_field).filter((S) => !y.includes(S) && S !== c)
114
- ).size * 100 + g.length;
115
- A < r && (r = A, e = c);
112
+ const h = new Set(
113
+ k.map((g) => g.parent_field).filter((g) => !y.includes(g) && g !== S)
114
+ ).size * 100 + k.length;
115
+ h < r && (r = h, n = S);
116
116
  }
117
- e == null && (e = [...m].sort(
118
- (c, g) => {
119
- var k, v;
120
- return (((k = f.get(c)) == null ? void 0 : k.length) ?? 0) - (((v = f.get(g)) == null ? void 0 : v.length) ?? 0);
117
+ n == null && (n = [...w].sort(
118
+ (S, k) => {
119
+ var d, p;
120
+ return (((d = c.get(S)) == null ? void 0 : d.length) ?? 0) - (((p = c.get(k)) == null ? void 0 : p.length) ?? 0);
121
121
  }
122
- )[0]), y.push(e), m.delete(e);
122
+ )[0]), y.push(n), w.delete(n);
123
123
  }
124
124
  return y;
125
125
  }
126
- function W({
127
- cascadeRules: t,
128
- cascadeFilter: n,
126
+ function j(e) {
127
+ if (e == null || e === "") return null;
128
+ if (Array.isArray(e)) return e.map((t) => j(t) ?? "").join(",");
129
+ if (typeof e == "object") {
130
+ const t = e.id;
131
+ return t == null ? JSON.stringify(e) : String(t);
132
+ }
133
+ return String(e);
134
+ }
135
+ function B({
136
+ cascadeRules: e,
137
+ cascadeFilter: t,
129
138
  currentValue: i,
130
139
  relatedCollection: l,
131
- missingRequiredParents: f,
140
+ missingRequiredParents: c,
132
141
  onClear: s
133
142
  }) {
134
- const d = N(), h = JSON.stringify(n), o = b(void 0), a = b(s);
135
- a.current = s, w(() => {
136
- const e = o.current;
137
- o.current = h, e !== void 0 && e !== h && t.some((r) => r.clear_on_parent_change) && a.current();
138
- }, [h, t]);
139
- const p = b(null), _ = P(), u = _ == null ? void 0 : _.dirtyFields, y = (f ?? []).join(","), m = b(null);
140
- return w(() => {
143
+ const u = I(), b = JSON.stringify(t), o = O(void 0), a = O(s);
144
+ a.current = s;
145
+ const _ = J(), f = _ == null ? void 0 : _.dirtyFields, m = e.filter((d) => d.clear_on_parent_change).map((d) => d.parent_field), y = _ ? JSON.stringify(m.map((d) => {
146
+ var p;
147
+ return j((p = _.draft) == null ? void 0 : p[d]);
148
+ })) : "", w = O(void 0), n = O(!1);
149
+ A(() => {
150
+ const d = w.current;
151
+ if (w.current = y, _ && d !== void 0 && d !== y) {
152
+ const h = JSON.parse(d), g = JSON.parse(y);
153
+ m.some((v, N) => h[N] !== g[N] && (!f || f.has(v))) && (n.current = !0);
154
+ }
155
+ const p = o.current;
156
+ if (o.current = b, p !== void 0 && p !== b && m.length !== 0) {
157
+ if (_) {
158
+ if (!n.current) return;
159
+ n.current = !1;
160
+ }
161
+ a.current();
162
+ }
163
+ }, [b, y, e, f]);
164
+ const r = O(null), S = (c ?? []).join(","), k = O(null);
165
+ return A(() => {
141
166
  if (i == null || i === "") return;
142
- const e = (f ?? []).filter(
143
- (c) => (u == null ? void 0 : u.has(c)) && t.some((g) => g.parent_field === c && g.clear_on_unavailable)
167
+ const d = (c ?? []).filter(
168
+ (h) => (f == null ? void 0 : f.has(h)) && e.some((g) => g.parent_field === h && g.clear_on_unavailable)
144
169
  );
145
- if (e.length === 0) return;
146
- const r = `${String(i)}|${e.join(",")}`;
147
- m.current !== r && (m.current = r, a.current());
148
- }, [y, i, u, t]), w(() => {
149
- if (!n || Object.keys(n).length === 0 || !t.some((c) => c.clear_on_unavailable) || i == null || !l || !t.some(
150
- (c) => c.clear_on_unavailable && (u == null ? void 0 : u.has(c.parent_field))
170
+ if (d.length === 0) return;
171
+ const p = `${String(i)}|${d.join(",")}`;
172
+ k.current !== p && (k.current = p, a.current());
173
+ }, [S, i, f, e]), A(() => {
174
+ if (!t || Object.keys(t).length === 0 || !e.some((h) => h.clear_on_unavailable) || i == null || !l || !e.some(
175
+ (h) => h.clear_on_unavailable && (f == null ? void 0 : f.has(h.parent_field))
151
176
  )) return;
152
- const r = `${l}|${String(i)}|${h}`;
153
- p.current !== r && (p.current = r, d.request(
154
- j(`/items/${l}`, {
155
- filter: JSON.stringify({ ...n, id: { _eq: i } }),
177
+ const p = `${l}|${String(i)}|${b}`;
178
+ r.current !== p && (r.current = p, u.request(
179
+ q(`/items/${l}`, {
180
+ filter: JSON.stringify({ ...t, id: { _eq: i } }),
156
181
  limit: 1,
157
182
  fields: "id"
158
183
  })
159
- ).then((c) => {
160
- (c.data ?? []).length === 0 && a.current();
184
+ ).then((h) => {
185
+ (h.data ?? []).length === 0 && a.current();
161
186
  }).catch(() => {
162
- p.current === r && (p.current = null);
187
+ r.current === p && (r.current = null);
163
188
  }));
164
189
  }, [
165
- n,
166
- h,
167
190
  t,
168
- d,
191
+ b,
192
+ e,
193
+ u,
169
194
  i,
170
195
  l,
171
- u
196
+ f
172
197
  ]), null;
173
198
  }
174
- function B(t) {
175
- const [n, i] = E(9999);
176
- return w(() => {
177
- const l = t.current;
199
+ function U(e) {
200
+ const [t, i] = E(9999);
201
+ return A(() => {
202
+ const l = e.current;
178
203
  if (!l) return;
179
204
  i(l.getBoundingClientRect().width);
180
- const f = new ResizeObserver(([s]) => {
205
+ const c = new ResizeObserver(([s]) => {
181
206
  i(s.contentRect.width);
182
207
  });
183
- return f.observe(l), () => f.disconnect();
184
- }, [t]), n;
208
+ return c.observe(l), () => c.disconnect();
209
+ }, [e]), t;
185
210
  }
186
- function K(t, n) {
187
- const i = T(t), l = (i == null ? void 0 : i.col_span) ?? 0, f = [3, 4, 6, 12].includes(l) ? l : 12;
188
- return n < 480 ? 12 : n < 800 ? f <= 6 ? 6 : 12 : f;
211
+ function Y(e, t) {
212
+ const i = T(e), l = (i == null ? void 0 : i.col_span) ?? 0, c = [3, 4, 6, 12].includes(l) ? l : 12;
213
+ return t < 480 ? 12 : t < 800 ? c <= 6 ? 6 : 12 : c;
189
214
  }
190
- function R(t) {
191
- if (!t) return "";
215
+ function F(e) {
216
+ if (!e) return "";
192
217
  try {
193
- return new Date(String(t)).toISOString().slice(0, 16);
218
+ return new Date(String(e)).toISOString().slice(0, 16);
194
219
  } catch {
195
220
  return "";
196
221
  }
197
222
  }
198
- const U = /* @__PURE__ */ new Set([
223
+ const Q = /* @__PURE__ */ new Set([
199
224
  "id",
200
225
  "date_created",
201
226
  "date_updated",
202
227
  "user_created",
203
228
  "user_updated"
204
- ]), D = /* @__PURE__ */ new Set([
229
+ ]), $ = /* @__PURE__ */ new Set([
205
230
  "__pipeline__",
206
231
  "__comments__",
207
232
  "__tasks__",
@@ -211,44 +236,45 @@ const U = /* @__PURE__ */ new Set([
211
236
  "__owners__",
212
237
  "__pdf__",
213
238
  "__subtitle__"
214
- ]), Y = (t) => D.has(t) || t.startsWith("__widget_") && t.endsWith("__"), F = { created: [], updated: [], deleted: [] };
215
- function Q(t) {
216
- if (typeof t != "string") return null;
217
- const n = t.trim();
218
- if (!n) return null;
219
- if (n.startsWith("{") && /"blocks"\s*:/.test(n))
239
+ ]), G = (e) => $.has(e) || e.startsWith("__widget_") && e.endsWith("__"), H = { created: [], updated: [], deleted: [] };
240
+ function V(e) {
241
+ if (typeof e != "string") return null;
242
+ const t = e.trim();
243
+ if (!t) return null;
244
+ if (t.startsWith("{") && /"blocks"\s*:/.test(t))
220
245
  try {
221
- const i = JSON.parse(n);
246
+ const i = JSON.parse(t);
222
247
  if (Array.isArray(i.blocks)) {
223
248
  const l = [];
224
- for (const f of i.blocks) {
225
- const s = f.data ?? {};
249
+ for (const c of i.blocks) {
250
+ const s = c.data ?? {};
226
251
  typeof s.text == "string" ? l.push(s.text) : Array.isArray(s.items) && l.push(
227
252
  s.items.map(
228
- (d) => typeof d == "string" ? d : String((d == null ? void 0 : d.content) ?? "")
253
+ (u) => typeof u == "string" ? u : String((u == null ? void 0 : u.content) ?? "")
229
254
  ).filter(Boolean).join(" · ")
230
255
  );
231
256
  }
232
- return O(l.join(" ")).trim();
257
+ return P(l.join(" ")).trim();
233
258
  }
234
259
  } catch {
235
260
  }
236
- return /<[a-z][\s\S]*>/i.test(n) ? O(n).trim() : null;
261
+ return /<[a-z][\s\S]*>/i.test(t) ? P(t).trim() : null;
237
262
  }
238
- const O = I;
263
+ const P = C;
239
264
  export {
240
- W as CascadeEffectController,
241
- F as EMPTY_NESTED_OPS,
242
- D as SENTINEL_FIELDS,
243
- U as SYSTEM_FIELDS,
244
- L as applyDisplayTemplate,
245
- M as buildCascadeFilter,
246
- q as getCascadeFilters,
247
- Y as isSentinelKey,
265
+ B as CascadeEffectController,
266
+ H as EMPTY_NESTED_OPS,
267
+ $ as SENTINEL_FIELDS,
268
+ Q as SYSTEM_FIELDS,
269
+ z as applyDisplayTemplate,
270
+ K as buildCascadeFilter,
271
+ j as cascadeParentKey,
272
+ D as getCascadeFilters,
273
+ G as isSentinelKey,
248
274
  T as parseJson,
249
- K as resolveColSpan,
250
- Q as richTextToPlain,
251
- z as seedQuickPickerSteps,
252
- R as toLocalDatetime,
253
- B as useContainerWidth
275
+ Y as resolveColSpan,
276
+ V as richTextToPlain,
277
+ W as seedQuickPickerSteps,
278
+ F as toLocalDatetime,
279
+ U as useContainerWidth
254
280
  };