@flozy/editor 10.9.9 → 11.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 +17 -16
- package/dist/Editor/CommonEditor.js +141 -28
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +39 -11
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
- package/dist/Editor/Elements/AI/Styles.js +1 -0
- package/dist/Editor/Elements/Accordion/Accordion.js +28 -22
- package/dist/Editor/Elements/Accordion/AccordionButton.js +12 -3
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Attachments/AttachmentStyles.js +16 -0
- package/dist/Editor/Elements/Attachments/Attachments.js +153 -11
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +8 -3
- package/dist/Editor/Elements/Button/EditorButton.js +23 -7
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +134 -55
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/SelectV1.js +7 -8
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/PersonType.js +8 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +1 -1
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +1 -1
- package/dist/Editor/Elements/Embed/Embed.css +5 -0
- package/dist/Editor/Elements/Embed/Embed.js +36 -43
- package/dist/Editor/Elements/Embed/Image.js +236 -23
- package/dist/Editor/Elements/Embed/Video.js +245 -15
- package/dist/Editor/Elements/Form/FormField.js +1 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/Form/Workflow/constant.js +25 -1
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +39 -33
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
- package/dist/Editor/Elements/FreeGrid/Options/More.js +7 -7
- package/dist/Editor/Elements/FreeGrid/helper.js +115 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +15 -0
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +2 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +3 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +4 -1
- package/dist/Editor/Elements/SimpleText/index.js +4 -1
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +5 -4
- package/dist/Editor/Elements/Table/TableCell.js +10 -3
- package/dist/Editor/Elements/Title/title.js +10 -11
- package/dist/Editor/Elements/TopBanner/TopBanner.js +4 -2
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +5 -3
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +2 -1
- package/dist/Editor/Styles/EditorStyles.js +20 -8
- 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 +33 -29
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +25 -23
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +25 -7
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +24 -8
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +70 -10
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +73 -14
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -4
- package/dist/Editor/Toolbar/toolbarGroups.js +56 -10
- package/dist/Editor/assets/svg/BackIcon.js +18 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
- package/dist/Editor/common/ColorPickerButton.js +38 -16
- package/dist/Editor/common/CustomColorPicker/index.js +130 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -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 +43 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +4 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +45 -7
- package/dist/Editor/common/ImageSelector/Options/Upload.js +26 -11
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +6 -2
- package/dist/Editor/common/MentionsPopup/index.js +9 -1
- 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 +20 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +9 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +20 -7
- package/dist/Editor/common/RnD/GuideLines/styles.js +1 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -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 +28 -18
- package/dist/Editor/common/RnD/Utils/index.js +3 -1
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +45 -58
- package/dist/Editor/common/RnD/VirtualElement/helper.js +320 -130
- package/dist/Editor/common/RnD/VirtualElement/styles.js +22 -0
- package/dist/Editor/common/RnD/index.js +48 -13
- package/dist/Editor/common/Shorthands/elements.js +62 -4
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +4 -0
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +1 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +15 -2
- 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 +16 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/embedUpload.js +115 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +3 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +2 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +0 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/StyleBuilder/formStyle.js +19 -13
- package/dist/Editor/common/StyleBuilder/index.js +8 -4
- package/dist/Editor/common/Uploader.js +125 -17
- package/dist/Editor/common/UploaderWithProgress.js +183 -0
- package/dist/Editor/common/iconslist.js +21 -0
- package/dist/Editor/commonStyle.js +64 -45
- package/dist/Editor/helper/index.js +10 -2
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +203 -2
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/hooks/useTable.js +62 -1
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +12 -1
- package/dist/Editor/plugins/withHTML.js +58 -3
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/service/fileupload.js +70 -0
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +82 -0
- package/dist/Editor/themeSettings/buttons/index.js +300 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +310 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +240 -0
- package/dist/Editor/themeSettings/fonts/style.js +62 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +380 -0
- package/dist/Editor/themeSettings/style.js +299 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
- package/dist/Editor/themeSettingsAI/style.js +332 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +189 -40
- package/dist/Editor/utils/accordion.js +68 -40
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/events.js +94 -89
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/formfield.js +2 -2
- package/dist/Editor/utils/helper.js +100 -23
- package/dist/Editor/utils/insertAppHeader.js +8 -4
- package/package.json +4 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
|
@@ -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({
|
|
@@ -18,26 +21,29 @@ function Label({
|
|
|
18
21
|
});
|
|
19
22
|
}
|
|
20
23
|
function DisplayHeaderLabel({
|
|
21
|
-
type
|
|
24
|
+
type,
|
|
25
|
+
isCustomized,
|
|
26
|
+
isPara = false
|
|
22
27
|
}) {
|
|
23
28
|
return /*#__PURE__*/_jsxs("div", {
|
|
24
|
-
children: ["H", /*#__PURE__*/_jsx("sub", {
|
|
29
|
+
children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
|
|
25
30
|
children: type
|
|
26
31
|
})]
|
|
27
32
|
});
|
|
28
33
|
}
|
|
29
|
-
function getTypographyOptions(translation) {
|
|
30
|
-
|
|
34
|
+
function getTypographyOptions(isCustomized, translation) {
|
|
35
|
+
const typographyOptions = [{
|
|
31
36
|
id: 11,
|
|
32
37
|
format: "headingOne",
|
|
33
38
|
type: "block",
|
|
34
39
|
title: /*#__PURE__*/_jsx(Label, {
|
|
35
40
|
label: "H1",
|
|
36
|
-
type: "
|
|
41
|
+
type: "Heading",
|
|
37
42
|
translation: translation
|
|
38
43
|
}),
|
|
39
44
|
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
40
|
-
type: 1
|
|
45
|
+
type: 1,
|
|
46
|
+
isCustomized: isCustomized
|
|
41
47
|
}),
|
|
42
48
|
group: "typography",
|
|
43
49
|
value: "headingOne"
|
|
@@ -47,11 +53,12 @@ function getTypographyOptions(translation) {
|
|
|
47
53
|
type: "block",
|
|
48
54
|
title: /*#__PURE__*/_jsx(Label, {
|
|
49
55
|
label: "H2",
|
|
50
|
-
type: "
|
|
56
|
+
type: "Heading",
|
|
51
57
|
translation: translation
|
|
52
58
|
}),
|
|
53
59
|
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
54
|
-
type: 2
|
|
60
|
+
type: 2,
|
|
61
|
+
isCustomized: isCustomized
|
|
55
62
|
}),
|
|
56
63
|
group: "typography",
|
|
57
64
|
value: "headingTwo"
|
|
@@ -61,63 +68,156 @@ function getTypographyOptions(translation) {
|
|
|
61
68
|
type: "block",
|
|
62
69
|
title: /*#__PURE__*/_jsx(Label, {
|
|
63
70
|
label: "H3",
|
|
64
|
-
type: "
|
|
71
|
+
type: "Heading",
|
|
65
72
|
translation: translation
|
|
66
73
|
}),
|
|
67
74
|
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
68
|
-
type: 3
|
|
75
|
+
type: 3,
|
|
76
|
+
isCustomized: isCustomized
|
|
69
77
|
}),
|
|
70
78
|
group: "typography",
|
|
71
79
|
value: "headingThree"
|
|
72
80
|
}, {
|
|
73
|
-
id:
|
|
74
|
-
format: "
|
|
75
|
-
type: "
|
|
81
|
+
id: 17,
|
|
82
|
+
format: "headingFour",
|
|
83
|
+
type: "block",
|
|
76
84
|
title: /*#__PURE__*/_jsx(Label, {
|
|
77
|
-
label: "
|
|
78
|
-
type: "
|
|
85
|
+
label: "H4",
|
|
86
|
+
type: "Heading",
|
|
79
87
|
translation: translation
|
|
80
88
|
}),
|
|
81
|
-
label:
|
|
89
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
90
|
+
type: 4,
|
|
91
|
+
isCustomized: isCustomized
|
|
92
|
+
}),
|
|
82
93
|
group: "typography",
|
|
83
|
-
value: "
|
|
94
|
+
value: "headingFour"
|
|
84
95
|
}, {
|
|
85
|
-
id:
|
|
86
|
-
format: "
|
|
87
|
-
type: "
|
|
96
|
+
id: 18,
|
|
97
|
+
format: "headingFive",
|
|
98
|
+
type: "block",
|
|
88
99
|
title: /*#__PURE__*/_jsx(Label, {
|
|
89
|
-
label: "
|
|
90
|
-
type: "
|
|
100
|
+
label: "H5",
|
|
101
|
+
type: "Heading",
|
|
91
102
|
translation: translation
|
|
92
103
|
}),
|
|
93
|
-
label:
|
|
104
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
105
|
+
type: 5,
|
|
106
|
+
isCustomized: isCustomized
|
|
107
|
+
}),
|
|
94
108
|
group: "typography",
|
|
95
|
-
value: "
|
|
109
|
+
value: "headingFive"
|
|
96
110
|
}, {
|
|
97
|
-
id:
|
|
98
|
-
format: "
|
|
99
|
-
type: "
|
|
111
|
+
id: 19,
|
|
112
|
+
format: "headingSix",
|
|
113
|
+
type: "block",
|
|
100
114
|
title: /*#__PURE__*/_jsx(Label, {
|
|
101
|
-
label: "
|
|
102
|
-
type: "
|
|
115
|
+
label: "H6",
|
|
116
|
+
type: "Heading",
|
|
103
117
|
translation: translation
|
|
104
118
|
}),
|
|
105
|
-
label:
|
|
119
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
120
|
+
type: 6,
|
|
121
|
+
isCustomized: isCustomized
|
|
122
|
+
}),
|
|
106
123
|
group: "typography",
|
|
107
|
-
value: "
|
|
108
|
-
}
|
|
124
|
+
value: "headingSix"
|
|
125
|
+
}, {
|
|
126
|
+
id: 20,
|
|
127
|
+
format: "paragraphOne",
|
|
128
|
+
type: "block",
|
|
129
|
+
title: /*#__PURE__*/_jsx(Label, {
|
|
130
|
+
label: "P1",
|
|
131
|
+
type: "Paragraph",
|
|
132
|
+
translation: translation
|
|
133
|
+
}),
|
|
134
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
135
|
+
type: 1,
|
|
136
|
+
isCustomized: isCustomized,
|
|
137
|
+
isPara: true
|
|
138
|
+
}),
|
|
139
|
+
group: "typography",
|
|
140
|
+
value: "paragraphOne"
|
|
141
|
+
}, {
|
|
142
|
+
id: 21,
|
|
143
|
+
format: "paragraphTwo",
|
|
144
|
+
type: "block",
|
|
145
|
+
title: /*#__PURE__*/_jsx(Label, {
|
|
146
|
+
label: "P2",
|
|
147
|
+
type: "Paragraph",
|
|
148
|
+
translation: translation
|
|
149
|
+
}),
|
|
150
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
151
|
+
type: 2,
|
|
152
|
+
isCustomized: isCustomized,
|
|
153
|
+
isPara: true
|
|
154
|
+
}),
|
|
155
|
+
group: "typography",
|
|
156
|
+
value: "paragraphTwo"
|
|
157
|
+
}, {
|
|
158
|
+
id: 22,
|
|
159
|
+
format: "paragraphThree",
|
|
160
|
+
type: "block",
|
|
161
|
+
title: /*#__PURE__*/_jsx(Label, {
|
|
162
|
+
label: "P3",
|
|
163
|
+
type: "Paragraph",
|
|
164
|
+
translation: translation
|
|
165
|
+
}),
|
|
166
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
|
167
|
+
type: 3,
|
|
168
|
+
isCustomized: isCustomized,
|
|
169
|
+
isPara: true
|
|
170
|
+
}),
|
|
171
|
+
group: "typography",
|
|
172
|
+
value: "paragraphThree"
|
|
173
|
+
}
|
|
174
|
+
// {
|
|
175
|
+
// id: 14,
|
|
176
|
+
// format: "fontSize",
|
|
177
|
+
// type: "mark",
|
|
178
|
+
// title: <Label label="L" type="Large" />,
|
|
179
|
+
// label: "L",
|
|
180
|
+
// group: "typography",
|
|
181
|
+
// value: "huge",
|
|
182
|
+
// },
|
|
183
|
+
// {
|
|
184
|
+
// id: 15,
|
|
185
|
+
// format: "fontSize",
|
|
186
|
+
// type: "mark",
|
|
187
|
+
// title: <Label label="M" type="Medium" />,
|
|
188
|
+
// label: "M",
|
|
189
|
+
// group: "typography",
|
|
190
|
+
// value: "medium",
|
|
191
|
+
// },
|
|
192
|
+
// {
|
|
193
|
+
// id: 16,
|
|
194
|
+
// format: "fontSize",
|
|
195
|
+
// type: "mark",
|
|
196
|
+
// title: <Label label="S" type="Small" />,
|
|
197
|
+
// label: "S",
|
|
198
|
+
// group: "typography",
|
|
199
|
+
// value: "small",
|
|
200
|
+
// },
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
return typographyOptions;
|
|
109
204
|
}
|
|
110
205
|
function SelectTypography({
|
|
111
206
|
editor,
|
|
112
207
|
classes,
|
|
113
208
|
closeMainPopup,
|
|
209
|
+
type,
|
|
114
210
|
customProps
|
|
115
211
|
}) {
|
|
116
212
|
const [size] = useWindowResize();
|
|
213
|
+
const {
|
|
214
|
+
theme
|
|
215
|
+
} = useEditorTheme();
|
|
117
216
|
const {
|
|
118
217
|
translation
|
|
119
218
|
} = customProps;
|
|
120
|
-
const
|
|
219
|
+
const isTextCustomized = theme?.id ? isCustomized(editor) : false;
|
|
220
|
+
const typographyOptions = getTypographyOptions(isTextCustomized, translation);
|
|
121
221
|
const updateMarkData = newVal => {
|
|
122
222
|
const val = activeMark(editor, "fontSize");
|
|
123
223
|
let upData = {
|
|
@@ -139,7 +239,10 @@ function SelectTypography({
|
|
|
139
239
|
...upData
|
|
140
240
|
}
|
|
141
241
|
});
|
|
242
|
+
|
|
243
|
+
// closeMainPopup();
|
|
142
244
|
};
|
|
245
|
+
|
|
143
246
|
const selectedBlock = useMemo(() => {
|
|
144
247
|
return typographyOptions.find(t => {
|
|
145
248
|
if (t.type === "block") {
|
|
@@ -161,15 +264,13 @@ function SelectTypography({
|
|
|
161
264
|
});
|
|
162
265
|
}, [typographyOptions, activeMark, isBlockActive, editor]);
|
|
163
266
|
const onChange = (format, option) => {
|
|
164
|
-
// add/reset block elements
|
|
165
|
-
toggleBlock(editor, format);
|
|
166
267
|
if (option.type === "block") {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
addMarkData(editor, {
|
|
170
|
-
format: "fontSize",
|
|
171
|
-
value: {}
|
|
268
|
+
themeFields.forEach(field => {
|
|
269
|
+
Editor.removeMark(editor, field);
|
|
172
270
|
});
|
|
271
|
+
|
|
272
|
+
// add/reset block elements
|
|
273
|
+
toggleBlock(editor, format);
|
|
173
274
|
} else if (option.type === "mark") {
|
|
174
275
|
const size = sizeMap[option.value] || "";
|
|
175
276
|
const [sizeInNumber] = size.split("px");
|
|
@@ -177,11 +278,35 @@ function SelectTypography({
|
|
|
177
278
|
}
|
|
178
279
|
closeMainPopup();
|
|
179
280
|
};
|
|
281
|
+
const typographyValue = selectedBlock?.value || "headingOne";
|
|
282
|
+
if (type === "fullWidth") {
|
|
283
|
+
return /*#__PURE__*/_jsx(Select, {
|
|
284
|
+
value: typographyValue,
|
|
285
|
+
className: "editor-dd",
|
|
286
|
+
onChange: e => {
|
|
287
|
+
const {
|
|
288
|
+
value
|
|
289
|
+
} = e.target;
|
|
290
|
+
const option = typographyOptions?.find(o => o.value === value);
|
|
291
|
+
onChange(value, option);
|
|
292
|
+
},
|
|
293
|
+
style: {
|
|
294
|
+
width: "100%",
|
|
295
|
+
height: "36px",
|
|
296
|
+
borderRadius: "10px",
|
|
297
|
+
fontSize: "14px"
|
|
298
|
+
},
|
|
299
|
+
children: typographyOptions.map((item, index) => /*#__PURE__*/_jsxs(MenuItem, {
|
|
300
|
+
value: item.value,
|
|
301
|
+
children: [item.title, " ", isTextCustomized && item.value === typographyValue ? " *" : ""]
|
|
302
|
+
}, index))
|
|
303
|
+
});
|
|
304
|
+
}
|
|
180
305
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
|
181
306
|
options: typographyOptions,
|
|
182
307
|
editor: editor,
|
|
183
308
|
onChange: onChange,
|
|
184
|
-
value:
|
|
309
|
+
value: typographyValue,
|
|
185
310
|
classes: classes
|
|
186
311
|
});
|
|
187
312
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Fade, Grid, IconButton, Paper, Popper } from "@mui/material";
|
|
1
|
+
import { Fade, Grid, IconButton, Paper, Popper, useTheme } from "@mui/material";
|
|
2
2
|
import SelectTypography from "./SelectTypography";
|
|
3
3
|
import SelectList from "./SelectList";
|
|
4
4
|
import { toolbarGroups } from "../../toolbarGroups";
|
|
5
5
|
import { MarkButton } from "../../FormatTools";
|
|
6
|
-
import { activeMark, isBlockActive } from "../../../utils/SlateUtilityFunctions";
|
|
6
|
+
import { activeMark, getListType, isBlockActive } from "../../../utils/SlateUtilityFunctions";
|
|
7
7
|
import LinkButton from "../../../Elements/Link/LinkButton";
|
|
8
8
|
import TextToolIcon from "../../../assets/svg/TextToolIcon";
|
|
9
9
|
import TextFormat from "../TextFormat";
|
|
@@ -14,7 +14,7 @@ import MiniColorPicker from "./MiniColorPicker";
|
|
|
14
14
|
import SelectAlignment from "./SelectAlignment";
|
|
15
15
|
import SelectFontSize from "./SelectFontSize";
|
|
16
16
|
import InfinityAITool from "./InfinityAITool";
|
|
17
|
-
import { viewSlateSelection } from "../../../utils/helper";
|
|
17
|
+
import { getSelectedElementColor, viewSlateSelection } from "../../../utils/helper";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
const DEFAULT_COLOR = {
|
|
@@ -34,12 +34,18 @@ const MiniTextFormat = props => {
|
|
|
34
34
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
35
35
|
const open = Boolean(anchorEl);
|
|
36
36
|
const id = open ? "popup-edit-tool" : "";
|
|
37
|
+
const [resizedSize, setResizedSize] = useState();
|
|
37
38
|
const [size] = useWindowResize();
|
|
39
|
+
const theme = useTheme();
|
|
40
|
+
const listType = getListType(editor);
|
|
41
|
+
const commonProps = {
|
|
42
|
+
listType
|
|
43
|
+
};
|
|
38
44
|
const removeFontStyles = ["superscript", "subscript"];
|
|
39
45
|
const fontStyle = allTools.filter(f => f.type === "mark" && !removeFontStyles.includes(f.format));
|
|
40
46
|
const link = allTools.find(f => f.format?.indexOf("link") >= 0);
|
|
41
47
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
|
42
|
-
const activeColor =
|
|
48
|
+
const activeColor = getSelectedElementColor(editor, textColorFormat, theme);
|
|
43
49
|
const activeBg = activeMark(editor, textBgFormat) || DEFAULT_COLOR[textBgFormat];
|
|
44
50
|
return /*#__PURE__*/_jsx(Grid, {
|
|
45
51
|
container: true,
|
|
@@ -57,6 +63,7 @@ const MiniTextFormat = props => {
|
|
|
57
63
|
classes: classes,
|
|
58
64
|
editor: editor,
|
|
59
65
|
closeMainPopup: closeMainPopup,
|
|
66
|
+
type: "miniToolBar",
|
|
60
67
|
customProps: customProps
|
|
61
68
|
}), /*#__PURE__*/_jsx("div", {
|
|
62
69
|
className: "verticalLine"
|
|
@@ -64,7 +71,8 @@ const MiniTextFormat = props => {
|
|
|
64
71
|
classes: classes,
|
|
65
72
|
editor: editor,
|
|
66
73
|
closeMainPopup: closeMainPopup,
|
|
67
|
-
customProps: customProps
|
|
74
|
+
customProps: customProps,
|
|
75
|
+
commonProps: commonProps
|
|
68
76
|
}), /*#__PURE__*/_jsx("div", {
|
|
69
77
|
className: "verticalLine mr-1"
|
|
70
78
|
}), /*#__PURE__*/_jsx(SelectAlignment, {
|
|
@@ -77,7 +85,10 @@ const MiniTextFormat = props => {
|
|
|
77
85
|
className: "verticalLine mr-1"
|
|
78
86
|
}), /*#__PURE__*/_jsx(SelectFontSize, {
|
|
79
87
|
classes: classes,
|
|
80
|
-
editor: editor
|
|
88
|
+
editor: editor,
|
|
89
|
+
fromMiniTextFormat: true,
|
|
90
|
+
setResizedSize: setResizedSize,
|
|
91
|
+
resizedSize: resizedSize
|
|
81
92
|
}), /*#__PURE__*/_jsx("div", {
|
|
82
93
|
className: "verticalLine mr-1"
|
|
83
94
|
}), fontStyle?.map((m, i) => {
|
|
@@ -92,7 +103,8 @@ const MiniTextFormat = props => {
|
|
|
92
103
|
activeColor: activeColor,
|
|
93
104
|
id: "11_cc",
|
|
94
105
|
editor: editor,
|
|
95
|
-
customProps: customProps
|
|
106
|
+
customProps: customProps,
|
|
107
|
+
type: "textColor"
|
|
96
108
|
}), /*#__PURE__*/_jsx(MiniColorPicker, {
|
|
97
109
|
format: textBgFormat,
|
|
98
110
|
classes: classes,
|
|
@@ -138,7 +150,11 @@ const MiniTextFormat = props => {
|
|
|
138
150
|
editor: editor,
|
|
139
151
|
classes: classes,
|
|
140
152
|
closeMainPopup: closeMainPopup,
|
|
141
|
-
customProps: customProps
|
|
153
|
+
customProps: customProps,
|
|
154
|
+
commonProps: commonProps,
|
|
155
|
+
fromMiniTextFormat: true,
|
|
156
|
+
setResizedSize: setResizedSize,
|
|
157
|
+
resizedSize: resizedSize
|
|
142
158
|
})]
|
|
143
159
|
})
|
|
144
160
|
})
|
|
@@ -98,6 +98,9 @@ const usePopupStyle = theme => ({
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
+
"& .MuiDivider-root": {
|
|
102
|
+
border: `0.5px solid ${theme?.palette?.editor?.deviderBgColor}`
|
|
103
|
+
},
|
|
101
104
|
"@media only screen and (max-width: 599px)": {
|
|
102
105
|
// margin: "10px !important",
|
|
103
106
|
background: "unset",
|
|
@@ -111,6 +114,7 @@ const usePopupStyle = theme => ({
|
|
|
111
114
|
width: "323px",
|
|
112
115
|
maxWidth: "100%",
|
|
113
116
|
overflowX: "hidden !important",
|
|
117
|
+
marginTop: "6px",
|
|
114
118
|
// 30% of window height
|
|
115
119
|
maxHeight: `${window.innerHeight * 0.45}px`,
|
|
116
120
|
overflow: "auto",
|
|
@@ -304,6 +308,21 @@ const usePopupStyle = theme => ({
|
|
|
304
308
|
paddingRight: "0px !important"
|
|
305
309
|
}
|
|
306
310
|
},
|
|
311
|
+
textFormatContainer: {
|
|
312
|
+
".saveThemeBtnsWrapper": {
|
|
313
|
+
position: "sticky",
|
|
314
|
+
bottom: "0px",
|
|
315
|
+
right: "0px",
|
|
316
|
+
boxShadow: `0px -3px 16px 0px ${theme?.palette?.editor?.cardShadow}`,
|
|
317
|
+
padding: "10px",
|
|
318
|
+
borderRadius: "8px 8px 19px 19px",
|
|
319
|
+
display: "flex",
|
|
320
|
+
justifyContent: "end",
|
|
321
|
+
alignItems: "center",
|
|
322
|
+
gap: "8px",
|
|
323
|
+
background: theme?.palette?.editor?.miniToolBarBackground
|
|
324
|
+
}
|
|
325
|
+
},
|
|
307
326
|
textFormatLabel: {
|
|
308
327
|
display: "flex",
|
|
309
328
|
alignItems: "center",
|
|
@@ -335,9 +354,10 @@ const usePopupStyle = theme => ({
|
|
|
335
354
|
borderBottom: `1px solid ${theme?.palette?.editor?.deviderBgColor} !important`
|
|
336
355
|
},
|
|
337
356
|
textFormatField: {
|
|
338
|
-
marginBottom: "8px"
|
|
339
|
-
marginTop: "8px"
|
|
357
|
+
marginBottom: "8px"
|
|
358
|
+
// marginTop: "8px",
|
|
340
359
|
},
|
|
360
|
+
|
|
341
361
|
textFormatField1: {
|
|
342
362
|
marginBottom: "16px",
|
|
343
363
|
marginTop: "10px"
|
|
@@ -416,6 +436,11 @@ const usePopupStyle = theme => ({
|
|
|
416
436
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
417
437
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`
|
|
418
438
|
},
|
|
439
|
+
"& .MuiInputBase-root": {
|
|
440
|
+
"& input": {
|
|
441
|
+
border: "none !important"
|
|
442
|
+
}
|
|
443
|
+
},
|
|
419
444
|
"& svg": {
|
|
420
445
|
width: "20px",
|
|
421
446
|
height: "24px"
|
|
@@ -424,9 +449,6 @@ const usePopupStyle = theme => ({
|
|
|
424
449
|
fontFamilyListOptions: {
|
|
425
450
|
"& .MuiAutocomplete-listbox": {
|
|
426
451
|
padding: "0px",
|
|
427
|
-
// "&::-webkit-scrollbar-thumb": {
|
|
428
|
-
// background: `none !important`,
|
|
429
|
-
// },
|
|
430
452
|
"&::-webkit-scrollbar-thumb": {
|
|
431
453
|
background: `${theme?.palette?.editor?.brainPopupScroll} !important`
|
|
432
454
|
},
|
|
@@ -537,7 +559,7 @@ const usePopupStyle = theme => ({
|
|
|
537
559
|
}
|
|
538
560
|
},
|
|
539
561
|
alignItems: "flexStart",
|
|
540
|
-
justifyContent: "center",
|
|
562
|
+
// justifyContent: "center",
|
|
541
563
|
flexDirection: "row",
|
|
542
564
|
"&:hover": {
|
|
543
565
|
background: "unset"
|
|
@@ -786,8 +808,13 @@ const usePopupStyle = theme => ({
|
|
|
786
808
|
padding: "0px"
|
|
787
809
|
},
|
|
788
810
|
defaultBtn: {
|
|
789
|
-
color: "#
|
|
790
|
-
textTransform: "none"
|
|
811
|
+
color: "#2563EB !important",
|
|
812
|
+
textTransform: "none",
|
|
813
|
+
textDecoration: "underline",
|
|
814
|
+
"&.Mui-disabled": {
|
|
815
|
+
color: "#A0AEC0 !important",
|
|
816
|
+
textDecoration: "none"
|
|
817
|
+
}
|
|
791
818
|
},
|
|
792
819
|
templateCardBtnGrp: {
|
|
793
820
|
display: "none",
|
|
@@ -864,7 +891,7 @@ const usePopupStyle = theme => ({
|
|
|
864
891
|
margin: "30px",
|
|
865
892
|
"& .MuiPaper-root": {
|
|
866
893
|
overflow: "auto",
|
|
867
|
-
backgroundColor: theme?.palette?.editor?.
|
|
894
|
+
backgroundColor: theme?.palette?.editor?.miniToolBarBackground,
|
|
868
895
|
borderRadius: "14px !important",
|
|
869
896
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`,
|
|
870
897
|
minWidth: "fit-content",
|
|
@@ -1132,12 +1159,45 @@ const usePopupStyle = theme => ({
|
|
|
1132
1159
|
miniFontSizeInput: {
|
|
1133
1160
|
"& input": {
|
|
1134
1161
|
fontSize: "14px",
|
|
1135
|
-
width: "
|
|
1162
|
+
width: "26px",
|
|
1136
1163
|
padding: "8px 4px"
|
|
1137
1164
|
},
|
|
1138
1165
|
"& fieldset": {
|
|
1139
1166
|
border: "none !important"
|
|
1140
1167
|
}
|
|
1168
|
+
},
|
|
1169
|
+
customCheckBox: {
|
|
1170
|
+
marginTop: "4px",
|
|
1171
|
+
padding: "0px",
|
|
1172
|
+
"& .MuiCheckbox-root": {
|
|
1173
|
+
padding: "8px 8px 8px 10px",
|
|
1174
|
+
"&:hover": {
|
|
1175
|
+
background: "unset !important"
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
"& button": {
|
|
1179
|
+
width: "14px !important",
|
|
1180
|
+
height: "14px !important",
|
|
1181
|
+
borderRadius: "3px",
|
|
1182
|
+
border: `1px solid ${theme?.palette?.editor?.buttonBorder3}`,
|
|
1183
|
+
padding: "0px",
|
|
1184
|
+
"& svg": {
|
|
1185
|
+
width: "10px",
|
|
1186
|
+
height: "10px"
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
"& .checkedIcon": {
|
|
1190
|
+
background: "#2563EB",
|
|
1191
|
+
borderColor: "#2563EB"
|
|
1192
|
+
},
|
|
1193
|
+
"& .unCheckedIcon": {
|
|
1194
|
+
background: theme?.palette?.editor?.checkedIconBg
|
|
1195
|
+
},
|
|
1196
|
+
"& p": {
|
|
1197
|
+
margin: "0px !important",
|
|
1198
|
+
color: theme?.palette?.editor?.tv_text,
|
|
1199
|
+
fontSize: "13px"
|
|
1200
|
+
}
|
|
1141
1201
|
}
|
|
1142
1202
|
});
|
|
1143
1203
|
export default usePopupStyle;
|