| 1 |
// Single source of truth for "does Quick Edit have an editor for this |
| 2 |
// blockType?" — hover-bar uses it to gate the Quick Edit pill, and |
| 3 |
// keyboard-entry uses it to skip opening an editor for blocks that |
| 4 |
// only get Ask AI. InlineEditor still owns the actual handler routing; |
| 5 |
// if a type is in this set but InlineEditor has no branch, the user |
| 6 |
// sees UnsupportedNotice (self-healing safety net). |
| 7 |
// |
| 8 |
// Keep aligned with TEXT_STRATEGIES + PICKER_STRATEGIES + |
| 9 |
// MODAL_BLOCK_TYPES in components/InlineEditor.jsx. |
| 10 |
export const QUICK_EDIT_BLOCK_TYPES = new Set([ |
| 11 |
'core/paragraph', |
| 12 |
'core/heading', |
| 13 |
'core/button', |
| 14 |
'core/image', |
| 15 |
'core/cover', |
| 16 |
'core/media-text:image', |
| 17 |
'product:image', |
| 18 |
'core/site-title', |
| 19 |
'core/site-tagline', |
| 20 |
'core/site-logo', |
| 21 |
'core/social-link', |
| 22 |
'core/navigation-link', |
| 23 |
'core/navigation-submenu', |
| 24 |
'product:name', |
| 25 |
'product:short_description', |
| 26 |
'product:description', |
| 27 |
'product:price', |
| 28 |
'wpforms:field', |
| 29 |
]); |
| 30 |
|
| 31 |
export const hasQuickEditModalFor = (blockType) => |
| 32 |
!!blockType && QUICK_EDIT_BLOCK_TYPES.has(blockType); |
| 33 |
|