dsh-drawai 0.3.4 → 0.4.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.
Files changed (538) hide show
  1. package/LICENSE +4154 -0
  2. package/README.md +49 -11
  3. package/lib/audio-media.js +150 -0
  4. package/lib/audio-service.js +66 -0
  5. package/lib/canvas-format.js +134 -0
  6. package/lib/client.js +5090 -184
  7. package/lib/comfyui-default-workflow.mjs +1825 -0
  8. package/lib/comfyui-workflow.mjs +426 -0
  9. package/lib/document-commands.js +12 -0
  10. package/lib/document-core.js +29 -0
  11. package/lib/drawing-runner.js +6 -4
  12. package/lib/drawing-tasks.js +26 -0
  13. package/lib/ffmpeg-manager.js +1056 -0
  14. package/lib/imagegen.mjs +596 -0
  15. package/lib/index.js +1762 -129
  16. package/lib/media.js +26 -13
  17. package/lib/mgstyle-core.js +75 -0
  18. package/lib/motion/apply.js +181 -0
  19. package/lib/motion/asset-pack-lock.js +10 -0
  20. package/lib/motion/asset-pack.js +335 -0
  21. package/lib/motion/assets.js +291 -0
  22. package/lib/motion/audio.js +103 -0
  23. package/lib/motion/audiolevel.js +63 -0
  24. package/lib/motion/audiomix.js +144 -0
  25. package/lib/motion/beats.js +338 -0
  26. package/lib/motion/builtin-assets.js +62 -0
  27. package/lib/motion/canvas-spec.js +442 -0
  28. package/lib/motion/capture.js +95 -0
  29. package/lib/motion/cards.js +80 -0
  30. package/lib/motion/collect.js +449 -0
  31. package/lib/motion/delivery.js +140 -0
  32. package/lib/motion/edge-speech.py +90 -0
  33. package/lib/motion/entry.jsx +73 -0
  34. package/lib/motion/export.js +200 -0
  35. package/lib/motion/ffmpeg.js +43 -0
  36. package/lib/motion/fonts.js +71 -0
  37. package/lib/motion/jobs.js +117 -0
  38. package/lib/motion/json.js +4 -0
  39. package/lib/motion/media-catalog.js +59 -0
  40. package/lib/motion/mgstyles/BRIEF-TEMPLATE.md +63 -0
  41. package/lib/motion/mgstyles/briefs/01-flat-vector.md +104 -0
  42. package/lib/motion/mgstyles/briefs/02-line-art.md +97 -0
  43. package/lib/motion/mgstyles/briefs/03-isometric.md +108 -0
  44. package/lib/motion/mgstyles/briefs/05-cel-boil.md +145 -0
  45. package/lib/motion/mgstyles/briefs/06-collage.md +149 -0
  46. package/lib/motion/mgstyles/briefs/07-liquid.md +106 -0
  47. package/lib/motion/mgstyles/briefs/08-morph.md +111 -0
  48. package/lib/motion/mgstyles/briefs/09-bauhaus.md +150 -0
  49. package/lib/motion/mgstyles/briefs/10-synthwave.md +151 -0
  50. package/lib/motion/mgstyles/briefs/12-aurora-glass.md +147 -0
  51. package/lib/motion/mgstyles/briefs/18-hanazi.md +140 -0
  52. package/lib/motion/mgstyles/briefs/19-paperclip.md +156 -0
  53. package/lib/motion/mgstyles/briefs/20-pixel.md +118 -0
  54. package/lib/motion/mgstyles/briefs/22-hud.md +118 -0
  55. package/lib/motion/mgstyles/catalog.d/01-flat-vector.json +34 -0
  56. package/lib/motion/mgstyles/catalog.d/02-line-art.json +34 -0
  57. package/lib/motion/mgstyles/catalog.d/03-isometric.json +35 -0
  58. package/lib/motion/mgstyles/catalog.d/05-cel-boil.json +28 -0
  59. package/lib/motion/mgstyles/catalog.d/06-collage.json +28 -0
  60. package/lib/motion/mgstyles/catalog.d/07-liquid.json +28 -0
  61. package/lib/motion/mgstyles/catalog.d/08-morph.json +28 -0
  62. package/lib/motion/mgstyles/catalog.d/09-bauhaus.json +28 -0
  63. package/lib/motion/mgstyles/catalog.d/10-synthwave.json +28 -0
  64. package/lib/motion/mgstyles/catalog.d/12-aurora-glass.json +28 -0
  65. package/lib/motion/mgstyles/catalog.d/18-hanazi.json +28 -0
  66. package/lib/motion/mgstyles/catalog.d/19-paperclip.json +28 -0
  67. package/lib/motion/mgstyles/catalog.d/20-pixel.json +28 -0
  68. package/lib/motion/mgstyles/catalog.d/22-hud.json +28 -0
  69. package/lib/motion/mgstyles/catalog.json +1356 -0
  70. package/lib/motion/mgstyles/upstream/README.md +147 -0
  71. package/lib/motion/mgstyles/upstream/README.zh-CN.md +147 -0
  72. package/lib/motion/mgstyles/upstream/demos/01-flat-vector/cues.json +1 -0
  73. package/lib/motion/mgstyles/upstream/demos/01-flat-vector/index.html +712 -0
  74. package/lib/motion/mgstyles/upstream/demos/02-line-art/cues.json +331 -0
  75. package/lib/motion/mgstyles/upstream/demos/02-line-art/film.js +676 -0
  76. package/lib/motion/mgstyles/upstream/demos/02-line-art/index.html +18 -0
  77. package/lib/motion/mgstyles/upstream/demos/02-line-art/tools/dump_timing.mjs +26 -0
  78. package/lib/motion/mgstyles/upstream/demos/03-isometric/cues.json +109 -0
  79. package/lib/motion/mgstyles/upstream/demos/03-isometric/index.html +25 -0
  80. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/anim.js +82 -0
  81. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/main.js +219 -0
  82. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/night5.js +180 -0
  83. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/render.js +202 -0
  84. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title.js +167 -0
  85. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title5.js +294 -0
  86. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/ui.js +141 -0
  87. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/world.js +1399 -0
  88. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/cues.json +157 -0
  89. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/index.html +34 -0
  90. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/engine.js +326 -0
  91. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/scene.js +2036 -0
  92. package/lib/motion/mgstyles/upstream/demos/06-collage/assets/gen/layout.json +157 -0
  93. package/lib/motion/mgstyles/upstream/demos/06-collage/cues.json +80 -0
  94. package/lib/motion/mgstyles/upstream/demos/06-collage/index.html +889 -0
  95. package/lib/motion/mgstyles/upstream/demos/07-liquid/cues.json +100 -0
  96. package/lib/motion/mgstyles/upstream/demos/07-liquid/index.html +108 -0
  97. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/engine.js +153 -0
  98. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/links.js +64 -0
  99. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/lookdev.js +46 -0
  100. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/scene.js +963 -0
  101. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/shaders.js +647 -0
  102. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/textsdf.js +114 -0
  103. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/type.js +50 -0
  104. package/lib/motion/mgstyles/upstream/demos/08-morph/cues.json +131 -0
  105. package/lib/motion/mgstyles/upstream/demos/08-morph/glyphs.json +1 -0
  106. package/lib/motion/mgstyles/upstream/demos/08-morph/index.html +901 -0
  107. package/lib/motion/mgstyles/upstream/demos/09-bauhaus/cues.json +270 -0
  108. package/lib/motion/mgstyles/upstream/demos/09-bauhaus/film.js +697 -0
  109. package/lib/motion/mgstyles/upstream/demos/09-bauhaus/index.html +12 -0
  110. package/lib/motion/mgstyles/upstream/demos/10-synthwave/cues.json +44 -0
  111. package/lib/motion/mgstyles/upstream/demos/10-synthwave/index.html +1028 -0
  112. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/cues.json +67 -0
  113. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/index.html +16 -0
  114. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/main.js +967 -0
  115. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/shaders.js +468 -0
  116. package/lib/motion/mgstyles/upstream/demos/18-hanazi/cues.json +117 -0
  117. package/lib/motion/mgstyles/upstream/demos/18-hanazi/index.html +541 -0
  118. package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/countries-110m.json +1 -0
  119. package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/stickers/meta.json +34 -0
  120. package/lib/motion/mgstyles/upstream/demos/19-paperclip/cues.json +285 -0
  121. package/lib/motion/mgstyles/upstream/demos/19-paperclip/index.html +599 -0
  122. package/lib/motion/mgstyles/upstream/demos/20-pixel/cues.json +42 -0
  123. package/lib/motion/mgstyles/upstream/demos/20-pixel/film.js +914 -0
  124. package/lib/motion/mgstyles/upstream/demos/20-pixel/index.html +18 -0
  125. package/lib/motion/mgstyles/upstream/demos/22-hud/cues.json +108 -0
  126. package/lib/motion/mgstyles/upstream/demos/22-hud/index.html +125 -0
  127. package/lib/motion/mgstyles/upstream/demos/22-hud/js/holo.js +275 -0
  128. package/lib/motion/mgstyles/upstream/demos/22-hud/js/hud.js +855 -0
  129. package/lib/motion/mgstyles/upstream/demos/22-hud/js/post.js +150 -0
  130. package/lib/motion/mgstyles/upstream/demos/22-hud/js/util.js +65 -0
  131. package/lib/motion/mgstyles/upstream/demos/22-hud/js/v5.js +142 -0
  132. package/lib/motion/mgstyles/upstream/harness/render.mjs +319 -0
  133. package/lib/motion/mgstyles/upstream/manifest.json +269 -0
  134. package/lib/motion/mgstyles/upstream/prompts/01-flat-vector.md +98 -0
  135. package/lib/motion/mgstyles/upstream/prompts/02-line-art.md +95 -0
  136. package/lib/motion/mgstyles/upstream/prompts/03-isometric.md +97 -0
  137. package/lib/motion/mgstyles/upstream/prompts/05-cel-boil.md +95 -0
  138. package/lib/motion/mgstyles/upstream/prompts/06-collage.md +95 -0
  139. package/lib/motion/mgstyles/upstream/prompts/07-liquid.md +98 -0
  140. package/lib/motion/mgstyles/upstream/prompts/08-morph.md +95 -0
  141. package/lib/motion/mgstyles/upstream/prompts/09-bauhaus.md +96 -0
  142. package/lib/motion/mgstyles/upstream/prompts/10-synthwave.md +95 -0
  143. package/lib/motion/mgstyles/upstream/prompts/12-aurora-glass.md +96 -0
  144. package/lib/motion/mgstyles/upstream/prompts/18-hanazi.md +95 -0
  145. package/lib/motion/mgstyles/upstream/prompts/19-paperclip.md +96 -0
  146. package/lib/motion/mgstyles/upstream/prompts/20-pixel.md +96 -0
  147. package/lib/motion/mgstyles/upstream/prompts/22-hud.md +95 -0
  148. package/lib/motion/mgstyles/upstream/rubric.md +51 -0
  149. package/lib/motion/mgstyles/upstream/template.md +36 -0
  150. package/lib/motion/pixelqa.js +198 -0
  151. package/lib/motion/preview.js +97 -0
  152. package/lib/motion/project.js +395 -0
  153. package/lib/motion/qa.js +290 -0
  154. package/lib/motion/reference-media.jsx +10 -0
  155. package/lib/motion/render-settings.js +112 -0
  156. package/lib/motion/render.js +161 -0
  157. package/lib/motion/runtime/package-lock.json +3058 -0
  158. package/lib/motion/runtime/package.json +16 -0
  159. package/lib/motion/scene-kit.js +183 -0
  160. package/lib/motion/sfx.js +232 -0
  161. package/lib/motion/shotcraft/ClipCard.tsx +204 -0
  162. package/lib/motion/shotcraft/catalog.json +2461 -0
  163. package/lib/motion/shotcraft/upstream/SKILL.md +286 -0
  164. package/lib/motion/shotcraft/upstream/assets/lib/Caption.tsx +54 -0
  165. package/lib/motion/shotcraft/upstream/assets/lib/ClipCard.tsx +200 -0
  166. package/lib/motion/shotcraft/upstream/assets/lib/DigitRoll.tsx +45 -0
  167. package/lib/motion/shotcraft/upstream/assets/lib/FlashCut.tsx +20 -0
  168. package/lib/motion/shotcraft/upstream/assets/lib/FlatPanel.tsx +65 -0
  169. package/lib/motion/shotcraft/upstream/assets/lib/PageCam.tsx +151 -0
  170. package/lib/motion/shotcraft/upstream/assets/lib/VerticalTicker.tsx +129 -0
  171. package/lib/motion/shotcraft/upstream/assets/lib/helpers/camera.tsx +75 -0
  172. package/lib/motion/shotcraft/upstream/assets/lib/helpers/motion.ts +40 -0
  173. package/lib/motion/shotcraft/upstream/assets/lib/helpers/rand.ts +11 -0
  174. package/lib/motion/shotcraft/upstream/assets/lib/helpers/shake.ts +10 -0
  175. package/lib/motion/shotcraft/upstream/assets/scripts/__pycache__/sfx-source.cpython-313.pyc +0 -0
  176. package/lib/motion/shotcraft/upstream/assets/scripts/build-readme-cover.mjs +49 -0
  177. package/lib/motion/shotcraft/upstream/assets/scripts/capture-template.mjs +210 -0
  178. package/lib/motion/shotcraft/upstream/assets/scripts/sfx-source.py +423 -0
  179. package/lib/motion/shotcraft/upstream/assets/scripts/smoke-render-demos.py +170 -0
  180. package/lib/motion/shotcraft/upstream/assets/scripts/test_sfx_source.py +157 -0
  181. package/lib/motion/shotcraft/upstream/demos/README.md +120 -0
  182. package/lib/motion/shotcraft/upstream/demos/_fixtures/Brand.tsx +112 -0
  183. package/lib/motion/shotcraft/upstream/demos/_fixtures/Fixtures.tsx +647 -0
  184. package/lib/motion/shotcraft/upstream/demos/_fixtures/Look.tsx +316 -0
  185. package/lib/motion/shotcraft/upstream/demos/_fixtures/Motion.tsx +82 -0
  186. package/lib/motion/shotcraft/upstream/demos/_fixtures/PageCam2D.tsx +115 -0
  187. package/lib/motion/shotcraft/upstream/demos/_fixtures/Polish.tsx +243 -0
  188. package/lib/motion/shotcraft/upstream/demos/_textures/live-layout.json +389 -0
  189. package/lib/motion/shotcraft/upstream/demos/camera/basic-3d-scene/Basic3DScene.tsx +250 -0
  190. package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashImpactReal.tsx +305 -0
  191. package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashZoomReal.tsx +246 -0
  192. package/lib/motion/shotcraft/upstream/demos/camera/cursor-flyover/CursorFlyover.tsx +390 -0
  193. package/lib/motion/shotcraft/upstream/demos/camera/depth-layer-moves/MultiplaneReal.tsx +138 -0
  194. package/lib/motion/shotcraft/upstream/demos/camera/graze-face-tour/GrazeFaceTour.tsx +542 -0
  195. package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/OverheadTabletopDrop.tsx +315 -0
  196. package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/TiltReveal.tsx +299 -0
  197. package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/DroneDiveLanding.tsx +173 -0
  198. package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/ExplodedView.tsx +348 -0
  199. package/lib/motion/shotcraft/upstream/demos/camera/steep-tilt-glide/SteepTiltGlide.tsx +366 -0
  200. package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/BulletTimeFreezeOrbit.tsx +279 -0
  201. package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/PullBackIsolation.tsx +184 -0
  202. package/lib/motion/shotcraft/upstream/demos/camera/terminal-3d/Terminal3D.tsx +390 -0
  203. package/lib/motion/shotcraft/upstream/demos/data/before-after-slider-scrub/BeforeAfterSliderScrub.tsx +155 -0
  204. package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/AxisRescaleShockV2.tsx +303 -0
  205. package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/OscilloscopeStreamV2.tsx +290 -0
  206. package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/UnitDotSwarmRegroupV2.tsx +278 -0
  207. package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/NeedleSweepSelftest.tsx +307 -0
  208. package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/TapeScrollFixedPointer.tsx +215 -0
  209. package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/BrakeReticleLock.tsx +299 -0
  210. package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/ChangelogScrollBrake.tsx +232 -0
  211. package/lib/motion/shotcraft/upstream/demos/data/timeline-travel/TimelineTravel.tsx +290 -0
  212. package/lib/motion/shotcraft/upstream/demos/effects/assemble-then-type-flyin/AssembleThenTypeFlyin.tsx +273 -0
  213. package/lib/motion/shotcraft/upstream/demos/effects/aurora-bloom-bg-flip/AuroraBloomBgFlip.tsx +167 -0
  214. package/lib/motion/shotcraft/upstream/demos/effects/brand-frame-snap/BrandFrameSnap.tsx +536 -0
  215. package/lib/motion/shotcraft/upstream/demos/effects/fui-hud-moves/ReticleLockOn.tsx +164 -0
  216. package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/FlylineArc.tsx +175 -0
  217. package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/GlowOrbAmbient.tsx +197 -0
  218. package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/OrbFlylineRelay.tsx +241 -0
  219. package/lib/motion/shotcraft/upstream/demos/effects/icon-performance-moves/AttentionBounce.tsx +279 -0
  220. package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/AnimeImpact.tsx +230 -0
  221. package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/HitCounter.tsx +345 -0
  222. package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SheenSweepRetry.tsx +275 -0
  223. package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SpotlightSweepReveal.tsx +229 -0
  224. package/lib/motion/shotcraft/upstream/demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx +312 -0
  225. package/lib/motion/shotcraft/upstream/demos/effects/riso-print-hits/RisoMisregistrationHit.tsx +222 -0
  226. package/lib/motion/shotcraft/upstream/demos/effects/scan-bracket-sweep/ScanBracketSweep.tsx +295 -0
  227. package/lib/motion/shotcraft/upstream/demos/effects/scanline-annotate-focus/ScanlineAnnotateFocus.tsx +329 -0
  228. package/lib/motion/shotcraft/upstream/demos/effects/scanline-assemble-flyin/ScanlineAssembleFlyin.tsx +315 -0
  229. package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ImpactBurstKit.tsx +264 -0
  230. package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/KanadaPerspectiveSnap.tsx +260 -0
  231. package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ScoreSlam.tsx +263 -0
  232. package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/CornerSpotlightReveal.tsx +123 -0
  233. package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/GlowWakeSleepPanel.tsx +187 -0
  234. package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/SlideSpotlightPan.tsx +175 -0
  235. package/lib/motion/shotcraft/upstream/demos/interaction/autolayout-gap-dial/AutolayoutGapDial.tsx +305 -0
  236. package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/DiagramCascadeBuild.tsx +350 -0
  237. package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/PanelToCanvasMaterialize.tsx +352 -0
  238. package/lib/motion/shotcraft/upstream/demos/interaction/chip-grid-single-select-blackout/ChipGridSingleSelectBlackout.tsx +218 -0
  239. package/lib/motion/shotcraft/upstream/demos/interaction/collab-cursor-moves/CursorCastEnsemble.tsx +297 -0
  240. package/lib/motion/shotcraft/upstream/demos/interaction/glass-pill-dictation-typing/GlassPillDictationTyping.tsx +157 -0
  241. package/lib/motion/shotcraft/upstream/demos/interaction/hashtag-to-pill-materialize/HashtagToPillMaterialize.tsx +218 -0
  242. package/lib/motion/shotcraft/upstream/demos/interaction/picker-carousel-feature-cycle/PickerCarouselFeatureCycle.tsx +202 -0
  243. package/lib/motion/shotcraft/upstream/demos/interaction/segmented-thumb-hero/SegmentedThumbHero.tsx +265 -0
  244. package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/PaletteThemeRipple.tsx +457 -0
  245. package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/ThemeSweepToggle.tsx +446 -0
  246. package/lib/motion/shotcraft/upstream/demos/interaction/type-and-filter/TypeAndFilter.tsx +249 -0
  247. package/lib/motion/shotcraft/upstream/demos/interaction/voice-waveform-live/VoiceWaveformLive.tsx +278 -0
  248. package/lib/motion/shotcraft/upstream/demos/opening/crane-rise-reveal/CraneRiseReveal.tsx +332 -0
  249. package/lib/motion/shotcraft/upstream/demos/opening/dataviz-landscape-open/DatavizLandscapeOpen.tsx +358 -0
  250. package/lib/motion/shotcraft/upstream/demos/opening/fracture/Fracture.tsx +201 -0
  251. package/lib/motion/shotcraft/upstream/demos/opening/icon-field-colorize/IconFieldColorize.tsx +200 -0
  252. package/lib/motion/shotcraft/upstream/demos/opening/letterspace-materialize/LetterspaceMaterialize.tsx +208 -0
  253. package/lib/motion/shotcraft/upstream/demos/opening/magician-card-flourish/MagicianCardFlourish.tsx +341 -0
  254. package/lib/motion/shotcraft/upstream/demos/opening/orbit-ring-title-open/OrbitRingTitleOpen.tsx +389 -0
  255. package/lib/motion/shotcraft/upstream/demos/opening/spotlight-hero-card/SpotlightHeroCard.tsx +293 -0
  256. package/lib/motion/shotcraft/upstream/demos/opening/stroke-segment-build/StrokeSegmentBuild.tsx +183 -0
  257. package/lib/motion/shotcraft/upstream/demos/opening/text-as-mask/TextAsMask.tsx +245 -0
  258. package/lib/motion/shotcraft/upstream/demos/outro/grain-dissolve/GrainDissolve.tsx +222 -0
  259. package/lib/motion/shotcraft/upstream/demos/outro/logo-shrink-wordmark-lockup/LogoShrinkWordmarkLockup.tsx +223 -0
  260. package/lib/motion/shotcraft/upstream/demos/outro/neon-triple-marquee/NeonTripleMarquee.tsx +217 -0
  261. package/lib/motion/shotcraft/upstream/demos/outro/outro-group-photo-launch/OutroGroupPhotoLaunch.tsx +343 -0
  262. package/lib/motion/shotcraft/upstream/demos/outro/ui-strip-away-outro/UiStripAwayOutro.tsx +357 -0
  263. package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/IconFlipBloomLogo.tsx +187 -0
  264. package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/InputMorphsIntoLogo.tsx +333 -0
  265. package/lib/motion/shotcraft/upstream/demos/rhythm/beat-cut-moves/PaparazziFlash.tsx +274 -0
  266. package/lib/motion/shotcraft/upstream/demos/rhythm/beat-step-list-theme-cycle/BeatStepListThemeCycle.tsx +270 -0
  267. package/lib/motion/shotcraft/upstream/demos/rhythm/panel-grid-moves/ComicPanelSplit.tsx +430 -0
  268. package/lib/motion/shotcraft/upstream/demos/rhythm/quad-split-parallel-scenes/QuadSplitParallelScenes.tsx +252 -0
  269. package/lib/motion/shotcraft/upstream/demos/rhythm/rhythm-interrupt-moves/JumpCutPunchIn.tsx +106 -0
  270. package/lib/motion/shotcraft/upstream/demos/rhythm/sakuga-timing-shift/SakugaTimingShift.tsx +288 -0
  271. package/lib/motion/shotcraft/upstream/demos/rhythm/speed-ramp-freeze/FreezeAnnotateReal.tsx +362 -0
  272. package/lib/motion/shotcraft/upstream/demos/rhythm/trailer-grammar-moves/TrailerBumper.tsx +168 -0
  273. package/lib/motion/shotcraft/upstream/demos/transition/bottom-push-stack-wipe/BottomPushStackWipe.tsx +310 -0
  274. package/lib/motion/shotcraft/upstream/demos/transition/card-flip-reveal/CardFlipReveal.tsx +261 -0
  275. package/lib/motion/shotcraft/upstream/demos/transition/card-flock-tumble/CardFlockTumble.tsx +459 -0
  276. package/lib/motion/shotcraft/upstream/demos/transition/circle-match-iris/CircleMatchIris.tsx +294 -0
  277. package/lib/motion/shotcraft/upstream/demos/transition/gradient-transition/GradientTransition.tsx +161 -0
  278. package/lib/motion/shotcraft/upstream/demos/transition/line-carry-transition/LineCarryTransition.tsx +248 -0
  279. package/lib/motion/shotcraft/upstream/demos/transition/mosaic-reframe/MosaicReframe.tsx +359 -0
  280. package/lib/motion/shotcraft/upstream/demos/transition/page-turn-transitions/BarnDoorSplit.tsx +227 -0
  281. package/lib/motion/shotcraft/upstream/demos/transition/print-texture-transitions/InkBleedReveal.tsx +162 -0
  282. package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/PortalWipeV2.tsx +248 -0
  283. package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/WhipBrakeReal.tsx +186 -0
  284. package/lib/motion/shotcraft/upstream/demos/transition/tear-streak-transitions/GlitchDisplace.tsx +355 -0
  285. package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/InvisibleCut.tsx +272 -0
  286. package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/LightLeakBurn.tsx +262 -0
  287. package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/VersusSlam.tsx +217 -0
  288. package/lib/motion/shotcraft/upstream/demos/transition/transition-travel/LetterformZoom.tsx +285 -0
  289. package/lib/motion/shotcraft/upstream/demos/transition/white-flash-logo-simplify-cut/WhiteFlashLogoSimplifyCut.tsx +205 -0
  290. package/lib/motion/shotcraft/upstream/demos/transition/wipe-transitions/BlindsSlice.tsx +178 -0
  291. package/lib/motion/shotcraft/upstream/demos/typography/blur-slide/BlurSlide.tsx +147 -0
  292. package/lib/motion/shotcraft/upstream/demos/typography/brace-expand/BraceExpand.tsx +143 -0
  293. package/lib/motion/shotcraft/upstream/demos/typography/brand-ink-open/BrandInkOpen.tsx +134 -0
  294. package/lib/motion/shotcraft/upstream/demos/typography/countdown-arc-scatter/CountdownArcScatter.tsx +217 -0
  295. package/lib/motion/shotcraft/upstream/demos/typography/flying-words/FlyingWords.tsx +198 -0
  296. package/lib/motion/shotcraft/upstream/demos/typography/glitch-cycle/GlitchCycle.tsx +221 -0
  297. package/lib/motion/shotcraft/upstream/demos/typography/gradient-word-sweep/GradientWordSweep.tsx +312 -0
  298. package/lib/motion/shotcraft/upstream/demos/typography/lead-word-zoom-assemble/LeadWordZoomAssemble.tsx +261 -0
  299. package/lib/motion/shotcraft/upstream/demos/typography/marker-underline-title/MarkerUnderlineTitle.tsx +121 -0
  300. package/lib/motion/shotcraft/upstream/demos/typography/outline-word-fill/OutlineWordFill.tsx +153 -0
  301. package/lib/motion/shotcraft/upstream/demos/typography/paper-title-card/PaperTitleCard.tsx +179 -0
  302. package/lib/motion/shotcraft/upstream/demos/typography/pill-chip-slot-cycle-handled/PillChipSlotCycleHandled.tsx +140 -0
  303. package/lib/motion/shotcraft/upstream/demos/typography/pill-slot-cycle/PillSlotCycle.tsx +309 -0
  304. package/lib/motion/shotcraft/upstream/demos/typography/text-column-converge/TextColumnConverge.tsx +191 -0
  305. package/lib/motion/shotcraft/upstream/demos/typography/title-demote-to-label/TitleDemoteToLabel.tsx +292 -0
  306. package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/LetterformDriftAssembly.tsx +135 -0
  307. package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/SplitTextStagger.tsx +124 -0
  308. package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/TextOnPath.tsx +255 -0
  309. package/lib/motion/shotcraft/upstream/demos/typography/type-entrance-moves/LetterDropPhysics.tsx +173 -0
  310. package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/FontWeightPump.tsx +225 -0
  311. package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/KaraokeFillSync.tsx +141 -0
  312. package/lib/motion/shotcraft/upstream/demos/typography/typewriter-moves/TypewriterErrorRetype.tsx +137 -0
  313. package/lib/motion/shotcraft/upstream/demos/typography/vertical-word-roll-blur-cycle/VerticalWordRollBlurCycle.tsx +147 -0
  314. package/lib/motion/shotcraft/upstream/demos/typography/word-relay-filmstrip/WordRelayFilmstrip.tsx +409 -0
  315. package/lib/motion/shotcraft/upstream/demos/typography/word-relay-geometry/WordRelayGeometry.tsx +280 -0
  316. package/lib/motion/shotcraft/upstream/demos/ui-entrance/avatar-bracket-carousel/AvatarBracketCarousel.tsx +271 -0
  317. package/lib/motion/shotcraft/upstream/demos/ui-entrance/bezier-source-converge-merge/BezierSourceConvergeMerge.tsx +385 -0
  318. package/lib/motion/shotcraft/upstream/demos/ui-entrance/card-stack/CardStack.tsx +312 -0
  319. package/lib/motion/shotcraft/upstream/demos/ui-entrance/carousel-3d/Carousel3D.tsx +303 -0
  320. package/lib/motion/shotcraft/upstream/demos/ui-entrance/clipcard-looping/ClipCardLooping.tsx +77 -0
  321. package/lib/motion/shotcraft/upstream/demos/ui-entrance/cloner-depth-echo/ClonerDepthEcho.tsx +311 -0
  322. package/lib/motion/shotcraft/upstream/demos/ui-entrance/deck-deal-flyin/DeckDealFlyin.tsx +307 -0
  323. package/lib/motion/shotcraft/upstream/demos/ui-entrance/doc-park-left-pill-deal/DocParkLeftPillDeal.tsx +349 -0
  324. package/lib/motion/shotcraft/upstream/demos/ui-entrance/document-typewriter-reveal/DocumentTypewriterReveal.tsx +255 -0
  325. package/lib/motion/shotcraft/upstream/demos/ui-entrance/draw-svg-trace/DrawSvgTrace.tsx +244 -0
  326. package/lib/motion/shotcraft/upstream/demos/ui-entrance/element-body-moves/ContactShadowLift.tsx +217 -0
  327. package/lib/motion/shotcraft/upstream/demos/ui-entrance/integration-hub-map/IntegrationHubMap.tsx +652 -0
  328. package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-reveal/ListReveal.tsx +153 -0
  329. package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-stack-press/ListStackPress.tsx +238 -0
  330. package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-forerun/NeonFrameForerun.tsx +324 -0
  331. package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-orbit-drop/NeonFrameForerunOrbit.tsx +354 -0
  332. package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/PageWaterfallWall.tsx +101 -0
  333. package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/VerticalTicker.tsx +129 -0
  334. package/lib/motion/shotcraft/upstream/demos/ui-entrance/product-card-progressive-assemble/ProductCardProgressiveAssemble.tsx +297 -0
  335. package/lib/motion/shotcraft/upstream/demos/ui-entrance/radial-wave/RadialWave.tsx +57 -0
  336. package/lib/motion/shotcraft/upstream/demos/ui-entrance/research-card-stack-scroll/ResearchCardStackScroll.tsx +155 -0
  337. package/lib/motion/shotcraft/upstream/demos/ui-entrance/row-embed/RowEmbed.tsx +175 -0
  338. package/lib/motion/shotcraft/upstream/demos/ui-entrance/value-stagger-gradient/ValueStaggerGradient.tsx +153 -0
  339. package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/BentoLightUp.tsx +146 -0
  340. package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/WireframeDrawOn.tsx +226 -0
  341. package/lib/motion/shotcraft/upstream/gallery/api/library.json +1 -0
  342. package/lib/motion/shotcraft/upstream/manifest.json +2715 -0
  343. package/lib/motion/shotcraft/upstream/references/aesthetic-rules.md +193 -0
  344. package/lib/motion/shotcraft/upstream/references/final-review.md +121 -0
  345. package/lib/motion/shotcraft/upstream/references/guided-free-creation.md +199 -0
  346. package/lib/motion/shotcraft/upstream/references/jianying-export.md +183 -0
  347. package/lib/motion/shotcraft/upstream/references/music-beat-sync.md +257 -0
  348. package/lib/motion/shotcraft/upstream/references/pipeline.md +382 -0
  349. package/lib/motion/shotcraft/upstream/references/publish-upload-post.md +111 -0
  350. package/lib/motion/shotcraft/upstream/references/sequences/promo-energy-arc.md +50 -0
  351. package/lib/motion/shotcraft/upstream/references/sfx-sourcing.md +95 -0
  352. package/lib/motion/shotcraft/upstream/references/shots/camera/basic-3d-scene.md +41 -0
  353. package/lib/motion/shotcraft/upstream/references/shots/camera/crash-zoom-punch.md +52 -0
  354. package/lib/motion/shotcraft/upstream/references/shots/camera/cursor-flyover.md +39 -0
  355. package/lib/motion/shotcraft/upstream/references/shots/camera/depth-layer-moves.md +39 -0
  356. package/lib/motion/shotcraft/upstream/references/shots/camera/graze-face-tour.md +57 -0
  357. package/lib/motion/shotcraft/upstream/references/shots/camera/overhead-camera-moves.md +51 -0
  358. package/lib/motion/shotcraft/upstream/references/shots/camera/space-camera-moves.md +46 -0
  359. package/lib/motion/shotcraft/upstream/references/shots/camera/steep-tilt-glide.md +52 -0
  360. package/lib/motion/shotcraft/upstream/references/shots/camera/tension-camera-moves.md +43 -0
  361. package/lib/motion/shotcraft/upstream/references/shots/camera/terminal-3d.md +42 -0
  362. package/lib/motion/shotcraft/upstream/references/shots/data/before-after-slider-scrub.md +48 -0
  363. package/lib/motion/shotcraft/upstream/references/shots/data/chart-live-moves.md +52 -0
  364. package/lib/motion/shotcraft/upstream/references/shots/data/gauge-readout-moves.md +45 -0
  365. package/lib/motion/shotcraft/upstream/references/shots/data/scroll-brake-moves.md +46 -0
  366. package/lib/motion/shotcraft/upstream/references/shots/data/timeline-travel.md +44 -0
  367. package/lib/motion/shotcraft/upstream/references/shots/effects/assemble-then-type-flyin.md +63 -0
  368. package/lib/motion/shotcraft/upstream/references/shots/effects/aurora-bloom-bg-flip.md +54 -0
  369. package/lib/motion/shotcraft/upstream/references/shots/effects/brand-frame-snap.md +58 -0
  370. package/lib/motion/shotcraft/upstream/references/shots/effects/fui-hud-moves.md +35 -0
  371. package/lib/motion/shotcraft/upstream/references/shots/effects/glow-flyline-moves.md +53 -0
  372. package/lib/motion/shotcraft/upstream/references/shots/effects/icon-performance-moves.md +42 -0
  373. package/lib/motion/shotcraft/upstream/references/shots/effects/impact-feedback.md +50 -0
  374. package/lib/motion/shotcraft/upstream/references/shots/effects/light-play-moves.md +46 -0
  375. package/lib/motion/shotcraft/upstream/references/shots/effects/radial-ripple-phone-chips.md +56 -0
  376. package/lib/motion/shotcraft/upstream/references/shots/effects/riso-print-hits.md +49 -0
  377. package/lib/motion/shotcraft/upstream/references/shots/effects/scan-bracket-sweep.md +50 -0
  378. package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-annotate-focus.md +53 -0
  379. package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-assemble-flyin.md +53 -0
  380. package/lib/motion/shotcraft/upstream/references/shots/effects/slam-entrance-moves.md +55 -0
  381. package/lib/motion/shotcraft/upstream/references/shots/effects/spotlight-sweep-moves.md +52 -0
  382. package/lib/motion/shotcraft/upstream/references/shots/interaction/autolayout-gap-dial.md +60 -0
  383. package/lib/motion/shotcraft/upstream/references/shots/interaction/canvas-materialize-moves.md +57 -0
  384. package/lib/motion/shotcraft/upstream/references/shots/interaction/chip-grid-single-select-blackout.md +51 -0
  385. package/lib/motion/shotcraft/upstream/references/shots/interaction/collab-cursor-moves.md +41 -0
  386. package/lib/motion/shotcraft/upstream/references/shots/interaction/glass-pill-dictation-typing.md +53 -0
  387. package/lib/motion/shotcraft/upstream/references/shots/interaction/hashtag-to-pill-materialize.md +60 -0
  388. package/lib/motion/shotcraft/upstream/references/shots/interaction/picker-carousel-feature-cycle.md +55 -0
  389. package/lib/motion/shotcraft/upstream/references/shots/interaction/segmented-thumb-hero.md +57 -0
  390. package/lib/motion/shotcraft/upstream/references/shots/interaction/theme-switch-moves.md +47 -0
  391. package/lib/motion/shotcraft/upstream/references/shots/interaction/type-and-filter.md +37 -0
  392. package/lib/motion/shotcraft/upstream/references/shots/interaction/voice-waveform-live.md +54 -0
  393. package/lib/motion/shotcraft/upstream/references/shots/opening/brand-ink-open.md +36 -0
  394. package/lib/motion/shotcraft/upstream/references/shots/opening/crane-rise-reveal.md +56 -0
  395. package/lib/motion/shotcraft/upstream/references/shots/opening/dataviz-landscape-open.md +56 -0
  396. package/lib/motion/shotcraft/upstream/references/shots/opening/fracture.md +40 -0
  397. package/lib/motion/shotcraft/upstream/references/shots/opening/icon-field-colorize.md +60 -0
  398. package/lib/motion/shotcraft/upstream/references/shots/opening/letterspace-materialize.md +57 -0
  399. package/lib/motion/shotcraft/upstream/references/shots/opening/magician-card-flourish.md +73 -0
  400. package/lib/motion/shotcraft/upstream/references/shots/opening/orbit-ring-title-open.md +87 -0
  401. package/lib/motion/shotcraft/upstream/references/shots/opening/spotlight-hero-card.md +55 -0
  402. package/lib/motion/shotcraft/upstream/references/shots/opening/stroke-segment-build.md +50 -0
  403. package/lib/motion/shotcraft/upstream/references/shots/opening/text-as-mask.md +59 -0
  404. package/lib/motion/shotcraft/upstream/references/shots/outro/grain-dissolve.md +38 -0
  405. package/lib/motion/shotcraft/upstream/references/shots/outro/logo-shrink-wordmark-lockup.md +38 -0
  406. package/lib/motion/shotcraft/upstream/references/shots/outro/neon-triple-marquee.md +59 -0
  407. package/lib/motion/shotcraft/upstream/references/shots/outro/outro-group-photo-launch.md +39 -0
  408. package/lib/motion/shotcraft/upstream/references/shots/outro/ui-strip-away-outro.md +61 -0
  409. package/lib/motion/shotcraft/upstream/references/shots/outro/ui-to-brand-morph.md +52 -0
  410. package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-cut-moves.md +50 -0
  411. package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-step-list-theme-cycle.md +66 -0
  412. package/lib/motion/shotcraft/upstream/references/shots/rhythm/panel-grid-moves.md +43 -0
  413. package/lib/motion/shotcraft/upstream/references/shots/rhythm/quad-split-parallel-scenes.md +38 -0
  414. package/lib/motion/shotcraft/upstream/references/shots/rhythm/rhythm-interrupt-moves.md +38 -0
  415. package/lib/motion/shotcraft/upstream/references/shots/rhythm/sakuga-timing-shift.md +56 -0
  416. package/lib/motion/shotcraft/upstream/references/shots/rhythm/speed-ramp-freeze.md +44 -0
  417. package/lib/motion/shotcraft/upstream/references/shots/rhythm/trailer-grammar-moves.md +38 -0
  418. package/lib/motion/shotcraft/upstream/references/shots/transition/bottom-push-stack-wipe.md +63 -0
  419. package/lib/motion/shotcraft/upstream/references/shots/transition/card-flip-reveal.md +57 -0
  420. package/lib/motion/shotcraft/upstream/references/shots/transition/card-flock-tumble.md +63 -0
  421. package/lib/motion/shotcraft/upstream/references/shots/transition/circle-match-iris.md +58 -0
  422. package/lib/motion/shotcraft/upstream/references/shots/transition/gradient-transition.md +45 -0
  423. package/lib/motion/shotcraft/upstream/references/shots/transition/line-carry-transition.md +55 -0
  424. package/lib/motion/shotcraft/upstream/references/shots/transition/mosaic-reframe.md +49 -0
  425. package/lib/motion/shotcraft/upstream/references/shots/transition/page-turn-transitions.md +42 -0
  426. package/lib/motion/shotcraft/upstream/references/shots/transition/print-texture-transitions.md +42 -0
  427. package/lib/motion/shotcraft/upstream/references/shots/transition/shot-transitions.md +45 -0
  428. package/lib/motion/shotcraft/upstream/references/shots/transition/tear-streak-transitions.md +48 -0
  429. package/lib/motion/shotcraft/upstream/references/shots/transition/transition-hidden-cut.md +55 -0
  430. package/lib/motion/shotcraft/upstream/references/shots/transition/transition-travel.md +43 -0
  431. package/lib/motion/shotcraft/upstream/references/shots/transition/white-flash-logo-simplify-cut.md +41 -0
  432. package/lib/motion/shotcraft/upstream/references/shots/transition/wipe-transitions.md +42 -0
  433. package/lib/motion/shotcraft/upstream/references/shots/typography/blur-slide.md +59 -0
  434. package/lib/motion/shotcraft/upstream/references/shots/typography/brace-expand.md +55 -0
  435. package/lib/motion/shotcraft/upstream/references/shots/typography/countdown-arc-scatter.md +65 -0
  436. package/lib/motion/shotcraft/upstream/references/shots/typography/document-typewriter-reveal.md +42 -0
  437. package/lib/motion/shotcraft/upstream/references/shots/typography/flying-words.md +64 -0
  438. package/lib/motion/shotcraft/upstream/references/shots/typography/glitch-cycle.md +64 -0
  439. package/lib/motion/shotcraft/upstream/references/shots/typography/gradient-word-sweep.md +54 -0
  440. package/lib/motion/shotcraft/upstream/references/shots/typography/lead-word-zoom-assemble.md +91 -0
  441. package/lib/motion/shotcraft/upstream/references/shots/typography/marker-underline-title.md +51 -0
  442. package/lib/motion/shotcraft/upstream/references/shots/typography/outline-word-fill.md +66 -0
  443. package/lib/motion/shotcraft/upstream/references/shots/typography/paper-title-card.md +38 -0
  444. package/lib/motion/shotcraft/upstream/references/shots/typography/pill-chip-slot-cycle-handled.md +66 -0
  445. package/lib/motion/shotcraft/upstream/references/shots/typography/pill-slot-cycle.md +58 -0
  446. package/lib/motion/shotcraft/upstream/references/shots/typography/text-column-converge.md +61 -0
  447. package/lib/motion/shotcraft/upstream/references/shots/typography/title-demote-to-label.md +64 -0
  448. package/lib/motion/shotcraft/upstream/references/shots/typography/type-assembly-moves.md +45 -0
  449. package/lib/motion/shotcraft/upstream/references/shots/typography/type-entrance-moves.md +41 -0
  450. package/lib/motion/shotcraft/upstream/references/shots/typography/type-rhythm-sync.md +51 -0
  451. package/lib/motion/shotcraft/upstream/references/shots/typography/typewriter-moves.md +42 -0
  452. package/lib/motion/shotcraft/upstream/references/shots/typography/vertical-word-roll-blur-cycle.md +63 -0
  453. package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-filmstrip.md +57 -0
  454. package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-geometry.md +75 -0
  455. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/avatar-bracket-carousel.md +59 -0
  456. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/bezier-source-converge-merge.md +67 -0
  457. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/card-stack.md +60 -0
  458. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/carousel-3d.md +66 -0
  459. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/cloner-depth-echo.md +40 -0
  460. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/deck-deal-flyin.md +45 -0
  461. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/doc-park-left-pill-deal.md +62 -0
  462. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/draw-svg-trace.md +55 -0
  463. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/element-body-moves.md +37 -0
  464. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/integration-hub-map.md +55 -0
  465. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-reveal.md +50 -0
  466. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-stack-press.md +43 -0
  467. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-forerun.md +55 -0
  468. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-orbit-drop.md +51 -0
  469. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/page-waterfall-wall.md +51 -0
  470. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/product-card-progressive-assemble.md +56 -0
  471. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/radial-wave.md +49 -0
  472. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/research-card-stack-scroll.md +57 -0
  473. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/row-embed.md +36 -0
  474. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/value-stagger-gradient.md +64 -0
  475. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/wall-reveal-moves.md +47 -0
  476. package/lib/motion/shotcraft/upstream/references/sound-design.md +170 -0
  477. package/lib/motion/shotcraft/upstream/references/workbench.md +157 -0
  478. package/lib/motion/shotcraft/upstream/template/TEMPLATE.md +103 -0
  479. package/lib/motion/shotcraft/upstream/template/THEMES.md +44 -0
  480. package/lib/motion/shotcraft/upstream/template/package.json +20 -0
  481. package/lib/motion/shotcraft/upstream/template/remotion.config.ts +6 -0
  482. package/lib/motion/shotcraft/upstream/template/src/Root.tsx +17 -0
  483. package/lib/motion/shotcraft/upstream/template/src/aifl/Caption.tsx +65 -0
  484. package/lib/motion/shotcraft/upstream/template/src/aifl/DigitRoll.tsx +48 -0
  485. package/lib/motion/shotcraft/upstream/template/src/aifl/FlashCut.tsx +24 -0
  486. package/lib/motion/shotcraft/upstream/template/src/aifl/Main.tsx +192 -0
  487. package/lib/motion/shotcraft/upstream/template/src/aifl/PaperTitleCard.tsx +111 -0
  488. package/lib/motion/shotcraft/upstream/template/src/aifl/live/PageCam.tsx +150 -0
  489. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneDetail.tsx +158 -0
  490. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneFlyIn.tsx +468 -0
  491. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOpen.tsx +552 -0
  492. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOutroLive.tsx +411 -0
  493. package/lib/motion/shotcraft/upstream/template/src/aifl/live/ScenePapers.tsx +200 -0
  494. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneWbr.tsx +324 -0
  495. package/lib/motion/shotcraft/upstream/template/src/aifl/live-layout.json +389 -0
  496. package/lib/motion/shotcraft/upstream/template/src/index.ts +4 -0
  497. package/lib/motion/shotcraft/upstream/template/src/themes/ThemedFilm.tsx +7 -0
  498. package/lib/motion/shotcraft/upstream/template/src/themes/manifest.tsx +68 -0
  499. package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.json +1 -0
  500. package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.ts +24 -0
  501. package/lib/motion/shotcraft/upstream/template/src/themes/palettes.json +74 -0
  502. package/lib/motion/shotcraft/upstream/template/src/themes/visual-theme.tsx +91 -0
  503. package/lib/motion/shotcraft/upstream/template/src/workbench.ts +213 -0
  504. package/lib/motion/shotcraft/upstream/template/tsconfig.json +15 -0
  505. package/lib/motion/spec.js +113 -0
  506. package/lib/motion/style-engine.js +153 -0
  507. package/lib/motion/style-frames.js +271 -0
  508. package/lib/motion/sync.js +214 -0
  509. package/lib/motion/theme.js +121 -0
  510. package/lib/motion/video-runtime.js +192 -0
  511. package/lib/motion/voice.js +417 -0
  512. package/lib/motion-agent-files.js +82 -0
  513. package/lib/motion-agent-protocol.js +66 -0
  514. package/lib/motion-agent-tools.js +196 -0
  515. package/lib/motion-agent.js +171 -0
  516. package/lib/motion-capture.js +93 -0
  517. package/lib/motion-core.js +238 -0
  518. package/lib/motion-film-review.js +71 -0
  519. package/lib/motion-library.js +210 -0
  520. package/lib/motion-planner.js +254 -0
  521. package/lib/motion-project.js +87 -0
  522. package/lib/motion-render-worker.js +153 -0
  523. package/lib/motion-session.js +32 -0
  524. package/lib/motion-source.js +49 -0
  525. package/lib/motion-tasks.js +452 -0
  526. package/lib/motion-vision.js +44 -0
  527. package/lib/mxfile.js +27 -7
  528. package/lib/routing/node-runtime.js +14 -0
  529. package/lib/routing/router.js +211 -0
  530. package/lib/routing/vendor/README.md +96 -0
  531. package/lib/routing/vendor/libavoid-routing.js +753 -0
  532. package/lib/routing/vendor/libavoid.min.js +59 -0
  533. package/lib/shotcard-core.js +39 -0
  534. package/lib/shotcard-reference.js +56 -0
  535. package/lib/style-kernel.js +37 -3
  536. package/lib/task-patches.js +26 -2
  537. package/lib/video-export.js +49 -22
  538. package/package.json +34 -4
