@flozy/editor 6.0.1 → 6.0.2
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.
@@ -30,16 +30,14 @@ const ToolTableComponent = props => {
|
|
30
30
|
const {
|
31
31
|
updateTableSelection
|
32
32
|
} = useTable();
|
33
|
-
return /*#__PURE__*/_jsx(
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
updateTableSelection(getDefaultTableSelection());
|
40
|
-
}
|
33
|
+
return /*#__PURE__*/_jsx(TableTool, {
|
34
|
+
theme: editorTheme,
|
35
|
+
handleToolAction: (type, option) => {
|
36
|
+
handleAction(type, option);
|
37
|
+
if (type === "duplicate") {
|
38
|
+
updateTableSelection(getDefaultTableSelection());
|
41
39
|
}
|
42
|
-
}
|
40
|
+
}
|
43
41
|
});
|
44
42
|
};
|
45
43
|
const MoreTableSettings = props => {
|
@@ -74,9 +72,11 @@ const MoreTableSettings = props => {
|
|
74
72
|
placement: "bottom-start",
|
75
73
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
76
74
|
onClickAway: () => setExpandTools(false),
|
77
|
-
children: /*#__PURE__*/_jsx(
|
78
|
-
|
79
|
-
|
75
|
+
children: /*#__PURE__*/_jsx("div", {
|
76
|
+
children: /*#__PURE__*/_jsx(ToolTableComponent, {
|
77
|
+
handleAction: handleAction,
|
78
|
+
editorTheme: editorTheme
|
79
|
+
})
|
80
80
|
})
|
81
81
|
})
|
82
82
|
});
|
@@ -151,15 +151,10 @@ function SelectTypography({
|
|
151
151
|
toggleBlock(editor, format);
|
152
152
|
if (option.type === "block") {
|
153
153
|
// reset old font size
|
154
|
-
let updatedValue = !selectedBlock ? {} : {
|
155
|
-
xs: "16px",
|
156
|
-
sm: "16px",
|
157
|
-
md: "16px",
|
158
|
-
lg: "16px"
|
159
|
-
};
|
154
|
+
// let updatedValue = !selectedBlock ? {} : { xs: "16px", sm: "16px", md: "16px", lg: "16px" }
|
160
155
|
addMarkData(editor, {
|
161
156
|
format: "fontSize",
|
162
|
-
value:
|
157
|
+
value: {}
|
163
158
|
});
|
164
159
|
} else if (option.type === "mark") {
|
165
160
|
const size = sizeMap[option.value] || "";
|
@@ -253,7 +253,13 @@ const withHtml = editor => {
|
|
253
253
|
return;
|
254
254
|
}
|
255
255
|
const fragment = deserialize(parsed.body);
|
256
|
-
const
|
256
|
+
const normalizeFragment = formatFragment[eltype];
|
257
|
+
if (normalizeFragment && isNonText) {
|
258
|
+
// When a non-text node is pasted into a list item, insert it into the next node.
|
259
|
+
insertAtNextNode(editor, fragment);
|
260
|
+
return;
|
261
|
+
}
|
262
|
+
const formattedFragment = normalizeFragment ? normalizeFragment(fragment) : fragment;
|
257
263
|
let is_img_table = false;
|
258
264
|
formattedFragment.map(f => {
|
259
265
|
if (f.type === "image" || f?.type?.includes("table")) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@flozy/editor",
|
3
|
-
"version": "6.0.
|
3
|
+
"version": "6.0.2",
|
4
4
|
"description": "An Editor for flozy app brain",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -61,7 +61,7 @@
|
|
61
61
|
"scripts": {
|
62
62
|
"prepare": "husky install .husky",
|
63
63
|
"analyze": "source-map-explorer build/static/js/*.js",
|
64
|
-
"lint": "./node_modules/.bin/eslint --ignore-path .gitignore .",
|
64
|
+
"lint": "./node_modules/. bin/eslint --ignore-path .gitignore .",
|
65
65
|
"start": "craco start",
|
66
66
|
"build": "NODE_OPTIONS='--max_old_space_size=4096' craco build",
|
67
67
|
"test": "craco test --passWithNoTests",
|