@synopackageland/ui 0.14.6 → 0.14.7
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 +9 -0
- package/README.md +2 -1
- package/dist/ButtonPolicyDemo.vue.d.ts +3 -0
- package/dist/components/composite/settings-section/SettingsSection.vue.d.ts +2 -2
- package/dist/components/containers/card/Card.vue.d.ts +2 -2
- package/dist/components/primitives/button/Button.vue.d.ts +4 -3
- package/dist/composables/buttonKind.d.ts +12 -4
- package/dist/index.js +247 -251
- package/dist/json-ai-prompt.md +1 -1
- package/dist/json-catalog.schema.json +1 -1
- package/dist/json-preview/preview.js +2378 -2385
- package/dist/json.js +22 -22
- 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/button-policy.md +62 -0
- package/docs/layout-rules.md +2 -1
- package/package.json +2 -1
package/dist/json.js
CHANGED
|
@@ -3,11 +3,11 @@ import { z as vt } from "zod";
|
|
|
3
3
|
import { defineCatalog as F } from "@json-render/core";
|
|
4
4
|
import { createStateStore as $t, defineCatalog as jt } from "@json-render/core";
|
|
5
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
|
|
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 Dt, useBoundProp as Kt, useStateStore as Lt } from "@json-render/vue";
|
|
7
7
|
import { schema as H } from "@json-render/vue/schema";
|
|
8
8
|
import { schema as Nt } 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, InputGroup as te, ListItem as oe, CellStatus as ne, CellText as ie, DataTable as
|
|
10
|
+
import { LoadingArea as ee, InputGroup as te, ListItem as oe, CellStatus as ne, CellText as ie, DataTable as D, Dialog as ae, Badge as se, Progress as re, EmptyState as le, Callout as ce, Card as de, Surface as pe, SettingsRow as ue, SettingsSection as me, FormItem as he, Form as fe, RadioGroup as ge, Switch as be, Checkbox as ye, Select as we, Input as ve, Button as Se, SectionTabs as $e, AppSidebar as je, AppToolbar as xe, PageHeader as Oe, PageContent as Ae, ResponsiveView as Pe, AppLayout as ke, AppRoot as Ce, getRegisteredIcon as Ie } from "./index.js";
|
|
11
11
|
const J = t.lazy(() => t.object({
|
|
12
12
|
key: t.string(),
|
|
13
13
|
label: t.string(),
|
|
@@ -22,7 +22,7 @@ const J = t.lazy(() => t.object({
|
|
|
22
22
|
disabled: t.boolean().optional()
|
|
23
23
|
}), Re = k.extend({
|
|
24
24
|
description: t.string().optional()
|
|
25
|
-
}),
|
|
25
|
+
}), K = t.object({
|
|
26
26
|
key: t.string(),
|
|
27
27
|
label: t.string(),
|
|
28
28
|
width: t.string().optional(),
|
|
@@ -125,7 +125,7 @@ const J = t.lazy(() => t.object({
|
|
|
125
125
|
icon: t.string().optional()
|
|
126
126
|
}),
|
|
127
127
|
events: ["press"],
|
|
128
|
-
description: "User action.
|
|
128
|
+
description: "User action. Its shape follows the container: a capsule in a Dialog footer, else a tool button. One primary (or one danger to confirm a deletion) per footer or section, placed last; toolbar and row actions, Delete included, stay secondary. Icon is an optional host-registered icon name."
|
|
129
129
|
},
|
|
130
130
|
Input: {
|
|
131
131
|
props: t.object({
|
|
@@ -296,7 +296,7 @@ const J = t.lazy(() => t.object({
|
|
|
296
296
|
},
|
|
297
297
|
DataTable: {
|
|
298
298
|
props: t.object({
|
|
299
|
-
columns: t.array(
|
|
299
|
+
columns: t.array(K),
|
|
300
300
|
rows: t.array(t.record(t.string(), t.unknown())),
|
|
301
301
|
rowKey: t.string().optional(),
|
|
302
302
|
emptyText: t.string().optional(),
|
|
@@ -307,7 +307,7 @@ const J = t.lazy(() => t.object({
|
|
|
307
307
|
},
|
|
308
308
|
ResourceList: {
|
|
309
309
|
props: t.object({
|
|
310
|
-
columns: t.array(
|
|
310
|
+
columns: t.array(K),
|
|
311
311
|
rows: t.array(t.record(t.string(), t.unknown())),
|
|
312
312
|
rowKey: t.string().optional(),
|
|
313
313
|
emptyText: t.string().optional(),
|
|
@@ -359,7 +359,7 @@ const J = t.lazy(() => t.object({
|
|
|
359
359
|
}, A = F(H, {
|
|
360
360
|
components: V,
|
|
361
361
|
actions: {}
|
|
362
|
-
}),
|
|
362
|
+
}), De = [
|
|
363
363
|
"Prefer AppRoot > AppShell > Page as the normal DSM application hierarchy.",
|
|
364
364
|
"Prefer SettingsSection and SettingsField for settings; prefer ResourceList/DataTable for ordinary scalar resource collections.",
|
|
365
365
|
"Keep state in the spec and use $bindState/$bindItem for editable controls; do not invent JavaScript in props.",
|
|
@@ -368,14 +368,14 @@ const J = t.lazy(() => t.object({
|
|
|
368
368
|
"AppShell adapts to its actual DSM window width: phone (<=600px), desktop window (601–1199px), and wide web/Portal (>=1200px). Never assume browser viewport width.",
|
|
369
369
|
"For a phone-unfriendly custom view, use ResponsiveView slots: mobile alternative and default full view. Keep essential actions accessible on mobile.",
|
|
370
370
|
"Use low-level Stack/Text only when a semantic component does not already express the layout."
|
|
371
|
-
],
|
|
371
|
+
], Ke = '## Self-check workflow\n\nInstall `@synopackageland/ui` first. Without a local install, use\n`npx -y -p @synopackageland/ui syno-pkg-land-ui <command>` (pin the package version for reproducibility).\n\n1. List components with `npx --no syno-pkg-land-ui catalog`; read props with `npx --no syno-pkg-land-ui describe <Component>`.\n2. Write the spec as JSON: {"root", "elements", "state"}. Seed every state path you bind or read.\n3. Run `npx --no syno-pkg-land-ui validate ui.json --json` (add --actions, --functions, --state, --messages for host-provided names).\n Fix every error at its JSON Pointer `path` using its `hint`, then validate again until it passes.\n4. Run `npx --no syno-pkg-land-ui render ui.json --out shots` to screenshot phone, DSM window and wide widths and to\n report layout overflow; fix reported elements and repeat.\n5. Hand over the spec only when validate and render both exit 0.';
|
|
372
372
|
function pt() {
|
|
373
|
-
return `${A.prompt({ customRules:
|
|
373
|
+
return `${A.prompt({ customRules: De })}
|
|
374
374
|
|
|
375
|
-
${
|
|
375
|
+
${Ke}
|
|
376
376
|
`;
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const Le = {
|
|
379
379
|
none: "0",
|
|
380
380
|
xs: "var(--ui-space-1)",
|
|
381
381
|
sm: "var(--ui-space-2)",
|
|
@@ -440,7 +440,7 @@ const Je = {
|
|
|
440
440
|
style: {
|
|
441
441
|
display: "flex",
|
|
442
442
|
flexDirection: e.direction ?? "column",
|
|
443
|
-
gap:
|
|
443
|
+
gap: Le[e.gap ?? "md"],
|
|
444
444
|
alignItems: Ue[e.align ?? "stretch"],
|
|
445
445
|
justifyContent: Ne[e.justify ?? "start"],
|
|
446
446
|
flexWrap: e.wrap ? "wrap" : "nowrap"
|
|
@@ -599,17 +599,17 @@ const Je = {
|
|
|
599
599
|
}
|
|
600
600
|
}, n);
|
|
601
601
|
},
|
|
602
|
-
DataTable: ({ props: e }) => d(
|
|
602
|
+
DataTable: ({ props: e }) => d(D, e),
|
|
603
603
|
ResourceList: ({ props: e, slots: o }) => d("section", { class: "min-w-0", "data-syno-pkg-land-ui": "", "data-ui-resource-list": "" }, [
|
|
604
604
|
o.toolbar ? d("div", { class: "mb-3 flex flex-wrap items-center gap-2" }, o.toolbar()) : null,
|
|
605
|
-
d(
|
|
605
|
+
d(D, e)
|
|
606
606
|
]),
|
|
607
607
|
CellText: ({ props: e, emit: o }) => d(ie, { ...e, onOpen: () => o("open") }),
|
|
608
608
|
CellStatus: ({ props: e }) => d(ne, e),
|
|
609
609
|
ListItem: ({ props: e, slots: o }) => d(oe, e, o),
|
|
610
610
|
InputGroup: ({ slots: e }) => d(te, null, e),
|
|
611
611
|
Loading: ({ props: e }) => d(ee, { text: e.text })
|
|
612
|
-
}, { registry:
|
|
612
|
+
}, { registry: L } = M(A, {
|
|
613
613
|
components: Je
|
|
614
614
|
}), ut = /* @__PURE__ */ G({
|
|
615
615
|
__name: "SynoJsonRenderer",
|
|
@@ -628,7 +628,7 @@ const Je = {
|
|
|
628
628
|
},
|
|
629
629
|
setup(e) {
|
|
630
630
|
return (o, n) => (X(), Y(j(W), {
|
|
631
|
-
registry: j(
|
|
631
|
+
registry: j(L),
|
|
632
632
|
store: e.store,
|
|
633
633
|
"initial-state": e.state ?? e.spec?.state ?? {},
|
|
634
634
|
handlers: e.handlers,
|
|
@@ -641,7 +641,7 @@ const Je = {
|
|
|
641
641
|
default: Q(() => [
|
|
642
642
|
Z(j(B), {
|
|
643
643
|
spec: e.spec,
|
|
644
|
-
registry: j(
|
|
644
|
+
registry: j(L),
|
|
645
645
|
loading: e.loading,
|
|
646
646
|
fallback: e.fallback
|
|
647
647
|
}, null, 8, ["spec", "registry", "loading", "fallback"])
|
|
@@ -1151,15 +1151,15 @@ export {
|
|
|
1151
1151
|
Nt as jsonRenderVueSchema,
|
|
1152
1152
|
ht as listSynoJsonComponents,
|
|
1153
1153
|
pt as synoJsonAiPrompt,
|
|
1154
|
-
|
|
1154
|
+
De as synoJsonAiRules,
|
|
1155
1155
|
A as synoJsonCatalog,
|
|
1156
1156
|
V as synoJsonComponentDefinitions,
|
|
1157
|
-
|
|
1157
|
+
L as synoJsonRegistry,
|
|
1158
1158
|
Je as synoJsonRenderers,
|
|
1159
1159
|
bt as synoJsonSchema,
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1160
|
+
Dt as useActions,
|
|
1161
|
+
Kt as useBoundProp,
|
|
1162
|
+
Lt as useStateStore,
|
|
1163
1163
|
mt as validateSynoJsonSpec,
|
|
1164
1164
|
vt as z
|
|
1165
1165
|
};
|
package/dist/reka-runtime.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"version": "2.10.5",
|
|
4
4
|
"delivery": "bundled-patched-esm",
|
|
5
5
|
"patchManifestSha256": "14f10159b60d48ac7a0686f58faf7a30e99898dc267b3c032cf2bdd6052dc52b",
|
|
6
|
-
"bundleSha256": "
|
|
6
|
+
"bundleSha256": "31923fb1aa37038cbb1c76cc2609d1d3c95dd1e7481e99f5f13b67aff922a680",
|
|
7
7
|
"sourceHashes": {
|
|
8
8
|
"shared/useBodyScrollLock.js": "657592f283cb6fd25454abd284a0024af21936cb56e05b762ff0d22b6a979d32",
|
|
9
9
|
"DismissableLayer/DismissableLayer.js": "da05ca544d9822a8e2b71057e78c0e1ef59423aa3893534338fb58e1ecbd1a8d",
|