@open-pencil/scene-graph 0.16.0 → 0.17.0-beta.2

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 (885) hide show
  1. package/dist/arrow-caps.d.ts +35 -14
  2. package/dist/arrow-caps.d.ts.map +1 -1
  3. package/dist/arrow-caps.js +286 -55
  4. package/dist/arrow-caps.js.map +1 -1
  5. package/dist/asset-keys.d.ts +17 -0
  6. package/dist/asset-keys.d.ts.map +1 -0
  7. package/dist/asset-keys.js.map +1 -0
  8. package/dist/behaviours/index.d.ts +6 -0
  9. package/dist/behaviours/index.js +6 -0
  10. package/dist/behaviours/kinds.d.ts +62 -0
  11. package/dist/behaviours/kinds.d.ts.map +1 -0
  12. package/dist/{chunks/behaviours → behaviours}/kinds.js +76 -75
  13. package/dist/behaviours/kinds.js.map +1 -0
  14. package/dist/behaviours/layers.d.ts +16 -0
  15. package/dist/behaviours/layers.d.ts.map +1 -0
  16. package/dist/behaviours/layers.js +43 -0
  17. package/dist/behaviours/layers.js.map +1 -0
  18. package/dist/behaviours/model.d.ts +48 -0
  19. package/dist/behaviours/model.d.ts.map +1 -0
  20. package/dist/behaviours/model.js +156 -0
  21. package/dist/behaviours/model.js.map +1 -0
  22. package/dist/behaviours/schema.d.ts +228 -0
  23. package/dist/behaviours/schema.d.ts.map +1 -0
  24. package/dist/behaviours/schema.js +86 -0
  25. package/dist/behaviours/schema.js.map +1 -0
  26. package/dist/behaviours/spec.d.ts +26 -0
  27. package/dist/behaviours/spec.d.ts.map +1 -0
  28. package/dist/{chunks/behaviours → behaviours}/spec.js +6 -29
  29. package/dist/behaviours/spec.js.map +1 -0
  30. package/dist/bindings.js +26 -0
  31. package/dist/bindings.js.map +1 -0
  32. package/dist/buffered-events.d.ts +21 -0
  33. package/dist/buffered-events.d.ts.map +1 -0
  34. package/dist/buffered-events.js.map +1 -0
  35. package/dist/checkpoint.d.ts +42 -0
  36. package/dist/checkpoint.d.ts.map +1 -0
  37. package/dist/checkpoint.js +249 -0
  38. package/dist/checkpoint.js.map +1 -0
  39. package/dist/clipping.d.ts +31 -0
  40. package/dist/clipping.d.ts.map +1 -0
  41. package/dist/clipping.js +125 -0
  42. package/dist/clipping.js.map +1 -0
  43. package/dist/color/contrast.d.ts +17 -0
  44. package/dist/color/contrast.d.ts.map +1 -0
  45. package/dist/{chunks/color → color}/contrast.js +2 -24
  46. package/dist/color/contrast.js.map +1 -0
  47. package/dist/color/index.d.ts +38 -0
  48. package/dist/color/index.d.ts.map +1 -0
  49. package/dist/color/index.js +110 -0
  50. package/dist/color/index.js.map +1 -0
  51. package/dist/color/management.d.ts +32 -0
  52. package/dist/color/management.d.ts.map +1 -0
  53. package/dist/color/management.js +187 -0
  54. package/dist/color/management.js.map +1 -0
  55. package/dist/color/normalize.d.ts +6 -0
  56. package/dist/color/normalize.d.ts.map +1 -0
  57. package/dist/color/normalize.js +15 -0
  58. package/dist/color/normalize.js.map +1 -0
  59. package/dist/color/okhcl.d.ts +33 -0
  60. package/dist/color/okhcl.d.ts.map +1 -0
  61. package/dist/color/okhcl.js +146 -0
  62. package/dist/color/okhcl.js.map +1 -0
  63. package/dist/color/schema.d.ts +11 -0
  64. package/dist/color/schema.d.ts.map +1 -0
  65. package/dist/color/schema.js +13 -0
  66. package/dist/color/schema.js.map +1 -0
  67. package/dist/comments/document.d.ts +23 -0
  68. package/dist/comments/document.d.ts.map +1 -0
  69. package/dist/{chunks/comments → comments}/document.js +2 -1
  70. package/dist/comments/document.js.map +1 -0
  71. package/dist/comments/index.d.ts +6 -0
  72. package/dist/comments/index.js +6 -0
  73. package/dist/comments/list.d.ts +25 -0
  74. package/dist/comments/list.d.ts.map +1 -0
  75. package/dist/comments/list.js +33 -0
  76. package/dist/comments/list.js.map +1 -0
  77. package/dist/comments/merge.d.ts +16 -0
  78. package/dist/comments/merge.d.ts.map +1 -0
  79. package/dist/{chunks/comments → comments}/merge.js +1 -1
  80. package/dist/comments/merge.js.map +1 -0
  81. package/dist/comments/schema.d.ts +8 -0
  82. package/dist/comments/schema.d.ts.map +1 -0
  83. package/dist/comments/schema.js +50 -0
  84. package/dist/comments/schema.js.map +1 -0
  85. package/dist/comments/threads.d.ts +59 -0
  86. package/dist/comments/threads.d.ts.map +1 -0
  87. package/dist/{chunks/comments/list.js → comments/threads.js} +3 -53
  88. package/dist/comments/threads.js.map +1 -0
  89. package/dist/components/exposure.d.ts +24 -0
  90. package/dist/components/exposure.d.ts.map +1 -0
  91. package/dist/components/exposure.js +51 -0
  92. package/dist/components/exposure.js.map +1 -0
  93. package/dist/components/index.d.ts +4 -0
  94. package/dist/components/index.js +4 -0
  95. package/dist/components/properties.d.ts +32 -0
  96. package/dist/components/properties.d.ts.map +1 -0
  97. package/dist/components/properties.js +180 -0
  98. package/dist/components/properties.js.map +1 -0
  99. package/dist/components/variants.d.ts +33 -0
  100. package/dist/components/variants.d.ts.map +1 -0
  101. package/dist/components/variants.js +58 -0
  102. package/dist/components/variants.js.map +1 -0
  103. package/dist/connectors/controls.d.ts +34 -0
  104. package/dist/connectors/controls.d.ts.map +1 -0
  105. package/dist/connectors/controls.js +196 -0
  106. package/dist/connectors/controls.js.map +1 -0
  107. package/dist/connectors/create.d.ts +23 -0
  108. package/dist/connectors/create.d.ts.map +1 -0
  109. package/dist/connectors/create.js +33 -0
  110. package/dist/connectors/create.js.map +1 -0
  111. package/dist/connectors/elbow.js +191 -0
  112. package/dist/connectors/elbow.js.map +1 -0
  113. package/dist/connectors/gaps.d.ts +10 -0
  114. package/dist/connectors/gaps.d.ts.map +1 -0
  115. package/dist/connectors/gaps.js +86 -0
  116. package/dist/connectors/gaps.js.map +1 -0
  117. package/dist/connectors/hit.d.ts +11 -0
  118. package/dist/connectors/hit.d.ts.map +1 -0
  119. package/dist/connectors/hit.js +47 -0
  120. package/dist/connectors/hit.js.map +1 -0
  121. package/dist/connectors/index.d.ts +11 -0
  122. package/dist/connectors/index.js +11 -0
  123. package/dist/connectors/label.d.ts +32 -0
  124. package/dist/connectors/label.d.ts.map +1 -0
  125. package/dist/connectors/label.js +213 -0
  126. package/dist/connectors/label.js.map +1 -0
  127. package/dist/connectors/layout.d.ts +46 -0
  128. package/dist/connectors/layout.d.ts.map +1 -0
  129. package/dist/connectors/layout.js +234 -0
  130. package/dist/connectors/layout.js.map +1 -0
  131. package/dist/connectors/pieces.d.ts +22 -0
  132. package/dist/connectors/pieces.d.ts.map +1 -0
  133. package/dist/connectors/pieces.js +156 -0
  134. package/dist/connectors/pieces.js.map +1 -0
  135. package/dist/connectors/route.d.ts +23 -0
  136. package/dist/connectors/route.d.ts.map +1 -0
  137. package/dist/connectors/route.js +107 -0
  138. package/dist/connectors/route.js.map +1 -0
  139. package/dist/connectors/sides.d.ts +23 -0
  140. package/dist/connectors/sides.d.ts.map +1 -0
  141. package/dist/connectors/sides.js +98 -0
  142. package/dist/connectors/sides.js.map +1 -0
  143. package/dist/connectors/sublayers.d.ts +76 -0
  144. package/dist/connectors/sublayers.d.ts.map +1 -0
  145. package/dist/connectors/sublayers.js +208 -0
  146. package/dist/connectors/sublayers.js.map +1 -0
  147. package/dist/constants.d.ts +11 -2
  148. package/dist/constants.d.ts.map +1 -0
  149. package/dist/constants.js +25 -1
  150. package/dist/constants.js.map +1 -0
  151. package/dist/coordinate.d.ts +94 -2
  152. package/dist/coordinate.d.ts.map +1 -0
  153. package/dist/coordinate.js +268 -1
  154. package/dist/coordinate.js.map +1 -0
  155. package/dist/copy.d.ts +49 -2
  156. package/dist/copy.d.ts.map +1 -0
  157. package/dist/copy.js +264 -2
  158. package/dist/copy.js.map +1 -0
  159. package/dist/css/blend.d.ts +11 -0
  160. package/dist/css/blend.d.ts.map +1 -0
  161. package/dist/css/blend.js +30 -0
  162. package/dist/css/blend.js.map +1 -0
  163. package/dist/css/grid.d.ts +7 -0
  164. package/dist/css/grid.d.ts.map +1 -0
  165. package/dist/{chunks/css → css}/grid.js +2 -33
  166. package/dist/css/grid.js.map +1 -0
  167. package/dist/css/index.d.ts +7 -0
  168. package/dist/css/index.js +7 -0
  169. package/dist/css/layout.d.ts +17 -0
  170. package/dist/css/layout.d.ts.map +1 -0
  171. package/dist/css/layout.js +45 -0
  172. package/dist/css/layout.js.map +1 -0
  173. package/dist/css/shadows.d.ts +10 -0
  174. package/dist/css/shadows.d.ts.map +1 -0
  175. package/dist/css/shadows.js +64 -0
  176. package/dist/css/shadows.js.map +1 -0
  177. package/dist/css/text.d.ts +22 -0
  178. package/dist/css/text.d.ts.map +1 -0
  179. package/dist/css/text.js +76 -0
  180. package/dist/css/text.js.map +1 -0
  181. package/dist/css/values.d.ts +14 -0
  182. package/dist/css/values.d.ts.map +1 -0
  183. package/dist/css/values.js +36 -0
  184. package/dist/css/values.js.map +1 -0
  185. package/dist/cubic.d.ts +7 -0
  186. package/dist/cubic.d.ts.map +1 -0
  187. package/dist/cubic.js +17 -0
  188. package/dist/cubic.js.map +1 -0
  189. package/dist/events.js.map +1 -0
  190. package/dist/export-format.d.ts +25 -0
  191. package/dist/export-format.d.ts.map +1 -0
  192. package/dist/export-format.js +47 -0
  193. package/dist/export-format.js.map +1 -0
  194. package/dist/export-scale.d.ts +14 -0
  195. package/dist/export-scale.d.ts.map +1 -0
  196. package/dist/export-scale.js +19 -0
  197. package/dist/export-scale.js.map +1 -0
  198. package/dist/fields/appearance.d.ts +9 -0
  199. package/dist/fields/appearance.d.ts.map +1 -0
  200. package/dist/fields/appearance.js +36 -0
  201. package/dist/fields/appearance.js.map +1 -0
  202. package/dist/fields/geometry.d.ts +7 -0
  203. package/dist/fields/geometry.d.ts.map +1 -0
  204. package/dist/fields/geometry.js.map +1 -0
  205. package/dist/fields/index.d.ts +5 -0
  206. package/dist/fields/index.js +5 -0
  207. package/dist/fields/layout.d.ts +10 -0
  208. package/dist/fields/layout.d.ts.map +1 -0
  209. package/dist/fields/layout.js +49 -0
  210. package/dist/fields/layout.js.map +1 -0
  211. package/dist/fields/text.d.ts +11 -0
  212. package/dist/fields/text.d.ts.map +1 -0
  213. package/dist/fields/text.js +64 -0
  214. package/dist/fields/text.js.map +1 -0
  215. package/dist/fig-compression.d.ts +11 -0
  216. package/dist/fig-compression.d.ts.map +1 -0
  217. package/dist/fig-compression.js +15 -0
  218. package/dist/fig-compression.js.map +1 -0
  219. package/dist/figjam/index.d.ts +3 -0
  220. package/dist/figjam/index.js +3 -0
  221. package/dist/figjam/palette.d.ts +270 -0
  222. package/dist/figjam/palette.d.ts.map +1 -0
  223. package/dist/figjam/palette.js +439 -0
  224. package/dist/figjam/palette.js.map +1 -0
  225. package/dist/figjam/text.d.ts +70 -0
  226. package/dist/figjam/text.d.ts.map +1 -0
  227. package/dist/figjam/text.js +95 -0
  228. package/dist/figjam/text.js.map +1 -0
  229. package/dist/font-style.d.ts +46 -0
  230. package/dist/font-style.d.ts.map +1 -0
  231. package/dist/font-style.js +127 -0
  232. package/dist/font-style.js.map +1 -0
  233. package/dist/generated/index.d.ts +44 -0
  234. package/dist/generated/index.d.ts.map +1 -0
  235. package/dist/generated/index.js +58 -0
  236. package/dist/generated/index.js.map +1 -0
  237. package/dist/generated/kind.d.ts +27 -0
  238. package/dist/generated/kind.d.ts.map +1 -0
  239. package/dist/generated/shape-with-text.d.ts +43 -0
  240. package/dist/generated/shape-with-text.d.ts.map +1 -0
  241. package/dist/generated/shape-with-text.js +135 -0
  242. package/dist/generated/shape-with-text.js.map +1 -0
  243. package/dist/generated/sticky.d.ts +128 -0
  244. package/dist/generated/sticky.d.ts.map +1 -0
  245. package/dist/generated/sticky.js +233 -0
  246. package/dist/generated/sticky.js.map +1 -0
  247. package/dist/geometry.d.ts +89 -2
  248. package/dist/geometry.d.ts.map +1 -0
  249. package/dist/geometry.js +306 -2
  250. package/dist/geometry.js.map +1 -0
  251. package/dist/gradient.d.ts +9 -2
  252. package/dist/gradient.d.ts.map +1 -1
  253. package/dist/gradient.js +13 -1
  254. package/dist/gradient.js.map +1 -1
  255. package/dist/graph.d.ts +178 -0
  256. package/dist/graph.d.ts.map +1 -0
  257. package/dist/graph.js +625 -0
  258. package/dist/graph.js.map +1 -0
  259. package/dist/group-bounds.d.ts +42 -0
  260. package/dist/group-bounds.d.ts.map +1 -0
  261. package/dist/{chunks/group-bounds.js → group-bounds.js} +56 -14
  262. package/dist/group-bounds.js.map +1 -0
  263. package/dist/guides.d.ts +21 -2
  264. package/dist/guides.d.ts.map +1 -0
  265. package/dist/guides.js +5 -1
  266. package/dist/guides.js.map +1 -1
  267. package/dist/hit-test.d.ts +48 -2
  268. package/dist/hit-test.d.ts.map +1 -0
  269. package/dist/hit-test.js +75 -57
  270. package/dist/hit-test.js.map +1 -1
  271. package/dist/icons/glyph.d.ts +22 -0
  272. package/dist/icons/glyph.d.ts.map +1 -0
  273. package/dist/{chunks/icons → icons}/glyph.js +2 -40
  274. package/dist/icons/glyph.js.map +1 -0
  275. package/dist/icons/index.d.ts +4 -0
  276. package/dist/icons/index.js +4 -0
  277. package/dist/icons/model.d.ts +29 -0
  278. package/dist/icons/model.d.ts.map +1 -0
  279. package/dist/icons/model.js +51 -0
  280. package/dist/icons/model.js.map +1 -0
  281. package/dist/icons/schema.d.ts +31 -0
  282. package/dist/icons/schema.d.ts.map +1 -0
  283. package/dist/icons/schema.js +28 -0
  284. package/dist/icons/schema.js.map +1 -0
  285. package/dist/ids.d.ts +12 -0
  286. package/dist/ids.d.ts.map +1 -0
  287. package/dist/ids.js +31 -0
  288. package/dist/ids.js.map +1 -0
  289. package/dist/images.d.ts +39 -2
  290. package/dist/images.d.ts.map +1 -0
  291. package/dist/images.js +67 -9
  292. package/dist/images.js.map +1 -1
  293. package/dist/index.d.ts +5 -7
  294. package/dist/index.js +5 -23
  295. package/dist/instances/assignments.js +89 -0
  296. package/dist/instances/assignments.js.map +1 -0
  297. package/dist/instances/content-size.js +60 -0
  298. package/dist/instances/content-size.js.map +1 -0
  299. package/dist/instances/copies.js +161 -0
  300. package/dist/instances/copies.js.map +1 -0
  301. package/dist/instances/cycles.d.ts +20 -0
  302. package/dist/instances/cycles.d.ts.map +1 -0
  303. package/dist/instances/cycles.js +53 -0
  304. package/dist/instances/cycles.js.map +1 -0
  305. package/dist/instances/fields.d.ts +18 -0
  306. package/dist/instances/fields.d.ts.map +1 -0
  307. package/dist/instances/fields.js +90 -0
  308. package/dist/instances/fields.js.map +1 -0
  309. package/dist/instances/index.d.ts +38 -0
  310. package/dist/instances/index.d.ts.map +1 -0
  311. package/dist/instances/index.js +180 -0
  312. package/dist/instances/index.js.map +1 -0
  313. package/dist/instances/kept-overrides.js +204 -0
  314. package/dist/instances/kept-overrides.js.map +1 -0
  315. package/dist/instances/main-component.d.ts +13 -0
  316. package/dist/instances/main-component.d.ts.map +1 -0
  317. package/dist/instances/main-component.js +50 -0
  318. package/dist/instances/main-component.js.map +1 -0
  319. package/dist/instances/overrides.d.ts +51 -0
  320. package/dist/instances/overrides.d.ts.map +1 -0
  321. package/dist/instances/overrides.js +158 -0
  322. package/dist/instances/overrides.js.map +1 -0
  323. package/dist/instances/placement.js +30 -0
  324. package/dist/instances/placement.js.map +1 -0
  325. package/dist/instances/source-walk.js +31 -0
  326. package/dist/instances/source-walk.js.map +1 -0
  327. package/dist/instances/swap.js +288 -0
  328. package/dist/instances/swap.js.map +1 -0
  329. package/dist/instances/sync.js +327 -0
  330. package/dist/instances/sync.js.map +1 -0
  331. package/dist/instances/vector-geometry.js +70 -0
  332. package/dist/instances/vector-geometry.js.map +1 -0
  333. package/dist/layout/aspect-ratio.d.ts +27 -0
  334. package/dist/layout/aspect-ratio.d.ts.map +1 -0
  335. package/dist/layout/aspect-ratio.js +45 -0
  336. package/dist/layout/aspect-ratio.js.map +1 -0
  337. package/dist/layout/guides.d.ts +25 -0
  338. package/dist/layout/guides.d.ts.map +1 -0
  339. package/dist/layout/guides.js +105 -0
  340. package/dist/layout/guides.js.map +1 -0
  341. package/dist/layout/index.d.ts +5 -0
  342. package/dist/{layout.js → layout/index.js} +4 -3
  343. package/dist/layout/keywords.d.ts +26 -0
  344. package/dist/layout/keywords.d.ts.map +1 -0
  345. package/dist/layout/keywords.js +59 -0
  346. package/dist/layout/keywords.js.map +1 -0
  347. package/dist/layout/sizing.d.ts +40 -0
  348. package/dist/layout/sizing.d.ts.map +1 -0
  349. package/dist/layout/sizing.js +122 -0
  350. package/dist/layout/sizing.js.map +1 -0
  351. package/dist/layout/writes.js +55 -0
  352. package/dist/layout/writes.js.map +1 -0
  353. package/dist/matrix.d.ts +16 -2
  354. package/dist/matrix.d.ts.map +1 -0
  355. package/dist/matrix.js +119 -1
  356. package/dist/matrix.js.map +1 -0
  357. package/dist/mutation-impact.d.ts +23 -0
  358. package/dist/mutation-impact.d.ts.map +1 -0
  359. package/dist/mutation-impact.js +67 -0
  360. package/dist/mutation-impact.js.map +1 -0
  361. package/dist/node-defaults.d.ts +22 -2
  362. package/dist/node-defaults.d.ts.map +1 -0
  363. package/dist/node-defaults.js +254 -2
  364. package/dist/node-defaults.js.map +1 -0
  365. package/dist/outline/flatten.d.ts +15 -0
  366. package/dist/outline/flatten.d.ts.map +1 -0
  367. package/dist/outline/flatten.js +189 -0
  368. package/dist/outline/flatten.js.map +1 -0
  369. package/dist/outline/heads.js +34 -0
  370. package/dist/outline/heads.js.map +1 -0
  371. package/dist/outline/hit.d.ts +21 -0
  372. package/dist/outline/hit.d.ts.map +1 -0
  373. package/dist/outline/hit.js +276 -0
  374. package/dist/outline/hit.js.map +1 -0
  375. package/dist/outline/index.d.ts +5 -0
  376. package/dist/outline/index.js +5 -0
  377. package/dist/outline/point.d.ts +16 -0
  378. package/dist/outline/point.d.ts.map +1 -0
  379. package/dist/outline/point.js +42 -0
  380. package/dist/outline/point.js.map +1 -0
  381. package/dist/outline/shapes.d.ts +35 -0
  382. package/dist/outline/shapes.d.ts.map +1 -0
  383. package/dist/outline/shapes.js +181 -0
  384. package/dist/outline/shapes.js.map +1 -0
  385. package/dist/paints/index.d.ts +2 -0
  386. package/dist/paints/index.js +2 -0
  387. package/dist/paints/schema.d.ts +77 -0
  388. package/dist/paints/schema.d.ts.map +1 -0
  389. package/dist/paints/schema.js +56 -0
  390. package/dist/paints/schema.js.map +1 -0
  391. package/dist/parse-path.d.ts +9 -1
  392. package/dist/parse-path.d.ts.map +1 -1
  393. package/dist/parse-path.js +39 -2
  394. package/dist/parse-path.js.map +1 -1
  395. package/dist/plugin-data/field.d.ts +47 -0
  396. package/dist/plugin-data/field.d.ts.map +1 -0
  397. package/dist/plugin-data/field.js +73 -0
  398. package/dist/plugin-data/field.js.map +1 -0
  399. package/dist/plugin-data/fields.d.ts +143 -0
  400. package/dist/plugin-data/fields.d.ts.map +1 -0
  401. package/dist/plugin-data/fields.js +168 -0
  402. package/dist/plugin-data/fields.js.map +1 -0
  403. package/dist/plugin-data/index.d.ts +3 -0
  404. package/dist/plugin-data/index.js +3 -0
  405. package/dist/polygon.d.ts +4 -2
  406. package/dist/polygon.d.ts.map +1 -1
  407. package/dist/polygon.js +17 -2
  408. package/dist/polygon.js.map +1 -1
  409. package/dist/preview.d.ts +12 -2
  410. package/dist/preview.d.ts.map +1 -0
  411. package/dist/preview.js +62 -1
  412. package/dist/preview.js.map +1 -0
  413. package/dist/{primitives2.d.ts → primitives/index.d.ts} +4 -3
  414. package/dist/primitives/index.d.ts.map +1 -0
  415. package/dist/primitives/index.js +2 -0
  416. package/dist/primitives/schema.d.ts +18 -0
  417. package/dist/primitives/schema.d.ts.map +1 -0
  418. package/dist/primitives/schema.js +19 -0
  419. package/dist/primitives/schema.js.map +1 -0
  420. package/dist/random.js +24 -1
  421. package/dist/random.js.map +1 -0
  422. package/dist/resize.d.ts +6 -4
  423. package/dist/resize.d.ts.map +1 -1
  424. package/dist/resize.js +287 -2
  425. package/dist/resize.js.map +1 -0
  426. package/dist/scaling/index.d.ts +3 -0
  427. package/dist/scaling/index.js +3 -0
  428. package/dist/scaling/node.d.ts +6 -0
  429. package/dist/scaling/node.d.ts.map +1 -0
  430. package/dist/scaling/node.js +148 -0
  431. package/dist/scaling/node.js.map +1 -0
  432. package/dist/scaling/tree.d.ts +7 -0
  433. package/dist/scaling/tree.d.ts.map +1 -0
  434. package/dist/scaling/tree.js +47 -0
  435. package/dist/scaling/tree.js.map +1 -0
  436. package/dist/shaders/index.d.ts +4 -0
  437. package/dist/shaders/index.js +4 -0
  438. package/dist/shaders/model.d.ts +41 -0
  439. package/dist/shaders/model.d.ts.map +1 -0
  440. package/dist/shaders/model.js +71 -0
  441. package/dist/shaders/model.js.map +1 -0
  442. package/dist/shaders/schema.d.ts +41 -0
  443. package/dist/shaders/schema.d.ts.map +1 -0
  444. package/dist/shaders/schema.js +36 -0
  445. package/dist/shaders/schema.js.map +1 -0
  446. package/dist/shaders/still.d.ts +18 -0
  447. package/dist/shaders/still.d.ts.map +1 -0
  448. package/dist/shaders/still.js +36 -0
  449. package/dist/shaders/still.js.map +1 -0
  450. package/dist/shape-with-text/fit.d.ts +28 -0
  451. package/dist/shape-with-text/fit.d.ts.map +1 -0
  452. package/dist/shape-with-text/fit.js +271 -0
  453. package/dist/shape-with-text/fit.js.map +1 -0
  454. package/dist/shape-with-text/geometry.d.ts +20 -0
  455. package/dist/shape-with-text/geometry.d.ts.map +1 -0
  456. package/dist/shape-with-text/geometry.js +539 -0
  457. package/dist/shape-with-text/geometry.js.map +1 -0
  458. package/dist/shape-with-text/index.d.ts +4 -0
  459. package/dist/shape-with-text/index.js +4 -0
  460. package/dist/shape-with-text/kinds.d.ts +20 -0
  461. package/dist/shape-with-text/kinds.d.ts.map +1 -0
  462. package/dist/shape-with-text/kinds.js +86 -0
  463. package/dist/shape-with-text/kinds.js.map +1 -0
  464. package/dist/shared-styles.d.ts +51 -0
  465. package/dist/shared-styles.d.ts.map +1 -0
  466. package/dist/shared-styles.js +186 -0
  467. package/dist/shared-styles.js.map +1 -0
  468. package/dist/slots/authoring.d.ts +27 -0
  469. package/dist/slots/authoring.d.ts.map +1 -0
  470. package/dist/slots/authoring.js +77 -0
  471. package/dist/slots/authoring.js.map +1 -0
  472. package/dist/slots/content.d.ts +41 -0
  473. package/dist/slots/content.d.ts.map +1 -0
  474. package/dist/slots/content.js +105 -0
  475. package/dist/slots/content.js.map +1 -0
  476. package/dist/slots/frames.d.ts +40 -0
  477. package/dist/slots/frames.d.ts.map +1 -0
  478. package/dist/slots/frames.js +118 -0
  479. package/dist/slots/frames.js.map +1 -0
  480. package/dist/slots/index.d.ts +5 -0
  481. package/dist/slots/index.js +5 -0
  482. package/dist/slots/limits.d.ts +14 -0
  483. package/dist/slots/limits.d.ts.map +1 -0
  484. package/dist/slots/limits.js +28 -0
  485. package/dist/slots/limits.js.map +1 -0
  486. package/dist/snap.d.ts +21 -2
  487. package/dist/snap.d.ts.map +1 -0
  488. package/dist/snap.js +109 -1
  489. package/dist/snap.js.map +1 -0
  490. package/dist/source-metadata.js +10 -1
  491. package/dist/source-metadata.js.map +1 -0
  492. package/dist/statuses/impact.d.ts +18 -0
  493. package/dist/statuses/impact.d.ts.map +1 -0
  494. package/dist/statuses/impact.js +33 -0
  495. package/dist/statuses/impact.js.map +1 -0
  496. package/dist/statuses/index.d.ts +5 -0
  497. package/dist/statuses/index.js +5 -0
  498. package/dist/statuses/node.d.ts +22 -0
  499. package/dist/statuses/node.d.ts.map +1 -0
  500. package/dist/statuses/node.js +47 -0
  501. package/dist/statuses/node.js.map +1 -0
  502. package/dist/statuses/schema.d.ts +59 -0
  503. package/dist/statuses/schema.d.ts.map +1 -0
  504. package/dist/statuses/schema.js +27 -0
  505. package/dist/statuses/schema.js.map +1 -0
  506. package/dist/statuses/workflow.d.ts +120 -0
  507. package/dist/statuses/workflow.d.ts.map +1 -0
  508. package/dist/statuses/workflow.js +135 -0
  509. package/dist/statuses/workflow.js.map +1 -0
  510. package/dist/{text-direction.d.ts → text/direction.d.ts} +2 -2
  511. package/dist/text/direction.d.ts.map +1 -0
  512. package/dist/{text-direction.js → text/direction.js} +1 -1
  513. package/dist/text/direction.js.map +1 -0
  514. package/dist/text/index.d.ts +7 -0
  515. package/dist/text/index.js +7 -0
  516. package/dist/text/lengths.d.ts +24 -0
  517. package/dist/text/lengths.d.ts.map +1 -0
  518. package/dist/text/lengths.js +49 -0
  519. package/dist/text/lengths.js.map +1 -0
  520. package/dist/text/lists.d.ts +44 -0
  521. package/dist/text/lists.d.ts.map +1 -0
  522. package/dist/text/lists.js +100 -0
  523. package/dist/text/lists.js.map +1 -0
  524. package/dist/text/overflow.d.ts +11 -0
  525. package/dist/text/overflow.d.ts.map +1 -0
  526. package/dist/text/overflow.js +13 -0
  527. package/dist/text/overflow.js.map +1 -0
  528. package/dist/text/paragraphs.d.ts +62 -0
  529. package/dist/text/paragraphs.d.ts.map +1 -0
  530. package/dist/text/paragraphs.js +166 -0
  531. package/dist/text/paragraphs.js.map +1 -0
  532. package/dist/{text-picture.d.ts → text/picture.d.ts} +3 -4
  533. package/dist/text/picture.d.ts.map +1 -0
  534. package/dist/text/picture.js +38 -0
  535. package/dist/text/picture.js.map +1 -0
  536. package/dist/text/references.d.ts +21 -0
  537. package/dist/text/references.d.ts.map +1 -0
  538. package/dist/text/references.js +43 -0
  539. package/dist/text/references.js.map +1 -0
  540. package/dist/text/schema.d.ts +10 -0
  541. package/dist/text/schema.d.ts.map +1 -0
  542. package/dist/text/schema.js +11 -0
  543. package/dist/text/schema.js.map +1 -0
  544. package/dist/transfer/apply.d.ts +9 -0
  545. package/dist/transfer/apply.d.ts.map +1 -0
  546. package/dist/transfer/apply.js +65 -0
  547. package/dist/transfer/apply.js.map +1 -0
  548. package/dist/transfer/copied.d.ts +14 -0
  549. package/dist/transfer/copied.d.ts.map +1 -0
  550. package/dist/transfer/copied.js +52 -0
  551. package/dist/transfer/copied.js.map +1 -0
  552. package/dist/transfer/history.d.ts +8 -0
  553. package/dist/transfer/history.d.ts.map +1 -0
  554. package/dist/transfer/history.js +32 -0
  555. package/dist/transfer/history.js.map +1 -0
  556. package/dist/transfer/identity.js +12 -0
  557. package/dist/transfer/identity.js.map +1 -0
  558. package/dist/transfer/index.d.ts +8 -0
  559. package/dist/transfer/index.js +8 -0
  560. package/dist/transfer/nodes.d.ts +14 -0
  561. package/dist/transfer/nodes.d.ts.map +1 -0
  562. package/dist/transfer/nodes.js +78 -0
  563. package/dist/transfer/nodes.js.map +1 -0
  564. package/dist/transfer/plan.d.ts +29 -0
  565. package/dist/transfer/plan.d.ts.map +1 -0
  566. package/dist/transfer/plan.js +106 -0
  567. package/dist/transfer/plan.js.map +1 -0
  568. package/dist/transfer/references.js +10 -0
  569. package/dist/transfer/references.js.map +1 -0
  570. package/dist/transfer/remove.d.ts +8 -0
  571. package/dist/transfer/remove.d.ts.map +1 -0
  572. package/dist/transfer/remove.js +34 -0
  573. package/dist/transfer/remove.js.map +1 -0
  574. package/dist/transfer/validation.js +39 -0
  575. package/dist/transfer/validation.js.map +1 -0
  576. package/dist/transfer/variables.d.ts +15 -0
  577. package/dist/transfer/variables.d.ts.map +1 -0
  578. package/dist/transfer/variables.js +52 -0
  579. package/dist/transfer/variables.js.map +1 -0
  580. package/dist/types.d.ts +195 -2007
  581. package/dist/types.d.ts.map +1 -1
  582. package/dist/types.js +89 -2
  583. package/dist/types.js.map +1 -0
  584. package/dist/undo.d.ts +93 -2
  585. package/dist/undo.d.ts.map +1 -0
  586. package/dist/undo.js +235 -1
  587. package/dist/undo.js.map +1 -0
  588. package/dist/variables/bindings.d.ts +83 -0
  589. package/dist/variables/bindings.d.ts.map +1 -0
  590. package/dist/variables/bindings.js +314 -0
  591. package/dist/variables/bindings.js.map +1 -0
  592. package/dist/variables/corners.d.ts +12 -0
  593. package/dist/variables/corners.d.ts.map +1 -0
  594. package/dist/variables/corners.js +38 -0
  595. package/dist/variables/corners.js.map +1 -0
  596. package/dist/variables/fields.d.ts +43 -0
  597. package/dist/variables/fields.d.ts.map +1 -0
  598. package/dist/variables/fields.js +104 -0
  599. package/dist/variables/fields.js.map +1 -0
  600. package/dist/variables/formula/check.d.ts +14 -0
  601. package/dist/variables/formula/check.d.ts.map +1 -0
  602. package/dist/variables/formula/check.js +73 -0
  603. package/dist/variables/formula/check.js.map +1 -0
  604. package/dist/variables/formula/evaluate.d.ts +7 -0
  605. package/dist/variables/formula/evaluate.d.ts.map +1 -0
  606. package/dist/variables/formula/evaluate.js +30 -0
  607. package/dist/variables/formula/evaluate.js.map +1 -0
  608. package/dist/variables/formula/index.d.ts +21 -0
  609. package/dist/variables/formula/index.d.ts.map +1 -0
  610. package/dist/variables/formula/index.js +77 -0
  611. package/dist/variables/formula/index.js.map +1 -0
  612. package/dist/variables/formula/parse.js +141 -0
  613. package/dist/variables/formula/parse.js.map +1 -0
  614. package/dist/variables/formula/print.d.ts +25 -0
  615. package/dist/variables/formula/print.d.ts.map +1 -0
  616. package/dist/variables/formula/print.js +105 -0
  617. package/dist/variables/formula/print.js.map +1 -0
  618. package/dist/variables/formula/schema.d.ts +7 -0
  619. package/dist/variables/formula/schema.d.ts.map +1 -0
  620. package/dist/variables/formula/schema.js +62 -0
  621. package/dist/variables/formula/schema.js.map +1 -0
  622. package/dist/variables/formula/signatures.d.ts +9 -0
  623. package/dist/variables/formula/signatures.d.ts.map +1 -0
  624. package/dist/variables/formula/signatures.js +238 -0
  625. package/dist/variables/formula/signatures.js.map +1 -0
  626. package/dist/variables/formula/tokens.d.ts +26 -0
  627. package/dist/variables/formula/tokens.d.ts.map +1 -0
  628. package/dist/variables/formula/tokens.js +82 -0
  629. package/dist/variables/formula/tokens.js.map +1 -0
  630. package/dist/variables/formula/tree.d.ts +22 -0
  631. package/dist/variables/formula/tree.d.ts.map +1 -0
  632. package/dist/variables/formula/tree.js +35 -0
  633. package/dist/variables/formula/tree.js.map +1 -0
  634. package/dist/variables/index.d.ts +41 -0
  635. package/dist/variables/index.d.ts.map +1 -0
  636. package/dist/variables/index.js +238 -0
  637. package/dist/variables/index.js.map +1 -0
  638. package/dist/variables/resolution.d.ts +39 -0
  639. package/dist/variables/resolution.d.ts.map +1 -0
  640. package/dist/variables/resolution.js +154 -0
  641. package/dist/variables/resolution.js.map +1 -0
  642. package/dist/variables/schema.d.ts +40 -0
  643. package/dist/variables/schema.d.ts.map +1 -0
  644. package/dist/variables/schema.js +32 -0
  645. package/dist/variables/schema.js.map +1 -0
  646. package/dist/variables/text.d.ts +16 -0
  647. package/dist/variables/text.d.ts.map +1 -0
  648. package/dist/variables/text.js +49 -0
  649. package/dist/variables/text.js.map +1 -0
  650. package/dist/variables/token.d.ts +18 -0
  651. package/dist/variables/token.d.ts.map +1 -0
  652. package/dist/variables/token.js +39 -0
  653. package/dist/variables/token.js.map +1 -0
  654. package/dist/variables/units.js +19 -0
  655. package/dist/variables/units.js.map +1 -0
  656. package/dist/variables/value.d.ts +12 -0
  657. package/dist/variables/value.d.ts.map +1 -0
  658. package/dist/variables/value.js +70 -0
  659. package/dist/variables/value.js.map +1 -0
  660. package/dist/vector-network.d.ts +65 -2
  661. package/dist/vector-network.d.ts.map +1 -0
  662. package/dist/vector-network.js +375 -2
  663. package/dist/vector-network.js.map +1 -0
  664. package/package.json +303 -137
  665. package/src/arrow-caps.ts +279 -62
  666. package/src/behaviours/index.ts +5 -0
  667. package/src/behaviours/kinds.ts +51 -34
  668. package/src/behaviours/layers.ts +5 -3
  669. package/src/behaviours/model.ts +25 -22
  670. package/src/behaviours/schema.ts +64 -13
  671. package/src/behaviours/spec.ts +11 -50
  672. package/src/bindings.ts +11 -2
  673. package/src/checkpoint.ts +252 -5
  674. package/src/clipping.ts +112 -0
  675. package/src/color/index.ts +1 -0
  676. package/src/color/schema.ts +10 -0
  677. package/src/comments/document.ts +1 -1
  678. package/src/comments/index.ts +5 -0
  679. package/src/comments/schema.ts +51 -0
  680. package/src/comments/threads.ts +1 -1
  681. package/src/components/exposure.ts +1 -1
  682. package/src/components/index.ts +8 -0
  683. package/src/components/properties.ts +94 -4
  684. package/src/components/variants.ts +52 -31
  685. package/src/connectors/controls.ts +229 -0
  686. package/src/connectors/create.ts +48 -0
  687. package/src/connectors/elbow.ts +235 -0
  688. package/src/connectors/gaps.ts +72 -0
  689. package/src/connectors/hit.ts +49 -0
  690. package/src/connectors/index.ts +28 -0
  691. package/src/connectors/label.ts +238 -0
  692. package/src/connectors/layout.ts +280 -0
  693. package/src/connectors/pieces.ts +141 -0
  694. package/src/connectors/route.ts +148 -0
  695. package/src/connectors/sides.ts +94 -0
  696. package/src/connectors/sublayers.ts +203 -0
  697. package/src/coordinate.ts +10 -3
  698. package/src/copy.ts +71 -31
  699. package/src/css/blend.ts +27 -0
  700. package/src/css/index.ts +2 -0
  701. package/src/css/text.ts +84 -0
  702. package/src/cubic.ts +14 -0
  703. package/src/export-format.ts +30 -1
  704. package/src/fields/appearance.ts +35 -0
  705. package/src/fields/index.ts +4 -0
  706. package/src/fields/layout.ts +48 -0
  707. package/src/fields/text.ts +32 -1
  708. package/src/fig-compression.ts +9 -0
  709. package/src/figjam/index.ts +2 -0
  710. package/src/figjam/palette.ts +473 -0
  711. package/src/figjam/text.ts +83 -0
  712. package/src/font-style.ts +58 -14
  713. package/src/generated/index.ts +76 -0
  714. package/src/generated/kind.ts +24 -0
  715. package/src/generated/shape-with-text.ts +157 -0
  716. package/src/generated/sticky.ts +213 -0
  717. package/src/geometry.ts +102 -312
  718. package/src/gradient.ts +14 -0
  719. package/src/graph.ts +849 -0
  720. package/src/group-bounds.ts +59 -12
  721. package/src/guides.ts +6 -1
  722. package/src/hit-test.ts +118 -74
  723. package/src/icons/index.ts +3 -0
  724. package/src/icons/model.ts +9 -0
  725. package/src/icons/schema.ts +19 -3
  726. package/src/ids.ts +34 -0
  727. package/src/images.ts +71 -8
  728. package/src/index.ts +2 -976
  729. package/src/instances/assignments.ts +116 -0
  730. package/src/instances/content-size.ts +23 -2
  731. package/src/instances/copies.ts +7 -10
  732. package/src/instances/cycles.ts +1 -1
  733. package/src/instances/fields.ts +47 -92
  734. package/src/{instances.ts → instances/index.ts} +69 -44
  735. package/src/instances/kept-overrides.ts +280 -0
  736. package/src/instances/main-component.ts +55 -1
  737. package/src/{instance-overrides.ts → instances/overrides.ts} +58 -2
  738. package/src/instances/placement.ts +1 -1
  739. package/src/instances/source-walk.ts +3 -9
  740. package/src/instances/swap.ts +451 -0
  741. package/src/instances/sync.ts +166 -177
  742. package/src/instances/vector-geometry.ts +3 -3
  743. package/src/layout/aspect-ratio.ts +1 -1
  744. package/src/layout/sizing.ts +1 -1
  745. package/src/layout/writes.ts +59 -0
  746. package/src/matrix.ts +1 -1
  747. package/src/mutation-impact.ts +1 -1
  748. package/src/node-defaults.ts +43 -3
  749. package/src/outline/flatten.ts +190 -0
  750. package/src/outline/heads.ts +52 -0
  751. package/src/outline/hit.ts +369 -0
  752. package/src/outline/index.ts +4 -0
  753. package/src/outline/point.ts +59 -0
  754. package/src/outline/shapes.ts +207 -0
  755. package/src/paints/index.ts +1 -0
  756. package/src/paints/schema.ts +67 -0
  757. package/src/parse-path.ts +49 -4
  758. package/src/plugin-data/fields.ts +69 -77
  759. package/src/plugin-data/index.ts +2 -0
  760. package/src/polygon.ts +17 -0
  761. package/src/preview.ts +1 -1
  762. package/src/{primitives.ts → primitives/index.ts} +2 -0
  763. package/src/primitives/schema.ts +14 -0
  764. package/src/resize.ts +32 -6
  765. package/src/scaling/node.ts +10 -6
  766. package/src/scaling/tree.ts +2 -1
  767. package/src/shaders/index.ts +3 -0
  768. package/src/shaders/schema.ts +3 -3
  769. package/src/shape-with-text/fit.ts +154 -0
  770. package/src/shape-with-text/geometry.ts +496 -0
  771. package/src/shape-with-text/index.ts +10 -0
  772. package/src/shape-with-text/kinds.ts +86 -0
  773. package/src/shared-styles.ts +169 -17
  774. package/src/slots/authoring.ts +1 -1
  775. package/src/slots/content.ts +10 -5
  776. package/src/slots/frames.ts +12 -10
  777. package/src/slots/index.ts +4 -0
  778. package/src/slots/limits.ts +1 -1
  779. package/src/snap.ts +3 -1
  780. package/src/statuses/impact.ts +38 -0
  781. package/src/statuses/index.ts +4 -0
  782. package/src/statuses/node.ts +63 -0
  783. package/src/statuses/schema.ts +39 -0
  784. package/src/statuses/workflow.ts +121 -0
  785. package/src/text/index.ts +3 -0
  786. package/src/text/lengths.ts +44 -0
  787. package/src/text/overflow.ts +12 -0
  788. package/src/text/picture.ts +0 -4
  789. package/src/text/schema.ts +7 -0
  790. package/src/transfer/apply.ts +1 -1
  791. package/src/transfer/copied.ts +72 -0
  792. package/src/transfer/history.ts +1 -1
  793. package/src/transfer/index.ts +1 -0
  794. package/src/transfer/nodes.ts +18 -19
  795. package/src/transfer/plan.ts +1 -1
  796. package/src/transfer/remove.ts +1 -1
  797. package/src/transfer/validation.ts +1 -1
  798. package/src/transfer/variables.ts +7 -6
  799. package/src/types.ts +246 -13
  800. package/src/undo.ts +64 -2
  801. package/src/variables/bindings.ts +166 -66
  802. package/src/variables/corners.ts +39 -0
  803. package/src/variables/fields.ts +83 -0
  804. package/src/variables/formula/check.ts +99 -0
  805. package/src/variables/formula/evaluate.ts +33 -0
  806. package/src/variables/formula/index.ts +129 -0
  807. package/src/variables/formula/parse.ts +160 -0
  808. package/src/variables/formula/print.ts +167 -0
  809. package/src/variables/formula/schema.ts +77 -0
  810. package/src/variables/formula/signatures.ts +266 -0
  811. package/src/variables/formula/tokens.ts +114 -0
  812. package/src/variables/formula/tree.ts +53 -0
  813. package/src/{variables.ts → variables/index.ts} +86 -146
  814. package/src/variables/resolution.ts +293 -0
  815. package/src/variables/schema.ts +31 -0
  816. package/src/variables/text.ts +51 -0
  817. package/src/variables/token.ts +27 -1
  818. package/src/variables/value.ts +92 -0
  819. package/src/vector-network.ts +263 -22
  820. package/dist/chunks/asset-keys.js.map +0 -1
  821. package/dist/chunks/behaviours/kinds.js.map +0 -1
  822. package/dist/chunks/behaviours/layers.js +0 -611
  823. package/dist/chunks/behaviours/layers.js.map +0 -1
  824. package/dist/chunks/behaviours/spec.js.map +0 -1
  825. package/dist/chunks/bindings.js +0 -18
  826. package/dist/chunks/bindings.js.map +0 -1
  827. package/dist/chunks/buffered-events.js.map +0 -1
  828. package/dist/chunks/checkpoint.js +0 -78
  829. package/dist/chunks/checkpoint.js.map +0 -1
  830. package/dist/chunks/color/contrast.js.map +0 -1
  831. package/dist/chunks/color/index.js +0 -1662
  832. package/dist/chunks/color/index.js.map +0 -1
  833. package/dist/chunks/comments/document.js.map +0 -1
  834. package/dist/chunks/comments/list.js.map +0 -1
  835. package/dist/chunks/comments/merge.js.map +0 -1
  836. package/dist/chunks/components/exposure.js +0 -2291
  837. package/dist/chunks/components/exposure.js.map +0 -1
  838. package/dist/chunks/components/variants.js +0 -32
  839. package/dist/chunks/components/variants.js.map +0 -1
  840. package/dist/chunks/coordinate.js +0 -385
  841. package/dist/chunks/coordinate.js.map +0 -1
  842. package/dist/chunks/css/grid.js.map +0 -1
  843. package/dist/chunks/css/index.js +0 -160
  844. package/dist/chunks/css/index.js.map +0 -1
  845. package/dist/chunks/events.js.map +0 -1
  846. package/dist/chunks/fields/geometry.js.map +0 -1
  847. package/dist/chunks/font-style.js +0 -96
  848. package/dist/chunks/font-style.js.map +0 -1
  849. package/dist/chunks/group-bounds.js.map +0 -1
  850. package/dist/chunks/icons/glyph.js.map +0 -1
  851. package/dist/chunks/index.js +0 -2430
  852. package/dist/chunks/index.js.map +0 -1
  853. package/dist/color.d.ts +0 -78
  854. package/dist/color.d.ts.map +0 -1
  855. package/dist/color.js +0 -3
  856. package/dist/constants2.d.ts +0 -11
  857. package/dist/constants2.d.ts.map +0 -1
  858. package/dist/css.d.ts +0 -39
  859. package/dist/css.d.ts.map +0 -1
  860. package/dist/css.js +0 -3
  861. package/dist/images2.d.ts +0 -16
  862. package/dist/images2.d.ts.map +0 -1
  863. package/dist/instances.d.ts +0 -2
  864. package/dist/instances.js +0 -2
  865. package/dist/layout.d.ts +0 -2
  866. package/dist/matrix2.d.ts +0 -16
  867. package/dist/matrix2.d.ts.map +0 -1
  868. package/dist/primitives.d.ts +0 -2
  869. package/dist/primitives.js +0 -0
  870. package/dist/primitives2.d.ts.map +0 -1
  871. package/dist/text-direction.d.ts.map +0 -1
  872. package/dist/text-direction.js.map +0 -1
  873. package/dist/text-picture.d.ts.map +0 -1
  874. package/dist/text-picture.js +0 -2
  875. package/dist/text.d.ts +0 -2
  876. package/dist/text.js +0 -3
  877. package/dist/types2.d.ts +0 -2
  878. package/dist/undo2.d.ts +0 -73
  879. package/dist/undo2.d.ts.map +0 -1
  880. package/dist/variables.d.ts +0 -2
  881. package/dist/variables.js +0 -2
  882. /package/dist/{chunks/asset-keys.js → asset-keys.js} +0 -0
  883. /package/dist/{chunks/buffered-events.js → buffered-events.js} +0 -0
  884. /package/dist/{chunks/events.js → events.js} +0 -0
  885. /package/dist/{chunks/fields → fields}/geometry.js +0 -0
