@declarion/react 0.66.1 → 0.81.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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/api/auth.js +24 -14
  3. package/dist-lib/app.js +28 -23
  4. package/dist-lib/components/chrome/AssociationTabs.js +35 -38
  5. package/dist-lib/components/chrome/HighlightsStrip.js +2 -1
  6. package/dist-lib/components/chrome/RecordHeader.js +33 -38
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +10 -21
  8. package/dist-lib/components/detail-layout/ChildrenBlock.js +1 -8
  9. package/dist-lib/components/detail-layout/ChildrenCards.js +1 -8
  10. package/dist-lib/components/detail-layout/ChildrenList.js +1 -8
  11. package/dist-lib/components/detail-layout/ChildrenTable.js +1 -8
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +1 -8
  13. package/dist-lib/components/detail-layout/DetailAuditStrip.js +33 -29
  14. package/dist-lib/components/detail-layout/DetailHighlights.js +7 -2
  15. package/dist-lib/components/detail-layout/FieldsBlock.js +12 -9
  16. package/dist-lib/components/detail-layout/LayoutRenderer.js +10 -10
  17. package/dist-lib/components/detail-layout/LayoutTabs.js +49 -48
  18. package/dist-lib/components/detail-layout/SectionBlock.js +20 -28
  19. package/dist-lib/components/detail-layout/visibility.js +28 -0
  20. package/dist-lib/components/fields/IntArrayField.js +37 -33
  21. package/dist-lib/components/fields/NumberField.js +28 -55
  22. package/dist-lib/components/fields/RichTextField.js +1 -1
  23. package/dist-lib/components/fields/TimestampField.js +50 -89
  24. package/dist-lib/components/fields/cells/factories/date.js +13 -14
  25. package/dist-lib/components/fields/cells/factories/money.js +1 -1
  26. package/dist-lib/components/fields/cells/factories/number.js +4 -4
  27. package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
  28. package/dist-lib/components/file-widgets/Grid.js +153 -152
  29. package/dist-lib/components/file-widgets/ImageWidget.js +90 -91
  30. package/dist-lib/components/file-widgets/LabeledSlots.js +1 -0
  31. package/dist-lib/components/file-widgets/helpers.js +15 -19
  32. package/dist-lib/components/file-widgets/host.js +33 -32
  33. package/dist-lib/components/file-widgets/upload.js +10 -6
  34. package/dist-lib/components/layout/Layout.js +125 -123
  35. package/dist-lib/components/pages/NoScreensPage.impl.js +14 -0
  36. package/dist-lib/components/pages/NoScreensPage.js +12 -0
  37. package/dist-lib/components/pages/SmartDetailPage.impl.js +451 -451
  38. package/dist-lib/components/pages/auth/AuthShell.js +62 -61
  39. package/dist-lib/components/pages/auth/CodeInput.js +63 -0
  40. package/dist-lib/components/pages/auth/SignIn.js +12 -4
  41. package/dist-lib/components/pages/auth/SignUp.impl.js +80 -103
  42. package/dist-lib/components/pages/auth/SignUpCode.js +122 -0
  43. package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -55
  44. package/dist-lib/components/pages/list/cardProjection.js +135 -122
  45. package/dist-lib/components/pages/list/columns.js +58 -43
  46. package/dist-lib/components/pages/profile/Profile.impl.js +87 -104
  47. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -1
  48. package/dist-lib/components/params/ParamsBlock.js +6 -17
  49. package/dist-lib/components/params/param-editors.js +14 -10
  50. package/dist-lib/components/primitives/Fields.js +314 -236
  51. package/dist-lib/components/shared/MarkdownRenderer.js +44 -43
  52. package/dist-lib/declarion-react.css +1 -1
  53. package/dist-lib/hooks/useActiveTabFollowsRoute.js +49 -0
  54. package/dist-lib/hooks/useAuth.js +44 -37
  55. package/dist-lib/hooks/useDocumentTitle.js +20 -0
  56. package/dist-lib/hooks/useFollowAgentOpen.js +1 -0
  57. package/dist-lib/hooks/useTabTitle.js +1 -1
  58. package/dist-lib/index.d.ts +21 -7
  59. package/dist-lib/lib/date-text.js +57 -0
  60. package/dist-lib/lib/number-text.js +9 -0
  61. package/dist-lib/lib/timestamp.js +29 -29
  62. package/dist-lib/stores/tabs.js +7 -5
  63. package/dist-lib/testing.d.ts +1 -1
  64. package/dist-lib/testing.js +1 -0
  65. package/dist-lib/{useResponsiveMode-DmrpMbZX.d.ts → useResponsiveMode-D3SKz5z4.d.ts} +20 -9
  66. package/package.json +11 -11
