@declarion/react 0.87.0 → 0.89.0

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 (90) hide show
  1. package/dist-lib/app.js +28 -28
  2. package/dist-lib/components/actions/ActionButton.js +86 -85
  3. package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
  4. package/dist-lib/components/actions/ActionRunner.js +47 -47
  5. package/dist-lib/components/actions/ObjectActionBar.js +9 -9
  6. package/dist-lib/components/actions/RowActionsKebab.js +19 -19
  7. package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
  8. package/dist-lib/components/chrome/AssociationTabs.js +21 -21
  9. package/dist-lib/components/chrome/RecordHeader.js +33 -40
  10. package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
  11. package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
  13. package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
  14. package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
  15. package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
  16. package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
  17. package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
  18. package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
  19. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
  20. package/dist-lib/components/fields/FileReferenceField.js +9 -9
  21. package/dist-lib/components/fields/StructureField.js +57 -47
  22. package/dist-lib/components/fields/TimestampField.js +59 -54
  23. package/dist-lib/components/fields/cells/factories/money.js +14 -23
  24. package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
  25. package/dist-lib/components/fields/cells/factories/text.js +18 -3
  26. package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
  27. package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
  28. package/dist-lib/components/layout/Layout.js +306 -361
  29. package/dist-lib/components/layout/Rail.js +42 -41
  30. package/dist-lib/components/layout/Sidebar.js +132 -117
  31. package/dist-lib/components/layout/TabStrip.js +116 -115
  32. package/dist-lib/components/layout/TenantChip.js +47 -54
  33. package/dist-lib/components/layout/TopBar.js +108 -105
  34. package/dist-lib/components/list/InlineEditCell.js +23 -23
  35. package/dist-lib/components/list/QuickPeek.js +65 -66
  36. package/dist-lib/components/pages/DocumentsMenu.js +42 -42
  37. package/dist-lib/components/pages/ExportMenu.js +25 -25
  38. package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
  39. package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
  40. package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
  41. package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
  42. package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
  43. package/dist-lib/components/pages/auth/AuthShell.js +73 -73
  44. package/dist-lib/components/pages/auth/SignIn.js +32 -32
  45. package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
  46. package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
  47. package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
  48. package/dist-lib/components/pages/list/ListHeader.js +19 -19
  49. package/dist-lib/components/pages/list/ListNoRows.js +15 -15
  50. package/dist-lib/components/pages/list/ListToolbar.js +145 -145
  51. package/dist-lib/components/pages/list/useActiveView.js +14 -5
  52. package/dist-lib/components/pages/list/useListQuery.js +121 -81
  53. package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
  54. package/dist-lib/components/pages/list/useRowMenu.js +7 -7
  55. package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
  56. package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
  57. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
  58. package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
  59. package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
  60. package/dist-lib/hooks/useAuth.js +11 -11
  61. package/dist-lib/hooks/useBranding.js +4 -4
  62. package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
  63. package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
  64. package/dist-lib/hooks/useImpersonation.js +6 -6
  65. package/dist-lib/hooks/useMutations.js +23 -23
  66. package/dist-lib/hooks/useObjectStatus.js +5 -5
  67. package/dist-lib/hooks/useParams.js +59 -51
  68. package/dist-lib/hooks/useProperties.js +8 -8
  69. package/dist-lib/hooks/useRowTenant.js +18 -6
  70. package/dist-lib/hooks/useText.js +9 -7
  71. package/dist-lib/hooks/useUiPreferences.js +71 -0
  72. package/dist-lib/index.d.ts +22 -6
  73. package/dist-lib/index.js +127 -126
  74. package/dist-lib/lib/actions.js +116 -84
  75. package/dist-lib/lib/child-config.js +10 -1
  76. package/dist-lib/lib/format-count.js +16 -1
  77. package/dist-lib/lib/language.js +23 -21
  78. package/dist-lib/lib/money-text.js +29 -0
  79. package/dist-lib/lib/profile.js +4 -0
  80. package/dist-lib/lib/role-label.js +8 -0
  81. package/dist-lib/lib/schema-routing.js +34 -14
  82. package/dist-lib/lib/shortcut.js +10 -0
  83. package/dist-lib/lib/timestamp.js +93 -31
  84. package/dist-lib/stores/auth.js +9 -8
  85. package/dist-lib/stores/preferences.js +56 -17
  86. package/dist-lib/testing.d.ts +1 -1
  87. package/dist-lib/testing.js +25 -28
  88. package/dist-lib/types/schema.js +33 -27
  89. package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
  90. package/package.json +1 -1
