@dimina-kit/devtools 0.4.0-dev.20260824071518 → 0.4.0-dev.20260828161241
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 +59 -2
- package/dist/main/index.bundle.js +986 -245
- package/dist/main/ipc/index.d.ts +2 -0
- package/dist/main/ipc/index.js +2 -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 +36 -1
- 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.js +1 -1
- 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/notifications/renderer-notifier.d.ts +30 -1
- package/dist/main/services/notifications/renderer-notifier.js +23 -1
- package/dist/main/services/projects/create-project-service.js +9 -2
- package/dist/main/services/projects/local-provider.js +6 -0
- package/dist/main/services/projects/project-repository.d.ts +29 -1
- package/dist/main/services/projects/project-repository.js +151 -17
- package/dist/main/services/projects/types.d.ts +13 -2
- 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/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 -224
- 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/overlay-panels-view.d.ts +23 -0
- package/dist/main/services/views/overlay-panels-view.js +93 -4
- package/dist/main/services/views/placement-reconciler.d.ts +14 -2
- package/dist/main/services/views/placement-reconciler.js +27 -0
- package/dist/main/services/views/placement-test-driver.d.ts +1 -0
- package/dist/main/services/views/placement-test-driver.js +3 -0
- package/dist/main/services/views/view-manager-devtools-host-test-fixtures.js +3 -1
- package/dist/main/services/views/view-manager.d.ts +10 -78
- package/dist/main/services/views/view-manager.js +34 -3
- package/dist/main/services/workbench-context.d.ts +18 -4
- package/dist/main/services/workbench-context.js +1 -0
- package/dist/main/services/workspace/workspace-service.d.ts +2 -0
- package/dist/main/services/workspace/workspace-service.js +14 -0
- package/dist/main/utils/paths.d.ts +4 -0
- package/dist/main/utils/paths.js +4 -0
- package/dist/main/utils/sender-policy.js +10 -0
- package/dist/native-host/common/common.js +65 -62
- package/dist/native-host/render/render.js +2230 -2052
- 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/simulator.cjs.map +1 -1
- package/dist/renderer/assets/button-D5Q2wkXq.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-Bqi8hpdi.js +2 -0
- package/dist/renderer/assets/dialog-e1TecTOY.js +46 -0
- package/dist/renderer/assets/dist-DKWdE1TK.js +2 -0
- package/dist/renderer/assets/hostSidebarDefault-B3yLfy8j.js +2 -0
- package/dist/renderer/assets/index-CsPD68N_.js +5 -0
- package/dist/renderer/assets/input-Ct3alvkq.js +2 -0
- package/dist/renderer/assets/ipc-channels-overlays-LsDzGAtV.js +2 -0
- package/dist/renderer/assets/jsx-runtime-2vXHouwr.css +1 -0
- package/dist/renderer/assets/jsx-runtime-DGLHmmOq.js +9 -0
- package/dist/renderer/assets/popover-Dix5cm_b.js +2 -0
- package/dist/renderer/assets/project-api-k7Oq9iaq.js +2 -0
- package/dist/renderer/assets/projectCreateDialog-Bbjz75bP.js +2 -0
- package/dist/renderer/assets/select-acGb0AmJ.js +2 -0
- package/dist/renderer/assets/settings-CQrTMr43.js +2 -0
- package/dist/renderer/assets/settings-api-CrUQ9rYV.js +2 -0
- package/dist/renderer/assets/settings-tab-bar-Cw1kVIf2.js +2 -0
- package/dist/renderer/assets/tooltip-B_-_YVbw.js +2 -0
- package/dist/renderer/assets/types-CsEKtFyr.js +2 -0
- package/dist/renderer/assets/updateDialog-NsF8223A.js +2 -0
- package/dist/renderer/assets/utils-kfQov6Pa.js +2 -0
- package/dist/renderer/assets/view-api-CLn3rcQE.js +2 -0
- package/dist/renderer/assets/{workbenchSettings-oq_EyfKf.js → workbenchSettings-CV4LVA9b.js} +3 -3
- package/dist/renderer/entries/host-sidebar-default/index.html +21 -0
- package/dist/renderer/entries/main/index.html +17 -8
- package/dist/renderer/entries/popover/index.html +10 -7
- package/dist/renderer/entries/project-create-dialog/index.html +27 -0
- package/dist/renderer/entries/settings/index.html +10 -7
- package/dist/renderer/entries/tooltip/index.html +5 -4
- package/dist/renderer/entries/update-dialog/index.html +25 -0
- package/dist/renderer/entries/workbench-settings/index.html +11 -7
- package/dist/service-host/preload.cjs +10 -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 +4 -77
- package/dist/shared/ipc-channels.js +4 -98
- package/dist/shared/ipc-schemas.d.ts +44 -0
- package/dist/shared/ipc-schemas.js +55 -0
- package/dist/shared/types.d.ts +71 -0
- package/dist/shared/view-ids.d.ts +7 -0
- package/dist/shared/view-ids.js +10 -0
- package/package.json +8 -8
- package/dist/renderer/assets/constants-Bdz0LHdy.js +0 -2
- package/dist/renderer/assets/index-CtznrmHR.js +0 -49
- package/dist/renderer/assets/input-Dmm6nob5.js +0 -2
- package/dist/renderer/assets/ipc-transport-BOg0gR9W.js +0 -9
- package/dist/renderer/assets/ipc-transport-DgQhZaE9.css +0 -1
- package/dist/renderer/assets/popover-Cd1FEGOX.js +0 -2
- package/dist/renderer/assets/select-BaYox7If.js +0 -2
- package/dist/renderer/assets/settings-BXvwuFaz.js +0 -2
- package/dist/renderer/assets/settings-api-Bo9GbYqs.js +0 -2
- package/dist/renderer/assets/settings-tab-bar-Beia6lMr.js +0 -2
- package/dist/renderer/assets/tooltip-DfQqK3Sk.js +0 -2
- package/dist/renderer/assets/view-api-nn69je7A.js +0 -2
|
@@ -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
|
|
@@ -138,10 +138,14 @@ export declare const ProjectsChannel: {
|
|
|
138
138
|
readonly List: "projects:list";
|
|
139
139
|
readonly Add: "projects:add";
|
|
140
140
|
readonly Remove: "projects:remove";
|
|
141
|
+
/** Edit an existing record's name / icon; its path stays the identity. */
|
|
142
|
+
readonly Update: "projects:update";
|
|
141
143
|
/** Merged + sanitized template catalog for the create-project dialog. */
|
|
142
144
|
readonly ListTemplates: "projects:listTemplates";
|
|
143
145
|
/** Host-supplied create-project dialog hook (returns input or null). */
|
|
144
146
|
readonly OpenCreateDialog: "projects:openCreateDialog";
|
|
147
|
+
/** Host-supplied edit-project dialog hook; `null` means no hook is configured. */
|
|
148
|
+
readonly OpenEditDialog: "projects:openEditDialog";
|
|
145
149
|
/** Server-side scaffold + register (delegates to create-project-service). */
|
|
146
150
|
readonly Create: "projects:create";
|
|
147
151
|
/** Default values used to pre-fill the create-project dialog (baseDir). */
|
|
@@ -155,70 +159,6 @@ export interface ProjectCreateDefaults {
|
|
|
155
159
|
export declare const DialogChannel: {
|
|
156
160
|
readonly OpenDirectory: "dialog:openDirectory";
|
|
157
161
|
};
|
|
158
|
-
export declare const ViewChannel: {
|
|
159
|
-
/**
|
|
160
|
-
* Reverse size-advertiser: the host-toolbar WCV's OWN renderer advertises its
|
|
161
|
-
* intrinsic content height so main reserves exactly that much. Payload
|
|
162
|
-
* `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
|
|
163
|
-
*/
|
|
164
|
-
readonly HostToolbarAdvertiseHeight: "view:host-toolbar:advertise-height";
|
|
165
|
-
/**
|
|
166
|
-
* main → host-toolbar WCV renderer: per-load MessagePort handshake for the
|
|
167
|
-
* gated narrow channel. On every toolbar `did-finish-load` main creates a
|
|
168
|
-
* `MessageChannelMain` and transfers port2 here
|
|
169
|
-
* (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
|
|
170
|
-
* toolbar runtime preload receives it via `event.ports[0]` and bridges it to
|
|
171
|
-
* the page as `window.diminaHostToolbar`. Envelope both directions:
|
|
172
|
-
* `{ channel: string, payload: unknown }`.
|
|
173
|
-
*/
|
|
174
|
-
readonly HostToolbarPort: "view:host-toolbar:port";
|
|
175
|
-
/**
|
|
176
|
-
* main → main-window renderer: push the reserved host-toolbar height so the
|
|
177
|
-
* renderer placeholder div resizes (closing the dynamic-height loop).
|
|
178
|
-
*/
|
|
179
|
-
readonly HostToolbarHeightChanged: "view:host-toolbar:height-changed";
|
|
180
|
-
/**
|
|
181
|
-
* main ← main-window renderer (invoke): pull the last NOTIFIED toolbar
|
|
182
|
-
* height retained in main. Mount-time replay companion to
|
|
183
|
-
* `HostToolbarHeightChanged`: the push listener mounts with the project
|
|
184
|
-
* view and the toolbar's size-advertiser deduplicates (never re-reports),
|
|
185
|
-
* so a height pushed while no project view was mounted would otherwise be
|
|
186
|
-
* lost forever (cold start on the project list races it; close-project →
|
|
187
|
-
* reopen hits it deterministically). No payload; resolves a number.
|
|
188
|
-
*/
|
|
189
|
-
readonly HostToolbarGetHeight: "view:host-toolbar:get-height";
|
|
190
|
-
/**
|
|
191
|
-
* Renderer → main: the window-level placement snapshot (one monotonic epoch
|
|
192
|
-
* per commit tick, one generation per renderer lifetime) that drives the view
|
|
193
|
-
* reconciler. The single source of truth for every managed native view's
|
|
194
|
-
* bounds/visibility/z-order — supersedes the per-view bounds channels above.
|
|
195
|
-
* invoke.
|
|
196
|
-
*/
|
|
197
|
-
readonly PlacementSnapshot: "view:placement-snapshot";
|
|
198
|
-
};
|
|
199
|
-
export interface ViewBounds {
|
|
200
|
-
x: number;
|
|
201
|
-
y: number;
|
|
202
|
-
width: number;
|
|
203
|
-
height: number;
|
|
204
|
-
}
|
|
205
|
-
export declare const PopoverChannel: {
|
|
206
|
-
readonly Show: "popover:show";
|
|
207
|
-
readonly Hide: "popover:hide";
|
|
208
|
-
readonly Relaunch: "popover:relaunch";
|
|
209
|
-
readonly Closed: "popover:closed";
|
|
210
|
-
readonly Init: "popover:init";
|
|
211
|
-
};
|
|
212
|
-
export declare const OverlayChannel: {
|
|
213
|
-
readonly Ready: "overlay:ready";
|
|
214
|
-
};
|
|
215
|
-
export declare const TooltipChannel: {
|
|
216
|
-
readonly Prepare: "tooltip:prepare";
|
|
217
|
-
readonly Show: "tooltip:show";
|
|
218
|
-
readonly Hide: "tooltip:hide";
|
|
219
|
-
readonly Init: "tooltip:init";
|
|
220
|
-
readonly Measured: "tooltip:measured";
|
|
221
|
-
};
|
|
222
162
|
export declare const WindowChannel: {
|
|
223
163
|
readonly NavigateBack: "window:navigateBack";
|
|
224
164
|
readonly OpenProject: "window:openProject";
|
|
@@ -237,17 +177,4 @@ export declare const AutomationChannel: {
|
|
|
237
177
|
export declare const InternalDevtoolsChannel: {
|
|
238
178
|
readonly Open: "internal-devtools:open";
|
|
239
179
|
};
|
|
240
|
-
export declare const SettingsChannel: {
|
|
241
|
-
readonly SetVisible: "settings:setVisible";
|
|
242
|
-
readonly ConfigChanged: "settings:configChanged";
|
|
243
|
-
readonly ProjectSettingsChanged: "settings:projectSettingsChanged";
|
|
244
|
-
readonly Init: "settings:init";
|
|
245
|
-
};
|
|
246
|
-
export declare const UpdateChannel: {
|
|
247
|
-
readonly Check: "updates:check";
|
|
248
|
-
readonly Download: "updates:download";
|
|
249
|
-
readonly Install: "updates:install";
|
|
250
|
-
readonly DownloadProgress: "updates:downloadProgress";
|
|
251
|
-
readonly Available: "updates:available";
|
|
252
|
-
};
|
|
253
180
|
//# sourceMappingURL=ipc-channels.d.ts.map
|
|
@@ -193,10 +193,14 @@ export const ProjectsChannel = {
|
|
|
193
193
|
List: 'projects:list',
|
|
194
194
|
Add: 'projects:add',
|
|
195
195
|
Remove: 'projects:remove',
|
|
196
|
+
/** Edit an existing record's name / icon; its path stays the identity. */
|
|
197
|
+
Update: 'projects:update',
|
|
196
198
|
/** Merged + sanitized template catalog for the create-project dialog. */
|
|
197
199
|
ListTemplates: 'projects:listTemplates',
|
|
198
200
|
/** Host-supplied create-project dialog hook (returns input or null). */
|
|
199
201
|
OpenCreateDialog: 'projects:openCreateDialog',
|
|
202
|
+
/** Host-supplied edit-project dialog hook; `null` means no hook is configured. */
|
|
203
|
+
OpenEditDialog: 'projects:openEditDialog',
|
|
200
204
|
/** Server-side scaffold + register (delegates to create-project-service). */
|
|
201
205
|
Create: 'projects:create',
|
|
202
206
|
/** Default values used to pre-fill the create-project dialog (baseDir). */
|
|
@@ -206,86 +210,6 @@ export const ProjectsChannel = {
|
|
|
206
210
|
export const DialogChannel = {
|
|
207
211
|
OpenDirectory: 'dialog:openDirectory',
|
|
208
212
|
};
|
|
209
|
-
// ── Embedded views (renderer → main) ─────────────────────────────────────
|
|
210
|
-
//
|
|
211
|
-
// The main window's React layout owns the *positions* of the editor +
|
|
212
|
-
// simulator-DevTools WebContentsView overlays — each visible placeholder
|
|
213
|
-
// `<div>` measures its client rect via ResizeObserver and pushes the
|
|
214
|
-
// rectangle to the main process. The view manager caches the latest
|
|
215
|
-
// payload per kind and applies it to the overlay; no payload means the
|
|
216
|
-
// overlay is hidden.
|
|
217
|
-
//
|
|
218
|
-
// Payload (after schema validation): `{ x, y, width, height }` in CSS
|
|
219
|
-
// pixels relative to the window's content area (origin = top-left,
|
|
220
|
-
// not including the OS chrome).
|
|
221
|
-
export const ViewChannel = {
|
|
222
|
-
/**
|
|
223
|
-
* Reverse size-advertiser: the host-toolbar WCV's OWN renderer advertises its
|
|
224
|
-
* intrinsic content height so main reserves exactly that much. Payload
|
|
225
|
-
* `{ axis: 'block', extent }`. fire-and-forget (send), NOT invoke.
|
|
226
|
-
*/
|
|
227
|
-
HostToolbarAdvertiseHeight: 'view:host-toolbar:advertise-height',
|
|
228
|
-
/**
|
|
229
|
-
* main → host-toolbar WCV renderer: per-load MessagePort handshake for the
|
|
230
|
-
* gated narrow channel. On every toolbar `did-finish-load` main creates a
|
|
231
|
-
* `MessageChannelMain` and transfers port2 here
|
|
232
|
-
* (`wc.postMessage(HostToolbarPort, null, [port2])`); the session-resident
|
|
233
|
-
* toolbar runtime preload receives it via `event.ports[0]` and bridges it to
|
|
234
|
-
* the page as `window.diminaHostToolbar`. Envelope both directions:
|
|
235
|
-
* `{ channel: string, payload: unknown }`.
|
|
236
|
-
*/
|
|
237
|
-
HostToolbarPort: 'view:host-toolbar:port',
|
|
238
|
-
/**
|
|
239
|
-
* main → main-window renderer: push the reserved host-toolbar height so the
|
|
240
|
-
* renderer placeholder div resizes (closing the dynamic-height loop).
|
|
241
|
-
*/
|
|
242
|
-
HostToolbarHeightChanged: 'view:host-toolbar:height-changed',
|
|
243
|
-
/**
|
|
244
|
-
* main ← main-window renderer (invoke): pull the last NOTIFIED toolbar
|
|
245
|
-
* height retained in main. Mount-time replay companion to
|
|
246
|
-
* `HostToolbarHeightChanged`: the push listener mounts with the project
|
|
247
|
-
* view and the toolbar's size-advertiser deduplicates (never re-reports),
|
|
248
|
-
* so a height pushed while no project view was mounted would otherwise be
|
|
249
|
-
* lost forever (cold start on the project list races it; close-project →
|
|
250
|
-
* reopen hits it deterministically). No payload; resolves a number.
|
|
251
|
-
*/
|
|
252
|
-
HostToolbarGetHeight: 'view:host-toolbar:get-height',
|
|
253
|
-
/**
|
|
254
|
-
* Renderer → main: the window-level placement snapshot (one monotonic epoch
|
|
255
|
-
* per commit tick, one generation per renderer lifetime) that drives the view
|
|
256
|
-
* reconciler. The single source of truth for every managed native view's
|
|
257
|
-
* bounds/visibility/z-order — supersedes the per-view bounds channels above.
|
|
258
|
-
* invoke.
|
|
259
|
-
*/
|
|
260
|
-
PlacementSnapshot: 'view:placement-snapshot',
|
|
261
|
-
};
|
|
262
|
-
// ── Popover ──────────────────────────────────────────────────────────────
|
|
263
|
-
export const PopoverChannel = {
|
|
264
|
-
Show: 'popover:show',
|
|
265
|
-
Hide: 'popover:hide',
|
|
266
|
-
Relaunch: 'popover:relaunch',
|
|
267
|
-
Closed: 'popover:closed',
|
|
268
|
-
Init: 'popover:init',
|
|
269
|
-
};
|
|
270
|
-
// ── Tooltip ──────────────────────────────────────────────────────────────
|
|
271
|
-
//
|
|
272
|
-
// A top-tier overlay WebContentsView (VIEW_LAYER.tooltip — see view-ids.ts),
|
|
273
|
-
// NOT a DOM tooltip in the main renderer: any DOM-portaled floating UI (Radix
|
|
274
|
-
// Tooltip) or the browser-native `title` attribute lives in the main
|
|
275
|
-
// renderer's own paint surface, which every other WCV (simulator, editor,
|
|
276
|
-
// settings, popover) renders on top of — CSS cannot reach across that
|
|
277
|
-
// boundary. A trigger reports its anchor rect + label; main computes the
|
|
278
|
-
// tooltip's screen bounds and shows/repositions/hides this overlay.
|
|
279
|
-
export const OverlayChannel = {
|
|
280
|
-
Ready: 'overlay:ready',
|
|
281
|
-
};
|
|
282
|
-
export const TooltipChannel = {
|
|
283
|
-
Prepare: 'tooltip:prepare',
|
|
284
|
-
Show: 'tooltip:show',
|
|
285
|
-
Hide: 'tooltip:hide',
|
|
286
|
-
Init: 'tooltip:init',
|
|
287
|
-
Measured: 'tooltip:measured',
|
|
288
|
-
};
|
|
289
213
|
// ── Window ───────────────────────────────────────────────────────────────
|
|
290
214
|
export const WindowChannel = {
|
|
291
215
|
NavigateBack: 'window:navigateBack',
|
|
@@ -322,21 +246,3 @@ export const InternalDevtoolsChannel = {
|
|
|
322
246
|
// its own dedicated window (see internal-devtools-window/index.ts).
|
|
323
247
|
Open: 'internal-devtools:open',
|
|
324
248
|
};
|
|
325
|
-
// ── Embedded settings overlay ────────────────────────────────────────────
|
|
326
|
-
export const SettingsChannel = {
|
|
327
|
-
SetVisible: 'settings:setVisible',
|
|
328
|
-
ConfigChanged: 'settings:configChanged',
|
|
329
|
-
ProjectSettingsChanged: 'settings:projectSettingsChanged',
|
|
330
|
-
Init: 'settings:init',
|
|
331
|
-
};
|
|
332
|
-
// ── Updates (UpdateManager) ──────────────────────────────────────────────
|
|
333
|
-
//
|
|
334
|
-
// String values are FROZEN: shipped builds key off them. Add new entries
|
|
335
|
-
// here, never rename existing ones.
|
|
336
|
-
export const UpdateChannel = {
|
|
337
|
-
Check: 'updates:check',
|
|
338
|
-
Download: 'updates:download',
|
|
339
|
-
Install: 'updates:install',
|
|
340
|
-
DownloadProgress: 'updates:downloadProgress',
|
|
341
|
-
Available: 'updates:available',
|
|
342
|
-
};
|
|
@@ -42,6 +42,22 @@ export declare const TooltipMeasuredSchema: z.ZodTuple<[z.ZodObject<{
|
|
|
42
42
|
width: z.ZodNumber;
|
|
43
43
|
height: z.ZodNumber;
|
|
44
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>;
|
|
45
61
|
/**
|
|
46
62
|
* simulator:attach-native (native-host only) — the simulator URL to load into
|
|
47
63
|
* the top-level WebContentsView + simulator width. The URL is the dev-server
|
|
@@ -114,6 +130,23 @@ export declare const HostToolbarAdvertiseHeightSchema: z.ZodTuple<[z.ZodObject<{
|
|
|
114
130
|
axis: z.ZodLiteral<"block">;
|
|
115
131
|
extent: z.ZodNumber;
|
|
116
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>;
|
|
117
150
|
/**
|
|
118
151
|
* simulator:custom-apis:invoke — API name + arbitrary JSON-serialisable params.
|
|
119
152
|
*
|
|
@@ -125,8 +158,19 @@ export declare const SimulatorCustomApiInvokeSchema: z.ZodTuple<[z.ZodString, z.
|
|
|
125
158
|
export declare const ProjectGetPagesSchema: z.ZodTuple<[z.ZodString], null>;
|
|
126
159
|
/** project:getCompileConfig — absolute project path. */
|
|
127
160
|
export declare const ProjectGetCompileConfigSchema: z.ZodTuple<[z.ZodString], null>;
|
|
161
|
+
/**
|
|
162
|
+
* projects:update — absolute project directory path + the editable subset of
|
|
163
|
+
* its record. The path is the identity of the record being edited, never a
|
|
164
|
+
* field of the patch.
|
|
165
|
+
*/
|
|
166
|
+
export declare const ProjectsUpdateSchema: z.ZodTuple<[z.ZodString, z.ZodObject<{
|
|
167
|
+
name: z.ZodOptional<z.ZodString>;
|
|
168
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, z.core.$strip>], null>;
|
|
128
170
|
/** projects:remove — absolute project directory path. */
|
|
129
171
|
export declare const ProjectsRemoveSchema: z.ZodTuple<[z.ZodString], null>;
|
|
172
|
+
/** projects:openEditDialog — absolute project directory path. */
|
|
173
|
+
export declare const ProjectsOpenEditDialogSchema: z.ZodTuple<[z.ZodString], null>;
|
|
130
174
|
/**
|
|
131
175
|
* workbenchSettings:save — full WorkbenchSettings object.
|
|
132
176
|
*
|
|
@@ -66,6 +66,26 @@ export const TooltipMeasuredSchema = z.tuple([
|
|
|
66
66
|
height: z.number().finite().positive(),
|
|
67
67
|
}),
|
|
68
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
|
+
]);
|
|
69
89
|
/**
|
|
70
90
|
* Reasonable simulator width range. Window width is clamped UI-side, but
|
|
71
91
|
* we still reject obvious garbage (negative, zero, absurdly large).
|
|
@@ -167,6 +187,27 @@ export const HostToolbarAdvertiseHeightSchema = z.tuple([
|
|
|
167
187
|
extent: NonNegInt,
|
|
168
188
|
}),
|
|
169
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
|
+
]);
|
|
170
211
|
/**
|
|
171
212
|
* simulator:custom-apis:invoke — API name + arbitrary JSON-serialisable params.
|
|
172
213
|
*
|
|
@@ -181,8 +222,22 @@ export const SimulatorCustomApiInvokeSchema = z.tuple([
|
|
|
181
222
|
export const ProjectGetPagesSchema = z.tuple([AbsolutePath]);
|
|
182
223
|
/** project:getCompileConfig — absolute project path. */
|
|
183
224
|
export const ProjectGetCompileConfigSchema = z.tuple([AbsolutePath]);
|
|
225
|
+
/**
|
|
226
|
+
* projects:update — absolute project directory path + the editable subset of
|
|
227
|
+
* its record. The path is the identity of the record being edited, never a
|
|
228
|
+
* field of the patch.
|
|
229
|
+
*/
|
|
230
|
+
export const ProjectsUpdateSchema = z.tuple([
|
|
231
|
+
AbsolutePath,
|
|
232
|
+
z.object({
|
|
233
|
+
name: z.string().min(1).max(200).optional(),
|
|
234
|
+
iconUrl: z.string().max(2048).optional(),
|
|
235
|
+
}),
|
|
236
|
+
]);
|
|
184
237
|
/** projects:remove — absolute project directory path. */
|
|
185
238
|
export const ProjectsRemoveSchema = z.tuple([AbsolutePath]);
|
|
239
|
+
/** projects:openEditDialog — absolute project directory path. */
|
|
240
|
+
export const ProjectsOpenEditDialogSchema = z.tuple([AbsolutePath]);
|
|
186
241
|
/**
|
|
187
242
|
* workbenchSettings:save — full WorkbenchSettings object.
|
|
188
243
|
*
|
package/dist/shared/types.d.ts
CHANGED
|
@@ -123,6 +123,16 @@ export interface CompileConfig {
|
|
|
123
123
|
value: string;
|
|
124
124
|
}[];
|
|
125
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';
|
|
126
136
|
export interface IpcResult<T = unknown> {
|
|
127
137
|
success: boolean;
|
|
128
138
|
data?: T;
|
|
@@ -212,6 +222,7 @@ export interface ProjectsProvider {
|
|
|
212
222
|
validateProjectDir?(dirPath: string): string | null;
|
|
213
223
|
addProject(dirPath: string): unknown;
|
|
214
224
|
removeProject(dirPath: string): void | Promise<void>;
|
|
225
|
+
updateProject?(dirPath: string, patch: unknown): unknown;
|
|
215
226
|
updateLastOpened?(dirPath: string): void | Promise<void>;
|
|
216
227
|
getCompileConfig?(dirPath: string): unknown;
|
|
217
228
|
saveCompileConfig?(dirPath: string, cfg: unknown): void | Promise<void>;
|
|
@@ -345,6 +356,32 @@ export interface WorkbenchAppConfig extends WorkbenchConfig {
|
|
|
345
356
|
parentWindow: import('electron').BrowserWindow;
|
|
346
357
|
templates: ProjectTemplate[];
|
|
347
358
|
}) => Promise<CustomCreateProjectDialogResult>;
|
|
359
|
+
/**
|
|
360
|
+
* Host-supplied "编辑项目" dialog. When provided, the renderer routes the
|
|
361
|
+
* project card's edit action through IPC into this main-process hook
|
|
362
|
+
* instead of showing the built-in dialog. `project` is read from the
|
|
363
|
+
* current project-list record (not whatever the renderer happened to have
|
|
364
|
+
* in state), so the host always sees devtools' own authoritative record.
|
|
365
|
+
*
|
|
366
|
+
* Return either:
|
|
367
|
+
* - `null` — user cancelled; devtools does nothing.
|
|
368
|
+
* - `{ name?, iconUrl? }` — the host collected an edit; devtools applies
|
|
369
|
+
* it via `workspace.updateProject`, the same path the built-in dialog's
|
|
370
|
+
* submit uses.
|
|
371
|
+
* - `{ updated: EditableProject }` — the host has ALREADY persisted the
|
|
372
|
+
* change itself; devtools just refreshes the list.
|
|
373
|
+
*
|
|
374
|
+
* Unlike `customCreateProjectDialog`, "no hook configured" and "user
|
|
375
|
+
* cancelled" are NOT both collapsed to `null` on the wire: the create flow
|
|
376
|
+
* does that and it means a cancelled host dialog falls through into the
|
|
377
|
+
* built-in one right after. The `projects:openEditDialog` IPC instead
|
|
378
|
+
* returns `null` only when no hook is configured, and wraps the hook's
|
|
379
|
+
* result as `{ result }` otherwise — see `OpenEditProjectDialogReply`.
|
|
380
|
+
*/
|
|
381
|
+
customEditProjectDialog?: (ctx: {
|
|
382
|
+
parentWindow: import('electron').BrowserWindow;
|
|
383
|
+
project: EditableProject;
|
|
384
|
+
}) => Promise<CustomEditProjectDialogResult>;
|
|
348
385
|
}
|
|
349
386
|
/**
|
|
350
387
|
* Discriminated return of `customCreateProjectDialog`. `null` = cancelled.
|
|
@@ -362,4 +399,38 @@ export type CustomCreateProjectDialogResult = null | {
|
|
|
362
399
|
lastOpened?: string | null;
|
|
363
400
|
};
|
|
364
401
|
} | CreateProjectInput;
|
|
402
|
+
/**
|
|
403
|
+
* Structural minimum devtools needs to render a project-list card, passed to
|
|
404
|
+
* `customEditProjectDialog` and returned as its `updated` variant. Mirrors
|
|
405
|
+
* `Project` in `./projects-provider`.
|
|
406
|
+
*/
|
|
407
|
+
export interface EditableProject {
|
|
408
|
+
name: string;
|
|
409
|
+
path: string;
|
|
410
|
+
iconUrl?: string;
|
|
411
|
+
lastOpened?: string | null;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Discriminated return of `customEditProjectDialog`. `null` = cancelled.
|
|
415
|
+
* `{ updated }` = the host already persisted the edit; devtools just
|
|
416
|
+
* refreshes. Otherwise a `{ name?, iconUrl? }` patch devtools applies via
|
|
417
|
+
* `workspace.updateProject`.
|
|
418
|
+
*/
|
|
419
|
+
export type CustomEditProjectDialogResult = null | {
|
|
420
|
+
updated: EditableProject;
|
|
421
|
+
} | {
|
|
422
|
+
name?: string;
|
|
423
|
+
iconUrl?: string;
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* Wire reply for `projects:openEditDialog`. `null` means the host configured
|
|
427
|
+
* no `customEditProjectDialog` hook at all — the renderer should show the
|
|
428
|
+
* built-in dialog. When a hook IS configured, the IPC always resolves
|
|
429
|
+
* `{ result }` even if `result` is `null` (user cancelled the host dialog),
|
|
430
|
+
* so the renderer can tell "no hook" apart from "hook ran, user cancelled"
|
|
431
|
+
* and skip the built-in fallback in the latter case.
|
|
432
|
+
*/
|
|
433
|
+
export type OpenEditProjectDialogReply = null | {
|
|
434
|
+
result: CustomEditProjectDialogResult;
|
|
435
|
+
};
|
|
365
436
|
//# sourceMappingURL=types.d.ts.map
|