@dimina-kit/devtools 0.4.0 → 0.5.0
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
|
@@ -0,0 +1,184 @@
|
|
|
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 { createConnectionRegistry } from '@dimina-kit/electron-deck/main';
|
|
22
|
+
/** Every WebContentsView ever constructed by the code under test, in
|
|
23
|
+
* construction order: attachNativeSimulator builds [0] = the native simulator
|
|
24
|
+
* content view, then attachNativeSimulatorDevtoolsHost builds [1] = the
|
|
25
|
+
* DevTools front-end host view. Reset in each file's beforeEach. */
|
|
26
|
+
export const constructed = [];
|
|
27
|
+
/** Service-host wcs registered by `makeServiceWc`, looked up by
|
|
28
|
+
* `electron.webContents.fromId` — mirrors real Electron's global wc registry
|
|
29
|
+
* so `onNativeServiceHostReady`'s `webContents.fromId(event.serviceWcId)`
|
|
30
|
+
* resolution has something real to find. */
|
|
31
|
+
export const serviceWcRegistry = new Map();
|
|
32
|
+
/** One stub wc surface shared by BOTH stub flavors (the constructed
|
|
33
|
+
* WebContentsView host wcs and the standalone service-host wcs) — a single
|
|
34
|
+
* factory instead of two hand-maintained near-identical literals. */
|
|
35
|
+
function makeStubWc(id, overrides = {}) {
|
|
36
|
+
return {
|
|
37
|
+
destroyed: false,
|
|
38
|
+
id,
|
|
39
|
+
isDestroyed() { return this.destroyed; },
|
|
40
|
+
close: vi.fn(),
|
|
41
|
+
loadURL: vi.fn(() => Promise.resolve()),
|
|
42
|
+
loadFile: vi.fn(() => Promise.resolve()),
|
|
43
|
+
on: vi.fn(),
|
|
44
|
+
once: vi.fn(),
|
|
45
|
+
removeListener: vi.fn(),
|
|
46
|
+
setWindowOpenHandler: vi.fn(),
|
|
47
|
+
setZoomFactor: vi.fn(),
|
|
48
|
+
send: vi.fn(),
|
|
49
|
+
setMaxListeners: vi.fn(),
|
|
50
|
+
getMaxListeners: vi.fn(() => 10),
|
|
51
|
+
// DevTools front-end host wc surface (the WebContentsView flavor is used
|
|
52
|
+
// for `simulatorView.webContents`, i.e. the right-panel DevTools host).
|
|
53
|
+
isLoading: vi.fn(() => false),
|
|
54
|
+
executeJavaScript: vi.fn(() => Promise.resolve()),
|
|
55
|
+
setDevToolsWebContents: vi.fn(),
|
|
56
|
+
openDevTools: vi.fn(),
|
|
57
|
+
isDevToolsOpened: vi.fn(() => false),
|
|
58
|
+
closeDevTools: vi.fn(),
|
|
59
|
+
getURL: vi.fn(() => ''),
|
|
60
|
+
...overrides,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** The `electron` module surface view-manager and its injectors touch. */
|
|
64
|
+
export function electronModuleMock() {
|
|
65
|
+
let nextId = 1;
|
|
66
|
+
class WebContentsView {
|
|
67
|
+
webContents;
|
|
68
|
+
setBounds = vi.fn();
|
|
69
|
+
setBackgroundColor = vi.fn();
|
|
70
|
+
constructor(_opts) {
|
|
71
|
+
this.webContents = makeStubWc(nextId++, {
|
|
72
|
+
close: vi.fn(function () { this.destroyed = true; }),
|
|
73
|
+
});
|
|
74
|
+
constructed.push(this);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const ipcMain = {
|
|
78
|
+
on: vi.fn(),
|
|
79
|
+
removeListener: vi.fn(),
|
|
80
|
+
handle: vi.fn(),
|
|
81
|
+
removeHandler: vi.fn(),
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
WebContentsView,
|
|
85
|
+
ipcMain,
|
|
86
|
+
shell: { openExternal: vi.fn() },
|
|
87
|
+
nativeTheme: { shouldUseDarkColors: false, on: vi.fn(), removeListener: vi.fn() },
|
|
88
|
+
webContents: {
|
|
89
|
+
fromId: vi.fn((id) => serviceWcRegistry.get(id)),
|
|
90
|
+
getAllWebContents: vi.fn(() => []),
|
|
91
|
+
},
|
|
92
|
+
default: { ipcMain },
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export function pathsModuleMock() {
|
|
96
|
+
return {
|
|
97
|
+
mainPreloadPath: '/stub/preload.js',
|
|
98
|
+
hostToolbarRuntimePreloadPath: '/stub/host-toolbar-preload.js',
|
|
99
|
+
hostSidebarRuntimePreloadPath: '/stub/host-sidebar-preload.js',
|
|
100
|
+
hostDialogRuntimePreloadPath: '/stub/host-dialog-preload.js',
|
|
101
|
+
cjsSiblingPreloadPath: (p) => p.replace(/\.js$/, '.cjs'),
|
|
102
|
+
devtoolsPackageRoot: '/stub/devtools-pkg-root',
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export const SIM_URL = 'http://localhost:7788/simulator.html?appId=repoint';
|
|
106
|
+
/** A hidden SERVICE-HOST BrowserWindow wc (top-level, can host DevTools). */
|
|
107
|
+
export function makeServiceWc(id) {
|
|
108
|
+
const wc = makeStubWc(id, { isDevToolsOpened: vi.fn(() => true) });
|
|
109
|
+
serviceWcRegistry.set(id, wc);
|
|
110
|
+
return wc;
|
|
111
|
+
}
|
|
112
|
+
export function makeContext() {
|
|
113
|
+
const addChildView = vi.fn();
|
|
114
|
+
const removeChildView = vi.fn();
|
|
115
|
+
const contentView = { addChildView, removeChildView, children: [] };
|
|
116
|
+
const mainWindow = {
|
|
117
|
+
destroyed: false,
|
|
118
|
+
contentView,
|
|
119
|
+
isDestroyed() { return this.destroyed; },
|
|
120
|
+
getContentSize: () => [1280, 980],
|
|
121
|
+
};
|
|
122
|
+
const notify = {
|
|
123
|
+
popoverInit: vi.fn(),
|
|
124
|
+
popoverClosed: vi.fn(),
|
|
125
|
+
hostToolbarHeightChanged: vi.fn(),
|
|
126
|
+
};
|
|
127
|
+
// ── ctx.bridge stub ───────────────────────────────────────────────────────
|
|
128
|
+
// Minimal `BridgeRouterHandle`: `getServiceWc` resolves to whatever the test
|
|
129
|
+
// currently points `currentServiceWc` at (simulating a pre-warm-pool swap
|
|
130
|
+
// between render events), and `onRenderEvent` fans a manually-driven
|
|
131
|
+
// `RenderEvent` out to every subscriber (view-manager's own follow-path AND
|
|
132
|
+
// elements-forward's internal subscription both register here).
|
|
133
|
+
let currentServiceWc = null;
|
|
134
|
+
const renderEventListeners = new Set();
|
|
135
|
+
const serviceHostReadyListeners = new Set();
|
|
136
|
+
const bridge = {
|
|
137
|
+
isNativeHost: () => true,
|
|
138
|
+
resolveRenderWc: () => null,
|
|
139
|
+
getServiceWc: vi.fn(() => currentServiceWc),
|
|
140
|
+
getServiceWcForBridge: () => null,
|
|
141
|
+
getActiveRenderWc: () => null,
|
|
142
|
+
getActiveBridgeId: () => null,
|
|
143
|
+
onRenderEvent: (listener) => {
|
|
144
|
+
renderEventListeners.add(listener);
|
|
145
|
+
return () => renderEventListeners.delete(listener);
|
|
146
|
+
},
|
|
147
|
+
onServiceHostReady: (listener) => {
|
|
148
|
+
serviceHostReadyListeners.add(listener);
|
|
149
|
+
return () => serviceHostReadyListeners.delete(listener);
|
|
150
|
+
},
|
|
151
|
+
getDevice: () => null,
|
|
152
|
+
setDevice: () => { },
|
|
153
|
+
disposeSessionsForSimulator: () => Promise.resolve(),
|
|
154
|
+
};
|
|
155
|
+
function setActiveServiceWc(wc) {
|
|
156
|
+
currentServiceWc = wc;
|
|
157
|
+
}
|
|
158
|
+
function emitRenderEvent(event) {
|
|
159
|
+
for (const l of [...renderEventListeners])
|
|
160
|
+
l(event);
|
|
161
|
+
}
|
|
162
|
+
function emitServiceHostReady(event) {
|
|
163
|
+
for (const l of [...serviceHostReadyListeners])
|
|
164
|
+
l(event);
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
addChildView,
|
|
168
|
+
removeChildView,
|
|
169
|
+
setActiveServiceWc,
|
|
170
|
+
emitRenderEvent,
|
|
171
|
+
emitServiceHostReady,
|
|
172
|
+
ctx: {
|
|
173
|
+
windows: {
|
|
174
|
+
mainWindow: mainWindow,
|
|
175
|
+
},
|
|
176
|
+
rendererDir: '/stub/renderer',
|
|
177
|
+
notify: notify,
|
|
178
|
+
connections: createConnectionRegistry(),
|
|
179
|
+
preloadPath: '/stub/sim-preload.js',
|
|
180
|
+
bridge: bridge,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=view-manager-devtools-host-test-fixtures.js.map
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { WebContents } from 'electron';
|
|
2
2
|
import type { NativeDeviceInfo } from '../../../shared/ipc-channels.js';
|
|
3
3
|
import { type WorkbenchContext } from '../workbench-context.js';
|
|
4
|
-
import type { HostToolbarMessageSubscription } from './host-toolbar-port-channel.js';
|
|
5
4
|
import type { PlacementSnapshot } from '@dimina-kit/electron-deck/layout';
|
|
6
5
|
import type { DevtoolsExtra } from '../../../shared/view-ids.js';
|
|
6
|
+
import { type HostToolbarControl } from './host-toolbar-view.js';
|
|
7
|
+
import { type HostSidebarViewManagerMembers } from './host-sidebar-view.js';
|
|
8
|
+
import { type HostDialogViewManagerMembers } from './host-dialog-view.js';
|
|
9
|
+
import { type OverlayPanelsView, type TooltipShowPayload } from './overlay-panels-view.js';
|
|
10
|
+
export type { TooltipShowPayload };
|
|
7
11
|
export { resolveProjectEditorTarget, type ProjectEditorTarget, } from './resolve-project-editor-target.js';
|
|
8
12
|
/**
|
|
9
13
|
* Context surface used by the ViewManager. We only need a small slice of the
|
|
@@ -20,6 +24,15 @@ export interface ViewManagerContext {
|
|
|
20
24
|
* `createWorkbenchContext` always supplies it.
|
|
21
25
|
*/
|
|
22
26
|
connections: WorkbenchContext['connections'];
|
|
27
|
+
/**
|
|
28
|
+
* Shared CDP session broker (see cdp-session/index.ts). safe-area acquires
|
|
29
|
+
* render-guest debugger leases through it instead of attaching directly, so
|
|
30
|
+
* it shares sessions with elements-forward/render-inspect/network-forward
|
|
31
|
+
* rather than fighting them for exclusive ownership. Optional so partial
|
|
32
|
+
* test contexts compile (safe-area falls back to a private broker
|
|
33
|
+
* instance); `createWorkbenchContext` always supplies the real one.
|
|
34
|
+
*/
|
|
35
|
+
cdpSessionBroker?: WorkbenchContext['cdpSessionBroker'];
|
|
23
36
|
/** Active project root used to validate/open console source locations. */
|
|
24
37
|
workspace?: WorkbenchContext['workspace'];
|
|
25
38
|
/**
|
|
@@ -55,6 +68,11 @@ export interface ViewManagerContext {
|
|
|
55
68
|
* Optional so partial test contexts compile.
|
|
56
69
|
*/
|
|
57
70
|
simulatorApis?: WorkbenchContext['simulatorApis'];
|
|
71
|
+
/**
|
|
72
|
+
* Host-registered UI extensions that follow the native simulator WCV.
|
|
73
|
+
* Optional only for focused view-manager test doubles.
|
|
74
|
+
*/
|
|
75
|
+
simulatorUiExtensions?: WorkbenchContext['simulatorUiExtensions'];
|
|
58
76
|
}
|
|
59
77
|
/**
|
|
60
78
|
* Unified lifecycle manager for Electron WebContentsView overlays.
|
|
@@ -75,7 +93,7 @@ export interface ViewManagerContext {
|
|
|
75
93
|
* panels) and shares a single injected placement reconciler; this file wires
|
|
76
94
|
* them together and exposes their combined method surface.
|
|
77
95
|
*/
|
|
78
|
-
export interface ViewManager {
|
|
96
|
+
export interface ViewManager extends Pick<OverlayPanelsView, 'showSettings' | 'hideSettings' | 'showPopover' | 'hidePopover' | 'prepareTooltip' | 'showTooltip' | 'hideTooltip' | 'markOverlayReady' | 'applyTooltipMeasurement' | 'showProjectCreateDialog' | 'hideProjectCreateDialog' | 'showUpdateDialog' | 'hideUpdateDialog' | 'notifyUpdateDownloadProgress' | 'showDevicePicker' | 'hideDevicePicker' | 'getProjectCreateDialogWebContentsId' | 'getUpdateDialogWebContentsId' | 'getDevicePickerWebContentsId'>, HostSidebarViewManagerMembers, HostDialogViewManagerMembers {
|
|
79
97
|
/**
|
|
80
98
|
* NATIVE-HOST ONLY. Create the simulator itself as a top-level
|
|
81
99
|
* WebContentsView (not a renderer `<webview>` guest) loading `simulatorUrl`,
|
|
@@ -104,6 +122,13 @@ export interface ViewManager {
|
|
|
104
122
|
* back to the hard attachNativeSimulator rebuild.
|
|
105
123
|
*/
|
|
106
124
|
softReloadNativeSimulator(simulatorUrl: string): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Style-only fast path after a watcher rebuild: hot-swap the render-host
|
|
127
|
+
* stylesheets in place (no shell respawn), preserving the page stack / form
|
|
128
|
+
* state / focus. Returns false when no live+ready guest exists so the caller
|
|
129
|
+
* falls back to the full soft reload.
|
|
130
|
+
*/
|
|
131
|
+
refreshSimulatorStyles(): boolean;
|
|
107
132
|
/**
|
|
108
133
|
* Destroy and null out the simulator view (e.g. on simulator detach).
|
|
109
134
|
* Also destroys the cached settings view and hides the popover —
|
|
@@ -111,17 +136,23 @@ export interface ViewManager {
|
|
|
111
136
|
* `windows/views.ts` module, which every detach call relied on.
|
|
112
137
|
*/
|
|
113
138
|
detachSimulator(): void;
|
|
114
|
-
/** Lazy-create and show the settings overlay view. */
|
|
115
|
-
showSettings(): Promise<void>;
|
|
116
|
-
/** Remove the settings overlay view (kept around for next open). */
|
|
117
|
-
hideSettings(): void;
|
|
118
|
-
/** Create and show the popover overlay with the given init payload. */
|
|
119
|
-
showPopover(data: unknown): void;
|
|
120
|
-
/** Destroy the popover overlay and notify the renderer. */
|
|
121
|
-
hidePopover(): void;
|
|
122
139
|
/** Re-apply layout for every currently visible overlay (on window resize). */
|
|
123
140
|
repositionAll(): void;
|
|
124
|
-
/**
|
|
141
|
+
/**
|
|
142
|
+
* Destroy the PROJECT-scoped views: the simulator (with its devtools host
|
|
143
|
+
* and settings/popover overlays), the embedded workbench editor, and the
|
|
144
|
+
* per-guest safe-area sessions. Deliberately does NOT touch the host
|
|
145
|
+
* toolbar — its webContents lifecycle belongs to the HOST, so it survives
|
|
146
|
+
* closing a project. This is what `workspace.closeProject()` calls.
|
|
147
|
+
*/
|
|
148
|
+
disposeProjectViews(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Destroy ALL managed views: everything `disposeProjectViews()` covers PLUS
|
|
151
|
+
* the host toolbar (its view, port channel, and the ref-counted
|
|
152
|
+
* session-runtime preload registration). App/window teardown only — the
|
|
153
|
+
* context's DisposableRegistry runs this so the toolbar's session-level
|
|
154
|
+
* resources are released exactly once, at the end of the manager's life.
|
|
155
|
+
*/
|
|
125
156
|
disposeAll(): void;
|
|
126
157
|
/** Return the webContents ID of the currently attached simulator. */
|
|
127
158
|
getSimulatorWebContentsId(): number | null;
|
|
@@ -135,6 +166,8 @@ export interface ViewManager {
|
|
|
135
166
|
getSettingsWebContentsId(): number | null;
|
|
136
167
|
/** Return the webContents ID of the popover overlay if alive, else null. */
|
|
137
168
|
getPopoverWebContentsId(): number | null;
|
|
169
|
+
/** Return the webContents ID of the tooltip overlay if alive, else null. */
|
|
170
|
+
getTooltipWebContentsId(): number | null;
|
|
138
171
|
/**
|
|
139
172
|
* Return the webContents ID of the host-toolbar overlay if alive, else null.
|
|
140
173
|
* The host-toolbar WCV is the one overlay whose OWN renderer drives an IPC
|
|
@@ -171,6 +204,12 @@ export interface ViewManager {
|
|
|
171
204
|
* view tree.
|
|
172
205
|
*/
|
|
173
206
|
setPlacementSnapshot(snapshot: PlacementSnapshot<DevtoolsExtra>): void;
|
|
207
|
+
/**
|
|
208
|
+
* Hand out a fresh generation seed for a renderer bootstrap. See
|
|
209
|
+
* `PlacementReconciler.allocateGeneration`'s doc-comment for why this
|
|
210
|
+
* replaces a wall-clock (`Date.now()`) seed.
|
|
211
|
+
*/
|
|
212
|
+
allocatePlacementGeneration(): number;
|
|
174
213
|
/**
|
|
175
214
|
* Lazily create the workbench WebContentsView, load `<url>index.html`, and
|
|
176
215
|
* add it to the contentView. `url` is the COI server's base URL (trailing
|
|
@@ -181,11 +220,29 @@ export interface ViewManager {
|
|
|
181
220
|
/**
|
|
182
221
|
* Store the workbench COI base URL without loading it. The heavy
|
|
183
222
|
* WebContentsView load is deferred to the first visible
|
|
184
|
-
* `setWorkbenchBounds
|
|
223
|
+
* `setWorkbenchBounds` — and further deferred while `holdWorkbenchAttach`
|
|
224
|
+
* is in force — keeping it off the app boot critical path.
|
|
185
225
|
*/
|
|
186
226
|
setWorkbenchSource(url: string): void;
|
|
187
227
|
/** Destroy the workbench editor view (teardown). No-op if never attached. */
|
|
188
228
|
detachWorkbench(): void;
|
|
229
|
+
/**
|
|
230
|
+
* Close the workbench attach gate: while held (and the view does not exist
|
|
231
|
+
* yet), the lazy attach is deferred so the editor's heavy load stays out of
|
|
232
|
+
* a project open's boot-critical window (teardown + first compile). Returns
|
|
233
|
+
* an idempotent release fn bound to this hold; a newer hold supersedes it
|
|
234
|
+
* (its release becomes a no-op), explicit user intent (openFileInWorkbench)
|
|
235
|
+
* opens the gate, and a 3s cap self-releases with a warn so the editor is
|
|
236
|
+
* never deferred unboundedly. The gate never hides or destroys a live view.
|
|
237
|
+
*/
|
|
238
|
+
holdWorkbenchAttach(): () => void;
|
|
239
|
+
/**
|
|
240
|
+
* Void the current workbench attach hold WITHOUT the release replay. For
|
|
241
|
+
* teardown paths that preempt an in-flight open (closeProject, disposeAll):
|
|
242
|
+
* the superseded open's late release or its cap firing must not rebuild the
|
|
243
|
+
* editor view after the project is gone. No-op when nothing is held.
|
|
244
|
+
*/
|
|
245
|
+
cancelWorkbenchAttachHold(): void;
|
|
189
246
|
/**
|
|
190
247
|
* Reveal a project file in the embedded workbench at a 1-based line/column
|
|
191
248
|
* (the open-in-editor target coordinate convention). Drives the workbench's
|
|
@@ -212,82 +269,6 @@ export interface ViewManager {
|
|
|
212
269
|
*/
|
|
213
270
|
readonly hostToolbar: HostToolbarControl;
|
|
214
271
|
}
|
|
215
|
-
/**
|
|
216
|
-
* Height mode for the host-toolbar placeholder strip. `'auto'` (default): the
|
|
217
|
-
* session-resident advertiser's reports drive the height. `{ fixed }`: the
|
|
218
|
-
* host pins the height; advertiser reports are ignored until `'auto'` again.
|
|
219
|
-
*/
|
|
220
|
-
export type HostToolbarHeightMode = 'auto' | {
|
|
221
|
-
fixed: number;
|
|
222
|
-
};
|
|
223
|
-
/**
|
|
224
|
-
* The control object the downstream host uses to own the toolbar
|
|
225
|
-
* WebContentsView. Lazily backed by the view-manager's `hostToolbarView`.
|
|
226
|
-
*/
|
|
227
|
-
export interface HostToolbarControl {
|
|
228
|
-
/** Load a URL into the toolbar view (lazy-creates the view). */
|
|
229
|
-
loadURL(url: string): Promise<void>;
|
|
230
|
-
/** Load a local file into the toolbar view (lazy-creates the view). */
|
|
231
|
-
loadFile(path: string): Promise<void>;
|
|
232
|
-
/** The toolbar view's live WebContents, or null if not yet created/destroyed. */
|
|
233
|
-
readonly webContents: WebContents | null;
|
|
234
|
-
/** Remove the toolbar view from the contentView and reset it (kept alive). */
|
|
235
|
-
hide(): void;
|
|
236
|
-
/**
|
|
237
|
-
* The HOST's own `webPreferences.preload` for the toolbar view (purely
|
|
238
|
-
* additive). The framework's height-advertiser runtime does NOT ride
|
|
239
|
-
* `webPreferences.preload` — it is session-resident (registered on
|
|
240
|
-
* `session.defaultSession`, self-guarded by the `--dimina-host-toolbar`
|
|
241
|
-
* marker + `isMainFrame`), so a host preload set here coexists with it and
|
|
242
|
-
* never replaces it. Must be set before the view is (re)created (first
|
|
243
|
-
* `loadURL`/`loadFile`, or the next one after the host closed the
|
|
244
|
-
* webContents); `null` (default) means "no host preload" — it does not and
|
|
245
|
-
* cannot restore any built-in preload.
|
|
246
|
-
*/
|
|
247
|
-
setPreloadPath(path: string | null): void;
|
|
248
|
-
/**
|
|
249
|
-
* Register a host-side handler for messages the toolbar PAGE sends via
|
|
250
|
-
* `window.diminaHostToolbar.send(channel, payload)`. Control-level: may be
|
|
251
|
-
* called before the view exists and survives page reloads / wc rebuilds
|
|
252
|
-
* (each per-load MessagePort handshake re-attaches the registry to the new
|
|
253
|
-
* port). Throws on an empty / non-string channel. `dispose()` detaches
|
|
254
|
-
* (idempotent).
|
|
255
|
-
*/
|
|
256
|
-
onMessage(channel: string, handler: (payload: unknown) => void): HostToolbarMessageSubscription;
|
|
257
|
-
/**
|
|
258
|
-
* Observe handshake readiness — the push counterpart to polling `send()`
|
|
259
|
-
* for `true`. Fires the handler once per load generation, exactly when
|
|
260
|
-
* that load's MessagePort handshake completes; registering while the
|
|
261
|
-
* channel is ALREADY ready fires once asynchronously on a microtask
|
|
262
|
-
* (missed-signal race guard, re-validated at fire time). A reload /
|
|
263
|
-
* re-handshake fires registered handlers again; a host-initiated
|
|
264
|
-
* `loadURL`/`loadFile` invalidates readiness at initiation, so handlers
|
|
265
|
-
* registered in that window wait for the NEW document's handshake.
|
|
266
|
-
* `dispose()` detaches (idempotent); `disposeAll` sweeps everything.
|
|
267
|
-
*/
|
|
268
|
-
onReady(handler: () => void): HostToolbarMessageSubscription;
|
|
269
|
-
/**
|
|
270
|
-
* Post `{ channel, payload }` to the toolbar page (received via
|
|
271
|
-
* `window.diminaHostToolbar.onMessage(channel, handler)`). Gated and
|
|
272
|
-
* non-queueing: returns false — delivering nothing, creating no view —
|
|
273
|
-
* while there is no live toolbar webContents, the current load's
|
|
274
|
-
* MessagePort handshake hasn't completed, or a document-replacing
|
|
275
|
-
* navigation is in flight (`loadURL`/`loadFile` was issued, or the page
|
|
276
|
-
* itself started a main-frame cross-document navigation, and the new
|
|
277
|
-
* document hasn't handshaked yet); true once the envelope went out.
|
|
278
|
-
* No manual `getHostToolbarWebContentsId` gating needed: the false/true
|
|
279
|
-
* result IS the readiness signal.
|
|
280
|
-
*/
|
|
281
|
-
send(channel: string, payload: unknown): boolean;
|
|
282
|
-
/**
|
|
283
|
-
* Pin or unpin the toolbar strip height. `{ fixed }` notifies the renderer
|
|
284
|
-
* placeholder with that height immediately (so a preload-less/static toolbar
|
|
285
|
-
* is visible without any advertiser report) and ignores subsequent advertiser
|
|
286
|
-
* reports. `'auto'` (default) re-enables advertiser-driven height starting
|
|
287
|
-
* from the NEXT report — it does not synthesize/replay a stale height.
|
|
288
|
-
*/
|
|
289
|
-
setHeightMode(mode: HostToolbarHeightMode): void;
|
|
290
|
-
}
|
|
291
272
|
/**
|
|
292
273
|
* Build a ViewManager bound to the given context. The returned object is the
|
|
293
274
|
* only component allowed to instantiate or add/remove overlay WebContentsViews.
|
|
@@ -3,7 +3,9 @@ import { createPlacementReconciler } from './placement-reconciler.js';
|
|
|
3
3
|
import { createWorkbenchView } from './workbench-view.js';
|
|
4
4
|
import { createDevtoolsHost } from './native-simulator-devtools-host.js';
|
|
5
5
|
import { createHostToolbarView } from './host-toolbar-view.js';
|
|
6
|
-
import {
|
|
6
|
+
import { createHostSidebarView } from './host-sidebar-view.js';
|
|
7
|
+
import { createHostDialogView } from './host-dialog-view.js';
|
|
8
|
+
import { createOverlayPanelsView, } from './overlay-panels-view.js';
|
|
7
9
|
import { createNativeSimulatorView } from './native-simulator-view.js';
|
|
8
10
|
export { resolveProjectEditorTarget, } from './resolve-project-editor-target.js';
|
|
9
11
|
/**
|
|
@@ -17,7 +19,7 @@ export function createViewManager(ctx) {
|
|
|
17
19
|
// CSS env(safe-area-inset-*) simulation for render-host guests (per device).
|
|
18
20
|
// Driven from did-attach-webview in the simulator domain and re-pushed on
|
|
19
21
|
// device change via reapplySafeArea. Torn down in disposeAll.
|
|
20
|
-
const safeArea = createSafeAreaController({ connections: ctx.connections });
|
|
22
|
+
const safeArea = createSafeAreaController({ connections: ctx.connections, broker: ctx.cdpSessionBroker });
|
|
21
23
|
// The single level-triggered placement reconciler every view domain shares —
|
|
22
24
|
// the sole owner of placement state (docs/view-placement-reconciler.md). Each
|
|
23
25
|
// domain registers exactly one view slot with it.
|
|
@@ -34,6 +36,11 @@ export function createViewManager(ctx) {
|
|
|
34
36
|
const hostToolbar = createHostToolbarView(ctx, reconciler, {
|
|
35
37
|
reapplyPresentOverlays: () => reapplyToolbarDependentOverlays(),
|
|
36
38
|
});
|
|
39
|
+
// Sidebar and dialog are host-scoped like the toolbar (survive project
|
|
40
|
+
// close/reopen) but carry no height-cycle dependency on the overlay panels,
|
|
41
|
+
// so unlike hostToolbar they need no thunk into this scope.
|
|
42
|
+
const hostSidebar = createHostSidebarView(ctx, reconciler);
|
|
43
|
+
const hostDialog = createHostDialogView(ctx, reconciler);
|
|
37
44
|
const overlayPanels = createOverlayPanelsView(ctx, reconciler, {
|
|
38
45
|
getHostToolbarHeight: hostToolbar.getHostToolbarHeight,
|
|
39
46
|
});
|
|
@@ -45,27 +52,64 @@ export function createViewManager(ctx) {
|
|
|
45
52
|
function reapplyToolbarDependentOverlays() {
|
|
46
53
|
overlayPanels.reapplyPresentOverlays();
|
|
47
54
|
}
|
|
48
|
-
function
|
|
55
|
+
function disposeProjectViews() {
|
|
49
56
|
// Aggregate simulator detach first (native simulator + devtools host +
|
|
50
|
-
// settings/popover), then the workbench, the
|
|
51
|
-
//
|
|
57
|
+
// settings/popover), then the workbench, then the per-guest safe-area
|
|
58
|
+
// sessions. The host toolbar is exempt: it is HOST-scoped (the host loads
|
|
59
|
+
// and drives it; the height-replay machinery exists precisely for the
|
|
60
|
+
// close-project → reopen flow), so a project's teardown must not kill it.
|
|
52
61
|
nativeSimulator.detachSimulator();
|
|
53
62
|
// Embedded workbench editor view (no-op when the host never opted in;
|
|
54
63
|
// also removes the devtools-theme sync listener).
|
|
55
64
|
workbench.detachWorkbench();
|
|
56
|
-
hostToolbar.dispose();
|
|
57
65
|
safeArea.dispose();
|
|
58
66
|
}
|
|
67
|
+
function disposeAll() {
|
|
68
|
+
// App-level teardown invalidates any in-flight open's attach hold first,
|
|
69
|
+
// so the held-detach preserve path below can't keep a desired around for
|
|
70
|
+
// a release/cap replay to rebuild.
|
|
71
|
+
workbench.cancelWorkbenchAttachHold();
|
|
72
|
+
disposeProjectViews();
|
|
73
|
+
// Host-scoped teardown: the toolbar/sidebar/dialog views, their port
|
|
74
|
+
// channels, and their ref-counted session-runtime preload registrations.
|
|
75
|
+
hostToolbar.dispose();
|
|
76
|
+
hostSidebar.dispose();
|
|
77
|
+
hostDialog.dispose();
|
|
78
|
+
// Devtools-owned overlay-panel dialogs (project-create/update) — never
|
|
79
|
+
// torn down by disposeProjectViews(), they'd otherwise outlive every
|
|
80
|
+
// other view once the app tears down.
|
|
81
|
+
overlayPanels.destroyDialogs();
|
|
82
|
+
}
|
|
59
83
|
return {
|
|
60
84
|
attachNativeSimulator: nativeSimulator.attachNativeSimulator,
|
|
61
85
|
softReloadNativeSimulator: nativeSimulator.softReloadNativeSimulator,
|
|
86
|
+
refreshSimulatorStyles: nativeSimulator.refreshSimulatorStyles,
|
|
62
87
|
detachSimulator: nativeSimulator.detachSimulator,
|
|
63
88
|
reapplySafeArea: (device) => safeArea.reapplyAll(device),
|
|
64
89
|
showSettings: overlayPanels.showSettings,
|
|
65
90
|
hideSettings: overlayPanels.hideSettings,
|
|
66
91
|
showPopover: overlayPanels.showPopover,
|
|
67
92
|
hidePopover: overlayPanels.hidePopover,
|
|
68
|
-
|
|
93
|
+
prepareTooltip: overlayPanels.prepareTooltip,
|
|
94
|
+
showTooltip: overlayPanels.showTooltip,
|
|
95
|
+
hideTooltip: overlayPanels.hideTooltip,
|
|
96
|
+
markOverlayReady: overlayPanels.markOverlayReady,
|
|
97
|
+
applyTooltipMeasurement: overlayPanels.applyTooltipMeasurement,
|
|
98
|
+
showProjectCreateDialog: overlayPanels.showProjectCreateDialog,
|
|
99
|
+
hideProjectCreateDialog: overlayPanels.hideProjectCreateDialog,
|
|
100
|
+
showUpdateDialog: overlayPanels.showUpdateDialog,
|
|
101
|
+
hideUpdateDialog: overlayPanels.hideUpdateDialog,
|
|
102
|
+
notifyUpdateDownloadProgress: overlayPanels.notifyUpdateDownloadProgress,
|
|
103
|
+
showDevicePicker: overlayPanels.showDevicePicker,
|
|
104
|
+
hideDevicePicker: overlayPanels.hideDevicePicker,
|
|
105
|
+
getProjectCreateDialogWebContentsId: overlayPanels.getProjectCreateDialogWebContentsId,
|
|
106
|
+
getUpdateDialogWebContentsId: overlayPanels.getUpdateDialogWebContentsId,
|
|
107
|
+
getDevicePickerWebContentsId: overlayPanels.getDevicePickerWebContentsId,
|
|
108
|
+
repositionAll: () => {
|
|
109
|
+
overlayPanels.reapplyPresentOverlays();
|
|
110
|
+
hostDialog.reposition();
|
|
111
|
+
},
|
|
112
|
+
disposeProjectViews,
|
|
69
113
|
disposeAll,
|
|
70
114
|
getSimulatorWebContentsId: nativeSimulator.getSimulatorWebContentsId,
|
|
71
115
|
getSimulatorWebContents: nativeSimulator.getSimulatorWebContents,
|
|
@@ -73,16 +117,27 @@ export function createViewManager(ctx) {
|
|
|
73
117
|
getSettingsWebContents: overlayPanels.getSettingsWebContents,
|
|
74
118
|
getSettingsWebContentsId: overlayPanels.getSettingsWebContentsId,
|
|
75
119
|
getPopoverWebContentsId: overlayPanels.getPopoverWebContentsId,
|
|
120
|
+
getTooltipWebContentsId: overlayPanels.getTooltipWebContentsId,
|
|
76
121
|
getHostToolbarWebContentsId: hostToolbar.getHostToolbarWebContentsId,
|
|
77
122
|
getHostToolbarHeight: hostToolbar.getHostToolbarHeight,
|
|
78
123
|
resize: () => overlayPanels.applySettingsBoundsIfPresent(),
|
|
79
124
|
setPlacementSnapshot: reconciler.setPlacementSnapshot,
|
|
125
|
+
allocatePlacementGeneration: reconciler.allocateGeneration,
|
|
80
126
|
attachWorkbench: workbench.attachWorkbench,
|
|
81
127
|
setWorkbenchSource: workbench.setWorkbenchSource,
|
|
82
128
|
detachWorkbench: workbench.detachWorkbench,
|
|
83
129
|
openFileInWorkbench: workbench.openFileInWorkbench,
|
|
130
|
+
holdWorkbenchAttach: workbench.holdWorkbenchAttach,
|
|
131
|
+
cancelWorkbenchAttachHold: workbench.cancelWorkbenchAttachHold,
|
|
84
132
|
setHostToolbarHeight: hostToolbar.setHostToolbarHeight,
|
|
85
133
|
hostToolbar: hostToolbar.control,
|
|
134
|
+
getHostSidebarWebContentsId: hostSidebar.getHostSidebarWebContentsId,
|
|
135
|
+
getHostSidebarWidth: hostSidebar.getHostSidebarWidth,
|
|
136
|
+
setHostSidebarWidth: hostSidebar.setHostSidebarWidth,
|
|
137
|
+
hostSidebar: hostSidebar.control,
|
|
138
|
+
getHostDialogWebContentsId: hostDialog.getHostDialogWebContentsId,
|
|
139
|
+
reportHostDialogMeasuredExtent: hostDialog.reportMeasuredExtent,
|
|
140
|
+
hostDialog: hostDialog.control,
|
|
86
141
|
};
|
|
87
142
|
}
|
|
88
143
|
//# sourceMappingURL=view-manager.js.map
|
|
@@ -10,6 +10,8 @@ export interface WorkbenchView {
|
|
|
10
10
|
setWorkbenchSource(url: string): void;
|
|
11
11
|
detachWorkbench(): void;
|
|
12
12
|
openFileInWorkbench(relPath: string, line: number, column: number): boolean;
|
|
13
|
+
holdWorkbenchAttach(): () => void;
|
|
14
|
+
cancelWorkbenchAttachHold(): void;
|
|
13
15
|
}
|
|
14
16
|
export declare function createWorkbenchView(ctx: ViewManagerContext, reconciler: PlacementReconciler): WorkbenchView;
|
|
15
17
|
//# sourceMappingURL=workbench-view.d.ts.map
|