@flozy/editor 3.8.8 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -54,22 +54,6 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
54
54
|
if (editor) {
|
55
55
|
ReactEditor.focus(editor);
|
56
56
|
insertEmoji(editor, emoji?.native, editor.selection);
|
57
|
-
if (editor.selection) {
|
58
|
-
// const path = editor.selection.anchor.path;
|
59
|
-
// const offset = editor.selection.anchor.offset + emoji?.native.length;
|
60
|
-
const position = {
|
61
|
-
anchor: {
|
62
|
-
path: [0],
|
63
|
-
offset: 0
|
64
|
-
},
|
65
|
-
focus: {
|
66
|
-
path: [0],
|
67
|
-
offset: 0
|
68
|
-
}
|
69
|
-
};
|
70
|
-
// Create a new selection
|
71
|
-
Transforms.select(editor, position);
|
72
|
-
}
|
73
57
|
ReactEditor.focus(editor);
|
74
58
|
}
|
75
59
|
},
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { getBorderColor, getTextColor } from "../../helper";
|
3
2
|
import { Box } from "@mui/material";
|
4
3
|
import { getBreakPointsValue, getTRBLBreakPoints } from "../../helper/theme";
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -16,23 +15,21 @@ const AccordionSummary = props => {
|
|
16
15
|
borderRadius,
|
17
16
|
bannerSpacing
|
18
17
|
} = element;
|
19
|
-
const textStyles = getTextColor(textColor);
|
20
|
-
const borderStyle = getBorderColor(borderColor);
|
21
18
|
return /*#__PURE__*/_jsx(Box, {
|
22
19
|
className: `accordion-summary-container`,
|
23
20
|
...attributes,
|
24
21
|
sx: {
|
25
22
|
width: "100%",
|
26
23
|
position: "relative",
|
24
|
+
backgroundColor: bgColor,
|
25
|
+
border: `1px solid ${borderColor}`,
|
26
|
+
color: textColor,
|
27
27
|
borderRadius: {
|
28
28
|
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
29
29
|
},
|
30
30
|
padding: {
|
31
31
|
...getTRBLBreakPoints(bannerSpacing)
|
32
|
-
}
|
33
|
-
background: bgColor,
|
34
|
-
...borderStyle,
|
35
|
-
'& span[data-slate-string="true"]': textStyles
|
32
|
+
}
|
36
33
|
},
|
37
34
|
component: "div",
|
38
35
|
children: children
|
@@ -154,26 +154,4 @@ export const debounce = function (func, wait, immediate) {
|
|
154
154
|
timeout = setTimeout(later, wait);
|
155
155
|
if (callNow) func.apply(context, args);
|
156
156
|
};
|
157
|
-
};
|
158
|
-
export const getTextColor = (color = "") => {
|
159
|
-
return color?.indexOf("gradient") >= 0 ? {
|
160
|
-
background: color?.concat("text"),
|
161
|
-
WebkitBackgroundClip: "text",
|
162
|
-
WebkitTextFillColor: "transparent",
|
163
|
-
color: "transparent",
|
164
|
-
caretColor: "black"
|
165
|
-
} : {
|
166
|
-
color
|
167
|
-
};
|
168
|
-
};
|
169
|
-
export const getBorderColor = (borderColor = "") => {
|
170
|
-
const borderStyle = borderColor ? {
|
171
|
-
border: "1px solid"
|
172
|
-
} : {};
|
173
|
-
if (borderColor?.indexOf("gradient") >= 0) {
|
174
|
-
borderStyle.borderImage = `${borderColor} 1`;
|
175
|
-
} else {
|
176
|
-
borderStyle.borderColor = borderColor;
|
177
|
-
}
|
178
|
-
return borderStyle;
|
179
157
|
};
|
@@ -32,7 +32,7 @@ import FormField from "../Elements/Form/FormField";
|
|
32
32
|
import InlineIcon from "../Elements/InlineIcon/InlineIcon";
|
33
33
|
import SimpleText from "../Elements/SimpleText";
|
34
34
|
import CheckList from "../Elements/List/CheckList";
|
35
|
-
import {
|
35
|
+
import { isEmptyTextNode } from "../helper";
|
36
36
|
import Attachments from "../Elements/Attachments/Attachments";
|
37
37
|
import { getBreakPointsValue } from "../helper/theme";
|
38
38
|
import Variables from "../Elements/Variables/Variable";
|
@@ -203,7 +203,13 @@ export const getMarked = (leaf, children) => {
|
|
203
203
|
// cover under single span
|
204
204
|
if (leaf.color || leaf.bgColor || leaf.fontSize || leaf.fontFamily || leaf.fontWeight || className) {
|
205
205
|
const family = fontFamilyMap[leaf?.fontFamily];
|
206
|
-
const textStyles =
|
206
|
+
const textStyles = leaf?.color?.indexOf("gradient") >= 0 ? {
|
207
|
+
background: leaf?.color?.concat("text"),
|
208
|
+
WebkitBackgroundClip: "text",
|
209
|
+
WebkitTextFillColor: "transparent"
|
210
|
+
} : {
|
211
|
+
color: leaf.color
|
212
|
+
};
|
207
213
|
children = /*#__PURE__*/_jsx("span", {
|
208
214
|
style: {
|
209
215
|
background: leaf.bgColor
|