soma-kit 0.1.15 → 0.1.16

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 (470) hide show
  1. package/README.md +1 -1
  2. package/package.json +8 -5
  3. package/packs/ai/model-card.ts +3 -3
  4. package/packs/ops/error-budget-card.ts +3 -3
  5. package/packs/ops/release-readiness-card.ts +3 -3
  6. package/packs/security/control-evidence-card.ts +3 -3
  7. package/packs/security/finding-card.ts +3 -2
  8. package/packs/shared/card-util.ts +17 -0
  9. package/spec/generated/kit-app.schema.json +2148 -340
  10. package/spec/generated/kit-page.schema.json +1134 -139
  11. package/spec/kit-grammar.json +934 -92
  12. package/spec/kit-grammar.schema.json +167 -2
  13. package/src/app/app-config.ts +219 -186
  14. package/src/app/define-kit-actions.ts +126 -20
  15. package/src/app/define-kit-app.ts +49 -4
  16. package/src/app/index.ts +5 -0
  17. package/src/app/kit-view-context.ts +39 -1
  18. package/src/app/list-page-defaults.ts +14 -0
  19. package/src/app/server-pages.ts +239 -7
  20. package/src/app/server.ts +466 -25
  21. package/src/app/theme-endpoint.ts +67 -23
  22. package/src/app/theme-runtime.ts +414 -85
  23. package/src/app/theme-shards.ts +69 -0
  24. package/src/app/tier-compat.ts +107 -0
  25. package/src/base/action-busy.ts +215 -38
  26. package/src/base/affix.ts +137 -0
  27. package/src/base/alert.ts +104 -59
  28. package/src/base/anchored-layer.ts +7 -6
  29. package/src/base/avatar.ts +147 -61
  30. package/src/base/badge.ts +186 -0
  31. package/src/base/button-group.ts +227 -0
  32. package/src/base/button.ts +347 -50
  33. package/src/base/card.ts +233 -0
  34. package/src/base/cascader.ts +143 -32
  35. package/src/base/check-core.ts +193 -33
  36. package/src/base/checkbox.ts +67 -2
  37. package/src/base/choice.ts +132 -31
  38. package/src/base/collapse.ts +249 -0
  39. package/src/base/color-picker.ts +399 -27
  40. package/src/base/combobox.ts +6 -2
  41. package/src/base/command-palette.ts +148 -36
  42. package/src/base/context-menu.ts +23 -6
  43. package/src/base/countdown.ts +37 -15
  44. package/src/base/date-range.ts +114 -96
  45. package/src/base/date.ts +481 -74
  46. package/src/base/delta.ts +16 -9
  47. package/src/base/divider.ts +51 -33
  48. package/src/base/end-edge.ts +10 -4
  49. package/src/base/fab.ts +57 -21
  50. package/src/base/gap-value.ts +34 -15
  51. package/src/base/hint-tips.ts +99 -29
  52. package/src/base/identity-cells.ts +839 -0
  53. package/src/base/illustrations.ts +6 -4
  54. package/src/base/image.ts +40 -19
  55. package/src/base/index.ts +79 -22
  56. package/src/base/inline-error.ts +13 -7
  57. package/src/base/input.ts +135 -35
  58. package/src/base/kbd.ts +30 -17
  59. package/src/base/kit-contract.ts +400 -0
  60. package/src/base/link.ts +41 -20
  61. package/src/base/listbox-core.ts +282 -101
  62. package/src/base/loading-gate.ts +3 -0
  63. package/src/base/look.ts +197 -0
  64. package/src/base/mentions.ts +55 -22
  65. package/src/base/menu-button.ts +73 -22
  66. package/src/base/menu-core.ts +201 -24
  67. package/src/base/month-grid.ts +60 -3
  68. package/src/base/motion/aura.ts +52 -10
  69. package/src/base/motion/hover-3d.ts +7 -5
  70. package/src/base/motion/hover-gallery.ts +16 -12
  71. package/src/base/motion/limits.ts +10 -0
  72. package/src/base/motion/marquee.ts +18 -11
  73. package/src/base/motion/text-rotate.ts +34 -16
  74. package/src/base/notification.ts +292 -0
  75. package/src/base/number.ts +93 -12
  76. package/src/base/otp.ts +139 -27
  77. package/src/base/overlay-runtime.ts +30 -23
  78. package/src/base/overlay-shell.ts +59 -14
  79. package/src/base/period-picker.ts +868 -0
  80. package/src/base/popover.ts +624 -73
  81. package/src/base/popup.ts +187 -52
  82. package/src/base/portal-core.ts +99 -2
  83. package/src/base/price-text.ts +51 -17
  84. package/src/base/progress.ts +100 -18
  85. package/src/base/qr-code.ts +64 -17
  86. package/src/base/qty-stepper.ts +141 -22
  87. package/src/base/radio.ts +43 -2
  88. package/src/base/range.ts +194 -39
  89. package/src/base/rating.ts +117 -31
  90. package/src/base/reason-tip.ts +58 -16
  91. package/src/base/relation-cells.ts +541 -0
  92. package/src/base/resize-handle.ts +5 -3
  93. package/src/base/row-fresh.ts +84 -0
  94. package/src/base/section-spy.ts +79 -0
  95. package/src/base/segmented.ts +70 -26
  96. package/src/base/select.ts +8 -3
  97. package/src/base/shared.ts +482 -71
  98. package/src/base/spinner.ts +107 -0
  99. package/src/base/state-panel.ts +77 -22
  100. package/src/base/sticky-edge.ts +96 -29
  101. package/src/base/swap.ts +39 -21
  102. package/src/base/switch.ts +158 -38
  103. package/src/base/tabs.ts +292 -0
  104. package/src/base/tag-input.ts +123 -54
  105. package/src/base/tag.ts +184 -66
  106. package/src/base/text.ts +461 -71
  107. package/src/base/textarea.ts +88 -39
  108. package/src/base/time-picker.ts +335 -55
  109. package/src/base/time-range.ts +846 -0
  110. package/src/base/tree-select.ts +342 -88
  111. package/src/base/upload.ts +604 -158
  112. package/src/base/view-transition.ts +7 -3
  113. package/src/base/virtual-list.ts +49 -14
  114. package/src/biz/approval-desk/compile.ts +70 -5
  115. package/src/biz/approval-desk/index.ts +2 -0
  116. package/src/biz/approval-desk/shell.ts +52 -12
  117. package/src/biz/auth-panel/compile.ts +13 -3
  118. package/src/biz/auth-panel/shell.ts +27 -7
  119. package/src/biz/category-crud/compile.ts +51 -13
  120. package/src/biz/category-crud/index.ts +2 -0
  121. package/src/biz/category-crud/shell.ts +29 -9
  122. package/src/biz/checkout-page/compile.ts +37 -3
  123. package/src/biz/checkout-page/index.ts +1 -0
  124. package/src/biz/checkout-page/shell.ts +26 -9
  125. package/src/biz/compose.ts +6 -1
  126. package/src/biz/data-components.ts +2 -0
  127. package/src/biz/import-wizard/compile.ts +4 -1
  128. package/src/biz/import-wizard/index.ts +1 -0
  129. package/src/biz/import-wizard/shell.ts +32 -18
  130. package/src/biz/index.ts +1 -1
  131. package/src/biz/landing-page/compile.ts +3 -2
  132. package/src/biz/landing-page/shell.ts +22 -3
  133. package/src/biz/layout-contracts.ts +918 -0
  134. package/src/biz/link/hub.ts +199 -8
  135. package/src/biz/link/shared.ts +54 -15
  136. package/src/biz/master-sub/compile.ts +194 -57
  137. package/src/biz/master-sub/detail-head.ts +141 -18
  138. package/src/biz/master-sub/index.ts +3 -0
  139. package/src/biz/master-sub/shell.ts +186 -57
  140. package/src/biz/multi-board/compile.ts +87 -36
  141. package/src/biz/multi-board/composition.ts +7 -20
  142. package/src/biz/multi-board/index.ts +3 -2
  143. package/src/biz/multi-board/prose-fold.ts +15 -11
  144. package/src/biz/multi-board/shell.ts +148 -37
  145. package/src/biz/notification-center/compile.ts +20 -6
  146. package/src/biz/notification-center/index.ts +2 -0
  147. package/src/biz/notification-center/shell.ts +43 -10
  148. package/src/biz/page-templates/domain-templates.ts +145 -22
  149. package/src/biz/page-templates/result-page/compile.ts +4 -1
  150. package/src/biz/page-templates/result-page/index.ts +1 -0
  151. package/src/biz/page-templates/result-page/shell.ts +17 -4
  152. package/src/biz/page-templates/sign-in-page/compile.ts +19 -8
  153. package/src/biz/page-templates/sign-in-page/index.ts +1 -0
  154. package/src/biz/page-templates/sign-in-page/shell.ts +28 -12
  155. package/src/biz/record-detail/compile.ts +39 -11
  156. package/src/biz/record-detail/index.ts +1 -0
  157. package/src/biz/record-detail/shell.ts +41 -10
  158. package/src/biz/settings-center/compile.ts +4 -1
  159. package/src/biz/settings-center/index.ts +1 -0
  160. package/src/biz/settings-center/shell.ts +30 -9
  161. package/src/biz/shared/action-host.ts +137 -46
  162. package/src/biz/shared/compile-helpers.ts +130 -28
  163. package/src/biz/shared/coordinator.ts +628 -147
  164. package/src/biz/shared/focus-return.ts +180 -0
  165. package/src/biz/shared/object-aliases.ts +7 -1
  166. package/src/biz/shared/overlay-compile.ts +58 -10
  167. package/src/biz/shared/overlay-shell.ts +40 -10
  168. package/src/biz/shared/page-form-actions.ts +151 -0
  169. package/src/biz/shared/page-form.ts +255 -0
  170. package/src/biz/shared/pipeline.ts +74 -0
  171. package/src/biz/shared/runtime-hub.ts +101 -8
  172. package/src/biz/shared/verbs.ts +129 -0
  173. package/src/biz/single-form/compile.ts +4 -2
  174. package/src/biz/single-form/index.ts +2 -0
  175. package/src/biz/single-form/shell.ts +21 -11
  176. package/src/biz/standard-crud/compile.ts +206 -38
  177. package/src/biz/standard-crud/index.ts +2 -1
  178. package/src/biz/standard-crud/shell.ts +82 -22
  179. package/src/biz/standard-crud/summary.ts +2 -37
  180. package/src/biz/step-form/compile.ts +12 -3
  181. package/src/biz/step-form/hub.ts +165 -50
  182. package/src/biz/step-form/index.ts +1 -0
  183. package/src/biz/step-form/shell.ts +31 -15
  184. package/src/biz/types.ts +40 -4
  185. package/src/cli/kit-cli.ts +145 -26
  186. package/src/cli/kit-init.ts +3 -3
  187. package/src/cli/migrate/theme-map.ts +35 -28
  188. package/src/cli/migrate/ts-rules.ts +2 -2
  189. package/src/cli/migrate/types.ts +3 -3
  190. package/src/cli/migrate/yaml-rules.ts +11 -9
  191. package/src/cli/view-writes.ts +13 -0
  192. package/src/compile/closed-set.ts +102 -6
  193. package/src/compile/compile-page.ts +446 -53
  194. package/src/compile/component-candidates.ts +56 -4
  195. package/src/compile/danger-tier.ts +65 -0
  196. package/src/compile/hints.ts +1 -1
  197. package/src/compile/info-structure.ts +155 -0
  198. package/src/compile/layout-lint/rules-composition.ts +2 -1
  199. package/src/compile/layout-lint/rules-table.ts +4 -19
  200. package/src/compile/look-page.ts +551 -0
  201. package/src/compile/look.ts +376 -0
  202. package/src/compile/page-composition.ts +382 -46
  203. package/src/compile/page-hierarchy.ts +131 -0
  204. package/src/compile/page-pipeline-look.ts +156 -0
  205. package/src/compile/page-pipeline.ts +200 -0
  206. package/src/compile/parse.ts +12 -11
  207. package/src/compile/relation-render.ts +120 -0
  208. package/src/compile/remove-guard.ts +115 -41
  209. package/src/compile/stages.ts +645 -28
  210. package/src/compile/styles.ts +226 -26
  211. package/src/compile/types.ts +62 -5
  212. package/src/compile/view-check.ts +190 -1
  213. package/src/data/access-gate.ts +17 -9
  214. package/src/data/amount-breakdown.ts +49 -22
  215. package/src/data/anchor-nav.ts +73 -15
  216. package/src/data/approval-flow.ts +210 -124
  217. package/src/data/assignment-picker.ts +163 -85
  218. package/src/data/async-result-panel.ts +110 -46
  219. package/src/data/audit-log.ts +461 -0
  220. package/src/data/breadcrumbs.ts +141 -19
  221. package/src/data/calendar.ts +434 -96
  222. package/src/data/card-grid.ts +319 -0
  223. package/src/data/carousel.ts +72 -38
  224. package/src/data/cell-value.ts +253 -0
  225. package/src/data/chart.ts +904 -77
  226. package/src/data/checklist.ts +78 -35
  227. package/src/data/code-view.ts +106 -48
  228. package/src/data/comment-thread.ts +607 -87
  229. package/src/data/compare-view.ts +227 -0
  230. package/src/data/confirm-dialog.ts +198 -30
  231. package/src/data/context-menu.ts +95 -21
  232. package/src/data/d9-limits.ts +2 -0
  233. package/src/data/d9-util.ts +13 -5
  234. package/src/data/diff.ts +107 -50
  235. package/src/data/display-util.ts +9 -4
  236. package/src/data/dock.ts +33 -17
  237. package/src/data/embed.ts +142 -7
  238. package/src/data/engine-ports.ts +13 -4
  239. package/src/data/field-mapper.ts +104 -48
  240. package/src/data/file-list.ts +522 -0
  241. package/src/data/flow-editor.ts +603 -142
  242. package/src/data/flow-node-options.ts +24 -5
  243. package/src/data/flow-remote-options.ts +94 -19
  244. package/src/data/footer.ts +85 -27
  245. package/src/data/form-draft-registry.ts +183 -12
  246. package/src/data/gantt.ts +637 -117
  247. package/src/data/graph-view.ts +51 -0
  248. package/src/data/heat-calendar.ts +412 -0
  249. package/src/data/hero.ts +38 -15
  250. package/src/data/image-viewer.ts +261 -62
  251. package/src/data/index.ts +63 -1
  252. package/src/data/item-list.ts +217 -57
  253. package/src/data/json-view.ts +165 -100
  254. package/src/data/kanban.ts +339 -87
  255. package/src/data/kit-contract.ts +230 -0
  256. package/src/data/leaderboard.ts +343 -0
  257. package/src/data/level-class.ts +21 -0
  258. package/src/data/log-stream.ts +347 -0
  259. package/src/data/markdown-view.ts +155 -45
  260. package/src/data/matrix.ts +217 -112
  261. package/src/data/media-grid.ts +162 -38
  262. package/src/data/mega-menu.ts +39 -23
  263. package/src/data/menu-bar.ts +254 -0
  264. package/src/data/menu-dom.ts +50 -15
  265. package/src/data/menu.ts +131 -47
  266. package/src/data/mockup.ts +30 -22
  267. package/src/data/modal-dialog.ts +90 -13
  268. package/src/data/navbar.ts +143 -61
  269. package/src/data/notice-list.ts +100 -48
  270. package/src/data/notify-renderer.ts +61 -7
  271. package/src/data/object-form.ts +1389 -130
  272. package/src/data/org-chart.ts +544 -0
  273. package/src/data/outcome-watch.ts +90 -21
  274. package/src/data/pager.ts +122 -42
  275. package/src/data/panel-head.ts +237 -75
  276. package/src/data/permission-matrix.ts +371 -119
  277. package/src/data/permission-tree.ts +135 -80
  278. package/src/data/pricing-table.ts +106 -42
  279. package/src/data/prompt-dialog.ts +49 -21
  280. package/src/data/reaction-bar.ts +63 -31
  281. package/src/data/record-card.ts +239 -70
  282. package/src/data/record-picker.ts +56 -27
  283. package/src/data/redirect.ts +39 -15
  284. package/src/data/request-console.ts +131 -41
  285. package/src/data/resident.ts +11 -1
  286. package/src/data/result-panel.ts +65 -27
  287. package/src/data/rich-text.ts +206 -35
  288. package/src/data/row-confirm.ts +47 -0
  289. package/src/data/row-editor.ts +376 -102
  290. package/src/data/rule-builder.ts +129 -80
  291. package/src/data/schedule-grid.ts +238 -0
  292. package/src/data/segment-bar.ts +221 -0
  293. package/src/data/shape-util.ts +86 -43
  294. package/src/data/stage-flow.ts +244 -0
  295. package/src/data/staged-rows.ts +207 -24
  296. package/src/data/stat-group.ts +438 -86
  297. package/src/data/static-lazy.ts +18 -0
  298. package/src/data/static-registry.ts +38 -2
  299. package/src/data/status-strip.ts +171 -0
  300. package/src/data/steps.ts +63 -34
  301. package/src/data/summary-strip.ts +136 -0
  302. package/src/data/summary-util.ts +116 -0
  303. package/src/data/survey.ts +128 -47
  304. package/src/data/system-switcher.ts +40 -20
  305. package/src/data/target-progress.ts +208 -0
  306. package/src/data/text-action-button.ts +28 -7
  307. package/src/data/text-diff.ts +99 -31
  308. package/src/data/tile-grid.ts +343 -0
  309. package/src/data/timeline.ts +205 -36
  310. package/src/data/tour-guide.ts +110 -47
  311. package/src/data/transfer.ts +195 -47
  312. package/src/data/tree-table.ts +194 -112
  313. package/src/data/tree.ts +191 -70
  314. package/src/data/trend-line.ts +68 -12
  315. package/src/data/virtual-rows.ts +242 -102
  316. package/src/data/waterfall.ts +171 -0
  317. package/src/data/watermark.ts +35 -6
  318. package/src/data/wrap.ts +26 -4
  319. package/src/frames/blank-frame.ts +6 -4
  320. package/src/frames/index.ts +1 -2
  321. package/src/frames/inherited-shell.ts +54 -13
  322. package/src/frames/page-bar.ts +205 -27
  323. package/src/frames/page-status.ts +3 -2
  324. package/src/frames/resident-components.ts +0 -2
  325. package/src/frames/shared.ts +64 -21
  326. package/src/frames/single-frame.ts +20 -4
  327. package/src/frames/split-frame/shell.ts +11 -7
  328. package/src/frames/split-frame/wiring.ts +14 -10
  329. package/src/frames/tabs-frame/shell.ts +3 -2
  330. package/src/frames/tabs-frame/wiring.ts +2 -1
  331. package/src/frames/top-main-frame.ts +55 -3
  332. package/src/frames/types.ts +2 -0
  333. package/src/frames/workspace-frame/extras.ts +5 -3
  334. package/src/frames/workspace-frame/index.ts +1 -1
  335. package/src/frames/workspace-frame/pipeline-key.ts +6 -0
  336. package/src/frames/workspace-frame/shell.ts +22 -2
  337. package/src/frames/workspace-frame/state.ts +42 -14
  338. package/src/frames/workspace-frame/view.ts +697 -167
  339. package/src/generated/kit-grammar-runtime.ts +1015 -53
  340. package/src/generated/kit-page.ts +272 -0
  341. package/src/i18n/index.ts +2 -0
  342. package/src/i18n/kit-text.ts +96 -3
  343. package/src/object-renderer/action-group.ts +175 -23
  344. package/src/object-renderer/action-more.ts +48 -17
  345. package/src/object-renderer/arrange.ts +241 -29
  346. package/src/object-renderer/category-tone.ts +96 -0
  347. package/src/object-renderer/collapse-wiring.ts +19 -9
  348. package/src/object-renderer/collection-expand.ts +3 -3
  349. package/src/object-renderer/collection-parts.ts +432 -107
  350. package/src/object-renderer/collection-table.ts +347 -45
  351. package/src/object-renderer/collection.ts +291 -62
  352. package/src/object-renderer/compile-data.ts +12 -2
  353. package/src/object-renderer/defaults.ts +6 -5
  354. package/src/object-renderer/emit-events.ts +45 -19
  355. package/src/object-renderer/emit-object.ts +35 -9
  356. package/src/object-renderer/emit-static.ts +734 -159
  357. package/src/object-renderer/filter-plan.ts +3 -3
  358. package/src/object-renderer/filter-toolbar.ts +105 -18
  359. package/src/object-renderer/form-detail.ts +87 -2
  360. package/src/object-renderer/key-field.ts +21 -0
  361. package/src/object-renderer/layout-facts.ts +18 -2
  362. package/src/object-renderer/layout-plan.ts +6 -3
  363. package/src/object-renderer/overlay-decide.ts +44 -2
  364. package/src/object-renderer/pick-component.ts +8 -2
  365. package/src/object-renderer/pipeline-mode.ts +6 -0
  366. package/src/object-renderer/relation-field.ts +79 -0
  367. package/src/object-renderer/render-object.ts +71 -26
  368. package/src/object-renderer/request-actions.ts +119 -21
  369. package/src/object-renderer/table-actions.ts +424 -103
  370. package/src/object-renderer/table-gap.ts +2 -1
  371. package/src/object-renderer/table-reorder.ts +237 -0
  372. package/src/object-renderer/table-summary.ts +26 -12
  373. package/src/object-renderer/table-tools.ts +428 -128
  374. package/src/object-renderer/types.ts +91 -2
  375. package/src/object-renderer/value-present.ts +49 -0
  376. package/src/page-target/ai-surface.ts +15 -22
  377. package/src/page-target/compile.ts +5 -6
  378. package/src/page-target/drift.ts +0 -7
  379. package/src/page-target/intent-schema.ts +46 -43
  380. package/src/page-target/target.ts +4 -5
  381. package/src/page-target/writer-policy.ts +4 -5
  382. package/src/recipes/chrome-surface.ts +20 -0
  383. package/src/recipes/code-view.ts +15 -14
  384. package/src/recipes/color-role.ts +442 -0
  385. package/src/recipes/compact-group.ts +3 -2
  386. package/src/recipes/composition-projector.ts +321 -0
  387. package/src/recipes/container.ts +76 -19
  388. package/src/recipes/control.ts +64 -5
  389. package/src/recipes/desc-list.ts +101 -7
  390. package/src/recipes/divider.ts +30 -9
  391. package/src/recipes/emphasis.ts +90 -5
  392. package/src/recipes/field-text.ts +72 -0
  393. package/src/recipes/form-section.ts +177 -0
  394. package/src/recipes/frame-bleed.ts +3 -2
  395. package/src/recipes/index.ts +28 -4
  396. package/src/recipes/inherited-shell.ts +21 -15
  397. package/src/recipes/json-view.ts +6 -5
  398. package/src/recipes/look.ts +56 -0
  399. package/src/recipes/mark.ts +138 -0
  400. package/src/recipes/markdown.ts +16 -6
  401. package/src/recipes/overlay.ts +47 -19
  402. package/src/recipes/page-width.ts +31 -0
  403. package/src/recipes/pipeline-runtime.ts +366 -0
  404. package/src/recipes/placeholder.ts +37 -19
  405. package/src/recipes/rail-grid.ts +6 -3
  406. package/src/recipes/self-owned.ts +59 -0
  407. package/src/recipes/slot-align.ts +5 -3
  408. package/src/recipes/stat-state.ts +5 -5
  409. package/src/recipes/state.ts +54 -3
  410. package/src/recipes/status.ts +14 -14
  411. package/src/recipes/strip.ts +47 -5
  412. package/src/recipes/surface-edge.ts +3 -1
  413. package/src/recipes/surface.ts +33 -4
  414. package/src/recipes/table-gap.ts +3 -2
  415. package/src/recipes/table-native-edit.ts +22 -9
  416. package/src/recipes/table-row.ts +45 -12
  417. package/src/recipes/tabs.ts +54 -22
  418. package/src/recipes/text-diff.ts +15 -8
  419. package/src/recipes/text-fit.ts +132 -0
  420. package/src/recipes/title-row.ts +68 -3
  421. package/src/shared/action-func.ts +106 -0
  422. package/src/shared/color-scheme.ts +127 -0
  423. package/src/shared/confirm-decl.ts +5 -2
  424. package/src/shared/danger-facts.ts +55 -0
  425. package/src/shared/dom-attrs-registry.ts +1009 -0
  426. package/src/shared/dom-attrs.ts +743 -0
  427. package/src/shared/field-kind.ts +49 -0
  428. package/src/shared/field-value-format.ts +58 -12
  429. package/src/shared/glyphs.ts +127 -0
  430. package/src/shared/icons.ts +28 -1
  431. package/src/shared/identifier-field.ts +66 -0
  432. package/src/shared/list-pager.ts +23 -0
  433. package/src/shared/list-title.ts +29 -0
  434. package/src/shared/order-value.ts +15 -0
  435. package/src/shared/page-attrs-runtime.ts +327 -0
  436. package/src/shared/page-attrs.ts +262 -0
  437. package/src/shared/pipeline-mode.ts +64 -0
  438. package/src/shared/row-key.ts +15 -0
  439. package/src/shared/theme-runtime-shared.ts +165 -24
  440. package/src/shared/theme-usage.ts +16 -0
  441. package/src/shared/value-table-contract.ts +68 -0
  442. package/src/spatial/action-func.ts +4 -0
  443. package/src/spatial/declared-actions.ts +116 -0
  444. package/src/spatial/emit.ts +660 -0
  445. package/src/spatial/expand.ts +1482 -0
  446. package/src/spatial/field-types.ts +48 -0
  447. package/src/spatial/index.ts +82 -0
  448. package/src/spatial/layout.ts +697 -0
  449. package/src/spatial/look-apply.ts +206 -0
  450. package/src/spatial/page-decl.ts +44 -0
  451. package/src/spatial/page-object.ts +349 -0
  452. package/src/spatial/recognize.ts +491 -0
  453. package/src/spatial/self-report.ts +571 -0
  454. package/src/spatial/shape.ts +205 -0
  455. package/src/spatial/spatial-map.ts +136 -0
  456. package/src/spatial/tone.ts +145 -0
  457. package/src/theme/index.ts +11 -2
  458. package/src/theme/kit-theme-text.ts +1 -1
  459. package/src/theme/kit-theme.css +527 -16
  460. package/src/theme/kit-theme.tpl +491 -16
  461. package/src/theme/look-carrier.ts +65 -0
  462. package/src/theme/nine-dim-structure.ts +522 -185
  463. package/src/theme/private-vars.ts +153 -0
  464. package/src/theme/surface-layers.ts +3 -2
  465. package/src/theme/theme-tokens.ts +1601 -93
  466. package/src/theme/theme-types.ts +38 -59
  467. package/src/theme/value-table.ts +2379 -0
  468. package/src/frames/list-summary.ts +0 -123
  469. package/src/recipes/nowrap.ts +0 -16
  470. package/src/theme/block-theme.ts +0 -202
