@interopio/groups-ui-react 2.3.1 → 2.4.1
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/dist/cjs/defaultComponents/channelSelector/utils.d.ts +4 -0
- package/dist/cjs/index.js +36 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/api.d.ts +5 -0
- package/dist/cjs/types/defaultComponents.d.ts +12 -0
- package/dist/cjs/types/internal.d.ts +12 -0
- package/dist/esm/defaultComponents/channelSelector/utils.d.ts +4 -0
- package/dist/esm/index.js +36 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api.d.ts +5 -0
- package/dist/esm/types/defaultComponents.d.ts +12 -0
- package/dist/esm/types/internal.d.ts +12 -0
- package/dist/styles/groups.css +11 -2
- package/dist/styles/vars.css +6 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -577,10 +577,30 @@
|
|
|
577
577
|
console.error("Error while checking readable color for '" + color + "'", error);
|
|
578
578
|
}
|
|
579
579
|
return false;
|
|
580
|
+
}
|
|
581
|
+
function getChannelDirection(channelRestrictions) {
|
|
582
|
+
if (!channelRestrictions) {
|
|
583
|
+
return "";
|
|
584
|
+
}
|
|
585
|
+
if (typeof channelRestrictions.read === "boolean" && typeof channelRestrictions.write === "boolean") {
|
|
586
|
+
if (channelRestrictions.read && channelRestrictions.write) {
|
|
587
|
+
return "";
|
|
588
|
+
}
|
|
589
|
+
if (channelRestrictions.read) {
|
|
590
|
+
return "subscribe";
|
|
591
|
+
}
|
|
592
|
+
if (channelRestrictions.write) {
|
|
593
|
+
return "publish";
|
|
594
|
+
}
|
|
595
|
+
return "";
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
return "";
|
|
599
|
+
}
|
|
580
600
|
}
|
|
581
601
|
|
|
582
602
|
var BaseChannelSelector = function (_a) {
|
|
583
|
-
var outsideClass = _a.outsideClass, contentClass = _a.contentClass, showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor;
|
|
603
|
+
var outsideClass = _a.outsideClass, contentClass = _a.contentClass, showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor, direction = _a.direction, channelLabel = _a.channelLabel;
|
|
584
604
|
var ref = React.useRef(null);
|
|
585
605
|
var wrappedOnClick = function () {
|
|
586
606
|
if (!ref.current) {
|
|
@@ -607,13 +627,15 @@
|
|
|
607
627
|
var style = {
|
|
608
628
|
background: selectedChannelColor
|
|
609
629
|
};
|
|
610
|
-
return React__default["default"].createElement("div", { title: selectedChannel !== null && selectedChannel !== void 0 ? selectedChannel : "", ref: ref, style: style, onClick: wrappedOnClick, className: "t42-buttons " + outsideClass },
|
|
611
|
-
React__default["default"].createElement("div", { className: className }
|
|
630
|
+
return React__default["default"].createElement("div", { title: selectedChannel !== null && selectedChannel !== void 0 ? selectedChannel : "", ref: ref, style: style, onClick: wrappedOnClick, className: "t42-buttons " + outsideClass }, channelLabel ?
|
|
631
|
+
React__default["default"].createElement("div", { className: className + " icon" },
|
|
632
|
+
channelLabel,
|
|
633
|
+
direction && React__default["default"].createElement("i", { className: "icon-" + direction })) : React__default["default"].createElement("div", { className: className }));
|
|
612
634
|
};
|
|
613
635
|
|
|
614
636
|
var FlatChannelSelector = function (_a) {
|
|
615
|
-
var showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor;
|
|
616
|
-
return React__default["default"].createElement(BaseChannelSelector, { outsideClass: "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: "t42-frame-channel-selector-content", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor });
|
|
637
|
+
var showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor, channelRestrictions = _a.channelRestrictions, channelLabel = _a.channelLabel;
|
|
638
|
+
return React__default["default"].createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-frame-caption-bar-element t42-frame-channel-selector t42-channel-selector-direction" : "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: !channelLabel ? "t42-frame-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
|
|
617
639
|
};
|
|
618
640
|
|
|
619
641
|
var ExtractButton = function (_a) {
|
|
@@ -1771,7 +1793,7 @@
|
|
|
1771
1793
|
var FlatCaptionBar = function (_a) {
|
|
1772
1794
|
var moveAreaId = _a.moveAreaId, caption = _a.caption, channels = _a.channels, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "caption", "channels", "captionEditor", "notifyCaptionBoundsChanged"]);
|
|
1773
1795
|
return (React__default["default"].createElement("div", { className: "t42-react-caption-bar" },
|
|
1774
|
-
(channels === null || channels === void 0 ? void 0 : channels.visible) && React__default["default"].createElement(FlatChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannel: channels === null || channels === void 0 ? void 0 : channels.selectedChannel, selectedChannelColor: channels === null || channels === void 0 ? void 0 : channels.selectedChannelColor }),
|
|
1796
|
+
(channels === null || channels === void 0 ? void 0 : channels.visible) && React__default["default"].createElement(FlatChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannel: channels === null || channels === void 0 ? void 0 : channels.selectedChannel, selectedChannelColor: channels === null || channels === void 0 ? void 0 : channels.selectedChannelColor, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
|
|
1775
1797
|
React__default["default"].createElement(FlatMoveArea, { moveAreaId: moveAreaId }, captionEditor.show ? React__default["default"].createElement(FlatCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, frameId: rest.frameId })) : React__default["default"].createElement(FlatCaption, { notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
|
|
1776
1798
|
React__default["default"].createElement(FlatButtons, __assign({}, rest))));
|
|
1777
1799
|
};
|
|
@@ -1812,8 +1834,8 @@
|
|
|
1812
1834
|
};
|
|
1813
1835
|
|
|
1814
1836
|
var TabChannelSelector = function (_a) {
|
|
1815
|
-
var showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor;
|
|
1816
|
-
return React__default["default"].createElement(BaseChannelSelector, { outsideClass: "t42-tab-bar-element t42-tab-channel-selector", contentClass: "t42-tab-channel-selector-content", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor });
|
|
1837
|
+
var showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor, channelRestrictions = _a.channelRestrictions, channelLabel = _a.channelLabel;
|
|
1838
|
+
return React__default["default"].createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-tab-bar-element t42-tab-channel-selector t42-channel-selector-direction" : "t42-tab-bar-element t42-tab-channel-selector", contentClass: !channelLabel ? "t42-tab-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
|
|
1817
1839
|
};
|
|
1818
1840
|
|
|
1819
1841
|
var TabCaption = function (_a) {
|
|
@@ -3023,7 +3045,9 @@
|
|
|
3023
3045
|
showSelector: showSelector,
|
|
3024
3046
|
visible: options.channelSelectorVisible,
|
|
3025
3047
|
selectedChannel: options.selectedChannel,
|
|
3026
|
-
selectedChannelColor: options.selectedChannelColor
|
|
3048
|
+
selectedChannelColor: options.selectedChannelColor,
|
|
3049
|
+
channelRestrictions: options.channelRestrictions,
|
|
3050
|
+
channelLabel: options.channelLabel
|
|
3027
3051
|
};
|
|
3028
3052
|
var captionEditor = __assign(__assign({}, options.captionEditor), { commitChanges: function (text) {
|
|
3029
3053
|
webGroupsManager.commitCaptionEditing(TargetType.Frame, options.targetId, text);
|
|
@@ -3141,7 +3165,9 @@
|
|
|
3141
3165
|
showSelector: showSelector,
|
|
3142
3166
|
visible: options.channelSelectorVisible,
|
|
3143
3167
|
selectedChannel: options.selectedChannel,
|
|
3144
|
-
selectedChannelColor: (_a = options.selectedChannelColor) !== null && _a !== void 0 ? _a : options.selectedChannel
|
|
3168
|
+
selectedChannelColor: (_a = options.selectedChannelColor) !== null && _a !== void 0 ? _a : options.selectedChannel,
|
|
3169
|
+
channelRestrictions: options.channelRestrictions,
|
|
3170
|
+
channelLabel: options.channelLabel
|
|
3145
3171
|
};
|
|
3146
3172
|
var captionEditor = __assign(__assign({}, options.captionEditor), { commitChanges: function (text) {
|
|
3147
3173
|
webGroupsManager.commitCaptionEditing(TargetType.Tab, options.targetId, text);
|