@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
package/dist/tmagic-editor.js
CHANGED
|
@@ -4987,7 +4987,15 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
4987
4987
|
"custom-error": _ctx.customError,
|
|
4988
4988
|
onEdit: unref(editCode),
|
|
4989
4989
|
onRemove: unref(deleteCode)
|
|
4990
|
-
},
|
|
4990
|
+
}, {
|
|
4991
|
+
"code-block-panel-tool": withCtx(({ id, data }) => [
|
|
4992
|
+
renderSlot(_ctx.$slots, "code-block-panel-tool", {
|
|
4993
|
+
id,
|
|
4994
|
+
data
|
|
4995
|
+
})
|
|
4996
|
+
]),
|
|
4997
|
+
_: 3
|
|
4998
|
+
}, 8, ["custom-error", "onEdit", "onRemove"]),
|
|
4991
4999
|
unref(codeConfig) ? (openBlock(), createBlock(_sfc_main$G, {
|
|
4992
5000
|
key: 0,
|
|
4993
5001
|
ref_key: "codeBlockEditor",
|
|
@@ -5835,7 +5843,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
5835
5843
|
return;
|
|
5836
5844
|
const { data: node } = e;
|
|
5837
5845
|
const parent = editorService?.getParentById(node.id, false);
|
|
5838
|
-
const layout = await editorService?.getLayout(parent);
|
|
5846
|
+
const layout = await editorService?.getLayout(parent, node);
|
|
5839
5847
|
node.style.position = layout;
|
|
5840
5848
|
if (layout === Layout.RELATIVE) {
|
|
5841
5849
|
node.style.top = 0;
|
|
@@ -7777,12 +7785,14 @@ class Watcher extends EventEmitter {
|
|
|
7777
7785
|
* @param nodes 需要清除依赖的节点
|
|
7778
7786
|
*/
|
|
7779
7787
|
clear(nodes) {
|
|
7788
|
+
const clearedItemsNodeIds = [];
|
|
7780
7789
|
Object.values(this.targets).forEach((targets) => {
|
|
7781
7790
|
Object.values(targets).forEach((target) => {
|
|
7782
7791
|
if (nodes) {
|
|
7783
7792
|
nodes.forEach((node) => {
|
|
7784
7793
|
target.removeDep(node);
|
|
7785
|
-
if (Array.isArray(node.items)) {
|
|
7794
|
+
if (Array.isArray(node.items) && node.items.length && !clearedItemsNodeIds.includes(node.id)) {
|
|
7795
|
+
clearedItemsNodeIds.push(node.id);
|
|
7786
7796
|
this.clear(node.items);
|
|
7787
7797
|
}
|
|
7788
7798
|
});
|