@dimina-kit/devtools 0.4.0-dev.20260706125036 → 0.4.0-dev.20260706131625

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.
Files changed (40) hide show
  1. package/dist/main/app/app.d.ts +1 -4
  2. package/dist/main/app/app.js +0 -20
  3. package/dist/main/index.bundle.js +5 -136
  4. package/dist/main/ipc/popover.js +1 -10
  5. package/dist/main/ipc/session.js +1 -17
  6. package/dist/main/services/notifications/renderer-notifier.d.ts +1 -5
  7. package/dist/main/services/notifications/renderer-notifier.js +0 -6
  8. package/dist/main/services/projects/local-provider.js +0 -4
  9. package/dist/main/services/projects/project-repository.d.ts +1 -7
  10. package/dist/main/services/projects/project-repository.js +0 -24
  11. package/dist/main/services/projects/types.d.ts +1 -25
  12. package/dist/main/services/render-inspect/index.js +4 -4
  13. package/dist/main/services/workspace/workspace-service.d.ts +1 -5
  14. package/dist/main/services/workspace/workspace-service.js +0 -8
  15. package/dist/native-host/render/render.js +52 -42
  16. package/dist/native-host/service/service.js +2 -2
  17. package/dist/preload/windows/host-toolbar-runtime.cjs.map +2 -2
  18. package/dist/preload/windows/simulator.cjs.map +1 -1
  19. package/dist/renderer/assets/index-BwzPwCmM.js +49 -0
  20. package/dist/renderer/assets/{input-CDAEwpBO.js → input-CTb_le7F.js} +2 -2
  21. package/dist/renderer/assets/ipc-transport-BPWIV5hA.css +1 -0
  22. package/dist/renderer/assets/{ipc-transport-_G1k5V1p.js → ipc-transport-Ck5Xa8Tu.js} +2 -2
  23. package/dist/renderer/assets/popover-B1Zu2UQu.js +2 -0
  24. package/dist/renderer/assets/{select-DpKPCh3y.js → select-ozSk5Pt6.js} +2 -2
  25. package/dist/renderer/assets/{settings-M5q2elUr.js → settings-CNwGOI22.js} +2 -2
  26. package/dist/renderer/assets/{settings-api-CDlZoHiO.js → settings-api-DMbMp1Eq.js} +2 -2
  27. package/dist/renderer/assets/{workbenchSettings-CT_H1WhV.js → workbenchSettings-Cr4EHo5w.js} +2 -2
  28. package/dist/renderer/entries/main/index.html +6 -6
  29. package/dist/renderer/entries/popover/index.html +5 -5
  30. package/dist/renderer/entries/settings/index.html +5 -5
  31. package/dist/renderer/entries/workbench-settings/index.html +4 -4
  32. package/dist/shared/ipc-channels.d.ts +0 -6
  33. package/dist/shared/ipc-channels.js +0 -6
  34. package/dist/shared/ipc-schemas.d.ts +0 -29
  35. package/dist/shared/ipc-schemas.js +0 -34
  36. package/dist/shared/types.d.ts +0 -28
  37. package/package.json +6 -6
  38. package/dist/renderer/assets/index-BMqyDx71.js +0 -49
  39. package/dist/renderer/assets/ipc-transport-B7eFOR68.css +0 -1
  40. package/dist/renderer/assets/popover-DEdjK14m.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { BrowserWindow } from 'electron';
2
- import type { LaunchConfig, WorkbenchAppConfig } from '../../shared/types.js';
2
+ import type { WorkbenchAppConfig } from '../../shared/types.js';
3
3
  import type { SimulatorApiHandler } from '../services/simulator/custom-apis.js';
4
4
  import { type WorkbenchContext } from '../services/workbench-context.js';
5
5
  import { type AutomationServer } from '../services/automation/index.js';
@@ -18,9 +18,6 @@ export interface WorkbenchAppInstance {
18
18
  automationServer?: AutomationServer;
19
19
  updateManager?: UpdateManager;
20
20
  dispose: () => Promise<void>;
21
- getLaunchConfigs: () => Promise<LaunchConfig[]>;
22
- setLaunchConfigs: (configs: LaunchConfig[]) => Promise<void>;
23
- setActiveLaunchConfig: (id: string | null) => Promise<void>;
24
21
  }
