@dimina-kit/devtools 0.3.1-dev.20260518114324 → 0.3.2-dev.20260522085907
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 +33 -71
- package/dist/main/app/app.js +5 -0
- package/dist/main/app/bootstrap.js +2 -1
- package/dist/main/app/launch.d.ts +1 -1
- package/dist/main/app/launch.js +6 -7
- package/dist/main/index.bundle.js +306 -317
- package/dist/main/ipc/panels.js +3 -5
- package/dist/main/ipc/projects.d.ts +1 -1
- package/dist/main/ipc/projects.js +5 -5
- package/dist/main/ipc/settings.d.ts +1 -1
- package/dist/main/ipc/settings.js +14 -1
- package/dist/main/ipc/simulator.d.ts +1 -1
- package/dist/main/ipc/simulator.js +1 -10
- package/dist/main/services/automation/exec.d.ts +2 -0
- package/dist/main/services/automation/exec.js +7 -9
- package/dist/main/services/automation/handlers/app.js +37 -51
- package/dist/main/services/automation/handlers/element.js +27 -41
- package/dist/main/services/default-adapter.js +3 -3
- package/dist/main/services/mcp/index.d.ts +1 -0
- package/dist/main/services/mcp/index.js +1 -0
- package/dist/main/services/mcp/server.js +5 -0
- package/dist/main/services/mcp/status.d.ts +10 -0
- package/dist/main/services/mcp/status.js +14 -0
- package/dist/main/services/mcp/target-manager.js +2 -1
- package/dist/main/services/notifications/renderer-notifier.d.ts +3 -3
- package/dist/main/services/notifications/renderer-notifier.js +3 -6
- package/dist/main/services/projects/local-provider.js +3 -3
- package/dist/main/services/projects/project-repository.d.ts +0 -1
- package/dist/main/services/settings/index.js +2 -1
- package/dist/main/services/simulator-storage/index.js +47 -77
- package/dist/main/services/views/view-manager.d.ts +3 -7
- package/dist/main/services/views/view-manager.js +20 -27
- package/dist/main/services/window-service.d.ts +3 -3
- package/dist/main/services/workbench-context.d.ts +3 -6
- package/dist/main/services/workbench-context.js +1 -3
- package/dist/main/services/workspace/workspace-service.js +8 -24
- package/dist/main/utils/theme.d.ts +24 -0
- package/dist/main/utils/theme.js +38 -1
- package/dist/preload/index.d.ts +5 -2
- package/dist/preload/index.js +3 -2
- package/dist/preload/instrumentation/app-data.d.ts +32 -2
- package/dist/preload/instrumentation/app-data.js +187 -172
- package/dist/preload/instrumentation/index.d.ts +2 -2
- package/dist/preload/instrumentation/index.js +2 -2
- package/dist/preload/instrumentation/wxml.d.ts +16 -4
- package/dist/preload/instrumentation/wxml.js +188 -178
- package/dist/preload/miniapp-snapshot/host.d.ts +12 -0
- package/dist/preload/miniapp-snapshot/host.js +117 -0
- package/dist/preload/miniapp-snapshot/types.d.ts +62 -0
- package/dist/preload/miniapp-snapshot/types.js +15 -0
- package/dist/preload/runtime/bridge.js +5 -24
- package/dist/preload/runtime/custom-apis.d.ts +1 -1
- package/dist/preload/runtime/custom-apis.js +3 -7
- package/dist/preload/shared/expose.d.ts +15 -0
- package/dist/preload/shared/expose.js +33 -0
- package/dist/preload/shared/page-iframe.d.ts +3 -0
- package/dist/preload/shared/page-iframe.js +6 -0
- package/dist/preload/shared/types.d.ts +2 -0
- package/dist/preload/windows/simulator.js +400 -348
- package/dist/renderer/assets/constants-DI382mTP.js +2 -0
- package/dist/renderer/assets/index-D8VFYBh-.js +46 -0
- package/dist/renderer/assets/{input-DqVQNCx_.js → input-CoWcfa8u.js} +2 -2
- package/dist/renderer/assets/ipc-transport-Cd2xPrsa.js +9 -0
- package/dist/renderer/assets/popover-Nq5gT9DO.js +2 -0
- package/dist/renderer/assets/select-By5KH-UG.js +2 -0
- package/dist/renderer/assets/{settings-BFNfnYvU.js → settings-Dj_N70qR.js} +2 -2
- package/dist/renderer/assets/settings-api-Do0_Smq1.js +2 -0
- package/dist/renderer/assets/workbenchSettings-CazSLGYt.js +8 -0
- package/dist/renderer/entries/main/index.html +5 -4
- package/dist/renderer/entries/popover/index.html +5 -4
- package/dist/renderer/entries/settings/index.html +4 -4
- package/dist/renderer/entries/workbench-settings/index.html +4 -3
- package/dist/shared/ipc-channels.d.ts +4 -12
- package/dist/shared/ipc-channels.js +10 -14
- package/dist/shared/simulator-route.d.ts +72 -0
- package/dist/shared/simulator-route.js +169 -0
- package/dist/shared/types.d.ts +2 -10
- package/dist/simulator/assets/simulator-DJCozrU5.js +9 -0
- package/dist/simulator/simulator.html +6 -43
- package/package.json +4 -4
- package/dist/preload/instrumentation/disposable.d.ts +0 -11
- package/dist/preload/instrumentation/disposable.js +0 -15
- package/dist/renderer/assets/index-Czz_bp6b.js +0 -46
- package/dist/renderer/assets/ipc-transport-CCHrCtDr.js +0 -9
- package/dist/renderer/assets/popover-BRg4XI_w.js +0 -2
- package/dist/renderer/assets/select-CvILHHZU.js +0 -2
- package/dist/renderer/assets/settings-api-DOAgmBst.js +0 -2
- package/dist/renderer/assets/workbenchSettings-DjVMgMMH.js +0 -8
- package/dist/simulator/assets/simulator-DL6kOCq-.js +0 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ipcRenderer } from 'electron';
|
|
2
2
|
import { SimulatorCustomApiBridgeChannel } from '../../shared/ipc-channels.js';
|
|
3
|
+
import { exposeOnMainWorld } from '../shared/expose.js';
|
|
3
4
|
// The simulator <webview> is intentionally kept off the workbench sender-policy
|
|
4
5
|
// white-list, so it cannot reach `ipcMain.handle` directly. Instead the bridge
|
|
5
6
|
// asks the trusted main-window renderer to proxy the call: webview sends via
|
|
@@ -37,11 +38,6 @@ function buildBridge() {
|
|
|
37
38
|
}
|
|
38
39
|
export function installCustomApisBridge() {
|
|
39
40
|
const bridge = buildBridge();
|
|
40
|
-
|
|
41
|
-
contextBridge.exposeInMainWorld('__diminaCustomApis', bridge);
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
window.__diminaCustomApis = bridge;
|
|
45
|
-
}
|
|
41
|
+
return exposeOnMainWorld('__diminaCustomApis', bridge);
|
|
46
42
|
}
|
|
47
43
|
//# sourceMappingURL=custom-apis.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expose `value` on the renderer's main world under `key`.
|
|
3
|
+
*
|
|
4
|
+
* Prefers Electron's `contextBridge` (the path that works with
|
|
5
|
+
* `contextIsolation: true`). When `contextBridge` is unavailable — e.g. a
|
|
6
|
+
* webview running without context isolation — it falls back to assigning
|
|
7
|
+
* `value` directly onto the preload realm's `window`.
|
|
8
|
+
*
|
|
9
|
+
* Returns a disposer. It can only undo the fallback assignment (a
|
|
10
|
+
* `contextBridge` binding cannot be un-exposed); on the contextBridge path
|
|
11
|
+
* the disposer is a no-op. The disposer never clobbers a `window[key]` that
|
|
12
|
+
* something else has since reassigned.
|
|
13
|
+
*/
|
|
14
|
+
export declare function exposeOnMainWorld(key: string, value: unknown): () => void;
|
|
15
|
+
//# sourceMappingURL=expose.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { contextBridge } from 'electron';
|
|
2
|
+
/**
|
|
3
|
+
* Expose `value` on the renderer's main world under `key`.
|
|
4
|
+
*
|
|
5
|
+
* Prefers Electron's `contextBridge` (the path that works with
|
|
6
|
+
* `contextIsolation: true`). When `contextBridge` is unavailable — e.g. a
|
|
7
|
+
* webview running without context isolation — it falls back to assigning
|
|
8
|
+
* `value` directly onto the preload realm's `window`.
|
|
9
|
+
*
|
|
10
|
+
* Returns a disposer. It can only undo the fallback assignment (a
|
|
11
|
+
* `contextBridge` binding cannot be un-exposed); on the contextBridge path
|
|
12
|
+
* the disposer is a no-op. The disposer never clobbers a `window[key]` that
|
|
13
|
+
* something else has since reassigned.
|
|
14
|
+
*/
|
|
15
|
+
export function exposeOnMainWorld(key, value) {
|
|
16
|
+
let fellBack = false;
|
|
17
|
+
try {
|
|
18
|
+
contextBridge.exposeInMainWorld(key, value);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
;
|
|
22
|
+
window[key] = value;
|
|
23
|
+
fellBack = true;
|
|
24
|
+
}
|
|
25
|
+
return () => {
|
|
26
|
+
if (!fellBack)
|
|
27
|
+
return;
|
|
28
|
+
const w = window;
|
|
29
|
+
if (w[key] === value)
|
|
30
|
+
delete w[key];
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=expose.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Locate the active page's webview iframe — the last one in the simulator stack. */
|
|
2
|
+
export function getActivePageIframe() {
|
|
3
|
+
const iframes = document.querySelectorAll('.dimina-native-webview__window');
|
|
4
|
+
return iframes.length > 0 ? iframes[iframes.length - 1] : null;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=page-iframe.js.map
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Snapshot, StorageSnapshot, WxmlNode } from '../runtime/bridge.js';
|
|
8
8
|
import type { ElementInspection } from '../../shared/ipc-channels.js';
|
|
9
|
+
import type { MiniappSnapshotApi } from '../miniapp-snapshot/types.js';
|
|
9
10
|
/** The simulator data bridge exposed via contextBridge. */
|
|
10
11
|
export interface SimulatorDataBridge {
|
|
11
12
|
getAppdata: () => Record<string, unknown>;
|
|
@@ -30,6 +31,7 @@ declare global {
|
|
|
30
31
|
__simulatorData?: SimulatorDataBridge;
|
|
31
32
|
__deviceInfo?: unknown;
|
|
32
33
|
__simulatorHook?: SimulatorHook;
|
|
34
|
+
__miniappSnapshot?: MiniappSnapshotApi;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
//# sourceMappingURL=types.d.ts.map
|