@dimina-kit/devtools 0.4.0 → 0.5.0-dev.20260908120530
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 +51 -660
- package/dist/main/api.d.ts +2 -1
- package/dist/main/app/app.d.ts +41 -12
- package/dist/main/app/app.js +299 -514
- package/dist/main/app/bootstrap.d.ts +8 -5
- package/dist/main/app/bootstrap.js +15 -15
- package/dist/main/app/editor-view.d.ts +21 -0
- package/dist/main/app/editor-view.js +71 -0
- package/dist/main/app/global-mirrors.d.ts +23 -0
- package/dist/main/app/global-mirrors.js +37 -0
- package/dist/main/app/host-sidebar-default.d.ts +19 -0
- package/dist/main/app/host-sidebar-default.js +44 -0
- package/dist/main/app/lifecycle.d.ts +12 -1
- package/dist/main/app/lifecycle.js +27 -1
- package/dist/main/app/menu-setup.d.ts +13 -0
- package/dist/main/app/menu-setup.js +49 -0
- package/dist/main/app/native-overview.d.ts +1 -1
- package/dist/main/app/open-project-ipc.d.ts +13 -0
- package/dist/main/app/open-project-ipc.js +21 -0
- package/dist/main/app/project-list-surface.d.ts +31 -0
- package/dist/main/app/project-list-surface.js +20 -0
- package/dist/main/app/project-window.d.ts +36 -0
- package/dist/main/app/project-window.js +93 -0
- package/dist/main/app/servers.d.ts +17 -0
- package/dist/main/app/servers.js +60 -0
- package/dist/main/app/ui-extension-targets.d.ts +42 -0
- package/dist/main/app/ui-extension-targets.js +101 -0
- package/dist/main/app/window-close-reveal.harness.d.ts +34 -0
- package/dist/main/app/window-close-reveal.harness.js +65 -0
- package/dist/main/app/window-events.d.ts +15 -0
- package/dist/main/app/window-events.js +45 -0
- package/dist/main/app/window-runtime-services.d.ts +41 -0
- package/dist/main/app/window-runtime-services.js +197 -0
- package/dist/main/app/workbench-modules.d.ts +24 -0
- package/dist/main/app/workbench-modules.js +51 -0
- package/dist/main/app/workbench-window.d.ts +85 -0
- package/dist/main/app/workbench-window.js +310 -0
- package/dist/main/index.bundle.js +11712 -9986
- package/dist/main/index.js +49 -1
- package/dist/main/ipc/app-lifecycle.d.ts +1 -31
- package/dist/main/ipc/app-lifecycle.js +1 -53
- package/dist/main/ipc/app.d.ts +4 -1
- package/dist/main/ipc/app.js +4 -3
- package/dist/main/ipc/bridge-router.d.ts +19 -116
- package/dist/main/ipc/bridge-router.js +28 -2128
- package/dist/main/ipc/device-picker.d.ts +16 -0
- package/dist/main/ipc/device-picker.js +27 -0
- package/dist/main/ipc/index.d.ts +5 -0
- package/dist/main/ipc/index.js +5 -0
- package/dist/main/ipc/internal-devtools.d.ts +16 -0
- package/dist/main/ipc/internal-devtools.js +10 -0
- package/dist/main/ipc/page-scroll.d.ts +1 -13
- package/dist/main/ipc/page-scroll.js +1 -16
- package/dist/main/ipc/popover.d.ts +4 -1
- package/dist/main/ipc/popover.js +26 -19
- package/dist/main/ipc/project-create.d.ts +16 -0
- package/dist/main/ipc/project-create.js +27 -0
- package/dist/main/ipc/project-fs.d.ts +38 -3
- package/dist/main/ipc/project-fs.js +53 -22
- package/dist/main/ipc/projects.d.ts +3 -3
- package/dist/main/ipc/projects.js +47 -11
- package/dist/main/ipc/session-listener-bag.d.ts +1 -40
- package/dist/main/ipc/session-listener-bag.js +1 -39
- package/dist/main/ipc/session.d.ts +4 -1
- package/dist/main/ipc/session.js +26 -26
- package/dist/main/ipc/settings.d.ts +4 -1
- package/dist/main/ipc/settings.js +17 -19
- package/dist/main/ipc/simulator-module.d.ts +9 -3
- package/dist/main/ipc/simulator-module.js +13 -10
- package/dist/main/ipc/simulator.d.ts +4 -1
- package/dist/main/ipc/simulator.js +12 -18
- package/dist/main/ipc/tooltip.d.ts +14 -0
- package/dist/main/ipc/tooltip.js +29 -0
- package/dist/main/ipc/views.d.ts +19 -2
- package/dist/main/ipc/views.js +76 -8
- package/dist/main/runtime/devtools-backend-before-quit.harness.d.ts +43 -0
- package/dist/main/runtime/devtools-backend-before-quit.harness.js +87 -0
- package/dist/main/runtime/devtools-backend.js +60 -4
- package/dist/main/runtime/devtools-runtime-mock.harness.d.ts +21 -0
- package/dist/main/runtime/devtools-runtime-mock.harness.js +313 -0
- package/dist/main/runtime/miniapp-runtime.d.ts +91 -22
- package/dist/main/services/app-services.d.ts +62 -0
- package/dist/main/services/app-services.js +64 -0
- package/dist/main/services/automation/connection-target.d.ts +36 -0
- package/dist/main/services/automation/connection-target.js +29 -0
- package/dist/main/services/automation/console-bridge.d.ts +28 -0
- package/dist/main/services/automation/console-bridge.js +91 -0
- package/dist/main/services/automation/handlers/app.js +4 -4
- package/dist/main/services/automation/handlers/element.js +55 -21
- package/dist/main/services/automation/index.d.ts +12 -1
- package/dist/main/services/automation/index.js +54 -133
- package/dist/main/services/cdp-session/index.d.ts +87 -0
- package/dist/main/services/cdp-session/index.js +173 -0
- package/dist/main/services/compile-standby.js +4 -0
- package/dist/main/services/console-forward/cdp-inject.d.ts +18 -0
- package/dist/main/services/console-forward/cdp-inject.js +30 -0
- package/dist/main/services/console-forward/global-console-mirror.d.ts +33 -0
- package/dist/main/services/console-forward/global-console-mirror.js +71 -0
- package/dist/main/services/console-forward/global-diagnostics-mirror.d.ts +33 -0
- package/dist/main/services/console-forward/global-diagnostics-mirror.js +73 -0
- package/dist/main/services/console-forward/index.d.ts +1 -46
- package/dist/main/services/console-forward/index.js +1 -185
- package/dist/main/services/console-forward/internal-log.d.ts +2 -0
- package/dist/main/services/console-forward/internal-log.js +2 -0
- package/dist/main/services/console-forward/open-gated-relay.d.ts +67 -0
- package/dist/main/services/console-forward/open-gated-relay.js +55 -0
- package/dist/main/services/default-adapter.js +1 -1
- package/dist/main/services/diagnostics/index.d.ts +1 -48
- package/dist/main/services/diagnostics/index.js +1 -60
- package/dist/main/services/dimina-resource-server.d.ts +1 -6
- package/dist/main/services/dimina-resource-server.js +1 -98
- package/dist/main/services/elements-forward/index.d.ts +132 -15
- package/dist/main/services/elements-forward/index.js +155 -304
- package/dist/main/services/fs-bridge-protocol.d.ts +61 -0
- package/dist/main/services/fs-bridge-protocol.js +34 -0
- package/dist/main/services/fs-watch-sse.d.ts +40 -0
- package/dist/main/services/fs-watch-sse.js +113 -0
- package/dist/main/services/http-json.d.ts +9 -0
- package/dist/main/services/http-json.js +6 -0
- package/dist/main/services/layout/index.d.ts +11 -0
- package/dist/main/services/layout/index.js +23 -0
- package/dist/main/services/mcp/connection-owner.d.ts +38 -0
- package/dist/main/services/mcp/connection-owner.js +79 -0
- package/dist/main/services/mcp/index.d.ts +3 -1
- package/dist/main/services/mcp/index.js +4 -3
- package/dist/main/services/mcp/opened-project.d.ts +88 -0
- package/dist/main/services/mcp/opened-project.js +60 -0
- package/dist/main/services/mcp/server.d.ts +2 -1
- package/dist/main/services/mcp/server.js +29 -4
- package/dist/main/services/mcp/target-manager.d.ts +71 -23
- package/dist/main/services/mcp/target-manager.js +269 -138
- package/dist/main/services/mcp/target-selection.d.ts +47 -0
- package/dist/main/services/mcp/target-selection.js +71 -0
- package/dist/main/services/mcp/tools/context-tools.js +20 -5
- package/dist/main/services/mcp/tools/project-tools.d.ts +72 -0
- package/dist/main/services/mcp/tools/project-tools.js +133 -0
- package/dist/main/services/module.d.ts +13 -5
- package/dist/main/services/network-forward/body-cache.d.ts +72 -0
- package/dist/main/services/network-forward/body-cache.js +179 -0
- package/dist/main/services/network-forward/frontend-dispatch.d.ts +91 -0
- package/dist/main/services/network-forward/frontend-dispatch.js +148 -0
- package/dist/main/services/network-forward/global-body-gate.d.ts +46 -0
- package/dist/main/services/network-forward/global-body-gate.js +93 -0
- package/dist/main/services/network-forward/global-mirror-test-fixtures.d.ts +48 -0
- package/dist/main/services/network-forward/global-mirror-test-fixtures.js +96 -0
- package/dist/main/services/network-forward/http.d.ts +47 -0
- package/dist/main/services/network-forward/http.js +162 -0
- package/dist/main/services/network-forward/index.d.ts +135 -15
- package/dist/main/services/network-forward/index.js +854 -224
- package/dist/main/services/network-forward/request-ids.d.ts +5 -0
- package/dist/main/services/network-forward/request-ids.js +5 -0
- package/dist/main/services/network-forward/user-facing.d.ts +21 -0
- package/dist/main/services/network-forward/user-facing.js +50 -0
- package/dist/main/services/network-forward/websocket.d.ts +36 -0
- package/dist/main/services/network-forward/websocket.js +120 -0
- package/dist/main/services/notifications/renderer-notifier.d.ts +71 -9
- package/dist/main/services/notifications/renderer-notifier.js +45 -8
- package/dist/main/services/projects/create-project-service.js +19 -5
- package/dist/main/services/projects/local-provider.js +8 -4
- package/dist/main/services/projects/project-repository.d.ts +59 -7
- package/dist/main/services/projects/project-repository.js +285 -51
- package/dist/main/services/projects/types.d.ts +44 -34
- package/dist/main/services/render-inspect/index.d.ts +12 -2
- package/dist/main/services/render-inspect/index.js +21 -102
- package/dist/main/services/safe-area/index.d.ts +21 -6
- package/dist/main/services/safe-area/index.js +92 -46
- package/dist/main/services/service-host-pool/pool.d.ts +1 -196
- package/dist/main/services/service-host-pool/pool.js +1 -363
- package/dist/main/services/settings/index.d.ts +7 -1
- package/dist/main/services/settings/index.js +22 -2
- package/dist/main/services/simulator/custom-apis.d.ts +1 -42
- package/dist/main/services/simulator/custom-apis.js +1 -46
- package/dist/main/services/simulator/referer.d.ts +1 -9
- package/dist/main/services/simulator/referer.js +1 -19
- package/dist/main/services/simulator/ui-extensions.d.ts +21 -0
- package/dist/main/services/simulator/ui-extensions.js +176 -0
- package/dist/main/services/simulator-appdata/index.d.ts +6 -0
- package/dist/main/services/simulator-appdata/index.js +21 -2
- package/dist/main/services/simulator-current-page/index.d.ts +5 -3
- package/dist/main/services/simulator-current-page/index.js +8 -1
- package/dist/main/services/simulator-storage/index.d.ts +34 -5
- package/dist/main/services/simulator-storage/index.js +73 -71
- package/dist/main/services/simulator-storage/service-storage-ops.d.ts +1 -39
- package/dist/main/services/simulator-storage/service-storage-ops.js +1 -66
- package/dist/main/services/simulator-storage/window-scope.d.ts +20 -0
- package/dist/main/services/simulator-storage/window-scope.js +20 -0
- package/dist/main/services/simulator-temp-files/disk.d.ts +1 -54
- package/dist/main/services/simulator-temp-files/disk.js +1 -237
- package/dist/main/services/simulator-temp-files/fs-channels.d.ts +1 -68
- package/dist/main/services/simulator-temp-files/fs-channels.js +1 -107
- package/dist/main/services/simulator-temp-files/index.d.ts +1 -32
- package/dist/main/services/simulator-temp-files/index.js +1 -181
- package/dist/main/services/simulator-temp-files/request-handler.d.ts +1 -29
- package/dist/main/services/simulator-temp-files/request-handler.js +1 -177
- package/dist/main/services/simulator-temp-files/resolver.d.ts +1 -21
- package/dist/main/services/simulator-temp-files/resolver.js +1 -21
- package/dist/main/services/simulator-temp-files/store.d.ts +1 -13
- package/dist/main/services/simulator-temp-files/store.js +1 -23
- package/dist/main/services/update/github-release-checker.js +22 -3
- package/dist/main/services/update/update-manager.d.ts +21 -4
- package/dist/main/services/update/update-manager.js +55 -11
- package/dist/main/services/views/clear-console-filter.d.ts +44 -0
- package/dist/main/services/views/clear-console-filter.js +86 -0
- package/dist/main/services/views/console-filter-test-fixtures.d.ts +94 -0
- package/dist/main/services/views/console-filter-test-fixtures.js +82 -0
- package/dist/main/services/views/console-filter.d.ts +94 -0
- package/dist/main/services/views/console-filter.js +190 -0
- package/dist/main/services/views/devtools-tabs.d.ts +24 -4
- package/dist/main/services/views/devtools-tabs.js +40 -21
- package/dist/main/services/views/frontend-bootstrap-gate.d.ts +59 -0
- package/dist/main/services/views/frontend-bootstrap-gate.js +117 -0
- package/dist/main/services/views/host-dialog-port-channel.d.ts +18 -0
- package/dist/main/services/views/host-dialog-port-channel.js +15 -0
- package/dist/main/services/views/host-dialog-session-runtime.d.ts +10 -0
- package/dist/main/services/views/host-dialog-session-runtime.js +17 -0
- package/dist/main/services/views/host-dialog-view.d.ts +95 -0
- package/dist/main/services/views/host-dialog-view.js +147 -0
- package/dist/main/services/views/host-sidebar-port-channel.d.ts +18 -0
- package/dist/main/services/views/host-sidebar-port-channel.js +15 -0
- package/dist/main/services/views/host-sidebar-session-runtime.d.ts +10 -0
- package/dist/main/services/views/host-sidebar-session-runtime.js +17 -0
- package/dist/main/services/views/host-sidebar-view.d.ts +59 -0
- package/dist/main/services/views/host-sidebar-view.js +44 -0
- package/dist/main/services/views/host-slot-port-channel.d.ts +124 -0
- package/dist/main/services/views/host-slot-port-channel.js +289 -0
- package/dist/main/services/views/host-slot-session-runtime.d.ts +40 -0
- package/dist/main/services/views/host-slot-session-runtime.js +50 -0
- package/dist/main/services/views/host-slot-view.d.ts +109 -0
- package/dist/main/services/views/host-slot-view.js +147 -0
- package/dist/main/services/views/host-toolbar-port-channel.d.ts +6 -91
- package/dist/main/services/views/host-toolbar-port-channel.js +10 -243
- package/dist/main/services/views/host-toolbar-session-runtime.d.ts +5 -30
- package/dist/main/services/views/host-toolbar-session-runtime.js +9 -47
- package/dist/main/services/views/host-toolbar-view.d.ts +34 -7
- package/dist/main/services/views/host-toolbar-view.js +30 -237
- package/dist/main/services/views/managed-web-contents-view.d.ts +48 -0
- package/dist/main/services/views/managed-web-contents-view.js +143 -0
- package/dist/main/services/views/miniapp-partition.d.ts +1 -89
- package/dist/main/services/views/miniapp-partition.js +1 -158
- package/dist/main/services/views/native-simulator-devtools-host.js +206 -68
- package/dist/main/services/views/native-simulator-view.d.ts +6 -0
- package/dist/main/services/views/native-simulator-view.js +47 -40
- package/dist/main/services/views/native-view-tree.d.ts +25 -0
- package/dist/main/services/views/native-view-tree.js +69 -0
- package/dist/main/services/views/overlay-panels-view.d.ts +63 -4
- package/dist/main/services/views/overlay-panels-view.js +257 -108
- package/dist/main/services/views/placement-reconciler.d.ts +18 -18
- package/dist/main/services/views/placement-reconciler.js +91 -29
- package/dist/main/services/views/placement-test-driver.d.ts +27 -0
- package/dist/main/services/views/placement-test-driver.js +29 -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/simulator-session-policy.d.ts +1 -27
- package/dist/main/services/views/simulator-session-policy.js +1 -98
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.d.ts +76 -0
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.js +184 -0
- package/dist/main/services/views/view-manager.d.ts +69 -88
- package/dist/main/services/views/view-manager.js +62 -7
- package/dist/main/services/views/workbench-view.d.ts +2 -0
- package/dist/main/services/views/workbench-view.js +104 -17
- package/dist/main/services/window-contexts/context-router.d.ts +36 -0
- package/dist/main/services/window-contexts/context-router.js +55 -0
- package/dist/main/services/workbench-coi-host.d.ts +52 -0
- package/dist/main/services/workbench-coi-host.js +227 -0
- package/dist/main/services/workbench-coi-server.d.ts +11 -0
- package/dist/main/services/workbench-coi-server.js +126 -126
- package/dist/main/services/workbench-coi-shutdown.d.ts +40 -0
- package/dist/main/services/workbench-coi-shutdown.js +69 -0
- package/dist/main/services/workbench-coi-static.d.ts +23 -0
- package/dist/main/services/workbench-coi-static.js +87 -0
- package/dist/main/services/workbench-context.d.ts +88 -8
- package/dist/main/services/workbench-context.js +54 -6
- package/dist/main/services/workspace/compile-log-buffer.d.ts +40 -0
- package/dist/main/services/workspace/compile-log-buffer.js +41 -0
- package/dist/main/services/workspace/compile-mode-adapter.d.ts +18 -0
- package/dist/main/services/workspace/compile-mode-adapter.js +57 -0
- package/dist/main/services/workspace/compile-mode-store.d.ts +25 -0
- package/dist/main/services/workspace/compile-mode-store.js +71 -0
- 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 +37 -0
- package/dist/main/services/workspace/rebuild-status.js +36 -0
- package/dist/main/services/workspace/session-status-store.d.ts +47 -0
- package/dist/main/services/workspace/session-status-store.js +73 -0
- package/dist/main/services/workspace/status-tap.d.ts +20 -0
- package/dist/main/services/workspace/status-tap.js +32 -0
- package/dist/main/services/workspace/workspace-compile-modes.d.ts +59 -0
- package/dist/main/services/workspace/workspace-compile-modes.js +93 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +22 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +62 -0
- package/dist/main/services/workspace/workspace-referer.d.ts +17 -0
- package/dist/main/services/workspace/workspace-referer.js +26 -0
- package/dist/main/services/workspace/workspace-service.d.ts +7 -5
- package/dist/main/services/workspace/workspace-service.js +96 -135
- package/dist/main/services/workspace/workspace-thumbnails.d.ts +22 -0
- package/dist/main/services/workspace/workspace-thumbnails.js +67 -0
- package/dist/main/utils/ipc-context-source.d.ts +40 -0
- package/dist/main/utils/ipc-context-source.js +23 -0
- package/dist/main/utils/ipc-registry.d.ts +46 -21
- package/dist/main/utils/ipc-registry.js +166 -76
- package/dist/main/utils/paths.d.ts +18 -0
- package/dist/main/utils/paths.js +18 -0
- package/dist/main/utils/sender-policy.d.ts +10 -1
- package/dist/main/utils/sender-policy.js +42 -4
- package/dist/main/utils/theme.d.ts +18 -8
- package/dist/main/utils/theme.js +19 -9
- package/dist/main/windows/internal-devtools-window/index.d.ts +66 -0
- package/dist/main/windows/internal-devtools-window/index.js +160 -0
- package/dist/main/windows/main-window/create.d.ts +16 -0
- package/dist/main/windows/main-window/create.js +19 -11
- package/dist/main/windows/main-window/events.d.ts +1 -1
- package/dist/main/windows/main-window/events.js +26 -13
- package/dist/main/windows/main-window/index.d.ts +1 -1
- package/dist/main/windows/main-window/index.js +1 -1
- package/dist/main/windows/service-host-window/create.d.ts +1 -92
- package/dist/main/windows/service-host-window/create.js +1 -154
- package/dist/native-host/common/common.js +173 -53
- package/dist/native-host/container/pageFrame.css +1 -1
- package/dist/native-host/render/render.js +8278 -3659
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/index.d.ts +2 -0
- package/dist/preload/index.js +1 -0
- package/dist/preload/instrumentation/app-data.d.ts +2 -2
- package/dist/preload/instrumentation/app-data.js +1 -1
- package/dist/preload/instrumentation/wxml.js +1 -1
- package/dist/preload/runtime/bridge.d.ts +3 -3
- package/dist/preload/runtime/bridge.js +2 -2
- package/dist/preload/runtime/clipboard.d.ts +6 -0
- package/dist/preload/runtime/clipboard.js +12 -0
- package/dist/preload/runtime/host-dialog-advertiser.d.ts +22 -0
- package/dist/preload/runtime/host-dialog-advertiser.js +37 -0
- package/dist/preload/runtime/host-dialog-port.d.ts +44 -0
- package/dist/preload/runtime/host-dialog-port.js +53 -0
- package/dist/preload/runtime/host-dialog-runtime.d.ts +28 -0
- package/dist/preload/runtime/host-dialog-runtime.js +36 -0
- package/dist/preload/runtime/host-sidebar-advertiser.d.ts +19 -0
- package/dist/preload/runtime/host-sidebar-advertiser.js +35 -0
- package/dist/preload/runtime/host-sidebar-port.d.ts +44 -0
- package/dist/preload/runtime/host-sidebar-port.js +53 -0
- package/dist/preload/runtime/host-sidebar-runtime.d.ts +28 -0
- package/dist/preload/runtime/host-sidebar-runtime.js +36 -0
- package/dist/preload/runtime/host-slot-port-bridge.d.ts +18 -0
- package/dist/preload/runtime/host-slot-port-bridge.js +112 -0
- package/dist/preload/runtime/host-toolbar-advertiser.d.ts +5 -13
- package/dist/preload/runtime/host-toolbar-advertiser.js +18 -38
- package/dist/preload/runtime/host-toolbar-port.d.ts +9 -0
- package/dist/preload/runtime/host-toolbar-port.js +11 -95
- package/dist/preload/runtime/native-host.d.ts +14 -0
- package/dist/preload/runtime/native-host.js +5 -8
- package/dist/preload/runtime/node-bindings.d.ts +18 -0
- package/dist/preload/runtime/node-bindings.js +44 -0
- package/dist/preload/runtime/temp-files.js +9 -2
- package/dist/preload/runtime/wait-for-slot-root.d.ts +23 -0
- package/dist/preload/runtime/wait-for-slot-root.js +80 -0
- package/dist/preload/shared/api-compat.js +63 -41
- package/dist/preload/windows/host-dialog-runtime.cjs +360 -0
- package/dist/preload/windows/host-dialog-runtime.cjs.map +7 -0
- package/dist/preload/windows/host-dialog-runtime.d.ts +2 -0
- package/dist/preload/windows/host-dialog-runtime.js +13 -0
- package/dist/preload/windows/host-sidebar-runtime.cjs +361 -0
- package/dist/preload/windows/host-sidebar-runtime.cjs.map +7 -0
- package/dist/preload/windows/host-sidebar-runtime.d.ts +2 -0
- package/dist/preload/windows/host-sidebar-runtime.js +13 -0
- package/dist/preload/windows/host-toolbar-runtime.cjs +142 -52
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +3 -3
- package/dist/preload/windows/main.cjs +4922 -1246
- package/dist/preload/windows/main.cjs.map +4 -4
- package/dist/preload/windows/main.css +428 -0
- package/dist/preload/windows/main.css.map +7 -0
- package/dist/preload/windows/simulator.cjs +376 -322
- package/dist/preload/windows/simulator.cjs.map +4 -4
- package/dist/preload/windows/simulator.js +376 -322
- package/dist/render-host/pageFrame.html +4 -4
- package/dist/render-host/preload.cjs +30 -0
- package/dist/render-host/render-inspect.js +184 -115
- package/dist/renderer/assets/button-CB2MWjHY.js +2 -0
- package/dist/renderer/assets/constants-CkoGPQTS.js +2 -0
- package/dist/renderer/assets/constants-zQZ2-y21.js +2 -0
- package/dist/renderer/assets/createLucideIcon-cZ9FlZZw.js +2 -0
- package/dist/renderer/assets/devicePicker-H2eIO4e1.js +2 -0
- package/dist/renderer/assets/dialog-pHzEA8Vx.js +46 -0
- package/dist/renderer/assets/dist-B5HADirS.js +2 -0
- package/dist/renderer/assets/dist-DIFlRMKe.js +2 -0
- package/dist/renderer/assets/hostSidebarDefault-DRWh6OCt.js +2 -0
- package/dist/renderer/assets/index-CEL_XFge.js +2 -0
- package/dist/renderer/assets/input-CAObw95L.js +2 -0
- package/dist/renderer/assets/ipc-channels-overlays-gIPUFnqc.js +2 -0
- package/dist/renderer/assets/jsx-runtime-DICEQH_0.css +1 -0
- package/dist/renderer/assets/jsx-runtime-DIw5wnYl.js +9 -0
- package/dist/renderer/assets/plus-BQ9u5EbL.js +2 -0
- package/dist/renderer/assets/popover-Cw7G2Ctp.js +2 -0
- package/dist/renderer/assets/presets-DMZOb9ay.js +2 -0
- package/dist/renderer/assets/project-api-YTOr_Yvo.js +2 -0
- package/dist/renderer/assets/projectCreateDialog-BmLqiYxn.js +2 -0
- package/dist/renderer/assets/search-BMvuYF48.js +2 -0
- package/dist/renderer/assets/select-nFP95TxM.js +2 -0
- package/dist/renderer/assets/settings-CnpVfSWt.js +2 -0
- package/dist/renderer/assets/settings-api-Ccsf-Nsj.js +2 -0
- package/dist/renderer/assets/settings-tab-bar-CAzrv32m.js +2 -0
- package/dist/renderer/assets/smartphone-Bb2GdIKy.js +2 -0
- package/dist/renderer/assets/tabs-CPKN3Mmq.js +2 -0
- package/dist/renderer/assets/tooltip-D6AxXRk5.js +2 -0
- package/dist/renderer/assets/types-Bh0hA7El.js +2 -0
- package/dist/renderer/assets/updateDialog-CwndJ0Bl.js +2 -0
- package/dist/renderer/assets/utils-sEB5OZEQ.js +2 -0
- package/dist/renderer/assets/view-api-B-2zPBR5.js +2 -0
- package/dist/renderer/assets/view-ids-BfaDVV5P.js +2 -0
- package/dist/renderer/assets/workbench-C0Jkdlps.js +5 -0
- package/dist/renderer/assets/workbenchSettings-YD0Ctbm_.js +8 -0
- package/dist/renderer/entries/device-picker/index.html +28 -0
- package/dist/renderer/entries/host-sidebar-default/index.html +22 -0
- package/dist/renderer/entries/main/index.html +16 -7
- package/dist/renderer/entries/popover/index.html +16 -6
- package/dist/renderer/entries/project-create-dialog/index.html +27 -0
- package/dist/renderer/entries/settings/index.html +10 -5
- package/dist/renderer/entries/tooltip/index.html +21 -0
- package/dist/renderer/entries/update-dialog/index.html +25 -0
- package/dist/renderer/entries/workbench/index.html +49 -0
- package/dist/renderer/entries/workbench-settings/index.html +12 -5
- package/dist/service-host/appdata-set-data.cjs +39 -0
- package/dist/service-host/host-env-update.cjs +23 -0
- package/dist/service-host/preload.cjs +54 -48
- package/dist/service-host/service-message-queue.cjs +71 -0
- package/dist/service-host/sync-impls/menu-button-geometry.js +16 -5
- package/dist/service-host/sync-impls/menu-button.js +5 -3
- package/dist/service-host/sync-impls/system-info.js +31 -9
- package/dist/shared/bridge-channels.d.ts +1 -416
- package/dist/shared/bridge-channels.js +1 -89
- package/dist/shared/compile-mode-state.d.ts +73 -0
- package/dist/shared/compile-mode-state.js +100 -0
- package/dist/shared/compile-modes.d.ts +152 -0
- package/dist/shared/compile-modes.js +237 -0
- package/dist/shared/constants.d.ts +22 -0
- package/dist/shared/constants.js +22 -0
- package/dist/shared/dmb-resource-url.d.ts +2 -0
- package/dist/shared/dmb-resource-url.js +2 -0
- package/dist/shared/ipc-channels-overlays.d.ts +162 -0
- package/dist/shared/ipc-channels-overlays.js +203 -0
- package/dist/shared/ipc-channels.d.ts +24 -154
- package/dist/shared/ipc-channels.js +48 -96
- package/dist/shared/ipc-schemas.d.ts +143 -54
- package/dist/shared/ipc-schemas.js +137 -45
- package/dist/shared/node-bindings.d.ts +2 -0
- package/dist/shared/node-bindings.js +2 -0
- package/dist/shared/project-window-types.d.ts +42 -0
- package/dist/shared/project-window-types.js +2 -0
- package/dist/shared/simulator-route.d.ts +8 -0
- package/dist/shared/simulator-route.js +15 -0
- package/dist/shared/simulator-ui.d.ts +61 -0
- package/dist/shared/simulator-ui.js +12 -0
- package/dist/shared/types.d.ts +126 -41
- package/dist/shared/view-ids.d.ts +10 -0
- package/dist/shared/view-ids.js +23 -0
- package/dist/simulator/assets/bridge-channels-B3JAmRfl.js +2 -0
- package/dist/simulator/assets/device-shell-ATEhHV2_.css +1 -0
- package/dist/simulator/assets/device-shell-DucLepkm.js +431 -0
- package/dist/simulator/assets/simulator-B4rbcOVt.js +10 -0
- package/dist/simulator/assets/simulator-mini-app-DFo7fhi5.js +2 -0
- package/dist/simulator/assets/simulator-ui-BupATgKo.css +1 -0
- package/dist/simulator/assets/simulator-ui-i3GCc7YJ.js +2 -0
- package/dist/simulator/simulator.html +4 -3
- package/dist/simulator/temp-files.d.ts +35 -0
- package/dist/simulator/temp-files.js +121 -0
- package/dist/simulator/types.d.ts +50 -0
- package/dist/simulator/types.js +2 -0
- package/dist/vscode-workbench/assets/__vite-browser-external-JIkWewFf.js +1 -0
- package/dist/vscode-workbench/assets/{dist-TpGpmMGi.js → dist-CXG-u1VB.js} +3 -3
- package/dist/vscode-workbench/assets/fs-core-worker-urls-DZ1nod84.js +1 -0
- package/dist/vscode-workbench/assets/fs-core.worker-Bnmpp6fo.js +1 -0
- package/dist/vscode-workbench/assets/fs-query.worker-cZ-7Fjch.js +2 -0
- package/dist/vscode-workbench/assets/{iconv-lite-umd-C9tiCAJa.js → iconv-lite-umd-Dxx9Qyb4.js} +1 -1
- package/dist/vscode-workbench/assets/{index-DJ1HyMZ7.js → index-6VJMsaWj.js} +475 -475
- package/dist/vscode-workbench/assets/{jschardet-DE1jV513.js → jschardet-Ba3D16vt.js} +1 -1
- package/dist/vscode-workbench/index.html +21 -1
- package/package.json +23 -13
- package/dist/main/services/views/destroy-child-view.d.ts +0 -9
- package/dist/main/services/views/destroy-child-view.js +0 -23
- package/dist/preload/instrumentation/wxml-extract.d.ts +0 -11
- package/dist/preload/instrumentation/wxml-extract.js +0 -382
- package/dist/preload/shared/sid-registry.d.ts +0 -11
- package/dist/preload/shared/sid-registry.js +0 -38
- package/dist/renderer/assets/constants-EAMiwL9_.js +0 -2
- package/dist/renderer/assets/index-BMqyDx71.js +0 -49
- package/dist/renderer/assets/input-CDAEwpBO.js +0 -2
- package/dist/renderer/assets/ipc-transport-B7eFOR68.css +0 -1
- package/dist/renderer/assets/ipc-transport-_G1k5V1p.js +0 -9
- package/dist/renderer/assets/popover-DEdjK14m.js +0 -2
- package/dist/renderer/assets/select-DpKPCh3y.js +0 -2
- package/dist/renderer/assets/settings-M5q2elUr.js +0 -2
- package/dist/renderer/assets/settings-api-CDlZoHiO.js +0 -2
- package/dist/renderer/assets/workbenchSettings-CT_H1WhV.js +0 -8
- package/dist/shared/appdata-accumulator.d.ts +0 -95
- package/dist/shared/appdata-accumulator.js +0 -218
- package/dist/shared/request-core.d.ts +0 -84
- package/dist/shared/request-core.js +0 -168
- package/dist/shared/simulator-api-metadata.d.ts +0 -26
- package/dist/shared/simulator-api-metadata.js +0 -59
- package/dist/shared/vpath.d.ts +0 -42
- package/dist/shared/vpath.js +0 -105
- package/dist/simulator/assets/bridge-channels-zhsumfky.js +0 -2
- package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
- package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
- package/dist/simulator/assets/jsx-runtime-BDTY6fEq.js +0 -2
- package/dist/simulator/assets/simulator-DU3-fS3v.js +0 -10
- package/dist/simulator/assets/simulator-mini-app-DzfMfnVM.js +0 -2
- package/dist/simulator/device-shell/menu-button-geometry.js +0 -8
- package/dist/vscode-workbench/assets/__vite-browser-external-CXi6Kz9W.js +0 -1
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { reconcile, createInitialState } from '@dimina-kit/electron-deck/layout';
|
|
2
2
|
import { applyViewOps } from './apply-view-ops.js';
|
|
3
|
+
import { createNativeViewTreeHost } from './native-view-tree.js';
|
|
3
4
|
export function createPlacementReconciler(ctx) {
|
|
4
5
|
let placementState = createInitialState();
|
|
5
6
|
let epochCounter = 0;
|
|
6
7
|
let rendererGeneration = 0;
|
|
8
|
+
let allocatedGeneration = 0;
|
|
9
|
+
const appliedActual = new Map();
|
|
7
10
|
const baseDesired = new Map();
|
|
8
11
|
const overlayDesired = new Map();
|
|
9
12
|
const slots = new Map();
|
|
13
|
+
// Sole owner of the main window's native child tree. Every attach, detach,
|
|
14
|
+
// reorder and hard destroy passes through this ledger-backed adapter.
|
|
15
|
+
const contentViewHost = createNativeViewTreeHost(ctx, slots);
|
|
10
16
|
function gateReadiness(v) {
|
|
11
17
|
const slot = slots.get(v.viewId);
|
|
12
18
|
if (slot?.gateHidden?.())
|
|
@@ -20,59 +26,67 @@ export function createPlacementReconciler(ctx) {
|
|
|
20
26
|
const slot = slots.get(viewId);
|
|
21
27
|
if (!slot)
|
|
22
28
|
return;
|
|
23
|
-
if (slot.beforeAttach?.())
|
|
24
|
-
return;
|
|
25
29
|
const view = slot.ensureView ? slot.ensureView() : slot.getView();
|
|
26
30
|
if (!view)
|
|
27
31
|
return;
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
if (!contentViewHost.addChildView({ id: viewId }))
|
|
33
|
+
return;
|
|
34
|
+
const previous = appliedActual.get(viewId);
|
|
35
|
+
appliedActual.set(viewId, {
|
|
36
|
+
attached: true,
|
|
37
|
+
visible: true,
|
|
38
|
+
bounds: previous?.bounds,
|
|
39
|
+
extra: previous?.extra,
|
|
40
|
+
});
|
|
30
41
|
},
|
|
31
42
|
detach(viewId) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
ctx.windows.mainWindow.contentView.removeChildView(view);
|
|
37
|
-
}
|
|
38
|
-
catch { /* already removed */ }
|
|
39
|
-
}
|
|
40
|
-
slot?.setAdded?.(false);
|
|
43
|
+
if (!contentViewHost.removeChildView({ id: viewId }))
|
|
44
|
+
return;
|
|
45
|
+
appliedActual.delete(viewId);
|
|
41
46
|
},
|
|
42
47
|
setBounds(viewId, bounds, extra) {
|
|
43
48
|
const slot = slots.get(viewId);
|
|
44
49
|
const view = slot?.getView() ?? null;
|
|
45
50
|
if (!view || view.webContents.isDestroyed())
|
|
46
51
|
return;
|
|
47
|
-
|
|
48
|
-
slot
|
|
52
|
+
try {
|
|
53
|
+
if (slot?.applyBounds)
|
|
54
|
+
slot.applyBounds(view, bounds, extra);
|
|
55
|
+
else
|
|
56
|
+
view.setBounds(bounds);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
49
59
|
return;
|
|
50
60
|
}
|
|
51
|
-
|
|
61
|
+
const previous = appliedActual.get(viewId);
|
|
62
|
+
appliedActual.set(viewId, {
|
|
63
|
+
attached: previous?.attached ?? false,
|
|
64
|
+
visible: previous?.visible ?? false,
|
|
65
|
+
bounds,
|
|
66
|
+
extra,
|
|
67
|
+
});
|
|
52
68
|
},
|
|
53
69
|
setVisible(viewId, visible) {
|
|
54
70
|
const view = slots.get(viewId)?.getView() ?? null;
|
|
55
|
-
if (!view)
|
|
71
|
+
if (!view || view.webContents.isDestroyed())
|
|
56
72
|
return;
|
|
57
73
|
try {
|
|
58
74
|
view.setVisible(visible);
|
|
59
75
|
}
|
|
60
|
-
catch {
|
|
76
|
+
catch {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const previous = appliedActual.get(viewId);
|
|
80
|
+
if (!previous)
|
|
81
|
+
return;
|
|
82
|
+
appliedActual.set(viewId, { ...previous, visible });
|
|
61
83
|
},
|
|
62
84
|
reorder(order) {
|
|
63
85
|
// A single attached view is already in place — nothing to reorder.
|
|
64
86
|
if (order.length <= 1 || ctx.windows.mainWindow.isDestroyed())
|
|
65
87
|
return;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const view = slots.get(viewId)?.getView() ?? null;
|
|
69
|
-
if (view) {
|
|
70
|
-
try {
|
|
71
|
-
cv.addChildView(view);
|
|
72
|
-
}
|
|
73
|
-
catch { /* already attached */ }
|
|
74
|
-
}
|
|
75
|
-
}
|
|
88
|
+
for (const viewId of order)
|
|
89
|
+
contentViewHost.addChildView({ id: viewId });
|
|
76
90
|
},
|
|
77
91
|
};
|
|
78
92
|
// Create the lazily-built views (host-toolbar, workbench) BEFORE reconcile so
|
|
@@ -83,6 +97,9 @@ export function createPlacementReconciler(ctx) {
|
|
|
83
97
|
slot.ensureLazy?.(baseDesired.get(viewId));
|
|
84
98
|
}
|
|
85
99
|
}
|
|
100
|
+
function cloneAppliedActual() {
|
|
101
|
+
return new Map([...appliedActual].map(([viewId, actual]) => [viewId, { ...actual }]));
|
|
102
|
+
}
|
|
86
103
|
function reconcileNow() {
|
|
87
104
|
ensureLazyViews();
|
|
88
105
|
const views = [];
|
|
@@ -90,6 +107,7 @@ export function createPlacementReconciler(ctx) {
|
|
|
90
107
|
views.push(gateReadiness(v));
|
|
91
108
|
for (const v of overlayDesired.values())
|
|
92
109
|
views.push(v);
|
|
110
|
+
placementState = { ...placementState, actual: cloneAppliedActual() };
|
|
93
111
|
const result = reconcile(placementState, {
|
|
94
112
|
generation: rendererGeneration,
|
|
95
113
|
epoch: ++epochCounter,
|
|
@@ -97,8 +115,33 @@ export function createPlacementReconciler(ctx) {
|
|
|
97
115
|
});
|
|
98
116
|
placementState = result.state;
|
|
99
117
|
applyViewOps(result.ops, viewTarget);
|
|
118
|
+
// The planner's next state is optimistic. Keep only desired/epoch metadata;
|
|
119
|
+
// appliedActual is updated by successful native effects above.
|
|
120
|
+
placementState = { ...placementState, actual: cloneAppliedActual() };
|
|
100
121
|
}
|
|
101
122
|
function setPlacementSnapshot(snapshot) {
|
|
123
|
+
// Hard reject a snapshot from BEHIND the current high-water mark — a
|
|
124
|
+
// complete no-op, touching neither `rendererGeneration` nor
|
|
125
|
+
// `baseDesired`. The renderer hands out one shared, strictly monotonic
|
|
126
|
+
// sequence across every screen (see renderer-placement-generation.ts),
|
|
127
|
+
// so under normal operation a lower generation can only be a LATE
|
|
128
|
+
// arrival from an already-superseded source (e.g. a dead screen's
|
|
129
|
+
// delayed `dispose()` empty-snapshot flush racing a successor screen's
|
|
130
|
+
// mount). The previous version of this guard clamped
|
|
131
|
+
// `rendererGeneration` to never regress but still unconditionally
|
|
132
|
+
// applied the stale snapshot's CONTENT into `baseDesired` under the
|
|
133
|
+
// clamped (i.e. current) generation number — which defeated the
|
|
134
|
+
// reconcile core's own generation-regression guard
|
|
135
|
+
// (placement-reconcile.ts: `snapshot.generation < prev.generation`) by
|
|
136
|
+
// never letting it see the snapshot's real, lower generation. That let a
|
|
137
|
+
// dead screen's stale/empty view list silently overwrite a currently
|
|
138
|
+
// active screen's real views. Dropping it here, before it ever reaches
|
|
139
|
+
// `baseDesired`, is what actually gives the stale snapshot zero side
|
|
140
|
+
// effects.
|
|
141
|
+
if (snapshot.generation < rendererGeneration) {
|
|
142
|
+
console.warn(`[placement-reconciler] snapshot generation ${snapshot.generation} is behind the current ${rendererGeneration}; dropping without applying its content`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
102
145
|
rendererGeneration = snapshot.generation;
|
|
103
146
|
baseDesired.clear();
|
|
104
147
|
for (const v of snapshot.views)
|
|
@@ -109,12 +152,31 @@ export function createPlacementReconciler(ctx) {
|
|
|
109
152
|
registerView: (viewId, slot) => { slots.set(viewId, slot); },
|
|
110
153
|
reconcileNow,
|
|
111
154
|
setPlacementSnapshot,
|
|
112
|
-
|
|
155
|
+
prepareView: (viewId, view, bounds) => {
|
|
156
|
+
if (slots.get(viewId)?.getView() !== view || view.webContents.isDestroyed())
|
|
157
|
+
return;
|
|
158
|
+
try {
|
|
159
|
+
view.setBounds(bounds);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
appliedActual.set(viewId, { attached: false, visible: false, bounds });
|
|
165
|
+
},
|
|
166
|
+
destroyView: (viewId, view) => {
|
|
167
|
+
contentViewHost.destroyView(viewId, view);
|
|
168
|
+
appliedActual.delete(viewId);
|
|
169
|
+
placementState.actual.delete(viewId);
|
|
170
|
+
},
|
|
113
171
|
setBaseDesired: (viewId, desired) => { baseDesired.set(viewId, desired); },
|
|
114
172
|
deleteBaseDesired: (viewId) => { baseDesired.delete(viewId); },
|
|
115
173
|
setOverlayDesired: (viewId, desired) => { overlayDesired.set(viewId, desired); },
|
|
116
174
|
deleteOverlayDesired: (viewId) => { overlayDesired.delete(viewId); },
|
|
117
175
|
hasOverlayDesired: (viewId) => overlayDesired.has(viewId),
|
|
176
|
+
allocateGeneration: () => {
|
|
177
|
+
allocatedGeneration = Math.max(allocatedGeneration, rendererGeneration) + 1;
|
|
178
|
+
return allocatedGeneration;
|
|
179
|
+
},
|
|
118
180
|
};
|
|
119
181
|
}
|
|
120
182
|
//# sourceMappingURL=placement-reconciler.js.map
|
|
@@ -13,9 +13,36 @@ interface SnapshotSink {
|
|
|
13
13
|
views: DesiredView<DevtoolsExtra>[];
|
|
14
14
|
}): void;
|
|
15
15
|
}
|
|
16
|
+
interface OverlaySink {
|
|
17
|
+
showSettings(): Promise<void>;
|
|
18
|
+
showPopover(data: unknown): void;
|
|
19
|
+
showTooltip(data: {
|
|
20
|
+
anchor: Rect;
|
|
21
|
+
text: string;
|
|
22
|
+
}): void;
|
|
23
|
+
getSettingsWebContentsId(): number | null;
|
|
24
|
+
getPopoverWebContentsId(): number | null;
|
|
25
|
+
getTooltipWebContentsId(): number | null;
|
|
26
|
+
markOverlayReady(webContentsId: number): void;
|
|
27
|
+
applyTooltipMeasurement(webContentsId: number, measurement: {
|
|
28
|
+
requestId: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}): void;
|
|
32
|
+
}
|
|
16
33
|
export declare function hostToolbarBounds(mgr: SnapshotSink, rect: Rect): void;
|
|
34
|
+
export declare function hostSidebarBounds(mgr: SnapshotSink, rect: Rect): void;
|
|
17
35
|
export declare function simulatorDevtoolsBounds(mgr: SnapshotSink, rect: Rect): void;
|
|
18
36
|
export declare function workbenchBounds(mgr: SnapshotSink, rect: Rect): void;
|
|
37
|
+
export declare function showSettingsReady(mgr: OverlaySink): Promise<void>;
|
|
38
|
+
export declare function showPopoverReady(mgr: OverlaySink, data: unknown): void;
|
|
39
|
+
export declare function showTooltipReady(mgr: OverlaySink, data: {
|
|
40
|
+
anchor: Rect;
|
|
41
|
+
text: string;
|
|
42
|
+
}, size?: {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}): void;
|
|
19
46
|
export declare function simulatorBounds(mgr: SnapshotSink, params: Rect & {
|
|
20
47
|
zoom: number;
|
|
21
48
|
}): void;
|
|
@@ -12,6 +12,7 @@ import { VIEW_ID, VIEW_LAYER } from '../../../shared/view-ids.js';
|
|
|
12
12
|
// pushes on one manager never look stale.
|
|
13
13
|
let globalEpoch = 0;
|
|
14
14
|
const desiredByMgr = new WeakMap();
|
|
15
|
+
const tooltipRequestByMgr = new WeakMap();
|
|
15
16
|
function toPlacement(r) {
|
|
16
17
|
return r.width > 0 && r.height > 0 ? { visible: true, bounds: r } : { visible: false };
|
|
17
18
|
}
|
|
@@ -27,12 +28,40 @@ function pushView(mgr, view, generation = 1) {
|
|
|
27
28
|
export function hostToolbarBounds(mgr, rect) {
|
|
28
29
|
pushView(mgr, { viewId: VIEW_ID.hostToolbar, placement: toPlacement(rect), layer: VIEW_LAYER.hostToolbar });
|
|
29
30
|
}
|
|
31
|
+
export function hostSidebarBounds(mgr, rect) {
|
|
32
|
+
pushView(mgr, { viewId: VIEW_ID.hostSidebar, placement: toPlacement(rect), layer: VIEW_LAYER.hostSidebar });
|
|
33
|
+
}
|
|
30
34
|
export function simulatorDevtoolsBounds(mgr, rect) {
|
|
31
35
|
pushView(mgr, { viewId: VIEW_ID.simulatorDevtools, placement: toPlacement(rect), layer: VIEW_LAYER.base });
|
|
32
36
|
}
|
|
33
37
|
export function workbenchBounds(mgr, rect) {
|
|
34
38
|
pushView(mgr, { viewId: VIEW_ID.workbench, placement: toPlacement(rect), layer: VIEW_LAYER.base });
|
|
35
39
|
}
|
|
40
|
+
export async function showSettingsReady(mgr) {
|
|
41
|
+
const shown = mgr.showSettings();
|
|
42
|
+
const webContentsId = mgr.getSettingsWebContentsId();
|
|
43
|
+
if (webContentsId === null)
|
|
44
|
+
throw new Error('settings view was not created');
|
|
45
|
+
mgr.markOverlayReady(webContentsId);
|
|
46
|
+
await shown;
|
|
47
|
+
}
|
|
48
|
+
export function showPopoverReady(mgr, data) {
|
|
49
|
+
mgr.showPopover(data);
|
|
50
|
+
const webContentsId = mgr.getPopoverWebContentsId();
|
|
51
|
+
if (webContentsId === null)
|
|
52
|
+
throw new Error('popover view was not created');
|
|
53
|
+
mgr.markOverlayReady(webContentsId);
|
|
54
|
+
}
|
|
55
|
+
export function showTooltipReady(mgr, data, size = { width: 80, height: 28 }) {
|
|
56
|
+
mgr.showTooltip(data);
|
|
57
|
+
const webContentsId = mgr.getTooltipWebContentsId();
|
|
58
|
+
if (webContentsId === null)
|
|
59
|
+
throw new Error('tooltip view was not created');
|
|
60
|
+
mgr.markOverlayReady(webContentsId);
|
|
61
|
+
const requestId = (tooltipRequestByMgr.get(mgr) ?? 0) + 1;
|
|
62
|
+
tooltipRequestByMgr.set(mgr, requestId);
|
|
63
|
+
mgr.applyTooltipMeasurement(webContentsId, { requestId, ...size });
|
|
64
|
+
}
|
|
36
65
|
export function simulatorBounds(mgr, params) {
|
|
37
66
|
const { zoom, ...rect } = params;
|
|
38
67
|
pushView(mgr, { viewId: VIEW_ID.simulator, placement: toPlacement(rect), layer: VIEW_LAYER.base, extra: { zoom } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type WebContentsView } from 'electron';
|
|
2
|
+
/**
|
|
3
|
+
* Hot-swap the stylesheets of every live render-host guest of `view` in place
|
|
4
|
+
* (no shell respawn — page stack / form state / scroll / focus survive). Guests
|
|
5
|
+
* are found via `hostWebContents === view.webContents` — the same nesting
|
|
6
|
+
* pattern the zoom propagation uses. Returns false when no live guest is found,
|
|
7
|
+
* so the caller can fall back to a full reload rather than dropping the edit.
|
|
8
|
+
*/
|
|
9
|
+
export declare function refreshGuestStylesheets(view: WebContentsView): boolean;
|
|
10
|
+
//# sourceMappingURL=refresh-styles.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { webContents } from 'electron';
|
|
2
|
+
/**
|
|
3
|
+
* Injected into each live render-host guest to hot-swap its stylesheets in
|
|
4
|
+
* place: for every `<link rel=stylesheet>`, insert a cache-busted clone
|
|
5
|
+
* (`?__hmr=<ts>`) so the browser re-fetches the recompiled `.css` and re-applies
|
|
6
|
+
* it against the already-mounted DOM, then drop the stale sheet once the fresh
|
|
7
|
+
* one loads (no unstyled flash). Recurses into same-origin iframes because a
|
|
8
|
+
* render-host page nests its content in an iframe. Self-contained (runs in the
|
|
9
|
+
* guest realm via `executeJavaScript`), defensive (never throws). Mirrors
|
|
10
|
+
* `@dimina-kit/devkit`'s `refreshStylesheets` (the SSE web-preview equivalent).
|
|
11
|
+
*/
|
|
12
|
+
const REFRESH_STYLES_JS = `(function refresh(doc){
|
|
13
|
+
try {
|
|
14
|
+
var links = doc.querySelectorAll('link[rel="stylesheet"]');
|
|
15
|
+
for (var i = 0; i < links.length; i++) {
|
|
16
|
+
var link = links[i];
|
|
17
|
+
try {
|
|
18
|
+
var u = new URL(link.href, doc.baseURI || undefined);
|
|
19
|
+
u.searchParams.set('__hmr', String(Date.now()));
|
|
20
|
+
var next = link.cloneNode();
|
|
21
|
+
next.href = u.href;
|
|
22
|
+
next.addEventListener('load', (function(stale){ return function(){ stale.remove(); }; })(link));
|
|
23
|
+
link.parentNode.insertBefore(next, link.nextSibling);
|
|
24
|
+
} catch (e) {}
|
|
25
|
+
}
|
|
26
|
+
var frames = doc.querySelectorAll('iframe');
|
|
27
|
+
for (var j = 0; j < frames.length; j++) {
|
|
28
|
+
try { if (frames[j].contentDocument) refresh(frames[j].contentDocument); } catch (e) {}
|
|
29
|
+
}
|
|
30
|
+
} catch (e) {}
|
|
31
|
+
})(document);`;
|
|
32
|
+
/**
|
|
33
|
+
* Hot-swap the stylesheets of every live render-host guest of `view` in place
|
|
34
|
+
* (no shell respawn — page stack / form state / scroll / focus survive). Guests
|
|
35
|
+
* are found via `hostWebContents === view.webContents` — the same nesting
|
|
36
|
+
* pattern the zoom propagation uses. Returns false when no live guest is found,
|
|
37
|
+
* so the caller can fall back to a full reload rather than dropping the edit.
|
|
38
|
+
*/
|
|
39
|
+
export function refreshGuestStylesheets(view) {
|
|
40
|
+
const simWc = view.webContents;
|
|
41
|
+
let refreshed = 0;
|
|
42
|
+
try {
|
|
43
|
+
for (const wc of webContents.getAllWebContents()) {
|
|
44
|
+
if (wc.isDestroyed())
|
|
45
|
+
continue;
|
|
46
|
+
if (wc.hostWebContents !== simWc)
|
|
47
|
+
continue;
|
|
48
|
+
wc.executeJavaScript(REFRESH_STYLES_JS).catch(() => { });
|
|
49
|
+
refreshed++;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return refreshed > 0;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=refresh-styles.js.map
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Referer + CORS webRequest policy for the simulator runtime's sessions.
|
|
3
|
-
*
|
|
4
|
-
* The native render/service hosts fetch the compiled `<appId>/…` resources
|
|
5
|
-
* cross-origin and need a WeChat-style page-frame `Referer`; this installs that
|
|
6
|
-
* policy on the shared fallback session AND on every per-project
|
|
7
|
-
* `persist:miniapp-<key>` partition (current + future) via the partition
|
|
8
|
-
* configurator registry, so isolated projects load resources identically.
|
|
9
|
-
*
|
|
10
|
-
* TEARDOWN: a `webRequest` listener is per-session and there is exactly one
|
|
11
|
-
* slot per (session, event) — re-installing replaces, never stacks. But the
|
|
12
|
-
* configurator registration itself leaks if discarded: re-creating the
|
|
13
|
-
* WorkbenchApp in the same process would register a second configurator that
|
|
14
|
-
* keeps firing for every future partition. So this returns a {@link Disposable}
|
|
15
|
-
* that unregisters the configurator AND clears the listeners off every session
|
|
16
|
-
* it touched. Wire it into the context registry like any other module.
|
|
17
|
-
*/
|
|
18
|
-
import { type Disposable } from '@dimina-kit/electron-deck/main';
|
|
19
|
-
/**
|
|
20
|
-
* Install the simulator referer/CORS policy on the shared fallback session and
|
|
21
|
-
* register a configurator so every per-project partition session gets it too.
|
|
22
|
-
* Returns a disposable that unregisters the configurator and clears the policy
|
|
23
|
-
* off every session it installed on — call its teardown when the owning
|
|
24
|
-
* context is disposed so re-creating the app never leaks a duplicate
|
|
25
|
-
* configurator/listener.
|
|
26
|
-
*/
|
|
27
|
-
export declare function setupSimulatorSessionPolicy(): Disposable;
|
|
1
|
+
export * from '@dimina-kit/electron-runtime/main/session-policy';
|
|
28
2
|
//# sourceMappingURL=simulator-session-policy.d.ts.map
|
|
@@ -1,99 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Referer + CORS webRequest policy for the simulator runtime's sessions.
|
|
3
|
-
*
|
|
4
|
-
* The native render/service hosts fetch the compiled `<appId>/…` resources
|
|
5
|
-
* cross-origin and need a WeChat-style page-frame `Referer`; this installs that
|
|
6
|
-
* policy on the shared fallback session AND on every per-project
|
|
7
|
-
* `persist:miniapp-<key>` partition (current + future) via the partition
|
|
8
|
-
* configurator registry, so isolated projects load resources identically.
|
|
9
|
-
*
|
|
10
|
-
* TEARDOWN: a `webRequest` listener is per-session and there is exactly one
|
|
11
|
-
* slot per (session, event) — re-installing replaces, never stacks. But the
|
|
12
|
-
* configurator registration itself leaks if discarded: re-creating the
|
|
13
|
-
* WorkbenchApp in the same process would register a second configurator that
|
|
14
|
-
* keeps firing for every future partition. So this returns a {@link Disposable}
|
|
15
|
-
* that unregisters the configurator AND clears the listeners off every session
|
|
16
|
-
* it touched. Wire it into the context registry like any other module.
|
|
17
|
-
*/
|
|
18
|
-
import { session } from 'electron';
|
|
19
|
-
import { toDisposable } from '@dimina-kit/electron-deck/main';
|
|
20
|
-
import { getSimulatorServicewechatReferer } from '../simulator/referer.js';
|
|
21
|
-
import { registerMiniappSessionConfigurator, SHARED_MINIAPP_PARTITION, } from './miniapp-partition.js';
|
|
22
|
-
/** The response headers this policy owns outright (compared lowercase). */
|
|
23
|
-
const CORS_OVERRIDE_HEADERS = new Set([
|
|
24
|
-
'access-control-allow-origin',
|
|
25
|
-
'access-control-allow-headers',
|
|
26
|
-
'access-control-allow-methods',
|
|
27
|
-
]);
|
|
28
|
-
/** Apply the simulator runtime's referer + CORS webRequest policy to one
|
|
29
|
-
* session. Each session installs its own listeners (a webRequest listener is
|
|
30
|
-
* per-session), so this runs once per partition. */
|
|
31
|
-
function applySimulatorWebRequestPolicy(simulatorSession) {
|
|
32
|
-
simulatorSession.webRequest.onBeforeSendHeaders((details, callback) => {
|
|
33
|
-
const forcedReferer = getSimulatorServicewechatReferer();
|
|
34
|
-
if (forcedReferer) {
|
|
35
|
-
details.requestHeaders['Referer'] = forcedReferer;
|
|
36
|
-
}
|
|
37
|
-
callback({ requestHeaders: details.requestHeaders });
|
|
38
|
-
});
|
|
39
|
-
simulatorSession.webRequest.onHeadersReceived((details, callback) => {
|
|
40
|
-
const headers = details.responseHeaders ?? {};
|
|
41
|
-
// CORS for the native render/service hosts to fetch compiled app resources
|
|
42
|
-
// cross-origin. (The COOP/COEP cross-origin-isolation headers were only for
|
|
43
|
-
// the removed default-path SharedArrayBuffer sync Worker — dropped.)
|
|
44
|
-
//
|
|
45
|
-
// This policy is the single authority for these three headers: any value
|
|
46
|
-
// the server itself sent must be REPLACED, not shadowed. responseHeaders
|
|
47
|
-
// keys keep the server's original casing, so assigning the lowercase key
|
|
48
|
-
// beside an existing `Access-Control-Allow-Origin` puts BOTH on the wire —
|
|
49
|
-
// Chromium then rejects the response for carrying multiple ACAO values
|
|
50
|
-
// (`*, *`), breaking every fetch against a CORS-compliant backend.
|
|
51
|
-
for (const key of Object.keys(headers)) {
|
|
52
|
-
if (CORS_OVERRIDE_HEADERS.has(key.toLowerCase()))
|
|
53
|
-
delete headers[key];
|
|
54
|
-
}
|
|
55
|
-
headers['access-control-allow-origin'] = ['*'];
|
|
56
|
-
headers['access-control-allow-headers'] = ['*'];
|
|
57
|
-
headers['access-control-allow-methods'] = ['*'];
|
|
58
|
-
callback({ responseHeaders: headers });
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/** Remove the policy listeners from a session (passing `null` clears the slot). */
|
|
62
|
-
function clearSimulatorWebRequestPolicy(simulatorSession) {
|
|
63
|
-
try {
|
|
64
|
-
simulatorSession.webRequest.onBeforeSendHeaders(null);
|
|
65
|
-
simulatorSession.webRequest.onHeadersReceived(null);
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// Session already gone (app shutdown) — nothing to clear.
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Install the simulator referer/CORS policy on the shared fallback session and
|
|
73
|
-
* register a configurator so every per-project partition session gets it too.
|
|
74
|
-
* Returns a disposable that unregisters the configurator and clears the policy
|
|
75
|
-
* off every session it installed on — call its teardown when the owning
|
|
76
|
-
* context is disposed so re-creating the app never leaks a duplicate
|
|
77
|
-
* configurator/listener.
|
|
78
|
-
*/
|
|
79
|
-
export function setupSimulatorSessionPolicy() {
|
|
80
|
-
const configured = new Set();
|
|
81
|
-
function install(sess) {
|
|
82
|
-
if (configured.has(sess))
|
|
83
|
-
return;
|
|
84
|
-
configured.add(sess);
|
|
85
|
-
applySimulatorWebRequestPolicy(sess);
|
|
86
|
-
}
|
|
87
|
-
// Shared fallback session (pre-warm pool + unknown-appId path).
|
|
88
|
-
install(session.fromPartition(SHARED_MINIAPP_PARTITION));
|
|
89
|
-
// Every per-project miniapp partition session (current + future) gets the
|
|
90
|
-
// same referer/CORS policy so isolated projects load resources identically.
|
|
91
|
-
const unregister = registerMiniappSessionConfigurator((sess) => install(sess));
|
|
92
|
-
return toDisposable(() => {
|
|
93
|
-
unregister();
|
|
94
|
-
for (const sess of configured)
|
|
95
|
-
clearSimulatorWebRequestPolicy(sess);
|
|
96
|
-
configured.clear();
|
|
97
|
-
});
|
|
98
|
-
}
|
|
1
|
+
export * from '@dimina-kit/electron-runtime/main/session-policy';
|
|
99
2
|
//# sourceMappingURL=simulator-session-policy.js.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared harness for the simulator-DevTools host suites
|
|
3
|
+
* (`view-manager-devtools-host-repoint.test.ts` +
|
|
4
|
+
* `view-manager-service-host-ready.test.ts`), split out so each test file
|
|
5
|
+
* stays under the repo's 500-line-per-file ratchet. Pure test scaffolding,
|
|
6
|
+
* not code under test — same pattern as
|
|
7
|
+
* network-forward/global-mirror-test-fixtures.ts.
|
|
8
|
+
*
|
|
9
|
+
* Consumers register the module mocks themselves (vi.mock factories are
|
|
10
|
+
* hoisted per test file, so they live there, thin):
|
|
11
|
+
* vi.mock('electron', async () =>
|
|
12
|
+
* (await import('./view-manager-devtools-host-test-fixtures.js')).electronModuleMock())
|
|
13
|
+
* vi.mock('../../utils/paths.js', async () =>
|
|
14
|
+
* (await import('./view-manager-devtools-host-test-fixtures.js')).pathsModuleMock())
|
|
15
|
+
* The electron factory closes over this module's `constructed` /
|
|
16
|
+
* `serviceWcRegistry` registries, so test assertions and the mock see the
|
|
17
|
+
* same objects (vitest gives each test FILE its own instance of this module —
|
|
18
|
+
* no cross-file bleed).
|
|
19
|
+
*/
|
|
20
|
+
import { vi } from 'vitest';
|
|
21
|
+
import type { RenderEvent, ServiceHostReadyEvent } from '../../ipc/bridge-router.js';
|
|
22
|
+
import type { ViewManagerContext } from './view-manager.js';
|
|
23
|
+
export type StubWebContents = {
|
|
24
|
+
destroyed: boolean;
|
|
25
|
+
id: number;
|
|
26
|
+
isDestroyed: () => boolean;
|
|
27
|
+
close: ReturnType<typeof vi.fn>;
|
|
28
|
+
loadURL: ReturnType<typeof vi.fn>;
|
|
29
|
+
loadFile: ReturnType<typeof vi.fn>;
|
|
30
|
+
on: ReturnType<typeof vi.fn>;
|
|
31
|
+
once: ReturnType<typeof vi.fn>;
|
|
32
|
+
removeListener: ReturnType<typeof vi.fn>;
|
|
33
|
+
setWindowOpenHandler: ReturnType<typeof vi.fn>;
|
|
34
|
+
setZoomFactor: ReturnType<typeof vi.fn>;
|
|
35
|
+
send: ReturnType<typeof vi.fn>;
|
|
36
|
+
setMaxListeners: ReturnType<typeof vi.fn>;
|
|
37
|
+
getMaxListeners: ReturnType<typeof vi.fn>;
|
|
38
|
+
isLoading: ReturnType<typeof vi.fn>;
|
|
39
|
+
executeJavaScript: ReturnType<typeof vi.fn>;
|
|
40
|
+
setDevToolsWebContents: ReturnType<typeof vi.fn>;
|
|
41
|
+
openDevTools: ReturnType<typeof vi.fn>;
|
|
42
|
+
isDevToolsOpened: ReturnType<typeof vi.fn>;
|
|
43
|
+
closeDevTools: ReturnType<typeof vi.fn>;
|
|
44
|
+
getURL: ReturnType<typeof vi.fn>;
|
|
45
|
+
};
|
|
46
|
+
export type StubView = {
|
|
47
|
+
webContents: StubWebContents;
|
|
48
|
+
setBounds: ReturnType<typeof vi.fn>;
|
|
49
|
+
setBackgroundColor: ReturnType<typeof vi.fn>;
|
|
50
|
+
};
|
|
51
|
+
/** Every WebContentsView ever constructed by the code under test, in
|
|
52
|
+
* construction order: attachNativeSimulator builds [0] = the native simulator
|
|
53
|
+
* content view, then attachNativeSimulatorDevtoolsHost builds [1] = the
|
|
54
|
+
* DevTools front-end host view. Reset in each file's beforeEach. */
|
|
55
|
+
export declare const constructed: StubView[];
|
|
56
|
+
/** Service-host wcs registered by `makeServiceWc`, looked up by
|
|
57
|
+
* `electron.webContents.fromId` — mirrors real Electron's global wc registry
|
|
58
|
+
* so `onNativeServiceHostReady`'s `webContents.fromId(event.serviceWcId)`
|
|
59
|
+
* resolution has something real to find. */
|
|
60
|
+
export declare const serviceWcRegistry: Map<number, StubWebContents>;
|
|
61
|
+
/** The `electron` module surface view-manager and its injectors touch. */
|
|
62
|
+
export declare function electronModuleMock(): Record<string, unknown>;
|
|
63
|
+
export declare function pathsModuleMock(): Record<string, unknown>;
|
|
64
|
+
export declare const SIM_URL = "http://localhost:7788/simulator.html?appId=repoint";
|
|
65
|
+
/** A hidden SERVICE-HOST BrowserWindow wc (top-level, can host DevTools). */
|
|
66
|
+
export declare function makeServiceWc(id: number): StubWebContents;
|
|
67
|
+
export interface DevtoolsHostHarness {
|
|
68
|
+
addChildView: ReturnType<typeof vi.fn>;
|
|
69
|
+
removeChildView: ReturnType<typeof vi.fn>;
|
|
70
|
+
setActiveServiceWc: (wc: StubWebContents) => void;
|
|
71
|
+
emitRenderEvent: (event: RenderEvent) => void;
|
|
72
|
+
emitServiceHostReady: (event: ServiceHostReadyEvent) => void;
|
|
73
|
+
ctx: ViewManagerContext;
|
|
74
|
+
}
|
|
75
|
+
export declare function makeContext(): DevtoolsHostHarness;
|
|
76
|
+
//# sourceMappingURL=view-manager-devtools-host-test-fixtures.d.ts.map
|