@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.
- package/dist/openerWorkerMain.js +17 -3
- package/package.json +1 -1
package/dist/openerWorkerMain.js
CHANGED
|
@@ -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
|
-
//
|
|
1167
|
-
|
|
1168
|
-
|
|
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 = {
|