soma-core 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +7 -6
  2. package/app/SomaPageClient.tsx +2 -72
  3. package/bin/soma-lsp.cjs +1 -4
  4. package/core/build/compiler/full-manifest-builder.ts +17 -26
  5. package/core/build/compiler/html-include-expander.ts +56 -0
  6. package/core/build/compiler/page-assets.ts +26 -0
  7. package/core/build/compiler/page-declaration-compiler.ts +85 -0
  8. package/core/build/compiler/rollup-plugin-soma.ts +4 -19
  9. package/core/build/compiler/route-builder.ts +0 -2
  10. package/core/build/compiler/rspack-plugin-soma.js +1 -10
  11. package/core/build/compiler/soma-manifest-webpack-plugin.js +54 -13
  12. package/core/build/compiler/soma-precompile.js +74 -0
  13. package/core/build/compiler/soma-precompile.ts +13 -0
  14. package/core/build/compiler/soma-rspack-yaml-loader.js +5 -11
  15. package/core/build/compiler/soma-webpack-loader.js +6 -21
  16. package/core/build/compiler/vite-plugin-soma.ts +9 -31
  17. package/core/build/component/pack-from-dir.ts +58 -0
  18. package/core/build/component/package-loader.ts +158 -12
  19. package/core/build/eject/plan-eject.ts +15 -21
  20. package/core/build/lsp/cross-file-diagnostics.cjs +82 -113
  21. package/core/build/lsp/extra-completion.cjs +14 -8
  22. package/core/build/lsp/lsp-navigation.cjs +50 -43
  23. package/core/build/lsp/soma-declaration.cjs +85 -0
  24. package/core/build/lsp/ui-yaml-completion.cjs +98 -104
  25. package/core/build/v2/block-compile.ts +200 -0
  26. package/core/build/v2/block-loader.ts +33 -0
  27. package/core/build/v2/html-index.ts +120 -0
  28. package/core/build/v2/migrate-v1.ts +370 -0
  29. package/core/build/v2/soma-file-loader.ts +216 -0
  30. package/core/client/component/ai-catalog.ts +15 -0
  31. package/core/client/component/component-pack.ts +205 -31
  32. package/core/client/component/contract-compat.ts +132 -0
  33. package/core/client/component/example-v2.ts +132 -0
  34. package/core/client/engine/dom-renderer.ts +14 -8
  35. package/core/client/engine/reactive-proxy.ts +8 -7
  36. package/core/client/engine/soma-bootstrap.ts +23 -5
  37. package/core/client/parser/v2/namespace.ts +182 -0
  38. package/core/client/parser/v2/page-parser.ts +359 -0
  39. package/core/client/parser/v2/use-parser.ts +412 -0
  40. package/core/client/parser/value-lang.ts +340 -0
  41. package/core/client/pipes/pipe-registry.ts +1 -1
  42. package/core/client/registry/declaration-renderer.ts +17 -15
  43. package/core/client/theme/harmony.ts +307 -0
  44. package/core/client/theme/scene-tokens.ts +134 -0
  45. package/core/client/theme/theme-axes.ts +228 -0
  46. package/core/client/theme/theme-engine.ts +333 -73
  47. package/core/client/theme/tone-solver.ts +118 -0
  48. package/core/index.ts +74 -2
  49. package/core/server/host/server-page-assets.ts +33 -16
  50. package/core/server/host/soma-page-compile.ts +33 -0
  51. package/core/server/index.ts +15 -0
  52. package/core/server/registry/declaration-precompiler.ts +24 -54
  53. package/core/server/registry/page-registry-store.ts +38 -9
  54. package/core/server/registry/services/pages/Get.ts +19 -9
  55. package/core/server/registry/validation/compile-gate.ts +14 -31
  56. package/core/server/registry/validation/cross-check.ts +7 -17
  57. package/core/server/registry/validation/declaration-safety-scan.ts +2 -2
  58. package/core/shared/types/component-contract.types.ts +10 -0
  59. package/dist/core/index.cjs +2138 -154
  60. package/dist/types/build/compiler/full-manifest-builder.d.ts +4 -4
  61. package/dist/types/build/compiler/html-include-expander.d.ts +19 -0
  62. package/dist/types/build/compiler/page-assets.d.ts +3 -0
  63. package/dist/types/build/compiler/page-declaration-compiler.d.ts +33 -0
  64. package/dist/types/build/compiler/rollup-plugin-soma.d.ts +0 -3
  65. package/dist/types/build/compiler/route-builder.d.ts +0 -1
  66. package/dist/types/build/compiler/soma-precompile.d.ts +8 -0
  67. package/dist/types/build/compiler/vite-plugin-soma.d.ts +2 -10
  68. package/dist/types/build/component/pack-from-dir.d.ts +17 -0
  69. package/dist/types/build/component/package-loader.d.ts +33 -2
  70. package/dist/types/build/v2/block-compile.d.ts +28 -0
  71. package/dist/types/build/v2/block-loader.d.ts +9 -0
  72. package/dist/types/build/v2/html-index.d.ts +37 -0
  73. package/dist/types/build/v2/migrate-v1.d.ts +32 -0
  74. package/dist/types/build/v2/soma-file-loader.d.ts +45 -0
  75. package/dist/types/client/component/component-pack.d.ts +23 -3
  76. package/dist/types/client/component/contract-compat.d.ts +16 -0
  77. package/dist/types/client/component/example-v2.d.ts +9 -0
  78. package/dist/types/client/engine/dom-renderer.d.ts +2 -0
  79. package/dist/types/client/engine/soma-bootstrap.d.ts +3 -1
  80. package/dist/types/client/parser/v2/namespace.d.ts +52 -0
  81. package/dist/types/client/parser/v2/page-parser.d.ts +21 -0
  82. package/dist/types/client/parser/v2/use-parser.d.ts +72 -0
  83. package/dist/types/client/parser/value-lang.d.ts +63 -0
  84. package/dist/types/client/registry/declaration-renderer.d.ts +1 -2
  85. package/dist/types/client/theme/harmony.d.ts +77 -0
  86. package/dist/types/client/theme/scene-tokens.d.ts +25 -0
  87. package/dist/types/client/theme/theme-axes.d.ts +81 -0
  88. package/dist/types/client/theme/theme-engine.d.ts +29 -1
  89. package/dist/types/client/theme/tone-solver.d.ts +47 -0
  90. package/dist/types/index.d.ts +13 -2
  91. package/dist/types/server/host/server-page-assets.d.ts +1 -4
  92. package/dist/types/server/host/soma-page-compile.d.ts +7 -0
  93. package/dist/types/server/index.d.ts +3 -1
  94. package/dist/types/server/registry/declaration-precompiler.d.ts +3 -3
  95. package/dist/types/server/registry/page-registry-store.d.ts +4 -4
  96. package/dist/types/server/registry/validation/compile-gate.d.ts +2 -0
  97. package/dist/types/server/registry/validation/cross-check.d.ts +4 -4
  98. package/dist/types/shared/types/component-contract.types.d.ts +10 -0
  99. package/editor/vscode/package.json +1 -24
  100. package/global.d.ts +1 -11
  101. package/next.config.js +32 -50
  102. package/package.json +3 -2
  103. package/tailwind.config.ts +0 -1
  104. package/core/build/lsp/event-yaml-completion.cjs +0 -106
  105. package/core/client/host-bridge/empty-host/data/README.md +0 -17
  106. package/editor/vscode/syntaxes/soma-event-yaml.tmLanguage.json +0 -30
