@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,40 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Session-scoped listener bookkeeping. An app session hangs lifecycle hooks on
|
|
3
|
-
* emitters it does NOT own — the shared simulator WebContentsView, a pooled
|
|
4
|
-
* service-host window — and those emitters outlive the session (one simulator
|
|
5
|
-
* wc soft-reloads through many sessions). Every such hook is registered
|
|
6
|
-
* through this bag so the session's single teardown chokepoint can detach them
|
|
7
|
-
* all with one `dispose()`; a hook left behind survives as a dead listener on
|
|
8
|
-
* the shared emitter, growing by one per soft reload until Node's MaxListeners
|
|
9
|
-
* warning fires.
|
|
10
|
-
*/
|
|
11
|
-
export function createSessionListenerBag() {
|
|
12
|
-
const records = [];
|
|
13
|
-
let disposed = false;
|
|
14
|
-
return {
|
|
15
|
-
on(emitter, event, fn) {
|
|
16
|
-
if (disposed)
|
|
17
|
-
return;
|
|
18
|
-
emitter.on(event, fn);
|
|
19
|
-
records.push({ emitter, event, fn });
|
|
20
|
-
},
|
|
21
|
-
once(emitter, event, fn) {
|
|
22
|
-
if (disposed)
|
|
23
|
-
return;
|
|
24
|
-
emitter.once(event, fn);
|
|
25
|
-
records.push({ emitter, event, fn });
|
|
26
|
-
},
|
|
27
|
-
dispose() {
|
|
28
|
-
if (disposed)
|
|
29
|
-
return;
|
|
30
|
-
disposed = true;
|
|
31
|
-
for (const { emitter, event, fn } of records) {
|
|
32
|
-
if (emitter.isDestroyed?.())
|
|
33
|
-
continue;
|
|
34
|
-
emitter.removeListener(event, fn);
|
|
35
|
-
}
|
|
36
|
-
records.length = 0;
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
1
|
+
export * from '@dimina-kit/electron-runtime/main/session-listener-bag';
|
|
40
2
|
//# sourceMappingURL=session-listener-bag.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { WorkbenchModule } from '../services/module.js';
|
|
3
3
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
4
|
-
|
|
4
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
5
|
+
type SessionIpcCtx = Pick<WorkbenchContext, 'workspace' | 'senderPolicy'>;
|
|
6
|
+
export declare function registerSessionIpc(input: IpcInput<SessionIpcCtx>): Disposable;
|
|
5
7
|
export declare const sessionModule: WorkbenchModule;
|
|
8
|
+
export {};
|
|
6
9
|
//# sourceMappingURL=session.d.ts.map
|
package/dist/main/ipc/session.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { ProjectChannel } from '../../shared/ipc-channels.js';
|
|
2
|
-
import { ProjectCaptureThumbnailSchema, ProjectGetCompileConfigSchema, ProjectGetPagesSchema, ProjectGetThumbnailSchema, ProjectOpenSchema, ProjectSaveCompileConfigSchema,
|
|
2
|
+
import { ProjectCaptureThumbnailSchema, ProjectGetCompileConfigSchema, ProjectGetCompileModeStateSchema, ProjectGetPagesSchema, ProjectGetThumbnailSchema, ProjectOpenSchema, ProjectSaveCompileConfigSchema, } from '../../shared/ipc-schemas.js';
|
|
3
3
|
import { validate } from '../utils/ipc-schema.js';
|
|
4
4
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
|
+
export function registerSessionIpc(input) {
|
|
7
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
8
|
+
.handleRouted(ProjectChannel.Open, (ctx, _e, ...args) => {
|
|
8
9
|
const [projectPath] = validate(ProjectChannel.Open, ProjectOpenSchema, args);
|
|
9
10
|
return ctx.workspace.openProject(projectPath);
|
|
10
11
|
})
|
|
11
|
-
.
|
|
12
|
+
.handleRouted(ProjectChannel.GetPages, (ctx, _e, ...args) => {
|
|
12
13
|
const [projectPath] = validate(ProjectChannel.GetPages, ProjectGetPagesSchema, args);
|
|
13
14
|
return ctx.workspace.getProjectPages(projectPath);
|
|
14
15
|
})
|
|
15
|
-
.
|
|
16
|
+
.handleRouted(ProjectChannel.GetCompileConfig, (ctx, _e, ...args) => {
|
|
16
17
|
const [projectPath] = validate(ProjectChannel.GetCompileConfig, ProjectGetCompileConfigSchema, args);
|
|
17
18
|
return ctx.workspace.getCompileConfig(projectPath);
|
|
18
19
|
})
|
|
19
|
-
.
|
|
20
|
+
.handleRouted(ProjectChannel.SaveCompileConfig, (ctx, _e, ...args) => {
|
|
20
21
|
const [projectPath, config] = validate(ProjectChannel.SaveCompileConfig, ProjectSaveCompileConfigSchema, args);
|
|
21
22
|
return ctx.workspace.saveCompileConfig(projectPath, config);
|
|
22
23
|
})
|
|
23
|
-
.
|
|
24
|
+
.handleRouted(ProjectChannel.GetCompileModeState, (ctx, _e, ...args) => {
|
|
25
|
+
const [projectPath] = validate(ProjectChannel.GetCompileModeState, ProjectGetCompileModeStateSchema, args);
|
|
26
|
+
return ctx.workspace.getCompileModeState(projectPath);
|
|
27
|
+
})
|
|
28
|
+
.handleRouted(ProjectChannel.Close, (ctx) => {
|
|
24
29
|
return ctx.workspace.closeProject();
|
|
25
30
|
})
|
|
26
|
-
.
|
|
31
|
+
.handleRouted(ProjectChannel.Rebuild, async (ctx) => {
|
|
32
|
+
const session = ctx.workspace.getSession();
|
|
33
|
+
if (!session)
|
|
34
|
+
throw new Error('project:rebuild — no active project session');
|
|
35
|
+
// A host CompilationAdapter predating session.rebuild must not break:
|
|
36
|
+
// degrade discernibly so the renderer falls back to reattach-only.
|
|
37
|
+
if (typeof session.rebuild !== 'function')
|
|
38
|
+
return { supported: false };
|
|
39
|
+
await session.rebuild();
|
|
40
|
+
return { supported: true };
|
|
41
|
+
})
|
|
42
|
+
.handleRouted(ProjectChannel.CaptureThumbnail, (ctx, _e, ...args) => {
|
|
27
43
|
const [projectPath] = validate(ProjectChannel.CaptureThumbnail, ProjectCaptureThumbnailSchema, args);
|
|
28
44
|
return ctx.workspace.captureThumbnail(projectPath);
|
|
29
45
|
})
|
|
30
|
-
.
|
|
46
|
+
.handleRouted(ProjectChannel.GetThumbnail, (ctx, _e, ...args) => {
|
|
31
47
|
const [projectPath] = validate(ProjectChannel.GetThumbnail, ProjectGetThumbnailSchema, args);
|
|
32
48
|
return ctx.workspace.getThumbnail(projectPath);
|
|
33
|
-
})
|
|
34
|
-
.handle(ProjectChannel.GetLaunchConfigs, (_, ...args) => {
|
|
35
|
-
const [projectPath] = validate(ProjectChannel.GetLaunchConfigs, ProjectGetLaunchConfigsSchema, args);
|
|
36
|
-
return ctx.workspace.getLaunchConfigs(projectPath);
|
|
37
|
-
})
|
|
38
|
-
.handle(ProjectChannel.SaveLaunchConfigs, (_, ...args) => {
|
|
39
|
-
const [projectPath, configs] = validate(ProjectChannel.SaveLaunchConfigs, ProjectSaveLaunchConfigsSchema, args);
|
|
40
|
-
return ctx.workspace.saveLaunchConfigs(projectPath, configs);
|
|
41
|
-
})
|
|
42
|
-
.handle(ProjectChannel.GetActiveLaunchConfigId, (_, ...args) => {
|
|
43
|
-
const [projectPath] = validate(ProjectChannel.GetActiveLaunchConfigId, ProjectGetActiveLaunchConfigIdSchema, args);
|
|
44
|
-
return ctx.workspace.getActiveLaunchConfigId(projectPath);
|
|
45
|
-
})
|
|
46
|
-
.handle(ProjectChannel.SaveActiveLaunchConfigId, (_, ...args) => {
|
|
47
|
-
const [projectPath, id] = validate(ProjectChannel.SaveActiveLaunchConfigId, ProjectSaveActiveLaunchConfigIdSchema, args);
|
|
48
|
-
return ctx.workspace.saveActiveLaunchConfigId(projectPath, id);
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
export const sessionModule = {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
3
3
|
import type { WorkbenchModule } from '../services/module.js';
|
|
4
|
-
|
|
4
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
5
|
+
type SettingsIpcCtx = Pick<WorkbenchContext, 'views' | 'notify' | 'workspace' | 'rendererDir' | 'senderPolicy'>;
|
|
6
|
+
export declare function registerSettingsIpc(input: IpcInput<SettingsIpcCtx>): Disposable;
|
|
5
7
|
export declare const settingsModule: WorkbenchModule;
|
|
8
|
+
export {};
|
|
6
9
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import { app } from 'electron';
|
|
2
2
|
import { loadWorkbenchSettings, saveWorkbenchSettings, applyTheme, } from '../services/settings/index.js';
|
|
3
|
-
import { WorkbenchSettingsChannel
|
|
3
|
+
import { WorkbenchSettingsChannel } from '../../shared/ipc-channels.js';
|
|
4
|
+
import { SettingsChannel } from '../../shared/ipc-channels-overlays.js';
|
|
4
5
|
import { DEFAULT_CDP_PORT } from '../../shared/constants.js';
|
|
5
6
|
import { getMcpStatus } from '../services/mcp/status.js';
|
|
6
|
-
import {
|
|
7
|
+
import { SettingsProjectSettingsChangedSchema, SettingsSetVisibleSchema, WorkbenchSettingsSaveSchema, WorkbenchSettingsSetThemeSchema, } from '../../shared/ipc-schemas.js';
|
|
7
8
|
import { validate } from '../utils/ipc-schema.js';
|
|
8
9
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
11
|
+
export function registerSettingsIpc(input) {
|
|
12
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
13
|
+
.handleRouted(WorkbenchSettingsChannel.Get, () => {
|
|
12
14
|
return loadWorkbenchSettings();
|
|
13
15
|
})
|
|
14
|
-
.
|
|
16
|
+
.handleRouted(WorkbenchSettingsChannel.Save, (_ctx, _e, ...args) => {
|
|
15
17
|
const [settings] = validate(WorkbenchSettingsChannel.Save, WorkbenchSettingsSaveSchema, args);
|
|
16
18
|
saveWorkbenchSettings(settings);
|
|
17
19
|
applyTheme(settings.theme ?? 'system');
|
|
18
20
|
return { success: true };
|
|
19
21
|
})
|
|
20
|
-
.
|
|
22
|
+
.handleRouted(WorkbenchSettingsChannel.SetTheme, (_ctx, _e, ...args) => {
|
|
21
23
|
const [theme] = validate(WorkbenchSettingsChannel.SetTheme, WorkbenchSettingsSetThemeSchema, args);
|
|
22
24
|
applyTheme(theme);
|
|
23
25
|
})
|
|
24
|
-
.
|
|
26
|
+
.handleRouted(WorkbenchSettingsChannel.Restart, () => {
|
|
27
|
+
app.relaunch();
|
|
28
|
+
app.quit();
|
|
29
|
+
})
|
|
30
|
+
.handleRouted(WorkbenchSettingsChannel.GetCdpStatus, () => {
|
|
25
31
|
const settings = loadWorkbenchSettings();
|
|
26
32
|
const switchValue = app.commandLine.getSwitchValue('remote-debugging-port');
|
|
27
33
|
const implicitDevDefault = !app.isPackaged && !settings.cdp.enabled && switchValue === String(DEFAULT_CDP_PORT);
|
|
@@ -33,7 +39,7 @@ export function registerSettingsIpc(ctx) {
|
|
|
33
39
|
implicitDevDefault,
|
|
34
40
|
};
|
|
35
41
|
})
|
|
36
|
-
.
|
|
42
|
+
.handleRouted(WorkbenchSettingsChannel.GetMcpStatus, () => {
|
|
37
43
|
const settings = loadWorkbenchSettings();
|
|
38
44
|
const runtime = getMcpStatus();
|
|
39
45
|
return {
|
|
@@ -44,14 +50,13 @@ export function registerSettingsIpc(ctx) {
|
|
|
44
50
|
error: runtime.error,
|
|
45
51
|
};
|
|
46
52
|
})
|
|
47
|
-
.
|
|
53
|
+
.handleRouted(SettingsChannel.SetVisible, async (ctx, _e, ...args) => {
|
|
48
54
|
const [visible] = validate(SettingsChannel.SetVisible, SettingsSetVisibleSchema, args);
|
|
49
55
|
if (visible) {
|
|
50
56
|
await ctx.views.showSettings();
|
|
51
57
|
const projectPath = ctx.workspace.getProjectPath();
|
|
52
58
|
ctx.notify.settingsInit({
|
|
53
59
|
projectPath,
|
|
54
|
-
config: await ctx.workspace.getCompileConfig(projectPath),
|
|
55
60
|
projectSettings: ctx.workspace.getProjectSettings(projectPath),
|
|
56
61
|
});
|
|
57
62
|
}
|
|
@@ -59,14 +64,7 @@ export function registerSettingsIpc(ctx) {
|
|
|
59
64
|
ctx.views.hideSettings();
|
|
60
65
|
}
|
|
61
66
|
})
|
|
62
|
-
.
|
|
63
|
-
const [config] = validate(SettingsChannel.ConfigChanged, SettingsConfigChangedSchema, args);
|
|
64
|
-
const projectPath = ctx.workspace.getProjectPath();
|
|
65
|
-
if (projectPath) {
|
|
66
|
-
await ctx.workspace.saveCompileConfig(projectPath, config);
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
.on(SettingsChannel.ProjectSettingsChanged, (_, ...args) => {
|
|
67
|
+
.onRouted(SettingsChannel.ProjectSettingsChanged, (ctx, _e, ...args) => {
|
|
70
68
|
const [patch] = validate(SettingsChannel.ProjectSettingsChanged, SettingsProjectSettingsChangedSchema, args);
|
|
71
69
|
ctx.workspace.updateProjectSettings(ctx.workspace.getProjectPath(), patch);
|
|
72
70
|
});
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { WorkbenchModule } from '../services/module.js';
|
|
2
2
|
/**
|
|
3
|
-
* The 'simulator' built-in module
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The 'simulator' built-in module. views.ts's `registerViewsIpc` is NOT
|
|
4
|
+
* bundled in here — it's registered unconditionally by app.ts (see that call
|
|
5
|
+
* site's comment for why: host-sidebar/host-toolbar placement has no real
|
|
6
|
+
* dependency on the simulator module).
|
|
6
7
|
*
|
|
7
8
|
* Bridge router (native-host PAGE_OPEN / NAV_ACTION / TAB_ACTION etc.) hooks
|
|
8
9
|
* up unconditionally — the `__diminaNativeHost.enabled` flag in the simulator
|
|
9
10
|
* window decides whether to actually call dmb:* channels, but the main-side
|
|
10
11
|
* handlers must always be ready or `ipcRenderer.invoke('dmb:spawn')` fails
|
|
11
12
|
* with `No handler registered`.
|
|
13
|
+
*
|
|
14
|
+
* The router installs onto a concrete context (it assigns `ctx.bridge`,
|
|
15
|
+
* `ctx.consoleForwarder` and `ctx.diagnostics`, which the window assembly
|
|
16
|
+
* reads straight afterwards), so it is per-window wiring rather than
|
|
17
|
+
* app-level registration.
|
|
12
18
|
*/
|
|
13
19
|
export declare const simulatorModule: WorkbenchModule;
|
|
14
20
|
//# sourceMappingURL=simulator-module.d.ts.map
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toDisposable } from '@dimina-kit/electron-deck/main';
|
|
2
2
|
import { registerSimulatorIpc } from './simulator.js';
|
|
3
3
|
import { installBridgeRouter } from './bridge-router.js';
|
|
4
|
-
import { registerViewsIpc } from './views.js';
|
|
5
4
|
/**
|
|
6
|
-
* The 'simulator' built-in module
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* The 'simulator' built-in module. views.ts's `registerViewsIpc` is NOT
|
|
6
|
+
* bundled in here — it's registered unconditionally by app.ts (see that call
|
|
7
|
+
* site's comment for why: host-sidebar/host-toolbar placement has no real
|
|
8
|
+
* dependency on the simulator module).
|
|
9
9
|
*
|
|
10
10
|
* Bridge router (native-host PAGE_OPEN / NAV_ACTION / TAB_ACTION etc.) hooks
|
|
11
11
|
* up unconditionally — the `__diminaNativeHost.enabled` flag in the simulator
|
|
12
12
|
* window decides whether to actually call dmb:* channels, but the main-side
|
|
13
13
|
* handlers must always be ready or `ipcRenderer.invoke('dmb:spawn')` fails
|
|
14
14
|
* with `No handler registered`.
|
|
15
|
+
*
|
|
16
|
+
* The router installs onto a concrete context (it assigns `ctx.bridge`,
|
|
17
|
+
* `ctx.consoleForwarder` and `ctx.diagnostics`, which the window assembly
|
|
18
|
+
* reads straight afterwards), so it is per-window wiring rather than
|
|
19
|
+
* app-level registration.
|
|
15
20
|
*/
|
|
16
21
|
export const simulatorModule = {
|
|
17
|
-
setup: (
|
|
18
|
-
|
|
19
|
-
reg.add(registerSimulatorIpc(ctx));
|
|
20
|
-
reg.add(registerViewsIpc(ctx));
|
|
22
|
+
setup: (source) => registerSimulatorIpc(source),
|
|
23
|
+
setupWindow: (ctx) => {
|
|
21
24
|
installBridgeRouter(ctx);
|
|
22
|
-
return
|
|
25
|
+
return toDisposable(() => { });
|
|
23
26
|
},
|
|
24
27
|
};
|
|
25
28
|
//# sourceMappingURL=simulator-module.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
3
|
-
|
|
3
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
4
|
+
type SimulatorIpcCtx = Pick<WorkbenchContext, 'views' | 'notify' | 'senderPolicy' | 'simulatorApis' | 'bridge'>;
|
|
5
|
+
export declare function registerSimulatorIpc(input: IpcInput<SimulatorIpcCtx>): Disposable;
|
|
6
|
+
export {};
|
|
4
7
|
//# sourceMappingURL=simulator.d.ts.map
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SimulatorChannel, SimulatorCustomApiChannel } from '../../shared/ipc-channels.js';
|
|
2
2
|
import { SimulatorAttachNativeSchema, SimulatorCustomApiInvokeSchema, SimulatorSetDeviceInfoSchema, SimulatorSoftReloadSchema, } from '../../shared/ipc-schemas.js';
|
|
3
|
-
import { deviceInfoToHostEnv } from '../../shared/bridge-channels.js';
|
|
4
3
|
import { validate } from '../utils/ipc-schema.js';
|
|
5
4
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
|
+
export function registerSimulatorIpc(input) {
|
|
7
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
8
|
+
.handleRouted(SimulatorChannel.AttachNative, (ctx, _e, ...args) => {
|
|
9
9
|
const [simulatorUrl, simWidth] = validate(SimulatorChannel.AttachNative, SimulatorAttachNativeSchema, args);
|
|
10
10
|
return ctx.views.attachNativeSimulator(simulatorUrl, simWidth);
|
|
11
11
|
})
|
|
12
|
-
.
|
|
12
|
+
.handleRouted(SimulatorChannel.SoftReload, (ctx, _e, ...args) => {
|
|
13
13
|
const [simulatorUrl] = validate(SimulatorChannel.SoftReload, SimulatorSoftReloadSchema, args);
|
|
14
14
|
return ctx.views.softReloadNativeSimulator(simulatorUrl);
|
|
15
15
|
})
|
|
16
|
-
.
|
|
16
|
+
.handleRouted(SimulatorChannel.Detach, (ctx) => {
|
|
17
17
|
ctx.views.detachSimulator();
|
|
18
18
|
})
|
|
19
|
-
.
|
|
19
|
+
.handleRouted(SimulatorChannel.SetDeviceInfo, (ctx, _e, ...args) => {
|
|
20
20
|
const [device] = validate(SimulatorChannel.SetDeviceInfo, SimulatorSetDeviceInfoSchema, args);
|
|
21
21
|
// Cache the selection (rides the next NATIVE_HOST_ENABLED reply for a
|
|
22
22
|
// race-free DeviceShell init) and push DEVICE_CHANGE to the live simulator
|
|
23
23
|
// WCV so the DeviceShell resizes the bezel + re-renders status bar / notch.
|
|
24
|
+
// `setDevice` also pushes `hostEnvUpdate` + `pageResize` to every running
|
|
25
|
+
// service host, so `wx.getSystemInfoSync()` and `Page.onResize` follow
|
|
26
|
+
// the selection without a relaunch.
|
|
24
27
|
ctx.bridge?.setDevice(device);
|
|
25
28
|
// Re-push the CSS env(safe-area-inset-*) override to attached render-host
|
|
26
29
|
// guests so notch-aware page layout updates without a reload.
|
|
27
30
|
ctx.views.reapplySafeArea(device);
|
|
28
|
-
// Live-update the running service-host window's host-env snapshot so
|
|
29
|
-
// `wx.getSystemInfoSync()` reflects the selected device without a relaunch.
|
|
30
|
-
// The service-host preload mutates `__diminaSpawnContext` in place;
|
|
31
|
-
// `getSystemInfoSync` reads it fresh on each call. No service window yet
|
|
32
|
-
// (pre-spawn) → no-op.
|
|
33
|
-
const serviceWc = ctx.bridge?.getServiceWc();
|
|
34
|
-
if (serviceWc && !serviceWc.isDestroyed()) {
|
|
35
|
-
serviceWc.send(ServiceHostChannel.HostEnvUpdate, deviceInfoToHostEnv(device));
|
|
36
|
-
}
|
|
37
31
|
})
|
|
38
|
-
.
|
|
32
|
+
.handleRouted(SimulatorCustomApiChannel.Invoke, (ctx, _e, ...args) => {
|
|
39
33
|
const [name, params] = validate(SimulatorCustomApiChannel.Invoke, SimulatorCustomApiInvokeSchema, args);
|
|
40
34
|
return ctx.simulatorApis.invoke(name, params);
|
|
41
35
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { WorkbenchModule } from '../services/module.js';
|
|
2
|
+
import type { ViewManager } from '../services/views/view-manager.js';
|
|
3
|
+
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
4
|
+
import { type SenderPolicy } from '../utils/ipc-registry.js';
|
|
5
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
6
|
+
/** Module-local narrow deps — deliberately NOT `Pick<WorkbenchContext, ...>`
|
|
7
|
+
* (the gate in eslint.config.* is shrink-only; see its message). */
|
|
8
|
+
export interface TooltipIpcDeps {
|
|
9
|
+
views: Pick<ViewManager, 'prepareTooltip' | 'showTooltip' | 'hideTooltip' | 'markOverlayReady' | 'applyTooltipMeasurement'>;
|
|
10
|
+
senderPolicy?: SenderPolicy;
|
|
11
|
+
}
|
|
12
|
+
export declare function registerTooltipIpc(input: IpcInput<TooltipIpcDeps>): Disposable;
|
|
13
|
+
export declare const tooltipModule: WorkbenchModule;
|
|
14
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { OverlayChannel, TooltipChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
|
+
import { TooltipMeasuredSchema, TooltipShowSchema } from '../../shared/ipc-schemas.js';
|
|
3
|
+
import { validate } from '../utils/ipc-schema.js';
|
|
4
|
+
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
5
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
|
+
export function registerTooltipIpc(input) {
|
|
7
|
+
return new IpcRegistry(toIpcContextSource(input))
|
|
8
|
+
.onRouted(TooltipChannel.Prepare, (ctx) => {
|
|
9
|
+
ctx.views.prepareTooltip();
|
|
10
|
+
})
|
|
11
|
+
.onRouted(TooltipChannel.Show, (ctx, _event, ...args) => {
|
|
12
|
+
const [data] = validate(TooltipChannel.Show, TooltipShowSchema, args);
|
|
13
|
+
ctx.views.showTooltip(data);
|
|
14
|
+
})
|
|
15
|
+
.onRouted(TooltipChannel.Hide, (ctx) => {
|
|
16
|
+
ctx.views.hideTooltip();
|
|
17
|
+
})
|
|
18
|
+
.onRouted(OverlayChannel.Ready, (ctx, event) => {
|
|
19
|
+
ctx.views.markOverlayReady(event.sender.id);
|
|
20
|
+
})
|
|
21
|
+
.onRouted(TooltipChannel.Measured, (ctx, event, ...args) => {
|
|
22
|
+
const [measurement] = validate(TooltipChannel.Measured, TooltipMeasuredSchema, args);
|
|
23
|
+
ctx.views.applyTooltipMeasurement(event.sender.id, measurement);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export const tooltipModule = {
|
|
27
|
+
setup: (ctx) => registerTooltipIpc(ctx),
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=tooltip.js.map
|
package/dist/main/ipc/views.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
3
|
+
import { type IpcInput } from '../utils/ipc-context-source.js';
|
|
4
|
+
type ViewsIpcCtx = Pick<WorkbenchContext, 'views' | 'senderPolicy'>;
|
|
3
5
|
/**
|
|
4
|
-
* Renderer-driven overlay bounds
|
|
6
|
+
* Renderer-driven overlay bounds, plus the renderer bootstrap's
|
|
7
|
+
* placement-generation seed pull.
|
|
5
8
|
*
|
|
6
9
|
* The main window's React layout is the source of truth for where the
|
|
7
10
|
* editor view and the simulator's Chromium DevTools overlay live on
|
|
@@ -14,6 +17,20 @@ import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
|
14
17
|
* panel is collapsed or the tab is not selected. The view manager removes
|
|
15
18
|
* the child view from the contentView but keeps the WebContents alive so
|
|
16
19
|
* subsequent re-shows skip the OpenSumi DI bootstrap.
|
|
20
|
+
*
|
|
21
|
+
* Registered UNCONDITIONALLY by app.ts — NOT gated behind `modules.simulator`
|
|
22
|
+
* (`WorkbenchAppConfig.modules`). None of `ctx.views` (`ViewManager`) is
|
|
23
|
+
* itself conditional on that toggle — it's constructed unconditionally in
|
|
24
|
+
* `createContext` and used unconditionally elsewhere (onResize, the
|
|
25
|
+
* update-dialog panel, workbench detach) — and host-sidebar in particular
|
|
26
|
+
* lives on the project-list page, wholly unrelated to the mini-program
|
|
27
|
+
* simulator webview a disabled `modules.simulator` would actually skip. Every
|
|
28
|
+
* renderer entry point also blocks its first render on
|
|
29
|
+
* `AllocatePlacementGeneration` (see renderer-placement-generation.ts) —
|
|
30
|
+
* gating any of this behind the simulator toggle would strand a host that
|
|
31
|
+
* disables it on the fatal boot-failure page, or leave placement silently
|
|
32
|
+
* non-functional. See disabled-module.test.ts for the end-to-end guard.
|
|
17
33
|
*/
|
|
18
|
-
export declare function registerViewsIpc(
|
|
34
|
+
export declare function registerViewsIpc(input: IpcInput<ViewsIpcCtx>): Disposable;
|
|
35
|
+
export {};
|
|
19
36
|
//# sourceMappingURL=views.d.ts.map
|
package/dist/main/ipc/views.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ipcMain } from 'electron';
|
|
2
|
-
import { ViewChannel } from '../../shared/ipc-channels.js';
|
|
3
|
-
import { PlacementSnapshotSchema, HostToolbarAdvertiseHeightSchema, } from '../../shared/ipc-schemas.js';
|
|
2
|
+
import { ViewChannel } from '../../shared/ipc-channels-overlays.js';
|
|
3
|
+
import { PlacementSnapshotSchema, HostToolbarAdvertiseHeightSchema, HostSidebarAdvertiseWidthSchema, HostDialogAdvertiseSizeSchema, } from '../../shared/ipc-schemas.js';
|
|
4
4
|
import { validate } from '../utils/ipc-schema.js';
|
|
5
5
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
6
|
+
import { toIpcContextSource } from '../utils/ipc-context-source.js';
|
|
6
7
|
/**
|
|
7
|
-
* Renderer-driven overlay bounds
|
|
8
|
+
* Renderer-driven overlay bounds, plus the renderer bootstrap's
|
|
9
|
+
* placement-generation seed pull.
|
|
8
10
|
*
|
|
9
11
|
* The main window's React layout is the source of truth for where the
|
|
10
12
|
* editor view and the simulator's Chromium DevTools overlay live on
|
|
@@ -17,14 +19,37 @@ import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
|
17
19
|
* panel is collapsed or the tab is not selected. The view manager removes
|
|
18
20
|
* the child view from the contentView but keeps the WebContents alive so
|
|
19
21
|
* subsequent re-shows skip the OpenSumi DI bootstrap.
|
|
22
|
+
*
|
|
23
|
+
* Registered UNCONDITIONALLY by app.ts — NOT gated behind `modules.simulator`
|
|
24
|
+
* (`WorkbenchAppConfig.modules`). None of `ctx.views` (`ViewManager`) is
|
|
25
|
+
* itself conditional on that toggle — it's constructed unconditionally in
|
|
26
|
+
* `createContext` and used unconditionally elsewhere (onResize, the
|
|
27
|
+
* update-dialog panel, workbench detach) — and host-sidebar in particular
|
|
28
|
+
* lives on the project-list page, wholly unrelated to the mini-program
|
|
29
|
+
* simulator webview a disabled `modules.simulator` would actually skip. Every
|
|
30
|
+
* renderer entry point also blocks its first render on
|
|
31
|
+
* `AllocatePlacementGeneration` (see renderer-placement-generation.ts) —
|
|
32
|
+
* gating any of this behind the simulator toggle would strand a host that
|
|
33
|
+
* disables it on the fatal boot-failure page, or leave placement silently
|
|
34
|
+
* non-functional. See disabled-module.test.ts for the end-to-end guard.
|
|
20
35
|
*/
|
|
21
|
-
export function registerViewsIpc(
|
|
22
|
-
const
|
|
36
|
+
export function registerViewsIpc(input) {
|
|
37
|
+
const source = toIpcContextSource(input);
|
|
38
|
+
// The raw listeners below trust an exact wc id, and each window mounts its
|
|
39
|
+
// own host slots — so the id itself names the owning window. Scanning the
|
|
40
|
+
// live contexts for the one whose slot holds this sender is both the trust
|
|
41
|
+
// gate and the routing decision; no match means the message came from
|
|
42
|
+
// somewhere that is not a host slot at all, and is dropped.
|
|
43
|
+
const ownerOfSlot = (event, slotWebContentsId) => source.list().find((ctx) => slotWebContentsId(ctx) === event.sender.id) ?? null;
|
|
44
|
+
const registry = new IpcRegistry(source)
|
|
45
|
+
// Renderer bootstrap: allocate this session's placement-generation seed
|
|
46
|
+
// (see renderer-placement-generation.ts / PlacementReconciler.allocateGeneration).
|
|
47
|
+
.handleRouted(ViewChannel.AllocatePlacementGeneration, (ctx) => ctx.views.allocatePlacementGeneration())
|
|
23
48
|
// Window-level placement snapshot: the single source of truth for every
|
|
24
49
|
// managed native view's bounds/visibility/z-order. The renderer's central
|
|
25
50
|
// publisher coalesces one snapshot per frame; the reconciler diffs it
|
|
26
51
|
// against the actual view tree. Supersedes the per-view bounds channels.
|
|
27
|
-
.
|
|
52
|
+
.handleRouted(ViewChannel.PlacementSnapshot, (ctx, _event, ...args) => {
|
|
28
53
|
const [snapshot] = validate(ViewChannel.PlacementSnapshot, PlacementSnapshotSchema, args);
|
|
29
54
|
ctx.views.setPlacementSnapshot(snapshot);
|
|
30
55
|
})
|
|
@@ -36,7 +61,10 @@ export function registerViewsIpc(ctx) {
|
|
|
36
61
|
// senderPolicy-gated registry as HostToolbarBounds: the toolbar WCV's
|
|
37
62
|
// arbitrary host content must not reach this — only the trusted main
|
|
38
63
|
// renderer pulls. Live delegation, not a registration-time snapshot.
|
|
39
|
-
.
|
|
64
|
+
.handleRouted(ViewChannel.HostToolbarGetHeight, (ctx) => ctx.views.getHostToolbarHeight())
|
|
65
|
+
// Same mount-time replay role as HostToolbarGetHeight, on the sidebar's
|
|
66
|
+
// inline (width) axis.
|
|
67
|
+
.handleRouted(ViewChannel.HostSidebarGetWidth, (ctx) => ctx.views.getHostSidebarWidth());
|
|
40
68
|
// Reverse size-advertiser: the toolbar WCV's OWN renderer sends this, and the
|
|
41
69
|
// host loads ARBITRARY content into that WCV. We DELIBERATELY do NOT add the
|
|
42
70
|
// toolbar wc to the global sender policy — that would trust it for ALL ~72
|
|
@@ -48,7 +76,8 @@ export function registerViewsIpc(ctx) {
|
|
|
48
76
|
// The host content can reach ONLY this one channel, carrying only a
|
|
49
77
|
// non-negative integer height.
|
|
50
78
|
const onAdvertiseHeight = (event, ...args) => {
|
|
51
|
-
|
|
79
|
+
const ctx = ownerOfSlot(event, (c) => c.views.getHostToolbarWebContentsId());
|
|
80
|
+
if (!ctx)
|
|
52
81
|
return;
|
|
53
82
|
let extent;
|
|
54
83
|
try {
|
|
@@ -61,10 +90,49 @@ export function registerViewsIpc(ctx) {
|
|
|
61
90
|
ctx.views.setHostToolbarHeight(extent);
|
|
62
91
|
};
|
|
63
92
|
ipcMain.on(ViewChannel.HostToolbarAdvertiseHeight, onAdvertiseHeight);
|
|
93
|
+
// Same precise-sender-id trust model as onAdvertiseHeight, on the
|
|
94
|
+
// sidebar's inline (width) axis.
|
|
95
|
+
const onAdvertiseWidth = (event, ...args) => {
|
|
96
|
+
const ctx = ownerOfSlot(event, (c) => c.views.getHostSidebarWebContentsId());
|
|
97
|
+
if (!ctx)
|
|
98
|
+
return;
|
|
99
|
+
let extent;
|
|
100
|
+
try {
|
|
101
|
+
;
|
|
102
|
+
[{ extent }] = validate(ViewChannel.HostSidebarAdvertiseWidth, HostSidebarAdvertiseWidthSchema, args);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return; // malformed payload from the host's own content — drop it
|
|
106
|
+
}
|
|
107
|
+
ctx.views.setHostSidebarWidth(extent);
|
|
108
|
+
};
|
|
109
|
+
ipcMain.on(ViewChannel.HostSidebarAdvertiseWidth, onAdvertiseWidth);
|
|
110
|
+
// Same precise-sender-id trust model as onAdvertiseHeight/onAdvertiseWidth,
|
|
111
|
+
// but the dialog is a single by-demand overlay rather than a persistent
|
|
112
|
+
// slot: either axis may arrive, and the view manager re-centers using
|
|
113
|
+
// whichever axes it has measured so far.
|
|
114
|
+
const onAdvertiseDialogSize = (event, ...args) => {
|
|
115
|
+
const ctx = ownerOfSlot(event, (c) => c.views.getHostDialogWebContentsId());
|
|
116
|
+
if (!ctx)
|
|
117
|
+
return;
|
|
118
|
+
let axis;
|
|
119
|
+
let extent;
|
|
120
|
+
try {
|
|
121
|
+
;
|
|
122
|
+
[{ axis, extent }] = validate(ViewChannel.HostDialogAdvertiseSize, HostDialogAdvertiseSizeSchema, args);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return; // malformed payload from the host's own content — drop it
|
|
126
|
+
}
|
|
127
|
+
ctx.views.reportHostDialogMeasuredExtent(axis, extent);
|
|
128
|
+
};
|
|
129
|
+
ipcMain.on(ViewChannel.HostDialogAdvertiseSize, onAdvertiseDialogSize);
|
|
64
130
|
return {
|
|
65
131
|
dispose() {
|
|
66
132
|
void registry.dispose();
|
|
67
133
|
ipcMain.removeListener(ViewChannel.HostToolbarAdvertiseHeight, onAdvertiseHeight);
|
|
134
|
+
ipcMain.removeListener(ViewChannel.HostSidebarAdvertiseWidth, onAdvertiseWidth);
|
|
135
|
+
ipcMain.removeListener(ViewChannel.HostDialogAdvertiseSize, onAdvertiseDialogSize);
|
|
68
136
|
},
|
|
69
137
|
};
|
|
70
138
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { WorkbenchAppConfig } from '../../shared/types.js';
|
|
2
|
+
import type { RuntimeBackend } from '@dimina-kit/electron-deck';
|
|
3
|
+
declare const viewManagerStubs: {
|
|
4
|
+
createdManagers: Array<{
|
|
5
|
+
disposeAll: () => void;
|
|
6
|
+
}>;
|
|
7
|
+
};
|
|
8
|
+
export { stubs, devkitStubs } from './devtools-runtime-mock.harness.js';
|
|
9
|
+
export { viewManagerStubs };
|
|
10
|
+
/**
|
|
11
|
+
* Shared per-test setup both `devtools-backend-before-quit.test.ts` and
|
|
12
|
+
* `devtools-backend-shutdown-race.test.ts` need identically: reset modules
|
|
13
|
+
* (fresh `let`-scoped module-level state in `devtools-backend.ts` each
|
|
14
|
+
* test), reset the mock harness above, and dynamically re-import `electron`
|
|
15
|
+
* + `createDevtoolsBackend` — dynamic, not a static top-level import,
|
|
16
|
+
* because it must happen AFTER `vi.resetModules()` picks up a fresh module
|
|
17
|
+
* instance each test. Registers its own `beforeEach`; call once per
|
|
18
|
+
* describing test file. Returns a mutable state object (not individual
|
|
19
|
+
* values) because `beforeEach` reassigns its fields once per test, after
|
|
20
|
+
* this function itself has already returned.
|
|
21
|
+
*/
|
|
22
|
+
export interface BackendTestState {
|
|
23
|
+
createDevtoolsBackend: typeof import('./devtools-backend.js').createDevtoolsBackend;
|
|
24
|
+
electron: typeof import('electron');
|
|
25
|
+
}
|
|
26
|
+
export declare function registerBackendTestLifecycle(): BackendTestState;
|
|
27
|
+
/**
|
|
28
|
+
* Shared setup for the two tests (one in `devtools-backend-before-quit.test.ts`,
|
|
29
|
+
* one in `devtools-backend-shutdown-race.test.ts`) that need to observe
|
|
30
|
+
* `assemble()` PAUSED mid-flight, inside a still-pending `config.onSetup`:
|
|
31
|
+
* builds the backend with a gated `onSetup`, runs `beforeReady`/`assemble`,
|
|
32
|
+
* and waits until the assembled `ViewManager` is actually reachable (proof
|
|
33
|
+
* `createDevtoolsRuntime` has progressed past instance construction) before
|
|
34
|
+
* handing control back — the caller then fires whatever quit-path event it's
|
|
35
|
+
* testing while `onSetup` is still gated, and is responsible for calling
|
|
36
|
+
* `releaseOnSetup()` + awaiting `assemblePromise` itself.
|
|
37
|
+
*/
|
|
38
|
+
export declare function startAssemblingWithGatedOnSetup(createDevtoolsBackend: BackendTestState['createDevtoolsBackend'], extraConfig?: Omit<WorkbenchAppConfig, 'onSetup'>): Promise<{
|
|
39
|
+
backend: RuntimeBackend;
|
|
40
|
+
assemblePromise: Promise<void>;
|
|
41
|
+
releaseOnSetup: () => void;
|
|
42
|
+
}>;
|
|
43
|
+
//# sourceMappingURL=devtools-backend-before-quit.harness.d.ts.map
|