@@ -11,25 +11,25 @@ import { useText as u } from "../../../hooks/useText.js";
11
11
  import { SectionCard as d } from "../../primitives/SectionCard.js";
12
12
  import { useResponsiveMode as f } from "../../../hooks/useResponsiveMode.js";
13
13
  import { Spinner as p } from "../../primitives/Spinner.js";
14
- import { FieldLabel as m, Select as h, TextInput as g } from "../../primitives/Fields.js";
15
- import { DynamicIcon as _ } from "../../shared/DynamicIcon.js";
16
- import { updateEntity as v } from "../../../api/data.js";
17
- import { failureTitle as y } from "../../../lib/failure.js";
18
- import { useAllParams as b, useCarrierParamOverrides as x } from "../../../hooks/useParams.js";
19
- import { useTabNavigate as S } from "../../../hooks/useTabNavigate.js";
20
- import { toast as C } from "../../../lib/toast.js";
21
- import { useBrandingChrome as w } from "../../../hooks/useBrandingChrome.js";
22
- import { useCurrentScreen as T } from "../../../hooks/useCurrentScreen.js";
23
- import { useObject as E } from "../../../hooks/useObject.js";
24
- import { FileDraftScope as D, useFileDraftScope as O } from "../../file-widgets/draft-scope.js";
25
- import { singleFileFromValue as k } from "../../file-widgets/value.js";
26
- import { getFileFieldValue as A, renderSchemaField as j } from "../../file-widgets/host.js";
27
- import { buildFilesPayload as M } from "../../file-widgets/payload.js";
28
- import { EMPTY_CELL as ee } from "../../fields/cells/factories/emptyCell.js";
29
- import { ChangePasswordDialog as N } from "../../shared/ChangePasswordDialog.js";
30
- import { AssociatedBlock as P } from "../../detail-layout/AssociatedBlock.js";
31
- import { FieldRow as F, FieldsGrid as I } from "../../detail-layout/FieldRow.js";
32
- import { DetailAuditStrip as te } from "../../detail-layout/DetailAuditStrip.js";
14
+ import { FieldLabel as m, TextInput as h } from "../../primitives/Fields.js";
15
+ import { DynamicIcon as g } from "../../shared/DynamicIcon.js";
16
+ import { updateEntity as _ } from "../../../api/data.js";
17
+ import { failureTitle as v } from "../../../lib/failure.js";
18
+ import { useAllParams as y } from "../../../hooks/useParams.js";
19
+ import { useTabNavigate as b } from "../../../hooks/useTabNavigate.js";
20
+ import { toast as x } from "../../../lib/toast.js";
21
+ import { useBrandingChrome as S } from "../../../hooks/useBrandingChrome.js";
22
+ import { useCurrentScreen as C } from "../../../hooks/useCurrentScreen.js";
23
+ import { useObject as w } from "../../../hooks/useObject.js";
24
+ import { FileDraftScope as T, useFileDraftScope as E } from "../../file-widgets/draft-scope.js";
25
+ import { singleFileFromValue as D } from "../../file-widgets/value.js";
26
+ import { getFileFieldValue as O, renderSchemaField as k } from "../../file-widgets/host.js";
27
+ import { buildFilesPayload as A } from "../../file-widgets/payload.js";
28
+ import { EMPTY_CELL as j } from "../../fields/cells/factories/emptyCell.js";
29
+ import { ChangePasswordDialog as M } from "../../shared/ChangePasswordDialog.js";
30
+ import { FieldRow as N, FieldsGrid as P } from "../../detail-layout/FieldRow.js";
31
+ import { AssociatedBlock as F } from "../../detail-layout/AssociatedBlock.js";
32
+ import { DetailAuditStrip as I } from "../../detail-layout/DetailAuditStrip.js";
33
33
  import { RecordHeader as L } from "../../chrome/RecordHeader.js";
