@shopify/react-native-skia 1.7.7 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (663) hide show
  1. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +3 -7
  2. package/lib/commonjs/dom/nodes/JsiSkDOM.js +58 -70
  3. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  4. package/lib/commonjs/dom/nodes/datatypes/Circle.js +4 -1
  5. package/lib/commonjs/dom/nodes/datatypes/Circle.js.map +1 -1
  6. package/lib/commonjs/dom/nodes/datatypes/Enum.js +5 -2
  7. package/lib/commonjs/dom/nodes/datatypes/Enum.js.map +1 -1
  8. package/lib/commonjs/dom/nodes/datatypes/Fitting.js +10 -1
  9. package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
  10. package/lib/commonjs/dom/nodes/datatypes/Gradient.js +17 -10
  11. package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
  12. package/lib/commonjs/dom/nodes/datatypes/Path.js +4 -1
  13. package/lib/commonjs/dom/nodes/datatypes/Path.js.map +1 -1
  14. package/lib/commonjs/dom/nodes/datatypes/Radius.js +2 -1
  15. package/lib/commonjs/dom/nodes/datatypes/Radius.js.map +1 -1
  16. package/lib/commonjs/dom/nodes/datatypes/Rect.js +16 -2
  17. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  18. package/lib/commonjs/dom/nodes/datatypes/Transform.js +4 -1
  19. package/lib/commonjs/dom/nodes/datatypes/Transform.js.map +1 -1
  20. package/lib/commonjs/dom/types/Node.d.ts +2 -5
  21. package/lib/commonjs/dom/types/Node.js.map +1 -1
  22. package/lib/commonjs/dom/types/index.d.ts +0 -2
  23. package/lib/commonjs/dom/types/index.js +0 -22
  24. package/lib/commonjs/dom/types/index.js.map +1 -1
  25. package/lib/commonjs/headless/index.js +3 -5
  26. package/lib/commonjs/headless/index.js.map +1 -1
  27. package/lib/commonjs/index.d.ts +1 -0
  28. package/lib/commonjs/index.js +12 -0
  29. package/lib/commonjs/index.js.map +1 -1
  30. package/lib/commonjs/renderer/Canvas.js +9 -26
  31. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  32. package/lib/commonjs/renderer/Canvas.web.d.ts +10 -0
  33. package/lib/commonjs/renderer/Canvas.web.js +110 -0
  34. package/lib/commonjs/renderer/Canvas.web.js.map +1 -0
  35. package/lib/commonjs/renderer/Canvas2.d.ts +10 -0
  36. package/lib/commonjs/renderer/Canvas2.js +104 -0
  37. package/lib/commonjs/renderer/Canvas2.js.map +1 -0
  38. package/lib/commonjs/renderer/Canvas2.web.d.ts +3 -0
  39. package/lib/commonjs/renderer/Canvas2.web.js +9 -0
  40. package/lib/commonjs/renderer/Canvas2.web.js.map +1 -0
  41. package/lib/commonjs/renderer/Container.d.ts +3 -5
  42. package/lib/commonjs/renderer/Container.js +2 -7
  43. package/lib/commonjs/renderer/Container.js.map +1 -1
  44. package/lib/commonjs/renderer/HostComponents.d.ts +3 -6
  45. package/lib/commonjs/renderer/HostComponents.js +1 -4
  46. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  47. package/lib/commonjs/renderer/Offscreen.js +3 -5
  48. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  49. package/lib/commonjs/renderer/Reconciler.d.ts +2 -3
  50. package/lib/commonjs/renderer/Reconciler.js +2 -2
  51. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  52. package/lib/commonjs/skia/types/Shader/Shader.js +6 -1
  53. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  54. package/lib/commonjs/sksg/Container.js +2 -2
  55. package/lib/commonjs/sksg/Container.js.map +1 -1
  56. package/lib/commonjs/sksg/DeclarationContext.d.ts +56 -0
  57. package/lib/commonjs/sksg/DeclarationContext.js +77 -0
  58. package/lib/commonjs/sksg/DeclarationContext.js.map +1 -0
  59. package/lib/commonjs/sksg/DrawingContext.d.ts +9 -12
  60. package/lib/commonjs/sksg/DrawingContext.js +63 -77
  61. package/lib/commonjs/sksg/DrawingContext.js.map +1 -1
  62. package/lib/commonjs/sksg/Reconciler.d.ts +2 -0
  63. package/lib/commonjs/sksg/Reconciler.js +7 -0
  64. package/lib/commonjs/sksg/Reconciler.js.map +1 -1
  65. package/lib/commonjs/sksg/nodes/colorFilters.d.ts +9 -6
  66. package/lib/commonjs/sksg/nodes/colorFilters.js +26 -2
  67. package/lib/commonjs/sksg/nodes/colorFilters.js.map +1 -1
  68. package/lib/commonjs/sksg/nodes/context.js +58 -112
  69. package/lib/commonjs/sksg/nodes/context.js.map +1 -1
  70. package/lib/commonjs/sksg/nodes/drawings.d.ts +1 -2
  71. package/lib/commonjs/sksg/nodes/drawings.js +43 -6
  72. package/lib/commonjs/sksg/nodes/drawings.js.map +1 -1
  73. package/lib/commonjs/sksg/nodes/imageFilters.d.ts +4 -1
  74. package/lib/commonjs/sksg/nodes/imageFilters.js +64 -2
  75. package/lib/commonjs/sksg/nodes/imageFilters.js.map +1 -1
  76. package/lib/commonjs/sksg/nodes/paint.d.ts +2 -1
  77. package/lib/commonjs/sksg/nodes/paint.js +2 -1
  78. package/lib/commonjs/sksg/nodes/paint.js.map +1 -1
  79. package/lib/commonjs/sksg/nodes/pathEffects.d.ts +10 -7
  80. package/lib/commonjs/sksg/nodes/pathEffects.js +30 -3
  81. package/lib/commonjs/sksg/nodes/pathEffects.js.map +1 -1
  82. package/lib/commonjs/sksg/nodes/shaders.d.ts +2 -1
  83. package/lib/commonjs/sksg/nodes/shaders.js +18 -1
  84. package/lib/commonjs/sksg/nodes/shaders.js.map +1 -1
  85. package/lib/commonjs/sksg/nodes/utils.js +4 -1
  86. package/lib/commonjs/sksg/nodes/utils.js.map +1 -1
  87. package/lib/commonjs/views/SkiaDomView.web.d.ts +0 -7
  88. package/lib/commonjs/views/SkiaDomView.web.js +0 -30
  89. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
  90. package/lib/commonjs/views/SkiaPictureView.web.d.ts +3 -1
  91. package/lib/commonjs/views/SkiaPictureView.web.js +10 -0
  92. package/lib/commonjs/views/SkiaPictureView.web.js.map +1 -1
  93. package/lib/commonjs/views/types.d.ts +2 -7
  94. package/lib/commonjs/views/types.js.map +1 -1
  95. package/lib/module/dom/nodes/JsiSkDOM.d.ts +3 -7
  96. package/lib/module/dom/nodes/JsiSkDOM.js +58 -70
  97. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  98. package/lib/module/dom/nodes/datatypes/Circle.js +4 -2
  99. package/lib/module/dom/nodes/datatypes/Circle.js.map +1 -1
  100. package/lib/module/dom/nodes/datatypes/Enum.js +4 -2
  101. package/lib/module/dom/nodes/datatypes/Enum.js.map +1 -1
  102. package/lib/module/dom/nodes/datatypes/Fitting.js +10 -2
  103. package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
  104. package/lib/module/dom/nodes/datatypes/Gradient.js +17 -11
  105. package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
  106. package/lib/module/dom/nodes/datatypes/Path.js +4 -2
  107. package/lib/module/dom/nodes/datatypes/Path.js.map +1 -1
  108. package/lib/module/dom/nodes/datatypes/Radius.js +2 -2
  109. package/lib/module/dom/nodes/datatypes/Radius.js.map +1 -1
  110. package/lib/module/dom/nodes/datatypes/Rect.js +15 -2
  111. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  112. package/lib/module/dom/nodes/datatypes/Transform.js +4 -2
  113. package/lib/module/dom/nodes/datatypes/Transform.js.map +1 -1
  114. package/lib/module/dom/types/Node.d.ts +2 -5
  115. package/lib/module/dom/types/Node.js.map +1 -1
  116. package/lib/module/dom/types/index.d.ts +0 -2
  117. package/lib/module/dom/types/index.js +0 -2
  118. package/lib/module/dom/types/index.js.map +1 -1
  119. package/lib/module/headless/index.js +3 -5
  120. package/lib/module/headless/index.js.map +1 -1
  121. package/lib/module/index.d.ts +1 -0
  122. package/lib/module/index.js +1 -0
  123. package/lib/module/index.js.map +1 -1
  124. package/lib/module/renderer/Canvas.js +9 -26
  125. package/lib/module/renderer/Canvas.js.map +1 -1
  126. package/lib/module/renderer/Canvas.web.d.ts +10 -0
  127. package/lib/module/renderer/Canvas.web.js +105 -0
  128. package/lib/module/renderer/Canvas.web.js.map +1 -0
  129. package/lib/module/renderer/Canvas2.d.ts +10 -0
  130. package/lib/module/renderer/Canvas2.js +97 -0
  131. package/lib/module/renderer/Canvas2.js.map +1 -0
  132. package/lib/module/renderer/Canvas2.web.d.ts +3 -0
  133. package/lib/module/renderer/Canvas2.web.js +3 -0
  134. package/lib/module/renderer/Canvas2.web.js.map +1 -0
  135. package/lib/module/renderer/Container.d.ts +3 -5
  136. package/lib/module/renderer/Container.js +2 -7
  137. package/lib/module/renderer/Container.js.map +1 -1
  138. package/lib/module/renderer/HostComponents.d.ts +3 -6
  139. package/lib/module/renderer/HostComponents.js +0 -3
  140. package/lib/module/renderer/HostComponents.js.map +1 -1
  141. package/lib/module/renderer/Offscreen.js +3 -5
  142. package/lib/module/renderer/Offscreen.js.map +1 -1
  143. package/lib/module/renderer/Reconciler.d.ts +2 -3
  144. package/lib/module/renderer/Reconciler.js +2 -2
  145. package/lib/module/renderer/Reconciler.js.map +1 -1
  146. package/lib/module/skia/types/Shader/Shader.js +6 -2
  147. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  148. package/lib/module/sksg/Container.js +3 -3
  149. package/lib/module/sksg/Container.js.map +1 -1
  150. package/lib/module/sksg/DeclarationContext.d.ts +56 -0
  151. package/lib/module/sksg/DeclarationContext.js +69 -0
  152. package/lib/module/sksg/DeclarationContext.js.map +1 -0
  153. package/lib/module/sksg/DrawingContext.d.ts +9 -12
  154. package/lib/module/sksg/DrawingContext.js +54 -69
  155. package/lib/module/sksg/DrawingContext.js.map +1 -1
  156. package/lib/module/sksg/Reconciler.d.ts +2 -0
  157. package/lib/module/sksg/Reconciler.js +7 -0
  158. package/lib/module/sksg/Reconciler.js.map +1 -1
  159. package/lib/module/sksg/nodes/colorFilters.d.ts +9 -6
  160. package/lib/module/sksg/nodes/colorFilters.js +24 -2
  161. package/lib/module/sksg/nodes/colorFilters.js.map +1 -1
  162. package/lib/module/sksg/nodes/context.js +45 -101
  163. package/lib/module/sksg/nodes/context.js.map +1 -1
  164. package/lib/module/sksg/nodes/drawings.d.ts +1 -2
  165. package/lib/module/sksg/nodes/drawings.js +42 -5
  166. package/lib/module/sksg/nodes/drawings.js.map +1 -1
  167. package/lib/module/sksg/nodes/imageFilters.d.ts +4 -1
  168. package/lib/module/sksg/nodes/imageFilters.js +61 -2
  169. package/lib/module/sksg/nodes/imageFilters.js.map +1 -1
  170. package/lib/module/sksg/nodes/paint.d.ts +2 -1
  171. package/lib/module/sksg/nodes/paint.js +2 -2
  172. package/lib/module/sksg/nodes/paint.js.map +1 -1
  173. package/lib/module/sksg/nodes/pathEffects.d.ts +10 -7
  174. package/lib/module/sksg/nodes/pathEffects.js +28 -3
  175. package/lib/module/sksg/nodes/pathEffects.js.map +1 -1
  176. package/lib/module/sksg/nodes/shaders.d.ts +2 -1
  177. package/lib/module/sksg/nodes/shaders.js +18 -2
  178. package/lib/module/sksg/nodes/shaders.js.map +1 -1
  179. package/lib/module/sksg/nodes/utils.js +4 -2
  180. package/lib/module/sksg/nodes/utils.js.map +1 -1
  181. package/lib/module/views/SkiaDomView.web.d.ts +0 -7
  182. package/lib/module/views/SkiaDomView.web.js +1 -24
  183. package/lib/module/views/SkiaDomView.web.js.map +1 -1
  184. package/lib/module/views/SkiaPictureView.web.d.ts +3 -1
  185. package/lib/module/views/SkiaPictureView.web.js +10 -0
  186. package/lib/module/views/SkiaPictureView.web.js.map +1 -1
  187. package/lib/module/views/types.d.ts +2 -7
  188. package/lib/module/views/types.js.map +1 -1
  189. package/lib/typescript/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +57 -67
  190. package/lib/typescript/lib/commonjs/renderer/Canvas.web.d.ts +3 -0
  191. package/lib/typescript/lib/commonjs/renderer/Canvas2.d.ts +3 -0
  192. package/lib/typescript/lib/commonjs/{dom/nodes/drawings/index.d.ts → renderer/Canvas2.web.d.ts} +1 -0
  193. package/lib/typescript/lib/commonjs/renderer/Container.d.ts +1 -2
  194. package/lib/typescript/lib/commonjs/renderer/HostComponents.d.ts +0 -1
  195. package/lib/typescript/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  196. package/lib/typescript/lib/commonjs/sksg/DeclarationContext.d.ts +53 -0
  197. package/lib/typescript/lib/commonjs/sksg/DrawingContext.d.ts +8 -12
  198. package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +2 -0
  199. package/lib/typescript/lib/commonjs/sksg/nodes/colorFilters.d.ts +1 -0
  200. package/lib/typescript/lib/commonjs/sksg/nodes/drawings.d.ts +0 -1
  201. package/lib/typescript/lib/commonjs/sksg/nodes/imageFilters.d.ts +2 -0
  202. package/lib/typescript/lib/commonjs/sksg/nodes/pathEffects.d.ts +1 -0
  203. package/lib/typescript/lib/commonjs/views/SkiaDomView.web.d.ts +0 -5
  204. package/lib/typescript/lib/commonjs/views/SkiaPictureView.web.d.ts +2 -0
  205. package/lib/typescript/lib/module/dom/nodes/JsiSkDOM.d.ts +57 -117
  206. package/lib/typescript/lib/module/dom/types/index.d.ts +0 -2
  207. package/lib/typescript/lib/module/index.d.ts +1 -0
  208. package/lib/typescript/lib/module/mock/index.d.ts +0 -3
  209. package/lib/typescript/lib/module/renderer/Canvas.web.d.ts +1 -0
  210. package/lib/typescript/lib/module/renderer/Canvas2.d.ts +1 -0
  211. package/lib/typescript/lib/module/renderer/Canvas2.web.d.ts +1 -0
  212. package/lib/typescript/lib/module/renderer/Container.d.ts +3 -4
  213. package/lib/typescript/lib/module/renderer/HostComponents.d.ts +0 -1
  214. package/lib/typescript/lib/module/renderer/Reconciler.d.ts +2 -2
  215. package/lib/typescript/lib/module/sksg/DeclarationContext.d.ts +52 -0
  216. package/lib/typescript/lib/module/sksg/DrawingContext.d.ts +8 -13
  217. package/lib/typescript/lib/module/sksg/Reconciler.d.ts +2 -0
  218. package/lib/typescript/lib/module/sksg/nodes/colorFilters.d.ts +1 -0
  219. package/lib/typescript/lib/module/sksg/nodes/drawings.d.ts +0 -1
  220. package/lib/typescript/lib/module/sksg/nodes/imageFilters.d.ts +2 -0
  221. package/lib/typescript/lib/module/sksg/nodes/pathEffects.d.ts +1 -0
  222. package/lib/typescript/lib/module/views/SkiaDomView.web.d.ts +0 -4
  223. package/lib/typescript/lib/module/views/SkiaPictureView.web.d.ts +2 -0
  224. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +3 -7
  225. package/lib/typescript/src/dom/types/Node.d.ts +2 -5
  226. package/lib/typescript/src/dom/types/index.d.ts +0 -2
  227. package/lib/typescript/src/index.d.ts +1 -0
  228. package/lib/typescript/src/renderer/Canvas.web.d.ts +10 -0
  229. package/lib/typescript/src/renderer/Canvas2.d.ts +10 -0
  230. package/lib/typescript/src/renderer/Canvas2.web.d.ts +3 -0
  231. package/lib/typescript/src/renderer/Container.d.ts +3 -5
  232. package/lib/typescript/src/renderer/HostComponents.d.ts +3 -6
  233. package/lib/typescript/src/renderer/Reconciler.d.ts +2 -3
  234. package/lib/typescript/src/sksg/DeclarationContext.d.ts +56 -0
  235. package/lib/typescript/src/sksg/DrawingContext.d.ts +9 -12
  236. package/lib/typescript/src/sksg/Reconciler.d.ts +2 -0
  237. package/lib/typescript/src/sksg/nodes/colorFilters.d.ts +9 -6
  238. package/lib/typescript/src/sksg/nodes/drawings.d.ts +1 -2
  239. package/lib/typescript/src/sksg/nodes/imageFilters.d.ts +4 -1
  240. package/lib/typescript/src/sksg/nodes/paint.d.ts +2 -1
  241. package/lib/typescript/src/sksg/nodes/pathEffects.d.ts +10 -7
  242. package/lib/typescript/src/sksg/nodes/shaders.d.ts +2 -1
  243. package/lib/typescript/src/views/SkiaDomView.web.d.ts +0 -7
  244. package/lib/typescript/src/views/SkiaPictureView.web.d.ts +3 -1
  245. package/lib/typescript/src/views/types.d.ts +2 -7
  246. package/package.json +1 -1
  247. package/src/dom/nodes/JsiSkDOM.ts +58 -239
  248. package/src/dom/nodes/datatypes/Circle.ts +2 -2
  249. package/src/dom/nodes/datatypes/Enum.ts +4 -4
  250. package/src/dom/nodes/datatypes/Fitting.ts +5 -2
  251. package/src/dom/nodes/datatypes/Gradient.ts +12 -9
  252. package/src/dom/nodes/datatypes/Path.ts +2 -2
  253. package/src/dom/nodes/datatypes/Radius.ts +1 -2
  254. package/src/dom/nodes/datatypes/Rect.ts +7 -2
  255. package/src/dom/nodes/datatypes/Transform.ts +4 -2
  256. package/src/dom/types/Node.ts +2 -5
  257. package/src/dom/types/index.ts +0 -2
  258. package/src/headless/index.ts +3 -5
  259. package/src/index.ts +1 -0
  260. package/src/renderer/Canvas.tsx +12 -31
  261. package/src/renderer/Canvas.web.tsx +134 -0
  262. package/src/renderer/Canvas2.tsx +128 -0
  263. package/src/renderer/Canvas2.web.tsx +6 -0
  264. package/src/renderer/Container.tsx +4 -16
  265. package/src/renderer/HostComponents.ts +2 -10
  266. package/src/renderer/Offscreen.tsx +3 -6
  267. package/src/renderer/Reconciler.tsx +1 -5
  268. package/src/skia/types/Shader/Shader.ts +3 -2
  269. package/src/sksg/Container.ts +3 -3
  270. package/src/sksg/DeclarationContext.ts +85 -0
  271. package/src/sksg/DrawingContext.ts +81 -76
  272. package/src/sksg/Reconciler.ts +8 -1
  273. package/src/sksg/__tests__/MockDeclaration.ts +0 -2
  274. package/src/sksg/nodes/colorFilters.ts +22 -3
  275. package/src/sksg/nodes/context.ts +46 -123
  276. package/src/sksg/nodes/drawings.ts +21 -9
  277. package/src/sksg/nodes/imageFilters.ts +55 -3
  278. package/src/sksg/nodes/paint.ts +3 -3
  279. package/src/sksg/nodes/pathEffects.ts +27 -4
  280. package/src/sksg/nodes/shaders.ts +10 -3
  281. package/src/sksg/nodes/utils.ts +2 -2
  282. package/src/views/SkiaDomView.web.tsx +0 -23
  283. package/src/views/SkiaPictureView.web.tsx +10 -1
  284. package/src/views/types.ts +2 -8
  285. package/lib/commonjs/dom/nodes/DrawingNode.d.ts +0 -14
  286. package/lib/commonjs/dom/nodes/DrawingNode.js +0 -69
  287. package/lib/commonjs/dom/nodes/DrawingNode.js.map +0 -1
  288. package/lib/commonjs/dom/nodes/GroupNode.d.ts +0 -7
  289. package/lib/commonjs/dom/nodes/GroupNode.js +0 -22
  290. package/lib/commonjs/dom/nodes/GroupNode.js.map +0 -1
  291. package/lib/commonjs/dom/nodes/LayerNode.d.ts +0 -8
  292. package/lib/commonjs/dom/nodes/LayerNode.js +0 -39
  293. package/lib/commonjs/dom/nodes/LayerNode.js.map +0 -1
  294. package/lib/commonjs/dom/nodes/Node.d.ts +0 -34
  295. package/lib/commonjs/dom/nodes/Node.js +0 -102
  296. package/lib/commonjs/dom/nodes/Node.js.map +0 -1
  297. package/lib/commonjs/dom/nodes/PaintNode.d.ts +0 -8
  298. package/lib/commonjs/dom/nodes/PaintNode.js +0 -90
  299. package/lib/commonjs/dom/nodes/PaintNode.js.map +0 -1
  300. package/lib/commonjs/dom/nodes/RenderNode.d.ts +0 -26
  301. package/lib/commonjs/dom/nodes/RenderNode.js +0 -132
  302. package/lib/commonjs/dom/nodes/RenderNode.js.map +0 -1
  303. package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +0 -8
  304. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +0 -36
  305. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +0 -1
  306. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
  307. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js +0 -42
  308. package/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.js.map +0 -1
  309. package/lib/commonjs/dom/nodes/drawings/Box.d.ts +0 -15
  310. package/lib/commonjs/dom/nodes/drawings/Box.js +0 -81
  311. package/lib/commonjs/dom/nodes/drawings/Box.js.map +0 -1
  312. package/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +0 -9
  313. package/lib/commonjs/dom/nodes/drawings/CircleNode.js +0 -32
  314. package/lib/commonjs/dom/nodes/drawings/CircleNode.js.map +0 -1
  315. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
  316. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js +0 -28
  317. package/lib/commonjs/dom/nodes/drawings/DiffRectNode.js.map +0 -1
  318. package/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +0 -8
  319. package/lib/commonjs/dom/nodes/drawings/FillNode.js +0 -24
  320. package/lib/commonjs/dom/nodes/drawings/FillNode.js.map +0 -1
  321. package/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +0 -25
  322. package/lib/commonjs/dom/nodes/drawings/ImageNode.js +0 -71
  323. package/lib/commonjs/dom/nodes/drawings/ImageNode.js.map +0 -1
  324. package/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +0 -13
  325. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js +0 -57
  326. package/lib/commonjs/dom/nodes/drawings/ImageSVG.js.map +0 -1
  327. package/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +0 -8
  328. package/lib/commonjs/dom/nodes/drawings/LineNode.js +0 -28
  329. package/lib/commonjs/dom/nodes/drawings/LineNode.js.map +0 -1
  330. package/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +0 -9
  331. package/lib/commonjs/dom/nodes/drawings/OvalNode.js +0 -28
  332. package/lib/commonjs/dom/nodes/drawings/OvalNode.js.map +0 -1
  333. package/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
  334. package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js +0 -32
  335. package/lib/commonjs/dom/nodes/drawings/ParagraphNode.js.map +0 -1
  336. package/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +0 -18
  337. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +0 -53
  338. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +0 -1
  339. package/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +0 -9
  340. package/lib/commonjs/dom/nodes/drawings/PathNode.js +0 -55
  341. package/lib/commonjs/dom/nodes/drawings/PathNode.js.map +0 -1
  342. package/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +0 -8
  343. package/lib/commonjs/dom/nodes/drawings/PictureNode.js +0 -26
  344. package/lib/commonjs/dom/nodes/drawings/PictureNode.js.map +0 -1
  345. package/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +0 -8
  346. package/lib/commonjs/dom/nodes/drawings/PointsNode.js +0 -30
  347. package/lib/commonjs/dom/nodes/drawings/PointsNode.js.map +0 -1
  348. package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +0 -10
  349. package/lib/commonjs/dom/nodes/drawings/RRectNode.js +0 -32
  350. package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +0 -1
  351. package/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +0 -9
  352. package/lib/commonjs/dom/nodes/drawings/RectNode.js +0 -28
  353. package/lib/commonjs/dom/nodes/drawings/RectNode.js.map +0 -1
  354. package/lib/commonjs/dom/nodes/drawings/Text.d.ts +0 -30
  355. package/lib/commonjs/dom/nodes/drawings/Text.js +0 -159
  356. package/lib/commonjs/dom/nodes/drawings/Text.js.map +0 -1
  357. package/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +0 -9
  358. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +0 -43
  359. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +0 -1
  360. package/lib/commonjs/dom/nodes/drawings/index.d.ts +0 -18
  361. package/lib/commonjs/dom/nodes/drawings/index.js +0 -204
  362. package/lib/commonjs/dom/nodes/drawings/index.js.map +0 -1
  363. package/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +0 -8
  364. package/lib/commonjs/dom/nodes/paint/BlendNode.js +0 -37
  365. package/lib/commonjs/dom/nodes/paint/BlendNode.js.map +0 -1
  366. package/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +0 -35
  367. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +0 -102
  368. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +0 -1
  369. package/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +0 -42
  370. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +0 -183
  371. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +0 -1
  372. package/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +0 -8
  373. package/lib/commonjs/dom/nodes/paint/MaskFilters.js +0 -26
  374. package/lib/commonjs/dom/nodes/paint/MaskFilters.js.map +0 -1
  375. package/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +0 -39
  376. package/lib/commonjs/dom/nodes/paint/PathEffects.js +0 -136
  377. package/lib/commonjs/dom/nodes/paint/PathEffects.js.map +0 -1
  378. package/lib/commonjs/dom/nodes/paint/Shaders.d.ts +0 -43
  379. package/lib/commonjs/dom/nodes/paint/Shaders.js +0 -209
  380. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +0 -1
  381. package/lib/commonjs/dom/nodes/paint/index.d.ts +0 -6
  382. package/lib/commonjs/dom/nodes/paint/index.js +0 -72
  383. package/lib/commonjs/dom/nodes/paint/index.js.map +0 -1
  384. package/lib/commonjs/dom/types/DeclarationContext.d.ts +0 -29
  385. package/lib/commonjs/dom/types/DeclarationContext.js +0 -97
  386. package/lib/commonjs/dom/types/DeclarationContext.js.map +0 -1
  387. package/lib/commonjs/dom/types/DrawingContext.d.ts +0 -22
  388. package/lib/commonjs/dom/types/DrawingContext.js +0 -263
  389. package/lib/commonjs/dom/types/DrawingContext.js.map +0 -1
  390. package/lib/commonjs/renderer/DrawingContext.d.ts +0 -7
  391. package/lib/commonjs/renderer/DrawingContext.js +0 -6
  392. package/lib/commonjs/renderer/DrawingContext.js.map +0 -1
  393. package/lib/commonjs/views/SkiaJSDomView.d.ts +0 -38
  394. package/lib/commonjs/views/SkiaJSDomView.js +0 -131
  395. package/lib/commonjs/views/SkiaJSDomView.js.map +0 -1
  396. package/lib/commonjs/views/SkiaJSDomView.web.d.ts +0 -1
  397. package/lib/commonjs/views/SkiaJSDomView.web.js +0 -13
  398. package/lib/commonjs/views/SkiaJSDomView.web.js.map +0 -1
  399. package/lib/module/dom/nodes/DrawingNode.d.ts +0 -14
  400. package/lib/module/dom/nodes/DrawingNode.js +0 -62
  401. package/lib/module/dom/nodes/DrawingNode.js.map +0 -1
  402. package/lib/module/dom/nodes/GroupNode.d.ts +0 -7
  403. package/lib/module/dom/nodes/GroupNode.js +0 -15
  404. package/lib/module/dom/nodes/GroupNode.js.map +0 -1
  405. package/lib/module/dom/nodes/LayerNode.d.ts +0 -8
  406. package/lib/module/dom/nodes/LayerNode.js +0 -32
  407. package/lib/module/dom/nodes/LayerNode.js.map +0 -1
  408. package/lib/module/dom/nodes/Node.d.ts +0 -34
  409. package/lib/module/dom/nodes/Node.js +0 -94
  410. package/lib/module/dom/nodes/Node.js.map +0 -1
  411. package/lib/module/dom/nodes/PaintNode.d.ts +0 -8
  412. package/lib/module/dom/nodes/PaintNode.js +0 -83
  413. package/lib/module/dom/nodes/PaintNode.js.map +0 -1
  414. package/lib/module/dom/nodes/RenderNode.d.ts +0 -26
  415. package/lib/module/dom/nodes/RenderNode.js +0 -125
  416. package/lib/module/dom/nodes/RenderNode.js.map +0 -1
  417. package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +0 -8
  418. package/lib/module/dom/nodes/drawings/AtlasNode.js +0 -29
  419. package/lib/module/dom/nodes/drawings/AtlasNode.js.map +0 -1
  420. package/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
  421. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js +0 -35
  422. package/lib/module/dom/nodes/drawings/BackdropFilterNode.js.map +0 -1
  423. package/lib/module/dom/nodes/drawings/Box.d.ts +0 -15
  424. package/lib/module/dom/nodes/drawings/Box.js +0 -73
  425. package/lib/module/dom/nodes/drawings/Box.js.map +0 -1
  426. package/lib/module/dom/nodes/drawings/CircleNode.d.ts +0 -9
  427. package/lib/module/dom/nodes/drawings/CircleNode.js +0 -25
  428. package/lib/module/dom/nodes/drawings/CircleNode.js.map +0 -1
  429. package/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
  430. package/lib/module/dom/nodes/drawings/DiffRectNode.js +0 -21
  431. package/lib/module/dom/nodes/drawings/DiffRectNode.js.map +0 -1
  432. package/lib/module/dom/nodes/drawings/FillNode.d.ts +0 -8
  433. package/lib/module/dom/nodes/drawings/FillNode.js +0 -17
  434. package/lib/module/dom/nodes/drawings/FillNode.js.map +0 -1
  435. package/lib/module/dom/nodes/drawings/ImageNode.d.ts +0 -25
  436. package/lib/module/dom/nodes/drawings/ImageNode.js +0 -64
  437. package/lib/module/dom/nodes/drawings/ImageNode.js.map +0 -1
  438. package/lib/module/dom/nodes/drawings/ImageSVG.d.ts +0 -13
  439. package/lib/module/dom/nodes/drawings/ImageSVG.js +0 -50
  440. package/lib/module/dom/nodes/drawings/ImageSVG.js.map +0 -1
  441. package/lib/module/dom/nodes/drawings/LineNode.d.ts +0 -8
  442. package/lib/module/dom/nodes/drawings/LineNode.js +0 -21
  443. package/lib/module/dom/nodes/drawings/LineNode.js.map +0 -1
  444. package/lib/module/dom/nodes/drawings/OvalNode.d.ts +0 -9
  445. package/lib/module/dom/nodes/drawings/OvalNode.js +0 -21
  446. package/lib/module/dom/nodes/drawings/OvalNode.js.map +0 -1
  447. package/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
  448. package/lib/module/dom/nodes/drawings/ParagraphNode.js +0 -25
  449. package/lib/module/dom/nodes/drawings/ParagraphNode.js.map +0 -1
  450. package/lib/module/dom/nodes/drawings/PatchNode.d.ts +0 -18
  451. package/lib/module/dom/nodes/drawings/PatchNode.js +0 -46
  452. package/lib/module/dom/nodes/drawings/PatchNode.js.map +0 -1
  453. package/lib/module/dom/nodes/drawings/PathNode.d.ts +0 -9
  454. package/lib/module/dom/nodes/drawings/PathNode.js +0 -48
  455. package/lib/module/dom/nodes/drawings/PathNode.js.map +0 -1
  456. package/lib/module/dom/nodes/drawings/PictureNode.d.ts +0 -8
  457. package/lib/module/dom/nodes/drawings/PictureNode.js +0 -19
  458. package/lib/module/dom/nodes/drawings/PictureNode.js.map +0 -1
  459. package/lib/module/dom/nodes/drawings/PointsNode.d.ts +0 -8
  460. package/lib/module/dom/nodes/drawings/PointsNode.js +0 -23
  461. package/lib/module/dom/nodes/drawings/PointsNode.js.map +0 -1
  462. package/lib/module/dom/nodes/drawings/RRectNode.d.ts +0 -10
  463. package/lib/module/dom/nodes/drawings/RRectNode.js +0 -25
  464. package/lib/module/dom/nodes/drawings/RRectNode.js.map +0 -1
  465. package/lib/module/dom/nodes/drawings/RectNode.d.ts +0 -9
  466. package/lib/module/dom/nodes/drawings/RectNode.js +0 -21
  467. package/lib/module/dom/nodes/drawings/RectNode.js.map +0 -1
  468. package/lib/module/dom/nodes/drawings/Text.d.ts +0 -30
  469. package/lib/module/dom/nodes/drawings/Text.js +0 -149
  470. package/lib/module/dom/nodes/drawings/Text.js.map +0 -1
  471. package/lib/module/dom/nodes/drawings/VerticesNode.d.ts +0 -9
  472. package/lib/module/dom/nodes/drawings/VerticesNode.js +0 -36
  473. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +0 -1
  474. package/lib/module/dom/nodes/drawings/index.d.ts +0 -18
  475. package/lib/module/dom/nodes/drawings/index.js +0 -19
  476. package/lib/module/dom/nodes/drawings/index.js.map +0 -1
  477. package/lib/module/dom/nodes/paint/BlendNode.d.ts +0 -8
  478. package/lib/module/dom/nodes/paint/BlendNode.js +0 -30
  479. package/lib/module/dom/nodes/paint/BlendNode.js.map +0 -1
  480. package/lib/module/dom/nodes/paint/ColorFilters.d.ts +0 -35
  481. package/lib/module/dom/nodes/paint/ColorFilters.js +0 -89
  482. package/lib/module/dom/nodes/paint/ColorFilters.js.map +0 -1
  483. package/lib/module/dom/nodes/paint/ImageFilters.d.ts +0 -42
  484. package/lib/module/dom/nodes/paint/ImageFilters.js +0 -169
  485. package/lib/module/dom/nodes/paint/ImageFilters.js.map +0 -1
  486. package/lib/module/dom/nodes/paint/MaskFilters.d.ts +0 -8
  487. package/lib/module/dom/nodes/paint/MaskFilters.js +0 -19
  488. package/lib/module/dom/nodes/paint/MaskFilters.js.map +0 -1
  489. package/lib/module/dom/nodes/paint/PathEffects.d.ts +0 -39
  490. package/lib/module/dom/nodes/paint/PathEffects.js +0 -123
  491. package/lib/module/dom/nodes/paint/PathEffects.js.map +0 -1
  492. package/lib/module/dom/nodes/paint/Shaders.d.ts +0 -43
  493. package/lib/module/dom/nodes/paint/Shaders.js +0 -193
  494. package/lib/module/dom/nodes/paint/Shaders.js.map +0 -1
  495. package/lib/module/dom/nodes/paint/index.d.ts +0 -6
  496. package/lib/module/dom/nodes/paint/index.js +0 -7
  497. package/lib/module/dom/nodes/paint/index.js.map +0 -1
  498. package/lib/module/dom/types/DeclarationContext.d.ts +0 -29
  499. package/lib/module/dom/types/DeclarationContext.js +0 -90
  500. package/lib/module/dom/types/DeclarationContext.js.map +0 -1
  501. package/lib/module/dom/types/DrawingContext.d.ts +0 -22
  502. package/lib/module/dom/types/DrawingContext.js +0 -256
  503. package/lib/module/dom/types/DrawingContext.js.map +0 -1
  504. package/lib/module/renderer/DrawingContext.d.ts +0 -7
  505. package/lib/module/renderer/DrawingContext.js +0 -2
  506. package/lib/module/renderer/DrawingContext.js.map +0 -1
  507. package/lib/module/views/SkiaJSDomView.d.ts +0 -38
  508. package/lib/module/views/SkiaJSDomView.js +0 -123
  509. package/lib/module/views/SkiaJSDomView.js.map +0 -1
  510. package/lib/module/views/SkiaJSDomView.web.d.ts +0 -1
  511. package/lib/module/views/SkiaJSDomView.web.js +0 -2
  512. package/lib/module/views/SkiaJSDomView.web.js.map +0 -1
  513. package/lib/typescript/lib/commonjs/dom/nodes/DrawingNode.d.ts +0 -6
  514. package/lib/typescript/lib/commonjs/dom/nodes/GroupNode.d.ts +0 -6
  515. package/lib/typescript/lib/commonjs/dom/nodes/LayerNode.d.ts +0 -6
  516. package/lib/typescript/lib/commonjs/dom/nodes/Node.d.ts +0 -20
  517. package/lib/typescript/lib/commonjs/dom/nodes/PaintNode.d.ts +0 -6
  518. package/lib/typescript/lib/commonjs/dom/nodes/RenderNode.d.ts +0 -16
  519. package/lib/typescript/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +0 -10
  520. package/lib/typescript/lib/commonjs/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -10
  521. package/lib/typescript/lib/commonjs/dom/nodes/drawings/Box.d.ts +0 -15
  522. package/lib/typescript/lib/commonjs/dom/nodes/drawings/CircleNode.d.ts +0 -10
  523. package/lib/typescript/lib/commonjs/dom/nodes/drawings/DiffRectNode.d.ts +0 -10
  524. package/lib/typescript/lib/commonjs/dom/nodes/drawings/FillNode.d.ts +0 -10
  525. package/lib/typescript/lib/commonjs/dom/nodes/drawings/ImageNode.d.ts +0 -13
  526. package/lib/typescript/lib/commonjs/dom/nodes/drawings/ImageSVG.d.ts +0 -9
  527. package/lib/typescript/lib/commonjs/dom/nodes/drawings/LineNode.d.ts +0 -10
  528. package/lib/typescript/lib/commonjs/dom/nodes/drawings/OvalNode.d.ts +0 -10
  529. package/lib/typescript/lib/commonjs/dom/nodes/drawings/ParagraphNode.d.ts +0 -9
  530. package/lib/typescript/lib/commonjs/dom/nodes/drawings/PatchNode.d.ts +0 -14
  531. package/lib/typescript/lib/commonjs/dom/nodes/drawings/PathNode.d.ts +0 -10
  532. package/lib/typescript/lib/commonjs/dom/nodes/drawings/PictureNode.d.ts +0 -9
  533. package/lib/typescript/lib/commonjs/dom/nodes/drawings/PointsNode.d.ts +0 -10
  534. package/lib/typescript/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +0 -10
  535. package/lib/typescript/lib/commonjs/dom/nodes/drawings/RectNode.d.ts +0 -10
  536. package/lib/typescript/lib/commonjs/dom/nodes/drawings/Text.d.ts +0 -34
  537. package/lib/typescript/lib/commonjs/dom/nodes/drawings/VerticesNode.d.ts +0 -10
  538. package/lib/typescript/lib/commonjs/dom/nodes/paint/BlendNode.d.ts +0 -6
  539. package/lib/typescript/lib/commonjs/dom/nodes/paint/ColorFilters.d.ts +0 -29
  540. package/lib/typescript/lib/commonjs/dom/nodes/paint/ImageFilters.d.ts +0 -35
  541. package/lib/typescript/lib/commonjs/dom/nodes/paint/MaskFilters.d.ts +0 -6
  542. package/lib/typescript/lib/commonjs/dom/nodes/paint/PathEffects.d.ts +0 -34
  543. package/lib/typescript/lib/commonjs/dom/nodes/paint/Shaders.d.ts +0 -40
  544. package/lib/typescript/lib/commonjs/dom/nodes/paint/index.d.ts +0 -1
  545. package/lib/typescript/lib/commonjs/dom/types/DeclarationContext.d.ts +0 -26
  546. package/lib/typescript/lib/commonjs/dom/types/DrawingContext.d.ts +0 -13
  547. package/lib/typescript/lib/commonjs/renderer/DrawingContext.d.ts +0 -1
  548. package/lib/typescript/lib/commonjs/views/SkiaJSDomView.d.ts +0 -29
  549. package/lib/typescript/lib/commonjs/views/SkiaJSDomView.web.d.ts +0 -3
  550. package/lib/typescript/lib/module/dom/nodes/DrawingNode.d.ts +0 -5
  551. package/lib/typescript/lib/module/dom/nodes/GroupNode.d.ts +0 -5
  552. package/lib/typescript/lib/module/dom/nodes/LayerNode.d.ts +0 -5
  553. package/lib/typescript/lib/module/dom/nodes/Node.d.ts +0 -19
  554. package/lib/typescript/lib/module/dom/nodes/PaintNode.d.ts +0 -5
  555. package/lib/typescript/lib/module/dom/nodes/RenderNode.d.ts +0 -15
  556. package/lib/typescript/lib/module/dom/nodes/drawings/AtlasNode.d.ts +0 -9
  557. package/lib/typescript/lib/module/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -9
  558. package/lib/typescript/lib/module/dom/nodes/drawings/Box.d.ts +0 -14
  559. package/lib/typescript/lib/module/dom/nodes/drawings/CircleNode.d.ts +0 -9
  560. package/lib/typescript/lib/module/dom/nodes/drawings/DiffRectNode.d.ts +0 -9
  561. package/lib/typescript/lib/module/dom/nodes/drawings/FillNode.d.ts +0 -9
  562. package/lib/typescript/lib/module/dom/nodes/drawings/ImageNode.d.ts +0 -22
  563. package/lib/typescript/lib/module/dom/nodes/drawings/ImageSVG.d.ts +0 -8
  564. package/lib/typescript/lib/module/dom/nodes/drawings/LineNode.d.ts +0 -9
  565. package/lib/typescript/lib/module/dom/nodes/drawings/OvalNode.d.ts +0 -9
  566. package/lib/typescript/lib/module/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
  567. package/lib/typescript/lib/module/dom/nodes/drawings/PatchNode.d.ts +0 -13
  568. package/lib/typescript/lib/module/dom/nodes/drawings/PathNode.d.ts +0 -9
  569. package/lib/typescript/lib/module/dom/nodes/drawings/PictureNode.d.ts +0 -8
  570. package/lib/typescript/lib/module/dom/nodes/drawings/PointsNode.d.ts +0 -9
  571. package/lib/typescript/lib/module/dom/nodes/drawings/RRectNode.d.ts +0 -9
  572. package/lib/typescript/lib/module/dom/nodes/drawings/RectNode.d.ts +0 -9
  573. package/lib/typescript/lib/module/dom/nodes/drawings/Text.d.ts +0 -33
  574. package/lib/typescript/lib/module/dom/nodes/drawings/VerticesNode.d.ts +0 -9
  575. package/lib/typescript/lib/module/dom/nodes/drawings/index.d.ts +0 -18
  576. package/lib/typescript/lib/module/dom/nodes/paint/BlendNode.d.ts +0 -5
  577. package/lib/typescript/lib/module/dom/nodes/paint/ColorFilters.d.ts +0 -28
  578. package/lib/typescript/lib/module/dom/nodes/paint/ImageFilters.d.ts +0 -34
  579. package/lib/typescript/lib/module/dom/nodes/paint/MaskFilters.d.ts +0 -5
  580. package/lib/typescript/lib/module/dom/nodes/paint/PathEffects.d.ts +0 -33
  581. package/lib/typescript/lib/module/dom/nodes/paint/Shaders.d.ts +0 -39
  582. package/lib/typescript/lib/module/dom/nodes/paint/index.d.ts +0 -6
  583. package/lib/typescript/lib/module/dom/types/DeclarationContext.d.ts +0 -25
  584. package/lib/typescript/lib/module/dom/types/DrawingContext.d.ts +0 -12
  585. package/lib/typescript/lib/module/renderer/DrawingContext.d.ts +0 -1
  586. package/lib/typescript/lib/module/views/SkiaJSDomView.d.ts +0 -26
  587. package/lib/typescript/lib/module/views/SkiaJSDomView.web.d.ts +0 -1
  588. package/lib/typescript/src/dom/nodes/DrawingNode.d.ts +0 -14
  589. package/lib/typescript/src/dom/nodes/GroupNode.d.ts +0 -7
  590. package/lib/typescript/src/dom/nodes/LayerNode.d.ts +0 -8
  591. package/lib/typescript/src/dom/nodes/Node.d.ts +0 -34
  592. package/lib/typescript/src/dom/nodes/PaintNode.d.ts +0 -8
  593. package/lib/typescript/src/dom/nodes/RenderNode.d.ts +0 -26
  594. package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +0 -8
  595. package/lib/typescript/src/dom/nodes/drawings/BackdropFilterNode.d.ts +0 -8
  596. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +0 -15
  597. package/lib/typescript/src/dom/nodes/drawings/CircleNode.d.ts +0 -9
  598. package/lib/typescript/src/dom/nodes/drawings/DiffRectNode.d.ts +0 -8
  599. package/lib/typescript/src/dom/nodes/drawings/FillNode.d.ts +0 -8
  600. package/lib/typescript/src/dom/nodes/drawings/ImageNode.d.ts +0 -25
  601. package/lib/typescript/src/dom/nodes/drawings/ImageSVG.d.ts +0 -13
  602. package/lib/typescript/src/dom/nodes/drawings/LineNode.d.ts +0 -8
  603. package/lib/typescript/src/dom/nodes/drawings/OvalNode.d.ts +0 -9
  604. package/lib/typescript/src/dom/nodes/drawings/ParagraphNode.d.ts +0 -8
  605. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +0 -18
  606. package/lib/typescript/src/dom/nodes/drawings/PathNode.d.ts +0 -9
  607. package/lib/typescript/src/dom/nodes/drawings/PictureNode.d.ts +0 -8
  608. package/lib/typescript/src/dom/nodes/drawings/PointsNode.d.ts +0 -8
  609. package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +0 -10
  610. package/lib/typescript/src/dom/nodes/drawings/RectNode.d.ts +0 -9
  611. package/lib/typescript/src/dom/nodes/drawings/Text.d.ts +0 -30
  612. package/lib/typescript/src/dom/nodes/drawings/VerticesNode.d.ts +0 -9
  613. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +0 -18
  614. package/lib/typescript/src/dom/nodes/paint/BlendNode.d.ts +0 -8
  615. package/lib/typescript/src/dom/nodes/paint/ColorFilters.d.ts +0 -35
  616. package/lib/typescript/src/dom/nodes/paint/ImageFilters.d.ts +0 -42
  617. package/lib/typescript/src/dom/nodes/paint/MaskFilters.d.ts +0 -8
  618. package/lib/typescript/src/dom/nodes/paint/PathEffects.d.ts +0 -39
  619. package/lib/typescript/src/dom/nodes/paint/Shaders.d.ts +0 -43
  620. package/lib/typescript/src/dom/nodes/paint/index.d.ts +0 -6
  621. package/lib/typescript/src/dom/types/DeclarationContext.d.ts +0 -29
  622. package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -22
  623. package/lib/typescript/src/renderer/DrawingContext.d.ts +0 -7
  624. package/lib/typescript/src/views/SkiaJSDomView.d.ts +0 -38
  625. package/lib/typescript/src/views/SkiaJSDomView.web.d.ts +0 -1
  626. package/src/dom/nodes/DrawingNode.ts +0 -74
  627. package/src/dom/nodes/GroupNode.ts +0 -19
  628. package/src/dom/nodes/LayerNode.ts +0 -37
  629. package/src/dom/nodes/Node.ts +0 -121
  630. package/src/dom/nodes/PaintNode.ts +0 -91
  631. package/src/dom/nodes/RenderNode.ts +0 -172
  632. package/src/dom/nodes/drawings/AtlasNode.ts +0 -24
  633. package/src/dom/nodes/drawings/BackdropFilterNode.ts +0 -37
  634. package/src/dom/nodes/drawings/Box.ts +0 -82
  635. package/src/dom/nodes/drawings/CircleNode.ts +0 -24
  636. package/src/dom/nodes/drawings/DiffRectNode.ts +0 -19
  637. package/src/dom/nodes/drawings/FillNode.ts +0 -18
  638. package/src/dom/nodes/drawings/ImageNode.ts +0 -49
  639. package/src/dom/nodes/drawings/ImageSVG.ts +0 -38
  640. package/src/dom/nodes/drawings/LineNode.ts +0 -19
  641. package/src/dom/nodes/drawings/OvalNode.ts +0 -23
  642. package/src/dom/nodes/drawings/ParagraphNode.ts +0 -22
  643. package/src/dom/nodes/drawings/PatchNode.ts +0 -54
  644. package/src/dom/nodes/drawings/PathNode.ts +0 -51
  645. package/src/dom/nodes/drawings/PictureNode.ts +0 -19
  646. package/src/dom/nodes/drawings/PointsNode.ts +0 -21
  647. package/src/dom/nodes/drawings/RRectNode.ts +0 -25
  648. package/src/dom/nodes/drawings/RectNode.ts +0 -23
  649. package/src/dom/nodes/drawings/Text.ts +0 -145
  650. package/src/dom/nodes/drawings/VerticesNode.ts +0 -35
  651. package/src/dom/nodes/drawings/index.ts +0 -18
  652. package/src/dom/nodes/paint/BlendNode.ts +0 -32
  653. package/src/dom/nodes/paint/ColorFilters.ts +0 -106
  654. package/src/dom/nodes/paint/ImageFilters.ts +0 -221
  655. package/src/dom/nodes/paint/MaskFilters.ts +0 -23
  656. package/src/dom/nodes/paint/PathEffects.ts +0 -139
  657. package/src/dom/nodes/paint/Shaders.ts +0 -233
  658. package/src/dom/nodes/paint/index.ts +0 -6
  659. package/src/dom/types/DeclarationContext.ts +0 -115
  660. package/src/dom/types/DrawingContext.ts +0 -322
  661. package/src/renderer/DrawingContext.ts +0 -8
  662. package/src/views/SkiaJSDomView.tsx +0 -143
  663. package/src/views/SkiaJSDomView.web.tsx +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["deflate","enumKey","fitRects","inflate","NodeType","processCircle","processPath","processRect","processRRect","saturate","BlendMode","BlurStyle","ClipOp","FillType","isRRect","PointMode","VertexMode","materialize","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawBox","children","box","defaultBox","opacity","getAlphaf","RRectXY","shadows","map","node","type","BoxShadow","filter","n","shadow","inner","color","blur","spread","dx","dy","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore","drawBoxShadow","_ctx","_props","drawImage","image","_props$fit","fit","src","dst","width","height","drawImageRect","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","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","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","translate","drawSvg","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawFill","drawPaint"],"sources":["drawings.ts"],"sourcesContent":["\"worklet\";\n\nimport {\n deflate,\n enumKey,\n fitRects,\n inflate,\n NodeType,\n processCircle,\n processPath,\n processRect,\n processRRect,\n} from \"../../dom/nodes\";\nimport type {\n AtlasProps,\n BoxProps,\n BoxShadowProps,\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 {\n SkCanvas,\n SkPaint,\n SkPoint,\n SkRSXform,\n Skia,\n} from \"../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ClipOp,\n FillType,\n isRRect,\n PointMode,\n VertexMode,\n} from \"../../skia/types\";\n\nimport type { Node } from \"./Node\";\nimport { materialize } from \"./utils\";\n\ninterface LocalDrawingContext {\n Skia: Skia;\n canvas: SkCanvas;\n paint: SkPaint;\n}\n\nexport const drawLine = (ctx: LocalDrawingContext, props: LineProps) => {\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: LocalDrawingContext, props: OvalProps) => {\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawBox = (\n ctx: LocalDrawingContext,\n props: BoxProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n children: Node<any>[]\n) => {\n const { paint, Skia, canvas } = ctx;\n const { box: defaultBox } = props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);\n const shadows = children\n .map((node) => {\n if (node.type === NodeType.BoxShadow) {\n return materialize(node.props);\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(Skia, box, spread, spread, dx, dy), lPaint);\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(Skia, box, spread, spread, dx, dy);\n const outer = inflate(Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n};\n\nexport const drawBoxShadow = (\n _ctx: LocalDrawingContext,\n _props: BoxShadowProps\n) => {\n //throw new Error(\"drawBoxShadow(): not implemented yet\");\n};\n\nexport const drawImage = (ctx: LocalDrawingContext, props: ImageProps) => {\n const { image } = 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 ctx.canvas.drawImageRect(image, src, dst, ctx.paint);\n }\n};\n\nexport const drawPoints = (ctx: LocalDrawingContext, props: PointsProps) => {\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (\n ctx: LocalDrawingContext,\n props: VerticesProps\n) => {\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) => ctx.Skia.Color(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 = (\n ctx: LocalDrawingContext,\n props: DiffRectProps\n) => {\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (\n ctx: LocalDrawingContext,\n props: TextPathProps\n) => {\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: LocalDrawingContext, props: TextProps) => {\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: LocalDrawingContext, props: PatchProps) => {\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) => ctx.Skia.Color(c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: LocalDrawingContext, props: PathProps) => {\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: LocalDrawingContext, props: RectProps) => {\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (\n ctx: LocalDrawingContext,\n props: RoundedRectProps\n) => {\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (\n ctx: LocalDrawingContext,\n props: TextBlobProps\n) => {\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: LocalDrawingContext, props: GlyphsProps) => {\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 = (\n ctx: LocalDrawingContext,\n props: ImageSVGProps\n) => {\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 = (\n ctx: LocalDrawingContext,\n props: ParagraphProps\n) => {\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: LocalDrawingContext, props: PictureProps) => {\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: LocalDrawingContext, props: AtlasProps) => {\n const { image, sprites, transforms, colors, blendMode } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(image, sprites, transforms, ctx.paint, blend, colors);\n }\n};\n\nexport const drawCircle = (ctx: LocalDrawingContext, props: CircleProps) => {\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 = (\n ctx: LocalDrawingContext,\n _props: DrawingNodeProps\n) => {\n ctx.canvas.drawPaint(ctx.paint);\n};\n"],"mappings":"AAAA,SAAS;;AAET,SACEA,OAAO,EACPC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,YAAY,QACP,iBAAiB;AAyBxB,SAASC,QAAQ,QAAQ,2BAA2B;AAQpD,SACEC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTC,UAAU,QACL,kBAAkB;AAGzB,SAASC,WAAW,QAAQ,SAAS;AAQrC,OAAO,MAAMC,QAAQ,GAAGA,CAACC,GAAwB,EAAEC,KAAgB,KAAK;EACtE,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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AQ,GAAGA,CACtB/J,GAAwB,EACxBsD,MAAwB,KACrB;EACHtD,GAAG,CAACI,MAAM,CAAC4J,SAAS,CAAChK,GAAG,CAACO,KAAK,CAAC;AACjC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["deflate","enumKey","fitRects","inflate","NodeType","processCircle","processPath","processRect","processRRect","saturate","BlendMode","BlurStyle","ClipOp","FillType","isRRect","PointMode","VertexMode","materialize","drawLine","ctx","props","p1","p2","canvas","x","y","paint","drawOval","rect","Skia","drawBox","children","box","defaultBox","opacity","getAlphaf","RRectXY","shadows","map","node","type","BoxShadow","filter","n","shadow","inner","color","blur","spread","dx","dy","lPaint","Paint","setColor","Color","setAlphaf","setMaskFilter","MaskFilter","MakeBlur","Normal","drawRRect","delta","Point","Math","abs","save","clipRRect","Intersect","outer","drawDRRect","restore","drawImage","image","_props$fit","fit","src","dst","width","height","drawImageRect","drawPoints","points","mode","drawVertices","textures","colors","indices","blendMode","vertexMode","Triangles","vertices","MakeVertices","c","undefined","defaultBlendMode","DstOver","SrcOver","blend","drawDiffRect","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","blob","drawGlyphs","glyphs","reduce","acc","glyph","id","positions","drawImageSVG","svg","translate","drawSvg","drawParagraph","paragraph","layout","drawPicture","picture","drawAtlas","sprites","transforms","drawCircle","r","drawFill","_props","drawPaint"],"sources":["drawings.ts"],"sourcesContent":["import {\n deflate,\n enumKey,\n fitRects,\n inflate,\n NodeType,\n processCircle,\n processPath,\n processRect,\n processRRect,\n} from \"../../dom/nodes\";\nimport type {\n AtlasProps,\n BoxProps,\n BoxShadowProps,\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 {\n SkCanvas,\n SkPaint,\n SkPoint,\n SkRSXform,\n Skia,\n} from \"../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ClipOp,\n FillType,\n isRRect,\n PointMode,\n VertexMode,\n} from \"../../skia/types\";\n\nimport type { Node } from \"./Node\";\nimport { materialize } from \"./utils\";\n\ninterface LocalDrawingContext {\n Skia: Skia;\n canvas: SkCanvas;\n paint: SkPaint;\n}\n\nexport const drawLine = (ctx: LocalDrawingContext, 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: LocalDrawingContext, props: OvalProps) => {\n \"worklet\";\n const rect = processRect(ctx.Skia, props);\n ctx.canvas.drawOval(rect, ctx.paint);\n};\n\nexport const drawBox = (\n ctx: LocalDrawingContext,\n props: BoxProps,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n children: Node<any>[]\n) => {\n \"worklet\";\n const { paint, Skia, canvas } = ctx;\n const { box: defaultBox } = props;\n const opacity = paint.getAlphaf();\n const box = isRRect(defaultBox) ? defaultBox : Skia.RRectXY(defaultBox, 0, 0);\n const shadows = children\n .map((node) => {\n if (node.type === NodeType.BoxShadow) {\n return materialize(node.props);\n }\n return null;\n })\n .filter((n): n is BoxShadowProps => n !== null);\n shadows\n .filter((shadow) => !shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n canvas.drawRRect(inflate(Skia, box, spread, spread, dx, dy), lPaint);\n });\n\n canvas.drawRRect(box, paint);\n\n shadows\n .filter((shadow) => shadow.inner)\n .map((shadow) => {\n const { color = \"black\", blur, spread = 0, dx = 0, dy = 0 } = shadow;\n const delta = Skia.Point(10 + Math.abs(dx), 10 + Math.abs(dy));\n canvas.save();\n canvas.clipRRect(box, ClipOp.Intersect, false);\n const lPaint = Skia.Paint();\n lPaint.setColor(Skia.Color(color));\n lPaint.setAlphaf(paint.getAlphaf() * opacity);\n\n lPaint.setMaskFilter(\n Skia.MaskFilter.MakeBlur(BlurStyle.Normal, blur, true)\n );\n const inner = deflate(Skia, box, spread, spread, dx, dy);\n const outer = inflate(Skia, box, delta.x, delta.y);\n canvas.drawDRRect(outer, inner, lPaint);\n canvas.restore();\n });\n};\n\nexport const drawImage = (ctx: LocalDrawingContext, props: ImageProps) => {\n \"worklet\";\n const { image } = 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 ctx.canvas.drawImageRect(image, src, dst, ctx.paint);\n }\n};\n\nexport const drawPoints = (ctx: LocalDrawingContext, props: PointsProps) => {\n \"worklet\";\n const { points, mode } = props;\n ctx.canvas.drawPoints(PointMode[enumKey(mode)], points, ctx.paint);\n};\n\nexport const drawVertices = (\n ctx: LocalDrawingContext,\n props: VerticesProps\n) => {\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) => ctx.Skia.Color(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 = (\n ctx: LocalDrawingContext,\n props: DiffRectProps\n) => {\n \"worklet\";\n const { outer, inner } = props;\n ctx.canvas.drawDRRect(outer, inner, ctx.paint);\n};\n\nexport const drawTextPath = (\n ctx: LocalDrawingContext,\n props: TextPathProps\n) => {\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: LocalDrawingContext, 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: LocalDrawingContext, 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) => ctx.Skia.Color(c))\n : undefined;\n ctx.canvas.drawPatch(points, colors, texture, mode, ctx.paint);\n};\n\nexport const drawPath = (ctx: LocalDrawingContext, 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: LocalDrawingContext, props: RectProps) => {\n \"worklet\";\n const derived = processRect(ctx.Skia, props);\n ctx.canvas.drawRect(derived, ctx.paint);\n};\n\nexport const drawRRect = (\n ctx: LocalDrawingContext,\n props: RoundedRectProps\n) => {\n \"worklet\";\n const derived = processRRect(ctx.Skia, props);\n ctx.canvas.drawRRect(derived, ctx.paint);\n};\n\nexport const drawTextBlob = (\n ctx: LocalDrawingContext,\n props: TextBlobProps\n) => {\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: LocalDrawingContext, 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 = (\n ctx: LocalDrawingContext,\n props: ImageSVGProps\n) => {\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 = (\n ctx: LocalDrawingContext,\n props: ParagraphProps\n) => {\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: LocalDrawingContext, props: PictureProps) => {\n \"worklet\";\n const { picture } = props;\n ctx.canvas.drawPicture(picture);\n};\n\nexport const drawAtlas = (ctx: LocalDrawingContext, props: AtlasProps) => {\n \"worklet\";\n const { image, sprites, transforms, colors, blendMode } = props;\n const blend = blendMode ? BlendMode[enumKey(blendMode)] : undefined;\n if (image) {\n ctx.canvas.drawAtlas(image, sprites, transforms, ctx.paint, blend, colors);\n }\n};\n\nexport const drawCircle = (ctx: LocalDrawingContext, 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 = (\n ctx: LocalDrawing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EACxE,SAAS;;EACT,MAAM;IAAEoD,KAAK;IAAEmG,OAAO;IAAEC,UAAU;IAAEvF,MAAM;IAAEE;EAAU,CAAC,GAAGnE,KAAK;EAC/D,MAAM6E,KAAK,GAAGV,SAAS,GAAG7E,SAAS,CAACT,OAAO,CAACsF,SAAS,CAAC,CAAC,GAAGM,SAAS;EACnE,IAAIrB,KAAK,EAAE;IACTrD,GAAG,CAACI,MAAM,CAACmJ,SAAS,CAAClG,KAAK,EAAEmG,OAAO,EAAEC,UAAU,EAAEzJ,GAAG,CAACO,KAAK,EAAEuE,KAAK,EAAEZ,MAAM,CAAC;EAC5E;AACF,CAAC;AAED,OAAO,MAAMwF,UAAU,GAAGA,CAAC1J,GAAwB,EAAEC,KAAkB,KAAK;EAC1E,SAAS;;EACT,MAAM;IAAEwE;EAAE,CAAC,GAAGvF,aAAa,CAACe,KAAK,CAAC;EAClC,MAAM;IAAE0J;EAAE,CAAC,GAAG1J,KAAK;EACnBD,GAAG,CAACI,MAAM,CAACsJ,UAAU,CAACjF,CAAC,CAACpE,CAAC,EAAEoE,CAAC,CAACnE,CAAC,EAAEqJ,CAAC,EAAE3J,GAAG,CAACO,KAAK,CAAC;AAC/C,CAAC;AAED,OAAO,MAAMqJ,QAAQ,GAAGA,CACtB5J,GAAwB,EACxB6J,MAAwB,KACrB;EACH,SAAS;;EACT7J,GAAG,CAACI,MAAM,CAAC0J,SAAS,CAAC9J,GAAG,CAACO,KAAK,CAAC;AACjC,CAAC","ignoreList":[]}
