@declarion/react 0.358.0 → 0.365.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.
@@ -1,42 +1,42 @@
1
1
  // src/api/access-expiry.ts
2
- var e = "declarion.auth.access.expiry";
3
- function t(t) {
2
+ var e = "declarion.auth.access.expiry", t = 6e4;
3
+ function n(t) {
4
4
  if (t && !Number.isNaN(Date.parse(t))) try {
5
5
  window.localStorage.setItem(e, t);
6
6
  } catch {
7
7
  return;
8
8
  }
9
9
  }
10
- function n() {
10
+ function r() {
11
11
  try {
12
12
  window.localStorage.removeItem(e);
13
13
  } catch {
14
14
  return;
15
15
  }
16
16
  }
17
- var r = "declarion.auth.signed_out";
18
- function i() {
17
+ var i = "declarion.auth.signed_out";
18
+ function a() {
19
19
  try {
20
- window.localStorage.setItem(r, "1");
20
+ window.localStorage.setItem(i, "1");
21
21
  } catch {
22
22
  return;
23
23
  }
24
24
  }
25
- function a() {
25
+ function o() {
26
26
  try {
27
- window.localStorage.removeItem(r);
27
+ window.localStorage.removeItem(i);
28
28
  } catch {
29
29
  return;
30
30
  }
31
31
  }
32
- function o() {
32
+ function s() {
33
33
  try {
34
- return window.localStorage.getItem(r) === "1";
34
+ return window.localStorage.getItem(i) === "1";
35
35
  } catch {
36
36
  return !1;
37
37
  }
38
38
  }
39
- function s() {
39
+ function c() {
40
40
  try {
41
41
  let t = Date.parse(window.localStorage.getItem(e) ?? "");
42
42
  return Number.isNaN(t) ? null : t;
@@ -44,11 +44,11 @@ function s() {
44
44
  return null;
45
45
  }
46
46
  }
47
- var c = "/login/sso-callback";
48
- function l(e, t, n = !1) {
49
- return n ? "first-wave" : e === null ? "probe-first" : e > t ? "first-wave" : "refresh-first";
47
+ var l = "/login/sso-callback";
48
+ function u(e, t, n = !1) {
49
+ return n ? "first-wave" : e === null ? "probe-first" : e - 6e4 > t ? "first-wave" : "refresh-first";
50
50
  }
51
- function u() {
52
- return l(s(), Date.now(), window.location.pathname === c);
51
+ function d() {
52
+ return u(c(), Date.now(), window.location.pathname === l);
53
53
  }
54
- export { c as SSO_RETURN_PATH, n as clearAccessExpiry, a as clearSignOut, t as recordAccessExpiry, i as recordSignOut, o as signedOutExplicitly, l as startOrder, u as startOrderNow };
54
+ export { t as PROACTIVE_REFRESH_MARGIN_MS, l as SSO_RETURN_PATH, r as clearAccessExpiry, o as clearSignOut, n as recordAccessExpiry, a as recordSignOut, s as signedOutExplicitly, u as startOrder, d as startOrderNow };
@@ -1,8 +1,9 @@
1
1
  import { RefreshDeadError as e, ensureRefresh as t, getPersistentAuthFailureHandler as n } from "./client.js";
2
2
  import { backoffDelayMs as r } from "./request-bounds.js";
3
- import { isEmbedTokenMode as i } from "../embed/token.js";
3
+ import { PROACTIVE_REFRESH_MARGIN_MS as i } from "./access-expiry.js";
4
+ import { isEmbedTokenMode as a } from "../embed/token.js";
4
5
  // src/api/session-renewal.ts
5
- var a = 6e4, o = 5e3, s = null, c = null, l = 0, u = !1;
6
+ var o = 5e3, s = null, c = null, l = 0, u = !1;
6
7
  function d() {
7
8
  s && clearTimeout(s), s = null;
8
9
  }
@@ -12,7 +13,7 @@ function f(e) {
12
13
  }, e);
13
14
  }
14
15
  function p() {
15
- u || i() || (d(), u = !0, t().catch((t) => {
16
+ u || a() || (d(), u = !0, t().catch((t) => {
16
17
  t instanceof e ? n()() : c !== null && f(r(l++));
17
18
  }).finally(() => {
18
19
  u = !1;
@@ -21,7 +22,7 @@ function p() {
21
22
  function m(e) {
22
23
  h();
23
24
  let t = e ? Date.parse(e) : NaN;
24
- Number.isNaN(t) || (c = t, f(Math.max(t - Date.now() - a, o)));
25
+ Number.isNaN(t) || (c = t, f(Math.max(t - Date.now() - i, o)));
25
26
  }
26
27
  function h() {
27
28
  d(), c = null, l = 0;
@@ -32,4 +33,4 @@ function g() {
32
33
  document.addEventListener("visibilitychange", () => {
33
34
  document.visibilityState === "visible" && g();
34
35
  }), document.addEventListener("resume", g), window.addEventListener("pageshow", g), window.addEventListener("online", g);
35
- export { a as PROACTIVE_REFRESH_MARGIN_MS, h as cancelRenewal, m as scheduleRenewal };
36
+ export { h as cancelRenewal, m as scheduleRenewal };
@@ -0,0 +1,27 @@
1
+ import { Select as e } from "../primitives/Fields.js";
2
+ import { useSchema as t } from "../../hooks/useSchema.js";
3
+ import { useText as n } from "../../hooks/useText.js";
4
+ import { coerceDisplayString as r } from "../../lib/display-value.js";
5
+ import { errorOptions as i } from "../../lib/error-options.js";
6
+ import { EMPTY_CELL as a } from "./cells/factories/emptyCell.js";
7
+ import { Fragment as o, jsx as s } from "react/jsx-runtime";
8
+ // src/components/fields/ErrorField.tsx
9
+ var c = "__declarion_error_null__";
10
+ function l({ field: l, value: u, mode: d, onChange: f, fieldId: p, labelId: m, t: h }) {
11
+ let { data: g } = t(), _ = n("errors"), v = u != null && u !== "" ? r(u) : "";
12
+ if (d === "display") return v ? /* @__PURE__ */ s(o, { children: _(v, v) }) : a;
13
+ let y = [...l.required ? [] : [{
14
+ value: c,
15
+ label: h("field.enum.none", "— None —")
16
+ }], ...i(g?.errors, h)];
17
+ return /* @__PURE__ */ s(e, {
18
+ id: p,
19
+ "aria-labelledby": m,
20
+ "aria-required": l.required || void 0,
21
+ value: v || c,
22
+ options: y,
23
+ onChange: (e) => f?.(e === c ? null : e),
24
+ placeholder: h("field.select_placeholder", "Select…")
25
+ });
26
+ }
27
+ export { l as ErrorField };
@@ -1,32 +1,37 @@
1
1
  import { IconBtn as e } from "../primitives/IconBtn.js";
2
2
  import { Icon as t } from "../primitives/Icons.js";
3
- import { useText as n } from "../../hooks/useText.js";
4
- import { coerceDisplayString as r } from "../../lib/display-value.js";
5
- import { Suspense as i, lazy as a, useState as o } from "react";
6
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
+ import { useSchema as n } from "../../hooks/useSchema.js";
4
+ import { useText as r } from "../../hooks/useText.js";
5
+ import { coerceDisplayString as i } from "../../lib/display-value.js";
6
+ import { Suspense as a, lazy as o, useState as s } from "react";
7
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
7
8
  // src/components/fields/JsonField.tsx
8
- var u = a(() => import("./JsonEditor.js").then((e) => ({ default: e.JsonEditor })));
9
- function d() {
10
- return /* @__PURE__ */ c("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
9
+ var d = o(() => import("./JsonEditor.js").then((e) => ({ default: e.JsonEditor })));
10
+ function f() {
11
+ return /* @__PURE__ */ l("div", { className: "h-20 rounded-md border border-border bg-muted animate-pulse" });
11
12
  }
12
- function f(e) {
13
+ function p(e) {
13
14
  return e == null ? !0 : typeof e == "string" ? e.trim() === "" : Array.isArray(e) ? e.length === 0 : typeof e == "object" && Object.keys(e).length === 0;
14
15
  }
15
- function p(e) {
16
+ function m(e) {
16
17
  return Array.isArray(e) && e.every((e) => [
17
18
  "string",
18
19
  "number",
19
20
  "boolean"
20
21
  ].includes(typeof e));
21
22
  }
22
- function m({ value: e, mode: t, onChange: n, fieldId: r }) {
23
- return t === "display" ? f(e) ? /* @__PURE__ */ c("span", {
23
+ function h({ value: e, mode: t, onChange: n, fieldId: r, entityCode: i, fieldName: o }) {
24
+ let s = T(i, o);
25
+ return t === "display" ? p(e) ? /* @__PURE__ */ l("span", {
24
26
  style: {
25
27
  fontSize: 12.5,
26
28
  color: "var(--text-4)"
27
29
  },
28
30
  children: "—"
29
- }) : p(e) ? /* @__PURE__ */ c("ul", {
31
+ }) : s && typeof e == "object" && !Array.isArray(e) ? /* @__PURE__ */ l(D, {
32
+ value: e,
33
+ body: /* @__PURE__ */ l(E, { value: e })
34
+ }) : m(e) ? /* @__PURE__ */ l("ul", {
30
35
  className: "mono",
31
36
  style: {
32
37
  margin: 0,
@@ -35,17 +40,17 @@ function m({ value: e, mode: t, onChange: n, fieldId: r }) {
35
40
  fontSize: 12.5,
36
41
  lineHeight: 1.7
37
42
  },
38
- children: e.map((e, t) => /* @__PURE__ */ c("li", { children: String(e) }, t))
39
- }) : /* @__PURE__ */ c(S, { value: e }) : /* @__PURE__ */ c(i, {
40
- fallback: /* @__PURE__ */ c(d, {}),
41
- children: /* @__PURE__ */ c(u, {
43
+ children: e.map((e, t) => /* @__PURE__ */ l("li", { children: String(e) }, t))
44
+ }) : /* @__PURE__ */ l(D, { value: e }) : /* @__PURE__ */ l(a, {
45
+ fallback: /* @__PURE__ */ l(f, {}),
46
+ children: /* @__PURE__ */ l(d, {
42
47
  value: e,
43
48
  onChange: n,
44
49
  id: r
45
50
  })
46
51
  });
47
52
  }
48
- var h = {
53
+ var g = {
49
54
  display: "flex",
50
55
  flexDirection: "column",
51
56
  gap: 6,
@@ -53,72 +58,103 @@ var h = {
53
58
  borderRadius: "var(--radius-md)",
54
59
  padding: 12,
55
60
  background: "var(--surface-2)"
56
- }, g = {
61
+ }, _ = {
57
62
  display: "flex",
58
63
  flexDirection: "column",
59
64
  gap: 8
60
- }, _ = {
65
+ }, v = {
61
66
  display: "flex",
62
67
  flexWrap: "wrap",
63
68
  alignItems: "baseline",
64
69
  gap: 8
65
- }, v = {
70
+ }, y = {
66
71
  fontSize: 11.5,
67
72
  fontWeight: 500,
68
73
  color: "var(--text-3)",
69
74
  width: 120,
70
75
  flexShrink: 0,
71
76
  overflowWrap: "anywhere"
72
- }, y = {
73
- ...g,
77
+ }, b = {
78
+ ..._,
74
79
  paddingLeft: 10,
75
80
  borderLeft: "2px solid var(--border)"
76
- }, b = {
81
+ }, x = {
77
82
  minWidth: 0,
78
83
  flex: "1 1 14rem",
79
84
  fontSize: 12.5,
80
85
  overflowWrap: "anywhere"
81
- }, x = {
86
+ }, S = {
82
87
  display: "flex",
83
88
  justifyContent: "flex-end"
84
- };
85
- function S({ value: r }) {
86
- let a = n(), [s, f] = o(!1), p = s ? a("field.json.hide_source", "Hide JSON") : a("field.json.show_source", "Show JSON");
87
- return /* @__PURE__ */ l("div", {
88
- style: h,
89
- children: [/* @__PURE__ */ c("div", {
90
- style: x,
91
- children: /* @__PURE__ */ c(e, {
89
+ }, C = {
90
+ fontSize: 12.5,
91
+ fontWeight: 500
92
+ }, w = /* @__PURE__ */ new Set([
93
+ "type",
94
+ "status",
95
+ "title",
96
+ "detail",
97
+ "instance",
98
+ "retryable"
99
+ ]);
100
+ function T(e, t) {
101
+ let { data: r } = n(), i = e ? r?.entities[e] : void 0;
102
+ return i ? [...i.fields].some(([, e]) => e.type === "error" && e.source === `$row.${t}.type`) : !1;
103
+ }
104
+ function E({ value: e }) {
105
+ let t = r("errors"), n = typeof e.type == "string" ? e.type : "", i = n.startsWith("/errors/") ? n.slice(8) : n, a = Object.fromEntries(Object.entries(e).filter(([e]) => !w.has(e)));
106
+ return /* @__PURE__ */ u("div", {
107
+ style: _,
108
+ children: [
109
+ i ? /* @__PURE__ */ l("span", {
110
+ style: C,
111
+ children: t(i, i)
112
+ }) : null,
113
+ typeof e.detail == "string" && e.detail ? /* @__PURE__ */ l("span", {
114
+ style: x,
115
+ children: e.detail
116
+ }) : null,
117
+ Object.keys(a).length > 0 ? /* @__PURE__ */ l(O, { value: a }) : null
118
+ ]
119
+ });
120
+ }
121
+ function D({ value: n, body: i }) {
122
+ let o = r(), [c, p] = s(!1), m = c ? o("field.json.hide_source", "Hide JSON") : o("field.json.show_source", "Show JSON");
123
+ return /* @__PURE__ */ u("div", {
124
+ style: g,
125
+ children: [/* @__PURE__ */ l("div", {
126
+ style: S,
127
+ children: /* @__PURE__ */ l(e, {
92
128
  size: 22,
93
- icon: /* @__PURE__ */ c(t.code, { size: 13 }),
129
+ icon: /* @__PURE__ */ l(t.code, { size: 13 }),
94
130
  onClick: (e) => {
95
- e.stopPropagation(), f((e) => !e);
131
+ e.stopPropagation(), p((e) => !e);
96
132
  },
97
- title: p,
98
- "aria-label": p,
99
- "aria-pressed": s
133
+ title: m,
134
+ "aria-label": m,
135
+ "aria-pressed": c
100
136
  })
101
- }), s ? /* @__PURE__ */ c(i, {
102
- fallback: /* @__PURE__ */ c(d, {}),
103
- children: /* @__PURE__ */ c(u, {
104
- value: r,
137
+ }), c ? /* @__PURE__ */ l(a, {
138
+ fallback: /* @__PURE__ */ l(f, {}),
139
+ children: /* @__PURE__ */ l(d, {
140
+ value: n,
105
141
  readOnly: !0
106
142
  })
107
- }) : /* @__PURE__ */ c(w, { value: r })]
143
+ }) : i ?? /* @__PURE__ */ l(k, { value: n })]
108
144
  });
109
145
  }
110
- function C({ value: e, nested: t }) {
146
+ function O({ value: e, nested: t }) {
111
147
  let n = Array.isArray(e) ? e.map((e, t) => [String(t + 1), e]) : Object.entries(e);
112
- return /* @__PURE__ */ c("div", {
113
- style: t ? y : g,
114
- children: n.map(([e, t]) => /* @__PURE__ */ l("div", {
115
- style: _,
116
- children: [/* @__PURE__ */ c("span", {
117
- style: v,
148
+ return /* @__PURE__ */ l("div", {
149
+ style: t ? b : _,
150
+ children: n.map(([e, t]) => /* @__PURE__ */ u("div", {
151
+ style: v,
152
+ children: [/* @__PURE__ */ l("span", {
153
+ style: y,
118
154
  children: e
119
- }), /* @__PURE__ */ c("div", {
120
- style: b,
121
- children: /* @__PURE__ */ c(w, {
155
+ }), /* @__PURE__ */ l("div", {
156
+ style: x,
157
+ children: /* @__PURE__ */ l(k, {
122
158
  value: t,
123
159
  nested: !0
124
160
  })
@@ -126,13 +162,21 @@ function C({ value: e, nested: t }) {
126
162
  }, e))
127
163
  });
128
164
  }
129
- function w({ value: e, nested: t }) {
130
- return f(e) ? /* @__PURE__ */ c("span", {
165
+ function k({ value: e, nested: t }) {
166
+ let n = r();
167
+ return p(e) ? /* @__PURE__ */ l("span", {
131
168
  style: { color: "var(--text-4)" },
132
169
  children: "—"
133
- }) : p(e) ? /* @__PURE__ */ c(s, { children: e.map(String).join(", ") }) : typeof e == "object" ? /* @__PURE__ */ c(C, {
170
+ }) : m(e) ? /* @__PURE__ */ l(c, { children: e.map((e) => A(e, n.language)).join(", ") }) : typeof e == "object" ? /* @__PURE__ */ l(O, {
134
171
  value: e,
135
172
  nested: t
136
- }) : /* @__PURE__ */ c(s, { children: r(e) });
173
+ }) : /* @__PURE__ */ l(c, { children: A(e, n.language) });
174
+ }
175
+ function A(e, t) {
176
+ if (typeof e == "number" && Number.isFinite(e) && !Number.isInteger(e)) {
177
+ let n = Math.abs(e) < 1 ? { maximumSignificantDigits: 4 } : { maximumFractionDigits: 4 };
178
+ return new Intl.NumberFormat(t, n).format(e);
179
+ }
180
+ return i(e);
137
181
  }
138
- export { m as JsonField, f as isEmptyJsonValue };
182
+ export { h as JsonField, p as isEmptyJsonValue };
@@ -0,0 +1,11 @@
1
+ import { useText as e } from "../../../../hooks/useText.js";
2
+ import { coerceDisplayString as t } from "../../../../lib/display-value.js";
3
+ import { EMPTY_CELL as n } from "./emptyCell.js";
4
+ import { Fragment as r, jsx as i } from "react/jsx-runtime";
5
+ // src/components/fields/cells/factories/errorTitle.tsx
6
+ function a({ code: t }) {
7
+ let n = e("errors");
8
+ return /* @__PURE__ */ i(r, { children: n(t, t) });
9
+ }
10
+ var o = () => (e) => e == null || e === "" ? n : /* @__PURE__ */ i(a, { code: t(e) });
11
+ export { o as errorFactory };
@@ -50,6 +50,7 @@ var d = (e) => {
50
50
  }
51
51
  return /* @__PURE__ */ i(t, {
52
52
  field: e.field,
53
+ entityCode: e.entityCode,
53
54
  fieldName: e.fieldName,
54
55
  value: s,
55
56
  mode: "display",
@@ -21,8 +21,9 @@ import { passwordMaskFactory as x } from "./factories/passwordMask.js";
21
21
  import { richTextPreviewFactory as S } from "./factories/richTextPreview.js";
22
22
  import { multilangInlineFactory as C } from "./factories/multilangInline.js";
23
23
  import { fileReferenceFactory as w } from "./factories/fileReference.js";
24
+ import { errorFactory as T } from "./factories/errorTitle.js";
24
25
  // src/components/fields/cells/registry.ts
25
- var T = {
26
+ var E = {
26
27
  text: e,
27
28
  bool_pill: t,
28
29
  badge: n,
@@ -48,12 +49,13 @@ var T = {
48
49
  markdown: b,
49
50
  password_mask: x,
50
51
  rich_text_preview: S,
51
- multilang_inline: C
52
+ multilang_inline: C,
53
+ error: T
52
54
  };
53
- Object.keys(T).sort();
54
- function E(e) {
55
- let t = e.field.display?.widget ?? "text", n = T[t];
55
+ Object.keys(E).sort();
56
+ function D(e) {
57
+ let t = e.field.display?.widget ?? "text", n = E[t];
56
58
  if (!n) throw Error(`resolveCellRenderer: no factory registered for widget "${t}" (field "${e.fieldName}"). The engine must stamp a smart default at YAML-load time; an unknown widget here indicates an out-of-sync allow-list.`);
57
59
  return n(e);
58
60
  }
59
- export { E as resolveCellRenderer };
61
+ export { D as resolveCellRenderer };
@@ -2,69 +2,71 @@ import { FIELD_TYPES as e } from "../../types/fieldType.js";
2
2
  import { StringField as t } from "./StringField.js";
3
3
  import { TextField as n } from "./TextField.js";
4
4
  import { EnumField as r } from "./EnumField.js";
5
- import { EmailField as i } from "./EmailField.js";
6
- import { UrlField as a } from "./UrlField.js";
7
- import { PhoneField as o } from "./PhoneField.js";
8
- import { TimestampField as s } from "./TimestampField.js";
9
- import { BoolField as c } from "./BoolField.js";
10
- import { NumberField as l } from "./NumberField.js";
11
- import { RefField as u } from "./RefField.js";
12
- import { JsonField as d } from "./JsonField.js";
13
- import { MultilangField as f } from "./MultilangField.js";
14
- import { MultilangTextField as p } from "./MultilangTextField.js";
15
- import { MultilangArrayField as m } from "./MultilangArrayField.js";
16
- import { StructureField as h } from "./StructureField.js";
17
- import { SecretField as g } from "./SecretField.js";
18
- import { PasswordField as _ } from "./PasswordField.js";
19
- import { StringArrayField as v } from "./StringArrayField.js";
20
- import { IntArrayField as y } from "./IntArrayField.js";
21
- import { RichTextField as b } from "./RichTextField.js";
22
- import { FileReferenceField as x } from "./FileReferenceField.js";
23
- import { resolveCellRenderer as S } from "./cells/registry.js";
24
- import { jsx as C } from "react/jsx-runtime";
5
+ import { ErrorField as i } from "./ErrorField.js";
6
+ import { EmailField as a } from "./EmailField.js";
7
+ import { UrlField as o } from "./UrlField.js";
8
+ import { PhoneField as s } from "./PhoneField.js";
9
+ import { TimestampField as c } from "./TimestampField.js";
10
+ import { BoolField as l } from "./BoolField.js";
11
+ import { NumberField as u } from "./NumberField.js";
12
+ import { RefField as d } from "./RefField.js";
13
+ import { JsonField as f } from "./JsonField.js";
14
+ import { MultilangField as p } from "./MultilangField.js";
15
+ import { MultilangTextField as m } from "./MultilangTextField.js";
16
+ import { MultilangArrayField as h } from "./MultilangArrayField.js";
17
+ import { StructureField as g } from "./StructureField.js";
18
+ import { SecretField as _ } from "./SecretField.js";
19
+ import { PasswordField as v } from "./PasswordField.js";
20
+ import { StringArrayField as y } from "./StringArrayField.js";
21
+ import { IntArrayField as b } from "./IntArrayField.js";
22
+ import { RichTextField as x } from "./RichTextField.js";
23
+ import { FileReferenceField as S } from "./FileReferenceField.js";
24
+ import { resolveCellRenderer as C } from "./cells/registry.js";
25
+ import { jsx as w } from "react/jsx-runtime";
25
26
  // src/components/fields/index.tsx
26
- var w = {
27
+ var T = {
27
28
  string: t,
28
29
  text: n,
29
- rich_text: b,
30
- int: l,
31
- float: l,
32
- decimal: l,
33
- bool: c,
34
- timestamp: s,
35
- date: s,
36
- time: s,
30
+ rich_text: x,
31
+ int: u,
32
+ float: u,
33
+ decimal: u,
34
+ bool: l,
35
+ timestamp: c,
36
+ date: c,
37
+ time: c,
37
38
  enum: r,
38
- email: i,
39
- url: a,
40
- phone: o,
39
+ error: i,
40
+ email: a,
41
+ url: o,
42
+ phone: s,
41
43
  uuid: t,
42
44
  bytes: t,
43
- ref: u,
44
- file_ref: x,
45
+ ref: d,
46
+ file_ref: S,
45
47
  folder_ref: t,
46
- json: d,
48
+ json: f,
47
49
  tags: t,
48
- string_array: v,
49
- int_array: y,
50
- uuid_array: v,
51
- multilang: f,
52
- multilang_text: p,
53
- multilang_array: m,
54
- structure: h,
55
- secret: g,
56
- password: _
50
+ string_array: y,
51
+ int_array: b,
52
+ uuid_array: y,
53
+ multilang: p,
54
+ multilang_text: m,
55
+ multilang_array: h,
56
+ structure: g,
57
+ secret: _,
58
+ password: v
57
59
  };
58
- for (let t of e) if (!w[t]) throw Error(`editRegistry: missing entry for FieldType "${t}". The FieldType union and editRegistry must cover every field type the server declares.`);
59
- function T(e) {
60
- if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ C(h, { ...e });
60
+ for (let t of e) if (!T[t]) throw Error(`editRegistry: missing entry for FieldType "${t}". The FieldType union and editRegistry must cover every field type the server declares.`);
61
+ function E(e) {
62
+ if (e.field.type === "json" && e.field.structure) return /* @__PURE__ */ w(g, { ...e });
61
63
  if (e.mode === "edit") {
62
- let t = w[e.field.type];
64
+ let t = T[e.field.type];
63
65
  if (!t) throw Error(`renderField: no edit-mode renderer for FieldType "${e.field.type}" (field "${e.fieldName}"). editRegistry must be total over FieldType; check types/fieldType.ts and components/fields/index.tsx.`);
64
- return /* @__PURE__ */ C(t, { ...e });
66
+ return /* @__PURE__ */ w(t, { ...e });
65
67
  }
66
68
  if (!e.field.display?.widget) throw Error(`renderField: display mode requires a non-empty field.display.widget (field "${e.fieldName}", type "${e.field.type}"). The engine must stamp a smart default; an empty widget here means the field bypassed ResolveDefaultWidgets.`);
67
- return S({
69
+ return C({
68
70
  field: e.field,
69
71
  fieldName: e.fieldName,
70
72
  surface: e.surface ?? "detail",
@@ -77,4 +79,4 @@ function T(e) {
77
79
  detailScreen: e.detailScreen
78
80
  })(e.value, e.record ?? {});
79
81
  }
80
- export { w as editRegistry, T as renderField };
82
+ export { T as editRegistry, E as renderField };