soma-core 1.5.0 → 1.6.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 +30 -6
- 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/layout/css-emitter.ts +14 -1
- 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/compiler/manifest-compiler.ts +2 -0
- package/core/client/component/ai-catalog.ts +41 -3
- package/core/client/component/catalog-examples.ts +60 -0
- package/core/client/component/component-definition.types.ts +9 -0
- package/core/client/component/component-expander.ts +39 -8
- package/core/client/component/component-manager.ts +107 -16
- package/core/client/component/component-registry.ts +10 -1
- 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 +64 -1
- package/core/client/engine/asset-resolver.ts +1 -1
- package/core/client/engine/dom-renderer.ts +283 -0
- package/core/client/engine/event-engine.ts +28 -9
- package/core/client/engine/render-engine.ts +2 -0
- 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/soma-bootstrap.ts +146 -1
- package/core/client/parser/blocks/page-parser.ts +9 -2
- package/core/client/parser/ui-config-parser.ts +38 -6
- package/core/client/registry/declaration-renderer.ts +32 -24
- package/core/client/registry/remote-page.ts +1 -1
- package/core/client/theme/theme-engine.ts +61 -1
- package/core/client/validation/contract-validator.ts +1 -1
- package/core/index.ts +9 -1
- 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/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/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/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 +1976 -692
- package/dist/lsp/component-tree.cjs +20807 -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/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 +3 -1
- package/dist/types/client/component/component-manager.d.ts +11 -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/engine/dom-renderer.d.ts +15 -0
- package/dist/types/client/engine/event-engine.d.ts +1 -0
- package/dist/types/client/engine/render-engine.d.ts +1 -0
- 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/ui-config-parser.d.ts +2 -0
- 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/index.d.ts +3 -2
- 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/manifest.types.d.ts +4 -0
- package/dist/types/shared/types/ui-config.types.d.ts +8 -0
- package/package.json +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UiConfig } from '../../shared/types/ui-config.types';
|
|
1
|
+
import type { UiConfig, BindDeclaration } from '../../shared/types/ui-config.types';
|
|
2
2
|
import { type HtmlAnchorIndex } from './html-index';
|
|
3
3
|
import { type UseBlockAst } from '../../client/parser/blocks/use-parser';
|
|
4
4
|
export interface CompiledSomaBlocks {
|
|
@@ -34,6 +34,15 @@ export interface CompileSomaBlocksInput {
|
|
|
34
34
|
externalBlocks?: ReadonlyMap<string, string>;
|
|
35
35
|
/** 词典键集合(locale 批量段校验;缺省不校验) */
|
|
36
36
|
localeKeys?: ReadonlySet<string>;
|
|
37
|
+
/** Build-only AST ownership proof; never derived from regex or exposed as author YAML. */
|
|
38
|
+
treeBindings?: {
|
|
39
|
+
htmlIndex: HtmlAnchorIndex;
|
|
40
|
+
collections: readonly {
|
|
41
|
+
symbol: string;
|
|
42
|
+
parentSymbol?: string;
|
|
43
|
+
bind: BindDeclaration;
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
37
46
|
}
|
|
38
47
|
/**
|
|
39
48
|
* 编译一份块声明。
|
|
@@ -5,8 +5,14 @@ import type { ParsedTimer } from '../../shared/types/timer.types';
|
|
|
5
5
|
import type { StyleConfig } from '../../shared/types/style-config.types';
|
|
6
6
|
import type { SomaDataConfig } from '../../shared/types/data-config.types';
|
|
7
7
|
import { type SomaRouteEntry } from './route-builder';
|
|
8
|
+
import type { SomaPageMarkup, TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
9
|
+
import type { TreeArtifact } from '../../shared/types/component-tree-artifact.types';
|
|
8
10
|
export interface SomaPrecompiledPage {
|
|
9
11
|
path: string;
|
|
12
|
+
/** Optional only for compatibility with manifests created before REQ-016. */
|
|
13
|
+
sourceMarkup?: SomaPageMarkup;
|
|
14
|
+
html?: string;
|
|
15
|
+
artifact?: TreeArtifact;
|
|
10
16
|
uiConfig: UiConfig;
|
|
11
17
|
eventConfig: ParsedEvent[];
|
|
12
18
|
triggers: PropertyTrigger[];
|
|
@@ -34,6 +40,9 @@ export declare function precompileAll(inputs: {
|
|
|
34
40
|
path: string;
|
|
35
41
|
html: string;
|
|
36
42
|
uiYaml: string;
|
|
43
|
+
markup?: SomaPageMarkup;
|
|
44
|
+
grammarVersion?: number;
|
|
45
|
+
treeContext?: TreeCompileContext;
|
|
37
46
|
appConfigYaml?: string;
|
|
38
47
|
externalBlocks?: ReadonlyMap<string, string>;
|
|
39
48
|
includes?: Readonly<Record<string, string>>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { SomaPageAssets } from '../../client/engine/soma-bootstrap';
|
|
2
|
+
import type { SomaPageMarkup, TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
2
3
|
/** 把 SOMA DSL 源声明编译成客户端挂载所需的运行时资产。 */
|
|
3
|
-
export declare function compilePageAssets(assets: SomaPageAssets
|
|
4
|
+
export declare function compilePageAssets(assets: SomaPageAssets, options?: {
|
|
5
|
+
markup?: SomaPageMarkup;
|
|
6
|
+
grammarVersion?: number;
|
|
7
|
+
treeContext?: TreeCompileContext;
|
|
8
|
+
}): SomaPageAssets;
|
|
@@ -5,9 +5,15 @@ import type { StyleConfig } from '../../shared/types/style-config.types';
|
|
|
5
5
|
import type { ParsedTimer } from '../../shared/types/timer.types';
|
|
6
6
|
import type { UiConfig } from '../../shared/types/ui-config.types';
|
|
7
7
|
import { type SomaEnvironment, type SomaOouiEngine, type SomaTrace } from '../ooui';
|
|
8
|
+
import type { SomaPageMarkup, TreeCompileContext, ComponentTreeTrace } from '../../shared/types/component-tree.types';
|
|
9
|
+
import type { ComponentTreeRuntimeEnvelope } from '../../shared/types/component-tree-artifact.types';
|
|
8
10
|
export interface SomaPageDeclarationInput {
|
|
9
11
|
html: string;
|
|
10
12
|
uiYaml: string;
|
|
13
|
+
/** Explicit source format. Component trees require a trusted Registry/policy context. */
|
|
14
|
+
markup?: SomaPageMarkup;
|
|
15
|
+
grammarVersion?: number;
|
|
16
|
+
treeContext?: TreeCompileContext;
|
|
11
17
|
eventYaml?: string;
|
|
12
18
|
styleYaml?: string;
|
|
13
19
|
dataYaml?: string;
|
|
@@ -33,13 +39,17 @@ export interface SomaPageDeclarationInput {
|
|
|
33
39
|
/** 演绎环境(可用宽度档、已装配组件清单)。缺省 = 不限宽、不筛候选 */
|
|
34
40
|
oouiEnv?: SomaEnvironment;
|
|
35
41
|
}
|
|
36
|
-
export interface SomaRuntimeDeclarationAssets {
|
|
42
|
+
export interface SomaRuntimeDeclarationAssets extends ComponentTreeRuntimeEnvelope {
|
|
43
|
+
sourceMarkup: SomaPageMarkup;
|
|
44
|
+
html: string;
|
|
37
45
|
uiYaml: string;
|
|
38
46
|
eventYaml: string;
|
|
39
47
|
styleYaml: string;
|
|
40
48
|
dataYaml?: string;
|
|
41
49
|
}
|
|
42
50
|
export interface CompiledPageDeclaration {
|
|
51
|
+
/** Source/contract/symbol lineage; never sent to browser assets. */
|
|
52
|
+
treeTrace?: ComponentTreeTrace;
|
|
43
53
|
uiConfig: UiConfig;
|
|
44
54
|
eventConfig: ParsedEvent[];
|
|
45
55
|
triggers: PropertyTrigger[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SomaComponentDefinition } from '../../client/component/component-definition.types';
|
|
2
|
+
import type { ComponentTreeRegistryEntry } from '../component-tree/registry-snapshot';
|
|
2
3
|
export declare class SomaComponentPackageError extends Error {
|
|
3
4
|
readonly packageDir: string;
|
|
4
5
|
/**
|
|
@@ -17,6 +18,8 @@ export interface PackScanWarning {
|
|
|
17
18
|
message: string;
|
|
18
19
|
}
|
|
19
20
|
export interface LoadPackagesOptions {
|
|
21
|
+
/** Actual composed external dependencies for trusted collection preparation. */
|
|
22
|
+
componentTreeDependencies?: readonly ComponentTreeRegistryEntry[];
|
|
20
23
|
/**
|
|
21
24
|
* 警告汇总回调(缺省时汇总为单块 console.warn)。
|
|
22
25
|
* 刻意做成"扫描结束一次性给全部"而不是逐条打印:dev 服务器的滚动输出里,
|
|
@@ -33,7 +36,7 @@ interface PackageEntry {
|
|
|
33
36
|
packageDir: string;
|
|
34
37
|
}
|
|
35
38
|
/** 装载单个组件包目录 → 运行时定义(结构校验 fail fast) */
|
|
36
|
-
export declare function loadComponentPackage(packageDir: string): SomaComponentDefinition;
|
|
39
|
+
export declare function loadComponentPackage(packageDir: string, options?: LoadPackagesOptions): SomaComponentDefinition;
|
|
37
40
|
/** 装载单个组件包目录 → 定义 + 样式 + 警告(供整包装载复用) */
|
|
38
41
|
export declare function loadComponentPackageEntry(packageDir: string): PackageEntry;
|
|
39
42
|
/**
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ComponentTreeRuntimeEnvelope, TreeArtifact } from '../../shared/types/component-tree-artifact.types';
|
|
2
|
+
import type { SomaPageMarkup, TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
3
|
+
/** Increment whenever the tree lowering or logical artifact protocol changes. */
|
|
4
|
+
export declare const TREE_COMPILER_VERSION = "component-tree:1.0.0";
|
|
5
|
+
export interface RuntimeConfigInput {
|
|
6
|
+
uiConfig?: unknown;
|
|
7
|
+
uiYaml?: string;
|
|
8
|
+
eventConfig?: unknown;
|
|
9
|
+
eventYaml?: string;
|
|
10
|
+
triggers?: unknown;
|
|
11
|
+
triggerConfig?: unknown;
|
|
12
|
+
timers?: unknown;
|
|
13
|
+
timerConfig?: unknown;
|
|
14
|
+
dataConfig?: unknown;
|
|
15
|
+
dataYaml?: string;
|
|
16
|
+
styleConfig?: unknown;
|
|
17
|
+
styleYaml?: string;
|
|
18
|
+
layoutCss?: string;
|
|
19
|
+
oouiArtifact?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface TreeCompileKeyInput {
|
|
22
|
+
html: string;
|
|
23
|
+
uiYaml: string;
|
|
24
|
+
markup?: SomaPageMarkup;
|
|
25
|
+
grammarVersion?: number;
|
|
26
|
+
treeContext: TreeCompileContext;
|
|
27
|
+
externalBlocks?: ReadonlyMap<string, string>;
|
|
28
|
+
}
|
|
29
|
+
type Data = null | boolean | number | string | Data[] | {
|
|
30
|
+
[key: string]: Data;
|
|
31
|
+
};
|
|
32
|
+
/** Canonical JSON: ordered keys, unchanged strings/array order, no getters or cycles. */
|
|
33
|
+
export declare function canonicalTreeData(value: unknown): Data;
|
|
34
|
+
export declare function digestTreeData(value: unknown): string;
|
|
35
|
+
/** Pure artifact decoding. Never instantiates a Domain or falls back to Host configuration. */
|
|
36
|
+
export declare function normalizeRuntimeConfig(input: RuntimeConfigInput): Data;
|
|
37
|
+
export declare function treeContextIdentity(context: TreeCompileContext): {
|
|
38
|
+
registrySnapshotDigest: string;
|
|
39
|
+
policyDigest: string;
|
|
40
|
+
assetSupplyKey: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function computeTreeSourceDigest(input: Pick<TreeCompileKeyInput, 'html' | 'uiYaml' | 'externalBlocks'>): string;
|
|
43
|
+
export declare function computeTreeCompileKey(input: TreeCompileKeyInput): string;
|
|
44
|
+
export declare function sealTreeRuntimeAssets(input: RuntimeConfigInput & {
|
|
45
|
+
sourceMarkup: 'component-tree';
|
|
46
|
+
html: string;
|
|
47
|
+
artifact: Omit<TreeArtifact, 'artifactDigest'>;
|
|
48
|
+
}): TreeArtifact;
|
|
49
|
+
export declare function verifyTreeRuntimeAssets(input: ComponentTreeRuntimeEnvelope & RuntimeConfigInput, source?: TreeCompileKeyInput): boolean;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CompileSomaBlocksInput } from '../blocks/block-compile';
|
|
2
|
+
import type { TreeCompileContext, TreeValidationResult, ComponentTreeTrace } from '../../shared/types/component-tree.types';
|
|
3
|
+
import type { ComponentRef, RepeatPlan, StructurePlan } from '../../shared/types/component-tree-artifact.types';
|
|
4
|
+
export interface TreeBindingResult {
|
|
5
|
+
html: string;
|
|
6
|
+
uiYaml: string;
|
|
7
|
+
treeBindings: NonNullable<CompileSomaBlocksInput['treeBindings']>;
|
|
8
|
+
structurePlan: StructurePlan[];
|
|
9
|
+
repeatPlans: RepeatPlan[];
|
|
10
|
+
componentRefs: ComponentRef[];
|
|
11
|
+
effectiveParents: ReadonlyMap<string, string | undefined>;
|
|
12
|
+
trace: ComponentTreeTrace;
|
|
13
|
+
}
|
|
14
|
+
/** AST-owned scopes, canonical rows, lowering and escaped HTML share one symbol table. */
|
|
15
|
+
export declare function bindComponentTree(validated: TreeValidationResult, input: {
|
|
16
|
+
uiYaml: string;
|
|
17
|
+
externalBlocks?: ReadonlyMap<string, string>;
|
|
18
|
+
treeContext: TreeCompileContext;
|
|
19
|
+
}): TreeBindingResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CollectionConsumerOwner, CollectionDeclarationScope, RepeatPlan } from '../../shared/types/component-tree-artifact.types';
|
|
2
|
+
import { type TreeCollectionSource, type TreeLimits } from '../../shared/types/component-tree.types';
|
|
3
|
+
export interface LowerCollectionBindingInput {
|
|
4
|
+
planId: string;
|
|
5
|
+
scopeId: string;
|
|
6
|
+
parentPlanId?: string;
|
|
7
|
+
sourcePath: string;
|
|
8
|
+
itemAlias: string;
|
|
9
|
+
keyPath: string;
|
|
10
|
+
declarationScope: CollectionDeclarationScope;
|
|
11
|
+
consumerOwner: CollectionConsumerOwner;
|
|
12
|
+
rowTemplateId: string;
|
|
13
|
+
localSymbols: Record<string, string>;
|
|
14
|
+
collectionSources: readonly TreeCollectionSource[];
|
|
15
|
+
limits?: Partial<TreeLimits>;
|
|
16
|
+
}
|
|
17
|
+
/** Shared page/definition source lowering; no controller, reader or DOM execution. */
|
|
18
|
+
export declare function lowerCollectionBinding(input: LowerCollectionBindingInput): RepeatPlan;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SomaComponentDefinition } from '../../client/component/component-definition.types';
|
|
2
|
+
import type { TreeRegistrySnapshot } from '../../shared/types/component-tree.types';
|
|
3
|
+
import { type ComponentTreeRegistryEntry } from './registry-snapshot';
|
|
4
|
+
export interface PreparedComponentTreeDefinitions {
|
|
5
|
+
definitions: SomaComponentDefinition[];
|
|
6
|
+
registrySnapshot: TreeRegistrySnapshot;
|
|
7
|
+
}
|
|
8
|
+
/** Prepare real composed definitions on the build/server side, never in a browser factory. */
|
|
9
|
+
export declare function prepareComponentTreeDefinitions(entries: readonly ComponentTreeRegistryEntry[]): PreparedComponentTreeDefinitions;
|
|
10
|
+
/** Trusted templateHtml + nested props/bind/show becomes the same RepeatPlan as a page tree. */
|
|
11
|
+
export declare function lowerDefinitionCollections(definition: SomaComponentDefinition, registry: TreeRegistrySnapshot): SomaComponentDefinition;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ComponentTreeMigrationPlan } from './migration';
|
|
2
|
+
import type { TreeCompileContext } from '../../shared/types/component-tree.types';
|
|
3
|
+
interface TrackedFile {
|
|
4
|
+
file: string;
|
|
5
|
+
text: string;
|
|
6
|
+
exists: boolean;
|
|
7
|
+
digest: string;
|
|
8
|
+
external?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ComponentTreeMigrationPage {
|
|
11
|
+
hostDir: string;
|
|
12
|
+
base: string;
|
|
13
|
+
plan: ComponentTreeMigrationPlan;
|
|
14
|
+
htmlFile: string;
|
|
15
|
+
uiFile: string;
|
|
16
|
+
markupFile: string;
|
|
17
|
+
files: TrackedFile[];
|
|
18
|
+
/** Source packages are inventory-only; modifying installed dependencies is never automatic. */
|
|
19
|
+
writable: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Standard Host inventory, without loading Domain classes, credentials or application services. */
|
|
22
|
+
export declare function inspectComponentTreeMigrationPage(hostDir: string, pageBase: string, explicitContext?: TreeCompileContext): ComponentTreeMigrationPage;
|
|
23
|
+
export declare function listComponentTreeMigrationPages(hostDir: string): string[];
|
|
24
|
+
/** Explicit proposal output only; existing files are never overwritten. */
|
|
25
|
+
export declare function writeComponentTreeMigrationProposal(page: ComponentTreeMigrationPage, outputDir: string): void;
|
|
26
|
+
/** Reviewed exact plan only. Stage everything first; retain backups and compensate a failed rename. */
|
|
27
|
+
export declare function applyComponentTreeMigrationPlan(page: ComponentTreeMigrationPage, approval: {
|
|
28
|
+
sourceDigest: string;
|
|
29
|
+
planDigest: string;
|
|
30
|
+
reviewed: boolean;
|
|
31
|
+
}): {
|
|
32
|
+
changed: string[];
|
|
33
|
+
backupDirectory: string;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type SomaPageDeclarationInput } from '../compiler/page-declaration-compiler';
|
|
2
|
+
export type ComponentTreeMigrationStatus = 'converted' | 'needs-business-component' | 'unsupported' | 'unchanged';
|
|
3
|
+
export interface ComponentTreeMigrationItem {
|
|
4
|
+
status: 'needs-business-component' | 'unsupported';
|
|
5
|
+
sourcePath: string;
|
|
6
|
+
reason: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ComponentTreeMigrationPlan {
|
|
9
|
+
schemaVersion: 1;
|
|
10
|
+
status: ComponentTreeMigrationStatus;
|
|
11
|
+
sourceDigest: string;
|
|
12
|
+
planDigest: string;
|
|
13
|
+
mappings: Array<{
|
|
14
|
+
sourcePath: string;
|
|
15
|
+
targetPath: string;
|
|
16
|
+
identity?: string;
|
|
17
|
+
}>;
|
|
18
|
+
manualItems: ComponentTreeMigrationItem[];
|
|
19
|
+
requiredComparisons: string[];
|
|
20
|
+
candidate?: {
|
|
21
|
+
markup: 'component-tree';
|
|
22
|
+
grammarVersion: 1;
|
|
23
|
+
html: string;
|
|
24
|
+
uiYaml: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Pure migration analysis. It never guesses a component for a native business/layout node. */
|
|
28
|
+
export declare function planComponentTreeMigration(input: SomaPageDeclarationInput): ComponentTreeMigrationPlan;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type SomaComponentTree, type TreeLimits } from '../../shared/types/component-tree.types';
|
|
2
|
+
export interface ParseComponentTreeOptions {
|
|
3
|
+
sourceId?: string;
|
|
4
|
+
limits?: Partial<TreeLimits>;
|
|
5
|
+
}
|
|
6
|
+
type Tag = 'soma-host' | 'soma-component' | 'soma-slot' | 'soma-fragment' | 'soma-repeat';
|
|
7
|
+
export declare const COMPONENT_TREE_ATTRIBUTES: Readonly<Record<Tag, readonly string[]>>;
|
|
8
|
+
/**
|
|
9
|
+
* Strict build-time syntax parser. It deliberately does not use the browser's
|
|
10
|
+
* error-recovering HTML parser, resolve Registry entries, or inspect live data.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseComponentTree(source: string, options?: ParseComponentTreeOptions): SomaComponentTree;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SomaComponentDefinition } from '../../client/component/component-definition.types';
|
|
2
|
+
import type { TreeRegistrySnapshot } from '../../shared/types/component-tree.types';
|
|
3
|
+
export interface ComponentTreeRegistryEntry {
|
|
4
|
+
definition: SomaComponentDefinition;
|
|
5
|
+
packName?: string;
|
|
6
|
+
packVersion?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ComponentTreeRegistrySnapshotOptions {
|
|
9
|
+
sourceId?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Captures contract/schema preconditions without executing controllers or UI package code.
|
|
13
|
+
* Captures trusted implementation topology without retaining templates or executing controllers.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildComponentTreeRegistrySnapshot(entries: readonly ComponentTreeRegistryEntry[], options?: ComponentTreeRegistrySnapshotOptions): TreeRegistrySnapshot;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SomaPageMarkup, TreeCompileContext, TreeValidationResult } from '../../shared/types/component-tree.types';
|
|
2
|
+
export interface ComponentTreePreflightInput {
|
|
3
|
+
html: string;
|
|
4
|
+
uiYaml: string;
|
|
5
|
+
markup?: SomaPageMarkup;
|
|
6
|
+
grammarVersion?: number;
|
|
7
|
+
treeContext?: TreeCompileContext;
|
|
8
|
+
externalBlocks?: ReadonlyMap<string, string>;
|
|
9
|
+
}
|
|
10
|
+
/** Explicit format selection. Invalid metadata must never fall back to legacy HTML. */
|
|
11
|
+
export declare function resolvePageMarkup(input: Pick<ComponentTreePreflightInput, 'markup' | 'grammarVersion'>): SomaPageMarkup;
|
|
12
|
+
/**
|
|
13
|
+
* Build/server preflight only: grammar, identity, Registry and composition rules.
|
|
14
|
+
* It does not compile canonical props/events, emit HTML or produce a publishable artifact.
|
|
15
|
+
*/
|
|
16
|
+
export declare function preflightComponentTree(input: ComponentTreePreflightInput): TreeValidationResult;
|
|
17
|
+
/**
|
|
18
|
+
* A syntax leak guard, not an HTML sanitizer. Use the HTML tree-builder's actual
|
|
19
|
+
* namespace/raw-text rules and visit inert template content as well as ordinary children.
|
|
20
|
+
* Existing Registry injection checks retain responsibility for unsafe native HTML.
|
|
21
|
+
*/
|
|
22
|
+
export declare function assertNoComponentTreeSyntax(html: string): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SomaComponentContract } from '../../shared/types/component-contract.types';
|
|
2
|
+
import type { SomaStructureAdapterDefinition } from '../../shared/types/component-tree-artifact.types';
|
|
3
|
+
/** Proves the trusted implementation topology once, without a browser or controllers. */
|
|
4
|
+
export declare function inspectStructureTopology(contract: SomaComponentContract, templateHtml: string, adapter?: SomaStructureAdapterDefinition, uiConfig?: unknown): {
|
|
5
|
+
internalRootId?: string;
|
|
6
|
+
templateRootTag?: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SomaComponentTree, type TreeCompileContext, type TreeValidationResult } from '../../shared/types/component-tree.types';
|
|
2
|
+
/**
|
|
3
|
+
* Validate only source/context facts. The return value is not an executable asset;
|
|
4
|
+
* binding lowering, effective-parent proof and full artifact delivery are separate.
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateComponentTree(tree: SomaComponentTree, input: {
|
|
7
|
+
domain: string;
|
|
8
|
+
context: TreeCompileContext;
|
|
9
|
+
}): TreeValidationResult;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TreeCompileContext, TreeRegistrySnapshot } from '../../shared/types/component-tree.types';
|
|
2
|
+
export { loadPageMarkupConfig } from '../../server/host/page-markup-config';
|
|
3
|
+
export interface TreeEditorPosition {
|
|
4
|
+
line: number;
|
|
5
|
+
character: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TreeEditorDiagnostic {
|
|
8
|
+
uri: string;
|
|
9
|
+
code: string;
|
|
10
|
+
severity: number;
|
|
11
|
+
source: string;
|
|
12
|
+
message: string;
|
|
13
|
+
range: {
|
|
14
|
+
start: TreeEditorPosition;
|
|
15
|
+
end: TreeEditorPosition;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Same parser/compiler as publishing. LSP supplies only trusted Host context, never source metadata. */
|
|
19
|
+
export declare function diagnoseComponentTree(input: {
|
|
20
|
+
html: string;
|
|
21
|
+
uiYaml: string;
|
|
22
|
+
htmlUri: string;
|
|
23
|
+
uiUri: string;
|
|
24
|
+
markup?: 'legacy-html' | 'component-tree';
|
|
25
|
+
grammarVersion?: number;
|
|
26
|
+
treeContext?: TreeCompileContext;
|
|
27
|
+
}): TreeEditorDiagnostic[];
|
|
28
|
+
/** Tolerant cursor context is only for suggestions; it never claims a partial document is valid. */
|
|
29
|
+
export declare function completeComponentTree(text: string, position: TreeEditorPosition, registry?: TreeRegistrySnapshot): {
|
|
30
|
+
label: string;
|
|
31
|
+
insertText: string;
|
|
32
|
+
detail: string;
|
|
33
|
+
kind: number;
|
|
34
|
+
}[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CatalogExampleCapabilities } from './catalog-examples';
|
|
2
|
+
import { type SomaComponentContract, type SomaContractKeyboard, type SomaContractOverlay, type SomaGeometryFamily, type SomaContractExample, type SomaContractStructure } from '../../shared/types/component-contract.types';
|
|
2
3
|
import type { SomaComponentDefinition } from './component-definition.types';
|
|
3
4
|
export interface SomaAiCatalogEntry {
|
|
4
5
|
name: string;
|
|
@@ -44,6 +45,19 @@ export interface SomaAiCatalogEntry {
|
|
|
44
45
|
};
|
|
45
46
|
/** 浮层行为契约(声明了才有) */
|
|
46
47
|
overlay?: SomaContractOverlay;
|
|
48
|
+
/** Public structural summary; implementation anchor names/selectors never enter the catalog. */
|
|
49
|
+
structure?: {
|
|
50
|
+
kind: SomaContractStructure['kind'];
|
|
51
|
+
rootless: boolean;
|
|
52
|
+
treeMount: SomaContractStructure['tree_mount'];
|
|
53
|
+
semantics?: SomaContractStructure['semantics'];
|
|
54
|
+
slots: Array<{
|
|
55
|
+
name: string;
|
|
56
|
+
kind: 'projection' | 'collection';
|
|
57
|
+
directChildren: boolean;
|
|
58
|
+
rowContainer?: 'none' | 'list-item';
|
|
59
|
+
}>;
|
|
60
|
+
};
|
|
47
61
|
/** 契约级依赖(F-46):装这个还要装什么 */
|
|
48
62
|
uses?: string[];
|
|
49
63
|
/** 组件级令牌(M-1):这个组件开放的可调旋钮及其 CSS 变量名 */
|
|
@@ -57,6 +71,7 @@ export interface SomaAiCatalogEntry {
|
|
|
57
71
|
whenToUse: string;
|
|
58
72
|
whenNotToUse?: string;
|
|
59
73
|
example: string;
|
|
74
|
+
examples?: readonly SomaContractExample[];
|
|
60
75
|
antiPatterns?: string[];
|
|
61
76
|
};
|
|
62
77
|
/**
|
|
@@ -97,6 +112,8 @@ export interface GenerateAiCatalogOptions {
|
|
|
97
112
|
* 不传则目录产物与历史完全一致。
|
|
98
113
|
*/
|
|
99
114
|
conventions?: string;
|
|
115
|
+
/** Human/tool consumers may opt in; AI/native-page consumers remain legacy-only by default. */
|
|
116
|
+
exampleCapabilities?: CatalogExampleCapabilities;
|
|
100
117
|
}
|
|
101
118
|
/**
|
|
102
119
|
* 生成完整 AI 目录。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SomaContractExample } from '../../shared/types/component-contract.types';
|
|
2
|
+
export interface CatalogExampleSource {
|
|
3
|
+
ai?: {
|
|
4
|
+
example?: string;
|
|
5
|
+
examples?: readonly SomaContractExample[];
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface CatalogExampleCapabilities {
|
|
9
|
+
/** In preference order. Missing options intentionally means legacy-only. */
|
|
10
|
+
formats?: readonly SomaContractExample['format'][];
|
|
11
|
+
capabilities?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
/** No tree source is selected unless both its grammar format and capabilities are accepted. */
|
|
14
|
+
export declare function selectSomaCatalogExample(entry: CatalogExampleSource, options?: CatalogExampleCapabilities): SomaContractExample | null;
|
|
15
|
+
/** Human-readable usage retains format metadata, rather than pretending tree tags are HTML. */
|
|
16
|
+
export declare function formatSomaCatalogExample(example: SomaContractExample): string;
|
|
17
|
+
/** Validate the portable example envelope without importing build-time parsers in the client. */
|
|
18
|
+
export declare function copyCatalogExamples(examples: readonly SomaContractExample[]): SomaContractExample[];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { UiConfig } from '../../shared/types/ui-config.types';
|
|
2
2
|
import type { ParsedEvent } from '../../shared/types/event.types';
|
|
3
3
|
import type { SomaComponentContract } from '../../shared/types/component-contract.types';
|
|
4
|
+
import type { DefinitionPreparation, DefinitionRepeatPlan, SomaStructureAdapterDefinition } from '../../shared/types/component-tree-artifact.types';
|
|
5
|
+
import type { TreeCollectionSource } from '../../shared/types/component-tree.types';
|
|
4
6
|
/** 控制器工厂上下文:props 即实例作用域根(可读取最新值),emit 向页面上抛 */
|
|
5
7
|
export interface SomaComponentControllerContext {
|
|
6
8
|
props: Record<string, unknown>;
|
|
@@ -61,6 +63,13 @@ export interface SomaComponentStyleFeature {
|
|
|
61
63
|
}
|
|
62
64
|
export interface SomaComponentDefinition {
|
|
63
65
|
contract: SomaComponentContract;
|
|
66
|
+
structureAdapter?: SomaStructureAdapterDefinition;
|
|
67
|
+
collectionSources?: readonly TreeCollectionSource[];
|
|
68
|
+
definitionRepeatPlans?: DefinitionRepeatPlan[];
|
|
69
|
+
definitionPreparation?: DefinitionPreparation;
|
|
70
|
+
/** Precomputed by the trusted package build; never browser-computed with Node. */
|
|
71
|
+
structureDigest?: string;
|
|
72
|
+
contractDigest?: string;
|
|
64
73
|
/**
|
|
65
74
|
* 组件内部结构模板。内部锚点写 data-soma-id(与页面 DSL 一致),
|
|
66
75
|
* 展开器统一改写为 data-soma-scoped-id 实现作用域隔离。
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SomaComponentDefinition } from './component-definition.types';
|
|
2
|
+
import type { StructurePlan } from '../../shared/types/component-tree-artifact.types';
|
|
2
3
|
export declare const SOMA_COMPONENT_ATTR = "data-soma-component";
|
|
3
4
|
/**
|
|
4
5
|
* 展开完成标记;**值为该次展开分配的 scopeId**(此前是空串)。
|
|
@@ -20,6 +21,7 @@ export declare class SomaComponentExpander {
|
|
|
20
21
|
/** 已展开宿主的 scopeId(未展开返回 null) */
|
|
21
22
|
scopeIdOf(host: HTMLElement): string | null;
|
|
22
23
|
/** @returns 本次展开分配的 scopeId(宿主已展开时返回既有的那个) */
|
|
23
|
-
expand(host: HTMLElement, def: SomaComponentDefinition): string;
|
|
24
|
+
expand(host: HTMLElement, def: SomaComponentDefinition, plan?: StructurePlan, staticProps?: Record<string, unknown>): string;
|
|
24
25
|
private scopeAnchors;
|
|
26
|
+
private collectSlotOutlets;
|
|
25
27
|
}
|
|
@@ -9,6 +9,7 @@ import type { SomaComponentDefinition } from './component-definition.types';
|
|
|
9
9
|
import { SomaComponentRegistry } from './component-registry';
|
|
10
10
|
import type { SomaComponentDefaults } from './component-defaults';
|
|
11
11
|
import type { PackStyleOptions } from './pack-styles';
|
|
12
|
+
import { type TreeArtifact } from '../../shared/types/component-tree-artifact.types';
|
|
12
13
|
/** 页面运行时接入点(activate 入参) */
|
|
13
14
|
export interface SomaComponentPageRuntime {
|
|
14
15
|
container: HTMLElement;
|
|
@@ -20,6 +21,8 @@ export interface SomaComponentPageRuntime {
|
|
|
20
21
|
services?: Record<string, unknown>;
|
|
21
22
|
}
|
|
22
23
|
export interface SomaComponentManagerOptions {
|
|
24
|
+
/** The complete artifact has already passed the bootstrap integrity gate. */
|
|
25
|
+
treeArtifact?: TreeArtifact;
|
|
23
26
|
registry: SomaComponentRegistry;
|
|
24
27
|
scheduler?: SomaScheduler;
|
|
25
28
|
diagnostics?: SomaDiagnostics;
|
|
@@ -42,6 +45,8 @@ export declare class SomaComponentManager {
|
|
|
42
45
|
private readonly componentDefaults?;
|
|
43
46
|
private readonly styleOptions?;
|
|
44
47
|
private readonly expander;
|
|
48
|
+
private readonly treeArtifact?;
|
|
49
|
+
private readonly preparedDefinitions;
|
|
45
50
|
private staticDecls;
|
|
46
51
|
private propsIndex;
|
|
47
52
|
private readonly instances;
|
|
@@ -106,6 +111,9 @@ export declare class SomaComponentManager {
|
|
|
106
111
|
* 未注册的组件名在此静默跳过(不阻塞收敛),照旧由 applyChildComponent 抛错点名。
|
|
107
112
|
*/
|
|
108
113
|
private expandNestedTemplates;
|
|
114
|
+
private expandHost;
|
|
115
|
+
private assertDefinitionPrepared;
|
|
116
|
+
private artifactError;
|
|
109
117
|
private createChildReader;
|
|
110
118
|
/** 自治组件服务注入:按定义白名单过滤页面服务表(白名单外不可见) */
|
|
111
119
|
private filterServices;
|
|
@@ -165,6 +173,7 @@ export declare class SomaComponentInstance {
|
|
|
165
173
|
private readonly staticChildren;
|
|
166
174
|
private readonly mountChild;
|
|
167
175
|
private readonly styleOptions?;
|
|
176
|
+
private readonly host;
|
|
168
177
|
constructor(options: SomaComponentInstanceOptions);
|
|
169
178
|
/**
|
|
170
179
|
* 整树重渲 + 把新的 props 推给模板里静态嵌套的子组件。
|
|
@@ -186,6 +195,8 @@ export declare class SomaComponentInstance {
|
|
|
186
195
|
/** props 下行更新:浅合并后整树重渲(ctrl 派生 getter 自然重算) */
|
|
187
196
|
setProps(next: Record<string, unknown>): void;
|
|
188
197
|
getScopeRoot(): Record<string, unknown>;
|
|
198
|
+
/** Internal lifecycle ordering: children must release while their DOM is still attached. */
|
|
199
|
+
getHost(): HTMLElement;
|
|
189
200
|
/** 父实例作用域读取;rowData 存在时与列表行内组件的求值语义一致。 */
|
|
190
201
|
read(path: string, rowData?: unknown): unknown;
|
|
191
202
|
hasVar(segment: string): boolean;
|
|
@@ -3,6 +3,7 @@ import type { SomaAnchorStats } from '../container/IContainerAdapter';
|
|
|
3
3
|
export declare const SOMA_SCOPED_ID_ATTR = "data-soma-scoped-id";
|
|
4
4
|
/** 锚点的作用域归属标记(展开器写入,值为该次展开的 scopeId) */
|
|
5
5
|
export declare const SOMA_SCOPE_ATTR = "data-soma-scope";
|
|
6
|
+
export declare function registerSomaRootAlias(host: HTMLElement, scopeId: string, anchorId: string): void;
|
|
6
7
|
export declare class SomaScopedContainerAdapter extends SomaContainerAdapter {
|
|
7
8
|
/** 本适配器认领的作用域;undefined = 认所有 scoped 锚点 */
|
|
8
9
|
private readonly scopeId?;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StructurePlan, RepeatPlan } from '../../shared/types/component-tree-artifact.types';
|
|
2
|
+
import type { SomaComponentDefinition } from './component-definition.types';
|
|
3
|
+
export interface PreparedStructureTemplate {
|
|
4
|
+
fragment: DocumentFragment;
|
|
5
|
+
root?: HTMLElement;
|
|
6
|
+
rootAlias?: string;
|
|
7
|
+
merge: boolean;
|
|
8
|
+
staticProps: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Validate off-DOM, before replacing the old host or activating any controller. */
|
|
11
|
+
export declare function prepareStructureTemplate(host: HTMLElement, definition: SomaComponentDefinition, plan?: StructurePlan, suppliedProps?: Record<string, unknown>): PreparedStructureTemplate;
|
|
12
|
+
export declare function commitStructureTemplate(host: HTMLElement, prepared: PreparedStructureTemplate): void;
|
|
13
|
+
export declare function registerPreparedStructure(host: HTMLElement, definition: SomaComponentDefinition, scopeId: string, staticProps: Record<string, unknown>): void;
|
|
14
|
+
export declare function assertPreparedStructureProps(host: HTMLElement, props: Record<string, unknown>): void;
|
|
15
|
+
export declare function withPreparedStructureProps(host: HTMLElement, props: Record<string, unknown>, declared: Record<string, unknown>): Record<string, unknown>;
|
|
16
|
+
export declare function resolveCollectionOutlet(host: HTMLElement, plan: RepeatPlan): HTMLElement;
|
|
17
|
+
export declare function publishCollectionState(host: HTMLElement, root: HTMLElement, phase: 'pending' | 'ready' | 'error', count: number, generation: number): void;
|
|
@@ -3,6 +3,7 @@ import type { SomaCompiledBinding } from '../../shared/types/manifest.types';
|
|
|
3
3
|
import type { BindingEntry } from '../../shared/types/engine.types';
|
|
4
4
|
import type { SomaScopeResolver } from './scope-resolver';
|
|
5
5
|
import { type SomaPipeRegistry } from '../pipes/pipe-registry';
|
|
6
|
+
import type { RepeatPlan } from '../../shared/types/component-tree-artifact.types';
|
|
6
7
|
export type ModelWriteBack = (path: string, value: string) => void;
|
|
7
8
|
/**
|
|
8
9
|
* 行内组件钩子:列表/对象作用域渲染遇到带 props 的锚点时回调。
|
|
@@ -31,6 +32,9 @@ export declare class SomaDomRenderer {
|
|
|
31
32
|
private componentHook;
|
|
32
33
|
private componentReleaseHook;
|
|
33
34
|
private pipeRegistry;
|
|
35
|
+
private explicitLists;
|
|
36
|
+
private repeatPlans;
|
|
37
|
+
setRepeatPlans(plans: readonly RepeatPlan[]): void;
|
|
34
38
|
setComponentHook(hook: SomaRowComponentHook | null): void;
|
|
35
39
|
setComponentReleaseHook(hook: SomaRowComponentReleaseHook | null): void;
|
|
36
40
|
/** 摘除单个已渲染节点:先放行释放钩子,再离开 DOM(顺序不可颠倒——查子树需要它还在树上) */
|
|
@@ -74,6 +78,17 @@ export declare class SomaDomRenderer {
|
|
|
74
78
|
destroy(): void;
|
|
75
79
|
renderEntry(entry: BindingEntry, value: any): void;
|
|
76
80
|
private renderList;
|
|
81
|
+
/** All explicit-key sources share this range reconciler; legacy guessing stays separate. */
|
|
82
|
+
private renderExplicitList;
|
|
83
|
+
private attachRepeatPlan;
|
|
84
|
+
private collectionReady;
|
|
85
|
+
private repeatArtifactError;
|
|
86
|
+
private activateDefaultRowComponents;
|
|
87
|
+
private validateNestedRows;
|
|
88
|
+
private rowDepth;
|
|
89
|
+
private repeatLimit;
|
|
90
|
+
private releaseExplicitRange;
|
|
91
|
+
private disposeExplicitList;
|
|
77
92
|
private appendListItem;
|
|
78
93
|
private renderObj;
|
|
79
94
|
private applyShowConfig;
|
|
@@ -45,6 +45,7 @@ export declare class SomaEventEngine<TContext extends Record<string, unknown> =
|
|
|
45
45
|
private readonly middleware;
|
|
46
46
|
private readonly eventContextFactory?;
|
|
47
47
|
private readonly pendingSet;
|
|
48
|
+
private pendingRows;
|
|
48
49
|
private readonly abortController;
|
|
49
50
|
constructor(options: SomaEventEngineOptions<TContext>);
|
|
50
51
|
init(): void;
|
|
@@ -8,6 +8,7 @@ import { SomaScopeResolver } from './scope-resolver';
|
|
|
8
8
|
import { SomaPropertyWatcher } from './property-watcher';
|
|
9
9
|
import type { WatchCallback, WatcherOptions } from '../../shared/types/watcher.types';
|
|
10
10
|
export interface SomaRenderEngineOptions {
|
|
11
|
+
repeatPlans?: readonly import('../../shared/types/component-tree-artifact.types').RepeatPlan[];
|
|
11
12
|
container: HTMLElement;
|
|
12
13
|
adapter: IContainerAdapter;
|
|
13
14
|
manifest: SomaRuntimeManifest;
|