@@ -8,17 +8,19 @@
8
8
  //
9
9
  // 缺分类键不取数:条目的 from 编成 core `from[].require`(requireLink),尚未选分类时对象落 idle,不发请求。
10
10
 
11
+ import { isNextPipeline, kitEditAnchor } from '../shared/pipeline';
11
12
  import type { SomaScopeMirrorDecl } from 'soma-core';
12
- import { stateAnchor, viewAnchor } from '../../object-renderer/emit-static';
13
+ import { metaAnchor, stateAnchor, viewAnchor } from '../../object-renderer/emit-static';
13
14
  import type { KitObject, KitType } from '../../object-renderer/types';
14
15
  import type { KitFragment } from '../../object-renderer/fragment';
15
16
  import type { KitBizContext, KitBizInput } from '../types';
16
17
  import { KIT_COORD_EVENTS, KIT_COORD_MIRRORS } from '../shared/coordinator';
17
18
  import { bizObjectName, finishBizCompile, listPanelBody, validateBizAreaClass } from '../shared/compile-helpers';
18
19
  import { wireDialogForm } from '../shared/pipes';
19
- import { OVERLAY_SHELL_CLASS, dialogHtml, dialogIds, dialogTitles } from '../shared/overlay-shell';
20
+ import { OVERLAY_SHELL_CLASS, dialogHtml, dialogIds } from '../shared/overlay-shell';
20
21
  import { adviseDialogFooter } from '../shared/overlay-compile';
