soma-core 2.2.5 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +5 -6
  2. package/bin/soma.cjs +2 -2
  3. package/core/build/compiler/flat-page.ts +16 -0
  4. package/core/build/compiler/full-manifest-builder.ts +0 -3
  5. package/core/build/compiler/page-assets.ts +0 -1
  6. package/core/build/compiler/page-closure.ts +245 -0
  7. package/core/build/compiler/page-declaration-compiler.ts +2 -5
  8. package/core/build/compiler/soma-precompile.js +1848 -3244
  9. package/core/build/compiler/soma-precompile.ts +4 -7
  10. package/core/build/component-tree/artifact-codec.ts +4 -8
  11. package/core/build/lsp/soma-declaration.cjs +1 -1
  12. package/core/build/lsp/std-completion.generated.json +3 -3
  13. package/core/client/a11y/a11y-config.ts +2 -1
  14. package/core/client/a11y/dom-id.ts +1 -1
  15. package/core/client/base/SomaHttpClient.ts +11 -3
  16. package/core/client/base/SomaPageRootBase.ts +6 -0
  17. package/core/client/base/defineSomaView.ts +178 -0
  18. package/core/client/base/index.ts +13 -0
  19. package/core/client/base/view-context.ts +328 -0
  20. package/core/client/behavior/adapter-collection.ts +2 -2
  21. package/core/client/compiler/manifest-compiler.ts +5 -36
  22. package/core/client/component/component-definition.types.ts +2 -1
  23. package/core/client/component/component-manager.ts +110 -20
  24. package/core/client/component/structure-adapter.ts +3 -7
  25. package/core/client/container/SomaContainerAdapter.ts +9 -1
  26. package/core/client/data/data-object-resolver.ts +516 -181
  27. package/core/client/data/data-write-actions.ts +79 -15
  28. package/core/client/data/format-config.ts +3 -1
  29. package/core/client/data/region-scope-port.ts +11 -0
  30. package/core/client/engine/asset-resolver.ts +2 -5
  31. package/core/client/engine/dom-renderer.ts +7 -40
  32. package/core/client/engine/event-engine.ts +1 -105
  33. package/core/client/engine/property-watcher.ts +1 -1
  34. package/core/client/engine/reactive-proxy.ts +78 -17
  35. package/core/client/engine/runtime-builder.ts +0 -14
  36. package/core/client/engine/scope-resolver.ts +18 -0
  37. package/core/client/engine/soma-bootstrap.ts +385 -98
  38. package/core/client/engine/style-binder.ts +49 -106
  39. package/core/client/engine/timer-engine.ts +11 -1
  40. package/core/client/host-bridge/load-host-domain-class.ts +2 -1
  41. package/core/client/infra/http/SomaHttpService.ts +15 -4
  42. package/core/client/infra/i18n/pack-locales.ts +2 -2
  43. package/core/client/mount/domain-rule.ts +7 -3
  44. package/core/client/mount/mount-page.ts +38 -5
  45. package/core/client/mount/types.ts +2 -0
  46. package/core/client/parser/confirm-spec.ts +1 -1
  47. package/core/client/parser/data-config-parser.ts +27 -210
  48. package/core/client/parser/pipeline-parser.ts +14 -59
  49. package/core/client/parser/style-config-parser.ts +101 -95
  50. package/core/client/parser/timer-parser.ts +21 -0
  51. package/core/client/parser/ui-config-parser.ts +64 -12
  52. package/core/client/registry/declaration-renderer.ts +1 -1
  53. package/core/client/runtime/SomaRuntimeServices.ts +2 -1
  54. package/core/client/runtime/SomaSnapshotStore.ts +5 -0
  55. package/core/client/security/url-guard.ts +71 -11
  56. package/core/client/validation/async-check-registry.ts +2 -1
  57. package/core/client/validation/contract-validator.ts +2 -6
  58. package/core/client/validation/field-rules.ts +3 -13
  59. package/core/client/validation/object-rules.ts +2 -10
  60. package/core/index.ts +1 -35
  61. package/core/inspect/check-product.ts +5 -5
  62. package/core/inspect/runtime.ts +2 -1
  63. package/core/server/api/dispatch-service-api.ts +35 -36
  64. package/core/server/api/load-host-service.ts +5 -4
  65. package/core/server/compile-port.ts +1 -1
  66. package/core/server/host/app-config-composer.ts +2 -1
  67. package/core/server/host/host-assembly-entry.ts +1 -0
  68. package/core/server/host/host-assembly.ts +47 -3
  69. package/core/server/host/host-caller.ts +2 -1
  70. package/core/server/host/host-dir.ts +9 -0
  71. package/core/server/host/host-response-headers.ts +2 -1
  72. package/core/server/host/invoke-host-request-hook.ts +28 -4
  73. package/core/server/host/published-page-assets.ts +2 -1
  74. package/core/server/host/resolve-host-request-hook.ts +25 -7
  75. package/core/server/host/server-page-assets.ts +4 -4
  76. package/core/server/host/virtual-pages.ts +3 -2
  77. package/core/server/infra/cache/ServerFileCache.ts +79 -9
  78. package/core/server/registry/api-registry-store.ts +3 -1
  79. package/core/server/registry/declaration-precompiler.ts +0 -2
  80. package/core/server/registry/page-registry-repository.ts +2 -1
  81. package/core/server/registry/page-registry-store.ts +2 -1
  82. package/core/server/registry/registry-error.ts +6 -1
  83. package/core/server/registry/registry-file-lock.ts +296 -23
  84. package/core/server/registry/request-body-limit.ts +3 -2
  85. package/core/server/registry/validation/declaration-safety-scan.ts +151 -27
  86. package/core/server/runtime-space/access-gate.ts +21 -7
  87. package/core/server/runtime-space/bindings.ts +3 -6
  88. package/core/server/runtime-space/dynamic-pages.ts +181 -49
  89. package/core/server/runtime-space/errors.ts +3 -0
  90. package/core/server/runtime-space/inject.ts +74 -15
  91. package/core/server/runtime-space/page-grants.ts +7 -1
  92. package/core/server/runtime-space/resolve.ts +66 -19
  93. package/core/server/runtime-space/store.ts +32 -3
  94. package/core/server/runtime-space/submit-steps.ts +2 -1
  95. package/core/server/runtime-space/types.ts +3 -1
  96. package/core/shared/component-tree-errors.ts +2 -1
  97. package/core/shared/contract-a11y.ts +1 -1
  98. package/core/shared/contract-sections.ts +2 -2
  99. package/core/shared/core-diagnostic-codes.ts +8 -0
  100. package/core/shared/declaration-keys.ts +1 -1
  101. package/core/shared/engines/engine-error.ts +2 -1
  102. package/core/shared/generation-error.ts +2 -1
  103. package/core/shared/page-envelope.ts +1 -1
  104. package/core/shared/pure-binding.ts +88 -0
  105. package/core/shared/registry-generated/diagnostic-registry-index.ts +16 -19
  106. package/core/shared/registry-generated/diagnostic-registry.ts +135 -177
  107. package/core/shared/registry-generated/limits.ts +49 -13
  108. package/core/shared/registry-generated/std-grammar-completion.ts +0 -4
  109. package/core/shared/registry-generated/std-grammar-views.ts +40 -10
  110. package/core/shared/registry-generated/std-grammar.ts +42 -20
  111. package/core/shared/soma-error.ts +36 -0
  112. package/core/shared/types/compile-port.types.ts +1 -1
  113. package/core/shared/types/data-config.types.ts +17 -17
  114. package/core/shared/types/engine.types.ts +0 -3
  115. package/core/shared/types/event.types.ts +1 -11
  116. package/core/shared/types/generation-error.types.ts +5 -1
  117. package/core/shared/types/host-assembly.types.ts +7 -1
  118. package/core/shared/types/manifest.types.ts +0 -3
  119. package/core/shared/types/region-scope.types.ts +5 -1
  120. package/core/shared/types/scope-manifest.types.ts +0 -2
  121. package/core/shared/types/style-config.types.ts +21 -21
  122. package/core/shared/types/ui-config.types.ts +4 -5
  123. package/core/shared/types/watcher.types.ts +1 -1
  124. package/dist/browser/runtime-bundle.manifest.json +11 -13
  125. package/dist/browser/soma-runtime.js +2567 -2696
  126. package/dist/core/index.cjs +5446 -5486
  127. package/dist/host-native/aot-builder.cjs +46 -1
  128. package/dist/host-native/native-server.cjs +4879 -4505
  129. package/dist/lsp/component-tree.cjs +5814 -7042
  130. package/dist/types/build/compiler/full-manifest-builder.d.ts +0 -2
  131. package/dist/types/build/compiler/page-closure.d.ts +21 -0
  132. package/dist/types/build/compiler/page-declaration-compiler.d.ts +2 -4
  133. package/dist/types/build/compiler/soma-precompile.d.ts +1 -3
  134. package/dist/types/build/component-tree/artifact-codec.d.ts +0 -2
  135. package/dist/types/client/a11y/a11y-config.d.ts +2 -1
  136. package/dist/types/client/base/SomaHttpClient.d.ts +1 -1
  137. package/dist/types/client/base/SomaPageRootBase.d.ts +5 -0
  138. package/dist/types/client/base/defineSomaView.d.ts +46 -0
  139. package/dist/types/client/base/index.d.ts +2 -0
  140. package/dist/types/client/base/view-context.d.ts +136 -0
  141. package/dist/types/client/behavior/adapter-collection.d.ts +1 -1
  142. package/dist/types/client/compiler/manifest-compiler.d.ts +0 -3
  143. package/dist/types/client/component/component-definition.types.d.ts +2 -1
  144. package/dist/types/client/component/component-manager.d.ts +29 -0
  145. package/dist/types/client/data/data-object-resolver.d.ts +91 -31
  146. package/dist/types/client/data/format-config.d.ts +2 -1
  147. package/dist/types/client/engine/dom-renderer.d.ts +1 -2
  148. package/dist/types/client/engine/event-engine.d.ts +0 -7
  149. package/dist/types/client/engine/reactive-proxy.d.ts +11 -4
  150. package/dist/types/client/engine/runtime-builder.d.ts +0 -4
  151. package/dist/types/client/engine/soma-bootstrap.d.ts +44 -6
  152. package/dist/types/client/engine/style-binder.d.ts +8 -4
  153. package/dist/types/client/host-bridge/load-host-domain-class.d.ts +2 -1
  154. package/dist/types/client/mount/domain-rule.d.ts +2 -0
  155. package/dist/types/client/mount/mount-page.d.ts +2 -1
  156. package/dist/types/client/mount/types.d.ts +2 -0
  157. package/dist/types/client/parser/data-config-parser.d.ts +6 -5
  158. package/dist/types/client/parser/style-config-parser.d.ts +7 -3
  159. package/dist/types/client/parser/timer-parser.d.ts +5 -0
  160. package/dist/types/client/parser/ui-config-parser.d.ts +6 -2
  161. package/dist/types/client/runtime/SomaSnapshotStore.d.ts +2 -0
  162. package/dist/types/client/security/url-guard.d.ts +14 -0
  163. package/dist/types/client/validation/async-check-registry.d.ts +2 -1
  164. package/dist/types/client/validation/object-rules.d.ts +0 -5
  165. package/dist/types/index.d.ts +2 -7
  166. package/dist/types/inspect/runtime.d.ts +2 -1
  167. package/dist/types/server/api/dispatch-service-api.d.ts +5 -0
  168. package/dist/types/server/api/load-host-service.d.ts +1 -1
  169. package/dist/types/server/compile-port.d.ts +1 -1
  170. package/dist/types/server/host/host-assembly-entry.d.ts +1 -1
  171. package/dist/types/server/host/host-assembly.d.ts +2 -0
  172. package/dist/types/server/host/host-dir.d.ts +2 -0
  173. package/dist/types/server/host/invoke-host-request-hook.d.ts +10 -3
  174. package/dist/types/server/host/published-page-assets.d.ts +2 -1
  175. package/dist/types/server/host/resolve-host-request-hook.d.ts +18 -5
  176. package/dist/types/server/host/server-page-assets.d.ts +2 -1
  177. package/dist/types/server/infra/cache/ServerFileCache.d.ts +8 -0
  178. package/dist/types/server/registry/declaration-precompiler.d.ts +0 -1
  179. package/dist/types/server/registry/registry-error.d.ts +5 -1
  180. package/dist/types/server/registry/registry-file-lock.d.ts +30 -0
  181. package/dist/types/server/registry/request-body-limit.d.ts +3 -2
  182. package/dist/types/server/registry/validation/declaration-safety-scan.d.ts +3 -0
  183. package/dist/types/server/runtime-space/access-gate.d.ts +7 -0
  184. package/dist/types/server/runtime-space/bindings.d.ts +3 -2
  185. package/dist/types/server/runtime-space/dynamic-pages.d.ts +6 -1
  186. package/dist/types/server/runtime-space/errors.d.ts +1 -1
  187. package/dist/types/server/runtime-space/resolve.d.ts +2 -0
  188. package/dist/types/server/runtime-space/store.d.ts +8 -1
  189. package/dist/types/server/runtime-space/submit-steps.d.ts +2 -1
  190. package/dist/types/server/runtime-space/types.d.ts +3 -1
  191. package/dist/types/shared/component-tree-errors.d.ts +2 -1
  192. package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
  193. package/dist/types/shared/declaration-keys.d.ts +1 -1
  194. package/dist/types/shared/engines/engine-error.d.ts +2 -1
  195. package/dist/types/shared/generation-error.d.ts +2 -1
  196. package/dist/types/shared/pure-binding.d.ts +48 -0
  197. package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +119 -158
  198. package/dist/types/shared/registry-generated/limits.d.ts +40 -10
  199. package/dist/types/shared/registry-generated/std-grammar-completion.d.ts +0 -30
  200. package/dist/types/shared/registry-generated/std-grammar-views.d.ts +97 -23
  201. package/dist/types/shared/registry-generated/std-grammar.d.ts +109 -241
  202. package/dist/types/shared/soma-error.d.ts +15 -0
  203. package/dist/types/shared/types/data-config.types.d.ts +14 -16
  204. package/dist/types/shared/types/engine.types.d.ts +0 -3
  205. package/dist/types/shared/types/event.types.d.ts +1 -7
  206. package/dist/types/shared/types/generation-error.types.d.ts +1 -1
  207. package/dist/types/shared/types/host-assembly.types.d.ts +2 -0
  208. package/dist/types/shared/types/manifest.types.d.ts +0 -3
  209. package/dist/types/shared/types/region-scope.types.d.ts +4 -1
  210. package/dist/types/shared/types/scope-manifest.types.d.ts +0 -2
  211. package/dist/types/shared/types/style-config.types.d.ts +17 -19
  212. package/dist/types/shared/types/ui-config.types.d.ts +4 -5
  213. package/host-native/bin/host-native.cjs +22 -1
  214. package/host-native/client/browser-entry.ts +21 -172
  215. package/host-native/src/aot-builder.ts +52 -0
  216. package/host-native/src/host-prepare.ts +39 -5
  217. package/host-native/src/manifest-http.ts +2 -3
  218. package/host-native/src/native-server.ts +812 -174
  219. package/host-native/src/page-http.ts +3 -3
  220. package/host-native/src/public-packages.cjs +0 -1
  221. package/host-native/src/registry-handler.ts +12 -5
  222. package/host-native/src/static-file.ts +203 -53
  223. package/package.json +3 -2
  224. package/core/client/engine/step-runner.ts +0 -212
  225. package/core/client/engine/trigger-engine.ts +0 -55
  226. package/core/client/format/zoned.ts +0 -10
  227. package/core/client/parser/step-parser.ts +0 -359
  228. package/core/client/parser/trigger-parser.ts +0 -90
  229. package/core/client/parser/value-lang.ts +0 -340
  230. package/core/client/time/instant.ts +0 -2
  231. package/core/shared/calc/coerce.ts +0 -2
  232. package/core/shared/calc/errors.ts +0 -40
  233. package/core/shared/calc/evaluator.ts +0 -113
  234. package/core/shared/calc/index.ts +0 -11
  235. package/core/shared/calc/lexer.ts +0 -189
  236. package/core/shared/calc/parser.ts +0 -193
  237. package/core/shared/calc/typer.ts +0 -171
  238. package/core/shared/date-parts.ts +0 -2
  239. package/core/shared/show-when.ts +0 -77
  240. package/core/shared/types/step.types.ts +0 -91
  241. package/core/shared/types/trigger.types.ts +0 -14
  242. package/dist/types/client/engine/step-runner.d.ts +0 -42
  243. package/dist/types/client/engine/trigger-engine.d.ts +0 -16
  244. package/dist/types/client/format/zoned.d.ts +0 -1
  245. package/dist/types/client/parser/step-parser.d.ts +0 -23
  246. package/dist/types/client/parser/trigger-parser.d.ts +0 -13
  247. package/dist/types/client/parser/value-lang.d.ts +0 -63
  248. package/dist/types/client/time/instant.d.ts +0 -1
  249. package/dist/types/shared/calc/coerce.d.ts +0 -1
  250. package/dist/types/shared/calc/errors.d.ts +0 -14
  251. package/dist/types/shared/calc/evaluator.d.ts +0 -2
  252. package/dist/types/shared/calc/index.d.ts +0 -6
  253. package/dist/types/shared/calc/lexer.d.ts +0 -19
  254. package/dist/types/shared/calc/parser.d.ts +0 -43
  255. package/dist/types/shared/calc/typer.d.ts +0 -11
  256. package/dist/types/shared/date-parts.d.ts +0 -1
  257. package/dist/types/shared/show-when.d.ts +0 -21
  258. package/dist/types/shared/types/step.types.d.ts +0 -76
  259. package/dist/types/shared/types/trigger.types.d.ts +0 -12
