openxiangda 1.0.264 → 2.0.0-alpha.2

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 (537) hide show
  1. package/README.md +11 -666
  2. package/bin/run.js +11 -0
  3. package/dist/browser/AuthoritativeSelector.d.ts +37 -0
  4. package/dist/browser/AuthoritativeSelector.d.ts.map +1 -0
  5. package/dist/browser/AuthoritativeSelector.js +357 -0
  6. package/dist/browser/AuthoritativeSelector.js.map +1 -0
  7. package/dist/browser/FilePreviewPage.d.ts +2 -0
  8. package/dist/browser/FilePreviewPage.d.ts.map +1 -0
  9. package/dist/browser/FilePreviewPage.js +191 -0
  10. package/dist/browser/FilePreviewPage.js.map +1 -0
  11. package/dist/browser/Shell.d.ts +6 -0
  12. package/dist/browser/Shell.d.ts.map +1 -0
  13. package/dist/browser/Shell.js +198 -0
  14. package/dist/browser/Shell.js.map +1 -0
  15. package/dist/browser/appearance.d.ts +12 -0
  16. package/dist/browser/appearance.d.ts.map +1 -0
  17. package/dist/browser/appearance.js +100 -0
  18. package/dist/browser/appearance.js.map +1 -0
  19. package/dist/browser/application.d.ts +8 -0
  20. package/dist/browser/application.d.ts.map +1 -0
  21. package/dist/browser/application.js +42 -0
  22. package/dist/browser/application.js.map +1 -0
  23. package/dist/browser/components/platform-fields/AddressField.d.ts +12 -0
  24. package/dist/browser/components/platform-fields/AddressField.d.ts.map +1 -0
  25. package/dist/browser/components/platform-fields/AddressField.js +179 -0
  26. package/dist/browser/components/platform-fields/AddressField.js.map +1 -0
  27. package/dist/browser/components/platform-fields/AttachmentFileList.d.ts +9 -0
  28. package/dist/browser/components/platform-fields/AttachmentFileList.d.ts.map +1 -0
  29. package/dist/browser/components/platform-fields/AttachmentFileList.js +164 -0
  30. package/dist/browser/components/platform-fields/AttachmentFileList.js.map +1 -0
  31. package/dist/browser/components/platform-fields/CascadeField.d.ts +13 -0
  32. package/dist/browser/components/platform-fields/CascadeField.d.ts.map +1 -0
  33. package/dist/browser/components/platform-fields/CascadeField.js +14 -0
  34. package/dist/browser/components/platform-fields/CascadeField.js.map +1 -0
  35. package/dist/browser/components/platform-fields/DateTimeField.d.ts +16 -0
  36. package/dist/browser/components/platform-fields/DateTimeField.d.ts.map +1 -0
  37. package/dist/browser/components/platform-fields/DateTimeField.js +51 -0
  38. package/dist/browser/components/platform-fields/DateTimeField.js.map +1 -0
  39. package/dist/browser/components/platform-fields/JsonField.d.ts +11 -0
  40. package/dist/browser/components/platform-fields/JsonField.d.ts.map +1 -0
  41. package/dist/browser/components/platform-fields/JsonField.js +40 -0
  42. package/dist/browser/components/platform-fields/JsonField.js.map +1 -0
  43. package/dist/browser/components/platform-fields/LocationField.d.ts +11 -0
  44. package/dist/browser/components/platform-fields/LocationField.d.ts.map +1 -0
  45. package/dist/browser/components/platform-fields/LocationField.js +73 -0
  46. package/dist/browser/components/platform-fields/LocationField.js.map +1 -0
  47. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts +12 -0
  48. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts.map +1 -0
  49. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js +269 -0
  50. package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js.map +1 -0
  51. package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts +12 -0
  52. package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts.map +1 -0
  53. package/dist/browser/components/platform-fields/ResourceReferenceField.js +22 -0
  54. package/dist/browser/components/platform-fields/ResourceReferenceField.js.map +1 -0
  55. package/dist/browser/components/platform-fields/RichTextField.d.ts +14 -0
  56. package/dist/browser/components/platform-fields/RichTextField.d.ts.map +1 -0
  57. package/dist/browser/components/platform-fields/RichTextField.js +214 -0
  58. package/dist/browser/components/platform-fields/RichTextField.js.map +1 -0
  59. package/dist/browser/components/platform-fields/SignatureField.d.ts +15 -0
  60. package/dist/browser/components/platform-fields/SignatureField.d.ts.map +1 -0
  61. package/dist/browser/components/platform-fields/SignatureField.js +179 -0
  62. package/dist/browser/components/platform-fields/SignatureField.js.map +1 -0
  63. package/dist/browser/components/platform-fields/SubtableField.d.ts +18 -0
  64. package/dist/browser/components/platform-fields/SubtableField.d.ts.map +1 -0
  65. package/dist/browser/components/platform-fields/SubtableField.js +236 -0
  66. package/dist/browser/components/platform-fields/SubtableField.js.map +1 -0
  67. package/dist/browser/components/platform-fields/address-value.d.ts +13 -0
  68. package/dist/browser/components/platform-fields/address-value.d.ts.map +1 -0
  69. package/dist/browser/components/platform-fields/address-value.js +70 -0
  70. package/dist/browser/components/platform-fields/address-value.js.map +1 -0
  71. package/dist/browser/components/platform-fields/cascade-value.d.ts +6 -0
  72. package/dist/browser/components/platform-fields/cascade-value.d.ts.map +1 -0
  73. package/dist/browser/components/platform-fields/cascade-value.js +47 -0
  74. package/dist/browser/components/platform-fields/cascade-value.js.map +1 -0
  75. package/dist/browser/components/platform-fields/directory-value.d.ts +7 -0
  76. package/dist/browser/components/platform-fields/directory-value.d.ts.map +1 -0
  77. package/dist/browser/components/platform-fields/directory-value.js +35 -0
  78. package/dist/browser/components/platform-fields/directory-value.js.map +1 -0
  79. package/dist/browser/components/platform-fields/field-form-codec.d.ts +10 -0
  80. package/dist/browser/components/platform-fields/field-form-codec.d.ts.map +1 -0
  81. package/dist/browser/components/platform-fields/field-form-codec.js +82 -0
  82. package/dist/browser/components/platform-fields/field-form-codec.js.map +1 -0
  83. package/dist/browser/components/platform-fields/location-value.d.ts +20 -0
  84. package/dist/browser/components/platform-fields/location-value.d.ts.map +1 -0
  85. package/dist/browser/components/platform-fields/location-value.js +57 -0
  86. package/dist/browser/components/platform-fields/location-value.js.map +1 -0
  87. package/dist/browser/components/platform-fields/resource-query.d.ts +14 -0
  88. package/dist/browser/components/platform-fields/resource-query.d.ts.map +1 -0
  89. package/dist/browser/components/platform-fields/resource-query.js +102 -0
  90. package/dist/browser/components/platform-fields/resource-query.js.map +1 -0
  91. package/dist/browser/components/platform-fields/rich-text-value.d.ts +12 -0
  92. package/dist/browser/components/platform-fields/rich-text-value.d.ts.map +1 -0
  93. package/dist/browser/components/platform-fields/rich-text-value.js +83 -0
  94. package/dist/browser/components/platform-fields/rich-text-value.js.map +1 -0
  95. package/dist/browser/components/platform-fields/subtable-value.d.ts +31 -0
  96. package/dist/browser/components/platform-fields/subtable-value.d.ts.map +1 -0
  97. package/dist/browser/components/platform-fields/subtable-value.js +120 -0
  98. package/dist/browser/components/platform-fields/subtable-value.js.map +1 -0
  99. package/dist/browser/components/resource/GeneratedResourceCrud.d.ts +8 -0
  100. package/dist/browser/components/resource/GeneratedResourceCrud.d.ts.map +1 -0
  101. package/dist/browser/components/resource/GeneratedResourceCrud.js +580 -0
  102. package/dist/browser/components/resource/GeneratedResourceCrud.js.map +1 -0
  103. package/dist/browser/components/resource/ResourceBatchActions.d.ts +25 -0
  104. package/dist/browser/components/resource/ResourceBatchActions.d.ts.map +1 -0
  105. package/dist/browser/components/resource/ResourceBatchActions.js +168 -0
  106. package/dist/browser/components/resource/ResourceBatchActions.js.map +1 -0
  107. package/dist/browser/components/resource/StandardResourcePages.d.ts +57 -0
  108. package/dist/browser/components/resource/StandardResourcePages.d.ts.map +1 -0
  109. package/dist/browser/components/resource/StandardResourcePages.js +89 -0
  110. package/dist/browser/components/resource/StandardResourcePages.js.map +1 -0
  111. package/dist/browser/components/resource/SurfaceFields.d.ts +88 -0
  112. package/dist/browser/components/resource/SurfaceFields.d.ts.map +1 -0
  113. package/dist/browser/components/resource/SurfaceFields.js +497 -0
  114. package/dist/browser/components/resource/SurfaceFields.js.map +1 -0
  115. package/dist/browser/components/resource/generated-resource-definition.d.ts +19 -0
  116. package/dist/browser/components/resource/generated-resource-definition.d.ts.map +1 -0
  117. package/dist/browser/components/resource/generated-resource-definition.js +2 -0
  118. package/dist/browser/components/resource/generated-resource-definition.js.map +1 -0
  119. package/dist/browser/components/resource/resource-import.d.ts +15 -0
  120. package/dist/browser/components/resource/resource-import.d.ts.map +1 -0
  121. package/dist/browser/components/resource/resource-import.js +197 -0
  122. package/dist/browser/components/resource/resource-import.js.map +1 -0
  123. package/dist/browser/data-provider.d.ts +4 -0
  124. package/dist/browser/data-provider.d.ts.map +1 -0
  125. package/dist/browser/data-provider.js +45 -0
  126. package/dist/browser/data-provider.js.map +1 -0
  127. package/dist/browser/platform-client.d.ts +81 -0
  128. package/dist/browser/platform-client.d.ts.map +1 -0
  129. package/dist/browser/platform-client.js +422 -0
  130. package/dist/browser/platform-client.js.map +1 -0
  131. package/dist/browser/resource-definitions.d.ts +8 -0
  132. package/dist/browser/resource-definitions.d.ts.map +1 -0
  133. package/dist/browser/resource-definitions.js +14 -0
  134. package/dist/browser/resource-definitions.js.map +1 -0
  135. package/dist/browser/runtime-meta.d.ts +22 -0
  136. package/dist/browser/runtime-meta.d.ts.map +1 -0
  137. package/dist/browser/runtime-meta.js +79 -0
  138. package/dist/browser/runtime-meta.js.map +1 -0
  139. package/dist/browser/runtime.d.ts +13 -0
  140. package/dist/browser/runtime.d.ts.map +1 -0
  141. package/dist/browser/runtime.js +47 -0
  142. package/dist/browser/runtime.js.map +1 -0
  143. package/dist/browser/styles.css +1941 -0
  144. package/dist/config.d.ts +2 -0
  145. package/dist/config.d.ts.map +1 -0
  146. package/dist/config.js +2 -0
  147. package/dist/config.js.map +1 -0
  148. package/dist/core.d.ts +6 -0
  149. package/dist/core.d.ts.map +1 -0
  150. package/dist/core.js +4 -0
  151. package/dist/core.js.map +1 -0
  152. package/dist/field-kit.d.ts +22 -0
  153. package/dist/field-kit.d.ts.map +1 -0
  154. package/dist/field-kit.js +22 -0
  155. package/dist/field-kit.js.map +1 -0
  156. package/dist/index.d.ts +2 -0
  157. package/dist/index.d.ts.map +1 -0
  158. package/dist/index.js +2 -0
  159. package/dist/index.js.map +1 -0
  160. package/dist/nest.d.ts +10 -0
  161. package/dist/nest.d.ts.map +1 -0
  162. package/dist/nest.js +9 -0
  163. package/dist/nest.js.map +1 -0
  164. package/dist/react.d.ts +12 -0
  165. package/dist/react.d.ts.map +1 -0
  166. package/dist/react.js +11 -0
  167. package/dist/react.js.map +1 -0
  168. package/dist/testing.d.ts +4 -0
  169. package/dist/testing.d.ts.map +1 -0
  170. package/dist/testing.js +4 -0
  171. package/dist/testing.js.map +1 -0
  172. package/package.json +95 -200
  173. package/skills/manifest.json +10 -0
  174. package/skills/openxiangda-v2/SKILL.md +55 -0
  175. package/skills/openxiangda-v2/references/architecture.md +7 -0
  176. package/skills/openxiangda-v2/references/backend.md +116 -0
  177. package/skills/openxiangda-v2/references/data-authz.md +93 -0
  178. package/skills/openxiangda-v2/references/delivery.md +11 -0
  179. package/skills/openxiangda-v2/references/discovery.md +15 -0
  180. package/skills/openxiangda-v2/references/frontend.md +10 -0
  181. package/skills/openxiangda-v2/references/testing.md +16 -0
  182. package/skills/openxiangda-v2/references/workflow-notification.md +69 -0
  183. package/skills/openxiangda-v2/references/workspace.md +21 -0
  184. package/bin/openxiangda.js +0 -26
  185. package/lib/app-function-invoke.js +0 -28
  186. package/lib/application-environments.js +0 -1134
  187. package/lib/change-baseline.js +0 -1359
  188. package/lib/cli.js +0 -31084
  189. package/lib/config.js +0 -450
  190. package/lib/content-cache.js +0 -97
  191. package/lib/delivery-v2-cli.js +0 -329
  192. package/lib/delivery-v2-executor.js +0 -1703
  193. package/lib/delivery-v2-package.js +0 -1176
  194. package/lib/dependency-capsule.js +0 -246
  195. package/lib/design-gates.js +0 -668
  196. package/lib/design-review.js +0 -220
  197. package/lib/developer-center.js +0 -160
  198. package/lib/form-field-contract.js +0 -79
  199. package/lib/form-schema-loader.js +0 -181
  200. package/lib/git-remote-identity.js +0 -89
  201. package/lib/http.js +0 -196
  202. package/lib/integration-bundle.js +0 -225
  203. package/lib/js-code-build.js +0 -175
  204. package/lib/open-api.js +0 -256
  205. package/lib/policy.js +0 -137
  206. package/lib/publish-context.js +0 -98
  207. package/lib/publish-lease-heartbeat.js +0 -182
  208. package/lib/publish-lease.js +0 -221
  209. package/lib/release-error-classification.js +0 -41
  210. package/lib/release-explain.js +0 -75
  211. package/lib/release-mainline.js +0 -654
  212. package/lib/release-plan.js +0 -550
  213. package/lib/release-telemetry.js +0 -182
  214. package/lib/resource-binding-contract.js +0 -210
  215. package/lib/role-resolution.js +0 -57
  216. package/lib/runtime-lineage.js +0 -326
  217. package/lib/sdd.js +0 -3306
  218. package/lib/skills.js +0 -453
  219. package/lib/source-dependencies.js +0 -921
  220. package/lib/task-status.js +0 -330
  221. package/lib/utils.js +0 -178
  222. package/lib/workspace-bootstrap.js +0 -268
  223. package/lib/workspace-init.js +0 -202
  224. package/lib/worktree-cleanup.js +0 -631
  225. package/lib/worktree-owner.js +0 -354
  226. package/openxiangda-skills/SKILL.md +0 -226
  227. package/openxiangda-skills/references/architecture-design.md +0 -409
  228. package/openxiangda-skills/references/architecture-patterns.md +0 -264
  229. package/openxiangda-skills/references/automation-v3.md +0 -349
  230. package/openxiangda-skills/references/best-practices.md +0 -272
  231. package/openxiangda-skills/references/component-guide.md +0 -287
  232. package/openxiangda-skills/references/connector-resources.md +0 -80
  233. package/openxiangda-skills/references/data-views.md +0 -360
  234. package/openxiangda-skills/references/forms/component-registry.md +0 -90
  235. package/openxiangda-skills/references/forms/form-schema.md +0 -146
  236. package/openxiangda-skills/references/forms/layout-and-rules.md +0 -24
  237. package/openxiangda-skills/references/notifications.md +0 -227
  238. package/openxiangda-skills/references/openxiangda-api.md +0 -971
  239. package/openxiangda-skills/references/pages/app-shell.md +0 -66
  240. package/openxiangda-skills/references/pages/page-sdk.md +0 -401
  241. package/openxiangda-skills/references/pages/publish-flow.md +0 -84
  242. package/openxiangda-skills/references/pages/workspace-structure.md +0 -41
  243. package/openxiangda-skills/references/permission-design-patterns.md +0 -313
  244. package/openxiangda-skills/references/permissions-settings.md +0 -468
  245. package/openxiangda-skills/references/platform-data-model.md +0 -340
  246. package/openxiangda-skills/references/resource-manifest-cheatsheet.md +0 -936
  247. package/openxiangda-skills/references/school-contact-relations.md +0 -224
  248. package/openxiangda-skills/references/style-system.md +0 -218
  249. package/openxiangda-skills/references/troubleshooting.md +0 -271
  250. package/openxiangda-skills/references/workflow-v3.md +0 -441
  251. package/openxiangda-skills/references/workspace-state.md +0 -115
  252. package/openxiangda-skills/skills/openxiangda-app/SKILL.md +0 -118
  253. package/openxiangda-skills/skills/openxiangda-architecture-design/SKILL.md +0 -137
  254. package/openxiangda-skills/skills/openxiangda-core/SKILL.md +0 -222
  255. package/openxiangda-skills/skills/openxiangda-form/SKILL.md +0 -184
  256. package/openxiangda-skills/skills/openxiangda-inspect/SKILL.md +0 -63
  257. package/openxiangda-skills/skills/openxiangda-open-api/SKILL.md +0 -57
  258. package/openxiangda-skills/skills/openxiangda-open-api/agents/openai.yaml +0 -4
  259. package/openxiangda-skills/skills/openxiangda-open-api/references/backend-authentication.md +0 -63
  260. package/openxiangda-skills/skills/openxiangda-open-api/references/dingtalk-api.openapi.json +0 -15653
  261. package/openxiangda-skills/skills/openxiangda-page/SKILL.md +0 -154
  262. package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +0 -209
  263. package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +0 -201
  264. package/packages/sdk/bin/lowcode-workspace.mjs +0 -4
  265. package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.mts +0 -1292
  266. package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.ts +0 -1292
  267. package/packages/sdk/dist/build/index.cjs +0 -1
  268. package/packages/sdk/dist/build/index.d.mts +0 -60
  269. package/packages/sdk/dist/build/index.d.ts +0 -60
  270. package/packages/sdk/dist/build/index.mjs +0 -1
  271. package/packages/sdk/dist/components/index.cjs +0 -148
  272. package/packages/sdk/dist/components/index.d.mts +0 -970
  273. package/packages/sdk/dist/components/index.d.ts +0 -970
  274. package/packages/sdk/dist/components/index.mjs +0 -148
  275. package/packages/sdk/dist/dataManagementApi-Ro9itwm8.d.ts +0 -142
  276. package/packages/sdk/dist/dataManagementApi-p_HOhQnA.d.mts +0 -142
  277. package/packages/sdk/dist/runtime/index.cjs +0 -148
  278. package/packages/sdk/dist/runtime/index.d.mts +0 -171
  279. package/packages/sdk/dist/runtime/index.d.ts +0 -171
  280. package/packages/sdk/dist/runtime/index.mjs +0 -148
  281. package/packages/sdk/dist/runtime/react.cjs +0 -148
  282. package/packages/sdk/dist/runtime/react.d.mts +0 -3202
  283. package/packages/sdk/dist/runtime/react.d.ts +0 -3202
  284. package/packages/sdk/dist/runtime/react.mjs +0 -148
  285. package/packages/sdk/dist/styles/antd-theme.cjs +0 -1
  286. package/packages/sdk/dist/styles/antd-theme.d.mts +0 -6
  287. package/packages/sdk/dist/styles/antd-theme.d.ts +0 -6
  288. package/packages/sdk/dist/styles/antd-theme.mjs +0 -1
  289. package/packages/sdk/dist/styles/tailwind-preset.cjs +0 -1
  290. package/packages/sdk/dist/styles/tailwind-preset.d.mts +0 -74
  291. package/packages/sdk/dist/styles/tailwind-preset.d.ts +0 -74
  292. package/packages/sdk/dist/styles/tailwind-preset.mjs +0 -1
  293. package/packages/sdk/dist/styles/tokens.css +0 -74
  294. package/packages/sdk/dist/workflow/index.cjs +0 -3
  295. package/packages/sdk/dist/workflow/index.d.mts +0 -291
  296. package/packages/sdk/dist/workflow/index.d.ts +0 -291
  297. package/packages/sdk/dist/workflow/index.mjs +0 -3
  298. package/packages/sdk/source/admin-list/AdminList.tsx +0 -1734
  299. package/packages/sdk/source/admin-list/README.md +0 -12
  300. package/packages/sdk/source/admin-list/dataSources.ts +0 -345
  301. package/packages/sdk/source/admin-list/index.ts +0 -42
  302. package/packages/sdk/source/admin-list/preferences.ts +0 -174
  303. package/packages/sdk/source/admin-list/types.ts +0 -273
  304. package/packages/sdk/src/build-source/README.md +0 -9
  305. package/packages/sdk/src/build-source/bin/lowcode-workspace.mjs +0 -7
  306. package/packages/sdk/src/build-source/package.json +0 -34
  307. package/packages/sdk/src/build-source/scripts/build-forms.mjs +0 -1129
  308. package/packages/sdk/src/build-source/scripts/build-pages.mjs +0 -897
  309. package/packages/sdk/src/build-source/scripts/build-workspace.mjs +0 -89
  310. package/packages/sdk/src/build-source/scripts/publish-all.mjs +0 -190
  311. package/packages/sdk/src/build-source/scripts/publish-oss.mjs +0 -144
  312. package/packages/sdk/src/build-source/scripts/register-bundle.mjs +0 -1
  313. package/packages/sdk/src/build-source/scripts/register.mjs +0 -362
  314. package/packages/sdk/src/build-source/scripts/sync-schema.mjs +0 -381
  315. package/packages/sdk/src/build-source/scripts/utils/form-api.mjs +0 -1058
  316. package/packages/sdk/src/build-source/scripts/utils/form-runtime-assets.mjs +0 -57
  317. package/packages/sdk/src/build-source/scripts/utils/incremental.mjs +0 -348
  318. package/packages/sdk/src/build-source/scripts/utils/load-config.mjs +0 -331
  319. package/packages/sdk/src/build-source/scripts/utils/mime-types.mjs +0 -70
  320. package/packages/sdk/src/build-source/scripts/utils/namespace-css.mjs +0 -77
  321. package/packages/sdk/src/build-source/scripts/utils/oss-client.mjs +0 -128
  322. package/packages/sdk/src/build-source/scripts/utils/pages.mjs +0 -150
  323. package/packages/sdk/src/build-source/scripts/utils/progress.mjs +0 -57
  324. package/packages/sdk/src/build-source/scripts/utils/publish-oss-patterns.mjs +0 -20
  325. package/packages/sdk/src/build-source/scripts/utils/register-payload.mjs +0 -90
  326. package/packages/sdk/src/build-source/scripts/utils/runtime-css-check.mjs +0 -44
  327. package/packages/sdk/src/build-source/scripts/utils/schema-transform.mjs +0 -142
  328. package/packages/sdk/src/build-source/scripts/utils/static-assets.mjs +0 -165
  329. package/packages/sdk/src/build-source/scripts/utils/tailwind-config.mjs +0 -283
  330. package/packages/sdk/src/build-source/scripts/utils/tailwind-token-warnings.mjs +0 -146
  331. package/packages/sdk/src/build-source/scripts/utils/workspace-style-entry.mjs +0 -29
  332. package/packages/sdk/src/build-source/src/cli.mjs +0 -735
  333. package/policy/openxiangda-policy.json +0 -72
  334. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-form.mdc +0 -24
  335. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-page.mdc +0 -25
  336. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-resources.mdc +0 -32
  337. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-workflow-automation.mdc +0 -26
  338. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +0 -68
  339. package/templates/openxiangda-react-spa/.env.example +0 -4
  340. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-form.md +0 -37
  341. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-page.md +0 -29
  342. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-resources.md +0 -32
  343. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-workflow-automation.md +0 -34
  344. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +0 -66
  345. package/templates/openxiangda-react-spa/AGENTS.md +0 -192
  346. package/templates/openxiangda-react-spa/DELIVERY.md +0 -43
  347. package/templates/openxiangda-react-spa/app-workspace.config.ts +0 -50
  348. package/templates/openxiangda-react-spa/index.html +0 -12
  349. package/templates/openxiangda-react-spa/package.json +0 -53
  350. package/templates/openxiangda-react-spa/postcss.config.cjs +0 -6
  351. package/templates/openxiangda-react-spa/scripts/build-js-code.mjs +0 -600
  352. package/templates/openxiangda-react-spa/scripts/deploy.mjs +0 -18
  353. package/templates/openxiangda-react-spa/scripts/guard-publish.mjs +0 -21
  354. package/templates/openxiangda-react-spa/src/app/navigation.ts +0 -73
  355. package/templates/openxiangda-react-spa/src/app/router.tsx +0 -146
  356. package/templates/openxiangda-react-spa/src/app/starter-content.ts +0 -144
  357. package/templates/openxiangda-react-spa/src/forms/.gitkeep +0 -1
  358. package/templates/openxiangda-react-spa/src/layouts/AdminShell.tsx +0 -570
  359. package/templates/openxiangda-react-spa/src/main.tsx +0 -21
  360. package/templates/openxiangda-react-spa/src/pages/admin/AdminDashboardPage.tsx +0 -170
  361. package/templates/openxiangda-react-spa/src/pages/admin/LoginLogPage.tsx +0 -425
  362. package/templates/openxiangda-react-spa/src/pages/defaults/DataRoutePage.tsx +0 -36
  363. package/templates/openxiangda-react-spa/src/pages/defaults/FilePreviewRoutePage.tsx +0 -65
  364. package/templates/openxiangda-react-spa/src/pages/defaults/FormRoutePage.tsx +0 -235
  365. package/templates/openxiangda-react-spa/src/pages/public/PublicRegisterPage.tsx +0 -15
  366. package/templates/openxiangda-react-spa/src/pages/states/NotFoundPage.tsx +0 -31
  367. package/templates/openxiangda-react-spa/src/resources/menus/menus.json +0 -22
  368. package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/app-admin.json +0 -8
  369. package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/public-visitor.json +0 -8
  370. package/templates/openxiangda-react-spa/src/resources/public-access/public-register.json +0 -14
  371. package/templates/openxiangda-react-spa/src/resources/roles/roles.json +0 -15
  372. package/templates/openxiangda-react-spa/src/resources/routes/public-register.json +0 -8
  373. package/templates/openxiangda-react-spa/src/runtime/default-page-overrides.tsx +0 -35
  374. package/templates/openxiangda-react-spa/src/runtime/default-routes.ts +0 -16
  375. package/templates/openxiangda-react-spa/src/shared/form-schema.ts +0 -135
  376. package/templates/openxiangda-react-spa/src/shared/mac-admin.tsx +0 -651
  377. package/templates/openxiangda-react-spa/src/shared/ui.tsx +0 -22
  378. package/templates/openxiangda-react-spa/src/styles/index.css +0 -105
  379. package/templates/openxiangda-react-spa/tailwind.config.cjs +0 -37
  380. package/templates/openxiangda-react-spa/tsconfig.app.json +0 -36
  381. package/templates/openxiangda-react-spa/tsconfig.js-code-nodes.json +0 -19
  382. package/templates/openxiangda-react-spa/tsconfig.json +0 -7
  383. package/templates/openxiangda-react-spa/tsconfig.node.json +0 -10
  384. package/templates/openxiangda-react-spa/vite.config.ts +0 -209
  385. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-form.mdc +0 -24
  386. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-page.mdc +0 -21
  387. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +0 -40
  388. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-workflow-automation.mdc +0 -21
  389. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +0 -81
  390. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-form.md +0 -38
  391. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-page.md +0 -39
  392. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +0 -59
  393. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-workflow-automation.md +0 -46
  394. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +0 -82
  395. package/templates/sy-lowcode-app-workspace/AGENTS.md +0 -158
  396. package/templates/sy-lowcode-app-workspace/DELIVERY.md +0 -43
  397. package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +0 -51
  398. package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +0 -43
  399. package/templates/sy-lowcode-app-workspace/examples/best-practices/access-governance.md +0 -239
  400. package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +0 -99
  401. package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +0 -94
  402. package/templates/sy-lowcode-app-workspace/examples/best-practices/design-style.md +0 -91
  403. package/templates/sy-lowcode-app-workspace/examples/best-practices/module-structure.md +0 -48
  404. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/index.ts +0 -2
  405. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.test.ts +0 -52
  406. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.ts +0 -37
  407. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/types.ts +0 -19
  408. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/index.ts +0 -4
  409. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.test.ts +0 -42
  410. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.ts +0 -25
  411. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.test.ts +0 -63
  412. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.ts +0 -73
  413. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.test.ts +0 -34
  414. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.ts +0 -73
  415. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/types.ts +0 -66
  416. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/page.tsx +0 -1
  417. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/schema.ts +0 -109
  418. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/page.tsx +0 -1
  419. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/schema.ts +0 -92
  420. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/page.tsx +0 -1
  421. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/schema.ts +0 -153
  422. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/page.tsx +0 -1
  423. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/schema.ts +0 -65
  424. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/daily_ticket_digest/index.ts +0 -44
  425. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/sync_roles_to_platform/index.ts +0 -33
  426. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/App.tsx +0 -8
  427. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/GlassHomeDashboard.tsx +0 -232
  428. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/index.tsx +0 -10
  429. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/page.config.ts +0 -14
  430. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/styles.css +0 -196
  431. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/App.tsx +0 -7
  432. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/WorkbenchPage.tsx +0 -36
  433. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/ConfigPanel.tsx +0 -34
  434. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/PreviewPanel.tsx +0 -17
  435. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/index.tsx +0 -10
  436. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/page.config.ts +0 -9
  437. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/reducer.ts +0 -29
  438. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/styles.css +0 -24
  439. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/App.tsx +0 -8
  440. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/MintAnalyticsDashboard.tsx +0 -279
  441. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/index.tsx +0 -10
  442. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/page.config.ts +0 -14
  443. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/styles.css +0 -163
  444. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/App.tsx +0 -7
  445. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/MobilePortalShell.tsx +0 -31
  446. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/index.tsx +0 -10
  447. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/modules/MobileHome.tsx +0 -13
  448. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/page.config.ts +0 -14
  449. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/routes.ts +0 -13
  450. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/styles.css +0 -11
  451. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/App.tsx +0 -8
  452. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/OpsMonitorDashboard.tsx +0 -306
  453. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/index.tsx +0 -10
  454. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/page.config.ts +0 -14
  455. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/styles.css +0 -248
  456. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/App.tsx +0 -7
  457. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/PcPortalShell.tsx +0 -35
  458. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/components/PortalMetric.tsx +0 -11
  459. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/index.tsx +0 -10
  460. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/HomeModule.tsx +0 -25
  461. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/TicketsModule.tsx +0 -14
  462. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/page.config.ts +0 -14
  463. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/routes.ts +0 -19
  464. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/styles.css +0 -35
  465. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/App.tsx +0 -7
  466. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/TicketOpsPage.tsx +0 -105
  467. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketActionTimeline.tsx +0 -22
  468. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketDetailDrawer.tsx +0 -44
  469. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketTableActions.tsx +0 -57
  470. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/index.tsx +0 -10
  471. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/page.config.ts +0 -9
  472. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/styles.css +0 -35
  473. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/App.tsx +0 -8
  474. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/WorkOrderListDrawerPage.tsx +0 -371
  475. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/index.tsx +0 -10
  476. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/page.config.ts +0 -14
  477. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/styles.css +0 -182
  478. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/automation.json +0 -25
  479. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/trigger.json +0 -9
  480. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/notifications/daily-ticket-digest.json +0 -24
  481. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/form-groups/service-ticket-college.json +0 -21
  482. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/roles.json +0 -17
  483. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/workflows/expense-approval-workflow.json +0 -48
  484. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/ConfirmAction.tsx +0 -22
  485. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/QueryState.tsx +0 -37
  486. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/StatusTag.tsx +0 -20
  487. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/DashboardPrimitives.tsx +0 -832
  488. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/chartOptions.ts +0 -140
  489. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/sampleData.ts +0 -466
  490. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/styles.css +0 -874
  491. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/types.ts +0 -150
  492. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/hooks/useTicketOps.ts +0 -96
  493. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/role-governance.ts +0 -48
  494. package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/service-ticket.ts +0 -113
  495. package/templates/sy-lowcode-app-workspace/examples/forms/customer/page.tsx +0 -1
  496. package/templates/sy-lowcode-app-workspace/examples/forms/customer/schema.ts +0 -36
  497. package/templates/sy-lowcode-app-workspace/index.html +0 -12
  498. package/templates/sy-lowcode-app-workspace/package.json +0 -58
  499. package/templates/sy-lowcode-app-workspace/postcss.config.cjs +0 -9
  500. package/templates/sy-lowcode-app-workspace/scripts/build-js-code.mjs +0 -600
  501. package/templates/sy-lowcode-app-workspace/scripts/guard-publish.mjs +0 -29
  502. package/templates/sy-lowcode-app-workspace/src/dev/App.tsx +0 -820
  503. package/templates/sy-lowcode-app-workspace/src/forms/.gitkeep +0 -1
  504. package/templates/sy-lowcode-app-workspace/src/forms/README.md +0 -52
  505. package/templates/sy-lowcode-app-workspace/src/index.css +0 -26
  506. package/templates/sy-lowcode-app-workspace/src/js-code-nodes/.gitkeep +0 -1
  507. package/templates/sy-lowcode-app-workspace/src/js-code-nodes/types.d.ts +0 -3
  508. package/templates/sy-lowcode-app-workspace/src/main.tsx +0 -29
  509. package/templates/sy-lowcode-app-workspace/src/pages/.gitkeep +0 -1
  510. package/templates/sy-lowcode-app-workspace/src/runtime/builtin-overrides.tsx +0 -8
  511. package/templates/sy-lowcode-app-workspace/src/shared/form-schema.ts +0 -135
  512. package/templates/sy-lowcode-app-workspace/src/types/app-workspace.types.ts +0 -88
  513. package/templates/sy-lowcode-app-workspace/tailwind.config.cjs +0 -31
  514. package/templates/sy-lowcode-app-workspace/tsconfig.app.json +0 -40
  515. package/templates/sy-lowcode-app-workspace/tsconfig.examples.json +0 -24
  516. package/templates/sy-lowcode-app-workspace/tsconfig.js-code-nodes.json +0 -19
  517. package/templates/sy-lowcode-app-workspace/tsconfig.json +0 -7
  518. package/templates/sy-lowcode-app-workspace/tsconfig.node.json +0 -10
  519. package/templates/sy-lowcode-app-workspace/vite.config.ts +0 -85
  520. package/v2/README.md +0 -35
  521. package/v2/skills/manifest.json +0 -45
  522. package/v2/skills/openxiangda-v1-maintenance/SKILL.md +0 -21
  523. package/v2/skills/openxiangda-v1-maintenance/agents/openai.yaml +0 -4
  524. package/v2/skills/openxiangda-v2/SKILL.md +0 -38
  525. package/v2/skills/openxiangda-v2-architecture/SKILL.md +0 -29
  526. package/v2/skills/openxiangda-v2-architecture/agents/openai.yaml +0 -4
  527. package/v2/skills/openxiangda-v2-backend/SKILL.md +0 -28
  528. package/v2/skills/openxiangda-v2-backend/agents/openai.yaml +0 -4
  529. package/v2/skills/openxiangda-v2-data-authz/SKILL.md +0 -28
  530. package/v2/skills/openxiangda-v2-data-authz/agents/openai.yaml +0 -4
  531. package/v2/skills/openxiangda-v2-delivery/SKILL.md +0 -30
  532. package/v2/skills/openxiangda-v2-delivery/agents/openai.yaml +0 -4
  533. package/v2/skills/openxiangda-v2-frontend/SKILL.md +0 -21
  534. package/v2/skills/openxiangda-v2-frontend/agents/openai.yaml +0 -4
  535. package/v2/skills/openxiangda-v2-workflow-events/SKILL.md +0 -28
  536. package/v2/skills/openxiangda-v2-workflow-events/agents/openai.yaml +0 -4
  537. /package/{v2/skills → skills}/openxiangda-v2/agents/openai.yaml +0 -0