21
- import { dialogWidthOf } from '../../object-renderer/overlay-decide';
22
+ import { dialogWidthOf, editContainerOf } from '../../object-renderer/overlay-decide';
23
+ import { PAGE_FORM_FOCUS_INITIAL, pageBrowsingMirror, wireMainPageForm } from '../shared/page-form';
22
24
  import { KIT_LINK_MIRRORS, KIT_SEL_PATH } from '../link/hub';
23
25
  import {
24
26
  IDENT, classesIn, emitMember, grantPageReset, isRec, keyFieldOf, linkRemoveProps, mirrorPath, newParts,
@@ -26,6 +28,7 @@ import {
26
28
  } from '../link/shared';
27
29
  import { kitText } from '../../i18n/kit-text';
28
30
  import { CategoryCrud } from './index';
31
+ import { applyFlowCopy } from '../shared/verbs';
29
32
  import { CATEGORY_CRUD_AREAS, CATEGORY_CRUD_CLASS, categoryCrudHtml, categoryCrudIds } from './shell';
30
33
 
31
34
  export function categoryObjectName(pageId: string, role: 'category' | 'item'): string {
@@ -49,6 +52,8 @@ export function compileCategoryCrud(input: KitBizInput, ctx: KitBizContext): Kit
49
52
  if (out.diagnostics.length > 0) return finishBizCompile(out, '');
50
53
 
51
54
  const ids = categoryCrudIds(ctx.pageId);
55
+ // 主题流水线新模式:模板只出中性结构容器与锚点(biz/shared/pipeline.ts)
56
+ const next = isNextPipeline(ctx);
52
57
  const areaClass = input.areaClass ?? {};
53
58
  const link = ids.link;
54
59
  const catName = categoryObjectName(ctx.pageId, 'category');
@@ -94,14 +99,19 @@ export function compileCategoryCrud(input: KitBizInput, ctx: KitBizContext): Kit
94
99
  });
