mce 0.12.3 → 0.12.5
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/index.js +8 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -615,7 +615,7 @@ class Doc extends Model {
|
|
|
615
615
|
const first = nodeMap[0];
|
|
616
616
|
let parent;
|
|
617
617
|
let childrenIds;
|
|
618
|
-
if (parentId) {
|
|
618
|
+
if (parentId && parentId !== this.root.id) {
|
|
619
619
|
parent = this.nodeMap.get(parentId);
|
|
620
620
|
childrenIds = this._yChildren.get(parentId)?.get("childrenIds");
|
|
621
621
|
} else {
|
|
@@ -688,7 +688,7 @@ class Doc extends Model {
|
|
|
688
688
|
const fromIndex = childrenIds.toJSON().indexOf(id);
|
|
689
689
|
childrenIds.delete(fromIndex, 1);
|
|
690
690
|
childrenIds.insert(toIndex, [id]);
|
|
691
|
-
if (parent) {
|
|
691
|
+
if (parent && !parent.equal(this.root)) {
|
|
692
692
|
parent.moveChild(node, toIndex);
|
|
693
693
|
} else {
|
|
694
694
|
this.root.moveChild(node, toIndex);
|
|
@@ -2310,6 +2310,8 @@ const _4_2_element = defineMixin((editor) => {
|
|
|
2310
2310
|
break;
|
|
2311
2311
|
case "screenCenter":
|
|
2312
2312
|
globalPosition = camera.value.toGlobal(getScreenCenter());
|
|
2313
|
+
globalPosition.x -= aabb.width / 2;
|
|
2314
|
+
globalPosition.y -= aabb.height / 2;
|
|
2313
2315
|
break;
|
|
2314
2316
|
default: {
|
|
2315
2317
|
const _parentAabb = parentAabb ?? rootAabb.value;
|
|
@@ -2608,11 +2610,11 @@ const _4_4_doc = defineMixin((editor, options) => {
|
|
|
2608
2610
|
if (Array.isArray(source) && source.length === 1) {
|
|
2609
2611
|
_source = source[0];
|
|
2610
2612
|
}
|
|
2611
|
-
if (!Array.isArray(
|
|
2612
|
-
if (
|
|
2613
|
-
id =
|
|
2613
|
+
if (!Array.isArray(_source)) {
|
|
2614
|
+
if (_source.meta?.inEditorIs === "Doc") {
|
|
2615
|
+
id = _source.id;
|
|
2614
2616
|
} else {
|
|
2615
|
-
_source = [
|
|
2617
|
+
_source = [_source];
|
|
2616
2618
|
}
|
|
2617
2619
|
}
|
|
2618
2620
|
}
|