@flozy/editor 9.6.8 → 9.6.9
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 +139 -25
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +13 -9
- 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 +4 -2
- 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 +425 -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 +14 -9
- package/dist/Editor/Elements/Embed/Video.js +9 -6
- 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 +38 -5
- 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 +14 -9
- 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 +7 -3
- package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
- 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 +5 -4
- 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 +24 -12
- 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 +15 -2
- 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 +128 -45
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +436 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +20 -10
- 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/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 +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- 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 -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 +22 -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/ElementSettings/styles.js +0 -1
- 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 +55 -8
- 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 +375 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
- package/dist/Editor/common/RnD/VirtualElement/styles.js +151 -7
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +64 -13
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +74 -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/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/Uploader.js +16 -5
- package/dist/Editor/commonStyle.js +23 -12
- 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/useDrag.js +1 -1
- 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/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/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 +201 -60
- 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 +3 -3
@@ -6,7 +6,8 @@ const PreviewAndSelect = props => {
|
|
6
6
|
const {
|
7
7
|
classes,
|
8
8
|
data,
|
9
|
-
onSelectTemplate
|
9
|
+
onSelectTemplate,
|
10
|
+
translation
|
10
11
|
} = props;
|
11
12
|
return /*#__PURE__*/_jsxs(Box, {
|
12
13
|
className: "template-card-action",
|
@@ -15,12 +16,12 @@ const PreviewAndSelect = props => {
|
|
15
16
|
children: [/*#__PURE__*/_jsx(Button, {
|
16
17
|
className: "blueBtn",
|
17
18
|
onClick: onSelectTemplate(data),
|
18
|
-
children: "Select"
|
19
|
+
children: translation("Select")
|
19
20
|
}), /*#__PURE__*/_jsx(Button, {
|
20
21
|
href: data?.previewLink,
|
21
22
|
target: "_blank",
|
22
23
|
className: "outlineBtn",
|
23
|
-
children: "Preview"
|
24
|
+
children: translation("Preview")
|
24
25
|
})]
|
25
26
|
});
|
26
27
|
};
|
@@ -29,8 +30,12 @@ const TemplateCard = props => {
|
|
29
30
|
classes,
|
30
31
|
m,
|
31
32
|
onSelectTemplate,
|
32
|
-
fullScreen
|
33
|
+
fullScreen,
|
34
|
+
customProps
|
33
35
|
} = props;
|
36
|
+
const {
|
37
|
+
translation
|
38
|
+
} = customProps;
|
34
39
|
return /*#__PURE__*/_jsx(Grid, {
|
35
40
|
item: true,
|
36
41
|
xs: 4,
|
@@ -53,7 +58,8 @@ const TemplateCard = props => {
|
|
53
58
|
}), /*#__PURE__*/_jsx(PreviewAndSelect, {
|
54
59
|
classes: classes,
|
55
60
|
onSelectTemplate: onSelectTemplate,
|
56
|
-
data: m
|
61
|
+
data: m,
|
62
|
+
translation: translation
|
57
63
|
})]
|
58
64
|
}), /*#__PURE__*/_jsx(CardContent, {
|
59
65
|
sx: classes.templateCardTitle,
|
@@ -10,11 +10,13 @@ import { AllColors } from "../../Elements/Color Picker/ColorButtons";
|
|
10
10
|
import { fontFamilyMap } from "../../utils/font";
|
11
11
|
import { getBorderColor } from "../../utils/helper";
|
12
12
|
import SelectTypography from "./MiniTextFormat/SelectTypography";
|
13
|
+
import { isTextCustomized, saveToTheme } from "../../helper/theme";
|
14
|
+
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
13
15
|
import SelectSuperSubscript from "./MiniTextFormat/SelectSuperSubscript";
|
14
16
|
import { ColorResetIcon, TextDefaultStyleIcon } from "../../common/iconListV2";
|
15
17
|
import FontFamilyAutocomplete from "../FormatTools/FontFamilyAutocomplete";
|
16
18
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
17
|
-
|
19
|
+
import LineSpacing from "../../common/StyleBuilder/fieldTypes/lineSpacing";
|
18
20
|
import { getPageSettings } from "../../utils/pageSettings";
|
19
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
20
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -33,15 +35,21 @@ const TextFormat = props => {
|
|
33
35
|
const [anchorEl, setAnchorEl] = useState(null);
|
34
36
|
const [type, setType] = useState(null);
|
35
37
|
const open = Boolean(anchorEl);
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
const {
|
39
|
+
translation
|
40
|
+
} = customProps;
|
41
|
+
const {
|
42
|
+
element: pageSt
|
43
|
+
} = getPageSettings(editor) || {};
|
44
|
+
const pageSettingLine = pageSt?.pageProps?.lineHeight;
|
39
45
|
const {
|
40
46
|
fontFamilies,
|
41
|
-
theme
|
47
|
+
theme: appTheme
|
48
|
+
} = useEditorContext();
|
49
|
+
const {
|
50
|
+
activeBreakPoint
|
42
51
|
} = useEditorContext();
|
43
|
-
|
44
|
-
// const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
52
|
+
const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
|
45
53
|
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
46
54
|
const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
|
47
55
|
const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
|
@@ -58,12 +66,13 @@ const TextFormat = props => {
|
|
58
66
|
color: "",
|
59
67
|
bgColor: ""
|
60
68
|
};
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
69
|
+
const {
|
70
|
+
theme,
|
71
|
+
updateTheme
|
72
|
+
} = useEditorTheme();
|
73
|
+
const customized = isTextCustomized(editor);
|
74
|
+
let lineSpacingValue = activeMark(editor, "lineHeight");
|
75
|
+
lineSpacingValue = lineSpacingValue?.[breakpoint] !== undefined ? lineSpacingValue : pageSettingLine;
|
67
76
|
const handleColorPicker = type => e => {
|
68
77
|
setType(type);
|
69
78
|
setAnchorEl(e.currentTarget);
|
@@ -104,11 +113,13 @@ const TextFormat = props => {
|
|
104
113
|
value
|
105
114
|
});
|
106
115
|
};
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
116
|
+
const handleLineSpacing = data => {
|
117
|
+
const [[format, value]] = Object.entries(data);
|
118
|
+
addMarkData(editor, {
|
119
|
+
format,
|
120
|
+
value
|
121
|
+
});
|
122
|
+
};
|
112
123
|
return /*#__PURE__*/_jsxs(Grid, {
|
113
124
|
container: true,
|
114
125
|
sx: classes.textFormatWrapper,
|
@@ -126,7 +137,52 @@ const TextFormat = props => {
|
|
126
137
|
variant: "body1",
|
127
138
|
color: "primary",
|
128
139
|
sx: classes.typoLabel,
|
129
|
-
children: "
|
140
|
+
children: "Style"
|
141
|
+
})
|
142
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
143
|
+
item: true,
|
144
|
+
children: theme?.id ? /*#__PURE__*/_jsx(Button, {
|
145
|
+
sx: classes.defaultBtn,
|
146
|
+
onClick: () => {
|
147
|
+
const {
|
148
|
+
field,
|
149
|
+
theme
|
150
|
+
} = saveToTheme(editor) || {};
|
151
|
+
updateTheme(theme, {
|
152
|
+
action: "ELEMENT_PROPS_CHANGE",
|
153
|
+
fieldName: field
|
154
|
+
});
|
155
|
+
},
|
156
|
+
disabled: !customized,
|
157
|
+
children: "Save to theme"
|
158
|
+
}) : null
|
159
|
+
})]
|
160
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
161
|
+
item: true,
|
162
|
+
xs: 12,
|
163
|
+
sx: classes.textFormatField,
|
164
|
+
children: /*#__PURE__*/_jsx(SelectTypography, {
|
165
|
+
editor: editor,
|
166
|
+
classes: classes,
|
167
|
+
closeMainPopup: closeMainPopup,
|
168
|
+
type: "fullWidth",
|
169
|
+
customProps: customProps
|
170
|
+
})
|
171
|
+
})]
|
172
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
173
|
+
item: true,
|
174
|
+
xs: 12,
|
175
|
+
children: [/*#__PURE__*/_jsxs(Grid, {
|
176
|
+
container: true,
|
177
|
+
justifyContent: "space-between",
|
178
|
+
alignItems: "center",
|
179
|
+
children: [/*#__PURE__*/_jsx(Grid, {
|
180
|
+
item: true,
|
181
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
182
|
+
variant: "body1",
|
183
|
+
color: "primary",
|
184
|
+
sx: classes.typoLabel,
|
185
|
+
children: translation("fontFamily")
|
130
186
|
})
|
131
187
|
}), /*#__PURE__*/_jsx(Grid, {
|
132
188
|
item: true,
|
@@ -138,7 +194,7 @@ const TextFormat = props => {
|
|
138
194
|
val: Object.values(fontFamilyMap)[0]
|
139
195
|
}),
|
140
196
|
className: "npr-0",
|
141
|
-
children: "
|
197
|
+
children: translation("defaultText")
|
142
198
|
})
|
143
199
|
})]
|
144
200
|
}), /*#__PURE__*/_jsx(Grid, {
|
@@ -163,7 +219,7 @@ const TextFormat = props => {
|
|
163
219
|
variant: "body1",
|
164
220
|
color: "primary",
|
165
221
|
sx: classes.typoLabel3,
|
166
|
-
children: "
|
222
|
+
children: translation("fontWeight")
|
167
223
|
}), /*#__PURE__*/_jsx(Grid, {
|
168
224
|
item: true,
|
169
225
|
xs: 12,
|
@@ -184,7 +240,7 @@ const TextFormat = props => {
|
|
184
240
|
variant: "body1",
|
185
241
|
color: "primary",
|
186
242
|
sx: classes.typoLabel3,
|
187
|
-
children: "
|
243
|
+
children: translation("fontSize")
|
188
244
|
}), /*#__PURE__*/_jsx(Grid, {
|
189
245
|
item: true,
|
190
246
|
xs: 12,
|
@@ -217,7 +273,7 @@ const TextFormat = props => {
|
|
217
273
|
variant: "body1",
|
218
274
|
color: "primary",
|
219
275
|
sx: classes.typoLabel,
|
220
|
-
children: "
|
276
|
+
children: translation("textColor")
|
221
277
|
})
|
222
278
|
}), /*#__PURE__*/_jsx(Grid, {
|
223
279
|
item: true,
|
@@ -227,7 +283,7 @@ const TextFormat = props => {
|
|
227
283
|
onClick: handleDefault({
|
228
284
|
format: "color"
|
229
285
|
}),
|
230
|
-
children: "
|
286
|
+
children: translation("defaultColor")
|
231
287
|
})
|
232
288
|
})]
|
233
289
|
}), /*#__PURE__*/_jsx(Grid, {
|
@@ -238,9 +294,10 @@ const TextFormat = props => {
|
|
238
294
|
editor: editor,
|
239
295
|
showHex: false,
|
240
296
|
rounded: true,
|
241
|
-
title: "
|
297
|
+
title: translation("textColor"),
|
242
298
|
id: "11_cc",
|
243
|
-
classes: classes
|
299
|
+
classes: classes,
|
300
|
+
type: "textColor"
|
244
301
|
}, "11_cc")
|
245
302
|
})]
|
246
303
|
}), /*#__PURE__*/_jsxs(Grid, {
|
@@ -257,7 +314,7 @@ const TextFormat = props => {
|
|
257
314
|
variant: "body1",
|
258
315
|
color: "primary",
|
259
316
|
sx: classes.typoLabel,
|
260
|
-
children: "
|
317
|
+
children: translation("backgroundColor")
|
261
318
|
})
|
262
319
|
}), /*#__PURE__*/_jsx(Grid, {
|
263
320
|
item: true,
|
@@ -266,12 +323,12 @@ const TextFormat = props => {
|
|
266
323
|
children: /*#__PURE__*/_jsx(Button, {
|
267
324
|
sx: classes.defaultBtn2,
|
268
325
|
startIcon: /*#__PURE__*/_jsx(ColorResetIcon, {
|
269
|
-
stroke:
|
326
|
+
stroke: appTheme?.palette?.type === "dark" ? "#505359" : "#A2B0B9"
|
270
327
|
}),
|
271
328
|
onClick: handleDefault({
|
272
329
|
format: "bgColor"
|
273
330
|
}),
|
274
|
-
children: "
|
331
|
+
children: translation("defaultColor")
|
275
332
|
})
|
276
333
|
})
|
277
334
|
})]
|
@@ -285,7 +342,7 @@ const TextFormat = props => {
|
|
285
342
|
editor: editor,
|
286
343
|
showHex: false,
|
287
344
|
rounded: true,
|
288
|
-
title: "
|
345
|
+
title: translation("textBgColor"),
|
289
346
|
classes: classes,
|
290
347
|
id: "12_cc"
|
291
348
|
}, "12_cc")
|
@@ -303,7 +360,7 @@ const TextFormat = props => {
|
|
303
360
|
variant: "body1",
|
304
361
|
color: "primary",
|
305
362
|
sx: classes.typoLabel2,
|
306
|
-
children: "Alignment"
|
363
|
+
children: translation("Alignment")
|
307
364
|
}), /*#__PURE__*/_jsx(Grid, {
|
308
365
|
item: true,
|
309
366
|
xs: 12,
|
@@ -311,7 +368,8 @@ const TextFormat = props => {
|
|
311
368
|
children: fontAlign?.map((m, i) => {
|
312
369
|
return /*#__PURE__*/_jsx(BlockButton, {
|
313
370
|
editor: editor,
|
314
|
-
...m
|
371
|
+
...m,
|
372
|
+
customProps: customProps
|
315
373
|
}, `pptool_block_${i}_${m.id}`);
|
316
374
|
})
|
317
375
|
})]
|
@@ -323,7 +381,7 @@ const TextFormat = props => {
|
|
323
381
|
variant: "body1",
|
324
382
|
color: "primary",
|
325
383
|
sx: classes.typoLabel2,
|
326
|
-
children: "Lists"
|
384
|
+
children: translation("Lists")
|
327
385
|
}), /*#__PURE__*/_jsx(Grid, {
|
328
386
|
item: true,
|
329
387
|
xs: 12,
|
@@ -332,7 +390,8 @@ const TextFormat = props => {
|
|
332
390
|
const Comp = ButtonComp[m?.component] || BlockButton;
|
333
391
|
return /*#__PURE__*/_jsx(Comp, {
|
334
392
|
editor: editor,
|
335
|
-
...m
|
393
|
+
...m,
|
394
|
+
customProps: customProps
|
336
395
|
}, `pptool_block_${i}_${m.id}`);
|
337
396
|
})
|
338
397
|
})]
|
@@ -348,20 +407,17 @@ const TextFormat = props => {
|
|
348
407
|
variant: "body1",
|
349
408
|
color: "primary",
|
350
409
|
sx: classes.typoLabel,
|
351
|
-
children: "Typography"
|
410
|
+
children: translation("Typography")
|
352
411
|
}), /*#__PURE__*/_jsxs(Grid, {
|
353
412
|
item: true,
|
354
413
|
xs: 12,
|
355
414
|
className: "typo-icons",
|
356
415
|
sx: classes.evenSpace,
|
357
|
-
children: [
|
358
|
-
classes: classes,
|
359
|
-
editor: editor,
|
360
|
-
closeMainPopup: closeMainPopup || onClose
|
361
|
-
}), fontStyle?.map((m, i) => {
|
416
|
+
children: [fontStyle?.map((m, i) => {
|
362
417
|
return /*#__PURE__*/_jsx(MarkButton, {
|
363
418
|
editor: editor,
|
364
|
-
...m
|
419
|
+
...m,
|
420
|
+
customProps: customProps
|
365
421
|
}, `pptool_mark_${i}_${m.id}`);
|
366
422
|
}), /*#__PURE__*/_jsx(LinkButton, {
|
367
423
|
active: isBlockActive(editor, link.format),
|
@@ -370,7 +426,8 @@ const TextFormat = props => {
|
|
370
426
|
}, link.id), /*#__PURE__*/_jsx(SelectSuperSubscript, {
|
371
427
|
classes: classes,
|
372
428
|
editor: editor,
|
373
|
-
closeMainPopup: closeMainPopup || onClose
|
429
|
+
closeMainPopup: closeMainPopup || onClose,
|
430
|
+
customProps: customProps
|
374
431
|
})]
|
375
432
|
})]
|
376
433
|
}), /*#__PURE__*/_jsx(Grid, {
|
@@ -378,6 +435,32 @@ const TextFormat = props => {
|
|
378
435
|
xs: 12,
|
379
436
|
sx: classes.dividerGrid,
|
380
437
|
children: /*#__PURE__*/_jsx(Divider, {})
|
438
|
+
}), /*#__PURE__*/_jsxs(Grid, {
|
439
|
+
item: true,
|
440
|
+
xs: 12,
|
441
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
442
|
+
variant: "body1",
|
443
|
+
color: "primary",
|
444
|
+
sx: classes.typoLabel,
|
445
|
+
children: "Line Spacing"
|
446
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
447
|
+
item: true,
|
448
|
+
xs: 12,
|
449
|
+
className: "typo-icons",
|
450
|
+
sx: classes.evenSpace,
|
451
|
+
children: /*#__PURE__*/_jsx(LineSpacing, {
|
452
|
+
value: lineSpacingValue,
|
453
|
+
onChange: handleLineSpacing,
|
454
|
+
data: {
|
455
|
+
key: "lineHeight"
|
456
|
+
}
|
457
|
+
})
|
458
|
+
})]
|
459
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
460
|
+
item: true,
|
461
|
+
xs: 12,
|
462
|
+
sx: classes.dividerGrid,
|
463
|
+
children: /*#__PURE__*/_jsx(Divider, {})
|
381
464
|
}), /*#__PURE__*/_jsx(Grid, {
|
382
465
|
item: true,
|
383
466
|
xs: 12,
|
@@ -389,7 +472,7 @@ const TextFormat = props => {
|
|
389
472
|
variant: "body1",
|
390
473
|
color: "primary",
|
391
474
|
sx: classes.typoLabel3,
|
392
|
-
children: "Decorations"
|
475
|
+
children: translation("Decorations")
|
393
476
|
})
|
394
477
|
}), /*#__PURE__*/_jsxs(Grid, {
|
395
478
|
item: true,
|
@@ -409,7 +492,7 @@ const TextFormat = props => {
|
|
409
492
|
style: {
|
410
493
|
background: bqBgColor
|
411
494
|
},
|
412
|
-
children: "Colorbox"
|
495
|
+
children: translation("Colorbox")
|
413
496
|
}), /*#__PURE__*/_jsx("div", {
|
414
497
|
className: "vl"
|
415
498
|
}), /*#__PURE__*/_jsx(Button, {
|
@@ -430,7 +513,7 @@ const TextFormat = props => {
|
|
430
513
|
...getBorderColor(bqColor || "transparent", 3),
|
431
514
|
borderWidth: bqColor ? "0px 0px 0px 3px" : "0px"
|
432
515
|
},
|
433
|
-
children: "Quote"
|
516
|
+
children: translation("Quote")
|
434
517
|
})
|
435
518
|
}), /*#__PURE__*/_jsx("div", {
|
436
519
|
className: "vl"
|