@flozy/editor 4.7.0 → 4.7.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +1 -1
- package/dist/Editor/Elements/AI/AIInput.js +5 -4
- package/dist/Editor/Elements/AI/PopoverAIInput.js +62 -78
- package/dist/Editor/Elements/AI/Styles.js +0 -1
- package/dist/Editor/Styles/EditorStyles.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +1 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -1
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +3 -5
- package/dist/Editor/common/iconslist.js +31 -31
- package/dist/Editor/utils/Decorators/index.js +2 -3
- package/dist/Editor/utils/SlateUtilityFunctions.js +0 -9
- package/package.json +1 -1
- package/dist/Editor/utils/Decorators/highlightSelection.js +0 -16
@@ -534,7 +534,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
534
534
|
readOnly: isReadOnly,
|
535
535
|
renderElement: renderElement,
|
536
536
|
renderLeaf: renderLeaf,
|
537
|
-
decorate:
|
537
|
+
decorate: decorators,
|
538
538
|
onKeyDown: onKeyDown,
|
539
539
|
onSelect: () => handleCursorScroll(editorWrapper.current)
|
540
540
|
}), !readOnly ? /*#__PURE__*/_jsx(MentionsPopup, {
|
@@ -90,7 +90,6 @@ function AIInput({
|
|
90
90
|
children: [/*#__PURE__*/_jsxs(Box, {
|
91
91
|
component: "div",
|
92
92
|
sx: classes.aiContainer,
|
93
|
-
ref: refs[0],
|
94
93
|
children: [generatedText ? /*#__PURE__*/_jsx(Typography, {
|
95
94
|
sx: classes.generatedText,
|
96
95
|
style: {
|
@@ -105,6 +104,7 @@ function AIInput({
|
|
105
104
|
onSubmit: e => {
|
106
105
|
e.preventDefault();
|
107
106
|
},
|
107
|
+
ref: refs[0],
|
108
108
|
children: [/*#__PURE__*/_jsx("div", {
|
109
109
|
className: "icon-container icons-elements",
|
110
110
|
ref: inputWrapperRef,
|
@@ -116,21 +116,22 @@ function AIInput({
|
|
116
116
|
children: /*#__PURE__*/_jsx(WaveLoading, {})
|
117
117
|
}) : /*#__PURE__*/_jsx(TextareaAutosize, {
|
118
118
|
className: "ai-input",
|
119
|
-
placeholder: "Ask AI to write anything...",
|
119
|
+
placeholder: fromToolBar ? "" : "Ask AI to write anything...",
|
120
120
|
ref: inputRef,
|
121
121
|
value: inputValue,
|
122
122
|
onChange: onInputChange,
|
123
|
+
disabled: fromToolBar,
|
123
124
|
onKeyDown: event => {
|
124
125
|
if (event.key === "Enter" && !event.shiftKey) {
|
125
126
|
event.preventDefault();
|
126
127
|
handleSendBtnClick();
|
127
128
|
}
|
128
129
|
}
|
129
|
-
}), /*#__PURE__*/_jsxs(Box, {
|
130
|
+
}), fromToolBar ? null : /*#__PURE__*/_jsxs(Box, {
|
130
131
|
component: "div",
|
131
132
|
style: classes.sendIconContainer,
|
132
133
|
className: "icons-elements",
|
133
|
-
children: [/*#__PURE__*/_jsx(IconButton, {
|
134
|
+
children: [isMobile ? null : /*#__PURE__*/_jsx(IconButton, {
|
134
135
|
disabled: loading,
|
135
136
|
onClick: () => startRecording(),
|
136
137
|
children: /*#__PURE__*/_jsx(ChatMicIcon, {})
|
@@ -40,11 +40,9 @@ const scrollToAIInput = editor => {
|
|
40
40
|
}, 200);
|
41
41
|
};
|
42
42
|
const insertText = (editor, text, options) => {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
Transforms.insertFragment(editor, fragment, options);
|
47
|
-
}
|
43
|
+
const parsed = new DOMParser().parseFromString(text, "text/html");
|
44
|
+
const fragment = deserialize(parsed.body);
|
45
|
+
Transforms.insertFragment(editor, fragment, options);
|
48
46
|
};
|
49
47
|
const insertAtNextLine = (editor, text) => {
|
50
48
|
const nextLine = getNextLine(editor);
|
@@ -201,95 +199,81 @@ function PopoverAIInput({
|
|
201
199
|
useEffect(() => {
|
202
200
|
selectedEleRef.current = selectedElement;
|
203
201
|
}, [selectedElement]);
|
204
|
-
const
|
205
|
-
|
202
|
+
const onSend = async (type, option) => {
|
203
|
+
if (type === "close") {
|
204
|
+
onClickOutside();
|
205
|
+
return;
|
206
|
+
}
|
207
|
+
if (type === "done") {
|
208
|
+
// Get the current selection point
|
209
|
+
const {
|
210
|
+
anchor
|
211
|
+
} = editor.selection;
|
212
|
+
const {
|
213
|
+
path
|
214
|
+
} = anchor;
|
215
|
+
const {
|
216
|
+
text: selectText
|
217
|
+
} = Node.get(editor, path);
|
218
|
+
if (selectText?.length) {
|
219
|
+
insertAtNextLine(editor, generatedText);
|
220
|
+
} else {
|
221
|
+
insertText(editor, generatedText);
|
222
|
+
}
|
223
|
+
onClickOutside();
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
if (type === "replace_selection") {
|
227
|
+
// replace generated text
|
228
|
+
insertText(editor, generatedText);
|
229
|
+
onClickOutside();
|
230
|
+
return;
|
231
|
+
}
|
232
|
+
if (type === "speech_to_text") {
|
233
|
+
setGeneratedText(option.text);
|
234
|
+
return;
|
235
|
+
}
|
236
|
+
if (type === "try_again") {
|
237
|
+
// resetting the previous option and try again
|
238
|
+
option = selectedOption;
|
239
|
+
type = selectedOption.value;
|
240
|
+
} else {
|
241
|
+
setSelectedOption(option);
|
242
|
+
}
|
243
|
+
setLoading(true);
|
244
|
+
const payload = {
|
206
245
|
mode: option.mode || 0,
|
207
246
|
query: option?.inputValue || inputValue
|
208
247
|
};
|
209
248
|
if (option.mode === MODES.translate || option.mode === MODES.rephraseTone) {
|
210
249
|
payload.textOptionInput = type;
|
211
250
|
}
|
212
|
-
const selectedText = getSelectedText(editor);
|
213
|
-
const textData = generatedText || selectedText;
|
214
251
|
if (option.mode) {
|
215
|
-
payload.textData =
|
216
|
-
} else if (selectedText && Number(payload.mode) === 0) {
|
217
|
-
payload.query = `${selectedText} \n ${payload.query}`;
|
252
|
+
payload.textData = generatedText || window.getSelection().toString();
|
218
253
|
}
|
219
|
-
const
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
254
|
+
const result = await services("infinityAI", payload);
|
255
|
+
setLoading(false);
|
256
|
+
setInputValue("");
|
257
|
+
let {
|
258
|
+
data: text
|
259
|
+
} = result || {};
|
260
|
+
if (!text) {
|
261
|
+
onClickOutside();
|
262
|
+
return;
|
224
263
|
}
|
225
|
-
|
226
|
-
};
|
227
|
-
const onSend = async (type, option) => {
|
228
|
-
try {
|
229
|
-
if (type === "close") {
|
230
|
-
onClickOutside();
|
231
|
-
return;
|
232
|
-
}
|
233
|
-
if (type === "done") {
|
234
|
-
// Get the current selection point
|
235
|
-
const {
|
236
|
-
anchor
|
237
|
-
} = editor.selection;
|
238
|
-
const {
|
239
|
-
path
|
240
|
-
} = anchor;
|
241
|
-
const {
|
242
|
-
text: selectText
|
243
|
-
} = Node.get(editor, path);
|
244
|
-
if (selectText?.length) {
|
245
|
-
insertAtNextLine(editor, generatedText);
|
246
|
-
} else {
|
247
|
-
insertText(editor, generatedText);
|
248
|
-
}
|
249
|
-
onClickOutside();
|
250
|
-
return;
|
251
|
-
}
|
252
|
-
if (type === "replace_selection") {
|
253
|
-
// replace generated text
|
254
|
-
insertText(editor, generatedText);
|
255
|
-
onClickOutside();
|
256
|
-
return;
|
257
|
-
}
|
258
|
-
setLoading(true);
|
259
|
-
const payload = framePayload(type, option);
|
260
|
-
setSelectedOption({
|
261
|
-
...option,
|
262
|
-
payload
|
263
|
-
});
|
264
|
-
const result = await services("infinityAI", payload);
|
265
|
-
setLoading(false);
|
266
|
-
setInputValue("");
|
267
|
-
let {
|
268
|
-
data: text
|
269
|
-
} = result || {};
|
270
|
-
if (!text) {
|
271
|
-
onClickOutside();
|
272
|
-
return;
|
273
|
-
}
|
274
|
-
|
275
|
-
// if (!option.replace) {
|
264
|
+
if (!option.replace) {
|
276
265
|
if (type === "continue_writing") {
|
277
266
|
setGeneratedText(generatedText + text);
|
278
267
|
} else {
|
279
268
|
setGeneratedText(text);
|
280
269
|
}
|
281
|
-
|
282
|
-
// return;
|
283
|
-
// }
|
284
|
-
|
285
|
-
// ** we are not using this insertText right now, AI returned response will not insert into the editor immediately, so option.replace will be false always
|
286
|
-
// insertText(editor, text);
|
287
|
-
|
288
|
-
// scrollToAIInput();
|
289
|
-
} catch (err) {
|
290
|
-
console.error("Error on sending/inserting text", err);
|
270
|
+
return;
|
291
271
|
}
|
272
|
+
insertText(editor, text);
|
273
|
+
|
274
|
+
// scrollToAIInput();
|
292
275
|
};
|
276
|
+
|
293
277
|
const onInputChange = e => {
|
294
278
|
setInputValue(e.target.value);
|
295
279
|
};
|
@@ -13,7 +13,6 @@ import PopperHeader from "../PopperHeader";
|
|
13
13
|
import MiniColorPicker from "./MiniColorPicker";
|
14
14
|
import SelectAlignment from "./SelectAlignment";
|
15
15
|
import SelectFontSize from "./SelectFontSize";
|
16
|
-
import InfinityAITool from "./InfinityAITool";
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
18
|
const DEFAULT_COLOR = {
|
@@ -27,8 +26,7 @@ const MiniTextFormat = props => {
|
|
27
26
|
const {
|
28
27
|
classes,
|
29
28
|
editor,
|
30
|
-
closeMainPopup
|
31
|
-
customProps
|
29
|
+
closeMainPopup
|
32
30
|
} = props;
|
33
31
|
const [anchorEl, setAnchorEl] = useState(null);
|
34
32
|
const open = Boolean(anchorEl);
|
@@ -50,7 +48,7 @@ const MiniTextFormat = props => {
|
|
50
48
|
xs: 12,
|
51
49
|
children: /*#__PURE__*/_jsxs("div", {
|
52
50
|
className: "toolWrapper",
|
53
|
-
children: [
|
51
|
+
children: [/*#__PURE__*/_jsx(SelectTypography, {
|
54
52
|
classes: classes,
|
55
53
|
editor: editor,
|
56
54
|
closeMainPopup: closeMainPopup
|
@@ -111,8 +111,8 @@ const PopupTool = props => {
|
|
111
111
|
open: open,
|
112
112
|
anchorEl: anchorEl,
|
113
113
|
transition: true,
|
114
|
+
placement: "auto-end",
|
114
115
|
sx: classes.popupWrapper,
|
115
|
-
placement: "top-start",
|
116
116
|
children: ({
|
117
117
|
TransitionProps
|
118
118
|
}) => /*#__PURE__*/_jsx(Fade, {
|
@@ -123,8 +123,8 @@ export function onDropItem(props, parentClass) {
|
|
123
123
|
dragOver,
|
124
124
|
parentPath,
|
125
125
|
path,
|
126
|
-
|
127
|
-
|
126
|
+
diffX,
|
127
|
+
x: cx,
|
128
128
|
breakpoint
|
129
129
|
// calX,
|
130
130
|
} = props;
|
@@ -134,9 +134,7 @@ export function onDropItem(props, parentClass) {
|
|
134
134
|
let newPath = [];
|
135
135
|
newPath = moveTo;
|
136
136
|
const cCalx = isContainerElement(editor, moveTo, props);
|
137
|
-
|
138
|
-
// cx - window.innerWidth / 2 + MARGIN_OF[breakpoint] - diffX
|
139
|
-
// );
|
137
|
+
const posX = parseInt(cx - window.innerWidth / 2 + MARGIN_OF[breakpoint] - diffX);
|
140
138
|
const toSectionNode = Node.get(editor, newPath);
|
141
139
|
const addToSectionDOM = ReactEditor.toDOMNode(editor, toSectionNode);
|
142
140
|
const rect = addToSectionDOM.getBoundingClientRect();
|
@@ -2140,7 +2140,37 @@ export const InfinityIcon = () => /*#__PURE__*/_jsxs("svg", {
|
|
2140
2140
|
viewBox: "0 0 22 14",
|
2141
2141
|
fill: "none",
|
2142
2142
|
xmlns: "http://www.w3.org/2000/svg",
|
2143
|
-
children: [/*#__PURE__*/
|
2143
|
+
children: [/*#__PURE__*/_jsx("path", {
|
2144
|
+
d: "M0.915756 6.95902C1.12067 5.41363 1.86206 4.92055 2.20714 4.86719C2.08975 5.03795 1.83787 5.44564 1.76957 5.71032C1.68419 6.04118 1.63082 6.95902 2.20714 7.8662C2.78347 8.77337 3.81871 9.29633 4.81127 9.60583C5.60531 9.85344 6.3588 9.80861 6.63628 9.75525C6.89243 9.76592 6.67063 10.0044 5.73978 10.3422C4.71521 10.7158 3.59459 10.8118 2.66607 10.2889C1.73755 9.76592 0.659613 8.89077 0.915756 6.95902Z",
|
2145
|
+
fill: "url(#paint0_linear_3_7)"
|
2146
|
+
}), /*#__PURE__*/_jsx("path", {
|
2147
|
+
d: "M0.915756 6.95902C1.12067 5.41363 1.86206 4.92055 2.20714 4.86719C2.08975 5.03795 1.83787 5.44564 1.76957 5.71032C1.68419 6.04118 1.63082 6.95902 2.20714 7.86619C2.46246 8.26809 2.80785 8.59457 3.1997 8.8605C3.37046 8.9548 3.4345 9.01884 3.4345 9.01884C3.16768 9.0722 2.75145 9.13624 2.20714 9.01884C1.66284 8.90144 1.13988 8.59193 0.930734 8.12234C0.868272 7.78378 0.857446 7.39878 0.915756 6.95902Z",
|
2148
|
+
fill: "url(#paint1_linear_3_7)"
|
2149
|
+
}), /*#__PURE__*/_jsx("path", {
|
2150
|
+
d: "M2.15304 9.10612C1.64075 8.44442 1.13537 7.33708 1.77573 5.71484C1.63699 6.18444 1.83445 7.07297 2.01589 7.52122C2.19732 7.96947 2.89531 8.8014 4.05821 9.35159C5.05076 9.82119 6.23709 9.82119 6.79562 9.7785C6.50746 9.91368 5.69208 10.1862 4.73581 10.1947C3.54047 10.2054 2.74003 9.69312 2.15304 9.10612Z",
|
2151
|
+
fill: "url(#paint2_linear_3_7)"
|
2152
|
+
}), /*#__PURE__*/_jsx("path", {
|
2153
|
+
d: "M16.4362 12.7797C18.4637 12.4072 19.9581 11.4316 21.144 9.00646C20.8404 9.27254 20.1806 9.908 19.6785 10.2241C19.0509 10.6192 17.887 11.0693 17.4547 11.5271C16.6737 12.2487 15.4362 12.6472 14.9104 12.7027C14.3846 12.7582 14.6598 13.0473 16.4362 12.7797Z",
|
2154
|
+
fill: "url(#paint3_linear_3_7)"
|
2155
|
+
}), /*#__PURE__*/_jsx("path", {
|
2156
|
+
d: "M2.48878 3.38168C0.992124 4.16676 0.598877 5.99203 0.70329 7.17193C0.807704 8.35183 1.11378 8.54174 1.05295 8.43731C0.854563 7.0486 1.11051 5.49084 2.22774 5.08363C3.34498 4.67641 4.43089 5.58482 5.38106 6.50366C6.33123 7.42251 8.16893 9.05138 8.87895 9.7614C9.58897 10.4714 12.3107 12.7602 14.3781 12.8751C16.2993 12.9818 17.3539 11.9667 18.151 10.9726C18.6301 10.3751 19.0072 8.91564 18.8192 9.09315C18.6313 9.27065 18.1196 9.75096 17.159 10.012C16.1984 10.273 14.9454 10.1477 13.8595 9.81361C12.7736 9.47948 11.364 8.50842 10.4765 7.69399C9.58897 6.87956 7.43803 4.71818 6.44609 3.97684C5.45415 3.2355 3.92934 2.62603 2.48878 3.38168Z",
|
2157
|
+
fill: "url(#paint4_linear_3_7)"
|
2158
|
+
}), /*#__PURE__*/_jsx("path", {
|
2159
|
+
d: "M6.45603 3.95461C5.46409 3.21327 3.91876 2.5659 2.49872 3.35945C1.47193 3.95461 1.20045 4.64584 1.35708 4.46834C1.5137 4.29083 2.63093 2.78726 4.46863 3.7792C6.30632 4.77114 8.20667 7.35018 9.72068 8.77022C11.2347 10.1903 12.2754 11.0256 13.8695 11.4954C15.4635 11.9653 17.4927 11.6583 18.1609 10.9504C18.6401 10.3528 19.0171 8.89341 18.8292 9.07092C18.6412 9.24842 18.1296 9.72873 17.169 9.98976C16.2083 10.2508 14.9554 10.1255 13.8695 9.79138C12.7836 9.45725 11.374 8.48619 10.4864 7.67176C9.59891 6.85733 7.44797 4.69595 6.45603 3.95461Z",
|
2160
|
+
fill: "url(#paint5_linear_3_7)"
|
2161
|
+
}), /*#__PURE__*/_jsx("path", {
|
2162
|
+
d: "M17.9698 11.1279C17.8237 11.2845 19.0573 10.8051 20.2477 9.87581C20.6099 9.593 20.7786 9.48856 21.0188 9.21708C21.2432 8.96331 21.699 7.3072 21.699 6.5241C21.6573 4.937 21.2393 3.94621 21.1456 3.74576C21.0187 3.47416 20.977 3.35945 21.0188 4.16344C21.0605 4.96743 20.9561 6.05334 20.5071 6.99307C19.9328 7.9328 19.5778 8.18338 18.9618 8.83075C18.826 8.97693 18.8783 9.24843 18.7634 9.593C18.6381 10.0002 18.116 10.9712 17.9698 11.1279Z",
|
2163
|
+
fill: "url(#paint6_linear_3_7)"
|
2164
|
+
}), /*#__PURE__*/_jsx("path", {
|
2165
|
+
d: "M3.44581 9.00993C3.27874 9.06005 3.70684 9.34419 4.91804 9.72008C5.40879 9.82449 6.45294 10.1167 6.92281 9.78272C7.58062 9.47317 9.08419 8.04944 9.72112 7.40207C10.2571 6.89044 11.5713 5.72935 12.5403 5.17804C13.7515 4.48891 15.5579 3.68491 16.9362 4.1339C18.3144 4.58288 18.8574 6.31616 18.8783 7.04706C18.8992 7.77797 18.8783 8.7177 18.8783 8.95785C18.8748 9.0205 18.943 9.05809 19.2437 8.70725C19.6196 8.26871 20.0686 8.04944 20.6429 6.71294C20.8622 6.16302 21.227 4.63509 21.0814 3.78933C20.9556 3.05843 20.6528 2.67209 20.079 2.02472C19.5052 1.37735 18.2309 0.448066 16.696 0.437625C15.1611 0.427183 13.9603 1.07455 13.3025 1.3878C12.1957 1.89943 10.3894 3.26726 9.41832 4.23831C8.43682 5.13628 7.44488 6.13866 6.82884 6.75471C6.336 7.24754 5.60022 7.96243 5.29394 8.25827C4.67789 8.73858 3.68596 8.93789 3.44581 9.00993Z",
|
2166
|
+
fill: "url(#paint7_linear_3_7)"
|
2167
|
+
}), /*#__PURE__*/_jsx("path", {
|
2168
|
+
d: "M6.93299 9.79053C6.50698 9.991 5.41897 9.8323 4.92822 9.72788C5.11809 9.65819 5.74215 9.30791 6.71947 8.46434C7.94112 7.40988 9.69528 5.78076 11.2719 4.78895C13.1618 3.62995 14.9672 3.09756 16.9463 4.1417C15.5681 3.69272 13.7617 4.49671 12.5505 5.18585C11.5815 5.73715 10.2673 6.89824 9.7313 7.40988C9.09437 8.05724 7.5908 9.48097 6.93299 9.79053Z",
|
2169
|
+
fill: "url(#paint8_linear_3_7)"
|
2170
|
+
}), /*#__PURE__*/_jsx("path", {
|
2171
|
+
d: "M19.2123 2.0471C18.3519 1.23685 16.682 1.20831 15.9546 1.29532L20.4235 4.72012C20.4235 4.72012 20.2878 3.05993 19.2123 2.0471Z",
|
2172
|
+
fill: "url(#paint9_linear_3_7)"
|
2173
|
+
}), /*#__PURE__*/_jsxs("defs", {
|
2144
2174
|
children: [/*#__PURE__*/_jsxs("linearGradient", {
|
2145
2175
|
id: "paint0_linear_3_7",
|
2146
2176
|
x1: "5.86156",
|
@@ -2280,36 +2310,6 @@ export const InfinityIcon = () => /*#__PURE__*/_jsxs("svg", {
|
|
2280
2310
|
stopOpacity: "0"
|
2281
2311
|
})]
|
2282
2312
|
})]
|
2283
|
-
}), /*#__PURE__*/_jsx("path", {
|
2284
|
-
d: "M0.915756 6.95902C1.12067 5.41363 1.86206 4.92055 2.20714 4.86719C2.08975 5.03795 1.83787 5.44564 1.76957 5.71032C1.68419 6.04118 1.63082 6.95902 2.20714 7.8662C2.78347 8.77337 3.81871 9.29633 4.81127 9.60583C5.60531 9.85344 6.3588 9.80861 6.63628 9.75525C6.89243 9.76592 6.67063 10.0044 5.73978 10.3422C4.71521 10.7158 3.59459 10.8118 2.66607 10.2889C1.73755 9.76592 0.659613 8.89077 0.915756 6.95902Z",
|
2285
|
-
fill: "url(#paint0_linear_3_7)"
|
2286
|
-
}), /*#__PURE__*/_jsx("path", {
|
2287
|
-
d: "M0.915756 6.95902C1.12067 5.41363 1.86206 4.92055 2.20714 4.86719C2.08975 5.03795 1.83787 5.44564 1.76957 5.71032C1.68419 6.04118 1.63082 6.95902 2.20714 7.86619C2.46246 8.26809 2.80785 8.59457 3.1997 8.8605C3.37046 8.9548 3.4345 9.01884 3.4345 9.01884C3.16768 9.0722 2.75145 9.13624 2.20714 9.01884C1.66284 8.90144 1.13988 8.59193 0.930734 8.12234C0.868272 7.78378 0.857446 7.39878 0.915756 6.95902Z",
|
2288
|
-
fill: "url(#paint1_linear_3_7)"
|
2289
|
-
}), /*#__PURE__*/_jsx("path", {
|
2290
|
-
d: "M2.15304 9.10612C1.64075 8.44442 1.13537 7.33708 1.77573 5.71484C1.63699 6.18444 1.83445 7.07297 2.01589 7.52122C2.19732 7.96947 2.89531 8.8014 4.05821 9.35159C5.05076 9.82119 6.23709 9.82119 6.79562 9.7785C6.50746 9.91368 5.69208 10.1862 4.73581 10.1947C3.54047 10.2054 2.74003 9.69312 2.15304 9.10612Z",
|
2291
|
-
fill: "url(#paint2_linear_3_7)"
|
2292
|
-
}), /*#__PURE__*/_jsx("path", {
|
2293
|
-
d: "M16.4362 12.7797C18.4637 12.4072 19.9581 11.4316 21.144 9.00646C20.8404 9.27254 20.1806 9.908 19.6785 10.2241C19.0509 10.6192 17.887 11.0693 17.4547 11.5271C16.6737 12.2487 15.4362 12.6472 14.9104 12.7027C14.3846 12.7582 14.6598 13.0473 16.4362 12.7797Z",
|
2294
|
-
fill: "url(#paint3_linear_3_7)"
|
2295
|
-
}), /*#__PURE__*/_jsx("path", {
|
2296
|
-
d: "M2.48878 3.38168C0.992124 4.16676 0.598877 5.99203 0.70329 7.17193C0.807704 8.35183 1.11378 8.54174 1.05295 8.43731C0.854563 7.0486 1.11051 5.49084 2.22774 5.08363C3.34498 4.67641 4.43089 5.58482 5.38106 6.50366C6.33123 7.42251 8.16893 9.05138 8.87895 9.7614C9.58897 10.4714 12.3107 12.7602 14.3781 12.8751C16.2993 12.9818 17.3539 11.9667 18.151 10.9726C18.6301 10.3751 19.0072 8.91564 18.8192 9.09315C18.6313 9.27065 18.1196 9.75096 17.159 10.012C16.1984 10.273 14.9454 10.1477 13.8595 9.81361C12.7736 9.47948 11.364 8.50842 10.4765 7.69399C9.58897 6.87956 7.43803 4.71818 6.44609 3.97684C5.45415 3.2355 3.92934 2.62603 2.48878 3.38168Z",
|
2297
|
-
fill: "url(#paint4_linear_3_7)"
|
2298
|
-
}), /*#__PURE__*/_jsx("path", {
|
2299
|
-
d: "M6.45603 3.95461C5.46409 3.21327 3.91876 2.5659 2.49872 3.35945C1.47193 3.95461 1.20045 4.64584 1.35708 4.46834C1.5137 4.29083 2.63093 2.78726 4.46863 3.7792C6.30632 4.77114 8.20667 7.35018 9.72068 8.77022C11.2347 10.1903 12.2754 11.0256 13.8695 11.4954C15.4635 11.9653 17.4927 11.6583 18.1609 10.9504C18.6401 10.3528 19.0171 8.89341 18.8292 9.07092C18.6412 9.24842 18.1296 9.72873 17.169 9.98976C16.2083 10.2508 14.9554 10.1255 13.8695 9.79138C12.7836 9.45725 11.374 8.48619 10.4864 7.67176C9.59891 6.85733 7.44797 4.69595 6.45603 3.95461Z",
|
2300
|
-
fill: "url(#paint5_linear_3_7)"
|
2301
|
-
}), /*#__PURE__*/_jsx("path", {
|
2302
|
-
d: "M17.9698 11.1279C17.8237 11.2845 19.0573 10.8051 20.2477 9.87581C20.6099 9.593 20.7786 9.48856 21.0188 9.21708C21.2432 8.96331 21.699 7.3072 21.699 6.5241C21.6573 4.937 21.2393 3.94621 21.1456 3.74576C21.0187 3.47416 20.977 3.35945 21.0188 4.16344C21.0605 4.96743 20.9561 6.05334 20.5071 6.99307C19.9328 7.9328 19.5778 8.18338 18.9618 8.83075C18.826 8.97693 18.8783 9.24843 18.7634 9.593C18.6381 10.0002 18.116 10.9712 17.9698 11.1279Z",
|
2303
|
-
fill: "url(#paint6_linear_3_7)"
|
2304
|
-
}), /*#__PURE__*/_jsx("path", {
|
2305
|
-
d: "M3.44581 9.00993C3.27874 9.06005 3.70684 9.34419 4.91804 9.72008C5.40879 9.82449 6.45294 10.1167 6.92281 9.78272C7.58062 9.47317 9.08419 8.04944 9.72112 7.40207C10.2571 6.89044 11.5713 5.72935 12.5403 5.17804C13.7515 4.48891 15.5579 3.68491 16.9362 4.1339C18.3144 4.58288 18.8574 6.31616 18.8783 7.04706C18.8992 7.77797 18.8783 8.7177 18.8783 8.95785C18.8748 9.0205 18.943 9.05809 19.2437 8.70725C19.6196 8.26871 20.0686 8.04944 20.6429 6.71294C20.8622 6.16302 21.227 4.63509 21.0814 3.78933C20.9556 3.05843 20.6528 2.67209 20.079 2.02472C19.5052 1.37735 18.2309 0.448066 16.696 0.437625C15.1611 0.427183 13.9603 1.07455 13.3025 1.3878C12.1957 1.89943 10.3894 3.26726 9.41832 4.23831C8.43682 5.13628 7.44488 6.13866 6.82884 6.75471C6.336 7.24754 5.60022 7.96243 5.29394 8.25827C4.67789 8.73858 3.68596 8.93789 3.44581 9.00993Z",
|
2306
|
-
fill: "url(#paint7_linear_3_7)"
|
2307
|
-
}), /*#__PURE__*/_jsx("path", {
|
2308
|
-
d: "M6.93299 9.79053C6.50698 9.991 5.41897 9.8323 4.92822 9.72788C5.11809 9.65819 5.74215 9.30791 6.71947 8.46434C7.94112 7.40988 9.69528 5.78076 11.2719 4.78895C13.1618 3.62995 14.9672 3.09756 16.9463 4.1417C15.5681 3.69272 13.7617 4.49671 12.5505 5.18585C11.5815 5.73715 10.2673 6.89824 9.7313 7.40988C9.09437 8.05724 7.5908 9.48097 6.93299 9.79053Z",
|
2309
|
-
fill: "url(#paint8_linear_3_7)"
|
2310
|
-
}), /*#__PURE__*/_jsx("path", {
|
2311
|
-
d: "M19.2123 2.0471C18.3519 1.23685 16.682 1.20831 15.9546 1.29532L20.4235 4.72012C20.4235 4.72012 20.2878 3.05993 19.2123 2.0471Z",
|
2312
|
-
fill: "url(#paint9_linear_3_7)"
|
2313
2313
|
})]
|
2314
2314
|
});
|
2315
2315
|
export const ResetIcon = () => /*#__PURE__*/_jsxs("svg", {
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import highlightSelection from "./highlightSelection";
|
2
1
|
import link from "./link";
|
3
|
-
const decorators =
|
4
|
-
return [...link(d
|
2
|
+
const decorators = d => {
|
3
|
+
return [...link(d)];
|
5
4
|
};
|
6
5
|
export default decorators;
|
@@ -242,15 +242,6 @@ export const getMarked = (leaf, children, theme) => {
|
|
242
242
|
})
|
243
243
|
});
|
244
244
|
}
|
245
|
-
if (leaf.highlight) {
|
246
|
-
children = /*#__PURE__*/_jsx("span", {
|
247
|
-
style: {
|
248
|
-
background: "#EAEBFE",
|
249
|
-
color: "inherit"
|
250
|
-
},
|
251
|
-
children: children
|
252
|
-
});
|
253
|
-
}
|
254
245
|
if (leaf.decoration === "link") {
|
255
246
|
children = /*#__PURE__*/_jsx("a", {
|
256
247
|
style: {
|
package/package.json
CHANGED
@@ -1,16 +0,0 @@
|
|
1
|
-
import { Editor, Range, Text } from "slate";
|
2
|
-
const highlightSelection = ([node, path], editor = {}) => {
|
3
|
-
if (Text.isText(node) && editor?.selection) {
|
4
|
-
const intersection = Range.intersection(editor.selection, Editor.range(editor, path));
|
5
|
-
if (intersection == null) {
|
6
|
-
return [];
|
7
|
-
}
|
8
|
-
const range = {
|
9
|
-
highlight: true,
|
10
|
-
...intersection
|
11
|
-
};
|
12
|
-
return [range];
|
13
|
-
}
|
14
|
-
return [];
|
15
|
-
};
|
16
|
-
export default highlightSelection;
|