yugoo-design 0.2.3 → 0.2.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.
Files changed (34) hide show
  1. package/README.md +4 -4
  2. package/package.json +1 -1
  3. package/payload/desktop-preparation/materials.json +8 -8
  4. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/material.json +1 -1
  5. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
  6. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
  7. package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/panel-uiux-standard.md +3 -0
  8. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/material.json +1 -1
  9. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
  10. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
  11. package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/panel-uiux-standard.md +3 -0
  12. package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
  13. package/payload/overlays/claude-code/authoring/studio-creators/material.json +1 -1
  14. package/payload/overlays/claude-code/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
  15. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
  16. package/payload/overlays/claude-code/authoring/studio-creators/source/docs/panel-uiux-standard.md +3 -0
  17. package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
  18. package/payload/overlays/codex/authoring/studio-creators/material.json +1 -1
  19. package/payload/overlays/codex/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
  20. package/payload/overlays/codex/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
  21. package/payload/overlays/codex/authoring/studio-creators/source/docs/panel-uiux-standard.md +3 -0
  22. package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
  23. package/payload/overlays/qoder/authoring/studio-creators/material.json +1 -1
  24. package/payload/overlays/qoder/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
  25. package/payload/overlays/qoder/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
  26. package/payload/overlays/qoder/authoring/studio-creators/source/docs/panel-uiux-standard.md +3 -0
  27. package/payload/shared/authoring/panel-components.json +157 -120
  28. package/payload/shared/authoring/studio-creators/material.json +1 -1
  29. package/payload/shared/authoring/studio-creators/source/.agents/skills/design-bundle-creator/scripts/inspect-panel-component.mjs +10 -4
  30. package/payload/shared/authoring/studio-creators/source/docs/dsl-spec.md +28 -0
  31. package/payload/shared/authoring/studio-creators/source/docs/panel-uiux-standard.md +3 -0
  32. package/payload/shared/web/client.js +202 -34
  33. package/release-hosts.json +1 -1
  34. package/release-manifest.json +35 -35
@@ -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
- const declarations = new Map(source.statements
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(source)}`)
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, source, declarations } = context
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: contractPath,
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
@@ -18,6 +18,7 @@
18
18
  `packages/panel/src/visual-components.css` 这一基础样式维护入口,不各自复制
19
19
  样式、追加覆盖文件或重新拼装常见操作。交互行为由组件实现,不能只靠 CSS 或
20
20
  文档约定保证一致。主题资源、宿主壳和专业图形资源不构成另一套 Kit 基础样式。
21
+ 独立预览入口须带齐组件所需的基础与画布样式,不能依赖宿主先加载;实际检查画布定位和控件图标,不能只核对节点存在。
21
22
 
22
23
  Bundle 作者决定业务信息的归属、关系、次序和合适的已支持形态,组件自动承担
23
24
  共同的视觉与交互默认值。信息组织是否帮助人理解和改写仍须审视,但作者无需
@@ -516,6 +517,8 @@ Studio 统一按用户需要采取的动作选择反馈形态,复用 `packages
516
517
 
517
518
  通知不遮挡输入框、保存/取消操作或键盘焦点,遵循 Studio 的边界和语义层级。普通状态更新使用非打断的可访问通告,重要失败按需告警;不得让逐条校验输出反复抢读。明暗主题、长错误、窄内容区和展开详情均须实际检查。`role="alert"` 只提供语义,不提供样式或正确的布局;仅添加类名或统一红色不能证明符合本规范。
518
519
 
520
+ 读取待保存修改失败时,现有保存错误对话框提供“重试读取”,重新准备原样草稿;恢复后仍由用户明确保存。不能要求用户改一个字、丢弃草稿或重开页面才能解除旧网络错误,也不能借重试自动重发写入或对话。已提交但结果未确认的保存仍沿用原有核对流程。
521
+
519
522
  Studio 与 Companion 的宿主会话复用同一消息和工作记录组件。展示实际公开回复、
520
523
  工具动作及其结果;工作记录可折叠,用户主动收起后轮询不重新展开。工作中使用
521
524
  同一圆形等待指示,停止操作放在输入框的发送按钮位置,不增加估算进度条。