@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.
@@ -1149,7 +1149,7 @@
1149
1149
  type: eventTypeDecoder,
1150
1150
  branch: nonEmptyStringDecoder
1151
1151
  });
1152
- 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"));
1152
+ 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"));
1153
1153
  const workspaceConfigResultDecoder = object({
1154
1154
  frameId: nonEmptyStringDecoder,
1155
1155
  title: nonEmptyStringDecoder,
@@ -1445,7 +1445,14 @@
1445
1445
  workspaceId: nonEmptyStringDecoder,
1446
1446
  saveContext: optional(boolean()),
1447
1447
  allowMultiple: optional(boolean()),
1448
- metadata: optional(object())
1448
+ metadata: optional(object()),
1449
+ saveWindowContexts: optional(boolean())
1450
+ });
1451
+ const saveLayoutConfigDecoder = object({
1452
+ saveContext: optional(boolean()),
1453
+ allowMultiple: optional(boolean()),
1454
+ metadata: optional(object()),
1455
+ saveWindowContexts: optional(boolean())
1449
1456
  });
1450
1457
  const workspaceLockConfigDecoder = object({
1451
1458
  allowDrop: optional(boolean()),
@@ -1629,6 +1636,13 @@
1629
1636
  frameId: nonEmptyStringDecoder,
1630
1637
  options: frameDialogOptionsDecoder
1631
1638
  });
1639
+ const frameSetOnTopOptionsDecoder = object({
1640
+ onTop: boolean()
1641
+ });
1642
+ const setFrameOnTopConfigDecoder = object({
1643
+ frameId: nonEmptyStringDecoder,
1644
+ onTop: boolean()
1645
+ });
1632
1646
 
1633
1647
  const webPlatformMethodName = "T42.Web.Platform.Control";
1634
1648
  const webPlatformWspStreamName = "T42.Web.Platform.WSP.Stream";
@@ -1712,7 +1726,8 @@
1712
1726
  showPopup: { name: "showPopup", argsDecoder: ShowPopupConfigDecoder, resultDecoder: voidResultDecoder },
1713
1727
  changeFrameVisibility: { name: "changeFrameVisibility", argsDecoder: changeFrameVisibilityConfigDecoder, resultDecoder: voidResultDecoder },
1714
1728
  getFrameVisibility: { name: "getFrameVisibility", argsDecoder: simpleItemConfigDecoder, resultDecoder: frameVisibilityResultDecoder },
1715
- showFrameDialog: { name: "showFrameDialog", argsDecoder: showFrameDialogConfigDecoder, resultDecoder: anyJson() }
1729
+ showFrameDialog: { name: "showFrameDialog", argsDecoder: showFrameDialogConfigDecoder, resultDecoder: anyJson() },
1730
+ setFrameOnTop: { name: "setFrameOnTop", argsDecoder: setFrameOnTopConfigDecoder, resultDecoder: voidResultDecoder }
1716
1731
  };
1717
1732
 
1718
1733
  class PromiseWrapper {
@@ -2866,7 +2881,10 @@
2866
2881
  }
2867
2882
  async saveLayout(name, config) {
2868
2883
  nonEmptyStringDecoder.runWithException(name);
2869
- await getData$3(this).controller.saveLayout({ name, workspaceId: this.id, saveContext: config?.saveContext, metadata: config?.metadata, allowMultiple: config?.allowMultiple });
2884
+ if (config) {
2885
+ saveLayoutConfigDecoder.runWithException(config);
2886
+ }
2887
+ await getData$3(this).controller.saveLayout({ name, workspaceId: this.id, saveContext: config?.saveContext, metadata: config?.metadata, allowMultiple: config?.allowMultiple, saveWindowContexts: config?.saveWindowContexts });
2870
2888
  }
2871
2889
  async setTitle(title) {
2872
2890
  nonEmptyStringDecoder.runWithException(title);
@@ -3129,6 +3147,57 @@
3129
3147
  const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
3130
3148
  return unsubscribe;
3131
3149
  }
