@interopio/workspaces-api 4.0.2 → 4.1.1-beta.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/workspaces.es.js +41 -16
- package/dist/workspaces.es.js.map +1 -1
- package/dist/workspaces.umd.js +41 -16
- package/dist/workspaces.umd.js.map +1 -1
- package/dist/workspaces.umd.min.js +1 -1
- package/package.json +3 -3
package/dist/workspaces.umd.js
CHANGED
|
@@ -1601,6 +1601,7 @@
|
|
|
1601
1601
|
maximizeItem: { name: "maximizeItem", argsDecoder: simpleItemConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1602
1602
|
focusItem: { name: "focusItem", argsDecoder: simpleItemConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1603
1603
|
closeItem: { name: "closeItem", argsDecoder: closeItemConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1604
|
+
closeWorkspace: { name: "closeWorkspace", argsDecoder: closeItemConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1604
1605
|
resizeItem: { name: "resizeItem", argsDecoder: resizeItemConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1605
1606
|
setMaximizationBoundary: { name: "setMaximizationBoundary", argsDecoder: setMaximizationBoundaryConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1606
1607
|
changeFrameState: { name: "changeFrameState", argsDecoder: frameStateConfigDecoder, resultDecoder: voidResultDecoder },
|
|
@@ -2781,14 +2782,7 @@
|
|
|
2781
2782
|
}
|
|
2782
2783
|
async close() {
|
|
2783
2784
|
const controller = getData$3(this).controller;
|
|
2784
|
-
|
|
2785
|
-
const platformFrameId = (await controller.getPlatformFrameId()).id;
|
|
2786
|
-
const shouldCloseFrame = isLastWorkspaceInFrame &&
|
|
2787
|
-
platformFrameId !== this.frame.id;
|
|
2788
|
-
if (shouldCloseFrame) {
|
|
2789
|
-
return this.frame.close();
|
|
2790
|
-
}
|
|
2791
|
-
await controller.closeItem(this.id);
|
|
2785
|
+
await controller.closeWorkspace(this.id, this.frameId);
|
|
2792
2786
|
}
|
|
2793
2787
|
snapshot() {
|
|
2794
2788
|
return getData$3(this).controller.getSnapshot(this.id, "workspace");
|
|
@@ -3345,7 +3339,8 @@
|
|
|
3345
3339
|
throw new Error("Cannot eject this window, because it is not loaded yet");
|
|
3346
3340
|
}
|
|
3347
3341
|
const itemId = getData$2(this).id;
|
|
3348
|
-
const
|
|
3342
|
+
const windowId = getData$2(this).config.windowId;
|
|
3343
|
+
const newWindowId = await getData$2(this).controller.ejectWindow(itemId, windowId);
|
|
3349
3344
|
getData$2(this).config.windowId = newWindowId;
|
|
3350
3345
|
await this.workspace.refreshReference();
|
|
3351
3346
|
return this.getGdWindow();
|
|
@@ -4288,6 +4283,9 @@
|
|
|
4288
4283
|
async focusItem(itemId) {
|
|
4289
4284
|
await this.bridge.send(OPERATIONS.focusItem.name, { itemId });
|
|
4290
4285
|
}
|
|
4286
|
+
async closeWorkspace(workspaceId) {
|
|
4287
|
+
await this.bridge.send(OPERATIONS.closeWorkspace.name, { itemId: workspaceId });
|
|
4288
|
+
}
|
|
4291
4289
|
async closeItem(itemId) {
|
|
4292
4290
|
await this.bridge.send(OPERATIONS.closeItem.name, { itemId });
|
|
4293
4291
|
}
|
|
@@ -4319,8 +4317,8 @@
|
|
|
4319
4317
|
const controlResult = await this.bridge.send(OPERATIONS.forceLoadWindow.name, { itemId });
|
|
4320
4318
|
return controlResult.windowId;
|
|
4321
4319
|
}
|
|
4322
|
-
async ejectWindow(itemId) {
|
|
4323
|
-
return await this.bridge.send(OPERATIONS.ejectWindow.name, { itemId });
|
|
4320
|
+
async ejectWindow(itemId, windowId) {
|
|
4321
|
+
return await this.bridge.send(OPERATIONS.ejectWindow.name, { itemId, windowId });
|
|
4324
4322
|
}
|
|
4325
4323
|
async moveWindowTo(itemId, newParentId) {
|
|
4326
4324
|
await this.bridge.send(OPERATIONS.moveWindowTo.name, { itemId, containerId: newParentId });
|
|
@@ -4708,6 +4706,23 @@
|
|
|
4708
4706
|
const frameResult = await this.bridge.send(OPERATIONS.getFrameState.name, { itemId: frameId });
|
|
4709
4707
|
return frameResult.state;
|
|
4710
4708
|
}
|
|
4709
|
+
async closeWorkspace(workspaceId, frameId) {
|
|
4710
|
+
if (isDesktop()) {
|
|
4711
|
+
return await this.closeItem(workspaceId);
|
|
4712
|
+
}
|
|
4713
|
+
let closeWorkspaceCommandExists = false;
|
|
4714
|
+
try {
|
|
4715
|
+
const { isSupported } = await this.base.isOperationSupported(OPERATIONS.closeWorkspace.name);
|
|
4716
|
+
closeWorkspaceCommandExists = isSupported;
|
|
4717
|
+
}
|
|
4718
|
+
catch (error) {
|
|
4719
|
+
closeWorkspaceCommandExists = false;
|
|
4720
|
+
}
|
|
4721
|
+
if (closeWorkspaceCommandExists) {
|
|
4722
|
+
return await this.base.closeWorkspace(workspaceId);
|
|
4723
|
+
}
|
|
4724
|
+
return await this.legacyCloseWorkspace(workspaceId, frameId);
|
|
4725
|
+
}
|
|
4711
4726
|
async closeItem(itemId) {
|
|
4712
4727
|
return await this.base.closeItem(itemId);
|
|
4713
4728
|
}
|
|
@@ -4740,10 +4755,10 @@
|
|
|
4740
4755
|
await this.base.notifyWindowAdded(windowId);
|
|
4741
4756
|
return windowId;
|
|
4742
4757
|
}
|
|
4743
|
-
async ejectWindow(itemId) {
|
|
4744
|
-
const
|
|
4745
|
-
await this.base.notifyWindowAdded(
|
|
4746
|
-
return
|
|
4758
|
+
async ejectWindow(itemId, windowId) {
|
|
4759
|
+
const id = (await this.base.ejectWindow(itemId, windowId)).windowId;
|
|
4760
|
+
await this.base.notifyWindowAdded(id);
|
|
4761
|
+
return id;
|
|
4747
4762
|
}
|
|
4748
4763
|
async moveWindowTo(itemId, newParentId) {
|
|
4749
4764
|
return await this.base.moveWindowTo(itemId, newParentId);
|
|
@@ -4886,6 +4901,16 @@
|
|
|
4886
4901
|
callback(wsp, end);
|
|
4887
4902
|
}
|
|
4888
4903
|
}
|
|
4904
|
+
async legacyCloseWorkspace(workspaceId, frameId) {
|
|
4905
|
+
const isLastWorkspaceInFrame = await this.isLastWorkspaceInFrame(workspaceId, frameId);
|
|
4906
|
+
const platformFrameId = (await this.getPlatformFrameId()).id;
|
|
4907
|
+
const shouldCloseFrame = isLastWorkspaceInFrame &&
|
|
4908
|
+
platformFrameId !== frameId;
|
|
4909
|
+
if (shouldCloseFrame) {
|
|
4910
|
+
return await this.closeFrame(frameId, {});
|
|
4911
|
+
}
|
|
4912
|
+
await this.closeItem(workspaceId);
|
|
4913
|
+
}
|
|
4889
4914
|
}
|
|
4890
4915
|
|
|
4891
4916
|
class ShortcutsController {
|
|
@@ -5114,7 +5139,7 @@
|
|
|
5114
5139
|
}
|
|
5115
5140
|
}
|
|
5116
5141
|
|
|
5117
|
-
var version = "4.0
|
|
5142
|
+
var version = "4.1.1-beta.0";
|
|
5118
5143
|
|
|
5119
5144
|
const composeAPI = (glue, ioc) => {
|
|
5120
5145
|
const controller = ioc.controller;
|