@flozy/editor 4.4.4 → 4.4.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.
@@ -27,7 +27,7 @@ import DragAndDrop from "./common/DnD";
27
27
  import Section from "./common/Section";
28
28
  import decorators from "./utils/Decorators";
29
29
  import { getTRBLBreakPoints } from "./helper/theme";
30
- import { handleInsertLastElement, isFreeGridFragment, outsideEditorClickLabel } from "./utils/helper";
30
+ import { getPreviousNode, handleInsertLastElement, isFreeGridFragment, outsideEditorClickLabel } from "./utils/helper";
31
31
  import useWindowResize from "./hooks/useWindowResize";
32
32
  import PopoverAIInput from "./Elements/AI/PopoverAIInput";
33
33
  import RnDCopy from "./common/RnD/RnDCopy";
@@ -374,8 +374,12 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
374
374
  if (!Range.isCollapsed(selection)) {
375
375
  editor.deleteFragment();
376
376
  } else {
377
+ const match = getPreviousNode(editor);
378
+ if (match?.type === "page-settings") {
379
+ return;
380
+ }
377
381
  editor.deleteBackward({
378
- unit: 'character'
382
+ unit: "character"
379
383
  });
380
384
  }
381
385
  }
@@ -53,7 +53,8 @@ const VideoContent = props => {
53
53
  ...videoSX
54
54
  },
55
55
  src: embedURL,
56
- title: alt
56
+ title: alt,
57
+ allowFullScreen: true
57
58
  });
58
59
  };
59
60
  const VideoPlaceholder = props => {
@@ -10,7 +10,7 @@ const useResize = ({
10
10
  const defaultSize = getBreakPointsValue(allSize);
11
11
  const {
12
12
  width,
13
- height
13
+ height = 370
14
14
  } = parentDOM?.getBoundingClientRect() || {
15
15
  ...defaultSize
16
16
  };
@@ -1,4 +1,4 @@
1
- import { Editor, Node, Transforms, Element } from "slate";
1
+ import { Editor, Node, Transforms, Element, Path } from "slate";
2
2
  import { ReactEditor } from "slate-react";
3
3
  import insertNewLine from "./insertNewLine";
4
4
  import { getDevice } from "../helper/theme";
@@ -470,4 +470,11 @@ export const editorThemeStyle = {
470
470
  };
471
471
  export const getEditorTheme = (themeType = "light") => {
472
472
  return editorThemeStyle[themeType] || {};
473
+ };
474
+ export const getPreviousNode = editor => {
475
+ try {
476
+ const parentPath = Path.parent(editor?.selection?.anchor?.path);
477
+ const prevPath = Path.previous(parentPath);
478
+ return getNode(editor, prevPath);
479
+ } catch (err) {}
473
480
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.4.4",
3
+ "version": "4.4.7",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"