@lvce-editor/main-process 4.8.0 → 4.10.0

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.
@@ -4239,7 +4239,7 @@ const getElectronFileResponseConfig = async (url, request) => {
4239
4239
  return getNotFoundResponse();
4240
4240
  }
4241
4241
  const responseHeaders = headers[match];
4242
- const absolutePath = getAbsolutePath(match);
4242
+ const absolutePath = getAbsolutePath(actual);
4243
4243
  if (!existsSync(absolutePath)) {
4244
4244
  return getNotFoundResponse();
4245
4245
  }
@@ -4829,6 +4829,25 @@ const showOpenDialog = async (title, properties) => {
4829
4829
  // TODO maybe return whole result (including canceled or not)
4830
4830
  return result.filePaths;
4831
4831
  };
4832
+ const showSaveDialog = async (title, properties) => {
4833
+ string(title);
4834
+ array(properties);
4835
+ const focusedWindow = getFocusedWindow();
4836
+ if (!focusedWindow) {
4837
+ return {
4838
+ canceled: true,
4839
+ filePath: ''
4840
+ };
4841
+ }
4842
+ const result = await Electron.dialog.showSaveDialog(focusedWindow, {
4843
+ properties,
4844
+ title
4845
+ });
4846
+ return {
4847
+ canceled: result.canceled,
4848
+ filePath: result.filePath
4849
+ };
4850
+ };
4832
4851
 
4833
4852
  /**
4834
4853
  *
@@ -6346,6 +6365,7 @@ const commandMap = {
6346
6365
  'ElectronDeveloper.getPerformanceEntries': getPerformanceEntries,
6347
6366
  'ElectronDialog.showMessageBox': showMessageBox,
6348
6367
  'ElectronDialog.showOpenDialog': showOpenDialog,
6368
+ 'ElectronDialog.showSaveDialog': showSaveDialog,
6349
6369
  'ElectronNet.getJson': getJson,
6350
6370
  'ElectronNetLog.startLogging': startLogging,
6351
6371
  'ElectronNetLog.stopLogging': stopLogging,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/main-process",
3
- "version": "4.8.0",
3
+ "version": "4.10.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "electron"