95
100
  out.diagnostics.push(...itemNorm.diagnostics);
96
101
  if (out.diagnostics.length > 0) return finishBizCompile(out, '');
97
- const item: KitObject = itemNorm.obj;
102
+ // 动词闭集(B1-7):新建 / 编辑的入口、窗口标题、主按钮由对象名生成;手写且不同的文案报 KIT-IA-004(警告)
103
+ const { object: item, copy: flow } = applyFlowCopy(itemNorm.obj, 'product.objects.item', ctx.locale, ctx.advise);
98
104
 
99
105
  const c = emitMember(out, { object: catName, scope: catScope, obj: cat, ctx, link, hubId: ids.hub, pick: staticView === undefined });
100
106
  const it = emitMember(out, {
101
107
  object: itemName, scope: itemScope, obj: item, ctx, link, hubId: ids.hub,
108
+ // 条目三态面板:监听链接作用域的选中切换(分类树写 selection),选中签名按分类主键(catKey,与枢纽 keyField 同一个)取(契约 C3)
109
+ selectionScope: link,
110
+ selectionKeyField: catKey,
102
111
  emitInput: { formModePath: mirrorPath(link, mk.mode.key), formInitialPath: mirrorPath(link, mk.row.key) },
103
112
  });
104
113
  const pageScopes = grantPageReset(out, itemScope, ids.hub) ? [itemScope] : [];
114
+ const createObjects: Record<string, string> = pageScopes.length > 0 ? { [itemScope]: itemName } : {};
105
115
 
106
116
  // 分类树:select 直接写 selection(Tree 自己是 owner)
107
117
  const treeId = staticView !== undefined ? viewAnchor(catName, 'summary') : undefined;
@@ -117,10 +127,13 @@ export function compileCategoryCrud(input: KitBizInput, ctx: KitBizContext): Kit
117
127
  { key: KIT_LINK_MIRRORS.selRow, slice: 'selection', path: KIT_SEL_PATH, as: 'value' },
118
128
  ];
119
129
  for (const x of [mk.openForm, mk.creating, mk.editing, mk.mode, mk.row, mk.id]) mirrors.push({ key: x.key, slice: 'focus', path: x.path, as: x.as });
130
+ // 新建 / 编辑表单的容器(KT-P-window):对话框,或同页切换的整页表单视图(分类 + 条目区让位)
131
+ const pageForm = item.view?.form !== undefined && editContainerOf({ form: item.view.form, schema: item.schema }).container === 'page';
132
+ if (pageForm) mirrors.push(pageBrowsingMirror());
120
133
  out.scopes[link] = {
121
134
  id: link,
122
135
  object: itemName,
123
- slices: [{ name: 'selection', owner: treeId ?? ids.hub }, { name: 'focus', owner: ids.coord }],
136
+ slices: [{ name: 'selection', owner: treeId ?? ids.hub }, { name: 'focus', owner: ids.coord, ...(pageForm ? { initial: PAGE_FORM_FOCUS_INITIAL } : {}) }],
124
137
  mirrors: sortMirrors(mirrors),
125
138
  };
126
139
 
@@ -130,17 +143,27 @@ export function compileCategoryCrud(input: KitBizInput, ctx: KitBizContext): Kit
130
143
  const formId = viewAnchor(itemName, 'form');
131
144
  const formHtml = it.r.parts.form ?? '';
132
145
  if (formHtml.includes(`data-soma-id="${formId}"`)) {
133
- patchProps(out.show, formId, { scope: `${itemName}__form`, cancelLabel: CANCEL_LABEL });
146
+ patchProps(out.show, formId, { scope: `${itemName}__form`, cancelLabel: CANCEL_LABEL, submitLabel: flow.editSubmit, createLabel: flow.createSubmit });
134
147
  wireDialogForm(out.events, formId, link);
135
148
  }
149
+ }
150
+ if (item.view?.form !== undefined && pageForm) {
151
+ dialog = wireMainPageForm(out, {
152
+ object: itemName, scope: link, formId: viewAnchor(itemName, 'form'), formHtml: it.r.parts.form ?? '',
153
+ ...(next ? { bodyAnchor: kitEditAnchor(itemName) } : {}),
154
+ copy: { create: flow.createTitle, edit: flow.editTitle, submitCreate: flow.createSubmit, submitEdit: flow.editSubmit },
155
+ ...(ctx.locale !== undefined ? { locale: ctx.locale } : {}),
156
+ schema: item.schema, weight: editContainerOf({ form: item.view!.form, schema: item.schema }).weight,
157
+ });
158
+ } else if (item.view?.form !== undefined) {
136
159
  const d = dialogIds(itemName);
137
160
  out.show[d.dialogLayer] = { when: mirrorPath(link, mk.openForm.key) };
138
161
  out.show[d.dialogTitleCreate] = { when: mirrorPath(link, mk.creating.key) };
139
162
  out.show[d.dialogTitleEdit] = { when: mirrorPath(link, mk.editing.key) };
140
163
  out.events[`${d.dialogClose}.click`] = semanticPipe(link, KIT_COORD_EVENTS.close);
141
- const createName = item.behavior.actions?.find((a) => a.builtin === 'openCreate')?.name ?? kitText('soma.kit.create', undefined, ctx.locale);
142
- const editName = item.behavior.actions?.find((a) => a.builtin === 'openEdit')?.name ?? kitText('soma.kit.edit', undefined, ctx.locale);
143
- dialog = dialogHtml(d, dialogTitles(item.view?.form?.title, { create: createName, edit: editName }), it.r.parts.form ?? '', { dialog: areaClass.dialog ?? '' }, CLOSE_LABEL, '', dialogWidthOf({ form: item.view?.form, schema: item.schema }));
164
+ dialog = next
165
+ ? dialogHtml(d, { create: flow.createTitle, edit: flow.editTitle }, it.r.parts.form ?? '', { dialog: areaClass.dialog ?? '' }, CLOSE_LABEL, '', dialogWidthOf({ form: item.view?.form, schema: item.schema }), kitEditAnchor(itemName))
166
+ : dialogHtml(d, { create: flow.createTitle, edit: flow.editTitle }, it.r.parts.form ?? '', { dialog: areaClass.dialog ?? '' }, CLOSE_LABEL, '', dialogWidthOf({ form: item.view?.form, schema: item.schema }));
144
167
  adviseDialogFooter(ctx, item.view?.form, 'product.objects.item.view.form.footerActions');
145
168
  for (const cl of Object.values(OVERLAY_SHELL_CLASS)) for (const t of cl.split(/\s+/)) if (t !== '') out.candidates.add(t);
146
169
  }
@@ -150,7 +173,10 @@ export function compileCategoryCrud(input: KitBizInput, ctx: KitBizContext): Kit
150
173
  const catRowsPath = `page.data.${catName}.${c.r.compiled.listShape.rows}`;
151
174
  const hubAutoSelect = staticView === undefined;
152
175
  out.show[ids.hub] = {
153
- props: { scope: link, keyField: catKey, linkKey, autoSelect: hubAutoSelect, rows: hubAutoSelect ? catRowsPath : [], pageScopes },
176
+ props: {
177
+ scope: link, keyField: catKey, linkKey, autoSelect: hubAutoSelect, rows: hubAutoSelect ? catRowsPath : [], pageScopes,
178
+ ...(Object.keys(createObjects).length > 0 ? { createObjects } : {}),
179
+ },
154
180
  };
155
181
  const itemStateShow = out.show[stateAnchor(itemName)] as { props?: { config?: Record<string, unknown> } } | undefined;
156
182
  if (itemStateShow?.props?.config !== undefined && itemStateShow.props.config.idle === undefined) {
@@ -159,17 +185,29 @@ export function compileCategoryCrud(input: KitBizInput, ctx: KitBizContext): Kit
159
185
  }
160
186
  out.show[ids.coord] = {
161
187
  props: {
162
- scope: link, object: itemName, keyField: keyFieldOf(item) ?? '', reloads: [], overlays: {}, rowsPath: it.r.compiled.listShape.rows,
188
+ scope: link, objectScope: itemScope, object: itemName, keyField: keyFieldOf(item) ?? '', reloads: [], overlays: {}, rowsPath: it.r.compiled.listShape.rows,
189
+ ...(pageForm ? { pageForm: true } : {}),
163
190
  ...linkRemoveProps(out),
164
191
  },
165
192
  };
193
+ if (pageForm) out.show[`${ids.root}_browse`] = { when: mirrorPath(link, KIT_COORD_MIRRORS.browsing.key) };
166
194
  out.events[`${ids.hub}.picked`] = semanticPipe(link, KIT_COORD_EVENTS.pick);
167
195
 
168
196
  // ---- 壳
169
197
  const catHtml = [c.r.parts.toolbar ?? '', c.r.parts.filter ?? '', c.listHtml, c.r.parts.summary ?? ''].filter((x) => x !== '').join('\n');
