@shopify/react-native-skia 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. package/cpp/api/JsiSkPaint.h +8 -1
  2. package/lib/commonjs/dom/types/Common.d.ts +6 -4
  3. package/lib/commonjs/dom/types/Common.js.map +1 -1
  4. package/lib/commonjs/dom/types/ImageFilters.d.ts +1 -1
  5. package/lib/commonjs/dom/types/ImageFilters.js.map +1 -1
  6. package/lib/commonjs/dom/types/Node.d.ts +0 -2
  7. package/lib/commonjs/dom/types/Node.js.map +1 -1
  8. package/lib/commonjs/external/reanimated/index.d.ts +0 -1
  9. package/lib/commonjs/external/reanimated/index.js +0 -11
  10. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  11. package/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  12. package/lib/commonjs/external/reanimated/renderHelpers.js +5 -43
  13. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  14. package/lib/commonjs/skia/types/Paint/Paint.d.ts +1 -0
  15. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  16. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  17. package/lib/commonjs/skia/web/JsiSkPaint.js +3 -0
  18. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  19. package/lib/commonjs/sksg/Container.d.ts +3 -2
  20. package/lib/commonjs/sksg/Container.js +32 -26
  21. package/lib/commonjs/sksg/Container.js.map +1 -1
  22. package/lib/commonjs/sksg/HostConfig.d.ts +2 -2
  23. package/lib/commonjs/sksg/HostConfig.js +7 -25
  24. package/lib/commonjs/sksg/HostConfig.js.map +1 -1
  25. package/lib/commonjs/sksg/Node.d.ts +19 -0
  26. package/lib/commonjs/sksg/Node.js +78 -0
  27. package/lib/commonjs/sksg/Node.js.map +1 -0
  28. package/lib/commonjs/sksg/Reconciler.d.ts +1 -1
  29. package/lib/commonjs/sksg/Recorder/Core.d.ts +79 -0
  30. package/lib/commonjs/sksg/Recorder/Core.js +110 -0
  31. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -0
  32. package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +18 -0
  33. package/lib/commonjs/sksg/Recorder/DrawingContext.js +105 -0
  34. package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -0
  35. package/lib/commonjs/sksg/Recorder/Player.d.ts +3 -0
  36. package/lib/commonjs/sksg/Recorder/Player.js +127 -0
  37. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -0
  38. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +50 -0
  39. package/lib/commonjs/sksg/Recorder/Recorder.js +288 -0
  40. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -0
  41. package/lib/commonjs/sksg/Recorder/Recording.d.ts +7 -0
  42. package/lib/commonjs/sksg/Recorder/Recording.js +12 -0
  43. package/lib/commonjs/sksg/Recorder/Recording.js.map +1 -0
  44. package/lib/commonjs/sksg/Recorder/Visitor.d.ts +5 -0
  45. package/lib/commonjs/sksg/Recorder/Visitor.js +293 -0
  46. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -0
  47. package/lib/commonjs/sksg/Recorder/commands/Box.d.ts +13 -0
  48. package/lib/commonjs/sksg/Recorder/commands/Box.js +71 -0
  49. package/lib/commonjs/sksg/Recorder/commands/Box.js.map +1 -0
  50. package/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +3 -0
  51. package/lib/commonjs/sksg/Recorder/commands/CTM.js +79 -0
  52. package/lib/commonjs/sksg/Recorder/commands/CTM.js.map +1 -0
  53. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  54. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js +76 -0
  55. package/lib/commonjs/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  56. package/lib/commonjs/sksg/Recorder/commands/Drawing.d.ts +24 -0
  57. package/lib/commonjs/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  58. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -0
  59. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  60. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +183 -0
  61. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  62. package/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +4 -0
  63. package/lib/commonjs/sksg/Recorder/commands/Paint.js +70 -0
  64. package/lib/commonjs/sksg/Recorder/commands/Paint.js.map +1 -0
  65. package/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  66. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js +137 -0
  67. package/lib/commonjs/sksg/Recorder/commands/PathEffects.js.map +1 -0
  68. package/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +5 -0
  69. package/lib/commonjs/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +58 -15
  70. package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -0
  71. package/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  72. package/lib/commonjs/sksg/{nodes/utils.js → utils.js} +12 -2
  73. package/lib/commonjs/sksg/utils.js.map +1 -0
  74. package/lib/module/dom/types/Common.d.ts +6 -4
  75. package/lib/module/dom/types/Common.js.map +1 -1
  76. package/lib/module/dom/types/ImageFilters.d.ts +1 -1
  77. package/lib/module/dom/types/ImageFilters.js.map +1 -1
  78. package/lib/module/dom/types/Node.d.ts +0 -2
  79. package/lib/module/dom/types/Node.js.map +1 -1
  80. package/lib/module/external/reanimated/index.d.ts +0 -1
  81. package/lib/module/external/reanimated/index.js +0 -1
  82. package/lib/module/external/reanimated/index.js.map +1 -1
  83. package/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  84. package/lib/module/external/reanimated/renderHelpers.js +4 -42
  85. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  86. package/lib/module/skia/types/Paint/Paint.d.ts +1 -0
  87. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  88. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  89. package/lib/module/skia/web/JsiSkPaint.js +3 -0
  90. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  91. package/lib/module/sksg/Container.d.ts +3 -2
  92. package/lib/module/sksg/Container.js +30 -24
  93. package/lib/module/sksg/Container.js.map +1 -1
  94. package/lib/module/sksg/HostConfig.d.ts +2 -2
  95. package/lib/module/sksg/HostConfig.js +7 -25
  96. package/lib/module/sksg/HostConfig.js.map +1 -1
  97. package/lib/module/sksg/Node.d.ts +19 -0
  98. package/lib/module/sksg/Node.js +67 -0
  99. package/lib/module/sksg/Node.js.map +1 -0
  100. package/lib/module/sksg/Reconciler.d.ts +1 -1
  101. package/lib/module/sksg/Recorder/Core.d.ts +79 -0
  102. package/lib/module/sksg/Recorder/Core.js +101 -0
  103. package/lib/module/sksg/Recorder/Core.js.map +1 -0
  104. package/lib/module/sksg/Recorder/DrawingContext.d.ts +18 -0
  105. package/lib/module/sksg/Recorder/DrawingContext.js +98 -0
  106. package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -0
  107. package/lib/module/sksg/Recorder/Player.d.ts +3 -0
  108. package/lib/module/sksg/Recorder/Player.js +120 -0
  109. package/lib/module/sksg/Recorder/Player.js.map +1 -0
  110. package/lib/module/sksg/Recorder/Recorder.d.ts +50 -0
  111. package/lib/module/sksg/Recorder/Recorder.js +281 -0
  112. package/lib/module/sksg/Recorder/Recorder.js.map +1 -0
  113. package/lib/module/sksg/Recorder/Recording.d.ts +7 -0
  114. package/lib/module/sksg/Recorder/Recording.js +5 -0
  115. package/lib/module/sksg/Recorder/Recording.js.map +1 -0
  116. package/lib/module/sksg/Recorder/Visitor.d.ts +5 -0
  117. package/lib/module/sksg/Recorder/Visitor.js +285 -0
  118. package/lib/module/sksg/Recorder/Visitor.js.map +1 -0
  119. package/lib/module/sksg/Recorder/commands/Box.d.ts +13 -0
  120. package/lib/module/sksg/Recorder/commands/Box.js +63 -0
  121. package/lib/module/sksg/Recorder/commands/Box.js.map +1 -0
  122. package/lib/module/sksg/Recorder/commands/CTM.d.ts +3 -0
  123. package/lib/module/sksg/Recorder/commands/CTM.js +72 -0
  124. package/lib/module/sksg/Recorder/commands/CTM.js.map +1 -0
  125. package/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  126. package/lib/module/sksg/Recorder/commands/ColorFilters.js +67 -0
  127. package/lib/module/sksg/Recorder/commands/ColorFilters.js.map +1 -0
  128. package/lib/module/sksg/Recorder/commands/Drawing.d.ts +24 -0
  129. package/lib/module/sksg/{nodes/drawings.js → Recorder/commands/Drawing.js} +5 -5
  130. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -0
  131. package/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  132. package/lib/module/sksg/{nodes/imageFilters.js → Recorder/commands/ImageFilters.js} +87 -95
  133. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -0
  134. package/lib/module/sksg/Recorder/commands/Paint.d.ts +4 -0
  135. package/lib/module/sksg/Recorder/commands/Paint.js +62 -0
  136. package/lib/module/sksg/Recorder/commands/Paint.js.map +1 -0
  137. package/lib/module/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  138. package/lib/module/sksg/Recorder/commands/PathEffects.js +128 -0
  139. package/lib/module/sksg/Recorder/commands/PathEffects.js.map +1 -0
  140. package/lib/module/sksg/Recorder/commands/Shaders.d.ts +5 -0
  141. package/lib/module/sksg/{nodes/shaders.js → Recorder/commands/Shaders.js} +63 -13
  142. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -0
  143. package/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  144. package/lib/module/sksg/{nodes/utils.js → utils.js} +10 -1
  145. package/lib/module/sksg/utils.js.map +1 -0
  146. package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +0 -1
  147. package/lib/typescript/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
  148. package/lib/typescript/lib/commonjs/sksg/Container.d.ts +4 -0
  149. package/lib/typescript/lib/commonjs/sksg/HostConfig.d.ts +1 -3
  150. package/lib/typescript/lib/commonjs/sksg/Node.d.ts +14 -0
  151. package/lib/typescript/lib/commonjs/sksg/Recorder/Core.d.ts +5 -0
  152. package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +17 -0
  153. package/lib/typescript/lib/commonjs/sksg/Recorder/Player.d.ts +2 -0
  154. package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +45 -0
  155. package/lib/typescript/lib/commonjs/sksg/Recorder/Recording.d.ts +5 -0
  156. package/lib/typescript/lib/commonjs/sksg/Recorder/Visitor.d.ts +27 -0
  157. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Box.d.ts +3 -0
  158. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/CTM.d.ts +2 -0
  159. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ColorFilters.d.ts +4 -0
  160. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/ImageFilters.d.ts +6 -0
  161. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Paint.d.ts +14 -0
  162. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/PathEffects.d.ts +4 -0
  163. package/lib/typescript/lib/commonjs/sksg/Recorder/commands/Shaders.d.ts +3 -0
  164. package/lib/typescript/lib/commonjs/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  165. package/lib/typescript/lib/module/external/reanimated/index.d.ts +0 -1
  166. package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +0 -1
  167. package/lib/typescript/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
  168. package/lib/typescript/lib/module/sksg/Container.d.ts +4 -0
  169. package/lib/typescript/lib/module/sksg/HostConfig.d.ts +1 -3
  170. package/lib/typescript/lib/module/sksg/Node.d.ts +13 -0
  171. package/lib/typescript/lib/module/sksg/Recorder/Core.d.ts +4 -0
  172. package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +16 -0
  173. package/lib/typescript/lib/module/sksg/Recorder/Player.d.ts +1 -0
  174. package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +44 -0
  175. package/lib/typescript/lib/module/sksg/Recorder/Recording.d.ts +4 -0
  176. package/lib/typescript/lib/module/sksg/Recorder/Visitor.d.ts +26 -0
  177. package/lib/typescript/lib/module/sksg/Recorder/commands/Box.d.ts +2 -0
  178. package/lib/typescript/lib/module/sksg/Recorder/commands/CTM.d.ts +1 -0
  179. package/lib/typescript/lib/module/sksg/Recorder/commands/ColorFilters.d.ts +3 -0
  180. package/lib/typescript/lib/module/sksg/Recorder/commands/ImageFilters.d.ts +5 -0
  181. package/lib/typescript/lib/module/sksg/Recorder/commands/Paint.d.ts +13 -0
  182. package/lib/typescript/lib/module/sksg/Recorder/commands/PathEffects.d.ts +3 -0
  183. package/lib/typescript/lib/module/sksg/Recorder/commands/Shaders.d.ts +2 -0
  184. package/lib/typescript/lib/module/sksg/{nodes/utils.d.ts → utils.d.ts} +1 -0
  185. package/lib/typescript/src/dom/types/Common.d.ts +6 -4
  186. package/lib/typescript/src/dom/types/ImageFilters.d.ts +1 -1
  187. package/lib/typescript/src/dom/types/Node.d.ts +0 -2
  188. package/lib/typescript/src/external/reanimated/index.d.ts +0 -1
  189. package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +0 -1
  190. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +1 -0
  191. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  192. package/lib/typescript/src/sksg/Container.d.ts +3 -2
  193. package/lib/typescript/src/sksg/HostConfig.d.ts +2 -2
  194. package/lib/typescript/src/sksg/Node.d.ts +19 -0
  195. package/lib/typescript/src/sksg/Reconciler.d.ts +1 -1
  196. package/lib/typescript/src/sksg/Recorder/Core.d.ts +79 -0
  197. package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +18 -0
  198. package/lib/typescript/src/sksg/Recorder/Player.d.ts +3 -0
  199. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +50 -0
  200. package/lib/typescript/src/sksg/Recorder/Recording.d.ts +7 -0
  201. package/lib/typescript/src/sksg/Recorder/Visitor.d.ts +5 -0
  202. package/lib/typescript/src/sksg/Recorder/commands/Box.d.ts +13 -0
  203. package/lib/typescript/src/sksg/Recorder/commands/CTM.d.ts +3 -0
  204. package/lib/typescript/src/sksg/Recorder/commands/ColorFilters.d.ts +6 -0
  205. package/lib/typescript/src/sksg/Recorder/commands/Drawing.d.ts +24 -0
  206. package/lib/typescript/src/sksg/Recorder/commands/ImageFilters.d.ts +12 -0
  207. package/lib/typescript/src/sksg/Recorder/commands/Paint.d.ts +4 -0
  208. package/lib/typescript/src/sksg/Recorder/commands/PathEffects.d.ts +6 -0
  209. package/lib/typescript/src/sksg/Recorder/commands/Shaders.d.ts +5 -0
  210. package/lib/typescript/src/sksg/{nodes/utils.d.ts → utils.d.ts} +3 -0
  211. package/package.json +1 -1
  212. package/src/__tests__/snapshots/image-filter/test-shadow.png +0 -0
  213. package/src/dom/types/Common.ts +7 -5
  214. package/src/dom/types/ImageFilters.ts +2 -1
  215. package/src/dom/types/Node.ts +0 -4
  216. package/src/external/reanimated/index.ts +0 -1
  217. package/src/external/reanimated/renderHelpers.ts +4 -44
  218. package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +15 -0
  219. package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +23 -2
  220. package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +91 -2
  221. package/src/renderer/__tests__/setup.tsx +1 -1
  222. package/src/skia/types/Paint/Paint.ts +2 -0
  223. package/src/skia/web/JsiSkPaint.ts +4 -0
  224. package/src/sksg/Container.ts +35 -29
  225. package/src/sksg/HostConfig.ts +5 -50
  226. package/src/sksg/Node.ts +105 -0
  227. package/src/sksg/Recorder/Core.ts +171 -0
  228. package/src/sksg/Recorder/DrawingContext.ts +130 -0
  229. package/src/sksg/Recorder/Player.ts +160 -0
  230. package/src/sksg/Recorder/Recorder.ts +259 -0
  231. package/src/sksg/Recorder/Recording.ts +13 -0
  232. package/src/sksg/Recorder/Visitor.ts +324 -0
  233. package/src/sksg/Recorder/commands/Box.ts +63 -0
  234. package/src/sksg/Recorder/commands/CTM.ts +72 -0
  235. package/src/sksg/Recorder/commands/ColorFilters.ts +87 -0
  236. package/src/sksg/{nodes/drawings.ts → Recorder/commands/Drawing.ts} +29 -65
  237. package/src/sksg/Recorder/commands/ImageFilters.ts +255 -0
  238. package/src/sksg/Recorder/commands/Paint.ts +77 -0
  239. package/src/sksg/Recorder/commands/PathEffects.ts +169 -0
  240. package/src/sksg/{nodes/shaders.ts → Recorder/commands/Shaders.ts} +100 -26
  241. package/src/sksg/{nodes/utils.ts → utils.ts} +14 -1
  242. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  243. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +0 -24
  244. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  245. package/lib/commonjs/sksg/DeclarationContext.d.ts +0 -56
  246. package/lib/commonjs/sksg/DeclarationContext.js +0 -77
  247. package/lib/commonjs/sksg/DeclarationContext.js.map +0 -1
  248. package/lib/commonjs/sksg/DrawingContext.d.ts +0 -13
  249. package/lib/commonjs/sksg/DrawingContext.js +0 -172
  250. package/lib/commonjs/sksg/DrawingContext.js.map +0 -1
  251. package/lib/commonjs/sksg/__tests__/Declarations.spec.d.ts +0 -1
  252. package/lib/commonjs/sksg/__tests__/MockDeclaration.d.ts +0 -57
  253. package/lib/commonjs/sksg/nodes/Node.d.ts +0 -7
  254. package/lib/commonjs/sksg/nodes/Node.js +0 -6
  255. package/lib/commonjs/sksg/nodes/Node.js.map +0 -1
  256. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -10
  257. package/lib/commonjs/sksg/nodes/colorFilters.js +0 -79
  258. package/lib/commonjs/sksg/nodes/colorFilters.js.map +0 -1
  259. package/lib/commonjs/sksg/nodes/context.d.ts +0 -3
  260. package/lib/commonjs/sksg/nodes/context.js +0 -394
  261. package/lib/commonjs/sksg/nodes/context.js.map +0 -1
  262. package/lib/commonjs/sksg/nodes/drawings.d.ts +0 -30
  263. package/lib/commonjs/sksg/nodes/drawings.js.map +0 -1
  264. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -17
  265. package/lib/commonjs/sksg/nodes/imageFilters.js +0 -197
  266. package/lib/commonjs/sksg/nodes/imageFilters.js.map +0 -1
  267. package/lib/commonjs/sksg/nodes/index.d.ts +0 -3
  268. package/lib/commonjs/sksg/nodes/index.js +0 -39
  269. package/lib/commonjs/sksg/nodes/index.js.map +0 -1
  270. package/lib/commonjs/sksg/nodes/paint.d.ts +0 -3
  271. package/lib/commonjs/sksg/nodes/paint.js +0 -81
  272. package/lib/commonjs/sksg/nodes/paint.js.map +0 -1
  273. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -11
  274. package/lib/commonjs/sksg/nodes/pathEffects.js +0 -111
  275. package/lib/commonjs/sksg/nodes/pathEffects.js.map +0 -1
  276. package/lib/commonjs/sksg/nodes/shaders.d.ts +0 -11
  277. package/lib/commonjs/sksg/nodes/shaders.js.map +0 -1
  278. package/lib/commonjs/sksg/nodes/utils.js.map +0 -1
  279. package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  280. package/lib/module/external/reanimated/useDerivedValueOnJS.js +0 -16
  281. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +0 -1
  282. package/lib/module/sksg/DeclarationContext.d.ts +0 -56
  283. package/lib/module/sksg/DeclarationContext.js +0 -69
  284. package/lib/module/sksg/DeclarationContext.js.map +0 -1
  285. package/lib/module/sksg/DrawingContext.d.ts +0 -13
  286. package/lib/module/sksg/DrawingContext.js +0 -165
  287. package/lib/module/sksg/DrawingContext.js.map +0 -1
  288. package/lib/module/sksg/__tests__/Declarations.spec.d.ts +0 -1
  289. package/lib/module/sksg/__tests__/MockDeclaration.d.ts +0 -57
  290. package/lib/module/sksg/nodes/Node.d.ts +0 -7
  291. package/lib/module/sksg/nodes/Node.js +0 -2
  292. package/lib/module/sksg/nodes/Node.js.map +0 -1
  293. package/lib/module/sksg/nodes/colorFilters.d.ts +0 -10
  294. package/lib/module/sksg/nodes/colorFilters.js +0 -66
  295. package/lib/module/sksg/nodes/colorFilters.js.map +0 -1
  296. package/lib/module/sksg/nodes/context.d.ts +0 -3
  297. package/lib/module/sksg/nodes/context.js +0 -387
  298. package/lib/module/sksg/nodes/context.js.map +0 -1
  299. package/lib/module/sksg/nodes/drawings.d.ts +0 -30
  300. package/lib/module/sksg/nodes/drawings.js.map +0 -1
  301. package/lib/module/sksg/nodes/imageFilters.d.ts +0 -17
  302. package/lib/module/sksg/nodes/imageFilters.js.map +0 -1
  303. package/lib/module/sksg/nodes/index.d.ts +0 -3
  304. package/lib/module/sksg/nodes/index.js +0 -4
  305. package/lib/module/sksg/nodes/index.js.map +0 -1
  306. package/lib/module/sksg/nodes/paint.d.ts +0 -3
  307. package/lib/module/sksg/nodes/paint.js +0 -74
  308. package/lib/module/sksg/nodes/paint.js.map +0 -1
  309. package/lib/module/sksg/nodes/pathEffects.d.ts +0 -11
  310. package/lib/module/sksg/nodes/pathEffects.js +0 -97
  311. package/lib/module/sksg/nodes/pathEffects.js.map +0 -1
  312. package/lib/module/sksg/nodes/shaders.d.ts +0 -11
  313. package/lib/module/sksg/nodes/shaders.js.map +0 -1
  314. package/lib/module/sksg/nodes/utils.js.map +0 -1
  315. package/lib/typescript/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +0 -2
  316. package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +0 -53
  317. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +0 -22
  318. package/lib/typescript/lib/commonjs/sksg/nodes/Node.d.ts +0 -1
  319. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +0 -8
  320. package/lib/typescript/lib/commonjs/sksg/nodes/context.d.ts +0 -2
  321. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +0 -12
  322. package/lib/typescript/lib/commonjs/sksg/nodes/index.d.ts +0 -1
  323. package/lib/typescript/lib/commonjs/sksg/nodes/paint.d.ts +0 -2
  324. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +0 -9
  325. package/lib/typescript/lib/commonjs/sksg/nodes/shaders.d.ts +0 -10
  326. package/lib/typescript/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  327. package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +0 -52
  328. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +0 -21
  329. package/lib/typescript/lib/module/sksg/nodes/Node.d.ts +0 -1
  330. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +0 -7
  331. package/lib/typescript/lib/module/sksg/nodes/context.d.ts +0 -1
  332. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +0 -11
  333. package/lib/typescript/lib/module/sksg/nodes/index.d.ts +0 -3
  334. package/lib/typescript/lib/module/sksg/nodes/paint.d.ts +0 -1
  335. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +0 -8
  336. package/lib/typescript/lib/module/sksg/nodes/shaders.d.ts +0 -9
  337. package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +0 -1
  338. package/lib/typescript/src/sksg/DeclarationContext.d.ts +0 -56
  339. package/lib/typescript/src/sksg/DrawingContext.d.ts +0 -13
  340. package/lib/typescript/src/sksg/__tests__/Declarations.spec.d.ts +0 -1
  341. package/lib/typescript/src/sksg/__tests__/MockDeclaration.d.ts +0 -57
  342. package/lib/typescript/src/sksg/nodes/Node.d.ts +0 -7
  343. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +0 -10
  344. package/lib/typescript/src/sksg/nodes/context.d.ts +0 -3
  345. package/lib/typescript/src/sksg/nodes/drawings.d.ts +0 -30
  346. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +0 -17
  347. package/lib/typescript/src/sksg/nodes/index.d.ts +0 -3
  348. package/lib/typescript/src/sksg/nodes/paint.d.ts +0 -3
  349. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +0 -11
  350. package/lib/typescript/src/sksg/nodes/shaders.d.ts +0 -11
  351. package/src/external/reanimated/useDerivedValueOnJS.ts +0 -20
  352. package/src/sksg/DeclarationContext.ts +0 -85
  353. package/src/sksg/DrawingContext.ts +0 -226
  354. package/src/sksg/__tests__/Declarations.spec.tsx +0 -235
  355. package/src/sksg/__tests__/MockDeclaration.ts +0 -138
  356. package/src/sksg/nodes/Node.ts +0 -8
  357. package/src/sksg/nodes/colorFilters.ts +0 -79
  358. package/src/sksg/nodes/context.ts +0 -412
  359. package/src/sksg/nodes/imageFilters.ts +0 -235
  360. package/src/sksg/nodes/index.ts +0 -3
  361. package/src/sksg/nodes/paint.ts +0 -75
  362. package/src/sksg/nodes/pathEffects.ts +0 -118
  363. /package/lib/typescript/lib/commonjs/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
  364. /package/lib/typescript/lib/module/sksg/{nodes/drawings.d.ts → Recorder/commands/Drawing.d.ts} +0 -0
