@flozy/editor 8.0.8 → 9.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 +1 -2
- package/dist/Editor/CommonEditor.js +33 -112
- 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 +7 -9
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +1 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -126
- 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 +14 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +1 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -2
- 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 +16 -17
- package/dist/Editor/Elements/Table/TableCell.js +3 -4
- 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/Mini/MiniToolbar.js +0 -1
- 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 +38 -31
- 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/LinkSettings/NavComponents.js +5 -1
- package/dist/Editor/common/LinkSettings/index.js +5 -1
- package/dist/Editor/common/LinkSettings/style.js +7 -0
- package/dist/Editor/common/MentionsPopup/Styles.js +12 -6
- 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 -45
- 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 +69 -114
- 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 +21 -20
- 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/chatEditor/SlateUtilityFunctions.js +0 -23
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +19 -59
- 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 -90
- package/dist/Editor/common/CustomDialog/style.js +0 -67
- package/dist/Editor/common/CustomDialog/styles.js +0 -80
- 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,10 +1,9 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Autocomplete, TextField } from "@mui/material";
|
3
|
-
import { addMarkData } from "../../utils/SlateUtilityFunctions.js";
|
3
|
+
import { activeMark, 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
|
7
|
-
import { getValue } from "./Dropdown.js";
|
6
|
+
import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
const FontFamilyAutocomplete = ({
|
10
9
|
editor,
|
@@ -15,7 +14,7 @@ const FontFamilyAutocomplete = ({
|
|
15
14
|
val = "",
|
16
15
|
webFont = false
|
17
16
|
}) => {
|
18
|
-
const markValue =
|
17
|
+
const markValue = activeMark(editor, format);
|
19
18
|
const value = !webFont ? markValue : val;
|
20
19
|
const changeMarkData = (event, newValue, format) => {
|
21
20
|
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, isMarkActive } 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: isMarkActive(editor, format),
|
13
13
|
format: format,
|
14
14
|
onMouseDown: e => {
|
15
15
|
e.preventDefault();
|
@@ -1,7 +1,10 @@
|
|
1
1
|
import React, { useEffect, useRef, useState } from "react";
|
2
2
|
import { TextField, IconButton } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
4
|
-
import {
|
3
|
+
import { addMarkData, activeMark, isBlockActive } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { headingMap, sizeMap } from "../../utils/font.js";
|
5
|
+
import ExpandLessRoundedIcon from "@mui/icons-material/ExpandLessRounded";
|
6
|
+
import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded";
|
7
|
+
import { getBreakPointsValue } from "../../helper/theme.js";
|
5
8
|
import useWindowResize from "../../hooks/useWindowResize.js";
|
6
9
|
import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
|
7
10
|
import { TextSizeDownArrow, TextSizeUpArrow } from "../../common/iconListV2.js";
|
@@ -14,12 +17,11 @@ const TextSize = ({
|
|
14
17
|
format,
|
15
18
|
fullWidth
|
16
19
|
}) => {
|
17
|
-
const [fontSize, setFontSize] = useState();
|
18
|
-
const timerRef = useRef();
|
19
20
|
const [size] = useWindowResize();
|
20
21
|
const val = activeMark(editor, format);
|
21
|
-
const
|
22
|
-
const
|
22
|
+
const value = getBreakPointsValue(val, size?.device);
|
23
|
+
const [fontSize, setFontSize] = useState();
|
24
|
+
const timerRef = useRef();
|
23
25
|
useEffect(() => {
|
24
26
|
setFontSize(getSizeVal());
|
25
27
|
}, [value]);
|
@@ -55,7 +57,13 @@ const TextSize = ({
|
|
55
57
|
};
|
56
58
|
const getSizeVal = () => {
|
57
59
|
try {
|
58
|
-
|
60
|
+
let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
|
61
|
+
Object.entries(headingMap).forEach(([format, value]) => {
|
62
|
+
if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
|
63
|
+
size = value;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
return parseInt(size);
|
59
67
|
} catch (err) {
|
60
68
|
return "";
|
61
69
|
}
|
@@ -3,18 +3,17 @@ 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
|
-
// };
|
15
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
7
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
17
8
|
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
|
+
};
|
18
17
|
const Categories = props => {
|
19
18
|
const {
|
20
19
|
value,
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
2
|
-
import { activeMark, addMarkData } from "../../../utils/SlateUtilityFunctions";
|
2
|
+
import { activeMark, addMarkData, isBlockActive } 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
|
6
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue } from "../../../helper/theme";
|
7
|
+
import { headingMap, sizeMap } from "../../../utils/font";
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
10
|
const fontSizeOptions = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 26, 32, 36, 40, 48, 64, 96, 128];
|
@@ -18,7 +19,7 @@ function SelectFontSize({
|
|
18
19
|
const containerRef = useRef();
|
19
20
|
const [size] = useWindowResize();
|
20
21
|
const val = activeMark(editor, format);
|
21
|
-
const value =
|
22
|
+
const value = getBreakPointsValue(val, size?.device);
|
22
23
|
const timerRef = useRef();
|
23
24
|
const updateMarkData = newVal => {
|
24
25
|
let upData = {
|
@@ -52,7 +53,13 @@ function SelectFontSize({
|
|
52
53
|
};
|
53
54
|
const getSizeVal = () => {
|
54
55
|
try {
|
55
|
-
|
56
|
+
let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
|
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);
|
56
63
|
} catch (err) {
|
57
64
|
return "";
|
58
65
|
}
|
@@ -90,8 +97,8 @@ function SelectFontSize({
|
|
90
97
|
anchorEl: anchorEl,
|
91
98
|
onClose: () => setAnchorEl(null),
|
92
99
|
anchorOrigin: {
|
93
|
-
vertical:
|
94
|
-
horizontal:
|
100
|
+
vertical: 'bottom',
|
101
|
+
horizontal: 'left'
|
95
102
|
},
|
96
103
|
sx: classes.customSelectPopoverWrapper,
|
97
104
|
children: fontSizeOptions.map((s, i) => {
|
@@ -2,11 +2,8 @@ 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
|
5
|
+
import { BREAKPOINTS_DEVICES, getBreakPointsValue } 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";
|
10
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
9
|
function Label({
|
@@ -20,190 +17,93 @@ function Label({
|
|
20
17
|
});
|
21
18
|
}
|
22
19
|
function DisplayHeaderLabel({
|
23
|
-
type
|
24
|
-
isCustomized,
|
25
|
-
isPara = false
|
20
|
+
type
|
26
21
|
}) {
|
27
22
|
return /*#__PURE__*/_jsxs("div", {
|
28
|
-
children: [
|
23
|
+
children: ["H", /*#__PURE__*/_jsx("sub", {
|
29
24
|
children: type
|
30
25
|
})]
|
31
26
|
});
|
32
27
|
}
|
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
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
type: "
|
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
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
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
|
-
}
|
28
|
+
const typographyOptions = [{
|
29
|
+
id: 11,
|
30
|
+
format: "headingOne",
|
31
|
+
type: "block",
|
32
|
+
title: /*#__PURE__*/_jsx(Label, {
|
33
|
+
label: "H1",
|
34
|
+
type: "Header"
|
35
|
+
}),
|
36
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
37
|
+
type: 1
|
38
|
+
}),
|
39
|
+
group: "typography",
|
40
|
+
value: "headingOne"
|
41
|
+
}, {
|
42
|
+
id: 12,
|
43
|
+
format: "headingTwo",
|
44
|
+
type: "block",
|
45
|
+
title: /*#__PURE__*/_jsx(Label, {
|
46
|
+
label: "H2",
|
47
|
+
type: "Header"
|
48
|
+
}),
|
49
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
50
|
+
type: 2
|
51
|
+
}),
|
52
|
+
group: "typography",
|
53
|
+
value: "headingTwo"
|
54
|
+
}, {
|
55
|
+
id: 13,
|
56
|
+
format: "headingThree",
|
57
|
+
type: "block",
|
58
|
+
title: /*#__PURE__*/_jsx(Label, {
|
59
|
+
label: "H3",
|
60
|
+
type: "Header"
|
61
|
+
}),
|
62
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
63
|
+
type: 3
|
64
|
+
}),
|
65
|
+
group: "typography",
|
66
|
+
value: "headingThree"
|
67
|
+
}, {
|
68
|
+
id: 14,
|
69
|
+
format: "fontSize",
|
70
|
+
type: "mark",
|
71
|
+
title: /*#__PURE__*/_jsx(Label, {
|
72
|
+
label: "L",
|
73
|
+
type: "Large"
|
74
|
+
}),
|
75
|
+
label: "L",
|
76
|
+
group: "typography",
|
77
|
+
value: "huge"
|
78
|
+
}, {
|
79
|
+
id: 15,
|
80
|
+
format: "fontSize",
|
81
|
+
type: "mark",
|
82
|
+
title: /*#__PURE__*/_jsx(Label, {
|
83
|
+
label: "M",
|
84
|
+
type: "Medium"
|
85
|
+
}),
|
86
|
+
label: "M",
|
87
|
+
group: "typography",
|
88
|
+
value: "medium"
|
89
|
+
}, {
|
90
|
+
id: 16,
|
91
|
+
format: "fontSize",
|
92
|
+
type: "mark",
|
93
|
+
title: /*#__PURE__*/_jsx(Label, {
|
94
|
+
label: "S",
|
95
|
+
type: "Small"
|
96
|
+
}),
|
97
|
+
label: "S",
|
98
|
+
group: "typography",
|
99
|
+
value: "small"
|
100
|
+
}];
|
195
101
|
function SelectTypography({
|
196
102
|
editor,
|
197
103
|
classes,
|
198
|
-
closeMainPopup
|
199
|
-
type
|
104
|
+
closeMainPopup
|
200
105
|
}) {
|
201
106
|
const [size] = useWindowResize();
|
202
|
-
const {
|
203
|
-
theme
|
204
|
-
} = useEditorTheme();
|
205
|
-
const isTextCustomized = theme?.id ? isCustomized(editor) : false;
|
206
|
-
const typographyOptions = getTypographyOptions(isTextCustomized);
|
207
107
|
const updateMarkData = newVal => {
|
208
108
|
const val = activeMark(editor, "fontSize");
|
209
109
|
let upData = {
|
@@ -225,10 +125,7 @@ function SelectTypography({
|
|
225
125
|
...upData
|
226
126
|
}
|
227
127
|
});
|
228
|
-
|
229
|
-
// closeMainPopup();
|
230
128
|
};
|
231
|
-
|
232
129
|
const selectedBlock = useMemo(() => {
|
233
130
|
return typographyOptions.find(t => {
|
234
131
|
if (t.type === "block") {
|
@@ -250,13 +147,15 @@ function SelectTypography({
|
|
250
147
|
});
|
251
148
|
}, [typographyOptions, activeMark, isBlockActive, editor]);
|
252
149
|
const onChange = (format, option) => {
|
150
|
+
// add/reset block elements
|
151
|
+
toggleBlock(editor, format);
|
253
152
|
if (option.type === "block") {
|
254
|
-
|
255
|
-
|
153
|
+
// reset old font size
|
154
|
+
// let updatedValue = !selectedBlock ? {} : { xs: "16px", sm: "16px", md: "16px", lg: "16px" }
|
155
|
+
addMarkData(editor, {
|
156
|
+
format: "fontSize",
|
157
|
+
value: {}
|
256
158
|
});
|
257
|
-
|
258
|
-
// add/reset block elements
|
259
|
-
toggleBlock(editor, format);
|
260
159
|
} else if (option.type === "mark") {
|
261
160
|
const size = sizeMap[option.value] || "";
|
262
161
|
const [sizeInNumber] = size.split("px");
|
@@ -264,35 +163,11 @@ function SelectTypography({
|
|
264
163
|
}
|
265
164
|
closeMainPopup();
|
266
165
|
};
|
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
|
-
}
|
291
166
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
292
167
|
options: typographyOptions,
|
293
168
|
editor: editor,
|
294
169
|
onChange: onChange,
|
295
|
-
value:
|
170
|
+
value: selectedBlock?.value || "headingOne",
|
296
171
|
classes: classes
|
297
172
|
});
|
298
173
|
}
|
@@ -56,8 +56,7 @@ const MiniTextFormat = props => {
|
|
56
56
|
}), /*#__PURE__*/_jsx(SelectTypography, {
|
57
57
|
classes: classes,
|
58
58
|
editor: editor,
|
59
|
-
closeMainPopup: closeMainPopup
|
60
|
-
type: "miniToolBar"
|
59
|
+
closeMainPopup: closeMainPopup
|
61
60
|
}), /*#__PURE__*/_jsx("div", {
|
62
61
|
className: "verticalLine"
|
63
62
|
}), /*#__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,11 +416,6 @@ 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
|
-
},
|
424
419
|
"& svg": {
|
425
420
|
width: "20px",
|
426
421
|
height: "24px"
|
@@ -429,6 +424,12 @@ const usePopupStyle = theme => ({
|
|
429
424
|
fontFamilyListOptions: {
|
430
425
|
"& .MuiAutocomplete-listbox": {
|
431
426
|
padding: "0px",
|
427
|
+
"&::-webkit-scrollbar-thumb": {
|
428
|
+
background: `none !important`
|
429
|
+
},
|
430
|
+
"&::-webkit-scrollbar-track": {
|
431
|
+
visibility: "hidden"
|
432
|
+
},
|
432
433
|
"&::-webkit-scrollbar-thumb": {
|
433
434
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
434
435
|
},
|
@@ -439,8 +440,8 @@ const usePopupStyle = theme => ({
|
|
439
440
|
margin: "5px",
|
440
441
|
borderRadius: "8px",
|
441
442
|
color: theme?.palette?.editor?.menuOptionTextColor,
|
442
|
-
fontSize:
|
443
|
-
padding:
|
443
|
+
fontSize: '14px',
|
444
|
+
padding: '8px 12px',
|
444
445
|
'&[aria-selected="true"]': {
|
445
446
|
backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
|
446
447
|
}
|
@@ -539,7 +540,7 @@ const usePopupStyle = theme => ({
|
|
539
540
|
}
|
540
541
|
},
|
541
542
|
alignItems: "flexStart",
|
542
|
-
|
543
|
+
justifyContent: "center",
|
543
544
|
flexDirection: "row",
|
544
545
|
"&:hover": {
|
545
546
|
background: "unset"
|
@@ -788,13 +789,8 @@ const usePopupStyle = theme => ({
|
|
788
789
|
padding: "0px"
|
789
790
|
},
|
790
791
|
defaultBtn: {
|
791
|
-
color: "#
|
792
|
-
textTransform: "none"
|
793
|
-
textDecoration: "underline",
|
794
|
-
"&.Mui-disabled": {
|
795
|
-
color: "#A0AEC0 !important",
|
796
|
-
textDecoration: "none"
|
797
|
-
}
|
792
|
+
color: "#0F172A",
|
793
|
+
textTransform: "none"
|
798
794
|
},
|
799
795
|
templateCardBtnGrp: {
|
800
796
|
display: "none",
|