@twick/2d 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/LICENSE +21 -0
  2. package/editor/editor/NodeInspectorConfig.d.ts +3 -0
  3. package/editor/editor/NodeInspectorConfig.d.ts.map +1 -0
  4. package/editor/editor/PreviewOverlayConfig.d.ts +3 -0
  5. package/editor/editor/PreviewOverlayConfig.d.ts.map +1 -0
  6. package/editor/editor/Provider.d.ts +17 -0
  7. package/editor/editor/Provider.d.ts.map +1 -0
  8. package/editor/editor/SceneGraphTabConfig.d.ts +3 -0
  9. package/editor/editor/SceneGraphTabConfig.d.ts.map +1 -0
  10. package/editor/editor/icons/CircleIcon.d.ts +2 -0
  11. package/editor/editor/icons/CircleIcon.d.ts.map +1 -0
  12. package/editor/editor/icons/CodeBlockIcon.d.ts +2 -0
  13. package/editor/editor/icons/CodeBlockIcon.d.ts.map +1 -0
  14. package/editor/editor/icons/CurveIcon.d.ts +2 -0
  15. package/editor/editor/icons/CurveIcon.d.ts.map +1 -0
  16. package/editor/editor/icons/GridIcon.d.ts +2 -0
  17. package/editor/editor/icons/GridIcon.d.ts.map +1 -0
  18. package/editor/editor/icons/IconMap.d.ts +3 -0
  19. package/editor/editor/icons/IconMap.d.ts.map +1 -0
  20. package/editor/editor/icons/ImgIcon.d.ts +2 -0
  21. package/editor/editor/icons/ImgIcon.d.ts.map +1 -0
  22. package/editor/editor/icons/LayoutIcon.d.ts +2 -0
  23. package/editor/editor/icons/LayoutIcon.d.ts.map +1 -0
  24. package/editor/editor/icons/LineIcon.d.ts +2 -0
  25. package/editor/editor/icons/LineIcon.d.ts.map +1 -0
  26. package/editor/editor/icons/NodeIcon.d.ts +2 -0
  27. package/editor/editor/icons/NodeIcon.d.ts.map +1 -0
  28. package/editor/editor/icons/RayIcon.d.ts +2 -0
  29. package/editor/editor/icons/RayIcon.d.ts.map +1 -0
  30. package/editor/editor/icons/RectIcon.d.ts +2 -0
  31. package/editor/editor/icons/RectIcon.d.ts.map +1 -0
  32. package/editor/editor/icons/ShapeIcon.d.ts +2 -0
  33. package/editor/editor/icons/ShapeIcon.d.ts.map +1 -0
  34. package/editor/editor/icons/TxtIcon.d.ts +2 -0
  35. package/editor/editor/icons/TxtIcon.d.ts.map +1 -0
  36. package/editor/editor/icons/VideoIcon.d.ts +2 -0
  37. package/editor/editor/icons/VideoIcon.d.ts.map +1 -0
  38. package/editor/editor/icons/View2DIcon.d.ts +2 -0
  39. package/editor/editor/icons/View2DIcon.d.ts.map +1 -0
  40. package/editor/editor/index.d.ts +4 -0
  41. package/editor/editor/index.d.ts.map +1 -0
  42. package/editor/editor/tree/DetachedRoot.d.ts +2 -0
  43. package/editor/editor/tree/DetachedRoot.d.ts.map +1 -0
  44. package/editor/editor/tree/NodeElement.d.ts +8 -0
  45. package/editor/editor/tree/NodeElement.d.ts.map +1 -0
  46. package/editor/editor/tree/TreeElement.d.ts +15 -0
  47. package/editor/editor/tree/TreeElement.d.ts.map +1 -0
  48. package/editor/editor/tree/TreeRoot.d.ts +3 -0
  49. package/editor/editor/tree/TreeRoot.d.ts.map +1 -0
  50. package/editor/editor/tree/ViewRoot.d.ts +2 -0
  51. package/editor/editor/tree/ViewRoot.d.ts.map +1 -0
  52. package/editor/editor/tree/index.d.ts +4 -0
  53. package/editor/editor/tree/index.d.ts.map +1 -0
  54. package/editor/editor/tsconfig.build.tsbuildinfo +1 -0
  55. package/editor/index.css +33 -0
  56. package/editor/index.js +341 -0
  57. package/editor/index.js.map +1 -0
  58. package/lib/code/CodeCursor.d.ts +83 -0
  59. package/lib/code/CodeCursor.d.ts.map +1 -0
  60. package/lib/code/CodeCursor.js +306 -0
  61. package/lib/code/CodeDiffer.d.ts +28 -0
  62. package/lib/code/CodeDiffer.d.ts.map +1 -0
  63. package/lib/code/CodeDiffer.js +51 -0
  64. package/lib/code/CodeFragment.d.ts +42 -0
  65. package/lib/code/CodeFragment.d.ts.map +1 -0
  66. package/lib/code/CodeFragment.js +72 -0
  67. package/lib/code/CodeHighlighter.d.ts +71 -0
  68. package/lib/code/CodeHighlighter.d.ts.map +1 -0
  69. package/lib/code/CodeHighlighter.js +2 -0
  70. package/lib/code/CodeMetrics.d.ts +11 -0
  71. package/lib/code/CodeMetrics.d.ts.map +1 -0
  72. package/lib/code/CodeMetrics.js +29 -0
  73. package/lib/code/CodeRange.d.ts +41 -0
  74. package/lib/code/CodeRange.d.ts.map +1 -0
  75. package/lib/code/CodeRange.js +179 -0
  76. package/lib/code/CodeScope.d.ts +16 -0
  77. package/lib/code/CodeScope.d.ts.map +1 -0
  78. package/lib/code/CodeScope.js +72 -0
  79. package/lib/code/CodeSelection.d.ts +6 -0
  80. package/lib/code/CodeSelection.d.ts.map +1 -0
  81. package/lib/code/CodeSelection.js +13 -0
  82. package/lib/code/CodeSignal.d.ts +60 -0
  83. package/lib/code/CodeSignal.d.ts.map +1 -0
  84. package/lib/code/CodeSignal.js +194 -0
  85. package/lib/code/CodeTokenizer.d.ts +8 -0
  86. package/lib/code/CodeTokenizer.d.ts.map +1 -0
  87. package/lib/code/CodeTokenizer.js +50 -0
  88. package/lib/code/DefaultHighlightStyle.d.ts +3 -0
  89. package/lib/code/DefaultHighlightStyle.d.ts.map +1 -0
  90. package/lib/code/DefaultHighlightStyle.js +98 -0
  91. package/lib/code/LezerHighlighter.d.ts +22 -0
  92. package/lib/code/LezerHighlighter.d.ts.map +1 -0
  93. package/lib/code/LezerHighlighter.js +89 -0
  94. package/lib/code/diff.d.ts +31 -0
  95. package/lib/code/diff.d.ts.map +1 -0
  96. package/lib/code/diff.js +236 -0
  97. package/lib/code/extractRange.d.ts +17 -0
  98. package/lib/code/extractRange.d.ts.map +1 -0
  99. package/lib/code/extractRange.js +102 -0
  100. package/lib/code/index.d.ts +14 -0
  101. package/lib/code/index.d.ts.map +1 -0
  102. package/lib/code/index.js +14 -0
  103. package/lib/components/Audio.d.ts +14 -0
  104. package/lib/components/Audio.d.ts.map +1 -0
  105. package/lib/components/Audio.js +118 -0
  106. package/lib/components/Bezier.d.ts +23 -0
  107. package/lib/components/Bezier.d.ts.map +1 -0
  108. package/lib/components/Bezier.js +81 -0
  109. package/lib/components/Circle.d.ts +193 -0
  110. package/lib/components/Circle.d.ts.map +1 -0
  111. package/lib/components/Circle.js +178 -0
  112. package/lib/components/Code.d.ts +231 -0
  113. package/lib/components/Code.d.ts.map +1 -0
  114. package/lib/components/Code.js +325 -0
  115. package/lib/components/CodeBlock.d.ts +133 -0
  116. package/lib/components/CodeBlock.d.ts.map +1 -0
  117. package/lib/components/CodeBlock.js +461 -0
  118. package/lib/components/CubicBezier.d.ts +70 -0
  119. package/lib/components/CubicBezier.d.ts.map +1 -0
  120. package/lib/components/CubicBezier.js +81 -0
  121. package/lib/components/Curve.d.ts +204 -0
  122. package/lib/components/Curve.d.ts.map +1 -0
  123. package/lib/components/Curve.js +284 -0
  124. package/lib/components/Grid.d.ts +76 -0
  125. package/lib/components/Grid.d.ts.map +1 -0
  126. package/lib/components/Grid.js +91 -0
  127. package/lib/components/Icon.d.ts +59 -0
  128. package/lib/components/Icon.d.ts.map +1 -0
  129. package/lib/components/Icon.js +58 -0
  130. package/lib/components/Img.d.ts +118 -0
  131. package/lib/components/Img.d.ts.map +1 -0
  132. package/lib/components/Img.js +245 -0
  133. package/lib/components/Knot.d.ts +90 -0
  134. package/lib/components/Knot.d.ts.map +1 -0
  135. package/lib/components/Knot.js +68 -0
  136. package/lib/components/Latex.d.ts +39 -0
  137. package/lib/components/Latex.d.ts.map +1 -0
  138. package/lib/components/Latex.js +101 -0
  139. package/lib/components/Layout.d.ts +419 -0
  140. package/lib/components/Layout.d.ts.map +1 -0
  141. package/lib/components/Layout.js +706 -0
  142. package/lib/components/Line.d.ts +160 -0
  143. package/lib/components/Line.d.ts.map +1 -0
  144. package/lib/components/Line.js +346 -0
  145. package/lib/components/Media.d.ts +65 -0
  146. package/lib/components/Media.d.ts.map +1 -0
  147. package/lib/components/Media.js +303 -0
  148. package/lib/components/Node.d.ts +836 -0
  149. package/lib/components/Node.d.ts.map +1 -0
  150. package/lib/components/Node.js +1317 -0
  151. package/lib/components/Path.d.ts +20 -0
  152. package/lib/components/Path.d.ts.map +1 -0
  153. package/lib/components/Path.js +97 -0
  154. package/lib/components/Polygon.d.ts +113 -0
  155. package/lib/components/Polygon.d.ts.map +1 -0
  156. package/lib/components/Polygon.js +123 -0
  157. package/lib/components/QuadBezier.d.ts +62 -0
  158. package/lib/components/QuadBezier.d.ts.map +1 -0
  159. package/lib/components/QuadBezier.js +76 -0
  160. package/lib/components/Ray.d.ts +62 -0
  161. package/lib/components/Ray.d.ts.map +1 -0
  162. package/lib/components/Ray.js +96 -0
  163. package/lib/components/Rect.d.ts +114 -0
  164. package/lib/components/Rect.d.ts.map +1 -0
  165. package/lib/components/Rect.js +76 -0
  166. package/lib/components/Rive.d.ts +22 -0
  167. package/lib/components/Rive.d.ts.map +1 -0
  168. package/lib/components/Rive.js +117 -0
  169. package/lib/components/SVG.d.ts +178 -0
  170. package/lib/components/SVG.d.ts.map +1 -0
  171. package/lib/components/SVG.js +577 -0
  172. package/lib/components/Shape.d.ts +40 -0
  173. package/lib/components/Shape.d.ts.map +1 -0
  174. package/lib/components/Shape.js +134 -0
  175. package/lib/components/Spline.d.ts +89 -0
  176. package/lib/components/Spline.d.ts.map +1 -0
  177. package/lib/components/Spline.js +256 -0
  178. package/lib/components/Txt.d.ts +53 -0
  179. package/lib/components/Txt.d.ts.map +1 -0
  180. package/lib/components/Txt.js +173 -0
  181. package/lib/components/TxtLeaf.d.ts +21 -0
  182. package/lib/components/TxtLeaf.d.ts.map +1 -0
  183. package/lib/components/TxtLeaf.js +181 -0
  184. package/lib/components/Video.d.ts +69 -0
  185. package/lib/components/Video.d.ts.map +1 -0
  186. package/lib/components/Video.js +283 -0
  187. package/lib/components/View2D.d.ts +28 -0
  188. package/lib/components/View2D.d.ts.map +1 -0
  189. package/lib/components/View2D.js +93 -0
  190. package/lib/components/index.d.ts +29 -0
  191. package/lib/components/index.d.ts.map +1 -0
  192. package/lib/components/index.js +29 -0
  193. package/lib/components/types.d.ts +17 -0
  194. package/lib/components/types.d.ts.map +1 -0
  195. package/lib/components/types.js +2 -0
  196. package/lib/curves/ArcSegment.d.ts +26 -0
  197. package/lib/curves/ArcSegment.d.ts.map +1 -0
  198. package/lib/curves/ArcSegment.js +97 -0
  199. package/lib/curves/CircleSegment.d.ts +18 -0
  200. package/lib/curves/CircleSegment.d.ts.map +1 -0
  201. package/lib/curves/CircleSegment.js +52 -0
  202. package/lib/curves/CubicBezierSegment.d.ts +18 -0
  203. package/lib/curves/CubicBezierSegment.d.ts.map +1 -0
  204. package/lib/curves/CubicBezierSegment.js +55 -0
  205. package/lib/curves/CurveDrawingInfo.d.ts +11 -0
  206. package/lib/curves/CurveDrawingInfo.d.ts.map +1 -0
  207. package/lib/curves/CurveDrawingInfo.js +2 -0
  208. package/lib/curves/CurvePoint.d.ts +15 -0
  209. package/lib/curves/CurvePoint.d.ts.map +1 -0
  210. package/lib/curves/CurvePoint.js +2 -0
  211. package/lib/curves/CurveProfile.d.ts +7 -0
  212. package/lib/curves/CurveProfile.d.ts.map +1 -0
  213. package/lib/curves/CurveProfile.js +2 -0
  214. package/lib/curves/KnotInfo.d.ts +12 -0
  215. package/lib/curves/KnotInfo.d.ts.map +1 -0
  216. package/lib/curves/KnotInfo.js +2 -0
  217. package/lib/curves/LineSegment.d.ts +16 -0
  218. package/lib/curves/LineSegment.d.ts.map +1 -0
  219. package/lib/curves/LineSegment.js +45 -0
  220. package/lib/curves/Polynomial.d.ts +118 -0
  221. package/lib/curves/Polynomial.d.ts.map +1 -0
  222. package/lib/curves/Polynomial.js +259 -0
  223. package/lib/curves/Polynomial2D.d.ts +22 -0
  224. package/lib/curves/Polynomial2D.d.ts.map +1 -0
  225. package/lib/curves/Polynomial2D.js +45 -0
  226. package/lib/curves/PolynomialSegment.d.ts +39 -0
  227. package/lib/curves/PolynomialSegment.d.ts.map +1 -0
  228. package/lib/curves/PolynomialSegment.js +86 -0
  229. package/lib/curves/QuadBezierSegment.d.ts +17 -0
  230. package/lib/curves/QuadBezierSegment.d.ts.map +1 -0
  231. package/lib/curves/QuadBezierSegment.js +49 -0
  232. package/lib/curves/Segment.d.ts +9 -0
  233. package/lib/curves/Segment.d.ts.map +1 -0
  234. package/lib/curves/Segment.js +3 -0
  235. package/lib/curves/UniformPolynomialCurveSampler.d.ts +43 -0
  236. package/lib/curves/UniformPolynomialCurveSampler.d.ts.map +1 -0
  237. package/lib/curves/UniformPolynomialCurveSampler.js +73 -0
  238. package/lib/curves/createCurveProfileLerp.d.ts +32 -0
  239. package/lib/curves/createCurveProfileLerp.d.ts.map +1 -0
  240. package/lib/curves/createCurveProfileLerp.js +351 -0
  241. package/lib/curves/getBezierSplineProfile.d.ts +12 -0
  242. package/lib/curves/getBezierSplineProfile.d.ts.map +1 -0
  243. package/lib/curves/getBezierSplineProfile.js +137 -0
  244. package/lib/curves/getCircleProfile.d.ts +4 -0
  245. package/lib/curves/getCircleProfile.d.ts.map +1 -0
  246. package/lib/curves/getCircleProfile.js +44 -0
  247. package/lib/curves/getPathProfile.d.ts +3 -0
  248. package/lib/curves/getPathProfile.d.ts.map +1 -0
  249. package/lib/curves/getPathProfile.js +128 -0
  250. package/lib/curves/getPointAtDistance.d.ts +4 -0
  251. package/lib/curves/getPointAtDistance.d.ts.map +1 -0
  252. package/lib/curves/getPointAtDistance.js +15 -0
  253. package/lib/curves/getPolylineProfile.d.ts +4 -0
  254. package/lib/curves/getPolylineProfile.d.ts.map +1 -0
  255. package/lib/curves/getPolylineProfile.js +58 -0
  256. package/lib/curves/getRectProfile.d.ts +4 -0
  257. package/lib/curves/getRectProfile.d.ts.map +1 -0
  258. package/lib/curves/getRectProfile.js +57 -0
  259. package/lib/curves/index.d.ts +17 -0
  260. package/lib/curves/index.d.ts.map +1 -0
  261. package/lib/curves/index.js +17 -0
  262. package/lib/decorators/canvasStyleSignal.d.ts +5 -0
  263. package/lib/decorators/canvasStyleSignal.d.ts.map +1 -0
  264. package/lib/decorators/canvasStyleSignal.js +12 -0
  265. package/lib/decorators/colorSignal.d.ts +2 -0
  266. package/lib/decorators/colorSignal.d.ts.map +1 -0
  267. package/lib/decorators/colorSignal.js +9 -0
  268. package/lib/decorators/compound.d.ts +26 -0
  269. package/lib/decorators/compound.d.ts.map +1 -0
  270. package/lib/decorators/compound.js +49 -0
  271. package/lib/decorators/computed.d.ts +9 -0
  272. package/lib/decorators/computed.d.ts.map +1 -0
  273. package/lib/decorators/computed.js +18 -0
  274. package/lib/decorators/defaultStyle.d.ts +2 -0
  275. package/lib/decorators/defaultStyle.d.ts.map +1 -0
  276. package/lib/decorators/defaultStyle.js +14 -0
  277. package/lib/decorators/filtersSignal.d.ts +13 -0
  278. package/lib/decorators/filtersSignal.d.ts.map +1 -0
  279. package/lib/decorators/filtersSignal.js +73 -0
  280. package/lib/decorators/index.d.ts +11 -0
  281. package/lib/decorators/index.d.ts.map +1 -0
  282. package/lib/decorators/index.js +11 -0
  283. package/lib/decorators/initializers.d.ts +4 -0
  284. package/lib/decorators/initializers.d.ts.map +1 -0
  285. package/lib/decorators/initializers.js +27 -0
  286. package/lib/decorators/nodeName.d.ts +9 -0
  287. package/lib/decorators/nodeName.d.ts.map +1 -0
  288. package/lib/decorators/nodeName.js +13 -0
  289. package/lib/decorators/signal.d.ts +183 -0
  290. package/lib/decorators/signal.d.ts.map +1 -0
  291. package/lib/decorators/signal.js +285 -0
  292. package/lib/decorators/spacingSignal.d.ts +2 -0
  293. package/lib/decorators/spacingSignal.d.ts.map +1 -0
  294. package/lib/decorators/spacingSignal.js +15 -0
  295. package/lib/decorators/vector2Signal.d.ts +9 -0
  296. package/lib/decorators/vector2Signal.d.ts.map +1 -0
  297. package/lib/decorators/vector2Signal.js +15 -0
  298. package/lib/index.d.ts +9 -0
  299. package/lib/index.d.ts.map +1 -0
  300. package/lib/index.js +9 -0
  301. package/lib/jsx-dev-runtime.d.ts +3 -0
  302. package/lib/jsx-dev-runtime.d.ts.map +1 -0
  303. package/lib/jsx-dev-runtime.js +3 -0
  304. package/lib/jsx-runtime.d.ts +12 -0
  305. package/lib/jsx-runtime.d.ts.map +1 -0
  306. package/lib/jsx-runtime.js +23 -0
  307. package/lib/partials/Filter.d.ts +82 -0
  308. package/lib/partials/Filter.d.ts.map +1 -0
  309. package/lib/partials/Filter.js +135 -0
  310. package/lib/partials/Gradient.d.ts +31 -0
  311. package/lib/partials/Gradient.d.ts.map +1 -0
  312. package/lib/partials/Gradient.js +63 -0
  313. package/lib/partials/Pattern.d.ts +13 -0
  314. package/lib/partials/Pattern.d.ts.map +1 -0
  315. package/lib/partials/Pattern.js +27 -0
  316. package/lib/partials/ShaderConfig.d.ts +81 -0
  317. package/lib/partials/ShaderConfig.d.ts.map +1 -0
  318. package/lib/partials/ShaderConfig.js +25 -0
  319. package/lib/partials/index.d.ts +5 -0
  320. package/lib/partials/index.d.ts.map +1 -0
  321. package/lib/partials/index.js +5 -0
  322. package/lib/partials/types.d.ts +35 -0
  323. package/lib/partials/types.d.ts.map +1 -0
  324. package/lib/partials/types.js +2 -0
  325. package/lib/scenes/Scene2D.d.ts +29 -0
  326. package/lib/scenes/Scene2D.d.ts.map +1 -0
  327. package/lib/scenes/Scene2D.js +180 -0
  328. package/lib/scenes/index.d.ts +4 -0
  329. package/lib/scenes/index.d.ts.map +1 -0
  330. package/lib/scenes/index.js +4 -0
  331. package/lib/scenes/makeScene2D.d.ts +5 -0
  332. package/lib/scenes/makeScene2D.d.ts.map +1 -0
  333. package/lib/scenes/makeScene2D.js +11 -0
  334. package/lib/scenes/useScene2D.d.ts +3 -0
  335. package/lib/scenes/useScene2D.d.ts.map +1 -0
  336. package/lib/scenes/useScene2D.js +5 -0
  337. package/lib/tsconfig.build.tsbuildinfo +1 -0
  338. package/lib/utils/CanvasUtils.d.ts +23 -0
  339. package/lib/utils/CanvasUtils.d.ts.map +1 -0
  340. package/lib/utils/CanvasUtils.js +138 -0
  341. package/lib/utils/diff.d.ts +31 -0
  342. package/lib/utils/diff.d.ts.map +1 -0
  343. package/lib/utils/diff.js +97 -0
  344. package/lib/utils/index.d.ts +3 -0
  345. package/lib/utils/index.d.ts.map +1 -0
  346. package/lib/utils/index.js +3 -0
  347. package/lib/utils/is.d.ts +8 -0
  348. package/lib/utils/is.d.ts.map +1 -0
  349. package/lib/utils/is.js +10 -0
  350. package/lib/utils/makeSignalExtensions.d.ts +4 -0
  351. package/lib/utils/makeSignalExtensions.d.ts.map +1 -0
  352. package/lib/utils/makeSignalExtensions.js +20 -0
  353. package/lib/utils/video/ffmpeg-client.d.ts +5 -0
  354. package/lib/utils/video/ffmpeg-client.d.ts.map +1 -0
  355. package/lib/utils/video/ffmpeg-client.js +32 -0
  356. package/lib/utils/video/mp4-parser-manager.d.ts +3 -0
  357. package/lib/utils/video/mp4-parser-manager.d.ts.map +1 -0
  358. package/lib/utils/video/mp4-parser-manager.js +55 -0
  359. package/lib/utils/video/parser/index.d.ts +2 -0
  360. package/lib/utils/video/parser/index.d.ts.map +1 -0
  361. package/lib/utils/video/parser/index.js +2 -0
  362. package/lib/utils/video/parser/parser.d.ts +21 -0
  363. package/lib/utils/video/parser/parser.d.ts.map +1 -0
  364. package/lib/utils/video/parser/parser.js +168 -0
  365. package/lib/utils/video/parser/sampler.d.ts +16 -0
  366. package/lib/utils/video/parser/sampler.d.ts.map +1 -0
  367. package/lib/utils/video/parser/sampler.js +56 -0
  368. package/lib/utils/video/parser/segment.d.ts +48 -0
  369. package/lib/utils/video/parser/segment.d.ts.map +1 -0
  370. package/lib/utils/video/parser/segment.js +239 -0
  371. package/lib/utils/video/parser/sink.d.ts +9 -0
  372. package/lib/utils/video/parser/sink.d.ts.map +1 -0
  373. package/lib/utils/video/parser/sink.js +22 -0
  374. package/lib/utils/video/parser/utils.d.ts +10 -0
  375. package/lib/utils/video/parser/utils.d.ts.map +1 -0
  376. package/lib/utils/video/parser/utils.js +22 -0
  377. package/package.json +53 -0
  378. package/src/editor/NodeInspectorConfig.tsx +76 -0
  379. package/src/editor/PreviewOverlayConfig.tsx +67 -0
  380. package/src/editor/Provider.tsx +93 -0
  381. package/src/editor/SceneGraphTabConfig.tsx +81 -0
  382. package/src/editor/icons/CircleIcon.tsx +7 -0
  383. package/src/editor/icons/CodeBlockIcon.tsx +8 -0
  384. package/src/editor/icons/CurveIcon.tsx +7 -0
  385. package/src/editor/icons/GridIcon.tsx +7 -0
  386. package/src/editor/icons/IconMap.ts +35 -0
  387. package/src/editor/icons/ImgIcon.tsx +8 -0
  388. package/src/editor/icons/LayoutIcon.tsx +9 -0
  389. package/src/editor/icons/LineIcon.tsx +7 -0
  390. package/src/editor/icons/NodeIcon.tsx +7 -0
  391. package/src/editor/icons/RayIcon.tsx +7 -0
  392. package/src/editor/icons/RectIcon.tsx +7 -0
  393. package/src/editor/icons/ShapeIcon.tsx +7 -0
  394. package/src/editor/icons/TxtIcon.tsx +8 -0
  395. package/src/editor/icons/VideoIcon.tsx +7 -0
  396. package/src/editor/icons/View2DIcon.tsx +10 -0
  397. package/src/editor/index.css +0 -0
  398. package/src/editor/index.ts +17 -0
  399. package/src/editor/tree/DetachedRoot.tsx +23 -0
  400. package/src/editor/tree/NodeElement.tsx +74 -0
  401. package/src/editor/tree/TreeElement.tsx +72 -0
  402. package/src/editor/tree/TreeRoot.tsx +10 -0
  403. package/src/editor/tree/ViewRoot.tsx +20 -0
  404. package/src/editor/tree/index.module.scss +38 -0
  405. package/src/editor/tree/index.ts +3 -0
  406. package/src/editor/tsconfig.build.json +5 -0
  407. package/src/editor/tsconfig.json +12 -0
  408. package/src/editor/tsdoc.json +4 -0
  409. package/src/editor/vite-env.d.ts +1 -0
  410. package/src/lib/code/CodeCursor.ts +445 -0
  411. package/src/lib/code/CodeDiffer.ts +78 -0
  412. package/src/lib/code/CodeFragment.ts +97 -0
  413. package/src/lib/code/CodeHighlighter.ts +75 -0
  414. package/src/lib/code/CodeMetrics.ts +47 -0
  415. package/src/lib/code/CodeRange.test.ts +74 -0
  416. package/src/lib/code/CodeRange.ts +216 -0
  417. package/src/lib/code/CodeScope.ts +101 -0
  418. package/src/lib/code/CodeSelection.ts +24 -0
  419. package/src/lib/code/CodeSignal.ts +327 -0
  420. package/src/lib/code/CodeTokenizer.ts +54 -0
  421. package/src/lib/code/DefaultHighlightStyle.ts +98 -0
  422. package/src/lib/code/LezerHighlighter.ts +113 -0
  423. package/src/lib/code/diff.test.ts +311 -0
  424. package/src/lib/code/diff.ts +319 -0
  425. package/src/lib/code/extractRange.ts +126 -0
  426. package/src/lib/code/index.ts +13 -0
  427. package/src/lib/components/Audio.ts +131 -0
  428. package/src/lib/components/Bezier.ts +105 -0
  429. package/src/lib/components/Circle.ts +266 -0
  430. package/src/lib/components/Code.ts +526 -0
  431. package/src/lib/components/CodeBlock.ts +576 -0
  432. package/src/lib/components/CubicBezier.ts +112 -0
  433. package/src/lib/components/Curve.ts +455 -0
  434. package/src/lib/components/Grid.ts +135 -0
  435. package/src/lib/components/Icon.ts +96 -0
  436. package/src/lib/components/Img.ts +319 -0
  437. package/src/lib/components/Knot.ts +157 -0
  438. package/src/lib/components/Latex.ts +122 -0
  439. package/src/lib/components/Layout.ts +1092 -0
  440. package/src/lib/components/Line.ts +429 -0
  441. package/src/lib/components/Media.ts +379 -0
  442. package/src/lib/components/Node.ts +1940 -0
  443. package/src/lib/components/Path.ts +137 -0
  444. package/src/lib/components/Polygon.ts +171 -0
  445. package/src/lib/components/QuadBezier.ts +100 -0
  446. package/src/lib/components/Ray.ts +125 -0
  447. package/src/lib/components/Rect.ts +187 -0
  448. package/src/lib/components/Rive.ts +156 -0
  449. package/src/lib/components/SVG.ts +797 -0
  450. package/src/lib/components/Shape.ts +143 -0
  451. package/src/lib/components/Spline.ts +344 -0
  452. package/src/lib/components/Txt.test.tsx +81 -0
  453. package/src/lib/components/Txt.ts +203 -0
  454. package/src/lib/components/TxtLeaf.ts +205 -0
  455. package/src/lib/components/Video.ts +397 -0
  456. package/src/lib/components/View2D.ts +98 -0
  457. package/src/lib/components/__tests__/children.test.tsx +142 -0
  458. package/src/lib/components/__tests__/clone.test.tsx +126 -0
  459. package/src/lib/components/__tests__/generatorTest.ts +28 -0
  460. package/src/lib/components/__tests__/mockScene2D.ts +45 -0
  461. package/src/lib/components/__tests__/query.test.tsx +122 -0
  462. package/src/lib/components/__tests__/state.test.tsx +60 -0
  463. package/src/lib/components/index.ts +28 -0
  464. package/src/lib/components/types.ts +35 -0
  465. package/src/lib/curves/ArcSegment.ts +159 -0
  466. package/src/lib/curves/CircleSegment.ts +77 -0
  467. package/src/lib/curves/CubicBezierSegment.ts +78 -0
  468. package/src/lib/curves/CurveDrawingInfo.ts +11 -0
  469. package/src/lib/curves/CurvePoint.ts +15 -0
  470. package/src/lib/curves/CurveProfile.ts +7 -0
  471. package/src/lib/curves/KnotInfo.ts +10 -0
  472. package/src/lib/curves/LineSegment.ts +62 -0
  473. package/src/lib/curves/Polynomial.ts +355 -0
  474. package/src/lib/curves/Polynomial2D.ts +62 -0
  475. package/src/lib/curves/PolynomialSegment.ts +124 -0
  476. package/src/lib/curves/QuadBezierSegment.ts +64 -0
  477. package/src/lib/curves/Segment.ts +17 -0
  478. package/src/lib/curves/UniformPolynomialCurveSampler.ts +94 -0
  479. package/src/lib/curves/createCurveProfileLerp.ts +471 -0
  480. package/src/lib/curves/getBezierSplineProfile.ts +223 -0
  481. package/src/lib/curves/getCircleProfile.ts +86 -0
  482. package/src/lib/curves/getPathProfile.ts +178 -0
  483. package/src/lib/curves/getPointAtDistance.ts +21 -0
  484. package/src/lib/curves/getPolylineProfile.test.ts +21 -0
  485. package/src/lib/curves/getPolylineProfile.ts +89 -0
  486. package/src/lib/curves/getRectProfile.ts +139 -0
  487. package/src/lib/curves/index.ts +16 -0
  488. package/src/lib/decorators/canvasStyleSignal.ts +16 -0
  489. package/src/lib/decorators/colorSignal.ts +9 -0
  490. package/src/lib/decorators/compound.ts +72 -0
  491. package/src/lib/decorators/computed.ts +18 -0
  492. package/src/lib/decorators/defaultStyle.ts +18 -0
  493. package/src/lib/decorators/filtersSignal.ts +136 -0
  494. package/src/lib/decorators/index.ts +10 -0
  495. package/src/lib/decorators/initializers.ts +32 -0
  496. package/src/lib/decorators/nodeName.ts +13 -0
  497. package/src/lib/decorators/signal.test.ts +90 -0
  498. package/src/lib/decorators/signal.ts +345 -0
  499. package/src/lib/decorators/spacingSignal.ts +15 -0
  500. package/src/lib/decorators/vector2Signal.ts +30 -0
  501. package/src/lib/globals.d.ts +2 -0
  502. package/src/lib/index.ts +8 -0
  503. package/src/lib/jsx-dev-runtime.ts +2 -0
  504. package/src/lib/jsx-runtime.ts +46 -0
  505. package/src/lib/parse-svg-path.d.ts +14 -0
  506. package/src/lib/partials/Filter.ts +180 -0
  507. package/src/lib/partials/Gradient.ts +102 -0
  508. package/src/lib/partials/Pattern.ts +34 -0
  509. package/src/lib/partials/ShaderConfig.ts +117 -0
  510. package/src/lib/partials/index.ts +4 -0
  511. package/src/lib/partials/types.ts +58 -0
  512. package/src/lib/scenes/Scene2D.ts +242 -0
  513. package/src/lib/scenes/index.ts +3 -0
  514. package/src/lib/scenes/makeScene2D.ts +16 -0
  515. package/src/lib/scenes/useScene2D.ts +6 -0
  516. package/src/lib/tsconfig.build.json +5 -0
  517. package/src/lib/tsconfig.json +10 -0
  518. package/src/lib/tsdoc.json +4 -0
  519. package/src/lib/utils/CanvasUtils.ts +306 -0
  520. package/src/lib/utils/diff.test.ts +453 -0
  521. package/src/lib/utils/diff.ts +148 -0
  522. package/src/lib/utils/index.ts +2 -0
  523. package/src/lib/utils/is.ts +11 -0
  524. package/src/lib/utils/makeSignalExtensions.ts +30 -0
  525. package/src/lib/utils/video/declarations.d.ts +1 -0
  526. package/src/lib/utils/video/ffmpeg-client.ts +50 -0
  527. package/src/lib/utils/video/mp4-parser-manager.ts +72 -0
  528. package/src/lib/utils/video/parser/index.ts +1 -0
  529. package/src/lib/utils/video/parser/parser.ts +257 -0
  530. package/src/lib/utils/video/parser/sampler.ts +72 -0
  531. package/src/lib/utils/video/parser/segment.ts +302 -0
  532. package/src/lib/utils/video/parser/sink.ts +29 -0
  533. package/src/lib/utils/video/parser/utils.ts +31 -0
  534. package/src/tsconfig.base.json +19 -0
  535. package/src/tsconfig.build.json +8 -0
  536. package/src/tsconfig.json +5 -0
  537. package/tsconfig.project.json +7 -0
