@flozy/editor 3.8.9 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,168 +0,0 @@
|
|
1
|
-
import { Editor, Transforms, Node, Path } from "slate";
|
2
|
-
import { isSelectionInNodeType, getCaretPosition, onPasteRnDNode, bringItemToFB } from "../../helper";
|
3
|
-
import focusOnNewItem from "../../helper/RnD/focusOnNewItem";
|
4
|
-
const RND_ITEM_TYPES = ["freegrid", "freegridItem", "freegridBox"];
|
5
|
-
const parsePath = path => path?.split("|").map(m => parseInt(m));
|
6
|
-
const selectAll = (event, {
|
7
|
-
editor
|
8
|
-
}) => {
|
9
|
-
try {
|
10
|
-
const {
|
11
|
-
selected,
|
12
|
-
match
|
13
|
-
} = isSelectionInNodeType(editor, "freegridItem");
|
14
|
-
const sel = getCaretPosition(editor);
|
15
|
-
|
16
|
-
// if not selection prevent the events
|
17
|
-
if (!sel) {
|
18
|
-
event.preventDefault();
|
19
|
-
return;
|
20
|
-
}
|
21
|
-
|
22
|
-
// only prevent default for freegrid item
|
23
|
-
if (selected) {
|
24
|
-
event.preventDefault();
|
25
|
-
const [item, path] = match;
|
26
|
-
switch (item?.childType) {
|
27
|
-
case "text":
|
28
|
-
const range = Editor.range(editor, path);
|
29
|
-
Transforms.select(editor, range);
|
30
|
-
break;
|
31
|
-
default:
|
32
|
-
return null;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
} catch (err) {
|
36
|
-
console.log(err);
|
37
|
-
}
|
38
|
-
};
|
39
|
-
const onCopy = async (event, {
|
40
|
-
editor
|
41
|
-
}) => {
|
42
|
-
try {
|
43
|
-
const {
|
44
|
-
path,
|
45
|
-
enable
|
46
|
-
} = window?.selectedRnDElement || {};
|
47
|
-
// only copy RnD items in Srag enable mode not in edit mode
|
48
|
-
if (path && enable === 1) {
|
49
|
-
let pPath = parsePath(path);
|
50
|
-
let node = Node.get(editor, pPath);
|
51
|
-
const isRnD = RND_ITEM_TYPES.indexOf(node?.type) > -1;
|
52
|
-
if (isRnD) {
|
53
|
-
event.preventDefault();
|
54
|
-
if (node?.type === "freegrid") {
|
55
|
-
node = Node.get(editor, Path.parent(pPath));
|
56
|
-
}
|
57
|
-
const jsonFragment = JSON.stringify(node);
|
58
|
-
window.copiedNode = jsonFragment;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
} catch (err) {
|
62
|
-
console.log(err);
|
63
|
-
}
|
64
|
-
};
|
65
|
-
const onCut = (event, {
|
66
|
-
editor
|
67
|
-
}) => {
|
68
|
-
try {
|
69
|
-
const {
|
70
|
-
path,
|
71
|
-
enable
|
72
|
-
} = window?.selectedRnDElement || {};
|
73
|
-
onCopy(event, {
|
74
|
-
editor
|
75
|
-
});
|
76
|
-
// remove the node
|
77
|
-
if (path && enable === 1) {
|
78
|
-
const pPath = parsePath(path);
|
79
|
-
Transforms.removeNodes(editor, {
|
80
|
-
at: pPath
|
81
|
-
});
|
82
|
-
// change / remove the focus to parent
|
83
|
-
const currentSelectedNode = Node.get(editor, pPath);
|
84
|
-
const sPath = currentSelectedNode?.type !== "freegrid" ? Path.parent(pPath) : pPath;
|
85
|
-
focusOnNewItem(editor, sPath, {
|
86
|
-
setSelectedElement: window.updateSelectedItem
|
87
|
-
});
|
88
|
-
}
|
89
|
-
} catch (err) {
|
90
|
-
console.log(err);
|
91
|
-
}
|
92
|
-
};
|
93
|
-
const onPaste = async (event, {
|
94
|
-
editor
|
95
|
-
}) => {
|
96
|
-
try {
|
97
|
-
const {
|
98
|
-
path,
|
99
|
-
enable
|
100
|
-
} = window?.selectedRnDElement || {};
|
101
|
-
if (path && enable === 1) {
|
102
|
-
event.preventDefault();
|
103
|
-
const pPath = parsePath(path);
|
104
|
-
const currentSelectedNode = Node.get(editor, pPath);
|
105
|
-
let sPath = currentSelectedNode?.type !== "freegrid" ? Path.parent(pPath) : pPath;
|
106
|
-
const sectionNode = Node.get(editor, sPath);
|
107
|
-
const np = onPasteRnDNode(editor, {
|
108
|
-
path: sPath,
|
109
|
-
children: sectionNode?.children,
|
110
|
-
slateNodes: null
|
111
|
-
});
|
112
|
-
if (np && window.updateSelectedItem) {
|
113
|
-
focusOnNewItem(editor, np, {
|
114
|
-
setSelectedElement: window.updateSelectedItem
|
115
|
-
});
|
116
|
-
}
|
117
|
-
}
|
118
|
-
} catch (err) {
|
119
|
-
console.log(err);
|
120
|
-
}
|
121
|
-
};
|
122
|
-
const onBringFront = (event, {
|
123
|
-
editor
|
124
|
-
}) => {
|
125
|
-
try {
|
126
|
-
const {
|
127
|
-
path,
|
128
|
-
enable
|
129
|
-
} = window?.selectedRnDElement || {};
|
130
|
-
if (path && enable === 1) {
|
131
|
-
event.preventDefault();
|
132
|
-
bringItemToFB(editor, {
|
133
|
-
path: parsePath(path),
|
134
|
-
moveFront: true
|
135
|
-
});
|
136
|
-
}
|
137
|
-
} catch (err) {
|
138
|
-
console.log(err);
|
139
|
-
}
|
140
|
-
};
|
141
|
-
const onBringBack = (event, {
|
142
|
-
editor
|
143
|
-
}) => {
|
144
|
-
try {
|
145
|
-
const {
|
146
|
-
path,
|
147
|
-
enable
|
148
|
-
} = window?.selectedRnDElement || {};
|
149
|
-
if (path && enable === 1) {
|
150
|
-
event.preventDefault();
|
151
|
-
bringItemToFB(editor, {
|
152
|
-
path: parsePath(path),
|
153
|
-
moveFront: false
|
154
|
-
});
|
155
|
-
}
|
156
|
-
} catch (err) {
|
157
|
-
console.log(err);
|
158
|
-
}
|
159
|
-
};
|
160
|
-
const RnDCtrlCmds = {
|
161
|
-
ArrowUp: onBringFront,
|
162
|
-
ArrowDown: onBringBack,
|
163
|
-
a: selectAll,
|
164
|
-
c: onCopy,
|
165
|
-
v: onPaste,
|
166
|
-
x: onCut
|
167
|
-
};
|
168
|
-
export default RnDCtrlCmds;
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import { Transforms } from "slate";
|
2
|
-
import insertNewLine from "./insertNewLine";
|
3
|
-
import scrollToNewSection from "../helper/RnD/scrollToNewSection";
|
4
|
-
const Default_text_Node = {
|
5
|
-
type: "paragraph",
|
6
|
-
children: [{
|
7
|
-
text: "Effortless Business Growth"
|
8
|
-
}]
|
9
|
-
};
|
10
|
-
export const insertFreeGridItem = (childType, childTypeNode, extProps = {}, type = "freegridItem") => {
|
11
|
-
return {
|
12
|
-
type: type || "freegridItem",
|
13
|
-
childType: childType || "text",
|
14
|
-
children: [childTypeNode || Default_text_Node],
|
15
|
-
gridArea: "1 / 1 / 2 / 2",
|
16
|
-
height: 300,
|
17
|
-
width: 250,
|
18
|
-
left: 401,
|
19
|
-
top: 0,
|
20
|
-
marginTop: 47,
|
21
|
-
left_xs: 24,
|
22
|
-
top_xs: 24,
|
23
|
-
marginTop_xs: 12,
|
24
|
-
width_xs: 250,
|
25
|
-
height_xs: 300,
|
26
|
-
gridArea_xs: "1 / 1 / 2 / 2",
|
27
|
-
sectionBgColor: "rgb(240, 108, 131)",
|
28
|
-
...(extProps || {})
|
29
|
-
};
|
30
|
-
};
|
31
|
-
export const insertFreeGrid = (editor, path, extProps) => {
|
32
|
-
const items = Array.from(Array(1).keys()).map(() => insertFreeGridItem());
|
33
|
-
const freegridData = [{
|
34
|
-
type: "paragraph",
|
35
|
-
children: [{
|
36
|
-
type: "freegrid",
|
37
|
-
height: 500,
|
38
|
-
gridTemplateRows: "var(--rows)",
|
39
|
-
gridTemplateColumns: "var(--cols)",
|
40
|
-
children: [...items]
|
41
|
-
}]
|
42
|
-
}];
|
43
|
-
const newPath = path ? path : editor?.selection?.anchor?.path;
|
44
|
-
Transforms.insertNodes(editor, freegridData, {
|
45
|
-
at: newPath
|
46
|
-
});
|
47
|
-
scrollToNewSection(editor, newPath, extProps);
|
48
|
-
insertNewLine(editor);
|
49
|
-
};
|