@tmagic/editor 1.3.0-alpha.14 → 1.3.0-alpha.16
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/tmagic-editor.js +13 -3
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +13 -3
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +12 -12
- package/src/layouts/sidebar/LayerPanel.vue +1 -1
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +5 -6
- package/src/services/dep.ts +4 -2
- package/src/services/editor.ts +1 -1
- package/types/layouts/sidebar/code-block/CodeBlockListPanel.vue.d.ts +4 -0
- package/types/services/editor.d.ts +1 -1
|
@@ -4996,7 +4996,15 @@
|
|
|
4996
4996
|
"custom-error": _ctx.customError,
|
|
4997
4997
|
onEdit: vue.unref(editCode),
|
|
4998
4998
|
onRemove: vue.unref(deleteCode)
|
|
4999
|
-
},
|
|
4999
|
+
}, {
|
|
5000
|
+
"code-block-panel-tool": vue.withCtx(({ id, data }) => [
|
|
5001
|
+
vue.renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
5002
|
+
id,
|
|
5003
|
+
data
|
|
5004
|
+
})
|
|
5005
|
+
]),
|
|
5006
|
+
_: 3
|
|
5007
|
+
}, 8, ["custom-error", "onEdit", "onRemove"]),
|
|
5000
5008
|
vue.unref(codeConfig) ? (vue.openBlock(), vue.createBlock(_sfc_main$G, {
|
|
5001
5009
|
key: 0,
|
|
5002
5010
|
ref_key: "codeBlockEditor",
|
|
@@ -5844,7 +5852,7 @@
|
|
|
5844
5852
|
return;
|
|
5845
5853
|
const { data: node } = e;
|
|
5846
5854
|
const parent = editorService?.getParentById(node.id, false);
|
|
5847
|
-
const layout = await editorService?.getLayout(parent);
|
|
5855
|
+
const layout = await editorService?.getLayout(parent, node);
|
|
5848
5856
|
node.style.position = layout;
|
|
5849
5857
|
if (layout === Layout.RELATIVE) {
|
|
5850
5858
|
node.style.top = 0;
|
|
@@ -7786,12 +7794,14 @@
|
|
|
7786
7794
|
* @param nodes 需要清除依赖的节点
|
|
7787
7795
|
*/
|
|
7788
7796
|
clear(nodes) {
|
|
7797
|
+
const clearedItemsNodeIds = [];
|
|
7789
7798
|
Object.values(this.targets).forEach((targets) => {
|
|
7790
7799
|
Object.values(targets).forEach((target) => {
|
|
7791
7800
|
if (nodes) {
|
|
7792
7801
|
nodes.forEach((node) => {
|
|
7793
7802
|
target.removeDep(node);
|
|
7794
|
-
if (Array.isArray(node.items)) {
|
|
7803
|
+
if (Array.isArray(node.items) && node.items.length && !clearedItemsNodeIds.includes(node.id)) {
|
|
7804
|
+
clearedItemsNodeIds.push(node.id);
|
|
7795
7805
|
this.clear(node.items);
|
|
7796
7806
|
}
|
|
7797
7807
|
});
|