@interopio/workspaces-api 4.1.3 → 4.1.5

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.
@@ -1564,15 +1564,41 @@
1564
1564
  const frameClosingResultDecoder = object({
1565
1565
  prevent: boolean()
1566
1566
  });
1567
+ const sizeDecoder = object({
1568
+ width: nonNegativeNumberDecoder,
1569
+ height: nonNegativeNumberDecoder
1570
+ });
1571
+ const boundsDecoder = object({
1572
+ left: number(),
1573
+ top: number(),
1574
+ width: nonNegativeNumberDecoder,
1575
+ height: nonNegativeNumberDecoder
1576
+ });
1577
+ const popupTargetLocationDecoder = oneOf(constant("none"), constant("left"), constant("right"), constant("top"), constant("bottom"));
1578
+ const popupConfigDecoder = object({
1579
+ size: sizeDecoder,
1580
+ targetBounds: boundsDecoder,
1581
+ targetLocation: popupTargetLocationDecoder,
1582
+ windowId: nonEmptyStringDecoder,
1583
+ horizontalOffset: optional(number()),
1584
+ verticalOffset: optional(number()),
1585
+ focus: optional(boolean()),
1586
+ });
1587
+ const ShowPopupConfigDecoder = object({
1588
+ frameId: nonEmptyStringDecoder,
1589
+ size: sizeDecoder,
1590
+ targetBounds: boundsDecoder,
1591
+ targetLocation: popupTargetLocationDecoder,
1592
+ windowId: nonEmptyStringDecoder,
1593
+ horizontalOffset: optional(number()),
1594
+ verticalOffset: optional(number()),
1595
+ focus: optional(boolean()),
1596
+ });
1567
1597
  const changeFrameVisibilityConfigDecoder = object({
1568
1598
  frameId: nonEmptyStringDecoder,
1569
1599
  activate: optional(boolean()),
1570
1600
  isVisible: boolean()
1571
1601
  });
1572
- const sizeDecoder = object({
1573
- width: positiveNumberDecoder,
1574
- height: positiveNumberDecoder
1575
- });
1576
1602
  const frameDialogOptionsDecoder = object({
1577
1603
  mode: optional(oneOf(constant("Global"), constant("WindowContainer"))),
1578
1604
  type: string(),
@@ -1681,6 +1707,7 @@
1681
1707
  getTaskbarIcon: { name: "getTaskbarIcon", resultDecoder: iconDecoder },
1682
1708
  setTaskbarIcon: { name: "setTaskbarIcon", argsDecoder: setIconArgumentsDecoder, resultDecoder: voidResultDecoder },
1683
1709
  subscribeToFrameClosing: { name: "subscribeToFrameClosing", argsDecoder: simpleItemConfigDecoder, resultDecoder: voidResultDecoder },
1710
+ showPopup: { name: "showPopup", argsDecoder: ShowPopupConfigDecoder, resultDecoder: voidResultDecoder },
1684
1711
  changeFrameVisibility: { name: "changeFrameVisibility", argsDecoder: changeFrameVisibilityConfigDecoder, resultDecoder: voidResultDecoder },
1685
1712
  getFrameVisibility: { name: "getFrameVisibility", argsDecoder: simpleItemConfigDecoder, resultDecoder: frameVisibilityResultDecoder },
1686
1713
  showFrameDialog: { name: "showFrameDialog", argsDecoder: showFrameDialogConfigDecoder, resultDecoder: anyJson() }
@@ -3607,6 +3634,15 @@
3607
3634
  }
3608
3635
  return getData$1(this).controller.initFrame(this.id, config);
3609
3636
  }
3637
+ async showPopup(config) {
3638
+ if (!isDesktop()) {
3639
+ throw new Error("Popup operations are not supported in IO Connect Browser");
3640
+ }
3641
+ const validatedConfig = popupConfigDecoder.runWithException(config);
3642
+ const controller = getData$1(this).controller;
3643
+ await controller.showPopup(validatedConfig, this.id);
3644
+ return controller.getGDWindow(validatedConfig.windowId);
3645
+ }
3610
3646
  async show(config) {
3611
3647
  if (!isDesktop()) {
3612
3648
  throw new Error("The show operation is not supported in IO Connect Browser");
@@ -4573,6 +4609,9 @@
4573
4609
  }
4574
4610
  return await this.bridge.send(OPERATIONS.operationCheck.name, { operation });
4575
4611
  }
4612
+ async showPopup(config, frameId) {
4613
+ return this.bridge.send(OPERATIONS.showPopup.name, { ...config, frameId });
4614
+ }
4576
4615
  }
4577
4616
 
4578
4617
  class MainController {
@@ -4924,6 +4963,9 @@
4924
4963
  registerFrameOnClosing(frameId, callback) {
4925
4964
  return this.closingController.registerFrameOnClosing(frameId, callback);
4926
4965
  }
4966
+ showPopup(config, frameId) {
4967
+ return this.base.showPopup(config, frameId);
4968
+ }
4927
4969
  async showFrame(frameId, config) {
4928
4970
  return this.base.showFrame(frameId, config);
4929
4971
  }
@@ -5240,7 +5282,7 @@
5240
5282
  }
5241
5283
  }
5242
5284
 
5243
- var version = "4.1.3";
5285
+ var version = "4.1.5";
5244
5286
 
5245
5287
  const composeAPI = (glue, ioc) => {
5246
5288
  const controller = ioc.controller;