soma-core 1.5.1 → 2.0.0
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/app/SomaPageClient.tsx +28 -9
- package/app/soma/manifest/route.ts +3 -0
- package/bin/migrate.cjs +71 -1
- package/bin/soma-lsp.cjs +8 -1
- package/core/build/blocks/block-compile.ts +23 -5
- package/core/build/compiler/full-manifest-builder.ts +15 -0
- package/core/build/compiler/page-assets.ts +17 -1
- package/core/build/compiler/page-declaration-compiler.ts +67 -11
- package/core/build/compiler/precompiled-manifest-loader.ts +7 -0
- package/core/build/compiler/soma-manifest-webpack-plugin.js +7 -0
- package/core/build/compiler/soma-precompile.js +212 -21
- package/core/build/component/package-loader.ts +35 -4
- package/core/build/component-tree/artifact-codec.ts +192 -0
- package/core/build/component-tree/binding-bridge.ts +272 -0
- package/core/build/component-tree/collection-binding-lowerer.ts +65 -0
- package/core/build/component-tree/definition-preparation.ts +320 -0
- package/core/build/component-tree/migration-files.ts +214 -0
- package/core/build/component-tree/migration.ts +170 -0
- package/core/build/component-tree/parser.ts +362 -0
- package/core/build/component-tree/registry-snapshot.ts +317 -0
- package/core/build/component-tree/source-preflight.ts +132 -0
- package/core/build/component-tree/structure-topology.ts +63 -0
- package/core/build/component-tree/validator.ts +318 -0
- package/core/build/eject/component-eject.ts +1 -0
- package/core/build/lsp/component-tree-service.ts +79 -0
- package/core/build/lsp/component-tree.cjs +42 -0
- package/core/build/lsp/cross-file-diagnostics.cjs +15 -3
- package/core/build/lsp/extra-completion.cjs +7 -0
- package/core/client/adaptive/observer-pool.ts +122 -8
- package/core/client/compiler/manifest-compiler.ts +48 -5
- package/core/client/component/ai-catalog.ts +41 -3
- package/core/client/component/catalog-examples.ts +60 -0
- package/core/client/component/component-defaults.ts +1 -1
- package/core/client/component/component-definition.types.ts +9 -0
- package/core/client/component/component-expander.ts +22 -6
- package/core/client/component/component-manager.ts +881 -45
- package/core/client/component/component-pack.ts +1 -1
- package/core/client/component/component-registry.ts +11 -2
- package/core/client/component/scoped-adapter.ts +29 -2
- package/core/client/component/structure-adapter.ts +207 -0
- package/core/client/component/verify-pack.ts +21 -1
- package/core/client/container/SomaContainerAdapter.ts +103 -2
- package/core/client/data/data-object-resolver.ts +45 -1
- package/core/client/engine/asset-resolver.ts +1 -1
- package/core/client/engine/dom-renderer.ts +712 -26
- package/core/client/engine/event-engine.ts +328 -21
- package/core/client/engine/property-watcher.ts +164 -18
- package/core/client/engine/reactive-proxy.ts +194 -23
- package/core/client/engine/render-engine.ts +120 -11
- package/core/client/engine/row-range.ts +62 -0
- package/core/client/engine/row-scope.ts +77 -0
- package/core/client/engine/runtime-builder.ts +2 -0
- package/core/client/engine/scope-resolver.ts +3 -3
- package/core/client/engine/soma-bootstrap.ts +176 -17
- package/core/client/parser/adaptive-parser.ts +1 -1
- package/core/client/parser/annotation-extractor.ts +1 -1
- package/core/client/parser/blocks/page-parser.ts +53 -3
- package/core/client/parser/blocks/use-parser.ts +21 -6
- package/core/client/parser/data-config-parser.ts +1 -1
- package/core/client/parser/pipeline-parser.ts +252 -15
- package/core/client/parser/style-config-parser.ts +1 -1
- package/core/client/parser/timer-parser.ts +1 -1
- package/core/client/parser/trigger-parser.ts +1 -1
- package/core/client/parser/ui-config-parser.ts +39 -7
- package/core/client/pipes/pipe-registry.ts +45 -4
- package/core/client/registry/declaration-renderer.ts +32 -24
- package/core/client/registry/remote-page.ts +1 -1
- package/core/client/runtime/SomaSnapshotStore.ts +1 -1
- package/core/client/scheduler/SomaScheduler.ts +1 -1
- package/core/client/security/attribute-presence.ts +3 -0
- package/core/client/theme/harmony.ts +135 -13
- package/core/client/theme/scene-tokens.ts +17 -2
- package/core/client/theme/theme-axes.ts +43 -6
- package/core/client/theme/theme-engine.ts +921 -126
- package/core/client/validation/contract-validator.ts +2 -2
- package/core/index.ts +3 -0
- package/core/server/host/page-markup-config.ts +42 -0
- package/core/server/host/published-page-artifact-cache.ts +36 -4
- package/core/server/host/published-page-assets.ts +13 -7
- package/core/server/host/resolve-host-tree-context.ts +43 -0
- package/core/server/host/server-page-assets.ts +23 -4
- package/core/server/host/soma-page-compile.ts +10 -0
- package/core/server/mock/node/cli.mjs +3 -3
- package/core/server/page-declaration.ts +7 -0
- package/core/server/registry/declaration-precompiler.ts +35 -3
- package/core/server/registry/page-registry-repository.ts +31 -3
- package/core/server/registry/page-registry-store.ts +64 -7
- package/core/server/registry/publish-asset-pin.ts +6 -1
- package/core/server/registry/services/pages/Get.ts +11 -6
- package/core/server/registry/validation/compile-gate.ts +10 -1
- package/core/shared/component-tree-artifact.ts +237 -0
- package/core/shared/component-tree-errors.ts +52 -0
- package/core/shared/path-algebra.ts +1 -1
- package/core/shared/types/component-contract.types.ts +51 -0
- package/core/shared/types/component-tree-artifact.types.ts +121 -0
- package/core/shared/types/component-tree.types.ts +170 -0
- package/core/shared/types/engine.types.ts +5 -0
- package/core/shared/types/event.types.ts +8 -4
- package/core/shared/types/manifest.types.ts +4 -0
- package/core/shared/types/ui-config.types.ts +8 -0
- package/dist/cli/soma.js +1 -1
- package/dist/core/index.cjs +14508 -11358
- package/dist/lsp/component-tree.cjs +20997 -0
- package/dist/types/build/blocks/block-compile.d.ts +10 -1
- package/dist/types/build/compiler/full-manifest-builder.d.ts +9 -0
- package/dist/types/build/compiler/page-assets.d.ts +6 -1
- package/dist/types/build/compiler/page-declaration-compiler.d.ts +11 -1
- package/dist/types/build/component/package-loader.d.ts +4 -1
- package/dist/types/build/component-tree/artifact-codec.d.ts +50 -0
- package/dist/types/build/component-tree/binding-bridge.d.ts +19 -0
- package/dist/types/build/component-tree/collection-binding-lowerer.d.ts +18 -0
- package/dist/types/build/component-tree/definition-preparation.d.ts +11 -0
- package/dist/types/build/component-tree/migration-files.d.ts +35 -0
- package/dist/types/build/component-tree/migration.d.ts +28 -0
- package/dist/types/build/component-tree/parser.d.ts +13 -0
- package/dist/types/build/component-tree/registry-snapshot.d.ts +15 -0
- package/dist/types/build/component-tree/source-preflight.d.ts +22 -0
- package/dist/types/build/component-tree/structure-topology.d.ts +7 -0
- package/dist/types/build/component-tree/validator.d.ts +9 -0
- package/dist/types/build/lsp/component-tree-service.d.ts +34 -0
- package/dist/types/client/adaptive/observer-pool.d.ts +9 -2
- package/dist/types/client/compiler/manifest-compiler.d.ts +11 -2
- package/dist/types/client/component/ai-catalog.d.ts +18 -1
- package/dist/types/client/component/catalog-examples.d.ts +18 -0
- package/dist/types/client/component/component-definition.types.d.ts +9 -0
- package/dist/types/client/component/component-expander.d.ts +2 -1
- package/dist/types/client/component/component-manager.d.ts +97 -0
- package/dist/types/client/component/scoped-adapter.d.ts +1 -0
- package/dist/types/client/component/structure-adapter.d.ts +17 -0
- package/dist/types/client/container/SomaContainerAdapter.d.ts +8 -0
- package/dist/types/client/data/data-object-resolver.d.ts +19 -0
- package/dist/types/client/engine/dom-renderer.d.ts +125 -2
- package/dist/types/client/engine/event-engine.d.ts +62 -3
- package/dist/types/client/engine/property-watcher.d.ts +41 -1
- package/dist/types/client/engine/reactive-proxy.d.ts +42 -2
- package/dist/types/client/engine/render-engine.d.ts +55 -3
- package/dist/types/client/engine/row-range.d.ts +13 -0
- package/dist/types/client/engine/row-scope.d.ts +20 -0
- package/dist/types/client/engine/runtime-builder.d.ts +1 -0
- package/dist/types/client/engine/soma-bootstrap.d.ts +4 -1
- package/dist/types/client/parser/blocks/use-parser.d.ts +18 -0
- package/dist/types/client/parser/pipeline-parser.d.ts +12 -4
- package/dist/types/client/parser/ui-config-parser.d.ts +2 -0
- package/dist/types/client/pipes/pipe-registry.d.ts +39 -1
- package/dist/types/client/registry/declaration-renderer.d.ts +5 -1
- package/dist/types/client/registry/remote-page.d.ts +1 -1
- package/dist/types/client/theme/harmony.d.ts +44 -2
- package/dist/types/client/theme/scene-tokens.d.ts +11 -1
- package/dist/types/client/theme/theme-axes.d.ts +36 -6
- package/dist/types/index.d.ts +3 -1
- package/dist/types/server/host/page-markup-config.d.ts +6 -0
- package/dist/types/server/host/published-page-artifact-cache.d.ts +9 -1
- package/dist/types/server/host/published-page-assets.d.ts +5 -3
- package/dist/types/server/host/resolve-host-tree-context.d.ts +8 -0
- package/dist/types/server/host/server-page-assets.d.ts +6 -0
- package/dist/types/server/host/soma-page-compile.d.ts +10 -1
- package/dist/types/server/page-declaration.d.ts +6 -0
- package/dist/types/server/registry/declaration-precompiler.d.ts +8 -3
- package/dist/types/server/registry/page-registry-repository.d.ts +5 -0
- package/dist/types/server/registry/page-registry-store.d.ts +11 -1
- package/dist/types/server/registry/publish-asset-pin.d.ts +4 -0
- package/dist/types/server/registry/validation/compile-gate.d.ts +4 -1
- package/dist/types/shared/component-tree-artifact.d.ts +5 -0
- package/dist/types/shared/component-tree-errors.d.ts +22 -0
- package/dist/types/shared/types/component-contract.types.d.ts +42 -0
- package/dist/types/shared/types/component-tree-artifact.types.d.ts +104 -0
- package/dist/types/shared/types/component-tree.types.d.ts +149 -0
- package/dist/types/shared/types/engine.types.d.ts +5 -0
- package/dist/types/shared/types/event.types.d.ts +8 -4
- package/dist/types/shared/types/manifest.types.d.ts +4 -0
- package/dist/types/shared/types/ui-config.types.d.ts +8 -0
- package/package.json +5 -4
- package/dist/preview-export.cjs +0 -3401
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type CompiledPageDeclaration } from '../../build/compiler/page-declaration-compiler';
|
|
2
2
|
import type { PageRegistryDeclaration } from './page-registry-store';
|
|
3
|
+
import type { TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
4
|
+
import type { ComponentTreeRuntimeEnvelope } from '../../shared/types/component-tree-artifact.types';
|
|
3
5
|
/**
|
|
4
6
|
* 编译器版本。与 soma-core 的包版本对齐——语义变更必然伴随版本号变化,
|
|
5
7
|
* 拿它当"这份缓存还能不能用"的判据,比自己再造一套指纹可靠。
|
|
@@ -10,7 +12,7 @@ import type { PageRegistryDeclaration } from './page-registry-store';
|
|
|
10
12
|
*/
|
|
11
13
|
export declare const DECLARATION_COMPILER_VERSION: string;
|
|
12
14
|
/** 落库的完整运行时产物。 */
|
|
13
|
-
export interface CompiledDeclaration {
|
|
15
|
+
export interface CompiledDeclaration extends ComponentTreeRuntimeEnvelope {
|
|
14
16
|
compilerVersion: string;
|
|
15
17
|
/**
|
|
16
18
|
* 供货指纹(词表版本那一维,可选)。缺席 = 编译那一刻宿主没报供货版本,
|
|
@@ -33,7 +35,7 @@ export interface CompiledDeclaration {
|
|
|
33
35
|
* 这里就不再编第二遍。产物由下面同一段映射得出,与自己编出来的逐字相同;
|
|
34
36
|
* 供货指纹仍在此刻读取,与自己编时同一时点。保证它编的是同一份声明,是传入方的责任。
|
|
35
37
|
*/
|
|
36
|
-
export declare function precompileDeclaration(declaration: PageRegistryDeclaration, compiledPage?: CompiledPageDeclaration): CompiledDeclaration | null;
|
|
38
|
+
export declare function precompileDeclaration(declaration: PageRegistryDeclaration, compiledPage?: CompiledPageDeclaration, treeContext?: TreeCompileContext): CompiledDeclaration | null;
|
|
37
39
|
/**
|
|
38
40
|
* 消费端的版本闸:编译器版本或供货版本对不上就整份丢弃。
|
|
39
41
|
* 这是"缓存不是真理"那条纪律的执行点。
|
|
@@ -47,4 +49,7 @@ export declare function precompileDeclaration(declaration: PageRegistryDeclarati
|
|
|
47
49
|
* 而运行时问不到自己的供货版本时判假,等于拿"我不知道"当"不一致"。
|
|
48
50
|
* 失败方向仍然安全:第三道闸判假只导致**重新编译**,不导致拒绝。
|
|
49
51
|
*/
|
|
50
|
-
export declare function isCompiledUsable(compiled: CompiledDeclaration | null | undefined, runtimeVersion?: string, runtimeSupplyKey?: string | undefined
|
|
52
|
+
export declare function isCompiledUsable(compiled: CompiledDeclaration | null | undefined, runtimeVersion?: string, runtimeSupplyKey?: string | undefined, options?: {
|
|
53
|
+
declaration?: PageRegistryDeclaration;
|
|
54
|
+
treeContext?: TreeCompileContext;
|
|
55
|
+
}): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type PageRegistryDeclaration, type PageRegistryListOptions, type PageRegistryListResult, type PageRegistryMeta, type PageRegistryPublishOptions, type PageRegistryStatus, type PageRegistryWriteOptions, type PageVersionRecord } from './page-registry-store';
|
|
2
2
|
import { type PageRegistryStore } from './page-registry-store';
|
|
3
3
|
import type { ConditionalObjectStore } from './conditional-object-store';
|
|
4
|
+
import type { TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
4
5
|
export interface PublishResult {
|
|
5
6
|
record: PageVersionRecord;
|
|
6
7
|
}
|
|
@@ -9,6 +10,7 @@ export interface RollbackResult {
|
|
|
9
10
|
}
|
|
10
11
|
/** API 的唯一仓储门面;全部方法异步,后端可为共享文件系统或对象存储 CAS。 */
|
|
11
12
|
export interface PageRegistryRepository {
|
|
13
|
+
getTreeCompileContext?(name: string, app: string): TreeCompileContext | undefined;
|
|
12
14
|
publish(name: string, declaration: unknown, options?: PageRegistryStatus | PageRegistryPublishOptions): Promise<PublishResult>;
|
|
13
15
|
get(name: string, version?: number): Promise<PageVersionRecord>;
|
|
14
16
|
list(options?: PageRegistryListOptions): Promise<PageRegistryListResult>;
|
|
@@ -22,6 +24,7 @@ export interface PageRegistryRepository {
|
|
|
22
24
|
export declare class FilePageRegistryRepository implements PageRegistryRepository {
|
|
23
25
|
private readonly injectedPages?;
|
|
24
26
|
constructor(injectedPages?: PageRegistryStore | undefined);
|
|
27
|
+
getTreeCompileContext(name: string, app: string): TreeCompileContext | undefined;
|
|
25
28
|
publish(name: string, declaration: unknown, options?: PageRegistryStatus | PageRegistryPublishOptions): Promise<PublishResult>;
|
|
26
29
|
get(name: string, version?: number): Promise<PageVersionRecord>;
|
|
27
30
|
list(options?: PageRegistryListOptions): Promise<PageRegistryListResult>;
|
|
@@ -38,7 +41,9 @@ export declare class ConditionalPageRegistryRepository implements PageRegistryRe
|
|
|
38
41
|
prefix?: string;
|
|
39
42
|
now?: () => number;
|
|
40
43
|
maxAttempts?: number;
|
|
44
|
+
treeContextResolver?: (name: string, app: string) => TreeCompileContext | undefined;
|
|
41
45
|
});
|
|
46
|
+
getTreeCompileContext(name: string, app: string): TreeCompileContext | undefined;
|
|
42
47
|
publish(name: string, declaration: unknown, options?: PageRegistryStatus | PageRegistryPublishOptions): Promise<PublishResult>;
|
|
43
48
|
get(name: string, version?: number): Promise<PageVersionRecord>;
|
|
44
49
|
list(options?: PageRegistryListOptions): Promise<PageRegistryListResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CompiledPageDeclaration } from '../../build/compiler/page-declaration-compiler';
|
|
2
|
+
import type { SomaPageMarkup, TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
2
3
|
import { type CompiledDeclaration } from './declaration-precompiler';
|
|
3
4
|
import { type SomaAssetPin } from './publish-asset-pin';
|
|
4
5
|
import { RegistryError } from './registry-error';
|
|
@@ -65,6 +66,8 @@ export declare class PageRegistryError extends RegistryError {
|
|
|
65
66
|
}
|
|
66
67
|
/** 页面声明本体:与 /api/ai-page/generate 的产物同构(dataYaml 为数据对象绑定拓展位) */
|
|
67
68
|
export interface PageRegistryDeclaration {
|
|
69
|
+
markup?: SomaPageMarkup;
|
|
70
|
+
grammarVersion?: number;
|
|
68
71
|
html: string;
|
|
69
72
|
uiYaml: string;
|
|
70
73
|
eventYaml: string;
|
|
@@ -135,6 +138,7 @@ export interface PageRegistryWriteOptions {
|
|
|
135
138
|
}
|
|
136
139
|
/** 追加新版本时的规范化字段;文件后端与条件写后端共用同一状态机输入。 */
|
|
137
140
|
export interface PageVersionFields {
|
|
141
|
+
treeContext?: TreeCompileContext;
|
|
138
142
|
declaration: PageRegistryDeclaration;
|
|
139
143
|
status: PageRegistryStatus;
|
|
140
144
|
app: string;
|
|
@@ -199,12 +203,15 @@ export interface PageRegistryListResult {
|
|
|
199
203
|
total: number;
|
|
200
204
|
}
|
|
201
205
|
export interface PageRegistryStoreOptions {
|
|
206
|
+
/** Trusted server assembly only; never accepted through publish request options. */
|
|
207
|
+
treeContextResolver?: (name: string, app: string) => TreeCompileContext | undefined;
|
|
202
208
|
/** 持久化目录(每页面一个 <name>.json),默认 data/soma-runtime/pages */
|
|
203
209
|
baseDir?: string;
|
|
204
210
|
/** 时钟注入点,默认 Date.now;测试传确定性时钟 */
|
|
205
211
|
now?: () => number;
|
|
206
212
|
}
|
|
207
213
|
export declare class PageRegistryStore {
|
|
214
|
+
private readonly treeContextResolver;
|
|
208
215
|
private readonly baseDir;
|
|
209
216
|
private readonly now;
|
|
210
217
|
/**
|
|
@@ -216,6 +223,7 @@ export declare class PageRegistryStore {
|
|
|
216
223
|
*/
|
|
217
224
|
private readonly cache;
|
|
218
225
|
constructor(options?: PageRegistryStoreOptions);
|
|
226
|
+
getTreeCompileContext(name: string, app: string): TreeCompileContext | undefined;
|
|
219
227
|
/** 供共享 FS 聚合协调器使用;对象存储模式不依赖本地路径。 */
|
|
220
228
|
storageDirectory(): string;
|
|
221
229
|
/**
|
|
@@ -296,10 +304,12 @@ export declare function normalizePublishOptions(options: PageRegistryStatus | Pa
|
|
|
296
304
|
* **同一份归一化声明**、同一个纯函数,发布路径上相邻两步——第二遍只是重付一次编译代价
|
|
297
305
|
* (演绎链接进来之后这笔代价随声明规模长),而落库结果逐字相同,多编一遍不会让任何东西红。
|
|
298
306
|
*/
|
|
299
|
-
export declare function normalizeDeclaration(declaration: unknown): {
|
|
307
|
+
export declare function normalizeDeclaration(declaration: unknown, treeContext?: TreeCompileContext): {
|
|
300
308
|
declaration: PageRegistryDeclaration;
|
|
301
309
|
compiledPage: CompiledPageDeclaration;
|
|
302
310
|
};
|
|
311
|
+
/** Inspect only the format discriminator; the full declaration is validated by normalizeDeclaration. */
|
|
312
|
+
export declare function isTreeDeclaration(value: unknown): boolean;
|
|
303
313
|
/** 声明总字节数:UTF-8 计,涵盖 declaration 的全部字符串字段 */
|
|
304
314
|
export declare function declarationByteSize(declaration: PageRegistryDeclaration): number;
|
|
305
315
|
/** 存量 JSON 记录归一化:只补元数据;旧页面语法必须离线迁移,不在读取时自动转换。 */
|
|
@@ -81,6 +81,10 @@ export interface PinnableDeclaration {
|
|
|
81
81
|
html: string;
|
|
82
82
|
}
|
|
83
83
|
export interface PinPublishedAssetsOptions {
|
|
84
|
+
/** Tree compilation includes macros and the complete transitive uses closure. */
|
|
85
|
+
componentRefs?: readonly {
|
|
86
|
+
name: string;
|
|
87
|
+
}[];
|
|
84
88
|
/** 演绎产物。演绎选出的组件不在 `html` 里,不带上就会漏钉恰好是演绎选中的那些 */
|
|
85
89
|
artifact?: SomaPageOouiArtifact | undefined;
|
|
86
90
|
/** 资产库(缺省取进程共享库) */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type CompiledPageDeclaration } from '../../../build/compiler/page-declaration-compiler';
|
|
2
|
+
import type { SomaPageMarkup, TreeCompileContext } from '../../../shared/types/component-tree.types';
|
|
2
3
|
export interface CompilableDeclaration {
|
|
4
|
+
markup?: SomaPageMarkup;
|
|
5
|
+
grammarVersion?: number;
|
|
3
6
|
html: string;
|
|
4
7
|
uiYaml: string;
|
|
5
8
|
eventYaml?: string;
|
|
@@ -64,7 +67,7 @@ export interface CompileGateResult {
|
|
|
64
67
|
*
|
|
65
68
|
* `issues` 与 `dryRunCompile()` 逐字一致——两者是同一条判定,不是两套规则。
|
|
66
69
|
*/
|
|
67
|
-
export declare function dryRunCompileWithDiagnostics(declaration: CompilableDeclaration): CompileGateResult;
|
|
70
|
+
export declare function dryRunCompileWithDiagnostics(declaration: CompilableDeclaration, treeContext?: TreeCompileContext): CompileGateResult;
|
|
68
71
|
/**
|
|
69
72
|
* 干跑编译,返回中文问题清单(空数组 = 通过)。
|
|
70
73
|
* 与安全扫描同款约定:命中即拒,清单点名到具体哪一件、解析器原话是什么。
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ComponentTreeRuntimeEnvelope, type DefinitionPreparation } from './types/component-tree-artifact.types';
|
|
2
|
+
/** Pure browser/server schema gate. Hash/context verification remains build/server-owned. */
|
|
3
|
+
export declare function assertRuntimeArtifact(input: unknown): asserts input is ComponentTreeRuntimeEnvelope;
|
|
4
|
+
/** Definitions carry their own gate even when mounted from a legacy page. */
|
|
5
|
+
export declare function assertDefinitionPreparation(input: unknown): asserts input is DefinitionPreparation;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SourceSpan } from './types/component-tree.types';
|
|
2
|
+
export type ComponentTreeErrorCode = 'CT-SYNTAX-ROOT' | 'CT-SYNTAX-ELEMENT' | 'CT-SYNTAX-CLOSE' | 'CT-SYNTAX-ATTRIBUTE' | 'CT-IDENTITY-ID' | 'CT-IDENTITY-HOST' | 'CT-REGISTRY-CONTEXT' | 'CT-REGISTRY-COMPONENT' | 'CT-POLICY-COMPONENT' | 'CT-SLOT-CONTRACT' | 'CT-STRUCTURE-MOUNT' | 'CT-BINDING-SCOPE' | 'CT-BINDING-DUPLICATE' | 'CT-REPEAT-SOURCE' | 'CT-REPEAT-KEY' | 'CT-LIMIT' | 'CT-LAYOUT-PARENT' | 'CT-ARTIFACT-VERSION' | 'CT-ARTIFACT-CAPABILITY' | 'CT-ARTIFACT-INCOMPLETE' | 'CT-SYNTAX-LEAK' | 'CT-MIGRATION-UNSAFE';
|
|
3
|
+
export interface ComponentTreeDiagnostic {
|
|
4
|
+
code: ComponentTreeErrorCode;
|
|
5
|
+
phase: 'input' | 'parse' | 'registry' | 'validate' | 'bind' | 'lower' | 'emit' | 'artifact' | 'runtime' | 'migration';
|
|
6
|
+
sourceId: string;
|
|
7
|
+
nodePath: string;
|
|
8
|
+
span?: SourceSpan;
|
|
9
|
+
relatedSpans?: readonly SourceSpan[];
|
|
10
|
+
attribute?: string;
|
|
11
|
+
expected?: string;
|
|
12
|
+
/** Describe the invalid shape/token category, never copy business data or credentials. */
|
|
13
|
+
actualSummary?: string;
|
|
14
|
+
fixHint?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Stable, serializable diagnostics without retaining the page source or context. */
|
|
17
|
+
export declare class SomaComponentTreeError extends Error {
|
|
18
|
+
readonly code: ComponentTreeErrorCode;
|
|
19
|
+
readonly diagnostic: Readonly<ComponentTreeDiagnostic>;
|
|
20
|
+
constructor(diagnostic: ComponentTreeDiagnostic);
|
|
21
|
+
toJSON(): Readonly<ComponentTreeDiagnostic>;
|
|
22
|
+
}
|
|
@@ -57,6 +57,31 @@ export interface SomaContractSlot {
|
|
|
57
57
|
desc?: string;
|
|
58
58
|
required?: boolean;
|
|
59
59
|
}
|
|
60
|
+
/** Core 拥有的非交互结构语义词汇;组件只能收窄,不能传入任意标签。 */
|
|
61
|
+
export type SomaStructureSemanticToken = 'root' | 'main' | 'section' | 'article' | 'div' | 'flow' | 'aside' | 'header' | 'footer' | 'nav' | 'navigation' | 'complementary' | 'contentinfo' | 'region' | 'none' | 'unordered' | 'ordered';
|
|
62
|
+
export interface SomaStructureSemantics {
|
|
63
|
+
target: 'host';
|
|
64
|
+
default: SomaStructureSemanticToken;
|
|
65
|
+
allowed: SomaStructureSemanticToken[];
|
|
66
|
+
/** 仅支持 Core 已定义的 as/landmark/ordered 封闭转换,不接受脚本。 */
|
|
67
|
+
staticProp?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface SomaStructureSlot {
|
|
70
|
+
kind: 'projection' | 'collection';
|
|
71
|
+
/** 受信组件实现键,不是页面提供的 CSS selector。 */
|
|
72
|
+
layoutRoot?: string;
|
|
73
|
+
directChildren: boolean;
|
|
74
|
+
/** 仅集合槽可声明,集合槽必须明确是否需要语义行容器。 */
|
|
75
|
+
rowContainer?: 'none' | 'list-item';
|
|
76
|
+
}
|
|
77
|
+
/** 可选的新树结构契约;缺省保持旧组件行为,不自动推断结构能力。 */
|
|
78
|
+
export interface SomaContractStructure {
|
|
79
|
+
kind: 'element' | 'fragment-macro';
|
|
80
|
+
rootless: boolean;
|
|
81
|
+
tree_mount: 'legacy-host' | 'controlled-host' | 'single-host' | 'erase';
|
|
82
|
+
semantics?: SomaStructureSemantics;
|
|
83
|
+
slots?: Record<string, SomaStructureSlot>;
|
|
84
|
+
}
|
|
60
85
|
/**
|
|
61
86
|
* 组件级令牌(三级令牌的第三级,REQ-009 M-1)。
|
|
62
87
|
*
|
|
@@ -77,11 +102,26 @@ export interface SomaContractToken {
|
|
|
77
102
|
* AI 目录段(契约规范第 11 章):AI 生成页面前查表选组件的依据。
|
|
78
103
|
* when_to_use / example 为目录质量线;when_not_to_use 用于同族组件消歧。
|
|
79
104
|
*/
|
|
105
|
+
export type SomaContractExample = {
|
|
106
|
+
format: 'legacy-html';
|
|
107
|
+
grammarVersion?: never;
|
|
108
|
+
html: string;
|
|
109
|
+
canonicalUi: string;
|
|
110
|
+
capabilities?: readonly string[];
|
|
111
|
+
} | {
|
|
112
|
+
format: 'component-tree';
|
|
113
|
+
grammarVersion: 1;
|
|
114
|
+
html: string;
|
|
115
|
+
canonicalUi: string;
|
|
116
|
+
capabilities?: readonly string[];
|
|
117
|
+
};
|
|
80
118
|
export interface SomaContractAiSection {
|
|
81
119
|
when_to_use: string;
|
|
82
120
|
when_not_to_use?: string;
|
|
83
121
|
/** 三行真实用法:html / ui / event 各一行 */
|
|
84
122
|
example: string;
|
|
123
|
+
/** Full examples are format- and capability-negotiated; legacy example remains compatible. */
|
|
124
|
+
examples?: readonly SomaContractExample[];
|
|
85
125
|
anti_patterns?: string[];
|
|
86
126
|
}
|
|
87
127
|
export interface SomaComponentContract {
|
|
@@ -96,6 +136,8 @@ export interface SomaComponentContract {
|
|
|
96
136
|
props?: Record<string, SomaContractProp>;
|
|
97
137
|
emits?: Record<string, SomaContractEmit>;
|
|
98
138
|
slots?: Record<string, SomaContractSlot>;
|
|
139
|
+
/** REQ-016:构建期验证的宿主、语义、投影/集合结构能力。 */
|
|
140
|
+
structure?: SomaContractStructure;
|
|
99
141
|
/**
|
|
100
142
|
* 组件级令牌:key 为 kebab-case,装配期写出 `--soma-<组件名 kebab>-<key>`。
|
|
101
143
|
* 主题输入的 `components.<组件名>.<key>` 覆盖它,`ThemeScope` 可按子树覆盖。
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { SomaStructureSemanticToken } from './component-contract.types';
|
|
2
|
+
import type { CollectionStatusPlan, SomaPageMarkup } from './component-tree.types';
|
|
3
|
+
export declare const COMPONENT_TREE_CAPABILITIES: readonly ["component-tree:1", "structure-host:1", "fragment-erasure:1", "repeat-range:1", "row-bindings:1", "definition-repeat:1"];
|
|
4
|
+
export type ComponentTreeCapability = typeof COMPONENT_TREE_CAPABILITIES[number];
|
|
5
|
+
/** Trusted component implementation keys; never page-provided selectors. */
|
|
6
|
+
export interface SomaStructureAdapterDefinition {
|
|
7
|
+
rootAnchor?: string;
|
|
8
|
+
layoutRoots: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
export interface SlotPlan {
|
|
11
|
+
name: string;
|
|
12
|
+
kind: 'projection' | 'collection';
|
|
13
|
+
ownerSymbol: string;
|
|
14
|
+
layoutRootKey?: string;
|
|
15
|
+
directChildren: boolean;
|
|
16
|
+
rowContainer?: 'none' | 'list-item';
|
|
17
|
+
}
|
|
18
|
+
export interface StructurePlan {
|
|
19
|
+
/** The emitted template symbol, shared by HTML anchors and compiled bindings. */
|
|
20
|
+
instanceSymbol: string;
|
|
21
|
+
componentName: string;
|
|
22
|
+
mountMode: 'legacy-host' | 'controlled-host' | 'single-host';
|
|
23
|
+
semanticToken?: SomaStructureSemanticToken;
|
|
24
|
+
hostTag: string;
|
|
25
|
+
slotPlans: SlotPlan[];
|
|
26
|
+
internalRootId?: string;
|
|
27
|
+
structureDigest: string;
|
|
28
|
+
/** Compiled static semantic props; runtime defaults/updates may not change them. */
|
|
29
|
+
staticProps?: Record<string, string | boolean>;
|
|
30
|
+
}
|
|
31
|
+
export interface CollectionDeclarationScope {
|
|
32
|
+
kind: 'page' | 'component';
|
|
33
|
+
ownerSymbol: string;
|
|
34
|
+
parentScopeId?: string;
|
|
35
|
+
/** Domain name for pages, __component for trusted component definitions. */
|
|
36
|
+
readerRoot: string;
|
|
37
|
+
emitOwnerSymbol: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CollectionConsumerOwner {
|
|
40
|
+
instanceSymbol: string;
|
|
41
|
+
componentName: string;
|
|
42
|
+
slotName: string;
|
|
43
|
+
layoutRootKey: string;
|
|
44
|
+
rowContainer: 'none' | 'list-item';
|
|
45
|
+
}
|
|
46
|
+
export interface RepeatPlan {
|
|
47
|
+
planId: string;
|
|
48
|
+
scopeId: string;
|
|
49
|
+
parentPlanId?: string;
|
|
50
|
+
declarationScope: CollectionDeclarationScope;
|
|
51
|
+
consumerOwner: CollectionConsumerOwner;
|
|
52
|
+
sourcePath: string;
|
|
53
|
+
statusPlan: CollectionStatusPlan;
|
|
54
|
+
itemAlias: string;
|
|
55
|
+
/** Full current-item path (for example row.id), not a second author input. */
|
|
56
|
+
keyPath: string;
|
|
57
|
+
rowTemplateId: string;
|
|
58
|
+
/** Local source id -> emitted unique template symbol. */
|
|
59
|
+
localSymbols: Record<string, string>;
|
|
60
|
+
limits: {
|
|
61
|
+
maxRows: number;
|
|
62
|
+
maxPageRows: number;
|
|
63
|
+
maxKeyLength: number;
|
|
64
|
+
maxDepth: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface DefinitionRepeatPlan extends RepeatPlan {
|
|
68
|
+
definitionName: string;
|
|
69
|
+
definitionPlanId: string;
|
|
70
|
+
}
|
|
71
|
+
export interface DefinitionPreparation {
|
|
72
|
+
schemaVersion: 1;
|
|
73
|
+
requiredCapabilities: ComponentTreeCapability[];
|
|
74
|
+
dependencyDigests: Record<string, string>;
|
|
75
|
+
definitionDigest: string;
|
|
76
|
+
}
|
|
77
|
+
export interface ComponentRef {
|
|
78
|
+
name: string;
|
|
79
|
+
packName?: string;
|
|
80
|
+
packVersion?: string;
|
|
81
|
+
contractDigest: string;
|
|
82
|
+
structureDigest: string;
|
|
83
|
+
uses: string[];
|
|
84
|
+
}
|
|
85
|
+
export interface TreeArtifact {
|
|
86
|
+
schemaVersion: 1;
|
|
87
|
+
grammarVersion: 1;
|
|
88
|
+
compilerVersion: string;
|
|
89
|
+
sourceDigest: string;
|
|
90
|
+
registrySnapshotDigest: string;
|
|
91
|
+
policyDigest: string;
|
|
92
|
+
assetSupplyKey: string;
|
|
93
|
+
capabilities: ComponentTreeCapability[];
|
|
94
|
+
componentRefs: ComponentRef[];
|
|
95
|
+
structurePlan: StructurePlan[];
|
|
96
|
+
repeatPlans: RepeatPlan[];
|
|
97
|
+
artifactDigest: string;
|
|
98
|
+
}
|
|
99
|
+
/** Compatible legacy inputs may omit the mode; newly compiled outputs always carry it. */
|
|
100
|
+
export interface ComponentTreeRuntimeEnvelope {
|
|
101
|
+
sourceMarkup?: SomaPageMarkup;
|
|
102
|
+
html?: string;
|
|
103
|
+
artifact?: TreeArtifact;
|
|
104
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import type { SomaComponentContract, SomaComponentLayer, SomaContractField } from './component-contract.types';
|
|
2
|
+
import type { SomaStructureAdapterDefinition } from './component-tree-artifact.types';
|
|
3
|
+
export type SomaPageMarkup = 'legacy-html' | 'component-tree';
|
|
4
|
+
export interface SourceSpan {
|
|
5
|
+
sourceId: string;
|
|
6
|
+
/** UTF-16 offsets; end is exclusive. Lines and columns are one-based. */
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
startLine: number;
|
|
10
|
+
startColumn: number;
|
|
11
|
+
endLine: number;
|
|
12
|
+
endColumn: number;
|
|
13
|
+
}
|
|
14
|
+
export interface NodeMeta {
|
|
15
|
+
nodeId: string;
|
|
16
|
+
span: SourceSpan;
|
|
17
|
+
nodePath: string;
|
|
18
|
+
}
|
|
19
|
+
export interface HostNode {
|
|
20
|
+
kind: 'host';
|
|
21
|
+
name: string;
|
|
22
|
+
id?: string;
|
|
23
|
+
as: string;
|
|
24
|
+
children: TreeNode[];
|
|
25
|
+
meta: NodeMeta;
|
|
26
|
+
}
|
|
27
|
+
export interface ComponentNode {
|
|
28
|
+
kind: 'component';
|
|
29
|
+
component: string;
|
|
30
|
+
id: string;
|
|
31
|
+
as?: string;
|
|
32
|
+
mount: 'host' | 'fragment';
|
|
33
|
+
slots: SlotNode[];
|
|
34
|
+
meta: NodeMeta;
|
|
35
|
+
}
|
|
36
|
+
export interface SlotNode {
|
|
37
|
+
kind: 'slot';
|
|
38
|
+
name: string;
|
|
39
|
+
children: TreeNode[];
|
|
40
|
+
meta: NodeMeta;
|
|
41
|
+
}
|
|
42
|
+
export interface FragmentNode {
|
|
43
|
+
kind: 'fragment';
|
|
44
|
+
children: TreeNode[];
|
|
45
|
+
meta: NodeMeta;
|
|
46
|
+
}
|
|
47
|
+
export interface RepeatNode {
|
|
48
|
+
kind: 'repeat';
|
|
49
|
+
source: string;
|
|
50
|
+
item: string;
|
|
51
|
+
key: string;
|
|
52
|
+
child: ComponentNode | FragmentNode;
|
|
53
|
+
meta: NodeMeta;
|
|
54
|
+
}
|
|
55
|
+
export type TreeNode = HostNode | ComponentNode | SlotNode | FragmentNode | RepeatNode;
|
|
56
|
+
export interface SomaComponentTree {
|
|
57
|
+
grammarVersion: 1;
|
|
58
|
+
sourceId: string;
|
|
59
|
+
host: HostNode;
|
|
60
|
+
}
|
|
61
|
+
/** Trusted deployment limits, never accepted as attributes in source markup. */
|
|
62
|
+
export interface TreeLimits {
|
|
63
|
+
maxSourceBytes: number;
|
|
64
|
+
maxNodes: number;
|
|
65
|
+
maxDepth: number;
|
|
66
|
+
maxAttributes: number;
|
|
67
|
+
maxRepeatDepth: number;
|
|
68
|
+
maxRowsPerCollection: number;
|
|
69
|
+
maxRowsPerPage: number;
|
|
70
|
+
maxKeyLength: number;
|
|
71
|
+
maxArtifactBytes: number;
|
|
72
|
+
maxDiagnostics: number;
|
|
73
|
+
}
|
|
74
|
+
export declare const DEFAULT_TREE_LIMITS: Readonly<TreeLimits>;
|
|
75
|
+
export interface TreeComponentSnapshot {
|
|
76
|
+
readonly name: string;
|
|
77
|
+
readonly layer: SomaComponentLayer;
|
|
78
|
+
readonly version: string;
|
|
79
|
+
readonly contract: SomaComponentContract;
|
|
80
|
+
readonly packName?: string;
|
|
81
|
+
readonly packVersion?: string;
|
|
82
|
+
readonly structureDigest: string;
|
|
83
|
+
readonly contractDigest?: string;
|
|
84
|
+
readonly internalRootId?: string;
|
|
85
|
+
readonly templateRootTag?: string;
|
|
86
|
+
readonly structureAdapter?: SomaStructureAdapterDefinition;
|
|
87
|
+
}
|
|
88
|
+
export interface TreeRegistrySnapshot {
|
|
89
|
+
readonly components: Readonly<Record<string, TreeComponentSnapshot>>;
|
|
90
|
+
readonly digest: string;
|
|
91
|
+
}
|
|
92
|
+
export interface TreeSlotPolicy {
|
|
93
|
+
readonly component: string;
|
|
94
|
+
readonly slot: string;
|
|
95
|
+
readonly allowedComponents?: readonly string[];
|
|
96
|
+
readonly allowedLayers?: readonly SomaComponentLayer[];
|
|
97
|
+
/** Some Host shell slots distinguish direct shells from business descendants. */
|
|
98
|
+
readonly descendantAllowedComponents?: readonly string[];
|
|
99
|
+
readonly descendantAllowedLayers?: readonly SomaComponentLayer[];
|
|
100
|
+
readonly forbidden?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface TreeCompositionPolicy {
|
|
103
|
+
readonly policyId: string;
|
|
104
|
+
readonly version: string;
|
|
105
|
+
readonly roots: readonly string[];
|
|
106
|
+
readonly allowedComponents?: readonly string[];
|
|
107
|
+
readonly allowedLayers?: readonly SomaComponentLayer[];
|
|
108
|
+
/** A matched slot rule remains in force through transparent/nested content. */
|
|
109
|
+
readonly slotRules?: readonly TreeSlotPolicy[];
|
|
110
|
+
}
|
|
111
|
+
export type CollectionStatusPlan = {
|
|
112
|
+
readonly kind: 'sync';
|
|
113
|
+
} | {
|
|
114
|
+
readonly kind: 'async';
|
|
115
|
+
readonly statePath: string;
|
|
116
|
+
};
|
|
117
|
+
export interface TreeCollectionSource {
|
|
118
|
+
readonly path: string;
|
|
119
|
+
/** The collection is always an array; item describes its element schema. */
|
|
120
|
+
readonly item: SomaContractField;
|
|
121
|
+
readonly statusPlan: CollectionStatusPlan;
|
|
122
|
+
}
|
|
123
|
+
export interface TreeCompileContext {
|
|
124
|
+
readonly registrySnapshot: TreeRegistrySnapshot;
|
|
125
|
+
readonly compositionPolicy: TreeCompositionPolicy;
|
|
126
|
+
readonly collectionSources?: readonly TreeCollectionSource[];
|
|
127
|
+
readonly limits?: Partial<TreeLimits>;
|
|
128
|
+
/** Trusted deployment identity; otherwise derived from the actual Registry snapshot. */
|
|
129
|
+
readonly assetSupplyKey?: string;
|
|
130
|
+
}
|
|
131
|
+
/** Preflight output, deliberately not a runtime asset or a compiled tree plan. */
|
|
132
|
+
export interface TreeValidationResult {
|
|
133
|
+
readonly tree: SomaComponentTree;
|
|
134
|
+
readonly componentNames: readonly string[];
|
|
135
|
+
}
|
|
136
|
+
/** Build diagnostics only; never included in runtimeAssets or content-addressed payloads. */
|
|
137
|
+
export interface ComponentTreeTrace {
|
|
138
|
+
sources: readonly {
|
|
139
|
+
nodeId: string;
|
|
140
|
+
nodePath: string;
|
|
141
|
+
span: SourceSpan;
|
|
142
|
+
symbol?: string;
|
|
143
|
+
}[];
|
|
144
|
+
edges: readonly {
|
|
145
|
+
fromId: string;
|
|
146
|
+
relation: 'derives' | 'normalizes' | 'binds' | 'projects' | 'scopes' | 'consumes' | 'invalidates' | 'verifies';
|
|
147
|
+
toId: string;
|
|
148
|
+
}[];
|
|
149
|
+
}
|
|
@@ -15,6 +15,11 @@ export interface BindingEntry {
|
|
|
15
15
|
pipes?: import('./scope-manifest.types').SomaPipeCall[];
|
|
16
16
|
/** 异构列表模板选择器(行相对路径) */
|
|
17
17
|
roleBy?: string;
|
|
18
|
+
keyPath?: string;
|
|
19
|
+
itemAlias?: string;
|
|
20
|
+
repeatPlanId?: string;
|
|
21
|
+
repeatPlan?: import('./component-tree-artifact.types').RepeatPlan;
|
|
22
|
+
collectionOwner?: HTMLElement;
|
|
18
23
|
/** 变体模板表:'item' 默认 + 'item:变体'(异构列表用;同构列表仅 templateCache) */
|
|
19
24
|
templatesByRole?: Record<string, DocumentFragment>;
|
|
20
25
|
/** 预编译的属性访问器:消除 path.split + 循环 */
|
|
@@ -54,10 +54,14 @@ export interface ParsedEvent {
|
|
|
54
54
|
permission?: string;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* 事件 handler
|
|
58
|
-
* - `true` / `undefined`:成功,继续 post-action
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* 事件 handler 返回值:业务成功/失败(流程是否继续),兼「这次改没改东西」。
|
|
58
|
+
* - `true` / `undefined`:成功,继续 post-action(跳转、显隐等),引擎照常提交一次重渲;
|
|
59
|
+
* 不写返回值是绝大多数处理器的形态,语义与 `true` 完全一致。
|
|
60
|
+
* - `false`:失败或「什么都没改」,中断 post-action,**并且引擎不提交这次重渲**。
|
|
61
|
+
* 键盘处理器接不住的键(裸 Shift、字母、F2)该走这条路——组件实例的 commit
|
|
62
|
+
* 等于整树重渲,白提交一次就会把正被聚焦的节点换掉。
|
|
63
|
+
* 返回 `false` 却确实改了页面字段时数据不丢:页面级写入进的是代理的 pending patch,
|
|
64
|
+
* 事务收口照样 flush;组件实例内部状态要上屏则自己调 `refresh()`。
|
|
61
65
|
*/
|
|
62
66
|
export type EventHandlerResult = boolean | undefined;
|
|
63
67
|
/**
|
|
@@ -20,6 +20,10 @@ export interface SomaCompiledBinding {
|
|
|
20
20
|
pipes?: SomaPipeCall[];
|
|
21
21
|
/** 异构列表模板选择器(行相对路径,list 绑定专用) */
|
|
22
22
|
roleBy?: string;
|
|
23
|
+
/** Explicit stable identity and lexical alias (absent on legacy lists). */
|
|
24
|
+
keyPath?: string;
|
|
25
|
+
itemAlias?: string;
|
|
26
|
+
repeatPlanId?: string;
|
|
23
27
|
}
|
|
24
28
|
export interface SomaCompiledEvent extends ParsedEvent {
|
|
25
29
|
/**
|
|
@@ -18,6 +18,12 @@ export interface BindDeclaration {
|
|
|
18
18
|
* 取值匹配 <template data-soma-role="item:取值">,无匹配回落 item 默认模板。
|
|
19
19
|
*/
|
|
20
20
|
role_by?: string;
|
|
21
|
+
/** Explicit stable row identity. Must start with this binding's var. */
|
|
22
|
+
key?: string;
|
|
23
|
+
/** Prepared collection plan reference; never combined with source key/slot. */
|
|
24
|
+
repeatPlanId?: string;
|
|
25
|
+
/** Trusted component-definition source only; lowered before browser delivery. */
|
|
26
|
+
collectionSlot?: string;
|
|
21
27
|
}
|
|
22
28
|
/**
|
|
23
29
|
* 展示映射值 - 支持多种绑定类型
|
|
@@ -33,6 +39,8 @@ export type ShowValue = string | NestedShowMapping | ExtendedShowValue;
|
|
|
33
39
|
* 用于对象或列表级别的子作用域绑定
|
|
34
40
|
*/
|
|
35
41
|
export interface NestedShowMapping {
|
|
42
|
+
/** The collection consumer's own props, not its row component props. */
|
|
43
|
+
props?: Record<string, unknown>;
|
|
36
44
|
/** 子作用域声明 */
|
|
37
45
|
bind: BindDeclaration;
|
|
38
46
|
/** 子级展示映射 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soma-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "SOMA — Semantic Oriented Modular Architecture. A declarative frontend framework runtime built on Next.js 16 App Router.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"soma",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"global.d.ts"
|
|
137
137
|
],
|
|
138
138
|
"engines": {
|
|
139
|
-
"node": "
|
|
139
|
+
"node": "24.21.0"
|
|
140
140
|
},
|
|
141
141
|
"scripts": {
|
|
142
142
|
"build:cli": "tsc -p tsconfig.cli.json",
|
|
@@ -167,11 +167,12 @@
|
|
|
167
167
|
"jiti": "^1.21.7",
|
|
168
168
|
"js-yaml": "^4.3.2",
|
|
169
169
|
"msw": "2.15.0",
|
|
170
|
+
"parse5": "7.3.0",
|
|
170
171
|
"reflect-metadata": "^0.2.1",
|
|
171
172
|
"server-only": "^0.0.1"
|
|
172
173
|
},
|
|
173
174
|
"peerDependencies": {
|
|
174
|
-
"next": ">=16.3.
|
|
175
|
+
"next": ">=16.3.5 <17",
|
|
175
176
|
"react": ">=18.0.0",
|
|
176
177
|
"react-dom": ">=18.0.0"
|
|
177
178
|
},
|
|
@@ -186,7 +187,7 @@
|
|
|
186
187
|
"ajv-formats": "3.0.1",
|
|
187
188
|
"esbuild": "^0.25.12",
|
|
188
189
|
"jsdom": "^26.1.0",
|
|
189
|
-
"next": "16.3.
|
|
190
|
+
"next": "16.3.5",
|
|
190
191
|
"playwright": "^1.62.1",
|
|
191
192
|
"react": "^18.3.0",
|
|
192
193
|
"react-dom": "^18.3.0",
|