@flozy/editor 1.7.4 → 1.7.6
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/CommonEditor.js +30 -12
- package/dist/Editor/DialogWrapper.js +2 -10
- package/dist/Editor/Editor.css +105 -0
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -4
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +9 -6
- package/dist/Editor/Elements/Color Picker/LogoIcon.js +15 -49
- package/dist/Editor/Elements/Color Picker/Styles.js +25 -4
- package/dist/Editor/Elements/Color Picker/defaultColors.js +1 -1
- package/dist/Editor/Elements/Embed/Image.js +25 -31
- package/dist/Editor/Elements/Embed/Video.js +49 -40
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +49 -3
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +92 -75
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +0 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +19 -5
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -4
- package/dist/Editor/Elements/Grid/Grid.js +67 -114
- package/dist/Editor/Elements/Grid/GridItem.js +9 -23
- package/dist/Editor/Elements/Grid/templates/default_grid.js +0 -23
- package/dist/Editor/Elements/Link/Link.js +58 -20
- package/dist/Editor/Elements/Link/LinkButton.js +37 -97
- package/dist/Editor/Elements/Link/LinkPopup.js +106 -0
- package/dist/Editor/Elements/List/CheckList.js +28 -22
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +11 -5
- package/dist/Editor/Elements/Signature/SignaturePopup.js +15 -4
- package/dist/Editor/Elements/SimpleText.js +30 -26
- package/dist/Editor/MiniEditor.js +4 -6
- package/dist/Editor/Styles/EditorStyles.js +72 -1
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -1
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -1
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +3 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +4 -0
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +96 -19
- package/dist/Editor/Toolbar/toolbarGroups.js +1 -1
- package/dist/Editor/common/Section/index.js +118 -0
- package/dist/Editor/common/Shorthands/elements.js +1 -1
- package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +5 -1
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +44 -51
- package/dist/Editor/common/StyleBuilder/embedImageStyle.js +2 -24
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -3
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +0 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +52 -62
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +2 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +100 -74
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +41 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +3 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +27 -77
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +7 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +19 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +67 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +2 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +21 -32
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +37 -41
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +26 -24
- package/dist/Editor/common/StyleBuilder/formStyle.js +0 -6
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +38 -54
- package/dist/Editor/common/StyleBuilder/gridStyle.js +20 -26
- package/dist/Editor/common/StyleBuilder/index.js +14 -58
- package/dist/Editor/common/StyleBuilder/sectionStyle.js +16 -0
- package/dist/Editor/common/Uploader.js +0 -4
- package/dist/Editor/helper/index.js +63 -1
- package/dist/Editor/utils/Decorators/index.js +5 -0
- package/dist/Editor/utils/Decorators/link.js +26 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +36 -8
- package/dist/Editor/utils/accordion.js +17 -4
- package/dist/Editor/utils/button.js +15 -1
- package/dist/Editor/utils/customHooks/useElement.js +28 -0
- package/dist/Editor/utils/embed.js +1 -7
- package/dist/Editor/utils/events.js +92 -43
- package/dist/Editor/utils/gridItem.js +1 -1
- package/dist/Editor/utils/link.js +10 -9
- package/package.json +1 -1
|
@@ -9,24 +9,27 @@ import { draftToSlate } from "./utils/draftToSlate";
|
|
|
9
9
|
import useMentions from "./hooks/useMentions";
|
|
10
10
|
import MentionsPopup from "./common/MentionsPopup";
|
|
11
11
|
import { RemoteCursorOverlay } from "./RemoteCursorOverlay/Overlay";
|
|
12
|
-
import { mentionsEvent, commands, indentation, escapeEvent } from "./utils/events";
|
|
12
|
+
import { mentionsEvent, commands, indentation, escapeEvent, enterEvent } from "./utils/events";
|
|
13
13
|
import withCommon from "./hooks/withCommon";
|
|
14
14
|
import DialogWrapper from "./DialogWrapper";
|
|
15
15
|
import { serializeToText } from "./utils/serializeToText";
|
|
16
16
|
import { getPageSettings } from "./utils/pageSettings";
|
|
17
|
-
import { getThumbnailImage } from "./helper";
|
|
17
|
+
import { getThumbnailImage, invertColor } from "./helper";
|
|
18
18
|
import PopupTool from "./Toolbar/PopupTool";
|
|
19
19
|
import "./font.css";
|
|
20
20
|
import "./Editor.css";
|
|
21
|
-
import { Box } from "@mui/material";
|
|
21
|
+
import { Box, Typography } from "@mui/material";
|
|
22
22
|
import Shorthands from "./common/Shorthands";
|
|
23
23
|
import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
|
|
24
24
|
import { EditorProvider } from "./hooks/useMouseMove";
|
|
25
25
|
import TopBanner from "./Elements/TopBanner/TopBanner";
|
|
26
26
|
import editorStyles from "./Styles/EditorStyles";
|
|
27
|
-
import DragHandle from "./common/DnD/DragHandle";
|
|
28
27
|
import DragAndDrop from "./common/DnD";
|
|
28
|
+
import Section from "./common/Section";
|
|
29
29
|
import "animate.css";
|
|
30
|
+
import decorators from "./utils/Decorators";
|
|
31
|
+
import useFormat from "./utils/customHooks/useFormat";
|
|
32
|
+
import useElement from "./utils/customHooks/useElement";
|
|
30
33
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
34
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
35
|
const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar"];
|
|
@@ -46,7 +49,10 @@ const Item = /*#__PURE__*/forwardRef(({
|
|
|
46
49
|
});
|
|
47
50
|
Item.displayName = "Item";
|
|
48
51
|
const Element = props => {
|
|
49
|
-
return
|
|
52
|
+
return /*#__PURE__*/_jsx(Section, {
|
|
53
|
+
...props,
|
|
54
|
+
children: getBlock(props)
|
|
55
|
+
});
|
|
50
56
|
};
|
|
51
57
|
const Leaf = ({
|
|
52
58
|
attributes,
|
|
@@ -95,9 +101,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
95
101
|
fullWidth = "80%"
|
|
96
102
|
} = otherProps || {};
|
|
97
103
|
const [drag, setDrag] = useState(null);
|
|
98
|
-
const classes = editorStyles({
|
|
99
|
-
padHeight: !fullScreen ? otherProps?.padHeight : 120
|
|
100
|
-
});
|
|
101
104
|
const editor = useMemo(() => {
|
|
102
105
|
if (collaborativeEditor) return collaborativeEditor;
|
|
103
106
|
return withCommon(createEditor(), {
|
|
@@ -120,6 +123,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
120
123
|
bottom: 0
|
|
121
124
|
}
|
|
122
125
|
};
|
|
126
|
+
const classes = editorStyles({
|
|
127
|
+
padHeight: !fullScreen ? otherProps?.padHeight : 120,
|
|
128
|
+
placeHolderColor: invertColor(pageColor || "#FFF")
|
|
129
|
+
});
|
|
130
|
+
const isListItem = useElement(editor, ["list-item", "check-list-item", "accordion-summary"]);
|
|
131
|
+
console.log(editor.selection);
|
|
123
132
|
useEffect(() => {
|
|
124
133
|
setValue(draftToSlate({
|
|
125
134
|
data: content
|
|
@@ -297,6 +306,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
297
306
|
escapeEvent({
|
|
298
307
|
editor
|
|
299
308
|
});
|
|
309
|
+
} else if (event.key === "Enter") {
|
|
310
|
+
enterEvent(event, editor, isListItem);
|
|
300
311
|
}
|
|
301
312
|
}, [chars, editor, target, mentions, setMentions, search, type, mentionsRef]);
|
|
302
313
|
const Overlay = collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
|
|
@@ -336,11 +347,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
336
347
|
onChange: handleEditorChange,
|
|
337
348
|
children: [/*#__PURE__*/_jsx(DragAndDrop, {
|
|
338
349
|
children: /*#__PURE__*/_jsx(Overlay, {
|
|
339
|
-
children: /*#__PURE__*/
|
|
350
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
340
351
|
className: `${hasTopBanner() ? "has-topbanner" : ""}`,
|
|
341
352
|
sx: classes.slateWrapper,
|
|
342
353
|
id: "slate-wrapper-scroll-container",
|
|
343
|
-
children: /*#__PURE__*/_jsxs(Box, {
|
|
354
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
344
355
|
component: "div",
|
|
345
356
|
className: "max-content",
|
|
346
357
|
children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
|
|
@@ -358,7 +369,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
358
369
|
paddingTop: `${bannerSpacing?.top}px`,
|
|
359
370
|
paddingBottom: `${bannerSpacing?.bottom}px`,
|
|
360
371
|
width: !pageWidth || pageWidth === "fixed" ? fixedWidth : fullWidth,
|
|
361
|
-
// width: viewport.w ? `${viewport.w}px` : "100%",
|
|
362
372
|
height: viewport.h ? `${viewport.h}px` : `100%`,
|
|
363
373
|
alignSelf: "center",
|
|
364
374
|
transformOrigin: "left top",
|
|
@@ -372,6 +382,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
372
382
|
readOnly: isReadOnly,
|
|
373
383
|
renderElement: renderElement,
|
|
374
384
|
renderLeaf: renderLeaf,
|
|
385
|
+
decorate: decorators,
|
|
375
386
|
onKeyDown: onKeyDown
|
|
376
387
|
}), /*#__PURE__*/_jsx(MentionsPopup, {
|
|
377
388
|
ref: mentionsRef,
|
|
@@ -388,7 +399,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
388
399
|
customProps: customProps,
|
|
389
400
|
toolbarOptions: toolbarOptions
|
|
390
401
|
}) : null]
|
|
391
|
-
})
|
|
402
|
+
}), readOnly && /*#__PURE__*/_jsx(Typography, {
|
|
403
|
+
sx: {
|
|
404
|
+
color: "rgb(100, 116, 139)",
|
|
405
|
+
fontSize: "13px"
|
|
406
|
+
},
|
|
407
|
+
align: "center",
|
|
408
|
+
children: footer
|
|
409
|
+
})]
|
|
392
410
|
})
|
|
393
411
|
})
|
|
394
412
|
}), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Dialog, DialogTitle, DialogContent,
|
|
2
|
+
import { Dialog, DialogTitle, DialogContent, IconButton, Grid } from "@mui/material";
|
|
3
3
|
import CloseIcon from "@mui/icons-material/Close";
|
|
4
4
|
// import styled from "@emotion/styled";
|
|
5
5
|
// import commonStyle from "./commonStyle";
|
|
@@ -9,8 +9,7 @@ const DialogWrapper = props => {
|
|
|
9
9
|
const {
|
|
10
10
|
fullScreen,
|
|
11
11
|
onClose,
|
|
12
|
-
children
|
|
13
|
-
footer
|
|
12
|
+
children
|
|
14
13
|
} = props;
|
|
15
14
|
return fullScreen ? /*#__PURE__*/_jsxs(Dialog, {
|
|
16
15
|
className: `dialogComp`,
|
|
@@ -38,13 +37,6 @@ const DialogWrapper = props => {
|
|
|
38
37
|
padding: "0px"
|
|
39
38
|
},
|
|
40
39
|
children: children
|
|
41
|
-
}), /*#__PURE__*/_jsx(DialogActions, {
|
|
42
|
-
style: {
|
|
43
|
-
justifyContent: "center",
|
|
44
|
-
color: "#64748B",
|
|
45
|
-
fontSize: "13px"
|
|
46
|
-
},
|
|
47
|
-
children: footer
|
|
48
40
|
})]
|
|
49
41
|
}) : children;
|
|
50
42
|
};
|
package/dist/Editor/Editor.css
CHANGED
|
@@ -772,6 +772,10 @@ blockquote {
|
|
|
772
772
|
padding: 6px;
|
|
773
773
|
}
|
|
774
774
|
|
|
775
|
+
.iconRadioButton .MuiFormControlLabel-root {
|
|
776
|
+
margin-right: 8px;
|
|
777
|
+
}
|
|
778
|
+
|
|
775
779
|
.iconRadioButton .MuiTypography-root {
|
|
776
780
|
width: 32px;
|
|
777
781
|
height: 32px;
|
|
@@ -810,6 +814,80 @@ blockquote {
|
|
|
810
814
|
outline: none !important;
|
|
811
815
|
}
|
|
812
816
|
|
|
817
|
+
.bannerSpaceBoxLeft {
|
|
818
|
+
width: 12px;
|
|
819
|
+
height: 80px;
|
|
820
|
+
border-radius: 2px 8px 8px 2px;
|
|
821
|
+
border: 2px solid #2563eb;
|
|
822
|
+
top: 14px;
|
|
823
|
+
position: absolute;
|
|
824
|
+
left: 0;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.bannerSpaceBoxTop {
|
|
828
|
+
height: 12px;
|
|
829
|
+
width: 86px;
|
|
830
|
+
border-radius: 2px 2px 8px 8px;
|
|
831
|
+
border: 2px solid #2563eb;
|
|
832
|
+
position: absolute;
|
|
833
|
+
left: 9px;
|
|
834
|
+
top: 0;
|
|
835
|
+
}
|
|
836
|
+
.bannerSpaceBoxRight {
|
|
837
|
+
width: 12px;
|
|
838
|
+
height: 80px;
|
|
839
|
+
border-radius: 8px 2px 2px 8px;
|
|
840
|
+
border: 2px solid #2563eb;
|
|
841
|
+
position: absolute;
|
|
842
|
+
right: 0;
|
|
843
|
+
top: 14px;
|
|
844
|
+
}
|
|
845
|
+
.bannerSpaceBoxBottom {
|
|
846
|
+
height: 12px;
|
|
847
|
+
width: 86px;
|
|
848
|
+
border-radius: 8px 8px 2px 2px;
|
|
849
|
+
border: 2px solid #2563eb;
|
|
850
|
+
position: absolute;
|
|
851
|
+
left: 9px;
|
|
852
|
+
bottom: 0;
|
|
853
|
+
}
|
|
854
|
+
.bannerSpaceBox {
|
|
855
|
+
position: relative;
|
|
856
|
+
width: 106px;
|
|
857
|
+
height: 106px;
|
|
858
|
+
flex-shrink: 0;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
.sliderInput {
|
|
862
|
+
width: 66px;
|
|
863
|
+
padding: 2px 10px;
|
|
864
|
+
margin-left: 18px;
|
|
865
|
+
box-shadow: 0px 4px 16px 0px #0000000d;
|
|
866
|
+
border: 1px solid #6f6f6f33;
|
|
867
|
+
border-radius: 4px;
|
|
868
|
+
}
|
|
869
|
+
.sld-wrpr {
|
|
870
|
+
padding-left: 16px;
|
|
871
|
+
}
|
|
872
|
+
.cradio-primary .MuiRadio-root {
|
|
873
|
+
color: #E0E0E0;
|
|
874
|
+
}
|
|
875
|
+
.cradio-primary .MuiRadio-root.Mui-checked,
|
|
876
|
+
.ccheckbox-primary .MuiCheckbox-root.Mui-checked {
|
|
877
|
+
color: #2563eb
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.spacingSlider .MuiSlider-thumb {
|
|
881
|
+
width: 16px;
|
|
882
|
+
height: 16px;
|
|
883
|
+
border: 2px solid #fff;
|
|
884
|
+
box-shadow: 0px 1px 6px #aaa;
|
|
885
|
+
}
|
|
886
|
+
.spacingSlider {
|
|
887
|
+
height: 9px !important;
|
|
888
|
+
color: #2563eb !important;
|
|
889
|
+
}
|
|
890
|
+
|
|
813
891
|
.uploadImageSection {
|
|
814
892
|
position: absolute;
|
|
815
893
|
transform: translate(-50%, -50%);
|
|
@@ -874,6 +952,33 @@ blockquote {
|
|
|
874
952
|
height: 0px;
|
|
875
953
|
}
|
|
876
954
|
|
|
955
|
+
.sidebar-wrpr-eds {
|
|
956
|
+
padding: 8px 0px;
|
|
957
|
+
}
|
|
958
|
+
.sidebar-wrpr-eds .MuiTypography-body1 {
|
|
959
|
+
color: #0F172A;
|
|
960
|
+
font-size: 14px;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
.content-editable.empty {
|
|
964
|
+
position: relative;
|
|
965
|
+
}
|
|
966
|
+
.content-editable.empty:after {
|
|
967
|
+
content: attr(placeholder);
|
|
968
|
+
position: absolute;
|
|
969
|
+
left: 0;
|
|
970
|
+
top: 0;
|
|
971
|
+
}
|
|
972
|
+
.af-pl-1::after {
|
|
973
|
+
padding-left: 12px;
|
|
974
|
+
}
|
|
975
|
+
.af-pl-2::after {
|
|
976
|
+
padding-left: 24px;
|
|
977
|
+
}
|
|
978
|
+
.af-pt-2::after {
|
|
979
|
+
padding-top: 8px;
|
|
980
|
+
}
|
|
981
|
+
|
|
877
982
|
/* HTML: <div class="loader"></div> */
|
|
878
983
|
.img-loader-wrapper {
|
|
879
984
|
width: 28px;
|
|
@@ -13,21 +13,24 @@ const ColorChunks = (recentColors = []) => [...recentColors, ...colors].reduce((
|
|
|
13
13
|
}
|
|
14
14
|
c.push(b);
|
|
15
15
|
return a;
|
|
16
|
-
}, []).
|
|
16
|
+
}, []).sort((a, b) => b.length - a.length);
|
|
17
17
|
const SingleColorButton = ({
|
|
18
18
|
crs,
|
|
19
19
|
index,
|
|
20
20
|
handleSelect,
|
|
21
21
|
classes,
|
|
22
22
|
handleMore,
|
|
23
|
-
activeColor
|
|
23
|
+
activeColor,
|
|
24
|
+
id,
|
|
25
|
+
padding
|
|
24
26
|
}) => {
|
|
25
27
|
return /*#__PURE__*/_jsxs(Box, {
|
|
26
28
|
style: {
|
|
27
29
|
width: "100%",
|
|
28
30
|
display: "flex",
|
|
29
31
|
alignItems: "center",
|
|
30
|
-
padding: "8px"
|
|
32
|
+
padding: padding || "8px",
|
|
33
|
+
justifyContent: "center"
|
|
31
34
|
},
|
|
32
35
|
children: [crs.map(m => /*#__PURE__*/_jsx(Button, {
|
|
33
36
|
onClick: handleSelect(m),
|
|
@@ -37,6 +40,7 @@ const SingleColorButton = ({
|
|
|
37
40
|
sx: classes.colorButtonSingle,
|
|
38
41
|
className: `${activeColor === m ? "active" : ""}`
|
|
39
42
|
}, `color_bs_${m}`)), index === 0 && handleMore ? /*#__PURE__*/_jsx(IconButton, {
|
|
43
|
+
id: `in_${id}`,
|
|
40
44
|
onClick: handleMore,
|
|
41
45
|
className: "more-btn-cbs",
|
|
42
46
|
children: /*#__PURE__*/_jsx(ArrowDropDownIcon, {})
|
|
@@ -45,6 +49,7 @@ const SingleColorButton = ({
|
|
|
45
49
|
};
|
|
46
50
|
export const AllColors = props => {
|
|
47
51
|
const {
|
|
52
|
+
id,
|
|
48
53
|
classes,
|
|
49
54
|
open,
|
|
50
55
|
anchorEl,
|
|
@@ -74,11 +79,13 @@ export const AllColors = props => {
|
|
|
74
79
|
className: "buttonsWrpr",
|
|
75
80
|
children: all.map((m, i) => {
|
|
76
81
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
|
82
|
+
id: `pi_${id}`,
|
|
77
83
|
crs: m,
|
|
78
84
|
index: i,
|
|
79
85
|
handleSelect: onSelect,
|
|
80
86
|
classes: classes,
|
|
81
|
-
activeColor: activeColor
|
|
87
|
+
activeColor: activeColor,
|
|
88
|
+
padding: "0px"
|
|
82
89
|
}, `si_btn_row1_${m}_${i}`);
|
|
83
90
|
})
|
|
84
91
|
})
|
|
@@ -88,6 +95,7 @@ export const AllColors = props => {
|
|
|
88
95
|
};
|
|
89
96
|
const ColorButtons = props => {
|
|
90
97
|
const {
|
|
98
|
+
id,
|
|
91
99
|
onSelect,
|
|
92
100
|
classes,
|
|
93
101
|
activeColor
|
|
@@ -111,6 +119,7 @@ const ColorButtons = props => {
|
|
|
111
119
|
className: "buttonsWrpr first",
|
|
112
120
|
children: [row1].map((m, i) => {
|
|
113
121
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
|
122
|
+
id: `p1_${id}`,
|
|
114
123
|
crs: m,
|
|
115
124
|
index: i,
|
|
116
125
|
handleSelect: handleSelect,
|
|
@@ -135,6 +144,7 @@ const ColorButtons = props => {
|
|
|
135
144
|
sx: classes.colorButtonsInner,
|
|
136
145
|
children: restRows.map((m, i) => {
|
|
137
146
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
|
147
|
+
id: `p2_${id}`,
|
|
138
148
|
crs: m,
|
|
139
149
|
index: i,
|
|
140
150
|
handleSelect: handleSelect,
|
|
@@ -5,9 +5,9 @@ import ColorPickerTool from "react-gcolor-picker";
|
|
|
5
5
|
import { IconButton, Tooltip, Box, Popover } from "@mui/material";
|
|
6
6
|
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
|
|
7
7
|
import { logo } from "./LogoIcon";
|
|
8
|
-
import "./ColorPicker.css";
|
|
9
8
|
import ColorButtons from "./ColorButtons";
|
|
10
9
|
import ColorPickerStyles from "./Styles";
|
|
10
|
+
import "./ColorPicker.css";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -16,6 +16,7 @@ const DEFAULT_COLOR = {
|
|
|
16
16
|
bgcolor: "#FFFFFF"
|
|
17
17
|
};
|
|
18
18
|
const ColorPicker = ({
|
|
19
|
+
id,
|
|
19
20
|
format,
|
|
20
21
|
editor,
|
|
21
22
|
showHex,
|
|
@@ -55,6 +56,7 @@ const ColorPicker = ({
|
|
|
55
56
|
title: title,
|
|
56
57
|
arrow: true,
|
|
57
58
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
59
|
+
sx: pickerStyles.colorPickerIcon,
|
|
58
60
|
onClick: onOpen,
|
|
59
61
|
children: Logo
|
|
60
62
|
})
|
|
@@ -64,18 +66,19 @@ const ColorPicker = ({
|
|
|
64
66
|
}) : null, /*#__PURE__*/_jsx(ColorButtons, {
|
|
65
67
|
classes: pickerStyles,
|
|
66
68
|
onSelect: onSelect,
|
|
67
|
-
activeColor: activeColor
|
|
68
|
-
|
|
69
|
+
activeColor: activeColor,
|
|
70
|
+
id: id
|
|
71
|
+
}, id), /*#__PURE__*/_jsx(Popover, {
|
|
69
72
|
open: open,
|
|
70
73
|
anchorEl: anchorEl,
|
|
71
74
|
onClose: handleClose,
|
|
72
75
|
anchorOrigin: {
|
|
73
|
-
vertical: "
|
|
76
|
+
vertical: "top",
|
|
74
77
|
horizontal: "center"
|
|
75
78
|
},
|
|
76
79
|
transformOrigin: {
|
|
77
|
-
vertical: "
|
|
78
|
-
horizontal: "
|
|
80
|
+
vertical: "bottom",
|
|
81
|
+
horizontal: "top"
|
|
79
82
|
},
|
|
80
83
|
children: /*#__PURE__*/_jsx(ColorPickerTool, {
|
|
81
84
|
gradient: true,
|
|
@@ -1,59 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
export const logo = {
|
|
4
3
|
color: color => /*#__PURE__*/_jsx("svg", {
|
|
4
|
+
width: "14",
|
|
5
|
+
height: "14",
|
|
6
|
+
viewBox: "0 0 11 14",
|
|
7
|
+
fill: "none",
|
|
5
8
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
version: "1.1",
|
|
10
|
-
id: "Icons",
|
|
11
|
-
viewBox: "0 0 32 32",
|
|
12
|
-
children: /*#__PURE__*/_jsxs("g", {
|
|
13
|
-
children: [/*#__PURE__*/_jsx("path", {
|
|
14
|
-
d: "M29,27H3c-0.6,0-1,0.4-1,1s0.4,1,1,1h26c0.6,0,1-0.4,1-1S29.6,27,29,27z",
|
|
15
|
-
fill: color || "#64748B"
|
|
16
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
17
|
-
d: "M5,24h4c0.6,0,1-0.4,1-1s-0.4-1-1-1H8.6l1.9-4h11.1l1.9,4H23c-0.6,0-1,0.4-1,1s0.4,1,1,1h4c0.6,0,1-0.4,1-1s-0.4-1-1-1 h-1.4L16.9,3.6C16.7,3.2,16.4,3,16,3s-0.7,0.2-0.9,0.6L6.4,22H5c-0.6,0-1,0.4-1,1S4.4,24,5,24z M16,6.3l4.6,9.7h-9.2L16,6.3z"
|
|
18
|
-
})]
|
|
9
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
10
|
+
d: "M5.16796 0C5.16796 0 0 5.92326 0 8.8319C0 12.0176 2.65524 14 5.16796 14C7.83258 14 10.3359 11.9129 10.3359 8.8319C10.3359 5.92326 5.16796 0 5.16796 0ZM8.7402 9.70788C8.45278 11.3396 7.03388 12.0548 5.89918 12.0548C5.80706 12.0543 9.14466 10.6134 7.85834 6.30322C8.53622 7.06776 8.96266 8.4448 8.7402 9.70788Z",
|
|
11
|
+
fill: "#778599"
|
|
19
12
|
})
|
|
20
13
|
}),
|
|
21
|
-
bgColor: color => /*#__PURE__*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
viewBox: "0 0 50 50",
|
|
14
|
+
bgColor: color => /*#__PURE__*/_jsx("svg", {
|
|
15
|
+
width: "14",
|
|
16
|
+
height: "14",
|
|
17
|
+
viewBox: "0 0 14 14",
|
|
26
18
|
fill: "none",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
fill: "white",
|
|
31
|
-
fillOpacity: "0.01"
|
|
32
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
33
|
-
fillRule: "evenodd",
|
|
34
|
-
clipRule: "evenodd",
|
|
35
|
-
d: "M37 37C39.2091 37 41 35.2091 41 33C41 31.5272 39.6667 29.5272 37 27C34.3333 29.5272 33 31.5272 33 33C33 35.2091 34.7909 37 37 37Z",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
children: /*#__PURE__*/_jsx("path", {
|
|
21
|
+
d: "M13.5512 6.73405L6.71385 12.8277C6.30072 13.1996 5.76365 13.3648 5.22658 13.3442C4.6895 13.3235 4.19375 13.0756 3.80127 12.6625L0.516875 8.98561C-0.226762 8.13869 -0.164793 6.83733 0.682127 6.09369L7.51946 0L13.5512 6.7547V6.73405ZM13.3859 8.01475C13.4479 8.26263 11.6095 11.1959 13.138 11.3818C14.9558 11.5883 13.324 7.76687 13.3859 8.01475ZM12.5183 6.67208L7.47814 1.03283L1.19854 6.65142L12.5183 6.69273V6.67208Z",
|
|
36
22
|
fill: "#64748B"
|
|
37
|
-
})
|
|
38
|
-
d: "M20.8535 5.50439L24.389 9.03993",
|
|
39
|
-
stroke: "#64748B",
|
|
40
|
-
strokeWidth: "4",
|
|
41
|
-
strokeLinecap: "round"
|
|
42
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
43
|
-
d: "M23.6818 8.33281L8.12549 23.8892L19.4392 35.2029L34.9955 19.6465L23.6818 8.33281Z",
|
|
44
|
-
stroke: "#64748B",
|
|
45
|
-
strokeWidth: "4",
|
|
46
|
-
strokeLinejoin: "round"
|
|
47
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
48
|
-
d: "M12 20.0732L28.961 25.6496",
|
|
49
|
-
stroke: "#64748B",
|
|
50
|
-
strokeWidth: "4",
|
|
51
|
-
strokeLinecap: "round"
|
|
52
|
-
}), /*#__PURE__*/_jsx("path", {
|
|
53
|
-
d: "M4 43H44",
|
|
54
|
-
stroke: color || "#FFF",
|
|
55
|
-
strokeWidth: "4",
|
|
56
|
-
strokeLinecap: "round"
|
|
57
|
-
})]
|
|
23
|
+
})
|
|
58
24
|
})
|
|
59
25
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ColorPickerStyles = () => ({
|
|
2
2
|
colorButtons: {
|
|
3
|
+
padding: "0px",
|
|
3
4
|
"& .buttonsWrpr": {
|
|
4
5
|
display: "flex",
|
|
5
6
|
justifyCotnent: "center"
|
|
@@ -16,18 +17,18 @@ const ColorPickerStyles = () => ({
|
|
|
16
17
|
"&:before": {
|
|
17
18
|
content: '" "',
|
|
18
19
|
position: "absolute",
|
|
19
|
-
top: "-
|
|
20
|
-
left: "-
|
|
20
|
+
top: "-5px",
|
|
21
|
+
left: "-5px",
|
|
21
22
|
width: "calc(100% + 4px)",
|
|
22
23
|
height: "calc(100% + 4px)",
|
|
23
|
-
border: "3px solid
|
|
24
|
+
border: "3px solid #2563EB",
|
|
24
25
|
borderRadius: "50%"
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
colorButtonsInner: {
|
|
29
30
|
width: "100%",
|
|
30
|
-
padding: "
|
|
31
|
+
padding: "0px",
|
|
31
32
|
display: "flex",
|
|
32
33
|
justifyContent: "center",
|
|
33
34
|
alignItems: "center",
|
|
@@ -46,6 +47,26 @@ const ColorPickerStyles = () => ({
|
|
|
46
47
|
margin: "0px 4px",
|
|
47
48
|
border: "1px solid #ccc"
|
|
48
49
|
}
|
|
50
|
+
},
|
|
51
|
+
colorPickerIcon: {
|
|
52
|
+
background: "linear-gradient(324.06deg, #7025EB 12.92%, #30C8E9 25.48%, #2967F0 38.81%, #DE1E1E 52.54%, #EECE28 68.51%, #64EA61 86.62%)",
|
|
53
|
+
position: "relative",
|
|
54
|
+
padding: "9px",
|
|
55
|
+
zIndex: 1,
|
|
56
|
+
"&:before": {
|
|
57
|
+
content: '" "',
|
|
58
|
+
position: "absolute",
|
|
59
|
+
top: "3px",
|
|
60
|
+
left: "3px",
|
|
61
|
+
width: "calc(100% - 6px)",
|
|
62
|
+
height: "calc(100% - 6px)",
|
|
63
|
+
borderRadius: "50%",
|
|
64
|
+
background: "#E9F3FE",
|
|
65
|
+
zIndex: 2
|
|
66
|
+
},
|
|
67
|
+
"& svg": {
|
|
68
|
+
zIndex: 3
|
|
69
|
+
}
|
|
49
70
|
}
|
|
50
71
|
});
|
|
51
72
|
export default ColorPickerStyles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const colors = ["#
|
|
1
|
+
export const colors = ["#0F172A", "#2563EB", "#8360FD", "#19A9FC", "#FDB52A", "#0E8E2A", "#E1425E", "#292D32", "#578CFF", "#A58CFF", "#46BBFF", "#FFC93A", "#33B24F", "#F06C83", "#64748B", "#82A9FE", "#C4B3FF", "#71CBFF", "#FFD055", "#61D57A", "#FA91A4", "#A2B0B9", "#A4C1FF", "#D7CBFF", "#9FDCFF", "#FFDC80", "#8AE59E", "#FCB0BE", "#E4ECF3", "#CDDCFF", "#E0D7FF", "#BEE7FF", "#FFE49E", "#B9F6C6", "#FDCAD3", "#FFFFFF", "#489FF8", "#FE7A00", "linear-gradient(327.62deg, #EBB9E0 13.53%, #9CEEE5 86.82%)", "linear-gradient(310.6deg, #7FA4F4 15.53%, #805EF5 83.64%)", "linear-gradient(95.19deg, #A831E7 4.17%, #F05339 88.89%)", "linear-gradient(90deg, #3F2AB7 12.5%, #0DC9B5 100%)"];
|
|
@@ -4,10 +4,10 @@ import { Node, Transforms, Editor } from "slate";
|
|
|
4
4
|
import AspectRatioIcon from "@mui/icons-material/AspectRatio";
|
|
5
5
|
import useResize from "../../utils/customHooks/useResize";
|
|
6
6
|
import EmbedPopup from "./EmbedPopup";
|
|
7
|
-
import { IconButton, Tooltip } from "@mui/material";
|
|
7
|
+
import { IconButton, Tooltip, Box } from "@mui/material";
|
|
8
8
|
import { GridSettingsIcon } from "../../common/iconslist";
|
|
9
|
-
import QuiltedImageList from "../../common/ImageList";
|
|
10
9
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
|
10
|
+
import Icon from "../../common/Icon";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const Image = ({
|
|
@@ -19,14 +19,11 @@ const Image = ({
|
|
|
19
19
|
const {
|
|
20
20
|
url,
|
|
21
21
|
alt,
|
|
22
|
-
images = [],
|
|
23
22
|
bannerSpacing,
|
|
24
23
|
alignment,
|
|
25
24
|
bgColor,
|
|
26
25
|
borderColor,
|
|
27
26
|
borderRadius,
|
|
28
|
-
cols,
|
|
29
|
-
rowHeight,
|
|
30
27
|
boxShadow
|
|
31
28
|
} = element;
|
|
32
29
|
const {
|
|
@@ -105,15 +102,6 @@ const Image = ({
|
|
|
105
102
|
at: path
|
|
106
103
|
});
|
|
107
104
|
};
|
|
108
|
-
|
|
109
|
-
// const onAddText = () => {
|
|
110
|
-
// Transforms.wrapNodes(editor, {
|
|
111
|
-
// type: "image-text-wrapper",
|
|
112
|
-
// children: [],
|
|
113
|
-
// });
|
|
114
|
-
// insertImageText(editor, [...path, 1]);
|
|
115
|
-
// };
|
|
116
|
-
|
|
117
105
|
const ToolBar = () => {
|
|
118
106
|
return selected ? /*#__PURE__*/_jsx("div", {
|
|
119
107
|
className: "element-toolbar visible-on-hover",
|
|
@@ -128,6 +116,28 @@ const Image = ({
|
|
|
128
116
|
})
|
|
129
117
|
}) : null;
|
|
130
118
|
};
|
|
119
|
+
const ImageContent = () => {
|
|
120
|
+
return !url && !readOnly ? /*#__PURE__*/_jsxs(Box, {
|
|
121
|
+
component: "button",
|
|
122
|
+
className: "element-empty-btn",
|
|
123
|
+
onClick: onSettings,
|
|
124
|
+
contentEditable: false,
|
|
125
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
126
|
+
icon: "video"
|
|
127
|
+
}), "Add Image"]
|
|
128
|
+
}) : /*#__PURE__*/_jsx("img", {
|
|
129
|
+
style: {
|
|
130
|
+
borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
|
|
131
|
+
objectFit: "cover",
|
|
132
|
+
boxShadow: boxShadow || "none"
|
|
133
|
+
},
|
|
134
|
+
alt: alt,
|
|
135
|
+
src: url,
|
|
136
|
+
onClick: handleImageClick,
|
|
137
|
+
"data-path": path.join(","),
|
|
138
|
+
draggable: false
|
|
139
|
+
});
|
|
140
|
+
};
|
|
131
141
|
const totalMinus = (parseInt(left) || 0) + (parseInt(right) || 0);
|
|
132
142
|
const width = resizing ? `${size.width}px` : `${size.widthInPercent}%`;
|
|
133
143
|
return /*#__PURE__*/_jsxs("div", {
|
|
@@ -164,23 +174,7 @@ const Image = ({
|
|
|
164
174
|
width: `${width}`,
|
|
165
175
|
height: `${size.height}px`
|
|
166
176
|
},
|
|
167
|
-
children: [!readOnly && /*#__PURE__*/_jsx(ToolBar, {}),
|
|
168
|
-
itemData: images || [],
|
|
169
|
-
readOnly: true,
|
|
170
|
-
rowHeight: rowHeight,
|
|
171
|
-
cols: cols
|
|
172
|
-
}) : /*#__PURE__*/_jsx("img", {
|
|
173
|
-
style: {
|
|
174
|
-
borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
|
|
175
|
-
objectFit: "cover",
|
|
176
|
-
boxShadow: boxShadow || "none"
|
|
177
|
-
},
|
|
178
|
-
alt: alt,
|
|
179
|
-
src: url,
|
|
180
|
-
onClick: handleImageClick,
|
|
181
|
-
"data-path": path.join(","),
|
|
182
|
-
draggable: false
|
|
183
|
-
}), selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
|
|
177
|
+
children: [!readOnly && /*#__PURE__*/_jsx(ToolBar, {}), /*#__PURE__*/_jsx(ImageContent, {}), selected && !readOnly && /*#__PURE__*/_jsx(IconButton, {
|
|
184
178
|
onPointerDown: onMouseDown,
|
|
185
179
|
style: {
|
|
186
180
|
opacity: 1,
|