@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.
- package/changelog.md +5 -0
- package/dist/io-browser-widget-react.es.js +19 -9
- package/dist/io-browser-widget-react.es.js.map +1 -1
- package/dist/io-browser-widget-react.umd.js +19 -9
- package/dist/io-browser-widget-react.umd.js.map +1 -1
- package/dist/io-browser-widget.es.js +19 -9
- package/dist/io-browser-widget.es.js.map +1 -1
- package/dist/io-browser-widget.umd.js +19 -9
- package/dist/io-browser-widget.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -2
- package/widget.d.ts +9 -1
|
@@ -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";
|
|
@@ -1207,6 +1209,9 @@
|
|
|
1207
1209
|
}));
|
|
1208
1210
|
setChannelsInfo(channelsInfo);
|
|
1209
1211
|
}, [glueController]);
|
|
1212
|
+
React.useEffect(() => {
|
|
1213
|
+
getChannels();
|
|
1214
|
+
}, [getChannels]);
|
|
1210
1215
|
React.useEffect(() => {
|
|
1211
1216
|
const subscribeForChannelChanged = () => {
|
|
1212
1217
|
glueController.io.channels.onChanged(async (name) => {
|
|
@@ -1238,7 +1243,7 @@
|
|
|
1238
1243
|
handleBtnBackgroundChange();
|
|
1239
1244
|
}, [channelsInfo]);
|
|
1240
1245
|
return (React.createElement(L, { onClick: getChannels },
|
|
1241
|
-
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
|
|
1246
|
+
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 })),
|
|
1242
1247
|
React.createElement(L.Content, null,
|
|
1243
1248
|
React.createElement(ChannelSelector, { className: "io-list-channels", variant: type, channels: channelsInfo, onChannelSelect: type === "single" ? handleSingleChannelSelect : handleDirectionalChannelSelect, variantToggle: variantToggle, onVariantChange: onTypeChange }))));
|
|
1244
1249
|
};
|
|
@@ -1278,9 +1283,9 @@
|
|
|
1278
1283
|
return (React.createElement(L, null,
|
|
1279
1284
|
React.createElement(L.ButtonIcon, { className: "io-btn-icon", iconSize: "16", size: "32", variant: "circle" }),
|
|
1280
1285
|
React.createElement(L.Content, null,
|
|
1281
|
-
React.createElement(L.ItemSection, null, "
|
|
1286
|
+
React.createElement(L.ItemSection, null, "App"),
|
|
1282
1287
|
React.createElement(L.List, null,
|
|
1283
|
-
showBringBackToWspBtn ? (React.createElement(L.Item, { onClick: handleBringBackToWspClick, prepend: React.createElement(y, { variant: "pop-in-widget" }) }, "Pop
|
|
1288
|
+
showBringBackToWspBtn ? (React.createElement(L.Item, { onClick: handleBringBackToWspClick, prepend: React.createElement(y, { variant: "pop-in-widget" }) }, "Pop In")) : null,
|
|
1284
1289
|
showChannelSelectorBtn ? React.createElement(ChannelSelectorWrapper, { mode: mode }) : null),
|
|
1285
1290
|
React.createElement(PositionDropdown, { position: position, positionClickHandler: positionClickHandler }),
|
|
1286
1291
|
React.createElement(ModeDropdown, { mode: mode, modeClickHandler: modeClickHandler }))));
|
|
@@ -1399,6 +1404,9 @@
|
|
|
1399
1404
|
}
|
|
1400
1405
|
async checkShowWidget() {
|
|
1401
1406
|
const errorMsg = `Current window is in workspace`;
|
|
1407
|
+
if (window.iobrowser?.isPlatformFrame) {
|
|
1408
|
+
return { show: false, reason: `Current window is a Platform in a Workspaces Frame` };
|
|
1409
|
+
}
|
|
1402
1410
|
if (this.io.workspaces && await this.io.workspaces.inWorkspace()) {
|
|
1403
1411
|
return { show: false, reason: errorMsg };
|
|
1404
1412
|
}
|
|
@@ -1501,10 +1509,12 @@
|
|
|
1501
1509
|
return;
|
|
1502
1510
|
}
|
|
1503
1511
|
logger.trace(`Bridge initiated successfully`);
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1512
|
+
if (!widgetConfig.displayInWorkspace) {
|
|
1513
|
+
const showWidgetRes = await ioc.glueController.checkShowWidget();
|
|
1514
|
+
if (!showWidgetRes.show) {
|
|
1515
|
+
logger.error(`${baseErrorMessage} ${showWidgetRes.reason}`);
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1508
1518
|
}
|
|
1509
1519
|
logger.trace(`Widget will be attached to DOM`);
|
|
1510
1520
|
await ioc.domController.attachWidget();
|