soma-core 2.2.6 → 2.2.8
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/core/build/compiler/soma-precompile.js +66 -10
- package/core/client/container/IContainerAdapter.ts +4 -0
- package/core/client/container/SomaContainerAdapter.ts +43 -2
- package/core/client/data/data-object-resolver.ts +43 -8
- package/core/client/engine/event-engine.ts +28 -3
- package/core/client/engine/soma-bootstrap.ts +2 -1
- package/core/client/engines/chart/adapter-echarts.ts +75 -2
- package/core/client/engines/chart/index.ts +18 -0
- package/core/client/engines/chart/port.ts +13 -0
- package/core/client/infra/notify/DefaultNotifyService.ts +2 -2
- package/core/client/parser/confirm-spec.ts +99 -6
- package/core/client/parser/data-config-parser.ts +1 -1
- package/core/client/parser/pipeline-parser.ts +2 -1
- package/core/client/render-ports/hide-transition.ts +9 -0
- package/core/client/render-ports/index.ts +4 -0
- package/core/client/render-ports/notify-renderer.ts +2 -1
- package/core/index.ts +16 -4
- package/core/server/api/load-host-service.ts +3 -0
- package/core/server/api/paged-list.ts +259 -0
- package/core/server/host/empty-host-bootstrap.mjs +3 -0
- package/core/server/host/host-assembly.ts +3 -0
- package/core/server/host/source-aliases.cjs +345 -0
- package/core/server/host/source-aliases.ts +32 -0
- package/core/server/host/source-packages.cjs +1 -0
- package/core/server/infra/cache/ServerFileCache.ts +4 -1
- package/core/server/node.ts +10 -0
- package/core/server/runtime-space/bindings.ts +47 -1
- package/core/server/runtime-space/digest.ts +6 -0
- package/core/server/runtime-space/index.ts +1 -1
- package/core/server/runtime-space/inject.ts +4 -1
- package/core/server/runtime-space/prewarm.ts +8 -8
- package/core/server/runtime-space/store.ts +8 -7
- package/core/server/runtime-space/types.ts +3 -2
- package/core/shared/core-diagnostic-codes.ts +6 -0
- package/core/shared/data-declaration-checks.ts +29 -3
- package/core/shared/registry-generated/diagnostic-registry-index.ts +5 -0
- package/core/shared/registry-generated/diagnostic-registry.ts +35 -0
- package/core/shared/registry-generated/limits.ts +18 -2
- package/core/shared/registry-generated/std-grammar.ts +1 -1
- package/core/shared/types/data-config.types.ts +3 -1
- package/core/shared/types/event.types.ts +9 -0
- package/dist/browser/soma-runtime.js +262 -23
- package/dist/core/index.cjs +283 -23
- package/dist/host-native/aot-builder.cjs +284 -0
- package/dist/host-native/native-server.cjs +395 -24
- package/dist/lsp/component-tree.cjs +66 -10
- package/dist/types/client/container/IContainerAdapter.d.ts +3 -0
- package/dist/types/client/container/SomaContainerAdapter.d.ts +5 -0
- package/dist/types/client/data/data-object-resolver.d.ts +2 -0
- package/dist/types/client/engines/chart/index.d.ts +1 -1
- package/dist/types/client/engines/chart/port.d.ts +15 -0
- package/dist/types/client/parser/confirm-spec.d.ts +27 -3
- package/dist/types/client/render-ports/hide-transition.d.ts +9 -0
- package/dist/types/client/render-ports/index.d.ts +4 -0
- package/dist/types/client/render-ports/notify-renderer.d.ts +2 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/server/api/paged-list.d.ts +101 -0
- package/dist/types/server/host/source-aliases.d.cts +53 -0
- package/dist/types/server/host/source-aliases.d.ts +30 -0
- package/dist/types/server/host/source-packages.d.cts +2 -0
- package/dist/types/server/node.d.ts +1 -0
- package/dist/types/server/runtime-space/bindings.d.ts +9 -0
- package/dist/types/server/runtime-space/digest.d.ts +5 -0
- package/dist/types/server/runtime-space/index.d.ts +1 -1
- package/dist/types/server/runtime-space/prewarm.d.ts +2 -2
- package/dist/types/server/runtime-space/types.d.ts +3 -2
- package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
- package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +30 -0
- package/dist/types/shared/registry-generated/limits.d.ts +14 -0
- package/dist/types/shared/registry-generated/std-grammar.d.ts +1 -1
- package/dist/types/shared/types/data-config.types.d.ts +3 -1
- package/dist/types/shared/types/event.types.d.ts +8 -0
- package/host-native/src/aot-builder.ts +23 -0
- package/host-native/src/host-prepare.ts +18 -1
- package/host-native/src/native-server.ts +16 -0
- package/host-native/styles/globals.css +30 -28
- package/package.json +13 -2
|
@@ -94538,6 +94538,9 @@ var HOOK_NAME_SET = new Set(SOMA_CORE_HOOK_ATTRIBUTES.map((a2) => a2.name));
|
|
|
94538
94538
|
// core/client/container/SomaContainerAdapter.ts
|
|
94539
94539
|
var SomaContainerAdapter = class {
|
|
94540
94540
|
navigateHandler = null;
|
|
94541
|
+
hideTransition = null;
|
|
94542
|
+
/** 正在「隐藏前过渡」的元素 -> 取消控制器(显示时 abort,作废旧 Promise) */
|
|
94543
|
+
pendingHides = /* @__PURE__ */ new WeakMap();
|
|
94541
94544
|
/** 注入自定义导航处理器(如 SomaRouter + Next.js 路由) */
|
|
94542
94545
|
setNavigateHandler(handler) {
|
|
94543
94546
|
this.navigateHandler = handler;
|
|
@@ -94620,10 +94623,45 @@ var SomaContainerAdapter = class {
|
|
|
94620
94623
|
}
|
|
94621
94624
|
/** 显隐只有 `hidden` 属性这一个机制:不写内联样式、不切类名;元素自带的 display 规则压不过 `[hidden]`,见 host-next/app/globals.css(宿主壳样式) */
|
|
94622
94625
|
setVisibility(element, visible) {
|
|
94623
|
-
|
|
94626
|
+
const pending = this.pendingHides.get(element);
|
|
94627
|
+
if (visible) {
|
|
94628
|
+
if (pending) {
|
|
94629
|
+
this.pendingHides.delete(element);
|
|
94630
|
+
pending.abort();
|
|
94631
|
+
}
|
|
94632
|
+
element.hidden = false;
|
|
94633
|
+
return;
|
|
94634
|
+
}
|
|
94635
|
+
const hook = this.hideTransition;
|
|
94636
|
+
if (!hook || element.hidden || pending) {
|
|
94637
|
+
if (!pending) element.hidden = true;
|
|
94638
|
+
return;
|
|
94639
|
+
}
|
|
94640
|
+
const controller = new AbortController();
|
|
94641
|
+
let result;
|
|
94642
|
+
try {
|
|
94643
|
+
result = hook(element, controller.signal);
|
|
94644
|
+
} catch {
|
|
94645
|
+
element.hidden = true;
|
|
94646
|
+
return;
|
|
94647
|
+
}
|
|
94648
|
+
if (!result || typeof result.then !== "function") {
|
|
94649
|
+
element.hidden = true;
|
|
94650
|
+
return;
|
|
94651
|
+
}
|
|
94652
|
+
this.pendingHides.set(element, controller);
|
|
94653
|
+
const settle = () => {
|
|
94654
|
+
if (this.pendingHides.get(element) !== controller || controller.signal.aborted) return;
|
|
94655
|
+
this.pendingHides.delete(element);
|
|
94656
|
+
element.hidden = true;
|
|
94657
|
+
};
|
|
94658
|
+
result.then(settle, settle);
|
|
94624
94659
|
}
|
|
94625
94660
|
isVisible(element) {
|
|
94626
|
-
return !element.hidden;
|
|
94661
|
+
return !element.hidden && !this.pendingHides.has(element);
|
|
94662
|
+
}
|
|
94663
|
+
setHideTransition(hook) {
|
|
94664
|
+
this.hideTransition = hook;
|
|
94627
94665
|
}
|
|
94628
94666
|
toggleClasses(element, classes, enabled) {
|
|
94629
94667
|
if (classes.length === 0) return;
|
|
@@ -99685,6 +99723,7 @@ var MemoryCache = class {
|
|
|
99685
99723
|
var NOTIFY_LEVELS = ["success", "info", "warning", "error", "alert", "announce"];
|
|
99686
99724
|
var NOTIFY_POLITENESS = ["polite", "assertive"];
|
|
99687
99725
|
var SOMA_CONFIRM_LEVELS = ["plain", "typed", "consent"];
|
|
99726
|
+
var SOMA_CONFIRM_TONES = ["default", "danger"];
|
|
99688
99727
|
|
|
99689
99728
|
// core/shared/types/region-scope.types.ts
|
|
99690
99729
|
init_soma_error();
|
|
@@ -99710,7 +99749,7 @@ var SomaRegionScopeError = class extends SomaError {
|
|
|
99710
99749
|
// core/client/parser/confirm-spec.ts
|
|
99711
99750
|
var SOMA_CONFIRM_REJECTED_PREFIX = "soma-confirm:";
|
|
99712
99751
|
var SOMA_CONFIRM_TEXT_MAX = 1e3;
|
|
99713
|
-
var SPEC_KEYS = ["level", "text", "phrase", "impact"];
|
|
99752
|
+
var SPEC_KEYS = ["level", "text", "phrase", "impact", "tone"];
|
|
99714
99753
|
function boundedText(value, key) {
|
|
99715
99754
|
if (typeof value !== "string" || value.trim() === "") return `confirm.${key} \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5F53\u524D\u503C: ${JSON.stringify(value)}`;
|
|
99716
99755
|
if (value.length > SOMA_CONFIRM_TEXT_MAX) return `confirm.${key} \u8FC7\u957F\uFF08\u4E0A\u9650 ${SOMA_CONFIRM_TEXT_MAX} \u5B57\u7B26\uFF09`;
|
|
@@ -99718,7 +99757,7 @@ function boundedText(value, key) {
|
|
|
99718
99757
|
}
|
|
99719
99758
|
function checkConfirmSpec(raw) {
|
|
99720
99759
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
99721
|
-
return { ok: false, error: `confirm \u7ED3\u6784\u5FC5\u987B\u662F { level, text, phrase?, impact? } \u5BF9\u8C61\uFF0C\u5F53\u524D\u503C: ${JSON.stringify(raw)}` };
|
|
99760
|
+
return { ok: false, error: `confirm \u7ED3\u6784\u5FC5\u987B\u662F { level, text, phrase?, impact?, tone? } \u5BF9\u8C61\uFF0C\u5F53\u524D\u503C: ${JSON.stringify(raw)}` };
|
|
99722
99761
|
}
|
|
99723
99762
|
const record2 = raw;
|
|
99724
99763
|
const extra = Object.keys(record2).find((key) => !SPEC_KEYS.includes(key));
|
|
@@ -99729,6 +99768,9 @@ function checkConfirmSpec(raw) {
|
|
|
99729
99768
|
if (typeof level !== "string" || !SOMA_CONFIRM_LEVELS.includes(level)) {
|
|
99730
99769
|
return { ok: false, error: `confirm.level \u5FC5\u987B\u662F ${SOMA_CONFIRM_LEVELS.join(" / ")} \u4E4B\u4E00\uFF0C\u5F53\u524D\u503C: ${JSON.stringify(level)}` };
|
|
99731
99770
|
}
|
|
99771
|
+
if (record2.tone !== void 0 && (typeof record2.tone !== "string" || !SOMA_CONFIRM_TONES.includes(record2.tone))) {
|
|
99772
|
+
return { ok: false, error: `confirm.tone \u5FC5\u987B\u662F ${SOMA_CONFIRM_TONES.join(" / ")} \u4E4B\u4E00\uFF08\u4E0D\u5199 = default\uFF09\uFF0C\u5F53\u524D\u503C: ${JSON.stringify(record2.tone)}` };
|
|
99773
|
+
}
|
|
99732
99774
|
const textProblem = boundedText(record2.text, "text");
|
|
99733
99775
|
if (textProblem !== null) return { ok: false, error: textProblem };
|
|
99734
99776
|
for (const key of ["phrase", "impact"]) {
|
|
@@ -99756,7 +99798,8 @@ function checkConfirmSpec(raw) {
|
|
|
99756
99798
|
level: lv,
|
|
99757
99799
|
text: text2,
|
|
99758
99800
|
...lv === "typed" ? { phrase: record2.phrase.trim() } : {},
|
|
99759
|
-
...lv !== "plain" && record2.impact !== void 0 ? { impact: record2.impact.trim() } : {}
|
|
99801
|
+
...lv !== "plain" && record2.impact !== void 0 ? { impact: record2.impact.trim() } : {},
|
|
99802
|
+
...record2.tone === "danger" ? { tone: "danger" } : {}
|
|
99760
99803
|
}
|
|
99761
99804
|
};
|
|
99762
99805
|
}
|
|
@@ -99777,6 +99820,45 @@ function parseConfirmSegment(message) {
|
|
|
99777
99820
|
}
|
|
99778
99821
|
return { spec: { level: "plain", text: text2 } };
|
|
99779
99822
|
}
|
|
99823
|
+
var SOMA_CONFIRM_MISSING = "\u2014";
|
|
99824
|
+
var SOMA_CONFIRM_COUNT_NAME = "n";
|
|
99825
|
+
var CONFIRM_TOKEN = /\{\{|\}\}|\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
99826
|
+
var warnedMissing = /* @__PURE__ */ new Set();
|
|
99827
|
+
function scalarText(value) {
|
|
99828
|
+
if (typeof value === "string") return value;
|
|
99829
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return String(value);
|
|
99830
|
+
return null;
|
|
99831
|
+
}
|
|
99832
|
+
function substituteConfirmText(text2, context, onMissing) {
|
|
99833
|
+
if (!text2.includes("{") && !text2.includes("}")) return text2;
|
|
99834
|
+
const row = context.row !== null && typeof context.row === "object" && !Array.isArray(context.row) ? context.row : void 0;
|
|
99835
|
+
return text2.replace(CONFIRM_TOKEN, (token, name2) => {
|
|
99836
|
+
if (name2 === void 0) return token === "{{" ? "{" : "}";
|
|
99837
|
+
const value = name2 === SOMA_CONFIRM_COUNT_NAME ? context.count : row?.[name2];
|
|
99838
|
+
const plain = scalarText(value);
|
|
99839
|
+
if (plain !== null) return plain;
|
|
99840
|
+
onMissing?.(name2);
|
|
99841
|
+
return SOMA_CONFIRM_MISSING;
|
|
99842
|
+
});
|
|
99843
|
+
}
|
|
99844
|
+
function resolveConfirmSpec(spec, context, onMissing) {
|
|
99845
|
+
const text2 = substituteConfirmText(spec.text, context, onMissing);
|
|
99846
|
+
const impact = spec.impact === void 0 ? void 0 : substituteConfirmText(spec.impact, context, onMissing);
|
|
99847
|
+
if (text2 === spec.text && impact === spec.impact) return spec;
|
|
99848
|
+
return { ...spec, text: text2, ...impact !== void 0 ? { impact } : {} };
|
|
99849
|
+
}
|
|
99850
|
+
function warnConfirmMissing(name2, where) {
|
|
99851
|
+
if (warnedMissing.has(name2)) return;
|
|
99852
|
+
warnedMissing.add(name2);
|
|
99853
|
+
const dev = typeof process === "undefined" || true;
|
|
99854
|
+
if (dev) console.warn(`[soma-core][\u5F15\u64CE] ${where} \u7684\u786E\u8BA4\u6587\u6848\u5360\u4F4D {${name2}} \u53D6\u4E0D\u5230\u503C\uFF0C\u5DF2\u4EE3\u5165\u300C${SOMA_CONFIRM_MISSING}\u300D\uFF08\u5360\u4F4D\u53EA\u53D6\u8F7D\u8377 row \u7684\u5B57\u6BB5\uFF0C{n} \u53D6\u5DF2\u9009\u884C\u6570\uFF1B\u5B57\u9762\u82B1\u62EC\u53F7\u5199 {{ }}\uFF09`);
|
|
99855
|
+
}
|
|
99856
|
+
function confirmContextOf(payload, rowData) {
|
|
99857
|
+
const record2 = payload !== null && typeof payload === "object" && !Array.isArray(payload) ? payload : void 0;
|
|
99858
|
+
const row = record2 !== void 0 && "row" in record2 ? record2.row : rowData;
|
|
99859
|
+
const count2 = Array.isArray(record2?.rows) ? record2.rows.length : void 0;
|
|
99860
|
+
return { ...row !== void 0 ? { row } : {}, ...count2 !== void 0 ? { count: count2 } : {} };
|
|
99861
|
+
}
|
|
99780
99862
|
|
|
99781
99863
|
// core/shared/region-scope-decl.ts
|
|
99782
99864
|
var PATH_PATTERN2 = /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z0-9_]+)*$/;
|
|
@@ -100205,7 +100287,7 @@ function splitOptionalSegments(parts) {
|
|
|
100205
100287
|
const segment2 = parseConfirmSegment(message);
|
|
100206
100288
|
if ("error" in segment2) throw new SomaEventParseError(segment2.error, parts.join(" | "));
|
|
100207
100289
|
confirm = segment2.spec.text;
|
|
100208
|
-
confirmSpec = segment2.spec.level === "plain" ? void 0 : segment2.spec;
|
|
100290
|
+
confirmSpec = segment2.spec.level === "plain" && segment2.spec.tone === void 0 ? void 0 : segment2.spec;
|
|
100209
100291
|
continue;
|
|
100210
100292
|
}
|
|
100211
100293
|
if (index > 0 && part.startsWith(PERMISSION_PREFIX)) {
|
|
@@ -104204,7 +104286,15 @@ var SomaEventEngine = class {
|
|
|
104204
104286
|
return false;
|
|
104205
104287
|
};
|
|
104206
104288
|
if (!isCurrent()) return;
|
|
104207
|
-
const preChecked = this.preCheck(
|
|
104289
|
+
const preChecked = this.preCheck(
|
|
104290
|
+
config,
|
|
104291
|
+
config.somaId,
|
|
104292
|
+
element,
|
|
104293
|
+
confirmContextOf(
|
|
104294
|
+
isSomaEmitEvent(originalEvent) ? originalEvent.payload : void 0,
|
|
104295
|
+
rowContext instanceof SomaRowScope ? rowContext.data : void 0
|
|
104296
|
+
)
|
|
104297
|
+
);
|
|
104208
104298
|
if (!(preChecked instanceof Promise ? await preChecked : preChecked)) {
|
|
104209
104299
|
runtime.status = "blocked";
|
|
104210
104300
|
runtime.message = "pre-check rejected";
|
|
@@ -104463,12 +104553,17 @@ var SomaEventEngine = class {
|
|
|
104463
104553
|
if (this.confirmGraded) return this.confirmGraded(spec);
|
|
104464
104554
|
return this.adapter.confirm(spec.text);
|
|
104465
104555
|
}
|
|
104466
|
-
preCheck(config, somaId, element) {
|
|
104556
|
+
preCheck(config, somaId, element, confirmContext) {
|
|
104467
104557
|
if (this.getContext(element) instanceof SomaRowScope ? this.pendingRows.has(element) : this.pendingSet.has(somaId)) {
|
|
104468
104558
|
return false;
|
|
104469
104559
|
}
|
|
104470
104560
|
if (config.confirm) {
|
|
104471
|
-
|
|
104561
|
+
const spec = resolveConfirmSpec(
|
|
104562
|
+
config.confirmSpec ?? { level: "plain", text: config.confirm },
|
|
104563
|
+
confirmContext,
|
|
104564
|
+
(name2) => warnConfirmMissing(name2, `${somaId}.${config.domEvent}`)
|
|
104565
|
+
);
|
|
104566
|
+
return this.askConfirm(spec);
|
|
104472
104567
|
}
|
|
104473
104568
|
return true;
|
|
104474
104569
|
}
|
|
@@ -107893,8 +107988,8 @@ var DefaultNotifyService = class {
|
|
|
107893
107988
|
return this.renderer.confirm({
|
|
107894
107989
|
message: spec.text,
|
|
107895
107990
|
...title === void 0 ? {} : { title },
|
|
107896
|
-
// plain
|
|
107897
|
-
...spec.level === "plain" ? {} : { spec }
|
|
107991
|
+
// plain 且无语气不带 spec:旧渲染器与旧测试看到的请求逐字不变
|
|
107992
|
+
...spec.level === "plain" && spec.tone === void 0 ? {} : { spec }
|
|
107898
107993
|
});
|
|
107899
107994
|
}
|
|
107900
107995
|
return this.confirmResult;
|
|
@@ -108794,6 +108889,63 @@ function createEChartsAdapter(adapterOptions = {}) {
|
|
|
108794
108889
|
chart.off("mouseout", onOut);
|
|
108795
108890
|
};
|
|
108796
108891
|
},
|
|
108892
|
+
onColumn(handler) {
|
|
108893
|
+
const zr = chart.getZr();
|
|
108894
|
+
const axisOf = () => {
|
|
108895
|
+
const model = chart.getModel();
|
|
108896
|
+
for (const dim of ["x", "y"]) {
|
|
108897
|
+
const axis = model.getComponent(`${dim}Axis`, 0);
|
|
108898
|
+
if (axis !== void 0 && axis.get("type") === "category") {
|
|
108899
|
+
const scale3 = axis.axis?.scale;
|
|
108900
|
+
const metaCats = scale3?.getOrdinalMeta?.()?.categories;
|
|
108901
|
+
const cats = metaCats !== void 0 && metaCats.length > 0 ? metaCats : axis.getCategories?.() ?? [];
|
|
108902
|
+
return { dim, count: cats.length };
|
|
108903
|
+
}
|
|
108904
|
+
}
|
|
108905
|
+
return null;
|
|
108906
|
+
};
|
|
108907
|
+
const columnAt = (x2, y2) => {
|
|
108908
|
+
const axis = axisOf();
|
|
108909
|
+
if (axis === null || axis.count === 0) return null;
|
|
108910
|
+
if (!chart.containPixel({ gridIndex: 0 }, [x2, y2])) return null;
|
|
108911
|
+
const raw = chart.convertFromPixel({ gridIndex: 0 }, [x2, y2]);
|
|
108912
|
+
const v4 = Array.isArray(raw) ? raw[axis.dim === "x" ? 0 : 1] : raw;
|
|
108913
|
+
if (typeof v4 !== "number" || !Number.isFinite(v4)) return null;
|
|
108914
|
+
const dataIndex = Math.min(axis.count - 1, Math.max(0, Math.round(v4)));
|
|
108915
|
+
return columnAnchor(dataIndex, axis.dim);
|
|
108916
|
+
};
|
|
108917
|
+
const columnAnchor = (dataIndex, dim) => {
|
|
108918
|
+
const finder = dim === "x" ? { xAxisIndex: 0 } : { yAxisIndex: 0 };
|
|
108919
|
+
const px = chart.convertToPixel(finder, dataIndex);
|
|
108920
|
+
const grid = chart.getModel().getComponent("grid", 0);
|
|
108921
|
+
const rect = grid?.coordinateSystem?.getRect();
|
|
108922
|
+
const along = typeof px === "number" ? px : Array.isArray(px) ? px[0] : NaN;
|
|
108923
|
+
if (!Number.isFinite(along)) return null;
|
|
108924
|
+
const anchor = dim === "x" ? { x: along, y: rect?.y ?? 0 } : { x: rect?.x ?? 0, y: along };
|
|
108925
|
+
return { dataIndex, anchor };
|
|
108926
|
+
};
|
|
108927
|
+
const read = (e3) => typeof e3.offsetX === "number" && typeof e3.offsetY === "number" ? columnAt(e3.offsetX, e3.offsetY) : null;
|
|
108928
|
+
const onMove = (e3) => {
|
|
108929
|
+
const c2 = read(e3);
|
|
108930
|
+
handler(c2 === null ? "leave" : "hover", c2);
|
|
108931
|
+
};
|
|
108932
|
+
const onClick = (e3) => {
|
|
108933
|
+
const c2 = read(e3);
|
|
108934
|
+
if (c2 !== null) handler("click", c2);
|
|
108935
|
+
};
|
|
108936
|
+
const onOut = () => handler("leave", null);
|
|
108937
|
+
zr.on("mousemove", onMove);
|
|
108938
|
+
zr.on("click", onClick);
|
|
108939
|
+
zr.on("globalout", onOut);
|
|
108940
|
+
let active2 = true;
|
|
108941
|
+
return () => {
|
|
108942
|
+
if (!active2) return;
|
|
108943
|
+
active2 = false;
|
|
108944
|
+
zr.off("mousemove", onMove);
|
|
108945
|
+
zr.off("click", onClick);
|
|
108946
|
+
zr.off("globalout", onOut);
|
|
108947
|
+
};
|
|
108948
|
+
},
|
|
108797
108949
|
resize() {
|
|
108798
108950
|
chart.resize(size3 === void 0 ? void 0 : { width: size3.width, height: size3.height });
|
|
108799
108951
|
},
|
|
@@ -108856,6 +109008,21 @@ function guard(inner23) {
|
|
|
108856
109008
|
unsubs.add(wrapped);
|
|
108857
109009
|
return wrapped;
|
|
108858
109010
|
},
|
|
109011
|
+
...inner23.onColumn === void 0 ? {} : {
|
|
109012
|
+
onColumn(handler) {
|
|
109013
|
+
live();
|
|
109014
|
+
const off = inner23.onColumn(handler);
|
|
109015
|
+
let done = false;
|
|
109016
|
+
const wrapped = () => {
|
|
109017
|
+
if (done) return;
|
|
109018
|
+
done = true;
|
|
109019
|
+
unsubs.delete(wrapped);
|
|
109020
|
+
off();
|
|
109021
|
+
};
|
|
109022
|
+
unsubs.add(wrapped);
|
|
109023
|
+
return wrapped;
|
|
109024
|
+
}
|
|
109025
|
+
},
|
|
108859
109026
|
resize() {
|
|
108860
109027
|
live();
|
|
108861
109028
|
inner23.resize();
|
|
@@ -109855,6 +110022,17 @@ var SOMA_CORE_DIAGNOSTIC_CODES = [
|
|
|
109855
110022
|
// 时间:ready() 前调同步方法
|
|
109856
110023
|
"CORE-TEMPORAL-ZONE",
|
|
109857
110024
|
// 时间:时区标识非法
|
|
110025
|
+
// 宿主源码别名(产生点 core/server/host/source-aliases.cjs,CJS 不能 import 本表,码字面量两处各一份,由本表对账测试与注册表一致)
|
|
110026
|
+
"CORE-HOST-ALIAS-INVALID",
|
|
110027
|
+
// 别名声明形状不对 / 路径越界或不存在 / 别名名字非法(error)
|
|
110028
|
+
"CORE-HOST-ALIAS-RESERVED",
|
|
110029
|
+
// 别名占了保留名(soma / soma-*、server-only、node_modules、带子路径的 Node 内置)(error)
|
|
110030
|
+
"CORE-HOST-ALIAS-SHADOW",
|
|
110031
|
+
// 宿主 node_modules/<别名> 已存在且不是指向别名目录的软链(warning,别名仍生效)
|
|
110032
|
+
"CORE-HOST-ALIAS-DUPLICATE",
|
|
110033
|
+
// 多个源码根里同名别名,先声明者胜(warning)
|
|
110034
|
+
"CORE-HOST-ALIAS-TSCONFIG-DRIFT",
|
|
110035
|
+
// tsconfig.json 的 baseUrl 与第一个源码根不一致(warning)
|
|
109858
110036
|
"CORE-DND-SPEC",
|
|
109859
110037
|
// 拖放:getData 返回非对象 / 同元素重复登记
|
|
109860
110038
|
"CORE-ALGO-DIFF-INPUT",
|
|
@@ -110796,14 +110974,16 @@ function inspectSourceRequire(raw, paramNames) {
|
|
|
110796
110974
|
}
|
|
110797
110975
|
const issues = [];
|
|
110798
110976
|
const seen = /* @__PURE__ */ new Set();
|
|
110799
|
-
|
|
110800
|
-
const at2 = `require[${index}]`;
|
|
110977
|
+
const checkName = (name2, at2, inGroup) => {
|
|
110801
110978
|
if (typeof name2 !== "string" || name2.trim() === "") {
|
|
110802
110979
|
issues.push({ path: at2, message: `require \u91CC\u7684\u53C2\u6570\u540D\u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\uFF0C\u5F53\u524D\u503C: ${show(name2)}` });
|
|
110803
110980
|
return;
|
|
110804
110981
|
}
|
|
110805
110982
|
if (seen.has(name2)) {
|
|
110806
|
-
issues.push({
|
|
110983
|
+
issues.push({
|
|
110984
|
+
path: at2,
|
|
110985
|
+
message: inGroup ? `require \u91CC\u6709\u91CD\u590D\u7684\u53C2\u6570\u540D "${name2}"\uFF08\u540C\u540D\u4E0D\u80FD\u5728\u5355\u9879\u4E0E\u5206\u7EC4\u91CC\u3001\u6216\u4E24\u4E2A\u5206\u7EC4\u91CC\u91CD\u590D\u51FA\u73B0\uFF09` : `require \u91CC\u6709\u91CD\u590D\u7684\u53C2\u6570\u540D "${name2}"`
|
|
110986
|
+
});
|
|
110807
110987
|
return;
|
|
110808
110988
|
}
|
|
110809
110989
|
seen.add(name2);
|
|
@@ -110813,6 +110993,28 @@ function inspectSourceRequire(raw, paramNames) {
|
|
|
110813
110993
|
message: `require \u91CC\u7684 "${name2}" \u6CA1\u6709\u51FA\u73B0\u5728\u540C\u4E00\u6765\u6E90\u7684 params \u91CC\uFF08params \u6709: ${paramNames.join(" / ") || "\u65E0"}\uFF09`
|
|
110814
110994
|
});
|
|
110815
110995
|
}
|
|
110996
|
+
};
|
|
110997
|
+
raw.forEach((entry, index) => {
|
|
110998
|
+
const at2 = `require[${index}]`;
|
|
110999
|
+
if (!Array.isArray(entry)) {
|
|
111000
|
+
checkName(entry, at2, false);
|
|
111001
|
+
return;
|
|
111002
|
+
}
|
|
111003
|
+
if (entry.length < 2) {
|
|
111004
|
+
issues.push({
|
|
111005
|
+
path: at2,
|
|
111006
|
+
message: `require \u91CC\u7684\u300C\u81F3\u5C11\u4E00\u4E2A\u300D\u5206\u7EC4\u81F3\u5C11\u8981 2 \u4E2A\u53C2\u6570\u540D\uFF08\u5355\u4E2A\u53C2\u6570\u76F4\u63A5\u5199\u540D\u5B57\uFF09\uFF0C\u5F53\u524D\u503C: ${show(entry)}`
|
|
111007
|
+
});
|
|
111008
|
+
return;
|
|
111009
|
+
}
|
|
111010
|
+
entry.forEach((member, memberIndex) => {
|
|
111011
|
+
const memberAt = `${at2}[${memberIndex}]`;
|
|
111012
|
+
if (Array.isArray(member)) {
|
|
111013
|
+
issues.push({ path: memberAt, message: `require \u7684\u5206\u7EC4\u53EA\u8BB8\u4E00\u5C42\uFF0C\u4E0D\u80FD\u518D\u5D4C\u5957\u6570\u7EC4\uFF0C\u5F53\u524D\u503C: ${show(member)}` });
|
|
111014
|
+
return;
|
|
111015
|
+
}
|
|
111016
|
+
checkName(member, memberAt, true);
|
|
111017
|
+
});
|
|
110816
111018
|
});
|
|
110817
111019
|
return issues;
|
|
110818
111020
|
}
|
|
@@ -111624,6 +111826,11 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
111624
111826
|
"file": "core/server/registry/registry-file-lock.ts",
|
|
111625
111827
|
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
111626
111828
|
},
|
|
111829
|
+
{
|
|
111830
|
+
"module": "soma-core",
|
|
111831
|
+
"file": "core/server/api/paged-list.ts",
|
|
111832
|
+
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
111833
|
+
},
|
|
111627
111834
|
{
|
|
111628
111835
|
"module": "soma-core",
|
|
111629
111836
|
"file": "core/server/registry/registry-write-pipeline.ts",
|
|
@@ -111639,6 +111846,11 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
111639
111846
|
"file": "core/server/registry/source/version-store.ts",
|
|
111640
111847
|
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
111641
111848
|
},
|
|
111849
|
+
{
|
|
111850
|
+
"module": "soma-core",
|
|
111851
|
+
"file": "core/server/runtime-space/inject.ts",
|
|
111852
|
+
"symbol": "SOMA_PIPELINE_LIMITS"
|
|
111853
|
+
},
|
|
111642
111854
|
{
|
|
111643
111855
|
"module": "soma-ui",
|
|
111644
111856
|
"file": "src/compiler/bdl/registry/archive.ts",
|
|
@@ -111987,7 +112199,8 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
111987
112199
|
"watchFailLimit": 2,
|
|
111988
112200
|
"serverFileMaxEntries": 512,
|
|
111989
112201
|
"serverFileMaxBytes": 33554432,
|
|
111990
|
-
"serverDirMaxEntries": 256
|
|
112202
|
+
"serverDirMaxEntries": 256,
|
|
112203
|
+
"sourceRootAliasCapacity": 64
|
|
111991
112204
|
},
|
|
111992
112205
|
"runtimeCache": {
|
|
111993
112206
|
"basis": "runtime \u7A7A\u95F4 L1 \u5185\u5B58 LRU \u7684\u6761\u76EE\u5BB9\u91CF\uFF08\u7F16\u8BD1\u7ED3\u679C\u4E0E\u6807\u51C6\u683C\u5F0F\u4EA7\u7269\u5404\u4E00\u6761\u76EE\uFF09\u4E0E\u9759\u6001\u9875\u5730\u5740\u6E05\u5355\u7684\u5F00\u53D1\u6001\u590D\u6838\u95F4\u9694\uFF1B\u5BB9\u91CF\u4E0D\u5C0F\u4E8E\u53D1\u5E03\u9875\u4EA7\u7269\u7F13\u5B58\u5BB9\u91CF\uFF08cache.publishedArtifactCapacity\uFF09\uFF0C\u56E0\u4E3A L1 \u8981\u5BB9\u5F97\u4E0B\u5DF2\u53D1\u5E03\u9875\u52A0\u4E0A\u8FD0\u884C\u671F\u6309 URL \u6CE8\u5165\u7684\u9875\uFF1B\u590D\u6838\u95F4\u9694\u8BA9\u65B0\u589E\u9759\u6001\u9875\u6700\u8FDF\u8FD9\u4E2A\u6BEB\u79D2\u6570\u540E\u8FDB\u5165\u5199\u5165\u671F\u51B2\u7A81\u5224\u5B9A\uFF08\u751F\u4EA7\u6001\u4E0D\u8FC7\u671F\uFF09\u3002\u8FC1\u5165\u524D\u662F soma-core store.ts \u7684 SOMA_RUNTIME_CACHE_ENTRIES_DEFAULT \u4E0E static-source.ts \u7684 DEV_TTL_MS",
|
|
@@ -112005,6 +112218,10 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
112005
112218
|
"maxWaitMs": 5e3,
|
|
112006
112219
|
"waitSliceMs": 15
|
|
112007
112220
|
},
|
|
112221
|
+
"pagedList": {
|
|
112222
|
+
"pageSizeDefault": 10,
|
|
112223
|
+
"pageSizeMax": 500
|
|
112224
|
+
},
|
|
112008
112225
|
"writeRate": {
|
|
112009
112226
|
"limit": 120,
|
|
112010
112227
|
"windowMs": 6e4
|
|
@@ -112015,7 +112232,8 @@ var SOMA_PIPELINE_LIMITS = {
|
|
|
112015
112232
|
"defaultDebounceMs": 300
|
|
112016
112233
|
},
|
|
112017
112234
|
"inject": {
|
|
112018
|
-
"pageMaxBytes": 4194304
|
|
112235
|
+
"pageMaxBytes": 4194304,
|
|
112236
|
+
"batchFailureMessageMaxChars": 2e3
|
|
112019
112237
|
},
|
|
112020
112238
|
"execution": {
|
|
112021
112239
|
"maxNodes": 128,
|
|
@@ -112298,7 +112516,7 @@ function parseSource(raw, path, objectNames, selfName, deps) {
|
|
|
112298
112516
|
SOMA_FROM_REQUIRE_CODE
|
|
112299
112517
|
);
|
|
112300
112518
|
}
|
|
112301
|
-
source.require = [...
|
|
112519
|
+
source.require = requireRaw.map((entry) => Array.isArray(entry) ? [...entry] : entry);
|
|
112302
112520
|
}
|
|
112303
112521
|
return source;
|
|
112304
112522
|
}
|
|
@@ -113156,6 +113374,19 @@ var SomaDataCycleError = class extends Error {
|
|
|
113156
113374
|
function isPlainObject5(value) {
|
|
113157
113375
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
113158
113376
|
}
|
|
113377
|
+
function explicitBooleans(fields2, model, create4) {
|
|
113378
|
+
let next = null;
|
|
113379
|
+
for (const [key, field] of Object.entries(fields2)) {
|
|
113380
|
+
if (field?.type !== "bool") continue;
|
|
113381
|
+
const present = Object.hasOwn(model, key);
|
|
113382
|
+
const value = model[key];
|
|
113383
|
+
const blank = value === void 0 || value === null || value === "";
|
|
113384
|
+
if (present ? !blank : !create4) continue;
|
|
113385
|
+
next ??= { ...model };
|
|
113386
|
+
next[key] = false;
|
|
113387
|
+
}
|
|
113388
|
+
return next ?? model;
|
|
113389
|
+
}
|
|
113159
113390
|
function readPath2(root, segments) {
|
|
113160
113391
|
let current = root;
|
|
113161
113392
|
for (const segment2 of segments) {
|
|
@@ -113573,8 +113804,10 @@ var SomaDataObjectResolver = class {
|
|
|
113573
113804
|
*/
|
|
113574
113805
|
async submit(name2, model, mode, options = {}) {
|
|
113575
113806
|
const intent = options.intent ?? "explicit";
|
|
113576
|
-
const
|
|
113577
|
-
const write =
|
|
113807
|
+
const declared = this.config.objects[name2];
|
|
113808
|
+
const write = declared?.write;
|
|
113809
|
+
const sent = write !== void 0 && declared?.fields !== void 0 && isPlainObject5(model) ? explicitBooleans(declared.fields, model, (mode ?? this.inferWriteMode(name2, write)) === "create") : model;
|
|
113810
|
+
const result = await this.submitRaw(name2, sent, mode, options.identityField, options.signal);
|
|
113578
113811
|
if (!write) return result;
|
|
113579
113812
|
if (result.ok) return decorateSuccess(result, write, intent);
|
|
113580
113813
|
return decorateFailure(result, intent, { sentToken: readConcurrencyToken(model, write) });
|
|
@@ -113727,8 +113960,10 @@ var SomaDataObjectResolver = class {
|
|
|
113727
113960
|
*/
|
|
113728
113961
|
mapSubmitError(error2, write) {
|
|
113729
113962
|
const payload = extractErrorPayload(error2);
|
|
113730
|
-
const
|
|
113731
|
-
const
|
|
113963
|
+
const raw = payload.message ?? (error2 instanceof Error ? error2.message : "\u63D0\u4EA4\u5931\u8D25");
|
|
113964
|
+
const http = splitHttpMessage(raw);
|
|
113965
|
+
const message = http === null ? raw : http.text !== "" ? http.text : "\u63D0\u4EA4\u5931\u8D25";
|
|
113966
|
+
const status = commandStatusOf(error2) ?? http?.status;
|
|
113732
113967
|
const conflict = status === 409 || status === 412 ? readConflictState(error2, write) : {};
|
|
113733
113968
|
const withStatus = status === void 0 ? { ...conflict } : { status, ...conflict };
|
|
113734
113969
|
if (!payload.fieldErrors) return { ok: false, message, ...withStatus };
|
|
@@ -114212,7 +114447,10 @@ var SomaDataObjectResolver = class {
|
|
|
114212
114447
|
this.assertActive();
|
|
114213
114448
|
const params = this.resolveParams(source.params, selfName, selfValue);
|
|
114214
114449
|
if (params === null) return { skipped: false, data: [] };
|
|
114215
|
-
|
|
114450
|
+
const blank = (name2) => isRequiredParamBlank(params?.[name2]);
|
|
114451
|
+
if (source.require?.some((entry) => Array.isArray(entry) ? entry.every(blank) : blank(entry))) {
|
|
114452
|
+
return { skipped: true };
|
|
114453
|
+
}
|
|
114216
114454
|
return { skipped: false, data: await this.requestSource(source, selfName, params) };
|
|
114217
114455
|
}
|
|
114218
114456
|
requestSource(source, selfName, params) {
|
|
@@ -114220,7 +114458,7 @@ var SomaDataObjectResolver = class {
|
|
|
114220
114458
|
this.onFetch?.({ region: selfName, object: selfName, window: { offset: 0, limit: 0 }, query: params ?? {} });
|
|
114221
114459
|
} catch {
|
|
114222
114460
|
}
|
|
114223
|
-
const request = this.http.get(source.api, params ? { params } :
|
|
114461
|
+
const request = this.http.get(source.api, params ? { params, silentErrorToast: true } : { silentErrorToast: true });
|
|
114224
114462
|
if (source.failWhen === void 0) return request;
|
|
114225
114463
|
return Promise.resolve(request).then((data) => {
|
|
114226
114464
|
const refusal = envelopeFailureOf(data, { failWhen: source.failWhen, messagePath: source.messagePath }, "\u670D\u52A1\u7AEF\u62D2\u7EDD\u4E86\u8BE5\u8BF7\u6C42");
|
|
@@ -118004,6 +118242,7 @@ var SomaBootstrap = class {
|
|
|
118004
118242
|
...shortcutsDesign()?.sequenceTimeoutMs !== void 0 ? { sequenceTimeoutMs: shortcutsDesign().sequenceTimeoutMs } : {}
|
|
118005
118243
|
});
|
|
118006
118244
|
this.renderPorts = options.renderPorts;
|
|
118245
|
+
if (options.renderPorts?.hideTransition) this.adapter.setHideTransition?.(options.renderPorts.hideTransition);
|
|
118007
118246
|
this.engines = options.engines ?? {};
|
|
118008
118247
|
this.localeOptions = options.locale ?? {};
|
|
118009
118248
|
this.preferredLocale = this.localeOptions.initial;
|