@appquality/unguess-design-system 3.1.105-attachments → 3.1.107-attachments
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 +130 -0
- package/build/index.js +194 -276
- package/build/stories/buttons/button/index.stories.d.ts +0 -1
- package/build/stories/buttons/utils.d.ts +27 -27
- package/build/stories/chat/_types.d.ts +6 -4
- package/build/stories/chat/context/chatContext.d.ts +4 -4
- package/build/stories/chat/hooks/useMedia.d.ts +5 -0
- package/build/stories/chat/index.stories.d.ts +3 -5
- package/build/stories/chat/parts/MediaLightbox.d.ts +14 -0
- package/build/stories/chat/parts/ThumbnailContainer/Thumbnail.d.ts +11 -0
- package/build/stories/chat/parts/ThumbnailContainer/index.d.ts +1 -1
- package/build/stories/chat/parts/comment.d.ts +2 -7
- package/build/stories/dropdowns/select/index.stories.d.ts +0 -1
- package/build/stories/editor/index.stories.d.ts +0 -1
- package/build/stories/highlight/index.stories.d.ts +0 -1
- package/build/stories/player/index.stories.d.ts +0 -1
- package/package.json +1 -1
- package/build/stories/chat/parts/ThumbnailContainer/ImageThumbnail.d.ts +0 -11
- package/build/stories/chat/parts/ThumbnailContainer/VideoThumbnail.d.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
1
|
+
# v3.1.88 (Mon May 13 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Player fixes [#343](https://github.com/AppQuality/unguess-design-system/pull/343) ([@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
- Fix undefined state in player and reduce renders [#342](https://github.com/AppQuality/unguess-design-system/pull/342) ([@cannarocks](https://github.com/cannarocks))
|
|
7
|
+
|
|
8
|
+
#### Authors: 1
|
|
9
|
+
|
|
10
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# v3.1.87 (Mon May 13 2024)
|
|
15
|
+
|
|
16
|
+
#### 🐛 Bug Fix
|
|
17
|
+
|
|
18
|
+
- feat: chat media upload [#340](https://github.com/AppQuality/unguess-design-system/pull/340) ([@Kariamos](https://github.com/Kariamos) [@iacopolea](https://github.com/iacopolea) [@marcbon](https://github.com/marcbon) [@sinatragianpaolo](https://github.com/sinatragianpaolo))
|
|
19
|
+
- fix: package version [#341](https://github.com/AppQuality/unguess-design-system/pull/341) ([@iacopolea](https://github.com/iacopolea))
|
|
20
|
+
- Chat attach media [#320](https://github.com/AppQuality/unguess-design-system/pull/320) ([@Kariamos](https://github.com/Kariamos) [@iacopolea](https://github.com/iacopolea) [@marcbon](https://github.com/marcbon) [@sinatragianpaolo](https://github.com/sinatragianpaolo))
|
|
21
|
+
- Thumbnails container [#328](https://github.com/AppQuality/unguess-design-system/pull/328) ([@sinatragianpaolo](https://github.com/sinatragianpaolo) [@Kariamos](https://github.com/Kariamos))
|
|
22
|
+
- Spinner [#327](https://github.com/AppQuality/unguess-design-system/pull/327) ([@Kariamos](https://github.com/Kariamos) [@iacopolea](https://github.com/iacopolea) [@sinatragianpaolo](https://github.com/sinatragianpaolo))
|
|
23
|
+
|
|
24
|
+
#### Authors: 4
|
|
25
|
+
|
|
26
|
+
- Gianpaolo Sinatra ([@sinatragianpaolo](https://github.com/sinatragianpaolo))
|
|
27
|
+
- Iacopo Leardini ([@iacopolea](https://github.com/iacopolea))
|
|
28
|
+
- Marco ([@Kariamos](https://github.com/Kariamos))
|
|
29
|
+
- Marco Bonomo ([@marcbon](https://github.com/marcbon))
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# v3.1.82 (Mon May 13 2024)
|
|
34
|
+
|
|
35
|
+
#### 🐛 Bug Fix
|
|
36
|
+
|
|
37
|
+
- Player improvements and trans fix [#339](https://github.com/AppQuality/unguess-design-system/pull/339) ([@iDome89](https://github.com/iDome89) [@cannarocks](https://github.com/cannarocks))
|
|
38
|
+
- Update-controls-layout [#338](https://github.com/AppQuality/unguess-design-system/pull/338) ([@cannarocks](https://github.com/cannarocks))
|
|
39
|
+
- fixed obs breaking text [#334](https://github.com/AppQuality/unguess-design-system/pull/334) ([@iDome89](https://github.com/iDome89))
|
|
40
|
+
- removed ; from component tree [#337](https://github.com/AppQuality/unguess-design-system/pull/337) ([@iDome89](https://github.com/iDome89) [@cannarocks](https://github.com/cannarocks))
|
|
41
|
+
- Player controls updated [#336](https://github.com/AppQuality/unguess-design-system/pull/336) ([@cannarocks](https://github.com/cannarocks))
|
|
42
|
+
- Improve-player-bookmarks-usability [#335](https://github.com/AppQuality/unguess-design-system/pull/335) ([@cannarocks](https://github.com/cannarocks))
|
|
43
|
+
|
|
44
|
+
#### ⚠️ Pushed to `master`
|
|
45
|
+
|
|
46
|
+
- 3.1.85 ([@cannarocks](https://github.com/cannarocks))
|
|
47
|
+
- 3.1.84 ([@cannarocks](https://github.com/cannarocks))
|
|
48
|
+
|
|
49
|
+
#### Authors: 2
|
|
50
|
+
|
|
51
|
+
- [@iDome89](https://github.com/iDome89)
|
|
52
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
# v3.1.82 (Mon May 13 2024)
|
|
57
|
+
|
|
58
|
+
#### 🐛 Bug Fix
|
|
59
|
+
|
|
60
|
+
- Player improvements and trans fix [#339](https://github.com/AppQuality/unguess-design-system/pull/339) ([@iDome89](https://github.com/iDome89) [@cannarocks](https://github.com/cannarocks))
|
|
61
|
+
- Update-controls-layout [#338](https://github.com/AppQuality/unguess-design-system/pull/338) ([@cannarocks](https://github.com/cannarocks))
|
|
62
|
+
- fixed obs breaking text [#334](https://github.com/AppQuality/unguess-design-system/pull/334) ([@iDome89](https://github.com/iDome89))
|
|
63
|
+
- removed ; from component tree [#337](https://github.com/AppQuality/unguess-design-system/pull/337) ([@iDome89](https://github.com/iDome89) [@cannarocks](https://github.com/cannarocks))
|
|
64
|
+
- Player controls updated [#336](https://github.com/AppQuality/unguess-design-system/pull/336) ([@cannarocks](https://github.com/cannarocks))
|
|
65
|
+
- Improve-player-bookmarks-usability [#335](https://github.com/AppQuality/unguess-design-system/pull/335) ([@cannarocks](https://github.com/cannarocks))
|
|
66
|
+
|
|
67
|
+
#### Authors: 2
|
|
68
|
+
|
|
69
|
+
- [@iDome89](https://github.com/iDome89)
|
|
70
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
# v3.1.82 (Fri May 10 2024)
|
|
75
|
+
|
|
76
|
+
#### 🐛 Bug Fix
|
|
77
|
+
|
|
78
|
+
- Player controls updated [#336](https://github.com/AppQuality/unguess-design-system/pull/336) ([@cannarocks](https://github.com/cannarocks))
|
|
79
|
+
- Improve-player-bookmarks-usability [#335](https://github.com/AppQuality/unguess-design-system/pull/335) ([@cannarocks](https://github.com/cannarocks))
|
|
80
|
+
|
|
81
|
+
#### Authors: 1
|
|
82
|
+
|
|
83
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
# v3.1.81 (Thu May 09 2024)
|
|
88
|
+
|
|
89
|
+
#### 🐛 Bug Fix
|
|
90
|
+
|
|
91
|
+
- Fix highlight for long selections [#331](https://github.com/AppQuality/unguess-design-system/pull/331) ([@iDome89](https://github.com/iDome89) [@marcbon](https://github.com/marcbon))
|
|
92
|
+
- removed border radius from highlighted word [#332](https://github.com/AppQuality/unguess-design-system/pull/332) ([@iDome89](https://github.com/iDome89))
|
|
93
|
+
- fixees for searched term and break word [#330](https://github.com/AppQuality/unguess-design-system/pull/330) ([@iDome89](https://github.com/iDome89))
|
|
94
|
+
|
|
95
|
+
#### Authors: 2
|
|
96
|
+
|
|
97
|
+
- [@iDome89](https://github.com/iDome89)
|
|
98
|
+
- Marco Bonomo ([@marcbon](https://github.com/marcbon))
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
# v3.1.80 (Tue May 07 2024)
|
|
103
|
+
|
|
104
|
+
#### 🐛 Bug Fix
|
|
105
|
+
|
|
106
|
+
- Allow search in trascript [#326](https://github.com/AppQuality/unguess-design-system/pull/326) ([@cannarocks](https://github.com/cannarocks))
|
|
107
|
+
- feat: Add search functionality to highlight component [#325](https://github.com/AppQuality/unguess-design-system/pull/325) ([@cannarocks](https://github.com/cannarocks))
|
|
108
|
+
|
|
109
|
+
#### Authors: 1
|
|
110
|
+
|
|
111
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# v3.1.79 (Mon May 06 2024)
|
|
116
|
+
|
|
117
|
+
#### 🐛 Bug Fix
|
|
118
|
+
|
|
119
|
+
- release 20240506 [#324](https://github.com/AppQuality/unguess-design-system/pull/324) ([@cannarocks](https://github.com/cannarocks) [@marcbon](https://github.com/marcbon))
|
|
120
|
+
- Add resizeble observation in player progress [#323](https://github.com/AppQuality/unguess-design-system/pull/323) ([@cannarocks](https://github.com/cannarocks))
|
|
121
|
+
- Add-cutting-edge-functionalities-to-player [#322](https://github.com/AppQuality/unguess-design-system/pull/322) ([@cannarocks](https://github.com/cannarocks))
|
|
122
|
+
- Add Highlight component [#321](https://github.com/AppQuality/unguess-design-system/pull/321) ([@cannarocks](https://github.com/cannarocks) [@marcbon](https://github.com/marcbon))
|
|
123
|
+
|
|
124
|
+
#### Authors: 2
|
|
125
|
+
|
|
126
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
127
|
+
- Marco Bonomo ([@marcbon](https://github.com/marcbon))
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
1
131
|
# v3.1.77 (Mon Feb 26 2024)
|
|
2
132
|
|
|
3
133
|
|
package/build/index.js
CHANGED
|
@@ -25,9 +25,9 @@ var sunburst = require('@nivo/sunburst');
|
|
|
25
25
|
var waffle = require('@nivo/waffle');
|
|
26
26
|
var line = require('@nivo/line');
|
|
27
27
|
var reactForms = require('@zendeskgarden/react-forms');
|
|
28
|
-
var uuid = require('uuid');
|
|
29
28
|
var react = require('@tiptap/react');
|
|
30
29
|
var reactTooltips = require('@zendeskgarden/react-tooltips');
|
|
30
|
+
var uuid = require('uuid');
|
|
31
31
|
var Typography = require('@tiptap/extension-typography');
|
|
32
32
|
var Link = require('@tiptap/extension-link');
|
|
33
33
|
var StarterKit = require('@tiptap/starter-kit');
|
|
@@ -2339,7 +2339,7 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
|
|
|
2339
2339
|
setThumbnails,
|
|
2340
2340
|
afterUploadCallback: (failed) => {
|
|
2341
2341
|
setThumbnails(thumbnails.map((file) => {
|
|
2342
|
-
if (failed.includes(file.
|
|
2342
|
+
if (failed.includes(file.id)) {
|
|
2343
2343
|
file.isLoadingMedia = false;
|
|
2344
2344
|
//file.isError = true;
|
|
2345
2345
|
}
|
|
@@ -2351,7 +2351,6 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
|
|
|
2351
2351
|
}));
|
|
2352
2352
|
},
|
|
2353
2353
|
addThumbnails: ({ files }) => {
|
|
2354
|
-
files.forEach((file) => (file.isLoadingMedia = true));
|
|
2355
2354
|
setThumbnails((prev) => [...prev, ...files]);
|
|
2356
2355
|
if (onFileUpload) {
|
|
2357
2356
|
onFileUpload(files).then((data) => {
|
|
@@ -2360,7 +2359,7 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
|
|
|
2360
2359
|
setThumbnails((prev) => {
|
|
2361
2360
|
return prev.map((file) => {
|
|
2362
2361
|
file.isLoadingMedia = false;
|
|
2363
|
-
if ((failed === null || failed === void 0 ? void 0 : failed.length) && failed.includes(file.
|
|
2362
|
+
if ((failed === null || failed === void 0 ? void 0 : failed.length) && failed.includes(file.id)) {
|
|
2364
2363
|
file.isError = true;
|
|
2365
2364
|
}
|
|
2366
2365
|
else {
|
|
@@ -2737,74 +2736,6 @@ const ChatTitle = styled__default["default"](Title$1) `
|
|
|
2737
2736
|
padding: ${({ theme }) => `${theme.space.sm} ${theme.space.md}`};
|
|
2738
2737
|
`;
|
|
2739
2738
|
|
|
2740
|
-
const UgClose$1 = styled__default["default"](reactNotifications.Close) `
|
|
2741
|
-
display: flex;
|
|
2742
|
-
align-items: center;
|
|
2743
|
-
justify-content: center;
|
|
2744
|
-
width: ${({ theme }) => theme.space.xl};
|
|
2745
|
-
height: ${({ theme }) => theme.space.xl};
|
|
2746
|
-
`;
|
|
2747
|
-
/**
|
|
2748
|
-
* Title is a basic component used to display a title. Often used in card headers.
|
|
2749
|
-
*/
|
|
2750
|
-
const Close = (props) => jsxRuntime.jsx(UgClose$1, Object.assign({}, props));
|
|
2751
|
-
|
|
2752
|
-
const NOTIFICATION_COMPONENT_ID = "notifications.notification";
|
|
2753
|
-
const CLOSE_COMPONENT_ID = "notifications.notification.close";
|
|
2754
|
-
const CLOSE_ICON_COMPONENT_ID = "notifications.notification.close-icon";
|
|
2755
|
-
const TITLE_COMPONENT_ID = "notifications.notification.title";
|
|
2756
|
-
const UgClose = styled__default["default"](Close).attrs((props) => {
|
|
2757
|
-
var _a;
|
|
2758
|
-
return ({
|
|
2759
|
-
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_ICON_COMPONENT_ID,
|
|
2760
|
-
});
|
|
2761
|
-
}) `
|
|
2762
|
-
${(props) => reactTheming.retrieveComponentStyles(CLOSE_ICON_COMPONENT_ID, props)};
|
|
2763
|
-
`;
|
|
2764
|
-
const UgAnchor = styled__default["default"](reactButtons.Anchor).attrs((props) => {
|
|
2765
|
-
var _a;
|
|
2766
|
-
return ({
|
|
2767
|
-
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_COMPONENT_ID,
|
|
2768
|
-
});
|
|
2769
|
-
}) `
|
|
2770
|
-
${(props) => reactTheming.retrieveComponentStyles(CLOSE_COMPONENT_ID, props)};
|
|
2771
|
-
`;
|
|
2772
|
-
const UgTitle = styled__default["default"](Title$1).attrs((props) => {
|
|
2773
|
-
var _a;
|
|
2774
|
-
return ({
|
|
2775
|
-
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : TITLE_COMPONENT_ID,
|
|
2776
|
-
});
|
|
2777
|
-
}) `
|
|
2778
|
-
${(props) => reactTheming.retrieveComponentStyles(TITLE_COMPONENT_ID, props)};
|
|
2779
|
-
`;
|
|
2780
|
-
const UgNotification = styled__default["default"](reactNotifications.Notification) `
|
|
2781
|
-
display: flex;
|
|
2782
|
-
align-items: center;
|
|
2783
|
-
justify-content: space-between;
|
|
2784
|
-
padding-right: ${({ theme }) => theme.space.md};
|
|
2785
|
-
white-space: pre;
|
|
2786
|
-
|
|
2787
|
-
${UgAnchor} {
|
|
2788
|
-
flex-shrink: 0;
|
|
2789
|
-
margin-left: ${({ theme }) => theme.space.md};
|
|
2790
|
-
}
|
|
2791
|
-
|
|
2792
|
-
${(props) => reactTheming.retrieveComponentStyles(NOTIFICATION_COMPONENT_ID, props)};
|
|
2793
|
-
`;
|
|
2794
|
-
/**
|
|
2795
|
-
* A Notification is a passive status update that keeps users informed of system progress.
|
|
2796
|
-
* <hr>
|
|
2797
|
-
* Used for this:
|
|
2798
|
-
- For a passive status update about user or system activity
|
|
2799
|
-
*/
|
|
2800
|
-
const Notification = (_a) => {
|
|
2801
|
-
var { closeText, message, onClose, type, isPrimary, isRegular } = _a, props = __rest(_a, ["closeText", "message", "onClose", "type", "isPrimary", "isRegular"]);
|
|
2802
|
-
return (jsxRuntime.jsxs(UgNotification, Object.assign({ type: type, isPrimary: isPrimary }, props, { children: [jsxRuntime.jsx(UgTitle, Object.assign({ isRegular: isRegular, type: type, isPrimary: isPrimary }, { children: message })), jsxRuntime.jsx(UgAnchor, Object.assign({ type: type, isPrimary: isPrimary, onClick: onClose }, { children: closeText !== null && closeText !== void 0 ? closeText : jsxRuntime.jsx(UgClose, {}) }))] })));
|
|
2803
|
-
};
|
|
2804
|
-
// ToastProvider
|
|
2805
|
-
const ToastProvider = (props) => (jsxRuntime.jsx(reactNotifications.ToastProvider, Object.assign({}, props)));
|
|
2806
|
-
const useToast = reactNotifications.useToast;
|
|
2807
|
-
|
|
2808
2739
|
var _path$w;
|
|
2809
2740
|
function _extends$E() { _extends$E = 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$E.apply(this, arguments); }
|
|
2810
2741
|
const SvgBoldFill = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$E({
|
|
@@ -3042,6 +2973,98 @@ const SvgClipboard = props => /*#__PURE__*/React__namespace.createElement("svg",
|
|
|
3042
2973
|
d: "M9.5 4v7.7c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5V3C6.5 1.6 7.6.5 9 .5s2.5 1.1 2.5 2.5v9c0 1.9-1.6 3.5-3.5 3.5S4.5 13.9 4.5 12V4"
|
|
3043
2974
|
})));
|
|
3044
2975
|
|
|
2976
|
+
const UgClose$1 = styled__default["default"](reactNotifications.Close) `
|
|
2977
|
+
display: flex;
|
|
2978
|
+
align-items: center;
|
|
2979
|
+
justify-content: center;
|
|
2980
|
+
width: ${({ theme }) => theme.space.xl};
|
|
2981
|
+
height: ${({ theme }) => theme.space.xl};
|
|
2982
|
+
`;
|
|
2983
|
+
/**
|
|
2984
|
+
* Title is a basic component used to display a title. Often used in card headers.
|
|
2985
|
+
*/
|
|
2986
|
+
const Close = (props) => jsxRuntime.jsx(UgClose$1, Object.assign({}, props));
|
|
2987
|
+
|
|
2988
|
+
const NOTIFICATION_COMPONENT_ID = "notifications.notification";
|
|
2989
|
+
const CLOSE_COMPONENT_ID = "notifications.notification.close";
|
|
2990
|
+
const CLOSE_ICON_COMPONENT_ID = "notifications.notification.close-icon";
|
|
2991
|
+
const TITLE_COMPONENT_ID = "notifications.notification.title";
|
|
2992
|
+
const UgClose = styled__default["default"](Close).attrs((props) => {
|
|
2993
|
+
var _a;
|
|
2994
|
+
return ({
|
|
2995
|
+
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_ICON_COMPONENT_ID,
|
|
2996
|
+
});
|
|
2997
|
+
}) `
|
|
2998
|
+
${(props) => reactTheming.retrieveComponentStyles(CLOSE_ICON_COMPONENT_ID, props)};
|
|
2999
|
+
`;
|
|
3000
|
+
const UgAnchor = styled__default["default"](reactButtons.Anchor).attrs((props) => {
|
|
3001
|
+
var _a;
|
|
3002
|
+
return ({
|
|
3003
|
+
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : CLOSE_COMPONENT_ID,
|
|
3004
|
+
});
|
|
3005
|
+
}) `
|
|
3006
|
+
${(props) => reactTheming.retrieveComponentStyles(CLOSE_COMPONENT_ID, props)};
|
|
3007
|
+
`;
|
|
3008
|
+
const UgTitle = styled__default["default"](Title$1).attrs((props) => {
|
|
3009
|
+
var _a;
|
|
3010
|
+
return ({
|
|
3011
|
+
"data-custom-id": (_a = props["data-custom-id"]) !== null && _a !== void 0 ? _a : TITLE_COMPONENT_ID,
|
|
3012
|
+
});
|
|
3013
|
+
}) `
|
|
3014
|
+
${(props) => reactTheming.retrieveComponentStyles(TITLE_COMPONENT_ID, props)};
|
|
3015
|
+
`;
|
|
3016
|
+
const UgNotification = styled__default["default"](reactNotifications.Notification) `
|
|
3017
|
+
display: flex;
|
|
3018
|
+
align-items: center;
|
|
3019
|
+
justify-content: space-between;
|
|
3020
|
+
padding-right: ${({ theme }) => theme.space.md};
|
|
3021
|
+
white-space: pre;
|
|
3022
|
+
|
|
3023
|
+
${UgAnchor} {
|
|
3024
|
+
flex-shrink: 0;
|
|
3025
|
+
margin-left: ${({ theme }) => theme.space.md};
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
${(props) => reactTheming.retrieveComponentStyles(NOTIFICATION_COMPONENT_ID, props)};
|
|
3029
|
+
`;
|
|
3030
|
+
/**
|
|
3031
|
+
* A Notification is a passive status update that keeps users informed of system progress.
|
|
3032
|
+
* <hr>
|
|
3033
|
+
* Used for this:
|
|
3034
|
+
- For a passive status update about user or system activity
|
|
3035
|
+
*/
|
|
3036
|
+
const Notification = (_a) => {
|
|
3037
|
+
var { closeText, message, onClose, type, isPrimary, isRegular } = _a, props = __rest(_a, ["closeText", "message", "onClose", "type", "isPrimary", "isRegular"]);
|
|
3038
|
+
return (jsxRuntime.jsxs(UgNotification, Object.assign({ type: type, isPrimary: isPrimary }, props, { children: [jsxRuntime.jsx(UgTitle, Object.assign({ isRegular: isRegular, type: type, isPrimary: isPrimary }, { children: message })), jsxRuntime.jsx(UgAnchor, Object.assign({ type: type, isPrimary: isPrimary, onClick: onClose }, { children: closeText !== null && closeText !== void 0 ? closeText : jsxRuntime.jsx(UgClose, {}) }))] })));
|
|
3039
|
+
};
|
|
3040
|
+
// ToastProvider
|
|
3041
|
+
const ToastProvider = (props) => (jsxRuntime.jsx(reactNotifications.ToastProvider, Object.assign({}, props)));
|
|
3042
|
+
const useToast = reactNotifications.useToast;
|
|
3043
|
+
|
|
3044
|
+
const acceptedMediaTypes = /^(image|video)\//;
|
|
3045
|
+
function useMedia() {
|
|
3046
|
+
const { addToast } = useToast();
|
|
3047
|
+
function getValidMedia(data) {
|
|
3048
|
+
const wrongFiles = Array.from(data).filter((file) => !acceptedMediaTypes.test(file.type));
|
|
3049
|
+
if (wrongFiles.length) {
|
|
3050
|
+
addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: wrongFiles.length === 1
|
|
3051
|
+
? `${wrongFiles[0].name} not supported, please upload video or image only`
|
|
3052
|
+
: "Some attachments are not supported, please upload video or image only", isPrimary: true })), { placement: "top" });
|
|
3053
|
+
}
|
|
3054
|
+
return Array.from(data).filter((file) => acceptedMediaTypes.test(file.type));
|
|
3055
|
+
}
|
|
3056
|
+
function getMedia(data) {
|
|
3057
|
+
return getValidMedia(data).map((file) => {
|
|
3058
|
+
return Object.assign(file, {
|
|
3059
|
+
url: URL.createObjectURL(file),
|
|
3060
|
+
isLoadingMedia: true,
|
|
3061
|
+
id: uuid.v4(),
|
|
3062
|
+
});
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
return { getMedia };
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3045
3068
|
const MenuContainer = styled__default["default"].div `
|
|
3046
3069
|
padding: ${({ theme }) => theme.space.xs} 0;
|
|
3047
3070
|
display: flex;
|
|
@@ -3059,59 +3082,33 @@ const VerticalDivider = styled__default["default"].div `
|
|
|
3059
3082
|
const CommentBar = ({ editor, i18n, }) => {
|
|
3060
3083
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3061
3084
|
const { addThumbnails } = useChatContext();
|
|
3085
|
+
const { getMedia } = useMedia();
|
|
3062
3086
|
if (!editor)
|
|
3063
3087
|
return null;
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3066
|
-
case "bold":
|
|
3067
|
-
return jsxRuntime.jsx(SvgBoldStroke, {});
|
|
3068
|
-
case "italic":
|
|
3069
|
-
return jsxRuntime.jsx(SvgItalicStroke, {});
|
|
3070
|
-
case "mention":
|
|
3071
|
-
return jsxRuntime.jsx(SvgAtStroke, {});
|
|
3072
|
-
case "attachment":
|
|
3073
|
-
return jsxRuntime.jsx(SvgClipboard, {});
|
|
3074
|
-
default:
|
|
3075
|
-
return null;
|
|
3076
|
-
}
|
|
3088
|
+
const handleBoldClick = () => {
|
|
3089
|
+
editor.chain().focus().toggleBold().run();
|
|
3077
3090
|
};
|
|
3078
|
-
const
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
const { from } = editor.state.selection;
|
|
3086
|
-
const char = from > 1 ? " @" : "@";
|
|
3087
|
-
return editor.chain().focus().insertContent(char).run();
|
|
3088
|
-
case "attachment":
|
|
3089
|
-
//open a file browser to select one or more images
|
|
3090
|
-
const fileInput = document.createElement("input");
|
|
3091
|
-
fileInput.type = "file";
|
|
3092
|
-
fileInput.accept = "image/*,video/*";
|
|
3093
|
-
fileInput.multiple = true;
|
|
3094
|
-
fileInput.click();
|
|
3095
|
-
fileInput.onchange = () => {
|
|
3096
|
-
const files = fileInput.files;
|
|
3097
|
-
if (files) {
|
|
3098
|
-
const mediaFiles = Array.from(files).map((file) => {
|
|
3099
|
-
return Object.assign(file, {
|
|
3100
|
-
isLoadingMedia: false,
|
|
3101
|
-
internal_id: uuid.v4(),
|
|
3102
|
-
});
|
|
3103
|
-
});
|
|
3104
|
-
if (mediaFiles.length === 0)
|
|
3105
|
-
return;
|
|
3106
|
-
addThumbnails({ files: mediaFiles });
|
|
3107
|
-
}
|
|
3108
|
-
};
|
|
3109
|
-
return;
|
|
3110
|
-
default:
|
|
3111
|
-
return;
|
|
3112
|
-
}
|
|
3091
|
+
const handleItalicClick = () => {
|
|
3092
|
+
editor.chain().focus().toggleItalic().run();
|
|
3093
|
+
};
|
|
3094
|
+
const handleMentionClick = () => {
|
|
3095
|
+
const { from } = editor.state.selection;
|
|
3096
|
+
const char = from > 1 ? " @" : "@";
|
|
3097
|
+
editor.chain().focus().insertContent(char).run();
|
|
3113
3098
|
};
|
|
3114
|
-
|
|
3099
|
+
const handleAttachmentClick = () => {
|
|
3100
|
+
const fileInput = document.createElement("input");
|
|
3101
|
+
fileInput.type = "file";
|
|
3102
|
+
fileInput.accept = "image/*,video/*";
|
|
3103
|
+
fileInput.multiple = true;
|
|
3104
|
+
fileInput.click();
|
|
3105
|
+
fileInput.onchange = () => {
|
|
3106
|
+
if (fileInput.files) {
|
|
3107
|
+
addThumbnails({ files: getMedia(fileInput.files) });
|
|
3108
|
+
}
|
|
3109
|
+
};
|
|
3110
|
+
};
|
|
3111
|
+
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({ 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 : "Upload images and video. 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, {}) })) }))] })) }));
|
|
3115
3112
|
};
|
|
3116
3113
|
|
|
3117
3114
|
const CustomMention = Mention__default["default"].extend({
|
|
@@ -3392,45 +3389,13 @@ const StyledDeleteThumbnailX = styled__default["default"].div `
|
|
|
3392
3389
|
width: 32px;
|
|
3393
3390
|
height: 32px;
|
|
3394
3391
|
opacity: 0;
|
|
3392
|
+
transition: opacity 0.2s;
|
|
3395
3393
|
z-index: 2;
|
|
3396
3394
|
`;
|
|
3397
3395
|
const DeleteThumbnailX = ({ deleteThumbnail }) => {
|
|
3398
3396
|
return (jsxRuntime.jsx(StyledDeleteThumbnailX, Object.assign({ className: "deleteThumbnail" }, { children: jsxRuntime.jsx(SvgRemoveMediaIcon, { onClick: (e) => deleteThumbnail(e) }) })));
|
|
3399
3397
|
};
|
|
3400
3398
|
|
|
3401
|
-
const ImageCard = styled__default["default"](SpecialCard) `
|
|
3402
|
-
padding: 0;
|
|
3403
|
-
:hover .deleteThumbnail {
|
|
3404
|
-
opacity: 1;
|
|
3405
|
-
}
|
|
3406
|
-
`;
|
|
3407
|
-
const Preview$1 = styled__default["default"].div `
|
|
3408
|
-
display: flex;
|
|
3409
|
-
justify-content: center;
|
|
3410
|
-
align-items: center;
|
|
3411
|
-
height: 150px;
|
|
3412
|
-
width: 100%;
|
|
3413
|
-
background-image: url(${(props) => props.url});
|
|
3414
|
-
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
3415
|
-
background-size: contain;
|
|
3416
|
-
background-position: center;
|
|
3417
|
-
background-repeat: no-repeat;
|
|
3418
|
-
`;
|
|
3419
|
-
const ImageThumbnail = ({ src, index = 0, removeThumbnail, clickThumbnail, showX = true, isLoadingMedia = true, isError = false, }) => {
|
|
3420
|
-
const handleCancel = (e) => {
|
|
3421
|
-
e.stopPropagation();
|
|
3422
|
-
if (removeThumbnail)
|
|
3423
|
-
removeThumbnail(index);
|
|
3424
|
-
};
|
|
3425
|
-
return (jsxRuntime.jsxs(ImageCard, Object.assign({ onClick: clickThumbnail }, { children: [isLoadingMedia && (jsxRuntime.jsx(Preview$1, Object.assign({ url: "" }, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
|
|
3426
|
-
display: "flex",
|
|
3427
|
-
alignItems: "center",
|
|
3428
|
-
justifyContent: "center",
|
|
3429
|
-
}, size: "large" }) }))), isError && (
|
|
3430
|
-
// todo: add error icon
|
|
3431
|
-
jsxRuntime.jsx("span", { children: "error uploading media" })), !isLoadingMedia && (jsxRuntime.jsx(Preview$1, Object.assign({ url: src }, { children: showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })) })))] })));
|
|
3432
|
-
};
|
|
3433
|
-
|
|
3434
3399
|
var _circle$2, _path$o;
|
|
3435
3400
|
function _extends$t() { _extends$t = 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$t.apply(this, arguments); }
|
|
3436
3401
|
const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
|
|
@@ -3449,16 +3414,11 @@ const SvgVideoPlayIcon = props => /*#__PURE__*/React__namespace.createElement("s
|
|
|
3449
3414
|
fill: "currentColor"
|
|
3450
3415
|
})));
|
|
3451
3416
|
|
|
3452
|
-
const
|
|
3417
|
+
const ImageCard = styled__default["default"](SpecialCard) `
|
|
3453
3418
|
padding: 0;
|
|
3454
3419
|
position: relative;
|
|
3455
3420
|
overflow: hidden;
|
|
3456
|
-
|
|
3457
|
-
&:hover .deleteThumbnail {
|
|
3458
|
-
opacity: 1;
|
|
3459
|
-
z-index: 9999;
|
|
3460
|
-
}
|
|
3461
|
-
|
|
3421
|
+
|
|
3462
3422
|
&:before {
|
|
3463
3423
|
content: "";
|
|
3464
3424
|
position: absolute;
|
|
@@ -3467,46 +3427,66 @@ const VideoCard = styled__default["default"](SpecialCard) `
|
|
|
3467
3427
|
width: 100%;
|
|
3468
3428
|
height: 100%;
|
|
3469
3429
|
background-color: ${({ theme }) => theme.palette.grey[800]};
|
|
3470
|
-
opacity: 0
|
|
3430
|
+
opacity: 0;
|
|
3431
|
+
transition: opacity 0.2s;
|
|
3471
3432
|
z-index: 1;
|
|
3472
3433
|
}
|
|
3473
3434
|
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3435
|
+
&:hover {
|
|
3436
|
+
.deleteThumbnail {
|
|
3437
|
+
opacity: 1;
|
|
3438
|
+
}
|
|
3439
|
+
&:before {
|
|
3440
|
+
opacity: 0.3;
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
&.video{
|
|
3445
|
+
|
|
3446
|
+
svg {
|
|
3447
|
+
position: absolute;
|
|
3448
|
+
top: 50%;
|
|
3449
|
+
left: 50%;
|
|
3450
|
+
transform: translate(-50%, -50%);
|
|
3451
|
+
width: 32px;
|
|
3452
|
+
height: 32px;
|
|
3453
|
+
z-index: 2;
|
|
3454
|
+
}
|
|
3482
3455
|
}
|
|
3483
3456
|
`;
|
|
3484
3457
|
const Preview = styled__default["default"].div `
|
|
3485
|
-
padding: ${({ theme }) => theme.space.md};
|
|
3486
3458
|
display: flex;
|
|
3487
3459
|
justify-content: center;
|
|
3488
3460
|
align-items: center;
|
|
3489
3461
|
height: 150px;
|
|
3490
3462
|
width: 100%;
|
|
3491
3463
|
|
|
3464
|
+
${p => p.url && `
|
|
3465
|
+
background-image: url(${p.url});
|
|
3466
|
+
background-color: ${p.theme.palette.grey[100]};
|
|
3467
|
+
background-size: contain;
|
|
3468
|
+
background-position: center;
|
|
3469
|
+
background-repeat: no-repeat;
|
|
3470
|
+
`}
|
|
3471
|
+
|
|
3492
3472
|
> video {
|
|
3493
3473
|
width: 100%;
|
|
3494
3474
|
height: 100%;
|
|
3495
3475
|
}
|
|
3496
3476
|
`;
|
|
3497
|
-
const
|
|
3477
|
+
const Thumbnail = ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia = true, isError = false, }) => {
|
|
3498
3478
|
const handleCancel = (e) => {
|
|
3499
3479
|
e.stopPropagation();
|
|
3500
3480
|
if (removeThumbnail)
|
|
3501
|
-
removeThumbnail(
|
|
3481
|
+
removeThumbnail();
|
|
3502
3482
|
};
|
|
3503
|
-
return (jsxRuntime.jsxs(
|
|
3483
|
+
return (jsxRuntime.jsxs(ImageCard, Object.assign({ onClick: clickThumbnail, className: type.includes('video') ? 'video' : 'image' }, { children: [isError && (
|
|
3484
|
+
// todo: add error icon
|
|
3485
|
+
jsxRuntime.jsx("span", { children: "error uploading media" })), isLoadingMedia ? (jsxRuntime.jsx(Preview, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
|
|
3504
3486
|
display: "flex",
|
|
3505
3487
|
alignItems: "center",
|
|
3506
3488
|
justifyContent: "center",
|
|
3507
|
-
}, size: "large" }) })),
|
|
3508
|
-
// todo: add error icon
|
|
3509
|
-
jsxRuntime.jsx("span", { children: "error uploading media" })), !isLoadingMedia && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), jsxRuntime.jsx(Preview, { children: jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })) }), jsxRuntime.jsx(SvgVideoPlayIcon, {})] }))] })));
|
|
3489
|
+
}, size: "large" }) })) : (jsxRuntime.jsxs(Preview, Object.assign({ url: src }, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), type.includes('video') && jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })), jsxRuntime.jsx(SvgVideoPlayIcon, {})] })] })))] })));
|
|
3510
3490
|
};
|
|
3511
3491
|
|
|
3512
3492
|
const UgGrid = styled__default["default"](reactGrid.Grid) `
|
|
@@ -3538,32 +3518,20 @@ const ThumbnailContainer = ({ openLightbox }) => {
|
|
|
3538
3518
|
return thumbnails.map((file) => ({
|
|
3539
3519
|
fileName: file.name,
|
|
3540
3520
|
fileType: file.type,
|
|
3541
|
-
previewUrl:
|
|
3542
|
-
|
|
3521
|
+
previewUrl: file.url,
|
|
3522
|
+
id: file.id,
|
|
3543
3523
|
isLoadingMedia: file.isLoadingMedia,
|
|
3544
3524
|
}));
|
|
3545
3525
|
}, [thumbnails]);
|
|
3546
3526
|
if (!mediaFiles || mediaFiles.length === 0) {
|
|
3547
3527
|
return null;
|
|
3548
3528
|
}
|
|
3549
|
-
return (jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: mediaFiles.map((file, index) => {
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
}, clickThumbnail: () => {
|
|
3556
|
-
openLightbox(thumbnails[index], index);
|
|
3557
|
-
} }, index) })));
|
|
3558
|
-
if (file.fileType.includes("video"))
|
|
3559
|
-
return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.previewUrl, index: index, showX: true, isLoadingMedia: file.isLoadingMedia, removeThumbnail: () => {
|
|
3560
|
-
removeThumbnail(index);
|
|
3561
|
-
onDeleteThumbnail(file.internal_id);
|
|
3562
|
-
}, clickThumbnail: () => {
|
|
3563
|
-
openLightbox(thumbnails[index], index);
|
|
3564
|
-
} }, index) })));
|
|
3565
|
-
return null;
|
|
3566
|
-
}) })) }));
|
|
3529
|
+
return (jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: mediaFiles.map((file, index) => (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 3, className: "flex-3-sm" }, { children: jsxRuntime.jsx(Thumbnail, { src: file.previewUrl, showX: true, type: file.fileType, isLoadingMedia: file.isLoadingMedia, removeThumbnail: () => {
|
|
3530
|
+
removeThumbnail(index);
|
|
3531
|
+
onDeleteThumbnail(file.id);
|
|
3532
|
+
}, clickThumbnail: () => {
|
|
3533
|
+
openLightbox(index);
|
|
3534
|
+
} }, file.id) })))) })) }));
|
|
3567
3535
|
};
|
|
3568
3536
|
|
|
3569
3537
|
const UgModalBody = styled__default["default"](reactModals.Body) `
|
|
@@ -4722,11 +4690,7 @@ const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx
|
|
|
4722
4690
|
* Used for this:
|
|
4723
4691
|
- To display a video
|
|
4724
4692
|
*/
|
|
4725
|
-
const Player = React.forwardRef((props, forwardRef) => {
|
|
4726
|
-
const videoRef = React.useRef(null);
|
|
4727
|
-
React.useImperativeHandle(forwardRef, () => videoRef.current);
|
|
4728
|
-
return (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: videoRef }, props)) })));
|
|
4729
|
-
});
|
|
4693
|
+
const Player = React.forwardRef((props, forwardRef) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: forwardRef }, props)) }))));
|
|
4730
4694
|
const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
4731
4695
|
var _a;
|
|
4732
4696
|
const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
|
|
@@ -4734,7 +4698,7 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
|
4734
4698
|
const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
|
|
4735
4699
|
const isLoaded = !!videoRef;
|
|
4736
4700
|
const containerRef = React.useRef(null);
|
|
4737
|
-
React.useImperativeHandle(forwardRef, () => videoRef);
|
|
4701
|
+
React.useImperativeHandle(forwardRef, () => videoRef, [videoRef]);
|
|
4738
4702
|
React.useEffect(() => {
|
|
4739
4703
|
if (videoRef) {
|
|
4740
4704
|
videoRef.addEventListener("pause", () => {
|
|
@@ -4752,6 +4716,15 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
|
4752
4716
|
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 }) })] })));
|
|
4753
4717
|
});
|
|
4754
4718
|
|
|
4719
|
+
const MediaLightBox = ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }) => {
|
|
4720
|
+
if (!isOpen) {
|
|
4721
|
+
return null;
|
|
4722
|
+
}
|
|
4723
|
+
return (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: onClose }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: header }), jsxRuntime.jsxs(Lightbox.Body, { children: [jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: details ? 2 : 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: thumbnails.map((item) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type.includes("image") && (jsxRuntime.jsx("img", { src: item.url, alt: `media ${item.name}`, style: { maxHeight: "100%", height: "auto" } })), item.type.includes("video") && item.url && (jsxRuntime.jsx(Player, { ref: (ref) => {
|
|
4724
|
+
videoRefs.current.push(ref);
|
|
4725
|
+
}, url: item.url }))] }, item.id))) })) })), details && (jsxRuntime.jsx(Lightbox.Body.Details, Object.assign({ style: { flex: 1 } }, { children: details })))] }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] })));
|
|
4726
|
+
};
|
|
4727
|
+
|
|
4755
4728
|
const ChatBoxContainer = styled__default["default"].div `
|
|
4756
4729
|
display: flex;
|
|
4757
4730
|
border-top: 1px solid ${({ theme }) => theme.palette.grey[200]};
|
|
@@ -4771,14 +4744,19 @@ const ChatBoxContainer = styled__default["default"].div `
|
|
|
4771
4744
|
- Simple text input, use textarea instead.
|
|
4772
4745
|
*/
|
|
4773
4746
|
const CommentBox = (_a) => {
|
|
4747
|
+
var _b;
|
|
4774
4748
|
var { placeholderOptions } = _a, props = __rest(_a, ["placeholderOptions"]);
|
|
4775
4749
|
const { children, hasFloatingMenu, hasButtonsMenu, bubbleOptions, i18n } = props;
|
|
4776
4750
|
const { editor, setEditor, mentionableUsers, triggerSave, thumbnails, addThumbnails, } = useChatContext();
|
|
4777
|
-
const { addToast } = useToast();
|
|
4778
4751
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
4779
|
-
const [selectedImage, setSelectedImage] = React.useState({});
|
|
4780
4752
|
const [selectedImageIndex, setSelectedImageIndex] = React.useState(0);
|
|
4753
|
+
const { getMedia } = useMedia();
|
|
4781
4754
|
const ext = editorExtensions({ placeholderOptions, mentionableUsers });
|
|
4755
|
+
function handleEvent(data) {
|
|
4756
|
+
if (!data || !data.files)
|
|
4757
|
+
return;
|
|
4758
|
+
addThumbnails({ files: getMedia(data.files) });
|
|
4759
|
+
}
|
|
4782
4760
|
const closeLightbox = () => {
|
|
4783
4761
|
setIsOpen(false);
|
|
4784
4762
|
};
|
|
@@ -4791,10 +4769,7 @@ const CommentBox = (_a) => {
|
|
|
4791
4769
|
}
|
|
4792
4770
|
});
|
|
4793
4771
|
}, [videoRefs]);
|
|
4794
|
-
const handleOpenLightbox = (
|
|
4795
|
-
if (!file)
|
|
4796
|
-
throw Error("Error with the image");
|
|
4797
|
-
setSelectedImage(file);
|
|
4772
|
+
const handleOpenLightbox = (index) => {
|
|
4798
4773
|
setSelectedImageIndex(index);
|
|
4799
4774
|
setIsOpen(true);
|
|
4800
4775
|
};
|
|
@@ -4806,48 +4781,12 @@ const CommentBox = (_a) => {
|
|
|
4806
4781
|
return false;
|
|
4807
4782
|
},
|
|
4808
4783
|
handleDrop: function (view, event, slice, moved) {
|
|
4809
|
-
if (!event.dataTransfer || !event.dataTransfer.files)
|
|
4810
|
-
return false;
|
|
4811
4784
|
event.preventDefault();
|
|
4812
|
-
|
|
4813
|
-
return Object.assign(file, {
|
|
4814
|
-
isLoadingMedia: false,
|
|
4815
|
-
internal_id: uuid.v4(),
|
|
4816
|
-
});
|
|
4817
|
-
});
|
|
4818
|
-
const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
|
|
4819
|
-
if (wrongFiles.length > 0) {
|
|
4820
|
-
for (const file of wrongFiles) {
|
|
4821
|
-
addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
|
|
4822
|
-
}
|
|
4823
|
-
}
|
|
4824
|
-
const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
|
|
4825
|
-
if (mediaFiles.length === 0)
|
|
4826
|
-
return false;
|
|
4827
|
-
addThumbnails({ files: mediaFiles });
|
|
4828
|
-
return false;
|
|
4785
|
+
handleEvent(event.dataTransfer);
|
|
4829
4786
|
},
|
|
4830
4787
|
handlePaste: (view, event, slice) => {
|
|
4831
|
-
if (!event.clipboardData || !event.clipboardData.items)
|
|
4832
|
-
return false;
|
|
4833
4788
|
event.preventDefault();
|
|
4834
|
-
|
|
4835
|
-
return Object.assign(file, {
|
|
4836
|
-
isLoadingMedia: false,
|
|
4837
|
-
internal_id: uuid.v4(),
|
|
4838
|
-
});
|
|
4839
|
-
});
|
|
4840
|
-
const wrongFiles = files.filter((file) => !/^(image|video)\//.test(file.type));
|
|
4841
|
-
if (wrongFiles.length > 0) {
|
|
4842
|
-
for (const file of wrongFiles) {
|
|
4843
|
-
addToast(({ close }) => (jsxRuntime.jsx(Notification, { onClose: close, type: "error", message: `${props.messageBadFileFormat} - ${file.name}`, isPrimary: true })), { placement: "top" });
|
|
4844
|
-
}
|
|
4845
|
-
}
|
|
4846
|
-
const mediaFiles = files.filter((file) => /^(image|video)\//.test(file.type));
|
|
4847
|
-
if (mediaFiles.length === 0)
|
|
4848
|
-
return false;
|
|
4849
|
-
addThumbnails({ files: mediaFiles });
|
|
4850
|
-
return false;
|
|
4789
|
+
handleEvent(event.clipboardData);
|
|
4851
4790
|
},
|
|
4852
4791
|
} }, props));
|
|
4853
4792
|
const onKeyDown = (event) => {
|
|
@@ -4860,12 +4799,7 @@ const CommentBox = (_a) => {
|
|
|
4860
4799
|
return null;
|
|
4861
4800
|
ed.on("create", ({ editor }) => setEditor(editor));
|
|
4862
4801
|
ed.on("update", ({ editor }) => setEditor(editor));
|
|
4863
|
-
|
|
4864
|
-
return Object.assign(file, { isLoadingMedia: file.isLoadingMedia });
|
|
4865
|
-
});
|
|
4866
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: selectedImage.name }), jsxRuntime.jsx(Lightbox.Body, { children: jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 3 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: mediaFiles.map((item, index) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type.includes("image") && (jsxRuntime.jsx("img", { src: URL.createObjectURL(item), alt: `media ${item.name}` })), item.type.includes("video") && (jsxRuntime.jsx(Player, { ref: (ref) => {
|
|
4867
|
-
videoRefs.current.push(ref);
|
|
4868
|
-
}, url: URL.createObjectURL(item) }))] }))) })) })) }), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), 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 })] }));
|
|
4802
|
+
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 })] }));
|
|
4869
4803
|
};
|
|
4870
4804
|
|
|
4871
4805
|
const CommentCard = styled.styled(Card) `
|
|
@@ -4911,13 +4845,9 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
|
|
|
4911
4845
|
var _a, _b;
|
|
4912
4846
|
const { mentionableUsers } = useChatContext();
|
|
4913
4847
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
4914
|
-
const [selectedImage, setSelectedImage] = React.useState({});
|
|
4915
4848
|
const [selectedImageIndex, setSelectedImageIndex] = React.useState(0);
|
|
4916
4849
|
const ext = editorExtensions({ mentionableUsers });
|
|
4917
|
-
const handleClickThumbnail = (
|
|
4918
|
-
if (!file)
|
|
4919
|
-
throw Error("Error with the image");
|
|
4920
|
-
setSelectedImage(file);
|
|
4850
|
+
const handleClickThumbnail = (index) => {
|
|
4921
4851
|
setSelectedImageIndex(index);
|
|
4922
4852
|
setIsOpen(true);
|
|
4923
4853
|
};
|
|
@@ -4926,7 +4856,6 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
|
|
|
4926
4856
|
};
|
|
4927
4857
|
const videoRefs = React.useRef([]);
|
|
4928
4858
|
const slideChange = React.useCallback((index) => {
|
|
4929
|
-
setSelectedImage(media[index]);
|
|
4930
4859
|
setSelectedImageIndex(index);
|
|
4931
4860
|
videoRefs.current.forEach((ref) => {
|
|
4932
4861
|
if (ref) {
|
|
@@ -4943,23 +4872,12 @@ const Comment = ({ author, message, children, date, media = [], header, }) => {
|
|
|
4943
4872
|
ed.setOptions({
|
|
4944
4873
|
editable: false,
|
|
4945
4874
|
});
|
|
4946
|
-
return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", " ", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => {
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
if (file.type.includes("video"))
|
|
4953
|
-
return (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(VideoThumbnail, { src: file.url, index: index, showX: false, isLoadingMedia: false, clickThumbnail: () => {
|
|
4954
|
-
handleClickThumbnail(file, index);
|
|
4955
|
-
} }, index) })));
|
|
4956
|
-
return null;
|
|
4957
|
-
}) })) }), isOpen && selectedImage && (jsxRuntime.jsxs(Lightbox, Object.assign({ onClose: closeLightbox }, { children: [jsxRuntime.jsx(Lightbox.Header, { children: 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] }))] })) }), jsxRuntime.jsxs(Lightbox.Body, { children: [jsxRuntime.jsx(Lightbox.Body.Main, Object.assign({ style: { flex: 2 } }, { children: jsxRuntime.jsx(Slider, Object.assign({ prevArrow: jsxRuntime.jsx(Slider.PrevButton, { isBright: true }), nextArrow: jsxRuntime.jsx(Slider.NextButton, { isBright: true }), onSlideChange: slideChange, initialSlide: selectedImageIndex }, { children: media.map((item, index) => (jsxRuntime.jsxs(Slider.Slide, { children: [item.type === "image" && (jsxRuntime.jsx("img", { src: item.url, alt: `{{${item.url}}}` })), item.type === "video" && (jsxRuntime.jsx(Player, { ref: (ref) => {
|
|
4958
|
-
videoRefs.current.push(ref);
|
|
4959
|
-
}, url: item.url }))] }))) })) })), jsxRuntime.jsx(Lightbox.Body.Details, Object.assign({ style: { flex: 1 } }, { children: jsxRuntime.jsx(Comment, Object.assign({ header: header, author: {
|
|
4960
|
-
avatar: author.avatar,
|
|
4961
|
-
name: author.name,
|
|
4962
|
-
}, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }))] }), jsxRuntime.jsx(Lightbox.Footer, {}), jsxRuntime.jsx(Lightbox.Close, { "aria-label": "Close modal" })] }))), jsxRuntime.jsx(Footer$2, { children: children })] }));
|
|
4875
|
+
return (jsxRuntime.jsxs(CommentCard, { children: [jsxRuntime.jsxs(AuthorContainer, { children: [jsxRuntime.jsx(Avatar, Object.assign({ avatarType: (_a = author.avatarType) !== null && _a !== void 0 ? _a : "text", style: { flexShrink: 0 } }, { children: author.avatar })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(CommentTitle, { children: [(_b = author.name) !== null && _b !== void 0 ? _b : "User", " ", jsxRuntime.jsx(CommentDate, { children: date })] }), jsxRuntime.jsx(ReadOnly, { children: jsxRuntime.jsx(EditorContainer$1, Object.assign({ editable: false }, { children: jsxRuntime.jsx(react.EditorContent, { editor: ed }) })) })] })] }), jsxRuntime.jsx(Grid, { children: jsxRuntime.jsx(Row$1, Object.assign({ className: "responsive-container" }, { children: media.map((file, index) => (jsxRuntime.jsx(Col, Object.assign({ xs: 12, sm: 4, className: "flex-3-sm" }, { children: jsxRuntime.jsx(Thumbnail, { src: file.url, type: file.type, showX: false, isLoadingMedia: false, clickThumbnail: () => {
|
|
4876
|
+
handleClickThumbnail(index);
|
|
4877
|
+
} }) }), 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: {
|
|
4878
|
+
avatar: author.avatar,
|
|
4879
|
+
name: author.name,
|
|
4880
|
+
}, date: date, message: message }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("br", {}) }) })) }), jsxRuntime.jsx(Footer$2, { children: children })] }));
|
|
4963
4881
|
};
|
|
4964
4882
|
|
|
4965
4883
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ButtonArgs } from "./_types";
|
|
3
2
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
|
|
4
3
|
export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
|
|
@@ -8,18 +8,18 @@ export declare const variants: readonly [{}, {
|
|
|
8
8
|
readonly disabled: true;
|
|
9
9
|
}];
|
|
10
10
|
export declare const Row: import("styled-components").IStyledComponent<"web", {
|
|
11
|
-
alignItems?: "
|
|
12
|
-
alignItemsXs?: "
|
|
13
|
-
alignItemsSm?: "
|
|
14
|
-
alignItemsMd?: "
|
|
15
|
-
alignItemsLg?: "
|
|
16
|
-
alignItemsXl?: "
|
|
17
|
-
justifyContent?: "
|
|
18
|
-
justifyContentXs?: "
|
|
19
|
-
justifyContentSm?: "
|
|
20
|
-
justifyContentMd?: "
|
|
21
|
-
justifyContentLg?: "
|
|
22
|
-
justifyContentXl?: "
|
|
11
|
+
alignItems?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
|
|
12
|
+
alignItemsXs?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
|
|
13
|
+
alignItemsSm?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
|
|
14
|
+
alignItemsMd?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
|
|
15
|
+
alignItemsLg?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
|
|
16
|
+
alignItemsXl?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
|
|
17
|
+
justifyContent?: "start" | "center" | "end" | "between" | "around" | undefined;
|
|
18
|
+
justifyContentXs?: "start" | "center" | "end" | "between" | "around" | undefined;
|
|
19
|
+
justifyContentSm?: "start" | "center" | "end" | "between" | "around" | undefined;
|
|
20
|
+
justifyContentMd?: "start" | "center" | "end" | "between" | "around" | undefined;
|
|
21
|
+
justifyContentLg?: "start" | "center" | "end" | "between" | "around" | undefined;
|
|
22
|
+
justifyContentXl?: "start" | "center" | "end" | "between" | "around" | undefined;
|
|
23
23
|
wrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
|
|
24
24
|
wrapXs?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
|
|
25
25
|
wrapSm?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
|
|
@@ -73,7 +73,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
|
|
|
73
73
|
results?: number | undefined;
|
|
74
74
|
security?: string | undefined;
|
|
75
75
|
unselectable?: "on" | "off" | undefined;
|
|
76
|
-
inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" |
|
|
76
|
+
inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
|
|
77
77
|
is?: string | undefined;
|
|
78
78
|
"aria-activedescendant"?: string | undefined;
|
|
79
79
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -299,18 +299,18 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
|
|
|
299
299
|
md?: string | number | boolean | undefined;
|
|
300
300
|
lg?: string | number | boolean | undefined;
|
|
301
301
|
xl?: string | number | boolean | undefined;
|
|
302
|
-
alignSelf?: "
|
|
303
|
-
alignSelfXs?: "
|
|
304
|
-
alignSelfSm?: "
|
|
305
|
-
alignSelfMd?: "
|
|
306
|
-
alignSelfLg?: "
|
|
307
|
-
alignSelfXl?: "
|
|
308
|
-
textAlign?: "
|
|
309
|
-
textAlignXs?: "
|
|
310
|
-
textAlignSm?: "
|
|
311
|
-
textAlignMd?: "
|
|
312
|
-
textAlignLg?: "
|
|
313
|
-
textAlignXl?: "
|
|
302
|
+
alignSelf?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
|
|
303
|
+
alignSelfXs?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
|
|
304
|
+
alignSelfSm?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
|
|
305
|
+
alignSelfMd?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
|
|
306
|
+
alignSelfLg?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
|
|
307
|
+
alignSelfXl?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
|
|
308
|
+
textAlign?: "start" | "center" | "end" | "justify" | undefined;
|
|
309
|
+
textAlignXs?: "start" | "center" | "end" | "justify" | undefined;
|
|
310
|
+
textAlignSm?: "start" | "center" | "end" | "justify" | undefined;
|
|
311
|
+
textAlignMd?: "start" | "center" | "end" | "justify" | undefined;
|
|
312
|
+
textAlignLg?: "start" | "center" | "end" | "justify" | undefined;
|
|
313
|
+
textAlignXl?: "start" | "center" | "end" | "justify" | undefined;
|
|
314
314
|
offset?: string | number | undefined;
|
|
315
315
|
offsetXs?: string | number | undefined;
|
|
316
316
|
offsetSm?: string | number | undefined;
|
|
@@ -370,7 +370,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
|
|
|
370
370
|
results?: number | undefined;
|
|
371
371
|
security?: string | undefined;
|
|
372
372
|
unselectable?: "on" | "off" | undefined;
|
|
373
|
-
inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" |
|
|
373
|
+
inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
|
|
374
374
|
is?: string | undefined;
|
|
375
375
|
"aria-activedescendant"?: string | undefined;
|
|
376
376
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -640,7 +640,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
|
|
|
640
640
|
results?: number | undefined;
|
|
641
641
|
security?: string | undefined;
|
|
642
642
|
unselectable?: "on" | "off" | undefined;
|
|
643
|
-
inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" |
|
|
643
|
+
inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
|
|
644
644
|
is?: string | undefined;
|
|
645
645
|
"aria-activedescendant"?: string | undefined;
|
|
646
646
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
@@ -9,7 +9,6 @@ export type SuggestedUser = {
|
|
|
9
9
|
};
|
|
10
10
|
export interface ChatEditorArgs extends Partial<EditorOptions> {
|
|
11
11
|
author: Author;
|
|
12
|
-
messageBadFileFormat: string;
|
|
13
12
|
placeholderOptions?: Partial<PlaceholderOptions>;
|
|
14
13
|
hasFloatingMenu?: boolean;
|
|
15
14
|
hasButtonsMenu?: boolean;
|
|
@@ -38,10 +37,13 @@ export interface EditorHeaderArgs {
|
|
|
38
37
|
title?: string;
|
|
39
38
|
validation?: validationStatus;
|
|
40
39
|
}
|
|
41
|
-
export interface
|
|
42
|
-
|
|
40
|
+
export interface CommentMedia {
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
isLoadingMedia?: boolean;
|
|
43
45
|
isError?: boolean;
|
|
44
|
-
|
|
46
|
+
url?: string;
|
|
45
47
|
}
|
|
46
48
|
export interface FloatingMenuArgs extends Partial<BubbleMenuProps> {
|
|
47
49
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Editor } from "@tiptap/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { CommentMedia, SuggestedUser } from "../_types";
|
|
4
4
|
export type ChatContextType = {
|
|
5
5
|
triggerSave: () => void;
|
|
6
6
|
editor?: Editor;
|
|
7
7
|
setEditor: React.Dispatch<React.SetStateAction<Editor | undefined>>;
|
|
8
8
|
addThumbnails: (props: {
|
|
9
|
-
files:
|
|
9
|
+
files: CommentMedia[];
|
|
10
10
|
}) => void;
|
|
11
11
|
removeThumbnail: (index: number) => void;
|
|
12
|
-
thumbnails:
|
|
12
|
+
thumbnails: CommentMedia[];
|
|
13
13
|
mentionableUsers: (props: {
|
|
14
14
|
query: string;
|
|
15
15
|
}) => SuggestedUser[];
|
|
@@ -29,7 +29,7 @@ export interface Data {
|
|
|
29
29
|
}
|
|
30
30
|
export declare const ChatContextProvider: ({ onSave, onFileUpload, onDeleteThumbnail, setMentionableUsers, children, }: {
|
|
31
31
|
onSave?: ((editor: Editor, mentions: SuggestedUser[]) => void) | undefined;
|
|
32
|
-
onFileUpload?: ((files:
|
|
32
|
+
onFileUpload?: ((files: CommentMedia[]) => Promise<Data>) | undefined;
|
|
33
33
|
onDeleteThumbnail: (id: string) => void;
|
|
34
34
|
children: React.ReactNode;
|
|
35
35
|
setMentionableUsers: (props: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { PlaceholderOptions } from "@tiptap/extension-placeholder";
|
|
3
2
|
import { Editor as TipTapEditor } from "@tiptap/react";
|
|
4
|
-
import { ChatEditorArgs,
|
|
5
|
-
import { MediaType } from "./parts/comment";
|
|
3
|
+
import { ChatEditorArgs, CommentMedia, SuggestedUser } from "./_types";
|
|
6
4
|
import { Data } from "./context/chatContext";
|
|
7
5
|
interface EditorStoryArgs extends ChatEditorArgs {
|
|
8
6
|
children?: any;
|
|
@@ -14,12 +12,12 @@ interface EditorStoryArgs extends ChatEditorArgs {
|
|
|
14
12
|
};
|
|
15
13
|
message: string;
|
|
16
14
|
date: string;
|
|
17
|
-
media?:
|
|
15
|
+
media?: CommentMedia[];
|
|
18
16
|
}[];
|
|
19
17
|
editorText?: string;
|
|
20
18
|
background?: string;
|
|
21
19
|
onSave: (editor: TipTapEditor, mentions: SuggestedUser[]) => void;
|
|
22
|
-
onFileUpload?: (files:
|
|
20
|
+
onFileUpload?: (files: CommentMedia[]) => Promise<Data>;
|
|
23
21
|
placeholderOptions?: Partial<PlaceholderOptions>;
|
|
24
22
|
}
|
|
25
23
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, EditorStoryArgs>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommentMedia } from "../_types";
|
|
3
|
+
interface MediaLightBoxProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
header: React.ReactNode;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
slideChange: (index: number) => void;
|
|
8
|
+
selectedImageIndex: number;
|
|
9
|
+
thumbnails: CommentMedia[];
|
|
10
|
+
videoRefs: React.MutableRefObject<Array<HTMLVideoElement | null>>;
|
|
11
|
+
details?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const MediaLightBox: ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }: MediaLightBoxProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export default MediaLightBox;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
src?: string;
|
|
3
|
+
type: string;
|
|
4
|
+
clickThumbnail?: () => void;
|
|
5
|
+
isLoadingMedia?: boolean;
|
|
6
|
+
removeThumbnail?: () => void;
|
|
7
|
+
showX?: boolean;
|
|
8
|
+
isError?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Thumbnail: ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia, isError, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default Thumbnail;
|
|
@@ -7,7 +7,7 @@ export interface FileElement {
|
|
|
7
7
|
isLoadingMedia: boolean;
|
|
8
8
|
}
|
|
9
9
|
interface Props {
|
|
10
|
-
openLightbox: (
|
|
10
|
+
openLightbox: (index: number) => void;
|
|
11
11
|
}
|
|
12
12
|
declare const ThumbnailContainer: ({ openLightbox }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
13
|
export default ThumbnailContainer;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
|
-
import { Author } from "../_types";
|
|
3
|
-
export type MediaType = {
|
|
4
|
-
url: string;
|
|
5
|
-
id: number;
|
|
6
|
-
type: "image" | "video";
|
|
7
|
-
};
|
|
2
|
+
import { Author, CommentMedia } from "../_types";
|
|
8
3
|
export declare const Comment: ({ author, message, children, date, media, header, }: PropsWithChildren<{
|
|
9
4
|
author: Author;
|
|
10
5
|
message: string;
|
|
11
6
|
date: string;
|
|
12
|
-
media?:
|
|
7
|
+
media?: CommentMedia[] | undefined;
|
|
13
8
|
header: {
|
|
14
9
|
title: string;
|
|
15
10
|
message?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
src: string;
|
|
3
|
-
index?: number;
|
|
4
|
-
removeThumbnail?: (index: number) => void;
|
|
5
|
-
clickThumbnail: () => void;
|
|
6
|
-
showX?: boolean;
|
|
7
|
-
isLoadingMedia: boolean;
|
|
8
|
-
isError?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const ImageThumbnail: ({ src, index, removeThumbnail, clickThumbnail, showX, isLoadingMedia, isError, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default ImageThumbnail;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
src: string;
|
|
3
|
-
index?: number;
|
|
4
|
-
removeThumbnail?: (index: number) => void;
|
|
5
|
-
clickThumbnail: () => void;
|
|
6
|
-
showX?: boolean;
|
|
7
|
-
isLoadingMedia: boolean;
|
|
8
|
-
isError?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const VideoThumbnail: ({ src, index, removeThumbnail, clickThumbnail, showX, isLoadingMedia, isError, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default VideoThumbnail;
|