frameyard 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +177 -14
- package/GLOSSARY.md +112 -2
- package/README.md +302 -265
- package/dist/assets/integrations.d.ts +8 -4
- package/dist/assets/integrations.d.ts.map +1 -1
- package/dist/assets/integrations.js +8 -4
- package/dist/assets/integrations.js.map +1 -1
- package/dist/assets/provenance.d.ts +2 -2
- package/dist/assets/provenance.d.ts.map +1 -1
- package/dist/assets/provenance.js +5 -3
- package/dist/assets/provenance.js.map +1 -1
- package/dist/assets/tts-supertonic.d.ts +28 -0
- package/dist/assets/tts-supertonic.d.ts.map +1 -0
- package/dist/assets/tts-supertonic.js +156 -0
- package/dist/assets/tts-supertonic.js.map +1 -0
- package/dist/assets/tts.d.ts +18 -6
- package/dist/assets/tts.d.ts.map +1 -1
- package/dist/assets/tts.js +219 -97
- package/dist/assets/tts.js.map +1 -1
- package/dist/cli.js +1685 -93
- package/dist/cli.js.map +1 -1
- package/dist/composition/format.d.ts +1 -1
- package/dist/composition/format.d.ts.map +1 -1
- package/dist/composition/format.js +1 -1
- package/dist/composition/format.js.map +1 -1
- package/dist/context.d.ts +82 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +277 -0
- package/dist/context.js.map +1 -0
- package/dist/contracts.d.ts +25 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/doctor.d.ts +14 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +166 -7
- package/dist/doctor.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/fonts/add.d.ts +41 -0
- package/dist/fonts/add.d.ts.map +1 -0
- package/dist/fonts/add.js +259 -0
- package/dist/fonts/add.js.map +1 -0
- package/dist/fonts/binary.d.ts +4 -0
- package/dist/fonts/binary.d.ts.map +1 -0
- package/dist/fonts/binary.js +21 -0
- package/dist/fonts/binary.js.map +1 -0
- package/dist/fonts/css.d.ts +4 -0
- package/dist/fonts/css.d.ts.map +1 -0
- package/dist/fonts/css.js +50 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/fontsource.d.ts +107 -0
- package/dist/fonts/fontsource.d.ts.map +1 -0
- package/dist/fonts/fontsource.js +565 -0
- package/dist/fonts/fontsource.js.map +1 -0
- package/dist/fonts/index.d.ts +11 -0
- package/dist/fonts/index.d.ts.map +1 -0
- package/dist/fonts/index.js +11 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/install.d.ts +24 -0
- package/dist/fonts/install.d.ts.map +1 -0
- package/dist/fonts/install.js +145 -0
- package/dist/fonts/install.js.map +1 -0
- package/dist/fonts/manifest.d.ts +21 -0
- package/dist/fonts/manifest.d.ts.map +1 -0
- package/dist/fonts/manifest.js +96 -0
- package/dist/fonts/manifest.js.map +1 -0
- package/dist/fonts/options.d.ts +9 -0
- package/dist/fonts/options.d.ts.map +1 -0
- package/dist/fonts/options.js +66 -0
- package/dist/fonts/options.js.map +1 -0
- package/dist/fonts/schema.d.ts +4 -0
- package/dist/fonts/schema.d.ts.map +1 -0
- package/dist/fonts/schema.js +316 -0
- package/dist/fonts/schema.js.map +1 -0
- package/dist/fonts/summary.d.ts +16 -0
- package/dist/fonts/summary.d.ts.map +1 -0
- package/dist/fonts/summary.js +22 -0
- package/dist/fonts/summary.js.map +1 -0
- package/dist/fonts/types.d.ts +56 -0
- package/dist/fonts/types.d.ts.map +1 -0
- package/dist/fonts/types.js +8 -0
- package/dist/fonts/types.js.map +1 -0
- package/dist/fonts/verify.d.ts +33 -0
- package/dist/fonts/verify.d.ts.map +1 -0
- package/dist/fonts/verify.js +200 -0
- package/dist/fonts/verify.js.map +1 -0
- package/dist/html/validate.d.ts.map +1 -1
- package/dist/html/validate.js +59 -0
- package/dist/html/validate.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +61 -0
- package/dist/inspect.d.ts.map +1 -0
- package/dist/inspect.js +325 -0
- package/dist/inspect.js.map +1 -0
- package/dist/lint.d.ts +63 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +265 -0
- package/dist/lint.js.map +1 -0
- package/dist/policy.d.ts +69 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +361 -0
- package/dist/policy.js.map +1 -0
- package/dist/preview/fonts/LICENSE-figtree.txt +93 -0
- package/dist/preview/fonts/LICENSE-space-mono.txt +93 -0
- package/dist/preview/fonts/README.md +23 -0
- package/dist/preview/fonts/figtree-latin-wght-normal.woff2 +0 -0
- package/dist/preview/fonts/space-mono-latin-400-normal.woff2 +0 -0
- package/dist/preview/fonts/space-mono-latin-700-normal.woff2 +0 -0
- package/dist/preview/main.js +5 -2
- package/dist/preview/main.js.map +1 -1
- package/dist/preview/timeline-data.d.ts +17 -69
- package/dist/preview/timeline-data.d.ts.map +1 -1
- package/dist/preview/timeline-host.d.ts.map +1 -1
- package/dist/preview/timeline-host.js +70 -45
- package/dist/preview/timeline-host.js.map +1 -1
- package/dist/preview/timeline-main.d.ts.map +1 -1
- package/dist/preview/timeline-main.js +88 -27
- package/dist/preview/timeline-main.js.map +1 -1
- package/dist/project.d.ts +10 -3
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +20 -17
- package/dist/project.js.map +1 -1
- package/dist/renderer/audio.d.ts +6 -0
- package/dist/renderer/audio.d.ts.map +1 -1
- package/dist/renderer/audio.js +3 -1
- package/dist/renderer/audio.js.map +1 -1
- package/dist/renderer/browser.d.ts.map +1 -1
- package/dist/renderer/browser.js +13 -0
- package/dist/renderer/browser.js.map +1 -1
- package/dist/renderer/concurrency.d.ts +6 -0
- package/dist/renderer/concurrency.d.ts.map +1 -0
- package/dist/renderer/concurrency.js +27 -0
- package/dist/renderer/concurrency.js.map +1 -0
- package/dist/renderer/ffmpeg.d.ts +104 -5
- package/dist/renderer/ffmpeg.d.ts.map +1 -1
- package/dist/renderer/ffmpeg.js +580 -67
- package/dist/renderer/ffmpeg.js.map +1 -1
- package/dist/renderer/index.js +1 -1
- package/dist/renderer/index.js.map +1 -1
- package/dist/renderer/keyframe-expressions.d.ts +39 -0
- package/dist/renderer/keyframe-expressions.d.ts.map +1 -0
- package/dist/renderer/keyframe-expressions.js +180 -0
- package/dist/renderer/keyframe-expressions.js.map +1 -0
- package/dist/renderer/session-pool.d.ts +28 -0
- package/dist/renderer/session-pool.d.ts.map +1 -0
- package/dist/renderer/session-pool.js +91 -0
- package/dist/renderer/session-pool.js.map +1 -0
- package/dist/renderer/timeline.d.ts +2 -0
- package/dist/renderer/timeline.d.ts.map +1 -1
- package/dist/renderer/timeline.js +600 -147
- package/dist/renderer/timeline.js.map +1 -1
- package/dist/renderer/timings.d.ts +13 -0
- package/dist/renderer/timings.d.ts.map +1 -0
- package/dist/renderer/timings.js +29 -0
- package/dist/renderer/timings.js.map +1 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/host.js +4 -0
- package/dist/runtime/host.js.map +1 -1
- package/dist/scaffold.d.ts +3 -0
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +48 -320
- package/dist/scaffold.js.map +1 -1
- package/dist/server/composition-html.d.ts +2 -0
- package/dist/server/composition-html.d.ts.map +1 -1
- package/dist/server/composition-html.js +7 -0
- package/dist/server/composition-html.js.map +1 -1
- package/dist/server/preview-html.d.ts.map +1 -1
- package/dist/server/preview-html.js +74 -188
- package/dist/server/preview-html.js.map +1 -1
- package/dist/server/preview-style.d.ts +11 -0
- package/dist/server/preview-style.d.ts.map +1 -0
- package/dist/server/preview-style.js +298 -0
- package/dist/server/preview-style.js.map +1 -0
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +31 -1
- package/dist/server/server.js.map +1 -1
- package/dist/server/timeline-preview-data.d.ts.map +1 -1
- package/dist/server/timeline-preview-data.js +12 -34
- package/dist/server/timeline-preview-data.js.map +1 -1
- package/dist/server/timeline-preview-html.d.ts.map +1 -1
- package/dist/server/timeline-preview-html.js +140 -148
- package/dist/server/timeline-preview-html.js.map +1 -1
- package/dist/templates.d.ts +16 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +186 -0
- package/dist/templates.js.map +1 -0
- package/dist/timeline/easing.d.ts +36 -0
- package/dist/timeline/easing.d.ts.map +1 -0
- package/dist/timeline/easing.js +225 -0
- package/dist/timeline/easing.js.map +1 -0
- package/dist/timeline/keyframes.d.ts +23 -0
- package/dist/timeline/keyframes.d.ts.map +1 -0
- package/dist/timeline/keyframes.js +95 -0
- package/dist/timeline/keyframes.js.map +1 -0
- package/dist/timeline/plan.d.ts +6 -12
- package/dist/timeline/plan.d.ts.map +1 -1
- package/dist/timeline/plan.js +17 -30
- package/dist/timeline/plan.js.map +1 -1
- package/dist/timeline/resolve.d.ts +12 -0
- package/dist/timeline/resolve.d.ts.map +1 -1
- package/dist/timeline/resolve.js +105 -9
- package/dist/timeline/resolve.js.map +1 -1
- package/dist/timeline/scene.d.ts +126 -0
- package/dist/timeline/scene.d.ts.map +1 -0
- package/dist/timeline/scene.js +109 -0
- package/dist/timeline/scene.js.map +1 -0
- package/dist/timeline/schema.d.ts +31 -0
- package/dist/timeline/schema.d.ts.map +1 -1
- package/dist/timeline/schema.js +240 -9
- package/dist/timeline/schema.js.map +1 -1
- package/dist/timeline/transitions.d.ts +21 -0
- package/dist/timeline/transitions.d.ts.map +1 -0
- package/dist/timeline/transitions.js +23 -0
- package/dist/timeline/transitions.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/adr/0007-make-html-documents-the-composition-unit.md +1 -1
- package/docs/adr/0010-make-timelines-the-render-unit.md +3 -2
- package/docs/adr/0012-render-timelines-with-segmented-lossless-clip-intermediates.md +1 -1
- package/docs/adr/0014-compose-timeline-clips-with-css-blend-modes.md +2 -1
- package/docs/adr/0015-inherit-composition-format-from-the-project.md +2 -2
- package/docs/adr/0016-author-compositions-as-html-fragments.md +1 -1
- package/docs/adr/0018-animate-timeline-clips-with-keyframes.md +35 -0
- package/docs/adr/0019-make-same-track-overlap-the-transition-window.md +36 -0
- package/docs/adr/0020-crossfade-audio-clips-on-audio-tracks.md +27 -0
- package/docs/adr/0021-project-timeline-scenes-once.md +32 -0
- package/docs/adr/0022-gate-heavy-operations-with-a-workspace-resource-policy.md +35 -0
- package/docs/adr/0023-pin-fonts-as-project-assets.md +98 -0
- package/docs/adr/0024-stream-composition-captures-and-skip-trivial-composites.md +86 -0
- package/docs/adr/0025-capture-timeline-layers-in-parallel-with-a-global-limit.md +67 -0
- package/docs/adr/0026-reuse-loaded-composition-sessions-across-segments.md +70 -0
- package/docs/adr/0027-encode-two-full-frame-layers-through-dual-pipes.md +76 -0
- package/docs/adr/0028-encode-full-frame-video-segments-directly.md +65 -0
- package/docs/migration-0.4.md +2 -2
- package/docs/preview-testing.md +27 -6
- package/docs/{v0.1-design.md → v0.x-design.md} +57 -32
- package/examples/blend/README.md +3 -3
- package/examples/demo/README.md +2 -2
- package/examples/intro/README.md +71 -0
- package/examples/intro/assets/fonts/figtree/LICENSE.txt +93 -0
- package/examples/intro/assets/fonts/figtree/figtree-latin-wght-normal.woff2 +0 -0
- package/examples/intro/assets/fonts/instrument-serif/LICENSE.txt +93 -0
- package/examples/intro/assets/fonts/instrument-serif/instrument-serif-latin-400-italic.woff2 +0 -0
- package/examples/intro/assets/fonts/space-mono/LICENSE.txt +93 -0
- package/examples/intro/assets/fonts/space-mono/space-mono-latin-400-normal.woff2 +0 -0
- package/examples/intro/assets/fonts/space-mono/space-mono-latin-700-normal.woff2 +0 -0
- package/examples/intro/assets/grain.png +0 -0
- package/examples/intro/assets/score.ogg +0 -0
- package/examples/intro/compositions/brand.html +412 -0
- package/examples/intro/compositions/chrome.controller.js +63 -0
- package/examples/intro/compositions/chrome.html +256 -0
- package/examples/intro/compositions/lattice.controller.js +148 -0
- package/examples/intro/compositions/lattice.html +308 -0
- package/examples/intro/compositions/opening.html +504 -0
- package/examples/intro/compositions/studio.html +930 -0
- package/examples/intro/compositions/theme.css +218 -0
- package/examples/intro/fy.config.js +13 -0
- package/examples/intro/fy.fonts.json +100 -0
- package/examples/intro/scripts/make-grain.mjs +79 -0
- package/examples/intro/scripts/make-score.mjs +702 -0
- package/examples/intro/timelines/intro.timeline.json +60 -0
- package/examples/keyframes/README.md +76 -0
- package/examples/keyframes/compositions/backdrop.html +60 -0
- package/examples/keyframes/compositions/card.html +99 -0
- package/examples/keyframes/fy.config.js +10 -0
- package/examples/keyframes/timelines/keyframes.timeline.json +60 -0
- package/examples/nested/README.md +112 -0
- package/examples/nested/assets/pulse.wav +0 -0
- package/examples/nested/compositions/backdrop.html +84 -0
- package/examples/nested/compositions/card.html +275 -0
- package/examples/nested/compositions/overlay.html +307 -0
- package/examples/nested/fy.config.js +13 -0
- package/examples/nested/scripts/make-pulse.sh +20 -0
- package/examples/nested/timelines/chapter-a.timeline.json +39 -0
- package/examples/nested/timelines/chapter-b.timeline.json +39 -0
- package/examples/nested/timelines/nested-reel.timeline.json +52 -0
- package/examples/static/README.md +2 -2
- package/examples/transitions/README.md +128 -0
- package/examples/transitions/assets/alpha.wav +0 -0
- package/examples/transitions/assets/beta.wav +0 -0
- package/examples/transitions/assets/gamma.wav +0 -0
- package/examples/transitions/compositions/alpha.html +56 -0
- package/examples/transitions/compositions/beta.html +56 -0
- package/examples/transitions/compositions/gamma.html +56 -0
- package/examples/transitions/fy.config.js +12 -0
- package/examples/transitions/timelines/audio-crossfade.timeline.json +44 -0
- package/examples/transitions/timelines/transitions.timeline.json +31 -0
- package/examples/video/README.md +4 -4
- package/examples/webgl/README.md +1 -1
- package/package.json +13 -6
- package/scaffolds/init/AGENTS.md +131 -0
- package/scaffolds/init/README.md +56 -0
- package/scaffolds/init/compositions/hello.html +79 -0
- package/scaffolds/init/fy.config.js +9 -0
- package/scaffolds/init/gitignore.template +1 -0
- package/scaffolds/init/package.json +11 -0
- package/scaffolds/init/props/hello.json +4 -0
- package/scaffolds/init/props/main.json +6 -0
- package/scaffolds/init/timelines/main.timeline.json +20 -0
- package/scaffolds/local-models/LOCAL-MODELS.md +77 -0
- package/scaffolds/local-models/fy.policy.json +5 -0
- package/scaffolds/local-models/opencode/opencode.jsonc +17 -0
- package/scaffolds/local-models/pi/APPEND_SYSTEM.md +21 -0
- package/scaffolds/local-models/pi/sandbox.json +15 -0
- package/scaffolds/local-models/pi/settings.json +15 -0
- package/skills/frameyard/README.md +1 -0
- package/skills/frameyard/SKILL.md +59 -61
- package/skills/frameyard/references/audio-assets.md +32 -3
- package/skills/frameyard/references/common-mistakes.md +53 -2
- package/skills/frameyard/references/deterministic-authoring.md +10 -3
- package/skills/frameyard/references/diagnostics.md +31 -1
- package/skills/frameyard/references/failure-recovery.md +32 -6
- package/skills/frameyard/references/fonts.md +132 -0
- package/skills/frameyard/references/json-results.md +119 -6
- package/skills/frameyard/references/quick-reference.md +222 -0
- package/skills/frameyard/references/timelines.md +97 -7
- /package/examples/blend/{video.config.js → fy.config.js} +0 -0
- /package/examples/demo/{video.config.js → fy.config.js} +0 -0
- /package/examples/static/{video.config.js → fy.config.js} +0 -0
- /package/examples/video/{video.config.js → fy.config.js} +0 -0
- /package/examples/webgl/{video.config.js → fy.config.js} +0 -0
package/dist/scaffold.js
CHANGED
|
@@ -1,311 +1,27 @@
|
|
|
1
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
1
4
|
import { VERSION } from "./version.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
top-level \`<fy-composition>\`; props, the controller, import maps, and styles
|
|
22
|
-
are top-level siblings. Do not add \`<!doctype>\`, \`<html>\`, \`<head>\`,
|
|
23
|
-
\`<body>\`, \`<title>\`, or \`<meta>\`.
|
|
24
|
-
|
|
25
|
-
\`\`\`html
|
|
26
|
-
<script type="application/json" data-fy="props">{ "title": "Hello" }</script>
|
|
27
|
-
<style>
|
|
28
|
-
html, body { margin: 0; width: 100%; height: 100%; }
|
|
29
|
-
</style>
|
|
30
|
-
<fy-composition width="1280" height="720" fps="30" duration-in-frames="150">
|
|
31
|
-
<h1 data-fy-text="title"></h1>
|
|
32
|
-
</fy-composition>
|
|
33
|
-
\`\`\`
|
|
34
|
-
|
|
35
|
-
## Timeline skeleton
|
|
36
|
-
|
|
37
|
-
\`timelines/main.timeline.json\` assembles clips in the project format:
|
|
38
|
-
|
|
39
|
-
\`\`\`json
|
|
40
|
-
{
|
|
41
|
-
"version": 1,
|
|
42
|
-
"tracks": [
|
|
43
|
-
{ "id": "v1", "kind": "video" },
|
|
44
|
-
{ "id": "a1", "kind": "audio" }
|
|
45
|
-
],
|
|
46
|
-
"clips": [
|
|
47
|
-
{
|
|
48
|
-
"id": "hello",
|
|
49
|
-
"track": "v1",
|
|
50
|
-
"source": { "kind": "composition", "id": "hello" },
|
|
51
|
-
"start": 0
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"id": "music",
|
|
55
|
-
"track": "a1",
|
|
56
|
-
"source": { "kind": "audio", "src": "assets/music.wav" },
|
|
57
|
-
"start": 0,
|
|
58
|
-
"duration": 150,
|
|
59
|
-
"audio": { "gain": 0.6 }
|
|
60
|
-
}
|
|
61
|
-
]
|
|
5
|
+
const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
|
+
const INIT_TEMPLATES = path.join(PACKAGE_ROOT, "scaffolds", "init");
|
|
7
|
+
const LOCAL_MODELS_TEMPLATES = path.join(PACKAGE_ROOT, "scaffolds", "local-models");
|
|
8
|
+
function readTemplates(directory) {
|
|
9
|
+
const files = {};
|
|
10
|
+
const visit = (current) => {
|
|
11
|
+
const entries = readdirSync(current, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name));
|
|
12
|
+
for (const entry of entries) {
|
|
13
|
+
const fullPath = path.join(current, entry.name);
|
|
14
|
+
if (entry.isDirectory()) {
|
|
15
|
+
visit(fullPath);
|
|
16
|
+
}
|
|
17
|
+
else if (entry.isFile()) {
|
|
18
|
+
files[path.relative(directory, fullPath).split(path.sep).join("/")] = readFileSync(fullPath, "utf8");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
visit(directory);
|
|
23
|
+
return files;
|
|
62
24
|
}
|
|
63
|
-
\`\`\`
|
|
64
|
-
|
|
65
|
-
- \`source.kind\` is \`composition\` (with \`id\`), \`timeline\` (with \`id\`), or \`video\`, \`image\`, \`audio\` (with a project-relative \`src\`).
|
|
66
|
-
- \`start\`, \`sourceIn\`, and \`duration\` use timeline frames. Omitted durations use the rest of the source; image clips require a duration.
|
|
67
|
-
- Composition clips may declare \`props\`; the same composition can appear multiple times with different props, trims, and transforms. A static composition clip needs an explicit \`duration\` and \`sourceIn: 0\`, and contributes no audio.
|
|
68
|
-
- Visual clips support static \`transform\` values: \`fit\` (\`contain\`, \`cover\`, \`stretch\`), \`width\`/\`height\` (an explicit box, both together), \`x\`, \`y\`, \`scale\`, \`rotation\`, and \`opacity\`. \`width\`/\`height\` are mutually exclusive with \`scale\`.
|
|
69
|
-
- Visual clips may declare a static \`blend\` mode from the separable CSS set (\`normal\`, \`multiply\`, \`screen\`, \`overlay\`, \`darken\`, \`lighten\`, \`color-dodge\`, \`color-burn\`, \`hard-light\`, \`soft-light\`, \`difference\`, \`exclusion\`); omitted means \`normal\`.
|
|
70
|
-
- Video and audio clips are muted with \`audio.muted\`; \`audio.gain\` is 0-1. Composition audio is included automatically.
|
|
71
|
-
- Tracks composite from bottom to top. Clips on the same track cannot overlap. No transitions or keyframes.
|
|
72
|
-
- Project \`format\` fixes width, height, and fps for every timeline and fills those values for compositions that omit them. Animated composition fps must match the project; different composition sizes are fitted by the clip. A static composition has no fps.
|
|
73
|
-
|
|
74
|
-
## Bindings
|
|
75
|
-
|
|
76
|
-
- \`data-fy-text="path"\` sets text content.
|
|
77
|
-
- \`data-fy-attr-src="path"\` (and other \`data-fy-attr-*\` names) sets an attribute.
|
|
78
|
-
- \`data-fy-class-active="path"\` toggles a class.
|
|
79
|
-
- \`data-fy-if="path"\` removes the element when the value is false.
|
|
80
|
-
- \`<template data-fy-repeat="items">\` clones its content for each item; use \`item\` and \`index\`, and style stagger with \`--fy-index\`.
|
|
81
|
-
- Paths are dot-separated (\`user.name\`, \`items.0.label\`). Missing paths warn and resolve to an empty value.
|
|
82
|
-
- Primitive top-level props are also available as \`--fy-prop-<name>\` CSS custom properties.
|
|
83
|
-
|
|
84
|
-
## Animation
|
|
85
|
-
|
|
86
|
-
- CSS \`@keyframes\` and Web Animations API animations are paused and seeked from the frame clock.
|
|
87
|
-
- \`data-fy-anim-start\`, \`data-fy-anim-duration\`, and \`data-fy-anim-easing\` schedule one animation per element in composition frames. The CSS \`animation\` shorthand supplies keyframes and fill mode.
|
|
88
|
-
- Frame-state variables are set on \`:root\`: \`--fy-frame\`, \`--fy-time\`, \`--fy-progress\`, \`--fy-fps\`, \`--fy-duration\`, and \`--fy-duration-frames\`.
|
|
89
|
-
- Use \`--fy-progress\` for progress bars and \`--fy-frame\`/\`--fy-time\` in \`calc()\` for simple computed motion.
|
|
90
|
-
- CSS transitions are not deterministic; do not use them.
|
|
91
|
-
|
|
92
|
-
## Static compositions
|
|
93
|
-
|
|
94
|
-
A composition that declares neither \`duration-in-frames\` nor \`fps\` is static.
|
|
95
|
-
It is captured once and renders to PNG. It may use images, CSS, SVG, and canvas,
|
|
96
|
-
but not \`data-fy-anim-*\`, \`<video>\`, \`<audio>\`, or \`<fy-transcript>\`. Its
|
|
97
|
-
controller runs \`mount()\` and \`validateProps()\`; \`update()\` is not called and
|
|
98
|
-
frame-state variables are not set. In a timeline, a static composition clip
|
|
99
|
-
needs an explicit \`duration\` and \`sourceIn: 0\`.
|
|
100
|
-
|
|
101
|
-
## Controller
|
|
102
|
-
|
|
103
|
-
Exactly one optional controller is allowed, inline or external, as a top-level
|
|
104
|
-
sibling of \`<fy-composition>\`:
|
|
105
|
-
|
|
106
|
-
\`\`\`html
|
|
107
|
-
<script type="text/fy-controller">
|
|
108
|
-
export default {
|
|
109
|
-
mount({ root, props }) {},
|
|
110
|
-
update({ frame, props, root }) {},
|
|
111
|
-
};
|
|
112
|
-
</script>
|
|
113
|
-
\`\`\`
|
|
114
|
-
|
|
115
|
-
\`\`\`html
|
|
116
|
-
<script type="text/fy-controller" src="./hello.controller.js"></script>
|
|
117
|
-
\`\`\`
|
|
118
|
-
|
|
119
|
-
- \`mount\` may be asynchronous; \`update\` and \`validateProps\` are synchronous and seek-safe; \`dispose\` releases resources.
|
|
120
|
-
- Use inline for small, single-use controllers; extract to an external module for Canvas 2D, WebGL, karaoke, reuse, tests, or a large controller.
|
|
121
|
-
- A controller may be validation-only and export just \`validateProps(props)\`.
|
|
122
|
-
- The controller is the only executable code. Other scripts and \`on*\` handlers are rejected.
|
|
123
|
-
- Controller-created DOM is not re-bound; declarative bindings apply once before \`mount\`.
|
|
124
|
-
|
|
125
|
-
## Determinism rules
|
|
126
|
-
|
|
127
|
-
- A composition frame may depend only on its integer \`frame\`, immutable \`props\`, and assets loaded before frame production. A timeline frame is derived from its active clips and the same composition rules.
|
|
128
|
-
- Never use \`Math.random()\`, \`Date.now()\`, \`performance.now()\`, timers, independent \`requestAnimationFrame()\` loops, CSS transitions, or state left from a previously visited frame as animation inputs.
|
|
129
|
-
- Use \`random("stable:key")\` from \`frameyard/runtime\` for randomness.
|
|
130
|
-
- Load remote data, fonts, and images before frame production. Network requests are blocked during capture; a \`fetch()\` from \`update()\` is a bug.
|
|
131
|
-
- Redraw Canvas 2D and WebGL from the current frame. Production pins software WebGL for reproducible pixels.
|
|
132
|
-
- Embedded video and audio use local project files and \`data-fy-start\` (frames), \`data-fy-trim\` (seconds), optional \`data-fy-duration\` (seconds), and \`data-fy-volume\` (0-1). Let the runtime seek video; do not call \`play()\`, \`pause()\`, or set \`currentTime\` in \`update()\`.
|
|
133
|
-
- Media and transcript \`src\` values resolve from the project root. The controller \`src\` and ordinary HTML asset URLs resolve relative to the composition URL.
|
|
134
|
-
|
|
135
|
-
## Audio and transcripts
|
|
136
|
-
|
|
137
|
-
- Composition audio clips are \`<audio>\` elements placed by composition frames and trimmed by seconds. Timeline audio clips use frames and are placed on audio tracks.
|
|
138
|
-
- Visual clips contribute their audio automatically unless muted; there are no linked A/V pairs. For a J/L cut, mute the video and add a separate audio clip with a different sourceIn.
|
|
139
|
-
- Frameyard does not time-stretch audio or change timeline duration to fit it.
|
|
140
|
-
- An unmuted embedded video contributes its audio track to the same mix; use \`muted\` or \`data-fy-audio="off"\` for a visual-only video.
|
|
141
|
-
- Declare required transcripts with \`<fy-transcript src="assets/voice.transcript.json" words></fy-transcript>\`.
|
|
142
|
-
- Produce speech with \`npx frameyard tts\` and transcripts with \`npx frameyard transcribe\`; never call \`qwen-tts\` or \`whisper-cli\` directly, and never run inference inside a controller.
|
|
143
|
-
- Do not overwrite or regenerate generated assets without explicit approval.
|
|
144
|
-
- \`words\` requires measured word timings; never interpolate segment timings.
|
|
145
|
-
- Commit \`frameyard.assets.json\` when present; do not edit hashes or manifest entries by hand.
|
|
146
|
-
|
|
147
|
-
## Agent workflow
|
|
148
|
-
|
|
149
|
-
1. Read \`video.config.js\`, the timeline document, the referenced composition HTML, the optional controller, and the props files before changing behavior.
|
|
150
|
-
2. Author compositions with native HTML, CSS, SVG, Canvas 2D, WebGL, embedded video, and an optional controller. Arrange composition and media clips in the timeline JSON. Do not add a bundling step.
|
|
151
|
-
3. Validate every animated frame (or a static composition's single state): \`npx frameyard check main --json\`. Static validation runs before Chromium and reports stable diagnostic codes with source locations. Use \`--props <file>\` for composition props or a timeline clip override map.
|
|
152
|
-
4. Inspect representative frames: \`npx frameyard still main --frame <spec> --out <dir|file.png> --json\`, where \`<spec>\` is a frame number, an inclusive range like \`2-12\`, or a comma-separated list with at most 32 unique frames. With multiple frames, \`--out\` is a directory. Then view the PNGs when the host supports images. State explicitly when visual inspection is not possible.
|
|
153
|
-
5. Render: \`npx frameyard render main --props props/main.json [--workers <n>] [--scratch <dir>] --json\`. The video is written to \`out/main.mp4\` unless \`--out\` is passed.
|
|
154
|
-
6. Report the timeline, composition sources, props, validation result, diagnostics, still paths and inspection status, video path, and any failure. Never claim success when \`check\` fails, a still is missing, or a render exits nonzero.
|
|
155
|
-
|
|
156
|
-
## Commands
|
|
157
|
-
|
|
158
|
-
\`\`\`sh
|
|
159
|
-
npx frameyard dev
|
|
160
|
-
npx frameyard doctor --json
|
|
161
|
-
npx frameyard check main --json
|
|
162
|
-
npx frameyard still main --frame 42 --out main-42.png --json
|
|
163
|
-
npx frameyard still main --frame 0,118-126 --out out/stills --json
|
|
164
|
-
npx frameyard render main --props props/main.json --workers 8 --scratch /path/to/scratch --json
|
|
165
|
-
npx frameyard check hello --json
|
|
166
|
-
npx frameyard render hello --props props/hello.json --json
|
|
167
|
-
\`\`\`
|
|
168
|
-
|
|
169
|
-
- Use \`--json\` for non-interactive commands. Parse stdout as the structured result; treat stderr as progress and diagnostics.
|
|
170
|
-
- Use \`--project <dir>\` when running outside the project root.
|
|
171
|
-
- \`render\` writes to \`out/<id>.mp4\` for video and \`out/<id>.png\` for a static composition unless \`--out\` is passed. \`out/\` is gitignored.
|
|
172
|
-
- Use \`--concurrency <n>\` for animated composition renders (1-16). Use \`--workers <n>\` for timeline renders (1-16); the default is 8. Timeline renders also accept \`--scratch <dir>\` for FFV1 intermediates. \`--container <mp4|mov|mkv|webm>\`, \`--codec <h264|hevc|vp9>\`, and \`--encoder <auto|software|nvenc|qsv>\` select the delivery pair and encoder; the defaults are MP4 with H.264 and \`auto\`, which falls back to software. A static composition render rejects the container, codec, encoder, and concurrency options.
|
|
173
|
-
- \`still\` and \`render\` replace existing outputs only with \`--overwrite\`. Generated assets are replaced only with \`--force\`, and only with user approval.
|
|
174
|
-
|
|
175
|
-
The official \`frameyard\` agent skill contains the full host-neutral contract. Install it with \`npx skills add vladiantio/frameyard\` or see the \`skills/frameyard/\` directory in the \`frameyard\` npm package. This file is the project-local summary.
|
|
176
|
-
|
|
177
|
-
This project was scaffolded with frameyard ${VERSION}. \`npx frameyard\` resolves the latest published version; run \`npx frameyard@${VERSION}\` when you need the CLI version that scaffolded the project.
|
|
178
|
-
`;
|
|
179
|
-
const PROJECT_README = `# My Frameyard project
|
|
180
|
-
|
|
181
|
-
Coding agents should read \`AGENTS.md\` for the project rules and the check, still, and render workflow.
|
|
182
|
-
|
|
183
|
-
The reusable composition is a partial HTML fragment at \`compositions/hello.html\`. The edit is \`timelines/main.timeline.json\`, which places that composition as a clip in the project format. The project format is fixed in \`video.config.js\`.
|
|
184
|
-
|
|
185
|
-
Start the preview:
|
|
186
|
-
|
|
187
|
-
\`\`\`sh
|
|
188
|
-
npx frameyard dev
|
|
189
|
-
\`\`\`
|
|
190
|
-
|
|
191
|
-
The preview lists the timeline next to the compositions. Open the timeline to scrub it and inspect the program monitor.
|
|
192
|
-
|
|
193
|
-
Validate and render the timeline:
|
|
194
|
-
|
|
195
|
-
\`\`\`sh
|
|
196
|
-
npx frameyard doctor
|
|
197
|
-
npx frameyard check main
|
|
198
|
-
npx frameyard render main --props props/main.json
|
|
199
|
-
\`\`\`
|
|
200
|
-
|
|
201
|
-
\`props/main.json\` maps composition clip IDs to props overrides. The video is written to \`out/main.mp4\` in the project. Pass \`--out <file.mp4>\` to choose another path. Timelines with heavy composition work accept \`--workers <n>\` and \`--scratch <dir>\`.
|
|
202
|
-
|
|
203
|
-
The composition can still be previewed and rendered on its own:
|
|
204
|
-
|
|
205
|
-
\`\`\`sh
|
|
206
|
-
npx frameyard check hello
|
|
207
|
-
npx frameyard render hello --props props/hello.json
|
|
208
|
-
\`\`\`
|
|
209
|
-
|
|
210
|
-
Or run the pinned scripts from \`package.json\`:
|
|
211
|
-
|
|
212
|
-
\`\`\`sh
|
|
213
|
-
npm run dev
|
|
214
|
-
npm run check -- main
|
|
215
|
-
npm run render -- main --props props/main.json
|
|
216
|
-
npm run still -- main --frame 42 --out main-42.png
|
|
217
|
-
\`\`\`
|
|
218
|
-
`;
|
|
219
|
-
const SCAFFOLD_TEMPLATES = {
|
|
220
|
-
".gitignore": "out/\n",
|
|
221
|
-
"video.config.js": `export default {\n format: { width: 1280, height: 720, fps: 30 },\n compositions: {\n hello: "./compositions/hello.html",\n },\n timelines: {\n main: "./timelines/main.timeline.json",\n },\n};\n`,
|
|
222
|
-
"props/hello.json": `${JSON.stringify({ title: "Hello, Frameyard", accent: "#b8f36b" }, null, 2)}\n`,
|
|
223
|
-
"props/main.json": `${JSON.stringify({ hello: { title: "Hello, Frameyard", accent: "#b8f36b" } }, null, 2)}\n`,
|
|
224
|
-
"timelines/main.timeline.json": `${JSON.stringify({
|
|
225
|
-
version: 1,
|
|
226
|
-
tracks: [{ id: "v1", kind: "video" }],
|
|
227
|
-
clips: [
|
|
228
|
-
{
|
|
229
|
-
id: "hello",
|
|
230
|
-
track: "v1",
|
|
231
|
-
source: { kind: "composition", id: "hello" },
|
|
232
|
-
start: 0,
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
}, null, 2)}\n`,
|
|
236
|
-
"AGENTS.md": AGENTS_GUIDE,
|
|
237
|
-
"README.md": PROJECT_README,
|
|
238
|
-
"compositions/hello.html": `<script type="application/json" data-fy="props">
|
|
239
|
-
{ "title": "Hello, Frameyard", "accent": "#b8f36b" }
|
|
240
|
-
</script>
|
|
241
|
-
<style>
|
|
242
|
-
@keyframes fade-up {
|
|
243
|
-
from { opacity: 0; transform: translateY(28px); }
|
|
244
|
-
to { opacity: 1; transform: translateY(0); }
|
|
245
|
-
}
|
|
246
|
-
@keyframes drift {
|
|
247
|
-
from { transform: translate(-120px, -80px); }
|
|
248
|
-
to { transform: translate(120px, 80px); }
|
|
249
|
-
}
|
|
250
|
-
#hello {
|
|
251
|
-
position: relative;
|
|
252
|
-
width: 100%;
|
|
253
|
-
height: 100%;
|
|
254
|
-
display: grid;
|
|
255
|
-
place-items: center;
|
|
256
|
-
overflow: hidden;
|
|
257
|
-
background: #0b0d10;
|
|
258
|
-
color: #e8edf3;
|
|
259
|
-
font-family: Inter, system-ui, sans-serif;
|
|
260
|
-
}
|
|
261
|
-
#hello h1 {
|
|
262
|
-
position: relative;
|
|
263
|
-
margin: 0;
|
|
264
|
-
font-size: 96px;
|
|
265
|
-
letter-spacing: -0.04em;
|
|
266
|
-
opacity: 0;
|
|
267
|
-
animation: fade-up 1s cubic-bezier(0.215, 0.61, 0.355, 1) both;
|
|
268
|
-
}
|
|
269
|
-
#hello p {
|
|
270
|
-
position: relative;
|
|
271
|
-
margin: 18px 0 0;
|
|
272
|
-
color: #8a97a6;
|
|
273
|
-
font-size: 26px;
|
|
274
|
-
}
|
|
275
|
-
#glow {
|
|
276
|
-
position: absolute;
|
|
277
|
-
left: 50%;
|
|
278
|
-
top: 50%;
|
|
279
|
-
width: 520px;
|
|
280
|
-
height: 520px;
|
|
281
|
-
margin: -260px 0 0 -260px;
|
|
282
|
-
border-radius: 50%;
|
|
283
|
-
background: var(--fy-prop-accent);
|
|
284
|
-
filter: blur(120px);
|
|
285
|
-
opacity: 0.16;
|
|
286
|
-
animation: drift 12s ease-in-out infinite alternate;
|
|
287
|
-
}
|
|
288
|
-
#sweep {
|
|
289
|
-
position: absolute;
|
|
290
|
-
left: 0;
|
|
291
|
-
bottom: 0;
|
|
292
|
-
width: calc(var(--fy-progress) * 100%);
|
|
293
|
-
height: 4px;
|
|
294
|
-
background: var(--fy-prop-accent);
|
|
295
|
-
}
|
|
296
|
-
</style>
|
|
297
|
-
<fy-composition width="1280" height="720" fps="30" duration-in-frames="150">
|
|
298
|
-
<div id="hello">
|
|
299
|
-
<div id="glow"></div>
|
|
300
|
-
<div style="position: relative; text-align: center">
|
|
301
|
-
<h1 id="title" data-fy-text="title" data-fy-anim-start="0" data-fy-anim-duration="24"></h1>
|
|
302
|
-
<p>Deterministic video, authored on the web.</p>
|
|
303
|
-
</div>
|
|
304
|
-
<div id="sweep"></div>
|
|
305
|
-
</div>
|
|
306
|
-
</fy-composition>
|
|
307
|
-
`,
|
|
308
|
-
};
|
|
309
25
|
// Keep the generated package name valid for npm and pnpm.
|
|
310
26
|
function packageName(projectName) {
|
|
311
27
|
const normalized = projectName
|
|
@@ -316,21 +32,33 @@ function packageName(projectName) {
|
|
|
316
32
|
.replace(/[._-]+$/g, "");
|
|
317
33
|
return normalized === "" ? "frameyard-project" : normalized;
|
|
318
34
|
}
|
|
35
|
+
function renderTemplates(templates, projectName) {
|
|
36
|
+
const name = packageName(projectName);
|
|
37
|
+
return Object.fromEntries(Object.entries(templates).map(([file, content]) => [
|
|
38
|
+
file === "gitignore.template" ? ".gitignore" : file,
|
|
39
|
+
content.replaceAll("{{PROJECT_NAME}}", name).replaceAll("{{VERSION}}", VERSION),
|
|
40
|
+
]));
|
|
41
|
+
}
|
|
42
|
+
/** Reads the project scaffold templates from `scaffolds/init/`. */
|
|
319
43
|
export function scaffoldFiles(projectName) {
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
44
|
+
return renderTemplates(readTemplates(INIT_TEMPLATES), projectName);
|
|
45
|
+
}
|
|
46
|
+
/** Reads the optional local-model host scaffold from `scaffolds/local-models/`. */
|
|
47
|
+
export function localModelScaffoldFiles() {
|
|
48
|
+
const templates = readTemplates(LOCAL_MODELS_TEMPLATES);
|
|
49
|
+
const files = {};
|
|
50
|
+
for (const [file, content] of Object.entries(templates)) {
|
|
51
|
+
if (file.startsWith("opencode/")) {
|
|
52
|
+
files[`.opencode/${file.slice("opencode/".length)}`] = content;
|
|
53
|
+
}
|
|
54
|
+
else if (file.startsWith("pi/")) {
|
|
55
|
+
files[`.pi/${file.slice("pi/".length)}`] = content;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
files[file] = content;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return files;
|
|
334
62
|
}
|
|
335
63
|
export const SCAFFOLD_NEXT = [
|
|
336
64
|
"npx frameyard doctor",
|
package/dist/scaffold.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AACtF,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AACpE,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;AAEpF,SAAS,aAAa,CAAC,SAAi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,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,sBAAsB;IACtB,mBAAmB;IACnB,0BAA0B;IAC1B,2BAA2B;CAC5B,CAAC"}
|
|
@@ -16,6 +16,8 @@ export interface RenderCompositionDocumentOptions {
|
|
|
16
16
|
importMap?: Record<string, string>;
|
|
17
17
|
hostScriptUrl?: string;
|
|
18
18
|
styleText?: string;
|
|
19
|
+
/** Project font stylesheet served by the preview server. */
|
|
20
|
+
fontStylesheetUrl?: string;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Wraps an authoring fragment in the fixed composition document shell. Top-level
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-html.d.ts","sourceRoot":"","sources":["../../src/server/composition-html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,eAAO,MAAM,oBAAoB;aAC/B,SAAS,EAAE,iCAAiC;aAC5C,mBAAmB,EAAE,yCAAyC;CACtD,CAAC;AAEX,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AAEpF,eAAO,MAAM,sBAAsB,0LACsJ,CAAC;AAE1L,MAAM,WAAW,gCAAgC;IAC/C,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"composition-html.d.ts","sourceRoot":"","sources":["../../src/server/composition-html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,eAAO,MAAM,oBAAoB;aAC/B,SAAS,EAAE,iCAAiC;aAC5C,mBAAmB,EAAE,yCAAyC;CACtD,CAAC;AAEX,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AAEpF,eAAO,MAAM,sBAAsB,0LACsJ,CAAC;AAE1L,MAAM,WAAW,gCAAgC;IAC/C,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gCAAgC,GAAG,MAAM,CA6F3F"}
|
|
@@ -64,6 +64,13 @@ export function renderCompositionDocument(options) {
|
|
|
64
64
|
const hostStyle = createElement("style", [{ name: "data-fy-host", value: "" }]);
|
|
65
65
|
appendText(hostStyle, options.styleText ?? COMPOSITION_HOST_STYLE);
|
|
66
66
|
appendChild(head, hostStyle);
|
|
67
|
+
if (options.fontStylesheetUrl !== undefined) {
|
|
68
|
+
appendChild(head, createElement("link", [
|
|
69
|
+
{ name: "rel", value: "stylesheet" },
|
|
70
|
+
{ name: "href", value: options.fontStylesheetUrl },
|
|
71
|
+
{ name: "data-fy-host", value: "" },
|
|
72
|
+
]));
|
|
73
|
+
}
|
|
67
74
|
for (const style of styleNodes) {
|
|
68
75
|
appendChild(head, style);
|
|
69
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition-html.js","sourceRoot":"","sources":["../../src/server/composition-html.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,SAA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kBAAkB,CAAC,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview-html.d.ts","sourceRoot":"","sources":["../../src/server/preview-html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preview-html.d.ts","sourceRoot":"","sources":["../../src/server/preview-html.ts"],"names":[],"mappings":"AAsEA,wBAAgB,iBAAiB,IAAI,MAAM,CAqE1C"}
|