@@ -1,10 +1,10 @@
1
1
  // 对应《soma 数据对象层》:core 的数据对象最小形状。
2
2
  // 数据对象是命名数据(如 order),来源是一个或多个后端接口;组件与页面只认对象与字段,不认接口协议。
3
- // core 只认:取数(from / transform / into / poll / subscribe)、写通道(create / update / delete / map / only /
3
+ // core 只认:取数(from / into / poll / subscribe)、写通道(create / update / delete / map / only /
4
4
  // validate_on / version)、字段字典(name / type / options / default / rules)。键集真源是 std-grammar.json。
5
5
  // 其余业务声明不在 core。
6
6
 
7
- import type { SomaFieldPredicate, SomaNamedPredicates } from '../predicates';
7
+ import type { SomaFieldPredicate } from '../predicates';
8
8
  import type { SomaWriteActionName, SomaWriteOutcomeView } from './write-outcome-view.types';
9
9
  import type { SomaWriteOutcomeMeta } from './write.types';
10
10
  import {
@@ -79,8 +79,6 @@ export interface SomaDataFieldRule {
79
79
  severity?: SomaValidationSeverity;
80
80
  /** 校验失败提示文案 */
81
81
  message: string;
82
- /** 条件规则(`rules[].when`):对所在记录求值的字段谓词,成立才执行本条规则;没写 = 恒参与 */
83
- when?: SomaFieldPredicate;
84
82
  }
85
83
 
86
84
  /** 字段字典条目(驱动 UI 的元数据,全部可选) */
@@ -95,12 +93,6 @@ export interface SomaDataFieldConfig {
95
93
  options?: SomaDataFieldOption[];
96
94
  /** 缺省值 */
97
95
  default?: unknown;
98
- /**
99
- * 派生列:`"[revenue] - [cost]"`。受限算式(方括号引用同对象字段、四则、比较、六个函数),
100
- * 解析期推出结果类型并与声明的 `type` 对账;取数收尾时由 core 算出来挂到记录上。
101
- * 派生字段是算出来的,提交时不能写它。
102
- */
103
- calc?: string;
104
96
  }
105
97
 
106
98
  /**
@@ -212,19 +204,12 @@ export interface SomaDataObjectConfig {
212
204
  displayName?: string;
213
205
  /** 取数来源列表 */
214
206
  from: SomaDataSourceConfig[];
215
- /**
216
- * 派生字段:值为 "源字段路径 | 管道链"(复用 pipe-registry)。
217
- * 解析期已归一化为标准管道语法(`date: 'x'` → `date('x')`)。
218
- */
219
- transform?: Record<string, string>;
220
207
  /** 字段字典(字段名 → 字典条目) */
221
208
  fields?: Record<string, SomaDataFieldConfig>;
222
209
  /** 写通道声明;不给 = 该对象只读 */
223
210
  write?: SomaDataWriteConfig;
224
211
  /** 对象级轮询:服务端状态会自己变的对象(排队 → 生成中 → 已生成) */
225
212
  poll?: SomaObjectPoll;
226
- /** 具名谓词表:`{ 名字: 谓词 }`,条件规则 `{ ref: 名字 }` 复用 */
227
- predicates?: SomaNamedPredicates;
228
213
  /** 解析期提取:params 引用到的其他数据对象名(DAG 拓扑排序输入,不含自引用) */
229
214
  deps: string[];
230
215
  }
