@dimina-kit/devtools 0.4.0-dev.20260803105710 → 0.4.0-dev.20260828092243
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main/api.d.ts +1 -1
- package/dist/main/app/app.js +66 -2
- package/dist/main/index.bundle.js +1454 -540
- package/dist/main/ipc/index.d.ts +3 -0
- package/dist/main/ipc/index.js +3 -0
- package/dist/main/ipc/popover.js +1 -1
- package/dist/main/ipc/project-create.d.ts +15 -0
- package/dist/main/ipc/project-create.js +26 -0
- package/dist/main/ipc/projects.d.ts +1 -1
- package/dist/main/ipc/projects.js +11 -0
- package/dist/main/ipc/session.js +11 -0
- package/dist/main/ipc/settings.js +2 -1
- package/dist/main/ipc/simulator-module.d.ts +4 -3
- package/dist/main/ipc/simulator-module.js +4 -5
- package/dist/main/ipc/tooltip.d.ts +13 -0
- package/dist/main/ipc/tooltip.js +28 -0
- package/dist/main/ipc/views.d.ts +15 -1
- package/dist/main/ipc/views.js +61 -4
- package/dist/main/runtime/miniapp-runtime.d.ts +87 -19
- package/dist/main/services/layout/index.d.ts +11 -0
- package/dist/main/services/layout/index.js +23 -0
- package/dist/main/services/network-forward/frontend-dispatch.js +2 -1
- package/dist/main/services/notifications/renderer-notifier.d.ts +32 -1
- package/dist/main/services/notifications/renderer-notifier.js +29 -1
- package/dist/main/services/projects/project-repository.d.ts +4 -1
- package/dist/main/services/projects/project-repository.js +63 -5
- 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/update/update-manager.d.ts +17 -3
- package/dist/main/services/update/update-manager.js +25 -6
- 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 +79 -130
- package/dist/main/services/views/console-filter.js +140 -183
- 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/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 +107 -0
- package/dist/main/services/views/host-slot-port-channel.js +261 -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 +123 -0
- package/dist/main/services/views/native-simulator-devtools-host.js +64 -45
- package/dist/main/services/views/native-simulator-view.js +6 -24
- 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 +50 -4
- package/dist/main/services/views/overlay-panels-view.js +226 -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/view-manager-devtools-host-test-fixtures.js +3 -1
- package/dist/main/services/views/view-manager.d.ts +14 -86
- package/dist/main/services/views/view-manager.js +41 -4
- package/dist/main/services/views/workbench-view.js +27 -20
- package/dist/main/services/workbench-coi-server.d.ts +11 -0
- package/dist/main/services/workbench-coi-server.js +32 -0
- package/dist/main/services/workspace/rebuild-status.d.ts +21 -8
- package/dist/main/services/workspace/rebuild-status.js +24 -8
- package/dist/main/utils/paths.d.ts +4 -0
- package/dist/main/utils/paths.js +4 -0
- package/dist/main/utils/sender-policy.d.ts +1 -1
- package/dist/main/utils/sender-policy.js +16 -1
- package/dist/main/utils/theme.d.ts +7 -2
- package/dist/main/utils/theme.js +8 -3
- package/dist/native-host/common/common.js +65 -62
- package/dist/native-host/container/pageFrame.css +1 -1
- package/dist/native-host/render/render.js +3226 -2898
- package/dist/native-host/service/service.js +2 -2
- 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/wait-for-slot-root.d.ts +20 -0
- package/dist/preload/runtime/wait-for-slot-root.js +52 -0
- package/dist/preload/windows/host-dialog-runtime.cjs +353 -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 +354 -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 +134 -51
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +3 -3
- package/dist/preload/windows/main.cjs +3176 -14
- 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 +5 -2
- package/dist/preload/windows/simulator.cjs.map +2 -2
- package/dist/preload/windows/simulator.js +5 -2
- package/dist/renderer/assets/button-DsNqZm7o.js +2 -0
- package/dist/renderer/assets/constants-D7DfVqMp.js +2 -0
- package/dist/renderer/assets/constants-D8zsejFq.js +2 -0
- package/dist/renderer/assets/createLucideIcon-CYJeT1ji.js +2 -0
- package/dist/renderer/assets/dialog-pT4qWmka.js +46 -0
- package/dist/renderer/assets/dist-o70xmpc1.js +2 -0
- package/dist/renderer/assets/hostSidebarDefault-NvGZlE9O.js +2 -0
- package/dist/renderer/assets/index-zErhG3ta.js +5 -0
- package/dist/renderer/assets/input-4QxTXMZN.js +2 -0
- package/dist/renderer/assets/ipc-channels-overlays-Blr5TNoB.js +2 -0
- package/dist/renderer/assets/jsx-runtime-B-3rq1y5.css +1 -0
- package/dist/renderer/assets/jsx-runtime-CqVdW3eg.js +9 -0
- package/dist/renderer/assets/popover-CJiSWwuE.js +2 -0
- package/dist/renderer/assets/project-api-DZ1Zi6EC.js +2 -0
- package/dist/renderer/assets/projectCreateDialog-DMWNhw_1.js +2 -0
- package/dist/renderer/assets/select-C86pNcsu.js +2 -0
- package/dist/renderer/assets/settings-BoI8mLT1.js +2 -0
- package/dist/renderer/assets/settings-api-Bs_g4NHs.js +2 -0
- package/dist/renderer/assets/settings-tab-bar-DHLLygqv.js +2 -0
- package/dist/renderer/assets/tooltip-BhAyY0T4.js +2 -0
- package/dist/renderer/assets/types-YYjkvane.js +2 -0
- package/dist/renderer/assets/updateDialog-DPum3wx1.js +2 -0
- package/dist/renderer/assets/utils-kfQov6Pa.js +2 -0
- package/dist/renderer/assets/view-api-DFhb2R8-.js +2 -0
- package/dist/renderer/assets/workbenchSettings-DrajRQUk.js +8 -0
- package/dist/renderer/entries/host-sidebar-default/index.html +21 -0
- package/dist/renderer/entries/main/index.html +15 -7
- package/dist/renderer/entries/popover/index.html +10 -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-settings/index.html +11 -5
- package/dist/service-host/preload.cjs +10 -0
- package/dist/service-host/sync-impls/menu-button-geometry.js +1 -0
- package/dist/shared/constants.d.ts +22 -0
- package/dist/shared/constants.js +22 -0
- package/dist/shared/ipc-channels-overlays.d.ts +156 -0
- package/dist/shared/ipc-channels-overlays.js +186 -0
- package/dist/shared/ipc-channels.d.ts +1 -67
- package/dist/shared/ipc-channels.js +9 -81
- package/dist/shared/ipc-schemas.d.ts +52 -0
- package/dist/shared/ipc-schemas.js +64 -0
- package/dist/shared/simulator-route.d.ts +8 -0
- package/dist/shared/simulator-route.js +15 -0
- package/dist/shared/types.d.ts +17 -0
- package/dist/shared/view-ids.d.ts +9 -0
- package/dist/shared/view-ids.js +21 -0
- package/dist/simulator/assets/device-shell-CmtM1QxP.js +2 -0
- package/dist/simulator/assets/device-shell-iFZo1igL.css +1 -0
- package/dist/simulator/assets/{simulator-COIE6R49.js → simulator-CIobn3Mh.js} +6 -6
- package/dist/simulator/assets/{simulator-mini-app-BLn7XV8e.js → simulator-mini-app-CRe6n9br.js} +2 -2
- package/dist/simulator/assets/simulator-ui-BupATgKo.css +1 -0
- package/dist/simulator/assets/simulator-ui-C_cP602X.js +2 -0
- package/dist/simulator/simulator.html +3 -2
- package/dist/vscode-workbench/assets/__vite-browser-external-Bc1vizTf.js +1 -0
- package/dist/vscode-workbench/assets/{dist-oHcwN53f.js → dist-CMfmHflW.js} +3 -3
- package/dist/vscode-workbench/assets/{iconv-lite-umd-CLMLpdGm.js → iconv-lite-umd-Bx8CgaZq.js} +1 -1
- package/dist/vscode-workbench/assets/{index-BE3UJdoH.js → index-CdG6YWhW.js} +436 -436
- package/dist/vscode-workbench/assets/{jschardet-BICW8PLJ.js → jschardet-M0qgd2lN.js} +1 -1
- package/dist/vscode-workbench/index.html +21 -1
- package/package.json +9 -8
- 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/renderer/assets/constants-EAMiwL9_.js +0 -2
- package/dist/renderer/assets/index-BBg3YI5b.js +0 -49
- package/dist/renderer/assets/input-xdmfv-eH.js +0 -2
- package/dist/renderer/assets/ipc-transport-B3EpmfNS.js +0 -9
- package/dist/renderer/assets/ipc-transport-Blac3sOj.css +0 -1
- package/dist/renderer/assets/popover-B88e2hkg.js +0 -2
- package/dist/renderer/assets/select-CD9CJyhI.js +0 -2
- package/dist/renderer/assets/settings-44hf0QtO.js +0 -2
- package/dist/renderer/assets/settings-api-pJKPuP1M.js +0 -2
- package/dist/renderer/assets/workbenchSettings-DKD5U1Ql.js +0 -8
- package/dist/simulator/assets/device-shell-Cw7c-IkG.js +0 -2
- package/dist/simulator/assets/device-shell-DbC5ccs8.css +0 -1
- package/dist/simulator/assets/jsx-runtime-DkKmJyBb.js +0 -2
- package/dist/simulator/device-shell/menu-button-geometry.js +0 -18
- package/dist/vscode-workbench/assets/__vite-browser-external-BON7qP59.js +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IPC channel name constants for dimina-devtools' overlay/panel
|
|
3
|
+
* WebContentsViews — layout slots (host-toolbar/host-sidebar/host-dialog),
|
|
4
|
+
* the popover, tooltip, project-create dialog and settings overlays, plus
|
|
5
|
+
* the update flow. Split out of `ipc-channels.ts` (see that file's header)
|
|
6
|
+
* once this group alone pushed it past the repo's file-length threshold —
|
|
7
|
+
* these constants share no runtime dependency on the rest of that file, so
|
|
8
|
+
* the split is a pure line-count relief valve, not a behavior change.
|
|
9
|
+
*/
|
|
10
|
+
// ── Embedded views (renderer → main) ─────────────────────────────────────
|
|
11
|
+
//
|
|
12
|
+
// The main window's React layout owns the *positions* of the editor +
|
|
13
|
+
// simulator-DevTools WebContentsView overlays — each visible placeholder
|
|
14
|
+
// `<div>` measures its client rect via ResizeObserver and pushes the
|
|
15
|
+
// rectangle to the main process. The view manager caches the latest
|
|
16
|
+
// payload per kind and applies it to the overlay; no payload means the
|
|
17
|
+
// overlay is hidden.
|
|
18
|
+
//
|
|
19
|
+
// Payload (after schema validation): `{ x, y, width, height }` in CSS
|
|
20
|
+
// pixels relative to the window's content area (origin = top-left,
|
|
21
|
+
// not including the OS chrome).
|
|
22
|
+
export const ViewChannel = {
|
|
23
|
+
/**
|
|
24
|
+
* Reverse size-advertiser: the host-toolbar WCV's OWN renderer advertises its
|
|
25
|
+
* intrinsic content height so main reserves exactly that much. Payload
|
|
26
|
+
* `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
|
|
27
|
+
*/
|
|
28
|
+
HostToolbarAdvertiseHeight: 'view:host-toolbar:advertise-height',
|
|
29
|
+
/**
|
|
30
|
+
* main → host-toolbar WCV renderer: per-load MessagePort handshake for the
|
|
31
|
+
* gated narrow channel. On every toolbar `did-finish-load` main creates a
|
|
32
|
+
* `MessageChannelMain` and transfers port2 here
|
|
33
|
+
* (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
|
|
34
|
+
* toolbar runtime preload receives it via `event.ports[0]` and bridges it to
|
|
35
|
+
* the page as `window.diminaHostToolbar`. Envelope both directions:
|
|
36
|
+
* `{ channel: string, payload: unknown }`.
|
|
37
|
+
*/
|
|
38
|
+
HostToolbarPort: 'view:host-toolbar:port',
|
|
39
|
+
/**
|
|
40
|
+
* main → main-window renderer: push the reserved host-toolbar height so the
|
|
41
|
+
* renderer placeholder div resizes (closing the dynamic-height loop).
|
|
42
|
+
*/
|
|
43
|
+
HostToolbarHeightChanged: 'view:host-toolbar:height-changed',
|
|
44
|
+
/**
|
|
45
|
+
* main ← main-window renderer (invoke): pull the last NOTIFIED toolbar
|
|
46
|
+
* height retained in main. Mount-time replay companion to
|
|
47
|
+
* `HostToolbarHeightChanged`: the push listener mounts with the project
|
|
48
|
+
* view and the toolbar's size-advertiser deduplicates (never re-reports),
|
|
49
|
+
* so a height pushed while no project view was mounted would otherwise be
|
|
50
|
+
* lost forever (cold start on the project list races it; close-project →
|
|
51
|
+
* reopen hits it deterministically). No payload; resolves a number.
|
|
52
|
+
*/
|
|
53
|
+
HostToolbarGetHeight: 'view:host-toolbar:get-height',
|
|
54
|
+
/**
|
|
55
|
+
* Reverse size-advertiser for the host-sidebar WCV, mirroring
|
|
56
|
+
* `HostToolbarAdvertiseHeight` on the inline (width) axis instead of block.
|
|
57
|
+
* Payload `{ axis: 'inline', extent }`. fire-and-forget (send), NOT invoke.
|
|
58
|
+
*/
|
|
59
|
+
HostSidebarAdvertiseWidth: 'view:host-sidebar:advertise-width',
|
|
60
|
+
/**
|
|
61
|
+
* main → host-sidebar WCV renderer: per-load MessagePort handshake, same
|
|
62
|
+
* contract as `HostToolbarPort` (see that entry).
|
|
63
|
+
*/
|
|
64
|
+
HostSidebarPort: 'view:host-sidebar:port',
|
|
65
|
+
/**
|
|
66
|
+
* main → main-window renderer: push the reserved host-sidebar width so the
|
|
67
|
+
* renderer placeholder div resizes, mirroring `HostToolbarHeightChanged`.
|
|
68
|
+
*/
|
|
69
|
+
HostSidebarWidthChanged: 'view:host-sidebar:width-changed',
|
|
70
|
+
/**
|
|
71
|
+
* main ← main-window renderer (invoke): pull the last NOTIFIED sidebar
|
|
72
|
+
* width, mirroring `HostToolbarGetHeight`'s mount-time replay role.
|
|
73
|
+
*/
|
|
74
|
+
HostSidebarGetWidth: 'view:host-sidebar:get-width',
|
|
75
|
+
/**
|
|
76
|
+
* main → main-window renderer: push the project category (`Project.type`)
|
|
77
|
+
* selected in the host-sidebar's content — devtools' own default icon rail,
|
|
78
|
+
* or any downstream replacement that sends on the same channel. No
|
|
79
|
+
* pull/replay companion like `HostSidebarGetWidth`: the default category is
|
|
80
|
+
* a stable initial value regardless of load-order, and nothing is ever sent
|
|
81
|
+
* before the main-window renderer (and thus `ProjectListScreen`) is already
|
|
82
|
+
* mounted.
|
|
83
|
+
*/
|
|
84
|
+
HostSidebarCategorySelected: 'view:host-sidebar:category-selected',
|
|
85
|
+
/**
|
|
86
|
+
* Reverse size-advertiser for the host-dialog WCV. Unlike the toolbar/sidebar
|
|
87
|
+
* (single-axis, `setBaseDesired`-placed strips), the dialog is a BOTH-AXES
|
|
88
|
+
* overlay positioned by `setOverlayDesired` — main centers it in the main
|
|
89
|
+
* window once it knows both dimensions. One channel carries either axis'
|
|
90
|
+
* report (`{ axis: 'block' | 'inline', extent }`); the dialog's own content
|
|
91
|
+
* advertises both from the same root (see `host-dialog-advertiser.ts`).
|
|
92
|
+
* fire-and-forget (send), NOT invoke.
|
|
93
|
+
*
|
|
94
|
+
* No `HostDialogSizeChanged` / `HostDialogGetSize` counterparts: those exist
|
|
95
|
+
* for toolbar/sidebar so a renderer-owned PLACEHOLDER can replay a size it
|
|
96
|
+
* missed. The dialog has no such placeholder — it is a main-driven overlay
|
|
97
|
+
* shown/hidden on demand (`hostDialog.show()`/`hide()`), so there is nothing
|
|
98
|
+
* in the renderer to replay a size into.
|
|
99
|
+
*/
|
|
100
|
+
HostDialogAdvertiseSize: 'view:host-dialog:advertise-size',
|
|
101
|
+
/**
|
|
102
|
+
* main → host-dialog WCV renderer: per-load MessagePort handshake, same
|
|
103
|
+
* contract as `HostToolbarPort` (see that entry).
|
|
104
|
+
*/
|
|
105
|
+
HostDialogPort: 'view:host-dialog:port',
|
|
106
|
+
/**
|
|
107
|
+
* Renderer → main: the window-level placement snapshot (one monotonic epoch
|
|
108
|
+
* per commit tick, one generation per renderer lifetime) that drives the view
|
|
109
|
+
* reconciler. The single source of truth for every managed native view's
|
|
110
|
+
* bounds/visibility/z-order — supersedes the per-view bounds channels above.
|
|
111
|
+
* invoke.
|
|
112
|
+
*/
|
|
113
|
+
PlacementSnapshot: 'view:placement-snapshot',
|
|
114
|
+
/**
|
|
115
|
+
* main ← main-window renderer (invoke): allocate a fresh placement
|
|
116
|
+
* generation seed for this renderer bootstrap. See
|
|
117
|
+
* renderer-placement-generation.ts for why the seed comes from main
|
|
118
|
+
* (a wall-clock `Date.now()` seed is not guaranteed to exceed main's
|
|
119
|
+
* still-standing high-water mark across two reloads that happen faster
|
|
120
|
+
* than the clock's resolution). No payload; resolves a number.
|
|
121
|
+
*/
|
|
122
|
+
AllocatePlacementGeneration: 'view:allocate-placement-generation',
|
|
123
|
+
};
|
|
124
|
+
// ── Popover ──────────────────────────────────────────────────────────────
|
|
125
|
+
export const PopoverChannel = {
|
|
126
|
+
Show: 'popover:show',
|
|
127
|
+
Hide: 'popover:hide',
|
|
128
|
+
Relaunch: 'popover:relaunch',
|
|
129
|
+
Closed: 'popover:closed',
|
|
130
|
+
Init: 'popover:init',
|
|
131
|
+
};
|
|
132
|
+
// ── Tooltip ──────────────────────────────────────────────────────────────
|
|
133
|
+
//
|
|
134
|
+
// A top-tier overlay WebContentsView (VIEW_LAYER.tooltip — see view-ids.ts),
|
|
135
|
+
// NOT a DOM tooltip in the main renderer: any DOM-portaled floating UI (Radix
|
|
136
|
+
// Tooltip) or the browser-native `title` attribute lives in the main
|
|
137
|
+
// renderer's own paint surface, which every other WCV (simulator, editor,
|
|
138
|
+
// settings, popover) renders on top of — CSS cannot reach across that
|
|
139
|
+
// boundary. A trigger reports its anchor rect + label; main computes the
|
|
140
|
+
// tooltip's screen bounds and shows/repositions/hides this overlay.
|
|
141
|
+
export const OverlayChannel = {
|
|
142
|
+
Ready: 'overlay:ready',
|
|
143
|
+
};
|
|
144
|
+
export const TooltipChannel = {
|
|
145
|
+
Prepare: 'tooltip:prepare',
|
|
146
|
+
Show: 'tooltip:show',
|
|
147
|
+
Hide: 'tooltip:hide',
|
|
148
|
+
Init: 'tooltip:init',
|
|
149
|
+
Measured: 'tooltip:measured',
|
|
150
|
+
};
|
|
151
|
+
// ── Project-create dialog ───────────────────────────────────────────────
|
|
152
|
+
//
|
|
153
|
+
// A top-tier overlay WebContentsView (VIEW_LAYER.dialog), NOT the Radix
|
|
154
|
+
// `fixed inset-0` DOM portal it replaced — a DOM overlay paints inside the
|
|
155
|
+
// main window's own renderer, so any native WebContentsView mounted on top
|
|
156
|
+
// (simulator, host-toolbar, host-sidebar) occludes it. main.tsx fetches the
|
|
157
|
+
// template catalog + base-dir defaults, then asks main to show this panel;
|
|
158
|
+
// the panel relays submit/cancel back to main.tsx to run the existing
|
|
159
|
+
// scaffold flow.
|
|
160
|
+
export const ProjectCreateChannel = {
|
|
161
|
+
Show: 'projectCreate:show',
|
|
162
|
+
Init: 'projectCreate:init',
|
|
163
|
+
Submit: 'projectCreate:submit',
|
|
164
|
+
Cancel: 'projectCreate:cancel',
|
|
165
|
+
Submitted: 'projectCreate:submitted',
|
|
166
|
+
};
|
|
167
|
+
// ── Embedded settings overlay ────────────────────────────────────────────
|
|
168
|
+
export const SettingsChannel = {
|
|
169
|
+
SetVisible: 'settings:setVisible',
|
|
170
|
+
ConfigChanged: 'settings:configChanged',
|
|
171
|
+
ProjectSettingsChanged: 'settings:projectSettingsChanged',
|
|
172
|
+
Init: 'settings:init',
|
|
173
|
+
};
|
|
174
|
+
// ── Updates (UpdateManager) ──────────────────────────────────────────────
|
|
175
|
+
//
|
|
176
|
+
// String values are FROZEN: shipped builds key off them. Add new entries
|
|
177
|
+
// here, never rename existing ones.
|
|
178
|
+
export const UpdateChannel = {
|
|
179
|
+
Check: 'updates:check',
|
|
180
|
+
Download: 'updates:download',
|
|
181
|
+
Install: 'updates:install',
|
|
182
|
+
DownloadProgress: 'updates:downloadProgress',
|
|
183
|
+
Available: 'updates:available',
|
|
184
|
+
Close: 'updates:close',
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=ipc-channels-overlays.js.map
|
|
@@ -95,6 +95,7 @@ export declare const WorkbenchSettingsChannel: {
|
|
|
95
95
|
export declare const ProjectChannel: {
|
|
96
96
|
readonly Open: "project:open";
|
|
97
97
|
readonly Close: "project:close";
|
|
98
|
+
readonly Rebuild: "project:rebuild";
|
|
98
99
|
readonly GetPages: "project:getPages";
|
|
99
100
|
readonly GetCompileConfig: "project:getCompileConfig";
|
|
100
101
|
readonly SaveCompileConfig: "project:saveCompileConfig";
|
|
@@ -154,60 +155,6 @@ export interface ProjectCreateDefaults {
|
|
|
154
155
|
export declare const DialogChannel: {
|
|
155
156
|
readonly OpenDirectory: "dialog:openDirectory";
|
|
156
157
|
};
|
|
157
|
-
export declare const ViewChannel: {
|
|
158
|
-
/**
|
|
159
|
-
* Reverse size-advertiser: the host-toolbar WCV's OWN renderer advertises its
|
|
160
|
-
* intrinsic content height so main reserves exactly that much. Payload
|
|
161
|
-
* `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
|
|
162
|
-
*/
|
|
163
|
-
readonly HostToolbarAdvertiseHeight: "view:host-toolbar:advertise-height";
|
|
164
|
-
/**
|
|
165
|
-
* main → host-toolbar WCV renderer: per-load MessagePort handshake for the
|
|
166
|
-
* gated narrow channel. On every toolbar `did-finish-load` main creates a
|
|
167
|
-
* `MessageChannelMain` and transfers port2 here
|
|
168
|
-
* (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
|
|
169
|
-
* toolbar runtime preload receives it via `event.ports[0]` and bridges it to
|
|
170
|
-
* the page as `window.diminaHostToolbar`. Envelope both directions:
|
|
171
|
-
* `{ channel: string, payload: unknown }`.
|
|
172
|
-
*/
|
|
173
|
-
readonly HostToolbarPort: "view:host-toolbar:port";
|
|
174
|
-
/**
|
|
175
|
-
* main → main-window renderer: push the reserved host-toolbar height so the
|
|
176
|
-
* renderer placeholder div resizes (closing the dynamic-height loop).
|
|
177
|
-
*/
|
|
178
|
-
readonly HostToolbarHeightChanged: "view:host-toolbar:height-changed";
|
|
179
|
-
/**
|
|
180
|
-
* main ← main-window renderer (invoke): pull the last NOTIFIED toolbar
|
|
181
|
-
* height retained in main. Mount-time replay companion to
|
|
182
|
-
* `HostToolbarHeightChanged`: the push listener mounts with the project
|
|
183
|
-
* view and the toolbar's size-advertiser deduplicates (never re-reports),
|
|
184
|
-
* so a height pushed while no project view was mounted would otherwise be
|
|
185
|
-
* lost forever (cold start on the project list races it; close-project →
|
|
186
|
-
* reopen hits it deterministically). No payload; resolves a number.
|
|
187
|
-
*/
|
|
188
|
-
readonly HostToolbarGetHeight: "view:host-toolbar:get-height";
|
|
189
|
-
/**
|
|
190
|
-
* Renderer → main: the window-level placement snapshot (one monotonic epoch
|
|
191
|
-
* per commit tick, one generation per renderer lifetime) that drives the view
|
|
192
|
-
* reconciler. The single source of truth for every managed native view's
|
|
193
|
-
* bounds/visibility/z-order — supersedes the per-view bounds channels above.
|
|
194
|
-
* invoke.
|
|
195
|
-
*/
|
|
196
|
-
readonly PlacementSnapshot: "view:placement-snapshot";
|
|
197
|
-
};
|
|
198
|
-
export interface ViewBounds {
|
|
199
|
-
x: number;
|
|
200
|
-
y: number;
|
|
201
|
-
width: number;
|
|
202
|
-
height: number;
|
|
203
|
-
}
|
|
204
|
-
export declare const PopoverChannel: {
|
|
205
|
-
readonly Show: "popover:show";
|
|
206
|
-
readonly Hide: "popover:hide";
|
|
207
|
-
readonly Relaunch: "popover:relaunch";
|
|
208
|
-
readonly Closed: "popover:closed";
|
|
209
|
-
readonly Init: "popover:init";
|
|
210
|
-
};
|
|
211
158
|
export declare const WindowChannel: {
|
|
212
159
|
readonly NavigateBack: "window:navigateBack";
|
|
213
160
|
readonly OpenProject: "window:openProject";
|
|
@@ -226,17 +173,4 @@ export declare const AutomationChannel: {
|
|
|
226
173
|
export declare const InternalDevtoolsChannel: {
|
|
227
174
|
readonly Open: "internal-devtools:open";
|
|
228
175
|
};
|
|
229
|
-
export declare const SettingsChannel: {
|
|
230
|
-
readonly SetVisible: "settings:setVisible";
|
|
231
|
-
readonly ConfigChanged: "settings:configChanged";
|
|
232
|
-
readonly ProjectSettingsChanged: "settings:projectSettingsChanged";
|
|
233
|
-
readonly Init: "settings:init";
|
|
234
|
-
};
|
|
235
|
-
export declare const UpdateChannel: {
|
|
236
|
-
readonly Check: "updates:check";
|
|
237
|
-
readonly Download: "updates:download";
|
|
238
|
-
readonly Install: "updates:install";
|
|
239
|
-
readonly DownloadProgress: "updates:downloadProgress";
|
|
240
|
-
readonly Available: "updates:available";
|
|
241
|
-
};
|
|
242
176
|
//# sourceMappingURL=ipc-channels.d.ts.map
|
|
@@ -25,8 +25,11 @@ export const SimulatorChannel = {
|
|
|
25
25
|
Detach: 'simulator:detach',
|
|
26
26
|
Console: 'simulator:console',
|
|
27
27
|
// Main → renderer push of the visible top-of-stack page route whenever the
|
|
28
|
-
// mini-app navigates (navigateTo / switchTab / back). Payload: the page
|
|
29
|
-
// string (
|
|
28
|
+
// mini-app navigates (navigateTo / switchTab / back). Payload: the page
|
|
29
|
+
// route string (`pagePath` + `?k=v&…` query, same format as
|
|
30
|
+
// `encodePageSpec`/`decodePageSpec`), or '' when unknown. The query lets the
|
|
31
|
+
// page-path bar show params (WeChat DevTools parity) and a recompile restore
|
|
32
|
+
// the current page's params.
|
|
30
33
|
CurrentPage: 'simulator:current-page',
|
|
31
34
|
};
|
|
32
35
|
// ── Service host (main → hidden service-host window) ─────────────────────
|
|
@@ -128,6 +131,10 @@ export const WorkbenchSettingsChannel = {
|
|
|
128
131
|
export const ProjectChannel = {
|
|
129
132
|
Open: 'project:open',
|
|
130
133
|
Close: 'project:close',
|
|
134
|
+
// Renderer → main invoke: run one real recompile of the active session
|
|
135
|
+
// (the popover 重新编译 button). Resolves `{ supported: boolean }`; rejects
|
|
136
|
+
// on build failure or when no session is active.
|
|
137
|
+
Rebuild: 'project:rebuild',
|
|
131
138
|
GetPages: 'project:getPages',
|
|
132
139
|
GetCompileConfig: 'project:getCompileConfig',
|
|
133
140
|
SaveCompileConfig: 'project:saveCompileConfig',
|
|
@@ -199,67 +206,6 @@ export const ProjectsChannel = {
|
|
|
199
206
|
export const DialogChannel = {
|
|
200
207
|
OpenDirectory: 'dialog:openDirectory',
|
|
201
208
|
};
|
|
202
|
-
// ── Embedded views (renderer → main) ─────────────────────────────────────
|
|
203
|
-
//
|
|
204
|
-
// The main window's React layout owns the *positions* of the editor +
|
|
205
|
-
// simulator-DevTools WebContentsView overlays — each visible placeholder
|
|
206
|
-
// `<div>` measures its client rect via ResizeObserver and pushes the
|
|
207
|
-
// rectangle to the main process. The view manager caches the latest
|
|
208
|
-
// payload per kind and applies it to the overlay; no payload means the
|
|
209
|
-
// overlay is hidden.
|
|
210
|
-
//
|
|
211
|
-
// Payload (after schema validation): `{ x, y, width, height }` in CSS
|
|
212
|
-
// pixels relative to the window's content area (origin = top-left,
|
|
213
|
-
// not including the OS chrome).
|
|
214
|
-
export const ViewChannel = {
|
|
215
|
-
/**
|
|
216
|
-
* Reverse size-advertiser: the host-toolbar WCV's OWN renderer advertises its
|
|
217
|
-
* intrinsic content height so main reserves exactly that much. Payload
|
|
218
|
-
* `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
|
|
219
|
-
*/
|
|
220
|
-
HostToolbarAdvertiseHeight: 'view:host-toolbar:advertise-height',
|
|
221
|
-
/**
|
|
222
|
-
* main → host-toolbar WCV renderer: per-load MessagePort handshake for the
|
|
223
|
-
* gated narrow channel. On every toolbar `did-finish-load` main creates a
|
|
224
|
-
* `MessageChannelMain` and transfers port2 here
|
|
225
|
-
* (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
|
|
226
|
-
* toolbar runtime preload receives it via `event.ports[0]` and bridges it to
|
|
227
|
-
* the page as `window.diminaHostToolbar`. Envelope both directions:
|
|
228
|
-
* `{ channel: string, payload: unknown }`.
|
|
229
|
-
*/
|
|
230
|
-
HostToolbarPort: 'view:host-toolbar:port',
|
|
231
|
-
/**
|
|
232
|
-
* main → main-window renderer: push the reserved host-toolbar height so the
|
|
233
|
-
* renderer placeholder div resizes (closing the dynamic-height loop).
|
|
234
|
-
*/
|
|
235
|
-
HostToolbarHeightChanged: 'view:host-toolbar:height-changed',
|
|
236
|
-
/**
|
|
237
|
-
* main ← main-window renderer (invoke): pull the last NOTIFIED toolbar
|
|
238
|
-
* height retained in main. Mount-time replay companion to
|
|
239
|
-
* `HostToolbarHeightChanged`: the push listener mounts with the project
|
|
240
|
-
* view and the toolbar's size-advertiser deduplicates (never re-reports),
|
|
241
|
-
* so a height pushed while no project view was mounted would otherwise be
|
|
242
|
-
* lost forever (cold start on the project list races it; close-project →
|
|
243
|
-
* reopen hits it deterministically). No payload; resolves a number.
|
|
244
|
-
*/
|
|
245
|
-
HostToolbarGetHeight: 'view:host-toolbar:get-height',
|
|
246
|
-
/**
|
|
247
|
-
* Renderer → main: the window-level placement snapshot (one monotonic epoch
|
|
248
|
-
* per commit tick, one generation per renderer lifetime) that drives the view
|
|
249
|
-
* reconciler. The single source of truth for every managed native view's
|
|
250
|
-
* bounds/visibility/z-order — supersedes the per-view bounds channels above.
|
|
251
|
-
* invoke.
|
|
252
|
-
*/
|
|
253
|
-
PlacementSnapshot: 'view:placement-snapshot',
|
|
254
|
-
};
|
|
255
|
-
// ── Popover ──────────────────────────────────────────────────────────────
|
|
256
|
-
export const PopoverChannel = {
|
|
257
|
-
Show: 'popover:show',
|
|
258
|
-
Hide: 'popover:hide',
|
|
259
|
-
Relaunch: 'popover:relaunch',
|
|
260
|
-
Closed: 'popover:closed',
|
|
261
|
-
Init: 'popover:init',
|
|
262
|
-
};
|
|
263
209
|
// ── Window ───────────────────────────────────────────────────────────────
|
|
264
210
|
export const WindowChannel = {
|
|
265
211
|
NavigateBack: 'window:navigateBack',
|
|
@@ -296,21 +242,3 @@ export const InternalDevtoolsChannel = {
|
|
|
296
242
|
// its own dedicated window (see internal-devtools-window/index.ts).
|
|
297
243
|
Open: 'internal-devtools:open',
|
|
298
244
|
};
|
|
299
|
-
// ── Embedded settings overlay ────────────────────────────────────────────
|
|
300
|
-
export const SettingsChannel = {
|
|
301
|
-
SetVisible: 'settings:setVisible',
|
|
302
|
-
ConfigChanged: 'settings:configChanged',
|
|
303
|
-
ProjectSettingsChanged: 'settings:projectSettingsChanged',
|
|
304
|
-
Init: 'settings:init',
|
|
305
|
-
};
|
|
306
|
-
// ── Updates (UpdateManager) ──────────────────────────────────────────────
|
|
307
|
-
//
|
|
308
|
-
// String values are FROZEN: shipped builds key off them. Add new entries
|
|
309
|
-
// here, never rename existing ones.
|
|
310
|
-
export const UpdateChannel = {
|
|
311
|
-
Check: 'updates:check',
|
|
312
|
-
Download: 'updates:download',
|
|
313
|
-
Install: 'updates:install',
|
|
314
|
-
DownloadProgress: 'updates:downloadProgress',
|
|
315
|
-
Available: 'updates:available',
|
|
316
|
-
};
|
|
@@ -23,6 +23,41 @@ export declare const ProjectSaveCompileConfigSchema: z.ZodTuple<[z.ZodString, z.
|
|
|
23
23
|
}, z.core.$loose>], null>;
|
|
24
24
|
/** popover:show — must be an object (not undefined/null/string). */
|
|
25
25
|
export declare const PopoverShowSchema: z.ZodTuple<[z.ZodObject<{}, z.core.$loose>], null>;
|
|
26
|
+
/**
|
|
27
|
+
* tooltip:show — the trigger's own bounding rect (CSS px, main-window content
|
|
28
|
+
* coordinates — same space `getBoundingClientRect()` reports, no conversion,
|
|
29
|
+
* mirrors the base-view placement snapshot's Bounds) plus the label text.
|
|
30
|
+
*/
|
|
31
|
+
export declare const TooltipShowSchema: z.ZodTuple<[z.ZodObject<{
|
|
32
|
+
anchor: z.ZodObject<{
|
|
33
|
+
x: z.ZodNumber;
|
|
34
|
+
y: z.ZodNumber;
|
|
35
|
+
width: z.ZodNumber;
|
|
36
|
+
height: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
text: z.ZodString;
|
|
39
|
+
}, z.core.$strip>], null>;
|
|
40
|
+
export declare const TooltipMeasuredSchema: z.ZodTuple<[z.ZodObject<{
|
|
41
|
+
requestId: z.ZodNumber;
|
|
42
|
+
width: z.ZodNumber;
|
|
43
|
+
height: z.ZodNumber;
|
|
44
|
+
}, z.core.$strip>], null>;
|
|
45
|
+
/**
|
|
46
|
+
* projectCreate:show — the merged template catalog + suggested base dir
|
|
47
|
+
* main.tsx already resolved before asking main to show the overlay panel.
|
|
48
|
+
* Templates are re-validated loosely (they only round-trip back into the
|
|
49
|
+
* panel's own render, never interpreted main-side).
|
|
50
|
+
*/
|
|
51
|
+
export declare const ProjectCreateShowSchema: z.ZodTuple<[z.ZodObject<{
|
|
52
|
+
templates: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
53
|
+
defaultBaseDir: z.ZodString;
|
|
54
|
+
}, z.core.$strip>], null>;
|
|
55
|
+
/** projectCreate:submit — the collected create-project form. */
|
|
56
|
+
export declare const ProjectCreateSubmitSchema: z.ZodTuple<[z.ZodObject<{
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
path: z.ZodString;
|
|
59
|
+
templateId: z.ZodString;
|
|
60
|
+
}, z.core.$strip>], null>;
|
|
26
61
|
/**
|
|
27
62
|
* simulator:attach-native (native-host only) — the simulator URL to load into
|
|
28
63
|
* the top-level WebContentsView + simulator width. The URL is the dev-server
|
|
@@ -95,6 +130,23 @@ export declare const HostToolbarAdvertiseHeightSchema: z.ZodTuple<[z.ZodObject<{
|
|
|
95
130
|
axis: z.ZodLiteral<"block">;
|
|
96
131
|
extent: z.ZodNumber;
|
|
97
132
|
}, z.core.$strip>], null>;
|
|
133
|
+
/**
|
|
134
|
+
* host-sidebar reverse size-advertiser payload — mirrors
|
|
135
|
+
* `HostToolbarAdvertiseHeightSchema` on the inline (width) axis.
|
|
136
|
+
*/
|
|
137
|
+
export declare const HostSidebarAdvertiseWidthSchema: z.ZodTuple<[z.ZodObject<{
|
|
138
|
+
axis: z.ZodLiteral<"inline">;
|
|
139
|
+
extent: z.ZodNumber;
|
|
140
|
+
}, z.core.$strip>], null>;
|
|
141
|
+
/**
|
|
142
|
+
* host-dialog reverse size-advertiser payload. Unlike the single-axis
|
|
143
|
+
* toolbar/sidebar, the dialog's content advertises BOTH axes over the same
|
|
144
|
+
* channel — `axis` distinguishes which report this is.
|
|
145
|
+
*/
|
|
146
|
+
export declare const HostDialogAdvertiseSizeSchema: z.ZodTuple<[z.ZodObject<{
|
|
147
|
+
axis: z.ZodUnion<readonly [z.ZodLiteral<"block">, z.ZodLiteral<"inline">]>;
|
|
148
|
+
extent: z.ZodNumber;
|
|
149
|
+
}, z.core.$strip>], null>;
|
|
98
150
|
/**
|
|
99
151
|
* simulator:custom-apis:invoke — API name + arbitrary JSON-serialisable params.
|
|
100
152
|
*
|
|
@@ -43,6 +43,49 @@ export const ProjectSaveCompileConfigSchema = z.tuple([
|
|
|
43
43
|
]);
|
|
44
44
|
/** popover:show — must be an object (not undefined/null/string). */
|
|
45
45
|
export const PopoverShowSchema = z.tuple([z.looseObject({})]);
|
|
46
|
+
/**
|
|
47
|
+
* tooltip:show — the trigger's own bounding rect (CSS px, main-window content
|
|
48
|
+
* coordinates — same space `getBoundingClientRect()` reports, no conversion,
|
|
49
|
+
* mirrors the base-view placement snapshot's Bounds) plus the label text.
|
|
50
|
+
*/
|
|
51
|
+
export const TooltipShowSchema = z.tuple([
|
|
52
|
+
z.object({
|
|
53
|
+
anchor: z.object({
|
|
54
|
+
x: z.number().finite(),
|
|
55
|
+
y: z.number().finite(),
|
|
56
|
+
width: z.number().finite().nonnegative(),
|
|
57
|
+
height: z.number().finite().nonnegative(),
|
|
58
|
+
}),
|
|
59
|
+
text: z.string().min(1).max(200),
|
|
60
|
+
}),
|
|
61
|
+
]);
|
|
62
|
+
export const TooltipMeasuredSchema = z.tuple([
|
|
63
|
+
z.object({
|
|
64
|
+
requestId: z.number().int().positive(),
|
|
65
|
+
width: z.number().finite().positive(),
|
|
66
|
+
height: z.number().finite().positive(),
|
|
67
|
+
}),
|
|
68
|
+
]);
|
|
69
|
+
/**
|
|
70
|
+
* projectCreate:show — the merged template catalog + suggested base dir
|
|
71
|
+
* main.tsx already resolved before asking main to show the overlay panel.
|
|
72
|
+
* Templates are re-validated loosely (they only round-trip back into the
|
|
73
|
+
* panel's own render, never interpreted main-side).
|
|
74
|
+
*/
|
|
75
|
+
export const ProjectCreateShowSchema = z.tuple([
|
|
76
|
+
z.object({
|
|
77
|
+
templates: z.array(z.looseObject({})),
|
|
78
|
+
defaultBaseDir: z.string(),
|
|
79
|
+
}),
|
|
80
|
+
]);
|
|
81
|
+
/** projectCreate:submit — the collected create-project form. */
|
|
82
|
+
export const ProjectCreateSubmitSchema = z.tuple([
|
|
83
|
+
z.object({
|
|
84
|
+
name: z.string().min(1),
|
|
85
|
+
path: AbsolutePath,
|
|
86
|
+
templateId: z.string().min(1),
|
|
87
|
+
}),
|
|
88
|
+
]);
|
|
46
89
|
/**
|
|
47
90
|
* Reasonable simulator width range. Window width is clamped UI-side, but
|
|
48
91
|
* we still reject obvious garbage (negative, zero, absurdly large).
|
|
@@ -144,6 +187,27 @@ export const HostToolbarAdvertiseHeightSchema = z.tuple([
|
|
|
144
187
|
extent: NonNegInt,
|
|
145
188
|
}),
|
|
146
189
|
]);
|
|
190
|
+
/**
|
|
191
|
+
* host-sidebar reverse size-advertiser payload — mirrors
|
|
192
|
+
* `HostToolbarAdvertiseHeightSchema` on the inline (width) axis.
|
|
193
|
+
*/
|
|
194
|
+
export const HostSidebarAdvertiseWidthSchema = z.tuple([
|
|
195
|
+
z.object({
|
|
196
|
+
axis: z.literal('inline'),
|
|
197
|
+
extent: NonNegInt,
|
|
198
|
+
}),
|
|
199
|
+
]);
|
|
200
|
+
/**
|
|
201
|
+
* host-dialog reverse size-advertiser payload. Unlike the single-axis
|
|
202
|
+
* toolbar/sidebar, the dialog's content advertises BOTH axes over the same
|
|
203
|
+
* channel — `axis` distinguishes which report this is.
|
|
204
|
+
*/
|
|
205
|
+
export const HostDialogAdvertiseSizeSchema = z.tuple([
|
|
206
|
+
z.object({
|
|
207
|
+
axis: z.union([z.literal('block'), z.literal('inline')]),
|
|
208
|
+
extent: NonNegInt,
|
|
209
|
+
}),
|
|
210
|
+
]);
|
|
147
211
|
/**
|
|
148
212
|
* simulator:custom-apis:invoke — API name + arbitrary JSON-serialisable params.
|
|
149
213
|
*
|
|
@@ -63,6 +63,14 @@ export declare function parseLocationRoute(search: string): SimulatorRoute | nul
|
|
|
63
63
|
export declare function parseRoute(url: string): SimulatorRoute | null;
|
|
64
64
|
/** Return the current page path (no query) from a URL, or `''` if unparseable. */
|
|
65
65
|
export declare function getCurrentPagePath(url: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Return the current page as a `pagePath?k=v&…` route string (WeChat DevTools
|
|
68
|
+
* page-path format), with the internal `scene` bookkeeping param stripped so
|
|
69
|
+
* the displayed route matches what the page actually received in `onLoad`.
|
|
70
|
+
* Returns `''` if unparseable. Symmetric with `encodePageSpec`/`decodePageSpec`
|
|
71
|
+
* and with the `SimulatorChannel.CurrentPage` payload.
|
|
72
|
+
*/
|
|
73
|
+
export declare function getCurrentPageRoute(url: string): string;
|
|
66
74
|
/**
|
|
67
75
|
* Rewrite the URL so `entry === current`. Used before a hot-reload so the
|
|
68
76
|
* container boots at just the top page — avoids merged-bundle requests for a
|
|
@@ -133,6 +133,21 @@ export function getCurrentPagePath(url) {
|
|
|
133
133
|
const route = parseRoute(url);
|
|
134
134
|
return route?.current.pagePath ?? '';
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Return the current page as a `pagePath?k=v&…` route string (WeChat DevTools
|
|
138
|
+
* page-path format), with the internal `scene` bookkeeping param stripped so
|
|
139
|
+
* the displayed route matches what the page actually received in `onLoad`.
|
|
140
|
+
* Returns `''` if unparseable. Symmetric with `encodePageSpec`/`decodePageSpec`
|
|
141
|
+
* and with the `SimulatorChannel.CurrentPage` payload.
|
|
142
|
+
*/
|
|
143
|
+
export function getCurrentPageRoute(url) {
|
|
144
|
+
const route = parseRoute(url);
|
|
145
|
+
if (!route)
|
|
146
|
+
return '';
|
|
147
|
+
const query = { ...route.current.query };
|
|
148
|
+
delete query['scene'];
|
|
149
|
+
return encodePageSpec({ pagePath: route.current.pagePath, query });
|
|
150
|
+
}
|
|
136
151
|
/**
|
|
137
152
|
* Rewrite the URL so `entry === current`. Used before a hot-reload so the
|
|
138
153
|
* container boots at just the top page — avoids merged-bundle requests for a
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -54,6 +54,13 @@ export interface ProjectSession {
|
|
|
54
54
|
close: () => Promise<void>;
|
|
55
55
|
port: number;
|
|
56
56
|
appInfo: AppInfo;
|
|
57
|
+
/**
|
|
58
|
+
* Run one real recompile of the session's project. Optional: a host
|
|
59
|
+
* CompilationAdapter predating this capability may omit it — the rebuild
|
|
60
|
+
* IPC then degrades to `{ supported: false }` and the renderer falls back
|
|
61
|
+
* to its reattach-only relaunch.
|
|
62
|
+
*/
|
|
63
|
+
rebuild?: () => Promise<void>;
|
|
57
64
|
}
|
|
58
65
|
export interface CompilationAdapter {
|
|
59
66
|
openProject(opts: Omit<OpenProjectOptions, 'containerDir' | 'outputDir'>): Promise<ProjectSession>;
|
|
@@ -116,6 +123,16 @@ export interface CompileConfig {
|
|
|
116
123
|
value: string;
|
|
117
124
|
}[];
|
|
118
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* A project's runtime kind, detected from its source layout (see
|
|
128
|
+
* `detectRuntimeType` in main's `project-repository.ts`). Lives here because
|
|
129
|
+
* the value crosses the process boundary — main detects it and pushes it to
|
|
130
|
+
* the renderer over `ViewChannel.HostSidebarCategorySelected`, and the
|
|
131
|
+
* renderer's `Project.type` carries it back in the project list. Two
|
|
132
|
+
* structurally identical unions declared on either side would type-check
|
|
133
|
+
* against each other today and silently diverge the moment one gains a member.
|
|
134
|
+
*/
|
|
135
|
+
export type ProjectType = 'miniprogram' | 'minigame';
|
|
119
136
|
export interface IpcResult<T = unknown> {
|
|
120
137
|
success: boolean;
|
|
121
138
|
data?: T;
|
|
@@ -3,8 +3,13 @@ export declare const VIEW_ID: {
|
|
|
3
3
|
readonly simulatorDevtools: "simulator-devtools";
|
|
4
4
|
readonly workbench: "workbench";
|
|
5
5
|
readonly hostToolbar: "host-toolbar";
|
|
6
|
+
readonly hostSidebar: "host-sidebar";
|
|
7
|
+
readonly hostDialog: "host-dialog";
|
|
6
8
|
readonly settings: "settings";
|
|
7
9
|
readonly popover: "popover";
|
|
10
|
+
readonly tooltip: "tooltip";
|
|
11
|
+
readonly projectCreateDialog: "project-create-dialog";
|
|
12
|
+
readonly updateDialog: "update-dialog";
|
|
8
13
|
};
|
|
9
14
|
export type DevtoolsViewId = (typeof VIEW_ID)[keyof typeof VIEW_ID];
|
|
10
15
|
export interface DevtoolsExtra {
|
|
@@ -13,7 +18,11 @@ export interface DevtoolsExtra {
|
|
|
13
18
|
export declare const VIEW_LAYER: {
|
|
14
19
|
readonly base: 0;
|
|
15
20
|
readonly hostToolbar: 5;
|
|
21
|
+
readonly hostSidebar: 5;
|
|
16
22
|
readonly settings: 10;
|
|
17
23
|
readonly popover: 20;
|
|
24
|
+
readonly tooltip: 30;
|
|
25
|
+
readonly dialog: 40;
|
|
26
|
+
readonly hostDialog: 45;
|
|
18
27
|
};
|
|
19
28
|
//# sourceMappingURL=view-ids.d.ts.map
|
package/dist/shared/view-ids.js
CHANGED
|
@@ -8,18 +8,39 @@ export const VIEW_ID = {
|
|
|
8
8
|
simulatorDevtools: 'simulator-devtools',
|
|
9
9
|
workbench: 'workbench',
|
|
10
10
|
hostToolbar: 'host-toolbar',
|
|
11
|
+
hostSidebar: 'host-sidebar',
|
|
12
|
+
hostDialog: 'host-dialog',
|
|
11
13
|
settings: 'settings',
|
|
12
14
|
popover: 'popover',
|
|
15
|
+
tooltip: 'tooltip',
|
|
16
|
+
projectCreateDialog: 'project-create-dialog',
|
|
17
|
+
updateDialog: 'update-dialog',
|
|
13
18
|
};
|
|
14
19
|
// z-order layers; larger paints on top. Base overlays share layer 0 (they never
|
|
15
20
|
// overlap each other — the simulator device WCV, the console/DevTools WCV, and
|
|
16
21
|
// the embedded workbench occupy disjoint dock regions). The host-toolbar strip
|
|
17
22
|
// sits above the base row; settings and popover are the top tier (settings below
|
|
18
23
|
// a simultaneously-open popover), replacing the imperative raiseTopOverlays.
|
|
24
|
+
// tooltip sits above ALL of them — it must never be occluded by a popover/
|
|
25
|
+
// settings sheet either, and it's the reason this layer exists at all: a
|
|
26
|
+
// DOM-portaled (Radix) tooltip rendered by the main window's OWN renderer, or
|
|
27
|
+
// even the browser-native `title` attribute, is part of that renderer's paint
|
|
28
|
+
// surface and renders BEHIND every other WCV mounted on top of it (simulator,
|
|
29
|
+
// editor, settings, popover) — CSS z-index cannot reach across that boundary.
|
|
30
|
+
// Routing the tooltip through this same reconciler (a real WCV of its own,
|
|
31
|
+
// placed via `setOverlayDesired`) is what actually fixes that; see
|
|
32
|
+
// `overlay-panels-view.ts`'s tooltip functions.
|
|
19
33
|
export const VIEW_LAYER = {
|
|
20
34
|
base: 0,
|
|
21
35
|
hostToolbar: 5,
|
|
36
|
+
hostSidebar: 5,
|
|
22
37
|
settings: 10,
|
|
23
38
|
popover: 20,
|
|
39
|
+
tooltip: 30,
|
|
40
|
+
// devtools' own ProjectCreateDialog/UpdateDialog panels (createOverlayPanel).
|
|
41
|
+
dialog: 40,
|
|
42
|
+
// Host-controlled fully-custom dialog (loadURL-level takeover); sits above
|
|
43
|
+
// devtools' own dialog layer so host content is never occluded by it.
|
|
44
|
+
hostDialog: 45,
|
|
24
45
|
};
|
|
25
46
|
//# sourceMappingURL=view-ids.js.map
|