@flozy/editor 9.1.2 → 9.1.3
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 +19 -2
- package/dist/Editor/CommonEditor.js +104 -37
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +21 -3
- 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 +5 -5
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +19 -9
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +32 -2
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +126 -29
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- 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 +0 -1
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +43 -27
- package/dist/Editor/Elements/Table/TableCell.js +4 -3
- package/dist/Editor/Elements/Title/title.js +13 -31
- package/dist/Editor/Elements/Variables/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- 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/Mini/MiniToolbar.js +1 -0
- 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 +54 -7
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +5 -10
- 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/styles.js +80 -0
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -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/FontLoader.js +3 -0
- 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 +9 -10
- 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/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 +114 -69
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useDrag.js +17 -11
- package/dist/Editor/hooks/useEditorScroll.js +0 -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 +19 -14
- 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 +150 -37
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +59 -27
- package/dist/Editor/utils/link.js +1 -1
- package/dist/Editor/utils/table.js +8 -0
- package/package.json +6 -3
@@ -1,8 +1,32 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Select, MenuItem } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
3
|
+
import { addMarkData, activeMark, getSelectedElementStyle } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { toolbarGroups } from "../toolbarGroups.js";
|
4
5
|
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
6
|
+
import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList.js";
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
const allTools = toolbarGroups.flat();
|
9
|
+
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
10
|
+
export const getValue = (editor, format) => {
|
11
|
+
switch (format) {
|
12
|
+
case "fontFamily":
|
13
|
+
{
|
14
|
+
const style = getSelectedElementStyle("font-family", editor);
|
15
|
+
return style || defaultFonts[0];
|
16
|
+
}
|
17
|
+
case "fontWeight":
|
18
|
+
{
|
19
|
+
const {
|
20
|
+
options
|
21
|
+
} = fontWeight || {};
|
22
|
+
const fontWeightStyle = getSelectedElementStyle("font-weight", editor);
|
23
|
+
const selected = options?.find(o => o.value === fontWeightStyle || o.numVal === fontWeightStyle);
|
24
|
+
return selected?.value;
|
25
|
+
}
|
26
|
+
default:
|
27
|
+
return activeMark(editor, format);
|
28
|
+
}
|
29
|
+
};
|
6
30
|
const Dropdown = ({
|
7
31
|
classes,
|
8
32
|
editor,
|
@@ -10,7 +34,7 @@ const Dropdown = ({
|
|
10
34
|
options,
|
11
35
|
width
|
12
36
|
}) => {
|
13
|
-
const value =
|
37
|
+
const value = getValue(editor, format);
|
14
38
|
const changeMarkData = (event, format) => {
|
15
39
|
event.preventDefault();
|
16
40
|
const value = event.target.value;
|
@@ -20,7 +44,7 @@ const Dropdown = ({
|
|
20
44
|
});
|
21
45
|
};
|
22
46
|
return /*#__PURE__*/_jsx(Select, {
|
23
|
-
value: value,
|
47
|
+
value: value || options?.[0]?.value,
|
24
48
|
className: "editor-dd",
|
25
49
|
onChange: e => changeMarkData(e, format),
|
26
50
|
MenuProps: {
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Autocomplete, TextField } from "@mui/material";
|
3
|
-
import {
|
3
|
+
import { addMarkData } from "../../utils/SlateUtilityFunctions.js";
|
4
4
|
import usePopupStyle from "../PopupTool/PopupToolStyle.js";
|
5
5
|
import { useEditorContext } from "../../hooks/useMouseMove.js";
|
6
|
-
import KeyboardArrowDownRoundedIcon from
|
6
|
+
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
7
|
+
import { getValue } from "./Dropdown.js";
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
9
|
const FontFamilyAutocomplete = ({
|
9
10
|
editor,
|
@@ -14,7 +15,7 @@ const FontFamilyAutocomplete = ({
|
|
14
15
|
val = "",
|
15
16
|
webFont = false
|
16
17
|
}) => {
|
17
|
-
const markValue =
|
18
|
+
const markValue = getValue(editor, format);
|
18
19
|
const value = !webFont ? markValue : val;
|
19
20
|
const changeMarkData = (event, newValue, format) => {
|
20
21
|
if (!webFont) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import Icon from "../../common/Icon";
|
3
3
|
import Button from "../../common/Button";
|
4
|
-
import { toggleMark,
|
4
|
+
import { toggleMark, isMarkBtnActive } from "../../utils/SlateUtilityFunctions.js";
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
const MarkButton = ({
|
7
7
|
editor,
|
@@ -9,7 +9,7 @@ const MarkButton = ({
|
|
9
9
|
title
|
10
10
|
}) => {
|
11
11
|
return /*#__PURE__*/_jsx(Button, {
|
12
|
-
active:
|
12
|
+
active: isMarkBtnActive(editor, format),
|
13
13
|
format: format,
|
14
14
|
onMouseDown: e => {
|
15
15
|
e.preventDefault();
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
2
2
|
import { TextField, IconButton } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark
|
4
|
-
import {
|
5
|
-
import ExpandLessRoundedIcon from "@mui/icons-material/ExpandLessRounded";
|
6
|
-
import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded";
|
7
|
-
import { getBreakPointsValue } from "../../helper/theme.js";
|
3
|
+
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { getBreakPointsValue, getTextSizeVal } from "../../helper/theme.js";
|
8
5
|
import useWindowResize from "../../hooks/useWindowResize.js";
|
9
6
|
import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
|
10
7
|
import { TextSizeDownArrow, TextSizeUpArrow } from "../../common/iconListV2.js";
|
@@ -17,11 +14,12 @@ const TextSize = ({
|
|
17
14
|
format,
|
18
15
|
fullWidth
|
19
16
|
}) => {
|
20
|
-
const [size] = useWindowResize();
|
21
|
-
const val = activeMark(editor, format);
|
22
|
-
const value = getBreakPointsValue(val, size?.device);
|
23
17
|
const [fontSize, setFontSize] = useState();
|
24
18
|
const timerRef = useRef();
|
19
|
+
const [size] = useWindowResize();
|
20
|
+
const val = activeMark(editor, format);
|
21
|
+
const noFontSize = val === "normal" || typeof val === "object" && !Object.keys(val)?.length;
|
22
|
+
const value = noFontSize ? getTextSizeVal(editor) : getBreakPointsValue(val, size?.device);
|
25
23
|
useEffect(() => {
|
26
24
|
setFontSize(getSizeVal());
|
27
25
|
}, [value]);
|
@@ -57,13 +55,7 @@ const TextSize = ({
|
|
57
55
|
};
|
58
56
|
const getSizeVal = () => {
|
59
57
|
try {
|
60
|
-
|
61
|
-
Object.entries(headingMap).forEach(([format, value]) => {
|
62
|
-
if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
|
63
|
-
size = value;
|
64
|
-
}
|
65
|
-
});
|
66
|
-
return parseInt(size);
|
58
|
+
return parseInt(value);
|
67
59
|
} catch (err) {
|
68
60
|
return "";
|
69
61
|
}
|
@@ -3,17 +3,18 @@ import { Grid, Tabs, Tab, CircularProgress } from "@mui/material";
|
|
3
3
|
import TemplateCard from "./TemplateCard";
|
4
4
|
import FullViewCard from "./FullViewCard";
|
5
5
|
import ButtonTemplateCard from "./ButtonTemplatesCard";
|
6
|
+
|
7
|
+
// const CATEGORIES_SORT_INDEX = {
|
8
|
+
// Brief: 1,
|
9
|
+
// Buttons: 2,
|
10
|
+
// Banners: 3,
|
11
|
+
// Tables: 4,
|
12
|
+
// Contract: 5,
|
13
|
+
// Proposal: 6,
|
14
|
+
// };
|
6
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
8
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
|
-
const CATEGORIES_SORT_INDEX = {
|
10
|
-
Brief: 1,
|
11
|
-
Buttons: 2,
|
12
|
-
Banners: 3,
|
13
|
-
Tables: 4,
|
14
|
-
Contract: 5,
|
15
|
-
Proposal: 6
|
16
|
-
};
|
17
18
|
const Categories = props => {
|
18
19
|
const {
|
19
20
|
value,
|
@@ -1,10 +1,9 @@
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
2
|
-
import { activeMark, addMarkData
|
2
|
+
import { activeMark, addMarkData } from "../../../utils/SlateUtilityFunctions";
|
3
3
|
import { Button, IconButton, Popover, TextField } from "@mui/material";
|
4
4
|
import DownArrowIcon from "../../../assets/svg/DownArrowIcon";
|
5
5
|
import useWindowResize from "../../../hooks/useWindowResize";
|
6
|
-
import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
|
7
|
-
import { headingMap, sizeMap } from "../../../utils/font";
|
6
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue, getTextSizeVal } from "../../../helper/theme";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
9
|
const fontSizeOptions = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 26, 32, 36, 40, 48, 64, 96, 128];
|
@@ -19,7 +18,7 @@ function SelectFontSize({
|
|
19
18
|
const containerRef = useRef();
|
20
19
|
const [size] = useWindowResize();
|
21
20
|
const val = activeMark(editor, format);
|
22
|
-
const value =
|
21
|
+
const value = getTextSizeVal(editor);
|
23
22
|
const timerRef = useRef();
|
24
23
|
const updateMarkData = newVal => {
|
25
24
|
let upData = {
|
@@ -53,13 +52,7 @@ function SelectFontSize({
|
|
53
52
|
};
|
54
53
|
const getSizeVal = () => {
|
55
54
|
try {
|
56
|
-
|
57
|
-
Object.entries(headingMap).forEach(([format, value]) => {
|
58
|
-
if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
|
59
|
-
size = value;
|
60
|
-
}
|
61
|
-
});
|
62
|
-
return isNaN(parseInt(size)) ? 14 : parseInt(size);
|
55
|
+
return parseInt(value);
|
63
56
|
} catch (err) {
|
64
57
|
return "";
|
65
58
|
}
|
@@ -97,8 +90,8 @@ function SelectFontSize({
|
|
97
90
|
anchorEl: anchorEl,
|
98
91
|
onClose: () => setAnchorEl(null),
|
99
92
|
anchorOrigin: {
|
100
|
-
vertical:
|
101
|
-
horizontal:
|
93
|
+
vertical: "bottom",
|
94
|
+
horizontal: "left"
|
102
95
|
},
|
103
96
|
sx: classes.customSelectPopoverWrapper,
|
104
97
|
children: fontSizeOptions.map((s, i) => {
|
@@ -2,8 +2,11 @@ import { useMemo } from "react";
|
|
2
2
|
import { activeMark, addMarkData, isBlockActive, toggleBlock } from "../../../utils/SlateUtilityFunctions";
|
3
3
|
import CustomSelectTool from "./CustomSelectTool";
|
4
4
|
import useWindowResize from "../../../hooks/useWindowResize";
|
5
|
-
import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
|
5
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue, isTextCustomized as isCustomized, textThemeFields as themeFields } from "../../../helper/theme";
|
6
6
|
import { sizeMap } from "../../../utils/font";
|
7
|
+
import { Editor } from "slate";
|
8
|
+
import { useEditorTheme } from "../../../hooks/useEditorTheme";
|
9
|
+
import { MenuItem, Select } from "@mui/material";
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
12
|
function Label({
|
@@ -17,93 +20,190 @@ function Label({
|
|
17
20
|
});
|
18
21
|
}
|
19
22
|
function DisplayHeaderLabel({
|
20
|
-
type
|
23
|
+
type,
|
24
|
+
isCustomized,
|
25
|
+
isPara = false
|
21
26
|
}) {
|
22
27
|
return /*#__PURE__*/_jsxs("div", {
|
23
|
-
children: ["H", /*#__PURE__*/_jsx("sub", {
|
28
|
+
children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
|
24
29
|
children: type
|
25
30
|
})]
|
26
31
|
});
|
27
32
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
},
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
type: "
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
},
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
33
|
+
function getTypographyOptions(isCustomized) {
|
34
|
+
const typographyOptions = [{
|
35
|
+
id: 11,
|
36
|
+
format: "headingOne",
|
37
|
+
type: "block",
|
38
|
+
title: /*#__PURE__*/_jsx(Label, {
|
39
|
+
label: "H1",
|
40
|
+
type: "Heading"
|
41
|
+
}),
|
42
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
43
|
+
type: 1,
|
44
|
+
isCustomized: isCustomized
|
45
|
+
}),
|
46
|
+
group: "typography",
|
47
|
+
value: "headingOne"
|
48
|
+
}, {
|
49
|
+
id: 12,
|
50
|
+
format: "headingTwo",
|
51
|
+
type: "block",
|
52
|
+
title: /*#__PURE__*/_jsx(Label, {
|
53
|
+
label: "H2",
|
54
|
+
type: "Heading"
|
55
|
+
}),
|
56
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
57
|
+
type: 2,
|
58
|
+
isCustomized: isCustomized
|
59
|
+
}),
|
60
|
+
group: "typography",
|
61
|
+
value: "headingTwo"
|
62
|
+
}, {
|
63
|
+
id: 13,
|
64
|
+
format: "headingThree",
|
65
|
+
type: "block",
|
66
|
+
title: /*#__PURE__*/_jsx(Label, {
|
67
|
+
label: "H3",
|
68
|
+
type: "Heading"
|
69
|
+
}),
|
70
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
71
|
+
type: 3,
|
72
|
+
isCustomized: isCustomized
|
73
|
+
}),
|
74
|
+
group: "typography",
|
75
|
+
value: "headingThree"
|
76
|
+
}, {
|
77
|
+
id: 17,
|
78
|
+
format: "headingFour",
|
79
|
+
type: "block",
|
80
|
+
title: /*#__PURE__*/_jsx(Label, {
|
81
|
+
label: "H4",
|
82
|
+
type: "Heading"
|
83
|
+
}),
|
84
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
85
|
+
type: 4,
|
86
|
+
isCustomized: isCustomized
|
87
|
+
}),
|
88
|
+
group: "typography",
|
89
|
+
value: "headingFour"
|
90
|
+
}, {
|
91
|
+
id: 18,
|
92
|
+
format: "headingFive",
|
93
|
+
type: "block",
|
94
|
+
title: /*#__PURE__*/_jsx(Label, {
|
95
|
+
label: "H5",
|
96
|
+
type: "Heading"
|
97
|
+
}),
|
98
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
99
|
+
type: 5,
|
100
|
+
isCustomized: isCustomized
|
101
|
+
}),
|
102
|
+
group: "typography",
|
103
|
+
value: "headingFive"
|
104
|
+
}, {
|
105
|
+
id: 19,
|
106
|
+
format: "headingSix",
|
107
|
+
type: "block",
|
108
|
+
title: /*#__PURE__*/_jsx(Label, {
|
109
|
+
label: "H6",
|
110
|
+
type: "Heading"
|
111
|
+
}),
|
112
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
113
|
+
type: 6,
|
114
|
+
isCustomized: isCustomized
|
115
|
+
}),
|
116
|
+
group: "typography",
|
117
|
+
value: "headingSix"
|
118
|
+
}, {
|
119
|
+
id: 20,
|
120
|
+
format: "paragraphOne",
|
121
|
+
type: "block",
|
122
|
+
title: /*#__PURE__*/_jsx(Label, {
|
123
|
+
label: "P1",
|
124
|
+
type: "Paragraph"
|
125
|
+
}),
|
126
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
127
|
+
type: 1,
|
128
|
+
isCustomized: isCustomized,
|
129
|
+
isPara: true
|
130
|
+
}),
|
131
|
+
group: "typography",
|
132
|
+
value: "paragraphOne"
|
133
|
+
}, {
|
134
|
+
id: 21,
|
135
|
+
format: "paragraphTwo",
|
136
|
+
type: "block",
|
137
|
+
title: /*#__PURE__*/_jsx(Label, {
|
138
|
+
label: "P2",
|
139
|
+
type: "Paragraph"
|
140
|
+
}),
|
141
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
142
|
+
type: 2,
|
143
|
+
isCustomized: isCustomized,
|
144
|
+
isPara: true
|
145
|
+
}),
|
146
|
+
group: "typography",
|
147
|
+
value: "paragraphTwo"
|
148
|
+
}, {
|
149
|
+
id: 22,
|
150
|
+
format: "paragraphThree",
|
151
|
+
type: "block",
|
152
|
+
title: /*#__PURE__*/_jsx(Label, {
|
153
|
+
label: "P3",
|
154
|
+
type: "Paragraph"
|
155
|
+
}),
|
156
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
157
|
+
type: 3,
|
158
|
+
isCustomized: isCustomized,
|
159
|
+
isPara: true
|
160
|
+
}),
|
161
|
+
group: "typography",
|
162
|
+
value: "paragraphThree"
|
163
|
+
}
|
164
|
+
// {
|
165
|
+
// id: 14,
|
166
|
+
// format: "fontSize",
|
167
|
+
// type: "mark",
|
168
|
+
// title: <Label label="L" type="Large" />,
|
169
|
+
// label: "L",
|
170
|
+
// group: "typography",
|
171
|
+
// value: "huge",
|
172
|
+
// },
|
173
|
+
// {
|
174
|
+
// id: 15,
|
175
|
+
// format: "fontSize",
|
176
|
+
// type: "mark",
|
177
|
+
// title: <Label label="M" type="Medium" />,
|
178
|
+
// label: "M",
|
179
|
+
// group: "typography",
|
180
|
+
// value: "medium",
|
181
|
+
// },
|
182
|
+
// {
|
183
|
+
// id: 16,
|
184
|
+
// format: "fontSize",
|
185
|
+
// type: "mark",
|
186
|
+
// title: <Label label="S" type="Small" />,
|
187
|
+
// label: "S",
|
188
|
+
// group: "typography",
|
189
|
+
// value: "small",
|
190
|
+
// },
|
191
|
+
];
|
192
|
+
|
193
|
+
return typographyOptions;
|
194
|
+
}
|
101
195
|
function SelectTypography({
|
102
196
|
editor,
|
103
197
|
classes,
|
104
|
-
closeMainPopup
|
198
|
+
closeMainPopup,
|
199
|
+
type
|
105
200
|
}) {
|
106
201
|
const [size] = useWindowResize();
|
202
|
+
const {
|
203
|
+
theme
|
204
|
+
} = useEditorTheme();
|
205
|
+
const isTextCustomized = theme?.id ? isCustomized(editor) : false;
|
206
|
+
const typographyOptions = getTypographyOptions(isTextCustomized);
|
107
207
|
const updateMarkData = newVal => {
|
108
208
|
const val = activeMark(editor, "fontSize");
|
109
209
|
let upData = {
|
@@ -125,7 +225,10 @@ function SelectTypography({
|
|
125
225
|
...upData
|
126
226
|
}
|
127
227
|
});
|
228
|
+
|
229
|
+
// closeMainPopup();
|
128
230
|
};
|
231
|
+
|
129
232
|
const selectedBlock = useMemo(() => {
|
130
233
|
return typographyOptions.find(t => {
|
131
234
|
if (t.type === "block") {
|
@@ -147,15 +250,13 @@ function SelectTypography({
|
|
147
250
|
});
|
148
251
|
}, [typographyOptions, activeMark, isBlockActive, editor]);
|
149
252
|
const onChange = (format, option) => {
|
150
|
-
// add/reset block elements
|
151
|
-
toggleBlock(editor, format);
|
152
253
|
if (option.type === "block") {
|
153
|
-
|
154
|
-
|
155
|
-
addMarkData(editor, {
|
156
|
-
format: "fontSize",
|
157
|
-
value: {}
|
254
|
+
themeFields.forEach(field => {
|
255
|
+
Editor.removeMark(editor, field);
|
158
256
|
});
|
257
|
+
|
258
|
+
// add/reset block elements
|
259
|
+
toggleBlock(editor, format);
|
159
260
|
} else if (option.type === "mark") {
|
160
261
|
const size = sizeMap[option.value] || "";
|
161
262
|
const [sizeInNumber] = size.split("px");
|
@@ -163,11 +264,35 @@ function SelectTypography({
|
|
163
264
|
}
|
164
265
|
closeMainPopup();
|
165
266
|
};
|
267
|
+
const typographyValue = selectedBlock?.value || "headingOne";
|
268
|
+
if (type === "fullWidth") {
|
269
|
+
return /*#__PURE__*/_jsx(Select, {
|
270
|
+
value: typographyValue,
|
271
|
+
className: "editor-dd",
|
272
|
+
onChange: e => {
|
273
|
+
const {
|
274
|
+
value
|
275
|
+
} = e.target;
|
276
|
+
const option = typographyOptions?.find(o => o.value === value);
|
277
|
+
onChange(value, option);
|
278
|
+
},
|
279
|
+
style: {
|
280
|
+
width: "100%",
|
281
|
+
height: "36px",
|
282
|
+
borderRadius: "10px",
|
283
|
+
fontSize: "14px"
|
284
|
+
},
|
285
|
+
children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
|
286
|
+
value: item.value,
|
287
|
+
children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
|
288
|
+
}, index))
|
289
|
+
});
|
290
|
+
}
|
166
291
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
167
292
|
options: typographyOptions,
|
168
293
|
editor: editor,
|
169
294
|
onChange: onChange,
|
170
|
-
value:
|
295
|
+
value: typographyValue,
|
171
296
|
classes: classes
|
172
297
|
});
|
173
298
|
}
|
@@ -56,7 +56,8 @@ const MiniTextFormat = props => {
|
|
56
56
|
}), /*#__PURE__*/_jsx(SelectTypography, {
|
57
57
|
classes: classes,
|
58
58
|
editor: editor,
|
59
|
-
closeMainPopup: closeMainPopup
|
59
|
+
closeMainPopup: closeMainPopup,
|
60
|
+
type: "miniToolBar"
|
60
61
|
}), /*#__PURE__*/_jsx("div", {
|
61
62
|
className: "verticalLine"
|
62
63
|
}), /*#__PURE__*/_jsx(SelectList, {
|
@@ -130,7 +130,7 @@ const usePopupStyle = theme => ({
|
|
130
130
|
},
|
131
131
|
"& .accordionIcon": {
|
132
132
|
"& p": {
|
133
|
-
textAlign:
|
133
|
+
textAlign: "left"
|
134
134
|
}
|
135
135
|
}
|
136
136
|
},
|
@@ -416,6 +416,11 @@ const usePopupStyle = theme => ({
|
|
416
416
|
"& .MuiOutlinedInput-notchedOutline": {
|
417
417
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
|
418
418
|
},
|
419
|
+
"& .MuiInputBase-root": {
|
420
|
+
"& input": {
|
421
|
+
border: "none !important"
|
422
|
+
}
|
423
|
+
},
|
419
424
|
"& svg": {
|
420
425
|
width: "20px",
|
421
426
|
height: "24px"
|
@@ -424,12 +429,6 @@ const usePopupStyle = theme => ({
|
|
424
429
|
fontFamilyListOptions: {
|
425
430
|
"& .MuiAutocomplete-listbox": {
|
426
431
|
padding: "0px",
|
427
|
-
"&::-webkit-scrollbar-thumb": {
|
428
|
-
background: `none !important`
|
429
|
-
},
|
430
|
-
"&::-webkit-scrollbar-track": {
|
431
|
-
visibility: "hidden"
|
432
|
-
},
|
433
432
|
"&::-webkit-scrollbar-thumb": {
|
434
433
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
435
434
|
},
|
@@ -440,8 +439,8 @@ const usePopupStyle = theme => ({
|
|
440
439
|
margin: "5px",
|
441
440
|
borderRadius: "8px",
|
442
441
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
443
|
-
fontSize:
|
444
|
-
padding:
|
442
|
+
fontSize: "14px",
|
443
|
+
padding: "8px 12px",
|
445
444
|
'&[aria-selected="true"]': {
|
446
445
|
backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
447
446
|
}
|
@@ -540,7 +539,7 @@ const usePopupStyle = theme => ({
|
|
540
539
|
}
|
541
540
|
},
|
542
541
|
alignItems: "flexStart",
|
543
|
-
justifyContent: "center",
|
542
|
+
// justifyContent: "center",
|
544
543
|
flexDirection: "row",
|
545
544
|
"&:hover": {
|
546
545
|
background: "unset"
|
@@ -789,8 +788,13 @@ const usePopupStyle = theme => ({
|
|
789
788
|
padding: "0px"
|
790
789
|
},
|
791
790
|
defaultBtn: {
|
792
|
-
color: "#
|
793
|
-
textTransform: "none"
|
791
|
+
color: "#2563EB !important",
|
792
|
+
textTransform: "none",
|
793
|
+
textDecoration: "underline",
|
794
|
+
"&.Mui-disabled": {
|
795
|
+
color: "#A0AEC0 !important",
|
796
|
+
textDecoration: "none"
|
797
|
+
}
|
794
798
|
},
|
795
799
|
templateCardBtnGrp: {
|
796
800
|
display: "none",
|