@proteus-vue/render-backend 0.3.0-beta.23 → 0.3.0-beta.28
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/dist/index.js +19 -1
- package/dist/superapp-runtime.d.ts +17 -0
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -7463,11 +7463,12 @@ function createSuperappRuntime(opts) {
|
|
|
7463
7463
|
});
|
|
7464
7464
|
let cur = "";
|
|
7465
7465
|
let lastHostReply = null;
|
|
7466
|
+
const devEvents = [];
|
|
7466
7467
|
if (typeof opts.host.onGesture === "function") {
|
|
7467
7468
|
opts.host.onGesture(cbName);
|
|
7468
7469
|
}
|
|
7469
7470
|
;
|
|
7470
|
-
globalThis[cbName] = (type,
|
|
7471
|
+
globalThis[cbName] = (type, kernelId, chainJson) => {
|
|
7471
7472
|
let chain = [];
|
|
7472
7473
|
try {
|
|
7473
7474
|
chain = chainJson ? JSON.parse(chainJson) : [];
|
|
@@ -7475,6 +7476,8 @@ function createSuperappRuntime(opts) {
|
|
|
7475
7476
|
note(`[superapp-runtime] \u624B\u52BF\u94FE JSON \u89E3\u6790\u5931\u8D25\uFF1A${String(chainJson).slice(0, 40)}`);
|
|
7476
7477
|
}
|
|
7477
7478
|
const r = dispatch(type, chain);
|
|
7479
|
+
devEvents.push({ type, id: kernelId, chain, handled: r.handled, fired: r.fired, time: Date.now() });
|
|
7480
|
+
if (devEvents.length > 200) devEvents.shift();
|
|
7478
7481
|
return JSON.stringify(r);
|
|
7479
7482
|
};
|
|
7480
7483
|
function hostOk(reply) {
|
|
@@ -7543,6 +7546,21 @@ function createSuperappRuntime(opts) {
|
|
|
7543
7546
|
},
|
|
7544
7547
|
dispatchGesture: dispatch,
|
|
7545
7548
|
current: () => cur,
|
|
7549
|
+
// ★DevTools 元素内省(决策 #674):当前屏已实例化节点(避免暴露整个 rt/instance 给桥)。
|
|
7550
|
+
currentContent: () => {
|
|
7551
|
+
if (!cur) return null;
|
|
7552
|
+
try {
|
|
7553
|
+
return rt.instance(cur).content();
|
|
7554
|
+
} catch {
|
|
7555
|
+
return null;
|
|
7556
|
+
}
|
|
7557
|
+
},
|
|
7558
|
+
// ★排空式:返回自上次调用以来的手势 trace,并清空(宿主每次轮询取走)。
|
|
7559
|
+
devEvents: () => {
|
|
7560
|
+
const out = devEvents.slice();
|
|
7561
|
+
devEvents.length = 0;
|
|
7562
|
+
return out;
|
|
7563
|
+
},
|
|
7546
7564
|
snapshot: () => rt.snapshot(),
|
|
7547
7565
|
lastHostReply: () => lastHostReply
|
|
7548
7566
|
};
|
|
@@ -57,6 +57,23 @@ export interface SuperappRuntime {
|
|
|
57
57
|
};
|
|
58
58
|
/** 当前屏名 */
|
|
59
59
|
current(): string;
|
|
60
|
+
/** ★DevTools 元素内省(决策 #674):当前屏**已实例化节点**(Template 实例化产物:id/parentId/tag/style/text)——供面板"元素"树。 */
|
|
61
|
+
currentContent(): {
|
|
62
|
+
viewport?: {
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
66
|
+
nodes: readonly unknown[];
|
|
67
|
+
} | null;
|
|
68
|
+
/** ★DevTools 事件 trace(决策 #675):自上次调用以来发生的手势派发(type/命中 id/冒泡链/handled/fired)——排空式。 */
|
|
69
|
+
devEvents(): ReadonlyArray<{
|
|
70
|
+
type: string;
|
|
71
|
+
id: number;
|
|
72
|
+
chain: readonly number[];
|
|
73
|
+
handled: boolean;
|
|
74
|
+
fired: readonly number[];
|
|
75
|
+
time: number;
|
|
76
|
+
}>;
|
|
60
77
|
/** ★跨调用状态导出(`{屏名: 数据}`)——一次性 VM 宿主持有、下次回灌 `seedData` */
|
|
61
78
|
snapshot(): Record<string, Record<string, unknown>>;
|
|
62
79
|
/**
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proteus-vue/render-backend",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.28",
|
|
4
4
|
"description": "G-27 ProteusRenderBackend SPI:可插拔渲染后端接口 + conformance test + 官方后端原型(Headless/VueDom) + G-41 nodeOps Dispatcher——Render anywhere, on any engine(M1.4)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@proteus-vue/animation": "0.3.0-beta.
|
|
9
|
-
"@proteus-vue/component-ir": "0.3.0-beta.
|
|
10
|
-
"@proteus-vue/contracts": "0.3.0-beta.
|
|
11
|
-
"@proteus-vue/router": "0.3.0-beta.
|
|
12
|
-
"@proteus-vue/slot-runtime": "0.3.0-beta.
|
|
8
|
+
"@proteus-vue/animation": "0.3.0-beta.28",
|
|
9
|
+
"@proteus-vue/component-ir": "0.3.0-beta.28",
|
|
10
|
+
"@proteus-vue/contracts": "0.3.0-beta.28",
|
|
11
|
+
"@proteus-vue/router": "0.3.0-beta.28",
|
|
12
|
+
"@proteus-vue/slot-runtime": "0.3.0-beta.28"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"@vue/runtime-core": "^3.4.0"
|