@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.
Files changed (21) hide show
  1. package/cjs/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
  2. package/cjs/CollaborationItem/components/RepliedComment/styles.d.ts +1 -1
  3. package/cjs/CollaborationItem/components/RepliedComment/styles.js +3 -0
  4. package/cjs/CollaborationItem/components/SendMessageArea/styles.js +1 -1
  5. package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.d.ts +1 -1
  6. package/cjs/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.js +9 -7
  7. package/cjs/CollaborationItem/components/TextFieldWithMentions/constants.d.ts +1 -0
  8. package/cjs/CollaborationItem/components/TextFieldWithMentions/constants.js +4 -0
  9. package/cjs/CollaborationItem/components/TextFieldWithMentions/styles.d.ts +5 -1
  10. package/cjs/CollaborationItem/components/TextFieldWithMentions/styles.js +58 -48
  11. package/esm/CollaborationItem/components/RepliedComment/RepliedComment.js +1 -1
  12. package/esm/CollaborationItem/components/RepliedComment/styles.d.ts +1 -1
  13. package/esm/CollaborationItem/components/RepliedComment/styles.js +3 -0
  14. package/esm/CollaborationItem/components/SendMessageArea/styles.js +1 -1
  15. package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.d.ts +1 -1
  16. package/esm/CollaborationItem/components/TextFieldWithMentions/TextFieldWithMentions.js +9 -7
  17. package/esm/CollaborationItem/components/TextFieldWithMentions/constants.d.ts +1 -0
  18. package/esm/CollaborationItem/components/TextFieldWithMentions/constants.js +1 -0
  19. package/esm/CollaborationItem/components/TextFieldWithMentions/styles.d.ts +5 -1
  20. package/esm/CollaborationItem/components/TextFieldWithMentions/styles.js +58 -48
  21. 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, { flexGrow: 1 },
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">;
@@ -12,6 +12,9 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
12
12
  avatar: {
13
13
  marginRight: '8px'
14
14
  },
15
+ replyArea: {
16
+ width: 'calc(100% - 60px)'
17
+ },
15
18
  header: {
16
19
  display: 'flex',
17
20
  marginBottom: '8px'
@@ -14,7 +14,7 @@ exports.useStyles = (0, styles_1.makeStyles)({
14
14
  textField: function (_a) {
15
15
  var isEditing = _a.isEditing;
16
16
  return ({
17
- maxWidth: isEditing ? '100%' : 'calc(100% - 40px)'
17
+ width: isEditing ? '100%' : 'calc(100% - 40px)'
18
18
  });
19
19
  },
20
20
  form: {
@@ -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(react_mentions_1.MentionsInput, __assign({}, props, { onChange: handleChange, className: (0, classnames_1.default)(styles.root, className), suggestionsPortalHost: document.body }),
69
- react_1.default.createElement(react_mentions_1.Mention, { trigger: "+", data: users.map(function (_a) {
70
- var username = _a.username;
71
- return ({ id: username, display: username });
72
- }), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention })));
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";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MENTIONS_TEXTAREA_CLASSNAME = void 0;
4
+ exports.MENTIONS_TEXTAREA_CLASSNAME = 'mentionsTextArea';
@@ -1 +1,5 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "mention">;
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) { return ({
8
- root: {
9
- width: '100%',
10
- backgroundColor: '#fff',
11
- fontFamily: 'Roboto',
12
- '&__control': {
13
- fontSize: '13px'
14
- },
15
- '&__highlighter': {
16
- padding: '10px 22px',
17
- border: '1px solid transparent !important'
18
- },
19
- '&__input': {
20
- borderRadius: '2px',
21
- border: '1px solid rgba(0,0,0,0.12)',
22
- padding: '10px 22px',
23
- outline: 0,
24
- overflow: 'auto !important'
25
- },
26
- '&__suggestions': {
27
- padding: '8px 0',
28
- zIndex: suggestionsZIndex + '!important',
29
- borderRadius: '4px',
30
- backgroundColor: '#fafafa !important',
31
- 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)',
32
- transform: 'translateY(-100%)'
33
- },
34
- '&__suggestions__list': {
35
- maxHeight: '200px',
36
- overflowY: 'scroll'
37
- },
38
- '&__suggestions__item': {
39
- padding: '6px 12px',
40
- color: theme.palette.text.primary,
41
- fontSize: '13px',
42
- transition: theme.transitions.create(['background-color']),
43
- '&:hover, &--focused': {
44
- backgroundColor: 'rgba(0,0,0,0.04)'
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
- mention: {
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, { flexGrow: 1 },
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">;
@@ -9,6 +9,9 @@ export var useStyles = makeStyles(function (theme) { return ({
9
9
  avatar: {
10
10
  marginRight: '8px'
11
11
  },
12
+ replyArea: {
13
+ width: 'calc(100% - 60px)'
14
+ },
12
15
  header: {
13
16
  display: 'flex',
14
17
  marginBottom: '8px'
@@ -11,7 +11,7 @@ export var useStyles = makeStyles({
11
11
  textField: function (_a) {
12
12
  var isEditing = _a.isEditing;
13
13
  return ({
14
- maxWidth: isEditing ? '100%' : 'calc(100% - 40px)'
14
+ width: isEditing ? '100%' : 'calc(100% - 40px)'
15
15
  });
16
16
  },
17
17
  form: {
@@ -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(MentionsInput, __assign({}, props, { onChange: handleChange, className: classnames(styles.root, className), suggestionsPortalHost: document.body }),
40
- React.createElement(Mention, { trigger: "+", data: users.map(function (_a) {
41
- var username = _a.username;
42
- return ({ id: username, display: username });
43
- }), displayTransform: function (_, username) { return "+".concat(username); }, appendSpaceOnAdd: true, className: styles.mention })));
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
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "mention">;
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) { return ({
5
- root: {
6
- width: '100%',
7
- backgroundColor: '#fff',
8
- fontFamily: 'Roboto',
9
- '&__control': {
10
- fontSize: '13px'
11
- },
12
- '&__highlighter': {
13
- padding: '10px 22px',
14
- border: '1px solid transparent !important'
15
- },
16
- '&__input': {
17
- borderRadius: '2px',
18
- border: '1px solid rgba(0,0,0,0.12)',
19
- padding: '10px 22px',
20
- outline: 0,
21
- overflow: 'auto !important'
22
- },
23
- '&__suggestions': {
24
- padding: '8px 0',
25
- zIndex: suggestionsZIndex + '!important',
26
- borderRadius: '4px',
27
- backgroundColor: '#fafafa !important',
28
- 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)',
29
- transform: 'translateY(-100%)'
30
- },
31
- '&__suggestions__list': {
32
- maxHeight: '200px',
33
- overflowY: 'scroll'
34
- },
35
- '&__suggestions__item': {
36
- padding: '6px 12px',
37
- color: theme.palette.text.primary,
38
- fontSize: '13px',
39
- transition: theme.transitions.create(['background-color']),
40
- '&:hover, &--focused': {
41
- backgroundColor: 'rgba(0,0,0,0.04)'
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
- mention: {
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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1837",
3
+ "version": "1.4.1838",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",