@flozy/editor 4.1.5 → 4.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -248,6 +248,16 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
248
248
  restVal
249
249
  });
250
250
  };
251
+ const handlePaste = event => {
252
+ const items = event.clipboardData.items;
253
+ for (let i = 0; i < items.length; i++) {
254
+ if (items[i].type.startsWith("image/")) {
255
+ event.preventDefault(); // Prevent the default paste behavior
256
+ return; // Exit early to keep the editor empty
257
+ }
258
+ }
259
+ };
260
+
251
261
  return /*#__PURE__*/_jsx(EditorProvider, {
252
262
  theme: theme,
253
263
  editor: editor,
@@ -267,7 +277,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
267
277
  placeholder: "Start typing ...",
268
278
  spellCheck: true,
269
279
  onBlur: handleBlur,
270
- onKeyDown: onKeyDown
280
+ onKeyDown: onKeyDown,
281
+ onPaste: handlePaste
271
282
  }), !readOnly ? /*#__PURE__*/_jsx(MentionsPopup, {
272
283
  ref: mentionsRef,
273
284
  mentions: mentions,
@@ -81,7 +81,7 @@ function AIInput({
81
81
  const selectWrapper = refs?.length ? refs[1]?.current : null;
82
82
  const slateWrapper = document.getElementById("slate-wrapper-scroll-container");
83
83
  if (selectWrapper && slateWrapper) {
84
- const height = slateWrapper.offsetHeight - selectWrapper.offsetHeight - 80;
84
+ const height = slateWrapper.offsetHeight - selectWrapper.offsetHeight - 170;
85
85
  setContentHeight(height + "px");
86
86
  }
87
87
  }, [refs, generatedText]);
@@ -95,7 +95,8 @@ const Styles = theme => ({
95
95
  generatedText: {
96
96
  margin: "8px",
97
97
  overflow: "auto",
98
- fontSize: "inherit"
98
+ fontSize: "inherit",
99
+ color: `${theme?.palette?.editor?.textColor} !important`
99
100
  },
100
101
  customSelectWrapper: {
101
102
  width: "fit-content",
@@ -37,14 +37,14 @@ const FormTextArea = props => {
37
37
  ...getTRBLBreakPoints(bannerSpacing)
38
38
  },
39
39
  height: height || "150px",
40
- borderColor: borderColor || "transparent",
40
+ borderColor: `${borderColor || "transparent"} !important`,
41
41
  borderWidth: borderWidth || "1px",
42
42
  borderRadius: {
43
43
  ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
44
44
  },
45
45
  borderStyle: borderStyle || "solid",
46
- color: textColor || "#000",
47
- background: bgColor || "transparent",
46
+ color: `${textColor || "#000"} !important`,
47
+ background: `${bgColor || "transparent"} !important`,
48
48
  fontSize: '14px'
49
49
  }
50
50
  })
@@ -24,6 +24,7 @@ const FontLoader = props => {
24
24
  google: {
25
25
  families: [...batchWithWeights]
26
26
  },
27
+ classes: false,
27
28
  active: () => {
28
29
  console.log(`Fonts loaded successfully: ${batch}`);
29
30
  currentIndex += batchSize;
@@ -25,8 +25,22 @@ const Settings = props => {
25
25
  children: /*#__PURE__*/_jsx(Popper, {
26
26
  open: open,
27
27
  anchorEl: anchorEl,
28
- placement: placement,
28
+ placement: "auto-start",
29
29
  sx: classes.root,
30
+ modifiers: [{
31
+ name: "flip",
32
+ enabled: true,
33
+ options: {
34
+ altBoundary: true,
35
+ rootBoundary: "viewport"
36
+ }
37
+ }, {
38
+ name: "preventOverflow",
39
+ enabled: true,
40
+ options: {
41
+ padding: 8
42
+ }
43
+ }],
30
44
  children: /*#__PURE__*/_jsxs(Paper, {
31
45
  className: "papper-root",
32
46
  children: [/*#__PURE__*/_jsxs(Typography, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.1.5",
3
+ "version": "4.1.6",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"