@@ -249,6 +234,19 @@ export type SomaCommandResult =
249
234
  | { ok: true; data?: unknown; refreshError?: string; status?: number }
250
235
  | { ok: false; message: string; status?: number; fieldErrors?: Record<string, string> };
251
236
 
237
+ /** 数据对象标准读状态 */
238
+ export type SomaDataReadState = 'idle' | 'loading' | 'ready' | 'error' | 'forbidden' | 'partial';
239
+
240
+ /** 数据对象完整读状态视图(同时以非枚举属性挂在数据对象自身上) */
241
+ export interface SomaDataReadStatus {
242
+ readonly readState: SomaDataReadState;
243
+ readonly loading: boolean;
244
+ readonly ready: boolean;
245
+ readonly errorMessage?: string;
246
+ readonly errorStatus?: number;
247
+ readonly retry?: () => Promise<void>;
248
+ }
249
+
252
250
  /**
253
251
  * 注入给组件的数据端口(services 白名单里的 `data`)。
254
252
  * 复杂度沉引擎:组件只做「收值 → 调 submit → 渲染返回的 fieldErrors」。
@@ -258,6 +256,8 @@ export interface SomaDataPort {
258
256
  getObject(name: string): unknown;
259
257
  /** 对象读状态:`idle` = 因 `from[].require` 的必填参数缺而跳过过请求;`ready` = 其余;未声明 / 数据层未就绪 = undefined */
