soma-core 2.2.5 → 2.2.7
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.
- package/README.md +5 -6
- package/bin/soma.cjs +2 -2
- package/core/build/compiler/flat-page.ts +16 -0
- package/core/build/compiler/full-manifest-builder.ts +0 -3
- package/core/build/compiler/page-assets.ts +0 -1
- package/core/build/compiler/page-closure.ts +245 -0
- package/core/build/compiler/page-declaration-compiler.ts +2 -5
- package/core/build/compiler/soma-precompile.js +1972 -3312
- package/core/build/compiler/soma-precompile.ts +4 -7
- package/core/build/component-tree/artifact-codec.ts +4 -8
- package/core/build/lsp/soma-declaration.cjs +1 -1
- package/core/build/lsp/std-completion.generated.json +3 -3
- package/core/client/a11y/a11y-config.ts +2 -1
- package/core/client/a11y/dom-id.ts +1 -1
- package/core/client/base/SomaHttpClient.ts +11 -3
- package/core/client/base/SomaPageRootBase.ts +6 -0
- package/core/client/base/defineSomaView.ts +178 -0
- package/core/client/base/index.ts +13 -0
- package/core/client/base/view-context.ts +328 -0
- package/core/client/behavior/adapter-collection.ts +2 -2
- package/core/client/compiler/manifest-compiler.ts +5 -36
- package/core/client/component/component-definition.types.ts +2 -1
- package/core/client/component/component-manager.ts +110 -20
- package/core/client/component/structure-adapter.ts +3 -7
- package/core/client/container/IContainerAdapter.ts +4 -0
- package/core/client/container/SomaContainerAdapter.ts +52 -3
- package/core/client/data/data-object-resolver.ts +523 -184
- package/core/client/data/data-write-actions.ts +79 -15
- package/core/client/data/format-config.ts +3 -1
- package/core/client/data/region-scope-port.ts +11 -0
- package/core/client/engine/asset-resolver.ts +2 -5
- package/core/client/engine/dom-renderer.ts +7 -40
- package/core/client/engine/event-engine.ts +29 -108
- package/core/client/engine/property-watcher.ts +1 -1
- package/core/client/engine/reactive-proxy.ts +78 -17
- package/core/client/engine/runtime-builder.ts +0 -14
- package/core/client/engine/scope-resolver.ts +18 -0
- package/core/client/engine/soma-bootstrap.ts +387 -99
- package/core/client/engine/style-binder.ts +49 -106
- package/core/client/engine/timer-engine.ts +11 -1
- package/core/client/host-bridge/load-host-domain-class.ts +2 -1
- package/core/client/infra/http/SomaHttpService.ts +15 -4
- package/core/client/infra/i18n/pack-locales.ts +2 -2
- package/core/client/infra/notify/DefaultNotifyService.ts +2 -2
- package/core/client/mount/domain-rule.ts +7 -3
- package/core/client/mount/mount-page.ts +38 -5
- package/core/client/mount/types.ts +2 -0
- package/core/client/parser/confirm-spec.ts +100 -7
- package/core/client/parser/data-config-parser.ts +28 -211
- package/core/client/parser/pipeline-parser.ts +16 -60
- package/core/client/parser/style-config-parser.ts +101 -95
- package/core/client/parser/timer-parser.ts +21 -0
- package/core/client/parser/ui-config-parser.ts +64 -12
- package/core/client/registry/declaration-renderer.ts +1 -1
- package/core/client/render-ports/hide-transition.ts +9 -0
- package/core/client/render-ports/index.ts +4 -0
- package/core/client/render-ports/notify-renderer.ts +2 -1
- package/core/client/runtime/SomaRuntimeServices.ts +2 -1
- package/core/client/runtime/SomaSnapshotStore.ts +5 -0
- package/core/client/security/url-guard.ts +71 -11
- package/core/client/validation/async-check-registry.ts +2 -1
- package/core/client/validation/contract-validator.ts +2 -6
- package/core/client/validation/field-rules.ts +3 -13
- package/core/client/validation/object-rules.ts +2 -10
- package/core/index.ts +17 -39
- package/core/inspect/check-product.ts +5 -5
- package/core/inspect/runtime.ts +2 -1
- package/core/server/api/dispatch-service-api.ts +35 -36
- package/core/server/api/load-host-service.ts +8 -4
- package/core/server/api/paged-list.ts +259 -0
- package/core/server/compile-port.ts +1 -1
- package/core/server/host/app-config-composer.ts +2 -1
- package/core/server/host/empty-host-bootstrap.mjs +3 -0
- package/core/server/host/host-assembly-entry.ts +1 -0
- package/core/server/host/host-assembly.ts +50 -3
- package/core/server/host/host-caller.ts +2 -1
- package/core/server/host/host-dir.ts +9 -0
- package/core/server/host/host-response-headers.ts +2 -1
- package/core/server/host/invoke-host-request-hook.ts +28 -4
- package/core/server/host/published-page-assets.ts +2 -1
- package/core/server/host/resolve-host-request-hook.ts +25 -7
- package/core/server/host/server-page-assets.ts +4 -4
- package/core/server/host/source-aliases.cjs +345 -0
- package/core/server/host/source-aliases.ts +32 -0
- package/core/server/host/source-packages.cjs +1 -0
- package/core/server/host/virtual-pages.ts +3 -2
- package/core/server/infra/cache/ServerFileCache.ts +83 -10
- package/core/server/node.ts +10 -0
- package/core/server/registry/api-registry-store.ts +3 -1
- package/core/server/registry/declaration-precompiler.ts +0 -2
- package/core/server/registry/page-registry-repository.ts +2 -1
- package/core/server/registry/page-registry-store.ts +2 -1
- package/core/server/registry/registry-error.ts +6 -1
- package/core/server/registry/registry-file-lock.ts +296 -23
- package/core/server/registry/request-body-limit.ts +3 -2
- package/core/server/registry/validation/declaration-safety-scan.ts +151 -27
- package/core/server/runtime-space/access-gate.ts +21 -7
- package/core/server/runtime-space/bindings.ts +3 -6
- package/core/server/runtime-space/dynamic-pages.ts +181 -49
- package/core/server/runtime-space/errors.ts +3 -0
- package/core/server/runtime-space/inject.ts +78 -16
- package/core/server/runtime-space/page-grants.ts +7 -1
- package/core/server/runtime-space/resolve.ts +66 -19
- package/core/server/runtime-space/store.ts +32 -3
- package/core/server/runtime-space/submit-steps.ts +2 -1
- package/core/server/runtime-space/types.ts +3 -1
- package/core/shared/component-tree-errors.ts +2 -1
- package/core/shared/contract-a11y.ts +1 -1
- package/core/shared/contract-sections.ts +2 -2
- package/core/shared/core-diagnostic-codes.ts +14 -0
- package/core/shared/data-declaration-checks.ts +29 -3
- package/core/shared/declaration-keys.ts +1 -1
- package/core/shared/engines/engine-error.ts +2 -1
- package/core/shared/generation-error.ts +2 -1
- package/core/shared/page-envelope.ts +1 -1
- package/core/shared/pure-binding.ts +88 -0
- package/core/shared/registry-generated/diagnostic-registry-index.ts +21 -19
- package/core/shared/registry-generated/diagnostic-registry.ts +170 -177
- package/core/shared/registry-generated/limits.ts +65 -13
- package/core/shared/registry-generated/std-grammar-completion.ts +0 -4
- package/core/shared/registry-generated/std-grammar-views.ts +40 -10
- package/core/shared/registry-generated/std-grammar.ts +43 -21
- package/core/shared/soma-error.ts +36 -0
- package/core/shared/types/compile-port.types.ts +1 -1
- package/core/shared/types/data-config.types.ts +20 -18
- package/core/shared/types/engine.types.ts +0 -3
- package/core/shared/types/event.types.ts +10 -11
- package/core/shared/types/generation-error.types.ts +5 -1
- package/core/shared/types/host-assembly.types.ts +7 -1
- package/core/shared/types/manifest.types.ts +0 -3
- package/core/shared/types/region-scope.types.ts +5 -1
- package/core/shared/types/scope-manifest.types.ts +0 -2
- package/core/shared/types/style-config.types.ts +21 -21
- package/core/shared/types/ui-config.types.ts +4 -5
- package/core/shared/types/watcher.types.ts +1 -1
- package/dist/browser/runtime-bundle.manifest.json +11 -13
- package/dist/browser/soma-runtime.js +2733 -2712
- package/dist/core/index.cjs +5665 -5534
- package/dist/host-native/aot-builder.cjs +330 -1
- package/dist/host-native/native-server.cjs +5434 -4726
- package/dist/lsp/component-tree.cjs +5868 -7040
- package/dist/types/build/compiler/full-manifest-builder.d.ts +0 -2
- package/dist/types/build/compiler/page-closure.d.ts +21 -0
- package/dist/types/build/compiler/page-declaration-compiler.d.ts +2 -4
- package/dist/types/build/compiler/soma-precompile.d.ts +1 -3
- package/dist/types/build/component-tree/artifact-codec.d.ts +0 -2
- package/dist/types/client/a11y/a11y-config.d.ts +2 -1
- package/dist/types/client/base/SomaHttpClient.d.ts +1 -1
- package/dist/types/client/base/SomaPageRootBase.d.ts +5 -0
- package/dist/types/client/base/defineSomaView.d.ts +46 -0
- package/dist/types/client/base/index.d.ts +2 -0
- package/dist/types/client/base/view-context.d.ts +136 -0
- package/dist/types/client/behavior/adapter-collection.d.ts +1 -1
- package/dist/types/client/compiler/manifest-compiler.d.ts +0 -3
- package/dist/types/client/component/component-definition.types.d.ts +2 -1
- package/dist/types/client/component/component-manager.d.ts +29 -0
- package/dist/types/client/container/IContainerAdapter.d.ts +3 -0
- package/dist/types/client/container/SomaContainerAdapter.d.ts +5 -0
- package/dist/types/client/data/data-object-resolver.d.ts +93 -31
- package/dist/types/client/data/format-config.d.ts +2 -1
- package/dist/types/client/engine/dom-renderer.d.ts +1 -2
- package/dist/types/client/engine/event-engine.d.ts +0 -7
- package/dist/types/client/engine/reactive-proxy.d.ts +11 -4
- package/dist/types/client/engine/runtime-builder.d.ts +0 -4
- package/dist/types/client/engine/soma-bootstrap.d.ts +44 -6
- package/dist/types/client/engine/style-binder.d.ts +8 -4
- package/dist/types/client/host-bridge/load-host-domain-class.d.ts +2 -1
- package/dist/types/client/mount/domain-rule.d.ts +2 -0
- package/dist/types/client/mount/mount-page.d.ts +2 -1
- package/dist/types/client/mount/types.d.ts +2 -0
- package/dist/types/client/parser/confirm-spec.d.ts +27 -3
- package/dist/types/client/parser/data-config-parser.d.ts +6 -5
- package/dist/types/client/parser/style-config-parser.d.ts +7 -3
- package/dist/types/client/parser/timer-parser.d.ts +5 -0
- package/dist/types/client/parser/ui-config-parser.d.ts +6 -2
- package/dist/types/client/render-ports/hide-transition.d.ts +9 -0
- package/dist/types/client/render-ports/index.d.ts +4 -0
- package/dist/types/client/render-ports/notify-renderer.d.ts +2 -1
- package/dist/types/client/runtime/SomaSnapshotStore.d.ts +2 -0
- package/dist/types/client/security/url-guard.d.ts +14 -0
- package/dist/types/client/validation/async-check-registry.d.ts +2 -1
- package/dist/types/client/validation/object-rules.d.ts +0 -5
- package/dist/types/index.d.ts +6 -11
- package/dist/types/inspect/runtime.d.ts +2 -1
- package/dist/types/server/api/dispatch-service-api.d.ts +5 -0
- package/dist/types/server/api/load-host-service.d.ts +1 -1
- package/dist/types/server/api/paged-list.d.ts +101 -0
- package/dist/types/server/compile-port.d.ts +1 -1
- package/dist/types/server/host/host-assembly-entry.d.ts +1 -1
- package/dist/types/server/host/host-assembly.d.ts +2 -0
- package/dist/types/server/host/host-dir.d.ts +2 -0
- package/dist/types/server/host/invoke-host-request-hook.d.ts +10 -3
- package/dist/types/server/host/published-page-assets.d.ts +2 -1
- package/dist/types/server/host/resolve-host-request-hook.d.ts +18 -5
- package/dist/types/server/host/server-page-assets.d.ts +2 -1
- package/dist/types/server/host/source-aliases.d.cts +53 -0
- package/dist/types/server/host/source-aliases.d.ts +30 -0
- package/dist/types/server/host/source-packages.d.cts +2 -0
- package/dist/types/server/infra/cache/ServerFileCache.d.ts +8 -0
- package/dist/types/server/node.d.ts +1 -0
- package/dist/types/server/registry/declaration-precompiler.d.ts +0 -1
- package/dist/types/server/registry/registry-error.d.ts +5 -1
- package/dist/types/server/registry/registry-file-lock.d.ts +30 -0
- package/dist/types/server/registry/request-body-limit.d.ts +3 -2
- package/dist/types/server/registry/validation/declaration-safety-scan.d.ts +3 -0
- package/dist/types/server/runtime-space/access-gate.d.ts +7 -0
- package/dist/types/server/runtime-space/bindings.d.ts +3 -2
- package/dist/types/server/runtime-space/dynamic-pages.d.ts +6 -1
- package/dist/types/server/runtime-space/errors.d.ts +1 -1
- package/dist/types/server/runtime-space/resolve.d.ts +2 -0
- package/dist/types/server/runtime-space/store.d.ts +8 -1
- package/dist/types/server/runtime-space/submit-steps.d.ts +2 -1
- package/dist/types/server/runtime-space/types.d.ts +3 -1
- package/dist/types/shared/component-tree-errors.d.ts +2 -1
- package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
- package/dist/types/shared/declaration-keys.d.ts +1 -1
- package/dist/types/shared/engines/engine-error.d.ts +2 -1
- package/dist/types/shared/generation-error.d.ts +2 -1
- package/dist/types/shared/pure-binding.d.ts +48 -0
- package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +149 -158
- package/dist/types/shared/registry-generated/limits.d.ts +54 -10
- package/dist/types/shared/registry-generated/std-grammar-completion.d.ts +0 -30
- package/dist/types/shared/registry-generated/std-grammar-views.d.ts +97 -23
- package/dist/types/shared/registry-generated/std-grammar.d.ts +110 -242
- package/dist/types/shared/soma-error.d.ts +15 -0
- package/dist/types/shared/types/data-config.types.d.ts +17 -17
- package/dist/types/shared/types/engine.types.d.ts +0 -3
- package/dist/types/shared/types/event.types.d.ts +9 -7
- package/dist/types/shared/types/generation-error.types.d.ts +1 -1
- package/dist/types/shared/types/host-assembly.types.d.ts +2 -0
- package/dist/types/shared/types/manifest.types.d.ts +0 -3
- package/dist/types/shared/types/region-scope.types.d.ts +4 -1
- package/dist/types/shared/types/scope-manifest.types.d.ts +0 -2
- package/dist/types/shared/types/style-config.types.d.ts +17 -19
- package/dist/types/shared/types/ui-config.types.d.ts +4 -5
- package/host-native/bin/host-native.cjs +22 -1
- package/host-native/client/browser-entry.ts +21 -172
- package/host-native/src/aot-builder.ts +75 -0
- package/host-native/src/host-prepare.ts +39 -5
- package/host-native/src/manifest-http.ts +2 -3
- package/host-native/src/native-server.ts +812 -174
- package/host-native/src/page-http.ts +3 -3
- package/host-native/src/public-packages.cjs +0 -1
- package/host-native/src/registry-handler.ts +12 -5
- package/host-native/src/static-file.ts +203 -53
- package/host-native/styles/globals.css +30 -28
- package/package.json +14 -2
- package/core/client/engine/step-runner.ts +0 -212
- package/core/client/engine/trigger-engine.ts +0 -55
- package/core/client/format/zoned.ts +0 -10
- package/core/client/parser/step-parser.ts +0 -359
- package/core/client/parser/trigger-parser.ts +0 -90
- package/core/client/parser/value-lang.ts +0 -340
- package/core/client/time/instant.ts +0 -2
- package/core/shared/calc/coerce.ts +0 -2
- package/core/shared/calc/errors.ts +0 -40
- package/core/shared/calc/evaluator.ts +0 -113
- package/core/shared/calc/index.ts +0 -11
- package/core/shared/calc/lexer.ts +0 -189
- package/core/shared/calc/parser.ts +0 -193
- package/core/shared/calc/typer.ts +0 -171
- package/core/shared/date-parts.ts +0 -2
- package/core/shared/show-when.ts +0 -77
- package/core/shared/types/step.types.ts +0 -91
- package/core/shared/types/trigger.types.ts +0 -14
- package/dist/types/client/engine/step-runner.d.ts +0 -42
- package/dist/types/client/engine/trigger-engine.d.ts +0 -16
- package/dist/types/client/format/zoned.d.ts +0 -1
- package/dist/types/client/parser/step-parser.d.ts +0 -23
- package/dist/types/client/parser/trigger-parser.d.ts +0 -13
- package/dist/types/client/parser/value-lang.d.ts +0 -63
- package/dist/types/client/time/instant.d.ts +0 -1
- package/dist/types/shared/calc/coerce.d.ts +0 -1
- package/dist/types/shared/calc/errors.d.ts +0 -14
- package/dist/types/shared/calc/evaluator.d.ts +0 -2
- package/dist/types/shared/calc/index.d.ts +0 -6
- package/dist/types/shared/calc/lexer.d.ts +0 -19
- package/dist/types/shared/calc/parser.d.ts +0 -43
- package/dist/types/shared/calc/typer.d.ts +0 -11
- package/dist/types/shared/date-parts.d.ts +0 -1
- package/dist/types/shared/show-when.d.ts +0 -21
- package/dist/types/shared/types/step.types.d.ts +0 -76
- package/dist/types/shared/types/trigger.types.d.ts +0 -12
|
@@ -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',
|
|
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: {
|
|
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
|
|
168
|
+
export class SomaRegionScopeError extends SomaError {
|
|
165
169
|
readonly code = SOMA_REGION_SCOPE_ERROR;
|
|
166
170
|
readonly scopeId: string;
|
|
167
171
|
readonly slice: string;
|
|
@@ -11,16 +11,15 @@
|
|
|
11
11
|
export type SomaStyleViolationKind = 'layout-class';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* 类名档位绑定(纯绑定):`bind` 路径指向展示对象的成员,成员的值就是档位名;
|
|
15
|
+
* 档位名命中 `tiers` 的键时,应用该档位的类名,其余档位的类名一律移除;不在闭集内时不加任何类。
|
|
16
|
+
* 页面不写「等于某值」的比较;档位名闭集形态与个数上限见 std-grammar.json#pageForbiddenLogicKeys.pureBinding.styleTier。
|
|
16
17
|
*/
|
|
17
|
-
export interface
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
|
|
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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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,
|
|
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?:
|
|
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
|
-
/**
|
|
71
|
-
when?:
|
|
69
|
+
/** 条件渲染:纯路径字符串(truthy 显示,"!path" 取反),布尔值由展示对象 / 业务对象给出 */
|
|
70
|
+
when?: string;
|
|
72
71
|
/** CSS 类名动态绑定 { "class-names": "condition-path" } */
|
|
73
72
|
class?: Record<string, string>;
|
|
74
73
|
/** 子级展示映射 */
|
|
@@ -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/
|
|
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/
|
|
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",
|