@motionscript/core 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (615) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +2 -4
  3. package/dist/assets/errors.js +4 -5
  4. package/dist/assets/errors.js.map +1 -1
  5. package/dist/assets/scope.d.ts +1 -1
  6. package/dist/assets/scope.d.ts.map +1 -1
  7. package/dist/assets/scope.js +1 -1
  8. package/dist/assets/scope.js.map +1 -1
  9. package/dist/attributes/audio/schedule.d.ts +3 -18
  10. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  11. package/dist/attributes/audio/schedule.js.map +1 -1
  12. package/dist/attributes/index.d.ts +3 -5
  13. package/dist/attributes/index.d.ts.map +1 -1
  14. package/dist/attributes/index.js +2 -2
  15. package/dist/attributes/index.js.map +1 -1
  16. package/dist/attributes/layout/insets.d.ts +1 -1
  17. package/dist/attributes/layout/insets.js.map +1 -1
  18. package/dist/attributes/layout/size.d.ts +1 -1
  19. package/dist/attributes/layout/size.js +1 -1
  20. package/dist/attributes/layout/size.js.map +1 -1
  21. package/dist/attributes/properties/decorator.d.ts +44 -11
  22. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  23. package/dist/attributes/properties/decorator.js +37 -9
  24. package/dist/attributes/properties/decorator.js.map +1 -1
  25. package/dist/attributes/properties/inputs.d.ts +1 -1
  26. package/dist/attributes/properties/inputs.js +1 -1
  27. package/dist/attributes/properties/inputs.js.map +1 -1
  28. package/dist/attributes/properties/typed.d.ts +19 -140
  29. package/dist/attributes/properties/typed.d.ts.map +1 -1
  30. package/dist/attributes/properties/typed.js +12 -108
  31. package/dist/attributes/properties/typed.js.map +1 -1
  32. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
  33. package/dist/attributes/shape/corners/corner-radius.js +1 -1
  34. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  35. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
  36. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  37. package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
  38. package/dist/attributes/shape/fill/color/parser.js +1 -1
  39. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  40. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
  41. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  42. package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
  43. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  44. package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
  45. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  46. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  47. package/dist/attributes/shape/fill/lerp.d.ts +1 -1
  48. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  49. package/dist/attributes/shape/filters/chain.d.ts +1 -1
  50. package/dist/attributes/shape/filters/chain.js +1 -1
  51. package/dist/attributes/shape/filters/chain.js.map +1 -1
  52. package/dist/attributes/shape/filters/union.d.ts +4 -3
  53. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  54. package/dist/attributes/shape/filters/union.js.map +1 -1
  55. package/dist/attributes/shape/path/ops.d.ts +1 -2
  56. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  57. package/dist/attributes/shape/path/ops.js.map +1 -1
  58. package/dist/attributes/shared/operators.d.ts +2 -2
  59. package/dist/attributes/shared/operators.js.map +1 -1
  60. package/dist/attributes/text/types.d.ts +2 -3
  61. package/dist/attributes/text/types.d.ts.map +1 -1
  62. package/dist/attributes/text/types.js.map +1 -1
  63. package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
  64. package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
  65. package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
  66. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +7 -0
  67. package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
  68. package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
  69. package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
  70. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
  71. package/dist/browser/component.js +1 -1
  72. package/dist/browser/component.js.map +4 -4
  73. package/dist/browser/experimental.js +2 -0
  74. package/dist/browser/index.js +1 -1
  75. package/dist/browser/index.js.map +4 -4
  76. package/dist/browser/manifest.json +3 -4
  77. package/dist/browser/sdk.js +1 -1
  78. package/dist/component/api.d.ts +508 -0
  79. package/dist/component/api.d.ts.map +1 -0
  80. package/dist/component/api.js +4 -0
  81. package/dist/component/api.js.map +1 -0
  82. package/dist/component/builtins/audio.d.ts +26 -0
  83. package/dist/component/builtins/audio.d.ts.map +1 -0
  84. package/dist/component/builtins/audio.js +41 -0
  85. package/dist/component/builtins/audio.js.map +1 -0
  86. package/dist/component/builtins/canvas3d.d.ts +98 -0
  87. package/dist/component/builtins/canvas3d.d.ts.map +1 -0
  88. package/dist/component/builtins/canvas3d.js +21 -0
  89. package/dist/component/builtins/canvas3d.js.map +1 -0
  90. package/dist/component/builtins/composite.d.ts +56 -0
  91. package/dist/component/builtins/composite.d.ts.map +1 -0
  92. package/dist/component/builtins/composite.js +25 -0
  93. package/dist/component/builtins/composite.js.map +1 -0
  94. package/dist/component/builtins/geometry.d.ts +505 -0
  95. package/dist/component/builtins/geometry.d.ts.map +1 -0
  96. package/dist/component/builtins/geometry.js +107 -0
  97. package/dist/component/builtins/geometry.js.map +1 -0
  98. package/dist/component/builtins/layout.d.ts +88 -0
  99. package/dist/component/builtins/layout.d.ts.map +1 -0
  100. package/dist/component/builtins/layout.js +84 -0
  101. package/dist/component/builtins/layout.js.map +1 -0
  102. package/dist/component/builtins/media.d.ts +95 -0
  103. package/dist/component/builtins/media.d.ts.map +1 -0
  104. package/dist/component/builtins/media.js +149 -0
  105. package/dist/component/builtins/media.js.map +1 -0
  106. package/dist/component/builtins/providers.d.ts +23 -0
  107. package/dist/component/builtins/providers.d.ts.map +1 -0
  108. package/dist/component/builtins/providers.js +30 -0
  109. package/dist/component/builtins/providers.js.map +1 -0
  110. package/dist/component/builtins/text.d.ts +193 -0
  111. package/dist/component/builtins/text.d.ts.map +1 -0
  112. package/dist/component/builtins/text.js +113 -0
  113. package/dist/component/builtins/text.js.map +1 -0
  114. package/dist/component/builtins/three.d.ts +1085 -0
  115. package/dist/component/builtins/three.d.ts.map +1 -0
  116. package/dist/component/builtins/three.js +265 -0
  117. package/dist/component/builtins/three.js.map +1 -0
  118. package/dist/component/clip-of.d.ts +5 -0
  119. package/dist/component/clip-of.d.ts.map +1 -0
  120. package/dist/component/clip-of.js +33 -0
  121. package/dist/component/clip-of.js.map +1 -0
  122. package/dist/component/commands-for.d.ts +19 -0
  123. package/dist/component/commands-for.d.ts.map +1 -0
  124. package/dist/component/commands-for.js +5 -0
  125. package/dist/component/commands-for.js.map +1 -0
  126. package/dist/component/component-audio.d.ts +9 -0
  127. package/dist/component/component-audio.d.ts.map +1 -0
  128. package/dist/component/component-audio.js +18 -0
  129. package/dist/component/component-audio.js.map +1 -0
  130. package/dist/component/component2d.d.ts +9 -0
  131. package/dist/component/component2d.d.ts.map +1 -0
  132. package/dist/component/component2d.js +239 -0
  133. package/dist/component/component2d.js.map +1 -0
  134. package/dist/component/component3d.d.ts +9 -0
  135. package/dist/component/component3d.d.ts.map +1 -0
  136. package/dist/component/component3d.js +99 -0
  137. package/dist/component/component3d.js.map +1 -0
  138. package/dist/component/factory.d.ts +63 -0
  139. package/dist/component/factory.d.ts.map +1 -0
  140. package/dist/component/factory.js +313 -0
  141. package/dist/component/factory.js.map +1 -0
  142. package/dist/component/modules/aim.d.ts +30 -0
  143. package/dist/component/modules/aim.d.ts.map +1 -0
  144. package/dist/component/modules/aim.js +39 -0
  145. package/dist/component/modules/aim.js.map +1 -0
  146. package/dist/component/modules/corners.d.ts +13 -0
  147. package/dist/component/modules/corners.d.ts.map +1 -0
  148. package/dist/component/modules/corners.js +12 -0
  149. package/dist/component/modules/corners.js.map +1 -0
  150. package/dist/component/modules/flow.d.ts +26 -0
  151. package/dist/component/modules/flow.d.ts.map +1 -0
  152. package/dist/component/modules/flow.js +55 -0
  153. package/dist/component/modules/flow.js.map +1 -0
  154. package/dist/component/modules/material.d.ts +40 -0
  155. package/dist/component/modules/material.d.ts.map +1 -0
  156. package/dist/component/modules/material.js +75 -0
  157. package/dist/component/modules/material.js.map +1 -0
  158. package/dist/component/modules/paint.d.ts +71 -0
  159. package/dist/component/modules/paint.d.ts.map +1 -0
  160. package/dist/component/modules/paint.js +106 -0
  161. package/dist/component/modules/paint.js.map +1 -0
  162. package/dist/component/modules/shapes.d.ts +31 -0
  163. package/dist/component/modules/shapes.d.ts.map +1 -0
  164. package/dist/component/modules/shapes.js +43 -0
  165. package/dist/component/modules/shapes.js.map +1 -0
  166. package/dist/component/modules/text-layout.d.ts +26 -0
  167. package/dist/component/modules/text-layout.d.ts.map +1 -0
  168. package/dist/component/modules/text-layout.js +57 -0
  169. package/dist/component/modules/text-layout.js.map +1 -0
  170. package/dist/component/modules/text-style.d.ts +48 -0
  171. package/dist/component/modules/text-style.d.ts.map +1 -0
  172. package/dist/component/modules/text-style.js +63 -0
  173. package/dist/component/modules/text-style.js.map +1 -0
  174. package/dist/component/modules/three-entries.d.ts +23 -0
  175. package/dist/component/modules/three-entries.d.ts.map +1 -0
  176. package/dist/component/modules/three-entries.js +41 -0
  177. package/dist/component/modules/three-entries.js.map +1 -0
  178. package/dist/component/modules/view3d.d.ts +55 -0
  179. package/dist/component/modules/view3d.d.ts.map +1 -0
  180. package/dist/component/modules/view3d.js +160 -0
  181. package/dist/component/modules/view3d.js.map +1 -0
  182. package/dist/component/timeline.d.ts +22 -0
  183. package/dist/component/timeline.d.ts.map +1 -0
  184. package/dist/component/timeline.js +128 -0
  185. package/dist/component/timeline.js.map +1 -0
  186. package/dist/component/type-def.d.ts +26 -0
  187. package/dist/component/type-def.d.ts.map +1 -0
  188. package/dist/component/type-def.js +16 -0
  189. package/dist/component/type-def.js.map +1 -0
  190. package/dist/component/types.d.ts +91 -0
  191. package/dist/component/types.d.ts.map +1 -0
  192. package/dist/component/types.js +88 -0
  193. package/dist/component/types.js.map +1 -0
  194. package/dist/component/views.d.ts +121 -0
  195. package/dist/component/views.d.ts.map +1 -0
  196. package/dist/component/views.js +413 -0
  197. package/dist/component/views.js.map +1 -0
  198. package/dist/component.d.ts +10 -19
  199. package/dist/component.d.ts.map +1 -1
  200. package/dist/component.js +10 -19
  201. package/dist/component.js.map +1 -1
  202. package/dist/components/builtins/audio/audio.d.ts +53 -0
  203. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  204. package/dist/components/builtins/audio/audio.js +41 -0
  205. package/dist/components/builtins/audio/audio.js.map +1 -0
  206. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  207. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  208. package/dist/components/builtins/geometry/composite.js +25 -0
  209. package/dist/components/builtins/geometry/composite.js.map +1 -0
  210. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  211. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  212. package/dist/components/builtins/geometry/geometry.js +107 -0
  213. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  214. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  215. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  216. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  217. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  218. package/dist/components/builtins/layout/layout.d.ts +186 -0
  219. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  220. package/dist/components/builtins/layout/layout.js +84 -0
  221. package/dist/components/builtins/layout/layout.js.map +1 -0
  222. package/dist/components/builtins/media/media.d.ts +240 -0
  223. package/dist/components/builtins/media/media.d.ts.map +1 -0
  224. package/dist/components/builtins/media/media.js +149 -0
  225. package/dist/components/builtins/media/media.js.map +1 -0
  226. package/dist/components/builtins/providers/providers.d.ts +47 -0
  227. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  228. package/dist/components/builtins/providers/providers.js +30 -0
  229. package/dist/components/builtins/providers/providers.js.map +1 -0
  230. package/dist/components/builtins/text/number-format.d.ts +66 -0
  231. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  232. package/dist/components/builtins/text/number-format.js +227 -0
  233. package/dist/components/builtins/text/number-format.js.map +1 -0
  234. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  235. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  236. package/dist/components/builtins/text/number-pattern.js +77 -0
  237. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  238. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  239. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  240. package/dist/components/builtins/text/text-defaults.js +37 -0
  241. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  242. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  243. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  244. package/dist/components/builtins/text/text-layout.js +331 -0
  245. package/dist/components/builtins/text/text-layout.js.map +1 -0
  246. package/dist/components/builtins/text/text.d.ts +409 -0
  247. package/dist/components/builtins/text/text.d.ts.map +1 -0
  248. package/dist/components/builtins/text/text.js +113 -0
  249. package/dist/components/builtins/text/text.js.map +1 -0
  250. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  251. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  252. package/dist/components/builtins/three/canvas3d.js +21 -0
  253. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  254. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  255. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  256. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  257. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  258. package/dist/components/builtins/three/three.d.ts +1889 -0
  259. package/dist/components/builtins/three/three.d.ts.map +1 -0
  260. package/dist/components/builtins/three/three.js +305 -0
  261. package/dist/components/builtins/three/three.js.map +1 -0
  262. package/dist/components/factory/api.d.ts +516 -0
  263. package/dist/components/factory/api.d.ts.map +1 -0
  264. package/dist/components/factory/api.js +4 -0
  265. package/dist/components/factory/api.js.map +1 -0
  266. package/dist/components/factory/clip-of.d.ts +5 -0
  267. package/dist/components/factory/clip-of.d.ts.map +1 -0
  268. package/dist/components/factory/clip-of.js +33 -0
  269. package/dist/components/factory/clip-of.js.map +1 -0
  270. package/dist/components/factory/commands-for.d.ts +19 -0
  271. package/dist/components/factory/commands-for.d.ts.map +1 -0
  272. package/dist/components/factory/commands-for.js +5 -0
  273. package/dist/components/factory/commands-for.js.map +1 -0
  274. package/dist/components/factory/component-audio.d.ts +9 -0
  275. package/dist/components/factory/component-audio.d.ts.map +1 -0
  276. package/dist/components/factory/component-audio.js +18 -0
  277. package/dist/components/factory/component-audio.js.map +1 -0
  278. package/dist/components/factory/component2d.d.ts +8 -0
  279. package/dist/components/factory/component2d.d.ts.map +1 -0
  280. package/dist/components/factory/component2d.js +240 -0
  281. package/dist/components/factory/component2d.js.map +1 -0
  282. package/dist/components/factory/component3d.d.ts +9 -0
  283. package/dist/components/factory/component3d.d.ts.map +1 -0
  284. package/dist/components/factory/component3d.js +99 -0
  285. package/dist/components/factory/component3d.js.map +1 -0
  286. package/dist/components/factory/factory.d.ts +63 -0
  287. package/dist/components/factory/factory.d.ts.map +1 -0
  288. package/dist/components/factory/factory.js +313 -0
  289. package/dist/components/factory/factory.js.map +1 -0
  290. package/dist/components/factory/timeline.d.ts +22 -0
  291. package/dist/components/factory/timeline.d.ts.map +1 -0
  292. package/dist/components/factory/timeline.js +128 -0
  293. package/dist/components/factory/timeline.js.map +1 -0
  294. package/dist/components/factory/type-def.d.ts +26 -0
  295. package/dist/components/factory/type-def.d.ts.map +1 -0
  296. package/dist/components/factory/type-def.js +16 -0
  297. package/dist/components/factory/type-def.js.map +1 -0
  298. package/dist/components/factory/types.d.ts +91 -0
  299. package/dist/components/factory/types.d.ts.map +1 -0
  300. package/dist/components/factory/types.js +88 -0
  301. package/dist/components/factory/types.js.map +1 -0
  302. package/dist/components/factory/views.d.ts +121 -0
  303. package/dist/components/factory/views.d.ts.map +1 -0
  304. package/dist/components/factory/views.js +413 -0
  305. package/dist/components/factory/views.js.map +1 -0
  306. package/dist/components/modules/aim.d.ts +30 -0
  307. package/dist/components/modules/aim.d.ts.map +1 -0
  308. package/dist/components/modules/aim.js +39 -0
  309. package/dist/components/modules/aim.js.map +1 -0
  310. package/dist/components/modules/corners.d.ts +13 -0
  311. package/dist/components/modules/corners.d.ts.map +1 -0
  312. package/dist/components/modules/corners.js +12 -0
  313. package/dist/components/modules/corners.js.map +1 -0
  314. package/dist/components/modules/flow.d.ts +26 -0
  315. package/dist/components/modules/flow.d.ts.map +1 -0
  316. package/dist/components/modules/flow.js +57 -0
  317. package/dist/components/modules/flow.js.map +1 -0
  318. package/dist/components/modules/material.d.ts +40 -0
  319. package/dist/components/modules/material.d.ts.map +1 -0
  320. package/dist/components/modules/material.js +75 -0
  321. package/dist/components/modules/material.js.map +1 -0
  322. package/dist/components/modules/paint.d.ts +71 -0
  323. package/dist/components/modules/paint.d.ts.map +1 -0
  324. package/dist/components/modules/paint.js +106 -0
  325. package/dist/components/modules/paint.js.map +1 -0
  326. package/dist/components/modules/shapes.d.ts +31 -0
  327. package/dist/components/modules/shapes.d.ts.map +1 -0
  328. package/dist/components/modules/shapes.js +43 -0
  329. package/dist/components/modules/shapes.js.map +1 -0
  330. package/dist/components/modules/text-layout.d.ts +26 -0
  331. package/dist/components/modules/text-layout.d.ts.map +1 -0
  332. package/dist/components/modules/text-layout.js +57 -0
  333. package/dist/components/modules/text-layout.js.map +1 -0
  334. package/dist/components/modules/text-style.d.ts +48 -0
  335. package/dist/components/modules/text-style.d.ts.map +1 -0
  336. package/dist/components/modules/text-style.js +63 -0
  337. package/dist/components/modules/text-style.js.map +1 -0
  338. package/dist/components/modules/three-entries.d.ts +23 -0
  339. package/dist/components/modules/three-entries.d.ts.map +1 -0
  340. package/dist/components/modules/three-entries.js +41 -0
  341. package/dist/components/modules/three-entries.js.map +1 -0
  342. package/dist/components/modules/view3d.d.ts +59 -0
  343. package/dist/components/modules/view3d.d.ts.map +1 -0
  344. package/dist/components/modules/view3d.js +171 -0
  345. package/dist/components/modules/view3d.js.map +1 -0
  346. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  347. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  348. package/dist/components/trees/2d/group-bounds.js +87 -0
  349. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  350. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  351. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  352. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  353. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  354. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  355. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  356. package/dist/components/trees/2d/node-motion.js +86 -0
  357. package/dist/components/trees/2d/node-motion.js.map +1 -0
  358. package/dist/components/trees/2d/node-render.d.ts +36 -0
  359. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  360. package/dist/components/trees/2d/node-render.js +67 -0
  361. package/dist/components/trees/2d/node-render.js.map +1 -0
  362. package/dist/components/trees/2d/node-space.d.ts +63 -0
  363. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  364. package/dist/components/trees/2d/node-space.js +131 -0
  365. package/dist/components/trees/2d/node-space.js.map +1 -0
  366. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  367. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  368. package/dist/components/trees/2d/node-transform.js +73 -0
  369. package/dist/components/trees/2d/node-transform.js.map +1 -0
  370. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  371. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  372. package/dist/components/trees/2d/node2d.js +1481 -0
  373. package/dist/components/trees/2d/node2d.js.map +1 -0
  374. package/dist/components/trees/audio/index.d.ts +2 -0
  375. package/dist/components/trees/audio/index.d.ts.map +1 -0
  376. package/dist/components/trees/audio/index.js +2 -0
  377. package/dist/components/trees/audio/index.js.map +1 -0
  378. package/dist/components/trees/audio/node-audio.d.ts +109 -0
  379. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  380. package/dist/components/trees/audio/node-audio.js +167 -0
  381. package/dist/components/trees/audio/node-audio.js.map +1 -0
  382. package/dist/components/trees/index.d.ts +10 -0
  383. package/dist/components/trees/index.d.ts.map +1 -0
  384. package/dist/components/trees/index.js +14 -0
  385. package/dist/components/trees/index.js.map +1 -0
  386. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  387. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  388. package/dist/components/trees/node/node-editor-state.js +23 -0
  389. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  390. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  391. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  392. package/dist/components/trees/node/node-reactive.js +135 -0
  393. package/dist/components/trees/node/node-reactive.js.map +1 -0
  394. package/dist/components/trees/node/node-time.d.ts +39 -0
  395. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  396. package/dist/components/trees/node/node-time.js +14 -0
  397. package/dist/components/trees/node/node-time.js.map +1 -0
  398. package/dist/components/trees/node/node-walk.d.ts +46 -0
  399. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  400. package/dist/components/trees/node/node-walk.js +74 -0
  401. package/dist/components/trees/node/node-walk.js.map +1 -0
  402. package/dist/components/trees/node/node.d.ts +401 -0
  403. package/dist/components/trees/node/node.d.ts.map +1 -0
  404. package/dist/components/trees/node/node.js +680 -0
  405. package/dist/components/trees/node/node.js.map +1 -0
  406. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  407. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  408. package/dist/components/trees/root/canvas2d-node.js +216 -0
  409. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  410. package/dist/components/trees/three/node3d.d.ts +222 -0
  411. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  412. package/dist/components/trees/three/node3d.js +289 -0
  413. package/dist/components/trees/three/node3d.js.map +1 -0
  414. package/dist/document/audio.d.ts +9 -1
  415. package/dist/document/audio.d.ts.map +1 -1
  416. package/dist/document/audio.js +41 -0
  417. package/dist/document/audio.js.map +1 -1
  418. package/dist/document/builtins.d.ts.map +1 -1
  419. package/dist/document/builtins.js +13 -31
  420. package/dist/document/builtins.js.map +1 -1
  421. package/dist/document/command-traits.d.ts +2 -2
  422. package/dist/document/command-traits.js +4 -1
  423. package/dist/document/command-traits.js.map +1 -1
  424. package/dist/document/deny-globals.d.ts +2 -2
  425. package/dist/document/deny-globals.js +2 -2
  426. package/dist/document/deny-globals.js.map +1 -1
  427. package/dist/document/diff.d.ts.map +1 -1
  428. package/dist/document/diff.js +3 -3
  429. package/dist/document/diff.js.map +1 -1
  430. package/dist/document/doc-index.d.ts.map +1 -1
  431. package/dist/document/doc-index.js +3 -3
  432. package/dist/document/doc-index.js.map +1 -1
  433. package/dist/document/expression/index.d.ts +1 -1
  434. package/dist/document/expression/index.js +1 -1
  435. package/dist/document/expression/index.js.map +1 -1
  436. package/dist/document/expression/ops.js +1 -1
  437. package/dist/document/expression/ops.js.map +1 -1
  438. package/dist/document/index.d.ts +1 -2
  439. package/dist/document/index.d.ts.map +1 -1
  440. package/dist/document/index.js +1 -2
  441. package/dist/document/index.js.map +1 -1
  442. package/dist/document/node-decorator.d.ts +14 -10
  443. package/dist/document/node-decorator.d.ts.map +1 -1
  444. package/dist/document/node-decorator.js +14 -10
  445. package/dist/document/node-decorator.js.map +1 -1
  446. package/dist/document/node-descriptor.d.ts +9 -3
  447. package/dist/document/node-descriptor.d.ts.map +1 -1
  448. package/dist/document/node-descriptor.js.map +1 -1
  449. package/dist/document/placement.js +2 -2
  450. package/dist/document/placement.js.map +1 -1
  451. package/dist/document/registry.d.ts +29 -36
  452. package/dist/document/registry.d.ts.map +1 -1
  453. package/dist/document/registry.js +29 -35
  454. package/dist/document/registry.js.map +1 -1
  455. package/dist/document/settled-index.d.ts +49 -0
  456. package/dist/document/settled-index.d.ts.map +1 -0
  457. package/dist/document/settled-index.js +247 -0
  458. package/dist/document/settled-index.js.map +1 -0
  459. package/dist/document/timeline.d.ts +29 -3
  460. package/dist/document/timeline.d.ts.map +1 -1
  461. package/dist/document/timeline.js +99 -3
  462. package/dist/document/timeline.js.map +1 -1
  463. package/dist/document/types.d.ts +4 -4
  464. package/dist/document/types.js.map +1 -1
  465. package/dist/document/validate.d.ts +1 -1
  466. package/dist/document/validate.js.map +1 -1
  467. package/dist/experimental.d.ts +22 -0
  468. package/dist/experimental.d.ts.map +1 -0
  469. package/dist/experimental.js +20 -0
  470. package/dist/experimental.js.map +1 -0
  471. package/dist/index.d.ts +10 -2
  472. package/dist/index.d.ts.map +1 -1
  473. package/dist/index.js +10 -2
  474. package/dist/index.js.map +1 -1
  475. package/dist/layout/types.d.ts +1 -1
  476. package/dist/layout/types.js.map +1 -1
  477. package/dist/nodes/audio/index.d.ts +2 -2
  478. package/dist/nodes/audio/index.d.ts.map +1 -1
  479. package/dist/nodes/audio/index.js +0 -2
  480. package/dist/nodes/audio/index.js.map +1 -1
  481. package/dist/nodes/audio/sound-node.d.ts +2 -1
  482. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  483. package/dist/nodes/audio/sound-node.js +3 -0
  484. package/dist/nodes/audio/sound-node.js.map +1 -1
  485. package/dist/nodes/index.d.ts +39 -27
  486. package/dist/nodes/index.d.ts.map +1 -1
  487. package/dist/nodes/index.js +16 -30
  488. package/dist/nodes/index.js.map +1 -1
  489. package/dist/nodes/node/node.d.ts +7 -1
  490. package/dist/nodes/node/node.d.ts.map +1 -1
  491. package/dist/nodes/node/node.js +23 -8
  492. package/dist/nodes/node/node.js.map +1 -1
  493. package/dist/nodes/root/canvas2d-node.d.ts +2 -1
  494. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -1
  495. package/dist/nodes/root/canvas2d-node.js +3 -0
  496. package/dist/nodes/root/canvas2d-node.js.map +1 -1
  497. package/dist/nodes/text/richtext-node.d.ts +0 -5
  498. package/dist/nodes/text/richtext-node.d.ts.map +1 -1
  499. package/dist/nodes/text/richtext-node.js +5 -71
  500. package/dist/nodes/text/richtext-node.js.map +1 -1
  501. package/dist/nodes/text/text-base.d.ts +5 -22
  502. package/dist/nodes/text/text-base.d.ts.map +1 -1
  503. package/dist/nodes/text/text-base.js +12 -363
  504. package/dist/nodes/text/text-base.js.map +1 -1
  505. package/dist/nodes/text/text-layout.d.ts +87 -0
  506. package/dist/nodes/text/text-layout.d.ts.map +1 -0
  507. package/dist/nodes/text/text-layout.js +368 -0
  508. package/dist/nodes/text/text-layout.js.map +1 -0
  509. package/dist/nodes/three/canvas3d-node.d.ts +3 -1
  510. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  511. package/dist/nodes/three/canvas3d-node.js +6 -0
  512. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  513. package/dist/props/host.d.ts +1 -1
  514. package/dist/props/host.js.map +1 -1
  515. package/dist/props/slot.d.ts +1 -1
  516. package/dist/props/slot.js +1 -1
  517. package/dist/props/slot.js.map +1 -1
  518. package/dist/render/clip.d.ts +1 -1
  519. package/dist/render/clip.js +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/rect.js.map +1 -1
  522. package/dist/render/descriptors/text.d.ts +11 -5
  523. package/dist/render/descriptors/text.d.ts.map +1 -1
  524. package/dist/render/descriptors/text.js +7 -1
  525. package/dist/render/descriptors/text.js.map +1 -1
  526. package/dist/render/render-context2d.d.ts +2 -2
  527. package/dist/render/render-context2d.js.map +1 -1
  528. package/dist/render3d/builders.d.ts +1 -1
  529. package/dist/render3d/builders.js +1 -1
  530. package/dist/render3d/builders.js.map +1 -1
  531. package/dist/render3d/graphics3d.d.ts +13 -19
  532. package/dist/render3d/graphics3d.d.ts.map +1 -1
  533. package/dist/render3d/graphics3d.js +13 -19
  534. package/dist/render3d/graphics3d.js.map +1 -1
  535. package/dist/render3d/scene3d.d.ts +1 -1
  536. package/dist/render3d/scene3d.js +1 -1
  537. package/dist/render3d/scene3d.js.map +1 -1
  538. package/dist/render3d/texture.d.ts +2 -2
  539. package/dist/render3d/texture.d.ts.map +1 -1
  540. package/dist/render3d/texture.js.map +1 -1
  541. package/dist/render3d/vector3.d.ts +2 -2
  542. package/dist/render3d/vector3.js +2 -2
  543. package/dist/render3d/vector3.js.map +1 -1
  544. package/dist/runtime/asset-refine.d.ts +1 -1
  545. package/dist/runtime/asset-refine.d.ts.map +1 -1
  546. package/dist/runtime/asset-refine.js +1 -1
  547. package/dist/runtime/asset-refine.js.map +1 -1
  548. package/dist/runtime/asset-update.js +1 -1
  549. package/dist/runtime/asset-update.js.map +1 -1
  550. package/dist/runtime/audio-index.d.ts +0 -11
  551. package/dist/runtime/audio-index.d.ts.map +1 -1
  552. package/dist/runtime/audio-index.js +0 -25
  553. package/dist/runtime/audio-index.js.map +1 -1
  554. package/dist/runtime/clip-instance.d.ts +7 -4
  555. package/dist/runtime/clip-instance.d.ts.map +1 -1
  556. package/dist/runtime/clip-instance.js +21 -7
  557. package/dist/runtime/clip-instance.js.map +1 -1
  558. package/dist/runtime/clip-store.d.ts +11 -3
  559. package/dist/runtime/clip-store.d.ts.map +1 -1
  560. package/dist/runtime/clip-store.js +83 -23
  561. package/dist/runtime/clip-store.js.map +1 -1
  562. package/dist/runtime/engine.d.ts +3 -3
  563. package/dist/runtime/engine.js +2 -2
  564. package/dist/runtime/engine.js.map +1 -1
  565. package/dist/runtime/node-picking.d.ts +2 -2
  566. package/dist/runtime/node-picking.d.ts.map +1 -1
  567. package/dist/runtime/node-picking.js +9 -10
  568. package/dist/runtime/node-picking.js.map +1 -1
  569. package/dist/runtime/node-picking3d.d.ts +12 -5
  570. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  571. package/dist/runtime/node-picking3d.js +6 -1
  572. package/dist/runtime/node-picking3d.js.map +1 -1
  573. package/dist/runtime/playback-controller.d.ts +2 -2
  574. package/dist/runtime/playback-controller.d.ts.map +1 -1
  575. package/dist/runtime/playback-controller.js +1 -1
  576. package/dist/runtime/playback-controller.js.map +1 -1
  577. package/dist/runtime/state-evaluator.d.ts +2 -2
  578. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  579. package/dist/runtime/state-evaluator.js.map +1 -1
  580. package/dist/runtime/text-geometry.d.ts +1 -1
  581. package/dist/runtime/text-geometry.d.ts.map +1 -1
  582. package/dist/runtime/text-geometry.js +6 -3
  583. package/dist/runtime/text-geometry.js.map +1 -1
  584. package/dist/sdk/index.d.ts +46 -21
  585. package/dist/sdk/index.d.ts.map +1 -1
  586. package/dist/sdk/index.js +47 -43
  587. package/dist/sdk/index.js.map +1 -1
  588. package/dist/tween/command-decorator.d.ts +7 -9
  589. package/dist/tween/command-decorator.d.ts.map +1 -1
  590. package/dist/tween/command-decorator.js +2 -2
  591. package/dist/tween/command-decorator.js.map +1 -1
  592. package/dist/tween/command.d.ts +13 -1
  593. package/dist/tween/command.d.ts.map +1 -1
  594. package/dist/tween/command.js +14 -0
  595. package/dist/tween/command.js.map +1 -1
  596. package/dist/tween/index.d.ts +2 -1
  597. package/dist/tween/index.d.ts.map +1 -1
  598. package/dist/tween/index.js +1 -1
  599. package/dist/tween/index.js.map +1 -1
  600. package/dist/tween/loop.d.ts +1 -1
  601. package/dist/tween/loop.js +1 -1
  602. package/dist/tween/loop.js.map +1 -1
  603. package/dist/util/reference.d.ts +6 -6
  604. package/dist/util/reference.js.map +1 -1
  605. package/package.json +7 -10
  606. package/dist/browser/chunks/chunk-FUZVFT3W.js +0 -18
  607. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +0 -7
  608. package/dist/browser/chunks/chunk-QG6C23IJ.js +0 -3
  609. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +0 -7
  610. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  611. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  612. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  613. package/dist/browser/jsx-jsx-runtime.js +0 -2
  614. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
  615. /package/dist/browser/{jsx-jsx-dev-runtime.js.map → experimental.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAGxH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAOvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAY1D,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAOf,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAYlB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/B,iFAAiF;IACjF,WAAW,EAAE,eAAe,CAAC;CAChC;AAED,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC5C,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC7C,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,WAAW,EAAE,WAAW,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,SAAU,SAAQ,UAAU;IACzC,IAAI,EAAE,QAAQ,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IACjD,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;CACd"}
@@ -0,0 +1,107 @@
1
+ import { lerpCornerScalarStyle } from "../../../attributes/shape/corners/corner-style.js";
2
+ import { pathOps } from "../../../attributes/shape/path/ops.js";
3
+ import { STAR_DEFAULT_POINTS, STAR_DEFAULT_RATIO } from "../../../components/builtins/geometry/shape-outline.js";
4
+ import { component2d } from "../../../components/factory/component2d.js";
5
+ import { Types } from "../../../components/factory/types.js";
6
+ import * as Corners from "../../../components/modules/corners.js";
7
+ import * as Flow from "../../../components/modules/flow.js";
8
+ import * as Paint from "../../../components/modules/paint.js";
9
+ import * as Shapes from "../../../components/modules/shapes.js";
10
+ /**
11
+ * The geometry built-ins: paint, the flow engine for children (clear of the
12
+ * stroke), and each one's outline.
13
+ */
14
+ const scalarCorners = {
15
+ cornerRadius: Types.number(0),
16
+ cornerStyle: Types.custom("rounded", { lerp: lerpCornerScalarStyle }),
17
+ };
18
+ export const Rect = component2d({
19
+ key: "rect",
20
+ state: { ...Paint.state, ...Flow.state, ...Corners.state },
21
+ commands: { ...Paint.commands },
22
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
23
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
24
+ render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state)),
25
+ });
26
+ export const Ellipse = component2d({
27
+ key: "ellipse",
28
+ state: {
29
+ ...Paint.state, ...Flow.state,
30
+ startAngle: Types.number(0),
31
+ sweep: Types.number(360),
32
+ ratio: Types.number(0),
33
+ },
34
+ commands: { ...Paint.commands },
35
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
36
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
37
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.ellipse(ctx.size, state)),
38
+ });
39
+ export const Polygon = component2d({
40
+ key: "polygon",
41
+ state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ...scalarCorners },
42
+ commands: { ...Paint.commands },
43
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
44
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
45
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygon(ctx.size, state)),
46
+ });
47
+ export const Polygram = component2d({
48
+ key: "polygram",
49
+ state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ratio: Types.number(0.5), ...scalarCorners },
50
+ commands: { ...Paint.commands },
51
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
52
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
53
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygram(ctx.size, state)),
54
+ });
55
+ /** The document's `path`: `data` in the unit space of its own box, so a resize is a width/height write. */
56
+ export const PathShape = component2d({
57
+ key: "path",
58
+ state: { ...Paint.state, ...Flow.state, data: Types.path },
59
+ commands: { ...Paint.commands },
60
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
61
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
62
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.unitPath(ctx.size, state.data), { clipShape: Shapes.box(ctx.size) }),
63
+ });
64
+ /** Path data drawn at face value, hugging it: geometry written in code. */
65
+ export const Path = component2d({
66
+ key: "facePath",
67
+ state: { ...Paint.state, ...Flow.state, data: Types.path },
68
+ defaults: { width: "hug", height: "hug" },
69
+ commands: { ...Paint.commands },
70
+ measure: (_measurer, state) => {
71
+ const intrinsic = pathOps.size(state.data);
72
+ const pad = state.padding;
73
+ return { width: intrinsic.width + pad.left + pad.right, height: intrinsic.height + pad.top + pad.bottom };
74
+ },
75
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
76
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.facePath(state.data), { clipShape: null }),
77
+ });
78
+ function boundsShape(key, kind) {
79
+ return component2d({
80
+ key,
81
+ state: { ...Paint.state, ...Flow.state, ...scalarCorners },
82
+ commands: { ...Paint.commands },
83
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
84
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
85
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(kind, ctx.size, state), { clipShape: Shapes.box(ctx.size) }),
86
+ });
87
+ }
88
+ export const Triangle = boundsShape("triangle", "triangle");
89
+ export const RightTriangle = boundsShape("rightTriangle", "rightTriangle");
90
+ export const Pentagon = boundsShape("pentagon", "pentagon");
91
+ export const Hexagon = boundsShape("hexagon", "hexagon");
92
+ export const Octagon = boundsShape("octagon", "octagon");
93
+ export const Star = component2d({
94
+ key: "star",
95
+ state: {
96
+ ...Paint.state, ...Flow.state, ...scalarCorners,
97
+ points: Types.number(STAR_DEFAULT_POINTS),
98
+ ratio: Types.number(STAR_DEFAULT_RATIO),
99
+ },
100
+ commands: { ...Paint.commands },
101
+ measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),
102
+ layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),
103
+ render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline("star", ctx.size, {
104
+ cornerRadius: state.cornerRadius, cornerStyle: state.cornerStyle, sides: Math.max(3, Math.round(state.points)), ratio: state.ratio,
105
+ }), { clipShape: Shapes.box(ctx.size) }),
106
+ });
107
+ //# sourceMappingURL=geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAA0C,MAAM,yCAAyC,CAAC;AACxH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAyB,MAAM,8CAA8C,CAAC;AAE9H,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACxD,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,KAAK,MAAM,MAAM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CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnG,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvF,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE;QAC5E,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK;KACrI,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;CAC3C,CAAC,CAAC","sourcesContent":["import { lerpCornerScalarStyle, type CornerStyle, type RectCornerStyle } from \"@/attributes/shape/corners/corner-style\";\r\nimport { pathOps } from \"@/attributes/shape/path/ops\";\r\nimport { STAR_DEFAULT_POINTS, STAR_DEFAULT_RATIO, type ShapeOutlineKind } from \"@/components/builtins/geometry/shape-outline\";\r\nimport type { NodeOf } from \"@/components/factory/api\";\r\nimport { component2d } from \"@/components/factory/component2d\";\r\nimport { Types } from \"@/components/factory/types\";\r\nimport * as Corners from \"@/components/modules/corners\";\r\nimport * as Flow from \"@/components/modules/flow\";\r\nimport * as Paint from \"@/components/modules/paint\";\r\nimport * as Shapes from \"@/components/modules/shapes\";\r\nimport type { Node2DProps } from \"@/components/trees/2d/node2d\";\r\nimport type { Fill } from \"@/attributes/shape/fill/chain\";\r\nimport type { Stroke } from \"@/attributes/shape/stroke/stroke\";\r\nimport type { Shadow } from \"@/attributes/shape/shadow/shadow\";\r\nimport type { FlowProps } from \"@/layout/types\";\r\nimport type { RectCornerRadius } from \"@/attributes/shape/corners/corner-radius\";\r\nimport type { PathData } from \"@/render/descriptors/path\";\r\n\r\n/**\r\n * The geometry built-ins: paint, the flow engine for children (clear of the\r\n * stroke), and each one's outline.\r\n */\r\n\r\nconst scalarCorners = {\r\n cornerRadius: Types.number(0),\r\n cornerStyle: Types.custom<CornerStyle>(\"rounded\", { lerp: lerpCornerScalarStyle }),\r\n};\r\n\r\nexport const Rect = component2d({\r\n key: \"rect\",\r\n state: { ...Paint.state, ...Flow.state, ...Corners.state },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Corners.rect(ctx.size, state)),\r\n});\r\n\r\nexport const Ellipse = component2d({\r\n key: \"ellipse\",\r\n state: {\r\n ...Paint.state, ...Flow.state,\r\n startAngle: Types.number(0),\r\n sweep: Types.number(360),\r\n ratio: Types.number(0),\r\n },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.ellipse(ctx.size, state)),\r\n});\r\n\r\nexport const Polygon = component2d({\r\n key: \"polygon\",\r\n state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ...scalarCorners },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygon(ctx.size, state)),\r\n});\r\n\r\nexport const Polygram = component2d({\r\n key: \"polygram\",\r\n state: { ...Paint.state, ...Flow.state, sides: Types.number(5), ratio: Types.number(0.5), ...scalarCorners },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.polygram(ctx.size, state)),\r\n});\r\n\r\n/** The document's `path`: `data` in the unit space of its own box, so a resize is a width/height write. */\r\nexport const PathShape = component2d({\r\n key: \"path\",\r\n state: { ...Paint.state, ...Flow.state, data: Types.path },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.unitPath(ctx.size, state.data), { clipShape: Shapes.box(ctx.size) }),\r\n});\r\n\r\n/** Path data drawn at face value, hugging it: geometry written in code. */\r\nexport const Path = component2d({\r\n key: \"facePath\",\r\n state: { ...Paint.state, ...Flow.state, data: Types.path },\r\n defaults: { width: \"hug\", height: \"hug\" },\r\n commands: { ...Paint.commands },\r\n measure: (_measurer, state) => {\r\n const intrinsic = pathOps.size(state.data);\r\n const pad = state.padding;\r\n return { width: intrinsic.width + pad.left + pad.right, height: intrinsic.height + pad.top + pad.bottom };\r\n },\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.facePath(state.data), { clipShape: null }),\r\n});\r\n\r\nfunction boundsShape<const K extends string>(key: K, kind: ShapeOutlineKind) {\r\n return component2d({\r\n key,\r\n state: { ...Paint.state, ...Flow.state, ...scalarCorners },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(kind, ctx.size, state), { clipShape: Shapes.box(ctx.size) }),\r\n });\r\n}\r\n\r\nexport const Triangle = boundsShape(\"triangle\", \"triangle\");\r\nexport const RightTriangle = boundsShape(\"rightTriangle\", \"rightTriangle\");\r\nexport const Pentagon = boundsShape(\"pentagon\", \"pentagon\");\r\nexport const Hexagon = boundsShape(\"hexagon\", \"hexagon\");\r\nexport const Octagon = boundsShape(\"octagon\", \"octagon\");\r\n\r\nexport const Star = component2d({\r\n key: \"star\",\r\n state: {\r\n ...Paint.state, ...Flow.state, ...scalarCorners,\r\n points: Types.number(STAR_DEFAULT_POINTS),\r\n ratio: Types.number(STAR_DEFAULT_RATIO),\r\n },\r\n commands: { ...Paint.commands },\r\n measure: (measurer, state, children) => Flow.measure(measurer, state, children, Paint.inset(state)),\r\n layout: (box, state, children) => Flow.layout(box, state, children, Paint.inset(state)),\r\n render: (ctx, state) => Paint.draw(ctx, state, Shapes.outline(\"star\", ctx.size, {\r\n cornerRadius: state.cornerRadius, cornerStyle: state.cornerStyle, sides: Math.max(3, Math.round(state.points)), ratio: state.ratio,\r\n }), { clipShape: Shapes.box(ctx.size) }),\r\n});\r\n\r\nexport type Rect = NodeOf<typeof Rect>;\r\nexport type Ellipse = NodeOf<typeof Ellipse>;\r\nexport type Polygon = NodeOf<typeof Polygon>;\r\nexport type Polygram = NodeOf<typeof Polygram>;\r\nexport type PathShape = NodeOf<typeof PathShape>;\r\nexport type Path = NodeOf<typeof Path>;\r\nexport type Triangle = NodeOf<typeof Triangle>;\r\nexport type RightTriangle = NodeOf<typeof RightTriangle>;\r\nexport type Pentagon = NodeOf<typeof Pentagon>;\r\nexport type Hexagon = NodeOf<typeof Hexagon>;\r\nexport type Octagon = NodeOf<typeof Octagon>;\r\nexport type Star = NodeOf<typeof Star>;\r\n\r\n// What code building a shape names its props as. A call's own type is `CallProps<typeof Rect>`.\r\n\r\nexport interface PaintProps extends Node2DProps {\r\n /**\r\n * Fill layer(s). Each item can be:\r\n * - A plain CSS color string → treated as a solid fill\r\n * - A fill prop object (SolidFillProp, LinearGradientFillProp, …)\r\n * - An already-resolved fill object\r\n * - A {@link FillChain} from the `Fills` builder (e.g. `Fills.color('red')`)\r\n */\r\n fill?: Fill;\r\n /**\r\n * Stroke layer(s): a single {@link StrokeProp}, an array of them, or an\r\n * already-resolved stroke. `fill` inside each stroke accepts the same loose\r\n * values as the top-level fill prop.\r\n */\r\n stroke?: Stroke;\r\n /**\r\n * Shadow layer(s): a single {@link ShadowProp}, an array of them, or an\r\n * already-resolved shadow. `fill` inside each shadow accepts the same loose\r\n * values as the top-level fill prop.\r\n */\r\n shadow?: Shadow;\r\n start?: number;\r\n end?: number;\r\n}\r\n\r\nexport interface ShapeProps extends PaintProps, FlowProps {\r\n /**\r\n * Overlay layer(s) — the same loose values as {@link PaintProps.fill}, but\r\n * painted *over* this node's fill **and** its children (clipped to the node's\r\n * silhouette) while still sitting **under** the stroke. Use for textures\r\n * laid across the whole subtree, e.g. a VHS-grain image or video.\r\n */\r\n overlay?: Fill;\r\n}\r\n\r\nexport type FlexSize = number | \"fill\" | \"hug\";\r\n\r\nexport interface RectProps extends ShapeProps {\r\n /** Corner radius in pixels — uniform, per-corner, or per-axis. */\r\n cornerRadius: RectCornerRadius;\r\n /** How each corner is shaped once it has a radius: `'rounded'` or `'angled'`. */\r\n cornerStyle: RectCornerStyle;\r\n}\r\n\r\nexport interface EllipseProps extends ShapeProps {\r\n ratio: number;\r\n sweep: number;\r\n startAngle: number;\r\n}\r\n\r\nexport interface PolygonProps extends ShapeProps {\r\n /** Number of sides. Must be ≥ 3. */\r\n sides: number;\r\n /** Vertex rounding radius in pixels. */\r\n cornerRadius: number;\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle;\r\n}\r\n\r\nexport interface PolygramProps extends ShapeProps {\r\n /** Number of outer points. Must be ≥ 3. */\r\n sides: number;\r\n /**\r\n * Inner-to-outer radius ratio (0–1). Controls how deeply the star points are cut.\r\n * At 1 the shape degenerates into a regular polygon; lower values produce sharper points.\r\n */\r\n ratio: number;\r\n /** Vertex rounding radius in pixels applied to both inner and outer vertices. */\r\n cornerRadius: number;\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle;\r\n}\r\n\r\nexport interface PathShapeProps extends ShapeProps {\r\n /**\r\n * The geometry, as an SVG `d` string in the node's **unit box** — see\r\n * {@link PathData}.\r\n */\r\n data: PathData\r\n}\r\n\r\nexport interface PathProps extends ShapeProps {\r\n data: PathData;\r\n}\r\n\r\n/**\r\n * The named shapes — a triangle, a right triangle, a pentagon, a hexagon, an\r\n * octagon, a star — as engine nodes.\r\n *\r\n * ## Why they aren't just a Polygon with `sides` set\r\n *\r\n * A `Polygon` inscribes its n-gon in the node's box, so a three-sided one leaves\r\n * a visible gap under its base (see `./shape-outline` for the full reason,\r\n * which is a good one: it's what makes a `sides` tween smooth). These fill the\r\n * box instead. The two behaviours can't be one node with a switch, because\r\n * \"which shape is this\" is the sort of thing a scene's author picks once and a\r\n * reader of the layers panel needs to see at a glance — so each is a type of its\r\n * own, named for what it draws.\r\n *\r\n * ## Why they're paths rather than polygons\r\n *\r\n * The silhouette is handed to the renderer as a `path` op rather than a\r\n * `polygon` one, which is what lets corner rounding be *ours*: the engine's\r\n * polygon geometry rounds the inscribed figure, and rounding a stretched one is\r\n * a different arc at every vertex. Drawing the outline ourselves also means the\r\n * shape a user is looking at and the shape they get when they start editing its\r\n * points are built by the same function, so converting to a Path node changes\r\n * nothing on screen.\r\n *\r\n * The outline is rebuilt per draw rather than cached against the box. It is a\r\n * handful of trig per vertex on a shape with at most ten of them, and the\r\n * alternative — a cache keyed on width, height, radius, style and the two\r\n * parametric fields — costs more to keep honest than it saves.\r\n */\r\nexport interface BoundsShapeProps extends ShapeProps {\r\n /** Vertex rounding radius in pixels. */\r\n cornerRadius: number\r\n /** Vertex shape: `'rounded'` (circular arc) or `'angled'` (chamfer). */\r\n cornerStyle: CornerStyle\r\n}\r\n\r\nexport interface StarProps extends BoundsShapeProps {\r\n /** How many points the star has. */\r\n points: number\r\n /** Inner radius as a fraction of the outer one — how deep the points cut. */\r\n ratio: number\r\n}\r\n"]}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The silhouette of every shape type, as a {@link VectorPath}.
3
+ *
4
+ * One module, two callers with the same question asked at different scales:
5
+ *
6
+ * - The **shape node classes** (`nodes/shapes`) draw their outline every frame
7
+ * from their laid-out box, so they ask in pixels.
8
+ * - The **path editor** converts a shape into an editable Path node the moment
9
+ * somebody moves one of its points, so it asks in the unit box the Path node
10
+ * stores its geometry in (see `./vector-path`).
11
+ *
12
+ * Sharing the definition is what makes that conversion invisible: a triangle
13
+ * that becomes a path is the *same* triangle, down to the rounding on its
14
+ * corners, rather than a fresh approximation of one.
15
+ *
16
+ * ## Why these shapes exist at all
17
+ *
18
+ * The engine's `Polygon` inscribes its n-gon in the node's box — the vertices
19
+ * sit on the box's inscribed ellipse — which is what makes a `sides` tween
20
+ * smooth: every vertex count is the same circle sampled differently, so a
21
+ * triangle morphing into a square doesn't lurch. The cost is that a triangle
22
+ * *doesn't touch the bottom of its own bounds*, because the two base vertices
23
+ * sit at 30° below the horizontal rather than on the ellipse's lowest point.
24
+ * Figma's polygon does exactly the same thing for exactly the same reason.
25
+ *
26
+ * That is right for a shape you intend to animate and wrong for a shape you
27
+ * intend to *be a triangle*. So the parametric `polygon`/`polygram` keep the
28
+ * inscribed geometry, and the named shapes here are stretched to fill their box
29
+ * — the vertices are computed on the circle exactly as before, then their
30
+ * bounding box is mapped onto the node's. Same silhouette, no gap.
31
+ *
32
+ * Everything here works in **y-down** coordinates, the convention the stored
33
+ * `d` string uses. The node classes flip once on the way to the renderer, whose
34
+ * local space is y-up.
35
+ */
36
+ import type { CornerRadiusResolved } from "../../../attributes/shape/corners/corner-radius.js";
37
+ import type { CornerStyle } from "../../../attributes/shape/corners/corner-style.js";
38
+ import type { VectorPath } from "../../../attributes/shape/path/types.js";
39
+ /** The shape types this module can draw an outline for. */
40
+ export type ShapeOutlineKind = "rect" | "ellipse" | "polygon" | "polygram" | "triangle" | "rightTriangle" | "pentagon" | "hexagon" | "octagon" | "star";
41
+ /** Everything an outline can depend on. Unstated fields take the schema's default. */
42
+ export interface ShapeOutlineOptions {
43
+ /** The node's box, in pixels. */
44
+ width: number;
45
+ height: number;
46
+ /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */
47
+ cornerRadius?: number | CornerRadiusResolved;
48
+ cornerStyle?: CornerStyle;
49
+ /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */
50
+ sides?: number;
51
+ /**
52
+ * The inner radius as a fraction of the outer one: a polygram's or star's
53
+ * point depth, and an ellipse's donut hole.
54
+ */
55
+ ratio?: number;
56
+ /** The ellipse's arc, in degrees. */
57
+ startAngle?: number;
58
+ sweep?: number;
59
+ }
60
+ /**
61
+ * A star's default point depth: the classic five-pointed star, where the inner
62
+ * vertices sit where the extended edges of a pentagram cross.
63
+ *
64
+ * Not the polygram node's 50%, and deliberately so. The parametric polygram
65
+ * opens at a round number because it is a *control* you are expected to move;
66
+ * this node exists for the person who wanted a star and got a geometry lesson,
67
+ * so it opens on the star they were picturing.
68
+ */
69
+ export declare const STAR_DEFAULT_RATIO = 0.382;
70
+ /** The default number of points on a Star node. */
71
+ export declare const STAR_DEFAULT_POINTS = 5;
72
+ /**
73
+ * The shape's outline in **pixel** space: centred on the origin, spanning
74
+ * `width` × `height`, y-down.
75
+ *
76
+ * Returns an empty path for a degenerate box, which draws nothing rather than
77
+ * producing NaN coordinates the renderer would have to cope with.
78
+ */
79
+ export declare function shapeOutlinePixels(kind: ShapeOutlineKind, options: ShapeOutlineOptions): VectorPath;
80
+ /**
81
+ * The same outline in the **unit box** a Path node stores — pixels divided by
82
+ * the node's own size, so the geometry is a fraction of the box rather than a
83
+ * count of pixels inside it.
84
+ *
85
+ * This is what a shape→path conversion writes. Dividing at the end rather than
86
+ * computing in unit space throughout is what keeps a corner radius circular: a
87
+ * 20px corner on a 400×200 node is 0.05 × 0.1 of the box, and only comes back
88
+ * out round because the renderer multiplies by the same two numbers.
89
+ */
90
+ export declare function shapeOutline(kind: ShapeOutlineKind, options: ShapeOutlineOptions): VectorPath;
91
+ /** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */
92
+ export declare function hasShapeOutline(kind: string): kind is ShapeOutlineKind;
93
+ //# sourceMappingURL=shape-outline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-outline.d.ts","sourceRoot":"","sources":["../../../../src/components/builtins/geometry/shape-outline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAI3E,OAAO,KAAK,EAA2B,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEzF,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,SAAS,GACT,SAAS,GACT,UAAU,GACV,UAAU,GACV,eAAe,GACf,UAAU,GACV,SAAS,GACT,SAAS,GACT,MAAM,CAAA;AAEV,sFAAsF;AACtF,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAAA;IAC5C,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MA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