@shopify/react-native-skia 2.0.7 → 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 (283) 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/JsiSkSkottie.h +590 -0
  5. package/cpp/api/JsiSkottieFactory.h +65 -0
  6. package/cpp/api/recorder/Command.h +1 -0
  7. package/cpp/api/recorder/Convertor.h +16 -0
  8. package/cpp/api/recorder/Drawings.h +23 -0
  9. package/cpp/api/recorder/JsiRecorder.h +6 -0
  10. package/cpp/api/recorder/RNRecorder.h +9 -0
  11. package/cpp/api/third_party/SkottieUtils.cpp +333 -0
  12. package/cpp/api/third_party/SkottieUtils.h +172 -0
  13. package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +980 -0
  14. package/cpp/skia/modules/jsonreader/SkJSONReader.h +389 -0
  15. package/cpp/skia/modules/skottie/include/ExternalLayer.h +56 -0
  16. package/cpp/skia/modules/skottie/include/Skottie.h +313 -0
  17. package/cpp/skia/modules/skottie/include/SkottieProperty.h +190 -0
  18. package/cpp/skia/modules/skottie/include/SlotManager.h +113 -0
  19. package/cpp/skia/modules/skottie/include/TextShaper.h +200 -0
  20. package/cpp/skia/modules/skottie/src/SkottieValue.h +56 -0
  21. package/cpp/skia/modules/skottie/src/animator/Animator.h +89 -0
  22. package/cpp/skia/modules/skottie/src/text/Font.h +82 -0
  23. package/cpp/skia/modules/skottie/src/text/TextAdapter.h +155 -0
  24. package/cpp/skia/modules/skottie/src/text/TextAnimator.h +121 -0
  25. package/cpp/skia/modules/skottie/src/text/TextValue.h +28 -0
  26. package/cpp/skia/modules/sksg/include/SkSGClipEffect.h +61 -0
  27. package/cpp/skia/modules/sksg/include/SkSGColorFilter.h +135 -0
  28. package/cpp/skia/modules/sksg/include/SkSGDraw.h +57 -0
  29. package/cpp/skia/modules/sksg/include/SkSGEffectNode.h +50 -0
  30. package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +181 -0
  31. package/cpp/skia/modules/sksg/include/SkSGGeometryNode.h +54 -0
  32. package/cpp/skia/modules/sksg/include/SkSGGradient.h +108 -0
  33. package/cpp/skia/modules/sksg/include/SkSGGroup.h +65 -0
  34. package/cpp/skia/modules/sksg/include/SkSGImage.h +59 -0
  35. package/cpp/skia/modules/sksg/include/SkSGInvalidationController.h +46 -0
  36. package/cpp/skia/modules/sksg/include/SkSGMaskEffect.h +65 -0
  37. package/cpp/skia/modules/sksg/include/SkSGMerge.h +74 -0
  38. package/cpp/skia/modules/sksg/include/SkSGNode.h +128 -0
  39. package/cpp/skia/modules/sksg/include/SkSGOpacityEffect.h +54 -0
  40. package/cpp/skia/modules/sksg/include/SkSGPaint.h +112 -0
  41. package/cpp/skia/modules/sksg/include/SkSGPath.h +68 -0
  42. package/cpp/skia/modules/sksg/include/SkSGPlane.h +47 -0
  43. package/cpp/skia/modules/sksg/include/SkSGRect.h +122 -0
  44. package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +283 -0
  45. package/cpp/skia/modules/sksg/include/SkSGRenderNode.h +157 -0
  46. package/cpp/skia/modules/sksg/include/SkSGScene.h +47 -0
  47. package/cpp/skia/modules/sksg/include/SkSGText.h +82 -0
  48. package/cpp/skia/modules/sksg/include/SkSGTransform.h +127 -0
  49. package/cpp/skia/src/base/SkArenaAlloc.h +371 -0
  50. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +15 -15
  51. package/lib/commonjs/dom/types/Drawings.d.ts +5 -1
  52. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  53. package/lib/commonjs/dom/types/NodeType.d.ts +2 -1
  54. package/lib/commonjs/dom/types/NodeType.js +2 -0
  55. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  56. package/lib/commonjs/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  57. package/lib/commonjs/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  58. package/lib/commonjs/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  59. package/lib/commonjs/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  60. package/lib/commonjs/renderer/__tests__/setup.d.ts +5 -0
  61. package/lib/commonjs/renderer/components/Skottie.d.ts +4 -0
  62. package/lib/commonjs/renderer/components/Skottie.js +13 -0
  63. package/lib/commonjs/renderer/components/Skottie.js.map +1 -0
  64. package/lib/commonjs/renderer/components/index.d.ts +1 -0
  65. package/lib/commonjs/renderer/components/index.js +11 -0
  66. package/lib/commonjs/renderer/components/index.js.map +1 -1
  67. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  68. package/lib/commonjs/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  69. package/lib/commonjs/skia/types/Matrix4.d.ts +11 -2
  70. package/lib/commonjs/skia/types/Matrix4.js +42 -1
  71. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  72. package/lib/commonjs/skia/types/Recorder.d.ts +2 -1
  73. package/lib/commonjs/skia/types/Recorder.js.map +1 -1
  74. package/lib/commonjs/skia/types/Skia.d.ts +2 -0
  75. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  76. package/lib/commonjs/skia/types/Skottie.d.ts +223 -0
  77. package/lib/commonjs/skia/types/Skottie.js +73 -0
  78. package/lib/commonjs/skia/types/Skottie.js.map +1 -0
  79. package/lib/commonjs/skia/types/index.d.ts +1 -0
  80. package/lib/commonjs/skia/types/index.js +11 -0
  81. package/lib/commonjs/skia/types/index.js.map +1 -1
  82. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  83. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +88 -19
  84. package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  85. package/lib/commonjs/skia/web/JsiSkia.js +2 -0
  86. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  87. package/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +59 -0
  88. package/lib/commonjs/skia/web/JsiSkottieAnimation.js +243 -0
  89. package/lib/commonjs/skia/web/JsiSkottieAnimation.js.map +1 -0
  90. package/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +9 -0
  91. package/lib/commonjs/skia/web/JsiSkottieFactory.js +26 -0
  92. package/lib/commonjs/skia/web/JsiSkottieFactory.js.map +1 -0
  93. package/lib/commonjs/sksg/Elements.d.ts +2 -1
  94. package/lib/commonjs/sksg/Elements.js.map +1 -1
  95. package/lib/commonjs/sksg/Recorder/Core.d.ts +4 -2
  96. package/lib/commonjs/sksg/Recorder/Core.js +1 -0
  97. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
  98. package/lib/commonjs/sksg/Recorder/Player.js +2 -0
  99. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
  100. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  101. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +4 -0
  102. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  103. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +2 -1
  104. package/lib/commonjs/sksg/Recorder/Recorder.js +6 -0
  105. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
  106. package/lib/commonjs/sksg/Recorder/Visitor.js +3 -0
  107. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
  108. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +2 -2
  109. package/lib/commonjs/sksg/Recorder/commands/Drawing.js +11 -4
  110. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
  111. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +1 -1
  112. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  113. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +15 -15
  114. package/lib/module/dom/types/Drawings.d.ts +5 -1
  115. package/lib/module/dom/types/Drawings.js.map +1 -1
  116. package/lib/module/dom/types/NodeType.d.ts +2 -1
  117. package/lib/module/dom/types/NodeType.js +2 -0
  118. package/lib/module/dom/types/NodeType.js.map +1 -1
  119. package/lib/module/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  120. package/lib/module/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  121. package/lib/module/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  122. package/lib/module/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  123. package/lib/module/renderer/__tests__/setup.d.ts +5 -0
  124. package/lib/module/renderer/components/Skottie.d.ts +4 -0
  125. package/lib/module/renderer/components/Skottie.js +5 -0
  126. package/lib/module/renderer/components/Skottie.js.map +1 -0
  127. package/lib/module/renderer/components/index.d.ts +1 -0
  128. package/lib/module/renderer/components/index.js +1 -0
  129. package/lib/module/renderer/components/index.js.map +1 -1
  130. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  131. package/lib/module/skia/types/ImageFilter/ImageFilterFactory.js.map +1 -1
  132. package/lib/module/skia/types/Matrix4.d.ts +11 -2
  133. package/lib/module/skia/types/Matrix4.js +40 -0
  134. package/lib/module/skia/types/Matrix4.js.map +1 -1
  135. package/lib/module/skia/types/Recorder.d.ts +2 -1
  136. package/lib/module/skia/types/Recorder.js.map +1 -1
  137. package/lib/module/skia/types/Skia.d.ts +2 -0
  138. package/lib/module/skia/types/Skia.js.map +1 -1
  139. package/lib/module/skia/types/Skottie.d.ts +223 -0
  140. package/lib/module/skia/types/Skottie.js +74 -0
  141. package/lib/module/skia/types/Skottie.js.map +1 -0
  142. package/lib/module/skia/types/index.d.ts +1 -0
  143. package/lib/module/skia/types/index.js +1 -0
  144. package/lib/module/skia/types/index.js.map +1 -1
  145. package/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  146. package/lib/module/skia/web/JsiSkImageFilterFactory.js +88 -19
  147. package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
  148. package/lib/module/skia/web/JsiSkia.js +2 -0
  149. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  150. package/lib/module/skia/web/JsiSkottieAnimation.d.ts +59 -0
  151. package/lib/module/skia/web/JsiSkottieAnimation.js +236 -0
  152. package/lib/module/skia/web/JsiSkottieAnimation.js.map +1 -0
  153. package/lib/module/skia/web/JsiSkottieFactory.d.ts +9 -0
  154. package/lib/module/skia/web/JsiSkottieFactory.js +19 -0
  155. package/lib/module/skia/web/JsiSkottieFactory.js.map +1 -0
  156. package/lib/module/sksg/Elements.d.ts +2 -1
  157. package/lib/module/sksg/Elements.js.map +1 -1
  158. package/lib/module/sksg/Recorder/Core.d.ts +4 -2
  159. package/lib/module/sksg/Recorder/Core.js +1 -0
  160. package/lib/module/sksg/Recorder/Core.js.map +1 -1
  161. package/lib/module/sksg/Recorder/Player.js +3 -1
  162. package/lib/module/sksg/Recorder/Player.js.map +1 -1
  163. package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  164. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +4 -0
  165. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  166. package/lib/module/sksg/Recorder/Recorder.d.ts +2 -1
  167. package/lib/module/sksg/Recorder/Recorder.js +6 -0
  168. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  169. package/lib/module/sksg/Recorder/Visitor.js +3 -0
  170. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  171. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +2 -2
  172. package/lib/module/sksg/Recorder/commands/Drawing.js +9 -2
  173. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  174. package/lib/module/sksg/Recorder/commands/ImageFilters.js +1 -1
  175. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  176. package/lib/typescript/lib/commonjs/renderer/components/Skottie.d.ts +2 -0
  177. package/lib/typescript/lib/commonjs/skia/types/Matrix4.d.ts +1 -0
  178. package/lib/typescript/lib/commonjs/skia/types/Skottie.d.ts +6 -0
  179. package/lib/typescript/lib/commonjs/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  180. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +2 -0
  181. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieAnimation.d.ts +48 -0
  182. package/lib/typescript/lib/commonjs/skia/web/JsiSkottieFactory.d.ts +6 -0
  183. package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  184. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -0
  185. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +1 -1
  186. package/lib/typescript/lib/module/mock/index.d.ts +7 -0
  187. package/lib/typescript/lib/module/renderer/components/Skottie.d.ts +2 -0
  188. package/lib/typescript/lib/module/renderer/components/index.d.ts +1 -0
  189. package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -0
  190. package/lib/typescript/lib/module/skia/types/Matrix4.d.ts +1 -0
  191. package/lib/typescript/lib/module/skia/types/Skottie.d.ts +5 -0
  192. package/lib/typescript/lib/module/skia/types/index.d.ts +1 -0
  193. package/lib/typescript/lib/module/skia/web/JsiSkImageFilterFactory.d.ts +22 -5
  194. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +2 -0
  195. package/lib/typescript/lib/module/skia/web/JsiSkottieAnimation.d.ts +47 -0
  196. package/lib/typescript/lib/module/skia/web/JsiSkottieFactory.d.ts +5 -0
  197. package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -0
  198. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -0
  199. package/lib/typescript/lib/module/sksg/Recorder/commands/Drawing.d.ts +1 -1
  200. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +15 -15
  201. package/lib/typescript/src/dom/types/Drawings.d.ts +5 -1
  202. package/lib/typescript/src/dom/types/NodeType.d.ts +2 -1
  203. package/lib/typescript/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +1 -0
  204. package/lib/typescript/src/renderer/__tests__/e2e/Camera.spec.d.ts +21 -0
  205. package/lib/typescript/src/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +1 -0
  206. package/lib/typescript/src/renderer/__tests__/e2e/Skottie.spec.d.ts +1 -0
  207. package/lib/typescript/src/renderer/__tests__/setup.d.ts +5 -0
  208. package/lib/typescript/src/renderer/components/Skottie.d.ts +4 -0
  209. package/lib/typescript/src/renderer/components/index.d.ts +1 -0
  210. package/lib/typescript/src/skia/types/ImageFilter/ImageFilterFactory.d.ts +252 -15
  211. package/lib/typescript/src/skia/types/Matrix4.d.ts +11 -2
  212. package/lib/typescript/src/skia/types/Recorder.d.ts +2 -1
  213. package/lib/typescript/src/skia/types/Skia.d.ts +2 -0
  214. package/lib/typescript/src/skia/types/Skottie.d.ts +223 -0
  215. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  216. package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +29 -12
  217. package/lib/typescript/src/skia/web/JsiSkottieAnimation.d.ts +59 -0
  218. package/lib/typescript/src/skia/web/JsiSkottieFactory.d.ts +9 -0
  219. package/lib/typescript/src/sksg/Elements.d.ts +2 -1
  220. package/lib/typescript/src/sksg/Recorder/Core.d.ts +4 -2
  221. package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +2 -1
  222. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +2 -1
  223. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +2 -2
  224. package/libs/android/arm64-v8a/libjsonreader.a +0 -0
  225. package/libs/android/armeabi-v7a/libjsonreader.a +0 -0
  226. package/libs/android/x86/libjsonreader.a +0 -0
  227. package/libs/android/x86_64/libjsonreader.a +0 -0
  228. package/libs/apple/libpathops.xcframework/Info.plist +8 -8
  229. package/libs/apple/libskia.xcframework/Info.plist +14 -14
  230. package/libs/apple/libskottie.xcframework/Info.plist +14 -14
  231. package/libs/apple/libskparagraph.xcframework/Info.plist +16 -16
  232. package/libs/apple/libsksg.xcframework/Info.plist +5 -5
  233. package/libs/apple/libskshaper.xcframework/Info.plist +14 -14
  234. package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +14 -14
  235. package/libs/apple/libsvg.xcframework/Info.plist +14 -14
  236. package/package.json +1 -1
  237. package/react-native-skia.podspec +4 -2
  238. package/src/__tests__/snapshots/matrix4/camera-corner.png +0 -0
  239. package/src/__tests__/snapshots/matrix4/camera-offset.png +0 -0
  240. package/src/__tests__/snapshots/matrix4/camera-top-left-center.png +0 -0
  241. package/src/__tests__/snapshots/matrix4/camera-zoom-out.png +0 -0
  242. package/src/__tests__/snapshots/matrix4/full-rect.png +0 -0
  243. package/src/__tests__/snapshots/matrix4/rect.png +0 -0
  244. package/src/__tests__/snapshots/matrix4/scaled-rect.png +0 -0
  245. package/src/__tests__/snapshots/matrix4/test-perspective.png +0 -0
  246. package/src/__tests__/snapshots/matrix4/test-perspective2.png +0 -0
  247. package/src/dom/types/Drawings.ts +6 -0
  248. package/src/dom/types/NodeType.ts +2 -0
  249. package/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.tsx +492 -0
  250. package/src/renderer/__tests__/e2e/Camera.spec.tsx +475 -0
  251. package/src/renderer/__tests__/e2e/LightingImageFilters.spec.tsx +1478 -0
  252. package/src/renderer/__tests__/e2e/Skottie.spec.tsx +440 -0
  253. package/src/renderer/__tests__/e2e/setup/skottie/basic_slots.json +1118 -0
  254. package/src/renderer/__tests__/e2e/setup/skottie/color-props.json +1 -0
  255. package/src/renderer/__tests__/e2e/setup/skottie/confetti.json +5899 -0
  256. package/src/renderer/__tests__/e2e/setup/skottie/drinks.json +43857 -0
  257. package/src/renderer/__tests__/e2e/setup/skottie/fingerprint.json +1 -0
  258. package/src/renderer/__tests__/e2e/setup/skottie/lego_loader.json +29540 -0
  259. package/src/renderer/__tests__/e2e/setup/skottie/new-drop.json +1 -0
  260. package/src/renderer/__tests__/e2e/setup/skottie/onboarding.json +1 -0
  261. package/src/renderer/__tests__/e2e/setup/skottie/text-layer.json +1 -0
  262. package/src/renderer/__tests__/setup.tsx +23 -0
  263. package/src/renderer/components/Skottie.tsx +8 -0
  264. package/src/renderer/components/index.ts +1 -0
  265. package/src/skia/__tests__/assets/Avenir-Heavy.ttf +0 -0
  266. package/src/skia/types/ImageFilter/ImageFilterFactory.ts +391 -21
  267. package/src/skia/types/Matrix4.ts +108 -2
  268. package/src/skia/types/Recorder.ts +2 -0
  269. package/src/skia/types/Skia.ts +2 -0
  270. package/src/skia/types/Skottie.ts +266 -0
  271. package/src/skia/types/index.ts +1 -0
  272. package/src/skia/web/JsiSkImageFilterFactory.ts +266 -31
  273. package/src/skia/web/JsiSkia.ts +2 -0
  274. package/src/skia/web/JsiSkottieAnimation.ts +259 -0
  275. package/src/skia/web/JsiSkottieFactory.ts +25 -0
  276. package/src/sksg/Elements.tsx +2 -0
  277. package/src/sksg/Recorder/Core.ts +3 -0
  278. package/src/sksg/Recorder/Player.ts +3 -0
  279. package/src/sksg/Recorder/ReanimatedRecorder.ts +6 -0
  280. package/src/sksg/Recorder/Recorder.ts +5 -0
  281. package/src/sksg/Recorder/Visitor.ts +3 -0
  282. package/src/sksg/Recorder/commands/Drawing.ts +7 -3
  283. package/src/sksg/Recorder/commands/ImageFilters.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  import type { SharedValue } from "react-native-reanimated";
