@shopify/react-native-skia 2.0.6 → 2.1.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 (287) hide show
  1. package/android/CMakeLists.txt +20 -1
  2. package/cpp/api/JsiSkApi.h +3 -0
  3. package/cpp/api/JsiSkImageFilterFactory.h +478 -39
  4. package/cpp/api/JsiSkPath.h +2 -1
  5. package/cpp/api/JsiSkPathFactory.h +1 -1
  6. package/cpp/api/JsiSkSkottie.h +590 -0
  7. package/cpp/api/JsiSkottieFactory.h +65 -0
  8. package/cpp/api/recorder/Command.h +1 -0
  9. package/cpp/api/recorder/Convertor.h +16 -0
  10. package/cpp/api/recorder/Drawings.h +23 -0
  11. package/cpp/api/recorder/JsiRecorder.h +6 -0
  12. package/cpp/api/recorder/RNRecorder.h +9 -0
  13. package/cpp/api/third_party/SkottieUtils.cpp +333 -0
  14. package/cpp/api/third_party/SkottieUtils.h +172 -0
  15. package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +980 -0
  16. package/cpp/skia/modules/jsonreader/SkJSONReader.h +389 -0
  17. package/cpp/skia/modules/skottie/include/ExternalLayer.h +56 -0
  18. package/cpp/skia/modules/skottie/include/Skottie.h +313 -0
  19. package/cpp/skia/modules/skottie/include/SkottieProperty.h +190 -0
  20. package/cpp/skia/modules/skottie/include/SlotManager.h +113 -0
  21. package/cpp/skia/modules/skottie/include/TextShaper.h +200 -0
  22. package/cpp/skia/modules/skottie/src/SkottieValue.h +56 -0
  23. package/cpp/skia/modules/skottie/src/animator/Animator.h +89 -0
  24. package/cpp/skia/modules/skottie/src/text/Font.h +82 -0
  25. package/cpp/skia/modules/skottie/src/text/TextAdapter.h +155 -0
  26. package/cpp/skia/modules/skottie/src/text/TextAnimator.h +121 -0
  27. package/cpp/skia/modules/skottie/src/text/TextValue.h +28 -0
  28. package/cpp/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
  29. package/cpp/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
  30. package/cpp/skia/modules/sksg/include/SkSGDraw.h +57 -0
  31. package/cpp/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
  32. package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +181 -0
  33. package/cpp/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
  34. package/cpp/skia/modules/sksg/include/SkSGGradient.h +108 -0
  35. package/cpp/skia/modules/sksg/include/SkSGGroup.h +65 -0
  36. package/cpp/skia/modules/sksg/include/SkSGImage.h +59 -0
  37. package/cpp/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
  38. package/cpp/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
  39. package/cpp/skia/modules/sksg/include/SkSGMerge.h +74 -0
  40. package/cpp/skia/modules/sksg/include/SkSGNode.h +128 -0
  41. package/cpp/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
  42. package/cpp/skia/modules/sksg/include/SkSGPaint.h +112 -0
  43. package/cpp/skia/modules/sksg/include/SkSGPath.h +68 -0
  44. package/cpp/skia/modules/sksg/include/SkSGPlane.h +47 -0
  45. package/cpp/skia/modules/sksg/include/SkSGRect.h +122 -0
  46. package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
  47. package/cpp/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
  48. package/cpp/skia/modules/sksg/include/SkSGScene.h +47 -0
  49. package/cpp/skia/modules/sksg/include/SkSGText.h +82 -0
  50. package/cpp/skia/modules/sksg/include/SkSGTransform.h +127 -0
  51. package/cpp/skia/src/base/SkArenaAlloc.h +371 -0
  52. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +15 -15
  53. package/lib/commonjs/dom/types/Drawings.d.ts +5 -1
  54. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  55. package/lib/commonjs/dom/types/NodeType.d.ts +2 -1
  56. package/lib/commonjs/dom/types/NodeType.js +2 -0
  57. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  58. package/lib/commonjs/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  59. package/lib/commonjs/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  60. package/lib/commonjs/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  61. package/lib/commonjs/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  62. package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -0
  63. package/lib/commonjs/renderer/components/Skottie.d.ts +4 -0
  64. package/lib/commonjs/renderer/components/Skottie.js +13 -0
  65. package/lib/commonjs/renderer/components/Skottie.js.map +1 -0
  66. package/lib/commonjs/renderer/components/index.d.ts +1 -0
  67. package/lib/commonjs/renderer/components/index.js +11 -0
  68. package/lib/commonjs/renderer/components/index.js.map +1 -1
  69. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  70. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  71. package/lib/commonjs/skia/types/Matrix4.d.ts +11 -2
  72. package/lib/commonjs/skia/types/Matrix4.js +42 -1
  73. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  74. package/lib/commonjs/skia/types/Recorder.d.ts +2 -1
  75. package/lib/commonjs/skia/types/Recorder.js.map +1 -1
  76. package/lib/commonjs/skia/types/Skia.d.ts +2 -0
  77. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  78. package/lib/commonjs/skia/types/Skottie.d.ts +223 -0
  79. package/lib/commonjs/skia/types/Skottie.js +73 -0
  80. package/lib/commonjs/skia/types/Skottie.js.map +1 -0
  81. package/lib/commonjs/skia/types/index.d.ts +1 -0
  82. package/lib/commonjs/skia/types/index.js +11 -0
  83. package/lib/commonjs/skia/types/index.js.map +1 -1
  84. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  85. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +88 -19
  86. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  87. package/lib/commonjs/skia/web/JsiSkia.js +2 -0
  88. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  89. package/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +59 -0
  90. package/lib/commonjs/skia/web/JsiSkottieAnimation.js +243 -0
  91. package/lib/commonjs/skia/web/JsiSkottieAnimation.js.map +1 -0
  92. package/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +9 -0
  93. package/lib/commonjs/skia/web/JsiSkottieFactory.js +26 -0
  94. package/lib/commonjs/skia/web/JsiSkottieFactory.js.map +1 -0
  95. package/lib/commonjs/sksg/Elements.d.ts +2 -1
  96. package/lib/commonjs/sksg/Elements.js.map +1 -1
  97. package/lib/commonjs/sksg/Recorder/Core.d.ts +4 -2
  98. package/lib/commonjs/sksg/Recorder/Core.js +1 -0
  99. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
  100. package/lib/commonjs/sksg/Recorder/Player.js +2 -0
  101. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
  102. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  103. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +4 -0
  104. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  105. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +2 -1
  106. package/lib/commonjs/sksg/Recorder/Recorder.js +6 -0
  107. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
  108. package/lib/commonjs/sksg/Recorder/Visitor.js +3 -0
  109. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
  110. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +2 -2
  111. package/lib/commonjs/sksg/Recorder/commands/Drawing.js +11 -4
  112. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
  113. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +1 -1
  114. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  115. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +15 -15
  116. package/lib/module/dom/types/Drawings.d.ts +5 -1
  117. package/lib/module/dom/types/Drawings.js.map +1 -1
  118. package/lib/module/dom/types/NodeType.d.ts +2 -1
  119. package/lib/module/dom/types/NodeType.js +2 -0
  120. package/lib/module/dom/types/NodeType.js.map +1 -1
  121. package/lib/module/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  122. package/lib/module/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  123. package/lib/module/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  124. package/lib/module/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  125. package/lib/module/renderer/__tests__/setup.d.ts +5 -0
  126. package/lib/module/renderer/components/Skottie.d.ts +4 -0
  127. package/lib/module/renderer/components/Skottie.js +5 -0
  128. package/lib/module/renderer/components/Skottie.js.map +1 -0
  129. package/lib/module/renderer/components/index.d.ts +1 -0
  130. package/lib/module/renderer/components/index.js +1 -0
  131. package/lib/module/renderer/components/index.js.map +1 -1
  132. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  133. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  134. package/lib/module/skia/types/Matrix4.d.ts +11 -2
  135. package/lib/module/skia/types/Matrix4.js +40 -0
  136. package/lib/module/skia/types/Matrix4.js.map +1 -1
  137. package/lib/module/skia/types/Recorder.d.ts +2 -1
  138. package/lib/module/skia/types/Recorder.js.map +1 -1
  139. package/lib/module/skia/types/Skia.d.ts +2 -0
  140. package/lib/module/skia/types/Skia.js.map +1 -1
  141. package/lib/module/skia/types/Skottie.d.ts +223 -0
  142. package/lib/module/skia/types/Skottie.js +74 -0
  143. package/lib/module/skia/types/Skottie.js.map +1 -0
  144. package/lib/module/skia/types/index.d.ts +1 -0
  145. package/lib/module/skia/types/index.js +1 -0
  146. package/lib/module/skia/types/index.js.map +1 -1
  147. package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  148. package/lib/module/skia/web/JsiSkImageFilterFactory.js +88 -19
  149. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  150. package/lib/module/skia/web/JsiSkia.js +2 -0
  151. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  152. package/lib/module/skia/web/JsiSkottieAnimation.d.ts +59 -0
  153. package/lib/module/skia/web/JsiSkottieAnimation.js +236 -0
  154. package/lib/module/skia/web/JsiSkottieAnimation.js.map +1 -0
  155. package/lib/module/skia/web/JsiSkottieFactory.d.ts +9 -0
  156. package/lib/module/skia/web/JsiSkottieFactory.js +19 -0
  157. package/lib/module/skia/web/JsiSkottieFactory.js.map +1 -0
  158. package/lib/module/sksg/Elements.d.ts +2 -1
  159. package/lib/module/sksg/Elements.js.map +1 -1
  160. package/lib/module/sksg/Recorder/Core.d.ts +4 -2
  161. package/lib/module/sksg/Recorder/Core.js +1 -0
  162. package/lib/module/sksg/Recorder/Core.js.map +1 -1
  163. package/lib/module/sksg/Recorder/Player.js +3 -1
  164. package/lib/module/sksg/Recorder/Player.js.map +1 -1
  165. package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  166. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +4 -0
  167. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  168. package/lib/module/sksg/Recorder/Recorder.d.ts +2 -1
  169. package/lib/module/sksg/Recorder/Recorder.js +6 -0
  170. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  171. package/lib/module/sksg/Recorder/Visitor.js +3 -0
  172. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  173. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +2 -2
  174. package/lib/module/sksg/Recorder/commands/Drawing.js +9 -2
  175. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  176. package/lib/module/sksg/Recorder/commands/ImageFilters.js +1 -1
  177. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  178. package/lib/typescript/lib/commonjs/renderer/components/Skottie.d.ts +2 -0
  179. package/lib/typescript/lib/commonjs/skia/types/Matrix4.d.ts +1 -0
  180. package/lib/typescript/lib/commonjs/skia/types/Skottie.d.ts +6 -0
  181. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  182. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
  183. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +48 -0
  184. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +6 -0
  185. package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  186. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -0
  187. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -1
  188. package/lib/typescript/lib/module/mock/index.d.ts +7 -0
  189. package/lib/typescript/lib/module/renderer/components/Skottie.d.ts +2 -0
  190. package/lib/typescript/lib/module/renderer/components/index.d.ts +1 -0
  191. package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
  192. package/lib/typescript/lib/module/skia/types/Matrix4.d.ts +1 -0
  193. package/lib/typescript/lib/module/skia/types/Skottie.d.ts +5 -0
  194. package/lib/typescript/lib/module/skia/types/index.d.ts +1 -0
  195. package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  196. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
  197. package/lib/typescript/lib/module/skia/web/JsiSkottieAnimation.d.ts +47 -0
  198. package/lib/typescript/lib/module/skia/web/JsiSkottieFactory.d.ts +5 -0
  199. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  200. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -0
  201. package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -1
  202. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +15 -15
  203. package/lib/typescript/src/dom/types/Drawings.d.ts +5 -1
  204. package/lib/typescript/src/dom/types/NodeType.d.ts +2 -1
  205. package/lib/typescript/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  206. package/lib/typescript/src/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  207. package/lib/typescript/src/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  208. package/lib/typescript/src/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  209. package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -0
  210. package/lib/typescript/src/renderer/components/Skottie.d.ts +4 -0
  211. package/lib/typescript/src/renderer/components/index.d.ts +1 -0
  212. package/lib/typescript/src/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  213. package/lib/typescript/src/skia/types/Matrix4.d.ts +11 -2
  214. package/lib/typescript/src/skia/types/Recorder.d.ts +2 -1
  215. package/lib/typescript/src/skia/types/Skia.d.ts +2 -0
  216. package/lib/typescript/src/skia/types/Skottie.d.ts +223 -0
  217. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  218. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  219. package/lib/typescript/src/skia/web/JsiSkottieAnimation.d.ts +59 -0
  220. package/lib/typescript/src/skia/web/JsiSkottieFactory.d.ts +9 -0
  221. package/lib/typescript/src/sksg/Elements.d.ts +2 -1
  222. package/lib/typescript/src/sksg/Recorder/Core.d.ts +4 -2
  223. package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  224. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +2 -1
  225. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +2 -2
  226. package/libs/android/arm64-v8a/libjsonreader.a +0 -0
  227. package/libs/android/armeabi-v7a/libjsonreader.a +0 -0
  228. package/libs/android/x86/libjsonreader.a +0 -0
  229. package/libs/android/x86_64/libjsonreader.a +0 -0
  230. package/libs/apple/libpathops.xcframework/Info.plist +9 -9
  231. package/libs/apple/libskia.xcframework/Info.plist +14 -14
  232. package/libs/apple/libskottie.xcframework/Info.plist +13 -13
  233. package/libs/apple/libskparagraph.xcframework/Info.plist +15 -15
  234. package/libs/apple/libsksg.xcframework/Info.plist +13 -13
  235. package/libs/apple/libskshaper.xcframework/Info.plist +15 -15
  236. package/libs/apple/libskunicode_core.xcframework/Info.plist +9 -9
  237. package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +13 -13
  238. package/libs/apple/libsvg.xcframework/Info.plist +15 -15
  239. package/package.json +1 -1
  240. package/react-native-skia.podspec +4 -2
  241. package/src/__tests__/snapshots/matrix4/camera-corner.png +0 -0
  242. package/src/__tests__/snapshots/matrix4/camera-offset.png +0 -0
  243. package/src/__tests__/snapshots/matrix4/camera-top-left-center.png +0 -0
  244. package/src/__tests__/snapshots/matrix4/camera-zoom-out.png +0 -0
  245. package/src/__tests__/snapshots/matrix4/full-rect.png +0 -0
  246. package/src/__tests__/snapshots/matrix4/rect.png +0 -0
  247. package/src/__tests__/snapshots/matrix4/scaled-rect.png +0 -0
  248. package/src/__tests__/snapshots/matrix4/test-perspective.png +0 -0
  249. package/src/__tests__/snapshots/matrix4/test-perspective2.png +0 -0
  250. package/src/dom/types/Drawings.ts +6 -0
  251. package/src/dom/types/NodeType.ts +2 -0
  252. package/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.tsx +492 -0
  253. package/src/renderer/__tests__/e2e/Camera.spec.tsx +475 -0
  254. package/src/renderer/__tests__/e2e/LightingImageFilters.spec.tsx +1478 -0
  255. package/src/renderer/__tests__/e2e/Skottie.spec.tsx +440 -0
  256. package/src/renderer/__tests__/e2e/setup/skottie/basic_slots.json +1118 -0
  257. package/src/renderer/__tests__/e2e/setup/skottie/color-props.json +1 -0
  258. package/src/renderer/__tests__/e2e/setup/skottie/confetti.json +5899 -0
  259. package/src/renderer/__tests__/e2e/setup/skottie/drinks.json +43857 -0
  260. package/src/renderer/__tests__/e2e/setup/skottie/fingerprint.json +1 -0
  261. package/src/renderer/__tests__/e2e/setup/skottie/lego_loader.json +29540 -0
  262. package/src/renderer/__tests__/e2e/setup/skottie/new-drop.json +1 -0
  263. package/src/renderer/__tests__/e2e/setup/skottie/onboarding.json +1 -0
  264. package/src/renderer/__tests__/e2e/setup/skottie/text-layer.json +1 -0
  265. package/src/renderer/__tests__/setup.tsx +23 -0
  266. package/src/renderer/components/Skottie.tsx +8 -0
  267. package/src/renderer/components/index.ts +1 -0
  268. package/src/skia/__tests__/assets/Avenir-Heavy.ttf +0 -0
  269. package/src/skia/types/ImageFilter/ImageFilterFactory.ts +391 -21
  270. package/src/skia/types/Matrix4.ts +108 -2
  271. package/src/skia/types/Recorder.ts +2 -0
  272. package/src/skia/types/Skia.ts +2 -0
  273. package/src/skia/types/Skottie.ts +266 -0
  274. package/src/skia/types/index.ts +1 -0
  275. package/src/skia/web/JsiSkImageFilterFactory.ts +266 -31
  276. package/src/skia/web/JsiSkia.ts +2 -0
  277. package/src/skia/web/JsiSkottieAnimation.ts +259 -0
  278. package/src/skia/web/JsiSkottieFactory.ts +25 -0
  279. package/src/sksg/Elements.tsx +2 -0
  280. package/src/sksg/Recorder/Core.ts +3 -0
  281. package/src/sksg/Recorder/Player.ts +3 -0
  282. package/src/sksg/Recorder/ReanimatedRecorder.ts +6 -0
  283. package/src/sksg/Recorder/Recorder.ts +5 -0
  284. package/src/sksg/Recorder/Visitor.ts +3 -0
  285. package/src/sksg/Recorder/commands/Drawing.ts +7 -3
  286. package/src/sksg/Recorder/commands/ImageFilters.ts +1 -1
  287. package/cpp/skia/include/pathops/SkPathOps.h +0 -17
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.JsiSkottieAnimation = void 0;
7
+ var _Host = require("./Host");
8
+ var _JsiSkTypeface = require("./JsiSkTypeface");
9
+ var _JsiSkColor = require("./JsiSkColor");
10
+ var _JsiSkRect = require("./JsiSkRect");
11
+ class JsiSkottieAnimation extends _Host.HostObject {
12
+ constructor(CanvasKit, ref) {
13
+ super(CanvasKit, ref, "SkottieAnimation");
14
+ }
15
+ getOpacityProps() {
16
+ return this.ref.getOpacityProps();
17
+ }
18
+ getTextProps() {
19
+ return this.ref.getTextProps();
20
+ }
21
+ getColorProps() {
22
+ return this.ref.getColorProps().map(({
23
+ key,
24
+ value
25
+ }) => ({
26
+ key,
27
+ value: (0, _JsiSkColor.Color)(value)
28
+ }));
29
+ }
30
+ getTransformProps() {
31
+ return this.ref.getTransformProps().map(({
32
+ key,
33
+ value
34
+ }) => ({
35
+ key,
36
+ value: {
37
+ anchor: {
38
+ x: value.anchor[0],
39
+ y: value.anchor[1]
40
+ },
41
+ position: {
42
+ x: value.position[0],
43
+ y: value.position[1]
44
+ },
45
+ scale: {
46
+ x: value.scale[0],
47
+ y: value.scale[1]
48
+ },
49
+ rotation: value.rotation,
50
+ skew: value.skew,
51
+ skewAxis: value.skew_axis
52
+ }
53
+ }));
54
+ }
55
+ setColor(key, color) {
56
+ return this.ref.setColor(key, color);
57
+ }
58
+ setText(key, text, size) {
59
+ return this.ref.setText(key, text, size);
60
+ }
61
+ setOpacity(key, opacity) {
62
+ return this.ref.setOpacity(key, opacity);
63
+ }
64
+ setTransform(key, anchor, position, scale, rotation, skew, skewAxis) {
65
+ const a = Float32Array.of(anchor.x, anchor.y);
66
+ const p = Float32Array.of(position.x, position.y);
67
+ const s = Float32Array.of(scale.x, scale.y);
68
+ return this.ref.setTransform(key, a, p, s, rotation, skew, skewAxis);
69
+ }
70
+ getSlotInfo() {
71
+ return this.ref.getSlotInfo();
72
+ }
73
+ setColorSlot(key, color) {
74
+ return this.ref.setColorSlot(key, color);
75
+ }
76
+ setScalarSlot(key, scalar) {
77
+ return this.ref.setScalarSlot(key, scalar);
78
+ }
79
+ setVec2Slot(key, vec2) {
80
+ return this.ref.setVec2Slot(key, Float32Array.of(vec2.x, vec2.y));
81
+ }
82
+ setTextSlot(key, text) {
83
+ var _text$text, _text$textSize, _text$minTextSize, _text$maxTextSize, _text$strokeWidth, _text$lineHeight, _text$lineShift;
84
+ const txt = {
85
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
86
+ // @ts-expect-error
87
+ typeface: text.typeface && text.typeface instanceof _JsiSkTypeface.JsiSkTypeface ? text.typeface.ref : null,
88
+ text: (_text$text = text.text) !== null && _text$text !== void 0 ? _text$text : "",
89
+ textSize: (_text$textSize = text.textSize) !== null && _text$textSize !== void 0 ? _text$textSize : 0,
90
+ minTextSize: (_text$minTextSize = text.minTextSize) !== null && _text$minTextSize !== void 0 ? _text$minTextSize : 0,
91
+ maxTextSize: (_text$maxTextSize = text.maxTextSize) !== null && _text$maxTextSize !== void 0 ? _text$maxTextSize : Number.MAX_VALUE,
92
+ strokeWidth: (_text$strokeWidth = text.strokeWidth) !== null && _text$strokeWidth !== void 0 ? _text$strokeWidth : 0,
93
+ lineHeight: (_text$lineHeight = text.lineHeight) !== null && _text$lineHeight !== void 0 ? _text$lineHeight : 0,
94
+ lineShift: (_text$lineShift = text.lineShift) !== null && _text$lineShift !== void 0 ? _text$lineShift : 0,
95
+ ascent: text.ascent,
96
+ maxLines: text.maxLines,
97
+ // TODO: implement
98
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
99
+ //@ts-expect-error
100
+ horizAlign: this.CanvasKit.TextAlign.Left,
101
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
102
+ //@ts-expect-error
103
+ vertAlign: this.CanvasKit.VerticalTextAlign.Top,
104
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
105
+ //@ts-expect-error
106
+ strokeJoin: this.CanvasKit.StrokeJoin.Miter,
107
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
108
+ //@ts-expect-error
109
+ direction: this.CanvasKit.TextDirection.LTR,
110
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
111
+ // @ts-expect-error
112
+ linebreak: this.CanvasKit.LineBreakType.HardLineBreak,
113
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
114
+ // @ts-expect-error
115
+ resize: this.CanvasKit.ResizePolicy.None,
116
+ boundingBox: text.boundingBox ? this.CanvasKit.XYWHRect(text.boundingBox.x, text.boundingBox.y, text.boundingBox.width, text.boundingBox.height) : [0, 0, 0, 0],
117
+ fillColor: text.fillColor ? (0, _JsiSkColor.Color)(text.fillColor) : this.CanvasKit.TRANSPARENT,
118
+ strokeColor: text.strokeColor ? (0, _JsiSkColor.Color)(text.strokeColor) : this.CanvasKit.TRANSPARENT
119
+ };
120
+ return this.ref.setTextSlot(key, txt);
121
+ }
122
+ setImageSlot(key, assetName) {
123
+ return this.ref.setImageSlot(key, assetName);
124
+ }
125
+ getColorSlot(key) {
126
+ const color = this.ref.getColorSlot(key);
127
+ return color;
128
+ }
129
+ getScalarSlot(key) {
130
+ return this.ref.getScalarSlot(key);
131
+ }
132
+ getVec2Slot(key) {
133
+ const vec2 = this.ref.getVec2Slot(key);
134
+ if (!vec2) {
135
+ return null;
136
+ }
137
+ return {
138
+ x: vec2[0],
139
+ y: vec2[1]
140
+ };
141
+ }
142
+ getTextSlot(key) {
143
+ const result = this.ref.getTextSlot(key);
144
+ const textSlot = {};
145
+ if (result) {
146
+ if (result.typeface) {
147
+ textSlot.typeface = new _JsiSkTypeface.JsiSkTypeface(this.CanvasKit, result.typeface);
148
+ }
149
+ if (result.text) {
150
+ textSlot.text = result.text;
151
+ }
152
+ if (result.textSize) {
153
+ textSlot.textSize = result.textSize;
154
+ }
155
+ if (result.minTextSize) {
156
+ textSlot.minTextSize = result.minTextSize;
157
+ }
158
+ if (result.maxTextSize) {
159
+ textSlot.maxTextSize = result.maxTextSize;
160
+ }
161
+ if (result.strokeWidth) {
162
+ textSlot.strokeWidth = result.strokeWidth;
163
+ }
164
+ if (result.lineHeight) {
165
+ textSlot.lineHeight = result.lineHeight;
166
+ }
167
+ if (result.lineShift) {
168
+ textSlot.lineShift = result.lineShift;
169
+ }
170
+ if (result.ascent) {
171
+ textSlot.ascent = result.ascent;
172
+ }
173
+ if (result.maxLines) {
174
+ textSlot.maxLines = result.maxLines;
175
+ }
176
+ // if (result.horizAlign) {
177
+ // textSlot.horizAlign = result.horizAlign;
178
+ // }
179
+ // if (result.vertAlign) {
180
+ // textSlot.vertAlign = result.vertAlign;
181
+ // }
182
+ // if (result.strokeJoin) {
183
+ // textSlot.strokeJoin = result.strokeJoin;
184
+ // }
185
+ // if (result.direction) {
186
+ // textSlot.direction = result.direction;
187
+ // }
188
+ // if (result.linebreak) {
189
+ // textSlot.linebreak = result.linebreak;
190
+ // }
191
+ // if (result.resize) {
192
+ // textSlot.resize = result.resize;
193
+ // }
194
+ // if (result.boundingBox) {
195
+ // textSlot.boundingBox = new JsiSkRect(
196
+ // this.CanvasKit,
197
+ // result.boundingBox
198
+ // );
199
+ // }
200
+ // if (result.fillColor) {
201
+ // textSlot.fillColor = Color(result.fillColor);
202
+ // }
203
+ // if (result.strokeColor) {
204
+ // textSlot.strokeColor = Color(result.strokeColor);
205
+ // }
206
+ }
207
+ return textSlot;
208
+ }
209
+ duration() {
210
+ return this.ref.duration();
211
+ }
212
+ fps() {
213
+ return this.ref.fps();
214
+ }
215
+ render(canvas, dstRect) {
216
+ const [width, height] = this.ref.size();
217
+ this.ref.render(canvas.ref, dstRect && dstRect instanceof _JsiSkRect.JsiSkRect ? dstRect.ref : Float32Array.of(0, 0, width, height));
218
+ }
219
+ seekFrame(frame, damageRect) {
220
+ const result = this.ref.seekFrame(frame);
221
+ if (damageRect && damageRect instanceof _JsiSkRect.JsiSkRect) {
222
+ damageRect.ref[0] = result[0];
223
+ damageRect.ref[1] = result[1];
224
+ damageRect.ref[2] = result[2];
225
+ damageRect.ref[3] = result[3];
226
+ }
227
+ }
228
+ size() {
229
+ const [width, height] = this.ref.size();
230
+ return {
231
+ width,
232
+ height
233
+ };
234
+ }
235
+ version() {
236
+ return this.ref.version();
237
+ }
238
+ dispose() {
239
+ this.ref.delete();
240
+ }
241
+ }
242
+ exports.JsiSkottieAnimation = JsiSkottieAnimation;
243
+ //# sourceMappingURL=JsiSkottieAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Host","require","_JsiSkTypeface","_JsiSkColor","_JsiSkRect","JsiSkottieAnimation","HostObject","constructor","CanvasKit","ref","getOpacityProps","getTextProps","getColorProps","map","key","value","Color","getTransformProps","anchor","x","y","position","scale","rotation","skew","skewAxis","skew_axis","setColor","color","setText","text","size","setOpacity","opacity","setTransform","a","Float32Array","of","p","s","getSlotInfo","setColorSlot","setScalarSlot","scalar","setVec2Slot","vec2","setTextSlot","_text$text","_text$textSize","_text$minTextSize","_text$maxTextSize","_text$strokeWidth","_text$lineHeight","_text$lineShift","txt","typeface","JsiSkTypeface","textSize","minTextSize","maxTextSize","Number","MAX_VALUE","strokeWidth","lineHeight","lineShift","ascent","maxLines","horizAlign","TextAlign","Left","vertAlign","VerticalTextAlign","Top","strokeJoin","StrokeJoin","Miter","direction","TextDirection","LTR","linebreak","LineBreakType","HardLineBreak","resize","ResizePolicy","None","boundingBox","XYWHRect","width","height","fillColor","TRANSPARENT","strokeColor","setImageSlot","assetName","getColorSlot","getScalarSlot","getVec2Slot","getTextSlot","result","textSlot","duration","fps","render","canvas","dstRect","JsiSkRect","seekFrame","frame","damageRect","version","dispose","delete","exports"],"sources":["JsiSkottieAnimation.ts"],"sourcesContent":["import type {\n CanvasKit,\n ManagedSkottieAnimation,\n SlottableTextProperty as CKSlottableTextProperty,\n} from \"canvaskit-wasm\";\n\nimport type {\n SkSkottieAnimation,\n SlotInfo,\n SlottableTextProperty,\n} from \"../types/Skottie\";\nimport type { SkColor, SkPoint, SkRect } from \"../types\";\n\nimport { HostObject } from \"./Host\";\nimport type { JsiSkCanvas } from \"./JsiSkCanvas\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\nimport { Color } from \"./JsiSkColor\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkottieAnimation\n extends HostObject<ManagedSkottieAnimation, \"SkottieAnimation\">\n implements SkSkottieAnimation\n{\n constructor(CanvasKit: CanvasKit, ref: ManagedSkottieAnimation) {\n super(CanvasKit, ref, \"SkottieAnimation\");\n }\n getOpacityProps() {\n return this.ref.getOpacityProps();\n }\n getTextProps() {\n return this.ref.getTextProps();\n }\n getColorProps() {\n return this.ref\n .getColorProps()\n .map(({ key, value }) => ({ key, value: Color(value) }));\n }\n getTransformProps() {\n return this.ref.getTransformProps().map(({ key, value }) => ({\n key,\n value: {\n anchor: { x: value.anchor[0], y: value.anchor[1] },\n position: { x: value.position[0], y: value.position[1] },\n scale: { x: value.scale[0], y: value.scale[1] },\n rotation: value.rotation,\n skew: value.skew,\n skewAxis: value.skew_axis,\n },\n }));\n }\n setColor(key: string, color: SkColor) {\n return this.ref.setColor(key, color);\n }\n setText(key: string, text: string, size: number) {\n return this.ref.setText(key, text, size);\n }\n setOpacity(key: string, opacity: number) {\n return this.ref.setOpacity(key, opacity);\n }\n setTransform(\n key: string,\n anchor: SkPoint,\n position: SkPoint,\n scale: SkPoint,\n rotation: number,\n skew: number,\n skewAxis: number\n ) {\n const a = Float32Array.of(anchor.x, anchor.y);\n const p = Float32Array.of(position.x, position.y);\n const s = Float32Array.of(scale.x, scale.y);\n return this.ref.setTransform(key, a, p, s, rotation, skew, skewAxis);\n }\n\n getSlotInfo(): SlotInfo {\n return this.ref.getSlotInfo();\n }\n setColorSlot(key: string, color: SkColor) {\n return this.ref.setColorSlot(key, color);\n }\n setScalarSlot(key: string, scalar: number) {\n return this.ref.setScalarSlot(key, scalar);\n }\n setVec2Slot(key: string, vec2: SkPoint) {\n return this.ref.setVec2Slot(key, Float32Array.of(vec2.x, vec2.y));\n }\n setTextSlot(key: string, text: SlottableTextProperty): boolean {\n const txt: CKSlottableTextProperty = {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n typeface:\n text.typeface && text.typeface instanceof JsiSkTypeface\n ? text.typeface.ref\n : null,\n text: text.text ?? \"\",\n textSize: text.textSize ?? 0,\n minTextSize: text.minTextSize ?? 0,\n maxTextSize: text.maxTextSize ?? Number.MAX_VALUE,\n strokeWidth: text.strokeWidth ?? 0,\n lineHeight: text.lineHeight ?? 0,\n lineShift: text.lineShift ?? 0,\n ascent: text.ascent,\n maxLines: text.maxLines,\n // TODO: implement\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n horizAlign: this.CanvasKit.TextAlign.Left,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n vertAlign: this.CanvasKit.VerticalTextAlign.Top,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n strokeJoin: this.CanvasKit.StrokeJoin.Miter,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-expect-error\n direction: this.CanvasKit.TextDirection.LTR,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n linebreak: this.CanvasKit.LineBreakType.HardLineBreak,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n resize: this.CanvasKit.ResizePolicy.None,\n boundingBox: text.boundingBox\n ? this.CanvasKit.XYWHRect(\n text.boundingBox.x,\n text.boundingBox.y,\n text.boundingBox.width,\n text.boundingBox.height\n )\n : [0, 0, 0, 0],\n fillColor: text.fillColor\n ? Color(text.fillColor)\n : this.CanvasKit.TRANSPARENT,\n strokeColor: text.strokeColor\n ? Color(text.strokeColor)\n : this.CanvasKit.TRANSPARENT,\n };\n return this.ref.setTextSlot(key, txt);\n }\n setImageSlot(key: string, assetName: string) {\n return this.ref.setImageSlot(key, assetName);\n }\n getColorSlot(key: string): SkColor | null {\n const color = this.ref.getColorSlot(key);\n return color;\n }\n getScalarSlot(key: string) {\n return this.ref.getScalarSlot(key);\n }\n getVec2Slot(key: string): SkPoint | null {\n const vec2 = this.ref.getVec2Slot(key);\n if (!vec2) {\n return null;\n }\n return { x: vec2[0], y: vec2[1] };\n }\n getTextSlot(key: string): SlottableTextProperty | null {\n const result = this.ref.getTextSlot(key);\n const textSlot: SlottableTextProperty = {};\n if (result) {\n if (result.typeface) {\n textSlot.typeface = new JsiSkTypeface(this.CanvasKit, result.typeface);\n }\n if (result.text) {\n textSlot.text = result.text;\n }\n if (result.textSize) {\n textSlot.textSize = result.textSize;\n }\n if (result.minTextSize) {\n textSlot.minTextSize = result.minTextSize;\n }\n if (result.maxTextSize) {\n textSlot.maxTextSize = result.maxTextSize;\n }\n if (result.strokeWidth) {\n textSlot.strokeWidth = result.strokeWidth;\n }\n if (result.lineHeight) {\n textSlot.lineHeight = result.lineHeight;\n }\n if (result.lineShift) {\n textSlot.lineShift = result.lineShift;\n }\n if (result.ascent) {\n textSlot.ascent = result.ascent;\n }\n if (result.maxLines) {\n textSlot.maxLines = result.maxLines;\n }\n // if (result.horizAlign) {\n // textSlot.horizAlign = result.horizAlign;\n // }\n // if (result.vertAlign) {\n // textSlot.vertAlign = result.vertAlign;\n // }\n // if (result.strokeJoin) {\n // textSlot.strokeJoin = result.strokeJoin;\n // }\n // if (result.direction) {\n // textSlot.direction = result.direction;\n // }\n // if (result.linebreak) {\n // textSlot.linebreak = result.linebreak;\n // }\n // if (result.resize) {\n // textSlot.resize = result.resize;\n // }\n // if (result.boundingBox) {\n // textSlot.boundingBox = new JsiSkRect(\n // this.CanvasKit,\n // result.boundingBox\n // );\n // }\n // if (result.fillColor) {\n // textSlot.fillColor = Color(result.fillColor);\n // }\n // if (result.strokeColor) {\n // textSlot.strokeColor = Color(result.strokeColor);\n // }\n }\n return textSlot;\n }\n\n duration() {\n return this.ref.duration();\n }\n fps() {\n return this.ref.fps();\n }\n render(canvas: JsiSkCanvas, dstRect?: SkRect) {\n const [width, height] = this.ref.size();\n this.ref.render(\n canvas.ref,\n dstRect && dstRect instanceof JsiSkRect\n ? dstRect.ref\n : Float32Array.of(0, 0, width, height)\n );\n }\n seekFrame(frame: number, damageRect?: JsiSkRect) {\n const result = this.ref.seekFrame(frame);\n if (damageRect && damageRect instanceof JsiSkRect) {\n damageRect.ref[0] = result[0];\n damageRect.ref[1] = result[1];\n damageRect.ref[2] = result[2];\n damageRect.ref[3] = result[3];\n }\n }\n size() {\n const [width, height] = this.ref.size();\n return { width, height };\n }\n version() {\n return this.ref.version();\n }\n dispose() {\n this.ref.delete();\n }\n}\n"],"mappings":";;;;;;AAaA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEO,MAAMI,mBAAmB,SACtBC,gBAAU,CAEpB;EACEC,WAAWA,CAACC,SAAoB,EAAEC,GAA4B,EAAE;IAC9D,KAAK,CAACD,SAAS,EAAEC,GAAG,EAAE,kBAAkB,CAAC;EAC3C;EACAC,eAAeA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACD,GAAG,CAACC,eAAe,CAAC,CAAC;EACnC;EACAC,YAAYA,CAAA,EAAG;IACb,OAAO,IAAI,CAACF,GAAG,CAACE,YAAY,CAAC,CAAC;EAChC;EACAC,aAAaA,CAAA,EAAG;IACd,OAAO,IAAI,CAACH,GAAG,CACZG,aAAa,CAAC,CAAC,CACfC,GAAG,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAM,CAAC,MAAM;MAAED,GAAG;MAAEC,KAAK,EAAE,IAAAC,iBAAK,EAACD,KAAK;IAAE,CAAC,CAAC,CAAC;EAC5D;EACAE,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACR,GAAG,CAACQ,iBAAiB,CAAC,CAAC,CAACJ,GAAG,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAM,CAAC,MAAM;MAC3DD,GAAG;MACHC,KAAK,EAAE;QACLG,MAAM,EAAE;UAAEC,CAAC,EAAEJ,KAAK,CAACG,MAAM,CAAC,CAAC,CAAC;UAAEE,CAAC,EAAEL,KAAK,C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nE,IAAIA,CAAA,EAAG;IACL,MAAM,CAACwD,KAAK,EAAEC,MAAM,CAAC,GAAG,IAAI,CAAC/E,GAAG,CAACsB,IAAI,CAAC,CAAC;IACvC,OAAO;MAAEwD,KAAK;MAAEC;IAAO,CAAC;EAC1B;EACAqB,OAAOA,CAAA,EAAG;IACR,OAAO,IAAI,CAACpG,GAAG,CAACoG,OAAO,CAAC,CAAC;EAC3B;EACAC,OAAOA,CAAA,EAAG;IACR,IAAI,CAACrG,GAAG,CAACsG,MAAM,CAAC,CAAC;EACnB;AACF;AAACC,OAAA,CAAA3G,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ import type { CanvasKit } from "canvaskit-wasm";
2
+ import type { SkottieFactory } from "../types";
3
+ import { Host } from "./Host";
4
+ import { JsiSkottieAnimation } from "./JsiSkottieAnimation";
5
+ import type { JsiSkData } from "./JsiSkData";
6
+ export declare class JsiSkottieFactory extends Host implements SkottieFactory {
7
+ constructor(CanvasKit: CanvasKit);
8
+ Make(json: string, assets?: Record<string, JsiSkData>): JsiSkottieAnimation;
9
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.JsiSkottieFactory = void 0;
7
+ var _Host = require("./Host");
8
+ var _JsiSkottieAnimation = require("./JsiSkottieAnimation");
9
+ class JsiSkottieFactory extends _Host.Host {
10
+ constructor(CanvasKit) {
11
+ super(CanvasKit);
12
+ }
13
+ Make(json, assets) {
14
+ const rawAssets = {};
15
+ for (const [key, value] of Object.entries(assets !== null && assets !== void 0 ? assets : {})) {
16
+ rawAssets[key] = value.ref;
17
+ }
18
+ const animation = this.CanvasKit.MakeManagedAnimation(json, rawAssets);
19
+ if (!animation) {
20
+ throw new Error("Failed to create SkottieAnimation");
21
+ }
22
+ return new _JsiSkottieAnimation.JsiSkottieAnimation(this.CanvasKit, animation);
23
+ }
24
+ }
25
+ exports.JsiSkottieFactory = JsiSkottieFactory;
26
+ //# sourceMappingURL=JsiSkottieFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_Host","require","_JsiSkottieAnimation","JsiSkottieFactory","Host","constructor","CanvasKit","Make","json","assets","rawAssets","key","value","Object","entries","ref","animation","MakeManagedAnimation","Error","JsiSkottieAnimation","exports"],"sources":["JsiSkottieFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkottieFactory } from \"../types\";\n\nimport { Host } from \"./Host\";\nimport { JsiSkottieAnimation } from \"./JsiSkottieAnimation\";\nimport type { JsiSkData } from \"./JsiSkData\";\n\nexport class JsiSkottieFactory extends Host implements SkottieFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make(json: string, assets?: Record<string, JsiSkData>) {\n const rawAssets: { [key: string]: ArrayBuffer } = {};\n for (const [key, value] of Object.entries(assets ?? {})) {\n rawAssets[key] = value.ref;\n }\n const animation = this.CanvasKit.MakeManagedAnimation(json, rawAssets);\n if (!animation) {\n throw new Error(\"Failed to create SkottieAnimation\");\n }\n return new JsiSkottieAnimation(this.CanvasKit, animation);\n }\n}\n"],"mappings":";;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AAGO,MAAME,iBAAiB,SAASC,UAAI,CAA2B;EACpEC,WAAWA,CAACC,SAAoB,EAAE;IAChC,KAAK,CAACA,SAAS,CAAC;EAClB;EAEAC,IAAIA,CAACC,IAAY,EAAEC,MAAkC,EAAE;IACrD,MAAMC,SAAyC,GAAG,CAAC,CAAC;IACpD,KAAK,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACL,MAAM,aAANA,MAAM,cAANA,MAAM,GAAI,CAAC,CAAC,CAAC,EAAE;MACvDC,SAAS,CAACC,GAAG,CAAC,GAAGC,KAAK,CAACG,GAAG;IAC5B;IACA,MAAMC,SAAS,GAAG,IAAI,CAACV,SAAS,CAACW,oBAAoB,CAACT,IAAI,EAAEE,SAAS,CAAC;IACtE,IAAI,CAACM,SAAS,EAAE;MACd,MAAM,IAAIE,KAAK,CAAC,mCAAmC,CAAC;IACtD;IACA,OAAO,IAAIC,wCAAmB,CAAC,IAAI,CAACb,SAAS,EAAEU,SAAS,CAAC;EAC3D;AACF;AAACI,OAAA,CAAAjB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { FractalNoiseProps, CircleProps, DrawingNodeProps, ImageProps, PaintProps, PathProps, LineProps, OvalProps, DiffRectProps, PointsProps, RectProps, RoundedRectProps, TextProps, VerticesProps, BlurMaskFilterProps, BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps, MatrixColorFilterProps, ShaderProps, ImageShaderProps, LinearGradientProps, GroupProps, PatchProps, BlendColorFilterProps, DashPathEffectProps, DiscretePathEffectProps, CornerPathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, BoxProps, BoxShadowProps, ParagraphProps, AtlasProps, ChildrenProps, MorphologyImageFilterProps, BlendProps } from "../dom/types";
1
+ import type { FractalNoiseProps, CircleProps, DrawingNodeProps, ImageProps, PaintProps, PathProps, LineProps, OvalProps, DiffRectProps, PointsProps, RectProps, RoundedRectProps, TextProps, VerticesProps, BlurMaskFilterProps, BlendImageFilterProps, BlurImageFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps, MatrixColorFilterProps, ShaderProps, ImageShaderProps, LinearGradientProps, GroupProps, PatchProps, BlendColorFilterProps, DashPathEffectProps, DiscretePathEffectProps, CornerPathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps, TextPathProps, TextBlobProps, GlyphsProps, TwoPointConicalGradientProps, TurbulenceProps, SweepGradientProps, RadialGradientProps, ColorProps, PictureProps, ImageSVGProps, LerpColorFilterProps, BoxProps, BoxShadowProps, ParagraphProps, AtlasProps, ChildrenProps, MorphologyImageFilterProps, BlendProps, SkottieProps } from "../dom/types";
2
2
  import type { SkiaProps } from "../renderer";
3
3
  declare module "react" {
4
4
  namespace JSX {
@@ -23,6 +23,7 @@ declare module "react" {
23
23
  skTextBlob: SkiaProps<TextBlobProps>;
24
24
  skGlyphs: SkiaProps<GlyphsProps>;
25
25
  skDiffRect: SkiaProps<DiffRectProps>;
26
+ skSkottie: SkiaProps<SkottieProps>;
26
27
  skPicture: SkiaProps<PictureProps>;
27
28
  skImageSVG: SkiaProps<ImageSVGProps>;
28
29
  skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Elements.tsx"],"sourcesContent":["import type {\n FractalNoiseProps,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n AtlasProps,\n ChildrenProps,\n MorphologyImageFilterProps,\n BlendProps,\n} from \"../dom/types\";\nimport type { SkiaProps } from \"../renderer\";\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skAtlas: SkiaProps<AtlasProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Elements.tsx"],"sourcesContent":["import type {\n FractalNoiseProps,\n CircleProps,\n DrawingNodeProps,\n ImageProps,\n PaintProps,\n PathProps,\n LineProps,\n OvalProps,\n DiffRectProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextProps,\n VerticesProps,\n BlurMaskFilterProps,\n BlendImageFilterProps,\n BlurImageFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n MatrixColorFilterProps,\n ShaderProps,\n ImageShaderProps,\n LinearGradientProps,\n GroupProps,\n PatchProps,\n BlendColorFilterProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n CornerPathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n TwoPointConicalGradientProps,\n TurbulenceProps,\n SweepGradientProps,\n RadialGradientProps,\n ColorProps,\n PictureProps,\n ImageSVGProps,\n LerpColorFilterProps,\n BoxProps,\n BoxShadowProps,\n ParagraphProps,\n AtlasProps,\n ChildrenProps,\n MorphologyImageFilterProps,\n BlendProps,\n SkottieProps,\n} from \"../dom/types\";\nimport type { SkiaProps } from \"../renderer\";\n\ndeclare module \"react\" {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n interface IntrinsicElements {\n skGroup: SkiaProps<GroupProps>;\n skLayer: SkiaProps<ChildrenProps>;\n skPaint: SkiaProps<PaintProps>;\n\n // Drawings\n skFill: SkiaProps<DrawingNodeProps>;\n skImage: SkiaProps<ImageProps>;\n skCircle: SkiaProps<CircleProps>;\n skPath: SkiaProps<PathProps>;\n skLine: SkiaProps<LineProps>;\n skOval: SkiaProps<OvalProps>;\n skPatch: SkiaProps<PatchProps>;\n skPoints: SkiaProps<PointsProps>;\n skRect: SkiaProps<RectProps>;\n skRRect: SkiaProps<RoundedRectProps>;\n skAtlas: SkiaProps<AtlasProps>;\n skVertices: SkiaProps<VerticesProps>;\n skText: SkiaProps<TextProps>;\n skTextPath: SkiaProps<TextPathProps>;\n skTextBlob: SkiaProps<TextBlobProps>;\n skGlyphs: SkiaProps<GlyphsProps>;\n skDiffRect: SkiaProps<DiffRectProps>;\n skSkottie: SkiaProps<SkottieProps>;\n skPicture: SkiaProps<PictureProps>;\n skImageSVG: SkiaProps<ImageSVGProps>;\n\n // BlurMaskFilters\n skBlurMaskFilter: SkiaProps<BlurMaskFilterProps>;\n\n // ImageFilters\n skBlendImageFilter: SkiaProps<BlendImageFilterProps>;\n skBlurImageFilter: SkiaProps<BlurImageFilterProps>;\n skOffsetImageFilter: SkiaProps<OffsetImageFilterProps>;\n skDropShadowImageFilter: SkiaProps<DropShadowImageFilterProps>;\n skDisplacementMapImageFilter: SkiaProps<DisplacementMapImageFilterProps>;\n skRuntimeShaderImageFilter: SkiaProps<RuntimeShaderImageFilterProps>;\n skMorphologyImageFilter: SkiaProps<MorphologyImageFilterProps>;\n\n // ColorFilters\n skMatrixColorFilter: SkiaProps<MatrixColorFilterProps>;\n skBlendColorFilter: SkiaProps<BlendColorFilterProps>;\n skLinearToSRGBGammaColorFilter: SkiaProps<ChildrenProps>;\n skSRGBToLinearGammaColorFilter: SkiaProps<ChildrenProps>;\n skLumaColorFilter: SkiaProps<ChildrenProps>;\n skLerpColorFilter: SkiaProps<LerpColorFilterProps>;\n\n // Shaders\n skShader: SkiaProps<ShaderProps>;\n skImageShader: SkiaProps<ImageShaderProps>;\n skColorShader: SkiaProps<ColorProps>;\n skTurbulence: SkiaProps<TurbulenceProps>;\n skFractalNoise: SkiaProps<FractalNoiseProps>;\n skLinearGradient: SkiaProps<LinearGradientProps>;\n skRadialGradient: SkiaProps<RadialGradientProps>;\n skSweepGradient: SkiaProps<SweepGradientProps>;\n skTwoPointConicalGradient: SkiaProps<TwoPointConicalGradientProps>;\n\n // Path Effects\n skDiscretePathEffect: SkiaProps<DiscretePathEffectProps>;\n skDashPathEffect: SkiaProps<DashPathEffectProps>;\n skPath1DPathEffect: SkiaProps<Path1DPathEffectProps>;\n skPath2DPathEffect: SkiaProps<Path2DPathEffectProps>;\n skCornerPathEffect: SkiaProps<CornerPathEffectProps>;\n skSumPathEffect: ChildrenProps;\n skLine2DPathEffect: SkiaProps<Line2DPathEffectProps>;\n\n // Mixed declarations/drawings\n skBlend: SkiaProps<BlendProps>;\n skBackdropFilter: SkiaProps<ChildrenProps>;\n skBox: SkiaProps<BoxProps>;\n skBoxShadow: SkiaProps<BoxShadowProps>;\n\n // Paragraph\n skParagraph: SkiaProps<ParagraphProps>;\n }\n }\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, DrawingNodeProps } from "../../dom/types";
1
+ import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, DrawingNodeProps, SkottieProps } from "../../dom/types";
2
2
  export declare enum CommandType {
3
3
  Group = 0,
4
4
  SavePaint = 1,
@@ -37,7 +37,8 @@ export declare enum CommandType {
37
37
  DrawPicture = 34,
38
38
  DrawImageSVG = 35,
39
39
  DrawParagraph = 36,
40
- DrawAtlas = 37
40
+ DrawAtlas = 37,
41
+ DrawSkottie = 38
41
42
  }
42
43
  export type Command<T extends CommandType = CommandType> = {
43
44
  type: T;
@@ -72,6 +73,7 @@ interface Props {
72
73
  [CommandType.DrawImageSVG]: ImageSVGProps;
73
74
  [CommandType.DrawParagraph]: ParagraphProps;
74
75
  [CommandType.DrawAtlas]: AtlasProps;
76
+ [CommandType.DrawSkottie]: SkottieProps;
75
77
  }
76
78
  interface DrawCommand<T extends CommandType> extends Command<T> {
77
79
  props: T extends keyof Props ? Props[T] : never;
@@ -87,6 +87,7 @@ let CommandType = exports.CommandType = /*#__PURE__*/function (CommandType) {
87
87
  CommandType[CommandType["DrawImageSVG"] = 35] = "DrawImageSVG";
88
88
  CommandType[CommandType["DrawParagraph"] = 36] = "DrawParagraph";
89
89
  CommandType[CommandType["DrawAtlas"] = 37] = "DrawAtlas";
90
+ CommandType[CommandType["DrawSkottie"] = 38] = "DrawSkottie";
90
91
  return CommandType;
91
92
  }({});
92
93
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"names":["CommandType","exports","materializeCommand","command","newProps","props","animatedProps","key","value","isCommand","type","isGroup","Group","isDrawCommand"],"sources":["Core.ts"],"sourcesContent":["import type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n DrawingNodeProps,\n} from \"../../dom/types\";\n\n// export enum CommandType {\n// // Context\n// Group = \"Group\",\n// SavePaint = \"SavePaint\",\n// RestorePaint = \"RestorePaint\",\n// SaveCTM = \"SaveCTM\",\n// RestoreCTM = \"RestoreCTM\",\n// PushColorFilter = \"PushColorFilter\",\n// PushBlurMaskFilter = \"PushBlurMaskFilter\",\n// PushImageFilter = \"PushImageFilter\",\n// PushPathEffect = \"PushPathEffect\",\n// PushShader = \"PushShader\",\n// ComposeColorFilter = \"ComposeColorFilter\",\n// ComposeImageFilter = \"ComposeImageFilter\",\n// ComposePathEffect = \"ComposePathEffect\",\n// MaterializePaint = \"MaterializePaint\",\n// SaveBackdropFilter = \"SaveBackdropFilter\",\n// SaveLayer = \"SaveLayer\",\n// RestorePaintDeclaration = \"RestorePaintDeclaration\",\n// // Drawing\n// DrawBox = \"DrawBox\",\n// DrawImage = \"DrawImage\",\n// DrawCircle = \"DrawCircle\",\n// DrawPaint = \"DrawPaint\",\n// DrawPoints = \"DrawPoints\",\n// DrawPath = \"DrawPath\",\n// DrawRect = \"DrawRect\",\n// DrawRRect = \"DrawRRect\",\n// DrawOval = \"DrawOval\",\n// DrawLine = \"DrawLine\",\n// DrawPatch = \"DrawPatch\",\n// DrawVertices = \"DrawVertices\",\n// DrawDiffRect = \"DrawDiffRect\",\n// DrawText = \"DrawText\",\n// DrawTextPath = \"DrawTextPath\",\n// DrawTextBlob = \"DrawTextBlob\",\n// DrawGlyphs = \"DrawGlyphs\",\n// DrawPicture = \"DrawPicture\",\n// DrawImageSVG = \"DrawImageSVG\",\n// DrawParagraph = \"DrawParagraph\",\n// DrawAtlas = \"DrawAtlas\",\n// }\nexport enum CommandType {\n // Context\n Group,\n SavePaint,\n RestorePaint,\n SaveCTM,\n RestoreCTM,\n PushColorFilter,\n PushBlurMaskFilter,\n PushImageFilter,\n PushPathEffect,\n PushShader,\n ComposeColorFilter,\n ComposeImageFilter,\n ComposePathEffect,\n MaterializePaint,\n SaveBackdropFilter,\n SaveLayer,\n RestorePaintDeclaration,\n // Drawing\n DrawBox,\n DrawImage,\n DrawCircle,\n DrawPaint,\n DrawPoints,\n DrawPath,\n DrawRect,\n DrawRRect,\n DrawOval,\n DrawLine,\n DrawPatch,\n DrawVertices,\n DrawDiffRect,\n DrawText,\n DrawTextPath,\n DrawTextBlob,\n DrawGlyphs,\n DrawPicture,\n DrawImageSVG,\n DrawParagraph,\n DrawAtlas,\n}\n\nexport type Command<T extends CommandType = CommandType> = {\n type: T;\n [key: string]: unknown;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const materializeCommand = (command: any) => {\n \"worklet\";\n const newProps = { ...command.props };\n if (command.animatedProps) {\n for (const key in command.animatedProps) {\n newProps[key] = command.animatedProps[key].value;\n }\n }\n return { ...command, props: newProps };\n};\n\nexport const isCommand = <T extends CommandType>(\n command: Command,\n type: T\n): command is Command<T> => {\n \"worklet\";\n return command.type === type;\n};\n\ninterface GroupCommand extends Command<CommandType.Group> {\n children: Command[];\n}\n\nexport const isGroup = (command: Command): command is GroupCommand => {\n \"worklet\";\n return command.type === CommandType.Group;\n};\n\ninterface Props {\n [CommandType.DrawImage]: ImageProps;\n [CommandType.DrawCircle]: CircleProps;\n [CommandType.SaveCTM]: CTMProps;\n [CommandType.SavePaint]: DrawingNodeProps;\n [CommandType.PushBlurMaskFilter]: BlurMaskFilterProps;\n [CommandType.DrawPoints]: PointsProps;\n [CommandType.DrawPath]: PathProps;\n [CommandType.DrawRect]: RectProps;\n [CommandType.DrawRRect]: RoundedRectProps;\n [CommandType.DrawOval]: OvalProps;\n [CommandType.DrawLine]: LineProps;\n [CommandType.DrawPatch]: PatchProps;\n [CommandType.DrawVertices]: VerticesProps;\n [CommandType.DrawDiffRect]: DiffRectProps;\n [CommandType.DrawText]: TextProps;\n [CommandType.DrawTextPath]: TextPathProps;\n [CommandType.DrawTextBlob]: TextBlobProps;\n [CommandType.DrawGlyphs]: GlyphsProps;\n [CommandType.DrawPicture]: PictureProps;\n [CommandType.DrawImageSVG]: ImageSVGProps;\n [CommandType.DrawParagraph]: ParagraphProps;\n [CommandType.DrawAtlas]: AtlasProps;\n}\n\ninterface DrawCommand<T extends CommandType> extends Command<T> {\n props: T extends keyof Props ? Props[T] : never;\n}\n\nexport const isDrawCommand = <T extends keyof Props>(\n command: Command,\n type: T\n): command is DrawCommand<T> => {\n \"worklet\";\n return command.type === type;\n};\n"],"mappings":";;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,IACYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EACrB;EADUA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,W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CAAC;AAACH,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEK,MAAMO,SAAS,GAAGA,CACvBN,OAAgB,EAChBO,IAAO,KACmB;EAC1B,SAAS;;EACT,OAAOP,OAAO,CAACO,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAACT,OAAA,CAAAQ,SAAA,GAAAA,SAAA;AAMK,MAAME,OAAO,GAAIR,OAAgB,IAA8B;EACpE,SAAS;;EACT,OAAOA,OAAO,CAACO,IAAI,KAAKV,WAAW,CAACY,KAAK;AAC3C,CAAC;AAACX,OAAA,CAAAU,OAAA,GAAAA,OAAA;AA+BK,MAAME,aAAa,GAAGA,CAC3BV,OAAgB,EAChBO,IAAO,KACuB;EAC9B,SAAS;;EACT,OAAOP,OAAO,CAACO,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAACT,OAAA,CAAAY,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["CommandType","exports","materializeCommand","command","newProps","props","animatedProps","key","value","isCommand","type","isGroup","Group","isDrawCommand"],"sources":["Core.ts"],"sourcesContent":["import type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PointsProps,\n PathProps,\n RectProps,\n RoundedRectProps,\n OvalProps,\n LineProps,\n PatchProps,\n VerticesProps,\n DiffRectProps,\n TextProps,\n TextPathProps,\n TextBlobProps,\n GlyphsProps,\n PictureProps,\n ImageSVGProps,\n ParagraphProps,\n AtlasProps,\n DrawingNodeProps,\n SkottieProps,\n} from \"../../dom/types\";\n\n// export enum CommandType {\n// // Context\n// Group = \"Group\",\n// SavePaint = \"SavePaint\",\n// RestorePaint = \"RestorePaint\",\n// SaveCTM = \"SaveCTM\",\n// RestoreCTM = \"RestoreCTM\",\n// PushColorFilter = \"PushColorFilter\",\n// PushBlurMaskFilter = \"PushBlurMaskFilter\",\n// PushImageFilter = \"PushImageFilter\",\n// PushPathEffect = \"PushPathEffect\",\n// PushShader = \"PushShader\",\n// ComposeColorFilter = \"ComposeColorFilter\",\n// ComposeImageFilter = \"ComposeImageFilter\",\n// ComposePathEffect = \"ComposePathEffect\",\n// MaterializePaint = \"MaterializePaint\",\n// SaveBackdropFilter = \"SaveBackdropFilter\",\n// SaveLayer = \"SaveLayer\",\n// RestorePaintDeclaration = \"RestorePaintDeclaration\",\n// // Drawing\n// DrawBox = \"DrawBox\",\n// DrawImage = \"DrawImage\",\n// DrawCircle = \"DrawCircle\",\n// DrawPaint = \"DrawPaint\",\n// DrawPoints = \"DrawPoints\",\n// DrawPath = \"DrawPath\",\n// DrawRect = \"DrawRect\",\n// DrawRRect = \"DrawRRect\",\n// DrawOval = \"DrawOval\",\n// DrawLine = \"DrawLine\",\n// DrawPatch = \"DrawPatch\",\n// DrawVertices = \"DrawVertices\",\n// DrawDiffRect = \"DrawDiffRect\",\n// DrawText = \"DrawText\",\n// DrawTextPath = \"DrawTextPath\",\n// DrawTextBlob = \"DrawTextBlob\",\n// DrawGlyphs = \"DrawGlyphs\",\n// DrawPicture = \"DrawPicture\",\n// DrawImageSVG = \"DrawImageSVG\",\n// DrawParagraph = \"DrawParagraph\",\n// DrawAtlas = \"DrawAtlas\",\n// }\nexport enum CommandType {\n // Context\n Group,\n SavePaint,\n RestorePaint,\n SaveCTM,\n RestoreCTM,\n PushColorFilter,\n PushBlurMaskFilter,\n PushImageFilter,\n PushPathEffect,\n PushShader,\n ComposeColorFilter,\n ComposeImageFilter,\n ComposePathEffect,\n MaterializePaint,\n SaveBackdropFilter,\n SaveLayer,\n RestorePaintDeclaration,\n // Drawing\n DrawBox,\n DrawImage,\n DrawCircle,\n DrawPaint,\n DrawPoints,\n DrawPath,\n DrawRect,\n DrawRRect,\n DrawOval,\n DrawLine,\n DrawPatch,\n DrawVertices,\n DrawDiffRect,\n DrawText,\n DrawTextPath,\n DrawTextBlob,\n DrawGlyphs,\n DrawPicture,\n DrawImageSVG,\n DrawParagraph,\n DrawAtlas,\n DrawSkottie,\n}\n\nexport type Command<T extends CommandType = CommandType> = {\n type: T;\n [key: string]: unknown;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const materializeCommand = (command: any) => {\n \"worklet\";\n const newProps = { ...command.props };\n if (command.animatedProps) {\n for (const key in command.animatedProps) {\n newProps[key] = command.animatedProps[key].value;\n }\n }\n return { ...command, props: newProps };\n};\n\nexport const isCommand = <T extends CommandType>(\n command: Command,\n type: T\n): command is Command<T> => {\n \"worklet\";\n return command.type === type;\n};\n\ninterface GroupCommand extends Command<CommandType.Group> {\n children: Command[];\n}\n\nexport const isGroup = (command: Command): command is GroupCommand => {\n \"worklet\";\n return command.type === CommandType.Group;\n};\n\ninterface Props {\n [CommandType.DrawImage]: ImageProps;\n [CommandType.DrawCircle]: CircleProps;\n [CommandType.SaveCTM]: CTMProps;\n [CommandType.SavePaint]: DrawingNodeProps;\n [CommandType.PushBlurMaskFilter]: BlurMaskFilterProps;\n [CommandType.DrawPoints]: PointsProps;\n [CommandType.DrawPath]: PathProps;\n [CommandType.DrawRect]: RectProps;\n [CommandType.DrawRRect]: RoundedRectProps;\n [CommandType.DrawOval]: OvalProps;\n [CommandType.DrawLine]: LineProps;\n [CommandType.DrawPatch]: PatchProps;\n [CommandType.DrawVertices]: VerticesProps;\n [CommandType.DrawDiffRect]: DiffRectProps;\n [CommandType.DrawText]: TextProps;\n [CommandType.DrawTextPath]: TextPathProps;\n [CommandType.DrawTextBlob]: TextBlobProps;\n [CommandType.DrawGlyphs]: GlyphsProps;\n [CommandType.DrawPicture]: PictureProps;\n [CommandType.DrawImageSVG]: ImageSVGProps;\n [CommandType.DrawParagraph]: ParagraphProps;\n [CommandType.DrawAtlas]: AtlasProps;\n [CommandType.DrawSkottie]: SkottieProps;\n}\n\ninterface DrawCommand<T extends CommandType> extends Command<T> {\n props: T extends keyof Props ? Props[T] : never;\n}\n\nexport const isDrawCommand = <T extends keyof Props>(\n command: Command,\n type: T\n): command is DrawCommand<T> => {\n \"worklet\";\n return command.type === type;\n};\n"],"mappings":";;;;;;AA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XA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAiDvB;AACO,MAAME,kBAAkB,GAAIC,OAAY,IAAK;EAClD,SAAS;;EACT,MAAMC,QAAQ,GAAG;IAAE,GAAGD,OAAO,CAACE;EAAM,CAAC;EACrC,IAAIF,OAAO,CAACG,aAAa,EAAE;IACzB,KAAK,MAAMC,GAAG,IAAIJ,OAAO,CAACG,aAAa,EAAE;MACvCF,QAAQ,CAACG,GAAG,CAAC,GAAGJ,OAAO,CAACG,aAAa,CAACC,GAAG,CAAC,CAACC,KAAK;IAClD;EACF;EACA,OAAO;IAAE,GAAGL,OAAO;IAAEE,KAAK,EAAED;EAAS,CAAC;AACxC,CAAC;AAACH,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAEK,MAAMO,SAAS,GAAGA,CACvBN,OAAgB,EAChBO,IAAO,KACmB;EAC1B,SAAS;;EACT,OAAOP,OAAO,CAACO,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAACT,OAAA,CAAAQ,SAAA,GAAAA,SAAA;AAMK,MAAME,OAAO,GAAIR,OAAgB,IAA8B;EACpE,SAAS;;EACT,OAAOA,OAAO,CAACO,IAAI,KAAKV,WAAW,CAACY,KAAK;AAC3C,CAAC;AAACX,OAAA,CAAAU,OAAA,GAAAA,OAAA;AAgCK,MAAME,aAAa,GAAGA,CAC3BV,OAAgB,EAChBO,IAAO,KACuB;EAC9B,SAAS;;EACT,OAAOP,OAAO,CAACO,IAAI,KAAKA,IAAI;AAC9B,CAAC;AAACT,OAAA,CAAAY,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -118,6 +118,8 @@ function play(ctx, _command) {
118
118
  (0, _Drawing.drawParagraph)(ctx, command.props);
119
119
  } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawAtlas)) {
120
120
  (0, _Drawing.drawAtlas)(ctx, command.props);
121
+ } else if ((0, _Core.isDrawCommand)(command, _Core.CommandType.DrawSkottie)) {
122
+ (0, _Drawing.drawSkottie)(ctx, command.props);
121
123
  } else {
122
124
  console.warn(`Unknown command: ${command.type}`);
123
125
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_Drawing","require","_Box","_ColorFilters","_CTM","_ImageFilters","_Paint","_PathEffects","_Shaders","_Core","play","ctx","_command","isGroup","children","forEach","child","command","materializeCommand","isCommand","CommandType","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","isDrawCommand","SavePaint","props","paints","push","savePaint","setPaintProperties","Skia","standalone","RestorePaint","restorePaint","ComposeColorFilter","composeColorFilters","RestorePaintDeclaration","Error","MaterializePaint","isPushColorFilter","pushColorFilter","isPushShader","pushShader","isPushImageFilter","pushImageFilter","isPushPathEffect","pushPathEffect","ComposePathEffect","composePathEffects","ComposeImageFilter","composeImageFilters","PushBlurMaskFilter","setBlurMaskFilter","SaveCTM","saveCTM","RestoreCTM","restore","copy","setAlphaf","getAlphaf","getOpacity","p","isBoxCommand","drawBox","DrawPaint","drawPaint","DrawImage","drawImage","DrawCircle","drawCircle","DrawPoints","drawPoints","DrawPath","drawPath","DrawRect","drawRect","DrawRRect","drawRRect","DrawOval","drawOval","DrawLine","drawLine","DrawPatch","drawPatch","DrawVertices","drawVertices","DrawDiffRect","drawDiffRect","DrawText","drawText","DrawTextPath","drawTextPath","DrawTextBlob","drawTextBlob","DrawGlyphs","drawGlyphs","DrawPicture","drawPicture","DrawImageSVG","drawImageSVG","DrawParagraph","drawParagraph","DrawAtlas","drawAtlas","console","warn","type","replay","commands","exports"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n isGroup,\n materializeCommand,\n} from \"./Core\";\nimport type { Command } from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nfunction play(ctx: DrawingContext, _command: Command) {\n \"worklet\";\n if (isGroup(_command)) {\n _command.children.forEach((child) => play(ctx, child));\n return;\n }\n const command = materializeCommand(_command);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(\n ctx.Skia,\n ctx,\n command.props,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (command as any).standalone\n );\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n // TODO: is a copy needed here?\n // apply opacity to the current paint.\n const paint = ctx.paint.copy();\n paint.setAlphaf(paint.getAlphaf() * ctx.getOpacity());\n const paints = [paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n}\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAqBA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAUA,SAASS,IAAIA,CAACC,GAAmB,EAAEC,QAAiB,EAAE;EACpD,SAAS;;EACT,IAAI,IAAAC,aAAO,EAACD,QAAQ,CAAC,EAAE;IACrBA,QAAQ,CAACE,QAAQ,CAACC,OAAO,CAAEC,KAAK,IAAKN,IAAI,CAACC,GAAG,EAAEK,KAAK,CAAC,CAAC;IACtD;EACF;EACA,MAAMC,OAAO,GAAG,IAAAC,wBAAkB,EAAC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AAAF,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACuF,aAAa,CAAC,EAAE;QAC5D,IAAAC,sBAAa,EAACjG,GAAG,EAAEM,OAAO,CAACe,KAAK,CAAC;MACnC,CAAC,MAAM,IAAI,IAAAF,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACyF,SAAS,CAAC,EAAE;QACxD,IAAAC,kBAAS,EAACnG,GAAG,EAAEM,OAAO,CAACe,KAAK,CAAC;MAC/B,CAAC,MAAM;QACL+E,OAAO,CAACC,IAAI,CAAC,oBAAoB/F,OAAO,CAACgG,IAAI,EAAE,CAAC;MAClD;MACAtG,GAAG,CAACsB,MAAM,CAACN,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC;EACJ;AACF;AAEO,MAAMuF,MAAM,GAAGA,CAACvG,GAAmB,EAAEwG,QAAmB,KAAK;EAClE,SAAS;;EACTA,QAAQ,CAACpG,OAAO,CAAEE,OAAO,IAAK;IAC5BP,IAAI,CAACC,GAAG,EAAEM,OAAO,CAAC;EACpB,CAAC,CAAC;AACJ,CAAC;AAACmG,OAAA,CAAAF,MAAA,GAAAA,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Drawing","require","_Box","_ColorFilters","_CTM","_ImageFilters","_Paint","_PathEffects","_Shaders","_Core","play","ctx","_command","isGroup","children","forEach","child","command","materializeCommand","isCommand","CommandType","SaveBackdropFilter","saveBackdropFilter","SaveLayer","materializePaint","paint","paintDeclarations","pop","canvas","saveLayer","isDrawCommand","SavePaint","props","paints","push","savePaint","setPaintProperties","Skia","standalone","RestorePaint","restorePaint","ComposeColorFilter","composeColorFilters","RestorePaintDeclaration","Error","MaterializePaint","isPushColorFilter","pushColorFilter","isPushShader","pushShader","isPushImageFilter","pushImageFilter","isPushPathEffect","pushPathEffect","ComposePathEffect","composePathEffects","ComposeImageFilter","composeImageFilters","PushBlurMaskFilter","setBlurMaskFilter","SaveCTM","saveCTM","RestoreCTM","restore","copy","setAlphaf","getAlphaf","getOpacity","p","isBoxCommand","drawBox","DrawPaint","drawPaint","DrawImage","drawImage","DrawCircle","drawCircle","DrawPoints","drawPoints","DrawPath","drawPath","DrawRect","drawRect","DrawRRect","drawRRect","DrawOval","drawOval","DrawLine","drawLine","DrawPatch","drawPatch","DrawVertices","drawVertices","DrawDiffRect","drawDiffRect","DrawText","drawText","DrawTextPath","drawTextPath","DrawTextBlob","drawTextBlob","DrawGlyphs","drawGlyphs","DrawPicture","drawPicture","DrawImageSVG","drawImageSVG","DrawParagraph","drawParagraph","DrawAtlas","drawAtlas","DrawSkottie","drawSkottie","console","warn","type","replay","commands","exports"],"sources":["Player.ts"],"sourcesContent":["import {\n drawCircle,\n drawImage,\n drawOval,\n drawPath,\n drawPoints,\n drawRect,\n drawRRect,\n drawLine,\n drawAtlas,\n drawParagraph,\n drawImageSVG,\n drawPicture,\n drawGlyphs,\n drawTextBlob,\n drawTextPath,\n drawText,\n drawDiffRect,\n drawVertices,\n drawPatch,\n drawSkottie,\n} from \"./commands/Drawing\";\nimport { drawBox, isBoxCommand } from \"./commands/Box\";\nimport {\n composeColorFilters,\n isPushColorFilter,\n pushColorFilter,\n} from \"./commands/ColorFilters\";\nimport { saveCTM } from \"./commands/CTM\";\nimport {\n setBlurMaskFilter,\n isPushImageFilter,\n pushImageFilter,\n composeImageFilters,\n} from \"./commands/ImageFilters\";\nimport { setPaintProperties } from \"./commands/Paint\";\nimport {\n composePathEffects,\n isPushPathEffect,\n pushPathEffect,\n} from \"./commands/PathEffects\";\nimport { isPushShader, pushShader } from \"./commands/Shaders\";\nimport {\n CommandType,\n isCommand,\n isDrawCommand,\n isGroup,\n materializeCommand,\n} from \"./Core\";\nimport type { Command } from \"./Core\";\nimport type { DrawingContext } from \"./DrawingContext\";\n\nfunction play(ctx: DrawingContext, _command: Command) {\n \"worklet\";\n if (isGroup(_command)) {\n _command.children.forEach((child) => play(ctx, child));\n return;\n }\n const command = materializeCommand(_command);\n if (isCommand(command, CommandType.SaveBackdropFilter)) {\n ctx.saveBackdropFilter();\n } else if (isCommand(command, CommandType.SaveLayer)) {\n ctx.materializePaint();\n const paint = ctx.paintDeclarations.pop();\n ctx.canvas.saveLayer(paint);\n } else if (isDrawCommand(command, CommandType.SavePaint)) {\n if (command.props.paint) {\n ctx.paints.push(command.props.paint);\n } else {\n ctx.savePaint();\n setPaintProperties(\n ctx.Skia,\n ctx,\n command.props,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (command as any).standalone\n );\n }\n } else if (isCommand(command, CommandType.RestorePaint)) {\n ctx.restorePaint();\n } else if (isCommand(command, CommandType.ComposeColorFilter)) {\n composeColorFilters(ctx);\n } else if (isCommand(command, CommandType.RestorePaintDeclaration)) {\n ctx.materializePaint();\n const paint = ctx.restorePaint();\n if (!paint) {\n throw new Error(\"No paint declaration to push\");\n }\n ctx.paintDeclarations.push(paint);\n } else if (isCommand(command, CommandType.MaterializePaint)) {\n ctx.materializePaint();\n } else if (isPushColorFilter(command)) {\n pushColorFilter(ctx, command);\n } else if (isPushShader(command)) {\n pushShader(ctx, command);\n } else if (isPushImageFilter(command)) {\n pushImageFilter(ctx, command);\n } else if (isPushPathEffect(command)) {\n pushPathEffect(ctx, command);\n } else if (isCommand(command, CommandType.ComposePathEffect)) {\n composePathEffects(ctx);\n } else if (isCommand(command, CommandType.ComposeImageFilter)) {\n composeImageFilters(ctx);\n } else if (isDrawCommand(command, CommandType.PushBlurMaskFilter)) {\n setBlurMaskFilter(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.SaveCTM)) {\n saveCTM(ctx, command.props);\n } else if (isCommand(command, CommandType.RestoreCTM)) {\n ctx.canvas.restore();\n } else {\n // TODO: is a copy needed here?\n // apply opacity to the current paint.\n const paint = ctx.paint.copy();\n paint.setAlphaf(paint.getAlphaf() * ctx.getOpacity());\n const paints = [paint, ...ctx.paintDeclarations];\n ctx.paintDeclarations = [];\n paints.forEach((p) => {\n ctx.paints.push(p);\n if (isBoxCommand(command)) {\n drawBox(ctx, command);\n } else if (isCommand(command, CommandType.DrawPaint)) {\n ctx.canvas.drawPaint(ctx.paint);\n } else if (isDrawCommand(command, CommandType.DrawImage)) {\n drawImage(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawCircle)) {\n drawCircle(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPoints)) {\n drawPoints(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPath)) {\n drawPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRect)) {\n drawRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawRRect)) {\n drawRRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawOval)) {\n drawOval(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawLine)) {\n drawLine(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPatch)) {\n drawPatch(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawVertices)) {\n drawVertices(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawDiffRect)) {\n drawDiffRect(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawText)) {\n drawText(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextPath)) {\n drawTextPath(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawTextBlob)) {\n drawTextBlob(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawGlyphs)) {\n drawGlyphs(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawPicture)) {\n drawPicture(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawImageSVG)) {\n drawImageSVG(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawParagraph)) {\n drawParagraph(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawAtlas)) {\n drawAtlas(ctx, command.props);\n } else if (isDrawCommand(command, CommandType.DrawSkottie)) {\n drawSkottie(ctx, command.props);\n } else {\n console.warn(`Unknown command: ${command.type}`);\n }\n ctx.paints.pop();\n });\n }\n}\n\nexport const replay = (ctx: DrawingContext, commands: Command[]) => {\n \"worklet\";\n commands.forEach((command) => {\n play(ctx, command);\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAsBA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAUA,SAASS,IAAIA,CAACC,GAAmB,EAAEC,QAAiB,EAAE;EACpD,SAAS;;EACT,IAAI,IAAAC,aAAO,EAACD,QAAQ,CAAC,EAAE;IACrBA,QAAQ,CAACE,QAAQ,CAACC,OAAO,CAAEC,KAAK,IAAKN,IAAI,CAACC,GAAG,EAAEK,KAAK,CAAC,CAAC;IACtD;EACF;EACA,MAAMC,OAAO,GAAG,IAAAC,wBAAkB,EAACN,QAAQ,CAAC;EAC5C,IAAI,IAAAO,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACC,kBAAkB,CAAC,EAAE;IACtDV,GAAG,CAACW,kBAAkB,CAAC,CAAC;EAC1B,CAAC,MAAM,IAAI,IAAAH,eAAS,EAACF,OAAO,EAAEG,iBAAW,CAACG,SAAS,CAAC,EAAE;IACpDZ,GAAG,CAACa,gBAAgB,CAAC,CAAC;IACtB,MAAMC,KAAK,GAAGd,GAAG,CAACe,iBAAiB,CAACC,GAAG,CAAC,CAAC;IACzChB,GAAG,CAACiB,MAAM,CAACC,SAAS,CAACJ,KAAK,CAAC;EAC7B,CAAC,MAAM,IAAI,IAAAK,mBAAa,EAACb,OAAO,EAAEG,iBAAW,CAACW,SAAS,CAAC,EAAE;IACxD,IAAId,OAAO,CAACe,KAAK,CAACP,KAAK,EAAE;MACvBd,GAAG,CAACsB,MAAM,CAACC,I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AM,CAACN,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC;EACJ;AACF;AAEO,MAAMyF,MAAM,GAAGA,CAACzG,GAAmB,EAAE0G,QAAmB,KAAK;EAClE,SAAS;;EACTA,QAAQ,CAACtG,OAAO,CAAEE,OAAO,IAAK;IAC5BP,IAAI,CAACC,GAAG,EAAEM,OAAO,CAAC;EACpB,CAAC,CAAC;AACJ,CAAC;AAACqG,OAAA,CAAAF,MAAA,GAAAA,MAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { SharedValue } from "react-native-reanimated";
2
2
  import type { BaseRecorder, JsiRecorder, Skia } from "../../skia/types";
3
- import type { PaintProps, NodeType, BlurMaskFilterProps, CTMProps, BoxProps, BoxShadowProps, ImageProps, CircleProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps } from "../../dom/types";
3
+ import type { PaintProps, NodeType, BlurMaskFilterProps, CTMProps, BoxProps, BoxShadowProps, ImageProps, CircleProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, SkottieProps } from "../../dom/types";
4
4
  import type { AnimatedProps } from "../../renderer";
5
5
  export declare class ReanimatedRecorder implements BaseRecorder {
6
6
  private values;
@@ -50,4 +50,5 @@ export declare class ReanimatedRecorder implements BaseRecorder {
50
50
  drawImageSVG(props: AnimatedProps<ImageSVGProps>): void;
51
51
  drawParagraph(props: AnimatedProps<ParagraphProps>): void;
52
52
  drawAtlas(props: AnimatedProps<AtlasProps>): void;
53
+ drawSkottie(props: AnimatedProps<SkottieProps>): void;
53
54
  }
@@ -184,6 +184,10 @@ class ReanimatedRecorder {
184
184
  this.processAnimationValues(props);
185
185
  this.recorder.drawAtlas(props);
186
186
  }
187
+ drawSkottie(props) {
188
+ this.processAnimationValues(props);
189
+ this.recorder.drawSkottie(props);
190
+ }
187
191
  }
188
192
  exports.ReanimatedRecorder = ReanimatedRecorder;
189
193
  //# sourceMappingURL=ReanimatedRecorder.js.map