25
22
  /**
26
23
  * Pre-ready bootstrap side effects (app name, CDP port, CSP suppression,
@@ -400,26 +400,6 @@ export async function createDevtoolsRuntime(config = {}) {
400
400
  registerTrustedWindow: (win) => context.registry.add(registerTrustedWindow(context, win)),
401
401
  registerSimulatorApi: (name, handler) => context.registry.add(toDisposable(context.simulatorApis.register(name, handler))),
402
402
  dispose: () => disposeContext(context),
403
- async getLaunchConfigs() {
404
- const projectPath = context.workspace.getProjectPath();
405
- if (!projectPath)
406
- return [];
407
- return context.workspace.getLaunchConfigs(projectPath);
408
- },
409
- async setLaunchConfigs(configs) {
410
- const projectPath = context.workspace.getProjectPath();
411
- if (!projectPath)
412
- return;
413
- await context.workspace.saveLaunchConfigs(projectPath, configs);
414
- context.notify.popoverUpdateLaunchConfigs(configs);
415
- },
416
- async setActiveLaunchConfig(id) {
417
- const projectPath = context.workspace.getProjectPath();
418
- if (!projectPath)
419
- return;
420
- await context.workspace.saveActiveLaunchConfigId(projectPath, id);
421
- context.notify.popoverSwitchLaunchConfig(id);
422
- },
423
403
  };
424
404
  // Built-in simulator APIs: devtools-supplied wx.* implementations that run
425
405
  // in the main process. Hosts can override any of these in their onSetup by
@@ -391,11 +391,7 @@ var ProjectChannel = {
391
391
  // contract (compileEvents), this one carries the line stream (compileLogs).
392
392
  CompileLog: "project:compileLog",
393
393
  CaptureThumbnail: "project:captureThumbnail",
394
- GetThumbnail: "project:getThumbnail",
395
- GetLaunchConfigs: "project:getLaunchConfigs",
396
- SaveLaunchConfigs: "project:saveLaunchConfigs",
397
- GetActiveLaunchConfigId: "project:getActiveLaunchConfigId",
398
- SaveActiveLaunchConfigId: "project:saveActiveLaunchConfigId"
394
+ GetThumbnail: "project:getThumbnail"
399
395
  };
400
396
  var SessionChannel = {
401
397
  RuntimeStatus: "session:runtimeStatus"
@@ -480,9 +476,7 @@ var PopoverChannel = {
480
476
  Hide: "popover:hide",
481
477
  Relaunch: "popover:relaunch",
482
478
  Closed: "popover:closed",
483
- Init: "popover:init",
484
- SwitchLaunchConfig: "popover:switchLaunchConfig",
485
- UpdateLaunchConfigs: "popover:updateLaunchConfigs"
479
+ Init: "popover:init"
486
480
  };
487
481
  var WindowChannel = {
488
482
  NavigateBack: "window:navigateBack"
@@ -1129,12 +1123,6 @@ function createRendererNotifier(ctx) {
1129
1123
  popoverRelaunch(config) {
1130
1124
  sendToMain(PopoverChannel.Relaunch, config);
1131
1125
  },
1132
- popoverSwitchLaunchConfig(id) {
1133
- sendToMain(PopoverChannel.SwitchLaunchConfig, id);
1134
- },
1135
- popoverUpdateLaunchConfigs(configs) {
1136
- sendToMain(PopoverChannel.UpdateLaunchConfigs, configs);
1137
- },
1138
1126
  hostToolbarHeightChanged(height) {
1139
1127
  sendToMain(ViewChannel.HostToolbarHeightChanged, height);
1140
1128
  },
@@ -3976,30 +3964,6 @@ function getProjectSettings(projectPath) {
3976
3964
  return { uploadWithSourceMap: false };
3977
3965
  }
3978
3966
  }
3979
- function getLaunchConfigs(dirPath) {
3980
- const project = load().find((p) => p.path === dirPath);
3981
- return project?.launchConfigs ?? [];
3982
- }
3983
- function saveLaunchConfigs(dirPath, configs) {
3984
- const projects = load();
3985
- const idx = projects.findIndex((p) => p.path === dirPath);
3986
- if (idx >= 0) {
3987
- projects[idx] = { ...projects[idx], launchConfigs: configs };
3988
- save(projects);
3989
- }
3990
- }
3991
- function getActiveLaunchConfigId(dirPath) {
3992
- const project = load().find((p) => p.path === dirPath);
3993
- return project?.activeLaunchConfigId ?? null;
3994
- }
3995
- function saveActiveLaunchConfigId(dirPath, id) {
3996
- const projects = load();
3997
- const idx = projects.findIndex((p) => p.path === dirPath);
3998
- if (idx >= 0) {
3999
- projects[idx] = { ...projects[idx], activeLaunchConfigId: id };
4000
- save(projects);
4001
- }
4002
- }
4003
3967
  function updateProjectSettings(projectPath, patch) {
4004
3968
  if (!projectPath) return;
4005
3969
  const configPath = path10.join(projectPath, "project.config.json");
@@ -4305,15 +4269,7 @@ function createWorkspaceService(ctx) {
4305
4269
  // Per-project settings (uploadWithSourceMap etc.) live in the project's
4306
4270
  // own `project.config.json`, not the registry — keep direct repo calls.
4307
4271
  getProjectSettings: (projectPath) => getProjectSettings(projectPath),
4308
- updateProjectSettings: (projectPath, patch) => updateProjectSettings(projectPath, patch),
4309
- getLaunchConfigs: async (p) => provider.getLaunchConfigs ? await provider.getLaunchConfigs(p) : [],
4310
- saveLaunchConfigs: async (p, c) => {
4311
- if (provider.saveLaunchConfigs) await provider.saveLaunchConfigs(p, c);
4312
- },
4313
- getActiveLaunchConfigId: async (p) => provider.getActiveLaunchConfigId ? await provider.getActiveLaunchConfigId(p) : null,
4314
- saveActiveLaunchConfigId: async (p, id) => {
4315
- if (provider.saveActiveLaunchConfigId) await provider.saveActiveLaunchConfigId(p, id);
4316
- }
4272
+ updateProjectSettings: (projectPath, patch) => updateProjectSettings(projectPath, patch)
4317
4273
  };
4318
4274
  }
4319
4275
 
@@ -4359,11 +4315,7 @@ function createLocalProjectsProvider() {
4359
4315
  getCompileConfig: (dirPath) => getCompileConfig(dirPath),
4360
4316
  saveCompileConfig: (dirPath, cfg) => saveCompileConfig(dirPath, cfg),
4361
4317
  saveThumbnail: (dirPath, dataUrl) => saveThumbnailFromDataUrl(dirPath, dataUrl),
4362
- getThumbnail: (dirPath) => loadThumbnail(dirPath),
4363
- getLaunchConfigs: (dirPath) => getLaunchConfigs(dirPath),
4364
- saveLaunchConfigs: (dirPath, configs) => saveLaunchConfigs(dirPath, configs),
4365
- getActiveLaunchConfigId: (dirPath) => getActiveLaunchConfigId(dirPath),
4366
- saveActiveLaunchConfigId: (dirPath, id) => saveActiveLaunchConfigId(dirPath, id)
4318
+ getThumbnail: (dirPath) => loadThumbnail(dirPath)
4367
4319
  };
4368
4320
  }
4369
4321
 
@@ -4698,29 +4650,6 @@ var SettingsProjectSettingsChangedSchema = z3.tuple([
4698
4650
  ]);
4699
4651
  var ProjectCaptureThumbnailSchema = z3.tuple([AbsolutePath]);
4700
4652
  var ProjectGetThumbnailSchema = z3.tuple([AbsolutePath]);
4701
- var ProjectGetLaunchConfigsSchema = z3.tuple([AbsolutePath]);
4702
- var LaunchConfigShape = z3.looseObject({
4703
- id: z3.string().min(1),
4704
- name: z3.string(),
4705
- startPage: z3.string().optional(),
4706
- scene: z3.number().optional(),
4707
- queryParams: z3.array(z3.looseObject({ key: z3.string(), value: z3.string() })).optional()
4708
- });
4709
- var ProjectSaveLaunchConfigsSchema = z3.tuple([
4710
- AbsolutePath,
4711
- z3.array(LaunchConfigShape)
4712
- ]);
4713
- var ProjectGetActiveLaunchConfigIdSchema = z3.tuple([AbsolutePath]);
4714
- var ProjectSaveActiveLaunchConfigIdSchema = z3.tuple([
4715
- AbsolutePath,
4716
- z3.union([z3.string(), z3.null()])
4717
- ]);
4718
- var PopoverSwitchLaunchConfigSchema = z3.tuple([
4719
- z3.union([z3.string(), z3.null()])
4720
- ]);
4721
- var PopoverUpdateLaunchConfigsSchema = z3.tuple([
4722
- z3.array(LaunchConfigShape)
4723
- ]);
4724
4653
 
4725
4654
  // src/main/ipc/simulator.ts
4726
4655
  function registerSimulatorIpc(ctx) {
@@ -4757,21 +4686,6 @@ function registerPopoverIpc(ctx) {
4757
4686
  const [newConfig] = validate(PopoverChannel.Relaunch, PopoverRelaunchSchema, args);
4758
4687
  ctx.views.hidePopover();
4759
4688
  ctx.notify.popoverRelaunch(newConfig);
4760
- }).on(PopoverChannel.SwitchLaunchConfig, (_event, ...args) => {
4761
- const [id] = validate(
4762
- PopoverChannel.SwitchLaunchConfig,
4763
- PopoverSwitchLaunchConfigSchema,
4764
- args
4765
- );
4766
- ctx.views.hidePopover();
4767
- ctx.notify.popoverSwitchLaunchConfig(id);
4768
- }).on(PopoverChannel.UpdateLaunchConfigs, (_event, ...args) => {
4769
- const [configs] = validate(
4770
- PopoverChannel.UpdateLaunchConfigs,
4771
- PopoverUpdateLaunchConfigsSchema,
4772
- args
4773
- );
4774
- ctx.notify.popoverUpdateLaunchConfigs(configs);
4775
4689
  });
4776
4690
  }
4777
4691
  var popoverModule = {
@@ -4997,34 +4911,6 @@ function registerSessionIpc(ctx) {
4997
4911
  args
4998
4912
  );
4999
4913
  return ctx.workspace.getThumbnail(projectPath);
5000
- }).handle(ProjectChannel.GetLaunchConfigs, (_, ...args) => {
5001
- const [projectPath] = validate(
5002
- ProjectChannel.GetLaunchConfigs,
5003
- ProjectGetLaunchConfigsSchema,
5004
- args
5005
- );
5006
- return ctx.workspace.getLaunchConfigs(projectPath);
5007
- }).handle(ProjectChannel.SaveLaunchConfigs, (_, ...args) => {
5008
- const [projectPath, configs] = validate(
5009
- ProjectChannel.SaveLaunchConfigs,
5010
- ProjectSaveLaunchConfigsSchema,
5011
- args
5012
- );
5013
- return ctx.workspace.saveLaunchConfigs(projectPath, configs);
5014
- }).handle(ProjectChannel.GetActiveLaunchConfigId, (_, ...args) => {
5015
- const [projectPath] = validate(
5016
- ProjectChannel.GetActiveLaunchConfigId,
5017
- ProjectGetActiveLaunchConfigIdSchema,
5018
- args
5019
- );
5020
- return ctx.workspace.getActiveLaunchConfigId(projectPath);
5021
- }).handle(ProjectChannel.SaveActiveLaunchConfigId, (_, ...args) => {
5022
- const [projectPath, id] = validate(
5023
- ProjectChannel.SaveActiveLaunchConfigId,
5024
- ProjectSaveActiveLaunchConfigIdSchema,
5025
- args
5026
- );
5027
- return ctx.workspace.saveActiveLaunchConfigId(projectPath, id);
5028
4914
  });
5029
4915
  }
5030
4916
  var sessionModule = {
@@ -11563,24 +11449,7 @@ async function createDevtoolsRuntime(config = {}) {
11563
11449
  // teardown, so a single dispose leaves no dead entry behind.
11564
11450
  registerTrustedWindow: (win) => context.registry.add(registerTrustedWindow(context, win)),
11565
11451
  registerSimulatorApi: (name, handler) => context.registry.add(toDisposable8(context.simulatorApis.register(name, handler))),
11566
- dispose: () => disposeContext(context),
11567
- async getLaunchConfigs() {
11568
- const projectPath = context.workspace.getProjectPath();
11569
- if (!projectPath) return [];
11570
- return context.workspace.getLaunchConfigs(projectPath);
11571
- },
11572
- async setLaunchConfigs(configs) {
11573
- const projectPath = context.workspace.getProjectPath();
11574
- if (!projectPath) return;
11575
- await context.workspace.saveLaunchConfigs(projectPath, configs);
11576
- context.notify.popoverUpdateLaunchConfigs(configs);
11577
- },
11578
- async setActiveLaunchConfig(id) {
11579
- const projectPath = context.workspace.getProjectPath();
11580
- if (!projectPath) return;
11581
- await context.workspace.saveActiveLaunchConfigId(projectPath, id);
11582
- context.notify.popoverSwitchLaunchConfig(id);
11583
- }
11452
+ dispose: () => disposeContext(context)
11584
11453
  };
11585
11454
  instance.registerSimulatorApi("login", async () => {
11586
11455
  return "hello";
@@ -1,5 +1,5 @@
1
1
  import { PopoverChannel } from '../../shared/ipc-channels.js';
2
- import { PopoverShowSchema, PopoverRelaunchSchema, PopoverSwitchLaunchConfigSchema, PopoverUpdateLaunchConfigsSchema, } from '../../shared/ipc-schemas.js';
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';
5
5
  export function registerPopoverIpc(ctx) {
@@ -15,15 +15,6 @@ export function registerPopoverIpc(ctx) {
15
15
  const [newConfig] = validate(PopoverChannel.Relaunch, PopoverRelaunchSchema, args);
16
16
  ctx.views.hidePopover();
17
17
  ctx.notify.popoverRelaunch(newConfig);
18
- })
19
- .on(PopoverChannel.SwitchLaunchConfig, (_event, ...args) => {
20
- const [id] = validate(PopoverChannel.SwitchLaunchConfig, PopoverSwitchLaunchConfigSchema, args);
21
- ctx.views.hidePopover();
22
- ctx.notify.popoverSwitchLaunchConfig(id);
23
- })
24
- .on(PopoverChannel.UpdateLaunchConfigs, (_event, ...args) => {
25
- const [configs] = validate(PopoverChannel.UpdateLaunchConfigs, PopoverUpdateLaunchConfigsSchema, args);
26
- ctx.notify.popoverUpdateLaunchConfigs(configs);
27
18
  });
28
19
  }
29
20
  export const popoverModule = {
@@ -1,5 +1,5 @@
1
1
  import { ProjectChannel } from '../../shared/ipc-channels.js';
2
- import { ProjectCaptureThumbnailSchema, ProjectGetCompileConfigSchema, ProjectGetPagesSchema, ProjectGetThumbnailSchema, ProjectOpenSchema, ProjectSaveCompileConfigSchema, ProjectGetLaunchConfigsSchema, ProjectSaveLaunchConfigsSchema, ProjectGetActiveLaunchConfigIdSchema, ProjectSaveActiveLaunchConfigIdSchema, } from '../../shared/ipc-schemas.js';
2
+ import { ProjectCaptureThumbnailSchema, ProjectGetCompileConfigSchema, ProjectGetPagesSchema, ProjectGetThumbnailSchema, ProjectOpenSchema, ProjectSaveCompileConfigSchema, } from '../../shared/ipc-schemas.js';
3
3
  import { validate } from '../utils/ipc-schema.js';
4
4
  import { IpcRegistry } from '../utils/ipc-registry.js';
5
5
  export function registerSessionIpc(ctx) {
@@ -30,22 +30,6 @@ export function registerSessionIpc(ctx) {
30
30
  .handle(ProjectChannel.GetThumbnail, (_, ...args) => {
31
31
  const [projectPath] = validate(ProjectChannel.GetThumbnail, ProjectGetThumbnailSchema, args);
32
32
  return ctx.workspace.getThumbnail(projectPath);
33
- })
34
- .handle(ProjectChannel.GetLaunchConfigs, (_, ...args) => {
35
- const [projectPath] = validate(ProjectChannel.GetLaunchConfigs, ProjectGetLaunchConfigsSchema, args);
36
- return ctx.workspace.getLaunchConfigs(projectPath);
37
- })
38
- .handle(ProjectChannel.SaveLaunchConfigs, (_, ...args) => {
39
- const [projectPath, configs] = validate(ProjectChannel.SaveLaunchConfigs, ProjectSaveLaunchConfigsSchema, args);
40
- return ctx.workspace.saveLaunchConfigs(projectPath, configs);
41
- })
42
- .handle(ProjectChannel.GetActiveLaunchConfigId, (_, ...args) => {
43
- const [projectPath] = validate(ProjectChannel.GetActiveLaunchConfigId, ProjectGetActiveLaunchConfigIdSchema, args);
44
- return ctx.workspace.getActiveLaunchConfigId(projectPath);
45
- })
46
- .handle(ProjectChannel.SaveActiveLaunchConfigId, (_, ...args) => {
47
- const [projectPath, id] = validate(ProjectChannel.SaveActiveLaunchConfigId, ProjectSaveActiveLaunchConfigIdSchema, args);
48
- return ctx.workspace.saveActiveLaunchConfigId(projectPath, id);
49
33
  });
50
34
  }
51
35
  export const sessionModule = {
@@ -1,5 +1,5 @@
1
1
  import type { BrowserWindow, WebContents, WebContentsView } from 'electron';
2
- import type { CompileConfig, LaunchConfig } from '../../../shared/types.js';
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
5
  import type { ProjectSettings } from '../projects/project-repository.js';
@@ -98,10 +98,6 @@ export interface RendererNotifier {
98
98
  popoverClosed(): void;
99
99
  /** Ask the main renderer to relaunch the simulator with a new config. */