3150
+ async onLockConfigurationChanged(callback) {
3151
+ checkThrowCallback(callback);
3152
+ const id = getData$3(this).id;
3153
+ const wrappedCallback = async () => {
3154
+ await this.refreshReference();
3155
+ callback({
3156
+ allowDrop: this.allowDrop,
3157
+ allowDropLeft: this.allowDropLeft,
3158
+ allowDropTop: this.allowDropTop,
3159
+ allowDropRight: this.allowDropRight,
3160
+ allowDropBottom: this.allowDropBottom,
3161
+ allowSystemHibernation: this.allowSystemHibernation,
3162
+ allowExtract: this.allowExtract,
3163
+ allowSplitters: this.allowSplitters,
3164
+ allowWindowReorder: this.allowWindowReorder,
3165
+ allowWorkspaceTabExtract: this.allowWorkspaceTabExtract,
3166
+ allowWorkspaceTabReorder: this.allowWorkspaceTabReorder,
3167
+ showAddWindowButtons: this.showAddWindowButtons,
3168
+ showCloseButton: this.showCloseButton,
3169
+ showEjectButtons: this.showEjectButtons,
3170
+ showSaveButton: this.showSaveButton,
3171
+ showWindowCloseButtons: this.showWindowCloseButtons
3172
+ });
3173
+ };
3174
+ const config = {
3175
+ action: "lock-configuration-changed",
3176
+ eventType: "workspace",
3177
+ scope: "workspace",
3178
+ scopeId: id,
3179
+ callback: wrappedCallback
3180
+ };
3181
+ const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
3182
+ return unsubscribe;
3183
+ }
3184
+ async onTabReordered(callback) {
3185
+ checkThrowCallback(callback);
3186
+ const id = getData$3(this).id;
3187
+ const wrappedCallback = async () => {
3188
+ await this.refreshReference();
3189
+ callback();
3190
+ };
3191
+ const config = {
3192
+ action: "tab-reordered",
3193
+ eventType: "workspace",
3194
+ scope: "workspace",
3195
+ scopeId: id,
3196
+ callback: wrappedCallback
3197
+ };
3198
+ const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
3199
+ return unsubscribe;
3200
+ }
3132
3201
  async onWindowAdded(callback) {
3133
3202
  checkThrowCallback(callback);
3134
3203
  const id = getData$3(this).id;
@@ -3251,33 +3320,20 @@
3251
3320
  const unsubscribe = await getData$3(this).controller.processLocalSubscription(config, id);
3252
3321
  return unsubscribe;
3253
3322
  }
