@flozy/editor 3.5.3 → 3.5.5

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.
@@ -13,6 +13,7 @@ import formButtonStyle from "../../common/StyleBuilder/formButtonStyle";
13
13
  import Workflow from "./Workflow";
14
14
  import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
15
15
  import { validation } from "./FormElements/validations";
16
+ import Icon from "../../common/Icon";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
19
  const Form = props => {
@@ -256,6 +257,9 @@ const Form = props => {
256
257
  const onMouseOver = () => {
257
258
  setShowOptions(true);
258
259
  };
260
+ const handleCloseMessage = () => {
261
+ setSubmittedSuccessfully(false);
262
+ };
259
263
  const onMouseLeave = () => {
260
264
  setShowOptions(false);
261
265
  };
@@ -408,27 +412,47 @@ const Form = props => {
408
412
  }
409
413
  })
410
414
  })]
411
- }) : /*#__PURE__*/_jsx(Typography, {
412
- sx: {
413
- color: textColor || "#A2A9B4",
414
- borderColor: borderColor || "transparent",
415
- borderWidth: borderWidth || "1px",
416
- borderRadius: {
417
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
418
- },
419
- borderStyle: borderStyle || "solid",
420
- background: bgColor || "transparent",
421
- padding: {
422
- ...getTRBLBreakPoints(bannerSpacing)
423
- },
424
- minHeight: `${formHeight}px`,
425
- display: 'flex',
415
+ }) : /*#__PURE__*/_jsx(Grid, {
416
+ item: true,
417
+ children: /*#__PURE__*/_jsxs(Grid, {
418
+ container: true,
426
419
  alignItems: "center",
427
420
  justifyContent: "center",
428
- textAlign: "center",
429
- position: 'relative'
430
- },
431
- children: "Form Submitted Successfully...!"
421
+ spacing: 2,
422
+ children: [/*#__PURE__*/_jsx(Grid, {
423
+ item: true,
424
+ children: /*#__PURE__*/_jsx(Typography, {
425
+ sx: {
426
+ color: textColor || "#A2A9B4",
427
+ borderColor: borderColor || "transparent",
428
+ borderWidth: borderWidth || "1px",
429
+ borderRadius: {
430
+ ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
431
+ },
432
+ borderStyle: borderStyle || "solid",
433
+ background: bgColor || "transparent",
434
+ padding: {
435
+ ...getTRBLBreakPoints(bannerSpacing)
436
+ },
437
+ minHeight: `${formHeight}px`,
438
+ display: 'flex',
439
+ alignItems: "center",
440
+ justifyContent: "center",
441
+ textAlign: "center",
442
+ position: 'relative'
443
+ },
444
+ children: "Form Submitted Successfully...!"
445
+ })
446
+ }), /*#__PURE__*/_jsx(Grid, {
447
+ item: true,
448
+ children: /*#__PURE__*/_jsx(IconButton, {
449
+ onClick: handleCloseMessage,
450
+ children: /*#__PURE__*/_jsx(Icon, {
451
+ icon: "closeIcon"
452
+ })
453
+ })
454
+ })]
455
+ })
432
456
  }), openSetttings ? /*#__PURE__*/_jsx(FormPopup, {
433
457
  element: element,
434
458
  onSave: onSave,
@@ -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.5",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"