@@ -27,6 +27,12 @@ class JsiSkPaint : public JsiSkWrappingSharedPtrHostObject<SkPaint> {
27
27
  public:
28
28
  EXPORT_JSI_API_TYPENAME(JsiSkPaint, Paint)
29
29
 
30
+ JSI_HOST_FUNCTION(assign) {
31
+ SkPaint* paint = JsiSkPaint::fromValue(runtime, arguments[0]).get();
32
+ *getObject() = *paint;
33
+ return jsi::Value::undefined();
34
+ }
35
+
30
36
  JSI_HOST_FUNCTION(copy) {
31
37
  const auto *paint = getObject().get();
32
38
  return jsi::Object::createFromHostObject(
@@ -163,7 +169,8 @@ public:
163
169
  return jsi::Value::undefined();
164
170
  }
165
171
 
166
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPaint, copy),
172
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkPaint, assign),
173
+ JSI_EXPORT_FUNC(JsiSkPaint, copy),
167
174
  JSI_EXPORT_FUNC(JsiSkPaint, reset),
168
175
  JSI_EXPORT_FUNC(JsiSkPaint, getAlphaf),
169
176
  JSI_EXPORT_FUNC(JsiSkPaint, getColor),
@@ -38,6 +38,11 @@ export interface TransformProps {
38
38
  origin?: Vector;
39
39
  matrix?: InputMatrix;
40
40
  }