@@ -0,0 +1,204 @@
1
+ import type { BBox, SerializedVector2, SignalValue, SimpleSignal } from '@twick/core';
2
+ import { Vector2 } from '@twick/core';
3
+ import type { CurveDrawingInfo } from '../curves/CurveDrawingInfo';
4
+ import type { CurvePoint } from '../curves/CurvePoint';
5
+ import type { CurveProfile } from '../curves/CurveProfile';
6
+ import type { DesiredLength } from '../partials';
7
+ import type { ShapeProps } from './Shape';
8
+ import { Shape } from './Shape';
9
+ export interface CurveProps extends ShapeProps {
10
+ /**
11
+ * {@inheritDoc Curve.closed}
12
+ */
13
+ closed?: SignalValue<boolean>;
14
+ /**
15
+ * {@inheritDoc Curve.start}
16
+ */
17
+ start?: SignalValue<number>;
18
+ /**
19
+ * {@inheritDoc Curve.startOffset}
20
+ */
21
+ startOffset?: SignalValue<number>;
22
+ /**
23
+ * {@inheritDoc Curve.startArrow}
24
+ */
25
+ startArrow?: SignalValue<boolean>;
26
+ /**
27
+ * {@inheritDoc Curve.end}
28
+ */
29
+ end?: SignalValue<number>;
30
+ /**
31
+ * {@inheritDoc Curve.endOffset}
32
+ */
33
+ endOffset?: SignalValue<number>;
34
+ /**
35
+ * {@inheritDoc Curve.endArrow}
36
+ */
37
+ endArrow?: SignalValue<boolean>;
38
+ /**
39
+ * {@inheritDoc Curve.arrowSize}
40
+ */
41
+ arrowSize?: SignalValue<number>;
42
+ }
43
+ export declare abstract class Curve extends Shape {
44
+ /**
45
+ * Whether the curve should be closed.
46
+ *
47
+ * @remarks
48
+ * Closed curves have their start and end points connected.
49
+ */
50
+ readonly closed: SimpleSignal<boolean, this>;
51
+ /**
52
+ * A percentage from the start before which the curve should be clipped.
53
+ *
54
+ * @remarks
55
+ * The portion of the curve that comes before the given percentage will be
56
+ * made invisible.
57
+ *
58
+ * This property is usefully for animating the curve appearing on the screen.
59
+ * The value of `0` means the very start of the curve (accounting for the
60
+ * {@link startOffset}) while `1` means the very end (accounting for the
61
+ * {@link endOffset}).
62
+ */
63
+ readonly start: SimpleSignal<number, this>;
64
+ /**
65
+ * The offset in pixels from the start of the curve.
66
+ *
67
+ * @remarks
68
+ * This property lets you specify where along the defined curve the actual
69
+ * visible portion starts. For example, setting it to `20` will make the first
70
+ * 20 pixels of the curve invisible.
71
+ *
72
+ * This property is useful for trimming the curve using a fixed distance.
73
+ * If you want to animate the curve appearing on the screen, use {@link start}
74
+ * instead.
75
+ */
76
+ readonly startOffset: SimpleSignal<number, this>;
77
+ /**
78
+ * Whether to display an arrow at the start of the visible curve.
79
+ *
80
+ * @remarks
81
+ * Use {@link arrowSize} to control the size of the arrow.
82
+ */
83
+ readonly startArrow: SimpleSignal<boolean, this>;
84
+ /**
85
+ * A percentage from the start after which the curve should be clipped.
86
+ *
87
+ * @remarks
88
+ * The portion of the curve that comes after the given percentage will be
89
+ * made invisible.
90
+ *
91
+ * This property is usefully for animating the curve appearing on the screen.
92
+ * The value of `0` means the very start of the curve (accounting for the
93
+ * {@link startOffset}) while `1` means the very end (accounting for the
94
+ * {@link endOffset}).
95
+ */
96
+ readonly end: SimpleSignal<number, this>;
97
+ /**
98
+ * The offset in pixels from the end of the curve.
99
+ *
100
+ * @remarks
101
+ * This property lets you specify where along the defined curve the actual
102
+ * visible portion ends. For example, setting it to `20` will make the last
103
+ * 20 pixels of the curve invisible.
104
+ *
105
+ * This property is useful for trimming the curve using a fixed distance.
106
+ * If you want to animate the curve appearing on the screen, use {@link end}
107
+ * instead.
108
+ */
109
+ readonly endOffset: SimpleSignal<number, this>;
110
+ /**
111
+ * Whether to display an arrow at the end of the visible curve.
112
+ *
113
+ * @remarks
114
+ * Use {@link arrowSize} to control the size of the arrow.
115
+ */
116
+ readonly endArrow: SimpleSignal<boolean, this>;
117
+ /**
118
+ * Controls the size of the end and start arrows.
119
+ *
120
+ * @remarks
121
+ * To make the arrows visible make sure to enable {@link startArrow} and/or
122
+ * {@link endArrow}.
123
+ */
124
+ readonly arrowSize: SimpleSignal<number, this>;
125
+ protected canHaveSubpath: boolean;
126
+ protected desiredSize(): SerializedVector2<DesiredLength>;
127
+ constructor(props: CurveProps);
128
+ protected abstract childrenBBox(): BBox;
129
+ abstract profile(): CurveProfile;
130
+ /**
131
+ * Convert a percentage along the curve to a distance.
132
+ *
133
+ * @remarks
134
+ * The returned distance is given in relation to the full curve, not
135
+ * accounting for {@link startOffset} and {@link endOffset}.
136
+ *
137
+ * @param value - The percentage along the curve.
138
+ */
139
+ percentageToDistance(value: number): number;
140
+ /**
141
+ * Convert a distance along the curve to a percentage.
142
+ *
143
+ * @remarks
144
+ * The distance should be given in relation to the full curve, not
145
+ * accounting for {@link startOffset} and {@link endOffset}.
146
+ *
147
+ * @param value - The distance along the curve.
148
+ */
149
+ distanceToPercentage(value: number): number;
150
+ /**
151
+ * The base arc length of this curve.
152
+ *
153
+ * @remarks
154
+ * This is the entire length of this curve, not accounting for
155
+ * {@link startOffset | the offsets}.
156
+ */
157
+ baseArcLength(): number;
158
+ /**
159
+ * The offset arc length of this curve.
160
+ *
161
+ * @remarks
162
+ * This is the length of the curve that accounts for
163
+ * {@link startOffset | the offsets}.
164
+ */
165
+ offsetArcLength(): number;
166
+ /**
167
+ * The visible arc length of this curve.
168
+ *
169
+ * @remarks
170
+ * This arc length accounts for both the offset and the {@link start} and
171
+ * {@link end} properties.
172
+ */
173
+ arcLength(): number;
174
+ /**
175
+ * The percentage of the curve that's currently visible.
176
+ *
177
+ * @remarks
178
+ * The returned value is the ratio between the visible length (as defined by
179
+ * {@link start} and {@link end}) and the offset length of the curve.
180
+ */
181
+ completion(): number;
182
+ protected processSubpath(_path: Path2D, _startPoint: Vector2 | null, _endPoint: Vector2 | null): void;
183
+ protected curveDrawingInfo(): CurveDrawingInfo;
184
+ protected getPointAtDistance(value: number): CurvePoint;
185
+ getPointAtPercentage(value: number): CurvePoint;
186
+ protected getComputedLayout(): BBox;
187
+ protected offsetComputedLayout(box: BBox): BBox;
188
+ protected getPath(): Path2D;
189
+ protected getCacheBBox(): BBox;
190
+ protected lineWidthCoefficient(): number;
191
+ /**
192
+ * Check if the path requires a profile.
193
+ *
194
+ * @remarks
195
+ * The profile is only required if certain features are used. Otherwise, the
196
+ * profile generation can be skipped, and the curve can be drawn directly
197
+ * using the 2D context.
198
+ */
199
+ protected requiresProfile(): boolean;
200
+ protected drawShape(context: CanvasRenderingContext2D): void;
201
+ private drawArrows;
202
+ private drawArrow;
203
+ }
204
+ //# sourceMappingURL=Curve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Curve.d.ts","sourceRoot":"","sources":["../../src/lib/components/Curve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,iBAAiB,EACjB,WAAW,EACX,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,OAAO,EAAQ,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B;;OAE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AIpC,SAAS,CAAC,QAAQ,CAAC,YAAY,IAAI,IAAI;aAEvB,OAAO,IAAI,YAAY;IAEvC;;;;;;;;OAQG;IACI,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAQlD;;;;;;;;OAQG;IACI,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIlD;;;;;;OAMG;IACI,aAAa;IAIpB;;;;;;OAMG;IACI,eAAe;IAOtB;;;;;;OAMG;IAEI,SAAS;IAIhB;;;;;;OAMG;IACI,UAAU,IAAI,MAAM;IAI3B,SAAS,CAAC,cAAc,CAEtB,KAAK,EAAE,MAAM,EAEb,WAAW,EAAE,OAAO,GAAG,IAAI,EAE3B,SAAS,EAAE,OAAO,GAAG,IAAI;IAM3B,SAAS,CAAC,gBAAgB,IAAI,gBAAgB;IA6F9C,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAIhD,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;cAInC,iBAAiB,IAAI,IAAI;IAI5C,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI;cAK5B,OAAO,IAAI,MAAM;cAIjB,YAAY,IAAI,IAAI;IAWvC,SAAS,CAAC,oBAAoB,IAAI,MAAM;IAIxC;;;;;;;OAOG;IACH,SAAS,CAAC,eAAe,IAAI,OAAO;cAWjB,SAAS,CAAC,OAAO,EAAE,wBAAwB;IAO9D,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,SAAS;CAelB"}
@@ -0,0 +1,284 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Vector2, clamp } from '@twick/core';
8
+ import { getPointAtDistance } from '../curves/getPointAtDistance';
9
+ import { computed, initial, nodeName, signal } from '../decorators';
10
+ import { lineTo, moveTo, resolveCanvasStyle } from '../utils';
11
+ import { Shape } from './Shape';
12
+ let Curve = class Curve extends Shape {
13
+ desiredSize() {
14
+ return this.childrenBBox().size;
15
+ }
16
+ constructor(props) {
17
+ super(props);
18
+ this.canHaveSubpath = false;
19
+ }
20
+ /**
21
+ * Convert a percentage along the curve to a distance.
22
+ *
23
+ * @remarks
24
+ * The returned distance is given in relation to the full curve, not
25
+ * accounting for {@link startOffset} and {@link endOffset}.
26
+ *
27
+ * @param value - The percentage along the curve.
28
+ */
29
+ percentageToDistance(value) {
30
+ return clamp(0, this.baseArcLength(), this.startOffset() + this.offsetArcLength() * value);
31
+ }
32
+ /**
33
+ * Convert a distance along the curve to a percentage.
34
+ *
35
+ * @remarks
36
+ * The distance should be given in relation to the full curve, not
37
+ * accounting for {@link startOffset} and {@link endOffset}.
38
+ *
39
+ * @param value - The distance along the curve.
40
+ */
41
+ distanceToPercentage(value) {
42
+ return (value - this.startOffset()) / this.offsetArcLength();
43
+ }
44
+ /**
45
+ * The base arc length of this curve.
46
+ *
47
+ * @remarks
48
+ * This is the entire length of this curve, not accounting for
49
+ * {@link startOffset | the offsets}.
50
+ */
51
+ baseArcLength() {
52
+ return this.profile().arcLength;
53
+ }
54
+ /**
55
+ * The offset arc length of this curve.
56
+ *
57
+ * @remarks
58
+ * This is the length of the curve that accounts for
59
+ * {@link startOffset | the offsets}.
60
+ */
61
+ offsetArcLength() {
62
+ const startOffset = this.startOffset();
63
+ const endOffset = this.endOffset();
64
+ const baseLength = this.baseArcLength();
65
+ return clamp(0, baseLength, baseLength - startOffset - endOffset);
66
+ }
67
+ /**
68
+ * The visible arc length of this curve.
69
+ *
70
+ * @remarks
71
+ * This arc length accounts for both the offset and the {@link start} and
72
+ * {@link end} properties.
73
+ */
74
+ arcLength() {
75
+ return this.offsetArcLength() * Math.abs(this.start() - this.end());
76
+ }
77
+ /**
78
+ * The percentage of the curve that's currently visible.
79
+ *
80
+ * @remarks
81
+ * The returned value is the ratio between the visible length (as defined by
82
+ * {@link start} and {@link end}) and the offset length of the curve.
83
+ */
84
+ completion() {
85
+ return Math.abs(this.start() - this.end());
86
+ }
87
+ processSubpath(
88
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
89
+ _path,
90
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
91
+ _startPoint,
92
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
93
+ _endPoint) {
94
+ // do nothing
95
+ }
96
+ curveDrawingInfo() {
97
+ const path = new Path2D();
98
+ let subpath = new Path2D();
99
+ const profile = this.profile();
100
+ let start = this.percentageToDistance(this.start());
101
+ let end = this.percentageToDistance(this.end());
102
+ if (start > end) {
103
+ [start, end] = [end, start];
104
+ }
105
+ const distance = end - start;
106
+ const arrowSize = Math.min(distance / 2, this.arrowSize());
107
+ if (this.startArrow()) {
108
+ start += arrowSize / 2;
109
+ }
110
+ if (this.endArrow()) {
111
+ end -= arrowSize / 2;
112
+ }
113
+ let length = 0;
114
+ let startPoint = null;
115
+ let startTangent = null;
116
+ let endPoint = null;
117
+ let endTangent = null;
118
+ for (const segment of profile.segments) {
119
+ const previousLength = length;
120
+ length += segment.arcLength;
121
+ if (length < start) {
122
+ continue;
123
+ }
124
+ const relativeStart = (start - previousLength) / segment.arcLength;
125
+ const relativeEnd = (end - previousLength) / segment.arcLength;
126
+ const clampedStart = clamp(0, 1, relativeStart);
127
+ const clampedEnd = clamp(0, 1, relativeEnd);
128
+ if (this.canHaveSubpath &&
129
+ endPoint &&
130
+ !segment.getPoint(0).position.equals(endPoint)) {
131
+ path.addPath(subpath);
132
+ this.processSubpath(subpath, startPoint, endPoint);
133
+ subpath = new Path2D();
134
+ startPoint = null;
135
+ }
136
+ const [startCurvePoint, endCurvePoint] = segment.draw(subpath, clampedStart, clampedEnd, startPoint === null);
137
+ if (startPoint === null) {
138
+ startPoint = startCurvePoint.position;
139
+ startTangent = startCurvePoint.normal.flipped.perpendicular;
140
+ }
141
+ endPoint = endCurvePoint.position;
142
+ endTangent = endCurvePoint.normal.flipped.perpendicular;
143
+ if (length > end) {
144
+ break;
145
+ }
146
+ }
147
+ if (this.closed() &&
148
+ this.start.isInitial() &&
149
+ this.end.isInitial() &&
150
+ this.startOffset.isInitial() &&
151
+ this.endOffset.isInitial()) {
152
+ subpath.closePath();
153
+ }
154
+ this.processSubpath(subpath, startPoint, endPoint);
155
+ path.addPath(subpath);
156
+ return {
157
+ startPoint: startPoint ?? Vector2.zero,
158
+ startTangent: startTangent ?? Vector2.right,
159
+ endPoint: endPoint ?? Vector2.zero,
160
+ endTangent: endTangent ?? Vector2.right,
161
+ arrowSize,
162
+ path,
163
+ startOffset: start,
164
+ };
165
+ }
166
+ getPointAtDistance(value) {
167
+ return getPointAtDistance(this.profile(), value + this.startOffset());
168
+ }
169
+ getPointAtPercentage(value) {
170
+ return getPointAtDistance(this.profile(), this.percentageToDistance(value));
171
+ }
172
+ getComputedLayout() {
173
+ return this.offsetComputedLayout(super.getComputedLayout());
174
+ }
175
+ offsetComputedLayout(box) {
176
+ box.position = box.position.sub(this.childrenBBox().center);
177
+ return box;
178
+ }
179
+ getPath() {
180
+ return this.curveDrawingInfo().path;
181
+ }
182
+ getCacheBBox() {
183
+ const box = this.childrenBBox();
184
+ const arrowSize = this.startArrow() || this.endArrow() ? this.arrowSize() : 0;
185
+ const lineWidth = this.lineWidth();
186
+ const coefficient = this.lineWidthCoefficient();
187
+ return box.expand(Math.max(0, arrowSize, lineWidth * coefficient));
188
+ }
189
+ lineWidthCoefficient() {
190
+ return this.lineCap() === 'square' ? 0.5 * 1.4143 : 0.5;
191
+ }
192
+ /**
193
+ * Check if the path requires a profile.
194
+ *
195
+ * @remarks
196
+ * The profile is only required if certain features are used. Otherwise, the
197
+ * profile generation can be skipped, and the curve can be drawn directly
198
+ * using the 2D context.
199
+ */
200
+ requiresProfile() {
201
+ return (!this.start.isInitial() ||
202
+ !this.startOffset.isInitial() ||
203
+ !this.startArrow.isInitial() ||
204
+ !this.end.isInitial() ||
205
+ !this.endOffset.isInitial() ||
206
+ !this.endArrow.isInitial());
207
+ }
208
+ drawShape(context) {
209
+ super.drawShape(context);
210
+ if (this.startArrow() || this.endArrow()) {
211
+ this.drawArrows(context);
212
+ }
213
+ }
214
+ drawArrows(context) {
215
+ const { startPoint, startTangent, endPoint, endTangent, arrowSize } = this.curveDrawingInfo();
216
+ if (arrowSize < 0.001) {
217
+ return;
218
+ }
219
+ context.save();
220
+ context.beginPath();
221
+ if (this.endArrow()) {
222
+ this.drawArrow(context, endPoint, endTangent.flipped, arrowSize);
223
+ }
224
+ if (this.startArrow()) {
225
+ this.drawArrow(context, startPoint, startTangent, arrowSize);
226
+ }
227
+ context.fillStyle = resolveCanvasStyle(this.stroke(), context);
228
+ context.closePath();
229
+ context.fill();
230
+ context.restore();
231
+ }
232
+ drawArrow(context, center, tangent, arrowSize) {
233
+ const normal = tangent.perpendicular;
234
+ const origin = center.add(tangent.scale(-arrowSize / 2));
235
+ moveTo(context, origin);
236
+ lineTo(context, origin.add(tangent.add(normal).scale(arrowSize)));
237
+ lineTo(context, origin.add(tangent.sub(normal).scale(arrowSize)));
238
+ lineTo(context, origin);
239
+ context.closePath();
240
+ }
241
+ };
242
+ __decorate([
243
+ initial(false),
244
+ signal()
245
+ ], Curve.prototype, "closed", void 0);
246
+ __decorate([
247
+ initial(0),
248
+ signal()
249
+ ], Curve.prototype, "start", void 0);
250
+ __decorate([
251
+ initial(0),
252
+ signal()
253
+ ], Curve.prototype, "startOffset", void 0);
254
+ __decorate([
255
+ initial(false),
256
+ signal()
257
+ ], Curve.prototype, "startArrow", void 0);
258
+ __decorate([
259
+ initial(1),
260
+ signal()
261
+ ], Curve.prototype, "end", void 0);
262
+ __decorate([
263
+ initial(0),
264
+ signal()
265
+ ], Curve.prototype, "endOffset", void 0);
266
+ __decorate([
267
+ initial(false),
268
+ signal()
269
+ ], Curve.prototype, "endArrow", void 0);
270
+ __decorate([
271
+ initial(24),
272
+ signal()
273
+ ], Curve.prototype, "arrowSize", void 0);
274
+ __decorate([
275
+ computed()
276
+ ], Curve.prototype, "arcLength", null);
277
+ __decorate([
278
+ computed()
279
+ ], Curve.prototype, "curveDrawingInfo", null);
280
+ Curve = __decorate([
281
+ nodeName('Curve')
282
+ ], Curve);
283
+ export { Curve };
284
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQ3VydmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL2NvbXBvbmVudHMvQ3VydmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBTUEsT0FBTyxFQUFDLE9BQU8sRUFBRSxLQUFLLEVBQUMsTUFBTSxhQUFhLENBQUM7QUFJM0MsT0FBTyxFQUFDLGtCQUFrQixFQUFDLE1BQU0sOEJBQThCLENBQUM7QUFDaEUsT0FBTyxFQUFDLFFBQVEsRUFBRSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUVsRSxPQUFPLEVBQUMsTUFBTSxFQUFFLE1BQU0sRUFBRSxrQkFBa0IsRUFBQyxNQUFNLFVBQVUsQ0FBQztBQUU1RCxPQUFPLEVBQUMsS0FBSyxFQUFDLE1BQU0sU0FBUyxDQUFDO0FBc0N2QixJQUFlLEtBQUssR0FBcEIsTUFBZSxLQUFNLFNBQVEsS0FBSztJQTRHcEIsV0FBVztRQUM1QixPQUFPLElBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQyxJQUFJLENBQUM7SUFDbEMsQ0FBQztJQUVELFlBQW1CLEtBQWlCO1FBQ2xDLEtBQUssQ0FBQ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
+ import type { ShapeProps } from './Shape';
3
+ import { Shape } from './Shape';
4
+ export interface GridProps extends ShapeProps {
5
+ /**
6
+ * {@inheritDoc Grid.spacing}
7
+ */
8
+ spacing?: SignalValue<PossibleVector2>;
9
+ /**
10
+ * {@inheritDoc Grid.start}
11
+ */
12
+ start?: SignalValue<number>;
13
+ /**
14
+ * {@inheritDoc Grid.end}
15
+ */
16
+ end?: SignalValue<number>;
17
+ }
18
+ /**
19
+ * A node for drawing a two-dimensional grid.
20
+ *
21
+ * @preview
22
+ * ```tsx editor
23
+ * import {Grid, makeScene2D} from '@twick/2d';
24
+ * import {all, createRef} from '@twick/core';
25
+ *
26
+ * export default makeScene2D(function* (view) {
27
+ * const grid = createRef<Grid>();
28
+ *
29
+ * view.add(
30
+ * <Grid
31
+ * ref={grid}
32
+ * width={'100%'}
33
+ * height={'100%'}
34
+ * stroke={'#666'}
35
+ * start={0}
36
+ * end={1}
37
+ * />,
38
+ * );
39
+ *
40
+ * yield* all(
41
+ * grid().end(0.5, 1).to(1, 1).wait(1),
42
+ * grid().start(0.5, 1).to(0, 1).wait(1),
43
+ * );
44
+ * });
45
+ * ```
46
+ */
47
+ export declare class Grid extends Shape {
48
+ /**
49
+ * The spacing between the grid lines.
50
+ */
51
+ readonly spacing: Vector2Signal<this>;
52
+ /**
53
+ * The percentage that should be clipped from the beginning of each grid line.
54
+ *
55
+ * @remarks
56
+ * The portion of each grid line that comes before the given percentage will
57
+ * be made invisible.
58
+ *
59
+ * This property is useful for animating the grid appearing on-screen.
60
+ */
61
+ readonly start: SimpleSignal<number, this>;
62
+ /**
63
+ * The percentage that should be clipped from the end of each grid line.
64
+ *
65
+ * @remarks
66
+ * The portion of each grid line that comes after the given percentage will
67
+ * be made invisible.
68
+ *
69
+ * This property is useful for animating the grid appearing on-screen.
70
+ */
71
+ readonly end: SimpleSignal<number, this>;
72
+ constructor(props: GridProps);
73
+ protected drawShape(context: CanvasRenderingContext2D): void;
74
+ private mapPoints;
75
+ }
76
+ //# sourceMappingURL=Grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/lib/components/Grid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,MAAM,WAAW,SAAU,SAAQ,UAAU;IAC3C;;OAEG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,eAAe,CAAC,CAAC;IACvC;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B;;OAEG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBACa,IAAK,SAAQ,KAAK;IAC7B;;OAEG;IACH,SAEwB,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAErD;;;;;;;;OAQG;IACH,SAEwB,KAAK,EAAE,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE1D;;;;;;;;OAQG;IACH,SAEwB,GAAG,EAAE,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBAErC,KAAK,EAAE,SAAS;cAIhB,SAAS,CAAC,OAAO,EAAE,wBAAwB;IA8B9D,OAAO,CAAC,SAAS;CAUlB"}
@@ -0,0 +1,91 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { map } from '@twick/core';
8
+ import { initial, nodeName, signal, vector2Signal } from '../decorators';
9
+ import { Shape } from './Shape';
10
+ /**
11
+ * A node for drawing a two-dimensional grid.
12
+ *
13
+ * @preview
14
+ * ```tsx editor
15
+ * import {Grid, makeScene2D} from '@twick/2d';
16
+ * import {all, createRef} from '@twick/core';
17
+ *
18
+ * export default makeScene2D(function* (view) {
19
+ * const grid = createRef<Grid>();
20
+ *
21
+ * view.add(
22
+ * <Grid
23
+ * ref={grid}
24
+ * width={'100%'}
25
+ * height={'100%'}
26
+ * stroke={'#666'}
27
+ * start={0}
28
+ * end={1}
29
+ * />,
30
+ * );
31
+ *
32
+ * yield* all(
33
+ * grid().end(0.5, 1).to(1, 1).wait(1),
34
+ * grid().start(0.5, 1).to(0, 1).wait(1),
35
+ * );
36
+ * });
37
+ * ```
38
+ */
39
+ let Grid = class Grid extends Shape {
40
+ constructor(props) {
41
+ super(props);
42
+ }
43
+ drawShape(context) {
44
+ context.save();
45
+ this.applyStyle(context);
46
+ this.drawRipple(context);
47
+ const spacing = this.spacing();
48
+ const size = this.computedSize().scale(0.5);
49
+ const steps = size.div(spacing).floored;
50
+ for (let x = -steps.x; x <= steps.x; x++) {
51
+ const [from, to] = this.mapPoints(-size.height, size.height);
52
+ context.beginPath();
53
+ context.moveTo(spacing.x * x, from);
54
+ context.lineTo(spacing.x * x, to);
55
+ context.stroke();
56
+ }
57
+ for (let y = -steps.y; y <= steps.y; y++) {
58
+ const [from, to] = this.mapPoints(-size.width, size.width);
59
+ context.beginPath();
60
+ context.moveTo(from, spacing.y * y);
61
+ context.lineTo(to, spacing.y * y);
62
+ context.stroke();
63
+ }
64
+ context.restore();
65
+ }
66
+ mapPoints(start, end) {
67
+ let from = map(start, end, this.start());
68
+ let to = map(start, end, this.end());
69
+ if (to < from) {
70
+ [from, to] = [to, from];
71
+ }
72
+ return [from, to];
73
+ }
74
+ };
75
+ __decorate([
76
+ initial(80),
77
+ vector2Signal('spacing')
78
+ ], Grid.prototype, "spacing", void 0);
79
+ __decorate([
80
+ initial(0),
81
+ signal()
82
+ ], Grid.prototype, "start", void 0);
83
+ __decorate([
84
+ initial(1),
85
+ signal()
86
+ ], Grid.prototype, "end", void 0);
87
+ Grid = __decorate([
88
+ nodeName('Grid')
89
+ ], Grid);
90
+ export { Grid };
91
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiR3JpZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9saWIvY29tcG9uZW50cy9HcmlkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQU1BLE9BQU8sRUFBQyxHQUFHLEVBQUMsTUFBTSxhQUFhLENBQUM7QUFDaEMsT0FBTyxFQUFDLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLGFBQWEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUV2RSxPQUFPLEVBQUMsS0FBSyxFQUFDLE1BQU0sU0FBUyxDQUFDO0FBaUI5Qjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQTRCRztBQUVJLElBQU0sSUFBSSxHQUFWLE1BQU0sSUFBSyxTQUFRLEtBQUs7SUFrQzdCLFlBQW1CLEtBQWdCO1FBQ2pDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUNmLENBQUM7SUFFa0IsU0FBUyxDQUFDLE9BQWlDO1FBQzVELE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUNmLElBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDekIsSUFBSSxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUV6QixNQUFNLE9BQU8sR0FBRyxJQUFJLEN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