@flozy/editor 3.5.3 → 3.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -103,22 +103,26 @@ const MentionsPopup = /*#__PURE__*/forwardRef((props, ref) => {
103
103
  }, 0);
104
104
  };
105
105
  const handleInsertMention = (char, e) => {
106
- if (!char.renderComponent) {
107
- Transforms.select(editor, target);
108
- if (char.type === "infinityAI") {
109
- setOpenAI("fromElements");
106
+ try {
107
+ if (!char.renderComponent) {
108
+ Transforms.select(editor, target);
109
+ if (char.type === "infinityAI") {
110
+ setOpenAI("fromElements");
111
+ }
112
+ insertMention(editor, char, type);
113
+ setMentions({
114
+ ...mentions,
115
+ target: null
116
+ });
117
+ } else if (buttonRef && buttonRef?.current) {
118
+ if (e) {
119
+ e.preventDefault();
120
+ }
121
+ // trigger click of the ToolbarIcon button
122
+ buttonRef?.current?.triggerClick(target);
110
123
  }
111
- insertMention(editor, char, type);
112
- setMentions({
113
- ...mentions,
114
- target: null
115
- });
116
- } else if (buttonRef && buttonRef?.current) {
117
- if (e) {
118
- e.preventDefault();
119
- }
120
- // trigger click of the ToolbarIcon button
121
- buttonRef?.current?.triggerClick(target);
124
+ } catch (err) {
125
+ console.log(err);
122
126
  }
123
127
  };
124
128
  return target && chars.length > 0 ? /*#__PURE__*/_jsx(Popper, {
@@ -133,6 +133,7 @@ const SaveAsTemplate = props => {
133
133
  children: /*#__PURE__*/_jsx(TextField, {
134
134
  fullWidth: true,
135
135
  name: "category",
136
+ placeholder: "Category",
136
137
  value: template?.category,
137
138
  onChange: onChange,
138
139
  size: "small"
@@ -1536,19 +1536,17 @@ export const UploadImage = () => /*#__PURE__*/_jsx("svg", {
1536
1536
  })
1537
1537
  });
1538
1538
  export const WorkflowIcon = () => {
1539
- return /*#__PURE__*/_jsxs("svg", {
1539
+ return /*#__PURE__*/_jsx("svg", {
1540
1540
  xmlns: "http://www.w3.org/2000/svg",
1541
1541
  fill: "#000000",
1542
1542
  width: "800px",
1543
1543
  height: "800px",
1544
1544
  viewBox: "0 0 32 32",
1545
1545
  version: "1.1",
1546
- children: [/*#__PURE__*/_jsx("title", {
1547
- children: "lightning-bolt"
1548
- }), /*#__PURE__*/_jsx("path", {
1546
+ children: /*#__PURE__*/_jsx("path", {
1549
1547
  d: "M23.5 13.187h-7.5v-12.187l-7.5 17.813h7.5v12.187l7.5-17.813z",
1550
1548
  fill: "#f3b814"
1551
- })]
1549
+ })
1552
1550
  });
1553
1551
  };
1554
1552
  export const LeftArrow = () => /*#__PURE__*/_jsx("svg", {
@@ -1,11 +1,15 @@
1
1
  import { Transforms } from "slate";
2
2
  import insertNewLine from "./insertNewLine";
3
3
  export const insertDefaultEmbed = (editor, type, defaultURL = "") => {
4
- const url = defaultURL ? defaultURL : type === "image" ? "" : "";
5
- insertEmbed(editor, {
6
- url,
7
- images: []
8
- }, type);
4
+ try {
5
+ const url = defaultURL ? defaultURL : type === "image" ? "" : "";
6
+ insertEmbed(editor, {
7
+ url,
8
+ images: []
9
+ }, type);
10
+ } catch (err) {
11
+ console.log(err);
12
+ }
9
13
  };
10
14
  export const createEmbedNode = (type, {
11
15
  url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"