@@ -0,0 +1,539 @@
1
+ import { databaseCap } from "./fit.js";
2
+ //#region src/shape-with-text/geometry.ts
3
+ /** Bezier handle length for a quarter ellipse. */
4
+ const KAPPA = .5522847498;
5
+ function polygon(points) {
6
+ const commands = points.map(([x, y], index) => ({
7
+ type: index === 0 ? "M" : "L",
8
+ x,
9
+ y
10
+ }));
11
+ commands.push({ type: "Z" });
12
+ return commands;
13
+ }
14
+ function line(from, to) {
15
+ return [{
16
+ type: "M",
17
+ x: from[0],
18
+ y: from[1]
19
+ }, {
20
+ type: "L",
21
+ x: to[0],
22
+ y: to[1]
23
+ }];
24
+ }
25
+ function curve(x1, y1, x2, y2, x, y) {
26
+ return {
27
+ type: "C",
28
+ x1,
29
+ y1,
30
+ x2,
31
+ y2,
32
+ x,
33
+ y
34
+ };
35
+ }
36
+ function ellipse(x, y, w, h) {
37
+ const rx = w / 2;
38
+ const ry = h / 2;
39
+ const cx = x + rx;
40
+ const cy = y + ry;
41
+ const kx = rx * KAPPA;
42
+ const ky = ry * KAPPA;
43
+ return [
44
+ {
45
+ type: "M",
46
+ x: cx,
47
+ y
48
+ },
49
+ curve(cx + kx, y, x + w, cy - ky, x + w, cy),
50
+ curve(x + w, cy + ky, cx + kx, y + h, cx, y + h),
51
+ curve(cx - kx, y + h, x, cy + ky, x, cy),
52
+ curve(x, cy - ky, cx - kx, y, cx, y),
53
+ { type: "Z" }
54
+ ];
55
+ }
56
+ function roundedRect(w, h, radius) {
57
+ const r = Math.max(0, Math.min(radius, w / 2, h / 2));
58
+ const k = r * .4477152502;
59
+ return [
60
+ {
61
+ type: "M",
62
+ x: r,
63
+ y: 0
64
+ },
65
+ {
66
+ type: "L",
67
+ x: w - r,
68
+ y: 0
69
+ },
70
+ curve(w - k, 0, w, k, w, r),
71
+ {
72
+ type: "L",
73
+ x: w,
74
+ y: h - r
75
+ },
76
+ curve(w, h - k, w - k, h, w - r, h),
77
+ {
78
+ type: "L",
79
+ x: r,
80
+ y: h
81
+ },
82
+ curve(k, h, 0, h - k, 0, h - r),
83
+ {
84
+ type: "L",
85
+ x: 0,
86
+ y: r
87
+ },
88
+ curve(0, k, k, 0, r, 0),
89
+ { type: "Z" }
90
+ ];
91
+ }
92
+ /** A page with a wavy bottom edge, the flowchart "document" symbol. */
93
+ function documentPage(x, y, w, h) {
94
+ const wave = h * .1;
95
+ const base = y + h - wave;
96
+ return [
97
+ {
98
+ type: "M",
99
+ x,
100
+ y
101
+ },
102
+ {
103
+ type: "L",
104
+ x: x + w,
105
+ y
106
+ },
107
+ {
108
+ type: "L",
109
+ x: x + w,
110
+ y: base
111
+ },
112
+ curve(x + w * .8, base - wave * 1.2, x + w * .7, base - wave * 1.2, x + w * .5, base),
113
+ curve(x + w * .3, base + wave, x + w * .2, base + wave, x, base),
114
+ { type: "Z" }
115
+ ];
116
+ }
117
+ function star(w, h) {
118
+ const points = [];
119
+ for (let i = 0; i < 10; i++) {
120
+ const angle = -Math.PI / 2 + i * Math.PI / 5;
121
+ const radius = i % 2 === 0 ? 1 : .382;
122
+ points.push([w / 2 + Math.cos(angle) * radius * w / 2, h / 2 + Math.sin(angle) * radius * h / 2 + h * .05]);
123
+ }
124
+ return points;
125
+ }
126
+ /** A point on the ellipse filling the box, at `angle` radians clockwise from the right. */
127
+ function onEllipse(w, h, angle) {
128
+ return [w / 2 + Math.cos(angle) * w / 2, h / 2 + Math.sin(angle) * h / 2];
129
+ }
130
+ /** A plain box with stroke-only inner lines. */
131
+ function boxWithLines(w, h, details) {
132
+ return {
133
+ outline: polygon([
134
+ [0, 0],
135
+ [w, 0],
136
+ [w, h],
137
+ [0, h]
138
+ ]),
139
+ details
140
+ };
141
+ }
142
+ /** A rounded box with a tail below its left side; the tail joins the bottom edge. */
143
+ function speechBubble(w, h) {
144
+ const body = h * .8;
145
+ const box = roundedRect(w, body, Math.min(w, body) * .2);
146
+ const tail = [
147
+ {
148
+ type: "L",
149
+ x: w * .38,
150
+ y: body
151
+ },
152
+ {
153
+ type: "L",
154
+ x: w * .18,
155
+ y: h
156
+ },
157
+ {
158
+ type: "L",
159
+ x: w * .22,
160
+ y: body
161
+ }
162
+ ];
163
+ return [
164
+ ...box.slice(0, 5),
165
+ ...tail,
166
+ ...box.slice(5)
167
+ ];
168
+ }
169
+ const plain = (outline) => ({
170
+ outline,
171
+ details: []
172
+ });
173
+ /** How far a parallelogram's sides lean: FigJam leans them with the height, not the width. */
174
+ function parallelogramSlant(w, h) {
175
+ return Math.min(h * .43, w * .45);
176
+ }
177
+ /** Each kind's outline and inner lines for a `w` × `h` box, `min` being its shorter side. */
178
+ const BUILDERS = {
179
+ SQUARE: (w, h) => plain(polygon([
180
+ [0, 0],
181
+ [w, 0],
182
+ [w, h],
183
+ [0, h]
184
+ ])),
185
+ ELLIPSE: (w, h) => plain(ellipse(0, 0, w, h)),
186
+ DIAMOND: (w, h) => plain(polygon([
187
+ [w / 2, 0],
188
+ [w, h / 2],
189
+ [w / 2, h],
190
+ [0, h / 2]
191
+ ])),
192
+ TRIANGLE_UP: (w, h) => plain(polygon([
193
+ [w / 2, 0],
194
+ [w, h],
195
+ [0, h]
196
+ ])),
197
+ TRIANGLE_DOWN: (w, h) => plain(polygon([
198
+ [0, 0],
199
+ [w, 0],
200
+ [w / 2, h]
201
+ ])),
202
+ ROUNDED_RECTANGLE: (w, h, min) => plain(roundedRect(w, h, min * .4)),
203
+ PARALLELOGRAM_RIGHT: (w, h) => {
204
+ const s = parallelogramSlant(w, h);
205
+ return plain(polygon([
206
+ [s, 0],
207
+ [w, 0],
208
+ [w - s, h],
209
+ [0, h]
210
+ ]));
211
+ },
212
+ PARALLELOGRAM_LEFT: (w, h) => {
213
+ const s = parallelogramSlant(w, h);
214
+ return plain(polygon([
215
+ [0, 0],
216
+ [w - s, 0],
217
+ [w, h],
218
+ [s, h]
219
+ ]));
220
+ },
221
+ ENG_DATABASE: (w, h) => {
222
+ const ry = databaseCap(w, h);
223
+ const kx = w / 2 * KAPPA;
224
+ const ky = ry * KAPPA;
225
+ return {
226
+ outline: [
227
+ {
228
+ type: "M",
229
+ x: 0,
230
+ y: ry
231
+ },
232
+ curve(0, ry - ky, w / 2 - kx, 0, w / 2, 0),
233
+ curve(w / 2 + kx, 0, w, ry - ky, w, ry),
234
+ {
235
+ type: "L",
236
+ x: w,
237
+ y: h - ry
238
+ },
239
+ curve(w, h - ry + ky, w / 2 + kx, h, w / 2, h),
240
+ curve(w / 2 - kx, h, 0, h - ry + ky, 0, h - ry),
241
+ { type: "Z" }
242
+ ],
243
+ details: [
244
+ {
245
+ type: "M",
246
+ x: 0,
247
+ y: ry
248
+ },
249
+ curve(0, ry + ky, w / 2 - kx, ry * 2, w / 2, ry * 2),
250
+ curve(w / 2 + kx, ry * 2, w, ry + ky, w, ry)
251
+ ]
252
+ };
253
+ },
254
+ ENG_QUEUE: (w, h) => {
255
+ const rx = Math.min(w * .15, h * .25);
256
+ const kx = rx * KAPPA;
257
+ const ky = h / 2 * KAPPA;
258
+ return {
259
+ outline: [
260
+ {
261
+ type: "M",
262
+ x: rx,
263
+ y: 0
264
+ },
265
+ {
266
+ type: "L",
267
+ x: w - rx,
268
+ y: 0
269
+ },
270
+ curve(w - rx + kx, 0, w, h / 2 - ky, w, h / 2),
271
+ curve(w, h / 2 + ky, w - rx + kx, h, w - rx, h),
272
+ {
273
+ type: "L",
274
+ x: rx,
275
+ y: h
276
+ },
277
+ curve(rx - kx, h, 0, h / 2 + ky, 0, h / 2),
278
+ curve(0, h / 2 - ky, rx - kx, 0, rx, 0),
279
+ { type: "Z" }
280
+ ],
281
+ details: [
282
+ {
283
+ type: "M",
284
+ x: w - rx,
285
+ y: 0
286
+ },
287
+ curve(w - rx - kx, 0, w - rx * 2, h / 2 - ky, w - rx * 2, h / 2),
288
+ curve(w - rx * 2, h / 2 + ky, w - rx - kx, h, w - rx, h)
289
+ ]
290
+ };
291
+ },
292
+ ENG_FILE: (w, h, min) => {
293
+ const f = min * .25;
294
+ return {
295
+ outline: polygon([
296
+ [0, 0],
297
+ [w - f, 0],
298
+ [w, f],
299
+ [w, h],
300
+ [0, h]
301
+ ]),
302
+ details: [...line([w - f, 0], [w - f, f]), {
303
+ type: "L",
304
+ x: w,
305
+ y: f
306
+ }]
307
+ };
308
+ },
309
+ ENG_FOLDER: (w, h) => {
310
+ const tab = Math.min(h * .18, w * .2);
311
+ return plain(polygon([
312
+ [0, 0],
313
+ [w * .4, 0],
314
+ [w * .4 + tab, tab],
315
+ [w, tab],
316
+ [w, h],
317
+ [0, h]
318
+ ]));
319
+ },
320
+ TRAPEZOID: (w, h) => {
321
+ const s = Math.min(w * .2, h);
322
+ return plain(polygon([
323
+ [s, 0],
324
+ [w - s, 0],
325
+ [w, h],
326
+ [0, h]
327
+ ]));
328
+ },
329
+ PREDEFINED_PROCESS: (w, h) => {
330
+ const e = Math.min(w * .1, h * .5);
331
+ return boxWithLines(w, h, [...line([e, 0], [e, h]), ...line([w - e, 0], [w - e, h])]);
332
+ },
333
+ SHIELD: (w, h) => plain([
334
+ {
335
+ type: "M",
336
+ x: 0,
337
+ y: 0
338
+ },
339
+ {
340
+ type: "L",
341
+ x: w,
342
+ y: 0
343
+ },
344
+ {
345
+ type: "L",
346
+ x: w,
347
+ y: h * .45
348
+ },
349
+ curve(w, h * .75, w * .75, h * .9, w / 2, h),
350
+ curve(w * .25, h * .9, 0, h * .75, 0, h * .45),
351
+ { type: "Z" }
352
+ ]),
353
+ DOCUMENT_SINGLE: (w, h) => plain(documentPage(0, 0, w, h)),
354
+ DOCUMENT_MULTIPLE: (w, h, min) => {
355
+ const o = min * .06;
356
+ return {
357
+ outline: documentPage(0, o * 2, w - o * 2, h - o * 2),
358
+ details: [
359
+ ...line([o, o * 2], [o, o]),
360
+ {
361
+ type: "L",
362
+ x: w - o,
363
+ y: o
364
+ },
365
+ {
366
+ type: "L",
367
+ x: w - o,
368
+ y: h - o * 2
369
+ },
370
+ ...line([o * 2, o], [o * 2, 0]),
371
+ {
372
+ type: "L",
373
+ x: w,
374
+ y: 0
375
+ },
376
+ {
377
+ type: "L",
378
+ x: w,
379
+ y: h - o * 3
380
+ }
381
+ ]
382
+ };
383
+ },
384
+ MANUAL_INPUT: (w, h) => plain(polygon([
385
+ [0, h * .25],
386
+ [w, 0],
387
+ [w, h],
388
+ [0, h]
389
+ ])),
390
+ HEXAGON: (w, h) => {
391
+ const s = Math.min(w * .25, h * .5);
392
+ return plain(polygon([
393
+ [s, 0],
394
+ [w - s, 0],
395
+ [w, h / 2],
396
+ [w - s, h],
397
+ [s, h],
398
+ [0, h / 2]
399
+ ]));
400
+ },
401
+ CHEVRON: (w, h) => {
402
+ const p = Math.min(w * .25, h * .5);
403
+ return plain(polygon([
404
+ [0, 0],
405
+ [w - p, 0],
406
+ [w, h / 2],
407
+ [w - p, h],
408
+ [0, h],
409
+ [p, h / 2]
410
+ ]));
411
+ },
412
+ PENTAGON: (w, h) => plain(polygon([
413
+ [w / 2, 0],
414
+ [w, h * .38],
415
+ [w * .81, h],
416
+ [w * .19, h],
417
+ [0, h * .38]
418
+ ])),
419
+ OCTAGON: (w, h, min) => {
420
+ const c = min * .29;
421
+ return plain(polygon([
422
+ [c, 0],
423
+ [w - c, 0],
424
+ [w, c],
425
+ [w, h - c],
426
+ [w - c, h],
427
+ [c, h],
428
+ [0, h - c],
429
+ [0, c]
430
+ ]));
431
+ },
432
+ STAR: (w, h) => plain(polygon(star(w, h))),
433
+ PLUS: (w, h) => {
434
+ const a = w / 3;
435
+ const b = h / 3;
436
+ return plain(polygon([
437
+ [a, 0],
438
+ [a * 2, 0],
439
+ [a * 2, b],
440
+ [w, b],
441
+ [w, b * 2],
442
+ [a * 2, b * 2],
443
+ [a * 2, h],
444
+ [a, h],
445
+ [a, b * 2],
446
+ [0, b * 2],
447
+ [0, b],
448
+ [a, b]
449
+ ]));
450
+ },
451
+ ARROW_RIGHT: (w, h) => {
452
+ const head = Math.min(w * .4, h * .5);
453
+ return plain(polygon([
454
+ [0, h * .25],
455
+ [w - head, h * .25],
456
+ [w - head, 0],
457
+ [w, h / 2],
458
+ [w - head, h],
459
+ [w - head, h * .75],
460
+ [0, h * .75]
461
+ ]));
462
+ },
463
+ ARROW_LEFT: (w, h) => {
464
+ const head = Math.min(w * .4, h * .5);
465
+ return plain(polygon([
466
+ [w, h * .25],
467
+ [head, h * .25],
468
+ [head, 0],
469
+ [0, h / 2],
470
+ [head, h],
471
+ [head, h * .75],
472
+ [w, h * .75]
473
+ ]));
474
+ },
475
+ SUMMING_JUNCTION: (w, h) => {
476
+ const q = Math.PI / 4;
477
+ return {
478
+ outline: ellipse(0, 0, w, h),
479
+ details: [...line(onEllipse(w, h, -q), onEllipse(w, h, Math.PI - q)), ...line(onEllipse(w, h, q), onEllipse(w, h, Math.PI + q))]
480
+ };
481
+ },
482
+ OR: (w, h) => ({
483
+ outline: ellipse(0, 0, w, h),
484
+ details: [...line([w / 2, 0], [w / 2, h]), ...line([0, h / 2], [w, h / 2])]
485
+ }),
486
+ SPEECH_BUBBLE: (w, h) => plain(speechBubble(w, h)),
487
+ INTERNAL_STORAGE: (w, h, min) => {
488
+ const e = min * .15;
489
+ return boxWithLines(w, h, [...line([e, 0], [e, h]), ...line([0, e], [w, e])]);
490
+ }
491
+ };
492
+ /**
493
+ * The outline with each straight corner rounded to `radius` (FigJam rounds them all to its corner
494
+ * radius), shortened where an edge is too short for it. Outlines with curves keep their shape.
495
+ */
496
+ function roundCorners(commands, radius) {
497
+ if (radius <= 0 || commands.some((command) => command.type === "C")) return commands;
498
+ const points = [];
499
+ for (const command of commands) if (command.type !== "Z") points.push([command.x, command.y]);
500
+ if (points.length < 3) return commands;
501
+ const rounded = [];
502
+ points.forEach((vertex, index) => {
503
+ const before = points[(index + points.length - 1) % points.length];
504
+ const after = points[(index + 1) % points.length];
505
+ const toward = (to) => {
506
+ const length = Math.hypot(to[0] - vertex[0], to[1] - vertex[1]);
507
+ const t = length > 0 ? Math.min(radius, length / 2) / length : 0;
508
+ return [vertex[0] + (to[0] - vertex[0]) * t, vertex[1] + (to[1] - vertex[1]) * t];
509
+ };
510
+ const [inX, inY] = toward(before);
511
+ const [outX, outY] = toward(after);
512
+ rounded.push({
513
+ type: index === 0 ? "M" : "L",
514
+ x: inX,
515
+ y: inY
516
+ });
517
+ rounded.push(curve(inX + (vertex[0] - inX) * KAPPA, inY + (vertex[1] - inY) * KAPPA, outX + (vertex[0] - outX) * KAPPA, outY + (vertex[1] - outY) * KAPPA, outX, outY));
518
+ });
519
+ rounded.push({ type: "Z" });
520
+ return rounded;
521
+ }
522
+ /**
523
+ * The outline and inner lines of a shape of `type` filling a `width` × `height` box. Outlines
524
+ * made only of straight segments have their corners rounded to `cornerRadius`; outlines with
525
+ * curves, such as a rounded rectangle, keep their own shape.
526
+ */
527
+ function shapeWithTextGeometry(type, width, height, cornerRadius = 0) {
528
+ const w = Math.max(0, width);
529
+ const h = Math.max(0, height);
530
+ const geometry = BUILDERS[type](w, h, Math.min(w, h));
531
+ return {
532
+ ...geometry,
533
+ outline: roundCorners(geometry.outline, cornerRadius)
534
+ };
535
+ }
536
+ //#endregion
537
+ export { parallelogramSlant, shapeWithTextGeometry };
538
+
539
+ //# sourceMappingURL=geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.js","names":[],"sources":["../../src/shape-with-text/geometry.ts"],"sourcesContent":["import type { PolygonOutlineCommand } from '../polygon'\nimport { databaseCap } from './fit'\nimport type { ShapeWithTextType } from './kinds'\n\nexport interface ShapeWithTextGeometry {\n /** The closed outline that is filled and stroked, and that connectors attach to. */\n outline: PolygonOutlineCommand[]\n /** Inner lines that are stroked only, such as a database's front rim. */\n details: PolygonOutlineCommand[]\n}\n\n/** Bezier handle length for a quarter ellipse. */\nconst KAPPA = 0.5522847498\n\ntype Point = readonly [number, number]\n\nfunction polygon(points: Point[]): PolygonOutlineCommand[] {\n const commands: PolygonOutlineCommand[] = points.map(([x, y], index) => ({\n type: index === 0 ? 'M' : 'L',\n x,\n y\n }))\n commands.push({ type: 'Z' })\n return commands\n}\n\nfunction line(from: Point, to: Point): PolygonOutlineCommand[] {\n return [\n { type: 'M', x: from[0], y: from[1] },\n { type: 'L', x: to[0], y: to[1] }\n ]\n}\n\nfunction curve(x1: number, y1: number, x2: number, y2: number, x: number, y: number) {\n return { type: 'C', x1, y1, x2, y2, x, y } as const\n}\n\nfunction ellipse(x: number, y: number, w: number, h: number): PolygonOutlineCommand[] {\n const rx = w / 2\n const ry = h / 2\n const cx = x + rx\n const cy = y + ry\n const kx = rx * KAPPA\n const ky = ry * KAPPA\n return [\n { type: 'M', x: cx, y },\n curve(cx + kx, y, x + w, cy - ky, x + w, cy),\n curve(x + w, cy + ky, cx + kx, y + h, cx, y + h),\n curve(cx - kx, y + h, x, cy + ky, x, cy),\n curve(x, cy - ky, cx - kx, y, cx, y),\n { type: 'Z' }\n ]\n}\n\nfunction roundedRect(w: number, h: number, radius: number): PolygonOutlineCommand[] {\n const r = Math.max(0, Math.min(radius, w / 2, h / 2))\n const k = r * (1 - KAPPA)\n return [\n { type: 'M', x: r, y: 0 },\n { type: 'L', x: w - r, y: 0 },\n curve(w - k, 0, w, k, w, r),\n { type: 'L', x: w, y: h - r },\n curve(w, h - k, w - k, h, w - r, h),\n { type: 'L', x: r, y: h },\n curve(k, h, 0, h - k, 0, h - r),\n { type: 'L', x: 0, y: r },\n curve(0, k, k, 0, r, 0),\n { type: 'Z' }\n ]\n}\n\n/** A page with a wavy bottom edge, the flowchart \"document\" symbol. */\nfunction documentPage(x: number, y: number, w: number, h: number): PolygonOutlineCommand[] {\n const wave = h * 0.1\n const base = y + h - wave\n return [\n { type: 'M', x, y },\n { type: 'L', x: x + w, y },\n { type: 'L', x: x + w, y: base },\n curve(x + w * 0.8, base - wave * 1.2, x + w * 0.7, base - wave * 1.2, x + w * 0.5, base),\n curve(x + w * 0.3, base + wave, x + w * 0.2, base + wave, x, base),\n { type: 'Z' }\n ]\n}\n\nfunction star(w: number, h: number): Point[] {\n const points: Point[] = []\n for (let i = 0; i < 10; i++) {\n const angle = -Math.PI / 2 + (i * Math.PI) / 5\n const radius = i % 2 === 0 ? 1 : 0.382\n points.push([\n w / 2 + (Math.cos(angle) * radius * w) / 2,\n h / 2 + (Math.sin(angle) * radius * h) / 2 + h * 0.05\n ])\n }\n return points\n}\n\n/** A point on the ellipse filling the box, at `angle` radians clockwise from the right. */\nfunction onEllipse(w: number, h: number, angle: number): Point {\n return [w / 2 + (Math.cos(angle) * w) / 2, h / 2 + (Math.sin(angle) * h) / 2]\n}\n\n/** A plain box with stroke-only inner lines. */\nfunction boxWithLines(\n w: number,\n h: number,\n details: PolygonOutlineCommand[]\n): ShapeWithTextGeometry {\n return {\n outline: polygon([\n [0, 0],\n [w, 0],\n [w, h],\n [0, h]\n ]),\n details\n }\n}\n\n/** A rounded box with a tail below its left side; the tail joins the bottom edge. */\nfunction speechBubble(w: number, h: number): PolygonOutlineCommand[] {\n const body = h * 0.8\n const box = roundedRect(w, body, Math.min(w, body) * 0.2)\n // The fifth command draws the bottom edge leftwards; the tail goes just before it.\n const tail: PolygonOutlineCommand[] = [\n { type: 'L', x: w * 0.38, y: body },\n { type: 'L', x: w * 0.18, y: h },\n { type: 'L', x: w * 0.22, y: body }\n ]\n return [...box.slice(0, 5), ...tail, ...box.slice(5)]\n}\n\nconst plain = (outline: PolygonOutlineCommand[]): ShapeWithTextGeometry => ({\n outline,\n details: []\n})\n\ntype Builder = (w: number, h: number, min: number) => ShapeWithTextGeometry\n\n/** How far a parallelogram's sides lean: FigJam leans them with the height, not the width. */\nexport function parallelogramSlant(w: number, h: number): number {\n return Math.min(h * 0.43, w * 0.45)\n}\n\n/** Each kind's outline and inner lines for a `w` × `h` box, `min` being its shorter side. */\nconst BUILDERS: Record<ShapeWithTextType, Builder> = {\n SQUARE: (w, h) =>\n plain(\n polygon([\n [0, 0],\n [w, 0],\n [w, h],\n [0, h]\n ])\n ),\n ELLIPSE: (w, h) => plain(ellipse(0, 0, w, h)),\n DIAMOND: (w, h) =>\n plain(\n polygon([\n [w / 2, 0],\n [w, h / 2],\n [w / 2, h],\n [0, h / 2]\n ])\n ),\n TRIANGLE_UP: (w, h) =>\n plain(\n polygon([\n [w / 2, 0],\n [w, h],\n [0, h]\n ])\n ),\n TRIANGLE_DOWN: (w, h) =>\n plain(\n polygon([\n [0, 0],\n [w, 0],\n [w / 2, h]\n ])\n ),\n // FigJam rounds the ends to 0.4 of the shorter side, as its saved outlines show.\n ROUNDED_RECTANGLE: (w, h, min) => plain(roundedRect(w, h, min * 0.4)),\n PARALLELOGRAM_RIGHT: (w, h) => {\n const s = parallelogramSlant(w, h)\n return plain(\n polygon([\n [s, 0],\n [w, 0],\n [w - s, h],\n [0, h]\n ])\n )\n },\n PARALLELOGRAM_LEFT: (w, h) => {\n const s = parallelogramSlant(w, h)\n return plain(\n polygon([\n [0, 0],\n [w - s, 0],\n [w, h],\n [s, h]\n ])\n )\n },\n ENG_DATABASE: (w, h) => {\n const ry = databaseCap(w, h)\n const kx = (w / 2) * KAPPA\n const ky = ry * KAPPA\n return {\n outline: [\n { type: 'M', x: 0, y: ry },\n curve(0, ry - ky, w / 2 - kx, 0, w / 2, 0),\n curve(w / 2 + kx, 0, w, ry - ky, w, ry),\n { type: 'L', x: w, y: h - ry },\n curve(w, h - ry + ky, w / 2 + kx, h, w / 2, h),\n curve(w / 2 - kx, h, 0, h - ry + ky, 0, h - ry),\n { type: 'Z' }\n ],\n details: [\n { type: 'M', x: 0, y: ry },\n curve(0, ry + ky, w / 2 - kx, ry * 2, w / 2, ry * 2),\n curve(w / 2 + kx, ry * 2, w, ry + ky, w, ry)\n ]\n }\n },\n ENG_QUEUE: (w, h) => {\n const rx = Math.min(w * 0.15, h * 0.25)\n const kx = rx * KAPPA\n const ky = (h / 2) * KAPPA\n return {\n outline: [\n { type: 'M', x: rx, y: 0 },\n { type: 'L', x: w - rx, y: 0 },\n curve(w - rx + kx, 0, w, h / 2 - ky, w, h / 2),\n curve(w, h / 2 + ky, w - rx + kx, h, w - rx, h),\n { type: 'L', x: rx, y: h },\n curve(rx - kx, h, 0, h / 2 + ky, 0, h / 2),\n curve(0, h / 2 - ky, rx - kx, 0, rx, 0),\n { type: 'Z' }\n ],\n details: [\n { type: 'M', x: w - rx, y: 0 },\n curve(w - rx - kx, 0, w - rx * 2, h / 2 - ky, w - rx * 2, h / 2),\n curve(w - rx * 2, h / 2 + ky, w - rx - kx, h, w - rx, h)\n ]\n }\n },\n ENG_FILE: (w, h, min) => {\n const f = min * 0.25\n return {\n outline: polygon([\n [0, 0],\n [w - f, 0],\n [w, f],\n [w, h],\n [0, h]\n ]),\n details: [...line([w - f, 0], [w - f, f]), { type: 'L', x: w, y: f }]\n }\n },\n ENG_FOLDER: (w, h) => {\n const tab = Math.min(h * 0.18, w * 0.2)\n return plain(\n polygon([\n [0, 0],\n [w * 0.4, 0],\n [w * 0.4 + tab, tab],\n [w, tab],\n [w, h],\n [0, h]\n ])\n )\n },\n TRAPEZOID: (w, h) => {\n const s = Math.min(w * 0.2, h)\n return plain(\n polygon([\n [s, 0],\n [w - s, 0],\n [w, h],\n [0, h]\n ])\n )\n },\n PREDEFINED_PROCESS: (w, h) => {\n const e = Math.min(w * 0.1, h * 0.5)\n return boxWithLines(w, h, [...line([e, 0], [e, h]), ...line([w - e, 0], [w - e, h])])\n },\n SHIELD: (w, h) =>\n plain([\n { type: 'M', x: 0, y: 0 },\n { type: 'L', x: w, y: 0 },\n { type: 'L', x: w, y: h * 0.45 },\n curve(w, h * 0.75, w * 0.75, h * 0.9, w / 2, h),\n curve(w * 0.25, h * 0.9, 0, h * 0.75, 0, h * 0.45),\n { type: 'Z' }\n ]),\n DOCUMENT_SINGLE: (w, h) => plain(documentPage(0, 0, w, h)),\n DOCUMENT_MULTIPLE: (w, h, min) => {\n const o = min * 0.06\n return {\n outline: documentPage(0, o * 2, w - o * 2, h - o * 2),\n details: [\n ...line([o, o * 2], [o, o]),\n { type: 'L', x: w - o, y: o },\n { type: 'L', x: w - o, y: h - o * 2 },\n ...line([o * 2, o], [o * 2, 0]),\n { type: 'L', x: w, y: 0 },\n { type: 'L', x: w, y: h - o * 3 }\n ]\n }\n },\n MANUAL_INPUT: (w, h) =>\n plain(\n polygon([\n [0, h * 0.25],\n [w, 0],\n [w, h],\n [0, h]\n ])\n ),\n HEXAGON: (w, h) => {\n const s = Math.min(w * 0.25, h * 0.5)\n return plain(\n polygon([\n [s, 0],\n [w - s, 0],\n [w, h / 2],\n [w - s, h],\n [s, h],\n [0, h / 2]\n ])\n )\n },\n CHEVRON: (w, h) => {\n const p = Math.min(w * 0.25, h * 0.5)\n return plain(\n polygon([\n [0, 0],\n [w - p, 0],\n [w, h / 2],\n [w - p, h],\n [0, h],\n [p, h / 2]\n ])\n )\n },\n PENTAGON: (w, h) =>\n plain(\n polygon([\n [w / 2, 0],\n [w, h * 0.38],\n [w * 0.81, h],\n [w * 0.19, h],\n [0, h * 0.38]\n ])\n ),\n OCTAGON: (w, h, min) => {\n const c = min * 0.29\n return plain(\n polygon([\n [c, 0],\n [w - c, 0],\n [w, c],\n [w, h - c],\n [w - c, h],\n [c, h],\n [0, h - c],\n [0, c]\n ])\n )\n },\n STAR: (w, h) => plain(polygon(star(w, h))),\n PLUS: (w, h) => {\n const a = w / 3\n const b = h / 3\n return plain(\n polygon([\n [a, 0],\n [a * 2, 0],\n [a * 2, b],\n [w, b],\n [w, b * 2],\n [a * 2, b * 2],\n [a * 2, h],\n [a, h],\n [a, b * 2],\n [0, b * 2],\n [0, b],\n [a, b]\n ])\n )\n },\n ARROW_RIGHT: (w, h) => {\n const head = Math.min(w * 0.4, h * 0.5)\n return plain(\n polygon([\n [0, h * 0.25],\n [w - head, h * 0.25],\n [w - head, 0],\n [w, h / 2],\n [w - head, h],\n [w - head, h * 0.75],\n [0, h * 0.75]\n ])\n )\n },\n ARROW_LEFT: (w, h) => {\n const head = Math.min(w * 0.4, h * 0.5)\n return plain(\n polygon([\n [w, h * 0.25],\n [head, h * 0.25],\n [head, 0],\n [0, h / 2],\n [head, h],\n [head, h * 0.75],\n [w, h * 0.75]\n ])\n )\n },\n SUMMING_JUNCTION: (w, h) => {\n const q = Math.PI / 4\n return {\n outline: ellipse(0, 0, w, h),\n details: [\n ...line(onEllipse(w, h, -q), onEllipse(w, h, Math.PI - q)),\n ...line(onEllipse(w, h, q), onEllipse(w, h, Math.PI + q))\n ]\n }\n },\n OR: (w, h) => ({\n outline: ellipse(0, 0, w, h),\n details: [...line([w / 2, 0], [w / 2, h]), ...line([0, h / 2], [w, h / 2])]\n }),\n SPEECH_BUBBLE: (w, h) => plain(speechBubble(w, h)),\n INTERNAL_STORAGE: (w, h, min) => {\n const e = min * 0.15\n return boxWithLines(w, h, [...line([e, 0], [e, h]), ...line([0, e], [w, e])])\n }\n}\n\n/**\n * The outline with each straight corner rounded to `radius` (FigJam rounds them all to its corner\n * radius), shortened where an edge is too short for it. Outlines with curves keep their shape.\n */\nfunction roundCorners(commands: PolygonOutlineCommand[], radius: number): PolygonOutlineCommand[] {\n if (radius <= 0 || commands.some((command) => command.type === 'C')) return commands\n const points: Point[] = []\n for (const command of commands) if (command.type !== 'Z') points.push([command.x, command.y])\n if (points.length < 3) return commands\n const rounded: PolygonOutlineCommand[] = []\n points.forEach((vertex, index) => {\n const before = points[(index + points.length - 1) % points.length]\n const after = points[(index + 1) % points.length]\n const toward = (to: Point): Point => {\n const length = Math.hypot(to[0] - vertex[0], to[1] - vertex[1])\n const t = length > 0 ? Math.min(radius, length / 2) / length : 0\n return [vertex[0] + (to[0] - vertex[0]) * t, vertex[1] + (to[1] - vertex[1]) * t]\n }\n const [inX, inY] = toward(before)\n const [outX, outY] = toward(after)\n rounded.push({ type: index === 0 ? 'M' : 'L', x: inX, y: inY })\n rounded.push(\n curve(\n inX + (vertex[0] - inX) * KAPPA,\n inY + (vertex[1] - inY) * KAPPA,\n outX + (vertex[0] - outX) * KAPPA,\n outY + (vertex[1] - outY) * KAPPA,\n outX,\n outY\n )\n )\n })\n rounded.push({ type: 'Z' })\n return rounded\n}\n\n/**\n * The outline and inner lines of a shape of `type` filling a `width` × `height` box. Outlines\n * made only of straight segments have their corners rounded to `cornerRadius`; outlines with\n * curves, such as a rounded rectangle, keep their own shape.\n */\nexport function shapeWithTextGeometry(\n type: ShapeWithTextType,\n width: number,\n height: number,\n cornerRadius = 0\n): ShapeWithTextGeometry {\n const w = Math.max(0, width)\n const h = Math.max(0, height)\n const geometry = BUILDERS[type](w, h, Math.min(w, h))\n return { ...geometry, outline: roundCorners(geometry.outline, cornerRadius) }\n}\n"],"mappings":";;;AAYA,MAAM,QAAQ;AAId,SAAS,QAAQ,QAA0C;CACzD,MAAM,WAAoC,OAAO,KAAK,CAAC,GAAG,IAAI,WAAW;EACvE,MAAM,UAAU,IAAI,MAAM;EAC1B;EACA;CACF,EAAE;CACF,SAAS,KAAK,EAAE,MAAM,IAAI,CAAC;CAC3B,OAAO;AACT;AAEA,SAAS,KAAK,MAAa,IAAoC;CAC7D,OAAO,CACL;EAAE,MAAM;EAAK,GAAG,KAAK;EAAI,GAAG,KAAK;CAAG,GACpC;EAAE,MAAM;EAAK,GAAG,GAAG;EAAI,GAAG,GAAG;CAAG,CAClC;AACF;AAEA,SAAS,MAAM,IAAY,IAAY,IAAY,IAAY,GAAW,GAAW;CACnF,OAAO;EAAE,MAAM;EAAK;EAAI;EAAI;EAAI;EAAI;EAAG;CAAE;AAC3C;AAEA,SAAS,QAAQ,GAAW,GAAW,GAAW,GAAoC;CACpF,MAAM,KAAK,IAAI;CACf,MAAM,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,KAAK,IAAI,GAAG,KAAK;CAC3B,MAAM,IAAI,KAAK,IAAI,GAAG,MAAM;CAC5B,MAAM,WAAW,SAAS,KAAK,CAAC,GAAG,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC;CACpD,OAAO;EAAE,GAAG;EAAU,SAAS,aAAa,SAAS,SAAS,YAAY;CAAE;AAC9E"}
@@ -0,0 +1,4 @@
1
+ import { SHAPE_WITH_TEXT_GROUPS, SHAPE_WITH_TEXT_TYPES, ShapeWithTextType, isShapeWithTextType } from "./kinds.js";
2
+ import { ShapeWithTextGeometry, parallelogramSlant, shapeWithTextGeometry } from "./geometry.js";
3
+ import { LabelBox, LabelMeasure, databaseCap, fitShapeWithTextHeight, shapeWithTextGrows, shapeWithTextLabelBox } from "./fit.js";
4
+ export { type LabelBox, type LabelMeasure, SHAPE_WITH_TEXT_GROUPS, SHAPE_WITH_TEXT_TYPES, ShapeWithTextGeometry, ShapeWithTextType, databaseCap, fitShapeWithTextHeight, isShapeWithTextType, parallelogramSlant, shapeWithTextGeometry, shapeWithTextGrows, shapeWithTextLabelBox };
@@ -0,0 +1,4 @@
1
+ import { databaseCap, fitShapeWithTextHeight, shapeWithTextGrows, shapeWithTextLabelBox } from "./fit.js";
2
+ import { SHAPE_WITH_TEXT_GROUPS, SHAPE_WITH_TEXT_TYPES, isShapeWithTextType } from "./kinds.js";
3
+ import { parallelogramSlant, shapeWithTextGeometry } from "./geometry.js";
4
+ export { SHAPE_WITH_TEXT_GROUPS, SHAPE_WITH_TEXT_TYPES, databaseCap, fitShapeWithTextHeight, isShapeWithTextType, parallelogramSlant, shapeWithTextGeometry, shapeWithTextGrows, shapeWithTextLabelBox };
@@ -0,0 +1,20 @@
1
+ //#region src/shape-with-text/kinds.d.ts
2
+ /**
3
+ * FigJam's shape-with-text kinds, as Figma names them in `.fig` files and in its plugin API
4
+ * (`ShapeWithTextNode.shapeType`). Each kind is drawn from its size here, so rendering, hit
5
+ * testing, export and connectors share one outline.
6
+ */
7
+ declare const SHAPE_WITH_TEXT_TYPES: readonly ["SQUARE", "ELLIPSE", "DIAMOND", "TRIANGLE_UP", "TRIANGLE_DOWN", "ROUNDED_RECTANGLE", "PARALLELOGRAM_RIGHT", "PARALLELOGRAM_LEFT", "ENG_DATABASE", "ENG_QUEUE", "ENG_FILE", "ENG_FOLDER", "TRAPEZOID", "PREDEFINED_PROCESS", "SHIELD", "DOCUMENT_SINGLE", "DOCUMENT_MULTIPLE", "MANUAL_INPUT", "HEXAGON", "CHEVRON", "PENTAGON", "OCTAGON", "STAR", "PLUS", "ARROW_LEFT", "ARROW_RIGHT", "SUMMING_JUNCTION", "OR", "SPEECH_BUBBLE", "INTERNAL_STORAGE"];
8
+ type ShapeWithTextType = (typeof SHAPE_WITH_TEXT_TYPES)[number];
9
+ declare function isShapeWithTextType(value: unknown): value is ShapeWithTextType;
10
+ /**
11
+ * The kinds as FigJam's Shapes panel offers them, in its order: Basic, then Flowchart. Together
12
+ * they are every kind.
13
+ */
14
+ declare const SHAPE_WITH_TEXT_GROUPS: {
15
+ readonly basic: readonly ["SQUARE", "ELLIPSE", "DIAMOND", "TRIANGLE_UP", "TRIANGLE_DOWN", "ROUNDED_RECTANGLE", "PENTAGON", "OCTAGON", "PLUS", "ARROW_LEFT", "ARROW_RIGHT", "CHEVRON", "STAR", "SPEECH_BUBBLE"];
16
+ readonly flowchart: readonly ["PARALLELOGRAM_RIGHT", "PARALLELOGRAM_LEFT", "ENG_DATABASE", "ENG_QUEUE", "ENG_FILE", "ENG_FOLDER", "DOCUMENT_SINGLE", "DOCUMENT_MULTIPLE", "PREDEFINED_PROCESS", "SHIELD", "TRAPEZOID", "MANUAL_INPUT", "HEXAGON", "INTERNAL_STORAGE", "OR", "SUMMING_JUNCTION"];
17
+ };
18
+ //#endregion
19
+ export { SHAPE_WITH_TEXT_GROUPS, SHAPE_WITH_TEXT_TYPES, ShapeWithTextType, isShapeWithTextType };
20
+ //# sourceMappingURL=kinds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kinds.d.ts","names":[],"sources":["../../src/shape-with-text/kinds.ts"],"mappings":";;;;;;cAKa;KAiCD,4BAA4B;iBAIxB,oBAAoB,iBAAiB,SAAS;;;;;cAQjD;WAAA;WAAA"}