openyida 2026.8.4 → 2026.8.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.
Files changed (190) hide show
  1. package/README.md +10 -16
  2. package/bin/yida.js +6 -6
  3. package/docs/capabilities.md +2 -3
  4. package/lib/app/canvas-compile.js +237 -0
  5. package/lib/app/create-form.js +14 -228
  6. package/lib/app/form-detail-link-guard.js +200 -0
  7. package/lib/app/form-detail-style.js +476 -0
  8. package/lib/app/form-open-guard.js +222 -0
  9. package/lib/app/form-theme-action.js +439 -0
  10. package/lib/app/jsx-text-guard.js +69 -0
  11. package/lib/app/page-linter.js +69 -5
  12. package/lib/app/page-richness-guard.js +108 -0
  13. package/lib/app/services/canvas-page-schema-builder.js +82 -2
  14. package/lib/app/services/form-compiler.js +11 -0
  15. package/lib/core/agent-capabilities.js +35 -35
  16. package/lib/core/command-manifest.js +20 -14
  17. package/lib/core/locales/en.js +13 -6
  18. package/lib/core/locales/zh.js +14 -7
  19. package/lib/core/sample.js +3 -34
  20. package/lib/integration/integration-process-builder.js +1 -1
  21. package/lib/integration/integration-spec-builder.js +2 -2
  22. package/lib/integration/integration-view-builder.js +1 -1
  23. package/lib/samples/yida-create-app/ipd-app-template.js +1 -1
  24. package/package.json +1 -1
  25. package/scripts/build-skills-package.js +16 -34
  26. package/scripts/postinstall.js +13 -12
  27. package/yida-skills/SKILL.md +30 -28
  28. package/yida-skills/references/development-rules.md +5 -4
  29. package/yida-skills/references/field-and-url-reference.md +5 -3
  30. package/yida-skills/references/task-retrospective.md +28 -28
  31. package/yida-skills/skills/yida-app/SKILL.md +113 -108
  32. package/yida-skills/skills/yida-app/references/app-build-contract.md +61 -179
  33. package/yida-skills/skills/yida-canvas-custom-page/SKILL.md +40 -102
  34. package/yida-skills/skills/yida-canvas-custom-page/references/canvas-authoring-examples.md +4 -3
  35. package/yida-skills/skills/yida-canvas-custom-page/references/canvas-style-implementation-guide.md +421 -0
  36. package/yida-skills/skills/yida-canvas-custom-page/references/component-library-guide.md +37 -18
  37. package/yida-skills/skills/yida-canvas-custom-page/references/data-bridge-guide.md +29 -11
  38. package/yida-skills/skills/yida-canvas-custom-page/references/dependencies-and-cdn.md +1 -0
  39. package/yida-skills/skills/yida-canvas-custom-page/references/native-components-bridge.md +2 -11
  40. package/yida-skills/skills/yida-canvas-custom-page/references/navigation-and-entry-guide.md +166 -13
  41. package/yida-skills/skills/yida-canvas-custom-page/references/page-generation-guide.md +114 -43
  42. package/yida-skills/skills/yida-canvas-custom-page/references/theme-runtime-helpers.md +177 -0
  43. package/yida-skills/skills/yida-canvas-data-binding/SKILL.md +52 -46
  44. package/yida-skills/skills/yida-canvas-table-form/SKILL.md +5 -6
  45. package/yida-skills/skills/yida-canvas-upgrade/SKILL.md +1 -1
  46. package/yida-skills/skills/yida-chart/SKILL.md +2 -2
  47. package/yida-skills/skills/yida-chart/references/echarts-code-template.md +1 -1
  48. package/yida-skills/skills/yida-create-app/SKILL.md +13 -20
  49. package/yida-skills/skills/yida-create-form-page/SKILL.md +15 -7
  50. package/yida-skills/skills/yida-create-form-page/references/form-field-properties.md +3 -3
  51. package/yida-skills/skills/yida-create-page/SKILL.md +2 -2
  52. package/yida-skills/skills/yida-custom-page/SKILL.md +28 -35
  53. package/yida-skills/skills/yida-custom-page/references/assets-guide.md +6 -22
  54. package/yida-skills/skills/yida-custom-page/references/attachment-upload-guide.md +1 -1
  55. package/yida-skills/skills/yida-custom-page/references/coding-guide.md +55 -4
  56. package/yida-skills/skills/yida-custom-page/references/design-system.md +22 -38
  57. package/yida-skills/skills/yida-dashboard/SKILL.md +10 -13
  58. package/yida-skills/skills/yida-dashboard/references/structure-and-layout.md +2 -2
  59. package/yida-skills/skills/yida-dashboard/references/theme-presets.md +1 -1
  60. package/yida-skills/skills/yida-data-management/SKILL.md +16 -6
  61. package/yida-skills/skills/yida-density/SKILL.md +2 -2
  62. package/yida-skills/skills/yida-design/SKILL.md +98 -0
  63. package/yida-skills/skills/yida-design/references/app/blueprint.md +61 -0
  64. package/yida-skills/skills/{yida-page-uiux → yida-design}/references/asset-workflow.md +16 -16
  65. package/yida-skills/skills/yida-design/references/page-quality-gates.md +125 -0
  66. package/yida-skills/skills/yida-design/references/style-design-selection.md +118 -0
  67. package/yida-skills/skills/yida-design/references/style-designs/_design-md-template.md +185 -0
  68. package/yida-skills/skills/yida-design/references/style-designs/aqua-service-progress-dashboard.md +242 -0
  69. package/yida-skills/skills/yida-design/references/style-designs/blue-insight-operations-dashboard.md +243 -0
  70. package/yida-skills/skills/yida-design/references/style-designs/blue-productivity-insight-workbench.md +242 -0
  71. package/yida-skills/skills/yida-design/references/style-designs/command-filter-card-console.md +304 -0
  72. package/yida-skills/skills/yida-design/references/style-designs/contrast-command-analytics-workbench.md +261 -0
  73. package/yida-skills/skills/yida-design/references/style-designs/dark-stage-analytic-dashboard.md +369 -0
  74. package/yida-skills/skills/yida-design/references/style-designs/filterable-card-catalog.md +354 -0
  75. package/yida-skills/skills/yida-design/references/style-designs/green-timeline-progress-workbench.md +250 -0
  76. package/yida-skills/skills/yida-design/references/style-designs/registry.md +91 -0
  77. package/yida-skills/skills/yida-design/references/style-designs/soft-analytic-workbench.md +348 -0
  78. package/yida-skills/skills/yida-design/references/style-designs/soft-blue-grid-analytic-dashboard.md +658 -0
  79. package/yida-skills/skills/yida-design/references/style-designs/soft-bordered-analytic-workbench.md +385 -0
  80. package/yida-skills/skills/yida-design/references/style-designs/soft-curated-filter-gallery.md +300 -0
  81. package/yida-skills/skills/yida-design/references/style-designs/soft-modular-analytic-workbench.md +404 -0
  82. package/yida-skills/skills/yida-design/references/style-designs/soft-progress-analytics-workbench.md +382 -0
  83. package/yida-skills/skills/yida-design/references/style-designs/soft-timeline-analytics-workbench.md +367 -0
  84. package/yida-skills/skills/yida-design/references/style-designs/teal-rail-analytics-workbench.md +341 -0
  85. package/yida-skills/skills/yida-design/references/theme/theme-token-presets.md +394 -0
  86. package/yida-skills/skills/{yida-page-uiux → yida-design}/references/visual-decision-engine.md +7 -7
  87. package/yida-skills/skills/yida-design/references/visual-scaffold-recipes.md +191 -0
  88. package/yida-skills/skills/yida-design/sub_skill/page-design/SKILL.md +57 -0
  89. package/yida-skills/skills/yida-design/workflow/output-design.md +391 -0
  90. package/yida-skills/skills/yida-design/workflow/output-prd.md +178 -0
  91. package/yida-skills/skills/yida-design/workflow/step-1-positioning.md +58 -0
  92. package/yida-skills/skills/yida-design/workflow/step-2-theme-system.md +111 -0
  93. package/yida-skills/skills/yida-design/workflow/step-3-information-architecture.md +70 -0
  94. package/yida-skills/skills/yida-design/workflow/step-4-wireframe-interaction.md +52 -0
  95. package/yida-skills/skills/yida-design/workflow/step-5-visual-states.md +118 -0
  96. package/yida-skills/skills/yida-design/workflow/step-6-handoff.md +62 -0
  97. package/yida-skills/skills/yida-flash-note-to-prd/SKILL.md +8 -8
  98. package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prd-template.md +1 -1
  99. package/yida-skills/skills/yida-form-detail/SKILL.md +35 -36
  100. package/yida-skills/skills/yida-form-detail/references/injection-guide.md +43 -121
  101. package/yida-skills/skills/yida-get-schema/SKILL.md +1 -1
  102. package/yida-skills/skills/yida-integration/references/integration-node-schemas.md +1 -1
  103. package/yida-skills/skills/yida-nav-group/SKILL.md +5 -4
  104. package/yida-skills/skills/yida-nav-shell/SKILL.md +2 -2
  105. package/yida-skills/skills/yida-nav-shell/references/nav-shell-patterns.md +3 -3
  106. package/yida-skills/skills/yida-ppt-slider/references/dark-tech-theme.md +1 -1
  107. package/yida-skills/skills/yida-process-rule/references/examples.md +6 -6
  108. package/yida-skills/skills/yida-process-rule/references/process-ai-rules.md +3 -3
  109. package/yida-skills/skills/yida-publish-page/SKILL.md +2 -2
  110. package/yida-skills/skills/yida-rechart/SKILL.md +5 -8
  111. package/yida-skills/skills/yida-report/SKILL.md +6 -6
  112. package/yida-skills/skills/yida-table-form/SKILL.md +2 -15
  113. package/yida-skills/skills-index.json +106 -97
  114. package/lib/app/generate-page.js +0 -819
  115. package/lib/app/page-ir.js +0 -1680
  116. package/lib/samples/yida-canvas-custom-page/business-list.canvas.jsx +0 -741
  117. package/lib/samples/yida-canvas-custom-page/dashboard-overview.canvas.jsx +0 -782
  118. package/lib/samples/yida-canvas-custom-page/dashboard-starter.canvas.jsx +0 -389
  119. package/lib/samples/yida-canvas-custom-page/data-management.canvas.jsx +0 -1397
  120. package/lib/samples/yida-canvas-custom-page/data-screen.canvas.jsx +0 -1117
  121. package/lib/samples/yida-canvas-custom-page/detail-profile.canvas.jsx +0 -421
  122. package/lib/samples/yida-canvas-custom-page/native-components-smoke.canvas.jsx +0 -786
  123. package/lib/samples/yida-canvas-custom-page/official-homepage.canvas.jsx +0 -936
  124. package/lib/samples/yida-canvas-custom-page/portal-native-components.canvas.jsx +0 -1273
  125. package/lib/samples/yida-canvas-custom-page/portal-shell-home.canvas.jsx +0 -489
  126. package/lib/samples/yida-canvas-custom-page/product-homepage.canvas.jsx +0 -777
  127. package/lib/samples/yida-canvas-custom-page/split-pane-detail.canvas.jsx +0 -616
  128. package/lib/samples/yida-canvas-custom-page/todo-mvc.canvas.jsx +0 -614
  129. package/lib/samples/yida-canvas-custom-page/workbench-home.canvas.jsx +0 -692
  130. package/lib/samples/yida-custom-page/business-list.oyd.jsx +0 -443
  131. package/lib/samples/yida-custom-page/custom-page-template.js +0 -842
  132. package/lib/samples/yida-custom-page/dashboard-overview.oyd.jsx +0 -327
  133. package/lib/samples/yida-custom-page/data-management.oyd.jsx +0 -274
  134. package/lib/samples/yida-custom-page/data-screen.oyd.jsx +0 -348
  135. package/lib/samples/yida-custom-page/design-tokens.js +0 -262
  136. package/lib/samples/yida-custom-page/detail-profile.oyd.jsx +0 -241
  137. package/lib/samples/yida-custom-page/official-homepage.oyd.jsx +0 -218
  138. package/lib/samples/yida-custom-page/portal-shell-home.oyd.jsx +0 -268
  139. package/lib/samples/yida-custom-page/product-homepage.jsx +0 -752
  140. package/lib/samples/yida-custom-page/split-pane-detail.oyd.jsx +0 -245
  141. package/lib/samples/yida-custom-page/todo-mvc.oyd.jsx +0 -901
  142. package/lib/samples/yida-custom-page/workbench-home.oyd.jsx +0 -707
  143. package/project/prd/demo-birthday-game.md +0 -48
  144. package/project/prd/demo-crm.md +0 -463
  145. package/project/prd/demo-dingtalk-ai-solution-center.md +0 -425
  146. package/project/prd/demo-future-vision-2026.md +0 -78
  147. package/project/prd/demo-salary-calculator.md +0 -101
  148. package/yida-skills/skills/yida-app/references/ui-guidance-by-mode.md +0 -77
  149. package/yida-skills/skills/yida-app-uiux/SKILL.md +0 -97
  150. package/yida-skills/skills/yida-canvas-custom-page/references/canvas-design-system.md +0 -276
  151. package/yida-skills/skills/yida-page-uiux/SKILL.md +0 -154
  152. package/yida-skills/skills/yida-page-uiux/references/app/blueprint.md +0 -20
  153. package/yida-skills/skills/yida-page-uiux/references/dashboard/app-blueprint.md +0 -18
  154. package/yida-skills/skills/yida-page-uiux/references/dashboard/chart-contracts.md +0 -17
  155. package/yida-skills/skills/yida-page-uiux/references/dashboard/component-contracts.md +0 -18
  156. package/yida-skills/skills/yida-page-uiux/references/dashboard/layout-patterns.md +0 -31
  157. package/yida-skills/skills/yida-page-uiux/references/dashboard/theme-recipes.md +0 -23
  158. package/yida-skills/skills/yida-page-uiux/references/detail/object-narrative.md +0 -18
  159. package/yida-skills/skills/yida-page-uiux/references/detail/section-patterns.md +0 -15
  160. package/yida-skills/skills/yida-page-uiux/references/detail/timeline-and-related.md +0 -17
  161. package/yida-skills/skills/yida-page-uiux/references/landing/assets-workflow.md +0 -25
  162. package/yida-skills/skills/yida-page-uiux/references/landing/industry-playbooks.md +0 -25
  163. package/yida-skills/skills/yida-page-uiux/references/landing/realistic-brand-homepage.md +0 -82
  164. package/yida-skills/skills/yida-page-uiux/references/landing/research-levels.md +0 -10
  165. package/yida-skills/skills/yida-page-uiux/references/landing/section-patterns.md +0 -16
  166. package/yida-skills/skills/yida-page-uiux/references/list/drawer-detail.md +0 -18
  167. package/yida-skills/skills/yida-page-uiux/references/list/empty-loading-error.md +0 -17
  168. package/yida-skills/skills/yida-page-uiux/references/list/filter-patterns.md +0 -15
  169. package/yida-skills/skills/yida-page-uiux/references/list/table-patterns.md +0 -13
  170. package/yida-skills/skills/yida-page-uiux/references/scenes/dashboard.md +0 -128
  171. package/yida-skills/skills/yida-page-uiux/references/scenes/detail.md +0 -79
  172. package/yida-skills/skills/yida-page-uiux/references/scenes/landing.md +0 -112
  173. package/yida-skills/skills/yida-page-uiux/references/scenes/list.md +0 -78
  174. package/yida-skills/skills/yida-page-uiux/references/scenes/screen.md +0 -36
  175. package/yida-skills/skills/yida-page-uiux/references/scenes/workbench.md +0 -77
  176. package/yida-skills/skills/yida-page-uiux/references/workbench/entry-patterns.md +0 -20
  177. package/yida-skills/skills/yida-page-uiux/references/workbench/portal-layouts.md +0 -19
  178. package/yida-skills/skills/yida-page-uiux/references/workbench/task-feed.md +0 -20
  179. package/yida-skills/skills/yida-page-uiux/workflow/output-decision-block.md +0 -111
  180. package/yida-skills/skills/yida-page-uiux/workflow/step-0-nav-shape.md +0 -43
  181. package/yida-skills/skills/yida-page-uiux/workflow/step-1-page-type.md +0 -42
  182. package/yida-skills/skills/yida-page-uiux/workflow/step-2-intent-decode.md +0 -25
  183. package/yida-skills/skills/yida-page-uiux/workflow/step-3-scene-routing.md +0 -49
  184. package/yida-skills/skills/yida-page-uiux/workflow/step-4-visual-decision.md +0 -56
  185. package/yida-skills/skills/yida-page-uiux/workflow/step-5-icon-and-assets.md +0 -36
  186. package/yida-skills/skills/yida-page-uiux/workflow/step-6-deai-selfcheck.md +0 -40
  187. package/yida-skills/skills/yida-theme/SKILL.md +0 -232
  188. package/yida-skills/skills/yida-theme/references/theme-token-presets.md +0 -135
  189. /package/yida-skills/skills/{yida-page-uiux → yida-design}/references/app/navigation-patterns.md +0 -0
  190. /package/yida-skills/skills/{yida-page-uiux → yida-design}/references/app/role-journey.md +0 -0
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  OpenYida connects AI coding agents with Yida's low-code platform, so developers can create apps, forms, workflows, custom pages, reports, integrations, and deployment configuration from a normal chat-driven development workflow.
10
10
 
