@nativescript/canvas 2.0.0-beta.9 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/Canvas/common.d.ts +16 -24
  2. package/Canvas/common.js +149 -203
  3. package/Canvas/common.js.map +1 -1
  4. package/Canvas/index.android.d.ts +13 -15
  5. package/Canvas/index.android.js +152 -151
  6. package/Canvas/index.android.js.map +1 -1
  7. package/Canvas/index.d.ts +23 -11
  8. package/Canvas/index.ios.d.ts +14 -6
  9. package/Canvas/index.ios.js +213 -124
  10. package/Canvas/index.ios.js.map +1 -1
  11. package/Canvas/utils.d.ts +3 -0
  12. package/Canvas/utils.js +85 -0
  13. package/Canvas/utils.js.map +1 -0
  14. package/Canvas2D/CanvasRenderingContext2D/index.d.ts +4 -2
  15. package/Canvas2D/CanvasRenderingContext2D/index.js +79 -85
  16. package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
  17. package/Canvas2D/DOMMatrix/index.d.ts +14 -0
  18. package/Canvas2D/DOMMatrix/index.js +62 -0
  19. package/Canvas2D/DOMMatrix/index.js.map +1 -1
  20. package/Canvas2D/ImageData/index.js +4 -6
  21. package/Canvas2D/ImageData/index.js.map +1 -1
  22. package/Canvas2D/Path2D/index.js.map +1 -1
  23. package/Dom/Dom.js +8 -1
  24. package/Dom/Dom.js.map +1 -1
  25. package/Dom/Group.d.ts +1 -2
  26. package/Dom/Group.js.map +1 -1
  27. package/Dom/Image.d.ts +4 -1
  28. package/Dom/Image.js +15 -2
  29. package/Dom/Image.js.map +1 -1
  30. package/Dom/Paint.d.ts +1 -1
  31. package/Dom/Paint.js.map +1 -1
  32. package/Dom/Text.js.map +1 -1
  33. package/Dom/shaders/LinearGradient.js.map +1 -1
  34. package/Dom/shaders/TwoPointConicalGradient.js.map +1 -1
  35. package/Dom/shapes/Atlas.js.map +1 -1
  36. package/Dom/shapes/Circle.js.map +1 -1
  37. package/Dom/shapes/Line.js.map +1 -1
  38. package/Dom/shapes/Oval.js.map +1 -1
  39. package/Dom/shapes/Path.d.ts +1 -1
  40. package/Dom/shapes/Path.js.map +1 -1
  41. package/Dom/shapes/Rect.js.map +1 -1
  42. package/Dom/shapes/RoundedRect.js.map +1 -1
  43. package/Dom/shapes/index.js.map +1 -1
  44. package/Fonts/FontFace.android.d.ts +46 -0
  45. package/Fonts/FontFace.android.js +197 -0
  46. package/Fonts/FontFace.android.js.map +1 -0
  47. package/Fonts/FontFace.ios.d.ts +45 -0
  48. package/Fonts/FontFace.ios.js +169 -0
  49. package/Fonts/FontFace.ios.js.map +1 -0
  50. package/Fonts/FontFaceSet.android.d.ts +31 -0
  51. package/Fonts/FontFaceSet.android.js +119 -0
  52. package/Fonts/FontFaceSet.android.js.map +1 -0
  53. package/Fonts/FontFaceSet.ios.d.ts +31 -0
  54. package/Fonts/FontFaceSet.ios.js +109 -0
  55. package/Fonts/FontFaceSet.ios.js.map +1 -0
  56. package/Fonts/index.d.ts +2 -0
  57. package/Fonts/index.js +3 -0
  58. package/Fonts/index.js.map +1 -0
  59. package/ImageAsset/index.d.ts +8 -3
  60. package/ImageAsset/index.js +206 -11
  61. package/ImageAsset/index.js.map +1 -1
  62. package/ImageBitmap/index.js +110 -23
  63. package/ImageBitmap/index.js.map +1 -1
  64. package/README.md +62 -3
  65. package/TextDecoder/index.js +3 -3
  66. package/TextDecoder/index.js.map +1 -1
  67. package/TextEncoder/index.js +3 -3
  68. package/TextEncoder/index.js.map +1 -1
  69. package/WebGL/WebGLExtensions/index.js +5 -5
  70. package/WebGL/WebGLExtensions/index.js.map +1 -1
  71. package/WebGL/WebGLRenderingContext/common.d.ts +1 -1
  72. package/WebGL/WebGLRenderingContext/common.js.map +1 -1
  73. package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
  74. package/WebGL/WebGLRenderingContext/index.js +144 -46
  75. package/WebGL/WebGLRenderingContext/index.js.map +1 -1
  76. package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
  77. package/WebGL2/WebGL2RenderingContext/index.js +7 -8
  78. package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
  79. package/WebGPU/Constants.d.ts +36 -0
  80. package/WebGPU/Constants.js +42 -0
  81. package/WebGPU/Constants.js.map +1 -0
  82. package/WebGPU/Errors.d.ts +18 -0
  83. package/WebGPU/Errors.js +21 -0
  84. package/WebGPU/Errors.js.map +1 -0
  85. package/WebGPU/GPU.d.ts +13 -0
  86. package/WebGPU/GPU.js +36 -0
  87. package/WebGPU/GPU.js.map +1 -0
  88. package/WebGPU/GPUAdapter.d.ts +26 -0
  89. package/WebGPU/GPUAdapter.js +93 -0
  90. package/WebGPU/GPUAdapter.js.map +1 -0
  91. package/WebGPU/GPUAdapterInfo.d.ts +9 -0
  92. package/WebGPU/GPUAdapterInfo.js +24 -0
  93. package/WebGPU/GPUAdapterInfo.js.map +1 -0
  94. package/WebGPU/GPUBindGroup.d.ts +6 -0
  95. package/WebGPU/GPUBindGroup.js +15 -0
  96. package/WebGPU/GPUBindGroup.js.map +1 -0
  97. package/WebGPU/GPUBindGroupLayout.d.ts +6 -0
  98. package/WebGPU/GPUBindGroupLayout.js +15 -0
  99. package/WebGPU/GPUBindGroupLayout.js.map +1 -0
  100. package/WebGPU/GPUBuffer.d.ts +15 -0
  101. package/WebGPU/GPUBuffer.js +66 -0
  102. package/WebGPU/GPUBuffer.js.map +1 -0
  103. package/WebGPU/GPUCanvasContext.d.ts +42 -0
  104. package/WebGPU/GPUCanvasContext.js +149 -0
  105. package/WebGPU/GPUCanvasContext.js.map +1 -0
  106. package/WebGPU/GPUCommandBuffer.d.ts +6 -0
  107. package/WebGPU/GPUCommandBuffer.js +15 -0
  108. package/WebGPU/GPUCommandBuffer.js.map +1 -0
  109. package/WebGPU/GPUCommandEncoder.d.ts +35 -0
  110. package/WebGPU/GPUCommandEncoder.js +163 -0
  111. package/WebGPU/GPUCommandEncoder.js.map +1 -0
  112. package/WebGPU/GPUComputePassEncoder.d.ts +17 -0
  113. package/WebGPU/GPUComputePassEncoder.js +53 -0
  114. package/WebGPU/GPUComputePassEncoder.js.map +1 -0
  115. package/WebGPU/GPUComputePipeline.d.ts +8 -0
  116. package/WebGPU/GPUComputePipeline.js +19 -0
  117. package/WebGPU/GPUComputePipeline.js.map +1 -0
  118. package/WebGPU/GPUDevice.d.ts +111 -0
  119. package/WebGPU/GPUDevice.js +341 -0
  120. package/WebGPU/GPUDevice.js.map +1 -0
  121. package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
  122. package/WebGPU/GPUDeviceLostInfo.js +10 -0
  123. package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
  124. package/WebGPU/GPUExternalTexture.d.ts +6 -0
  125. package/WebGPU/GPUExternalTexture.js +15 -0
  126. package/WebGPU/GPUExternalTexture.js.map +1 -0
  127. package/WebGPU/GPUPipelineLayout.d.ts +6 -0
  128. package/WebGPU/GPUPipelineLayout.js +15 -0
  129. package/WebGPU/GPUPipelineLayout.js.map +1 -0
  130. package/WebGPU/GPUQuerySet.d.ts +6 -0
  131. package/WebGPU/GPUQuerySet.js +15 -0
  132. package/WebGPU/GPUQuerySet.js.map +1 -0
  133. package/WebGPU/GPUQueue.d.ts +15 -0
  134. package/WebGPU/GPUQueue.js +128 -0
  135. package/WebGPU/GPUQueue.js.map +1 -0
  136. package/WebGPU/GPURenderBundle.d.ts +6 -0
  137. package/WebGPU/GPURenderBundle.js +15 -0
  138. package/WebGPU/GPURenderBundle.js.map +1 -0
  139. package/WebGPU/GPURenderBundleEncoder.d.ts +22 -0
  140. package/WebGPU/GPURenderBundleEncoder.js +65 -0
  141. package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
  142. package/WebGPU/GPURenderPassEncoder.d.ts +33 -0
  143. package/WebGPU/GPURenderPassEncoder.js +106 -0
  144. package/WebGPU/GPURenderPassEncoder.js.map +1 -0
  145. package/WebGPU/GPURenderPipeline.d.ts +8 -0
  146. package/WebGPU/GPURenderPipeline.js +19 -0
  147. package/WebGPU/GPURenderPipeline.js.map +1 -0
  148. package/WebGPU/GPUSampler.d.ts +6 -0
  149. package/WebGPU/GPUSampler.js +15 -0
  150. package/WebGPU/GPUSampler.js.map +1 -0
  151. package/WebGPU/GPUShaderModule.d.ts +6 -0
  152. package/WebGPU/GPUShaderModule.js +15 -0
  153. package/WebGPU/GPUShaderModule.js.map +1 -0
  154. package/WebGPU/GPUTexture.d.ts +18 -0
  155. package/WebGPU/GPUTexture.js +47 -0
  156. package/WebGPU/GPUTexture.js.map +1 -0
  157. package/WebGPU/GPUTextureView.d.ts +6 -0
  158. package/WebGPU/GPUTextureView.js +15 -0
  159. package/WebGPU/GPUTextureView.js.map +1 -0
  160. package/WebGPU/Interfaces.d.ts +246 -0
  161. package/WebGPU/Interfaces.js +2 -0
  162. package/WebGPU/Interfaces.js.map +1 -0
  163. package/WebGPU/Types.d.ts +47 -0
  164. package/WebGPU/Types.js +2 -0
  165. package/WebGPU/Types.js.map +1 -0
  166. package/WebGPU/Utils.d.ts +7 -0
  167. package/WebGPU/Utils.js +301 -0
  168. package/WebGPU/Utils.js.map +1 -0
  169. package/WebGPU/index.d.ts +28 -0
  170. package/WebGPU/index.js +29 -0
  171. package/WebGPU/index.js.map +1 -0
  172. package/angular/{esm2020 → esm2022}/index.mjs +5 -5
  173. package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
  174. package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
  175. package/angular/package.json +4 -10
  176. package/common.d.ts +0 -3
  177. package/common.js +1 -5
  178. package/common.js.map +1 -1
  179. package/helpers.js.map +1 -1
  180. package/index.d.ts +4 -2
  181. package/index.js +37 -3
  182. package/index.js.map +1 -1
  183. package/package.json +2 -5
  184. package/platforms/android/canvas-release.aar +0 -0
  185. package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
  186. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
  187. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +194 -56
  188. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -0
  189. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
  190. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +152 -151
  191. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2901 -411
  192. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
  193. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  194. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +10901 -8099
  195. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +259 -52
  196. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  197. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +259 -52
  198. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Black.ttf +0 -0
  199. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Bold.ttf +0 -0
  200. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraBold.ttf +0 -0
  201. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraLight.ttf +0 -0
  202. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Light.ttf +0 -0
  203. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Medium.ttf +0 -0
  204. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Regular.ttf +0 -0
  205. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-SemiBold.ttf +0 -0
  206. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoMath-Regular.ttf +0 -0
  207. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Bold.ttf +0 -0
  208. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-BoldItalic.ttf +0 -0
  209. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Italic.ttf +0 -0
  210. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Medium.ttf +0 -0
  211. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-MediumItalic.ttf +0 -0
  212. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Regular.ttf +0 -0
  213. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBold.ttf +0 -0
  214. package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBoldItalic.ttf +0 -0
  215. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  216. package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +994 -663
  217. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
  218. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +388 -112
  219. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -0
  220. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
  221. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +152 -151
  222. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2901 -411
  223. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
  224. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  225. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  226. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +10901 -8099
  227. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +259 -52
  228. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  229. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +259 -52
  230. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +10901 -8099
  231. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +259 -52
  232. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  233. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +259 -52
  234. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +143 -33
  235. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Black.ttf +0 -0
  236. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Bold.ttf +0 -0
  237. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraBold.ttf +0 -0
  238. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraLight.ttf +0 -0
  239. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Light.ttf +0 -0
  240. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Medium.ttf +0 -0
  241. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Regular.ttf +0 -0
  242. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-SemiBold.ttf +0 -0
  243. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoMath-Regular.ttf +0 -0
  244. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Bold.ttf +0 -0
  245. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-BoldItalic.ttf +0 -0
  246. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Italic.ttf +0 -0
  247. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Medium.ttf +0 -0
  248. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-MediumItalic.ttf +0 -0
  249. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Regular.ttf +0 -0
  250. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBold.ttf +0 -0
  251. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBoldItalic.ttf +0 -0
  252. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
  253. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +993 -662
  254. package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +1037 -641
  255. package/platforms/ios/build.xcconfig +3 -1
  256. package/platforms/ios/src/NSOperationQueueWrapper.h +3 -1
  257. package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
  258. package/platforms/ios/src/cpp/AsyncCallback.h +214 -0
  259. package/platforms/ios/src/cpp/Caches.h +69 -1
  260. package/platforms/ios/src/cpp/CanvasJSIModule.cpp +647 -1166
  261. package/platforms/ios/src/cpp/CanvasJSIModule.h +11 -1
  262. package/platforms/ios/src/cpp/Helpers.h +2 -129
  263. package/platforms/ios/src/cpp/ImageAssetImpl.cpp +600 -437
  264. package/platforms/ios/src/cpp/ImageAssetImpl.h +18 -10
  265. package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +63 -6
  266. package/platforms/ios/src/cpp/ImageBitmapImpl.h +12 -4
  267. package/platforms/ios/src/cpp/JSIReadFileCallback.h +4 -4
  268. package/platforms/ios/src/cpp/NativeType.h +87 -0
  269. package/platforms/ios/src/cpp/ObjectWrapperImpl.h +50 -0
  270. package/platforms/ios/src/cpp/OneByteStringResource.cpp +2 -2
  271. package/platforms/ios/src/cpp/PromiseCallback.h +197 -0
  272. package/platforms/ios/src/cpp/RafImpl.h +2 -2
  273. package/platforms/ios/src/cpp/TextDecoderImpl.cpp +0 -6
  274. package/platforms/ios/src/cpp/TextDecoderImpl.h +3 -3
  275. package/platforms/ios/src/cpp/TextEncoderImpl.cpp +1 -1
  276. package/platforms/ios/src/cpp/TextEncoderImpl.h +3 -3
  277. package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +8 -7
  278. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +1 -11
  279. package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
  280. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +193 -90
  281. package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +77 -23
  282. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +5 -6
  283. package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +4 -4
  284. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
  285. package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +29 -2
  286. package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
  287. package/platforms/ios/src/cpp/canvas2d/Path2D.h +7 -7
  288. package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +3 -3
  289. package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
  290. package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
  291. package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
  292. package/platforms/ios/src/cpp/webgl/WebGLProgram.h +3 -3
  293. package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +3 -3
  294. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +247 -160
  295. package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
  296. package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +6 -6
  297. package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
  298. package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +5 -5
  299. package/platforms/ios/src/cpp/webgl/WebGLTexture.h +3 -2
  300. package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +2 -2
  301. package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
  302. package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
  303. package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
  304. package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
  305. package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
  306. package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
  307. package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
  308. package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +2 -2
  309. package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +5 -5
  310. package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
  311. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
  312. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
  313. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
  314. package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
  315. package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
  316. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
  317. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
  318. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
  319. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +2 -2
  320. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
  321. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
  322. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
  323. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
  324. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
  325. package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
  326. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1067 -960
  327. package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
  328. package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
  329. package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
  330. package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
  331. package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
  332. package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +2 -2
  333. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +371 -0
  334. package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
  335. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
  336. package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
  337. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +79 -0
  338. package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +48 -0
  339. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +79 -0
  340. package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +48 -0
  341. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +277 -0
  342. package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +63 -0
  343. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +379 -0
  344. package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +57 -0
  345. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +81 -0
  346. package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +48 -0
  347. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1217 -0
  348. package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +73 -0
  349. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +293 -0
  350. package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +65 -0
  351. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +109 -0
  352. package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +51 -0
  353. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +3701 -0
  354. package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +97 -0
  355. package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +200 -0
  356. package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
  357. package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
  358. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +80 -0
  359. package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +49 -0
  360. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +136 -0
  361. package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
  362. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +605 -0
  363. package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +59 -0
  364. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +501 -0
  365. package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +74 -0
  366. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +78 -0
  367. package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +48 -0
  368. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +723 -0
  369. package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +92 -0
  370. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +109 -0
  371. package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +52 -0
  372. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +79 -0
  373. package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +48 -0
  374. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +80 -0
  375. package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +48 -0
  376. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
  377. package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
  378. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +386 -0
  379. package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +77 -0
  380. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +79 -0
  381. package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +48 -0
  382. package/platforms/ios/src/cpp/webgpu/GPUUtils.h +756 -0
  383. package/react/index.d.ts +1 -1
  384. package/utils.d.ts +1 -1
  385. package/utils.js.map +1 -1
  386. package/SVG/Circle.d.ts +0 -11
  387. package/SVG/Circle.js +0 -21
  388. package/SVG/Circle.js.map +0 -1
  389. package/SVG/ClipPath.d.ts +0 -4
  390. package/SVG/ClipPath.js +0 -9
  391. package/SVG/ClipPath.js.map +0 -1
  392. package/SVG/Defs.d.ts +0 -4
  393. package/SVG/Defs.js +0 -9
  394. package/SVG/Defs.js.map +0 -1
  395. package/SVG/Ellipse.d.ts +0 -13
  396. package/SVG/Ellipse.js +0 -26
  397. package/SVG/Ellipse.js.map +0 -1
  398. package/SVG/G.d.ts +0 -7
  399. package/SVG/G.js +0 -9
  400. package/SVG/G.js.map +0 -1
  401. package/SVG/Image.d.ts +0 -11
  402. package/SVG/Image.js +0 -40
  403. package/SVG/Image.js.map +0 -1
  404. package/SVG/Line.d.ts +0 -13
  405. package/SVG/Line.js +0 -26
  406. package/SVG/Line.js.map +0 -1
  407. package/SVG/LinearGradient.d.ts +0 -10
  408. package/SVG/LinearGradient.js +0 -13
  409. package/SVG/LinearGradient.js.map +0 -1
  410. package/SVG/Path.d.ts +0 -7
  411. package/SVG/Path.js +0 -14
  412. package/SVG/Path.js.map +0 -1
  413. package/SVG/Pattern.d.ts +0 -4
  414. package/SVG/Pattern.js +0 -9
  415. package/SVG/Pattern.js.map +0 -1
  416. package/SVG/Polygon.d.ts +0 -7
  417. package/SVG/Polygon.js +0 -14
  418. package/SVG/Polygon.js.map +0 -1
  419. package/SVG/Polyline.d.ts +0 -7
  420. package/SVG/Polyline.js +0 -14
  421. package/SVG/Polyline.js.map +0 -1
  422. package/SVG/Rect.d.ts +0 -8
  423. package/SVG/Rect.js +0 -13
  424. package/SVG/Rect.js.map +0 -1
  425. package/SVG/SVG.d.ts +0 -32
  426. package/SVG/SVG.js +0 -204
  427. package/SVG/SVG.js.map +0 -1
  428. package/SVG/SVGItem.d.ts +0 -5
  429. package/SVG/SVGItem.js +0 -8
  430. package/SVG/SVGItem.js.map +0 -1
  431. package/SVG/Stop.d.ts +0 -5
  432. package/SVG/Stop.js +0 -9
  433. package/SVG/Stop.js.map +0 -1
  434. package/SVG/Symbol.d.ts +0 -4
  435. package/SVG/Symbol.js +0 -9
  436. package/SVG/Symbol.js.map +0 -1
  437. package/SVG/Text.d.ts +0 -14
  438. package/SVG/Text.js +0 -26
  439. package/SVG/Text.js.map +0 -1
  440. package/SVG/Use.d.ts +0 -4
  441. package/SVG/Use.js +0 -9
  442. package/SVG/Use.js.map +0 -1
  443. package/SVG/index.d.ts +0 -18
  444. package/SVG/index.js +0 -19
  445. package/SVG/index.js.map +0 -1
  446. package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
  447. package/angular/fesm2020/nativescript-canvas-angular.mjs.map +0 -1
  448. package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
  449. package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
  450. package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
  451. package/platforms/ios/src/cpp/URLImpl.h +0 -121
  452. package/typings/objc!CanvasNative.d.ts +0 -2038
  453. package/typings/objc!CanvasNative.js +0 -1
  454. package/typings/objc!CanvasNative.js.map +0 -1
  455. /package/angular/{esm2020 → esm2022}/nativescript-canvas-angular.mjs +0 -0
