@synopackageland/ui 0.12.5 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/components/advanced-panel/AdvancePanelGrid.vue.d.ts +5 -5
- package/dist/components/composite/about-dialog/AboutDialog.vue.d.ts +5 -4
- package/dist/components/composite/about-dialog/types.d.ts +3 -2
- package/dist/components/composite/connection-topology/ConnectionTopology.vue.d.ts +3 -0
- package/dist/components/composite/data-grid/DataGrid.vue.d.ts +1 -1
- package/dist/components/composite/data-table/DataTable.vue.d.ts +6 -3
- package/dist/components/composite/overflow-toolbar/overflow.d.ts +3 -1
- package/dist/components/composite/scroll-edges/ScrollEdges.vue.d.ts +8 -1
- package/dist/components/composite/tree-view/TreeView.vue.d.ts +7 -5
- package/dist/components/composite/virtual-list/VirtualList.vue.d.ts +2 -0
- package/dist/components/containers/card-grid/cardGrid.d.ts +2 -2
- package/dist/components/containers/expandable-item/ExpandableItem.vue.d.ts +7 -7
- package/dist/components/primitives/color-picker/ColorPicker.vue.d.ts +4 -4
- package/dist/components/primitives/context-menu/ContextMenu.vue.d.ts +2 -2
- package/dist/components/primitives/context-menu/ContextMenuItems.vue.d.ts +5 -1
- package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +3 -0
- package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +3 -0
- package/dist/components/primitives/pagination/Pagination.vue.d.ts +3 -0
- package/dist/components/primitives/segment-control/SegmentItem.vue.d.ts +1 -1
- package/dist/components/primitives/spinner/Spinner.vue.d.ts +3 -0
- package/dist/components/primitives/tooltip/OverflowTooltip.vue.d.ts +3 -0
- package/dist/components/primitives/tooltip/Tooltip.vue.d.ts +5 -2
- package/dist/components/primitives/tooltip/tooltipStyle.d.ts +1 -1
- package/dist/components/primitives/typography/TypoHeader.vue.d.ts +3 -0
- package/dist/composables/formControl.d.ts +1 -0
- package/dist/composables/scrollEdges.d.ts +8 -4
- package/dist/i18n/text.d.ts +1 -0
- package/dist/index.js +17975 -21895
- package/dist/json/catalog.d.ts +10 -10
- package/dist/json/registry.d.ts +170 -170
- package/dist/json-preview/preview.js +9895 -10908
- package/dist/json.js +204 -222
- 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/package.json +1 -1
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 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 Tt } 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 se, Badge as ae, 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
|
-
})),
|
|
19
|
+
})), k = t.object({
|
|
20
20
|
label: t.string(),
|
|
21
21
|
value: t.string(),
|
|
22
22
|
disabled: t.boolean().optional()
|
|
23
|
-
}),
|
|
23
|
+
}), Re = k.extend({
|
|
24
24
|
description: t.string().optional()
|
|
25
|
-
}),
|
|
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
|
-
}),
|
|
32
|
+
}), V = {
|
|
33
33
|
AppRoot: {
|
|
34
34
|
props: t.object({
|
|
35
35
|
modalScope: t.enum(["document", "app"]).optional()
|
|
@@ -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(k),
|
|
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(k),
|
|
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(Re),
|
|
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(L),
|
|
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(L),
|
|
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
|
+
}, A = F(H, {
|
|
359
|
+
components: V,
|
|
360
360
|
actions: {}
|
|
361
|
-
}),
|
|
361
|
+
}), Ke = [
|
|
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
|
+
], 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.';
|
|
371
|
+
function pt() {
|
|
372
|
+
return `${A.prompt({ customRules: Ke })}
|
|
373
373
|
|
|
374
|
-
${
|
|
374
|
+
${Le}
|
|
375
375
|
`;
|
|
376
376
|
}
|
|
377
|
-
const
|
|
377
|
+
const De = {
|
|
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
|
+
}, Ue = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" }, Te = { start: "flex-start", center: "center", end: "flex-end", between: "space-between" };
|
|
384
|
+
function Ee(e) {
|
|
385
385
|
return { default: () => e };
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
return e ?
|
|
387
|
+
function C(e) {
|
|
388
|
+
return e ? Ie(e) : void 0;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function _(e) {
|
|
391
391
|
return {
|
|
392
392
|
...e,
|
|
393
|
-
icon:
|
|
394
|
-
children: e.children?.map(
|
|
393
|
+
icon: C(e.icon),
|
|
394
|
+
children: e.children?.map(_)
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
return e.map((o) => ({ ...o, items: o.items.map(
|
|
397
|
+
function Ne(e) {
|
|
398
|
+
return e.map((o) => ({ ...o, items: o.items.map(_) }));
|
|
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(Ce, { modalScope: e.modalScope }, o),
|
|
402
|
+
AppShell: ({ props: e, slots: o }) => d(ke, {
|
|
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(Pe, { mode: e.mode }, o),
|
|
409
|
+
Page: ({ props: e, slots: o }) => d(Ae, { width: e.width ?? "fill", surface: e.surface }, o),
|
|
410
|
+
PageHeader: ({ props: e, slots: o }) => d(Oe, e, o),
|
|
411
|
+
Toolbar: ({ props: e, slots: o }) => d(xe, 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(je, {
|
|
415
415
|
modelValue: s,
|
|
416
|
-
groups:
|
|
416
|
+
groups: Ne(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($e, {
|
|
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: De[e.gap ?? "md"],
|
|
442
|
+
alignItems: Ue[e.align ?? "stretch"],
|
|
443
|
+
justifyContent: Te[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 = C(e.icon);
|
|
453
|
+
return d(Se, {
|
|
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(ve, {
|
|
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(we, {
|
|
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(ye, {
|
|
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(be, {
|
|
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(ge, {
|
|
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(fe, {
|
|
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(he, {
|
|
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(me, {
|
|
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(ue, {
|
|
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(pe, 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(de, {
|
|
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(ce, {
|
|
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(le, {
|
|
580
580
|
title: e.title,
|
|
581
581
|
description: e.description,
|
|
582
|
-
icon:
|
|
582
|
+
icon: C(e.icon)
|
|
583
583
|
}, o),
|
|
584
|
-
Progress: ({ props: e }) => d(
|
|
585
|
-
Badge: ({ props: e }) => d(
|
|
584
|
+
Progress: ({ props: e }) => d(re, e),
|
|
585
|
+
Badge: ({ props: e }) => d(ae, { tone: e.tone }, Ee(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(se, {
|
|
589
589
|
open: i ?? !1,
|
|
590
590
|
title: e.title,
|
|
591
591
|
description: e.description,
|
|
@@ -597,80 +597,62 @@ const Je = {
|
|
|
597
597
|
}
|
|
598
598
|
}, n);
|
|
599
599
|
},
|
|
600
|
-
DataTable: ({ props: e }) => d(
|
|
600
|
+
DataTable: ({ props: e }) => d(K, 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(K, 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(ie, { ...e, onOpen: () => o("open") }),
|
|
606
|
+
CellStatus: ({ props: e }) => d(ne, e),
|
|
607
|
+
ListItem: ({ props: e, slots: o }) => d(oe, e, o),
|
|
608
|
+
InputGroup: ({ slots: e }) => d(te, null, e),
|
|
609
|
+
Loading: ({ props: e }) => d(ee, { text: e.text })
|
|
610
|
+
}, { registry: D } = M(A, {
|
|
611
611
|
components: Je
|
|
612
|
-
}),
|
|
612
|
+
}), ut = /* @__PURE__ */ G({
|
|
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: {},
|
|
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: {}
|
|
626
626
|
},
|
|
627
|
-
setup(e
|
|
628
|
-
o()
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
627
|
+
setup(e) {
|
|
628
|
+
return (o, n) => (X(), Y(j(W), {
|
|
629
|
+
registry: j(D),
|
|
630
|
+
store: e.store,
|
|
631
|
+
"initial-state": e.state ?? e.spec?.state ?? {},
|
|
632
|
+
handlers: e.handlers,
|
|
633
|
+
navigate: e.navigate,
|
|
634
|
+
functions: e.functions,
|
|
635
|
+
directives: e.directives,
|
|
636
|
+
"validation-functions": e.validationFunctions,
|
|
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"]));
|
|
637
649
|
}
|
|
638
|
-
}),
|
|
639
|
-
|
|
640
|
-
|
|
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}`]);
|
|
650
|
+
}), Ve = ["label", "title", "description", "text", "placeholder", "emptyText", "help", "ariaLabel", "valueLabel", "searchPlaceholder"];
|
|
651
|
+
function z(e, o = "") {
|
|
652
|
+
return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, s]) => m(s) ? z(s, `${o}${n}.`) : [`${o}${n}`]);
|
|
671
653
|
}
|
|
672
654
|
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
|
|
655
|
+
function _e(e, o) {
|
|
674
656
|
const n = Array.from({ length: o.length + 1 }, (s, i) => i);
|
|
675
657
|
for (let s = 1; s <= e.length; s++) {
|
|
676
658
|
let i = n[0];
|
|
@@ -685,23 +667,23 @@ function ze(e, o) {
|
|
|
685
667
|
function y(e, o) {
|
|
686
668
|
let n, s = 1 / 0;
|
|
687
669
|
for (const i of o) {
|
|
688
|
-
const a =
|
|
670
|
+
const a = _e(e, i);
|
|
689
671
|
a < s && ([n, s] = [i, a]);
|
|
690
672
|
}
|
|
691
673
|
return n !== void 0 && s <= Math.max(2, Math.floor(e.length / 3)) ? n : void 0;
|
|
692
674
|
}
|
|
693
|
-
const
|
|
694
|
-
function
|
|
675
|
+
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));
|
|
676
|
+
function P(e) {
|
|
695
677
|
const o = e.props?.shape;
|
|
696
678
|
return m(o) ? o : void 0;
|
|
697
679
|
}
|
|
698
|
-
const
|
|
699
|
-
function
|
|
680
|
+
const R = (e) => e.safeParse(void 0).success;
|
|
681
|
+
function Fe(e) {
|
|
700
682
|
if (e.code === "invalid_value") return `Use one of: ${e.values.map((o) => JSON.stringify(o)).join(", ")}.`;
|
|
701
683
|
if (e.code === "invalid_type") return `Expected ${e.expected}.`;
|
|
702
684
|
}
|
|
703
685
|
const v = (e, o) => `${e}: ${o.join(", ")}`;
|
|
704
|
-
class
|
|
686
|
+
class Me {
|
|
705
687
|
errors = [];
|
|
706
688
|
warnings = [];
|
|
707
689
|
error(o) {
|
|
@@ -711,10 +693,10 @@ class Be {
|
|
|
711
693
|
this.warnings.push({ severity: "warning", ...o });
|
|
712
694
|
}
|
|
713
695
|
}
|
|
714
|
-
function
|
|
715
|
-
const n = o.catalog ??
|
|
696
|
+
function mt(e, o = {}) {
|
|
697
|
+
const n = o.catalog ?? A, s = n.data.components, i = new Me();
|
|
716
698
|
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": {...}}.' }),
|
|
699
|
+
return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }), T(i);
|
|
718
700
|
const a = m(e.elements) ? e.elements : void 0;
|
|
719
701
|
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
702
|
const r = Object.keys(a ?? {});
|
|
@@ -737,9 +719,9 @@ function ft(e, o = {}) {
|
|
|
737
719
|
});
|
|
738
720
|
continue;
|
|
739
721
|
}
|
|
740
|
-
|
|
722
|
+
We(i, p, h, s[h], f.props), Be(i, p, h, s[h], f, a);
|
|
741
723
|
}
|
|
742
|
-
const c = o.messages &&
|
|
724
|
+
const c = o.messages && z(o.messages), l = {
|
|
743
725
|
issues: i,
|
|
744
726
|
components: s,
|
|
745
727
|
actions: [
|
|
@@ -752,15 +734,15 @@ function ft(e, o = {}) {
|
|
|
752
734
|
functions: o.functions || c ? [...o.functions ?? [], ...c ? ["t"] : []] : void 0,
|
|
753
735
|
messageKeys: c
|
|
754
736
|
};
|
|
755
|
-
return a && typeof e.root == "string" && Object.hasOwn(a, e.root) &&
|
|
737
|
+
return a && typeof e.root == "string" && Object.hasOwn(a, e.root) && He(l, e.root, a), T(i);
|
|
756
738
|
}
|
|
757
|
-
function
|
|
739
|
+
function We(e, o, n, s, i) {
|
|
758
740
|
const a = (...l) => u("elements", o, "props", ...l);
|
|
759
741
|
if (!m(i)) {
|
|
760
742
|
e.error({ code: "invalid_props", path: a(), elementKey: o, message: '"props" must be an object.', hint: 'Use "props": {} when the component needs none.' });
|
|
761
743
|
return;
|
|
762
744
|
}
|
|
763
|
-
const r =
|
|
745
|
+
const r = P(s);
|
|
764
746
|
if (!r) return;
|
|
765
747
|
const c = Object.keys(r);
|
|
766
748
|
for (const [l, p] of Object.entries(i)) {
|
|
@@ -776,7 +758,7 @@ function He(e, o, n, s, i) {
|
|
|
776
758
|
});
|
|
777
759
|
continue;
|
|
778
760
|
}
|
|
779
|
-
if (
|
|
761
|
+
if (I(p)) continue;
|
|
780
762
|
const w = f.safeParse(p);
|
|
781
763
|
if (!w.success)
|
|
782
764
|
for (const h of w.error.issues)
|
|
@@ -785,13 +767,13 @@ function He(e, o, n, s, i) {
|
|
|
785
767
|
path: a(l, ...h.path.map((g) => String(g))),
|
|
786
768
|
elementKey: o,
|
|
787
769
|
message: `${n}.${l}: ${h.message}`,
|
|
788
|
-
hint:
|
|
770
|
+
hint: Fe(h)
|
|
789
771
|
});
|
|
790
772
|
}
|
|
791
773
|
for (const l of c)
|
|
792
|
-
!Object.hasOwn(i, l) && !
|
|
774
|
+
!Object.hasOwn(i, l) && !R(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.` });
|
|
793
775
|
}
|
|
794
|
-
function
|
|
776
|
+
function q(e, o) {
|
|
795
777
|
const n = [];
|
|
796
778
|
if (Array.isArray(o.children) && o.children.forEach((s, i) => {
|
|
797
779
|
typeof s == "string" && n.push({ child: s, path: u("elements", e, "children", i) });
|
|
@@ -802,7 +784,7 @@ function E(e, o) {
|
|
|
802
784
|
});
|
|
803
785
|
return n;
|
|
804
786
|
}
|
|
805
|
-
function
|
|
787
|
+
function Be(e, o, n, s, i, a) {
|
|
806
788
|
const r = s.slots ?? [], { children: c } = i;
|
|
807
789
|
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
790
|
code: "children_not_allowed",
|
|
@@ -827,7 +809,7 @@ function Ge(e, o, n, s, i, a) {
|
|
|
827
809
|
hint: f ? `Did you mean "${f}"?` : r.length ? v(`${n} slots`, r) : `${n} has no slots.`
|
|
828
810
|
});
|
|
829
811
|
}
|
|
830
|
-
for (const l of
|
|
812
|
+
for (const l of q(o, i))
|
|
831
813
|
if (!Object.hasOwn(a, l.child)) {
|
|
832
814
|
const p = y(l.child, Object.keys(a));
|
|
833
815
|
e.error({
|
|
@@ -839,16 +821,16 @@ function Ge(e, o, n, s, i, a) {
|
|
|
839
821
|
});
|
|
840
822
|
}
|
|
841
823
|
}
|
|
842
|
-
function
|
|
824
|
+
function He(e, o, n) {
|
|
843
825
|
const { issues: s } = e, i = /* @__PURE__ */ new Set(), a = (r, c, l, p) => {
|
|
844
826
|
const f = n[r];
|
|
845
827
|
if (!m(f)) return;
|
|
846
828
|
i.add(r);
|
|
847
829
|
const w = m(f.repeat);
|
|
848
|
-
|
|
830
|
+
Qe(e, r, f, p || w);
|
|
849
831
|
const h = f.type === "AppRoot";
|
|
850
832
|
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
|
|
833
|
+
for (const g of q(r, f))
|
|
852
834
|
if (Object.hasOwn(n, g.child)) {
|
|
853
835
|
if (c.includes(g.child)) {
|
|
854
836
|
s.error({ code: "cycle", path: g.path, elementKey: r, message: `"${g.child}" is its own ancestor.`, hint: "Element references must form a tree." });
|
|
@@ -861,7 +843,7 @@ function Xe(e, o, n) {
|
|
|
861
843
|
for (const r of Object.keys(n))
|
|
862
844
|
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." });
|
|
863
845
|
}
|
|
864
|
-
function
|
|
846
|
+
function Ge(e, o) {
|
|
865
847
|
let n = e;
|
|
866
848
|
for (const s of o.split("/").slice(1)) {
|
|
867
849
|
const i = s.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
@@ -882,7 +864,7 @@ function S(e, o, n, s, { mustExist: i }) {
|
|
|
882
864
|
});
|
|
883
865
|
return;
|
|
884
866
|
}
|
|
885
|
-
i && !
|
|
867
|
+
i && !Ge(e.state, n).found && e.issues.warn({
|
|
886
868
|
code: "state_path_missing",
|
|
887
869
|
path: s,
|
|
888
870
|
elementKey: o,
|
|
@@ -890,9 +872,9 @@ function S(e, o, n, s, { mustExist: i }) {
|
|
|
890
872
|
hint: `Seed it in the spec's "state", or pass the host state with --state, so the first render has a value.`
|
|
891
873
|
});
|
|
892
874
|
}
|
|
893
|
-
function
|
|
875
|
+
function $(e, o, n, s, i) {
|
|
894
876
|
if (Array.isArray(n)) {
|
|
895
|
-
n.forEach((a, r) =>
|
|
877
|
+
n.forEach((a, r) => $(e, o, a, s + u(r), i));
|
|
896
878
|
return;
|
|
897
879
|
}
|
|
898
880
|
if (m(n)) {
|
|
@@ -909,12 +891,12 @@ function j(e, o, n, s, i) {
|
|
|
909
891
|
if (typeof n.$template == "string")
|
|
910
892
|
for (const a of n.$template.matchAll(/\$\{([^}]*)\}/g))
|
|
911
893
|
S(e, o, a[1], s + u("$template"), { mustExist: !0 });
|
|
912
|
-
typeof n.$computed == "string" &&
|
|
894
|
+
typeof n.$computed == "string" && Xe(e, o, n, s);
|
|
913
895
|
for (const [a, r] of Object.entries(n))
|
|
914
|
-
["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) ||
|
|
896
|
+
["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) || $(e, o, r, s + u(a), i);
|
|
915
897
|
}
|
|
916
898
|
}
|
|
917
|
-
function
|
|
899
|
+
function Xe(e, o, n, s) {
|
|
918
900
|
const i = n.$computed;
|
|
919
901
|
if (!e.functions)
|
|
920
902
|
e.issues.warn({
|
|
@@ -947,10 +929,10 @@ function Qe(e, o, n, s) {
|
|
|
947
929
|
});
|
|
948
930
|
}
|
|
949
931
|
}
|
|
950
|
-
const
|
|
951
|
-
function
|
|
932
|
+
const Ye = ["statePath", "clearStatePath"];
|
|
933
|
+
function Qe(e, o, n, s) {
|
|
952
934
|
const i = (...c) => u("elements", o, ...c);
|
|
953
|
-
if (
|
|
935
|
+
if ($(e, o, n.props, i("props"), s), e.messageKeys && m(n.props))
|
|
954
936
|
for (const c of Ve) {
|
|
955
937
|
const l = n.props[c];
|
|
956
938
|
typeof l == "string" && l.trim() && e.issues.warn({
|
|
@@ -961,7 +943,7 @@ function et(e, o, n, s) {
|
|
|
961
943
|
hint: 'Use {"$computed": "t", "args": {"key": "<message key>"}}.'
|
|
962
944
|
});
|
|
963
945
|
}
|
|
964
|
-
n.visible !== void 0 &&
|
|
946
|
+
n.visible !== void 0 && $(e, o, n.visible, i("visible"), s), m(n.repeat) && S(e, o, n.repeat.statePath, i("repeat", "statePath"), { mustExist: !0 });
|
|
965
947
|
const a = typeof n.type == "string" ? n.type : "", r = e.components[a]?.events ?? [];
|
|
966
948
|
if (m(n.on))
|
|
967
949
|
for (const [c, l] of Object.entries(n.on)) {
|
|
@@ -975,13 +957,13 @@ function et(e, o, n, s) {
|
|
|
975
957
|
hint: p ? `Did you mean "${p}"?` : r.length ? v(`${a} events`, r) : `${a} emits no events.`
|
|
976
958
|
});
|
|
977
959
|
}
|
|
978
|
-
|
|
960
|
+
U(e, o, l, i("on", c), s);
|
|
979
961
|
}
|
|
980
962
|
if (m(n.watch))
|
|
981
963
|
for (const [c, l] of Object.entries(n.watch))
|
|
982
|
-
S(e, o, c, i("watch", c), { mustExist: !1 }),
|
|
964
|
+
S(e, o, c, i("watch", c), { mustExist: !1 }), U(e, o, l, i("watch", c), s);
|
|
983
965
|
}
|
|
984
|
-
function
|
|
966
|
+
function U(e, o, n, s, i) {
|
|
985
967
|
(Array.isArray(n) ? n : [n]).forEach((r, c) => {
|
|
986
968
|
const l = Array.isArray(n) ? s + u(c) : s;
|
|
987
969
|
if (!m(r) || typeof r.action != "string") {
|
|
@@ -999,21 +981,21 @@ function K(e, o, n, s, i) {
|
|
|
999
981
|
});
|
|
1000
982
|
}
|
|
1001
983
|
if (m(r.params)) {
|
|
1002
|
-
for (const p of
|
|
984
|
+
for (const p of Ye)
|
|
1003
985
|
Object.hasOwn(r.params, p) && S(e, o, r.params[p], l + u("params", p), { mustExist: !1 });
|
|
1004
|
-
|
|
986
|
+
$(e, o, r.params, l + u("params"), i);
|
|
1005
987
|
}
|
|
1006
988
|
});
|
|
1007
989
|
}
|
|
1008
|
-
function
|
|
990
|
+
function T(e) {
|
|
1009
991
|
return { valid: e.errors.length === 0, errors: e.errors, warnings: e.warnings };
|
|
1010
992
|
}
|
|
1011
|
-
const
|
|
1012
|
-
function
|
|
993
|
+
const x = V;
|
|
994
|
+
function Ze(e) {
|
|
1013
995
|
const o = t.toJSONSchema(e);
|
|
1014
996
|
return delete o.$schema, o;
|
|
1015
997
|
}
|
|
1016
|
-
function
|
|
998
|
+
function et(e) {
|
|
1017
999
|
if (Array.isArray(e.enum)) return e.enum[0];
|
|
1018
1000
|
switch (e.type) {
|
|
1019
1001
|
case "string":
|
|
@@ -1029,23 +1011,23 @@ function ot(e) {
|
|
|
1029
1011
|
return {};
|
|
1030
1012
|
}
|
|
1031
1013
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return Object.entries(
|
|
1014
|
+
function ht() {
|
|
1015
|
+
return Object.entries(x).map(([e, o]) => ({
|
|
1034
1016
|
name: e,
|
|
1035
1017
|
description: o.description,
|
|
1036
|
-
required: Object.entries(
|
|
1018
|
+
required: Object.entries(P(o) ?? {}).filter(([, n]) => !R(n)).map(([n]) => n),
|
|
1037
1019
|
slots: o.slots ?? [],
|
|
1038
1020
|
events: o.events ?? []
|
|
1039
1021
|
}));
|
|
1040
1022
|
}
|
|
1041
|
-
function
|
|
1042
|
-
return y(e, Object.keys(
|
|
1023
|
+
function ft(e) {
|
|
1024
|
+
return y(e, Object.keys(x));
|
|
1043
1025
|
}
|
|
1044
|
-
function
|
|
1045
|
-
if (!Object.hasOwn(
|
|
1046
|
-
const o =
|
|
1026
|
+
function gt(e) {
|
|
1027
|
+
if (!Object.hasOwn(x, e)) return;
|
|
1028
|
+
const o = x[e], n = Object.fromEntries(Object.entries(P(o) ?? {}).map(([s, i]) => [
|
|
1047
1029
|
s,
|
|
1048
|
-
{ required: !
|
|
1030
|
+
{ required: !R(i), schema: Ze(i) }
|
|
1049
1031
|
]));
|
|
1050
1032
|
return {
|
|
1051
1033
|
name: e,
|
|
@@ -1055,16 +1037,16 @@ function yt(e) {
|
|
|
1055
1037
|
events: o.events ?? [],
|
|
1056
1038
|
example: {
|
|
1057
1039
|
type: e,
|
|
1058
|
-
props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s,
|
|
1040
|
+
props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s, et(i)])),
|
|
1059
1041
|
children: []
|
|
1060
1042
|
}
|
|
1061
1043
|
};
|
|
1062
1044
|
}
|
|
1063
|
-
const
|
|
1045
|
+
const O = { type: "string", pattern: "^/" }, tt = {
|
|
1064
1046
|
description: "A json-render expression resolved at render time.",
|
|
1065
1047
|
anyOf: [
|
|
1066
|
-
{ type: "object", required: ["$state"], properties: { $state:
|
|
1067
|
-
{ type: "object", required: ["$bindState"], properties: { $bindState:
|
|
1048
|
+
{ type: "object", required: ["$state"], properties: { $state: O } },
|
|
1049
|
+
{ type: "object", required: ["$bindState"], properties: { $bindState: O } },
|
|
1068
1050
|
{ type: "object", required: ["$item"], properties: { $item: { type: "string" } } },
|
|
1069
1051
|
{ type: "object", required: ["$bindItem"], properties: { $bindItem: { type: "string" } } },
|
|
1070
1052
|
{ type: "object", required: ["$index"], properties: { $index: { const: !0 } } },
|
|
@@ -1072,7 +1054,7 @@ const x = { type: "string", pattern: "^/" }, nt = {
|
|
|
1072
1054
|
{ type: "object", required: ["$computed"], properties: { $computed: { type: "string" }, args: { type: "object" } } },
|
|
1073
1055
|
{ type: "object", required: ["$cond", "$then", "$else"], properties: { $cond: {}, $then: {}, $else: {} } }
|
|
1074
1056
|
]
|
|
1075
|
-
},
|
|
1057
|
+
}, ot = {
|
|
1076
1058
|
type: "object",
|
|
1077
1059
|
required: ["action"],
|
|
1078
1060
|
properties: {
|
|
@@ -1084,8 +1066,8 @@ const x = { type: "string", pattern: "^/" }, nt = {
|
|
|
1084
1066
|
preventDefault: { type: "boolean" }
|
|
1085
1067
|
},
|
|
1086
1068
|
additionalProperties: !1
|
|
1087
|
-
},
|
|
1088
|
-
function
|
|
1069
|
+
}, E = { anyOf: [{ $ref: "#/$defs/actionBinding" }, { type: "array", items: { $ref: "#/$defs/actionBinding" } }] }, N = { type: "array", items: { type: "string" } };
|
|
1070
|
+
function nt(e, o, n) {
|
|
1089
1071
|
const s = (r) => Array.isArray(r) ? r.map(s) : !r || typeof r != "object" ? r : Object.fromEntries(Object.entries(r).map(([c, l]) => [
|
|
1090
1072
|
c,
|
|
1091
1073
|
c === "$ref" && typeof l == "string" ? l.replace("#/$defs/", `#/$defs/${o}`) : s(l)
|
|
@@ -1094,11 +1076,11 @@ function st(e, o, n) {
|
|
|
1094
1076
|
for (const [r, c] of Object.entries(i ?? {})) n[o + r] = s(c);
|
|
1095
1077
|
return s(a);
|
|
1096
1078
|
}
|
|
1097
|
-
function
|
|
1098
|
-
const s =
|
|
1079
|
+
function it(e, o, n) {
|
|
1080
|
+
const s = P(o), i = o.slots ?? [];
|
|
1099
1081
|
let a = { type: "object" };
|
|
1100
1082
|
if (s) {
|
|
1101
|
-
const r =
|
|
1083
|
+
const r = nt(t.toJSONSchema(t.object(s)), `${e}__`, n), c = r.properties;
|
|
1102
1084
|
a = {
|
|
1103
1085
|
...r,
|
|
1104
1086
|
properties: Object.fromEntries(Object.entries(c).map(([l, p]) => [
|
|
@@ -1120,20 +1102,20 @@ function at(e, o, n) {
|
|
|
1120
1102
|
}
|
|
1121
1103
|
};
|
|
1122
1104
|
}
|
|
1123
|
-
function
|
|
1124
|
-
const o = e.data.components, n = { expression:
|
|
1105
|
+
function bt(e = A) {
|
|
1106
|
+
const o = e.data.components, n = { expression: tt, actionBinding: ot }, s = Object.entries(o).map(([i, a]) => it(i, a, n));
|
|
1125
1107
|
return n.element = {
|
|
1126
1108
|
type: "object",
|
|
1127
1109
|
required: ["type", "props"],
|
|
1128
1110
|
properties: {
|
|
1129
1111
|
type: { enum: Object.keys(o) },
|
|
1130
1112
|
props: { type: "object" },
|
|
1131
|
-
children:
|
|
1132
|
-
slots: { type: "object", additionalProperties:
|
|
1113
|
+
children: N,
|
|
1114
|
+
slots: { type: "object", additionalProperties: N },
|
|
1133
1115
|
visible: {},
|
|
1134
|
-
on: { type: "object", additionalProperties:
|
|
1135
|
-
watch: { type: "object", propertyNames:
|
|
1136
|
-
repeat: { type: "object", required: ["statePath"], properties: { statePath:
|
|
1116
|
+
on: { type: "object", additionalProperties: E },
|
|
1117
|
+
watch: { type: "object", propertyNames: O, additionalProperties: E },
|
|
1118
|
+
repeat: { type: "object", required: ["statePath"], properties: { statePath: O, key: { type: "string" } }, additionalProperties: !1 }
|
|
1137
1119
|
},
|
|
1138
1120
|
additionalProperties: !1,
|
|
1139
1121
|
allOf: s
|
|
@@ -1152,30 +1134,30 @@ function wt(e = O) {
|
|
|
1152
1134
|
};
|
|
1153
1135
|
}
|
|
1154
1136
|
export {
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1137
|
+
Ot as ActionProvider,
|
|
1138
|
+
At as JSONUIProvider,
|
|
1139
|
+
Pt as Renderer,
|
|
1140
|
+
kt as StateProvider,
|
|
1141
|
+
ut as SynoJsonRenderer,
|
|
1142
|
+
Ct as ValidationProvider,
|
|
1161
1143
|
It as VisibilityProvider,
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1144
|
+
ft as closestSynoJsonComponent,
|
|
1145
|
+
$t as createStateStore,
|
|
1146
|
+
jt as defineCatalog,
|
|
1147
|
+
Rt as defineRegistry,
|
|
1148
|
+
gt as describeSynoJsonComponent,
|
|
1149
|
+
Tt as jsonRenderVueSchema,
|
|
1150
|
+
ht as listSynoJsonComponents,
|
|
1151
|
+
pt as synoJsonAiPrompt,
|
|
1152
|
+
Ke as synoJsonAiRules,
|
|
1153
|
+
A as synoJsonCatalog,
|
|
1154
|
+
V as synoJsonComponentDefinitions,
|
|
1155
|
+
D as synoJsonRegistry,
|
|
1174
1156
|
Je as synoJsonRenderers,
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1157
|
+
bt as synoJsonSchema,
|
|
1158
|
+
Kt as useActions,
|
|
1159
|
+
Lt as useBoundProp,
|
|
1178
1160
|
Dt as useStateStore,
|
|
1179
|
-
|
|
1180
|
-
|
|
1161
|
+
mt as validateSynoJsonSpec,
|
|
1162
|
+
vt as z
|
|
1181
1163
|
};
|