@flozy/editor 3.8.9 → 3.9.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 +55 -45
- package/dist/Editor/CommonEditor.js +8 -69
- package/dist/Editor/DialogWrapper.js +3 -4
- package/dist/Editor/Editor.css +12 -5
- package/dist/Editor/Elements/AI/PopoverAIInput.js +36 -47
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +15 -4
- package/dist/Editor/Elements/AppHeader/AppHeader.js +23 -36
- package/dist/Editor/Elements/Button/EditorButton.js +16 -23
- package/dist/Editor/Elements/Embed/Image.js +14 -15
- package/dist/Editor/Elements/Embed/Video.js +8 -12
- package/dist/Editor/Elements/Emoji/EmojiButton.js +7 -11
- package/dist/Editor/Elements/Emoji/EmojiPicker.js +4 -2
- package/dist/Editor/Elements/Form/Form.js +1 -1
- package/dist/Editor/Elements/Grid/Grid.js +8 -12
- package/dist/Editor/Elements/Grid/GridItem.js +21 -31
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +5 -1
- package/dist/Editor/Elements/SimpleText/index.js +8 -9
- package/dist/Editor/Elements/SimpleText/style.js +0 -37
- package/dist/Editor/Styles/EditorStyles.js +0 -23
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +25 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -1
- package/dist/Editor/Toolbar/PopupTool/index.js +0 -8
- package/dist/Editor/Toolbar/Toolbar.js +0 -7
- package/dist/Editor/Toolbar/toolbarGroups.js +0 -5
- package/dist/Editor/common/Icon.js +2 -9
- package/dist/Editor/common/MentionsPopup/MentionsListCard.js +6 -1
- package/dist/Editor/common/MentionsPopup/index.js +8 -12
- package/dist/Editor/common/Section/index.js +12 -21
- package/dist/Editor/common/Section/styles.js +1 -6
- package/dist/Editor/common/Shorthands/elements.js +0 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +31 -32
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +18 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +14 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +2 -4
- package/dist/Editor/common/StyleBuilder/index.js +2 -2
- package/dist/Editor/common/StyleBuilder/sectionStyle.js +2 -13
- package/dist/Editor/helper/index.js +0 -139
- package/dist/Editor/helper/theme.js +2 -50
- package/dist/Editor/hooks/useMouseMove.js +8 -36
- package/dist/Editor/hooks/withCommon.js +1 -2
- package/dist/Editor/utils/SlateUtilityFunctions.js +3 -23
- package/dist/Editor/utils/draftToSlate.js +1 -1
- package/dist/Editor/utils/events.js +0 -5
- package/dist/Editor/utils/helper.js +0 -29
- package/package.json +2 -5
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -391
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +0 -193
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +0 -23
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +0 -184
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +0 -36
- package/dist/Editor/Elements/FreeGrid/Options/More.js +0 -24
- package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +0 -47
- package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +0 -11
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +0 -75
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -159
- package/dist/Editor/ErrorBoundary.js +0 -30
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +0 -105
- package/dist/Editor/common/RnD/ContextMenu/index.js +0 -38
- package/dist/Editor/common/RnD/ContextMenu/styles.js +0 -21
- package/dist/Editor/common/RnD/DragInfo/index.js +0 -31
- package/dist/Editor/common/RnD/DragInfo/styles.js +0 -15
- package/dist/Editor/common/RnD/DragOver/index.js +0 -46
- package/dist/Editor/common/RnD/DragOver/styles.js +0 -23
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +0 -82
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -26
- package/dist/Editor/common/RnD/ElementOptions/index.js +0 -93
- package/dist/Editor/common/RnD/ElementOptions/styles.js +0 -41
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +0 -153
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +0 -58
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +0 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +0 -30
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +0 -13
- package/dist/Editor/common/RnD/ElementSettings/index.js +0 -17
- package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +0 -14
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -76
- package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +0 -52
- package/dist/Editor/common/RnD/GuideLines/index.js +0 -33
- package/dist/Editor/common/RnD/GuideLines/styles.js +0 -60
- package/dist/Editor/common/RnD/OptionsPopup/index.js +0 -50
- package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -36
- package/dist/Editor/common/RnD/RnDCopy.js +0 -23
- package/dist/Editor/common/RnD/ShadowElement.js +0 -34
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +0 -40
- package/dist/Editor/common/RnD/SwitchViewport/styles.js +0 -24
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +0 -63
- package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +0 -19
- package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +0 -13
- package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +0 -18
- package/dist/Editor/common/RnD/TransformHandles/index.js +0 -62
- package/dist/Editor/common/RnD/Utils/alignmentDetection.js +0 -26
- package/dist/Editor/common/RnD/Utils/calculateDropItem.js +0 -98
- package/dist/Editor/common/RnD/Utils/collisionDetection.js +0 -52
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +0 -148
- package/dist/Editor/common/RnD/Utils/index.js +0 -251
- package/dist/Editor/common/RnD/VirtualElement/index.js +0 -76
- package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -27
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +0 -28
- package/dist/Editor/common/RnD/index.js +0 -503
- package/dist/Editor/common/RnD/styles.js +0 -4
- package/dist/Editor/common/StyleBuilder/boxStyle.js +0 -30
- package/dist/Editor/helper/RnD/focusOnNewItem.js +0 -39
- package/dist/Editor/helper/RnD/scrollToNewSection.js +0 -24
- package/dist/Editor/helper/breakpoint.js +0 -5
- package/dist/Editor/hooks/useBreakpoints.js +0 -34
- package/dist/Editor/hooks/withErrorHandling.js +0 -14
- package/dist/Editor/utils/RnD/RnDCtrlCmds.js +0 -168
- package/dist/Editor/utils/freegrid.js +0 -49
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { Editor, Transforms, Path } from "slate";
|
|
2
|
-
import { ReactEditor } from "slate-react";
|
|
3
1
|
import html2canvas from "html2canvas";
|
|
4
2
|
import { rectIntersection, closestCenter } from "@dnd-kit/core";
|
|
5
3
|
import { getQueryStrings } from "../utils/SlateUtilityFunctions";
|
|
6
4
|
import { Node } from "slate";
|
|
7
5
|
const HIDE_PLACHOLDERS = ["grid", "grid-item", "table"];
|
|
8
6
|
const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar", "mini-tool-wrpr-ei", "element-selector", "element-selector-ctrl"];
|
|
9
|
-
const RND_ITEMS = ["freegridItem", "freegridBox"];
|
|
10
7
|
export const getThumbnailImage = async (dom, options = {}) => {
|
|
11
8
|
try {
|
|
12
9
|
const canvas = await html2canvas(dom, {
|
|
@@ -143,142 +140,6 @@ export const isEmptyTextNode = element => {
|
|
|
143
140
|
return false;
|
|
144
141
|
}
|
|
145
142
|
};
|
|
146
|
-
export const clearSelection = editor => {
|
|
147
|
-
try {
|
|
148
|
-
ReactEditor.focus(editor);
|
|
149
|
-
Transforms.collapse(editor, {
|
|
150
|
-
edge: "start"
|
|
151
|
-
});
|
|
152
|
-
Transforms.deselect(editor);
|
|
153
|
-
} catch (err) {
|
|
154
|
-
console.log(err);
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
export const isSelectionInNodeType = (editor, type) => {
|
|
158
|
-
const {
|
|
159
|
-
selection
|
|
160
|
-
} = editor;
|
|
161
|
-
if (selection) {
|
|
162
|
-
const [match] = Editor.nodes(editor, {
|
|
163
|
-
match: n => n.type === type,
|
|
164
|
-
mode: "lowest" // This ensures that we check the lowest node that matches the type
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
return {
|
|
168
|
-
selected: !!match,
|
|
169
|
-
match
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
selected: false
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
export const getCaretPosition = editor => {
|
|
177
|
-
const {
|
|
178
|
-
selection
|
|
179
|
-
} = editor;
|
|
180
|
-
if (selection) {
|
|
181
|
-
const {
|
|
182
|
-
anchor
|
|
183
|
-
} = selection;
|
|
184
|
-
const {
|
|
185
|
-
path,
|
|
186
|
-
offset
|
|
187
|
-
} = anchor;
|
|
188
|
-
return path && offset ? {
|
|
189
|
-
path,
|
|
190
|
-
offset
|
|
191
|
-
} : null;
|
|
192
|
-
}
|
|
193
|
-
return null;
|
|
194
|
-
};
|
|
195
|
-
export const onPasteRnDNode = (editor, {
|
|
196
|
-
path,
|
|
197
|
-
children,
|
|
198
|
-
slateNodes
|
|
199
|
-
}) => {
|
|
200
|
-
try {
|
|
201
|
-
const cur_root_path = Path.parent(path);
|
|
202
|
-
const parsed_node = slateNodes || JSON.parse(window.copiedNode);
|
|
203
|
-
let new_path = [...path, children.length];
|
|
204
|
-
if (RND_ITEMS.indexOf(parsed_node?.type) > -1) {
|
|
205
|
-
Transforms.insertNodes(editor, [{
|
|
206
|
-
...parsed_node,
|
|
207
|
-
// for differentiate the items
|
|
208
|
-
left: parsed_node?.left + 20,
|
|
209
|
-
marginTop: parsed_node?.marginTop + 20,
|
|
210
|
-
// to maintain unique drop location in different section also
|
|
211
|
-
gridArea: "1 / 1 / 2 / 2"
|
|
212
|
-
}], {
|
|
213
|
-
at: new_path
|
|
214
|
-
});
|
|
215
|
-
} else {
|
|
216
|
-
// for pasting whole section
|
|
217
|
-
new_path = Path.next(cur_root_path);
|
|
218
|
-
Transforms.insertNodes(editor, [{
|
|
219
|
-
...parsed_node
|
|
220
|
-
}], {
|
|
221
|
-
at: new_path
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
return new_path;
|
|
225
|
-
} catch (err) {
|
|
226
|
-
console.log(err);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
export const setSelection = (editor, {
|
|
230
|
-
path
|
|
231
|
-
}) => {
|
|
232
|
-
try {
|
|
233
|
-
ReactEditor.focus(editor);
|
|
234
|
-
const point = {
|
|
235
|
-
path,
|
|
236
|
-
offset: 0
|
|
237
|
-
};
|
|
238
|
-
Transforms.select(editor, {
|
|
239
|
-
anchor: point,
|
|
240
|
-
focus: point
|
|
241
|
-
});
|
|
242
|
-
ReactEditor.focus(editor);
|
|
243
|
-
} catch (err) {
|
|
244
|
-
console.log(err);
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
export const focusSelection = (editor, {
|
|
248
|
-
path
|
|
249
|
-
}) => {
|
|
250
|
-
try {
|
|
251
|
-
ReactEditor.focus(editor);
|
|
252
|
-
const selectedNode = Node.get(editor, path);
|
|
253
|
-
const selectedDOM = ReactEditor.toDOMNode(editor, selectedNode);
|
|
254
|
-
selectedDOM.scrollIntoView({
|
|
255
|
-
behavior: "smooth",
|
|
256
|
-
block: "center"
|
|
257
|
-
});
|
|
258
|
-
} catch (err) {
|
|
259
|
-
console.log(err);
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
export const bringItemToFB = (editor, {
|
|
263
|
-
path,
|
|
264
|
-
moveFront
|
|
265
|
-
}) => {
|
|
266
|
-
try {
|
|
267
|
-
const itemNode = Node.get(editor, path);
|
|
268
|
-
const {
|
|
269
|
-
zIndex
|
|
270
|
-
} = itemNode;
|
|
271
|
-
let arrangeIndex = zIndex === undefined ? path[path.length - 1] : zIndex;
|
|
272
|
-
arrangeIndex = moveFront ? arrangeIndex + 1 : arrangeIndex - 1;
|
|
273
|
-
Transforms.setNodes(editor, {
|
|
274
|
-
zIndex: Math.min(arrangeIndex, editor.children.length)
|
|
275
|
-
}, {
|
|
276
|
-
at: path
|
|
277
|
-
});
|
|
278
|
-
} catch (err) {
|
|
279
|
-
console.log(err);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
143
|
export const debounce = function (func, wait, immediate) {
|
|
283
144
|
let timeout;
|
|
284
145
|
return function () {
|
|
@@ -6,12 +6,6 @@ export const breakpoints = {
|
|
|
6
6
|
};
|
|
7
7
|
export const BREAKPOINTS_DEVICES = ["xs", "sm", "md", "lg"];
|
|
8
8
|
export const getDevice = width => {
|
|
9
|
-
// stimulated environment
|
|
10
|
-
const breakpoint = document.getElementsByClassName("et-wrpr")[0];
|
|
11
|
-
const etDataset = breakpoint?.dataset;
|
|
12
|
-
if (etDataset?.breakpoint) {
|
|
13
|
-
return etDataset?.breakpoint;
|
|
14
|
-
}
|
|
15
9
|
if (width > 0 && width < breakpoints.mobile) {
|
|
16
10
|
return "xs";
|
|
17
11
|
} else {
|
|
@@ -48,7 +42,7 @@ const overrides = {
|
|
|
48
42
|
return `${val?.widthInPercent || 100}%`;
|
|
49
43
|
},
|
|
50
44
|
overrideReSizeH: val => {
|
|
51
|
-
return
|
|
45
|
+
return `${val?.height}px`;
|
|
52
46
|
},
|
|
53
47
|
overrideBorderRadius: val => {
|
|
54
48
|
return `${val?.topLeft}px ${val?.topRight}px ${val?.bottomLeft}px ${val?.bottomRight}px`;
|
|
@@ -104,46 +98,4 @@ export const getTRBLBreakPoints = (value, breakpoint) => {
|
|
|
104
98
|
console.log(err);
|
|
105
99
|
}
|
|
106
100
|
};
|
|
107
|
-
export const
|
|
108
|
-
const {
|
|
109
|
-
value,
|
|
110
|
-
breakpoint,
|
|
111
|
-
ot,
|
|
112
|
-
ov
|
|
113
|
-
} = props;
|
|
114
|
-
const val = getBreakPointsValue(value, breakpoint, ot, ov);
|
|
115
|
-
return val[rbr] || val["lg"];
|
|
116
|
-
};
|
|
117
|
-
const isObject = value => {
|
|
118
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
119
|
-
};
|
|
120
|
-
export const groupByBreakpoint = (styleProps, theme) => {
|
|
121
|
-
const tProps = Object.keys(styleProps);
|
|
122
|
-
const groupedXS = tProps.reduce((a, b) => {
|
|
123
|
-
if (isObject(styleProps[b])) {
|
|
124
|
-
a[b] = styleProps[b]["xs"];
|
|
125
|
-
if (b === "height" && !a[b]) {
|
|
126
|
-
a[b] = "auto";
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
a[b] = styleProps[b];
|
|
130
|
-
}
|
|
131
|
-
return a;
|
|
132
|
-
}, {});
|
|
133
|
-
const groupedLG = tProps.reduce((a, b) => {
|
|
134
|
-
if (isObject(styleProps[b])) {
|
|
135
|
-
a[b] = styleProps[b]["lg"] || styleProps[b];
|
|
136
|
-
} else {
|
|
137
|
-
a[b] = styleProps[b];
|
|
138
|
-
}
|
|
139
|
-
return a;
|
|
140
|
-
}, {});
|
|
141
|
-
return {
|
|
142
|
-
[theme.breakpoints.up("lg")]: {
|
|
143
|
-
...groupedLG
|
|
144
|
-
},
|
|
145
|
-
[theme.breakpoints.between("xs", "md")]: {
|
|
146
|
-
...groupedXS
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
};
|
|
101
|
+
export const getCustomizationValue = value => isNaN(parseInt(value)) ? null : parseInt(value);
|
|
@@ -22,36 +22,16 @@ export const EditorProvider = ({
|
|
|
22
22
|
theme,
|
|
23
23
|
children
|
|
24
24
|
}) => {
|
|
25
|
+
const [event] = useMouseMove();
|
|
25
26
|
const [previous, setPrevious] = useState("");
|
|
26
27
|
const [drop, setDrop] = useState(0);
|
|
27
28
|
const [selectedPath, setSelectedPath] = useState(null);
|
|
28
|
-
const [selectedElement, setSelectedElement] = useState({});
|
|
29
|
-
const [dragging, setDragging] = useState({});
|
|
30
|
-
const [event] = useMouseMove(dragging);
|
|
31
29
|
const path = event?.target?.getAttribute("data-path");
|
|
32
30
|
const [popupType, setPopupType] = useState(""); // opened popup name in the editor will be stored
|
|
33
31
|
const [openAI, setOpenAI] = useState("");
|
|
34
|
-
const [contextMenu, setContextMenu] = useState({
|
|
35
|
-
path: null
|
|
36
|
-
});
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
window.updateSelectedItem = d => {
|
|
39
|
-
setSelectedElement(d);
|
|
40
|
-
};
|
|
41
|
-
}, []);
|
|
42
32
|
const onDrop = () => {
|
|
43
33
|
setDrop(drop + 1);
|
|
44
34
|
};
|
|
45
|
-
const isSelectedElement = path => {
|
|
46
|
-
const cu_path = path.split("|");
|
|
47
|
-
const se_path = selectedElement?.path?.split("|");
|
|
48
|
-
const isParentSelected = se_path?.slice(0, cu_path.length).join("|") === path;
|
|
49
|
-
// check if child or parent is selected
|
|
50
|
-
if (selectedElement?.path === path || isParentSelected) {
|
|
51
|
-
return selectedElement;
|
|
52
|
-
}
|
|
53
|
-
return {};
|
|
54
|
-
};
|
|
55
35
|
const value = useMemo(() => {
|
|
56
36
|
if (path) {
|
|
57
37
|
setPrevious(path);
|
|
@@ -72,15 +52,8 @@ export const EditorProvider = ({
|
|
|
72
52
|
theme: theme,
|
|
73
53
|
selectedPath: selectedPath,
|
|
74
54
|
setSelectedPath: setSelectedPath,
|
|
75
|
-
selectedElement: selectedElement,
|
|
76
|
-
setSelectedElement: setSelectedElement,
|
|
77
|
-
isSelectedElement: isSelectedElement,
|
|
78
|
-
setDragging: setDragging,
|
|
79
|
-
dragging: dragging,
|
|
80
55
|
popupType,
|
|
81
56
|
setPopupType,
|
|
82
|
-
setContextMenu,
|
|
83
|
-
contextMenu,
|
|
84
57
|
openAI,
|
|
85
58
|
setOpenAI
|
|
86
59
|
},
|
|
@@ -90,7 +63,7 @@ export const EditorProvider = ({
|
|
|
90
63
|
export const useEditorContext = () => {
|
|
91
64
|
return useContext(EditorContext);
|
|
92
65
|
};
|
|
93
|
-
const useMouseMove =
|
|
66
|
+
const useMouseMove = () => {
|
|
94
67
|
const [event, setEvent] = useState({
|
|
95
68
|
target: null
|
|
96
69
|
});
|
|
@@ -101,13 +74,12 @@ const useMouseMove = dragging => {
|
|
|
101
74
|
};
|
|
102
75
|
}, []);
|
|
103
76
|
const onMouseMove = e => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
77
|
+
const dpath = e?.target?.closest(".dpath");
|
|
78
|
+
if (dpath) {
|
|
79
|
+
console.log(`Stopped position: (${e.clientX}, ${e.clientY})`, dpath);
|
|
80
|
+
setEvent({
|
|
81
|
+
target: dpath
|
|
82
|
+
});
|
|
111
83
|
}
|
|
112
84
|
};
|
|
113
85
|
const debounceMouseMove = debounce(onMouseMove, 100);
|
|
@@ -7,9 +7,8 @@ import withEquation from "../plugins/withEquation";
|
|
|
7
7
|
import withMentions from "../plugins/withMentions";
|
|
8
8
|
import withLayout from "../plugins/withLayout";
|
|
9
9
|
import withHtml from "../plugins/withHTML";
|
|
10
|
-
import withErrorHandling from "./withErrorHandling";
|
|
11
10
|
import withCustomDeleteBackward from "../plugins/withCustomDeleteBackward";
|
|
12
11
|
const withCommon = (props, rest = {}) => {
|
|
13
|
-
return rest.needLayout ?
|
|
12
|
+
return rest.needLayout ? withHtml(withEquation(withLayout(withHistory(withEmbeds(withTables(withLinks(withMentions(withCustomDeleteBackward(withReact(props)))))))))) : withHtml(withEquation(withHistory(withEmbeds(withTables(withLinks(withMentions(withCustomDeleteBackward(withReact(props)))))))));
|
|
14
13
|
};
|
|
15
14
|
export default withCommon;
|
|
@@ -40,10 +40,6 @@ import insertNewLine from "./insertNewLine";
|
|
|
40
40
|
import Divider from "../Elements/Divider/Divider";
|
|
41
41
|
import { getBorderColor } from "./helper";
|
|
42
42
|
import Code from "../Elements/EmbedScript/Code";
|
|
43
|
-
import FreeGrid from "../Elements/FreeGrid/FreeGrid";
|
|
44
|
-
import FreeGridItem from "../Elements/FreeGrid/FreeGridItem";
|
|
45
|
-
import FreeGridBox from "../Elements/FreeGrid/FreeGridBox";
|
|
46
|
-
import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
|
|
47
43
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
48
44
|
const alignment = ["alignLeft", "alignRight", "alignCenter"];
|
|
49
45
|
const list_types = ["orderedList", "unorderedList"];
|
|
@@ -164,7 +160,7 @@ export const activeMark = (editor, format) => {
|
|
|
164
160
|
return null;
|
|
165
161
|
}
|
|
166
162
|
};
|
|
167
|
-
export const getMarked = (leaf, children
|
|
163
|
+
export const getMarked = (leaf, children) => {
|
|
168
164
|
const className = leaf?.doublequote ? "doublequote" : "";
|
|
169
165
|
if (leaf.bold) {
|
|
170
166
|
children = /*#__PURE__*/_jsx("strong", {
|
|
@@ -222,14 +218,10 @@ export const getMarked = (leaf, children, theme) => {
|
|
|
222
218
|
className: className,
|
|
223
219
|
component: "span",
|
|
224
220
|
sx: {
|
|
225
|
-
|
|
221
|
+
fontSize: {
|
|
226
222
|
lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
|
227
223
|
...getBreakPointsValue(leaf.fontSize, null, "overrideText")
|
|
228
|
-
},
|
|
229
|
-
// fontSize: {
|
|
230
|
-
// lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
|
231
|
-
// ...getBreakPointsValue(leaf.fontSize, null, "overrideText"),
|
|
232
|
-
// },
|
|
224
|
+
},
|
|
233
225
|
...textStyles,
|
|
234
226
|
fontFamily: family,
|
|
235
227
|
fontWeight: leaf.fontWeight
|
|
@@ -415,18 +407,6 @@ export const getBlock = props => {
|
|
|
415
407
|
return /*#__PURE__*/_jsx(Grid, {
|
|
416
408
|
...props
|
|
417
409
|
});
|
|
418
|
-
case "freegrid":
|
|
419
|
-
return /*#__PURE__*/_jsx(FreeGrid, {
|
|
420
|
-
...props
|
|
421
|
-
});
|
|
422
|
-
case "freegridItem":
|
|
423
|
-
return /*#__PURE__*/_jsx(FreeGridItem, {
|
|
424
|
-
...props
|
|
425
|
-
});
|
|
426
|
-
case "freegridBox":
|
|
427
|
-
return /*#__PURE__*/_jsx(FreeGridBox, {
|
|
428
|
-
...props
|
|
429
|
-
});
|
|
430
410
|
case "grid-item":
|
|
431
411
|
return /*#__PURE__*/_jsx(GridItem, {
|
|
432
412
|
...props,
|
|
@@ -3,7 +3,6 @@ import { toggleBlock } from "./SlateUtilityFunctions";
|
|
|
3
3
|
import insertNewLine from "./insertNewLine";
|
|
4
4
|
import { insertAccordion } from "./accordion";
|
|
5
5
|
import { isListItem } from "./helper";
|
|
6
|
-
import RnDCtrlCmds from "./RnD/RnDCtrlCmds";
|
|
7
6
|
import EDITORCMDS from "../common/EditorCmds";
|
|
8
7
|
const HOTKEYS = {
|
|
9
8
|
b: "bold",
|
|
@@ -76,10 +75,6 @@ export const commands = props => {
|
|
|
76
75
|
} else {
|
|
77
76
|
Editor.addMark(editor, HOTKEYS[event.key], true);
|
|
78
77
|
}
|
|
79
|
-
} else if (RnDCtrlCmds[event.key]) {
|
|
80
|
-
RnDCtrlCmds[event.key](event, {
|
|
81
|
-
editor
|
|
82
|
-
});
|
|
83
78
|
} else if (EDITORCMDS[event.key]) {
|
|
84
79
|
EDITORCMDS[event.key](event, {
|
|
85
80
|
editor,
|
|
@@ -398,33 +398,4 @@ export const onDeleteKey = (event, {
|
|
|
398
398
|
} catch (err) {
|
|
399
399
|
console.log(err);
|
|
400
400
|
}
|
|
401
|
-
};
|
|
402
|
-
export const selectText = (editor, {
|
|
403
|
-
path,
|
|
404
|
-
cursorOnly
|
|
405
|
-
}) => {
|
|
406
|
-
try {
|
|
407
|
-
ReactEditor.focus(editor);
|
|
408
|
-
const range = Editor.range(editor, path);
|
|
409
|
-
const textNode = Node.get(editor, path);
|
|
410
|
-
if (!cursorOnly) {
|
|
411
|
-
Transforms.select(editor, range);
|
|
412
|
-
}
|
|
413
|
-
if (cursorOnly && textNode) {
|
|
414
|
-
const textLength = Node.string(textNode).length;
|
|
415
|
-
editor.selection = {
|
|
416
|
-
anchor: {
|
|
417
|
-
path: path,
|
|
418
|
-
offset: textLength
|
|
419
|
-
},
|
|
420
|
-
focus: {
|
|
421
|
-
path: path,
|
|
422
|
-
offset: textLength
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
ReactEditor.focus(editor);
|
|
427
|
-
} catch (err) {
|
|
428
|
-
console.log(err);
|
|
429
|
-
}
|
|
430
401
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flozy/editor",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "An Editor for flozy app brain",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"react-gcolor-picker": "^1.3.1",
|
|
37
37
|
"react-icons": "^4.10.1",
|
|
38
38
|
"react-katex": "^3.0.1",
|
|
39
|
-
"react-rnd": "^10.4.11",
|
|
40
39
|
"react-scripts": "5.0.1",
|
|
41
40
|
"react-signature-canvas": "^1.0.6",
|
|
42
41
|
"react-slick": "^0.29.0",
|
|
@@ -57,7 +56,6 @@
|
|
|
57
56
|
},
|
|
58
57
|
"scripts": {
|
|
59
58
|
"prepare": "husky install .husky",
|
|
60
|
-
"analyze": "source-map-explorer build/static/js/*.js",
|
|
61
59
|
"lint": "./node_modules/.bin/eslint --ignore-path .gitignore .",
|
|
62
60
|
"start": "craco start",
|
|
63
61
|
"build": "NODE_OPTIONS='--max_old_space_size=4096' craco build",
|
|
@@ -66,7 +64,7 @@
|
|
|
66
64
|
"storybook": "NODE_OPTIONS='--max_old_space_size=4096' storybook dev -p 6006",
|
|
67
65
|
"build-storybook": "NODE_OPTIONS='--max_old_space_size=4096' storybook build",
|
|
68
66
|
"publish:npm": "rm -rf dist && mkdir dist && babel src/components -d dist --copy-files",
|
|
69
|
-
"publish:local": "rm -rf /Users/
|
|
67
|
+
"publish:local": "rm -rf /Users/agenciflow08/Documents/flozy/client/node_modules/@flozy/editor/dist && babel src/components -d /Users/agenciflow08/Documents/flozy/client/node_modules/@flozy/editor/dist --copy-files"
|
|
70
68
|
},
|
|
71
69
|
"eslintConfig": {
|
|
72
70
|
"extends": [
|
|
@@ -114,7 +112,6 @@
|
|
|
114
112
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
115
113
|
"eslint-plugin-storybook": "^0.6.13",
|
|
116
114
|
"prop-types": "^15.8.1",
|
|
117
|
-
"source-map-explorer": "^2.5.3",
|
|
118
115
|
"storybook": "^7.4.0",
|
|
119
116
|
"webpack": "^5.88.2"
|
|
120
117
|
},
|