mirror of
https://github.com/nexu-io/openmotion.git
synced 2026-12-01 23:59:50 +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>
13 lines
718 B
TypeScript
13 lines
718 B
TypeScript
import { createRequire } from 'node:module';
|
|
import path from 'node:path';
|
|
import { canvasStyleRewriter } from '../packages/edit-core/composition-canvas.ts';
|
|
import { loadCaptionSourceOperations } from './transcript-captions.ts';
|
|
|
|
/** Bind both parsers from the installed authoring runtime, including when opened from a ZIP. */
|
|
export async function loadCanvasSourceOperations(runtimeRoot: string) {
|
|
const { parseHTML } = await loadCaptionSourceOperations(runtimeRoot);
|
|
const require = createRequire(path.join(runtimeRoot, 'package.json'));
|
|
const nativeRequire = createRequire(require.resolve('hyperframes/package.json'));
|
|
return { parseHTML, rewriteStyles: canvasStyleRewriter(nativeRequire('css-tree')) };
|
|
}
|