@synopackageland/ui 0.9.4 → 0.9.6
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 +92 -0
- package/README.md +6 -1
- package/dist/components/app/page-header/PageHeader.vue.d.ts +4 -2
- package/dist/components/composite/callout/Callout.vue.d.ts +2 -0
- package/dist/components/composite/form/Form.vue.d.ts +1 -1
- package/dist/components/composite/form-actions/FormActions.vue.d.ts +6 -0
- package/dist/components/composite/list-item/ListItem.vue.d.ts +25 -0
- package/dist/components/composite/settings-row/SettingsRow.vue.d.ts +1 -0
- package/dist/components/composite/settings-section/SettingsSection.vue.d.ts +1 -0
- package/dist/components/composite/statistic/Statistic.vue.d.ts +24 -0
- package/dist/components/composite/table-cell/CellStatus.vue.d.ts +24 -0
- package/dist/components/composite/table-cell/CellText.vue.d.ts +36 -0
- package/dist/components/feedback/notification/NotificationProvider.vue.d.ts +1 -1
- package/dist/components/primitives/button/Button.vue.d.ts +3 -0
- package/dist/components/primitives/button/IconButton.vue.d.ts +5 -2
- package/dist/components/primitives/dropdown-menu/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/primitives/dropdown-menu/DropdownMenuItems.vue.d.ts +3 -0
- package/dist/components/primitives/input-group/InputGroup.vue.d.ts +13 -0
- package/dist/components/primitives/popover/Popover.vue.d.ts +3 -3
- package/dist/components/primitives/progress/Progress.vue.d.ts +3 -0
- package/dist/components/primitives/space/Space.vue.d.ts +4 -1
- package/dist/composables/collisionBoundary.d.ts +4 -0
- package/dist/composables/floatingHost.d.ts +5 -2
- package/dist/composables/floatingPlacement.d.ts +1 -1
- package/dist/composables/pendingClick.d.ts +12 -0
- package/dist/composables/stickyRoom.d.ts +8 -0
- package/dist/i18n/text.d.ts +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9046 -8544
- package/dist/json/catalog.d.ts +98 -0
- package/dist/json/registry.d.ts +3548 -22
- package/dist/json-ai-prompt.md +8 -4
- package/dist/json-catalog.schema.json +290 -3
- package/dist/json-preview/preview.js +6371 -6019
- package/dist/json.js +453 -413
- package/dist/lib/clipboard.d.ts +7 -1
- package/dist/lib/fileSize.d.ts +9 -1
- package/dist/lib/floatingDialog.d.ts +9 -2
- package/dist/lib/format.d.ts +13 -0
- package/dist/lib/slots.d.ts +4 -0
- 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/layout-rules.md +36 -3
- package/package.json +62 -1
package/dist/json.js
CHANGED
|
@@ -1,324 +1,359 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
import { z as
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
import { z as vt } from "zod";
|
|
3
3
|
import { defineCatalog as z } from "@json-render/core";
|
|
4
|
-
import { createStateStore as
|
|
4
|
+
import { createStateStore as St, defineCatalog as jt } from "@json-render/core";
|
|
5
5
|
import { defineRegistry as B, useBoundProp as b, JSONUIProvider as M, Renderer as W } from "@json-render/vue";
|
|
6
|
-
import { ActionProvider as
|
|
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 Ut } from "@json-render/vue";
|
|
7
7
|
import { schema as H } from "@json-render/vue/schema";
|
|
8
|
-
import { schema as
|
|
8
|
+
import { schema as Tt } from "@json-render/vue/schema";
|
|
9
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, DataTable as
|
|
11
|
-
const
|
|
12
|
-
key:
|
|
13
|
-
label:
|
|
14
|
-
icon:
|
|
15
|
-
badge:
|
|
16
|
-
disabled:
|
|
17
|
-
selectable:
|
|
18
|
-
children:
|
|
19
|
-
})), k =
|
|
20
|
-
label:
|
|
21
|
-
value:
|
|
22
|
-
disabled:
|
|
23
|
-
}),
|
|
24
|
-
description:
|
|
25
|
-
}),
|
|
26
|
-
key:
|
|
27
|
-
label:
|
|
28
|
-
width:
|
|
29
|
-
align:
|
|
30
|
-
}),
|
|
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 $e, SectionTabs as Se, 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
|
+
const J = t.lazy(() => t.object({
|
|
12
|
+
key: t.string(),
|
|
13
|
+
label: t.string(),
|
|
14
|
+
icon: t.string().optional(),
|
|
15
|
+
badge: t.union([t.string(), t.number()]).optional(),
|
|
16
|
+
disabled: t.boolean().optional(),
|
|
17
|
+
selectable: t.boolean().optional(),
|
|
18
|
+
children: t.array(J).optional()
|
|
19
|
+
})), k = t.object({
|
|
20
|
+
label: t.string(),
|
|
21
|
+
value: t.string(),
|
|
22
|
+
disabled: t.boolean().optional()
|
|
23
|
+
}), Re = k.extend({
|
|
24
|
+
description: t.string().optional()
|
|
25
|
+
}), L = t.object({
|
|
26
|
+
key: t.string(),
|
|
27
|
+
label: t.string(),
|
|
28
|
+
width: t.string().optional(),
|
|
29
|
+
align: t.enum(["left", "center", "right"]).optional()
|
|
30
|
+
}), V = {
|
|
31
31
|
AppRoot: {
|
|
32
|
-
props:
|
|
33
|
-
modalScope:
|
|
32
|
+
props: t.object({
|
|
33
|
+
modalScope: t.enum(["document", "app"]).optional()
|
|
34
34
|
}),
|
|
35
35
|
slots: ["default"],
|
|
36
36
|
description: 'Root of a DSM application. Use once around the application shell. Dialogs stay inside the app by default (modalScope "app"); "document" is only for full-page web/Portal apps.'
|
|
37
37
|
},
|
|
38
38
|
AppShell: {
|
|
39
|
-
props:
|
|
40
|
-
sidebarWidth:
|
|
41
|
-
minHeight:
|
|
42
|
-
responsive:
|
|
43
|
-
wideLayout:
|
|
39
|
+
props: t.object({
|
|
40
|
+
sidebarWidth: t.string().optional(),
|
|
41
|
+
minHeight: t.string().optional(),
|
|
42
|
+
responsive: t.boolean().optional(),
|
|
43
|
+
wideLayout: t.enum(["window", "web"]).optional()
|
|
44
44
|
}),
|
|
45
45
|
slots: ["default", "sidebar", "toolbar", "footer"],
|
|
46
46
|
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.'
|
|
47
47
|
},
|
|
48
48
|
ResponsiveView: {
|
|
49
|
-
props:
|
|
49
|
+
props: t.object({ mode: t.enum(["auto", "mobile", "window", "web"]).optional() }),
|
|
50
50
|
slots: ["default", "mobile", "window", "web"],
|
|
51
51
|
description: 'Optionally replace a specialized element with a phone-friendly alternative. mobile/window/web slots follow AppShell container width (web only with AppShell wideLayout "web"); default is always the fallback.'
|
|
52
52
|
},
|
|
53
53
|
Page: {
|
|
54
|
-
props:
|
|
55
|
-
width:
|
|
56
|
-
surface:
|
|
54
|
+
props: t.object({
|
|
55
|
+
width: t.string().optional(),
|
|
56
|
+
surface: t.enum(["auto", "flat", "card"]).optional()
|
|
57
57
|
}),
|
|
58
58
|
slots: ["default"],
|
|
59
59
|
description: 'Page content area. Use width "fill" for data-heavy screens and "readable" for forms/settings.'
|
|
60
60
|
},
|
|
61
61
|
PageHeader: {
|
|
62
|
-
props:
|
|
63
|
-
title:
|
|
64
|
-
description:
|
|
62
|
+
props: t.object({
|
|
63
|
+
title: t.string(),
|
|
64
|
+
description: t.string().optional()
|
|
65
65
|
}),
|
|
66
|
-
slots: ["actions"],
|
|
67
|
-
description: "Page heading with optional description and page-level actions."
|
|
66
|
+
slots: ["actions", "meta"],
|
|
67
|
+
description: "Page heading with optional description and page-level actions. The meta slot sits on the title line, for a small chip such as when the data was read."
|
|
68
68
|
},
|
|
69
69
|
Toolbar: {
|
|
70
|
-
props:
|
|
70
|
+
props: t.object({ height: t.string().optional() }),
|
|
71
71
|
slots: ["default", "leading", "actions"],
|
|
72
72
|
description: "Application toolbar. Put primary page-independent actions in the actions slot."
|
|
73
73
|
},
|
|
74
74
|
SidebarNav: {
|
|
75
|
-
props:
|
|
76
|
-
value:
|
|
77
|
-
groups:
|
|
78
|
-
label:
|
|
79
|
-
items:
|
|
75
|
+
props: t.object({
|
|
76
|
+
value: t.string().optional(),
|
|
77
|
+
groups: t.array(t.object({
|
|
78
|
+
label: t.string().optional(),
|
|
79
|
+
items: t.array(J)
|
|
80
80
|
})),
|
|
81
|
-
searchable:
|
|
82
|
-
collapsible:
|
|
83
|
-
searchPlaceholder:
|
|
81
|
+
searchable: t.boolean().optional(),
|
|
82
|
+
collapsible: t.boolean().optional(),
|
|
83
|
+
searchPlaceholder: t.string().optional()
|
|
84
84
|
}),
|
|
85
85
|
events: ["change"],
|
|
86
86
|
description: "DSM sidebar navigation. Icon values are names registered by the host application."
|
|
87
87
|
},
|
|
88
88
|
Tabs: {
|
|
89
|
-
props:
|
|
90
|
-
value:
|
|
91
|
-
items:
|
|
92
|
-
ariaLabel:
|
|
89
|
+
props: t.object({
|
|
90
|
+
value: t.string(),
|
|
91
|
+
items: t.array(k),
|
|
92
|
+
ariaLabel: t.string().optional()
|
|
93
93
|
}),
|
|
94
94
|
events: ["change"],
|
|
95
95
|
description: "Section tabs for switching a local mode or filter. Bind value to state for two-way updates."
|
|
96
96
|
},
|
|
97
97
|
Stack: {
|
|
98
|
-
props:
|
|
99
|
-
direction:
|
|
100
|
-
gap:
|
|
101
|
-
align:
|
|
102
|
-
justify:
|
|
103
|
-
wrap:
|
|
98
|
+
props: t.object({
|
|
99
|
+
direction: t.enum(["row", "column"]).optional(),
|
|
100
|
+
gap: t.enum(["none", "xs", "sm", "md", "lg"]).optional(),
|
|
101
|
+
align: t.enum(["start", "center", "end", "stretch"]).optional(),
|
|
102
|
+
justify: t.enum(["start", "center", "end", "between"]).optional(),
|
|
103
|
+
wrap: t.boolean().optional()
|
|
104
104
|
}),
|
|
105
105
|
slots: ["default"],
|
|
106
106
|
description: "Simple layout composition. Prefer semantic components first and use Stack only for local arrangement."
|
|
107
107
|
},
|
|
108
108
|
Text: {
|
|
109
|
-
props:
|
|
110
|
-
text:
|
|
111
|
-
variant:
|
|
109
|
+
props: t.object({
|
|
110
|
+
text: t.string(),
|
|
111
|
+
variant: t.enum(["body", "muted", "caption", "heading", "mono"]).optional()
|
|
112
112
|
}),
|
|
113
113
|
description: "Short application text. Do not use it when a semantic component already owns the label/description."
|
|
114
114
|
},
|
|
115
115
|
Button: {
|
|
116
|
-
props:
|
|
117
|
-
label:
|
|
118
|
-
variant:
|
|
119
|
-
size:
|
|
120
|
-
disabled:
|
|
121
|
-
loading:
|
|
122
|
-
icon:
|
|
116
|
+
props: t.object({
|
|
117
|
+
label: t.string(),
|
|
118
|
+
variant: t.enum(["primary", "secondary", "ghost", "danger"]).optional(),
|
|
119
|
+
size: t.enum(["sm", "md", "lg"]).optional(),
|
|
120
|
+
disabled: t.boolean().optional(),
|
|
121
|
+
loading: t.boolean().optional(),
|
|
122
|
+
icon: t.string().optional()
|
|
123
123
|
}),
|
|
124
124
|
events: ["press"],
|
|
125
125
|
description: "User action. Use one primary action per local task when possible. Icon is an optional host-registered icon name."
|
|
126
126
|
},
|
|
127
127
|
Input: {
|
|
128
|
-
props:
|
|
129
|
-
value:
|
|
130
|
-
type:
|
|
131
|
-
placeholder:
|
|
132
|
-
disabled:
|
|
133
|
-
readonly:
|
|
134
|
-
invalid:
|
|
135
|
-
size:
|
|
136
|
-
ariaLabel:
|
|
128
|
+
props: t.object({
|
|
129
|
+
value: t.union([t.string(), t.number()]).optional(),
|
|
130
|
+
type: t.string().optional(),
|
|
131
|
+
placeholder: t.string().optional(),
|
|
132
|
+
disabled: t.boolean().optional(),
|
|
133
|
+
readonly: t.boolean().optional(),
|
|
134
|
+
invalid: t.boolean().optional(),
|
|
135
|
+
size: t.enum(["sm", "md", "lg"]).optional(),
|
|
136
|
+
ariaLabel: t.string().optional()
|
|
137
137
|
}),
|
|
138
138
|
events: ["change"],
|
|
139
139
|
description: "Single-line input. Use $bindState/$bindItem on value for editable state."
|
|
140
140
|
},
|
|
141
141
|
Select: {
|
|
142
|
-
props:
|
|
143
|
-
value:
|
|
144
|
-
options:
|
|
145
|
-
placeholder:
|
|
146
|
-
disabled:
|
|
147
|
-
search:
|
|
142
|
+
props: t.object({
|
|
143
|
+
value: t.string().optional(),
|
|
144
|
+
options: t.array(k),
|
|
145
|
+
placeholder: t.string().optional(),
|
|
146
|
+
disabled: t.boolean().optional(),
|
|
147
|
+
search: t.boolean().optional()
|
|
148
148
|
}),
|
|
149
149
|
events: ["change"],
|
|
150
150
|
description: "Single-choice select. Use $bindState/$bindItem on value."
|
|
151
151
|
},
|
|
152
152
|
Checkbox: {
|
|
153
|
-
props:
|
|
154
|
-
checked:
|
|
155
|
-
label:
|
|
156
|
-
description:
|
|
157
|
-
disabled:
|
|
153
|
+
props: t.object({
|
|
154
|
+
checked: t.boolean().optional(),
|
|
155
|
+
label: t.string().optional(),
|
|
156
|
+
description: t.string().optional(),
|
|
157
|
+
disabled: t.boolean().optional()
|
|
158
158
|
}),
|
|
159
159
|
events: ["change"],
|
|
160
160
|
description: "Boolean choice. Use $bindState/$bindItem on checked."
|
|
161
161
|
},
|
|
162
162
|
Switch: {
|
|
163
|
-
props:
|
|
164
|
-
checked:
|
|
165
|
-
label:
|
|
166
|
-
disabled:
|
|
163
|
+
props: t.object({
|
|
164
|
+
checked: t.boolean().optional(),
|
|
165
|
+
label: t.string().optional(),
|
|
166
|
+
disabled: t.boolean().optional()
|
|
167
167
|
}),
|
|
168
168
|
events: ["change"],
|
|
169
169
|
description: "Immediate on/off setting. Use $bindState/$bindItem on checked."
|
|
170
170
|
},
|
|
171
171
|
RadioGroup: {
|
|
172
|
-
props:
|
|
173
|
-
value:
|
|
174
|
-
options:
|
|
175
|
-
orientation:
|
|
176
|
-
disabled:
|
|
172
|
+
props: t.object({
|
|
173
|
+
value: t.string().optional(),
|
|
174
|
+
options: t.array(Re),
|
|
175
|
+
orientation: t.enum(["vertical", "horizontal"]).optional(),
|
|
176
|
+
disabled: t.boolean().optional()
|
|
177
177
|
}),
|
|
178
178
|
events: ["change"],
|
|
179
179
|
description: "Choose one of a small visible set of mutually-exclusive options."
|
|
180
180
|
},
|
|
181
181
|
Form: {
|
|
182
|
-
props:
|
|
183
|
-
direction:
|
|
184
|
-
fieldWidth:
|
|
182
|
+
props: t.object({
|
|
183
|
+
direction: t.enum(["auto", "horizontal", "vertical"]).optional(),
|
|
184
|
+
fieldWidth: t.string().optional()
|
|
185
185
|
}),
|
|
186
186
|
slots: ["default"],
|
|
187
187
|
events: ["submit"],
|
|
188
188
|
description: "Form container. Put Field components inside and bind controls to state."
|
|
189
189
|
},
|
|
190
190
|
Field: {
|
|
191
|
-
props:
|
|
192
|
-
label:
|
|
193
|
-
description:
|
|
194
|
-
help:
|
|
195
|
-
required:
|
|
196
|
-
fieldWidth:
|
|
197
|
-
direction:
|
|
191
|
+
props: t.object({
|
|
192
|
+
label: t.string(),
|
|
193
|
+
description: t.string().optional(),
|
|
194
|
+
help: t.string().optional(),
|
|
195
|
+
required: t.boolean().optional(),
|
|
196
|
+
fieldWidth: t.string().optional(),
|
|
197
|
+
direction: t.enum(["auto", "horizontal", "vertical"]).optional()
|
|
198
198
|
}),
|
|
199
199
|
slots: ["default"],
|
|
200
200
|
description: "Labeled form field for create/edit dialogs and forms."
|
|
201
201
|
},
|
|
202
202
|
SettingsSection: {
|
|
203
|
-
props:
|
|
204
|
-
title:
|
|
205
|
-
collapsible:
|
|
206
|
-
open:
|
|
203
|
+
props: t.object({
|
|
204
|
+
title: t.string(),
|
|
205
|
+
collapsible: t.boolean().optional(),
|
|
206
|
+
open: t.boolean().optional()
|
|
207
207
|
}),
|
|
208
208
|
slots: ["default", "actions"],
|
|
209
209
|
events: ["openChange"],
|
|
210
210
|
description: "Section of related settings. Prefer this plus SettingsField for DSM settings pages."
|
|
211
211
|
},
|
|
212
212
|
SettingsField: {
|
|
213
|
-
props:
|
|
214
|
-
label:
|
|
215
|
-
description:
|
|
216
|
-
required:
|
|
217
|
-
fieldWidth:
|
|
218
|
-
align:
|
|
213
|
+
props: t.object({
|
|
214
|
+
label: t.string(),
|
|
215
|
+
description: t.string().optional(),
|
|
216
|
+
required: t.boolean().optional(),
|
|
217
|
+
fieldWidth: t.string().optional(),
|
|
218
|
+
align: t.enum(["start", "center"]).optional()
|
|
219
219
|
}),
|
|
220
220
|
slots: ["default"],
|
|
221
221
|
description: "DSM settings row with label, description and one control/content region."
|
|
222
222
|
},
|
|
223
223
|
Surface: {
|
|
224
|
-
props:
|
|
225
|
-
padding:
|
|
226
|
-
border:
|
|
227
|
-
raised:
|
|
224
|
+
props: t.object({
|
|
225
|
+
padding: t.enum(["none", "sm", "md", "lg"]).optional(),
|
|
226
|
+
border: t.boolean().optional(),
|
|
227
|
+
raised: t.boolean().optional()
|
|
228
228
|
}),
|
|
229
229
|
slots: ["default"],
|
|
230
230
|
description: "Neutral bordered/raised content surface when Card semantics are not needed."
|
|
231
231
|
},
|
|
232
232
|
Card: {
|
|
233
|
-
props:
|
|
234
|
-
title:
|
|
235
|
-
layoutType:
|
|
236
|
-
expandable:
|
|
237
|
-
expanded:
|
|
238
|
-
footerAlign:
|
|
233
|
+
props: t.object({
|
|
234
|
+
title: t.string().optional(),
|
|
235
|
+
layoutType: t.enum(["regular", "compact"]).optional(),
|
|
236
|
+
expandable: t.boolean().optional(),
|
|
237
|
+
expanded: t.boolean().optional(),
|
|
238
|
+
footerAlign: t.enum(["start", "end", "between"]).optional()
|
|
239
239
|
}),
|
|
240
240
|
slots: ["default", "header-actions", "footer"],
|
|
241
241
|
events: ["expandedChange"],
|
|
242
242
|
description: "Grouped content with optional header/actions/footer. Do not use a Card just to add spacing."
|
|
243
243
|
},
|
|
244
244
|
Callout: {
|
|
245
|
-
props:
|
|
246
|
-
tone:
|
|
247
|
-
title:
|
|
248
|
-
closable:
|
|
245
|
+
props: t.object({
|
|
246
|
+
tone: t.enum(["info", "success", "warning", "danger"]).optional(),
|
|
247
|
+
title: t.string().optional(),
|
|
248
|
+
closable: t.boolean().optional(),
|
|
249
|
+
code: t.string().optional()
|
|
249
250
|
}),
|
|
250
251
|
slots: ["default", "actions"],
|
|
251
252
|
events: ["close"],
|
|
252
|
-
description: "Inline information, success, warning or error message."
|
|
253
|
+
description: "Inline information, success, warning or error message. Put a machine error code in `code`, not in the text."
|
|
253
254
|
},
|
|
254
255
|
EmptyState: {
|
|
255
|
-
props:
|
|
256
|
-
title:
|
|
257
|
-
description:
|
|
258
|
-
icon:
|
|
256
|
+
props: t.object({
|
|
257
|
+
title: t.string(),
|
|
258
|
+
description: t.string().optional(),
|
|
259
|
+
icon: t.string().optional()
|
|
259
260
|
}),
|
|
260
261
|
slots: ["actions"],
|
|
261
262
|
description: "Empty/no-results state with optional recovery or create actions."
|
|
262
263
|
},
|
|
263
264
|
Progress: {
|
|
264
|
-
props:
|
|
265
|
-
value:
|
|
266
|
-
max:
|
|
267
|
-
label:
|
|
268
|
-
valueLabel:
|
|
265
|
+
props: t.object({
|
|
266
|
+
value: t.number().optional(),
|
|
267
|
+
max: t.number().optional(),
|
|
268
|
+
label: t.string().optional(),
|
|
269
|
+
valueLabel: t.string().optional(),
|
|
270
|
+
tone: t.enum(["primary", "success", "warning", "danger"]).optional()
|
|
269
271
|
}),
|
|
270
272
|
description: "Linear determinate progress. Domain-specific progress visualizations should be custom components."
|
|
271
273
|
},
|
|
272
274
|
Badge: {
|
|
273
|
-
props:
|
|
274
|
-
text:
|
|
275
|
-
tone:
|
|
275
|
+
props: t.object({
|
|
276
|
+
text: t.string(),
|
|
277
|
+
tone: t.enum(["neutral", "info", "success", "warning", "danger"]).optional()
|
|
276
278
|
}),
|
|
277
279
|
description: "Short status/category badge."
|
|
278
280
|
},
|
|
279
281
|
Dialog: {
|
|
280
|
-
props:
|
|
281
|
-
open:
|
|
282
|
-
title:
|
|
283
|
-
description:
|
|
284
|
-
width:
|
|
285
|
-
showClose:
|
|
282
|
+
props: t.object({
|
|
283
|
+
open: t.boolean().optional(),
|
|
284
|
+
title: t.string().optional(),
|
|
285
|
+
description: t.string().optional(),
|
|
286
|
+
width: t.string().optional(),
|
|
287
|
+
showClose: t.boolean().optional()
|
|
286
288
|
}),
|
|
287
289
|
slots: ["default", "footer"],
|
|
288
290
|
events: ["openChange"],
|
|
289
291
|
description: "Modal task/dialog. Bind open to state. Put confirmation or form actions in footer."
|
|
290
292
|
},
|
|
291
293
|
DataTable: {
|
|
292
|
-
props:
|
|
293
|
-
columns:
|
|
294
|
-
rows:
|
|
295
|
-
rowKey:
|
|
296
|
-
emptyText:
|
|
297
|
-
compact:
|
|
298
|
-
mobileView:
|
|
294
|
+
props: t.object({
|
|
295
|
+
columns: t.array(L),
|
|
296
|
+
rows: t.array(t.record(t.string(), t.unknown())),
|
|
297
|
+
rowKey: t.string().optional(),
|
|
298
|
+
emptyText: t.string().optional(),
|
|
299
|
+
compact: t.boolean().optional(),
|
|
300
|
+
mobileView: t.enum(["auto", "cards", "table"]).optional()
|
|
299
301
|
}),
|
|
300
302
|
description: "Simple resource table where cells display scalar row fields. Use an app extension component for rich/custom cells and row actions."
|
|
301
303
|
},
|
|
302
304
|
ResourceList: {
|
|
303
|
-
props:
|
|
304
|
-
columns:
|
|
305
|
-
rows:
|
|
306
|
-
rowKey:
|
|
307
|
-
emptyText:
|
|
308
|
-
compact:
|
|
309
|
-
mobileView:
|
|
305
|
+
props: t.object({
|
|
306
|
+
columns: t.array(L),
|
|
307
|
+
rows: t.array(t.record(t.string(), t.unknown())),
|
|
308
|
+
rowKey: t.string().optional(),
|
|
309
|
+
emptyText: t.string().optional(),
|
|
310
|
+
compact: t.boolean().optional(),
|
|
311
|
+
mobileView: t.enum(["auto", "cards", "table"]).optional()
|
|
310
312
|
}),
|
|
311
313
|
slots: ["toolbar"],
|
|
312
314
|
description: "Common resource collection pattern: optional toolbar plus a simple table. For domain-specific row rendering, extend the catalog with a custom list/table component."
|
|
313
315
|
},
|
|
316
|
+
CellText: {
|
|
317
|
+
props: t.object({
|
|
318
|
+
text: t.string(),
|
|
319
|
+
secondary: t.string().optional(),
|
|
320
|
+
layout: t.enum(["stacked", "inline"]).optional(),
|
|
321
|
+
openLabel: t.string().optional(),
|
|
322
|
+
openDisabled: t.boolean().optional()
|
|
323
|
+
}),
|
|
324
|
+
events: ["open"],
|
|
325
|
+
description: 'Main text with secondary information (size, time, path), truncated with a tooltip. With openLabel the main text is a link-styled button that emits open, e.g. "Open in File Station".'
|
|
326
|
+
},
|
|
327
|
+
CellStatus: {
|
|
328
|
+
props: t.object({
|
|
329
|
+
label: t.string(),
|
|
330
|
+
tone: t.enum(["neutral", "info", "success", "warning", "danger"]).optional(),
|
|
331
|
+
progress: t.number().optional(),
|
|
332
|
+
detail: t.string().optional()
|
|
333
|
+
}),
|
|
334
|
+
description: "Task status: a toned dot and label, a bar while progress (0–100) is running, and a detail such as speed or a reason."
|
|
335
|
+
},
|
|
336
|
+
ListItem: {
|
|
337
|
+
props: t.object({
|
|
338
|
+
title: t.string().optional(),
|
|
339
|
+
description: t.string().optional()
|
|
340
|
+
}),
|
|
341
|
+
slots: ["default", "actions"],
|
|
342
|
+
description: "One entry of a list (an extension, a tool, a rule): title, description, content and actions on the right. Consecutive entries are split by a hairline."
|
|
343
|
+
},
|
|
344
|
+
InputGroup: {
|
|
345
|
+
props: t.object({}),
|
|
346
|
+
slots: ["default"],
|
|
347
|
+
description: "A field and the buttons acting on it on one line, such as a URL and its Install button. The first child takes the room left."
|
|
348
|
+
},
|
|
314
349
|
Loading: {
|
|
315
|
-
props:
|
|
350
|
+
props: t.object({ text: t.string().optional() }),
|
|
316
351
|
description: "Centered loading state for a page or bounded region."
|
|
317
352
|
}
|
|
318
353
|
}, A = z(H, {
|
|
319
|
-
components:
|
|
354
|
+
components: V,
|
|
320
355
|
actions: {}
|
|
321
|
-
}),
|
|
356
|
+
}), Ke = [
|
|
322
357
|
"Prefer AppRoot > AppShell > Page as the normal DSM application hierarchy.",
|
|
323
358
|
"Prefer SettingsSection and SettingsField for settings; prefer ResourceList/DataTable for ordinary scalar resource collections.",
|
|
324
359
|
"Keep state in the spec and use $bindState/$bindItem for editable controls; do not invent JavaScript in props.",
|
|
@@ -327,53 +362,53 @@ const V = o.lazy(() => o.object({
|
|
|
327
362
|
"AppShell adapts to its actual DSM window width: phone (<=600px), desktop window (601–1199px), and wide web/Portal (>=1200px). Never assume browser viewport width.",
|
|
328
363
|
"For a phone-unfriendly custom view, use ResponsiveView slots: mobile alternative and default full view. Keep essential actions accessible on mobile.",
|
|
329
364
|
"Use low-level Stack/Text only when a semantic component does not already express the layout."
|
|
330
|
-
],
|
|
331
|
-
function
|
|
332
|
-
return `${A.prompt({ customRules:
|
|
365
|
+
], 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.';
|
|
366
|
+
function pt() {
|
|
367
|
+
return `${A.prompt({ customRules: Ke })}
|
|
333
368
|
|
|
334
|
-
${
|
|
369
|
+
${Le}
|
|
335
370
|
`;
|
|
336
371
|
}
|
|
337
|
-
const
|
|
372
|
+
const Ue = {
|
|
338
373
|
none: "0",
|
|
339
374
|
xs: "var(--ui-space-1)",
|
|
340
375
|
sm: "var(--ui-space-2)",
|
|
341
376
|
md: "var(--ui-space-3)",
|
|
342
377
|
lg: "var(--ui-space-4)"
|
|
343
|
-
},
|
|
344
|
-
function
|
|
378
|
+
}, De = { start: "flex-start", center: "center", end: "flex-end", stretch: "stretch" }, Te = { start: "flex-start", center: "center", end: "flex-end", between: "space-between" };
|
|
379
|
+
function Ee(e) {
|
|
345
380
|
return { default: () => e };
|
|
346
381
|
}
|
|
347
382
|
function C(e) {
|
|
348
|
-
return e ?
|
|
383
|
+
return e ? Ie(e) : void 0;
|
|
349
384
|
}
|
|
350
|
-
function
|
|
385
|
+
function _(e) {
|
|
351
386
|
return {
|
|
352
387
|
...e,
|
|
353
388
|
icon: C(e.icon),
|
|
354
|
-
children: e.children?.map(
|
|
389
|
+
children: e.children?.map(_)
|
|
355
390
|
};
|
|
356
391
|
}
|
|
357
|
-
function
|
|
358
|
-
return e.map((
|
|
392
|
+
function Ne(e) {
|
|
393
|
+
return e.map((o) => ({ ...o, items: o.items.map(_) }));
|
|
359
394
|
}
|
|
360
|
-
const
|
|
361
|
-
AppRoot: ({ props: e, slots:
|
|
362
|
-
AppShell: ({ props: e, slots:
|
|
395
|
+
const Je = {
|
|
396
|
+
AppRoot: ({ props: e, slots: o }) => d(Ce, { modalScope: e.modalScope }, o),
|
|
397
|
+
AppShell: ({ props: e, slots: o }) => d(ke, {
|
|
363
398
|
sidebarWidth: e.sidebarWidth,
|
|
364
399
|
minHeight: e.minHeight,
|
|
365
400
|
responsive: e.responsive,
|
|
366
401
|
wideLayout: e.wideLayout
|
|
367
|
-
},
|
|
368
|
-
ResponsiveView: ({ props: e, slots:
|
|
369
|
-
Page: ({ props: e, slots:
|
|
370
|
-
PageHeader: ({ props: e, slots:
|
|
371
|
-
Toolbar: ({ props: e, slots:
|
|
372
|
-
SidebarNav: ({ props: e, bindings:
|
|
373
|
-
const [s, i] = b(e.value,
|
|
374
|
-
return d(
|
|
402
|
+
}, o),
|
|
403
|
+
ResponsiveView: ({ props: e, slots: o }) => d(Pe, { mode: e.mode }, o),
|
|
404
|
+
Page: ({ props: e, slots: o }) => d(Ae, { width: e.width ?? "fill", surface: e.surface }, o),
|
|
405
|
+
PageHeader: ({ props: e, slots: o }) => d(Oe, e, o),
|
|
406
|
+
Toolbar: ({ props: e, slots: o }) => d(xe, e, o),
|
|
407
|
+
SidebarNav: ({ props: e, bindings: o, emit: n }) => {
|
|
408
|
+
const [s, i] = b(e.value, o?.value);
|
|
409
|
+
return d(je, {
|
|
375
410
|
modelValue: s,
|
|
376
|
-
groups:
|
|
411
|
+
groups: Ne(e.groups),
|
|
377
412
|
searchable: e.searchable,
|
|
378
413
|
collapsible: e.collapsible,
|
|
379
414
|
searchPlaceholder: e.searchPlaceholder,
|
|
@@ -382,9 +417,9 @@ const Le = {
|
|
|
382
417
|
}
|
|
383
418
|
});
|
|
384
419
|
},
|
|
385
|
-
Tabs: ({ props: e, bindings:
|
|
386
|
-
const [s, i] = b(e.value,
|
|
387
|
-
return d(
|
|
420
|
+
Tabs: ({ props: e, bindings: o, emit: n }) => {
|
|
421
|
+
const [s, i] = b(e.value, o?.value);
|
|
422
|
+
return d(Se, {
|
|
388
423
|
modelValue: s ?? "",
|
|
389
424
|
items: e.items,
|
|
390
425
|
ariaLabel: e.ariaLabel,
|
|
@@ -393,36 +428,36 @@ const Le = {
|
|
|
393
428
|
}
|
|
394
429
|
});
|
|
395
430
|
},
|
|
396
|
-
Stack: ({ props: e, children:
|
|
431
|
+
Stack: ({ props: e, children: o }) => d("div", {
|
|
397
432
|
"data-syno-pkg-land-ui": "",
|
|
398
433
|
style: {
|
|
399
434
|
display: "flex",
|
|
400
435
|
flexDirection: e.direction ?? "column",
|
|
401
|
-
gap:
|
|
402
|
-
alignItems:
|
|
403
|
-
justifyContent:
|
|
436
|
+
gap: Ue[e.gap ?? "md"],
|
|
437
|
+
alignItems: De[e.align ?? "stretch"],
|
|
438
|
+
justifyContent: Te[e.justify ?? "start"],
|
|
404
439
|
flexWrap: e.wrap ? "wrap" : "nowrap"
|
|
405
440
|
}
|
|
406
|
-
},
|
|
441
|
+
}, o),
|
|
407
442
|
Text: ({ props: e }) => {
|
|
408
|
-
const
|
|
409
|
-
return d(
|
|
443
|
+
const o = e.variant ?? "body";
|
|
444
|
+
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);
|
|
410
445
|
},
|
|
411
|
-
Button: ({ props: e, emit:
|
|
446
|
+
Button: ({ props: e, emit: o }) => {
|
|
412
447
|
const n = C(e.icon);
|
|
413
|
-
return d(
|
|
448
|
+
return d($e, {
|
|
414
449
|
variant: e.variant,
|
|
415
450
|
size: e.size,
|
|
416
451
|
disabled: e.disabled,
|
|
417
452
|
loading: e.loading,
|
|
418
|
-
onClick: () =>
|
|
453
|
+
onClick: () => o("press")
|
|
419
454
|
}, {
|
|
420
455
|
default: () => [n ? d(n, { class: "size-4", "aria-hidden": "true" }) : null, e.label]
|
|
421
456
|
});
|
|
422
457
|
},
|
|
423
|
-
Input: ({ props: e, bindings:
|
|
424
|
-
const [s, i] = b(e.value,
|
|
425
|
-
return d(
|
|
458
|
+
Input: ({ props: e, bindings: o, emit: n }) => {
|
|
459
|
+
const [s, i] = b(e.value, o?.value);
|
|
460
|
+
return d(ve, {
|
|
426
461
|
modelValue: s,
|
|
427
462
|
type: e.type,
|
|
428
463
|
placeholder: e.placeholder,
|
|
@@ -436,9 +471,9 @@ const Le = {
|
|
|
436
471
|
}
|
|
437
472
|
});
|
|
438
473
|
},
|
|
439
|
-
Select: ({ props: e, bindings:
|
|
440
|
-
const [s, i] = b(e.value,
|
|
441
|
-
return d(
|
|
474
|
+
Select: ({ props: e, bindings: o, emit: n }) => {
|
|
475
|
+
const [s, i] = b(e.value, o?.value);
|
|
476
|
+
return d(we, {
|
|
442
477
|
modelValue: s,
|
|
443
478
|
options: e.options,
|
|
444
479
|
placeholder: e.placeholder,
|
|
@@ -449,9 +484,9 @@ const Le = {
|
|
|
449
484
|
}
|
|
450
485
|
});
|
|
451
486
|
},
|
|
452
|
-
Checkbox: ({ props: e, bindings:
|
|
453
|
-
const [s, i] = b(e.checked,
|
|
454
|
-
return d(
|
|
487
|
+
Checkbox: ({ props: e, bindings: o, emit: n }) => {
|
|
488
|
+
const [s, i] = b(e.checked, o?.checked);
|
|
489
|
+
return d(ye, {
|
|
455
490
|
modelValue: s ?? !1,
|
|
456
491
|
label: e.label,
|
|
457
492
|
description: e.description,
|
|
@@ -461,9 +496,9 @@ const Le = {
|
|
|
461
496
|
}
|
|
462
497
|
});
|
|
463
498
|
},
|
|
464
|
-
Switch: ({ props: e, bindings:
|
|
465
|
-
const [s, i] = b(e.checked,
|
|
466
|
-
return d(
|
|
499
|
+
Switch: ({ props: e, bindings: o, emit: n }) => {
|
|
500
|
+
const [s, i] = b(e.checked, o?.checked);
|
|
501
|
+
return d(be, {
|
|
467
502
|
modelValue: s ?? !1,
|
|
468
503
|
label: e.label,
|
|
469
504
|
disabled: e.disabled,
|
|
@@ -472,9 +507,9 @@ const Le = {
|
|
|
472
507
|
}
|
|
473
508
|
});
|
|
474
509
|
},
|
|
475
|
-
RadioGroup: ({ props: e, bindings:
|
|
476
|
-
const [s, i] = b(e.value,
|
|
477
|
-
return d(
|
|
510
|
+
RadioGroup: ({ props: e, bindings: o, emit: n }) => {
|
|
511
|
+
const [s, i] = b(e.value, o?.value);
|
|
512
|
+
return d(ge, {
|
|
478
513
|
modelValue: s,
|
|
479
514
|
options: e.options,
|
|
480
515
|
orientation: e.orientation,
|
|
@@ -484,22 +519,22 @@ const Le = {
|
|
|
484
519
|
}
|
|
485
520
|
});
|
|
486
521
|
},
|
|
487
|
-
Form: ({ props: e, slots:
|
|
522
|
+
Form: ({ props: e, slots: o, emit: n }) => d(fe, {
|
|
488
523
|
direction: e.direction,
|
|
489
524
|
fieldWidth: e.fieldWidth,
|
|
490
525
|
onSubmit: () => n("submit")
|
|
491
|
-
},
|
|
492
|
-
Field: ({ props: e, slots:
|
|
526
|
+
}, o),
|
|
527
|
+
Field: ({ props: e, slots: o }) => d(he, {
|
|
493
528
|
label: e.label,
|
|
494
529
|
description: e.description,
|
|
495
530
|
help: e.help,
|
|
496
531
|
requiredMark: e.required,
|
|
497
532
|
fieldWidth: e.fieldWidth,
|
|
498
533
|
direction: e.direction
|
|
499
|
-
},
|
|
500
|
-
SettingsSection: ({ props: e, bindings:
|
|
501
|
-
const [i, a] = b(e.open,
|
|
502
|
-
return d(
|
|
534
|
+
}, o),
|
|
535
|
+
SettingsSection: ({ props: e, bindings: o, slots: n, emit: s }) => {
|
|
536
|
+
const [i, a] = b(e.open, o?.open);
|
|
537
|
+
return d(me, {
|
|
503
538
|
title: e.title,
|
|
504
539
|
collapsible: e.collapsible,
|
|
505
540
|
open: i,
|
|
@@ -508,17 +543,17 @@ const Le = {
|
|
|
508
543
|
}
|
|
509
544
|
}, n);
|
|
510
545
|
},
|
|
511
|
-
SettingsField: ({ props: e, slots:
|
|
546
|
+
SettingsField: ({ props: e, slots: o }) => d(ue, {
|
|
512
547
|
label: e.label,
|
|
513
548
|
description: e.description,
|
|
514
549
|
required: e.required,
|
|
515
550
|
fieldWidth: e.fieldWidth,
|
|
516
551
|
align: e.align
|
|
517
|
-
},
|
|
518
|
-
Surface: ({ props: e, slots:
|
|
519
|
-
Card: ({ props: e, bindings:
|
|
520
|
-
const [i, a] = b(e.expanded,
|
|
521
|
-
return d(
|
|
552
|
+
}, o),
|
|
553
|
+
Surface: ({ props: e, slots: o }) => d(pe, e, o),
|
|
554
|
+
Card: ({ props: e, bindings: o, slots: n, emit: s }) => {
|
|
555
|
+
const [i, a] = b(e.expanded, o?.expanded);
|
|
556
|
+
return d(de, {
|
|
522
557
|
title: e.title,
|
|
523
558
|
layoutType: e.layoutType,
|
|
524
559
|
expandable: e.expandable,
|
|
@@ -529,22 +564,23 @@ const Le = {
|
|
|
529
564
|
}
|
|
530
565
|
}, n);
|
|
531
566
|
},
|
|
532
|
-
Callout: ({ props: e, slots:
|
|
567
|
+
Callout: ({ props: e, slots: o, emit: n }) => d(ce, {
|
|
533
568
|
tone: e.tone,
|
|
534
569
|
title: e.title,
|
|
535
570
|
closable: e.closable,
|
|
571
|
+
code: e.code,
|
|
536
572
|
onClose: () => n("close")
|
|
537
|
-
},
|
|
538
|
-
EmptyState: ({ props: e, slots:
|
|
573
|
+
}, o),
|
|
574
|
+
EmptyState: ({ props: e, slots: o }) => d(le, {
|
|
539
575
|
title: e.title,
|
|
540
576
|
description: e.description,
|
|
541
577
|
icon: C(e.icon)
|
|
542
|
-
},
|
|
543
|
-
Progress: ({ props: e }) => d(
|
|
544
|
-
Badge: ({ props: e }) => d(
|
|
545
|
-
Dialog: ({ props: e, bindings:
|
|
546
|
-
const [i, a] = b(e.open,
|
|
547
|
-
return d(
|
|
578
|
+
}, o),
|
|
579
|
+
Progress: ({ props: e }) => d(re, e),
|
|
580
|
+
Badge: ({ props: e }) => d(ae, { tone: e.tone }, Ee(e.text)),
|
|
581
|
+
Dialog: ({ props: e, bindings: o, slots: n, emit: s }) => {
|
|
582
|
+
const [i, a] = b(e.open, o?.open);
|
|
583
|
+
return d(se, {
|
|
548
584
|
open: i ?? !1,
|
|
549
585
|
title: e.title,
|
|
550
586
|
description: e.description,
|
|
@@ -555,15 +591,19 @@ const Le = {
|
|
|
555
591
|
}
|
|
556
592
|
}, n);
|
|
557
593
|
},
|
|
558
|
-
DataTable: ({ props: e }) => d(
|
|
559
|
-
ResourceList: ({ props: e, slots:
|
|
560
|
-
|
|
561
|
-
d(
|
|
594
|
+
DataTable: ({ props: e }) => d(K, e),
|
|
595
|
+
ResourceList: ({ props: e, slots: o }) => d("section", { class: "min-w-0", "data-syno-pkg-land-ui": "", "data-ui-resource-list": "" }, [
|
|
596
|
+
o.toolbar ? d("div", { class: "mb-3 flex flex-wrap items-center gap-2" }, o.toolbar()) : null,
|
|
597
|
+
d(K, e)
|
|
562
598
|
]),
|
|
599
|
+
CellText: ({ props: e, emit: o }) => d(ie, { ...e, onOpen: () => o("open") }),
|
|
600
|
+
CellStatus: ({ props: e }) => d(ne, e),
|
|
601
|
+
ListItem: ({ props: e, slots: o }) => d(oe, e, o),
|
|
602
|
+
InputGroup: ({ slots: e }) => d(te, null, e),
|
|
563
603
|
Loading: ({ props: e }) => d(ee, { text: e.text })
|
|
564
|
-
}, { registry:
|
|
565
|
-
components:
|
|
566
|
-
}),
|
|
604
|
+
}, { registry: U } = B(A, {
|
|
605
|
+
components: Je
|
|
606
|
+
}), ut = /* @__PURE__ */ G({
|
|
567
607
|
__name: "SynoJsonRenderer",
|
|
568
608
|
props: {
|
|
569
609
|
spec: {},
|
|
@@ -579,8 +619,8 @@ const Le = {
|
|
|
579
619
|
fallback: {}
|
|
580
620
|
},
|
|
581
621
|
setup(e) {
|
|
582
|
-
return (
|
|
583
|
-
registry: j(
|
|
622
|
+
return (o, n) => (X(), Y(j(M), {
|
|
623
|
+
registry: j(U),
|
|
584
624
|
store: e.store,
|
|
585
625
|
"initial-state": e.state ?? e.spec?.state ?? {},
|
|
586
626
|
handlers: e.handlers,
|
|
@@ -593,7 +633,7 @@ const Le = {
|
|
|
593
633
|
default: Q(() => [
|
|
594
634
|
Z(j(W), {
|
|
595
635
|
spec: e.spec,
|
|
596
|
-
registry: j(
|
|
636
|
+
registry: j(U),
|
|
597
637
|
loading: e.loading,
|
|
598
638
|
fallback: e.fallback
|
|
599
639
|
}, null, 8, ["spec", "registry", "loading", "fallback"])
|
|
@@ -601,56 +641,56 @@ const Le = {
|
|
|
601
641
|
_: 1
|
|
602
642
|
}, 8, ["registry", "store", "initial-state", "handlers", "navigate", "functions", "directives", "validation-functions", "on-state-change"]));
|
|
603
643
|
}
|
|
604
|
-
}),
|
|
605
|
-
function q(e,
|
|
606
|
-
return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, s]) => m(s) ? q(s, `${
|
|
644
|
+
}), Ve = ["label", "title", "description", "text", "placeholder", "emptyText", "help", "ariaLabel", "valueLabel", "searchPlaceholder"];
|
|
645
|
+
function q(e, o = "") {
|
|
646
|
+
return Array.isArray(e) ? e : Object.entries(e).flatMap(([n, s]) => m(s) ? q(s, `${o}${n}.`) : [`${o}${n}`]);
|
|
607
647
|
}
|
|
608
|
-
const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e), u = (...e) => e.map((
|
|
609
|
-
function
|
|
610
|
-
const n = Array.from({ length:
|
|
648
|
+
const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e), u = (...e) => e.map((o) => "/" + String(o).replaceAll("~", "~0").replaceAll("/", "~1")).join("");
|
|
649
|
+
function _e(e, o) {
|
|
650
|
+
const n = Array.from({ length: o.length + 1 }, (s, i) => i);
|
|
611
651
|
for (let s = 1; s <= e.length; s++) {
|
|
612
652
|
let i = n[0];
|
|
613
653
|
n[0] = s;
|
|
614
|
-
for (let a = 1; a <=
|
|
654
|
+
for (let a = 1; a <= o.length; a++) {
|
|
615
655
|
const r = n[a];
|
|
616
|
-
n[a] = Math.min(n[a] + 1, n[a - 1] + 1, i + (e[s - 1].toLowerCase() ===
|
|
656
|
+
n[a] = Math.min(n[a] + 1, n[a - 1] + 1, i + (e[s - 1].toLowerCase() === o[a - 1].toLowerCase() ? 0 : 1)), i = r;
|
|
617
657
|
}
|
|
618
658
|
}
|
|
619
|
-
return n[
|
|
659
|
+
return n[o.length];
|
|
620
660
|
}
|
|
621
|
-
function y(e,
|
|
661
|
+
function y(e, o) {
|
|
622
662
|
let n, s = 1 / 0;
|
|
623
|
-
for (const i of
|
|
624
|
-
const a =
|
|
663
|
+
for (const i of o) {
|
|
664
|
+
const a = _e(e, i);
|
|
625
665
|
a < s && ([n, s] = [i, a]);
|
|
626
666
|
}
|
|
627
667
|
return n !== void 0 && s <= Math.max(2, Math.floor(e.length / 3)) ? n : void 0;
|
|
628
668
|
}
|
|
629
|
-
const
|
|
669
|
+
const qe = ["$state", "$item", "$index", "$bindState", "$bindItem", "$cond", "$computed", "$template"], Fe = (e) => m(e) && qe.some((o) => Object.hasOwn(e, o)), I = (e) => Fe(e) || (Array.isArray(e) ? e.some(I) : m(e) && Object.values(e).some(I));
|
|
630
670
|
function P(e) {
|
|
631
|
-
const
|
|
632
|
-
return m(
|
|
671
|
+
const o = e.props?.shape;
|
|
672
|
+
return m(o) ? o : void 0;
|
|
633
673
|
}
|
|
634
|
-
const
|
|
635
|
-
function
|
|
636
|
-
if (e.code === "invalid_value") return `Use one of: ${e.values.map((
|
|
674
|
+
const R = (e) => e.safeParse(void 0).success;
|
|
675
|
+
function ze(e) {
|
|
676
|
+
if (e.code === "invalid_value") return `Use one of: ${e.values.map((o) => JSON.stringify(o)).join(", ")}.`;
|
|
637
677
|
if (e.code === "invalid_type") return `Expected ${e.expected}.`;
|
|
638
678
|
}
|
|
639
|
-
const v = (e,
|
|
640
|
-
class
|
|
679
|
+
const v = (e, o) => `${e}: ${o.join(", ")}`;
|
|
680
|
+
class Be {
|
|
641
681
|
errors = [];
|
|
642
682
|
warnings = [];
|
|
643
|
-
error(
|
|
644
|
-
this.errors.push({ severity: "error", ...
|
|
683
|
+
error(o) {
|
|
684
|
+
this.errors.push({ severity: "error", ...o });
|
|
645
685
|
}
|
|
646
|
-
warn(
|
|
647
|
-
this.warnings.push({ severity: "warning", ...
|
|
686
|
+
warn(o) {
|
|
687
|
+
this.warnings.push({ severity: "warning", ...o });
|
|
648
688
|
}
|
|
649
689
|
}
|
|
650
|
-
function
|
|
651
|
-
const n =
|
|
690
|
+
function mt(e, o = {}) {
|
|
691
|
+
const n = o.catalog ?? A, s = n.data.components, i = new Be();
|
|
652
692
|
if (!m(e))
|
|
653
|
-
return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }),
|
|
693
|
+
return i.error({ code: "invalid_spec", path: "", message: "A spec must be a JSON object.", hint: 'Return {"root": "<key>", "elements": {...}, "state": {...}}.' }), T(i);
|
|
654
694
|
const a = m(e.elements) ? e.elements : void 0;
|
|
655
695
|
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": []}}}.' });
|
|
656
696
|
const r = Object.keys(a ?? {});
|
|
@@ -673,27 +713,27 @@ function ct(e, t = {}) {
|
|
|
673
713
|
});
|
|
674
714
|
continue;
|
|
675
715
|
}
|
|
676
|
-
|
|
716
|
+
Me(i, p, h, s[h], f.props), We(i, p, h, s[h], f, a);
|
|
677
717
|
}
|
|
678
|
-
const c =
|
|
718
|
+
const c = o.messages && q(o.messages), l = {
|
|
679
719
|
issues: i,
|
|
680
720
|
components: s,
|
|
681
721
|
actions: [
|
|
682
722
|
...(n.schema?.builtInActions ?? []).map((p) => p.name),
|
|
683
723
|
...Object.keys(n.data.actions ?? {}),
|
|
684
|
-
...
|
|
724
|
+
...o.actions ?? []
|
|
685
725
|
],
|
|
686
|
-
state: { ...
|
|
726
|
+
state: { ...o.state, ...m(e.state) ? e.state : {} },
|
|
687
727
|
// A message catalog implies the host registers the `t` function.
|
|
688
|
-
functions:
|
|
728
|
+
functions: o.functions || c ? [...o.functions ?? [], ...c ? ["t"] : []] : void 0,
|
|
689
729
|
messageKeys: c
|
|
690
730
|
};
|
|
691
|
-
return a && typeof e.root == "string" && Object.hasOwn(a, e.root) &&
|
|
731
|
+
return a && typeof e.root == "string" && Object.hasOwn(a, e.root) && He(l, e.root, a), T(i);
|
|
692
732
|
}
|
|
693
|
-
function
|
|
694
|
-
const a = (...l) => u("elements",
|
|
733
|
+
function Me(e, o, n, s, i) {
|
|
734
|
+
const a = (...l) => u("elements", o, "props", ...l);
|
|
695
735
|
if (!m(i)) {
|
|
696
|
-
e.error({ code: "invalid_props", path: a(), elementKey:
|
|
736
|
+
e.error({ code: "invalid_props", path: a(), elementKey: o, message: '"props" must be an object.', hint: 'Use "props": {} when the component needs none.' });
|
|
697
737
|
return;
|
|
698
738
|
}
|
|
699
739
|
const r = P(s);
|
|
@@ -706,82 +746,82 @@ function qe(e, t, n, s, i) {
|
|
|
706
746
|
e.error({
|
|
707
747
|
code: "unknown_prop",
|
|
708
748
|
path: a(l),
|
|
709
|
-
elementKey:
|
|
749
|
+
elementKey: o,
|
|
710
750
|
message: `${n} has no prop "${l}".`,
|
|
711
751
|
hint: h ? `Did you mean "${h}"? Run "syno-pkg-land-ui describe ${n}".` : v(`${n} props`, c)
|
|
712
752
|
});
|
|
713
753
|
continue;
|
|
714
754
|
}
|
|
715
|
-
if (
|
|
755
|
+
if (I(p)) continue;
|
|
716
756
|
const w = f.safeParse(p);
|
|
717
757
|
if (!w.success)
|
|
718
758
|
for (const h of w.error.issues)
|
|
719
759
|
e.error({
|
|
720
760
|
code: "invalid_prop",
|
|
721
761
|
path: a(l, ...h.path.map((g) => String(g))),
|
|
722
|
-
elementKey:
|
|
762
|
+
elementKey: o,
|
|
723
763
|
message: `${n}.${l}: ${h.message}`,
|
|
724
|
-
hint:
|
|
764
|
+
hint: ze(h)
|
|
725
765
|
});
|
|
726
766
|
}
|
|
727
767
|
for (const l of c)
|
|
728
|
-
!Object.hasOwn(i, l) && !
|
|
768
|
+
!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.` });
|
|
729
769
|
}
|
|
730
|
-
function F(e,
|
|
770
|
+
function F(e, o) {
|
|
731
771
|
const n = [];
|
|
732
|
-
if (Array.isArray(
|
|
772
|
+
if (Array.isArray(o.children) && o.children.forEach((s, i) => {
|
|
733
773
|
typeof s == "string" && n.push({ child: s, path: u("elements", e, "children", i) });
|
|
734
|
-
}), m(
|
|
735
|
-
for (const [s, i] of Object.entries(
|
|
774
|
+
}), m(o.slots))
|
|
775
|
+
for (const [s, i] of Object.entries(o.slots))
|
|
736
776
|
Array.isArray(i) && i.forEach((a, r) => {
|
|
737
777
|
typeof a == "string" && n.push({ child: a, path: u("elements", e, "slots", s, r) });
|
|
738
778
|
});
|
|
739
779
|
return n;
|
|
740
780
|
}
|
|
741
|
-
function
|
|
781
|
+
function We(e, o, n, s, i, a) {
|
|
742
782
|
const r = s.slots ?? [], { children: c } = i;
|
|
743
|
-
if (c !== void 0 && !(Array.isArray(c) && c.every((l) => typeof l == "string")) ? e.error({ code: "invalid_children", path: u("elements",
|
|
783
|
+
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({
|
|
744
784
|
code: "children_not_allowed",
|
|
745
|
-
path: u("elements",
|
|
746
|
-
elementKey:
|
|
785
|
+
path: u("elements", o, "children"),
|
|
786
|
+
elementKey: o,
|
|
747
787
|
message: `${n} does not render children.`,
|
|
748
788
|
hint: r.length ? v(`Put them in a named slot of ${n}`, r) : 'Use "children": [] and put the content in a sibling or parent container.'
|
|
749
789
|
}), i.slots !== void 0)
|
|
750
790
|
if (!m(i.slots))
|
|
751
|
-
e.error({ code: "invalid_slots", path: u("elements",
|
|
791
|
+
e.error({ code: "invalid_slots", path: u("elements", o, "slots"), elementKey: o, message: '"slots" must map slot names to arrays of element keys.' });
|
|
752
792
|
else
|
|
753
793
|
for (const [l, p] of Object.entries(i.slots))
|
|
754
794
|
if (r.includes(l))
|
|
755
|
-
Array.isArray(p) || e.error({ code: "invalid_slots", path: u("elements",
|
|
795
|
+
Array.isArray(p) || e.error({ code: "invalid_slots", path: u("elements", o, "slots", l), elementKey: o, message: `Slot "${l}" must be an array of element keys.` });
|
|
756
796
|
else {
|
|
757
797
|
const f = y(l, r);
|
|
758
798
|
e.error({
|
|
759
799
|
code: "unknown_slot",
|
|
760
|
-
path: u("elements",
|
|
761
|
-
elementKey:
|
|
800
|
+
path: u("elements", o, "slots", l),
|
|
801
|
+
elementKey: o,
|
|
762
802
|
message: `${n} has no slot "${l}".`,
|
|
763
803
|
hint: f ? `Did you mean "${f}"?` : r.length ? v(`${n} slots`, r) : `${n} has no slots.`
|
|
764
804
|
});
|
|
765
805
|
}
|
|
766
|
-
for (const l of F(
|
|
806
|
+
for (const l of F(o, i))
|
|
767
807
|
if (!Object.hasOwn(a, l.child)) {
|
|
768
808
|
const p = y(l.child, Object.keys(a));
|
|
769
809
|
e.error({
|
|
770
810
|
code: "missing_child",
|
|
771
811
|
path: l.path,
|
|
772
|
-
elementKey:
|
|
812
|
+
elementKey: o,
|
|
773
813
|
message: `"${l.child}" is not in "elements".`,
|
|
774
814
|
hint: p ? `Did you mean "${p}"? Otherwise add the element.` : "Add the element or remove the reference."
|
|
775
815
|
});
|
|
776
816
|
}
|
|
777
817
|
}
|
|
778
|
-
function
|
|
818
|
+
function He(e, o, n) {
|
|
779
819
|
const { issues: s } = e, i = /* @__PURE__ */ new Set(), a = (r, c, l, p) => {
|
|
780
820
|
const f = n[r];
|
|
781
821
|
if (!m(f)) return;
|
|
782
822
|
i.add(r);
|
|
783
823
|
const w = m(f.repeat);
|
|
784
|
-
|
|
824
|
+
Qe(e, r, f, p || w);
|
|
785
825
|
const h = f.type === "AppRoot";
|
|
786
826
|
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." });
|
|
787
827
|
for (const g of F(r, f))
|
|
@@ -793,13 +833,13 @@ function ze(e, t, n) {
|
|
|
793
833
|
a(g.child, [...c, g.child], l || h, p || w);
|
|
794
834
|
}
|
|
795
835
|
};
|
|
796
|
-
a(
|
|
836
|
+
a(o, [o], !1, !1);
|
|
797
837
|
for (const r of Object.keys(n))
|
|
798
838
|
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." });
|
|
799
839
|
}
|
|
800
|
-
function
|
|
840
|
+
function Ge(e, o) {
|
|
801
841
|
let n = e;
|
|
802
|
-
for (const s of
|
|
842
|
+
for (const s of o.split("/").slice(1)) {
|
|
803
843
|
const i = s.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
804
844
|
if (Array.isArray(n) && /^\d+$/.test(i)) n = n[Number(i)];
|
|
805
845
|
else if (m(n) && Object.hasOwn(n, i)) n = n[i];
|
|
@@ -807,56 +847,56 @@ function Be(e, t) {
|
|
|
807
847
|
}
|
|
808
848
|
return { found: !0, value: n };
|
|
809
849
|
}
|
|
810
|
-
function $(e,
|
|
850
|
+
function $(e, o, n, s, { mustExist: i }) {
|
|
811
851
|
if (typeof n != "string" || !n.startsWith("/")) {
|
|
812
852
|
e.issues.error({
|
|
813
853
|
code: "invalid_state_path",
|
|
814
854
|
path: s,
|
|
815
|
-
elementKey:
|
|
855
|
+
elementKey: o,
|
|
816
856
|
message: `State paths are JSON Pointers; got ${JSON.stringify(n)}.`,
|
|
817
857
|
hint: typeof n == "string" ? `Use "/${n.replace(/^\.?\/?/, "").replaceAll(".", "/")}".` : 'Use a string such as "/settings/enabled".'
|
|
818
858
|
});
|
|
819
859
|
return;
|
|
820
860
|
}
|
|
821
|
-
i && !
|
|
861
|
+
i && !Ge(e.state, n).found && e.issues.warn({
|
|
822
862
|
code: "state_path_missing",
|
|
823
863
|
path: s,
|
|
824
|
-
elementKey:
|
|
864
|
+
elementKey: o,
|
|
825
865
|
message: `State "${n}" has no initial value.`,
|
|
826
866
|
hint: `Seed it in the spec's "state", or pass the host state with --state, so the first render has a value.`
|
|
827
867
|
});
|
|
828
868
|
}
|
|
829
|
-
function S(e,
|
|
869
|
+
function S(e, o, n, s, i) {
|
|
830
870
|
if (Array.isArray(n)) {
|
|
831
|
-
n.forEach((a, r) => S(e,
|
|
871
|
+
n.forEach((a, r) => S(e, o, a, s + u(r), i));
|
|
832
872
|
return;
|
|
833
873
|
}
|
|
834
874
|
if (m(n)) {
|
|
835
875
|
for (const a of ["$state", "$bindState"])
|
|
836
|
-
Object.hasOwn(n, a) && $(e,
|
|
876
|
+
Object.hasOwn(n, a) && $(e, o, n[a], s + u(a), { mustExist: !0 });
|
|
837
877
|
for (const a of ["$item", "$bindItem", "$index"])
|
|
838
878
|
Object.hasOwn(n, a) && !i && e.issues.error({
|
|
839
879
|
code: "item_outside_repeat",
|
|
840
880
|
path: s + u(a),
|
|
841
|
-
elementKey:
|
|
881
|
+
elementKey: o,
|
|
842
882
|
message: `${a} only works inside an element with "repeat" or its descendants.`,
|
|
843
883
|
hint: 'Add "repeat": {"statePath": "/list"} to an ancestor, or read the value with $state.'
|
|
844
884
|
});
|
|
845
885
|
if (typeof n.$template == "string")
|
|
846
886
|
for (const a of n.$template.matchAll(/\$\{([^}]*)\}/g))
|
|
847
|
-
$(e,
|
|
848
|
-
typeof n.$computed == "string" &&
|
|
887
|
+
$(e, o, a[1], s + u("$template"), { mustExist: !0 });
|
|
888
|
+
typeof n.$computed == "string" && Xe(e, o, n, s);
|
|
849
889
|
for (const [a, r] of Object.entries(n))
|
|
850
|
-
["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) || S(e,
|
|
890
|
+
["$state", "$bindState", "$item", "$bindItem", "$index", "$template"].includes(a) || S(e, o, r, s + u(a), i);
|
|
851
891
|
}
|
|
852
892
|
}
|
|
853
|
-
function
|
|
893
|
+
function Xe(e, o, n, s) {
|
|
854
894
|
const i = n.$computed;
|
|
855
895
|
if (!e.functions)
|
|
856
896
|
e.issues.warn({
|
|
857
897
|
code: "unverified_function",
|
|
858
898
|
path: s + u("$computed"),
|
|
859
|
-
elementKey:
|
|
899
|
+
elementKey: o,
|
|
860
900
|
message: `$computed "${i}" must be registered by the host.`,
|
|
861
901
|
hint: `Pass the host function names with --functions ${i} to verify it.`
|
|
862
902
|
});
|
|
@@ -865,7 +905,7 @@ function Me(e, t, n, s) {
|
|
|
865
905
|
e.issues.error({
|
|
866
906
|
code: "unknown_function",
|
|
867
907
|
path: s + u("$computed"),
|
|
868
|
-
elementKey:
|
|
908
|
+
elementKey: o,
|
|
869
909
|
message: `$computed "${i}" is not a host function.`,
|
|
870
910
|
hint: `${r ? `Did you mean "${r}"? ` : ""}${v("Host functions", e.functions)}`
|
|
871
911
|
});
|
|
@@ -877,27 +917,27 @@ function Me(e, t, n, s) {
|
|
|
877
917
|
e.issues.error({
|
|
878
918
|
code: "missing_i18n_key",
|
|
879
919
|
path: s + u("args", "key"),
|
|
880
|
-
elementKey:
|
|
920
|
+
elementKey: o,
|
|
881
921
|
message: `Message key ${JSON.stringify(a)} is not in the message catalog.`,
|
|
882
922
|
hint: r ? `Did you mean "${r}"? Otherwise add the key to every locale.` : "Add the key to every locale, or use an existing key."
|
|
883
923
|
});
|
|
884
924
|
}
|
|
885
925
|
}
|
|
886
|
-
const
|
|
887
|
-
function
|
|
888
|
-
const i = (...c) => u("elements",
|
|
889
|
-
if (S(e,
|
|
890
|
-
for (const c of
|
|
926
|
+
const Ye = ["statePath", "clearStatePath"];
|
|
927
|
+
function Qe(e, o, n, s) {
|
|
928
|
+
const i = (...c) => u("elements", o, ...c);
|
|
929
|
+
if (S(e, o, n.props, i("props"), s), e.messageKeys && m(n.props))
|
|
930
|
+
for (const c of Ve) {
|
|
891
931
|
const l = n.props[c];
|
|
892
932
|
typeof l == "string" && l.trim() && e.issues.warn({
|
|
893
933
|
code: "literal_text",
|
|
894
934
|
path: i("props", c),
|
|
895
|
-
elementKey:
|
|
935
|
+
elementKey: o,
|
|
896
936
|
message: `Literal text ${JSON.stringify(l)} is not localized.`,
|
|
897
937
|
hint: 'Use {"$computed": "t", "args": {"key": "<message key>"}}.'
|
|
898
938
|
});
|
|
899
939
|
}
|
|
900
|
-
n.visible !== void 0 && S(e,
|
|
940
|
+
n.visible !== void 0 && S(e, o, n.visible, i("visible"), s), m(n.repeat) && $(e, o, n.repeat.statePath, i("repeat", "statePath"), { mustExist: !0 });
|
|
901
941
|
const a = typeof n.type == "string" ? n.type : "", r = e.components[a]?.events ?? [];
|
|
902
942
|
if (m(n.on))
|
|
903
943
|
for (const [c, l] of Object.entries(n.on)) {
|
|
@@ -906,22 +946,22 @@ function He(e, t, n, s) {
|
|
|
906
946
|
e.issues.error({
|
|
907
947
|
code: "unknown_event",
|
|
908
948
|
path: i("on", c),
|
|
909
|
-
elementKey:
|
|
949
|
+
elementKey: o,
|
|
910
950
|
message: `${a} does not emit "${c}".`,
|
|
911
951
|
hint: p ? `Did you mean "${p}"?` : r.length ? v(`${a} events`, r) : `${a} emits no events.`
|
|
912
952
|
});
|
|
913
953
|
}
|
|
914
|
-
|
|
954
|
+
D(e, o, l, i("on", c), s);
|
|
915
955
|
}
|
|
916
956
|
if (m(n.watch))
|
|
917
957
|
for (const [c, l] of Object.entries(n.watch))
|
|
918
|
-
$(e,
|
|
958
|
+
$(e, o, c, i("watch", c), { mustExist: !1 }), D(e, o, l, i("watch", c), s);
|
|
919
959
|
}
|
|
920
|
-
function
|
|
960
|
+
function D(e, o, n, s, i) {
|
|
921
961
|
(Array.isArray(n) ? n : [n]).forEach((r, c) => {
|
|
922
962
|
const l = Array.isArray(n) ? s + u(c) : s;
|
|
923
963
|
if (!m(r) || typeof r.action != "string") {
|
|
924
|
-
e.issues.error({ code: "invalid_action_binding", path: l, elementKey:
|
|
964
|
+
e.issues.error({ code: "invalid_action_binding", path: l, elementKey: o, message: 'An action binding is {"action": "<name>", "params": {...}}.' });
|
|
925
965
|
return;
|
|
926
966
|
}
|
|
927
967
|
if (!e.actions.includes(r.action)) {
|
|
@@ -929,27 +969,27 @@ function L(e, t, n, s, i) {
|
|
|
929
969
|
e.issues.error({
|
|
930
970
|
code: "unknown_action",
|
|
931
971
|
path: l + u("action"),
|
|
932
|
-
elementKey:
|
|
972
|
+
elementKey: o,
|
|
933
973
|
message: `Action "${r.action}" is not declared.`,
|
|
934
974
|
hint: `${p ? `Did you mean "${p}"? ` : ""}Declare it in the app catalog, or pass host handlers with --actions ${r.action}. ${v("Known actions", e.actions)}`
|
|
935
975
|
});
|
|
936
976
|
}
|
|
937
977
|
if (m(r.params)) {
|
|
938
|
-
for (const p of
|
|
939
|
-
Object.hasOwn(r.params, p) && $(e,
|
|
940
|
-
S(e,
|
|
978
|
+
for (const p of Ye)
|
|
979
|
+
Object.hasOwn(r.params, p) && $(e, o, r.params[p], l + u("params", p), { mustExist: !1 });
|
|
980
|
+
S(e, o, r.params, l + u("params"), i);
|
|
941
981
|
}
|
|
942
982
|
});
|
|
943
983
|
}
|
|
944
|
-
function
|
|
984
|
+
function T(e) {
|
|
945
985
|
return { valid: e.errors.length === 0, errors: e.errors, warnings: e.warnings };
|
|
946
986
|
}
|
|
947
|
-
const
|
|
948
|
-
function
|
|
949
|
-
const
|
|
950
|
-
return delete
|
|
987
|
+
const x = V;
|
|
988
|
+
function Ze(e) {
|
|
989
|
+
const o = t.toJSONSchema(e);
|
|
990
|
+
return delete o.$schema, o;
|
|
951
991
|
}
|
|
952
|
-
function
|
|
992
|
+
function et(e) {
|
|
953
993
|
if (Array.isArray(e.enum)) return e.enum[0];
|
|
954
994
|
switch (e.type) {
|
|
955
995
|
case "string":
|
|
@@ -965,42 +1005,42 @@ function Xe(e) {
|
|
|
965
1005
|
return {};
|
|
966
1006
|
}
|
|
967
1007
|
}
|
|
968
|
-
function
|
|
969
|
-
return Object.entries(
|
|
1008
|
+
function ht() {
|
|
1009
|
+
return Object.entries(x).map(([e, o]) => ({
|
|
970
1010
|
name: e,
|
|
971
|
-
description:
|
|
972
|
-
required: Object.entries(P(
|
|
973
|
-
slots:
|
|
974
|
-
events:
|
|
1011
|
+
description: o.description,
|
|
1012
|
+
required: Object.entries(P(o) ?? {}).filter(([, n]) => !R(n)).map(([n]) => n),
|
|
1013
|
+
slots: o.slots ?? [],
|
|
1014
|
+
events: o.events ?? []
|
|
975
1015
|
}));
|
|
976
1016
|
}
|
|
977
|
-
function
|
|
978
|
-
return y(e, Object.keys(
|
|
1017
|
+
function ft(e) {
|
|
1018
|
+
return y(e, Object.keys(x));
|
|
979
1019
|
}
|
|
980
|
-
function
|
|
981
|
-
if (!Object.hasOwn(
|
|
982
|
-
const
|
|
1020
|
+
function gt(e) {
|
|
1021
|
+
if (!Object.hasOwn(x, e)) return;
|
|
1022
|
+
const o = x[e], n = Object.fromEntries(Object.entries(P(o) ?? {}).map(([s, i]) => [
|
|
983
1023
|
s,
|
|
984
|
-
{ required: !
|
|
1024
|
+
{ required: !R(i), schema: Ze(i) }
|
|
985
1025
|
]));
|
|
986
1026
|
return {
|
|
987
1027
|
name: e,
|
|
988
|
-
description:
|
|
1028
|
+
description: o.description,
|
|
989
1029
|
props: n,
|
|
990
|
-
slots:
|
|
991
|
-
events:
|
|
1030
|
+
slots: o.slots ?? [],
|
|
1031
|
+
events: o.events ?? [],
|
|
992
1032
|
example: {
|
|
993
1033
|
type: e,
|
|
994
|
-
props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s,
|
|
1034
|
+
props: Object.fromEntries(Object.entries(n).filter(([, s]) => s.required).map(([s, { schema: i }]) => [s, et(i)])),
|
|
995
1035
|
children: []
|
|
996
1036
|
}
|
|
997
1037
|
};
|
|
998
1038
|
}
|
|
999
|
-
const
|
|
1039
|
+
const O = { type: "string", pattern: "^/" }, tt = {
|
|
1000
1040
|
description: "A json-render expression resolved at render time.",
|
|
1001
1041
|
anyOf: [
|
|
1002
|
-
{ type: "object", required: ["$state"], properties: { $state:
|
|
1003
|
-
{ type: "object", required: ["$bindState"], properties: { $bindState:
|
|
1042
|
+
{ type: "object", required: ["$state"], properties: { $state: O } },
|
|
1043
|
+
{ type: "object", required: ["$bindState"], properties: { $bindState: O } },
|
|
1004
1044
|
{ type: "object", required: ["$item"], properties: { $item: { type: "string" } } },
|
|
1005
1045
|
{ type: "object", required: ["$bindItem"], properties: { $bindItem: { type: "string" } } },
|
|
1006
1046
|
{ type: "object", required: ["$index"], properties: { $index: { const: !0 } } },
|
|
@@ -1008,7 +1048,7 @@ const x = { type: "string", pattern: "^/" }, Ye = {
|
|
|
1008
1048
|
{ type: "object", required: ["$computed"], properties: { $computed: { type: "string" }, args: { type: "object" } } },
|
|
1009
1049
|
{ type: "object", required: ["$cond", "$then", "$else"], properties: { $cond: {}, $then: {}, $else: {} } }
|
|
1010
1050
|
]
|
|
1011
|
-
},
|
|
1051
|
+
}, ot = {
|
|
1012
1052
|
type: "object",
|
|
1013
1053
|
required: ["action"],
|
|
1014
1054
|
properties: {
|
|
@@ -1020,21 +1060,21 @@ const x = { type: "string", pattern: "^/" }, Ye = {
|
|
|
1020
1060
|
preventDefault: { type: "boolean" }
|
|
1021
1061
|
},
|
|
1022
1062
|
additionalProperties: !1
|
|
1023
|
-
},
|
|
1024
|
-
function
|
|
1063
|
+
}, E = { anyOf: [{ $ref: "#/$defs/actionBinding" }, { type: "array", items: { $ref: "#/$defs/actionBinding" } }] }, N = { type: "array", items: { type: "string" } };
|
|
1064
|
+
function nt(e, o, n) {
|
|
1025
1065
|
const s = (r) => Array.isArray(r) ? r.map(s) : !r || typeof r != "object" ? r : Object.fromEntries(Object.entries(r).map(([c, l]) => [
|
|
1026
1066
|
c,
|
|
1027
|
-
c === "$ref" && typeof l == "string" ? l.replace("#/$defs/", `#/$defs/${
|
|
1067
|
+
c === "$ref" && typeof l == "string" ? l.replace("#/$defs/", `#/$defs/${o}`) : s(l)
|
|
1028
1068
|
])), { $defs: i, ...a } = e;
|
|
1029
1069
|
delete a.$schema;
|
|
1030
|
-
for (const [r, c] of Object.entries(i ?? {})) n[
|
|
1070
|
+
for (const [r, c] of Object.entries(i ?? {})) n[o + r] = s(c);
|
|
1031
1071
|
return s(a);
|
|
1032
1072
|
}
|
|
1033
|
-
function
|
|
1034
|
-
const s = P(
|
|
1073
|
+
function it(e, o, n) {
|
|
1074
|
+
const s = P(o), i = o.slots ?? [];
|
|
1035
1075
|
let a = { type: "object" };
|
|
1036
1076
|
if (s) {
|
|
1037
|
-
const r =
|
|
1077
|
+
const r = nt(t.toJSONSchema(t.object(s)), `${e}__`, n), c = r.properties;
|
|
1038
1078
|
a = {
|
|
1039
1079
|
...r,
|
|
1040
1080
|
properties: Object.fromEntries(Object.entries(c).map(([l, p]) => [
|
|
@@ -1046,30 +1086,30 @@ function et(e, t, n) {
|
|
|
1046
1086
|
return {
|
|
1047
1087
|
if: { properties: { type: { const: e } } },
|
|
1048
1088
|
then: {
|
|
1049
|
-
...
|
|
1089
|
+
...o.description ? { description: o.description } : {},
|
|
1050
1090
|
properties: {
|
|
1051
1091
|
props: a,
|
|
1052
1092
|
...i.includes("default") ? {} : { children: { maxItems: 0 } },
|
|
1053
1093
|
slots: { propertyNames: { enum: i.filter((r) => r !== "default") } },
|
|
1054
|
-
on: { propertyNames: { enum:
|
|
1094
|
+
on: { propertyNames: { enum: o.events ?? [] } }
|
|
1055
1095
|
}
|
|
1056
1096
|
}
|
|
1057
1097
|
};
|
|
1058
1098
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const
|
|
1099
|
+
function bt(e = A) {
|
|
1100
|
+
const o = e.data.components, n = { expression: tt, actionBinding: ot }, s = Object.entries(o).map(([i, a]) => it(i, a, n));
|
|
1061
1101
|
return n.element = {
|
|
1062
1102
|
type: "object",
|
|
1063
1103
|
required: ["type", "props"],
|
|
1064
1104
|
properties: {
|
|
1065
|
-
type: { enum: Object.keys(
|
|
1105
|
+
type: { enum: Object.keys(o) },
|
|
1066
1106
|
props: { type: "object" },
|
|
1067
|
-
children:
|
|
1068
|
-
slots: { type: "object", additionalProperties:
|
|
1107
|
+
children: N,
|
|
1108
|
+
slots: { type: "object", additionalProperties: N },
|
|
1069
1109
|
visible: {},
|
|
1070
|
-
on: { type: "object", additionalProperties:
|
|
1071
|
-
watch: { type: "object", propertyNames:
|
|
1072
|
-
repeat: { type: "object", required: ["statePath"], properties: { statePath:
|
|
1110
|
+
on: { type: "object", additionalProperties: E },
|
|
1111
|
+
watch: { type: "object", propertyNames: O, additionalProperties: E },
|
|
1112
|
+
repeat: { type: "object", required: ["statePath"], properties: { statePath: O, key: { type: "string" } }, additionalProperties: !1 }
|
|
1073
1113
|
},
|
|
1074
1114
|
additionalProperties: !1,
|
|
1075
1115
|
allOf: s
|
|
@@ -1088,30 +1128,30 @@ function mt(e = A) {
|
|
|
1088
1128
|
};
|
|
1089
1129
|
}
|
|
1090
1130
|
export {
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1131
|
+
Ot as ActionProvider,
|
|
1132
|
+
At as JSONUIProvider,
|
|
1133
|
+
Pt as Renderer,
|
|
1134
|
+
kt as StateProvider,
|
|
1135
|
+
ut as SynoJsonRenderer,
|
|
1136
|
+
Ct as ValidationProvider,
|
|
1137
|
+
It as VisibilityProvider,
|
|
1138
|
+
ft as closestSynoJsonComponent,
|
|
1139
|
+
St as createStateStore,
|
|
1140
|
+
jt as defineCatalog,
|
|
1141
|
+
Rt as defineRegistry,
|
|
1142
|
+
gt as describeSynoJsonComponent,
|
|
1143
|
+
Tt as jsonRenderVueSchema,
|
|
1144
|
+
ht as listSynoJsonComponents,
|
|
1145
|
+
pt as synoJsonAiPrompt,
|
|
1146
|
+
Ke as synoJsonAiRules,
|
|
1107
1147
|
A as synoJsonCatalog,
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1148
|
+
V as synoJsonComponentDefinitions,
|
|
1149
|
+
U as synoJsonRegistry,
|
|
1150
|
+
Je as synoJsonRenderers,
|
|
1151
|
+
bt as synoJsonSchema,
|
|
1152
|
+
Kt as useActions,
|
|
1153
|
+
Lt as useBoundProp,
|
|
1154
|
+
Ut as useStateStore,
|
|
1155
|
+
mt as validateSynoJsonSpec,
|
|
1156
|
+
vt as z
|
|
1117
1157
|
};
|