@nodetool-ai/timeline 0.8.1
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/README.md +55 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/animation/bakedAnimation.d.ts +84 -0
- package/dist/animation/bakedAnimation.d.ts.map +1 -0
- package/dist/animation/bakedAnimation.js +95 -0
- package/dist/animation/bakedAnimation.js.map +1 -0
- package/dist/animation/beat.d.ts +7 -0
- package/dist/animation/beat.d.ts.map +1 -0
- package/dist/animation/beat.js +36 -0
- package/dist/animation/beat.js.map +1 -0
- package/dist/animation/compile.d.ts +184 -0
- package/dist/animation/compile.d.ts.map +1 -0
- package/dist/animation/compile.js +312 -0
- package/dist/animation/compile.js.map +1 -0
- package/dist/animation/custom.d.ts +183 -0
- package/dist/animation/custom.d.ts.map +1 -0
- package/dist/animation/custom.js +583 -0
- package/dist/animation/custom.js.map +1 -0
- package/dist/animation/easing.d.ts +34 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +332 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/index.d.ts +20 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/index.js +20 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/links.d.ts +33 -0
- package/dist/animation/links.d.ts.map +1 -0
- package/dist/animation/links.js +126 -0
- package/dist/animation/links.js.map +1 -0
- package/dist/animation/presets.d.ts +86 -0
- package/dist/animation/presets.d.ts.map +1 -0
- package/dist/animation/presets.js +642 -0
- package/dist/animation/presets.js.map +1 -0
- package/dist/animation/sample.d.ts +145 -0
- package/dist/animation/sample.d.ts.map +1 -0
- package/dist/animation/sample.js +390 -0
- package/dist/animation/sample.js.map +1 -0
- package/dist/animation/simplify.d.ts +70 -0
- package/dist/animation/simplify.d.ts.map +1 -0
- package/dist/animation/simplify.js +278 -0
- package/dist/animation/simplify.js.map +1 -0
- package/dist/animation/sourceCurves.d.ts +45 -0
- package/dist/animation/sourceCurves.d.ts.map +1 -0
- package/dist/animation/sourceCurves.js +168 -0
- package/dist/animation/sourceCurves.js.map +1 -0
- package/dist/animation/styleTracks.d.ts +23 -0
- package/dist/animation/styleTracks.d.ts.map +1 -0
- package/dist/animation/styleTracks.js +341 -0
- package/dist/animation/styleTracks.js.map +1 -0
- package/dist/animation/types.d.ts +269 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/types.js +173 -0
- package/dist/animation/types.js.map +1 -0
- package/dist/animation/typewriter.d.ts +8 -0
- package/dist/animation/typewriter.d.ts.map +1 -0
- package/dist/animation/typewriter.js +32 -0
- package/dist/animation/typewriter.js.map +1 -0
- package/dist/audioFade.d.ts +73 -0
- package/dist/audioFade.d.ts.map +1 -0
- package/dist/audioFade.js +134 -0
- package/dist/audioFade.js.map +1 -0
- package/dist/authoredStyles.d.ts +61 -0
- package/dist/authoredStyles.d.ts.map +1 -0
- package/dist/authoredStyles.js +90 -0
- package/dist/authoredStyles.js.map +1 -0
- package/dist/authoring.d.ts +50 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +207 -0
- package/dist/authoring.js.map +1 -0
- package/dist/beats.d.ts +103 -0
- package/dist/beats.d.ts.map +1 -0
- package/dist/beats.js +228 -0
- package/dist/beats.js.map +1 -0
- package/dist/clone.d.ts +32 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +53 -0
- package/dist/clone.js.map +1 -0
- package/dist/composition.d.ts +87 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +253 -0
- package/dist/composition.js.map +1 -0
- package/dist/crop.d.ts +48 -0
- package/dist/crop.d.ts.map +1 -0
- package/dist/crop.js +75 -0
- package/dist/crop.js.map +1 -0
- package/dist/defaults.d.ts +142 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +335 -0
- package/dist/defaults.js.map +1 -0
- package/dist/dependencyHash.d.ts +14 -0
- package/dist/dependencyHash.d.ts.map +1 -0
- package/dist/dependencyHash.js +19 -0
- package/dist/dependencyHash.js.map +1 -0
- package/dist/dropResolve.d.ts +40 -0
- package/dist/dropResolve.d.ts.map +1 -0
- package/dist/dropResolve.js +137 -0
- package/dist/dropResolve.js.map +1 -0
- package/dist/examples/node.d.ts +11 -0
- package/dist/examples/node.d.ts.map +1 -0
- package/dist/examples/node.js +87 -0
- package/dist/examples/node.js.map +1 -0
- package/dist/extension.d.ts +52 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +269 -0
- package/dist/extension.js.map +1 -0
- package/dist/extensionRequest.d.ts +40 -0
- package/dist/extensionRequest.d.ts.map +1 -0
- package/dist/extensionRequest.js +135 -0
- package/dist/extensionRequest.js.map +1 -0
- package/dist/fill-text.d.ts +30 -0
- package/dist/fill-text.d.ts.map +1 -0
- package/dist/fill-text.js +73 -0
- package/dist/fill-text.js.map +1 -0
- package/dist/fonts/catalog.d.ts +97 -0
- package/dist/fonts/catalog.d.ts.map +1 -0
- package/dist/fonts/catalog.js +276 -0
- package/dist/fonts/catalog.js.map +1 -0
- package/dist/fonts/css.d.ts +24 -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/index.d.ts +10 -0
- package/dist/fonts/index.d.ts.map +1 -0
- package/dist/fonts/index.js +10 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/register-node.d.ts +45 -0
- package/dist/fonts/register-node.d.ts.map +1 -0
- package/dist/fonts/register-node.js +71 -0
- package/dist/fonts/register-node.js.map +1 -0
- package/dist/generatedMatte.d.ts +86 -0
- package/dist/generatedMatte.d.ts.map +1 -0
- package/dist/generatedMatte.js +152 -0
- package/dist/generatedMatte.js.map +1 -0
- package/dist/generative.d.ts +145 -0
- package/dist/generative.d.ts.map +1 -0
- package/dist/generative.js +396 -0
- package/dist/generative.js.map +1 -0
- package/dist/group.d.ts +47 -0
- package/dist/group.d.ts.map +1 -0
- package/dist/group.js +131 -0
- package/dist/group.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/interchange.d.ts +47 -0
- package/dist/interchange.d.ts.map +1 -0
- package/dist/interchange.js +158 -0
- package/dist/interchange.js.map +1 -0
- package/dist/keyframes.d.ts +44 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/keyframes.js +148 -0
- package/dist/keyframes.js.map +1 -0
- package/dist/lineDelivery.d.ts +108 -0
- package/dist/lineDelivery.d.ts.map +1 -0
- package/dist/lineDelivery.js +154 -0
- package/dist/lineDelivery.js.map +1 -0
- package/dist/linked.d.ts +41 -0
- package/dist/linked.d.ts.map +1 -0
- package/dist/linked.js +166 -0
- package/dist/linked.js.map +1 -0
- package/dist/lipSyncRequest.d.ts +65 -0
- package/dist/lipSyncRequest.d.ts.map +1 -0
- package/dist/lipSyncRequest.js +73 -0
- package/dist/lipSyncRequest.js.map +1 -0
- package/dist/measureClipDurations.d.ts +7 -0
- package/dist/measureClipDurations.d.ts.map +1 -0
- package/dist/measureClipDurations.js +17 -0
- package/dist/measureClipDurations.js.map +1 -0
- package/dist/mediaTrack.d.ts +120 -0
- package/dist/mediaTrack.d.ts.map +1 -0
- package/dist/mediaTrack.js +269 -0
- package/dist/mediaTrack.js.map +1 -0
- package/dist/midi/cacheKey.d.ts +25 -0
- package/dist/midi/cacheKey.d.ts.map +1 -0
- package/dist/midi/cacheKey.js +54 -0
- package/dist/midi/cacheKey.js.map +1 -0
- package/dist/midi/edit.d.ts +48 -0
- package/dist/midi/edit.d.ts.map +1 -0
- package/dist/midi/edit.js +93 -0
- package/dist/midi/edit.js.map +1 -0
- package/dist/midi/engines/bl1.d.ts +29 -0
- package/dist/midi/engines/bl1.d.ts.map +1 -0
- package/dist/midi/engines/bl1.js +128 -0
- package/dist/midi/engines/bl1.js.map +1 -0
- package/dist/midi/engines/dr1.d.ts +28 -0
- package/dist/midi/engines/dr1.d.ts.map +1 -0
- package/dist/midi/engines/dr1.js +101 -0
- package/dist/midi/engines/dr1.js.map +1 -0
- package/dist/midi/engines/dsp.d.ts +126 -0
- package/dist/midi/engines/dsp.d.ts.map +1 -0
- package/dist/midi/engines/dsp.js +371 -0
- package/dist/midi/engines/dsp.js.map +1 -0
- package/dist/midi/engines/index.d.ts +13 -0
- package/dist/midi/engines/index.d.ts.map +1 -0
- package/dist/midi/engines/index.js +13 -0
- package/dist/midi/engines/index.js.map +1 -0
- package/dist/midi/engines/kits.d.ts +12 -0
- package/dist/midi/engines/kits.d.ts.map +1 -0
- package/dist/midi/engines/kits.js +121 -0
- package/dist/midi/engines/kits.js.map +1 -0
- package/dist/midi/engines/wavetables.d.ts +45 -0
- package/dist/midi/engines/wavetables.d.ts.map +1 -0
- package/dist/midi/engines/wavetables.js +334 -0
- package/dist/midi/engines/wavetables.js.map +1 -0
- package/dist/midi/engines/wt1.d.ts +30 -0
- package/dist/midi/engines/wt1.d.ts.map +1 -0
- package/dist/midi/engines/wt1.js +91 -0
- package/dist/midi/engines/wt1.js.map +1 -0
- package/dist/midi/grid.d.ts +51 -0
- package/dist/midi/grid.d.ts.map +1 -0
- package/dist/midi/grid.js +104 -0
- package/dist/midi/grid.js.map +1 -0
- package/dist/midi/index.d.ts +20 -0
- package/dist/midi/index.d.ts.map +1 -0
- package/dist/midi/index.js +20 -0
- package/dist/midi/index.js.map +1 -0
- package/dist/midi/instrument.d.ts +32 -0
- package/dist/midi/instrument.d.ts.map +1 -0
- package/dist/midi/instrument.js +73 -0
- package/dist/midi/instrument.js.map +1 -0
- package/dist/midi/notes.d.ts +46 -0
- package/dist/midi/notes.d.ts.map +1 -0
- package/dist/midi/notes.js +121 -0
- package/dist/midi/notes.js.map +1 -0
- package/dist/midi/notesEdit.d.ts +94 -0
- package/dist/midi/notesEdit.d.ts.map +1 -0
- package/dist/midi/notesEdit.js +159 -0
- package/dist/midi/notesEdit.js.map +1 -0
- package/dist/midi/presets.d.ts +29 -0
- package/dist/midi/presets.d.ts.map +1 -0
- package/dist/midi/presets.js +281 -0
- package/dist/midi/presets.js.map +1 -0
- package/dist/midi/tempo.d.ts +27 -0
- package/dist/midi/tempo.d.ts.map +1 -0
- package/dist/midi/tempo.js +57 -0
- package/dist/midi/tempo.js.map +1 -0
- package/dist/midi/ticks.d.ts +25 -0
- package/dist/midi/ticks.d.ts.map +1 -0
- package/dist/midi/ticks.js +35 -0
- package/dist/midi/ticks.js.map +1 -0
- package/dist/midi/voice.d.ts +148 -0
- package/dist/midi/voice.d.ts.map +1 -0
- package/dist/midi/voice.js +348 -0
- package/dist/midi/voice.js.map +1 -0
- package/dist/midi/wav.d.ts +14 -0
- package/dist/midi/wav.d.ts.map +1 -0
- package/dist/midi/wav.js +51 -0
- package/dist/midi/wav.js.map +1 -0
- package/dist/model3d.d.ts +41 -0
- package/dist/model3d.d.ts.map +1 -0
- package/dist/model3d.js +39 -0
- package/dist/model3d.js.map +1 -0
- package/dist/model3dBake.d.ts +80 -0
- package/dist/model3dBake.d.ts.map +1 -0
- package/dist/model3dBake.js +127 -0
- package/dist/model3dBake.js.map +1 -0
- package/dist/ops/apply.d.ts +32 -0
- package/dist/ops/apply.d.ts.map +1 -0
- package/dist/ops/apply.js +1595 -0
- package/dist/ops/apply.js.map +1 -0
- package/dist/ops/index.d.ts +13 -0
- package/dist/ops/index.d.ts.map +1 -0
- package/dist/ops/index.js +13 -0
- package/dist/ops/index.js.map +1 -0
- package/dist/ops/op.d.ts +407 -0
- package/dist/ops/op.d.ts.map +1 -0
- package/dist/ops/op.js +61 -0
- package/dist/ops/op.js.map +1 -0
- package/dist/ops/serialize.d.ts +77 -0
- package/dist/ops/serialize.d.ts.map +1 -0
- package/dist/ops/serialize.js +81 -0
- package/dist/ops/serialize.js.map +1 -0
- package/dist/ops/types.d.ts +150 -0
- package/dist/ops/types.d.ts.map +1 -0
- package/dist/ops/types.js +12 -0
- package/dist/ops/types.js.map +1 -0
- package/dist/pathSampling.d.ts +51 -0
- package/dist/pathSampling.d.ts.map +1 -0
- package/dist/pathSampling.js +111 -0
- package/dist/pathSampling.js.map +1 -0
- package/dist/placement/index.d.ts +2 -0
- package/dist/placement/index.d.ts.map +1 -0
- package/dist/placement/index.js +2 -0
- package/dist/placement/index.js.map +1 -0
- package/dist/placement/resolveTrackPlacement.d.ts +40 -0
- package/dist/placement/resolveTrackPlacement.d.ts.map +1 -0
- package/dist/placement/resolveTrackPlacement.js +71 -0
- package/dist/placement/resolveTrackPlacement.js.map +1 -0
- package/dist/production.d.ts +99 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +328 -0
- package/dist/production.js.map +1 -0
- package/dist/reassemble.d.ts +68 -0
- package/dist/reassemble.d.ts.map +1 -0
- package/dist/reassemble.js +187 -0
- package/dist/reassemble.js.map +1 -0
- package/dist/recipe.d.ts +24 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +89 -0
- package/dist/recipe.js.map +1 -0
- package/dist/recordedVoiceReplacement.d.ts +70 -0
- package/dist/recordedVoiceReplacement.d.ts.map +1 -0
- package/dist/recordedVoiceReplacement.js +82 -0
- package/dist/recordedVoiceReplacement.js.map +1 -0
- package/dist/reframe.d.ts +31 -0
- package/dist/reframe.d.ts.map +1 -0
- package/dist/reframe.js +227 -0
- package/dist/reframe.js.map +1 -0
- package/dist/render/canvas2d.d.ts +419 -0
- package/dist/render/canvas2d.d.ts.map +1 -0
- package/dist/render/canvas2d.js +1392 -0
- package/dist/render/canvas2d.js.map +1 -0
- package/dist/render/color.d.ts +26 -0
- package/dist/render/color.d.ts.map +1 -0
- package/dist/render/color.js +305 -0
- package/dist/render/color.js.map +1 -0
- package/dist/render/cpuLegacyEffects.d.ts +17 -0
- package/dist/render/cpuLegacyEffects.d.ts.map +1 -0
- package/dist/render/cpuLegacyEffects.js +347 -0
- package/dist/render/cpuLegacyEffects.js.map +1 -0
- package/dist/render/cpuVisualEffects.d.ts +13 -0
- package/dist/render/cpuVisualEffects.d.ts.map +1 -0
- package/dist/render/cpuVisualEffects.js +388 -0
- package/dist/render/cpuVisualEffects.js.map +1 -0
- package/dist/render/cubeLut.d.ts +12 -0
- package/dist/render/cubeLut.d.ts.map +1 -0
- package/dist/render/cubeLut.js +81 -0
- package/dist/render/cubeLut.js.map +1 -0
- package/dist/render/curveFitting.d.ts +28 -0
- package/dist/render/curveFitting.d.ts.map +1 -0
- package/dist/render/curveFitting.js +94 -0
- package/dist/render/curveFitting.js.map +1 -0
- package/dist/render/draw.d.ts +265 -0
- package/dist/render/draw.d.ts.map +1 -0
- package/dist/render/draw.js +929 -0
- package/dist/render/draw.js.map +1 -0
- package/dist/render/effects.d.ts +120 -0
- package/dist/render/effects.d.ts.map +1 -0
- package/dist/render/effects.js +804 -0
- package/dist/render/effects.js.map +1 -0
- package/dist/render/frameCompositor.d.ts +502 -0
- package/dist/render/frameCompositor.d.ts.map +1 -0
- package/dist/render/frameCompositor.js +1331 -0
- package/dist/render/frameCompositor.js.map +1 -0
- package/dist/render/index.d.ts +27 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +27 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/layout.d.ts +17 -0
- package/dist/render/layout.d.ts.map +1 -0
- package/dist/render/layout.js +197 -0
- package/dist/render/layout.js.map +1 -0
- package/dist/render/model3dBakeSamples.d.ts +45 -0
- package/dist/render/model3dBakeSamples.d.ts.map +1 -0
- package/dist/render/model3dBakeSamples.js +68 -0
- package/dist/render/model3dBakeSamples.js.map +1 -0
- package/dist/render/motionBlur.d.ts +170 -0
- package/dist/render/motionBlur.d.ts.map +1 -0
- package/dist/render/motionBlur.js +193 -0
- package/dist/render/motionBlur.js.map +1 -0
- package/dist/render/sceneModel.d.ts +577 -0
- package/dist/render/sceneModel.d.ts.map +1 -0
- package/dist/render/sceneModel.js +1460 -0
- package/dist/render/sceneModel.js.map +1 -0
- package/dist/render/shapeGeometry.d.ts +81 -0
- package/dist/render/shapeGeometry.d.ts.map +1 -0
- package/dist/render/shapeGeometry.js +460 -0
- package/dist/render/shapeGeometry.js.map +1 -0
- package/dist/render/spatial.d.ts +9 -0
- package/dist/render/spatial.d.ts.map +1 -0
- package/dist/render/spatial.js +58 -0
- package/dist/render/spatial.js.map +1 -0
- package/dist/render/svgPath.d.ts +80 -0
- package/dist/render/svgPath.d.ts.map +1 -0
- package/dist/render/svgPath.js +199 -0
- package/dist/render/svgPath.js.map +1 -0
- package/dist/render/temporal.d.ts +6 -0
- package/dist/render/temporal.d.ts.map +1 -0
- package/dist/render/temporal.js +74 -0
- package/dist/render/temporal.js.map +1 -0
- package/dist/render/textLayout.d.ts +159 -0
- package/dist/render/textLayout.d.ts.map +1 -0
- package/dist/render/textLayout.js +301 -0
- package/dist/render/textLayout.js.map +1 -0
- package/dist/render/trackEffects.d.ts +23 -0
- package/dist/render/trackEffects.d.ts.map +1 -0
- package/dist/render/trackEffects.js +93 -0
- package/dist/render/trackEffects.js.map +1 -0
- package/dist/render/transform.d.ts +54 -0
- package/dist/render/transform.d.ts.map +1 -0
- package/dist/render/transform.js +222 -0
- package/dist/render/transform.js.map +1 -0
- package/dist/render/transition.d.ts +109 -0
- package/dist/render/transition.d.ts.map +1 -0
- package/dist/render/transition.js +351 -0
- package/dist/render/transition.js.map +1 -0
- package/dist/retarget.d.ts +73 -0
- package/dist/retarget.d.ts.map +1 -0
- package/dist/retarget.js +305 -0
- package/dist/retarget.js.map +1 -0
- package/dist/rippleEdit.d.ts +83 -0
- package/dist/rippleEdit.d.ts.map +1 -0
- package/dist/rippleEdit.js +184 -0
- package/dist/rippleEdit.js.map +1 -0
- package/dist/scene.d.ts +28 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js +28 -0
- package/dist/scene.js.map +1 -0
- package/dist/script-link.d.ts +52 -0
- package/dist/script-link.d.ts.map +1 -0
- package/dist/script-link.js +78 -0
- package/dist/script-link.js.map +1 -0
- package/dist/script.d.ts +52 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +93 -0
- package/dist/script.js.map +1 -0
- package/dist/snap.d.ts +2 -0
- package/dist/snap.d.ts.map +1 -0
- package/dist/snap.js +21 -0
- package/dist/snap.js.map +1 -0
- package/dist/snapping/buildSnapPoints.d.ts +16 -0
- package/dist/snapping/buildSnapPoints.d.ts.map +1 -0
- package/dist/snapping/buildSnapPoints.js +39 -0
- package/dist/snapping/buildSnapPoints.js.map +1 -0
- package/dist/snapping/index.d.ts +3 -0
- package/dist/snapping/index.d.ts.map +1 -0
- package/dist/snapping/index.js +3 -0
- package/dist/snapping/index.js.map +1 -0
- package/dist/snapping/resolveSnap.d.ts +19 -0
- package/dist/snapping/resolveSnap.d.ts.map +1 -0
- package/dist/snapping/resolveSnap.js +39 -0
- package/dist/snapping/resolveSnap.js.map +1 -0
- package/dist/sourceRate.d.ts +12 -0
- package/dist/sourceRate.d.ts.map +1 -0
- package/dist/sourceRate.js +13 -0
- package/dist/sourceRate.js.map +1 -0
- package/dist/spatialVideoRequest.d.ts +91 -0
- package/dist/spatialVideoRequest.d.ts.map +1 -0
- package/dist/spatialVideoRequest.js +175 -0
- package/dist/spatialVideoRequest.js.map +1 -0
- package/dist/splitClip.d.ts +3 -0
- package/dist/splitClip.d.ts.map +1 -0
- package/dist/splitClip.js +190 -0
- package/dist/splitClip.js.map +1 -0
- package/dist/stableSerialize.d.ts +11 -0
- package/dist/stableSerialize.d.ts.map +1 -0
- package/dist/stableSerialize.js +31 -0
- package/dist/stableSerialize.js.map +1 -0
- package/dist/staleSet.d.ts +41 -0
- package/dist/staleSet.d.ts.map +1 -0
- package/dist/staleSet.js +106 -0
- package/dist/staleSet.js.map +1 -0
- package/dist/storyboard.d.ts +221 -0
- package/dist/storyboard.d.ts.map +1 -0
- package/dist/storyboard.js +417 -0
- package/dist/storyboard.js.map +1 -0
- package/dist/subtitles.d.ts +61 -0
- package/dist/subtitles.d.ts.map +1 -0
- package/dist/subtitles.js +92 -0
- package/dist/subtitles.js.map +1 -0
- package/dist/takes.d.ts +76 -0
- package/dist/takes.d.ts.map +1 -0
- package/dist/takes.js +238 -0
- package/dist/takes.js.map +1 -0
- package/dist/timeRemap.d.ts +101 -0
- package/dist/timeRemap.d.ts.map +1 -0
- package/dist/timeRemap.js +183 -0
- package/dist/timeRemap.js.map +1 -0
- package/dist/trackOrder.d.ts +38 -0
- package/dist/trackOrder.d.ts.map +1 -0
- package/dist/trackOrder.js +54 -0
- package/dist/trackOrder.js.map +1 -0
- package/dist/transitionAtCut.d.ts +89 -0
- package/dist/transitionAtCut.d.ts.map +1 -0
- package/dist/transitionAtCut.js +217 -0
- package/dist/transitionAtCut.js.map +1 -0
- package/dist/trimClip.d.ts +13 -0
- package/dist/trimClip.d.ts.map +1 -0
- package/dist/trimClip.js +60 -0
- package/dist/trimClip.js.map +1 -0
- package/dist/types.d.ts +1772 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +84 -0
- package/dist/types.js.map +1 -0
- package/fonts/BebasNeue-Regular.ttf +0 -0
- package/fonts/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter-Italic-Variable.ttf +0 -0
- package/fonts/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Italic-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Variable.ttf +0 -0
- package/fonts/Lora-Italic-Variable.ttf +0 -0
- package/fonts/Lora-Variable.ttf +0 -0
- package/fonts/OFL-BebasNeue.txt +93 -0
- package/fonts/OFL-Inter.txt +93 -0
- package/fonts/OFL-JetBrainsMono.txt +93 -0
- package/fonts/OFL-Lora.txt +93 -0
- package/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/fonts/OFL-SpaceGrotesk.txt +93 -0
- package/fonts/PlayfairDisplay-Italic-Variable.ttf +0 -0
- package/fonts/PlayfairDisplay-Variable.ttf +0 -0
- package/fonts/SpaceGrotesk-Variable.ttf +0 -0
- package/package.json +108 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { applyExtensionToClips, captureExtensionSource } from "./extension.js";
|
|
2
|
+
import { composeGenerativeTakePatch, planGenerativeOperation } from "./generative.js";
|
|
3
|
+
export const EXTENSION_MODEL_TASK = "extend_video";
|
|
4
|
+
export function createExtensionRequest(input) {
|
|
5
|
+
if (!input.sequenceId || !input.requestId) {
|
|
6
|
+
throw new Error("Extension requires a saved sequence and request id.");
|
|
7
|
+
}
|
|
8
|
+
if (!input.model.id ||
|
|
9
|
+
!input.model.provider ||
|
|
10
|
+
!input.model.supportedTasks?.includes(EXTENSION_MODEL_TASK)) {
|
|
11
|
+
throw new Error("Choose a model with the extend_video task.");
|
|
12
|
+
}
|
|
13
|
+
const directionTasks = input.model.supportedTasks.filter((task) => task === "extend_video_start" || task === "extend_video_end");
|
|
14
|
+
if (directionTasks.length > 0 &&
|
|
15
|
+
!directionTasks.includes(`extend_video_${input.direction}`)) {
|
|
16
|
+
throw new Error(`The selected model does not support ${input.direction} extension.`);
|
|
17
|
+
}
|
|
18
|
+
if ((input.direction !== "start" && input.direction !== "end") ||
|
|
19
|
+
!Number.isFinite(input.addedSourceDurationMs) ||
|
|
20
|
+
input.addedSourceDurationMs <= 0 ||
|
|
21
|
+
!input.prompt.trim()) {
|
|
22
|
+
throw new Error("Choose start or end, a positive extension duration, and an instruction.");
|
|
23
|
+
}
|
|
24
|
+
if (input.model.durations?.length &&
|
|
25
|
+
!input.model.durations.includes(input.addedSourceDurationMs / 1000)) {
|
|
26
|
+
throw new Error("Choose a supported extension duration.");
|
|
27
|
+
}
|
|
28
|
+
const planned = planGenerativeOperation({
|
|
29
|
+
clip: input.clip,
|
|
30
|
+
operation: "extend",
|
|
31
|
+
direction: input.direction,
|
|
32
|
+
durationMs: input.addedSourceDurationMs,
|
|
33
|
+
prompt: input.prompt,
|
|
34
|
+
provider: input.model.provider,
|
|
35
|
+
model: input.model.id
|
|
36
|
+
});
|
|
37
|
+
if (!planned.ok) {
|
|
38
|
+
throw new Error(planned.error);
|
|
39
|
+
}
|
|
40
|
+
const captured = captureExtensionSource(input.clip);
|
|
41
|
+
if (!captured.ok) {
|
|
42
|
+
throw new Error(captured.error);
|
|
43
|
+
}
|
|
44
|
+
return Object.freeze({
|
|
45
|
+
action: "video_extend",
|
|
46
|
+
requestId: input.requestId,
|
|
47
|
+
sequenceId: input.sequenceId,
|
|
48
|
+
source: captured.source,
|
|
49
|
+
direction: input.direction,
|
|
50
|
+
addedSourceDurationMs: input.addedSourceDurationMs,
|
|
51
|
+
prompt: input.prompt.trim(),
|
|
52
|
+
provider: input.model.provider,
|
|
53
|
+
model: input.model.id
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function extensionGenerateMediaData(request) {
|
|
57
|
+
const source = request.source;
|
|
58
|
+
return {
|
|
59
|
+
mode: request.action,
|
|
60
|
+
provider: request.provider,
|
|
61
|
+
model: request.model,
|
|
62
|
+
prompt: request.prompt,
|
|
63
|
+
extension_mode: request.direction,
|
|
64
|
+
duration: request.addedSourceDurationMs / 1000,
|
|
65
|
+
variations: 1,
|
|
66
|
+
source_asset_id: source.sourceAssetId,
|
|
67
|
+
source_context: {
|
|
68
|
+
sequence_id: request.sequenceId,
|
|
69
|
+
clip_id: source.clipId,
|
|
70
|
+
source_asset_id: source.sourceAssetId,
|
|
71
|
+
...(source.sourceTakeId && { source_take_id: source.sourceTakeId }),
|
|
72
|
+
source_start_ms: source.sourceStartMs,
|
|
73
|
+
source_end_ms: source.sourceEndMs,
|
|
74
|
+
timeline_start_ms: source.timelineStartMs,
|
|
75
|
+
timeline_duration_ms: source.timelineDurationMs,
|
|
76
|
+
speed_multiplier: source.rate
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** Keep the accepted media intact, even when it changed during generation. */
|
|
81
|
+
export function landExtensionCandidate(clip, request, result) {
|
|
82
|
+
if (clip.id !== request.source.clipId) {
|
|
83
|
+
throw new Error("The extension belongs to a different clip.");
|
|
84
|
+
}
|
|
85
|
+
const requiredDuration = request.source.sourceEndMs -
|
|
86
|
+
request.source.sourceStartMs +
|
|
87
|
+
request.addedSourceDurationMs;
|
|
88
|
+
if (!Number.isFinite(result.durationMs) ||
|
|
89
|
+
result.durationMs < requiredDuration) {
|
|
90
|
+
throw new Error("The extension result does not contain the source window plus the requested extension.");
|
|
91
|
+
}
|
|
92
|
+
const next = composeGenerativeTakePatch(clip, "extend", {
|
|
93
|
+
...result,
|
|
94
|
+
jobId: request.requestId,
|
|
95
|
+
provider: request.provider,
|
|
96
|
+
model: request.model,
|
|
97
|
+
prompt: request.prompt,
|
|
98
|
+
paramOverridesSnapshot: { extension: request },
|
|
99
|
+
activate: false
|
|
100
|
+
});
|
|
101
|
+
if (next === clip) {
|
|
102
|
+
return clip;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...next,
|
|
106
|
+
versions: next.versions?.map((take) => take.id === request.requestId
|
|
107
|
+
? { ...take, parentTakeId: request.source.sourceTakeId }
|
|
108
|
+
: take)
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** Apply only a take produced by this submission, using one timing choice. */
|
|
112
|
+
export function applyExtensionRequest(clips, request, timing, lockedTrackIds) {
|
|
113
|
+
const take = clips
|
|
114
|
+
.find((clip) => clip.id === request.source.clipId)
|
|
115
|
+
?.versions?.find((version) => version.id === request.requestId);
|
|
116
|
+
if (!take ||
|
|
117
|
+
JSON.stringify(take.paramOverridesSnapshot.extension) !==
|
|
118
|
+
JSON.stringify(request)) {
|
|
119
|
+
return {
|
|
120
|
+
ok: false,
|
|
121
|
+
code: "invalid",
|
|
122
|
+
error: "Choose an extension take from this request."
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return applyExtensionToClips({
|
|
126
|
+
clips,
|
|
127
|
+
source: request.source,
|
|
128
|
+
takeId: request.requestId,
|
|
129
|
+
direction: request.direction,
|
|
130
|
+
addedSourceDurationMs: request.addedSourceDurationMs,
|
|
131
|
+
timing,
|
|
132
|
+
lockedTrackIds
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=extensionRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionRequest.js","sourceRoot":"","sources":["../src/extensionRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAuB,CAAC;AAsB5D,MAAM,UAAU,sBAAsB,CAAC,KAQtC;IACC,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,IACE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACf,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ;QACrB,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE,QAAQ,CAAC,oBAAoB,CAAC,EAC3D,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CACtD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,oBAAoB,IAAI,IAAI,KAAK,kBAAkB,CACvE,CAAC;IACF,IACE,cAAc,CAAC,MAAM,GAAG,CAAC;QACzB,CAAC,cAAc,CAAC,QAAQ,CAAC,gBAAgB,KAAK,CAAC,SAAS,EAAE,CAAC,EAC3D,CAAC;QACD,MAAM,IAAI,KAAK,CACb,uCAAuC,KAAK,CAAC,SAAS,aAAa,CACpE,CAAC;IACJ,CAAC;IACD,IACE,CAAC,KAAK,CAAC,SAAS,KAAK,OAAO,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC;Q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AG,KAAK;SACf,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;QAClD,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAClE,IACE,CAAC,IAAI;QACL,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC;YACnD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EACzB,CAAC;QACD,OAAO;YACL,EAAE,EAAE,KAAc;YAClB,IAAI,EAAE,SAAkB;YACxB,KAAK,EAAE,6CAA6C;SACrD,CAAC;IACJ,CAAC;IACD,OAAO,qBAAqB,CAAC;QAC3B,KAAK;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,SAAS;QACzB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;QACpD,MAAM;QACN,cAAc;KACf,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filling a template cut's placeholders.
|
|
3
|
+
*
|
|
4
|
+
* A sequence approved once becomes a template when its text carries `{{key}}`:
|
|
5
|
+
* a per-SKU batch fills the overlay ("{{name}} — {{price}}") and renders. This
|
|
6
|
+
* is that substitution, pure, so the `nodetool.timeline.FillTimelineText` node
|
|
7
|
+
* and any editor affordance fill a cut the same way.
|
|
8
|
+
*
|
|
9
|
+
* An unresolved key is reported and left in the text. Blanking it would ship a
|
|
10
|
+
* frame reading "Aero 9 — " with nothing downstream able to tell that from an
|
|
11
|
+
* authored dash.
|
|
12
|
+
*/
|
|
13
|
+
import type { TimelineSequence } from "./types.js";
|
|
14
|
+
export interface FillTimelineTextResult {
|
|
15
|
+
/** A new sequence; the input is never mutated. */
|
|
16
|
+
sequence: TimelineSequence;
|
|
17
|
+
/** Keys that were substituted at least once, in first-seen order. */
|
|
18
|
+
filled: string[];
|
|
19
|
+
/** Keys the text names that `values` has no entry for, in first-seen order. */
|
|
20
|
+
unresolved: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Fill `{{key}}` placeholders in every text clip's authored text and in every
|
|
24
|
+
* caption word.
|
|
25
|
+
*
|
|
26
|
+
* Nothing else is touched: a clip name, a marker label or a transcript line is
|
|
27
|
+
* editor furniture, not what the frame draws.
|
|
28
|
+
*/
|
|
29
|
+
export declare function fillTimelineText(seq: TimelineSequence, values: Record<string, string>): FillTimelineTextResult;
|
|
30
|
+
//# sourceMappingURL=fill-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fill-text.d.ts","sourceRoot":"","sources":["../src/fill-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAgB,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAUjE,MAAM,WAAW,sBAAsB;IACrC,kDAAkD;IAClD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,qEAAqE;IACrE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,+EAA+E;IAC/E,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAoDD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,sBAAsB,CAWxB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filling a template cut's placeholders.
|
|
3
|
+
*
|
|
4
|
+
* A sequence approved once becomes a template when its text carries `{{key}}`:
|
|
5
|
+
* a per-SKU batch fills the overlay ("{{name}} — {{price}}") and renders. This
|
|
6
|
+
* is that substitution, pure, so the `nodetool.timeline.FillTimelineText` node
|
|
7
|
+
* and any editor affordance fill a cut the same way.
|
|
8
|
+
*
|
|
9
|
+
* An unresolved key is reported and left in the text. Blanking it would ship a
|
|
10
|
+
* frame reading "Aero 9 — " with nothing downstream able to tell that from an
|
|
11
|
+
* authored dash.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The placeholder grammar, identical to `fillScript`'s in
|
|
15
|
+
* `@nodetool-ai/protocol/script-fill.ts`: `{{key}}`, optional inner whitespace,
|
|
16
|
+
* a key of word characters plus `.`/`-`. One grammar, so a script and the cut's
|
|
17
|
+
* overlay accept the same value bag.
|
|
18
|
+
*/
|
|
19
|
+
const PLACEHOLDER = /\{\{\s*([A-Za-z0-9_][A-Za-z0-9_.-]*)\s*\}\}/g;
|
|
20
|
+
function fillText(text, values, filled, unresolved) {
|
|
21
|
+
return text.replace(PLACEHOLDER, (match, key) => {
|
|
22
|
+
if (!Object.prototype.hasOwnProperty.call(values, key)) {
|
|
23
|
+
unresolved.add(key);
|
|
24
|
+
return match;
|
|
25
|
+
}
|
|
26
|
+
filled.add(key);
|
|
27
|
+
return values[key];
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** One clip's text and caption words, filled. Unchanged clips come back as-is. */
|
|
31
|
+
function fillClip(clip, values, filled, unresolved) {
|
|
32
|
+
let next = clip;
|
|
33
|
+
const style = clip.textStyle;
|
|
34
|
+
if (style) {
|
|
35
|
+
const text = fillText(style.text, values, filled, unresolved);
|
|
36
|
+
if (text !== style.text) {
|
|
37
|
+
next = { ...next, textStyle: { ...style, text } };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const caption = clip.caption;
|
|
41
|
+
if (caption) {
|
|
42
|
+
let changed = false;
|
|
43
|
+
const words = caption.words.map((entry) => {
|
|
44
|
+
const word = fillText(entry.word, values, filled, unresolved);
|
|
45
|
+
if (word === entry.word)
|
|
46
|
+
return entry;
|
|
47
|
+
changed = true;
|
|
48
|
+
return { ...entry, word };
|
|
49
|
+
});
|
|
50
|
+
if (changed) {
|
|
51
|
+
next = { ...next, caption: { ...caption, words } };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return next;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Fill `{{key}}` placeholders in every text clip's authored text and in every
|
|
58
|
+
* caption word.
|
|
59
|
+
*
|
|
60
|
+
* Nothing else is touched: a clip name, a marker label or a transcript line is
|
|
61
|
+
* editor furniture, not what the frame draws.
|
|
62
|
+
*/
|
|
63
|
+
export function fillTimelineText(seq, values) {
|
|
64
|
+
const filled = new Set();
|
|
65
|
+
const unresolved = new Set();
|
|
66
|
+
const clips = seq.clips.map((clip) => fillClip(clip, values, filled, unresolved));
|
|
67
|
+
return {
|
|
68
|
+
sequence: { ...seq, clips },
|
|
69
|
+
filled: [...filled],
|
|
70
|
+
unresolved: [...unresolved]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=fill-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fill-text.js","sourceRoot":"","sources":["../src/fill-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;;GAKG;AACH,MAAM,WAAW,GAAG,8CAA8C,CAAC;AAWnE,SAAS,QAAQ,CACf,IAAY,EACZ,MAA8B,EAC9B,MAAmB,EACnB,UAAuB;IAEvB,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;QACtD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YACvD,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACpB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CA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,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAC3C,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE;QAC3B,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC;QACnB,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typefaces NodeTool ships, and the rule every host resolves a text
|
|
3
|
+
* clip's `fontFamily` through.
|
|
4
|
+
*
|
|
5
|
+
* A font family named in a document used to mean whatever the machine drawing
|
|
6
|
+
* the frame happened to have installed (F15): the editor preview, the server
|
|
7
|
+
* render and the agent's frame preview each resolved `Inter, Arial,
|
|
8
|
+
* sans-serif` against a different set of system fonts, so the same document
|
|
9
|
+
* produced three different pictures. A bundled corpus fixes the picture; a
|
|
10
|
+
* system font stays available and is reported as non-portable instead (D8).
|
|
11
|
+
*
|
|
12
|
+
* The files live in `packages/timeline/fonts/` next to their OFL licences
|
|
13
|
+
* (C7). Every one is registered in `@nodetool-ai/config`'s
|
|
14
|
+
* `PACKAGE_RUNTIME_ASSET_DIRS`, so `bundle-backend.mjs` stages the directory
|
|
15
|
+
* and `verify-backend-bundle.mjs` fails a build that ships without it (C6).
|
|
16
|
+
*
|
|
17
|
+
* Pure data plus string handling: this module is reachable from the package
|
|
18
|
+
* root, so it must not import anything (AS2). Registering the files with a
|
|
19
|
+
* canvas implementation is `register-node.ts`, which is not.
|
|
20
|
+
*/
|
|
21
|
+
/** The generic CSS family a face falls back to before `sans-serif`. */
|
|
22
|
+
export type BundledFontGeneric = "sans-serif" | "serif" | "monospace";
|
|
23
|
+
/** The slant a face file carries. */
|
|
24
|
+
export type BundledFontStyle = "normal" | "italic";
|
|
25
|
+
/** One font file in the corpus. */
|
|
26
|
+
export interface BundledFontFace {
|
|
27
|
+
/** CSS family name, exactly as the file's `name` table reports it. */
|
|
28
|
+
family: string;
|
|
29
|
+
/** The slant this file draws. Static weights may share a slant. */
|
|
30
|
+
style: BundledFontStyle;
|
|
31
|
+
/**
|
|
32
|
+
* The `wght` axis range this file covers, `[min, max]`. A static face
|
|
33
|
+
* reports the single weight it draws, so the pair is enough for both the
|
|
34
|
+
* `@font-face` descriptor the browser needs and the picker's label.
|
|
35
|
+
*/
|
|
36
|
+
weights: readonly [number, number];
|
|
37
|
+
/** File name under `packages/timeline/fonts/`. */
|
|
38
|
+
file: string;
|
|
39
|
+
/** The OFL text shipped beside it, same directory. */
|
|
40
|
+
license: string;
|
|
41
|
+
/** What the family falls back to when the file itself fails to load. */
|
|
42
|
+
generic: BundledFontGeneric;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The corpus. Ordered by how a title is most likely to be set — the default
|
|
46
|
+
* family first — because the fonts endpoint and the inspector picker list
|
|
47
|
+
* bundled faces in this order before the system ones.
|
|
48
|
+
*
|
|
49
|
+
* Weight ranges are read from each file's `fvar` table rather than from the
|
|
50
|
+
* family's documentation: a browser given a range wider than the axis clamps
|
|
51
|
+
* silently, and one given a narrower range refuses weights the file can draw.
|
|
52
|
+
*/
|
|
53
|
+
export declare const BUNDLED_FONTS: readonly BundledFontFace[];
|
|
54
|
+
/** The family a text style with no `fontFamily` is set in. */
|
|
55
|
+
export declare const DEFAULT_FONT_FAMILY = "Inter";
|
|
56
|
+
/** Bundled family names, each once, in {@link BUNDLED_FONTS} order. */
|
|
57
|
+
export declare const BUNDLED_FONT_FAMILIES: readonly string[];
|
|
58
|
+
/**
|
|
59
|
+
* Every file the corpus consists of — faces and licences alike, since a build
|
|
60
|
+
* that drops a licence is as wrong as one that drops a face (C7). This is what
|
|
61
|
+
* the bundle staging and the artifact check assert against.
|
|
62
|
+
*/
|
|
63
|
+
export declare const BUNDLED_FONT_FILES: readonly string[];
|
|
64
|
+
/**
|
|
65
|
+
* A family's faces, in catalog order. Empty for a family nothing bundles.
|
|
66
|
+
*/
|
|
67
|
+
export declare function bundledFacesFor(family: string): BundledFontFace[];
|
|
68
|
+
/** Whether `family` names one of the shipped faces. */
|
|
69
|
+
export declare function isBundledFamily(family: string | undefined): boolean;
|
|
70
|
+
/** What {@link resolveFontFamily} decided about a document's `fontFamily`. */
|
|
71
|
+
export interface ResolvedFontFamily {
|
|
72
|
+
/** The CSS family list to set on a context, always ending in `sans-serif`. */
|
|
73
|
+
family: string;
|
|
74
|
+
/** True when the head of the list is a face NodeTool ships (D8). */
|
|
75
|
+
portable: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Why a `fontFamily` cannot be authored as written, or null when it can.
|
|
79
|
+
*
|
|
80
|
+
* Only the generics are refused. A named system font stays authorable and is
|
|
81
|
+
* reported by the timeline validator as `font_not_portable` (D8) — the family
|
|
82
|
+
* exists somewhere, and pinning it may be exactly what the caller wants.
|
|
83
|
+
*/
|
|
84
|
+
export declare function fontFamilyRefusal(family: string | undefined): string | null;
|
|
85
|
+
/** Throw {@link fontFamilyRefusal} when a family cannot be authored. */
|
|
86
|
+
export declare function assertAuthorableFontFamily(family: string | undefined): void;
|
|
87
|
+
/**
|
|
88
|
+
* Turn a document's `fontFamily` into the family list every host draws with.
|
|
89
|
+
*
|
|
90
|
+
* A bundled family resolves to itself plus its generic; anything else keeps
|
|
91
|
+
* the name it was given and falls back to the bundled default, so a document
|
|
92
|
+
* authored against a system font still renders text on a host that lacks it
|
|
93
|
+
* rather than nothing at all. Either way the list ends in `sans-serif`, which
|
|
94
|
+
* is the last stop a canvas is guaranteed to have.
|
|
95
|
+
*/
|
|
96
|
+
export declare function resolveFontFamily(name: string | undefined): ResolvedFontFamily;
|
|
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,QAAQ,EAAE,OAAO,CAAC;CACnB;AA8BD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAW3E;AAED,wEAAwE;AACxE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAG3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,kBAAkB,CA2BpB"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The typefaces NodeTool ships, and the rule every host resolves a text
|
|
3
|
+
* clip's `fontFamily` through.
|
|
4
|
+
*
|
|
5
|
+
* A font family named in a document used to mean whatever the machine drawing
|
|
6
|
+
* the frame happened to have installed (F15): the editor preview, the server
|
|
7
|
+
* render and the agent's frame preview each resolved `Inter, Arial,
|
|
8
|
+
* sans-serif` against a different set of system fonts, so the same document
|
|
9
|
+
* produced three different pictures. A bundled corpus fixes the picture; a
|
|
10
|
+
* system font stays available and is reported as non-portable instead (D8).
|
|
11
|
+
*
|
|
12
|
+
* The files live in `packages/timeline/fonts/` next to their OFL licences
|
|
13
|
+
* (C7). Every one is registered in `@nodetool-ai/config`'s
|
|
14
|
+
* `PACKAGE_RUNTIME_ASSET_DIRS`, so `bundle-backend.mjs` stages the directory
|
|
15
|
+
* and `verify-backend-bundle.mjs` fails a build that ships without it (C6).
|
|
16
|
+
*
|
|
17
|
+
* Pure data plus string handling: this module is reachable from the package
|
|
18
|
+
* root, so it must not import anything (AS2). Registering the files with a
|
|
19
|
+
* canvas implementation is `register-node.ts`, which is not.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* The corpus. Ordered by how a title is most likely to be set — the default
|
|
23
|
+
* family first — because the fonts endpoint and the inspector picker list
|
|
24
|
+
* bundled faces in this order before the system ones.
|
|
25
|
+
*
|
|
26
|
+
* Weight ranges are read from each file's `fvar` table rather than from the
|
|
27
|
+
* family's documentation: a browser given a range wider than the axis clamps
|
|
28
|
+
* silently, and one given a narrower range refuses weights the file can draw.
|
|
29
|
+
*/
|
|
30
|
+
export const BUNDLED_FONTS = [
|
|
31
|
+
{
|
|
32
|
+
family: "Inter",
|
|
33
|
+
style: "normal",
|
|
34
|
+
weights: [100, 900],
|
|
35
|
+
file: "Inter-Variable.ttf",
|
|
36
|
+
license: "OFL-Inter.txt",
|
|
37
|
+
generic: "sans-serif"
|
|
38
|
+
},
|
|
39
|
+
// Skia picks the same bold outline for 600 and 800 in the variable file.
|
|
40
|
+
// These static instances were generated from it with fontTools varLib.instancer
|
|
41
|
+
// at wght=600 and wght=800, using --static --update-name-table.
|
|
42
|
+
{
|
|
43
|
+
family: "Inter",
|
|
44
|
+
style: "normal",
|
|
45
|
+
weights: [600, 600],
|
|
46
|
+
file: "Inter-SemiBold.ttf",
|
|
47
|
+
license: "OFL-Inter.txt",
|
|
48
|
+
generic: "sans-serif"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
family: "Inter",
|
|
52
|
+
style: "normal",
|
|
53
|
+
weights: [800, 800],
|
|
54
|
+
file: "Inter-ExtraBold.ttf",
|
|
55
|
+
license: "OFL-Inter.txt",
|
|
56
|
+
generic: "sans-serif"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
family: "Inter",
|
|
60
|
+
style: "italic",
|
|
61
|
+
weights: [100, 900],
|
|
62
|
+
file: "Inter-Italic-Variable.ttf",
|
|
63
|
+
license: "OFL-Inter.txt",
|
|
64
|
+
generic: "sans-serif"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
family: "Space Grotesk",
|
|
68
|
+
style: "normal",
|
|
69
|
+
weights: [300, 700],
|
|
70
|
+
file: "SpaceGrotesk-Variable.ttf",
|
|
71
|
+
license: "OFL-SpaceGrotesk.txt",
|
|
72
|
+
generic: "sans-serif"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
family: "Bebas Neue",
|
|
76
|
+
style: "normal",
|
|
77
|
+
weights: [400, 400],
|
|
78
|
+
file: "BebasNeue-Regular.ttf",
|
|
79
|
+
license: "OFL-BebasNeue.txt",
|
|
80
|
+
generic: "sans-serif"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
family: "Playfair Display",
|
|
84
|
+
style: "normal",
|
|
85
|
+
weights: [400, 900],
|
|
86
|
+
file: "PlayfairDisplay-Variable.ttf",
|
|
87
|
+
license: "OFL-PlayfairDisplay.txt",
|
|
88
|
+
generic: "serif"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
family: "Playfair Display",
|
|
92
|
+
style: "italic",
|
|
93
|
+
weights: [400, 900],
|
|
94
|
+
file: "PlayfairDisplay-Italic-Variable.ttf",
|
|
95
|
+
license: "OFL-PlayfairDisplay.txt",
|
|
96
|
+
generic: "serif"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
family: "Lora",
|
|
100
|
+
style: "normal",
|
|
101
|
+
weights: [400, 700],
|
|
102
|
+
file: "Lora-Variable.ttf",
|
|
103
|
+
license: "OFL-Lora.txt",
|
|
104
|
+
generic: "serif"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
family: "Lora",
|
|
108
|
+
style: "italic",
|
|
109
|
+
weights: [400, 700],
|
|
110
|
+
file: "Lora-Italic-Variable.ttf",
|
|
111
|
+
license: "OFL-Lora.txt",
|
|
112
|
+
generic: "serif"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
family: "JetBrains Mono",
|
|
116
|
+
style: "normal",
|
|
117
|
+
weights: [100, 800],
|
|
118
|
+
file: "JetBrainsMono-Variable.ttf",
|
|
119
|
+
license: "OFL-JetBrainsMono.txt",
|
|
120
|
+
generic: "monospace"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
family: "JetBrains Mono",
|
|
124
|
+
style: "italic",
|
|
125
|
+
weights: [100, 800],
|
|
126
|
+
file: "JetBrainsMono-Italic-Variable.ttf",
|
|
127
|
+
license: "OFL-JetBrainsMono.txt",
|
|
128
|
+
generic: "monospace"
|
|
129
|
+
}
|
|
130
|
+
];
|
|
131
|
+
/** The family a text style with no `fontFamily` is set in. */
|
|
132
|
+
export const DEFAULT_FONT_FAMILY = "Inter";
|
|
133
|
+
/** Bundled family names, each once, in {@link BUNDLED_FONTS} order. */
|
|
134
|
+
export const BUNDLED_FONT_FAMILIES = [
|
|
135
|
+
...new Set(BUNDLED_FONTS.map((face) => face.family))
|
|
136
|
+
];
|
|
137
|
+
/**
|
|
138
|
+
* Every file the corpus consists of — faces and licences alike, since a build
|
|
139
|
+
* that drops a licence is as wrong as one that drops a face (C7). This is what
|
|
140
|
+
* the bundle staging and the artifact check assert against.
|
|
141
|
+
*/
|
|
142
|
+
export const BUNDLED_FONT_FILES = [
|
|
143
|
+
...new Set(BUNDLED_FONTS.flatMap((face) => [face.file, face.license]))
|
|
144
|
+
].sort();
|
|
145
|
+
/** Case-insensitive family lookup, built once. */
|
|
146
|
+
const familiesByLowerName = new Map(BUNDLED_FONTS.map((face) => [face.family.toLowerCase(), face.family]));
|
|
147
|
+
/**
|
|
148
|
+
* A family's faces, in catalog order. Empty for a family nothing bundles.
|
|
149
|
+
*/
|
|
150
|
+
export function bundledFacesFor(family) {
|
|
151
|
+
const canonical = familiesByLowerName.get(family.trim().toLowerCase());
|
|
152
|
+
if (canonical === undefined)
|
|
153
|
+
return [];
|
|
154
|
+
return BUNDLED_FONTS.filter((face) => face.family === canonical);
|
|
155
|
+
}
|
|
156
|
+
/** Whether `family` names one of the shipped faces. */
|
|
157
|
+
export function isBundledFamily(family) {
|
|
158
|
+
if (family === undefined)
|
|
159
|
+
return false;
|
|
160
|
+
return familiesByLowerName.has(primaryFamilyOf(family).toLowerCase());
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The first family of a CSS family list. A document usually carries one name,
|
|
164
|
+
* but the old default was the stack `Inter, Arial, sans-serif` and saved
|
|
165
|
+
* documents still hold it, so the head of the list is what portability is
|
|
166
|
+
* decided on.
|
|
167
|
+
*/
|
|
168
|
+
function primaryFamilyOf(value) {
|
|
169
|
+
const head = value.split(",")[0] ?? "";
|
|
170
|
+
return head.trim().replace(/^["']|["']$/g, "").trim();
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A family name quoted for the `font` shorthand.
|
|
174
|
+
*
|
|
175
|
+
* The shorthand is parsed as a whole, so one unbalanced quote makes a canvas
|
|
176
|
+
* ignore the assignment and keep whatever font it last had — the wrong
|
|
177
|
+
* picture rather than an unstyled one. Quote characters and the semicolons
|
|
178
|
+
* that would end a declaration are therefore dropped, not escaped.
|
|
179
|
+
*/
|
|
180
|
+
function quoteFamily(family) {
|
|
181
|
+
const clean = family.replace(/["';]/g, "").trim();
|
|
182
|
+
if (clean === "")
|
|
183
|
+
return "";
|
|
184
|
+
return /^[A-Za-z][A-Za-z0-9-]*$/.test(clean) ? clean : `"${clean}"`;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Generic CSS families: names that select no typeface at all.
|
|
188
|
+
*
|
|
189
|
+
* `sans-serif` is not a font, it is "whatever this machine calls its default
|
|
190
|
+
* sans" — so a title set in it draws in one face in the editor preview,
|
|
191
|
+
* another in a server render, and a third on the reviewer's laptop. Unlike a
|
|
192
|
+
* named system font, there is no version of it that is right, which is why
|
|
193
|
+
* these are refused where a clip is authored rather than reported afterwards
|
|
194
|
+
* as `font_not_portable`.
|
|
195
|
+
*/
|
|
196
|
+
const GENERIC_FONT_FAMILIES = new Set([
|
|
197
|
+
"sans-serif",
|
|
198
|
+
"serif",
|
|
199
|
+
"monospace",
|
|
200
|
+
"cursive",
|
|
201
|
+
"fantasy",
|
|
202
|
+
"system-ui",
|
|
203
|
+
"ui-sans-serif",
|
|
204
|
+
"ui-serif",
|
|
205
|
+
"ui-monospace",
|
|
206
|
+
"ui-rounded",
|
|
207
|
+
"math",
|
|
208
|
+
"emoji",
|
|
209
|
+
"fangsong",
|
|
210
|
+
"-apple-system",
|
|
211
|
+
"blinkmacsystemfont"
|
|
212
|
+
]);
|
|
213
|
+
/**
|
|
214
|
+
* Why a `fontFamily` cannot be authored as written, or null when it can.
|
|
215
|
+
*
|
|
216
|
+
* Only the generics are refused. A named system font stays authorable and is
|
|
217
|
+
* reported by the timeline validator as `font_not_portable` (D8) — the family
|
|
218
|
+
* exists somewhere, and pinning it may be exactly what the caller wants.
|
|
219
|
+
*/
|
|
220
|
+
export function fontFamilyRefusal(family) {
|
|
221
|
+
if (family === undefined)
|
|
222
|
+
return null;
|
|
223
|
+
const head = primaryFamilyOf(family);
|
|
224
|
+
if (!GENERIC_FONT_FAMILIES.has(head.toLowerCase()))
|
|
225
|
+
return null;
|
|
226
|
+
return (`"${head}" names no typeface — it is whatever the machine drawing the ` +
|
|
227
|
+
"frame calls its default, so the editor preview, the render and the " +
|
|
228
|
+
"agent's frame preview each pick their own. Set a family NodeTool ships: " +
|
|
229
|
+
`${BUNDLED_FONT_FAMILIES.join(", ")}. Omit fontFamily to get ` +
|
|
230
|
+
`${DEFAULT_FONT_FAMILY}.`);
|
|
231
|
+
}
|
|
232
|
+
/** Throw {@link fontFamilyRefusal} when a family cannot be authored. */
|
|
233
|
+
export function assertAuthorableFontFamily(family) {
|
|
234
|
+
const refusal = fontFamilyRefusal(family);
|
|
235
|
+
if (refusal !== null)
|
|
236
|
+
throw new Error(refusal);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Turn a document's `fontFamily` into the family list every host draws with.
|
|
240
|
+
*
|
|
241
|
+
* A bundled family resolves to itself plus its generic; anything else keeps
|
|
242
|
+
* the name it was given and falls back to the bundled default, so a document
|
|
243
|
+
* authored against a system font still renders text on a host that lacks it
|
|
244
|
+
* rather than nothing at all. Either way the list ends in `sans-serif`, which
|
|
245
|
+
* is the last stop a canvas is guaranteed to have.
|
|
246
|
+
*/
|
|
247
|
+
export function resolveFontFamily(name) {
|
|
248
|
+
const requested = primaryFamilyOf(name ?? "");
|
|
249
|
+
if (requested === "") {
|
|
250
|
+
return {
|
|
251
|
+
family: `${quoteFamily(DEFAULT_FONT_FAMILY)}, sans-serif`,
|
|
252
|
+
portable: true
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
const canonical = familiesByLowerName.get(requested.toLowerCase());
|
|
256
|
+
if (canonical !== undefined) {
|
|
257
|
+
const generic = bundledFacesFor(canonical)[0]?.generic ?? "sans-serif";
|
|
258
|
+
const stack = [quoteFamily(canonical)];
|
|
259
|
+
if (generic !== "sans-serif")
|
|
260
|
+
stack.push(generic);
|
|
261
|
+
stack.push("sans-serif");
|
|
262
|
+
return { family: stack.join(", "), portable: true };
|
|
263
|
+
}
|
|
264
|
+
const quoted = quoteFamily(requested);
|
|
265
|
+
if (quoted === "") {
|
|
266
|
+
return {
|
|
267
|
+
family: `${quoteFamily(DEFAULT_FONT_FAMILY)}, sans-serif`,
|
|
268
|
+
portable: true
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
family: `${quoted}, ${quoteFamily(DEFAULT_FONT_FAMILY)}, sans-serif`,
|
|
273
|
+
portable: false
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/fonts/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA4BH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B;IACvD;QACE,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,QAAQ;QACf,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QACnB,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,YAAY;KACtB;IACD,yEAAyE;IACzE,gFAAgF;IAChF,gEAAgE;IAChE;QACE,MAAM,EAA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