41
+ export interface CTMProps extends TransformProps {
42
+ clip?: ClipDef;
43
+ invertClip?: boolean;
44
+ layer?: SkPaint | boolean;
45
+ }
41
46
  export interface PaintProps extends ChildrenProps {
42
47
  color?: Color;
43
48
  strokeWidth?: number;
@@ -50,8 +55,5 @@ export interface PaintProps extends ChildrenProps {
50
55
  antiAlias?: boolean;
51
56
  dither?: boolean;
52
57
  }
53
- export interface GroupProps extends PaintProps, TransformProps {
54
- clip?: ClipDef;
55
- invertClip?: boolean;
56
- layer?: SkPaint | boolean;
58
+ export interface GroupProps extends PaintProps, CTMProps {
57
59
  }
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n InputMatrix,\n InputRRect,\n PaintStyle,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms3d,\n Vector,\n} from \"../../skia/types\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x?: number;\n y?: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r?: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: InputRRect };\n\nexport interface PointCircleDef {\n c?: Vector;\n r: number;\n}\n\nexport interface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nexport interface TransformProps {\n transform?: Transforms3d;\n origin?: Vector;\n matrix?: InputMatrix;\n}\n\nexport interface PaintProps extends ChildrenProps {\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n dither?: boolean;\n}\n\nexport interface GroupProps extends PaintProps, TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: SkPaint | boolean;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Common.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n BlendMode,\n Color,\n InputMatrix,\n InputRRect,\n PaintStyle,\n SkPaint,\n SkPath,\n SkRect,\n SkRRect,\n StrokeCap,\n StrokeJoin,\n Transforms3d,\n Vector,\n} from \"../../skia/types\";\n\nexport type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>;\n\nexport type PathDef = string | SkPath;\n\nexport type ClipDef = SkRRect | SkRect | PathDef;\n\nexport type Fit =\n | \"cover\"\n | \"contain\"\n | \"fill\"\n | \"fitHeight\"\n | \"fitWidth\"\n | \"none\"\n | \"scaleDown\";\n\nexport type Radius = number | Vector;\n\nexport interface ChildrenProps {\n children?: ReactNode | ReactNode[];\n}\n\nexport interface RectCtor {\n x?: number;\n y?: number;\n width: number;\n height: number;\n}\n\nexport interface RRectCtor extends RectCtor {\n r?: Radius;\n}\n\nexport type RectDef = RectCtor | { rect: SkRect };\nexport type RRectDef = RRectCtor | { rect: InputRRect };\n\nexport interface PointCircleDef {\n c?: Vector;\n r: number;\n}\n\nexport interface ScalarCircleDef {\n cx: number;\n cy: number;\n r: number;\n}\n\nexport type CircleDef = PointCircleDef | ScalarCircleDef;\n\nexport interface TransformProps {\n transform?: Transforms3d;\n origin?: Vector;\n matrix?: InputMatrix;\n}\n\nexport interface CTMProps extends TransformProps {\n clip?: ClipDef;\n invertClip?: boolean;\n layer?: SkPaint | boolean;\n}\n\nexport interface PaintProps extends ChildrenProps {\n color?: Color;\n strokeWidth?: number;\n blendMode?: SkEnum<typeof BlendMode>;\n style?: SkEnum<typeof PaintStyle>;\n strokeJoin?: SkEnum<typeof StrokeJoin>;\n strokeCap?: SkEnum<typeof StrokeCap>;\n strokeMiter?: number;\n opacity?: number;\n antiAlias?: boolean;\n dither?: boolean;\n}\n\nexport interface GroupProps extends PaintProps, CTMProps {}\n"],"mappings":"","ignoreList":[]}
@@ -13,7 +13,7 @@ export interface RuntimeShaderImageFilterProps extends ChildrenProps {
13
13
  uniforms?: Uniforms;
14
14
  }
15
15
  export interface BlendImageFilterProps extends ChildrenProps {
16
- mode: BlendMode;
16
+ mode: SkEnum<typeof BlendMode>;
17
17
  }