@@ -0,0 +1,340 @@
1
+ // 值语言(DSL v2 · REQ-005 F4):全体系唯一的一条值规则。
2
+ //
3
+ // 值 := 段 ( "|" 管道调用 )*
4
+ // 段 := 路径 | 数字 | 算术表达式(路径 · 数字 · + - * / · 括号 · 一元负号)
5
+ //
6
+ // 为什么算术长成数学的样子而不是 `mul()` 管道:`o.price * o.qty` 谁都看得懂
7
+ // (Excel 用户零学习),而且标量管道 add/sub/mul/div 四个概念因此直接消失——
8
+ // 功能更强的同时概念更少。代价是引入一个**永久封闭**的微文法。
9
+ //
10
+ // 封闭在哪:词元只有六种(路径 / 数字 / + - * / / 括号)。
11
+ // **永不放行**比较、布尔、三元、字符串拼接——拼接有 tpl,判断归 Domain,
12
+ // 分支归 match 与组件多态。这不是"暂时不做",是地基:
13
+ // 词汇封闭同时是 AI 可稳定生成与可完全预编译两条命脉的共同前提
14
+ // (见 REQ-005 需求说明第零条论证)。解析器遇到 `> < ? :` 直接报错并指路。
15
+ //
16
+ // 产物是**可 JSON 序列化的指令节点**,不是闭包:清单要进预编译产物与注册中心
17
+ // (既有约束),闭包在装配期才结。运行时因此零解析——第零条公理的兑现点。
18
+
19
+ import type { SomaPipeCall } from '../../shared/types/scope-manifest.types';
20
+
21
+ export class SomaValueLangError extends Error {
22
+ constructor(message: string, readonly raw: string) {
23
+ super(`[soma-core][引擎] ${message}(值: "${raw}")`);
24
+ this.name = 'SomaValueLangError';
25
+ }
26
+ }
27
+
28
+ /** 值段的指令节点:JSON 可序列化,进清单 */
29
+ export type ValueNode =
30
+ | { kind: 'path'; path: string }
31
+ | { kind: 'lit'; value: string | number | boolean }
32
+ | { kind: 'neg'; operand: ValueNode }
33
+ | { kind: 'arith'; op: '+' | '-' | '*' | '/'; left: ValueNode; right: ValueNode };
34
+
35
+ export interface PipedValue {
36
+ seg: ValueNode;
37
+ pipes: SomaPipeCall[];
38
+ /** 值内引用的全部绑定路径(段内 + 管道实参),供 watchPaths 注册 */
39
+ paths: string[];
40
+ }
41
+
42
+ /**
43
+ * 值位置。算术与计算管道是**展示位专有**——算出来的值不驱动行为,
44
+ * 业务规则(定价、优惠、判断)留在 Domain 才可测试。
45
+ */
46
+ export type ValuePosition = 'display' | 'condition' | 'key';
47
+
48
+ /** 判定一个变量首段是否在当前作用域(与既有 hasVar 同款契约) */
49
+ export type HasVarFn = (segment: string) => boolean;
50
+
51
+ /** 段内是否出现算术运算符(路径词法不含运算符,故零歧义) */
52
+ const ARITH_HINT = /[+\-*/()]/;
53
+ /** 明确拒绝的词元:比较 / 布尔 / 三元 / 字符串拼接意图 */
54
+ const FORBIDDEN = /(>=|<=|==|!=|&&|\|\||[<>?])/;
55
+ /** 合法路径词法:首段已在作用域内时,其余部分必须严格符合此形状 */
56
+ const PATH_SHAPE = /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z0-9_]+)*$/;
57
+
58
+ // ── 词法 ────────────────────────────────────────────────────────────────────
59
+
60
+ type Token =
61
+ | { t: 'num'; v: number }
62
+ | { t: 'id'; v: string }
63
+ | { t: 'op'; v: '+' | '-' | '*' | '/' }
64
+ | { t: '(' }
65
+ | { t: ')' };
66
+
67
+ function tokenize(raw: string, source: string): Token[] {
68
+ const tokens: Token[] = [];
69
+ let i = 0;
70
+ while (i < raw.length) {
71
+ const ch = raw[i];
72
+ if (ch === ' ' || ch === '\t') { i += 1; continue; }
73
+ if (ch === '(' || ch === ')') { tokens.push({ t: ch } as Token); i += 1; continue; }
74
+ if (ch === '+' || ch === '-' || ch === '*' || ch === '/') {
75
+ tokens.push({ t: 'op', v: ch }); i += 1; continue;
76
+ }
77
+ if (/[0-9]/.test(ch)) {
78
+ let j = i;
79
+ while (j < raw.length && /[0-9.]/.test(raw[j])) j += 1;
80
+ const text = raw.slice(i, j);
81
+ const value = Number(text);
82
+ if (!Number.isFinite(value)) {
83
+ throw new SomaValueLangError(`数字字面量非法: "${text}"`, source);
84
+ }
85
+ tokens.push({ t: 'num', v: value }); i = j; continue;
86
+ }
87
+ if (/[A-Za-z_]/.test(ch)) {
88
+ let j = i;
89
+ while (j < raw.length && /[A-Za-z0-9_.]/.test(raw[j])) j += 1;
90
+ tokens.push({ t: 'id', v: raw.slice(i, j) }); i = j; continue;
91
+ }
92
+ throw new SomaValueLangError(
93
+ `无法识别的字符 "${ch}"——算术只支持路径、数字、+ - * / 与括号`,
94
+ source,
95
+ );
96
+ }
97
+ return tokens;
98
+ }
99
+
100
+ // ── 递归下降(* / 高于 + -,括号最大,一元负号) ──────────────────────────
101
+
102
+ class Parser {
103
+ private pos = 0;
104
+
105
+ constructor(
106
+ private readonly tokens: Token[],
107
+ private readonly source: string,
108
+ private readonly hasVar: HasVarFn,
109
+ private readonly paths: string[],
110
+ ) {}
111
+
112
+ parse(): ValueNode {
113
+ const node = this.expression();
114
+ if (this.pos < this.tokens.length) {
115
+ throw new SomaValueLangError('算术表达式有多余词元(括号是否配对?)', this.source);
116
+ }
117
+ return node;
118
+ }
119
+
120
+ /** 表达式 := 项 { ("+"|"-") 项 } */
121
+ private expression(): ValueNode {
122
+ let left = this.term();
123
+ for (;;) {
124
+ const token = this.tokens[this.pos];
125
+ if (token?.t === 'op' && (token.v === '+' || token.v === '-')) {
126
+ this.pos += 1;
127
+ left = { kind: 'arith', op: token.v, left, right: this.term() };
128
+ continue;
129
+ }
130
+ return left;
131
+ }
132
+ }
133
+
134
+ /** 项 := 因子 { ("*"|"/") 因子 } */
135
+ private term(): ValueNode {
136
+ let left = this.factor();
137
+ for (;;) {
138
+ const token = this.tokens[this.pos];
139
+ if (token?.t === 'op' && (token.v === '*' || token.v === '/')) {
140
+ this.pos += 1;
141
+ left = { kind: 'arith', op: token.v, left, right: this.factor() };
142
+ continue;
143
+ }
144
+ return left;
145
+ }
146
+ }
147
+
148
+ /** 因子 := 路径 | 数字 | "(" 表达式 ")" | "-" 因子 */
149
+ private factor(): ValueNode {
150
+ const token = this.tokens[this.pos];
151
+ if (!token) {
152
+ throw new SomaValueLangError('算术表达式不完整(缺少运算数)', this.source);
153
+ }
154
+ if (token.t === 'op' && token.v === '-') {
155
+ this.pos += 1;
156
+ return { kind: 'neg', operand: this.factor() };
157
+ }
158
+ if (token.t === 'num') {
159
+ this.pos += 1;
160
+ return { kind: 'lit', value: token.v };
161
+ }
162
+ if (token.t === 'id') {
163
+ this.pos += 1;
164
+ return this.pathNode(token.v);
165
+ }
166
+ if (token.t === '(') {
167
+ this.pos += 1;
168
+ const inner = this.expression();
169
+ if (this.tokens[this.pos]?.t !== ')') {
170
+ throw new SomaValueLangError('括号未闭合', this.source);
171
+ }
172
+ this.pos += 1;
173
+ return inner;
174
+ }
175
+ throw new SomaValueLangError('算术表达式中出现意外词元', this.source);
176
+ }
177
+
178
+ private pathNode(text: string): ValueNode {
179
+ if (text === 'true' || text === 'false') {
180
+ return { kind: 'lit', value: text === 'true' };
181
+ }
182
+ const head = text.split('.')[0];
183
+ if (!this.hasVar(head)) {
184
+ throw new SomaValueLangError(
185
+ `路径 "${text}" 的首段 "${head}" 不在当前作用域——算术只接受绑定路径与数字`,
186
+ this.source,
187
+ );
188
+ }
189
+ this.paths.push(text);
190
+ return { kind: 'path', path: text };
191
+ }
192
+ }
193
+
194
+ // ── 对外入口 ────────────────────────────────────────────────────────────────
195
+
196
+ /** 段内是否需要走算术解析(出现运算符或括号即是;路径词法不含它们) */
197
+ export function isArithSegment(segment: string): boolean {
198
+ return ARITH_HINT.test(segment);
199
+ }
200
+
201
+ /**
202
+ * 解析一个值段(不含管道)。
203
+ *
204
+ * 纯路径与纯字面量走快路径;含运算符时进算术文法。
205
+ */
206
+ export function parseValueSegment(
207
+ segment: string,
208
+ hasVar: HasVarFn,
209
+ position: ValuePosition = 'display',
210
+ source = segment,
211
+ ): { node: ValueNode; paths: string[] } {
212
+ const raw = segment.trim();
213
+ if (!raw) {
214
+ throw new SomaValueLangError('值段为空', source);
215
+ }
216
+
217
+ const forbidden = raw.match(FORBIDDEN);
218
+ if (forbidden) {
219
+ throw new SomaValueLangError(
220
+ `不支持的运算符 "${forbidden[0]}"——比较与布尔运算不进 DSL,判断写进 Domain`
221
+ + '(显隐用 when + ! 前缀,多分支用 match 管道或组件多态)',
222
+ source,
223
+ );
224
+ }
225
+
226
+ if (!isArithSegment(raw)) {
227
+ // 纯路径 / 纯字面量
228
+ if (/^-?\d+(\.\d+)?$/.test(raw)) {
229
+ return { node: { kind: 'lit', value: Number(raw) }, paths: [] };
230
+ }
231
+ if (raw === 'true' || raw === 'false') {
232
+ return { node: { kind: 'lit', value: raw === 'true' }, paths: [] };
233
+ }
234
+ const head = raw.split(/[.\s]/)[0];
235
+ if (hasVar(head)) {
236
+ // 首段在作用域内 ⇒ 这是绑定路径的意图,其余部分必须严格合法。
237
+ // 不校验的话 `item.price # 2` 会被当成一个名字很怪的路径静默通过,
238
+ // 运行时读不到值只渲染空白——典型的"不报错但坏掉"。
239
+ if (!PATH_SHAPE.test(raw)) {
240
+ throw new SomaValueLangError(
241
+ `路径 "${raw}" 含非法字符——路径只允许字母、数字、下划线与点`
242
+ + '(若本意是字面量文案,请换一个不以作用域变量开头的写法或加引号)',
243
+ source,
244
+ );
245
+ }
246
+ return { node: { kind: 'path', path: raw }, paths: [raw] };
247
+ }
248
+ return { node: { kind: 'lit', value: raw }, paths: [] };
249
+ }
250
+
251
+ if (position !== 'display') {
252
+ throw new SomaValueLangError(
253
+ `算术只允许出现在展示值位,当前位置是 ${position}`
254
+ + '——算出来的值不驱动行为,业务判断留在 Domain',
255
+ source,
256
+ );
257
+ }
258
+
259
+ const paths: string[] = [];
260
+ const node = new Parser(tokenize(raw, source), source, hasVar, paths).parse();
261
+ return { node, paths };
262
+ }
263
+
264
+ /** 值段内是否只是一条裸路径(供上层决定是否走既有轻路径) */
265
+ export function isPlainPath(node: ValueNode): node is { kind: 'path'; path: string } {
266
+ return node.kind === 'path';
267
+ }
268
+
269
+ // ── 求值(装配期结闭包时使用;纯函数,无副作用) ────────────────────────────
270
+
271
+ export interface EvalOptions {
272
+ /** dev 下算术遇非数值/除零直接抛错(含表达式原文);prod 返回 null 交由上层占位 */
273
+ dev?: boolean;
274
+ }
275
+
276
+ /**
277
+ * 对指令节点求值。
278
+ *
279
+ * 除零与非数值:dev 抛错(点名原文,避免"页面上一个 NaN 查半天"),
280
+ * prod 返回 null——上层渲染占位符,与 role_by 未命中的既有语义一致。
281
+ */
282
+ export function evaluateValueNode(
283
+ node: ValueNode,
284
+ read: (path: string) => unknown,
285
+ options: EvalOptions = {},
286
+ ): unknown {
287
+ switch (node.kind) {
288
+ case 'lit':
289
+ return node.value;
290
+ case 'path':
291
+ return read(node.path);
292
+ case 'neg': {
293
+ const operand = toNumber(evaluateValueNode(node.operand, read, options), node, options);
294
+ return operand === null ? null : -operand;
295
+ }
296
+ case 'arith': {
297
+ const left = toNumber(evaluateValueNode(node.left, read, options), node, options);
298
+ const right = toNumber(evaluateValueNode(node.right, read, options), node, options);
299
+ if (left === null || right === null) return null;
300
+ if (node.op === '/' && right === 0) {
301
+ if (options.dev) {
302
+ throw new SomaValueLangError('除数为 0', describeNode(node));
303
+ }
304
+ return null;
305
+ }
306
+ switch (node.op) {
307
+ case '+': return left + right;
308
+ case '-': return left - right;
309
+ case '*': return left * right;
310
+ case '/': return left / right;
311
+ }
312
+ }
313
+ }
314
+ return null;
315
+ }
316
+
317
+ function toNumber(value: unknown, node: ValueNode, options: EvalOptions): number | null {
318
+ if (typeof value === 'number' && Number.isFinite(value)) return value;
319
+ if (typeof value === 'string' && value.trim() !== '') {
320
+ const parsed = Number(value);
321
+ if (Number.isFinite(parsed)) return parsed;
322
+ }
323
+ if (options.dev) {
324
+ throw new SomaValueLangError(
325
+ `算术运算数不是数值: ${JSON.stringify(value)}`,
326
+ describeNode(node),
327
+ );
328
+ }
329
+ return null;
330
+ }
331
+
332
+ /** 把指令节点还原成近似原文,仅用于报错可读性 */
333
+ export function describeNode(node: ValueNode): string {
334
+ switch (node.kind) {
335
+ case 'lit': return String(node.value);
336
+ case 'path': return node.path;
337
+ case 'neg': return `-${describeNode(node.operand)}`;
338
+ case 'arith': return `${describeNode(node.left)} ${node.op} ${describeNode(node.right)}`;
339
+ }
340
+ }
@@ -1,6 +1,6 @@
1
1
  // 格式化管道(组件体系 U4):绑定值的展示格式化,让 Domain 回归存原始值。
