dsh-drawai 0.3.3 → 0.4.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/LICENSE +4142 -0
- package/README.md +43 -10
- package/lib/audio-media.js +147 -0
- package/lib/audio-service.js +66 -0
- package/lib/canvas-format.js +134 -0
- package/lib/client.js +5283 -223
- package/lib/comfyui-default-workflow.mjs +1825 -0
- package/lib/comfyui-workflow.mjs +426 -0
- package/lib/document-commands.js +12 -0
- package/lib/document-core.js +29 -0
- package/lib/drawing-tasks.js +26 -0
- package/lib/imagegen.mjs +596 -0
- package/lib/index.js +1758 -129
- package/lib/media.js +26 -13
- package/lib/mgstyle-core.js +75 -0
- package/lib/motion/apply.js +180 -0
- package/lib/motion/asset-pack-lock.js +10 -0
- package/lib/motion/asset-pack.js +335 -0
- package/lib/motion/assets.js +290 -0
- package/lib/motion/audio.js +103 -0
- package/lib/motion/audiolevel.js +63 -0
- package/lib/motion/audiomix.js +144 -0
- package/lib/motion/beats.js +337 -0
- package/lib/motion/builtin-assets.js +62 -0
- package/lib/motion/canvas-spec.js +442 -0
- package/lib/motion/capture.js +95 -0
- package/lib/motion/cards.js +80 -0
- package/lib/motion/collect.js +447 -0
- package/lib/motion/delivery.js +112 -0
- package/lib/motion/edge-speech.py +90 -0
- package/lib/motion/entry.jsx +73 -0
- package/lib/motion/export.js +200 -0
- package/lib/motion/ffmpeg.js +42 -0
- package/lib/motion/fonts.js +71 -0
- package/lib/motion/jobs.js +113 -0
- package/lib/motion/json.js +4 -0
- package/lib/motion/media-catalog.js +59 -0
- package/lib/motion/mgstyles/BRIEF-TEMPLATE.md +63 -0
- package/lib/motion/mgstyles/briefs/01-flat-vector.md +104 -0
- package/lib/motion/mgstyles/briefs/02-line-art.md +97 -0
- package/lib/motion/mgstyles/briefs/03-isometric.md +108 -0
- package/lib/motion/mgstyles/briefs/05-cel-boil.md +145 -0
- package/lib/motion/mgstyles/briefs/06-collage.md +149 -0
- package/lib/motion/mgstyles/briefs/07-liquid.md +106 -0
- package/lib/motion/mgstyles/briefs/08-morph.md +111 -0
- package/lib/motion/mgstyles/briefs/09-bauhaus.md +150 -0
- package/lib/motion/mgstyles/briefs/10-synthwave.md +151 -0
- package/lib/motion/mgstyles/briefs/12-aurora-glass.md +147 -0
- package/lib/motion/mgstyles/briefs/18-hanazi.md +140 -0
- package/lib/motion/mgstyles/briefs/19-paperclip.md +156 -0
- package/lib/motion/mgstyles/briefs/20-pixel.md +118 -0
- package/lib/motion/mgstyles/briefs/22-hud.md +118 -0
- package/lib/motion/mgstyles/catalog.d/01-flat-vector.json +34 -0
- package/lib/motion/mgstyles/catalog.d/02-line-art.json +34 -0
- package/lib/motion/mgstyles/catalog.d/03-isometric.json +35 -0
- package/lib/motion/mgstyles/catalog.d/05-cel-boil.json +28 -0
- package/lib/motion/mgstyles/catalog.d/06-collage.json +28 -0
- package/lib/motion/mgstyles/catalog.d/07-liquid.json +28 -0
- package/lib/motion/mgstyles/catalog.d/08-morph.json +28 -0
- package/lib/motion/mgstyles/catalog.d/09-bauhaus.json +28 -0
- package/lib/motion/mgstyles/catalog.d/10-synthwave.json +28 -0
- package/lib/motion/mgstyles/catalog.d/12-aurora-glass.json +28 -0
- package/lib/motion/mgstyles/catalog.d/18-hanazi.json +28 -0
- package/lib/motion/mgstyles/catalog.d/19-paperclip.json +28 -0
- package/lib/motion/mgstyles/catalog.d/20-pixel.json +28 -0
- package/lib/motion/mgstyles/catalog.d/22-hud.json +28 -0
- package/lib/motion/mgstyles/catalog.json +1356 -0
- package/lib/motion/mgstyles/upstream/README.md +147 -0
- package/lib/motion/mgstyles/upstream/README.zh-CN.md +147 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/cues.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/index.html +712 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/cues.json +331 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/film.js +676 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/tools/dump_timing.mjs +26 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/cues.json +109 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/index.html +25 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/anim.js +82 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/main.js +219 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/night5.js +180 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/render.js +202 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title.js +167 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title5.js +294 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/ui.js +141 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/world.js +1399 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/cues.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/index.html +34 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/engine.js +326 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/scene.js +2036 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/assets/gen/layout.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/cues.json +80 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/index.html +889 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/cues.json +100 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/index.html +108 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/engine.js +153 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/links.js +64 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/lookdev.js +46 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/scene.js +963 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/shaders.js +647 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/textsdf.js +114 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/type.js +50 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/cues.json +131 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/glyphs.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/index.html +901 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/cues.json +270 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/film.js +697 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/index.html +12 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/cues.json +44 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/index.html +1028 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/cues.json +67 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/index.html +16 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/main.js +967 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/shaders.js +468 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/cues.json +117 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/index.html +541 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/countries-110m.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/stickers/meta.json +34 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/cues.json +285 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/index.html +599 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/cues.json +42 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/film.js +914 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/cues.json +108 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/index.html +125 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/holo.js +275 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/hud.js +855 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/post.js +150 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/util.js +65 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/v5.js +142 -0
- package/lib/motion/mgstyles/upstream/harness/render.mjs +319 -0
- package/lib/motion/mgstyles/upstream/manifest.json +269 -0
- package/lib/motion/mgstyles/upstream/prompts/01-flat-vector.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/02-line-art.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/03-isometric.md +97 -0
- package/lib/motion/mgstyles/upstream/prompts/05-cel-boil.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/06-collage.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/07-liquid.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/08-morph.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/09-bauhaus.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/10-synthwave.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/12-aurora-glass.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/18-hanazi.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/19-paperclip.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/20-pixel.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/22-hud.md +95 -0
- package/lib/motion/mgstyles/upstream/rubric.md +51 -0
- package/lib/motion/mgstyles/upstream/template.md +36 -0
- package/lib/motion/pixelqa.js +198 -0
- package/lib/motion/preview.js +95 -0
- package/lib/motion/project.js +395 -0
- package/lib/motion/qa.js +290 -0
- package/lib/motion/reference-media.jsx +10 -0
- package/lib/motion/render-settings.js +112 -0
- package/lib/motion/render.js +159 -0
- package/lib/motion/scene-kit.js +183 -0
- package/lib/motion/sfx.js +232 -0
- package/lib/motion/shotcraft/ClipCard.tsx +204 -0
- package/lib/motion/shotcraft/catalog.json +2461 -0
- package/lib/motion/shotcraft/upstream/SKILL.md +286 -0
- package/lib/motion/shotcraft/upstream/assets/lib/Caption.tsx +54 -0
- package/lib/motion/shotcraft/upstream/assets/lib/ClipCard.tsx +200 -0
- package/lib/motion/shotcraft/upstream/assets/lib/DigitRoll.tsx +45 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlashCut.tsx +20 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlatPanel.tsx +65 -0
- package/lib/motion/shotcraft/upstream/assets/lib/PageCam.tsx +151 -0
- package/lib/motion/shotcraft/upstream/assets/lib/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/camera.tsx +75 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/motion.ts +40 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/rand.ts +11 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/shake.ts +10 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/__pycache__/sfx-source.cpython-313.pyc +0 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/build-readme-cover.mjs +49 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/capture-template.mjs +210 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/sfx-source.py +423 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/smoke-render-demos.py +170 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/test_sfx_source.py +157 -0
- package/lib/motion/shotcraft/upstream/demos/README.md +120 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Brand.tsx +112 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Fixtures.tsx +647 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Look.tsx +316 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Motion.tsx +82 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/PageCam2D.tsx +115 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Polish.tsx +243 -0
- package/lib/motion/shotcraft/upstream/demos/_textures/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/demos/camera/basic-3d-scene/Basic3DScene.tsx +250 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashImpactReal.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashZoomReal.tsx +246 -0
- package/lib/motion/shotcraft/upstream/demos/camera/cursor-flyover/CursorFlyover.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/camera/depth-layer-moves/MultiplaneReal.tsx +138 -0
- package/lib/motion/shotcraft/upstream/demos/camera/graze-face-tour/GrazeFaceTour.tsx +542 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/OverheadTabletopDrop.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/TiltReveal.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/DroneDiveLanding.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/ExplodedView.tsx +348 -0
- package/lib/motion/shotcraft/upstream/demos/camera/steep-tilt-glide/SteepTiltGlide.tsx +366 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/BulletTimeFreezeOrbit.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/PullBackIsolation.tsx +184 -0
- package/lib/motion/shotcraft/upstream/demos/camera/terminal-3d/Terminal3D.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/data/before-after-slider-scrub/BeforeAfterSliderScrub.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/AxisRescaleShockV2.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/OscilloscopeStreamV2.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/UnitDotSwarmRegroupV2.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/NeedleSweepSelftest.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/TapeScrollFixedPointer.tsx +215 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/BrakeReticleLock.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/ChangelogScrollBrake.tsx +232 -0
- package/lib/motion/shotcraft/upstream/demos/data/timeline-travel/TimelineTravel.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/effects/assemble-then-type-flyin/AssembleThenTypeFlyin.tsx +273 -0
- package/lib/motion/shotcraft/upstream/demos/effects/aurora-bloom-bg-flip/AuroraBloomBgFlip.tsx +167 -0
- package/lib/motion/shotcraft/upstream/demos/effects/brand-frame-snap/BrandFrameSnap.tsx +536 -0
- package/lib/motion/shotcraft/upstream/demos/effects/fui-hud-moves/ReticleLockOn.tsx +164 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/FlylineArc.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/GlowOrbAmbient.tsx +197 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/OrbFlylineRelay.tsx +241 -0
- package/lib/motion/shotcraft/upstream/demos/effects/icon-performance-moves/AttentionBounce.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/AnimeImpact.tsx +230 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/HitCounter.tsx +345 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SheenSweepRetry.tsx +275 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SpotlightSweepReveal.tsx +229 -0
- package/lib/motion/shotcraft/upstream/demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/effects/riso-print-hits/RisoMisregistrationHit.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scan-bracket-sweep/ScanBracketSweep.tsx +295 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-annotate-focus/ScanlineAnnotateFocus.tsx +329 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-assemble-flyin/ScanlineAssembleFlyin.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ImpactBurstKit.tsx +264 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/KanadaPerspectiveSnap.tsx +260 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ScoreSlam.tsx +263 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/CornerSpotlightReveal.tsx +123 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/GlowWakeSleepPanel.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/SlideSpotlightPan.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/autolayout-gap-dial/AutolayoutGapDial.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/DiagramCascadeBuild.tsx +350 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/PanelToCanvasMaterialize.tsx +352 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/chip-grid-single-select-blackout/ChipGridSingleSelectBlackout.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/collab-cursor-moves/CursorCastEnsemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/glass-pill-dictation-typing/GlassPillDictationTyping.tsx +157 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/hashtag-to-pill-materialize/HashtagToPillMaterialize.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/picker-carousel-feature-cycle/PickerCarouselFeatureCycle.tsx +202 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/segmented-thumb-hero/SegmentedThumbHero.tsx +265 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/PaletteThemeRipple.tsx +457 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/ThemeSweepToggle.tsx +446 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/type-and-filter/TypeAndFilter.tsx +249 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/voice-waveform-live/VoiceWaveformLive.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/opening/crane-rise-reveal/CraneRiseReveal.tsx +332 -0
- package/lib/motion/shotcraft/upstream/demos/opening/dataviz-landscape-open/DatavizLandscapeOpen.tsx +358 -0
- package/lib/motion/shotcraft/upstream/demos/opening/fracture/Fracture.tsx +201 -0
- package/lib/motion/shotcraft/upstream/demos/opening/icon-field-colorize/IconFieldColorize.tsx +200 -0
- package/lib/motion/shotcraft/upstream/demos/opening/letterspace-materialize/LetterspaceMaterialize.tsx +208 -0
- package/lib/motion/shotcraft/upstream/demos/opening/magician-card-flourish/MagicianCardFlourish.tsx +341 -0
- package/lib/motion/shotcraft/upstream/demos/opening/orbit-ring-title-open/OrbitRingTitleOpen.tsx +389 -0
- package/lib/motion/shotcraft/upstream/demos/opening/spotlight-hero-card/SpotlightHeroCard.tsx +293 -0
- package/lib/motion/shotcraft/upstream/demos/opening/stroke-segment-build/StrokeSegmentBuild.tsx +183 -0
- package/lib/motion/shotcraft/upstream/demos/opening/text-as-mask/TextAsMask.tsx +245 -0
- package/lib/motion/shotcraft/upstream/demos/outro/grain-dissolve/GrainDissolve.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/outro/logo-shrink-wordmark-lockup/LogoShrinkWordmarkLockup.tsx +223 -0
- package/lib/motion/shotcraft/upstream/demos/outro/neon-triple-marquee/NeonTripleMarquee.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/outro/outro-group-photo-launch/OutroGroupPhotoLaunch.tsx +343 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-strip-away-outro/UiStripAwayOutro.tsx +357 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/IconFlipBloomLogo.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/InputMorphsIntoLogo.tsx +333 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-cut-moves/PaparazziFlash.tsx +274 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-step-list-theme-cycle/BeatStepListThemeCycle.tsx +270 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/panel-grid-moves/ComicPanelSplit.tsx +430 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/quad-split-parallel-scenes/QuadSplitParallelScenes.tsx +252 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/rhythm-interrupt-moves/JumpCutPunchIn.tsx +106 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/sakuga-timing-shift/SakugaTimingShift.tsx +288 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/speed-ramp-freeze/FreezeAnnotateReal.tsx +362 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/trailer-grammar-moves/TrailerBumper.tsx +168 -0
- package/lib/motion/shotcraft/upstream/demos/transition/bottom-push-stack-wipe/BottomPushStackWipe.tsx +310 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flip-reveal/CardFlipReveal.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flock-tumble/CardFlockTumble.tsx +459 -0
- package/lib/motion/shotcraft/upstream/demos/transition/circle-match-iris/CircleMatchIris.tsx +294 -0
- package/lib/motion/shotcraft/upstream/demos/transition/gradient-transition/GradientTransition.tsx +161 -0
- package/lib/motion/shotcraft/upstream/demos/transition/line-carry-transition/LineCarryTransition.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/mosaic-reframe/MosaicReframe.tsx +359 -0
- package/lib/motion/shotcraft/upstream/demos/transition/page-turn-transitions/BarnDoorSplit.tsx +227 -0
- package/lib/motion/shotcraft/upstream/demos/transition/print-texture-transitions/InkBleedReveal.tsx +162 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/PortalWipeV2.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/WhipBrakeReal.tsx +186 -0
- package/lib/motion/shotcraft/upstream/demos/transition/tear-streak-transitions/GlitchDisplace.tsx +355 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/InvisibleCut.tsx +272 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/LightLeakBurn.tsx +262 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/VersusSlam.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-travel/LetterformZoom.tsx +285 -0
- package/lib/motion/shotcraft/upstream/demos/transition/white-flash-logo-simplify-cut/WhiteFlashLogoSimplifyCut.tsx +205 -0
- package/lib/motion/shotcraft/upstream/demos/transition/wipe-transitions/BlindsSlice.tsx +178 -0
- package/lib/motion/shotcraft/upstream/demos/typography/blur-slide/BlurSlide.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brace-expand/BraceExpand.tsx +143 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brand-ink-open/BrandInkOpen.tsx +134 -0
- package/lib/motion/shotcraft/upstream/demos/typography/countdown-arc-scatter/CountdownArcScatter.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/typography/flying-words/FlyingWords.tsx +198 -0
- package/lib/motion/shotcraft/upstream/demos/typography/glitch-cycle/GlitchCycle.tsx +221 -0
- package/lib/motion/shotcraft/upstream/demos/typography/gradient-word-sweep/GradientWordSweep.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/typography/lead-word-zoom-assemble/LeadWordZoomAssemble.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/typography/marker-underline-title/MarkerUnderlineTitle.tsx +121 -0
- package/lib/motion/shotcraft/upstream/demos/typography/outline-word-fill/OutlineWordFill.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/typography/paper-title-card/PaperTitleCard.tsx +179 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-chip-slot-cycle-handled/PillChipSlotCycleHandled.tsx +140 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-slot-cycle/PillSlotCycle.tsx +309 -0
- package/lib/motion/shotcraft/upstream/demos/typography/text-column-converge/TextColumnConverge.tsx +191 -0
- package/lib/motion/shotcraft/upstream/demos/typography/title-demote-to-label/TitleDemoteToLabel.tsx +292 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/LetterformDriftAssembly.tsx +135 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/SplitTextStagger.tsx +124 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/TextOnPath.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-entrance-moves/LetterDropPhysics.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/FontWeightPump.tsx +225 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/KaraokeFillSync.tsx +141 -0
- package/lib/motion/shotcraft/upstream/demos/typography/typewriter-moves/TypewriterErrorRetype.tsx +137 -0
- package/lib/motion/shotcraft/upstream/demos/typography/vertical-word-roll-blur-cycle/VerticalWordRollBlurCycle.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-filmstrip/WordRelayFilmstrip.tsx +409 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-geometry/WordRelayGeometry.tsx +280 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/avatar-bracket-carousel/AvatarBracketCarousel.tsx +271 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/bezier-source-converge-merge/BezierSourceConvergeMerge.tsx +385 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/card-stack/CardStack.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/carousel-3d/Carousel3D.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/clipcard-looping/ClipCardLooping.tsx +77 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/cloner-depth-echo/ClonerDepthEcho.tsx +311 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/deck-deal-flyin/DeckDealFlyin.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/doc-park-left-pill-deal/DocParkLeftPillDeal.tsx +349 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/document-typewriter-reveal/DocumentTypewriterReveal.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/draw-svg-trace/DrawSvgTrace.tsx +244 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/element-body-moves/ContactShadowLift.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/integration-hub-map/IntegrationHubMap.tsx +652 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-reveal/ListReveal.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-stack-press/ListStackPress.tsx +238 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-forerun/NeonFrameForerun.tsx +324 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-orbit-drop/NeonFrameForerunOrbit.tsx +354 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/PageWaterfallWall.tsx +101 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/product-card-progressive-assemble/ProductCardProgressiveAssemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/radial-wave/RadialWave.tsx +57 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/research-card-stack-scroll/ResearchCardStackScroll.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/row-embed/RowEmbed.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/value-stagger-gradient/ValueStaggerGradient.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/BentoLightUp.tsx +146 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/WireframeDrawOn.tsx +226 -0
- package/lib/motion/shotcraft/upstream/gallery/api/library.json +1 -0
- package/lib/motion/shotcraft/upstream/manifest.json +2715 -0
- package/lib/motion/shotcraft/upstream/references/aesthetic-rules.md +193 -0
- package/lib/motion/shotcraft/upstream/references/final-review.md +121 -0
- package/lib/motion/shotcraft/upstream/references/guided-free-creation.md +199 -0
- package/lib/motion/shotcraft/upstream/references/jianying-export.md +183 -0
- package/lib/motion/shotcraft/upstream/references/music-beat-sync.md +257 -0
- package/lib/motion/shotcraft/upstream/references/pipeline.md +382 -0
- package/lib/motion/shotcraft/upstream/references/publish-upload-post.md +111 -0
- package/lib/motion/shotcraft/upstream/references/sequences/promo-energy-arc.md +50 -0
- package/lib/motion/shotcraft/upstream/references/sfx-sourcing.md +95 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/basic-3d-scene.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/crash-zoom-punch.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/cursor-flyover.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/depth-layer-moves.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/graze-face-tour.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/overhead-camera-moves.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/space-camera-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/steep-tilt-glide.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/tension-camera-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/terminal-3d.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/before-after-slider-scrub.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/chart-live-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/gauge-readout-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/scroll-brake-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/timeline-travel.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/assemble-then-type-flyin.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/aurora-bloom-bg-flip.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/brand-frame-snap.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/fui-hud-moves.md +35 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/glow-flyline-moves.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/icon-performance-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/impact-feedback.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/light-play-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/radial-ripple-phone-chips.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/riso-print-hits.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scan-bracket-sweep.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-annotate-focus.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-assemble-flyin.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/slam-entrance-moves.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/spotlight-sweep-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/autolayout-gap-dial.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/canvas-materialize-moves.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/chip-grid-single-select-blackout.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/collab-cursor-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/glass-pill-dictation-typing.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/hashtag-to-pill-materialize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/picker-carousel-feature-cycle.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/segmented-thumb-hero.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/theme-switch-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/type-and-filter.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/voice-waveform-live.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/brand-ink-open.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/crane-rise-reveal.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/dataviz-landscape-open.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/fracture.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/icon-field-colorize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/letterspace-materialize.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/magician-card-flourish.md +73 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/orbit-ring-title-open.md +87 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/spotlight-hero-card.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/stroke-segment-build.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/text-as-mask.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/grain-dissolve.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/logo-shrink-wordmark-lockup.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/neon-triple-marquee.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/outro-group-photo-launch.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-strip-away-outro.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-to-brand-morph.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-cut-moves.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-step-list-theme-cycle.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/panel-grid-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/quad-split-parallel-scenes.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/rhythm-interrupt-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/sakuga-timing-shift.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/speed-ramp-freeze.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/trailer-grammar-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/bottom-push-stack-wipe.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flip-reveal.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flock-tumble.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/circle-match-iris.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/gradient-transition.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/line-carry-transition.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/mosaic-reframe.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/page-turn-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/print-texture-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/shot-transitions.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/tear-streak-transitions.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-hidden-cut.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-travel.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/white-flash-logo-simplify-cut.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/wipe-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/blur-slide.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/brace-expand.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/countdown-arc-scatter.md +65 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/document-typewriter-reveal.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/flying-words.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/glitch-cycle.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/gradient-word-sweep.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/lead-word-zoom-assemble.md +91 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/marker-underline-title.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/outline-word-fill.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/paper-title-card.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-chip-slot-cycle-handled.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-slot-cycle.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/text-column-converge.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/title-demote-to-label.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-assembly-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-entrance-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-rhythm-sync.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/typewriter-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/vertical-word-roll-blur-cycle.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-filmstrip.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-geometry.md +75 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/avatar-bracket-carousel.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/bezier-source-converge-merge.md +67 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/card-stack.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/carousel-3d.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/cloner-depth-echo.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/deck-deal-flyin.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/doc-park-left-pill-deal.md +62 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/draw-svg-trace.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/element-body-moves.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/integration-hub-map.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-reveal.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-stack-press.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-forerun.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-orbit-drop.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/page-waterfall-wall.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/product-card-progressive-assemble.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/radial-wave.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/research-card-stack-scroll.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/row-embed.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/value-stagger-gradient.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/wall-reveal-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/sound-design.md +170 -0
- package/lib/motion/shotcraft/upstream/references/workbench.md +157 -0
- package/lib/motion/shotcraft/upstream/template/TEMPLATE.md +103 -0
- package/lib/motion/shotcraft/upstream/template/THEMES.md +44 -0
- package/lib/motion/shotcraft/upstream/template/package.json +20 -0
- package/lib/motion/shotcraft/upstream/template/remotion.config.ts +6 -0
- package/lib/motion/shotcraft/upstream/template/src/Root.tsx +17 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Caption.tsx +65 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/DigitRoll.tsx +48 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/FlashCut.tsx +24 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Main.tsx +192 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/PaperTitleCard.tsx +111 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/PageCam.tsx +150 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneDetail.tsx +158 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneFlyIn.tsx +468 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOpen.tsx +552 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOutroLive.tsx +411 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/ScenePapers.tsx +200 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneWbr.tsx +324 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/template/src/index.ts +4 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/ThemedFilm.tsx +7 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/manifest.tsx +68 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.json +1 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.ts +24 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palettes.json +74 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/visual-theme.tsx +91 -0
- package/lib/motion/shotcraft/upstream/template/src/workbench.ts +213 -0
- package/lib/motion/shotcraft/upstream/template/tsconfig.json +15 -0
- package/lib/motion/spec.js +113 -0
- package/lib/motion/style-engine.js +153 -0
- package/lib/motion/style-frames.js +268 -0
- package/lib/motion/sync.js +214 -0
- package/lib/motion/theme.js +121 -0
- package/lib/motion/voice.js +417 -0
- package/lib/motion-agent-files.js +82 -0
- package/lib/motion-agent-protocol.js +66 -0
- package/lib/motion-agent-tools.js +196 -0
- package/lib/motion-agent.js +171 -0
- package/lib/motion-capture.js +92 -0
- package/lib/motion-core.js +238 -0
- package/lib/motion-film-review.js +71 -0
- package/lib/motion-library.js +210 -0
- package/lib/motion-planner.js +254 -0
- package/lib/motion-project.js +80 -0
- package/lib/motion-render-worker.js +145 -0
- package/lib/motion-session.js +32 -0
- package/lib/motion-source.js +49 -0
- package/lib/motion-tasks.js +452 -0
- package/lib/motion-vision.js +43 -0
- package/lib/mxfile.js +27 -7
- package/lib/routing/node-runtime.js +14 -0
- package/lib/routing/router.js +211 -0
- package/lib/routing/vendor/README.md +96 -0
- package/lib/routing/vendor/libavoid-routing.js +753 -0
- package/lib/routing/vendor/libavoid.min.js +59 -0
- package/lib/shotcard-core.js +39 -0
- package/lib/shotcard-reference.js +56 -0
- package/lib/style-kernel.js +37 -3
- package/lib/task-patches.js +26 -2
- package/lib/video-export.js +17 -2
- package/package.json +29 -4
package/lib/media.js
CHANGED
|
@@ -46,7 +46,7 @@ const MEDIA_DATA_KEYS = ['drawaiMedia', 'mediaKind', 'mediaClip', 'mediaFps', 'm
|
|
|
46
46
|
/** 从画布路径得到 stem(去掉 .drawio)。 */
|
|
47
47
|
export function drawioStem(drawioPath) {
|
|
48
48
|
const base = basename(String(drawioPath || ''))
|
|
49
|
-
return base.replace(/\.drawio$/i, '') || 'canvas'
|
|
49
|
+
return base.replace(/\.(?:drawio|drawai)$/i, '') || 'canvas'
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/** `foo.drawio` → `…/foo.media`(绝对或相对,跟随入参形态)。 */
|
|
@@ -54,7 +54,8 @@ export function mediaRootFor(drawioPath) {
|
|
|
54
54
|
const p = String(drawioPath || '')
|
|
55
55
|
const dir = dirname(p)
|
|
56
56
|
const stem = drawioStem(p)
|
|
57
|
-
|
|
57
|
+
const suffix = /\.drawai$/i.test(p) ? '.drawai.media' : MEDIA_DIR_SUFFIX
|
|
58
|
+
return dir === '.' ? stem + suffix : join(dir, stem + suffix)
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
/** clip 目录:`…/foo.media/clip-a` */
|
|
@@ -162,7 +163,11 @@ export function emptyManifest(opts) {
|
|
|
162
163
|
function syncDuration(manifest) {
|
|
163
164
|
const frames = Array.isArray(manifest.frames) ? manifest.frames.length : 0
|
|
164
165
|
const fps = Number(manifest.fps)
|
|
165
|
-
|
|
166
|
+
// 有逐帧清单时以清单为准;没有清单(raster clip pack 就是这种)就保留写进来的时长。
|
|
167
|
+
// 以前这里无条件用 frames/fps 覆盖,于是 applyFilm 写下的 12.1s 被抹成 0 —— "不看 <video>
|
|
168
|
+
// metadata 也知道多长"这个用途就永远拿不到真值。
|
|
169
|
+
if (frames > 0 && Number.isFinite(fps) && fps > 0) manifest.duration = frames / fps
|
|
170
|
+
else if (!(Number(manifest.duration) > 0)) manifest.duration = 0
|
|
166
171
|
return manifest
|
|
167
172
|
}
|
|
168
173
|
|
|
@@ -183,6 +188,7 @@ export function normalizeManifest(raw) {
|
|
|
183
188
|
frames.push({ file: file, t: Number.isFinite(t) ? t : i / (Number.isFinite(fps) && fps > 0 ? fps : DEFAULT_MEDIA_FPS) })
|
|
184
189
|
}
|
|
185
190
|
}
|
|
191
|
+
const duration = Number(raw.duration)
|
|
186
192
|
return syncDuration({
|
|
187
193
|
version: Number(raw.version) || MEDIA_VERSION,
|
|
188
194
|
kind: raw.kind === 'raster' ? 'raster' : 'svg',
|
|
@@ -192,7 +198,7 @@ export function normalizeManifest(raw) {
|
|
|
192
198
|
source: typeof raw.source === 'string' && raw.source.length > 0 ? raw.source.replace(/\\/g, '/') : null,
|
|
193
199
|
sourceOffset: Number.isFinite(Number(raw.sourceOffset)) && Number(raw.sourceOffset) >= 0 ? Number(raw.sourceOffset) : 0,
|
|
194
200
|
frames: frames,
|
|
195
|
-
duration: 0,
|
|
201
|
+
duration: Number.isFinite(duration) && duration > 0 ? duration : 0,
|
|
196
202
|
})
|
|
197
203
|
}
|
|
198
204
|
|
|
@@ -395,8 +401,14 @@ export function collectReferencedClips(doc) {
|
|
|
395
401
|
const used = new Set()
|
|
396
402
|
if (doc === null || typeof doc !== 'object' || Array.isArray(doc.nodes) === false) return used
|
|
397
403
|
for (let i = 0; i < doc.nodes.length; i += 1) {
|
|
404
|
+
const audioClip=doc.nodes[i].data?.drawaiAudio==='1'&&sanitizeClipId(doc.nodes[i].data.audioClip)
|
|
405
|
+
if(audioClip)used.add(audioClip)
|
|
398
406
|
const meta = videoMetaFromData(doc.nodes[i].data)
|
|
399
407
|
if (meta !== null && meta.clip !== null) used.add(meta.clip)
|
|
408
|
+
for (const result of Array.isArray(doc.nodes[i].data?.motion?.results) ? doc.nodes[i].data.motion.results : []) {
|
|
409
|
+
const clip = sanitizeClipId(result.clip)
|
|
410
|
+
if (clip) used.add(clip)
|
|
411
|
+
}
|
|
400
412
|
}
|
|
401
413
|
return used
|
|
402
414
|
}
|
|
@@ -551,11 +563,11 @@ export function packCanvasBundle(drawioPath) {
|
|
|
551
563
|
const stem = drawioStem(drawioPath)
|
|
552
564
|
const files = []
|
|
553
565
|
if (existsSync(drawioPath) === false) throw new Error('drawio not found: ' + drawioPath)
|
|
554
|
-
files.push({ name: stem + '.drawio', data: readFileSync(drawioPath) })
|
|
566
|
+
files.push({ name: stem + (/\.drawai$/i.test(drawioPath) ? '.drawai' : '.drawio'), data: readFileSync(drawioPath) })
|
|
555
567
|
const mediaRoot = mediaRootFor(drawioPath)
|
|
556
568
|
if (existsSync(mediaRoot)) {
|
|
557
569
|
const mediaFiles = []
|
|
558
|
-
walkFiles(mediaRoot,
|
|
570
|
+
walkFiles(mediaRoot, basename(mediaRoot), mediaFiles)
|
|
559
571
|
for (let i = 0; i < mediaFiles.length; i += 1) files.push(mediaFiles[i])
|
|
560
572
|
}
|
|
561
573
|
return buildZip(files)
|
|
@@ -567,29 +579,30 @@ export function unpackCanvasBundle(zipBuffer, destDir, preferredStem) {
|
|
|
567
579
|
if (entries.length === 0) throw new Error('empty zip')
|
|
568
580
|
let drawioEntry = null
|
|
569
581
|
for (let i = 0; i < entries.length; i += 1) {
|
|
570
|
-
if (/\.drawio$/i.test(entries[i].name) && entries[i].name.indexOf('/') < 0) {
|
|
582
|
+
if (/\.(?:drawio|drawai)$/i.test(entries[i].name) && entries[i].name.indexOf('/') < 0) {
|
|
571
583
|
drawioEntry = entries[i]
|
|
572
584
|
break
|
|
573
585
|
}
|
|
574
586
|
}
|
|
575
587
|
if (drawioEntry === null) {
|
|
576
588
|
for (let i = 0; i < entries.length; i += 1) {
|
|
577
|
-
if (/\.drawio$/i.test(entries[i].name)) {
|
|
589
|
+
if (/\.(?:drawio|drawai)$/i.test(entries[i].name)) {
|
|
578
590
|
drawioEntry = entries[i]
|
|
579
591
|
break
|
|
580
592
|
}
|
|
581
593
|
}
|
|
582
594
|
}
|
|
583
595
|
if (drawioEntry === null) throw new Error('zip 里没有 .drawio')
|
|
584
|
-
const stem = preferredStem || basename(drawioEntry.name).replace(/\.drawio$/i, '')
|
|
596
|
+
const stem = preferredStem || basename(drawioEntry.name).replace(/\.(?:drawio|drawai)$/i, '')
|
|
585
597
|
mkdirSync(destDir, { recursive: true })
|
|
586
|
-
const
|
|
598
|
+
const extension = /\.drawai$/i.test(drawioEntry.name) ? '.drawai' : '.drawio'
|
|
599
|
+
const drawioOut = join(destDir, stem + extension)
|
|
587
600
|
if (existsSync(drawioOut)) throw new Error('already exists: ' + stem + '.drawio')
|
|
588
601
|
writeFileSync(drawioOut, drawioEntry.data)
|
|
589
|
-
const mediaOut =
|
|
602
|
+
const mediaOut = mediaRootFor(drawioOut)
|
|
590
603
|
for (let i = 0; i < entries.length; i += 1) {
|
|
591
604
|
const name = entries[i].name.replace(/\\/g, '/')
|
|
592
|
-
if (/\.drawio$/i.test(name)) continue
|
|
605
|
+
if (/\.(?:drawio|drawai)$/i.test(name)) continue
|
|
593
606
|
// 接受 `foo.media/...` 或任意 `*.media/...`
|
|
594
607
|
const m = /([^/]+)\.media\/(.+)$/i.exec(name)
|
|
595
608
|
if (m === null) continue
|
|
@@ -599,7 +612,7 @@ export function unpackCanvasBundle(zipBuffer, destDir, preferredStem) {
|
|
|
599
612
|
mkdirSync(dirname(abs), { recursive: true })
|
|
600
613
|
writeFileSync(abs, entries[i].data)
|
|
601
614
|
}
|
|
602
|
-
return { path: stem +
|
|
615
|
+
return { path: stem + extension, mediaRoot: mediaOut }
|
|
603
616
|
}
|
|
604
617
|
|
|
605
618
|
/** 导出单个 clip 为 SVG 视频 zip(manifest + frames + poster)。 */
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* 由 tools/build.mjs 生成 —— 请勿直接编辑;改 src/ 下的源文件。 */
|
|
2
|
+
/* Browser-safe, shared identity and search for the mg-styles library (整片风格,不是单镜卡). */
|
|
3
|
+
export function resolveMgStyle(catalog, slug) {
|
|
4
|
+
const style = catalog.styles.find((item) => item.slug === slug)
|
|
5
|
+
if (!style) {
|
|
6
|
+
throw new Error('未知 mg 风格:' + slug + '(可用:' + catalog.styles.map((item) => item.slug).join(' / ') + ')')
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
slug: style.slug,
|
|
10
|
+
name: style.name,
|
|
11
|
+
en: style.en,
|
|
12
|
+
oneLiner: style.oneLiner,
|
|
13
|
+
signature: style.signature || [],
|
|
14
|
+
palette: style.palette,
|
|
15
|
+
colors: style.colors || [],
|
|
16
|
+
fonts: style.fonts || null,
|
|
17
|
+
rhythm: style.rhythm || null,
|
|
18
|
+
prompt: style.prompt,
|
|
19
|
+
demos: style.demos,
|
|
20
|
+
brief: style.brief,
|
|
21
|
+
engine: style.engine || null,
|
|
22
|
+
engines: style.engines || [],
|
|
23
|
+
engineNote: style.engineNote || '',
|
|
24
|
+
engineFiles: style.engineFiles || [],
|
|
25
|
+
motion: style.motion || null,
|
|
26
|
+
commit: catalog.commit,
|
|
27
|
+
label: style.name + ' · ' + style.slug,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 按词打分:命中的词越多分越高;slug 精确命中、中文名命中权重最高。中文按字包含即可。 */
|
|
32
|
+
export function searchMgStyles(catalog, query = '') {
|
|
33
|
+
const terms = String(query).toLowerCase().trim().split(/\s+/).filter(Boolean)
|
|
34
|
+
return catalog.styles
|
|
35
|
+
.map((style) => {
|
|
36
|
+
const haystack = [style.slug, style.name, style.en, style.heading, style.oneLiner,
|
|
37
|
+
(style.tags || []).join(' '), (style.signature || []).join(' ')].join(' ').toLowerCase()
|
|
38
|
+
const hit = terms.filter((term) => haystack.includes(term)).length
|
|
39
|
+
if (terms.length && hit === 0) return null
|
|
40
|
+
const exact = terms.includes(style.slug) || terms.includes(style.name.toLowerCase())
|
|
41
|
+
return { style, score: (exact ? 100 : 0) + hit * 10 + (terms.length && hit === terms.length ? 5 : 0) }
|
|
42
|
+
})
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.sort((a, b) => b.score - a.score)
|
|
45
|
+
.map(({ style }) => ({
|
|
46
|
+
slug: style.slug,
|
|
47
|
+
name: style.name,
|
|
48
|
+
en: style.en,
|
|
49
|
+
oneLiner: style.oneLiner,
|
|
50
|
+
tags: style.tags || [],
|
|
51
|
+
palette: style.palette,
|
|
52
|
+
rhythm: style.rhythm || null,
|
|
53
|
+
shot: style.shot || '',
|
|
54
|
+
}))
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function isMgStyleNode(node) { return node?.data?.drawaiMgStyle === '1' }
|
|
58
|
+
|
|
59
|
+
export function mgStyleData(catalog, slug) {
|
|
60
|
+
const selection = resolveMgStyle(catalog, slug)
|
|
61
|
+
return { drawaiMgStyle: '1', mgStyleSlug: selection.slug, mgStyleCommit: selection.commit }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** 一条片子只允许一种整片风格;重复引用同一个风格不算错,去重即可。 */
|
|
65
|
+
export function mgStyleSelection(catalog, input) {
|
|
66
|
+
const picks = input.refs.filter((ref) => ref.role === 'mgstyle').map((ref) => {
|
|
67
|
+
const node = ref.nodes.find((item) => item.id === ref.id)
|
|
68
|
+
if (!isMgStyleNode(node)) throw new Error('风格参考必须来自 mg 风格节点')
|
|
69
|
+
if (node.data.mgStyleCommit !== catalog.commit) throw new Error('mg 风格库版本已变化,请重新选择风格')
|
|
70
|
+
return { ...resolveMgStyle(catalog, node.data.mgStyleSlug), nodeId: ref.id }
|
|
71
|
+
})
|
|
72
|
+
const unique = picks.filter((item, index, all) => all.findIndex((other) => other.slug === item.slug) === index)
|
|
73
|
+
if (unique.length > 1) throw new Error('一条片子只能选一种整片风格,当前有:' + unique.map((item) => item.slug).join(' / '))
|
|
74
|
+
return unique[0] || null
|
|
75
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// 成片回流:把渲染产物落成画布视频节点能播的 clip pack。
|
|
2
|
+
//
|
|
3
|
+
// 为什么不是"把 mp4 塞进 .drawio":文档里只该有 id(mediaClip),字节留在
|
|
4
|
+
// `<画布>.media/<clip>/` 里。播放器对 raster clip 的做法是读 `source.mp4`
|
|
5
|
+
// 的原字节、用 <video> 直接播(见 src/video-player.js:203),所以只要
|
|
6
|
+
// source + manifest 就够,stills/ 只服务于"抽帧转 SVG"那条编辑路径。
|
|
7
|
+
//
|
|
8
|
+
// 这里不做视频解码之外的任何创作:渲染出来的像素原样搬,海报抽一帧。
|
|
9
|
+
|
|
10
|
+
import { execFile } from 'node:child_process'
|
|
11
|
+
import { promisify } from 'node:util'
|
|
12
|
+
import { chmodSync, existsSync, statSync, writeFileSync } from 'node:fs'
|
|
13
|
+
import { join } from 'node:path'
|
|
14
|
+
import { ffmpegBinary } from '../video-export.js'
|
|
15
|
+
import {
|
|
16
|
+
allocateClipId,
|
|
17
|
+
clipDirFor,
|
|
18
|
+
ensureClipPack,
|
|
19
|
+
importSourceFile,
|
|
20
|
+
POSTER_NAME,
|
|
21
|
+
readManifest,
|
|
22
|
+
videoDataAttrs,
|
|
23
|
+
videoMetaFromData,
|
|
24
|
+
writeManifest,
|
|
25
|
+
} from '../media.js'
|
|
26
|
+
|
|
27
|
+
const exec = promisify(execFile)
|
|
28
|
+
const MAX_SOURCE_BYTES = 512 * 1024 * 1024
|
|
29
|
+
|
|
30
|
+
function ffmpeg(args, options = {}) {
|
|
31
|
+
return exec(ffmpegBinary(), args, {
|
|
32
|
+
windowsHide: true,
|
|
33
|
+
timeout: 120000,
|
|
34
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
35
|
+
...options,
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** ffmpeg 不做 ffprobe 的活:`-i` 的 stderr 里就有尺寸、帧率、时长。 */
|
|
40
|
+
export async function probeVideo(file) { let stderr = ''
|
|
41
|
+
try {
|
|
42
|
+
const result = await ffmpeg(['-hide_banner', '-i', file, '-f', 'null', '-'], { encoding: 'utf8' })
|
|
43
|
+
stderr = result.stderr || ''
|
|
44
|
+
} catch (error) {
|
|
45
|
+
// ffmpeg 对"没有输出文件"的探测会以非零码退出,stderr 仍然有效。
|
|
46
|
+
stderr = String((error && (error.stderr || error.message)) || '')
|
|
47
|
+
}
|
|
48
|
+
const size = /Stream #\d+:\d+.*?(\d{2,5})x(\d{2,5})/.exec(stderr)
|
|
49
|
+
if (!size) throw new Error('读不出视频尺寸:' + file)
|
|
50
|
+
const fpsMatch = /(\d+(?:\.\d+)?)\s*fps/.exec(stderr)
|
|
51
|
+
const durationMatch = /Duration:\s*(\d+):(\d+):(\d+(?:\.\d+)?)/.exec(stderr)
|
|
52
|
+
const fps = fpsMatch ? Number(fpsMatch[1]) : 0
|
|
53
|
+
const seconds = durationMatch
|
|
54
|
+
? Number(durationMatch[1]) * 3600 + Number(durationMatch[2]) * 60 + Number(durationMatch[3])
|
|
55
|
+
: 0
|
|
56
|
+
return {
|
|
57
|
+
width: Number(size[1]),
|
|
58
|
+
height: Number(size[2]),
|
|
59
|
+
fps: Number.isFinite(fps) && fps > 0 ? Math.round(fps * 1000) / 1000 : 0,
|
|
60
|
+
seconds: Number.isFinite(seconds) && seconds > 0 ? seconds : 0,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** 抽一帧 PNG 当海报(默认取 0.4s,避开首帧可能的黑场/入场动画)。 */
|
|
65
|
+
export async function posterPng(file, atSeconds = 0.4) {
|
|
66
|
+
// 海报最终以 base64 内嵌进节点 style,尺寸就是文档体积——所以先缩到 960 宽。
|
|
67
|
+
const result = await ffmpeg(
|
|
68
|
+
['-hide_banner', '-loglevel', 'error', '-ss', String(Math.max(0, atSeconds)), '-i', file,
|
|
69
|
+
'-frames:v', '1', '-vf', 'scale=640:-2:flags=lanczos', '-f', 'image2pipe', '-vcodec', 'png', '-'],
|
|
70
|
+
{ encoding: 'buffer' },
|
|
71
|
+
)
|
|
72
|
+
if (!Buffer.isBuffer(result.stdout) || result.stdout.length === 0) throw new Error('抽不出海报帧:' + file)
|
|
73
|
+
return result.stdout
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 把海报 PNG 变成节点 style 里 `image=` 的值。
|
|
78
|
+
*
|
|
79
|
+
* 直接给**位图 data URI**,不再包一层 SVG。原因有两条:
|
|
80
|
+
* 1. `shape=image` 的渲染分支(client.js:2414 的 `isRasterDataUri(href)`)本来就要求位图;
|
|
81
|
+
* 2. 「SVG 里再 `<image href="data:image/png…">`」这种嵌套在 Chromium 里会让
|
|
82
|
+
* 画进 canvas 的导出图变成 tainted —— 导出 PNG / AI「看一眼」都会抛
|
|
83
|
+
* `Tainted canvases may not be exported`。平铺成 PNG 就没有这层嵌套。
|
|
84
|
+
*/
|
|
85
|
+
export function posterMarkup(pngBuffer, width, height) {
|
|
86
|
+
// 宽高只为保持签名兼容:位图自己带着尺寸,节点按 imageAspect 铺满。
|
|
87
|
+
void width
|
|
88
|
+
void height
|
|
89
|
+
return 'data:image/png;base64,' + pngBuffer.toString('base64')
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function existingClipIds(doc) {
|
|
93
|
+
const out = []
|
|
94
|
+
for (const node of (doc && doc.nodes) || []) {
|
|
95
|
+
const meta = videoMetaFromData(node.data)
|
|
96
|
+
if (meta) out.push(meta.clip)
|
|
97
|
+
}
|
|
98
|
+
return out
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* 把一段成片落进节点的 clip pack。
|
|
103
|
+
*
|
|
104
|
+
* - 节点已有 clip 就复用,没有就分配 `clip-N`;
|
|
105
|
+
* - source 复制成 `source.mp4`(保留原字节,播放器直接播它);
|
|
106
|
+
* - manifest 标成 raster,写回 fps/尺寸/时长;
|
|
107
|
+
* - 返回 node.data 需要合并的属性 + 海报标记,调用方负责写文档。
|
|
108
|
+
*/
|
|
109
|
+
export async function applyFilm({ drawioAbs, doc, node, film, fpsFallback = 30 }) {
|
|
110
|
+
if (typeof film !== 'string' || film.length === 0) throw new Error('缺少成片路径')
|
|
111
|
+
if (existsSync(film) === false) throw new Error('成片还不存在:' + film)
|
|
112
|
+
const bytes = statSync(film).size
|
|
113
|
+
if (bytes <= 0) throw new Error('成片是空文件:' + film)
|
|
114
|
+
if (bytes > MAX_SOURCE_BYTES) throw new Error('成片超过 ' + Math.round(MAX_SOURCE_BYTES / 1024 / 1024) + 'MB,先把画布外置存储清一清')
|
|
115
|
+
|
|
116
|
+
const probed = await probeVideo(film)
|
|
117
|
+
const fallbackFps = Number(fpsFallback) > 0 ? Number(fpsFallback) : 30
|
|
118
|
+
const fps = probed.fps > 0 ? probed.fps : fallbackFps
|
|
119
|
+
const existing = videoMetaFromData(node.data)
|
|
120
|
+
// 注意:视频节点建出来时就有 drawaiMedia=1,但 mediaClip 还是空的——
|
|
121
|
+
// videoMetaFromData 这时会返回 { clip: null },不能直接信。
|
|
122
|
+
const clip = existing && existing.clip ? existing.clip : allocateClipId(existingClipIds(doc))
|
|
123
|
+
|
|
124
|
+
const clipDir = clipDirFor(drawioAbs, clip)
|
|
125
|
+
ensureClipPack(drawioAbs, clip, { kind: 'raster', fps, w: probed.width, h: probed.height })
|
|
126
|
+
const imported = importSourceFile(clipDir, film, 'source.mp4')
|
|
127
|
+
// 只读位会跟着复制过来,Remotion 打包 publicDir 时会炸(EPERM copyfile)。
|
|
128
|
+
try { chmodSync(join(clipDir, imported.rel), 0o644) } catch { /* 权限已够 */ }
|
|
129
|
+
|
|
130
|
+
const manifest = readManifest(clipDir)
|
|
131
|
+
manifest.kind = 'raster'
|
|
132
|
+
manifest.fps = fps
|
|
133
|
+
manifest.width = probed.width
|
|
134
|
+
manifest.height = probed.height
|
|
135
|
+
manifest.source = imported.rel
|
|
136
|
+
manifest.sourceOffset = 0
|
|
137
|
+
// duration 留给"不看 <video> metadata 也要知道多长"的读者(缩略帧、打包、校验);
|
|
138
|
+
// raster 播放仍然以元素自己的 metadata 为准,这里只是把已知事实写下来。
|
|
139
|
+
manifest.duration = probed.seconds
|
|
140
|
+
writeManifest(clipDir, manifest)
|
|
141
|
+
|
|
142
|
+
const attrs = videoDataAttrs({ clip, kind: 'raster', fps, w: probed.width, h: probed.height, posterFrame: 0 })
|
|
143
|
+
let mark = ''
|
|
144
|
+
// 海报取片子的 35% 处,而不是固定 0.4s:深色/慢起的片子头几帧几乎是黑的,
|
|
145
|
+
// 拿它当封面等于画布上放一块空图,看着就像"没写回来"。
|
|
146
|
+
const posterAt = probed.seconds > 0
|
|
147
|
+
? Math.min(Math.max(0.4, probed.seconds * 0.35), Math.max(0.4, probed.seconds - 0.5))
|
|
148
|
+
: 0.4
|
|
149
|
+
try {
|
|
150
|
+
mark = posterMarkup(await posterPng(film, posterAt), probed.width, probed.height)
|
|
151
|
+
// 顺手把海报也写进 clip pack:ensureClipPack 只会放一张占位图,
|
|
152
|
+
// 打包画布(packCanvasBundle)或别处直接读 poster.svg 时才不会拿到空白。
|
|
153
|
+
writeFileSync(join(clipDir, POSTER_NAME), mark, 'utf8')
|
|
154
|
+
} catch {
|
|
155
|
+
mark = ''
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
clip,
|
|
159
|
+
dir: clipDir,
|
|
160
|
+
source: imported.rel,
|
|
161
|
+
width: probed.width,
|
|
162
|
+
height: probed.height,
|
|
163
|
+
fps,
|
|
164
|
+
seconds: probed.seconds,
|
|
165
|
+
frames: Math.round(probed.seconds * fps),
|
|
166
|
+
bytes,
|
|
167
|
+
attrs,
|
|
168
|
+
poster: mark,
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 把成片的音轨抽成单声道 wav,给回测用(motion_audio_verify)。
|
|
174
|
+
* 20 秒的片子这一步不到 1 秒,别把整条视频解出来。
|
|
175
|
+
*/
|
|
176
|
+
export async function extractAudio(film, out) {
|
|
177
|
+
if (!existsSync(film)) throw new Error('没有这个文件:' + film)
|
|
178
|
+
await ffmpeg(['-hide_banner', '-loglevel', 'error', '-y', '-i', film, '-vn', '-ac', '1', '-ar', '22050', out])
|
|
179
|
+
return out
|
|
180
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 由 tools/build-assets-pack.mjs 生成,勿手改。
|
|
2
|
+
export const ASSETS_LOCK = {
|
|
3
|
+
"version": "v1",
|
|
4
|
+
"file": "drawai-assets-v1.tar.gz",
|
|
5
|
+
"bytes": 151660586,
|
|
6
|
+
"sha256": "6804f9dcd5b9d8c46edc079c7c29cebf9b9f8e144d6ce9a3af37387b8a916f9f",
|
|
7
|
+
"files": 164,
|
|
8
|
+
"rawBytes": 210718720,
|
|
9
|
+
"builtAt": "2026-11-07T10:25:25.324Z"
|
|
10
|
+
}
|