@@ -1,9 +1,12 @@
1
- import type { BlendImageFilterProps, BlurImageFilterProps, BlurMaskFilterProps, DeclarationContext, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../dom/types";
1
+ import type { BlendImageFilterProps, BlendProps, BlurImageFilterProps, BlurMaskFilterProps, DisplacementMapImageFilterProps, DropShadowImageFilterProps, MorphologyImageFilterProps, OffsetImageFilterProps, RuntimeShaderImageFilterProps } from "../../dom/types";
2
2
  import type { SkImageFilter } from "../../skia/types";
3
+ import type { DeclarationContext } from "../DeclarationContext";
3
4
  export declare enum MorphologyOperator {
4
5
  Erode = 0,
5
6
  Dilate = 1
6
7
  }
8
+ export declare const declareBlend: (ctx: DeclarationContext, props: BlendProps) => void;
9
+ export declare const composeImageFilters: (ctx: DeclarationContext, imgf1: SkImageFilter, processChildren: () => void) => void;
7
10
  export declare const makeOffsetImageFilter: (ctx: DeclarationContext, props: OffsetImageFilterProps) => SkImageFilter;
8
11
  export declare const declareDisplacementMapImageFilter: (ctx: DeclarationContext, props: DisplacementMapImageFilterProps) => void;
9
12
  export declare const makeBlurImageFilter: (ctx: DeclarationContext, props: BlurImageFilterProps) => SkImageFilter;
@@ -1,7 +1,6 @@
1
- "worklet";
2
-
3
1
  import { enumKey, processRadius } from "../../dom/nodes";
4
2
  import { BlendMode, BlurStyle, ColorChannel, processUniforms, TileMode } from "../../skia/types";
3
+ import { composeDeclarations } from "../DeclarationContext";
5
4
  export let MorphologyOperator = /*#__PURE__*/function (MorphologyOperator) {
6
5
  MorphologyOperator[MorphologyOperator["Erode"] = 0] = "Erode";
7
6
  MorphologyOperator[MorphologyOperator["Dilate"] = 1] = "Dilate";
@@ -9,6 +8,8 @@ export let MorphologyOperator = /*#__PURE__*/function (MorphologyOperator) {
9
8
  }({});
10
9
  const Black = Float32Array.of(0, 0, 0, 1);
11
10
  const MakeInnerShadow = (Skia, shadowOnly, dx, dy, sigmaX, sigmaY, color, input) => {
11
+ "worklet";
12
+
12
13
  const sourceGraphic = Skia.ImageFilter.MakeColorFilter(Skia.ColorFilter.MakeBlend(Black, BlendMode.Dst), null);
13
14
  const sourceAlpha = Skia.ImageFilter.MakeColorFilter(Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn), null);
14
15
  const f1 = Skia.ImageFilter.MakeColorFilter(Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut), null);
@@ -20,11 +21,55 @@ const MakeInnerShadow = (Skia, shadowOnly, dx, dy, sigmaX, sigmaY, color, input)
20
21
  }