100
100
  popoverRelaunch(config: CompileConfig): void;
101
- /** Ask the main renderer to switch to a launch config (or null for normal). */
102
- popoverSwitchLaunchConfig(id: string | null): void;
103
- /** Ask the main renderer to update its launch configs list. */
104
- popoverUpdateLaunchConfigs(configs: LaunchConfig[]): void;
105
101
  /**
106
102
  * Push the reserved host-toolbar height to the main renderer so its toolbar
107
103
  * placeholder div resizes (closes the host-toolbar dynamic-height loop).
@@ -39,12 +39,6 @@ export function createRendererNotifier(ctx) {
39
39
  popoverRelaunch(config) {
40
40
  sendToMain(PopoverChannel.Relaunch, config);
41
41
  },
42
- popoverSwitchLaunchConfig(id) {
43
- sendToMain(PopoverChannel.SwitchLaunchConfig, id);
44
- },
45
- popoverUpdateLaunchConfigs(configs) {
46
- sendToMain(PopoverChannel.UpdateLaunchConfigs, configs);
47
- },
48
42
  hostToolbarHeightChanged(height) {
49
43
  sendToMain(ViewChannel.HostToolbarHeightChanged, height);
50
44
  },
@@ -20,10 +20,6 @@ export function createLocalProjectsProvider() {
20
20
  saveCompileConfig: (dirPath, cfg) => repo.saveCompileConfig(dirPath, cfg),
21
21
  saveThumbnail: (dirPath, dataUrl) => saveThumbnailFromDataUrl(dirPath, dataUrl),
22
22
  getThumbnail: (dirPath) => loadThumbnail(dirPath),
23
- getLaunchConfigs: (dirPath) => repo.getLaunchConfigs(dirPath),
24
- saveLaunchConfigs: (dirPath, configs) => repo.saveLaunchConfigs(dirPath, configs),
25
- getActiveLaunchConfigId: (dirPath) => repo.getActiveLaunchConfigId(dirPath),
26
- saveActiveLaunchConfigId: (dirPath, id) => repo.saveActiveLaunchConfigId(dirPath, id),
27
23
  };
28
24
  }
29
25
  //# sourceMappingURL=local-provider.js.map
@@ -1,11 +1,9 @@
1
- import type { CompileConfig, LaunchConfig } from '../../../shared/types.js';
1
+ import type { CompileConfig } from '../../../shared/types.js';
2
2
  export interface Project {
3
3
  name: string;
4
4
  path: string;
5
5
  lastOpened?: string | null;
6
6
  compileConfig?: CompileConfig;
7
- launchConfigs?: LaunchConfig[];
8
- activeLaunchConfigId?: string | null;
9
7
  }
10
8
  export interface ProjectPages {
11
9
  pages: string[];
@@ -25,10 +23,6 @@ export declare function getProjectPages(dirPath: string): ProjectPages;
25
23
  export declare function saveCompileConfig(dirPath: string, config: CompileConfig): void;
26
24
  /** Read a subset of `project.config.json` exposed to the settings panel. */