18
18
  export interface MorphologyImageFilterProps extends ChildrenProps {
19
19
  operator: "erode" | "dilate";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["ImageFilters.ts"],"sourcesContent":["import type {\n BlendMode,\n Color,\n ColorChannel,\n SkRuntimeEffect,\n TileMode,\n Uniforms,\n} from \"../../skia/types\";\n\nimport type { Radius, SkEnum, ChildrenProps } from \"./Common\";\n\nexport interface BlurImageFilterProps extends ChildrenProps {\n blur: Radius;\n mode: SkEnum<typeof TileMode>;\n}\n\nexport interface OffsetImageFilterProps extends ChildrenProps {\n x: number;\n y: number;\n}\n\nexport interface RuntimeShaderImageFilterProps extends ChildrenProps {\n source: SkRuntimeEffect;\n uniforms?: Uniforms;\n}\n\nexport interface BlendImageFilterProps extends ChildrenProps {\n mode: BlendMode;\n}\n\nexport interface MorphologyImageFilterProps extends ChildrenProps {\n operator: \"erode\" | \"dilate\";\n radius: Radius;\n}\n\nexport interface DropShadowImageFilterProps extends ChildrenProps {\n dx: number;\n dy: number;\n blur: number;\n color: Color;\n inner?: boolean;\n shadowOnly?: boolean;\n}\n\nexport interface DisplacementMapImageFilterProps extends ChildrenProps {\n channelX: SkEnum<typeof ColorChannel>;\n channelY: SkEnum<typeof ColorChannel>;\n scale: number;\n}\n\nexport interface BlendProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["ImageFilters.ts"],"sourcesContent":["import type {\n BlendMode,\n Color,\n ColorChannel,\n SkRuntimeEffect,\n TileMode,\n Uniforms,\n} from \"../../skia/types\";\n\nimport type { Radius, SkEnum, ChildrenProps } from \"./Common\";\n\nexport interface BlurImageFilterProps extends ChildrenProps {\n blur: Radius;\n mode: SkEnum<typeof TileMode>;\n}\n\nexport interface OffsetImageFilterProps extends ChildrenProps {\n x: number;\n y: number;\n}\n\nexport interface RuntimeShaderImageFilterProps extends ChildrenProps {\n source: SkRuntimeEffect;\n uniforms?: Uniforms;\n}\n\n// TODO: delete\nexport interface BlendImageFilterProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n}\n\nexport interface MorphologyImageFilterProps extends ChildrenProps {\n operator: \"erode\" | \"dilate\";\n radius: Radius;\n}\n\nexport interface DropShadowImageFilterProps extends ChildrenProps {\n dx: number;\n dy: number;\n blur: number;\n color: Color;\n inner?: boolean;\n shadowOnly?: boolean;\n}\n\nexport interface DisplacementMapImageFilterProps extends ChildrenProps {\n channelX: SkEnum<typeof ColorChannel>;\n channelY: SkEnum<typeof ColorChannel>;\n scale: number;\n}\n\nexport interface BlendProps extends ChildrenProps {\n mode: SkEnum<typeof BlendMode>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,6 +1,5 @@
1
1
  import type { GroupProps } from "./Common";
2
2
  import type { NodeType } from "./NodeType";
3
- import type { DeclarationContext } from "../../sksg/DeclarationContext";
4
3
  export interface Node<P> {
5
4
  type: NodeType;
6
5
  setProps(props: P): void;
@@ -13,7 +12,6 @@ export interface Node<P> {
13
12
  }
14
13
  export type Invalidate = () => void;
15
14
  export interface DeclarationNode<P> extends Node<P> {
16
- decorate(ctx: DeclarationContext): void;
17
15
  setInvalidate(invalidate: Invalidate): void;
18
16
  }
19
17
  export type RenderNode<P extends GroupProps> = Node<P>;
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["Node.ts"],"sourcesContent":["import type { GroupProps } from \"./Common\";\nimport type { NodeType } from \"./NodeType\";\nimport type { DeclarationContext } from \"../../sksg/DeclarationContext\";\n\nexport interface Node<P> {\n type: NodeType;\n\n setProps(props: P): void;\n setProp<K extends keyof P>(name: K, v: P[K]): boolean;\n getProps(): P;\n\n children(): Node<unknown>[];\n addChild(child: Node<unknown>): void;\n removeChild(child: Node<unknown>): void;\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;\n}\n\nexport type Invalidate = () => void;\n\nexport interface DeclarationNode<P> extends Node<P> {\n //declarationType: DeclarationType;\n decorate(ctx: DeclarationContext): void;\n\n setInvalidate(invalidate: Invalidate): void;\n}\n\nexport type RenderNode<P extends GroupProps> = Node<P>;\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["Node.ts"],"sourcesContent":["import type { GroupProps } from \"./Common\";\nimport type { NodeType } from \"./NodeType\";\n\nexport interface Node<P> {\n type: NodeType;\n\n setProps(props: P): void;\n setProp<K extends keyof P>(name: K, v: P[K]): boolean;\n getProps(): P;\n\n children(): Node<unknown>[];\n addChild(child: Node<unknown>): void;\n removeChild(child: Node<unknown>): void;\n insertChildBefore(child: Node<unknown>, before: Node<unknown>): void;\n}\n\nexport type Invalidate = () => void;\n\nexport interface DeclarationNode<P> extends Node<P> {\n setInvalidate(invalidate: Invalidate): void;\n}\n\nexport type RenderNode<P extends GroupProps> = Node<P>;\n"],"mappings":"","ignoreList":[]}
@@ -1,5 +1,4 @@
1
1
  export * from "./useAnimatedImageValue";
2
- export * from "./useDerivedValueOnJS";
3
2
  export * from "./renderHelpers";
4
3
  export * from "./interpolators";
5
4
  export * from "./textures";
@@ -14,17 +14,6 @@ Object.keys(_useAnimatedImageValue).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
- var _useDerivedValueOnJS = require("./useDerivedValueOnJS");
18
- Object.keys(_useDerivedValueOnJS).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _useDerivedValueOnJS[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _useDerivedValueOnJS[key];
25
- }
26
- });
27
- });
28
17
  var _renderHelpers = require("./renderHelpers");