2
2
  import { NodeType } from "../../dom/types";
3
- import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PaintProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, BoxProps, BoxShadowProps } from "../../dom/types";
3
+ import type { BlurMaskFilterProps, CircleProps, CTMProps, ImageProps, PaintProps, PointsProps, PathProps, RectProps, RoundedRectProps, OvalProps, LineProps, PatchProps, VerticesProps, DiffRectProps, TextProps, TextPathProps, TextBlobProps, GlyphsProps, PictureProps, ImageSVGProps, ParagraphProps, AtlasProps, BoxProps, BoxShadowProps, SkottieProps } from "../../dom/types";
4
4
  import type { AnimatedProps } from "../../renderer";
5
5
  import type { SkPaint, BaseRecorder } from "../../skia/types";
6
6
  import type { Command } from "./Core";
@@ -61,5 +61,6 @@ export declare class Recorder implements BaseRecorder {
61
61
  drawImageSVG(props: AnimatedProps<ImageSVGProps>): void;
62
62
  drawParagraph(props: AnimatedProps<ParagraphProps>): void;
63
63
  drawAtlas(props: AnimatedProps<AtlasProps>): void;
64
+ drawSkottie(props: AnimatedProps<SkottieProps>): void;
64
65
  }
65
66
  export {};
@@ -299,5 +299,11 @@ export class Recorder {
299
299
  props
300
300
  });
301
301
  }
302
+ drawSkottie(props) {
303
+ this.add({
304
+ type: CommandType.DrawSkottie,
305
+ props
306
+ });
307
+ }
302
308
  }
303
309
  //# sourceMappingURL=Recorder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NodeType","isSharedValue","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","length","saveGroup","children","type","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","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"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\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 BoxProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n}\n"],"mappings":";;;AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA4B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAG9E,SAASC,WAAW,QAAQ,QAAQ;AAYpC,OAAO,MAAMC,QAAQ,CAAyB;EAK5CC,WAAWA,CAAA,EAAG;IAAAC,eAAA,mBAJQ,EAAE;IAAAA,eAAA,kBACD,EAAE;IAAAA,eAAA,0BACoB,IAAIC,GAAG,CAAC,CAAC;IAGpD,IAAI,CAACC,OAAO,CAACC,IAAI,CAA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AAM,CAAC,CAAC;EACrD;EAEAoF,QAAQA,CAACpF,KAA+B,EAAE;IACxC,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACiG,QAAQ;MAAErF;IAAM,CAAC,CAAC;EACjD;EAEAsF,YAAYA,CAACtF,KAAmC,EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACmG,YAAY;MAAEvF;IAAM,CAAC,CAAC;EACrD;EAEAwF,YAAYA,CAACxF,KAAmC,EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACqG,YAAY;MAAEzF;IAAM,CAAC,CAAC;EACrD;EAEA0F,UAAUA,CAAC1F,KAAiC,EAAE;IAC5C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACuG,UAAU;MAAE3F;IAAM,CAAC,CAAC;EACnD;EAEA4F,WAAWA,CAAC5F,KAAkC,EAAE;IAC9C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACyG,WAAW;MAAE7F;IAAM,CAAC,CAAC;EACpD;EAEA8F,YAAYA,CAAC9F,KAAmC,EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC2G,YAAY;MAAE/F;IAAM,CAAC,CAAC;EACrD;EAEAgG,aAAaA,CAAChG,KAAoC,EAAE;IAClD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC6G,aAAa;MAAEjG;IAAM,CAAC,CAAC;EACtD;EAEAkG,SAASA,CAAClG,KAAgC,EAAE;IAC1C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC+G,SAAS;MAAEnG;IAAM,CAAC,CAAC;EAClD;AACF","ignoreList":[]}
