@flozy/editor 9.2.5 → 9.2.7
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 +33 -9
- package/dist/Editor/CommonEditor.js +117 -27
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +19 -1
- 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 +31 -14
- 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 +57 -12
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +5 -5
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/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 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +19 -9
- package/dist/Editor/Elements/DataView/Layouts/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 +3 -2
- 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 +7 -6
- 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 +12 -6
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +32 -2
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +132 -33
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +6 -3
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- 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/UserInputs.js +4 -2
- package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +21 -18
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +8 -3
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -3
- 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 +15 -10
- 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 +74 -44
- 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 +16 -5
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
- package/dist/Editor/Elements/Search/SearchButton.js +6 -3
- 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 -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 +56 -32
- package/dist/Editor/Elements/Table/TableCell.js +12 -29
- 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 +10 -0
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/Elements/Variables/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/MiniEditor.js +9 -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 +7 -15
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +20 -15
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +19 -13
- 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 +6 -2
- 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 +15 -7
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +84 -32
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +3 -8
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/CalenderIconTick.js +1 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +35 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +88 -0
- package/dist/Editor/common/CustomDialog/styles.js +80 -0
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/DnD/Draggable.js +0 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/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/ImageSelector/UploadStyles.js +0 -1
- 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/MentionsPopup/Styles.js +109 -71
- package/dist/Editor/common/MentionsPopup/index.js +8 -4
- 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 +4 -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/SwitchViewport/SwitchViewport.js +11 -4
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +20 -8
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +5 -4
- package/dist/Editor/common/RnD/Utils/index.js +45 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +1 -2
- package/dist/Editor/common/RnD/index.js +34 -7
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +75 -4
- 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 +41 -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/Uploader.js +16 -5
- package/dist/Editor/commonStyle.js +114 -69
- package/dist/Editor/helper/index.js +8 -12
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useDrag.js +16 -10
- package/dist/Editor/hooks/useEditorScroll.js +10 -5
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +25 -13
- package/dist/Editor/hooks/useTable.js +1 -1
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +19 -14
- 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 +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +283 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +220 -0
- package/dist/Editor/themeSettings/fonts/style.js +44 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +320 -0
- package/dist/Editor/themeSettings/style.js +152 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +356 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +162 -45
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
- package/dist/Editor/utils/divider.js +8 -0
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +77 -19
- package/dist/Editor/utils/link.js +1 -1
- package/dist/Editor/utils/table.js +17 -6
- package/package.json +5 -2
@@ -12,9 +12,11 @@ import useTable, { TableProvider, getDefaultTableSelection } from "../../hooks/u
|
|
12
12
|
import AddRowCol from "./AddRowCol";
|
13
13
|
import TableTool from "./TableTool";
|
14
14
|
import { MoreIcon, SettingsIcon } from "../../assets/svg/TableIcons";
|
15
|
+
import { DeleteIcon } from "../../assets/svg/AIIcons";
|
15
16
|
import { getSelectedCls } from "../../utils/helper";
|
16
17
|
import SwipeableDrawerComponent from "../../common/SwipeableDrawer";
|
17
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
18
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
21
|
const hideRowDragBtns = (hide, dragRowBtnCls) => {
|
20
22
|
const rowDragBtns = document.querySelectorAll(`.${dragRowBtnCls}`);
|
@@ -25,19 +27,23 @@ const hideRowDragBtns = (hide, dragRowBtnCls) => {
|
|
25
27
|
const ToolTableComponent = props => {
|
26
28
|
const {
|
27
29
|
handleAction,
|
28
|
-
editorTheme
|
30
|
+
editorTheme,
|
31
|
+
translation
|
29
32
|
} = props;
|
30
33
|
const {
|
31
34
|
updateTableSelection
|
32
35
|
} = useTable();
|
33
|
-
return /*#__PURE__*/_jsx(
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
return /*#__PURE__*/_jsx("div", {
|
37
|
+
children: /*#__PURE__*/_jsx(TableTool, {
|
38
|
+
theme: editorTheme,
|
39
|
+
handleToolAction: (type, option) => {
|
40
|
+
handleAction(type, option);
|
41
|
+
if (type === "duplicate") {
|
42
|
+
updateTableSelection(getDefaultTableSelection());
|
43
|
+
}
|
44
|
+
},
|
45
|
+
translation: translation
|
46
|
+
})
|
41
47
|
});
|
42
48
|
};
|
43
49
|
const MoreTableSettings = props => {
|
@@ -46,9 +52,13 @@ const MoreTableSettings = props => {
|
|
46
52
|
handleAction,
|
47
53
|
editorTheme,
|
48
54
|
setExpandTools,
|
49
|
-
classes
|
55
|
+
classes,
|
56
|
+
customProps
|
50
57
|
} = props;
|
51
58
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
59
|
+
const {
|
60
|
+
translation
|
61
|
+
} = customProps;
|
52
62
|
return isMobile ? /*#__PURE__*/_jsx(SwipeableDrawerComponent, {
|
53
63
|
open: Boolean(exandTools),
|
54
64
|
onClose: () => {
|
@@ -75,7 +85,8 @@ const MoreTableSettings = props => {
|
|
75
85
|
children: /*#__PURE__*/_jsx("div", {
|
76
86
|
children: /*#__PURE__*/_jsx(ToolTableComponent, {
|
77
87
|
handleAction: handleAction,
|
78
|
-
editorTheme: editorTheme
|
88
|
+
editorTheme: editorTheme,
|
89
|
+
translation: translation
|
79
90
|
})
|
80
91
|
})
|
81
92
|
})
|
@@ -89,34 +100,44 @@ const ToolBar = props => {
|
|
89
100
|
handleExpand,
|
90
101
|
handleAction,
|
91
102
|
exandTools,
|
92
|
-
openSetttings
|
103
|
+
openSetttings,
|
104
|
+
hideTools
|
93
105
|
} = props;
|
94
106
|
const {
|
95
107
|
getSelectedCells
|
96
108
|
} = useTable();
|
97
109
|
const viewTool = selected && !showTool && getSelectedCells()?.length <= 1;
|
98
|
-
return viewTool ? /*#__PURE__*/
|
110
|
+
return viewTool ? /*#__PURE__*/_jsx(Box, {
|
99
111
|
component: "div",
|
100
112
|
contentEditable: false,
|
101
113
|
className: `tableToolBar ${exandTools ? "active" : ""}`,
|
102
114
|
sx: classes.tableToolBar,
|
103
|
-
children:
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
115
|
+
children: !hideTools.includes("settings") ? /*#__PURE__*/_jsxs(_Fragment, {
|
116
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
117
|
+
title: "Settings",
|
118
|
+
arrow: true,
|
119
|
+
onClick: () => handleAction("settings"),
|
120
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
121
|
+
className: getSelectedCls("toolbtn toggle", openSetttings),
|
122
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
123
|
+
})
|
124
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
125
|
+
title: "Show Tools",
|
126
|
+
arrow: true,
|
127
|
+
onClick: handleExpand,
|
128
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
129
|
+
className: getSelectedCls("toolbtn toggle", exandTools),
|
130
|
+
children: /*#__PURE__*/_jsx(MoreIcon, {})
|
131
|
+
})
|
132
|
+
})]
|
133
|
+
}) : /*#__PURE__*/_jsx(Tooltip, {
|
134
|
+
title: "Delete",
|
113
135
|
arrow: true,
|
114
|
-
onClick:
|
136
|
+
onClick: () => handleAction("delete"),
|
115
137
|
children: /*#__PURE__*/_jsx(IconButton, {
|
116
|
-
|
117
|
-
children: /*#__PURE__*/_jsx(MoreIcon, {})
|
138
|
+
children: /*#__PURE__*/_jsx(DeleteIcon, {})
|
118
139
|
})
|
119
|
-
})
|
140
|
+
})
|
120
141
|
}) : null;
|
121
142
|
};
|
122
143
|
const Table = props => {
|
@@ -133,7 +154,8 @@ const Table = props => {
|
|
133
154
|
const classes = TableStyles(editorTheme);
|
134
155
|
const {
|
135
156
|
readOnly,
|
136
|
-
isMobile
|
157
|
+
isMobile,
|
158
|
+
hideTools = []
|
137
159
|
} = customProps;
|
138
160
|
const [openSetttings, setOpenSettings] = useState(false);
|
139
161
|
const [exandTools, setExpandTools] = useState(null);
|
@@ -304,12 +326,12 @@ const Table = props => {
|
|
304
326
|
...attributes,
|
305
327
|
children: children
|
306
328
|
})
|
307
|
-
}), /*#__PURE__*/_jsx(AddRowCol, {
|
329
|
+
}), !hideTools.includes("add_column") && /*#__PURE__*/_jsx(AddRowCol, {
|
308
330
|
...commonAddBtnProps,
|
309
331
|
addType: "col",
|
310
332
|
onAdd: addCol
|
311
333
|
})]
|
312
|
-
}), /*#__PURE__*/_jsx(AddRowCol, {
|
334
|
+
}), !hideTools.includes("add_column") && /*#__PURE__*/_jsx(AddRowCol, {
|
313
335
|
...commonAddBtnProps,
|
314
336
|
addType: "row",
|
315
337
|
onAdd: addRow
|
@@ -320,13 +342,15 @@ const Table = props => {
|
|
320
342
|
handleExpand: handleExpand,
|
321
343
|
handleAction: handleAction,
|
322
344
|
exandTools: exandTools,
|
323
|
-
openSetttings: openSetttings
|
345
|
+
openSetttings: openSetttings,
|
346
|
+
hideTools: hideTools
|
324
347
|
}), /*#__PURE__*/_jsx(MoreTableSettings, {
|
325
348
|
exandTools: exandTools,
|
326
349
|
handleAction: handleAction,
|
327
350
|
editorTheme: editorTheme,
|
328
351
|
setExpandTools: setExpandTools,
|
329
|
-
classes: classes
|
352
|
+
classes: classes,
|
353
|
+
customProps: customProps
|
330
354
|
}), openSetttings ? /*#__PURE__*/_jsx(TablePopup, {
|
331
355
|
element: tableProps?.styleProps || {},
|
332
356
|
onSave: onSave,
|
@@ -12,30 +12,9 @@ import TablePopup from "./TablePopup";
|
|
12
12
|
import { Droppable } from "./Droppable";
|
13
13
|
import { useDndContext } from "@dnd-kit/core";
|
14
14
|
import { getNodeWithType } from "../../utils/helper";
|
15
|
-
import { isEmptyTextNode } from "../../helper";
|
16
|
-
import SimpleText from "../SimpleText";
|
17
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
19
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
|
-
const withOldTableData = WrappedComponent => {
|
21
|
-
// to prevent old table data issues, ("table-cell" node is coming without parent "table" node (FS-9330))
|
22
|
-
return function TableHOC(props) {
|
23
|
-
const tableData = useTable();
|
24
|
-
if (!tableData) {
|
25
|
-
const {
|
26
|
-
element
|
27
|
-
} = props;
|
28
|
-
const isEmpty = isEmptyTextNode(element);
|
29
|
-
return /*#__PURE__*/_jsx(SimpleText, {
|
30
|
-
...props,
|
31
|
-
isEmpty: isEmpty
|
32
|
-
});
|
33
|
-
}
|
34
|
-
return /*#__PURE__*/_jsx(WrappedComponent, {
|
35
|
-
...props
|
36
|
-
});
|
37
|
-
};
|
38
|
-
};
|
39
18
|
const Resizer = ({
|
40
19
|
classes,
|
41
20
|
onMouseDown,
|
@@ -69,7 +48,8 @@ const TableCell = props => {
|
|
69
48
|
customProps
|
70
49
|
} = props;
|
71
50
|
const {
|
72
|
-
readOnly
|
51
|
+
readOnly,
|
52
|
+
hideTools = []
|
73
53
|
} = customProps;
|
74
54
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
75
55
|
const {
|
@@ -120,15 +100,19 @@ const TableCell = props => {
|
|
120
100
|
const [openSettings, setOpenSettings] = useState(false);
|
121
101
|
const table = new TableUtil(editor);
|
122
102
|
const tableProps = table.getTableProps();
|
123
|
-
const [tableNode] = getNodeWithType(editor, "table",
|
124
|
-
|
103
|
+
const [tableNode] = getNodeWithType(editor, "table", {
|
104
|
+
at: path
|
105
|
+
}); // getting cannot find the descendant path error, while deleting table because of unknown re-render issue, so wrapping it with try catch
|
106
|
+
const [rowNode] = getNodeWithType(editor, "table-row", {
|
107
|
+
at: path
|
108
|
+
});
|
125
109
|
const currentPath = path.slice(-2) || []; // getting last 2 items from path, which gives row and column position of the cell
|
126
110
|
const [row, column] = currentPath;
|
127
111
|
const isFirstRow = row === 0;
|
128
112
|
const isFirstColumn = column === 0;
|
129
113
|
const [hoverRow, hoverCol] = hoverPath ? hoverPath.slice(-2) : [];
|
130
|
-
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly;
|
131
|
-
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly;
|
114
|
+
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly && !hideTools.includes("drag");
|
115
|
+
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly && !hideTools.includes("drag");
|
132
116
|
const [parentProps] = tableNode || [{}];
|
133
117
|
const [rowProps] = rowNode || [{}];
|
134
118
|
const tableDOM = table.getDOMNode(path, true);
|
@@ -176,7 +160,7 @@ const TableCell = props => {
|
|
176
160
|
};
|
177
161
|
useEffect(() => {
|
178
162
|
const currentPath = path?.toString();
|
179
|
-
|
163
|
+
setTimeout(() => {
|
180
164
|
if (tableResizing === currentPath) {
|
181
165
|
setTableResizing(null);
|
182
166
|
|
@@ -192,7 +176,6 @@ const TableCell = props => {
|
|
192
176
|
if (resizing) {
|
193
177
|
setTableResizing(currentPath);
|
194
178
|
}
|
195
|
-
return () => clearTimeout(timeoutId);
|
196
179
|
}, [resizing]);
|
197
180
|
const onMouseEnter = path => {
|
198
181
|
setHoverPath(path);
|
@@ -476,4 +459,4 @@ const TableCell = props => {
|
|
476
459
|
}) : null]
|
477
460
|
});
|
478
461
|
};
|
479
|
-
export default
|
462
|
+
export default TableCell;
|
@@ -15,8 +15,11 @@ const TablePopup = props => {
|
|
15
15
|
styleType
|
16
16
|
} = props;
|
17
17
|
const styles = STYLE_TYPES[styleType] || tableStyle;
|
18
|
+
const {
|
19
|
+
translation
|
20
|
+
} = customProps;
|
18
21
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
19
|
-
title: "Table",
|
22
|
+
title: translation("Table"),
|
20
23
|
type: "gridStyle",
|
21
24
|
element: element,
|
22
25
|
onSave: onSave,
|
@@ -10,7 +10,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
11
|
const TableSelector = ({
|
12
12
|
editor,
|
13
|
-
icoBtnType
|
13
|
+
icoBtnType,
|
14
|
+
customProps
|
14
15
|
}) => {
|
15
16
|
const tableOptionsRef = useRef();
|
16
17
|
const [selection, setSelection] = useState();
|
@@ -20,6 +21,9 @@ const TableSelector = ({
|
|
20
21
|
column: 2
|
21
22
|
});
|
22
23
|
const table = new TableUtil(editor);
|
24
|
+
const {
|
25
|
+
translation
|
26
|
+
} = customProps;
|
23
27
|
const handleButtonClick = () => {
|
24
28
|
setSelection(editor.selection);
|
25
29
|
setShowOptions(true);
|
@@ -72,7 +76,7 @@ const TableSelector = ({
|
|
72
76
|
variant: "h6",
|
73
77
|
className: "popupTitle",
|
74
78
|
color: "primary",
|
75
|
-
children: "Table"
|
79
|
+
children: translation("Table")
|
76
80
|
}), /*#__PURE__*/_jsx(Grid, {
|
77
81
|
style: {
|
78
82
|
display: "flex"
|
@@ -110,7 +114,7 @@ const TableSelector = ({
|
|
110
114
|
fontSize: "14px",
|
111
115
|
fontWeight: 500
|
112
116
|
},
|
113
|
-
children: "
|
117
|
+
children: translation("numberOfRow")
|
114
118
|
})
|
115
119
|
}), /*#__PURE__*/_jsx(TextField, {
|
116
120
|
fullWidth: true,
|
@@ -137,7 +141,7 @@ const TableSelector = ({
|
|
137
141
|
fontSize: "14px",
|
138
142
|
fontWeight: 500
|
139
143
|
},
|
140
|
-
children: "
|
144
|
+
children: translation("numberOfCoumns")
|
141
145
|
})
|
142
146
|
}), /*#__PURE__*/_jsx(TextField, {
|
143
147
|
fullWidth: true,
|
@@ -158,11 +162,11 @@ const TableSelector = ({
|
|
158
162
|
children: [/*#__PURE__*/_jsx(Button, {
|
159
163
|
onClick: onCancel,
|
160
164
|
className: "secondaryBtn",
|
161
|
-
children: "Cancel"
|
165
|
+
children: translation("Cancel")
|
162
166
|
}), /*#__PURE__*/_jsx(Button, {
|
163
167
|
onClick: handleInsert,
|
164
168
|
className: "primaryBtn",
|
165
|
-
children: "Save"
|
169
|
+
children: translation("Save")
|
166
170
|
})]
|
167
171
|
})]
|
168
172
|
})
|
@@ -67,7 +67,8 @@ export function TableToolOnDrag({
|
|
67
67
|
theme,
|
68
68
|
dragType,
|
69
69
|
handleToolAction,
|
70
|
-
hideDelete
|
70
|
+
hideDelete,
|
71
|
+
translation
|
71
72
|
}) {
|
72
73
|
const classes = Styles(theme);
|
73
74
|
const tools = getTools(dragType, hideDelete);
|
@@ -81,12 +82,14 @@ export function TableToolOnDrag({
|
|
81
82
|
btnProps: {
|
82
83
|
onMouseDown: e => e.stopPropagation(),
|
83
84
|
onMouseUp: e => e.stopPropagation()
|
84
|
-
}
|
85
|
+
},
|
86
|
+
translation: translation
|
85
87
|
});
|
86
88
|
}
|
87
89
|
function TableTool({
|
88
90
|
theme,
|
89
|
-
handleToolAction
|
91
|
+
handleToolAction,
|
92
|
+
translation
|
90
93
|
}) {
|
91
94
|
const classes = Styles(theme);
|
92
95
|
return /*#__PURE__*/_jsx(CustomSelect, {
|
@@ -95,7 +98,8 @@ function TableTool({
|
|
95
98
|
options: wholeTableTools,
|
96
99
|
onSend: (value, option) => {
|
97
100
|
handleToolAction(value, option);
|
98
|
-
}
|
101
|
+
},
|
102
|
+
translation: translation
|
99
103
|
});
|
100
104
|
}
|
101
105
|
export default TableTool;
|
@@ -2,7 +2,14 @@ import React, { useEffect, useState } from "react";
|
|
2
2
|
import { Editor } from "slate";
|
3
3
|
import { useSlate } from "slate-react";
|
4
4
|
import { getNodeText } from "../../utils/helper";
|
5
|
+
import { Text } from "slate";
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
const isEmptyTextNode = node => {
|
8
|
+
if (Text.isText(node)) {
|
9
|
+
return !node.text.trim();
|
10
|
+
}
|
11
|
+
return false;
|
12
|
+
};
|
6
13
|
const Title = props => {
|
7
14
|
const {
|
8
15
|
attributes,
|
@@ -11,8 +18,11 @@ const Title = props => {
|
|
11
18
|
customProps
|
12
19
|
} = props;
|
13
20
|
useDetectExitFromTitle(element, customProps?.getTitleSaveData);
|
21
|
+
const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
|
14
22
|
return /*#__PURE__*/_jsx("div", {
|
15
23
|
...attributes,
|
24
|
+
placeholder: "Title",
|
25
|
+
className: `content-editable ${isEmpty}`,
|
16
26
|
style: {
|
17
27
|
fontWeight: "bold",
|
18
28
|
fontSize: "20px"
|
@@ -13,6 +13,9 @@ const TopBannerButton = props => {
|
|
13
13
|
customProps
|
14
14
|
} = props;
|
15
15
|
const [open, setOpen] = useState(false);
|
16
|
+
const {
|
17
|
+
translation
|
18
|
+
} = customProps;
|
16
19
|
const onSelectImage = url => {
|
17
20
|
if (url) {
|
18
21
|
insertTopBanner(editor, {
|
@@ -29,7 +32,7 @@ const TopBannerButton = props => {
|
|
29
32
|
};
|
30
33
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
31
34
|
children: [/*#__PURE__*/_jsx(ToolbarIcon, {
|
32
|
-
title: "Top Banner",
|
35
|
+
title: translation("Top Banner"),
|
33
36
|
onClick: handleClick,
|
34
37
|
icon: /*#__PURE__*/_jsx(Icon, {
|
35
38
|
icon: "topbanner"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
const VariableStyles =
|
1
|
+
const VariableStyles = theme => ({
|
2
2
|
variablesItem: {
|
3
3
|
color: "#2563EB",
|
4
4
|
background: "#EEEEEE"
|
@@ -37,8 +37,34 @@ const VariableStyles = () => ({
|
|
37
37
|
"& .MuiMenuItem-root": {
|
38
38
|
color: "#64748B"
|
39
39
|
},
|
40
|
+
"& .MuiPaper-root": {
|
41
|
+
borderRadius: '8px',
|
42
|
+
backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
|
43
|
+
marginTop: '5px',
|
44
|
+
"@media only screen and (max-width: 599px)": {
|
45
|
+
padding: '10px 0px'
|
46
|
+
}
|
47
|
+
},
|
48
|
+
"& .MuiList-root": {
|
49
|
+
padding: '0px'
|
50
|
+
},
|
51
|
+
"& .MuiButtonBase-root": {
|
52
|
+
margin: '6px',
|
53
|
+
borderRadius: '8px',
|
54
|
+
padding: '6px 14px',
|
55
|
+
fontSize: '14px',
|
56
|
+
fontWeight: '400',
|
57
|
+
color: theme?.palette?.editor?.deletePopUpButtonTextColor,
|
58
|
+
"&:hover": {
|
59
|
+
background: `${theme?.palette?.editor?.menuOptionHoverBackground} !important`
|
60
|
+
},
|
61
|
+
"@media only screen and (max-width: 599px)": {
|
62
|
+
minHeight: '30px',
|
63
|
+
margin: '0px 6px'
|
64
|
+
}
|
65
|
+
},
|
40
66
|
"& .Mui-selected": {
|
41
|
-
backgroundColor:
|
67
|
+
backgroundColor: 'unset !important'
|
42
68
|
}
|
43
69
|
}
|
44
70
|
});
|
@@ -3,11 +3,15 @@ import { useSlateStatic } from "slate-react";
|
|
3
3
|
import { MenuItem, Select } from "@mui/material";
|
4
4
|
import { insertVariables } from "../../utils/variables";
|
5
5
|
import VariableStyles from "./Style";
|
6
|
-
import
|
6
|
+
import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
|
7
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
10
|
const VariableButton = props => {
|
10
|
-
const
|
11
|
+
const {
|
12
|
+
theme
|
13
|
+
} = useEditorContext();
|
14
|
+
const classes = VariableStyles(theme);
|
11
15
|
const editor = useSlateStatic();
|
12
16
|
const {
|
13
17
|
options
|
@@ -24,13 +28,14 @@ const VariableButton = props => {
|
|
24
28
|
value: "",
|
25
29
|
sx: classes.variableBtn,
|
26
30
|
onChange: updateVariable,
|
27
|
-
IconComponent: () => /*#__PURE__*/_jsx(
|
31
|
+
IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {}),
|
28
32
|
MenuProps: {
|
29
33
|
sx: classes.variableMenuItem,
|
30
34
|
PaperProps: {
|
31
35
|
style: {
|
32
36
|
maxHeight: 300,
|
33
|
-
overflowY: "auto"
|
37
|
+
overflowY: "auto",
|
38
|
+
transformOrigin: 'top left'
|
34
39
|
},
|
35
40
|
sx: {
|
36
41
|
"&::-webkit-scrollbar-track": {
|
@@ -40,6 +45,14 @@ const VariableButton = props => {
|
|
40
45
|
borderRadius: "16px"
|
41
46
|
}
|
42
47
|
}
|
48
|
+
},
|
49
|
+
anchorOrigin: {
|
50
|
+
vertical: 'bottom',
|
51
|
+
horizontal: 'right'
|
52
|
+
},
|
53
|
+
transformOrigin: {
|
54
|
+
vertical: 'top',
|
55
|
+
horizontal: 'right'
|
43
56
|
}
|
44
57
|
},
|
45
58
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
@@ -26,7 +26,8 @@ const MiniEditor = props => {
|
|
26
26
|
className,
|
27
27
|
otherProps,
|
28
28
|
onSave,
|
29
|
-
theme
|
29
|
+
theme,
|
30
|
+
translation
|
30
31
|
} = props;
|
31
32
|
const {
|
32
33
|
CHARACTERS = []
|
@@ -41,11 +42,15 @@ const MiniEditor = props => {
|
|
41
42
|
const [value, setValue] = useState(ensureWrappedVariables(updatedContent));
|
42
43
|
const [deboundedValue] = useDebounce(value, 500);
|
43
44
|
const isReadOnly = readOnly === "readonly";
|
45
|
+
const {
|
46
|
+
translationMock
|
47
|
+
} = otherProps;
|
44
48
|
const customProps = {
|
45
49
|
...(otherProps || {}),
|
46
50
|
readOnly: isReadOnly,
|
47
51
|
editorPlaceholder: miniEditorPlaceholder,
|
48
|
-
page_id: id
|
52
|
+
page_id: id,
|
53
|
+
translation: translation || translationMock
|
49
54
|
};
|
50
55
|
const [mentions, setMentions] = useMentions({
|
51
56
|
editor,
|
@@ -58,7 +63,8 @@ const MiniEditor = props => {
|
|
58
63
|
} = mentions;
|
59
64
|
const chars = type ? Shorthands[type]({
|
60
65
|
...mentions,
|
61
|
-
CHARACTERS
|
66
|
+
CHARACTERS,
|
67
|
+
translation: translation || translationMock
|
62
68
|
}) : [];
|
63
69
|
useEffect(() => {
|
64
70
|
if (onSave && isInteracted) {
|
@@ -133,7 +133,7 @@ const editorStyles = ({
|
|
133
133
|
},
|
134
134
|
"& .accordion-summary-collapse-btn": {
|
135
135
|
padding: "4px",
|
136
|
-
width:
|
136
|
+
width: "5px"
|
137
137
|
},
|
138
138
|
"& .workflow-icon-btn": {
|
139
139
|
pointerEvents: "none",
|
@@ -242,7 +242,7 @@ const editorStyles = ({
|
|
242
242
|
}
|
243
243
|
},
|
244
244
|
"& .section-tw": {
|
245
|
-
background:
|
245
|
+
background: "transparent !important",
|
246
246
|
"& button": {
|
247
247
|
padding: "2px",
|
248
248
|
borderRadius: "0px",
|
@@ -291,8 +291,8 @@ const editorStyles = ({
|
|
291
291
|
}
|
292
292
|
},
|
293
293
|
"& ::selection": {
|
294
|
-
background:
|
295
|
-
color:
|
294
|
+
background: "rgba(35, 131, 226, 0.35)!important",
|
295
|
+
color: "inherit"
|
296
296
|
},
|
297
297
|
"&.readOnlyContainer": {
|
298
298
|
"& .max-content": {
|
@@ -302,7 +302,7 @@ const editorStyles = ({
|
|
302
302
|
},
|
303
303
|
fullScreenWrapper: {
|
304
304
|
"& .editor-wrapper": {
|
305
|
-
paddingTop:
|
305
|
+
paddingTop: "20px"
|
306
306
|
},
|
307
307
|
"& .MuiDialog-paper, & .MuiPopover-paper": {
|
308
308
|
background: `${theme?.palette?.editor?.background} !important`
|
@@ -59,7 +59,8 @@ const BasicToolbar = props => {
|
|
59
59
|
children: fontStyle?.map((m, i) => {
|
60
60
|
return /*#__PURE__*/_jsx(MarkButton, {
|
61
61
|
editor: editor,
|
62
|
-
...m
|
62
|
+
...m,
|
63
|
+
customProps: customProps
|
63
64
|
}, `pptool_mark_${i}_${m.id}`);
|
64
65
|
})
|
65
66
|
}), !hideLink && /*#__PURE__*/_jsx(Grid, {
|
@@ -10,8 +10,12 @@ const BlockButton = props => {
|
|
10
10
|
const {
|
11
11
|
editor,
|
12
12
|
format,
|
13
|
-
title
|
13
|
+
title,
|
14
|
+
customProps
|
14
15
|
} = props;
|
16
|
+
const {
|
17
|
+
translation
|
18
|
+
} = customProps;
|
15
19
|
const isMark = MARK_TYPES?.indexOf(format) >= 0;
|
16
20
|
const isActive = isMark ? isMarkActive(editor, format) : isBlockActive(editor, format);
|
17
21
|
const {
|
@@ -29,7 +33,7 @@ const BlockButton = props => {
|
|
29
33
|
toggleBlock(editor, format);
|
30
34
|
}
|
31
35
|
},
|
32
|
-
title: title,
|
36
|
+
title: translation(title),
|
33
37
|
sx: classes.textAlignButtons,
|
34
38
|
style: {
|
35
39
|
color: "#64748B"
|
@@ -1,8 +1,32 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Select, MenuItem } from "@mui/material";
|
3
|
-
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
3
|
+
import { addMarkData, activeMark, getSelectedElementStyle } from "../../utils/SlateUtilityFunctions.js";
|
4
|
+
import { toolbarGroups } from "../toolbarGroups.js";
|
4
5
|
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
6
|
+
import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList.js";
|
5
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
const allTools = toolbarGroups.flat();
|
9
|
+
const fontWeight = allTools.find(f => f.format === "fontWeight");
|
10
|
+
export const getValue = (editor, format) => {
|
11
|
+
switch (format) {
|
12
|
+
case "fontFamily":
|
13
|
+
{
|
14
|
+
const style = getSelectedElementStyle("font-family", editor);
|
15
|
+
return style || defaultFonts[0];
|
16
|
+
}
|
17
|
+
case "fontWeight":
|
18
|
+
{
|
19
|
+
const {
|
20
|
+
options
|
21
|
+
} = fontWeight || {};
|
22
|
+
const fontWeightStyle = getSelectedElementStyle("font-weight", editor);
|
23
|
+
const selected = options?.find(o => o.value === fontWeightStyle || o.numVal === fontWeightStyle);
|
24
|
+
return selected?.value;
|
25
|
+
}
|
26
|
+
default:
|
27
|
+
return activeMark(editor, format);
|
28
|
+
}
|
29
|
+
};
|
6
30
|
const Dropdown = ({
|
7
31
|
classes,
|
8
32
|
editor,
|
@@ -10,7 +34,7 @@ const Dropdown = ({
|
|
10
34
|
options,
|
11
35
|
width
|
12
36
|
}) => {
|
13
|
-
const value =
|
37
|
+
const value = getValue(editor, format);
|
14
38
|
const changeMarkData = (event, format) => {
|
15
39
|
event.preventDefault();
|
16
40
|
const value = event.target.value;
|
@@ -20,7 +44,7 @@ const Dropdown = ({
|
|
20
44
|
});
|
21
45
|
};
|
22
46
|
return /*#__PURE__*/_jsx(Select, {
|
23
|
-
value: value,
|
47
|
+
value: value || options?.[0]?.value,
|
24
48
|
className: "editor-dd",
|
25
49
|
onChange: e => changeMarkData(e, format),
|
26
50
|
MenuProps: {
|