mirror of
https://github.com/nexu-io/openmotion.git
synced 2026-12-02 04:40:32 +08:00
* 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>
14 lines
493 B
JavaScript
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);
|
|
}
|