@interopio/desktop 6.13.0 → 6.14.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.
@@ -11702,6 +11702,9 @@
11702
11702
  height: a.height
11703
11703
  };
11704
11704
  }
11705
+ static isRunningInIoCdContext() {
11706
+ return typeof window !== "undefined" && (window.glue42gd || window.iodesktop);
11707
+ }
11705
11708
  static isNode() {
11706
11709
  if (typeof Utils._isNode !== "undefined") {
11707
11710
  return Utils._isNode;
@@ -12689,24 +12692,23 @@
12689
12692
  .forEach((item) => entitlements.handleBranchesModified(item));
12690
12693
  if (!initiated) {
12691
12694
  initiated = true;
12692
- const hasMyAppInSnapShot = onApplicationAddedEventArgs.some((a) => a.Name === agm.instance.application);
12693
- const hasMyInstanceInSnapShot = onApplicationStartedEventArgs.some((i) => i.Id === agm.instance.instance);
12694
- if (hasMyAppInSnapShot) {
12695
- if (hasMyInstanceInSnapShot) {
12696
- resolveFunc(configuration);
12697
- }
12698
- else {
12699
- const un = applications.onInstanceStarted((i) => {
12700
- if (i.id === agm.instance.instance) {
12701
- un();
12702
- resolveFunc(configuration);
12703
- }
12704
- });
12705
- }
12706
- }
12707
- else {
12695
+ const myInstance = agm.instance;
12696
+ const hasMyAppInSnapShot = onApplicationAddedEventArgs.some((a) => a.Name === myInstance.application);
12697
+ const hasMyInstanceInSnapShot = onApplicationStartedEventArgs.some((i) => i.Id === myInstance.instance);
12698
+ if (!hasMyAppInSnapShot) {
12708
12699
  resolveFunc(configuration);
12700
+ return;
12701
+ }
12702
+ if (!hasMyInstanceInSnapShot && (Utils.isNode() || Utils.isRunningInIoCdContext())) {
12703
+ const un = applications.onInstanceStarted((i) => {
12704
+ if (i.id === myInstance.instance) {
12705
+ un();
12706
+ resolveFunc(configuration);
12707
+ }
12708
+ });
12709
+ return;
12709
12710
  }
12711
+ resolveFunc(configuration);
12710
12712
  }
12711
12713
  });
12712
12714
  subscription.onFailed((err) => rejectFunc(err));
@@ -13511,6 +13513,9 @@
13511
13513
  return executor.snap(resultWindow, target, direction);
13512
13514
  }, success, error);
13513
13515
  }
13516
+ function dragMove(dragMoveSettings) {
13517
+ return executor.dragMove(resultWindow, dragMoveSettings);
13518
+ }
13514
13519
  function attachTab(tab, opt, success, error) {
13515
13520
  return Utils.callbackifyPromise(() => {
13516
13521
  var _a;
@@ -13740,6 +13745,9 @@
13740
13745
  function place(placementSettings) {
13741
13746
  return executor.place(resultWindow, placementSettings);
13742
13747
  }
13748
+ function clearPlacement(clearPlacementSettings) {
13749
+ return executor.clearPlacement(resultWindow, clearPlacementSettings);
13750
+ }
13743
13751
  function refresh(ignoreCache) {
13744
13752
  return executor.refresh(resultWindow, ignoreCache);
13745
13753
  }
@@ -14493,6 +14501,7 @@
14493
14501
  center,
14494
14502
  close,
14495
14503
  snap,
14504
+ dragMove,
14496
14505
  showLoader,
14497
14506
  hideLoader,
14498
14507
  updateContext,
@@ -14523,6 +14532,7 @@
14523
14532
  print,
14524
14533
  printToPDF,
14525
14534
  place,
14535
+ clearPlacement,
14526
14536
  ungroup,
14527
14537
  refresh,
14528
14538
  goBack,
@@ -15006,6 +15016,9 @@
15006
15016
  await this.execute("snap", { windowId: w.id, options: args }, "CompositionChanged", `CompositionChanged-${targetWindow.id}`);
15007
15017
  return w;
15008
15018
  }
15019
+ dragMove(window, options) {
15020
+ return this.execute("dragMove", { windowId: window.id, options });
15021
+ }
15009
15022
  async attachTab(w, sourceWindow, options) {
15010
15023
  await this.execute("attachTab", {
15011
15024
  windowId: w.id,
@@ -15266,6 +15279,9 @@
15266
15279
  }
15267
15280
  return this.execute("place", { windowId: window.id, options: { ...copy } });
15268
15281
  }
15282
+ async clearPlacement(window, options) {
15283
+ return this.execute("clearPlacement", { windowId: window.id, options });
15284
+ }
15269
15285
  async refresh(resultWindow, ignoreCache) {
15270
15286
  await this.execute("refresh", { windowId: resultWindow.id, options: { ignoreCache } });
15271
15287
  return resultWindow;
@@ -15412,6 +15428,8 @@
15412
15428
  }
15413
15429
  nonWindowHandlersCore(targetId, type, isGroup, callback) {
15414
15430
  const id = `${targetId}-${type}`;
15431
+ const noOperationHandler = () => {
15432
+ };
15415
15433
  const unsub = () => {
15416
15434
  var _a;
15417
15435
  if (this.unsubCallbacks[id]) {
@@ -15430,13 +15448,13 @@
15430
15448
  this.executeGroup(type, {
15431
15449
  groupId: targetId,
15432
15450
  options
15433
- });
15451
+ }).catch(noOperationHandler);
15434
15452
  }
15435
15453
  else {
15436
15454
  this.execute(type, {
15437
15455
  windowId: targetId,
15438
15456
  options
15439
- });
15457
+ }).catch(noOperationHandler);
15440
15458
  }
15441
15459
  }
