yugoo-design 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +1 -1
- package/payload/desktop-preparation/materials.json +6 -6
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/material.json +1 -1
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/material.json +1 -1
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
- package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
- package/payload/overlays/claude-code/authoring/studio-creators/material.json +1 -1
- package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
- package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
- package/payload/overlays/codex/authoring/studio-creators/material.json +1 -1
- package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
- package/payload/overlays/codex/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
- package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
- package/payload/overlays/qoder/authoring/studio-creators/material.json +1 -1
- package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
- package/payload/shared/authoring/panel-components.json +118 -81
- package/payload/shared/authoring/studio-creators/material.json +1 -1
- package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
- package/payload/shared/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
- package/payload/shared/web/client.js +188 -29
- package/release-hosts.json +1 -1
- package/release-manifest.json +29 -29
|
@@ -19,7 +19,12 @@ async function inspectionContext(repo) {
|
|
|
19
19
|
const contractPath = 'packages/core/src/panel-dsl.ts'
|
|
20
20
|
const source = ts.createSourceFile(contractPath,
|
|
21
21
|
await readFile(join(repo, contractPath), 'utf8'), ts.ScriptTarget.Latest, true, ts.ScriptKind.TS)
|
|
22
|
-
|
|
22
|
+
// These trusted local contract sources are parsed as data, never executed or
|
|
23
|
+
// resolved through arbitrary imports. PanelManifest imports its i18n shape.
|
|
24
|
+
const i18nPath = 'packages/core/src/panel-i18n.ts'
|
|
25
|
+
const i18nSource = ts.createSourceFile(i18nPath,
|
|
26
|
+
await readFile(join(repo, i18nPath), 'utf8'), ts.ScriptTarget.Latest, true, ts.ScriptKind.TS)
|
|
27
|
+
const declarations = new Map([...source.statements, ...i18nSource.statements]
|
|
23
28
|
.filter(node => ts.isInterfaceDeclaration(node) || ts.isTypeAliasDeclaration(node))
|
|
24
29
|
.map(node => [node.name.text, node]))
|
|
25
30
|
const constants = new Map(source.statements
|
|
@@ -35,7 +40,7 @@ async function inspectionContext(repo) {
|
|
|
35
40
|
function visit(node) {
|
|
36
41
|
if (ts.isTypeQueryNode(node)) {
|
|
37
42
|
if (!ts.isIdentifier(node.exprName)) {
|
|
38
|
-
throw new Error(`Unsupported local typeof contract reference: ${node.exprName.getText(
|
|
43
|
+
throw new Error(`Unsupported local typeof contract reference: ${node.exprName.getText(node.getSourceFile())}`)
|
|
39
44
|
}
|
|
40
45
|
const name = node.exprName.text
|
|
41
46
|
const constant = constants.get(name)
|
|
@@ -61,7 +66,7 @@ export async function inspectPanelComponent(repo, name, typeName, options = {})
|
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
async function inspectWithContext(context, name, typeName, options = {}) {
|
|
64
|
-
const { repo, ts, PANEL_COMPONENT_CATALOG, GENERATED_COMPONENT_KINDS, contractPath,
|
|
69
|
+
const { repo, ts, PANEL_COMPONENT_CATALOG, GENERATED_COMPONENT_KINDS, contractPath, declarations } = context
|
|
65
70
|
if (!Object.hasOwn(PANEL_COMPONENT_CATALOG, name)) throw new Error(`Unknown component: ${name}`)
|
|
66
71
|
function contract(name) {
|
|
67
72
|
const [root, ...properties] = name.split('.')
|
|
@@ -88,8 +93,9 @@ async function inspectWithContext(context, name, typeName, options = {}) {
|
|
|
88
93
|
ts.forEachChild(child, visit)
|
|
89
94
|
}
|
|
90
95
|
visit(node)
|
|
96
|
+
const source = node.getSourceFile()
|
|
91
97
|
return {
|
|
92
|
-
name, file:
|
|
98
|
+
name, file: source.fileName,
|
|
93
99
|
line: source.getLineAndCharacterOfPosition(node.getStart(source)).line + 1,
|
|
94
100
|
declaration: node.getText(source),
|
|
95
101
|
references: [...references].sort().map(name => ({ name, read: `--type ${name}` })),
|
|
@@ -35,6 +35,34 @@ ui: {…}
|
|
|
35
35
|
|
|
36
36
|
`evidence_workbook | capability_map | process | lifecycle | page_spec | document`
|
|
37
37
|
|
|
38
|
+
### UI text and locale resources
|
|
39
|
+
|
|
40
|
+
Declare the locale-to-file map at the manifest root, alongside `sections`,
|
|
41
|
+
`fields` and `ui`. Paths are relative to this Bundle:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
i18n:
|
|
45
|
+
default_locale: zh-CN
|
|
46
|
+
locales:
|
|
47
|
+
zh-CN: locales/zh-CN.json
|
|
48
|
+
en-US: locales/en-US.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For example, `ui.title: $t:workspaceTitle` reads `workspaceTitle` from these
|
|
52
|
+
JSON objects: `locales/zh-CN.json` contains
|
|
53
|
+
`{"workspaceTitle":"交付验收点"}`, and `locales/en-US.json` contains
|
|
54
|
+
`{"workspaceTitle":"Delivery acceptance points"}`. The Kit loader reads the
|
|
55
|
+
declared files and supplies the resolved `i18n.messages`; authors maintain the
|
|
56
|
+
locale files rather than duplicating their messages in `panel.yaml`.
|
|
57
|
+
|
|
58
|
+
Use whole `$t:key` tokens for display titles, labels, descriptions and other
|
|
59
|
+
supported text properties. The default locale must cover every referenced key;
|
|
60
|
+
missing keys in other locales fall back to it. Locale switching does not
|
|
61
|
+
translate saved user text, IDs, field keys, enum values or canonical defaults.
|
|
62
|
+
Shared component action copy stays in Panel's shared dictionaries. The owning
|
|
63
|
+
type is `PanelTranslations` in `packages/core/src/panel-i18n.ts`; installed
|
|
64
|
+
component contract reads expose it through `PanelManifest`'s returned reference.
|
|
65
|
+
|
|
38
66
|
## `sections`
|
|
39
67
|
|
|
40
68
|
```yaml
|