@flozy/editor 1.4.9 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +14 -3
- package/dist/Editor/Editor.css +144 -14
- package/dist/Editor/Elements/AppHeader/AppHeader.js +16 -11
- package/dist/Editor/Elements/Button/EditorButton.js +16 -7
- package/dist/Editor/Elements/Embed/Embed.js +13 -10
- package/dist/Editor/Elements/Form/Form.js +2 -1
- package/dist/Editor/Elements/Form/FormPopup.js +4 -2
- package/dist/Editor/Elements/Grid/Grid.js +15 -2
- package/dist/Editor/Elements/Grid/GridItem.js +14 -2
- package/dist/Editor/Elements/Table/TableSelector.js +6 -4
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +73 -0
- package/dist/Editor/Toolbar/FormatTools/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +23 -9
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +152 -42
- package/dist/Editor/Toolbar/PopupTool/index.js +35 -34
- package/dist/Editor/Toolbar/Toolbar.js +6 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +9 -9
- package/dist/Editor/assets/svg/addGridItem.js +49 -0
- package/dist/Editor/common/ColorPickerButton.js +3 -3
- package/dist/Editor/common/StyleBuilder/embedImageStyle.js +4 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +32 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +48 -34
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +90 -115
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +93 -101
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +24 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +49 -20
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +9 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +23 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +52 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +33 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +16 -17
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +12 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +28 -23
- package/dist/Editor/common/StyleBuilder/gridStyle.js +0 -6
- package/dist/Editor/common/StyleBuilder/index.js +70 -44
- package/dist/Editor/common/Uploader.js +51 -14
- package/dist/Editor/common/iconslist.js +409 -0
- package/dist/Editor/utils/embed.js +2 -22
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { Transforms } from "slate";
|
2
2
|
import { createParagraph } from "./paragraph";
|
3
3
|
export const createEmbedNode = (type, {
|
4
4
|
url,
|
@@ -16,29 +16,9 @@ export const insertEmbed = (editor, embedData, format) => {
|
|
16
16
|
url
|
17
17
|
} = embedData;
|
18
18
|
if (!url) return;
|
19
|
-
const {
|
20
|
-
selection
|
21
|
-
} = editor;
|
22
|
-
if (!selection?.focus?.path) return;
|
23
|
-
const [parent, parentPath] = Editor.parent(editor, selection?.focus?.path);
|
24
19
|
const embed = createEmbedNode(format, embedData);
|
25
|
-
let removePath = parentPath;
|
26
|
-
let parentPosition = parentPath;
|
27
|
-
if (parentPath?.length - 1 > 0) {
|
28
|
-
removePath = parentPath.slice(0, parentPath?.length - 1);
|
29
|
-
parentPosition = parentPath.slice(0, parentPath?.length - 1);
|
30
|
-
}
|
31
|
-
removePath = removePath.map((elem, i) => {
|
32
|
-
if (i === removePath.length - 1) {
|
33
|
-
return elem + 1;
|
34
|
-
}
|
35
|
-
return elem;
|
36
|
-
});
|
37
20
|
Transforms.insertNodes(editor, embed, {
|
38
|
-
|
39
|
-
});
|
40
|
-
Transforms.unwrapNodes(editor, {
|
41
|
-
at: [...removePath]
|
21
|
+
select: true
|
42
22
|
});
|
43
23
|
Transforms.insertNodes(editor, createParagraph(""));
|
44
24
|
};
|