@pairdraw/scene-graph 0.0.0-stage → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (897) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -2
  3. package/dist/agent-notes/index.d.ts +3 -0
  4. package/dist/agent-notes/index.js +3 -0
  5. package/dist/agent-notes/model.d.ts +23 -0
  6. package/dist/agent-notes/model.d.ts.map +1 -0
  7. package/dist/agent-notes/model.js +36 -0
  8. package/dist/agent-notes/model.js.map +1 -0
  9. package/dist/agent-notes/schema.d.ts +19 -0
  10. package/dist/agent-notes/schema.d.ts.map +1 -0
  11. package/dist/agent-notes/schema.js +17 -0
  12. package/dist/agent-notes/schema.js.map +1 -0
  13. package/dist/arrow-caps.d.ts +65 -0
  14. package/dist/arrow-caps.d.ts.map +1 -0
  15. package/dist/arrow-caps.js +365 -0
  16. package/dist/arrow-caps.js.map +1 -0
  17. package/dist/asset-keys.d.ts +17 -0
  18. package/dist/asset-keys.d.ts.map +1 -0
  19. package/dist/asset-keys.js +27 -0
  20. package/dist/asset-keys.js.map +1 -0
  21. package/dist/behaviours/index.d.ts +6 -0
  22. package/dist/behaviours/index.js +6 -0
  23. package/dist/behaviours/kinds.d.ts +56 -0
  24. package/dist/behaviours/kinds.d.ts.map +1 -0
  25. package/dist/behaviours/kinds.js +273 -0
  26. package/dist/behaviours/kinds.js.map +1 -0
  27. package/dist/behaviours/layers.d.ts +16 -0
  28. package/dist/behaviours/layers.d.ts.map +1 -0
  29. package/dist/behaviours/layers.js +42 -0
  30. package/dist/behaviours/layers.js.map +1 -0
  31. package/dist/behaviours/model.d.ts +45 -0
  32. package/dist/behaviours/model.d.ts.map +1 -0
  33. package/dist/behaviours/model.js +149 -0
  34. package/dist/behaviours/model.js.map +1 -0
  35. package/dist/behaviours/schema.d.ts +114 -0
  36. package/dist/behaviours/schema.d.ts.map +1 -0
  37. package/dist/behaviours/schema.js +71 -0
  38. package/dist/behaviours/schema.js.map +1 -0
  39. package/dist/behaviours/spec.d.ts +26 -0
  40. package/dist/behaviours/spec.d.ts.map +1 -0
  41. package/dist/behaviours/spec.js +157 -0
  42. package/dist/behaviours/spec.js.map +1 -0
  43. package/dist/bindings.js +18 -0
  44. package/dist/bindings.js.map +1 -0
  45. package/dist/browser-node/index.d.ts +3 -0
  46. package/dist/browser-node/index.js +3 -0
  47. package/dist/browser-node/model.d.ts +18 -0
  48. package/dist/browser-node/model.d.ts.map +1 -0
  49. package/dist/browser-node/model.js +31 -0
  50. package/dist/browser-node/model.js.map +1 -0
  51. package/dist/browser-node/schema.d.ts +23 -0
  52. package/dist/browser-node/schema.d.ts.map +1 -0
  53. package/dist/browser-node/schema.js +44 -0
  54. package/dist/browser-node/schema.js.map +1 -0
  55. package/dist/buffered-events.d.ts +21 -0
  56. package/dist/buffered-events.d.ts.map +1 -0
  57. package/dist/buffered-events.js +57 -0
  58. package/dist/buffered-events.js.map +1 -0
  59. package/dist/checkpoint.d.ts +13 -0
  60. package/dist/checkpoint.d.ts.map +1 -0
  61. package/dist/checkpoint.js +78 -0
  62. package/dist/checkpoint.js.map +1 -0
  63. package/dist/clipping.d.ts +31 -0
  64. package/dist/clipping.d.ts.map +1 -0
  65. package/dist/clipping.js +125 -0
  66. package/dist/clipping.js.map +1 -0
  67. package/dist/color/contrast.d.ts +20 -0
  68. package/dist/color/contrast.d.ts.map +1 -0
  69. package/dist/color/contrast.js +69 -0
  70. package/dist/color/contrast.js.map +1 -0
  71. package/dist/color/index.d.ts +38 -0
  72. package/dist/color/index.d.ts.map +1 -0
  73. package/dist/color/index.js +110 -0
  74. package/dist/color/index.js.map +1 -0
  75. package/dist/color/management.d.ts +32 -0
  76. package/dist/color/management.d.ts.map +1 -0
  77. package/dist/color/management.js +187 -0
  78. package/dist/color/management.js.map +1 -0
  79. package/dist/color/normalize.d.ts +6 -0
  80. package/dist/color/normalize.d.ts.map +1 -0
  81. package/dist/color/normalize.js +15 -0
  82. package/dist/color/normalize.js.map +1 -0
  83. package/dist/color/okhcl.d.ts +33 -0
  84. package/dist/color/okhcl.d.ts.map +1 -0
  85. package/dist/color/okhcl.js +146 -0
  86. package/dist/color/okhcl.js.map +1 -0
  87. package/dist/color/schema.d.ts +11 -0
  88. package/dist/color/schema.d.ts.map +1 -0
  89. package/dist/color/schema.js +13 -0
  90. package/dist/color/schema.js.map +1 -0
  91. package/dist/comments/document.d.ts +23 -0
  92. package/dist/comments/document.d.ts.map +1 -0
  93. package/dist/comments/document.js +33 -0
  94. package/dist/comments/document.js.map +1 -0
  95. package/dist/comments/index.d.ts +6 -0
  96. package/dist/comments/index.js +6 -0
  97. package/dist/comments/list.d.ts +25 -0
  98. package/dist/comments/list.d.ts.map +1 -0
  99. package/dist/comments/list.js +33 -0
  100. package/dist/comments/list.js.map +1 -0
  101. package/dist/comments/merge.d.ts +16 -0
  102. package/dist/comments/merge.d.ts.map +1 -0
  103. package/dist/comments/merge.js +58 -0
  104. package/dist/comments/merge.js.map +1 -0
  105. package/dist/comments/schema.d.ts +8 -0
  106. package/dist/comments/schema.d.ts.map +1 -0
  107. package/dist/comments/schema.js +50 -0
  108. package/dist/comments/schema.js.map +1 -0
  109. package/dist/comments/threads.d.ts +59 -0
  110. package/dist/comments/threads.d.ts.map +1 -0
  111. package/dist/comments/threads.js +132 -0
  112. package/dist/comments/threads.js.map +1 -0
  113. package/dist/components/exposure.d.ts +24 -0
  114. package/dist/components/exposure.d.ts.map +1 -0
  115. package/dist/components/exposure.js +51 -0
  116. package/dist/components/exposure.js.map +1 -0
  117. package/dist/components/index.d.ts +5 -0
  118. package/dist/components/index.js +5 -0
  119. package/dist/components/library-page.d.ts +11 -0
  120. package/dist/components/library-page.d.ts.map +1 -0
  121. package/dist/components/library-page.js +21 -0
  122. package/dist/components/library-page.js.map +1 -0
  123. package/dist/components/properties.d.ts +20 -0
  124. package/dist/components/properties.d.ts.map +1 -0
  125. package/dist/components/properties.js +125 -0
  126. package/dist/components/properties.js.map +1 -0
  127. package/dist/components/variants.d.ts +27 -0
  128. package/dist/components/variants.d.ts.map +1 -0
  129. package/dist/components/variants.js +32 -0
  130. package/dist/components/variants.js.map +1 -0
  131. package/dist/connectors/controls.d.ts +34 -0
  132. package/dist/connectors/controls.d.ts.map +1 -0
  133. package/dist/connectors/controls.js +196 -0
  134. package/dist/connectors/controls.js.map +1 -0
  135. package/dist/connectors/create.d.ts +23 -0
  136. package/dist/connectors/create.d.ts.map +1 -0
  137. package/dist/connectors/create.js +33 -0
  138. package/dist/connectors/create.js.map +1 -0
  139. package/dist/connectors/elbow.js +191 -0
  140. package/dist/connectors/elbow.js.map +1 -0
  141. package/dist/connectors/gaps.d.ts +10 -0
  142. package/dist/connectors/gaps.d.ts.map +1 -0
  143. package/dist/connectors/gaps.js +86 -0
  144. package/dist/connectors/gaps.js.map +1 -0
  145. package/dist/connectors/hit.d.ts +11 -0
  146. package/dist/connectors/hit.d.ts.map +1 -0
  147. package/dist/connectors/hit.js +53 -0
  148. package/dist/connectors/hit.js.map +1 -0
  149. package/dist/connectors/index.d.ts +11 -0
  150. package/dist/connectors/index.js +11 -0
  151. package/dist/connectors/label.d.ts +32 -0
  152. package/dist/connectors/label.d.ts.map +1 -0
  153. package/dist/connectors/label.js +213 -0
  154. package/dist/connectors/label.js.map +1 -0
  155. package/dist/connectors/layout.d.ts +46 -0
  156. package/dist/connectors/layout.d.ts.map +1 -0
  157. package/dist/connectors/layout.js +234 -0
  158. package/dist/connectors/layout.js.map +1 -0
  159. package/dist/connectors/pieces.d.ts +22 -0
  160. package/dist/connectors/pieces.d.ts.map +1 -0
  161. package/dist/connectors/pieces.js +159 -0
  162. package/dist/connectors/pieces.js.map +1 -0
  163. package/dist/connectors/route.d.ts +23 -0
  164. package/dist/connectors/route.d.ts.map +1 -0
  165. package/dist/connectors/route.js +107 -0
  166. package/dist/connectors/route.js.map +1 -0
  167. package/dist/connectors/sides.d.ts +23 -0
  168. package/dist/connectors/sides.d.ts.map +1 -0
  169. package/dist/connectors/sides.js +98 -0
  170. package/dist/connectors/sides.js.map +1 -0
  171. package/dist/connectors/sublayers.d.ts +76 -0
  172. package/dist/connectors/sublayers.d.ts.map +1 -0
  173. package/dist/connectors/sublayers.js +209 -0
  174. package/dist/connectors/sublayers.js.map +1 -0
  175. package/dist/constants.d.ts +16 -0
  176. package/dist/constants.d.ts.map +1 -0
  177. package/dist/constants.js +31 -0
  178. package/dist/constants.js.map +1 -0
  179. package/dist/coordinate.d.ts +99 -0
  180. package/dist/coordinate.d.ts.map +1 -0
  181. package/dist/coordinate.js +276 -0
  182. package/dist/coordinate.js.map +1 -0
  183. package/dist/copy.d.ts +45 -0
  184. package/dist/copy.d.ts.map +1 -0
  185. package/dist/copy.js +256 -0
  186. package/dist/copy.js.map +1 -0
  187. package/dist/css/grid.d.ts +7 -0
  188. package/dist/css/grid.d.ts.map +1 -0
  189. package/dist/css/grid.js +63 -0
  190. package/dist/css/grid.js.map +1 -0
  191. package/dist/css/index.d.ts +6 -0
  192. package/dist/css/index.js +6 -0
  193. package/dist/css/layout.d.ts +17 -0
  194. package/dist/css/layout.d.ts.map +1 -0
  195. package/dist/css/layout.js +45 -0
  196. package/dist/css/layout.js.map +1 -0
  197. package/dist/css/shadows.d.ts +10 -0
  198. package/dist/css/shadows.d.ts.map +1 -0
  199. package/dist/css/shadows.js +64 -0
  200. package/dist/css/shadows.js.map +1 -0
  201. package/dist/css/text.d.ts +22 -0
  202. package/dist/css/text.d.ts.map +1 -0
  203. package/dist/css/text.js +76 -0
  204. package/dist/css/text.js.map +1 -0
  205. package/dist/css/values.d.ts +14 -0
  206. package/dist/css/values.d.ts.map +1 -0
  207. package/dist/css/values.js +36 -0
  208. package/dist/css/values.js.map +1 -0
  209. package/dist/events.js +18 -0
  210. package/dist/events.js.map +1 -0
  211. package/dist/export-format.d.ts +19 -0
  212. package/dist/export-format.d.ts.map +1 -0
  213. package/dist/export-format.js +33 -0
  214. package/dist/export-format.js.map +1 -0
  215. package/dist/export-scale.d.ts +14 -0
  216. package/dist/export-scale.d.ts.map +1 -0
  217. package/dist/export-scale.js +19 -0
  218. package/dist/export-scale.js.map +1 -0
  219. package/dist/fields/appearance.d.ts +9 -0
  220. package/dist/fields/appearance.d.ts.map +1 -0
  221. package/dist/fields/appearance.js +36 -0
  222. package/dist/fields/appearance.js.map +1 -0
  223. package/dist/fields/geometry.d.ts +7 -0
  224. package/dist/fields/geometry.d.ts.map +1 -0
  225. package/dist/fields/geometry.js +14 -0
  226. package/dist/fields/geometry.js.map +1 -0
  227. package/dist/fields/index.d.ts +5 -0
  228. package/dist/fields/index.js +5 -0
  229. package/dist/fields/layout.d.ts +10 -0
  230. package/dist/fields/layout.d.ts.map +1 -0
  231. package/dist/fields/layout.js +49 -0
  232. package/dist/fields/layout.js.map +1 -0
  233. package/dist/fields/text.d.ts +11 -0
  234. package/dist/fields/text.d.ts.map +1 -0
  235. package/dist/fields/text.js +63 -0
  236. package/dist/fields/text.js.map +1 -0
  237. package/dist/fig-compression.d.ts +11 -0
  238. package/dist/fig-compression.d.ts.map +1 -0
  239. package/dist/fig-compression.js +15 -0
  240. package/dist/fig-compression.js.map +1 -0
  241. package/dist/figjam/index.d.ts +3 -0
  242. package/dist/figjam/index.js +3 -0
  243. package/dist/figjam/palette.d.ts +199 -0
  244. package/dist/figjam/palette.d.ts.map +1 -0
  245. package/dist/figjam/palette.js +277 -0
  246. package/dist/figjam/palette.js.map +1 -0
  247. package/dist/figjam/text.d.ts +68 -0
  248. package/dist/figjam/text.d.ts.map +1 -0
  249. package/dist/figjam/text.js +89 -0
  250. package/dist/figjam/text.js.map +1 -0
  251. package/dist/font-style.d.ts +46 -0
  252. package/dist/font-style.d.ts.map +1 -0
  253. package/dist/font-style.js +127 -0
  254. package/dist/font-style.js.map +1 -0
  255. package/dist/generated/index.d.ts +46 -0
  256. package/dist/generated/index.d.ts.map +1 -0
  257. package/dist/generated/index.js +62 -0
  258. package/dist/generated/index.js.map +1 -0
  259. package/dist/generated/kind.d.ts +29 -0
  260. package/dist/generated/kind.d.ts.map +1 -0
  261. package/dist/generated/shape-with-text.d.ts +38 -0
  262. package/dist/generated/shape-with-text.d.ts.map +1 -0
  263. package/dist/generated/shape-with-text.js +119 -0
  264. package/dist/generated/shape-with-text.js.map +1 -0
  265. package/dist/generated/sticky.d.ts +128 -0
  266. package/dist/generated/sticky.d.ts.map +1 -0
  267. package/dist/generated/sticky.js +234 -0
  268. package/dist/generated/sticky.js.map +1 -0
  269. package/dist/geometry.d.ts +105 -0
  270. package/dist/geometry.d.ts.map +1 -0
  271. package/dist/geometry.js +374 -0
  272. package/dist/geometry.js.map +1 -0
  273. package/dist/gradient.d.ts +74 -0
  274. package/dist/gradient.d.ts.map +1 -0
  275. package/dist/gradient.js +211 -0
  276. package/dist/gradient.js.map +1 -0
  277. package/dist/graph.d.ts +186 -0
  278. package/dist/graph.d.ts.map +1 -0
  279. package/dist/graph.js +630 -0
  280. package/dist/graph.js.map +1 -0
  281. package/dist/group-bounds.d.ts +42 -0
  282. package/dist/group-bounds.d.ts.map +1 -0
  283. package/dist/group-bounds.js +146 -0
  284. package/dist/group-bounds.js.map +1 -0
  285. package/dist/guides.d.ts +19 -0
  286. package/dist/guides.d.ts.map +1 -0
  287. package/dist/guides.js +39 -0
  288. package/dist/guides.js.map +1 -0
  289. package/dist/hit-test.d.ts +49 -0
  290. package/dist/hit-test.d.ts.map +1 -0
  291. package/dist/hit-test.js +315 -0
  292. package/dist/hit-test.js.map +1 -0
  293. package/dist/icons/glyph.d.ts +22 -0
  294. package/dist/icons/glyph.d.ts.map +1 -0
  295. package/dist/icons/glyph.js +109 -0
  296. package/dist/icons/glyph.js.map +1 -0
  297. package/dist/icons/index.d.ts +4 -0
  298. package/dist/icons/index.js +4 -0
  299. package/dist/icons/model.d.ts +29 -0
  300. package/dist/icons/model.d.ts.map +1 -0
  301. package/dist/icons/model.js +51 -0
  302. package/dist/icons/model.js.map +1 -0
  303. package/dist/icons/schema.d.ts +31 -0
  304. package/dist/icons/schema.d.ts.map +1 -0
  305. package/dist/icons/schema.js +28 -0
  306. package/dist/icons/schema.js.map +1 -0
  307. package/dist/ids.d.ts +12 -0
  308. package/dist/ids.d.ts.map +1 -0
  309. package/dist/ids.js +31 -0
  310. package/dist/ids.js.map +1 -0
  311. package/dist/images.d.ts +39 -0
  312. package/dist/images.d.ts.map +1 -0
  313. package/dist/images.js +85 -0
  314. package/dist/images.js.map +1 -0
  315. package/dist/index.d.ts +5 -0
  316. package/dist/index.js +5 -0
  317. package/dist/instances/assignments.js +89 -0
  318. package/dist/instances/assignments.js.map +1 -0
  319. package/dist/instances/content-size.js +60 -0
  320. package/dist/instances/content-size.js.map +1 -0
  321. package/dist/instances/copies.js +162 -0
  322. package/dist/instances/copies.js.map +1 -0
  323. package/dist/instances/cycles.d.ts +20 -0
  324. package/dist/instances/cycles.d.ts.map +1 -0
  325. package/dist/instances/cycles.js +53 -0
  326. package/dist/instances/cycles.js.map +1 -0
  327. package/dist/instances/fields.d.ts +18 -0
  328. package/dist/instances/fields.d.ts.map +1 -0
  329. package/dist/instances/fields.js +82 -0
  330. package/dist/instances/fields.js.map +1 -0
  331. package/dist/instances/index.d.ts +63 -0
  332. package/dist/instances/index.d.ts.map +1 -0
  333. package/dist/instances/index.js +305 -0
  334. package/dist/instances/index.js.map +1 -0
  335. package/dist/instances/main-component.d.ts +11 -0
  336. package/dist/instances/main-component.d.ts.map +1 -0
  337. package/dist/instances/main-component.js +42 -0
  338. package/dist/instances/main-component.js.map +1 -0
  339. package/dist/instances/modes.js +26 -0
  340. package/dist/instances/modes.js.map +1 -0
  341. package/dist/instances/overrides.d.ts +63 -0
  342. package/dist/instances/overrides.d.ts.map +1 -0
  343. package/dist/instances/overrides.js +164 -0
  344. package/dist/instances/overrides.js.map +1 -0
  345. package/dist/instances/placement.js +30 -0
  346. package/dist/instances/placement.js.map +1 -0
  347. package/dist/instances/replacements.d.ts +19 -0
  348. package/dist/instances/replacements.d.ts.map +1 -0
  349. package/dist/instances/replacements.js +67 -0
  350. package/dist/instances/replacements.js.map +1 -0
  351. package/dist/instances/source-walk.js +31 -0
  352. package/dist/instances/source-walk.js.map +1 -0
  353. package/dist/instances/sync.js +305 -0
  354. package/dist/instances/sync.js.map +1 -0
  355. package/dist/instances/vector-geometry.js +70 -0
  356. package/dist/instances/vector-geometry.js.map +1 -0
  357. package/dist/layout/aspect-ratio.d.ts +27 -0
  358. package/dist/layout/aspect-ratio.d.ts.map +1 -0
  359. package/dist/layout/aspect-ratio.js +45 -0
  360. package/dist/layout/aspect-ratio.js.map +1 -0
  361. package/dist/layout/guides.d.ts +25 -0
  362. package/dist/layout/guides.d.ts.map +1 -0
  363. package/dist/layout/guides.js +105 -0
  364. package/dist/layout/guides.js.map +1 -0
  365. package/dist/layout/index.d.ts +5 -0
  366. package/dist/layout/index.js +5 -0
  367. package/dist/layout/keywords.d.ts +26 -0
  368. package/dist/layout/keywords.d.ts.map +1 -0
  369. package/dist/layout/keywords.js +60 -0
  370. package/dist/layout/keywords.js.map +1 -0
  371. package/dist/layout/sizing.d.ts +40 -0
  372. package/dist/layout/sizing.d.ts.map +1 -0
  373. package/dist/layout/sizing.js +122 -0
  374. package/dist/layout/sizing.js.map +1 -0
  375. package/dist/layout/writes.js +55 -0
  376. package/dist/layout/writes.js.map +1 -0
  377. package/dist/matrix.d.ts +16 -0
  378. package/dist/matrix.d.ts.map +1 -0
  379. package/dist/matrix.js +120 -0
  380. package/dist/matrix.js.map +1 -0
  381. package/dist/mutation-impact.d.ts +23 -0
  382. package/dist/mutation-impact.d.ts.map +1 -0
  383. package/dist/mutation-impact.js +67 -0
  384. package/dist/mutation-impact.js.map +1 -0
  385. package/dist/naming.d.ts +9 -0
  386. package/dist/naming.d.ts.map +1 -0
  387. package/dist/naming.js +16 -0
  388. package/dist/naming.js.map +1 -0
  389. package/dist/node-defaults.d.ts +19 -0
  390. package/dist/node-defaults.d.ts.map +1 -0
  391. package/dist/node-defaults.js +243 -0
  392. package/dist/node-defaults.js.map +1 -0
  393. package/dist/order-keys.d.ts +39 -0
  394. package/dist/order-keys.d.ts.map +1 -0
  395. package/dist/order-keys.js +136 -0
  396. package/dist/order-keys.js.map +1 -0
  397. package/dist/paints/index.d.ts +2 -0
  398. package/dist/paints/index.js +2 -0
  399. package/dist/paints/schema.d.ts +103 -0
  400. package/dist/paints/schema.d.ts.map +1 -0
  401. package/dist/paints/schema.js +64 -0
  402. package/dist/paints/schema.js.map +1 -0
  403. package/dist/parse-path.d.ts +36 -0
  404. package/dist/parse-path.d.ts.map +1 -0
  405. package/dist/parse-path.js +200 -0
  406. package/dist/parse-path.js.map +1 -0
  407. package/dist/plugin-data/citation.d.ts +13 -0
  408. package/dist/plugin-data/citation.d.ts.map +1 -0
  409. package/dist/plugin-data/citation.js +23 -0
  410. package/dist/plugin-data/citation.js.map +1 -0
  411. package/dist/plugin-data/field.d.ts +47 -0
  412. package/dist/plugin-data/field.d.ts.map +1 -0
  413. package/dist/plugin-data/field.js +79 -0
  414. package/dist/plugin-data/field.js.map +1 -0
  415. package/dist/plugin-data/fields.d.ts +220 -0
  416. package/dist/plugin-data/fields.d.ts.map +1 -0
  417. package/dist/plugin-data/fields.js +214 -0
  418. package/dist/plugin-data/fields.js.map +1 -0
  419. package/dist/plugin-data/index.d.ts +5 -0
  420. package/dist/plugin-data/index.js +5 -0
  421. package/dist/plugin-data/schema.d.ts +18 -0
  422. package/dist/plugin-data/schema.d.ts.map +1 -0
  423. package/dist/plugin-data/schema.js +29 -0
  424. package/dist/plugin-data/schema.js.map +1 -0
  425. package/dist/polygon.d.ts +55 -0
  426. package/dist/polygon.d.ts.map +1 -0
  427. package/dist/polygon.js +220 -0
  428. package/dist/polygon.js.map +1 -0
  429. package/dist/preview.d.ts +12 -0
  430. package/dist/preview.d.ts.map +1 -0
  431. package/dist/preview.js +63 -0
  432. package/dist/preview.js.map +1 -0
  433. package/dist/primitives/index.d.ts +43 -0
  434. package/dist/primitives/index.d.ts.map +1 -0
  435. package/dist/primitives/index.js +2 -0
  436. package/dist/primitives/schema.d.ts +18 -0
  437. package/dist/primitives/schema.d.ts.map +1 -0
  438. package/dist/primitives/schema.js +19 -0
  439. package/dist/primitives/schema.js.map +1 -0
  440. package/dist/random.d.ts +7 -0
  441. package/dist/random.d.ts.map +1 -0
  442. package/dist/random.js +25 -0
  443. package/dist/random.js.map +1 -0
  444. package/dist/resize.d.ts +41 -0
  445. package/dist/resize.d.ts.map +1 -0
  446. package/dist/resize.js +288 -0
  447. package/dist/resize.js.map +1 -0
  448. package/dist/scaling/index.d.ts +3 -0
  449. package/dist/scaling/index.js +3 -0
  450. package/dist/scaling/node.d.ts +6 -0
  451. package/dist/scaling/node.d.ts.map +1 -0
  452. package/dist/scaling/node.js +150 -0
  453. package/dist/scaling/node.js.map +1 -0
  454. package/dist/scaling/tree.d.ts +22 -0
  455. package/dist/scaling/tree.d.ts.map +1 -0
  456. package/dist/scaling/tree.js +71 -0
  457. package/dist/scaling/tree.js.map +1 -0
  458. package/dist/script/index.d.ts +2 -0
  459. package/dist/script/index.js +2 -0
  460. package/dist/script/schema.d.ts +29 -0
  461. package/dist/script/schema.d.ts.map +1 -0
  462. package/dist/script/schema.js +51 -0
  463. package/dist/script/schema.js.map +1 -0
  464. package/dist/shaders/directives.d.ts +43 -0
  465. package/dist/shaders/directives.d.ts.map +1 -0
  466. package/dist/shaders/directives.js +293 -0
  467. package/dist/shaders/directives.js.map +1 -0
  468. package/dist/shaders/index.d.ts +5 -0
  469. package/dist/shaders/index.js +5 -0
  470. package/dist/shaders/model.d.ts +58 -0
  471. package/dist/shaders/model.d.ts.map +1 -0
  472. package/dist/shaders/model.js +109 -0
  473. package/dist/shaders/model.js.map +1 -0
  474. package/dist/shaders/schema.d.ts +86 -0
  475. package/dist/shaders/schema.d.ts.map +1 -0
  476. package/dist/shaders/schema.js +65 -0
  477. package/dist/shaders/schema.js.map +1 -0
  478. package/dist/shaders/still.d.ts +18 -0
  479. package/dist/shaders/still.d.ts.map +1 -0
  480. package/dist/shaders/still.js +36 -0
  481. package/dist/shaders/still.js.map +1 -0
  482. package/dist/shape-with-text/fit.d.ts +28 -0
  483. package/dist/shape-with-text/fit.d.ts.map +1 -0
  484. package/dist/shape-with-text/fit.js +271 -0
  485. package/dist/shape-with-text/fit.js.map +1 -0
  486. package/dist/shape-with-text/geometry.d.ts +20 -0
  487. package/dist/shape-with-text/geometry.d.ts.map +1 -0
  488. package/dist/shape-with-text/geometry.js +539 -0
  489. package/dist/shape-with-text/geometry.js.map +1 -0
  490. package/dist/shape-with-text/index.d.ts +4 -0
  491. package/dist/shape-with-text/index.js +4 -0
  492. package/dist/shape-with-text/kinds.d.ts +20 -0
  493. package/dist/shape-with-text/kinds.d.ts.map +1 -0
  494. package/dist/shape-with-text/kinds.js +86 -0
  495. package/dist/shape-with-text/kinds.js.map +1 -0
  496. package/dist/shared-styles.d.ts +36 -0
  497. package/dist/shared-styles.d.ts.map +1 -0
  498. package/dist/shared-styles.js +116 -0
  499. package/dist/shared-styles.js.map +1 -0
  500. package/dist/slots/authoring.d.ts +27 -0
  501. package/dist/slots/authoring.d.ts.map +1 -0
  502. package/dist/slots/authoring.js +74 -0
  503. package/dist/slots/authoring.js.map +1 -0
  504. package/dist/slots/content.d.ts +41 -0
  505. package/dist/slots/content.d.ts.map +1 -0
  506. package/dist/slots/content.js +103 -0
  507. package/dist/slots/content.js.map +1 -0
  508. package/dist/slots/frames.d.ts +38 -0
  509. package/dist/slots/frames.d.ts.map +1 -0
  510. package/dist/slots/frames.js +113 -0
  511. package/dist/slots/frames.js.map +1 -0
  512. package/dist/slots/index.d.ts +5 -0
  513. package/dist/slots/index.js +5 -0
  514. package/dist/slots/limits.d.ts +14 -0
  515. package/dist/slots/limits.d.ts.map +1 -0
  516. package/dist/slots/limits.js +28 -0
  517. package/dist/slots/limits.js.map +1 -0
  518. package/dist/snap.d.ts +61 -0
  519. package/dist/snap.d.ts.map +1 -0
  520. package/dist/snap.js +264 -0
  521. package/dist/snap.js.map +1 -0
  522. package/dist/source-metadata.d.ts +6 -0
  523. package/dist/source-metadata.d.ts.map +1 -0
  524. package/dist/source-metadata.js +11 -0
  525. package/dist/source-metadata.js.map +1 -0
  526. package/dist/statuses/impact.d.ts +18 -0
  527. package/dist/statuses/impact.d.ts.map +1 -0
  528. package/dist/statuses/impact.js +33 -0
  529. package/dist/statuses/impact.js.map +1 -0
  530. package/dist/statuses/index.d.ts +5 -0
  531. package/dist/statuses/index.js +5 -0
  532. package/dist/statuses/node.d.ts +22 -0
  533. package/dist/statuses/node.d.ts.map +1 -0
  534. package/dist/statuses/node.js +47 -0
  535. package/dist/statuses/node.js.map +1 -0
  536. package/dist/statuses/schema.d.ts +59 -0
  537. package/dist/statuses/schema.d.ts.map +1 -0
  538. package/dist/statuses/schema.js +27 -0
  539. package/dist/statuses/schema.js.map +1 -0
  540. package/dist/statuses/workflow.d.ts +120 -0
  541. package/dist/statuses/workflow.d.ts.map +1 -0
  542. package/dist/statuses/workflow.js +135 -0
  543. package/dist/statuses/workflow.js.map +1 -0
  544. package/dist/text/direction.d.ts +13 -0
  545. package/dist/text/direction.d.ts.map +1 -0
  546. package/dist/text/direction.js +31 -0
  547. package/dist/text/direction.js.map +1 -0
  548. package/dist/text/index.d.ts +7 -0
  549. package/dist/text/index.js +7 -0
  550. package/dist/text/lengths.d.ts +19 -0
  551. package/dist/text/lengths.d.ts.map +1 -0
  552. package/dist/text/lengths.js +40 -0
  553. package/dist/text/lengths.js.map +1 -0
  554. package/dist/text/lists.d.ts +44 -0
  555. package/dist/text/lists.d.ts.map +1 -0
  556. package/dist/text/lists.js +100 -0
  557. package/dist/text/lists.js.map +1 -0
  558. package/dist/text/overflow.d.ts +11 -0
  559. package/dist/text/overflow.d.ts.map +1 -0
  560. package/dist/text/overflow.js +13 -0
  561. package/dist/text/overflow.js.map +1 -0
  562. package/dist/text/paragraphs.d.ts +62 -0
  563. package/dist/text/paragraphs.d.ts.map +1 -0
  564. package/dist/text/paragraphs.js +166 -0
  565. package/dist/text/paragraphs.js.map +1 -0
  566. package/dist/text/picture.d.ts +18 -0
  567. package/dist/text/picture.d.ts.map +1 -0
  568. package/dist/text/picture.js +41 -0
  569. package/dist/text/picture.js.map +1 -0
  570. package/dist/text/references.d.ts +21 -0
  571. package/dist/text/references.d.ts.map +1 -0
  572. package/dist/text/references.js +43 -0
  573. package/dist/text/references.js.map +1 -0
  574. package/dist/text/schema.d.ts +10 -0
  575. package/dist/text/schema.d.ts.map +1 -0
  576. package/dist/text/schema.js +11 -0
  577. package/dist/text/schema.js.map +1 -0
  578. package/dist/transfer/apply.d.ts +9 -0
  579. package/dist/transfer/apply.d.ts.map +1 -0
  580. package/dist/transfer/apply.js +65 -0
  581. package/dist/transfer/apply.js.map +1 -0
  582. package/dist/transfer/history.d.ts +8 -0
  583. package/dist/transfer/history.d.ts.map +1 -0
  584. package/dist/transfer/history.js +32 -0
  585. package/dist/transfer/history.js.map +1 -0
  586. package/dist/transfer/identity.js +12 -0
  587. package/dist/transfer/identity.js.map +1 -0
  588. package/dist/transfer/index.d.ts +7 -0
  589. package/dist/transfer/index.js +7 -0
  590. package/dist/transfer/nodes.d.ts +14 -0
  591. package/dist/transfer/nodes.d.ts.map +1 -0
  592. package/dist/transfer/nodes.js +82 -0
  593. package/dist/transfer/nodes.js.map +1 -0
  594. package/dist/transfer/plan.d.ts +29 -0
  595. package/dist/transfer/plan.d.ts.map +1 -0
  596. package/dist/transfer/plan.js +106 -0
  597. package/dist/transfer/plan.js.map +1 -0
  598. package/dist/transfer/references.js +10 -0
  599. package/dist/transfer/references.js.map +1 -0
  600. package/dist/transfer/remove.d.ts +8 -0
  601. package/dist/transfer/remove.d.ts.map +1 -0
  602. package/dist/transfer/remove.js +34 -0
  603. package/dist/transfer/remove.js.map +1 -0
  604. package/dist/transfer/validation.js +39 -0
  605. package/dist/transfer/validation.js.map +1 -0
  606. package/dist/transfer/variables.d.ts +15 -0
  607. package/dist/transfer/variables.d.ts.map +1 -0
  608. package/dist/transfer/variables.js +52 -0
  609. package/dist/transfer/variables.js.map +1 -0
  610. package/dist/types.d.ts +910 -0
  611. package/dist/types.d.ts.map +1 -0
  612. package/dist/types.js +89 -0
  613. package/dist/types.js.map +1 -0
  614. package/dist/undo.d.ts +93 -0
  615. package/dist/undo.d.ts.map +1 -0
  616. package/dist/undo.js +236 -0
  617. package/dist/undo.js.map +1 -0
  618. package/dist/variables/bindings.d.ts +66 -0
  619. package/dist/variables/bindings.d.ts.map +1 -0
  620. package/dist/variables/bindings.js +251 -0
  621. package/dist/variables/bindings.js.map +1 -0
  622. package/dist/variables/corners.d.ts +12 -0
  623. package/dist/variables/corners.d.ts.map +1 -0
  624. package/dist/variables/corners.js +38 -0
  625. package/dist/variables/corners.js.map +1 -0
  626. package/dist/variables/fields.d.ts +30 -0
  627. package/dist/variables/fields.d.ts.map +1 -0
  628. package/dist/variables/fields.js +89 -0
  629. package/dist/variables/fields.js.map +1 -0
  630. package/dist/variables/formula/check.d.ts +14 -0
  631. package/dist/variables/formula/check.d.ts.map +1 -0
  632. package/dist/variables/formula/check.js +73 -0
  633. package/dist/variables/formula/check.js.map +1 -0
  634. package/dist/variables/formula/evaluate.d.ts +7 -0
  635. package/dist/variables/formula/evaluate.d.ts.map +1 -0
  636. package/dist/variables/formula/evaluate.js +30 -0
  637. package/dist/variables/formula/evaluate.js.map +1 -0
  638. package/dist/variables/formula/index.d.ts +21 -0
  639. package/dist/variables/formula/index.d.ts.map +1 -0
  640. package/dist/variables/formula/index.js +77 -0
  641. package/dist/variables/formula/index.js.map +1 -0
  642. package/dist/variables/formula/parse.js +141 -0
  643. package/dist/variables/formula/parse.js.map +1 -0
  644. package/dist/variables/formula/print.d.ts +25 -0
  645. package/dist/variables/formula/print.d.ts.map +1 -0
  646. package/dist/variables/formula/print.js +105 -0
  647. package/dist/variables/formula/print.js.map +1 -0
  648. package/dist/variables/formula/schema.d.ts +7 -0
  649. package/dist/variables/formula/schema.d.ts.map +1 -0
  650. package/dist/variables/formula/schema.js +62 -0
  651. package/dist/variables/formula/schema.js.map +1 -0
  652. package/dist/variables/formula/signatures.d.ts +9 -0
  653. package/dist/variables/formula/signatures.d.ts.map +1 -0
  654. package/dist/variables/formula/signatures.js +238 -0
  655. package/dist/variables/formula/signatures.js.map +1 -0
  656. package/dist/variables/formula/tokens.d.ts +26 -0
  657. package/dist/variables/formula/tokens.d.ts.map +1 -0
  658. package/dist/variables/formula/tokens.js +82 -0
  659. package/dist/variables/formula/tokens.js.map +1 -0
  660. package/dist/variables/formula/tree.d.ts +22 -0
  661. package/dist/variables/formula/tree.d.ts.map +1 -0
  662. package/dist/variables/formula/tree.js +35 -0
  663. package/dist/variables/formula/tree.js.map +1 -0
  664. package/dist/variables/index.d.ts +41 -0
  665. package/dist/variables/index.d.ts.map +1 -0
  666. package/dist/variables/index.js +246 -0
  667. package/dist/variables/index.js.map +1 -0
  668. package/dist/variables/resolution.d.ts +39 -0
  669. package/dist/variables/resolution.d.ts.map +1 -0
  670. package/dist/variables/resolution.js +154 -0
  671. package/dist/variables/resolution.js.map +1 -0
  672. package/dist/variables/schema.d.ts +40 -0
  673. package/dist/variables/schema.d.ts.map +1 -0
  674. package/dist/variables/schema.js +32 -0
  675. package/dist/variables/schema.js.map +1 -0
  676. package/dist/variables/text.d.ts +21 -0
  677. package/dist/variables/text.d.ts.map +1 -0
  678. package/dist/variables/text.js +58 -0
  679. package/dist/variables/text.js.map +1 -0
  680. package/dist/variables/token.d.ts +18 -0
  681. package/dist/variables/token.d.ts.map +1 -0
  682. package/dist/variables/token.js +39 -0
  683. package/dist/variables/token.js.map +1 -0
  684. package/dist/variables/units.js +19 -0
  685. package/dist/variables/units.js.map +1 -0
  686. package/dist/variables/value.d.ts +12 -0
  687. package/dist/variables/value.d.ts.map +1 -0
  688. package/dist/variables/value.js +70 -0
  689. package/dist/variables/value.js.map +1 -0
  690. package/dist/variant-name.d.ts +6 -0
  691. package/dist/variant-name.d.ts.map +1 -0
  692. package/dist/variant-name.js +17 -0
  693. package/dist/variant-name.js.map +1 -0
  694. package/dist/variant-properties.d.ts +18 -0
  695. package/dist/variant-properties.d.ts.map +1 -0
  696. package/dist/variant-properties.js +74 -0
  697. package/dist/variant-properties.js.map +1 -0
  698. package/dist/vector-network.d.ts +48 -0
  699. package/dist/vector-network.d.ts.map +1 -0
  700. package/dist/vector-network.js +352 -0
  701. package/dist/vector-network.js.map +1 -0
  702. package/package.json +352 -4
  703. package/src/agent-notes/index.ts +2 -0
  704. package/src/agent-notes/model.ts +46 -0
  705. package/src/agent-notes/schema.ts +28 -0
  706. package/src/arrow-caps.ts +364 -0
  707. package/src/asset-keys.ts +25 -0
  708. package/src/behaviours/index.ts +5 -0
  709. package/src/behaviours/kinds.ts +185 -0
  710. package/src/behaviours/layers.ts +51 -0
  711. package/src/behaviours/model.ts +184 -0
  712. package/src/behaviours/schema.ts +93 -0
  713. package/src/behaviours/spec.ts +178 -0
  714. package/src/bindings.ts +20 -0
  715. package/src/browser-node/index.ts +2 -0
  716. package/src/browser-node/model.ts +35 -0
  717. package/src/browser-node/schema.ts +62 -0
  718. package/src/buffered-events.ts +64 -0
  719. package/src/checkpoint.ts +123 -0
  720. package/src/clipping.ts +112 -0
  721. package/src/color/contrast.ts +71 -0
  722. package/src/color/index.ts +89 -0
  723. package/src/color/management.ts +210 -0
  724. package/src/color/normalize.ts +7 -0
  725. package/src/color/okhcl.ts +201 -0
  726. package/src/color/schema.ts +10 -0
  727. package/src/comments/document.ts +51 -0
  728. package/src/comments/index.ts +5 -0
  729. package/src/comments/list.ts +52 -0
  730. package/src/comments/merge.ts +63 -0
  731. package/src/comments/schema.ts +51 -0
  732. package/src/comments/threads.ts +156 -0
  733. package/src/components/exposure.ts +61 -0
  734. package/src/components/index.ts +9 -0
  735. package/src/components/library-page.ts +17 -0
  736. package/src/components/properties.ts +241 -0
  737. package/src/components/variants.ts +53 -0
  738. package/src/connectors/controls.ts +229 -0
  739. package/src/connectors/create.ts +48 -0
  740. package/src/connectors/elbow.ts +235 -0
  741. package/src/connectors/gaps.ts +72 -0
  742. package/src/connectors/hit.ts +60 -0
  743. package/src/connectors/index.ts +28 -0
  744. package/src/connectors/label.ts +238 -0
  745. package/src/connectors/layout.ts +280 -0
  746. package/src/connectors/pieces.ts +144 -0
  747. package/src/connectors/route.ts +148 -0
  748. package/src/connectors/sides.ts +94 -0
  749. package/src/connectors/sublayers.ts +204 -0
  750. package/src/constants.ts +13 -0
  751. package/src/coordinate.ts +298 -0
  752. package/src/copy.ts +341 -0
  753. package/src/css/grid.ts +70 -0
  754. package/src/css/index.ts +10 -0
  755. package/src/css/layout.ts +53 -0
  756. package/src/css/shadows.ts +68 -0
  757. package/src/css/text.ts +84 -0
  758. package/src/css/values.ts +42 -0
  759. package/src/events.ts +21 -0
  760. package/src/export-format.ts +33 -0
  761. package/src/export-scale.ts +16 -0
  762. package/src/fields/appearance.ts +35 -0
  763. package/src/fields/geometry.ts +11 -0
  764. package/src/fields/index.ts +4 -0
  765. package/src/fields/layout.ts +48 -0
  766. package/src/fields/text.ts +64 -0
  767. package/src/fig-compression.ts +9 -0
  768. package/src/figjam/index.ts +2 -0
  769. package/src/figjam/palette.ts +308 -0
  770. package/src/figjam/text.ts +78 -0
  771. package/src/font-style.ts +121 -0
  772. package/src/generated/index.ts +81 -0
  773. package/src/generated/kind.ts +26 -0
  774. package/src/generated/shape-with-text.ts +132 -0
  775. package/src/generated/sticky.ts +214 -0
  776. package/src/geometry.ts +490 -0
  777. package/src/gradient.ts +275 -0
  778. package/src/graph.ts +842 -0
  779. package/src/group-bounds.ts +178 -0
  780. package/src/guides.ts +47 -0
  781. package/src/hit-test.ts +501 -0
  782. package/src/icons/glyph.ts +128 -0
  783. package/src/icons/index.ts +3 -0
  784. package/src/icons/model.ts +63 -0
  785. package/src/icons/schema.ts +34 -0
  786. package/src/ids.ts +34 -0
  787. package/src/images.ts +89 -0
  788. package/src/index.ts +4 -0
  789. package/src/instances/assignments.ts +116 -0
  790. package/src/instances/content-size.ts +84 -0
  791. package/src/instances/copies.ts +244 -0
  792. package/src/instances/cycles.ts +73 -0
  793. package/src/instances/fields.ts +90 -0
  794. package/src/instances/index.ts +467 -0
  795. package/src/instances/main-component.ts +61 -0
  796. package/src/instances/modes.ts +39 -0
  797. package/src/instances/overrides.ts +240 -0
  798. package/src/instances/placement.ts +29 -0
  799. package/src/instances/replacements.ts +80 -0
  800. package/src/instances/source-walk.ts +35 -0
  801. package/src/instances/sync.ts +556 -0
  802. package/src/instances/vector-geometry.ts +81 -0
  803. package/src/layout/aspect-ratio.ts +51 -0
  804. package/src/layout/guides.ts +132 -0
  805. package/src/layout/index.ts +4 -0
  806. package/src/layout/keywords.ts +74 -0
  807. package/src/layout/sizing.ts +196 -0
  808. package/src/layout/writes.ts +59 -0
  809. package/src/matrix.ts +116 -0
  810. package/src/mutation-impact.ts +85 -0
  811. package/src/naming.ts +11 -0
  812. package/src/node-defaults.ts +260 -0
  813. package/src/order-keys.ts +162 -0
  814. package/src/paints/index.ts +1 -0
  815. package/src/paints/schema.ts +72 -0
  816. package/src/parse-path.ts +244 -0
  817. package/src/plugin-data/citation.ts +27 -0
  818. package/src/plugin-data/field.ts +140 -0
  819. package/src/plugin-data/fields.ts +306 -0
  820. package/src/plugin-data/index.ts +3 -0
  821. package/src/plugin-data/schema.ts +35 -0
  822. package/src/polygon.ts +228 -0
  823. package/src/preview.ts +80 -0
  824. package/src/primitives/index.ts +44 -0
  825. package/src/primitives/schema.ts +14 -0
  826. package/src/random.ts +28 -0
  827. package/src/resize.ts +415 -0
  828. package/src/scaling/index.ts +9 -0
  829. package/src/scaling/node.ts +168 -0
  830. package/src/scaling/tree.ts +85 -0
  831. package/src/script/index.ts +1 -0
  832. package/src/script/schema.ts +65 -0
  833. package/src/shaders/directives.ts +366 -0
  834. package/src/shaders/index.ts +4 -0
  835. package/src/shaders/model.ts +147 -0
  836. package/src/shaders/schema.ts +84 -0
  837. package/src/shaders/still.ts +41 -0
  838. package/src/shape-with-text/fit.ts +154 -0
  839. package/src/shape-with-text/geometry.ts +496 -0
  840. package/src/shape-with-text/index.ts +10 -0
  841. package/src/shape-with-text/kinds.ts +86 -0
  842. package/src/shared-styles.ts +137 -0
  843. package/src/slots/authoring.ts +101 -0
  844. package/src/slots/content.ts +127 -0
  845. package/src/slots/frames.ts +160 -0
  846. package/src/slots/index.ts +4 -0
  847. package/src/slots/limits.ts +49 -0
  848. package/src/snap.ts +349 -0
  849. package/src/source-metadata.ts +8 -0
  850. package/src/statuses/impact.ts +38 -0
  851. package/src/statuses/index.ts +4 -0
  852. package/src/statuses/node.ts +63 -0
  853. package/src/statuses/schema.ts +39 -0
  854. package/src/statuses/workflow.ts +121 -0
  855. package/src/text/direction.ts +55 -0
  856. package/src/text/index.ts +6 -0
  857. package/src/text/lengths.ts +34 -0
  858. package/src/text/lists.ts +138 -0
  859. package/src/text/overflow.ts +12 -0
  860. package/src/text/paragraphs.ts +241 -0
  861. package/src/text/picture.ts +57 -0
  862. package/src/text/references.ts +50 -0
  863. package/src/text/schema.ts +7 -0
  864. package/src/transfer/apply.ts +84 -0
  865. package/src/transfer/history.ts +49 -0
  866. package/src/transfer/identity.ts +16 -0
  867. package/src/transfer/index.ts +6 -0
  868. package/src/transfer/nodes.ts +128 -0
  869. package/src/transfer/plan.ts +130 -0
  870. package/src/transfer/references.ts +9 -0
  871. package/src/transfer/remove.ts +39 -0
  872. package/src/transfer/validation.ts +59 -0
  873. package/src/transfer/variables.ts +83 -0
  874. package/src/types.ts +1205 -0
  875. package/src/undo.ts +285 -0
  876. package/src/variables/bindings.ts +310 -0
  877. package/src/variables/corners.ts +39 -0
  878. package/src/variables/fields.ts +109 -0
  879. package/src/variables/formula/check.ts +99 -0
  880. package/src/variables/formula/evaluate.ts +33 -0
  881. package/src/variables/formula/index.ts +129 -0
  882. package/src/variables/formula/parse.ts +160 -0
  883. package/src/variables/formula/print.ts +167 -0
  884. package/src/variables/formula/schema.ts +77 -0
  885. package/src/variables/formula/signatures.ts +266 -0
  886. package/src/variables/formula/tokens.ts +114 -0
  887. package/src/variables/formula/tree.ts +53 -0
  888. package/src/variables/index.ts +400 -0
  889. package/src/variables/resolution.ts +293 -0
  890. package/src/variables/schema.ts +31 -0
  891. package/src/variables/text.ts +61 -0
  892. package/src/variables/token.ts +40 -0
  893. package/src/variables/units.ts +15 -0
  894. package/src/variables/value.ts +92 -0
  895. package/src/variant-name.ts +15 -0
  896. package/src/variant-properties.ts +98 -0
  897. package/src/vector-network.ts +489 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit.js","names":[],"sources":["../../src/shape-with-text/fit.ts"],"sourcesContent":["import type { ShapeWithTextType } from './kinds'\n\n/** The height of a database's elliptical cap: FigJam keeps it 24 px tall at any size. */\nexport function databaseCap(w: number, h: number): number {\n return Math.min(24, h * 0.25, w * 0.25)\n}\n\nexport interface LabelBox {\n x: number\n y: number\n width: number\n height: number\n}\n\ntype Insets = readonly [left: number, top: number, right: number, bottom: number]\n\n/** The 16 px FigJam leaves around a label, 8 px on a shape less than 100 px on a side. */\nfunction labelPadding(width: number, height: number): number {\n return Math.min(width, height) < 100 ? 8 : 16\n}\n\n/** FigJam doubles some kinds' insets on a shape 300 px wide or more. */\nfunction wide(width: number): boolean {\n return width >= 300\n}\n\ntype InsetRule = (width: number, height: number, padding: number) => Insets\n\n/** A triangle's label sits under its middle, 4 px in from its sides; returns its top and bottom. */\nfunction triangleInsets(width: number, height: number): readonly [apex: number, base: number] {\n const lean = (4 * height) / width\n return [height / 2 + lean, 8 + lean]\n}\n\n/** The rectangle inscribed in an ellipse, its width rounded to a whole pixel. */\nconst ellipseInsets: InsetRule = (width, height) => {\n const label = Math.round(width / Math.SQRT2)\n const x = (width - label) / 2\n const y = (height - height * Math.sqrt(1 - (label / width) ** 2)) / 2\n return [x, y, x, y]\n}\n\n/**\n * The px FigJam leaves free on each side of a label in each kind, measured from its saved label\n * layouts. Insets that scale do so with the side they lie along.\n */\nconst LABEL_INSETS: Record<ShapeWithTextType, InsetRule> = {\n SQUARE: (_w, _h, p) => [p, p, p, p],\n ROUNDED_RECTANGLE: (w, _h, p) => {\n const inset = wide(w) ? p * 2 : p\n return [inset, inset, inset, inset]\n },\n ELLIPSE: ellipseInsets,\n SUMMING_JUNCTION: ellipseInsets,\n OR: ellipseInsets,\n DIAMOND: (w, h) => [w / 4 + 4, h / 4 + 4, w / 4 + 4, h / 4 + 4],\n TRIANGLE_UP: (w, h) => {\n const [apex, base] = triangleInsets(w, h)\n return [w / 4, apex, w / 4, base]\n },\n TRIANGLE_DOWN: (w, h) => {\n const [apex, base] = triangleInsets(w, h)\n return [w / 4, base, w / 4, apex]\n },\n PARALLELOGRAM_RIGHT: (w, _h, p) => [(13 * w) / 62 + 6, p, (13 * w) / 62 + 6, p],\n PARALLELOGRAM_LEFT: (w, _h, p) => [(13 * w) / 62 + 6, p, (13 * w) / 62 + 6, p],\n // Below the cap and its rim, above the bottom curve.\n ENG_DATABASE: (w, h, p) => [p, databaseCap(w, h) * 2 + p, p, databaseCap(w, h)],\n ENG_QUEUE: (_w, _h, p) => [24, p, 64, p],\n ENG_FILE: (_w, _h, p) => [p, 64, p, 64],\n ENG_FOLDER: (_w, _h, p) => [p, 60, p, p],\n TRAPEZOID: (w, _h, p) => [(16 * w) / 121, p, (16 * w) / 121, p],\n HEXAGON: (w, _h, p) => [(8 * w) / 121, p, (8 * w) / 121, p],\n PREDEFINED_PROCESS: (w) => (wide(w) ? [48, 24, 48, 24] : [32, 16, 32, 16]),\n INTERNAL_STORAGE: (w) => (wide(w) ? [40, 40, 24, 24] : [24, 24, 16, 16]),\n SHIELD: (_w, h, p) => [p, h * 0.075, p, h * 0.1977],\n DOCUMENT_SINGLE: (_w, _h, p) => [p, p, p, 28],\n DOCUMENT_MULTIPLE: (_w, _h, p) => [32, p, p, 28],\n MANUAL_INPUT: (_w, _h, p) => [p, 24, p, p],\n CHEVRON: (_w, _h, p) => [43, p, 43, p],\n PENTAGON: (w, h) => [w * 0.115, h * 0.27403, w * 0.115, h * 0.08454],\n OCTAGON: (w, h) => [w * 0.11466, h * 0.1193, w * 0.11466, h * 0.1193],\n STAR: (w, h) => [w * 0.19531, h * 0.3028, w * 0.19531, h * 0.109],\n PLUS: (_w, h, p) => [p, (h * 5) / 18, p, (h * 5) / 18],\n ARROW_LEFT: (_w, h, p) => [54, h * 0.25465, p, h * 0.25465],\n ARROW_RIGHT: (_w, h, p) => [p, h * 0.25465, 54, h * 0.25465],\n // Above the tail, an eighth of the shape and at most 32 px tall.\n SPEECH_BUBBLE: (w, h, p) => [p, p, p, p + Math.min(32, Math.min(w, h) / 8)]\n}\n\n/** Where a shape's label sits inside its `width` × `height` box. */\nexport function shapeWithTextLabelBox(\n type: ShapeWithTextType,\n width: number,\n height: number\n): LabelBox {\n const [left, top, right, bottom] = LABEL_INSETS[type](width, height, labelPadding(width, height))\n const x = insetWithin(left, right, width)\n const y = insetWithin(top, bottom, height)\n return {\n x,\n y,\n width: Math.max(0, width - x - right),\n height: Math.max(0, height - y - bottom)\n }\n}\n\n/** The inset before a label, its share of `size` when both insets do not fit in it. */\nfunction insetWithin(before: number, after: number, size: number): number {\n return before + after <= size ? before : (size * before) / (before + after)\n}\n\n/** Measures a label wrapped at `maxWidth`; its height is what the wrapped lines take. */\nexport type LabelMeasure = (maxWidth: number) => { width: number; height: number }\n\nconst LARGEST = 100_000\n\n/** Whether a kind grows for its label; FigJam keeps summing junctions and ors round. */\nexport function shapeWithTextGrows(type: ShapeWithTextType): boolean {\n return type !== 'SUMMING_JUNCTION' && type !== 'OR'\n}\n\n/**\n * The height a `width`-wide shape of `type` takes for its label, as FigJam fits it: the height it\n * was given while the label fits its label box, else the smallest whole height whose label box\n * holds the label. FigJam never widens a shape for its label; a word too long for it breaks.\n */\nexport function fitShapeWithTextHeight(\n type: ShapeWithTextType,\n width: number,\n height: number,\n measure: LabelMeasure\n): number {\n const fits = (h: number) => {\n const box = shapeWithTextLabelBox(type, width, h)\n return measure(box.width).height <= box.height\n }\n if (width <= 0 || height <= 0 || !shapeWithTextGrows(type) || fits(height)) return height\n let low = height\n let high = Math.max(height * 2, height + 16)\n while (!fits(high)) {\n low = high\n high *= 2\n if (high > LARGEST) return LARGEST\n }\n // The smallest whole height that fits, above a height that does not.\n low = Math.floor(low)\n while (high - low > 1) {\n const middle = Math.floor((low + high) / 2)\n if (fits(middle)) high = middle\n else low = middle\n }\n return Math.ceil(high)\n}\n"],"mappings":";;AAGA,SAAgB,YAAY,GAAW,GAAmB;CACxD,OAAO,KAAK,IAAI,IAAI,IAAI,KAAM,IAAI,GAAI;AACxC;;AAYA,SAAS,aAAa,OAAe,QAAwB;CAC3D,OAAO,KAAK,IAAI,OAAO,MAAM,IAAI,MAAM,IAAI;AAC7C;;AAGA,SAAS,KAAK,OAAwB;CACpC,OAAO,SAAS;AAClB;;AAKA,SAAS,eAAe,OAAe,QAAuD;CAC5F,MAAM,OAAQ,IAAI,SAAU;CAC5B,OAAO,CAAC,SAAS,IAAI,MAAM,IAAI,IAAI;AACrC;;AAGA,MAAM,iBAA4B,OAAO,WAAW;CAClD,MAAM,QAAQ,KAAK,MAAM,QAAQ,KAAK,KAAK;CAC3C,MAAM,KAAK,QAAQ,SAAS;CAC5B,MAAM,KAAK,SAAS,SAAS,KAAK,KAAK,KAAK,QAAQ,UAAU,CAAC,KAAK;CACpE,OAAO;EAAC;EAAG;EAAG;EAAG;CAAC;AACpB;;;;;AAMA,MAAM,eAAqD;CACzD,SAAS,IAAI,IAAI,MAAM;EAAC;EAAG;EAAG;EAAG;CAAC;CAClC,oBAAoB,GAAG,IAAI,MAAM;EAC/B,MAAM,QAAQ,KAAK,CAAC,IAAI,IAAI,IAAI;EAChC,OAAO;GAAC;GAAO;GAAO;GAAO;EAAK;CACpC;CACA,SAAS;CACT,kBAAkB;CAClB,IAAI;CACJ,UAAU,GAAG,MAAM;EAAC,IAAI,IAAI;EAAG,IAAI,IAAI;EAAG,IAAI,IAAI;EAAG,IAAI,IAAI;CAAC;CAC9D,cAAc,GAAG,MAAM;EACrB,MAAM,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;AAKA,MAAM,UAAU;;AAGhB,SAAgB,mBAAmB,MAAkC;CACnE,OAAO,SAAS,sBAAsB,SAAS;AACjD;;;;;;AAOA,SAAgB,uBACd,MACA,OACA,QACA,SACQ;CACR,MAAM,QAAQ,MAAc;EAC1B,MAAM,MAAM,sBAAsB,MAAM,OAAO,CAAC;EAChD,OAAO,QAAQ,IAAI,KAAK,CAAC,CAAC,UAAU,IAAI;CAC1C;CACA,IAAI,SAAS,KAAK,UAAU,KAAK,CAAC,mBAAmB,IAAI,KAAK,KAAK,MAAM,GAAG,OAAO;CACnF,IAAI,MAAM;CACV,IAAI,OAAO,KAAK,IAAI,SAAS,GAAG,SAAS,EAAE;CAC3C,OAAO,CAAC,KAAK,IAAI,GAAG;EAClB,MAAM;EACN,QAAQ;EACR,IAAI,OAAO,SAAS,OAAO;CAC7B;CAEA,MAAM,KAAK,MAAM,GAAG;CACpB,OAAO,OAAO,MAAM,GAAG;EACrB,MAAM,SAAS,KAAK,OAAO,MAAM,QAAQ,CAAC;EAC1C,IAAI,KAAK,MAAM,GAAG,OAAO;OACpB,MAAM;CACb;CACA,OAAO,KAAK,KAAK,IAAI;AACvB"}
@@ -0,0 +1,20 @@
1
+ import { ShapeWithTextType } from "./kinds.js";
2
+ import { PolygonOutlineCommand } from "../polygon.js";
3
+ //#region src/shape-with-text/geometry.d.ts
4
+ interface ShapeWithTextGeometry {
5
+ /** The closed outline that is filled and stroked, and that connectors attach to. */
6
+ outline: PolygonOutlineCommand[];
7
+ /** Inner lines that are stroked only, such as a database's front rim. */
8
+ details: PolygonOutlineCommand[];
9
+ }
10
+ /** How far a parallelogram's sides lean: FigJam leans them with the height, not the width. */
11
+ declare function parallelogramSlant(w: number, h: number): number;
12
+ /**
13
+ * The outline and inner lines of a shape of `type` filling a `width` × `height` box. Outlines
14
+ * made only of straight segments have their corners rounded to `cornerRadius`; outlines with
15
+ * curves, such as a rounded rectangle, keep their own shape.
16
+ */
17
+ declare function shapeWithTextGeometry(type: ShapeWithTextType, width: number, height: number, cornerRadius?: number): ShapeWithTextGeometry;
18
+ //#endregion
19
+ export { ShapeWithTextGeometry, parallelogramSlant, shapeWithTextGeometry };
20
+ //# sourceMappingURL=geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry.d.ts","names":[],"sources":["../../src/shape-with-text/geometry.ts"],"mappings":";;;UAIiB;;EAEf,SAAS;;EAET,SAAS;;;iBAqIK,mBAAmB,WAAW;;;;;;iBAwV9B,sBACd,MAAM,mBACN,eACA,gBACA,wBACC"}
@@ -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,KAAK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K,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"}