198
+ // 无标题条目列表的「清除筛选」meta 宿主由 listPanelBody 并入筛选条同行,同步标 inline: true(同 StandardCrud)
199
+ const itemListTitled = typeof item.view?.list?.title === 'string' && item.view.list.title !== '';
200
+ if (!itemListTitled && (it.r.parts.filter ?? '') !== '') {
201
+ const metaEntry = out.show[metaAnchor(itemName)];
202
+ if (isRec(metaEntry) && isRec(metaEntry.props) && isRec(metaEntry.props.config)) {
203
+ metaEntry.props.config = { ...metaEntry.props.config, inline: true };
204
+ }
205
+ }
170
206
  // 条目面板:工具条区(筛选 + 主操作)+ hairline + 集合 + 摘要(单一面板,见 shared/compile-helpers#listPanelBody)
171
- const itemHtml = [listPanelBody({ filter: it.r.parts.filter ?? '', toolbar: it.r.parts.toolbar ?? '', list: it.listHtml }), it.r.parts.summary ?? ''].filter((x) => x !== '').join('\n');
172
- const html = categoryCrudHtml(ids, { category: catHtml, item: itemHtml, dialog }, areaClass, input.class);
207
+ const itemHtml = [next
208
+ ? listPanelBody({ filter: it.r.parts.filter ?? '', toolbar: it.r.parts.toolbar ?? '', list: it.listHtml }, '', false, { object: itemName })
209
+ : listPanelBody({ filter: it.r.parts.filter ?? '', toolbar: it.r.parts.toolbar ?? '', list: it.listHtml }), it.r.parts.summary ?? ''].filter((x) => x !== '').join('\n');
210
+ const html = categoryCrudHtml(ids, { category: catHtml, item: itemHtml, dialog, layout: input.listLayout ?? 'side', ...(pageForm ? { browseId: `${ids.root}_browse` } : {}), ...(next ? { next: { category: catName, item: itemName } } : {}) }, areaClass, input.class);
173
211
  for (const cl of classesIn(html)) out.candidates.add(cl);
174
212
  for (const cl of Object.values(CATEGORY_CRUD_CLASS)) for (const t of cl.split(/\s+/)) if (t !== '') out.candidates.add(t);
175
213
  return finishBizCompile(out, html);
@@ -12,6 +12,8 @@ export const CategoryCrud = defineKitBizComponent({
12
12
  item: { required: true, views: ['filter', 'list', 'summary', 'form'] },
13
13
  },
14
14
  areas: [...CATEGORY_CRUD_AREAS],
15
+ envelope: { horizontalPanes: 2 },
16
+ listLayout: true,
15
17
  compile: compileCategoryCrud,
16
18
  });
17
19
 
@@ -1,17 +1,27 @@
1
- // CategoryCrud 的 HTML 代码壳:左侧固定紧凑分类栏(默认 w-56)+ 右侧条目管理区。只有结构与 Tailwind 类,分栏靠容器查询变体。
1
+ // CategoryCrud 的 HTML 代码壳:左侧紧凑分类栏(宽夹在 [容器宽/6, 容器宽/4],list_layout: side)或上方整宽分类栏(top)+ 右侧 / 下方条目管理区。只有结构与 Tailwind 类,分栏靠容器查询变体。
2
2
 
3
+ import { kitNeutralClass, kitObjectAnchor } from '../shared/pipeline';
3
4
  import { mergeClass } from '../../shared/merge-class';
5
+ import { KIT_ATTR_CONTAINER } from '../../shared/dom-attrs';
4
6
  import { kitShellRecipe } from '../../recipes/container';
7
+ import { kitDefaultListPane, kitListPaneClass, type KitListLayout } from '../../recipes/page-width';
5
8
  import { cls, esc, host } from '../link/shared';
9
+ import { browsingWrapHtml } from '../shared/page-form';
6
10
 
7
11
  /** 壳的内部区域名(`areaClass` 的合法键) */
8
12
  export const CATEGORY_CRUD_AREAS = ['root', 'categorySidebar', 'itemWorkspace', 'dialog'] as const;
9
13
 
14
+ /** 分类栏是列表窗格:没有条目样本,内容需要的宽取默认档;并排线与主从同一条(SCON-122:侧栏宽夹在 [容器宽/6, 容器宽/4],窄于并排线上下堆叠) */
15
+ const LIST_PANE = kitDefaultListPane();
16
+
10
17
  export const CATEGORY_CRUD_CLASS = {
11
- // 外层只做容器查询宿主(@container 不能自查询,@md:flex-row 放在内层容器上)
12
- root: '@container w-full',
13
- layout: 'flex flex-col gap-section @md:flex-row',
14
- categorySidebar: mergeClass('w-full shrink-0 @md:w-56 p-inset-compact flex flex-col gap-cluster', kitShellRecipe()),
18
+ // 外层只做容器查询宿主(@container 不能自查询,并排的 flex-row 放在内层容器上);flex-1 沿 single-frame 视口舞台落底撑满
19
+ root: '@container flex flex-1 flex-col w-full',
20
+ layout: `flex flex-1 flex-col gap-section @${LIST_PANE.tier}:flex-row`,
21
+ /** top 形态(product.list_layout: top):分类栏在上、条目区在下,整宽堆叠,没有并排线 */
22
+ layoutTop: 'flex flex-1 flex-col gap-section',
23
+ categorySidebar: mergeClass(`@max-${LIST_PANE.tier}:w-full shrink-0 ${kitListPaneClass(LIST_PANE.px, LIST_PANE.tier)} p-inset-compact flex flex-col gap-cluster`, kitShellRecipe()),
24
+ categorySidebarTop: mergeClass('w-full shrink-0 p-inset-compact flex flex-col gap-cluster', kitShellRecipe()),
15
25
  // 条目工作区是一张面板(单一面板:工具条区 + hairline + 集合共用一个面,面板持有内边距 p-card),与 StandardCrud 的列表卡同一结构
16
26
  itemWorkspace: mergeClass('flex min-w-0 flex-1 flex-col gap-region p-card', kitShellRecipe({ tone: 'base', shadow: false })),
17
27
  } as const;
@@ -22,12 +32,22 @@ export function categoryCrudIds(pageId: string): { root: string; hub: string; co
22
32
 
23
33
  export function categoryCrudHtml(
24
34
  ids: ReturnType<typeof categoryCrudIds>,
25
- parts: { category: string; item: string; dialog: string },
35
+ parts: { category: string; item: string; dialog: string; /** 整页表单视图打开时分类 + 条目区让位的显隐外层 id(缺省不包) */ browseId?: string; /** 列表窗格形态(product.list_layout,缺省 side) */ layout?: KitListLayout;
36
+ /** 新模式(主题流水线 next):分类与条目对象的运行期名(容器锚点据它拼);旧版不给 */ next?: { readonly category: string; readonly item: string } },
26
37
  areaClass: Record<string, string>,
27
38
  extra: string | undefined,
28
39
  ): string {
29
- const side = `<aside data-kit-container="card"${cls(mergeClass(CATEGORY_CRUD_CLASS.categorySidebar, areaClass.categorySidebar))}>${parts.category}</aside>`;
30
- const main = `<section data-kit-container="card"${cls(mergeClass(CATEGORY_CRUD_CLASS.itemWorkspace, areaClass.itemWorkspace))}>${parts.item}</section>`;
40
+ const top = parts.layout === 'top';
41
+ const nx = parts.next;
42
+ // 新模式:分类栏与条目区是两个对象的容器,补对象锚点;不写容器形态,类只留结构类(面的外观由取值表按层级角色给)
43
+ const side = nx !== undefined
44
+ ? `<aside data-soma-id="${esc(kitObjectAnchor(nx.category))}"${cls(kitNeutralClass(mergeClass(top ? CATEGORY_CRUD_CLASS.categorySidebarTop : CATEGORY_CRUD_CLASS.categorySidebar, areaClass.categorySidebar)))}>${parts.category}</aside>`
45
+ : `<aside ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(top ? CATEGORY_CRUD_CLASS.categorySidebarTop : CATEGORY_CRUD_CLASS.categorySidebar, areaClass.categorySidebar))}>${parts.category}</aside>`;
46
+ const main = nx !== undefined
47
+ ? `<section data-soma-id="${esc(kitObjectAnchor(nx.item))}"${cls(kitNeutralClass(mergeClass(CATEGORY_CRUD_CLASS.itemWorkspace, areaClass.itemWorkspace)))}>${parts.item}</section>`
48
+ : `<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(CATEGORY_CRUD_CLASS.itemWorkspace, areaClass.itemWorkspace))}>${parts.item}</section>`;
31
49
  const root = mergeClass(mergeClass(CATEGORY_CRUD_CLASS.root, areaClass.root), extra);
32
- return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n${host('KitLinkHub', ids.hub)}${host('KitCrudBridge', ids.coord)}\n<div${cls(CATEGORY_CRUD_CLASS.layout)}>\n${side}\n${main}\n</div>\n${parts.dialog}\n</div>`;
50
+ const layout = `<div${cls(top ? CATEGORY_CRUD_CLASS.layoutTop : CATEGORY_CRUD_CLASS.layout)}>\n${side}\n${main}\n</div>`;
51
+ const body = parts.browseId === undefined || parts.browseId === '' ? layout : browsingWrapHtml(parts.browseId, layout);
52
+ return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n${host('KitLinkHub', ids.hub)}${host('KitCrudBridge', ids.coord)}\n${body}\n${parts.dialog}\n</div>`;
33
53
  }
@@ -3,11 +3,15 @@
3
3
  // form 必有 behavior.write 与 form 视图;有 behavior.from 时挂载回填(edit),没有则空表单(create);校验后提交走 data.submit,成功弹「提交成功」
4
4
  // items 只读展示对象(list 或 summary,不允许动作 / write),订单明细 / 购物车行
5
5
  // amounts 可选,只读展示对象;通常写 staticComponent: AmountBreakdown(金额原样展示,不计算)
6
- // 金额是服务端事实:组件不在前端算价;提交成功后需要刷新明细 / 金额,由应用的 saved 之后的跳转或页面刷新承担。
6
+ // 金额是服务端事实:组件不在前端算价;提交成功后写通道的 write.reload 点名「表单 + 明细 (+ 金额)」,由 core 一并重取;
7
+ // 没有 from 的结账表单(新建下单)提交成功后锁住提交钮(submitOnce),点重置才能再填一单。
8
+ // 配送方式等改变应付金额的字段:金额要随字段变化重算,需要应用把这些字段作为金额对象读接口的参数(页面声明里没有草稿取值路径),模板不替应用猜。
7
9
  // 与 StepForm 的区别:单页结算,表单与摘要并排,没有分步;与 MultiObjectBoard 的区别:表单是提交主体,摘要栏是写死的附属。
8
10
 
11
+ import { isNextPipeline } from '../shared/pipeline';
9
12
  import { emitObject } from '../../object-renderer/emit-object';
10
13
  import { savedNoticePipe } from '../../object-renderer/form-notify';
14
+ import type { CoreWriteDecl } from '../../object-renderer/compile-data';
11
15
  import { viewAnchor } from '../../object-renderer/emit-static';
12
16
  import type { KitObject, KitViewForm } from '../../object-renderer/types';
13
17
  import type { KitFragment } from '../../object-renderer/fragment';
@@ -83,14 +87,20 @@ export function compileCheckoutPage(input: KitBizInput, ctx: KitBizContext): Kit
83
87
  submitLabel,
84
88
  resetLabel: RESET_LABEL,
85
89
  classes: { ...classes, actions: CHECKOUT_PAGE_CLASS.footer },
90
+ // 没有 behavior.from(新建下单):提交成功后锁住提交钮,同一份草稿不可重复建单;点重置再填下一单才解锁
91
+ ...(hasFrom ? {} : { submitOnce: true }),
92
+ // 独立的可编辑表单:草稿有改动时拦截刷新 / 关闭与站内链接点击(尊重页面显式关闭 false / 'none')
93
+ ...(target.behavior.leaveGuard === undefined ? { leaveGuard: true } : {}),
86
94
  });
