@flozy/editor 9.4.5 → 9.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/ChatEditor.js +10 -4
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
- package/dist/Editor/Elements/DataView/styles.js +13 -0
- package/dist/Editor/common/CustomDialog/styles.js +0 -2
- package/dist/Editor/common/MentionsPopup/Styles.js +0 -6
- package/dist/Editor/common/MentionsPopup/index.js +2 -0
- package/package.json +2 -2
@@ -1,6 +1,6 @@
|
|
1
|
-
import React, { useCallback, useMemo, useRef, useImperativeHandle, forwardRef } from "react";
|
2
|
-
import { Editable, Slate, ReactEditor } from
|
3
|
-
import { createEditor, Transforms, Editor } from
|
1
|
+
import React, { useCallback, useMemo, useRef, useImperativeHandle, forwardRef, useState } from "react";
|
2
|
+
import { Editable, Slate, ReactEditor } from 'slate-react';
|
3
|
+
import { createEditor, Transforms, Editor } from 'slate';
|
4
4
|
import withCommon from "./hooks/withCommon";
|
5
5
|
import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
|
6
6
|
import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
|
@@ -46,6 +46,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
46
46
|
}]
|
47
47
|
});
|
48
48
|
const debouncedValue = useRef(convertedContent);
|
49
|
+
const [isFocused, setIsFocused] = useState(false);
|
49
50
|
const debounced = useDebouncedCallback(
|
50
51
|
// function
|
51
52
|
value => {
|
@@ -268,6 +269,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
268
269
|
strVal,
|
269
270
|
restVal
|
270
271
|
});
|
272
|
+
setIsFocused(false);
|
271
273
|
};
|
272
274
|
const handlePaste = event => {
|
273
275
|
const items = event.clipboardData.items;
|
@@ -280,6 +282,9 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
280
282
|
};
|
281
283
|
|
282
284
|
const html = isMarkDown ? convertMDToHTML(markDownContent) : null;
|
285
|
+
const handleFocus = () => {
|
286
|
+
setIsFocused(true);
|
287
|
+
};
|
283
288
|
return !isMarkDown ? /*#__PURE__*/_jsx(EditorProvider, {
|
284
289
|
theme: theme,
|
285
290
|
editor: editor,
|
@@ -299,11 +304,12 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
299
304
|
decorate: decorators,
|
300
305
|
placeholder: "Start typing ...",
|
301
306
|
spellCheck: true,
|
307
|
+
onFocus: handleFocus,
|
302
308
|
onBlur: handleBlur,
|
303
309
|
onKeyDown: onKeyDown,
|
304
310
|
onPaste: handlePaste,
|
305
311
|
customProps: customProps
|
306
|
-
}), !readOnly ? /*#__PURE__*/_jsx(MentionsPopup, {
|
312
|
+
}), !readOnly && isFocused ? /*#__PURE__*/_jsx(MentionsPopup, {
|
307
313
|
ref: mentionsRef,
|
308
314
|
mentions: mentions,
|
309
315
|
setMentions: setMentions,
|
@@ -14,7 +14,8 @@ const ColumnView = props => {
|
|
14
14
|
property,
|
15
15
|
onSelect,
|
16
16
|
selected,
|
17
|
-
readOnly
|
17
|
+
readOnly,
|
18
|
+
translation
|
18
19
|
} = props;
|
19
20
|
const {
|
20
21
|
type
|
@@ -60,7 +61,8 @@ const ColumnView = props => {
|
|
60
61
|
readOnly: readOnly,
|
61
62
|
settings: {
|
62
63
|
wrapColumn: property?.wrapColumn
|
63
|
-
}
|
64
|
+
},
|
65
|
+
translation: translation
|
64
66
|
}), needAnchor && !readOnly ? /*#__PURE__*/_jsx(Popper, {
|
65
67
|
sx: classes.root,
|
66
68
|
open: open,
|
@@ -22,7 +22,8 @@ const MultiSelectWithPopover = props => {
|
|
22
22
|
onChange,
|
23
23
|
onUpdate,
|
24
24
|
property,
|
25
|
-
wrapColumn = false
|
25
|
+
wrapColumn = false,
|
26
|
+
translation
|
26
27
|
} = props;
|
27
28
|
const [anchorEl, setAnchorEl] = useState(null);
|
28
29
|
const [anchorElOption, setAnchorElOption] = useState(null);
|
@@ -413,7 +414,8 @@ const MultiSelectWithPopover = props => {
|
|
413
414
|
anchorEl: anchorElOption,
|
414
415
|
mode: mode,
|
415
416
|
onClose: onClose,
|
416
|
-
onEvent: onEditOption
|
417
|
+
onEvent: onEditOption,
|
418
|
+
translation: translation
|
417
419
|
}) : null, showSnackBar ? /*#__PURE__*/_jsx(SnackbarAlert, {
|
418
420
|
message: "Option already selected!",
|
419
421
|
setShowSnackBar: setShowSnackBar
|
@@ -10,7 +10,8 @@ const MultiSelectType = props => {
|
|
10
10
|
options,
|
11
11
|
label = "",
|
12
12
|
readOnly,
|
13
|
-
settings
|
13
|
+
settings,
|
14
|
+
translation
|
14
15
|
} = props;
|
15
16
|
const {
|
16
17
|
wrapColumn
|
@@ -51,7 +52,8 @@ const MultiSelectType = props => {
|
|
51
52
|
placeholder: label,
|
52
53
|
disabled: readOnly,
|
53
54
|
property: property,
|
54
|
-
wrapColumn: wrapColumn
|
55
|
+
wrapColumn: wrapColumn,
|
56
|
+
translation: translation
|
55
57
|
});
|
56
58
|
};
|
57
59
|
export default MultiSelectType;
|
@@ -11,7 +11,8 @@ const RenderRow = props => {
|
|
11
11
|
properties,
|
12
12
|
onSelect,
|
13
13
|
selected,
|
14
|
-
readOnly
|
14
|
+
readOnly,
|
15
|
+
translation
|
15
16
|
} = props;
|
16
17
|
const showProperties = properties?.filter(f => f.visible);
|
17
18
|
return showProperties?.map((property, i) => {
|
@@ -22,7 +23,8 @@ const RenderRow = props => {
|
|
22
23
|
property: property,
|
23
24
|
onSelect: onSelect,
|
24
25
|
selected: selected,
|
25
|
-
readOnly: readOnly
|
26
|
+
readOnly: readOnly,
|
27
|
+
translation: translation
|
26
28
|
}, `${property.key}_${i}`);
|
27
29
|
});
|
28
30
|
};
|
@@ -33,7 +35,8 @@ const ViewData = props => {
|
|
33
35
|
customProps
|
34
36
|
} = props;
|
35
37
|
const {
|
36
|
-
readOnly
|
38
|
+
readOnly,
|
39
|
+
translation
|
37
40
|
} = customProps || {};
|
38
41
|
const {
|
39
42
|
properties,
|
@@ -67,7 +70,8 @@ const ViewData = props => {
|
|
67
70
|
properties: properties,
|
68
71
|
onSelect: onSelect,
|
69
72
|
selected: selectedRows?.includes(row?.id),
|
70
|
-
readOnly: readOnly
|
73
|
+
readOnly: readOnly,
|
74
|
+
translation: translation
|
71
75
|
}), /*#__PURE__*/_jsx("td", {}), /*#__PURE__*/_jsx("td", {})]
|
72
76
|
}, i);
|
73
77
|
}), /*#__PURE__*/_jsx("tr", {
|
@@ -69,6 +69,19 @@ const useDataViewStyles = (theme, appTheme) => ({
|
|
69
69
|
opacity: 1
|
70
70
|
}
|
71
71
|
}
|
72
|
+
},
|
73
|
+
"& .fe-tv-type_text": {
|
74
|
+
"& .MuiInputBase-multiline": {
|
75
|
+
height: "auto !important",
|
76
|
+
"&.Mui-focused": {
|
77
|
+
border: 0,
|
78
|
+
outline: 0,
|
79
|
+
"& textarea:focus-visible": {
|
80
|
+
border: 0,
|
81
|
+
borderColor: "none"
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
72
85
|
}
|
73
86
|
},
|
74
87
|
filterView: {
|
@@ -25,7 +25,6 @@ const CustomDialogStyles = theme => ({
|
|
25
25
|
},
|
26
26
|
"& .confirmBtn": {
|
27
27
|
backgroundColor: "#2563EB",
|
28
|
-
padding: "8px 12px",
|
29
28
|
color: "#ffffff",
|
30
29
|
fontWeight: 600,
|
31
30
|
fontSize: "14px",
|
@@ -55,7 +54,6 @@ const CustomDialogStyles = theme => ({
|
|
55
54
|
borderRadius: "8px",
|
56
55
|
textTransform: "math-auto",
|
57
56
|
height: "36px",
|
58
|
-
padding: "0px 12px",
|
59
57
|
minWidth: "90px",
|
60
58
|
backgroundColor: theme?.palette?.editor?.closeButtonBackground,
|
61
59
|
border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder}`,
|
@@ -78,12 +78,6 @@ const usePopupStyles = theme => ({
|
|
78
78
|
"& .orderedListIcon, .bulletedListTextIcon, .checkedListTextIcon, .accordianIconSvgTextFormat": {
|
79
79
|
width: "20px !important"
|
80
80
|
},
|
81
|
-
"&::-webkit-scrollbar-thumb": {
|
82
|
-
background: `none !important`
|
83
|
-
},
|
84
|
-
"&::-webkit-scrollbar-track": {
|
85
|
-
visibility: "hidden"
|
86
|
-
},
|
87
81
|
"&::-webkit-scrollbar-thumb": {
|
88
82
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
89
83
|
},
|
@@ -158,6 +158,8 @@ const MentionsPopup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
158
158
|
sx: classes.root,
|
159
159
|
placement: "bottom-start",
|
160
160
|
className: "cmd-wrapper",
|
161
|
+
onMouseDownCapture: e => e.preventDefault(),
|
162
|
+
onMouseUpCapture: e => e.preventDefault(),
|
161
163
|
children: /*#__PURE__*/_jsx(Paper, {
|
162
164
|
sx: classes.papper,
|
163
165
|
children: chars.map(renderList)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flozy/editor",
|
3
|
-
"version": "9.4.
|
3
|
+
"version": "9.4.7",
|
4
4
|
"description": "An Editor for flozy app brain",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -69,7 +69,7 @@
|
|
69
69
|
"storybook": "storybook dev -p 6006",
|
70
70
|
"build-storybook": "NODE_OPTIONS='--max_old_space_size=4096' storybook build",
|
71
71
|
"publish:npm": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files",
|
72
|
-
"publish:local": "rm -rf /Users/
|
72
|
+
"publish:local": "rm -rf /Users/agenciflow08/Documents/flozyapp/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agenciflow08/Documents/flozyapp/client/node_modules/@flozy/editor/dist --copy-files",
|
73
73
|
"publish:flozy": "./publish-flozy.sh",
|
74
74
|
"publish:flozy2": "./publish-flozy2.sh",
|
75
75
|
"publish:permission": "chmod +x publish-flozy.sh && chmod +x publish-flozy2.sh"
|