lakelib 0.4.1 → 0.4.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.
- package/dist/lake.min.js +22 -22
- package/dist/lake.min.js.map +1 -1
- package/lib/lake.d.ts +1 -1
- package/lib/lake.js +13 -3
- package/lib/lake.js.map +1 -1
- package/package.json +29 -29
package/lib/lake.d.ts
CHANGED
|
@@ -2264,4 +2264,4 @@ declare class Dropdown {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
|
|
2266
2266
|
export { Box, Button, Dropdown, Editor, Fragment, HTMLParser, Nodes, Range$1 as Range, TextParser, Toolbar, addMark, createIframeBox, deleteContents, getBox, getContentRules, icons, insertBlock, insertBookmark, insertBox, insertContents, query, removeBox, removeMark, setBlocks, splitBlock, splitMarks, template, toBookmark, toHex };
|
|
2267
|
-
export type { ActiveItem, BoxComponent, BoxValue, CommandItem, ContentRules, DropdownItem, DropdownMenuItem, InitializePlugin, KeyValue, MentionItem, NodePath, SelectionState, SlashButtonItem, SlashItem, SlashUploadItem, ToolbarButtonItem, ToolbarDropdownItem, ToolbarItem, ToolbarUploadItem, UnmountPlugin };
|
|
2267
|
+
export type { ActiveItem, BoxComponent, BoxValue, CommandItem, ContentRules, DropdownItem, DropdownMenuItem, EditorConfig, InitializePlugin, KeyValue, MentionItem, NodePath, SelectionState, SlashButtonItem, SlashItem, SlashUploadItem, ToolbarButtonItem, ToolbarConfig, ToolbarDropdownItem, ToolbarItem, ToolbarUploadItem, UnmountPlugin };
|
package/lib/lake.js
CHANGED
|
@@ -6611,7 +6611,7 @@ function removeBox(range) {
|
|
|
6611
6611
|
return box;
|
|
6612
6612
|
}
|
|
6613
6613
|
|
|
6614
|
-
var version = "0.4.
|
|
6614
|
+
var version = "0.4.2";
|
|
6615
6615
|
|
|
6616
6616
|
// Converts the custom HTML tags to the special tags that can not be parsed by browser.
|
|
6617
6617
|
function denormalizeValue(value) {
|
|
@@ -8345,11 +8345,21 @@ class Editor {
|
|
|
8345
8345
|
}
|
|
8346
8346
|
else if (children.length === 1) {
|
|
8347
8347
|
const child = children[0];
|
|
8348
|
-
if (child.isVoid) {
|
|
8348
|
+
if (child.isVoid || child.isText) {
|
|
8349
|
+
const startNode = range.startNode;
|
|
8350
|
+
const startOffset = range.startOffset;
|
|
8351
|
+
const endNode = range.endNode;
|
|
8352
|
+
const endOffset = range.endOffset;
|
|
8349
8353
|
const paragraph = query('<p />');
|
|
8350
8354
|
child.before(paragraph);
|
|
8351
8355
|
paragraph.append(child);
|
|
8352
|
-
|
|
8356
|
+
if (startNode.isText || endNode.isText) {
|
|
8357
|
+
range.setStart(startNode, startOffset);
|
|
8358
|
+
range.setEnd(endNode, endOffset);
|
|
8359
|
+
}
|
|
8360
|
+
else {
|
|
8361
|
+
range.shrinkAfter(paragraph);
|
|
8362
|
+
}
|
|
8353
8363
|
changed = true;
|
|
8354
8364
|
debug(`Content fixed: void element "${child.name}" was wrapped in paragraph`);
|
|
8355
8365
|
}
|