@dimina-kit/devtools 0.4.0-dev.20260711140249 → 0.4.0-dev.20260716153350
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/main/app/app.js +39 -10
- package/dist/main/app/native-overview.d.ts +1 -1
- package/dist/main/index.bundle.js +189 -172
- package/dist/main/services/simulator-appdata/index.js +1 -1
- package/dist/main/services/views/native-simulator-view.d.ts +6 -0
- package/dist/main/services/views/native-simulator-view.js +16 -0
- package/dist/main/services/views/refresh-styles.d.ts +10 -0
- package/dist/main/services/views/refresh-styles.js +57 -0
- package/dist/main/services/views/view-manager.d.ts +26 -1
- package/dist/main/services/views/view-manager.js +7 -0
- package/dist/main/services/views/workbench-view.d.ts +2 -0
- package/dist/main/services/views/workbench-view.js +87 -7
- package/dist/main/services/workspace/open-project-guards.d.ts +16 -0
- package/dist/main/services/workspace/open-project-guards.js +42 -0
- package/dist/main/services/workspace/rebuild-status.d.ts +24 -0
- package/dist/main/services/workspace/rebuild-status.js +20 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +2 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +4 -0
- package/dist/main/services/workspace/workspace-service.js +21 -36
- package/dist/native-host/common/common.js +1 -1
- package/dist/native-host/render/render.js +49 -34
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/instrumentation/app-data.d.ts +2 -2
- package/dist/preload/instrumentation/app-data.js +1 -1
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +1 -1
- package/dist/preload/windows/main.cjs +96 -0
- package/dist/preload/windows/main.cjs.map +2 -2
- package/dist/preload/windows/simulator.cjs +162 -140
- package/dist/preload/windows/simulator.cjs.map +3 -3
- package/dist/preload/windows/simulator.js +162 -140
- package/dist/render-host/render-inspect.js +15 -47
- package/dist/renderer/assets/index-CiIkMrdt.js +49 -0
- package/dist/renderer/assets/{input-COtRON-n.js → input-7P0WbXyg.js} +2 -2
- package/dist/renderer/assets/ipc-transport-BGtDnv6p.css +1 -0
- package/dist/renderer/assets/{ipc-transport-SuI2rOB_.js → ipc-transport-DTEmLpxx.js} +2 -2
- package/dist/renderer/assets/popover-DsOcyIS6.js +2 -0
- package/dist/renderer/assets/{select-Bwb8O0Mf.js → select-Bzbhbg9Z.js} +2 -2
- package/dist/renderer/assets/{settings-BispnvJU.js → settings-CR1TyBWu.js} +2 -2
- package/dist/renderer/assets/{settings-api-HIBz8BFz.js → settings-api-B1wVFAPB.js} +2 -2
- package/dist/renderer/assets/workbenchSettings-CFbToT4Q.js +8 -0
- package/dist/renderer/entries/main/index.html +6 -6
- package/dist/renderer/entries/popover/index.html +5 -5
- package/dist/renderer/entries/settings/index.html +5 -5
- package/dist/renderer/entries/workbench-settings/index.html +4 -4
- package/dist/shared/ipc-channels.d.ts +1 -0
- package/dist/shared/ipc-channels.js +7 -0
- package/dist/simulator/assets/device-shell-C-HZY3bL.css +1 -0
- package/dist/simulator/assets/device-shell-Cu1ZPLfe.js +2 -0
- package/dist/simulator/assets/{simulator-A1vGZVBM.js → simulator-Cy8c-eA2.js} +5 -5
- package/dist/simulator/simulator.html +1 -1
- package/package.json +7 -7
- package/dist/renderer/assets/index-WbvXdhWQ.js +0 -49
- package/dist/renderer/assets/ipc-transport-CNvORIEX.css +0 -1
- package/dist/renderer/assets/popover-B73T3z-m.js +0 -2
- package/dist/renderer/assets/workbenchSettings-CtRBr7gS.js +0 -8
- package/dist/shared/appdata-accumulator.d.ts +0 -95
- package/dist/shared/appdata-accumulator.js +0 -218
- package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
- package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
|
@@ -56,6 +56,168 @@ function escapeForAttrSelector(value) {
|
|
|
56
56
|
return value.replace(/[\\"]/g, "\\$&");
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// ../inspect/dist/appdata-accumulator.js
|
|
60
|
+
function parseMessagePayload(message) {
|
|
61
|
+
if (typeof message !== "string")
|
|
62
|
+
return message;
|
|
63
|
+
try {
|
|
64
|
+
return JSON.parse(message);
|
|
65
|
+
} catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function decodeUpdateBatchBody(rawBody) {
|
|
70
|
+
const body = rawBody;
|
|
71
|
+
if (!body || typeof body !== "object")
|
|
72
|
+
return null;
|
|
73
|
+
if (typeof body.bridgeId !== "string" || !Array.isArray(body.updates))
|
|
74
|
+
return null;
|
|
75
|
+
const out = [];
|
|
76
|
+
for (const u of body.updates) {
|
|
77
|
+
if (!u || typeof u.moduleId !== "string")
|
|
78
|
+
continue;
|
|
79
|
+
if (!u.moduleId.startsWith("page_"))
|
|
80
|
+
continue;
|
|
81
|
+
out.push({ mode: "patch", bridgeId: body.bridgeId, moduleId: u.moduleId, data: u.data });
|
|
82
|
+
}
|
|
83
|
+
return out.length > 0 ? out : null;
|
|
84
|
+
}
|
|
85
|
+
function decodePageInitBody(moduleId, rawBody) {
|
|
86
|
+
const body = rawBody;
|
|
87
|
+
if (!body || typeof body !== "object")
|
|
88
|
+
return null;
|
|
89
|
+
if (typeof body.bridgeId !== "string" || typeof body.path !== "string")
|
|
90
|
+
return null;
|
|
91
|
+
if (!body.data || typeof body.data !== "object")
|
|
92
|
+
return null;
|
|
93
|
+
return [{
|
|
94
|
+
mode: "init",
|
|
95
|
+
bridgeId: body.bridgeId,
|
|
96
|
+
moduleId,
|
|
97
|
+
componentPath: body.path,
|
|
98
|
+
data: body.data
|
|
99
|
+
}];
|
|
100
|
+
}
|
|
101
|
+
function decodeWorkerMessage(message) {
|
|
102
|
+
const payload = parseMessagePayload(message);
|
|
103
|
+
if (!payload || typeof payload !== "object")
|
|
104
|
+
return null;
|
|
105
|
+
const record = payload;
|
|
106
|
+
if (record.type === "ub")
|
|
107
|
+
return decodeUpdateBatchBody(record.body);
|
|
108
|
+
if (typeof record.type === "string" && record.type.startsWith("page_")) {
|
|
109
|
+
return decodePageInitBody(record.type, record.body);
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
function decodeOutgoingMessage(message) {
|
|
114
|
+
const payload = parseMessagePayload(message);
|
|
115
|
+
if (!payload || typeof payload !== "object")
|
|
116
|
+
return null;
|
|
117
|
+
const r = payload;
|
|
118
|
+
if (typeof r.type !== "string")
|
|
119
|
+
return null;
|
|
120
|
+
return {
|
|
121
|
+
type: r.type,
|
|
122
|
+
bridgeId: typeof r.body?.bridgeId === "string" ? r.body.bridgeId : void 0
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
var AppDataAccumulator = class {
|
|
126
|
+
cache = /* @__PURE__ */ new Map();
|
|
127
|
+
// Bridges in insertion order — drives the `bridges` array (stable tab order).
|
|
128
|
+
bridgeOrder = [];
|
|
129
|
+
// Page path per bridge: set from `page_*` init's body.path (the page route).
|
|
130
|
+
bridgePagePath = /* @__PURE__ */ new Map();
|
|
131
|
+
recordBridge(bridgeId) {
|
|
132
|
+
if (!this.bridgeOrder.includes(bridgeId))
|
|
133
|
+
this.bridgeOrder.push(bridgeId);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Apply one entry. Returns true if it was accepted (a mutation worth
|
|
137
|
+
* republishing), false if dropped (missing ids, or the init-gate).
|
|
138
|
+
*/
|
|
139
|
+
apply(input) {
|
|
140
|
+
if (!input.bridgeId || !input.moduleId)
|
|
141
|
+
return false;
|
|
142
|
+
if (input.mode !== "init" && !this.bridgePagePath.has(input.bridgeId))
|
|
143
|
+
return false;
|
|
144
|
+
const key = `${input.bridgeId}/${input.moduleId}`;
|
|
145
|
+
const prev = this.cache.get(key);
|
|
146
|
+
const incoming = input.data && typeof input.data === "object" ? input.data : {};
|
|
147
|
+
const merged = input.mode === "init" ? { ...incoming } : { ...prev?.data ?? {}, ...incoming };
|
|
148
|
+
const componentPath = input.componentPath ?? prev?.componentPath;
|
|
149
|
+
const next = componentPath !== void 0 ? { componentPath, data: merged } : { data: merged };
|
|
150
|
+
this.cache.set(key, next);
|
|
151
|
+
this.recordBridge(input.bridgeId);
|
|
152
|
+
if (input.mode === "init" && input.moduleId.startsWith("page_") && input.componentPath) {
|
|
153
|
+
this.bridgePagePath.set(input.bridgeId, input.componentPath);
|
|
154
|
+
}
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
/** Evict every entry for a bridge (page teardown). */
|
|
158
|
+
clearBridge(bridgeId) {
|
|
159
|
+
const prefix = `${bridgeId}/`;
|
|
160
|
+
for (const key of [...this.cache.keys()]) {
|
|
161
|
+
if (key.startsWith(prefix))
|
|
162
|
+
this.cache.delete(key);
|
|
163
|
+
}
|
|
164
|
+
const idx = this.bridgeOrder.indexOf(bridgeId);
|
|
165
|
+
if (idx >= 0)
|
|
166
|
+
this.bridgeOrder.splice(idx, 1);
|
|
167
|
+
this.bridgePagePath.delete(bridgeId);
|
|
168
|
+
}
|
|
169
|
+
/** The full cumulative snapshot for the panel. */
|
|
170
|
+
snapshot() {
|
|
171
|
+
const bridges = [];
|
|
172
|
+
for (const id of this.bridgeOrder) {
|
|
173
|
+
bridges.push({ id, pagePath: this.bridgePagePath.get(id) ?? null });
|
|
174
|
+
}
|
|
175
|
+
const entries = {};
|
|
176
|
+
for (const [key, entry] of this.cache) {
|
|
177
|
+
const slash = key.indexOf("/");
|
|
178
|
+
if (slash < 0)
|
|
179
|
+
continue;
|
|
180
|
+
const bridgeId = key.slice(0, slash);
|
|
181
|
+
const moduleId = key.slice(slash + 1);
|
|
182
|
+
if (!entries[bridgeId])
|
|
183
|
+
entries[bridgeId] = {};
|
|
184
|
+
const displayKey = entry.componentPath ?? moduleId;
|
|
185
|
+
entries[bridgeId][displayKey] = entry.data;
|
|
186
|
+
}
|
|
187
|
+
return { bridges, entries };
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The current reactive page state for a bridge: shallow-merge of `entry.data`
|
|
191
|
+
* across every cache entry whose key starts with `${bridgeId}/`, in insertion
|
|
192
|
+
* order (later entries win on key conflicts). `{}` when no entries match
|
|
193
|
+
* (unknown bridge / after clearBridge). Pure, no side effects.
|
|
194
|
+
*/
|
|
195
|
+
pageData(bridgeId) {
|
|
196
|
+
const merged = {};
|
|
197
|
+
for (const [key, entry] of this.cache) {
|
|
198
|
+
const slash = key.indexOf("/");
|
|
199
|
+
if (slash < 0)
|
|
200
|
+
continue;
|
|
201
|
+
if (key.slice(0, slash) !== bridgeId)
|
|
202
|
+
continue;
|
|
203
|
+
Object.assign(merged, entry.data);
|
|
204
|
+
}
|
|
205
|
+
return merged;
|
|
206
|
+
}
|
|
207
|
+
/** Flat `key → data` map for the `__simulatorData.getAppdata()` mirror. */
|
|
208
|
+
flat() {
|
|
209
|
+
const data = {};
|
|
210
|
+
for (const [key, entry] of this.cache)
|
|
211
|
+
data[key] = entry.data;
|
|
212
|
+
return data;
|
|
213
|
+
}
|
|
214
|
+
clear() {
|
|
215
|
+
this.cache.clear();
|
|
216
|
+
this.bridgeOrder.length = 0;
|
|
217
|
+
this.bridgePagePath.clear();
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
59
221
|
// src/preload/runtime/bridge.ts
|
|
60
222
|
var state = {
|
|
61
223
|
appdata: { gen: 0, ready: true, data: {} },
|
|
@@ -388,146 +550,6 @@ function installConsoleInstrumentation() {
|
|
|
388
550
|
};
|
|
389
551
|
}
|
|
390
552
|
|
|
391
|
-
// src/shared/appdata-accumulator.ts
|
|
392
|
-
function parseMessagePayload(message) {
|
|
393
|
-
if (typeof message !== "string") return message;
|
|
394
|
-
try {
|
|
395
|
-
return JSON.parse(message);
|
|
396
|
-
} catch {
|
|
397
|
-
return null;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function decodeUpdateBatchBody(rawBody) {
|
|
401
|
-
const body = rawBody;
|
|
402
|
-
if (!body || typeof body !== "object") return null;
|
|
403
|
-
if (typeof body.bridgeId !== "string" || !Array.isArray(body.updates)) return null;
|
|
404
|
-
const out = [];
|
|
405
|
-
for (const u of body.updates) {
|
|
406
|
-
if (!u || typeof u.moduleId !== "string") continue;
|
|
407
|
-
if (!u.moduleId.startsWith("page_")) continue;
|
|
408
|
-
out.push({ mode: "patch", bridgeId: body.bridgeId, moduleId: u.moduleId, data: u.data });
|
|
409
|
-
}
|
|
410
|
-
return out.length > 0 ? out : null;
|
|
411
|
-
}
|
|
412
|
-
function decodePageInitBody(moduleId, rawBody) {
|
|
413
|
-
const body = rawBody;
|
|
414
|
-
if (!body || typeof body !== "object") return null;
|
|
415
|
-
if (typeof body.bridgeId !== "string" || typeof body.path !== "string") return null;
|
|
416
|
-
if (!body.data || typeof body.data !== "object") return null;
|
|
417
|
-
return [{
|
|
418
|
-
mode: "init",
|
|
419
|
-
bridgeId: body.bridgeId,
|
|
420
|
-
moduleId,
|
|
421
|
-
componentPath: body.path,
|
|
422
|
-
data: body.data
|
|
423
|
-
}];
|
|
424
|
-
}
|
|
425
|
-
function decodeWorkerMessage(message) {
|
|
426
|
-
const payload = parseMessagePayload(message);
|
|
427
|
-
if (!payload || typeof payload !== "object") return null;
|
|
428
|
-
const record = payload;
|
|
429
|
-
if (record.type === "ub") return decodeUpdateBatchBody(record.body);
|
|
430
|
-
if (typeof record.type === "string" && record.type.startsWith("page_")) {
|
|
431
|
-
return decodePageInitBody(record.type, record.body);
|
|
432
|
-
}
|
|
433
|
-
return null;
|
|
434
|
-
}
|
|
435
|
-
function decodeOutgoingMessage(message) {
|
|
436
|
-
const payload = parseMessagePayload(message);
|
|
437
|
-
if (!payload || typeof payload !== "object") return null;
|
|
438
|
-
const r = payload;
|
|
439
|
-
if (typeof r.type !== "string") return null;
|
|
440
|
-
return {
|
|
441
|
-
type: r.type,
|
|
442
|
-
bridgeId: typeof r.body?.bridgeId === "string" ? r.body.bridgeId : void 0
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
var AppDataAccumulator = class {
|
|
446
|
-
cache = /* @__PURE__ */ new Map();
|
|
447
|
-
// Bridges in insertion order — drives the `bridges` array (stable tab order).
|
|
448
|
-
bridgeOrder = [];
|
|
449
|
-
// Page path per bridge: set from `page_*` init's body.path (the page route).
|
|
450
|
-
bridgePagePath = /* @__PURE__ */ new Map();
|
|
451
|
-
recordBridge(bridgeId) {
|
|
452
|
-
if (!this.bridgeOrder.includes(bridgeId)) this.bridgeOrder.push(bridgeId);
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Apply one entry. Returns true if it was accepted (a mutation worth
|
|
456
|
-
* republishing), false if dropped (missing ids, or the init-gate).
|
|
457
|
-
*/
|
|
458
|
-
apply(input) {
|
|
459
|
-
if (!input.bridgeId || !input.moduleId) return false;
|
|
460
|
-
if (input.mode !== "init" && !this.bridgePagePath.has(input.bridgeId)) return false;
|
|
461
|
-
const key = `${input.bridgeId}/${input.moduleId}`;
|
|
462
|
-
const prev = this.cache.get(key);
|
|
463
|
-
const incoming = input.data && typeof input.data === "object" ? input.data : {};
|
|
464
|
-
const merged = input.mode === "init" ? { ...incoming } : { ...prev?.data ?? {}, ...incoming };
|
|
465
|
-
const componentPath = input.componentPath ?? prev?.componentPath;
|
|
466
|
-
const next = componentPath !== void 0 ? { componentPath, data: merged } : { data: merged };
|
|
467
|
-
this.cache.set(key, next);
|
|
468
|
-
this.recordBridge(input.bridgeId);
|
|
469
|
-
if (input.mode === "init" && input.moduleId.startsWith("page_") && input.componentPath) {
|
|
470
|
-
this.bridgePagePath.set(input.bridgeId, input.componentPath);
|
|
471
|
-
}
|
|
472
|
-
return true;
|
|
473
|
-
}
|
|
474
|
-
/** Evict every entry for a bridge (page teardown). */
|
|
475
|
-
clearBridge(bridgeId) {
|
|
476
|
-
const prefix = `${bridgeId}/`;
|
|
477
|
-
for (const key of [...this.cache.keys()]) {
|
|
478
|
-
if (key.startsWith(prefix)) this.cache.delete(key);
|
|
479
|
-
}
|
|
480
|
-
const idx = this.bridgeOrder.indexOf(bridgeId);
|
|
481
|
-
if (idx >= 0) this.bridgeOrder.splice(idx, 1);
|
|
482
|
-
this.bridgePagePath.delete(bridgeId);
|
|
483
|
-
}
|
|
484
|
-
/** The full cumulative snapshot for the panel. */
|
|
485
|
-
snapshot() {
|
|
486
|
-
const bridges = [];
|
|
487
|
-
for (const id of this.bridgeOrder) {
|
|
488
|
-
bridges.push({ id, pagePath: this.bridgePagePath.get(id) ?? null });
|
|
489
|
-
}
|
|
490
|
-
const entries = {};
|
|
491
|
-
for (const [key, entry] of this.cache) {
|
|
492
|
-
const slash = key.indexOf("/");
|
|
493
|
-
if (slash < 0) continue;
|
|
494
|
-
const bridgeId = key.slice(0, slash);
|
|
495
|
-
const moduleId = key.slice(slash + 1);
|
|
496
|
-
if (!entries[bridgeId]) entries[bridgeId] = {};
|
|
497
|
-
const displayKey = entry.componentPath ?? moduleId;
|
|
498
|
-
entries[bridgeId][displayKey] = entry.data;
|
|
499
|
-
}
|
|
500
|
-
return { bridges, entries };
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* The current reactive page state for a bridge: shallow-merge of `entry.data`
|
|
504
|
-
* across every cache entry whose key starts with `${bridgeId}/`, in insertion
|
|
505
|
-
* order (later entries win on key conflicts). `{}` when no entries match
|
|
506
|
-
* (unknown bridge / after clearBridge). Pure, no side effects.
|
|
507
|
-
*/
|
|
508
|
-
pageData(bridgeId) {
|
|
509
|
-
const merged = {};
|
|
510
|
-
for (const [key, entry] of this.cache) {
|
|
511
|
-
const slash = key.indexOf("/");
|
|
512
|
-
if (slash < 0) continue;
|
|
513
|
-
if (key.slice(0, slash) !== bridgeId) continue;
|
|
514
|
-
Object.assign(merged, entry.data);
|
|
515
|
-
}
|
|
516
|
-
return merged;
|
|
517
|
-
}
|
|
518
|
-
/** Flat `key → data` map for the `__simulatorData.getAppdata()` mirror. */
|
|
519
|
-
flat() {
|
|
520
|
-
const data = {};
|
|
521
|
-
for (const [key, entry] of this.cache) data[key] = entry.data;
|
|
522
|
-
return data;
|
|
523
|
-
}
|
|
524
|
-
clear() {
|
|
525
|
-
this.cache.clear();
|
|
526
|
-
this.bridgeOrder.length = 0;
|
|
527
|
-
this.bridgePagePath.clear();
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
|
|
531
553
|
// src/preload/instrumentation/app-data.ts
|
|
532
554
|
function createAppDataSource() {
|
|
533
555
|
const accumulator = new AppDataAccumulator();
|