15442
15460
  };
@@ -15448,10 +15466,10 @@
15448
15466
  this.unsubCallbacks[id] = [callback];
15449
15467
  }
15450
15468
  if (isGroup) {
15451
- this.executeGroup(type, { groupId: targetId });
15469
+ this.executeGroup(type, { groupId: targetId }).catch(noOperationHandler);
15452
15470
  }
15453
15471
  else {
15454
- this.execute(type, { windowId: targetId });
15472
+ this.execute(type, { windowId: targetId }).catch(noOperationHandler);
15455
15473
  }
15456
15474
  return unsub;
15457
15475
  }
@@ -16926,7 +16944,8 @@
16926
16944
  }
16927
16945
  registerRequestMethods() {
16928
16946
  this.interop.register(SaveContextMethodName, (args) => {
16929
- const usersCbs = this.callbacks.execute("saveRequested", args);
16947
+ const { ignoreContexts, ...cbArgs } = args;
16948
+ const usersCbs = this.callbacks.execute("saveRequested", cbArgs);
16930
16949
  if ((usersCbs === null || usersCbs === void 0 ? void 0 : usersCbs.length) > 1) {
16931
16950
  this.logger.warn(`Multiple subscriptions for "glue.layouts.onSaveRequested" - only the first one will be used`);
16932
16951
  }
@@ -16942,7 +16961,7 @@
16942
16961
  if (this.isActivityOwner()) {
16943
16962
  result.activityContext = requestResult === null || requestResult === void 0 ? void 0 : requestResult.activityContext;
16944
16963
  }
16945
- return result;
16964
+ return ignoreContexts ? { windowContext: undefined, activityContext: undefined } : result;
16946
16965
  });
16947
16966
  }
16948
16967
  }
@@ -17148,6 +17167,9 @@
17148
17167
  if (typeof layout.setAsCurrent === "boolean") {
17149
17168
  layoutObject.options.setAsCurrent = layout.setAsCurrent;
17150
17169
  }
17170
+ if (typeof layout.ignoreContexts === "boolean") {
17171
+ layoutObject.options.ignoreContexts = layout.ignoreContexts;
17172
+ }
17151
17173
  }
17152
17174
  else {
17153
17175
  return reject(new Error(`layout type ${layout.type} is not supported`));
@@ -17399,6 +17421,16 @@
17399
17421
  onChanged(callback) {
17400
17422
  return this.callbacks.add("changed", callback);
17401
17423
  }
17424
+ onDefaultGlobalChanged(callback) {
17425
+ if (typeof callback !== "function") {
17426
+ throw new Error("callback must be a function");
17427
+ }
17428
+ this.getDefaultGlobal()
17429
+ .then((layout) => callback(layout ? { name: layout.name } : undefined))
17430
+ .catch(() => {
17431
+ });
17432
+ return this.callbacks.add("default-changed", callback);
17433
+ }
17402
17434
  onRestored(callback) {
17403
17435
  return this.callbacks.add("restored", callback);
17404
17436
  }
@@ -17584,6 +17616,8 @@
17584
17616
  this.changeLayouts(transform(data.OnLayoutChanged));
17585
17617
  this.renameLayouts(transform(data.OnLayoutRenamed));
17586
17618
  this.restoredLayout(transform(data.OnLayoutRestored));
17619
+ this.selectedDefaultLayout(transform(data.OnLayoutSelectedDefault), false);
17620
+ this.selectedDefaultLayout(transform(data.OnLayoutDeselectedDefault), true);
17587
17621
  this.callbacks.execute("streamEvent", data);
17588
17622
  });
17589
17623
  subs.onFailed((err) => {
@@ -17618,7 +17652,7 @@
17618
17652
  });
17619
17653
  setTimeout(() => {
17620
17654
  if (!done) {
17621
- reject("timed out");
17655
+ reject(new Error(`Timeout waiting for token ${token}`));
17622
17656
  }
17623
17657
  }, timeout);
17624
17658
  });
@@ -17684,7 +17718,7 @@
17684
17718
  throw Error(`received rename event for unknown layout with type ${renamedLayout.type} and name ${renamedLayout.oldName}`);
17685
17719
  }
17686
17720
  existingLayout.name = renamedLayout.newName;
17687
- this.callbacks.execute("renamed", existingLayout);
17721
+ this.callbacks.execute("renamed", existingLayout, { name: renamedLayout.oldName });
17688
17722
  });
17689
17723
  }
17690
17724
  compareLayouts(layout1, layout2) {
@@ -17705,6 +17739,17 @@
17705
17739
  this.callbacks.execute("restored", existingLayout);
17706
17740
  });
17707
17741
  }
17742
+ selectedDefaultLayout(selectedDefaultLayouts, deselected) {
17743
+ if (!selectedDefaultLayouts || selectedDefaultLayouts.length === 0) {
17744
+ return;
17745
+ }
17746
+ if (deselected) {
17747
+ this.callbacks.execute("default-changed", undefined);
17748
+ }
17749
+ else {
17750
+ this.callbacks.execute("default-changed", selectedDefaultLayouts[0]);
17751
+ }
17752
+ }
17708
17753
  }
17709
17754
 
17710
17755
  function LayoutsFactory (config) {
@@ -19181,7 +19226,7 @@
19181
19226
  };
19182
19227
  }
19183
19228
 
19184
- var version = "6.13.0";
19229
+ var version = "6.14.0";
19185
19230
 
19186
19231
  var prepareConfig = (options) => {
19187
19232
  function getLibConfig(value, defaultMode, trueMode) {