@dimina-kit/devtools 0.4.0-dev.20260824071518 → 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 +55 -2
- package/dist/main/index.bundle.js +887 -234
- 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 +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.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/project-repository.d.ts +4 -1
- package/dist/main/services/projects/project-repository.js +63 -5
- 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/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-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-oq_EyfKf.js → workbenchSettings-DrajRQUk.js} +3 -3
- package/dist/renderer/entries/host-sidebar-default/index.html +21 -0
- package/dist/renderer/entries/main/index.html +15 -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 +0 -77
- package/dist/shared/ipc-channels.js +0 -98
- package/dist/shared/ipc-schemas.d.ts +33 -0
- package/dist/shared/ipc-schemas.js +41 -0
- package/dist/shared/types.d.ts +10 -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
package/dist/main/ipc/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ export { registerAppIpc } from './app.js';
|
|
|
2
2
|
export { registerSimulatorIpc } from './simulator.js';
|
|
3
3
|
export { registerPopoverIpc, popoverModule } from './popover.js';
|
|
4
4
|
export { registerTooltipIpc, tooltipModule } from './tooltip.js';
|
|
5
|
+
export { registerProjectCreateIpc, projectCreateModule } from './project-create.js';
|
|
5
6
|
export { registerProjectsIpc, projectsModule } from './projects.js';
|
|
6
7
|
export { registerSessionIpc, sessionModule } from './session.js';
|
|
7
8
|
export { registerSettingsIpc, settingsModule } from './settings.js';
|
|
8
9
|
export { registerInternalDevtoolsIpc } from './internal-devtools.js';
|
|
10
|
+
export { registerViewsIpc } from './views.js';
|
|
9
11
|
export { simulatorModule } from './simulator-module.js';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/main/ipc/index.js
CHANGED
|
@@ -2,9 +2,11 @@ export { registerAppIpc } from './app.js';
|
|
|
2
2
|
export { registerSimulatorIpc } from './simulator.js';
|
|
3
3
|
export { registerPopoverIpc, popoverModule } from './popover.js';
|
|
4
4
|
export { registerTooltipIpc, tooltipModule } from './tooltip.js';
|
|
5
|
+
export { registerProjectCreateIpc, projectCreateModule } from './project-create.js';
|
|
5
6
|
export { registerProjectsIpc, projectsModule } from './projects.js';
|
|
6
7
|
export { registerSessionIpc, sessionModule } from './session.js';
|
|
7
8
|
export { registerSettingsIpc, settingsModule } from './settings.js';
|
|
8
9
|
export { registerInternalDevtoolsIpc } from './internal-devtools.js';
|
|
10
|
+
export { registerViewsIpc } from './views.js';
|
|
9
11
|
export { simulatorModule } from './simulator-module.js';
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
package/dist/main/ipc/popover.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PopoverChannel } from '../../shared/ipc-channels.js';
|
|
1
|
+
import { PopoverChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
2
|
import { PopoverShowSchema, PopoverRelaunchSchema, } from '../../shared/ipc-schemas.js';
|
|
3
3
|
import { validate } from '../utils/ipc-schema.js';
|
|
4
4
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkbenchModule } from '../services/module.js';
|
|
2
|
+
import type { ViewManager } from '../services/views/view-manager.js';
|
|
3
|
+
import type { RendererNotifier } from '../services/notifications/renderer-notifier.js';
|
|
4
|
+
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
5
|
+
import { type SenderPolicy } from '../utils/ipc-registry.js';
|
|
6
|
+
/** Module-local narrow deps — deliberately NOT `Pick<WorkbenchContext, ...>`
|
|
7
|
+
* (the gate in eslint.config.* is shrink-only; see its message). */
|
|
8
|
+
export interface ProjectCreateIpcDeps {
|
|
9
|
+
views: Pick<ViewManager, 'showProjectCreateDialog' | 'hideProjectCreateDialog'>;
|
|
10
|
+
notify: Pick<RendererNotifier, 'projectCreateSubmitted'>;
|
|
11
|
+
senderPolicy?: SenderPolicy;
|
|
12
|
+
}
|
|
13
|
+
export declare function registerProjectCreateIpc(ctx: ProjectCreateIpcDeps): Disposable;
|
|
14
|
+
export declare const projectCreateModule: WorkbenchModule;
|
|
15
|
+
//# sourceMappingURL=project-create.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ProjectCreateChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
|
+
import { ProjectCreateShowSchema, ProjectCreateSubmitSchema } from '../../shared/ipc-schemas.js';
|
|
3
|
+
import { validate } from '../utils/ipc-schema.js';
|
|
4
|
+
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
5
|
+
export function registerProjectCreateIpc(ctx) {
|
|
6
|
+
return new IpcRegistry(ctx.senderPolicy)
|
|
7
|
+
.on(ProjectCreateChannel.Show, (_event, ...args) => {
|
|
8
|
+
const [data] = validate(ProjectCreateChannel.Show, ProjectCreateShowSchema, args);
|
|
9
|
+
ctx.views.showProjectCreateDialog(data);
|
|
10
|
+
})
|
|
11
|
+
.on(ProjectCreateChannel.Cancel, () => {
|
|
12
|
+
ctx.views.hideProjectCreateDialog();
|
|
13
|
+
})
|
|
14
|
+
.on(ProjectCreateChannel.Submit, (_event, ...args) => {
|
|
15
|
+
const [input] = validate(ProjectCreateChannel.Submit, ProjectCreateSubmitSchema, args);
|
|
16
|
+
ctx.views.hideProjectCreateDialog();
|
|
17
|
+
ctx.notify.projectCreateSubmitted(input);
|
|
18
|
+
});
|
|
19
|
+
// OverlayChannel.Ready is registered once, in tooltip.ts — every overlay
|
|
20
|
+
// renderer (this one included) funnels readiness through that single
|
|
21
|
+
// listener, so a second registration here would double-fire markOverlayReady.
|
|
22
|
+
}
|
|
23
|
+
export const projectCreateModule = {
|
|
24
|
+
setup: (ctx) => registerProjectCreateIpc(ctx),
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=project-create.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { WorkbenchModule } from '../services/module.js';
|
|
3
3
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
4
|
-
type ProjectsIpcCtx = Pick<WorkbenchContext, 'workspace' | 'windows' | 'senderPolicy' | 'projectsProvider' | 'projectTemplates' | 'customCreateProjectDialog'>;
|
|
4
|
+
type ProjectsIpcCtx = Pick<WorkbenchContext, 'workspace' | 'windows' | 'senderPolicy' | 'projectsProvider' | 'projectTemplates' | 'customCreateProjectDialog' | 'notify' | 'views'>;
|
|
5
5
|
export declare function registerProjectsIpc(ctx: ProjectsIpcCtx): Disposable;
|
|
6
6
|
export declare const projectsModule: WorkbenchModule;
|
|
7
7
|
export {};
|
|
@@ -43,6 +43,17 @@ export function registerProjectsIpc(ctx) {
|
|
|
43
43
|
buttons: ['确定'],
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
// Imported project's own detected type wins over whatever category the
|
|
47
|
+
// sidebar happened to be showing — the list would otherwise stay on
|
|
48
|
+
// the old category and hide the project that was just added. Drives
|
|
49
|
+
// both halves: the main-window list filter (existing notify channel,
|
|
50
|
+
// same one the sidebar's own click uses) and the sidebar rail's own
|
|
51
|
+
// highlight (a push down through its narrow bridge — the rail has no
|
|
52
|
+
// other way to learn about a selection that didn't originate from its
|
|
53
|
+
// own click).
|
|
54
|
+
const importedCategory = project.type ?? 'miniprogram';
|
|
55
|
+
ctx.notify.hostSidebarCategorySelected(importedCategory);
|
|
56
|
+
ctx.views.hostSidebar.send('project-category-forced', { category: importedCategory });
|
|
46
57
|
return project;
|
|
47
58
|
})
|
|
48
59
|
.handle(ProjectsChannel.Remove, (_event, ...args) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { app } from 'electron';
|
|
2
2
|
import { loadWorkbenchSettings, saveWorkbenchSettings, applyTheme, } from '../services/settings/index.js';
|
|
3
|
-
import { WorkbenchSettingsChannel
|
|
3
|
+
import { WorkbenchSettingsChannel } from '../../shared/ipc-channels.js';
|
|
4
|
+
import { SettingsChannel } from '../../shared/ipc-channels-overlays.js';
|
|
4
5
|
import { DEFAULT_CDP_PORT } from '../../shared/constants.js';
|
|
5
6
|
import { getMcpStatus } from '../services/mcp/status.js';
|
|
6
7
|
import { SettingsConfigChangedSchema, SettingsProjectSettingsChangedSchema, SettingsSetVisibleSchema, WorkbenchSettingsSaveSchema, WorkbenchSettingsSetThemeSchema, } from '../../shared/ipc-schemas.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { WorkbenchModule } from '../services/module.js';
|
|
2
2
|
/**
|
|
3
|
-
* The 'simulator' built-in module
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* The 'simulator' built-in module. views.ts's `registerViewsIpc` is NOT
|
|
4
|
+
* bundled in here — it's registered unconditionally by app.ts (see that call
|
|
5
|
+
* site's comment for why: host-sidebar/host-toolbar placement has no real
|
|
6
|
+
* dependency on the simulator module).
|
|
6
7
|
*
|
|
7
8
|
* Bridge router (native-host PAGE_OPEN / NAV_ACTION / TAB_ACTION etc.) hooks
|
|
8
9
|
* up unconditionally — the `__diminaNativeHost.enabled` flag in the simulator
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DisposableRegistry } from '@dimina-kit/electron-deck/main';
|
|
2
2
|
import { registerSimulatorIpc } from './simulator.js';
|
|
3
3
|
import { installBridgeRouter } from './bridge-router.js';
|
|
4
|
-
import { registerViewsIpc } from './views.js';
|
|
5
4
|
/**
|
|
6
|
-
* The 'simulator' built-in module
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* The 'simulator' built-in module. views.ts's `registerViewsIpc` is NOT
|
|
6
|
+
* bundled in here — it's registered unconditionally by app.ts (see that call
|
|
7
|
+
* site's comment for why: host-sidebar/host-toolbar placement has no real
|
|
8
|
+
* dependency on the simulator module).
|
|
9
9
|
*
|
|
10
10
|
* Bridge router (native-host PAGE_OPEN / NAV_ACTION / TAB_ACTION etc.) hooks
|
|
11
11
|
* up unconditionally — the `__diminaNativeHost.enabled` flag in the simulator
|
|
@@ -17,7 +17,6 @@ export const simulatorModule = {
|
|
|
17
17
|
setup: (ctx) => {
|
|
18
18
|
const reg = new DisposableRegistry();
|
|
19
19
|
reg.add(registerSimulatorIpc(ctx));
|
|
20
|
-
reg.add(registerViewsIpc(ctx));
|
|
21
20
|
installBridgeRouter(ctx);
|
|
22
21
|
return reg;
|
|
23
22
|
},
|
package/dist/main/ipc/tooltip.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OverlayChannel, TooltipChannel } from '../../shared/ipc-channels.js';
|
|
1
|
+
import { OverlayChannel, TooltipChannel } from '../../shared/ipc-channels-overlays.js';
|
|
2
2
|
import { TooltipMeasuredSchema, TooltipShowSchema } from '../../shared/ipc-schemas.js';
|
|
3
3
|
import { validate } from '../utils/ipc-schema.js';
|
|
4
4
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
package/dist/main/ipc/views.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { WorkbenchContext } from '../services/workbench-context.js';
|
|
2
2
|
import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
3
3
|
/**
|
|
4
|
-
* Renderer-driven overlay bounds
|
|
4
|
+
* Renderer-driven overlay bounds, plus the renderer bootstrap's
|
|
5
|
+
* placement-generation seed pull.
|
|
5
6
|
*
|
|
6
7
|
* The main window's React layout is the source of truth for where the
|
|
7
8
|
* editor view and the simulator's Chromium DevTools overlay live on
|
|
@@ -14,6 +15,19 @@ import type { Disposable } from '@dimina-kit/electron-deck/main';
|
|
|
14
15
|
* panel is collapsed or the tab is not selected. The view manager removes
|
|
15
16
|
* the child view from the contentView but keeps the WebContents alive so
|
|
16
17
|
* subsequent re-shows skip the OpenSumi DI bootstrap.
|
|
18
|
+
*
|
|
19
|
+
* Registered UNCONDITIONALLY by app.ts — NOT gated behind `modules.simulator`
|
|
20
|
+
* (`WorkbenchAppConfig.modules`). None of `ctx.views` (`ViewManager`) is
|
|
21
|
+
* itself conditional on that toggle — it's constructed unconditionally in
|
|
22
|
+
* `createContext` and used unconditionally elsewhere (onResize, the
|
|
23
|
+
* update-dialog panel, workbench detach) — and host-sidebar in particular
|
|
24
|
+
* lives on the project-list page, wholly unrelated to the mini-program
|
|
25
|
+
* simulator webview a disabled `modules.simulator` would actually skip. Every
|
|
26
|
+
* renderer entry point also blocks its first render on
|
|
27
|
+
* `AllocatePlacementGeneration` (see renderer-placement-generation.ts) —
|
|
28
|
+
* gating any of this behind the simulator toggle would strand a host that
|
|
29
|
+
* disables it on the fatal boot-failure page, or leave placement silently
|
|
30
|
+
* non-functional. See disabled-module.test.ts for the end-to-end guard.
|
|
17
31
|
*/
|
|
18
32
|
export declare function registerViewsIpc(ctx: Pick<WorkbenchContext, 'views' | 'senderPolicy'>): Disposable;
|
|
19
33
|
//# sourceMappingURL=views.d.ts.map
|
package/dist/main/ipc/views.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ipcMain } from 'electron';
|
|
2
|
-
import { ViewChannel } from '../../shared/ipc-channels.js';
|
|
3
|
-
import { PlacementSnapshotSchema, HostToolbarAdvertiseHeightSchema, } from '../../shared/ipc-schemas.js';
|
|
2
|
+
import { ViewChannel } from '../../shared/ipc-channels-overlays.js';
|
|
3
|
+
import { PlacementSnapshotSchema, HostToolbarAdvertiseHeightSchema, HostSidebarAdvertiseWidthSchema, HostDialogAdvertiseSizeSchema, } from '../../shared/ipc-schemas.js';
|
|
4
4
|
import { validate } from '../utils/ipc-schema.js';
|
|
5
5
|
import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
6
6
|
/**
|
|
7
|
-
* Renderer-driven overlay bounds
|
|
7
|
+
* Renderer-driven overlay bounds, plus the renderer bootstrap's
|
|
8
|
+
* placement-generation seed pull.
|
|
8
9
|
*
|
|
9
10
|
* The main window's React layout is the source of truth for where the
|
|
10
11
|
* editor view and the simulator's Chromium DevTools overlay live on
|
|
@@ -17,9 +18,25 @@ import { IpcRegistry } from '../utils/ipc-registry.js';
|
|
|
17
18
|
* panel is collapsed or the tab is not selected. The view manager removes
|
|
18
19
|
* the child view from the contentView but keeps the WebContents alive so
|
|
19
20
|
* subsequent re-shows skip the OpenSumi DI bootstrap.
|
|
21
|
+
*
|
|
22
|
+
* Registered UNCONDITIONALLY by app.ts — NOT gated behind `modules.simulator`
|
|
23
|
+
* (`WorkbenchAppConfig.modules`). None of `ctx.views` (`ViewManager`) is
|
|
24
|
+
* itself conditional on that toggle — it's constructed unconditionally in
|
|
25
|
+
* `createContext` and used unconditionally elsewhere (onResize, the
|
|
26
|
+
* update-dialog panel, workbench detach) — and host-sidebar in particular
|
|
27
|
+
* lives on the project-list page, wholly unrelated to the mini-program
|
|
28
|
+
* simulator webview a disabled `modules.simulator` would actually skip. Every
|
|
29
|
+
* renderer entry point also blocks its first render on
|
|
30
|
+
* `AllocatePlacementGeneration` (see renderer-placement-generation.ts) —
|
|
31
|
+
* gating any of this behind the simulator toggle would strand a host that
|
|
32
|
+
* disables it on the fatal boot-failure page, or leave placement silently
|
|
33
|
+
* non-functional. See disabled-module.test.ts for the end-to-end guard.
|
|
20
34
|
*/
|
|
21
35
|
export function registerViewsIpc(ctx) {
|
|
22
36
|
const registry = new IpcRegistry(ctx.senderPolicy)
|
|
37
|
+
// Renderer bootstrap: allocate this session's placement-generation seed
|
|
38
|
+
// (see renderer-placement-generation.ts / PlacementReconciler.allocateGeneration).
|
|
39
|
+
.handle(ViewChannel.AllocatePlacementGeneration, () => ctx.views.allocatePlacementGeneration())
|
|
23
40
|
// Window-level placement snapshot: the single source of truth for every
|
|
24
41
|
// managed native view's bounds/visibility/z-order. The renderer's central
|
|
25
42
|
// publisher coalesces one snapshot per frame; the reconciler diffs it
|
|
@@ -36,7 +53,10 @@ export function registerViewsIpc(ctx) {
|
|
|
36
53
|
// senderPolicy-gated registry as HostToolbarBounds: the toolbar WCV's
|
|
37
54
|
// arbitrary host content must not reach this — only the trusted main
|
|
38
55
|
// renderer pulls. Live delegation, not a registration-time snapshot.
|
|
39
|
-
.handle(ViewChannel.HostToolbarGetHeight, () => ctx.views.getHostToolbarHeight())
|
|
56
|
+
.handle(ViewChannel.HostToolbarGetHeight, () => ctx.views.getHostToolbarHeight())
|
|
57
|
+
// Same mount-time replay role as HostToolbarGetHeight, on the sidebar's
|
|
58
|
+
// inline (width) axis.
|
|
59
|
+
.handle(ViewChannel.HostSidebarGetWidth, () => ctx.views.getHostSidebarWidth());
|
|
40
60
|
// Reverse size-advertiser: the toolbar WCV's OWN renderer sends this, and the
|
|
41
61
|
// host loads ARBITRARY content into that WCV. We DELIBERATELY do NOT add the
|
|
42
62
|
// toolbar wc to the global sender policy — that would trust it for ALL ~72
|
|
@@ -61,10 +81,47 @@ export function registerViewsIpc(ctx) {
|
|
|
61
81
|
ctx.views.setHostToolbarHeight(extent);
|
|
62
82
|
};
|
|
63
83
|
ipcMain.on(ViewChannel.HostToolbarAdvertiseHeight, onAdvertiseHeight);
|
|
84
|
+
// Same precise-sender-id trust model as onAdvertiseHeight, on the
|
|
85
|
+
// sidebar's inline (width) axis.
|
|
86
|
+
const onAdvertiseWidth = (event, ...args) => {
|
|
87
|
+
if (event.sender.id !== ctx.views.getHostSidebarWebContentsId())
|
|
88
|
+
return;
|
|
89
|
+
let extent;
|
|
90
|
+
try {
|
|
91
|
+
;
|
|
92
|
+
[{ extent }] = validate(ViewChannel.HostSidebarAdvertiseWidth, HostSidebarAdvertiseWidthSchema, args);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return; // malformed payload from the host's own content — drop it
|
|
96
|
+
}
|
|
97
|
+
ctx.views.setHostSidebarWidth(extent);
|
|
98
|
+
};
|
|
99
|
+
ipcMain.on(ViewChannel.HostSidebarAdvertiseWidth, onAdvertiseWidth);
|
|
100
|
+
// Same precise-sender-id trust model as onAdvertiseHeight/onAdvertiseWidth,
|
|
101
|
+
// but the dialog is a single by-demand overlay rather than a persistent
|
|
102
|
+
// slot: either axis may arrive, and the view manager re-centers using
|
|
103
|
+
// whichever axes it has measured so far.
|
|
104
|
+
const onAdvertiseDialogSize = (event, ...args) => {
|
|
105
|
+
if (event.sender.id !== ctx.views.getHostDialogWebContentsId())
|
|
106
|
+
return;
|
|
107
|
+
let axis;
|
|
108
|
+
let extent;
|
|
109
|
+
try {
|
|
110
|
+
;
|
|
111
|
+
[{ axis, extent }] = validate(ViewChannel.HostDialogAdvertiseSize, HostDialogAdvertiseSizeSchema, args);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return; // malformed payload from the host's own content — drop it
|
|
115
|
+
}
|
|
116
|
+
ctx.views.reportHostDialogMeasuredExtent(axis, extent);
|
|
117
|
+
};
|
|
118
|
+
ipcMain.on(ViewChannel.HostDialogAdvertiseSize, onAdvertiseDialogSize);
|
|
64
119
|
return {
|
|
65
120
|
dispose() {
|
|
66
121
|
void registry.dispose();
|
|
67
122
|
ipcMain.removeListener(ViewChannel.HostToolbarAdvertiseHeight, onAdvertiseHeight);
|
|
123
|
+
ipcMain.removeListener(ViewChannel.HostSidebarAdvertiseWidth, onAdvertiseWidth);
|
|
124
|
+
ipcMain.removeListener(ViewChannel.HostDialogAdvertiseSize, onAdvertiseDialogSize);
|
|
68
125
|
},
|
|
69
126
|
};
|
|
70
127
|
}
|
|
@@ -73,6 +73,25 @@ export interface DiminaHostToolbarPageBridge {
|
|
|
73
73
|
send: (channel: string, payload: unknown) => void;
|
|
74
74
|
onMessage: (channel: string, handler: (payload: unknown) => void) => () => void;
|
|
75
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* The page-side bridge injected into the host-sidebar WCV as
|
|
78
|
+
* `window.diminaHostSidebar` (see src/preload/runtime/host-sidebar-port.ts).
|
|
79
|
+
* Shape identical to `DiminaHostToolbarPageBridge` — the port-channel
|
|
80
|
+
* envelope and queueing/guard behaviour don't vary by slot.
|
|
81
|
+
*/
|
|
82
|
+
export interface DiminaHostSidebarPageBridge {
|
|
83
|
+
send: (channel: string, payload: unknown) => void;
|
|
84
|
+
onMessage: (channel: string, handler: (payload: unknown) => void) => () => void;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The page-side bridge injected into the host-dialog WCV as
|
|
88
|
+
* `window.diminaHostDialog` (see src/preload/runtime/host-dialog-port.ts).
|
|
89
|
+
* Shape identical to `DiminaHostToolbarPageBridge`.
|
|
90
|
+
*/
|
|
91
|
+
export interface DiminaHostDialogPageBridge {
|
|
92
|
+
send: (channel: string, payload: unknown) => void;
|
|
93
|
+
onMessage: (channel: string, handler: (payload: unknown) => void) => () => void;
|
|
94
|
+
}
|
|
76
95
|
declare global {
|
|
77
96
|
interface Window {
|
|
78
97
|
/**
|
|
@@ -81,51 +100,68 @@ declare global {
|
|
|
81
100
|
* else, so page code must runtime-guard before use.
|
|
82
101
|
*/
|
|
83
102
|
diminaHostToolbar?: DiminaHostToolbarPageBridge;
|
|
103
|
+
/**
|
|
104
|
+
* Present ONLY inside the host-sidebar WebContentsView's main frame
|
|
105
|
+
* (guarded injection — see host-sidebar-runtime.ts); optional everywhere
|
|
106
|
+
* else, so page code must runtime-guard before use.
|
|
107
|
+
*/
|
|
108
|
+
diminaHostSidebar?: DiminaHostSidebarPageBridge;
|
|
109
|
+
/**
|
|
110
|
+
* Present ONLY inside the host-dialog WebContentsView's main frame
|
|
111
|
+
* (guarded injection — see host-dialog-runtime.ts); optional everywhere
|
|
112
|
+
* else, so page code must runtime-guard before use.
|
|
113
|
+
*/
|
|
114
|
+
diminaHostDialog?: DiminaHostDialogPageBridge;
|
|
84
115
|
}
|
|
85
116
|
}
|
|
86
117
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* hatch (that would put
|
|
118
|
+
* Shared message-channel surface for every downstream-controllable host slot
|
|
119
|
+
* (toolbar/sidebar/dialog) — `send`/`onMessage`/`onReady` plus preload and
|
|
120
|
+
* content loading, with no `webContents` escape hatch (that would put
|
|
121
|
+
* Electron types on the contract). Each slot extends this with its own
|
|
122
|
+
* extent/visibility members.
|
|
90
123
|
*/
|
|
91
|
-
export interface
|
|
124
|
+
export interface MiniappHostSlotChannel {
|
|
92
125
|
/**
|
|
93
|
-
* The host's own `webPreferences.preload` for
|
|
94
|
-
* additive — never replaces the framework's session-resident
|
|
126
|
+
* The host's own `webPreferences.preload` for this slot's view (purely
|
|
127
|
+
* additive — never replaces the framework's session-resident size
|
|
95
128
|
* advertiser). Must be set before the view is (re)created; `null` (default)
|
|
96
129
|
* means "no host preload".
|
|
97
130
|
*/
|
|
98
131
|
setPreloadPath: (path: string | null) => void;
|
|
99
|
-
/** Load a local file into the
|
|
132
|
+
/** Load a local file into the slot's view (lazy-creates the view). */
|
|
100
133
|
loadFile: (path: string) => Promise<void>;
|
|
101
|
-
/** Load a URL into the
|
|
134
|
+
/** Load a URL into the slot's view (lazy-creates the view). */
|
|
102
135
|
loadURL: (url: string) => Promise<void>;
|
|
103
136
|
/**
|
|
104
|
-
* Post `{ channel, payload }` to the
|
|
137
|
+
* Post `{ channel, payload }` to the slot's page. Gated and non-queueing:
|
|
105
138
|
* returns false (delivering nothing, creating no view) while there is no
|
|
106
|
-
* live
|
|
107
|
-
*
|
|
139
|
+
* live webContents or the current load's MessagePort handshake hasn't
|
|
140
|
+
* completed; true once the envelope went out.
|
|
108
141
|
*/
|
|
109
142
|
send: (channel: string, payload: unknown) => boolean;
|
|
110
143
|
/**
|
|
111
|
-
* Register a host-side handler for messages the
|
|
112
|
-
* `window.
|
|
113
|
-
*
|
|
144
|
+
* Register a host-side handler for messages the slot's page sends via
|
|
145
|
+
* `window.dimina*.send(channel, payload)`. May be called before the view
|
|
146
|
+
* exists; survives page reloads. `dispose()` detaches (idempotent).
|
|
114
147
|
*/
|
|
115
148
|
onMessage: (channel: string, handler: (payload: unknown) => void) => {
|
|
116
149
|
dispose: () => void;
|
|
117
150
|
};
|
|
118
151
|
/**
|
|
119
152
|
* Observe handshake readiness. Fires the handler once per load generation,
|
|
120
|
-
* exactly when the
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
153
|
+
* exactly when the slot page's MessagePort handshake completes (i.e. when
|
|
154
|
+
* `send` flips to true). Registering while the channel is already ready
|
|
155
|
+
* fires once asynchronously on a microtask (missed-signal guard); a
|
|
156
|
+
* reload / re-handshake fires registered handlers again. `dispose()`
|
|
124
157
|
* detaches (idempotent).
|
|
125
158
|
*/
|
|
126
159
|
onReady: (handler: () => void) => {
|
|
127
160
|
dispose: () => void;
|
|
128
161
|
};
|
|
162
|
+
}
|
|
163
|
+
/** Host-facing control surface for the toolbar WebContentsView. */
|
|
164
|
+
export interface MiniappHostToolbar extends MiniappHostSlotChannel {
|
|
129
165
|
/**
|
|
130
166
|
* Pin (`{ fixed }`) or unpin (`'auto'`) the toolbar strip height. `'auto'`
|
|
131
167
|
* (default) lets the in-page height advertiser drive the placeholder.
|
|
@@ -136,6 +172,36 @@ export interface MiniappHostToolbar {
|
|
|
136
172
|
fixed: number;
|
|
137
173
|
}) => void;
|
|
138
174
|
}
|
|
175
|
+
/** Host-facing control surface for the sidebar WebContentsView. */
|
|
176
|
+
export interface MiniappHostSidebar extends MiniappHostSlotChannel {
|
|
177
|
+
/**
|
|
178
|
+
* Pin (`{ fixed }`) or unpin (`'auto'`) the sidebar strip width. `'auto'`
|
|
179
|
+
* (default) lets the in-page width advertiser drive the placeholder.
|
|
180
|
+
* `{ fixed }` values must be finite and non-negative — anything else throws
|
|
181
|
+
* a `TypeError` synchronously and leaves the standing mode untouched.
|
|
182
|
+
*/
|
|
183
|
+
setWidthMode: (mode: 'auto' | {
|
|
184
|
+
fixed: number;
|
|
185
|
+
}) => void;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Host-facing control surface for the by-demand, dual-axis-autosized dialog
|
|
189
|
+
* WebContentsView. Unlike the persistent toolbar/sidebar strips, the dialog
|
|
190
|
+
* is shown/hidden explicitly — there is no extent-mode setter (both axes
|
|
191
|
+
* always self-size from the page's own measured content).
|
|
192
|
+
*/
|
|
193
|
+
export interface MiniappHostDialog extends MiniappHostSlotChannel {
|
|
194
|
+
/**
|
|
195
|
+
* Show the dialog, centered in the main window using its self-advertised
|
|
196
|
+
* size on both axes. Creates the view's placement if needed; does not
|
|
197
|
+
* (re)load content — the host must `loadURL`/`loadFile` first.
|
|
198
|
+
*/
|
|
199
|
+
show: () => void;
|
|
200
|
+
/** Hide the dialog (kept alive, content preserved) without destroying the view. */
|
|
201
|
+
hide: () => void;
|
|
202
|
+
/** Whether the dialog is currently shown. */
|
|
203
|
+
isVisible: () => boolean;
|
|
204
|
+
}
|
|
139
205
|
/**
|
|
140
206
|
* The audited workspace surface: project list membership, session lifecycle,
|
|
141
207
|
* and minimal session state. Thumbnails / per-project settings / providers
|
|
@@ -177,9 +243,11 @@ export interface MiniappWorkspace {
|
|
|
177
243
|
* plumbing is a deliberate semver decision, not an accident of projection.
|
|
178
244
|
*/
|
|
179
245
|
export interface MiniappRuntime {
|
|
180
|
-
/** View layer — only the host-owned
|
|
246
|
+
/** View layer — only the host-owned slot controls are public. */
|
|
181
247
|
views: {
|
|
182
248
|
readonly hostToolbar: MiniappHostToolbar;
|
|
249
|
+
readonly hostSidebar: MiniappHostSidebar;
|
|
250
|
+
readonly hostDialog: MiniappHostDialog;
|
|
183
251
|
};
|
|
184
252
|
/** Project + session workspace (see {@link MiniappWorkspace}). */
|
|
185
253
|
workspace: MiniappWorkspace;
|
|
@@ -2,7 +2,8 @@ import type { BrowserWindow, WebContents, WebContentsView } from 'electron';
|
|
|
2
2
|
import type { CompileConfig } from '../../../shared/types.js';
|
|
3
3
|
import { type EditorOpenFilePayload } from '../../../shared/ipc-channels.js';
|
|
4
4
|
import type { WorkbenchSettings } from '../settings/index.js';
|
|
5
|
-
import type { ProjectSettings } from '../projects/project-repository.js';
|
|
5
|
+
import type { ProjectSettings, ProjectType } from '../projects/project-repository.js';
|
|
6
|
+
import type { UpdateInfo } from '../../../shared/types.js';
|
|
6
7
|
/**
|
|
7
8
|
* Payload for the `project:status` event sent whenever compile status changes.
|
|
8
9
|
*/
|
|
@@ -114,17 +115,45 @@ export interface RendererNotifier {
|
|
|
114
115
|
* placeholder div resizes (closes the host-toolbar dynamic-height loop).
|
|
115
116
|
*/
|
|
116
117
|
hostToolbarHeightChanged(height: number): void;
|
|
118
|
+
/**
|
|
119
|
+
* Push the reserved host-sidebar width to the main renderer so its sidebar
|
|
120
|
+
* placeholder div resizes, mirroring `hostToolbarHeightChanged` on the
|
|
121
|
+
* inline axis.
|
|
122
|
+
*/
|
|
123
|
+
hostSidebarWidthChanged(width: number): void;
|
|
124
|
+
/**
|
|
125
|
+
* Push the project category selected in the host-sidebar's content to the
|
|
126
|
+
* main renderer so `ProjectListScreen` filters `ProjectList` accordingly.
|
|
127
|
+
*/
|
|
128
|
+
hostSidebarCategorySelected(category: ProjectType): void;
|
|
117
129
|
/**
|
|
118
130
|
* Ask the main renderer's Monaco editor to open a project file at a position.
|
|
119
131
|
* Drives the "click a console file link → open in editor" pipeline.
|
|
120
132
|
*/
|
|
121
133
|
editorOpenFile(payload: EditorOpenFilePayload): void;
|
|
134
|
+
/**
|
|
135
|
+
* Relay a project-create-dialog submission from the overlay panel back to
|
|
136
|
+
* the main renderer, which owns the scaffold flow (createProject + list
|
|
137
|
+
* refresh) — the panel only collects the form and hands it off.
|
|
138
|
+
*/
|
|
139
|
+
projectCreateSubmitted(payload: {
|
|
140
|
+
name: string;
|
|
141
|
+
path: string;
|
|
142
|
+
templateId: string;
|
|
143
|
+
}): void;
|
|
122
144
|
/** Initialise the currently shown compile popover overlay. */
|
|
123
145
|
popoverInit(popoverView: WebContentsView, payload: unknown): void;
|
|
124
146
|
/** Initialise the currently shown settings overlay (no-op if hidden). */
|
|
125
147
|
settingsInit(payload: SettingsInitPayload): void;
|
|
126
148
|
/** Push the label text (+ anchor) into the tooltip overlay's own renderer. */
|
|
127
149
|
tooltipInit(tooltipView: WebContentsView, payload: unknown): void;
|
|
150
|
+
/** Push the template catalog + base-dir defaults into the project-create overlay. */
|
|
151
|
+
projectCreateInit(dialogView: WebContentsView, payload: {
|
|
152
|
+
templates: unknown[];
|
|
153
|
+
defaultBaseDir: string;
|
|
154
|
+
}): void;
|
|
155
|
+
/** Push a discovered update's info into the update overlay. */
|
|
156
|
+
updateAvailable(dialogView: WebContentsView, payload: UpdateInfo): void;
|
|
128
157
|
/** Initialise the standalone workbench-settings window. */
|
|
129
158
|
workbenchSettingsInit(window: BrowserWindow, payload: WorkbenchSettingsInitPayload): void;
|
|
130
159
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ProjectChannel, SessionChannel, WindowChannel,
|
|
1
|
+
import { ProjectChannel, SessionChannel, WindowChannel, WorkbenchSettingsChannel, EditorChannel, } from '../../../shared/ipc-channels.js';
|
|
2
|
+
import { SettingsChannel, PopoverChannel, TooltipChannel, ProjectCreateChannel, UpdateChannel, ViewChannel, } from '../../../shared/ipc-channels-overlays.js';
|
|
2
3
|
/** Safely resolve a WebContents, skipping destroyed / missing targets. */
|
|
3
4
|
function liveWebContents(wc) {
|
|
4
5
|
if (!wc)
|
|
@@ -45,9 +46,18 @@ export function createRendererNotifier(ctx) {
|
|
|
45
46
|
hostToolbarHeightChanged(height) {
|
|
46
47
|
sendToMain(ViewChannel.HostToolbarHeightChanged, height);
|
|
47
48
|
},
|
|
49
|
+
hostSidebarWidthChanged(width) {
|
|
50
|
+
sendToMain(ViewChannel.HostSidebarWidthChanged, width);
|
|
51
|
+
},
|
|
52
|
+
hostSidebarCategorySelected(category) {
|
|
53
|
+
sendToMain(ViewChannel.HostSidebarCategorySelected, category);
|
|
54
|
+
},
|
|
48
55
|
editorOpenFile(payload) {
|
|
49
56
|
sendToMain(EditorChannel.OpenFile, payload);
|
|
50
57
|
},
|
|
58
|
+
projectCreateSubmitted(payload) {
|
|
59
|
+
sendToMain(ProjectCreateChannel.Submitted, payload);
|
|
60
|
+
},
|
|
51
61
|
popoverInit(popoverView, payload) {
|
|
52
62
|
const wc = liveWebContents(popoverView.webContents);
|
|
53
63
|
if (!wc)
|
|
@@ -60,6 +70,18 @@ export function createRendererNotifier(ctx) {
|
|
|
60
70
|
return;
|
|
61
71
|
wc.send(TooltipChannel.Init, payload);
|
|
62
72
|
},
|
|
73
|
+
projectCreateInit(dialogView, payload) {
|
|
74
|
+
const wc = liveWebContents(dialogView.webContents);
|
|
75
|
+
if (!wc)
|
|
76
|
+
return;
|
|
77
|
+
wc.send(ProjectCreateChannel.Init, payload);
|
|
78
|
+
},
|
|
79
|
+
updateAvailable(dialogView, payload) {
|
|
80
|
+
const wc = liveWebContents(dialogView.webContents);
|
|
81
|
+
if (!wc)
|
|
82
|
+
return;
|
|
83
|
+
wc.send(UpdateChannel.Available, payload);
|
|
84
|
+
},
|
|
63
85
|
settingsInit(payload) {
|
|
64
86
|
const wc = liveWebContents(ctx.views.getSettingsWebContents());
|
|
65
87
|
if (!wc)
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { CompileConfig } from '../../../shared/types.js';
|
|
1
|
+
import type { CompileConfig, ProjectType } from '../../../shared/types.js';
|
|
2
|
+
export type { ProjectType };
|
|
2
3
|
export interface Project {
|
|
3
4
|
name: string;
|
|
4
5
|
path: string;
|
|
5
6
|
lastOpened?: string | null;
|
|
6
7
|
compileConfig?: CompileConfig;
|
|
8
|
+
/** Absent on projects added before mini-game support — treat as 'miniprogram'. */
|
|
9
|
+
type?: ProjectType;
|
|
7
10
|
}
|
|
8
11
|
export interface ProjectPages {
|
|
9
12
|
pages: string[];
|