@interopio/widget 1.0.4 → 1.1.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.
@@ -795,7 +795,8 @@
795
795
  const configDecoder = object({
796
796
  channelSelector: optional(channelSelectorDecoder),
797
797
  position: optional(positionDecoder),
798
- mode: optional(modeDecoder)
798
+ mode: optional(modeDecoder),
799
+ displayInWorkspace: optional(boolean())
799
800
  });
800
801
 
801
802
  const defaultConfig = {
@@ -804,7 +805,8 @@
804
805
  type: "default"
805
806
  },
806
807
  position: "bottom",
807
- mode: "default"
808
+ mode: "default",
809
+ displayInWorkspace: false
808
810
  };
809
811
 
810
812
  const browserPlatformMethodName = "T42.Web.Platform.Control";
@@ -1632,6 +1634,9 @@
1632
1634
  }));
1633
1635
  setChannelsInfo(channelsInfo);
1634
1636
  }, [glueController]);
1637
+ reactExports.useEffect(() => {
1638
+ getChannels();
1639
+ }, [getChannels]);
1635
1640
  reactExports.useEffect(() => {
1636
1641
  const subscribeForChannelChanged = () => {
1637
1642
  glueController.io.channels.onChanged(async (name) => {
@@ -1663,7 +1668,7 @@
1663
1668
  handleBtnBackgroundChange();
1664
1669
  }, [channelsInfo]);
1665
1670
  return (React.createElement(L, { onClick: getChannels },
1666
- mode === "default" ? (React.createElement(L.ButtonIcon, { className: "io-btn-icon", icon: "link", iconSize: "16", size: "32", variant: "circle" })) : (React.createElement(L.Button, { icon: "link", text: "Select channel", iconRight: false })),
1671
+ mode === "default" ? (React.createElement(L.ButtonIcon, { className: "io-btn-icon", icon: "link", iconSize: "16", size: "32", variant: "circle" })) : (React.createElement(L.Button, { icon: "link", text: "Select Channel", iconRight: false })),
1667
1672
  React.createElement(L.Content, null,
1668
1673
  React.createElement(ChannelSelector, { className: "io-list-channels", variant: type, channels: channelsInfo, onChannelSelect: type === "single" ? handleSingleChannelSelect : handleDirectionalChannelSelect, variantToggle: variantToggle, onVariantChange: onTypeChange }))));
1669
1674
  };
@@ -1703,9 +1708,9 @@
1703
1708
  return (React.createElement(L, null,
1704
1709
  React.createElement(L.ButtonIcon, { className: "io-btn-icon", iconSize: "16", size: "32", variant: "circle" }),
1705
1710
  React.createElement(L.Content, null,
1706
- React.createElement(L.ItemSection, null, "Application"),
1711
+ React.createElement(L.ItemSection, null, "App"),
1707
1712
  React.createElement(L.List, null,
1708
- showBringBackToWspBtn ? (React.createElement(L.Item, { onClick: handleBringBackToWspClick, prepend: React.createElement(y, { variant: "pop-in-widget" }) }, "Pop in")) : null,
1713
+ showBringBackToWspBtn ? (React.createElement(L.Item, { onClick: handleBringBackToWspClick, prepend: React.createElement(y, { variant: "pop-in-widget" }) }, "Pop In")) : null,
1709
1714
  showChannelSelectorBtn ? React.createElement(ChannelSelectorWrapper, { mode: mode }) : null),
1710
1715
  React.createElement(PositionDropdown, { position: position, positionClickHandler: positionClickHandler }),
1711
1716
  React.createElement(ModeDropdown, { mode: mode, modeClickHandler: modeClickHandler }))));
@@ -1824,6 +1829,9 @@
1824
1829
  }
1825
1830
  async checkShowWidget() {
1826
1831
  const errorMsg = `Current window is in workspace`;
1832
+ if (window.iobrowser?.isPlatformFrame) {
1833
+ return { show: false, reason: `Current window is a Platform in a Workspaces Frame` };
1834
+ }
1827
1835
  if (this.io.workspaces && await this.io.workspaces.inWorkspace()) {
1828
1836
  return { show: false, reason: errorMsg };
1829
1837
  }
@@ -1926,10 +1934,12 @@
1926
1934
  return;
1927
1935
  }
1928
1936
  logger.trace(`Bridge initiated successfully`);
1929
- const showWidgetRes = await ioc.glueController.checkShowWidget();
1930
- if (!showWidgetRes.show) {
1931
- logger.error(`${baseErrorMessage} ${showWidgetRes.reason}`);
1932
- return;
1937
+ if (!widgetConfig.displayInWorkspace) {
1938
+ const showWidgetRes = await ioc.glueController.checkShowWidget();
1939
+ if (!showWidgetRes.show) {
1940
+ logger.error(`${baseErrorMessage} ${showWidgetRes.reason}`);
1941
+ return;
1942
+ }
1933
1943
  }
1934
1944
  logger.trace(`Widget will be attached to DOM`);
1935
1945
  await ioc.domController.attachWidget();