2
2
  //
3
- // 语法(soma-core/doc/soma 组件dsl扩展.md 第 3 章):
3
+ // 语法(soma-core/doc/soma DSL 语法全书.md(格式化管道章)):
4
4
  // item_price: item.price | money
5
5
  // tip: page._locale.cart_total_count | tpl(count: page.totalCount)
6
6
  // created: order.createdAt | date(YYYY-MM-DD HH:mm)
@@ -1,4 +1,4 @@
1
- // 声明渲染通道:拿着内存里的四件套声明直接上屏(空 Domain + initProps 演示数据)。
1
+ // 声明渲染通道:拿着统一声明与服务端编译产物直接上屏(空 Domain + initProps 演示数据)。
2
2
  //
3
3
  // REQ-002 自 soma-ai 收编归位:「soma-ai 管生成,soma-core 管使用」——
4
4
  // 把声明变成运行页面是引擎能力,与声明从哪来(AI 生成 / 应用构造 / 注册中心拉取)无关。
@@ -14,8 +14,7 @@ import type { SomaErrorEvent, SomaPageIdentity } from '../observability/error-re
14
14
  import { SomaPageRootBase } from '../base/SomaPageRootBase';
15
15
 
16
16
  /**
17
- * 注册中心落库的预编译产物(P-a)。渲染时若版本对得上就直接喂给引擎,省掉一次 YAML 解析;
18
- * 对不上则整份忽略——**缓存不是真理**,拿旧编译器的产物渲染新语义比慢一点危险得多。
17
+ * 服务端编译产物。浏览器不编译 SOMA DSL 源声明,缺失或不完整时明确拒绝。
19
18
  */
