@flozy/editor 10.0.3 → 10.0.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 +30 -13
- package/dist/Editor/Editor.css +1 -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/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 +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 +168 -97
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +31 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +54 -6
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
- package/dist/Editor/Elements/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 +32 -27
- 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 +46 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
- package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +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/ShadowElement.js +2 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +74 -9
- package/dist/Editor/common/RnD/Utils/index.js +3 -0
- package/dist/Editor/common/RnD/VirtualElement/BoxHeaderAutoAlignment.js +43 -0
- package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +44 -0
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +134 -0
- package/dist/Editor/common/RnD/VirtualElement/helper.js +382 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +187 -103
- package/dist/Editor/common/RnD/VirtualElement/styles.js +157 -7
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +76 -8
- 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/hooks/useAutoScroll.js +38 -0
- package/dist/Editor/plugins/withHTML.js +7 -6
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withLinks.js +9 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +20 -11
- package/dist/Editor/utils/brains.js +1 -2
- package/dist/Editor/utils/freegrid.js +3 -4
- package/dist/Editor/utils/helper.js +2 -2
- package/package.json +1 -1
@@ -37,6 +37,9 @@ const Uploader = props => {
|
|
37
37
|
onUploaded(result?.imageURL[0]);
|
38
38
|
}
|
39
39
|
};
|
40
|
+
const {
|
41
|
+
translation
|
42
|
+
} = customProps;
|
40
43
|
const onRemoveBG = () => {
|
41
44
|
setBase64(null);
|
42
45
|
onUploaded("none");
|
@@ -68,14 +71,14 @@ const Uploader = props => {
|
|
68
71
|
}), /*#__PURE__*/_jsx(Grid, {
|
69
72
|
className: "removeImageText",
|
70
73
|
onClick: onRemoveBG,
|
71
|
-
children: "
|
74
|
+
children: translation("Remove")
|
72
75
|
})]
|
73
76
|
});
|
74
77
|
default:
|
75
78
|
return /*#__PURE__*/_jsx(Grid, {
|
76
79
|
className: "removeImageText",
|
77
80
|
onClick: onRemoveBG,
|
78
|
-
children: "
|
81
|
+
children: translation("Remove")
|
79
82
|
});
|
80
83
|
}
|
81
84
|
};
|
@@ -83,7 +86,7 @@ const Uploader = props => {
|
|
83
86
|
children: [/*#__PURE__*/_jsx(Grid, {
|
84
87
|
item: true,
|
85
88
|
xs: 12,
|
86
|
-
children: uploading ? "
|
89
|
+
children: uploading ? translation("uploadingText") : ""
|
87
90
|
}), /*#__PURE__*/_jsx(Grid, {
|
88
91
|
container: true,
|
89
92
|
sx: classes.uploadContainer,
|
@@ -116,11 +119,11 @@ const Uploader = props => {
|
|
116
119
|
onChange: handleChange
|
117
120
|
}), /*#__PURE__*/_jsx(Icon, {
|
118
121
|
icon: "fileUpload"
|
119
|
-
}), /*#__PURE__*/
|
122
|
+
}), /*#__PURE__*/_jsx("span", {
|
120
123
|
style: {
|
121
124
|
paddingLeft: "8px"
|
122
125
|
},
|
123
|
-
children:
|
126
|
+
children: `${translation("upload")} ${translation(title) || translation("image")}`
|
124
127
|
})]
|
125
128
|
})
|
126
129
|
})
|
@@ -276,8 +276,10 @@ export const bringItemToFB = (editor, {
|
|
276
276
|
} = itemNode;
|
277
277
|
let arrangeIndex = zIndex === undefined ? path[path.length - 1] : zIndex;
|
278
278
|
arrangeIndex = moveFront ? arrangeIndex + 1 : arrangeIndex - 1;
|
279
|
+
arrangeIndex = Math.min(arrangeIndex, editor.children.length);
|
280
|
+
arrangeIndex = Math.max(1, arrangeIndex); // to avoid negative z-index
|
279
281
|
Transforms.setNodes(editor, {
|
280
|
-
zIndex:
|
282
|
+
zIndex: arrangeIndex
|
281
283
|
}, {
|
282
284
|
at: path
|
283
285
|
});
|
@@ -306,7 +308,7 @@ export const debounce = function (func, wait, immediate) {
|
|
306
308
|
};
|
307
309
|
export const getTextColor = (color = "") => {
|
308
310
|
return color?.indexOf("gradient") >= 0 ? {
|
309
|
-
background: color?.concat("text")
|
311
|
+
background: `${color?.concat("text")} !important`,
|
310
312
|
WebkitBackgroundClip: "text",
|
311
313
|
WebkitTextFillColor: "transparent !important",
|
312
314
|
color: "transparent !important",
|
@@ -321,7 +323,29 @@ export const getTextColor = (color = "") => {
|
|
321
323
|
color: "#000 !important"
|
322
324
|
}
|
323
325
|
} : {
|
324
|
-
color
|
326
|
+
color: `${color} !important`,
|
327
|
+
WebkitTextFillColor: "unset !important"
|
328
|
+
};
|
329
|
+
};
|
330
|
+
export const pageTextStyle = (color = "") => {
|
331
|
+
return color?.indexOf("gradient") >= 0 ? {
|
332
|
+
background: color?.concat("text"),
|
333
|
+
WebkitBackgroundClip: "text",
|
334
|
+
WebkitTextFillColor: "transparent",
|
335
|
+
color: "transparent",
|
336
|
+
caretColor: "black",
|
337
|
+
"& span": {
|
338
|
+
color: "transparent",
|
339
|
+
"& ::selection": {
|
340
|
+
color: "#000"
|
341
|
+
}
|
342
|
+
},
|
343
|
+
"& ::selection": {
|
344
|
+
color: "#000"
|
345
|
+
}
|
346
|
+
} : {
|
347
|
+
color: color,
|
348
|
+
WebkitTextFillColor: "unset"
|
325
349
|
};
|
326
350
|
};
|
327
351
|
export const getBorderColor = (borderColor = "") => {
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { useEffect, useRef } from "react";
|
2
|
+
function useAutoScroll(speed = 10, scrollElementId = "slate-wrapper-scroll-container") {
|
3
|
+
const scrollInterval = useRef(null);
|
4
|
+
function getScrollElement() {
|
5
|
+
return document.getElementById(scrollElementId) || window;
|
6
|
+
}
|
7
|
+
function startAutoScroll(direction) {
|
8
|
+
if (scrollInterval.current) return; // Prevent multiple intervals
|
9
|
+
|
10
|
+
const scrollContainer = getScrollElement();
|
11
|
+
scrollInterval.current = setInterval(() => {
|
12
|
+
scrollContainer.style.scrollBehavior = "auto";
|
13
|
+
if (direction === "up") {
|
14
|
+
scrollContainer.scrollBy(0, -speed);
|
15
|
+
} else if (direction === "down") {
|
16
|
+
scrollContainer.scrollBy(0, speed);
|
17
|
+
scrollContainer.style.scrollBehavior = "smooth";
|
18
|
+
}
|
19
|
+
}, 16); // Approx 60fps
|
20
|
+
}
|
21
|
+
|
22
|
+
function stopAutoScroll() {
|
23
|
+
if (scrollInterval.current) {
|
24
|
+
clearInterval(scrollInterval.current);
|
25
|
+
scrollInterval.current = null;
|
26
|
+
const scrollContainer = getScrollElement();
|
27
|
+
scrollContainer.style.scrollBehavior = "smooth";
|
28
|
+
}
|
29
|
+
}
|
30
|
+
useEffect(() => {
|
31
|
+
return () => stopAutoScroll(); // Cleanup on unmount
|
32
|
+
}, []);
|
33
|
+
return {
|
34
|
+
startAutoScroll,
|
35
|
+
stopAutoScroll
|
36
|
+
};
|
37
|
+
}
|
38
|
+
export default useAutoScroll;
|
@@ -261,12 +261,13 @@ const withHtml = editor => {
|
|
261
261
|
return;
|
262
262
|
}
|
263
263
|
const formattedFragment = normalizeFragment ? normalizeFragment(fragment) : fragment;
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
}
|
264
|
+
|
265
|
+
// let is_img_table = false;
|
266
|
+
// formattedFragment.map((f) => {
|
267
|
+
// if (f.type === "image" || f?.type?.includes("table")) {
|
268
|
+
// is_img_table = true;
|
269
|
+
// }
|
270
|
+
// });
|
270
271
|
|
271
272
|
// if (editor.isChatEditor && is_img_table) {
|
272
273
|
// return;
|
@@ -27,7 +27,8 @@ const ORDERS_LAYOUT_VALIDATIONS = {
|
|
27
27
|
};
|
28
28
|
const withLayout = editor => {
|
29
29
|
const {
|
30
|
-
normalizeNode
|
30
|
+
normalizeNode,
|
31
|
+
translation
|
31
32
|
} = editor;
|
32
33
|
editor.normalizeNode = ([node, path]) => {
|
33
34
|
if (path.length === 0) {
|
@@ -39,7 +40,7 @@ const withLayout = editor => {
|
|
39
40
|
const title = {
|
40
41
|
type: "title",
|
41
42
|
children: [{
|
42
|
-
text: "Untitled"
|
43
|
+
text: translation ? translation("Untitled") : "Untitled"
|
43
44
|
}]
|
44
45
|
};
|
45
46
|
Transforms.insertNodes(editor, title, {
|
@@ -11,6 +11,15 @@ const withLinks = editor => {
|
|
11
11
|
// remove empty inline
|
12
12
|
editor.normalizeNode = entry => {
|
13
13
|
const [node, path] = entry;
|
14
|
+
if (!editor.children.length && !editor.isChatEditor) {
|
15
|
+
Transforms.insertNodes(editor, {
|
16
|
+
type: "paragraph",
|
17
|
+
children: [{
|
18
|
+
text: ""
|
19
|
+
}]
|
20
|
+
});
|
21
|
+
return;
|
22
|
+
}
|
14
23
|
if (Element.isElement(node) && node.type === "paragraph") {
|
15
24
|
const children = Array.from(Node.children(editor, path));
|
16
25
|
for (const [child, childPath] of children) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Editor, Transforms, Element as SlateElement, Range
|
1
|
+
import { Editor, Transforms, Element as SlateElement, Range } from "slate";
|
2
2
|
import { Box } from "@mui/material";
|
3
3
|
import { sizeMap } from "./font";
|
4
4
|
import Link from "../Elements/Link/Link";
|
@@ -237,7 +237,7 @@ export const getMarked = (leaf, children, theme) => {
|
|
237
237
|
background: leaf.bgColor
|
238
238
|
},
|
239
239
|
children: /*#__PURE__*/_jsx(Box, {
|
240
|
-
className: className
|
240
|
+
className: `${className} leaf-item`,
|
241
241
|
component: "span",
|
242
242
|
sx: {
|
243
243
|
...groupByBreakpoint({
|
@@ -258,11 +258,16 @@ export const getMarked = (leaf, children, theme) => {
|
|
258
258
|
// lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
259
259
|
// ...getBreakPointsValue(leaf.fontSize, null, "overrideText"),
|
260
260
|
// },
|
261
|
-
|
261
|
+
'& span[data-slate-string="true"]': {
|
262
|
+
...textStyles
|
263
|
+
},
|
262
264
|
fontFamily: family,
|
263
265
|
fontWeight: leaf.fontWeight,
|
264
266
|
WebkitTextFillColor: "unset !important"
|
265
267
|
},
|
268
|
+
style: {
|
269
|
+
"--fontSize_xs": leaf?.fontSize?.xs || "auto"
|
270
|
+
},
|
266
271
|
children: children
|
267
272
|
})
|
268
273
|
});
|
@@ -284,17 +289,21 @@ export const getMarked = (leaf, children, theme) => {
|
|
284
289
|
export const getBlock = props => {
|
285
290
|
const {
|
286
291
|
element,
|
287
|
-
children
|
292
|
+
children,
|
293
|
+
customProps
|
288
294
|
} = props;
|
289
295
|
const attributes = props.attributes ?? {};
|
290
296
|
const isEmpty = isEmptyTextNode(element);
|
297
|
+
const {
|
298
|
+
translation
|
299
|
+
} = customProps;
|
291
300
|
switch (element.type) {
|
292
301
|
case "headingOne":
|
293
302
|
return /*#__PURE__*/_jsxs("h1", {
|
294
303
|
...attributes,
|
295
304
|
...element.attr,
|
296
305
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
297
|
-
placeholder: "Heading 1",
|
306
|
+
placeholder: translation("Heading 1"),
|
298
307
|
children: [children, /*#__PURE__*/_jsx("span", {
|
299
308
|
contentEditable: false
|
300
309
|
})]
|
@@ -304,7 +313,7 @@ export const getBlock = props => {
|
|
304
313
|
...attributes,
|
305
314
|
...element.attr,
|
306
315
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
307
|
-
placeholder: "Heading 2",
|
316
|
+
placeholder: translation("Heading 2"),
|
308
317
|
children: [children, /*#__PURE__*/_jsx("span", {
|
309
318
|
contentEditable: false
|
310
319
|
})]
|
@@ -314,7 +323,7 @@ export const getBlock = props => {
|
|
314
323
|
...attributes,
|
315
324
|
...element.attr,
|
316
325
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
317
|
-
placeholder: "Heading 3",
|
326
|
+
placeholder: translation("Heading 3"),
|
318
327
|
children: [children, /*#__PURE__*/_jsx("span", {
|
319
328
|
contentEditable: false
|
320
329
|
})]
|
@@ -324,7 +333,7 @@ export const getBlock = props => {
|
|
324
333
|
...attributes,
|
325
334
|
...element.attr,
|
326
335
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
327
|
-
placeholder: "Heading 4",
|
336
|
+
placeholder: translation("Heading 4"),
|
328
337
|
children: [children, /*#__PURE__*/_jsx("span", {
|
329
338
|
contentEditable: false
|
330
339
|
})]
|
@@ -334,7 +343,7 @@ export const getBlock = props => {
|
|
334
343
|
...attributes,
|
335
344
|
...element.attr,
|
336
345
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
337
|
-
placeholder: "Heading 5",
|
346
|
+
placeholder: translation("Heading 5"),
|
338
347
|
children: [children, /*#__PURE__*/_jsx("span", {
|
339
348
|
contentEditable: false
|
340
349
|
})]
|
@@ -344,7 +353,7 @@ export const getBlock = props => {
|
|
344
353
|
...attributes,
|
345
354
|
...element.attr,
|
346
355
|
className: `edt-headings content-editable ${isEmpty ? "empty" : ""}`,
|
347
|
-
placeholder: "Heading 6",
|
356
|
+
placeholder: translation("Heading 6"),
|
348
357
|
children: [children, /*#__PURE__*/_jsx("span", {
|
349
358
|
contentEditable: false
|
350
359
|
})]
|
@@ -414,7 +423,7 @@ export const getBlock = props => {
|
|
414
423
|
...attributes,
|
415
424
|
...element.attr,
|
416
425
|
className: `content-editable ${isEmpty ? "empty" : ""}`,
|
417
|
-
placeholder: "List",
|
426
|
+
placeholder: translation("List"),
|
418
427
|
style: {
|
419
428
|
color: firstChildren?.color
|
420
429
|
},
|
@@ -17,8 +17,7 @@ export const insertBrain = (editor, data, position) => {
|
|
17
17
|
}]
|
18
18
|
};
|
19
19
|
const [currentNode, currentPath] = Editor.node(editor, selection);
|
20
|
-
|
21
|
-
const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
|
20
|
+
const cleanedText = Node.string(currentNode).toLowerCase().replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
|
22
21
|
if (cleanedText) {
|
23
22
|
Transforms.delete(editor, {
|
24
23
|
at: Editor.range(editor, currentPath)
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import { Transforms } from "slate";
|
2
|
-
import insertNewLine from "./insertNewLine";
|
3
2
|
import scrollToNewSection from "../helper/RnD/scrollToNewSection";
|
4
3
|
const Default_text_Node = {
|
5
4
|
type: "paragraph",
|
@@ -22,8 +21,8 @@ export const insertFreeGridItem = (childType, childTypeNode, extProps = {}, type
|
|
22
21
|
top_xs: 24,
|
23
22
|
marginTop_xs: 12,
|
24
23
|
width_xs: 250,
|
25
|
-
height_xs: 300,
|
26
|
-
gridArea_xs: "1 / 1 / 2 / 2",
|
24
|
+
// height_xs: 300,
|
25
|
+
// gridArea_xs: "1 / 1 / 2 / 2",
|
27
26
|
sectionBgColor: "rgb(240, 108, 131)",
|
28
27
|
...(extProps || {})
|
29
28
|
};
|
@@ -166,5 +165,5 @@ export const insertFreeGrid = (editor, path, extProps) => {
|
|
166
165
|
at: newPath
|
167
166
|
});
|
168
167
|
scrollToNewSection(editor, newPath, extProps);
|
169
|
-
insertNewLine(editor);
|
168
|
+
// insertNewLine(editor);
|
170
169
|
};
|
@@ -168,11 +168,11 @@ export const handleInsertLastElement = (event, editor) => {
|
|
168
168
|
}
|
169
169
|
const hasPath = event.target.dataset.path;
|
170
170
|
const lastElement = editor.children[editor.children?.length - 1];
|
171
|
-
const isFreeGrid = lastElement?.type === "freegrid" || lastElement?.children[0]?.type === "freegrid";
|
171
|
+
const isFreeGrid = lastElement?.type === "freegrid" || lastElement?.children?.[0]?.type === "freegrid";
|
172
172
|
if (isFreeGrid) {
|
173
173
|
return;
|
174
174
|
}
|
175
|
-
const isLastElementEmpty = lastElement.type === "paragraph" && !lastElement.children[0]?.text && !lastElement.children?.some(c => BLOCKS.includes(c.type));
|
175
|
+
const isLastElementEmpty = lastElement && lastElement.type === "paragraph" && !lastElement.children[0]?.text && !lastElement.children?.some(c => BLOCKS.includes(c.type));
|
176
176
|
if (!ReactEditor.isFocused(editor)) {
|
177
177
|
if (isLastElementEmpty) {
|
178
178
|
if (hasPath) {
|