@interopio/browser 3.5.2 → 3.5.3

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/browser.d.ts CHANGED
@@ -6,7 +6,6 @@ import { IOConnectCore } from "@interopio/core";
6
6
  import { IOConnectDesktop } from "@interopio/desktop";
7
7
  import { IOConnectWorkspaces } from "@interopio/workspaces-api";
8
8
  import { IOConnectSearch } from "@interopio/search-api";
9
- import { IOBrowserWidget } from "@interopio/widget";
10
9
  import { Context as FDC3Context } from "@finos/fdc3";
11
10
 
12
11
  /**
@@ -118,7 +117,61 @@ export namespace IOConnectBrowser {
118
117
  widget?: Widget;
119
118
  }
120
119
 
121
- export interface Widget extends IOBrowserWidget.Config {
120
+ export namespace Widget {
121
+ export type ChannelSelectorType = "directional" | "default";
122
+
123
+ export type ChannelsDisplayMode = "all" | "fdc3";
124
+
125
+ export type Position = "top" | "bottom" | "left" | "right";
126
+
127
+ export type Mode = "compact" | "default";
128
+
129
+ export interface ChannelSelectorConfig {
130
+ /**
131
+ * Configure whether Channel Selector will be added to the Widget component
132
+ * @default true
133
+ */
134
+ enable?: boolean;
135
+
136
+ type?: ChannelSelectorType;
137
+ }
138
+
139
+ export interface Channels {
140
+ selector?: ChannelSelectorConfig;
141
+ /**
142
+ * Configure whether to show only fdc3-enabled channels or all
143
+ * @default all
144
+ */
145
+ displayMode?: ChannelsDisplayMode;
146
+ }
147
+
148
+ export interface DefaultConfig {
149
+ enable: boolean;
150
+
151
+ channels?: Channels;
152
+
153
+ /**
154
+ * Starting position
155
+ * @default bottom
156
+ */
157
+ position?: Position;
158
+
159
+ /**
160
+ * Widget mode
161
+ * @default default
162
+ */
163
+ mode?: Mode;
164
+
165
+ /**
166
+ * If `true`, the widget will be visible in the app even if the app is currently in a Workspace.
167
+ * @default false
168
+ */
169
+ displayInWorkspace?: boolean;
170
+ }
171
+ }
172
+
173
+
174
+ export interface Widget extends Widget.DefaultConfig {
122
175
  /**
123
176
  * Whether to wait for IOBrowserWidget factory to resolve
124
177
  * @default true
@@ -530,6 +583,12 @@ export namespace IOConnectBrowser {
530
583
  /** Array of component objects describing the apps and Workspaces saved in the Layout. */
531
584
  components: Array<WindowComponent | WorkspaceFrameComponent | IOConnectWorkspaces.WorkspaceComponent>;
532
585
 
586
+ /**
587
+ * Used internally to audit operations.
588
+ * @ignore
589
+ */
590
+ token?: string;
591
+
533
592
  /** Context object passed when the Layout was saved. */
534
593
  context?: any;
535
594
 
@@ -2324,6 +2324,7 @@ const workspaceFrameComponentDecoder = object$1({
2324
2324
  const glueLayoutDecoder = object$1({
2325
2325
  name: nonEmptyStringDecoder,
2326
2326
  type: layoutTypeDecoder,
2327
+ token: optional$1(nonEmptyStringDecoder),
2327
2328
  components: array$1(oneOf$1(windowLayoutComponentDecoder, workspaceLayoutComponentDecoder, workspaceFrameComponentDecoder)),
2328
2329
  context: optional$1(anyJson$1()),
2329
2330
  metadata: optional$1(anyJson$1()),
@@ -6811,7 +6812,7 @@ class UIController {
6811
6812
  async invokeWidgetFactory(io) {
6812
6813
  const timeout = this.config?.widget?.timeout || defaultWidgetTimeout;
6813
6814
  await this.ioc.eventsDispatcher.widgetReady(timeout);
6814
- const config = deepmerge$1({ ...this.resources?.widget?.config, enable: true }, this.config?.widget || {});
6815
+ const config = deepmerge$1({ ...this.resources?.widget?.config, enable: this.displayWidget }, this.config?.widget || {});
6815
6816
  this.logger.trace(`IOBrowserWidget factory is available. Invoking it with config: ${JSON.stringify(config)}`);
6816
6817
  await window.IOBrowserWidget(io, config);
6817
6818
  }
@@ -7016,7 +7017,7 @@ class IoC {
7016
7017
  }
7017
7018
  }
7018
7019
 
7019
- var version$1 = "3.5.2";
7020
+ var version$1 = "3.5.3";
7020
7021
 
7021
7022
  const createFactoryFunction = (coreFactoryFunction) => {
7022
7023
  let cachedApiPromise;
@@ -10003,7 +10004,7 @@ const ContextMessageReplaySpec = {
10003
10004
  }
10004
10005
  };
10005
10006
 
10006
- var version = "6.5.0";
10007
+ var version = "6.5.1";
10007
10008
 
10008
10009
  function prepareConfig (configuration, ext, glue42gd) {
10009
10010
  let nodeStartingContext;
@@ -15289,18 +15290,27 @@ const IOConnectCoreFactory = (userConfig, ext) => {
15289
15290
  if (_allowTrace) {
15290
15291
  _logger.trace(`registering ${name} module`);
15291
15292
  }
15292
- const done = () => {
15293
+ const done = (e) => {
15293
15294
  inner.initTime = t.stop();
15294
15295
  inner.initEndTime = t.endTime;
15295
15296
  inner.marks = t.marks;
15296
- if (_allowTrace) {
15297
- _logger.trace(`${name} is ready - ${t.endTime - t.startTime}`);
15297
+ if (!_allowTrace) {
15298
+ return;
15298
15299
  }
15300
+ const traceMessage = e ?
15301
+ `${name} failed - ${e.message}` :
15302
+ `${name} is ready - ${t.endTime - t.startTime}`;
15303
+ _logger.trace(traceMessage);
15299
15304
  };
15300
15305
  inner.initStartTime = t.startTime;
15301
15306
  if (inner.ready) {
15302
- inner.ready().then(() => {
15307
+ inner.ready()
15308
+ .then(() => {
15303
15309
  done();
15310
+ })
15311
+ .catch((e) => {
15312
+ const error = typeof e === "string" ? new Error(e) : e;
15313
+ done(error);
15304
15314
  });
15305
15315
  }
15306
15316
  else {
@@ -15589,6 +15599,26 @@ if (typeof window !== "undefined") {
15589
15599
  IOConnectCoreFactory.version = version;
15590
15600
  IOConnectCoreFactory.default = IOConnectCoreFactory;
15591
15601
 
15602
+ const setupGlobalSystem = () => {
15603
+ return {
15604
+ getContainerInfo: async () => {
15605
+ if (window === window.parent) {
15606
+ return;
15607
+ }
15608
+ if (window.name.includes("#wsp")) {
15609
+ return {
15610
+ workspaceFrame: {
15611
+ id: "N/A"
15612
+ }
15613
+ };
15614
+ }
15615
+ return window.parent === window.top ?
15616
+ { top: {} } :
15617
+ { parent: {} };
15618
+ }
15619
+ };
15620
+ };
15621
+
15592
15622
  const iOConnectBrowserFactory = createFactoryFunction(IOConnectCoreFactory);
15593
15623
  if (typeof window !== "undefined") {
15594
15624
  const windowAny = window;
@@ -15601,6 +15631,9 @@ const ioGlobal = window.iodesktop || window.iobrowser;
15601
15631
  if (!legacyGlobal && !ioGlobal) {
15602
15632
  window.iobrowser = { webStarted: false };
15603
15633
  }
15634
+ if (!window.iobrowser.system) {
15635
+ window.iobrowser.system = setupGlobalSystem();
15636
+ }
15604
15637
  iOConnectBrowserFactory.version = version$1;
15605
15638
 
15606
15639
  export { iOConnectBrowserFactory as default };