@flozy/editor 9.8.3 → 9.8.4
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 +26 -19
- package/dist/Editor/CommonEditor.js +141 -26
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +11 -7
- package/dist/Editor/Elements/AI/AIInput.js +5 -3
- package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
- package/dist/Editor/Elements/AI/PopoverAIInput.js +15 -5
- package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
- package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
- package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
- package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
- package/dist/Editor/Elements/Button/EditorButton.js +43 -30
- package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
- package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
- package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
- package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
- package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
- package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -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/Colorbox/ColorboxButton.js +6 -2
- package/dist/Editor/Elements/DataView/DataView.js +5 -2
- package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +448 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
- package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
- package/dist/Editor/Elements/Divider/Divider.js +5 -3
- package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
- package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
- package/dist/Editor/Elements/Embed/Embed.js +4 -1
- package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
- package/dist/Editor/Elements/Embed/Image.js +16 -11
- package/dist/Editor/Elements/Embed/Video.js +10 -7
- package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
- package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
- package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
- package/dist/Editor/Elements/Form/Form.js +12 -9
- package/dist/Editor/Elements/Form/FormButton.js +6 -2
- package/dist/Editor/Elements/Form/FormPopup.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
- package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +67 -23
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/Grid.js +13 -10
- package/dist/Editor/Elements/Grid/GridButton.js +9 -5
- package/dist/Editor/Elements/Grid/GridItem.js +14 -8
- package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
- package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
- package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
- package/dist/Editor/Elements/Link/Link.js +8 -5
- package/dist/Editor/Elements/Link/LinkButton.js +4 -1
- package/dist/Editor/Elements/List/CheckList.js +18 -10
- package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +4 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
- package/dist/Editor/Elements/Search/SearchButton.js +7 -4
- package/dist/Editor/Elements/Search/SearchList.js +10 -5
- package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +2 -8
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
- package/dist/Editor/Elements/SimpleText/index.js +14 -5
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +4 -2
- package/dist/Editor/Elements/Table/Table.js +23 -11
- package/dist/Editor/Elements/Table/TablePopup.js +4 -1
- package/dist/Editor/Elements/Table/TableSelector.js +10 -6
- package/dist/Editor/Elements/Table/TableTool.js +8 -4
- package/dist/Editor/Elements/Title/title.js +9 -8
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +10 -3
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/Basic/index.js +2 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
- 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 +8 -4
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +17 -5
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +9 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +20 -10
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +10 -5
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +71 -11
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +122 -42
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +18 -2
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
- package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +39 -14
- package/dist/Editor/common/CustomColorPicker/index.js +131 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +8 -10
- 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 +3 -0
- package/dist/Editor/common/Icon.js +31 -1
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
- package/dist/Editor/common/LinkSettings/index.js +20 -14
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/MUIIcon/index.js +0 -3
- package/dist/Editor/common/MentionsPopup/index.js +6 -2
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +46 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
- package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
- 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 +7 -4
- 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/TextSettings.js +6 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
- package/dist/Editor/common/RnD/ShadowElement.js +2 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
- 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 +73 -9
- package/dist/Editor/common/RnD/Utils/index.js +3 -0
- package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
- package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
- package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
- package/dist/Editor/common/RnD/VirtualElement/styles.js +155 -7
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +69 -13
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +72 -3
- package/dist/Editor/common/SnackBar/index.js +43 -0
- package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
- package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +6 -4
- package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +13 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +43 -14
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
- package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
- package/dist/Editor/common/StyleBuilder/index.js +8 -5
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
- package/dist/Editor/common/SwipeableDrawer/index.js +1 -1
- package/dist/Editor/common/Uploader.js +16 -5
- package/dist/Editor/commonStyle.js +68 -57
- package/dist/Editor/helper/index.js +27 -3
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +202 -2
- package/dist/Editor/hooks/useAutoScroll.js +38 -0
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +9 -3
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +11 -9
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withLinks.js +10 -0
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +290 -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 +61 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +351 -0
- package/dist/Editor/themeSettings/style.js +220 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +205 -0
- package/dist/Editor/themeSettingsAI/style.js +259 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +186 -54
- package/dist/Editor/utils/brains.js +1 -2
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/freegrid.js +3 -3
- package/dist/Editor/utils/helper.js +92 -21
- package/package.json +4 -4
@@ -13,34 +13,41 @@ function Label({
|
|
13
13
|
}), " ", type]
|
14
14
|
});
|
15
15
|
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
function getSubcriptOptions(translation) {
|
17
|
+
return [{
|
18
|
+
id: 9,
|
19
|
+
format: "superscript",
|
20
|
+
type: "mark",
|
21
|
+
title: /*#__PURE__*/_jsx(Label, {
|
22
|
+
label: "X²",
|
23
|
+
type: translation("Superscript")
|
24
|
+
}),
|
21
25
|
label: "X²",
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
group: "superSubscript",
|
27
|
+
value: "superscript"
|
28
|
+
}, {
|
29
|
+
id: 10,
|
30
|
+
format: "subscript",
|
31
|
+
type: "mark",
|
32
|
+
title: /*#__PURE__*/_jsx(Label, {
|
33
|
+
label: "X₂",
|
34
|
+
type: translation("Subscript")
|
35
|
+
}),
|
32
36
|
label: "X₂",
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
value: "subscript"
|
38
|
-
}];
|
37
|
+
group: "superSubscript",
|
38
|
+
value: "subscript"
|
39
|
+
}];
|
40
|
+
}
|
39
41
|
function SelectSuperSubscript({
|
40
42
|
editor,
|
41
43
|
classes,
|
42
|
-
closeMainPopup
|
44
|
+
closeMainPopup,
|
45
|
+
customProps
|
43
46
|
}) {
|
47
|
+
const {
|
48
|
+
translation
|
49
|
+
} = customProps;
|
50
|
+
const superSubscriptOptions = getSubcriptOptions(translation);
|
44
51
|
const selectedMark = useMemo(() => {
|
45
52
|
return superSubscriptOptions.find(option => activeMark(editor, option.format));
|
46
53
|
}, [editor]);
|
@@ -2,108 +2,222 @@ 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({
|
10
13
|
label,
|
11
|
-
type
|
14
|
+
type,
|
15
|
+
translation
|
12
16
|
}) {
|
13
17
|
return /*#__PURE__*/_jsxs("span", {
|
14
18
|
children: [/*#__PURE__*/_jsx("strong", {
|
15
19
|
children: label
|
16
|
-
}), " ", type]
|
20
|
+
}), " ", translation(type)]
|
17
21
|
});
|
18
22
|
}
|
19
23
|
function DisplayHeaderLabel({
|
20
|
-
type
|
24
|
+
type,
|
25
|
+
isCustomized,
|
26
|
+
isPara = false
|
21
27
|
}) {
|
22
28
|
return /*#__PURE__*/_jsxs("div", {
|
23
|
-
children: ["H", /*#__PURE__*/_jsx("sub", {
|
29
|
+
children: [isCustomized ? "*" : "", isPara ? "P" : "H", /*#__PURE__*/_jsx("sub", {
|
24
30
|
children: type
|
25
31
|
})]
|
26
32
|
});
|
27
33
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
},
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
type: "
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
},
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
label:
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
}, {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
34
|
+
function getTypographyOptions(isCustomized, translation) {
|
35
|
+
const typographyOptions = [{
|
36
|
+
id: 11,
|
37
|
+
format: "headingOne",
|
38
|
+
type: "block",
|
39
|
+
title: /*#__PURE__*/_jsx(Label, {
|
40
|
+
label: "H1",
|
41
|
+
type: "Heading",
|
42
|
+
translation: translation
|
43
|
+
}),
|
44
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
45
|
+
type: 1,
|
46
|
+
isCustomized: isCustomized
|
47
|
+
}),
|
48
|
+
group: "typography",
|
49
|
+
value: "headingOne"
|
50
|
+
}, {
|
51
|
+
id: 12,
|
52
|
+
format: "headingTwo",
|
53
|
+
type: "block",
|
54
|
+
title: /*#__PURE__*/_jsx(Label, {
|
55
|
+
label: "H2",
|
56
|
+
type: "Heading",
|
57
|
+
translation: translation
|
58
|
+
}),
|
59
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
60
|
+
type: 2,
|
61
|
+
isCustomized: isCustomized
|
62
|
+
}),
|
63
|
+
group: "typography",
|
64
|
+
value: "headingTwo"
|
65
|
+
}, {
|
66
|
+
id: 13,
|
67
|
+
format: "headingThree",
|
68
|
+
type: "block",
|
69
|
+
title: /*#__PURE__*/_jsx(Label, {
|
70
|
+
label: "H3",
|
71
|
+
type: "Heading",
|
72
|
+
translation: translation
|
73
|
+
}),
|
74
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
75
|
+
type: 3,
|
76
|
+
isCustomized: isCustomized
|
77
|
+
}),
|
78
|
+
group: "typography",
|
79
|
+
value: "headingThree"
|
80
|
+
}, {
|
81
|
+
id: 17,
|
82
|
+
format: "headingFour",
|
83
|
+
type: "block",
|
84
|
+
title: /*#__PURE__*/_jsx(Label, {
|
85
|
+
label: "H4",
|
86
|
+
type: "Heading",
|
87
|
+
translation: translation
|
88
|
+
}),
|
89
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
90
|
+
type: 4,
|
91
|
+
isCustomized: isCustomized
|
92
|
+
}),
|
93
|
+
group: "typography",
|
94
|
+
value: "headingFour"
|
95
|
+
}, {
|
96
|
+
id: 18,
|
97
|
+
format: "headingFive",
|
98
|
+
type: "block",
|
99
|
+
title: /*#__PURE__*/_jsx(Label, {
|
100
|
+
label: "H5",
|
101
|
+
type: "Heading",
|
102
|
+
translation: translation
|
103
|
+
}),
|
104
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
105
|
+
type: 5,
|
106
|
+
isCustomized: isCustomized
|
107
|
+
}),
|
108
|
+
group: "typography",
|
109
|
+
value: "headingFive"
|
110
|
+
}, {
|
111
|
+
id: 19,
|
112
|
+
format: "headingSix",
|
113
|
+
type: "block",
|
114
|
+
title: /*#__PURE__*/_jsx(Label, {
|
115
|
+
label: "H6",
|
116
|
+
type: "Heading",
|
117
|
+
translation: translation
|
118
|
+
}),
|
119
|
+
label: /*#__PURE__*/_jsx(DisplayHeaderLabel, {
|
120
|
+
type: 6,
|
121
|
+
isCustomized: isCustomized
|
122
|
+
}),
|
123
|
+
group: "typography",
|
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;
|
204
|
+
}
|
101
205
|
function SelectTypography({
|
102
206
|
editor,
|
103
207
|
classes,
|
104
|
-
closeMainPopup
|
208
|
+
closeMainPopup,
|
209
|
+
type,
|
210
|
+
customProps
|
105
211
|
}) {
|
106
212
|
const [size] = useWindowResize();
|
213
|
+
const {
|
214
|
+
theme
|
215
|
+
} = useEditorTheme();
|
216
|
+
const {
|
217
|
+
translation
|
218
|
+
} = customProps;
|
219
|
+
const isTextCustomized = theme?.id ? isCustomized(editor) : false;
|
220
|
+
const typographyOptions = getTypographyOptions(isTextCustomized, translation);
|
107
221
|
const updateMarkData = newVal => {
|
108
222
|
const val = activeMark(editor, "fontSize");
|
109
223
|
let upData = {
|
@@ -125,7 +239,10 @@ function SelectTypography({
|
|
125
239
|
...upData
|
126
240
|
}
|
127
241
|
});
|
242
|
+
|
243
|
+
// closeMainPopup();
|
128
244
|
};
|
245
|
+
|
129
246
|
const selectedBlock = useMemo(() => {
|
130
247
|
return typographyOptions.find(t => {
|
131
248
|
if (t.type === "block") {
|
@@ -147,15 +264,13 @@ function SelectTypography({
|
|
147
264
|
});
|
148
265
|
}, [typographyOptions, activeMark, isBlockActive, editor]);
|
149
266
|
const onChange = (format, option) => {
|
150
|
-
// add/reset block elements
|
151
|
-
toggleBlock(editor, format);
|
152
267
|
if (option.type === "block") {
|
153
|
-
|
154
|
-
|
155
|
-
addMarkData(editor, {
|
156
|
-
format: "fontSize",
|
157
|
-
value: {}
|
268
|
+
themeFields.forEach(field => {
|
269
|
+
Editor.removeMark(editor, field);
|
158
270
|
});
|
271
|
+
|
272
|
+
// add/reset block elements
|
273
|
+
toggleBlock(editor, format);
|
159
274
|
} else if (option.type === "mark") {
|
160
275
|
const size = sizeMap[option.value] || "";
|
161
276
|
const [sizeInNumber] = size.split("px");
|
@@ -163,11 +278,35 @@ function SelectTypography({
|
|
163
278
|
}
|
164
279
|
closeMainPopup();
|
165
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
|
+
}
|
166
305
|
return /*#__PURE__*/_jsx(CustomSelectTool, {
|
167
306
|
options: typographyOptions,
|
168
307
|
editor: editor,
|
169
308
|
onChange: onChange,
|
170
|
-
value:
|
309
|
+
value: typographyValue,
|
171
310
|
classes: classes
|
172
311
|
});
|
173
312
|
}
|
@@ -1,4 +1,4 @@
|
|
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";
|
@@ -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 = {
|
@@ -35,11 +35,12 @@ const MiniTextFormat = props => {
|
|
35
35
|
const open = Boolean(anchorEl);
|
36
36
|
const id = open ? "popup-edit-tool" : "";
|
37
37
|
const [size] = useWindowResize();
|
38
|
+
const theme = useTheme();
|
38
39
|
const removeFontStyles = ["superscript", "subscript"];
|
39
40
|
const fontStyle = allTools.filter(f => f.type === "mark" && !removeFontStyles.includes(f.format));
|
40
41
|
const link = allTools.find(f => f.format?.indexOf("link") >= 0);
|
41
42
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
42
|
-
const activeColor =
|
43
|
+
const activeColor = getSelectedElementColor(editor, textColorFormat, theme);
|
43
44
|
const activeBg = activeMark(editor, textBgFormat) || DEFAULT_COLOR[textBgFormat];
|
44
45
|
return /*#__PURE__*/_jsx(Grid, {
|
45
46
|
container: true,
|
@@ -56,20 +57,24 @@ const MiniTextFormat = props => {
|
|
56
57
|
}), /*#__PURE__*/_jsx(SelectTypography, {
|
57
58
|
classes: classes,
|
58
59
|
editor: editor,
|
59
|
-
closeMainPopup: closeMainPopup
|
60
|
+
closeMainPopup: closeMainPopup,
|
61
|
+
type: "miniToolBar",
|
62
|
+
customProps: customProps
|
60
63
|
}), /*#__PURE__*/_jsx("div", {
|
61
64
|
className: "verticalLine"
|
62
65
|
}), /*#__PURE__*/_jsx(SelectList, {
|
63
66
|
classes: classes,
|
64
67
|
editor: editor,
|
65
|
-
closeMainPopup: closeMainPopup
|
68
|
+
closeMainPopup: closeMainPopup,
|
69
|
+
customProps: customProps
|
66
70
|
}), /*#__PURE__*/_jsx("div", {
|
67
71
|
className: "verticalLine mr-1"
|
68
72
|
}), /*#__PURE__*/_jsx(SelectAlignment, {
|
69
73
|
fontAlign: fontAlign,
|
70
74
|
classes: classes,
|
71
75
|
editor: editor,
|
72
|
-
closeMainPopup: closeMainPopup
|
76
|
+
closeMainPopup: closeMainPopup,
|
77
|
+
customProps: customProps
|
73
78
|
}), /*#__PURE__*/_jsx("div", {
|
74
79
|
className: "verticalLine mr-1"
|
75
80
|
}), /*#__PURE__*/_jsx(SelectFontSize, {
|
@@ -80,20 +85,24 @@ const MiniTextFormat = props => {
|
|
80
85
|
}), fontStyle?.map((m, i) => {
|
81
86
|
return /*#__PURE__*/_jsx(MarkButton, {
|
82
87
|
editor: editor,
|
83
|
-
...m
|
88
|
+
...m,
|
89
|
+
customProps: customProps
|
84
90
|
}, `pptool_mark_${i}_${m.id}`);
|
85
91
|
}), /*#__PURE__*/_jsx(MiniColorPicker, {
|
86
92
|
format: textColorFormat,
|
87
93
|
classes: classes,
|
88
94
|
activeColor: activeColor,
|
89
95
|
id: "11_cc",
|
90
|
-
editor: editor
|
96
|
+
editor: editor,
|
97
|
+
customProps: customProps,
|
98
|
+
type: "textColor"
|
91
99
|
}), /*#__PURE__*/_jsx(MiniColorPicker, {
|
92
100
|
format: textBgFormat,
|
93
101
|
classes: classes,
|
94
102
|
activeColor: activeBg,
|
95
103
|
id: "12_cc",
|
96
|
-
editor: editor
|
104
|
+
editor: editor,
|
105
|
+
customProps: customProps
|
97
106
|
}), /*#__PURE__*/_jsx("div", {
|
98
107
|
className: "verticalLine ml-1 mr-1"
|
99
108
|
}), /*#__PURE__*/_jsx(LinkButton, {
|
@@ -126,7 +135,8 @@ const MiniTextFormat = props => {
|
|
126
135
|
children: [/*#__PURE__*/_jsx(PopperHeader, {
|
127
136
|
title: "Text Settings",
|
128
137
|
classes: classes,
|
129
|
-
onClose: () => setAnchorEl(null)
|
138
|
+
onClose: () => setAnchorEl(null),
|
139
|
+
customProps: customProps
|
130
140
|
}), /*#__PURE__*/_jsx(TextFormat, {
|
131
141
|
editor: editor,
|
132
142
|
classes: classes,
|
@@ -35,9 +35,13 @@ const PopperHeader = props => {
|
|
35
35
|
fullScreen,
|
36
36
|
toggleFullscreen,
|
37
37
|
search,
|
38
|
-
onSearch
|
38
|
+
onSearch,
|
39
|
+
customProps
|
39
40
|
} = props;
|
40
41
|
const [openSearch, setOpenSearch] = useState(false);
|
42
|
+
const {
|
43
|
+
translation
|
44
|
+
} = customProps;
|
41
45
|
const handleSearchButton = () => {
|
42
46
|
setOpenSearch(!openSearch);
|
43
47
|
};
|
@@ -46,7 +50,8 @@ const PopperHeader = props => {
|
|
46
50
|
padding: 2,
|
47
51
|
className: "headerContainer",
|
48
52
|
style: {
|
49
|
-
paddingTop: "5px"
|
53
|
+
paddingTop: "5px",
|
54
|
+
paddingBottom: "0px"
|
50
55
|
},
|
51
56
|
children: /*#__PURE__*/_jsxs(Grid, {
|
52
57
|
item: true,
|
@@ -61,7 +66,7 @@ const PopperHeader = props => {
|
|
61
66
|
fontWeight: "700",
|
62
67
|
color: "#000"
|
63
68
|
},
|
64
|
-
children: title
|
69
|
+
children: translation(title)
|
65
70
|
}), /*#__PURE__*/_jsxs(Grid, {
|
66
71
|
sx: classes.textFormatLabel,
|
67
72
|
justifyContent: "end",
|
@@ -82,7 +87,7 @@ const PopperHeader = props => {
|
|
82
87
|
handleChange: onSearch
|
83
88
|
})]
|
84
89
|
}) : null, needFullscreen ? /*#__PURE__*/_jsx(Tooltip, {
|
85
|
-
title: "
|
90
|
+
title: translation("toggleFullScreen"),
|
86
91
|
arrow: true,
|
87
92
|
children: /*#__PURE__*/_jsx(IconButton, {
|
88
93
|
style: {
|
@@ -94,7 +99,7 @@ const PopperHeader = props => {
|
|
94
99
|
children: fullScreen ? /*#__PURE__*/_jsx(CloseFullscreenIcon, {}) : /*#__PURE__*/_jsx(ToggleFullScreenIcon, {})
|
95
100
|
})
|
96
101
|
}) : null, /*#__PURE__*/_jsx(Tooltip, {
|
97
|
-
title: "Close",
|
102
|
+
title: translation("Close"),
|
98
103
|
arrow: true,
|
99
104
|
children: /*#__PURE__*/_jsx(IconButton, {
|
100
105
|
sx: classes.closeBtn,
|