@appquality/unguess-design-system 3.1.91-highlight-obs → 3.1.91-highlight
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 +174 -0
- package/build/index.d.ts +11 -10
- package/build/index.js +924 -459
- package/build/stories/accordions/index.stories.d.ts +5 -5
- package/build/stories/alerts/index.d.ts +9 -7
- package/build/stories/alerts/index.stories.d.ts +2 -2
- package/build/stories/avatar/index.stories.d.ts +4 -4
- package/build/stories/breadcrumbs/index.stories.d.ts +2 -2
- package/build/stories/buttons/anchor/index.stories.d.ts +4 -4
- package/build/stories/buttons/button/index.d.ts +11 -9
- package/build/stories/buttons/button/index.stories.d.ts +6 -7
- package/build/stories/buttons/button-group/index.stories.d.ts +4 -4
- package/build/stories/buttons/icon-button/index.stories.d.ts +5 -5
- package/build/stories/buttons/split-button/index.stories.d.ts +2 -2
- package/build/stories/buttons/utils.d.ts +93 -87
- package/build/stories/campaign-cards/index.stories.d.ts +3 -3
- package/build/stories/cards/container.stories.d.ts +2 -2
- package/build/stories/cards/index.stories.d.ts +3 -3
- package/build/stories/charts/bar/index.stories.d.ts +3 -3
- package/build/stories/charts/bullet/index.stories.d.ts +3 -3
- package/build/stories/charts/halfPie/index.stories.d.ts +2 -2
- package/build/stories/charts/pie/index.stories.d.ts +4 -4
- package/build/stories/charts/sentiment/index.stories.d.ts +3 -3
- package/build/stories/charts/sunburst/index.stories.d.ts +3 -3
- package/build/stories/charts/waffle/index.stories.d.ts +3 -3
- package/build/stories/chat/index.d.ts +6 -4
- package/build/stories/chat/index.stories.d.ts +6 -7
- package/build/stories/chat/parts/containers.d.ts +11 -7
- package/build/stories/chat/parts/header.d.ts +6 -4
- package/build/stories/color-swatch/index.stories.d.ts +3 -3
- package/build/stories/drawers/index.stories.d.ts +2 -2
- package/build/stories/dropdowns/autocomplete/index.stories.d.ts +3 -3
- package/build/stories/dropdowns/countermultiselect/index.stories.d.ts +2 -2
- package/build/stories/dropdowns/field/index.d.ts +8 -6
- package/build/stories/dropdowns/menu/index.stories.d.ts +3 -3
- package/build/stories/dropdowns/select/index.d.ts +6 -4
- package/build/stories/dropdowns/select/index.stories.d.ts +3 -4
- package/build/stories/editor/index.stories.d.ts +6 -7
- package/build/stories/editorWithHighlight/_data.d.ts +17 -0
- package/build/stories/editorWithHighlight/floatingMenu.d.ts +5 -0
- package/build/stories/editorWithHighlight/index.d.ts +32 -0
- package/build/stories/editorWithHighlight/index.stories.d.ts +7 -0
- package/build/stories/editorWithHighlight/nodes/active.d.ts +4 -0
- package/build/stories/editorWithHighlight/nodes/observation/Component.d.ts +6 -0
- package/build/stories/editorWithHighlight/nodes/observation/index.d.ts +2 -0
- package/build/stories/editorWithHighlight/nodes/paragraph/Component.d.ts +6 -0
- package/build/stories/editorWithHighlight/nodes/paragraph/index.d.ts +2 -0
- package/build/stories/editorWithHighlight/nodes/word.d.ts +2 -0
- package/build/stories/editorWithHighlight/search.d.ts +8 -0
- package/build/stories/editorWithHighlight/useEditor.d.ts +14 -0
- package/build/stories/forms/checkbox/cards/index.stories.d.ts +3 -3
- package/build/stories/forms/checkbox/index.stories.d.ts +2 -2
- package/build/stories/forms/input/index.d.ts +10 -8
- package/build/stories/forms/input/index.stories.d.ts +5 -5
- package/build/stories/forms/input-toggle/index.d.ts +6 -4
- package/build/stories/forms/input-toggle/index.stories.d.ts +6 -6
- package/build/stories/forms/mediaInput/index.stories.d.ts +5 -5
- package/build/stories/forms/radio/cards/index.stories.d.ts +3 -3
- package/build/stories/forms/radio/index.stories.d.ts +3 -3
- package/build/stories/forms/textarea/index.stories.d.ts +4 -4
- package/build/stories/forms/toggle/index.stories.d.ts +2 -2
- package/build/stories/grid/col/index.stories.d.ts +4 -4
- package/build/stories/grid/grid/index.stories.d.ts +4 -4
- package/build/stories/grid/row/index.stories.d.ts +2 -2
- package/build/stories/highlight/CreateObservationButton.d.ts +5 -3
- package/build/stories/highlight/index.stories.d.ts +7 -8
- package/build/stories/icons/index.stories.d.ts +2 -2
- package/build/stories/info-cards/index.stories.d.ts +3 -3
- package/build/stories/label/index.d.ts +9 -7
- package/build/stories/label/index.stories.d.ts +3 -3
- package/build/stories/lightbox/index.stories.d.ts +2 -2
- package/build/stories/lightbox/parts/body.d.ts +18 -12
- package/build/stories/lightbox/parts/footer.d.ts +7 -5
- package/build/stories/loaders/dots/index.stories.d.ts +2 -2
- package/build/stories/loaders/progress/index.stories.d.ts +2 -2
- package/build/stories/loaders/skeleton/index.stories.d.ts +3 -3
- package/build/stories/loaders/spinner/index.stories.d.ts +2 -2
- package/build/stories/login-form/index.stories.d.ts +3 -3
- package/build/stories/logo/index.stories.d.ts +2 -2
- package/build/stories/modals/fullscreen/index.d.ts +40 -32
- package/build/stories/modals/fullscreen/index.stories.d.ts +2 -2
- package/build/stories/modals/index.d.ts +8 -6
- package/build/stories/modals/index.stories.d.ts +5 -5
- package/build/stories/multiselect/index.stories.d.ts +3 -3
- package/build/stories/navigation/app-header/index.stories.d.ts +3 -3
- package/build/stories/navigation/header/header-item/brandItem.d.ts +9 -7
- package/build/stories/navigation/nav/nav-item/accordionItem.d.ts +3 -1
- package/build/stories/navigation/page-header/index.d.ts +38 -26
- package/build/stories/navigation/page-header/index.stories.d.ts +5 -5
- package/build/stories/navigation/page-header/styled/main.d.ts +40 -28
- package/build/stories/notifications/index.stories.d.ts +3 -3
- package/build/stories/pagination/index.stories.d.ts +3 -3
- package/build/stories/player/_types.d.ts +2 -1
- package/build/stories/player/hooks/usePictureInPicture.d.ts +4 -0
- package/build/stories/player/index.d.ts +7 -2
- package/build/stories/player/index.stories.d.ts +7 -6
- package/build/stories/player/parts/controlButton.d.ts +10 -8
- package/build/stories/player/parts/controls.d.ts +6 -4
- package/build/stories/product-cards/index.stories.d.ts +3 -3
- package/build/stories/profile-modal/components/menuItem.d.ts +6 -4
- package/build/stories/profile-modal/index.stories.d.ts +2 -2
- package/build/stories/service-cards/index.stories.d.ts +3 -3
- package/build/stories/slider/index.stories.d.ts +3 -3
- package/build/stories/slider/parts/container.d.ts +6 -4
- package/build/stories/special-cards/index.d.ts +42 -30
- package/build/stories/special-cards/index.stories.d.ts +2 -2
- package/build/stories/special-cards/styled/header.d.ts +33 -21
- package/build/stories/stepper/index.d.ts +27 -21
- package/build/stories/stepper/index.stories.d.ts +3 -3
- package/build/stories/table/index.stories.d.ts +11 -11
- package/build/stories/tabs/index.stories.d.ts +3 -3
- package/build/stories/tags/index.d.ts +24 -20
- package/build/stories/tags/index.stories.d.ts +6 -6
- package/build/stories/theme/palette.stories.d.ts +1 -1
- package/build/stories/tiles/index.stories.d.ts +4 -4
- package/build/stories/timeline/index.d.ts +11 -7
- package/build/stories/timeline/index.stories.d.ts +4 -4
- package/build/stories/title/index.stories.d.ts +2 -2
- package/build/stories/tooltip/index.d.ts +7 -5
- package/build/stories/tooltip/index.stories.d.ts +3 -3
- package/build/stories/tooltip-modal/index.stories.d.ts +2 -2
- package/build/stories/typography/block-quote/index.stories.d.ts +2 -2
- package/build/stories/typography/code/index.stories.d.ts +4 -4
- package/build/stories/typography/ellipsis/index.stories.d.ts +2 -2
- package/build/stories/typography/lists/ordered.stories.d.ts +2 -2
- package/build/stories/typography/lists/unordered.stories.d.ts +2 -2
- package/build/stories/typography/paragraph/index.stories.d.ts +2 -2
- package/build/stories/typography/span/index.stories.d.ts +2 -2
- package/build/stories/typography/typescale/anchortag/index.stories.d.ts +2 -2
- package/build/stories/typography/typescale/index.d.ts +26 -12
- package/build/stories/typography/typescale/index.stories.d.ts +2 -2
- package/package.json +16 -12
- package/yarn-error.log +13975 -0
package/build/index.js
CHANGED
|
@@ -21,9 +21,9 @@ var bullet = require('@nivo/bullet');
|
|
|
21
21
|
var web = require('@react-spring/web');
|
|
22
22
|
var tooltip = require('@nivo/tooltip');
|
|
23
23
|
var pie = require('@nivo/pie');
|
|
24
|
+
var line = require('@nivo/line');
|
|
24
25
|
var sunburst = require('@nivo/sunburst');
|
|
25
26
|
var waffle = require('@nivo/waffle');
|
|
26
|
-
var line = require('@nivo/line');
|
|
27
27
|
var reactForms = require('@zendeskgarden/react-forms');
|
|
28
28
|
var react = require('@tiptap/react');
|
|
29
29
|
var reactTooltips = require('@zendeskgarden/react-tooltips');
|
|
@@ -49,6 +49,10 @@ var formik = require('formik');
|
|
|
49
49
|
var reactChrome = require('@zendeskgarden/react-chrome');
|
|
50
50
|
var reactPagination = require('@zendeskgarden/react-pagination');
|
|
51
51
|
var reactTables = require('@zendeskgarden/react-tables');
|
|
52
|
+
var SearchAndReplace = require('@sereneinserenade/tiptap-search-and-replace');
|
|
53
|
+
var Document = require('@tiptap/extension-document');
|
|
54
|
+
var Text$2 = require('@tiptap/extension-text');
|
|
55
|
+
var model = require('@tiptap/pm/model');
|
|
52
56
|
|
|
53
57
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
54
58
|
|
|
@@ -85,6 +89,9 @@ var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image$2);
|
|
|
85
89
|
var Dropcursor__default = /*#__PURE__*/_interopDefaultLegacy(Dropcursor);
|
|
86
90
|
var SlickSlider__default = /*#__PURE__*/_interopDefaultLegacy(SlickSlider);
|
|
87
91
|
var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
|
|
92
|
+
var SearchAndReplace__default = /*#__PURE__*/_interopDefaultLegacy(SearchAndReplace);
|
|
93
|
+
var Document__default = /*#__PURE__*/_interopDefaultLegacy(Document);
|
|
94
|
+
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text$2);
|
|
88
95
|
|
|
89
96
|
/*
|
|
90
97
|
* Design principles https://garden.zendesk.com/design/color (accessed 28 apr 2023)
|
|
@@ -291,7 +298,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
291
298
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
292
299
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
293
300
|
});
|
|
294
|
-
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
304
|
+
var e = new Error(message);
|
|
305
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
306
|
+
};
|
|
295
307
|
|
|
296
308
|
const fontWeights = Object.assign(Object.assign({}, reactTheming.DEFAULT_THEME.fontWeights), { semibold: 500 });
|
|
297
309
|
|
|
@@ -852,7 +864,7 @@ Tag.Close = StyledClose;
|
|
|
852
864
|
Tag.SecondaryText = StyledSpan;
|
|
853
865
|
|
|
854
866
|
var _path$G;
|
|
855
|
-
function _extends$T() { _extends$T = Object.assign ? Object.assign.bind() : function (
|
|
867
|
+
function _extends$T() { return _extends$T = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$T.apply(null, arguments); }
|
|
856
868
|
const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$T({
|
|
857
869
|
width: 24,
|
|
858
870
|
height: 24,
|
|
@@ -865,7 +877,7 @@ const SvgUgSquare = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
865
877
|
})));
|
|
866
878
|
|
|
867
879
|
var _path$F;
|
|
868
|
-
function _extends$S() { _extends$S = Object.assign ? Object.assign.bind() : function (
|
|
880
|
+
function _extends$S() { return _extends$S = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$S.apply(null, arguments); }
|
|
869
881
|
const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$S({
|
|
870
882
|
width: 24,
|
|
871
883
|
height: 24,
|
|
@@ -878,7 +890,7 @@ const SvgUgCircle = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
878
890
|
})));
|
|
879
891
|
|
|
880
892
|
var _path$E;
|
|
881
|
-
function _extends$R() { _extends$R = Object.assign ? Object.assign.bind() : function (
|
|
893
|
+
function _extends$R() { return _extends$R = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$R.apply(null, arguments); }
|
|
882
894
|
const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$R({
|
|
883
895
|
width: 24,
|
|
884
896
|
height: 24,
|
|
@@ -891,7 +903,7 @@ const SvgUgTriangle = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
891
903
|
})));
|
|
892
904
|
|
|
893
905
|
var _rect$4, _path$D, _path2$c, _path3$4;
|
|
894
|
-
function _extends$Q() { _extends$Q = Object.assign ? Object.assign.bind() : function (
|
|
906
|
+
function _extends$Q() { return _extends$Q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$Q.apply(null, arguments); }
|
|
895
907
|
const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$Q({
|
|
896
908
|
width: 24,
|
|
897
909
|
height: 24,
|
|
@@ -915,7 +927,7 @@ const SvgCampaignCompleted = props => /*#__PURE__*/React__namespace.createElemen
|
|
|
915
927
|
})));
|
|
916
928
|
|
|
917
929
|
var _rect$3, _path$C, _path2$b;
|
|
918
|
-
function _extends$P() { _extends$P = Object.assign ? Object.assign.bind() : function (
|
|
930
|
+
function _extends$P() { return _extends$P = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$P.apply(null, arguments); }
|
|
919
931
|
const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$P({
|
|
920
932
|
width: 24,
|
|
921
933
|
height: 24,
|
|
@@ -940,7 +952,7 @@ const SvgCampaignLocked = props => /*#__PURE__*/React__namespace.createElement("
|
|
|
940
952
|
})));
|
|
941
953
|
|
|
942
954
|
var _rect$2, _path$B, _path2$a;
|
|
943
|
-
function _extends$O() { _extends$O = Object.assign ? Object.assign.bind() : function (
|
|
955
|
+
function _extends$O() { return _extends$O = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$O.apply(null, arguments); }
|
|
944
956
|
const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$O({
|
|
945
957
|
width: 24,
|
|
946
958
|
height: 24,
|
|
@@ -967,7 +979,7 @@ const SvgCampaignIncoming = props => /*#__PURE__*/React__namespace.createElement
|
|
|
967
979
|
})));
|
|
968
980
|
|
|
969
981
|
var _rect$1, _path$A, _path2$9, _path3$3, _path4$1, _path5$1, _path6$1, _path7$1, _path8$1, _path9$1, _path10$1;
|
|
970
|
-
function _extends$N() { _extends$N = Object.assign ? Object.assign.bind() : function (
|
|
982
|
+
function _extends$N() { return _extends$N = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$N.apply(null, arguments); }
|
|
971
983
|
const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$N({
|
|
972
984
|
width: 24,
|
|
973
985
|
height: 24,
|
|
@@ -1012,7 +1024,7 @@ const SvgCampaignProgress = props => /*#__PURE__*/React__namespace.createElement
|
|
|
1012
1024
|
})));
|
|
1013
1025
|
|
|
1014
1026
|
var _g$c, _path$z, _path2$8, _path3$2, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11;
|
|
1015
|
-
function _extends$M() { _extends$M = Object.assign ? Object.assign.bind() : function (
|
|
1027
|
+
function _extends$M() { return _extends$M = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$M.apply(null, arguments); }
|
|
1016
1028
|
const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$M({
|
|
1017
1029
|
width: 24,
|
|
1018
1030
|
height: 24,
|
|
@@ -1082,7 +1094,7 @@ const SvgCampaignExperiential = props => /*#__PURE__*/React__namespace.createEle
|
|
|
1082
1094
|
})));
|
|
1083
1095
|
|
|
1084
1096
|
var _g$b, _path$y;
|
|
1085
|
-
function _extends$L() { _extends$L = Object.assign ? Object.assign.bind() : function (
|
|
1097
|
+
function _extends$L() { return _extends$L = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$L.apply(null, arguments); }
|
|
1086
1098
|
const SvgCampaignFunctional = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$L({
|
|
1087
1099
|
width: 24,
|
|
1088
1100
|
height: 24,
|
|
@@ -1198,7 +1210,7 @@ const TextDescription = (_a) => {
|
|
|
1198
1210
|
: jsxRuntime.jsx(MD, Object.assign({ color: theme.palette.grey[700] }, props)));
|
|
1199
1211
|
};
|
|
1200
1212
|
|
|
1201
|
-
const Label$
|
|
1213
|
+
const Label$3 = styled__default["default"](SM) `
|
|
1202
1214
|
color: ${({ theme }) => theme.palette.grey[500]};
|
|
1203
1215
|
`;
|
|
1204
1216
|
const Title$2 = styled__default["default"](LG) `
|
|
@@ -1222,7 +1234,7 @@ const Container$3 = styled__default["default"].div `
|
|
|
1222
1234
|
`}
|
|
1223
1235
|
`;
|
|
1224
1236
|
const CardHeader = (props) => jsxRuntime.jsx(Container$3, Object.assign({}, props));
|
|
1225
|
-
CardHeader.Label = Label$
|
|
1237
|
+
CardHeader.Label = Label$3;
|
|
1226
1238
|
CardHeader.Title = Title$2;
|
|
1227
1239
|
CardHeader.Text = Description$2;
|
|
1228
1240
|
|
|
@@ -1737,59 +1749,6 @@ const BulletChart = ({ width, height, ranges, values }) => {
|
|
|
1737
1749
|
}, tooltip: CustomTooltip, rangeColors: theme.palette.grey[200], rangeBorderColor: "white", rangeBorderWidth: 2, margin: { top: 0, right: 5, bottom: -1, left: 0 } }) })) })));
|
|
1738
1750
|
};
|
|
1739
1751
|
|
|
1740
|
-
const CenteredItem = ({ centerX, centerY, theme, radius, label, value, fontSizeMultiplier, }) => {
|
|
1741
|
-
const parameter = 6;
|
|
1742
|
-
const fontSizeFactor = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) / (14 * parameter);
|
|
1743
|
-
const spacing = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) /
|
|
1744
|
-
(parameter * 0.9);
|
|
1745
|
-
const shift = -radius / (parameter * 2.5);
|
|
1746
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift + (value ? spacing : spacing / 2), fill: theme.palette.grey[600], style: {
|
|
1747
|
-
fontSize: parseInt(theme.fontSizes.md.replace("px", "")) * fontSizeFactor,
|
|
1748
|
-
} }, { children: label })) }))), value && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift - (label ? spacing : spacing / 2), fill: theme.palette.blue[600], style: {
|
|
1749
|
-
fontSize: parseInt(theme.fontSizes.xxl.replace("px", "")) *
|
|
1750
|
-
fontSizeFactor,
|
|
1751
|
-
fontWeight: theme.fontWeights.semibold,
|
|
1752
|
-
} }, { children: value })) })))] }));
|
|
1753
|
-
};
|
|
1754
|
-
|
|
1755
|
-
const PieChart = ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }) => {
|
|
1756
|
-
var _a;
|
|
1757
|
-
const themeContext = React.useContext(styled.ThemeContext);
|
|
1758
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: Object.assign({}, Object.assign(Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), theme), { labels: Object.assign(Object.assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: Object.assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_a = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _a === void 0 ? void 0 : _a.text) }) })), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, arcLinkLabelsThickness: 2, arcLinkLabel: (d) => labelFormatter
|
|
1759
|
-
? labelFormatter({
|
|
1760
|
-
label: d.label,
|
|
1761
|
-
id: d.id,
|
|
1762
|
-
value: d.value,
|
|
1763
|
-
data: d.data,
|
|
1764
|
-
labelPosition: "arclink",
|
|
1765
|
-
})
|
|
1766
|
-
: (d.label || d.id).toString(), arcLinkLabelsDiagonalLength: 8, arcLinkLabelsStraightLength: 12, arcLinkLabelsTextOffset: 4, padAngle: 2, data: data, margin: Object.assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
|
|
1767
|
-
? (node) => {
|
|
1768
|
-
const data = node.datum.data;
|
|
1769
|
-
const label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
|
|
1770
|
-
const value = data.value;
|
|
1771
|
-
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({ label, value, data }) });
|
|
1772
|
-
}
|
|
1773
|
-
: undefined, cornerRadius: 2, innerRadius: 0.8, layers: [
|
|
1774
|
-
"arcs",
|
|
1775
|
-
"arcLabels",
|
|
1776
|
-
"arcLinkLabels",
|
|
1777
|
-
...(centerItem
|
|
1778
|
-
? [
|
|
1779
|
-
(props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))),
|
|
1780
|
-
]
|
|
1781
|
-
: []),
|
|
1782
|
-
], activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.map((d) => labelFormatter
|
|
1783
|
-
? labelFormatter({
|
|
1784
|
-
label: d.label,
|
|
1785
|
-
id: d.id,
|
|
1786
|
-
value: d.value,
|
|
1787
|
-
data: d,
|
|
1788
|
-
labelPosition: "legend",
|
|
1789
|
-
})
|
|
1790
|
-
: d.id.toString()) }, (typeof legend === "object" && legend)))) : undefined }))] }));
|
|
1791
|
-
};
|
|
1792
|
-
|
|
1793
1752
|
const AbsoluteChartContainer = styled__default["default"](ChartContainer) `
|
|
1794
1753
|
position: absolute;
|
|
1795
1754
|
left: 0;
|
|
@@ -1833,131 +1792,61 @@ const HalfPieChart = ({ theme, colors, width, height, data, margin, showArcLinks
|
|
|
1833
1792
|
}, mode: "back" })] })));
|
|
1834
1793
|
};
|
|
1835
1794
|
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
if (data.value) {
|
|
1850
|
-
return data.value;
|
|
1851
|
-
}
|
|
1852
|
-
if (data.children) {
|
|
1853
|
-
return data.children.reduce((acc, item) => {
|
|
1854
|
-
return acc + getChildrenValue(item);
|
|
1855
|
-
}, 0);
|
|
1856
|
-
}
|
|
1857
|
-
return 0;
|
|
1795
|
+
const CenteredItem = ({ centerX, centerY, theme, radius, label, value, fontSizeMultiplier, }) => {
|
|
1796
|
+
const parameter = 6;
|
|
1797
|
+
const fontSizeFactor = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) / (14 * parameter);
|
|
1798
|
+
const spacing = ((fontSizeMultiplier ? fontSizeMultiplier : 1) * radius) /
|
|
1799
|
+
(parameter * 0.9);
|
|
1800
|
+
const shift = -radius / (parameter * 2.5);
|
|
1801
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift + (value ? spacing : spacing / 2), fill: theme.palette.grey[600], style: {
|
|
1802
|
+
fontSize: parseInt(theme.fontSizes.md.replace("px", "")) * fontSizeFactor,
|
|
1803
|
+
} }, { children: label })) }))), value && (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX},${centerY})` }, { children: jsxRuntime.jsx("text", Object.assign({ textAnchor: "middle", baselineShift: shift - (label ? spacing : spacing / 2), fill: theme.palette.blue[600], style: {
|
|
1804
|
+
fontSize: parseInt(theme.fontSizes.xxl.replace("px", "")) *
|
|
1805
|
+
fontSizeFactor,
|
|
1806
|
+
fontWeight: theme.fontWeights.semibold,
|
|
1807
|
+
} }, { children: value })) })))] }));
|
|
1858
1808
|
};
|
|
1859
1809
|
|
|
1860
|
-
const
|
|
1861
|
-
|
|
1862
|
-
cursor: pointer;
|
|
1863
|
-
|
|
1864
|
-
fill: ${({ theme }) => theme.palette.blue[500]};
|
|
1865
|
-
&:hover {
|
|
1866
|
-
fill: ${({ theme }) => theme.palette.blue[700]};
|
|
1867
|
-
}
|
|
1868
|
-
`;
|
|
1869
|
-
const ResetButton = ({ centerX, centerY, radius, theme, onClick, }) => (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX - radius},${centerY - radius})` }, { children: jsxRuntime.jsx(ResetText, Object.assign({ onClick: onClick, radius: radius }, { children: `< Reset` })) })));
|
|
1870
|
-
|
|
1871
|
-
const SunburstChart = ({ colors, width, height, data, centerItem, margin, onChange, tooltip, legend, }) => {
|
|
1810
|
+
const PieChart = ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }) => {
|
|
1811
|
+
var _a;
|
|
1872
1812
|
const themeContext = React.useContext(styled.ThemeContext);
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
|
|
1888
|
-
padding: 0,
|
|
1889
|
-
} }) }) : DEFAULT_CHARTS_THEME, colors: currentColor
|
|
1890
|
-
? () => currentColor
|
|
1891
|
-
: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, borderWidth: 4, cornerRadius: 4, onMouseEnter: (node) => {
|
|
1892
|
-
if (node.data.children) {
|
|
1893
|
-
setIsHovering(true);
|
|
1894
|
-
}
|
|
1895
|
-
}, onMouseLeave: (node) => {
|
|
1896
|
-
if (node.data.children) {
|
|
1897
|
-
setIsHovering(false);
|
|
1813
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: Object.assign({}, Object.assign(Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), theme), { labels: Object.assign(Object.assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: Object.assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_a = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _a === void 0 ? void 0 : _a.text) }) })), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, arcLinkLabelsThickness: 2, arcLinkLabel: (d) => labelFormatter
|
|
1814
|
+
? labelFormatter({
|
|
1815
|
+
label: d.label,
|
|
1816
|
+
id: d.id,
|
|
1817
|
+
value: d.value,
|
|
1818
|
+
data: d.data,
|
|
1819
|
+
labelPosition: "arclink",
|
|
1820
|
+
})
|
|
1821
|
+
: (d.label || d.id).toString(), arcLinkLabelsDiagonalLength: 8, arcLinkLabelsStraightLength: 12, arcLinkLabelsTextOffset: 4, padAngle: 2, data: data, margin: Object.assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
|
|
1822
|
+
? (node) => {
|
|
1823
|
+
const data = node.datum.data;
|
|
1824
|
+
const label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
|
|
1825
|
+
const value = data.value;
|
|
1826
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({ label, value, data }) });
|
|
1898
1827
|
}
|
|
1899
|
-
|
|
1900
|
-
? (node) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({
|
|
1901
|
-
label: node.data.label || node.data.name,
|
|
1902
|
-
value: getChildrenValue(node.data),
|
|
1903
|
-
data: Object.assign(Object.assign({}, node.data), { children: undefined }),
|
|
1904
|
-
}) }))
|
|
1905
|
-
: undefined, layers: [
|
|
1828
|
+
: undefined, cornerRadius: 2, innerRadius: 0.8, layers: [
|
|
1906
1829
|
"arcs",
|
|
1830
|
+
"arcLabels",
|
|
1831
|
+
"arcLinkLabels",
|
|
1907
1832
|
...(centerItem
|
|
1908
1833
|
? [
|
|
1909
|
-
(props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, {
|
|
1910
|
-
]
|
|
1911
|
-
: []),
|
|
1912
|
-
...(currentColor
|
|
1913
|
-
? [
|
|
1914
|
-
(props) => (jsxRuntime.jsx(ResetButton, { centerX: props.centerX, centerY: props.centerY, radius: props.radius, theme: themeContext, onClick: () => {
|
|
1915
|
-
changeDataSlice({
|
|
1916
|
-
data,
|
|
1917
|
-
});
|
|
1918
|
-
} })),
|
|
1834
|
+
(props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))),
|
|
1919
1835
|
]
|
|
1920
1836
|
: []),
|
|
1921
|
-
],
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
};
|
|
1931
|
-
|
|
1932
|
-
const CustomCell = ({ position, size, x, y, color, fill, opacity, borderWidth, borderColor, data, onHover, onLeave, onClick, }) => (jsxRuntime.jsx("circle", { r: size / 2, cx: x + size / 2, cy: y + size / 2, fill: fill || color, strokeWidth: borderWidth, stroke: borderColor, opacity: opacity, onMouseEnter: onHover, onMouseMove: onHover, onMouseLeave: onLeave, onClick: event => {
|
|
1933
|
-
onClick({ position, color, x, y, data }, event);
|
|
1934
|
-
} }));
|
|
1935
|
-
|
|
1936
|
-
const WaffleChart = ({ height, width, data, total, tooltip, }) => {
|
|
1937
|
-
return (jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: tooltip
|
|
1938
|
-
? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
|
|
1939
|
-
padding: 0,
|
|
1940
|
-
} }) }) : DEFAULT_CHARTS_THEME, data: [
|
|
1941
|
-
{
|
|
1942
|
-
id: "green-circles",
|
|
1943
|
-
label: data.label,
|
|
1944
|
-
value: data.value,
|
|
1945
|
-
},
|
|
1946
|
-
{
|
|
1947
|
-
id: "grey-circles",
|
|
1948
|
-
label: total.label,
|
|
1949
|
-
value: total.value,
|
|
1950
|
-
},
|
|
1951
|
-
], tooltip: ({ value, label }) => tooltip ? tooltip({ label, value }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${label}: ${value}` }), fillDirection: "bottom", total: total.value, rows: 6, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
|
|
1952
|
-
// @ts-ignore property cellComponent does not exist, but it does
|
|
1953
|
-
cellComponent: (_a) => {
|
|
1954
|
-
var rest = __rest(_a, ["borderWidth", "borderColor"]);
|
|
1955
|
-
return (jsxRuntime.jsx(CustomCell, Object.assign({ borderWidth: 2, borderColor: "white" }, rest)));
|
|
1956
|
-
} }) })));
|
|
1837
|
+
], activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.map((d) => labelFormatter
|
|
1838
|
+
? labelFormatter({
|
|
1839
|
+
label: d.label,
|
|
1840
|
+
id: d.id,
|
|
1841
|
+
value: d.value,
|
|
1842
|
+
data: d,
|
|
1843
|
+
labelPosition: "legend",
|
|
1844
|
+
})
|
|
1845
|
+
: d.id.toString()) }, (typeof legend === "object" && legend)))) : undefined }))] }));
|
|
1957
1846
|
};
|
|
1958
1847
|
|
|
1959
1848
|
var _g$a, _defs$4;
|
|
1960
|
-
function _extends$K() { _extends$K = Object.assign ? Object.assign.bind() : function (
|
|
1849
|
+
function _extends$K() { return _extends$K = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$K.apply(null, arguments); }
|
|
1961
1850
|
const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$K({
|
|
1962
1851
|
width: 27,
|
|
1963
1852
|
height: 26,
|
|
@@ -1981,7 +1870,7 @@ const SvgSentiment1 = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
1981
1870
|
})))));
|
|
1982
1871
|
|
|
1983
1872
|
var _g$9, _defs$3;
|
|
1984
|
-
function _extends$J() { _extends$J = Object.assign ? Object.assign.bind() : function (
|
|
1873
|
+
function _extends$J() { return _extends$J = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$J.apply(null, arguments); }
|
|
1985
1874
|
const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$J({
|
|
1986
1875
|
width: 27,
|
|
1987
1876
|
height: 26,
|
|
@@ -2005,7 +1894,7 @@ const SvgSentiment2 = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
2005
1894
|
})))));
|
|
2006
1895
|
|
|
2007
1896
|
var _g$8, _defs$2;
|
|
2008
|
-
function _extends$I() { _extends$I = Object.assign ? Object.assign.bind() : function (
|
|
1897
|
+
function _extends$I() { return _extends$I = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$I.apply(null, arguments); }
|
|
2009
1898
|
const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$I({
|
|
2010
1899
|
width: 27,
|
|
2011
1900
|
height: 26,
|
|
@@ -2035,7 +1924,7 @@ const SvgSentiment3 = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
2035
1924
|
})))));
|
|
2036
1925
|
|
|
2037
1926
|
var _g$7, _defs$1;
|
|
2038
|
-
function _extends$H() { _extends$H = Object.assign ? Object.assign.bind() : function (
|
|
1927
|
+
function _extends$H() { return _extends$H = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$H.apply(null, arguments); }
|
|
2039
1928
|
const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$H({
|
|
2040
1929
|
width: 27,
|
|
2041
1930
|
height: 26,
|
|
@@ -2065,7 +1954,7 @@ const SvgSentiment4 = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
2065
1954
|
})))));
|
|
2066
1955
|
|
|
2067
1956
|
var _g$6, _defs;
|
|
2068
|
-
function _extends$G() { _extends$G = Object.assign ? Object.assign.bind() : function (
|
|
1957
|
+
function _extends$G() { return _extends$G = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$G.apply(null, arguments); }
|
|
2069
1958
|
const SvgSentiment5 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$G({
|
|
2070
1959
|
width: 26,
|
|
2071
1960
|
height: 26,
|
|
@@ -2294,41 +2183,164 @@ const SentimentChart = ({ data, width, height, margin, tooltip, i18n, }) => {
|
|
|
2294
2183
|
], enableCrosshair: false, isInteractive: true, enableSlices: "x" }) })) }));
|
|
2295
2184
|
};
|
|
2296
2185
|
|
|
2297
|
-
const
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
const SendShortcut = ({ saveText }) => {
|
|
2308
|
-
return (jsxRuntime.jsxs(ShortcutContainer, { children: [jsxRuntime.jsxs(reactTags.Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text$1, { children: saveText || "to save" })] }));
|
|
2309
|
-
};
|
|
2310
|
-
|
|
2311
|
-
const Footer$4 = styled__default["default"].div `
|
|
2312
|
-
display: flex;
|
|
2313
|
-
flex-direction: row;
|
|
2314
|
-
padding: ${({ theme }) => `${theme.space.xs} 0px ${theme.space.sm}`};
|
|
2315
|
-
align-items: center;
|
|
2316
|
-
margin: ${({ theme }) => `0 -${theme.space.base * 4}px`};
|
|
2317
|
-
justify-content: ${({ showShortcut }) => showShortcut ? "space-between" : "flex-end"};
|
|
2318
|
-
gap: ${({ theme }) => theme.space.xs};
|
|
2319
|
-
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
2320
|
-
`;
|
|
2321
|
-
const ChatFooter = ({ saveText, children, showShortcut, }) => {
|
|
2322
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Footer$4, Object.assign({ showShortcut: showShortcut }, { children: showShortcut ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SendShortcut, { saveText: saveText }), children] })) : (children) })) }));
|
|
2186
|
+
const flatten = (data) => data.reduce((acc, item) => {
|
|
2187
|
+
if (item.children) {
|
|
2188
|
+
return [...acc, item, ...flatten(item.children)];
|
|
2189
|
+
}
|
|
2190
|
+
return [...acc, item];
|
|
2191
|
+
}, []);
|
|
2192
|
+
const findChildrenByName = (data, name) => {
|
|
2193
|
+
if (!data.children)
|
|
2194
|
+
return undefined;
|
|
2195
|
+
return flatten(data.children).find((searchedName) => searchedName.name === name);
|
|
2323
2196
|
};
|
|
2324
2197
|
|
|
2325
|
-
const
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2198
|
+
const getChildrenValue = (data) => {
|
|
2199
|
+
if (data.value) {
|
|
2200
|
+
return data.value;
|
|
2201
|
+
}
|
|
2202
|
+
if (data.children) {
|
|
2203
|
+
return data.children.reduce((acc, item) => {
|
|
2204
|
+
return acc + getChildrenValue(item);
|
|
2205
|
+
}, 0);
|
|
2206
|
+
}
|
|
2207
|
+
return 0;
|
|
2208
|
+
};
|
|
2209
|
+
|
|
2210
|
+
const ResetText = styled__default["default"].text `
|
|
2211
|
+
font-size: ${({ radius, theme }) => (parseInt(theme.fontSizes.md.replace("px", "")) * radius) / 130}px;
|
|
2212
|
+
cursor: pointer;
|
|
2213
|
+
|
|
2214
|
+
fill: ${({ theme }) => theme.palette.blue[500]};
|
|
2215
|
+
&:hover {
|
|
2216
|
+
fill: ${({ theme }) => theme.palette.blue[700]};
|
|
2217
|
+
}
|
|
2218
|
+
`;
|
|
2219
|
+
const ResetButton = ({ centerX, centerY, radius, theme, onClick, }) => (jsxRuntime.jsx("g", Object.assign({ transform: `translate(${centerX - radius},${centerY - radius})` }, { children: jsxRuntime.jsx(ResetText, Object.assign({ onClick: onClick, radius: radius }, { children: `< Reset` })) })));
|
|
2220
|
+
|
|
2221
|
+
const SunburstChart = ({ colors, width, height, data, centerItem, margin, onChange, tooltip, legend, }) => {
|
|
2222
|
+
const themeContext = React.useContext(styled.ThemeContext);
|
|
2223
|
+
const [currentData, setCurrentData] = React.useState(data);
|
|
2224
|
+
const [currentColor, setCurrentColor] = React.useState();
|
|
2225
|
+
const [isHovering, setIsHovering] = React.useState(false);
|
|
2226
|
+
const changeDataSlice = ({ data, color, }) => {
|
|
2227
|
+
setCurrentData(data);
|
|
2228
|
+
setCurrentColor(color);
|
|
2229
|
+
};
|
|
2230
|
+
React.useEffect(() => {
|
|
2231
|
+
if (onChange)
|
|
2232
|
+
onChange(currentData);
|
|
2233
|
+
}, [currentData]);
|
|
2234
|
+
if (!data.children)
|
|
2235
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: "No data" });
|
|
2236
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height, style: isHovering ? { cursor: "pointer" } : undefined }, { children: jsxRuntime.jsx(sunburst.ResponsiveSunburst, { theme: tooltip
|
|
2237
|
+
? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
|
|
2238
|
+
padding: 0,
|
|
2239
|
+
} }) }) : DEFAULT_CHARTS_THEME, colors: currentColor
|
|
2240
|
+
? () => currentColor
|
|
2241
|
+
: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, borderWidth: 4, cornerRadius: 4, onMouseEnter: (node) => {
|
|
2242
|
+
if (node.data.children) {
|
|
2243
|
+
setIsHovering(true);
|
|
2244
|
+
}
|
|
2245
|
+
}, onMouseLeave: (node) => {
|
|
2246
|
+
if (node.data.children) {
|
|
2247
|
+
setIsHovering(false);
|
|
2248
|
+
}
|
|
2249
|
+
}, tooltip: tooltip
|
|
2250
|
+
? (node) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: tooltip({
|
|
2251
|
+
label: node.data.label || node.data.name,
|
|
2252
|
+
value: getChildrenValue(node.data),
|
|
2253
|
+
data: Object.assign(Object.assign({}, node.data), { children: undefined }),
|
|
2254
|
+
}) }))
|
|
2255
|
+
: undefined, layers: [
|
|
2256
|
+
"arcs",
|
|
2257
|
+
...(centerItem
|
|
2258
|
+
? [
|
|
2259
|
+
(props) => (jsxRuntime.jsx(CenteredItem, Object.assign({}, props, { fontSizeMultiplier: centerItem.fontSizeMultiplier, theme: themeContext, label: centerItem.label, value: centerItem.value }))),
|
|
2260
|
+
]
|
|
2261
|
+
: []),
|
|
2262
|
+
...(currentColor
|
|
2263
|
+
? [
|
|
2264
|
+
(props) => (jsxRuntime.jsx(ResetButton, { centerX: props.centerX, centerY: props.centerY, radius: props.radius, theme: themeContext, onClick: () => {
|
|
2265
|
+
changeDataSlice({
|
|
2266
|
+
data,
|
|
2267
|
+
});
|
|
2268
|
+
} })),
|
|
2269
|
+
]
|
|
2270
|
+
: []),
|
|
2271
|
+
], id: "name", value: "value", margin: Object.assign({ top: 40, bottom: 40 }, margin), data: currentData, childColor: { from: "color", modifiers: [["brighter", 0.6]] }, onClick: (clickedData) => {
|
|
2272
|
+
const foundObject = findChildrenByName(currentData, clickedData.id.toString());
|
|
2273
|
+
if (foundObject && foundObject.children) {
|
|
2274
|
+
changeDataSlice({
|
|
2275
|
+
data: foundObject,
|
|
2276
|
+
color: clickedData.color,
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
} }) })), jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, Object.assign({ colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL, data: data.children.map((d) => d.label || d.name) }, (typeof legend === "object" && legend)))) : undefined }))] }));
|
|
2280
|
+
};
|
|
2281
|
+
|
|
2282
|
+
const CustomCell = ({ position, size, x, y, color, fill, opacity, borderWidth, borderColor, data, onHover, onLeave, onClick, }) => (jsxRuntime.jsx("circle", { r: size / 2, cx: x + size / 2, cy: y + size / 2, fill: fill || color, strokeWidth: borderWidth, stroke: borderColor, opacity: opacity, onMouseEnter: onHover, onMouseMove: onHover, onMouseLeave: onLeave, onClick: event => {
|
|
2283
|
+
onClick({ position, color, x, y, data }, event);
|
|
2284
|
+
} }));
|
|
2285
|
+
|
|
2286
|
+
const WaffleChart = ({ height, width, data, total, tooltip, }) => {
|
|
2287
|
+
return (jsxRuntime.jsx(ChartContainer, Object.assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: tooltip
|
|
2288
|
+
? Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME), { tooltip: Object.assign(Object.assign({}, DEFAULT_CHARTS_THEME.tooltip), { container: {
|
|
2289
|
+
padding: 0,
|
|
2290
|
+
} }) }) : DEFAULT_CHARTS_THEME, data: [
|
|
2291
|
+
{
|
|
2292
|
+
id: "green-circles",
|
|
2293
|
+
label: data.label,
|
|
2294
|
+
value: data.value,
|
|
2295
|
+
},
|
|
2296
|
+
{
|
|
2297
|
+
id: "grey-circles",
|
|
2298
|
+
label: total.label,
|
|
2299
|
+
value: total.value,
|
|
2300
|
+
},
|
|
2301
|
+
], tooltip: ({ value, label }) => tooltip ? tooltip({ label, value }) : jsxRuntime.jsx(jsxRuntime.Fragment, { children: `${label}: ${value}` }), fillDirection: "bottom", total: total.value, rows: 6, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
|
|
2302
|
+
// @ts-ignore property cellComponent does not exist, but it does
|
|
2303
|
+
cellComponent: (_a) => {
|
|
2304
|
+
var rest = __rest(_a, ["borderWidth", "borderColor"]);
|
|
2305
|
+
return (jsxRuntime.jsx(CustomCell, Object.assign({ borderWidth: 2, borderColor: "white" }, rest)));
|
|
2306
|
+
} }) })));
|
|
2307
|
+
};
|
|
2308
|
+
|
|
2309
|
+
const ShortcutContainer = styled__default["default"].div `
|
|
2310
|
+
display: flex;
|
|
2311
|
+
flex-direction: row;
|
|
2312
|
+
padding: ${({ theme }) => `0 ${theme.space.base * 4}px`};
|
|
2313
|
+
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
2314
|
+
font-size: ${({ theme }) => theme.fontSizes.sm};
|
|
2315
|
+
`;
|
|
2316
|
+
const Text$1 = styled__default["default"](reactTypography.SM) `
|
|
2317
|
+
line-height: 1.7;
|
|
2318
|
+
`;
|
|
2319
|
+
const SendShortcut = ({ saveText }) => {
|
|
2320
|
+
return (jsxRuntime.jsxs(ShortcutContainer, { children: [jsxRuntime.jsxs(reactTags.Tag, { children: [isMac() ? "Cmd" : "Ctrl", "+enter"] }), "\u00A0", jsxRuntime.jsx(Text$1, { children: saveText || "to save" })] }));
|
|
2321
|
+
};
|
|
2322
|
+
|
|
2323
|
+
const Footer$4 = styled__default["default"].div `
|
|
2324
|
+
display: flex;
|
|
2325
|
+
flex-direction: row;
|
|
2326
|
+
padding: ${({ theme }) => `${theme.space.xs} 0px ${theme.space.sm}`};
|
|
2327
|
+
align-items: center;
|
|
2328
|
+
margin: ${({ theme }) => `0 -${theme.space.base * 4}px`};
|
|
2329
|
+
justify-content: ${({ showShortcut }) => showShortcut ? "space-between" : "flex-end"};
|
|
2330
|
+
gap: ${({ theme }) => theme.space.xs};
|
|
2331
|
+
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
2332
|
+
`;
|
|
2333
|
+
const ChatFooter = ({ saveText, children, showShortcut, }) => {
|
|
2334
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Footer$4, Object.assign({ showShortcut: showShortcut }, { children: showShortcut ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SendShortcut, { saveText: saveText }), children] })) : (children) })) }));
|
|
2335
|
+
};
|
|
2336
|
+
|
|
2337
|
+
const ChatContext = React.createContext(null);
|
|
2338
|
+
const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMentionableUsers, children, }) => {
|
|
2339
|
+
const [editor, setEditor] = React.useState();
|
|
2340
|
+
const [thumbnails, setThumbnails] = React.useState([]);
|
|
2341
|
+
const getMentions = (editor) => {
|
|
2342
|
+
const result = [];
|
|
2343
|
+
editor.state.doc.descendants((node) => {
|
|
2332
2344
|
if (node.type.name === "mention") {
|
|
2333
2345
|
// Add only if it's not already in the array
|
|
2334
2346
|
if (!result.some((r) => r.id === node.attrs.id))
|
|
@@ -2732,7 +2744,7 @@ const ChatTitle = styled__default["default"](Title$1) `
|
|
|
2732
2744
|
`;
|
|
2733
2745
|
|
|
2734
2746
|
var _path$x;
|
|
2735
|
-
function _extends$F() { _extends$F = Object.assign ? Object.assign.bind() : function (
|
|
2747
|
+
function _extends$F() { return _extends$F = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$F.apply(null, arguments); }
|
|
2736
2748
|
const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$F({
|
|
2737
2749
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2738
2750
|
width: 16,
|
|
@@ -2745,7 +2757,7 @@ const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
2745
2757
|
})));
|
|
2746
2758
|
|
|
2747
2759
|
var _path$w;
|
|
2748
|
-
function _extends$E() { _extends$E = Object.assign ? Object.assign.bind() : function (
|
|
2760
|
+
function _extends$E() { return _extends$E = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$E.apply(null, arguments); }
|
|
2749
2761
|
const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
|
|
2750
2762
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2751
2763
|
width: 16,
|
|
@@ -2761,7 +2773,7 @@ const SvgItalicFill = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
2761
2773
|
})));
|
|
2762
2774
|
|
|
2763
2775
|
var _path$v, _path2$7;
|
|
2764
|
-
function _extends$D() { _extends$D = Object.assign ? Object.assign.bind() : function (
|
|
2776
|
+
function _extends$D() { return _extends$D = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$D.apply(null, arguments); }
|
|
2765
2777
|
const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$D({
|
|
2766
2778
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2767
2779
|
width: 16,
|
|
@@ -2780,7 +2792,7 @@ const SvgQuoteFill = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
2780
2792
|
})));
|
|
2781
2793
|
|
|
2782
2794
|
var _g$5;
|
|
2783
|
-
function _extends$C() { _extends$C = Object.assign ? Object.assign.bind() : function (
|
|
2795
|
+
function _extends$C() { return _extends$C = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$C.apply(null, arguments); }
|
|
2784
2796
|
const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$C({
|
|
2785
2797
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2786
2798
|
width: 16,
|
|
@@ -2808,7 +2820,7 @@ const SvgH1Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
|
|
|
2808
2820
|
}))));
|
|
2809
2821
|
|
|
2810
2822
|
var _g$4;
|
|
2811
|
-
function _extends$B() { _extends$B = Object.assign ? Object.assign.bind() : function (
|
|
2823
|
+
function _extends$B() { return _extends$B = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$B.apply(null, arguments); }
|
|
2812
2824
|
const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$B({
|
|
2813
2825
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2814
2826
|
width: 16,
|
|
@@ -2836,7 +2848,7 @@ const SvgH2Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
|
|
|
2836
2848
|
}))));
|
|
2837
2849
|
|
|
2838
2850
|
var _g$3;
|
|
2839
|
-
function _extends$A() { _extends$A = Object.assign ? Object.assign.bind() : function (
|
|
2851
|
+
function _extends$A() { return _extends$A = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$A.apply(null, arguments); }
|
|
2840
2852
|
const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$A({
|
|
2841
2853
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2842
2854
|
width: 16,
|
|
@@ -2864,7 +2876,7 @@ const SvgH3Fill = props => /*#__PURE__*/React__namespace.createElement("svg", _e
|
|
|
2864
2876
|
}))));
|
|
2865
2877
|
|
|
2866
2878
|
const StyledIconButton = styled__default["default"](IconButton) ``;
|
|
2867
|
-
const MenuContainer$
|
|
2879
|
+
const MenuContainer$2 = styled__default["default"](Card) `
|
|
2868
2880
|
padding: ${({ theme }) => theme.space.xxs};
|
|
2869
2881
|
|
|
2870
2882
|
${StyledIconButton} {
|
|
@@ -2883,12 +2895,12 @@ const MenuContainer$1 = styled__default["default"](Card) `
|
|
|
2883
2895
|
}
|
|
2884
2896
|
}
|
|
2885
2897
|
`;
|
|
2886
|
-
const FloatingMenu = (props) => {
|
|
2898
|
+
const FloatingMenu$1 = (props) => {
|
|
2887
2899
|
const { editor } = props;
|
|
2888
2900
|
if (!editor) {
|
|
2889
2901
|
return null;
|
|
2890
2902
|
}
|
|
2891
|
-
return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer$
|
|
2903
|
+
return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({}, props, { editor: editor }, { children: jsxRuntime.jsxs(MenuContainer$2, Object.assign({ isFloating: true }, { children: [jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(), isBasic: !editor.isActive("heading", { level: 1 }), isPrimary: editor.isActive("heading", { level: 1 }), isPill: false }, { children: jsxRuntime.jsx(SvgH1Fill, {}, "ug-h1-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(), isBasic: !editor.isActive("heading", { level: 2 }), isPrimary: editor.isActive("heading", { level: 2 }), isPill: false }, { children: jsxRuntime.jsx(SvgH2Fill, {}, "ug-h2-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(), isBasic: !editor.isActive("heading", { level: 3 }), isPrimary: editor.isActive("heading", { level: 3 }), isPill: false }, { children: jsxRuntime.jsx(SvgH3Fill, {}, "ug-h3-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBold().run(), isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false }, { children: jsxRuntime.jsx(SvgBoldFill, {}, "ug-bold-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleItalic().run(), isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false }, { children: jsxRuntime.jsx(SvgItalicFill, {}, "ug-italic-button-bubble-menu") })), jsxRuntime.jsx(StyledIconButton, Object.assign({ size: "small", onClick: () => editor.chain().focus().toggleBlockquote().run(), isBasic: !editor.isActive("blockquote"), isPrimary: editor.isActive("blockquote"), isPill: false }, { children: jsxRuntime.jsx(SvgQuoteFill, {}, "ug-quote-button-bubble-menu") }))] })) })));
|
|
2892
2904
|
};
|
|
2893
2905
|
|
|
2894
2906
|
/**
|
|
@@ -2918,7 +2930,7 @@ const Tooltip = styled__default["default"](TooltipComponent) `
|
|
|
2918
2930
|
`;
|
|
2919
2931
|
|
|
2920
2932
|
var _path$u;
|
|
2921
|
-
function _extends$z() { _extends$z = Object.assign ? Object.assign.bind() : function (
|
|
2933
|
+
function _extends$z() { return _extends$z = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$z.apply(null, arguments); }
|
|
2922
2934
|
const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
|
|
2923
2935
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2924
2936
|
width: 16,
|
|
@@ -2931,7 +2943,7 @@ const SvgBoldStroke = props => /*#__PURE__*/React__namespace.createElement("svg"
|
|
|
2931
2943
|
})));
|
|
2932
2944
|
|
|
2933
2945
|
var _path$t;
|
|
2934
|
-
function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (
|
|
2946
|
+
function _extends$y() { return _extends$y = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$y.apply(null, arguments); }
|
|
2935
2947
|
const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
|
|
2936
2948
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2937
2949
|
width: 16,
|
|
@@ -2946,7 +2958,7 @@ const SvgItalicStroke = props => /*#__PURE__*/React__namespace.createElement("sv
|
|
|
2946
2958
|
})));
|
|
2947
2959
|
|
|
2948
2960
|
var _path$s;
|
|
2949
|
-
function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (
|
|
2961
|
+
function _extends$x() { return _extends$x = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$x.apply(null, arguments); }
|
|
2950
2962
|
const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
|
|
2951
2963
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2952
2964
|
width: 16,
|
|
@@ -2961,7 +2973,7 @@ const SvgAtStroke = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
2961
2973
|
})));
|
|
2962
2974
|
|
|
2963
2975
|
var _path$r;
|
|
2964
|
-
function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (
|
|
2976
|
+
function _extends$w() { return _extends$w = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$w.apply(null, arguments); }
|
|
2965
2977
|
const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
|
|
2966
2978
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2967
2979
|
width: 16,
|
|
@@ -3067,7 +3079,7 @@ function useMedia() {
|
|
|
3067
3079
|
return { getMedia };
|
|
3068
3080
|
}
|
|
3069
3081
|
|
|
3070
|
-
const MenuContainer = styled__default["default"].div `
|
|
3082
|
+
const MenuContainer$1 = styled__default["default"].div `
|
|
3071
3083
|
padding: ${({ theme }) => theme.space.xs} 0;
|
|
3072
3084
|
display: flex;
|
|
3073
3085
|
flex-direction: row;
|
|
@@ -3110,7 +3122,7 @@ const CommentBar = ({ editor, i18n, }) => {
|
|
|
3110
3122
|
}
|
|
3111
3123
|
};
|
|
3112
3124
|
};
|
|
3113
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ style: { textAlign: "center" }, content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : (jsxRuntime.jsxs("span", { children: ["Upload images and video.", " ", jsxRuntime.jsxs("span", Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [" ", jsxRuntime.jsx("br", {}), " Max size: 5GB", " "] }))] })), placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
|
|
3125
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer$1, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ style: { textAlign: "center" }, content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : (jsxRuntime.jsxs("span", { children: ["Upload images and video.", " ", jsxRuntime.jsxs("span", Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [" ", jsxRuntime.jsx("br", {}), " Max size: 5GB", " "] }))] })), placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
|
|
3114
3126
|
};
|
|
3115
3127
|
|
|
3116
3128
|
const CustomMention = Mention__default["default"].extend({
|
|
@@ -3360,7 +3372,7 @@ const editorExtensions = ({ placeholderOptions, mentionableUsers, }) => {
|
|
|
3360
3372
|
};
|
|
3361
3373
|
|
|
3362
3374
|
var _circle$3, _path$q, _path2$6;
|
|
3363
|
-
function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (
|
|
3375
|
+
function _extends$v() { return _extends$v = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$v.apply(null, arguments); }
|
|
3364
3376
|
const SvgRemoveMediaIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
|
|
3365
3377
|
width: 56,
|
|
3366
3378
|
height: 56,
|
|
@@ -3400,7 +3412,7 @@ const DeleteThumbnailX = ({ deleteThumbnail }) => {
|
|
|
3400
3412
|
};
|
|
3401
3413
|
|
|
3402
3414
|
var _circle$2, _path$p;
|
|
3403
|
-
function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (
|
|
3415
|
+
function _extends$u() { return _extends$u = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$u.apply(null, arguments); }
|
|
3404
3416
|
const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
|
|
3405
3417
|
width: 56,
|
|
3406
3418
|
height: 56,
|
|
@@ -3603,7 +3615,7 @@ Lightbox.Footer = Footer$3;
|
|
|
3603
3615
|
Lightbox.Close = reactModals.Close;
|
|
3604
3616
|
|
|
3605
3617
|
var _path$o;
|
|
3606
|
-
function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (
|
|
3618
|
+
function _extends$t() { return _extends$t = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$t.apply(null, arguments); }
|
|
3607
3619
|
const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
|
|
3608
3620
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3609
3621
|
width: 16,
|
|
@@ -3616,7 +3628,7 @@ const SvgChevronLeftStroke = props => /*#__PURE__*/React__namespace.createElemen
|
|
|
3616
3628
|
})));
|
|
3617
3629
|
|
|
3618
3630
|
var _path$n;
|
|
3619
|
-
function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (
|
|
3631
|
+
function _extends$s() { return _extends$s = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$s.apply(null, arguments); }
|
|
3620
3632
|
const SvgChevronRightStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
|
|
3621
3633
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3622
3634
|
width: 16,
|
|
@@ -3847,7 +3859,7 @@ Slider.PrevButton = PrevButton;
|
|
|
3847
3859
|
Slider.NextButton = NextButton;
|
|
3848
3860
|
|
|
3849
3861
|
var _path$m, _path2$5;
|
|
3850
|
-
function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (
|
|
3862
|
+
function _extends$r() { return _extends$r = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$r.apply(null, arguments); }
|
|
3851
3863
|
const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
|
|
3852
3864
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3853
3865
|
width: 16,
|
|
@@ -3864,7 +3876,7 @@ const SvgVolumeMutedFill = props => /*#__PURE__*/React__namespace.createElement(
|
|
|
3864
3876
|
})));
|
|
3865
3877
|
|
|
3866
3878
|
var _path$l, _path2$4;
|
|
3867
|
-
function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (
|
|
3879
|
+
function _extends$q() { return _extends$q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$q.apply(null, arguments); }
|
|
3868
3880
|
const SvgVolumeUnmutedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
|
|
3869
3881
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3870
3882
|
width: 16,
|
|
@@ -3946,7 +3958,7 @@ const useProgressContext = () => {
|
|
|
3946
3958
|
};
|
|
3947
3959
|
|
|
3948
3960
|
var _g$2;
|
|
3949
|
-
function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (
|
|
3961
|
+
function _extends$p() { return _extends$p = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$p.apply(null, arguments); }
|
|
3950
3962
|
const SvgGrip = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
|
|
3951
3963
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3952
3964
|
width: 16,
|
|
@@ -4111,7 +4123,7 @@ const Bookmark = (props) => {
|
|
|
4111
4123
|
};
|
|
4112
4124
|
|
|
4113
4125
|
var _path$k, _path2$3, _path3$1;
|
|
4114
|
-
function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (
|
|
4126
|
+
function _extends$o() { return _extends$o = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$o.apply(null, arguments); }
|
|
4115
4127
|
const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
|
|
4116
4128
|
width: 16,
|
|
4117
4129
|
height: 16,
|
|
@@ -4132,7 +4144,7 @@ const SvgBackSecondsFill = props => /*#__PURE__*/React__namespace.createElement(
|
|
|
4132
4144
|
})));
|
|
4133
4145
|
|
|
4134
4146
|
var _path$j, _path2$2, _path3;
|
|
4135
|
-
function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (
|
|
4147
|
+
function _extends$n() { return _extends$n = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$n.apply(null, arguments); }
|
|
4136
4148
|
const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
|
|
4137
4149
|
width: 16,
|
|
4138
4150
|
height: 16,
|
|
@@ -4153,7 +4165,7 @@ const SvgForwardSecondsFill = props => /*#__PURE__*/React__namespace.createEleme
|
|
|
4153
4165
|
})));
|
|
4154
4166
|
|
|
4155
4167
|
var _g$1;
|
|
4156
|
-
function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (
|
|
4168
|
+
function _extends$m() { return _extends$m = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$m.apply(null, arguments); }
|
|
4157
4169
|
const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
|
|
4158
4170
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4159
4171
|
width: 16,
|
|
@@ -4179,7 +4191,7 @@ const SvgPauseFill = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
4179
4191
|
}))));
|
|
4180
4192
|
|
|
4181
4193
|
var _path$i;
|
|
4182
|
-
function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (
|
|
4194
|
+
function _extends$l() { return _extends$l = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$l.apply(null, arguments); }
|
|
4183
4195
|
const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
|
|
4184
4196
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4185
4197
|
width: 16,
|
|
@@ -4192,7 +4204,7 @@ const SvgPlayFill = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
4192
4204
|
})));
|
|
4193
4205
|
|
|
4194
4206
|
var _path$h, _path2$1;
|
|
4195
|
-
function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (
|
|
4207
|
+
function _extends$k() { return _extends$k = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$k.apply(null, arguments); }
|
|
4196
4208
|
const SvgPreviousFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
|
|
4197
4209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4198
4210
|
width: 16,
|
|
@@ -4279,7 +4291,7 @@ const ControlsGroupCenter = (props) => {
|
|
|
4279
4291
|
};
|
|
4280
4292
|
|
|
4281
4293
|
var _path$g, _circle$1;
|
|
4282
|
-
function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (
|
|
4294
|
+
function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
|
|
4283
4295
|
const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
|
|
4284
4296
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4285
4297
|
width: 16,
|
|
@@ -4298,7 +4310,7 @@ const SvgTagStroke = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
4298
4310
|
})));
|
|
4299
4311
|
|
|
4300
4312
|
var _path$f;
|
|
4301
|
-
function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (
|
|
4313
|
+
function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
|
|
4302
4314
|
const SvgPlus$1 = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
|
|
4303
4315
|
width: 12,
|
|
4304
4316
|
height: 12,
|
|
@@ -4331,7 +4343,7 @@ const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
|
|
|
4331
4343
|
};
|
|
4332
4344
|
|
|
4333
4345
|
var _path$e;
|
|
4334
|
-
function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (
|
|
4346
|
+
function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
|
|
4335
4347
|
const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
|
|
4336
4348
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4337
4349
|
width: 16,
|
|
@@ -4346,7 +4358,7 @@ const SvgMaximizeStroke = props => /*#__PURE__*/React__namespace.createElement("
|
|
|
4346
4358
|
})));
|
|
4347
4359
|
|
|
4348
4360
|
var _path$d;
|
|
4349
|
-
function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (
|
|
4361
|
+
function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
|
|
4350
4362
|
const SvgMinimizeStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
|
|
4351
4363
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4352
4364
|
width: 16,
|
|
@@ -4655,7 +4667,7 @@ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpd
|
|
|
4655
4667
|
};
|
|
4656
4668
|
|
|
4657
4669
|
var _path$c;
|
|
4658
|
-
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (
|
|
4670
|
+
function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
|
|
4659
4671
|
const SvgPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
|
|
4660
4672
|
width: 70,
|
|
4661
4673
|
height: 70,
|
|
@@ -4780,6 +4792,79 @@ const StyledDiv = styled__default["default"].div `
|
|
|
4780
4792
|
`;
|
|
4781
4793
|
const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx(Spinner, { size: "50", color: "white" }) }));
|
|
4782
4794
|
|
|
4795
|
+
const usePictureInPicture = (videoRef, pipMode, onPipChange) => {
|
|
4796
|
+
const getObserver = (videoRef, isVideoPlaying) => {
|
|
4797
|
+
return new IntersectionObserver((entries) => {
|
|
4798
|
+
entries.forEach((entry) => {
|
|
4799
|
+
if (!entry.isIntersecting && isVideoPlaying()) {
|
|
4800
|
+
videoRef.requestPictureInPicture();
|
|
4801
|
+
}
|
|
4802
|
+
if (document.pictureInPictureElement &&
|
|
4803
|
+
entry.isIntersecting &&
|
|
4804
|
+
!isVideoPlaying()) {
|
|
4805
|
+
document.exitPictureInPicture();
|
|
4806
|
+
}
|
|
4807
|
+
});
|
|
4808
|
+
}, { threshold: 0.5 });
|
|
4809
|
+
};
|
|
4810
|
+
const handleManualPipMode = (videoRef, pipMode) => {
|
|
4811
|
+
if (pipMode) {
|
|
4812
|
+
videoRef.requestPictureInPicture();
|
|
4813
|
+
}
|
|
4814
|
+
if (!pipMode && document.pictureInPictureElement) {
|
|
4815
|
+
document.exitPictureInPicture();
|
|
4816
|
+
}
|
|
4817
|
+
};
|
|
4818
|
+
React.useEffect(() => {
|
|
4819
|
+
// bail out if pipMode is not defined or videoRef is not defined or pip is not supported
|
|
4820
|
+
if (typeof pipMode === "undefined")
|
|
4821
|
+
return;
|
|
4822
|
+
if (!document.pictureInPictureEnabled) {
|
|
4823
|
+
console.warn("Picture-in-Picture is not supported in this browser");
|
|
4824
|
+
return;
|
|
4825
|
+
}
|
|
4826
|
+
if (!videoRef)
|
|
4827
|
+
return;
|
|
4828
|
+
// if pipMode is auto, we will enter picture in picture mode when the video is not in view
|
|
4829
|
+
if (pipMode === "auto") {
|
|
4830
|
+
const isVideoPlaying = () => videoRef.currentTime > 0 &&
|
|
4831
|
+
!videoRef.paused &&
|
|
4832
|
+
!videoRef.ended &&
|
|
4833
|
+
videoRef.readyState > 2;
|
|
4834
|
+
const observer = getObserver(videoRef, isVideoPlaying);
|
|
4835
|
+
observer.observe(videoRef);
|
|
4836
|
+
return () => {
|
|
4837
|
+
observer.disconnect();
|
|
4838
|
+
};
|
|
4839
|
+
}
|
|
4840
|
+
else if (typeof pipMode === "boolean") {
|
|
4841
|
+
handleManualPipMode(videoRef, pipMode);
|
|
4842
|
+
}
|
|
4843
|
+
else {
|
|
4844
|
+
handleManualPipMode(videoRef, pipMode());
|
|
4845
|
+
}
|
|
4846
|
+
}, [pipMode, videoRef]);
|
|
4847
|
+
React.useEffect(() => {
|
|
4848
|
+
if (!document.pictureInPictureEnabled) {
|
|
4849
|
+
return;
|
|
4850
|
+
}
|
|
4851
|
+
document.addEventListener("enterpictureinpicture", () => {
|
|
4852
|
+
onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(true);
|
|
4853
|
+
});
|
|
4854
|
+
document.addEventListener("leavepictureinpicture", () => {
|
|
4855
|
+
onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(false);
|
|
4856
|
+
});
|
|
4857
|
+
return () => {
|
|
4858
|
+
document.removeEventListener("enterpictureinpicture", () => {
|
|
4859
|
+
onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(true);
|
|
4860
|
+
});
|
|
4861
|
+
document.removeEventListener("leavepictureinpicture", () => {
|
|
4862
|
+
onPipChange === null || onPipChange === void 0 ? void 0 : onPipChange(false);
|
|
4863
|
+
});
|
|
4864
|
+
};
|
|
4865
|
+
}, [onPipChange]);
|
|
4866
|
+
};
|
|
4867
|
+
|
|
4783
4868
|
/**
|
|
4784
4869
|
* The Player is a styled media tag with custom controls
|
|
4785
4870
|
* <hr>
|
|
@@ -4790,11 +4875,14 @@ const Player = React.forwardRef((props, forwardRef) => (jsxRuntime.jsx(Video__de
|
|
|
4790
4875
|
const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
4791
4876
|
var _a;
|
|
4792
4877
|
const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
|
|
4793
|
-
const { onCutHandler, bookmarks, isCutting } = props;
|
|
4878
|
+
const { onCutHandler, bookmarks, isCutting, pipMode, onPipChange } = props;
|
|
4794
4879
|
const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
|
|
4795
4880
|
const isLoaded = !!videoRef;
|
|
4796
4881
|
const containerRef = React.useRef(null);
|
|
4797
|
-
React.useImperativeHandle(forwardRef, () => videoRef, [
|
|
4882
|
+
React.useImperativeHandle(forwardRef, () => videoRef, [
|
|
4883
|
+
videoRef,
|
|
4884
|
+
]);
|
|
4885
|
+
usePictureInPicture(videoRef, pipMode, onPipChange);
|
|
4798
4886
|
React.useEffect(() => {
|
|
4799
4887
|
if (videoRef) {
|
|
4800
4888
|
videoRef.addEventListener("pause", () => {
|
|
@@ -4809,8 +4897,10 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
|
4809
4897
|
}
|
|
4810
4898
|
};
|
|
4811
4899
|
}, [setIsPlaying, videoRef]);
|
|
4812
|
-
return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef
|
|
4813
|
-
});
|
|
4900
|
+
return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(ProgressContextProvider, { children: jsxRuntime.jsx(Controls, { container: containerRef.current, onCutHandler: onCutHandler, bookmarks: bookmarks, isCutting: isCutting, onBookMarkUpdated: props.handleBookmarkUpdate, i18n: props.i18n }) })] })));
|
|
4901
|
+
});
|
|
4902
|
+
const PlayerProvider = (props) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: props.children })));
|
|
4903
|
+
PlayerProvider.Core = PlayerCore;
|
|
4814
4904
|
|
|
4815
4905
|
const MediaLightBox = ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }) => {
|
|
4816
4906
|
if (!isOpen) {
|
|
@@ -4895,7 +4985,7 @@ const CommentBox = (_a) => {
|
|
|
4895
4985
|
return null;
|
|
4896
4986
|
ed.on("create", ({ editor }) => setEditor(editor));
|
|
4897
4987
|
ed.on("update", ({ editor }) => setEditor(editor));
|
|
4898
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: (_b = thumbnails[selectedImageIndex]) === null || _b === void 0 ? void 0 : _b.name, onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: thumbnails, videoRefs: videoRefs }), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0, paddingBottom: 12 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n })] }));
|
|
4988
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: (_b = thumbnails[selectedImageIndex]) === null || _b === void 0 ? void 0 : _b.name, onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: thumbnails, videoRefs: videoRefs }), jsxRuntime.jsx(ChatBoxContainer, { children: jsxRuntime.jsxs(EditorContainer$1, Object.assign({ editable: true, style: { marginLeft: 0, paddingBottom: 12 } }, { children: [hasFloatingMenu && (jsxRuntime.jsx(FloatingMenu$1, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), jsxRuntime.jsx(ThumbnailContainer, { openLightbox: handleOpenLightbox })] })) }), hasButtonsMenu && jsxRuntime.jsx(CommentBar, { editor: ed, i18n: i18n })] }));
|
|
4899
4989
|
};
|
|
4900
4990
|
|
|
4901
4991
|
const UgGrid = styled__default["default"](reactGrid.Grid) `
|
|
@@ -4995,6 +5085,7 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
|
|
|
4995
5085
|
handleClickThumbnail(index);
|
|
4996
5086
|
} }) }), index))) })) }), jsxRuntime.jsx(MediaLightBox, { isOpen: isOpen, header: jsxRuntime.jsxs(reactTypography.MD, Object.assign({ isBold: true }, { children: [jsxRuntime.jsx(Grey600Span, { children: header && header.title }), header && header.message && (jsxRuntime.jsxs(Grey800Span, { children: [" | ", header.message] }))] })), onClose: closeLightbox, slideChange: slideChange, selectedImageIndex: selectedImageIndex, thumbnails: media, videoRefs: videoRefs, details: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
|
|
4997
5087
|
avatar: author.avatar,
|
|
5088
|
+
avatarType: author.avatarType,
|
|
4998
5089
|
name: author.name,
|
|
4999
5090
|
}, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }), jsxRuntime.jsx(Footer$2, { children: children })] }));
|
|
5000
5091
|
};
|
|
@@ -5018,7 +5109,7 @@ Chat.Input = CommentBox;
|
|
|
5018
5109
|
Chat.Footer = ChatFooter;
|
|
5019
5110
|
|
|
5020
5111
|
var _circle;
|
|
5021
|
-
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (
|
|
5112
|
+
function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
|
|
5022
5113
|
const SvgCircleFullFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
|
|
5023
5114
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5024
5115
|
width: 16,
|
|
@@ -5101,6 +5192,79 @@ Drawer.Footer = reactModals.DrawerModal.Footer;
|
|
|
5101
5192
|
Drawer.FooterItem = reactModals.DrawerModal.FooterItem;
|
|
5102
5193
|
Drawer.Close = reactModals.DrawerModal.Close;
|
|
5103
5194
|
|
|
5195
|
+
const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
|
|
5196
|
+
width: 100%;
|
|
5197
|
+
`;
|
|
5198
|
+
/**
|
|
5199
|
+
* Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
|
|
5200
|
+
* <hr>
|
|
5201
|
+
* Used for this:
|
|
5202
|
+
- To filter down a large list of options
|
|
5203
|
+
- To quickly find a known option
|
|
5204
|
+
* Not for this:
|
|
5205
|
+
- To make more than one selection, use Multiselect instead
|
|
5206
|
+
*/
|
|
5207
|
+
const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
|
|
5208
|
+
|
|
5209
|
+
const StyledMenu = styled__default["default"](reactDropdowns.Menu) `
|
|
5210
|
+
width: auto !important;
|
|
5211
|
+
`;
|
|
5212
|
+
/**
|
|
5213
|
+
* A Menu is a wrapper for items elements
|
|
5214
|
+
**/
|
|
5215
|
+
const Menu = (props) => jsxRuntime.jsx(StyledMenu, Object.assign({}, props));
|
|
5216
|
+
// Extras
|
|
5217
|
+
const PreviousItem = (props) => (jsxRuntime.jsx(reactDropdowns.PreviousItem, Object.assign({}, props)));
|
|
5218
|
+
const Separator = (props) => (jsxRuntime.jsx(reactDropdowns.Separator, Object.assign({}, props)));
|
|
5219
|
+
const NextItem = (props) => jsxRuntime.jsx(reactDropdowns.NextItem, Object.assign({}, props));
|
|
5220
|
+
const ItemMeta = (props) => (jsxRuntime.jsx(reactDropdowns.ItemMeta, Object.assign({}, props)));
|
|
5221
|
+
const MediaBody = (props) => (jsxRuntime.jsx(reactDropdowns.MediaBody, Object.assign({}, props)));
|
|
5222
|
+
const MediaFigure = (props) => (jsxRuntime.jsx(reactDropdowns.MediaFigure, Object.assign({}, props)));
|
|
5223
|
+
const MediaItem = (props) => (jsxRuntime.jsx(reactDropdowns.MediaItem, Object.assign({}, props)));
|
|
5224
|
+
|
|
5225
|
+
const StyledLabel$2 = styled__default["default"](reactForms.Label) ``;
|
|
5226
|
+
/**
|
|
5227
|
+
* A Label is used to specify a title for an input.
|
|
5228
|
+
* <hr>
|
|
5229
|
+
**/
|
|
5230
|
+
const Label$2 = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
|
|
5231
|
+
|
|
5232
|
+
const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
|
|
5233
|
+
|
|
5234
|
+
const UgSelect = styled__default["default"](reactDropdowns.Select) `
|
|
5235
|
+
${(props) => props.isPrimary &&
|
|
5236
|
+
`
|
|
5237
|
+
background-color: ${props.theme.palette.blue[600]};
|
|
5238
|
+
color: white;
|
|
5239
|
+
& svg[data-garden-id="forms.media_figure"] {
|
|
5240
|
+
color: white;
|
|
5241
|
+
}
|
|
5242
|
+
`}
|
|
5243
|
+
`;
|
|
5244
|
+
/**
|
|
5245
|
+
* Select allows a user to pick one option from a list. This helps simplify the UI when space is limited
|
|
5246
|
+
* <hr>
|
|
5247
|
+
* Used for this:
|
|
5248
|
+
- To make a selection from a list of options
|
|
5249
|
+
* Not for this:
|
|
5250
|
+
- To filter a large list of options, use Autocomplete instead
|
|
5251
|
+
- To make multiple selections from a list, use Multiselect instead
|
|
5252
|
+
- To select from a list on mobile, use a native Select instead
|
|
5253
|
+
*/
|
|
5254
|
+
const Select = (props) => jsxRuntime.jsx(UgSelect, Object.assign({}, props));
|
|
5255
|
+
const StyledDropdown = styled__default["default"].div `
|
|
5256
|
+
${StyledLabel$2} {
|
|
5257
|
+
display: block;
|
|
5258
|
+
}
|
|
5259
|
+
`;
|
|
5260
|
+
const StyledMenuHeaderItem = styled__default["default"](MenuHeaderItem) `
|
|
5261
|
+
pointer-events: none;
|
|
5262
|
+
`;
|
|
5263
|
+
const Dropdown = (props) => (jsxRuntime.jsx(StyledDropdown, { children: jsxRuntime.jsx(reactDropdowns.Dropdown, Object.assign({}, props)) }));
|
|
5264
|
+
const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign({}, props));
|
|
5265
|
+
Dropdown.HeaderItem = StyledMenuHeaderItem;
|
|
5266
|
+
Dropdown.Separator = Separator;
|
|
5267
|
+
|
|
5104
5268
|
const Field$1 = styled__default["default"](reactDropdowns.Field) ``;
|
|
5105
5269
|
|
|
5106
5270
|
var index$1 = /*#__PURE__*/Object.freeze({
|
|
@@ -5132,120 +5296,6 @@ const UgItem = styled__default["default"](reactDropdowns.Item) `
|
|
|
5132
5296
|
`;
|
|
5133
5297
|
const Item$1 = (props) => jsxRuntime.jsx(UgItem, Object.assign({}, props));
|
|
5134
5298
|
|
|
5135
|
-
const Container = styled__default["default"].div `
|
|
5136
|
-
display: flex;
|
|
5137
|
-
flex-direction: row;
|
|
5138
|
-
align-items: center;
|
|
5139
|
-
justify-content: flex-start;
|
|
5140
|
-
width: 100%;
|
|
5141
|
-
`;
|
|
5142
|
-
const MetaContainer$1 = styled__default["default"].div `
|
|
5143
|
-
display: flex;
|
|
5144
|
-
flex-direction: column;
|
|
5145
|
-
align-items: flex-start;
|
|
5146
|
-
justify-content: center;
|
|
5147
|
-
`;
|
|
5148
|
-
const ThumbContainer = styled__default["default"].div `
|
|
5149
|
-
display: flex;
|
|
5150
|
-
flex-direction: row;
|
|
5151
|
-
align-items: center;
|
|
5152
|
-
justify-content: center;
|
|
5153
|
-
margin-right: ${({ theme }) => theme.space.sm};
|
|
5154
|
-
width: 100%;
|
|
5155
|
-
max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
|
|
5156
|
-
|
|
5157
|
-
> div {
|
|
5158
|
-
height: 100%;
|
|
5159
|
-
}
|
|
5160
|
-
`;
|
|
5161
|
-
const Label$1 = styled__default["default"](MD) `
|
|
5162
|
-
font-weight: ${({ theme }) => theme.fontWeights.medium};
|
|
5163
|
-
color: ${({ theme }) => theme.palette.grey[800]};
|
|
5164
|
-
`;
|
|
5165
|
-
const Description$1 = styled__default["default"](SM) `
|
|
5166
|
-
color: ${({ theme }) => theme.palette.grey[600]};
|
|
5167
|
-
`;
|
|
5168
|
-
const Image$1 = React.memo(({ src }) => {
|
|
5169
|
-
return jsxRuntime.jsx("img", { src: src });
|
|
5170
|
-
});
|
|
5171
|
-
const ItemContent = (props) => {
|
|
5172
|
-
const { thumbSrc, description, label } = props;
|
|
5173
|
-
return (jsxRuntime.jsxs(Container, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
|
|
5174
|
-
};
|
|
5175
|
-
|
|
5176
|
-
const StyledMenu = styled__default["default"](reactDropdowns.Menu) `
|
|
5177
|
-
width: auto !important;
|
|
5178
|
-
`;
|
|
5179
|
-
/**
|
|
5180
|
-
* A Menu is a wrapper for items elements
|
|
5181
|
-
**/
|
|
5182
|
-
const Menu = (props) => jsxRuntime.jsx(StyledMenu, Object.assign({}, props));
|
|
5183
|
-
// Extras
|
|
5184
|
-
const PreviousItem = (props) => (jsxRuntime.jsx(reactDropdowns.PreviousItem, Object.assign({}, props)));
|
|
5185
|
-
const Separator = (props) => (jsxRuntime.jsx(reactDropdowns.Separator, Object.assign({}, props)));
|
|
5186
|
-
const NextItem = (props) => jsxRuntime.jsx(reactDropdowns.NextItem, Object.assign({}, props));
|
|
5187
|
-
const ItemMeta = (props) => (jsxRuntime.jsx(reactDropdowns.ItemMeta, Object.assign({}, props)));
|
|
5188
|
-
const MediaBody = (props) => (jsxRuntime.jsx(reactDropdowns.MediaBody, Object.assign({}, props)));
|
|
5189
|
-
const MediaFigure = (props) => (jsxRuntime.jsx(reactDropdowns.MediaFigure, Object.assign({}, props)));
|
|
5190
|
-
const MediaItem = (props) => (jsxRuntime.jsx(reactDropdowns.MediaItem, Object.assign({}, props)));
|
|
5191
|
-
|
|
5192
|
-
const StyledAutocomplete$1 = styled__default["default"](reactDropdowns.Autocomplete) `
|
|
5193
|
-
width: 100%;
|
|
5194
|
-
`;
|
|
5195
|
-
/**
|
|
5196
|
-
* Autocomplete is an input field that filters results as users type. This helps users find something quickly in a large list of options.
|
|
5197
|
-
* <hr>
|
|
5198
|
-
* Used for this:
|
|
5199
|
-
- To filter down a large list of options
|
|
5200
|
-
- To quickly find a known option
|
|
5201
|
-
* Not for this:
|
|
5202
|
-
- To make more than one selection, use Multiselect instead
|
|
5203
|
-
*/
|
|
5204
|
-
const Autocomplete = (props) => (jsxRuntime.jsx(StyledAutocomplete$1, Object.assign({}, props)));
|
|
5205
|
-
|
|
5206
|
-
const StyledLabel$2 = styled__default["default"](reactForms.Label) ``;
|
|
5207
|
-
/**
|
|
5208
|
-
* A Label is used to specify a title for an input.
|
|
5209
|
-
* <hr>
|
|
5210
|
-
**/
|
|
5211
|
-
const Label = (props) => jsxRuntime.jsx(StyledLabel$2, Object.assign({}, props));
|
|
5212
|
-
|
|
5213
|
-
const MenuHeaderItem = (props) => (jsxRuntime.jsx(reactDropdowns.HeaderItem, Object.assign({}, props)));
|
|
5214
|
-
|
|
5215
|
-
const UgSelect = styled__default["default"](reactDropdowns.Select) `
|
|
5216
|
-
${(props) => props.isPrimary &&
|
|
5217
|
-
`
|
|
5218
|
-
background-color: ${props.theme.palette.blue[600]};
|
|
5219
|
-
color: white;
|
|
5220
|
-
& svg[data-garden-id="forms.media_figure"] {
|
|
5221
|
-
color: white;
|
|
5222
|
-
}
|
|
5223
|
-
`}
|
|
5224
|
-
`;
|
|
5225
|
-
/**
|
|
5226
|
-
* Select allows a user to pick one option from a list. This helps simplify the UI when space is limited
|
|
5227
|
-
* <hr>
|
|
5228
|
-
* Used for this:
|
|
5229
|
-
- To make a selection from a list of options
|
|
5230
|
-
* Not for this:
|
|
5231
|
-
- To filter a large list of options, use Autocomplete instead
|
|
5232
|
-
- To make multiple selections from a list, use Multiselect instead
|
|
5233
|
-
- To select from a list on mobile, use a native Select instead
|
|
5234
|
-
*/
|
|
5235
|
-
const Select = (props) => jsxRuntime.jsx(UgSelect, Object.assign({}, props));
|
|
5236
|
-
const StyledDropdown = styled__default["default"].div `
|
|
5237
|
-
${StyledLabel$2} {
|
|
5238
|
-
display: block;
|
|
5239
|
-
}
|
|
5240
|
-
`;
|
|
5241
|
-
const StyledMenuHeaderItem = styled__default["default"](MenuHeaderItem) `
|
|
5242
|
-
pointer-events: none;
|
|
5243
|
-
`;
|
|
5244
|
-
const Dropdown = (props) => (jsxRuntime.jsx(StyledDropdown, { children: jsxRuntime.jsx(reactDropdowns.Dropdown, Object.assign({}, props)) }));
|
|
5245
|
-
const Message = (props) => jsxRuntime.jsx(reactDropdowns.Message, Object.assign({}, props));
|
|
5246
|
-
Dropdown.HeaderItem = StyledMenuHeaderItem;
|
|
5247
|
-
Dropdown.Separator = Separator;
|
|
5248
|
-
|
|
5249
5299
|
const StyledAutocomplete = styled__default["default"](Autocomplete) `
|
|
5250
5300
|
${(props) => props.hasSelectedItems &&
|
|
5251
5301
|
`
|
|
@@ -5283,13 +5333,54 @@ const CounterMultiselect = ({ options, label, i18n, onChange, isCompact, }) => {
|
|
|
5283
5333
|
}, onStateChange: (changes) => {
|
|
5284
5334
|
if (changes.isOpen === false)
|
|
5285
5335
|
setInputValue("");
|
|
5286
|
-
}, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
|
|
5336
|
+
}, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [label && jsxRuntime.jsx(Label$2, { children: label }), jsxRuntime.jsx(StyledAutocomplete, Object.assign({ isCompact: isCompact, hasSelectedItems: hasSelectedItems }, { children: hasSelectedItems
|
|
5287
5337
|
? (i18n === null || i18n === void 0 ? void 0 : i18n.counterText)
|
|
5288
5338
|
? i18n.counterText(selectedItems.length)
|
|
5289
5339
|
: `Items (${selectedItems.length})`
|
|
5290
5340
|
: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.noItems) !== null && _a !== void 0 ? _a : "No items" }))] }), jsxRuntime.jsx(Menu, Object.assign({ isCompact: isCompact }, { children: matchingOptions.length === 0 ? (jsxRuntime.jsx(Item$1, Object.assign({ disabled: true }, { children: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.noMatches) !== null && _b !== void 0 ? _b : "No matches found" }))) : (matchingOptions.map((option) => (jsxRuntime.jsx(Item$1, Object.assign({ value: option }, option, { children: jsxRuntime.jsx("span", { children: option.label }) }), option.itemId)))) }))] })) }));
|
|
5291
5341
|
};
|
|
5292
5342
|
|
|
5343
|
+
const Container = styled__default["default"].div `
|
|
5344
|
+
display: flex;
|
|
5345
|
+
flex-direction: row;
|
|
5346
|
+
align-items: center;
|
|
5347
|
+
justify-content: flex-start;
|
|
5348
|
+
width: 100%;
|
|
5349
|
+
`;
|
|
5350
|
+
const MetaContainer$1 = styled__default["default"].div `
|
|
5351
|
+
display: flex;
|
|
5352
|
+
flex-direction: column;
|
|
5353
|
+
align-items: flex-start;
|
|
5354
|
+
justify-content: center;
|
|
5355
|
+
`;
|
|
5356
|
+
const ThumbContainer = styled__default["default"].div `
|
|
5357
|
+
display: flex;
|
|
5358
|
+
flex-direction: row;
|
|
5359
|
+
align-items: center;
|
|
5360
|
+
justify-content: center;
|
|
5361
|
+
margin-right: ${({ theme }) => theme.space.sm};
|
|
5362
|
+
width: 100%;
|
|
5363
|
+
max-width: ${({ theme }) => theme.components.autocomplete.thumbSize};
|
|
5364
|
+
|
|
5365
|
+
> div {
|
|
5366
|
+
height: 100%;
|
|
5367
|
+
}
|
|
5368
|
+
`;
|
|
5369
|
+
const Label$1 = styled__default["default"](MD) `
|
|
5370
|
+
font-weight: ${({ theme }) => theme.fontWeights.medium};
|
|
5371
|
+
color: ${({ theme }) => theme.palette.grey[800]};
|
|
5372
|
+
`;
|
|
5373
|
+
const Description$1 = styled__default["default"](SM) `
|
|
5374
|
+
color: ${({ theme }) => theme.palette.grey[600]};
|
|
5375
|
+
`;
|
|
5376
|
+
const Image$1 = React.memo(({ src }) => {
|
|
5377
|
+
return jsxRuntime.jsx("img", { src: src });
|
|
5378
|
+
});
|
|
5379
|
+
const ItemContent = (props) => {
|
|
5380
|
+
const { thumbSrc, description, label } = props;
|
|
5381
|
+
return (jsxRuntime.jsxs(Container, { children: [thumbSrc && (jsxRuntime.jsx(ThumbContainer, { children: jsxRuntime.jsx(Image$1, { src: thumbSrc }) })), jsxRuntime.jsxs(MetaContainer$1, { children: [label && jsxRuntime.jsx(Label$1, Object.assign({ isBold: true }, { children: label })), description && jsxRuntime.jsx(Description$1, { children: description })] })] }));
|
|
5382
|
+
};
|
|
5383
|
+
|
|
5293
5384
|
const Header$1 = styled__default["default"].div `
|
|
5294
5385
|
display: flex;
|
|
5295
5386
|
flex-direction: column;
|
|
@@ -5393,7 +5484,7 @@ const Editor = (_a) => {
|
|
|
5393
5484
|
}
|
|
5394
5485
|
// Add here because we want to keep also the listener from the props.
|
|
5395
5486
|
ed.on("update", ({ editor }) => setActiveEditor(editor));
|
|
5396
|
-
return (jsxRuntime.jsxs(EditorContainer, Object.assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
|
|
5487
|
+
return (jsxRuntime.jsxs(EditorContainer, Object.assign({ editable: isEditable, validation: props.validation }, { children: [isEditable && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(EditorHeader, { title: headerTitle, validation: props.validation }), hasInlineMenu && (jsxRuntime.jsx(FloatingMenu$1, { editor: ed, tippyOptions: Object.assign({}, bubbleOptions) }))] })), jsxRuntime.jsx(react.EditorContent, { editor: ed, onKeyDown: onKeyDown }), isEditable && jsxRuntime.jsx(EditorFooter, { saveText: footerSaveText })] })));
|
|
5397
5488
|
};
|
|
5398
5489
|
|
|
5399
5490
|
const UgCheckbox = styled__default["default"](reactForms.Checkbox) ``;
|
|
@@ -5409,7 +5500,7 @@ const UgCheckbox = styled__default["default"](reactForms.Checkbox) ``;
|
|
|
5409
5500
|
**/
|
|
5410
5501
|
const Checkbox = (props) => jsxRuntime.jsx(UgCheckbox, Object.assign({}, props));
|
|
5411
5502
|
|
|
5412
|
-
const StyledLabel$1 = styled__default["default"](Label) `
|
|
5503
|
+
const StyledLabel$1 = styled__default["default"](Label$2) `
|
|
5413
5504
|
margin: ${({ theme }) => theme.space.base}px auto;
|
|
5414
5505
|
`;
|
|
5415
5506
|
const CheckboxCard = (props) => {
|
|
@@ -5446,7 +5537,7 @@ const Hint = styled__default["default"](reactForms.Hint) ``;
|
|
|
5446
5537
|
const Input = React.forwardRef((props, ref) => jsxRuntime.jsx(UgInput, Object.assign({ ref: ref }, props)));
|
|
5447
5538
|
|
|
5448
5539
|
var _g;
|
|
5449
|
-
function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (
|
|
5540
|
+
function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
|
|
5450
5541
|
const SvgNotesStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
|
|
5451
5542
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5452
5543
|
width: 16,
|
|
@@ -5479,7 +5570,7 @@ const StyledInput = styled__default["default"](Input) `
|
|
|
5479
5570
|
transition: border-color 0.2s ease-in-out 0.1s;
|
|
5480
5571
|
}
|
|
5481
5572
|
`;
|
|
5482
|
-
const StyledLabel = styled__default["default"](Label) `
|
|
5573
|
+
const StyledLabel = styled__default["default"](Label$2) `
|
|
5483
5574
|
padding: ${({ theme }) => `${theme.space.xxs} ${theme.space.xxs} 0`};
|
|
5484
5575
|
transition: opacity 0.2s ease-in-out;
|
|
5485
5576
|
`;
|
|
@@ -5566,7 +5657,7 @@ const UgRadio = styled__default["default"](reactForms.Radio) ``;
|
|
|
5566
5657
|
const Radio = (props) => jsxRuntime.jsx(UgRadio, Object.assign({}, props));
|
|
5567
5658
|
|
|
5568
5659
|
var _path$b;
|
|
5569
|
-
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (
|
|
5660
|
+
function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
|
|
5570
5661
|
const SvgCheckLg = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
5571
5662
|
width: 16,
|
|
5572
5663
|
height: 16,
|
|
@@ -5688,12 +5779,15 @@ const StyledWord = styled__default["default"].div `
|
|
|
5688
5779
|
|
|
5689
5780
|
${({ observations, theme }) => {
|
|
5690
5781
|
var _a;
|
|
5691
|
-
return observations &&
|
|
5782
|
+
return observations &&
|
|
5783
|
+
observations.length > 0 &&
|
|
5692
5784
|
`
|
|
5693
5785
|
color: ${(_a = observations[observations.length - 1].color) !== null && _a !== void 0 ? _a : theme.palette.grey[600]};
|
|
5694
5786
|
box-sizing: border-box;
|
|
5695
|
-
font-weight: ${getFocusedObs(observations)
|
|
5696
|
-
|
|
5787
|
+
font-weight: ${getFocusedObs(observations)
|
|
5788
|
+
? theme.fontWeights.extrabold
|
|
5789
|
+
: theme.fontWeights.semibold};
|
|
5790
|
+
font-style: ${getFocusedObs(observations) ? "italic" : "normal"};
|
|
5697
5791
|
z-index: 1;
|
|
5698
5792
|
&:focus {
|
|
5699
5793
|
outline: none;
|
|
@@ -5723,6 +5817,23 @@ const Layer = styled__default["default"].div `
|
|
|
5723
5817
|
z-index: 0;
|
|
5724
5818
|
background-color: ${({ color }) => getColor(color, undefined, undefined, 0.2)};
|
|
5725
5819
|
`;
|
|
5820
|
+
const textFromSelection = (selection) => {
|
|
5821
|
+
if (!selection || !selection.toString().length)
|
|
5822
|
+
return "";
|
|
5823
|
+
if (selection.anchorNode === null || selection.focusNode === null)
|
|
5824
|
+
return "";
|
|
5825
|
+
var range = selection.getRangeAt(0);
|
|
5826
|
+
var tempDiv = document.createElement("div");
|
|
5827
|
+
tempDiv.appendChild(range.cloneContents());
|
|
5828
|
+
var items = tempDiv.querySelectorAll("div");
|
|
5829
|
+
items.forEach(function (item) {
|
|
5830
|
+
if (item.getAttribute("data-unselectable")) {
|
|
5831
|
+
item.remove();
|
|
5832
|
+
}
|
|
5833
|
+
});
|
|
5834
|
+
var filteredText = tempDiv.textContent || tempDiv.innerText;
|
|
5835
|
+
return filteredText.length ? filteredText.trim() : selection.toString();
|
|
5836
|
+
};
|
|
5726
5837
|
/**
|
|
5727
5838
|
* Use Highlight to use highlight interation on any text element
|
|
5728
5839
|
*/
|
|
@@ -5734,26 +5845,12 @@ const Highlight = (props) => {
|
|
|
5734
5845
|
const [position, setPosition] = React.useState();
|
|
5735
5846
|
const [selection, setSelection] = React.useState();
|
|
5736
5847
|
const activeSelection = document.getSelection();
|
|
5737
|
-
const extractText = (
|
|
5738
|
-
if (selection.anchorNode === null || selection.focusNode === null)
|
|
5739
|
-
return "";
|
|
5740
|
-
var range = selection.getRangeAt(0);
|
|
5741
|
-
var tempDiv = document.createElement("div");
|
|
5742
|
-
tempDiv.appendChild(range.cloneContents());
|
|
5743
|
-
var items = tempDiv.querySelectorAll("div");
|
|
5744
|
-
items.forEach(function (item) {
|
|
5745
|
-
if (item.getAttribute("data-unselectable")) {
|
|
5746
|
-
item.remove();
|
|
5747
|
-
}
|
|
5748
|
-
});
|
|
5749
|
-
var filteredText = tempDiv.textContent || tempDiv.innerText;
|
|
5750
|
-
return filteredText.length ? filteredText.trim() : selection.toString();
|
|
5751
|
-
};
|
|
5848
|
+
const extractText = React.useMemo(() => textFromSelection(activeSelection), [activeSelection]);
|
|
5752
5849
|
const handleSelectionChange = React.useCallback(() => {
|
|
5753
5850
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5754
5851
|
if (activeSelection && activeSelection.toString().length > 0) {
|
|
5755
5852
|
// Extract the text from the selection cleaning unselectable items
|
|
5756
|
-
const text = extractText
|
|
5853
|
+
const text = extractText;
|
|
5757
5854
|
if (!text)
|
|
5758
5855
|
return;
|
|
5759
5856
|
const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
@@ -5768,9 +5865,7 @@ const Highlight = (props) => {
|
|
|
5768
5865
|
const range = activeSelection.getRangeAt(0);
|
|
5769
5866
|
const rects = range.getClientRects();
|
|
5770
5867
|
const lastRect = rects[rects.length - 1];
|
|
5771
|
-
const containerRect = ref && ref.current
|
|
5772
|
-
? ref.current.getBoundingClientRect()
|
|
5773
|
-
: null;
|
|
5868
|
+
const containerRect = ref && ref.current ? ref.current.getBoundingClientRect() : null;
|
|
5774
5869
|
if (!lastRect || !containerRect)
|
|
5775
5870
|
return;
|
|
5776
5871
|
const relativeY = lastRect.bottom - containerRect.top + ref.current.scrollTop;
|
|
@@ -5798,7 +5893,7 @@ const Highlight = (props) => {
|
|
|
5798
5893
|
else {
|
|
5799
5894
|
setIsSelecting(false);
|
|
5800
5895
|
}
|
|
5801
|
-
}, [
|
|
5896
|
+
}, [activeSelection, extractText, onSelectionButtonClick]);
|
|
5802
5897
|
React.useEffect(() => {
|
|
5803
5898
|
if (ref.current === null)
|
|
5804
5899
|
return;
|
|
@@ -5812,7 +5907,7 @@ const Highlight = (props) => {
|
|
|
5812
5907
|
y: 0,
|
|
5813
5908
|
}, onClick: () => onSelectionButtonClick(selection) }, { children: [jsxRuntime.jsx(CreateObservationButton.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), (_a = i18n === null || i18n === void 0 ? void 0 : i18n.selectionButtonLabel) !== null && _a !== void 0 ? _a : "Create observation"] })))] })));
|
|
5814
5909
|
};
|
|
5815
|
-
const Word = (props) => {
|
|
5910
|
+
const Word$1 = (props) => {
|
|
5816
5911
|
const isActive = props.currentTime &&
|
|
5817
5912
|
props.currentTime >= props.start &&
|
|
5818
5913
|
props.currentTime < props.end;
|
|
@@ -5821,16 +5916,17 @@ const Word = (props) => {
|
|
|
5821
5916
|
var _a, _b;
|
|
5822
5917
|
return (_b = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.filter((obs) => props.start >= obs.start && props.end <= obs.end)) !== null && _b !== void 0 ? _b : [];
|
|
5823
5918
|
}, [props.observations, props.start, props.end]);
|
|
5824
|
-
const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 &&
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5919
|
+
const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 &&
|
|
5920
|
+
foundObservations.map((obs) => {
|
|
5921
|
+
var _a;
|
|
5922
|
+
return (jsxRuntime.jsx(Layer, { color: (_a = obs.hue) !== null && _a !== void 0 ? _a : theme.palette.grey[600] }, obs.id));
|
|
5923
|
+
}), isActive ? (jsxRuntime.jsx(ActiveWord, Object.assign({ "data-start": props.start, "data-end": props.end }, { children: jsxRuntime.jsx(Searchable, { text: props.text }) }))) : (jsxRuntime.jsx(Searchable, { text: props.text })), " "] }))), [props, foundObservations, isActive]);
|
|
5828
5924
|
if (props.tooltipContent !== undefined && foundObservations.length > 0) {
|
|
5829
5925
|
return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent(foundObservations), isTransparent: true }, { children: ObsWord })));
|
|
5830
5926
|
}
|
|
5831
5927
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: ObsWord });
|
|
5832
5928
|
};
|
|
5833
|
-
Highlight.Word = Word;
|
|
5929
|
+
Highlight.Word = Word$1;
|
|
5834
5930
|
|
|
5835
5931
|
/**
|
|
5836
5932
|
* The Dots loader communicates ongoing activity after a user takes an action.
|
|
@@ -5905,7 +6001,7 @@ const Logo = (props) => {
|
|
|
5905
6001
|
};
|
|
5906
6002
|
|
|
5907
6003
|
var _path$a;
|
|
5908
|
-
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (
|
|
6004
|
+
function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
|
|
5909
6005
|
const SvgPlus = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
5910
6006
|
width: 16,
|
|
5911
6007
|
height: 16,
|
|
@@ -5953,7 +6049,7 @@ const MultiSelect = ({ options, onChange, creatable, i18n, maxItems, size, menuH
|
|
|
5953
6049
|
setMatchingOptions(matchedOptions);
|
|
5954
6050
|
}, [inputValue, options]);
|
|
5955
6051
|
return (jsxRuntime.jsxs(Dropdown, Object.assign({ inputValue: inputValue, selectedItems: options.filter((option) => option.selected), onSelect: (items) => onChange &&
|
|
5956
|
-
onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(Label, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => onChange &&
|
|
6052
|
+
onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: items.some((i) => i.id === o.id) })))), downshiftProps: { itemToString }, onInputValueChange: (value) => setInputValue(value) }, { children: [jsxRuntime.jsxs(Field$1, { children: [jsxRuntime.jsx(Label$2, Object.assign({ hidden: true }, { children: (_a = i18n === null || i18n === void 0 ? void 0 : i18n.label) !== null && _a !== void 0 ? _a : "Multiselect" })), jsxRuntime.jsx(reactDropdowns.Multiselect, { placeholder: (_b = i18n === null || i18n === void 0 ? void 0 : i18n.placeholder) !== null && _b !== void 0 ? _b : "Select Items", renderShowMore: i18n === null || i18n === void 0 ? void 0 : i18n.showMore, isCompact: size !== "medium", maxItems: maxItems, renderItem: ({ value }) => (jsxRuntime.jsxs(reactTags.Tag, Object.assign({ isPill: true }, { children: [jsxRuntime.jsx("span", { children: value.label }), jsxRuntime.jsx(reactTags.Tag.Close, { onClick: () => onChange &&
|
|
5957
6053
|
onChange(options.map((o) => (Object.assign(Object.assign({}, o), { selected: o.selected && o.id !== value.id })))) })] }))) })] }), jsxRuntime.jsxs(Menu, { children: [jsxRuntime.jsxs("div", Object.assign({ style: { maxHeight: menuHeight !== null && menuHeight !== void 0 ? menuHeight : "200px" } }, { children: [matchingOptions.map((option) => {
|
|
5958
6054
|
const items = options
|
|
5959
6055
|
.filter((o) => o.selected)
|
|
@@ -6014,18 +6110,18 @@ ModalFullScreen.Footer = StyledFooter$1;
|
|
|
6014
6110
|
ModalFullScreen.Close = StyledModalClose;
|
|
6015
6111
|
ModalFullScreen.FooterItem = FooterItem;
|
|
6016
6112
|
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6113
|
+
var _path$9;
|
|
6114
|
+
function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
|
|
6115
|
+
const SvgChevronDownStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
|
|
6116
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6117
|
+
width: 16,
|
|
6118
|
+
height: 16,
|
|
6119
|
+
focusable: "false",
|
|
6120
|
+
viewBox: "0 0 16 16"
|
|
6121
|
+
}, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
6122
|
+
fill: "currentColor",
|
|
6123
|
+
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
6124
|
+
})));
|
|
6029
6125
|
|
|
6030
6126
|
const UgHeaderItem = styled__default["default"](reactChrome.HeaderItem) `
|
|
6031
6127
|
${(props) => props.hasLogo && `border-right: none`};
|
|
@@ -6043,15 +6139,15 @@ const HeaderItemText = (props) => jsxRuntime.jsx(UgHeaderItemText, Object.assign
|
|
|
6043
6139
|
|
|
6044
6140
|
const HeaderItemIcon = (props) => (jsxRuntime.jsx(reactChrome.HeaderItemIcon, Object.assign({}, props)));
|
|
6045
6141
|
|
|
6046
|
-
var _path$
|
|
6047
|
-
function _extends$
|
|
6048
|
-
const SvgMenuStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
6142
|
+
var _path$8;
|
|
6143
|
+
function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
|
|
6144
|
+
const SvgMenuStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
6049
6145
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6050
6146
|
width: 16,
|
|
6051
6147
|
height: 16,
|
|
6052
6148
|
focusable: "false",
|
|
6053
6149
|
viewBox: "0 0 16 16"
|
|
6054
|
-
}, props), _path$
|
|
6150
|
+
}, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
6055
6151
|
fill: "none",
|
|
6056
6152
|
stroke: "currentColor",
|
|
6057
6153
|
strokeLinecap: "round",
|
|
@@ -6133,19 +6229,6 @@ Header.HeaderItem = HeaderItem;
|
|
|
6133
6229
|
Header.HeaderItemText = HeaderItemText;
|
|
6134
6230
|
Header.HeaderItemIcon = HeaderItemIcon;
|
|
6135
6231
|
|
|
6136
|
-
var _path$8;
|
|
6137
|
-
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
|
|
6138
|
-
const SvgChevronDownStroke = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
6139
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
6140
|
-
width: 16,
|
|
6141
|
-
height: 16,
|
|
6142
|
-
focusable: "false",
|
|
6143
|
-
viewBox: "0 0 16 16"
|
|
6144
|
-
}, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
6145
|
-
fill: "currentColor",
|
|
6146
|
-
d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
|
|
6147
|
-
})));
|
|
6148
|
-
|
|
6149
6232
|
const HeaderSkeleton = () => {
|
|
6150
6233
|
return (jsxRuntime.jsxs(Header, Object.assign({ isStandalone: true }, { children: [jsxRuntime.jsx(LogoIconContainer, Object.assign({ hasLogo: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(Logo, { type: "icon", size: 150 }) }) })), jsxRuntime.jsx(HeaderItem, Object.assign({ style: { marginRight: "auto", marginLeft: "-4px" } }, { children: window.matchMedia(`only screen and (min-width: 576px)`).matches ? (jsxRuntime.jsx(Skeleton, { width: "200px", height: theme.space.sm })) : (jsxRuntime.jsx(Skeleton, { width: "80px", height: theme.space.sm, style: { marginLeft: theme.space.sm } })) })), jsxRuntime.jsx(HeaderItem, Object.assign({ isRound: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(Skeleton, { width: "32px", height: "32px", style: { borderRadius: "100%" } }) }) }) }))] })));
|
|
6151
6234
|
};
|
|
@@ -6164,6 +6247,27 @@ const AppHeader = (_a) => {
|
|
|
6164
6247
|
return isLoading ? (jsxRuntime.jsx(HeaderSkeleton, {})) : (jsxRuntime.jsxs(Header, Object.assign({}, args, { style: Object.assign(Object.assign({}, style), { zIndex: (style === null || style === void 0 ? void 0 : style.zIndex) || theme.levels.front }) }, { children: [jsxRuntime.jsx(BrandItem, Object.assign({}, brand, { toggleMenu: args.onSidebarMenuToggle })), args.hasChangelog && args.changelogItem && (jsxRuntime.jsx(HeaderItem, Object.assign({ style: { marginRight: "-" + theme.space.xs } }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: args.changelogItem }) }))), jsxRuntime.jsx(HeaderItem, Object.assign({ isRound: true, onClick: args.onProfileModalToggle }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Avatar, Object.assign({}, avatar)), jsxRuntime.jsx(ChevronButton, Object.assign({ size: "small", isRotated: args.isProfileModalOpen }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] }) }) }))] })));
|
|
6165
6248
|
};
|
|
6166
6249
|
|
|
6250
|
+
const UgBody = styled__default["default"](reactChrome.Body) `
|
|
6251
|
+
background-color: ${({ theme }) => theme.palette.white};
|
|
6252
|
+
`;
|
|
6253
|
+
/**
|
|
6254
|
+
* A Body defines the main content of an HTML document which displays on the browser
|
|
6255
|
+
*/
|
|
6256
|
+
const Body$1 = (props) => jsxRuntime.jsx(UgBody, Object.assign({}, props));
|
|
6257
|
+
|
|
6258
|
+
/**
|
|
6259
|
+
* The Chrome component provides a high-level layout structure and sets a framework for navigating around Zendesk products.
|
|
6260
|
+
* <br>
|
|
6261
|
+
* Used for this:
|
|
6262
|
+
- To give a consistent dashboard and navigation experience
|
|
6263
|
+
*/
|
|
6264
|
+
const Chrome = (props) => jsxRuntime.jsx(reactChrome.Chrome, Object.assign({}, props));
|
|
6265
|
+
|
|
6266
|
+
/**
|
|
6267
|
+
* A Content defines the main content of an HTML document which displays on the browser
|
|
6268
|
+
*/
|
|
6269
|
+
const Content = (props) => jsxRuntime.jsx(reactChrome.Content, Object.assign({}, props));
|
|
6270
|
+
|
|
6167
6271
|
const UgMain = styled__default["default"](reactChrome.Main) `
|
|
6168
6272
|
@media (min-width: ${({ theme }) => theme.breakpoints.sm}) {
|
|
6169
6273
|
margin: ${({ theme }) => theme.space.xxl}
|
|
@@ -6315,14 +6419,6 @@ NavAccordionItem.Panel = AccordionItemPanel;
|
|
|
6315
6419
|
NavAccordionItem.Header = AccordionItemHeader;
|
|
6316
6420
|
NavAccordionItem.Label = AccordionItemLabel;
|
|
6317
6421
|
|
|
6318
|
-
/**
|
|
6319
|
-
* The Chrome component provides a high-level layout structure and sets a framework for navigating around Zendesk products.
|
|
6320
|
-
* <br>
|
|
6321
|
-
* Used for this:
|
|
6322
|
-
- To give a consistent dashboard and navigation experience
|
|
6323
|
-
*/
|
|
6324
|
-
const Chrome = (props) => jsxRuntime.jsx(reactChrome.Chrome, Object.assign({}, props));
|
|
6325
|
-
|
|
6326
6422
|
const UgPagination = styled__default["default"](reactPagination.Pagination) ``;
|
|
6327
6423
|
/**
|
|
6328
6424
|
* Pagination separates content into pages and allows users to navigate between those pages.
|
|
@@ -6449,7 +6545,7 @@ PageHeader.Meta = MainMeta;
|
|
|
6449
6545
|
PageHeader.Footer = StyledFooter;
|
|
6450
6546
|
|
|
6451
6547
|
var _path$7, _path2;
|
|
6452
|
-
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (
|
|
6548
|
+
function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
|
|
6453
6549
|
const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
|
|
6454
6550
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6455
6551
|
width: 16,
|
|
@@ -6467,7 +6563,7 @@ const SvgExit = props => /*#__PURE__*/React__namespace.createElement("svg", _ext
|
|
|
6467
6563
|
})));
|
|
6468
6564
|
|
|
6469
6565
|
var _path$6;
|
|
6470
|
-
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (
|
|
6566
|
+
function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
|
|
6471
6567
|
const SvgThumbsUp = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
|
|
6472
6568
|
width: 16,
|
|
6473
6569
|
height: 16,
|
|
@@ -6482,7 +6578,7 @@ const SvgThumbsUp = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
6482
6578
|
})));
|
|
6483
6579
|
|
|
6484
6580
|
var _rect, _path$5;
|
|
6485
|
-
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (
|
|
6581
|
+
function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
|
|
6486
6582
|
const SvgLockLockedFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
|
|
6487
6583
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6488
6584
|
width: 16,
|
|
@@ -6609,7 +6705,7 @@ const MenuItem = (_a) => {
|
|
|
6609
6705
|
};
|
|
6610
6706
|
|
|
6611
6707
|
var _path$4;
|
|
6612
|
-
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (
|
|
6708
|
+
function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
|
|
6613
6709
|
const SvgQuestionMark = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
6614
6710
|
width: 16,
|
|
6615
6711
|
height: 16,
|
|
@@ -6623,7 +6719,7 @@ const SvgQuestionMark = props => /*#__PURE__*/React__namespace.createElement("sv
|
|
|
6623
6719
|
})));
|
|
6624
6720
|
|
|
6625
6721
|
var _path$3;
|
|
6626
|
-
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (
|
|
6722
|
+
function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
|
|
6627
6723
|
const SvgCopy = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
|
|
6628
6724
|
width: 12,
|
|
6629
6725
|
height: 16,
|
|
@@ -6638,7 +6734,7 @@ const SvgCopy = props => /*#__PURE__*/React__namespace.createElement("svg", _ext
|
|
|
6638
6734
|
})));
|
|
6639
6735
|
|
|
6640
6736
|
var _path$2;
|
|
6641
|
-
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (
|
|
6737
|
+
function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
|
|
6642
6738
|
const SvgInfoFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
6643
6739
|
width: 16,
|
|
6644
6740
|
height: 16,
|
|
@@ -6670,7 +6766,7 @@ const UgParagraph = styled__default["default"](reactTypography.Paragraph) `
|
|
|
6670
6766
|
/**
|
|
6671
6767
|
* Use Paragraph to render blocks of text with Garden styling.
|
|
6672
6768
|
*/
|
|
6673
|
-
const Paragraph = (props) => jsxRuntime.jsx(UgParagraph, Object.assign({}, props));
|
|
6769
|
+
const Paragraph$1 = (props) => jsxRuntime.jsx(UgParagraph, Object.assign({}, props));
|
|
6674
6770
|
|
|
6675
6771
|
const getInitials = (name) => {
|
|
6676
6772
|
const names = name.split(" ");
|
|
@@ -6698,7 +6794,7 @@ const StyledBody$3 = styled__default["default"].div `
|
|
|
6698
6794
|
margin: ${({ theme }) => theme.space.base * 6}px
|
|
6699
6795
|
${({ theme }) => theme.space.base * 4}px;
|
|
6700
6796
|
`;
|
|
6701
|
-
const StyledParagraph = styled__default["default"](Paragraph) `
|
|
6797
|
+
const StyledParagraph = styled__default["default"](Paragraph$1) `
|
|
6702
6798
|
margin-top: ${({ theme }) => theme.space.base * 4}px;
|
|
6703
6799
|
`;
|
|
6704
6800
|
const Footer = styled__default["default"].div `
|
|
@@ -6726,15 +6822,15 @@ const HelpItem = (props) => {
|
|
|
6726
6822
|
if (email.length > 24) {
|
|
6727
6823
|
csmEmailCut = `${email.substring(0, 21)}...`;
|
|
6728
6824
|
}
|
|
6729
|
-
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$3, { children: [jsxRuntime.jsx(Paragraph, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: jsxRuntime.jsx(SM, { children: props.contactLabel }) })), jsxRuntime.jsx(StyledParagraph, { children: jsxRuntime.jsx(Avatar, { children: (_a = props.csm.picture) !== null && _a !== void 0 ? _a : getInitials(props.csm.name), avatarType: props.csm.picture ? "image" : "text", size: "large" }) }), jsxRuntime.jsxs(StyledParagraph, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true }, { children: props.csm.name })), jsxRuntime.jsxs(Description, { children: [jsxRuntime.jsx(Anchor, Object.assign({ href: `mailto:${props.csm.email}`, style: { color: theme.palette.grey[600] } }, { children: csmEmailCut })), jsxRuntime.jsxs(StyledButton, Object.assign({ isBasic: true, onClick: () => {
|
|
6825
|
+
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: props.title })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$3, { children: [jsxRuntime.jsx(Paragraph$1, Object.assign({ style: { color: theme.palette.grey[600] } }, { children: jsxRuntime.jsx(SM, { children: props.contactLabel }) })), jsxRuntime.jsx(StyledParagraph, { children: jsxRuntime.jsx(Avatar, { children: (_a = props.csm.picture) !== null && _a !== void 0 ? _a : getInitials(props.csm.name), avatarType: props.csm.picture ? "image" : "text", size: "large" }) }), jsxRuntime.jsxs(StyledParagraph, { children: [jsxRuntime.jsx(MD, Object.assign({ isBold: true }, { children: props.csm.name })), jsxRuntime.jsxs(Description, { children: [jsxRuntime.jsx(Anchor, Object.assign({ href: `mailto:${props.csm.email}`, style: { color: theme.palette.grey[600] } }, { children: csmEmailCut })), jsxRuntime.jsxs(StyledButton, Object.assign({ isBasic: true, onClick: () => {
|
|
6730
6826
|
var _a;
|
|
6731
6827
|
copyToClipBoard();
|
|
6732
6828
|
(_a = props.onCopyEmail) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
6733
|
-
}, size: "small" }, { children: [jsxRuntime.jsx(StyledButton.StartIcon, { children: jsxRuntime.jsx(SvgCopy, {}) }), (_b = props.copyLabel) !== null && _b !== void 0 ? _b : "Copy"] }))] })] })] }), props.chatSupport && (jsxRuntime.jsxs(Footer, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledFooterButton, Object.assign({ isStretched: true, isBasic: true, onClick: props.toggleChat, style: { paddingLeft: theme.space.xxs } }, { children: [jsxRuntime.jsx(
|
|
6829
|
+
}, size: "small" }, { children: [jsxRuntime.jsx(StyledButton.StartIcon, { children: jsxRuntime.jsx(SvgCopy, {}) }), (_b = props.copyLabel) !== null && _b !== void 0 ? _b : "Copy"] }))] })] })] }), props.chatSupport && (jsxRuntime.jsxs(Footer, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledFooterButton, Object.assign({ isStretched: true, isBasic: true, onClick: props.toggleChat, style: { paddingLeft: theme.space.xxs } }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgInfoFill, { color: theme.palette.blue[600] }) }), (_c = props.chatSupportLabel) !== null && _c !== void 0 ? _c : "Report a technical issue"] }))] }))] }));
|
|
6734
6830
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgQuestionMark, { color: theme.palette.blue[600] }) }, { children: props.title })) }));
|
|
6735
6831
|
};
|
|
6736
6832
|
|
|
6737
|
-
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
6833
|
+
function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
|
|
6738
6834
|
const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
6739
6835
|
width: 16,
|
|
6740
6836
|
height: 16,
|
|
@@ -6744,7 +6840,7 @@ const SvgEmpty = props => /*#__PURE__*/React__namespace.createElement("svg", _ex
|
|
|
6744
6840
|
}, props));
|
|
6745
6841
|
|
|
6746
6842
|
var _path$1;
|
|
6747
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
6843
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
6748
6844
|
const SvgTranslationExists = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
6749
6845
|
width: 16,
|
|
6750
6846
|
height: 16,
|
|
@@ -6795,7 +6891,7 @@ const UserContainer = (props) => {
|
|
|
6795
6891
|
};
|
|
6796
6892
|
|
|
6797
6893
|
var _path;
|
|
6798
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
6894
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
6799
6895
|
const SvgGearFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
6800
6896
|
width: 16,
|
|
6801
6897
|
height: 16,
|
|
@@ -6832,7 +6928,7 @@ const SettingsItem = (props) => {
|
|
|
6832
6928
|
setValue(value);
|
|
6833
6929
|
props.onSetSettings && props.onSetSettings(value);
|
|
6834
6930
|
};
|
|
6835
|
-
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === 1, onChange: () => onToggleSettings(value === 1 ? 0 : 1) }, { children: jsxRuntime.jsx(Label, { children: value === 1
|
|
6931
|
+
const content = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PreviousButton, Object.assign({ onClick: () => props.setActive(""), isBasic: true }, { children: (_a = props.i18n) === null || _a === void 0 ? void 0 : _a.settingsTitle })), jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs(StyledBody$1, { children: [props.i18n && props.i18n.settingsIntroText && (jsxRuntime.jsx(SettingsIntroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsIntroText }) })), jsxRuntime.jsxs(Field, { children: [jsxRuntime.jsx(TriggerTitle, Object.assign({ isBold: true }, { children: (_c = (_b = props.i18n) === null || _b === void 0 ? void 0 : _b.settingsToggle) === null || _c === void 0 ? void 0 : _c.title })), jsxRuntime.jsx(Toggle, Object.assign({ checked: value === 1, onChange: () => onToggleSettings(value === 1 ? 0 : 1) }, { children: jsxRuntime.jsx(Label$2, { children: value === 1
|
|
6836
6932
|
? (_e = (_d = props.i18n) === null || _d === void 0 ? void 0 : _d.settingsToggle) === null || _e === void 0 ? void 0 : _e.on
|
|
6837
6933
|
: (_g = (_f = props.i18n) === null || _f === void 0 ? void 0 : _f.settingsToggle) === null || _g === void 0 ? void 0 : _g.off }) }))] }), props.i18n && props.i18n.settingsOutroText && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(SettingsOutroText, { children: [jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_1 }), jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_2 })] }), jsxRuntime.jsx(SettingsOutroText, { children: jsxRuntime.jsx(SM, { children: props.i18n.settingsOutroText.paragraph_3 }) })] }))] })] }));
|
|
6838
6934
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(MenuItem, Object.assign({ content: content, value: props.value, selectedItem: props.selectedItem, setActive: props.setActive, icon: jsxRuntime.jsx(SvgGearFill, { color: theme.palette.blue[600] }) }, { children: (_h = props.i18n) === null || _h === void 0 ? void 0 : _h.settingsTitle })) }));
|
|
@@ -7046,7 +7142,7 @@ const UgGroupRow = styled__default["default"](reactTables.GroupRow) `
|
|
|
7046
7142
|
const GroupRow = (props) => jsxRuntime.jsx(UgGroupRow, Object.assign({}, props));
|
|
7047
7143
|
const GroupRowComponent = (props) => {
|
|
7048
7144
|
return (jsxRuntime.jsx(GroupRow, Object.assign({}, (props && props.group.items.length === 0 && { className: "empty" }), (props &&
|
|
7049
|
-
props.group.items.length > 0 && { onClick: props.handleToggle }), props, { children: jsxRuntime.jsxs(Cell, Object.assign({ colSpan: props.colSpan, className: props.open ? "open" : "closed" }, { children: [props.group.groupIcon && (jsxRuntime.jsx(StyledUgIcon, { size: 12, type: props.group.groupIcon })), jsxRuntime.jsxs(Label, Object.assign({ isRegular: true, className: "title" }, { children: [props.group.groupName, " ", jsxRuntime.jsxs("b", { children: ["(", props.group.items.length, ")"] })] })), jsxRuntime.jsx(StyledAnimatedToggle, Object.assign({ style: { transform: props.open ? "rotate(180deg)" : "none" } }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] })) })));
|
|
7145
|
+
props.group.items.length > 0 && { onClick: props.handleToggle }), props, { children: jsxRuntime.jsxs(Cell, Object.assign({ colSpan: props.colSpan, className: props.open ? "open" : "closed" }, { children: [props.group.groupIcon && (jsxRuntime.jsx(StyledUgIcon, { size: 12, type: props.group.groupIcon })), jsxRuntime.jsxs(Label$2, Object.assign({ isRegular: true, className: "title" }, { children: [props.group.groupName, " ", jsxRuntime.jsxs("b", { children: ["(", props.group.items.length, ")"] })] })), jsxRuntime.jsx(StyledAnimatedToggle, Object.assign({ style: { transform: props.open ? "rotate(180deg)" : "none" } }, { children: jsxRuntime.jsx(SvgChevronDownStroke, {}) }))] })) })));
|
|
7050
7146
|
};
|
|
7051
7147
|
const AnimatedRow = styled__default["default"](Row) `
|
|
7052
7148
|
&.render {
|
|
@@ -7250,10 +7346,377 @@ OrderedList.Item = UgOrderedList.Item;
|
|
|
7250
7346
|
const UnorderedList = (props) => jsxRuntime.jsx(UgUnorderedList, Object.assign({}, props));
|
|
7251
7347
|
UnorderedList.Item = UgUnorderedList.Item;
|
|
7252
7348
|
|
|
7349
|
+
const MenuContainer = styled__default["default"].div `
|
|
7350
|
+
box-shadow: ${({ theme }) => theme.shadows.boxShadow(theme)};
|
|
7351
|
+
display: flex;
|
|
7352
|
+
`;
|
|
7353
|
+
const FloatingMenu = (props) => {
|
|
7354
|
+
const { editor, onClick } = props;
|
|
7355
|
+
const shouldShow = (props) => {
|
|
7356
|
+
// At least a word selected?", props.from !== props.to);
|
|
7357
|
+
return props.from !== props.to;
|
|
7358
|
+
};
|
|
7359
|
+
if (!editor) {
|
|
7360
|
+
return null;
|
|
7361
|
+
}
|
|
7362
|
+
return (jsxRuntime.jsx(react.BubbleMenu, Object.assign({ editor: editor, shouldShow: shouldShow }, { children: jsxRuntime.jsx(MenuContainer, Object.assign({ className: "bubble-menu" }, { children: jsxRuntime.jsxs(Button, Object.assign({ isAccent: true, isPrimary: true, onClick: () => onClick(editor) }, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), "Create Observation"] })) })) })));
|
|
7363
|
+
};
|
|
7364
|
+
|
|
7365
|
+
const Search = ({ editor }) => {
|
|
7366
|
+
const [search, setSearch] = React.useState("");
|
|
7367
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("input", { type: "text", onChange: (e) => {
|
|
7368
|
+
setSearch(e.target.value);
|
|
7369
|
+
} }), jsxRuntime.jsx("button", Object.assign({ onClick: () => {
|
|
7370
|
+
editor.commands.setSearchTerm(search);
|
|
7371
|
+
} }, { children: "Search" }))] }));
|
|
7372
|
+
};
|
|
7373
|
+
const SearchStyle = styled.css `
|
|
7374
|
+
.search-result {
|
|
7375
|
+
background-color: rgba(255, 217, 0, 0.5);
|
|
7376
|
+
|
|
7377
|
+
&-current {
|
|
7378
|
+
background-color: rgba(13, 255, 0, 0.5);
|
|
7379
|
+
}
|
|
7380
|
+
}
|
|
7381
|
+
`;
|
|
7382
|
+
Search.Style = SearchStyle;
|
|
7383
|
+
|
|
7384
|
+
const Active = ({ onSetCurrentTime, }) => core.Node.create({
|
|
7385
|
+
name: "Active",
|
|
7386
|
+
content: "inline*",
|
|
7387
|
+
inline: true,
|
|
7388
|
+
parseHTML() {
|
|
7389
|
+
return [
|
|
7390
|
+
{
|
|
7391
|
+
tag: "span",
|
|
7392
|
+
},
|
|
7393
|
+
];
|
|
7394
|
+
},
|
|
7395
|
+
renderHTML({ node }) {
|
|
7396
|
+
return [
|
|
7397
|
+
"active",
|
|
7398
|
+
{
|
|
7399
|
+
style: "background-color: #ff0000;",
|
|
7400
|
+
},
|
|
7401
|
+
0,
|
|
7402
|
+
];
|
|
7403
|
+
},
|
|
7404
|
+
addCommands() {
|
|
7405
|
+
return {
|
|
7406
|
+
setCurrentTime: (start) => () => {
|
|
7407
|
+
if (onSetCurrentTime)
|
|
7408
|
+
onSetCurrentTime(start);
|
|
7409
|
+
return true;
|
|
7410
|
+
},
|
|
7411
|
+
updateCurrentActive: ({ currentWord }) => ({ state, view }) => {
|
|
7412
|
+
const { tr } = state;
|
|
7413
|
+
// trova il nodo "active"
|
|
7414
|
+
state.doc.descendants((node, pos) => {
|
|
7415
|
+
if (node.type.name === "Word") {
|
|
7416
|
+
// check if the node has an "active" descendant
|
|
7417
|
+
let hasActiveDescendant = false;
|
|
7418
|
+
node.descendants((child) => {
|
|
7419
|
+
hasActiveDescendant =
|
|
7420
|
+
hasActiveDescendant || child.type.name === "Active";
|
|
7421
|
+
});
|
|
7422
|
+
if (hasActiveDescendant) {
|
|
7423
|
+
// remove the "active" descendant
|
|
7424
|
+
function removeActiveDescendant(n) {
|
|
7425
|
+
var _a;
|
|
7426
|
+
if (((_a = n.firstChild) === null || _a === void 0 ? void 0 : _a.type.name) === "Active") {
|
|
7427
|
+
const textContent = n.textContent;
|
|
7428
|
+
const textNode = state.schema.text(textContent);
|
|
7429
|
+
return n.copy(model.Fragment.from(textNode));
|
|
7430
|
+
}
|
|
7431
|
+
let updatedContent = model.Fragment.empty;
|
|
7432
|
+
n.content.forEach((child) => {
|
|
7433
|
+
updatedContent = updatedContent.addToEnd(removeActiveDescendant(child));
|
|
7434
|
+
});
|
|
7435
|
+
return n.copy(updatedContent);
|
|
7436
|
+
}
|
|
7437
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), removeActiveDescendant(node));
|
|
7438
|
+
}
|
|
7439
|
+
}
|
|
7440
|
+
if (node.type.name === "Word" &&
|
|
7441
|
+
node.attrs["data-start"] === currentWord.start &&
|
|
7442
|
+
node.attrs["data-end"] === currentWord.end) {
|
|
7443
|
+
function getUpdatedNode(n) {
|
|
7444
|
+
var _a;
|
|
7445
|
+
if (((_a = n.firstChild) === null || _a === void 0 ? void 0 : _a.type.name) === "text" &&
|
|
7446
|
+
n.type.name !== "Active") {
|
|
7447
|
+
return n.copy(model.Fragment.from(state.schema.nodes.Active.create({}, n.content.firstChild)));
|
|
7448
|
+
}
|
|
7449
|
+
let updatedContent = model.Fragment.empty;
|
|
7450
|
+
n.content.forEach((child, index) => {
|
|
7451
|
+
updatedContent = updatedContent.addToEnd(getUpdatedNode(child));
|
|
7452
|
+
});
|
|
7453
|
+
return n.copy(updatedContent);
|
|
7454
|
+
}
|
|
7455
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), getUpdatedNode(node));
|
|
7456
|
+
}
|
|
7457
|
+
});
|
|
7458
|
+
view.updateState(view.state.apply(view.state.tr));
|
|
7459
|
+
return true;
|
|
7460
|
+
},
|
|
7461
|
+
};
|
|
7462
|
+
},
|
|
7463
|
+
});
|
|
7464
|
+
|
|
7465
|
+
const useTypeSpec = (type) => {
|
|
7466
|
+
switch (type) {
|
|
7467
|
+
default:
|
|
7468
|
+
return {
|
|
7469
|
+
background: "rgba(144,144,144,0.3)",
|
|
7470
|
+
};
|
|
7471
|
+
}
|
|
7472
|
+
};
|
|
7473
|
+
const Component$1 = ({ node, editor, }) => {
|
|
7474
|
+
const { background } = useTypeSpec(node.attrs["type"]);
|
|
7475
|
+
return (jsxRuntime.jsx(react.NodeViewWrapper, Object.assign({ as: "span", className: "react-component" }, { children: jsxRuntime.jsx("span", Object.assign({ style: { background } }, { children: jsxRuntime.jsx(Tooltip, Object.assign({ content: node.attrs["title"] || "" }, { children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(react.NodeViewContent, { as: "span", className: "content is-editable" }) }) })) })) })));
|
|
7476
|
+
};
|
|
7477
|
+
|
|
7478
|
+
const Observation = core.Node.create({
|
|
7479
|
+
name: "Observation",
|
|
7480
|
+
content: "inline*",
|
|
7481
|
+
inline: true,
|
|
7482
|
+
addAttributes() {
|
|
7483
|
+
return {
|
|
7484
|
+
type: {
|
|
7485
|
+
default: "",
|
|
7486
|
+
},
|
|
7487
|
+
title: {
|
|
7488
|
+
default: "",
|
|
7489
|
+
},
|
|
7490
|
+
};
|
|
7491
|
+
},
|
|
7492
|
+
parseHTML() {
|
|
7493
|
+
return [
|
|
7494
|
+
{
|
|
7495
|
+
tag: "observation",
|
|
7496
|
+
},
|
|
7497
|
+
];
|
|
7498
|
+
},
|
|
7499
|
+
addCommands() {
|
|
7500
|
+
return {
|
|
7501
|
+
addObservation: (type, title) => ({ tr, state, view }) => {
|
|
7502
|
+
const { from, to } = state.selection;
|
|
7503
|
+
state.doc.nodesBetween(from, to, (node, pos) => {
|
|
7504
|
+
// Controlla se il nodo è del tipo che vuoi sostituire (ad esempio "word")
|
|
7505
|
+
if (node.type.name === "Word") {
|
|
7506
|
+
// Crea il nodo "active"
|
|
7507
|
+
const annotationNode = state.schema.nodes.Observation.create({
|
|
7508
|
+
title: "Ciao",
|
|
7509
|
+
}, node.content);
|
|
7510
|
+
// Crea il nodo "word" aggiornato con "active" come figlio
|
|
7511
|
+
const updatedNode = node.copy(model.Fragment.from(annotationNode));
|
|
7512
|
+
// Sostituisci il nodo originale con quello aggiornato
|
|
7513
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos + node.nodeSize), updatedNode);
|
|
7514
|
+
}
|
|
7515
|
+
});
|
|
7516
|
+
view.updateState(view.state.apply(view.state.tr));
|
|
7517
|
+
return true;
|
|
7518
|
+
},
|
|
7519
|
+
};
|
|
7520
|
+
},
|
|
7521
|
+
renderHTML({ HTMLAttributes }) {
|
|
7522
|
+
return ["observation", react.mergeAttributes(HTMLAttributes), 0];
|
|
7523
|
+
},
|
|
7524
|
+
addNodeView() {
|
|
7525
|
+
return react.ReactNodeViewRenderer(Component$1);
|
|
7526
|
+
},
|
|
7527
|
+
});
|
|
7528
|
+
|
|
7529
|
+
const Label = styled__default["default"].p `
|
|
7530
|
+
user-select: none;
|
|
7531
|
+
margin: 24px 0 12px;
|
|
7532
|
+
`;
|
|
7533
|
+
const formatTime = (seconds) => {
|
|
7534
|
+
const date = new Date(0);
|
|
7535
|
+
date.setSeconds(seconds);
|
|
7536
|
+
if (seconds < 3600)
|
|
7537
|
+
return date.toISOString().substring(14, 19);
|
|
7538
|
+
return date.toISOString().substring(11, 19);
|
|
7539
|
+
};
|
|
7540
|
+
const Component = ({ node, editor, }) => {
|
|
7541
|
+
return (jsxRuntime.jsxs(react.NodeViewWrapper, Object.assign({ className: "react-component" }, { children: [jsxRuntime.jsxs(Label, Object.assign({ onClick: () => {
|
|
7542
|
+
let currentWord = null;
|
|
7543
|
+
node.descendants((child) => {
|
|
7544
|
+
if (currentWord !== null)
|
|
7545
|
+
return false;
|
|
7546
|
+
if (child.type.name === "Word") {
|
|
7547
|
+
currentWord = child;
|
|
7548
|
+
}
|
|
7549
|
+
});
|
|
7550
|
+
if (!currentWord)
|
|
7551
|
+
return;
|
|
7552
|
+
const word = currentWord;
|
|
7553
|
+
editor.commands.setCurrentTime(word.attrs["data-start"]);
|
|
7554
|
+
}, contentEditable: false }, { children: [node.attrs.speakername, " (", formatTime(node.attrs.start), " -", " ", formatTime(node.attrs.end), ")"] })), jsxRuntime.jsx(react.NodeViewContent, { className: "content is-editable" })] })));
|
|
7555
|
+
};
|
|
7556
|
+
|
|
7557
|
+
const Paragraph = core.Node.create({
|
|
7558
|
+
name: "Paragraph",
|
|
7559
|
+
group: "block",
|
|
7560
|
+
atom: false,
|
|
7561
|
+
content: "inline*",
|
|
7562
|
+
addAttributes() {
|
|
7563
|
+
return {
|
|
7564
|
+
speakername: {
|
|
7565
|
+
default: "Speaker",
|
|
7566
|
+
},
|
|
7567
|
+
start: {
|
|
7568
|
+
default: 0,
|
|
7569
|
+
},
|
|
7570
|
+
end: {
|
|
7571
|
+
default: 0,
|
|
7572
|
+
},
|
|
7573
|
+
};
|
|
7574
|
+
},
|
|
7575
|
+
parseHTML() {
|
|
7576
|
+
return [
|
|
7577
|
+
{
|
|
7578
|
+
tag: "speaker-paragraph",
|
|
7579
|
+
},
|
|
7580
|
+
];
|
|
7581
|
+
},
|
|
7582
|
+
renderHTML({ HTMLAttributes }) {
|
|
7583
|
+
return ["speaker-paragraph", core.mergeAttributes(HTMLAttributes), 0];
|
|
7584
|
+
},
|
|
7585
|
+
addNodeView() {
|
|
7586
|
+
return react.ReactNodeViewRenderer(Component);
|
|
7587
|
+
},
|
|
7588
|
+
});
|
|
7589
|
+
|
|
7590
|
+
const Word = core.Node.create({
|
|
7591
|
+
name: "Word",
|
|
7592
|
+
group: "inline",
|
|
7593
|
+
content: "inline*",
|
|
7594
|
+
inline: true,
|
|
7595
|
+
addAttributes() {
|
|
7596
|
+
return {
|
|
7597
|
+
"data-start": {
|
|
7598
|
+
default: null,
|
|
7599
|
+
},
|
|
7600
|
+
"data-end": {
|
|
7601
|
+
default: null,
|
|
7602
|
+
},
|
|
7603
|
+
};
|
|
7604
|
+
},
|
|
7605
|
+
parseHTML() {
|
|
7606
|
+
return [
|
|
7607
|
+
{
|
|
7608
|
+
tag: "span[data-start][data-end]",
|
|
7609
|
+
},
|
|
7610
|
+
];
|
|
7611
|
+
},
|
|
7612
|
+
renderHTML({ node }) {
|
|
7613
|
+
return [
|
|
7614
|
+
"span",
|
|
7615
|
+
{
|
|
7616
|
+
"data-start": node.attrs["data-start"],
|
|
7617
|
+
"data-end": node.attrs["data-end"],
|
|
7618
|
+
style: "",
|
|
7619
|
+
},
|
|
7620
|
+
0,
|
|
7621
|
+
];
|
|
7622
|
+
},
|
|
7623
|
+
});
|
|
7624
|
+
|
|
7625
|
+
const useEditor = ({ content, currentTime, onSetCurrentTime, }, deps) => {
|
|
7626
|
+
const ed = react.useEditor({
|
|
7627
|
+
extensions: [
|
|
7628
|
+
Document__default["default"],
|
|
7629
|
+
Paragraph,
|
|
7630
|
+
Text__default["default"],
|
|
7631
|
+
Word,
|
|
7632
|
+
SearchAndReplace__default["default"].configure(),
|
|
7633
|
+
Active({
|
|
7634
|
+
onSetCurrentTime,
|
|
7635
|
+
}),
|
|
7636
|
+
Observation,
|
|
7637
|
+
],
|
|
7638
|
+
editorProps: {
|
|
7639
|
+
handlePaste: () => true,
|
|
7640
|
+
},
|
|
7641
|
+
content: {
|
|
7642
|
+
type: "doc",
|
|
7643
|
+
content: content
|
|
7644
|
+
? content.map((paragraph) => ({
|
|
7645
|
+
type: "Paragraph",
|
|
7646
|
+
attrs: {
|
|
7647
|
+
speakername: `Speaker ${paragraph.speaker}`,
|
|
7648
|
+
start: paragraph.start,
|
|
7649
|
+
end: paragraph.end,
|
|
7650
|
+
},
|
|
7651
|
+
content: paragraph.words.map((word) => ({
|
|
7652
|
+
type: "Word",
|
|
7653
|
+
attrs: {
|
|
7654
|
+
"data-start": word.start,
|
|
7655
|
+
"data-end": word.end,
|
|
7656
|
+
},
|
|
7657
|
+
content: [
|
|
7658
|
+
{
|
|
7659
|
+
type: "text",
|
|
7660
|
+
text: `${word.word} `,
|
|
7661
|
+
},
|
|
7662
|
+
],
|
|
7663
|
+
})),
|
|
7664
|
+
}))
|
|
7665
|
+
: undefined,
|
|
7666
|
+
},
|
|
7667
|
+
}, deps);
|
|
7668
|
+
React.useEffect(() => {
|
|
7669
|
+
if (!currentTime)
|
|
7670
|
+
return;
|
|
7671
|
+
if (!ed)
|
|
7672
|
+
return;
|
|
7673
|
+
const currentParagraph = content === null || content === void 0 ? void 0 : content.find((paragraph) => paragraph.words.some((word) => word.start * 1000 <= currentTime && word.end * 1000 >= currentTime));
|
|
7674
|
+
if (!currentParagraph)
|
|
7675
|
+
return;
|
|
7676
|
+
const currentWord = currentParagraph.words.find((word) => word.start * 1000 <= currentTime && word.end * 1000 >= currentTime);
|
|
7677
|
+
if (!currentWord)
|
|
7678
|
+
return;
|
|
7679
|
+
ed.commands.updateCurrentActive({ currentWord });
|
|
7680
|
+
}, [currentTime, content, ed]);
|
|
7681
|
+
return ed;
|
|
7682
|
+
};
|
|
7683
|
+
|
|
7684
|
+
const EditorWrapper = styled__default["default"].div `
|
|
7685
|
+
${Search.Style}
|
|
7686
|
+
`;
|
|
7687
|
+
const EditorWithHighlight = ({ editor }) => {
|
|
7688
|
+
const ref = React.useRef(null);
|
|
7689
|
+
const handleDragStart = React.useCallback((event) => {
|
|
7690
|
+
const selection = window.getSelection();
|
|
7691
|
+
if (selection && selection.toString()) {
|
|
7692
|
+
event.preventDefault();
|
|
7693
|
+
}
|
|
7694
|
+
}, []);
|
|
7695
|
+
React.useEffect(() => {
|
|
7696
|
+
const currentRef = ref.current;
|
|
7697
|
+
if (!currentRef)
|
|
7698
|
+
return;
|
|
7699
|
+
currentRef.addEventListener("dragstart", handleDragStart);
|
|
7700
|
+
return () => {
|
|
7701
|
+
currentRef.removeEventListener("dragstart", handleDragStart);
|
|
7702
|
+
};
|
|
7703
|
+
}, [handleDragStart]);
|
|
7704
|
+
if (!editor)
|
|
7705
|
+
return null;
|
|
7706
|
+
return (jsxRuntime.jsx(EditorWrapper, { children: jsxRuntime.jsx(react.EditorContent, { ref: ref, editor: editor }) }));
|
|
7707
|
+
};
|
|
7708
|
+
EditorWithHighlight.useEditor = useEditor;
|
|
7709
|
+
EditorWithHighlight.Search = Search;
|
|
7710
|
+
EditorWithHighlight.FloatingMenu = FloatingMenu;
|
|
7711
|
+
|
|
7253
7712
|
Object.defineProperty(exports, 'ModalClose', {
|
|
7254
7713
|
enumerable: true,
|
|
7255
7714
|
get: function () { return reactModals.Close; }
|
|
7256
7715
|
});
|
|
7716
|
+
Object.defineProperty(exports, 'useVideoContext', {
|
|
7717
|
+
enumerable: true,
|
|
7718
|
+
get: function () { return Video.useVideoContext; }
|
|
7719
|
+
});
|
|
7257
7720
|
exports.Accordion = Accordion;
|
|
7258
7721
|
exports.Alert = Alert;
|
|
7259
7722
|
exports.Anchor = Anchor;
|
|
@@ -7294,6 +7757,7 @@ exports.Drawer = Drawer;
|
|
|
7294
7757
|
exports.Dropdown = Dropdown;
|
|
7295
7758
|
exports.DropdownField = index$1;
|
|
7296
7759
|
exports.Editor = Editor;
|
|
7760
|
+
exports.EditorWithHighlight = EditorWithHighlight;
|
|
7297
7761
|
exports.Ellipsis = Ellipsis;
|
|
7298
7762
|
exports.FooterItem = FooterItem;
|
|
7299
7763
|
exports.FormField = index;
|
|
@@ -7319,7 +7783,7 @@ exports.Item = Item$1;
|
|
|
7319
7783
|
exports.ItemContent = ItemContent;
|
|
7320
7784
|
exports.ItemMeta = ItemMeta;
|
|
7321
7785
|
exports.LG = LG;
|
|
7322
|
-
exports.Label = Label;
|
|
7786
|
+
exports.Label = Label$2;
|
|
7323
7787
|
exports.Lightbox = Lightbox;
|
|
7324
7788
|
exports.LoginForm = LoginForm;
|
|
7325
7789
|
exports.Logo = Logo;
|
|
@@ -7348,9 +7812,10 @@ exports.Notification = Notification;
|
|
|
7348
7812
|
exports.OrderedList = OrderedList;
|
|
7349
7813
|
exports.PageHeader = PageHeader;
|
|
7350
7814
|
exports.Pagination = Pagination;
|
|
7351
|
-
exports.Paragraph = Paragraph;
|
|
7815
|
+
exports.Paragraph = Paragraph$1;
|
|
7352
7816
|
exports.PieChart = PieChart;
|
|
7353
7817
|
exports.Player = Player;
|
|
7818
|
+
exports.PlayerProvider = PlayerProvider;
|
|
7354
7819
|
exports.PreviousItem = PreviousItem;
|
|
7355
7820
|
exports.ProductCard = ProductCard;
|
|
7356
7821
|
exports.ProfileModal = ProfileModal;
|