21
22
  return Skia.ImageFilter.MakeCompose(input, Skia.ImageFilter.MakeBlend(BlendMode.SrcOver, sourceGraphic, f4));
22
23
  };
24
+ export const declareBlend = (ctx, props) => {
25
+ "worklet";
26
+
27
+ const {
28
+ Skia
29
+ } = ctx;
30
+ const blend = BlendMode[enumKey(props.mode)];
31
+ // Blend ImageFilters
32
+ const imageFilters = ctx.imageFilters.popAll();
33
+ if (imageFilters.length > 0) {
34
+ const composer = Skia.ImageFilter.MakeBlend.bind(Skia.ImageFilter, blend);
35
+ ctx.imageFilters.push(composeDeclarations(imageFilters, composer));
36
+ }
37
+ // Blend Shaders
38
+ const shaders = ctx.shaders.popAll();
39
+ if (shaders.length > 0) {
40
+ const composer = Skia.Shader.MakeBlend.bind(Skia.Shader, blend);
41
+ ctx.shaders.push(composeDeclarations(shaders, composer));
42
+ }
43
+ };
44
+ export const composeImageFilters = (ctx, imgf1, processChildren) => {
45
+ "worklet";
46
+
47
+ const {
48
+ Skia
49
+ } = ctx;
50
+ ctx.imageFilters.save();
51
+ ctx.colorFilters.save();
52
+ processChildren();
53
+ let imgf2 = ctx.imageFilters.popAllAsOne();
54
+ const cf = ctx.colorFilters.popAllAsOne();
55
+ ctx.imageFilters.restore();
56
+ ctx.colorFilters.restore();
57
+ if (cf) {
58
+ var _imgf;
59
+ imgf2 = Skia.ImageFilter.MakeCompose((_imgf = imgf2) !== null && _imgf !== void 0 ? _imgf : null, Skia.ImageFilter.MakeColorFilter(cf, null));
60
+ }
61
+ const imgf = imgf2 ? Skia.ImageFilter.MakeCompose(imgf1, imgf2) : imgf1;
62
+ ctx.imageFilters.push(imgf);
63
+ };
23
64
  const input = ctx => {
65
+ "worklet";
66
+
24
67
  var _ctx$imageFilters$pop;
25
68
  return (_ctx$imageFilters$pop = ctx.imageFilters.pop()) !== null && _ctx$imageFilters$pop !== void 0 ? _ctx$imageFilters$pop : null;
26
69
  };
