@reltio/components 1.4.1837 → 1.4.1838
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/cjs/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
- package/cjs/CollaborationItem/components/RepliedComment/styles.d.ts +1 -1
- package/cjs/CollaborationItem/components/RepliedComment/styles.js +3 -0
- package/cjs/CollaborationItem/components/SendMessageArea/styles.js +1 -1
- package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.d.ts +1 -1
- package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.js +9 -7
- package/cjs/CollaborationItem/components/TextFieldWithMentions/constants.d.ts +1 -0
- package/cjs/CollaborationItem/components/TextFieldWithMentions/constants.js +4 -0
- package/cjs/CollaborationItem/components/TextFieldWithMentions/styles.d.ts +5 -1
- package/cjs/CollaborationItem/components/TextFieldWithMentions/styles.js +58 -48
- package/esm/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
- package/esm/CollaborationItem/components/RepliedComment/styles.d.ts +1 -1
- package/esm/CollaborationItem/components/RepliedComment/styles.js +3 -0
- package/esm/CollaborationItem/components/SendMessageArea/styles.js +1 -1
- package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.d.ts +1 -1
- package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.js +9 -7
- package/esm/CollaborationItem/components/TextFieldWithMentions/constants.d.ts +1 -0
- package/esm/CollaborationItem/components/TextFieldWithMentions/constants.js +1 -0
- package/esm/CollaborationItem/components/TextFieldWithMentions/styles.d.ts +5 -1
- package/esm/CollaborationItem/components/TextFieldWithMentions/styles.js +58 -48
- package/package.json +1 -1
|
@@ -68,7 +68,7 @@ var RepliedComment = function (_a) {
|
|
|
68
68
|
var sendMessageArea = (react_1.default.createElement(SendMessageArea_1.SendMessageArea, { inputRef: inputRef, popperRef: popperRef, uri: uri, onCancel: function () { return updateIsEditingReply(false); }, isEditingReply: isEditing, reply: reply, comment: comment }));
|
|
69
69
|
return (react_1.default.createElement(Box_1.default, { className: (0, classnames_1.default)(styles.root, className) },
|
|
70
70
|
react_1.default.createElement(Avatar_1.Avatar, { classes: { root: styles.avatar } }, createdBy),
|
|
71
|
-
react_1.default.createElement(Box_1.default, {
|
|
71
|
+
react_1.default.createElement(Box_1.default, { className: styles.replyArea },
|
|
72
72
|
react_1.default.createElement(Box_1.default, { className: styles.header },
|
|
73
73
|
react_1.default.createElement(Typography_1.default, { className: styles.username }, createdBy),
|
|
74
74
|
action === 'resolve' && (react_1.default.createElement(Typography_1.default, { className: styles.marked }, ui_i18n_1.default.text('Marked as resolved'))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "marked">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "replyArea" | "marked">;
|
|
@@ -2,5 +2,5 @@ import { MentionsInputProps } from 'react-mentions';
|
|
|
2
2
|
type Props = Omit<MentionsInputProps, 'children' | 'onChange'> & {
|
|
3
3
|
onChange?: (value: string, plainTextValue: string, mentions: string[]) => void;
|
|
4
4
|
};
|
|
5
|
-
export declare const TextFieldWithMentions: ({ onChange, className, ...props }: Props) => JSX.Element;
|
|
5
|
+
export declare const TextFieldWithMentions: ({ onChange, className, value, placeholder, ...props }: Props) => JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -55,9 +55,10 @@ var ramda_1 = require("ramda");
|
|
|
55
55
|
var react_mentions_1 = require("react-mentions");
|
|
56
56
|
var UsersContext_1 = require("../../../contexts/UsersContext");
|
|
57
57
|
var styles_1 = require("./styles");
|
|
58
|
+
var constants_1 = require("./constants");
|
|
58
59
|
var TextFieldWithMentions = function (_a) {
|
|
59
|
-
var onChange = _a.onChange, className = _a.className, props = __rest(_a, ["onChange", "className"]);
|
|
60
|
-
var styles = (0, styles_1.useStyles)();
|
|
60
|
+
var onChange = _a.onChange, className = _a.className, value = _a.value, placeholder = _a.placeholder, props = __rest(_a, ["onChange", "className", "value", "placeholder"]);
|
|
61
|
+
var styles = (0, styles_1.useStyles)({ placeholder: value ? '' : placeholder });
|
|
61
62
|
var users = (0, react_1.useContext)(UsersContext_1.UsersContext);
|
|
62
63
|
var handleChange = function (_, value, plainTextValue, mentions) {
|
|
63
64
|
onChange(value, plainTextValue, (0, ramda_1.uniq)(mentions.map(function (_a) {
|
|
@@ -65,10 +66,11 @@ var TextFieldWithMentions = function (_a) {
|
|
|
65
66
|
return display.slice(1);
|
|
66
67
|
})));
|
|
67
68
|
};
|
|
68
|
-
return (react_1.default.createElement(
|
|
69
|
-
react_1.default.createElement(react_mentions_1.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.root, className) },
|
|
70
|
+
react_1.default.createElement(react_mentions_1.MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: (0, classnames_1.default)(constants_1.MENTIONS_TEXTAREA_CLASSNAME), suggestionsPortalHost: document.body }),
|
|
71
|
+
react_1.default.createElement(react_mentions_1.Mention, { trigger: "+", data: users.map(function (_a) {
|
|
72
|
+
var username = _a.username;
|
|
73
|
+
return ({ id: username, display: username });
|
|
74
|
+
}), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention }))));
|
|
73
75
|
};
|
|
74
76
|
exports.TextFieldWithMentions = TextFieldWithMentions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MENTIONS_TEXTAREA_CLASSNAME = "mentionsTextArea";
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
type StylesProps = {
|
|
2
|
+
placeholder?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"root" | "mention">;
|
|
5
|
+
export {};
|
|
@@ -3,53 +3,63 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useStyles = void 0;
|
|
4
4
|
var styles_1 = require("@mui/styles");
|
|
5
5
|
var constants_1 = require("../../../constants");
|
|
6
|
+
var constants_2 = require("./constants");
|
|
6
7
|
var suggestionsZIndex = constants_1.POPUP_Z_INDEX + 1;
|
|
7
|
-
exports.useStyles = (0, styles_1.makeStyles)(function (theme) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
8
|
+
exports.useStyles = (0, styles_1.makeStyles)(function (theme) {
|
|
9
|
+
var _a;
|
|
10
|
+
return ({
|
|
11
|
+
root: (_a = {
|
|
12
|
+
backgroundColor: '#fff',
|
|
13
|
+
fontFamily: 'Roboto'
|
|
14
|
+
},
|
|
15
|
+
_a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__control")] = {
|
|
16
|
+
fontSize: '13px'
|
|
17
|
+
},
|
|
18
|
+
_a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__highlighter")] = {
|
|
19
|
+
padding: '10px 22px',
|
|
20
|
+
border: '1px solid transparent !important',
|
|
21
|
+
'&::before': {
|
|
22
|
+
content: function (_a) {
|
|
23
|
+
var placeholder = _a.placeholder;
|
|
24
|
+
return placeholder && "\"".concat(placeholder, "\"");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
_a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__input")] = {
|
|
29
|
+
borderRadius: '2px',
|
|
30
|
+
border: '1px solid rgba(0,0,0,0.12)',
|
|
31
|
+
padding: '10px 22px',
|
|
32
|
+
outline: 0,
|
|
33
|
+
overflow: 'auto !important'
|
|
34
|
+
},
|
|
35
|
+
_a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__suggestions")] = {
|
|
36
|
+
padding: '8px 0',
|
|
37
|
+
zIndex: suggestionsZIndex + '!important',
|
|
38
|
+
borderRadius: '4px',
|
|
39
|
+
backgroundColor: '#fafafa !important',
|
|
40
|
+
boxShadow: '0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)',
|
|
41
|
+
transform: 'translateY(-100%)'
|
|
42
|
+
},
|
|
43
|
+
_a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__list")] = {
|
|
44
|
+
maxHeight: '200px',
|
|
45
|
+
overflowY: 'scroll'
|
|
46
|
+
},
|
|
47
|
+
_a["& .".concat(constants_2.MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__item")] = {
|
|
48
|
+
padding: '6px 12px',
|
|
49
|
+
color: theme.palette.text.primary,
|
|
50
|
+
fontSize: '13px',
|
|
51
|
+
transition: theme.transitions.create(['background-color']),
|
|
52
|
+
'&:hover, &--focused': {
|
|
53
|
+
backgroundColor: 'rgba(0,0,0,0.04)'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
_a),
|
|
57
|
+
mention: {
|
|
58
|
+
position: 'relative',
|
|
59
|
+
zIndex: 1,
|
|
60
|
+
color: theme.palette.primary.main,
|
|
61
|
+
textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
|
|
62
|
+
pointerEvents: 'none'
|
|
46
63
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
position: 'relative',
|
|
50
|
-
zIndex: 1,
|
|
51
|
-
color: theme.palette.primary.main,
|
|
52
|
-
textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
|
|
53
|
-
pointerEvents: 'none'
|
|
54
|
-
}
|
|
55
|
-
}); });
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -39,7 +39,7 @@ export var RepliedComment = function (_a) {
|
|
|
39
39
|
var sendMessageArea = (React.createElement(SendMessageArea, { inputRef: inputRef, popperRef: popperRef, uri: uri, onCancel: function () { return updateIsEditingReply(false); }, isEditingReply: isEditing, reply: reply, comment: comment }));
|
|
40
40
|
return (React.createElement(Box, { className: classnames(styles.root, className) },
|
|
41
41
|
React.createElement(Avatar, { classes: { root: styles.avatar } }, createdBy),
|
|
42
|
-
React.createElement(Box, {
|
|
42
|
+
React.createElement(Box, { className: styles.replyArea },
|
|
43
43
|
React.createElement(Box, { className: styles.header },
|
|
44
44
|
React.createElement(Typography, { className: styles.username }, createdBy),
|
|
45
45
|
action === 'resolve' && (React.createElement(Typography, { className: styles.marked }, i18n.text('Marked as resolved'))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "marked">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"header" | "message" | "username" | "root" | "avatar" | "createdAt" | "replyArea" | "marked">;
|
|
@@ -2,5 +2,5 @@ import { MentionsInputProps } from 'react-mentions';
|
|
|
2
2
|
type Props = Omit<MentionsInputProps, 'children' | 'onChange'> & {
|
|
3
3
|
onChange?: (value: string, plainTextValue: string, mentions: string[]) => void;
|
|
4
4
|
};
|
|
5
|
-
export declare const TextFieldWithMentions: ({ onChange, className, ...props }: Props) => JSX.Element;
|
|
5
|
+
export declare const TextFieldWithMentions: ({ onChange, className, value, placeholder, ...props }: Props) => JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -26,9 +26,10 @@ import { uniq } from 'ramda';
|
|
|
26
26
|
import { MentionsInput, Mention } from 'react-mentions';
|
|
27
27
|
import { UsersContext } from '../../../contexts/UsersContext';
|
|
28
28
|
import { useStyles } from './styles';
|
|
29
|
+
import { MENTIONS_TEXTAREA_CLASSNAME } from './constants';
|
|
29
30
|
export var TextFieldWithMentions = function (_a) {
|
|
30
|
-
var onChange = _a.onChange, className = _a.className, props = __rest(_a, ["onChange", "className"]);
|
|
31
|
-
var styles = useStyles();
|
|
31
|
+
var onChange = _a.onChange, className = _a.className, value = _a.value, placeholder = _a.placeholder, props = __rest(_a, ["onChange", "className", "value", "placeholder"]);
|
|
32
|
+
var styles = useStyles({ placeholder: value ? '' : placeholder });
|
|
32
33
|
var users = useContext(UsersContext);
|
|
33
34
|
var handleChange = function (_, value, plainTextValue, mentions) {
|
|
34
35
|
onChange(value, plainTextValue, uniq(mentions.map(function (_a) {
|
|
@@ -36,9 +37,10 @@ export var TextFieldWithMentions = function (_a) {
|
|
|
36
37
|
return display.slice(1);
|
|
37
38
|
})));
|
|
38
39
|
};
|
|
39
|
-
return (React.createElement(
|
|
40
|
-
React.createElement(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
return (React.createElement("div", { className: classnames(styles.root, className) },
|
|
41
|
+
React.createElement(MentionsInput, __assign({}, props, { value: value, placeholder: placeholder, onChange: handleChange, className: classnames(MENTIONS_TEXTAREA_CLASSNAME), suggestionsPortalHost: document.body }),
|
|
42
|
+
React.createElement(Mention, { trigger: "+", data: users.map(function (_a) {
|
|
43
|
+
var username = _a.username;
|
|
44
|
+
return ({ id: username, display: username });
|
|
45
|
+
}), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention }))));
|
|
44
46
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MENTIONS_TEXTAREA_CLASSNAME = "mentionsTextArea";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var MENTIONS_TEXTAREA_CLASSNAME = 'mentionsTextArea';
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
type StylesProps = {
|
|
2
|
+
placeholder?: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const useStyles: (props: StylesProps) => import("@mui/styles").ClassNameMap<"root" | "mention">;
|
|
5
|
+
export {};
|
|
@@ -1,52 +1,62 @@
|
|
|
1
1
|
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import { POPUP_Z_INDEX } from '../../../constants';
|
|
3
|
+
import { MENTIONS_TEXTAREA_CLASSNAME } from './constants';
|
|
3
4
|
var suggestionsZIndex = POPUP_Z_INDEX + 1;
|
|
4
|
-
export var useStyles = makeStyles(function (theme) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
5
|
+
export var useStyles = makeStyles(function (theme) {
|
|
6
|
+
var _a;
|
|
7
|
+
return ({
|
|
8
|
+
root: (_a = {
|
|
9
|
+
backgroundColor: '#fff',
|
|
10
|
+
fontFamily: 'Roboto'
|
|
11
|
+
},
|
|
12
|
+
_a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__control")] = {
|
|
13
|
+
fontSize: '13px'
|
|
14
|
+
},
|
|
15
|
+
_a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__highlighter")] = {
|
|
16
|
+
padding: '10px 22px',
|
|
17
|
+
border: '1px solid transparent !important',
|
|
18
|
+
'&::before': {
|
|
19
|
+
content: function (_a) {
|
|
20
|
+
var placeholder = _a.placeholder;
|
|
21
|
+
return placeholder && "\"".concat(placeholder, "\"");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
_a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__input")] = {
|
|
26
|
+
borderRadius: '2px',
|
|
27
|
+
border: '1px solid rgba(0,0,0,0.12)',
|
|
28
|
+
padding: '10px 22px',
|
|
29
|
+
outline: 0,
|
|
30
|
+
overflow: 'auto !important'
|
|
31
|
+
},
|
|
32
|
+
_a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__suggestions")] = {
|
|
33
|
+
padding: '8px 0',
|
|
34
|
+
zIndex: suggestionsZIndex + '!important',
|
|
35
|
+
borderRadius: '4px',
|
|
36
|
+
backgroundColor: '#fafafa !important',
|
|
37
|
+
boxShadow: '0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)',
|
|
38
|
+
transform: 'translateY(-100%)'
|
|
39
|
+
},
|
|
40
|
+
_a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__list")] = {
|
|
41
|
+
maxHeight: '200px',
|
|
42
|
+
overflowY: 'scroll'
|
|
43
|
+
},
|
|
44
|
+
_a["& .".concat(MENTIONS_TEXTAREA_CLASSNAME, "__suggestions__item")] = {
|
|
45
|
+
padding: '6px 12px',
|
|
46
|
+
color: theme.palette.text.primary,
|
|
47
|
+
fontSize: '13px',
|
|
48
|
+
transition: theme.transitions.create(['background-color']),
|
|
49
|
+
'&:hover, &--focused': {
|
|
50
|
+
backgroundColor: 'rgba(0,0,0,0.04)'
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
_a),
|
|
54
|
+
mention: {
|
|
55
|
+
position: 'relative',
|
|
56
|
+
zIndex: 1,
|
|
57
|
+
color: theme.palette.primary.main,
|
|
58
|
+
textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
|
|
59
|
+
pointerEvents: 'none'
|
|
43
60
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
position: 'relative',
|
|
47
|
-
zIndex: 1,
|
|
48
|
-
color: theme.palette.primary.main,
|
|
49
|
-
textShadow: '1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white',
|
|
50
|
-
pointerEvents: 'none'
|
|
51
|
-
}
|
|
52
|
-
}); });
|
|
61
|
+
});
|
|
62
|
+
});
|