29
18
  Object.keys(_renderHelpers).forEach(function (key) {
30
19
  if (key === "default" || key === "__esModule") return;
@@ -1 +1 @@
1
- {"version":3,"names":["_useAnimatedImageValue","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useDerivedValueOnJS","_renderHelpers","_interpolators","_textures","_buffers","_useVideo"],"sources":["index.ts"],"sourcesContent":["export * from \"./useAnimatedImageValue\";\nexport * from \"./useDerivedValueOnJS\";\nexport * from \"./renderHelpers\";\nexport * from \"./interpolators\";\nexport * from \"./textures\";\nexport * from \"./buffers\";\nexport * from \"./useVideo\";\n"],"mappings":";;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,sBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,sBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,sBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA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A,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,SAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,SAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,SAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,SAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,SAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,SAAA,CAAAV,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useAnimatedImageValue","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_renderHelpers","_interpolators","_textures","_buffers","_useVideo"],"sources":["index.ts"],"sourcesContent":["export * from \"./useAnimatedImageValue\";\nexport * from \"./renderHelpers\";\nexport * from \"./interpolators\";\nexport * from \"./textures\";\nexport * from \"./buffers\";\nexport * from \"./useVideo\";\n"],"mappings":";;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA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AAAD,GAAA,MAAAO,SAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,SAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,QAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,QAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,QAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,QAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,SAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,SAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,SAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,SAAA,CAAAT,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  import type { Container } from "../../renderer/Container";
2
2
  import type { AnimatedProps } from "../../renderer/processors";
3
3
  import type { Node } from "../../dom/types";
4
- export declare let HAS_REANIMATED: boolean;
5
4
  export declare let HAS_REANIMATED_3: boolean;
6
5
  export declare const unbindReanimatedNode: (node: Node<unknown>) => void;
7
6
  export declare function extractReanimatedProps(props: AnimatedProps<any>): AnimatedProps<any, never>[];
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.HAS_REANIMATED_3 = exports.HAS_REANIMATED = void 0;
6
+ exports.HAS_REANIMATED_3 = void 0;
7
7
  exports.bindReanimatedProps = bindReanimatedProps;
8
8
  exports.extractReanimatedProps = extractReanimatedProps;
9
9
  exports.unbindReanimatedNode = void 0;
@@ -11,7 +11,6 @@ var _ReanimatedProxy = _interopRequireDefault(require("./ReanimatedProxy"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  /* eslint-disable @typescript-eslint/no-explicit-any */
13
13
 
14
- let HAS_REANIMATED = exports.HAS_REANIMATED = false;
15
14
  let HAS_REANIMATED_3 = exports.HAS_REANIMATED_3 = false;
16
15
  try {
17
16
  // This logic is convoluted but necessary
@@ -20,16 +19,15 @@ try {
20
19
  // So it will not throw an error and we need to check the version to know if it's there.
21
20
  const reanimatedVersion = require("react-native-reanimated/package.json").version;
22
21
  require("react-native-reanimated");
23
- exports.HAS_REANIMATED = HAS_REANIMATED = !!reanimatedVersion;
24
22
  if (reanimatedVersion && (reanimatedVersion >= "3.0.0" || reanimatedVersion.includes("3.0.0-"))) {
25
23
  exports.HAS_REANIMATED_3 = HAS_REANIMATED_3 = true;
26
24
  }
27
25
  } catch (e) {
28
- exports.HAS_REANIMATED = HAS_REANIMATED = false;
26
+ // do nothing
29
27
  }
30
28
  const _bindings = new WeakMap();
31
29
  const unbindReanimatedNode = node => {
32
- if (!HAS_REANIMATED) {
30
+ if (!HAS_REANIMATED_3) {
33
31
  return;
34
32
  }
35
33
  const previousMapperId = _bindings.get(node);
@@ -39,7 +37,7 @@ const unbindReanimatedNode = node => {
39
37
  };
40
38
  exports.unbindReanimatedNode = unbindReanimatedNode;
41
39
  function extractReanimatedProps(props) {
42
- if (!HAS_REANIMATED) {
40
+ if (!HAS_REANIMATED_3) {
43
41
  return [props, {}];
44
42
  }
45
43
  const reanimatedProps = {};
@@ -58,44 +56,8 @@ function extractReanimatedProps(props) {
58
56
  }
59
57
  return [otherProps, reanimatedProps];
60
58
  }
61
- function bindReanimatedProps2(container, node, reanimatedProps) {
62
- const sharedValues = Object.values(reanimatedProps);
63
- const previousMapperId = _bindings.get(node);
64
- if (previousMapperId !== undefined) {
65
- _ReanimatedProxy.default.stopMapper(previousMapperId);
66
- }
67
- if (sharedValues.length > 0) {
68
- const viewId = container.getNativeId();
69
- const {
70
- SkiaViewApi
71
- } = global;
72
- const updateProps = () => {
73
- for (const propName in reanimatedProps) {
74
- node && node.setProp(propName, reanimatedProps[propName].value);
75
- }
76
- // On React Native we use the SkiaViewApi to redraw because it can
77
- // run on the worklet thread (container.redraw can't)
78
- // if SkiaViewApi is undefined, we are on web and container.redraw()
79
- // can safely be invoked
80
- if (SkiaViewApi) {
81
- SkiaViewApi.requestRedraw(viewId);
82
- } else {
83
- container.redraw();
84
- }
85
- };
86
- const mapperId = _ReanimatedProxy.default.startMapper(() => {
87
- "worklet";
88
-
89
- _ReanimatedProxy.default.runOnJS(updateProps)();
90
- }, sharedValues);
91
- _bindings.set(node, mapperId);
92
- }
93
- }
94
59
  function bindReanimatedProps(container, node, reanimatedProps) {
95
- if (HAS_REANIMATED && !HAS_REANIMATED_3) {
96
- return bindReanimatedProps2(container, node, reanimatedProps);
97
- }
98
- if (!HAS_REANIMATED) {
60
+ if (!HAS_REANIMATED_3) {
99
61
  return;
100
62
  }
101
63
  const sharedValues = Object.values(reanimatedProps);
@@ -1 +1 @@
1
- {"version":3,"names":["_ReanimatedProxy","_interopRequireDefault","require","e","__esModule","default","HAS_REANIMATED","exports","HAS_REANIMATED_3","reanimatedVersion","version","includes","_bindings","WeakMap","unbindReanimatedNode","node","previousMapperId","get","undefined","Rea","stopMapper","extractReanimatedProps","props","reanimatedProps","otherProps","propName","propValue","isSharedValue","value","bindReanimatedProps2","container","sharedValues","Object","values","length","viewId","getNativeId","SkiaViewApi","global","updateProps","setProp","requestRedraw","redraw","mapperId","startMapper","runOnJS","set","bindReanimatedProps"],"sources":["renderHelpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Container } from \"../../renderer/Container\";\nimport type { AnimatedProps } from \"../../renderer/processors\";\nimport type { Node } from \"../../dom/types\";\n\nimport Rea from \"./ReanimatedProxy\";\n\nexport let HAS_REANIMATED = false;\nexport let HAS_REANIMATED_3 = false;\ntry {\n // This logic is convoluted but necessary\n // In most systems, `require(\"react-native-reanimated\")` throws an error, all is well.\n // In webpack, in some configuration it will return an empty object.\n // So it will not throw an error and we need to check the version to know if it's there.\n const reanimatedVersion =\n require(\"react-native-reanimated/package.json\").version;\n require(\"react-native-reanimated\");\n HAS_REANIMATED = !!reanimatedVersion;\n if (\n reanimatedVersion &&\n (reanimatedVersion >= \"3.0.0\" || reanimatedVersion.includes(\"3.0.0-\"))\n ) {\n HAS_REANIMATED_3 = true;\n }\n} catch (e) {\n HAS_REANIMATED = false;\n}\n\nconst _bindings = new WeakMap<Node<unknown>, unknown>();\n\nexport const unbindReanimatedNode = (node: Node<unknown>) => {\n if (!HAS_REANIMATED) {\n return;\n }\n const previousMapperId = _bindings.get(node);\n if (previousMapperId !== undefined) {\n Rea.stopMapper(previousMapperId as number);\n }\n};\n\nexport function extractReanimatedProps(props: AnimatedProps<any>) {\n if (!HAS_REANIMATED) {\n return [props, {}];\n }\n const reanimatedProps = {} as AnimatedProps<any>;\n const otherProps = {} as AnimatedProps<any>;\n for (const propName in props) {\n if (propName === \"children\") {\n continue;\n }\n const propValue = props[propName];\n if (Rea.isSharedValue(propValue)) {\n reanimatedProps[propName] = propValue;\n otherProps[propName] = propValue.value;\n } else {\n otherProps[propName] = propValue;\n }\n }\n return [otherProps, reanimatedProps];\n}\n\nfunction bindReanimatedProps2(\n container: Container,\n node: Node<any>,\n reanimatedProps: AnimatedProps<any>\n) {\n const sharedValues = Object.values(reanimatedProps);\n const previousMapperId = _bindings.get(node);\n if (previousMapperId !== undefined) {\n Rea.stopMapper(previousMapperId as number);\n }\n if (sharedValues.length > 0) {\n const viewId = container.getNativeId();\n const { SkiaViewApi } = global;\n const updateProps = () => {\n for (const propName in reanimatedProps) {\n node && node.setProp(propName, reanimatedProps[propName].value);\n }\n // On React Native we use the SkiaViewApi to redraw because it can\n // run on the worklet thread (container.redraw can't)\n // if SkiaViewApi is undefined, we are on web and container.redraw()\n // can safely be invoked\n if (SkiaViewApi) {\n SkiaViewApi.requestRedraw(viewId);\n } else {\n container.redraw();\n }\n };\n const mapperId = Rea.startMapper(() => {\n \"worklet\";\n Rea.runOnJS(updateProps)();\n }, sharedValues);\n _bindings.set(node, mapperId);\n }\n}\n\nexport function bindReanimatedProps(\n container: Container,\n node: Node<any>,\n reanimatedProps: AnimatedProps<any>\n) {\n if (HAS_REANIMATED && !HAS_REANIMATED_3) {\n return bindReanimatedProps2(container, node, reanimatedProps);\n }\n if (!HAS_REANIMATED) {\n return;\n }\n const sharedValues = Object.values(reanimatedProps);\n const previousMapperId = _bindings.get(node);\n if (previousMapperId !== undefined) {\n Rea.stopMapper(previousMapperId as number);\n }\n if (sharedValues.length > 0) {\n const viewId = container.getNativeId();\n const { SkiaViewApi } = global;\n const mapperId = Rea.startMapper(() => {\n \"worklet\";\n if (node) {\n for (const propName in reanimatedProps) {\n node.setProp(propName, reanimatedProps[propName].value);\n }\n }\n // On React Native we use the SkiaViewApi to redraw because it can\n // run on the worklet thread (container.redraw can't)\n // if SkiaViewApi is undefined, we are on web and container.redraw()\n // can safely be invoked\n if (SkiaViewApi) {\n SkiaViewApi.requestRedraw(viewId);\n } else {\n container.redraw();\n }\n }, sharedValues);\n _bindings.set(node, mapperId);\n }\n}\n"],"mappings":";;;;;;;;;AAMA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AANpC;;AAQO,IAAIG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,KAAK;AAC1B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opRequireDefault","require","e","__esModule","default","HAS_REANIMATED_3","exports","reanimatedVersion","version","includes","_bindings","WeakMap","unbindReanimatedNode","node","previousMapperId","get","undefined","Rea","stopMapper","extractReanimatedProps","props","reanimatedProps","otherProps","propName","propValue","isSharedValue","value","bindReanimatedProps","container","sharedValues","Object","values","length","viewId","getNativeId","SkiaViewApi","global","mapperId","startMapper","setProp","requestRedraw","redraw","set"],"sources":["renderHelpers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Container } from \"../../renderer/Container\";\nimport type { AnimatedProps } from \"../../renderer/processors\";\nimport type { Node } from \"../../dom/types\";\n\nimport Rea from \"./ReanimatedProxy\";\n\nexport let HAS_REANIMATED_3 = false;\ntry {\n // This logic is convoluted but necessary\n // In most systems, `require(\"react-native-reanimated\")` throws an error, all is well.\n // In webpack, in some configuration it will return an empty object.\n // So it will not throw an error and we need to check the version to know if it's there.\n const reanimatedVersion =\n require(\"react-native-reanimated/package.json\").version;\n require(\"react-native-reanimated\");\n if (\n reanimatedVersion &&\n (reanimatedVersion >= \"3.0.0\" || reanimatedVersion.includes(\"3.0.0-\"))\n ) {\n HAS_REANIMATED_3 = true;\n }\n} catch (e) {\n // do nothing\n}\n\nconst _bindings = new WeakMap<Node<unknown>, unknown>();\n\nexport const unbindReanimatedNode = (node: Node<unknown>) => {\n if (!HAS_REANIMATED_3) {\n return;\n }\n const previousMapperId = _bindings.get(node);\n if (previousMapperId !== undefined) {\n Rea.stopMapper(previousMapperId as number);\n }\n};\n\nexport function extractReanimatedProps(props: AnimatedProps<any>) {\n if (!HAS_REANIMATED_3) {\n return [props, {}];\n }\n const reanimatedProps = {} as AnimatedProps<any>;\n const otherProps = {} as AnimatedProps<any>;\n for (const propName in props) {\n if (propName === \"children\") {\n continue;\n }\n const propValue = props[propName];\n if (Rea.isSharedValue(propValue)) {\n reanimatedProps[propName] = propValue;\n otherProps[propName] = propValue.value;\n } else {\n otherProps[propName] = propValue;\n }\n }\n return [otherProps, reanimatedProps];\n}\n\nexport function bindReanimatedProps(\n container: Container,\n node: Node<any>,\n reanimatedProps: AnimatedProps<any>\n) {\n if (!HAS_REANIMATED_3) {\n return;\n }\n const sharedValues = Object.values(reanimatedProps);\n const previousMapperId = _bindings.get(node);\n if (previousMapperId !== undefined) {\n Rea.stopMapper(previousMapperId as number);\n }\n if (sharedValues.length > 0) {\n const viewId = container.getNativeId();\n const { SkiaViewApi } = global;\n const mapperId = Rea.startMapper(() => {\n \"worklet\";\n if (node) {\n for (const propName in reanimatedProps) {\n node.setProp(propName, reanimatedProps[propName].value);\n }\n }\n // On React Native we use the SkiaViewApi to redraw because it can\n // run on the worklet thread (container.redraw can't)\n // if SkiaViewApi is undefined, we are on web and container.redraw()\n // can safely be invoked\n if (SkiaViewApi) {\n SkiaViewApi.requestRedraw(viewId);\n } else {\n container.redraw();\n }\n }, sharedValues);\n _bindings.set(node, mapperId);\n }\n}\n"],"mappings":";;;;;;;;;AAMA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAoC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AANpC;;AAQO,IAAIG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,KAAK;AACnC,IAAI;EACF;EACA;EACA;EACA;EACA,MAAME,iBAAiB,GACrBN,OAAO,CAAC,sCAAsC,CAAC,CAACO,OAAO;EACzDP,OAAO,CAAC,yBAAyB,CAAC;EAClC,IACEM,iBAAiB,KAChBA,iBAAiB,IAAI,OAAO,IAAIA,iBAAiB,CAACE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EACtE;IACAH,OAAA,CAAAD,gBAAA,GAAAA,gBAAgB,GAAG,IAAI;EACzB;AACF,CAAC,CAAC,OAAOH,CAAC,EAAE;EACV;AAAA;AAGF,MAAMQ,SAAS,GAAG,IAAIC,OAAO,CAAyB,CAAC;AAEhD,MA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,UAAU,CAACJ,gBAA0B,CAAC;EAC5C;EACA,IAAIe,YAAY,CAACG,MAAM,GAAG,CAAC,EAAE;IAC3B,MAAMC,MAAM,GAAGL,SAAS,CAACM,WAAW,CAAC,CAAC;IACtC,MAAM;MAAEC;IAAY,CAAC,GAAGC,MAAM;IAC9B,MAAMC,QAAQ,GAAGpB,wBAAG,CAACqB,WAAW,CAAC,MAAM;MACrC,SAAS;;MACT,IAAIzB,IAAI,EAAE;QACR,KAAK,MAAMU,QAAQ,IAAIF,eAAe,EAAE;UACtCR,IAAI,CAAC0B,OAAO,CAAChB,QAAQ,EAAEF,eAAe,CAACE,QAAQ,CAAC,CAACG,KAAK,CAAC;QACzD;MACF;MACA;MACA;MACA;MACA;MACA,IAAIS,WAAW,EAAE;QACfA,WAAW,CAACK,aAAa,CAACP,MAAM,CAAC;MACnC,CAAC,MAAM;QACLL,SAAS,CAACa,MAAM,CAAC,CAAC;MACpB;IACF,CAAC,EAAEZ,YAAY,CAAC;IAChBnB,SAAS,CAACgC,GAAG,CAAC7B,IAAI,EAAEwB,QAAQ,CAAC;EAC/B;AACF","ignoreList":[]}
@@ -35,6 +35,7 @@ export interface SkPaint extends SkJSIInstance<"Paint"> {
35
35
  SkPaint with the result of SkPaint().
36
36
  */
37
37
  reset(): void;
38
+ assign(paint: SkPaint): void;
38
39
  /**
39
40
  * Retrieves the alpha and RGB unpremultiplied. RGB are extended sRGB values
40
41
  * (sRGB gamut, and encoded with the sRGB transfer function).
@@ -1 +1 @@
1
- {"version":3,"names":["PaintStyle","exports","StrokeCap","StrokeJoin","isPaint","obj","__typename__"],"sources":["Paint.ts"],"sourcesContent":["import type { SkImageFilter } from \"../ImageFilter\";\nimport type { SkMaskFilter } from \"../MaskFilter\";\nimport type { SkColorFilter } from \"../ColorFilter\";\nimport type { SkColor } from \"../Color\";\nimport type { SkPathEffect } from \"../PathEffect\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkShader } from \"../Shader\";\n\nimport type { BlendMode } from \"./BlendMode\";\n\nexport enum PaintStyle {\n Fill,\n Stroke,\n}\n\nexport enum StrokeCap {\n Butt,\n Round,\n Square,\n}\n\nexport enum StrokeJoin {\n Miter,\n Round,\n Bevel,\n}\n\nexport const isPaint = (obj: SkJSIInstance<string> | null): obj is SkPaint =>\n obj !== null && obj.__typename__ === \"Paint\";\n\nexport interface SkPaint extends SkJSIInstance<\"Paint\"> {\n /**\n * Retrieves alpha from the color used when stroking and filling.\n */\n getAlphaf(): number;\n\n /**\n * Returns a copy of this paint.\n */\n copy(): SkPaint;\n\n /**\n * Sets all SkPaint contents to their initial values. This is equivalent to replacing\n SkPaint with the result of SkPaint().\n */\n reset(): void;\n\n /**\n * Retrieves the alpha and RGB unpremultiplied. RGB are extended sRGB values\n * (sRGB gamut, and encoded with the sRGB transfer function).\n */\n getColor(): SkColor;\n\n /**\n * Returns the geometry drawn at the beginning and end of strokes.\n */\n getStrokeCap(): StrokeCap;\n\n /**\n * Returns the geometry drawn at the corners of strokes.\n */\n getStrokeJoin(): StrokeJoin;\n\n /**\n * Returns the limit at which a sharp corner is drawn beveled.\n */\n getStrokeMiter(): number;\n\n /**\n * Returns the thickness of the pen used to outline the shape.\n */\n getStrokeWidth(): number;\n\n /**\n * Replaces alpha, leaving RGBA unchanged. 0 means fully transparent, 1.0 means opaque.\n * @param alpha\n */\n setAlphaf(alpha: number): void;\n\n /**\n * Requests, but does not require, that edge pixels draw opaque or with\n * partial transparency.\n * @param aa\n */\n setAntiAlias: (aa: boolean) => void;\n\n /**\n * Requests, but does not require, to distribute color error.\n * @param dither\n */\n setDither: (dither: boolean) => void;\n\n /**\n * Sets the blend mode that is, the mode used to combine source color\n * with destination color.\n * @param mode\n */\n setBlendMode: (blendMode: BlendMode) => void;\n\n /**\n * Sets alpha and RGB used when stroking and filling. The color is a 32-bit\n * value, unpremultiplied, packing 8-bit components for alpha, red, blue,\n * and green.\n *\n * @param color unpremultiplied ARGB\n *\n * example: https://fiddle.skia.org/c/@Paint_setColor\n */\n setColor(color: SkColor): void;\n\n /**\n * Sets the current color filter, replacing the existing one if there was one.\n * @param filter\n */\n setColorFilter(filter: SkColorFilter | null): void;\n\n /**\n * Sets the current image filter, replacing the existing one if there was one.\n * @param filter\n */\n setImageFilter(filter: SkImageFilter | null): void;\n\n /**\n * Sets the current mask filter, replacing the existing one if there was one.\n * @param filter\n */\n setMaskFilter(filter: SkMaskFilter | null): void;\n\n /**\n * Sets the current path effect, replacing the existing one if there was one.\n * @param effect\n */\n setPathEffect(effect: SkPathEffect | null): void;\n\n /**\n * Sets the current shader, replacing the existing one if there was one.\n * @param shader\n */\n setShader(shader: SkShader | null): void;\n\n /**\n * Sets the geometry drawn at the beginning and end of strokes.\n * @param cap\n */\n setStrokeCap(cap: StrokeCap): void;\n\n /**\n * Sets the geometry drawn at the corners of strokes.\n * @param join\n */\n setStrokeJoin(join: StrokeJoin): void;\n\n /**\n * Sets the limit at which a sharp corner is drawn beveled.\n * @param limit\n */\n setStrokeMiter(limit: number): void;\n\n /**\n * Sets the thickness of the pen used to outline the shape.\n * @param width\n */\n setStrokeWidth(width: number): void;\n\n /**\n * Sets whether the geometry is filled or stroked.\n * @param style\n */\n setStyle(style: PaintStyle): void;\n}\n"],"mappings":";;;;;;IAUYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAKVE,SAAS,GAAAD,OAAA,CAAAC,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAAA,IAMTC,UAAU,GAAAF,OAAA,CAAAE,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAMf,MAAMC,OAAO,GAAIC,GAAiC,IACvDA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,OAAO;AAACL,OAAA,CAAAG,OAAA,GAAAA,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["PaintStyle","exports","StrokeCap","StrokeJoin","isPaint","obj","__typename__"],"sources":["Paint.ts"],"sourcesContent":["import type { SkImageFilter } from \"../ImageFilter\";\nimport type { SkMaskFilter } from \"../MaskFilter\";\nimport type { SkColorFilter } from \"../ColorFilter\";\nimport type { SkColor } from \"../Color\";\nimport type { SkPathEffect } from \"../PathEffect\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkShader } from \"../Shader\";\n\nimport type { BlendMode } from \"./BlendMode\";\n\nexport enum PaintStyle {\n Fill,\n Stroke,\n}\n\nexport enum StrokeCap {\n Butt,\n Round,\n Square,\n}\n\nexport enum StrokeJoin {\n Miter,\n Round,\n Bevel,\n}\n\nexport const isPaint = (obj: SkJSIInstance<string> | null): obj is SkPaint =>\n obj !== null && obj.__typename__ === \"Paint\";\n\nexport interface SkPaint extends SkJSIInstance<\"Paint\"> {\n /**\n * Retrieves alpha from the color used when stroking and filling.\n */\n getAlphaf(): number;\n\n /**\n * Returns a copy of this paint.\n */\n copy(): SkPaint;\n\n /**\n * Sets all SkPaint contents to their initial values. This is equivalent to replacing\n SkPaint with the result of SkPaint().\n */\n reset(): void;\n\n assign(paint: SkPaint): void;\n\n /**\n * Retrieves the alpha and RGB unpremultiplied. RGB are extended sRGB values\n * (sRGB gamut, and encoded with the sRGB transfer function).\n */\n getColor(): SkColor;\n\n /**\n * Returns the geometry drawn at the beginning and end of strokes.\n */\n getStrokeCap(): StrokeCap;\n\n /**\n * Returns the geometry drawn at the corners of strokes.\n */\n getStrokeJoin(): StrokeJoin;\n\n /**\n * Returns the limit at which a sharp corner is drawn beveled.\n */\n getStrokeMiter(): number;\n\n /**\n * Returns the thickness of the pen used to outline the shape.\n */\n getStrokeWidth(): number;\n\n /**\n * Replaces alpha, leaving RGBA unchanged. 0 means fully transparent, 1.0 means opaque.\n * @param alpha\n */\n setAlphaf(alpha: number): void;\n\n /**\n * Requests, but does not require, that edge pixels draw opaque or with\n * partial transparency.\n * @param aa\n */\n setAntiAlias: (aa: boolean) => void;\n\n /**\n * Requests, but does not require, to distribute color error.\n * @param dither\n */\n setDither: (dither: boolean) => void;\n\n /**\n * Sets the blend mode that is, the mode used to combine source color\n * with destination color.\n * @param mode\n */\n setBlendMode: (blendMode: BlendMode) => void;\n\n /**\n * Sets alpha and RGB used when stroking and filling. The color is a 32-bit\n * value, unpremultiplied, packing 8-bit components for alpha, red, blue,\n * and green.\n *\n * @param color unpremultiplied ARGB\n *\n * example: https://fiddle.skia.org/c/@Paint_setColor\n */\n setColor(color: SkColor): void;\n\n /**\n * Sets the current color filter, replacing the existing one if there was one.\n * @param filter\n */\n setColorFilter(filter: SkColorFilter | null): void;\n\n /**\n * Sets the current image filter, replacing the existing one if there was one.\n * @param filter\n */\n setImageFilter(filter: SkImageFilter | null): void;\n\n /**\n * Sets the current mask filter, replacing the existing one if there was one.\n * @param filter\n */\n setMaskFilter(filter: SkMaskFilter | null): void;\n\n /**\n * Sets the current path effect, replacing the existing one if there was one.\n * @param effect\n */\n setPathEffect(effect: SkPathEffect | null): void;\n\n /**\n * Sets the current shader, replacing the existing one if there was one.\n * @param shader\n */\n setShader(shader: SkShader | null): void;\n\n /**\n * Sets the geometry drawn at the beginning and end of strokes.\n * @param cap\n */\n setStrokeCap(cap: StrokeCap): void;\n\n /**\n * Sets the geometry drawn at the corners of strokes.\n * @param join\n */\n setStrokeJoin(join: StrokeJoin): void;\n\n /**\n * Sets the limit at which a sharp corner is drawn beveled.\n * @param limit\n */\n setStrokeMiter(limit: number): void;\n\n /**\n * Sets the thickness of the pen used to outline the shape.\n * @param width\n */\n setStrokeWidth(width: number): void;\n\n /**\n * Sets whether the geometry is filled or stroked.\n * @param style\n */\n setStyle(style: PaintStyle): void;\n}\n"],"mappings":";;;;;;IAUYA,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAKVE,SAAS,GAAAD,OAAA,CAAAC,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAAA,IAMTC,UAAU,GAAAF,OAAA,CAAAE,UAAA,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAMf,MAAMC,OAAO,GAAIC,GAAiC,IACvDA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,OAAO;AAACL,OAAA,CAAAG,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -5,6 +5,7 @@ export declare class JsiSkPaint extends HostObject<Paint, "Paint"> implements Sk
5
5
  constructor(CanvasKit: CanvasKit, ref: Paint);
6
6
  dispose: () => void;
7
7
  copy(): JsiSkPaint;
8
+ assign(paint: JsiSkPaint): void;
8
9
  reset(): void;
9
10
  getAlphaf(): number;
10
11
  getColor(): Float32Array;
@@ -23,6 +23,9 @@ class JsiSkPaint extends _Host.HostObject {
23
23
  copy() {
24
24
  return new JsiSkPaint(this.CanvasKit, this.ref.copy());
25
25
  }
26
+ assign(paint) {
27
+ this.ref = paint.ref.copy();
28
+ }
26
29
  reset() {
27
30
  this.ref = new this.CanvasKit.Paint();
28
31
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_Host","require","_JsiSkColorFilter","_JsiSkImageFilter","_JsiSkMaskFilter","_JsiSkPathEffect","_JsiSkShader","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","JsiSkPaint","HostObject","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","getEnum","BlendMode","setColor","color","setColorFilter","filter","JsiSkColorFilter","fromValue","setImageFilter","JsiSkImageFilter","setMaskFilter","JsiSkMaskFilter","setPathEffect","effect","JsiSkPathEffect","setShader","shader","JsiSkShader","setStrokeCap","cap","StrokeCap","setStrokeJoin","join","StrokeJoin","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style","exports"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;;;;;AAgBA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAA4C,SAAAM,gBAAAC,CA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,CAAArD,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Host","require","_JsiSkColorFilter","_JsiSkImageFilter","_JsiSkMaskFilter","_JsiSkPathEffect","_JsiSkShader","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","JsiSkPaint","HostObject","constructor","CanvasKit","ref","delete","copy","assign","paint","reset","Paint","getAlphaf","getColor","getStrokeCap","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","getEnum","BlendMode","setColor","color","setColorFilter","filter","JsiSkColorFilter","fromValue","setImageFilter","JsiSkImageFilter","setMaskFilter","JsiSkMaskFilter","setPathEffect","effect","JsiSkPathEffect","setShader","shader","JsiSkShader","setStrokeCap","cap","StrokeCap","setStrokeJoin","join","StrokeJoin","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style","exports"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n assign(paint: JsiSkPaint) {\n this.ref = paint.ref.copy();\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style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AAI,CAACtB,SAAS,CAAC6C,UAAU,EAAED,IAAI,CAAC,CAAC;EAClE;EAEAE,cAAcA,CAACC,KAAa,EAAE;IAC5B,IAAI,CAAC9C,GAAG,CAAC6C,cAAc,CAACC,KAAK,CAAC;EAChC;EAEAC,cAAcA,CAACC,KAAa,EAAE;IAC5B,IAAI,CAAChD,GAAG,CAAC+C,cAAc,CAACC,KAAK,CAAC;EAChC;EAEAC,QAAQA,CAACC,KAAiB,EAAE;IAC1B,IAAI,CAAClD,GAAG,CAACiD,QAAQ,CAAC;MAAEjE,KAAK,EAAEkE;IAAM,CAAC,CAAC;EACrC;AACF;AAACC,OAAA,CAAAvD,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1,9 +1,10 @@
1
1
  import type { Skia, SkCanvas } from "../skia/types";
2
- import type { Node } from "./nodes";
2
+ import type { Node } from "./Node";
3
3
  export declare class Container {
4
4
  Skia: Skia;
5
5
  private nativeId;
6
- _root: Node[];
6
+ private _root;
7
+ private _recording;
7
8
  unmounted: boolean;
8
9
  private values;
9
10
  private mapperId;
@@ -5,25 +5,30 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Container = void 0;
7
7
  var _ReanimatedProxy = _interopRequireDefault(require("../external/reanimated/ReanimatedProxy"));
8
- var _renderHelpers = require("../external/reanimated/renderHelpers");
9
- var _DrawingContext = require("./DrawingContext");
10
- var _nodes = require("./nodes");
8
+ var _utils = require("./utils");
9
+ var _Recorder = require("./Recorder/Recorder");
10
+ var _Visitor = require("./Recorder/Visitor");
11
+ var _Player = require("./Recorder/Player");
12
+ var _DrawingContext = require("./Recorder/DrawingContext");
13
+ var _Recording = require("./Recorder/Recording");
11
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
15
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
17
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
- const drawOnscreen = (Skia, nativeId, root) => {
18
+ const drawOnscreen = (Skia, nativeId, recording) => {
16
19
  "worklet";
17
20
 
18
21
  const rec = Skia.PictureRecorder();
19
22
  const canvas = rec.beginRecording();
20
- // TODO: This is only support from 3.15 and above (check the exact version)
21
- // This could be polyfilled in C++ if needed (or in JS via functions only?)
22
- const ctx = (0, _DrawingContext.createDrawingContext)(Skia, canvas);
23
- root.forEach(node => {
24
- (0, _nodes.draw)(ctx, node);
25
- });
23
+ // const start = performance.now();
24
+
25
+ // TODO: because the pool is not a shared value here, it is copied on every frame
26
+ const ctx = (0, _DrawingContext.createDrawingContext)(Skia, recording.paintPool, canvas);
27
+ //console.log(recording.commands);
28
+ (0, _Player.replay)(ctx, recording.commands);
26
29
  const picture = rec.finishRecordingAsPicture();
30
+ //const end = performance.now();
31
+ //console.log("Recording time: ", end - start);
27
32
  SkiaViewApi.setJsiProperty(nativeId, "picture", picture);
28
33
  };
29
34
  class Container {
@@ -31,6 +36,7 @@ class Container {
31
36
  this.Skia = Skia;
32
37
  this.nativeId = nativeId;
33
38
  _defineProperty(this, "_root", []);
39
+ _defineProperty(this, "_recording", null);
34
40
  _defineProperty(this, "unmounted", false);
35
41
  _defineProperty(this, "values", new Set());
36
42
  _defineProperty(this, "mapperId", null);
@@ -40,41 +46,39 @@ class Container {
40
46
  }
41
47
  set root(root) {
42
48
  const isOnscreen = this.nativeId !== -1;
43
- if (_renderHelpers.HAS_REANIMATED && !_renderHelpers.HAS_REANIMATED_3) {
44
- throw new Error("React Native Skia only supports Reanimated 3 and above");
45
- }
46
49
  if (isOnscreen) {
47
50
  if (this.mapperId !== null) {
48
51
  _ReanimatedProxy.default.stopMapper(this.mapperId);
49
52
  }
50
53
  const {
51
54
  nativeId,
52
- Skia
55
+ Skia,
56
+ _recording
53
57
  } = this;
54
58
  this.mapperId = _ReanimatedProxy.default.startMapper(() => {
55
59
  "worklet";
56
60
 
57
- drawOnscreen(Skia, nativeId, root);
61
+ drawOnscreen(Skia, nativeId, _recording);
58
62
  }, Array.from(this.values));
59
63
  }
60
64
  this._root = root;
65
+ const recorder = new _Recorder.Recorder();
66
+ (0, _Visitor.visit)(recorder, root);
67
+ this._recording = (0, _Recording.createRecording)(recorder.commands);
61
68
  }
62
69
  clear() {
63
70
  console.log("clear container");
64
71
  }
65
72
  redraw() {
66
73
  const isOnscreen = this.nativeId !== -1;
67
- if (_renderHelpers.HAS_REANIMATED && !_renderHelpers.HAS_REANIMATED_3) {
68
- throw new Error("React Native Skia only supports Reanimated 3 and above");
69
- }
70
74
  if (isOnscreen) {
71
75
  const {
72
76
  nativeId,
73
77
  Skia,
74
- root
78
+ _recording
75
79
  } = this;
76
80
  _ReanimatedProxy.default.runOnUI(() => {
77
- drawOnscreen(Skia, nativeId, root);
81
+ drawOnscreen(Skia, nativeId, _recording);
78
82
  })();
79
83
  }
80
84
  }
@@ -82,20 +86,22 @@ class Container {
82
86
  return this.nativeId;
83
87
  }
84
88
  unregisterValues(values) {
85
- Object.values(values).filter(_nodes.isSharedValue).forEach(value => {
89
+ Object.values(values).filter(_utils.isSharedValue).forEach(value => {
86
90
  this.values.delete(value);
87
91
  });
88
92
  }
89
93
  registerValues(values) {
90
- Object.values(values).filter(_nodes.isSharedValue).forEach(value => {
94
+ Object.values(values).filter(_utils.isSharedValue).forEach(value => {
91
95
  this.values.add(value);
92
96
  });
93
97
  }
94
98
  drawOnCanvas(canvas) {
95
- const ctx = (0, _DrawingContext.createDrawingContext)(this.Skia, canvas);
96
- this.root.forEach(node => {
97
- (0, _nodes.draw)(ctx, node);
98
- });
99
+ if (!this._recording) {
100
+ throw new Error("No recording to draw");
101
+ }
102
+ const ctx = (0, _DrawingContext.createDrawingContext)(this.Skia, this._recording.paintPool, canvas);
103
+ //console.log(this._recording);
104
+ (0, _Player.replay)(ctx, this._recording.commands);
99
105
  }
100
106
  }
101
107
  exports.Container = Container;
@@ -1 +1 @@
1
- {"version":3,"names":["_ReanimatedProxy","_interopRequireDefault","require","_renderHelpers","_DrawingContext","_nodes","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","drawOnscreen","Skia","nativeId","root","rec","PictureRecorder","canvas","beginRecording","ctx","createDrawingContext","forEach","node","draw","picture","finishRecordingAsPicture","SkiaViewApi","setJsiProperty","Container","constructor","Set","_root","isOnscreen","HAS_REANIMATED","HAS_REANIMATED_3","Error","mapperId","Rea","stopMapper","startMapper","Array","from","values","clear","console","log","redraw","runOnUI","getNativeId","unregisterValues","filter","isSharedValue","delete","registerValues","add","drawOnCanvas","exports"],"sources":["Container.ts"],"sourcesContent":["import { type SharedValue } from \"react-native-reanimated\";\n\nimport Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkCanvas } from \"../skia/types\";\nimport {\n HAS_REANIMATED,\n HAS_REANIMATED_3,\n} from \"../external/reanimated/renderHelpers\";\n\nimport { createDrawingContext } from \"./DrawingContext\";\nimport type { Node } from \"./nodes\";\nimport { draw, isSharedValue } from \"./nodes\";\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, root: Node[]) => {\n \"worklet\";\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n // TODO: This is only support from 3.15 and above (check the exact version)\n // This could be polyfilled in C++ if needed (or in JS via functions only?)\n const ctx = createDrawingContext(Skia, canvas);\n root.forEach((node) => {\n draw(ctx, node);\n });\n const picture = rec.finishRecordingAsPicture();\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nexport class Container {\n public _root: Node[] = [];\n public unmounted = false;\n\n private values = new Set<SharedValue<unknown>>();\n private mapperId: number | null = null;\n\n constructor(public Skia: Skia, private nativeId: number) {}\n\n get root() {\n return this._root;\n }\n\n set root(root: Node[]) {\n const isOnscreen = this.nativeId !== -1;\n if (HAS_REANIMATED && !HAS_REANIMATED_3) {\n throw new Error(\"React Native Skia only supports Reanimated 3 and above\");\n }\n if (isOnscreen) {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n const { nativeId, Skia } = this;\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, root);\n }, Array.from(this.values));\n }\n this._root = root;\n }\n\n clear() {\n console.log(\"clear container\");\n }\n\n redraw() {\n const isOnscreen = this.nativeId !== -1;\n if (HAS_REANIMATED && !HAS_REANIMATED_3) {\n throw new Error(\"React Native Skia only supports Reanimated 3 and above\");\n }\n if (isOnscreen) {\n const { nativeId, Skia, root } = this;\n Rea.runOnUI(() => {\n drawOnscreen(Skia, nativeId, root);\n })();\n }\n }\n\n getNativeId() {\n return this.nativeId;\n }\n\n unregisterValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.delete(value);\n });\n }\n\n registerValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.add(value);\n });\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n const ctx = createDrawingContext(this.Skia, canvas);\n this.root.forEach((node) => {\n draw(ctx, node);\n });\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AAKA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAA8C,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,G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IH,UAAU,EAAE;MACd,MAAM;QAAEnB,QAAQ;QAAED,IAAI;QAAEE;MAAK,CAAC,GAAG,IAAI;MACrCuB,wBAAG,CAACU,OAAO,CAAC,MAAM;QAChBpC,YAAY,CAACC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,CAAC;MACpC,CAAC,CAAC,CAAC,CAAC;IACN;EACF;EAEAkC,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACnC,QAAQ;EACtB;EAEAoC,gBAAgBA,CAACP,MAAc,EAAE;IAC/B7C,MAAM,CAAC6C,MAAM,CAACA,MAAM,CAAC,CAClBQ,MAAM,CAACC,oBAAa,CAAC,CACrB9B,OAAO,CAAEtB,KAAK,IAAK;MAClB,IAAI,CAAC2C,MAAM,CAACU,MAAM,CAACrD,KAAK,CAAC;IAC3B,CAAC,CAAC;EACN;EAEAsD,cAAcA,CAACX,MAAc,EAAE;IAC7B7C,MAAM,CAAC6C,MAAM,CAACA,MAAM,CAAC,CAClBQ,MAAM,CAACC,oBAAa,CAAC,CACrB9B,OAAO,CAAEtB,KAAK,IAAK;MAClB,IAAI,CAAC2C,MAAM,CAACY,GAAG,CAACvD,KAAK,CAAC;IACxB,CAAC,CAAC;EACN;EAEAwD,YAAYA,CAACtC,MAAgB,EAAE;IAC7B,MAAME,GAAG,GAAG,IAAAC,oCAAoB,EAAC,IAAI,CAACR,IAAI,EAAEK,MAAM,CAAC;IACnD,IAAI,CAACH,IAAI,CAACO,OAAO,CAAEC,IAAI,IAAK;MAC1B,IAAAC,WAAI,EAACJ,GAAG,EAAEG,IAAI,CAAC;IACjB,CAAC,CAAC;EACJ;AACF;AAACkC,OAAA,CAAA5B,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_ReanimatedProxy","_interopRequireDefault","require","_utils","_Recorder","_Visitor","_Player","_DrawingContext","_Recording","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","drawOnscreen","Skia","nativeId","recording","rec","PictureRecorder","canvas","beginRecording","ctx","createDrawingContext","paintPool","replay","commands","picture","finishRecordingAsPicture","SkiaViewApi","setJsiProperty","Container","constructor","Set","root","_root","isOnscreen","mapperId","Rea","stopMapper","_recording","startMapper","Array","from","values","recorder","Recorder","visit","createRecording","clear","console","log","redraw","runOnUI","getNativeId","unregisterValues","filter","isSharedValue","forEach","delete","registerValues","add","drawOnCanvas","Error","exports"],"sources":["Container.ts"],"sourcesContent":["import { type SharedValue } from \"react-native-reanimated\";\n\nimport Rea from \"../external/reanimated/ReanimatedProxy\";\nimport type { Skia, SkCanvas } from \"../skia/types\";\n\nimport type { Node } from \"./Node\";\nimport { isSharedValue } from \"./utils\";\nimport { Recorder } from \"./Recorder/Recorder\";\nimport { visit } from \"./Recorder/Visitor\";\nimport { replay } from \"./Recorder/Player\";\nimport { createDrawingContext } from \"./Recorder/DrawingContext\";\nimport { createRecording, type Recording } from \"./Recorder/Recording\";\n\nconst drawOnscreen = (Skia: Skia, nativeId: number, recording: Recording) => {\n \"worklet\";\n const rec = Skia.PictureRecorder();\n const canvas = rec.beginRecording();\n // const start = performance.now();\n\n // TODO: because the pool is not a shared value here, it is copied on every frame\n const ctx = createDrawingContext(Skia, recording.paintPool, canvas);\n //console.log(recording.commands);\n replay(ctx, recording.commands);\n const picture = rec.finishRecordingAsPicture();\n //const end = performance.now();\n //console.log(\"Recording time: \", end - start);\n SkiaViewApi.setJsiProperty(nativeId, \"picture\", picture);\n};\n\nexport class Container {\n private _root: Node[] = [];\n private _recording: Recording | null = null;\n public unmounted = false;\n\n private values = new Set<SharedValue<unknown>>();\n private mapperId: number | null = null;\n\n constructor(public Skia: Skia, private nativeId: number) {}\n\n get root() {\n return this._root;\n }\n\n set root(root: Node[]) {\n const isOnscreen = this.nativeId !== -1;\n if (isOnscreen) {\n if (this.mapperId !== null) {\n Rea.stopMapper(this.mapperId);\n }\n const { nativeId, Skia, _recording } = this;\n this.mapperId = Rea.startMapper(() => {\n \"worklet\";\n drawOnscreen(Skia, nativeId, _recording!);\n }, Array.from(this.values));\n }\n this._root = root;\n const recorder = new Recorder();\n visit(recorder, root);\n this._recording = createRecording(recorder.commands);\n }\n\n clear() {\n console.log(\"clear container\");\n }\n\n redraw() {\n const isOnscreen = this.nativeId !== -1;\n if (isOnscreen) {\n const { nativeId, Skia, _recording } = this;\n Rea.runOnUI(() => {\n drawOnscreen(Skia, nativeId, _recording!);\n })();\n }\n }\n\n getNativeId() {\n return this.nativeId;\n }\n\n unregisterValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.delete(value);\n });\n }\n\n registerValues(values: object) {\n Object.values(values)\n .filter(isSharedValue)\n .forEach((value) => {\n this.values.add(value);\n });\n }\n\n drawOnCanvas(canvas: SkCanvas) {\n if (!this._recording) {\n throw new Error(\"No recording to draw\");\n }\n const ctx = createDrawingContext(\n this.Skia,\n this._recording.paintPool,\n canvas\n );\n //console.log(this._recording);\n replay(ctx, this._recording.commands);\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAAuE,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MA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CAAC,MAAM;QAChBvC,YAAY,CAACC,IAAI,EAAEC,QAAQ,EAAEwB,UAAW,CAAC;MAC3C,CAAC,CAAC,CAAC,CAAC;IACN;EACF;EAEAc,WAAWA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACtC,QAAQ;EACtB;EAEAuC,gBAAgBA,CAACX,MAAc,EAAE;IAC/B5C,MAAM,CAAC4C,MAAM,CAACA,MAAM,CAAC,CAClBY,MAAM,CAACC,oBAAa,CAAC,CACrBC,OAAO,CAAExD,KAAK,IAAK;MAClB,IAAI,CAAC0C,MAAM,CAACe,MAAM,CAACzD,KAAK,CAAC;IAC3B,CAAC,CAAC;EACN;EAEA0D,cAAcA,CAAChB,MAAc,EAAE;IAC7B5C,MAAM,CAAC4C,MAAM,CAACA,MAAM,CAAC,CAClBY,MAAM,CAACC,oBAAa,CAAC,CACrBC,OAAO,CAAExD,KAAK,IAAK;MAClB,IAAI,CAAC0C,MAAM,CAACiB,GAAG,CAAC3D,KAAK,CAAC;IACxB,CAAC,CAAC;EACN;EAEA4D,YAAYA,CAAC1C,MAAgB,EAAE;IAC7B,IAAI,CAAC,IAAI,CAACoB,UAAU,EAAE;MACpB,MAAM,IAAIuB,KAAK,CAAC,sBAAsB,CAAC;IACzC;IACA,MAAMzC,GAAG,GAAG,IAAAC,oCAAoB,EAC9B,IAAI,CAACR,IAAI,EACT,IAAI,CAACyB,UAAU,CAAChB,SAAS,EACzBJ,MACF,CAAC;IACD;IACA,IAAAK,cAAM,EAACH,GAAG,EAAE,IAAI,CAACkB,UAAU,CAACd,QAAQ,CAAC;EACvC;AACF;AAACsC,OAAA,CAAAjC,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { HostConfig } from "react-reconciler";
2
- import { NodeType } from "../dom/types";
3
- import type { Node } from "./nodes/Node";
2
+ import type { NodeType } from "../dom/types";
3
+ import type { Node } from "./Node";
4
4
  import type { Container } from "./Container";
5
5
  export declare const debug: (message?: any, ...optionalParams: any[]) => void;
6
6
  type Instance = Node;