20
19
  export interface PrecompiledDeclarationAssets {
21
20
  uiConfig?: unknown;
@@ -129,21 +128,24 @@ export function createGeneratedPagePreview(
129
128
  const usable = compiled !== undefined
130
129
  && compiled.uiConfig !== undefined
131
130
  && compiled.eventConfig !== undefined;
131
+ if (!usable) {
132
+ throw new Error(
133
+ '[soma-core][声明渲染] 缺少完整的服务端编译产物。'
134
+ + '浏览器不解析 SOMA DSL 源声明;请由生成/注册服务返回 compiled 资产。',
135
+ );
136
+ }
132
137
  await next.mount(container, {
133
138
  html: decl.html,
134
- uiYaml: decl.uiYaml,
135
- eventYaml: decl.eventYaml ?? '',
136
- styleYaml: decl.styleYaml,
139
+ uiYaml: '',
140
+ eventYaml: '',
141
+ styleYaml: '',
137
142
  DomainClass: getPreviewPageRoot(),
138
- ...(usable
139
- ? {
140
- uiConfig: compiled.uiConfig as never,
141
- eventConfig: compiled.eventConfig as never,
142
- triggerConfig: compiled.triggerConfig as never,
143
- timerConfig: compiled.timerConfig as never,
144
- ...(compiled.styleConfig !== undefined ? { styleConfig: compiled.styleConfig as never } : {}),
145
- }
146
- : {}),
143
+ uiConfig: compiled.uiConfig as never,
144
+ eventConfig: compiled.eventConfig as never,
145
+ triggerConfig: compiled.triggerConfig as never,
146
+ timerConfig: compiled.timerConfig as never,
147
+ ...(compiled.styleConfig !== undefined ? { styleConfig: compiled.styleConfig as never } : {}),
148
+ ...(compiled.dataConfig !== undefined ? { dataConfig: compiled.dataConfig as never } : {}),
147
149
  });
148
150
  bootstrap = next;
149
151
  },