etro 0.13.0 → 0.14.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 (275) hide show
  1. package/.github/workflows/nodejs.yml +4 -0
  2. package/.github/workflows/shipjs-trigger.yml +2 -1
  3. package/.husky/pre-commit +1 -1
  4. package/AGENTS.md +106 -0
  5. package/CHANGELOG.md +17 -0
  6. package/CONTRIBUTING.md +5 -5
  7. package/README.md +7 -12
  8. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/index.html +50 -50
  9. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/custom-array.ts.html +11 -11
  10. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/base.ts.html +57 -9
  11. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/brightness.ts.html +1 -1
  12. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/channels.ts.html +1 -1
  13. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/chroma-key.ts.html +1 -1
  14. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/contrast.ts.html +1 -1
  15. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/elliptical-mask.ts.html +1 -1
  16. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/gaussian-blur.ts.html +1 -1
  17. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/grayscale.ts.html +1 -1
  18. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/index.html +21 -21
  19. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/index.ts.html +1 -1
  20. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/pixelate.ts.html +1 -1
  21. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/shader.ts.html +3 -3
  22. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/stack.ts.html +1 -1
  23. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/transform.ts.html +1 -1
  24. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/effect/visual.ts.html +1 -1
  25. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/etro.ts.html +1 -1
  26. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/event.ts.html +29 -29
  27. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/index.html +20 -20
  28. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/index.ts.html +1 -1
  29. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/audio-source.ts.html +47 -47
  30. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/audio.ts.html +4 -4
  31. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/base.ts.html +88 -34
  32. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/image.ts.html +1 -1
  33. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/index.html +20 -20
  34. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/index.ts.html +1 -1
  35. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/text.ts.html +1 -1
  36. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/video.ts.html +1 -1
  37. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/visual-source.ts.html +1 -1
  38. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/layer/visual.ts.html +10 -10
  39. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/movie/effects.ts.html +4 -4
  40. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/movie/index.html +19 -19
  41. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/movie/index.ts.html +1 -1
  42. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/movie/layers.ts.html +5 -5
  43. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/movie/movie.ts.html +467 -128
  44. package/coverage/{Firefox 148.0 (Mac OS 10.15) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/src/util.ts.html +380 -68
  45. package/coverage/Firefox 151.0 (Mac OS 10.15)/html/index.html +161 -0
  46. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/custom-array.ts.html +34 -34
  47. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/base.ts.html +92 -44
  48. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/brightness.ts.html +17 -17
  49. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/channels.ts.html +17 -17
  50. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/chroma-key.ts.html +21 -21
  51. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/contrast.ts.html +17 -17
  52. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/elliptical-mask.ts.html +1 -1
  53. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/gaussian-blur.ts.html +98 -98
  54. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/grayscale.ts.html +13 -13
  55. package/coverage/Firefox 151.0 (Mac OS 10.15)/html/src/effect/index.html +311 -0
  56. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/index.ts.html +1 -1
  57. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/pixelate.ts.html +24 -24
  58. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/shader.ts.html +369 -369
  59. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/stack.ts.html +46 -46
  60. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/transform.ts.html +104 -104
  61. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/effect/visual.ts.html +1 -1
  62. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/etro.ts.html +1 -1
  63. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/event.ts.html +60 -60
  64. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/index.html +42 -42
  65. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/index.ts.html +1 -1
  66. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/audio-source.ts.html +50 -50
  67. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/audio.ts.html +4 -4
  68. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/base.ts.html +95 -41
  69. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/image.ts.html +14 -14
  70. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/index.html +51 -51
  71. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/index.ts.html +1 -1
  72. package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/text.ts.html +1 -1
  73. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/video.ts.html +1 -1
  74. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/visual-source.ts.html +58 -58
  75. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/layer/visual.ts.html +84 -84
  76. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/movie/effects.ts.html +13 -13
  77. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/movie/index.html +28 -28
  78. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/movie/index.ts.html +1 -1
  79. package/coverage/{Firefox 120.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/movie/layers.ts.html +5 -5
  80. package/coverage/{Firefox 121.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/movie/movie.ts.html +605 -266
  81. package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/src/util.ts.html +408 -69
  82. package/dist/custom-array.d.ts +10 -10
  83. package/dist/effect/base.d.ts +61 -60
  84. package/dist/effect/brightness.d.ts +16 -16
  85. package/dist/effect/channels.d.ts +23 -23
  86. package/dist/effect/chroma-key.d.ts +23 -23
  87. package/dist/effect/contrast.d.ts +15 -15
  88. package/dist/effect/elliptical-mask.d.ts +31 -31
  89. package/dist/effect/gaussian-blur.d.ts +60 -60
  90. package/dist/effect/grayscale.d.ts +7 -7
  91. package/dist/effect/index.d.ts +16 -16
  92. package/dist/effect/pixelate.d.ts +18 -18
  93. package/dist/effect/shader.d.ts +109 -109
  94. package/dist/effect/stack.d.ts +27 -27
  95. package/dist/effect/transform.d.ts +73 -73
  96. package/dist/effect/visual.d.ts +17 -17
  97. package/dist/etro-cjs.js +3583 -3553
  98. package/dist/etro-iife.js +3583 -3553
  99. package/dist/etro.d.ts +7 -7
  100. package/dist/event.d.ts +40 -40
  101. package/dist/index.d.ts +6 -6
  102. package/dist/layer/audio-source.d.ts +28 -28
  103. package/dist/layer/audio.d.ts +27 -27
  104. package/dist/layer/base.d.ts +129 -128
  105. package/dist/layer/image.d.ts +20 -20
  106. package/dist/layer/index.d.ts +11 -11
  107. package/dist/layer/text.d.ts +78 -78
  108. package/dist/layer/video.d.ts +23 -23
  109. package/dist/layer/visual-source.d.ts +47 -47
  110. package/dist/layer/visual.d.ts +62 -62
  111. package/dist/movie/effects.d.ts +6 -6
  112. package/dist/movie/index.d.ts +1 -1
  113. package/dist/movie/layers.d.ts +6 -6
  114. package/dist/movie/movie.d.ts +280 -278
  115. package/dist/object.d.ts +19 -19
  116. package/dist/util.d.ts +128 -123
  117. package/karma.conf.js +61 -3
  118. package/package.json +13 -15
  119. package/ship.config.js +9 -11
  120. package/src/effect/base.ts +16 -0
  121. package/src/layer/base.ts +19 -1
  122. package/src/movie/movie.ts +116 -3
  123. package/src/util.ts +104 -0
  124. package/tsconfig.json +3 -2
  125. package/.husky/commit-msg +0 -4
  126. package/.husky/prepare-commit-msg +0 -11
  127. package/commitlint.config.ts +0 -39
  128. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/index.html +0 -176
  129. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/custom-array.ts.html +0 -214
  130. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/base.ts.html +0 -433
  131. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/brightness.ts.html +0 -214
  132. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/channels.ts.html +0 -235
  133. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/contrast.ts.html +0 -211
  134. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/elliptical-mask.ts.html +0 -310
  135. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/grayscale.ts.html +0 -187
  136. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/index.html +0 -311
  137. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/pixelate.ts.html +0 -259
  138. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/shader.ts.html +0 -1774
  139. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/stack.ts.html +0 -358
  140. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/transform.ts.html +0 -685
  141. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/effect/visual.ts.html +0 -148
  142. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/event.ts.html +0 -691
  143. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/index.html +0 -176
  144. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/index.ts.html +0 -109
  145. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/audio-source.ts.html +0 -835
  146. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/base.ts.html +0 -772
  147. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/image.ts.html +0 -181
  148. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/index.html +0 -236
  149. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/video.ts.html +0 -211
  150. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/visual-source.ts.html +0 -721
  151. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/layer/visual.ts.html +0 -760
  152. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/movie/effects.ts.html +0 -163
  153. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/movie/index.html +0 -161
  154. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/movie/index.ts.html +0 -88
  155. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/movie/layers.ts.html +0 -163
  156. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/movie/movie.ts.html +0 -2692
  157. package/coverage/Chrome Headless 79.0.3945.0 (Mac OS 10.16.0)/html/src/util.ts.html +0 -1426
  158. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/index.html +0 -176
  159. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/custom-array.ts.html +0 -214
  160. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/base.ts.html +0 -433
  161. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/channels.ts.html +0 -235
  162. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/chroma-key.ts.html +0 -331
  163. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/contrast.ts.html +0 -211
  164. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/gaussian-blur.ts.html +0 -796
  165. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/grayscale.ts.html +0 -187
  166. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/index.html +0 -311
  167. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/pixelate.ts.html +0 -259
  168. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/shader.ts.html +0 -1948
  169. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/effect/transform.ts.html +0 -685
  170. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/event.ts.html +0 -691
  171. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/audio-source.ts.html +0 -835
  172. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/audio.ts.html +0 -241
  173. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/base.ts.html +0 -772
  174. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/image.ts.html +0 -181
  175. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/index.ts.html +0 -124
  176. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/text.ts.html +0 -658
  177. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/video.ts.html +0 -211
  178. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/layer/visual.ts.html +0 -760
  179. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/movie/effects.ts.html +0 -163
  180. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/movie/index.html +0 -161
  181. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/movie/index.ts.html +0 -88
  182. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/movie/layers.ts.html +0 -163
  183. package/coverage/Firefox 118.0 (Mac OS 10.15)/html/src/movie/movie.ts.html +0 -2692
  184. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/base.css +0 -224
  185. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/block-navigation.js +0 -87
  186. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/favicon.png +0 -0
  187. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/index.html +0 -176
  188. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/prettify.css +0 -1
  189. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/prettify.js +0 -2
  190. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/sort-arrow-sprite.png +0 -0
  191. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/sorter.js +0 -196
  192. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/brightness.ts.html +0 -214
  193. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/chroma-key.ts.html +0 -331
  194. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/gaussian-blur.ts.html +0 -790
  195. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/index.html +0 -311
  196. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/index.ts.html +0 -154
  197. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/pixelate.ts.html +0 -259
  198. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/shader.ts.html +0 -1948
  199. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/stack.ts.html +0 -358
  200. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/effect/transform.ts.html +0 -685
  201. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/etro.ts.html +0 -163
  202. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/index.html +0 -176
  203. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/layer/image.ts.html +0 -181
  204. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/layer/index.html +0 -236
  205. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/layer/text.ts.html +0 -658
  206. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/layer/visual-source.ts.html +0 -721
  207. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/movie/movie.ts.html +0 -2692
  208. package/coverage/Firefox 120.0 (Mac OS 10.15)/html/src/util.ts.html +0 -1426
  209. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/base.css +0 -224
  210. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/block-navigation.js +0 -87
  211. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/favicon.png +0 -0
  212. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/index.html +0 -176
  213. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/prettify.css +0 -1
  214. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/prettify.js +0 -2
  215. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/sort-arrow-sprite.png +0 -0
  216. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/sorter.js +0 -196
  217. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/custom-array.ts.html +0 -214
  218. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/base.ts.html +0 -433
  219. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/brightness.ts.html +0 -214
  220. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/channels.ts.html +0 -235
  221. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/chroma-key.ts.html +0 -331
  222. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/contrast.ts.html +0 -211
  223. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/elliptical-mask.ts.html +0 -310
  224. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/gaussian-blur.ts.html +0 -796
  225. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/grayscale.ts.html +0 -187
  226. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/index.html +0 -311
  227. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/index.ts.html +0 -154
  228. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/stack.ts.html +0 -358
  229. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/effect/visual.ts.html +0 -148
  230. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/etro.ts.html +0 -163
  231. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/event.ts.html +0 -691
  232. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/index.html +0 -176
  233. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/index.ts.html +0 -109
  234. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/audio-source.ts.html +0 -835
  235. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/audio.ts.html +0 -241
  236. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/base.ts.html +0 -772
  237. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/index.html +0 -236
  238. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/index.ts.html +0 -124
  239. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/visual-source.ts.html +0 -721
  240. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/layer/visual.ts.html +0 -760
  241. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/movie/effects.ts.html +0 -163
  242. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/movie/index.html +0 -161
  243. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/movie/layers.ts.html +0 -163
  244. package/coverage/Firefox 121.0 (Mac OS 10.15)/html/src/util.ts.html +0 -1453
  245. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/base.css +0 -224
  246. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/block-navigation.js +0 -87
  247. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/favicon.png +0 -0
  248. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/prettify.css +0 -1
  249. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/prettify.js +0 -2
  250. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/sort-arrow-sprite.png +0 -0
  251. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/sorter.js +0 -196
  252. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/effect/elliptical-mask.ts.html +0 -310
  253. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/effect/index.ts.html +0 -154
  254. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/effect/visual.ts.html +0 -148
  255. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/etro.ts.html +0 -163
  256. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/index.ts.html +0 -109
  257. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/layer/audio.ts.html +0 -241
  258. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/layer/index.ts.html +0 -124
  259. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/layer/text.ts.html +0 -658
  260. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/layer/video.ts.html +0 -211
  261. package/coverage/Firefox 148.0 (Mac OS 10.15)/html/src/movie/index.ts.html +0 -88
  262. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/base.css +0 -0
  263. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/block-navigation.js +0 -0
  264. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/favicon.png +0 -0
  265. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/prettify.css +0 -0
  266. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/prettify.js +0 -0
  267. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/sort-arrow-sprite.png +0 -0
  268. /package/coverage/{Chrome Headless 79.0.3945.0 (Mac OS 10.16.0) → Chrome Headless 148.0.0.0 (Mac OS 10.15.7)}/html/sorter.js +0 -0
  269. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/base.css +0 -0
  270. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/block-navigation.js +0 -0
  271. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/favicon.png +0 -0
  272. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/prettify.css +0 -0
  273. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/prettify.js +0 -0
  274. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/sort-arrow-sprite.png +0 -0
  275. /package/coverage/{Firefox 118.0 (Mac OS 10.15) → Firefox 151.0 (Mac OS 10.15)}/html/sorter.js +0 -0
package/dist/util.d.ts CHANGED
@@ -1,123 +1,128 @@
1
- /**
2
- * @module util
3
- */
4
- import EtroObject from './object';
5
- import { Movie } from './movie';
6
- /**
7
- * Merges `options` with `defaultOptions`, and then copies the properties with
8
- * the keys in `defaultOptions` from the merged object to `destObj`.
9
- *
10
- * @deprecated Each option should be copied individually, and the default value
11
- * should be set in the constructor. See
12
- * {@link https://github.com/etro-js/etro/issues/131} for more info.
13
- *
14
- * @return
15
- */
16
- export declare function applyOptions(options: object, destObj: EtroObject): void;
17
- export declare function clearCachedValues(movie: Movie): void;
18
- declare type Interpolate = <U = number | object>(startValue: U, endValue: U, percentProgress: number, interpolationKeys: string[]) => U;
19
- /**
20
- * A keyframe set.
21
- *
22
- * Usage:
23
- * ```js
24
- new etro.KeyFrame([time1, value1, interpolation1], [time2, value2])`
25
- * ```
26
- * TypeScript users need to specify the type of the value as a type parameter.
27
- */
28
- export declare class KeyFrame<T> {
29
- value: (number | T | Interpolate)[][];
30
- /** Keys to interpolate, or all keys if undefined */
31
- interpolationKeys: string[];
32
- constructor(...value: (number | T)[][]);
33
- withKeys(keys: string[]): KeyFrame<T>;
34
- evaluate(time: number): T;
35
- }
36
- /** A dynamic property. Supports simple values, keyframes and functions */
37
- export declare type Dynamic<T> = T | KeyFrame<T> | ((element: EtroObject, time: number) => T);
38
- /**
39
- * Computes a property.
40
- *
41
- * @param element - the etro object to which the property belongs to
42
- * @param path - the dot-separated path to a property on `element`
43
- * @param time - time to calculate keyframes for, if necessary
44
- *
45
- * Note that only values used in keyframes that are numbers or objects
46
- * (including arrays) are interpolated. All other values are taken sequentially
47
- * with no interpolation. JavaScript will convert parsed colors, if created
48
- * correctly, to their string representations when assigned to a
49
- * CanvasRenderingContext2D property.
50
- */
51
- export declare function val(element: EtroObject, path: string, time: number): any;
52
- export declare function linearInterp(x1: number | object, x2: number | object, t: number, objectKeys?: string[]): number | object;
53
- export declare function cosineInterp(x1: number | object, x2: number | object, t: number, objectKeys?: string[]): number | object;
54
- /**
55
- * An RGBA color, for proper interpolation and shader effects
56
- */
57
- export declare class Color {
58
- r: number;
59
- g: number;
60
- b: number;
61
- a: number;
62
- /**
63
- * @param r
64
- * @param g
65
- * @param b
66
- * @param a
67
- */
68
- constructor(r: number, g: number, b: number, a?: number);
69
- /**
70
- * Converts to a CSS color
71
- */
72
- toString(): string;
73
- }
74
- /**
75
- * Converts a CSS color string to a {@link Color} object representation.
76
- * @param str
77
- * @return the parsed color
78
- */
79
- export declare function parseColor(str: string): Color;
80
- /**
81
- * A font, for proper interpolation
82
- */
83
- export declare class Font {
84
- size: number;
85
- sizeUnit: string;
86
- family: string;
87
- style: string;
88
- variant: string;
89
- weight: string;
90
- stretch: string;
91
- lineHeight: string;
92
- /**
93
- * @param size
94
- * @param family
95
- * @param sizeUnit
96
- */
97
- constructor(size: number, sizeUnit: string, family: string, style?: string, variant?: string, weight?: string, stretch?: string, lineHeight?: string);
98
- /**
99
- * Converts to CSS font syntax
100
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font
101
- */
102
- toString(): string;
103
- }
104
- /**
105
- * Converts a CSS font string to a {@link Font} object
106
- * representation.
107
- * @param str
108
- * @return the parsed font
109
- */
110
- export declare function parseFont(str: string): Font;
111
- /**
112
- * @param mapper
113
- * @param canvas
114
- * @param ctx
115
- * @param x
116
- * @param y
117
- * @param width
118
- * @param height
119
- * @param flush
120
- * @deprecated Use {@link effect.Shader} instead
121
- */
122
- export declare function mapPixels(mapper: (pixels: Uint8ClampedArray, i: number) => void, canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, flush?: boolean): void;
123
- export {};
1
+ /**
2
+ * @module util
3
+ */
4
+ import EtroObject from './object';
5
+ import { Movie } from './movie';
6
+ /**
7
+ * Merges `options` with `defaultOptions`, and then copies the properties with
8
+ * the keys in `defaultOptions` from the merged object to `destObj`.
9
+ *
10
+ * @deprecated Each option should be copied individually, and the default value
11
+ * should be set in the constructor. See
12
+ * {@link https://github.com/etro-js/etro/issues/131} for more info.
13
+ *
14
+ * @return
15
+ */
16
+ export declare function applyOptions(options: object, destObj: EtroObject): void;
17
+ export declare function clearCachedValues(movie: Movie): void;
18
+ type Interpolate = <U = number | object>(startValue: U, endValue: U, percentProgress: number, interpolationKeys: string[]) => U;
19
+ /**
20
+ * A keyframe set.
21
+ *
22
+ * Usage:
23
+ * ```js
24
+ new etro.KeyFrame([time1, value1, interpolation1], [time2, value2])`
25
+ * ```
26
+ * TypeScript users need to specify the type of the value as a type parameter.
27
+ */
28
+ export declare class KeyFrame<T> {
29
+ value: (number | T | Interpolate)[][];
30
+ /** Keys to interpolate, or all keys if undefined */
31
+ interpolationKeys: string[];
32
+ constructor(...value: (number | T)[][]);
33
+ withKeys(keys: string[]): KeyFrame<T>;
34
+ toJSON(): object;
35
+ evaluate(time: number): T;
36
+ }
37
+ /** A dynamic property. Supports simple values, keyframes and functions */
38
+ export type Dynamic<T> = T | KeyFrame<T> | ((element: EtroObject, time: number) => T);
39
+ /**
40
+ * Computes a property.
41
+ *
42
+ * @param element - the etro object to which the property belongs to
43
+ * @param path - the dot-separated path to a property on `element`
44
+ * @param time - time to calculate keyframes for, if necessary
45
+ *
46
+ * Note that only values used in keyframes that are numbers or objects
47
+ * (including arrays) are interpolated. All other values are taken sequentially
48
+ * with no interpolation. JavaScript will convert parsed colors, if created
49
+ * correctly, to their string representations when assigned to a
50
+ * CanvasRenderingContext2D property.
51
+ */
52
+ export declare function val(element: EtroObject, path: string, time: number): any;
53
+ export declare function linearInterp(x1: number | object, x2: number | object, t: number, objectKeys?: string[]): number | object;
54
+ export declare function cosineInterp(x1: number | object, x2: number | object, t: number, objectKeys?: string[]): number | object;
55
+ /**
56
+ * An RGBA color, for proper interpolation and shader effects
57
+ */
58
+ export declare class Color {
59
+ r: number;
60
+ g: number;
61
+ b: number;
62
+ a: number;
63
+ /**
64
+ * @param r
65
+ * @param g
66
+ * @param b
67
+ * @param a
68
+ */
69
+ constructor(r: number, g: number, b: number, a?: number);
70
+ /**
71
+ * Converts to a CSS color
72
+ */
73
+ toString(): string;
74
+ toJSON(): object;
75
+ }
76
+ /**
77
+ * Converts a CSS color string to a {@link Color} object representation.
78
+ * @param str
79
+ * @return the parsed color
80
+ */
81
+ export declare function parseColor(str: string): Color;
82
+ /**
83
+ * A font, for proper interpolation
84
+ */
85
+ export declare class Font {
86
+ size: number;
87
+ sizeUnit: string;
88
+ family: string;
89
+ style: string;
90
+ variant: string;
91
+ weight: string;
92
+ stretch: string;
93
+ lineHeight: string;
94
+ /**
95
+ * @param size
96
+ * @param family
97
+ * @param sizeUnit
98
+ */
99
+ constructor(size: number, sizeUnit: string, family: string, style?: string, variant?: string, weight?: string, stretch?: string, lineHeight?: string);
100
+ /**
101
+ * Converts to CSS font syntax
102
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/font
103
+ */
104
+ toString(): string;
105
+ toJSON(): object;
106
+ }
107
+ /**
108
+ * Converts a CSS font string to a {@link Font} object
109
+ * representation.
110
+ * @param str
111
+ * @return the parsed font
112
+ */
113
+ export declare function parseFont(str: string): Font;
114
+ /**
115
+ * @param mapper
116
+ * @param canvas
117
+ * @param ctx
118
+ * @param x
119
+ * @param y
120
+ * @param width
121
+ * @param height
122
+ * @param flush
123
+ * @deprecated Use {@link effect.Shader} instead
124
+ */
125
+ export declare function mapPixels(mapper: (pixels: Uint8ClampedArray, i: number) => void, canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, flush?: boolean): void;
126
+ export declare function serializeProperty(val: any): any;
127
+ export declare function deserializeProperty(val: any): any;
128
+ export {};
package/karma.conf.js CHANGED
@@ -1,7 +1,40 @@
1
1
  // Karma configuration
2
2
  // Generated on Thu Sep 19 2019 02:05:06 GMT-0400 (Eastern Daylight Time)
3
3
 
4
- process.env.CHROME_BIN = require('puppeteer').executablePath()
4
+ const { BrowserFinder } = require('@agent-infra/browser-finder')
5
+
6
+ const finder = new BrowserFinder()
7
+
8
+ // Detect which browsers are installed locally. Honor an explicit *_BIN
9
+ // override if one is already set, otherwise ask the finder to locate it.
10
+ function locateBrowser (type, envVar) {
11
+ if (process.env[envVar]) {
12
+ return process.env[envVar]
13
+ }
14
+ try {
15
+ return finder.findBrowser(type).path
16
+ } catch (e) {
17
+ return undefined
18
+ }
19
+ }
20
+
21
+ const browsers = []
22
+
23
+ const chromeBin = locateBrowser('chrome', 'CHROME_BIN')
24
+ if (chromeBin) {
25
+ process.env.CHROME_BIN = chromeBin
26
+ browsers.push('ChromeHeadlessWebGL')
27
+ }
28
+
29
+ const firefoxBin = locateBrowser('firefox', 'FIREFOX_BIN')
30
+ if (firefoxBin) {
31
+ process.env.FIREFOX_BIN = firefoxBin
32
+ browsers.push('FirefoxHeadless')
33
+ }
34
+
35
+ if (browsers.length === 0) {
36
+ throw new Error('No supported browsers (Chrome or Firefox) found locally. Install one or set CHROME_BIN / FIREFOX_BIN.')
37
+ }
5
38
 
6
39
  // Make sure TEST_SUITE is set
7
40
  if (!process.env.TEST_SUITE) {
@@ -56,7 +89,8 @@ module.exports = function (config) {
56
89
 
57
90
  // start these browsers
58
91
  // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
59
- browsers: ['FirefoxHeadless'],
92
+ // Only the browsers detected as installed locally.
93
+ browsers,
60
94
 
61
95
  customLaunchers: {
62
96
  'FirefoxHeadless': {
@@ -64,8 +98,28 @@ module.exports = function (config) {
64
98
  flags: ['-headless'],
65
99
  prefs: {
66
100
  'network.proxy.type': 0,
67
- 'media.autoplay.default': 0 // Allow all autoplay
101
+ 'media.autoplay.default': 0, // Allow all autoplay
102
+ // Mute the speaker output only. The Web Audio graph still runs, so
103
+ // analyser-based assertions stay valid. Applies to karma's throwaway
104
+ // temp profile, so it won't affect a normal Firefox install.
105
+ 'media.volume_scale': '0.0',
106
+ // Force WebGL on under software rendering (e.g. llvmpipe in CI),
107
+ // which Firefox would otherwise blocklist for lacking a GPU.
108
+ 'webgl.force-enabled': true,
109
+ 'webgl.disabled': false,
110
+ 'webgl.disable-fail-if-major-performance-caveat': true
68
111
  }
112
+ },
113
+ 'ChromeHeadlessWebGL': {
114
+ base: 'ChromeHeadless',
115
+ flags: [
116
+ '--use-gl=angle',
117
+ '--use-angle=swiftshader',
118
+ '--no-sandbox',
119
+ '--autoplay-policy=no-user-gesture-required',
120
+ // Mute the speaker output only; the Web Audio graph still runs.
121
+ '--mute-audio'
122
+ ]
69
123
  }
70
124
  },
71
125
 
@@ -89,6 +143,10 @@ module.exports = function (config) {
89
143
  concurrency: Infinity,
90
144
 
91
145
  karmaTypescriptConfig: {
146
+ compilerOptions: {
147
+ // Avoid type-checking third-party declaration packages in browser tests.
148
+ skipLibCheck: true
149
+ },
92
150
  bundlerOptions: {
93
151
  // Resemblejs only references the `canvas` dependency in the node
94
152
  // runtime. Since the tests are run in a browser, we need to exclude it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etro",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "An extendable video-editing framework for the browser",
5
5
  "main": "dist/etro-cjs.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,12 +10,11 @@
10
10
  "test": "spec"
11
11
  },
12
12
  "devDependencies": {
13
- "@commitlint/cli": "^17.6.6",
14
- "@commitlint/format": "^17.4.4",
13
+ "@agent-infra/browser-finder": "^0.2.2",
15
14
  "@rollup/plugin-eslint": "^9.2.0",
16
15
  "@types/jest": "^29.0.0",
17
- "@typescript-eslint/eslint-plugin": "^5.30.7",
18
- "@typescript-eslint/parser": "^5.30.7",
16
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
17
+ "@typescript-eslint/parser": "^5.62.0",
19
18
  "cross-env": "^7.0.3",
20
19
  "docdash": "^1.1.1",
21
20
  "ecstatic": ">=4.1.3",
@@ -27,27 +26,26 @@
27
26
  "eslint-plugin-promise": "^6.0.0",
28
27
  "eslint-plugin-standard": "^5.0.0",
29
28
  "ev": "0.0.7",
30
- "gitmoji-cli": "^9.0.0",
31
29
  "http-server": "^14.1.1",
32
30
  "husky": "^8.0.3",
33
31
  "jasmine": "^3.4.0",
34
- "jasmine-ts": "^0.4.0",
35
- "karma": "^6.1.1",
32
+ "karma": "^6.4.4",
33
+ "karma-chrome-launcher": "^3.2.0",
36
34
  "karma-firefox-launcher": "^2.1.2",
37
- "karma-jasmine": "^2.0.1",
35
+ "karma-jasmine": "^5.1.0",
38
36
  "karma-super-dots-reporter": "^0.2.0",
39
- "karma-typescript": "^5.5.3",
37
+ "karma-typescript": "^5.5.4",
40
38
  "keep-a-changelog": "^0.10.4",
41
39
  "puppeteer": "^2.0.0",
42
40
  "resemblejs": "^4.1.0",
43
- "rollup": "^4.53.3",
41
+ "rollup": "^4.61.1",
44
42
  "rollup-plugin-cleaner": "^1.0.0",
45
43
  "rollup-plugin-node-resolve": "^5.2.0",
46
- "rollup-plugin-typescript2": "^0.29.0",
44
+ "rollup-plugin-typescript2": "^0.37.0",
47
45
  "rollup-plugin-uglify-es": "^0.0.1",
48
- "shipjs": "^0.27.0",
49
- "typedoc": "^0.23.8",
50
- "typescript": "^4.7.4"
46
+ "shipjs": "^0.28.3",
47
+ "typedoc": "^0.28.19",
48
+ "typescript": "^5.0.4"
51
49
  },
52
50
  "scripts": {
53
51
  "build": "rollup -c",
package/ship.config.js CHANGED
@@ -25,17 +25,15 @@ module.exports = {
25
25
  const newChangelog = parsed.toString()
26
26
  fs.writeFileSync(changelogFile, newChangelog, 'utf8')
27
27
  },
28
- releases: [
29
- {
30
- extractChangelog: ({ version, dir }) => {
31
- const changelogFile = `${dir}/CHANGELOG.md`
32
- const changelog = fs.readFileSync(changelogFile, 'utf8')
33
- const parsed = parser(changelog)
34
- const release = parsed.findRelease(version)
35
- return `${release.toString()}\n${release.getCompareLink()}`
36
- },
37
- }
38
- ]
28
+ releases: {
29
+ extractChangelog: ({ version, dir }) => {
30
+ const changelogFile = `${dir}/CHANGELOG.md`
31
+ const changelog = fs.readFileSync(changelogFile, 'utf8')
32
+ const parsed = parser(changelog)
33
+ const release = parsed.findRelease(version)
34
+ return `${release.toString()}\n${release.getCompareLink()}`
35
+ },
36
+ }
39
37
  }
40
38
 
41
39
  class Changelog {
@@ -1,6 +1,7 @@
1
1
  import { Movie } from '../movie'
2
2
  import { Base as BaseLayer } from '../layer/index'
3
3
  import BaseObject from '../object'
4
+ import { serializeProperty } from '../util'
4
5
 
5
6
  /**
6
7
  * @deprecated All visual effects now inherit from `Visual` instead
@@ -108,6 +109,21 @@ export class Base implements BaseObject {
108
109
  getDefaultOptions (): Record<string, unknown> {
109
110
  return {}
110
111
  }
112
+
113
+ toJSON (): object {
114
+ const json: any = { type: `effect.${this.constructor.name}` }
115
+ const exclude = ['type', 'publicExcludes', 'propertyFilters', 'movie', 'ready', 'parent', 'currentTime', ...this.publicExcludes]
116
+ for (const key in this) {
117
+ if (key.startsWith('_') || exclude.indexOf(key) !== -1 || typeof (this as any)[key] === 'function') {
118
+ continue
119
+ }
120
+ json[key] = serializeProperty((this as any)[key])
121
+ }
122
+ if ((this as any).effects && (this as any).effects.length > 0) {
123
+ json.effects = (this as any).effects.map((e: any) => e.toJSON())
124
+ }
125
+ return json
126
+ }
111
127
  }
112
128
  // id for events (independent of instance, but easy to access when on prototype
113
129
  // chain)
package/src/layer/base.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import EtroObject from '../object'
2
- import { applyOptions } from '../util'
2
+ import { applyOptions, serializeProperty } from '../util'
3
3
  import { Movie } from '../movie'
4
4
 
5
5
  interface BaseOptions {
@@ -219,6 +219,24 @@ class Base implements EtroObject {
219
219
  duration: undefined // required
220
220
  }
221
221
  }
222
+
223
+ toJSON (): object {
224
+ const json: any = { type: `layer.${this.constructor.name}` }
225
+ const exclude = ['type', 'publicExcludes', 'propertyFilters', 'movie', 'ready', 'parent', 'currentTime', 'effects', ...this.publicExcludes]
226
+ for (const key in this) {
227
+ if (key.startsWith('_') || exclude.indexOf(key) !== -1 || typeof (this as any)[key] === 'function') {
228
+ continue
229
+ }
230
+ json[key] = serializeProperty((this as any)[key])
231
+ }
232
+ json.startTime = this.startTime
233
+ json.duration = this.duration
234
+
235
+ if ((this as any).effects && (this as any).effects.length > 0) {
236
+ json.effects = (this as any).effects.map((e: any) => e.toJSON())
237
+ }
238
+ return json
239
+ }
222
240
  }
223
241
  // id for events (independent of instance, but easy to access when on prototype
224
242
  // chain)
@@ -3,9 +3,11 @@
3
3
  */
4
4
 
5
5
  import { publish, deprecate } from '../event'
6
- import { Dynamic, val, clearCachedValues, applyOptions, Color, parseColor } from '../util'
6
+ import { Dynamic, val, clearCachedValues, applyOptions, Color, parseColor, serializeProperty, deserializeProperty } from '../util'
7
7
  import { Base as BaseLayer, Audio as AudioLayer, Video as VideoLayer, Visual } from '../layer/index' // `Media` mixins
8
8
  import { Base as BaseEffect } from '../effect/index'
9
+ import * as Layers from '../layer/index'
10
+ import * as Effects from '../effect/index'
9
11
  import { MovieEffects } from './effects'
10
12
  import { MovieLayers } from './layers'
11
13
 
@@ -182,7 +184,7 @@ export class Movie {
182
184
  * Streams the movie to a MediaStream
183
185
  *
184
186
  * @param options Options for the stream
185
- * @param options.frameRate The frame rate of the stream's video
187
+ * @param options.frameRate The maximum frame rate of the stream's video
186
188
  * @param options.duration The duration of the stream in seconds
187
189
  * @param options.video Whether to stream video. Defaults to true.
188
190
  * @param options.audio Whether to stream audio. Defaults to true.
@@ -265,7 +267,7 @@ export class Movie {
265
267
  * Plays the movie in the background and records it
266
268
  *
267
269
  * @param options
268
- * @param [options.frameRate] - Video frame rate
270
+ * @param [options.frameRate] - Maximum video frame rate (fps)
269
271
  * @param [options.video=true] - whether to include video in recording
270
272
  * @param [options.audio=true] - whether to include audio in recording
271
273
  * @param [options.mediaRecorderOptions=undefined] - Options to pass to the
@@ -854,6 +856,117 @@ export class Movie {
854
856
  repeat: false
855
857
  }
856
858
  }
859
+
860
+ toJSON (): object {
861
+ return {
862
+ type: 'movie',
863
+ canvas: this.canvas ? { width: this.canvas.width, height: this.canvas.height } : undefined,
864
+ background: serializeProperty(this.background),
865
+ repeat: this.repeat,
866
+ layers: this.layers.map(layer => (layer as any).toJSON()),
867
+ effects: this.effects.map(effect => (effect as any).toJSON())
868
+ }
869
+ }
870
+
871
+ static fromJSON (json: any, canvas?: HTMLCanvasElement, actx?: AudioContext): Movie {
872
+ if (!canvas) {
873
+ canvas = document.createElement('canvas')
874
+ if (json.canvas) {
875
+ canvas.width = json.canvas.width
876
+ canvas.height = json.canvas.height
877
+ }
878
+ }
879
+ const options: any = {
880
+ canvas,
881
+ actx,
882
+ background: deserializeProperty(json.background),
883
+ repeat: json.repeat
884
+ }
885
+ const movie = new Movie(options)
886
+
887
+ const deserializeEffect = (effectJson: any): any => {
888
+ const type = effectJson.type.replace('effect.', '')
889
+ const EffectClass = (Effects as any)[type]
890
+ if (!EffectClass) {
891
+ throw new Error(`Unknown effect type: ${type}`)
892
+ }
893
+
894
+ const effectOptions: any = {}
895
+ const defaultOptions = EffectClass.prototype.getDefaultOptions ? EffectClass.prototype.getDefaultOptions() : {}
896
+
897
+ for (const key in effectJson) {
898
+ if (key !== 'type' && key !== 'effects') {
899
+ if (key in defaultOptions) {
900
+ effectOptions[key] = deserializeProperty(effectJson[key])
901
+ }
902
+ }
903
+ }
904
+
905
+ if (effectJson.effects) {
906
+ effectOptions.effects = effectJson.effects.map((subEffectJson: any) => deserializeEffect(subEffectJson))
907
+ }
908
+
909
+ const effect = new EffectClass(effectOptions)
910
+ for (const key in effectJson) {
911
+ if (key !== 'type' && key !== 'effects' && !(key in defaultOptions)) {
912
+ effect[key] = deserializeProperty(effectJson[key])
913
+ }
914
+ }
915
+ return effect
916
+ }
917
+
918
+ const deserializeLayer = (layerJson: any): any => {
919
+ const type = layerJson.type.replace('layer.', '')
920
+ const LayerClass = (Layers as any)[type]
921
+ if (!LayerClass) {
922
+ throw new Error(`Unknown layer type: ${type}`)
923
+ }
924
+
925
+ const layerOptions: any = {}
926
+ const defaultOptions = LayerClass.prototype.getDefaultOptions ? LayerClass.prototype.getDefaultOptions() : {}
927
+ if (!('startTime' in defaultOptions)) {
928
+ defaultOptions.startTime = undefined
929
+ }
930
+ if (!('duration' in defaultOptions)) {
931
+ defaultOptions.duration = undefined
932
+ }
933
+
934
+ for (const key in layerJson) {
935
+ if (key !== 'type' && key !== 'effects') {
936
+ if (key in defaultOptions) {
937
+ layerOptions[key] = deserializeProperty(layerJson[key])
938
+ }
939
+ }
940
+ }
941
+
942
+ const layer = new LayerClass(layerOptions)
943
+ for (const key in layerJson) {
944
+ if (key !== 'type' && key !== 'effects' && !(key in defaultOptions)) {
945
+ layer[key] = deserializeProperty(layerJson[key])
946
+ }
947
+ }
948
+ if (layerJson.effects) {
949
+ for (const effectJson of layerJson.effects) {
950
+ layer.addEffect(deserializeEffect(effectJson))
951
+ }
952
+ }
953
+ return layer
954
+ }
955
+
956
+ if (json.layers) {
957
+ for (const layerJson of json.layers) {
958
+ movie.addLayer(deserializeLayer(layerJson))
959
+ }
960
+ }
961
+
962
+ if (json.effects) {
963
+ for (const effectJson of json.effects) {
964
+ movie.addEffect(deserializeEffect(effectJson))
965
+ }
966
+ }
967
+
968
+ return movie
969
+ }
857
970
  }
858
971
 
859
972
  // Id for events