@flozy/editor 3.8.9 → 3.9.1
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 +175 -168
- package/dist/Editor/DialogWrapper.js +3 -4
- package/dist/Editor/Editor.css +7 -4
- package/dist/Editor/Elements/AI/AIInput.js +17 -18
- package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
- package/dist/Editor/Elements/AI/PopoverAIInput.js +58 -74
- package/dist/Editor/Elements/AI/Styles.js +2 -1
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
- package/dist/Editor/Elements/AI/VoiceToText/index.js +177 -0
- package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
- package/dist/Editor/Elements/AppHeader/AppHeader.js +49 -40
- package/dist/Editor/Elements/Button/EditorButton.js +38 -33
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -17
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +2 -1
- 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/Form/Workflow/FormWorkflow.js +12 -3
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -1
- package/dist/Editor/Elements/Grid/Grid.js +34 -14
- package/dist/Editor/Elements/Grid/GridItem.js +23 -31
- package/dist/Editor/Elements/Link/Link.js +6 -1
- package/dist/Editor/Elements/Link/LinkButton.js +4 -2
- package/dist/Editor/Elements/Link/LinkPopup.js +10 -3
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +8 -4
- package/dist/Editor/Elements/Redo/RedoButton.js +14 -0
- package/dist/Editor/Elements/Signature/SignaturePopup.js +14 -3
- package/dist/Editor/Elements/SimpleText/index.js +8 -9
- package/dist/Editor/Elements/SimpleText/style.js +0 -37
- package/dist/Editor/Elements/Table/Styles.js +23 -1
- package/dist/Editor/Elements/Table/Table.js +2 -1
- package/dist/Editor/Elements/Table/TableCell.js +69 -7
- package/dist/Editor/Elements/TableContextMenu/TableContextMenu.js +1 -0
- package/dist/Editor/Elements/Undo/UndoButton.js +14 -0
- package/dist/Editor/MiniEditor.js +3 -1
- package/dist/Editor/Styles/EditorStyles.js +1 -24
- package/dist/Editor/Toolbar/Basic/index.js +4 -2
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +26 -2
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +29 -18
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +29 -3
- package/dist/Editor/Toolbar/Mini/Options/Options.js +10 -0
- package/dist/Editor/Toolbar/Mini/Styles.js +7 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +4 -11
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +213 -86
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +22 -16
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +52 -8
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -25
- package/dist/Editor/Toolbar/Toolbar.js +0 -7
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -11
- package/dist/Editor/assets/svg/AIIcons.js +153 -1
- package/dist/Editor/assets/svg/AddTemplateIcon.js +13 -10
- package/dist/Editor/assets/svg/RedoIcon.js +27 -0
- package/dist/Editor/assets/svg/SettingsIcon.js +28 -0
- package/dist/Editor/assets/svg/TextIcon.js +8 -5
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/assets/svg/UndoIcon.js +27 -0
- package/dist/Editor/common/ColorPickerButton.js +25 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +94 -0
- package/dist/Editor/common/CustomDialog/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +56 -47
- package/dist/Editor/common/Icon.js +41 -8
- package/dist/Editor/common/LinkSettings/NavComponents.js +5 -2
- package/dist/Editor/common/LinkSettings/index.js +4 -2
- package/dist/Editor/common/LinkSettings/navOptions.js +7 -2
- package/dist/Editor/common/LinkSettings/style.js +11 -8
- 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 +69 -28
- package/dist/Editor/common/Section/styles.js +12 -6
- package/dist/Editor/common/Shorthands/elements.js +54 -12
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +31 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- 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/fieldTypes/textOptions.js +14 -4
- package/dist/Editor/common/StyleBuilder/index.js +1 -1
- package/dist/Editor/common/StyleBuilder/sectionStyle.js +2 -13
- package/dist/Editor/common/iconslist.js +0 -31
- package/dist/Editor/helper/index.js +0 -139
- package/dist/Editor/helper/theme.js +185 -48
- package/dist/Editor/hooks/useEditorTheme.js +139 -0
- package/dist/Editor/hooks/useMouseMove.js +12 -37
- package/dist/Editor/hooks/useWindowMessage.js +10 -7
- package/dist/Editor/hooks/withCommon.js +1 -2
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +290 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +290 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +123 -0
- package/dist/Editor/themeSettings/fonts/index.js +213 -0
- package/dist/Editor/themeSettings/fonts/style.js +44 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +320 -0
- package/dist/Editor/themeSettings/style.js +152 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +356 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +190 -0
- package/dist/Editor/themeSettingsAI/style.js +247 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +163 -47
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/draftToSlate.js +1 -1
- package/dist/Editor/utils/events.js +54 -7
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +31 -31
- package/dist/Editor/utils/table.js +51 -43
- package/package.json +4 -6
- 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,184 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Transforms, Node, Path } from "slate";
|
3
|
-
import { useSlateStatic } from "slate-react";
|
4
|
-
import { ReactEditor } from "slate-react";
|
5
|
-
import { Box, useTheme } from "@mui/material";
|
6
|
-
import RnD from "../../common/RnD";
|
7
|
-
import { onDropItem } from "../../common/RnD/Utils/gridDropItem";
|
8
|
-
import useBreakpoints from "../../hooks/useBreakpoints";
|
9
|
-
import { breakpointValues, formatBreakpointValues } from "./breakpointConstants";
|
10
|
-
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
|
-
import focusOnNewItem from "../../helper/RnD/focusOnNewItem";
|
12
|
-
import { bringItemToFB } from "../../helper";
|
13
|
-
import itemOptions from "./Options/sectionItemOptions";
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
15
|
-
const FreeGridItem = props => {
|
16
|
-
const theme = useTheme();
|
17
|
-
const breakpoint = useBreakpoints(theme);
|
18
|
-
const {
|
19
|
-
element,
|
20
|
-
attributes,
|
21
|
-
children,
|
22
|
-
customProps
|
23
|
-
} = props;
|
24
|
-
const editor = useSlateStatic();
|
25
|
-
const path = ReactEditor.findPath(editor, element);
|
26
|
-
const {
|
27
|
-
readOnly
|
28
|
-
} = customProps;
|
29
|
-
const {
|
30
|
-
updated_at,
|
31
|
-
childType,
|
32
|
-
zIndex
|
33
|
-
} = element;
|
34
|
-
// get values based on breakpoint size
|
35
|
-
const {
|
36
|
-
gridArea,
|
37
|
-
width,
|
38
|
-
height,
|
39
|
-
left,
|
40
|
-
top,
|
41
|
-
marginTop
|
42
|
-
} = breakpointValues(element.type, breakpoint, element);
|
43
|
-
const {
|
44
|
-
setSelectedElement
|
45
|
-
} = useEditorContext();
|
46
|
-
const arrangeIndex = zIndex === undefined ? path[path.length - 1] : zIndex;
|
47
|
-
const onChangeSettings = () => {};
|
48
|
-
const onChange = data => {
|
49
|
-
let updateData = {
|
50
|
-
...data
|
51
|
-
};
|
52
|
-
delete updateData.children;
|
53
|
-
updateData = formatBreakpointValues(element.type, breakpoint, updateData);
|
54
|
-
Transforms.setNodes(editor, {
|
55
|
-
...updateData
|
56
|
-
}, {
|
57
|
-
at: path
|
58
|
-
});
|
59
|
-
};
|
60
|
-
const handleDragEvent = (type, data, cb) => {
|
61
|
-
const toPosition = {
|
62
|
-
left: left + data.lastX,
|
63
|
-
top: top + data.lastY
|
64
|
-
};
|
65
|
-
const {
|
66
|
-
node,
|
67
|
-
...rest
|
68
|
-
} = data;
|
69
|
-
switch (type) {
|
70
|
-
case "stop":
|
71
|
-
const updated_data = onDropItem({
|
72
|
-
editor,
|
73
|
-
fromPosition: {
|
74
|
-
left,
|
75
|
-
top
|
76
|
-
},
|
77
|
-
toPosition,
|
78
|
-
path,
|
79
|
-
ref: node,
|
80
|
-
breakpoint,
|
81
|
-
...rest
|
82
|
-
}, ".freegrid-container");
|
83
|
-
if (cb) {
|
84
|
-
cb(updated_data);
|
85
|
-
}
|
86
|
-
break;
|
87
|
-
default:
|
88
|
-
}
|
89
|
-
};
|
90
|
-
const handleResizeEvent = (type, data, cb) => {
|
91
|
-
switch (type) {
|
92
|
-
case "stop":
|
93
|
-
return;
|
94
|
-
default:
|
95
|
-
}
|
96
|
-
};
|
97
|
-
const onDelete = () => {
|
98
|
-
try {
|
99
|
-
Transforms.removeNodes(editor, {
|
100
|
-
at: path
|
101
|
-
});
|
102
|
-
} catch (err) {
|
103
|
-
console.log(err);
|
104
|
-
}
|
105
|
-
};
|
106
|
-
const handleContextMenuClick = d => {
|
107
|
-
switch (d?.name) {
|
108
|
-
case "bringForward":
|
109
|
-
bringItemToFB(editor, {
|
110
|
-
path,
|
111
|
-
moveFront: true
|
112
|
-
});
|
113
|
-
break;
|
114
|
-
case "bringBackward":
|
115
|
-
bringItemToFB(editor, {
|
116
|
-
path,
|
117
|
-
moveFront: false
|
118
|
-
});
|
119
|
-
break;
|
120
|
-
case "cut":
|
121
|
-
window.copiedNode = JSON.stringify(Node.get(editor, path));
|
122
|
-
onDelete();
|
123
|
-
focusOnNewItem(editor, Path.parent(path), {
|
124
|
-
setSelectedElement
|
125
|
-
});
|
126
|
-
break;
|
127
|
-
case "copy":
|
128
|
-
window.copiedNode = JSON.stringify(Node.get(editor, path));
|
129
|
-
break;
|
130
|
-
case "delete":
|
131
|
-
onDelete();
|
132
|
-
setSelectedElement({});
|
133
|
-
break;
|
134
|
-
default:
|
135
|
-
return;
|
136
|
-
}
|
137
|
-
};
|
138
|
-
const handleActionClick = type => {
|
139
|
-
console.log(type);
|
140
|
-
};
|
141
|
-
return /*#__PURE__*/_jsx(RnD, {
|
142
|
-
id: `freegrid_item_${path.join("|")}_${updated_at}_${breakpoint}`,
|
143
|
-
className: `freegrid-item breakpoint-${breakpoint}`,
|
144
|
-
editor: editor,
|
145
|
-
path: path,
|
146
|
-
actions: itemOptions[childType] || itemOptions?.default,
|
147
|
-
settingsProps: {
|
148
|
-
settings: "freegridItem",
|
149
|
-
onChange: onChangeSettings,
|
150
|
-
customProps
|
151
|
-
},
|
152
|
-
style: {
|
153
|
-
"--left": `${left || 0}px`,
|
154
|
-
"--marginTop": `${marginTop || 0}px`,
|
155
|
-
"--gridArea": `${gridArea}`,
|
156
|
-
"--width": `${width}px`,
|
157
|
-
"--height": `${height}px`,
|
158
|
-
"--zIndex": 100 + arrangeIndex
|
159
|
-
},
|
160
|
-
defaultStyle: {
|
161
|
-
height: `${height}px`,
|
162
|
-
width: `${width}px`
|
163
|
-
},
|
164
|
-
gridArea: gridArea,
|
165
|
-
onChange: onChange,
|
166
|
-
delta: {
|
167
|
-
width,
|
168
|
-
height
|
169
|
-
},
|
170
|
-
handleDragEvent: handleDragEvent,
|
171
|
-
handleResizeEvent: handleResizeEvent,
|
172
|
-
readOnly: readOnly,
|
173
|
-
childType: childType || "",
|
174
|
-
handleContextMenuClick: handleContextMenuClick,
|
175
|
-
handleActionClick: handleActionClick,
|
176
|
-
children: /*#__PURE__*/_jsx(Box, {
|
177
|
-
component: "div",
|
178
|
-
...attributes,
|
179
|
-
className: `fgi_type_${childType}`,
|
180
|
-
children: children
|
181
|
-
})
|
182
|
-
});
|
183
|
-
};
|
184
|
-
export default FreeGridItem;
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Box, List, ListItemButton } from "@mui/material";
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
5
|
-
const AddElement = props => {
|
6
|
-
const {
|
7
|
-
handleClick
|
8
|
-
} = props;
|
9
|
-
return /*#__PURE__*/_jsx(Box, {
|
10
|
-
children: /*#__PURE__*/_jsxs(List, {
|
11
|
-
className: "item-list-wrpr",
|
12
|
-
children: [/*#__PURE__*/_jsx(ListItemButton, {
|
13
|
-
className: "item-wrapper",
|
14
|
-
onClick: handleClick("addText"),
|
15
|
-
children: "Text"
|
16
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
17
|
-
className: "item-wrapper",
|
18
|
-
onClick: handleClick("addButton"),
|
19
|
-
children: "Button"
|
20
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
21
|
-
className: "item-wrapper",
|
22
|
-
onClick: handleClick("addImage"),
|
23
|
-
children: "Image"
|
24
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
25
|
-
className: "item-wrapper",
|
26
|
-
onClick: handleClick("addVideo"),
|
27
|
-
children: "Video"
|
28
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
29
|
-
className: "item-wrapper",
|
30
|
-
onClick: handleClick("addBox"),
|
31
|
-
children: "Box"
|
32
|
-
})]
|
33
|
-
})
|
34
|
-
});
|
35
|
-
};
|
36
|
-
export default AddElement;
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Box, List, ListItemButton } from "@mui/material";
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
5
|
-
const More = props => {
|
6
|
-
const {
|
7
|
-
handleClick
|
8
|
-
} = props;
|
9
|
-
return /*#__PURE__*/_jsx(Box, {
|
10
|
-
children: /*#__PURE__*/_jsxs(List, {
|
11
|
-
className: "item-list-wrpr",
|
12
|
-
children: [/*#__PURE__*/_jsx(ListItemButton, {
|
13
|
-
className: "item-wrapper",
|
14
|
-
onClick: handleClick("addSection"),
|
15
|
-
children: "Add Section"
|
16
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
17
|
-
className: "item-wrapper",
|
18
|
-
onClick: handleClick("duplicateSection"),
|
19
|
-
children: "Duplicate Section"
|
20
|
-
})]
|
21
|
-
})
|
22
|
-
});
|
23
|
-
};
|
24
|
-
export default More;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import { Transforms, Node } from "slate";
|
3
|
-
import { Box } from "@mui/material";
|
4
|
-
import { StyleContent } from "../../../common/StyleBuilder";
|
5
|
-
import sectionStyle from "../../../common/StyleBuilder/sectionStyle";
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
-
const SectionSettings = props => {
|
8
|
-
const {
|
9
|
-
editor,
|
10
|
-
path,
|
11
|
-
classes
|
12
|
-
} = props;
|
13
|
-
const element = Node.get(editor, path);
|
14
|
-
const styleMaps = sectionStyle?.filter(f => !f?.hideOnFGS);
|
15
|
-
const onChange = data => {
|
16
|
-
const updated_props = {
|
17
|
-
...element,
|
18
|
-
...data,
|
19
|
-
field_type: data?.element
|
20
|
-
};
|
21
|
-
delete updated_props.children;
|
22
|
-
Transforms.setNodes(editor, {
|
23
|
-
...updated_props
|
24
|
-
}, {
|
25
|
-
at: path
|
26
|
-
});
|
27
|
-
};
|
28
|
-
const handleClose = () => {
|
29
|
-
console.log("close");
|
30
|
-
};
|
31
|
-
return /*#__PURE__*/_jsx(Box, {
|
32
|
-
component: "div",
|
33
|
-
className: "style-settings-wrpr",
|
34
|
-
sx: classes.sectionSettingsPopper,
|
35
|
-
children: styleMaps?.map((m, i) => {
|
36
|
-
return /*#__PURE__*/_jsx(StyleContent, {
|
37
|
-
renderTabs: sectionStyle,
|
38
|
-
value: m.value,
|
39
|
-
element: element,
|
40
|
-
onChange: onChange,
|
41
|
-
customProps: {},
|
42
|
-
handleClose: handleClose
|
43
|
-
}, `tab_${m.value}_$${i}`);
|
44
|
-
})
|
45
|
-
});
|
46
|
-
};
|
47
|
-
export default SectionSettings;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
const commonOptions = ["drag", "edit", "settings", "close"];
|
2
|
-
const textOptions = ["drag", "edit", "settings", "link", "close"];
|
3
|
-
const buttonOptions = ["drag", "edit", "settings", "link", "close"];
|
4
|
-
const imageOptions = ["drag", "edit", "settings", "link", "close"];
|
5
|
-
const itemOptions = {
|
6
|
-
default: commonOptions,
|
7
|
-
text: textOptions,
|
8
|
-
button: buttonOptions,
|
9
|
-
image: imageOptions
|
10
|
-
};
|
11
|
-
export default itemOptions;
|
@@ -1,75 +0,0 @@
|
|
1
|
-
const breakpointConstants = {
|
2
|
-
freegrid: ["height"],
|
3
|
-
freegridItem: ["left", "top", "marginTop", "width", "height", "gridArea"],
|
4
|
-
freegridBox: ["left", "top", "marginTop", "width", "height", "gridArea"]
|
5
|
-
};
|
6
|
-
export function CssVar(device = "lg", key, props) {
|
7
|
-
const keyTo = `${key}_${device}`;
|
8
|
-
const value = props[keyTo] === undefined ? props[key] : props[keyTo];
|
9
|
-
return value;
|
10
|
-
}
|
11
|
-
export function breakpointValues(type, breakpoint = "lg", props) {
|
12
|
-
try {
|
13
|
-
const breakpointDatas = breakpointConstants[type]?.reduce((a, b) => {
|
14
|
-
const bpKey = `${b}_${breakpoint}`;
|
15
|
-
a[b] = props[bpKey] === undefined ? props[b] : props[bpKey];
|
16
|
-
return a;
|
17
|
-
}, {});
|
18
|
-
return breakpointDatas;
|
19
|
-
} catch (err) {
|
20
|
-
console.log(err);
|
21
|
-
return {};
|
22
|
-
}
|
23
|
-
}
|
24
|
-
export function formatBreakpointValues(type, breakpoint = "lg", data) {
|
25
|
-
try {
|
26
|
-
const bpValues = breakpointConstants[type];
|
27
|
-
if (breakpoint === "lg") {
|
28
|
-
return data;
|
29
|
-
} else {
|
30
|
-
let rtData = {};
|
31
|
-
Object.keys(data).forEach(key => {
|
32
|
-
if (bpValues.indexOf(key) > -1) {
|
33
|
-
rtData[`${key}_${breakpoint}`] = data[key];
|
34
|
-
} else {
|
35
|
-
rtData[key] = data[key];
|
36
|
-
}
|
37
|
-
});
|
38
|
-
return rtData;
|
39
|
-
}
|
40
|
-
} catch (err) {
|
41
|
-
console.log(err);
|
42
|
-
return {};
|
43
|
-
}
|
44
|
-
}
|
45
|
-
export function wrapThemeBreakpoints(sxProp, prop, theme) {
|
46
|
-
try {
|
47
|
-
const formatedSxProp = Object.keys(sxProp).reduce((a, b) => {
|
48
|
-
switch (b) {
|
49
|
-
case "md":
|
50
|
-
a[theme.breakpoints.up("lg")] = {
|
51
|
-
[prop]: sxProp["md"] || sxProp["lg"]
|
52
|
-
};
|
53
|
-
break;
|
54
|
-
case "sm":
|
55
|
-
a[theme.breakpoints.up("lg")] = {
|
56
|
-
[prop]: sxProp["sm"] || sxProp["lg"]
|
57
|
-
};
|
58
|
-
break;
|
59
|
-
case "xs":
|
60
|
-
a[theme.breakpoints.between("xs", "md")] = {
|
61
|
-
[prop]: sxProp["xs"] || sxProp["lg"]
|
62
|
-
};
|
63
|
-
break;
|
64
|
-
default:
|
65
|
-
a[theme.breakpoints.up("lg")] = {
|
66
|
-
[prop]: sxProp["lg"]
|
67
|
-
};
|
68
|
-
}
|
69
|
-
return a;
|
70
|
-
}, {});
|
71
|
-
return formatedSxProp;
|
72
|
-
} catch (err) {
|
73
|
-
console.log(err);
|
74
|
-
}
|
75
|
-
}
|
@@ -1,159 +0,0 @@
|
|
1
|
-
const useFreeGridStyles = ({
|
2
|
-
theme,
|
3
|
-
MAX_DEVICE_WIDTH
|
4
|
-
}) => ({
|
5
|
-
root: {
|
6
|
-
"&.freegrid-container": {
|
7
|
-
display: "grid",
|
8
|
-
gridTemplateColumns: "var(--cols)",
|
9
|
-
gridTemplateRows: "var(--rows)",
|
10
|
-
gridGap: "0px",
|
11
|
-
backgroundColor: "#FFF",
|
12
|
-
padding: "0px",
|
13
|
-
height: "100%",
|
14
|
-
position: "static",
|
15
|
-
overflow: "hidden",
|
16
|
-
"& .freegrid-item, & .freegrid-box-item": {
|
17
|
-
gridArea: "var(--gridArea)",
|
18
|
-
left: "var(--left)",
|
19
|
-
marginTop: "var(--marginTop)",
|
20
|
-
marginLeft: `calc((100% - ${MAX_DEVICE_WIDTH}px) * 0.5)`,
|
21
|
-
zIndex: "var(--zIndex) !important",
|
22
|
-
"&.active-drag": {},
|
23
|
-
"&.inactive-drag": {},
|
24
|
-
"& .editor-blocker": {
|
25
|
-
position: "absolute",
|
26
|
-
left: 0,
|
27
|
-
top: 0,
|
28
|
-
width: "100%",
|
29
|
-
height: "100%",
|
30
|
-
background: "rgba(0,0,0,0)",
|
31
|
-
border: 0,
|
32
|
-
outline: 0
|
33
|
-
},
|
34
|
-
"&.enable-1, &.enable-2": {
|
35
|
-
"&.type_text": {
|
36
|
-
// height: "fit-content !important",
|
37
|
-
}
|
38
|
-
},
|
39
|
-
"&.enable-1:before, &.enable-2:before": {
|
40
|
-
position: "absolute",
|
41
|
-
content: "attr(placeholder)",
|
42
|
-
top: "-22px",
|
43
|
-
left: "-2px",
|
44
|
-
padding: "2px 4px",
|
45
|
-
backgroundColor: "#2563EB",
|
46
|
-
color: "#FFF",
|
47
|
-
fontSize: "12px",
|
48
|
-
borderTopLeftRadius: "2px",
|
49
|
-
borderTopRightRadius: "2px",
|
50
|
-
width: "auto",
|
51
|
-
height: "16px"
|
52
|
-
},
|
53
|
-
"&:hover": {
|
54
|
-
"& .debug-info": {
|
55
|
-
opacity: 1
|
56
|
-
}
|
57
|
-
},
|
58
|
-
"& .debug-info": {
|
59
|
-
position: "absolute",
|
60
|
-
top: "calc(100% + 8px)",
|
61
|
-
pointerEvents: "none",
|
62
|
-
left: 0,
|
63
|
-
background: "rgba(0,0,0,0.2)",
|
64
|
-
color: "red",
|
65
|
-
width: "100%",
|
66
|
-
padding: "6px",
|
67
|
-
opacity: 0
|
68
|
-
},
|
69
|
-
"&.enable-1": {
|
70
|
-
"&.type_text": {
|
71
|
-
"*": {
|
72
|
-
"::selection": {
|
73
|
-
backgroundColor: "transparent !important",
|
74
|
-
color: "inherit !important"
|
75
|
-
}
|
76
|
-
}
|
77
|
-
}
|
78
|
-
},
|
79
|
-
/** for element items */
|
80
|
-
"& .fgi_type_image, & .fgi_type_video": {
|
81
|
-
height: "100%",
|
82
|
-
"& .embed": {
|
83
|
-
height: "100%",
|
84
|
-
"& .embed-image-wrpr, & .embed-video-wrpr-in, & .element-empty-btn": {
|
85
|
-
height: "100%"
|
86
|
-
}
|
87
|
-
}
|
88
|
-
},
|
89
|
-
"& .fgi_type_button": {
|
90
|
-
height: "100%",
|
91
|
-
"& .editor-btn-wrapper": {
|
92
|
-
height: "100%",
|
93
|
-
"& .editor-btn-wrapper-inner": {
|
94
|
-
width: "100%",
|
95
|
-
height: "100%",
|
96
|
-
"& span": {
|
97
|
-
width: "100%",
|
98
|
-
height: "100%"
|
99
|
-
},
|
100
|
-
"& .btn": {
|
101
|
-
width: "100%",
|
102
|
-
height: "100%",
|
103
|
-
"&.textAlign-left": {
|
104
|
-
justifyContent: "start"
|
105
|
-
},
|
106
|
-
"&.textAlign-right": {
|
107
|
-
justifyContent: "end"
|
108
|
-
},
|
109
|
-
"&.textAlign-center": {
|
110
|
-
justifyContent: "center"
|
111
|
-
}
|
112
|
-
}
|
113
|
-
}
|
114
|
-
}
|
115
|
-
},
|
116
|
-
"& .fgi_type_box": {
|
117
|
-
width: "100%",
|
118
|
-
height: "100%"
|
119
|
-
},
|
120
|
-
/** element toolbar hide */
|
121
|
-
"& .element-toolbar": {
|
122
|
-
display: "none"
|
123
|
-
},
|
124
|
-
[theme.breakpoints.between("xs", "md")]: {
|
125
|
-
marginLeft: `calc((100% - 320px) * 0.5)`
|
126
|
-
}
|
127
|
-
}
|
128
|
-
}
|
129
|
-
},
|
130
|
-
sectionPopper: {
|
131
|
-
zIndex: 1200,
|
132
|
-
width: "40px",
|
133
|
-
left: "-40px !important",
|
134
|
-
"& .papper-root": {
|
135
|
-
fontFamily: "sans-serif",
|
136
|
-
background: "#FFF",
|
137
|
-
"& .MuiIconButton-root": {
|
138
|
-
padding: "10px",
|
139
|
-
color: "#000",
|
140
|
-
background: "#FFF",
|
141
|
-
"& svg": {
|
142
|
-
width: "20px",
|
143
|
-
height: "20px"
|
144
|
-
},
|
145
|
-
"&.active,&:hover ": {}
|
146
|
-
}
|
147
|
-
}
|
148
|
-
},
|
149
|
-
sectionSettingsPopper: {
|
150
|
-
"&.style-settings-wrpr": {
|
151
|
-
height: "300px",
|
152
|
-
overflowY: "auto",
|
153
|
-
overflowX: "hidden",
|
154
|
-
padding: "8px 8px 12px 12px",
|
155
|
-
marginBotton: "12px"
|
156
|
-
}
|
157
|
-
}
|
158
|
-
});
|
159
|
-
export default useFreeGridStyles;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React, { Component } from "react";
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
-
class ErrorBoundary extends Component {
|
4
|
-
constructor(props) {
|
5
|
-
super(props);
|
6
|
-
this.state = {
|
7
|
-
hasError: false
|
8
|
-
};
|
9
|
-
}
|
10
|
-
static getDerivedStateFromError(error) {
|
11
|
-
// Update state so the next render will show the fallback UI.
|
12
|
-
return {
|
13
|
-
hasError: true
|
14
|
-
};
|
15
|
-
}
|
16
|
-
componentDidCatch(error, errorInfo) {
|
17
|
-
// You can also log the error to an error reporting service
|
18
|
-
console.error("Error caught in Error Boundary: ", error, errorInfo);
|
19
|
-
}
|
20
|
-
render() {
|
21
|
-
if (this.state.hasError) {
|
22
|
-
// You can render any custom fallback UI
|
23
|
-
return /*#__PURE__*/_jsx("h1", {
|
24
|
-
children: "Something went wrong."
|
25
|
-
});
|
26
|
-
}
|
27
|
-
return this.props.children;
|
28
|
-
}
|
29
|
-
}
|
30
|
-
export default ErrorBoundary;
|
@@ -1,105 +0,0 @@
|
|
1
|
-
import CMDIcon from "@mui/icons-material/KeyboardCommandKey";
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
4
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
5
|
-
const CMenus = {
|
6
|
-
child: [{
|
7
|
-
name: "bringForward",
|
8
|
-
label: "Move to Front",
|
9
|
-
autoClose: false,
|
10
|
-
render: () => {
|
11
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
12
|
-
children: ["Move to Front", " ", /*#__PURE__*/_jsxs("span", {
|
13
|
-
className: "shortcut-help-info",
|
14
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " \u2191"]
|
15
|
-
})]
|
16
|
-
});
|
17
|
-
}
|
18
|
-
}, {
|
19
|
-
name: "bringBackward",
|
20
|
-
label: "Move to Back",
|
21
|
-
autoClose: false,
|
22
|
-
render: () => {
|
23
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
24
|
-
children: ["Move to Back", " ", /*#__PURE__*/_jsxs("span", {
|
25
|
-
className: "shortcut-help-info",
|
26
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " \u2193"]
|
27
|
-
})]
|
28
|
-
});
|
29
|
-
}
|
30
|
-
}, {
|
31
|
-
name: "cut",
|
32
|
-
label: "Cut",
|
33
|
-
render: () => {
|
34
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
35
|
-
children: ["Cut", " ", /*#__PURE__*/_jsxs("span", {
|
36
|
-
className: "shortcut-help-info",
|
37
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " X"]
|
38
|
-
})]
|
39
|
-
});
|
40
|
-
}
|
41
|
-
}, {
|
42
|
-
name: "copy",
|
43
|
-
label: "Copy",
|
44
|
-
render: () => {
|
45
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
46
|
-
children: ["Copy", " ", /*#__PURE__*/_jsxs("span", {
|
47
|
-
className: "shortcut-help-info",
|
48
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " C"]
|
49
|
-
})]
|
50
|
-
});
|
51
|
-
}
|
52
|
-
}, {
|
53
|
-
name: "paste",
|
54
|
-
label: "Paste",
|
55
|
-
render: () => {
|
56
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
57
|
-
children: ["Paste", " ", /*#__PURE__*/_jsxs("span", {
|
58
|
-
className: "shortcut-help-info",
|
59
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " V"]
|
60
|
-
})]
|
61
|
-
});
|
62
|
-
}
|
63
|
-
}, {
|
64
|
-
name: "delete",
|
65
|
-
label: "Delete"
|
66
|
-
}],
|
67
|
-
parent: [{
|
68
|
-
name: "cut",
|
69
|
-
label: "Cut",
|
70
|
-
render: () => {
|
71
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
72
|
-
children: ["Cut", " ", /*#__PURE__*/_jsxs("span", {
|
73
|
-
className: "shortcut-help-info",
|
74
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " X"]
|
75
|
-
})]
|
76
|
-
});
|
77
|
-
}
|
78
|
-
}, {
|
79
|
-
name: "copy",
|
80
|
-
label: "Copy",
|
81
|
-
render: () => {
|
82
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
83
|
-
children: ["Copy", " ", /*#__PURE__*/_jsxs("span", {
|
84
|
-
className: "shortcut-help-info",
|
85
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " C"]
|
86
|
-
})]
|
87
|
-
});
|
88
|
-
}
|
89
|
-
}, {
|
90
|
-
name: "paste",
|
91
|
-
label: "Paste",
|
92
|
-
render: () => {
|
93
|
-
return /*#__PURE__*/_jsxs(_Fragment, {
|
94
|
-
children: ["Paste", " ", /*#__PURE__*/_jsxs("span", {
|
95
|
-
className: "shortcut-help-info",
|
96
|
-
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " V"]
|
97
|
-
})]
|
98
|
-
});
|
99
|
-
}
|
100
|
-
}, {
|
101
|
-
name: "delete",
|
102
|
-
label: "Delete"
|
103
|
-
}]
|
104
|
-
};
|
105
|
-
export default CMenus;
|