feat(blogeditor): enable corner drag-resize handles for inline and figure images

This commit is contained in:
Jakub Zych
2026-11-27 14:58:07 +01:00
parent ccd8dc85aa
commit 260a86b686
5 changed files with 178 additions and 35 deletions

View File

@@ -141,5 +141,34 @@ describe('Media Library picker (Phase 37, D-05)', () => {
expect(el.value).toContain('width="1200"')
expect(el.value).toContain('height="800"')
expect(changes.length).toBeGreaterThan(0)
expect(el.querySelectorAll('[data-resize-handle]').length).toBe(4)
})
it('renders corner resize handles on captioned figure images inserted from Media Library', () => {
const { el } = mount('<p>Intro</p>')
const picks: CustomEvent[] = []
el.addEventListener('summer-media-pick', (event) => picks.push(event as CustomEvent))
click(button(el, 'mediaLibrary'))
const { id } = picks[0]!.detail as { id: string }
el.dispatchEvent(
new CustomEvent('summer-media-pick-result', {
detail: {
id,
item: {
url: '/media/abc123456789/reishi.jpg',
alt: 'Reishi',
caption: 'Reishi mushroom',
width: 800,
height: 600,
},
},
}),
)
expect(el.value).toContain('<figure>')
expect(el.value).toContain('<figcaption>Reishi mushroom</figcaption>')
expect(el.querySelectorAll('figure [data-resize-handle]').length).toBe(4)
})
})