package/Canvas/common.js CHANGED
@@ -7,31 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { CSSType, PercentLength, View, Utils, Property, booleanConverter } from '@nativescript/core';
11
- const defaultGLOptions = {
12
- alpha: true,
13
- antialias: true,
14
- depth: true,
15
- failIfMajorPerformanceCaveat: false,
16
- powerPreference: 'default',
17
- premultipliedAlpha: true,
18
- preserveDrawingBuffer: false,
19
- stencil: false,
20
- desynchronized: false,
21
- xrCompatible: false,
22
- };
23
- const default2DOptions = {
24
- alpha: true,
25
- antialias: true,
26
- depth: true,
27
- failIfMajorPerformanceCaveat: false,
28
- powerPreference: 'default',
29
- premultipliedAlpha: true,
30
- preserveDrawingBuffer: false,
31
- stencil: false,
32
- desynchronized: false,
33
- xrCompatible: false,
34
- };
10
+ import { CSSType, View, Property, booleanConverter } from '@nativescript/core';
11
+ import { removeItemFromArray } from './utils';
35
12
  export class DOMRectReadOnly {
36
13
  constructor(x, y, width, height, top, right, bottom, left) {
37
14
  this.x = x;
@@ -59,6 +36,7 @@ export class Event {
59
36
  this.cancelable = options?.cancelable ?? false;
60
37
  this.cancelable = options?.cancelable ?? false;
61
38
  this.composed = options?.composed ?? false;
39
+ this.target = options?.target ?? null;
62
40
  }
63
41
  preventDefault() { }
64
42
  stopPropagation() { }
@@ -128,22 +106,20 @@ export class Touch {
128
106
  preventDefault() { }
129
107
  stopPropagation() { }
130
108
  }
131
- export class TouchList {
109
+ export class TouchList extends Array {
132
110
  static fromList(list) {
133
111
  const ret = new TouchList();
134
- ret._list = list;
112
+ ret.splice(0, 0, ...list);
135
113
  return ret;
136
114
  }
137
115
  static empty() {
138
- const ret = new TouchList();
139
- ret._list = [];
140
- return ret;
116
+ return new TouchList();
141
117
  }
142
118
  item(index) {
143
- return this._list[index];
119
+ return this[index];
144
120
  }
145
121
  get length() {
146
- return this._list.length;
122
+ return this.length;
147
123
  }
148
124
  }
149
125
  export class TouchEvent extends UIEvent {
@@ -178,16 +154,6 @@ class Rectangle {
178
154
  this.height = height;
179
155
  }
180
156
  }
181
- export const ignorePixelScalingProperty = new Property({
182
- name: 'ignorePixelScaling',
183
- defaultValue: false,
184
- valueConverter: booleanConverter,
185
- });
186
- export const upscaleProperty = new Property({
187
- name: 'upscale',
188
- defaultValue: false,
189
- valueConverter: booleanConverter,
190
- });
191
157
  export const ignoreTouchEventsProperty = new Property({
192
158
  name: 'ignoreTouchEvents',
193
159
  defaultValue: false,
@@ -206,6 +172,8 @@ let CanvasBase = class CanvasBase extends View {
206
172
  this._isCustom = false;
207
173
  this._pointerMoveCallbacks = [];
208
174
  this._pointerUpCallbacks = [];
175
+ this._pointerOutCallbacks = [];
176
+ this._pointerLeaveCallbacks = [];
209
177
  this._pointerDownCallbacks = [];
210
178
  this._pointerCancelCallbacks = [];
211
179
  // For mouse compat because wtf
@@ -220,19 +188,34 @@ let CanvasBase = class CanvasBase extends View {
220
188
  this._touchCancelCallbacks = new Array();
221
189
  this._touches = [];
222
190
  this._touchesById = [];
223
- this._lastPointerEventById = new Array();
191
+ this._lastPointerEventById = [];
192
+ this.__target = null;
224
193
  this._classList = new Set();
194
+ this.style.width = { unit: '%', value: 1 };
195
+ this.style.height = 'auto';
196
+ }
197
+ get isConnected() {
198
+ return this.parent !== null && this.parent !== undefined;
225
199
  }
226
200
  get ownerDocument() {
227
- return window?.document ?? doc;
201
+ //return window?.document ?? doc;
202
+ return this;
203
+ }
204
+ emit() { }
205
+ dispatchEvent(event) {
206
+ return true;
228
207
  }
229
208
  addEventListener(arg, callback, thisArg) {
209
+ if (typeof thisArg === 'boolean') {
210
+ thisArg = {
211
+ capture: thisArg,
212
+ };
213
+ }
230
214
  super.addEventListener(arg, callback, thisArg);
231
215
  if (typeof arg !== 'string') {
232
216
  return;
233
217
  }
234
- const eventtype = arg.toLowerCase();
235
- switch (eventtype) {
218
+ switch (arg) {
236
219
  case 'mousemove':
237
220
  this._mouseMoveCallbacks.push(callback);
238
221
  break;
@@ -251,7 +234,13 @@ let CanvasBase = class CanvasBase extends View {
251
234
  case 'pointerup':
252
235
  this._pointerUpCallbacks.push(callback);
253
236
  break;
254
- case 'moveout':
237
+ case 'pointerout':
238
+ this._pointerOutCallbacks.push(callback);
239
+ break;
240
+ case 'pointerleave':
241
+ this._pointerLeaveCallbacks.push(callback);
242
+ break;
243
+ case 'mouseout':
255
244
  case 'mousecancel':
256
245
  this._mouseCancelCallbacks.push(callback);
257
246
  break;
@@ -277,57 +266,61 @@ let CanvasBase = class CanvasBase extends View {
277
266
  break;
278
267
  }
279
268
  }
280
- _removeItemFromArray(array, item) {
281
- const index = array.indexOf(item);
282
- if (index !== -1) {
283
- array.splice(index, 1);
284
- }
285
- }
286
269
  removeEventListener(arg, callback, thisArg) {
270
+ if (typeof thisArg === 'boolean') {
271
+ thisArg = {
272
+ capture: thisArg,
273
+ };
274
+ }
287
275
  super.removeEventListener(arg, callback, thisArg);
288
- const eventtype = arg.toLowerCase();
289
- switch (eventtype) {
276
+ switch (arg) {
290
277
  case 'mousemove':
291
- this._removeItemFromArray(this._mouseMoveCallbacks, callback);
278
+ removeItemFromArray(this._mouseMoveCallbacks, callback);
292
279
  break;
293
280
  case 'pointermove':
294
- this._removeItemFromArray(this._pointerMoveCallbacks, callback);
281
+ removeItemFromArray(this._pointerMoveCallbacks, callback);
295
282
  break;
296
283
  case 'mousedown':
297
- this._removeItemFromArray(this._mouseDownCallbacks, callback);
284
+ removeItemFromArray(this._mouseDownCallbacks, callback);
298
285
  break;
299
286
  case 'pointerdown':
300
- this._removeItemFromArray(this._pointerDownCallbacks, callback);
287
+ removeItemFromArray(this._pointerDownCallbacks, callback);
301
288
  break;
302
289
  case 'mouseup':
303
- this._removeItemFromArray(this._mouseUpCallbacks, callback);
290
+ removeItemFromArray(this._mouseUpCallbacks, callback);
304
291
  break;
305
292
  case 'pointerup':
306
- this._removeItemFromArray(this._pointerUpCallbacks, callback);
293
+ removeItemFromArray(this._pointerUpCallbacks, callback);
294
+ break;
295
+ case 'pointerout':
296
+ removeItemFromArray(this._pointerOutCallbacks, callback);
297
+ break;
298
+ case 'pointerleave':
299
+ removeItemFromArray(this._pointerLeaveCallbacks, callback);
307
300
  break;
308
- case 'moveout':
301
+ case 'mouseout':
309
302
  case 'mousecancel':
310
- this._removeItemFromArray(this._mouseCancelCallbacks, callback);
303
+ removeItemFromArray(this._mouseCancelCallbacks, callback);
311
304
  break;
312
305
  case 'pointercancel':
313
- this._removeItemFromArray(this._pointerCancelCallbacks, callback);
306
+ removeItemFromArray(this._pointerCancelCallbacks, callback);
314
307
  break;
315
308
  case 'touchstart':
316
- this._removeItemFromArray(this._touchStartCallbacks, callback);
309
+ removeItemFromArray(this._touchStartCallbacks, callback);
317
310
  break;
318
311
  case 'touchend':
319
- this._removeItemFromArray(this._touchEndCallbacks, callback);
312
+ removeItemFromArray(this._touchEndCallbacks, callback);
320
313
  break;
321
314
  case 'touchmove':
322
- this._removeItemFromArray(this._touchMoveCallbacks, callback);
315
+ removeItemFromArray(this._touchMoveCallbacks, callback);
323
316
  break;
324
317
  case 'touchcancel':
325
- this._removeItemFromArray(this._touchCancelCallbacks, callback);
318
+ removeItemFromArray(this._touchCancelCallbacks, callback);
326
319
  break;
327
320
  case 'wheel':
328
321
  case 'mousewheel':
329
322
  case 'dommousescroll':
330
- this._removeItemFromArray(this._mouseWheelCallbacks, callback);
323
+ removeItemFromArray(this._mouseWheelCallbacks, callback);
331
324
  break;
332
325
  }
333
326
  }
@@ -361,6 +354,7 @@ let CanvasBase = class CanvasBase extends View {
361
354
  movementY: pointer.y - previousEvent.y,
362
355
  isPrimary: pointer.isPrimary,
363
356
  button: -1,
357
+ target: this.__target ?? this,
364
358
  });
365
359
  for (const callback of this._pointerMoveCallbacks) {
366
360
  callback(event);
@@ -377,10 +371,12 @@ let CanvasBase = class CanvasBase extends View {
377
371
  movementX: pointer.x - previousEvent.x,
378
372
  movementY: pointer.y - previousEvent.y,
379
373
  button: -1,
374
+ target: this.__target ?? this,
380
375
  });
381
- for (const callback of this._mouseMoveCallbacks) {
382
- callback(event);
383
- }
376
+ // todo emit mousemove when desktop is supported
377
+ // for (const callback of this._mouseMoveCallbacks) {
378
+ // callback(event);
379
+ // }
384
380
  }
385
381
  if (index > -1) {
386
382
  this._lastPointerEventById[index] = { pointerId, x: pointer.x, y: pointer.y };
@@ -388,11 +384,11 @@ let CanvasBase = class CanvasBase extends View {
388
384
  }
389
385
  }
390
386
  if (this._touchMoveCallbacks.length > 0) {
391
- const changedTouches = [];
387
+ const changedTouches = TouchList.empty();
392
388
  for (const pointer of pointers) {
393
389
  changedTouches.push(new Touch({
394
390
  identifier: pointer.ptrId,
395
- target: null,
391
+ target: this.__target ?? this,
396
392
  clientX: pointer.x,
397
393
  clientY: pointer.y,
398
394
  screenX: pointer.x,
@@ -406,19 +402,32 @@ let CanvasBase = class CanvasBase extends View {
406
402
  touches,
407
403
  targetTouches: touches,
408
404
  changedTouches,
405
+ target: this.__target ?? this,
409
406
  });
410
407
  for (const callback of this._touchMoveCallbacks) {
411
408
  callback(event);
412
409
  }
413
410
  }
414
411
  }
415
- _upCallback(ptrId, x, y, isPrimary) {
416
- const hasPointerCallbacks = this._pointerUpCallbacks.length > 0;
412
+ _upCallback(ptrId, x, y, isPrimary = false) {
413
+ const hasPointerCallbacks = this._pointerUpCallbacks.length > 0 || this._pointerOutCallbacks.length > 0 || this._pointerLeaveCallbacks.length > 0;
417
414
  const hasMouseCallbacks = this._mouseUpCallbacks.length > 0;
418
415
  if (hasPointerCallbacks || hasMouseCallbacks) {
419
416
  const pointerId = ptrId;
420
417
  if (hasPointerCallbacks) {
421
- const event = new PointerEvent('pointerup', {
418
+ const up = new PointerEvent('pointerup', {
419
+ pointerType: 'touch',
420
+ pointerId,
421
+ clientX: x,
422
+ clientY: y,
423
+ screenX: x,
424
+ screenY: y,
425
+ isPrimary,
426
+ pageX: x,
427
+ pageY: y,
428
+ target: this.__target ?? this,
429
+ });
430
+ const out = new PointerEvent('pointerout', {
422
431
  pointerType: 'touch',
423
432
  pointerId,
424
433
  clientX: x,
@@ -428,9 +437,28 @@ let CanvasBase = class CanvasBase extends View {
428
437
  isPrimary,
429
438
  pageX: x,
430
439
  pageY: y,
440
+ target: this.__target ?? this,
441
+ });
442
+ const leave = new PointerEvent('pointerleave', {
443
+ pointerType: 'touch',
444
+ pointerId,
445
+ clientX: x,
446
+ clientY: y,
447
+ screenX: x,
448
+ screenY: y,
449
+ isPrimary,
450
+ pageX: x,
451
+ pageY: y,
452
+ target: this.__target ?? this,
431
453
  });
432
454
  for (const callback of this._pointerUpCallbacks) {
433
- callback(event);
455
+ callback(up);
456
+ }
457
+ for (const callback of this._pointerOutCallbacks) {
458
+ callback(out);
459
+ }
460
+ for (const callback of this._pointerLeaveCallbacks) {
461
+ callback(leave);
434
462
  }
435
463
  }
436
464
  if (hasMouseCallbacks) {
@@ -441,10 +469,12 @@ let CanvasBase = class CanvasBase extends View {
441
469
  screenY: y,
442
470
  pageX: x,
443
471
  pageY: y,
472
+ target: this.__target ?? this,
444
473
  });
445
- for (const callback of this._mouseUpCallbacks) {
446
- callback(event);
447
- }
474
+ // todo emit mouseup when desktop is supported
475
+ // for (const callback of this._mouseUpCallbacks) {
476
+ // callback(event);
477
+ // }
448
478
  }
449
479
  const index = this._lastPointerEventById.findIndex((item) => {
450
480
  return item?.pointerId === pointerId;
@@ -462,10 +492,10 @@ let CanvasBase = class CanvasBase extends View {
462
492
  }
463
493
  if (this._touchEndCallbacks.length > 0) {
464
494
  const touches = TouchList.fromList(this._touches);
465
- const changedTouches = [
495
+ const changedTouches = TouchList.fromList([
466
496
  new Touch({
467
497
  identifier: ptrId,
468
- target: null,
498
+ target: this.__target ?? this,
469
499
  clientX: x,
470
500
  clientY: y,
471
501
  screenX: x,
@@ -473,11 +503,12 @@ let CanvasBase = class CanvasBase extends View {
473
503
  pageX: x,
474
504
  pageY: y,
475
505
  }),
476
- ];
506
+ ]);
477
507
  const event = new TouchEvent('touchend', {
478
508
  touches,
479
509
  targetTouches: touches,
480
510
  changedTouches,
511
+ target: this.__target ?? this,
481
512
  });
482
513
  for (const callback of this._touchEndCallbacks) {
483
514
  callback(event);
@@ -500,6 +531,7 @@ let CanvasBase = class CanvasBase extends View {
500
531
  isPrimary,
501
532
  pageX: x,
502
533
  pageY: y,
534
+ target: this.__target ?? this,
503
535
  });
504
536
  for (const callback of this._pointerDownCallbacks) {
505
537
  callback(event);
@@ -513,17 +545,19 @@ let CanvasBase = class CanvasBase extends View {
513
545
  screenY: y,
514
546
  pageX: x,
515
547
  pageY: y,
548
+ target: this.__target ?? this,
516
549
  });
517
- for (const callback of this._mouseDownCallbacks) {
518
- callback(event);
519
- }
550
+ // todo emit mousedown when desktop is supported
551
+ // for (const callback of this._mouseDownCallbacks) {
552
+ // callback(event);
553
+ // }
520
554
  }
521
555
  this._lastPointerEventById.push({ pointerId, x, y });
522
556
  }
523
557
  if (this._touchStartCallbacks.length > 0) {
524
558
  const touch = new Touch({
525
559
  identifier: ptrId,
526
- target: this,
560
+ target: this.__target ?? this,
527
561
  clientX: x,
528
562
  clientY: y,
529
563
  screenX: x,
@@ -538,17 +572,18 @@ let CanvasBase = class CanvasBase extends View {
538
572
  touches,
539
573
  targetTouches: touches,
540
574
  changedTouches: this._touches,
575
+ target: this.__target ?? this,
541
576
  });
542
577
  for (const callback of this._touchStartCallbacks) {
543
578
  callback(touchEvent);
544
579
  }
545
580
  }
546
581
  }
547
- _cancelCallback(ptrid, x, y, isPrimary = false) {
582
+ _cancelCallback(ptrId, x, y, isPrimary = false) {
548
583
  const hasPointerCallbacks = this._pointerCancelCallbacks.length > 0;
549
584
  const hasMouseCallbacks = this._mouseCancelCallbacks.length > 0;
550
585
  if (hasPointerCallbacks || hasMouseCallbacks) {
551
- const pointerId = ptrid;
586
+ const pointerId = ptrId;
552
587
  if (hasPointerCallbacks) {
553
588
  const event = new PointerEvent('pointercancel', {
554
589
  pointerType: 'touch',
@@ -560,6 +595,7 @@ let CanvasBase = class CanvasBase extends View {
560
595
  pageX: x,
561
596
  pageY: y,
562
597
  isPrimary,
598
+ target: this.__target ?? this,
563
599
  });
564
600
  for (const callback of this._pointerCancelCallbacks) {
565
601
  callback(event);
@@ -573,16 +609,18 @@ let CanvasBase = class CanvasBase extends View {
573
609
  screenY: y,
574
610
  pageX: x,
575
611
  pageY: y,
612
+ target: this.__target ?? this,
576
613
  });
577
- for (const callback of this._mouseCancelCallbacks) {
578
- callback(event);
579
- }
614
+ // todo emit mouseout when desktop is supported
615
+ // for (const callback of this._mouseCancelCallbacks) {
616
+ // callback(event);
617
+ // }
580
618
  }
581
619
  }
582
620
  if (this._touchCancelCallbacks.length > 0) {
583
621
  const touch = new Touch({
584
- identifier: ptrid,
585
- target: this,
622
+ identifier: ptrId,
623
+ target: this.__target ?? this,
586
624
  clientX: x,
587
625
  clientY: y,
588
626
  screenX: x,
@@ -592,12 +630,13 @@ let CanvasBase = class CanvasBase extends View {
592
630
  });
593
631
  const touchesList = [touch];
594
632
  const touchesById = [];
595
- touchesById[ptrid] = touch;
633
+ touchesById[ptrId] = touch;
596
634
  const touches = TouchList.fromList(touchesList);
597
635
  const touchEvent = new TouchEvent('touchcancel', {
598
636
  touches,
599
637
  targetTouches: touches,
600
638
  changedTouches: touchesList,
639
+ target: this.__target ?? this,
601
640
  });
602
641
  for (const callback of this._touchCancelCallbacks) {
603
642
  callback(touchEvent);
@@ -635,6 +674,7 @@ let CanvasBase = class CanvasBase extends View {
635
674
  movementX: pointer.x - previousEvent.x,
636
675
  movementY: pointer.y - previousEvent.y,
637
676
  button: -1,
677
+ target: this.__target ?? this,
638
678
  });
639
679
  for (const callback of this._pointerMoveCallbacks) {
640
680
  callback(event);
@@ -651,10 +691,12 @@ let CanvasBase = class CanvasBase extends View {
651
691
  movementX: pointer.x - previousEvent.x,
652
692
  movementY: pointer.y - previousEvent.y,
653
693
  button: -1,
694
+ target: this.__target ?? this,
654
695
  });
655
- for (const callback of this._mouseMoveCallbacks) {
656
- callback(event);
657
- }
696
+ // todo emit mousemove when desktop is supported
697
+ // for (const callback of this._mouseMoveCallbacks) {
698
+ // callback(event);
699
+ // }
658
700
  }
659
701
  if (hasMouseWheel) {
660
702
  const event = new WheelEvent('wheel', {
@@ -662,10 +704,12 @@ let CanvasBase = class CanvasBase extends View {
662
704
  deltaY: data.deltaY,
663
705
  deltaZ: 0,
664
706
  deltaMode: data.deltaMode,
707
+ target: this.__target ?? this,
665
708
  });
666
- for (const callback of this._mouseWheelCallbacks) {
667
- callback(event);
668
- }
709
+ // todo emit wheel when desktop is supported
710
+ // for (const callback of this._mouseWheelCallbacks) {
711
+ // callback(event);
712
+ // }
669
713
  }
670
714
  if (index > -1) {
671
715
  this._lastPointerEventById[index] = { pointerId, x: pointer.x, y: pointer.y };
@@ -677,7 +721,7 @@ let CanvasBase = class CanvasBase extends View {
677
721
  for (const pointer of data.pointers) {
678
722
  changedTouches.push(new Touch({
679
723
  identifier: pointer.ptrId,
680
- target: this,
724
+ target: this.__target ?? this,
681
725
  clientX: pointer.x,
682
726
  clientY: pointer.y,
683
727
  screenX: pointer.x,
@@ -691,6 +735,7 @@ let CanvasBase = class CanvasBase extends View {
691
735
  touches,
692
736
  targetTouches: touches,
693
737
  changedTouches,
738
+ target: this.__target ?? this,
694
739
  });
695
740
  for (const callback of this._touchMoveCallbacks) {
696
741
  callback(event);
@@ -725,50 +770,6 @@ let CanvasBase = class CanvasBase extends View {
725
770
  get classList() {
726
771
  return this._classList;
727
772
  }
728
- get _realSize() {
729
- return {
730
- width: this.getSize(this.style.width, this.getMeasuredWidth(), 'width'),
731
- height: this.getSize(this.style.height, this.getMeasuredHeight(), 'height'),
732
- };
733
- }
734
- _handleContextOptions(type, contextOpts) {
735
- if (!contextOpts) {
736
- if (type === '2d') {
737
- return { ...default2DOptions };
738
- }
739
- if (type.indexOf('webgl') > -1) {
740
- return { ...defaultGLOptions };
741
- }
742
- }
743
- if (type === '2d') {
744
- if (contextOpts.alpha !== undefined && typeof contextOpts.alpha === 'boolean') {
745
- return contextOpts;
746
- }
747
- else {
748
- return { alpha: true };
749
- }
750
- }
751
- const glOptions = { ...defaultGLOptions };
752
- const setIfDefined = (prop, value) => {
753
- const property = glOptions[prop];
754
- if (property !== undefined && typeof value === typeof property) {
755
- glOptions[prop] = value;
756
- }
757
- };
758
- if (type.indexOf('webgl') > -1) {
759
- setIfDefined('alpha', contextOpts.alpha);
760
- setIfDefined('antialias', contextOpts.antialias);
761
- setIfDefined('depth', contextOpts.depth);
762
- setIfDefined('failIfMajorPerformanceCaveat', contextOpts.failIfMajorPerformanceCaveat);
763
- setIfDefined('powerPreference', contextOpts.powerPreference);
764
- setIfDefined('premultipliedAlpha', contextOpts.premultipliedAlpha);
765
- setIfDefined('preserveDrawingBuffer', contextOpts.preserveDrawingBuffer);
766
- setIfDefined('stencil', contextOpts.stencil);
767
- setIfDefined('desynchronized', contextOpts.desynchronized);
768
- return glOptions;
769
- }
770
- return null;
771
- }
772
773
  _readyEvent() {
773
774
  this.notify({
774
775
  eventName: 'ready',
@@ -776,63 +777,10 @@ let CanvasBase = class CanvasBase extends View {
776
777
  });
777
778
  }
778
779
  getAttribute(attrib) {
779
- if (attrib === 'width') {
780
- return this.width;
781
- }
782
- if (attrib === 'height') {
783
- return this.height;
784
- }
785
- if (attrib === 'tabindex') {
786
- return (this['tabindex'] = arguments[1]);
787
- }
788
780
  return this[attrib];
789
781
  }
790
782
  setAttribute(attrib) {
791
- if (attrib === 'width') {
792
- if (!isNaN(parseInt(arguments[1]))) {
793
- this.width = parseInt(arguments[1]);
794
- }
795
- }
796
- if (attrib === 'height') {
797
- if (!isNaN(parseInt(arguments[1]))) {
798
- this.height = parseInt(arguments[1]);
799
- }
800
- }
801
- if (attrib === 'tabindex') {
802
- this['tabindex'] = arguments[1];
803
- }
804
- }
805
- getSize(value, measuredSize, type) {
806
- if (value === 'auto') {
807
- return Utils.layout.toDeviceIndependentPixels(Utils.layout.getMeasureSpecSize(Utils.layout.makeMeasureSpec(measuredSize, Utils.layout.UNSPECIFIED)));
808
- }
809
- if (typeof value === 'string') {
810
- value = PercentLength.parse(value);
811
- }
812
- if (typeof value === 'number') {
813
- if (global.isAndroid) {
814
- return Utils.layout.toDevicePixels(value) || 0;
815
- }
816
- return value || 0;
817
- }
818
- else if ((value !== null || true) && typeof value === 'object' && typeof value.value && typeof value.unit) {
819
- if (value.unit === 'px') {
820
- if (global.isIOS) {
821
- return Utils.layout.toDeviceIndependentPixels(value.value || 0);
822
- }
823
- return value.value || 0;
824
- }
825
- else if (value.unit === 'dip') {
826
- if (global.isAndroid) {
827
- return Utils.layout.toDevicePixels(value.value) || 0;
828
- }
829
- return value.value || 0;
830
- }
831
- else if (value.unit === '%') {
832
- return Utils.layout.toDeviceIndependentPixels(measuredSize * value.value ?? 0);
833
- }
834
- }
835
- return 0;
783
+ this[attrib] = attrib;
836
784
  }
837
785
  setPointerCapture(id) { }
838
786
  releasePointerCapture(id) { }
@@ -843,6 +791,4 @@ CanvasBase = __decorate([
843
791
  __metadata("design:paramtypes", [])
844
792
  ], CanvasBase);
845
793
  export { CanvasBase };
846
- ignorePixelScalingProperty.register(CanvasBase);
847
- upscaleProperty.register(CanvasBase);
848
794
  //# sourceMappingURL=common.js.map