27
70
  export const makeOffsetImageFilter = (ctx, props) => {
71
+ "worklet";
72
+
28
73
  const {
29
74
  x,
30
75
  y
@@ -32,6 +77,8 @@ export const makeOffsetImageFilter = (ctx, props) => {
32
77
  return ctx.Skia.ImageFilter.MakeOffset(x, y, null);
33
78
  };
34
79
  export const declareDisplacementMapImageFilter = (ctx, props) => {
80
+ "worklet";
81
+
35
82
  const {
36
83
  channelX,
37
84
  channelY,
@@ -46,6 +93,8 @@ export const declareDisplacementMapImageFilter = (ctx, props) => {
46
93
  ctx.imageFilters.push(imgf);
47
94
  };
48
95
  export const makeBlurImageFilter = (ctx, props) => {
96
+ "worklet";
97
+
49
98
  const {
50
99
  mode,
51
100
  blur
@@ -55,6 +104,8 @@ export const makeBlurImageFilter = (ctx, props) => {
55
104
  return imgf;
56
105
  };
57
106
  export const makeDropShadowImageFilter = (ctx, props) => {
107
+ "worklet";
108
+
58
109
  const {
59
110
  dx,
60
111
  dy,
@@ -74,6 +125,8 @@ export const makeDropShadowImageFilter = (ctx, props) => {
74
125
  return imgf;
75
126
  };
76
127
  export const makeMorphologyImageFilter = (ctx, props) => {
128
+ "worklet";
129
+
77
130
  const {
78
131
  operator
79
132
  } = props;
@@ -87,6 +140,8 @@ export const makeMorphologyImageFilter = (ctx, props) => {
87
140
  return imgf;
88
141
  };
89
142
  export const makeRuntimeShaderImageFilter = (ctx, props) => {
143
+ "worklet";
144
+
90
145
  const {
91
146
  source,
92
147
  uniforms
@@ -99,6 +154,8 @@ export const makeRuntimeShaderImageFilter = (ctx, props) => {
99
154
  return imgf;
100
155
  };
101
156
  export const declareBlendImageFilter = (ctx, props) => {
157
+ "worklet";
158
+
102
159
  const {
103
160
  mode
104
161
  } = props;
@@ -111,6 +168,8 @@ export const declareBlendImageFilter = (ctx, props) => {
111
168
  ctx.imageFilters.push(imgf);
112
169
  };
113
170
  export const declareBlurMaskFilter = (ctx, props) => {
171
+ "worklet";
172
+
114
173
  const {
115
174
  blur,
116
175
  style,
@@ -1 +1 @@
1
- {"version":3,"names":["enumKey","processRadius","BlendMode","BlurStyle","ColorChannel","processUniforms","TileMode","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","ctx","_ctx$imageFilters$pop","imageFilters","pop","makeOffsetImageFilter","props","x","y","declareDisplacementMapImageFilter","channelX","channelY","scale","shader","shaders","Error","map","MakeShader","imgf","MakeDisplacementMap","push","makeBlurImageFilter","mode","blur","sigma","makeDropShadowImageFilter","cl","inner","Color","factory","bind","MakeDropShadowOnly","MakeDropShadow","makeMorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","makeRuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader","declareBlendImageFilter","a","b","declareBlurMaskFilter","style","respectCTM","mf","MaskFilter","maskFilters"],"sources":["imageFilters.ts"],"sourcesContent":["\"worklet\";\n\nimport { enumKey, processRadius } from \"../../dom/nodes\";\nimport type {\n BlendImageFilterProps,\n BlurImageFilterProps,\n BlurMaskFilterProps,\n DeclarationContext,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../dom/types\";\nimport type { SkColor, Skia, SkImageFilter } from \"../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../skia/types\";\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 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 input = (ctx: DeclarationContext) => {\n return ctx.imageFilters.pop() ?? null;\n};\n\nexport const makeOffsetImageFilter = (\n ctx: DeclarationContext,\n props: OffsetImageFilterProps\n) => {\n const { x, y } = props;\n return ctx.Skia.ImageFilter.MakeOffset(x, y, null);\n};\n\nexport const declareDisplacementMapImageFilter = (\n ctx: DeclarationContext,\n props: DisplacementMapImageFilterProps\n) => {\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 input(ctx)\n );\n ctx.imageFilters.push(imgf);\n};\n\nexport const makeBlurImageFilter = (\n ctx: DeclarationContext,\n props: BlurImageFilterProps\n) => {\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 input(ctx)\n );\n return imgf;\n};\n\nexport const makeDropShadowImageFilter = (\n ctx: DeclarationContext,\n props: DropShadowImageFilterProps\n) => {\n const { dx, dy, blur, shadowOnly, color: cl, inner } = props;\n const color = ctx.Skia.Color(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, input(ctx));\n return imgf;\n};\n\nexport const makeMorphologyImageFilter = (\n ctx: DeclarationContext,\n props: MorphologyImageFilterProps\n) => {\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, input(ctx));\n } else {\n imgf = ctx.Skia.ImageFilter.MakeDilate(r.x, r.y, input(ctx));\n }\n return imgf;\n};\n\nexport const makeRuntimeShaderImageFilter = (\n ctx: DeclarationContext,\n props: RuntimeShaderImageFilterProps\n) => {\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, input(ctx));\n return imgf;\n};\n\nexport const declareBlendImageFilter = (\n ctx: DeclarationContext,\n props: BlendImageFilterProps\n) => {\n const { mode } = props;\n const a = ctx.imageFilters.pop();\n const b = ctx.imageFilters.pop();\n if (!a || !b) {\n throw new Error(\"BlendImageFilter requires two image filters\");\n }\n const imgf = ctx.Skia.ImageFilter.MakeBlend(mode, a, b);\n ctx.imageFilters.push(imgf);\n};\n\nexport const declareBlurMaskFilter = (\n ctx: DeclarationContext,\n props: BlurMaskFilterProps\n) => {\n const { blur, style, respectCTM } = props;\n const mf = ctx.Skia.MaskFilter.MakeBlur(\n BlurStyle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,GAAG,CAACqD,WAAW,CAAClC,IAAI,CAACgC,EAAE,CAAC;AAC1B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["enumKey","processRadius","BlendMode","BlurStyle","ColorChannel","processUniforms","TileMode","composeDeclarations","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","declareBlend","ctx","props","blend","mode","imageFilters","popAll","length","composer","bind","push","shaders","Shader","composeImageFilters","imgf1","processChildren","save","colorFilters","imgf2","popAllAsOne","cf","restore","_imgf","imgf","_ctx$imageFilters$pop","pop","makeOffsetImageFilter","x","y","declareDisplacementMapImageFilter","channelX","channelY","scale","shader","Error","map","MakeShader","MakeDisplacementMap","makeBlurImageFilter","blur","sigma","makeDropShadowImageFilter","cl","inner","Color","factory","MakeDropShadowOnly","MakeDropShadow","makeMorphologyImageFilter","operator","r","radius","Erode","MakeErode","MakeDilate","makeRuntimeShaderImageFilter","source","uniforms","rtb","RuntimeShaderBuilder","MakeRuntimeShader","declareBlendImageFilter","a","b","declareBlurMaskFilter","style","respectCTM","mf","MaskFilter","maskFilters"],"sources":["imageFilters.ts"],"sourcesContent":["import { enumKey, processRadius } from \"../../dom/nodes\";\nimport type {\n BlendImageFilterProps,\n BlendProps,\n BlurImageFilterProps,\n BlurMaskFilterProps,\n DisplacementMapImageFilterProps,\n DropShadowImageFilterProps,\n MorphologyImageFilterProps,\n OffsetImageFilterProps,\n RuntimeShaderImageFilterProps,\n} from \"../../dom/types\";\nimport type { SkColor, Skia, SkImageFilter } from \"../../skia/types\";\nimport {\n BlendMode,\n BlurStyle,\n ColorChannel,\n processUniforms,\n TileMode,\n} from \"../../skia/types\";\nimport type { DeclarationContext } from \"../DeclarationContext\";\nimport { composeDeclarations } from \"../DeclarationContext\";\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\nexport const declareBlend = (ctx: DeclarationContext, props: BlendProps) => {\n \"worklet\";\n const { Skia } = ctx;\n const blend = BlendMode[enumKey(props.mode as BlendProps[\"mode\"])];\n // Blend ImageFilters\n const imageFilters = ctx.imageFilters.popAll();\n if (imageFilters.length > 0) {\n const composer = Skia.ImageFilter.MakeBlend.bind(Skia.ImageFilter, blend);\n ctx.imageFilters.push(composeDeclarations(imageFilters, composer));\n }\n // Blend Shaders\n const shaders = ctx.shaders.popAll();\n if (shaders.length > 0) {\n const composer = Skia.Shader.MakeBlend.bind(Skia.Shader, blend);\n ctx.shaders.push(composeDeclarations(shaders, composer));\n }\n};\n\nexport const composeImageFilters = (\n ctx: DeclarationContext,\n imgf1: SkImageFilter,\n processChildren: () => void\n) => {\n \"worklet\";\n const { Skia } = ctx;\n ctx.imageFilters.save();\n ctx.colorFilters.save();\n processChildren();\n let imgf2 = ctx.imageFilters.popAllAsOne();\n const cf = ctx.colorFilters.popAllAsOne();\n ctx.imageFilters.restore();\n ctx.colorFilters.restore();\n if (cf) {\n imgf2 = Skia.ImageFilter.MakeCompose(\n imgf2 ?? null,\n Skia.ImageFilter.MakeColorFilter(cf, null)\n );\n }\n const imgf = imgf2 ? Skia.ImageFilter.MakeCompose(imgf1, imgf2) : imgf1;\n ctx.imageFilters.push(imgf);\n};\n\nconst input = (ctx: DeclarationContext) => {\n \"worklet\";\n return ctx.imageFilters.pop() ?? null;\n};\n\nexport const makeOffsetImageFilter = (\n ctx: DeclarationContext,\n props: OffsetImageFilterProps\n) => {\n \"worklet\";\n const { x, y } = props;\n return ctx.Skia.ImageFilter.MakeOffset(x, y, null);\n};\n\nexport const declareDisplacementMapImageFilter = (\n ctx: DeclarationContext,\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 input(ctx)\n );\n ctx.imageFilters.push(imgf);\n};\n\nexport const makeBlurImageFilter = (\n ctx: DeclarationContext,\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 input(ctx)\n );\n return imgf;\n};\n\nexport const makeDropShadowImageFilter = (\n ctx: DeclarationContext,\n props: DropShadowImageFilterProps\n) => {\n \"worklet\";\n const { dx, dy, blur, shadowOnly, color: cl, inner } = props;\n const color = ctx.Skia.Color(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, input(ctx));\n return imgf;\n};\n\nexport const makeMorphologyImageFilter = (\n ctx: DeclarationContext,\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, input(ctx));\n } else {\n imgf = ctx.Skia.ImageFilter.MakeDilate(r.x, r.y, input(ctx));\n }\n return imgf;\n};\n\nexport const makeRuntimeShaderImageFilter = (\n ctx: DeclarationContext,\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, input(ctx));\n return imgf;\n};\n\nexport const declareBlendImageFilter = (\n ctx: DeclarationContext,\n props: BlendImageFilterProps\n) => {\n \"worklet\";\n const { mode } = props;\n const a = ctx.imageFilters.pop();\n const b = ctx.imageFilters.pop();\n if (!a || !b) {\n throw new Error(\"BlendImageFilter requires two image filters\");\n }\n const imgf = ctx.Skia.ImageFilter.MakeBlend(mode, a, b);\n ctx.imageFilters.push(imgf);\n};\n\nexport const declareBlurMaskFilter = (\n ctx: DeclarationContext,\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.maskFilters.push(mf);\n};\n"],"mappings":"AAAA,SAASA,OAAO,E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EAChC,MAAMsC,CAAC,GAAG9D,GAAG,CAACI,YAAY,CAACoB,GAAG,CAAC,CAAC;EAChC,IAAI,CAACqC,CAAC,IAAI,CAACC,CAAC,EAAE;IACZ,MAAM,IAAI7B,KAAK,CAAC,6CAA6C,CAAC;EAChE;EACA,MAAMX,IAAI,GAAGtB,GAAG,CAAC3B,IAAI,CAACS,WAAW,CAACG,SAAS,CAACkB,IAAI,EAAE0D,CAAC,EAAEC,CAAC,CAAC;EACvD9D,GAAG,CAACI,YAAY,CAACK,IAAI,CAACa,IAAI,CAAC;AAC7B,CAAC;AAED,OAAO,MAAMyC,qBAAqB,GAAGA,CACnC/D,GAAuB,EACvBC,KAA0B,KACvB;EACH,SAAS;;EACT,MAAM;IAAEqC,IAAI;IAAE0B,KAAK;IAAEC;EAAW,CAAC,GAAGhE,KAAK;EACzC,MAAMiE,EAAE,GAAGlE,GAAG,CAAC3B,IAAI,CAAC8F,UAAU,CAACzE,QAAQ,CACrC/B,SAAS,CAACH,OAAO,CAACwG,KAAK,CAAC,CAAC,EACzB1B,IAAI,EACJ2B,UACF,CAAC;EACDjE,GAAG,CAACoE,WAAW,CAAC3D,IAAI,CAACyD,EAAE,CAAC;AAC1B,CAAC","ignoreList":[]}
@@ -1,2 +1,3 @@
1
- import type { DeclarationContext, PaintProps } from "../../dom/types";
1
+ import type { PaintProps } from "../../dom/types";
2
+ import type { DeclarationContext } from "../DeclarationContext";
2
3
  export declare const declarePaint: (ctx: DeclarationContext, props: PaintProps) => void;
@@ -1,8 +1,8 @@
1
- "worklet";
2
-
3
1
  import { enumKey } from "../../dom/nodes";
4
2
  import { BlendMode, PaintStyle, StrokeCap, StrokeJoin } from "../../skia/types";
5
3
  export const declarePaint = (ctx, props) => {
4
+ "worklet";
5
+
6
6
  const {
7
7
  color,
8
8
  strokeWidth,
@@ -1 +1 @@
1
- {"version":3,"names":["enumKey","BlendMode","PaintStyle","StrokeCap","StrokeJoin","declarePaint","ctx","props","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","dither","paint","Skia","Paint","undefined","setColor","Color","setStrokeWidth","setBlendMode","setStyle","setStrokeJoin","setStrokeCap","setStrokeMiter","setAlphaf","setAntiAlias","setDither","colorFilter","colorFilters","popAllAsOne","imageFilter","imageFilters","shader","shaders","pop","maskFilter","maskFilters","pathEffect","pathEffects","setImageFilter","setShader","setPathEffect","setColorFilter","setMaskFilter","paints","push"],"sources":["paint.ts"],"sourcesContent":["\"worklet\";\n\nimport { enumKey } from \"../../dom/nodes\";\nimport type { DeclarationContext, PaintProps } from \"../../dom/types\";\nimport { BlendMode, PaintStyle, StrokeCap, StrokeJoin } from \"../../skia/types\";\n\nexport const declarePaint = (ctx: DeclarationContext, props: PaintProps) => {\n const {\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n dither,\n } = props;\n const paint = ctx.Skia.Paint();\n if (color !== undefined) {\n paint.setColor(ctx.Skia.Color(color));\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n //ctx.save();\n\n const colorFilter = ctx.colorFilters.popAllAsOne();\n const imageFilter = ctx.imageFilters.popAllAsOne();\n const shader = ctx.shaders.pop();\n const maskFilter = ctx.maskFilters.pop();\n const pathEffect = ctx.pathEffects.popAllAsOne();\n //ctx.restore();\n if (imageFilter) {\n paint.setImageFilter(imageFilter);\n }\n if (shader) {\n paint.setShader(shader);\n }\n if (pathEffect) {\n paint.setPathEffect(pathEffect);\n }\n if (colorFilter) {\n paint.setColorFilter(colorFilter);\n }\n if (maskFilter) {\n paint.setMaskFilter(maskFilter);\n }\n ctx.paints.push(paint);\n};\n"],"mappings":"AAAA,SAAS;;AAET,SAASA,OAAO,QAAQ,iBAAiB;AAEzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAE/E,OAAO,MAAMC,YAAY,GAAGA,CAACC,GAAuB,EAAEC,KAAiB,KAAK;EAC1E,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,SAAS;IACTC,KAAK;IACLC,UAAU;IACVC,SAAS;IACTC,WAAW;IACXC,OAAO;IACPC,SAAS;IACTC;EACF,CAAC,GAAGV,KAAK;EACT,MAAMW,KAAK,GAAGZ,GAAG,CAACa,IAAI,CAACC,KAAK,CAAC,CAAC;EAC9B,IAAIZ,KAAK,KAAKa,SAAS,EAAE;IACvBH,KAAK,CAACI,QAAQ,CAAChB,GAAG,CAACa,IAAI,CAACI,KAAK,CAACf,KAAK,CAAC,CAAC;EACvC;EACA,IAAIC,WAAW,KAAKY,SAAS,EAAE;IAC7BH,KAAK,CAACM,cAAc,CAACf,WAAW,CAAC;EACnC;EACA,IAAIC,SAAS,KAAKW,SAAS,EAAE;IAC3BH,KAAK,CAACO,YAAY,CAACxB,SAAS,CAACD,OAAO,CAACU,SAAS,CAAC,CAAC,CAAC;EACnD;EACA,IAAIC,KAAK,KAAKU,SAAS,EAAE;IACvBH,KAAK,CAACQ,QAAQ,CAACxB,UAAU,CAACF,OAAO,CAACW,KAAK,CAAC,CAAC,CAAC;EAC5C;EACA,IAAIC,UAAU,KAAKS,SAAS,EAAE;IAC5BH,KAAK,CAACS,aAAa,CAACvB,UAAU,CAACJ,OAAO,CAACY,UAAU,CAAC,CA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AC;EACjC;EACAnC,GAAG,CAAC4C,MAAM,CAACC,IAAI,CAACjC,KAAK,CAAC;AACxB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["enumKey","BlendMode","PaintStyle","StrokeCap","StrokeJoin","declarePaint","ctx","props","color","strokeWidth","blendMode","style","strokeJoin","strokeCap","strokeMiter","opacity","antiAlias","dither","paint","Skia","Paint","undefined","setColor","Color","setStrokeWidth","setBlendMode","setStyle","setStrokeJoin","setStrokeCap","setStrokeMiter","setAlphaf","setAntiAlias","setDither","colorFilter","colorFilters","popAllAsOne","imageFilter","imageFilters","shader","shaders","pop","maskFilter","maskFilters","pathEffect","pathEffects","setImageFilter","setShader","setPathEffect","setColorFilter","setMaskFilter","paints","push"],"sources":["paint.ts"],"sourcesContent":["import { enumKey } from \"../../dom/nodes\";\nimport type { PaintProps } from \"../../dom/types\";\nimport { BlendMode, PaintStyle, StrokeCap, StrokeJoin } from \"../../skia/types\";\nimport type { DeclarationContext } from \"../DeclarationContext\";\n\nexport const declarePaint = (ctx: DeclarationContext, props: PaintProps) => {\n \"worklet\";\n const {\n color,\n strokeWidth,\n blendMode,\n style,\n strokeJoin,\n strokeCap,\n strokeMiter,\n opacity,\n antiAlias,\n dither,\n } = props;\n const paint = ctx.Skia.Paint();\n if (color !== undefined) {\n paint.setColor(ctx.Skia.Color(color));\n }\n if (strokeWidth !== undefined) {\n paint.setStrokeWidth(strokeWidth);\n }\n if (blendMode !== undefined) {\n paint.setBlendMode(BlendMode[enumKey(blendMode)]);\n }\n if (style !== undefined) {\n paint.setStyle(PaintStyle[enumKey(style)]);\n }\n if (strokeJoin !== undefined) {\n paint.setStrokeJoin(StrokeJoin[enumKey(strokeJoin)]);\n }\n if (strokeCap !== undefined) {\n paint.setStrokeCap(StrokeCap[enumKey(strokeCap)]);\n }\n if (strokeMiter !== undefined) {\n paint.setStrokeMiter(strokeMiter);\n }\n if (opacity !== undefined) {\n paint.setAlphaf(opacity);\n }\n if (antiAlias !== undefined) {\n paint.setAntiAlias(antiAlias);\n }\n if (dither !== undefined) {\n paint.setDither(dither);\n }\n //ctx.save();\n\n const colorFilter = ctx.colorFilters.popAllAsOne();\n const imageFilter = ctx.imageFilters.popAllAsOne();\n const shader = ctx.shaders.pop();\n const maskFilter = ctx.maskFilters.pop();\n const pathEffect = ctx.pathEffects.popAllAsOne();\n //ctx.restore();\n if (imageFilter) {\n paint.setImageFilter(imageFilter);\n }\n if (shader) {\n paint.setShader(shader);\n }\n if (pathEffect) {\n paint.setPathEffect(pathEffect);\n }\n if (colorFilter) {\n paint.setColorFilter(colorFilter);\n }\n if (maskFilter) {\n paint.setMaskFilter(maskFilter);\n }\n ctx.paints.push(paint);\n};\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,iBAAiB;AAEzC,SAASC,SAAS,EAAEC,UAAU,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAG/E,OAAO,MAAMC,YAAY,GAAGA,CAACC,GAAuB,EAAEC,KAAiB,KAAK;EAC1E,SAAS;;EACT,MAAM;IACJC,KAAK;IACLC,WAAW;IACXC,SAAS;IACTC,KAAK;IACLC,UAAU;IACVC,SAAS;IACTC,WAAW;IACXC,OAAO;IACPC,SAAS;IACTC;EACF,CAAC,GAAGV,KAAK;EACT,MAAMW,KAAK,GAAGZ,GAAG,CAACa,IAAI,CAACC,KAAK,CAAC,CAAC;EAC9B,IAAIZ,KAAK,KAAKa,SAAS,EAAE;IACvBH,KAAK,CAACI,QAAQ,CAAChB,GAAG,CAACa,IAAI,CAACI,KAAK,CAACf,KAAK,CAAC,CAAC;EACvC;EACA,IAAIC,WAAW,KAAKY,SAAS,EAAE;IAC7BH,KAAK,CAACM,cAAc,CAACf,WAAW,CAAC;EACnC;EACA,IAAIC,SAAS,KAAKW,SAAS,EAAE;IAC3BH,KAAK,CAACO,YAAY,CAACxB,SAAS,CAACD,OAAO,CAACU,SAAS,CAAC,CAAC,CAAC;EACnD;EACA,IAAIC,KAAK,KAAKU,SAAS,EAAE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U,EAAE;IACdzB,KAAK,CAAC6B,aAAa,CAACJ,UAAU,CAAC;EACjC;EACA,IAAIV,WAAW,EAAE;IACff,KAAK,CAAC8B,cAAc,CAACf,WAAW,CAAC;EACnC;EACA,IAAIQ,UAAU,EAAE;IACdvB,KAAK,CAAC+B,aAAa,CAACR,UAAU,CAAC;EACjC;EACAnC,GAAG,CAAC4C,MAAM,CAACC,IAAI,CAACjC,KAAK,CAAC;AACxB,CAAC","ignoreList":[]}
@@ -1,8 +1,11 @@
1
- import type { CornerPathEffectProps, DashPathEffectProps, DeclarationContext, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../../dom/types";
2
- export declare const makeDiscretePathEffect: (ctx: DeclarationContext, props: DiscretePathEffectProps) => import("../../skia/types").SkPathEffect;
3
- export declare const makePath2DPathEffect: (ctx: DeclarationContext, props: Path2DPathEffectProps) => import("../../skia/types").SkPathEffect;
4
- export declare const makeDashPathEffect: (ctx: DeclarationContext, props: DashPathEffectProps) => import("../../skia/types").SkPathEffect;
5
- export declare const makeCornerPathEffect: (ctx: DeclarationContext, props: CornerPathEffectProps) => import("../../skia/types").SkPathEffect;
1
+ import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, Path1DPathEffectProps, Path2DPathEffectProps } from "../../dom/types";
2
+ import type { SkPathEffect } from "../../skia/types";
3
+ import { type DeclarationContext } from "../DeclarationContext";
4
+ export declare const composePathEffects: (ctx: DeclarationContext, pe: SkPathEffect, processChildren: () => void) => void;
5
+ export declare const makeDiscretePathEffect: (ctx: DeclarationContext, props: DiscretePathEffectProps) => SkPathEffect;
6
+ export declare const makePath2DPathEffect: (ctx: DeclarationContext, props: Path2DPathEffectProps) => SkPathEffect;
7
+ export declare const makeDashPathEffect: (ctx: DeclarationContext, props: DashPathEffectProps) => SkPathEffect;
8
+ export declare const makeCornerPathEffect: (ctx: DeclarationContext, props: CornerPathEffectProps) => SkPathEffect;
6
9
  export declare const declareSumPathEffect: (ctx: DeclarationContext) => void;
7
- export declare const makeLine2DPathEffect: (ctx: DeclarationContext, props: Line2DPathEffectProps) => import("../../skia/types").SkPathEffect;
8
- export declare const makePath1DPathEffect: (ctx: DeclarationContext, props: Path1DPathEffectProps) => import("../../skia/types").SkPathEffect;
10
+ export declare const makeLine2DPathEffect: (ctx: DeclarationContext, props: Line2DPathEffectProps) => SkPathEffect;
11
+ export declare const makePath1DPathEffect: (ctx: DeclarationContext, props: Path1DPathEffectProps) => SkPathEffect;
@@ -1,8 +1,21 @@
1
- "worklet";
2
-
3
- import { composeDeclarations, enumKey, processPath } from "../../dom/nodes";
1
+ import { enumKey, processPath } from "../../dom/nodes";
4
2
  import { Path1DEffectStyle } from "../../skia/types";
3
+ import { composeDeclarations } from "../DeclarationContext";
4
+ export const composePathEffects = (ctx, pe, processChildren) => {
5
+ "worklet";
6
+
7
+ const {
8
+ Skia
9
+ } = ctx;
10
+ ctx.pathEffects.save();
11
+ processChildren();
12
+ const pe1 = ctx.pathEffects.popAllAsOne();
13
+ ctx.pathEffects.restore();
14
+ ctx.pathEffects.push(pe1 ? Skia.PathEffect.MakeCompose(pe, pe1) : pe);
15
+ };
5
16
  export const makeDiscretePathEffect = (ctx, props) => {
17
+ "worklet";
18
+
6
19
  const {
7
20
  length,
8
21
  deviation,
@@ -11,6 +24,8 @@ export const makeDiscretePathEffect = (ctx, props) => {
11
24
  return ctx.Skia.PathEffect.MakeDiscrete(length, deviation, seed);
12
25
  };
13
26
  export const makePath2DPathEffect = (ctx, props) => {
27
+ "worklet";
28
+
14
29
  const {
15
30
  matrix
16
31
  } = props;
@@ -22,6 +37,8 @@ export const makePath2DPathEffect = (ctx, props) => {
22
37
  return pe;
23
38
  };
24
39
  export const makeDashPathEffect = (ctx, props) => {
40
+ "worklet";
41
+
25
42
  const {
26
43
  intervals,
27
44
  phase
@@ -30,6 +47,8 @@ export const makeDashPathEffect = (ctx, props) => {
30
47
  return pe;
31
48
  };
32
49
  export const makeCornerPathEffect = (ctx, props) => {
50
+ "worklet";
51
+
33
52
  const {
34
53
  r
35
54
  } = props;
@@ -40,12 +59,16 @@ export const makeCornerPathEffect = (ctx, props) => {
40
59
  return pe;
41
60
  };
42
61
  export const declareSumPathEffect = ctx => {
62
+ "worklet";
63
+
43
64
  // Note: decorateChildren functionality needs to be handled differently
44
65
  const pes = ctx.pathEffects.popAll();
45
66
  const pe = composeDeclarations(pes, ctx.Skia.PathEffect.MakeSum.bind(ctx.Skia.PathEffect));
46
67
  ctx.pathEffects.push(pe);
47
68
  };
48
69
  export const makeLine2DPathEffect = (ctx, props) => {
70
+ "worklet";
71
+
49
72
  const {
50
73
  width,
51
74
  matrix
@@ -57,6 +80,8 @@ export const makeLine2DPathEffect = (ctx, props) => {
57
80
  return pe;
58
81
  };
59
82
  export const makePath1DPathEffect = (ctx, props) => {
83
+ "worklet";
84
+
60
85
  const {
61
86
  advance,
62
87
  phase,
@@ -1 +1 @@
1
- {"version":3,"names":["composeDeclarations","enumKey","processPath","Path1DEffectStyle","makeDiscretePathEffect","ctx","props","length","deviation","seed","Skia","PathEffect","MakeDiscrete","makePath2DPathEffect","matrix","path","pe","MakePath2D","Error","makeDashPathEffect","intervals","phase","MakeDash","makeCornerPathEffect","r","MakeCorner","declareSumPathEffect","pes","pathEffects","popAll","MakeSum","bind","push","makeLine2DPathEffect","width","MakeLine2D","makePath1DPathEffect","advance","style","MakePath1D"],"sources":["pathEffects.ts"],"sourcesContent":["\"worklet\";\n\nimport { composeDeclarations, enumKey, processPath } from \"../../dom/nodes\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DeclarationContext,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../dom/types\";\nimport { Path1DEffectStyle } from \"../../skia/types\";\n\nexport const makeDiscretePathEffect = (\n ctx: DeclarationContext,\n props: DiscretePathEffectProps\n) => {\n const { length, deviation, seed } = props;\n return ctx.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n};\n\nexport const makePath2DPathEffect = (\n ctx: DeclarationContext,\n props: Path2DPathEffectProps\n) => {\n const { matrix } = props;\n const path = processPath(ctx.Skia, props.path);\n const pe = ctx.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n throw new Error(\"Path2DPathEffect: invalid path\");\n }\n return pe;\n};\n\nexport const makeDashPathEffect = (\n ctx: DeclarationContext,\n props: DashPathEffectProps\n) => {\n const { intervals, phase } = props;\n const pe = ctx.Skia.PathEffect.MakeDash(intervals, phase);\n return pe;\n};\n\nexport const makeCornerPathEffect = (\n ctx: DeclarationContext,\n props: CornerPathEffectProps\n) => {\n const { r } = props;\n const pe = ctx.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n throw new Error(\"CornerPathEffect: couldn't create path effect\");\n }\n return pe;\n};\n\nexport const declareSumPathEffect = (ctx: DeclarationContext) => {\n // Note: decorateChildren functionality needs to be handled differently\n const pes = ctx.pathEffects.popAll();\n const pe = composeDeclarations(\n pes,\n ctx.Skia.PathEffect.MakeSum.bind(ctx.Skia.PathEffect)\n );\n ctx.pathEffects.push(pe);\n};\n\nexport const makeLine2DPathEffect = (\n ctx: DeclarationContext,\n props: Line2DPathEffectProps\n) => {\n const { width, matrix } = props;\n const pe = ctx.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n throw new Error(\"Line2DPathEffect: could not create path effect\");\n }\n return pe;\n};\n\nexport const makePath1DPathEffect = (\n ctx: DeclarationContext,\n props: Path1DPathEffectProps\n) => {\n const { advance, phase, style } = props;\n const path = processPath(ctx.Skia, props.path);\n const pe = ctx.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n throw new Error(\"Path1DPathEffect: could not create path effect\");\n }\n return pe;\n};\n"],"mappings":"AAAA,SAAS;;AAET,SAASA,mBAAmB,EAAEC,OAAO,EAAEC,WAAW,QAAQ,iBAAiB;AA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AC,gDAAgD,CAAC;EACnE;EACA,OAAOF,EAAE;AACX,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["enumKey","processPath","Path1DEffectStyle","composeDeclarations","composePathEffects","ctx","pe","processChildren","Skia","pathEffects","save","pe1","popAllAsOne","restore","push","PathEffect","MakeCompose","makeDiscretePathEffect","props","length","deviation","seed","MakeDiscrete","makePath2DPathEffect","matrix","path","MakePath2D","Error","makeDashPathEffect","intervals","phase","MakeDash","makeCornerPathEffect","r","MakeCorner","declareSumPathEffect","pes","popAll","MakeSum","bind","makeLine2DPathEffect","width","MakeLine2D","makePath1DPathEffect","advance","style","MakePath1D"],"sources":["pathEffects.ts"],"sourcesContent":["import { enumKey, processPath } from \"../../dom/nodes\";\nimport type {\n CornerPathEffectProps,\n DashPathEffectProps,\n DiscretePathEffectProps,\n Line2DPathEffectProps,\n Path1DPathEffectProps,\n Path2DPathEffectProps,\n} from \"../../dom/types\";\nimport type { SkPathEffect } from \"../../skia/types\";\nimport { Path1DEffectStyle } from \"../../skia/types\";\nimport {\n composeDeclarations,\n type DeclarationContext,\n} from \"../DeclarationContext\";\n\nexport const composePathEffects = (\n ctx: DeclarationContext,\n pe: SkPathEffect,\n processChildren: () => void\n) => {\n \"worklet\";\n const { Skia } = ctx;\n ctx.pathEffects.save();\n processChildren();\n const pe1 = ctx.pathEffects.popAllAsOne();\n ctx.pathEffects.restore();\n ctx.pathEffects.push(pe1 ? Skia.PathEffect.MakeCompose(pe, pe1) : pe);\n};\n\nexport const makeDiscretePathEffect = (\n ctx: DeclarationContext,\n props: DiscretePathEffectProps\n) => {\n \"worklet\";\n const { length, deviation, seed } = props;\n return ctx.Skia.PathEffect.MakeDiscrete(length, deviation, seed);\n};\n\nexport const makePath2DPathEffect = (\n ctx: DeclarationContext,\n props: Path2DPathEffectProps\n) => {\n \"worklet\";\n const { matrix } = props;\n const path = processPath(ctx.Skia, props.path);\n const pe = ctx.Skia.PathEffect.MakePath2D(matrix, path);\n if (pe === null) {\n throw new Error(\"Path2DPathEffect: invalid path\");\n }\n return pe;\n};\n\nexport const makeDashPathEffect = (\n ctx: DeclarationContext,\n props: DashPathEffectProps\n) => {\n \"worklet\";\n const { intervals, phase } = props;\n const pe = ctx.Skia.PathEffect.MakeDash(intervals, phase);\n return pe;\n};\n\nexport const makeCornerPathEffect = (\n ctx: DeclarationContext,\n props: CornerPathEffectProps\n) => {\n \"worklet\";\n const { r } = props;\n const pe = ctx.Skia.PathEffect.MakeCorner(r);\n if (pe === null) {\n throw new Error(\"CornerPathEffect: couldn't create path effect\");\n }\n return pe;\n};\n\nexport const declareSumPathEffect = (ctx: DeclarationContext) => {\n \"worklet\";\n // Note: decorateChildren functionality needs to be handled differently\n const pes = ctx.pathEffects.popAll();\n const pe = composeDeclarations(\n pes,\n ctx.Skia.PathEffect.MakeSum.bind(ctx.Skia.PathEffect)\n );\n ctx.pathEffects.push(pe);\n};\n\nexport const makeLine2DPathEffect = (\n ctx: DeclarationContext,\n props: Line2DPathEffectProps\n) => {\n \"worklet\";\n const { width, matrix } = props;\n const pe = ctx.Skia.PathEffect.MakeLine2D(width, matrix);\n if (pe === null) {\n throw new Error(\"Line2DPathEffect: could not create path effect\");\n }\n return pe;\n};\n\nexport const makePath1DPathEffect = (\n ctx: DeclarationContext,\n props: Path1DPathEffectProps\n) => {\n \"worklet\";\n const { advance, phase, style } = props;\n const path = processPath(ctx.Skia, props.path);\n const pe = ctx.Skia.PathEffect.MakePath1D(\n path,\n advance,\n phase,\n Path1DEffectStyle[enumKey(style)]\n );\n if (pe === null) {\n throw new Error(\"Path1DPathEffect: could not create path effect\");\n }\n return pe;\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,WAAW,QAAQ,iBAAiB;AAUtD,SAASC,iBAAiB,QAAQ,kBAAkB;AACpD,SACEC,mBAAmB,QAEd,uBAAuB;AAE9B,OAAO,MAAMC,kBAAkB,GAAGA,CAChCC,GAAuB,EACvBC,EAAgB,EAChBC,eAA2B,KACxB;EACH,SAA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B,GAAGA,CAClCtC,GAAuB,EACvBa,KAA4B,KACzB;EACH,SAAS;;EACT,MAAM;IAAE0B,OAAO;IAAEd,KAAK;IAAEe;EAAM,CAAC,GAAG3B,KAAK;EACvC,MAAMO,IAAI,GAAGxB,WAAW,CAACI,GAAG,CAACG,IAAI,EAAEU,KAAK,CAACO,IAAI,CAAC;EAC9C,MAAMnB,EAAE,GAAGD,GAAG,CAACG,IAAI,CAACO,UAAU,CAAC+B,UAAU,CACvCrB,IAAI,EACJmB,OAAO,EACPd,KAAK,EACL5B,iBAAiB,CAACF,OAAO,CAAC6C,KAAK,CAAC,CAClC,CAAC;EACD,IAAIvC,EAAE,KAAK,IAAI,EAAE;IACf,MAAM,IAAIqB,KAAK,CAAC,gDAAgD,CAAC;EACnE;EACA,OAAOrB,EAAE;AACX,CAAC","ignoreList":[]}
@@ -1,4 +1,5 @@
1
- import type { ColorProps, DeclarationContext, FractalNoiseProps, ImageShaderProps, LinearGradientProps, RadialGradientProps, ShaderProps, SweepGradientProps, TurbulenceProps, TwoPointConicalGradientProps } from "../../dom/types";
1
+ import type { ColorProps, FractalNoiseProps, ImageShaderProps, LinearGradientProps, RadialGradientProps, ShaderProps, SweepGradientProps, TurbulenceProps, TwoPointConicalGradientProps } from "../../dom/types";
2
+ import type { DeclarationContext } from "../DeclarationContext";
2
3
  export declare const declareShader: (ctx: DeclarationContext, props: ShaderProps) => void;
3
4
  export declare const declareColorShader: (ctx: DeclarationContext, props: ColorProps) => void;
4
5
  export declare const declareFractalNoiseShader: (ctx: DeclarationContext, props: FractalNoiseProps) => void;
@@ -1,8 +1,8 @@
1
- "worklet";
2
-
3
1
  import { enumKey, fitRects, getRect, processGradientProps, processTransformProps, rect2rect } from "../../dom/nodes";
4
2
  import { FilterMode, MipmapMode, processUniforms, TileMode } from "../../skia/types";
5
3
  export const declareShader = (ctx, props) => {
4
+ "worklet";
5
+
6
6
  const {
7
7
  source,
8
8
  uniforms,
@@ -14,6 +14,8 @@ export const declareShader = (ctx, props) => {
14
14
  ctx.shaders.push(shader);
15
15
  };
16
16
  export const declareColorShader = (ctx, props) => {
17
+ "worklet";
18
+
17
19
  const {
18
20
  color
19
21
  } = props;
@@ -21,6 +23,8 @@ export const declareColorShader = (ctx, props) => {
21
23
  ctx.shaders.push(shader);
22
24
  };
23
25
  export const declareFractalNoiseShader = (ctx, props) => {
26
+ "worklet";
27
+
24
28
  const {
25
29
  freqX,
26
30
  freqY,
@@ -33,6 +37,8 @@ export const declareFractalNoiseShader = (ctx, props) => {
33
37
  ctx.shaders.push(shader);
34
38
  };
35
39
  export const declareTwoPointConicalGradientShader = (ctx, props) => {
40
+ "worklet";
41
+
36
42
  const {
37
43
  startR,
38
44
  endR,
@@ -50,6 +56,8 @@ export const declareTwoPointConicalGradientShader = (ctx, props) => {
50
56
  ctx.shaders.push(shader);
51
57
  };
52
58
  export const declareRadialGradientShader = (ctx, props) => {
59
+ "worklet";
60
+
53
61
  const {
54
62
  c,
55
63
  r
@@ -65,6 +73,8 @@ export const declareRadialGradientShader = (ctx, props) => {
65
73
  ctx.shaders.push(shader);
66
74
  };
67
75
  export const declareSweepGradientShader = (ctx, props) => {
76
+ "worklet";
77
+
68
78
  const {
69
79
  c,
70
80
  start,
@@ -81,6 +91,8 @@ export const declareSweepGradientShader = (ctx, props) => {
81
91
  ctx.shaders.push(shader);
82
92
  };
83
93
  export const declareLinearGradientShader = (ctx, props) => {
94
+ "worklet";
95
+
84
96
  const {
85
97
  start,
86
98
  end
@@ -96,6 +108,8 @@ export const declareLinearGradientShader = (ctx, props) => {
96
108
  ctx.shaders.push(shader);
97
109
  };
98
110
  export const declareTurbulenceShader = (ctx, props) => {
111
+ "worklet";
112
+
99
113
  const {
100
114
  freqX,
101
115
  freqY,
@@ -108,6 +122,8 @@ export const declareTurbulenceShader = (ctx, props) => {
108
122
  ctx.shaders.push(shader);
109
123
  };
110
124
  export const declareImageShader = (ctx, props) => {
125
+ "worklet";
126
+
111
127
  const {
112
128
  fit,
113
129
  image,