soma-core 1.3.3 → 1.3.5
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 +7 -6
- package/app/SomaPageClient.tsx +2 -72
- package/app/soma/page/route.ts +17 -2
- package/bin/soma-lsp.cjs +1 -4
- package/core/build/compiler/full-manifest-builder.ts +17 -26
- package/core/build/compiler/html-include-expander.ts +56 -0
- package/core/build/compiler/page-assets.ts +26 -0
- package/core/build/compiler/page-declaration-compiler.ts +85 -0
- package/core/build/compiler/rollup-plugin-soma.ts +4 -19
- package/core/build/compiler/route-builder.ts +0 -2
- package/core/build/compiler/rspack-plugin-soma.js +1 -10
- package/core/build/compiler/soma-manifest-webpack-plugin.js +54 -13
- package/core/build/compiler/soma-precompile.js +74 -0
- package/core/build/compiler/soma-precompile.ts +13 -0
- package/core/build/compiler/soma-rspack-yaml-loader.js +5 -11
- package/core/build/compiler/soma-webpack-loader.js +6 -21
- package/core/build/compiler/vite-plugin-soma.ts +9 -31
- package/core/build/component/pack-from-dir.ts +58 -0
- package/core/build/component/package-loader.ts +158 -12
- package/core/build/eject/plan-eject.ts +15 -21
- package/core/build/lsp/cross-file-diagnostics.cjs +82 -113
- package/core/build/lsp/extra-completion.cjs +14 -8
- package/core/build/lsp/lsp-navigation.cjs +50 -43
- package/core/build/lsp/soma-declaration.cjs +85 -0
- package/core/build/lsp/ui-yaml-completion.cjs +98 -104
- package/core/build/v2/block-compile.ts +200 -0
- package/core/build/v2/block-loader.ts +33 -0
- package/core/build/v2/html-index.ts +120 -0
- package/core/build/v2/migrate-v1.ts +370 -0
- package/core/build/v2/soma-file-loader.ts +216 -0
- package/core/client/component/ai-catalog.ts +15 -0
- package/core/client/component/component-pack.ts +205 -31
- package/core/client/component/contract-compat.ts +132 -0
- package/core/client/component/example-v2.ts +132 -0
- package/core/client/engine/dom-renderer.ts +14 -8
- package/core/client/engine/reactive-proxy.ts +8 -7
- package/core/client/engine/soma-bootstrap.ts +23 -5
- package/core/client/parser/v2/namespace.ts +182 -0
- package/core/client/parser/v2/page-parser.ts +359 -0
- package/core/client/parser/v2/use-parser.ts +412 -0
- package/core/client/parser/value-lang.ts +340 -0
- package/core/client/pipes/pipe-registry.ts +1 -1
- package/core/client/registry/declaration-renderer.ts +17 -15
- package/core/client/registry/page-lifecycle.ts +1 -1
- package/core/client/security/attribute-presence.ts +16 -1
- package/core/client/theme/harmony.ts +307 -0
- package/core/client/theme/scene-tokens.ts +134 -0
- package/core/client/theme/theme-axes.ts +228 -0
- package/core/client/theme/theme-engine.ts +333 -73
- package/core/client/theme/tone-solver.ts +118 -0
- package/core/index.ts +74 -2
- package/core/server/host/published-page-assets.ts +35 -0
- package/core/server/host/server-page-assets.ts +33 -16
- package/core/server/host/soma-page-compile.ts +33 -0
- package/core/server/index.ts +15 -0
- package/core/server/registry/declaration-precompiler.ts +24 -54
- package/core/server/registry/page-registry-store.ts +39 -10
- package/core/server/registry/services/pages/Get.ts +19 -9
- package/core/server/registry/validation/compile-gate.ts +14 -31
- package/core/server/registry/validation/cross-check.ts +7 -17
- package/core/server/registry/validation/declaration-safety-scan.ts +2 -2
- package/core/shared/types/component-contract.types.ts +10 -0
- package/dist/core/index.cjs +2144 -155
- package/dist/types/build/compiler/full-manifest-builder.d.ts +4 -4
- package/dist/types/build/compiler/html-include-expander.d.ts +19 -0
- package/dist/types/build/compiler/page-assets.d.ts +3 -0
- package/dist/types/build/compiler/page-declaration-compiler.d.ts +33 -0
- package/dist/types/build/compiler/rollup-plugin-soma.d.ts +0 -3
- package/dist/types/build/compiler/route-builder.d.ts +0 -1
- package/dist/types/build/compiler/soma-precompile.d.ts +8 -0
- package/dist/types/build/compiler/vite-plugin-soma.d.ts +2 -10
- package/dist/types/build/component/pack-from-dir.d.ts +17 -0
- package/dist/types/build/component/package-loader.d.ts +33 -2
- package/dist/types/build/v2/block-compile.d.ts +28 -0
- package/dist/types/build/v2/block-loader.d.ts +9 -0
- package/dist/types/build/v2/html-index.d.ts +37 -0
- package/dist/types/build/v2/migrate-v1.d.ts +32 -0
- package/dist/types/build/v2/soma-file-loader.d.ts +45 -0
- package/dist/types/client/component/component-pack.d.ts +23 -3
- package/dist/types/client/component/contract-compat.d.ts +16 -0
- package/dist/types/client/component/example-v2.d.ts +9 -0
- package/dist/types/client/engine/dom-renderer.d.ts +2 -0
- package/dist/types/client/engine/soma-bootstrap.d.ts +3 -1
- package/dist/types/client/parser/v2/namespace.d.ts +52 -0
- package/dist/types/client/parser/v2/page-parser.d.ts +21 -0
- package/dist/types/client/parser/v2/use-parser.d.ts +72 -0
- package/dist/types/client/parser/value-lang.d.ts +63 -0
- package/dist/types/client/registry/declaration-renderer.d.ts +1 -2
- package/dist/types/client/theme/harmony.d.ts +77 -0
- package/dist/types/client/theme/scene-tokens.d.ts +25 -0
- package/dist/types/client/theme/theme-axes.d.ts +81 -0
- package/dist/types/client/theme/theme-engine.d.ts +29 -1
- package/dist/types/client/theme/tone-solver.d.ts +47 -0
- package/dist/types/index.d.ts +13 -2
- package/dist/types/server/host/published-page-assets.d.ts +19 -0
- package/dist/types/server/host/server-page-assets.d.ts +1 -4
- package/dist/types/server/host/soma-page-compile.d.ts +7 -0
- package/dist/types/server/index.d.ts +3 -1
- package/dist/types/server/registry/declaration-precompiler.d.ts +3 -3
- package/dist/types/server/registry/page-registry-store.d.ts +5 -5
- package/dist/types/server/registry/validation/compile-gate.d.ts +2 -0
- package/dist/types/server/registry/validation/cross-check.d.ts +4 -4
- package/dist/types/shared/types/component-contract.types.d.ts +10 -0
- package/editor/vscode/package.json +1 -24
- package/global.d.ts +1 -11
- package/next.config.js +32 -50
- package/package.json +3 -2
- package/tailwind.config.ts +0 -1
- package/tsconfig.json +20 -7
- package/core/build/lsp/event-yaml-completion.cjs +0 -106
- package/core/client/host-bridge/empty-host/data/README.md +0 -17
- package/editor/vscode/syntaxes/soma-event-yaml.tmLanguage.json +0 -30
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { SomaPipeCall } from '../../shared/types/scope-manifest.types';
|
|
2
|
+
export declare class SomaValueLangError extends Error {
|
|
3
|
+
readonly raw: string;
|
|
4
|
+
constructor(message: string, raw: string);
|
|
5
|
+
}
|
|
6
|
+
/** 值段的指令节点:JSON 可序列化,进清单 */
|
|
7
|
+
export type ValueNode = {
|
|
8
|
+
kind: 'path';
|
|
9
|
+
path: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'lit';
|
|
12
|
+
value: string | number | boolean;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'neg';
|
|
15
|
+
operand: ValueNode;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'arith';
|
|
18
|
+
op: '+' | '-' | '*' | '/';
|
|
19
|
+
left: ValueNode;
|
|
20
|
+
right: ValueNode;
|
|
21
|
+
};
|
|
22
|
+
export interface PipedValue {
|
|
23
|
+
seg: ValueNode;
|
|
24
|
+
pipes: SomaPipeCall[];
|
|
25
|
+
/** 值内引用的全部绑定路径(段内 + 管道实参),供 watchPaths 注册 */
|
|
26
|
+
paths: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 值位置。算术与计算管道是**展示位专有**——算出来的值不驱动行为,
|
|
30
|
+
* 业务规则(定价、优惠、判断)留在 Domain 才可测试。
|
|
31
|
+
*/
|
|
32
|
+
export type ValuePosition = 'display' | 'condition' | 'key';
|
|
33
|
+
/** 判定一个变量首段是否在当前作用域(与既有 hasVar 同款契约) */
|
|
34
|
+
export type HasVarFn = (segment: string) => boolean;
|
|
35
|
+
/** 段内是否需要走算术解析(出现运算符或括号即是;路径词法不含它们) */
|
|
36
|
+
export declare function isArithSegment(segment: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 解析一个值段(不含管道)。
|
|
39
|
+
*
|
|
40
|
+
* 纯路径与纯字面量走快路径;含运算符时进算术文法。
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseValueSegment(segment: string, hasVar: HasVarFn, position?: ValuePosition, source?: string): {
|
|
43
|
+
node: ValueNode;
|
|
44
|
+
paths: string[];
|
|
45
|
+
};
|
|
46
|
+
/** 值段内是否只是一条裸路径(供上层决定是否走既有轻路径) */
|
|
47
|
+
export declare function isPlainPath(node: ValueNode): node is {
|
|
48
|
+
kind: 'path';
|
|
49
|
+
path: string;
|
|
50
|
+
};
|
|
51
|
+
export interface EvalOptions {
|
|
52
|
+
/** dev 下算术遇非数值/除零直接抛错(含表达式原文);prod 返回 null 交由上层占位 */
|
|
53
|
+
dev?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 对指令节点求值。
|
|
57
|
+
*
|
|
58
|
+
* 除零与非数值:dev 抛错(点名原文,避免"页面上一个 NaN 查半天"),
|
|
59
|
+
* prod 返回 null——上层渲染占位符,与 role_by 未命中的既有语义一致。
|
|
60
|
+
*/
|
|
61
|
+
export declare function evaluateValueNode(node: ValueNode, read: (path: string) => unknown, options?: EvalOptions): unknown;
|
|
62
|
+
/** 把指令节点还原成近似原文,仅用于报错可读性 */
|
|
63
|
+
export declare function describeNode(node: ValueNode): string;
|
|
@@ -2,8 +2,7 @@ import type { SomaComponentDefinition } from '../component/component-definition.
|
|
|
2
2
|
import type { SomaAdaptiveVocabulary } from '../../shared/types/adaptive.types';
|
|
3
3
|
import type { SomaErrorEvent, SomaPageIdentity } from '../observability/error-reporter';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* 对不上则整份忽略——**缓存不是真理**,拿旧编译器的产物渲染新语义比慢一点危险得多。
|
|
5
|
+
* 服务端编译产物。浏览器不编译 SOMA DSL 源声明,缺失或不完整时明确拒绝。
|
|
7
6
|
*/
|
|
8
7
|
export interface PrecompiledDeclarationAssets {
|
|
9
8
|
uiConfig?: unknown;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { SomaAxisParams, SomaResolvedAxes, SomaSemantics } from './theme-axes';
|
|
2
|
+
export type SomaToneName = 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export interface SomaHueAnchors {
|
|
4
|
+
/** 各语气的色相锚(度,0–360) */
|
|
5
|
+
readonly tones: Readonly<Record<SomaToneName, number>>;
|
|
6
|
+
/** 图表序列 8 锚 */
|
|
7
|
+
readonly chart: readonly number[];
|
|
8
|
+
/** 色相带宽 < 120° 时为 true:序列区分改以明度阶梯为主 */
|
|
9
|
+
readonly chartLightnessLadder: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 功能色相:danger 偏红、success 偏绿、warning 偏琥珀、info 偏蓝。
|
|
13
|
+
*
|
|
14
|
+
* 这四个数从现状引擎 ④.1 的字面常量迁来,**取值一个没改**——
|
|
15
|
+
* functional 档(缺省)下产出与重构前完全一致。
|
|
16
|
+
*/
|
|
17
|
+
export declare const FUNCTIONAL_HUES: {
|
|
18
|
+
readonly info: 230;
|
|
19
|
+
readonly success: 150;
|
|
20
|
+
readonly warning: 75;
|
|
21
|
+
readonly danger: 27;
|
|
22
|
+
};
|
|
23
|
+
/** 表达性语气相对品牌的色相偏移(自现状 ④.1b 迁来,取值不改) */
|
|
24
|
+
export declare const EXPRESSIVE_OFFSETS: {
|
|
25
|
+
readonly secondary: 48;
|
|
26
|
+
readonly accent: 160;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 判撞阈值:色相与明度**同时**低于阈值才算撞。
|
|
30
|
+
*
|
|
31
|
+
* 只看色相不够——深红按钮配亮红徽标是可辨的;只看明度更不够。
|
|
32
|
+
* 阈值以 cartoonPop 病例(Δh 10.5°、ΔL 0.05)为下界校准。
|
|
33
|
+
* 导出是为了让棘轮测试直接引用,不在测试里抄一遍数字。
|
|
34
|
+
*/
|
|
35
|
+
export declare const SEPARATION_THRESHOLD: {
|
|
36
|
+
readonly hue: 30;
|
|
37
|
+
readonly lightness: 0.12;
|
|
38
|
+
};
|
|
39
|
+
/** 最短弧角差,返回 (-180, 180] */
|
|
40
|
+
export declare function angDiff(a: number, b: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* 色相压缩:把目标色相朝品牌色相压缩 k 倍。
|
|
43
|
+
* k=0 原值不动(功能优先);k=1 完全归一(单色系)。走最短弧,不绕远路。
|
|
44
|
+
*/
|
|
45
|
+
export declare function compress(hue: number, brandHue: number, k: number): number;
|
|
46
|
+
/**
|
|
47
|
+
* S1:解出全部色相锚。
|
|
48
|
+
*
|
|
49
|
+
* 作用域与优先序(《架构设计》§3 的表):
|
|
50
|
+
* accents 显式锁位 > semantics 决定语义三色 > harmony 决定其余 > 缺省
|
|
51
|
+
*/
|
|
52
|
+
export declare function resolveHueAnchors(brandHue: number, axes: SomaResolvedAxes, params: SomaAxisParams, accentHues?: readonly number[]): SomaHueAnchors;
|
|
53
|
+
/** 一组色相的极差(考虑环绕:取覆盖全部点的最小弧长) */
|
|
54
|
+
export declare function hueBandwidth(hues: readonly number[]): number;
|
|
55
|
+
export interface SeparationResult {
|
|
56
|
+
readonly anchors: SomaHueAnchors;
|
|
57
|
+
readonly applied: boolean;
|
|
58
|
+
readonly pushed: readonly ('success' | 'warning' | 'danger')[];
|
|
59
|
+
/**
|
|
60
|
+
* 色相区内推不出安全距离的语气:分离改由**明度**承担。
|
|
61
|
+
* 值是相对品牌明度需要的最小偏移方向与幅度,由编排者施加到该语气的明度上。
|
|
62
|
+
*/
|
|
63
|
+
readonly lightnessSeparation: Readonly<Partial<Record<'success' | 'warning' | 'danger', {
|
|
64
|
+
direction: 1 | -1;
|
|
65
|
+
minGap: number;
|
|
66
|
+
}>>>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* S3 语义分离闸:品牌与语义色撞了就**推开语义色**,不动品牌。
|
|
70
|
+
*
|
|
71
|
+
* 为什么推语义色不推品牌:品牌是宿主给的身份,引擎无权改;
|
|
72
|
+
* 而语义色本来就是派生物,移动它只需保证仍在自己的语义区间内可辨。
|
|
73
|
+
*
|
|
74
|
+
* immersive 档下闸退场——那一档的可辨性责任已移交信号通道,
|
|
75
|
+
* 此时再推色相等于既要色相编码又要动效编码,两头不讨好。
|
|
76
|
+
*/
|
|
77
|
+
export declare function applySeparationGuard(anchors: SomaHueAnchors, brandHue: number, brandLightness: number, toneLightness: Readonly<Record<SomaToneName, number>>, semantics: SomaSemantics): SeparationResult;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SomaResolvedAxes } from './theme-axes';
|
|
2
|
+
/**
|
|
3
|
+
* S5:不含颜色的场景结构参数。
|
|
4
|
+
*
|
|
5
|
+
* 玻璃三档的 rgba 从引擎主体迁到这里(值一个没改)——它们是材质的结构属性,
|
|
6
|
+
* 与 field/material 轴同族,散在派生链中间只会让人以为它们是色板的一部分。
|
|
7
|
+
*/
|
|
8
|
+
export declare function sceneStructureTokens(axes: SomaResolvedAxes): Record<string, string>;
|
|
9
|
+
/** 暗色下的玻璃:半透明**黑**而不是白——白玻璃压在深底上会变成发光板 */
|
|
10
|
+
export declare function glassTokens(dark: boolean): Record<string, string>;
|
|
11
|
+
/**
|
|
12
|
+
* S7′:场景颜色——吃 overrides 合并后的**最终**变量表。
|
|
13
|
+
*
|
|
14
|
+
* 三团环境光取自最终色板的 300/500/400 三档:宿主用 overrides 改了主色,
|
|
15
|
+
* 光球会跟着改,不会出现表面与场分属两个色系。
|
|
16
|
+
*/
|
|
17
|
+
export declare function sceneColorTokens(finalVars: Readonly<Record<string, string>>, axes: SomaResolvedAxes, alphas: readonly [number, number, number] | null, hexWithAlpha: (hex: string, alpha: number) => string,
|
|
18
|
+
/** 品牌色阶:三团光的缺省取色源(G1 用的就是 300/500/400 三档) */
|
|
19
|
+
scale: Readonly<Record<string, string>>,
|
|
20
|
+
/**
|
|
21
|
+
* 覆盖后的色阶重建器:宿主用 overrides 换掉了主色时,
|
|
22
|
+
* 光球必须跟着换色系,否则 daisy × aurora 会"表面一个色系、光球另一个色系"。
|
|
23
|
+
* 传 null 表示主色未被覆盖,直接用原色阶。
|
|
24
|
+
*/
|
|
25
|
+
rescale: ((primaryHex: string) => Record<string, string>) | null): Record<string, string>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type SomaHarmony = 'functional' | 'analogous' | 'monochrome' | 'complementary';
|
|
2
|
+
export type SomaSemantics = 'faithful' | 'tinted' | 'immersive';
|
|
3
|
+
export type SomaChroma = 'muted' | 'balanced' | 'vivid';
|
|
4
|
+
export type SomaContrast = 'soft' | 'standard' | 'strong';
|
|
5
|
+
export type SomaField = 'flat' | 'tinted' | 'aurora';
|
|
6
|
+
export type SomaIntensity = 'whisper' | 'soft' | 'bold';
|
|
7
|
+
export type SomaMaterial = 'solid' | 'glass';
|
|
8
|
+
export interface SomaPaletteAxes {
|
|
9
|
+
/** 色相编排:语义色与品牌的色相关系 */
|
|
10
|
+
harmony?: SomaHarmony;
|
|
11
|
+
/** 语义色忠实度:success/warning/danger 允许被 harmony 带走多远 */
|
|
12
|
+
semantics?: SomaSemantics;
|
|
13
|
+
/** 彩度个性:素净 ↔ 浓烈 */
|
|
14
|
+
chroma?: SomaChroma;
|
|
15
|
+
/** 明度反差:柔光粉彩 ↔ 高反差;AA 底线不随档移动 */
|
|
16
|
+
contrast?: SomaContrast;
|
|
17
|
+
/** 显式辅色(≤3):点名代替派生,依次锁 secondary/accent/info 的色相锚 */
|
|
18
|
+
accents?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface SomaSceneAxes {
|
|
21
|
+
/** 背景场:页面的"底"是平色、染色还是环境光场 */
|
|
22
|
+
field?: SomaField;
|
|
23
|
+
/** 场强三档(flat 下无义) */
|
|
24
|
+
intensity?: SomaIntensity;
|
|
25
|
+
/** 材质缺省档;组件级 surface prop 仍可逐个覆盖 */
|
|
26
|
+
material?: SomaMaterial;
|
|
27
|
+
}
|
|
28
|
+
/** 缺省回落后的确定轴位——meta 观测面与全部下游阶段的输入 */
|
|
29
|
+
export interface SomaResolvedAxes {
|
|
30
|
+
readonly palette: {
|
|
31
|
+
readonly harmony: SomaHarmony;
|
|
32
|
+
readonly semantics: SomaSemantics;
|
|
33
|
+
readonly chroma: SomaChroma;
|
|
34
|
+
readonly contrast: SomaContrast;
|
|
35
|
+
readonly accents: readonly string[];
|
|
36
|
+
};
|
|
37
|
+
readonly scene: {
|
|
38
|
+
readonly field: SomaField;
|
|
39
|
+
readonly intensity: SomaIntensity;
|
|
40
|
+
readonly material: SomaMaterial;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** 三个目标对比度:语气底对页面底、前景对语气底、正文对页面底 */
|
|
44
|
+
export interface SomaContrastTargets {
|
|
45
|
+
readonly toneOnPage: number;
|
|
46
|
+
readonly fgOnTone: number;
|
|
47
|
+
readonly textOnPage: number;
|
|
48
|
+
}
|
|
49
|
+
/** 档位解析出的数值参数 */
|
|
50
|
+
export interface SomaAxisParams {
|
|
51
|
+
/** 色相压缩系数:0 = 功能色相原值,1 = 完全归一到品牌色相 */
|
|
52
|
+
readonly harmonyK: number;
|
|
53
|
+
/** complementary 专用:accent 先跳到品牌对侧再压缩 */
|
|
54
|
+
readonly accentComplement: boolean;
|
|
55
|
+
/** 彩度乘数,乘在既有彩度算式上 */
|
|
56
|
+
readonly chromaMul: number;
|
|
57
|
+
readonly targets: SomaContrastTargets;
|
|
58
|
+
readonly darkTargets: SomaContrastTargets;
|
|
59
|
+
/** contrast:soft 的粉彩明度带;null = 不约束(现状) */
|
|
60
|
+
readonly softLightnessBand: readonly [number, number] | null;
|
|
61
|
+
/** 环境光三团的 alpha;null = flat(产 transparent) */
|
|
62
|
+
readonly fieldAlphas: readonly [number, number, number] | null;
|
|
63
|
+
readonly glassEnabled: boolean;
|
|
64
|
+
/** = semantics === 'immersive':信号通道令牌是否产出生效值 */
|
|
65
|
+
readonly signalEnabled: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare class SomaThemeAxisError extends Error {
|
|
68
|
+
constructor(message: string);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 轴解析:词元 → 确定轴位 + 数值参数。
|
|
72
|
+
*
|
|
73
|
+
* 纯函数,不读全局、不碰 DOM。全部轴省略时返回的参数即现状行为。
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveAxes(input: {
|
|
76
|
+
palette?: SomaPaletteAxes;
|
|
77
|
+
scene?: SomaSceneAxes;
|
|
78
|
+
}): {
|
|
79
|
+
axes: SomaResolvedAxes;
|
|
80
|
+
params: SomaAxisParams;
|
|
81
|
+
};
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
import { type SomaPaletteAxes, type SomaResolvedAxes, type SomaSceneAxes } from './theme-axes';
|
|
2
|
+
import { type SomaToneName } from './harmony';
|
|
3
|
+
export type { SomaPaletteAxes, SomaSceneAxes, SomaResolvedAxes } from './theme-axes';
|
|
4
|
+
export type { SomaToneName } from './harmony';
|
|
1
5
|
export interface SomaThemeInput {
|
|
2
6
|
/** 品牌主色(#rgb / #rrggbb) */
|
|
3
7
|
brand: string;
|
|
8
|
+
/**
|
|
9
|
+
* 色彩轴(REQ-007):色相编排 / 语义忠实度 / 彩度 / 反差 / 显式辅色。
|
|
10
|
+
* 整组可省——省略时派生结果与 REQ-007 之前字节级一致。
|
|
11
|
+
*/
|
|
12
|
+
palette?: SomaPaletteAxes;
|
|
13
|
+
/** 场景轴(REQ-007):背景场 / 场强 / 材质缺省档。整组可省 */
|
|
14
|
+
scene?: SomaSceneAxes;
|
|
4
15
|
/** 中性灰气质:warm 暖灰 / cool 冷灰 / neutral 跟随品牌色相(默认) */
|
|
5
16
|
mode?: 'warm' | 'cool' | 'neutral';
|
|
6
17
|
/** 应用暗色令牌(applyTheme 时生效;deriveTheme 恒产出亮暗两套) */
|
|
@@ -8,6 +19,14 @@ export interface SomaThemeInput {
|
|
|
8
19
|
/** 逐令牌精调通道:最后合并进 cssVars 与 darkCssVars,优先级最高(亮暗同时生效) */
|
|
9
20
|
overrides?: Record<string, string>;
|
|
10
21
|
}
|
|
22
|
+
export interface SomaThemeMeta {
|
|
23
|
+
/** 本次派生实际生效的轴位(含缺省回落)——诊断与测试的观测面 */
|
|
24
|
+
readonly axes: SomaResolvedAxes;
|
|
25
|
+
/** 语义分离闸是否触发(品牌撞进语义色地盘时为 true) */
|
|
26
|
+
readonly separationApplied: boolean;
|
|
27
|
+
/** 被推开的语气 */
|
|
28
|
+
readonly pushed: readonly SomaToneName[];
|
|
29
|
+
}
|
|
11
30
|
export interface SomaDerivedTheme {
|
|
12
31
|
/** 品牌色阶 50~950(11 档 hex) */
|
|
13
32
|
scale: Record<string, string>;
|
|
@@ -20,6 +39,8 @@ export interface SomaDerivedTheme {
|
|
|
20
39
|
primaryFg: number;
|
|
21
40
|
darkPrimaryFg: number;
|
|
22
41
|
};
|
|
42
|
+
/** 轴位与闸门观测面(REQ-007 新增;既有消费方零感知) */
|
|
43
|
+
meta: SomaThemeMeta;
|
|
23
44
|
}
|
|
24
45
|
interface Oklch {
|
|
25
46
|
l: number;
|
|
@@ -31,6 +52,14 @@ export declare function hexToOklch(hex: string): Oklch;
|
|
|
31
52
|
export declare function oklchToHex(color: Oklch): string;
|
|
32
53
|
export declare function contrastRatio(hexA: string, hexB: string): number;
|
|
33
54
|
export declare function deriveTheme(input: SomaThemeInput): SomaDerivedTheme;
|
|
55
|
+
/**
|
|
56
|
+
* 派生结果 → 根元素属性。
|
|
57
|
+
*
|
|
58
|
+
* 纯函数而不是写在 applyTheme 里:服务端渲染路径要用同一份逻辑预先戳属性,
|
|
59
|
+
* 否则 immersive 主题的页面会在补水前用色相编码、补水后切成信号编码,
|
|
60
|
+
* 闪一下。属性是编码通道的开关,必须和首屏 HTML 一起到达。
|
|
61
|
+
*/
|
|
62
|
+
export declare function themeRootAttributes(theme: SomaDerivedTheme): Record<string, string>;
|
|
34
63
|
/**
|
|
35
64
|
* 换肤期间挂在根节点上的过渡抑制类名(生产化强化 §6,作业单 P-4)。
|
|
36
65
|
*
|
|
@@ -46,4 +75,3 @@ export declare function deriveTheme(input: SomaThemeInput): SomaDerivedTheme;
|
|
|
46
75
|
export declare const THEME_SWITCHING_CLASS = "soma-theme-switching";
|
|
47
76
|
/** 把派生令牌注入 :root(运行时换肤/切暗色:重复调用即时生效) */
|
|
48
77
|
export declare function applyTheme(input: SomaThemeInput, root?: HTMLElement): SomaDerivedTheme;
|
|
49
|
-
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SomaAxisParams, SomaContrastTargets } from './theme-axes';
|
|
2
|
+
export interface Oklch {
|
|
3
|
+
l: number;
|
|
4
|
+
c: number;
|
|
5
|
+
h: number;
|
|
6
|
+
}
|
|
7
|
+
/** 求解需要的色彩原语由编排者注入——本模块不 import theme-engine,避免循环依赖 */
|
|
8
|
+
export interface ToneSolverDeps {
|
|
9
|
+
oklchToHex(c: Oklch): string;
|
|
10
|
+
hexToOklch(hex: string): Oklch;
|
|
11
|
+
contrastRatio(a: string, b: string): number;
|
|
12
|
+
bestFg(bg: string): string;
|
|
13
|
+
}
|
|
14
|
+
/** 与现状五处循环一致的上限:推 16 轮仍不达标就交出当前最优 */
|
|
15
|
+
export declare const MAX_SOLVE_ITER = 16;
|
|
16
|
+
/**
|
|
17
|
+
* 沿明度方向推色直到谓词满足。
|
|
18
|
+
*
|
|
19
|
+
* **幂等**:谓词一开始就满足时原值返回——这条性质让"S3 推过色相后回跑 S2"
|
|
20
|
+
* 成为无脑安全的操作(未被推动的语气原样穿过,不会因为多跑一次而漂移)。
|
|
21
|
+
*/
|
|
22
|
+
export declare function pushLightnessUntil(color: Oklch, satisfied: (candidate: Oklch) => boolean, direction: 'lighten' | 'darken', maxIter?: number): Oklch;
|
|
23
|
+
/**
|
|
24
|
+
* 现状五处循环的等价封装:不达 AA 就推明度,推的方向按当前明暗自适应。
|
|
25
|
+
*
|
|
26
|
+
* 保留"方向按 l > 0.55 判定"这个既有行为——它不是随手写的:
|
|
27
|
+
* 亮色推更亮、暗色推更暗,才不会把一个中亮度的色推穿到对面去。
|
|
28
|
+
*/
|
|
29
|
+
export declare function ensureContrast(bg: string, deps: ToneSolverDeps, minRatio?: number, maxIter?: number, forceDirection?: 'lighten' | 'darken'): {
|
|
30
|
+
bg: string;
|
|
31
|
+
fg: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* 解一个语气的实心底:命中 toneOnPage 目标。
|
|
35
|
+
*
|
|
36
|
+
* 前景(-fg)仍由既有 ④ 系代码解——那部分是实测校准过的 AA 保障,不在此重复。
|
|
37
|
+
*
|
|
38
|
+
* **裁决**:粉彩带约束与对比度目标冲突时**对比度赢**(AA 底线不随 contrast 档
|
|
39
|
+
* 移动,是《主题属性设计》§3 原则 4 的承诺)。带被突破时通过返回值旁路上报,
|
|
40
|
+
* 由编排者收进 meta,供观测——不报错,因为"带"是气质偏好不是硬约束。
|
|
41
|
+
*/
|
|
42
|
+
export declare function solveTone(seed: Oklch, pageHex: string, target: SomaContrastTargets, band: readonly [number, number] | null, deps: ToneSolverDeps): {
|
|
43
|
+
tone: Oklch;
|
|
44
|
+
bandBroken: boolean;
|
|
45
|
+
};
|
|
46
|
+
/** 彩度个性:把 chroma 轴的乘数应用到一个种子彩度上(下限护栏防止推成死灰) */
|
|
47
|
+
export declare function applyChroma(baseChroma: number, params: SomaAxisParams): number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -18,7 +18,9 @@ export { parseDataConfig, parseDataYaml, parseDataRef, normalizeDataPipeValue, S
|
|
|
18
18
|
export type { SomaDataRef } from './client/parser/data-config-parser';
|
|
19
19
|
export type { SomaDataConfig, SomaDataObjectConfig, SomaDataSourceConfig, SomaDataFieldConfig, SomaDataFieldRule, SomaDataFieldOption, SomaDataFieldType, SomaDataFieldPermission, SomaDataDicts, } from './shared/types/data-config.types';
|
|
20
20
|
export { deriveTheme, applyTheme, contrastRatio, THEME_SWITCHING_CLASS, } from './client/theme/theme-engine';
|
|
21
|
-
export type { SomaThemeInput, SomaDerivedTheme } from './client/theme/theme-engine';
|
|
21
|
+
export type { SomaThemeInput, SomaDerivedTheme, SomaThemeMeta } from './client/theme/theme-engine';
|
|
22
|
+
export { themeRootAttributes } from './client/theme/theme-engine';
|
|
23
|
+
export type { SomaPaletteAxes, SomaSceneAxes, SomaResolvedAxes, SomaHarmony, SomaSemantics, SomaChroma, SomaContrast, SomaField, SomaIntensity, SomaMaterial, } from './client/theme/theme-axes';
|
|
22
24
|
export { TYPOGRAPHY_BASE_CSS } from './client/typography/typography-base';
|
|
23
25
|
export { parseAdaptiveConfig, createAdaptiveVocabulary, SomaAdaptiveConfigError, } from './client/parser/adaptive-parser';
|
|
24
26
|
export { compileAdaptive, applyCompiledAdaptive, SOMA_ADAPTIVE_PROFILE_ATTR, } from './client/compiler/adaptive-compile';
|
|
@@ -67,6 +69,15 @@ export type { SomaHostRequestContext, SomaHostRequestKind, SomaRequestHook, } fr
|
|
|
67
69
|
export type { SomaDomainLoadContext, SomaDomainLoader, SomaDomainLoaderMap, SomaDomainLoaderModule, SomaDomainModule, SomaDomainModuleResolver, } from './client/host-bridge/soma-domain-loaders';
|
|
68
70
|
export { createSomaDomainLoaderKey, findSomaDomainLoader, loadSomaDomainModuleFromRegistry, } from './client/host-bridge/soma-domain-loaders';
|
|
69
71
|
export { createGeneratedPagePreview, createSomaPageLifecycle, renderPublishedPage, SomaPageLifecycle, type GeneratedPageDeclarations, type GeneratedPagePreviewOptions, type PrecompiledDeclarationAssets, type PreviewHandle, type PreviewObservabilityOptions, type MountedPageInfo, type PublishedPageHandle, type PublishedPageRecord, type RegisterDeclarationOptions, type RenderPublishedPageOptions, type SomaPageLifecycleOptions, } from './client/registry/index';
|
|
70
|
-
export { composeComponentPacks, generatePackCatalog, ComponentPackError, PACK_NAME_PATTERN, type ComposedComponentPacks, type ComposePacksOptions, type SomaComponentPack, type SomaComponentPackStyles, } from './client/component/component-pack';
|
|
72
|
+
export { composeComponentPacks, generatePackCatalog, ComponentPackError, PACK_NAME_PATTERN, type ComposedComponentPacks, type ComposePacksOptions, type SomaComponentPack, type SomaComponentPackStyles, type PackOverrideEvent, } from './client/component/component-pack';
|
|
71
73
|
export { verifyComponentPack, type VerifyPackOptions } from './client/component/verify-pack';
|
|
74
|
+
export { parseValueSegment, evaluateValueNode, isArithSegment, isPlainPath, describeNode, SomaValueLangError, type ValueNode, type PipedValue, type ValuePosition, type HasVarFn, type EvalOptions, } from './client/parser/value-lang';
|
|
75
|
+
export { loadSomaFile, SomaV2ParseError, PAGE_BLOCK_ID, type RawBlock, type SomaFileLoadInput, } from './build/v2/soma-file-loader';
|
|
76
|
+
export { buildHtmlAnchorIndex, type HtmlAnchorIndex, type HtmlAnchorInfo, } from './build/v2/html-index';
|
|
77
|
+
export { compilePageAssets } from './build/compiler/page-assets';
|
|
78
|
+
export { compileSomaV2, type CompiledSomaV2, type CompileSomaV2Input, } from './build/v2/block-compile';
|
|
79
|
+
export { parsePageBlock, type PageBlockAst, } from './client/parser/v2/page-parser';
|
|
80
|
+
export { parseUseBlock, type UseBlockAst, type DataObjectDecl, type FieldDecl, type ActionDecl, } from './client/parser/v2/use-parser';
|
|
81
|
+
export { buildBlockScope, resolvePath, resolveApiRef, expandPath, scopeHasVar, SomaScopeError, type BlockScope, } from './client/parser/v2/namespace';
|
|
82
|
+
export { checkOverrideCompat, type ContractCompatIssue, type ContractCompatIssueKind, } from './client/component/contract-compat';
|
|
72
83
|
export { attachPackStyles, ensurePackBaseStyles, resetPackStyleInjection, type PackStyleOptions, } from './client/component/pack-styles';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** `/pages/<registry-name>` 是发布声明的稳定浏览路径;更深层路径仍归普通 Host 页面。 */
|
|
2
|
+
export declare function registryPageNameFromPath(pagePath: string): string | null;
|
|
3
|
+
/** Registry 声明只在服务端编译,浏览器收到的仍是既有运行时资产。 */
|
|
4
|
+
export declare function loadPublishedRegistryPageAssets(pagePath: string): Promise<{
|
|
5
|
+
localeYaml: string;
|
|
6
|
+
appConfigYaml: string;
|
|
7
|
+
registryPage: {
|
|
8
|
+
name: string;
|
|
9
|
+
version: number;
|
|
10
|
+
};
|
|
11
|
+
dataYaml?: string | undefined;
|
|
12
|
+
base: string;
|
|
13
|
+
sourceType: "registry";
|
|
14
|
+
sourcePackage: null;
|
|
15
|
+
html: string;
|
|
16
|
+
ui: string;
|
|
17
|
+
event: string;
|
|
18
|
+
styleYaml: string;
|
|
19
|
+
} | null>;
|
|
@@ -8,10 +8,7 @@ export interface SomaServerPageAssets {
|
|
|
8
8
|
ui: string;
|
|
9
9
|
event: string;
|
|
10
10
|
styleYaml: string;
|
|
11
|
-
/**
|
|
12
|
-
* 数据对象层声明(*_data.yaml,五件套可选件)。
|
|
13
|
-
* 按约定发现 data/<page>_data.yaml(回退 ui/ 同目录);无文件时该字段缺省,零影响。
|
|
14
|
-
*/
|
|
11
|
+
/** 构建期从统一声明编译出的运行时数据对象资产。 */
|
|
15
12
|
dataYaml?: string;
|
|
16
13
|
localeYaml: string;
|
|
17
14
|
appConfigYaml: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SomaPageCompileResult {
|
|
2
|
+
ui: string;
|
|
3
|
+
event: string;
|
|
4
|
+
dataYaml?: string;
|
|
5
|
+
}
|
|
6
|
+
/** 外置块约定 `ui/{base}.blocks/*.yaml`,与页面声明同目录。 */
|
|
7
|
+
export declare function compileSomaPageAssets(uiRaw: string, html: string, uiDir: string, base: string, includes?: Readonly<Record<string, string>>): SomaPageCompileResult;
|
|
@@ -18,7 +18,9 @@ export { resolveHostRequestHook, type SomaHostRequestContext, type SomaHostReque
|
|
|
18
18
|
export { createSomaCspHeader, createSomaCspNonce, buildSomaCspDirectives, buildSomaCspHeaderValue, resolveSomaCspMode, resolveSomaCspOptionsFromEnv, somaCspHeaderName, SOMA_CSP_MODE_ENV, SOMA_CSP_CONNECT_SRC_ENV, SOMA_CSP_IMG_SRC_ENV, SOMA_CSP_FRAME_SRC_ENV, SOMA_CSP_REPORT_URI_ENV, SOMA_CSP_NONCE_HEADER, type SomaCspMode, type SomaCspOptions, type SomaCspHeader, } from './host/content-security-policy';
|
|
19
19
|
export { readSomaCspNonce, somaCspNonceMetadata, type SomaCspHeaderBag, } from './host/csp-nonce-metadata';
|
|
20
20
|
export { loadSomaServerPageAssets, SomaPageAssetError, type SomaServerPageAssets, type SomaPageAssetLoadProfile, } from './host/server-page-assets';
|
|
21
|
-
export { loadComponentPackage, loadComponentPackages, SomaComponentPackageError, } from '../build/component/package-loader';
|
|
21
|
+
export { loadComponentPackage, loadComponentPackages, scanComponentPackages, SomaComponentPackageError, type LoadPackagesOptions, type PackScanWarning, } from '../build/component/package-loader';
|
|
22
|
+
export { loadComponentPackFromDir, type LoadPackFromDirOptions, } from '../build/component/pack-from-dir';
|
|
23
|
+
export { loadExternalBlocks, blocksDirOf, } from '../build/v2/block-loader';
|
|
22
24
|
export { setSomaDb, getSomaDb, resetSomaDb, createSomaDbSingleton, registerSomaDbProvider, disconnectSomaDb, withSomaDb, type ISomaDbProvider, } from './infra/db/soma-db';
|
|
23
25
|
export { SomaQuery } from './infra/db/query/SomaQuery';
|
|
24
26
|
export type { SomaBaseMapper } from './infra/db/mapper/SomaBaseMapper';
|
|
@@ -8,7 +8,7 @@ import type { PageRegistryDeclaration } from './page-registry-store';
|
|
|
8
8
|
* 失败方向必须是"不用缓存",不是"照用"。
|
|
9
9
|
*/
|
|
10
10
|
export declare const DECLARATION_COMPILER_VERSION: string;
|
|
11
|
-
/**
|
|
11
|
+
/** 落库的完整运行时产物。 */
|
|
12
12
|
export interface CompiledDeclaration {
|
|
13
13
|
compilerVersion: string;
|
|
14
14
|
uiConfig?: unknown;
|
|
@@ -19,8 +19,8 @@ export interface CompiledDeclaration {
|
|
|
19
19
|
dataConfig?: unknown;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
22
|
+
* 把统一声明一次编译成运行时可直接消费的完整配置对象。
|
|
23
|
+
* 编译失败返回 null,不产生可被误用的半成品。
|
|
24
24
|
*/
|
|
25
25
|
export declare function precompileDeclaration(declaration: PageRegistryDeclaration): CompiledDeclaration | null;
|
|
26
26
|
/**
|
|
@@ -17,7 +17,7 @@ export declare const PAGE_APP_PATTERN: RegExp;
|
|
|
17
17
|
* notes 塞满一样会撑爆响应。
|
|
18
18
|
*
|
|
19
19
|
* 128KiB 这个数的依据(实测,2026-08-12):
|
|
20
|
-
* -
|
|
20
|
+
* - 历史基线中**最大的真实 Host 声明**是 gallery 页(html 13,826 + ui 4,407 + event 1,805)
|
|
21
21
|
* = 20,038 字节。128KiB / 20,038 ≈ 6.5×,即人手写得最复杂的整站页面还能再翻 6.5 倍。
|
|
22
22
|
* - 声明仓库里 119 份 AI 生成版本的实测分布:中位 1,777 / p90 2,305 / 最大 2,995 字节,
|
|
23
23
|
* 离上限有 43 倍余量——正常生成永远撞不到这条线。
|
|
@@ -91,9 +91,9 @@ export interface PageVersionRecord {
|
|
|
91
91
|
operator?: string;
|
|
92
92
|
/**
|
|
93
93
|
* 发布期预编译产物(P-a,可选):把 uiYaml/eventYaml 等的解析结果落库,
|
|
94
|
-
|
|
94
|
+
* 取页时客户端直接消费;浏览器不解析源声明。
|
|
95
95
|
* **它是缓存不是真理**——带 compilerVersion,消费端版本对不上就整份丢弃、
|
|
96
|
-
*
|
|
96
|
+
* 由服务端从统一源声明重新编译(见 DeclarationPrecompiler.isCompiledUsable)。
|
|
97
97
|
*/
|
|
98
98
|
compiled?: CompiledDeclaration;
|
|
99
99
|
}
|
|
@@ -245,11 +245,11 @@ export declare function assertPageName(name: unknown): string;
|
|
|
245
245
|
export declare function assertVersionNumber(version: unknown): asserts version is number;
|
|
246
246
|
/** publish 第三参归一化:裸 status 字符串(旧写法)或选项对象,逐字段校验 */
|
|
247
247
|
export declare function normalizePublishOptions(options: PageRegistryStatus | PageRegistryPublishOptions): PageRegistryPublishOptions;
|
|
248
|
-
/** 声明归一化:
|
|
248
|
+
/** 声明归一化:HTML + 统一 SOMA DSL 必填;页面侧车字段只允许缺省或空串。 */
|
|
249
249
|
export declare function normalizeDeclaration(declaration: unknown): PageRegistryDeclaration;
|
|
250
250
|
/** 声明总字节数:UTF-8 计,涵盖 declaration 的全部字符串字段 */
|
|
251
251
|
export declare function declarationByteSize(declaration: PageRegistryDeclaration): number;
|
|
252
|
-
/** 存量 JSON
|
|
252
|
+
/** 存量 JSON 记录归一化:只补元数据;旧页面语法必须离线迁移,不在读取时自动转换。 */
|
|
253
253
|
export declare function normalizeStoredRecord(record: Record<string, unknown>): PageVersionRecord;
|
|
254
254
|
/** 对外返回深拷贝,避免调用方改动污染内存缓存 */
|
|
255
255
|
export declare function cloneRecord(record: PageVersionRecord): PageVersionRecord;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SomaDataConfig } from '../../../shared/types/data-config.types';
|
|
1
2
|
/** 已注册路径的来源;测试与特殊宿主可替换(默认读共享 API 注册表) */
|
|
2
3
|
export type RegisteredPathsResolver = () => ReadonlySet<string>;
|
|
3
4
|
/** 替换判据来源(测试用;传 null 复位为共享注册表) */
|
|
@@ -5,12 +6,11 @@ export declare function setRegisteredPathsResolver(next: RegisteredPathsResolver
|
|
|
5
6
|
/** 取数路径归一化:剥掉查询串与 hash,只留路径本体 */
|
|
6
7
|
export declare function normalizeApiPath(raw: string): string;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
* dataYaml 为空或解析不出对象时返回空数组——没有取数就没有可校验的东西。
|
|
9
|
+
* 收集统一声明编译产物里引用到的全部接口路径(已归一化,去重、有序)。
|
|
10
10
|
*/
|
|
11
|
-
export declare function collectDeclaredApiPaths(
|
|
11
|
+
export declare function collectDeclaredApiPaths(config: SomaDataConfig | undefined): string[];
|
|
12
12
|
/**
|
|
13
13
|
* 交叉校验,返回中文问题清单(空数组 = 通过)。
|
|
14
14
|
* 与安全扫描同款约定:命中即拒,清单点名到具体路径与数据对象,便于自修复。
|
|
15
15
|
*/
|
|
16
|
-
export declare function crossCheckDeclaredApis(
|
|
16
|
+
export declare function crossCheckDeclaredApis(config: SomaDataConfig | undefined): string[];
|
|
@@ -65,4 +65,14 @@ export interface SomaComponentContract {
|
|
|
65
65
|
emits?: Record<string, SomaContractEmit>;
|
|
66
66
|
slots?: Record<string, SomaContractSlot>;
|
|
67
67
|
ai?: SomaContractAiSection;
|
|
68
|
+
/**
|
|
69
|
+
* 声明式覆盖:本组件有意替换该包里的同名组件(值为被覆盖组件的来源包名,如 'soma-ui')。
|
|
70
|
+
*
|
|
71
|
+
* 为什么写在契约上而不是宿主 bootstrap 里:覆盖意图与组件同处、随组件评审、
|
|
72
|
+
* 宿主零维护。合成时 `composeComponentPacks` 收集本字段构建覆盖表,并强制过
|
|
73
|
+
* 契约兼容闸门(props 超集 + emit 全保留),保证"优化存量组件、页面零改动"。
|
|
74
|
+
*
|
|
75
|
+
* 未声明的跨包撞名一律抛错——写出来的覆盖是设计决定,猜出来的覆盖是事故。
|
|
76
|
+
*/
|
|
77
|
+
overrides?: string;
|
|
68
78
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
"displayName": "SOMA",
|
|
6
6
|
|
|
7
|
-
"description": "SOMA Language Server —
|
|
7
|
+
"description": "SOMA Language Server — HTML 与单一 SOMA DSL 声明的诊断、补全与导航",
|
|
8
8
|
|
|
9
9
|
"version": "1.1.0",
|
|
10
10
|
|
|
@@ -32,18 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
"configuration": "./language-configuration.json"
|
|
34
34
|
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
"id": "soma-event-yaml",
|
|
40
|
-
|
|
41
|
-
"aliases": ["SOMA Event YAML"],
|
|
42
|
-
|
|
43
|
-
"extensions": ["_event.yaml"],
|
|
44
|
-
|
|
45
|
-
"configuration": "./language-configuration.json"
|
|
46
|
-
|
|
47
35
|
}
|
|
48
36
|
|
|
49
37
|
],
|
|
@@ -58,16 +46,6 @@
|
|
|
58
46
|
|
|
59
47
|
"path": "./syntaxes/soma-ui-yaml.tmLanguage.json"
|
|
60
48
|
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
"language": "soma-event-yaml",
|
|
66
|
-
|
|
67
|
-
"scopeName": "source.soma-event-yaml",
|
|
68
|
-
|
|
69
|
-
"path": "./syntaxes/soma-event-yaml.tmLanguage.json"
|
|
70
|
-
|
|
71
49
|
}
|
|
72
50
|
|
|
73
51
|
],
|
|
@@ -95,4 +73,3 @@
|
|
|
95
73
|
}
|
|
96
74
|
|
|
97
75
|
}
|
|
98
|
-
|
package/global.d.ts
CHANGED
|
@@ -42,17 +42,7 @@ declare module '@soma-host/bootstrap/soma-domain-loaders' {
|
|
|
42
42
|
export default defaultExport;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
const content: Record<string, unknown>;
|
|
47
|
-
export default content;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
declare module '@soma-host/config/app.config.yaml' {
|
|
51
|
-
const content: Record<string, unknown>;
|
|
52
|
-
export default content;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Host dynamic asset paths (domain/ui/event); runtime resolves via webpack alias */
|
|
45
|
+
/** Host bootstrap/domain dynamic paths; runtime resolves via webpack alias. */
|
|
56
46
|
declare module '@soma-host/*' {
|
|
57
47
|
const content: unknown;
|
|
58
48
|
export default content;
|