@flozy/editor 4.0.3 → 4.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +85 -13
- package/dist/Editor/DialogWrapper.js +4 -3
- package/dist/Editor/Editor.css +28 -2
- package/dist/Editor/Elements/AI/AIInput.js +31 -33
- package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
- package/dist/Editor/Elements/AI/PopoverAIInput.js +124 -133
- package/dist/Editor/Elements/AI/Styles.js +2 -2
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
- package/dist/Editor/Elements/AI/VoiceToText/index.js +184 -0
- package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
- package/dist/Editor/Elements/AI/helper.js +5 -3
- package/dist/Editor/Elements/AppHeader/AppHeader.js +36 -23
- package/dist/Editor/Elements/Button/EditorButton.js +23 -16
- package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +1 -1
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -0
- package/dist/Editor/Elements/Embed/Image.js +15 -14
- package/dist/Editor/Elements/Embed/Video.js +12 -8
- package/dist/Editor/Elements/Emoji/EmojiButton.js +11 -7
- package/dist/Editor/Elements/Form/Form.js +43 -27
- package/dist/Editor/Elements/Form/FormField.js +21 -10
- package/dist/Editor/Elements/Form/Workflow/index.js +5 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +437 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +206 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +23 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +236 -0
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +44 -0
- package/dist/Editor/Elements/FreeGrid/Options/More.js +24 -0
- package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +47 -0
- package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +19 -0
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +75 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +214 -0
- package/dist/Editor/Elements/Grid/Grid.js +12 -8
- package/dist/Editor/Elements/Grid/GridItem.js +31 -21
- package/dist/Editor/Elements/Link/LinkPopup.js +69 -13
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
- package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -2
- package/dist/Editor/Elements/Signature/Signature.css +13 -6
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +2 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +186 -31
- package/dist/Editor/Elements/SimpleText/index.js +19 -7
- package/dist/Editor/Elements/SimpleText/style.js +44 -1
- package/dist/Editor/ErrorBoundary.js +30 -0
- package/dist/Editor/Styles/EditorStyles.js +28 -0
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +1 -1
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -2
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +33 -5
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +12 -13
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +12 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +3 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +59 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +107 -40
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +57 -61
- package/dist/Editor/Toolbar/PopupTool/index.js +13 -3
- package/dist/Editor/Toolbar/Toolbar.js +7 -0
- package/dist/Editor/Toolbar/toolbarGroups.js +15 -5
- package/dist/Editor/assets/svg/AIIcons.js +153 -1
- package/dist/Editor/common/EditorCmds.js +0 -3
- package/dist/Editor/common/EditorIcons.js +7 -7
- package/dist/Editor/common/Icon.js +39 -30
- package/dist/Editor/common/ImageList.js +16 -3
- package/dist/Editor/common/ImageSelector/ImageSelector.js +30 -9
- package/dist/Editor/common/ImageSelector/Styles.js +2 -1
- package/dist/Editor/common/LinkSettings/index.js +2 -1
- package/dist/Editor/common/LinkSettings/style.js +11 -8
- package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
- package/dist/Editor/common/MentionsPopup/index.js +12 -8
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +142 -0
- package/dist/Editor/common/RnD/ContextMenu/index.js +38 -0
- package/dist/Editor/common/RnD/ContextMenu/styles.js +21 -0
- package/dist/Editor/common/RnD/DragInfo/index.js +31 -0
- package/dist/Editor/common/RnD/DragInfo/styles.js +15 -0
- package/dist/Editor/common/RnD/DragOver/index.js +55 -0
- package/dist/Editor/common/RnD/DragOver/styles.js +23 -0
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +102 -0
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +26 -0
- package/dist/Editor/common/RnD/ElementOptions/index.js +95 -0
- package/dist/Editor/common/RnD/ElementOptions/styles.js +41 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +153 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +36 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +60 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +9 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +48 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +30 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +17 -0
- package/dist/Editor/common/RnD/ElementSettings/index.js +17 -0
- package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +18 -0
- package/dist/Editor/common/RnD/ElementSettings/styles.js +94 -0
- package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +52 -0
- package/dist/Editor/common/RnD/GuideLines/index.js +33 -0
- package/dist/Editor/common/RnD/GuideLines/styles.js +62 -0
- package/dist/Editor/common/RnD/OptionsPopup/index.js +50 -0
- package/dist/Editor/common/RnD/OptionsPopup/style.js +36 -0
- package/dist/Editor/common/RnD/RnDCopy.js +23 -0
- package/dist/Editor/common/RnD/ShadowElement.js +34 -0
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +40 -0
- package/dist/Editor/common/RnD/SwitchViewport/styles.js +24 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +63 -0
- package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +19 -0
- package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +13 -0
- package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +20 -0
- package/dist/Editor/common/RnD/TransformHandles/index.js +67 -0
- package/dist/Editor/common/RnD/Utils/alignmentDetection.js +26 -0
- package/dist/Editor/common/RnD/Utils/calculateDropItem.js +98 -0
- package/dist/Editor/common/RnD/Utils/collisionDetection.js +52 -0
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +181 -0
- package/dist/Editor/common/RnD/Utils/index.js +251 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +77 -0
- package/dist/Editor/common/RnD/VirtualElement/styles.js +27 -0
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +28 -0
- package/dist/Editor/common/RnD/index.js +567 -0
- package/dist/Editor/common/RnD/styles.js +4 -0
- package/dist/Editor/common/Section/index.js +21 -12
- package/dist/Editor/common/Section/styles.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +21 -9
- package/dist/Editor/common/StyleBuilder/boxStyle.js +30 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +18 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +18 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -2
- package/dist/Editor/common/StyleBuilder/index.js +6 -4
- package/dist/Editor/common/StyleBuilder/sectionStyle.js +13 -2
- package/dist/Editor/common/iconListV2.js +843 -0
- package/dist/Editor/commonStyle.js +6 -0
- package/dist/Editor/helper/RnD/focusOnNewItem.js +39 -0
- package/dist/Editor/helper/RnD/scrollToNewSection.js +24 -0
- package/dist/Editor/helper/breakpoint.js +5 -0
- package/dist/Editor/helper/index.js +139 -0
- package/dist/Editor/helper/theme.js +50 -1
- package/dist/Editor/hooks/useBreakpoints.js +34 -0
- package/dist/Editor/hooks/useMouseMove.js +36 -8
- package/dist/Editor/hooks/useWindowMessage.js +10 -7
- package/dist/Editor/hooks/withCommon.js +2 -1
- package/dist/Editor/hooks/withErrorHandling.js +14 -0
- package/dist/Editor/utils/RnD/RnDCtrlCmds.js +197 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +36 -4
- package/dist/Editor/utils/events.js +5 -0
- package/dist/Editor/utils/form.js +7 -2
- package/dist/Editor/utils/formfield.js +1 -1
- package/dist/Editor/utils/freegrid.js +91 -0
- package/dist/Editor/utils/helper.js +43 -0
- package/dist/Editor/utils/insertAppHeader.js +47 -40
- package/package.json +6 -2
@@ -1,17 +1,18 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { MdFormatQuote, MdFormatAlignLeft, MdFormatAlignCenter, MdFormatAlignRight,
|
3
|
-
import { BsTypeH1, BsTypeH2, BsTypeH3, BsCameraVideoFill, BsArrowBarRight, BsArrowBarLeft,
|
2
|
+
import { MdFormatQuote, MdFormatAlignLeft, MdFormatAlignCenter, MdFormatAlignRight, MdAdd, MdArrowForward, MdOutlinePermMedia, MdFormatAlignJustify } from "react-icons/md";
|
3
|
+
import { BsTypeH1, BsTypeH2, BsTypeH3, BsCameraVideoFill, BsArrowBarRight, BsArrowBarLeft, BsCodeSlash } from "react-icons/bs";
|
4
4
|
import { FaSuperscript, FaSubscript } from "react-icons/fa";
|
5
5
|
import { FcAddRow, FcAddColumn } from "react-icons/fc";
|
6
6
|
import { AiFillEdit, AiOutlineInsertRowBelow, AiOutlineInsertRowRight, AiOutlineDelete, AiFillTag, AiOutlineUpload, AiOutlineArrowsAlt, AiOutlineInsertRowAbove, AiOutlineInsertRowLeft, AiFillHtml5 } from "react-icons/ai";
|
7
7
|
import { SiLatex } from "react-icons/si";
|
8
8
|
import { RiDeleteColumn, RiDeleteRow } from "react-icons/ri";
|
9
|
-
import {
|
10
|
-
import {
|
9
|
+
import { CiGrid32 } from "react-icons/ci";
|
10
|
+
import { FontFamilyIcon, FontSizeIcon, StrikethroughIcon, AppHeader, MoreHorizontal, UploadImage, LeftArrow, RightArrow, CheckListButton, CheckListButtonActive, ExcelIcon, CsvIcon, CloseIcon, SearchIcon, ExpandIcon, CalendarIconNew, Text, TextAreaIcon, Phone, BriefCase, Bank, CalendarTick, DollarSquare, Checkbox, Description, RadioButtonIcon, CheckedIcon, UncheckedIcon, InfinityIcon, ResetIcon } from "./iconslist";
|
11
11
|
import ArrowRightIcon from "@mui/icons-material/ArrowRight";
|
12
12
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
13
|
-
import EmailRoundedIcon from
|
14
|
-
import InfoOutlinedIcon from
|
13
|
+
import EmailRoundedIcon from "@mui/icons-material/EmailRounded";
|
14
|
+
import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
|
15
|
+
import { AccordionTextFormatIcon, BoldTextFormatIcon, BulletedListTextFormatIcon, ButtonElementIcon, CarouselElementIcon, CheckListTextFormatIcon, ColorBoxElementIcon, DividerElementIcon, DocUploadElementIcon, EmbedElementIcon, EmojiElementIcon, FormElementIcon, GridElementIcon, ImageElementIcon, ItalicTextFormatIcon, LinkIconV2, OrderedListTextFormatIcon, SignatureElementIcon, TableElementIcon, TopBannerElementIcon, UnderlineTextFormatIcon, VideoElementIcon } from "./iconListV2";
|
15
16
|
import SettingsIcon from "../assets/svg/SettingsIcon";
|
16
17
|
import UndoIcon from "../assets/svg/UndoIcon";
|
17
18
|
import RedoIcon from "../assets/svg/RedoIcon";
|
@@ -28,11 +29,11 @@ const iconList = {
|
|
28
29
|
size: 20
|
29
30
|
}),
|
30
31
|
// bold: <MdFormatBold size={20} />,
|
31
|
-
bold: /*#__PURE__*/_jsx(
|
32
|
+
bold: /*#__PURE__*/_jsx(BoldTextFormatIcon, {
|
32
33
|
size: 20
|
33
34
|
}),
|
34
35
|
// italic: <MdFormatItalic size={20} />,
|
35
|
-
italic: /*#__PURE__*/_jsx(
|
36
|
+
italic: /*#__PURE__*/_jsx(ItalicTextFormatIcon, {
|
36
37
|
size: 20
|
37
38
|
}),
|
38
39
|
// strikethrough: <MdStrikethroughS size={20} />,
|
@@ -40,7 +41,7 @@ const iconList = {
|
|
40
41
|
size: 20
|
41
42
|
}),
|
42
43
|
// underline: <MdFormatUnderlined size={20} />,
|
43
|
-
underline: /*#__PURE__*/_jsx(
|
44
|
+
underline: /*#__PURE__*/_jsx(UnderlineTextFormatIcon, {
|
44
45
|
size: 20
|
45
46
|
}),
|
46
47
|
headingOne: /*#__PURE__*/_jsx(BsTypeH1, {
|
@@ -83,31 +84,33 @@ const iconList = {
|
|
83
84
|
size: 18,
|
84
85
|
fill: "#64748B"
|
85
86
|
}),
|
86
|
-
|
87
|
+
alignJustify: /*#__PURE__*/_jsx(MdFormatAlignJustify, {
|
87
88
|
size: 18,
|
88
89
|
fill: "#64748B"
|
89
90
|
}),
|
90
|
-
|
91
|
+
orderedList: /*#__PURE__*/_jsx(OrderedListTextFormatIcon, {
|
92
|
+
size: 18,
|
93
|
+
fill: "#64748B"
|
94
|
+
}),
|
95
|
+
unorderedList: /*#__PURE__*/_jsx(BulletedListTextFormatIcon, {
|
91
96
|
size: 18,
|
92
97
|
fill: "#64748B"
|
93
98
|
}),
|
94
99
|
// link: <MdInsertLink size={20} />,
|
95
|
-
link: /*#__PURE__*/_jsx(
|
100
|
+
link: /*#__PURE__*/_jsx(LinkIconV2, {
|
96
101
|
size: 20
|
97
102
|
}),
|
98
103
|
// image: <MdImage size={20} />,
|
99
|
-
image: /*#__PURE__*/_jsx(
|
104
|
+
image: /*#__PURE__*/_jsx(ImageElementIcon, {
|
100
105
|
size: 20
|
101
106
|
}),
|
102
107
|
// video: <MdVideoLibrary size={20} />,
|
103
|
-
video: /*#__PURE__*/_jsx(
|
104
|
-
size: 20
|
105
|
-
}),
|
108
|
+
video: /*#__PURE__*/_jsx(VideoElementIcon, {}),
|
106
109
|
add: /*#__PURE__*/_jsx(MdAdd, {
|
107
110
|
size: 20
|
108
111
|
}),
|
109
112
|
// table: <AiOutlineTable size={20} />,
|
110
|
-
table: /*#__PURE__*/_jsx(
|
113
|
+
table: /*#__PURE__*/_jsx(TableElementIcon, {
|
111
114
|
size: 20
|
112
115
|
}),
|
113
116
|
insertRowBelow: /*#__PURE__*/_jsx(AiOutlineInsertRowBelow, {
|
@@ -149,16 +152,16 @@ const iconList = {
|
|
149
152
|
pen: /*#__PURE__*/_jsx(AiFillEdit, {
|
150
153
|
size: 20
|
151
154
|
}),
|
152
|
-
emoji: /*#__PURE__*/_jsx(
|
155
|
+
emoji: /*#__PURE__*/_jsx(EmojiElementIcon, {
|
153
156
|
size: 20,
|
154
157
|
fill: "#64748B"
|
155
158
|
}),
|
156
|
-
grid: /*#__PURE__*/_jsx(
|
157
|
-
accordion: /*#__PURE__*/_jsx(
|
158
|
-
signature: /*#__PURE__*/_jsx(
|
159
|
-
button: /*#__PURE__*/_jsx(
|
160
|
-
carousel: /*#__PURE__*/_jsx(
|
161
|
-
form: /*#__PURE__*/_jsx(
|
159
|
+
grid: /*#__PURE__*/_jsx(GridElementIcon, {}),
|
160
|
+
accordion: /*#__PURE__*/_jsx(AccordionTextFormatIcon, {}),
|
161
|
+
signature: /*#__PURE__*/_jsx(SignatureElementIcon, {}),
|
162
|
+
button: /*#__PURE__*/_jsx(ButtonElementIcon, {}),
|
163
|
+
carousel: /*#__PURE__*/_jsx(CarouselElementIcon, {}),
|
164
|
+
form: /*#__PURE__*/_jsx(FormElementIcon, {}),
|
162
165
|
tableCellResizeLeft: /*#__PURE__*/_jsx(BsArrowBarRight, {
|
163
166
|
size: 20
|
164
167
|
}),
|
@@ -177,11 +180,11 @@ const iconList = {
|
|
177
180
|
addRow: /*#__PURE__*/_jsx(FcAddRow, {
|
178
181
|
size: 20
|
179
182
|
}),
|
180
|
-
"check-list-item": /*#__PURE__*/_jsx(
|
183
|
+
"check-list-item": /*#__PURE__*/_jsx(CheckListTextFormatIcon, {
|
181
184
|
size: 20
|
182
185
|
}),
|
183
|
-
embed: /*#__PURE__*/_jsx(
|
184
|
-
topbanner: /*#__PURE__*/_jsx(
|
186
|
+
embed: /*#__PURE__*/_jsx(EmbedElementIcon, {}),
|
187
|
+
topbanner: /*#__PURE__*/_jsx(TopBannerElementIcon, {
|
185
188
|
size: 20,
|
186
189
|
fill: "#64748B"
|
187
190
|
}),
|
@@ -197,8 +200,8 @@ const iconList = {
|
|
197
200
|
}),
|
198
201
|
appHeader: /*#__PURE__*/_jsx(AppHeader, {}),
|
199
202
|
moreHorizantal: /*#__PURE__*/_jsx(MoreHorizontal, {}),
|
200
|
-
docsUpload: /*#__PURE__*/_jsx(
|
201
|
-
colorbox: /*#__PURE__*/_jsx(
|
203
|
+
docsUpload: /*#__PURE__*/_jsx(DocUploadElementIcon, {}),
|
204
|
+
colorbox: /*#__PURE__*/_jsx(ColorBoxElementIcon, {
|
202
205
|
style: {
|
203
206
|
fill: "#64748B"
|
204
207
|
},
|
@@ -210,7 +213,7 @@ const iconList = {
|
|
210
213
|
checkListButtonActive: /*#__PURE__*/_jsx(CheckListButtonActive, {}),
|
211
214
|
excelIcon: /*#__PURE__*/_jsx(ExcelIcon, {}),
|
212
215
|
csvIcon: /*#__PURE__*/_jsx(CsvIcon, {}),
|
213
|
-
divider: /*#__PURE__*/_jsx(
|
216
|
+
divider: /*#__PURE__*/_jsx(DividerElementIcon, {}),
|
214
217
|
SearchIcon: /*#__PURE__*/_jsx(SearchIcon, {}),
|
215
218
|
expandIcon: /*#__PURE__*/_jsx(ExpandIcon, {}),
|
216
219
|
closeIcon: /*#__PURE__*/_jsx(CloseIcon, {}),
|
@@ -221,6 +224,12 @@ const iconList = {
|
|
221
224
|
}
|
222
225
|
}),
|
223
226
|
calenderNewIcon: /*#__PURE__*/_jsx(CalendarIconNew, {}),
|
227
|
+
freegrid: /*#__PURE__*/_jsx(CiGrid32, {
|
228
|
+
size: 20,
|
229
|
+
style: {
|
230
|
+
fill: "#64748B"
|
231
|
+
}
|
232
|
+
}),
|
224
233
|
text: /*#__PURE__*/_jsx(Text, {}),
|
225
234
|
textArea: /*#__PURE__*/_jsx(TextAreaIcon, {}),
|
226
235
|
phone: /*#__PURE__*/_jsx(Phone, {}),
|
@@ -45,16 +45,29 @@ const QuiltedImageList = props => {
|
|
45
45
|
}, `img_upload_btn`) : null, (itemData || []).map(item => {
|
46
46
|
const isSelected = (selected || []).find(f => f.img === item.img);
|
47
47
|
return /*#__PURE__*/_jsxs(ImageListItem, {
|
48
|
+
// cols={item.cols || 1}
|
49
|
+
// rows={item.rows || 1}
|
50
|
+
sx: {
|
51
|
+
padding: "2px",
|
52
|
+
overflow: "hidden"
|
53
|
+
// position: "relative",
|
54
|
+
},
|
48
55
|
children: [/*#__PURE__*/_jsx("img", {
|
49
56
|
...srcset(item.img, rowHeight || 121, item.rows, item.cols),
|
50
57
|
alt: item.title,
|
51
|
-
loading: "lazy"
|
58
|
+
loading: "lazy",
|
59
|
+
style: {
|
60
|
+
width: "100%",
|
61
|
+
height: "145px",
|
62
|
+
borderRadius: "12px"
|
63
|
+
// display: "block",
|
64
|
+
}
|
52
65
|
}), !readOnly ? /*#__PURE__*/_jsx(ImageListItemBar, {
|
53
66
|
sx: {
|
54
67
|
background: "none"
|
55
68
|
},
|
56
|
-
position: "
|
57
|
-
actionPosition: "
|
69
|
+
position: "start",
|
70
|
+
actionPosition: "right",
|
58
71
|
actionIcon: /*#__PURE__*/_jsx(IconButton, {
|
59
72
|
onClick: onImageSelect(item, !isSelected),
|
60
73
|
children: /*#__PURE__*/_jsx(CheckCircleIcon, {
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
|
-
import { Button, Grid, Tab, Tabs, Dialog, DialogContent, DialogActions, DialogTitle, Typography, Divider } from "@mui/material";
|
2
|
+
import { Button, Grid, Tab, Tabs, Dialog, DialogContent, DialogActions, DialogTitle, Typography, Divider, Box, IconButton } from "@mui/material";
|
3
3
|
import Upload from "./Options/Upload";
|
4
4
|
import ChooseAssets from "./Options/ChooseAssets";
|
5
5
|
import AddLink from "./Options/AddLink";
|
6
6
|
import Icon from "../Icon";
|
7
7
|
import ImageSelectorStyles from "./Styles";
|
8
8
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
9
|
+
import { CloseIconImageUpload, ImageElementIcon } from "../iconListV2";
|
9
10
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -52,11 +53,28 @@ const ImageSelector = props => {
|
|
52
53
|
fullWidth: true,
|
53
54
|
sx: classes.dialogWrapper,
|
54
55
|
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
55
|
-
children: /*#__PURE__*/_jsxs(
|
56
|
-
sx:
|
57
|
-
|
56
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
57
|
+
sx: {
|
58
|
+
display: "flex",
|
59
|
+
justifyContent: "space-between",
|
60
|
+
alignItems: "center"
|
61
|
+
},
|
62
|
+
children: [/*#__PURE__*/_jsxs(Typography, {
|
63
|
+
sx: classes.titleTypo,
|
64
|
+
children: ["Add ", title]
|
65
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
66
|
+
sx: {
|
67
|
+
padding: "0px"
|
68
|
+
},
|
69
|
+
onClick: onClose,
|
70
|
+
children: /*#__PURE__*/_jsx(CloseIconImageUpload, {})
|
71
|
+
})]
|
58
72
|
})
|
59
|
-
}), /*#__PURE__*/_jsx(Divider, {
|
73
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
74
|
+
sx: {
|
75
|
+
boxShadow: "0px 4px 8px 0px #0000000A"
|
76
|
+
}
|
77
|
+
}), /*#__PURE__*/_jsx(DialogContent, {
|
60
78
|
children: /*#__PURE__*/_jsxs(Grid, {
|
61
79
|
container: true,
|
62
80
|
children: [TAB_SHOW[title].length > 1 && /*#__PURE__*/_jsx(Grid, {
|
@@ -84,9 +102,7 @@ const ImageSelector = props => {
|
|
84
102
|
}), /*#__PURE__*/_jsx(Tab, {
|
85
103
|
className: `${isActive("choose")} ${TAB_SHOW[title].indexOf("choose") === -1 ? "hidden" : ""}`,
|
86
104
|
sx: classes.tab,
|
87
|
-
icon: /*#__PURE__*/_jsx(
|
88
|
-
icon: "media"
|
89
|
-
}),
|
105
|
+
icon: /*#__PURE__*/_jsx(ImageElementIcon, {}),
|
90
106
|
iconPosition: "start",
|
91
107
|
value: "choose",
|
92
108
|
label: `Choose ${title}`
|
@@ -115,7 +131,12 @@ const ImageSelector = props => {
|
|
115
131
|
})
|
116
132
|
})]
|
117
133
|
})
|
118
|
-
}), /*#__PURE__*/_jsx(Divider, {
|
134
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
135
|
+
sx: {
|
136
|
+
boxShadow: "0px -4px 8px 0px #0000000A",
|
137
|
+
borderBottomWidth: "0px"
|
138
|
+
}
|
139
|
+
}), /*#__PURE__*/_jsxs(DialogActions, {
|
119
140
|
sx: {
|
120
141
|
p: 2
|
121
142
|
},
|
@@ -86,7 +86,8 @@ const ImageSelectorStyles = theme => ({
|
|
86
86
|
titleTypo: {
|
87
87
|
fontSize: "16px",
|
88
88
|
fontWeight: 500,
|
89
|
-
color: theme?.palette?.editor?.textColor
|
89
|
+
color: theme?.palette?.editor?.textColor,
|
90
|
+
fontFamily: 'Inter, sans-serif'
|
90
91
|
},
|
91
92
|
addLinkField: {
|
92
93
|
"& .MuiOutlinedInput-input": {
|
@@ -35,11 +35,12 @@ export default function LinkSettings(props) {
|
|
35
35
|
customProps,
|
36
36
|
navType
|
37
37
|
} = props;
|
38
|
+
const themeType = localStorage.getItem("themeType");
|
38
39
|
const {
|
39
40
|
isMobile
|
40
41
|
} = customProps;
|
41
42
|
const navOptions = getNavOptions(customProps.hideTools);
|
42
|
-
const classes = LinkSettingsStyles();
|
43
|
+
const classes = LinkSettingsStyles(themeType);
|
43
44
|
const [nav, setNav] = useState(getNav(navType, navOptions));
|
44
45
|
const [navValue, setNavValue] = useState(props?.navValue || "");
|
45
46
|
const [openInNewTab, setOpenInNewTab] = useState(props.openInNewTab || false);
|
@@ -1,32 +1,35 @@
|
|
1
|
-
const ButtonNavSettingsStyles =
|
1
|
+
const ButtonNavSettingsStyles = themeType => ({
|
2
2
|
dialogContainer: {
|
3
|
-
|
3
|
+
"& .MuiPaper-root": {
|
4
|
+
background: themeType === "dark" ? "#141720 !important" : "#ffffff !important"
|
5
|
+
},
|
6
|
+
"& .MuiDialogContent-root": {
|
4
7
|
padding: "0px 20px"
|
5
8
|
},
|
6
|
-
|
9
|
+
"& .MuiDialogActions-root": {
|
7
10
|
padding: "10px"
|
8
11
|
},
|
9
|
-
|
12
|
+
"& .MuiTypography-h6": {
|
10
13
|
fontWeight: 600,
|
11
14
|
fontSize: "16px",
|
12
15
|
paddingRight: "20px"
|
13
16
|
},
|
14
17
|
"& .MuiGrid-container": {
|
15
|
-
marginTop:
|
18
|
+
marginTop: "0px"
|
16
19
|
},
|
17
20
|
"& .MuiGrid-item": {
|
18
21
|
padding: "14px"
|
19
22
|
}
|
20
23
|
},
|
21
24
|
saveBtn: {
|
22
|
-
color:
|
25
|
+
color: "#fff",
|
23
26
|
background: "#2563EB",
|
24
27
|
fontSize: "14px",
|
25
28
|
fontWeight: 500,
|
26
29
|
padding: "4px 24px",
|
27
30
|
textTransform: "none",
|
28
31
|
"&:hover": {
|
29
|
-
color:
|
32
|
+
color: "#fff",
|
30
33
|
background: "#2563EB"
|
31
34
|
}
|
32
35
|
},
|
@@ -43,7 +46,7 @@ const ButtonNavSettingsStyles = () => ({
|
|
43
46
|
}
|
44
47
|
},
|
45
48
|
closeIcon: {
|
46
|
-
position:
|
49
|
+
position: "absolute",
|
47
50
|
right: 8,
|
48
51
|
top: 8,
|
49
52
|
color: theme => theme.palette.grey[500]
|
@@ -35,14 +35,18 @@ const MentionsPopup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
35
35
|
setOpenAI
|
36
36
|
} = useEditorContext();
|
37
37
|
useEffect(() => {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
try {
|
39
|
+
if (target && chars.length > 0) {
|
40
|
+
const domRange = ReactEditor.toDOMRange(editor, target);
|
41
|
+
const rect = domRange?.getBoundingClientRect();
|
42
|
+
setAnchorEl({
|
43
|
+
clientWidth: rect.width,
|
44
|
+
clientHeight: rect.height,
|
45
|
+
getBoundingClientRect: () => rect
|
46
|
+
});
|
47
|
+
}
|
48
|
+
} catch (err) {
|
49
|
+
console.log(err);
|
46
50
|
}
|
47
51
|
}, [chars.length, editor, index, target]);
|
48
52
|
useEffect(() => {
|
@@ -0,0 +1,142 @@
|
|
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
|
+
"parent-container": [{
|
105
|
+
name: "cut",
|
106
|
+
label: "Cut",
|
107
|
+
render: () => {
|
108
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
109
|
+
children: ["Cut", " ", /*#__PURE__*/_jsxs("span", {
|
110
|
+
className: "shortcut-help-info",
|
111
|
+
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " X"]
|
112
|
+
})]
|
113
|
+
});
|
114
|
+
}
|
115
|
+
}, {
|
116
|
+
name: "copy",
|
117
|
+
label: "Copy",
|
118
|
+
render: () => {
|
119
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
120
|
+
children: ["Copy", " ", /*#__PURE__*/_jsxs("span", {
|
121
|
+
className: "shortcut-help-info",
|
122
|
+
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " C"]
|
123
|
+
})]
|
124
|
+
});
|
125
|
+
}
|
126
|
+
}, {
|
127
|
+
name: "paste",
|
128
|
+
label: "Paste",
|
129
|
+
render: () => {
|
130
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
131
|
+
children: ["Paste", " ", /*#__PURE__*/_jsxs("span", {
|
132
|
+
className: "shortcut-help-info",
|
133
|
+
children: [/*#__PURE__*/_jsx(CMDIcon, {}), " V"]
|
134
|
+
})]
|
135
|
+
});
|
136
|
+
}
|
137
|
+
}, {
|
138
|
+
name: "delete",
|
139
|
+
label: "Delete"
|
140
|
+
}]
|
141
|
+
};
|
142
|
+
export default CMenus;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Popover, MenuItem } from "@mui/material";
|
3
|
+
import CMenus from "./CMenus";
|
4
|
+
import useContextMenuStyle from "./styles";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const ContextMenu = props => {
|
7
|
+
const classes = useContextMenuStyle();
|
8
|
+
const {
|
9
|
+
open,
|
10
|
+
type,
|
11
|
+
contextMenu,
|
12
|
+
handleClose
|
13
|
+
} = props;
|
14
|
+
const {
|
15
|
+
path,
|
16
|
+
x,
|
17
|
+
y
|
18
|
+
} = contextMenu;
|
19
|
+
const menus = CMenus[type] || [];
|
20
|
+
return open && path ? /*#__PURE__*/_jsx(Popover, {
|
21
|
+
open: contextMenu !== null,
|
22
|
+
sx: classes.root,
|
23
|
+
onClose: handleClose(null),
|
24
|
+
anchorReference: "anchorPosition",
|
25
|
+
anchorPosition: contextMenu !== null ? {
|
26
|
+
top: y,
|
27
|
+
left: x
|
28
|
+
} : undefined,
|
29
|
+
children: menus.map((m, i) => {
|
30
|
+
return /*#__PURE__*/_jsx(MenuItem, {
|
31
|
+
className: "cm-menu-item",
|
32
|
+
onClick: handleClose(m),
|
33
|
+
children: m?.render ? m.render() : m.label
|
34
|
+
}, `cm_${i}`);
|
35
|
+
})
|
36
|
+
}) : null;
|
37
|
+
};
|
38
|
+
export default ContextMenu;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
const useContextMenuStyle = () => ({
|
2
|
+
root: {
|
3
|
+
zIndex: 1200,
|
4
|
+
"& .cm-menu-item": {
|
5
|
+
width: "190px",
|
6
|
+
justifyContent: "space-between",
|
7
|
+
"& .shortcut-help-info": {
|
8
|
+
display: "flex",
|
9
|
+
justifyContent: "center",
|
10
|
+
alignItems: "center",
|
11
|
+
fontSize: "12px",
|
12
|
+
color: "#bbb",
|
13
|
+
"& svg": {
|
14
|
+
width: "12px",
|
15
|
+
marginRight: "4px"
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
});
|
21
|
+
export default useContextMenuStyle;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Paper, Popper } from "@mui/material";
|
3
|
+
import useDragInfoStyle from "./styles";
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const DragInfo = props => {
|
7
|
+
const {
|
8
|
+
open,
|
9
|
+
dragging,
|
10
|
+
anchorEl
|
11
|
+
} = props;
|
12
|
+
const {
|
13
|
+
position
|
14
|
+
} = dragging;
|
15
|
+
const {
|
16
|
+
diffX
|
17
|
+
} = position || {};
|
18
|
+
const classes = useDragInfoStyle();
|
19
|
+
const x = parseInt(position?.x - window.innerWidth / 2 + 490 - diffX);
|
20
|
+
return open ? /*#__PURE__*/_jsx(Popper, {
|
21
|
+
open: open,
|
22
|
+
anchorEl: anchorEl,
|
23
|
+
placement: "top-start",
|
24
|
+
sx: classes.root,
|
25
|
+
children: /*#__PURE__*/_jsxs(Paper, {
|
26
|
+
className: "papper-root",
|
27
|
+
children: ["x: ", x, ", y: ", position?.y]
|
28
|
+
})
|
29
|
+
}) : null;
|
30
|
+
};
|
31
|
+
export default DragInfo;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
const useDragInfoStyle = () => ({
|
2
|
+
root: {
|
3
|
+
zIndex: 1200,
|
4
|
+
"& .papper-root": {
|
5
|
+
padding: "4px 6px",
|
6
|
+
background: "#2563EB",
|
7
|
+
color: "#FFF",
|
8
|
+
fontSize: "12px",
|
9
|
+
left: "12px",
|
10
|
+
marginLeft: "6px",
|
11
|
+
borderRadius: "2px"
|
12
|
+
}
|
13
|
+
}
|
14
|
+
});
|
15
|
+
export default useDragInfoStyle;
|