PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 All 128 releases
← All changes | src/Agent/lib/delete-target.js +10 -0 3.2.0 → 3.2.2 View file →
@@ -9,8 +9,14 @@
9 9 'core/list',
10 10 'core/quote',
11 11 ]);
12 12
13 +// core/accordion-item locks these in place (templateLock 'all'), so the op takes the item.
14 +const LOCKED_PARTS = new Set([
15 + 'core/accordion-heading',
16 + 'core/accordion-panel',
17 +]);
18 +
13 19 // The wrapper never reaches the model (dropped from the manifest), so "delete this
14 20 // button" can only name the button — walk up to the wrapper when it's the last item.
15 21 export const resolveDeleteTarget = (blockId, scope = null) => {
16 22 const el = findBlockEl(blockId, document, scope);
@@ -16,8 +22,12 @@
16 22 const el = findBlockEl(blockId, document, scope);
17 23 if (!el) return blockId;
18 24 let targetId = blockId;
19 25 let parent = el.parentElement?.closest(BLOCK_ID_SEL);
26 + if (parent && LOCKED_PARTS.has(detectBlockType(el))) {
27 + targetId = blockIdOf(parent);
28 + parent = parent.parentElement?.closest(BLOCK_ID_SEL);
29 + }
20 30 while (
21 31 parent &&
22 32 LIST_WRAPPERS.has(detectBlockType(parent)) &&
23 33 parent.querySelectorAll(BLOCK_ID_SEL).length === 1