@@ -1,80 +1,80 @@
1
1
  import { coerceDisplayString as e } from "../../lib/display-value.js";
2
- import { fieldDisplayName as t } from "../../types/schema.js";
3
- import { Icon as n } from "../primitives/Icons.js";
4
- import { Btn as r } from "../primitives/Btn.js";
5
- import { IconBtn as i } from "../primitives/IconBtn.js";
6
- import { useText as a } from "../../hooks/useText.js";
7
- import { useResponsiveMode as o } from "../../hooks/useResponsiveMode.js";
8
- import { renderField as s } from "../fields/index.js";
9
- import { dataTableHeadCellStyle as c, dataTableStyle as l } from "../primitives/dataTableStyles.js";
10
- import { useCallback as u, useRef as d } from "react";
11
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
2
+ import { fieldDisplayName as t, isUserEditableField as n } from "../../types/schema.js";
3
+ import { Icon as r } from "../primitives/Icons.js";
4
+ import { Btn as i } from "../primitives/Btn.js";
5
+ import { IconBtn as a } from "../primitives/IconBtn.js";
6
+ import { useText as o } from "../../hooks/useText.js";
7
+ import { useResponsiveMode as s } from "../../hooks/useResponsiveMode.js";
8
+ import { renderField as c } from "../fields/index.js";
9
+ import { dataTableHeadCellStyle as l, dataTableStyle as u } from "../primitives/dataTableStyles.js";
10
+ import { useCallback as d, useRef as f } from "react";
11
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
12
12
  //#region src/components/detail-layout/EditableChildrenTable.tsx