@@ -1,820 +0,0 @@
1
- import { ReloadOutlined, UserSwitchOutlined } from "@ant-design/icons";
2
- import { Alert, Button, Card, Empty, Input, Select, Space, Spin, Tag, Typography, message, Modal } from "antd";
3
- import { useEffect, useMemo, useRef, useState } from "react";
4
- import { BuiltinRouteRenderer, resolveBrowserRuntimeRoute } from "openxiangda/runtime";
5
- import type {
6
- BrowserRuntimeRouteResolution,
7
- PageApiResponse,
8
- PageBinaryResponse,
9
- PageContext,
10
- PageRequestOptions,
11
- } from "openxiangda/runtime";
12
- import { runtimeRouteOverrides } from "../runtime/builtin-overrides";
13
-
14
- type PageConfig = {
15
- code?: string;
16
- name?: string;
17
- description?: string;
18
- route?: {
19
- pathKey?: string;
20
- [key: string]: unknown;
21
- };
22
- entry?: {
23
- mode?: string;
24
- hidePlatformNav?: boolean;
25
- defaultRoute?: string;
26
- [key: string]: unknown;
27
- };
28
- menu?: {
29
- name?: string;
30
- [key: string]: unknown;
31
- };
32
- publish?: boolean;
33
- [key: string]: unknown;
34
- };
35
-
36
- type RuntimeModule = {
37
- mount?: (el: HTMLElement, context: PageContext) => void | Promise<void>;
38
- update?: (el: HTMLElement, context: PageContext) => void | Promise<void>;
39
- unmount?: (el?: HTMLElement, context?: PageContext) => void | Promise<void>;
40
- default?: RuntimeModule;
41
- };
42
-
43
- type PageOption = {
44
- dirName: string;
45
- config: PageConfig;
46
- module?: RuntimeModule;
47
- };
48
-
49
- type UserProfile = {
50
- id?: string;
51
- username?: string;
52
- name?: string;
53
- tenantId?: string;
54
- departments?: Array<{ id: string; name: string }>;
55
- isGuest?: boolean;
56
- isPlatFormAdmin?: boolean;
57
- isAppAdmin?: boolean;
58
- };
59
-
60
- const configModules = (import.meta as any).glob("../pages/*/page.config.ts", {
61
- eager: true,
62
- }) as Record<string, { default?: PageConfig } & PageConfig>;
63
-
64
- const pageModules = (import.meta as any).glob("../pages/*/index.tsx", {
65
- eager: true,
66
- }) as Record<string, RuntimeModule>;
67
-
68
- const servicePrefix = (process.env.APP_SERVICE_PREFIX || "/service").replace(
69
- /\/+$/,
70
- "",
71
- );
72
-
73
- const appType =
74
- process.env.OPENXIANGDA_APP_TYPE ||
75
- process.env.APP_TYPE ||
76
- "APP_XXXXXXXXXXXXXXXX";
77
-
78
- const hasPlatformProxy = Boolean(
79
- process.env.OPENXIANGDA_BASE_URL || process.env.APP_PLATFORM_URL,
80
- );
81
-
82
- const LOCATION_CHANGE_EVENT = "openxiangda:location-change";
83
-
84
- const getDirName = (path: string) => path.match(/\/pages\/([^/]+)\//)?.[1] || "";
85
-
86
- const getPageIdentity = (page: PageOption) =>
87
- page.config.route?.pathKey || page.config.code || page.dirName;
88
-
89
- const getLocationKey = () =>
90
- `${window.location.pathname}${window.location.search}${window.location.hash}`;
91
-
92
- const emitLocationChange = () => {
93
- window.dispatchEvent(new Event(LOCATION_CHANGE_EVENT));
94
- };
95
-
96
- const setBrowserUrl = (
97
- method: "pushState" | "replaceState",
98
- url: string,
99
- ) => {
100
- window.history[method](null, "", url);
101
- emitLocationChange();
102
- };
103
-
104
- const createSearchParams = (query?: Record<string, unknown>) => {
105
- const params = new URLSearchParams();
106
- Object.entries(query || {}).forEach(([key, value]) => {
107
- if (value === undefined || value === null || value === "") return;
108
- if (Array.isArray(value)) {
109
- value.forEach(item => params.append(key, String(item)));
110
- return;
111
- }
112
- params.set(key, String(value));
113
- });
114
- return params;
115
- };
116
-
117
- const getRouteSegments = (pathname = window.location.pathname) => {
118
- const segments = pathname.split("/").filter(Boolean);
119
- return segments[0] === "view" ? segments.slice(1) : segments;
120
- };
121
-
122
- const getWorkbenchPageKeyFromPath = (pathname = window.location.pathname) => {
123
- const segments = getRouteSegments(pathname);
124
- if (segments[0] === appType && segments[1] === "workbench") {
125
- return segments[2] || "";
126
- }
127
- return "";
128
- };
129
-
130
- const normalizeModule = (moduleValue?: RuntimeModule): RuntimeModule => {
131
- if (moduleValue?.default && (moduleValue.default.mount || moduleValue.default.unmount)) {
132
- return {
133
- ...moduleValue.default,
134
- ...moduleValue,
135
- };
136
- }
137
- return moduleValue || {};
138
- };
139
-
140
- const appendQuery = (url: string, query?: string) => {
141
- if (!query) return url;
142
- return `${url}${url.includes("?") ? "&" : "?"}${query}`;
143
- };
144
-
145
- const normalizeQueryString = (query?: unknown) => {
146
- if (!query) return undefined;
147
- if (typeof query === "string") return query;
148
- if (query instanceof URLSearchParams) return query.toString();
149
- if (typeof query === "object") {
150
- const params = createSearchParams(query as Record<string, unknown>);
151
- return params.toString() || undefined;
152
- }
153
- return String(query);
154
- };
155
-
156
- const joinServicePath = (path: string) => {
157
- if (/^https?:\/\//i.test(path)) return path;
158
- if (path.startsWith(servicePrefix || "/service")) return path;
159
- return `${servicePrefix}${path.startsWith("/") ? path : `/${path}`}`;
160
- };
161
-
162
- const normalizeMethod = (method?: string) => {
163
- const value = String(method || "get").toUpperCase();
164
- return ["GET", "POST", "PUT", "DELETE", "PATCH"].includes(value)
165
- ? value
166
- : "GET";
167
- };
168
-
169
- const parseJsonResponse = async <T,>(response: Response): Promise<PageApiResponse<T>> => {
170
- const payload = await response.json().catch(() => null);
171
- if (!response.ok) {
172
- throw new Error(payload?.message || response.statusText || "请求失败");
173
- }
174
- if (payload && typeof payload === "object" && "code" in payload) {
175
- return {
176
- code: Number(payload.code || response.status),
177
- success: payload.code === 200 || payload.success === true,
178
- message: payload.message,
179
- result: payload.data ?? payload.result ?? null,
180
- data: payload.data,
181
- raw: payload,
182
- };
183
- }
184
- return {
185
- code: response.status,
186
- success: response.ok,
187
- message: response.statusText,
188
- result: payload,
189
- data: payload,
190
- raw: payload,
191
- };
192
- };
193
-
194
- const requestJson = async <T,>(options: PageRequestOptions): Promise<PageApiResponse<T>> => {
195
- const url = appendQuery(joinServicePath(options.path), normalizeQueryString(options.query));
196
- const headers = new Headers(options.headers as HeadersInit);
197
- let body: BodyInit | undefined;
198
- if (options.body !== undefined) {
199
- headers.set("Content-Type", headers.get("Content-Type") || "application/json");
200
- body = JSON.stringify(options.body);
201
- }
202
- const response = await fetch(url, {
203
- method: normalizeMethod(options.method),
204
- headers,
205
- body,
206
- credentials: "include",
207
- });
208
- return parseJsonResponse<T>(response);
209
- };
210
-
211
- const requestBinary = async (
212
- options: PageRequestOptions,
213
- ): Promise<PageBinaryResponse> => {
214
- const url = appendQuery(joinServicePath(options.path), normalizeQueryString(options.query));
215
- const response = await fetch(url, {
216
- method: normalizeMethod(options.method),
217
- headers: options.headers as HeadersInit,
218
- body: options.body === undefined ? undefined : JSON.stringify(options.body),
219
- credentials: "include",
220
- });
221
- if (!response.ok) {
222
- throw new Error(response.statusText || "下载失败");
223
- }
224
- const headers = Object.fromEntries(response.headers.entries());
225
- return {
226
- blob: await response.blob(),
227
- contentType: response.headers.get("content-type") || undefined,
228
- fileName: response.headers.get("content-disposition") || undefined,
229
- headers,
230
- };
231
- };
232
-
233
- const buildRouteInfo = (selected?: PageOption) => {
234
- const url = new URL(window.location.href);
235
- const query: Record<string, string | string[]> = {};
236
- url.searchParams.forEach((value, key) => {
237
- const current = query[key];
238
- if (current === undefined) {
239
- query[key] = value;
240
- } else if (Array.isArray(current)) {
241
- query[key] = [...current, value];
242
- } else {
243
- query[key] = [current, value];
244
- }
245
- });
246
- return {
247
- pathname: url.pathname,
248
- fullPath: `${url.pathname}${url.search}${url.hash}`,
249
- params: {
250
- appType,
251
- pageKey: selected?.config.route?.pathKey || selected?.config.code || selected?.dirName,
252
- },
253
- query,
254
- hash: url.hash,
255
- };
256
- };
257
-
258
- const createFallbackUser = (profile?: UserProfile) => ({
259
- id: profile?.id || "local-dev-user",
260
- name: profile?.name || profile?.username || "Local Developer",
261
- username: profile?.username || profile?.name || "local-dev-user",
262
- tenantId: profile?.tenantId || "",
263
- departments: profile?.departments || [],
264
- isGuest: profile?.isGuest || false,
265
- });
266
-
267
- const createPageContext = (
268
- selected: PageOption,
269
- profile: UserProfile | null,
270
- ): PageContext => ({
271
- protocolVersion: "1.0",
272
- app: {
273
- appType,
274
- name: appType,
275
- } as any,
276
- page: {
277
- id: selected.config.code || selected.dirName,
278
- code: selected.config.code || selected.dirName,
279
- name: selected.config.name || selected.dirName,
280
- type: "custom",
281
- rendererType: "custom_bundle",
282
- routeKey:
283
- selected.config.route?.pathKey || selected.config.code || selected.dirName,
284
- legacyFormUuid: selected.config.code || selected.dirName,
285
- status: "local",
286
- props: {},
287
- route: selected.config.route || {},
288
- entry: selected.config.entry || {},
289
- dataSources: [],
290
- capabilities: {},
291
- },
292
- user: createFallbackUser(profile || undefined) as any,
293
- route: buildRouteInfo(selected),
294
- env: {
295
- mode: "local",
296
- servicePrefix,
297
- },
298
- permissions: {
299
- canView: true,
300
- hasFullAccess: true,
301
- } as any,
302
- capabilities: ["navigation", "ui.message", "ui.modal", "transport.request", "transport.download"],
303
- ui: {
304
- message: {
305
- success: (text: string) => message.success(text),
306
- error: (text: string) => message.error(text),
307
- warning: (text: string) => message.warning(text),
308
- info: (text: string) => message.info(text),
309
- loading: (text: string) => {
310
- const hide = message.loading(text, 0);
311
- return () => {
312
- if (typeof hide === "function") hide();
313
- };
314
- },
315
- },
316
- modal: {
317
- confirm: (input: { title: string; content: string }) =>
318
- new Promise<boolean>(resolve => {
319
- Modal.confirm({
320
- title: input.title,
321
- content: input.content,
322
- onOk: () => resolve(true),
323
- onCancel: () => resolve(false),
324
- });
325
- }),
326
- },
327
- },
328
- navigation: {
329
- pushPage: (pageKey: string, query?: Record<string, unknown>) => {
330
- const params = createSearchParams(query);
331
- setBrowserUrl(
332
- "pushState",
333
- `/view/${appType}/workbench/${pageKey}${params.size ? `?${params}` : ""}`,
334
- );
335
- },
336
- replacePage: (pageKey: string, query?: Record<string, unknown>) => {
337
- const params = createSearchParams(query);
338
- setBrowserUrl(
339
- "replaceState",
340
- `/view/${appType}/workbench/${pageKey}${params.size ? `?${params}` : ""}`,
341
- );
342
- },
343
- pushRoute: (route: string) => {
344
- const url = new URL(window.location.href);
345
- url.searchParams.set("route", route);
346
- setBrowserUrl("pushState", `${url.pathname}${url.search}${url.hash}`);
347
- },
348
- replaceRoute: (route: string) => {
349
- const url = new URL(window.location.href);
350
- url.searchParams.set("route", route);
351
- setBrowserUrl("replaceState", `${url.pathname}${url.search}${url.hash}`);
352
- },
353
- updateQuery: (query: Record<string, unknown>) => {
354
- const url = new URL(window.location.href);
355
- Object.entries(query || {}).forEach(([key, value]) => {
356
- if (value === undefined || value === null || value === "") {
357
- url.searchParams.delete(key);
358
- } else {
359
- url.searchParams.set(key, String(value));
360
- }
361
- });
362
- setBrowserUrl("replaceState", `${url.pathname}${url.search}${url.hash}`);
363
- },
364
- setHash: (hash: string) => {
365
- window.location.hash = hash ? (hash.startsWith("#") ? hash : `#${hash}`) : "";
366
- },
367
- back: () => window.history.back(),
368
- },
369
- bridge: {
370
- invoke: async <T = unknown>(method: string, payload?: unknown): Promise<T> => {
371
- if (method === "transport.request") {
372
- return (await requestJson((payload || {}) as PageRequestOptions)) as T;
373
- }
374
- if (method === "transport.download") {
375
- return (await requestBinary((payload || {}) as PageRequestOptions)) as T;
376
- }
377
- throw new Error(`不支持的 bridge 方法: ${method}`);
378
- },
379
- },
380
- sdk: {
381
- packageName: "openxiangda",
382
- supportedBridgeMethods: ["transport.request", "transport.download"],
383
- },
384
- });
385
-
386
- const discoverPages = (): PageOption[] => {
387
- return Object.entries(configModules)
388
- .map(([configPath, moduleValue]) => {
389
- const dirName = getDirName(configPath);
390
- const modulePath = `../pages/${dirName}/index.tsx`;
391
- const config = moduleValue.default || moduleValue;
392
- return {
393
- dirName,
394
- config,
395
- module: normalizeModule(pageModules[modulePath]),
396
- };
397
- })
398
- .filter(item => item.dirName && item.config.publish !== false)
399
- .sort((left, right) =>
400
- String(left.config.name || left.dirName).localeCompare(
401
- String(right.config.name || right.dirName),
402
- "zh-Hans-CN",
403
- ),
404
- );
405
- };
406
-
407
- const findPageByIdentity = (pages: PageOption[], identity: string) =>
408
- pages.find(
409
- page =>
410
- page.config.code === identity ||
411
- page.config.route?.pathKey === identity ||
412
- page.dirName === identity,
413
- );
414
-
415
- const getRuntimePermission = (route?: BrowserRuntimeRouteResolution | null) => {
416
- const permission = route?.runtime?.permission;
417
- return permission && typeof permission === "object"
418
- ? (permission as { canView?: unknown; message?: unknown })
419
- : undefined;
420
- };
421
-
422
- const isRuntimePermissionDenied = (route?: BrowserRuntimeRouteResolution | null) =>
423
- getRuntimePermission(route)?.canView === false;
424
-
425
- const getRuntimePermissionMessage = (route: BrowserRuntimeRouteResolution) =>
426
- String(
427
- route.message ||
428
- getRuntimePermission(route)?.message ||
429
- "您没有权限访问当前页面",
430
- );
431
-
432
- const RuntimeRouteNotice = ({
433
- route,
434
- routeError,
435
- resolving,
436
- }: {
437
- route: BrowserRuntimeRouteResolution | null;
438
- routeError: string;
439
- resolving: boolean;
440
- }) => {
441
- if (resolving) {
442
- return (
443
- <Alert
444
- type="info"
445
- showIcon
446
- message="正在解析 /view 路由..."
447
- style={{ margin: 16 }}
448
- />
449
- );
450
- }
451
-
452
- if (routeError) {
453
- return (
454
- <Alert
455
- type="warning"
456
- showIcon
457
- message="后端 runtime route resolver 不可用"
458
- description={routeError}
459
- style={{ margin: 16 }}
460
- />
461
- );
462
- }
463
-
464
- if (!route) return null;
465
-
466
- if (isRuntimePermissionDenied(route)) {
467
- return (
468
- <Alert
469
- type="warning"
470
- showIcon
471
- message={getRuntimePermissionMessage(route)}
472
- style={{ margin: 16 }}
473
- />
474
- );
475
- }
476
-
477
- if (route.mode === "builtin-route") {
478
- return null;
479
- }
480
-
481
- if (route.mode === "legacy-fallback") {
482
- return (
483
- <Alert
484
- type="info"
485
- showIcon
486
- message="后端建议走旧 view fallback"
487
- description={route.fallback?.reason || route.message || "legacy-fallback"}
488
- style={{ margin: 16 }}
489
- />
490
- );
491
- }
492
-
493
- if (route.mode === "not-found") {
494
- return (
495
- <Alert
496
- type="warning"
497
- showIcon
498
- message="后端未识别该 runtime 路由"
499
- description={route.message || route.path}
500
- style={{ margin: 16 }}
501
- />
502
- );
503
- }
504
-
505
- return null;
506
- };
507
-
508
- export default function App() {
509
- const pages = useMemo(discoverPages, []);
510
- const [selectedCode, setSelectedCode] = useState(
511
- () => getWorkbenchPageKeyFromPath() || (pages[0] ? getPageIdentity(pages[0]) : ""),
512
- );
513
- const [profile, setProfile] = useState<UserProfile | null>(null);
514
- const [profileLoading, setProfileLoading] = useState(false);
515
- const [targetUserId, setTargetUserId] = useState("");
516
- const [mountError, setMountError] = useState("");
517
- const [mountSeed, setMountSeed] = useState(0);
518
- const [locationKey, setLocationKey] = useState(() => getLocationKey());
519
- const [routeResolution, setRouteResolution] =
520
- useState<BrowserRuntimeRouteResolution | null>(null);
521
- const [routeResolving, setRouteResolving] = useState(false);
522
- const [routeError, setRouteError] = useState("");
523
- const mountRef = useRef<HTMLDivElement | null>(null);
524
-
525
- const selected = useMemo(
526
- () => findPageByIdentity(pages, selectedCode),
527
- [pages, selectedCode],
528
- );
529
-
530
- const shouldBlockLocalMount =
531
- isRuntimePermissionDenied(routeResolution) ||
532
- routeResolution?.mode === "builtin-route" ||
533
- routeResolution?.kind === "work-center" ||
534
- (routeResolution?.mode === "not-found" &&
535
- routeResolution.params?.routeAppType !== undefined);
536
- const shouldRenderBuiltinRoute = routeResolution?.mode === "builtin-route";
537
- const localMountBlockedDescription = isRuntimePermissionDenied(routeResolution)
538
- ? "当前用户没有权限访问该页面"
539
- : "当前路由不挂载本地代码页";
540
-
541
- const handleSelectPage = (value: string) => {
542
- setSelectedCode(value);
543
- setBrowserUrl("pushState", `/view/${appType}/workbench/${value}`);
544
- };
545
-
546
- const loadProfile = async () => {
547
- setProfileLoading(true);
548
- try {
549
- const response = await requestJson<UserProfile>({
550
- path: "/api/auth/profile",
551
- method: "post",
552
- body: { appType },
553
- });
554
- setProfile((response.result || response.data || null) as UserProfile | null);
555
- if (response.success) {
556
- message.success("已读取当前登录用户");
557
- }
558
- } catch (error: any) {
559
- setProfile(null);
560
- message.warning(error?.message || "未读取到当前登录用户");
561
- } finally {
562
- setProfileLoading(false);
563
- }
564
- };
565
-
566
- const loginAsTargetUser = async () => {
567
- const normalizedTarget = targetUserId.trim();
568
- if (!normalizedTarget) {
569
- message.warning("请输入目标用户 ID");
570
- return;
571
- }
572
- const redirectPageKey =
573
- (selected ? getPageIdentity(selected) : selectedCode) ||
574
- getWorkbenchPageKeyFromPath();
575
- const redirectUri = `${window.location.origin}/view/${appType}/workbench/${
576
- redirectPageKey || ""
577
- }`;
578
- const response = await requestJson<{ loginUrl: string; expireIn: number }>({
579
- path: `/openxiangda-api/v1/apps/${appType}/verification-login-links`,
580
- method: "post",
581
- body: {
582
- targetUserId: normalizedTarget,
583
- redirectUri,
584
- purpose: "workspace-dev-preview",
585
- },
586
- });
587
- const loginUrl = response.result?.loginUrl || response.data?.loginUrl;
588
- if (!loginUrl) {
589
- throw new Error(response.message || "未生成登录链接");
590
- }
591
- window.location.href = loginUrl;
592
- };
593
-
594
- useEffect(() => {
595
- void loadProfile();
596
- }, []);
597
-
598
- useEffect(() => {
599
- const syncLocation = () => setLocationKey(getLocationKey());
600
- window.addEventListener("popstate", syncLocation);
601
- window.addEventListener(LOCATION_CHANGE_EVENT, syncLocation);
602
- return () => {
603
- window.removeEventListener("popstate", syncLocation);
604
- window.removeEventListener(LOCATION_CHANGE_EVENT, syncLocation);
605
- };
606
- }, []);
607
-
608
- useEffect(() => {
609
- let cancelled = false;
610
-
611
- const resolveRoute = async () => {
612
- const pageKey = getWorkbenchPageKeyFromPath();
613
- if (pageKey) {
614
- setSelectedCode(pageKey);
615
- }
616
-
617
- if (!hasPlatformProxy) {
618
- setRouteResolution(null);
619
- setRouteError("");
620
- setRouteResolving(false);
621
- return;
622
- }
623
-
624
- setRouteResolving(true);
625
- setRouteError("");
626
- try {
627
- const route = await resolveBrowserRuntimeRoute({
628
- appType,
629
- path: window.location.pathname,
630
- search: window.location.search,
631
- servicePrefix,
632
- });
633
- if (cancelled) return;
634
- setRouteResolution(route);
635
- const resolvedPageKey = route.params?.pageKey || pageKey;
636
- if (
637
- resolvedPageKey &&
638
- (route.kind === "custom-page" || route.kind === "legacy-workbench")
639
- ) {
640
- setSelectedCode(resolvedPageKey);
641
- }
642
- } catch (error: any) {
643
- if (!cancelled) {
644
- setRouteResolution(null);
645
- setRouteError(error?.message || "解析运行时路由失败");
646
- }
647
- } finally {
648
- if (!cancelled) {
649
- setRouteResolving(false);
650
- }
651
- }
652
- };
653
-
654
- void resolveRoute();
655
-
656
- return () => {
657
- cancelled = true;
658
- };
659
- }, [locationKey]);
660
-
661
- useEffect(() => {
662
- let cancelled = false;
663
- let cleanup: (() => Promise<void> | void) | undefined;
664
-
665
- const mount = async () => {
666
- setMountError("");
667
- const host = mountRef.current;
668
- if (!host) return;
669
- host.innerHTML = "";
670
- if (shouldBlockLocalMount) return;
671
- if (!selected) {
672
- if (selectedCode) {
673
- setMountError(`本地 src/pages 中没有找到页面: ${selectedCode}`);
674
- }
675
- return;
676
- }
677
- const moduleValue = selected.module;
678
- if (!moduleValue?.mount) {
679
- setMountError(`页面 ${selected.dirName} 缺少 index.tsx runtime export`);
680
- return;
681
- }
682
- const context = createPageContext(selected, profile);
683
- try {
684
- await moduleValue.mount(host, context);
685
- cleanup = async () => {
686
- await moduleValue.unmount?.(host, context);
687
- host.innerHTML = "";
688
- };
689
- } catch (error: any) {
690
- if (!cancelled) {
691
- setMountError(error?.message || "本地页面挂载失败");
692
- }
693
- }
694
- };
695
-
696
- void mount();
697
-
698
- return () => {
699
- cancelled = true;
700
- void cleanup?.();
701
- };
702
- }, [selected, profile, mountSeed, selectedCode, shouldBlockLocalMount]);
703
-
704
- return (
705
- <main style={{ minHeight: "100vh", background: "#f7f8fb" }}>
706
- <header
707
- style={{
708
- display: "flex",
709
- alignItems: "center",
710
- justifyContent: "space-between",
711
- gap: 16,
712
- padding: "16px 20px",
713
- borderBottom: "1px solid #e5e7eb",
714
- background: "#fff",
715
- position: "sticky",
716
- top: 0,
717
- zIndex: 10,
718
- }}
719
- >
720
- <Space size={16} wrap>
721
- <Typography.Title level={4} style={{ margin: 0 }}>
722
- OpenXiangda Runtime
723
- </Typography.Title>
724
- <Tag color="blue">{appType}</Tag>
725
- <Select
726
- style={{ minWidth: 240 }}
727
- value={selected ? getPageIdentity(selected) : selectedCode || undefined}
728
- placeholder="选择本地页面"
729
- onChange={handleSelectPage}
730
- options={pages.map(page => ({
731
- value: getPageIdentity(page),
732
- label: page.config.name || page.config.code || page.dirName,
733
- }))}
734
- />
735
- <Button
736
- icon={<ReloadOutlined />}
737
- onClick={() => setMountSeed(value => value + 1)}
738
- >
739
- 重新挂载
740
- </Button>
741
- </Space>
742
-
743
- <Space wrap>
744
- <Button loading={profileLoading} onClick={loadProfile}>
745
- {profile?.name || profile?.username || "读取登录态"}
746
- </Button>
747
- <Input
748
- style={{ width: 220 }}
749
- value={targetUserId}
750
- placeholder="目标用户 ID"
751
- onChange={event => setTargetUserId(event.target.value)}
752
- onPressEnter={() => void loginAsTargetUser()}
753
- />
754
- <Button
755
- type="primary"
756
- icon={<UserSwitchOutlined />}
757
- onClick={() => void loginAsTargetUser()}
758
- >
759
- 以该用户打开
760
- </Button>
761
- </Space>
762
- </header>
763
-
764
- {!process.env.OPENXIANGDA_BASE_URL && !process.env.APP_PLATFORM_URL ? (
765
- <Alert
766
- type="warning"
767
- showIcon
768
- message="未配置远端平台地址"
769
- description="设置 OPENXIANGDA_BASE_URL 或 APP_PLATFORM_URL 后,Vite 会代理 /service 并重写 Cookie,SDK 请求才能访问远端后端。"
770
- style={{ margin: 16 }}
771
- />
772
- ) : null}
773
-
774
- {mountError ? (
775
- <Alert type="error" showIcon message={mountError} style={{ margin: 16 }} />
776
- ) : null}
777
-
778
- <RuntimeRouteNotice
779
- route={routeResolution}
780
- routeError={routeError}
781
- resolving={routeResolving}
782
- />
783
-
784
- {shouldRenderBuiltinRoute ? (
785
- <BuiltinRouteRenderer
786
- route={routeResolution}
787
- appType={appType}
788
- servicePrefix={servicePrefix}
789
- overrides={runtimeRouteOverrides}
790
- style={{ minHeight: "calc(100vh - 73px)" }}
791
- />
792
- ) : pages.length === 0 ? (
793
- <Card style={{ margin: 16 }}>
794
- <Empty
795
- description={
796
- <span>
797
- 在 <Typography.Text code>src/pages/&lt;page&gt;</Typography.Text>{" "}
798
- 下添加 <Typography.Text code>index.tsx</Typography.Text>、
799
- <Typography.Text code>App.tsx</Typography.Text> 和{" "}
800
- <Typography.Text code>page.config.ts</Typography.Text> 后即可本地预览。
801
- </span>
802
- }
803
- />
804
- </Card>
805
- ) : (
806
- <section style={{ minHeight: "calc(100vh - 73px)" }}>
807
- {shouldBlockLocalMount ? (
808
- <div style={{ padding: 16 }}>
809
- <Empty description={localMountBlockedDescription} />
810
- </div>
811
- ) : !selected && !selectedCode ? (
812
- <Spin style={{ margin: 32 }} />
813
- ) : (
814
- <div ref={mountRef} style={{ minHeight: "calc(100vh - 73px)" }} />
815
- )}
816
- </section>
817
- )}
818
- </main>
819
- );
820
- }