Files
openmotion/packages/edit-core/reframe-canvas.js
open-design-crew[bot] 8ef74470c5 Keep Studio edits responsive through one ordered local working copy (#1041)
* Prepare versioned project edits locally and skip recursive preview mounts

* Preserve validation details on locally prepared composition drops

* Prepare Studio edits from one ordered local working copy

* Chain editable media references to their preceding Studio writes

---------

Co-authored-by: lefarcen <935902669@qq.com>
2026-11-25 10:24:21 +08:00

14 lines
493 B
JavaScript

import * as css from 'css-tree';
import { parseHTML } from 'linkedom';
import { canvasStyleRewriter, compositionCanvasSource } from './composition-canvas.ts';
const rewriteStyles = canvasStyleRewriter(css);
/**
* @param {string} html
* @param {{ ratio: import('./composition-canvas.ts').CanvasRatio, fit: import('./composition-canvas.ts').CanvasFit }} change
*/
export function reframeCanvas(html, change) {
return compositionCanvasSource(html, { parseHTML, rewriteStyles }, change);
}