@flozy/editor 7.0.9 → 8.0.1
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 +106 -33
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +32 -16
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +25 -9
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +57 -12
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +15 -0
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +111 -29
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- package/dist/Editor/Elements/Embed/Image.js +2 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -14
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +2 -1
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/GridItem.js +2 -3
- package/dist/Editor/Elements/Link/Link.js +70 -43
- package/dist/Editor/Elements/SimpleText/index.js +7 -12
- 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 +13 -1
- package/dist/Editor/Elements/Variables/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/Styles/EditorStyles.js +287 -291
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +7 -15
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +9 -8
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +210 -85
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +56 -9
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +31 -38
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +35 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +90 -0
- package/dist/Editor/common/CustomDialog/style.js +67 -0
- package/dist/Editor/common/CustomDialog/styles.js +80 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/DnD/Draggable.js +0 -1
- package/dist/Editor/common/FontLoader/FontList.js +3 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +74 -42
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -2
- package/dist/Editor/common/MentionsPopup/Styles.js +6 -12
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +5 -4
- package/dist/Editor/common/RnD/Utils/index.js +45 -0
- package/dist/Editor/common/RnD/index.js +23 -3
- package/dist/Editor/common/Section/index.js +60 -89
- package/dist/Editor/common/Shorthands/elements.js +54 -0
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +35 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/commonStyle.js +55 -65
- package/dist/Editor/helper/deserialize/index.js +1 -1
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +5 -9
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +283 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +220 -0
- package/dist/Editor/themeSettings/fonts/style.js +44 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +320 -0
- package/dist/Editor/themeSettings/style.js +152 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +356 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +157 -49
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +59 -19
- package/dist/Editor/utils/link.js +1 -1
- package/package.json +5 -2
@@ -1,6 +1,6 @@
|
|
1
|
-
import React, { useCallback, useMemo, useRef, useState,
|
2
|
-
import { Editable, Slate, ReactEditor } from
|
3
|
-
import { createEditor, Transforms, Editor } from
|
1
|
+
import React, { useCallback, useMemo, useRef, useState, 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
|
44
|
+
const [value] = 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 } from "react";
|
2
|
+
import React, { useRef, useCallback, useEffect, useMemo, useState, forwardRef, useImperativeHandle, createContext } 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 } from "@mui/material";
|
20
|
+
import { Box, Typography, useTheme, IconButton } 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,9 +26,12 @@ 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 {
|
30
|
-
import { getInitialValue, handleInsertLastElement, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
|
29
|
+
import { getTRBLBreakPoints, getVariableValue, getBreakpointLineSpacing } from "./helper/theme";
|
30
|
+
import { getInitialValue, handleInsertLastElement, isEverythingSelected, 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";
|
32
35
|
import PopoverAIInput from "./Elements/AI/PopoverAIInput";
|
33
36
|
import RnDCopy from "./common/RnD/RnDCopy";
|
34
37
|
import SwitchViewport from "./common/RnD/SwitchViewport/SwitchViewport";
|
@@ -37,8 +40,11 @@ import "./font.css";
|
|
37
40
|
import "./Editor.css";
|
38
41
|
import "animate.css";
|
39
42
|
import FontLoader from "./common/FontLoader/FontLoader";
|
43
|
+
import { ThemeAIIcon, ThemePaintIcon } from "./assets/svg/ThemeIcons";
|
44
|
+
import { CustomDialogComponent } from "./common/CustomDialog";
|
40
45
|
import { jsx as _jsx } from "react/jsx-runtime";
|
41
46
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
47
|
+
export const ThemeContext = /*#__PURE__*/createContext(null);
|
42
48
|
const Item = /*#__PURE__*/forwardRef(({
|
43
49
|
children,
|
44
50
|
...props
|
@@ -54,13 +60,14 @@ const Item = /*#__PURE__*/forwardRef(({
|
|
54
60
|
});
|
55
61
|
});
|
56
62
|
Item.displayName = "Item";
|
57
|
-
const Element = props => {
|
63
|
+
const Element = /*#__PURE__*/React.memo(props => {
|
58
64
|
return /*#__PURE__*/_jsx(Section, {
|
59
65
|
...props,
|
60
66
|
children: getBlock(props)
|
61
67
|
});
|
62
|
-
};
|
63
|
-
|
68
|
+
});
|
69
|
+
Element.displayName = "Element";
|
70
|
+
const Leaf = /*#__PURE__*/React.memo(({
|
64
71
|
attributes,
|
65
72
|
children,
|
66
73
|
leaf
|
@@ -71,12 +78,13 @@ const Leaf = ({
|
|
71
78
|
...attributes,
|
72
79
|
children: children
|
73
80
|
});
|
74
|
-
};
|
81
|
+
});
|
82
|
+
Leaf.displayName = "Leaf";
|
75
83
|
const updateTopBanner = (content = [], setTopBanner) => {
|
76
|
-
setTopBanner(() => {
|
77
|
-
|
78
|
-
|
79
|
-
});
|
84
|
+
// setTopBanner(() => {
|
85
|
+
// const firstNode = content ? content[0] : {};
|
86
|
+
// return firstNode?.type === "topbanner" ? firstNode : null;
|
87
|
+
// });
|
80
88
|
};
|
81
89
|
const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
82
90
|
const {
|
@@ -91,13 +99,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
91
99
|
otherProps,
|
92
100
|
isIframe,
|
93
101
|
theme,
|
94
|
-
|
95
|
-
|
102
|
+
showThemeButtons,
|
103
|
+
showViewport = false
|
96
104
|
} = props;
|
97
105
|
const editorWrapper = useRef();
|
98
106
|
const mentionsRef = useRef();
|
99
107
|
const convertedContent = draftToSlate({
|
100
|
-
data: content
|
108
|
+
data: content,
|
109
|
+
needLayout: otherProps?.needLayout
|
101
110
|
});
|
102
111
|
const [value, setValue] = useState(convertedContent);
|
103
112
|
const [isInteracted, setIsInteracted] = useState(false);
|
@@ -112,6 +121,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
112
121
|
const [breakpoint, setBreakpoint] = useState("");
|
113
122
|
const [topBanner, setTopBanner] = useState();
|
114
123
|
const debouncedValue = useRef(value);
|
124
|
+
const dialogRef = useRef(null);
|
115
125
|
const [size] = useWindowResize();
|
116
126
|
const {
|
117
127
|
needDotsBG,
|
@@ -137,10 +147,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
137
147
|
const {
|
138
148
|
bannerSpacing,
|
139
149
|
pageBgImage,
|
140
|
-
pageColor,
|
150
|
+
pageColor = "",
|
141
151
|
color: pageTextColor,
|
142
152
|
pageWidth,
|
143
153
|
maxWidth: pageMaxWidth,
|
154
|
+
theme: selectedTheme,
|
144
155
|
lineHeight
|
145
156
|
} = pageSt?.pageProps || {
|
146
157
|
bannerSpacing: {
|
@@ -152,10 +163,16 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
152
163
|
};
|
153
164
|
const classes = editorStyles({
|
154
165
|
padHeight: !fullScreen ? otherProps?.padHeight : 20,
|
155
|
-
placeHolderColor: invertColor(pageColor || "#FFF"),
|
156
|
-
theme
|
157
|
-
overrideWrapperStyles
|
166
|
+
placeHolderColor: invertColor(pageColor.startsWith("var") ? getVariableValue(pageColor) : pageColor || "#FFF"),
|
167
|
+
theme
|
158
168
|
});
|
169
|
+
const [openTheme, setOpenTheme] = useState(false);
|
170
|
+
const [openAITheme, setOpenAITheme] = useState(false);
|
171
|
+
const [, setThemeUpdated] = useState(0);
|
172
|
+
const triggerRender = () => {
|
173
|
+
setThemeUpdated(prev => prev + 1); // Incrementing forces a re-render while updating theme
|
174
|
+
};
|
175
|
+
|
159
176
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
160
177
|
useEffect(() => {
|
161
178
|
setValue(draftToSlate({
|
@@ -169,11 +186,11 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
169
186
|
const debounced = useDebouncedCallback(
|
170
187
|
// function
|
171
188
|
value => {
|
189
|
+
debouncedValue.current = value;
|
172
190
|
const {
|
173
191
|
value: strVal,
|
174
192
|
...restVal
|
175
193
|
} = getOnSaveData(value);
|
176
|
-
debouncedValue.current = value;
|
177
194
|
onSave(strVal, restVal);
|
178
195
|
},
|
179
196
|
// delay in ms
|
@@ -184,7 +201,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
184
201
|
return {
|
185
202
|
value: JSON.stringify(val),
|
186
203
|
text: text,
|
187
|
-
title: serializeToText(title?.children) || "
|
204
|
+
title: serializeToText(title?.children) || ""
|
188
205
|
};
|
189
206
|
};
|
190
207
|
const getPreviewImage = async (needBackground = false, options = {}) => {
|
@@ -283,6 +300,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
283
300
|
redo() {
|
284
301
|
editor?.redo();
|
285
302
|
},
|
303
|
+
toggleTheme() {
|
304
|
+
setOpenTheme(!openTheme);
|
305
|
+
},
|
306
|
+
toggleAITheme() {
|
307
|
+
setOpenAITheme(!openAITheme);
|
308
|
+
},
|
286
309
|
getPageSettings: {
|
287
310
|
background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
|
288
311
|
}
|
@@ -314,7 +337,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
314
337
|
updateTopBanner(newValue, setTopBanner);
|
315
338
|
debounced(newValue);
|
316
339
|
if (!isInteracted) {
|
317
|
-
setIsInteracted(true);
|
340
|
+
// setIsInteracted(true);
|
318
341
|
}
|
319
342
|
}
|
320
343
|
};
|
@@ -353,6 +376,15 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
353
376
|
...partialState
|
354
377
|
}));
|
355
378
|
};
|
379
|
+
const handleDeleteAll = () => {
|
380
|
+
const {
|
381
|
+
selection
|
382
|
+
} = editor;
|
383
|
+
if (selection) {
|
384
|
+
editor.deleteFragment();
|
385
|
+
dialogRef.current?.handleClose();
|
386
|
+
}
|
387
|
+
};
|
356
388
|
const onKeyDown = useCallback(event => {
|
357
389
|
const isMetaKey = event.metaKey && event.keyCode >= 65 && event.keyCode <= 90;
|
358
390
|
const isCtrlKey = event.ctrlKey || isMetaKey;
|
@@ -399,14 +431,19 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
399
431
|
const {
|
400
432
|
selection
|
401
433
|
} = editor;
|
434
|
+
const everythingSelect = isEverythingSelected(editor);
|
402
435
|
event.preventDefault();
|
403
|
-
if (
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
}
|
436
|
+
if (everythingSelect) {
|
437
|
+
dialogRef.current?.handleOpen();
|
438
|
+
} else {
|
439
|
+
if (selection) {
|
440
|
+
if (!Range.isCollapsed(selection)) {
|
441
|
+
editor.deleteFragment();
|
442
|
+
} else {
|
443
|
+
editor.deleteBackward({
|
444
|
+
unit: "character"
|
445
|
+
});
|
446
|
+
}
|
410
447
|
}
|
411
448
|
}
|
412
449
|
}
|
@@ -458,6 +495,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
458
495
|
}
|
459
496
|
return style;
|
460
497
|
}, [pageBgImage, pageColor]);
|
498
|
+
const themeProps = getTheme(selectedTheme);
|
461
499
|
|
462
500
|
// const handleContextMenu = (e) => {
|
463
501
|
// if (!readOnly) {
|
@@ -487,14 +525,30 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
487
525
|
console.log("handleCursorScroll", err);
|
488
526
|
}
|
489
527
|
};
|
490
|
-
return /*#__PURE__*/
|
528
|
+
return /*#__PURE__*/_jsxs(EditorProvider, {
|
491
529
|
theme: theme,
|
492
530
|
editor: editor,
|
493
|
-
|
531
|
+
openTheme: openTheme,
|
532
|
+
setOpenTheme: setOpenTheme,
|
533
|
+
triggerRender: triggerRender,
|
534
|
+
children: [showThemeButtons ? /*#__PURE__*/_jsxs("div", {
|
535
|
+
className: "theme-buttons",
|
536
|
+
children: [/*#__PURE__*/_jsx(IconButton, {
|
537
|
+
onClick: () => setOpenTheme(true),
|
538
|
+
children: /*#__PURE__*/_jsx(ThemePaintIcon, {})
|
539
|
+
}), /*#__PURE__*/_jsx(IconButton, {
|
540
|
+
onClick: () => setOpenAITheme(true),
|
541
|
+
style: {
|
542
|
+
marginTop: "4px"
|
543
|
+
},
|
544
|
+
children: /*#__PURE__*/_jsx(ThemeAIIcon, {})
|
545
|
+
})]
|
546
|
+
}) : null, /*#__PURE__*/_jsx(DialogWrapper, {
|
494
547
|
classes: classes,
|
495
548
|
...props,
|
496
549
|
fullScreen: fullScreen,
|
497
550
|
footer: footer || "",
|
551
|
+
selectedTheme: selectedTheme,
|
498
552
|
children: /*#__PURE__*/_jsx(Box, {
|
499
553
|
component: "div",
|
500
554
|
className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
|
@@ -524,6 +578,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
524
578
|
children: /*#__PURE__*/_jsxs(Box, {
|
525
579
|
component: "div",
|
526
580
|
className: "max-content",
|
581
|
+
sx: themeProps?.sxProps || {},
|
527
582
|
"data-info": outsideEditorClickLabel,
|
528
583
|
children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
|
529
584
|
className: "scroll-area",
|
@@ -590,6 +645,15 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
590
645
|
"data-info": outsideEditorClickLabel,
|
591
646
|
onClick: handleFooterClick,
|
592
647
|
children: footer
|
648
|
+
}), openTheme ? /*#__PURE__*/_jsx(ThemeSettings, {
|
649
|
+
open: openTheme,
|
650
|
+
setOpen: setOpenTheme,
|
651
|
+
editor: editor,
|
652
|
+
services: otherProps?.services
|
653
|
+
}) : null, /*#__PURE__*/_jsx(ThemeSettingsAI, {
|
654
|
+
openAITheme: openAITheme,
|
655
|
+
setOpenAITheme: setOpenAITheme,
|
656
|
+
onSaveTheme: otherProps?.onSaveTheme
|
593
657
|
})]
|
594
658
|
})
|
595
659
|
}), !readOnly ? /*#__PURE__*/_jsx(PopupTool, {
|
@@ -598,8 +662,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
598
662
|
setIsTextSelected: setIsTextSelected,
|
599
663
|
customProps: customProps,
|
600
664
|
editorWrapper: editorWrapper
|
601
|
-
}) : null, !readOnly
|
665
|
+
}) : null, !readOnly ? /*#__PURE__*/_jsx(SwitchViewport, {
|
602
666
|
breakpoint: breakpoint,
|
667
|
+
show: showViewport,
|
603
668
|
onChange: b => onSwitchBreakpoint(b)
|
604
669
|
}) : null]
|
605
670
|
})
|
@@ -611,7 +676,15 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
611
676
|
})]
|
612
677
|
}, id)
|
613
678
|
})
|
614
|
-
})
|
679
|
+
}), /*#__PURE__*/_jsx(CustomDialogComponent, {
|
680
|
+
ref: dialogRef,
|
681
|
+
content: "Are you sure you want to delete All the content?",
|
682
|
+
confirmText: "Delete",
|
683
|
+
cancelText: "Cancel",
|
684
|
+
onConfirm: () => {
|
685
|
+
handleDeleteAll();
|
686
|
+
}
|
687
|
+
})]
|
615
688
|
});
|
616
689
|
});
|
617
690
|
CommonEditor.displayName = "CommonEditor";
|
@@ -2,6 +2,7 @@ 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";
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
8
|
const DialogWrapper = props => {
|
@@ -9,40 +10,45 @@ const DialogWrapper = props => {
|
|
9
10
|
fullScreen,
|
10
11
|
onClose,
|
11
12
|
children,
|
12
|
-
classes
|
13
|
+
classes,
|
14
|
+
selectedTheme
|
13
15
|
} = props;
|
14
|
-
return fullScreen ? /*#__PURE__*/
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
},
|
22
|
-
sx: classes.fullScreenWrapper,
|
23
|
-
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
16
|
+
return fullScreen ? /*#__PURE__*/_jsx(MainThemeProvider, {
|
17
|
+
userSelectedTheme: selectedTheme,
|
18
|
+
children: /*#__PURE__*/_jsxs(Dialog, {
|
19
|
+
className: `dialogComp`,
|
20
|
+
open: fullScreen,
|
21
|
+
fullScreen: fullScreen,
|
22
|
+
onClose: onClose,
|
24
23
|
style: {
|
25
|
-
|
24
|
+
zIndex: 1000
|
26
25
|
},
|
27
|
-
|
26
|
+
sx: classes.fullScreenWrapper,
|
27
|
+
children: [/*#__PURE__*/_jsx(DialogTitle, {
|
28
|
+
style: {
|
29
|
+
padding: "6px 8px"
|
30
|
+
},
|
28
31
|
children: /*#__PURE__*/_jsx(Grid, {
|
29
|
-
|
30
|
-
display: "flex",
|
31
|
-
justifyContent: "end"
|
32
|
-
},
|
33
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
34
|
-
onClick: onClose,
|
32
|
+
children: /*#__PURE__*/_jsx(Grid, {
|
35
33
|
style: {
|
36
|
-
|
34
|
+
display: "flex",
|
35
|
+
justifyContent: "end"
|
37
36
|
},
|
38
|
-
children: /*#__PURE__*/_jsx(
|
37
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
38
|
+
onClick: onClose,
|
39
|
+
style: {
|
40
|
+
background: "rgba(255,255,255,0.5)"
|
41
|
+
},
|
42
|
+
children: /*#__PURE__*/_jsx(CloseIcon, {})
|
43
|
+
})
|
39
44
|
})
|
40
45
|
})
|
41
|
-
})
|
42
|
-
|
43
|
-
|
44
|
-
})
|
46
|
+
}), /*#__PURE__*/_jsx(DialogContent, {
|
47
|
+
children: children
|
48
|
+
})]
|
49
|
+
})
|
45
50
|
}) : /*#__PURE__*/_jsx(ViewportStimulator, {
|
51
|
+
selectedTheme: selectedTheme,
|
46
52
|
children: children
|
47
53
|
});
|
48
54
|
};
|
package/dist/Editor/Editor.css
CHANGED
@@ -1263,6 +1263,19 @@ 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
|
+
}
|
1266
1279
|
.hideScroll {
|
1267
1280
|
overflow-anchor: none;
|
1268
1281
|
}
|
@@ -1278,21 +1291,6 @@ blockquote {
|
|
1278
1291
|
.hideScroll::-webkit-scrollbar-thumb:hover {
|
1279
1292
|
background: none !important;
|
1280
1293
|
}
|
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
|
-
}
|
1296
1294
|
|
1297
1295
|
.custom-scroll::-webkit-scrollbar {
|
1298
1296
|
height: .6rem;
|
@@ -1339,4 +1337,22 @@ code.markcode {
|
|
1339
1337
|
display: block;
|
1340
1338
|
background-color: #f3f3f3;
|
1341
1339
|
font-family: 'Source Code Pro' !important;
|
1342
|
-
}
|
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
|
+
}
|
@@ -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 || "#000000",
|
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 || "#000",
|
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 || "#000",
|
339
339
|
background: bgColorHover || bgColor || "none",
|
340
340
|
"& .m-settings": {
|
341
341
|
display: "block"
|
@@ -9,6 +9,8 @@ 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";
|
12
14
|
import Icon from "../../common/Icon";
|
13
15
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
14
16
|
import useCommonStyle from "../../commonStyle";
|
@@ -38,6 +40,12 @@ const EditorButton = props => {
|
|
38
40
|
const [openNav, setOpenNav] = useState(false);
|
39
41
|
const [openMoreOptions, setOpenMoreOptions] = useState(false);
|
40
42
|
const classes = useCommonStyle(appTheme);
|
43
|
+
const {
|
44
|
+
theme: selectedTheme
|
45
|
+
} = useEditorTheme();
|
46
|
+
const {
|
47
|
+
buttonTheme
|
48
|
+
} = getTheme(selectedTheme);
|
41
49
|
const {
|
42
50
|
label,
|
43
51
|
bgColor,
|
@@ -51,7 +59,7 @@ const EditorButton = props => {
|
|
51
59
|
fontFamily,
|
52
60
|
textColorHover,
|
53
61
|
bgColorHover,
|
54
|
-
buttonIcon,
|
62
|
+
// buttonIcon,
|
55
63
|
iconPosition = "start",
|
56
64
|
borderStyle,
|
57
65
|
borderWidth,
|
@@ -72,6 +80,7 @@ const EditorButton = props => {
|
|
72
80
|
};
|
73
81
|
const isTrigger = linkType === "nextTrigger" || linkType === "prevTrigger";
|
74
82
|
const refURl = isTrigger ? buttonLink?.url : url;
|
83
|
+
const buttonIcon = element?.buttonIcon || buttonTheme?.buttonIcon;
|
75
84
|
const BtnIcon = buttonIcon ? buttonIcon : null;
|
76
85
|
windowVar.lastButtonProps = element;
|
77
86
|
const handleTrigger = async () => {
|
@@ -162,6 +171,7 @@ const EditorButton = props => {
|
|
162
171
|
display: "inline-flex",
|
163
172
|
color: "rgba(0, 0, 0, 0.54)",
|
164
173
|
marginBottom: "0px !important",
|
174
|
+
...classes.buttonMoreOption,
|
165
175
|
...classes.buttonMoreOption3
|
166
176
|
},
|
167
177
|
...btnProps,
|
@@ -253,19 +263,14 @@ const EditorButton = props => {
|
|
253
263
|
display: "inline-block"
|
254
264
|
},
|
255
265
|
children: [/*#__PURE__*/_jsxs(Box, {
|
266
|
+
className: `btn textAlign-${tAlign} button theme-element`,
|
256
267
|
ref: buttonRef,
|
257
|
-
className: `btn textAlign-${tAlign}`,
|
258
268
|
sx: {
|
259
269
|
textDecoration: "none",
|
260
|
-
background: bgColor || "rgb(30, 75, 122)",
|
261
270
|
borderBlockStyle: "solid",
|
262
|
-
borderColor: borderColor || "transparent",
|
263
271
|
borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
|
264
272
|
...btnSp,
|
265
273
|
borderStyle: borderStyle || "solid",
|
266
|
-
color: `${textColor || "#FFFFFF"}`,
|
267
|
-
fontSize: textSize || "inherit",
|
268
|
-
fontFamily: fontFamily || "PoppinsRegular",
|
269
274
|
display: "inline-flex",
|
270
275
|
alignItems: "center",
|
271
276
|
position: "relative",
|
@@ -274,11 +279,22 @@ const EditorButton = props => {
|
|
274
279
|
display: "none"
|
275
280
|
},
|
276
281
|
"&:hover": {
|
277
|
-
color: `${textColorHover || textColor
|
278
|
-
background: bgColorHover || bgColor
|
282
|
+
color: `${textColorHover || textColor}`,
|
283
|
+
background: bgColorHover || bgColor,
|
279
284
|
"& .element-toolbar": {
|
280
285
|
display: "flex"
|
281
286
|
}
|
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 || {})
|
282
298
|
}
|
283
299
|
},
|
284
300
|
...buttonProps,
|