1
+ {"version":3,"names":["NodeType","isSharedValue","isColorFilter","isImageFilter","isPathEffect","isShader","CommandType","Recorder","constructor","_defineProperty","Set","cursors","push","commands","getRecording","paintPool","animationValues","processProps","props","animatedProps","hasAnimatedProps","key","prop","add","undefined","command","length","saveGroup","children","type","Group","restoreGroup","pop","savePaint","standalone","SavePaint","restorePaint","RestorePaint","restorePaintDeclaration","RestorePaintDeclaration","materializePaint","MaterializePaint","pushPathEffect","pathEffectType","Error","PushPathEffect","pushImageFilter","imageFilterType","PushImageFilter","pushColorFilter","colorFilterType","PushColorFilter","pushShader","shaderType","Blend","PushShader","pushBlurMaskFilter","PushBlurMaskFilter","composePathEffect","ComposePathEffect","composeColorFilter","ComposeColorFilter","composeImageFilter","ComposeImageFilter","saveCTM","SaveCTM","restoreCTM","RestoreCTM","drawPaint","DrawPaint","saveLayer","SaveLayer","saveBackdropFilter","SaveBackdropFilter","drawBox","boxProps","shadows","forEach","shadow","DrawBox","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"],"sources":["Recorder.ts"],"sourcesContent":["import type { SharedValue } from \"react-native-reanimated\";\n\nimport { NodeType } from \"../../dom/types\";\nimport type {\n BlurMaskFilterProps,\n CircleProps,\n CTMProps,\n ImageProps,\n PaintProps,\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 BoxProps,\n BoxShadowProps,\n SkottieProps,\n} from \"../../dom/types\";\nimport type { AnimatedProps } from \"../../renderer\";\nimport { isSharedValue } from \"../utils\";\nimport { isColorFilter, isImageFilter, isPathEffect, isShader } from \"../Node\";\nimport type { SkPaint, BaseRecorder } from \"../../skia/types\";\n\nimport { CommandType } from \"./Core\";\nimport type { Command } from \"./Core\";\n\nexport interface Recording {\n commands: Command[];\n paintPool: SkPaint[];\n}\n\ninterface AnimationValues {\n animationValues: Set<SharedValue<unknown>>;\n}\n\nexport class Recorder implements BaseRecorder {\n commands: Command[] = [];\n cursors: Command[][] = [];\n animationValues: Set<SharedValue<unknown>> = new Set();\n\n constructor() {\n this.cursors.push(this.commands);\n }\n\n getRecording(): Recording & AnimationValues {\n return {\n commands: this.commands,\n paintPool: [],\n animationValues: this.animationValues,\n };\n }\n\n private processProps(props: Record<string, unknown>) {\n const animatedProps: Record<string, SharedValue<unknown>> = {};\n let hasAnimatedProps = false;\n\n for (const key in props) {\n const prop = props[key];\n if (isSharedValue(prop)) {\n this.animationValues.add(prop);\n animatedProps[key] = prop;\n hasAnimatedProps = true;\n }\n }\n\n return {\n props,\n animatedProps: hasAnimatedProps ? animatedProps : undefined,\n };\n }\n\n private add(command: Command) {\n if (command.props) {\n const { animatedProps } = this.processProps(\n command.props as Record<string, unknown>\n );\n if (animatedProps) {\n command.animatedProps = animatedProps;\n }\n }\n this.cursors[this.cursors.length - 1].push(command);\n }\n\n saveGroup() {\n const children: Command[] = [];\n this.add({ type: CommandType.Group, children });\n this.cursors.push(children);\n }\n\n restoreGroup() {\n this.cursors.pop();\n }\n\n savePaint(props: AnimatedProps<PaintProps>, standalone: boolean) {\n this.add({ type: CommandType.SavePaint, props, standalone });\n }\n\n restorePaint() {\n this.add({ type: CommandType.RestorePaint });\n }\n\n restorePaintDeclaration() {\n this.add({ type: CommandType.RestorePaintDeclaration });\n }\n\n materializePaint() {\n this.add({ type: CommandType.MaterializePaint });\n }\n\n pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>) {\n if (!isPathEffect(pathEffectType)) {\n throw new Error(\"Invalid color filter type: \" + pathEffectType);\n }\n this.add({\n type: CommandType.PushPathEffect,\n pathEffectType,\n props,\n });\n }\n\n pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isImageFilter(imageFilterType)) {\n throw new Error(\"Invalid color filter type: \" + imageFilterType);\n }\n this.add({\n type: CommandType.PushImageFilter,\n imageFilterType,\n props,\n });\n }\n\n pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>) {\n if (!isColorFilter(colorFilterType)) {\n throw new Error(\"Invalid color filter type: \" + colorFilterType);\n }\n this.add({\n type: CommandType.PushColorFilter,\n colorFilterType,\n props,\n });\n }\n\n pushShader(shaderType: NodeType, props: AnimatedProps<unknown>) {\n if (!isShader(shaderType) && !(shaderType === NodeType.Blend)) {\n throw new Error(\"Invalid color filter type: \" + shaderType);\n }\n this.add({ type: CommandType.PushShader, shaderType, props });\n }\n\n pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>) {\n this.add({ type: CommandType.PushBlurMaskFilter, props });\n }\n\n composePathEffect() {\n this.add({ type: CommandType.ComposePathEffect });\n }\n\n composeColorFilter() {\n this.add({ type: CommandType.ComposeColorFilter });\n }\n\n composeImageFilter() {\n this.add({ type: CommandType.ComposeImageFilter });\n }\n\n saveCTM(props: AnimatedProps<CTMProps>) {\n this.add({ type: CommandType.SaveCTM, props });\n }\n\n restoreCTM() {\n this.add({ type: CommandType.RestoreCTM });\n }\n\n drawPaint() {\n this.add({ type: CommandType.DrawPaint });\n }\n\n saveLayer() {\n this.add({ type: CommandType.SaveLayer });\n }\n\n saveBackdropFilter() {\n this.add({ type: CommandType.SaveBackdropFilter });\n }\n\n drawBox(\n boxProps: AnimatedProps<BoxProps>,\n shadows: {\n props: BoxShadowProps;\n animatedProps?: Record<string, SharedValue<unknown>>;\n }[]\n ) {\n shadows.forEach((shadow) => {\n if (shadow.props) {\n if (shadow.props) {\n const { animatedProps } = this.processProps(\n shadow.props as unknown as Record<string, unknown>\n );\n if (animatedProps) {\n shadow.animatedProps = animatedProps;\n }\n }\n }\n });\n this.add({ type: CommandType.DrawBox, props: boxProps, shadows });\n }\n\n drawImage(props: AnimatedProps<ImageProps>) {\n this.add({ type: CommandType.DrawImage, props });\n }\n\n drawCircle(props: AnimatedProps<CircleProps>) {\n this.add({ type: CommandType.DrawCircle, props });\n }\n drawPoints(props: AnimatedProps<PointsProps>) {\n this.add({ type: CommandType.DrawPoints, props });\n }\n\n drawPath(props: AnimatedProps<PathProps>) {\n this.add({ type: CommandType.DrawPath, props });\n }\n\n drawRect(props: AnimatedProps<RectProps>) {\n this.add({ type: CommandType.DrawRect, props });\n }\n\n drawRRect(props: AnimatedProps<RoundedRectProps>) {\n this.add({ type: CommandType.DrawRRect, props });\n }\n\n drawOval(props: AnimatedProps<OvalProps>) {\n this.add({ type: CommandType.DrawOval, props });\n }\n\n drawLine(props: AnimatedProps<LineProps>) {\n this.add({ type: CommandType.DrawLine, props });\n }\n\n drawPatch(props: AnimatedProps<PatchProps>) {\n this.add({ type: CommandType.DrawPatch, props });\n }\n\n drawVertices(props: AnimatedProps<VerticesProps>) {\n this.add({ type: CommandType.DrawVertices, props });\n }\n\n drawDiffRect(props: AnimatedProps<DiffRectProps>) {\n this.add({ type: CommandType.DrawDiffRect, props });\n }\n\n drawText(props: AnimatedProps<TextProps>) {\n this.add({ type: CommandType.DrawText, props });\n }\n\n drawTextPath(props: AnimatedProps<TextPathProps>) {\n this.add({ type: CommandType.DrawTextPath, props });\n }\n\n drawTextBlob(props: AnimatedProps<TextBlobProps>) {\n this.add({ type: CommandType.DrawTextBlob, props });\n }\n\n drawGlyphs(props: AnimatedProps<GlyphsProps>) {\n this.add({ type: CommandType.DrawGlyphs, props });\n }\n\n drawPicture(props: AnimatedProps<PictureProps>) {\n this.add({ type: CommandType.DrawPicture, props });\n }\n\n drawImageSVG(props: AnimatedProps<ImageSVGProps>) {\n this.add({ type: CommandType.DrawImageSVG, props });\n }\n\n drawParagraph(props: AnimatedProps<ParagraphProps>) {\n this.add({ type: CommandType.DrawParagraph, props });\n }\n\n drawAtlas(props: AnimatedProps<AtlasProps>) {\n this.add({ type: CommandType.DrawAtlas, props });\n }\n\n drawSkottie(props: AnimatedProps<SkottieProps>) {\n this.add({ type: CommandType.DrawSkottie, props });\n }\n}\n"],"mappings":";;;AAEA,SAASA,QAAQ,QAAQ,iBAAiB;AA6B1C,SAASC,aAAa,QAAQ,UAAU;AACxC,SAASC,aAAa,EAAEC,aAAa,EAAEC,YAAY,EAAEC,QAAQ,QAAQ,SAAS;AAG9E,SAASC,WAAW,QAAQ,QAAQ;AAYpC,OAAO,MAAMC,QAAQ,CAAyB;EAK5CC,WAAWA,CAAA,EAAG;IAAAC,eAAA,mBAJQ,EAAE;IAAAA,eAAA,kBACD,EAAE;IAAAA,eAAA,0BACoB,IAAIC,GAAG,CAAC,CAAC;IAGpD,IAAI,CAACC,OAAO,CAACC,IAAI,CAAC,IAAI,CAACC,QAAQ,CAAC;EAClC;EAEAC,YAAYA,CAAA,EAAgC;IAC1C,OAAO;MACLD,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBE,SAAS,EAAE,EAAE;MACbC,eAAe,EAAE,IAAI,CAACA;IACxB,CAAC;EACH;EAEQC,YAAYA,CAACC,KAA8B,EAAE;IACnD,MAAMC,aAAmD,GAAG,CAAC,CAAC;IAC9D,IAAIC,gBAAgB,GAAG,KAAK;IAE5B,KAAK,MAAMC,GAAG,IAAIH,KAAK,EAAE;MACvB,MAAMI,IAAI,GAAGJ,KAAK,CAACG,GAAG,CAAC;MACvB,IAAIpB,aAAa,CAACqB,IAAI,CAAC,EAAE;QACvB,IAAI,CAACN,eAAe,CAACO,GAAG,CAACD,IAAI,CAAC;QAC9BH,aAAa,CAACE,GAAG,CAAC,GAAGC,IAAI;QACzBF,gBAAgB,GAAG,IAAI;MACzB;IACF;IAEA,OAAO;MACLF,KAAK;MACLC,aAAa,EAAEC,gBAAgB,GAAGD,aAAa,GAAGK;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CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACyG,WAAW;MAAE7F;IAAM,CAAC,CAAC;EACpD;EAEA8F,YAAYA,CAAC9F,KAAmC,EAAE;IAChD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC2G,YAAY;MAAE/F;IAAM,CAAC,CAAC;EACrD;EAEAgG,aAAaA,CAAChG,KAAoC,EAAE;IAClD,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC6G,aAAa;MAAEjG;IAAM,CAAC,CAAC;EACtD;EAEAkG,SAASA,CAAClG,KAAgC,EAAE;IAC1C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAAC+G,SAAS;MAAEnG;IAAM,CAAC,CAAC;EAClD;EAEAoG,WAAWA,CAACpG,KAAkC,EAAE;IAC9C,IAAI,CAACK,GAAG,CAAC;MAAEM,IAAI,EAAEvB,WAAW,CAACiH,WAAW;MAAErG;IAAM,CAAC,CAAC;EACpD;AACF","ignoreList":[]}
@@ -266,6 +266,9 @@ const visitNode = (recorder, node) => {
266
266
  case NodeType.Paragraph:
267
267
  recorder.drawParagraph(props);
268
268
  break;
269
+ case NodeType.Skottie:
270
+ recorder.drawSkottie(props);
271
+ break;
269
272
  case NodeType.Atlas:
270
273
  recorder.drawAtlas(props);
271
274
  break;
@@ -1 +1 @@
1
- {"version":3,"names":["NodeType","isImageFilter","isShader","sortNodeChildren","processPaint","opacity","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintRef","undefined","processCTM","clip","invertClip","transform","origin","matrix","layer","ctm","pushColorFilters","recorder","colorFilters","forEach","colorFilter","children","length","pushColorFilter","type","props","needsComposition","LerpColorFilter","composeColorFilter","pushPathEffects","pathEffects","pathEffect","pushPathEffect","SumPathEffect","composePathEffect","pushImageFilters","imageFilters","imageFilter","pushImageFilter","pushShader","BlendImageFilter","composeImageFilter","pushShaders","shaders","shader","pushMaskFilters","maskFilters","pushBlurMaskFilter","pushPaints","paints","savePaint","restorePaintDeclaration","visitNode","node","Group","saveGroup","drawings","shouldPushPaint","BackdropFilter","saveBackdropFilter","materializePaint","Layer","saveLayer","shouldRestore","saveCTM","Box","shadows","filter","n","BoxShadow","map","drawBox","Fill","drawPaint","Image","drawImage","Circle","drawCircle","Points","drawPoints","Path","drawPath","Rect","drawRect","RRect","drawRRect","Oval","drawOval","Line","drawLine","Patch","drawPatch","Vertices","drawVertices","DiffRect","drawDiffRect","Text","drawText","TextPath","drawTextPath","TextBlob","drawTextBlob","Glyphs","drawGlyphs","Picture","drawPicture","ImageSVG","drawImageSVG","Paragraph","drawParagraph","Atlas","drawAtlas","drawing","restorePaint","restoreCTM","restoreGroup","visit","root"],"sources":["Visitor.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n CTMProps,\n DrawingNodeProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport { NodeType } from \"../../dom/types\";\nimport type { BaseRecorder } from \"../../skia/types/Recorder\";\nimport type { Node } from \"../Node\";\nimport { isImageFilter, isShader, sortNodeChildren } from \"../Node\";\n\nexport const processPaint = ({\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintRef,\n}: DrawingNodeProps) => {\n const paint: DrawingNodeProps = {};\n if (opacity !== undefined) {\n paint.opacity = opacity;\n }\n if (color !== undefined) {\n paint.color = color;\n }\n if (strokeWidth !== undefined) {\n paint.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n paint.blendMode = blendMode;\n }\n if (style !== undefined) {\n paint.style = style;\n }\n if (strokeJoin !== undefined) {\n paint.strokeJoin = strokeJoin;\n }\n if (strokeCap !== undefined) {\n paint.strokeCap = strokeCap;\n }\n if (strokeMiter !== undefined) {\n paint.strokeMiter = strokeMiter;\n }\n if (antiAlias !== undefined) {\n paint.antiAlias = antiAlias;\n }\n if (dither !== undefined) {\n paint.dither = dither;\n }\n\n if (paintRef !== undefined) {\n paint.paint = paintRef;\n }\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n paintRef !== undefined\n ) {\n return paint;\n }\n return null;\n};\n\nconst processCTM = ({\n clip,\n invertClip,\n transform,\n origin,\n matrix,\n layer,\n}: CTMProps) => {\n const ctm: CTMProps = {};\n if (clip) {\n ctm.clip = clip;\n }\n if (invertClip) {\n ctm.invertClip = invertClip;\n }\n if (transform) {\n ctm.transform = transform;\n }\n if (origin) {\n ctm.origin = origin;\n }\n if (matrix) {\n ctm.matrix = matrix;\n }\n if (layer) {\n ctm.layer = layer;\n }\n if (\n clip !== undefined ||\n invertClip !== undefined ||\n transform !== undefined ||\n origin !== undefined ||\n matrix !== undefined ||\n layer !== undefined\n ) {\n return ctm;\n }\n return null;\n};\n\nconst pushColorFilters = (\n recorder: BaseRecorder,\n colorFilters: Node<any>[]\n) => {\n colorFilters.forEach((colorFilter) => {\n if (colorFilter.children.length > 0) {\n pushColorFilters(recorder, colorFilter.children);\n }\n recorder.pushColorFilter(colorFilter.type, colorFilter.props);\n const needsComposition =\n colorFilter.type !== NodeType.LerpColorFilter &&\n colorFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeColorFilter();\n }\n });\n};\n\nconst pushPathEffects = (recorder: BaseRecorder, pathEffects: Node<any>[]) => {\n pathEffects.forEach((pathEffect) => {\n if (pathEffect.children.length > 0) {\n pushPathEffects(recorder, pathEffect.children);\n }\n recorder.pushPathEffect(pathEffect.type, pathEffect.props);\n const needsComposition =\n pathEffect.type !== NodeType.SumPathEffect &&\n pathEffect.children.length > 0;\n if (needsComposition) {\n recorder.composePathEffect();\n }\n });\n};\n\nconst pushImageFilters = (\n recorder: BaseRecorder,\n imageFilters: Node<any>[]\n) => {\n imageFilters.forEach((imageFilter) => {\n if (imageFilter.children.length > 0) {\n pushImageFilters(recorder, imageFilter.children);\n }\n if (isImageFilter(imageFilter.type)) {\n recorder.pushImageFilter(imageFilter.type, imageFilter.props);\n } else if (isShader(imageFilter.type)) {\n recorder.pushShader(imageFilter.type, imageFilter.props);\n }\n const needsComposition =\n imageFilter.type !== NodeType.BlendImageFilter &&\n imageFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeImageFilter();\n }\n });\n};\n\nconst pushShaders = (recorder: BaseRecorder, shaders: Node<any>[]) => {\n shaders.forEach((shader) => {\n if (shader.children.length > 0) {\n pushShaders(recorder, shader.children);\n }\n recorder.pushShader(shader.type, shader.props);\n });\n};\n\nconst pushMaskFilters = (recorder: BaseRecorder, maskFilters: Node<any>[]) => {\n if (maskFilters.length > 0) {\n recorder.pushBlurMaskFilter(maskFilters[maskFilters.length - 1].props);\n }\n};\n\nconst pushPaints = (recorder: BaseRecorder, paints: Node<any>[]) => {\n paints.forEach((paint) => {\n recorder.savePaint(paint.props, true);\n const { colorFilters, maskFilters, shaders, imageFilters, pathEffects } =\n sortNodeChildren(paint);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n recorder.restorePaintDeclaration();\n });\n};\n\nconst visitNode = (recorder: BaseRecorder, node: Node<any>) => {\n if (node.type === NodeType.Group) {\n recorder.saveGroup();\n }\n const { props } = node;\n const {\n colorFilters,\n maskFilters,\n drawings,\n shaders,\n imageFilters,\n pathEffects,\n paints,\n } = sortNodeChildren(node);\n const paint = processPaint(props);\n const shouldPushPaint =\n paint ||\n colorFilters.length > 0 ||\n maskFilters.length > 0 ||\n imageFilters.length > 0 ||\n pathEffects.length > 0 ||\n shaders.length > 0;\n if (shouldPushPaint) {\n recorder.savePaint(paint ?? {}, false);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n // For mixed nodes like BackdropFilters we don't materialize the paint\n if (node.type === NodeType.BackdropFilter) {\n recorder.saveBackdropFilter();\n } else {\n recorder.materializePaint();\n }\n }\n pushPaints(recorder, paints);\n if (node.type === NodeType.Layer) {\n recorder.saveLayer();\n }\n const ctm = processCTM(props);\n const shouldRestore = !!ctm || node.type === NodeType.Layer;\n if (ctm) {\n recorder.saveCTM(ctm);\n }\n switch (node.type) {\n case NodeType.Box:\n const shadows = node.children\n .filter((n) => n.type === NodeType.BoxShadow)\n // eslint-disable-next-line @typescript-eslint/no-shadow\n .map(({ props }) => ({ props } as { props: BoxShadowProps }));\n recorder.drawBox(props, shadows);\n break;\n case NodeType.Fill:\n recorder.drawPaint();\n break;\n case NodeType.Image:\n recorder.drawImage(props);\n break;\n case NodeType.Circle:\n recorder.drawCircle(props);\n break;\n case NodeType.Points:\n recorder.drawPoints(props);\n break;\n case NodeType.Path:\n recorder.drawPath(props);\n break;\n case NodeType.Rect:\n recorder.drawRect(props);\n break;\n case NodeType.RRect:\n recorder.drawRRect(props);\n break;\n case NodeType.Oval:\n recorder.drawOval(props);\n break;\n case NodeType.Line:\n recorder.drawLine(props);\n break;\n case NodeType.Patch:\n recorder.drawPatch(props);\n break;\n case NodeType.Vertices:\n recorder.drawVertices(props);\n break;\n case NodeType.DiffRect:\n recorder.drawDiffRect(props);\n break;\n case NodeType.Text:\n recorder.drawText(props);\n break;\n case NodeType.TextPath:\n recorder.drawTextPath(props);\n break;\n case NodeType.TextBlob:\n recorder.drawTextBlob(props);\n break;\n case NodeType.Glyphs:\n recorder.drawGlyphs(props);\n break;\n case NodeType.Picture:\n recorder.drawPicture(props);\n break;\n case NodeType.ImageSVG:\n recorder.drawImageSVG(props);\n break;\n case NodeType.Paragraph:\n recorder.drawParagraph(props);\n break;\n case NodeType.Atlas:\n recorder.drawAtlas(props);\n break;\n }\n drawings.forEach((drawing) => {\n visitNode(recorder, drawing);\n });\n if (shouldPushPaint) {\n recorder.restorePaint();\n }\n if (shouldRestore) {\n recorder.restoreCTM();\n }\n if (node.type === NodeType.Group) {\n recorder.restoreGroup();\n }\n};\n\nexport const visit = (recorder: BaseRecorder, root: Node[]) => {\n root.forEach((node) => {\n visitNode(recorder, node);\n });\n};\n"],"mappings":"AAAA;;AAMA,SAASA,QAAQ,QAAQ,iBAAiB;AAG1C,SAASC,aAAa,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,SAAS;AAEnE,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC,MAAM;EACNC,KAAK,EAAEC;AACS,CAAC,KAAK;EACtB,MAAMD,KAAuB,GAAG,CAAC,CAAC;EAClC,IAAIV,OAAO,KAAKY,SAAS,EAAE;IACzBF,KAAK,CAACV,OAAO,GAAGA,OAAO;EACzB;EACA,IAAIC,KAAK,KAAKW,SAAS,EAAE;IACvBF,KAAK,CAACT,KAAK,GAAGA,KAAK;EACrB;EACA,IAAIC,WAAW,KAAKU,SAAS,EAAE;IAC7BF,KAAK,CAACR,WAAW,GAAGA,WAAW;EACjC;EACA,IAAIC,SAAS,KAAKS,SAAS,EAAE;IAC3BF,KAAK,CAACP,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,KAAK,KAAKQ,SAAS,EAAE;IACvBF,KAAK,CAACN,KAAK,GAAGA,KAAK;EACrB;EACA,IAAIC,UAAU,KAAKO,SAAS,EAAE;IAC5BF,KAAK,CAACL,UAAU,GAAGA,UAAU;EAC/B;EACA,IAAIC,SAAS,KAAKM,SAAS,EAAE;IAC3BF,KAAK,CAACJ,SAAS,GAAGA,SAAS;EAC7B;EACA,IAAIC,WAAW,KAAKK,SAAS,EAAE;IAC7BF,KAAK,CAACH,WA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,QAAQ,CAACgE,KAAK,EAAE;IAChCrC,QAAQ,CAACkG,YAAY,CAAC,CAAC;EACzB;AACF,CAAC;AAED,OAAO,MAAMC,KAAK,GAAGA,CAACnG,QAAsB,EAAEoG,IAAY,KAAK;EAC7DA,IAAI,CAAClG,OAAO,CAAEkC,IAAI,IAAK;IACrBD,SAAS,CAACnC,QAAQ,EAAEoC,IAAI,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NodeType","isImageFilter","isShader","sortNodeChildren","processPaint","opacity","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","antiAlias","dither","paint","paintRef","undefined","processCTM","clip","invertClip","transform","origin","matrix","layer","ctm","pushColorFilters","recorder","colorFilters","forEach","colorFilter","children","length","pushColorFilter","type","props","needsComposition","LerpColorFilter","composeColorFilter","pushPathEffects","pathEffects","pathEffect","pushPathEffect","SumPathEffect","composePathEffect","pushImageFilters","imageFilters","imageFilter","pushImageFilter","pushShader","BlendImageFilter","composeImageFilter","pushShaders","shaders","shader","pushMaskFilters","maskFilters","pushBlurMaskFilter","pushPaints","paints","savePaint","restorePaintDeclaration","visitNode","node","Group","saveGroup","drawings","shouldPushPaint","BackdropFilter","saveBackdropFilter","materializePaint","Layer","saveLayer","shouldRestore","saveCTM","Box","shadows","filter","n","BoxShadow","map","drawBox","Fill","drawPaint","Image","drawImage","Circle","drawCircle","Points","drawPoints","Path","drawPath","Rect","drawRect","RRect","drawRRect","Oval","drawOval","Line","drawLine","Patch","drawPatch","Vertices","drawVertices","DiffRect","drawDiffRect","Text","drawText","TextPath","drawTextPath","TextBlob","drawTextBlob","Glyphs","drawGlyphs","Picture","drawPicture","ImageSVG","drawImageSVG","Paragraph","drawParagraph","Skottie","drawSkottie","Atlas","drawAtlas","drawing","restorePaint","restoreCTM","restoreGroup","visit","root"],"sources":["Visitor.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n CTMProps,\n DrawingNodeProps,\n BoxShadowProps,\n} from \"../../dom/types\";\nimport { NodeType } from \"../../dom/types\";\nimport type { BaseRecorder } from \"../../skia/types/Recorder\";\nimport type { Node } from \"../Node\";\nimport { isImageFilter, isShader, sortNodeChildren } from \"../Node\";\n\nexport const processPaint = ({\n opacity,\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n antiAlias,\n dither,\n paint: paintRef,\n}: DrawingNodeProps) => {\n const paint: DrawingNodeProps = {};\n if (opacity !== undefined) {\n paint.opacity = opacity;\n }\n if (color !== undefined) {\n paint.color = color;\n }\n if (strokeWidth !== undefined) {\n paint.strokeWidth = strokeWidth;\n }\n if (blendMode !== undefined) {\n paint.blendMode = blendMode;\n }\n if (style !== undefined) {\n paint.style = style;\n }\n if (strokeJoin !== undefined) {\n paint.strokeJoin = strokeJoin;\n }\n if (strokeCap !== undefined) {\n paint.strokeCap = strokeCap;\n }\n if (strokeMiter !== undefined) {\n paint.strokeMiter = strokeMiter;\n }\n if (antiAlias !== undefined) {\n paint.antiAlias = antiAlias;\n }\n if (dither !== undefined) {\n paint.dither = dither;\n }\n\n if (paintRef !== undefined) {\n paint.paint = paintRef;\n }\n\n if (\n opacity !== undefined ||\n color !== undefined ||\n strokeWidth !== undefined ||\n blendMode !== undefined ||\n style !== undefined ||\n strokeJoin !== undefined ||\n strokeCap !== undefined ||\n strokeMiter !== undefined ||\n antiAlias !== undefined ||\n dither !== undefined ||\n paintRef !== undefined\n ) {\n return paint;\n }\n return null;\n};\n\nconst processCTM = ({\n clip,\n invertClip,\n transform,\n origin,\n matrix,\n layer,\n}: CTMProps) => {\n const ctm: CTMProps = {};\n if (clip) {\n ctm.clip = clip;\n }\n if (invertClip) {\n ctm.invertClip = invertClip;\n }\n if (transform) {\n ctm.transform = transform;\n }\n if (origin) {\n ctm.origin = origin;\n }\n if (matrix) {\n ctm.matrix = matrix;\n }\n if (layer) {\n ctm.layer = layer;\n }\n if (\n clip !== undefined ||\n invertClip !== undefined ||\n transform !== undefined ||\n origin !== undefined ||\n matrix !== undefined ||\n layer !== undefined\n ) {\n return ctm;\n }\n return null;\n};\n\nconst pushColorFilters = (\n recorder: BaseRecorder,\n colorFilters: Node<any>[]\n) => {\n colorFilters.forEach((colorFilter) => {\n if (colorFilter.children.length > 0) {\n pushColorFilters(recorder, colorFilter.children);\n }\n recorder.pushColorFilter(colorFilter.type, colorFilter.props);\n const needsComposition =\n colorFilter.type !== NodeType.LerpColorFilter &&\n colorFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeColorFilter();\n }\n });\n};\n\nconst pushPathEffects = (recorder: BaseRecorder, pathEffects: Node<any>[]) => {\n pathEffects.forEach((pathEffect) => {\n if (pathEffect.children.length > 0) {\n pushPathEffects(recorder, pathEffect.children);\n }\n recorder.pushPathEffect(pathEffect.type, pathEffect.props);\n const needsComposition =\n pathEffect.type !== NodeType.SumPathEffect &&\n pathEffect.children.length > 0;\n if (needsComposition) {\n recorder.composePathEffect();\n }\n });\n};\n\nconst pushImageFilters = (\n recorder: BaseRecorder,\n imageFilters: Node<any>[]\n) => {\n imageFilters.forEach((imageFilter) => {\n if (imageFilter.children.length > 0) {\n pushImageFilters(recorder, imageFilter.children);\n }\n if (isImageFilter(imageFilter.type)) {\n recorder.pushImageFilter(imageFilter.type, imageFilter.props);\n } else if (isShader(imageFilter.type)) {\n recorder.pushShader(imageFilter.type, imageFilter.props);\n }\n const needsComposition =\n imageFilter.type !== NodeType.BlendImageFilter &&\n imageFilter.children.length > 0;\n if (needsComposition) {\n recorder.composeImageFilter();\n }\n });\n};\n\nconst pushShaders = (recorder: BaseRecorder, shaders: Node<any>[]) => {\n shaders.forEach((shader) => {\n if (shader.children.length > 0) {\n pushShaders(recorder, shader.children);\n }\n recorder.pushShader(shader.type, shader.props);\n });\n};\n\nconst pushMaskFilters = (recorder: BaseRecorder, maskFilters: Node<any>[]) => {\n if (maskFilters.length > 0) {\n recorder.pushBlurMaskFilter(maskFilters[maskFilters.length - 1].props);\n }\n};\n\nconst pushPaints = (recorder: BaseRecorder, paints: Node<any>[]) => {\n paints.forEach((paint) => {\n recorder.savePaint(paint.props, true);\n const { colorFilters, maskFilters, shaders, imageFilters, pathEffects } =\n sortNodeChildren(paint);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n recorder.restorePaintDeclaration();\n });\n};\n\nconst visitNode = (recorder: BaseRecorder, node: Node<any>) => {\n if (node.type === NodeType.Group) {\n recorder.saveGroup();\n }\n const { props } = node;\n const {\n colorFilters,\n maskFilters,\n drawings,\n shaders,\n imageFilters,\n pathEffects,\n paints,\n } = sortNodeChildren(node);\n const paint = processPaint(props);\n const shouldPushPaint =\n paint ||\n colorFilters.length > 0 ||\n maskFilters.length > 0 ||\n imageFilters.length > 0 ||\n pathEffects.length > 0 ||\n shaders.length > 0;\n if (shouldPushPaint) {\n recorder.savePaint(paint ?? {}, false);\n pushColorFilters(recorder, colorFilters);\n pushImageFilters(recorder, imageFilters);\n pushMaskFilters(recorder, maskFilters);\n pushShaders(recorder, shaders);\n pushPathEffects(recorder, pathEffects);\n // For mixed nodes like BackdropFilters we don't materialize the paint\n if (node.type === NodeType.BackdropFilter) {\n recorder.saveBackdropFilter();\n } else {\n recorder.materializePaint();\n }\n }\n pushPaints(recorder, paints);\n if (node.type === NodeType.Layer) {\n recorder.saveLayer();\n }\n const ctm = processCTM(props);\n const shouldRestore = !!ctm || node.type === NodeType.Layer;\n if (ctm) {\n recorder.saveCTM(ctm);\n }\n switch (node.type) {\n case NodeType.Box:\n const shadows = node.children\n .filter((n) => n.type === NodeType.BoxShadow)\n // eslint-disable-next-line @typescript-eslint/no-shadow\n .map(({ props }) => ({ props } as { props: BoxShadowProps }));\n recorder.drawBox(props, shadows);\n break;\n case NodeType.Fill:\n recorder.drawPaint();\n break;\n case NodeType.Image:\n recorder.drawImage(props);\n break;\n case NodeType.Circle:\n recorder.drawCircle(props);\n break;\n case NodeType.Points:\n recorder.drawPoints(props);\n break;\n case NodeType.Path:\n recorder.drawPath(props);\n break;\n case NodeType.Rect:\n recorder.drawRect(props);\n break;\n case NodeType.RRect:\n recorder.drawRRect(props);\n break;\n case NodeType.Oval:\n recorder.drawOval(props);\n break;\n case NodeType.Line:\n recorder.drawLine(props);\n break;\n case NodeType.Patch:\n recorder.drawPatch(props);\n break;\n case NodeType.Vertices:\n recorder.drawVertices(props);\n break;\n case NodeType.DiffRect:\n recorder.drawDiffRect(props);\n break;\n case NodeType.Text:\n recorder.drawText(props);\n break;\n case NodeType.TextPath:\n recorder.drawTextPath(props);\n break;\n case NodeType.TextBlob:\n recorder.drawTextBlob(props);\n break;\n case NodeType.Glyphs:\n recorder.drawGlyphs(props);\n break;\n case NodeType.Picture:\n recorder.drawPicture(props);\n break;\n case NodeType.ImageSVG:\n recorder.drawImageSVG(props);\n break;\n case NodeType.Paragraph:\n recorder.drawParagraph(props);\n break;\n case NodeType.Skottie:\n recorder.drawSkottie(props);\n break;\n case NodeType.Atlas:\n recorder.drawAtlas(props);\n break;\n }\n drawings.forEach((drawing) => {\n visitNode(recorder, drawing);\n });\n if (shouldPushPaint) {\n recorder.restorePaint();\n }\n if (shouldRestore) {\n recorder.restoreCTM();\n }\n if (node.type === NodeType.Group) {\n recorder.restoreGroup();\n }\n};\n\nexport const visit = (recorder: BaseRecorder, root: Node[]) => {\n root.forEach((node) => {\n visitNode(recorder, node);\n });\n};\n"],"mappings":"AAAA;;AAMA,SAASA,QAAQ,QAAQ,iBAAiB;AAG1C,SAASC,aAAa,EAAEC,QAAQ,EAAEC,gBAAgB,QAAQ,SAAS;AAEnE,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAC3BC,OAAO;EACPC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,UAAU;EACVC,SAAS;EACTC,WAAW;EACXC,SAAS;EACTC,MAAM;EACNC,KAAK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AACsF,UAAU,CAAC9E,KAAK,CAAC;MAC1B;IACF,KAAKnC,QAAQ,CAACkH,OAAO;MACnBvF,QAAQ,CAACwF,WAAW,CAAChF,KAAK,CAAC;MAC3B;IACF,KAAKnC,QAAQ,CAACoH,QAAQ;MACpBzF,QAAQ,CAAC0F,YAAY,CAAClF,KAAK,CAAC;MAC5B;IACF,KAAKnC,QAAQ,CAACsH,SAAS;MACrB3F,QAAQ,CAAC4F,aAAa,CAACpF,KAAK,CAAC;MAC7B;IACF,KAAKnC,QAAQ,CAACwH,OAAO;MACnB7F,QAAQ,CAAC8F,WAAW,CAACtF,KAAK,CAAC;MAC3B;IACF,KAAKnC,QAAQ,CAAC0H,KAAK;MACjB/F,QAAQ,CAACgG,SAAS,CAACxF,KAAK,CAAC;MACzB;EACJ;EACA+B,QAAQ,CAACrC,OAAO,CAAE+F,OAAO,IAAK;IAC5B9D,SAAS,CAACnC,QAAQ,EAAEiG,OAAO,CAAC;EAC9B,CAAC,CAAC;EACF,IAAIzD,eAAe,EAAE;IACnBxC,QAAQ,CAACkG,YAAY,CAAC,CAAC;EACzB;EACA,IAAIpD,aAAa,EAAE;IACjB9C,QAAQ,CAACmG,UAAU,CAAC,CAAC;EACvB;EACA,IAAI/D,IAAI,CAAC7B,IAAI,KAAKlC,QAAQ,CAACgE,KAAK,EAAE;IAChCrC,QAAQ,CAACoG,YAAY,CAAC,CAAC;EACzB;AACF,CAAC;AAED,OAAO,MAAMC,KAAK,GAAGA,CAACrG,QAAsB,EAAEsG,IAAY,KAAK;EAC7DA,IAAI,CAACpG,OAAO,CAAEkC,IAAI,IAAK;IACrBD,SAAS,CAACnC,QAAQ,EAAEoC,IAAI,CAAC;EAC3B,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { AtlasProps, CircleProps, DiffRectProps, DrawingNodeProps, GlyphsProps, ImageProps, ImageSVGProps, LineProps, OvalProps, ParagraphProps, PatchProps, PathProps, PictureProps, PointsProps, RectProps, RoundedRectProps, TextBlobProps, TextPathProps, TextProps, VerticesProps } from "../../../dom/types";
1
+ import type { AtlasProps, CircleProps, DiffRectProps, GlyphsProps, ImageProps, ImageSVGProps, LineProps, OvalProps, ParagraphProps, PatchProps, PathProps, PictureProps, PointsProps, RectProps, RoundedRectProps, SkottieProps, TextBlobProps, TextPathProps, TextProps, VerticesProps } from "../../../dom/types";
2
2
  import type { DrawingContext } from "../DrawingContext";
3
3
  export declare const drawLine: (ctx: DrawingContext, props: LineProps) => void;
4
4
  export declare const drawOval: (ctx: DrawingContext, props: OvalProps) => void;
@@ -19,4 +19,4 @@ export declare const drawParagraph: (ctx: DrawingContext, props: ParagraphProps)
19
19
  export declare const drawPicture: (ctx: DrawingContext, props: PictureProps) => void;
20
20
  export declare const drawAtlas: (ctx: DrawingContext, props: AtlasProps) => void;
21
21
  export declare const drawCircle: (ctx: DrawingContext, props: CircleProps) => void;
22
- export declare const drawFill: (ctx: DrawingContext, _props: DrawingNodeProps) => void;
22
+ export declare const drawSkottie: (ctx: DrawingContext, props: SkottieProps) => void;
@@ -314,9 +314,16 @@ export const drawCircle = (ctx, props) => {
314
314
  } = props;
315
315
  ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);
