@flozy/editor 1.5.7 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +15 -3
- package/dist/Editor/Elements/Embed/Embed.js +1 -1
- package/dist/Editor/Elements/Form/FormButton.js +2 -2
- package/dist/Editor/Elements/Grid/Grid.js +2 -20
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/chipTextStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/embedImageStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/formButtonStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/formStyle.js +3 -3
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +1 -1
- package/dist/Editor/common/iconslist.js +26 -1
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
|
2
|
-
import { createEditor } from "slate";
|
2
|
+
import { createEditor, Transforms } from "slate";
|
3
3
|
import { Slate, Editable, ReactEditor } from "slate-react";
|
4
4
|
import { DndContext, DragOverlay } from "@dnd-kit/core";
|
5
5
|
import { useDebounce } from "use-debounce";
|
@@ -167,8 +167,20 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
167
167
|
getContent() {
|
168
168
|
return getOnSaveData(deboundedValue);
|
169
169
|
},
|
170
|
-
insertFragments(fragments) {
|
171
|
-
|
170
|
+
insertFragments(fragments, clearAll = false) {
|
171
|
+
if (!clearAll) {
|
172
|
+
editor.insertNode(fragments);
|
173
|
+
} else {
|
174
|
+
// loop delete all
|
175
|
+
editor.children.map(item => {
|
176
|
+
Transforms.delete(editor, {
|
177
|
+
at: [0]
|
178
|
+
});
|
179
|
+
});
|
180
|
+
|
181
|
+
// reset init
|
182
|
+
editor.children = fragments;
|
183
|
+
}
|
172
184
|
},
|
173
185
|
toggleFullscreen() {
|
174
186
|
setFullScreen(!fullScreen);
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { useSlateStatic } from "slate-react";
|
3
3
|
import { IconButton, Tooltip } from "@mui/material";
|
4
|
-
import
|
4
|
+
import { FormIcon } from "../../common/iconslist";
|
5
5
|
import { insertForm } from "../../utils/form";
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
7
|
const FormButton = props => {
|
@@ -14,7 +14,7 @@ const FormButton = props => {
|
|
14
14
|
arrow: true,
|
15
15
|
children: /*#__PURE__*/_jsx(IconButton, {
|
16
16
|
onClick: onClick,
|
17
|
-
children: /*#__PURE__*/_jsx(
|
17
|
+
children: /*#__PURE__*/_jsx(FormIcon, {})
|
18
18
|
})
|
19
19
|
});
|
20
20
|
};
|
@@ -4,7 +4,7 @@ import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
|
|
4
4
|
import { gridItem } from "../../utils/gridItem";
|
5
5
|
import GridPopup from "./GridPopup";
|
6
6
|
import { IconButton, Tooltip } from "@mui/material";
|
7
|
-
import CompressIcon from "@mui/icons-material/Compress";
|
7
|
+
// import CompressIcon from "@mui/icons-material/Compress";
|
8
8
|
import { insertGrid } from "../../utils/grid";
|
9
9
|
import useDragAndDrop from "../../common/useDragAndDrop";
|
10
10
|
import useResize from "../../utils/customHooks/useResize";
|
@@ -257,7 +257,7 @@ const Grid = props => {
|
|
257
257
|
backgroundRepeat: "no-repeat",
|
258
258
|
backgroundSize: "cover"
|
259
259
|
}
|
260
|
-
}),
|
260
|
+
}), !readOnly && /*#__PURE__*/_jsxs("div", {
|
261
261
|
className: `element-selector ${selected ? "selected" : ""}`,
|
262
262
|
contentEditable: false,
|
263
263
|
children: [/*#__PURE__*/_jsx("div", {
|
@@ -294,24 +294,6 @@ const Grid = props => {
|
|
294
294
|
height: resizing ? `${size?.height}px` : elHeight ? `${elHeight}px` : "fit-content"
|
295
295
|
},
|
296
296
|
children: children
|
297
|
-
}), selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
|
298
|
-
onPointerDown: onMouseDown,
|
299
|
-
style: {
|
300
|
-
opacity: 1,
|
301
|
-
background: "#FFF",
|
302
|
-
position: "absolute",
|
303
|
-
left: 0,
|
304
|
-
right: 0,
|
305
|
-
bottom: "-28px",
|
306
|
-
margin: "auto",
|
307
|
-
color: "#FFF",
|
308
|
-
backgroundColor: "#2684ff",
|
309
|
-
width: "42px",
|
310
|
-
height: "42px",
|
311
|
-
zIndex: 1000
|
312
|
-
},
|
313
|
-
className: "",
|
314
|
-
children: /*#__PURE__*/_jsx(CompressIcon, {})
|
315
297
|
})]
|
316
298
|
});
|
317
299
|
};
|
@@ -2,7 +2,7 @@ const accordionTitleBtnStyle = [{
|
|
2
2
|
tab: "Colors",
|
3
3
|
value: "colors",
|
4
4
|
fields: [{
|
5
|
-
label: "Text",
|
5
|
+
label: "Text Color",
|
6
6
|
key: "textColor",
|
7
7
|
type: "color",
|
8
8
|
needPreview: true
|
@@ -11,11 +11,11 @@ const accordionTitleBtnStyle = [{
|
|
11
11
|
key: "btnBg",
|
12
12
|
type: "color"
|
13
13
|
}, {
|
14
|
-
label: "Background",
|
14
|
+
label: "Background Color",
|
15
15
|
key: "bgColor",
|
16
16
|
type: "color"
|
17
17
|
}, {
|
18
|
-
label: "Border",
|
18
|
+
label: "Border Color",
|
19
19
|
key: "borderColor",
|
20
20
|
type: "color"
|
21
21
|
}]
|
@@ -18,16 +18,16 @@ const accordionTitleStyle = [{
|
|
18
18
|
tab: "Colors",
|
19
19
|
value: "colors",
|
20
20
|
fields: [{
|
21
|
-
label: "Text",
|
21
|
+
label: "Text Color",
|
22
22
|
key: "textColor",
|
23
23
|
type: "color",
|
24
24
|
needPreview: true
|
25
25
|
}, {
|
26
|
-
label: "Background",
|
26
|
+
label: "Background Color",
|
27
27
|
key: "bgColor",
|
28
28
|
type: "color"
|
29
29
|
}, {
|
30
|
-
label: "Border",
|
30
|
+
label: "Border Color",
|
31
31
|
key: "borderColor",
|
32
32
|
type: "color"
|
33
33
|
}]
|
@@ -121,16 +121,16 @@ const buttonStyle = [{
|
|
121
121
|
tab: "Colors",
|
122
122
|
value: "colors",
|
123
123
|
fields: [{
|
124
|
-
label: "Text",
|
124
|
+
label: "Text Color",
|
125
125
|
key: "textColor",
|
126
126
|
type: "color",
|
127
127
|
needPreview: true
|
128
128
|
}, {
|
129
|
-
label: "Background",
|
129
|
+
label: "Background Color",
|
130
130
|
key: "bgColor",
|
131
131
|
type: "color"
|
132
132
|
}, {
|
133
|
-
label: "Border",
|
133
|
+
label: "Border Color",
|
134
134
|
key: "borderColor",
|
135
135
|
type: "color"
|
136
136
|
}]
|
@@ -138,16 +138,16 @@ const buttonStyle = [{
|
|
138
138
|
tab: "Hover Colors",
|
139
139
|
value: "hoverColors",
|
140
140
|
fields: [{
|
141
|
-
label: "Text",
|
141
|
+
label: "Hover Text Color",
|
142
142
|
key: "textColorHover",
|
143
143
|
type: "color",
|
144
144
|
needPreview: true
|
145
145
|
}, {
|
146
|
-
label: "Background",
|
146
|
+
label: "Hover Background Color",
|
147
147
|
key: "bgColorHover",
|
148
148
|
type: "color"
|
149
149
|
}, {
|
150
|
-
label: "Border",
|
150
|
+
label: "Hover Border Color",
|
151
151
|
key: "borderColorHover",
|
152
152
|
type: "color"
|
153
153
|
}]
|
@@ -42,16 +42,16 @@ const chipTextStyle = [{
|
|
42
42
|
tab: "Colors",
|
43
43
|
value: "colors",
|
44
44
|
fields: [{
|
45
|
-
label: "Text",
|
45
|
+
label: "Text Color",
|
46
46
|
key: "textColor",
|
47
47
|
type: "color",
|
48
48
|
needPreview: true
|
49
49
|
}, {
|
50
|
-
label: "Background",
|
50
|
+
label: "Background Color",
|
51
51
|
key: "bgColor",
|
52
52
|
type: "color"
|
53
53
|
}, {
|
54
|
-
label: "Border",
|
54
|
+
label: "Border Color",
|
55
55
|
key: "borderColor",
|
56
56
|
type: "color"
|
57
57
|
}]
|
@@ -38,16 +38,16 @@ const embedImageStyle = [{
|
|
38
38
|
tab: "Colors",
|
39
39
|
value: "colors",
|
40
40
|
fields: [{
|
41
|
-
label: "Text",
|
41
|
+
label: "Text Color",
|
42
42
|
key: "textColor",
|
43
43
|
type: "color",
|
44
44
|
needPreview: true
|
45
45
|
}, {
|
46
|
-
label: "Background",
|
46
|
+
label: "Background Color",
|
47
47
|
key: "bgColor",
|
48
48
|
type: "color"
|
49
49
|
}, {
|
50
|
-
label: "Border",
|
50
|
+
label: "Border Color",
|
51
51
|
key: "borderColor",
|
52
52
|
type: "color"
|
53
53
|
}]
|
@@ -69,16 +69,16 @@ const fieldStyle = [{
|
|
69
69
|
tab: "Colors",
|
70
70
|
value: "colors",
|
71
71
|
fields: [{
|
72
|
-
label: "Text",
|
72
|
+
label: "Text Color",
|
73
73
|
key: "textColor",
|
74
74
|
type: "color",
|
75
75
|
needPreview: true
|
76
76
|
}, {
|
77
|
-
label: "Background",
|
77
|
+
label: "Background Color",
|
78
78
|
key: "bgColor",
|
79
79
|
type: "color"
|
80
80
|
}, {
|
81
|
-
label: "Border",
|
81
|
+
label: "Border Color",
|
82
82
|
key: "borderColor",
|
83
83
|
type: "color"
|
84
84
|
}]
|
@@ -72,16 +72,16 @@ const formButtonStyle = [{
|
|
72
72
|
tab: "Colors",
|
73
73
|
value: "colors",
|
74
74
|
fields: [{
|
75
|
-
label: "Text",
|
75
|
+
label: "Text Color",
|
76
76
|
key: "textColor",
|
77
77
|
type: "color",
|
78
78
|
needPreview: true
|
79
79
|
}, {
|
80
|
-
label: "Background",
|
80
|
+
label: "Background Color",
|
81
81
|
key: "bgColor",
|
82
82
|
type: "color"
|
83
83
|
}, {
|
84
|
-
label: "Border",
|
84
|
+
label: "Border Color",
|
85
85
|
key: "borderColor",
|
86
86
|
type: "color"
|
87
87
|
}]
|
@@ -96,16 +96,16 @@ const formStyle = [{
|
|
96
96
|
tab: "Colors",
|
97
97
|
value: "colors",
|
98
98
|
fields: [{
|
99
|
-
label: "Text",
|
99
|
+
label: "Text Color",
|
100
100
|
key: "textColor",
|
101
101
|
type: "color",
|
102
102
|
needPreview: true
|
103
103
|
}, {
|
104
|
-
label: "Background",
|
104
|
+
label: "Background Color",
|
105
105
|
key: "bgColor",
|
106
106
|
type: "color"
|
107
107
|
}, {
|
108
|
-
label: "Border",
|
108
|
+
label: "Border Color",
|
109
109
|
key: "borderColor",
|
110
110
|
type: "color"
|
111
111
|
}]
|
@@ -1381,4 +1381,29 @@ export const GridAddSectionIcon = props => /*#__PURE__*/_jsxs("svg", {
|
|
1381
1381
|
strokeLinecap: "round",
|
1382
1382
|
strokeLinejoin: "round"
|
1383
1383
|
})]
|
1384
|
-
});
|
1384
|
+
});
|
1385
|
+
export const FormIcon = () => {
|
1386
|
+
return /*#__PURE__*/_jsxs("svg", {
|
1387
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1388
|
+
width: "22",
|
1389
|
+
height: "22",
|
1390
|
+
viewBox: "0 0 24 24",
|
1391
|
+
fill: "none",
|
1392
|
+
children: [/*#__PURE__*/_jsx("path", {
|
1393
|
+
d: "M17.6211 9.61914H12.3711C11.9611 9.61914 11.6211 9.27914 11.6211 8.86914C11.6211 8.45914 11.9611 8.11914 12.3711 8.11914H17.6211C18.0311 8.11914 18.3711 8.45914 18.3711 8.86914C18.3711 9.27914 18.0411 9.61914 17.6211 9.61914Z",
|
1394
|
+
fill: "#64748B"
|
1395
|
+
}), /*#__PURE__*/_jsx("path", {
|
1396
|
+
d: "M7.11859 10.3803C6.92859 10.3803 6.73859 10.3103 6.58859 10.1603L5.83859 9.41031C5.54859 9.12031 5.54859 8.64031 5.83859 8.35031C6.12859 8.06031 6.60859 8.06031 6.89859 8.35031L7.11859 8.57031L8.83859 6.85031C9.12859 6.56031 9.60859 6.56031 9.89859 6.85031C10.1886 7.14031 10.1886 7.62031 9.89859 7.91031L7.64859 10.1603C7.50859 10.3003 7.31859 10.3803 7.11859 10.3803Z",
|
1397
|
+
fill: "#64748B"
|
1398
|
+
}), /*#__PURE__*/_jsx("path", {
|
1399
|
+
d: "M17.6211 16.6191H12.3711C11.9611 16.6191 11.6211 16.2791 11.6211 15.8691C11.6211 15.4591 11.9611 15.1191 12.3711 15.1191H17.6211C18.0311 15.1191 18.3711 15.4591 18.3711 15.8691C18.3711 16.2791 18.0411 16.6191 17.6211 16.6191Z",
|
1400
|
+
fill: "#64748B"
|
1401
|
+
}), /*#__PURE__*/_jsx("path", {
|
1402
|
+
d: "M7.11859 17.3803C6.92859 17.3803 6.73859 17.3103 6.58859 17.1603L5.83859 16.4103C5.54859 16.1203 5.54859 15.6403 5.83859 15.3503C6.12859 15.0603 6.60859 15.0603 6.89859 15.3503L7.11859 15.5703L8.83859 13.8503C9.12859 13.5603 9.60859 13.5603 9.89859 13.8503C10.1886 14.1403 10.1886 14.6203 9.89859 14.9103L7.64859 17.1603C7.50859 17.3003 7.31859 17.3803 7.11859 17.3803Z",
|
1403
|
+
fill: "#64748B"
|
1404
|
+
}), /*#__PURE__*/_jsx("path", {
|
1405
|
+
d: "M15 22.75H9C3.57 22.75 1.25 20.43 1.25 15V9C1.25 3.57 3.57 1.25 9 1.25H15C20.43 1.25 22.75 3.57 22.75 9V15C22.75 20.43 20.43 22.75 15 22.75ZM9 2.75C4.39 2.75 2.75 4.39 2.75 9V15C2.75 19.61 4.39 21.25 9 21.25H15C19.61 21.25 21.25 19.61 21.25 15V9C21.25 4.39 19.61 2.75 15 2.75H9Z",
|
1406
|
+
fill: "#64748B"
|
1407
|
+
})]
|
1408
|
+
});
|
1409
|
+
};
|