swf2js 0.1.2 → 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.
Files changed (416) hide show
  1. package/README.md +81 -14
  2. package/package.json +11 -7
  3. package/studio/actionscript-roundtrip.test.js +54 -0
  4. package/studio/actionscript-scripts.test.js +169 -0
  5. package/studio/animated-image.test.js +137 -0
  6. package/studio/arithmetic.test.js +16 -0
  7. package/studio/as3-import.test.js +110 -0
  8. package/studio/audio-info.test.js +44 -0
  9. package/studio/components.test.js +152 -0
  10. package/studio/document-editing.test.js +92 -0
  11. package/studio/examples/01-space-mission.json +1628 -0
  12. package/studio/examples/02-clockwork-vault.json +1079 -0
  13. package/studio/examples/03-neon-synth.json +1364 -0
  14. package/studio/examples/04-kinetic-poster.json +923 -0
  15. package/studio/examples/05-signal-relay.json +1131 -0
  16. package/studio/examples/06-calculator.json +564 -0
  17. package/studio/frame-editing.test.js +129 -0
  18. package/studio/frame-events.test.js +117 -0
  19. package/studio/groups.test.js +88 -0
  20. package/studio/index.html +962 -0
  21. package/studio/interaction-triggers.test.js +37 -0
  22. package/studio/linked-actions.test.js +48 -0
  23. package/studio/lottie.test.js +208 -0
  24. package/studio/masks.test.js +43 -0
  25. package/studio/media-assets.test.js +62 -0
  26. package/studio/paint-tools.test.js +60 -0
  27. package/studio/playback.test.js +17 -0
  28. package/studio/project-io.test.js +405 -0
  29. package/studio/project-preview.test.js +475 -0
  30. package/studio/scene-transition.test.js +32 -0
  31. package/studio/server/archive-companions.js +27 -0
  32. package/studio/server/as3-library.js +91 -0
  33. package/studio/server/assets.js +162 -0
  34. package/studio/server/audio-info.js +82 -0
  35. package/studio/server/font-files.js +332 -0
  36. package/studio/server/http.js +135 -0
  37. package/studio/server/linked-actions.js +93 -0
  38. package/studio/server/png-decode.js +1 -0
  39. package/studio/server/project-movie.js +1164 -0
  40. package/studio/server/project-preview.js +152 -0
  41. package/studio/server/projects.js +370 -0
  42. package/studio/server/report.js +29 -0
  43. package/studio/server/routes.js +93 -0
  44. package/studio/server/swf-authoring.js +90 -0
  45. package/studio/server/swf-control-runtime.as +513 -0
  46. package/studio/server/swf-controls.js +119 -0
  47. package/studio/server/swf-export.js +293 -0
  48. package/studio/server/swf-import.js +1675 -0
  49. package/studio/server/swf-morphs.js +64 -0
  50. package/studio/server/swf-routes.js +42 -0
  51. package/studio/server/swf-streams.js +80 -0
  52. package/studio/server/swf-transition-runtime.as +52 -0
  53. package/studio/server/tween-recovery.js +106 -0
  54. package/studio/server-api.test.js +283 -0
  55. package/studio/server.js +320 -0
  56. package/studio/src/animated-image.js +423 -0
  57. package/studio/src/appearance-inspector.js +63 -0
  58. package/studio/src/arithmetic.js +50 -0
  59. package/studio/src/authored-controls.js +42 -0
  60. package/studio/src/busy.js +41 -0
  61. package/studio/src/canvas.js +430 -0
  62. package/studio/src/clipper-browser.js +2 -0
  63. package/studio/src/color-transform.js +38 -0
  64. package/studio/src/component-inspector.js +126 -0
  65. package/studio/src/components.js +268 -0
  66. package/studio/src/display-frame.js +262 -0
  67. package/studio/src/document-editing.js +69 -0
  68. package/studio/src/event-editor.js +150 -0
  69. package/studio/src/frame-editing.js +150 -0
  70. package/studio/src/frame-events.js +128 -0
  71. package/studio/src/frame-image.js +28 -0
  72. package/studio/src/groups.js +125 -0
  73. package/studio/src/handler-editor.js +122 -0
  74. package/studio/src/history.js +83 -0
  75. package/studio/src/imported-paths.js +99 -0
  76. package/studio/src/index.js +3582 -0
  77. package/studio/src/interaction-triggers.js +42 -0
  78. package/studio/src/json-patch.js +77 -0
  79. package/studio/src/layer-icons.js +25 -0
  80. package/studio/src/lottie-export.js +948 -0
  81. package/studio/src/lottie-import.js +1138 -0
  82. package/studio/src/masks.js +69 -0
  83. package/studio/src/media-assets.js +188 -0
  84. package/studio/src/media-library.js +193 -0
  85. package/studio/src/model.js +431 -0
  86. package/studio/src/numeric-fields.js +46 -0
  87. package/studio/src/object-list.js +57 -0
  88. package/studio/src/paint-tools.js +76 -0
  89. package/studio/src/placement-effects.js +74 -0
  90. package/studio/src/playback.js +10 -0
  91. package/studio/src/preview-audio.js +64 -0
  92. package/studio/src/preview-interactions.js +106 -0
  93. package/studio/src/preview-recorder.js +335 -0
  94. package/studio/src/preview-surface.js +338 -0
  95. package/studio/src/project-io.js +905 -0
  96. package/studio/src/project-session.js +375 -0
  97. package/studio/src/projects-dialog.js +319 -0
  98. package/studio/src/scene-transition.js +129 -0
  99. package/studio/src/script-editor.js +175 -0
  100. package/studio/src/script-references.js +74 -0
  101. package/studio/src/scripted-controls.js +146 -0
  102. package/studio/src/scripts.js +185 -0
  103. package/studio/src/stage-guides.js +101 -0
  104. package/studio/src/svg-animation.js +416 -0
  105. package/studio/src/svg-context.js +522 -0
  106. package/studio/src/svg-frame.js +413 -0
  107. package/studio/src/svg-import.js +1208 -0
  108. package/studio/src/swf-recording.js +104 -0
  109. package/studio/src/symbol-library.js +39 -0
  110. package/studio/src/symbols.js +62 -0
  111. package/studio/src/text-fields.js +58 -0
  112. package/studio/src/theme.js +43 -0
  113. package/studio/src/timeline.js +321 -0
  114. package/studio/src/vector-cut.js +103 -0
  115. package/studio/src/vector-geometry.js +254 -0
  116. package/studio/src/vector-style.js +146 -0
  117. package/studio/src/video-encode.js +84 -0
  118. package/studio/src/video-export.js +331 -0
  119. package/studio/src/video-mux.js +339 -0
  120. package/studio/src/video-playback.js +281 -0
  121. package/studio/src/workspace.js +344 -0
  122. package/studio/stroke-style.test.js +119 -0
  123. package/studio/styles.css +1547 -0
  124. package/studio/svg-export.test.js +162 -0
  125. package/studio/svg-import.test.js +318 -0
  126. package/studio/swf-authoring.test.js +140 -0
  127. package/studio/swf-export.test.js +324 -0
  128. package/studio/swf-import.test.js +489 -0
  129. package/studio/symbols.test.js +68 -0
  130. package/studio/tests/accessibility-interactions.mjs +138 -0
  131. package/studio/tests/appearance-interactions.mjs +103 -0
  132. package/studio/tests/control-interactions.mjs +60 -0
  133. package/studio/tests/event-interactions.mjs +117 -0
  134. package/studio/tests/external-resources.mjs +174 -0
  135. package/studio/tests/frame-image.mjs +71 -0
  136. package/studio/tests/html-export.mjs +68 -0
  137. package/studio/tests/import-files.mjs +131 -0
  138. package/studio/tests/lottie.mjs +125 -0
  139. package/studio/tests/mask-interactions.mjs +148 -0
  140. package/studio/tests/media-interactions.mjs +109 -0
  141. package/studio/tests/paint-interactions.mjs +64 -0
  142. package/studio/tests/project-interactions.mjs +244 -0
  143. package/studio/tests/script-interactions.mjs +178 -0
  144. package/studio/tests/scripted-control-interactions.mjs +107 -0
  145. package/studio/tests/svg-export.mjs +149 -0
  146. package/studio/tests/text-field-interactions.mjs +64 -0
  147. package/studio/tests/theme-interactions.mjs +53 -0
  148. package/studio/tests/timeline-browser.mjs +507 -0
  149. package/studio/tests/transition-interactions.mjs +94 -0
  150. package/studio/tests/trigger-interactions.mjs +93 -0
  151. package/studio/tests/video-export.mjs +243 -0
  152. package/studio/tests/workspace-interactions.mjs +226 -0
  153. package/studio/tween-recovery.test.js +31 -0
  154. package/studio/vector-style.test.js +56 -0
  155. package/studio/video-export.test.js +326 -0
  156. package/studiospec/actionscript.md +88 -0
  157. package/studiospec/architecture.md +378 -0
  158. package/studiospec/controls.md +100 -0
  159. package/studiospec/file-support.md +268 -0
  160. package/studiospec/lottie.md +69 -0
  161. package/studiospec/requirements.md +135 -0
  162. package/studiospec/stroke-style.md +95 -0
  163. package/studiospec/svg-export.md +83 -0
  164. package/studiospec/svg-import.md +139 -0
  165. package/studiospec/swooflib-integration.md +115 -0
  166. package/studiospec/tasks.md +573 -0
  167. package/studiospec/video-export.md +127 -0
  168. package/swf2js/__tests__/actionscript.test.js +1609 -0
  169. package/swf2js/__tests__/adpcm-audio.test.js +43 -0
  170. package/swf2js/__tests__/as2-compiler.test.js +153 -0
  171. package/swf2js/__tests__/as3-mixed-depth.test.js +498 -0
  172. package/swf2js/__tests__/authored-sprite-hit.test.js +118 -0
  173. package/swf2js/__tests__/authored-sprite-sizing.test.js +164 -0
  174. package/swf2js/__tests__/avm1-action-prefix.test.js +134 -0
  175. package/swf2js/__tests__/avm1-attach-movie.test.js +1151 -0
  176. package/swf2js/__tests__/avm1-boxhead-budget.test.js +73 -0
  177. package/swf2js/__tests__/avm1-cfg-bubble-tanks.test.js +101 -0
  178. package/swf2js/__tests__/avm1-cfg-mario-kart.test.js +184 -0
  179. package/swf2js/__tests__/avm1-cfg-mario.test.js +31 -0
  180. package/swf2js/__tests__/avm1-cfg-pacman.test.js +49 -0
  181. package/swf2js/__tests__/avm1-checkers-gameplay.test.js +122 -0
  182. package/swf2js/__tests__/avm1-clip-actions.test.js +2002 -0
  183. package/swf2js/__tests__/avm1-clone-drag.test.js +626 -0
  184. package/swf2js/__tests__/avm1-decompiler.test.js +102 -0
  185. package/swf2js/__tests__/avm1-dynamic-locals.test.js +159 -0
  186. package/swf2js/__tests__/avm1-formal-parameters.test.js +71 -0
  187. package/swf2js/__tests__/avm1-key-events.test.js +52 -0
  188. package/swf2js/__tests__/avm1-load-bitmap.test.js +75 -0
  189. package/swf2js/__tests__/avm1-loading-host-actions.test.js +764 -0
  190. package/swf2js/__tests__/avm1-multibyte-strings.test.js +63 -0
  191. package/swf2js/__tests__/avm1-pacman-gameplay.test.js +115 -0
  192. package/swf2js/__tests__/avm1-shape-hittest.test.js +311 -0
  193. package/swf2js/__tests__/avm1-shared-bodies.test.js +57 -0
  194. package/swf2js/__tests__/avm1-shared-runtime.test.js +1364 -0
  195. package/swf2js/__tests__/avm1-snake-gameplay.test.js +139 -0
  196. package/swf2js/__tests__/avm1-super.test.js +70 -0
  197. package/swf2js/__tests__/avm1-target-path.test.js +325 -0
  198. package/swf2js/__tests__/avm1-try.test.js +229 -0
  199. package/swf2js/__tests__/avm2-activation-closures.test.js +65 -0
  200. package/swf2js/__tests__/avm2-applytype.test.js +180 -0
  201. package/swf2js/__tests__/avm2-call-ops.test.js +232 -0
  202. package/swf2js/__tests__/avm2-callsuperid.test.js +231 -0
  203. package/swf2js/__tests__/avm2-class-initializer.test.js +219 -0
  204. package/swf2js/__tests__/avm2-custom-namespace.test.js +139 -0
  205. package/swf2js/__tests__/avm2-describe-type.test.js +96 -0
  206. package/swf2js/__tests__/avm2-dictionary.test.js +96 -0
  207. package/swf2js/__tests__/avm2-domain-memory.test.js +332 -0
  208. package/swf2js/__tests__/avm2-e4x.test.js +326 -0
  209. package/swf2js/__tests__/avm2-exceptions.test.js +81 -0
  210. package/swf2js/__tests__/avm2-findprop.test.js +110 -0
  211. package/swf2js/__tests__/avm2-getlex.test.js +166 -0
  212. package/swf2js/__tests__/avm2-global-slot.test.js +106 -0
  213. package/swf2js/__tests__/avm2-interface.test.js +95 -0
  214. package/swf2js/__tests__/avm2-multiname-precedence.test.js +148 -0
  215. package/swf2js/__tests__/avm2-named-namespace-types.test.js +106 -0
  216. package/swf2js/__tests__/avm2-optional-args.test.js +100 -0
  217. package/swf2js/__tests__/avm2-outer-scopes.test.js +101 -0
  218. package/swf2js/__tests__/avm2-package-internal-class.test.js +106 -0
  219. package/swf2js/__tests__/avm2-protected-namespace.test.js +105 -0
  220. package/swf2js/__tests__/avm2-protected.test.js +214 -0
  221. package/swf2js/__tests__/avm2-qwop-gameplay.test.js +116 -0
  222. package/swf2js/__tests__/avm2-runtime-namespaces.test.js +159 -0
  223. package/swf2js/__tests__/avm2-script-traits.test.js +89 -0
  224. package/swf2js/__tests__/avm2-shared-runtime.test.js +52 -0
  225. package/swf2js/__tests__/avm2-slot-ops.test.js +117 -0
  226. package/swf2js/__tests__/avm2-type-ops.test.js +224 -0
  227. package/swf2js/__tests__/bevel-filter.test.js +116 -0
  228. package/swf2js/__tests__/bitmap-button-mask.test.js +106 -0
  229. package/swf2js/__tests__/bitmap-data-draw.test.js +388 -0
  230. package/swf2js/__tests__/bitmap-decoder.test.js +108 -0
  231. package/swf2js/__tests__/bitmapdata-color-bounds.test.js +70 -0
  232. package/swf2js/__tests__/bitmapdata-copy-channel.test.js +91 -0
  233. package/swf2js/__tests__/bitmapdata-copy-pixels.test.js +136 -0
  234. package/swf2js/__tests__/bitmapdata-fill-compare.test.js +241 -0
  235. package/swf2js/__tests__/bitmapdata-filter.test.js +232 -0
  236. package/swf2js/__tests__/bitmapdata-hit-test.test.js +71 -0
  237. package/swf2js/__tests__/bitmapdata-merge.test.js +84 -0
  238. package/swf2js/__tests__/bitmapdata-palette-map.test.js +92 -0
  239. package/swf2js/__tests__/bitmapdata-pixels-io.test.js +198 -0
  240. package/swf2js/__tests__/bitmapdata-threshold.test.js +97 -0
  241. package/swf2js/__tests__/bitmapdata-vector.test.js +82 -0
  242. package/swf2js/__tests__/blur-filter.test.js +48 -0
  243. package/swf2js/__tests__/bundle-emitter.test.js +394 -0
  244. package/swf2js/__tests__/button-actions.test.js +370 -0
  245. package/swf2js/__tests__/button-color-transform.test.js +48 -0
  246. package/swf2js/__tests__/button-decoder.test.js +106 -0
  247. package/swf2js/__tests__/button-hit-test.test.js +825 -0
  248. package/swf2js/__tests__/button-scaling-grid.test.js +124 -0
  249. package/swf2js/__tests__/button-sound.test.js +105 -0
  250. package/swf2js/__tests__/bytearray-coercion.test.js +23 -0
  251. package/swf2js/__tests__/bytearray-object-serialization.test.js +380 -0
  252. package/swf2js/__tests__/cfg-switch-loop.test.js +103 -0
  253. package/swf2js/__tests__/clip-depth-mask.test.js +119 -0
  254. package/swf2js/__tests__/clipped-bitmap-fill.test.js +118 -0
  255. package/swf2js/__tests__/companion-swf.test.js +638 -0
  256. package/swf2js/__tests__/context-menu.test.js +149 -0
  257. package/swf2js/__tests__/convolution-filter.test.js +74 -0
  258. package/swf2js/__tests__/definefont4.test.js +280 -0
  259. package/swf2js/__tests__/display-displacement.test.js +161 -0
  260. package/swf2js/__tests__/display-list.test.js +80 -0
  261. package/swf2js/__tests__/display-mask-render.test.js +656 -0
  262. package/swf2js/__tests__/displayobject-stage.test.js +320 -0
  263. package/swf2js/__tests__/embedded-script-audio.test.js +131 -0
  264. package/swf2js/__tests__/embedded-swf.test.js +202 -0
  265. package/swf2js/__tests__/embedded-textfield.test.js +107 -0
  266. package/swf2js/__tests__/embedded-timeline-audio.test.js +182 -0
  267. package/swf2js/__tests__/embedded-timeline-input.test.js +420 -0
  268. package/swf2js/__tests__/embedded-timer-lifecycle.test.js +145 -0
  269. package/swf2js/__tests__/event-priority-order.test.js +125 -0
  270. package/swf2js/__tests__/event-weak-listeners.test.js +53 -0
  271. package/swf2js/__tests__/event-will-trigger.test.js +43 -0
  272. package/swf2js/__tests__/flash-text-engine-content.test.js +115 -0
  273. package/swf2js/__tests__/flash-text-engine-format.test.js +95 -0
  274. package/swf2js/__tests__/flash-text-engine-line.test.js +314 -0
  275. package/swf2js/__tests__/font-encoder.test.js +95 -0
  276. package/swf2js/__tests__/font-outline-text.test.js +659 -0
  277. package/swf2js/__tests__/glow-shadow-filter.test.js +68 -0
  278. package/swf2js/__tests__/graphics-bitmap-smoothing.test.js +32 -0
  279. package/swf2js/__tests__/graphics-fill-lifetime.test.js +36 -0
  280. package/swf2js/__tests__/graphics-gradient-matrix.test.js +53 -0
  281. package/swf2js/__tests__/graphics-stroke-hit-test.test.js +457 -0
  282. package/swf2js/__tests__/hit-test-primitives.test.js +414 -0
  283. package/swf2js/__tests__/input-events.test.js +714 -0
  284. package/swf2js/__tests__/integration/corpus.test.js +41 -0
  285. package/swf2js/__tests__/loader-embedded-swf.test.js +210 -0
  286. package/swf2js/__tests__/loader-info.test.js +81 -0
  287. package/swf2js/__tests__/local-connection.test.js +122 -0
  288. package/swf2js/__tests__/morph-focal-gradient.test.js +51 -0
  289. package/swf2js/__tests__/morph-topology.test.js +267 -0
  290. package/swf2js/__tests__/movie-data-codec.test.js +128 -0
  291. package/swf2js/__tests__/nellymoser-audio.test.js +84 -0
  292. package/swf2js/__tests__/opaque-background-cache.test.js +352 -0
  293. package/swf2js/__tests__/path-stream.test.js +81 -0
  294. package/swf2js/__tests__/place-object-filters.test.js +88 -0
  295. package/swf2js/__tests__/place-object3-decoder.test.js +116 -0
  296. package/swf2js/__tests__/place-object3-image.test.js +85 -0
  297. package/swf2js/__tests__/player-version.test.js +46 -0
  298. package/swf2js/__tests__/root-textfield.test.js +287 -0
  299. package/swf2js/__tests__/scaling-grid.test.js +183 -0
  300. package/swf2js/__tests__/shape-decoder.test.js +361 -0
  301. package/swf2js/__tests__/shape-line-style2.test.js +138 -0
  302. package/swf2js/__tests__/shape-nonscaling-stroke.test.js +131 -0
  303. package/swf2js/__tests__/shape-pixel-hint.test.js +101 -0
  304. package/swf2js/__tests__/simplebutton-pointer.test.js +1477 -0
  305. package/swf2js/__tests__/socket-offline.test.js +67 -0
  306. package/swf2js/__tests__/sound-avm1-stop.test.js +99 -0
  307. package/swf2js/__tests__/sound-envelope.test.js +110 -0
  308. package/swf2js/__tests__/sound-extract.test.js +168 -0
  309. package/swf2js/__tests__/sound-id3.test.js +283 -0
  310. package/swf2js/__tests__/sound-load.test.js +259 -0
  311. package/swf2js/__tests__/sound-mixer-spectrum.test.js +261 -0
  312. package/swf2js/__tests__/sound-stream-sprite.test.js +624 -0
  313. package/swf2js/__tests__/sound-transform.test.js +104 -0
  314. package/swf2js/__tests__/speex-audio.test.js +77 -0
  315. package/swf2js/__tests__/stage-noscale.test.js +45 -0
  316. package/swf2js/__tests__/swf-encoder.test.js +134 -0
  317. package/swf2js/__tests__/swflib-assemble.test.js +20 -0
  318. package/swf2js/__tests__/textfield-html-text.test.js +368 -0
  319. package/swf2js/__tests__/textfield-line-layout.test.js +339 -0
  320. package/swf2js/__tests__/textfield-programmatic-overlay.test.js +2506 -0
  321. package/swf2js/__tests__/textfield-scroll.test.js +79 -0
  322. package/swf2js/__tests__/textfield-selection.test.js +383 -0
  323. package/swf2js/__tests__/timeline-effect-surfaces.test.js +295 -0
  324. package/swf2js/__tests__/timeline-named-anchor.test.js +139 -0
  325. package/swf2js/__tests__/timeline-scenes.test.js +1723 -0
  326. package/swf2js/__tests__/urlloader-http-status.test.js +236 -0
  327. package/{src → swf2js}/cli.js +43 -11
  328. package/swf2js/compiler/as2-classes.js +156 -0
  329. package/swf2js/compiler/as2-parser.js +598 -0
  330. package/swf2js/compiler/avm1-codegen.js +897 -0
  331. package/swf2js/compiler/index.js +28 -0
  332. package/{src → swf2js}/decoder/button-decoder.js +3 -1
  333. package/swf2js/decoder/png.js +114 -0
  334. package/{src → swf2js}/decoder/shape-decoder.js +20 -10
  335. package/{src → swf2js}/decoder/tag-decoder.js +5 -3
  336. package/{src → swf2js}/decoder/tag-types.js +4 -0
  337. package/swf2js/decompiler/avm1-decompiler.js +1138 -0
  338. package/{src → swf2js}/emitter/asset-encoder.js +66 -113
  339. package/{src → swf2js}/emitter/bundle-emitter.js +209 -78
  340. package/swf2js/emitter/external-resources.js +39 -0
  341. package/swf2js/emitter/movie-data-codec.js +91 -0
  342. package/swf2js/encoder/bit-writer.js +182 -0
  343. package/swf2js/encoder/shape-encoder.js +310 -0
  344. package/swf2js/encoder/swf-builder.js +639 -0
  345. package/swf2js/encoder/swf-writer.js +55 -0
  346. package/{src/runtime/swflib/assemble.js → swf2js/runtime/assemble-swooflib.js} +4 -3
  347. package/{src → swf2js}/runtime/avm1-runtime.js +102 -63
  348. package/{src → swf2js}/runtime/index.js +1 -1
  349. package/{src → swf2js}/runtime/movie-runtime.js +28 -2
  350. package/{src → swf2js}/transpiler/actionscript.js +82 -19
  351. package/{src → swf2js}/transpiler/avm1/avm1-opcodes.js +5 -3
  352. package/{src → swf2js}/transpiler/avm1/avm1-transpiler.js +69 -6
  353. package/{src → swf2js}/transpiler/avm2/avm2-transpiler.js +1 -1
  354. package/{src → swf2js}/transpiler/timeline/display-list.js +41 -22
  355. package/{src → swf2js}/transpiler/timeline/timeline-codegen.js +97 -36
  356. package/swooflib/README.md +569 -0
  357. package/swooflib/adpcm.js +147 -0
  358. package/{src/runtime/swflib → swooflib}/builtins.js +6 -0
  359. package/{src/runtime/swflib → swooflib}/context-menu.js +7 -1
  360. package/swooflib/control-definitions.js +42 -0
  361. package/swooflib/control-widget.js +763 -0
  362. package/swooflib/controls.js +300 -0
  363. package/{src/runtime/swflib → swooflib}/display.js +16 -10
  364. package/{src/runtime/swflib → swooflib}/events.js +11 -0
  365. package/{src/runtime/swflib → swooflib}/flash.js +6 -5
  366. package/{src/runtime/swflib → swooflib}/graphics.js +81 -19
  367. package/{src/runtime/swflib → swooflib}/input.js +12 -14
  368. package/{src/runtime/swflib → swooflib}/loader.js +52 -22
  369. package/swooflib/movie-network.js +86 -0
  370. package/swooflib/path-stream.js +169 -0
  371. package/{src/runtime/swflib → swooflib}/render.js +3 -13
  372. package/{src/runtime/swflib → swooflib}/sound.js +25 -2
  373. package/{src/runtime/swflib → swooflib}/stage.js +3 -3
  374. package/swooflib/stream-time.js +21 -0
  375. package/{src/runtime/swflib → swooflib}/system.js +88 -37
  376. package/{src/runtime/swflib → swooflib}/text-paint.js +14 -3
  377. package/{src/runtime/swflib → swooflib}/text.js +8 -0
  378. package/swooflib/xml-node.js +53 -0
  379. package/src/emitter/timeline-data-codec.js +0 -58
  380. /package/{src → swf2js}/decoder/symbol-table.js +0 -0
  381. /package/{src → swf2js}/emitter/embedded-swf.js +0 -0
  382. /package/{src → swf2js}/emitter/font-encoder.js +0 -0
  383. /package/{src → swf2js}/model/swf-document.js +0 -0
  384. /package/{src → swf2js}/model/transpile-result.js +0 -0
  385. /package/{src → swf2js}/parser/bit-reader.js +0 -0
  386. /package/{src → swf2js}/parser/decompressor.js +0 -0
  387. /package/{src → swf2js}/parser/swf-parser.js +0 -0
  388. /package/{src → swf2js}/pretty-printer/pretty-printer.js +0 -0
  389. /package/{src → swf2js}/runtime/avm2-runtime.js +0 -0
  390. /package/{src → swf2js}/runtime/embedded-movie-runtime.js +0 -0
  391. /package/{src → swf2js}/transpiler/avm1/avm1-ir.js +0 -0
  392. /package/{src → swf2js}/transpiler/avm1/avm1-rewrite.js +0 -0
  393. /package/{src → swf2js}/transpiler/avm2/abc-reader.js +0 -0
  394. /package/{src → swf2js}/transpiler/cfg-structurer.js +0 -0
  395. /package/{src → swf2js}/util/diagnostics.js +0 -0
  396. /package/{src → swf2js}/util/logger.js +0 -0
  397. /package/{src/runtime/swflib → swooflib}/bitmap-image.js +0 -0
  398. /package/{src/runtime/swflib → swooflib}/bitmap.js +0 -0
  399. /package/{src/runtime/swflib → swooflib}/bytearray.js +0 -0
  400. /package/{src/runtime/swflib → swooflib}/compiled-swf.js +0 -0
  401. /package/{src/runtime/swflib → swooflib}/cursor-flag.js +0 -0
  402. /package/{src/runtime/swflib → swooflib}/dictionary.js +0 -0
  403. /package/{src/runtime/swflib → swooflib}/filters.js +0 -0
  404. /package/{src/runtime/swflib → swooflib}/geom.js +0 -0
  405. /package/{src/runtime/swflib → swooflib}/glyph-metrics.js +0 -0
  406. /package/{src/runtime/swflib → swooflib}/host.js +0 -0
  407. /package/{src/runtime/swflib → swooflib}/inherit.js +0 -0
  408. /package/{src/runtime/swflib → swooflib}/marks.js +0 -0
  409. /package/{src/runtime/swflib → swooflib}/matrix3d.js +0 -0
  410. /package/{src/runtime/swflib → swooflib}/pointer-bridge.js +0 -0
  411. /package/{src/runtime/swflib → swooflib}/projection.js +0 -0
  412. /package/{src/runtime/swflib → swooflib}/sprite-drag.js +0 -0
  413. /package/{src/runtime/swflib → swooflib}/stage-ref.js +0 -0
  414. /package/{src/runtime/swflib → swooflib}/text-field.js +0 -0
  415. /package/{src/runtime/swflib → swooflib}/transform.js +0 -0
  416. /package/{src/runtime/swflib → swooflib}/xml.js +0 -0