13
- function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validationErrors: b, refs: x, forceTablePresentation: S = !1 }) {
14
- let C = a(), w = o(), T = d(null), E = h.columns, D = h.position_field, O = new Set(Array.isArray(h.foreign_key) ? h.foreign_key : [h.foreign_key]), k = E.filter((e) => {
15
- if (O.has(e) || h.position_field && e === h.position_field) return !1;
16
- let t = g.fields.get(e);
17
- return !(!t || t.auto || t.primary || t.source);
18
- }), A = new Set(E.filter((e) => {
19
- if (h.position_field && e === h.position_field) return !0;
20
- let t = g.fields.get(e);
21
- return t && (t.auto || t.primary || t.source);
22
- })), j = u((e, t, n) => {
23
- y(v.map((r) => r._key === e ? {
13
+ function g({ config: g, childEntity: _, schema: v, rows: y, onChange: b, validationErrors: x, refs: S, forceTablePresentation: C = !1 }) {
14
+ let w = o(), T = s(), E = f(null), D = g.columns, O = g.position_field, k = new Set(Array.isArray(g.foreign_key) ? g.foreign_key : [g.foreign_key]), A = D.filter((e) => {
15
+ if (k.has(e) || g.position_field && e === g.position_field) return !1;
16
+ let t = _.fields.get(e);
17
+ return !(!t || !n(t));
18
+ }), j = new Set(D.filter((e) => {
19
+ if (g.position_field && e === g.position_field) return !0;
20
+ let t = _.fields.get(e);
21
+ return t && !n(t);
22
+ })), M = d((e, t, n) => {
23
+ b(y.map((r) => r._key === e ? {
24
24
  ...r,
25
25
  [t]: n,
26
26
  _dirty: !0
27
27
  } : r));
28
- }, [v, y]), M = u(() => {
28
+ }, [y, b]), N = d(() => {
29
29
  let e = {
30
30
  _key: crypto.randomUUID(),
31
31
  _dirty: !0
32
32
  };
33
- if (D) {
34
- let t = v.filter((e) => !e._deleted).reduce((e, t) => {
35
- let n = typeof t[D] == "number" ? t[D] : -1;
33
+ if (O) {
34
+ let t = y.filter((e) => !e._deleted).reduce((e, t) => {
35
+ let n = typeof t[O] == "number" ? t[O] : -1;
36
36
  return Math.max(e, n);
37
37
  }, -1);
38
- e[D] = t + 1;
38
+ e[O] = t + 1;
39
39
  }
40
- let t = h.quick_add?.defaults ?? {};
41
- for (let n of k) {
42
- let r = g.fields.get(n);
40
+ let t = g.quick_add?.defaults ?? {};
41
+ for (let n of A) {
42
+ let r = _.fields.get(n);
43
43
  r && (t[n] === void 0 ? r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default : e[n] = t[n]);
44
44
  }
45
- y([...v, e]);
45
+ b([...y, e]);
46
46
  }, [
47
- v,
48
47
  y,
49
- k,
50
- g,
51
- h.quick_add?.defaults,
52
- D
53
- ]), N = u((e) => {
54
- y(v.map((t) => t._key === e ? {
48
+ b,
49
+ A,
50
+ _,
51
+ g.quick_add?.defaults,
52
+ O
53
+ ]), P = d((e) => {
54
+ b(y.map((t) => t._key === e ? {
55
55
  ...t,
56
56
  _deleted: !0
57
57
  } : t));
58
- }, [v, y]), P = u((e) => {
59
- y(v.map((t) => t._key === e ? {
58
+ }, [y, b]), F = d((e) => {
59
+ b(y.map((t) => t._key === e ? {
60
60
  ...t,
61
61
  _deleted: !1
62
62
  } : t));
63
- }, [v, y]), F = u((e, t) => {
64
- if (!D) return;
65
- let n = v.filter((e) => !e._deleted), r = v.filter((e) => e._deleted), i = n.findIndex((t) => t._key === e), a = i + t;
63
+ }, [y, b]), I = d((e, t) => {
64
+ if (!O) return;
65
+ let n = y.filter((e) => !e._deleted), r = y.filter((e) => e._deleted), i = n.findIndex((t) => t._key === e), a = i + t;
66
66
  if (i < 0 || a < 0 || a >= n.length) return;
67
67
  let o = [...n], [s] = o.splice(i, 1);
68
- o.splice(a, 0, s), y([...o.map((e, t) => ({
68
+ o.splice(a, 0, s), b([...o.map((e, t) => ({
69
69
  ...e,
70
- [D]: t,
71
- _dirty: e[D] !== t || e._dirty
70
+ [O]: t,
71
+ _dirty: e[O] !== t || e._dirty
72
72
  })), ...r]);
73
73
  }, [
74
- v,
75
74
  y,
76
- D
77
- ]), I = u((e) => {
75
+ b,
76
+ O
77
+ ]), L = d((e) => {
78
78
  let t = e.target, n = t.closest("td");
79
79
  if (!n) return;
80
80
  let r = n.closest("tr");
@@ -98,7 +98,7 @@ function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validat
98
98
  if (o < t.length - 1) {
99
99
  let e = t[o + 1].cells[a]?.querySelector("input, select, textarea, [tabindex]");
100
100
  e && e.focus();
101
- } else M(), requestAnimationFrame(() => {
101
+ } else N(), requestAnimationFrame(() => {
102
102
  let e = i.querySelectorAll("tr"), t = e[e.length - 1];
103
103
  if (t) {
104
104
  let e = t.querySelector("input, select, textarea, [tabindex]");
@@ -106,16 +106,16 @@ function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validat
106
106
  }
107
107
  });
108
108
  } else e.key === "Escape" && t.blur?.();
109
- }, [M]), L = c;
110
- return w.isPhone && !S ? /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
109
+ }, [N]), R = l;
110
+ return T.isPhone && !C ? /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
111
111
  style: {
112
112
  display: "flex",
113
113
  flexDirection: "column",
114
114
  gap: 10
115
115
  },
116
- children: v.map((r, a) => {
117
- let o = !!r._deleted, c = b?.[r._key], l = D ? v.filter((e) => !e._deleted) : [], u = D ? l.findIndex((e) => e._key === r._key) : -1;
118
- return /* @__PURE__ */ m("div", {
116
+ children: y.map((n, i) => {
117
+ let o = !!n._deleted, s = x?.[n._key], l = O ? y.filter((e) => !e._deleted) : [], u = O ? l.findIndex((e) => e._key === n._key) : -1;
118
+ return /* @__PURE__ */ h("div", {
119
119
  style: {
120
120
  border: "1px solid var(--border)",
121
121
  borderRadius: "var(--radius-md)",
@@ -123,7 +123,7 @@ function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validat
123
123
  opacity: o ? .58 : 1,
124
124
  overflow: "hidden"
125
125
  },
126
- children: [/* @__PURE__ */ m("div", {
126
+ children: [/* @__PURE__ */ h("div", {
127
127
  style: {
128
128
  minHeight: 38,
129
129
  padding: "8px 10px",
@@ -133,61 +133,61 @@ function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validat
133
133
  justifyContent: "space-between",
134
134
  gap: 8
135
135
  },
136
- children: [/* @__PURE__ */ p("div", {
136
+ children: [/* @__PURE__ */ m("div", {
137
137
  style: {
138
138
  fontSize: 12,
139
139
  fontWeight: 600,
140
140
  color: "var(--text-2)"
141
141
  },
142
- children: C("record.row.number", "Row {number}", { number: a + 1 })
143
- }), /* @__PURE__ */ m("div", {
142
+ children: w("record.row.number", "Row {number}", { number: i + 1 })
143
+ }), /* @__PURE__ */ h("div", {
144
144
  style: {
145
145
  display: "flex",
146
146
  alignItems: "center",
147
147
  gap: 4
148
148
  },
149
- children: [D && !o && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(i, {
149
+ children: [O && !o && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
150
150
  size: 32,
151
- icon: /* @__PURE__ */ p(n.up, { size: 14 }),
152
- onClick: () => F(r._key, -1),
151
+ icon: /* @__PURE__ */ m(r.up, { size: 14 }),
152
+ onClick: () => I(n._key, -1),
153
153
  disabled: u <= 0,
154
- title: C("record.row.move_up", "Move row up")
155
- }), /* @__PURE__ */ p(i, {
154
+ title: w("record.row.move_up", "Move row up")
155
+ }), /* @__PURE__ */ m(a, {
156
156
  size: 32,
157
- icon: /* @__PURE__ */ p(n.down, { size: 14 }),
158
- onClick: () => F(r._key, 1),
157
+ icon: /* @__PURE__ */ m(r.down, { size: 14 }),
158
+ onClick: () => I(n._key, 1),
159
159
  disabled: u === -1 || u >= l.length - 1,
160
- title: C("record.row.move_down", "Move row down")
161
- })] }), o ? /* @__PURE__ */ p(i, {
160
+ title: w("record.row.move_down", "Move row down")
161
+ })] }), o ? /* @__PURE__ */ m(a, {
162
162
  size: 32,
163
- icon: /* @__PURE__ */ p(n.refresh, { size: 14 }),
164
- onClick: () => P(r._key),
165
- title: C("record.row.undo_delete", "Undo delete")
166
- }) : /* @__PURE__ */ p(i, {
163
+ icon: /* @__PURE__ */ m(r.refresh, { size: 14 }),
164
+ onClick: () => F(n._key),
165
+ title: w("record.row.undo_delete", "Undo delete")
166
+ }) : /* @__PURE__ */ m(a, {
167
167
  size: 32,
168
- icon: /* @__PURE__ */ p(n.trash, { size: 14 }),
169
- onClick: () => N(r._key),
170
- title: C("record.row.delete", "Delete row")
168
+ icon: /* @__PURE__ */ m(r.trash, { size: 14 }),
169
+ onClick: () => P(n._key),
170
+ title: w("record.row.delete", "Delete row")
171
171
  })]
172
172
  })]
173
- }), /* @__PURE__ */ p("div", {
173
+ }), /* @__PURE__ */ m("div", {
174
174
  style: {
175
175
  padding: 10,
176
176
  display: "flex",
177
177
  flexDirection: "column",
178
178
  gap: 12
179
179
  },
180
- children: E.map((n) => {
181
- let i = g.fields.get(n), a = c?.includes(n), l = A.has(n), u = i ? t(C, i, n, _.entities) : n, d = `child-${r._key}-${n}`, f = `${d}-label`, h = {
180
+ children: D.map((r) => {
181
+ let i = _.fields.get(r), a = s?.includes(r), l = j.has(r), u = i ? t(w, i, r, v.entities) : r, d = `child-${n._key}-${r}`, f = `${d}-label`, p = {
182
182
  outline: a ? "1px solid var(--danger)" : "none",
183
183
  outlineOffset: 3,
184
184
  borderRadius: a ? "var(--radius-sm)" : 0
185
- }, v = {
185
+ }, g = {
186
186
  fontSize: 11.5,
187
187
  fontWeight: 600,
188
188
  color: "var(--text-3)"
189
189
  }, y = !o && !l && !!i;
190
- return /* @__PURE__ */ m("div", {
190
+ return /* @__PURE__ */ h("div", {
191
191
  style: {
192
192
  display: "flex",
193
193
  flexDirection: "column",
@@ -195,95 +195,95 @@ function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validat
195
195
  minWidth: 0,
196
196
  textDecoration: o ? "line-through" : "none"
197
197
  },
198
- title: a ? C("record.row.field_required", "{field} is required", { field: n }) : void 0,
199
- children: [y ? /* @__PURE__ */ p("label", {
198
+ title: a ? w("record.row.field_required", "{field} is required", { field: r }) : void 0,
199
+ children: [y ? /* @__PURE__ */ m("label", {
200
200
  id: f,
201
201
  htmlFor: d,
202
- style: v,
202
+ style: g,
203
203
  children: u
204
- }) : /* @__PURE__ */ p("div", {
204
+ }) : /* @__PURE__ */ m("div", {
205
205
  id: f,
206
- style: v,
206
+ style: g,
207
207
  children: u
208
- }), /* @__PURE__ */ p("div", {
209
- style: h,
210
- children: o || l ? i ? s({
208
+ }), /* @__PURE__ */ m("div", {
209
+ style: p,
210
+ children: o || l ? i ? c({
211
211
  field: i,
212
- fieldName: n,
213
- value: r[n],
212
+ fieldName: r,
213
+ value: n[r],
214
214
  mode: "display",
215
- record: r,
216
- refs: x,
215
+ record: n,
216
+ refs: S,
217
217
  fieldId: d,
218
218
  labelId: f,
219
- t: C
220
- }) : e(r[n]) : i ? s({
219
+ t: w
220
+ }) : e(n[r]) : i ? c({
221
221
  field: i,
222
- fieldName: n,
223
- value: r[n],
222
+ fieldName: r,
223
+ value: n[r],
224
224
  mode: "edit",
225
- onChange: (e) => j(r._key, n, e),
226
- record: r,
227
- refs: x,
225
+ onChange: (e) => M(n._key, r, e),
226
+ record: n,
227
+ refs: S,
228
228
  compact: !0,
229
229
  fieldId: d,
230
230
  labelId: f,
231
- t: C
232
- }) : e(r[n])
231
+ t: w
232
+ }) : e(n[r])
233
233
  })]
234
- }, n);
234
+ }, r);
235
235
  })
236
236
  })]
237
- }, r._key);
237
+ }, n._key);
238
238
  })
239
- }), /* @__PURE__ */ p("div", {
239
+ }), /* @__PURE__ */ m("div", {
240
240
  style: { marginTop: 10 },
241
- children: /* @__PURE__ */ p(r, {
241
+ children: /* @__PURE__ */ m(i, {
242
242
  kind: "ghost",
243
243
  size: "sm",
244
- icon: /* @__PURE__ */ p(n.plus, { size: 14 }),
245
- onClick: M,
246
- children: C("record.row.add", "Add row")
244
+ icon: /* @__PURE__ */ m(r.plus, { size: 14 }),
245
+ onClick: N,
246
+ children: w("record.row.add", "Add row")
247
247
  })
248
- })] }) : /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("div", {
248
+ })] }) : /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
249
249
  style: { overflowX: "auto" },
250
- children: /* @__PURE__ */ m("table", {
251
- ref: T,
252
- style: l,
253
- onKeyDown: I,
254
- children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [E.map((e) => {
255
- let n = g.fields.get(e);
256
- return /* @__PURE__ */ p("th", {
257
- style: L,
258
- children: n ? t(C, n, e, _.entities) : e
250
+ children: /* @__PURE__ */ h("table", {
251
+ ref: E,
252
+ style: u,
253
+ onKeyDown: L,
254
+ children: [/* @__PURE__ */ m("thead", { children: /* @__PURE__ */ h("tr", { children: [D.map((e) => {
255
+ let n = _.fields.get(e);
256
+ return /* @__PURE__ */ m("th", {
257
+ style: R,
258
+ children: n ? t(w, n, e, v.entities) : e
259
259
  }, e);
260
- }), /* @__PURE__ */ p("th", { style: {
261
- ...L,
260
+ }), /* @__PURE__ */ m("th", { style: {
261
+ ...R,
262
262
  width: 40
263
- } })] }) }), /* @__PURE__ */ p("tbody", { children: v.map((t) => {
264
- let r = !!t._deleted, a = b?.[t._key];
265
- return /* @__PURE__ */ m("tr", {
266
- style: { opacity: r ? .5 : 1 },
267
- children: [E.map((n) => {
268
- let i = g.fields.get(n), o = a?.includes(n), c = A.has(n);
269
- return r || c ? /* @__PURE__ */ p("td", {
263
+ } })] }) }), /* @__PURE__ */ m("tbody", { children: y.map((t) => {
264
+ let n = !!t._deleted, i = x?.[t._key];
265
+ return /* @__PURE__ */ h("tr", {
266
+ style: { opacity: n ? .5 : 1 },
267
+ children: [D.map((r) => {
268
+ let a = _.fields.get(r), o = i?.includes(r), s = j.has(r);
269
+ return n || s ? /* @__PURE__ */ m("td", {
270
270
  style: {
271
271
  padding: "6px 12px",
272
272
  borderBottom: "1px solid var(--divider)",
273
273
  verticalAlign: "middle",
274
- textDecoration: r ? "line-through" : "none",
274
+ textDecoration: n ? "line-through" : "none",
275
275
  color: "var(--text-2)"
276
276
  },
277
- children: i ? s({
278
- field: i,
279
- fieldName: n,
280
- value: t[n],
277
+ children: a ? c({
278
+ field: a,
279
+ fieldName: r,
280
+ value: t[r],
281
281
  mode: "display",
282
282
  record: t,
283
- refs: x,
284
- t: C
285
- }) : e(t[n])
286
- }, n) : /* @__PURE__ */ p("td", {
283
+ refs: S,
284
+ t: w
285
+ }) : e(t[r])
286
+ }, r) : /* @__PURE__ */ m("td", {
287
287
  style: {
288
288
  padding: "4px 4px",
289
289
  borderBottom: "1px solid var(--divider)",
@@ -292,50 +292,50 @@ function h({ config: h, childEntity: g, schema: _, rows: v, onChange: y, validat
292
292
  outlineOffset: -1,
293
293
  borderRadius: o ? "var(--radius-sm)" : 0
294
294
  },
295
- title: o ? C("record.row.field_required", "{field} is required", { field: n }) : void 0,
296
- children: i ? s({
297
- field: i,
298
- fieldName: n,
299
- value: t[n],
295
+ title: o ? w("record.row.field_required", "{field} is required", { field: r }) : void 0,
296
+ children: a ? c({
297
+ field: a,
298
+ fieldName: r,
299
+ value: t[r],
300
300
  mode: "edit",
301
- onChange: (e) => j(t._key, n, e),
301
+ onChange: (e) => M(t._key, r, e),
302
302
  record: t,
303
- refs: x,
303
+ refs: S,
304
304
  compact: !0,
305
- t: C
306
- }) : e(t[n])
307
- }, n);
308
- }), /* @__PURE__ */ p("td", {
305
+ t: w
306
+ }) : e(t[r])
307
+ }, r);
308
+ }), /* @__PURE__ */ m("td", {
309
309
  style: {
310
310
  padding: "4px 8px",
311
311
  borderBottom: "1px solid var(--divider)",
312
312
  verticalAlign: "middle"
313
313
  },
314
- children: r ? /* @__PURE__ */ p(i, {
314
+ children: n ? /* @__PURE__ */ m(a, {
315
315
  size: 24,
316
- icon: /* @__PURE__ */ p(n.refresh, { size: 12 }),
317
- onClick: () => P(t._key),
318
- title: C("record.row.undo_delete", "Undo delete")
319
- }) : /* @__PURE__ */ p(i, {
316
+ icon: /* @__PURE__ */ m(r.refresh, { size: 12 }),
317
+ onClick: () => F(t._key),
318
+ title: w("record.row.undo_delete", "Undo delete")
319
+ }) : /* @__PURE__ */ m(a, {
320
320
  size: 24,
321
- icon: /* @__PURE__ */ p(n.trash, { size: 12 }),
322
- onClick: () => N(t._key),
323
- title: C("record.row.delete", "Delete row")
321
+ icon: /* @__PURE__ */ m(r.trash, { size: 12 }),
322
+ onClick: () => P(t._key),
323
+ title: w("record.row.delete", "Delete row")
324
324
  })
325
325
  })]
326
326
  }, t._key);
327
327
  }) })]
328
328
  })
329
- }), /* @__PURE__ */ p("div", {
329
+ }), /* @__PURE__ */ m("div", {
330
330
  style: { marginTop: 8 },
331
- children: /* @__PURE__ */ p(r, {
331
+ children: /* @__PURE__ */ m(i, {
332
332
  kind: "ghost",
333
333
  size: "xs",
334
- icon: /* @__PURE__ */ p(n.plus, { size: 12 }),
335
- onClick: M,
336
- children: C("record.row.add", "Add row")
334
+ icon: /* @__PURE__ */ m(r.plus, { size: 12 }),
335
+ onClick: N,
336
+ children: w("record.row.add", "Add row")
337
337
  })
338
338
  })] });
339
339
  }
340
340
  //#endregion
341
- export { h as EditableChildrenTable };
341
+ export { g as EditableChildrenTable };
@@ -1,22 +1,21 @@
1
- import { Pill as e } from "../primitives/Pill.js";
2
- import { useText as t } from "../../hooks/useText.js";
3
- import { verdictLabel as n, verdictTone as r } from "../../lib/evidence-verdict.js";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { formatOffsetTimestamp as e } from "../../lib/timestamp.js";
2
+ import { Pill as t } from "../primitives/Pill.js";
3
+ import { useText as n } from "../../hooks/useText.js";
4
+ import { verdictLabel as r, verdictTone as i } from "../../lib/evidence-verdict.js";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
6
  //#region src/components/detail-layout/EvidenceBlock.tsx
6
- function o(e, t) {
7
- if (!e) return;
8
- let n = new Date(e);
9
- if (!Number.isNaN(n.getTime())) return n.toLocaleString(t);
7
+ function s(t, n) {
8
+ if (t && !Number.isNaN(new Date(t).getTime())) return e(t, { zone: n });
10
9
  }
11
- function s({ evidence: s }) {
12
- let c = t(), l = s?.verdict ?? "unverified", u = o(s?.verified_at, c.language), d = [];
13
- return s?.seq && d.push(c("record.evidence.chain", "chain #{seq}", { seq: s.seq })), s?.generation && d.push(c("record.evidence.generation", "generation {number}", { number: s.generation })), /* @__PURE__ */ a("div", {
10
+ function c({ evidence: e }) {
11
+ let c = n(), l = e?.verdict ?? "unverified", u = s(e?.verified_at, c.timeZone), d = [];
12
+ return e?.seq && d.push(c("record.evidence.chain", "chain #{seq}", { seq: e.seq })), e?.generation && d.push(c("record.evidence.generation", "generation {number}", { number: e.generation })), /* @__PURE__ */ o("div", {
14
13
  style: {
15
14
  display: "flex",
16
15
  flexDirection: "column",
17
16
  gap: 6
18
17
  },
19
- children: [/* @__PURE__ */ a("div", {
18
+ children: [/* @__PURE__ */ o("div", {
20
19
  style: {
21
20
  display: "flex",
22
21
  alignItems: "center",
@@ -24,7 +23,7 @@ function s({ evidence: s }) {
24
23
  flexWrap: "wrap"
25
24
  },
26
25
  children: [
27
- /* @__PURE__ */ i("span", {
26
+ /* @__PURE__ */ a("span", {
28
27
  style: {
29
28
  fontSize: 12,
30
29
  fontWeight: 600,
@@ -32,20 +31,20 @@ function s({ evidence: s }) {
32
31
  },
33
32
  children: c("record.evidence.title", "Evidence")
34
33
  }),
35
- d.length > 0 && /* @__PURE__ */ i("span", {
34
+ d.length > 0 && /* @__PURE__ */ a("span", {
36
35
  style: {
37
36
  fontSize: 12,
38
37
  color: "var(--muted-foreground)"
39
38
  },
40
39
  children: d.join(" · ")
41
40
  }),
42
- /* @__PURE__ */ i(e, {
43
- tone: r(l),
41
+ /* @__PURE__ */ a(t, {
42
+ tone: i(l),
44
43
  size: "sm",
45
44
  dot: !0,
46
- children: n(c, l)
45
+ children: r(c, l)
47
46
  }),
48
- u && /* @__PURE__ */ i("span", {
47
+ u && /* @__PURE__ */ a("span", {
49
48
  style: {
50
49
  fontSize: 12,
51
50
  color: "var(--muted-foreground)"
@@ -53,14 +52,14 @@ function s({ evidence: s }) {
53
52
  children: c("record.evidence.verified", "Verified {when}", { when: u })
54
53
  })
55
54
  ]
56
- }), s?.reason && /* @__PURE__ */ i("span", {
55
+ }), e?.reason && /* @__PURE__ */ a("span", {
57
56
  style: {
58
57
  fontSize: 12,
59
58
  color: "var(--destructive)"
60
59
  },
61
- children: s.reason
60
+ children: e.reason
62
61
  })]
63
62
  });
64
63
  }
65
64
  //#endregion
66
- export { s as EvidenceBlock };
65
+ export { c as EvidenceBlock };