@flozy/editor 7.0.8 → 7.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Editor/ChatEditor.js +7 -7
- package/dist/Editor/CommonEditor.js +25 -74
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +16 -32
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +9 -25
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +12 -57
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/Embed/Image.js +2 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +14 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
- package/dist/Editor/Elements/Grid/GridItem.js +3 -2
- package/dist/Editor/Elements/Link/Link.js +43 -70
- package/dist/Editor/Elements/SimpleText/index.js +12 -7
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +12 -12
- package/dist/Editor/Elements/Title/title.js +1 -13
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
- package/dist/Editor/Styles/EditorStyles.js +291 -287
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +85 -210
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +9 -56
- package/dist/Editor/Toolbar/PopupTool/index.js +37 -29
- package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
- package/dist/Editor/common/ColorPickerButton.js +9 -35
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/DnD/Draggable.js +1 -0
- package/dist/Editor/common/FontLoader/FontList.js +11 -3
- package/dist/Editor/common/FontLoader/FontLoader.js +42 -74
- package/dist/Editor/common/Icon.js +0 -28
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +9 -3
- package/dist/Editor/common/ImageSelector/UploadStyles.js +2 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +9 -3
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/styles.js +1 -0
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -8
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
- package/dist/Editor/common/RnD/Utils/index.js +0 -40
- package/dist/Editor/common/RnD/index.js +3 -23
- package/dist/Editor/common/Section/index.js +89 -60
- package/dist/Editor/common/Shorthands/elements.js +0 -54
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +11 -35
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/commonStyle.js +65 -55
- package/dist/Editor/helper/deserialize/index.js +1 -1
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +2 -200
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/hooks/useMouseMove.js +3 -9
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +9 -5
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +49 -157
- package/dist/Editor/utils/button.js +14 -0
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +20 -48
- package/dist/Editor/utils/link.js +1 -1
- package/package.json +2 -5
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
- package/dist/Editor/common/CustomColorPicker/index.js +0 -106
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog/index.js +0 -94
- package/dist/Editor/common/CustomDialog/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -33
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
- package/dist/Editor/hooks/useEditorTheme.js +0 -153
- package/dist/Editor/theme/index.js +0 -144
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
- package/dist/Editor/themeSettings/buttons/index.js +0 -283
- package/dist/Editor/themeSettings/buttons/style.js +0 -21
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
- package/dist/Editor/themeSettings/fonts/index.js +0 -220
- package/dist/Editor/themeSettings/fonts/style.js +0 -44
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -320
- package/dist/Editor/themeSettings/style.js +0 -152
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -356
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
- package/dist/Editor/themeSettingsAI/style.js +0 -250
@@ -1,6 +1,6 @@
|
|
1
|
-
import React, { useCallback, useMemo, useRef, useState, useImperativeHandle, forwardRef } from "react";
|
2
|
-
import { Editable, Slate, ReactEditor } from
|
3
|
-
import { createEditor, Transforms, Editor } from
|
1
|
+
import React, { useCallback, useMemo, useRef, useState, useEffect, useImperativeHandle, forwardRef } from "react";
|
2
|
+
import { Editable, Slate, ReactEditor } from 'slate-react';
|
3
|
+
import { createEditor, Transforms, Editor } from 'slate';
|
4
4
|
import withCommon from "./hooks/withCommon";
|
5
5
|
import { getBlock, getMarked, serializeMentions } from "./utils/chatEditor/SlateUtilityFunctions";
|
6
6
|
import MiniTextFormat from "./Toolbar/PopupTool/MiniTextFormat";
|
@@ -35,13 +35,13 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
35
35
|
const classes = usePopupStyle(theme);
|
36
36
|
const convertedContent = draftToSlate({
|
37
37
|
data: content && content?.length > 0 ? content : [{
|
38
|
-
type:
|
38
|
+
type: 'paragraph',
|
39
39
|
children: [{
|
40
|
-
text:
|
40
|
+
text: ''
|
41
41
|
}]
|
42
42
|
}]
|
43
43
|
});
|
44
|
-
const [value] = useState(convertedContent);
|
44
|
+
const [value, setValue] = useState(convertedContent);
|
45
45
|
const debouncedValue = useRef(value);
|
46
46
|
const debounced = useDebouncedCallback(
|
47
47
|
// function
|
@@ -216,7 +216,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
216
216
|
editor
|
217
217
|
});
|
218
218
|
} else if (event.key === "Enter" && !isMobile) {
|
219
|
-
const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type ===
|
219
|
+
const isEmpty = debouncedValue?.current.length === 1 && debouncedValue?.current[0].type === 'paragraph' && debouncedValue?.current[0].children.length === 1 && debouncedValue?.current[0].children[0].text === '';
|
220
220
|
if (isEmpty) {
|
221
221
|
event.preventDefault();
|
222
222
|
return;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
|
-
import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle
|
2
|
+
import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle } from "react";
|
3
3
|
import PropTypes from "prop-types";
|
4
4
|
import { createEditor, Range, Transforms } from "slate";
|
5
5
|
import { Slate, Editable, ReactEditor } from "slate-react";
|
@@ -17,7 +17,7 @@ import { serializeToText } from "./utils/serializeToText";
|
|
17
17
|
import { getPageSettings } from "./utils/pageSettings";
|
18
18
|
import { getThumbnailImage, invertColor } from "./helper";
|
19
19
|
import PopupTool from "./Toolbar/PopupTool";
|
20
|
-
import { Box, Typography, useTheme
|
20
|
+
import { Box, Typography, useTheme } from "@mui/material";
|
21
21
|
import Shorthands from "./common/Shorthands";
|
22
22
|
import MiniToolbar from "./Toolbar/Mini/MiniToolbar";
|
23
23
|
import { EditorProvider } from "./hooks/useMouseMove";
|
@@ -26,12 +26,9 @@ import editorStyles from "./Styles/EditorStyles";
|
|
26
26
|
import DragAndDrop from "./common/DnD";
|
27
27
|
import Section from "./common/Section";
|
28
28
|
import decorators from "./utils/Decorators";
|
29
|
-
import {
|
29
|
+
import { getBreakpointLineSpacing, getTRBLBreakPoints } from "./helper/theme";
|
30
30
|
import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
|
31
31
|
import useWindowResize from "./hooks/useWindowResize";
|
32
|
-
import { getTheme } from "./theme";
|
33
|
-
import ThemeSettings from "./themeSettings";
|
34
|
-
import ThemeSettingsAI from "./themeSettingsAI";
|
35
32
|
import PopoverAIInput from "./Elements/AI/PopoverAIInput";
|
36
33
|
import RnDCopy from "./common/RnD/RnDCopy";
|
37
34
|
import SwitchViewport from "./common/RnD/SwitchViewport/SwitchViewport";
|
@@ -40,10 +37,8 @@ import "./font.css";
|
|
40
37
|
import "./Editor.css";
|
41
38
|
import "animate.css";
|
42
39
|
import FontLoader from "./common/FontLoader/FontLoader";
|
43
|
-
import { ThemeAIIcon, ThemePaintIcon } from "./assets/svg/ThemeIcons";
|
44
40
|
import { jsx as _jsx } from "react/jsx-runtime";
|
45
41
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
46
|
-
export const ThemeContext = /*#__PURE__*/createContext(null);
|
47
42
|
const Item = /*#__PURE__*/forwardRef(({
|
48
43
|
children,
|
49
44
|
...props
|
@@ -59,14 +54,13 @@ const Item = /*#__PURE__*/forwardRef(({
|
|
59
54
|
});
|
60
55
|
});
|
61
56
|
Item.displayName = "Item";
|
62
|
-
const Element =
|
57
|
+
const Element = props => {
|
63
58
|
return /*#__PURE__*/_jsx(Section, {
|
64
59
|
...props,
|
65
60
|
children: getBlock(props)
|
66
61
|
});
|
67
|
-
}
|
68
|
-
|
69
|
-
const Leaf = /*#__PURE__*/React.memo(({
|
62
|
+
};
|
63
|
+
const Leaf = ({
|
70
64
|
attributes,
|
71
65
|
children,
|
72
66
|
leaf
|
@@ -77,13 +71,12 @@ const Leaf = /*#__PURE__*/React.memo(({
|
|
77
71
|
...attributes,
|
78
72
|
children: children
|
79
73
|
});
|
80
|
-
}
|
81
|
-
Leaf.displayName = "Leaf";
|
74
|
+
};
|
82
75
|
const updateTopBanner = (content = [], setTopBanner) => {
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
76
|
+
setTopBanner(() => {
|
77
|
+
const firstNode = content ? content[0] : {};
|
78
|
+
return firstNode?.type === "topbanner" ? firstNode : null;
|
79
|
+
});
|
87
80
|
};
|
88
81
|
const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
89
82
|
const {
|
@@ -98,14 +91,13 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
98
91
|
otherProps,
|
99
92
|
isIframe,
|
100
93
|
theme,
|
101
|
-
|
102
|
-
|
94
|
+
showViewport = false,
|
95
|
+
overrideWrapperStyles = {}
|
103
96
|
} = props;
|
104
97
|
const editorWrapper = useRef();
|
105
98
|
const mentionsRef = useRef();
|
106
99
|
const convertedContent = draftToSlate({
|
107
|
-
data: content
|
108
|
-
needLayout: otherProps?.needLayout
|
100
|
+
data: content
|
109
101
|
});
|
110
102
|
const [value, setValue] = useState(convertedContent);
|
111
103
|
const [isInteracted, setIsInteracted] = useState(false);
|
@@ -145,11 +137,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
145
137
|
const {
|
146
138
|
bannerSpacing,
|
147
139
|
pageBgImage,
|
148
|
-
pageColor
|
140
|
+
pageColor,
|
149
141
|
color: pageTextColor,
|
150
142
|
pageWidth,
|
151
143
|
maxWidth: pageMaxWidth,
|
152
|
-
theme: selectedTheme,
|
153
144
|
lineHeight
|
154
145
|
} = pageSt?.pageProps || {
|
155
146
|
bannerSpacing: {
|
@@ -161,16 +152,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
161
152
|
};
|
162
153
|
const classes = editorStyles({
|
163
154
|
padHeight: !fullScreen ? otherProps?.padHeight : 20,
|
164
|
-
placeHolderColor: invertColor(pageColor
|
165
|
-
theme
|
155
|
+
placeHolderColor: invertColor(pageColor || "#FFF"),
|
156
|
+
theme,
|
157
|
+
overrideWrapperStyles
|
166
158
|
});
|
167
|
-
const [openTheme, setOpenTheme] = useState(false);
|
168
|
-
const [openAITheme, setOpenAITheme] = useState(false);
|
169
|
-
const [, setThemeUpdated] = useState(0);
|
170
|
-
const triggerRender = () => {
|
171
|
-
setThemeUpdated(prev => prev + 1); // Incrementing forces a re-render while updating theme
|
172
|
-
};
|
173
|
-
|
174
159
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
175
160
|
useEffect(() => {
|
176
161
|
setValue(draftToSlate({
|
@@ -184,11 +169,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
184
169
|
const debounced = useDebouncedCallback(
|
185
170
|
// function
|
186
171
|
value => {
|
187
|
-
debouncedValue.current = value;
|
188
172
|
const {
|
189
173
|
value: strVal,
|
190
174
|
...restVal
|
191
175
|
} = getOnSaveData(value);
|
176
|
+
debouncedValue.current = value;
|
192
177
|
onSave(strVal, restVal);
|
193
178
|
},
|
194
179
|
// delay in ms
|
@@ -199,7 +184,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
199
184
|
return {
|
200
185
|
value: JSON.stringify(val),
|
201
186
|
text: text,
|
202
|
-
title: serializeToText(title?.children) || ""
|
187
|
+
title: serializeToText(title?.children) || "Untitled"
|
203
188
|
};
|
204
189
|
};
|
205
190
|
const getPreviewImage = async (needBackground = false, options = {}) => {
|
@@ -298,12 +283,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
298
283
|
redo() {
|
299
284
|
editor?.redo();
|
300
285
|
},
|
301
|
-
toggleTheme() {
|
302
|
-
setOpenTheme(!openTheme);
|
303
|
-
},
|
304
|
-
toggleAITheme() {
|
305
|
-
setOpenAITheme(!openAITheme);
|
306
|
-
},
|
307
286
|
getPageSettings: {
|
308
287
|
background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
|
309
288
|
}
|
@@ -335,7 +314,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
335
314
|
updateTopBanner(newValue, setTopBanner);
|
336
315
|
debounced(newValue);
|
337
316
|
if (!isInteracted) {
|
338
|
-
|
317
|
+
setIsInteracted(true);
|
339
318
|
}
|
340
319
|
}
|
341
320
|
};
|
@@ -479,7 +458,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
479
458
|
}
|
480
459
|
return style;
|
481
460
|
}, [pageBgImage, pageColor]);
|
482
|
-
const themeProps = getTheme(selectedTheme);
|
483
461
|
|
484
462
|
// const handleContextMenu = (e) => {
|
485
463
|
// if (!readOnly) {
|
@@ -509,30 +487,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
509
487
|
console.log("handleCursorScroll", err);
|
510
488
|
}
|
511
489
|
};
|
512
|
-
return /*#__PURE__*/
|
490
|
+
return /*#__PURE__*/_jsx(EditorProvider, {
|
513
491
|
theme: theme,
|
514
492
|
editor: editor,
|
515
|
-
|
516
|
-
setOpenTheme: setOpenTheme,
|
517
|
-
triggerRender: triggerRender,
|
518
|
-
children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
|
519
|
-
className: "theme-buttons",
|
520
|
-
children: [/*#__PURE__*/_jsx(IconButton, {
|
521
|
-
onClick: () => setOpenTheme(true),
|
522
|
-
children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
|
523
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
524
|
-
onClick: () => setOpenAITheme(true),
|
525
|
-
style: {
|
526
|
-
marginTop: "4px"
|
527
|
-
},
|
528
|
-
children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
|
529
|
-
})]
|
530
|
-
}) : null, /*#__PURE__*/_jsx(DialogWrapper, {
|
493
|
+
children: /*#__PURE__*/_jsx(DialogWrapper, {
|
531
494
|
classes: classes,
|
532
495
|
...props,
|
533
496
|
fullScreen: fullScreen,
|
534
497
|
footer: footer || "",
|
535
|
-
selectedTheme: selectedTheme,
|
536
498
|
children: /*#__PURE__*/_jsx(Box, {
|
537
499
|
component: "div",
|
538
500
|
className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
|
@@ -562,7 +524,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
562
524
|
children: /*#__PURE__*/_jsxs(Box, {
|
563
525
|
component: "div",
|
564
526
|
className: "max-content",
|
565
|
-
sx: themeProps?.sxProps || {},
|
566
527
|
"data-info": outsideEditorClickLabel,
|
567
528
|
children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
|
568
529
|
className: "scroll-area",
|
@@ -629,15 +590,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
629
590
|
"data-info": outsideEditorClickLabel,
|
630
591
|
onClick: handleFooterClick,
|
631
592
|
children: footer
|
632
|
-
}), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
|
633
|
-
open: openTheme,
|
634
|
-
setOpen: setOpenTheme,
|
635
|
-
editor: editor,
|
636
|
-
services: otherProps?.services
|
637
|
-
}) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
|
638
|
-
openAITheme: openAITheme,
|
639
|
-
setOpenAITheme: setOpenAITheme,
|
640
|
-
onSaveTheme: otherProps?.onSaveTheme
|
641
593
|
})]
|
642
594
|
})
|
643
595
|
}), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
|
@@ -646,9 +598,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
646
598
|
setIsTextSelected: setIsTextSelected,
|
647
599
|
customProps: customProps,
|
648
600
|
editorWrapper: editorWrapper
|
649
|
-
}) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
|
601
|
+
}) : null, !readOnly && showViewport ? /*#__PURE__*/_jsx(SwitchViewport, {
|
650
602
|
breakpoint: breakpoint,
|
651
|
-
show: showViewport,
|
652
603
|
onChange: b => onSwitchBreakpoint(b)
|
653
604
|
}) : null]
|
654
605
|
})
|
@@ -660,7 +611,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
660
611
|
})]
|
661
612
|
}, id)
|
662
613
|
})
|
663
|
-
})
|
614
|
+
})
|
664
615
|
});
|
665
616
|
});
|
666
617
|
CommonEditor.displayName = "CommonEditor";
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
2
2
|
import { Dialog, DialogTitle, DialogContent, IconButton, Grid } from "@mui/material";
|
3
3
|
import CloseIcon from "@mui/icons-material/Close";
|
4
4
|
import ViewportStimulator from "./common/RnD/Theme/ViewportStimulator";
|
5
|
-
import MainThemeProvider from "./common/RnD/Theme/MainThemeProvider";
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
7
|
const DialogWrapper = props => {
|
@@ -10,45 +9,40 @@ const DialogWrapper = props => {
|
|
10
9
|
fullScreen,
|
11
10
|
onClose,
|
12
11
|
children,
|
13
|
-
classes
|
14
|
-
selectedTheme
|
12
|
+
classes
|
15
13
|
} = props;
|
16
|
-
return fullScreen ? /*#__PURE__*/
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
return fullScreen ? /*#__PURE__*/_jsxs(Dialog, {
|
15
|
+
className: `dialogComp`,
|
16
|
+
open: fullScreen,
|
17
|
+
fullScreen: fullScreen,
|
18
|
+
onClose: onClose,
|
19
|
+
style: {
|
20
|
+
zIndex: 1000
|
21
|
+
},
|
22
|
+
sx: classes.fullScreenWrapper,
|
23
|
+
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
23
24
|
style: {
|
24
|
-
|
25
|
+
padding: "6px 8px"
|
25
26
|
},
|
26
|
-
|
27
|
-
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
28
|
-
style: {
|
29
|
-
padding: "6px 8px"
|
30
|
-
},
|
27
|
+
children: /*#__PURE__*/_jsx(Grid, {
|
31
28
|
children: /*#__PURE__*/_jsx(Grid, {
|
32
|
-
|
29
|
+
style: {
|
30
|
+
display: "flex",
|
31
|
+
justifyContent: "end"
|
32
|
+
},
|
33
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
34
|
+
onClick: onClose,
|
33
35
|
style: {
|
34
|
-
|
35
|
-
justifyContent: "end"
|
36
|
+
background: "rgba(255,255,255,0.5)"
|
36
37
|
},
|
37
|
-
children: /*#__PURE__*/_jsx(
|
38
|
-
onClick: onClose,
|
39
|
-
style: {
|
40
|
-
background: "rgba(255,255,255,0.5)"
|
41
|
-
},
|
42
|
-
children: /*#__PURE__*/_jsx(CloseIcon, {})
|
43
|
-
})
|
38
|
+
children: /*#__PURE__*/_jsx(CloseIcon, {})
|
44
39
|
})
|
45
40
|
})
|
46
|
-
})
|
47
|
-
|
48
|
-
|
49
|
-
})
|
41
|
+
})
|
42
|
+
}), /*#__PURE__*/_jsx(DialogContent, {
|
43
|
+
children: children
|
44
|
+
})]
|
50
45
|
}) : /*#__PURE__*/_jsx(ViewportStimulator, {
|
51
|
-
selectedTheme: selectedTheme,
|
52
46
|
children: children
|
53
47
|
});
|
54
48
|
};
|
package/dist/Editor/Editor.css
CHANGED
@@ -1263,19 +1263,6 @@ blockquote {
|
|
1263
1263
|
pointer-events: auto;
|
1264
1264
|
}
|
1265
1265
|
|
1266
|
-
@media (max-width: 899px) {
|
1267
|
-
.MuiPopover-root {
|
1268
|
-
z-index: 1302 !important;
|
1269
|
-
}
|
1270
|
-
canvas {
|
1271
|
-
max-width: 100% !important;
|
1272
|
-
}
|
1273
|
-
}
|
1274
|
-
|
1275
|
-
.settingsHeader {
|
1276
|
-
font-size: 14px !important;
|
1277
|
-
font-weight: 500 !important;
|
1278
|
-
}
|
1279
1266
|
.hideScroll {
|
1280
1267
|
overflow-anchor: none;
|
1281
1268
|
}
|
@@ -1291,6 +1278,21 @@ blockquote {
|
|
1291
1278
|
.hideScroll::-webkit-scrollbar-thumb:hover {
|
1292
1279
|
background: none !important;
|
1293
1280
|
}
|
1281
|
+
@media (max-width: 899px) {
|
1282
|
+
/* Qa validation required */
|
1283
|
+
/* .MuiPopover-root {
|
1284
|
+
z-index: 1302 !important;
|
1285
|
+
} */
|
1286
|
+
|
1287
|
+
canvas {
|
1288
|
+
max-width: 100% !important;
|
1289
|
+
}
|
1290
|
+
}
|
1291
|
+
|
1292
|
+
.settingsHeader {
|
1293
|
+
font-size: 14px !important;
|
1294
|
+
font-weight: 500 !important;
|
1295
|
+
}
|
1294
1296
|
|
1295
1297
|
.custom-scroll::-webkit-scrollbar {
|
1296
1298
|
height: .6rem;
|
@@ -1337,22 +1339,4 @@ code.markcode {
|
|
1337
1339
|
display: block;
|
1338
1340
|
background-color: #f3f3f3;
|
1339
1341
|
font-family: 'Source Code Pro' !important;
|
1340
|
-
}
|
1341
|
-
|
1342
|
-
/* Hide the popper when the reference is hidden */
|
1343
|
-
.hide-popper-on-overlap[data-popper-escaped],
|
1344
|
-
.hide-popper-on-overlap[data-popper-reference-hidden] {
|
1345
|
-
visibility: hidden;
|
1346
|
-
pointer-events: none;
|
1347
|
-
}
|
1348
|
-
|
1349
|
-
.theme-buttons {
|
1350
|
-
display: flex;
|
1351
|
-
justify-content: end;
|
1352
|
-
align-items: center;
|
1353
|
-
margin: auto;
|
1354
|
-
position: absolute;
|
1355
|
-
top: 60px;
|
1356
|
-
right: 20px;
|
1357
|
-
z-index: 1000;
|
1358
|
-
}
|
1342
|
+
}
|
@@ -265,7 +265,7 @@ function AppHeader(props) {
|
|
265
265
|
style: {
|
266
266
|
display: "inline-flex",
|
267
267
|
alignItems: "center",
|
268
|
-
color: textColor
|
268
|
+
color: textColor,
|
269
269
|
fontSize: logoFontSize,
|
270
270
|
fontFamily: titleFontFamily,
|
271
271
|
justifyContent: isLogoRight ? "end" : "start"
|
@@ -320,7 +320,7 @@ function AppHeader(props) {
|
|
320
320
|
fontFamily: fontFamily,
|
321
321
|
textTransform: "none",
|
322
322
|
fontSize: fontSize || "16px",
|
323
|
-
color: textColor || "#
|
323
|
+
color: textColor || "#FFF",
|
324
324
|
background: bgColor || "none",
|
325
325
|
"& .m-settings": {
|
326
326
|
display: "none",
|
@@ -335,7 +335,7 @@ function AppHeader(props) {
|
|
335
335
|
background: "#FFF"
|
336
336
|
},
|
337
337
|
"&:hover": {
|
338
|
-
color: textColorHover || textColor || "#
|
338
|
+
color: textColorHover || textColor || "#FFF",
|
339
339
|
background: bgColorHover || bgColor || "none",
|
340
340
|
"& .m-settings": {
|
341
341
|
display: "block"
|
@@ -9,8 +9,6 @@ import { WorkflowIcon } from "../../common/iconslist";
|
|
9
9
|
import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
10
10
|
import { handleLinkType, windowVar } from "../../utils/helper";
|
11
11
|
import LinkSettings from "../../common/LinkSettings";
|
12
|
-
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
13
|
-
import { getTheme } from "../../theme";
|
14
12
|
import Icon from "../../common/Icon";
|
15
13
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
16
14
|
import useCommonStyle from "../../commonStyle";
|
@@ -40,12 +38,6 @@ const EditorButton = props => {
|
|
40
38
|
const [openNav, setOpenNav] = useState(false);
|
41
39
|
const [openMoreOptions, setOpenMoreOptions] = useState(false);
|
42
40
|
const classes = useCommonStyle(appTheme);
|
43
|
-
const {
|
44
|
-
theme: selectedTheme
|
45
|
-
} = useEditorTheme();
|
46
|
-
const {
|
47
|
-
buttonTheme
|
48
|
-
} = getTheme(selectedTheme);
|
49
41
|
const {
|
50
42
|
label,
|
51
43
|
bgColor,
|
@@ -59,7 +51,7 @@ const EditorButton = props => {
|
|
59
51
|
fontFamily,
|
60
52
|
textColorHover,
|
61
53
|
bgColorHover,
|
62
|
-
|
54
|
+
buttonIcon,
|
63
55
|
iconPosition = "start",
|
64
56
|
borderStyle,
|
65
57
|
borderWidth,
|
@@ -80,7 +72,6 @@ const EditorButton = props => {
|
|
80
72
|
};
|
81
73
|
const isTrigger = linkType === "nextTrigger" || linkType === "prevTrigger";
|
82
74
|
const refURl = isTrigger ? buttonLink?.url : url;
|
83
|
-
const buttonIcon = element?.buttonIcon || buttonTheme?.buttonIcon;
|
84
75
|
const BtnIcon = buttonIcon ? buttonIcon : null;
|
85
76
|
windowVar.lastButtonProps = element;
|
86
77
|
const handleTrigger = async () => {
|
@@ -171,7 +162,6 @@ const EditorButton = props => {
|
|
171
162
|
display: "inline-flex",
|
172
163
|
color: "rgba(0, 0, 0, 0.54)",
|
173
164
|
marginBottom: "0px !important",
|
174
|
-
...classes.buttonMoreOption,
|
175
165
|
...classes.buttonMoreOption3
|
176
166
|
},
|
177
167
|
...btnProps,
|
@@ -263,14 +253,19 @@ const EditorButton = props => {
|
|
263
253
|
display: "inline-block"
|
264
254
|
},
|
265
255
|
children: [/*#__PURE__*/_jsxs(Box, {
|
266
|
-
className: `btn textAlign-${tAlign} button theme-element`,
|
267
256
|
ref: buttonRef,
|
257
|
+
className: `btn textAlign-${tAlign}`,
|
268
258
|
sx: {
|
269
259
|
textDecoration: "none",
|
260
|
+
background: bgColor || "rgb(30, 75, 122)",
|
270
261
|
borderBlockStyle: "solid",
|
262
|
+
borderColor: borderColor || "transparent",
|
271
263
|
borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
|
272
264
|
...btnSp,
|
273
265
|
borderStyle: borderStyle || "solid",
|
266
|
+
color: `${textColor || "#FFFFFF"}`,
|
267
|
+
fontSize: textSize || "inherit",
|
268
|
+
fontFamily: fontFamily || "PoppinsRegular",
|
274
269
|
display: "inline-flex",
|
275
270
|
alignItems: "center",
|
276
271
|
position: "relative",
|
@@ -279,22 +274,11 @@ const EditorButton = props => {
|
|
279
274
|
display: "none"
|
280
275
|
},
|
281
276
|
"&:hover": {
|
282
|
-
color: `${textColorHover || textColor}`,
|
283
|
-
background: bgColorHover || bgColor,
|
277
|
+
color: `${textColorHover || textColor || "#FFFFFF"}`,
|
278
|
+
background: bgColorHover || bgColor || "rgb(30, 75, 122)",
|
284
279
|
"& .element-toolbar": {
|
285
280
|
display: "flex"
|
286
281
|
}
|
287
|
-
},
|
288
|
-
color: textColor ? `${textColor} !important` : "#FFFFFF",
|
289
|
-
fontSize: textSize ? `${textSize}px !important` : "inherit",
|
290
|
-
fontFamily: fontFamily ? `${fontFamily} !important` : "PoppinsRegular",
|
291
|
-
background: `${bgColor} !important`,
|
292
|
-
borderColor: `${borderColor} !important`,
|
293
|
-
borderRadius: {
|
294
|
-
...getBreakPointsValue(borderRadius || buttonTheme?.borderRadius || {}, null, "overrideBorderRadius", true)
|
295
|
-
},
|
296
|
-
padding: {
|
297
|
-
...getTRBLBreakPoints(bannerSpacing || buttonTheme?.bannerSpacing || {})
|
298
282
|
}
|
299
283
|
},
|
300
284
|
...buttonProps,
|
@@ -1,15 +1,11 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
|
-
import { Box, IconButton, Popover
|
2
|
+
import { Box, IconButton, Popover } from "@mui/material";
|
3
3
|
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
4
4
|
import Button from "../../common/Button";
|
5
5
|
import { colors } from "./defaultColors";
|
6
6
|
import ColorPicker from "./colorPicker.svg";
|
7
|
-
import { useSlateStatic } from "slate-react";
|
8
|
-
import { Transforms } from "slate";
|
9
|
-
import { useEditorContext } from "../../hooks/useMouseMove";
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
13
9
|
let c = [];
|
14
10
|
const ColorChunks = (recentColors = []) => [...recentColors, ...colors].reduce((a, b, i) => {
|
15
11
|
if (i % 7 === 0) {
|
@@ -114,18 +110,12 @@ const ColorButtons = props => {
|
|
114
110
|
openColorTool,
|
115
111
|
onClose,
|
116
112
|
onColorPickerClick,
|
117
|
-
disableEditTheme,
|
118
113
|
defaultColors = []
|
119
114
|
} = props;
|
120
115
|
const [row1, ...restRows] = ColorChunks([]);
|
121
116
|
const [anchorEl, setAnchorEl] = useState(null);
|
122
117
|
const open = Boolean(anchorEl);
|
123
118
|
const firstRow = defaultColors?.length ? defaultColors : row1;
|
124
|
-
const theme = useTheme();
|
125
|
-
const editor = useSlateStatic();
|
126
|
-
const {
|
127
|
-
setOpenTheme
|
128
|
-
} = useEditorContext();
|
129
119
|
const handleMore = e => {
|
130
120
|
setAnchorEl(e.currentTarget);
|
131
121
|
};
|
@@ -138,7 +128,6 @@ const ColorButtons = props => {
|
|
138
128
|
const handleSelect = color => () => {
|
139
129
|
onSelect(color);
|
140
130
|
};
|
141
|
-
const colorVars = theme?.vars?.colors || {};
|
142
131
|
return /*#__PURE__*/_jsxs(Box, {
|
143
132
|
component: "span",
|
144
133
|
sx: classes.colorButtons,
|
@@ -155,7 +144,7 @@ const ColorButtons = props => {
|
|
155
144
|
activeColor: activeColor
|
156
145
|
}, `si_btn_row1_${m}_${i}`);
|
157
146
|
})
|
158
|
-
}), /*#__PURE__*/
|
147
|
+
}), /*#__PURE__*/_jsxs(Popover, {
|
159
148
|
open: open || openColorTool,
|
160
149
|
anchorEl: anchorEl || openColorTool,
|
161
150
|
onClose: handleClose,
|
@@ -169,39 +158,9 @@ const ColorButtons = props => {
|
|
169
158
|
},
|
170
159
|
sx: classes.colorPopper,
|
171
160
|
className: "colorPopper",
|
172
|
-
children: /*#__PURE__*/
|
161
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
173
162
|
sx: classes.colorButtonsInner,
|
174
|
-
children:
|
175
|
-
children: [/*#__PURE__*/_jsxs(Box, {
|
176
|
-
component: "div",
|
177
|
-
className: "singleColorTitleWrapper",
|
178
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
179
|
-
variant: "subtitle2",
|
180
|
-
children: "Theme colours"
|
181
|
-
}), disableEditTheme ? null : /*#__PURE__*/_jsx("div", {
|
182
|
-
className: "editBtn",
|
183
|
-
onClick: () => {
|
184
|
-
Transforms.deselect(editor, {
|
185
|
-
at: editor.selection
|
186
|
-
});
|
187
|
-
setOpenTheme("editThemeColor");
|
188
|
-
},
|
189
|
-
children: "Edit"
|
190
|
-
})]
|
191
|
-
}), /*#__PURE__*/_jsx(SingleColorButton, {
|
192
|
-
crs: Object.values(colorVars),
|
193
|
-
handleSelect: handleSelect,
|
194
|
-
classes: classes,
|
195
|
-
activeColor: activeColor
|
196
|
-
})]
|
197
|
-
}) : null, /*#__PURE__*/_jsx(Box, {
|
198
|
-
component: "div",
|
199
|
-
className: "singleColorTitleWrapper",
|
200
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
201
|
-
variant: "subtitle2",
|
202
|
-
children: "Custom colour"
|
203
|
-
})
|
204
|
-
}), restRows.map((m, i) => {
|
163
|
+
children: restRows.map((m, i) => {
|
205
164
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
206
165
|
id: `p2_${id}`,
|
207
166
|
crs: m,
|
@@ -210,18 +169,14 @@ const ColorButtons = props => {
|
|
210
169
|
classes: classes,
|
211
170
|
activeColor: activeColor
|
212
171
|
}, `si_btn_${m}_${i}`);
|
213
|
-
})
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
alt: "color wheel"
|
222
|
-
})
|
223
|
-
}) : null]
|
224
|
-
})
|
172
|
+
})
|
173
|
+
}), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
|
174
|
+
onClick: onColorPickerClick,
|
175
|
+
children: /*#__PURE__*/_jsx("img", {
|
176
|
+
src: ColorPicker,
|
177
|
+
alt: "color wheel"
|
178
|
+
})
|
179
|
+
}) : null]
|
225
180
|
})]
|
226
181
|
});
|
227
182
|
};
|