/** * remove-motion-timeline — ATOMIC delete of a motion timeline row and its * managed `"; function removeMotionStyleBlock(html: string): string { const openIdx = html.indexOf(MOTION_STYLE_OPEN); if (openIdx === -1) return html; const closeIdx = html.indexOf( MOTION_STYLE_CLOSE, openIdx + MOTION_STYLE_OPEN.length, ); if (closeIdx === -1) return html; // Also trim the optional newline that injectMotionStyle adds after the block. const end = closeIdx + MOTION_STYLE_CLOSE.length; const tail = html[end] === "\n" ? end + 1 : end; return html.slice(0, openIdx) + html.slice(tail); } // ─── Action ─────────────────────────────────────────────────────────────────── export default defineAction({ description: "Atomically delete a motion timeline row and remove the managed " + "