@flozy/editor 1.0.8 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/dist/Editor/CollaborativeEditor.js +6 -4
  2. package/dist/Editor/CommonEditor.js +43 -31
  3. package/dist/Editor/Elements/CodeToText/CodeToText.js +44 -33
  4. package/dist/Editor/Elements/CodeToText/CodeToTextButton.js +13 -8
  5. package/dist/Editor/Elements/CodeToText/HtmlCode.js +13 -8
  6. package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +14 -8
  7. package/dist/Editor/Elements/Color Picker/ColorPicker.js +61 -53
  8. package/dist/Editor/Elements/Embed/Embed.js +62 -49
  9. package/dist/Editor/Elements/Embed/Image.js +30 -24
  10. package/dist/Editor/Elements/Embed/Video.js +45 -38
  11. package/dist/Editor/Elements/Equation/Equation.js +17 -10
  12. package/dist/Editor/Elements/Equation/EquationButton.js +37 -28
  13. package/dist/Editor/Elements/Grid/Grid.js +14 -9
  14. package/dist/Editor/Elements/Grid/GridButton.js +5 -3
  15. package/dist/Editor/Elements/Grid/GridItem.js +18 -13
  16. package/dist/Editor/Elements/ID/Id.js +30 -24
  17. package/dist/Editor/Elements/Link/Link.js +26 -19
  18. package/dist/Editor/Elements/Link/LinkButton.js +45 -35
  19. package/dist/Editor/Elements/Mentions/Mentions.js +6 -4
  20. package/dist/Editor/Elements/NewLine/NewLineButton.js +5 -3
  21. package/dist/Editor/Elements/Table/Table.js +10 -3
  22. package/dist/Editor/Elements/Table/TableSelector.js +41 -33
  23. package/dist/Editor/Elements/TableContextMenu/TableContextMenu.js +18 -13
  24. package/dist/Editor/RemoteCursorOverlay/Overlay.js +35 -31
  25. package/dist/Editor/Toolbar/Toolbar.js +90 -94
  26. package/dist/Editor/common/Button.js +7 -6
  27. package/dist/Editor/common/Icon.js +34 -33
  28. package/dist/Editor/common/MentionsPopup.js +20 -18
  29. package/dist/Editor/utils/SlateUtilityFunctions.js +132 -52
  30. package/package.json +4 -4
@@ -1,9 +1,10 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React, { useEffect, useState } from "react";
3
2
  import { useSlateStatic, useSelected, useFocused, ReactEditor } from "slate-react";
4
3
  import { Node, Transforms } from "slate";
5
4
  import Icon from "../../common/Icon";
6
5
  import useResize from "../../utils/customHooks/useResize";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
8
  const Image = ({
8
9
  attributes,
9
10
  element,
@@ -37,34 +38,39 @@ const Image = ({
37
38
  });
38
39
  }
39
40
  }, [resizing]);
40
- return /*#__PURE__*/React.createElement("div", _extends({}, attributes, {
41
+ return /*#__PURE__*/_jsxs("div", {
42
+ ...attributes,
41
43
  className: "embed",
42
44
  style: {
43
45
  display: "flex",
44
46
  width: "100%",
45
47
  maxWidth: "100%",
46
48
  boxShadow: selected && focused && "0 0 3px 3px lightgray"
47
- }
48
- }, element.attr), /*#__PURE__*/React.createElement("div", {
49
- contentEditable: false,
50
- style: {
51
- position: "relative",
52
- width: size.widthInPercent ? `${size.widthInPercent}%` : `${size.width}px`,
53
- height: `${size.height}px`
54
- }
55
- }, /*#__PURE__*/React.createElement("img", {
56
- alt: alt,
57
- src: url
58
- }), selected && /*#__PURE__*/React.createElement("button", {
59
- onPointerDown: onMouseDown,
60
- style: {
61
- width: "15px",
62
- height: "15px",
63
- opacity: 1,
64
- background: "transparent"
65
- }
66
- }, /*#__PURE__*/React.createElement(Icon, {
67
- icon: "resize"
68
- }))), children);
49
+ },
50
+ ...element.attr,
51
+ children: [/*#__PURE__*/_jsxs("div", {
52
+ contentEditable: false,
53
+ style: {
54
+ position: "relative",
55
+ width: size.widthInPercent ? `${size.widthInPercent}%` : `${size.width}px`,
56
+ height: `${size.height}px`
57
+ },
58
+ children: [/*#__PURE__*/_jsx("img", {
59
+ alt: alt,
60
+ src: url
61
+ }), selected && /*#__PURE__*/_jsx("button", {
62
+ onPointerDown: onMouseDown,
63
+ style: {
64
+ width: "15px",
65
+ height: "15px",
66
+ opacity: 1,
67
+ background: "transparent"
68
+ },
69
+ children: /*#__PURE__*/_jsx(Icon, {
70
+ icon: "resize"
71
+ })
72
+ })]
73
+ }), children]
74
+ });
69
75
  };
