@softize/opus 15.2.1 → 16.0.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 +59 -16
- package/bin/lib/check.mjs +98 -15
- package/bin/lib/copy.mjs +811 -314
- package/bin/lib/gen-manifest.mjs +24 -23
- package/bin/lib/gen-runner.mjs +198 -149
- package/docs/adr/0010-page-header-owns-page-chrome.md +3 -4
- package/docs/adr/0011-page-shell-coordinates-persistent-page-chrome.md +5 -3
- package/docs/adr/0012-data-products-are-first-class-declarations.md +4 -2
- package/docs/adr/0012-modal-header-only-names-the-surface.md +45 -0
- package/docs/adr/0013-presentation-is-a-portable-action-oriented-artifact.md +92 -0
- package/docs/code-style.md +24 -19
- package/docs/data-products.md +7 -1
- package/package.json +18 -15
- package/registry/skills/build-opus-ui/references/ui-patterns.md +43 -26
- package/registry/skills/maintain-opus-docs/scripts/audit-docs.mjs +0 -0
- package/src/core/data-product.ts +51 -7
- package/src/core/index.ts +3 -0
- package/src/core/presentation.ts +512 -0
- package/src/presentation/index.ts +1 -0
- package/src/ui/components/patterns/action-list-dialog.tsx +26 -9
- package/src/ui/components/patterns/confirm.tsx +34 -29
- package/src/ui/components/patterns/form-dialog.tsx +20 -8
- package/src/ui/components/patterns/list.tsx +26 -9
- package/src/ui/components/patterns/page.tsx +99 -139
- package/src/ui/components/patterns/presentation.tsx +316 -0
- package/src/ui/components/patterns/sidebar.tsx +3 -3
- package/src/ui/components/patterns/trigger.tsx +38 -17
- package/src/ui/components/primitives/button-group.tsx +53 -43
- package/src/ui/components/primitives/command.tsx +30 -72
- package/src/ui/components/primitives/dialog.tsx +23 -89
- package/src/ui/components/primitives/drawer.tsx +8 -34
- package/src/ui/docs/content/action-form-dialog.md +12 -10
- package/src/ui/docs/content/action-list-dialog.md +22 -17
- package/src/ui/docs/content/button.md +52 -35
- package/src/ui/docs/content/communication.md +26 -26
- package/src/ui/docs/content/dialog.md +173 -154
- package/src/ui/docs/content/drawer.md +12 -11
- package/src/ui/docs/content/page.md +72 -91
- package/src/ui/docs/content/presentation.md +158 -0
- package/src/ui/docs/registry.tsx +6 -0
- package/src/ui/meta.ts +8 -2
- package/src/ui/react.tsx +10 -3
package/bin/lib/gen-manifest.mjs
CHANGED
|
@@ -12,11 +12,12 @@
|
|
|
12
12
|
// histórico do git é o "quando". `opusVersion` fica (muda só com upgrade da base).
|
|
13
13
|
export function buildManifest(payload) {
|
|
14
14
|
return {
|
|
15
|
-
version:
|
|
15
|
+
version: "1",
|
|
16
16
|
opusVersion: payload.opusVersion,
|
|
17
17
|
seeds: payload.seeds ?? [],
|
|
18
|
+
presentations: payload.presentations ?? [],
|
|
18
19
|
domains: payload.domains.map(shapeDomain),
|
|
19
|
-
}
|
|
20
|
+
};
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
function shapeDomain(d) {
|
|
@@ -32,7 +33,7 @@ function shapeDomain(d) {
|
|
|
32
33
|
reactions: d.reactions,
|
|
33
34
|
schedules: d.schedules,
|
|
34
35
|
subdomains: d.subdomains.map(shapeDomain),
|
|
35
|
-
}
|
|
36
|
+
};
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
function shapeAction(a) {
|
|
@@ -61,24 +62,24 @@ function shapeAction(a) {
|
|
|
61
62
|
messages: a.messages,
|
|
62
63
|
examples: a.examples,
|
|
63
64
|
errors: a.errors,
|
|
65
|
+
};
|
|
66
|
+
if (a.kind === "simple" || a.kind === "form") {
|
|
67
|
+
out.emits = a.emits ?? [];
|
|
68
|
+
out.background = a.background === true;
|
|
64
69
|
}
|
|
65
|
-
if (a.kind ===
|
|
66
|
-
|
|
67
|
-
out.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
out.
|
|
72
|
-
out.sort = a.sort
|
|
73
|
-
out.paginate = a.paginate
|
|
74
|
-
out.text = a.text
|
|
75
|
-
out.periods = a.periods
|
|
70
|
+
if (a.kind === "form") out.fields = a.fields ?? {};
|
|
71
|
+
if (a.kind === "list") {
|
|
72
|
+
out.filters = a.filters ?? {};
|
|
73
|
+
out.sort = a.sort;
|
|
74
|
+
out.paginate = a.paginate;
|
|
75
|
+
out.text = a.text;
|
|
76
|
+
out.periods = a.periods;
|
|
76
77
|
}
|
|
77
|
-
if (a.kind ===
|
|
78
|
-
out.projection = a.projection ?? []
|
|
79
|
-
out.expand = a.expand
|
|
78
|
+
if (a.kind === "view") {
|
|
79
|
+
out.projection = a.projection ?? [];
|
|
80
|
+
out.expand = a.expand;
|
|
80
81
|
}
|
|
81
|
-
return out
|
|
82
|
+
return out;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
/**
|
|
@@ -86,16 +87,16 @@ function shapeAction(a) {
|
|
|
86
87
|
* cada). Usado pra gerar OpenAPI a partir do manifest.
|
|
87
88
|
*/
|
|
88
89
|
export function flattenManifestActions(manifest) {
|
|
89
|
-
const out = []
|
|
90
|
-
for (const domain of manifest.domains) walk(domain, out)
|
|
91
|
-
return out
|
|
90
|
+
const out = [];
|
|
91
|
+
for (const domain of manifest.domains) walk(domain, out);
|
|
92
|
+
return out;
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
function walk(domain, out) {
|
|
95
96
|
for (const action of domain.actions) {
|
|
96
|
-
out.push({ ...action, domainName: domain.name })
|
|
97
|
+
out.push({ ...action, domainName: domain.name });
|
|
97
98
|
}
|
|
98
99
|
if (Array.isArray(domain.subdomains)) {
|
|
99
|
-
for (const sub of domain.subdomains) walk(sub, out)
|
|
100
|
+
for (const sub of domain.subdomains) walk(sub, out);
|
|
100
101
|
}
|
|
101
102
|
}
|