27
25
  export declare function getProjectSettings(projectPath: string): ProjectSettings;
28
- export declare function getLaunchConfigs(dirPath: string): LaunchConfig[];
29
- export declare function saveLaunchConfigs(dirPath: string, configs: LaunchConfig[]): void;
30
- export declare function getActiveLaunchConfigId(dirPath: string): string | null;
31
- export declare function saveActiveLaunchConfigId(dirPath: string, id: string | null): void;
32
26
  /** Persist a partial patch into the `setting` block of `project.config.json`. */
33
27
  export declare function updateProjectSettings(projectPath: string, patch: Partial<ProjectSettings>): void;
34
28
  //# sourceMappingURL=project-repository.d.ts.map
@@ -132,30 +132,6 @@ export function getProjectSettings(projectPath) {
132
132
  return { uploadWithSourceMap: false };
133
133
  }
134
134
  }
135
- export function getLaunchConfigs(dirPath) {
136
- const project = load().find((p) => p.path === dirPath);
137
- return project?.launchConfigs ?? [];
138
- }
139
- export function saveLaunchConfigs(dirPath, configs) {
140
- const projects = load();
141
- const idx = projects.findIndex((p) => p.path === dirPath);
142
- if (idx >= 0) {
143
- projects[idx] = { ...projects[idx], launchConfigs: configs };
144
- save(projects);
145
- }
146
- }
147
- export function getActiveLaunchConfigId(dirPath) {
148
- const project = load().find((p) => p.path === dirPath);
149
- return project?.activeLaunchConfigId ?? null;
150
- }
151
- export function saveActiveLaunchConfigId(dirPath, id) {
152
- const projects = load();
153
- const idx = projects.findIndex((p) => p.path === dirPath);
154
- if (idx >= 0) {
155
- projects[idx] = { ...projects[idx], activeLaunchConfigId: id };
156
- save(projects);
157
- }
158
- }
159
135
  /** Persist a partial patch into the `setting` block of `project.config.json`. */
