@flozy/editor 10.5.9 → 10.6.0

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.
@@ -92,3 +92,7 @@
92
92
  border-width: 1px 0 0;
93
93
  border-color: rgba(55, 53, 47, .1607843137254902);
94
94
  }
95
+
96
+ .disablePointerEvent {
97
+ pointer-events: none;
98
+ }
@@ -3,7 +3,6 @@ import { Editor, Text } from "slate";
3
3
  import { useSlate } from "slate-react";
4
4
  import { getNodeText } from "../../utils/helper";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
6
  const isEmptyTextNode = node => {
8
7
  if (Text.isText(node)) {
9
8
  return !node.text.trim();
@@ -19,7 +18,7 @@ const Title = props => {
19
18
  } = props;
20
19
  const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
21
20
  useDetectExitFromTitle(element, customProps?.getTitleSaveData);
22
- return /*#__PURE__*/_jsxs("div", {
21
+ return /*#__PURE__*/_jsx("div", {
23
22
  ...attributes,
24
23
  placeholder: "Title",
25
24
  className: `content-editable ${isEmpty}`,
@@ -27,9 +26,7 @@ const Title = props => {
27
26
  fontWeight: "bold",
28
27
  fontSize: "20px"
29
28
  },
30
- children: [children, /*#__PURE__*/_jsx("span", {
31
- contentEditable: false
32
- })]
29
+ children: children
33
30
  });
34
31
  };
35
32
  export default Title;
@@ -49,7 +49,6 @@ import ColumnView from "../Elements/DataView/Layouts/ColumnView";
49
49
  import SearchAttachment from "../Elements/Search/SearchAttachment";
50
50
  import { wrapThemeBreakpoints } from "../Elements/FreeGrid/breakpointConstants";
51
51
  import { jsx as _jsx } from "react/jsx-runtime";
52
- import { jsxs as _jsxs } from "react/jsx-runtime";
53
52
  const alignment = ["alignLeft", "alignRight", "alignCenter", "alignJustify"];
54
53
  const list_types = ["orderedList", "unorderedList"];
55
54
  const LIST_FORMAT_TYPE = {
@@ -421,52 +420,52 @@ export const getBlock = props => {
421
420
  const selectedLineHeight = getBreakpointLineSpacing(lineH, breakpoint);
422
421
  switch (element.type) {
423
422
  case "headingOne":
424
- return /*#__PURE__*/_jsxs("h1", {
425
- ...commonHeadingProps(),
423
+ return /*#__PURE__*/_jsx("h1", {
424
+ ...attributes,
425
+ ...element.attr,
426
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} disablePointerEvent`,
426
427
  placeholder: translation("Heading 1"),
427
- children: [children, /*#__PURE__*/_jsx("span", {
428
- contentEditable: false
429
- })]
428
+ children: children
430
429
  });
431
430
  case "headingTwo":
432
- return /*#__PURE__*/_jsxs("h2", {
433
- ...commonHeadingProps(),
431
+ return /*#__PURE__*/_jsx("h2", {
432
+ ...attributes,
433
+ ...element.attr,
434
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} disablePointerEvent`,
434
435
  placeholder: translation("Heading 2"),
435
- children: [children, /*#__PURE__*/_jsx("span", {
436
- contentEditable: false
437
- })]
436
+ children: children
438
437
  });
439
438
  case "headingThree":
440
- return /*#__PURE__*/_jsxs("h3", {
441
- ...commonHeadingProps(),
439
+ return /*#__PURE__*/_jsx("h3", {
440
+ ...attributes,
441
+ ...element.attr,
442
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} disablePointerEvent`,
442
443
  placeholder: translation("Heading 3"),
443
- children: [children, /*#__PURE__*/_jsx("span", {
444
- contentEditable: false
445
- })]
444
+ children: children
446
445
  });
447
446
  case "headingFour":
448
- return /*#__PURE__*/_jsxs("h4", {
449
- ...commonHeadingProps(),
447
+ return /*#__PURE__*/_jsx("h4", {
448
+ ...attributes,
449
+ ...element.attr,
450
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} disablePointerEvent`,
450
451
  placeholder: translation("Heading 4"),
451
- children: [children, /*#__PURE__*/_jsx("span", {
452
- contentEditable: false
453
- })]
452
+ children: children
454
453
  });
455
454
  case "headingFive":
456
- return /*#__PURE__*/_jsxs("h5", {
457
- ...commonHeadingProps(),
455
+ return /*#__PURE__*/_jsx("h5", {
456
+ ...attributes,
457
+ ...element.attr,
458
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} disablePointerEvent`,
458
459
  placeholder: translation("Heading 5"),
459
- children: [children, /*#__PURE__*/_jsx("span", {
460
- contentEditable: false
461
- })]
460
+ children: children
462
461
  });
463
462
  case "headingSix":
464
- return /*#__PURE__*/_jsxs("h6", {
465
- ...commonHeadingProps(),
463
+ return /*#__PURE__*/_jsx("h6", {
464
+ ...attributes,
465
+ ...element.attr,
466
+ className: `edt-headings content-editable ${isEmpty ? "empty" : ""} disablePointerEvent`,
466
467
  placeholder: translation("Heading 6"),
467
- children: [children, /*#__PURE__*/_jsx("span", {
468
- contentEditable: false
469
- })]
468
+ children: children
470
469
  });
471
470
  case "paragraphOne":
472
471
  return /*#__PURE__*/_jsx("p", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "10.5.9",
3
+ "version": "10.6.0",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"