@declarion/react 0.54.0 → 0.56.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 (175) hide show
  1. package/dist-lib/{DraggableChildrenTable-CPoUY99R.js → DraggableChildrenTable-BV5sb8Uo.js} +32 -32
  2. package/dist-lib/{Grid--QAEby8k.js → Grid-DWgUPuZ3.js} +45 -45
  3. package/dist-lib/{JsonEditor-DoNmyrYd.js → JsonEditor-Dz1PQHC8.js} +2 -2
  4. package/dist-lib/{LayoutRenderer-BxZ7Nd9b.js → LayoutRenderer-C9AH9cXf.js} +716 -714
  5. package/dist-lib/{ListCardsBody-BPV4GPrv.js → ListCardsBody-DXcDg536.js} +29 -29
  6. package/dist-lib/{MarkdownRenderer-CIKuh_0i.js → MarkdownRenderer-CcSFc2N3.js} +1 -1
  7. package/dist-lib/{RefreshControl-DMLkZP3R.js → RefreshControl-CNtN8zSl.js} +41 -41
  8. package/dist-lib/{SmartDetailPage.impl-SnNu6Ug-.js → SmartDetailPage.impl-lskCd-WG.js} +492 -492
  9. package/dist-lib/{SmartListPage.impl-C73pR7Iw.js → SmartListPage.impl-CrGbdzyK.js} +744 -743
  10. package/dist-lib/{SmartRecordListPage.impl-rJjQZe1V.js → SmartRecordListPage.impl-Bkl9aZJ8.js} +129 -129
  11. package/dist-lib/{SortHeaderMenu-DQ_KrkWk.js → SortHeaderMenu-SYSAaqQJ.js} +1 -1
  12. package/dist-lib/{action-dispatch-DsuUS7ae.js → action-dispatch-CR4ajBtT.js} +179 -179
  13. package/dist-lib/api/auth.d.ts +1 -1
  14. package/dist-lib/api/batch.d.ts +1 -1
  15. package/dist-lib/api/data.d.ts +3 -3
  16. package/dist-lib/api/entities.d.ts +1 -1
  17. package/dist-lib/api/events.d.ts +13 -4
  18. package/dist-lib/api/params.d.ts +1 -1
  19. package/dist-lib/api/properties.d.ts +1 -1
  20. package/dist-lib/api/schema.d.ts +1 -1
  21. package/dist-lib/api/status.d.ts +1 -1
  22. package/dist-lib/{cardProjection-BadzqyeQ.js → cardProjection-CW5RIMko.js} +24 -24
  23. package/dist-lib/components/actions/ActionButton.d.ts +1 -1
  24. package/dist-lib/components/actions/ActionDialog.d.ts +1 -1
  25. package/dist-lib/components/actions/ActionRunner.d.ts +1 -1
  26. package/dist-lib/components/actions/ObjectActionBar.d.ts +3 -3
  27. package/dist-lib/components/actions/PropertyGridEditor.d.ts +2 -2
  28. package/dist-lib/components/actions/ResponsiveActionBar.d.ts +2 -2
  29. package/dist-lib/components/actions/RowActionsKebab.d.ts +1 -1
  30. package/dist-lib/components/agents/AgentConversationDrawer.d.ts +1 -1
  31. package/dist-lib/components/agents/AgentPicker.d.ts +1 -1
  32. package/dist-lib/components/agents/transcript-runs.d.ts +1 -1
  33. package/dist-lib/components/chrome/AssociationTabs.d.ts +1 -1
  34. package/dist-lib/components/chrome/Breadcrumbs.d.ts +1 -1
  35. package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +1 -1
  36. package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +1 -1
  37. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +2 -2
  38. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +2 -2
  39. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +3 -3
  40. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +3 -3
  41. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +3 -3
  42. package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +1 -1
  43. package/dist-lib/components/detail-layout/FieldsBlock.d.ts +1 -1
  44. package/dist-lib/components/detail-layout/LayoutColumn.d.ts +1 -1
  45. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +3 -3
  46. package/dist-lib/components/detail-layout/LayoutRow.d.ts +1 -1
  47. package/dist-lib/components/detail-layout/LayoutTabs.d.ts +1 -1
  48. package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +1 -1
  49. package/dist-lib/components/detail-layout/QuickAddForm.d.ts +2 -2
  50. package/dist-lib/components/detail-layout/SectionBlock.d.ts +1 -1
  51. package/dist-lib/components/detail-layout/StatusesBlock.d.ts +1 -1
  52. package/dist-lib/components/detail-layout/TimelineComposer.d.ts +2 -2
  53. package/dist-lib/components/detail-layout/blockMeta.d.ts +1 -1
  54. package/dist-lib/components/detail-layout/useQuickAdd.d.ts +2 -2
  55. package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +1 -1
  56. package/dist-lib/components/fields/RefCombobox.d.ts +2 -2
  57. package/dist-lib/components/fields/cells/factories/host-icons.d.ts +1 -1
  58. package/dist-lib/components/fields/cells/registry.d.ts +2 -2
  59. package/dist-lib/components/fields/index.d.ts +3 -3
  60. package/dist-lib/components/file-widgets/helpers.d.ts +1 -1
  61. package/dist-lib/components/file-widgets/host.d.ts +3 -3
  62. package/dist-lib/components/file-widgets/payload.d.ts +2 -2
  63. package/dist-lib/components/file-widgets/types.d.ts +1 -1
  64. package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +1 -1
  65. package/dist-lib/components/filters/FilterChips.d.ts +1 -1
  66. package/dist-lib/components/filters/FilterDrawer.d.ts +3 -3
  67. package/dist-lib/components/layout/CommandPalette.d.ts +2 -2
  68. package/dist-lib/components/layout/Layout.d.ts +3 -3
  69. package/dist-lib/components/layout/Rail.d.ts +2 -2
  70. package/dist-lib/components/layout/Sidebar.d.ts +1 -1
  71. package/dist-lib/components/layout/TabStrip.d.ts +1 -1
  72. package/dist-lib/components/layout/TenantChip.d.ts +1 -1
  73. package/dist-lib/components/layout/TopBar.d.ts +1 -1
  74. package/dist-lib/components/layout/tab-close.d.ts +1 -1
  75. package/dist-lib/components/list/InlineEditCell.d.ts +1 -1
  76. package/dist-lib/components/list/PeekFieldCell.d.ts +2 -2
  77. package/dist-lib/components/list/QuickPeek.d.ts +3 -3
  78. package/dist-lib/components/list/ViewSwitcher.d.ts +1 -1
  79. package/dist-lib/components/pages/DocumentsMenu.d.ts +1 -1
  80. package/dist-lib/components/pages/ExportMenu.d.ts +1 -1
  81. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +1 -1
  82. package/dist-lib/components/pages/auth/AuthShell.d.ts +1 -1
  83. package/dist-lib/components/pages/exportRequest.d.ts +1 -1
  84. package/dist-lib/components/pages/list/ListCardRow.d.ts +3 -3
  85. package/dist-lib/components/pages/list/ListCardsBody.d.ts +3 -3
  86. package/dist-lib/components/pages/list/ListFloatbar.d.ts +3 -3
  87. package/dist-lib/components/pages/list/ListHeader.d.ts +3 -3
  88. package/dist-lib/components/pages/list/ListNoRows.d.ts +1 -1
  89. package/dist-lib/components/pages/list/ListTable.d.ts +2 -2
  90. package/dist-lib/components/pages/list/ListTableRow.d.ts +1 -1
  91. package/dist-lib/components/pages/list/ListToolbar.d.ts +7 -5
  92. package/dist-lib/components/pages/list/RowActionsCell.d.ts +1 -1
  93. package/dist-lib/components/pages/list/RowContextMenu.d.ts +1 -1
  94. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +1 -1
  95. package/dist-lib/components/pages/list/cardProjection.d.ts +2 -2
  96. package/dist-lib/components/pages/list/columns.d.ts +3 -3
  97. package/dist-lib/components/pages/list/filter-meta.d.ts +2 -2
  98. package/dist-lib/components/pages/list/sortable-header.d.ts +1 -1
  99. package/dist-lib/components/pages/list/table-features.d.ts +1 -1
  100. package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +4 -4
  101. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +1 -1
  102. package/dist-lib/components/pages/list/useListQuery.d.ts +4 -8
  103. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +4 -4
  104. package/dist-lib/components/pages/list/useListSelection.d.ts +2 -2
  105. package/dist-lib/components/pages/list/useListSort.d.ts +1 -1
  106. package/dist-lib/components/pages/list/useListViews.d.ts +3 -3
  107. package/dist-lib/components/pages/list/useRowMenu.d.ts +3 -3
  108. package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +1 -1
  109. package/dist-lib/components/params/param-editors.d.ts +1 -1
  110. package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +1 -1
  111. package/dist-lib/components/shared/MarkdownRenderer.d.ts +1 -1
  112. package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +2 -2
  113. package/dist-lib/embed/screen-location.d.ts +1 -1
  114. package/dist-lib/{field-classification-sMkkAEg9.js → field-classification-D6xQYn-h.js} +271 -400
  115. package/dist-lib/{format-count-B5SLlNOb.js → format-count-Dobmi-Ji.js} +238 -238
  116. package/dist-lib/hooks/useAgentConversation.d.ts +1 -1
  117. package/dist-lib/hooks/useAllEntityData.d.ts +1 -1
  118. package/dist-lib/hooks/useAssociatedData.d.ts +1 -1
  119. package/dist-lib/hooks/useBranding.d.ts +4 -4
  120. package/dist-lib/hooks/useBrandingChrome.d.ts +2 -2
  121. package/dist-lib/hooks/useChildrenData.d.ts +1 -1
  122. package/dist-lib/hooks/useCurrentScreen.d.ts +1 -1
  123. package/dist-lib/hooks/useCursorEntityData.d.ts +5 -5
  124. package/dist-lib/hooks/useEntity.d.ts +1 -1
  125. package/dist-lib/hooks/useEntityData.d.ts +8 -1
  126. package/dist-lib/hooks/useFilters.d.ts +1 -1
  127. package/dist-lib/hooks/useImpersonation.d.ts +1 -1
  128. package/dist-lib/hooks/useLiveObject.d.ts +2 -2
  129. package/dist-lib/hooks/useMutations.d.ts +3 -3
  130. package/dist-lib/hooks/useObject.d.ts +1 -1
  131. package/dist-lib/hooks/useParams.d.ts +2 -2
  132. package/dist-lib/hooks/useRealtimeThresholds.d.ts +1 -0
  133. package/dist-lib/hooks/useRegisterScreenTab.d.ts +1 -1
  134. package/dist-lib/hooks/useResponsiveMode.d.ts +1 -1
  135. package/dist-lib/hooks/useSSE.d.ts +1 -2
  136. package/dist-lib/hooks/useScreen.d.ts +1 -1
  137. package/dist-lib/hooks/useTimelineData.d.ts +2 -2
  138. package/dist-lib/hooks/useViews.d.ts +1 -1
  139. package/dist-lib/index.js +811 -811
  140. package/dist-lib/lib/action-dispatch.d.ts +2 -2
  141. package/dist-lib/lib/actions.d.ts +1 -1
  142. package/dist-lib/lib/brand-tokens.d.ts +1 -1
  143. package/dist-lib/lib/branding.d.ts +1 -1
  144. package/dist-lib/lib/child-config.d.ts +1 -1
  145. package/dist-lib/lib/children-validation.d.ts +2 -2
  146. package/dist-lib/lib/document-templates.d.ts +1 -1
  147. package/dist-lib/lib/evidence-verdict.d.ts +1 -1
  148. package/dist-lib/lib/mass-edit.d.ts +1 -1
  149. package/dist-lib/lib/messages.d.ts +2 -2
  150. package/dist-lib/lib/realtime-query-keys.d.ts +22 -0
  151. package/dist-lib/lib/realtime-reconcile.d.ts +1 -10
  152. package/dist-lib/lib/realtime-resync.d.ts +23 -0
  153. package/dist-lib/lib/rich-text.d.ts +1 -1
  154. package/dist-lib/lib/schema-routing.d.ts +1 -1
  155. package/dist-lib/lib/screen-back.d.ts +1 -1
  156. package/dist-lib/lib/size-value.d.ts +1 -1
  157. package/dist-lib/lib/toast.d.ts +2 -2
  158. package/dist-lib/lib/ui-actions.d.ts +1 -1
  159. package/dist-lib/lib/variants.d.ts +1 -1
  160. package/dist-lib/{peekDraftStore-CbHFwz_F.js → peekDraftStore-5wQ7lq_V.js} +17 -17
  161. package/dist-lib/{registry-D0RhCnEL.js → registry-CjgUaF7C.js} +511 -511
  162. package/dist-lib/stores/auth.d.ts +1 -1
  163. package/dist-lib/stores/preferences.d.ts +1 -1
  164. package/dist-lib/stores/realtime.d.ts +86 -19
  165. package/dist-lib/testing.d.ts +4 -4
  166. package/dist-lib/testing.js +40 -40
  167. package/dist-lib/types/api.d.ts +1 -1
  168. package/dist-lib/types/schema.d.ts +2 -2
  169. package/dist-lib/{useCurrentScreen-DVTXCj_K.js → useCurrentScreen-CzwzQpoW.js} +2476 -1967
  170. package/dist-lib/useListQuery-D7Hr5WM1.js +96 -0
  171. package/dist-lib/{useProperties-BcIz-MyO.js → useProperties-CqtCzFCr.js} +25 -25
  172. package/dist-lib/{useTabSearchMirror-UYCsopxP.js → useTabSearchMirror-C39U85cg.js} +13 -13
  173. package/dist-lib/{value-CQzGOI0F.js → value-Bo8C8WMU.js} +4 -4
  174. package/package.json +10 -10
  175. package/dist-lib/useListQuery-C2nq58YV.js +0 -90
