@revideo/2d 0.10.0 → 0.10.1-alpha.1116

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 (289) hide show
  1. package/editor/editor/NodeInspectorConfig.d.ts +1 -1
  2. package/editor/editor/NodeInspectorConfig.d.ts.map +1 -1
  3. package/editor/editor/PreviewOverlayConfig.d.ts +1 -1
  4. package/editor/editor/PreviewOverlayConfig.d.ts.map +1 -1
  5. package/editor/editor/Provider.d.ts +3 -3
  6. package/editor/editor/Provider.d.ts.map +1 -1
  7. package/editor/editor/SceneGraphTabConfig.d.ts +1 -1
  8. package/editor/editor/SceneGraphTabConfig.d.ts.map +1 -1
  9. package/editor/editor/icons/IconMap.d.ts +1 -1
  10. package/editor/editor/icons/IconMap.d.ts.map +1 -1
  11. package/editor/editor/tree/NodeElement.d.ts +1 -1
  12. package/editor/editor/tree/NodeElement.d.ts.map +1 -1
  13. package/editor/editor/tree/TreeElement.d.ts +3 -3
  14. package/editor/editor/tree/TreeElement.d.ts.map +1 -1
  15. package/editor/editor/tree/TreeRoot.d.ts +1 -1
  16. package/editor/editor/tree/TreeRoot.d.ts.map +1 -1
  17. package/editor/editor/tsconfig.build.tsbuildinfo +1 -1
  18. package/editor/index.js +3 -2
  19. package/editor/index.js.map +1 -1
  20. package/lib/code/CodeCursor.d.ts +2 -2
  21. package/lib/code/CodeCursor.d.ts.map +1 -1
  22. package/lib/code/CodeCursor.js +2 -2
  23. package/lib/code/CodeDiffer.d.ts +2 -2
  24. package/lib/code/CodeDiffer.d.ts.map +1 -1
  25. package/lib/code/CodeDiffer.js +1 -1
  26. package/lib/code/CodeFragment.d.ts +1 -1
  27. package/lib/code/CodeFragment.d.ts.map +1 -1
  28. package/lib/code/CodeFragment.js +1 -1
  29. package/lib/code/CodeScope.d.ts +2 -2
  30. package/lib/code/CodeScope.d.ts.map +1 -1
  31. package/lib/code/CodeScope.js +1 -1
  32. package/lib/code/CodeSelection.d.ts +1 -1
  33. package/lib/code/CodeSelection.d.ts.map +1 -1
  34. package/lib/code/CodeSelection.js +2 -2
  35. package/lib/code/CodeSignal.d.ts +5 -4
  36. package/lib/code/CodeSignal.d.ts.map +1 -1
  37. package/lib/code/CodeSignal.js +2 -6
  38. package/lib/code/LezerHighlighter.d.ts +3 -3
  39. package/lib/code/LezerHighlighter.d.ts.map +1 -1
  40. package/lib/code/extractRange.d.ts +2 -2
  41. package/lib/code/extractRange.d.ts.map +1 -1
  42. package/lib/code/extractRange.js +1 -1
  43. package/lib/components/Audio.d.ts +2 -1
  44. package/lib/components/Audio.d.ts.map +1 -1
  45. package/lib/components/Audio.js +1 -1
  46. package/lib/components/Bezier.d.ts +5 -4
  47. package/lib/components/Bezier.d.ts.map +1 -1
  48. package/lib/components/Bezier.js +4 -3
  49. package/lib/components/Circle.d.ts +6 -4
  50. package/lib/components/Circle.d.ts.map +1 -1
  51. package/lib/components/Circle.js +2 -2
  52. package/lib/components/Code.d.ts +6 -4
  53. package/lib/components/Code.d.ts.map +1 -1
  54. package/lib/components/Code.js +1 -1
  55. package/lib/components/CodeBlock.d.ts +6 -4
  56. package/lib/components/CodeBlock.d.ts.map +1 -1
  57. package/lib/components/CodeBlock.js +2 -2
  58. package/lib/components/CubicBezier.d.ts +5 -4
  59. package/lib/components/CubicBezier.d.ts.map +1 -1
  60. package/lib/components/CubicBezier.js +1 -1
  61. package/lib/components/Curve.d.ts +8 -6
  62. package/lib/components/Curve.d.ts.map +1 -1
  63. package/lib/components/Curve.js +2 -2
  64. package/lib/components/Grid.d.ts +3 -2
  65. package/lib/components/Grid.d.ts.map +1 -1
  66. package/lib/components/Grid.js +2 -2
  67. package/lib/components/Icon.d.ts +3 -2
  68. package/lib/components/Icon.d.ts.map +1 -1
  69. package/lib/components/Icon.js +2 -2
  70. package/lib/components/Img.d.ts +5 -3
  71. package/lib/components/Img.d.ts.map +1 -1
  72. package/lib/components/Img.js +1 -1
  73. package/lib/components/Knot.d.ts +4 -3
  74. package/lib/components/Knot.d.ts.map +1 -1
  75. package/lib/components/Knot.js +4 -4
  76. package/lib/components/Latex.d.ts +4 -3
  77. package/lib/components/Latex.d.ts.map +1 -1
  78. package/lib/components/Latex.js +2 -2
  79. package/lib/components/Layout.d.ts +6 -4
  80. package/lib/components/Layout.d.ts.map +1 -1
  81. package/lib/components/Layout.js +11 -10
  82. package/lib/components/Line.d.ts +5 -3
  83. package/lib/components/Line.d.ts.map +1 -1
  84. package/lib/components/Line.js +6 -4
  85. package/lib/components/Media.d.ts +3 -2
  86. package/lib/components/Media.d.ts.map +1 -1
  87. package/lib/components/Media.js +1 -1
  88. package/lib/components/Node.d.ts +7 -6
  89. package/lib/components/Node.d.ts.map +1 -1
  90. package/lib/components/Node.js +10 -10
  91. package/lib/components/Path.d.ts +5 -3
  92. package/lib/components/Path.d.ts.map +1 -1
  93. package/lib/components/Path.js +4 -3
  94. package/lib/components/Polygon.d.ts +6 -4
  95. package/lib/components/Polygon.d.ts.map +1 -1
  96. package/lib/components/Polygon.js +2 -2
  97. package/lib/components/QuadBezier.d.ts +5 -4
  98. package/lib/components/QuadBezier.d.ts.map +1 -1
  99. package/lib/components/QuadBezier.js +1 -1
  100. package/lib/components/Ray.d.ts +5 -3
  101. package/lib/components/Ray.d.ts.map +1 -1
  102. package/lib/components/Ray.js +6 -5
  103. package/lib/components/Rect.d.ts +5 -3
  104. package/lib/components/Rect.d.ts.map +1 -1
  105. package/lib/components/Rect.js +2 -2
  106. package/lib/components/Rive.d.ts +3 -2
  107. package/lib/components/Rive.d.ts.map +1 -1
  108. package/lib/components/Rive.js +1 -1
  109. package/lib/components/SVG.d.ts +7 -4
  110. package/lib/components/SVG.d.ts.map +1 -1
  111. package/lib/components/SVG.js +1 -1
  112. package/lib/components/Shape.d.ts +5 -4
  113. package/lib/components/Shape.d.ts.map +1 -1
  114. package/lib/components/Shape.js +2 -2
  115. package/lib/components/Spline.d.ts +6 -4
  116. package/lib/components/Spline.d.ts.map +1 -1
  117. package/lib/components/Spline.js +5 -4
  118. package/lib/components/Txt.d.ts +5 -4
  119. package/lib/components/Txt.d.ts.map +1 -1
  120. package/lib/components/Txt.js +2 -2
  121. package/lib/components/TxtLeaf.d.ts +5 -4
  122. package/lib/components/TxtLeaf.d.ts.map +1 -1
  123. package/lib/components/TxtLeaf.js +12 -4
  124. package/lib/components/Video.d.ts +4 -3
  125. package/lib/components/Video.d.ts.map +1 -1
  126. package/lib/components/Video.js +2 -2
  127. package/lib/components/View2D.d.ts +4 -2
  128. package/lib/components/View2D.d.ts.map +1 -1
  129. package/lib/components/View2D.js +1 -1
  130. package/lib/curves/ArcSegment.d.ts +1 -1
  131. package/lib/curves/ArcSegment.d.ts.map +1 -1
  132. package/lib/curves/ArcSegment.js +10 -14
  133. package/lib/curves/CircleSegment.d.ts +1 -1
  134. package/lib/curves/CircleSegment.d.ts.map +1 -1
  135. package/lib/curves/CurveDrawingInfo.d.ts +1 -1
  136. package/lib/curves/CurveDrawingInfo.d.ts.map +1 -1
  137. package/lib/curves/CurveProfile.d.ts +1 -1
  138. package/lib/curves/CurveProfile.d.ts.map +1 -1
  139. package/lib/curves/KnotInfo.d.ts +1 -1
  140. package/lib/curves/KnotInfo.d.ts.map +1 -1
  141. package/lib/curves/LineSegment.d.ts +2 -2
  142. package/lib/curves/LineSegment.d.ts.map +1 -1
  143. package/lib/curves/PolynomialSegment.d.ts +3 -3
  144. package/lib/curves/PolynomialSegment.d.ts.map +1 -1
  145. package/lib/curves/PolynomialSegment.js +3 -2
  146. package/lib/curves/Segment.d.ts +2 -2
  147. package/lib/curves/Segment.d.ts.map +1 -1
  148. package/lib/curves/UniformPolynomialCurveSampler.d.ts +2 -2
  149. package/lib/curves/UniformPolynomialCurveSampler.d.ts.map +1 -1
  150. package/lib/curves/UniformPolynomialCurveSampler.js +1 -1
  151. package/lib/curves/createCurveProfileLerp.d.ts +1 -1
  152. package/lib/curves/createCurveProfileLerp.d.ts.map +1 -1
  153. package/lib/curves/getBezierSplineProfile.d.ts +2 -2
  154. package/lib/curves/getBezierSplineProfile.d.ts.map +1 -1
  155. package/lib/curves/getCircleProfile.d.ts +1 -1
  156. package/lib/curves/getCircleProfile.d.ts.map +1 -1
  157. package/lib/curves/getPathProfile.d.ts +1 -1
  158. package/lib/curves/getPathProfile.d.ts.map +1 -1
  159. package/lib/curves/getPathProfile.js +1 -1
  160. package/lib/curves/getPointAtDistance.d.ts +2 -2
  161. package/lib/curves/getPointAtDistance.d.ts.map +1 -1
  162. package/lib/curves/getPolylineProfile.d.ts +2 -2
  163. package/lib/curves/getPolylineProfile.d.ts.map +1 -1
  164. package/lib/curves/getPolylineProfile.js +1 -1
  165. package/lib/curves/getRectProfile.d.ts +2 -2
  166. package/lib/curves/getRectProfile.d.ts.map +1 -1
  167. package/lib/curves/getRectProfile.js +1 -1
  168. package/lib/decorators/canvasStyleSignal.d.ts +1 -1
  169. package/lib/decorators/canvasStyleSignal.d.ts.map +1 -1
  170. package/lib/decorators/canvasStyleSignal.js +1 -1
  171. package/lib/decorators/filtersSignal.d.ts +4 -2
  172. package/lib/decorators/filtersSignal.d.ts.map +1 -1
  173. package/lib/decorators/filtersSignal.js +1 -1
  174. package/lib/decorators/signal.d.ts +1 -1
  175. package/lib/decorators/signal.d.ts.map +1 -1
  176. package/lib/decorators/signal.js +2 -2
  177. package/lib/decorators/vector2Signal.d.ts +2 -1
  178. package/lib/decorators/vector2Signal.d.ts.map +1 -1
  179. package/lib/decorators/vector2Signal.js +1 -1
  180. package/lib/partials/Filter.d.ts +1 -1
  181. package/lib/partials/Filter.d.ts.map +1 -1
  182. package/lib/partials/Filter.js +2 -2
  183. package/lib/partials/Gradient.d.ts +1 -1
  184. package/lib/partials/Gradient.d.ts.map +1 -1
  185. package/lib/partials/Gradient.js +2 -2
  186. package/lib/partials/Pattern.d.ts +1 -1
  187. package/lib/partials/Pattern.d.ts.map +1 -1
  188. package/lib/partials/ShaderConfig.d.ts +2 -2
  189. package/lib/partials/ShaderConfig.d.ts.map +1 -1
  190. package/lib/partials/ShaderConfig.js +2 -2
  191. package/lib/partials/types.d.ts +1 -1
  192. package/lib/partials/types.d.ts.map +1 -1
  193. package/lib/scenes/Scene2D.d.ts +4 -2
  194. package/lib/scenes/Scene2D.d.ts.map +1 -1
  195. package/lib/scenes/Scene2D.js +3 -3
  196. package/lib/tsconfig.build.tsbuildinfo +1 -1
  197. package/lib/utils/CanvasUtils.d.ts +5 -3
  198. package/lib/utils/CanvasUtils.d.ts.map +1 -1
  199. package/lib/utils/CanvasUtils.js +1 -1
  200. package/lib/utils/makeSignalExtensions.d.ts +2 -2
  201. package/lib/utils/makeSignalExtensions.d.ts.map +1 -1
  202. package/lib/utils/makeSignalExtensions.js +1 -1
  203. package/lib/utils/video/parser/parser.d.ts.map +1 -1
  204. package/lib/utils/video/parser/parser.js +1 -1
  205. package/lib/utils/video/parser/sampler.d.ts +1 -1
  206. package/lib/utils/video/parser/sampler.d.ts.map +1 -1
  207. package/lib/utils/video/parser/segment.d.ts +1 -1
  208. package/lib/utils/video/parser/segment.d.ts.map +1 -1
  209. package/package.json +4 -4
  210. package/src/editor/NodeInspectorConfig.tsx +1 -1
  211. package/src/editor/PreviewOverlayConfig.tsx +6 -5
  212. package/src/editor/Provider.tsx +5 -9
  213. package/src/editor/SceneGraphTabConfig.tsx +1 -2
  214. package/src/editor/icons/IconMap.ts +1 -1
  215. package/src/editor/tree/NodeElement.tsx +2 -1
  216. package/src/editor/tree/TreeElement.tsx +3 -3
  217. package/src/editor/tree/TreeRoot.tsx +1 -1
  218. package/src/lib/code/CodeCursor.ts +10 -14
  219. package/src/lib/code/CodeDiffer.ts +3 -2
  220. package/src/lib/code/CodeFragment.ts +2 -1
  221. package/src/lib/code/CodeScope.ts +3 -2
  222. package/src/lib/code/CodeSelection.ts +2 -6
  223. package/src/lib/code/CodeSignal.ts +10 -18
  224. package/src/lib/code/LezerHighlighter.ts +3 -3
  225. package/src/lib/code/extractRange.ts +3 -2
  226. package/src/lib/components/Audio.ts +2 -1
  227. package/src/lib/components/Bezier.ts +7 -5
  228. package/src/lib/components/Circle.ts +7 -10
  229. package/src/lib/components/Code.ts +17 -12
  230. package/src/lib/components/CodeBlock.ts +8 -13
  231. package/src/lib/components/CubicBezier.ts +5 -4
  232. package/src/lib/components/Curve.ts +8 -8
  233. package/src/lib/components/Grid.ts +4 -3
  234. package/src/lib/components/Icon.ts +4 -3
  235. package/src/lib/components/Img.ts +9 -6
  236. package/src/lib/components/Knot.ts +7 -6
  237. package/src/lib/components/Latex.ts +5 -8
  238. package/src/lib/components/Layout.ts +28 -18
  239. package/src/lib/components/Line.ts +16 -9
  240. package/src/lib/components/Media.ts +3 -3
  241. package/src/lib/components/Node.ts +23 -15
  242. package/src/lib/components/Path.ts +12 -7
  243. package/src/lib/components/Polygon.ts +7 -10
  244. package/src/lib/components/QuadBezier.ts +5 -4
  245. package/src/lib/components/Ray.ts +10 -6
  246. package/src/lib/components/Rect.ts +5 -4
  247. package/src/lib/components/Rive.ts +6 -3
  248. package/src/lib/components/SVG.ts +20 -11
  249. package/src/lib/components/Shape.ts +6 -9
  250. package/src/lib/components/Spline.ts +14 -13
  251. package/src/lib/components/Txt.ts +6 -8
  252. package/src/lib/components/TxtLeaf.ts +14 -11
  253. package/src/lib/components/Video.ts +5 -10
  254. package/src/lib/components/View2D.ts +4 -2
  255. package/src/lib/components/__tests__/generatorTest.ts +3 -2
  256. package/src/lib/components/__tests__/mockScene2D.ts +2 -3
  257. package/src/lib/curves/ArcSegment.ts +25 -15
  258. package/src/lib/curves/CircleSegment.ts +1 -1
  259. package/src/lib/curves/CurveDrawingInfo.ts +1 -1
  260. package/src/lib/curves/CurveProfile.ts +1 -1
  261. package/src/lib/curves/KnotInfo.ts +1 -1
  262. package/src/lib/curves/LineSegment.ts +2 -2
  263. package/src/lib/curves/PolynomialSegment.ts +4 -4
  264. package/src/lib/curves/Segment.ts +2 -2
  265. package/src/lib/curves/UniformPolynomialCurveSampler.ts +4 -3
  266. package/src/lib/curves/createCurveProfileLerp.ts +1 -1
  267. package/src/lib/curves/getBezierSplineProfile.ts +3 -3
  268. package/src/lib/curves/getCircleProfile.ts +2 -2
  269. package/src/lib/curves/getPathProfile.ts +4 -3
  270. package/src/lib/curves/getPointAtDistance.ts +2 -2
  271. package/src/lib/curves/getPolylineProfile.ts +3 -2
  272. package/src/lib/curves/getRectProfile.ts +4 -3
  273. package/src/lib/decorators/canvasStyleSignal.ts +2 -1
  274. package/src/lib/decorators/defaultStyle.ts +1 -1
  275. package/src/lib/decorators/filtersSignal.ts +6 -3
  276. package/src/lib/decorators/signal.test.ts +2 -1
  277. package/src/lib/decorators/signal.ts +2 -5
  278. package/src/lib/decorators/vector2Signal.ts +2 -1
  279. package/src/lib/partials/Filter.ts +2 -7
  280. package/src/lib/partials/Gradient.ts +2 -3
  281. package/src/lib/partials/Pattern.ts +1 -1
  282. package/src/lib/partials/ShaderConfig.ts +3 -8
  283. package/src/lib/partials/types.ts +1 -1
  284. package/src/lib/scenes/Scene2D.ts +10 -5
  285. package/src/lib/utils/CanvasUtils.ts +4 -2
  286. package/src/lib/utils/makeSignalExtensions.ts +3 -2
  287. package/src/lib/utils/video/parser/parser.ts +2 -1
  288. package/src/lib/utils/video/parser/sampler.ts +1 -1
  289. package/src/lib/utils/video/parser/segment.ts +1 -1
