@flozy/editor 9.8.3 → 9.8.5
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 +14 -7
- package/dist/Editor/CommonEditor.js +27 -12
- 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/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 +6 -5
- 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/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/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/TableView.js +6 -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 +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 -4
- 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/Grid/Grid.js +13 -10
- package/dist/Editor/Elements/Grid/GridButton.js +9 -5
- package/dist/Editor/Elements/Grid/GridItem.js +13 -7
- 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 +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 -4
- package/dist/Editor/Elements/Table/DragButton.js +4 -2
- package/dist/Editor/Elements/Table/Table.js +21 -9
- 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/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/MiniEditor.js +9 -3
- package/dist/Editor/Toolbar/Basic/index.js +2 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +6 -2
- 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 +6 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
- 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 +87 -73
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +14 -7
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +29 -21
- package/dist/Editor/Toolbar/PopupTool/index.js +17 -1
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/common/CustomDialog/index.js +8 -10
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- 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/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 +5 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +4 -2
- package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -3
- package/dist/Editor/common/RnD/index.js +11 -4
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +18 -3
- 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 +2 -2
- 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 +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +7 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +11 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +9 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -2
- 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 +6 -5
- 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 +8 -5
- package/dist/Editor/helper/index.js +27 -3
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withLinks.js +10 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +15 -9
- package/dist/Editor/utils/brains.js +1 -2
- package/dist/Editor/utils/freegrid.js +1 -1
- package/dist/Editor/utils/helper.js +2 -2
- package/package.json +1 -1
@@ -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;
|
@@ -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"
|
@@ -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) {
|
@@ -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"
|
@@ -6,8 +6,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
const MarkButton = ({
|
7
7
|
editor,
|
8
8
|
format,
|
9
|
-
title
|
9
|
+
title,
|
10
|
+
customProps
|
10
11
|
}) => {
|
12
|
+
const {
|
13
|
+
translation
|
14
|
+
} = customProps;
|
11
15
|
return /*#__PURE__*/_jsx(Button, {
|
12
16
|
active: isMarkActive(editor, format),
|
13
17
|
format: format,
|
@@ -15,7 +19,7 @@ const MarkButton = ({
|
|
15
19
|
e.preventDefault();
|
16
20
|
toggleMark(editor, format);
|
17
21
|
},
|
18
|
-
title: title,
|
22
|
+
title: translation(title),
|
19
23
|
style: {
|
20
24
|
color: "#64748B"
|
21
25
|
},
|
@@ -10,6 +10,7 @@ import usePopupStyle from "../PopupTool/PopupToolStyle";
|
|
10
10
|
import PopperHeader from "../PopupTool/PopperHeader";
|
11
11
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
12
12
|
import PageSettingsButton from "../../Elements/PageSettings/PageSettingsButton";
|
13
|
+
import { isFreeGrid } from "../../utils/helper";
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
15
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -31,6 +32,16 @@ const POPUP_TITLE = {
|
|
31
32
|
addElement: "Add Elements",
|
32
33
|
addTemplate: "Templates"
|
33
34
|
};
|
35
|
+
const disableAddElementBtn = editor => {
|
36
|
+
if (isFreeGrid(editor?.children || [])) {
|
37
|
+
return true;
|
38
|
+
}
|
39
|
+
const isFocused = !!editor?.selection?.anchor?.path;
|
40
|
+
if (!isFocused) {
|
41
|
+
return true;
|
42
|
+
}
|
43
|
+
return false;
|
44
|
+
};
|
34
45
|
const MiniToolbar = props => {
|
35
46
|
const {
|
36
47
|
customProps,
|
@@ -49,7 +60,8 @@ const MiniToolbar = props => {
|
|
49
60
|
const open = Boolean(PopupComponent);
|
50
61
|
const DialogComp = !fullScreen ? Popper : Dialog;
|
51
62
|
const {
|
52
|
-
hideTools
|
63
|
+
hideTools,
|
64
|
+
translation
|
53
65
|
} = customProps;
|
54
66
|
const boxRef = useRef(null); // Add ref to get the Box element
|
55
67
|
const UPDATED_MENU_OPTIONS = MENU_OPTIONS.filter(f => (hideTools || [])?.indexOf(f.type) === -1);
|
@@ -140,11 +152,10 @@ const MiniToolbar = props => {
|
|
140
152
|
icon: Icon
|
141
153
|
}) => {
|
142
154
|
const isDisabled = popupType === type || type === "undo" ? !canUndo : type === "redo" ? !canRedo : false;
|
143
|
-
const
|
144
|
-
const disableAddElement = type === "addElement" && !isFocussed;
|
155
|
+
const disableAddElement = type === "addElement" && disableAddElementBtn(editor);
|
145
156
|
return /*#__PURE__*/_jsxs(Tooltip, {
|
146
157
|
arrow: true,
|
147
|
-
title: label,
|
158
|
+
title: translation(label),
|
148
159
|
disableHoverListener: toolTip,
|
149
160
|
children: [type !== "page-settings" && /*#__PURE__*/_jsx(IconButton, {
|
150
161
|
className: `${type === popper ? "active" : ""} ${type === "undo" && !canUndo || type === "redo" && !canRedo ? "disabled" : ""} ${type === "undo" ? canUndo ? "activeUndo" : "disabledUndo" : type === "redo" ? canRedo ? "activeRedo" : "disabledRedo" : ""} ${disableAddElement ? "disableAddElement" : ""}
|
@@ -194,7 +205,8 @@ const MiniToolbar = props => {
|
|
194
205
|
fullScreen: fullScreen,
|
195
206
|
toggleFullscreen: toggleFullscreen,
|
196
207
|
search: search,
|
197
|
-
onSearch: onSearch
|
208
|
+
onSearch: onSearch,
|
209
|
+
customProps: customProps
|
198
210
|
}), /*#__PURE__*/_jsx(PopupComponent, {
|
199
211
|
classes: popupStyles,
|
200
212
|
editor: editor,
|
@@ -135,14 +135,16 @@ const AddTemplates = props => {
|
|
135
135
|
classes: classes,
|
136
136
|
onSelectTemplate: onSelectTemplate,
|
137
137
|
m: mapData,
|
138
|
-
fullScreen: fullScreen
|
138
|
+
fullScreen: fullScreen,
|
139
|
+
customProps: customProps
|
139
140
|
}, `template_Card_${mapData.id}_popup`);
|
140
141
|
case "Buttons":
|
141
142
|
return /*#__PURE__*/_jsx(ButtonTemplateCard, {
|
142
143
|
classes: classes,
|
143
144
|
onSelectTemplate: onSelectTemplate,
|
144
145
|
m: mapData,
|
145
|
-
fullScreen: fullScreen
|
146
|
+
fullScreen: fullScreen,
|
147
|
+
customProps: customProps
|
146
148
|
}, `template_Card_${mapData.id}_popup`);
|
147
149
|
case "Banners":
|
148
150
|
case "Tables":
|
@@ -151,7 +153,8 @@ const AddTemplates = props => {
|
|
151
153
|
onSelectTemplate: onSelectTemplate,
|
152
154
|
m: mapData,
|
153
155
|
fullScreen: fullScreen,
|
154
|
-
height: "smallCard"
|
156
|
+
height: "smallCard",
|
157
|
+
customProps: customProps
|
155
158
|
}, `template_Card_${mapData.id}_popup`);
|
156
159
|
case "404 Page":
|
157
160
|
return /*#__PURE__*/_jsx(FullViewCard, {
|
@@ -159,14 +162,16 @@ const AddTemplates = props => {
|
|
159
162
|
onSelectTemplate: onSelectTemplate,
|
160
163
|
m: mapData,
|
161
164
|
fullScreen: fullScreen,
|
162
|
-
height: "mediumCard"
|
165
|
+
height: "mediumCard",
|
166
|
+
customProps: customProps
|
163
167
|
}, `template_Card_${mapData.id}_popup`);
|
164
168
|
default:
|
165
169
|
return /*#__PURE__*/_jsx(TemplateCard, {
|
166
170
|
classes: classes,
|
167
171
|
onSelectTemplate: onSelectTemplate,
|
168
172
|
m: mapData,
|
169
|
-
fullScreen: fullScreen
|
173
|
+
fullScreen: fullScreen,
|
174
|
+
customProps: customProps
|
170
175
|
}, `template_Card_${mapData.id}_popup`);
|
171
176
|
}
|
172
177
|
};
|
@@ -6,7 +6,8 @@ const Select = props => {
|
|
6
6
|
const {
|
7
7
|
classes,
|
8
8
|
data,
|
9
|
-
onSelectTemplate
|
9
|
+
onSelectTemplate,
|
10
|
+
translation
|
10
11
|
} = props;
|
11
12
|
return /*#__PURE__*/_jsx(Box, {
|
12
13
|
className: "template-card-action",
|
@@ -19,7 +20,7 @@ const Select = props => {
|
|
19
20
|
children: /*#__PURE__*/_jsx(Button, {
|
20
21
|
className: "blueBtn",
|
21
22
|
onClick: onSelectTemplate(data),
|
22
|
-
children: "Select"
|
23
|
+
children: translation("Select")
|
23
24
|
})
|
24
25
|
});
|
25
26
|
};
|
@@ -27,8 +28,12 @@ const ButtonTemplateCard = props => {
|
|
27
28
|
const {
|
28
29
|
classes,
|
29
30
|
m,
|
30
|
-
onSelectTemplate
|
31
|
+
onSelectTemplate,
|
32
|
+
customProps
|
31
33
|
} = props;
|
34
|
+
const {
|
35
|
+
translation
|
36
|
+
} = customProps;
|
32
37
|
return /*#__PURE__*/_jsx(Grid, {
|
33
38
|
item: true,
|
34
39
|
xs: 3,
|
@@ -45,7 +50,8 @@ const ButtonTemplateCard = props => {
|
|
45
50
|
}), /*#__PURE__*/_jsx(Select, {
|
46
51
|
classes: classes,
|
47
52
|
onSelectTemplate: onSelectTemplate,
|
48
|
-
data: m
|
53
|
+
data: m,
|
54
|
+
translation: translation
|
49
55
|
})]
|
50
56
|
})
|
51
57
|
})
|
@@ -6,7 +6,8 @@ const Select = props => {
|
|
6
6
|
const {
|
7
7
|
classes,
|
8
8
|
data,
|
9
|
-
onSelectTemplate
|
9
|
+
onSelectTemplate,
|
10
|
+
translation
|
10
11
|
} = props;
|
11
12
|
return /*#__PURE__*/_jsx(Box, {
|
12
13
|
className: "template-card-action",
|
@@ -18,7 +19,7 @@ const Select = props => {
|
|
18
19
|
children: /*#__PURE__*/_jsx(Button, {
|
19
20
|
className: "blueBtn",
|
20
21
|
onClick: onSelectTemplate(data),
|
21
|
-
children: "Select"
|
22
|
+
children: translation("Select")
|
22
23
|
})
|
23
24
|
});
|
24
25
|
};
|
@@ -27,8 +28,12 @@ const FullViewCard = props => {
|
|
27
28
|
classes,
|
28
29
|
m,
|
29
30
|
onSelectTemplate,
|
30
|
-
height = 'smallCard'
|
31
|
+
height = 'smallCard',
|
32
|
+
customProps
|
31
33
|
} = props;
|
34
|
+
const {
|
35
|
+
translation
|
36
|
+
} = customProps;
|
32
37
|
return /*#__PURE__*/_jsx(Grid, {
|
33
38
|
item: true,
|
34
39
|
xs: 12,
|
@@ -46,7 +51,8 @@ const FullViewCard = props => {
|
|
46
51
|
}), /*#__PURE__*/_jsx(Select, {
|
47
52
|
classes: classes,
|
48
53
|
onSelectTemplate: onSelectTemplate,
|
49
|
-
data: m
|
54
|
+
data: m,
|
55
|
+
translation: translation
|
50
56
|
})]
|
51
57
|
})
|
52
58
|
})
|
@@ -11,9 +11,13 @@ function MiniColorPicker(props) {
|
|
11
11
|
format,
|
12
12
|
classes,
|
13
13
|
id,
|
14
|
-
editor
|
14
|
+
editor,
|
15
|
+
customProps
|
15
16
|
} = props;
|
16
17
|
const [openColorTool, setOpenColorTool] = useState(null);
|
18
|
+
const {
|
19
|
+
translation
|
20
|
+
} = customProps;
|
17
21
|
return /*#__PURE__*/_jsxs("div", {
|
18
22
|
children: [/*#__PURE__*/_jsxs(Button, {
|
19
23
|
className: "fontColorBtn",
|
@@ -29,7 +33,7 @@ function MiniColorPicker(props) {
|
|
29
33
|
activeMark: activeMark,
|
30
34
|
editor: editor,
|
31
35
|
showHex: false,
|
32
|
-
title: "Text Color",
|
36
|
+
title: translation("Text Color"),
|
33
37
|
id: id,
|
34
38
|
classes: classes,
|
35
39
|
forMiniTool: true,
|
@@ -15,45 +15,52 @@ function Label({
|
|
15
15
|
}), " ", label]
|
16
16
|
});
|
17
17
|
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
}
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
}
|
18
|
+
function getAlignmentOptions(translation) {
|
19
|
+
return [{
|
20
|
+
id: 17,
|
21
|
+
value: "alignLeft",
|
22
|
+
type: "block",
|
23
|
+
title: /*#__PURE__*/_jsx(Label, {
|
24
|
+
icon: "alignLeft",
|
25
|
+
label: translation("Left Align")
|
26
|
+
}),
|
27
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
28
|
+
icon: "alignLeft"
|
29
|
+
})
|
30
|
+
}, {
|
31
|
+
id: 18,
|
32
|
+
value: "alignCenter",
|
33
|
+
type: "block",
|
34
|
+
title: /*#__PURE__*/_jsx(Label, {
|
35
|
+
icon: "alignCenter",
|
36
|
+
label: translation("Center Align")
|
37
|
+
}),
|
38
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
39
|
+
icon: "alignCenter"
|
40
|
+
})
|
41
|
+
}, {
|
42
|
+
id: 19,
|
43
|
+
value: "alignRight",
|
44
|
+
type: "block",
|
45
|
+
title: /*#__PURE__*/_jsx(Label, {
|
46
|
+
icon: "alignRight",
|
47
|
+
label: translation("Right Align")
|
48
|
+
}),
|
49
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
50
|
+
icon: "alignRight"
|
51
|
+
})
|
52
|
+
}];
|
53
|
+
}
|
52
54
|
function SelectAlignment({
|
53
55
|
editor,
|
54
56
|
classes,
|
55
|
-
closeMainPopup
|
57
|
+
closeMainPopup,
|
58
|
+
customProps
|
56
59
|
}) {
|
60
|
+
const {
|
61
|
+
translation
|
62
|
+
} = customProps;
|
63
|
+
const alignmentOptions = getAlignmentOptions(translation);
|
57
64
|
const selected = useMemo(() => {
|
58
65
|
return alignmentOptions.find(t => isBlockActive(editor, t.value));
|
59
66
|
}, [alignmentOptions, isBlockActive, editor]);
|
@@ -16,61 +16,68 @@ function Label({
|
|
16
16
|
}), " ", label]
|
17
17
|
});
|
18
18
|
}
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
19
|
+
function getListOptions(translation) {
|
20
|
+
return [{
|
21
|
+
id: 15,
|
22
|
+
value: "orderedList",
|
23
|
+
type: "block",
|
24
|
+
title: /*#__PURE__*/_jsx(Label, {
|
25
|
+
icon: "orderedList",
|
26
|
+
label: translation("Ordered List")
|
27
|
+
}),
|
28
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
29
|
+
icon: "orderedList"
|
30
|
+
}),
|
31
|
+
group: "list"
|
32
|
+
}, {
|
33
|
+
id: 16,
|
34
|
+
value: "unorderedList",
|
35
|
+
type: "block",
|
36
|
+
title: /*#__PURE__*/_jsx(Label, {
|
37
|
+
icon: "unorderedList",
|
38
|
+
label: translation("Bulleted List")
|
39
|
+
}),
|
40
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
41
|
+
icon: "unorderedList"
|
42
|
+
}),
|
43
|
+
group: "list"
|
44
|
+
}, {
|
45
|
+
id: 43,
|
46
|
+
value: "check-list-item",
|
47
|
+
type: "block",
|
48
|
+
title: /*#__PURE__*/_jsx(Label, {
|
49
|
+
icon: "check-list-item",
|
50
|
+
label: translation("Check List")
|
51
|
+
}),
|
52
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
53
|
+
icon: "check-list-item"
|
54
|
+
}),
|
55
|
+
group: "list"
|
56
|
+
}, {
|
57
|
+
id: 30,
|
58
|
+
value: "accordion",
|
59
|
+
type: "accordion",
|
60
|
+
group: "list",
|
61
|
+
component: "AccordionButton",
|
62
|
+
title: /*#__PURE__*/_jsx(Label, {
|
63
|
+
icon: "accordion",
|
64
|
+
label: translation("Accordion")
|
65
|
+
}),
|
66
|
+
label: /*#__PURE__*/_jsx(Icon, {
|
67
|
+
icon: "accordion"
|
68
|
+
})
|
69
|
+
}];
|
70
|
+
}
|
69
71
|
function SelectList({
|
70
72
|
editor,
|
71
73
|
classes,
|
72
|
-
closeMainPopup
|
74
|
+
closeMainPopup,
|
75
|
+
customProps
|
73
76
|
}) {
|
77
|
+
const {
|
78
|
+
translation
|
79
|
+
} = customProps;
|
80
|
+
const listOptions = getListOptions(translation);
|
74
81
|
const selectedList = useMemo(() => {
|
75
82
|
return listOptions.find(t => isBlockActive(editor, t.value));
|
76
83
|
}, [listOptions, isBlockActive, editor]);
|
@@ -13,34 +13,41 @@ function Label({
|
|
13
13
|
}), " ", type]
|
14
14
|
});
|
15
15
|
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
function getSubcriptOptions(translation) {
|
17
|
+
return [{
|
18
|
+
id: 9,
|
19
|
+
format: "superscript",
|
20
|
+
type: "mark",
|
21
|
+
title: /*#__PURE__*/_jsx(Label, {
|
22
|
+
label: "X²",
|
23
|
+
type: translation("Superscript")
|
24
|
+
}),
|
21
25
|
label: "X²",
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
group: "superSubscript",
|
27
|
+
value: "superscript"
|
28
|
+
}, {
|
29
|
+
id: 10,
|
30
|
+
format: "subscript",
|
31
|
+
type: "mark",
|
32
|
+
title: /*#__PURE__*/_jsx(Label, {
|
33
|
+
label: "X₂",
|
34
|
+
type: translation("Subscript")
|
35
|
+
}),
|
32
36
|
label: "X₂",
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
value: "subscript"
|
38
|
-
}];
|
37
|
+
group: "superSubscript",
|
38
|
+
value: "subscript"
|
39
|
+
}];
|
40
|
+
}
|
39
41
|
function SelectSuperSubscript({
|
40
42
|
editor,
|
41
43
|
classes,
|
42
|
-
closeMainPopup
|
44
|
+
closeMainPopup,
|
45
|
+
customProps
|
43
46
|
}) {
|
47
|
+
const {
|
48
|
+
translation
|
49
|
+
} = customProps;
|
50
|
+
const superSubscriptOptions = getSubcriptOptions(translation);
|
44
51
|
const selectedMark = useMemo(() => {
|
45
52
|
return superSubscriptOptions.find(option => activeMark(editor, option.format));
|
46
53
|
}, [editor]);
|