@interopio/workspaces-api 3.5.0 → 3.5.2

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 CHANGED
@@ -1,3 +1,7 @@
1
+ 3.5.2
2
+ feat: drag applications contained within workspace
3
+ 3.5.1
4
+ chore: Added the defaults in the WorkspaceConfig interface
1
5
  3.5.0
2
6
  chore: io.CB 3.5 bump
3
7
  3.4.3
@@ -906,6 +906,7 @@ var lazy = Decoder.lazy;
906
906
  const nonEmptyStringDecoder = string().where((s) => s.length > 0, "Expected a non-empty string");
907
907
  const nonNegativeNumberDecoder = number().where((num) => num >= 0, "Expected a non-negative number");
908
908
  const positiveNumberDecoder = number().where((num) => num > 0, "Expected a positive number");
909
+ const windowDragModeDecoder = oneOf(constant("keepInside"), constant("autoEject"));
909
910
  const isWindowInSwimlaneResultDecoder = object({
910
911
  inWorkspace: boolean()
911
912
  });
@@ -1068,7 +1069,8 @@ const workspaceDefinitionDecoder = object({
1068
1069
  icon: optional(nonEmptyStringDecoder),
1069
1070
  isPinned: optional(boolean()),
1070
1071
  isSelected: optional(boolean()),
1071
- positionIndex: optional(nonNegativeNumberDecoder)
1072
+ positionIndex: optional(nonNegativeNumberDecoder),
1073
+ windowDragMode: optional(windowDragModeDecoder)
1072
1074
  })),
1073
1075
  frame: optional(object({
1074
1076
  activate: optional(boolean()),
@@ -1162,6 +1164,7 @@ const workspaceConfigResultDecoder = object({
1162
1164
  widthInPx: optional(number()),
1163
1165
  heightInPx: optional(number()),
1164
1166
  isPinned: optional(boolean()),
1167
+ windowDragMode: optional(windowDragModeDecoder)
1165
1168
  });
1166
1169
  const baseChildSnapshotConfigDecoder = object({
1167
1170
  frameId: nonEmptyStringDecoder,
@@ -1517,6 +1520,10 @@ const loadingAnimationConfigDecoder = object({
1517
1520
  const operationCheckConfigDecoder = object({
1518
1521
  operation: nonEmptyStringDecoder
1519
1522
  });
1523
+ const setWindowDragModeDecoder = object({
1524
+ itemId: nonEmptyStringDecoder,
1525
+ dragMode: windowDragModeDecoder
1526
+ });
1520
1527
 
1521
1528
  const webPlatformMethodName = "T42.Web.Platform.Control";
1522
1529
  const webPlatformWspStreamName = "T42.Web.Platform.WSP.Stream";
@@ -1590,6 +1597,7 @@ const OPERATIONS = {
1590
1597
  hideLoadingAnimation: { name: "hideLoadingAnimation", argsDecoder: loadingAnimationConfigDecoder, resultDecoder: voidResultDecoder },
1591
1598
  getPlatformFrameId: { name: "getPlatformFrameId", resultDecoder: getPlatformFrameIdResultDecoder },
1592
1599
  operationCheck: { name: "operationCheck", argsDecoder: operationCheckConfigDecoder, resultDecoder: operationCheckResultDecoder },
1600
+ setWindowDragMode: { name: "setWindowDragMode", argsDecoder: setWindowDragModeDecoder, resultDecoder: voidResultDecoder }
1593
1601
  };
1594
1602
 
1595
1603
  class PromiseWrapper {
@@ -2554,6 +2562,8 @@ class Group {
2554
2562
  }
2555
2563
  }
2556
2564
 
2565
+ const DEFAULT_WINDOW_DRAG_MODE = "keepInside";
2566
+
2557
2567
  const data$3 = new WeakMap();
2558
2568
  const getData$3 = (model) => {
2559
2569
  return data$3.get(model).manager.getWorkspaceData(model);
@@ -2661,6 +2671,13 @@ class Workspace {
2661
2671
  get isPinned() {
2662
2672
  return getData$3(this).config.isPinned;
2663
2673
  }
2674
+ get windowDragMode() {
2675
+ const desktopGlobal = isDesktop();
2676
+ if (!desktopGlobal) {
2677
+ return DEFAULT_WINDOW_DRAG_MODE;
2678
+ }
2679
+ return getData$3(this).config.windowDragMode;
2680
+ }
2664
2681
  async removeChild(predicate) {
2665
2682
  checkThrowCallback(predicate);
2666
2683
  const child = this.children.find(predicate);
@@ -2902,6 +2919,15 @@ class Workspace {
2902
2919
  }
2903
2920
  await getData$3(this).controller.hideWorkspaceLoadingAnimation(this.id);
2904
2921
  }
2922
+ async setWindowDragMode(mode) {
2923
+ const desktopGlobal = isDesktop();
2924
+ if (!desktopGlobal) {
2925
+ throw new Error("Not supported in IO Connect Browser");
2926
+ }
2927
+ windowDragModeDecoder.runWithException(mode);
2928
+ await getData$3(this).controller.setWindowDragMode(this.id, mode);
2929
+ await this.refreshReference();
2930
+ }
2905
2931
  async onClosed(callback) {
2906
2932
  checkThrowCallback(callback);
2907
2933
  const id = getData$3(this).id;
@@ -4161,6 +4187,9 @@ class BaseController {
4161
4187
  async hideWorkspaceLoadingAnimation(workspaceId) {
4162
4188
  await this.bridge.send(OPERATIONS.hideLoadingAnimation.name, { itemId: workspaceId, type: "workspace" });
4163
4189
  }
4190
+ async setWindowDragMode(workspaceId, dragMode) {
4191
+ await this.bridge.send(OPERATIONS.setWindowDragMode.name, { itemId: workspaceId, dragMode });
4192
+ }
4164
4193
  async moveFrame(itemId, config) {
4165
4194
  await this.bridge.send(OPERATIONS.moveFrame.name, Object.assign({}, { itemId }, config));
4166
4195
  }
@@ -4558,6 +4587,9 @@ class MainController {
4558
4587
  async hideWorkspaceLoadingAnimation(workspaceId) {
4559
4588
  return await this.base.hideWorkspaceLoadingAnimation(workspaceId);
4560
4589
  }
4590
+ async setWindowDragMode(workspaceId, dragMode) {
4591
+ return await this.base.setWindowDragMode(workspaceId, dragMode);
4592
+ }
4561
4593
  async moveFrame(itemId, config) {
4562
4594
  return await this.base.moveFrame(itemId, config);
4563
4595
  }
@@ -4902,7 +4934,7 @@ class IoC {
4902
4934
  }
4903
4935
  }
4904
4936
 
4905
- var version = "3.5.0";
4937
+ var version = "3.5.2";
4906
4938
 
4907
4939
  const composeAPI = (glue, ioc) => {
4908
4940
  const controller = ioc.controller;