87
95
  out.events[`${formId}.saved`] = savedNoticePipe(formView, SAVED_NOTICE);
88
96
  const ft = formView.title;
89
97
  const formTitle = typeof ft === 'string' ? ft : isRec(ft) ? String((hasFrom ? ft.edit : ft.create) ?? '') : '';
90
98
 
91
99
  // ---- 摘要栏
100
+ const itemsObject = checkoutPageObjectName(ctx.pageId, 'items');
101
+ const amountsObject = checkoutPageObjectName(ctx.pageId, 'amounts');
92
102
  const items = emitReadOnlyMember(out, rawItems, {
93
- object: checkoutPageObjectName(ctx.pageId, 'items'),
103
+ object: itemsObject,
94
104
  path: 'product.objects.items',
95
105
  roleName: 'items',
96
106
  roleDef: CheckoutPage.roles.items,
@@ -99,7 +109,7 @@ export function compileCheckoutPage(input: KitBizInput, ctx: KitBizContext): Kit
99
109
  let amounts = undefined as ReturnType<typeof emitReadOnlyMember>;
100
110
  if (rawAmounts !== undefined) {
101
111
  amounts = emitReadOnlyMember(out, rawAmounts, {
102
- object: checkoutPageObjectName(ctx.pageId, 'amounts'),
112
+ object: amountsObject,
103
113
  path: 'product.objects.amounts',
104
114
  roleName: 'amounts',
105
115
  roleDef: CheckoutPage.roles.amounts,
@@ -108,6 +118,29 @@ export function compileCheckoutPage(input: KitBizInput, ctx: KitBizContext): Kit
108
118
  }
109
119
  if (out.diagnostics.length > 0 || items === undefined) return finishTemplate(out, '');
110
120
 
121
+ // 只读摘要 / 明细(含 AmountBreakdown 等写死形状件)读失败自动重试会发 `<对象>__<槽>.retry -> SCOPE | window-reload | <对象>_scope`;
122
+ // 补齐空切片作用域声明(幂等),避免无筛选/分页的静态只读成员触发 ERR-GEN-010 页面载入 500
123
+ for (const memberObj of [itemsObject, ...(amounts !== undefined ? [amountsObject] : [])]) {
124
+ const memberScope = `${memberObj}_scope`;
125
+ const reloadPipe = `SCOPE | window-reload | ${memberScope}`;
126
+ if (out.scopes[memberScope] === undefined && Object.values(out.events).includes(reloadPipe)) {
127
+ out.scopes[memberScope] = { id: memberScope, object: memberObj, slices: [] };
128
+ }
129
+ }
130
+
131
+ // 提交成功后摘要栏跟着刷新:明细与金额是服务端事实,写通道的 reload 从「只重取表单对象」扩成「表单 + 有读接口的明细 (+ 金额)」,
132
+ // 由 core 在写成功后一并重取(静态无 from 成员不进 ui.data,不得写入 reload 以免 core 解析崩溃)
133
+ const formWrite = (out.data[formObject] as { write?: CoreWriteDecl } | undefined)?.write;
134
+ if (formWrite !== undefined) {
135
+ const reloadTargets = [
136
+ formObject,
137
+ ...(items.hasFrom ? [checkoutPageObjectName(ctx.pageId, 'items')] : []),
138
+ ...(amounts?.hasFrom === true ? [checkoutPageObjectName(ctx.pageId, 'amounts')] : []),
139
+ ];
140
+ if (reloadTargets.length > 0) formWrite.reload = reloadTargets;
141
+ else delete (formWrite as { reload?: string[] }).reload;
142
+ }
143
+
111
144
  const titleOf = (raw: unknown): string => (isRec(raw) && typeof raw.title === 'string' ? raw.title : '');
112
145
  const html = checkoutPageHtml(
113
146
  ids,
@@ -118,6 +151,7 @@ export function compileCheckoutPage(input: KitBizInput, ctx: KitBizContext): Kit
118
151
  items: items.html,
119
152
  amountsTitle: titleOf(rawAmounts),
120
153
  amounts: amounts?.html ?? '',
154
+ ...(isNextPipeline(ctx) ? { next: { form: formObject, items: checkoutPageObjectName(ctx.pageId, 'items'), amounts: checkoutPageObjectName(ctx.pageId, 'amounts') } } : {}),
121
155
  },
122
156
  areaClass,
123
157
  input.class,
@@ -13,6 +13,7 @@ export const CheckoutPage = defineKitBizComponent({
13
13
  amounts: { required: false, views: ['list', 'summary'] },
14
14
  },
15
15
  areas: [...CHECKOUT_PAGE_AREAS],
16
+ envelope: { surface: 'form', railWidthRem: 22, minTier: 'wide', maxTier: 'xwide' },
16
17
  compile: compileCheckoutPage,
17
18
  });
18
19
 
@@ -1,7 +1,10 @@
1
1
  // CheckoutPage 的 HTML 代码壳:左信息表单卡 + 右订单摘要栏(明细 + 金额汇总)。只有结构与 Tailwind 类,分栏靠容器查询变体 `@md:`:
2
2
  // 窄容器下摘要在表单之后上下堆叠;达到 md 档左 7 / 右 5(共 12 份)。
3
3
 
4
+ import { kitNeutralClass, kitObjectAnchor } from '../shared/pipeline';
4
5
  import { mergeClass } from '../../shared/merge-class';
6
+ import { KIT_ATTR_CONTAINER } from '../../shared/dom-attrs';
7
+ import { kitSelfAttrs } from '../../shared/page-attrs-runtime';
5
8
  import { kitShellRecipe } from '../../recipes/container';
6
9
  import { KIT_DIVIDER_FOOT_CLASS } from '../../recipes/divider';
7
10
  import { kitTypographyRecipe } from '../../recipes/typography';
@@ -12,14 +15,14 @@ export const CHECKOUT_PAGE_AREAS = ['root', 'form', 'summary', 'items', 'amounts
12
15
  export type CheckoutPageArea = (typeof CHECKOUT_PAGE_AREAS)[number];
13
16
 
14
17
  export const CHECKOUT_PAGE_CLASS = {
15
- root: '@container grid grid-cols-12 gap-section',
18
+ root: '@container grid w-full min-w-0 grid-cols-12 gap-section',
16
19
  form: mergeClass('col-span-12 @md:col-span-7 flex min-w-0 flex-col gap-section p-inset-roomy', kitShellRecipe()),
17
20
  summary: 'col-span-12 @md:col-span-5 flex min-w-0 flex-col gap-section',
18
- items: mergeClass('flex flex-col gap-region p-card', kitShellRecipe()),
19
- amounts: mergeClass('flex flex-col gap-region p-card', kitShellRecipe({ tone: 'sunken', shadow: false })),
20
- title: kitTypographyRecipe('sectionTitle'),
21
+ items: mergeClass('flex min-w-0 flex-col gap-region p-card', kitShellRecipe()),
22
+ amounts: mergeClass('flex min-w-0 flex-col gap-region p-card', kitShellRecipe({ tone: 'sunken', shadow: false })),
23
+ title: mergeClass(kitTypographyRecipe('sectionTitle'), 'min-w-0 tracking-tight'),
21
24
  /** 表单底部提交栏(表单 actions 区);动作组恒单行不折行(排布引擎动作组规则) */
22
- footer: `mt-2 flex flex-nowrap items-end gap-cluster ${KIT_DIVIDER_FOOT_CLASS} pt-4`,
25
+ footer: `mt-2 flex flex-nowrap items-center gap-cluster ${KIT_DIVIDER_FOOT_CLASS} pt-4`,
23
26
  } as const;
24
27
 
25
28
  export function checkoutPageIds(pageId: string): { root: string } {
@@ -33,6 +36,8 @@ export interface CheckoutParts {
33
36
  items: string;
34
37
  amountsTitle: string;
35
38
  amounts: string;
39
+ /** 新模式(主题流水线 next):三个对象的运行期名(容器锚点据它拼);旧版不给 */
40
+ next?: Readonly<Record<'form' | 'items' | 'amounts', string>>;
36
41
  }
37
42
 
38
43
  export function checkoutPageHtml(
@@ -42,12 +47,24 @@ export function checkoutPageHtml(
42
47
  extra: string | undefined,
43
48
  ): string {
44
49
  const head = (t: string): string => (t === '' ? '' : `<h2${cls(CHECKOUT_PAGE_CLASS.title)}>${esc(t)}</h2>`);
45
- const form = `<section data-kit-container="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.form, areaClass.form))}>${head(parts.formTitle)}${parts.form}</section>`;
46
- const items = `<section data-kit-container="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.items, areaClass.items))}>${head(parts.itemsTitle)}${parts.items}</section>`;
50
+ const nx = parts.next;
51
+ if (nx !== undefined) {
52
+ // 新模式:表单、清单、金额各是一个对象的容器(补对象锚点),不写容器形态与外观类。
53
+ // 份数(表单 7 / 汇总栏 5)保留:栅格的子项是表单与「清单 + 金额」汇总栏,汇总栏不是组件树上的节点,布局写在清单对象上的份数落不到栅格子项上
54
+ // 标题行自报元素部件「块标题」,是对象容器的直接子元素:识别写下的「隐去重复标题」经生成事件作为结构属性落到容器上后,取值表据此只收起这一行
55
+ const headNext = (t: string): string => (t === '' ? '' : `<h2${kitSelfAttrs({ part: 'block-title' })}${cls(CHECKOUT_PAGE_CLASS.title)}>${esc(t)}</h2>`);
56
+ const face = (tag: string, k: 'form' | 'items' | 'amounts', base: string, title: string, inner: string): string =>
57
+ `<${tag} data-soma-id="${esc(kitObjectAnchor(nx[k]))}"${cls(kitNeutralClass(mergeClass(base, areaClass[k])))}>${headNext(title)}${inner}</${tag}>`;
58
+ const amountsNext = parts.amounts === '' ? '' : `\n${face('section', 'amounts', CHECKOUT_PAGE_CLASS.amounts, parts.amountsTitle, parts.amounts)}`;
59
+ const summaryNext = `<aside${cls(kitNeutralClass(mergeClass(CHECKOUT_PAGE_CLASS.summary, areaClass.summary)))}>\n${face('section', 'items', CHECKOUT_PAGE_CLASS.items, parts.itemsTitle, parts.items)}${amountsNext}\n</aside>`;
60
+ return `<div data-soma-id="${esc(ids.root)}"${cls(mergeClass(mergeClass(CHECKOUT_PAGE_CLASS.root, areaClass.root), extra))}>\n${face('section', 'form', CHECKOUT_PAGE_CLASS.form, parts.formTitle, parts.form)}\n${summaryNext}\n</div>`;
61
+ }
62
+ const form = `<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.form, areaClass.form))}>${head(parts.formTitle)}${parts.form}</section>`;
63
+ const items = `<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.items, areaClass.items))}>${head(parts.itemsTitle)}${parts.items}</section>`;
47
64
  const amounts = parts.amounts === ''
48
65
  ? ''
49
- : `\n<section data-kit-container="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.amounts, areaClass.amounts))}>${head(parts.amountsTitle)}${parts.amounts}</section>`;
50
- const summary = `<aside data-kit-container="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.summary, areaClass.summary))}>\n${items}${amounts}\n</aside>`;
66
+ : `\n<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(CHECKOUT_PAGE_CLASS.amounts, areaClass.amounts))}>${head(parts.amountsTitle)}${parts.amounts}</section>`;
67
+ const summary = `<aside ${KIT_ATTR_CONTAINER}="plain"${cls(mergeClass(CHECKOUT_PAGE_CLASS.summary, areaClass.summary))}>\n${items}${amounts}\n</aside>`;
51
68
  const root = mergeClass(mergeClass(CHECKOUT_PAGE_CLASS.root, areaClass.root), extra);
52
69
  return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n${form}\n${summary}\n</div>`;
53
70
  }
@@ -10,7 +10,7 @@ import { checkClasses, mergeClass } from '../shared/merge-class';
10
10
  import type { KitDiagnostic, KitObject } from '../object-renderer/types';
11
11
  import { defineKitBizComponent } from './define';
12
12
  import { validateBizAreaClass } from './shared/compile-helpers';
13
- import type { KitBizContext, KitBizDefinition, KitBizInput, KitBizRole } from './types';
13
+ import type { KitBizContext, KitBizDefinition, KitBizEnvelopeTrait, KitBizInput, KitBizRole } from './types';
14
14
  import { kitFail } from '../shared/kit-error';
15
15
 
16
16
  export interface WrapBizShellContext {
@@ -29,6 +29,8 @@ export interface WrapBizOptions {
29
29
  extraAreas?: readonly string[];
30
30
  /** 是否允许页面传入 product.config(缺省 true,专为包装层翻译专属语法设计) */
31
31
  acceptConfig?: boolean;
32
+ /** 可选:覆写底层业务组件的声明式版心特征;缺省透传 inner.envelope */
33
+ envelope?: KitBizEnvelopeTrait;
32
34
  /** 包装层写死的 Tailwind 类串或类名列表(自动校验并并入产物 candidates) */
33
35
  candidates?: readonly string[];
34
36
  /**
@@ -58,11 +60,14 @@ export function wrapKitBizComponent(inner: KitBizDefinition, options: WrapBizOpt
58
60
  if (bad.length > 0) kitFail('KIT-COMP-003', `${options.kind}.candidates`, `${options.kind} 的 candidates 含非法类 "${tok}":${bad[0]!.message}`, '候选类只能用刻度内的 Tailwind 类,不写方括号任意值');
59
61
  }
60
62
 
63
+ const resolvedEnvelope = options.envelope ?? inner.envelope;
61
64
  return defineKitBizComponent({
62
65
  kind: options.kind,
63
66
  roles: options.roles ?? inner.roles,
64
67
  areas: allAreas,
65
68
  acceptConfig: options.acceptConfig ?? true,
69
+ ...(resolvedEnvelope !== undefined ? { envelope: resolvedEnvelope } : {}),
70
+ ...(resolvedEnvelope === undefined && inner.pageMaxWidth !== undefined ? { pageMaxWidth: inner.pageMaxWidth } : {}),
66
71
  compile(input: KitBizInput, ctx: KitBizContext): KitFragment {
67
72
  const diagnostics: KitDiagnostic[] = [];
68
73
 
@@ -8,6 +8,7 @@ import { createKitCoordinator } from './shared/coordinator';
8
8
  import { createKitActionHost } from './shared/action-host';
9
9
  import { createKitBoardProse } from './multi-board/prose-fold';
10
10
  import { createKitDetailHead } from './master-sub/detail-head';
11
+ import { createKitPageFormActions } from './shared/page-form-actions';
11
12
  import { createKitStepHub } from './step-form/hub';
12
13
  import { createKitImportHub } from './import-wizard/hub';
13
14
 
@@ -20,6 +21,7 @@ export const KIT_BIZ_DATA_COMPONENTS: Record<string, () => SomaComponentDefiniti
20
21
  KitImportHub: createKitImportHub,
21
22
  KitBoardProse: createKitBoardProse,
22
23
  KitDetailHead: createKitDetailHead,
24
+ KitPageFormActions: createKitPageFormActions,
23
25
  };
24
26
 
25
27
  /** 装配期并入组件表的协作数据组件:名字 -> 定义 */
@@ -9,6 +9,7 @@
9
9
  // 结果 校验通过的行逐行 data.submit 写入(有限并发);ResultPanel 汇总成功 / 失败,失败明细可下载
10
10
  // 写入只经 core 的 data 端口,向导不读也不存任何凭据。
11
11
 
12
+ import { isNextPipeline } from '../shared/pipeline';
12
13
  import type { SomaScopeMirrorDecl } from 'soma-core';
13
14
  import { emitObject } from '../../object-renderer/emit-object';
14
15
  import type { KitFieldSchema, KitObject } from '../../object-renderer/types';
@@ -154,6 +155,8 @@ export function compileImportWizard(input: KitBizInput, ctx: KitBizContext): Kit
154
155
  props: {
155
156
  value: at(M.files.key), accept: '.csv,text/csv', multiple: false, dropzone: true,
156
157
  drop_text: T('soma.kit.iw_drop'), button_text: T('soma.kit.upload_pick'),
158
+ // 文件格式说明进上传区的说明位(原为上传区上方单独一行,非内容项 N07)
159
+ hint: T('soma.kit.iw_hint_upload'),
157
160
  },
158
161
  };
159
162
  out.events[`${ids.upload}.change`] = semanticPipe(link, KIT_IMPORT_EVENTS.files);
@@ -193,7 +196,7 @@ export function compileImportWizard(input: KitBizInput, ctx: KitBizContext): Kit
193
196
  };
194
197
 
195
198
  const title = typeof rawTarget.title === 'string' ? rawTarget.title : '';
196
- const html = importWizardHtml(ids, { title, job }, areaClass, input.class, ctx.locale);
199
+ const html = importWizardHtml(ids, { title, job, ...(isNextPipeline(ctx) ? { next: { target: targetName, job: importWizardObjectName(ctx.pageId, 'job') } } : {}) }, areaClass, input.class, ctx.locale);
197
200
  for (const c of classesIn(html)) out.candidates.add(c);
198
201
  for (const c of Object.values(IMPORT_WIZARD_CLASS)) for (const t of c.split(/\s+/)) if (t !== '') out.candidates.add(t);
199
202
  return finishBizCompile(out, html);
@@ -13,6 +13,7 @@ export const ImportWizard = defineKitBizComponent({
13
13
  job: { required: false, views: ['summary', 'list'] },
14
14
  },
15
15
  areas: [...IMPORT_WIZARD_AREAS],
16
+ envelope: { surface: 'wizard' },
16
17
  compile: compileImportWizard,
17
18
  });
18
19
 
@@ -2,10 +2,13 @@
2
2
  // 只有结构与 Tailwind 类(语义色名 + utilityScales 里有的尺度),不写原生 CSS。
3
3
  // 显隐规则同 StepForm:面板 / 步骤条变体 / 按钮都是「外层只放 core 写的 hidden、内层放布局类」两层;各步组件一直挂着,只靠外层显隐切换。
4
4
 
5
+ import { kitNeutralClass, kitObjectAnchor } from '../shared/pipeline';
5
6
  import { mergeClass } from '../../shared/merge-class';
7
+ import { KIT_ATTR_CONTAINER, KIT_ATTR_EMPHASIS, KIT_ATTR_ROLE } from '../../shared/dom-attrs';
8
+ import { kitSelfAttrs } from '../../shared/page-attrs-runtime';
6
9
  import { kitShellRecipe } from '../../recipes/container';
7
10
  import { KIT_DIVIDER_FOOT_CLASS } from '../../recipes/divider';
8
- import { KIT_PAGE_READ_WIDTH_CLASS } from '../../recipes/page-width';
11
+ import { kitClosedValueTone } from '../../recipes/field-text';
9
12
  import { kitTypographyRecipe } from '../../recipes/typography';
10
13
  import { cls, esc, host } from '../link/shared';
11
14
  import { kitText } from '../../i18n/kit-text';
@@ -21,26 +24,28 @@ export const IMPORT_WIZARD_STEP_TITLES = [
21
24
  ] as const;
22
25
 
23
26
  export const IMPORT_WIZARD_CLASS = {
24
- root: '@container flex justify-center',
25
- card: mergeClass(`flex w-full ${KIT_PAGE_READ_WIDTH_CLASS} flex-col gap-stack p-inset-roomy`, kitShellRecipe()),
26
- title: kitTypographyRecipe('sectionTitle'),
27
- steps: 'flex flex-wrap items-center gap-cluster',
27
+ // @container 需显式 w-full min-w-0,避免在弹性容器内因 container-type: inline-size 固有宽归零而坍缩为窄条
28
+ root: '@container flex w-full min-w-0 justify-center',
29
+ // 版心由外层 frame__width 唯一承载(向导 medium 800px / 页面 DSL page.max_width),消除内层二次夹紧
30
+ card: mergeClass('flex w-full min-w-0 flex-col gap-stack p-inset-roomy', kitShellRecipe()),
31
+ title: mergeClass(kitTypographyRecipe('sectionTitle'), 'tracking-tight'),
32
+ steps: 'flex flex-wrap items-center gap-cluster pb-1',
28
33
  stepItem: 'flex items-center gap-cluster',
29
- circle: 'flex h-6 w-6 items-center justify-center rounded-full text-sm font-medium',
34
+ circle: 'flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-sm font-medium',
30
35
  circleAt: 'bg-primary text-primary-fg',
31
36
  circlePast: 'bg-success text-success-fg',
32
- circleFut: 'bg-surface-sunken text-fg-muted',
37
+ circleFut: kitClosedValueTone('neutral'),
33
38
  labelAt: 'text-sm font-semibold text-fg',
34
39
  labelPast: 'text-sm text-fg',
35
40
  labelFut: 'text-sm text-fg-muted',
36
41
  joint: `w-6 ${KIT_DIVIDER_FOOT_CLASS}`,
37
- panel: 'flex flex-col gap-section',
38
- panelTitle: kitTypographyRecipe('sectionTitle'),
42
+ panel: 'flex min-w-0 flex-col gap-section',
43
+ panelTitle: mergeClass(kitTypographyRecipe('sectionTitle'), 'tracking-tight'),
39
44
  hint: 'text-sm text-fg-muted',
40
45
  error: 'text-sm text-danger-on-soft',
41
- buttons: 'flex flex-wrap items-center justify-end gap-cluster',
42
- preview: 'flex flex-col gap-region',
43
- done: 'flex flex-col gap-section',
46
+ buttons: 'flex flex-wrap items-center justify-end gap-cluster pt-1',
47
+ preview: 'flex min-w-0 flex-col gap-region',
48
+ done: 'flex min-w-0 flex-col gap-section',
44
49
  } as const;
45
50
 
46
51
  export interface ImportWizardIds {
@@ -89,6 +94,8 @@ export interface ImportWizardParts {
89
94
  title: string;
90
95
  /** 结果步里附带的长任务对象(可选,已发射的 HTML) */
91
96
  job: string;
97
+ /** 新模式(主题流水线 next):目标与长任务对象的运行期名(容器锚点据它拼);旧版不给 */
98
+ next?: { readonly target: string; readonly job: string };
92
99
  }
93
100
 
94
101
  export function importWizardHtml(
@@ -120,18 +127,19 @@ export function importWizardHtml(
120
127
  gate(ids.btnGate(name, off), host('Button', ids.btn(name, off)));
121
128
  const buttons = (...inner: string[]): string => `<div${cls(C.buttons)}>${inner.join('')}</div>`;
122
129
  const panel = (i: number, body: string): string =>
123
- gate(ids.panel(i), `<div${cls(mergeClass(C.panel, areaClass.panel))}><h3${cls(C.panelTitle)}>${esc(T(i))}</h3>${body}</div>`);
130
+ // 面板里不再画可见的步骤名(非内容项 N06:上方步骤条已显示当前步骤名,同屏两处同名);标题留给读屏
131
+ gate(ids.panel(i), `<div${cls(mergeClass(C.panel, areaClass.panel))}><h3 class="sr-only">${esc(T(i))}</h3>${body}</div>`);
124
132
  const text = (id: string, klass: string): string => `<div data-soma-component="Text" data-soma-id="${esc(id)}"${cls(klass)}></div>`;
125
133
 
126
134
  const p0 = panel(0, [
127
- `<p${cls(C.hint)}>${esc(kitText('soma.kit.iw_hint_upload', undefined, locale))}</p>`,
135
+ // 文件格式说明并进上传区自己的说明位(Upload 的 hint,compile 里给;非内容项 N07),不另占一行
128
136
  host('Upload', ids.upload),
129
137
  text(ids.parseError, C.error),
130
138
  text(ids.fileInfo, C.hint),
131
139
  buttons(gatedBtn('up_next'), gatedBtn('up_next', true)),
132
140
  ].join(''));
133
141
  const p1 = panel(1, [
134
- `<p${cls(C.hint)}>${esc(kitText('soma.kit.iw_hint_map', undefined, locale))}</p>`,
142
+ // 不出「把文件里的列对应到…」引导句(非内容项 N08:步骤名与表头已说明,星号含义与表单必填一致)
135
143
  host('FieldMapper', ids.mapper),
136
144
  buttons(
137
145
  host('Button', ids.btn('map_prev')),
@@ -152,15 +160,21 @@ export function importWizardHtml(
152
160
  ),
153
161
  ].join(''));
154
162
  const p3 = gate(ids.panel(3), `<div${cls(mergeClass(C.done, areaClass.done))}>`
155
- + `<h3${cls(C.panelTitle)}>${esc(T(3))}</h3>`
163
+ + `<h3 class="sr-only">${esc(T(3))}</h3>`
156
164
  + gate(ids.progress, text(`${ids.progress}_text`, C.hint) + buttons(gatedBtn('cancel'), gatedBtn('cancel', true)))
157
165
  + gate(ids.resultWrap, host('ResultPanel', ids.result))
158
- + parts.job
166
+ // 新模式:长任务是向导面里的一节(契约:呈现为节、依附目标),给它套一层带对象锚点的结构容器
167
+ + (parts.next !== undefined && parts.job !== '' ? `<div data-soma-id="${esc(kitObjectAnchor(parts.next.job))}">${parts.job}</div>` : parts.job)
159
168
  + '</div>');
160
169
 
161
170
  const title = parts.title === '' ? '' : `<h2${cls(C.title)}>${esc(parts.title)}</h2>`;
162
171
  // 唯一主体 = 页面(C2):向导卡是 E1 主体
163
- const card = `<section data-kit-emphasis="primary" data-kit-role="subject" data-kit-container="card"${cls(mergeClass(C.card, areaClass.card))}>${title}${bar}${p0}${p1}${p2}${p3}</section>`;
172
+ // 新模式:向导卡是目标对象的容器(补对象锚点),不写强调级 / 构成角色 / 容器形态,类只留结构类
173
+ // 新模式的标题行自报「块标题」(向导卡的直接子元素),取值表按容器上的标题隐去标记收起它
174
+ const titleNext = parts.title === '' ? '' : `<h2${kitSelfAttrs({ part: 'block-title' })}${cls(C.title)}>${esc(parts.title)}</h2>`;
175
+ const card = parts.next !== undefined
176
+ ? `<section data-soma-id="${esc(kitObjectAnchor(parts.next.target))}"${cls(kitNeutralClass(mergeClass(C.card, areaClass.card)))}>${titleNext}${bar}${p0}${p1}${p2}${p3}</section>`
177
+ : `<section ${KIT_ATTR_EMPHASIS}="primary" ${KIT_ATTR_ROLE}="subject" ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(C.card, areaClass.card))}>${title}${bar}${p0}${p1}${p2}${p3}</section>`;
164
178
  const root = mergeClass(mergeClass(C.root, areaClass.root), extra);
165
179
  return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n${host('KitImportHub', ids.hub)}\n${card}\n</div>`;
166
180
  }
package/src/biz/index.ts CHANGED
@@ -37,7 +37,7 @@ export { defineKitBizComponent } from './define';
37
37
  export { wrapKitBizComponent, composeKitBizComponents } from './compose';
38
38
  export type { WrapBizOptions, WrapBizShellContext, ComposeBizPart, ComposeBizOptions, ComposeBizShellContext } from './compose';
39
39
  export type {
40
- KitBizContext, KitBizDefinition, KitBizInput, KitBizRole, KitOverlayDecl,
40
+ KitBizContext, KitBizDefinition, KitBizEnvelopeTrait, KitBizInput, KitBizRole, KitOverlayDecl,
41
41
  } from './types';
42
42
  export * from './shared';
43
43
  export { StandardCrud, compileStandardCrud, CRUD_CLASS } from './standard-crud';