@blocklet/editor 1.6.203 → 1.6.205
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.
|
@@ -316,6 +316,12 @@ export default function ComponentPickerMenuPlugin() {
|
|
|
316
316
|
return mergeRegister(editor.registerCommand(INSERT_COMPONENT_COMMAND, (payload) => {
|
|
317
317
|
editor.update(() => {
|
|
318
318
|
const selection = $getSelection();
|
|
319
|
+
// if no selection, insert text node
|
|
320
|
+
if (!selection) {
|
|
321
|
+
const textNode = $createTextNode(payload);
|
|
322
|
+
$insertNodes([textNode]);
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
319
325
|
// @ts-ignore
|
|
320
326
|
const anchorNode = selection?.anchor?.getNode();
|
|
321
327
|
const oldText = anchorNode?.getTextContent();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/editor",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.205",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "npm run storybook",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@arcblock/ux": "^2.9.65",
|
|
41
41
|
"@blocklet/embed": "^0.1.11",
|
|
42
|
-
"@blocklet/pdf": "1.6.
|
|
42
|
+
"@blocklet/pdf": "1.6.205",
|
|
43
43
|
"@excalidraw/excalidraw": "^0.14.2",
|
|
44
44
|
"@iconify/iconify": "^3.0.1",
|
|
45
45
|
"@lexical/clipboard": "0.13.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"react": "*",
|
|
109
109
|
"react-dom": "*"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "4ed164b061529f0e3a17b919042ff05d2e73edc2"
|
|
112
112
|
}
|