@@ -0,0 +1,573 @@
1
+ # Implementation Plan: Browser Animation Editor
2
+
3
+ ## Overview
4
+
5
+ Browser-based authoring application for creating Swoof-backed 2D animations. The editor owns an editable in-memory document model and adapts it to Swoof display objects for preview; it does not edit generated movies or use the transpiler's compiled timeline format.
6
+
7
+ Serve Studio with `npm run studio` (or the `studio` bin), then open http://127.0.0.1:4810/. Pass `--port` or `--host` to change the address.
8
+
9
+ Checked tasks have implementation and verification evidence. Run the model and project tests with `node --test studio/*.test.js`. Run the browser authoring regression with `node studio/tests/timeline-browser.mjs` using Chrome or Chromium.
10
+
11
+ Studio opens SWFs and editable project JSON, saves projects on the server, and publishes SWF, standalone HTML, MP4 and WebM video, animated GIF, PNG and WebP, or a frame as an image. The Inputs menu exposes 25 component types. A tilde marks a task with outstanding requirements or verification.
12
+
13
+ ---
14
+
15
+ ## Tasks
16
+
17
+ ### 1. Browser workspace and project model
18
+
19
+ - [x] 1.1 Build the static browser workspace and in-memory project model
20
+ - Provide a stage tool rail, zoomable artboard, resizable timeline and docked Properties, Objects, and Library panels. The scene menu stays beside the artboard and narrow viewports use a panel drawer
21
+ - Scroll over the artboard to zoom around the pointer from 10% to 800%, middle-drag to pan, or choose Fit to recenter. Chromium verifies pointer anchoring, zoom limits and scrolling outside the stage.
22
+ - Keep the current project in browser memory without an application API
23
+ - _Requirements: 1.1, 1.5, 5.1_
24
+
25
+ - [x] 1.2 Adapt the Swoof renderer for authored vectors and text
26
+ - Render vector display objects and `TextField`/`TextFormat` using Swoof
27
+ - Keep editor poses, keyframes, and scenes in the editor's own model
28
+ - _Requirements: 5.1, 5.3_
29
+
30
+ - [x] 1.3 Implement stage settings
31
+ - Edit width, height, background, and frame rate with range validation and visible errors
32
+ - Fit the authored stage to the workspace without changing stage coordinates
33
+ - _Requirements: 1.1, 5.4_
34
+
35
+ - [x] 1.4 Implement scene creation and management
36
+ - Add, rename, select, and delete scenes; prevent deletion of the last scene
37
+ - Preserve each scene's in-memory elements and timeline when switching scenes
38
+ - _Requirements: 1.2, 1.3, 5.5_
39
+
40
+ ---
41
+
42
+ ### 2. Stage authoring tools
43
+
44
+ - [x] 2.1 Replace preset insertion with a grouped drawing toolbar
45
+ - Provide direct Select, Resize, Rotate, Pen and Text tools. Group vector primitives in Shapes and Flash components in Inputs.
46
+ - Group Pencil, Brush, Eraser, Paint Bucket, Ink Bottle, Eyedropper and Gradient Transform in Paint. The bucket can fill an area enclosed by separate strokes on the active layer.
47
+ - _Requirements: 2.1–2.5_
48
+
49
+ - [x] 2.2 Draw vector primitives on the stage
50
+ - Drag to size rectangles, rounded rectangles, ellipses, lines, and preset polygons/stars
51
+ - Stars start with five points. The inspector edits the point count and inner radius of stars and the corner radius of rounded rectangles.
52
+ - Create a default-sized object on click; constrain an ellipse to a circle with Shift
53
+ - _Requirements: 2.2_
54
+
55
+ - [x] 2.3 Create multi-point polygons and Bezier paths
56
+ - Add polygon/path points by clicking; drag Pen anchors to establish curve handles
57
+ - Close a shape by clicking its first point or using Close; finish an open path explicitly
58
+ - _Requirements: 2.3_
59
+
60
+ - [x] 2.4 Edit Bezier anchors and handles after creation
61
+ - Select a path with the Pen tool, then move anchors and adjust paired curve handles on stage
62
+ - _Requirements: 2.3_
63
+
64
+ - [x] 2.5 Select and transform objects directly on stage
65
+ - Select and move objects; expose visible edge/corner resize handles and a rotation handle
66
+ - Support numeric position, dimensions, scale, rotation, skew, and opacity in the inspector
67
+ - _Requirements: 2.4, 2.5_
68
+
69
+ - [x] 2.6 Create and edit text on stage
70
+ - Drag to size a text box or click to create a default-sized one
71
+ - Edit inline on creation, by double-clicking text, or through Edit text; support Done and Cancel
72
+ - Retain inspector controls for font family, size, weight, alignment, and color
73
+ - _Requirements: 2.2, 2.6_
74
+
75
+ - [x] 2.7 Edit vector appearance
76
+ - Edit fill, stroke, and stroke width for supported vector objects
77
+ - _Requirements: 2.7_
78
+
79
+ ---
80
+
81
+ ### 3. Timeline and animation
82
+
83
+ - [x] 3.1 Add object tracks and a scrubbable playhead
84
+ - Show scene frame numbers, object lanes, keyframe markers, and tween spans
85
+ - Keep stage selection synchronized with the element list and timeline lanes
86
+ - _Requirements: 2.4, 3.2, 3.7_
87
+
88
+ - [x] 3.2 Implement transform keyframes and tween interpolation
89
+ - Key position, dimensions, scale, rotation, skew, and opacity at the playhead
90
+ - Interpolate linear, ease-in, ease-out, ease-in-out, and hold spans deterministically
91
+ - _Requirements: 3.4, 3.5_
92
+
93
+ - [x] 3.3 Implement editor preview controls
94
+ - Play/pause, stop/reset, scrub, and step through frames
95
+ - Hold the final frame or loop to the scene start frame according to the scene’s Loop setting. Preview controls remain interactive while held
96
+ - _Requirements: 3.6, 3.7, 5.2_
97
+
98
+ - [x] 3.4 Animate object appearance
99
+ - Define keyframe behavior for fill, stroke, stroke width, text formatting, and other supported style properties
100
+ - Interpolate only properties supported by both ends of a tween; give incompatible changes a clear hold/discrete behavior
101
+ - _Requirements: 3.4, 3.5_
102
+
103
+ - [x] 3.5 Add Flash-like frame spans and frame editing
104
+ - Support blank frames, keyframes, duplicate/remove frame operations, and visible frame spans
105
+ - Draw at the playhead. Filled spans show when the object is present, and hollow keys begin blank spans. Key or blank the active layer as a unit
106
+ - Scene frame insertion and removal shift later keys and frame destinations together. Duration edits flag keys or destinations that would fall outside the scene
107
+ - _Requirements: 3.2–3.4_
108
+
109
+ ---
110
+
111
+ ### 4. Layers and display order
112
+
113
+ - [x] 4.1 Add a layer model
114
+ - Associate each object and timeline track with a named layer and explicit stacking order
115
+ - Migrate the current per-object tracks without changing scene contents
116
+ - _Requirements: 3.1_
117
+
118
+ - [x] 4.2 Implement layer management
119
+ - Add, rename, and remove layers; prevent removing a non-empty layer without an explicit object disposition
120
+ - _Requirements: 3.1_
121
+
122
+ - [x] 4.3 Implement layer order, visibility, and locking
123
+ - Reorder layers and reflect that order in stage rendering
124
+ - Hide/show layers and prevent edits to locked layers
125
+ - _Requirements: 3.1_
126
+
127
+ - [x] 4.4 Move objects between layers
128
+ - Drag or assign objects to layers while preserving their keyframes and selection identity
129
+ - _Requirements: 2.4, 3.1_
130
+
131
+ ---
132
+
133
+ ### 5. Input, buttons, and scene flow
134
+
135
+ - [x] 5.1 Define typed interaction actions in the editor model
136
+ - Support click/tap actions such as go to scene, go to frame, play, stop, and toggle visibility
137
+ - Validate action targets and report invalid references in the editor
138
+ - _Requirements: 2.9, 4.5_
139
+
140
+ - [x] 5.2 Add button properties and action editing
141
+ - Mark text or vector objects as buttons and configure their action without arbitrary code execution
142
+ - _Requirements: 2.9_
143
+
144
+ - [x] 5.3 Separate edit gestures from interactive preview input
145
+ - Route pointer/touch hits to authored buttons only in preview mode
146
+ - Show hover/pressed feedback and use the object's authored hit area
147
+ - _Requirements: 2.10, 4.1, 4.5_
148
+
149
+ - [x] 5.4 Implement scene and frame navigation
150
+ - Add scene start-frame settings and route preview actions to scenes or frames
151
+ - Stop the outgoing scene and continue playback in the destination when preview is active
152
+ - _Requirements: 1.4, 4.2, 4.3_
153
+
154
+ - [x] 5.5 Add scene transition authoring
155
+ - Set each scene’s entry to Cut, Crossfade or Wipe right under Document properties. Crossfades and wipes have a duration in frames and an easing curve.
156
+ - Chromium verifies blended pixels, wipe direction, paused and playing jumps, delayed start-frame actions, blocked input, and cancellation. Model tests cover timing, validation and project round trips.
157
+ - _Requirements: 4.2, 4.3, 5.2_
158
+
159
+ - [x] 5.6 Add keyboard and touch interaction authoring
160
+ - The Interaction inspector configures click/tap, touch tap, directional swipe, key press and key release for any supported button action.
161
+ - Chromium verifies native Tab and button activation, independent bindings in nested instances, text entry, capture cancellation, and simultaneous touches.
162
+ - _Requirements: 4.1–4.4_
163
+
164
+ ---
165
+
166
+ ### 6. Swoof display features and assets
167
+
168
+ - [x] 6.1 Add reusable symbols and nested sprites
169
+ - Create a definition in Symbols, edit its artboard and timeline, then place instances in scenes or other definitions. Double-click an instance to edit the shared artwork and use Back to restore the parent selection and playhead
170
+ - Each instance has its own transform track and can inherit playback, loop, play once, or hold a single frame. Its clock follows the parent playhead from placement
171
+ - Project JSON preserves shared definitions and validates references and cycles. Preview keeps text values and button targets local to each instance
172
+ - _Requirements: 5.3_
173
+
174
+ - [x] 6.2 Add richer vector fills and effects
175
+ - Properties supports two-color linear and radial fills on closed vectors. Set the linear angle or radial focal point, and apply blur, glow, or drop shadow to a vector.
176
+ - Matching gradient and effect types tween their parameters. Type changes take effect on the destination key. Styles round-trip through project JSON and support undo and redo.
177
+ - Chromium checks rotation, nonuniform scale, gradient colors, effect pixels beyond the geometry, and button hits on the artwork and its shadow.
178
+ - _Requirements: 5.1, 5.3_
179
+
180
+ - [x] 6.3 Add masks and clipping
181
+ - [x] Store timeline-local mask references in project JSON. Model tests cover sharing, chains, layer reordering, invalid references, cycles, and cleanup after deletion.
182
+ - [x] Select an object and choose a closed vector in Properties → Clip with. Sources have editable outlines and timeline labels. Targets retain their stacking positions. Hidden and blank sources hide their targets.
183
+ - [x] Chromium verifies chained and shared masks, animated geometry, layer visibility, deletion and undo. It checks clipped button hits, rotated symbol instances, native field pointer hits, and canvas strips above and below a field.
184
+ - _Requirements: 5.1, 5.3_
185
+
186
+ - [x] 6.4 Add bitmap assets
187
+ - [x] Store embedded media once per project, validate bitmap and sound references, and share immutable file data across undo steps.
188
+ - [x] Library → Import files accepts local images. Place and reuse them on scene or symbol timelines. Remove unused media from the library.
189
+ - [x] Properties supports fit inside, crop to fill with adjustable alignment, and stretch. Bitmap instances use the usual transform controls and keys. Chromium checks stage pixels and reopening embedded media while offline.
190
+ - _Requirements: 5.1, 5.3_
191
+
192
+ - [x] 6.5 Add audio assets and timeline playback
193
+ - [x] Store clip ranges and loop settings and shift clip boundaries with timeline edits.
194
+ - [x] Place a sound at the playhead from the Library. Its timeline lane opens editable start, end, and loop settings.
195
+ - [x] Chromium verifies local WAV decoding, playback from a scrubbed frame, pause, loop offsets, clip-end stop, removal and undo. A failed decode leaves the open project intact.
196
+ - _Requirements: 5.2, 5.3_
197
+
198
+ ---
199
+
200
+ ### 7. Advanced timeline and runtime authoring
201
+
202
+ - [x] 7.1 Add explicit timeline control actions
203
+ - Choose Timeline → Edit frames → Edit frame actions to author play, stop, jump to frame, or jump to scene. Jump actions offer stop and play modes. The Actions track reopens existing events.
204
+ - Preview dispatches frame entry on arrival, including jumps and loop wraps. Catch-up playback processes intermediate frames in order. Scrubbing and paused redraws leave actions idle.
205
+ - Inserting or removing a frame shifts its events and local jump targets. Removing a referenced scene or object cleans up the corresponding actions. Undo and redo include these changes.
206
+ - _Requirements: 1.4, 4.1–4.3_
207
+
208
+ - [x] 7.2 Add editable display-list grouping
209
+ - Shift-click same-layer objects on the stage or in the Elements list to group them. Move groups forward or backward, or select a member in the list to reorder it within its group
210
+ - Move, rotate, and uniformly resize a selection across its keyframes. Groups round-trip through project JSON and support undo and redo
211
+ - The adapter renders grouped artwork in Swoof Sprite containers. Each member keeps its own timeline track and preview interaction
212
+ - _Requirements: 5.3_
213
+
214
+ - [x] 7.3 Add optional frame-script/event authoring
215
+ - [x] Define ordered, typed actions on frame entry and timeline start. Model tests cover validation, project round trips, independent instance dispatch, redirects, and circular jumps.
216
+ - [x] Author, reorder, and remove typed playback and visibility actions on scenes and symbol definitions. Preview scopes object visibility and local playback to each instance.
217
+ - [x] Chromium verifies inline errors, draft cancellation, undo/redo, silent scrubbing, catch-up stops, loop entry, scene navigation, restored authoring selection, and a visible error for circular jumps.
218
+ - _Requirements: 4.1, 5.3_
219
+
220
+ ---
221
+
222
+ ### 8. Validation, accessibility, and documentation
223
+
224
+ - [x] 8.1 Smoke-test the current authoring workflow in a browser
225
+ - Verify drag-to-create, resize/rotate handles, polygon/path creation and editing, and inline text commit/cancel
226
+ - Confirm the tested flows complete without browser page errors
227
+
228
+ - [x] 8.2 Add automated model tests
229
+ - Current tests cover track editing, Hold boundaries, interpolation, scene duration, layer edits, group transforms and stacking, history, playback, arithmetic, vector style validation and tweening, mask relationships and deletion, frame events and navigation cycles, project validation and all six examples
230
+ - Regression tests verify rejected inspector and timing edits preserve every key, stage resizing respects positions across scenes, and scene/object deletion repairs navigation, masks and groups.
231
+ - _Requirements: 1.2–1.5, 3.4–3.7, 5.4_
232
+
233
+ - [x] 8.3 Add automated browser interaction tests
234
+ - Cover shape/text/path authoring, transforms, scene switching, timeline scrubbing, and preview actions
235
+ - Assert visible output and state changes, not implementation details
236
+
237
+ - [x] 8.4 Complete keyboard and accessibility review
238
+ - Chromium covers editor shortcuts and native Tab before runtime stage installation, preview text entry, and key-down/up delivery to the focused Swoof child after installation
239
+ - System, Light, and Dark themes switch locally and persist across reloads. Chromium checks desktop and compact controls and verifies project colors are preserved.
240
+ - Workspace regressions cover collapsible layer tracks and keyframe overviews, direct frame jumps, pointer scrubbing, stage rulers during zoom and pan, the authoring grid, keyboard timeline resizing, desktop panel tabs, and the compact drawer.
241
+ - Chromium exercises all nine tool shortcuts, toolbar and panel navigation, F2 layer renaming, focus after object selection and dialog dismissal, and keyboard access at 320×568 and 640×360.
242
+ - Chromium’s accessibility tree exposes labeled controls, polite status updates and assertive validation errors. Clearing the X field restores its value and preserves the exported project.
243
+ - _Requirements: 5.1, 5.4_
244
+
245
+ - [x] 8.5 Keep implementation status and Swoof integration documentation current
246
+ - Update this checklist only after the corresponding behavior and verification are complete
247
+ - Keep the current coverage and remaining-feature summary synchronized with the code
248
+
249
+ - [x] 8.6 Add undo and redo
250
+ - Record reversible authoring operations for object, scene, layer, path, text, and timeline edits
251
+ - Restore the scene, active layer, selection and playhead with the document. Coalesce a stage drag or inline text session into one edit
252
+
253
+ ---
254
+
255
+ ### 9. Served application
256
+
257
+ - [x] 9.1 Serve Studio through `node:http`
258
+ - `studio/server.js` serves the editor from its own directory and listens on 127.0.0.1:4810 by default. It blocks path traversal and hides tests and server source.
259
+ - `createStudioServer({ routes })` registers `"METHOD /path"` handlers before static files and reserves `/api/` for them. The Chromium suite runs against this server.
260
+
261
+ - [x] 9.2 Add server-side project saving and loading
262
+ - Tracked in detail by §10 below
263
+
264
+ ---
265
+
266
+ ### 10. File support ([file-support.md](./file-support.md))
267
+
268
+ - [x] 10.1 Add project folder storage and the project API
269
+ - `--projects <dir>`, slug IDs, one file per scene and symbol, hashed parts, and `project.json` as the commit point
270
+ - Revisions with `If-Match`, list/create/get/save/delete routes, and saves that send only changed parts
271
+ - _Requirements: 6.4, 6.6, 6.11_
272
+
273
+ - [x] 10.1a Add the edit journal and recovery
274
+ - JSON Patch entries from undo-history snapshots, append with `base`/`seq` checks, replay on open, Recover and Discard
275
+ - _Requirements: 6.5, 6.6_
276
+
277
+ - [x] 10.2 Add server-side asset uploads
278
+ - Raw-body uploads with size limits, magic-byte detection, SVG sanitizing, content-hash deduplication, and sandboxed media responses
279
+ - Accept `src`/`hash` asset entries alongside embedded `data`. Clean up unreferenced assets on save
280
+ - _Requirements: 6.1–6.3, 6.11_
281
+
282
+ - [x] 10.3 Add Open, Save, and Save as to the editor
283
+ - Project list dialog, Ctrl/Cmd+S, unsaved-changes marker from the history position, unload and discard warnings, conflict handling
284
+ - Export embeds media; Import stores embedded media on the server
285
+ - _Requirements: 6.4–6.7_
286
+
287
+ - [x] 10.4 Upload media from the Library and the stage
288
+ - Picker and drag-and-drop, concurrent uploads with progress, drop-to-place images and sounds
289
+ - The Library shows the filename and byte progress for each active transfer. Chromium checks that the meter reaches the file size and clears after upload.
290
+ - _Requirements: 6.1_
291
+
292
+ - [x] 10.5 Convert SWF vectors, bitmaps, text, and timelines
293
+ - Map stage settings, scenes, depths, placements, shapes, gradients, bitmaps, sprites, text, masks, and filters to the Studio model
294
+ - Validate every converted project with `parseProjectJson`
295
+ - _Requirements: 6.8, 6.9_
296
+
297
+ - [x] 10.6 Convert SWF sounds, buttons, and simple actions
298
+ - Event and stream sounds become assets and clips. Up-state buttons and constant AVM1 navigation become typed actions
299
+ - _Requirements: 6.8, 6.9_
300
+
301
+ - [x] 10.7 Add the SWF conversion report and editor entry points
302
+ - Open SWF, Import SWF into the library, and a report of approximated and dropped features that stays available after import
303
+ - _Requirements: 6.8, 6.10, 6.11_
304
+
305
+ - [x] 10.9 Compress API responses and accept compressed saves
306
+ - Chromium verified gzip on Save as, Save and background journal writes. HTTP tests verified response negotiation and the decoded size limit.
307
+ - Pick zstd, brotli, or gzip from `Accept-Encoding` for JSON responses. The editor sends saves and journal entries through `CompressionStream('gzip')` with `Content-Encoding: gzip`, and the server enforces its size limits after decompression
308
+ - Measured: a converted Castle Hero project is 57.7 MB as JSON, 2.9 MB with brotli
309
+ - _Requirements: 6.12_
310
+
311
+ - [x] 10.10 Load project parts separately
312
+ - Studio opens with `?view=manifest`. Existing API clients can still request the assembled project. Chromium verified that reopening after a one-scene edit transferred only the changed scene.
313
+ - `GET /api/projects/:id` returns the manifest with part hashes. `GET /api/projects/:id/parts/:hash` serves each scene and symbol with immutable caching, so reopening a project downloads only the parts that changed
314
+ - _Requirements: 6.12_
315
+
316
+ - [x] 10.11 Bound SWF import size
317
+ - The importer counts objects during conversion. Tests pin counts for the six demo games and verify acceptance at the configured cap and rejection immediately above it.
318
+ - Reject conversions above the object cap (default 50,000, `swfObjects` option) with 413 and a clear message, before the document is built. Record per-movie object counts in the conversion tests
319
+ - Imported paths, holes and geometry keyframes use compact anchor streams. The editor validates coordinates on open and expands them into editable cubic points on first use. Saving an unopened symbol keeps its geometry compact. On Raze 2, the 35,558-object import used 55.8 MB for scene and symbol JSON, down from 103.2 MB with expanded point objects.
320
+ - _Requirements: 6.8, 6.11_
321
+
322
+ - [x] 10.8 Verify file support
323
+ - API and conversion tests cover stored projects and SWF opening. Chromium opens Neon Grid through the SWF picker and checks the active project, the canvas before Preview, and the saved conversion report. It also covers media uploads, save/reopen, recovery and conflicts.
324
+ - Server route tests, conversion tests on the `demos/` SWFs and fixtures, and Chromium coverage for uploads, save/reopen, journal recovery, conflicts, and SWF opening
325
+
326
+ ---
327
+
328
+ ### 11. SWF export ([file-support.md](./file-support.md#swf-export))
329
+
330
+ - [x] 11.1 Add the encoder primitives in swf2js
331
+ - Done: `swf2js/encoder/bit-writer.js` (UB/SB/FB, integers, RECT, MATRIX, CXFORM, colors) and `swf-writer.js` (tag records, long form for bitmap tags, FWS/CWS with injected zlib). Property tests read every structure back with `BitReader` (`swf2js/__tests__/swf-encoder.test.js`)
332
+ - _Requirements: 7.4_
333
+
334
+ - [x] 11.2 Add the shape and tag encoders
335
+ - Done: `shape-encoder.js` writes DefineShape3/4 from display-list draws, one style layer per draw (StateNewStyles) so draws stack in order; solid, linear, radial and focal gradients, bitmap fills, LINESTYLE/LINESTYLE2; edges from snapped absolute twips, split when a delta exceeds 17 bits. Buttons (DefineButton2 with condition actions), DefineEditText with DefineFont2 device fonts, DefineBitsLossless2 (premultiplied) and DefineBitsJPEG2, PlaceObject2 with clip actions, RemoveObject2, FrameLabel, ExportAssets, DoAction, DoInitAction are written in `swf-builder.js`
336
+ - Native morphs retain their original edge records and the ratio of each placement. Edited exposures publish their editable vector shapes. Event sounds, placement filters, blend modes and imported embedded fonts have SWF round-trip coverage. Stream headers and packets retain their original timeline positions, including empty MP3 blocks.
337
+ - _Requirements: 7.1, 7.4_
338
+
339
+ - [x] 11.3 Add the SWF builder
340
+ - Done: `swf-builder.js` writes a swf2js display list (the decoder's and `buildProjectMovie`'s format) with its script tags: definitions in dependency order, fonts first, then ExportAssets and DoInitAction, then the root timeline. Clip events are merged into the placement they belong to; action lists get their ActionEndFlag when missing; scene names become frame labels when the frame has none
341
+ - The AS2 compiler produces AVM1 bytecode shared by Preview, HTML and native SWF export. Imported scripts retain their bytecode.
342
+ - _Requirements: 7.1, 7.4_
343
+
344
+ - [x] 11.4 Map Studio projects to SWF tags
345
+ - The exporter uses the Preview movie builder, embeds PNG and JPEG artwork, and writes supported MP3 and PCM event sounds. It reports unsupported audio formats and GIF, WebP or SVG artwork. Newly authored controls export to AVM1 movies from SWF 6 onward.
346
+ - _Requirements: 7.1, 7.3_
347
+
348
+ - [x] 11.5 Add SWF export to the editor and API
349
+ - Done: `POST /api/export/swf` (the posted project, unsaved edits included, with `projectId` for stored media) returns `{ name, swf, version, report }`; Download SWF in the Export dialog, with the busy indicator and the import report window
350
+ - Download HTML publishes the current project and its media directly from the Preview build. Chromium opens the downloaded file offline.
351
+ - _Requirements: 7.1–7.3_
352
+
353
+ - [x] 11.6 Verify SWF export
354
+ - Done: export, decode and compare every frame with Preview's display list (Neon Grid, Minesweeper, Pacman, Snake in `studio/swf-export.test.js`; also checked on the intro, Vesper Patrol, Motherload and Interactive Buddy). Exports converted back with swf2js render like Preview. Re-import keeps stage, frames, scripts and keyframes; Neon Grid comes back identical
355
+ - Studio SWF 8+ AVM1 exports include compact XMP references for generated definitions. Re-import restores single-artwork click buttons, button copies with a release handler, and matching loop/once clips. Linked definitions and initialization code survive two publish/import cycles. Unsupported variants and files with stale metadata keep their native definitions. Offline Ruffle verified attachMovie on SWF 5–8 inputs and their Studio republishes. Native AVM1 controls have been exercised in Ruffle.
356
+ - Ruffle played the Studio exports of Pacman and Minesweeper. Minesweeper opened cells and displayed their numbers after a backward frame jump. In Adobe Flash Player 32, advancing the exported Pacman intro with Control → Play reached the maze. A left-arrow input moved Pacman, pellets disappeared, the ghosts moved and the score rose from 0 to 20. Ruffle also verified the on-stage menu click. The original and exported Pacman share the offline promotion field at game over. The source field contains three lines of `d` that the movie tries to replace with external XML.
357
+ - _Requirements: 7.4_
358
+
359
+ - [x] 11.7 Export everything Studio shows (Ghost Manor audit)
360
+ - Done: shape labels (button captions) are built into movies as shape + text sprites; 8 kHz and other non-SWF-rate WAVs are resampled instead of dropped; scene transitions and rotated device-font text are reported. Ghost Manor's SWF, converted by swf2js and stepped frame by frame, matches Studio's frames (mean difference 0.9/255 over 88 sampled frames)
361
+ - Done after the audit: the Preview player frame sits on the stage (no letterbox margins, no focus ring)
362
+ - _Requirements: 7.1, 7.3_
363
+
364
+ - [x] 11.8 Embedded fonts in SWF export
365
+ - Installed TrueType fonts are embedded as `DefineFont3` outlines (used characters, printable ASCII, Latin-1 for editable fields); CFF, missing and restricted fonts stay device fonts and are reported. Ghost Manor's Georgia, Impact and Arial embed; Ruffle shows the rotated note and title letter
366
+ - Tests use a stub font library, so results do not depend on the machine's fonts
367
+ - Open: the first-baseline difference between the editor and Flash (about 0.16 em)
368
+ - _Requirements: 7.1.6_
369
+
370
+ - [x] 11.10 Scene transitions in SWF export
371
+ - A compiled AVM1 helper snapshots the stage with `BitmapData.draw` before each Studio scene jump and fades or wipes it away; Ghost Manor's crossfades play in Ruffle (WebGL)
372
+ - Open: jumps written in ActionScript, and scripted projects below SWF 8, still cut (reported)
373
+ - _Requirements: 7.1.7_
374
+
375
+ - [x] 11.9 Scenes survive SWF export and re-import
376
+ - Scene names, starts and transitions are stored in the authoring metadata and restored on import (Ghost Manor: 7 scenes back, transitions included)
377
+ - _Requirements: 7.1.5_
378
+
379
+ ### 12. ActionScript ([actionscript.md](./actionscript.md))
380
+
381
+ - [x] 12.1 Keep AVM1 scripts on import
382
+ - Project `scripts` table (bytecode, SWF version, readable JS from the transpiler), stored once per bytecode
383
+ - Frame scripts, button condition actions, clip actions, and `DoInitAction` at their attachment points; simple navigation stays typed
384
+ - Validation in `project-io.js`; the editor shows script actions read-only
385
+ - Done: `studio/src/scripts.js`, `scripts` stored as a third part kind, empty clips kept, tests in `studio/swf-import.test.js`. The six game demos import with no dropped entries
386
+ - _Requirements: 1, 2_
387
+ - [x] 12.2 Project → swf2js display list and script tags
388
+ - Done: `studio/server/project-movie.js`; `emit` accepts a prebuilt display list; typed actions compile to AVM1
389
+ - _Requirements: 3.1, 3.2_
390
+ - [x] 12.3 Preview runs the project itself on the swf2js runtime
391
+ - Done: `POST /api/preview` → temporary bundle at `/api/preview/<token>/`, shown in a frame; the original-SWF player was removed
392
+ - Verified in Chromium through the editor: Lane Relay (START RUN, arrow keys), Neon Grid (cell click, computer reply); the other four demos match their swf2js bundles on the first frame. Tests in `studio/project-preview.test.js` (instance names, clip timelines, text variables, positions, edits shown)
393
+ - _Requirements: 3.1, 3.3_
394
+ - [x] 12.4 Warn when an edit renames or deletes an object a script refers to
395
+ - Object renames and object, layer or scene deletion report surviving scripts that reference the old instance names. Matching checks authored identifiers, literal target paths, imported AVM1 push strings and constant pools, including legacy case folding.
396
+ - _Requirements: 3.4_
397
+ - [x] 12.5 Actions panel: scripts shown and edited as ActionScript
398
+ - Done: frame scripts. "Run script" rows in the Actions dialog open the script editor (`studio/src/script-editor.js`): imported scripts decompiled by `POST /api/script/decompile`, checked while typed (line and column), kept as bytecode until the text changes; bytecode with no ActionScript form shown read-only with the reason. "Add script" creates a script in the project's SWF version. Edits apply on Save actions and undo as one step. Browser test: `studio/tests/script-interactions.mjs`
399
+ - Done: artwork buttons accept Run script under Interaction. Clip event scripts are edited on the selected instance. Symbol scripts in the library edits the definition's button handlers and initialization script. Shared imported bytecode is copied when an attachment changes. Chromium and SWF round-trip checks cover all four attachment points.
400
+ - Compile errors in Preview, Download SWF and Download HTML open the failing script at the reported line and column. Open .as file loads an existing source file into the editor.
401
+ - _Requirements: 4.1, 4.3, 4.5, 4.6_
402
+ - [x] 12.7 ActionScript 2 compiler (`swf2js/compiler/`): lexer, parser, AVM1 code generation
403
+ - Done: global functions as their actions, DefineFunction2 from SWF 7, try/catch/finally, switch, for…in, labels, constant pool, UTF-8 from SWF 6. Tests (`swf2js/__tests__/as2-compiler.test.js`) run compiled scripts through `transpileAvm1` and the runtime stub, comparing traces
404
+ - `ifFrameLoaded` emits immediate and stack-based frame waits. SWF 7+ classes compile to native constructors and prototypes, with packages, imports, inheritance, interfaces, fields, static members, accessors and `super`. An exported class using inheritance, a getter and a frame wait ran in Ruffle.
405
+ - _Requirements: 4.2, 4.4_
406
+ - [x] 12.8 AVM1 decompiler (`swf2js/decompiler/`) on the shared CFG structurer
407
+ - Done: nested `&&`/`||`/`?:`, switch, for…in, do…while, with, try, tellTarget, functions; a dispatcher loop for control flow it cannot structure. Bytecode with no ActionScript form (values kept on the stack across statements, calls to functions named like global actions) is refused with the reason
408
+ - Corpus (11 archive games, 1156 scripts): 906 decompile, and all of those compile back to the same text. The rest are optimizer or obfuscator output (Mario Kart, N, parts of Pacman and Interactive Buddy) and stay bytecode
409
+ - Tests: `swf2js/__tests__/avm1-decompiler.test.js` (fixpoint and same traces), `studio/actionscript-roundtrip.test.js` (Neon Grid, Snake, Minesweeper, Pacman)
410
+ - _Requirements: 4.1, design notes_
411
+ - [x] 12.9 Compile `actionscript` scripts in `buildProjectMovie`; check endpoint for the editor
412
+ - Done: `scripts.js` reads `{ language: 'actionscript', code }`; `buildProjectMovie` compiles with the project's scene offsets; a compile error stops Preview and SWF export with 422 `script_error` (script ID, line, column); `POST /api/script/check`. Tests in `studio/actionscript-scripts.test.js`
413
+ - _Requirements: 2.1, 4.4, 4.5_
414
+ - [x] 12.6 Import fidelity
415
+ - Done: gradient stops and placement, mirroring, four button states, registration points, depths, labels, text field settings, JPEG alpha
416
+ - Done: holes (`subpaths`), color transforms, SWF clip depths on masks, static text as glyph outlines, keyboard-only buttons, linkage names, ±100000 px positions. Preview notes what does not run (swipes, nested masks) in the status line
417
+ - Done: mask slots. Masks swapped at one depth (Pacman's mouth, shapes or symbols) keep clipping their targets in the editor and Preview, as in Flash (`maskSlots` in `masks.js`, symbol masks from their filled shapes in `display-frame.js`)
418
+ - Embedded dynamic fonts, gradient strokes, bitmap-fill matrices and repeat flags, placement effects, and event and stream audio are supported. Raze 2 retains its original font IDs, morph exposures and long timelines. Imported AVM2 bytecode and class bindings run in the shared player.
419
+ - Art Thief retains its frame script and the preceding record containing part of that script. Tests compare both records after saving, building Preview and exporting a native SWF. Bashing Pumpkins exercises a button handler that resolves a movie global. Capture retains its original 80 fps.
420
+ - Bitmap strokes retain the image, matrix, repeat and smoothing settings. Studio supports native line widths up to 3276.75 px. Single-part artwork with clip actions has a shared symbol definition and per-placement handlers. Embedded video is reported on import. Font definitions without usable browser outlines use a fallback on the editing canvas.
421
+ - _Requirements: 5_
422
+
423
+ ## 13. Input controls ([controls.md](./controls.md))
424
+
425
+ - [x] 13.1 Component code runs in Preview: linkage names kept, `#initclip` in definition order
426
+ - Done: Minesweeper radio buttons and Interactive Buddy's menu bar match the swf2js bundle and respond to clicks
427
+ - _Requirements: 1.1_
428
+ - [x] 13.2 Recognize component symbols and decode instance parameters (`symbol.component`, `element.component`)
429
+ - Done: `studio/src/components.js`; every parameter handler in Minesweeper, Interactive Buddy, Motherload and Super Smash Flash decodes (tests in `studio/components.test.js`)
430
+ - _Requirements: 1.2, 1.3_
431
+ - [x] 13.3 Regenerate parameter handlers in Preview; inspector shows and edits parameters
432
+ - Done: `studio/src/component-inspector.js`; verified in the editor (Minesweeper label edit shown in Preview)
433
+ - _Requirements: 1.4, 1.5_
434
+ - [x] 13.4 swooflib controls (tier 1) with the v2 API
435
+ - _Requirements: 2.2_
436
+ - [x] 13.5 Studio control objects: create, draw, inspect, preview input, change trigger
437
+ - _Requirements: 2.1, 2.3, 2.4_
438
+ - [x] 13.6 Studio controls in scripted Preview, reachable from scripts
439
+ - _Requirements: 2.5_
440
+ - [x] 13.7 Tier 2 kinds
441
+ - [x] 13.8 Component code defined after frame 1 runs at its frame
442
+ - _Requirements: 1.6_
443
+
444
+ ## 14. Video export ([video-export.md](./video-export.md))
445
+
446
+ - [x] 14.1 Capture rendering: `capture` mode in `buildDisplayFrame`, scaled single-canvas frames
447
+ - Done: `renderCaptureFrame()` in `canvas.js` draws on its own canvas without the preview surface; inputs and controls as artwork, buttons in their up state. 2× output renders glows, gradients and masks at full resolution (checked on Ghost Manor)
448
+ - _Requirements: 8.2.4, 8.5.2_
449
+ - [x] 14.2 Headless playback: Preview's frame, event, scene and clock rules; transitions; end detection
450
+ - Done: `video-playback.js` `playHeadless()`; crossfade and wipe composited in `video-export.js`; ends at a stop (one-second hold), a repeated state, or the maximum length; circular actions stop the export
451
+ - _Requirements: 8.2, 8.3_
452
+ - [x] 14.3 Audio schedule and offline mix
453
+ - Done: `createAudioSchedule()` follows `preview-audio.js` voice rules; segments mixed with `OfflineAudioContext` at 48 kHz stereo and encoded in 1024-frame chunks
454
+ - _Requirements: 8.4_
455
+ - [x] 14.4 MP4 and WebM writers, with Node tests
456
+ - Done: `video-mux.js`; `studio/video-export.test.js` parses both containers and checks every sample offset; ffmpeg decodes the exports without errors
457
+ - _Requirements: 8.5, 8.8_
458
+ - [x] 14.5 WebCodecs encoding and format detection
459
+ - Done: `video-encode.js`; H.264 High/Main/Baseline with the level from the frame size, VP9 then VP8, AAC then Opus in MP4
460
+ - _Requirements: 8.5, 8.7_
461
+ - [x] 14.6 Download video in the Export dialog: options, progress, cancel, refusals
462
+ - Done: one Format menu (HTML by default, SWF, Video, Image, JSON) and one Export button, showing only the chosen entry's options; Video and Image have their own format menus; projects without sound say so instead of showing the sound checkbox; progress bar; Export becomes Cancel; closing the dialog cancels; scripted projects are refused with their reasons. Encoders are probed only when a video format is chosen
463
+ - _Requirements: 8.1, 8.6, 8.7_
464
+ - [x] 14.7 Verify video export in Chromium
465
+ - Done: `studio/tests/video-export.mjs` in the browser suite; Ghost Manor acceptance export (see [video-export.md](./video-export.md#verification))
466
+ - _Requirements: 8.1–8.7_
467
+ - [x] 14.8 Flash sound cues in video, and refuse only what a video cannot do
468
+ - Done: event sounds in `createAudioSchedule()` and envelopes in the offline mix; button sounds, menu buttons and sound cues no longer block export. The Swoof intro exports with sound
469
+ - _Requirements: 8.3.1, 8.4.4, 8.7_
470
+ - [x] 14.9 Record projects that play on the swf2js player (ActionScript, nine-slice scaling) with a virtual clock
471
+ - `preview-recorder.js` (in the Preview build when `record: true`): virtual clock, virtual `<audio>`, offline mix; `swf-recording.js` hosts the frame and decides the ending; video and animated images share one frame producer in `video-export.js`
472
+ - Fixed in swf2js: `ActionGotoFrame` is absolute in movies with scenes
473
+ - _Requirements: 8.7, 8.9_
474
+
475
+ ## 15. Frame image export ([video-export.md](./video-export.md#9-frame-image-export))
476
+
477
+ - [x] 15.1 Render the stage frame to PNG, JPEG or WebP at 1×, 2× or 4×
478
+ - Done: `frame-image.js` `renderFrameImage()` through `renderCaptureFrame()`, with copies of Preview's hidden objects and symbol clocks; size limits enforced
479
+ - _Requirements: 9.2–9.4_
480
+ - [x] 15.2 Download frame in the Export dialog, with the frame named and the file named after it
481
+ - Done: Image of this frame in the Format menu, with PNG, JPEG or WebP and a size option and the frame named ("Scene Intro, frame 6, …"); uses the symbol artboard while a symbol is edited
482
+ - _Requirements: 9.1, 9.5, 9.6_
483
+ - [x] 15.3 Verify in Chromium
484
+ - Done: `studio/tests/frame-image.mjs` in the browser suite: 2× PNG size and pixels, no selection handle although the stage shows one, JPEG, file names, playhead unchanged. Ghost Manor frame 120 exports at 1600 × 900
485
+ - _Requirements: 9.1–9.6_
486
+
487
+ ## 16. Animated image export ([video-export.md](./video-export.md#10-animated-image-export))
488
+
489
+ - [x] 16.1 GIF, APNG and animated WebP writers without dependencies
490
+ - Done: `animated-image.js`: changed rectangles, frame merging, GIF palette and LZW, APNG with `CompressionStream`, WebP from `canvas.toBlob`; Node tests
491
+ - _Requirements: 10.3–10.5, 10.7_
492
+ - [x] 16.2 In the Video format menu, silent, with half size for every video format
493
+ - Done: "Animated image (no sound)" group; the sound choice is replaced by a note; formats the browser cannot write are disabled
494
+ - _Requirements: 10.1, 10.2, 10.6, 8.5.2_
495
+ - [x] 16.3 Verify in Chromium
496
+ - Done: `studio/tests/video-export.mjs` decodes each format with `ImageDecoder`; Ghost Manor exported in all three
497
+ - _Requirements: 10.1–10.6_
498
+
499
+ ## 17. SVG export ([svg-export.md](./svg-export.md))
500
+
501
+ - [x] 17.1 Record drawing as SVG: a 2D context and Path2D that write SVG elements
502
+ - Done: `svg-context.js`; arcs as Béziers, path data parsing, gradients, patterns (no-repeat as clipped images), clips, text on its alphabetic baseline; Node tests
503
+ - _Requirements: 11.3_
504
+ - [x] 17.2 SVG of this frame from the display tree, in the image formats
505
+ - Done: `svg-frame.js` walks `buildDisplayFrame`'s strips (`onFlush` hook, Studio ids on display objects); filters, colour transforms, blend modes, mask clips, embedded images; the report lists fonts and approximations
506
+ - _Requirements: 11.1, 11.3, 11.5_
507
+ - [x] 17.3 Animated SVG: per-frame trees merged into SMIL tracks, steps, loops, transitions
508
+ - Done: `svg-animation.js`; `playHeadless` reports the frame a repeat returns to; runs per attribute, decomposed transforms, keyframe reduction with steps, order copies and variants, intro and loop parts
509
+ - _Requirements: 11.2, 11.4, 11.5_
510
+ - [x] 17.4 Verify in Chromium and on Ghost Manor
511
+ - Done: `studio/tests/svg-export.mjs` in the browser suite; Ghost Manor and imported SWFs with bitmaps compared with Studio's capture
512
+ - _Requirements: 11.1–11.6_
513
+
514
+ ## 18. Lottie ([lottie.md](./lottie.md))
515
+
516
+ - [x] 18.1 Export: Studio keyframes and eases as Lottie keyframes, shapes, text, images, effects
517
+ - Done: `lottie-export.js`; exact eases (in-out as two halves), holds with a pre-key, transform mapping with skew and mirror, artwork through the SVG writers cached by pose, text lines from the painter's runs, track mattes, blur and drop shadow
518
+ - _Requirements: 12.1, 12.2.1, 12.2.2, 12.2.5, 12.2.6_
519
+ - [x] 18.2 Export: symbols as precomps, scenes in playing order, transitions, markers, Studio's data
520
+ - Done: precomps sized to the artwork with an origin null; start time or time remapping; scene precomps with markers, crossfades and wipes; `intro` and `loop` markers; the gzipped project with a content hash
521
+ - _Requirements: 12.2.3, 12.2.4, 12.3_
522
+ - [x] 18.3 Import: Lottie to Studio project JSON
523
+ - Done: `lottie-import.js`; Lottie evaluation (bezier timing, spatial tangents, holds), per-frame pose decomposition and keyframe reduction, shapes, gradients, precomps as symbols, mattes and masks, effects, stage scaling, scene flow as frame events, sanitised values; the exact roundtrip
524
+ - _Requirements: 12.4, 12.5_
525
+ - [x] 18.4 Export dialog and Import
526
+ - Done: "Lottie (JSON)" in the Video format menu (size disabled, no sound); Import recognises Lottie files and reports what it left out
527
+ - _Requirements: 12.1, 12.4_
528
+ - [x] 18.5 Verify
529
+ - Done: `studio/lottie.test.js`; `studio/tests/lottie.mjs` in the browser suite; Studio's examples and imported SWFs round-tripped (exact, and from Lottie content alone); rlottie's third-party samples compared with lottie-web; ThorVG as a second player
530
+ - _Requirements: 12.1–12.6_
531
+ - [ ] 18.6 Next: expressions that link layers, trim paths, animated gradients, dotLottie
532
+
533
+ ## 19. SVG import and the Import picker ([svg-import.md](./svg-import.md))
534
+
535
+ - [x] 19.1 Import picker: every format Studio reads, by content
536
+ - Done: `#project-file` accepts JSON, SWF, SVG(Z), images and sounds; drop on the Import dialog; SWF signature sniffing in `workspace.js`; `openSwfFile` shared with Open SWF; images and sounds to the library; gzip unpacked; a message naming the formats for anything else
537
+ - _Requirements: 13.1_
538
+ - [x] 19.2 SVG to Studio project JSON
539
+ - Done: `svg-import.js`; XML reader without entity expansion, CSS colours and the font shorthand, transforms, full path data, primitives or baked paths, compound paths, fill and stroke merged, gradients, text with Studio's layout, data URI images, `use`, clip paths as masks, top-level groups, blur, shadow and glow filters; the report; limits
540
+ - _Requirements: 13.2–13.5_
541
+ - [x] 19.3 Verify
542
+ - Done: `studio/svg-import.test.js`; `studio/tests/import-files.mjs` in the browser suite; Studio's SVG exports of examples 00–09 and Inkscape's examples compared with Chromium's drawing
543
+ - _Requirements: 13.1–13.5_
544
+ - [x] 19.4 Exact SVG roundtrip and the remaining gaps
545
+ - Done: "Include the Studio project" in the Export dialog (SVG off, Lottie on, per format); `withStudioData` in `svg-animation.js`; exact import with a hash; style sheets; gradient spread and stroke gradients; line markers; SVG masks as outlines; `switch`; self-crossing even-odd fills; Figma drop shadows; blend modes
546
+ - _Requirements: 13.2, 13.5_
547
+ - [x] 19.5 Text on a path, patterns, soft masks and other filters
548
+ - Done: `textPath` letter by letter (offsets, anchor, `dx`/`dy`/`rotate`, spacing, graphemes and joined-script words); line style, dashes, fill rules, italic and inner shadows read; pattern fills as repeating bitmap fills; soft masks and unknown filters as pictures, drawn by `rasterizeInBrowser`
549
+ - _Requirements: 13.2, 13.3, 13.6, 14.8_
550
+ - [ ] 19.6 Next: SVG into an open project's library; right-to-left text in Studio's text field
551
+
552
+ ## 20. Stroke and fill style, masks with holes ([stroke-style.md](./stroke-style.md))
553
+
554
+ - [x] 20.1 Object fields and Properties
555
+ - Done: `lineCap`, `lineJoin`, `miterLimit`, `strokeDash`, `strokeDashOffset`, `fillRule`, `italic` (`readStrokeStyle` in `project-io.js`); effect `inner`, kept out of tween interpolation (`model.js`); Line ends, Corners, Dashes, Overlapping outlines, Italic and Inner controls
556
+ - _Requirements: 14.1–14.5_
557
+ - [x] 20.2 Drawing and exports
558
+ - Done: `setStrokeStyle` and the fill-rule winding in `vector-geometry.js`; swooflib `Graphics.lineDashStyle`; SWF line styles, dashes cut by `dashedPath`, the DefineShape4 winding flag; italic SWF fonts; Lottie leaves inner effects out (reported)
559
+ - _Requirements: 14.3, 14.4, 14.6_
560
+ - [x] 20.3 Masks with holes
561
+ - Done: clip rule from `vectorMaskPath` in the editor, hit tests and SVG export; `orientedVectorPathData` for symbol masks; Lottie image masks write holes as subtracting masks, and Lottie import keeps them
562
+ - _Requirements: 14.7, 14.8_
563
+ - [x] 20.4 Verify
564
+ - Done: `studio/stroke-style.test.js`; SVG import tests; Properties check in `tests/import-files.mjs`; canvas, SVG export and mask checks in Chromium
565
+ - _Requirements: 14.1–14.8_
566
+
567
+ ---
568
+
569
+ ## Verification
570
+
571
+ Native player verification is recorded under 11.6.
572
+
573
+ The browser regression exercises drawing at a later frame, blank exposures, key duplication and removal, layer selection, undo/redo, text and path authoring, shared symbol edits, nested playback, mask authoring and clipping, JSON round trips, preview hit testing, and scene navigation. Run the model suite with `node --test studio/*.test.js` and the browser suite with `node studio/tests/timeline-browser.mjs`.