@mateuszjs/magic-render 0.1.0-next.7 → 0.1.0-next.70

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 (242) hide show
  1. package/README.md +29 -0
  2. package/lib/index.mjs +1 -1
  3. package/lib/index.mjs.map +1 -1
  4. package/lib/types/WebGPU/TimingHelper.d.ts +14 -0
  5. package/lib/types/WebGPU/TimingHelper.d.ts.map +1 -0
  6. package/lib/types/WebGPU/canvasSizeObserver.d.ts.map +1 -0
  7. package/lib/types/WebGPU/device.d.ts +5 -0
  8. package/lib/types/WebGPU/device.d.ts.map +1 -0
  9. package/lib/types/WebGPU/generatePreview.d.ts +2 -0
  10. package/lib/types/WebGPU/generatePreview.d.ts.map +1 -0
  11. package/lib/types/WebGPU/getTexture/createCheckedImageData.d.ts.map +1 -0
  12. package/lib/types/WebGPU/getTexture/generateMimapsArray.d.ts.map +1 -0
  13. package/lib/types/WebGPU/getTexture/index.d.ts +14 -0
  14. package/lib/types/WebGPU/getTexture/index.d.ts.map +1 -0
  15. package/lib/types/WebGPU/m3.d.ts.map +1 -0
  16. package/lib/types/{src/WebGPU → WebGPU}/pick.d.ts +1 -2
  17. package/lib/types/WebGPU/pick.d.ts.map +1 -0
  18. package/lib/types/WebGPU/programs/blur/getProgram.d.ts +2 -0
  19. package/lib/types/WebGPU/programs/blur/getProgram.d.ts.map +1 -0
  20. package/lib/types/WebGPU/programs/clearComputeDepth/getProgram.d.ts +2 -0
  21. package/lib/types/WebGPU/programs/clearComputeDepth/getProgram.d.ts.map +1 -0
  22. package/lib/types/WebGPU/programs/clearSdf/getProgram.d.ts +2 -0
  23. package/lib/types/WebGPU/programs/clearSdf/getProgram.d.ts.map +1 -0
  24. package/lib/types/WebGPU/programs/combineSdf/getProgram.d.ts +2 -0
  25. package/lib/types/WebGPU/programs/combineSdf/getProgram.d.ts.map +1 -0
  26. package/lib/types/WebGPU/programs/computeShape/getProgram.d.ts +2 -0
  27. package/lib/types/WebGPU/programs/computeShape/getProgram.d.ts.map +1 -0
  28. package/lib/types/WebGPU/programs/computeShape/workers-deprecated/createWorker.d.ts +4 -0
  29. package/lib/types/WebGPU/programs/computeShape/workers-deprecated/createWorker.d.ts.map +1 -0
  30. package/lib/types/WebGPU/programs/computeShape/workers-deprecated/worker.d.ts +2 -0
  31. package/lib/types/WebGPU/programs/computeShape/workers-deprecated/worker.d.ts.map +1 -0
  32. package/lib/types/WebGPU/programs/drawShape/getProgram.d.ts +2 -0
  33. package/lib/types/WebGPU/programs/drawShape/getProgram.d.ts.map +1 -0
  34. package/lib/types/WebGPU/programs/drawTexture/getProgram.d.ts +2 -0
  35. package/lib/types/WebGPU/programs/drawTexture/getProgram.d.ts.map +1 -0
  36. package/lib/types/WebGPU/programs/drawTriangle/getProgram.d.ts +2 -0
  37. package/lib/types/WebGPU/programs/drawTriangle/getProgram.d.ts.map +1 -0
  38. package/lib/types/WebGPU/programs/initPrograms.d.ts +32 -0
  39. package/lib/types/WebGPU/programs/initPrograms.d.ts.map +1 -0
  40. package/lib/types/WebGPU/programs/pickShape/getProgram.d.ts +2 -0
  41. package/lib/types/WebGPU/programs/pickShape/getProgram.d.ts.map +1 -0
  42. package/lib/types/WebGPU/programs/pickTexture/getProgram.d.ts +2 -0
  43. package/lib/types/WebGPU/programs/pickTexture/getProgram.d.ts.map +1 -0
  44. package/lib/types/WebGPU/programs/pickTriangle/getProgram.d.ts +2 -0
  45. package/lib/types/WebGPU/programs/pickTriangle/getProgram.d.ts.map +1 -0
  46. package/lib/types/WebGPU/textureCache.d.ts +4 -0
  47. package/lib/types/WebGPU/textureCache.d.ts.map +1 -0
  48. package/lib/types/consts.d.ts +2 -0
  49. package/lib/types/consts.d.ts.map +1 -0
  50. package/lib/types/customPrograms.d.ts +16 -0
  51. package/lib/types/customPrograms.d.ts.map +1 -0
  52. package/lib/types/fonts.d.ts +6 -0
  53. package/lib/types/fonts.d.ts.map +1 -0
  54. package/lib/types/getCanvasMatrix.d.ts +2 -0
  55. package/lib/types/getCanvasMatrix.d.ts.map +1 -0
  56. package/lib/types/{src/getCanvasRenderDescriptor.d.ts → getCanvasRenderDescriptor.d.ts} +1 -0
  57. package/lib/types/getCanvasRenderDescriptor.d.ts.map +1 -0
  58. package/lib/types/{src/getDepthTexture.d.ts → getDepthTexture.d.ts} +1 -0
  59. package/lib/types/getDepthTexture.d.ts.map +1 -0
  60. package/lib/types/getMultisampleTexture.d.ts +2 -0
  61. package/lib/types/getMultisampleTexture.d.ts.map +1 -0
  62. package/lib/types/getRenderDescriptor.d.ts.map +1 -0
  63. package/lib/types/index.d.ts +3 -0
  64. package/lib/types/index.d.ts.map +1 -0
  65. package/lib/types/loadingTexture.d.ts +3 -0
  66. package/lib/types/loadingTexture.d.ts.map +1 -0
  67. package/lib/types/pointer.d.ts +17 -0
  68. package/lib/types/pointer.d.ts.map +1 -0
  69. package/lib/types/run.d.ts +6 -0
  70. package/lib/types/run.d.ts.map +1 -0
  71. package/lib/types/snapshots/convert.d.ts +8 -0
  72. package/lib/types/snapshots/convert.d.ts.map +1 -0
  73. package/lib/types/snapshots/fill.d.ts +4 -0
  74. package/lib/types/snapshots/fill.d.ts.map +1 -0
  75. package/lib/types/snapshots/snapshots.d.ts +6 -0
  76. package/lib/types/snapshots/snapshots.d.ts.map +1 -0
  77. package/lib/types/snapshots/toZigAsset.d.ts +3 -0
  78. package/lib/types/snapshots/toZigAsset.d.ts.map +1 -0
  79. package/lib/types/svgToShapes/addUiElement.d.ts +3 -0
  80. package/lib/types/svgToShapes/addUiElement.d.ts.map +1 -0
  81. package/lib/types/svgToShapes/arcToBezier.d.ts +11 -0
  82. package/lib/types/svgToShapes/arcToBezier.d.ts.map +1 -0
  83. package/lib/types/svgToShapes/boundingBox.d.ts +18 -0
  84. package/lib/types/svgToShapes/boundingBox.d.ts.map +1 -0
  85. package/lib/types/svgToShapes/collectShapesData.d.ts +12 -0
  86. package/lib/types/svgToShapes/collectShapesData.d.ts.map +1 -0
  87. package/lib/types/svgToShapes/const.d.ts +5 -0
  88. package/lib/types/svgToShapes/const.d.ts.map +1 -0
  89. package/lib/types/svgToShapes/definitions.d.ts +44 -0
  90. package/lib/types/svgToShapes/definitions.d.ts.map +1 -0
  91. package/lib/types/svgToShapes/getProps.d.ts +4 -0
  92. package/lib/types/svgToShapes/getProps.d.ts.map +1 -0
  93. package/lib/types/svgToShapes/getShapesAssets.d.ts +5 -0
  94. package/lib/types/svgToShapes/getShapesAssets.d.ts.map +1 -0
  95. package/lib/types/svgToShapes/parseEllipse.d.ts +3 -0
  96. package/lib/types/svgToShapes/parseEllipse.d.ts.map +1 -0
  97. package/lib/types/svgToShapes/parsePathData.d.ts +3 -0
  98. package/lib/types/svgToShapes/parsePathData.d.ts.map +1 -0
  99. package/lib/types/svgToShapes/parseRect.d.ts +3 -0
  100. package/lib/types/svgToShapes/parseRect.d.ts.map +1 -0
  101. package/lib/types/svgToShapes/radialGradient.d.ts +16 -0
  102. package/lib/types/svgToShapes/radialGradient.d.ts.map +1 -0
  103. package/lib/types/svgToShapes/utils.d.ts +10 -0
  104. package/lib/types/svgToShapes/utils.d.ts.map +1 -0
  105. package/lib/types/textures.d.ts +29 -0
  106. package/lib/types/textures.d.ts.map +1 -0
  107. package/lib/types/types.d.ts +181 -0
  108. package/lib/types/types.d.ts.map +1 -0
  109. package/lib/types/typing.d.ts +7 -0
  110. package/lib/types/typing.d.ts.map +1 -0
  111. package/lib/types/utils/assertUnreachable.d.ts +2 -0
  112. package/lib/types/utils/assertUnreachable.d.ts.map +1 -0
  113. package/lib/types/utils/atNormIndex.d.ts.map +1 -0
  114. package/lib/types/utils/captureCanvasStream.d.ts.map +1 -0
  115. package/lib/types/utils/captureCanvasStreamWasm.d.ts.map +1 -0
  116. package/lib/types/utils/clamp.d.ts.map +1 -0
  117. package/lib/types/utils/debounce.d.ts +2 -0
  118. package/lib/types/utils/debounce.d.ts.map +1 -0
  119. package/lib/types/utils/decompressWoff2.d.mts +3 -0
  120. package/lib/types/utils/decompressWoff2.d.mts.map +1 -0
  121. package/lib/types/{src/utils → utils}/distancePointToLine.d.ts +1 -0
  122. package/lib/types/utils/distancePointToLine.d.ts.map +1 -0
  123. package/lib/types/utils/downloadCanvas.d.ts +2 -0
  124. package/lib/types/utils/downloadCanvas.d.ts.map +1 -0
  125. package/lib/types/utils/fitCurve.d.ts.map +1 -0
  126. package/lib/types/utils/getAngle.d.ts +3 -0
  127. package/lib/types/utils/getAngle.d.ts.map +1 -0
  128. package/lib/types/utils/getAngleDiff.d.ts.map +1 -0
  129. package/lib/types/{src/utils → utils}/getBezierPos.d.ts +1 -0
  130. package/lib/types/utils/getBezierPos.d.ts.map +1 -0
  131. package/lib/types/{src/utils → utils}/getBezierTan.d.ts +1 -0
  132. package/lib/types/utils/getBezierTan.d.ts.map +1 -0
  133. package/lib/types/{src/utils → utils}/getCurveLength.d.ts +1 -0
  134. package/lib/types/utils/getCurveLength.d.ts.map +1 -0
  135. package/lib/types/utils/getDefaultPoints.d.ts +3 -0
  136. package/lib/types/utils/getDefaultPoints.d.ts.map +1 -0
  137. package/lib/types/utils/getDistance.d.ts +3 -0
  138. package/lib/types/utils/getDistance.d.ts.map +1 -0
  139. package/lib/types/utils/mat4.d.ts.map +1 -0
  140. package/lib/types/utils/normalizeVec2.d.ts +3 -0
  141. package/lib/types/utils/normalizeVec2.d.ts.map +1 -0
  142. package/lib/types/utils/resizeArray.d.ts.map +1 -0
  143. package/lib/types/utils/setCamera.d.ts +2 -0
  144. package/lib/types/utils/setCamera.d.ts.map +1 -0
  145. package/lib/types/utils/throttle.d.ts +2 -0
  146. package/lib/types/utils/throttle.d.ts.map +1 -0
  147. package/lib/types/utils/vec3.d.ts.map +1 -0
  148. package/lib/types.mjs +2 -0
  149. package/lib/types.mjs.map +1 -0
  150. package/package.json +34 -15
  151. package/lib/e9072ac5eb734c67.png +0 -0
  152. package/lib/types/src/WebGPU/canvasSizeObserver.d.ts.map +0 -1
  153. package/lib/types/src/WebGPU/getDevice.d.ts +0 -2
  154. package/lib/types/src/WebGPU/getDevice.d.ts.map +0 -1
  155. package/lib/types/src/WebGPU/getTexture/createCheckedImageData.d.ts.map +0 -1
  156. package/lib/types/src/WebGPU/getTexture/generateMimapsArray.d.ts.map +0 -1
  157. package/lib/types/src/WebGPU/getTexture/index.d.ts +0 -17
  158. package/lib/types/src/WebGPU/getTexture/index.d.ts.map +0 -1
  159. package/lib/types/src/WebGPU/m3.d.ts.map +0 -1
  160. package/lib/types/src/WebGPU/pick.d.ts.map +0 -1
  161. package/lib/types/src/WebGPU/pointer.d.ts +0 -10
  162. package/lib/types/src/WebGPU/pointer.d.ts.map +0 -1
  163. package/lib/types/src/WebGPU/programs/blur/getProgram.d.ts +0 -2
  164. package/lib/types/src/WebGPU/programs/blur/getProgram.d.ts.map +0 -1
  165. package/lib/types/src/WebGPU/programs/draw/getProgram.d.ts +0 -2
  166. package/lib/types/src/WebGPU/programs/draw/getProgram.d.ts.map +0 -1
  167. package/lib/types/src/WebGPU/programs/draw3dModel/getProgram.d.ts +0 -2
  168. package/lib/types/src/WebGPU/programs/draw3dModel/getProgram.d.ts.map +0 -1
  169. package/lib/types/src/WebGPU/programs/draw3dModelLight/getProgram.d.ts +0 -9
  170. package/lib/types/src/WebGPU/programs/draw3dModelLight/getProgram.d.ts.map +0 -1
  171. package/lib/types/src/WebGPU/programs/draw3dModelTexture/getProgram.d.ts +0 -2
  172. package/lib/types/src/WebGPU/programs/draw3dModelTexture/getProgram.d.ts.map +0 -1
  173. package/lib/types/src/WebGPU/programs/drawBezier/getProgram.d.ts +0 -2
  174. package/lib/types/src/WebGPU/programs/drawBezier/getProgram.d.ts.map +0 -1
  175. package/lib/types/src/WebGPU/programs/drawMSDF/getProgram.d.ts +0 -2
  176. package/lib/types/src/WebGPU/programs/drawMSDF/getProgram.d.ts.map +0 -1
  177. package/lib/types/src/WebGPU/programs/drawTexture/getProgram.d.ts +0 -2
  178. package/lib/types/src/WebGPU/programs/drawTexture/getProgram.d.ts.map +0 -1
  179. package/lib/types/src/WebGPU/programs/drawTriangle/getProgram.d.ts +0 -2
  180. package/lib/types/src/WebGPU/programs/drawTriangle/getProgram.d.ts.map +0 -1
  181. package/lib/types/src/WebGPU/programs/initPrograms.d.ts +0 -22
  182. package/lib/types/src/WebGPU/programs/initPrograms.d.ts.map +0 -1
  183. package/lib/types/src/WebGPU/programs/pickTexture/getProgram.d.ts +0 -2
  184. package/lib/types/src/WebGPU/programs/pickTexture/getProgram.d.ts.map +0 -1
  185. package/lib/types/src/WebGPU/programs/pickTriangle/getProgram.d.ts +0 -2
  186. package/lib/types/src/WebGPU/programs/pickTriangle/getProgram.d.ts.map +0 -1
  187. package/lib/types/src/__test__/index.test.d.ts +0 -1
  188. package/lib/types/src/__test__/index.test.d.ts.map +0 -1
  189. package/lib/types/src/consts.d.ts +0 -16
  190. package/lib/types/src/consts.d.ts.map +0 -1
  191. package/lib/types/src/getCanvasMatrix.d.ts +0 -2
  192. package/lib/types/src/getCanvasMatrix.d.ts.map +0 -1
  193. package/lib/types/src/getCanvasRenderDescriptor.d.ts.map +0 -1
  194. package/lib/types/src/getDepthTexture.d.ts.map +0 -1
  195. package/lib/types/src/getMultisampleTexture.d.ts +0 -2
  196. package/lib/types/src/getMultisampleTexture.d.ts.map +0 -1
  197. package/lib/types/src/getRenderDescriptor.d.ts.map +0 -1
  198. package/lib/types/src/index.d.ts +0 -14
  199. package/lib/types/src/index.d.ts.map +0 -1
  200. package/lib/types/src/models/Video/MiniatureVideo.d.ts +0 -30
  201. package/lib/types/src/models/Video/MiniatureVideo.d.ts.map +0 -1
  202. package/lib/types/src/run.d.ts +0 -5
  203. package/lib/types/src/run.d.ts.map +0 -1
  204. package/lib/types/src/types.d.ts +0 -4
  205. package/lib/types/src/types.d.ts.map +0 -1
  206. package/lib/types/src/utils/atNormIndex.d.ts.map +0 -1
  207. package/lib/types/src/utils/captureCanvasStream.d.ts.map +0 -1
  208. package/lib/types/src/utils/captureCanvasStreamWasm.d.ts.map +0 -1
  209. package/lib/types/src/utils/clamp.d.ts.map +0 -1
  210. package/lib/types/src/utils/distancePointToLine.d.ts.map +0 -1
  211. package/lib/types/src/utils/fitCurve.d.ts.map +0 -1
  212. package/lib/types/src/utils/getAngle.d.ts +0 -2
  213. package/lib/types/src/utils/getAngle.d.ts.map +0 -1
  214. package/lib/types/src/utils/getAngleDiff.d.ts.map +0 -1
  215. package/lib/types/src/utils/getBezierPos.d.ts.map +0 -1
  216. package/lib/types/src/utils/getBezierTan.d.ts.map +0 -1
  217. package/lib/types/src/utils/getCurveLength.d.ts.map +0 -1
  218. package/lib/types/src/utils/getDefaultPoints.d.ts +0 -2
  219. package/lib/types/src/utils/getDefaultPoints.d.ts.map +0 -1
  220. package/lib/types/src/utils/getDistance.d.ts +0 -2
  221. package/lib/types/src/utils/getDistance.d.ts.map +0 -1
  222. package/lib/types/src/utils/getSvgSource.d.ts +0 -2
  223. package/lib/types/src/utils/getSvgSource.d.ts.map +0 -1
  224. package/lib/types/src/utils/mat4.d.ts.map +0 -1
  225. package/lib/types/src/utils/normalizeVec2.d.ts +0 -2
  226. package/lib/types/src/utils/normalizeVec2.d.ts.map +0 -1
  227. package/lib/types/src/utils/resizeArray.d.ts.map +0 -1
  228. package/lib/types/src/utils/vec3.d.ts.map +0 -1
  229. /package/lib/types/{src/WebGPU → WebGPU}/canvasSizeObserver.d.ts +0 -0
  230. /package/lib/types/{src/WebGPU → WebGPU}/getTexture/createCheckedImageData.d.ts +0 -0
  231. /package/lib/types/{src/WebGPU → WebGPU}/getTexture/generateMimapsArray.d.ts +0 -0
  232. /package/lib/types/{src/WebGPU → WebGPU}/m3.d.ts +0 -0
  233. /package/lib/types/{src/getRenderDescriptor.d.ts → getRenderDescriptor.d.ts} +0 -0
  234. /package/lib/types/{src/utils → utils}/atNormIndex.d.ts +0 -0
  235. /package/lib/types/{src/utils → utils}/captureCanvasStream.d.ts +0 -0
  236. /package/lib/types/{src/utils → utils}/captureCanvasStreamWasm.d.ts +0 -0
  237. /package/lib/types/{src/utils → utils}/clamp.d.ts +0 -0
  238. /package/lib/types/{src/utils → utils}/fitCurve.d.ts +0 -0
  239. /package/lib/types/{src/utils → utils}/getAngleDiff.d.ts +0 -0
  240. /package/lib/types/{src/utils → utils}/mat4.d.ts +0 -0
  241. /package/lib/types/{src/utils → utils}/resizeArray.d.ts +0 -0
  242. /package/lib/types/{src/utils → utils}/vec3.d.ts +0 -0