@@ -1,5 +1,5 @@
1
1
  import { s as e } from "./DynamicIcon-DW5krHuX.js";
2
- import { Fr as t, Ir as n, Jn as r, lr as i, nt as a, rt as o } from "./useCurrentScreen-DVTXCj_K.js";
2
+ import { $n as t, Br as n, Vr as r, et as i, mr as a, tt as o } from "./useCurrentScreen-CzwzQpoW.js";
3
3
  import { n as s, r as c, t as l } from "./dataTableStyles-vwD1mVOP.js";
4
4
  import { useCallback as u, useMemo as d, useRef as f } from "react";
5
5
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
@@ -7,8 +7,8 @@ import { DndContext as h, PointerSensor as g, closestCenter as _, useSensor as v
7
7
  import { SortableContext as b, useSortable as x, verticalListSortingStrategy as S } from "@dnd-kit/sortable";
8
8
  import { CSS as C } from "@dnd-kit/utilities";
9
9
  //#region src/components/detail-layout/DraggableChildrenTable.tsx
10
- function w({ config: t, childEntity: i, schema: a, rows: o, onChange: l, validationErrors: x, refs: C }) {
11
- let w = f(null), E = t.position_field, D = t.columns, O = y(v(g, { activationConstraint: { distance: 5 } })), k = new Set(Array.isArray(t.foreign_key) ? t.foreign_key : [t.foreign_key]), A = D.filter((e) => {
10
+ function w({ config: n, childEntity: i, schema: a, rows: o, onChange: l, validationErrors: x, refs: C }) {
11
+ let w = f(null), E = n.position_field, D = n.columns, O = y(v(g, { activationConstraint: { distance: 5 } })), k = new Set(Array.isArray(n.foreign_key) ? n.foreign_key : [n.foreign_key]), A = D.filter((e) => {
12
12
  if (k.has(e) || e === E) return !1;
13
13
  let t = i.fields.get(e);
14
14
  return !(!t || t.auto || t.primary || t.source);
@@ -26,22 +26,22 @@ function w({ config: t, childEntity: i, schema: a, rows: o, onChange: l, validat
26
26
  let e = o.filter((e) => !e._deleted).reduce((e, t) => {
27
27
  let n = typeof t[E] == "number" ? t[E] : -1;
28
28
  return Math.max(e, n);
29
- }, -1), n = {
29
+ }, -1), t = {
30
30
  _key: crypto.randomUUID(),
31
31
  _dirty: !0,
32
32
  [E]: e + 1
33
- }, r = t.quick_add?.defaults ?? {};
33
+ }, r = n.quick_add?.defaults ?? {};
34
34
  for (let e of A) {
35
- let t = i.fields.get(e);
36
- t && (r[e] === void 0 ? t.default === void 0 ? t.type === "bool" && (n[e] = !1) : n[e] = t.default : n[e] = r[e]);
35
+ let n = i.fields.get(e);
36
+ n && (r[e] === void 0 ? n.default === void 0 ? n.type === "bool" && (t[e] = !1) : t[e] = n.default : t[e] = r[e]);
37
37
  }
38
- l([...o, n]);
38
+ l([...o, t]);
39
39
  }, [
40
40
  o,
41
41
  l,
42
42
  A,
43
43
  i,
44
- t.quick_add?.defaults,
44
+ n.quick_add?.defaults,
45
45
  E
46
46
  ]), I = u((e) => {
47
47
  l(o.map((t) => t._key === e ? {
@@ -118,10 +118,10 @@ function w({ config: t, childEntity: i, schema: a, rows: o, onChange: l, validat
118
118
  padding: "0 4px"
119
119
  } }),
120
120
  M.map((e) => {
121
- let t = i.fields.get(e);
121
+ let n = i.fields.get(e);
122
122
  return /* @__PURE__ */ p("th", {
123
123
  style: B,
124
- children: t ? r(t, e, a.entities) : e
124
+ children: n ? t(n, e, a.entities) : e
125
125
  }, e);
126
126
  }),
127
127
  /* @__PURE__ */ p("th", { style: {
@@ -148,7 +148,7 @@ function w({ config: t, childEntity: i, schema: a, rows: o, onChange: l, validat
148
148
  })
149
149
  }), /* @__PURE__ */ p("div", {
150
150
  style: { marginTop: 8 },
151
- children: /* @__PURE__ */ p(n, {
151
+ children: /* @__PURE__ */ p(r, {
152
152
  kind: "ghost",
153
153
  size: "xs",
154
154
  icon: /* @__PURE__ */ p(e.plus, { size: 12 }),
@@ -157,9 +157,9 @@ function w({ config: t, childEntity: i, schema: a, rows: o, onChange: l, validat
157
157
  })
158
158
  })] });
159
159
  }
160
- function T({ row: n, columns: r, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
161
- let v = a(), y = !!n._deleted, b = d?.[n._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
162
- id: n._key,
160
+ function T({ row: t, columns: r, editableColumns: s, displayOnlyColumns: c, childEntity: u, validationErrors: d, refs: f, onCellChange: h, onDelete: g, onUndoDelete: _ }) {
161
+ let v = i(), y = !!t._deleted, b = d?.[t._key], { attributes: S, listeners: w, setNodeRef: T, transform: E, transition: D, isDragging: O } = x({
162
+ id: t._key,
163
163
  disabled: y
164
164
  }), k = {
165
165
  transform: C.Translate.toString(E),
@@ -201,21 +201,21 @@ function T({ row: n, columns: r, editableColumns: s, displayOnlyColumns: c, chil
201
201
  })
202
202
  }),
203
203
  r.map((e) => {
204
- let t = u.fields.get(e), r = b?.includes(e), a = c.has(e), l = s.includes(e);
205
- return y || a || !l ? /* @__PURE__ */ p("td", {
204
+ let n = u.fields.get(e), r = b?.includes(e), i = c.has(e), l = s.includes(e);
205
+ return y || i || !l ? /* @__PURE__ */ p("td", {
206
206
  style: {
207
207
  ...A,
208
208
  textDecoration: y ? "line-through" : "none"
209
209
  },
210
- children: t ? o({
211
- field: t,
210
+ children: n ? o({
211
+ field: n,
212
212
  fieldName: e,
213
- value: n[e],
213
+ value: t[e],
214
214
  mode: "display",
215
- record: n,
215
+ record: t,
216
216
  refs: f,
217
217
  locale: v
218
- }) : i(n[e])
218
+ }) : a(t[e])
219
219
  }, e) : /* @__PURE__ */ p("td", {
220
220
  style: {
221
221
  ...j,
@@ -224,16 +224,16 @@ function T({ row: n, columns: r, editableColumns: s, displayOnlyColumns: c, chil
224
224
  borderRadius: r ? 4 : 0
225
225
  },
226
226
  title: r ? `${e} is required` : void 0,
227
- children: t ? o({
228
- field: t,
227
+ children: n ? o({
228
+ field: n,
229
229
  fieldName: e,
230
- value: n[e],
230
+ value: t[e],
231
231
  mode: "edit",
232
- onChange: (t) => h(n._key, e, t),
233
- record: n,
232
+ onChange: (n) => h(t._key, e, n),
233
+ record: t,
234
234
  refs: f,
235
235
  locale: v
236
- }) : i(n[e])
236
+ }) : a(t[e])
237
237
  }, e);
238
238
  }),
239
239
  /* @__PURE__ */ p("td", {
@@ -242,15 +242,15 @@ function T({ row: n, columns: r, editableColumns: s, displayOnlyColumns: c, chil
242
242
  borderBottom: "1px solid var(--divider)",
243
243
  verticalAlign: "middle"
244
244
  },
245
- children: y ? /* @__PURE__ */ p(t, {
245
+ children: y ? /* @__PURE__ */ p(n, {
246
246
  size: 24,
247
247
  icon: /* @__PURE__ */ p(e.refresh, { size: 12 }),
248
- onClick: () => _(n._key),
248
+ onClick: () => _(t._key),
249
249
  title: "Undo delete"
250
- }) : /* @__PURE__ */ p(t, {
250
+ }) : /* @__PURE__ */ p(n, {
251
251
  size: 24,
252
252
  icon: /* @__PURE__ */ p(e.trash, { size: 12 }),
253
- onClick: () => g(n._key),
253
+ onClick: () => g(t._key),
254
254
  title: "Delete row"
255
255
  })
256
256
  })
@@ -1,5 +1,5 @@
1
- import { ct as e, dt as t, ft as n, lt as r, ot as i, ut as a } from "./useCurrentScreen-DVTXCj_K.js";
2
- import { c as o, i as s, l as c, t as l } from "./value-CQzGOI0F.js";
1
+ import { ct as e, it as t, lt as n, ot as r, st as i, ut as a } from "./useCurrentScreen-CzwzQpoW.js";
2
+ import { c as o, i as s, l as c, t as l } from "./value-Bo8C8WMU.js";
3
3
  import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
4
4
  import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
5
5
  import { DndContext as v, PointerSensor as y, closestCenter as b, useSensor as x, useSensors as ee } from "@dnd-kit/core";
@@ -9,19 +9,19 @@ import { CSS as C } from "@dnd-kit/utilities";
9
9
  function w(e, t) {
10
10
  return o(e, t);
11
11
  }
12
- function T(a) {
13
- let { field: o, fieldName: s, value: c, onChange: h, mode: S, disabled: C } = a, w = l(c), [T, k] = m([]), [A, j] = m(/* @__PURE__ */ new Set()), [M, N] = m(null), { register: P, unregister: F, isDraft: I } = i(), L = p(/* @__PURE__ */ new Set()), R = p([]);
12
+ function T(e) {
13
+ let { field: o, fieldName: s, value: c, onChange: h, mode: S, disabled: C } = e, w = l(c), [T, k] = m([]), [A, j] = m(/* @__PURE__ */ new Set()), [M, N] = m(null), { register: P, unregister: F, isDraft: I } = t(), L = p(/* @__PURE__ */ new Set()), R = p([]);
14
14
  R.current = T;
15
15
  let z = p(w);
16
16
  z.current = w, d(() => () => {
17
17
  R.current.forEach((e) => e.abort());
18
18
  }, []);
19
- let B = ee(x(y, { activationConstraint: { distance: 5 } })), V = o.display?.placeholder || s, H = (o.accepts ?? ["image/*"]).join(","), U = o.display?.reorderable !== !1, W = o.display?.listable_thumbnail, G = u(async (i) => {
20
- let c = n(i, o.accepts, o.max_size_bytes), l = `tile-${Math.random().toString(36).slice(2)}-${Date.now()}`, u = new AbortController();
19
+ let B = ee(x(y, { activationConstraint: { distance: 5 } })), V = o.display?.placeholder || s, H = (o.accepts ?? ["image/*"]).join(","), U = o.display?.reorderable !== !1, W = o.display?.listable_thumbnail, G = u(async (t) => {
20
+ let c = a(t, o.accepts, o.max_size_bytes), l = `tile-${Math.random().toString(36).slice(2)}-${Date.now()}`, u = new AbortController();
21
21
  if (c) {
22
22
  k((e) => [...e, {
23
23
  localId: l,
24
- filename: i.name,
24
+ filename: t.name,
25
25
  progress: null,
26
26
  error: c,
27
27
  abort: () => {}
@@ -30,19 +30,19 @@ function T(a) {
30
30
  }
31
31
  k((e) => [...e, {
32
32
  localId: l,
33
- filename: i.name,
33
+ filename: t.name,
34
34
  progress: {
35
35
  loaded: 0,
36
- total: i.size,
36
+ total: t.size,
37
37
  pct: 0
38
38
  },
39
39
  error: null,
40
40
  abort: () => u.abort()
41
41
  }]);
42
42
  try {
43
- let e = await t({
44
- file: i,
45
- entityCode: a.entityCode,
43
+ let r = await n({
44
+ file: t,
45
+ entityCode: e.entityCode,
46
46
  fieldCode: s,
47
47
  signal: u.signal,
48
48
  onProgress: (e) => k((t) => t.map((t) => t.localId === l ? {
@@ -51,37 +51,37 @@ function T(a) {
51
51
  } : t))
52
52
  });
53
53
  if (L.current.delete(l)) {
54
- r(e.id).catch(() => {}), F(e.id);
54
+ i(r.id).catch(() => {}), F(r.id);
55
55
  return;
56
56
  }
57
- P(e.id, () => r(e.id));
58
- let n = {
59
- id: e.id,
60
- filename: e.filename,
61
- content_type: e.content_type,
62
- size_bytes: e.size_bytes,
63
- sha256: e.sha256,
64
- width: e.width,
65
- height: e.height,
66
- url: e.url,
67
- metadata: e.metadata
68
- }, o = [...z.current, n];
57
+ P(r.id, () => i(r.id));
58
+ let a = {
59
+ id: r.id,
60
+ filename: r.filename,
61
+ content_type: r.content_type,
62
+ size_bytes: r.size_bytes,
63
+ sha256: r.sha256,
64
+ width: r.width,
65
+ height: r.height,
66
+ url: r.url,
67
+ metadata: r.metadata
68
+ }, o = [...z.current, a];
69
69
  z.current = o, h?.(o), k((e) => e.filter((e) => e.localId !== l));
70
- } catch (t) {
71
- if (t instanceof e && t.code === "ABORTED") {
70
+ } catch (e) {
71
+ if (e instanceof r && e.code === "ABORTED") {
72
72
  k((e) => e.filter((e) => e.localId !== l));
73
73
  return;
74
74
  }
75
- let n = t instanceof e ? {
76
- code: t.code,
77
- message: t.message
75
+ let t = e instanceof r ? {
76
+ code: e.code,
77
+ message: e.message
78
78
  } : {
79
79
  code: "UNKNOWN",
80
- message: t instanceof Error ? t.message : "Upload failed"
80
+ message: e instanceof Error ? e.message : "Upload failed"
81
81
  };
82
82
  k((e) => e.map((e) => e.localId === l ? {
83
83
  ...e,
84
- error: n,
84
+ error: t,
85
85
  progress: null,
86
86
  abort: () => {}
87
87
  } : e));
@@ -91,7 +91,7 @@ function T(a) {
91
91
  o.max_size_bytes,
92
92
  s,
93
93
  h,
94
- a.entityCode,
94
+ e.entityCode,
95
95
  P,
96
96
  F
97
97
  ]), K = u((e) => {
@@ -109,7 +109,7 @@ function T(a) {
109
109
  let t = e.target.files;
110
110
  e.target.value = "", t && t.length > 0 && K(t);
111
111
  }, [K]), se = u((e) => {
112
- I(e) && (r(e).catch(() => {}), F(e));
112
+ I(e) && (i(e).catch(() => {}), F(e));
113
113
  let t = w.filter((t) => t.id !== e);
114
114
  h?.(t), j((t) => {
115
115
  let n = new Set(t);
@@ -122,7 +122,7 @@ function T(a) {
122
122
  F
123
123
  ]), ce = u(() => {
124
124
  A.size !== 0 && (Array.from(A).forEach((e) => {
125
- I(e) && (r(e).catch(() => {}), F(e));
125
+ I(e) && (i(e).catch(() => {}), F(e));
126
126
  }), h?.(w.filter((e) => !A.has(e.id))), j(/* @__PURE__ */ new Set()));
127
127
  }, [
128
128
  I,
@@ -346,13 +346,13 @@ function D({ tile: e, onCancel: t, onDismiss: n }) {
346
346
  ]
347
347
  });
348
348
  }
349
- function O({ file: e, hasPrev: t, hasNext: n, onPrev: r, onNext: i, onClose: o }) {
350
- let c = s(e.id, "preview", e.presigned_url ?? e.url ?? w(e));
349
+ function O({ file: t, hasPrev: n, hasNext: r, onPrev: i, onNext: a, onClose: o }) {
350
+ let c = s(t.id, "preview", t.presigned_url ?? t.url ?? w(t));
351
351
  return /* @__PURE__ */ _("div", {
352
352
  className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80",
353
353
  role: "dialog",
354
354
  "aria-modal": "true",
355
- "aria-label": e.filename,
355
+ "aria-label": t.filename,
356
356
  "data-testid": "lightbox",
357
357
  onClick: o,
358
358
  children: [
@@ -365,35 +365,35 @@ function O({ file: e, hasPrev: t, hasNext: n, onPrev: r, onNext: i, onClose: o }
365
365
  "data-testid": "lightbox-close",
366
366
  children: "Close"
367
367
  }),
368
- t && /* @__PURE__ */ g("button", {
368
+ n && /* @__PURE__ */ g("button", {
369
369
  type: "button",
370
370
  className: "absolute left-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
371
371
  onClick: (e) => {
372
- e.stopPropagation(), r();
372
+ e.stopPropagation(), i();
373
373
  },
374
374
  "data-testid": "lightbox-prev",
375
375
  children: "‹"
376
376
  }),
377
- n && /* @__PURE__ */ g("button", {
377
+ r && /* @__PURE__ */ g("button", {
378
378
  type: "button",
379
379
  className: "absolute right-4 bottom-4 rounded-sm border border-border bg-card px-3 py-2 text-foreground",
380
380
  onClick: (e) => {
381
- e.stopPropagation(), i();
381
+ e.stopPropagation(), a();
382
382
  },
383
383
  "data-testid": "lightbox-next",
384
384
  children: "›"
385
385
  }),
386
386
  c ? /* @__PURE__ */ g("img", {
387
387
  src: c,
388
- alt: e.filename,
388
+ alt: t.filename,
389
389
  className: "max-h-[90vh] max-w-[90vw] object-contain",
390
390
  onClick: (e) => e.stopPropagation()
391
391
  }) : /* @__PURE__ */ _("div", {
392
392
  className: "rounded-md bg-card p-4 text-foreground",
393
393
  children: [
394
- e.filename,
394
+ t.filename,
395
395
  " (",
396
- a(e.size_bytes),
396
+ e(t.size_bytes),
397
397
  ")"
398
398
  ]
399
399
  })
@@ -26,7 +26,7 @@ function o({ value: o, onChange: s, readOnly: c, id: l }) {
26
26
  navigationBar: !1,
27
27
  statusBar: !1,
28
28
  onChange: (e, t, n) => {
29
- if (!(c || !f.current) && !n.contentErrors) {
29
+ if (!c && f.current && !n.contentErrors) {
30
30
  if ("json" in e) f.current(e.json);
31
31
  else if ("text" in e) try {
32
32
  f.current(JSON.parse(e.text));
@@ -53,7 +53,7 @@ function o({ value: o, onChange: s, readOnly: c, id: l }) {
53
53
  n.disconnect(), s.destroy(), d.current = null;
54
54
  };
55
55
  }, [c]), e(() => {
56
- !d.current || !c || d.current.updateProps({ content: a(o) });
56
+ d.current && c && d.current.updateProps({ content: a(o) });
57
57
  }, [o, c]), /* @__PURE__ */ n("div", {
58
58
  ref: u,
59
59
  id: l,