11
- [Quick Start](#quick-start) · [Help Center](https://xmtrf1.aliwork.com/o/openyida/help) · [Capabilities](#capabilities) · [Full Capability List](./docs/capabilities.md) · [CLI Reference](#cli-reference) · [Examples](#examples) · [Contributing](./CONTRIBUTING.md) · [Changelog](./CHANGELOG.md)
11
+ [Quick Start](#quick-start) · [Help Center](https://xmtrf1.aliwork.com/o/openyida/help?lang=en) · [Capabilities](#capabilities) · [Full Capability List](./docs/capabilities.md) · [CLI Reference](#cli-reference) · [Examples](#examples) · [Contributing](./CONTRIBUTING.md) · [Changelog](./CHANGELOG.md)
12
12
 
13
13
  [![npm version](https://img.shields.io/npm/v/openyida?color=brightgreen&label=npm)](https://www.npmjs.com/package/openyida)
14
14
  [![npm downloads](https://img.shields.io/npm/dm/openyida?color=blue)](https://www.npmjs.com/package/openyida)
@@ -16,7 +16,7 @@ OpenYida connects AI coding agents with Yida's low-code platform, so developers
16
16
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
17
17
  [![Node.js >=18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
18
18
 
19
- **Help Center:** [English](https://xmtrf1.aliwork.com/o/openyida/help) · [简体中文](https://xmtrf1.aliwork.com/o/openyida/help) · [繁體中文](https://xmtrf1.aliwork.com/o/openyida/help) · [日本語](https://xmtrf1.aliwork.com/o/openyida/help) · [한국어](https://xmtrf1.aliwork.com/o/openyida/help) · [Français](https://xmtrf1.aliwork.com/o/openyida/help) · [Deutsch](https://xmtrf1.aliwork.com/o/openyida/help) · [Español](https://xmtrf1.aliwork.com/o/openyida/help) · [Português](https://xmtrf1.aliwork.com/o/openyida/help) · [Tiếng Việt](https://xmtrf1.aliwork.com/o/openyida/help) · [हिन्दी](https://xmtrf1.aliwork.com/o/openyida/help) · [العربية](https://xmtrf1.aliwork.com/o/openyida/help)
19
+ **Help Center:** [简体中文](https://xmtrf1.aliwork.com/o/openyida/help?lang=zh) · [繁體中文(中國台灣)](https://xmtrf1.aliwork.com/o/openyida/help?lang=zh-Hant) · [繁體中文(中國香港)](https://xmtrf1.aliwork.com/o/openyida/help?lang=zh-HK) · [English](https://xmtrf1.aliwork.com/o/openyida/help?lang=en) · [日本語](https://xmtrf1.aliwork.com/o/openyida/help?lang=ja) · [한국어](https://xmtrf1.aliwork.com/o/openyida/help?lang=ko) · [Tiếng Việt](https://xmtrf1.aliwork.com/o/openyida/help?lang=vi) · [ไทย](https://xmtrf1.aliwork.com/o/openyida/help?lang=th) · [Bahasa Indonesia](https://xmtrf1.aliwork.com/o/openyida/help?lang=id) · [Bahasa Melayu](https://xmtrf1.aliwork.com/o/openyida/help?lang=ms) · [Français](https://xmtrf1.aliwork.com/o/openyida/help?lang=fr) · [Português](https://xmtrf1.aliwork.com/o/openyida/help?lang=pt) · [Türkçe](https://xmtrf1.aliwork.com/o/openyida/help?lang=tr) · [Español](https://xmtrf1.aliwork.com/o/openyida/help?lang=es) · [Русский](https://xmtrf1.aliwork.com/o/openyida/help?lang=ru)
20
20
 
21
21
  [English README](./README.md) · [简体中文 README](./README_zhCN.md)
22
22
 
@@ -155,7 +155,7 @@ openyida/
155
155
  │ ├── core/ # Environment detection, i18n, diagnostics, data commands
156
156
  │ ├── process/ # Process form creation, configuration, preview
157
157
  │ ├── report/ # Yida report and chart generation
158
- │ └── samples/ # Templates emitted by openyida sample
158
+ │ └── samples/ # Sample skeletons emitted by openyida sample
159
159
  ├── project/ # Default workspace template for generated Yida projects
160
160
  ├── yida-skills/ # Source skill docs and Yida API references
161
161
  └── scripts/ # CI, packaging, and installation helpers
@@ -185,22 +185,14 @@ Form definitions support 19 business field types plus verified presentation/layo
185
185
 
186
186
  ```bash
187
187
  openyida create-page APP_XXX "Dashboard" --mode dashboard
188
- openyida generate-page product-homepage --scene workbench --theme-profile yida-app-theme --theme-scope page --spec .cache/openyida/page-specs/home.json --output pages/src/home.canvas.jsx --compile
189
- openyida generate-page official-homepage --theme-profile yida-app-theme --spec .cache/openyida/page-specs/official-home.json --resolve-assets --upload-assets --output pages/src/official-home.canvas.jsx --compile
190
- openyida generate-page data-screen --theme-profile yida-app-theme --output pages/src/data-screen.canvas.jsx --compile
191
- openyida generate-page split-pane-detail --theme-profile yida-app-theme --output pages/src/split-pane-detail.canvas.jsx --compile
192
- openyida generate-page portal-shell-home --theme-profile yida-app-theme --output pages/src/portal-shell-home.canvas.jsx --compile
193
- openyida sample yida-canvas-custom-page dashboard-starter --output pages/src/dashboard-starter.canvas.jsx
194
- openyida sample yida-canvas-custom-page native-components-smoke --output pages/src/native-components-smoke.canvas.jsx
195
- openyida sample yida-canvas-custom-page portal-native-components --output pages/src/portal-native-components.canvas.jsx
196
- openyida generate-page todo-mvc --output pages/src/todo-mvc.canvas.jsx --compile
188
+ openyida check-page pages/src/home.canvas.jsx --json
189
+ openyida compile pages/src/home.canvas.jsx
197
190
  openyida publish pages/src/home.canvas.jsx APP_XXX FORM_XXX
198
191
  ```
199
192
 
200
- `generate-page` turns a structured spec into a Page IR, renders a curated template, writes a `.openyida-page.json` manifest, and optionally compiles the result. Code Canvas is the default output (`.canvas.jsx`); pass `--native` or output `.oyd.jsx` only when the page must use the 普通自定义页面 JSX/Jsx 组件链路. Pass `--scene workbench|dashboard|list|detail|landing|screen` and `--theme-profile <name-or-json>` / `--visual-profile <name-or-json>` to preserve the visual direction decision in both source comments and the manifest. The user-facing default theme profile is `yida-app-theme`, which follows Yida application theme styling, compact business density, and layered 12/8/6/4 radii. `--theme-scope page` only injects theme variables into the generated page root; `--theme-scope app` additionally calls `window.__YIDA__.updateShellConfig({ themeConfig })` so the application shell can adopt the same theme. Landing pages should declare `spec.assets.heroImage` / `productImages`; use `--resolve-assets` to verify public image URLs and `--upload-assets` to mirror local or verified external images to CDN when CDN is configured. Use `--offline-assets` only for draft/offline gating. The manifest makes follow-up AI edits safer because agents can update known blocks and visual constraints instead of rewriting a large JSX file by hand.
201
- Built-in templates currently include `official-homepage` for brand/law-firm/product official sites, `data-screen` for immersive monitoring screens, `dashboard-overview` for business dashboards, `workbench-home` for task/entry workbenches, `business-list` for list management pages, `detail-profile` for single-object detail pages, `split-pane-detail` for left-list/right-detail processing consoles, `portal-shell-home` for in-page portal shells, `native-components-smoke` for runtime probing existing Yida host components through `window.Deep` / `window.DeepYida`, `portal-native-components` for runtime-bridged portal, member, department, and upload components, `product-homepage` for legacy workbench-style pages, and `todo-mvc` for a full interaction smoke page covering events, custom state, list rendering, editing, filtering, and localStorage persistence.
193
+ Custom page source is authored directly from PRD and design guidance. Code Canvas is the default output (`.canvas.jsx`); use `.oyd.jsx` only when the page must use the 普通自定义页面 JSX/Jsx 组件链路.
202
194
 
203
- For member, department, attachment, and image upload components, choose the page chain first. Code Canvas pages should start with `native-components-smoke` or `portal-native-components` and follow `yida-canvas-custom-page/references/native-components-bridge.md` for feature detection, fallback, and value normalization. 普通自定义页面 JSX/Jsx pages should use `.oyd.jsx`, read `yida-custom-page/references/component-jsx-guide.md`, and read `attachment-upload-guide.md` when upload fields are involved.
195
+ For member, department, attachment, and image upload components, choose the page chain first. Code Canvas pages should follow `yida-canvas-custom-page/references/native-components-bridge.md` for feature detection, fallback, and value normalization. 普通自定义页面 JSX/Jsx pages should use `.oyd.jsx`, read `yida-custom-page/references/component-jsx-guide.md`, and read `attachment-upload-guide.md` when upload fields are involved.
204
196
 
205
197
  ### Workflow, Data, and Permissions
206
198
 
@@ -401,13 +393,15 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
401
393
  | `openyida get-schema <appType> <formUuid\|--all> [--summary-json\|--field-map-json]` | Get one form Schema or all form Schemas |
402
394
  | `openyida er <appType> [--format mermaid\|json] [--output file] [--include-system] [--include-pages]` | Export app entity relationship diagram |
403
395
  | `openyida create-page <appType> "<name>" [--mode dashboard] [--hide-nav] [--locale zh_CN\|en_US\|ja_JP] [--open\|--no-open]` | Create a custom display page |
404
- | `openyida generate-page <template>` | Generate page from curated template |
405
396
  | `openyida build-page <sourceFile> [--output file\|--write]` | Build Yida-compatible page source |
406
397
  | `openyida check-page <src> [--compat]` | Check custom page standards |
407
398
  | `openyida compile <src>` | Compile custom page locally |
408
399
  | `openyida publish <src> <appType> <formUuid> [--health-check] [--force] [--canvas] [--auto-nav-order] [--open\|--no-open]` | Compile and publish custom page |
409
400
  | `openyida update-form-config <appType> ...` | Update form configuration |
410
401
  | `openyida get-form-config <appType> <formUuid> [--json]` | Query form configuration |
402
+ | `openyida form-detail-style apply <appType> <formUuid> [--css file\|--preset clean-card] [--json]` | Manage form detail page style |
403
+ | `openyida form-detail-style remove <appType> <formUuid> [--json]` | Manage form detail page style |
404
+ | `openyida form-detail-style check <appType> <formUuid> [--json]` | Manage form detail page style |
411
405
 
412
406
  ### Data & Permissions
413
407
 
package/bin/yida.js CHANGED
@@ -750,12 +750,6 @@ async function main() {
750
750
  break;
751
751
  }
752
752
 
753
- case 'generate-page': {
754
- const { run } = require('../lib/app/generate-page');
755
- await run(args);
756
- break;
757
- }
758
-
759
753
  case 'build-page': {
760
754
  const { run } = require('../lib/app/build-page');
761
755
  await run(args);
@@ -832,6 +826,12 @@ async function main() {
832
826
  break;
833
827
  }
834
828
 
829
+ case 'form-detail-style': {
830
+ const { run: runFormDetailStyle } = require('../lib/app/form-detail-style');
831
+ await runFormDetailStyle(args);
832
+ break;
833
+ }
834
+
835
835
  case 'update-app': {
836
836
  if (args.length < 2) {
837
837
  throwCliUsage(t('cli.update_app_usage'), t('cli.update_app_example'));
@@ -62,7 +62,6 @@
62
62
  |---|---|
63
63
  | 创建自定义页面 | `openyida create-page <appType> "<页面名称>"` |
64
64
  | 创建看板页 | `openyida create-page <appType> "<页面名称>" --mode dashboard` |
65
- | 从模板生成页面源码 | `openyida generate-page <template>` |
66
65
  | 构建宜搭兼容页面源码 | `openyida build-page <sourceFile> [--output file\|--write]` |
67
66
  | 检查普通自定义页面 JSX 规范 | `openyida check-page <src> [--compat]` |
68
67
  | 本地编译普通自定义页面 JSX | `openyida compile <src>` |
@@ -73,8 +72,8 @@
73
72
  | 更新页面/表单配置 | `openyida update-form-config <appType> ...` |
74
73
  | 查询页面/表单配置 | `openyida get-form-config <appType> <formUuid> [--json]` |
75
74
  | 开发高级自定义页面、看板、图表或幻灯片 | 默认优先使用 Code Canvas 链路;明确要求普通自定义页面 JSX/Jsx,或强依赖普通自定义页实例桥时使用 `.oyd.jsx` + `check-page` / `compile` / `publish` |
76
- | Code Canvas 页面使用成员/部门/上传等宜搭运行态组件 | `openyida sample yida-canvas-custom-page native-components-smoke --output pages/src/native-components-smoke.canvas.jsx`;再参考 `yida-canvas-custom-page/references/native-components-bridge.md` |
77
- | Code Canvas 门户 + 成员/部门/上传组件示例 | `openyida sample yida-canvas-custom-page portal-native-components --output pages/src/portal-native-components.canvas.jsx` |
75
+ | Code Canvas 页面使用成员/部门/上传等宜搭运行态组件 | 使用 `yida-canvas-custom-page`,参考 `yida-canvas-custom-page/references/native-components-bridge.md` 做运行态组件探测、fallback 和值归一化 |
76
+ | Code Canvas 门户 + 成员/部门/上传组件 | 使用 `yida-canvas-custom-page`,按业务页面结构接入运行态组件桥 |
78
77
  | 普通自定义页面 JSX/Jsx 使用成员/部门组件 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/component-jsx-guide.md` |
79
78
  | 普通自定义页面 JSX/Jsx 使用附件/图片上传 | 使用 `.oyd.jsx`,参考 `yida-custom-page/references/attachment-upload-guide.md` |
80
79
 
@@ -34,6 +34,22 @@ const {
34
34
  assertNoEmojiInText,
35
35
  } = require('../core/no-emoji-guard');
36
36
  const { CliError, isCliError } = require('../core/cli-error');
37
+ const {
38
+ findBareCjkJsxTextIdentifiers,
39
+ formatBareCjkJsxTextMessage,
40
+ } = require('./jsx-text-guard');
41
+ const {
42
+ findDirectFormOpenIssues,
43
+ formatDirectFormOpenMessage,
44
+ } = require('./form-open-guard');
45
+ const {
46
+ findFormDetailLinkIssues,
47
+ formatFormDetailLinkMessage,
48
+ } = require('./form-detail-link-guard');
49
+ const {
50
+ findPageRichnessIssues,
51
+ formatPageRichnessMessage,
52
+ } = require('./page-richness-guard');
37
53
 
38
54
  /**
39
55
  * 依赖 → window 别名白名单,用于把 import 改写到运行时全局对象。
@@ -58,6 +74,68 @@ const MODULE_ALIAS_MAP = {
58
74
  'framer-motion': 'FramerMotion',
59
75
  };
60
76
 
77
+ const MANUAL_DEPENDENCY_GLOBALS = Object.freeze({
78
+ React: 'react',
79
+ antd: 'antd',
80
+ icons: '@ant-design/icons',
81
+ ahooks: 'ahooks',
82
+ d3: 'd3',
83
+ dayjs: 'dayjs',
84
+ Recharts: 'recharts',
85
+ Radix: '@radix-ui/themes',
86
+ DynamicIcon: 'lucide-react',
87
+ LucideReact: 'lucide-react',
88
+ FramerMotion: 'framer-motion',
89
+ YidaMarkdown: 'yida-plugin-markdown',
90
+ });
91
+
92
+ const BARE_DEPENDENCY_GLOBALS = Object.freeze({
93
+ antd: {
94
+ packageName: 'antd',
95
+ importExample: "import { Button, Drawer, ConfigProvider } from 'antd';",
96
+ },
97
+ icons: {
98
+ packageName: '@ant-design/icons',
99
+ importExample: "import { SearchOutlined, PlusOutlined } from '@ant-design/icons';",
100
+ },
101
+ lucideReact: {
102
+ packageName: 'lucide-react',
103
+ importExample: "import { Search, Plus, RefreshCw } from 'lucide-react';",
104
+ },
105
+ LucideReact: {
106
+ packageName: 'lucide-react',
107
+ importExample: "import { Search, Plus, RefreshCw } from 'lucide-react';",
108
+ },
109
+ DynamicIcon: {
110
+ packageName: 'lucide-react',
111
+ importExample: "import { DynamicIcon, Search } from 'lucide-react';",
112
+ },
113
+ ahooks: {
114
+ packageName: 'ahooks',
115
+ importExample: "import { useMemoizedFn } from 'ahooks';",
116
+ },
117
+ dayjs: {
118
+ packageName: 'dayjs',
119
+ importExample: "import dayjs from 'dayjs';",
120
+ },
121
+ Recharts: {
122
+ packageName: 'recharts',
123
+ importExample: "import { LineChart, Line } from 'recharts';",
124
+ },
125
+ FramerMotion: {
126
+ packageName: 'framer-motion',
127
+ importExample: "import { motion } from 'framer-motion';",
128
+ },
129
+ Radix: {
130
+ packageName: '@radix-ui/themes',
131
+ importExample: "import { Button } from '@radix-ui/themes';",
132
+ },
133
+ YidaMarkdown: {
134
+ packageName: 'yida-plugin-markdown',
135
+ importExample: "import Markdown from 'yida-plugin-markdown';",
136
+ },
137
+ });
138
+
61
139
  const LUCIDE_REACT_PACKAGE = 'lucide-react';
62
140
  const LUCIDE_DYNAMIC_ICON_ALIAS = 'DynamicIcon';
63
141
  const LUCIDE_MODULE_ALIAS = 'LucideReact';
@@ -91,6 +169,108 @@ function stripJsComments(code) {
91
169
  .replace(/(^|[^:])\/\/.*$/gm, '$1');
92
170
  }
93
171
 
172
+ function assertNoManualDependencyGlobals(source, options = {}) {
173
+ const stripped = stripJsComments(source);
174
+ const globals = Object.keys(MANUAL_DEPENDENCY_GLOBALS);
175
+ const pattern = new RegExp(`\\bwindow\\.(${globals.join('|')})\\b`);
176
+ const match = pattern.exec(stripped);
177
+ if (!match) {
178
+ return;
179
+ }
180
+ const globalName = match[1];
181
+ const pkg = MANUAL_DEPENDENCY_GLOBALS[globalName];
182
+ throw new CliError(
183
+ `Code Canvas 源码不能直接读取 window.${globalName}。请使用标准 import 从 "${pkg}" 引入,`
184
+ + '让编译器把依赖写入 importedModules;否则运行时不会加载该资源,页面会出现 window 依赖 undefined。',
185
+ {
186
+ code: 'OPENYIDA_CANVAS_MANUAL_DEPENDENCY_GLOBAL',
187
+ details: {
188
+ stage: 'canvas_compile',
189
+ sourcePath: options.sourcePath,
190
+ globalName,
191
+ packageName: pkg,
192
+ },
193
+ }
194
+ );
195
+ }
196
+
197
+ function findBareDependencyGlobalIssues(source) {
198
+ const issues = [];
199
+ const names = new Set(Object.keys(BARE_DEPENDENCY_GLOBALS));
200
+
201
+ const guardPlugin = ({ types: t }) => ({
202
+ name: 'yida-bare-dependency-global-guard',
203
+ visitor: {
204
+ ReferencedIdentifier(path) {
205
+ const name = path.node.name;
206
+ if (!names.has(name)) {
207
+ return;
208
+ }
209
+ if (path.scope.hasBinding(name)) {
210
+ return;
211
+ }
212
+ if (
213
+ path.parentPath &&
214
+ path.parentPath.isMemberExpression() &&
215
+ path.parent.object === path.node &&
216
+ t.isIdentifier(path.parent.property, { name: 'then' })
217
+ ) {
218
+ return;
219
+ }
220
+ const config = BARE_DEPENDENCY_GLOBALS[name];
221
+ issues.push({
222
+ name,
223
+ packageName: config.packageName,
224
+ importExample: config.importExample,
225
+ line: path.node.loc && path.node.loc.start ? path.node.loc.start.line : 0,
226
+ column: path.node.loc && path.node.loc.start ? path.node.loc.start.column : 0,
227
+ });
228
+ },
229
+ },
230
+ });
231
+
232
+ Babel.transform(source, {
233
+ filename: 'canvas.tsx',
234
+ presets: [
235
+ ['typescript', { allExtensions: true, isTSX: true, allowDeclareFields: true }],
236
+ ['react', { runtime: 'classic' }],
237
+ ],
238
+ plugins: [guardPlugin],
239
+ sourceType: 'module',
240
+ compact: false,
241
+ babelrc: false,
242
+ configFile: false,
243
+ });
244
+
245
+ return issues;
246
+ }
247
+
248
+ function formatBareDependencyGlobalMessage(issue) {
249
+ return `Code Canvas 源码不能直接使用未声明的依赖全局变量 ${issue.name}。`
250
+ + `请改用标准 import 从 "${issue.packageName}" 引入,例如:${issue.importExample} `
251
+ + '编译器会自动写入 importedModules 并映射到正确运行时资源;否则线上会出现 '
252
+ + `${issue.name} is not defined。`;
253
+ }
254
+
255
+ function assertNoBareDependencyGlobals(source, options = {}) {
256
+ const issues = findBareDependencyGlobalIssues(source);
257
+ if (issues.length === 0) {
258
+ return;
259
+ }
260
+ const firstIssue = issues[0];
261
+ throw new CliError(formatBareDependencyGlobalMessage(firstIssue), {
262
+ code: 'OPENYIDA_CANVAS_BARE_DEPENDENCY_GLOBAL',
263
+ details: {
264
+ stage: 'canvas_compile',
265
+ sourcePath: options.sourcePath || '',
266
+ line: firstIssue.line,
267
+ column: firstIssue.column,
268
+ globalName: firstIssue.name,
269
+ packageName: firstIssue.packageName,
270
+ },
271
+ });
272
+ }
273
+
94
274
  /**
95
275
  * 从源码里正则抽取裸包名(过滤相对/绝对路径),去重排序。
96
276
  * 对齐画布运行时的依赖抽取行为。
@@ -402,6 +582,62 @@ function compileCanvasLocal(source, options = {}) {
402
582
  artifact: options.sourcePath || 'Code Canvas source',
403
583
  code: 'OPENYIDA_CANVAS_SOURCE_EMOJI_FORBIDDEN',
404
584
  });
585
+ const jsxTextIssues = findBareCjkJsxTextIdentifiers(source);
586
+ if (jsxTextIssues.length > 0) {
587
+ const firstIssue = jsxTextIssues[0];
588
+ throw new CliError(formatBareCjkJsxTextMessage(firstIssue.name), {
589
+ code: 'OPENYIDA_CANVAS_JSX_TEXT_IDENTIFIER',
590
+ details: {
591
+ stage: 'canvas_compile',
592
+ sourcePath: options.sourcePath || '',
593
+ line: firstIssue.line,
594
+ identifier: firstIssue.name,
595
+ },
596
+ });
597
+ }
598
+ const directFormOpenIssues = findDirectFormOpenIssues(source);
599
+ if (directFormOpenIssues.length > 0) {
600
+ const firstIssue = directFormOpenIssues[0];
601
+ throw new CliError(formatDirectFormOpenMessage(), {
602
+ code: 'OPENYIDA_CANVAS_FORM_OPEN_CONTAINER_REQUIRED',
603
+ details: {
604
+ stage: 'canvas_compile',
605
+ sourcePath: options.sourcePath || '',
606
+ line: firstIssue.line,
607
+ callee: firstIssue.callee,
608
+ },
609
+ });
610
+ }
611
+ const formDetailLinkIssues = findFormDetailLinkIssues(source);
612
+ if (formDetailLinkIssues.length > 0) {
613
+ const firstIssue = formDetailLinkIssues[0];
614
+ throw new CliError(formatFormDetailLinkMessage(firstIssue), {
615
+ code: 'OPENYIDA_CANVAS_FORM_DETAIL_LINK_INVALID',
616
+ details: {
617
+ stage: 'canvas_compile',
618
+ sourcePath: options.sourcePath || '',
619
+ line: firstIssue.line,
620
+ issueType: firstIssue.type,
621
+ },
622
+ });
623
+ }
624
+ const richnessIssues = findPageRichnessIssues(source);
625
+ if (richnessIssues.length > 0) {
626
+ const firstIssue = richnessIssues[0];
627
+ throw new CliError(formatPageRichnessMessage(firstIssue), {
628
+ code: 'OPENYIDA_CANVAS_CONTENT_BLOCKS_TOO_FEW',
629
+ details: {
630
+ stage: 'canvas_compile',
631
+ sourcePath: options.sourcePath || '',
632
+ line: firstIssue.line,
633
+ scene: firstIssue.scene,
634
+ count: firstIssue.count,
635
+ min: firstIssue.min,
636
+ },
637
+ });
638
+ }
639
+ assertNoBareDependencyGlobals(source, options);
640
+ assertNoManualDependencyGlobals(source, options);
405
641
 
406
642
  const importedModules = extractImportedModules(source);
407
643
 
@@ -517,5 +753,6 @@ module.exports = {
517
753
  resolveWindowAlias,
518
754
  shouldAllowUnsupportedBareImports,
519
755
  assertCanvasRuntimeParseable,
756
+ findBareDependencyGlobalIssues,
520
757
  MODULE_ALIAS_MAP,
521
758
  };