316
316
  };
317
- export const drawFill = (ctx, _props) => {
317
+ export const drawSkottie = (ctx, props) => {
318
318
  "worklet";
319
319
 
320
- ctx.canvas.drawPaint(ctx.paint);
320
+ const {
321
+ animation,
322
+ frame
323
+ } = props;
324
+ if (animation) {
325
+ props.animation.seekFrame(frame);
326
+ props.animation.render(ctx.canvas);
327
+ }
321
328
  };
322
329
  //# sourceMappingURL=Drawing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["enumKey","fitRects","processCircle","processColor","processPath","processRect","processRRect","saturate","BlendMode","FillType","FilterMode","isCubicSampling","MipmapMode","PointMode","VertexMode","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawImage","image","sampling","_props$fit","fit","src","dst","width","height","drawImageRectCubic","B","C","_sampling$filter","_sampling$mipmap","drawImageRectOptions","filter","Linear","mipmap","None","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","map","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","outer","inner","drawDRRect","drawTextPath","path","font","initialOffset","text","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","substring","p","t","getPosTan","adjustedX","adjustedY","push","RSXform","derived","TextBlob","MakeFromRSXform","drawTextBlob","drawText","drawPatch","texture","patch","pos","c2","c1","drawPath","start","trimStart","end","trimEnd","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","hasFillType","willMutatePath","pristinePath","copy","setFillType","trim","drawRect","drawRRect","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","save","translate","drawSvg","restore","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawFill","_props","drawPaint"],"sources":["Drawing.ts"],"sourcesContent":["import {\n enumKey,\n fitRects,\n processCircle,\n processColor,\n processPath,\n processRect,\n processRRect,\n} from \"../../../dom/nodes\";\nimport type {\n AtlasProps,\n CircleProps,\n DiffRectProps,\n DrawingNodeProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n OvalProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n TextBlobProps,\n TextPathProps,\n TextProps,\n VerticesProps,\n} from \"../../../dom/types\";\nimport { saturate } from \"../../../renderer/processors\";\nimport type { SkPoint, SkRSXform } from \"../../../skia/types\";\nimport {\n BlendMode,\n FillType,\n FilterMode,\n isCubicSampling,\n MipmapMode,\n PointMode,\n VertexMode,\n} from \"../../../skia/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport const drawLine = (ctx: DrawingContext, props: LineProps) => {\n \"worklet\";\n const { p1, p2 } = props;\n ctx.canvas.drawLine(p1.x, p1.y, p2.x, p2.y, ctx.paint);\n};\n\nexport const drawOval = (ctx: DrawingContext, props: OvalProps) => {\n \"worklet\";\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawImage = (ctx: DrawingContext, props: ImageProps) => {\n \"worklet\";\n const { image, sampling } = props;\n if (image) {\n const fit = props.fit ?? \"contain\";\n const rect = processRect(ctx.Skia, props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n if (sampling && isCubicSampling(sampling)) {\n ctx.canvas.drawImageRectCubic(\n image,\n src,\n dst,\n sampling.B,\n sampling.C,\n ctx.paint\n );\n } else {\n ctx.canvas.drawImageRectOptions(\n image,\n src,\n dst,\n sampling?.filter ?? FilterMode.Linear,\n sampling?.mipmap ?? MipmapMode.None,\n ctx.paint\n );\n }\n }\n};\n\nexport const drawPoints = (ctx: DrawingContext, props: PointsProps) => {\n \"worklet\";\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (ctx: DrawingContext, props: VerticesProps) => {\n \"worklet\";\n const { mode, textures, colors, indices, blendMode } = props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n const vertices = ctx.Skia.MakeVertices(\n vertexMode,\n props.vertices,\n textures,\n colors ? colors.map((c) => processColor(ctx.Skia, c)) : undefined,\n indices\n );\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n\n ctx.canvas.drawVertices(vertices, blend, ctx.paint);\n};\n\nexport const drawDiffRect = (ctx: DrawingContext, props: DiffRectProps) => {\n \"worklet\";\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (ctx: DrawingContext, props: TextPathProps) => {\n \"worklet\";\n const path = processPath(ctx.Skia, props.path);\n const { font, initialOffset } = props;\n if (font) {\n let { text } = props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = ctx.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const [p, t] = cont.getPosTan(dist);\n const adjustedX = p.x - (width / 2) * t.x;\n const adjustedY = p.y - (width / 2) * t.y;\n rsx.push(ctx.Skia.RSXform(t.x, t.y, adjustedX, adjustedY));\n dist += width / 2;\n }\n const derived = ctx.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n ctx.canvas.drawTextBlob(derived, 0, 0, ctx.paint);\n }\n};\n\nexport const drawText = (ctx: DrawingContext, props: TextProps) => {\n \"worklet\";\n const { text, x, y, font } = props;\n if (font != null) {\n ctx.canvas.drawText(text, x, y, ctx.paint, font);\n }\n};\n\nexport const drawPatch = (ctx: DrawingContext, props: PatchProps) => {\n \"worklet\";\n const { texture, blendMode, patch } = props;\n const defaultBlendMode = props.colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n\n const points = [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ];\n const colors = props.colors\n ? props.colors.map((c) => processColor(ctx.Skia, c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: DrawingContext, props: PathProps) => {\n \"worklet\";\n const {\n start: trimStart,\n end: trimEnd,\n fillType,\n stroke,\n ...pathProps\n } = props;\n const start = saturate(trimStart);\n const end = saturate(trimEnd);\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(ctx.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n ctx.canvas.drawPath(path, ctx.paint);\n};\n\nexport const drawRect = (ctx: DrawingContext, props: RectProps) => {\n \"worklet\";\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (ctx: DrawingContext, props: RoundedRectProps) => {\n \"worklet\";\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (ctx: DrawingContext, props: TextBlobProps) => {\n \"worklet\";\n const { blob, x, y } = props;\n ctx.canvas.drawTextBlob(blob, x, y, ctx.paint);\n};\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport const drawGlyphs = (ctx: DrawingContext, props: GlyphsProps) => {\n \"worklet\";\n const derived = props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n const { glyphs, positions } = derived;\n const { x, y, font } = props;\n if (font) {\n ctx.canvas.drawGlyphs(glyphs, positions, x, y, font, ctx.paint);\n }\n};\n\nexport const drawImageSVG = (ctx: DrawingContext, props: ImageSVGProps) => {\n \"worklet\";\n const { canvas } = ctx;\n const { svg } = props;\n const { x, y, width, height } = props.rect\n ? props.rect\n : { x: props.x, y: props.y, width: props.width, height: props.height };\n if (svg === null) {\n return;\n }\n canvas.save();\n if (x && y) {\n canvas.translate(x, y);\n }\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n};\n\nexport const drawParagraph = (ctx: DrawingContext, props: ParagraphProps) => {\n \"worklet\";\n const { paragraph, x, y, width } = props;\n if (paragraph) {\n paragraph.layout(width);\n paragraph.paint(ctx.canvas, x, y);\n }\n};\n\nexport const drawPicture = (ctx: DrawingContext, props: PictureProps) => {\n \"worklet\";\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: DrawingContext, props: AtlasProps) => {\n \"worklet\";\n const { image, sprites, transforms, colors, blendMode, sampling } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(\n image,\n sprites,\n transforms,\n ctx.paint,\n blend,\n colors,\n sampling\n );\n }\n};\n\nexport const drawCircle = (ctx: DrawingContext, props: CircleProps) => {\n \"worklet\";\n const { c } = processCircle(props);\n const { r } = props;\n ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);\n};\n\nexport const drawFill = (ctx: DrawingContext, _props: DrawingNodeProps) => {\n \"worklet\";\n ctx.canvas.drawPaint(ctx.paint);\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,QAAQ,EACRC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,oBAAoB;AAuB3B,SAASC,QAAQ,QAAQ,8BAA8B;AAEvD,SACEC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,eAAe,EACfC,UAAU,EACVC,SAAS,EACTC,UAAU,QACL,qBAAqB;AAG5B,OAAO,MAAMC,QAAQ,G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AAM,CAAC2H,SAAS,CAClBnH,KAAK,EACLoH,OAAO,EACPC,UAAU,EACVjI,GAAG,CAACO,KAAK,EACTyC,KAAK,EACLb,MAAM,EACNtB,QACF,CAAC;EACH;AACF,CAAC;AAED,OAAO,MAAMqH,UAAU,GAAGA,CAAClI,GAAmB,EAAEC,KAAkB,KAAK;EACrE,SAAS;;EACT,MAAM;IAAE0C;EAAE,CAAC,GAAGzD,aAAa,CAACe,KAAK,CAAC;EAClC,MAAM;IAAEkI;EAAE,CAAC,GAAGlI,KAAK;EACnBD,GAAG,CAACI,MAAM,CAAC8H,UAAU,CAACvF,CAAC,CAACtC,CAAC,EAAEsC,CAAC,CAACrC,CAAC,EAAE6H,CAAC,EAAEnI,GAAG,CAACO,KAAK,CAAC;AAC/C,CAAC;AAED,OAAO,MAAM6H,QAAQ,GAAGA,CAACpI,GAAmB,EAAEqI,MAAwB,KAAK;EACzE,SAAS;;EACTrI,GAAG,CAACI,MAAM,CAACkI,SAAS,CAACtI,GAAG,CAACO,KAAK,CAAC;AACjC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["enumKey","fitRects","processCircle","processColor","processPath","processRect","processRRect","saturate","BlendMode","FillType","FilterMode","isCubicSampling","MipmapMode","PointMode","VertexMode","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawImage","image","sampling","_props$fit","fit","src","dst","width","height","drawImageRectCubic","B","C","_sampling$filter","_sampling$mipmap","drawImageRectOptions","filter","Linear","mipmap","None","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","map","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","outer","inner","drawDRRect","drawTextPath","path","font","initialOffset","text","ids","getGlyphIDs","widths","getGlyphWidths","rsx","meas","ContourMeasureIter","cont","next","dist","i","length","substring","p","t","getPosTan","adjustedX","adjustedY","push","RSXform","derived","TextBlob","MakeFromRSXform","drawTextBlob","drawText","drawPatch","texture","patch","pos","c2","c1","drawPath","start","trimStart","end","trimEnd","fillType","stroke","pathProps","hasStartOffset","hasEndOffset","hasStrokeOptions","hasFillType","willMutatePath","pristinePath","copy","setFillType","trim","drawRect","drawRRect","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","save","translate","drawSvg","restore","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawSkottie","animation","frame","seekFrame","render"],"sources":["Drawing.ts"],"sourcesContent":["import {\n enumKey,\n fitRects,\n processCircle,\n processColor,\n processPath,\n processRect,\n processRRect,\n} from \"../../../dom/nodes\";\nimport type {\n AtlasProps,\n CircleProps,\n DiffRectProps,\n GlyphsProps,\n ImageProps,\n ImageSVGProps,\n LineProps,\n OvalProps,\n ParagraphProps,\n PatchProps,\n PathProps,\n PictureProps,\n PointsProps,\n RectProps,\n RoundedRectProps,\n SkottieProps,\n TextBlobProps,\n TextPathProps,\n TextProps,\n VerticesProps,\n} from \"../../../dom/types\";\nimport { saturate } from \"../../../renderer/processors\";\nimport type { SkPoint, SkRSXform } from \"../../../skia/types\";\nimport {\n BlendMode,\n FillType,\n FilterMode,\n isCubicSampling,\n MipmapMode,\n PointMode,\n VertexMode,\n} from \"../../../skia/types\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport const drawLine = (ctx: DrawingContext, props: LineProps) => {\n \"worklet\";\n const { p1, p2 } = props;\n ctx.canvas.drawLine(p1.x, p1.y, p2.x, p2.y, ctx.paint);\n};\n\nexport const drawOval = (ctx: DrawingContext, props: OvalProps) => {\n \"worklet\";\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawImage = (ctx: DrawingContext, props: ImageProps) => {\n \"worklet\";\n const { image, sampling } = props;\n if (image) {\n const fit = props.fit ?? \"contain\";\n const rect = processRect(ctx.Skia, props);\n const { src, dst } = fitRects(\n fit,\n {\n x: 0,\n y: 0,\n width: image.width(),\n height: image.height(),\n },\n rect\n );\n if (sampling && isCubicSampling(sampling)) {\n ctx.canvas.drawImageRectCubic(\n image,\n src,\n dst,\n sampling.B,\n sampling.C,\n ctx.paint\n );\n } else {\n ctx.canvas.drawImageRectOptions(\n image,\n src,\n dst,\n sampling?.filter ?? FilterMode.Linear,\n sampling?.mipmap ?? MipmapMode.None,\n ctx.paint\n );\n }\n }\n};\n\nexport const drawPoints = (ctx: DrawingContext, props: PointsProps) => {\n \"worklet\";\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (ctx: DrawingContext, props: VerticesProps) => {\n \"worklet\";\n const { mode, textures, colors, indices, blendMode } = props;\n const vertexMode = mode ? VertexMode[enumKey(mode)] : VertexMode.Triangles;\n const vertices = ctx.Skia.MakeVertices(\n vertexMode,\n props.vertices,\n textures,\n colors ? colors.map((c) => processColor(ctx.Skia, c)) : undefined,\n indices\n );\n const defaultBlendMode = colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n\n ctx.canvas.drawVertices(vertices, blend, ctx.paint);\n};\n\nexport const drawDiffRect = (ctx: DrawingContext, props: DiffRectProps) => {\n \"worklet\";\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (ctx: DrawingContext, props: TextPathProps) => {\n \"worklet\";\n const path = processPath(ctx.Skia, props.path);\n const { font, initialOffset } = props;\n if (font) {\n let { text } = props;\n const ids = font.getGlyphIDs(text);\n const widths = font.getGlyphWidths(ids);\n const rsx: SkRSXform[] = [];\n const meas = ctx.Skia.ContourMeasureIter(path, false, 1);\n let cont = meas.next();\n let dist = initialOffset;\n for (let i = 0; i < text.length && cont; i++) {\n const width = widths[i];\n dist += width / 2;\n if (dist > cont.length()) {\n // jump to next contour\n cont = meas.next();\n if (!cont) {\n // We have come to the end of the path - terminate the string\n // right here.\n text = text.substring(0, i);\n break;\n }\n dist = width / 2;\n }\n // Gives us the (x, y) coordinates as well as the cos/sin of the tangent\n // line at that position.\n const [p, t] = cont.getPosTan(dist);\n const adjustedX = p.x - (width / 2) * t.x;\n const adjustedY = p.y - (width / 2) * t.y;\n rsx.push(ctx.Skia.RSXform(t.x, t.y, adjustedX, adjustedY));\n dist += width / 2;\n }\n const derived = ctx.Skia.TextBlob.MakeFromRSXform(text, rsx, font);\n ctx.canvas.drawTextBlob(derived, 0, 0, ctx.paint);\n }\n};\n\nexport const drawText = (ctx: DrawingContext, props: TextProps) => {\n \"worklet\";\n const { text, x, y, font } = props;\n if (font != null) {\n ctx.canvas.drawText(text, x, y, ctx.paint, font);\n }\n};\n\nexport const drawPatch = (ctx: DrawingContext, props: PatchProps) => {\n \"worklet\";\n const { texture, blendMode, patch } = props;\n const defaultBlendMode = props.colors ? BlendMode.DstOver : BlendMode.SrcOver;\n const mode = blendMode ? BlendMode[enumKey(blendMode)] : defaultBlendMode;\n // Patch requires a path with the following constraints:\n // M tl\n // C c1 c2 br\n // C c1 c2 bl\n // C c1 c2 tl (the redundant point in the last command is removed)\n\n const points = [\n patch[0].pos,\n patch[0].c2,\n patch[1].c1,\n patch[1].pos,\n patch[1].c2,\n patch[2].c1,\n patch[2].pos,\n patch[2].c2,\n patch[3].c1,\n patch[3].pos,\n patch[3].c2,\n patch[0].c1,\n ];\n const colors = props.colors\n ? props.colors.map((c) => processColor(ctx.Skia, c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: DrawingContext, props: PathProps) => {\n \"worklet\";\n const {\n start: trimStart,\n end: trimEnd,\n fillType,\n stroke,\n ...pathProps\n } = props;\n const start = saturate(trimStart);\n const end = saturate(trimEnd);\n const hasStartOffset = start !== 0;\n const hasEndOffset = end !== 1;\n const hasStrokeOptions = stroke !== undefined;\n const hasFillType = !!fillType;\n const willMutatePath =\n hasStartOffset || hasEndOffset || hasStrokeOptions || hasFillType;\n const pristinePath = processPath(ctx.Skia, pathProps.path);\n const path = willMutatePath ? pristinePath.copy() : pristinePath;\n if (hasFillType) {\n path.setFillType(FillType[enumKey(fillType)]);\n }\n if (hasStrokeOptions) {\n path.stroke(stroke);\n }\n if (hasStartOffset || hasEndOffset) {\n path.trim(start, end, false);\n }\n ctx.canvas.drawPath(path, ctx.paint);\n};\n\nexport const drawRect = (ctx: DrawingContext, props: RectProps) => {\n \"worklet\";\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (ctx: DrawingContext, props: RoundedRectProps) => {\n \"worklet\";\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (ctx: DrawingContext, props: TextBlobProps) => {\n \"worklet\";\n const { blob, x, y } = props;\n ctx.canvas.drawTextBlob(blob, x, y, ctx.paint);\n};\n\ninterface ProcessedGlyphs {\n glyphs: number[];\n positions: SkPoint[];\n}\n\nexport const drawGlyphs = (ctx: DrawingContext, props: GlyphsProps) => {\n \"worklet\";\n const derived = props.glyphs.reduce<ProcessedGlyphs>(\n (acc, glyph) => {\n const { id, pos } = glyph;\n acc.glyphs.push(id);\n acc.positions.push(pos);\n return acc;\n },\n { glyphs: [], positions: [] }\n );\n const { glyphs, positions } = derived;\n const { x, y, font } = props;\n if (font) {\n ctx.canvas.drawGlyphs(glyphs, positions, x, y, font, ctx.paint);\n }\n};\n\nexport const drawImageSVG = (ctx: DrawingContext, props: ImageSVGProps) => {\n \"worklet\";\n const { canvas } = ctx;\n const { svg } = props;\n const { x, y, width, height } = props.rect\n ? props.rect\n : { x: props.x, y: props.y, width: props.width, height: props.height };\n if (svg === null) {\n return;\n }\n canvas.save();\n if (x && y) {\n canvas.translate(x, y);\n }\n canvas.drawSvg(svg, width, height);\n canvas.restore();\n};\n\nexport const drawParagraph = (ctx: DrawingContext, props: ParagraphProps) => {\n \"worklet\";\n const { paragraph, x, y, width } = props;\n if (paragraph) {\n paragraph.layout(width);\n paragraph.paint(ctx.canvas, x, y);\n }\n};\n\nexport const drawPicture = (ctx: DrawingContext, props: PictureProps) => {\n \"worklet\";\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: DrawingContext, props: AtlasProps) => {\n \"worklet\";\n const { image, sprites, transforms, colors, blendMode, sampling } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(\n image,\n sprites,\n transforms,\n ctx.paint,\n blend,\n colors,\n sampling\n );\n }\n};\n\nexport const drawCircle = (ctx: DrawingContext, props: CircleProps) => {\n \"worklet\";\n const { c } = processCircle(props);\n const { r } = props;\n ctx.canvas.drawCircle(c.x, c.y, r, ctx.paint);\n};\n\nexport const drawSkottie = (ctx: DrawingContext, props: SkottieProps) => {\n \"worklet\";\n const { animation, frame } = props;\n if (animation) {\n props.animation.seekFrame(frame);\n props.animation.render(ctx.canvas);\n }\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,QAAQ,EACRC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,oBAAoB;AAuB3B,SAASC,QAAQ,QAAQ,8BAA8B;AAEvD,SACEC,SAAS,EACTC,QAAQ,EACRC,UAAU,EACVC,eAAe,EACfC,UAAU,EACVC,SAAS,EACTC,UAAU,QACL,qBAAqB;AAG5B,OAAO,MAAMC,QAAQ,GAAGA,CAACC,GAAmB,EAAEC,KAAgB,KAAK;EACjE,SAAS;;EACT,MAAM;IAAEC,EAAE;IAAEC;EAAG,CAAC,GAAGF,KAAK;EACxBD,GAAG,CAACI,MAAM,CAACL,QAAQ,CAACG,EAAE,CAACG,CAAC,EAAEH,EAAE,CAACI,CAAC,EAAEH,EAAE,CAACE,CAAC,EAAEF,EAAE,CAACG,CAAC,EAAEN,GAAG,CAACO,KAAK,CAAC;AACxD,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAGA,C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lI,KAAK;EACnBD,GAAG,CAACI,MAAM,CAAC8H,UAAU,CAACvF,CAAC,CAACtC,CAAC,EAAEsC,CAAC,CAACrC,CAAC,EAAE6H,CAAC,EAAEnI,GAAG,CAACO,KAAK,CAAC;AAC/C,CAAC;AAED,OAAO,MAAM6H,WAAW,GAAGA,CAACpI,GAAmB,EAAEC,KAAmB,KAAK;EACvE,SAAS;;EACT,MAAM;IAAEoI,SAAS;IAAEC;EAAM,CAAC,GAAGrI,KAAK;EAClC,IAAIoI,SAAS,EAAE;IACbpI,KAAK,CAACoI,SAAS,CAACE,SAAS,CAACD,KAAK,CAAC;IAChCrI,KAAK,CAACoI,SAAS,CAACG,MAAM,CAACxI,GAAG,CAACI,MAAM,CAAC;EACpC;AACF,CAAC","ignoreList":[]}
@@ -101,7 +101,7 @@ const declareDisplacementMapImageFilter = (ctx, props) => {
101
101
  if (!shader) {
102
102
  throw new Error("DisplacementMap expects a shader as child");
103
103
  }
104
- const map = ctx.Skia.ImageFilter.MakeShader(shader, null);
104
+ const map = ctx.Skia.ImageFilter.MakeShader(shader);
105
105
  const imgf = ctx.Skia.ImageFilter.MakeDisplacementMap(ColorChannel[enumKey(channelX)], ColorChannel[enumKey(channelY)], scale, map, null);
106
106
  ctx.imageFilters.push(imgf);
107
107
  };
@@ -1 +1 @@
1
- {"version":3,"names":["enumKey","processColor","processRadius","NodeType","BlendMode","BlurStyle","ColorChannel","processUniforms","TileMode","composeDeclarations","CommandType","MorphologyOperator","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","declareBlurImageFilter","ctx","props","mode","blur","sigma","imgf","x","y","imageFilters","push","declareMorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","declareOffsetImageFilter","declareDropShadowImageFilter","cl","inner","factory","bind","MakeDropShadowOnly","MakeDropShadow","declareBlendImageFilter","blend","splice","length","composer","declareDisplacementMapImageFilter","channelX","channelY","scale","shader","shaders","pop","Error","map","MakeShader","MakeDisplacementMap","declareRuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader","composeImageFilters","outer","setBlurMaskFilter","style","respectCTM","mf","MaskFilter","paint","setMaskFilter","isPushImageFilter","command","type","PushImageFilter","isImageFilter","imageFilterType","pushImageFilter","BlurImageFilter","MorphologyImageFilter","BlendImageFilter","DisplacementMapImageFilter","DropShadowImageFilter","OffsetImageFilter","RuntimeShaderImageFilter"],"sources":["ImageFilters.ts"],"sourcesContent":["import { enumKey, processColor, processRadius } from \"../../../dom/nodes\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n BlurMaskFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../../dom/types\";\nimport { NodeType } from \"../../../dom/types\";\nimport type { SkColor, SkImageFilter, Skia } from \"../../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport { composeDeclarations } from \"../../utils\";\nimport type { Command } from \"../Core\";\nimport { CommandType } from \"../Core\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n \"worklet\";\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nconst declareBlurImageFilter = (\n ctx: DrawingContext,\n props: BlurImageFilterProps\n) => {\n \"worklet\";\n const { mode, blur } = props;\n const sigma = processRadius(ctx.Skia, blur);\n const imgf = ctx.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n null\n );\n ctx.imageFilters.push(imgf);\n};\n\nconst declareMorphologyImageFilter = (\n ctx: DrawingContext,\n props: MorphologyImageFilterProps\n) => {\n \"worklet\";\n const { operator } = props;\n const r = processRadius(ctx.Skia, props.radius);\n let imgf;\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n imgf = ctx.Skia.ImageFilter.MakeErode(r.x, r.y, null);\n } else {\n imgf = ctx.Skia.ImageFilter.MakeDilate(r.x, r.y, null);\n }\n ctx.imageFilters.push(imgf);\n};\n\nconst declareOffsetImageFilter = (\n ctx: DrawingContext,\n props: OffsetImageFilterProps\n) => {\n \"worklet\";\n const { x, y } = props;\n const imgf = ctx.Skia.ImageFilter.MakeOffset(x, y, null);\n ctx.imageFilters.push(imgf);\n};\n\nconst declareDropShadowImageFilter = (\n ctx: DrawingContext,\n props: DropShadowImageFilterProps\n) => {\n \"worklet\";\n const { dx, dy, blur, shadowOnly, color: cl, inner } = props;\n const color = processColor(ctx.Skia, cl);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, ctx.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? ctx.Skia.ImageFilter.MakeDropShadowOnly.bind(ctx.Skia.ImageFilter)\n : ctx.Skia.ImageFilter.MakeDropShadow.bind(ctx.Skia.ImageFilter);\n }\n const imgf = factory(dx, dy, blur, blur, color, null);\n ctx.imageFilters.push(imgf);\n};\n\nconst declareBlendImageFilter = (\n ctx: DrawingContext,\n props: BlendImageFilterProps\n) => {\n \"worklet\";\n const blend = BlendMode[enumKey(props.mode)];\n // Blend ImageFilters\n const imageFilters = ctx.imageFilters.splice(0, ctx.imageFilters.length);\n const composer = ctx.Skia.ImageFilter.MakeBlend.bind(\n ctx.Skia.ImageFilter,\n blend\n );\n ctx.imageFilters.push(composeDeclarations(imageFilters, composer));\n};\n\nconst declareDisplacementMapImageFilter = (\n ctx: DrawingContext,\n props: DisplacementMapImageFilterProps\n) => {\n \"worklet\";\n const { channelX, channelY, scale } = props;\n const shader = ctx.shaders.pop();\n if (!shader) {\n throw new Error(\"DisplacementMap expects a shader as child\");\n }\n const map = ctx.Skia.ImageFilter.MakeShader(shader, null);\n const imgf = ctx.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n map,\n null\n );\n ctx.imageFilters.push(imgf);\n};\n\nconst declareRuntimeShaderImageFilter = (\n ctx: DrawingContext,\n props: RuntimeShaderImageFilterProps\n) => {\n \"worklet\";\n const { source, uniforms } = props;\n const rtb = ctx.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const imgf = ctx.Skia.ImageFilter.MakeRuntimeShader(rtb, null, null);\n ctx.imageFilters.push(imgf);\n};\n\nexport const composeImageFilters = (ctx: DrawingContext) => {\n \"worklet\";\n if (ctx.imageFilters.length > 1) {\n const outer = ctx.imageFilters.pop()!;\n const inner = ctx.imageFilters.pop()!;\n ctx.imageFilters.push(ctx.Skia.ImageFilter.MakeCompose(outer, inner));\n }\n};\n\nexport const setBlurMaskFilter = (\n ctx: DrawingContext,\n props: BlurMaskFilterProps\n) => {\n \"worklet\";\n const { blur, style, respectCTM } = props;\n const mf = ctx.Skia.MaskFilter.MakeBlur(\n BlurStyle[enumKey(style)],\n blur,\n respectCTM\n );\n ctx.paint.setMaskFilter(mf);\n};\n\nexport const isPushImageFilter = (\n command: Command\n): command is Command<CommandType.PushImageFilter> => {\n \"worklet\";\n return command.type === CommandType.PushImageFilter;\n};\n\ntype Props = {\n [NodeType.OffsetImageFilter]: OffsetImageFilterProps;\n [NodeType.DisplacementMapImageFilter]: DisplacementMapImageFilterProps;\n [NodeType.BlurImageFilter]: BlurImageFilterProps;\n [NodeType.DropShadowImageFilter]: DropShadowImageFilterProps;\n [NodeType.MorphologyImageFilter]: MorphologyImageFilterProps;\n [NodeType.BlendImageFilter]: BlendImageFilterProps;\n [NodeType.RuntimeShaderImageFilter]: RuntimeShaderImageFilterProps;\n};\n\ninterface PushImageFilter<T extends keyof Props>\n extends Command<CommandType.PushImageFilter> {\n imageFilterType: T;\n props: Props[T];\n}\n\nconst isImageFilter = <T extends keyof Props>(\n command: Command<CommandType.PushImageFilter>,\n type: T\n): command is PushImageFilter<T> => {\n \"worklet\";\n return command.imageFilterType === type;\n};\n\nexport const pushImageFilter = (\n ctx: DrawingContext,\n command: Command<CommandType.PushImageFilter>\n) => {\n \"worklet\";\n if (isImageFilter(command, NodeType.BlurImageFilter)) {\n declareBlurImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.MorphologyImageFilter)) {\n declareMorphologyImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.BlendImageFilter)) {\n declareBlendImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.DisplacementMapImageFilter)) {\n declareDisplacementMapImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.DropShadowImageFilter)) {\n declareDropShadowImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.OffsetImageFilter)) {\n declareOffsetImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.RuntimeShaderImageFilter)) {\n declareRuntimeShaderImageFilter(ctx, command.props);\n } else {\n throw new Error(\"Invalid image filter type: \" + command.imageFilterType);\n }\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,YAAY,EAAEC,aAAa,QAAQ,oBAAoB;AAWzE,SAASC,QAAQ,QAAQ,oBAAoB;AAE7C,SACEC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,eAAe,EACfC,QAAQ,QACH,qBAAqB;AAC5B,SAASC,mBAAmB,QAAQ,aAAa;AAEjD,SAASC,WAAW,QAAQ,SAAS;AAGrC,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAK9B,MAAMC,KAAK,GAAGC,YAAY,CAACC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAEzC,MAAMC,eAAe,GAAGA,CACtBC,IAAU,EACVC,UAA+B,EAC/BC,EAAU,EACVC,EAAU,EACVC,MAAc,EACdC,MAAc,EACdC,KAAc,EACdC,KAA2B,KACxB;EACH,SAAS;;EACT,MAAMC,aAAa,GAAGR,IAAI,CAACS,WAAW,CAACC,eAAe,CACpDV,IAAI,CAACW,WAAW,CAACC,SAAS,CAAChB,KAAK,EAAER,SAAS,CAACyB,GAAG,CAAC,EAChD,IACF,CAAC;EACD,MAAMC,WAAW,GAAGd,IAAI,CAACS,WAAW,CAACC,eAAe,CAClDV,IAAI,CAACW,WAAW,CAACC,SAAS,CAAChB,KAAK,EAAER,SAAS,CAAC2B,KAAK,CAAC,EAClD,IACF,CAAC;EACD,MAAMC,EAAE,GAAGhB,IAAI,CAACS,WAAW,CAACC,eAAe,CACzCV,IAAI,CAACW,WAAW,CAACC,SAAS,CAACN,KAAK,EAAElB,SAAS,CAAC6B,MAAM,CAAC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AO,CAACxD,KAAK,CAAC;EAClD,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAACyG,gBAAgB,CAAC,EAAE;IAC5DxC,uBAAuB,CAACzB,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAC7C,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC0G,0BAA0B,CAAC,EAAE;IACtEpC,iCAAiC,CAAC9B,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EACvD,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC2G,qBAAqB,CAAC,EAAE;IACjEjD,4BAA4B,CAAClB,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAClD,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC4G,iBAAiB,CAAC,EAAE;IAC7DnD,wBAAwB,CAACjB,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAC9C,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC6G,wBAAwB,CAAC,EAAE;IACpE5B,+BAA+B,CAACzC,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EACrD,CAAC,MAAM;IACL,MAAM,IAAIoC,KAAK,CAAC,6BAA6B,GAAGoB,OAAO,CAACI,eAAe,CAAC;EAC1E;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["enumKey","processColor","processRadius","NodeType","BlendMode","BlurStyle","ColorChannel","processUniforms","TileMode","composeDeclarations","CommandType","MorphologyOperator","Black","Float32Array","of","MakeInnerShadow","Skia","shadowOnly","dx","dy","sigmaX","sigmaY","color","input","sourceGraphic","ImageFilter","MakeColorFilter","ColorFilter","MakeBlend","Dst","sourceAlpha","SrcIn","f1","SrcOut","f2","MakeOffset","f3","MakeBlur","Decal","f4","MakeCompose","SrcOver","declareBlurImageFilter","ctx","props","mode","blur","sigma","imgf","x","y","imageFilters","push","declareMorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","declareOffsetImageFilter","declareDropShadowImageFilter","cl","inner","factory","bind","MakeDropShadowOnly","MakeDropShadow","declareBlendImageFilter","blend","splice","length","composer","declareDisplacementMapImageFilter","channelX","channelY","scale","shader","shaders","pop","Error","map","MakeShader","MakeDisplacementMap","declareRuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader","composeImageFilters","outer","setBlurMaskFilter","style","respectCTM","mf","MaskFilter","paint","setMaskFilter","isPushImageFilter","command","type","PushImageFilter","isImageFilter","imageFilterType","pushImageFilter","BlurImageFilter","MorphologyImageFilter","BlendImageFilter","DisplacementMapImageFilter","DropShadowImageFilter","OffsetImageFilter","RuntimeShaderImageFilter"],"sources":["ImageFilters.ts"],"sourcesContent":["import { enumKey, processColor, processRadius } from \"../../../dom/nodes\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n BlurMaskFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../../dom/types\";\nimport { NodeType } from \"../../../dom/types\";\nimport type { SkColor, SkImageFilter, Skia } from \"../../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport { composeDeclarations } from \"../../utils\";\nimport type { Command } from \"../Core\";\nimport { CommandType } from \"../Core\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nexport enum MorphologyOperator {\n Erode,\n Dilate,\n}\n\nconst Black = Float32Array.of(0, 0, 0, 1);\n\nconst MakeInnerShadow = (\n Skia: Skia,\n shadowOnly: boolean | undefined,\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null\n) => {\n \"worklet\";\n const sourceGraphic = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst),\n null\n );\n const sourceAlpha = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),\n null\n );\n const f1 = Skia.ImageFilter.MakeColorFilter(\n Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),\n null\n );\n const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);\n const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);\n const f4 = Skia.ImageFilter.MakeBlend(BlendMode.SrcIn, sourceAlpha, f3);\n if (shadowOnly) {\n return f4;\n }\n return Skia.ImageFilter.MakeCompose(\n input,\n Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4)\n );\n};\n\nconst declareBlurImageFilter = (\n ctx: DrawingContext,\n props: BlurImageFilterProps\n) => {\n \"worklet\";\n const { mode, blur } = props;\n const sigma = processRadius(ctx.Skia, blur);\n const imgf = ctx.Skia.ImageFilter.MakeBlur(\n sigma.x,\n sigma.y,\n TileMode[enumKey(mode)],\n null\n );\n ctx.imageFilters.push(imgf);\n};\n\nconst declareMorphologyImageFilter = (\n ctx: DrawingContext,\n props: MorphologyImageFilterProps\n) => {\n \"worklet\";\n const { operator } = props;\n const r = processRadius(ctx.Skia, props.radius);\n let imgf;\n if (MorphologyOperator[enumKey(operator)] === MorphologyOperator.Erode) {\n imgf = ctx.Skia.ImageFilter.MakeErode(r.x, r.y, null);\n } else {\n imgf = ctx.Skia.ImageFilter.MakeDilate(r.x, r.y, null);\n }\n ctx.imageFilters.push(imgf);\n};\n\nconst declareOffsetImageFilter = (\n ctx: DrawingContext,\n props: OffsetImageFilterProps\n) => {\n \"worklet\";\n const { x, y } = props;\n const imgf = ctx.Skia.ImageFilter.MakeOffset(x, y, null);\n ctx.imageFilters.push(imgf);\n};\n\nconst declareDropShadowImageFilter = (\n ctx: DrawingContext,\n props: DropShadowImageFilterProps\n) => {\n \"worklet\";\n const { dx, dy, blur, shadowOnly, color: cl, inner } = props;\n const color = processColor(ctx.Skia, cl);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, ctx.Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? ctx.Skia.ImageFilter.MakeDropShadowOnly.bind(ctx.Skia.ImageFilter)\n : ctx.Skia.ImageFilter.MakeDropShadow.bind(ctx.Skia.ImageFilter);\n }\n const imgf = factory(dx, dy, blur, blur, color, null);\n ctx.imageFilters.push(imgf);\n};\n\nconst declareBlendImageFilter = (\n ctx: DrawingContext,\n props: BlendImageFilterProps\n) => {\n \"worklet\";\n const blend = BlendMode[enumKey(props.mode)];\n // Blend ImageFilters\n const imageFilters = ctx.imageFilters.splice(0, ctx.imageFilters.length);\n const composer = ctx.Skia.ImageFilter.MakeBlend.bind(\n ctx.Skia.ImageFilter,\n blend\n );\n ctx.imageFilters.push(composeDeclarations(imageFilters, composer));\n};\n\nconst declareDisplacementMapImageFilter = (\n ctx: DrawingContext,\n props: DisplacementMapImageFilterProps\n) => {\n \"worklet\";\n const { channelX, channelY, scale } = props;\n const shader = ctx.shaders.pop();\n if (!shader) {\n throw new Error(\"DisplacementMap expects a shader as child\");\n }\n const map = ctx.Skia.ImageFilter.MakeShader(shader);\n const imgf = ctx.Skia.ImageFilter.MakeDisplacementMap(\n ColorChannel[enumKey(channelX)],\n ColorChannel[enumKey(channelY)],\n scale,\n map,\n null\n );\n ctx.imageFilters.push(imgf);\n};\n\nconst declareRuntimeShaderImageFilter = (\n ctx: DrawingContext,\n props: RuntimeShaderImageFilterProps\n) => {\n \"worklet\";\n const { source, uniforms } = props;\n const rtb = ctx.Skia.RuntimeShaderBuilder(source);\n if (uniforms) {\n processUniforms(source, uniforms, rtb);\n }\n const imgf = ctx.Skia.ImageFilter.MakeRuntimeShader(rtb, null, null);\n ctx.imageFilters.push(imgf);\n};\n\nexport const composeImageFilters = (ctx: DrawingContext) => {\n \"worklet\";\n if (ctx.imageFilters.length > 1) {\n const outer = ctx.imageFilters.pop()!;\n const inner = ctx.imageFilters.pop()!;\n ctx.imageFilters.push(ctx.Skia.ImageFilter.MakeCompose(outer, inner));\n }\n};\n\nexport const setBlurMaskFilter = (\n ctx: DrawingContext,\n props: BlurMaskFilterProps\n) => {\n \"worklet\";\n const { blur, style, respectCTM } = props;\n const mf = ctx.Skia.MaskFilter.MakeBlur(\n BlurStyle[enumKey(style)],\n blur,\n respectCTM\n );\n ctx.paint.setMaskFilter(mf);\n};\n\nexport const isPushImageFilter = (\n command: Command\n): command is Command<CommandType.PushImageFilter> => {\n \"worklet\";\n return command.type === CommandType.PushImageFilter;\n};\n\ntype Props = {\n [NodeType.OffsetImageFilter]: OffsetImageFilterProps;\n [NodeType.DisplacementMapImageFilter]: DisplacementMapImageFilterProps;\n [NodeType.BlurImageFilter]: BlurImageFilterProps;\n [NodeType.DropShadowImageFilter]: DropShadowImageFilterProps;\n [NodeType.MorphologyImageFilter]: MorphologyImageFilterProps;\n [NodeType.BlendImageFilter]: BlendImageFilterProps;\n [NodeType.RuntimeShaderImageFilter]: RuntimeShaderImageFilterProps;\n};\n\ninterface PushImageFilter<T extends keyof Props>\n extends Command<CommandType.PushImageFilter> {\n imageFilterType: T;\n props: Props[T];\n}\n\nconst isImageFilter = <T extends keyof Props>(\n command: Command<CommandType.PushImageFilter>,\n type: T\n): command is PushImageFilter<T> => {\n \"worklet\";\n return command.imageFilterType === type;\n};\n\nexport const pushImageFilter = (\n ctx: DrawingContext,\n command: Command<CommandType.PushImageFilter>\n) => {\n \"worklet\";\n if (isImageFilter(command, NodeType.BlurImageFilter)) {\n declareBlurImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.MorphologyImageFilter)) {\n declareMorphologyImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.BlendImageFilter)) {\n declareBlendImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.DisplacementMapImageFilter)) {\n declareDisplacementMapImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.DropShadowImageFilter)) {\n declareDropShadowImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.OffsetImageFilter)) {\n declareOffsetImageFilter(ctx, command.props);\n } else if (isImageFilter(command, NodeType.RuntimeShaderImageFilter)) {\n declareRuntimeShaderImageFilter(ctx, command.props);\n } else {\n throw new Error(\"Invalid image filter type: \" + command.imageFilterType);\n }\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,YAAY,EAAEC,aAAa,QAAQ,oBAAoB;AAWzE,SAASC,QAAQ,QAAQ,oBAAoB;AAE7C,SACEC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,eAAe,EACfC,QAAQ,QACH,qBAAqB;AAC5B,SAASC,mBAAmB,QAAQ,aAAa;AAEjD,SAASC,WAAW,QAAQ,SAAS;AAGrC,WAAYC,kBAAkB,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA;AAK9B,MAAMC,KAAK,GAAGC,YAAY,CAACC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAEzC,MAAMC,eAAe,GAAGA,CACtBC,IAAU,EACVC,UAA+B,EAC/BC,EAAU,EACVC,EAAU,EACVC,MAAc,EACdC,MAAc,EACdC,KAAc,EACdC,KAA2B,KACxB;EACH,SAAS;;EACT,MAAMC,aAAa,GAAGR,IAAI,CAACS,WAAW,CAACC,eAAe,CACpDV,IAAI,CAACW,WAAW,CAACC,SAAS,CAAChB,KAAK,EAAER,SAAS,CAACyB,GAAG,CAAC,EAChD,IACF,CAAC;EACD,MAAMC,WAAW,GAAGd,IAAI,CAACS,WAAW,CAACC,eAAe,CAClDV,IAAI,CAACW,WAAW,CAACC,SAAS,CAAChB,KAAK,EAAER,SAAS,CAAC2B,KAAK,CAAC,EAClD,IACF,CAAC;EACD,MAAMC,EAAE,GAAGhB,IAAI,CAACS,WAA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,EAAEjG,QAAQ,CAACwG,qBAAqB,CAAC,EAAE;IACjEtD,4BAA4B,CAACV,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAClD,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAACyG,gBAAgB,CAAC,EAAE;IAC5DxC,uBAAuB,CAACzB,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAC7C,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC0G,0BAA0B,CAAC,EAAE;IACtEpC,iCAAiC,CAAC9B,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EACvD,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC2G,qBAAqB,CAAC,EAAE;IACjEjD,4BAA4B,CAAClB,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAClD,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC4G,iBAAiB,CAAC,EAAE;IAC7DnD,wBAAwB,CAACjB,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EAC9C,CAAC,MAAM,IAAI2D,aAAa,CAACH,OAAO,EAAEjG,QAAQ,CAAC6G,wBAAwB,CAAC,EAAE;IACpE5B,+BAA+B,CAACzC,GAAG,EAAEyD,OAAO,CAACxD,KAAK,CAAC;EACrD,CAAC,MAAM;IACL,MAAM,IAAIoC,KAAK,CAAC,6BAA6B,GAAGoB,OAAO,CAACI,eAAe,CAAC;EAC1E;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export const __esModule: boolean;
2
+ export function Skottie(props: any): any;
@@ -35,3 +35,4 @@ export function convertToAffineMatrix(m4: any): any[];
35
35
  * @returns The inverted matrix, or the identity matrix if the input is not invertible
36
36
  */
37
37
  export function invert4(m: any): number[];
38
+ export function setupCamera(area: any, zscale: any, cam: any): any[];
@@ -0,0 +1,6 @@
1
+ export const __esModule: boolean;
2
+ export const LineBreakType: {};
3
+ export const VerticalTextAlign: {};
4
+ export const ResizePolicy: {};
5
+ export const InputState: {};
6
+ export const ModifierKey: {};
@@ -1,10 +1,27 @@
1
1
  export const __esModule: boolean;
2
2
  export class JsiSkImageFilterFactory extends _Host.Host {
3
- MakeOffset(dx: any, dy: any, input: any): _JsiSkImageFilter.JsiSkImageFilter;
4
- MakeDisplacementMap(channelX: any, channelY: any, scale: any, in1: any, input: any): _JsiSkImageFilter.JsiSkImageFilter;
5
- MakeShader(shader: any, _input: any): _JsiSkImageFilter.JsiSkImageFilter;
6
- MakeBlur(sigmaX: any, sigmaY: any, mode: any, input: any): _JsiSkImageFilter.JsiSkImageFilter;
7
- MakeColorFilter(cf: any, input: any): _JsiSkImageFilter.JsiSkImageFilter;
3
+ MakeRuntimeShaderWithChildren(_builder: any, _sampleRadius: any, _childShaderNames: any, _inputs: any): void;
4
+ MakeArithmetic(_k1: any, _k2: any, _k3: any, _k4: any, _enforcePMColor: any, _background: any, _foreground: any, _cropRect: any): void;
5
+ MakeCrop(_rect: any, _tileMode: any, _input: any): void;
6
+ MakeEmpty(): void;
7
+ MakeImage(_image: any, _srcRect: any, _dstRect: any, _filterMode: any, _mipmap: any): void;
8
+ MakeMagnifier(_lensBounds: any, _zoomAmount: any, _inset: any, _filterMode: any, _mipmap: any, _input: any, _cropRect: any): void;
9
+ MakeMatrixConvolution(_kernelSizeX: any, _kernelSizeY: any, _kernel: any, _gain: any, _bias: any, _kernelOffsetX: any, _kernelOffsetY: any, _tileMode: any, _convolveAlpha: any, _input: any, _cropRect: any): void;
10
+ MakeMatrixTransform(_matrix: any, _filterMode: any, _mipmap: any, _input: any): void;
11
+ MakeMerge(_filters: any, _cropRect: any): void;
12
+ MakePicture(_picture: any, _targetRect: any): void;
13
+ MakeTile(_src: any, _dst: any, _input: any): void;
14
+ MakeDistantLitDiffuse(_direction: any, _lightColor: any, _surfaceScale: any, _kd: any, _input: any, _cropRect: any): void;
15
+ MakePointLitDiffuse(_location: any, _lightColor: any, _surfaceScale: any, _kd: any, _input: any, _cropRect: any): void;
16
+ MakeSpotLitDiffuse(_location: any, _target: any, _falloffExponent: any, _cutoffAngle: any, _lightColor: any, _surfaceScale: any, _kd: any, _input: any, _cropRect: any): void;
17
+ MakeDistantLitSpecular(_direction: any, _lightColor: any, _surfaceScale: any, _ks: any, _shininess: any, _input: any, _cropRect: any): void;
18
+ MakePointLitSpecular(_location: any, _lightColor: any, _surfaceScale: any, _ks: any, _shininess: any, _input: any, _cropRect: any): void;
19
+ MakeSpotLitSpecular(_location: any, _target: any, _falloffExponent: any, _cutoffAngle: any, _lightColor: any, _surfaceScale: any, _ks: any, _shininess: any, _input: any, _cropRect: any): void;
20
+ MakeOffset(dx: any, dy: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
21
+ MakeDisplacementMap(channelX: any, channelY: any, scale: any, in1: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
22
+ MakeShader(shader: any, dither: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
23
+ MakeBlur(sigmaX: any, sigmaY: any, mode: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
24
+ MakeColorFilter(colorFilter: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
8
25
  MakeCompose(outer: any, inner: any): _JsiSkImageFilter.JsiSkImageFilter;
9
26
  MakeDropShadow(dx: any, dy: any, sigmaX: any, sigmaY: any, color: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
10
27
  MakeDropShadowOnly(dx: any, dy: any, sigmaX: any, sigmaY: any, color: any, input: any, cropRect: any): _JsiSkImageFilter.JsiSkImageFilter;
@@ -32,6 +32,7 @@ export function JsiSkApi(CanvasKit: any): {
32
32
  FontMgr: _JsiSkFontMgrFactory.JsiSkFontMgrFactory;
33
33
  ParagraphBuilder: _JsiSkParagraphBuilderFactory.JsiSkParagraphBuilderFactory;
34
34
  NativeBuffer: _JsiSkNativeBufferFactory.JsiSkNativeBufferFactory;
35
+ Skottie: _JsiSkottieFactory.JsiSkottieFactory;
35
36
  Video: (url?: any) => Promise<any>;
36
37
  Context: (_surface: any, _width: any, _height: any) => jest.Mock<any, any, any>;
37
38
  Recorder: () => jest.Mock<any, any, any>;
@@ -64,3 +65,4 @@ import _JsiSkTypefaceFontProviderFactory = require("./JsiSkTypefaceFontProviderF
64
65
  import _JsiSkFontMgrFactory = require("./JsiSkFontMgrFactory");
65
66
  import _JsiSkParagraphBuilderFactory = require("./JsiSkParagraphBuilderFactory");
66
67
  import _JsiSkNativeBufferFactory = require("./JsiSkNativeBufferFactory");
68
+ import _JsiSkottieFactory = require("./JsiSkottieFactory");
@@ -0,0 +1,48 @@
1
+ export const __esModule: boolean;
2
+ export class JsiSkottieAnimation extends _Host.HostObject {
3
+ constructor(CanvasKit: any, ref: any);
4
+ getOpacityProps(): any;
5
+ getTextProps(): any;
6
+ getColorProps(): any;
7
+ getTransformProps(): any;
8
+ setColor(key: any, color: any): any;
9
+ setText(key: any, text: any, size: any): any;
10
+ setOpacity(key: any, opacity: any): any;
11
+ setTransform(key: any, anchor: any, position: any, scale: any, rotation: any, skew: any, skewAxis: any): any;
12
+ getSlotInfo(): any;
13
+ setColorSlot(key: any, color: any): any;
14
+ setScalarSlot(key: any, scalar: any): any;
15
+ setVec2Slot(key: any, vec2: any): any;
16
+ setTextSlot(key: any, text: any): any;
17
+ setImageSlot(key: any, assetName: any): any;
18
+ getColorSlot(key: any): any;
19
+ getScalarSlot(key: any): any;
20
+ getVec2Slot(key: any): {
21
+ x: any;
22
+ y: any;
23
+ } | null;
24
+ getTextSlot(key: any): {
25
+ typeface: _JsiSkTypeface.JsiSkTypeface;
26
+ text: any;
27
+ textSize: any;
28
+ minTextSize: any;
29
+ maxTextSize: any;
30
+ strokeWidth: any;
31
+ lineHeight: any;
32
+ lineShift: any;
33
+ ascent: any;
34
+ maxLines: any;
35
+ };
36
+ duration(): any;
37
+ fps(): any;
38
+ render(canvas: any, dstRect: any): void;
39
+ seekFrame(frame: any, damageRect: any): void;
40
+ size(): {
41
+ width: any;
42
+ height: any;
43
+ };
44
+ version(): any;
45
+ dispose(): void;
46
+ }
47
+ import _Host = require("./Host");
48
+ import _JsiSkTypeface = require("./JsiSkTypeface");
@@ -0,0 +1,6 @@
1
+ export const __esModule: boolean;
2
+ export class JsiSkottieFactory extends _Host.Host {
3
+ Make(json: any, assets: any): _JsiSkottieAnimation.JsiSkottieAnimation;
4
+ }
5
+ import _Host = require("./Host");
6
+ import _JsiSkottieAnimation = require("./JsiSkottieAnimation");
@@ -44,4 +44,5 @@ export class ReanimatedRecorder {
44
44
  drawImageSVG(props: any): void;
45
45
  drawParagraph(props: any): void;
46
46
  drawAtlas(props: any): void;
47
+ drawSkottie(props: any): void;
47
48
  }
@@ -49,4 +49,5 @@ export class Recorder {
49
49
  drawImageSVG(props: any): void;
50
50
  drawParagraph(props: any): void;
51
51
  drawAtlas(props: any): void;
52
+ drawSkottie(props: any): void;
52
53
  }