@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.
Files changed (41) hide show
  1. package/dist/Editor/CommonEditor.js +14 -3
  2. package/dist/Editor/Editor.css +144 -14
  3. package/dist/Editor/Elements/AppHeader/AppHeader.js +16 -11
  4. package/dist/Editor/Elements/Button/EditorButton.js +16 -7
  5. package/dist/Editor/Elements/Embed/Embed.js +13 -10
  6. package/dist/Editor/Elements/Form/Form.js +2 -1
  7. package/dist/Editor/Elements/Form/FormPopup.js +4 -2
  8. package/dist/Editor/Elements/Grid/Grid.js +15 -2
  9. package/dist/Editor/Elements/Grid/GridItem.js +14 -2
  10. package/dist/Editor/Elements/Table/TableSelector.js +6 -4
  11. package/dist/Editor/Toolbar/FormatTools/TextSize.js +73 -0
  12. package/dist/Editor/Toolbar/FormatTools/index.js +2 -1
  13. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +23 -9
  14. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +152 -42
  15. package/dist/Editor/Toolbar/PopupTool/index.js +35 -34
  16. package/dist/Editor/Toolbar/Toolbar.js +6 -1
  17. package/dist/Editor/Toolbar/toolbarGroups.js +9 -9
  18. package/dist/Editor/assets/svg/addGridItem.js +49 -0
  19. package/dist/Editor/common/ColorPickerButton.js +3 -3
  20. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +4 -4
  21. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +32 -15
  22. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +48 -34
  23. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +90 -115
  24. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +93 -101
  25. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +24 -5
  26. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -5
  27. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +49 -20
  28. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +9 -5
  29. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +23 -5
  30. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +52 -0
  31. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +33 -6
  32. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +16 -17
  33. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -5
  34. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +12 -6
  35. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +28 -23
  36. package/dist/Editor/common/StyleBuilder/gridStyle.js +0 -6
  37. package/dist/Editor/common/StyleBuilder/index.js +70 -44
  38. package/dist/Editor/common/Uploader.js +51 -14
  39. package/dist/Editor/common/iconslist.js +409 -0
  40. package/dist/Editor/utils/embed.js +2 -22
  41. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Editor, Transforms } from "slate";
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
- at: parentPosition
39
- });
40
- Transforms.unwrapNodes(editor, {
41
- at: [...removePath]
21
+ select: true
42
22
  });
43
23
  Transforms.insertNodes(editor, createParagraph(""));
44
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.4.9",
3
+ "version": "1.5.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"