@@ -1,19 +1,19 @@
1
- import {
1
+ import type {
2
2
  BBox,
3
3
  SerializedVector2,
4
4
  SignalValue,
5
5
  SimpleSignal,
6
- Vector2,
7
- clamp,
8
6
  } from '@revideo/core';
9
- import {CurveDrawingInfo} from '../curves/CurveDrawingInfo';
10
- import {CurvePoint} from '../curves/CurvePoint';
11
- import {CurveProfile} from '../curves/CurveProfile';
7
+ import {Vector2, clamp} from '@revideo/core';
8
+ import type {CurveDrawingInfo} from '../curves/CurveDrawingInfo';
9
+ import type {CurvePoint} from '../curves/CurvePoint';
10
+ import type {CurveProfile} from '../curves/CurveProfile';
12
11
  import {getPointAtDistance} from '../curves/getPointAtDistance';
13
12
  import {computed, initial, nodeName, signal} from '../decorators';
14
- import {DesiredLength} from '../partials';
13
+ import type {DesiredLength} from '../partials';
15
14
  import {lineTo, moveTo, resolveCanvasStyle} from '../utils';
16
- import {Shape, ShapeProps} from './Shape';
15
+ import type {ShapeProps} from './Shape';
16
+ import {Shape} from './Shape';
17
17
 
18
18
  export interface CurveProps extends ShapeProps {
19
19
  /**
@@ -1,12 +1,13 @@
1
- import {
1
+ import type {
2
2
  PossibleVector2,
3
3
  SignalValue,
4
4
  SimpleSignal,
5
5
  Vector2Signal,
6
- map,
7
6
  } from '@revideo/core';
7
+ import {map} from '@revideo/core';
8
8
  import {initial, nodeName, signal, vector2Signal} from '../decorators';
9
- import {Shape, ShapeProps} from './Shape';
9
+ import type {ShapeProps} from './Shape';
10
+ import {Shape} from './Shape';
10
11
 
11
12
  export interface GridProps extends ShapeProps {
12
13
  /**
@@ -1,12 +1,13 @@
1
- import {
1
+ import type {
2
2
  ColorSignal,
3
3
  PossibleColor,
4
4
  SignalValue,
5
5
  SimpleSignal,
6
- useLogger,
7
6
  } from '@revideo/core';
7
+ import {useLogger} from '@revideo/core';
8
8
  import {colorSignal, computed, initial, signal} from '../decorators';
9
- import {Img, ImgProps} from './Img';
9
+ import type {ImgProps} from './Img';
10
+ import {Img} from './Img';
10
11
 
11
12
  export interface IconProps extends ImgProps {
12
13
  /**
@@ -1,19 +1,22 @@
1
+ import type {
2
+ PossibleVector2,
3
+ SerializedVector2,
4
+ SignalValue,
5
+ SimpleSignal,
6
+ } from '@revideo/core';
1
7
  import {
2
8
  BBox,
3
9
  Color,
4
10
  DependencyContext,
5
11
  DetailedError,
6
- PossibleVector2,
7
- SerializedVector2,
8
- SignalValue,
9
- SimpleSignal,
10
12
  Vector2,
11
13
  useLogger,
12
14
  } from '@revideo/core';
13
15
  import {computed, initial, nodeName, signal} from '../decorators';
14
- import {DesiredLength} from '../partials';
16
+ import type {DesiredLength} from '../partials';
15
17
  import {drawImage} from '../utils';
16
- import {Rect, RectProps} from './Rect';
18
+ import type {RectProps} from './Rect';
19
+ import {Rect} from './Rect';
17
20
 
18
21
  const imageWithoutSource = `
19
22
  The image won't be visible unless you specify a source:
@@ -1,11 +1,11 @@
1
- import {
1
+ import type {
2
2
  PossibleVector2,
3
3
  Signal,
4
4
  SignalValue,
5
- Vector2,
6
5
  Vector2Signal,
7
6
  } from '@revideo/core';
8
- import {KnotInfo} from '../curves';
7
+ import {transformVectorAsPoint, Vector2} from '@revideo/core';
8
+ import type {KnotInfo} from '../curves';
9
9
  import {
10
10
  cloneable,
11
11
  compound,
@@ -15,7 +15,8 @@ import {
15
15
  signal,
16
16
  wrapper,
17
17
  } from '../decorators';
18
- import {Node, NodeProps} from './Node';
18
+ import type {NodeProps} from './Node';
19
+ import {Node} from './Node';
19
20
 
20
21
  export interface KnotProps extends NodeProps {
21
22
  /**
@@ -140,8 +141,8 @@ export class Knot extends Node {
140
141
 
141
142
  return {
142
143
  position: this.position(),
143
- startHandle: startHandle.transformAsPoint(this.localToParent()),
144
- endHandle: endHandle.transformAsPoint(this.localToParent()),
144
+ startHandle: transformVectorAsPoint(startHandle, this.localToParent()),
145
+ endHandle: transformVectorAsPoint(endHandle, this.localToParent()),
145
146
  auto: {start: this.startHandleAuto(), end: this.endHandleAuto()},
146
147
  };
147
148
  }
@@ -1,18 +1,15 @@
1
- import {
2
- DependencyContext,
3
- SignalValue,
4
- SimpleSignal,
5
- useLogger,
6
- } from '@revideo/core';
1
+ import type {SignalValue, SimpleSignal} from '@revideo/core';
2
+ import {DependencyContext, useLogger} from '@revideo/core';
7
3
  import {liteAdaptor} from 'mathjax-full/js/adaptors/liteAdaptor';
8
4
  import {RegisterHTMLHandler} from 'mathjax-full/js/handlers/html';
9
5
  import {TeX} from 'mathjax-full/js/input/tex';
10
6
  import {AllPackages} from 'mathjax-full/js/input/tex/AllPackages';
11
7
  import {mathjax} from 'mathjax-full/js/mathjax';
12
8
  import {SVG} from 'mathjax-full/js/output/svg';
13
- import {OptionList} from 'mathjax-full/js/util/Options';
9
+ import type {OptionList} from 'mathjax-full/js/util/Options';
14
10
  import {initial, signal} from '../decorators';
15
- import {Img, ImgProps} from './Img';
11
+ import type {ImgProps} from './Img';
12
+ import {Img} from './Img';
16
13
 
17
14
  const Adaptor = liteAdaptor();
18
15
  RegisterHTMLHandler(Adaptor);
@@ -1,8 +1,5 @@
1
- import {
2
- BBox,
3
- DependencyContext,
1
+ import type {
4
2
  InterpolationFunction,
5
- Origin,
6
3
  PossibleSpacing,
7
4
  PossibleVector2,
8
5
  SerializedVector2,
@@ -13,16 +10,23 @@ import {
13
10
  SpacingSignal,
14
11
  ThreadGenerator,
15
12
  TimingFunction,
16
- Vector2,
17
13
  Vector2Signal,
14
+ } from '@revideo/core';
15
+ import {
16
+ BBox,
17
+ DependencyContext,
18
+ Origin,
19
+ Vector2,
18
20
  boolLerp,
19
21
  modify,
20
22
  originToOffset,
21
23
  threadable,
24
+ transformVector,
25
+ transformVectorAsPoint,
22
26
  tween,
23
27
  } from '@revideo/core';
28
+ import type {Vector2LengthSignal} from '../decorators';
24
29
  import {
25
- Vector2LengthSignal,
26
30
  addInitializer,
27
31
  cloneable,
28
32
  computed,
@@ -35,7 +39,7 @@ import {
35
39
  vector2Signal,
36
40
  } from '../decorators';
37
41
  import {spacingSignal} from '../decorators/spacingSignal';
38
- import {
42
+ import type {
39
43
  DesiredLength,
40
44
  FlexBasis,
41
45
  FlexContent,
@@ -48,7 +52,8 @@ import {
48
52
  TextWrap,
49
53
  } from '../partials';
50
54
  import {drawLine, drawPivot, is} from '../utils';
51
- import {Node, NodeProps} from './Node';
55
+ import type {NodeProps} from './Node';
56
+ import {Node} from './Node';
52
57
 
53
58
  export interface LayoutProps extends NodeProps {
54
59
  layout?: LayoutMode;
@@ -843,7 +848,8 @@ export class Layout extends Node {
843
848
  matrix: DOMMatrix,
844
849
  ) {
845
850
  const size = this.computedSize();
846
- const offset = size.mul(this.offset()).scale(0.5).transformAsPoint(matrix);
851
+ const offsetVector = size.mul(this.offset()).scale(0.5);
852
+ const offset = transformVectorAsPoint(offsetVector, matrix);
847
853
  const box = BBox.fromSizeCentered(size);
848
854
  const layout = box.transformCorners(matrix);
849
855
  const padding = box
@@ -1038,7 +1044,10 @@ export class Layout extends Node {
1038
1044
  }
1039
1045
 
1040
1046
  public override hit(position: Vector2): Node | null {
1041
- const local = position.transformAsPoint(this.localToParent().inverse());
1047
+ const local = transformVectorAsPoint(
1048
+ position,
1049
+ this.localToParent().inverse(),
1050
+ );
1042
1051
  if (this.cacheBBox().includes(local)) {
1043
1052
  return super.hit(position) ?? this;
1044
1053
  }
@@ -1054,20 +1063,21 @@ function originSignal(origin: Origin): PropertyDecorator {
1054
1063
  const meta = getPropertyMeta<any>(target, key);
1055
1064
  meta!.parser = value => new Vector2(value);
1056
1065
  meta!.getter = function (this: Layout) {
1057
- return this.computedSize()
1058
- .getOriginOffset(origin)
1059
- .transformAsPoint(this.localToParent());
1066
+ const originOffset = this.computedSize().getOriginOffset(origin);
1067
+ return transformVectorAsPoint(originOffset, this.localToParent());
1060
1068
  };
1061
1069
  meta!.setter = function (
1062
1070
  this: Layout,
1063
1071
  value: SignalValue<PossibleVector2>,
1064
1072
  ) {
1065
1073
  this.position(
1066
- modify(value, unwrapped =>
1067
- this.getOriginDelta(origin)
1068
- .transform(this.scalingRotationMatrix())
1069
- .flipped.add(unwrapped),
1070
- ),
1074
+ modify(value, unwrapped => {
1075
+ const originDelta = this.getOriginDelta(origin);
1076
+ return transformVector(
1077
+ originDelta,
1078
+ this.scalingRotationMatrix(),
1079
+ ).flipped.add(unwrapped);
1080
+ }),
1071
1081
  );
1072
1082
  return this;
1073
1083
  };
@@ -1,18 +1,22 @@
1
- import {
2
- BBox,
3
- createSignal,
1
+ import type {
4
2
  PossibleVector2,
5
3
  SignalValue,
6
4
  SimpleSignal,
7
- threadable,
8
5
  ThreadGenerator,
9
6
  TimingFunction,
7
+ } from '@revideo/core';
8
+ import {
9
+ BBox,
10
+ createSignal,
11
+ threadable,
12
+ transformVectorAsPoint,
10
13
  tween,
11
14
  unwrap,
12
15
  useLogger,
13
16
  Vector2,
14
17
  } from '@revideo/core';
15
- import {CurveProfile, getPolylineProfile} from '../curves';
18
+ import type {CurveProfile} from '../curves';
19
+ import {getPolylineProfile} from '../curves';
16
20
  import {
17
21
  calculateLerpDistance,
18
22
  polygonLength,
@@ -20,7 +24,8 @@ import {
20
24
  } from '../curves/createCurveProfileLerp';
21
25
  import {computed, initial, nodeName, signal} from '../decorators';
22
26
  import {arc, drawLine, drawPivot, lineTo, moveTo} from '../utils';
23
- import {Curve, CurveProps} from './Curve';
27
+ import type {CurveProps} from './Curve';
28
+ import {Curve} from './Curve';
24
29
  import {Layout} from './Layout';
25
30
 
26
31
  const lineWithoutPoints = `
@@ -379,15 +384,17 @@ export class Line extends Curve {
379
384
  ) {
380
385
  const box = this.childrenBBox().transformCorners(matrix);
381
386
  const size = this.computedSize();
382
- const offset = size.mul(this.offset()).scale(0.5).transformAsPoint(matrix);
387
+ const offsetVector = size.mul(this.offset()).scale(0.5);
388
+ const offset = transformVectorAsPoint(offsetVector, matrix);
383
389
 
384
390
  context.fillStyle = 'white';
385
391
  context.strokeStyle = 'black';
386
392
  context.lineWidth = 1;
387
393
 
388
394
  const path = new Path2D();
389
- const points = (this.tweenedPoints() ?? this.parsedPoints()).map(point =>
390
- point.transformAsPoint(matrix),
395
+ const pointsPreTransformation = this.tweenedPoints() ?? this.parsedPoints();
396
+ const points = pointsPreTransformation.map(p =>
397
+ transformVectorAsPoint(p, matrix),
391
398
  );
392
399
  if (points.length > 0) {
393
400
  moveTo(path, points[0]);
@@ -1,15 +1,15 @@
1
+ import type {SignalValue, SimpleSignal} from '@revideo/core';
1
2
  import {
2
3
  DependencyContext,
3
4
  PlaybackState,
4
- SignalValue,
5
- SimpleSignal,
6
5
  clamp,
7
6
  isReactive,
8
7
  useLogger,
9
8
  useThread,
10
9
  } from '@revideo/core';
11
10
  import {computed, initial, nodeName, signal} from '../decorators';
12
- import {Rect, RectProps} from './Rect';
11
+ import type {RectProps} from './Rect';
12
+ import {Rect} from './Rect';
13
13
 
14
14
  export interface MediaProps extends RectProps {
15
15
  src?: SignalValue<string>;
@@ -1,7 +1,5 @@
1
- import {
2
- BBox,
1
+ import type {
3
2
  ColorSignal,
4
- DependencyContext,
5
3
  PossibleColor,
6
4
  PossibleSpacing,
7
5
  PossibleVector2,
@@ -14,11 +12,15 @@ import {
14
12
  SpacingSignal,
15
13
  ThreadGenerator,
16
14
  TimingFunction,
15
+ Vector2Signal,
16
+ } from '@revideo/core';
17
+ import {
18
+ BBox,
19
+ DependencyContext,
17
20
  UNIFORM_DESTINATION_MATRIX,
18
21
  UNIFORM_SOURCE_MATRIX,
19
22
  UNIFORM_TIME,
20
23
  Vector2,
21
- Vector2Signal,
22
24
  all,
23
25
  clamp,
24
26
  createSignal,
@@ -28,6 +30,8 @@ import {
28
30
  threadable,
29
31
  transformAngle,
30
32
  transformScalar,
33
+ transformVector,
34
+ transformVectorAsPoint,
31
35
  unwrap,
32
36
  useLogger,
33
37
  } from '@revideo/core';
@@ -46,14 +50,15 @@ import {
46
50
  vector2Signal,
47
51
  wrapper,
48
52
  } from '../decorators';
49
- import {FiltersSignal, filtersSignal} from '../decorators/filtersSignal';
53
+ import type {FiltersSignal} from '../decorators/filtersSignal';
54
+ import {filtersSignal} from '../decorators/filtersSignal';
50
55
  import {spacingSignal} from '../decorators/spacingSignal';
51
- import {Filter} from '../partials';
52
- import {
56
+ import type {Filter} from '../partials';
57
+ import type {
53
58
  PossibleShaderConfig,
54
59
  ShaderConfig,
55
- parseShader,
56
60
  } from '../partials/ShaderConfig';
61
+ import {parseShader} from '../partials/ShaderConfig';
57
62
  import {useScene2D} from '../scenes/useScene2D';
58
63
  import {drawLine} from '../utils';
59
64
  import type {View2D} from './View2D';
@@ -198,7 +203,7 @@ export class Node implements Promisable<Node> {
198
203
  protected setAbsolutePosition(value: SignalValue<PossibleVector2>) {
199
204
  this.position(
200
205
  modify(value, unwrapped =>
201
- new Vector2(unwrapped).transformAsPoint(this.worldToParent()),
206
+ transformVectorAsPoint(new Vector2(unwrapped), this.worldToParent()),
202
207
  ),
203
208
  );
204
209
  }
@@ -557,7 +562,7 @@ export class Node implements Promisable<Node> {
557
562
  * of the node:
558
563
  * ```ts
559
564
  * const local = new Vector2(0, 200);
560
- * const world = local.transformAsPoint(node.localToWorld());
565
+ * const world = transformVectorAsPoint(local, node.localToWorld());
561
566
  * ```
562
567
  */
563
568
  @computed()
@@ -580,7 +585,7 @@ export class Node implements Promisable<Node> {
580
585
  * top-left corner of the screen:
581
586
  * ```ts
582
587
  * const world = new Vector2(0, 0);
583
- * const local = world.transformAsPoint(node.worldToLocal());
588
+ * const local = transformVectorAsPoint(world, node.worldToLocal());
584
589
  * ```
585
590
  */
586
591
  @computed()
@@ -1404,7 +1409,7 @@ export class Node implements Promisable<Node> {
1404
1409
  const childCache = child.fullCacheBBox();
1405
1410
  const childMatrix = child.localToParent();
1406
1411
  points.push(
1407
- ...childCache.corners.map(r => r.transformAsPoint(childMatrix)),
1412
+ ...childCache.corners.map(r => transformVectorAsPoint(r, childMatrix)),
1408
1413
  );
1409
1414
  }
1410
1415
 
@@ -1422,7 +1427,7 @@ export class Node implements Promisable<Node> {
1422
1427
  @computed()
1423
1428
  protected fullCacheBBox(): BBox {
1424
1429
  const matrix = this.compositeToLocal();
1425
- const shadowOffset = this.shadowOffset().transform(matrix);
1430
+ const shadowOffset = transformVector(this.shadowOffset(), matrix);
1426
1431
  const shadowBlur = transformScalar(this.shadowBlur(), matrix);
1427
1432
 
1428
1433
  const result = this.cacheBBox().expand(
@@ -1496,7 +1501,7 @@ export class Node implements Promisable<Node> {
1496
1501
  }
1497
1502
  if (this.hasShadow()) {
1498
1503
  const matrix = this.compositeToWorld();
1499
- const offset = this.shadowOffset().transform(matrix);
1504
+ const offset = transformVector(this.shadowOffset(), matrix);
1500
1505
  const blur = transformScalar(this.shadowBlur(), matrix);
1501
1506
 
1502
1507
  context.shadowColor = this.shadowColor().serialize();
@@ -1731,7 +1736,10 @@ export class Node implements Promisable<Node> {
1731
1736
  */
1732
1737
  public hit(position: Vector2): Node | null {
1733
1738
  let hit: Node | null = null;
1734
- const local = position.transformAsPoint(this.localToParent().inverse());
1739
+ const local = transformVectorAsPoint(
1740
+ position,
1741
+ this.localToParent().inverse(),
1742
+ );
1735
1743
  const children = this.children();
1736
1744
  for (let i = children.length - 1; i >= 0; i--) {
1737
1745
  hit = children[i].hit(local);
@@ -1,20 +1,24 @@
1
+ import type {
2
+ SignalValue,
3
+ SimpleSignal,
4
+ TimingFunction,
5
+ Vector2,
6
+ } from '@revideo/core';
1
7
  import {
2
8
  BBox,
3
9
  createSignal,
4
10
  isReactive,
5
- SignalValue,
6
- SimpleSignal,
7
11
  threadable,
8
- TimingFunction,
12
+ transformVectorAsPoint,
9
13
  tween,
10
- Vector2,
11
14
  } from '@revideo/core';
12
- import {CurveProfile} from '../curves';
15
+ import type {CurveProfile} from '../curves';
13
16
  import {createCurveProfileLerp} from '../curves/createCurveProfileLerp';
14
17
  import {getPathProfile} from '../curves/getPathProfile';
15
18
  import {computed, signal} from '../decorators';
16
19
  import {drawLine, drawPivot} from '../utils';
17
- import {Curve, CurveProps} from './Curve';
20
+ import type {CurveProps} from './Curve';
21
+ import {Curve} from './Curve';
18
22
 
19
23
  export interface PathProps extends CurveProps {
20
24
  data: SignalValue<string>;
@@ -96,7 +100,8 @@ export class Path extends Curve {
96
100
  ): void {
97
101
  const box = this.childrenBBox().transformCorners(matrix);
98
102
  const size = this.computedSize();
99
- const offset = size.mul(this.offset()).scale(0.5).transformAsPoint(matrix);
103
+ const offsetVector = size.mul(this.offset()).scale(0.5);
104
+ const offset = transformVectorAsPoint(offsetVector, matrix);
100
105
  const segments = this.profile().segments;
101
106
 
102
107
  context.lineWidth = 1;
@@ -1,15 +1,12 @@
1
- import {
2
- BBox,
3
- SerializedVector2,
4
- SignalValue,
5
- SimpleSignal,
6
- Vector2,
7
- } from '@revideo/core';
8
- import {CurveProfile, getPolylineProfile} from '../curves';
1
+ import type {SerializedVector2, SignalValue, SimpleSignal} from '@revideo/core';
2
+ import {BBox, Vector2} from '@revideo/core';
3
+ import type {CurveProfile} from '../curves';
4
+ import {getPolylineProfile} from '../curves';
9
5
  import {computed, initial, signal} from '../decorators';
10
- import {DesiredLength} from '../partials';
6
+ import type {DesiredLength} from '../partials';
11
7
  import {drawPolygon} from '../utils';
12
- import {Curve, CurveProps} from './Curve';
8
+ import type {CurveProps} from './Curve';
9
+ import {Curve} from './Curve';
13
10
 
14
11
  export interface PolygonProps extends CurveProps {
15
12
  /**
@@ -1,10 +1,11 @@
1
- import {PossibleVector2, SignalValue, Vector2Signal} from '@revideo/core';
1
+ import type {PossibleVector2, SignalValue, Vector2Signal} from '@revideo/core';
2
2
  import {QuadBezierSegment} from '../curves';
3
- import {PolynomialSegment} from '../curves/PolynomialSegment';
3
+ import type {PolynomialSegment} from '../curves/PolynomialSegment';
4
4
  import {computed, vector2Signal} from '../decorators';
5
5
  import {lineTo, moveTo, quadraticCurveTo} from '../utils';
6
- import {Bezier, BezierOverlayInfo} from './Bezier';
7
- import {CurveProps} from './Curve';
6
+ import type {BezierOverlayInfo} from './Bezier';
7
+ import {Bezier} from './Bezier';
8
+ import type {CurveProps} from './Curve';
8
9
 
9
10
  export interface QuadBezierProps extends CurveProps {
10
11
  p0?: SignalValue<PossibleVector2>;
@@ -1,8 +1,11 @@
1
- import {BBox, PossibleVector2, SignalValue, Vector2Signal} from '@revideo/core';
2
- import {CurveProfile, LineSegment} from '../curves';
1
+ import type {PossibleVector2, SignalValue, Vector2Signal} from '@revideo/core';
2
+ import {BBox, transformVectorAsPoint} from '@revideo/core';
3
+ import type {CurveProfile} from '../curves';
4
+ import {LineSegment} from '../curves';
3
5
  import {nodeName, vector2Signal} from '../decorators';
4
6
  import {arc, drawLine, drawPivot} from '../utils';
5
- import {Curve, CurveProps} from './Curve';
7
+ import type {CurveProps} from './Curve';
8
+ import {Curve} from './Curve';
6
9
 
7
10
  export interface RayProps extends CurveProps {
8
11
  /**
@@ -86,9 +89,10 @@ export class Ray extends Curve {
86
89
  ) {
87
90
  const box = this.childrenBBox().transformCorners(matrix);
88
91
  const size = this.computedSize();
89
- const offset = size.mul(this.offset()).scale(0.5).transformAsPoint(matrix);
90
- const from = this.from().transformAsPoint(matrix);
91
- const to = this.to().transformAsPoint(matrix);
92
+ const offsetVector = size.mul(this.offset()).scale(0.5);
93
+ const offset = transformVectorAsPoint(offsetVector, matrix);
94
+ const from = transformVectorAsPoint(this.from(), matrix);
95
+ const to = transformVectorAsPoint(this.to(), matrix);
92
96
 
93
97
  context.fillStyle = 'white';
94
98
  context.strokeStyle = 'black';
@@ -1,17 +1,18 @@
1
- import {
2
- BBox,
1
+ import type {
3
2
  PossibleSpacing,
4
3
  SerializedVector2,
5
4
  SignalValue,
6
5
  SimpleSignal,
7
6
  SpacingSignal,
8
7
  } from '@revideo/core';
8
+ import {BBox} from '@revideo/core';
9
9
  import {getRectProfile} from '../curves/getRectProfile';
10
10
  import {computed, initial, nodeName, signal} from '../decorators';
11
11
  import {spacingSignal} from '../decorators/spacingSignal';
12
- import {DesiredLength} from '../partials';
12
+ import type {DesiredLength} from '../partials';
13
13
  import {drawRoundRect} from '../utils';
14
- import {Curve, CurveProps} from './Curve';
14
+ import type {CurveProps} from './Curve';
15
+ import {Curve} from './Curve';
15
16
 
16
17
  export interface RectProps extends CurveProps {
17
18
  /**
@@ -1,13 +1,16 @@
1
- import {BBox, SignalValue, SimpleSignal, useThread} from '@revideo/core';
2
- import RiveInitializer, {
1
+ import type {SignalValue, SimpleSignal} from '@revideo/core';
2
+ import {BBox, useThread} from '@revideo/core';
3
+ import type {
3
4
  Artboard,
4
5
  File,
5
6
  LinearAnimationInstance,
6
7
  Renderer,
7
8
  RiveCanvas,
8
9
  } from '@rive-app/canvas-advanced';
10
+ import RiveInitializer from '@rive-app/canvas-advanced';
9
11
  import {computed, initial, nodeName, signal} from '../decorators';
10
- import {Rect, RectProps} from './Rect';
12
+ import type {RectProps} from './Rect';
13
+ import {Rect} from './Rect';
11
14
 
12
15
  export interface RiveProps extends RectProps {
13
16
  src?: SignalValue<string>;
@@ -1,12 +1,14 @@
1
- import {
2
- BBox,
3
- Matrix2D,
1
+ import type {
4
2
  PossibleSpacing,
5
3
  SerializedVector2,
6
4
  SignalValue,
7
5
  SimpleSignal,
8
6
  ThreadGenerator,
9
7
  TimingFunction,
8
+ } from '@revideo/core';
9
+ import {
10
+ BBox,
11
+ Matrix2D,
10
12
  Vector2,
11
13
  all,
12
14
  clampRemap,
@@ -19,16 +21,23 @@ import {
19
21
  useLogger,
20
22
  } from '@revideo/core';
21
23
  import {computed, signal} from '../decorators';
22
- import {DesiredLength, PossibleCanvasStyle} from '../partials';
24
+ import type {DesiredLength, PossibleCanvasStyle} from '../partials';
23
25
  import {applyTransformDiff, getTransformDiff} from '../utils/diff';
24
- import {Circle, CircleProps} from './Circle';
25
- import {Img, ImgProps} from './Img';
26
+ import type {CircleProps} from './Circle';
27
+ import {Circle} from './Circle';
28
+ import type {ImgProps} from './Img';
29
+ import {Img} from './Img';
26
30
  import {Layout} from './Layout';
27
- import {Line, LineProps} from './Line';
28
- import {Node, NodeProps} from './Node';
29
- import {Path, PathProps} from './Path';
30
- import {Rect, RectProps} from './Rect';
31
- import {Shape, ShapeProps} from './Shape';
31
+ import type {LineProps} from './Line';
32
+ import {Line} from './Line';
33
+ import type {NodeProps} from './Node';
34
+ import {Node} from './Node';
35
+ import type {PathProps} from './Path';
36
+ import {Path} from './Path';
37
+ import type {RectProps} from './Rect';
38
+ import {Rect} from './Rect';
39
+ import type {ShapeProps} from './Shape';
40
+ import {Shape} from './Shape';
32
41
  import {View2D} from './View2D';
33
42
 
34
43
  /**