@@ -0,0 +1,290 @@
1
+ // 帧检:把"片子到底有没有毛病"变成一份带帧号的报告,而不是靠人眼逐帧看。
2
+ //
3
+ // 上游 template 里有一份 final-review.md 讲怎么验片,但没有脚本;这里把它
4
+ // 落成可执行的四类检查(全部基于 ffmpeg,不引入新依赖):
5
+ //
6
+ // 1. 结构 帧数 / 时长与 timeline 是否一致(硬错误)
7
+ // 2. 黑场 整段纯黑(blackdetect)——通常是某镜没渲染出来
8
+ // 3. 呆帧 画面静止多久(freezedetect)——设计留白还是漏了动画
9
+ // 4. 闪烁 单帧亮度突变又立刻复原(手算 Y 均值序列)
10
+ // 5. 空白 近乎纯色的帧(内容是"忘了放东西")
11
+ // 6. 越界 四边安全区里出现了墨色(文字压边)
12
+ // 7. 响度 综合响度 / 真峰值 / 静音段(ebur128)
13
+ //
14
+ // 报告落 .out/qa/framecq/report.json,同时给一份能直接读的 markdown 摘要。
15
+
16
+ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, rmSync } from 'node:fs'
17
+ import { join, resolve as resolvePath } from 'node:path'
18
+ import { runFfmpeg } from './ffmpeg.js'
19
+ import { pixelQuality } from './pixelqa.js'
20
+ import { parseProjectJson } from './json.js'
21
+
22
+ const DEFAULTS = {
23
+ freezeSeconds: 1.2, // 静止超过这个时长就记一笔
24
+ flashDelta: 18, // 单帧亮度突变阈值(0–255)
25
+ emptyDelta: 18, // 亮度极差小于它就当空白帧
26
+ emptyFrames: 8, // 连续多少帧算"一段空白"
27
+ marginRatio: 0.035, // 四边安全区宽度(占画面宽/高)
28
+ marginDark: 170, // 安全区里出现比这更暗的像素=内容压边
29
+ blackPixThreshold: 0.10,
30
+ }
31
+
32
+ export function qaDir(dir) {
33
+ return join(dir, '.out', 'qa', 'framecq')
34
+ }
35
+
36
+ function parseStats(text) {
37
+ const rows = []
38
+ let row = null
39
+ for (const line of text.split(/\r?\n/)) {
40
+ const head = /^frame:(\d+)\s+pts:\S+\s+pts_time:([\d.]+)/.exec(line)
41
+ if (head) { row = { frame: Number(head[1]), t: Number(head[2]) }; rows.push(row); continue }
42
+ const kv = /^lavfi\.signalstats\.(\w+)=(-?[\d.]+)/.exec(line)
43
+ if (kv && row) row[kv[1].toLowerCase()] = Number(kv[2])
44
+ }
45
+ return rows
46
+ }
47
+
48
+ function runs(flags) {
49
+ const out = []
50
+ let start = -1
51
+ for (let i = 0; i <= flags.length; i += 1) {
52
+ if (i < flags.length && flags[i]) { if (start < 0) start = i; continue }
53
+ if (start >= 0) { out.push({ from: start, to: i - 1, length: i - start }); start = -1 }
54
+ }
55
+ return out
56
+ }
57
+
58
+ const second = (value) => Math.round(value * 100) / 100
59
+
60
+ export async function runFrameQa({ dir, file, timeline, options = {} }) {
61
+ // 工具层会把没传的参数也写成 undefined 传进来,展开时会把默认值顶掉(freezeSeconds 变 undefined,
62
+ // 静止判定就整段失效)—— 所以先剔掉 undefined 再合。
63
+ const given = Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined))
64
+ const settings = { ...DEFAULTS, ...given }
65
+ const source = resolvePath(file || join(dir, '.out', 'film.mp4'))
66
+ if (!existsSync(source)) throw new Error('没有成片可检:先 motion_render start 出一版(' + source + ')')
67
+ if (!timeline || !Array.isArray(timeline.shots)) throw new Error('缺少 timeline,无法把发现问题归到镜头')
68
+ const fps = Number(timeline.fps) || 30
69
+ const work = qaDir(dir)
70
+ rmSync(work, { recursive: true, force: true })
71
+ mkdirSync(work, { recursive: true })
72
+ const call = (args, extra = {}) => runFfmpeg(args, { cwd: work, ...extra })
73
+ const read = (name) => existsSync(join(work, name)) ? readFileSync(join(work, name), 'utf8') : ''
74
+
75
+ // 缩成 480 宽再做统计:统计量对分辨率不敏感,解码却快一个量级。
76
+ await call(['-i', source, '-an', '-vf', 'scale=480:-2', '-c:v', 'libx264', '-crf', '30', '-preset', 'veryfast', 'scaled.mp4'])
77
+ await call(['-i', 'scaled.mp4', '-an', '-vf', 'signalstats,metadata=print:file=stats.txt', '-f', 'null', '-'])
78
+ const stats = parseStats(read('stats.txt'))
79
+ if (!stats.length) throw new Error('ffmpeg 没有输出逐帧统计,成片可能无法解码')
80
+
81
+ const bands = { left: '0:0', right: 'iw-iw*R:0', top: '0:0', bottom: '0:ih-ih*R' }
82
+ const cropOf = {
83
+ left: 'crop=iw*R:ih:0:0', right: 'crop=iw*R:ih:iw-iw*R:0',
84
+ top: 'crop=iw:ih*R:0:0', bottom: 'crop=iw:ih*R:0:ih-ih*R',
85
+ }
86
+ const margins = {}
87
+ for (const band of Object.keys(cropOf)) {
88
+ const filter = cropOf[band].replace(/R/g, String(settings.marginRatio)) + ',signalstats,metadata=print:file=m-' + band + '.txt'
89
+ await call(['-i', 'scaled.mp4', '-an', '-vf', filter, '-f', 'null', '-'])
90
+ margins[band] = parseStats(read('m-' + band + '.txt'))
91
+ }
92
+
93
+ const detected = await call(['-i', source, '-an', '-vf',
94
+ 'blackdetect=d=0.10:pix_th=' + settings.blackPixThreshold + ',freezedetect=n=-55dB:d=' + Math.max(0.3, settings.freezeSeconds) / 2, '-f', 'null', '-'], { allowFail: true })
95
+ .catch((error) => String(error.stderr || error.message || ''))
96
+ const blacks = [...detected.matchAll(/black_start:([\d.]+)\s+black_end:([\d.]+)\s+black_duration:([\d.]+)/g)]
97
+ .map((match) => ({ from: Number(match[1]), to: Number(match[2]), seconds: Number(match[3]) }))
98
+ // freezedetect 三行分开打:start → duration → end。按出现顺序串起来。
99
+ const freezes = []
100
+ let open = null
101
+ for (const line of detected.split(/\r?\n/)) {
102
+ let match
103
+ if ((match = /freeze_start:\s*([\d.]+)/.exec(line))) { open = { from: Number(match[1]) }; freezes.push(open); continue }
104
+ if (open && (match = /freeze_duration:\s*([\d.]+)/.exec(line))) { open.seconds = Number(match[1]); continue }
105
+ if (open && (match = /freeze_end:\s*([\d.]+)/.exec(line))) { open.to = Number(match[1]); open = null }
106
+ }
107
+
108
+ const shotAt = (time) => {
109
+ const frame = Math.round(time * fps)
110
+ const shot = timeline.shots.find((item) => frame >= item.startFrame && frame < item.startFrame + item.durationFrames)
111
+ return shot ? shot.id : '(镜头之间)'
112
+ }
113
+
114
+ // 单帧突变:比前后两帧都跳、而前后两帧彼此接近 —— 那是闪,不是运动。
115
+ const flashes = []
116
+ for (let i = 1; i < stats.length - 1; i += 1) {
117
+ const before = stats[i - 1].yavg, here = stats[i].yavg, after = stats[i + 1].yavg
118
+ if (before === undefined || here === undefined || after === undefined) continue
119
+ if (Math.abs(here - before) > settings.flashDelta && Math.abs(here - after) > settings.flashDelta && Math.abs(before - after) < 8)
120
+ flashes.push({ frame: stats[i].frame, t: stats[i].t, yavg: here })
121
+ }
122
+
123
+ // 空白帧:亮度极差极小(既没有字也没有图)。
124
+ const flat = stats.map((row) => (row.ymax ?? 0) - (row.ymin ?? 0) < settings.emptyDelta)
125
+ const blanks = runs(flat).filter((run) => run.length >= settings.emptyFrames)
126
+ .map((run) => ({ from: stats[run.from].t, to: stats[run.to].t, frames: run.length }))
127
+
128
+ const marginHits = {}
129
+ for (const band of Object.keys(margins)) {
130
+ const rows = margins[band]
131
+ const dark = rows.map((row) => (row.ymin ?? 255) < settings.marginDark)
132
+ marginHits[band] = runs(dark).filter((run) => run.length >= 3)
133
+ .map((run) => ({ from: second(rows[run.from]?.t ?? 0), to: second(rows[run.to]?.t ?? 0), frames: run.length }))
134
+ }
135
+
136
+ // 像素级三项:色带、抗锯齿、字体。走原始灰度字节,所以能看见「这帧糊不糊」。
137
+ // 关掉它的方式:options.pixels === false(例如只想快速看结构问题)。
138
+ let pixels = null
139
+ if (settings.pixels !== false) {
140
+ try {
141
+ pixels = await pixelQuality({ source, work, timeline, dir, samples: settings.pixelSamples || 3 })
142
+ } catch (error) {
143
+ pixels = { error: error.message || String(error) }
144
+ }
145
+ }
146
+
147
+ const hasAudio = /Stream #\S+.*: Audio:/.test(await call(['-i', source], { allowFail: true }).catch(() => ''))
148
+ let audio = { hasAudio, checked: false }
149
+ if (hasAudio) {
150
+ const measured = await call(['-i', source, '-vn', '-af', 'ebur128=peak=true,silencedetect=noise=-50dB:d=0.5', '-f', 'null', '-'])
151
+ .catch((error) => String(error.stderr || ''))
152
+ const summary = measured.slice(measured.lastIndexOf('Summary:'))
153
+ const grab = (pattern) => { const found = pattern.exec(summary); return found ? Number(found[1]) : null }
154
+ audio = {
155
+ hasAudio, checked: true,
156
+ integratedLufs: grab(/I:\s*(-?[\d.]+) LUFS/), truePeakDb: grab(/Peak:\s*(-?[\d.]+) dBFS/),
157
+ silence: [...measured.matchAll(/silence_start:\s*([\d.]+)/g)].map((m) => Number(m[1])).slice(0, 12),
158
+ }
159
+ }
160
+
161
+ const durationSeconds = stats.length / fps
162
+ const expectedFrames = Number(timeline.durationInFrames)
163
+ const checks = []
164
+ const add = (level, id, message, detail) => checks.push({ level, id, message, ...(detail === undefined ? {} : { detail }) })
165
+
166
+ if (Math.abs(stats.length - expectedFrames) > 1)
167
+ add('fail', 'frames', '成片帧数 ' + stats.length + ' 与时间轴 ' + expectedFrames + ' 不一致(差 ' + (stats.length - expectedFrames) + ' 帧)')
168
+ else add('pass', 'frames', '帧数 ' + stats.length + ' 与时间轴一致')
169
+
170
+ for (const black of blacks) add('fail', 'black', '纯黑段 ' + second(black.from) + 's–' + second(black.to) + 's(' + second(black.seconds) + 's)', shotAt(black.from))
171
+ if (!blacks.length) add('pass', 'black', '没有纯黑段')
172
+
173
+ const longFreezes = freezes.filter((item) => item.seconds >= settings.freezeSeconds)
174
+ for (const freeze of longFreezes) {
175
+ const heavy = freeze.seconds >= settings.freezeSeconds * 2
176
+ add(heavy ? 'warn' : 'info', 'freeze',
177
+ '画面静止 ' + second(freeze.seconds) + 's(' + second(freeze.from) + 's–' + second(freeze.to ?? freeze.from + freeze.seconds) + 's)'
178
+ + (heavy ? '' : ',像是设计停留'), shotAt(freeze.from))
179
+ }
180
+ if (!longFreezes.length) add('pass', 'freeze', '没有超过 ' + settings.freezeSeconds + 's 的静止段')
181
+ else if (!longFreezes.some((item) => item.seconds >= settings.freezeSeconds * 2)) add('pass', 'freeze', '静止段都在设计停留的量级(<' + settings.freezeSeconds * 2 + 's)')
182
+
183
+ for (const flash of flashes.slice(0, 8)) add('warn', 'flash', '第 ' + flash.frame + ' 帧亮度突变(' + second(flash.t) + 's,Y≈' + second(flash.yavg) + ')', shotAt(flash.t))
184
+ if (!flashes.length) add('pass', 'flash', '没有单帧闪烁')
185
+
186
+ for (const blank of blanks) add('warn', 'blank', '近乎空白 ' + second(blank.from) + 's–' + second(blank.to) + 's(' + blank.frames + ' 帧)', shotAt(blank.from))
187
+ if (!blanks.length) add('pass', 'blank', '没有连续空白帧')
188
+
189
+ let marginCount = 0
190
+ for (const [band, hits] of Object.entries(marginHits)) {
191
+ if (!hits.length) continue
192
+ marginCount += hits.length
193
+ add('warn', 'margin-' + band, band + ' 侧安全区有内容 ' + hits.length + ' 段,最长起于 ' + hits[0].from + 's', hits.slice(0, 4))
194
+ }
195
+ if (!marginCount) add('pass', 'margin', '四边安全区干净')
196
+
197
+ if (pixels && !pixels.error) {
198
+ const worst = pixels.banding && pixels.banding.worst
199
+ const bandingSteps = settings.bandingSteps || 10
200
+ if (worst && worst.longest >= bandingSteps)
201
+ add('warn', 'banding', '渐变出现阶梯色带(最长 ' + worst.longest + ' 段、共 ' + worst.steps + ' 级,' + worst.time + 's 第 ' + worst.y + ' 行)—— 多半是 8bit 量化没配抖动', shotAt(worst.time))
202
+ else add('pass', 'banding', '没有检出色带阶梯' + (worst ? '(最长 ' + worst.longest + ' 段)' : ''))
203
+
204
+ const aaValue = pixels.aa ? pixels.aa.average : null
205
+ if (aaValue !== null) {
206
+ const aaMin = settings.aaMin === undefined ? 0.3 : settings.aaMin
207
+ if (aaValue < aaMin) add('warn', 'aa', '斜边过渡像素占比 ' + aaValue + '(低于 ' + aaMin + ')—— 边缘像台阶,考虑开累积或超采样')
208
+ else add('pass', 'aa', '斜边过渡像素占比 ' + aaValue)
209
+ } else {
210
+ // 测不出不等于没问题:整帧近乎单色时 Sobel 找不到过渡像素。
211
+ // 这时候报 pass 会让「平涂深色底 + 细线」这种最该检查的片子悄悄过关。
212
+ add('info', 'aa', '量不出斜边过渡(画面近乎单色或对比过低),AA 未验证;等有内容的帧再检一次')
213
+ }
214
+
215
+ const missing = (pixels.fonts && pixels.fonts.missing) || []
216
+ if (missing.length) add('fail', 'font', '场景声明了 ' + missing.length + ' 个没注册的字体(会静默退回系统字体):' + missing.map((item) => item.family).join('、'), missing.map((item) => item.file))
217
+ else add('pass', 'font', '字体都有注册或字体文件' + (pixels.fonts && pixels.fonts.families && pixels.fonts.families.length ? '(' + pixels.fonts.families.join(' / ') + ')' : ''))
218
+ } else if (pixels && pixels.error) add('info', 'pixels', '像素级检查没跑成:' + pixels.error)
219
+
220
+ if (audio.checked) {
221
+ if (audio.truePeakDb !== null && audio.truePeakDb > -0.1) add('warn', 'audio-peak', '真峰值 ' + audio.truePeakDb + ' dBFS,已贴顶')
222
+ else if (audio.truePeakDb !== null) add('pass', 'audio-peak', '真峰值 ' + audio.truePeakDb + ' dBFS')
223
+ if (audio.integratedLufs !== null && audio.integratedLufs < -45) add('warn', 'audio-level', '综合响度 ' + audio.integratedLufs + ' LUFS,整片近乎无声')
224
+ else if (audio.integratedLufs !== null) add('pass', 'audio-level', '综合响度 ' + audio.integratedLufs + ' LUFS')
225
+ if (audio.silence.length > 2) add('info', 'audio-silence', '有 ' + audio.silence.length + ' 处静音起点(设计上的空拍请忽略)', audio.silence)
226
+ } else add('info', 'audio', '成片没有音轨')
227
+
228
+ const byShot = timeline.shots.map((shot) => {
229
+ const from = shot.startFrame / fps, to = (shot.startFrame + shot.durationFrames) / fps
230
+ const inside = (time) => time >= from - 0.02 && time < to - 0.02
231
+ return {
232
+ id: shot.id, from, to, seconds: second(shot.durationFrames / fps),
233
+ freeze: second(Math.max(0, ...freezes.filter((item) => inside(item.from)).map((item) => item.seconds || 0))),
234
+ black: blacks.filter((item) => inside(item.from)).length,
235
+ blank: blanks.filter((item) => inside(item.from)).length,
236
+ flash: flashes.filter((item) => inside(item.t)).length,
237
+ margin: Object.values(marginHits).flat().filter((item) => inside(item.from)).length,
238
+ }
239
+ })
240
+
241
+ const fails = checks.filter((item) => item.level === 'fail').length
242
+ const warns = checks.filter((item) => item.level === 'warn').length
243
+ const report = {
244
+ generatedAt: new Date().toISOString(), file: source, fps, frames: stats.length, durationSeconds: second(durationSeconds),
245
+ verdict: fails ? 'fail' : warns ? 'warn' : 'pass', summary: { fail: fails, warn: warns, pass: checks.length - fails - warns },
246
+ shots: byShot, checks, audio, pixels,
247
+ freezeSegments: freezes.map((item) => ({ from: second(item.from), to: item.to === undefined ? null : second(item.to), seconds: second(item.seconds || 0) })).filter((item) => item.seconds >= settings.freezeSeconds),
248
+ settings,
249
+ }
250
+ writeFileSync(join(work, 'report.json'), JSON.stringify(report, null, 2) + '\n', 'utf8')
251
+ // 统一入口:渲染期的 report(worker 写的渲染规格/采样帧)与帧检结论合成一份,
252
+ // 读报告的人不需要知道有两个目录。
253
+ try {
254
+ const merged = join(dir, '.out', 'qa', 'report.json')
255
+ const base = existsSync(merged) ? parseProjectJson(readFileSync(merged, 'utf8')) : {}
256
+ base.frameQa = { generatedAt: report.generatedAt, verdict: report.verdict, summary: report.summary, checks, audio, pixels }
257
+ writeFileSync(merged, JSON.stringify(base, null, 2) + '\n', 'utf8')
258
+ } catch { /* 合并失败不该影响帧检结论 */ }
259
+ for (const name of readdirSync(work)) if (/\.(raw|log)$/.test(name)) rmSync(join(work, name), { force: true })
260
+ for (const name of ['stats.txt', 'm-left.txt', 'm-right.txt', 'm-top.txt', 'm-bottom.txt', 'scaled.mp4', 'ff.log'])
261
+ rmSync(join(work, name), { force: true })
262
+ return report
263
+ }
264
+
265
+ export function readQaReport(dir) {
266
+ const file = join(qaDir(dir), 'report.json')
267
+ if (!existsSync(file)) return null
268
+ return parseProjectJson(readFileSync(file, 'utf8'))
269
+ }
270
+
271
+ export function renderMarkdown(report) {
272
+ const line = (item) => '- [' + item.level + '] ' + item.message + (typeof item.detail === 'string' ? ' → ' + item.detail : '')
273
+ return [
274
+ '# 帧检报告',
275
+ '',
276
+ '结论:**' + report.verdict + '** (fail ' + report.summary.fail + ' / warn ' + report.summary.warn + ' / pass ' + report.summary.pass + ')',
277
+ '成片:' + report.frames + ' 帧 · ' + report.durationSeconds + 's · ' + report.fps + 'fps',
278
+ '',
279
+ '## 逐镜',
280
+ '',
281
+ '| 镜头 | 时长 | 最长静止 | 黑场 | 空白 | 闪烁 | 越界 |',
282
+ '| --- | --- | --- | --- | --- | --- | --- |',
283
+ ...report.shots.map((shot) => '| ' + shot.id + ' | ' + shot.seconds + 's | ' + shot.freeze + 's | ' + shot.black + ' | ' + shot.blank + ' | ' + shot.flash + ' | ' + shot.margin + ' |'),
284
+ '',
285
+ '## 发现',
286
+ '',
287
+ ...report.checks.map(line),
288
+ '',
289
+ ].join('\n')
290
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import { Img, OffthreadVideo, staticFile } from 'remotion'
3
+ export function ReferenceMedia({ referenceId, index = 0, assets, style = {}, region }) {
4
+ const asset = (assets[referenceId] || []).at(index)
5
+ if (!asset) throw new Error('场景缺少参考素材:' + referenceId + ':' + index)
6
+ if(region && (!Array.isArray(region)||region.length!==4||region.some(value=>!Number.isFinite(value))||region[0]<0||region[1]<0||region[2]<=0||region[3]<=0||region[0]+region[2]>1.001||region[1]+region[3]>1.001))throw new Error('参考素材裁切区域无效')
7
+ const props = { src: staticFile(asset.src), style: region ? {position:'absolute',objectFit:'fill',width:100/region[2]+'%',height:100/region[3]+'%',left:-region[0]/region[2]*100+'%',top:-region[1]/region[3]*100+'%'} : { objectFit: 'contain', ...style } }
8
+ const media=asset.kind === 'video' ? <OffthreadVideo {...props} muted /> : <Img {...props} />
9
+ return region?<div style={{...style,position:style.position||'relative',overflow:'hidden'}}>{media}</div>:media
10
+ }
@@ -0,0 +1,112 @@
1
+ // 渲染规格:把「这一帧怎么变成文件」从散落的默认值里收成一份可校验、可记录、可复现的数据。
2
+ //
3
+ // 为什么要有这个文件:spec.js 说的是「这条片子是什么」(宽高 / 帧率 / 时长),
4
+ // 这里说的是「它怎么落成文件」(编码、色彩标签、超采样、并发、超时)。
5
+ // 两者混在一起,就会出现「想渲 3840 再缩 1920」这种根本表达不出来的事。
6
+ //
7
+ // 读取优先级:timeline.json 的 render → 调用参数 → RENDER_DEFAULTS。
8
+ // 越界的值不静默接受,也不让整条渲染失败:夹到边界并把原因写进 warnings,
9
+ // 由调用方决定是提示还是拒渲。
10
+
11
+ export const RENDER_DEFAULTS = {
12
+ codec: 'h264',
13
+ crf: 14, // 交付级质量;18 是「看一眼」的档,不是母版
14
+ preset: 'slow', // renderMedia 的 x264Preset
15
+ pixelFormat: 'yuv420p',
16
+ colorSpace: 'bt709', // 淡紫底 #EEEAFC 不标 bt709 就会偏色 + 出色带
17
+ scale: 1, // 2 = 渲 3840 再缩回 1920(超采样),只对成片生效
18
+ concurrency: 2,
19
+ audioBitrate: '320k',
20
+ sampleRate: 48000,
21
+ timeoutMs: 30 * 60 * 1000,
22
+ // 下面两个是场景层参数:插件不执行它们,只记录并把它们交给 scene-kit。
23
+ samples: 1, // 同帧子渲染次数(GPU 内累积)
24
+ shutter: 0.5, // 快门开角比例,1 = 360°
25
+ }
26
+
27
+ const LIMITS = {
28
+ codec: ['h264', 'h265', 'vp8', 'vp9'],
29
+ crf: [10, 18],
30
+ preset: ['ultrafast', 'superfast', 'veryfast', 'faster', 'fast', 'medium', 'slow', 'slower', 'veryslow'],
31
+ pixelFormat: ['yuv420p', 'yuv422p', 'yuv444p'],
32
+ colorSpace: ['bt709', 'bt2020-10', 'bt2020-12'],
33
+ scale: [1, 2],
34
+ concurrency: [1, 4],
35
+ samples: [1, 16],
36
+ shutter: [0, 1],
37
+ timeoutMs: [60000, 6 * 60 * 60 * 1000],
38
+ }
39
+
40
+ const NUMERIC = new Set(['crf', 'scale', 'concurrency', 'samples', 'shutter', 'timeoutMs', 'sampleRate'])
41
+
42
+ function clean(input) {
43
+ if (!input || typeof input !== 'object') return {}
44
+ return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined && value !== null && value !== ''))
45
+ }
46
+
47
+ export function resolveRenderSettings(timeline, overrides = {}) {
48
+ const stored = timeline && typeof timeline.render === 'object' ? timeline.render : {}
49
+ const merged = { ...RENDER_DEFAULTS, ...clean(stored), ...clean(overrides) }
50
+ const warnings = []
51
+ const settings = {}
52
+ for (const key of Object.keys(RENDER_DEFAULTS)) {
53
+ const value = merged[key]
54
+ const limit = LIMITS[key]
55
+ if (!limit) { settings[key] = value; continue }
56
+ if (NUMERIC.has(key)) {
57
+ const number = Number(value)
58
+ if (!Number.isFinite(number)) {
59
+ warnings.push(key + ' 不是数字(' + String(value) + '),用默认 ' + RENDER_DEFAULTS[key])
60
+ settings[key] = RENDER_DEFAULTS[key]
61
+ continue
62
+ }
63
+ if (number < limit[0] || number > limit[1]) {
64
+ const clamped = Math.min(Math.max(number, limit[0]), limit[1])
65
+ warnings.push(key + ' = ' + number + ' 超出允许范围 ' + limit[0] + '–' + limit[1] + ',已夹到 ' + clamped)
66
+ settings[key] = clamped
67
+ continue
68
+ }
69
+ settings[key] = Math.round(number * 1000) / 1000
70
+ continue
71
+ }
72
+ if (!limit.includes(value)) {
73
+ warnings.push(key + ' = ' + String(value) + ' 不在 ' + limit.join('/') + ' 里,用默认 ' + RENDER_DEFAULTS[key])
74
+ settings[key] = RENDER_DEFAULTS[key]
75
+ continue
76
+ }
77
+ settings[key] = value
78
+ }
79
+ // 超采样与累积是相乘的:scale² × samples。两条同时拉满能把单帧成本推到 64 倍,
80
+ // 那时不是「慢一点」,是必然撞超时,所以先算预算再开跑。
81
+ const pixels = Number(timeline?.width || 1920) * Number(timeline?.height || 1080)
82
+ const cost = settings.scale * settings.scale * settings.samples
83
+ const budget = 8 // 等效像素放大倍数的上限(1080p × 8)
84
+ settings.estimatedCost = Math.round(cost * 100) / 100
85
+ if (cost > budget) {
86
+ const suggestSamples = Math.max(1, Math.floor(budget / (settings.scale * settings.scale)))
87
+ warnings.push('scale=' + settings.scale + ' × samples=' + settings.samples + ' 相当于 ' + settings.estimatedCost
88
+ + ' 倍像素工作量(预算 ' + budget + ');建议 samples 降到 ' + suggestSamples + ' 或关掉超采样')
89
+ }
90
+ settings.pixels = pixels
91
+ settings.warnings = warnings
92
+ return settings
93
+ }
94
+
95
+ // 超时按帧数放大:settings.timeoutMs 是 300 帧整片的预算,
96
+ // 样片(几十帧)不该按整片等,长片(1200 帧)也不该被 30 分钟卡死。
97
+ export function timeoutFor(settings, frames) {
98
+ const base = Number(settings?.timeoutMs) || RENDER_DEFAULTS.timeoutMs
99
+ const count = Number(frames) || 300
100
+ const scale = Math.max(0.25, Math.min(4, count / 300))
101
+ return Math.round(base * scale)
102
+ }
103
+
104
+ // 写进报告的一行字:出问题时要能一眼看出「这条片子是用什么参数渲的」。
105
+ export function describeRenderSettings(settings) {
106
+ const s = settings || RENDER_DEFAULTS
107
+ return [
108
+ s.codec, 'crf=' + s.crf, 'preset=' + s.preset, s.pixelFormat, s.colorSpace,
109
+ 'scale=' + s.scale, 'concurrency=' + s.concurrency,
110
+ 'audio=' + s.audioBitrate + '/' + Math.round(s.sampleRate / 1000) + 'k',
111
+ ].join(' · ')
112
+ }
@@ -0,0 +1,161 @@
1
+ // 渲染入口:把"工程目录 + 一个操作"翻译成一次 worker 调用。
2
+ //
3
+ // 三条规则(对应之前 58 分钟里最贵的三个坑):
4
+ // 1. 永远异步:调用方拿到 jobId 就返回,不要把对话卡在 await 上;
5
+ // 2. 永远复用 bundle:预览和全片共用 .out/bundle/.drawai-bundle-key;
6
+ // 3. 永远先出图:预览走 renderStill,几秒钟,不跑全片。
7
+
8
+ import { videoRuntimeDirectory } from './video-runtime.js'
9
+ import { fork } from 'node:child_process'
10
+ import { fileURLToPath } from 'node:url'
11
+ import { createHash } from 'node:crypto'
12
+ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs'
13
+ import { join } from 'node:path'
14
+ import { buildComposition, readTimeline } from './project.js'
15
+ import { assetsHash } from './assets.js'
16
+ import { normalizeMix } from './audiomix.js'
17
+ import { writeBundledFonts } from './fonts.js'
18
+ import { syncRevision, filmHash } from './sync.js'
19
+ import { resolveRenderSettings, timeoutFor, describeRenderSettings } from './render-settings.js'
20
+
21
+ const WORKER = fileURLToPath(new URL('../motion-render-worker.js', import.meta.url))
22
+ // entry.jsx 是打包入口:它改了(比如加了 <Audio>)也必须重建 bundle,
23
+ // 否则会拿旧缓存渲染出一条没有声音的片子。
24
+ const ENTRY = fileURLToPath(new URL('./entry.jsx', import.meta.url))
25
+
26
+ export function outputPath(dir, name = 'film.mp4') {
27
+ return join(dir, '.out', name)
28
+ }
29
+
30
+ // bundle 的缓存键 = 所有场景源码 + 时间轴 + 尺寸 + 素材指纹。改任何一个字节就重建一次。
31
+ export function bundleKey(composition, projectDir) {
32
+ const hash = createHash('sha256')
33
+ hash.update(JSON.stringify({
34
+ width: composition.width, height: composition.height, fps: composition.fps,
35
+ durationFrames: composition.durationFrames,
36
+ shots: composition.shots.map((shot) => [shot.id, shot.startFrame, shot.durationFrames]),
37
+ assets: projectDir ? assetsHash(projectDir) : '',
38
+ }))
39
+ for (const shot of composition.shots) hash.update(shot.sceneSource)
40
+ if (projectDir && existsSync(projectDir)) {
41
+ const walk = (rel = '') => {
42
+ for (const entry of readdirSync(join(projectDir, rel), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
43
+ if (entry.isDirectory() && ['.out', 'assets', 'node_modules', '.git'].includes(entry.name)) continue
44
+ const next = rel ? join(rel, entry.name) : entry.name
45
+ if (entry.isDirectory()) walk(next)
46
+ else if (entry.isSymbolicLink()) throw new Error('视频工程源码目录不支持符号链接:' + next)
47
+ else if (entry.isFile() && /\.(?:[cm]?[jt]sx?|css|json|svg|wasm)$/i.test(entry.name)) {
48
+ const content = readFileSync(join(projectDir, next))
49
+ hash.update(JSON.stringify([next.replace(/\\/g, '/'), content.length])).update(content)
50
+ }
51
+ }
52
+ }
53
+ walk()
54
+ }
55
+ hash.update(readFileSync(ENTRY))
56
+ hash.update(videoRuntimeDirectory())
57
+ return hash.digest('hex')
58
+ }
59
+
60
+ function prepare(dir, options) {
61
+ writeBundledFonts(dir)
62
+ const composition = options.composition || buildComposition(dir)
63
+ if (!options.composition) composition.bundledFonts = true
64
+ const outDirectory = join(dir, '.out')
65
+ mkdirSync(outDirectory, { recursive: true })
66
+ const publicDir = join(dir, 'assets')
67
+ return { composition, outDirectory, publicDir: existsSync(publicDir) ? publicDir : undefined }
68
+ }
69
+
70
+ // 起一个 render worker。返回 { promise, cancel }:
71
+ // promise 在 done/error/exit 时结算,不阻塞调用方。
72
+ export function renderProject(dir, options = {}) {
73
+ const { composition, outDirectory, publicDir } = prepare(dir, options)
74
+ const timeline = readTimeline(dir)
75
+ const syncReceipt = timeline.sync ? { revision: syncRevision(dir, timeline), fps: timeline.fps } : null
76
+ const operation = options.operation || 'still'
77
+ // 预览永远按 1× 渲:我们要看的是构图和字,不是锯齿;超采样留给成片。
78
+ const settings = resolveRenderSettings(timeline, options.render)
79
+ const render = operation === 'still' ? { ...settings, scale: 1, samples: 1, estimatedCost: 1 } : settings
80
+ const output = options.output || outputPath(dir, operation === 'still' ? 'still.mp4' : 'film.mp4')
81
+ // 场景拿到的 plan.render 必须是**夹取后的**值:只透传时间轴原值的话,
82
+ // 没写 render 的工程在场景里看到的是 {},默认采样数就丢了。
83
+ composition.render = render
84
+ const bundleDir = join(outDirectory, 'bundle')
85
+ const request = {
86
+ composition,
87
+ projectDirectory: dir,
88
+ output,
89
+ publicDir,
90
+ bundleDir,
91
+ bundleKey: bundleKey(composition, dir),
92
+ reuseBundle: options.reuseBundle !== false,
93
+ keepBundle: true,
94
+ preserveSources: true,
95
+ operation,
96
+ assets: options.assets || {},
97
+ render,
98
+ frames: operation === 'still' ? (options.frames || []).map((frame) => Math.round(Number(frame))) : undefined,
99
+ frameRange: options.frameRange,
100
+ qaDirectory: join(outDirectory, 'qa'),
101
+ poster: join(outDirectory, 'poster.png'),
102
+ }
103
+ if (operation === 'still' && !request.frames.length) throw new Error('预览需要至少一帧,例如 frames:[0,60,120]')
104
+ if (operation === 'still' && request.frames.some((frame) => !Number.isInteger(frame) || frame < 0 || frame >= composition.durationFrames))
105
+ throw new Error('预览帧超出 0–' + (composition.durationFrames - 1))
106
+
107
+ const child = fork(WORKER, [], { windowsHide: true, stdio: ['ignore', 'ignore', 'pipe', 'ipc'], execArgv: [] })
108
+ let settled = false
109
+ let cancelTimer
110
+ const rendered = new Promise((resolve, reject) => {
111
+ const finish = (fn, value) => { if (settled) return; settled = true; clearTimeout(cancelTimer); fn(value) }
112
+ const timeout = setTimeout(() => { child.kill(); finish(reject, new Error('渲染超过 ' + Math.round(timeoutFor(render, composition.durationFrames) / 60000) + ' 分钟,请拆小场景或在 timeline.json 的 render.timeoutMs 里放大预算')) }, options.timeoutMs || (timeoutFor(render, composition.durationFrames) + 11 * 60000))
113
+ let stderr = ''
114
+ child.stderr.on('data', (bytes) => { stderr = (stderr + bytes).slice(-4000) })
115
+ child.on('message', (message) => {
116
+ if (message.type === 'progress') options.onProgress?.(message)
117
+ if (message.type === 'done') { clearTimeout(timeout); finish(resolve, { ...message, output, bundleDir }) }
118
+ if (message.type === 'error') { clearTimeout(timeout); finish(reject, new Error(message.error)) }
119
+ })
120
+ child.on('error', (error) => { clearTimeout(timeout); finish(reject, error) })
121
+ child.on('exit', (code) => {
122
+ clearTimeout(timeout)
123
+ if (!settled) finish(reject, new Error('渲染进程退出(' + code + '):' + stderr))
124
+ })
125
+ child.send(request)
126
+ })
127
+ const cancel = () => {
128
+ if (child.connected) child.send({ type: 'cancel' })
129
+ cancelTimer = setTimeout(() => child.kill(), 5000)
130
+ }
131
+ // 渲完之后再过一遍响度归一 + 限幅。
132
+ // 只对整片做:切片渲染(frameRange)归一化会把片段当整条量,结果是错的。
133
+ // 归一化的目标可以在 timeline.json 的 audioMix 里改,也可以在调用时用 options.mix 覆盖。
134
+ const promise = rendered.then(async (result) => {
135
+ if (operation !== 'full' || options.frameRange) return result
136
+ if (!(composition.audio || []).length) return result
137
+ let config = {}
138
+ try { config = { ...(readTimeline(dir).audioMix || {}) } } catch { config = {} }
139
+ config = { ...config, ...(options.mix || {}) }
140
+ if (config.normalize === false) return result
141
+ options.onProgress?.({ type: 'progress', phase: 'mixing', progress: 0.97 })
142
+ try {
143
+ const mix = await normalizeMix(output, { ...config, cwd: outDirectory, log: join(outDirectory, 'mix.log'), timeoutMs: 180000 })
144
+ return { ...result, mix }
145
+ } catch (error) {
146
+ // 混音后级失败不该让一条已经渲好的片子作废:带着错误回去,由调用方提示。
147
+ return { ...result, mixError: error.message }
148
+ }
149
+ })
150
+ const completed = promise.then((result) => {
151
+ if (operation === 'full' && !options.frameRange && syncReceipt) writeFileSync(output + '.sync.json', JSON.stringify({ ...syncReceipt, filmHash: filmHash(output) }))
152
+ return { ...result, render, renderSummary: describeRenderSettings(render) }
153
+ })
154
+ return { promise: completed, cancel, output, bundleDir, render }
155
+ }
156
+
157
+ export function outputInfo(file) {
158
+ if (!existsSync(file)) return null
159
+ const stat = statSync(file)
160
+ return { path: file, bytes: stat.size, at: stat.mtime.toISOString() }
161
+ }