@synopackageland/ui 0.12.5 → 0.13.1

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 (49) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +25 -0
  3. package/dist/components/advanced-panel/AdvancePanelGrid.vue.d.ts +5 -5
  4. package/dist/components/app/app-layout/AppLayout.vue.d.ts +8 -1
  5. package/dist/components/app/app-sidebar/AppTopNavItems.vue.d.ts +12 -0
  6. package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +5 -4
  7. package/dist/components/composite/about-dialog/types.d.ts +3 -2
  8. package/dist/components/composite/connection-topology/ConnectionTopology.vue.d.ts +3 -0
  9. package/dist/components/composite/data-grid/DataGrid.vue.d.ts +1 -1
  10. package/dist/components/composite/data-table/DataTable.vue.d.ts +6 -3
  11. package/dist/components/composite/overflow-toolbar/overflow.d.ts +3 -1
  12. package/dist/components/composite/scroll-edges/ScrollEdges.vue.d.ts +8 -1
  13. package/dist/components/composite/tree-view/TreeView.vue.d.ts +7 -5
  14. package/dist/components/composite/virtual-list/VirtualList.vue.d.ts +2 -0
  15. package/dist/components/containers/card-grid/cardGrid.d.ts +2 -2
  16. package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +7 -7
  17. package/dist/components/primitives/color-picker/ColorPicker.vue.d.ts +4 -4
  18. package/dist/components/primitives/context-menu/ContextMenu.vue.d.ts +2 -2
  19. package/dist/components/primitives/context-menu/ContextMenuItems.vue.d.ts +5 -1
  20. package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +3 -0
  21. package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +3 -0
  22. package/dist/components/primitives/pagination/Pagination.vue.d.ts +3 -0
  23. package/dist/components/primitives/segment-control/SegmentItem.vue.d.ts +1 -1
  24. package/dist/components/primitives/spinner/Spinner.vue.d.ts +3 -0
  25. package/dist/components/primitives/tooltip/OverflowTooltip.vue.d.ts +3 -0
  26. package/dist/components/primitives/tooltip/Tooltip.vue.d.ts +5 -2
  27. package/dist/components/primitives/tooltip/tooltipStyle.d.ts +1 -1
  28. package/dist/components/primitives/typography/TypoHeader.vue.d.ts +3 -0
  29. package/dist/composables/formControl.d.ts +1 -0
  30. package/dist/composables/scrollEdges.d.ts +8 -4
  31. package/dist/i18n/text.d.ts +1 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.js +18248 -22043
  34. package/dist/json/catalog.d.ts +18 -10
  35. package/dist/json/registry.d.ts +306 -170
  36. package/dist/json-ai-prompt.md +1 -1
  37. package/dist/json-catalog.schema.json +15 -1
  38. package/dist/json-preview/preview.js +11770 -10312
  39. package/dist/json.js +319 -335
  40. package/dist/lib/adaptiveLayout.d.ts +4 -0
  41. package/dist/reka-runtime.json +1 -1
  42. package/dist/theme.css +1 -1
  43. package/dist/themes/dsm7-embedded-theme.css +1 -1
  44. package/dist/themes/dsm7-embedded.css +1 -1
  45. package/dist/themes/dsm7.css +1 -1
  46. package/docs/adaptive-layout.md +5 -0
  47. package/docs/json-ui.md +2 -0
  48. package/docs/theme-hooks.md +142 -0
  49. package/package.json +3 -2
