@flozy/editor 4.3.4 → 4.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -80,7 +80,9 @@ const EditorButton = props => {
80
80
  window.open(refUrl, "_blank").focus();
81
81
  }
82
82
  };
83
- const buttonProps = handleLinkType(refURl, linkType, readOnly, openInNewTab, handleTrigger);
83
+ const buttonProps = handleLinkType(refURl, linkType, true,
84
+ // button functionalities have to work on both edit mode and normal mode
85
+ openInNewTab, handleTrigger);
84
86
  const onMenuClick = val => () => {
85
87
  switch (val) {
86
88
  case "edit":
@@ -99,7 +101,7 @@ const EditorButton = props => {
99
101
  }
100
102
  };
101
103
  const Toolbar = () => {
102
- const btnProps = handleLinkType(refURl, linkType, true, true, handleTrigger);
104
+ const btnProps = handleLinkType(refURl, linkType, true, openInNewTab, handleTrigger);
103
105
  const hideOpenLink = linkType === "page" || !linkType;
104
106
  return !readOnly ? /*#__PURE__*/_jsxs("div", {
105
107
  className: "element-toolbar hr",
@@ -138,7 +140,6 @@ const EditorButton = props => {
138
140
  border: 'none !important'
139
141
  },
140
142
  ...btnProps,
141
- target: openInNewTab ? "_blank" : "_self",
142
143
  children: /*#__PURE__*/_jsx(Icon, {
143
144
  icon: "openLinkIcon"
144
145
  })
@@ -180,7 +180,7 @@ const Video = ({
180
180
  if (resizing) {
181
181
  return {
182
182
  width: size.width ? `${size.width}px` : "100%",
183
- height: url ? `${size.height || 300}px` : "auto"
183
+ height: url ? `${size.height || 370}px` : "auto"
184
184
  };
185
185
  } else {
186
186
  return {
@@ -235,8 +235,8 @@ const FreeGrid = props => {
235
235
  alt: "",
236
236
  images: []
237
237
  }), {
238
- height: 300,
239
- width: 250
238
+ height: 370,
239
+ width: 650
240
240
  })
241
241
  }], {
242
242
  at: [...insertAt]
@@ -278,11 +278,11 @@ const useFreeGridStyles = ({
278
278
  },
279
279
  sectionSettingsPopper: {
280
280
  "&.style-settings-wrpr": {
281
- height: "300px",
281
+ maxHeight: "650px",
282
282
  overflowY: "auto",
283
283
  overflowX: "hidden",
284
284
  padding: "8px 8px 12px 12px",
285
- marginBotton: "12px"
285
+ marginBottom: "12px"
286
286
  }
287
287
  }
288
288
  });
@@ -13,7 +13,7 @@ import PopperHeader from "../PopperHeader";
13
13
  import MiniColorPicker from "./MiniColorPicker";
14
14
  import SelectAlignment from "./SelectAlignment";
15
15
  import SelectFontSize from "./SelectFontSize";
16
- import InfinityAITool from "./InfinityAITool";
16
+ // import InfinityAITool from "./InfinityAITool";
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
19
19
  const DEFAULT_COLOR = {
@@ -27,8 +27,8 @@ const MiniTextFormat = props => {
27
27
  const {
28
28
  classes,
29
29
  editor,
30
- closeMainPopup,
31
- customProps
30
+ closeMainPopup
31
+ // customProps
32
32
  } = props;
33
33
  const [anchorEl, setAnchorEl] = useState(null);
34
34
  const open = Boolean(anchorEl);
@@ -50,7 +50,7 @@ const MiniTextFormat = props => {
50
50
  xs: 12,
51
51
  children: /*#__PURE__*/_jsxs("div", {
52
52
  className: "toolWrapper",
53
- children: [customProps?.hideTools?.includes("infinityAI") ? null : /*#__PURE__*/_jsx(InfinityAITool, {}), /*#__PURE__*/_jsx(SelectTypography, {
53
+ children: [/*#__PURE__*/_jsx(SelectTypography, {
54
54
  classes: classes,
55
55
  editor: editor,
56
56
  closeMainPopup: closeMainPopup
@@ -5,7 +5,7 @@ const usePopupStyle = theme => ({
5
5
  marginBottom: "12px !important",
6
6
  border: "1px solid #D8DDE1",
7
7
  borderRadius: "6px",
8
- maxWidth: "96%",
8
+ maxWidth: "100%",
9
9
  "&.fullscreen": {
10
10
  marginBottom: "0px !important",
11
11
  "& .papper-wrpr": {
@@ -55,7 +55,7 @@ const useElementSettingsStyle = theme => ({
55
55
  }
56
56
  },
57
57
  "& .item-w": {
58
- maxHeight: "300px",
58
+ maxHeight: "500px",
59
59
  overflowX: "hidden",
60
60
  overflowY: "auto",
61
61
  background: theme?.palette?.editor?.background,
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import { Box, Paper, Popper, Typography, Tooltip, IconButton } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
- import HelpIcon from "@mui/icons-material/Help";
5
4
  import useOptionsPopupStyle from "./style";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
7
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -31,22 +30,16 @@ const OptionsPopup = props => {
31
30
  children: [/*#__PURE__*/_jsxs(Typography, {
32
31
  variant: "div",
33
32
  className: "item-wrapper title",
34
- children: [title, /*#__PURE__*/_jsxs(Box, {
33
+ children: [title, /*#__PURE__*/_jsx(Box, {
35
34
  component: "div",
36
- children: [/*#__PURE__*/_jsx(Tooltip, {
37
- title: "Help",
38
- arrow: true,
39
- children: /*#__PURE__*/_jsx(IconButton, {
40
- children: /*#__PURE__*/_jsx(HelpIcon, {})
41
- })
42
- }), /*#__PURE__*/_jsx(Tooltip, {
35
+ children: /*#__PURE__*/_jsx(Tooltip, {
43
36
  title: "Close",
44
37
  arrow: true,
45
38
  children: /*#__PURE__*/_jsx(IconButton, {
46
39
  onClick: handleClose,
47
40
  children: /*#__PURE__*/_jsx(CloseIcon, {})
48
41
  })
49
- })]
42
+ })
50
43
  })]
51
44
  }), children]
52
45
  })
@@ -9,7 +9,7 @@ const useOptionsPopupStyle = ({
9
9
  boxShadow: "1px 1px 3px rgba(0,0,0,0.3)",
10
10
  marginRight: "4px !important",
11
11
  "& .papper-root": {
12
- width: "270px",
12
+ width: "344px",
13
13
  boxShadow: "none",
14
14
  border: `1px solid ${theme?.palette?.editor?.borderColor}`,
15
15
  borderRadius: "7px",
@@ -47,7 +47,7 @@ const useOptionsPopupStyle = ({
47
47
  }
48
48
  },
49
49
  "& .item-wrapper": {
50
- padding: "8px",
50
+ padding: "12px 12px",
51
51
  fontFamily: "sans-serif",
52
52
  "& .MuiListItemIcon-root": {
53
53
  minWidth: "30px"
@@ -61,9 +61,9 @@ const useOptionsPopupStyle = ({
61
61
  color: theme?.palette?.editor?.textColor,
62
62
  "&:after": {
63
63
  position: "absolute",
64
- width: "100%",
64
+ width: "calc(100% - 24px)",
65
65
  bottom: 0,
66
- left: 0,
66
+ left: 12,
67
67
  content: '" "',
68
68
  borderBottom: "1px solid #ccc"
69
69
  },
@@ -1,6 +1,5 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
- import { Editor, Node, Path, Transforms } from "slate";
3
- import { ReactEditor } from "slate-react";
2
+ import { Node, Path } from "slate";
4
3
  import { Box } from "@mui/material";
5
4
  import { Rnd } from "react-rnd";
6
5
  import Handles from "./TransformHandles";
@@ -163,7 +162,7 @@ const RnD = props => {
163
162
  anchorEl: rndRef?.current
164
163
  });
165
164
  }
166
- ReactEditor.focus(editor);
165
+ // ReactEditor.focus(editor);
167
166
  break;
168
167
  case 2:
169
168
  focusSelection(editor, {
@@ -24,8 +24,22 @@ export const createEmbedNode = (type, {
24
24
  text: " "
25
25
  }],
26
26
  size: {
27
- widthInPercent: "100",
28
- height: type === "image" ? "auto" : 300
27
+ xs: {
28
+ widthInPercent: "100",
29
+ height: 300
30
+ },
31
+ sm: {
32
+ widthInPercent: "100",
33
+ height: 370
34
+ },
35
+ md: {
36
+ widthInPercent: "100",
37
+ height: 420
38
+ },
39
+ lg: {
40
+ widthInPercent: "100",
41
+ height: 520
42
+ }
29
43
  },
30
44
  alignment: {
31
45
  horizantal: "center"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.3.4",
3
+ "version": "4.3.6",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"