PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
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 0.6.0 All 127 releases
extendify / src / Agent / lib / classify-block-edit.js

classify-block-edit.js in Extendify 3.1.5, at src/Agent/lib/classify-block-edit.js

17 lines 719 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { buildSubtreeManifest } from './subtree-manifest';
2
3 // Wrapper/child units edited as one so both schemas ship; grow over time.
4 const COMBO_BLOCKS = new Set(['core/buttons', 'core/button']);
5
6 // Temporary ignore logos until we add template support
7 export const IGNORED_BLOCKS = new Set(['core/site-logo']);
8
9 // single/combo pin the selection's schema; multi ships the subtree's or narrows.
10 export const classifyBlockEdit = ({ block, root }) => {
11 if (!block?.blockType || IGNORED_BLOCKS.has(block.blockType))
12 return { bucket: 'multi' };
13 if (COMBO_BLOCKS.has(block.blockType)) return { bucket: 'combo' };
14 if (buildSubtreeManifest(root).length > 1) return { bucket: 'multi' };
15 return { bucket: 'single' };
16 };
17