@flozy/editor 11.0.9 → 11.1.0
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 -11
- package/dist/Editor/CommonEditor.js +14 -66
- package/dist/Editor/Editor.css +8 -3
- package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -11
- package/dist/Editor/Elements/AI/Styles.js +0 -1
- package/dist/Editor/Elements/Accordion/Accordion.js +22 -28
- package/dist/Editor/Elements/Accordion/AccordionButton.js +3 -12
- package/dist/Editor/Elements/Button/EditorButton.js +0 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
- package/dist/Editor/Elements/Embed/Embed.js +2 -1
- package/dist/Editor/Elements/Embed/Image.js +1 -0
- package/dist/Editor/Elements/Form/Form.js +10 -35
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +4 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +3 -3
- package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -3
- package/dist/Editor/Elements/Signature/SignaturePopup.js +6 -24
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
- package/dist/Editor/MiniEditor.js +1 -2
- package/dist/Editor/Styles/EditorStyles.js +1 -5
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +7 -25
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -10
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +3 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +2 -7
- package/dist/Editor/Toolbar/PopupTool/index.js +0 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +4 -8
- package/dist/Editor/common/ColorPickerButton.js +0 -3
- package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -6
- package/dist/Editor/common/MentionsPopup/index.js +1 -9
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +1 -7
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -11
- package/dist/Editor/common/RnD/VirtualElement/helper.js +62 -72
- package/dist/Editor/common/Shorthands/elements.js +4 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +8 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +3 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/Uploader.js +6 -13
- package/dist/Editor/commonStyle.js +15 -30
- package/dist/Editor/helper/index.js +1 -6
- package/dist/Editor/hooks/useMouseMove.js +4 -1
- package/dist/Editor/plugins/withEmbeds.js +0 -11
- package/dist/Editor/plugins/withHTML.js +0 -2
- package/dist/Editor/utils/SlateUtilityFunctions.js +3 -30
- package/dist/Editor/utils/accordion.js +39 -67
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/events.js +89 -94
- package/dist/Editor/utils/helper.js +20 -24
- package/package.json +4 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +0 -115
- package/dist/Editor/helper/textIndeces.js +0 -58
@@ -47,79 +47,69 @@ const getBoxToAutoAlign = (editor, sectionPath) => {
|
|
47
47
|
});
|
48
48
|
return boxData || [];
|
49
49
|
};
|
50
|
+
const handleGridItems = (gridItems, lastRow) => {
|
51
|
+
// to find the previously occupied rows
|
52
|
+
gridItems.forEach(item => {
|
53
|
+
const {
|
54
|
+
gridArea_xs: gridArea,
|
55
|
+
marginTop_xs,
|
56
|
+
height_xs,
|
57
|
+
type
|
58
|
+
} = item;
|
59
|
+
if (type === "paragraph") {
|
60
|
+
// non-freegridItem,
|
61
|
+
// some "paragraph" node is defaulty coming inside in box's children
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
const [startRow] = getGridArea(gridArea);
|
65
|
+
const marginTop = marginTop_xs ? Number(marginTop_xs) : 0;
|
66
|
+
const fullHeight = Number(height_xs) + marginTop;
|
67
|
+
const endRow = startRow + Math.floor(fullHeight / ROW_HEIGHT) + 1;
|
68
|
+
lastRow = Math.max(endRow, lastRow);
|
69
|
+
});
|
70
|
+
return {
|
71
|
+
lastRow
|
72
|
+
};
|
73
|
+
};
|
74
|
+
const handleNonGridItems = (nonGridItems, lastRow, editor, boxPath) => {
|
75
|
+
let containerHeight = (lastRow - 1) * ROW_HEIGHT;
|
76
|
+
let newlyAddedHeight = 0;
|
50
77
|
|
51
|
-
//
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
//
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
// }
|
87
|
-
|
88
|
-
// const startRow = lastRow || 1;
|
89
|
-
|
90
|
-
// const DEFAULT_NEW_ELEMENT_MARGIN_TOP = 12;
|
91
|
-
// let fullHeight = height_xs + DEFAULT_NEW_ELEMENT_MARGIN_TOP;
|
92
|
-
|
93
|
-
// const endRow = startRow + Math.floor(fullHeight / ROW_HEIGHT) + 1;
|
94
|
-
|
95
|
-
// const newGridArea = `${startRow} / 1 / ${startRow + 1} / 2`;
|
96
|
-
|
97
|
-
// const currentElementPath = [...boxPath, itemIndex];
|
98
|
-
|
99
|
-
// Transforms.setNodes(
|
100
|
-
// editor,
|
101
|
-
// {
|
102
|
-
// gridArea_xs: newGridArea,
|
103
|
-
// marginTop_xs: 12,
|
104
|
-
// left_xs: 12,
|
105
|
-
// xs_updatedOn: new Date().getTime(),
|
106
|
-
// },
|
107
|
-
// { at: currentElementPath }
|
108
|
-
// );
|
109
|
-
|
110
|
-
// lastRow = Math.max(endRow, lastRow);
|
111
|
-
|
112
|
-
// containerHeight += fullHeight;
|
113
|
-
// newlyAddedHeight += fullHeight;
|
114
|
-
// });
|
115
|
-
|
116
|
-
// return {
|
117
|
-
// lastRow,
|
118
|
-
// containerHeight,
|
119
|
-
// newlyAddedHeight,
|
120
|
-
// };
|
121
|
-
// };
|
122
|
-
|
78
|
+
//place it on the next rows that are available
|
79
|
+
nonGridItems.forEach((item, index) => {
|
80
|
+
const {
|
81
|
+
height_xs,
|
82
|
+
type,
|
83
|
+
itemIndex
|
84
|
+
} = item;
|
85
|
+
if (type === "paragraph") {
|
86
|
+
// non-freegridItem
|
87
|
+
return;
|
88
|
+
}
|
89
|
+
const startRow = lastRow || 1;
|
90
|
+
const DEFAULT_NEW_ELEMENT_MARGIN_TOP = 12;
|
91
|
+
let fullHeight = height_xs + DEFAULT_NEW_ELEMENT_MARGIN_TOP;
|
92
|
+
const endRow = startRow + Math.floor(fullHeight / ROW_HEIGHT) + 1;
|
93
|
+
const newGridArea = `${startRow} / 1 / ${startRow + 1} / 2`;
|
94
|
+
const currentElementPath = [...boxPath, itemIndex];
|
95
|
+
Transforms.setNodes(editor, {
|
96
|
+
gridArea_xs: newGridArea,
|
97
|
+
marginTop_xs: 12,
|
98
|
+
left_xs: 12,
|
99
|
+
xs_updatedOn: new Date().getTime()
|
100
|
+
}, {
|
101
|
+
at: currentElementPath
|
102
|
+
});
|
103
|
+
lastRow = Math.max(endRow, lastRow);
|
104
|
+
containerHeight += fullHeight;
|
105
|
+
newlyAddedHeight += fullHeight;
|
106
|
+
});
|
107
|
+
return {
|
108
|
+
lastRow,
|
109
|
+
containerHeight,
|
110
|
+
newlyAddedHeight
|
111
|
+
};
|
112
|
+
};
|
123
113
|
const getAncestorFreeGridContainers = (editor, path) => {
|
124
114
|
const containers = [...Editor.nodes(editor, {
|
125
115
|
at: path,
|
@@ -139,8 +139,7 @@ const ELEMENTS_LIST = [{
|
|
139
139
|
icon: /*#__PURE__*/_jsx(Icon, {
|
140
140
|
icon: "orderedList"
|
141
141
|
}),
|
142
|
-
onInsert: editor => toggleBlock(editor, "orderedList", false)
|
143
|
-
hideFor: ["accordion-summary"]
|
142
|
+
onInsert: editor => toggleBlock(editor, "orderedList", false)
|
144
143
|
}, {
|
145
144
|
name: "Bulleted List",
|
146
145
|
desc: "",
|
@@ -149,8 +148,7 @@ const ELEMENTS_LIST = [{
|
|
149
148
|
icon: /*#__PURE__*/_jsx(Icon, {
|
150
149
|
icon: "unorderedList"
|
151
150
|
}),
|
152
|
-
onInsert: editor => toggleBlock(editor, "unorderedList", false)
|
153
|
-
hideFor: ["accordion-summary"]
|
151
|
+
onInsert: editor => toggleBlock(editor, "unorderedList", false)
|
154
152
|
}, {
|
155
153
|
name: "Check List",
|
156
154
|
desc: "",
|
@@ -159,8 +157,7 @@ const ELEMENTS_LIST = [{
|
|
159
157
|
icon: /*#__PURE__*/_jsx(Icon, {
|
160
158
|
icon: "check-list-item"
|
161
159
|
}),
|
162
|
-
onInsert: editor => toggleBlock(editor, "check-list-item", false)
|
163
|
-
hideFor: ["accordion-summary"]
|
160
|
+
onInsert: editor => toggleBlock(editor, "check-list-item", false)
|
164
161
|
}, {
|
165
162
|
name: "Image",
|
166
163
|
desc: "",
|
@@ -297,8 +294,7 @@ const ELEMENTS_LIST = [{
|
|
297
294
|
onInsert: editor => {
|
298
295
|
Transforms.delete(editor, editor.selection); // remove text '/accordion' typed by user
|
299
296
|
insertAccordion(editor);
|
300
|
-
}
|
301
|
-
hideFor: ["unorderedList", "orderedList", "check-list-item"]
|
297
|
+
}
|
302
298
|
}, {
|
303
299
|
name: "Button",
|
304
300
|
group: "Elements",
|
@@ -82,11 +82,6 @@ const BackgroundImage = props => {
|
|
82
82
|
children: translation("REMOVE")
|
83
83
|
}) : /*#__PURE__*/_jsx(Grid, {
|
84
84
|
className: "uploadImageText",
|
85
|
-
sx: {
|
86
|
-
padding: 0,
|
87
|
-
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
88
|
-
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
89
|
-
},
|
90
85
|
children: /*#__PURE__*/_jsxs(Button, {
|
91
86
|
component: "label",
|
92
87
|
variant: "text",
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Box, Card, Checkbox, FormControlLabel, Grid, Tooltip, Typography } from "@mui/material";
|
2
2
|
import React from "react";
|
3
3
|
import Icon from "../../Icon";
|
4
|
-
import { useEditorContext } from "../../../hooks/useMouseMove";
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
7
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -16,17 +15,14 @@ const RenderCard = ({
|
|
16
15
|
}) => {
|
17
16
|
return /*#__PURE__*/_jsx(Card, {
|
18
17
|
sx: {
|
19
|
-
position:
|
20
|
-
padding: "10px"
|
21
|
-
"& .MuiCheckbox-root svg": {
|
22
|
-
fill: "unset !important"
|
23
|
-
}
|
18
|
+
position: 'relative',
|
19
|
+
padding: "10px"
|
24
20
|
},
|
25
21
|
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
26
22
|
control: /*#__PURE__*/_jsx(Checkbox, {
|
27
23
|
sx: {
|
28
24
|
padding: 0,
|
29
|
-
marginTop:
|
25
|
+
marginTop: '3px'
|
30
26
|
},
|
31
27
|
onChange: handleChange,
|
32
28
|
checked: value,
|
@@ -62,10 +58,10 @@ const RenderCard = ({
|
|
62
58
|
})
|
63
59
|
}),
|
64
60
|
sx: {
|
65
|
-
width:
|
66
|
-
display:
|
67
|
-
justifyContent:
|
68
|
-
alignItems:
|
61
|
+
width: '100%',
|
62
|
+
display: 'flex',
|
63
|
+
justifyContent: 'space-between',
|
64
|
+
alignItems: 'flex-start',
|
69
65
|
margin: 0
|
70
66
|
},
|
71
67
|
labelPlacement: "start"
|
@@ -87,9 +83,6 @@ const CardsMapping = props => {
|
|
87
83
|
selectedCard,
|
88
84
|
infoIcon
|
89
85
|
} = data;
|
90
|
-
const {
|
91
|
-
theme
|
92
|
-
} = useEditorContext();
|
93
86
|
const {
|
94
87
|
translation
|
95
88
|
} = customProps;
|
@@ -111,8 +104,7 @@ const CardsMapping = props => {
|
|
111
104
|
sx: {
|
112
105
|
marginBottom: "12px",
|
113
106
|
"& .MuiPaper-root": {
|
114
|
-
|
115
|
-
border: activeCard ? "1px solid #2563EB" : `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
107
|
+
border: activeCard ? "1px solid #2563EB" : "1px solid #C8D8FA",
|
116
108
|
borderRadius: "8px",
|
117
109
|
boxShadow: activeCard ? "0px 4px 16px 0px #2563EB40" : "unset"
|
118
110
|
}
|
@@ -14,6 +14,9 @@ const FontSize = props => {
|
|
14
14
|
elementProps,
|
15
15
|
customProps
|
16
16
|
} = props;
|
17
|
+
const {
|
18
|
+
translation
|
19
|
+
} = customProps;
|
17
20
|
const {
|
18
21
|
key,
|
19
22
|
width
|
@@ -22,9 +25,6 @@ const FontSize = props => {
|
|
22
25
|
const value = useMemo(() => {
|
23
26
|
return val || getElementStyle(editor, elementProps, "font-size");
|
24
27
|
}, [editor, val]);
|
25
|
-
const {
|
26
|
-
translation
|
27
|
-
} = customProps;
|
28
28
|
const handleChange = e => {
|
29
29
|
let inc = parseInt(e.target.value) || 16;
|
30
30
|
inc = inc > 200 ? 200 : inc;
|
@@ -19,7 +19,6 @@ import SelectSwitch from "./selectSwitch";
|
|
19
19
|
import CardsMapping from "./card";
|
20
20
|
import MetaDataMapping from "./metaDataMapping";
|
21
21
|
import LineSpacing from "./lineSpacing";
|
22
|
-
import EmbedUpload from "./embedUpload";
|
23
22
|
const FieldMap = {
|
24
23
|
text: Text,
|
25
24
|
bannerSpacing: BannerSpacing,
|
@@ -41,7 +40,6 @@ const FieldMap = {
|
|
41
40
|
selectSwitch: SelectSwitch,
|
42
41
|
card: CardsMapping,
|
43
42
|
metadatamapping: MetaDataMapping,
|
44
|
-
lineSpacing: LineSpacing
|
45
|
-
embedUpload: EmbedUpload
|
43
|
+
lineSpacing: LineSpacing
|
46
44
|
};
|
47
45
|
export default FieldMap;
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import React, { useRef, useState } from "react";
|
2
|
-
import Grid from
|
3
|
-
import Button from
|
4
|
-
import Typography from
|
5
|
-
import Box from
|
6
|
-
import CircularProgress from
|
2
|
+
import Grid from '@mui/material/Grid';
|
3
|
+
import Button from '@mui/material/Button';
|
4
|
+
import Typography from '@mui/material/Typography';
|
5
|
+
import Box from '@mui/material/Box';
|
6
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
7
7
|
import { convertBase64 } from "../utils/helper";
|
8
8
|
import Icon from "./Icon";
|
9
9
|
import UploadStyles from "../common/ImageSelector/UploadStyles";
|
10
|
-
import { allowedTypes, extensionMap } from "../Elements/Form/Workflow/constant";
|
10
|
+
import { allowedFormat, allowedTypes, extensionMap } from "../Elements/Form/Workflow/constant";
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
12
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -24,12 +24,6 @@ const Uploader = props => {
|
|
24
24
|
const classes = UploadStyles();
|
25
25
|
const [base64, setBase64] = useState(value?.url);
|
26
26
|
const [fileName, setFileName] = useState("");
|
27
|
-
const allowedFormat = {
|
28
|
-
Document: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf",
|
29
|
-
Image: "image/*",
|
30
|
-
Video: "video/*",
|
31
|
-
Embed: "*"
|
32
|
-
};
|
33
27
|
const {
|
34
28
|
uploadFile,
|
35
29
|
services,
|
@@ -122,7 +116,6 @@ const Uploader = props => {
|
|
122
116
|
const renderThumb = () => {
|
123
117
|
switch (title) {
|
124
118
|
case "Document":
|
125
|
-
case "Video":
|
126
119
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
127
120
|
children: [/*#__PURE__*/_jsx(Typography, {
|
128
121
|
style: {
|
@@ -49,12 +49,6 @@ const useCommonStyle = theme => ({
|
|
49
49
|
fontWeight: "500",
|
50
50
|
fontFamily: "Inter, sans-serif"
|
51
51
|
},
|
52
|
-
"& .MuiPaper-root": {
|
53
|
-
border: `unset !important`,
|
54
|
-
borderRadius: "0px",
|
55
|
-
height: "fit-content",
|
56
|
-
padding: "2px"
|
57
|
-
},
|
58
52
|
"& p": {
|
59
53
|
marginBottom: "7px",
|
60
54
|
marginTop: "4px"
|
@@ -71,6 +65,9 @@ const useCommonStyle = theme => ({
|
|
71
65
|
},
|
72
66
|
"&::-webkit-scrollbar-thumb": {
|
73
67
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
68
|
+
},
|
69
|
+
"&::-webkit-scrollbar-track": {
|
70
|
+
visibility: "hidden"
|
74
71
|
}
|
75
72
|
},
|
76
73
|
"& .MuiGrid-root>.MuiGrid-item": {
|
@@ -565,18 +562,6 @@ const useCommonStyle = theme => ({
|
|
565
562
|
}
|
566
563
|
}
|
567
564
|
},
|
568
|
-
buttonMoreOption: {
|
569
|
-
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
570
|
-
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
571
|
-
padding: "4px !important",
|
572
|
-
"& svg": {
|
573
|
-
width: "18px !important",
|
574
|
-
height: "18px !important",
|
575
|
-
"& path": {
|
576
|
-
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
577
|
-
}
|
578
|
-
}
|
579
|
-
},
|
580
565
|
pageSettingPopUpRoot: {
|
581
566
|
padding: "16px 8px 16px 10px!important",
|
582
567
|
height: "100%",
|
@@ -604,18 +589,18 @@ const useCommonStyle = theme => ({
|
|
604
589
|
right: -40,
|
605
590
|
transform: "translateY(-50%)"
|
606
591
|
},
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
592
|
+
buttonMoreOption: {
|
593
|
+
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
594
|
+
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
595
|
+
padding: "4px !important",
|
596
|
+
"& svg": {
|
597
|
+
width: "18px !important",
|
598
|
+
height: "18px !important",
|
599
|
+
"& path": {
|
600
|
+
stroke: `${theme?.palette?.editor?.closeButtonSvgStroke} !important`
|
601
|
+
}
|
602
|
+
}
|
603
|
+
},
|
619
604
|
buttonMoreOption2: {
|
620
605
|
background: `${theme?.palette?.editor?.aiInputBackground} !important`,
|
621
606
|
border: `1px solid ${theme?.palette?.editor?.buttonBorder1} !important`,
|
@@ -14,7 +14,7 @@ export const getThumbnailImage = async (dom, options = {}) => {
|
|
14
14
|
windowWidth: 1440,
|
15
15
|
windowHeight: 768,
|
16
16
|
...options,
|
17
|
-
backgroundColor:
|
17
|
+
backgroundColor: null,
|
18
18
|
allowTaint: true,
|
19
19
|
useCORS: false,
|
20
20
|
scale: 0.5,
|
@@ -23,11 +23,6 @@ export const getThumbnailImage = async (dom, options = {}) => {
|
|
23
23
|
// hide class
|
24
24
|
const sw = document.getElementById("slate-wrapper-scroll-container");
|
25
25
|
sw.style.minHeight = "2000px";
|
26
|
-
if (options?.fromBrains) {
|
27
|
-
const textbox = document.querySelector(".innert-editor-textbox");
|
28
|
-
textbox.style.padding = "24px";
|
29
|
-
textbox.style.background = options?.pageColor || '#fffff';
|
30
|
-
}
|
31
26
|
const svgFrames = document.querySelectorAll(".image-frame svg");
|
32
27
|
for (let i = 0; i < svgFrames.length; i++) {
|
33
28
|
svgFrames[i].style.width = "100%";
|
@@ -39,6 +39,7 @@ export const EditorProvider = ({
|
|
39
39
|
path: null
|
40
40
|
});
|
41
41
|
const [fontFamilies, setFontFamilies] = useState(defaultFontFamilies);
|
42
|
+
const [activeBreakPoint, setActiveBreakPoint] = useState("");
|
42
43
|
useEffect(() => {
|
43
44
|
window.updateSelectedItem = d => {
|
44
45
|
setSelectedElement(d);
|
@@ -104,8 +105,10 @@ export const EditorProvider = ({
|
|
104
105
|
setFontFamilies,
|
105
106
|
openTheme,
|
106
107
|
setOpenTheme,
|
108
|
+
activeBreakPoint,
|
109
|
+
setActiveBreakPoint,
|
107
110
|
triggerRender
|
108
|
-
}), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop, openTheme]);
|
111
|
+
}), [path, editor?.selection, selectedPath, selectedElement, contextMenu, openAI, popupType, drop, openTheme, activeBreakPoint]);
|
109
112
|
return /*#__PURE__*/_jsx(EditorContext.Provider, {
|
110
113
|
value: otherValues,
|
111
114
|
children: children
|
@@ -1,6 +1,4 @@
|
|
1
1
|
import { Transforms, Path, Node } from "slate";
|
2
|
-
import { isListItem } from "../utils/helper";
|
3
|
-
import { customizeEnterEvent } from "../utils/events";
|
4
2
|
const AvoidCopying = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree", "blockquote"];
|
5
3
|
const BlockTypes = ["grid"];
|
6
4
|
const withEmbeds = editor => {
|
@@ -55,15 +53,6 @@ const withEmbeds = editor => {
|
|
55
53
|
};
|
56
54
|
editor.insertBreak = (...args) => {
|
57
55
|
try {
|
58
|
-
const ele = isListItem(editor);
|
59
|
-
if (ele && ele[0]) {
|
60
|
-
const {
|
61
|
-
breakNext
|
62
|
-
} = customizeEnterEvent(editor, ele);
|
63
|
-
if (breakNext) {
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
}
|
67
56
|
const parentPath = Path.parent(editor.selection.focus.path);
|
68
57
|
const parentNode = Node.get(editor, parentPath);
|
69
58
|
if (editor.isVoid(parentNode)) {
|
@@ -31,8 +31,6 @@ const parseCopiedHTML = html => {
|
|
31
31
|
|
32
32
|
// claude.ai, copy list inbetween, some li tags are not wrapped with ul or ol
|
33
33
|
parsed.querySelectorAll("li").forEach(li => {
|
34
|
-
li.innerHTML = li.innerHTML.replace(/^\n+|\n+$/g, ""); // Removes leading and trailing newlines
|
35
|
-
|
36
34
|
// Check if the parent of <li> is not a <ul> or <ol>
|
37
35
|
if (!li.parentElement || li.parentElement.tagName !== "UL" && li.parentElement.tagName !== "OL") {
|
38
36
|
// Create a <ul> element
|
@@ -34,7 +34,7 @@ import SimpleText from "../Elements/SimpleText";
|
|
34
34
|
import CheckList from "../Elements/List/CheckList";
|
35
35
|
import { getTextColor, isEmptyTextNode } from "../helper";
|
36
36
|
import Attachments from "../Elements/Attachments/Attachments";
|
37
|
-
import { getBreakpointLineSpacing, getBreakPointsValue, getDevice,
|
37
|
+
import { getBreakpointLineSpacing, getBreakPointsValue, getDevice, textThemeFields, getElementProperty } from "../helper/theme";
|
38
38
|
import Variables from "../Elements/Variables/Variable";
|
39
39
|
import Divider from "../Elements/Divider/Divider";
|
40
40
|
import { getBorderColor, getSlateDom } from "./helper";
|
@@ -50,7 +50,7 @@ import SearchAttachment from "../Elements/Search/SearchAttachment";
|
|
50
50
|
import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
|
51
51
|
import { jsx as _jsx } from "react/jsx-runtime";
|
52
52
|
const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
|
53
|
-
|
53
|
+
const list_types = ["orderedList", "unorderedList"];
|
54
54
|
const LIST_FORMAT_TYPE = {
|
55
55
|
orderedList: "list-item",
|
56
56
|
unorderedList: "list-item"
|
@@ -67,7 +67,7 @@ const LIST_FORMAT_TYPE = {
|
|
67
67
|
|
68
68
|
const THEME_BLOCK_FIELDS = ["headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree"];
|
69
69
|
export const toggleBlock = (editor, format, selection = true, attr = {}) => {
|
70
|
-
|
70
|
+
const isActive = isBlockActive(editor, format);
|
71
71
|
const isList = list_types.includes(format);
|
72
72
|
const isIndent = alignment.includes(format);
|
73
73
|
const isAligned = alignment.some(alignmentType => isBlockActive(editor, alignmentType));
|
@@ -202,33 +202,6 @@ export const isBlockActive = (editor, format) => {
|
|
202
202
|
});
|
203
203
|
return !!match;
|
204
204
|
};
|
205
|
-
export const isListActive = editor => {
|
206
|
-
const list_types = ["orderedList", "unorderedList", "check-list-item", "accordion"];
|
207
|
-
const [match] = Editor.nodes(editor, {
|
208
|
-
match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && list_types.includes(n.type),
|
209
|
-
mode: "lowest" // To ensure it's the closest parent
|
210
|
-
});
|
211
|
-
|
212
|
-
if (match) {
|
213
|
-
const [matchNode] = match;
|
214
|
-
return matchNode.type;
|
215
|
-
}
|
216
|
-
};
|
217
|
-
export const getListType = editor => {
|
218
|
-
const [accordionSummary] = Editor.nodes(editor, {
|
219
|
-
match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === "accordion-summary"
|
220
|
-
});
|
221
|
-
if (accordionSummary) {
|
222
|
-
return "accordion-summary";
|
223
|
-
}
|
224
|
-
const listItems = ["list-item", "check-list-item"];
|
225
|
-
const [listItem] = Editor.nodes(editor, {
|
226
|
-
match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && listItems.includes(n.type)
|
227
|
-
});
|
228
|
-
if (listItem) {
|
229
|
-
return "list-item";
|
230
|
-
}
|
231
|
-
};
|
232
205
|
export const getBlockActive = (editor, format) => {
|
233
206
|
const [match] = Editor.nodes(editor, {
|
234
207
|
match: n => !Editor.isEditor(n) && SlateElement.isElement(n) && n.type === format
|