3254
- async onLockConfigurationChanged(callback) {
3323
+ async onWindowTabReordered(callback) {
3255
3324
  checkThrowCallback(callback);
3256
3325
  const id = getData$3(this).id;
3257
- const wrappedCallback = async () => {
3326
+ const wrappedCallback = async (payload) => {
3258
3327
  await this.refreshReference();
3259
- callback({
3260
- allowDrop: this.allowDrop,
3261
- allowDropLeft: this.allowDropLeft,
3262
- allowDropTop: this.allowDropTop,
3263
- allowDropRight: this.allowDropRight,
3264
- allowDropBottom: this.allowDropBottom,
3265
- allowSystemHibernation: this.allowSystemHibernation,
3266
- allowExtract: this.allowExtract,
3267
- allowSplitters: this.allowSplitters,
3268
- allowWindowReorder: this.allowWindowReorder,
3269
- allowWorkspaceTabExtract: this.allowWorkspaceTabExtract,
3270
- allowWorkspaceTabReorder: this.allowWorkspaceTabReorder,
3271
- showAddWindowButtons: this.showAddWindowButtons,
3272
- showCloseButton: this.showCloseButton,
3273
- showEjectButtons: this.showEjectButtons,
3274
- showSaveButton: this.showSaveButton,
3275
- showWindowCloseButtons: this.showWindowCloseButtons
3328
+ const windowParent = this.getBox((parent) => parent.id === payload.windowSummary.parentId);
3329
+ const foundWindow = windowParent.children.find((child) => {
3330
+ return child.type === "window" && child.elementId === payload.windowSummary.itemId;
3276
3331
  });
3332
+ callback(foundWindow);
3277
3333
  };
3278
3334
  const config = {
3279
- action: "lock-configuration-changed",
3280
- eventType: "workspace",
3335
+ action: "tab-reordered",
3336
+ eventType: "window",
3281
3337
  scope: "workspace",
3282
3338
  scopeId: id,
3283
3339
  callback: wrappedCallback
@@ -3511,6 +3567,22 @@
3511
3567
  const unsubscribe = await getData$2(this).controller.processLocalSubscription(config, id);
3512
3568
  return unsubscribe;
3513
3569
  }
3570
+ async onTabReordered(callback) {
3571
+ checkThrowCallback(callback);
3572
+ const id = getData$2(this).id;
3573
+ const wrappedCallback = async () => {
3574
+ await this.workspace.refreshReference();
3575
+ callback();
3576
+ };
3577
+ const config = {
3578
+ callback: wrappedCallback,
3579
+ action: "tab-reordered",
3580
+ eventType: "window",
3581
+ scope: "window"
3582
+ };
3583
+ const unsubscribe = await getData$2(this).controller.processLocalSubscription(config, id);
3584
+ return unsubscribe;
3585
+ }
3514
3586
  }
3515
3587
 
3516
3588
  const data$1 = new WeakMap();
@@ -3666,6 +3738,13 @@
3666
3738
  frameDialogOptionsDecoder.runWithException(options);
3667
3739
  return getData$1(this).controller.showFrameDialog(this.id, options);
3668
3740
  }
3741
+ async setOnTop(options) {
3742
+ if (!isDesktop()) {
3743
+ throw new Error("The setOnTop operation is not supported in IO Connect Browser");
3744
+ }
3745
+ frameSetOnTopOptionsDecoder.runWithException(options);
3746
+ return getData$1(this).controller.setFrameOnTop(this.id, options);
3747
+ }
3669
3748
  async onClosing(callback) {
3670
3749
  if (!isDesktop()) {
3671
3750
  throw new Error("Frame closing operations are not supported in io.Connect Browser");
@@ -4606,6 +4685,9 @@
4606
4685
  const result = await this.bridge.send(OPERATIONS.showFrameDialog.name, { frameId, options }, { timeout: ONE_DAY_MS });
4607
4686
  return result;
4608
4687
  }
4688
+ async setFrameOnTop(frameId, options) {
4689
+ return this.bridge.send(OPERATIONS.setFrameOnTop.name, { frameId, onTop: options.onTop });
4690
+ }
4609
4691
  async isOperationSupported(operation) {
4610
4692
  if (isDesktop()) {
4611
4693
  return { isSupported: true };
@@ -4981,6 +5063,9 @@
4981
5063
  async showFrameDialog(frameId, options) {
4982
5064
  return this.base.showFrameDialog(frameId, options);
4983
5065
  }
5066
+ async setFrameOnTop(frameId, options) {
5067
+ return this.base.setFrameOnTop(frameId, options);
5068
+ }
4984
5069
  async handleCoreLocalSubscription(config, levelId) {
4985
5070
  await this.bridge.createCoreEventSubscription();
4986
5071
  config.scopeId = config.scopeId || levelId;
@@ -5285,7 +5370,7 @@
5285
5370
  }
5286
5371
  }
5287
5372
 
5288
- var version = "4.3.0";
5373
+ var version = "4.5.0-next.1";
5289
5374
 
5290
5375
  const composeAPI = (glue, ioc) => {
5291
5376
  const controller = ioc.controller;
@@ -5454,6 +5539,15 @@
5454
5539
  const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "workspace", "resumed");
5455
5540
  return unsubscribe;
5456
5541
  };
5542
+ const onWorkspaceTabReordered = async (callback) => {
5543
+ checkThrowCallback(callback);
5544
+ const wrappedCallback = async (payload) => {
5545
+ const workspace = await controller.transformStreamPayloadToWorkspace(payload);
5546
+ callback(workspace);
5547
+ };
5548
+ const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "workspace", "tab-reordered");
5549
+ return unsubscribe;
5550
+ };
5457
5551
  const onWindowAdded = async (callback) => {
5458
5552
  checkThrowCallback(callback);
5459
5553
  const wrappedCallback = async (payload) => {
@@ -5547,6 +5641,23 @@
5547
5641
  const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "window", "selected");
5548
5642
  return unsubscribe;
5549
5643
  };
5644
+ const onWindowTabReordered = async (callback) => {
5645
+ checkThrowCallback(callback);
5646
+ const wrappedCallback = async (payload) => {
5647
+ const snapshot = (await controller.getSnapshot(payload.windowSummary.config.workspaceId, "workspace"));
5648
+ const frameConfig = {
5649
+ summary: snapshot.frameSummary
5650
+ };
5651
+ const frame = ioc.getModel("frame", frameConfig);
5652
+ const workspaceConfig = { frame, snapshot };
5653
+ const workspace = ioc.getModel("workspace", workspaceConfig);
5654
+ const windowParent = workspace.getBox((parent) => parent.id === payload.windowSummary.parentId);
5655
+ const foundWindow = windowParent.children.find((child) => child.type === "window" && child.elementId === payload.windowSummary.itemId);
5656
+ callback(foundWindow);
5657
+ };
5658
+ const unsubscribe = await controller.processGlobalSubscription(wrappedCallback, "window", "tab-reordered");
5659
+ return unsubscribe;
5660
+ };
5550
5661
  const waitForFrame = async (id) => {
5551
5662
  nonEmptyStringDecoder.runWithException(id);
5552
5663
  return new Promise((res, rej) => {
@@ -5593,6 +5704,8 @@
5593
5704
  onWorkspaceClosed,
5594
5705
  onWorkspaceHibernated,
5595
5706
  onWorkspaceResumed,
5707
+ onWorkspaceTabReordered,
5708
+ onWindowTabReordered,
5596
5709
  onWindowAdded,
5597
5710
  onWindowLoaded,
5598
5711
  onWindowRemoved,