34
34
  import { PageShell as R } from "../../chrome/PageShell.js";
35
35
  import { ErrorLine as z } from "../../params/param-editors.js";
@@ -39,8 +39,8 @@ import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
39
39
  //#region src/components/pages/profile/Profile.impl.tsx
40
40
  var q = "profile", J = "avatar";
41
41
  function Y() {
42
- let r = S(), s = t((e) => e.user), f = t((e) => e.activeTenant), p = t((e) => e.refreshMe), { data: m } = n(), h = T(), g = w("custom"), v = u(), y = E(q, s?.id), b = y.data?.data, [x, O] = U(!1), [k, A] = U(!1), M = m?.entities[q], P = s?.display_name || s?.email || v("profile.user_fallback", "User"), z = s?.roles && s.roles[0] || v("profile.role_fallback", "Member"), B = f?.env ? `${f.name} · ${f.env}` : f?.name ?? "—", V = (e) => M && j({
43
- entity: M,
42
+ let r = b(), s = t((e) => e.user), f = t((e) => e.activeTenant), p = t((e) => e.refreshMe), { data: m } = n(), h = C(), _ = S("custom"), v = u(), y = w(q, s?.id), E = y.data?.data, [D, O] = U(!1), [A, F] = U(!1), z = m?.entities[q], B = s?.display_name || s?.email || v("profile.user_fallback", "User"), V = (e) => s?.role_names?.[e] || e, H = s?.roles?.[0] && V(s.roles[0]) || v("profile.role_fallback", "Member"), J = f?.env ? `${f.name} · ${f.env}` : f?.name ?? "—", Y = (e) => z && k({
43
+ entity: z,
44
44
  entityCode: q,
45
45
  fieldName: e,
46
46
  record: {
@@ -55,14 +55,13 @@ function Y() {
55
55
  header: /* @__PURE__ */ G("div", {
56
56
  "data-testid": "profile-hero",
57
57
  children: /* @__PURE__ */ G(L, {
58
- icon: M?.display.icon ? /* @__PURE__ */ G(_, {
59
- name: M.display.icon,
58
+ icon: z?.display.icon ? /* @__PURE__ */ G(g, {
59
+ name: z.display.icon,
60
60
  size: 16
61
61
  }) : void 0,
62
- title: P,
63
- recordId: s?.id,
62
+ title: B,
64
63
  mode: "display",
65
- showTitle: g.isVisible("show_title"),
64
+ showTitle: _.isVisible("show_title"),
66
65
  highlights: /* @__PURE__ */ K("div", {
67
66
  className: "flex flex-wrap gap-1",
68
67
  children: [
@@ -70,12 +69,12 @@ function Y() {
70
69
  tone: "violet",
71
70
  size: "xs",
72
71
  dot: !0,
73
- children: z
72
+ children: H
74
73
  }),
75
74
  /* @__PURE__ */ G(c, {
76
75
  tone: "slate",
77
76
  size: "xs",
78
- children: B
77
+ children: J
79
78
  }),
80
79
  s?.is_active && /* @__PURE__ */ G(c, {
81
80
  tone: "emerald",
@@ -85,9 +84,9 @@ function Y() {
85
84
  })
86
85
  ]
87
86
  }),
88
- right: g.isVisible("show_actions") && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(o, {
87
+ right: _.isVisible("show_actions") && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(o, {
89
88
  icon: /* @__PURE__ */ G(a.edit, { size: 13 }),
90
- onClick: () => A(!0),
89
+ onClick: () => F(!0),
91
90
  children: v("profile.edit", "Edit profile")
92
91
  }), /* @__PURE__ */ G(o, {
93
92
  icon: /* @__PURE__ */ G(a.settings, { size: 13 }),
@@ -102,39 +101,39 @@ function Y() {
102
101
  icon: /* @__PURE__ */ G(a.users, { size: 14 }),
103
102
  children: /* @__PURE__ */ G("div", {
104
103
  "data-testid": "profile-personal-info-grid",
105
- children: /* @__PURE__ */ K(I, { children: [
106
- s && M && b && /* @__PURE__ */ G(F, {
104
+ children: /* @__PURE__ */ K(P, { children: [
105
+ s && z && E && /* @__PURE__ */ G(N, {
107
106
  label: v("profile.avatar", "Avatar"),
108
- children: /* @__PURE__ */ G(D, { children: /* @__PURE__ */ G(Z, {
107
+ children: /* @__PURE__ */ G(T, { children: /* @__PURE__ */ G(Z, {
109
108
  userId: s.id,
110
- entity: M,
111
- record: b,
109
+ entity: z,
110
+ record: E,
112
111
  onCommitted: async () => {
113
112
  await y.refetch();
114
113
  }
115
- }, X(b)) })
114
+ }, X(E)) })
116
115
  }),
117
- /* @__PURE__ */ G(F, {
116
+ /* @__PURE__ */ G(N, {
118
117
  label: v("profile.display_name", "Display name"),
119
- children: V("display_name")
118
+ children: Y("display_name")
120
119
  }),
121
- /* @__PURE__ */ G(F, {
120
+ /* @__PURE__ */ G(N, {
122
121
  label: v("profile.personal.email", "Email"),
123
122
  "data-testid": "profile-email",
124
- children: V("email")
123
+ children: Y("email")
125
124
  }),
126
- /* @__PURE__ */ G(F, {
125
+ /* @__PURE__ */ G(N, {
127
126
  label: v("profile.personal.timezone", "Timezone"),
128
- children: re()
127
+ children: te()
129
128
  }),
130
- s?.id && /* @__PURE__ */ G($, { userId: s.id })
129
+ /* @__PURE__ */ G($, {})
131
130
  ] })
132
131
  })
133
132
  }),
134
133
  /* @__PURE__ */ G(d, {
135
134
  title: v("profile.security.title", "Security"),
136
135
  icon: /* @__PURE__ */ G(a.shield, { size: 14 }),
137
- children: /* @__PURE__ */ G(I, { children: /* @__PURE__ */ G(F, {
136
+ children: /* @__PURE__ */ G(P, { children: /* @__PURE__ */ G(N, {
138
137
  label: v("profile.security.password", "Password"),
139
138
  hint: v("profile.security.password_hint", "Update at any time"),
140
139
  children: /* @__PURE__ */ G(o, {
@@ -147,24 +146,24 @@ function Y() {
147
146
  /* @__PURE__ */ G(d, {
148
147
  title: v("profile.access.title", "Access"),
149
148
  icon: /* @__PURE__ */ G(a.key, { size: 14 }),
150
- children: /* @__PURE__ */ K(I, { children: [
151
- /* @__PURE__ */ G(F, {
149
+ children: /* @__PURE__ */ K(P, { children: [
150
+ /* @__PURE__ */ G(N, {
152
151
  label: v("profile.access.role", "Role"),
153
152
  children: /* @__PURE__ */ G(c, {
154
153
  tone: "violet",
155
154
  size: "xs",
156
155
  dot: !0,
157
- children: z
156
+ children: H
158
157
  })
159
158
  }),
160
- /* @__PURE__ */ G(F, {
159
+ /* @__PURE__ */ G(N, {
161
160
  label: v("profile.access.groups", "Groups"),
162
161
  children: s?.roles && s.roles.length > 0 ? /* @__PURE__ */ G("div", {
163
162
  className: "flex flex-wrap gap-1",
164
- children: s.roles.map((e) => /* @__PURE__ */ G(l, { children: e }, e))
165
- }) : ee
163
+ children: s.roles.map((e) => /* @__PURE__ */ G(l, { children: V(e) }, e))
164
+ }) : j
166
165
  }),
167
- /* @__PURE__ */ G(F, {
166
+ /* @__PURE__ */ G(N, {
168
167
  label: v("profile.access.permissions", "Permissions"),
169
168
  children: i(v, "profile.access.permissions_explicit", s?.permissions?.length ?? 0, {
170
169
  one: "{count} explicit",
@@ -173,41 +172,42 @@ function Y() {
173
172
  })
174
173
  ] })
175
174
  }),
176
- /* @__PURE__ */ G(ie, { userId: s?.id }),
175
+ /* @__PURE__ */ G(ne, { userId: s?.id }),
177
176
  s?.id && /* @__PURE__ */ G(Q, { userId: s.id }),
178
- h?.screen && m && M && b && /* @__PURE__ */ G(te, {
177
+ h?.screen && m && z && E && /* @__PURE__ */ G(I, {
179
178
  screen: h.screen,
180
- entity: M,
179
+ entity: z,
181
180
  entityCode: q,
182
- record: b,
181
+ record: E,
182
+ recordId: s?.id,
183
183
  schema: m
184
184
  })
185
185
  ]
186
186
  }),
187
- /* @__PURE__ */ G(ne, {
188
- open: k,
187
+ /* @__PURE__ */ G(ee, {
188
+ open: A,
189
189
  initialName: s?.display_name ?? "",
190
190
  userId: s?.id ?? "",
191
- onClose: () => A(!1),
191
+ onClose: () => F(!1),
192
192
  onSaved: async () => {
193
- await p(), A(!1);
193
+ await p(), F(!1);
194
194
  }
195
195
  }),
196
- /* @__PURE__ */ G(N, {
197
- open: x,
196
+ /* @__PURE__ */ G(M, {
197
+ open: D,
198
198
  onClose: () => O(!1),
199
199
  onSubmit: async ({ current: t, next: n }) => {
200
- await e(t, n), C.success(v("profile.password.changed", "Password changed. Sign in again to continue."));
200
+ await e(t, n), x.success(v("profile.password.changed", "Password changed. Sign in again to continue."));
201
201
  }
202
202
  })
203
203
  ] });
204
204
  }
205
205
  function X(e) {
206
- return k(A(e, J))?.id ?? "";
206
+ return D(O(e, J))?.id ?? "";
207
207
  }
208
208
  function Z({ userId: e, entity: t, record: n, onCommitted: r }) {
209
- let i = u(), a = u("errors"), o = O(), [s, c] = U(!1), [l, d] = U(0), f = async (s) => {
210
- let l = M({
209
+ let i = u(), a = u("errors"), o = E(), [s, c] = U(!1), [l, d] = U(0), f = async (s) => {
210
+ let l = A({
211
211
  entity: t,
212
212
  formData: { [J]: s },
213
213
  record: n,
@@ -216,17 +216,17 @@ function Z({ userId: e, entity: t, record: n, onCommitted: r }) {
216
216
  if (Object.keys(l).length !== 0) {
217
217
  c(!0);
218
218
  try {
219
- await v(q, { id: e }, { $files: l });
219
+ await _(q, { id: e }, { $files: l });
220
220
  let t = X({ [J]: s });
221
- t && o.markCommitted(t), await r(), C.success(i("profile.avatar.updated", "Avatar updated."));
221
+ t && o.markCommitted(t), await r(), x.success(i("profile.avatar.updated", "Avatar updated."));
222
222
  } catch (e) {
223
- await o.flushAllDrafts(), d((e) => e + 1), C.error(y(a, e));
223
+ await o.flushAllDrafts(), d((e) => e + 1), x.error(v(a, e));
224
224
  } finally {
225
225
  c(!1);
226
226
  }
227
227
  }
228
228
  };
229
- return /* @__PURE__ */ G(V, { children: j({
229
+ return /* @__PURE__ */ G(V, { children: k({
230
230
  entity: t,
231
231
  entityCode: q,
232
232
  fieldName: J,
@@ -238,8 +238,8 @@ function Z({ userId: e, entity: t, record: n, onCommitted: r }) {
238
238
  fieldId: "profile-avatar"
239
239
  }) }, l);
240
240
  }
241
- function ne({ open: e, initialName: t, userId: n, onClose: r, onSaved: i }) {
242
- let c = f().isPhone, l = u(), d = u("errors"), h = H(), [_, b] = U(t), [x, S] = U(!1), [C, w] = U(null);
241
+ function ee({ open: e, initialName: t, userId: n, onClose: r, onSaved: i }) {
242
+ let c = f().isPhone, l = u(), d = u("errors"), g = H(), [y, b] = U(t), [x, S] = U(!1), [C, w] = U(null);
243
243
  if (!e) return null;
244
244
  let T = () => {
245
245
  b(t), w(null), r();
@@ -324,11 +324,11 @@ function ne({ open: e, initialName: t, userId: n, onClose: r, onSaved: i }) {
324
324
  },
325
325
  children: [/* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(m, {
326
326
  required: !0,
327
- htmlFor: h,
327
+ htmlFor: g,
328
328
  children: l("profile.display_name", "Display name")
329
- }), /* @__PURE__ */ G(g, {
330
- id: h,
331
- value: _,
329
+ }), /* @__PURE__ */ G(h, {
330
+ id: g,
331
+ value: y,
332
332
  onChange: b,
333
333
  placeholder: l("profile.edit.name_placeholder", "Your name"),
334
334
  autoFocus: !0
@@ -354,19 +354,19 @@ function ne({ open: e, initialName: t, userId: n, onClose: r, onSaved: i }) {
354
354
  kind: "primary",
355
355
  icon: G(x ? p : a.check, { size: 13 }),
356
356
  onClick: async () => {
357
- if (!_.trim()) w(l("profile.edit.name_required", "Display name is required."));
357
+ if (!y.trim()) w(l("profile.edit.name_required", "Display name is required."));
358
358
  else {
359
359
  w(null), S(!0);
360
360
  try {
361
- await v(q, { id: n }, { display_name: _.trim() }), await i();
361
+ await _(q, { id: n }, { display_name: y.trim() }), await i();
362
362
  } catch (e) {
363
- w(y(d, e));
363
+ w(v(d, e));
364
364
  } finally {
365
365
  S(!1);
366
366
  }
367
367
  }
368
368
  },
369
- disabled: !_.trim() || x,
369
+ disabled: !y.trim() || x,
370
370
  children: x ? l("dialog.saving", "Saving…") : l("dialog.save", "Save")
371
371
  })
372
372
  ]
@@ -374,7 +374,7 @@ function ne({ open: e, initialName: t, userId: n, onClose: r, onSaved: i }) {
374
374
  ]
375
375
  })] });
376
376
  }
377
- function re() {
377
+ function te() {
378
378
  try {
379
379
  return Intl.DateTimeFormat().resolvedOptions().timeZone || "—";
380
380
  } catch {
@@ -389,35 +389,18 @@ function Q({ userId: e }) {
389
389
  rowId: e
390
390
  });
391
391
  }
392
- function $({ userId: e }) {
393
- let t = u(), { data: i } = n(), a = b().data?.find((e) => e.code === r), o = i?.entities[q]?.params_scope ?? q, s = !!a?.scopes?.includes(o), { save: c, error: l, isLoading: d } = x({
394
- carrierEntityCode: q,
395
- rowId: e,
396
- enabled: s
397
- }), [f, m] = U(!1), g = (i?.languages ?? []).map((e) => ({
398
- value: e.code,
399
- label: e.name[e.code] || t(e.name) || e.code
400
- })), _ = typeof a?.value == "string" ? a.value : t.language, v = async (e) => {
401
- a && e !== _ && (m(!0), await c(a, e), m(!1));
402
- };
403
- return /* @__PURE__ */ G(F, {
404
- label: t(a?.name),
405
- mode: s ? "edit" : "display",
406
- error: l ?? void 0,
407
- children: !a || d ? /* @__PURE__ */ G(p, { size: 12 }) : s ? /* @__PURE__ */ G(h, {
408
- "data-testid": "profile-language",
409
- value: _,
410
- options: g,
411
- disabled: f,
412
- onChange: (e) => void v(e)
413
- }) : g.find((e) => e.value === _)?.label ?? _
392
+ function $() {
393
+ let e = u(), { data: t } = n(), i = y().data?.find((e) => e.code === r), a = typeof i?.value == "string" ? i.value : e.language, o = t?.languages?.find((e) => e.code === a);
394
+ return /* @__PURE__ */ G(N, {
395
+ label: e(i?.name),
396
+ children: i ? o?.name[o.code] || e(o?.name) || a : /* @__PURE__ */ G(p, { size: 12 })
414
397
  });
415
398
  }
416
- function ie({ userId: e }) {
399
+ function ne({ userId: e }) {
417
400
  let { data: t } = n();
418
401
  if (!e || !t) return null;
419
402
  let r = t.entities[q];
420
- return r ? /* @__PURE__ */ G(P, {
403
+ return r ? /* @__PURE__ */ G(F, {
421
404
  node: {
422
405
  associated: "api_key",
423
406
  foreign_key: "user_id"
@@ -201,7 +201,7 @@ function E(E) {
201
201
  /* @__PURE__ */ x(O, { children: /* @__PURE__ */ x(h, {
202
202
  type: e.type,
203
203
  value: e.value,
204
- structure: e.structure
204
+ values: e.values
205
205
  }) }),
206
206
  /* @__PURE__ */ x(O, { children: /* @__PURE__ */ S("span", {
207
207
  style: {
@@ -46,30 +46,19 @@ function y({ carrierEntityCode: y, carrierScope: b, rowId: x, title: S, icon: C
46
46
  gap: 10
47
47
  },
48
48
  children: [
49
- /* @__PURE__ */ g("div", {
49
+ /* @__PURE__ */ h("div", {
50
50
  style: {
51
51
  flex: 1,
52
- minWidth: 0
52
+ minWidth: 0,
53
+ fontSize: 12.5,
54
+ fontWeight: 500
53
55
  },
54
- children: [/* @__PURE__ */ h("div", {
55
- style: {
56
- fontSize: 12.5,
57
- fontWeight: 500
58
- },
59
- children: w(i.name) || i.code
60
- }), /* @__PURE__ */ h("div", {
61
- className: "mono",
62
- style: {
63
- fontSize: 11,
64
- color: "var(--text-3)"
65
- },
66
- children: i.code
67
- })]
56
+ children: w(i.name) || i.code
68
57
  }),
69
58
  /* @__PURE__ */ h(d, {
70
59
  type: i.type,
71
60
  value: i.value,
72
- structure: i.structure
61
+ values: i.values
73
62
  }),
74
63
  s && /* @__PURE__ */ h(r, {
75
64
  tone: "violet",
@@ -36,21 +36,25 @@ function m({ text: e }) {
36
36
  children: [/* @__PURE__ */ u(n.info, { size: 13 }), /* @__PURE__ */ u("span", { children: e })]
37
37
  });
38
38
  }
39
- function h({ type: n, value: r, structure: a }) {
40
- let o = i(), s;
41
- if (r == null) s = "—";
42
- else if (n === "bool") s = r ? o("params.value.on", "On") : o("params.value.off", "Off");
43
- else if (n === "multilang" || n === "multilang_text") s = o(r) || "—";
44
- else if (n === "multilang_array" && Array.isArray(r)) s = r.map((e) => o(e)).join(", ") || "—";
39
+ function h({ type: n, value: r, values: a }) {
40
+ let o = i(), s = (t) => {
41
+ let n = a?.find((e) => e.code === t);
42
+ return n && o(n.name) || e(t);
43
+ }, c;
44
+ if (r == null) c = "—";
45
+ else if (a && a.length > 0) c = (Array.isArray(r) ? r.map(s).join(", ") : s(r)) || "—";
46
+ else if (n === "bool") c = r ? o("params.value.on", "On") : o("params.value.off", "Off");
47
+ else if (n === "multilang" || n === "multilang_text") c = o(r) || "—";
48
+ else if (n === "multilang_array" && Array.isArray(r)) c = r.map((e) => o(e)).join(", ") || "—";
45
49
  else if (n === "json" || n === "structure") {
46
50
  if (r && typeof r == "object") {
47
51
  let e = Array.isArray(r) ? r.length : Object.keys(r).length;
48
- s = a || `{${t(o, "params.value.keys", e, {
52
+ c = `{${t(o, "params.value.keys", e, {
49
53
  one: "{count} key",
50
54
  other: "{count} keys"
51
55
  })}}`;
52
- } else s = e(r);
53
- } else s = e(r);
56
+ } else c = e(r);
57
+ } else c = e(r);
54
58
  return /* @__PURE__ */ u("span", {
55
59
  className: "mono",
56
60
  style: {
@@ -61,7 +65,7 @@ function h({ type: n, value: r, structure: a }) {
61
65
  textOverflow: "ellipsis",
62
66
  whiteSpace: "nowrap"
63
67
  },
64
- children: s
68
+ children: c
65
69
  });
66
70
  }
67
71
  function g({ param: e, current: t, error: s, onCancel: f, onSave: p }) {