@synopackageland/ui 0.12.3 → 0.12.5
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.
- package/CHANGELOG.md +15 -0
- package/README.md +18 -0
- package/dist/components/app/app-layout/AppLayout.vue.d.ts +1 -1
- package/dist/components/app/page-content/PageContent.vue.d.ts +3 -3
- package/dist/components/primitives/dropdown-menu/types.d.ts +3 -0
- package/dist/components/primitives/segment-control/SegmentControl.vue.d.ts +4 -0
- package/dist/components/primitives/segment-control/context.d.ts +3 -0
- package/dist/index.js +21635 -17311
- package/dist/json/catalog.d.ts +2 -0
- package/dist/json/registry.d.ts +34 -0
- package/dist/json-ai-prompt.md +1 -1
- package/dist/json-catalog.schema.json +2 -1
- package/dist/json-preview/preview.js +11791 -10685
- package/dist/json.js +223 -205
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/adaptive-layout.md +14 -6
- package/package.json +1 -70
package/dist/json.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { z as
|
|
3
|
-
import { defineCatalog as
|
|
4
|
-
import { createStateStore as
|
|
5
|
-
import { defineRegistry as
|
|
6
|
-
import { ActionProvider as
|
|
7
|
-
import { schema as
|
|
8
|
-
import { schema as
|
|
9
|
-
import { h as d, defineComponent as
|
|
10
|
-
import { LoadingArea as
|
|
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";
|
|
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
|
-
})),
|
|
19
|
+
})), P = t.object({
|
|
20
20
|
label: t.string(),
|
|
21
21
|
value: t.string(),
|
|
22
22
|
disabled: t.boolean().optional()
|
|
23
|
-
}),
|
|
23
|
+
}), ke = P.extend({
|
|
24
24
|
description: t.string().optional()
|
|
25
|
-
}),
|
|
25
|
+
}), I = 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
|
-
}),
|
|
32
|
+
}), q = {
|
|
33
33
|
AppRoot: {
|
|
34
34
|
props: t.object({
|
|
35
35
|
modalScope: t.enum(["document", "app"]).optional()
|
|
@@ -55,7 +55,7 @@ const J = t.lazy(() => t.object({
|
|
|
55
55
|
Page: {
|
|
56
56
|
props: t.object({
|
|
57
57
|
width: t.string().optional(),
|
|
58
|
-
surface: t.enum(["auto", "flat", "card"]).optional()
|
|
58
|
+
surface: t.enum(["auto", "flat", "card", "none"]).optional()
|
|
59
59
|
}),
|
|
60
60
|
slots: ["default"],
|
|
61
61
|
description: 'Page content area. Use width "fill" for data-heavy screens and "readable" for forms/settings.'
|
|
@@ -90,7 +90,7 @@ const J = t.lazy(() => t.object({
|
|
|
90
90
|
Tabs: {
|
|
91
91
|
props: t.object({
|
|
92
92
|
value: t.string(),
|
|
93
|
-
items: t.array(
|
|
93
|
+
items: t.array(P),
|
|
94
94
|
ariaLabel: t.string().optional()
|
|
95
95
|
}),
|
|
96
96
|
events: ["change"],
|
|
@@ -143,7 +143,7 @@ const J = t.lazy(() => t.object({
|
|
|
143
143
|
Select: {
|
|
144
144
|
props: t.object({
|
|
145
145
|
value: t.string().optional(),
|
|
146
|
-
options: t.array(
|
|
146
|
+
options: t.array(P),
|
|
147
147
|
placeholder: t.string().optional(),
|
|
148
148
|
disabled: t.boolean().optional(),
|
|
149
149
|
search: t.boolean().optional()
|
|
@@ -173,7 +173,7 @@ const J = t.lazy(() => t.object({
|
|
|
173
173
|
RadioGroup: {
|
|
174
174
|
props: t.object({
|
|
175
175
|
value: t.string().optional(),
|
|
176
|
-
options: t.array(
|
|
176
|
+
options: t.array(ke),
|
|
177
177
|
orientation: t.enum(["vertical", "horizontal"]).optional(),
|
|
178
178
|
disabled: t.boolean().optional()
|
|
179
179
|
}),
|
|
@@ -295,7 +295,7 @@ const J = t.lazy(() => t.object({
|
|
|
295
295
|
},
|
|
296
296
|
DataTable: {
|
|
297
297
|
props: t.object({
|
|
298
|
-
columns: t.array(
|
|
298
|
+
columns: t.array(I),
|
|
299
299
|
rows: t.array(t.record(t.string(), t.unknown())),
|
|
300
300
|
rowKey: t.string().optional(),
|
|
301
301
|
emptyText: t.string().optional(),
|
|
@@ -306,7 +306,7 @@ const J = t.lazy(() => t.object({
|
|
|
306
306
|
},
|
|
307
307
|
ResourceList: {
|
|
308
308
|
props: t.object({
|
|
309
|
-
columns: t.array(
|
|
309
|
+
columns: t.array(I),
|
|
310
310
|
rows: t.array(t.record(t.string(), t.unknown())),
|
|
311
311
|
rowKey: t.string().optional(),
|
|
312
312
|
emptyText: t.string().optional(),
|
|
@@ -355,10 +355,10 @@ const J = t.lazy(() => t.object({
|
|
|
355
355
|
props: t.object({ text: t.string().optional() }),
|
|
356
356
|
description: "Centered loading state for a page or bounded region."
|
|
357
357
|
}
|
|
358
|
-
},
|
|
359
|
-
components:
|
|
358
|
+
}, O = V(W, {
|
|
359
|
+
components: q,
|
|
360
360
|
actions: {}
|
|
361
|
-
}),
|
|
361
|
+
}), Ce = [
|
|
362
362
|
"Prefer AppRoot > AppShell > Page as the normal DSM application hierarchy.",
|
|
363
363
|
"Prefer SettingsSection and SettingsField for settings; prefer ResourceList/DataTable for ordinary scalar resource collections.",
|
|
364
364
|
"Keep state in the spec and use $bindState/$bindItem for editable controls; do not invent JavaScript in props.",
|
|
@@ -367,53 +367,53 @@ const J = t.lazy(() => t.object({
|
|
|
367
367
|
"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
368
|
"For a phone-unfriendly custom view, use ResponsiveView slots: mobile alternative and default full view. Keep essential actions accessible on mobile.",
|
|
369
369
|
"Use low-level Stack/Text only when a semantic component does not already express the layout."
|
|
370
|
-
],
|
|
371
|
-
function
|
|
372
|
-
return `${
|
|
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 })}
|
|
373
373
|
|
|
374
|
-
${
|
|
374
|
+
${Re}
|
|
375
375
|
`;
|
|
376
376
|
}
|
|
377
|
-
const
|
|
377
|
+
const Ie = {
|
|
378
378
|
none: "0",
|
|
379
379
|
xs: "var(--ui-space-1)",
|
|
380
380
|
sm: "var(--ui-space-2)",
|
|
381
381
|
md: "var(--ui-space-3)",
|
|
382
382
|
lg: "var(--ui-space-4)"
|
|
383
|
-
},
|
|
384
|
-
function
|
|
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) {
|
|
385
385
|
return { default: () => e };
|
|
386
386
|
}
|
|
387
|
-
function C(e) {
|
|
388
|
-
return e ? Ie(e) : void 0;
|
|
389
|
-
}
|
|
390
387
|
function _(e) {
|
|
388
|
+
return e ? _e(e) : void 0;
|
|
389
|
+
}
|
|
390
|
+
function N(e) {
|
|
391
391
|
return {
|
|
392
392
|
...e,
|
|
393
|
-
icon:
|
|
394
|
-
children: e.children?.map(
|
|
393
|
+
icon: _(e.icon),
|
|
394
|
+
children: e.children?.map(N)
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
return e.map((o) => ({ ...o, items: o.items.map(
|
|
397
|
+
function De(e) {
|
|
398
|
+
return e.map((o) => ({ ...o, items: o.items.map(N) }));
|
|
399
399
|
}
|
|
400
400
|
const Je = {
|
|
401
|
-
AppRoot: ({ props: e, slots: o }) => d(
|
|
402
|
-
AppShell: ({ props: e, slots: o }) => d(
|
|
401
|
+
AppRoot: ({ props: e, slots: o }) => d(Pe, { modalScope: e.modalScope }, o),
|
|
402
|
+
AppShell: ({ props: e, slots: o }) => d(Ae, {
|
|
403
403
|
sidebarWidth: e.sidebarWidth,
|
|
404
404
|
minHeight: e.minHeight,
|
|
405
405
|
responsive: e.responsive,
|
|
406
406
|
wideLayout: e.wideLayout
|
|
407
407
|
}, o),
|
|
408
|
-
ResponsiveView: ({ props: e, slots: o }) => d(
|
|
409
|
-
Page: ({ props: e, slots: o }) => d(
|
|
410
|
-
PageHeader: ({ props: e, slots: o }) => d(
|
|
411
|
-
Toolbar: ({ props: e, slots: o }) => d(
|
|
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),
|
|
412
412
|
SidebarNav: ({ props: e, bindings: o, emit: n }) => {
|
|
413
413
|
const [s, i] = b(e.value, o?.value);
|
|
414
|
-
return d(
|
|
414
|
+
return d(Se, {
|
|
415
415
|
modelValue: s,
|
|
416
|
-
groups:
|
|
416
|
+
groups: De(e.groups),
|
|
417
417
|
searchable: e.searchable,
|
|
418
418
|
collapsible: e.collapsible,
|
|
419
419
|
searchPlaceholder: e.searchPlaceholder,
|
|
@@ -424,7 +424,7 @@ const Je = {
|
|
|
424
424
|
},
|
|
425
425
|
Tabs: ({ props: e, bindings: o, emit: n }) => {
|
|
426
426
|
const [s, i] = b(e.value, o?.value);
|
|
427
|
-
return d(
|
|
427
|
+
return d(ve, {
|
|
428
428
|
modelValue: s ?? "",
|
|
429
429
|
items: e.items,
|
|
430
430
|
ariaLabel: e.ariaLabel,
|
|
@@ -438,9 +438,9 @@ const Je = {
|
|
|
438
438
|
style: {
|
|
439
439
|
display: "flex",
|
|
440
440
|
flexDirection: e.direction ?? "column",
|
|
441
|
-
gap:
|
|
442
|
-
alignItems:
|
|
443
|
-
justifyContent:
|
|
441
|
+
gap: Ie[e.gap ?? "md"],
|
|
442
|
+
alignItems: Ke[e.align ?? "stretch"],
|
|
443
|
+
justifyContent: Le[e.justify ?? "start"],
|
|
444
444
|
flexWrap: e.wrap ? "wrap" : "nowrap"
|
|
445
445
|
}
|
|
446
446
|
}, o),
|
|
@@ -449,8 +449,8 @@ const Je = {
|
|
|
449
449
|
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
450
|
},
|
|
451
451
|
Button: ({ props: e, emit: o }) => {
|
|
452
|
-
const n =
|
|
453
|
-
return d(
|
|
452
|
+
const n = _(e.icon);
|
|
453
|
+
return d(we, {
|
|
454
454
|
variant: e.variant,
|
|
455
455
|
size: e.size,
|
|
456
456
|
disabled: e.disabled,
|
|
@@ -462,7 +462,7 @@ const Je = {
|
|
|
462
462
|
},
|
|
463
463
|
Input: ({ props: e, bindings: o, emit: n }) => {
|
|
464
464
|
const [s, i] = b(e.value, o?.value);
|
|
465
|
-
return d(
|
|
465
|
+
return d(ye, {
|
|
466
466
|
modelValue: s,
|
|
467
467
|
type: e.type,
|
|
468
468
|
placeholder: e.placeholder,
|
|
@@ -478,7 +478,7 @@ const Je = {
|
|
|
478
478
|
},
|
|
479
479
|
Select: ({ props: e, bindings: o, emit: n }) => {
|
|
480
480
|
const [s, i] = b(e.value, o?.value);
|
|
481
|
-
return d(
|
|
481
|
+
return d(be, {
|
|
482
482
|
modelValue: s,
|
|
483
483
|
options: e.options,
|
|
484
484
|
placeholder: e.placeholder,
|
|
@@ -491,7 +491,7 @@ const Je = {
|
|
|
491
491
|
},
|
|
492
492
|
Checkbox: ({ props: e, bindings: o, emit: n }) => {
|
|
493
493
|
const [s, i] = b(e.checked, o?.checked);
|
|
494
|
-
return d(
|
|
494
|
+
return d(ge, {
|
|
495
495
|
modelValue: s ?? !1,
|
|
496
496
|
label: e.label,
|
|
497
497
|
description: e.description,
|
|
@@ -503,7 +503,7 @@ const Je = {
|
|
|
503
503
|
},
|
|
504
504
|
Switch: ({ props: e, bindings: o, emit: n }) => {
|
|
505
505
|
const [s, i] = b(e.checked, o?.checked);
|
|
506
|
-
return d(
|
|
506
|
+
return d(fe, {
|
|
507
507
|
modelValue: s ?? !1,
|
|
508
508
|
label: e.label,
|
|
509
509
|
disabled: e.disabled,
|
|
@@ -514,7 +514,7 @@ const Je = {
|
|
|
514
514
|
},
|
|
515
515
|
RadioGroup: ({ props: e, bindings: o, emit: n }) => {
|
|
516
516
|
const [s, i] = b(e.value, o?.value);
|
|
517
|
-
return d(
|
|
517
|
+
return d(he, {
|
|
518
518
|
modelValue: s,
|
|
519
519
|
options: e.options,
|
|
520
520
|
orientation: e.orientation,
|
|
@@ -524,12 +524,12 @@ const Je = {
|
|
|
524
524
|
}
|
|
525
525
|
});
|
|
526
526
|
},
|
|
527
|
-
Form: ({ props: e, slots: o, emit: n }) => d(
|
|
527
|
+
Form: ({ props: e, slots: o, emit: n }) => d(me, {
|
|
528
528
|
direction: e.direction,
|
|
529
529
|
fieldWidth: e.fieldWidth,
|
|
530
530
|
onSubmit: () => n("submit")
|
|
531
531
|
}, o),
|
|
532
|
-
Field: ({ props: e, slots: o }) => d(
|
|
532
|
+
Field: ({ props: e, slots: o }) => d(ue, {
|
|
533
533
|
label: e.label,
|
|
534
534
|
description: e.description,
|
|
535
535
|
help: e.help,
|
|
@@ -539,7 +539,7 @@ const Je = {
|
|
|
539
539
|
}, o),
|
|
540
540
|
SettingsSection: ({ props: e, bindings: o, slots: n, emit: s }) => {
|
|
541
541
|
const [i, a] = b(e.open, o?.open);
|
|
542
|
-
return d(
|
|
542
|
+
return d(pe, {
|
|
543
543
|
title: e.title,
|
|
544
544
|
collapsible: e.collapsible,
|
|
545
545
|
open: i,
|
|
@@ -548,17 +548,17 @@ const Je = {
|
|
|
548
548
|
}
|
|
549
549
|
}, n);
|
|
550
550
|
},
|
|
551
|
-
SettingsField: ({ props: e, slots: o }) => d(
|
|
551
|
+
SettingsField: ({ props: e, slots: o }) => d(de, {
|
|
552
552
|
label: e.label,
|
|
553
553
|
description: e.description,
|
|
554
554
|
required: e.required,
|
|
555
555
|
fieldWidth: e.fieldWidth,
|
|
556
556
|
align: e.align
|
|
557
557
|
}, o),
|
|
558
|
-
Surface: ({ props: e, slots: o }) => d(
|
|
558
|
+
Surface: ({ props: e, slots: o }) => d(ce, e, o),
|
|
559
559
|
Card: ({ props: e, bindings: o, slots: n, emit: s }) => {
|
|
560
560
|
const [i, a] = b(e.expanded, o?.expanded);
|
|
561
|
-
return d(
|
|
561
|
+
return d(le, {
|
|
562
562
|
title: e.title,
|
|
563
563
|
layoutType: e.layoutType,
|
|
564
564
|
expandable: e.expandable,
|
|
@@ -569,23 +569,23 @@ const Je = {
|
|
|
569
569
|
}
|
|
570
570
|
}, n);
|
|
571
571
|
},
|
|
572
|
-
Callout: ({ props: e, slots: o, emit: n }) => d(
|
|
572
|
+
Callout: ({ props: e, slots: o, emit: n }) => d(re, {
|
|
573
573
|
tone: e.tone,
|
|
574
574
|
title: e.title,
|
|
575
575
|
closable: e.closable,
|
|
576
576
|
code: e.code,
|
|
577
577
|
onClose: () => n("close")
|
|
578
578
|
}, o),
|
|
579
|
-
EmptyState: ({ props: e, slots: o }) => d(
|
|
579
|
+
EmptyState: ({ props: e, slots: o }) => d(ae, {
|
|
580
580
|
title: e.title,
|
|
581
581
|
description: e.description,
|
|
582
|
-
icon:
|
|
582
|
+
icon: _(e.icon)
|
|
583
583
|
}, o),
|
|
584
|
-
Progress: ({ props: e }) => d(
|
|
585
|
-
Badge: ({ props: e }) => d(
|
|
584
|
+
Progress: ({ props: e }) => d(se, e),
|
|
585
|
+
Badge: ({ props: e }) => d(ie, { tone: e.tone }, Ue(e.text)),
|
|
586
586
|
Dialog: ({ props: e, bindings: o, slots: n, emit: s }) => {
|
|
587
587
|
const [i, a] = b(e.open, o?.open);
|
|
588
|
-
return d(
|
|
588
|
+
return d(ne, {
|
|
589
589
|
open: i ?? !1,
|
|
590
590
|
title: e.title,
|
|
591
591
|
description: e.description,
|
|
@@ -597,62 +597,80 @@ const Je = {
|
|
|
597
597
|
}
|
|
598
598
|
}, n);
|
|
599
599
|
},
|
|
600
|
-
DataTable: ({ props: e }) => d(
|
|
600
|
+
DataTable: ({ props: e }) => d(R, e),
|
|
601
601
|
ResourceList: ({ props: e, slots: o }) => d("section", { class: "min-w-0", "data-syno-pkg-land-ui": "", "data-ui-resource-list": "" }, [
|
|
602
602
|
o.toolbar ? d("div", { class: "mb-3 flex flex-wrap items-center gap-2" }, o.toolbar()) : null,
|
|
603
|
-
d(
|
|
603
|
+
d(R, e)
|
|
604
604
|
]),
|
|
605
|
-
CellText: ({ props: e, emit: o }) => d(
|
|
606
|
-
CellStatus: ({ props: e }) => d(
|
|
607
|
-
ListItem: ({ props: e, slots: o }) => d(
|
|
608
|
-
InputGroup: ({ slots: e }) => d(
|
|
609
|
-
Loading: ({ props: e }) => d(
|
|
610
|
-
}, { registry:
|
|
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, {
|
|
611
611
|
components: Je
|
|
612
|
-
}),
|
|
612
|
+
}), Ne = /* @__PURE__ */ B({
|
|
613
613
|
__name: "SynoJsonRenderer",
|
|
614
614
|
props: {
|
|
615
|
-
spec: {},
|
|
616
|
-
store: {},
|
|
617
|
-
state: {},
|
|
618
|
-
handlers: {},
|
|
619
|
-
navigate: { type: Function },
|
|
620
|
-
functions: {},
|
|
621
|
-
directives: {},
|
|
622
|
-
validationFunctions: {},
|
|
623
|
-
onStateChange: { type: Function },
|
|
624
|
-
loading: { type: Boolean },
|
|
625
|
-
fallback: {}
|
|
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 }
|
|
626
626
|
},
|
|
627
|
-
setup(e) {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
"on-state-change": e.onStateChange
|
|
638
|
-
}, {
|
|
639
|
-
default: Q(() => [
|
|
640
|
-
Z(j(B), {
|
|
641
|
-
spec: e.spec,
|
|
642
|
-
registry: j(D),
|
|
643
|
-
loading: e.loading,
|
|
644
|
-
fallback: e.fallback
|
|
645
|
-
}, null, 8, ["spec", "registry", "loading", "fallback"])
|
|
646
|
-
]),
|
|
647
|
-
_: 1
|
|
648
|
-
}, 8, ["registry", "store", "initial-state", "handlers", "navigate", "functions", "directives", "validation-functions", "on-state-change"]));
|
|
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;
|
|
649
637
|
}
|
|
650
|
-
}),
|
|
651
|
-
|
|
652
|
-
|
|
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}`]);
|
|
653
671
|
}
|
|
654
672
|
const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e), u = (...e) => e.map((o) => "/" + String(o).replaceAll("~", "~0").replaceAll("/", "~1")).join("");
|
|
655
|
-
function
|
|
673
|
+
function ze(e, o) {
|
|
656
674
|
const n = Array.from({ length: o.length + 1 }, (s, i) => i);
|
|
657
675
|
for (let s = 1; s <= e.length; s++) {
|
|
658
676
|
let i = n[0];
|
|
@@ -667,23 +685,23 @@ function _e(e, o) {
|
|
|
667
685
|
function y(e, o) {
|
|
668
686
|
let n, s = 1 / 0;
|
|
669
687
|
for (const i of o) {
|
|
670
|
-
const a =
|
|
688
|
+
const a = ze(e, i);
|
|
671
689
|
a < s && ([n, s] = [i, a]);
|
|
672
690
|
}
|
|
673
691
|
return n !== void 0 && s <= Math.max(2, Math.floor(e.length / 3)) ? n : void 0;
|
|
674
692
|
}
|
|
675
|
-
const
|
|
676
|
-
function
|
|
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
695
|
const o = e.props?.shape;
|
|
678
696
|
return m(o) ? o : void 0;
|
|
679
697
|
}
|
|
680
|
-
const
|
|
681
|
-
function
|
|
698
|
+
const C = (e) => e.safeParse(void 0).success;
|
|
699
|
+
function We(e) {
|
|
682
700
|
if (e.code === "invalid_value") return `Use one of: ${e.values.map((o) => JSON.stringify(o)).join(", ")}.`;
|
|
683
701
|
if (e.code === "invalid_type") return `Expected ${e.expected}.`;
|
|
684
702
|
}
|
|
685
703
|
const v = (e, o) => `${e}: ${o.join(", ")}`;
|
|
686
|
-
class
|
|
704
|
+
class Be {
|
|
687
705
|
errors = [];
|
|
688
706
|
warnings = [];
|
|
689
707
|
error(o) {
|
|
@@ -693,10 +711,10 @@ class Me {
|
|
|
693
711
|
this.warnings.push({ severity: "warning", ...o });
|
|
694
712
|
}
|
|
695
713
|
}
|
|
696
|
-
function
|
|
697
|
-
const n = o.catalog ??
|
|
714
|
+
function ft(e, o = {}) {
|
|
715
|
+
const n = o.catalog ?? O, s = n.data.components, i = new Be();
|
|
698
716
|
if (!m(e))
|
|
699
|
-
return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }),
|
|
717
|
+
return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }), L(i);
|
|
700
718
|
const a = m(e.elements) ? e.elements : void 0;
|
|
701
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": []}}}.' });
|
|
702
720
|
const r = Object.keys(a ?? {});
|
|
@@ -719,9 +737,9 @@ function mt(e, o = {}) {
|
|
|
719
737
|
});
|
|
720
738
|
continue;
|
|
721
739
|
}
|
|
722
|
-
|
|
740
|
+
He(i, p, h, s[h], f.props), Ge(i, p, h, s[h], f, a);
|
|
723
741
|
}
|
|
724
|
-
const c = o.messages &&
|
|
742
|
+
const c = o.messages && T(o.messages), l = {
|
|
725
743
|
issues: i,
|
|
726
744
|
components: s,
|
|
727
745
|
actions: [
|
|
@@ -734,15 +752,15 @@ function mt(e, o = {}) {
|
|
|
734
752
|
functions: o.functions || c ? [...o.functions ?? [], ...c ? ["t"] : []] : void 0,
|
|
735
753
|
messageKeys: c
|
|
736
754
|
};
|
|
737
|
-
return a && typeof e.root == "string" && Object.hasOwn(a, e.root) &&
|
|
755
|
+
return a && typeof e.root == "string" && Object.hasOwn(a, e.root) && Xe(l, e.root, a), L(i);
|
|
738
756
|
}
|
|
739
|
-
function
|
|
757
|
+
function He(e, o, n, s, i) {
|
|
740
758
|
const a = (...l) => u("elements", o, "props", ...l);
|
|
741
759
|
if (!m(i)) {
|
|
742
760
|
e.error({ code: "invalid_props", path: a(), elementKey: o, message: '"props" must be an object.', hint: 'Use "props": {} when the component needs none.' });
|
|
743
761
|
return;
|
|
744
762
|
}
|
|
745
|
-
const r =
|
|
763
|
+
const r = A(s);
|
|
746
764
|
if (!r) return;
|
|
747
765
|
const c = Object.keys(r);
|
|
748
766
|
for (const [l, p] of Object.entries(i)) {
|
|
@@ -758,7 +776,7 @@ function We(e, o, n, s, i) {
|
|
|
758
776
|
});
|
|
759
777
|
continue;
|
|
760
778
|
}
|
|
761
|
-
if (
|
|
779
|
+
if (k(p)) continue;
|
|
762
780
|
const w = f.safeParse(p);
|
|
763
781
|
if (!w.success)
|
|
764
782
|
for (const h of w.error.issues)
|
|
@@ -767,13 +785,13 @@ function We(e, o, n, s, i) {
|
|
|
767
785
|
path: a(l, ...h.path.map((g) => String(g))),
|
|
768
786
|
elementKey: o,
|
|
769
787
|
message: `${n}.${l}: ${h.message}`,
|
|
770
|
-
hint:
|
|
788
|
+
hint: We(h)
|
|
771
789
|
});
|
|
772
790
|
}
|
|
773
791
|
for (const l of c)
|
|
774
|
-
!Object.hasOwn(i, l) && !
|
|
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.` });
|
|
775
793
|
}
|
|
776
|
-
function
|
|
794
|
+
function E(e, o) {
|
|
777
795
|
const n = [];
|
|
778
796
|
if (Array.isArray(o.children) && o.children.forEach((s, i) => {
|
|
779
797
|
typeof s == "string" && n.push({ child: s, path: u("elements", e, "children", i) });
|
|
@@ -784,7 +802,7 @@ function q(e, o) {
|
|
|
784
802
|
});
|
|
785
803
|
return n;
|
|
786
804
|
}
|
|
787
|
-
function
|
|
805
|
+
function Ge(e, o, n, s, i, a) {
|
|
788
806
|
const r = s.slots ?? [], { children: c } = i;
|
|
789
807
|
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({
|
|
790
808
|
code: "children_not_allowed",
|
|
@@ -809,7 +827,7 @@ function Be(e, o, n, s, i, a) {
|
|
|
809
827
|
hint: f ? `Did you mean "${f}"?` : r.length ? v(`${n} slots`, r) : `${n} has no slots.`
|
|
810
828
|
});
|
|
811
829
|
}
|
|
812
|
-
for (const l of
|
|
830
|
+
for (const l of E(o, i))
|
|
813
831
|
if (!Object.hasOwn(a, l.child)) {
|
|
814
832
|
const p = y(l.child, Object.keys(a));
|
|
815
833
|
e.error({
|
|
@@ -821,16 +839,16 @@ function Be(e, o, n, s, i, a) {
|
|
|
821
839
|
});
|
|
822
840
|
}
|
|
823
841
|
}
|
|
824
|
-
function
|
|
842
|
+
function Xe(e, o, n) {
|
|
825
843
|
const { issues: s } = e, i = /* @__PURE__ */ new Set(), a = (r, c, l, p) => {
|
|
826
844
|
const f = n[r];
|
|
827
845
|
if (!m(f)) return;
|
|
828
846
|
i.add(r);
|
|
829
847
|
const w = m(f.repeat);
|
|
830
|
-
|
|
848
|
+
et(e, r, f, p || w);
|
|
831
849
|
const h = f.type === "AppRoot";
|
|
832
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." });
|
|
833
|
-
for (const g of
|
|
851
|
+
for (const g of E(r, f))
|
|
834
852
|
if (Object.hasOwn(n, g.child)) {
|
|
835
853
|
if (c.includes(g.child)) {
|
|
836
854
|
s.error({ code: "cycle", path: g.path, elementKey: r, message: `"${g.child}" is its own ancestor.`, hint: "Element references must form a tree." });
|
|
@@ -843,7 +861,7 @@ function He(e, o, n) {
|
|
|
843
861
|
for (const r of Object.keys(n))
|
|
844
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." });
|
|
845
863
|
}
|
|
846
|
-
function
|
|
864
|
+
function Ye(e, o) {
|
|
847
865
|
let n = e;
|
|
848
866
|
for (const s of o.split("/").slice(1)) {
|
|
849
867
|
const i = s.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
@@ -864,7 +882,7 @@ function S(e, o, n, s, { mustExist: i }) {
|
|
|
864
882
|
});
|
|
865
883
|
return;
|
|
866
884
|
}
|
|
867
|
-
i && !
|
|
885
|
+
i && !Ye(e.state, n).found && e.issues.warn({
|
|
868
886
|
code: "state_path_missing",
|
|
869
887
|
path: s,
|
|
870
888
|
elementKey: o,
|
|
@@ -872,9 +890,9 @@ function S(e, o, n, s, { mustExist: i }) {
|
|
|
872
890
|
hint: `Seed it in the spec's "state", or pass the host state with --state, so the first render has a value.`
|
|
873
891
|
});
|
|
874
892
|
}
|
|
875
|
-
function
|
|
893
|
+
function j(e, o, n, s, i) {
|
|
876
894
|
if (Array.isArray(n)) {
|
|
877
|
-
n.forEach((a, r) =>
|
|
895
|
+
n.forEach((a, r) => j(e, o, a, s + u(r), i));
|
|
878
896
|
return;
|
|
879
897
|
}
|
|
880
898
|
if (m(n)) {
|
|
@@ -891,12 +909,12 @@ function $(e, o, n, s, i) {
|
|
|
891
909
|
if (typeof n.$template == "string")
|
|
892
910
|
for (const a of n.$template.matchAll(/\$\{([^}]*)\}/g))
|
|
893
911
|
S(e, o, a[1], s + u("$template"), { mustExist: !0 });
|
|
894
|
-
typeof n.$computed == "string" &&
|
|
912
|
+
typeof n.$computed == "string" && Qe(e, o, n, s);
|
|
895
913
|
for (const [a, r] of Object.entries(n))
|
|
896
|
-
["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) ||
|
|
914
|
+
["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) || j(e, o, r, s + u(a), i);
|
|
897
915
|
}
|
|
898
916
|
}
|
|
899
|
-
function
|
|
917
|
+
function Qe(e, o, n, s) {
|
|
900
918
|
const i = n.$computed;
|
|
901
919
|
if (!e.functions)
|
|
902
920
|
e.issues.warn({
|
|
@@ -929,10 +947,10 @@ function Xe(e, o, n, s) {
|
|
|
929
947
|
});
|
|
930
948
|
}
|
|
931
949
|
}
|
|
932
|
-
const
|
|
933
|
-
function
|
|
950
|
+
const Ze = ["statePath", "clearStatePath"];
|
|
951
|
+
function et(e, o, n, s) {
|
|
934
952
|
const i = (...c) => u("elements", o, ...c);
|
|
935
|
-
if (
|
|
953
|
+
if (j(e, o, n.props, i("props"), s), e.messageKeys && m(n.props))
|
|
936
954
|
for (const c of Ve) {
|
|
937
955
|
const l = n.props[c];
|
|
938
956
|
typeof l == "string" && l.trim() && e.issues.warn({
|
|
@@ -943,7 +961,7 @@ function Qe(e, o, n, s) {
|
|
|
943
961
|
hint: 'Use {"$computed": "t", "args": {"key": "<message key>"}}.'
|
|
944
962
|
});
|
|
945
963
|
}
|
|
946
|
-
n.visible !== void 0 &&
|
|
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 });
|
|
947
965
|
const a = typeof n.type == "string" ? n.type : "", r = e.components[a]?.events ?? [];
|
|
948
966
|
if (m(n.on))
|
|
949
967
|
for (const [c, l] of Object.entries(n.on)) {
|
|
@@ -957,13 +975,13 @@ function Qe(e, o, n, s) {
|
|
|
957
975
|
hint: p ? `Did you mean "${p}"?` : r.length ? v(`${a} events`, r) : `${a} emits no events.`
|
|
958
976
|
});
|
|
959
977
|
}
|
|
960
|
-
|
|
978
|
+
K(e, o, l, i("on", c), s);
|
|
961
979
|
}
|
|
962
980
|
if (m(n.watch))
|
|
963
981
|
for (const [c, l] of Object.entries(n.watch))
|
|
964
|
-
S(e, o, c, i("watch", c), { mustExist: !1 }),
|
|
982
|
+
S(e, o, c, i("watch", c), { mustExist: !1 }), K(e, o, l, i("watch", c), s);
|
|
965
983
|
}
|
|
966
|
-
function
|
|
984
|
+
function K(e, o, n, s, i) {
|
|
967
985
|
(Array.isArray(n) ? n : [n]).forEach((r, c) => {
|
|
968
986
|
const l = Array.isArray(n) ? s + u(c) : s;
|
|
969
987
|
if (!m(r) || typeof r.action != "string") {
|
|
@@ -981,21 +999,21 @@ function U(e, o, n, s, i) {
|
|
|
981
999
|
});
|
|
982
1000
|
}
|
|
983
1001
|
if (m(r.params)) {
|
|
984
|
-
for (const p of
|
|
1002
|
+
for (const p of Ze)
|
|
985
1003
|
Object.hasOwn(r.params, p) && S(e, o, r.params[p], l + u("params", p), { mustExist: !1 });
|
|
986
|
-
|
|
1004
|
+
j(e, o, r.params, l + u("params"), i);
|
|
987
1005
|
}
|
|
988
1006
|
});
|
|
989
1007
|
}
|
|
990
|
-
function
|
|
1008
|
+
function L(e) {
|
|
991
1009
|
return { valid: e.errors.length === 0, errors: e.errors, warnings: e.warnings };
|
|
992
1010
|
}
|
|
993
|
-
const
|
|
994
|
-
function
|
|
1011
|
+
const $ = q;
|
|
1012
|
+
function tt(e) {
|
|
995
1013
|
const o = t.toJSONSchema(e);
|
|
996
1014
|
return delete o.$schema, o;
|
|
997
1015
|
}
|
|
998
|
-
function
|
|
1016
|
+
function ot(e) {
|
|
999
1017
|
if (Array.isArray(e.enum)) return e.enum[0];
|
|
1000
1018
|
switch (e.type) {
|
|
1001
1019
|
case "string":
|
|
@@ -1011,23 +1029,23 @@ function et(e) {
|
|
|
1011
1029
|
return {};
|
|
1012
1030
|
}
|
|
1013
1031
|
}
|
|
1014
|
-
function
|
|
1015
|
-
return Object.entries(
|
|
1032
|
+
function gt() {
|
|
1033
|
+
return Object.entries($).map(([e, o]) => ({
|
|
1016
1034
|
name: e,
|
|
1017
1035
|
description: o.description,
|
|
1018
|
-
required: Object.entries(
|
|
1036
|
+
required: Object.entries(A(o) ?? {}).filter(([, n]) => !C(n)).map(([n]) => n),
|
|
1019
1037
|
slots: o.slots ?? [],
|
|
1020
1038
|
events: o.events ?? []
|
|
1021
1039
|
}));
|
|
1022
1040
|
}
|
|
1023
|
-
function
|
|
1024
|
-
return y(e, Object.keys(
|
|
1041
|
+
function bt(e) {
|
|
1042
|
+
return y(e, Object.keys($));
|
|
1025
1043
|
}
|
|
1026
|
-
function
|
|
1027
|
-
if (!Object.hasOwn(
|
|
1028
|
-
const o =
|
|
1044
|
+
function yt(e) {
|
|
1045
|
+
if (!Object.hasOwn($, e)) return;
|
|
1046
|
+
const o = $[e], n = Object.fromEntries(Object.entries(A(o) ?? {}).map(([s, i]) => [
|
|
1029
1047
|
s,
|
|
1030
|
-
{ required: !
|
|
1048
|
+
{ required: !C(i), schema: tt(i) }
|
|
1031
1049
|
]));
|
|
1032
1050
|
return {
|
|
1033
1051
|
name: e,
|
|
@@ -1037,16 +1055,16 @@ function gt(e) {
|
|
|
1037
1055
|
events: o.events ?? [],
|
|
1038
1056
|
example: {
|
|
1039
1057
|
type: e,
|
|
1040
|
-
props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s,
|
|
1058
|
+
props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s, ot(i)])),
|
|
1041
1059
|
children: []
|
|
1042
1060
|
}
|
|
1043
1061
|
};
|
|
1044
1062
|
}
|
|
1045
|
-
const
|
|
1063
|
+
const x = { type: "string", pattern: "^/" }, nt = {
|
|
1046
1064
|
description: "A json-render expression resolved at render time.",
|
|
1047
1065
|
anyOf: [
|
|
1048
|
-
{ type: "object", required: ["$state"], properties: { $state:
|
|
1049
|
-
{ type: "object", required: ["$bindState"], properties: { $bindState:
|
|
1066
|
+
{ type: "object", required: ["$state"], properties: { $state: x } },
|
|
1067
|
+
{ type: "object", required: ["$bindState"], properties: { $bindState: x } },
|
|
1050
1068
|
{ type: "object", required: ["$item"], properties: { $item: { type: "string" } } },
|
|
1051
1069
|
{ type: "object", required: ["$bindItem"], properties: { $bindItem: { type: "string" } } },
|
|
1052
1070
|
{ type: "object", required: ["$index"], properties: { $index: { const: !0 } } },
|
|
@@ -1054,7 +1072,7 @@ const O = { type: "string", pattern: "^/" }, tt = {
|
|
|
1054
1072
|
{ type: "object", required: ["$computed"], properties: { $computed: { type: "string" }, args: { type: "object" } } },
|
|
1055
1073
|
{ type: "object", required: ["$cond", "$then", "$else"], properties: { $cond: {}, $then: {}, $else: {} } }
|
|
1056
1074
|
]
|
|
1057
|
-
},
|
|
1075
|
+
}, it = {
|
|
1058
1076
|
type: "object",
|
|
1059
1077
|
required: ["action"],
|
|
1060
1078
|
properties: {
|
|
@@ -1066,8 +1084,8 @@ const O = { type: "string", pattern: "^/" }, tt = {
|
|
|
1066
1084
|
preventDefault: { type: "boolean" }
|
|
1067
1085
|
},
|
|
1068
1086
|
additionalProperties: !1
|
|
1069
|
-
},
|
|
1070
|
-
function
|
|
1087
|
+
}, U = { anyOf: [{ $ref: "#/$defs/actionBinding" }, { type: "array", items: { $ref: "#/$defs/actionBinding" } }] }, D = { type: "array", items: { type: "string" } };
|
|
1088
|
+
function st(e, o, n) {
|
|
1071
1089
|
const s = (r) => Array.isArray(r) ? r.map(s) : !r || typeof r != "object" ? r : Object.fromEntries(Object.entries(r).map(([c, l]) => [
|
|
1072
1090
|
c,
|
|
1073
1091
|
c === "$ref" && typeof l == "string" ? l.replace("#/$defs/", `#/$defs/${o}`) : s(l)
|
|
@@ -1076,11 +1094,11 @@ function nt(e, o, n) {
|
|
|
1076
1094
|
for (const [r, c] of Object.entries(i ?? {})) n[o + r] = s(c);
|
|
1077
1095
|
return s(a);
|
|
1078
1096
|
}
|
|
1079
|
-
function
|
|
1080
|
-
const s =
|
|
1097
|
+
function at(e, o, n) {
|
|
1098
|
+
const s = A(o), i = o.slots ?? [];
|
|
1081
1099
|
let a = { type: "object" };
|
|
1082
1100
|
if (s) {
|
|
1083
|
-
const r =
|
|
1101
|
+
const r = st(t.toJSONSchema(t.object(s)), `${e}__`, n), c = r.properties;
|
|
1084
1102
|
a = {
|
|
1085
1103
|
...r,
|
|
1086
1104
|
properties: Object.fromEntries(Object.entries(c).map(([l, p]) => [
|
|
@@ -1102,20 +1120,20 @@ function it(e, o, n) {
|
|
|
1102
1120
|
}
|
|
1103
1121
|
};
|
|
1104
1122
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const o = e.data.components, n = { expression:
|
|
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
1125
|
return n.element = {
|
|
1108
1126
|
type: "object",
|
|
1109
1127
|
required: ["type", "props"],
|
|
1110
1128
|
properties: {
|
|
1111
1129
|
type: { enum: Object.keys(o) },
|
|
1112
1130
|
props: { type: "object" },
|
|
1113
|
-
children:
|
|
1114
|
-
slots: { type: "object", additionalProperties:
|
|
1131
|
+
children: D,
|
|
1132
|
+
slots: { type: "object", additionalProperties: D },
|
|
1115
1133
|
visible: {},
|
|
1116
|
-
on: { type: "object", additionalProperties:
|
|
1117
|
-
watch: { type: "object", propertyNames:
|
|
1118
|
-
repeat: { type: "object", required: ["statePath"], properties: { statePath:
|
|
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 }
|
|
1119
1137
|
},
|
|
1120
1138
|
additionalProperties: !1,
|
|
1121
1139
|
allOf: s
|
|
@@ -1134,30 +1152,30 @@ function bt(e = A) {
|
|
|
1134
1152
|
};
|
|
1135
1153
|
}
|
|
1136
1154
|
export {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1155
|
+
Pt as ActionProvider,
|
|
1156
|
+
_t as JSONUIProvider,
|
|
1157
|
+
kt as Renderer,
|
|
1158
|
+
Ct as StateProvider,
|
|
1159
|
+
ht as SynoJsonRenderer,
|
|
1160
|
+
Rt as ValidationProvider,
|
|
1143
1161
|
It as VisibilityProvider,
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
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,
|
|
1156
1174
|
Je as synoJsonRenderers,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1175
|
+
wt as synoJsonSchema,
|
|
1176
|
+
Lt as useActions,
|
|
1177
|
+
Ut as useBoundProp,
|
|
1160
1178
|
Dt as useStateStore,
|
|
1161
|
-
|
|
1162
|
-
|
|
1179
|
+
ft as validateSynoJsonSpec,
|
|
1180
|
+
jt as z
|
|
1163
1181
|
};
|