70
76
  export default Image;
@@ -1,8 +1,9 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React from "react";
3
2
  import { useSelected, useFocused } from "slate-react";
4
3
  import Icon from "../../common/Icon";
5
4
  import useResize from "../../utils/customHooks/useResize";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
7
  const Video = ({
7
8
  attributes,
8
9
  element,
@@ -15,46 +16,52 @@ const Video = ({
15
16
  const [size, onMouseDown, resizing] = useResize();
16
17
  const selected = useSelected();
17
18
  const focused = useFocused();
18
- return /*#__PURE__*/React.createElement("div", _extends({}, attributes, {
19
+ return /*#__PURE__*/_jsxs("div", {
20
+ ...attributes,
19
21
  className: "embed",
20
22
  style: {
21
23
  display: "flex",
22
24
  boxShadow: selected && focused && "0 0 3px 3px lightgray"
23
- }
24
- }, element.attr), /*#__PURE__*/React.createElement("div", {
25
- contentEditable: false,
26
- style: {
27
- width: `${size.width}px`,
28
- height: `${size.height}px`
29
- }
30
- },
31
- // The iframe reloads on each re-render and hence it stutters and the document doesn't detect mouse-up event leading to unwanted behaviour
32
- // So during resize replace the iframe with a simple div
33
- resizing ? /*#__PURE__*/React.createElement("div", {
34
- style: {
35
- width: "100%",
36
- height: "100%",
37
- border: "2px dashed black",
38
- display: "flex",
39
- justifyContent: "center",
40
- alignItems: "center"
41
- }
42
- }, /*#__PURE__*/React.createElement(Icon, {
43
- icon: "videoPlayer"
44
- })) : /*#__PURE__*/React.createElement("iframe", {
45
- src: url,
46
- frameBorder: "0",
47
- title: alt
48
- }), selected && /*#__PURE__*/React.createElement("button", {
49
- onMouseDown: onMouseDown,
50
- style: {
51
- width: "15px",
52
- height: "15px",
53
- opacity: 1,
54
- background: "transparent"
55
- }
56
- }, /*#__PURE__*/React.createElement(Icon, {
57
- icon: "resize"
58
- }))), children);
25
+ },
26
+ ...element.attr,
27
+ children: [/*#__PURE__*/_jsxs("div", {
28
+ contentEditable: false,
29
+ style: {
30
+ width: `${size.width}px`,
31
+ height: `${size.height}px`
32
+ },
33
+ children: [
34
+ // The iframe reloads on each re-render and hence it stutters and the document doesn't detect mouse-up event leading to unwanted behaviour
35
+ // So during resize replace the iframe with a simple div
36
+ resizing ? /*#__PURE__*/_jsx("div", {
37
+ style: {
38
+ width: "100%",
39
+ height: "100%",
40
+ border: "2px dashed black",
41
+ display: "flex",
42
+ justifyContent: "center",
43
+ alignItems: "center"
44
+ },
45
+ children: /*#__PURE__*/_jsx(Icon, {
46
+ icon: "videoPlayer"
47
+ })
48
+ }) : /*#__PURE__*/_jsx("iframe", {
49
+ src: url,
50
+ frameBorder: "0",
51
+ title: alt
52
+ }), selected && /*#__PURE__*/_jsx("button", {
53
+ onMouseDown: onMouseDown,
54
+ style: {
55
+ width: "15px",
56
+ height: "15px",
57
+ opacity: 1,
58
+ background: "transparent"
59
+ },
60
+ children: /*#__PURE__*/_jsx(Icon, {
61
+ icon: "resize"
62
+ })
63
+ })]
64
+ }), children]
65
+ });
59
66
  };
60
67
  export default Video;
@@ -1,7 +1,8 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React from "react";
3
2
  import { InlineMath, BlockMath } from "react-katex";
4
3
  import "./styles.css";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
6
  const Equation = ({
6
7
  attributes,
7
8
  element,
@@ -11,14 +12,20 @@ const Equation = ({
11
12
  inline,
12
13
  math
13
14
  } = element;
14
- return /*#__PURE__*/React.createElement("div", {
15
- className: inline ? "equation-inline" : ""
16
- }, /*#__PURE__*/React.createElement("span", _extends({}, attributes, element.attr), /*#__PURE__*/React.createElement("span", {
17
- contentEditable: false
18
- }, inline ? /*#__PURE__*/React.createElement(InlineMath, {
19
- math: math
20
- }) : /*#__PURE__*/React.createElement(BlockMath, {
21
- math: math
22
- })), children));
15
+ return /*#__PURE__*/_jsx("div", {
16
+ className: inline ? "equation-inline" : "",
17
+ children: /*#__PURE__*/_jsxs("span", {
18
+ ...attributes,
19
+ ...element.attr,
20
+ children: [/*#__PURE__*/_jsx("span", {
21
+ contentEditable: false,
22
+ children: inline ? /*#__PURE__*/_jsx(InlineMath, {
23
+ math: math
24
+ }) : /*#__PURE__*/_jsx(BlockMath, {
25
+ math: math
26
+ })
27
+ }), children]
28
+ })
29
+ });
23
30
  };
24
31
  export default Equation;
@@ -4,6 +4,8 @@ import Icon from '../../common/Icon';
4
4
  import usePopup from '../../utils/customHooks/usePopup';
5
5
  import { insertEquation } from '../../utils/equation';
6
6
  import { Transforms } from 'slate';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
9
  const EquationButton = ({
8
10
  editor
9
11
  }) => {
@@ -33,34 +35,41 @@ const EquationButton = ({
33
35
  console.log('btn click');
34
36
  setShowInput(false);
35
37
  };
36
- return /*#__PURE__*/React.createElement("div", {
38
+ return /*#__PURE__*/_jsxs("div", {
37
39
  ref: equationInputRef,
38
- className: "popup-wrapper"
39
- }, /*#__PURE__*/React.createElement(Button, {
40
- format: "equation",
41
- onClick: toggleButton
42
- }, /*#__PURE__*/React.createElement(Icon, {
43
- icon: "equation"
44
- })), showInput && /*#__PURE__*/React.createElement("div", {
45
- className: "popup"
46
- }, /*#__PURE__*/React.createElement("div", {
47
- style: {
48
- display: 'flex',
49
- gap: '5px'
50
- }
51
- }, /*#__PURE__*/React.createElement("input", {
52
- type: "text",
53
- value: math,
54
- onChange: handleInputChange,
55
- placeholder: "Enter formula"
56
- }), /*#__PURE__*/React.createElement("div", {
57
- onClick: handleAddEquation
58
- }, /*#__PURE__*/React.createElement(Icon, {
59
- icon: "add"
60
- }))), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
61
- type: "checkbox",
62
- checked: displayInline,
63
- onChange: handleInputChange
64
- }), "Inline Equation")));
40
+ className: "popup-wrapper",
41
+ children: [/*#__PURE__*/_jsx(Button, {
42
+ format: "equation",
43
+ onClick: toggleButton,
44
+ children: /*#__PURE__*/_jsx(Icon, {
45
+ icon: "equation"
46
+ })
47
+ }), showInput && /*#__PURE__*/_jsxs("div", {
48
+ className: "popup",
49
+ children: [/*#__PURE__*/_jsxs("div", {
50
+ style: {
51
+ display: 'flex',
52
+ gap: '5px'
53
+ },
54
+ children: [/*#__PURE__*/_jsx("input", {
55
+ type: "text",
56
+ value: math,
57
+ onChange: handleInputChange,
58
+ placeholder: "Enter formula"
59
+ }), /*#__PURE__*/_jsx("div", {
60
+ onClick: handleAddEquation,
61
+ children: /*#__PURE__*/_jsx(Icon, {
62
+ icon: "add"
63
+ })
64
+ })]
65
+ }), /*#__PURE__*/_jsxs("label", {
66
+ children: [/*#__PURE__*/_jsx("input", {
67
+ type: "checkbox",
68
+ checked: displayInline,
69
+ onChange: handleInputChange
70
+ }), "Inline Equation"]
71
+ })]
72
+ })]
73
+ });
65
74
  };
66
75
  export default EquationButton;
@@ -1,8 +1,9 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React from "react";
3
2
  import { Transforms, Path } from "slate";
4
3
  import { useSelected, useSlateStatic } from "slate-react";
5
4
  import { gridItem } from "../../utils/gridItem";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
7
  const Grid = props => {
7
8
  const {
8
9
  attributes,
@@ -39,15 +40,19 @@ const Grid = props => {
39
40
  }
40
41
  };
41
42
  const GridToolBar = () => {
42
- return selected ? /*#__PURE__*/React.createElement("div", {
43
+ return selected ? /*#__PURE__*/_jsx("div", {
43
44
  className: "grid-container-toolbar",
44
- contentEditable: false
45
- }, /*#__PURE__*/React.createElement("button", {
46
- onClick: onAddGridItem
47
- }, "+ Add Item")) : null;
45
+ contentEditable: false,
46
+ children: /*#__PURE__*/_jsx("button", {
47
+ onClick: onAddGridItem,
48
+ children: "+ Add Item"
49
+ })
50
+ }) : null;
48
51
  };
49
- return /*#__PURE__*/React.createElement("div", _extends({
50
- className: `grid-container ${grid}`
51
- }, attributes), /*#__PURE__*/React.createElement(GridToolBar, null), children);
52
+ return /*#__PURE__*/_jsxs("div", {
53
+ className: `grid-container ${grid}`,
54
+ ...attributes,
55
+ children: [/*#__PURE__*/_jsx(GridToolBar, {}), children]
56
+ });
52
57
  };
53
58
  export default Grid;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import ViewComfyIcon from "@mui/icons-material/ViewComfy";
3
3
  import { insertGrid } from "../../utils/grid";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
4
5
  const GridButton = props => {
5
6
  const {
6
7
  editor
@@ -8,12 +9,13 @@ const GridButton = props => {
8
9
  const handleInsertGrid = () => {
9
10
  insertGrid(editor);
10
11
  };
11
- return /*#__PURE__*/React.createElement("button", {
12
+ return /*#__PURE__*/_jsx("button", {
12
13
  onClick: handleInsertGrid,
13
14
  title: "Layout",
14
15
  style: {
15
16
  marginLeft: "8px"
16
- }
17
- }, /*#__PURE__*/React.createElement(ViewComfyIcon, null));
17
+ },
18
+ children: /*#__PURE__*/_jsx(ViewComfyIcon, {})
19
+ });
18
20
  };
19
21
  export default GridButton;
@@ -1,7 +1,8 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React from "react";
3
2
  import { Transforms, Element } from "slate";
4
3
  import { useSelected, useSlateStatic } from "slate-react";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
6
  const GridItem = props => {
6
7
  const {
7
8
  attributes,
@@ -33,21 +34,25 @@ const GridItem = props => {
33
34
  });
34
35
  };
35
36
  const GridItemToolbar = () => {
36
- return selected ? /*#__PURE__*/React.createElement("div", {
37
+ return selected ? /*#__PURE__*/_jsxs("div", {
37
38
  contentEditable: false,
38
- className: "grid-item-toolbar"
39
- }, /*#__PURE__*/React.createElement("button", {
40
- onClick: onItemSizeDecrease
41
- }, "-"), /*#__PURE__*/React.createElement("button", {
42
- onClick: onItemSizeIncrease
43
- }, "+")) : null;
39
+ className: "grid-item-toolbar",
40
+ children: [/*#__PURE__*/_jsx("button", {
41
+ onClick: onItemSizeDecrease,
42
+ children: "-"
43
+ }), /*#__PURE__*/_jsx("button", {
44
+ onClick: onItemSizeIncrease,
45
+ children: "+"
46
+ })]
47
+ }) : null;
44
48
  };
45
- return /*#__PURE__*/React.createElement("div", _extends({
46
- className: `grid-item xs-${grid}`
47
- }, attributes, {
49
+ return /*#__PURE__*/_jsxs("div", {
50
+ className: `grid-item xs-${grid}`,
51
+ ...attributes,
48
52
  style: {
49
53
  width: `${itemWidth}%`
50
- }
51
- }), children, /*#__PURE__*/React.createElement(GridItemToolbar, null));
54
+ },
55
+ children: [children, /*#__PURE__*/_jsx(GridItemToolbar, {})]
56
+ });
52
57
  };
53
58
  export default GridItem;
@@ -3,6 +3,8 @@ import React, { useRef, useState } from "react";
3
3
  import Button from "../../common/Button";
4
4
  import Icon from "../../common/Icon";
5
5
  import usePopup from "../../utils/customHooks/usePopup";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
8
  const Id = ({
7
9
  editor
8
10
  }) => {
@@ -27,30 +29,34 @@ const Id = ({
27
29
  setShowInput(false);
28
30
  setId("");
29
31
  };
30
- return /*#__PURE__*/React.createElement("div", {
32
+ return /*#__PURE__*/_jsxs("div", {
31
33
  className: "popup-wrapper",
32
- ref: idInputRef
33
- }, /*#__PURE__*/React.createElement(Button, {
34
- className: showInput ? "clicked" : "",
35
- format: "add Id",
36
- onClick: toggleId
37
- }, /*#__PURE__*/React.createElement(Icon, {
38
- icon: "addId"
39
- })), showInput && /*#__PURE__*/React.createElement("div", {
40
- className: "popup",
41
- style: {
42
- display: "flex",
43
- gap: "4px"
44
- }
45
- }, /*#__PURE__*/React.createElement("input", {
46
- type: "text",
47
- placeholder: "Enter an unique ID",
48
- value: id,
49
- onChange: e => setId(e.target.value)
50
- }), /*#__PURE__*/React.createElement("div", {
51
- onClick: handleId
52
- }, /*#__PURE__*/React.createElement(Icon, {
53
- icon: "add"
54
- }))));
34
+ ref: idInputRef,
35
+ children: [/*#__PURE__*/_jsx(Button, {
36
+ className: showInput ? "clicked" : "",
37
+ format: "add Id",
38
+ onClick: toggleId,
39
+ children: /*#__PURE__*/_jsx(Icon, {
40
+ icon: "addId"
41
+ })
42
+ }), showInput && /*#__PURE__*/_jsxs("div", {
43
+ className: "popup",
44
+ style: {
45
+ display: "flex",
46
+ gap: "4px"
47
+ },
48
+ children: [/*#__PURE__*/_jsx("input", {
49
+ type: "text",
50
+ placeholder: "Enter an unique ID",
51
+ value: id,
52
+ onChange: e => setId(e.target.value)
53
+ }), /*#__PURE__*/_jsx("div", {
54
+ onClick: handleId,
55
+ children: /*#__PURE__*/_jsx(Icon, {
56
+ icon: "add"
57
+ })
58
+ })]
59
+ })]
60
+ });
55
61
  };
56
62
  export default Id;
@@ -1,9 +1,10 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
1
  import React from 'react';
3
2
  import { useFocused, useSelected, useSlateStatic } from 'slate-react';
4
3
  import { removeLink } from '../../utils/link';
5
4
  import unlink from '../../Toolbar/toolbarIcons/unlink.svg';
6
5
  import './styles.css';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
8
  const Link = ({
8
9
  attributes,
9
10
  element,
@@ -12,23 +13,29 @@ const Link = ({
12
13
  const editor = useSlateStatic();
13
14
  const selected = useSelected();
14
15
  const focused = useFocused();
15
- return /*#__PURE__*/React.createElement("div", {
16
- className: "link"
17
- }, /*#__PURE__*/React.createElement("a", _extends({
18
- href: element.href
19
- }, attributes, element.attr, {
20
- target: element.target
21
- }), children), selected && focused && /*#__PURE__*/React.createElement("div", {
22
- className: "link-popup",
23
- contentEditable: false
24
- }, /*#__PURE__*/React.createElement("a", {
25
- href: element.href,
26
- target: element.target
27
- }, element.href), /*#__PURE__*/React.createElement("button", {
28
- onClick: () => removeLink(editor)
29
- }, /*#__PURE__*/React.createElement("img", {
30
- src: unlink,
31
- alt: ""
32
- }))));
16
+ return /*#__PURE__*/_jsxs("div", {
17
+ className: "link",
18
+ children: [/*#__PURE__*/_jsx("a", {
19
+ href: element.href,
20
+ ...attributes,
21
+ ...element.attr,
22
+ target: element.target,
23
+ children: children
24
+ }), selected && focused && /*#__PURE__*/_jsxs("div", {
25
+ className: "link-popup",
26
+ contentEditable: false,
27
+ children: [/*#__PURE__*/_jsx("a", {
28
+ href: element.href,
29
+ target: element.target,
30
+ children: element.href
31
+ }), /*#__PURE__*/_jsx("button", {
32
+ onClick: () => removeLink(editor),
33
+ children: /*#__PURE__*/_jsx("img", {
34
+ src: unlink,
35
+ alt: ""
36
+ })
37
+ })]
38
+ })]
39
+ });
33
40
  };
34
41
  export default Link;
@@ -5,6 +5,8 @@ import Icon from "../../common/Icon";
5
5
  import { isBlockActive } from "../../utils/SlateUtilityFunctions";
6
6
  import usePopup from "../../utils/customHooks/usePopup";
7
7
  import { Transforms } from "slate";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
10
  const LinkButton = props => {
9
11
  const {
10
12
  editor
@@ -37,41 +39,49 @@ const LinkButton = props => {
37
39
  setUrl(target.value);
38
40
  }
39
41
  };
40
- return /*#__PURE__*/React.createElement("div", {
42
+ return /*#__PURE__*/_jsxs("div", {
41
43
  ref: linkInputRef,
42
- className: "popup-wrapper"
43
- }, /*#__PURE__*/React.createElement(Button, {
44
- className: showInput ? "clicked" : "",
45
- active: isBlockActive(editor, "link"),
46
- format: "link",
47
- onClick: toggleLink
48
- }, /*#__PURE__*/React.createElement(Icon, {
49
- icon: "link"
50
- })), showInput && /*#__PURE__*/React.createElement("div", {
51
- className: "popup"
52
- }, /*#__PURE__*/React.createElement("div", {
53
- style: {
54
- display: "flex",
55
- gap: "4px",
56
- margin: "5px 2px"
57
- }
58
- }, /*#__PURE__*/React.createElement("input", {
59
- type: "text",
60
- placeholder: "https://google.com",
61
- value: url,
62
- onChange: handleInputChange
63
- }), /*#__PURE__*/React.createElement("div", {
64
- onClick: handleInsertLink
65
- }, /*#__PURE__*/React.createElement(Icon, {
66
- icon: "add"
67
- }))), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
68
- type: "checkbox",
69
- checked: showInNewTab,
70
- onChange: handleInputChange
71
- }), /*#__PURE__*/React.createElement("span", {
72
- style: {
73
- fontSize: "0.8em"
74
- }
75
- }, "Open in new tab"))));
44
+ className: "popup-wrapper",
45
+ children: [/*#__PURE__*/_jsx(Button, {
46
+ className: showInput ? "clicked" : "",
47
+ active: isBlockActive(editor, "link"),
48
+ format: "link",
49
+ onClick: toggleLink,
50
+ children: /*#__PURE__*/_jsx(Icon, {
51
+ icon: "link"
52
+ })
53
+ }), showInput && /*#__PURE__*/_jsxs("div", {
54
+ className: "popup",
55
+ children: [/*#__PURE__*/_jsxs("div", {
56
+ style: {
57
+ display: "flex",
58
+ gap: "4px",
59
+ margin: "5px 2px"
60
+ },
61
+ children: [/*#__PURE__*/_jsx("input", {
62
+ type: "text",
63
+ placeholder: "https://google.com",
64
+ value: url,
65
+ onChange: handleInputChange
66
+ }), /*#__PURE__*/_jsx("div", {
67
+ onClick: handleInsertLink,
68
+ children: /*#__PURE__*/_jsx(Icon, {
69
+ icon: "add"
70
+ })
71
+ })]
72
+ }), /*#__PURE__*/_jsxs("label", {
73
+ children: [/*#__PURE__*/_jsx("input", {
74
+ type: "checkbox",
75
+ checked: showInNewTab,
76
+ onChange: handleInputChange
77
+ }), /*#__PURE__*/_jsx("span", {
78
+ style: {
79
+ fontSize: "0.8em"
80
+ },
81
+ children: "Open in new tab"
82
+ })]
83
+ })]
84
+ })]
85
+ });
76
86
  };
77
87
  export default LinkButton;