@flozy/editor 3.1.2 → 3.1.4

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.
@@ -91,15 +91,9 @@ const EditorButton = props => {
91
91
  }
92
92
  break;
93
93
  case "actionTrigger":
94
- if (readOnly) {
95
- const {
96
- url
97
- } = buttonLink || {};
98
- const refUrl = url ? url.includes("http") ? url : `//${url}` : "Link";
99
- props.component = "a";
100
- if (refUrl !== "Link") {
101
- props.href = refUrl;
102
- }
94
+ if (!readOnly) {
95
+ props.component = "button";
96
+ props.onClick = () => {};
103
97
  } else {
104
98
  props.component = "button";
105
99
  props.onClick = handleTrigger;
@@ -136,6 +130,8 @@ const EditorButton = props => {
136
130
  }
137
131
  };
138
132
  break;
133
+ default:
134
+ return {};
139
135
  }
140
136
  return props;
141
137
  };
@@ -6,7 +6,7 @@ import { IconButton, Tooltip, Grid as GridContainer } from "@mui/material";
6
6
  import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
7
7
  import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward";
8
8
  import KeyboardReturnIcon from "@mui/icons-material/KeyboardReturn";
9
- import ContentCopyIcon from '@mui/icons-material/ContentCopy';
9
+ import ContentCopyIcon from "@mui/icons-material/ContentCopy";
10
10
  import { insertGrid } from "../../utils/grid";
11
11
  import { GridAddGridIcon, GridSettingsIcon } from "../../common/iconslist";
12
12
  import GridPopup from "./GridPopup";
@@ -155,7 +155,8 @@ const Grid = props => {
155
155
  const onNewLine = direction => () => {
156
156
  try {
157
157
  if (direction) {
158
- let moveTo = direction === "up" ? path[0] - 1 : path[0] + 1;
158
+ const path = ReactEditor.findPath(editor, element);
159
+ let moveTo = direction === "up" ? path : Path.next(path);
159
160
  let lastLine = false;
160
161
  if (moveTo < 0) {
161
162
  moveTo = 0;
@@ -169,7 +170,8 @@ const Grid = props => {
169
170
  text: ""
170
171
  }]
171
172
  }, {
172
- at: [moveTo]
173
+ at: [...moveTo],
174
+ select: true
173
175
  });
174
176
  if (lastLine) {
175
177
  Transforms.move(editor, {
@@ -107,6 +107,7 @@ function SelectFontSize({
107
107
  className: `customSelectOptionLabel ${fontSize === s ? "selected" : ""}`,
108
108
  onClick: () => {
109
109
  setFontSize(s);
110
+ onChangeSize(s);
110
111
  },
111
112
  children: s
112
113
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"