@flozy/editor 3.2.0 → 3.2.1
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.
- package/dist/Editor/Elements/Embed/Image.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +0 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +1 -1
- package/dist/Editor/common/Shorthands/elements.js +2 -0
- package/dist/Editor/hooks/useDragDom.js +10 -8
- package/dist/Editor/utils/SlateUtilityFunctions.js +17 -13
- package/dist/Editor/utils/helper.js +1 -1
- package/package.json +1 -1
|
@@ -183,7 +183,7 @@ const Image = ({
|
|
|
183
183
|
opacity: frame ? 0 : 1,
|
|
184
184
|
cursor: webAddress ? "pointer" : "",
|
|
185
185
|
border: `1px solid ${borderColor}`,
|
|
186
|
-
borderWidth: borderWidth
|
|
186
|
+
borderWidth: `${borderWidth}`?.includes('px') ? borderWidth : `${borderWidth}px`
|
|
187
187
|
},
|
|
188
188
|
alt: alt,
|
|
189
189
|
src: url,
|
|
@@ -540,7 +540,7 @@ const usePopupStyle = theme => ({
|
|
|
540
540
|
lineHeight: "1.75 !important",
|
|
541
541
|
fontWeight: 400,
|
|
542
542
|
background: theme?.palette?.editor?.background,
|
|
543
|
-
"
|
|
543
|
+
"&:hover": {
|
|
544
544
|
background: `${theme?.palette?.action?.selected} !important`
|
|
545
545
|
},
|
|
546
546
|
"&.selected": {
|
|
@@ -10,6 +10,7 @@ import { TableUtil } from "../../utils/table";
|
|
|
10
10
|
import Icon from "../Icon";
|
|
11
11
|
import EmojiButton from "../../Elements/Emoji/EmojiButton";
|
|
12
12
|
import { insertDivider } from "../../utils/divider";
|
|
13
|
+
import { Transforms } from "slate";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
const ELEMENTS_LIST = [{
|
|
15
16
|
name: "Heading 1",
|
|
@@ -175,6 +176,7 @@ const ELEMENTS_LIST = [{
|
|
|
175
176
|
icon: "accordion"
|
|
176
177
|
}),
|
|
177
178
|
onInsert: editor => {
|
|
179
|
+
Transforms.delete(editor, editor.selection); // remove text '/accordion' typed by user
|
|
178
180
|
insertAccordion(editor);
|
|
179
181
|
}
|
|
180
182
|
}, {
|
|
@@ -20,7 +20,7 @@ const useDragDom = props => {
|
|
|
20
20
|
removeListener();
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
}, [refDom]);
|
|
23
|
+
}, [refDom, event]);
|
|
24
24
|
const onMouseDown = e => {
|
|
25
25
|
ePos.x = e.x;
|
|
26
26
|
ePos.y = e.y;
|
|
@@ -39,16 +39,18 @@ const useDragDom = props => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
const onMouseUp = e => {
|
|
42
|
-
setEvent("end");
|
|
43
|
-
ePos.x = 0;
|
|
44
|
-
ePos.y = 0;
|
|
45
42
|
if (event === "start") {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
setEvent("end");
|
|
44
|
+
ePos.x = 0;
|
|
45
|
+
ePos.y = 0;
|
|
46
|
+
|
|
47
|
+
// setDelta({
|
|
48
|
+
// x: e.x - ePos.x,
|
|
49
|
+
// y: e.y - ePos.y,
|
|
50
|
+
// });
|
|
50
51
|
}
|
|
51
52
|
};
|
|
53
|
+
|
|
52
54
|
const onClear = () => {
|
|
53
55
|
setDelta({
|
|
54
56
|
x: 0,
|
|
@@ -211,20 +211,24 @@ export const getMarked = (leaf, children) => {
|
|
|
211
211
|
} : {
|
|
212
212
|
color: leaf.color
|
|
213
213
|
};
|
|
214
|
-
children = /*#__PURE__*/_jsx(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
sx: {
|
|
218
|
-
fontSize: {
|
|
219
|
-
lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
|
220
|
-
...getBreakPointsValue(leaf.fontSize, null, "overrideText")
|
|
221
|
-
},
|
|
222
|
-
background: leaf.bgColor,
|
|
223
|
-
...textStyles,
|
|
224
|
-
fontFamily: family,
|
|
225
|
-
fontWeight: leaf.fontWeight
|
|
214
|
+
children = /*#__PURE__*/_jsx("span", {
|
|
215
|
+
style: {
|
|
216
|
+
background: leaf.bgColor
|
|
226
217
|
},
|
|
227
|
-
children:
|
|
218
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
219
|
+
className: className,
|
|
220
|
+
component: "span",
|
|
221
|
+
sx: {
|
|
222
|
+
fontSize: {
|
|
223
|
+
lg: sizeMap[leaf.fontSize] || leaf.fontSize,
|
|
224
|
+
...getBreakPointsValue(leaf.fontSize, null, "overrideText")
|
|
225
|
+
},
|
|
226
|
+
...textStyles,
|
|
227
|
+
fontFamily: family,
|
|
228
|
+
fontWeight: leaf.fontWeight
|
|
229
|
+
},
|
|
230
|
+
children: children
|
|
231
|
+
})
|
|
228
232
|
});
|
|
229
233
|
}
|
|
230
234
|
if (leaf.decoration === "link") {
|
|
@@ -235,7 +235,7 @@ export const handleLinkType = (url, linkType, readOnly, openInNewTab, onClick =
|
|
|
235
235
|
props.component = "a";
|
|
236
236
|
const [page, section] = url.split("#");
|
|
237
237
|
const sec = section ? `#${section}` : "";
|
|
238
|
-
props.href = page === "home" ? sec : `/${url}`;
|
|
238
|
+
props.href = page === "home" ? `/${sec}` : `/${url}`;
|
|
239
239
|
if (openInNewTab) {
|
|
240
240
|
props.target = "_blank";
|
|
241
241
|
}
|