package/README.md CHANGED
@@ -17,3 +17,32 @@ Each Pull Request has to be merged with squash, the following naming convention
17
17
  | `fix(pencil): stop graphite breaking when too much pressure applied` | patch/fix |
18
18
  | `feat(pencil): add 'graphiteWidth' option` | minor/feature |
19
19
  | `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | major/breaking release <br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |
20
+
21
+ ## Testing locally:
22
+
23
+ ```bash
24
+ npm link
25
+ ```
26
+
27
+ Creates link in global registry on your machine.
28
+
29
+ Then call
30
+
31
+ ```bash
32
+ npm link @mateuszjs/magic-render
33
+ ```
34
+
35
+ In the repo where you want to put local version of the package.
36
+ Remember to build package to see an update!
37
+
38
+ # Glossary
39
+
40
+ ## Units:
41
+
42
+ viewport - value expressed in pixels which will be rendered on the screen. This is exavtly how many pixels will be rendered, already includes retina. It's device physical pixel, not CSS pixel.
43
+
44
+ world - values expressed in abstract units used in project. This unit is absolute, never changes, does not depend on anything. This is how all sizes of all assets and assets' properties are kept expressed.
45
+
46
+ texel - value expressed in texels, ususally in SDF texture texels. It corresponds to how many texels will be used in the SDF texture.
47
+
48
+ Often when no unit is used, value is expressed in world coordinates OR the unit is obvious from the function context.