@interopio/workspaces-api 4.3.0 → 4.5.0-next.1
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/changelog.md +16 -1
- package/dist/workspaces.es.js +139 -26
- package/dist/workspaces.es.js.map +1 -1
- package/dist/workspaces.umd.js +139 -26
- package/dist/workspaces.umd.js.map +1 -1
- package/dist/workspaces.umd.min.js +1 -1
- package/package.json +1 -1
- package/workspaces.d.ts +72 -5
package/changelog.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
4.
|
|
1
|
+
## 4.4.0
|
|
2
|
+
|
|
3
|
+
## 4.5.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f9022d0: feat: Added the WorkspacesFrame.setOnTop method
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 3ba192c: feat: implemented the saveWindowContexts flag for workspace layouts
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 3a52c8d: feature: Added support for the TabReordered event for Workspace and WorkspaceWindow tabs
|
|
2
16
|
|
|
3
17
|
## 4.3.0
|
|
4
18
|
|
|
@@ -9,6 +23,7 @@
|
|
|
9
23
|
### Patch Changes
|
|
10
24
|
|
|
11
25
|
- ff2a338: chore: prerelease 4.3 snapshot
|
|
26
|
+
4.2.1
|
|
12
27
|
chore: G4E-10143 Changed the timeout for the showDialog method
|
|
13
28
|
feat: G4E-9244 Added option to blur the Frame instance that has displayed the dialog
|
|
14
29
|
4.2.0
|
package/dist/workspaces.es.js
CHANGED
|
@@ -1143,7 +1143,7 @@ const streamRequestArgumentsDecoder = object({
|
|
|
1143
1143
|
type: eventTypeDecoder,
|
|
1144
1144
|
branch: nonEmptyStringDecoder
|
|
1145
1145
|
});
|
|
1146
|
-
const workspaceEventActionDecoder = oneOf(constant("opened"), constant("closing"), constant("closed"), constant("focus"), constant("added"), constant("loaded"), constant("removed"), constant("childrenUpdate"), constant("containerChange"), constant("maximized"), constant("restored"), constant("minimized"), constant("normal"), constant("selected"), constant("lock-configuration-changed"), constant("hibernated"), constant("resumed"));
|
|
1146
|
+
const workspaceEventActionDecoder = oneOf(constant("opened"), constant("closing"), constant("closed"), constant("focus"), constant("added"), constant("loaded"), constant("removed"), constant("childrenUpdate"), constant("containerChange"), constant("maximized"), constant("restored"), constant("minimized"), constant("normal"), constant("selected"), constant("lock-configuration-changed"), constant("hibernated"), constant("resumed"), constant("tab-reordered"));
|
|
1147
1147
|
const workspaceConfigResultDecoder = object({
|
|
1148
1148
|
frameId: nonEmptyStringDecoder,
|
|
1149
1149
|
title: nonEmptyStringDecoder,
|
|
@@ -1439,7 +1439,14 @@ const workspaceLayoutSaveConfigDecoder = object({
|
|
|
1439
1439
|
workspaceId: nonEmptyStringDecoder,
|
|
1440
1440
|
saveContext: optional(boolean()),
|
|
1441
1441
|
allowMultiple: optional(boolean()),
|
|
1442
|
-
metadata: optional(object())
|
|
1442
|
+
metadata: optional(object()),
|
|
1443
|
+
saveWindowContexts: optional(boolean())
|
|
1444
|
+
});
|
|
1445
|
+
const saveLayoutConfigDecoder = object({
|
|
1446
|
+
saveContext: optional(boolean()),
|
|
1447
|
+
allowMultiple: optional(boolean()),
|
|
1448
|
+
metadata: optional(object()),
|
|
1449
|
+
saveWindowContexts: optional(boolean())
|
|
1443
1450
|
});
|
|
1444
1451
|
const workspaceLockConfigDecoder = object({
|
|
1445
1452
|
allowDrop: optional(boolean()),
|
|
@@ -1623,6 +1630,13 @@ const showFrameDialogConfigDecoder = object({
|
|
|
1623
1630
|
frameId: nonEmptyStringDecoder,
|
|
1624
1631
|
options: frameDialogOptionsDecoder
|
|
1625
1632
|
});
|
|
1633
|
+
const frameSetOnTopOptionsDecoder = object({
|
|
1634
|
+
onTop: boolean()
|
|
1635
|
+
});
|
|
1636
|
+
const setFrameOnTopConfigDecoder = object({
|
|
1637
|
+
frameId: nonEmptyStringDecoder,
|
|
1638
|
+
onTop: boolean()
|
|
1639
|
+
});
|
|
1626
1640
|
|
|
1627
1641
|
const webPlatformMethodName = "T42.Web.Platform.Control";
|
|
1628
1642
|
const webPlatformWspStreamName = "T42.Web.Platform.WSP.Stream";
|
|
@@ -1706,7 +1720,8 @@ const OPERATIONS = {
|
|
|
1706
1720
|
showPopup: { name: "showPopup", argsDecoder: ShowPopupConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1707
1721
|
changeFrameVisibility: { name: "changeFrameVisibility", argsDecoder: changeFrameVisibilityConfigDecoder, resultDecoder: voidResultDecoder },
|
|
1708
1722
|
getFrameVisibility: { name: "getFrameVisibility", argsDecoder: simpleItemConfigDecoder, resultDecoder: frameVisibilityResultDecoder },
|
|
1709
|
-
showFrameDialog: { name: "showFrameDialog", argsDecoder: showFrameDialogConfigDecoder, resultDecoder: anyJson() }
|
|
1723
|
+
showFrameDialog: { name: "showFrameDialog", argsDecoder: showFrameDialogConfigDecoder, resultDecoder: anyJson() },
|
|
1724
|
+
setFrameOnTop: { name: "setFrameOnTop", argsDecoder: setFrameOnTopConfigDecoder, resultDecoder: voidResultDecoder }
|
|
1710
1725
|
};
|
|
1711
1726
|
|
|
1712
1727
|
class PromiseWrapper {
|
|
@@ -2860,7 +2875,10 @@ class Workspace {
|
|
|
2860
2875
|
}
|
|
2861
2876
|
async saveLayout(name, config) {
|
|
2862
2877
|
nonEmptyStringDecoder.runWithException(name);
|
|
2863
|
-
|
|
2878
|
+
if (config) {
|
|
2879
|
+
saveLayoutConfigDecoder.runWithException(config);
|
|
2880
|
+
}
|
|
2881
|
+
await getData$3(this).controller.saveLayout({ name, workspaceId: this.id, saveContext: config?.saveContext, metadata: config?.metadata, allowMultiple: config?.allowMultiple, saveWindowContexts: config?.saveWindowContexts });
|
|
2864
2882
|
}
|
|
2865
2883
|
async setTitle(title) {
|
|
2866
2884
|
nonEmptyStringDecoder.runWithException(title);
|
|
@@ -3123,6 +3141,57 @@ class Workspace {
|
|
|
3123
3141
|
const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
|
|
3124
3142
|
return unsubscribe;
|
|
3125
3143
|
}
|
|
3144
|
+
async onLockConfigurationChanged(callback) {
|
|
3145
|
+
checkThrowCallback(callback);
|
|
3146
|
+
const id = getData$3(this).id;
|
|
3147
|
+
const wrappedCallback = async () => {
|
|
3148
|
+
await this.refreshReference();
|
|
3149
|
+
callback({
|
|
3150
|
+
allowDrop: this.allowDrop,
|
|
3151
|
+
allowDropLeft: this.allowDropLeft,
|
|
3152
|
+
allowDropTop: this.allowDropTop,
|
|
3153
|
+
allowDropRight: this.allowDropRight,
|
|
3154
|
+
allowDropBottom: this.allowDropBottom,
|
|
3155
|
+
allowSystemHibernation: this.allowSystemHibernation,
|
|
3156
|
+
allowExtract: this.allowExtract,
|
|
3157
|
+
allowSplitters: this.allowSplitters,
|
|
3158
|
+
allowWindowReorder: this.allowWindowReorder,
|
|
3159
|
+
allowWorkspaceTabExtract: this.allowWorkspaceTabExtract,
|
|
3160
|
+
allowWorkspaceTabReorder: this.allowWorkspaceTabReorder,
|
|
3161
|
+
showAddWindowButtons: this.showAddWindowButtons,
|
|
3162
|
+
showCloseButton: this.showCloseButton,
|
|
3163
|
+
showEjectButtons: this.showEjectButtons,
|
|
3164
|
+
showSaveButton: this.showSaveButton,
|
|
3165
|
+
showWindowCloseButtons: this.showWindowCloseButtons
|
|
3166
|
+
});
|
|
3167
|
+
};
|
|
3168
|
+
const config = {
|
|
3169
|
+
action: "lock-configuration-changed",
|
|
3170
|
+
eventType: "workspace",
|
|
3171
|
+
scope: "workspace",
|
|
3172
|
+
scopeId: id,
|
|
3173
|
+
callback: wrappedCallback
|
|
3174
|
+
};
|
|
3175
|
+
const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
|
|
3176
|
+
return unsubscribe;
|
|
3177
|
+
}
|
|
3178
|
+
async onTabReordered(callback) {
|
|
3179
|
+
checkThrowCallback(callback);
|
|
3180
|
+
const id = getData$3(this).id;
|
|
3181
|
+
const wrappedCallback = async () => {
|
|
3182
|
+
await this.refreshReference();
|
|
3183
|
+
callback();
|
|
3184
|
+
};
|
|
3185
|
+
const config = {
|
|
3186
|
+
action: "tab-reordered",
|
|
3187
|
+
eventType: "workspace",
|
|
3188
|
+
scope: "workspace",
|
|
3189
|
+
scopeId: id,
|
|
3190
|
+
callback: wrappedCallback
|
|
3191
|
+
};
|
|
3192
|
+
const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
|
|
3193
|
+
return unsubscribe;
|
|
3194
|
+
}
|
|
3126
3195
|
async onWindowAdded(callback) {
|
|
3127
3196
|
checkThrowCallback(callback);
|
|
3128
3197
|
const id = getData$3(this).id;
|
|
@@ -3245,33 +3314,20 @@ class Workspace {
|
|
|
3245
3314
|
const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
|
|
3246
3315
|
return unsubscribe;
|
|
3247
3316
|
}
|
|
3248
|
-
async
|
|
3317
|
+
async onWindowTabReordered(callback) {
|
|
3249
3318
|
checkThrowCallback(callback);
|
|
3250
3319
|
const id = getData$3(this).id;
|
|
3251
|
-
const wrappedCallback = async () => {
|
|
3320
|
+
const wrappedCallback = async (payload) => {
|
|
3252
3321
|
await this.refreshReference();
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
allowDropTop: this.allowDropTop,
|
|
3257
|
-
allowDropRight: this.allowDropRight,
|
|
3258
|
-
allowDropBottom: this.allowDropBottom,
|
|
3259
|
-
allowSystemHibernation: this.allowSystemHibernation,
|
|
3260
|
-
allowExtract: this.allowExtract,
|
|
3261
|
-
allowSplitters: this.allowSplitters,
|
|
3262
|
-
allowWindowReorder: this.allowWindowReorder,
|
|
3263
|
-
allowWorkspaceTabExtract: this.allowWorkspaceTabExtract,
|
|
3264
|
-
allowWorkspaceTabReorder: this.allowWorkspaceTabReorder,
|
|
3265
|
-
showAddWindowButtons: this.showAddWindowButtons,
|
|
3266
|
-
showCloseButton: this.showCloseButton,
|
|
3267
|
-
showEjectButtons: this.showEjectButtons,
|
|
3268
|
-
showSaveButton: this.showSaveButton,
|
|
3269
|
-
showWindowCloseButtons: this.showWindowCloseButtons
|
|
3322
|
+
const windowParent = this.getBox((parent) => parent.id === payload.windowSummary.parentId);
|
|
3323
|
+
const foundWindow = windowParent.children.find((child) => {
|
|
3324
|
+
return child.type === "window" && child.elementId === payload.windowSummary.itemId;
|
|
3270
3325
|
});
|
|
3326
|
+
callback(foundWindow);
|
|
3271
3327
|
};
|
|
3272
3328
|
const config = {
|
|
3273
|
-
action: "
|
|
3274
|
-
eventType: "
|
|
3329
|
+
action: "tab-reordered",
|
|
3330
|
+
eventType: "window",
|
|
3275
3331
|
scope: "workspace",
|
|
3276
3332
|
scopeId: id,
|
|
3277
3333
|
callback: wrappedCallback
|
|
@@ -3505,6 +3561,22 @@ class Window {
|
|
|
3505
3561
|
const unsubscribe = await getData$2(this).controller.processLocalSubscription(config, id);
|
|
3506
3562
|
return unsubscribe;
|
|
3507
3563
|
}
|
|
3564
|
+
async onTabReordered(callback) {
|
|
3565
|
+
checkThrowCallback(callback);
|
|
3566
|
+
const id = getData$2(this).id;
|
|
3567
|
+
const wrappedCallback = async () => {
|
|
3568
|
+
await this.workspace.refreshReference();
|
|
3569
|
+
callback();
|
|
3570
|
+
};
|
|
3571
|
+
const config = {
|
|
3572
|
+
callback: wrappedCallback,
|
|
3573
|
+
action: "tab-reordered",
|
|
3574
|
+
eventType: "window",
|
|
3575
|
+
scope: "window"
|
|
3576
|
+
};
|
|
3577
|
+
const unsubscribe = await getData$2(this).controller.processLocalSubscription(config, id);
|
|
3578
|
+
return unsubscribe;
|
|
3579
|
+
}
|
|
3508
3580
|
}
|
|
3509
3581
|
|
|
3510
3582
|
const data$1 = new WeakMap();
|
|
@@ -3660,6 +3732,13 @@ class Frame {
|
|
|
3660
3732
|
frameDialogOptionsDecoder.runWithException(options);
|
|
3661
3733
|
return getData$1(this).controller.showFrameDialog(this.id, options);
|
|
3662
3734
|
}
|
|
3735
|
+
async setOnTop(options) {
|
|
3736
|
+
if (!isDesktop()) {
|
|
3737
|
+
throw new Error("The setOnTop operation is not supported in IO Connect Browser");
|
|
3738
|
+
}
|
|
3739
|
+
frameSetOnTopOptionsDecoder.runWithException(options);
|
|
3740
|
+
return getData$1(this).controller.setFrameOnTop(this.id, options);
|
|
3741
|
+
}
|
|
3663
3742
|
async onClosing(callback) {
|
|
3664
3743
|
if (!isDesktop()) {
|
|
3665
3744
|
throw new Error("Frame closing operations are not supported in io.Connect Browser");
|
|
@@ -4600,6 +4679,9 @@ class BaseController {
|
|
|
4600
4679
|
const result = await this.bridge.send(OPERATIONS.showFrameDialog.name, { frameId, options }, { timeout: ONE_DAY_MS });
|
|
4601
4680
|
return result;
|
|
4602
4681
|
}
|
|
4682
|
+
async setFrameOnTop(frameId, options) {
|
|
4683
|
+
return this.bridge.send(OPERATIONS.setFrameOnTop.name, { frameId, onTop: options.onTop });
|
|
4684
|
+
}
|
|
4603
4685
|
async isOperationSupported(operation) {
|
|
4604
4686
|
if (isDesktop()) {
|
|
4605
4687
|
return { isSupported: true };
|
|
@@ -4975,6 +5057,9 @@ class MainController {
|
|
|
4975
5057
|
async showFrameDialog(frameId, options) {
|
|
4976
5058
|
return this.base.showFrameDialog(frameId, options);
|
|
4977
5059
|
}
|
|
5060
|
+
async setFrameOnTop(frameId, options) {
|
|
5061
|
+
return this.base.setFrameOnTop(frameId, options);
|
|
5062
|
+
}
|
|
4978
5063
|
async handleCoreLocalSubscription(config, levelId) {
|
|
4979
5064
|
await this.bridge.createCoreEventSubscription();
|
|
4980
5065
|
config.scopeId = config.scopeId || levelId;
|
|
@@ -5279,7 +5364,7 @@ class IoC {
|
|
|
5279
5364
|
}
|
|
5280
5365
|
}
|
|
5281
5366
|
|
|
5282
|
-
var version = "4.
|
|
5367
|
+
var version = "4.5.0-next.1";
|
|
5283
5368
|
|
|
5284
5369
|
const composeAPI = (glue, ioc) => {
|
|
5285
5370
|
const controller = ioc.controller;
|
|
@@ -5448,6 +5533,15 @@ const composeAPI = (glue, ioc) => {
|
|
|
5448
5533
|
const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "workspace", "resumed");
|
|
5449
5534
|
return unsubscribe;
|
|
5450
5535
|
};
|
|
5536
|
+
const onWorkspaceTabReordered = async (callback) => {
|
|
5537
|
+
checkThrowCallback(callback);
|
|
5538
|
+
const wrappedCallback = async (payload) => {
|
|
5539
|
+
const workspace = await controller.transformStreamPayloadToWorkspace(payload);
|
|
5540
|
+
callback(workspace);
|
|
5541
|
+
};
|
|
5542
|
+
const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "workspace", "tab-reordered");
|
|
5543
|
+
return unsubscribe;
|
|
5544
|
+
};
|
|
5451
5545
|
const onWindowAdded = async (callback) => {
|
|
5452
5546
|
checkThrowCallback(callback);
|
|
5453
5547
|
const wrappedCallback = async (payload) => {
|
|
@@ -5541,6 +5635,23 @@ const composeAPI = (glue, ioc) => {
|
|
|
5541
5635
|
const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "window", "selected");
|
|
5542
5636
|
return unsubscribe;
|
|
5543
5637
|
};
|
|
5638
|
+
const onWindowTabReordered = async (callback) => {
|
|
5639
|
+
checkThrowCallback(callback);
|
|
5640
|
+
const wrappedCallback = async (payload) => {
|
|
5641
|
+
const snapshot = (await controller.getSnapshot(payload.windowSummary.config.workspaceId, "workspace"));
|
|
5642
|
+
const frameConfig = {
|
|
5643
|
+
summary: snapshot.frameSummary
|
|
5644
|
+
};
|
|
5645
|
+
const frame = ioc.getModel("frame", frameConfig);
|
|
5646
|
+
const workspaceConfig = { frame, snapshot };
|
|
5647
|
+
const workspace = ioc.getModel("workspace", workspaceConfig);
|
|
5648
|
+
const windowParent = workspace.getBox((parent) => parent.id === payload.windowSummary.parentId);
|
|
5649
|
+
const foundWindow = windowParent.children.find((child) => child.type === "window" && child.elementId === payload.windowSummary.itemId);
|
|
5650
|
+
callback(foundWindow);
|
|
5651
|
+
};
|
|
5652
|
+
const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "window", "tab-reordered");
|
|
5653
|
+
return unsubscribe;
|
|
5654
|
+
};
|
|
5544
5655
|
const waitForFrame = async (id) => {
|
|
5545
5656
|
nonEmptyStringDecoder.runWithException(id);
|
|
5546
5657
|
return new Promise((res, rej) => {
|
|
@@ -5587,6 +5698,8 @@ const composeAPI = (glue, ioc) => {
|
|
|
5587
5698
|
onWorkspaceClosed,
|
|
5588
5699
|
onWorkspaceHibernated,
|
|
5589
5700
|
onWorkspaceResumed,
|
|
5701
|
+
onWorkspaceTabReordered,
|
|
5702
|
+
onWindowTabReordered,
|
|
5590
5703
|
onWindowAdded,
|
|
5591
5704
|
onWindowLoaded,
|
|
5592
5705
|
onWindowRemoved,
|