@flozy/editor 9.1.5 → 9.1.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 +9 -33
- package/dist/Editor/CommonEditor.js +43 -121
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +1 -19
- package/dist/Editor/Elements/AI/AIInput.js +3 -5
- package/dist/Editor/Elements/AI/CustomSelect.js +5 -9
- package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -4
- package/dist/Editor/Elements/Accordion/Accordion.js +3 -4
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +1 -4
- package/dist/Editor/Elements/Accordion/AccordionButton.js +2 -6
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +1 -4
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +2 -6
- package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +1 -4
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +1 -4
- package/dist/Editor/Elements/Button/ButtonPopup.js +1 -4
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +2 -6
- package/dist/Editor/Elements/Button/EditorButton.js +14 -31
- package/dist/Editor/Elements/Carousel/Carousel.js +4 -5
- package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -6
- package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -3
- package/dist/Editor/Elements/ChipText/ChipTextPopup.js +1 -4
- package/dist/Editor/Elements/CodeToText/CodeToText.js +4 -5
- package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +2 -6
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +12 -57
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +5 -5
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- package/dist/Editor/Elements/Colorbox/ColorboxButton.js +2 -6
- package/dist/Editor/Elements/DataView/DataView.js +2 -5
- package/dist/Editor/Elements/DataView/DataViewButton.js +2 -6
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +1 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +12 -13
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +4 -7
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +5 -7
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +7 -9
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +3 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +5 -6
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +3 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +6 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +12 -15
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +6 -12
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +33 -132
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/dist/Editor/Elements/DataView/Layouts/index.js +1 -3
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +3 -6
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- package/dist/Editor/Elements/Divider/Divider.js +3 -5
- package/dist/Editor/Elements/Divider/DividerButton.js +2 -6
- package/dist/Editor/Elements/Divider/DividerPopup.js +2 -3
- package/dist/Editor/Elements/Embed/Embed.js +1 -4
- package/dist/Editor/Elements/Embed/EmbedPopup.js +1 -4
- package/dist/Editor/Elements/Embed/Image.js +11 -16
- package/dist/Editor/Elements/Embed/Video.js +7 -10
- package/dist/Editor/Elements/EmbedScript/Code.js +4 -7
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +2 -6
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +5 -8
- package/dist/Editor/Elements/Emoji/EmojiButton.js +2 -6
- package/dist/Editor/Elements/Form/FieldPopup.js +1 -4
- package/dist/Editor/Elements/Form/Form.js +9 -12
- package/dist/Editor/Elements/Form/FormButton.js +2 -6
- package/dist/Editor/Elements/Form/FormPopup.js +2 -3
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -18
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +8 -13
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +2 -3
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -4
- package/dist/Editor/Elements/Form/Workflow/index.js +9 -15
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +18 -21
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +2 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +2 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -8
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +2 -3
- package/dist/Editor/Elements/FreeGrid/Options/More.js +3 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
- package/dist/Editor/Elements/Grid/Grid.js +10 -13
- package/dist/Editor/Elements/Grid/GridButton.js +5 -9
- package/dist/Editor/Elements/Grid/GridItem.js +10 -15
- package/dist/Editor/Elements/Grid/GridItemPopup.js +1 -4
- package/dist/Editor/Elements/Grid/GridPopup.js +1 -4
- package/dist/Editor/Elements/Grid/SectionPopup.js +1 -4
- package/dist/Editor/Elements/Link/Link.js +44 -74
- package/dist/Editor/Elements/Link/LinkButton.js +1 -4
- package/dist/Editor/Elements/List/CheckList.js +9 -14
- package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -6
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -4
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +1 -4
- package/dist/Editor/Elements/Search/SearchButton.js +3 -6
- package/dist/Editor/Elements/Search/SearchList.js +3 -7
- package/dist/Editor/Elements/Signature/SignatureButton.js +2 -6
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -6
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -4
- package/dist/Editor/Elements/Signature/SignaturePopup.js +16 -17
- 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 +2 -4
- package/dist/Editor/Elements/Table/Table.js +32 -56
- package/dist/Editor/Elements/Table/TableCell.js +3 -4
- package/dist/Editor/Elements/Table/TablePopup.js +1 -4
- package/dist/Editor/Elements/Table/TableSelector.js +6 -10
- package/dist/Editor/Elements/Table/TableTool.js +4 -8
- package/dist/Editor/Elements/Title/title.js +31 -13
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +1 -4
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
- package/dist/Editor/MiniEditor.js +3 -9
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/Basic/index.js +1 -2
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +2 -6
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +4 -8
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +3 -6
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +13 -19
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +4 -10
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +4 -10
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -6
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +35 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +51 -58
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +22 -29
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -226
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -15
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +4 -8
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +5 -11
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +32 -84
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -2
- package/dist/Editor/Toolbar/Toolbar.js +10 -20
- package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
- package/dist/Editor/common/ColorPickerButton.js +9 -35
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/DnD/Draggable.js +1 -0
- package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
- package/dist/Editor/common/Icon.js +0 -28
- package/dist/Editor/common/ImageSelector/ImageSelector.js +8 -10
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +4 -6
- package/dist/Editor/common/ImageSelector/Styles.js +9 -3
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -0
- package/dist/Editor/common/LinkSettings/NavComponents.js +10 -14
- package/dist/Editor/common/LinkSettings/index.js +14 -20
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +12 -6
- package/dist/Editor/common/MentionsPopup/index.js +2 -6
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +2 -3
- package/dist/Editor/common/RnD/ElementOptions/index.js +2 -7
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +3 -8
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +3 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +2 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
- package/dist/Editor/common/RnD/OptionsPopup/index.js +3 -4
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -11
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +10 -31
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
- package/dist/Editor/common/RnD/Utils/index.js +0 -45
- package/dist/Editor/common/RnD/index.js +7 -34
- package/dist/Editor/common/Section/index.js +4 -7
- package/dist/Editor/common/Shorthands/elements.js +4 -75
- 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 +4 -6
- 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 +9 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +5 -19
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +10 -22
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +3 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +13 -27
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +14 -41
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +6 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -19
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +2 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +11 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +2 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +12 -21
- 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 +3 -4
- package/dist/Editor/common/Uploader.js +5 -16
- package/dist/Editor/commonStyle.js +69 -114
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +2 -200
- package/dist/Editor/hooks/useMouseMove.js +3 -9
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +14 -19
- package/dist/Editor/plugins/withLayout.js +2 -3
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +45 -162
- package/dist/Editor/utils/button.js +14 -0
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -23
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +27 -59
- package/dist/Editor/utils/link.js +1 -1
- package/dist/Editor/utils/table.js +0 -8
- package/package.json +2 -5
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
- package/dist/Editor/common/CustomColorPicker/index.js +0 -106
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog/index.js +0 -88
- package/dist/Editor/common/CustomDialog/styles.js +0 -80
- package/dist/Editor/common/CustomDialog2/index.js +0 -94
- package/dist/Editor/common/CustomDialog2/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -33
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
- package/dist/Editor/hooks/useEditorTheme.js +0 -153
- package/dist/Editor/theme/index.js +0 -144
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
- package/dist/Editor/themeSettings/buttons/index.js +0 -283
- package/dist/Editor/themeSettings/buttons/style.js +0 -21
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
- package/dist/Editor/themeSettings/fonts/index.js +0 -220
- package/dist/Editor/themeSettings/fonts/style.js +0 -44
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -320
- package/dist/Editor/themeSettings/style.js +0 -152
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -356
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
- package/dist/Editor/themeSettingsAI/style.js +0 -250
|
@@ -12,11 +12,9 @@ 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";
|
|
16
15
|
import { getSelectedCls } from "../../utils/helper";
|
|
17
16
|
import SwipeableDrawerComponent from "../../common/SwipeableDrawer";
|
|
18
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
19
|
const hideRowDragBtns = (hide, dragRowBtnCls) => {
|
|
22
20
|
const rowDragBtns = document.querySelectorAll(`.${dragRowBtnCls}`);
|
|
@@ -27,23 +25,19 @@ const hideRowDragBtns = (hide, dragRowBtnCls) => {
|
|
|
27
25
|
const ToolTableComponent = props => {
|
|
28
26
|
const {
|
|
29
27
|
handleAction,
|
|
30
|
-
editorTheme
|
|
31
|
-
translation
|
|
28
|
+
editorTheme
|
|
32
29
|
} = props;
|
|
33
30
|
const {
|
|
34
31
|
updateTableSelection
|
|
35
32
|
} = useTable();
|
|
36
|
-
return /*#__PURE__*/_jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
translation: translation
|
|
46
|
-
})
|
|
33
|
+
return /*#__PURE__*/_jsx(TableTool, {
|
|
34
|
+
theme: editorTheme,
|
|
35
|
+
handleToolAction: (type, option) => {
|
|
36
|
+
handleAction(type, option);
|
|
37
|
+
if (type === "duplicate") {
|
|
38
|
+
updateTableSelection(getDefaultTableSelection());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
47
41
|
});
|
|
48
42
|
};
|
|
49
43
|
const MoreTableSettings = props => {
|
|
@@ -52,13 +46,9 @@ const MoreTableSettings = props => {
|
|
|
52
46
|
handleAction,
|
|
53
47
|
editorTheme,
|
|
54
48
|
setExpandTools,
|
|
55
|
-
classes
|
|
56
|
-
customProps
|
|
49
|
+
classes
|
|
57
50
|
} = props;
|
|
58
51
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
|
59
|
-
const {
|
|
60
|
-
translation
|
|
61
|
-
} = customProps;
|
|
62
52
|
return isMobile ? /*#__PURE__*/_jsx(SwipeableDrawerComponent, {
|
|
63
53
|
open: Boolean(exandTools),
|
|
64
54
|
onClose: () => {
|
|
@@ -85,8 +75,7 @@ const MoreTableSettings = props => {
|
|
|
85
75
|
children: /*#__PURE__*/_jsx("div", {
|
|
86
76
|
children: /*#__PURE__*/_jsx(ToolTableComponent, {
|
|
87
77
|
handleAction: handleAction,
|
|
88
|
-
editorTheme: editorTheme
|
|
89
|
-
translation: translation
|
|
78
|
+
editorTheme: editorTheme
|
|
90
79
|
})
|
|
91
80
|
})
|
|
92
81
|
})
|
|
@@ -100,44 +89,34 @@ const ToolBar = props => {
|
|
|
100
89
|
handleExpand,
|
|
101
90
|
handleAction,
|
|
102
91
|
exandTools,
|
|
103
|
-
openSetttings
|
|
104
|
-
hideTools
|
|
92
|
+
openSetttings
|
|
105
93
|
} = props;
|
|
106
94
|
const {
|
|
107
95
|
getSelectedCells
|
|
108
96
|
} = useTable();
|
|
109
97
|
const viewTool = selected && !showTool && getSelectedCells()?.length <= 1;
|
|
110
|
-
return viewTool ? /*#__PURE__*/
|
|
98
|
+
return viewTool ? /*#__PURE__*/_jsxs(Box, {
|
|
111
99
|
component: "div",
|
|
112
100
|
contentEditable: false,
|
|
113
101
|
className: `tableToolBar ${exandTools ? "active" : ""}`,
|
|
114
102
|
sx: classes.tableToolBar,
|
|
115
|
-
children:
|
|
116
|
-
|
|
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",
|
|
103
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
104
|
+
title: "Settings",
|
|
135
105
|
arrow: true,
|
|
136
|
-
onClick: () => handleAction("
|
|
106
|
+
onClick: () => handleAction("settings"),
|
|
137
107
|
children: /*#__PURE__*/_jsx(IconButton, {
|
|
138
|
-
|
|
108
|
+
className: getSelectedCls("toolbtn toggle", openSetttings),
|
|
109
|
+
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
|
139
110
|
})
|
|
140
|
-
})
|
|
111
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
|
112
|
+
title: "Show Tools",
|
|
113
|
+
arrow: true,
|
|
114
|
+
onClick: handleExpand,
|
|
115
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
116
|
+
className: getSelectedCls("toolbtn toggle", exandTools),
|
|
117
|
+
children: /*#__PURE__*/_jsx(MoreIcon, {})
|
|
118
|
+
})
|
|
119
|
+
})]
|
|
141
120
|
}) : null;
|
|
142
121
|
};
|
|
143
122
|
const Table = props => {
|
|
@@ -154,8 +133,7 @@ const Table = props => {
|
|
|
154
133
|
const classes = TableStyles(editorTheme);
|
|
155
134
|
const {
|
|
156
135
|
readOnly,
|
|
157
|
-
isMobile
|
|
158
|
-
hideTools = []
|
|
136
|
+
isMobile
|
|
159
137
|
} = customProps;
|
|
160
138
|
const [openSetttings, setOpenSettings] = useState(false);
|
|
161
139
|
const [exandTools, setExpandTools] = useState(null);
|
|
@@ -326,12 +304,12 @@ const Table = props => {
|
|
|
326
304
|
...attributes,
|
|
327
305
|
children: children
|
|
328
306
|
})
|
|
329
|
-
}),
|
|
307
|
+
}), /*#__PURE__*/_jsx(AddRowCol, {
|
|
330
308
|
...commonAddBtnProps,
|
|
331
309
|
addType: "col",
|
|
332
310
|
onAdd: addCol
|
|
333
311
|
})]
|
|
334
|
-
}),
|
|
312
|
+
}), /*#__PURE__*/_jsx(AddRowCol, {
|
|
335
313
|
...commonAddBtnProps,
|
|
336
314
|
addType: "row",
|
|
337
315
|
onAdd: addRow
|
|
@@ -342,15 +320,13 @@ const Table = props => {
|
|
|
342
320
|
handleExpand: handleExpand,
|
|
343
321
|
handleAction: handleAction,
|
|
344
322
|
exandTools: exandTools,
|
|
345
|
-
openSetttings: openSetttings
|
|
346
|
-
hideTools: hideTools
|
|
323
|
+
openSetttings: openSetttings
|
|
347
324
|
}), /*#__PURE__*/_jsx(MoreTableSettings, {
|
|
348
325
|
exandTools: exandTools,
|
|
349
326
|
handleAction: handleAction,
|
|
350
327
|
editorTheme: editorTheme,
|
|
351
328
|
setExpandTools: setExpandTools,
|
|
352
|
-
classes: classes
|
|
353
|
-
customProps: customProps
|
|
329
|
+
classes: classes
|
|
354
330
|
}), openSetttings ? /*#__PURE__*/_jsx(TablePopup, {
|
|
355
331
|
element: tableProps?.styleProps || {},
|
|
356
332
|
onSave: onSave,
|
|
@@ -48,8 +48,7 @@ const TableCell = props => {
|
|
|
48
48
|
customProps
|
|
49
49
|
} = props;
|
|
50
50
|
const {
|
|
51
|
-
readOnly
|
|
52
|
-
hideTools = []
|
|
51
|
+
readOnly
|
|
53
52
|
} = customProps;
|
|
54
53
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
|
55
54
|
const {
|
|
@@ -107,8 +106,8 @@ const TableCell = props => {
|
|
|
107
106
|
const isFirstRow = row === 0;
|
|
108
107
|
const isFirstColumn = column === 0;
|
|
109
108
|
const [hoverRow, hoverCol] = hoverPath ? hoverPath.slice(-2) : [];
|
|
110
|
-
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly
|
|
111
|
-
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly
|
|
109
|
+
const showColDrag = isFirstRow && hoverCol === column && !resizing && !readOnly;
|
|
110
|
+
const showRowDrag = isFirstColumn && hoverRow === row && !resizing && !readOnly;
|
|
112
111
|
const [parentProps] = tableNode || [{}];
|
|
113
112
|
const [rowProps] = rowNode || [{}];
|
|
114
113
|
const tableDOM = table.getDOMNode(path, true);
|
|
@@ -15,11 +15,8 @@ const TablePopup = props => {
|
|
|
15
15
|
styleType
|
|
16
16
|
} = props;
|
|
17
17
|
const styles = STYLE_TYPES[styleType] || tableStyle;
|
|
18
|
-
const {
|
|
19
|
-
translation
|
|
20
|
-
} = customProps;
|
|
21
18
|
return /*#__PURE__*/_jsx(StyleBuilder, {
|
|
22
|
-
title:
|
|
19
|
+
title: "Table",
|
|
23
20
|
type: "gridStyle",
|
|
24
21
|
element: element,
|
|
25
22
|
onSave: onSave,
|
|
@@ -10,8 +10,7 @@ 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
|
|
14
|
-
customProps
|
|
13
|
+
icoBtnType
|
|
15
14
|
}) => {
|
|
16
15
|
const tableOptionsRef = useRef();
|
|
17
16
|
const [selection, setSelection] = useState();
|
|
@@ -21,9 +20,6 @@ const TableSelector = ({
|
|
|
21
20
|
column: 2
|
|
22
21
|
});
|
|
23
22
|
const table = new TableUtil(editor);
|
|
24
|
-
const {
|
|
25
|
-
translation
|
|
26
|
-
} = customProps;
|
|
27
23
|
const handleButtonClick = () => {
|
|
28
24
|
setSelection(editor.selection);
|
|
29
25
|
setShowOptions(true);
|
|
@@ -76,7 +72,7 @@ const TableSelector = ({
|
|
|
76
72
|
variant: "h6",
|
|
77
73
|
className: "popupTitle",
|
|
78
74
|
color: "primary",
|
|
79
|
-
children:
|
|
75
|
+
children: "Table"
|
|
80
76
|
}), /*#__PURE__*/_jsx(Grid, {
|
|
81
77
|
style: {
|
|
82
78
|
display: "flex"
|
|
@@ -114,7 +110,7 @@ const TableSelector = ({
|
|
|
114
110
|
fontSize: "14px",
|
|
115
111
|
fontWeight: 500
|
|
116
112
|
},
|
|
117
|
-
children:
|
|
113
|
+
children: "No.of Rows"
|
|
118
114
|
})
|
|
119
115
|
}), /*#__PURE__*/_jsx(TextField, {
|
|
120
116
|
fullWidth: true,
|
|
@@ -141,7 +137,7 @@ const TableSelector = ({
|
|
|
141
137
|
fontSize: "14px",
|
|
142
138
|
fontWeight: 500
|
|
143
139
|
},
|
|
144
|
-
children:
|
|
140
|
+
children: "No.of Columns"
|
|
145
141
|
})
|
|
146
142
|
}), /*#__PURE__*/_jsx(TextField, {
|
|
147
143
|
fullWidth: true,
|
|
@@ -162,11 +158,11 @@ const TableSelector = ({
|
|
|
162
158
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
163
159
|
onClick: onCancel,
|
|
164
160
|
className: "secondaryBtn",
|
|
165
|
-
children:
|
|
161
|
+
children: "Cancel"
|
|
166
162
|
}), /*#__PURE__*/_jsx(Button, {
|
|
167
163
|
onClick: handleInsert,
|
|
168
164
|
className: "primaryBtn",
|
|
169
|
-
children:
|
|
165
|
+
children: "Save"
|
|
170
166
|
})]
|
|
171
167
|
})]
|
|
172
168
|
})
|
|
@@ -67,8 +67,7 @@ export function TableToolOnDrag({
|
|
|
67
67
|
theme,
|
|
68
68
|
dragType,
|
|
69
69
|
handleToolAction,
|
|
70
|
-
hideDelete
|
|
71
|
-
translation
|
|
70
|
+
hideDelete
|
|
72
71
|
}) {
|
|
73
72
|
const classes = Styles(theme);
|
|
74
73
|
const tools = getTools(dragType, hideDelete);
|
|
@@ -82,14 +81,12 @@ export function TableToolOnDrag({
|
|
|
82
81
|
btnProps: {
|
|
83
82
|
onMouseDown: e => e.stopPropagation(),
|
|
84
83
|
onMouseUp: e => e.stopPropagation()
|
|
85
|
-
}
|
|
86
|
-
translation: translation
|
|
84
|
+
}
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
function TableTool({
|
|
90
88
|
theme,
|
|
91
|
-
handleToolAction
|
|
92
|
-
translation
|
|
89
|
+
handleToolAction
|
|
93
90
|
}) {
|
|
94
91
|
const classes = Styles(theme);
|
|
95
92
|
return /*#__PURE__*/_jsx(CustomSelect, {
|
|
@@ -98,8 +95,7 @@ function TableTool({
|
|
|
98
95
|
options: wholeTableTools,
|
|
99
96
|
onSend: (value, option) => {
|
|
100
97
|
handleToolAction(value, option);
|
|
101
|
-
}
|
|
102
|
-
translation: translation
|
|
98
|
+
}
|
|
103
99
|
});
|
|
104
100
|
}
|
|
105
101
|
export default TableTool;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Editor } from "slate";
|
|
3
|
+
import { useSlate } from "slate-react";
|
|
4
|
+
import { getNodeText } from "../../utils/helper";
|
|
3
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const isEmptyTextNode = node => {
|
|
5
|
-
if (Text.isText(node)) {
|
|
6
|
-
return !node.text.trim();
|
|
7
|
-
}
|
|
8
|
-
return false;
|
|
9
|
-
};
|
|
10
6
|
const Title = props => {
|
|
11
7
|
const {
|
|
12
|
-
element,
|
|
13
8
|
attributes,
|
|
14
9
|
children,
|
|
10
|
+
element,
|
|
15
11
|
customProps
|
|
16
12
|
} = props;
|
|
17
|
-
|
|
13
|
+
useDetectExitFromTitle(element, customProps?.getTitleSaveData);
|
|
18
14
|
return /*#__PURE__*/_jsx("div", {
|
|
19
15
|
...attributes,
|
|
20
|
-
placeholder: "Title",
|
|
21
|
-
className: `content-editable ${isEmpty}`,
|
|
22
16
|
style: {
|
|
23
17
|
fontWeight: "bold",
|
|
24
18
|
fontSize: "20px"
|
|
@@ -26,4 +20,28 @@ const Title = props => {
|
|
|
26
20
|
children: children
|
|
27
21
|
});
|
|
28
22
|
};
|
|
29
|
-
export default Title;
|
|
23
|
+
export default Title;
|
|
24
|
+
const useDetectExitFromTitle = (titleNode, onSaveTitle) => {
|
|
25
|
+
const editor = useSlate();
|
|
26
|
+
const [wasInsideTitle, setWasInsideTitle] = useState(false);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!editor.selection) return;
|
|
29
|
+
|
|
30
|
+
// Get the current node where the cursor is
|
|
31
|
+
const [nodeEntry] = Editor.nodes(editor, {
|
|
32
|
+
at: editor.selection,
|
|
33
|
+
match: n => n.type === "title"
|
|
34
|
+
});
|
|
35
|
+
if (nodeEntry) {
|
|
36
|
+
setWasInsideTitle(true); // User was inside the title
|
|
37
|
+
} else if (wasInsideTitle) {
|
|
38
|
+
// User exited the title node
|
|
39
|
+
const text = getNodeText(titleNode) || "";
|
|
40
|
+
if (text?.trim() && text !== "Untitled" && onSaveTitle) {
|
|
41
|
+
onSaveTitle(text);
|
|
42
|
+
}
|
|
43
|
+
setWasInsideTitle(false);
|
|
44
|
+
}
|
|
45
|
+
}, [editor.selection]);
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
@@ -13,9 +13,6 @@ const TopBannerButton = props => {
|
|
|
13
13
|
customProps
|
|
14
14
|
} = props;
|
|
15
15
|
const [open, setOpen] = useState(false);
|
|
16
|
-
const {
|
|
17
|
-
translation
|
|
18
|
-
} = customProps;
|
|
19
16
|
const onSelectImage = url => {
|
|
20
17
|
if (url) {
|
|
21
18
|
insertTopBanner(editor, {
|
|
@@ -32,7 +29,7 @@ const TopBannerButton = props => {
|
|
|
32
29
|
};
|
|
33
30
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
34
31
|
children: [/*#__PURE__*/_jsx(ToolbarIcon, {
|
|
35
|
-
title:
|
|
32
|
+
title: "Top Banner",
|
|
36
33
|
onClick: handleClick,
|
|
37
34
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
38
35
|
icon: "topbanner"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const VariableStyles =
|
|
1
|
+
const VariableStyles = () => ({
|
|
2
2
|
variablesItem: {
|
|
3
3
|
color: "#2563EB",
|
|
4
4
|
background: "#EEEEEE"
|
|
@@ -37,34 +37,8 @@ const VariableStyles = theme => ({
|
|
|
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
|
-
},
|
|
66
40
|
"& .Mui-selected": {
|
|
67
|
-
backgroundColor:
|
|
41
|
+
backgroundColor: "rgba(0, 0, 0, 0.04) !important"
|
|
68
42
|
}
|
|
69
43
|
}
|
|
70
44
|
});
|
|
@@ -3,15 +3,11 @@ 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
|
|
7
|
-
import { useEditorContext } from "../../hooks/useMouseMove";
|
|
6
|
+
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
const VariableButton = props => {
|
|
11
|
-
const
|
|
12
|
-
theme
|
|
13
|
-
} = useEditorContext();
|
|
14
|
-
const classes = VariableStyles(theme);
|
|
10
|
+
const classes = VariableStyles();
|
|
15
11
|
const editor = useSlateStatic();
|
|
16
12
|
const {
|
|
17
13
|
options
|
|
@@ -28,14 +24,13 @@ const VariableButton = props => {
|
|
|
28
24
|
value: "",
|
|
29
25
|
sx: classes.variableBtn,
|
|
30
26
|
onChange: updateVariable,
|
|
31
|
-
IconComponent: () => /*#__PURE__*/_jsx(
|
|
27
|
+
IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}),
|
|
32
28
|
MenuProps: {
|
|
33
29
|
sx: classes.variableMenuItem,
|
|
34
30
|
PaperProps: {
|
|
35
31
|
style: {
|
|
36
32
|
maxHeight: 300,
|
|
37
|
-
overflowY: "auto"
|
|
38
|
-
transformOrigin: 'top left'
|
|
33
|
+
overflowY: "auto"
|
|
39
34
|
},
|
|
40
35
|
sx: {
|
|
41
36
|
"&::-webkit-scrollbar-track": {
|
|
@@ -45,14 +40,6 @@ const VariableButton = props => {
|
|
|
45
40
|
borderRadius: "16px"
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
},
|
|
49
|
-
anchorOrigin: {
|
|
50
|
-
vertical: 'bottom',
|
|
51
|
-
horizontal: 'right'
|
|
52
|
-
},
|
|
53
|
-
transformOrigin: {
|
|
54
|
-
vertical: 'top',
|
|
55
|
-
horizontal: 'right'
|
|
56
43
|
}
|
|
57
44
|
},
|
|
58
45
|
children: [/*#__PURE__*/_jsx(MenuItem, {
|
|
@@ -26,8 +26,7 @@ const MiniEditor = props => {
|
|
|
26
26
|
className,
|
|
27
27
|
otherProps,
|
|
28
28
|
onSave,
|
|
29
|
-
theme
|
|
30
|
-
translation
|
|
29
|
+
theme
|
|
31
30
|
} = props;
|
|
32
31
|
const {
|
|
33
32
|
CHARACTERS = []
|
|
@@ -42,15 +41,11 @@ const MiniEditor = props => {
|
|
|
42
41
|
const [value, setValue] = useState(ensureWrappedVariables(updatedContent));
|
|
43
42
|
const [deboundedValue] = useDebounce(value, 500);
|
|
44
43
|
const isReadOnly = readOnly === "readonly";
|
|
45
|
-
const {
|
|
46
|
-
translationMock
|
|
47
|
-
} = otherProps;
|
|
48
44
|
const customProps = {
|
|
49
45
|
...(otherProps || {}),
|
|
50
46
|
readOnly: isReadOnly,
|
|
51
47
|
editorPlaceholder: miniEditorPlaceholder,
|
|
52
|
-
page_id: id
|
|
53
|
-
translation: translation || translationMock
|
|
48
|
+
page_id: id
|
|
54
49
|
};
|
|
55
50
|
const [mentions, setMentions] = useMentions({
|
|
56
51
|
editor,
|
|
@@ -63,8 +58,7 @@ const MiniEditor = props => {
|
|
|
63
58
|
} = mentions;
|
|
64
59
|
const chars = type ? Shorthands[type]({
|
|
65
60
|
...mentions,
|
|
66
|
-
CHARACTERS
|
|
67
|
-
translation: translation || translationMock
|
|
61
|
+
CHARACTERS
|
|
68
62
|
}) : [];
|
|
69
63
|
useEffect(() => {
|
|
70
64
|
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,8 +59,7 @@ const BasicToolbar = props => {
|
|
|
59
59
|
children: fontStyle?.map((m, i) => {
|
|
60
60
|
return /*#__PURE__*/_jsx(MarkButton, {
|
|
61
61
|
editor: editor,
|
|
62
|
-
...m
|
|
63
|
-
customProps: customProps
|
|
62
|
+
...m
|
|
64
63
|
}, `pptool_mark_${i}_${m.id}`);
|
|
65
64
|
})
|
|
66
65
|
}), !hideLink && /*#__PURE__*/_jsx(Grid, {
|
|
@@ -10,12 +10,8 @@ const BlockButton = props => {
|
|
|
10
10
|
const {
|
|
11
11
|
editor,
|
|
12
12
|
format,
|
|
13
|
-
title
|
|
14
|
-
customProps
|
|
13
|
+
title
|
|
15
14
|
} = props;
|
|
16
|
-
const {
|
|
17
|
-
translation
|
|
18
|
-
} = customProps;
|
|
19
15
|
const isMark = MARK_TYPES?.indexOf(format) >= 0;
|
|
20
16
|
const isActive = isMark ? isMarkActive(editor, format) : isBlockActive(editor, format);
|
|
21
17
|
const {
|
|
@@ -33,7 +29,7 @@ const BlockButton = props => {
|
|
|
33
29
|
toggleBlock(editor, format);
|
|
34
30
|
}
|
|
35
31
|
},
|
|
36
|
-
title:
|
|
32
|
+
title: title,
|
|
37
33
|
sx: classes.textAlignButtons,
|
|
38
34
|
style: {
|
|
39
35
|
color: "#64748B"
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Select, MenuItem } from "@mui/material";
|
|
3
|
-
import { addMarkData, activeMark
|
|
4
|
-
import { toolbarGroups } from "../toolbarGroups.js";
|
|
3
|
+
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
|
|
5
4
|
import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
|
|
6
|
-
import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList.js";
|
|
7
5
|
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
|
-
};
|
|
30
6
|
const Dropdown = ({
|
|
31
7
|
classes,
|
|
32
8
|
editor,
|
|
@@ -34,7 +10,7 @@ const Dropdown = ({
|
|
|
34
10
|
options,
|
|
35
11
|
width
|
|
36
12
|
}) => {
|
|
37
|
-
const value =
|
|
13
|
+
const value = activeMark(editor, format);
|
|
38
14
|
const changeMarkData = (event, format) => {
|
|
39
15
|
event.preventDefault();
|
|
40
16
|
const value = event.target.value;
|
|
@@ -44,7 +20,7 @@ const Dropdown = ({
|
|
|
44
20
|
});
|
|
45
21
|
};
|
|
46
22
|
return /*#__PURE__*/_jsx(Select, {
|
|
47
|
-
value: value
|
|
23
|
+
value: value,
|
|
48
24
|
className: "editor-dd",
|
|
49
25
|
onChange: e => changeMarkData(e, format),
|
|
50
26
|
MenuProps: {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Autocomplete, TextField } from "@mui/material";
|
|
3
|
-
import { addMarkData } from "../../utils/SlateUtilityFunctions.js";
|
|
3
|
+
import { activeMark, addMarkData } from "../../utils/SlateUtilityFunctions.js";
|
|
4
4
|
import usePopupStyle from "../PopupTool/PopupToolStyle.js";
|
|
5
5
|
import { useEditorContext } from "../../hooks/useMouseMove.js";
|
|
6
|
-
import KeyboardArrowDownRoundedIcon from
|
|
7
|
-
import { getValue } from "./Dropdown.js";
|
|
6
|
+
import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
const FontFamilyAutocomplete = ({
|
|
10
9
|
editor,
|
|
@@ -15,7 +14,7 @@ const FontFamilyAutocomplete = ({
|
|
|
15
14
|
val = "",
|
|
16
15
|
webFont = false
|
|
17
16
|
}) => {
|
|
18
|
-
const markValue =
|
|
17
|
+
const markValue = activeMark(editor, format);
|
|
19
18
|
const value = !webFont ? markValue : val;
|
|
20
19
|
const changeMarkData = (event, newValue, format) => {
|
|
21
20
|
if (!webFont) {
|