package/dist/json.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { z as t } from "zod";
2
- import { z as jt } from "zod";
3
- import { defineCatalog as V } from "@json-render/core";
4
- import { createStateStore as xt, defineCatalog as Ot } from "@json-render/core";
5
- import { defineRegistry as z, useBoundProp as b, Renderer as F, JSONUIProvider as M } from "@json-render/vue";
6
- import { ActionProvider as Pt, JSONUIProvider as _t, Renderer as kt, StateProvider as Ct, ValidationProvider as Rt, VisibilityProvider as It, defineRegistry as Kt, useActions as Lt, useBoundProp as Ut, useStateStore as Dt } from "@json-render/vue";
7
- import { schema as W } from "@json-render/vue/schema";
8
- import { schema as qt } from "@json-render/vue/schema";
9
- import { h as d, defineComponent as B, openBlock as H, createBlock as G, withCtx as X, createVNode as Y } from "vue";
10
- import { LoadingArea as Q, InputGroup as Z, ListItem as ee, CellStatus as te, CellText as oe, DataTable as R, Dialog as ne, Badge as ie, Progress as se, EmptyState as ae, Callout as re, Card as le, Surface as ce, SettingsRow as de, SettingsSection as pe, FormItem as ue, Form as me, RadioGroup as he, Switch as fe, Checkbox as ge, Select as be, Input as ye, Button as we, SectionTabs as ve, AppSidebar as Se, AppToolbar as je, PageHeader as $e, PageContent as xe, ResponsiveView as Oe, AppLayout as Ae, AppRoot as Pe, getRegisteredIcon as _e } from "./index.js";
2
+ import { z as vt } from "zod";
3
+ import { defineCatalog as F } from "@json-render/core";
4
+ import { createStateStore as $t, defineCatalog as jt } from "@json-render/core";
5
+ import { defineRegistry as M, useBoundProp as b, JSONUIProvider as W, Renderer as B } from "@json-render/vue";
6
+ import { ActionProvider as Ot, JSONUIProvider as At, Renderer as Pt, StateProvider as kt, ValidationProvider as Ct, VisibilityProvider as It, defineRegistry as Rt, useActions as Kt, useBoundProp as Lt, useStateStore as Dt } from "@json-render/vue";
7
+ import { schema as H } from "@json-render/vue/schema";
8
+ import { schema as Nt } from "@json-render/vue/schema";
9
+ import { h as d, defineComponent as G, openBlock as X, createBlock as Y, unref as j, withCtx as Q, createVNode as Z } from "vue";
10
+ import { LoadingArea as ee, InputGroup as te, ListItem as oe, CellStatus as ne, CellText as ie, DataTable as K, Dialog as ae, Badge as se, Progress as re, EmptyState as le, Callout as ce, Card as de, Surface as pe, SettingsRow as ue, SettingsSection as me, FormItem as he, Form as fe, RadioGroup as ge, Switch as be, Checkbox as ye, Select as we, Input as ve, Button as Se, SectionTabs as $e, AppSidebar as je, AppToolbar as xe, PageHeader as Oe, PageContent as Ae, ResponsiveView as Pe, AppLayout as ke, AppRoot as Ce, getRegisteredIcon as Ie } from "./index.js";
11
11
  const J = t.lazy(() => t.object({
12
12
  key: t.string(),
13
13
  label: t.string(),
@@ -16,20 +16,20 @@ const J = t.lazy(() => t.object({
16
16
  disabled: t.boolean().optional(),
17
17
  selectable: t.boolean().optional(),
18
18
  children: t.array(J).optional()
19
- })), P = t.object({
19
+ })), k = t.object({
20
20
  label: t.string(),
21
21
  value: t.string(),
22
22
  disabled: t.boolean().optional()
23
- }), ke = P.extend({
23
+ }), Re = k.extend({
24
24
  description: t.string().optional()
25
- }), I = t.object({
25
+ }), L = t.object({
26
26
  key: t.string(),
27
27
  label: t.string(),
28
28
  width: t.string().optional(),
29
29
  /** Sets the alignment: DSM keeps every column left; number and date digits get one width. */
30
30
  type: t.enum(["text", "number", "date", "actions"]).optional(),
31
31
  align: t.enum(["left", "center", "right"]).optional()
32
- }), q = {
32
+ }), V = {
33
33
  AppRoot: {
34
34
  props: t.object({
35
35
  modalScope: t.enum(["document", "app"]).optional()
@@ -42,10 +42,11 @@ const J = t.lazy(() => t.object({
42
42
  sidebarWidth: t.string().optional(),
43
43
  minHeight: t.string().optional(),
44
44
  responsive: t.boolean().optional(),
45
- wideLayout: t.enum(["window", "web"]).optional()
45
+ wideLayout: t.enum(["window", "web"]).optional(),
46
+ navigation: t.enum(["sidebar", "top"]).optional()
46
47
  }),
47
48
  slots: ["default", "sidebar", "toolbar", "footer"],
48
- description: 'DSM application interior with optional sidebar, toolbar, main content and footer regions. Set wideLayout "web" only for a standalone Portal page; DSM windows keep the default "window" at every width.'
49
+ description: `DSM application interior with optional sidebar, toolbar, main content and footer regions. Set wideLayout "web" only for a standalone Portal page; DSM windows keep the default "window" at every width. navigation "top" shows the sidebar slot's SidebarNav as one bar above the page (phones keep the drawer).`
49
50
  },
50
51
  ResponsiveView: {
51
52
  props: t.object({ mode: t.enum(["auto", "mobile", "window", "web"]).optional() }),
@@ -90,7 +91,7 @@ const J = t.lazy(() => t.object({
90
91
  Tabs: {
91
92
  props: t.object({
92
93
  value: t.string(),
93
- items: t.array(P),
94
+ items: t.array(k),
94
95
  ariaLabel: t.string().optional()
95
96
  }),
96
97
  events: ["change"],
@@ -143,7 +144,7 @@ const J = t.lazy(() => t.object({
143
144
  Select: {
144
145
  props: t.object({
145
146
  value: t.string().optional(),
146
- options: t.array(P),
147
+ options: t.array(k),
147
148
  placeholder: t.string().optional(),
148
149
  disabled: t.boolean().optional(),
149
150
  search: t.boolean().optional()
@@ -173,7 +174,7 @@ const J = t.lazy(() => t.object({
173
174
  RadioGroup: {
174
175
  props: t.object({
175
176
  value: t.string().optional(),
176
- options: t.array(ke),
177
+ options: t.array(Re),
177
178
  orientation: t.enum(["vertical", "horizontal"]).optional(),
178
179
  disabled: t.boolean().optional()
179
180
  }),
@@ -295,7 +296,7 @@ const J = t.lazy(() => t.object({
295
296
  },
296
297
  DataTable: {
297
298
  props: t.object({
298
- columns: t.array(I),
299
+ columns: t.array(L),
299
300
  rows: t.array(t.record(t.string(), t.unknown())),
300
301
  rowKey: t.string().optional(),
301
302
  emptyText: t.string().optional(),
@@ -306,7 +307,7 @@ const J = t.lazy(() => t.object({
306
307
  },
307
308
  ResourceList: {
308
309
  props: t.object({
309
- columns: t.array(I),
310
+ columns: t.array(L),
310
311
  rows: t.array(t.record(t.string(), t.unknown())),
311
312
  rowKey: t.string().optional(),
312
313
  emptyText: t.string().optional(),
@@ -355,10 +356,10 @@ const J = t.lazy(() => t.object({
355
356
  props: t.object({ text: t.string().optional() }),
356
357
  description: "Centered loading state for a page or bounded region."
357
358
  }
358
- }, O = V(W, {
359
- components: q,
359
+ }, A = F(H, {
360
+ components: V,
360
361
  actions: {}
361
- }), Ce = [
362
+ }), Ke = [
362
363
  "Prefer AppRoot > AppShell > Page as the normal DSM application hierarchy.",
363
364
  "Prefer SettingsSection and SettingsField for settings; prefer ResourceList/DataTable for ordinary scalar resource collections.",
364
365
  "Keep state in the spec and use $bindState/$bindItem for editable controls; do not invent JavaScript in props.",
@@ -367,69 +368,70 @@ const J = t.lazy(() => t.object({
367
368
  "AppShell adapts to its actual DSM window width: phone (<=600px), desktop window (601–1199px), and wide web/Portal (>=1200px). Never assume browser viewport width.",
368
369
  "For a phone-unfriendly custom view, use ResponsiveView slots: mobile alternative and default full view. Keep essential actions accessible on mobile.",
369
370
  "Use low-level Stack/Text only when a semantic component does not already express the layout."
370
- ], Re = '## Self-check workflow\n\nInstall `@synopackageland/ui` first. Without a local install, use\n`npx -y -p @synopackageland/ui syno-pkg-land-ui <command>` (pin the package version for reproducibility).\n\n1. List components with `npx --no syno-pkg-land-ui catalog`; read props with `npx --no syno-pkg-land-ui describe <Component>`.\n2. Write the spec as JSON: {"root", "elements", "state"}. Seed every state path you bind or read.\n3. Run `npx --no syno-pkg-land-ui validate ui.json --json` (add --actions, --functions, --state, --messages for host-provided names).\n Fix every error at its JSON Pointer `path` using its `hint`, then validate again until it passes.\n4. Run `npx --no syno-pkg-land-ui render ui.json --out shots` to screenshot phone, DSM window and wide widths and to\n report layout overflow; fix reported elements and repeat.\n5. Hand over the spec only when validate and render both exit 0.';
371
- function mt() {
372
- return `${O.prompt({ customRules: Ce })}
371
+ ], Le = '## Self-check workflow\n\nInstall `@synopackageland/ui` first. Without a local install, use\n`npx -y -p @synopackageland/ui syno-pkg-land-ui <command>` (pin the package version for reproducibility).\n\n1. List components with `npx --no syno-pkg-land-ui catalog`; read props with `npx --no syno-pkg-land-ui describe <Component>`.\n2. Write the spec as JSON: {"root", "elements", "state"}. Seed every state path you bind or read.\n3. Run `npx --no syno-pkg-land-ui validate ui.json --json` (add --actions, --functions, --state, --messages for host-provided names).\n Fix every error at its JSON Pointer `path` using its `hint`, then validate again until it passes.\n4. Run `npx --no syno-pkg-land-ui render ui.json --out shots` to screenshot phone, DSM window and wide widths and to\n report layout overflow; fix reported elements and repeat.\n5. Hand over the spec only when validate and render both exit 0.';
372
+ function pt() {
373
+ return `${A.prompt({ customRules: Ke })}
373
374
 
374
- ${Re}
375
+ ${Le}
375
376
  `;
376
377
  }
377
- const Ie = {
378
+ const De = {
378
379
  none: "0",
379
380
  xs: "var(--ui-space-1)",
380
381
  sm: "var(--ui-space-2)",
381
382
  md: "var(--ui-space-3)",
382
383
  lg: "var(--ui-space-4)"
383
- }, Ke = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" }, Le = { start: "flex-start", center: "center", end: "flex-end", between: "space-between" };
384
- function Ue(e) {
384
+ }, Ue = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" }, Ne = { start: "flex-start", center: "center", end: "flex-end", between: "space-between" };
385
+ function Te(e) {
385
386
  return { default: () => e };
386
387
  }
387
- function _(e) {
388
- return e ? _e(e) : void 0;
388
+ function C(e) {
389
+ return e ? Ie(e) : void 0;
389
390
  }
390
- function N(e) {
391
+ function _(e) {
391
392
  return {
392
393
  ...e,
393
- icon: _(e.icon),
394
- children: e.children?.map(N)
394
+ icon: C(e.icon),
395
+ children: e.children?.map(_)
395
396
  };
396
397
  }
397
- function De(e) {
398
- return e.map((o) => ({ ...o, items: o.items.map(N) }));
398
+ function Ee(e) {
399
+ return e.map((o) => ({ ...o, items: o.items.map(_) }));
399
400
  }
400
401
  const Je = {
401
- AppRoot: ({ props: e, slots: o }) => d(Pe, { modalScope: e.modalScope }, o),
402
- AppShell: ({ props: e, slots: o }) => d(Ae, {
402
+ AppRoot: ({ props: e, slots: o }) => d(Ce, { modalScope: e.modalScope }, o),
403
+ AppShell: ({ props: e, slots: o }) => d(ke, {
403
404
  sidebarWidth: e.sidebarWidth,
404
405
  minHeight: e.minHeight,
405
406
  responsive: e.responsive,
406
- wideLayout: e.wideLayout
407
+ wideLayout: e.wideLayout,
408
+ navigation: e.navigation
407
409
  }, o),
408
- ResponsiveView: ({ props: e, slots: o }) => d(Oe, { mode: e.mode }, o),
409
- Page: ({ props: e, slots: o }) => d(xe, { width: e.width ?? "fill", surface: e.surface }, o),
410
- PageHeader: ({ props: e, slots: o }) => d($e, e, o),
411
- Toolbar: ({ props: e, slots: o }) => d(je, e, o),
410
+ ResponsiveView: ({ props: e, slots: o }) => d(Pe, { mode: e.mode }, o),
411
+ Page: ({ props: e, slots: o }) => d(Ae, { width: e.width ?? "fill", surface: e.surface }, o),
412
+ PageHeader: ({ props: e, slots: o }) => d(Oe, e, o),
413
+ Toolbar: ({ props: e, slots: o }) => d(xe, e, o),
412
414
  SidebarNav: ({ props: e, bindings: o, emit: n }) => {
413
- const [s, i] = b(e.value, o?.value);
414
- return d(Se, {
415
- modelValue: s,
416
- groups: De(e.groups),
415
+ const [a, i] = b(e.value, o?.value);
416
+ return d(je, {
417
+ modelValue: a,
418
+ groups: Ee(e.groups),
417
419
  searchable: e.searchable,
418
420
  collapsible: e.collapsible,
419
421
  searchPlaceholder: e.searchPlaceholder,
420
- "onUpdate:modelValue": (a) => {
421
- i(a), n("change");
422
+ "onUpdate:modelValue": (s) => {
423
+ i(s), n("change");
422
424
  }
423
425
  });
424
426
  },
425
427
  Tabs: ({ props: e, bindings: o, emit: n }) => {
426
- const [s, i] = b(e.value, o?.value);
427
- return d(ve, {
428
- modelValue: s ?? "",
428
+ const [a, i] = b(e.value, o?.value);
429
+ return d($e, {
430
+ modelValue: a ?? "",
429
431
  items: e.items,
430
432
  ariaLabel: e.ariaLabel,
431
- "onUpdate:modelValue": (a) => {
432
- i(a), n("change");
433
+ "onUpdate:modelValue": (s) => {
434
+ i(s), n("change");
433
435
  }
434
436
  });
435
437
  },
@@ -438,9 +440,9 @@ const Je = {
438
440
  style: {
439
441
  display: "flex",
440
442
  flexDirection: e.direction ?? "column",
441
- gap: Ie[e.gap ?? "md"],
442
- alignItems: Ke[e.align ?? "stretch"],
443
- justifyContent: Le[e.justify ?? "start"],
443
+ gap: De[e.gap ?? "md"],
444
+ alignItems: Ue[e.align ?? "stretch"],
445
+ justifyContent: Ne[e.justify ?? "start"],
444
446
  flexWrap: e.wrap ? "wrap" : "nowrap"
445
447
  }
446
448
  }, o),
@@ -449,8 +451,8 @@ const Je = {
449
451
  return d(o === "heading" ? "h2" : o === "mono" ? "code" : "span", { class: o === "muted" ? "text-[13px] text-[var(--ui-text-muted)]" : o === "caption" ? "text-[12px] text-[var(--ui-text-muted)]" : o === "heading" ? "text-[16px] font-semibold text-[var(--ui-text)]" : o === "mono" ? "font-mono text-[12px] text-[var(--ui-text)]" : "text-[13px] text-[var(--ui-text)]", "data-syno-pkg-land-ui": "" }, e.text);
450
452
  },
451
453
  Button: ({ props: e, emit: o }) => {
452
- const n = _(e.icon);
453
- return d(we, {
454
+ const n = C(e.icon);
455
+ return d(Se, {
454
456
  variant: e.variant,
455
457
  size: e.size,
456
458
  disabled: e.disabled,
@@ -461,9 +463,9 @@ const Je = {
461
463
  });
462
464
  },
463
465
  Input: ({ props: e, bindings: o, emit: n }) => {
464
- const [s, i] = b(e.value, o?.value);
465
- return d(ye, {
466
- modelValue: s,
466
+ const [a, i] = b(e.value, o?.value);
467
+ return d(ve, {
468
+ modelValue: a,
467
469
  type: e.type,
468
470
  placeholder: e.placeholder,
469
471
  disabled: e.disabled,
@@ -471,65 +473,65 @@ const Je = {
471
473
  invalid: e.invalid,
472
474
  size: e.size,
473
475
  ariaLabel: e.ariaLabel,
474
- "onUpdate:modelValue": (a) => {
475
- i(e.type === "number" && a !== "" ? Number(a) : a), n("change");
476
+ "onUpdate:modelValue": (s) => {
477
+ i(e.type === "number" && s !== "" ? Number(s) : s), n("change");
476
478
  }
477
479
  });
478
480
  },
479
481
  Select: ({ props: e, bindings: o, emit: n }) => {
480
- const [s, i] = b(e.value, o?.value);
481
- return d(be, {
482
- modelValue: s,
482
+ const [a, i] = b(e.value, o?.value);
483
+ return d(we, {
484
+ modelValue: a,
483
485
  options: e.options,
484
486
  placeholder: e.placeholder,
485
487
  disabled: e.disabled,
486
488
  search: e.search,
487
- "onUpdate:modelValue": (a) => {
488
- i(a), n("change");
489
+ "onUpdate:modelValue": (s) => {
490
+ i(s), n("change");
489
491
  }
490
492
  });
491
493
  },
492
494
  Checkbox: ({ props: e, bindings: o, emit: n }) => {
493
- const [s, i] = b(e.checked, o?.checked);
494
- return d(ge, {
495
- modelValue: s ?? !1,
495
+ const [a, i] = b(e.checked, o?.checked);
496
+ return d(ye, {
497
+ modelValue: a ?? !1,
496
498
  label: e.label,
497
499
  description: e.description,
498
500
  disabled: e.disabled,
499
- "onUpdate:modelValue": (a) => {
500
- i(a), n("change");
501
+ "onUpdate:modelValue": (s) => {
502
+ i(s), n("change");
501
503
  }
502
504
  });
503
505
  },
504
506
  Switch: ({ props: e, bindings: o, emit: n }) => {
505
- const [s, i] = b(e.checked, o?.checked);
506
- return d(fe, {
507
- modelValue: s ?? !1,
507
+ const [a, i] = b(e.checked, o?.checked);
508
+ return d(be, {
509
+ modelValue: a ?? !1,
508
510
  label: e.label,
509
511
  disabled: e.disabled,
510
- "onUpdate:modelValue": (a) => {
511
- i(a), n("change");
512
+ "onUpdate:modelValue": (s) => {
513
+ i(s), n("change");
512
514
  }
513
515
  });
514
516
  },
515
517
  RadioGroup: ({ props: e, bindings: o, emit: n }) => {
516
- const [s, i] = b(e.value, o?.value);
517
- return d(he, {
518
- modelValue: s,
518
+ const [a, i] = b(e.value, o?.value);
519
+ return d(ge, {
520
+ modelValue: a,
519
521
  options: e.options,
520
522
  orientation: e.orientation,
521
523
  disabled: e.disabled,
522
- "onUpdate:modelValue": (a) => {
523
- i(a), n("change");
524
+ "onUpdate:modelValue": (s) => {
525
+ i(s), n("change");
524
526
  }
525
527
  });
526
528
  },
527
- Form: ({ props: e, slots: o, emit: n }) => d(me, {
529
+ Form: ({ props: e, slots: o, emit: n }) => d(fe, {
528
530
  direction: e.direction,
529
531
  fieldWidth: e.fieldWidth,
530
532
  onSubmit: () => n("submit")
531
533
  }, o),
532
- Field: ({ props: e, slots: o }) => d(ue, {
534
+ Field: ({ props: e, slots: o }) => d(he, {
533
535
  label: e.label,
534
536
  description: e.description,
535
537
  help: e.help,
@@ -537,55 +539,55 @@ const Je = {
537
539
  fieldWidth: e.fieldWidth,
538
540
  direction: e.direction
539
541
  }, o),
540
- SettingsSection: ({ props: e, bindings: o, slots: n, emit: s }) => {
541
- const [i, a] = b(e.open, o?.open);
542
- return d(pe, {
542
+ SettingsSection: ({ props: e, bindings: o, slots: n, emit: a }) => {
543
+ const [i, s] = b(e.open, o?.open);
544
+ return d(me, {
543
545
  title: e.title,
544
546
  collapsible: e.collapsible,
545
547
  open: i,
546
548
  "onUpdate:open": (r) => {
547
- a(r), s("openChange");
549
+ s(r), a("openChange");
548
550
  }
549
551
  }, n);
550
552
  },
551
- SettingsField: ({ props: e, slots: o }) => d(de, {
553
+ SettingsField: ({ props: e, slots: o }) => d(ue, {
552
554
  label: e.label,
553
555
  description: e.description,
554
556
  required: e.required,
555
557
  fieldWidth: e.fieldWidth,
556
558
  align: e.align
557
559
  }, o),
558
- Surface: ({ props: e, slots: o }) => d(ce, e, o),
559
- Card: ({ props: e, bindings: o, slots: n, emit: s }) => {
560
- const [i, a] = b(e.expanded, o?.expanded);
561
- return d(le, {
560
+ Surface: ({ props: e, slots: o }) => d(pe, e, o),
561
+ Card: ({ props: e, bindings: o, slots: n, emit: a }) => {
562
+ const [i, s] = b(e.expanded, o?.expanded);
563
+ return d(de, {
562
564
  title: e.title,
563
565
  layoutType: e.layoutType,
564
566
  expandable: e.expandable,
565
567
  expanded: i,
566
568
  footerAlign: e.footerAlign,
567
569
  "onUpdate:expanded": (r) => {
568
- a(r), s("expandedChange");
570
+ s(r), a("expandedChange");
569
571
  }
570
572
  }, n);
571
573
  },
572
- Callout: ({ props: e, slots: o, emit: n }) => d(re, {
574
+ Callout: ({ props: e, slots: o, emit: n }) => d(ce, {
573
575
  tone: e.tone,
574
576
  title: e.title,
575
577
  closable: e.closable,
576
578
  code: e.code,
577
579
  onClose: () => n("close")
578
580
  }, o),
579
- EmptyState: ({ props: e, slots: o }) => d(ae, {
581
+ EmptyState: ({ props: e, slots: o }) => d(le, {
580
582
  title: e.title,
581
583
  description: e.description,
582
- icon: _(e.icon)
584
+ icon: C(e.icon)
583
585
  }, o),
584
- Progress: ({ props: e }) => d(se, e),
585
- Badge: ({ props: e }) => d(ie, { tone: e.tone }, Ue(e.text)),
586
- Dialog: ({ props: e, bindings: o, slots: n, emit: s }) => {
587
- const [i, a] = b(e.open, o?.open);
588
- return d(ne, {
586
+ Progress: ({ props: e }) => d(re, e),
587
+ Badge: ({ props: e }) => d(se, { tone: e.tone }, Te(e.text)),
588
+ Dialog: ({ props: e, bindings: o, slots: n, emit: a }) => {
589
+ const [i, s] = b(e.open, o?.open);
590
+ return d(ae, {
589
591
  open: i ?? !1,
590
592
  title: e.title,
591
593
  description: e.description,
@@ -593,115 +595,97 @@ const Je = {
593
595
  width: e.width,
594
596
  showClose: e.showClose,
595
597
  "onUpdate:open": (r) => {
596
- a(r), s("openChange");
598
+ s(r), a("openChange");
597
599
  }
598
600
  }, n);
599
601
  },
600
- DataTable: ({ props: e }) => d(R, e),
602
+ DataTable: ({ props: e }) => d(K, e),
601
603
  ResourceList: ({ props: e, slots: o }) => d("section", { class: "min-w-0", "data-syno-pkg-land-ui": "", "data-ui-resource-list": "" }, [
602
604
  o.toolbar ? d("div", { class: "mb-3 flex flex-wrap items-center gap-2" }, o.toolbar()) : null,
603
- d(R, e)
605
+ d(K, e)
604
606
  ]),
605
- CellText: ({ props: e, emit: o }) => d(oe, { ...e, onOpen: () => o("open") }),
606
- CellStatus: ({ props: e }) => d(te, e),
607
- ListItem: ({ props: e, slots: o }) => d(ee, e, o),
608
- InputGroup: ({ slots: e }) => d(Z, null, e),
609
- Loading: ({ props: e }) => d(Q, { text: e.text })
610
- }, { registry: qe } = z(O, {
607
+ CellText: ({ props: e, emit: o }) => d(ie, { ...e, onOpen: () => o("open") }),
608
+ CellStatus: ({ props: e }) => d(ne, e),
609
+ ListItem: ({ props: e, slots: o }) => d(oe, e, o),
610
+ InputGroup: ({ slots: e }) => d(te, null, e),
611
+ Loading: ({ props: e }) => d(ee, { text: e.text })
612
+ }, { registry: D } = M(A, {
611
613
  components: Je
612
- }), Ne = /* @__PURE__ */ B({
614
+ }), ut = /* @__PURE__ */ G({
613
615
  __name: "SynoJsonRenderer",
614
616
  props: {
615
- spec: { type: [Object, null], required: !0 },
616
- store: { type: Object, required: !1 },
617
- state: { type: Object, required: !1 },
618
- handlers: { type: Object, required: !1 },
619
- navigate: { type: Function, required: !1 },
620
- functions: { type: Object, required: !1 },
621
- directives: { type: Array, required: !1 },
622
- validationFunctions: { type: Object, required: !1 },
623
- onStateChange: { type: Function, required: !1 },
624
- loading: { type: Boolean, required: !1 },
625
- fallback: { type: null, required: !1 }
617
+ spec: {},
618
+ store: {},
619
+ state: {},
620
+ handlers: {},
621
+ navigate: { type: Function },
622
+ functions: {},
623
+ directives: {},
624
+ validationFunctions: {},
625
+ onStateChange: { type: Function },
626
+ loading: { type: Boolean },
627
+ fallback: {}
626
628
  },
627
- setup(e, { expose: o }) {
628
- o();
629
- const n = { get JSONUIProvider() {
630
- return M;
631
- }, get Renderer() {
632
- return F;
633
- }, get synoJsonRegistry() {
634
- return qe;
635
- } };
636
- return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
629
+ setup(e) {
630
+ return (o, n) => (X(), Y(j(W), {
631
+ registry: j(D),
632
+ store: e.store,
633
+ "initial-state": e.state ?? e.spec?.state ?? {},
634
+ handlers: e.handlers,
635
+ navigate: e.navigate,
636
+ functions: e.functions,
637
+ directives: e.directives,
638
+ "validation-functions": e.validationFunctions,
639
+ "on-state-change": e.onStateChange
640
+ }, {
641
+ default: Q(() => [
642
+ Z(j(B), {
643
+ spec: e.spec,
644
+ registry: j(D),
645
+ loading: e.loading,
646
+ fallback: e.fallback
647
+ }, null, 8, ["spec", "registry", "loading", "fallback"])
648
+ ]),
649
+ _: 1
650
+ }, 8, ["registry", "store", "initial-state", "handlers", "navigate", "functions", "directives", "validation-functions", "on-state-change"]));
637
651
  }
638
- }), Te = (e, o) => {
639
- const n = e.__vccOpts || e;
640
- for (const [s, i] of o)
641
- n[s] = i;
642
- return n;
643
- };
644
- function Ee(e, o, n, s, i, a) {
645
- return H(), G(s.JSONUIProvider, {
646
- registry: s.synoJsonRegistry,
647
- store: n.store,
648
- "initial-state": n.state ?? n.spec?.state ?? {},
649
- handlers: n.handlers,
650
- navigate: n.navigate,
651
- functions: n.functions,
652
- directives: n.directives,
653
- "validation-functions": n.validationFunctions,
654
- "on-state-change": n.onStateChange
655
- }, {
656
- default: X(() => [
657
- Y(s.Renderer, {
658
- spec: n.spec,
659
- registry: s.synoJsonRegistry,
660
- loading: n.loading,
661
- fallback: n.fallback
662
- }, null, 8, ["spec", "registry", "loading", "fallback"])
663
- ]),
664
- _: 1
665
- /* STABLE */
666
- }, 8, ["registry", "store", "initial-state", "handlers", "navigate", "functions", "directives", "validation-functions", "on-state-change"]);
667
- }
668
- const ht = /* @__PURE__ */ Te(Ne, [["render", Ee], ["__file", "/private/tmp/ui-pub-0125/src/json/SynoJsonRenderer.vue"]]), Ve = ["label", "title", "description", "text", "placeholder", "emptyText", "help", "ariaLabel", "valueLabel", "searchPlaceholder"];
669
- function T(e, o = "") {
670
- return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, s]) => m(s) ? T(s, `${o}${n}.`) : [`${o}${n}`]);
652
+ }), Ve = ["label", "title", "description", "text", "placeholder", "emptyText", "help", "ariaLabel", "valueLabel", "searchPlaceholder"];
653
+ function z(e, o = "") {
654
+ return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, a]) => m(a) ? z(a, `${o}${n}.`) : [`${o}${n}`]);
671
655
  }
672
656
  const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e), u = (...e) => e.map((o) => "/" + String(o).replaceAll("~", "~0").replaceAll("/", "~1")).join("");
673
- function ze(e, o) {
674
- const n = Array.from({ length: o.length + 1 }, (s, i) => i);
675
- for (let s = 1; s <= e.length; s++) {
657
+ function _e(e, o) {
658
+ const n = Array.from({ length: o.length + 1 }, (a, i) => i);
659
+ for (let a = 1; a <= e.length; a++) {
676
660
  let i = n[0];
677
- n[0] = s;
678
- for (let a = 1; a <= o.length; a++) {
679
- const r = n[a];
680
- n[a] = Math.min(n[a] + 1, n[a - 1] + 1, i + (e[s - 1].toLowerCase() === o[a - 1].toLowerCase() ? 0 : 1)), i = r;
661
+ n[0] = a;
662
+ for (let s = 1; s <= o.length; s++) {
663
+ const r = n[s];
664
+ n[s] = Math.min(n[s] + 1, n[s - 1] + 1, i + (e[a - 1].toLowerCase() === o[s - 1].toLowerCase() ? 0 : 1)), i = r;
681
665
  }
682
666
  }
683
667
  return n[o.length];
684
668
  }
685
669
  function y(e, o) {
686
- let n, s = 1 / 0;
670
+ let n, a = 1 / 0;
687
671
  for (const i of o) {
688
- const a = ze(e, i);
689
- a < s && ([n, s] = [i, a]);
672
+ const s = _e(e, i);
673
+ s < a && ([n, a] = [i, s]);
690
674
  }
691
- return n !== void 0 && s <= Math.max(2, Math.floor(e.length / 3)) ? n : void 0;
675
+ return n !== void 0 && a <= Math.max(2, Math.floor(e.length / 3)) ? n : void 0;
692
676
  }
693
- const Fe = ["$state", "$item", "$index", "$bindState", "$bindItem", "$cond", "$computed", "$template"], Me = (e) => m(e) && Fe.some((o) => Object.hasOwn(e, o)), k = (e) => Me(e) || (Array.isArray(e) ? e.some(k) : m(e) && Object.values(e).some(k));
694
- function A(e) {
677
+ const ze = ["$state", "$item", "$index", "$bindState", "$bindItem", "$cond", "$computed", "$template"], qe = (e) => m(e) && ze.some((o) => Object.hasOwn(e, o)), I = (e) => qe(e) || (Array.isArray(e) ? e.some(I) : m(e) && Object.values(e).some(I));
678
+ function P(e) {
695
679
  const o = e.props?.shape;
696
680
  return m(o) ? o : void 0;
697
681
  }
698
- const C = (e) => e.safeParse(void 0).success;
699
- function We(e) {
682
+ const R = (e) => e.safeParse(void 0).success;
683
+ function Fe(e) {
700
684
  if (e.code === "invalid_value") return `Use one of: ${e.values.map((o) => JSON.stringify(o)).join(", ")}.`;
701
685
  if (e.code === "invalid_type") return `Expected ${e.expected}.`;
702
686
  }
703
687
  const v = (e, o) => `${e}: ${o.join(", ")}`;
704
- class Be {
688
+ class Me {
705
689
  errors = [];
706
690
  warnings = [];
707
691
  error(o) {
@@ -711,23 +695,23 @@ class Be {
711
695
  this.warnings.push({ severity: "warning", ...o });
712
696
  }
713
697
  }
714
- function ft(e, o = {}) {
715
- const n = o.catalog ?? O, s = n.data.components, i = new Be();
698
+ function mt(e, o = {}) {
699
+ const n = o.catalog ?? A, a = n.data.components, i = new Me();
716
700
  if (!m(e))
717
- return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }), L(i);
718
- const a = m(e.elements) ? e.elements : void 0;
719
- a || i.error({ code: "invalid_elements", path: "/elements", message: '"elements" must be an object keyed by element id.', hint: 'Use a flat map: {"elements": {"root": {"type": "AppRoot", "props": {}, "children": []}}}.' });
720
- const r = Object.keys(a ?? {});
721
- typeof e.root != "string" || e.root === "" ? i.error({ code: "missing_root", path: "/root", message: '"root" must name the top element.', hint: r.length ? v('Set "root" to one of', r) : 'Add "root" and the element it names.' }) : a && !Object.hasOwn(a, e.root) && i.error({ code: "root_not_found", path: "/root", message: `Root "${e.root}" is not in "elements".`, hint: v("Existing element keys", r) });
722
- for (const [p, f] of Object.entries(a ?? {})) {
701
+ return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }), N(i);
702
+ const s = m(e.elements) ? e.elements : void 0;
703
+ s || i.error({ code: "invalid_elements", path: "/elements", message: '"elements" must be an object keyed by element id.', hint: 'Use a flat map: {"elements": {"root": {"type": "AppRoot", "props": {}, "children": []}}}.' });
704
+ const r = Object.keys(s ?? {});
705
+ typeof e.root != "string" || e.root === "" ? i.error({ code: "missing_root", path: "/root", message: '"root" must name the top element.', hint: r.length ? v('Set "root" to one of', r) : 'Add "root" and the element it names.' }) : s && !Object.hasOwn(s, e.root) && i.error({ code: "root_not_found", path: "/root", message: `Root "${e.root}" is not in "elements".`, hint: v("Existing element keys", r) });
706
+ for (const [p, f] of Object.entries(s ?? {})) {
723
707
  const w = (...g) => u("elements", p, ...g);
724
708
  if (!m(f)) {
725
709
  i.error({ code: "invalid_element", path: w(), elementKey: p, message: 'An element must be an object with "type", "props" and "children".' });
726
710
  continue;
727
711
  }
728
712
  const h = f.type;
729
- if (typeof h != "string" || !Object.hasOwn(s, h)) {
730
- const g = typeof h == "string" ? y(h, Object.keys(s)) : void 0;
713
+ if (typeof h != "string" || !Object.hasOwn(a, h)) {
714
+ const g = typeof h == "string" ? y(h, Object.keys(a)) : void 0;
731
715
  i.error({
732
716
  code: "unknown_component",
733
717
  path: w("type"),
@@ -737,11 +721,11 @@ function ft(e, o = {}) {
737
721
  });
738
722
  continue;
739
723
  }
740
- He(i, p, h, s[h], f.props), Ge(i, p, h, s[h], f, a);
724
+ We(i, p, h, a[h], f.props), Be(i, p, h, a[h], f, s);
741
725
  }
742
- const c = o.messages && T(o.messages), l = {
726
+ const c = o.messages && z(o.messages), l = {
743
727
  issues: i,
744
- components: s,
728
+ components: a,
745
729
  actions: [
746
730
  ...(n.schema?.builtInActions ?? []).map((p) => p.name),
747
731
  ...Object.keys(n.data.actions ?? {}),
@@ -752,15 +736,15 @@ function ft(e, o = {}) {
752
736
  functions: o.functions || c ? [...o.functions ?? [], ...c ? ["t"] : []] : void 0,
753
737
  messageKeys: c
754
738
  };
755
- return a && typeof e.root == "string" && Object.hasOwn(a, e.root) && Xe(l, e.root, a), L(i);
739
+ return s && typeof e.root == "string" && Object.hasOwn(s, e.root) && He(l, e.root, s), N(i);
756
740
  }
757
- function He(e, o, n, s, i) {
758
- const a = (...l) => u("elements", o, "props", ...l);
741
+ function We(e, o, n, a, i) {
742
+ const s = (...l) => u("elements", o, "props", ...l);
759
743
  if (!m(i)) {
760
- e.error({ code: "invalid_props", path: a(), elementKey: o, message: '"props" must be an object.', hint: 'Use "props": {} when the component needs none.' });
744
+ e.error({ code: "invalid_props", path: s(), elementKey: o, message: '"props" must be an object.', hint: 'Use "props": {} when the component needs none.' });
761
745
  return;
762
746
  }
763
- const r = A(s);
747
+ const r = P(a);
764
748
  if (!r) return;
765
749
  const c = Object.keys(r);
766
750
  for (const [l, p] of Object.entries(i)) {
@@ -769,41 +753,41 @@ function He(e, o, n, s, i) {
769
753
  const h = y(l, c);
770
754
  e.error({
771
755
  code: "unknown_prop",
772
- path: a(l),
756
+ path: s(l),
773
757
  elementKey: o,
774
758
  message: `${n} has no prop "${l}".`,
775
759
  hint: h ? `Did you mean "${h}"? Run "syno-pkg-land-ui describe ${n}".` : v(`${n} props`, c)
776
760
  });
777
761
  continue;
778
762
  }
779
- if (k(p)) continue;
763
+ if (I(p)) continue;
780
764
  const w = f.safeParse(p);
781
765
  if (!w.success)
782
766
  for (const h of w.error.issues)
783
767
  e.error({
784
768
  code: "invalid_prop",
785
- path: a(l, ...h.path.map((g) => String(g))),
769
+ path: s(l, ...h.path.map((g) => String(g))),
786
770
  elementKey: o,
787
771
  message: `${n}.${l}: ${h.message}`,
788
- hint: We(h)
772
+ hint: Fe(h)
789
773
  });
790
774
  }
791
775
  for (const l of c)
792
- !Object.hasOwn(i, l) && !C(r[l]) && e.error({ code: "missing_prop", path: a(l), elementKey: o, message: `${n} requires prop "${l}".`, hint: `Run "syno-pkg-land-ui describe ${n}" for its type.` });
776
+ !Object.hasOwn(i, l) && !R(r[l]) && e.error({ code: "missing_prop", path: s(l), elementKey: o, message: `${n} requires prop "${l}".`, hint: `Run "syno-pkg-land-ui describe ${n}" for its type.` });
793
777
  }
794
- function E(e, o) {
778
+ function q(e, o) {
795
779
  const n = [];
796
- if (Array.isArray(o.children) && o.children.forEach((s, i) => {
797
- typeof s == "string" && n.push({ child: s, path: u("elements", e, "children", i) });
780
+ if (Array.isArray(o.children) && o.children.forEach((a, i) => {
781
+ typeof a == "string" && n.push({ child: a, path: u("elements", e, "children", i) });
798
782
  }), m(o.slots))
799
- for (const [s, i] of Object.entries(o.slots))
800
- Array.isArray(i) && i.forEach((a, r) => {
801
- typeof a == "string" && n.push({ child: a, path: u("elements", e, "slots", s, r) });
783
+ for (const [a, i] of Object.entries(o.slots))
784
+ Array.isArray(i) && i.forEach((s, r) => {
785
+ typeof s == "string" && n.push({ child: s, path: u("elements", e, "slots", a, r) });
802
786
  });
803
787
  return n;
804
788
  }
805
- function Ge(e, o, n, s, i, a) {
806
- const r = s.slots ?? [], { children: c } = i;
789
+ function Be(e, o, n, a, i, s) {
790
+ const r = a.slots ?? [], { children: c } = i;
807
791
  if (c !== void 0 && !(Array.isArray(c) && c.every((l) => typeof l == "string")) ? e.error({ code: "invalid_children", path: u("elements", o, "children"), elementKey: o, message: '"children" must be an array of element keys.' }) : c?.length && !r.includes("default") && e.error({
808
792
  code: "children_not_allowed",
809
793
  path: u("elements", o, "children"),
@@ -827,9 +811,9 @@ function Ge(e, o, n, s, i, a) {
827
811
  hint: f ? `Did you mean "${f}"?` : r.length ? v(`${n} slots`, r) : `${n} has no slots.`
828
812
  });
829
813
  }
830
- for (const l of E(o, i))
831
- if (!Object.hasOwn(a, l.child)) {
832
- const p = y(l.child, Object.keys(a));
814
+ for (const l of q(o, i))
815
+ if (!Object.hasOwn(s, l.child)) {
816
+ const p = y(l.child, Object.keys(s));
833
817
  e.error({
834
818
  code: "missing_child",
835
819
  path: l.path,
@@ -839,87 +823,87 @@ function Ge(e, o, n, s, i, a) {
839
823
  });
840
824
  }
841
825
  }
842
- function Xe(e, o, n) {
843
- const { issues: s } = e, i = /* @__PURE__ */ new Set(), a = (r, c, l, p) => {
826
+ function He(e, o, n) {
827
+ const { issues: a } = e, i = /* @__PURE__ */ new Set(), s = (r, c, l, p) => {
844
828
  const f = n[r];
845
829
  if (!m(f)) return;
846
830
  i.add(r);
847
831
  const w = m(f.repeat);
848
- et(e, r, f, p || w);
832
+ Qe(e, r, f, p || w);
849
833
  const h = f.type === "AppRoot";
850
- h && l && s.error({ code: "nested_app_root", path: u("elements", r), elementKey: r, message: "AppRoot cannot be nested inside another AppRoot.", hint: "Use a single AppRoot at the top of the spec." });
851
- for (const g of E(r, f))
834
+ h && l && a.error({ code: "nested_app_root", path: u("elements", r), elementKey: r, message: "AppRoot cannot be nested inside another AppRoot.", hint: "Use a single AppRoot at the top of the spec." });
835
+ for (const g of q(r, f))
852
836
  if (Object.hasOwn(n, g.child)) {
853
837
  if (c.includes(g.child)) {
854
- s.error({ code: "cycle", path: g.path, elementKey: r, message: `"${g.child}" is its own ancestor.`, hint: "Element references must form a tree." });
838
+ a.error({ code: "cycle", path: g.path, elementKey: r, message: `"${g.child}" is its own ancestor.`, hint: "Element references must form a tree." });
855
839
  continue;
856
840
  }
857
- a(g.child, [...c, g.child], l || h, p || w);
841
+ s(g.child, [...c, g.child], l || h, p || w);
858
842
  }
859
843
  };
860
- a(o, [o], !1, !1);
844
+ s(o, [o], !1, !1);
861
845
  for (const r of Object.keys(n))
862
- i.has(r) || s.warn({ code: "orphaned_element", path: u("elements", r), elementKey: r, message: `"${r}" is not reachable from the root.`, hint: "Reference it from a parent or delete it." });
846
+ i.has(r) || a.warn({ code: "orphaned_element", path: u("elements", r), elementKey: r, message: `"${r}" is not reachable from the root.`, hint: "Reference it from a parent or delete it." });
863
847
  }
864
- function Ye(e, o) {
848
+ function Ge(e, o) {
865
849
  let n = e;
866
- for (const s of o.split("/").slice(1)) {
867
- const i = s.replaceAll("~1", "/").replaceAll("~0", "~");
850
+ for (const a of o.split("/").slice(1)) {
851
+ const i = a.replaceAll("~1", "/").replaceAll("~0", "~");
868
852
  if (Array.isArray(n) && /^\d+$/.test(i)) n = n[Number(i)];
869
853
  else if (m(n) && Object.hasOwn(n, i)) n = n[i];
870
854
  else return { found: !1 };
871
855
  }
872
856
  return { found: !0, value: n };
873
857
  }
874
- function S(e, o, n, s, { mustExist: i }) {
858
+ function S(e, o, n, a, { mustExist: i }) {
875
859
  if (typeof n != "string" || !n.startsWith("/")) {
876
860
  e.issues.error({
877
861
  code: "invalid_state_path",
878
- path: s,
862
+ path: a,
879
863
  elementKey: o,
880
864
  message: `State paths are JSON Pointers; got ${JSON.stringify(n)}.`,
881
865
  hint: typeof n == "string" ? `Use "/${n.replace(/^\.?\/?/, "").replaceAll(".", "/")}".` : 'Use a string such as "/settings/enabled".'
882
866
  });
883
867
  return;
884
868
  }
885
- i && !Ye(e.state, n).found && e.issues.warn({
869
+ i && !Ge(e.state, n).found && e.issues.warn({
886
870
  code: "state_path_missing",
887
- path: s,
871
+ path: a,
888
872
  elementKey: o,
889
873
  message: `State "${n}" has no initial value.`,
890
874
  hint: `Seed it in the spec's "state", or pass the host state with --state, so the first render has a value.`
891
875
  });
892
876
  }
893
- function j(e, o, n, s, i) {
877
+ function $(e, o, n, a, i) {
894
878
  if (Array.isArray(n)) {
895
- n.forEach((a, r) => j(e, o, a, s + u(r), i));
879
+ n.forEach((s, r) => $(e, o, s, a + u(r), i));
896
880
  return;
897
881
  }
898
882
  if (m(n)) {
899
- for (const a of ["$state", "$bindState"])
900
- Object.hasOwn(n, a) && S(e, o, n[a], s + u(a), { mustExist: !0 });
901
- for (const a of ["$item", "$bindItem", "$index"])
902
- Object.hasOwn(n, a) && !i && e.issues.error({
883
+ for (const s of ["$state", "$bindState"])
884
+ Object.hasOwn(n, s) && S(e, o, n[s], a + u(s), { mustExist: !0 });
885
+ for (const s of ["$item", "$bindItem", "$index"])
886
+ Object.hasOwn(n, s) && !i && e.issues.error({
903
887
  code: "item_outside_repeat",
904
- path: s + u(a),
888
+ path: a + u(s),
905
889
  elementKey: o,
906
- message: `${a} only works inside an element with "repeat" or its descendants.`,
890
+ message: `${s} only works inside an element with "repeat" or its descendants.`,
907
891
  hint: 'Add "repeat": {"statePath": "/list"} to an ancestor, or read the value with $state.'
908
892
  });
909
893
  if (typeof n.$template == "string")
910
- for (const a of n.$template.matchAll(/\$\{([^}]*)\}/g))
911
- S(e, o, a[1], s + u("$template"), { mustExist: !0 });
912
- typeof n.$computed == "string" && Qe(e, o, n, s);
913
- for (const [a, r] of Object.entries(n))
914
- ["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) || j(e, o, r, s + u(a), i);
894
+ for (const s of n.$template.matchAll(/\$\{([^}]*)\}/g))
895
+ S(e, o, s[1], a + u("$template"), { mustExist: !0 });
896
+ typeof n.$computed == "string" && Xe(e, o, n, a);
897
+ for (const [s, r] of Object.entries(n))
898
+ ["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(s) || $(e, o, r, a + u(s), i);
915
899
  }
916
900
  }
917
- function Qe(e, o, n, s) {
901
+ function Xe(e, o, n, a) {
918
902
  const i = n.$computed;
919
903
  if (!e.functions)
920
904
  e.issues.warn({
921
905
  code: "unverified_function",
922
- path: s + u("$computed"),
906
+ path: a + u("$computed"),
923
907
  elementKey: o,
924
908
  message: `$computed "${i}" must be registered by the host.`,
925
909
  hint: `Pass the host function names with --functions ${i} to verify it.`
@@ -928,29 +912,29 @@ function Qe(e, o, n, s) {
928
912
  const r = y(i, e.functions);
929
913
  e.issues.error({
930
914
  code: "unknown_function",
931
- path: s + u("$computed"),
915
+ path: a + u("$computed"),
932
916
  elementKey: o,
933
917
  message: `$computed "${i}" is not a host function.`,
934
918
  hint: `${r ? `Did you mean "${r}"? ` : ""}${v("Host functions", e.functions)}`
935
919
  });
936
920
  }
937
921
  if (i !== "t" || !e.messageKeys) return;
938
- const a = m(n.args) ? n.args.key : void 0;
939
- if (typeof a != "string" || !e.messageKeys.includes(a)) {
940
- const r = typeof a == "string" ? y(a, e.messageKeys) : void 0;
922
+ const s = m(n.args) ? n.args.key : void 0;
923
+ if (typeof s != "string" || !e.messageKeys.includes(s)) {
924
+ const r = typeof s == "string" ? y(s, e.messageKeys) : void 0;
941
925
  e.issues.error({
942
926
  code: "missing_i18n_key",
943
- path: s + u("args", "key"),
927
+ path: a + u("args", "key"),
944
928
  elementKey: o,
945
- message: `Message key ${JSON.stringify(a)} is not in the message catalog.`,
929
+ message: `Message key ${JSON.stringify(s)} is not in the message catalog.`,
946
930
  hint: r ? `Did you mean "${r}"? Otherwise add the key to every locale.` : "Add the key to every locale, or use an existing key."
947
931
  });
948
932
  }
949
933
  }
950
- const Ze = ["statePath", "clearStatePath"];
951
- function et(e, o, n, s) {
934
+ const Ye = ["statePath", "clearStatePath"];
935
+ function Qe(e, o, n, a) {
952
936
  const i = (...c) => u("elements", o, ...c);
953
- if (j(e, o, n.props, i("props"), s), e.messageKeys && m(n.props))
937
+ if ($(e, o, n.props, i("props"), a), e.messageKeys && m(n.props))
954
938
  for (const c of Ve) {
955
939
  const l = n.props[c];
956
940
  typeof l == "string" && l.trim() && e.issues.warn({
@@ -961,8 +945,8 @@ function et(e, o, n, s) {
961
945
  hint: 'Use {"$computed": "t", "args": {"key": "<message key>"}}.'
962
946
  });
963
947
  }
964
- n.visible !== void 0 && j(e, o, n.visible, i("visible"), s), m(n.repeat) && S(e, o, n.repeat.statePath, i("repeat", "statePath"), { mustExist: !0 });
965
- const a = typeof n.type == "string" ? n.type : "", r = e.components[a]?.events ?? [];
948
+ n.visible !== void 0 && $(e, o, n.visible, i("visible"), a), m(n.repeat) && S(e, o, n.repeat.statePath, i("repeat", "statePath"), { mustExist: !0 });
949
+ const s = typeof n.type == "string" ? n.type : "", r = e.components[s]?.events ?? [];
966
950
  if (m(n.on))
967
951
  for (const [c, l] of Object.entries(n.on)) {
968
952
  if (!r.includes(c)) {
@@ -971,19 +955,19 @@ function et(e, o, n, s) {
971
955
  code: "unknown_event",
972
956
  path: i("on", c),
973
957
  elementKey: o,
974
- message: `${a} does not emit "${c}".`,
975
- hint: p ? `Did you mean "${p}"?` : r.length ? v(`${a} events`, r) : `${a} emits no events.`
958
+ message: `${s} does not emit "${c}".`,
959
+ hint: p ? `Did you mean "${p}"?` : r.length ? v(`${s} events`, r) : `${s} emits no events.`
976
960
  });
977
961
  }
978
- K(e, o, l, i("on", c), s);
962
+ U(e, o, l, i("on", c), a);
979
963
  }
980
964
  if (m(n.watch))
981
965
  for (const [c, l] of Object.entries(n.watch))
982
- S(e, o, c, i("watch", c), { mustExist: !1 }), K(e, o, l, i("watch", c), s);
966
+ S(e, o, c, i("watch", c), { mustExist: !1 }), U(e, o, l, i("watch", c), a);
983
967
  }
984
- function K(e, o, n, s, i) {
968
+ function U(e, o, n, a, i) {
985
969
  (Array.isArray(n) ? n : [n]).forEach((r, c) => {
986
- const l = Array.isArray(n) ? s + u(c) : s;
970
+ const l = Array.isArray(n) ? a + u(c) : a;
987
971
  if (!m(r) || typeof r.action != "string") {
988
972
  e.issues.error({ code: "invalid_action_binding", path: l, elementKey: o, message: 'An action binding is {"action": "<name>", "params": {...}}.' });
989
973
  return;
@@ -999,21 +983,21 @@ function K(e, o, n, s, i) {
999
983
  });
1000
984
  }
1001
985
  if (m(r.params)) {
1002
- for (const p of Ze)
986
+ for (const p of Ye)
1003
987
  Object.hasOwn(r.params, p) && S(e, o, r.params[p], l + u("params", p), { mustExist: !1 });
1004
- j(e, o, r.params, l + u("params"), i);
988
+ $(e, o, r.params, l + u("params"), i);
1005
989
  }
1006
990
  });
1007
991
  }
1008
- function L(e) {
992
+ function N(e) {
1009
993
  return { valid: e.errors.length === 0, errors: e.errors, warnings: e.warnings };
1010
994
  }
1011
- const $ = q;
1012
- function tt(e) {
995
+ const x = V;
996
+ function Ze(e) {
1013
997
  const o = t.toJSONSchema(e);
1014
998
  return delete o.$schema, o;
1015
999
  }
1016
- function ot(e) {
1000
+ function et(e) {
1017
1001
  if (Array.isArray(e.enum)) return e.enum[0];
1018
1002
  switch (e.type) {
1019
1003
  case "string":
@@ -1029,23 +1013,23 @@ function ot(e) {
1029
1013
  return {};
1030
1014
  }
1031
1015
  }
1032
- function gt() {
1033
- return Object.entries($).map(([e, o]) => ({
1016
+ function ht() {
1017
+ return Object.entries(x).map(([e, o]) => ({
1034
1018
  name: e,
1035
1019
  description: o.description,
1036
- required: Object.entries(A(o) ?? {}).filter(([, n]) => !C(n)).map(([n]) => n),
1020
+ required: Object.entries(P(o) ?? {}).filter(([, n]) => !R(n)).map(([n]) => n),
1037
1021
  slots: o.slots ?? [],
1038
1022
  events: o.events ?? []
1039
1023
  }));
1040
1024
  }
1041
- function bt(e) {
1042
- return y(e, Object.keys($));
1025
+ function ft(e) {
1026
+ return y(e, Object.keys(x));
1043
1027
  }
1044
- function yt(e) {
1045
- if (!Object.hasOwn($, e)) return;
1046
- const o = $[e], n = Object.fromEntries(Object.entries(A(o) ?? {}).map(([s, i]) => [
1047
- s,
1048
- { required: !C(i), schema: tt(i) }
1028
+ function gt(e) {
1029
+ if (!Object.hasOwn(x, e)) return;
1030
+ const o = x[e], n = Object.fromEntries(Object.entries(P(o) ?? {}).map(([a, i]) => [
1031
+ a,
1032
+ { required: !R(i), schema: Ze(i) }
1049
1033
  ]));
1050
1034
  return {
1051
1035
  name: e,
@@ -1055,16 +1039,16 @@ function yt(e) {
1055
1039
  events: o.events ?? [],
1056
1040
  example: {
1057
1041
  type: e,
1058
- props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s, ot(i)])),
1042
+ props: Object.fromEntries(Object.entries(n).filter(([, a]) => a.required).map(([a, { schema: i }]) => [a, et(i)])),
1059
1043
  children: []
1060
1044
  }
1061
1045
  };
1062
1046
  }
1063
- const x = { type: "string", pattern: "^/" }, nt = {
1047
+ const O = { type: "string", pattern: "^/" }, tt = {
1064
1048
  description: "A json-render expression resolved at render time.",
1065
1049
  anyOf: [
1066
- { type: "object", required: ["$state"], properties: { $state: x } },
1067
- { type: "object", required: ["$bindState"], properties: { $bindState: x } },
1050
+ { type: "object", required: ["$state"], properties: { $state: O } },
1051
+ { type: "object", required: ["$bindState"], properties: { $bindState: O } },
1068
1052
  { type: "object", required: ["$item"], properties: { $item: { type: "string" } } },
1069
1053
  { type: "object", required: ["$bindItem"], properties: { $bindItem: { type: "string" } } },
1070
1054
  { type: "object", required: ["$index"], properties: { $index: { const: !0 } } },
@@ -1072,7 +1056,7 @@ const x = { type: "string", pattern: "^/" }, nt = {
1072
1056
  { type: "object", required: ["$computed"], properties: { $computed: { type: "string" }, args: { type: "object" } } },
1073
1057
  { type: "object", required: ["$cond", "$then", "$else"], properties: { $cond: {}, $then: {}, $else: {} } }
1074
1058
  ]
1075
- }, it = {
1059
+ }, ot = {
1076
1060
  type: "object",
1077
1061
  required: ["action"],
1078
1062
  properties: {
@@ -1084,35 +1068,35 @@ const x = { type: "string", pattern: "^/" }, nt = {
1084
1068
  preventDefault: { type: "boolean" }
1085
1069
  },
1086
1070
  additionalProperties: !1
1087
- }, U = { anyOf: [{ $ref: "#/$defs/actionBinding" }, { type: "array", items: { $ref: "#/$defs/actionBinding" } }] }, D = { type: "array", items: { type: "string" } };
1088
- function st(e, o, n) {
1089
- const s = (r) => Array.isArray(r) ? r.map(s) : !r || typeof r != "object" ? r : Object.fromEntries(Object.entries(r).map(([c, l]) => [
1071
+ }, T = { anyOf: [{ $ref: "#/$defs/actionBinding" }, { type: "array", items: { $ref: "#/$defs/actionBinding" } }] }, E = { type: "array", items: { type: "string" } };
1072
+ function nt(e, o, n) {
1073
+ const a = (r) => Array.isArray(r) ? r.map(a) : !r || typeof r != "object" ? r : Object.fromEntries(Object.entries(r).map(([c, l]) => [
1090
1074
  c,
1091
- c === "$ref" && typeof l == "string" ? l.replace("#/$defs/", `#/$defs/${o}`) : s(l)
1092
- ])), { $defs: i, ...a } = e;
1093
- delete a.$schema;
1094
- for (const [r, c] of Object.entries(i ?? {})) n[o + r] = s(c);
1095
- return s(a);
1075
+ c === "$ref" && typeof l == "string" ? l.replace("#/$defs/", `#/$defs/${o}`) : a(l)
1076
+ ])), { $defs: i, ...s } = e;
1077
+ delete s.$schema;
1078
+ for (const [r, c] of Object.entries(i ?? {})) n[o + r] = a(c);
1079
+ return a(s);
1096
1080
  }
1097
- function at(e, o, n) {
1098
- const s = A(o), i = o.slots ?? [];
1099
- let a = { type: "object" };
1100
- if (s) {
1101
- const r = st(t.toJSONSchema(t.object(s)), `${e}__`, n), c = r.properties;
1102
- a = {
1081
+ function it(e, o, n) {
1082
+ const a = P(o), i = o.slots ?? [];
1083
+ let s = { type: "object" };
1084
+ if (a) {
1085
+ const r = nt(t.toJSONSchema(t.object(a)), `${e}__`, n), c = r.properties;
1086
+ s = {
1103
1087
  ...r,
1104
1088
  properties: Object.fromEntries(Object.entries(c).map(([l, p]) => [
1105
1089
  l,
1106
1090
  { anyOf: [p, { $ref: "#/$defs/expression" }] }
1107
1091
  ]))
1108
- }, r.required?.length || delete a.required;
1092
+ }, r.required?.length || delete s.required;
1109
1093
  }
1110
1094
  return {
1111
1095
  if: { properties: { type: { const: e } } },
1112
1096
  then: {
1113
1097
  ...o.description ? { description: o.description } : {},
1114
1098
  properties: {
1115
- props: a,
1099
+ props: s,
1116
1100
  ...i.includes("default") ? {} : { children: { maxItems: 0 } },
1117
1101
  slots: { propertyNames: { enum: i.filter((r) => r !== "default") } },
1118
1102
  on: { propertyNames: { enum: o.events ?? [] } }
@@ -1120,23 +1104,23 @@ function at(e, o, n) {
1120
1104
  }
1121
1105
  };
1122
1106
  }
1123
- function wt(e = O) {
1124
- const o = e.data.components, n = { expression: nt, actionBinding: it }, s = Object.entries(o).map(([i, a]) => at(i, a, n));
1107
+ function bt(e = A) {
1108
+ const o = e.data.components, n = { expression: tt, actionBinding: ot }, a = Object.entries(o).map(([i, s]) => it(i, s, n));
1125
1109
  return n.element = {
1126
1110
  type: "object",
1127
1111
  required: ["type", "props"],
1128
1112
  properties: {
1129
1113
  type: { enum: Object.keys(o) },
1130
1114
  props: { type: "object" },
1131
- children: D,
1132
- slots: { type: "object", additionalProperties: D },
1115
+ children: E,
1116
+ slots: { type: "object", additionalProperties: E },
1133
1117
  visible: {},
1134
- on: { type: "object", additionalProperties: U },
1135
- watch: { type: "object", propertyNames: x, additionalProperties: U },
1136
- repeat: { type: "object", required: ["statePath"], properties: { statePath: x, key: { type: "string" } }, additionalProperties: !1 }
1118
+ on: { type: "object", additionalProperties: T },
1119
+ watch: { type: "object", propertyNames: O, additionalProperties: T },
1120
+ repeat: { type: "object", required: ["statePath"], properties: { statePath: O, key: { type: "string" } }, additionalProperties: !1 }
1137
1121
  },
1138
1122
  additionalProperties: !1,
1139
- allOf: s
1123
+ allOf: a
1140
1124
  }, {
1141
1125
  $schema: "https://json-schema.org/draft/2020-12/schema",
1142
1126
  title: "Synology Package Land JSON UI spec",
@@ -1152,30 +1136,30 @@ function wt(e = O) {
1152
1136
  };
1153
1137
  }
1154
1138
  export {
1155
- Pt as ActionProvider,
1156
- _t as JSONUIProvider,
1157
- kt as Renderer,
1158
- Ct as StateProvider,
1159
- ht as SynoJsonRenderer,
1160
- Rt as ValidationProvider,
1139
+ Ot as ActionProvider,
1140
+ At as JSONUIProvider,
1141
+ Pt as Renderer,
1142
+ kt as StateProvider,
1143
+ ut as SynoJsonRenderer,
1144
+ Ct as ValidationProvider,
1161
1145
  It as VisibilityProvider,
1162
- bt as closestSynoJsonComponent,
1163
- xt as createStateStore,
1164
- Ot as defineCatalog,
1165
- Kt as defineRegistry,
1166
- yt as describeSynoJsonComponent,
1167
- qt as jsonRenderVueSchema,
1168
- gt as listSynoJsonComponents,
1169
- mt as synoJsonAiPrompt,
1170
- Ce as synoJsonAiRules,
1171
- O as synoJsonCatalog,
1172
- q as synoJsonComponentDefinitions,
1173
- qe as synoJsonRegistry,
1146
+ ft as closestSynoJsonComponent,
1147
+ $t as createStateStore,
1148
+ jt as defineCatalog,
1149
+ Rt as defineRegistry,
1150
+ gt as describeSynoJsonComponent,
1151
+ Nt as jsonRenderVueSchema,
1152
+ ht as listSynoJsonComponents,
1153
+ pt as synoJsonAiPrompt,
1154
+ Ke as synoJsonAiRules,
1155
+ A as synoJsonCatalog,
1156
+ V as synoJsonComponentDefinitions,
1157
+ D as synoJsonRegistry,
1174
1158
  Je as synoJsonRenderers,
1175
- wt as synoJsonSchema,
1176
- Lt as useActions,
1177
- Ut as useBoundProp,
1159
+ bt as synoJsonSchema,
1160
+ Kt as useActions,
1161
+ Lt as useBoundProp,
1178
1162
  Dt as useStateStore,
1179
- ft as validateSynoJsonSpec,
1180
- jt as z
1163
+ mt as validateSynoJsonSpec,
1164
+ vt as z
1181
1165
  };