@lvce-editor/opener-worker 1.4.0 → 1.5.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.
@@ -1149,6 +1149,10 @@ const enable = () => {
1149
1149
  return set(true);
1150
1150
  };
1151
1151
 
1152
+ const getWorkspaceUri = async () => {
1153
+ return invoke$2('Workspace.getUri');
1154
+ };
1155
+
1152
1156
  let saveDialogMockReturnValue = null;
1153
1157
  const registerSaveDialogMock = value => {
1154
1158
  saveDialogMockReturnValue = value;
@@ -1163,9 +1167,19 @@ const showSaveDialog = async (title, properties, platform) => {
1163
1167
  if (platform === Electron) {
1164
1168
  return invoke$1('ElectronDialog.showSaveDialog', title, properties);
1165
1169
  }
1166
- // TODO when running in web, maybe only make a prompt and ask for a filename
1167
- // and the use the workspace path as directory
1168
- return invoke$2('ConfirmPompt.prompt', title);
1170
+ // When running in web, prompt for filename and combine with workspace path
1171
+ const fileName = await invoke$2('Prompt.prompt', title);
1172
+ if (!fileName) {
1173
+ return {
1174
+ canceled: true
1175
+ };
1176
+ }
1177
+ const workspaceUri = await getWorkspaceUri();
1178
+ const filePath = `${workspaceUri}/${fileName}`;
1179
+ return {
1180
+ canceled: false,
1181
+ filePath
1182
+ };
1169
1183
  };
1170
1184
 
1171
1185
  const commandMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/opener-worker",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Opener Worker",
5
5
  "repository": {
6
6
  "type": "git",