160
136
  export function updateProjectSettings(projectPath, patch) {
161
137
  if (!projectPath)
@@ -4,7 +4,7 @@
4
4
  * `WorkbenchAppConfig` to fully take over the project source-of-truth, the
5
5
  * template catalog, and the "新建项目" dialog.
6
6
  */
7
- import type { CompileConfig, LaunchConfig } from '../../../shared/types.js';
7
+ import type { CompileConfig } from '../../../shared/types.js';
8
8
  import type { Project } from './project-repository.js';
9
9
  export type { Project };
10
10
  export type { ProjectTemplate, CreateProjectInput } from '../../../shared/types.js';
@@ -81,30 +81,6 @@ export interface ProjectsProvider {
81
81
  * Default when omitted: returns `null`.
82
82
  */
83
83
  getThumbnail?(dirPath: string): string | null | Promise<string | null>;
84
- /**
85
- * Read saved launch configs for a project.
86
- *
87
- * Default when omitted: returns `[]`.
88
- */
89
- getLaunchConfigs?(dirPath: string): LaunchConfig[] | Promise<LaunchConfig[]>;
90
- /**
91
- * Persist the full list of launch configs for a project.
92
- *
93
- * Default when omitted: silently no-ops.
94
- */
95
- saveLaunchConfigs?(dirPath: string, configs: LaunchConfig[]): void | Promise<void>;
96
- /**
97
- * Read the active launch config id for a project.
98
- *
99
- * Default when omitted: returns `null` (normal mode).
100
- */
101
- getActiveLaunchConfigId?(dirPath: string): string | null | Promise<string | null>;
102
- /**
103
- * Persist the active launch config id for a project.
104
- *
105
- * Default when omitted: silently no-ops.
106
- */
107
- saveActiveLaunchConfigId?(dirPath: string, id: string | null): void | Promise<void>;
108
84
  }
109
85
  /** Built-in template policy. */
110
86
  export type BuiltinTemplatesMode = 'all' | 'none' | readonly string[];
@@ -91,7 +91,7 @@ export function createRenderInspector(options = {}) {
91
91
  if (!(await ensureInjected(wc)))
92
92
  return null;
93
93
  try {
94
- const result = (await wc.executeJavaScript('window.__diminaRenderInspect ? window.__diminaRenderInspect.getWxml() : null'));
94
+ const result = await wc.executeJavaScript('window.__diminaRenderInspect ? window.__diminaRenderInspect.getWxml() : null');
95
95
  return result ?? null;
96
96
  }
97
97
  catch {
@@ -105,7 +105,7 @@ export function createRenderInspector(options = {}) {
105
105
  return null;
106
106
  let inspection;
107
107
  try {
108
- const result = (await wc.executeJavaScript(`window.__diminaRenderInspect ? window.__diminaRenderInspect.highlightElement(${JSON.stringify(sid)}) : null`));
108
+ const result = await wc.executeJavaScript(`window.__diminaRenderInspect ? window.__diminaRenderInspect.highlightElement(${JSON.stringify(sid)}) : null`);
109
109
  inspection = result ?? null;
110
110
  }
111
111
  catch {
@@ -149,11 +149,11 @@ export function createRenderInspector(options = {}) {
149
149
  return;
150
150
  const expression = `window.__diminaRenderInspect && window.__diminaRenderInspect.elementFor(${JSON.stringify(sid)})`;
151
151
  try {
152
- const evaluated = (await wc.debugger.sendCommand('Runtime.evaluate', {
152
+ const evaluated = await wc.debugger.sendCommand('Runtime.evaluate', {
153
153
  expression,
154
154
  returnByValue: false,
155
155
  objectGroup: HOVER_OBJECT_GROUP,
156
- }));
156
+ });
157
157
  const objectId = evaluated?.result?.objectId;
158
158
  if (!objectId)
159
159
  return;
@@ -1,4 +1,4 @@
1
- import type { AppInfo, CompileConfig, LaunchConfig, ProjectSession } from '../../../shared/types.js';
1
+ import type { AppInfo, CompileConfig, ProjectSession } from '../../../shared/types.js';
2
2
  import type { WorkbenchContext } from '../workbench-context.js';
3
3
  import type { Project, ProjectPages, ProjectSettings } from '../projects/project-repository.js';
4
4
  /**
@@ -57,10 +57,6 @@ export interface WorkspaceService {
57
57
  saveCompileConfig(projectPath: string, config: CompileConfig): Promise<void>;
58
58
  getProjectSettings(projectPath: string): ProjectSettings;
59
59
  updateProjectSettings(projectPath: string, patch: Partial<ProjectSettings>): void;
60
- getLaunchConfigs(projectPath: string): Promise<LaunchConfig[]>;
61
- saveLaunchConfigs(projectPath: string, configs: LaunchConfig[]): Promise<void>;
62
- getActiveLaunchConfigId(projectPath: string): Promise<string | null>;
63
- saveActiveLaunchConfigId(projectPath: string, id: string | null): Promise<void>;
64
60
  }
65
61
  /** Build a workspace service bound to the given workbench context. */
66
62
  export declare function createWorkspaceService(ctx: WorkbenchContext): WorkspaceService;
@@ -386,14 +386,6 @@ export function createWorkspaceService(ctx) {
386
386
  // own `project.config.json`, not the registry — keep direct repo calls.
387
387
  getProjectSettings: (projectPath) => repo.getProjectSettings(projectPath),
388
388
  updateProjectSettings: (projectPath, patch) => repo.updateProjectSettings(projectPath, patch),
389
- getLaunchConfigs: async (p) => (provider.getLaunchConfigs ? await provider.getLaunchConfigs(p) : []),
390
- saveLaunchConfigs: async (p, c) => { if (provider.saveLaunchConfigs)
391
- await provider.saveLaunchConfigs(p, c); },
392
- getActiveLaunchConfigId: async (p) => provider.getActiveLaunchConfigId ? await provider.getActiveLaunchConfigId(p) : null,
393
- saveActiveLaunchConfigId: async (p, id) => {
394
- if (provider.saveActiveLaunchConfigId)
395
- await provider.saveActiveLaunchConfigId(p, id);
396
- },
397
389
  };
398
390
  }
399
391
  //# sourceMappingURL=workspace-service.js.map
@@ -1768,13 +1768,7 @@ var yi = /* @__PURE__ */ new WeakMap(), bi = /* @__PURE__ */ Symbol("_vte"), xi
1768
1768
  r ? (o !== "svg" && wi(r) ? o = "svg" : o !== "mathml" && Ti(r) && (o = "mathml"), i && i.isCE && (i.ce._teleportTargets || (i.ce._teleportTargets = /* @__PURE__ */ new Set())).add(r), n || (b(e, r, a), ji(e, !1))) : process.env.NODE_ENV !== "production" && !n && z("Invalid Teleport target on mount:", r, `(${typeof r})`);
1769
1769
  }, S = (e) => {
1770
1770
  let t = () => {
1771
- if (yi.get(e) === t) {
1772
- if (yi.delete(e), Si(e.props)) {
1773
- let t = _(e.el) || n;
1774
- b(e, t, e.anchor), ji(e, !0);
1775
- }
1776
- x(e);
1777
- }
1771
+ yi.get(e) === t && (yi.delete(e), Si(e.props) && (b(e, _(e.el) || n, e.anchor), ji(e, !0)), x(e));
1778
1772
  };
1779
1773
  yi.set(e, t), Ko(t, a);
1780
1774
  };
@@ -2919,10 +2913,7 @@ function Jo(e, t) {
2919
2913
  }
2920
2914
  }
2921
2915
  }, C = (e, t, n, r, i, a, o, s, c = 0) => {
2922
- for (let l = c; l < e.length; l++) {
2923
- let c = e[l] = s ? Vs(e[l]) : Bs(e[l]);
2924
- h(null, c, t, n, r, i, a, o, s);
2925
- }
2916
+ for (let l = c; l < e.length; l++) h(null, e[l] = s ? Vs(e[l]) : Bs(e[l]), t, n, r, i, a, o, s);
2926
2917
  }, ne = (e, t, n, r, i, o, s) => {
2927
2918
  let c = t.el = e.el;
2928
2919
  process.env.NODE_ENV !== "production" && (c.__vnode = t);
@@ -2945,8 +2936,8 @@ function Jo(e, t) {
2945
2936
  }, r);
2946
2937
  }, re = (e, t, n, r, i, a, o) => {
2947
2938
  for (let s = 0; s < t.length; s++) {
2948
- let c = e[s], l = t[s], u = c.el && (c.type === W || !Os(c, l) || c.shapeFlag & 198) ? d(c.el) : n;
2949
- h(c, l, u, null, r, i, a, o, !0);
2939
+ let c = e[s], l = t[s];
2940
+ h(c, l, c.el && (c.type === W || !Os(c, l) || c.shapeFlag & 198) ? d(c.el) : n, null, r, i, a, o, !0);
2950
2941
  }
2951
2942
  }, w = (e, t, n, r, i) => {
2952
2943
  if (t !== n) {
@@ -6494,10 +6485,7 @@ var Ru = {
6494
6485
  let e = c();
6495
6486
  if (t.value.style = o.indicatorStyle, v.default && v.default()[0].children.length > 0) {
6496
6487
  let e = r.value.querySelector(":first-child");
6497
- if (e) {
6498
- let n = window.getComputedStyle(e);
6499
- m.value = n.lineHeight || "34px", t.value.style.height = m.value;
6500
- }
6488
+ e && (m.value = window.getComputedStyle(e).lineHeight || "34px", t.value.style.height = m.value);
6501
6489
  }
6502
6490
  x = t.value.offsetHeight;
6503
6491
  let s = (e - x) / 2;
@@ -7343,25 +7331,19 @@ var Ru = {
7343
7331
  function be() {
7344
7332
  C &&= (cancelAnimationFrame(C), void 0);
7345
7333
  let e = p.value.getBoundingClientRect();
7346
- if (t.vertical) {
7347
- let t = te - e.y;
7348
- Q("transition", {
7349
- info: n,
7350
- detail: {
7351
- dx: 0,
7352
- dy: t
7353
- }
7354
- });
7355
- } else {
7356
- let t = ee - e.x;
7357
- Q("transition", {
7358
- info: n,
7359
- detail: {
7360
- dx: t,
7361
- dy: 0
7362
- }
7363
- });
7364
- }
7334
+ t.vertical ? Q("transition", {
7335
+ info: n,
7336
+ detail: {
7337
+ dx: 0,
7338
+ dy: te - e.y
7339
+ }
7340
+ }) : Q("transition", {
7341
+ info: n,
7342
+ detail: {
7343
+ dx: ee - e.x,
7344
+ dy: 0
7345
+ }
7346
+ });
7365
7347
  }
7366
7348
  function N() {
7367
7349
  xe(), t.autoplay && i.value > T.value && (ne = setInterval(() => {
@@ -8951,7 +8933,7 @@ var Jp = new class {
8951
8933
  }
8952
8934
  getCanvasImage(e) {
8953
8935
  let t = this.getCanvasResource(e);
8954
- return t || (t = new Image(), this.setCanvasResource(e, t)), t;
8936
+ return t || (t = new Image(), t.crossOrigin = "anonymous", this.setCanvasResource(e, t)), t;
8955
8937
  }
8956
8938
  executeCanvasOperation(e, t, n) {
8957
8939
  switch (t.op) {
@@ -8999,6 +8981,23 @@ var Jp = new class {
8999
8981
  }, e.src = t.src;
9000
8982
  break;
9001
8983
  }
8984
+ case "getImageData": {
8985
+ let e = this.getCanvasResource(t.contextId);
8986
+ if (e) {
8987
+ let r = e.getImageData(t.x, t.y, t.width, t.height);
8988
+ this.triggerCallback(n, t.callback, {
8989
+ data: Array.from(r.data),
8990
+ width: r.width,
8991
+ height: r.height
8992
+ });
8993
+ }
8994
+ break;
8995
+ }
8996
+ case "toDataURL": {
8997
+ let r = t.mimeType || "image/png", i = t.quality === void 0 ? e.canvas.toDataURL(r) : e.canvas.toDataURL(r, t.quality);
8998
+ this.triggerCallback(n, t.callback, i);
8999
+ break;
9000
+ }
9002
9001
  default: console.warn("[system]", "[render]", `Unsupported canvas node operation: ${t.op}`);
9003
9002
  }
9004
9003
  }
@@ -9229,11 +9228,22 @@ var Jp = new class {
9229
9228
  this.ensureCanvasResolution(d);
9230
9229
  let n = a || d.width, f = o || d.height, p = document.createElement("canvas");
9231
9230
  p.width = s || n, p.height = c || f, p.getContext("2d").drawImage(d, r, i, n, f, 0, 0, p.width, p.height);
9232
- let m = l === "jpg" || l === "jpeg" ? "image/jpeg" : "image/png", h = {
9233
- errMsg: "canvasToTempFilePath:ok",
9234
- tempFilePath: p.toDataURL(m, u)
9235
- };
9236
- this.triggerCallback(e, t.success, [h], h), this.triggerCallback(e, t.complete, [h], h);
9231
+ let m = l === "jpg" || l === "jpeg" ? "image/jpeg" : "image/png", h = p.toDataURL(m, u);
9232
+ T.invoke({
9233
+ type: "invokeAPI",
9234
+ target: "container",
9235
+ body: {
9236
+ name: "saveCanvasTempFile",
9237
+ bridgeId: e,
9238
+ params: {
9239
+ dataURL: h,
9240
+ fileType: l,
9241
+ success: t.success,
9242
+ fail: t.fail,
9243
+ complete: t.complete
9244
+ }
9245
+ }
9246
+ });
9237
9247
  } catch (n) {
9238
9248
  this.triggerCanvasFailure(e, t, `canvasToTempFilePath:fail ${n.message}`);
9239
9249
  }