260
258
  getObjectStatus?(name: string): 'idle' | 'ready' | undefined;
259
+ /** 对象完整读状态(含 loading / ready / error / forbidden / partial、错误信息、状态码与 retry) */
260
+ getObjectReadStatus?(name: string): SomaDataReadStatus | undefined;
261
261
  /** 字段字典(控件 / 校验来源) */
262
262
  getDict(name: string): Record<string, SomaDataFieldConfig>;
263
263
  /** 提交:剔只读字段、map/only、基础规则校验、version 令牌、构体、发请求、错误逆映射;从不抛 */
@@ -19,9 +19,6 @@ export interface BindingEntry {
19
19
  templateCache?: DocumentFragment;
20
20
  childShowConfig?: ShowMapping;
21
21
  attrName?: string;
22
- negate?: boolean;
23
- /** `when` 对象谓词(来自 SomaCompiledBinding.whenTest) */
24
- whenTest?: import('../show-when').SomaShowWhenTest;
25
22
  classRules?: Record<string, string>;
26
23
  /** 展示格式化管道链(text/attr 绑定,来自 SomaCompiledBinding.pipes) */
27
24
  pipes?: import('./scope-manifest.types').SomaPipeCall[];
@@ -5,7 +5,6 @@
5
5
  * 事件类型枚举
6
6
  * 定义 Pipeline DSL 支持的四种事件处理类型
7
7
  */
8
- import type { SomaStepGraph } from './step.types';
9
8
  import type { SomaScopeEventSpec } from './region-scope.types';
10
9
 
11
10
  export type EventType =
@@ -27,10 +26,7 @@ export type EventType =
27
26
  // 声明式提示(《core 标准声明面审计》S3 / S7):`NOTIFY | <级别> | <文案key> [| sticky] [| polite|assertive]`。
28
27
  // 级别闭集见 NOTIFY_LEVELS;落点由 core 实现(INotifyService / announcer),不经 Host 注册表。
29
28
  | 'NOTIFY'
30
- // 编排事件(REQ-010 F-13):值不是一条管道字符串,而是 `{ steps: [...] }`。
31
- // 它不能写成管道串——一串步骤没法压进一行竖线分隔的文本,硬压只会得到
32
- // 一门新的微型语法。所以它只从对象形态来,`parsePipelineBody` 不认它。
33
- | 'STEPS';
29
+ ;
34
30
 
35
31
  /**
36
32
  * UI 交互动作枚举
@@ -85,12 +81,6 @@ export interface SomaConfirmSpec {
85
81
  * Pipeline DSL 解析器将 YAML 中的事件声明解析为此结构
86
82
  */
87
83
  export interface ParsedEvent {
88
- /**
89
- * 动作编排图(`type === 'STEPS'` 时有)。
90
- * 解析在 `step-parser`,执行在 `step-runner`;不带它的事件走原来的单管道路径。
91
- */
92
- steps?: SomaStepGraph;
93
-
94
84
  /** 目标元素的 data-soma-id 值 */
95
85
  somaId: string;
96
86
 
@@ -25,7 +25,7 @@ export const SOMA_GENERATION_ERROR_CODES = [
25
25
  // 数据对象标准键(C10a):对象 states 声明不合(形状 / 未知键 / kind 越界 / 状态值不在状态字段候选里 / 与候选 class 不一致)、
26
26
  // 字段 screens 声明不合(值不在屏闭集 / 动作屏指向不存在的动作键 / bulk 配只读字段)、对象 variants 声明不合(判别字段不存在 / 分组引用不存在的字段 / 组名不在候选里)
27
27
  // (core shared/object-standard.ts;解析器 client/parser/data-config-parser.ts 抛 SomaDataConfigError 时带码)
28
- 'ERR-BIZ-017', 'ERR-BIZ-018', 'ERR-BIZ-019',
28
+ 'ERR-BIZ-017', 'ERR-BIZ-018',
29
29
  'ERR-PAGE-001', 'ERR-PAGE-002', 'ERR-PAGE-003',
30
30
  'ERR-GEN-001', 'ERR-GEN-002', 'ERR-GEN-003', 'ERR-GEN-004',
31
31
  'ERR-GEN-005', 'ERR-GEN-006', 'ERR-GEN-007', 'ERR-GEN-008',
@@ -37,6 +37,8 @@ export const SOMA_GENERATION_ERROR_CODES = [
37
37
  'ERR-PAGE-005', 'ERR-PAGE-006', 'ERR-PAGE-007', 'ERR-PAGE-008',
38
38
  // 落定区域 IR(soma-ui settle/):区域内可见标题层级超限
39
39
  'ERR-PAGE-009',
40
+ // 展示对象绑定(soma-ui page/view-binding.ts):绑定值不是纯路径、成员 / 方法未声明、页面没写 view、落点不成立
41
+ 'ERR-PAGE-010', 'ERR-PAGE-011', 'ERR-PAGE-012', 'ERR-PAGE-013', 'ERR-PAGE-014', 'ERR-PAGE-015', 'ERR-PAGE-016',
40
42
  'ERR-UNIT-001', 'ERR-UNIT-002', 'ERR-UNIT-003',
41
43
  'ERR-RUN-001', 'ERR-RUN-002', 'ERR-RUN-003',
42
44
  'ERR-PUB-001', 'ERR-PUB-002', 'ERR-PUB-003',
@@ -46,6 +48,8 @@ export const SOMA_GENERATION_ERROR_CODES = [
46
48
  // 应用装配(soma-ui 编译器 ERR-APP 族)与多语言(ERR-LOCALE 族):信封跨层转出,码义归 soma-ui
47
49
  'ERR-APP-001', 'ERR-APP-002', 'ERR-APP-003', 'ERR-APP-004', 'ERR-APP-005', 'ERR-APP-006',
48
50
  'ERR-APP-007', 'ERR-APP-008', 'ERR-APP-009', 'ERR-APP-010', 'ERR-APP-011', 'ERR-APP-012', 'ERR-APP-013', 'ERR-APP-014', 'ERR-APP-015',
51
+ // 展示对象(soma-ui defineUiView):view 未登记 / 与 domain 冲突、与页面不是 1:1
52
+ 'ERR-APP-016', 'ERR-APP-017', 'ERR-APP-018', 'ERR-APP-019',
49
53
  'ERR-LOCALE-001', 'ERR-LOCALE-002', 'ERR-LOCALE-003',
50
54
  ] as const;
51
55
 
@@ -14,7 +14,13 @@ import type { TreeCompileContext } from './component-tree.types';
14
14
  /** 服务端 Host 请求钩子(形状同 `SomaRequestHook`) */
15
15
  export type SomaHostAssemblyRequestHook = (
16
16
  request: Request,
17
- context: { readonly kind: 'page' | 'api'; readonly path: string; readonly pageHref?: string },
17
+ context: {
18
+ readonly kind: 'page' | 'api';
19
+ readonly path: string;
20
+ readonly pageHref?: string;
21
+ /** 原生宿主可选惰性读取入口;返回副本,限流并响应客户端断连。 */
22
+ readonly readBody?: () => Promise<Uint8Array>;
23
+ },
18
24
  ) => Response | undefined | Promise<Response | undefined>;
19
25
 
20
26
  /** 虚拟页登记项(形状同 `SomaVirtualPageRegistration`) */
@@ -11,9 +11,6 @@ export interface SomaCompiledBinding {
11
11
  dataPath: string;
12
12
  watchPaths: string[];
13
13
  attrName?: string;
14
- negate?: boolean;
15
- /** `when` 对象谓词(type 为 when 时;路径在 dataPath);缺省 = 字符串形的真值判定 */
16
- whenTest?: import('../show-when').SomaShowWhenTest;
17
14
  classRules?: Record<string, string>;
18
15
  childShowConfig?: ShowMapping;
19
16
  /** 静态提升标记:值在初始化后不会变化,不需要注册 watchPaths */
@@ -13,6 +13,8 @@
13
13
  // · `ready` 位:声明了 `ready: true` 的切片初值为未就绪,由 owner 置位;读者见到未就绪不得发首个请求
14
14
  // (例:filter 切片在初始过滤恢复完成前,表格不取数)。
15
15
 
16
+ import { SomaError } from '../soma-error';
17
+
16
18
  /** 切片名闭集(至多 8 个;真源 soma-design `pipeline/region-scope#/spec/slices/names`) */
17
19
  export const SOMA_REGION_SLICE_NAMES = ['filter', 'view', 'selection', 'focus', 'results', 'navigation', 'monitor', 'pending'] as const;
18
20
  export type SomaRegionSliceName = (typeof SOMA_REGION_SLICE_NAMES)[number];
@@ -139,6 +141,8 @@ export interface SomaRegionPort {
139
141
  slice(name: SomaRegionSliceName): SomaRegionSliceHandle | null;
140
142
  /** 订阅路由上抛的语义事件(事件类型 `SCOPE | semantic`);返回退订函数 */
141
143
  onSemantic(listener: (name: string, payload: Readonly<Record<string, unknown>>) => void): () => void;
144
+ /** 发语义事件(与 `SCOPE | semantic` 管道同一条通道,订阅方是同一批);组件 / 展示对象在代码里按顺序编排时用 */
145
+ emit(name: string, payload?: Readonly<Record<string, unknown>>): void;
142
146
  }
143
147
 
144
148
  /** 组件端 `ctx.services.region`:按作用域 id 取端口;作用域未声明、端口已失效返回 null */
@@ -161,7 +165,7 @@ export interface SomaScopeEventSpec {
161
165
  export const SOMA_REGION_SCOPE_ERROR = 'ERR-RUN-001' as const;
162
166
 
163
167
  /** 区域协调的运行期缺陷(非 owner / 非路径写者写切片等);与 ERR-RUN-001 同级,只影响该区域 */
164
- export class SomaRegionScopeError extends Error {
168
+ export class SomaRegionScopeError extends SomaError {
165
169
  readonly code = SOMA_REGION_SCOPE_ERROR;
166
170
  readonly scopeId: string;
167
171
  readonly slice: string;
@@ -35,8 +35,6 @@ export interface SomaPropBinding {
35
35
  /** 已解析的绑定路径;与 literal 二选一 */
36
36
  source?: string;
37
37
  literal?: unknown;
38
- /** 布尔 prop 的 `!` 前缀(沿用 when 语义,不引入其他运算) */
39
- negate?: boolean;
40
38
  mode: SomaPropMode;
41
39
  pipes?: SomaPipeCall[];
42
40
  }
@@ -11,16 +11,15 @@
11
11
  export type SomaStyleViolationKind = 'layout-class';
12
12
 
13
13
  /**
14
- * 状态驱动的样式规则
15
- * 当 condition 路径的值等于 value 时,将 apply 中的类名应用到对应 DOM 节点
14
+ * 类名档位绑定(纯绑定):`bind` 路径指向展示对象的成员,成员的值就是档位名;
15
+ * 档位名命中 `tiers` 的键时,应用该档位的类名,其余档位的类名一律移除;不在闭集内时不加任何类。
16
+ * 页面不写「等于某值」的比较;档位名闭集形态与个数上限见 std-grammar.json#pageForbiddenLogicKeys.pureBinding.styleTier。
16
17
  */
17
- export interface StyleStateRule {
18
- /** 数据路径(纯属性路径,禁止逻辑表达式) */
19
- condition: string;
20
- /** 目标值(基础类型:string | number | boolean | null) */
21
- value: string | number | boolean | null;
22
- /** 匹配时应用的 CSS 类名;具体样式由宿主样式系统提供 */
23
- apply: string;
18
+ export interface StyleTierBinding {
19
+ /** 展示对象成员的纯路径(点分标识符,无取反 / 管道 / 运算符) */
20
+ bind: string;
21
+ /** 档位名 → 类名串;具体样式由宿主样式系统提供 */
22
+ tiers: Record<string, string>;
24
23
  }
25
24
 
26
25
  /**
@@ -37,16 +36,17 @@ export type TransitionTrigger =
37
36
  /**
38
37
  * 过渡/动画配置
39
38
  */
40
- export interface StyleTransition {
41
- /** 触发方式 */
42
- trigger: TransitionTrigger;
43
- /** 应用的 CSS 动画/过渡类名;具体样式由宿主样式系统提供 */
44
- apply: string;
45
- /** active_state 类型时的条件路径 */
46
- condition?: string;
47
- /** active_state 类型时的目标值 */
48
- value?: string | number | boolean | null;
49
- }
39
+ export type StyleTransition =
40
+ | {
41
+ /** DOM 事件 / 入离场触发 */
42
+ trigger: Exclude<TransitionTrigger, 'active_state'>;
43
+ /** 应用的 CSS 动画/过渡类名;具体样式由宿主样式系统提供 */
44
+ apply: string;
45
+ }
46
+ | ({
47
+ /** 状态驱动:纯绑定,成员的值就是档位名 */
48
+ trigger: 'active_state';
49
+ } & StyleTierBinding);
50
50
 
51
51
  /**
52
52
  * 样式配置顶层结构
@@ -57,8 +57,8 @@ export interface StyleConfig {
57
57
  host: string;
58
58
  /** 基础静态样式映射:somaId → CSS 类名 */
59
59
  base: Record<string, string>;
60
- /** 状态驱动样式:somaId → 规则数组 */
61
- states: Record<string, StyleStateRule[]>;
60
+ /** 状态驱动样式:somaId → 类名档位绑定 */
61
+ states: Record<string, StyleTierBinding>;
62
62
  /** 动态交互与动画:somaId → 过渡配置 */
63
63
  transitions: Record<string, StyleTransition>;
64
64
  }
@@ -4,7 +4,6 @@
4
4
  import type { OnChangeRule } from './watcher.types';
5
5
  import type { SomaPageStateConfig } from './page-state.types';
6
6
  import type { SomaScopeDecl } from './region-scope.types';
7
- import type { SomaShowWhen } from '../show-when';
8
7
 
9
8
  /**
10
9
  * 作用域声明
@@ -54,8 +53,8 @@ export interface NestedShowMapping {
54
53
  bind: BindDeclaration;
55
54
  /** 子级展示映射 */
56
55
  show: ShowMapping;
57
- /** 整块显隐:与 bind 同处一个配置对象(另起同名键会覆盖列表绑定);字符串形或对象谓词 */
58
- when?: SomaShowWhen;
56
+ /** 整块显隐:与 bind 同处一个配置对象(另起同名键会覆盖列表绑定);纯路径字符串("!path" 取反),值由展示对象给出 */
57
+ when?: string;
59
58
  }
60
59
 
61
60
  /**
@@ -67,8 +66,8 @@ export interface ExtendedShowValue {
67
66
  text?: string;
68
67
  /** 双向绑定路径(表单控件) */
69
68
  model?: string;
70
- /** 条件渲染:路径字符串(truthy 显示,"!path" 取反),或对象谓词 `{ field, op, value? }`(`present` / `blank` 判有无值,0 与 false 算有值) */
71
- when?: SomaShowWhen;
69
+ /** 条件渲染:纯路径字符串(truthy 显示,"!path" 取反),布尔值由展示对象 / 业务对象给出 */
70
+ when?: string;
72
71
  /** CSS 类名动态绑定 { "class-names": "condition-path" } */
73
72
  class?: Record<string, string>;
74
73
  /** 子级展示映射 */
@@ -1,4 +1,4 @@
1
- // 属性监听器类型 — RenderEngine.watch / onChange / triggers 共用
1
+ // 属性监听器类型 — RenderEngine.watch / onChange 共用
2
2
 
3
3
  export type WatchCallback = (
4
4
  newValue: unknown,
@@ -704,8 +704,9 @@
704
704
  "../node_modules/zrender/node_modules/tslib/tslib.es6.js",
705
705
  "../soma-foundation/dist/esm/design-generated/impl/_data.js",
706
706
  "../soma-foundation/dist/esm/design-generated/impl/naming.js",
707
+ "../soma-foundation/dist/esm/design-generated/view-state-rules.js",
707
708
  "../soma-foundation/dist/esm/design/naming.js",
708
- "../soma-foundation/dist/esm/predicates/calc-coerce.js",
709
+ "../soma-foundation/dist/esm/layout/limits.generated.js",
709
710
  "../soma-foundation/dist/esm/predicates/generated/field-type-caps.js",
710
711
  "../soma-foundation/dist/esm/predicates/generated/predicate-ops.js",
711
712
  "../soma-foundation/dist/esm/predicates/generated/relative-window-units.js",
@@ -713,6 +714,7 @@
713
714
  "../soma-foundation/dist/esm/predicates/normalize-predicate.js",
714
715
  "../soma-foundation/dist/esm/predicates/predicates.js",
715
716
  "../soma-foundation/dist/esm/predicates/relative-window.js",
717
+ "../soma-foundation/dist/esm/predicates/value-coerce.js",
716
718
  "../soma-foundation/dist/esm/values/api-template.js",
717
719
  "../soma-foundation/dist/esm/values/civil-date.js",
718
720
  "../soma-foundation/dist/esm/values/clock.js",
@@ -722,10 +724,14 @@
722
724
  "../soma-foundation/dist/esm/values/duration.js",
723
725
  "../soma-foundation/dist/esm/values/field-rules.js",
724
726
  "../soma-foundation/dist/esm/values/formatter.js",
727
+ "../soma-foundation/dist/esm/values/http-request-timeout.generated.js",
725
728
  "../soma-foundation/dist/esm/values/index.js",
726
729
  "../soma-foundation/dist/esm/values/instant.js",
727
730
  "../soma-foundation/dist/esm/values/rule-step.js",
728
731
  "../soma-foundation/dist/esm/values/zoned.js",
732
+ "../soma-foundation/dist/esm/view-state/index.js",
733
+ "../soma-foundation/dist/esm/view-state/scan.js",
734
+ "../soma-foundation/dist/esm/view-state/shape.js",
729
735
  "core/client/a11y/a11y-config.ts",
730
736
  "core/client/a11y/announcer.ts",
731
737
  "core/client/a11y/motion-hook.ts",
@@ -743,8 +749,10 @@
743
749
  "core/client/base/decorators/Show.ts",
744
750
  "core/client/base/decorators/ShowList.ts",
745
751
  "core/client/base/decorators/index.ts",
752
+ "core/client/base/defineSomaView.ts",
746
753
  "core/client/base/index.ts",
747
754
  "core/client/base/runAsync.ts",
755
+ "core/client/base/view-context.ts",
748
756
  "core/client/behavior/adapter-popper.ts",
749
757
  "core/client/behavior/port.ts",
750
758
  "core/client/behavior/positioner.ts",
@@ -795,10 +803,8 @@
795
803
  "core/client/engine/runtime-builder.ts",
796
804
  "core/client/engine/scope-resolver.ts",
797
805
  "core/client/engine/soma-bootstrap.ts",
798
- "core/client/engine/step-runner.ts",
799
806
  "core/client/engine/style-binder.ts",
800
807
  "core/client/engine/timer-engine.ts",
801
- "core/client/engine/trigger-engine.ts",
802
808
  "core/client/engines/chart/adapter-echarts.ts",
803
809
  "core/client/engines/chart/index.ts",
804
810
  "core/client/engines/chart/kind-modules.ts",
@@ -860,11 +866,9 @@
860
866
  "core/client/parser/duration.ts",
861
867
  "core/client/parser/page-state-parser.ts",
862
868
  "core/client/parser/pipeline-parser.ts",
863
- "core/client/parser/step-parser.ts",
864
869
  "core/client/parser/style-config-parser.ts",
865
870
  "core/client/parser/subscribe-parser.ts",
866
871
  "core/client/parser/timer-parser.ts",
867
- "core/client/parser/trigger-parser.ts",
868
872
  "core/client/parser/ui-config-parser.ts",
869
873
  "core/client/pipes/pipe-registry.ts",
870
874
  "core/client/runtime-entry.ts",
@@ -892,13 +896,6 @@
892
896
  "core/client/validation/object-rules.ts",
893
897
  "core/shared/anchor-space.ts",
894
898
  "core/shared/artifact-compatibility.ts",
895
- "core/shared/calc/coerce.ts",
896
- "core/shared/calc/errors.ts",
897
- "core/shared/calc/evaluator.ts",
898
- "core/shared/calc/index.ts",
899
- "core/shared/calc/lexer.ts",
900
- "core/shared/calc/parser.ts",
901
- "core/shared/calc/typer.ts",
902
899
  "core/shared/component-tree-artifact.ts",
903
900
  "core/shared/component-tree-errors.ts",
904
901
  "core/shared/contract-a11y.ts",
@@ -916,12 +913,13 @@
916
913
  "core/shared/page-scopes.ts",
917
914
  "core/shared/predicates/index.ts",
918
915
  "core/shared/predicates/relative-window.ts",
916
+ "core/shared/pure-binding.ts",
919
917
  "core/shared/region-scope-decl.ts",
920
918
  "core/shared/registry-generated/limits.ts",
921
919
  "core/shared/registry-generated/platform-keys.ts",
922
920
  "core/shared/registry-generated/std-grammar-views.ts",
923
921
  "core/shared/sha256.ts",
924
- "core/shared/show-when.ts",
922
+ "core/shared/soma-error.ts",
925
923
  "core/shared/types/component-contract.types.ts",
926
924
  "core/shared/types/component-tree-artifact.types.ts",
927
925
  "core/shared/types/data-config.types.ts",