@open-pencil/scene-graph 0.17.0 → 0.18.0-beta.1

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 (423) hide show
  1. package/dist/behaviours/index.d.ts +3 -2
  2. package/dist/behaviours/index.js +2 -1
  3. package/dist/behaviours/kinds.d.ts.map +1 -1
  4. package/dist/behaviours/kinds.js +15 -8
  5. package/dist/behaviours/kinds.js.map +1 -1
  6. package/dist/behaviours/model.d.ts +2 -2
  7. package/dist/behaviours/model.d.ts.map +1 -1
  8. package/dist/behaviours/model.js.map +1 -1
  9. package/dist/behaviours/schema.d.ts +136 -1
  10. package/dist/behaviours/schema.d.ts.map +1 -1
  11. package/dist/behaviours/schema.js +17 -2
  12. package/dist/behaviours/schema.js.map +1 -1
  13. package/dist/behaviours/spec.d.ts.map +1 -1
  14. package/dist/behaviours/spec.js +4 -0
  15. package/dist/behaviours/spec.js.map +1 -1
  16. package/dist/behaviours/transition.d.ts +23 -0
  17. package/dist/behaviours/transition.d.ts.map +1 -0
  18. package/dist/behaviours/transition.js +36 -0
  19. package/dist/behaviours/transition.js.map +1 -0
  20. package/dist/checkpoint.d.ts.map +1 -1
  21. package/dist/checkpoint.js +2 -0
  22. package/dist/checkpoint.js.map +1 -1
  23. package/dist/color/index.d.ts +12 -9
  24. package/dist/color/index.d.ts.map +1 -1
  25. package/dist/color/index.js +15 -25
  26. package/dist/color/index.js.map +1 -1
  27. package/dist/color/management.d.ts +51 -23
  28. package/dist/color/management.d.ts.map +1 -1
  29. package/dist/color/management.js +154 -149
  30. package/dist/color/management.js.map +1 -1
  31. package/dist/color/okhcl.d.ts +28 -10
  32. package/dist/color/okhcl.d.ts.map +1 -1
  33. package/dist/color/okhcl.js +56 -40
  34. package/dist/color/okhcl.js.map +1 -1
  35. package/dist/color/schema.d.ts +6 -1
  36. package/dist/color/schema.d.ts.map +1 -1
  37. package/dist/color/schema.js +10 -1
  38. package/dist/color/schema.js.map +1 -1
  39. package/dist/constraints.d.ts.map +1 -1
  40. package/dist/constraints.js +2 -1
  41. package/dist/constraints.js.map +1 -1
  42. package/dist/copy.d.ts +7 -1
  43. package/dist/copy.d.ts.map +1 -1
  44. package/dist/copy.js +22 -1
  45. package/dist/copy.js.map +1 -1
  46. package/dist/corners.d.ts +3 -1
  47. package/dist/corners.d.ts.map +1 -1
  48. package/dist/corners.js +3 -1
  49. package/dist/corners.js.map +1 -1
  50. package/dist/css/grid.js +1 -1
  51. package/dist/css/index.d.ts +2 -1
  52. package/dist/css/index.js +3 -2
  53. package/dist/css/motion.d.ts +12 -0
  54. package/dist/css/motion.d.ts.map +1 -0
  55. package/dist/css/motion.js +60 -0
  56. package/dist/css/motion.js.map +1 -0
  57. package/dist/css/shadows.d.ts +4 -3
  58. package/dist/css/shadows.d.ts.map +1 -1
  59. package/dist/css/shadows.js +7 -6
  60. package/dist/css/shadows.js.map +1 -1
  61. package/dist/css/values.d.ts +3 -2
  62. package/dist/css/values.d.ts.map +1 -1
  63. package/dist/css/values.js +4 -4
  64. package/dist/css/values.js.map +1 -1
  65. package/dist/fields/index.d.ts +2 -2
  66. package/dist/fields/index.js +2 -2
  67. package/dist/fields/layout.d.ts +3 -1
  68. package/dist/fields/layout.d.ts.map +1 -1
  69. package/dist/fields/layout.js +9 -1
  70. package/dist/fields/layout.js.map +1 -1
  71. package/dist/figjam/palette.js +1 -1
  72. package/dist/font-style.d.ts.map +1 -1
  73. package/dist/font-style.js +7 -3
  74. package/dist/font-style.js.map +1 -1
  75. package/dist/generated/index.d.ts +6 -2
  76. package/dist/generated/index.d.ts.map +1 -1
  77. package/dist/generated/index.js +14 -4
  78. package/dist/generated/index.js.map +1 -1
  79. package/dist/geometry.d.ts +6 -1
  80. package/dist/geometry.d.ts.map +1 -1
  81. package/dist/geometry.js +10 -2
  82. package/dist/geometry.js.map +1 -1
  83. package/dist/graph.d.ts +29 -4
  84. package/dist/graph.d.ts.map +1 -1
  85. package/dist/graph.js +59 -9
  86. package/dist/graph.js.map +1 -1
  87. package/dist/group-bounds.d.ts +5 -2
  88. package/dist/group-bounds.d.ts.map +1 -1
  89. package/dist/group-bounds.js +38 -8
  90. package/dist/group-bounds.js.map +1 -1
  91. package/dist/hit-test.d.ts.map +1 -1
  92. package/dist/hit-test.js +19 -8
  93. package/dist/hit-test.js.map +1 -1
  94. package/dist/index.d.ts +2 -2
  95. package/dist/index.js +2 -2
  96. package/dist/instances/content-size.js +1 -1
  97. package/dist/instances/fields.d.ts +2 -2
  98. package/dist/instances/fields.d.ts.map +1 -1
  99. package/dist/instances/fields.js +2 -0
  100. package/dist/instances/fields.js.map +1 -1
  101. package/dist/instances/index.d.ts.map +1 -1
  102. package/dist/instances/index.js +50 -11
  103. package/dist/instances/index.js.map +1 -1
  104. package/dist/instances/sync.js +67 -7
  105. package/dist/instances/sync.js.map +1 -1
  106. package/dist/layout/flow.d.ts +16 -0
  107. package/dist/layout/flow.d.ts.map +1 -0
  108. package/dist/layout/flow.js +34 -0
  109. package/dist/layout/flow.js.map +1 -0
  110. package/dist/layout/index.d.ts +4 -3
  111. package/dist/layout/index.js +4 -3
  112. package/dist/layout/keywords.d.ts.map +1 -1
  113. package/dist/layout/keywords.js +7 -1
  114. package/dist/layout/keywords.js.map +1 -1
  115. package/dist/layout/sizing.d.ts +9 -1
  116. package/dist/layout/sizing.d.ts.map +1 -1
  117. package/dist/layout/sizing.js +17 -1
  118. package/dist/layout/sizing.js.map +1 -1
  119. package/dist/layout/spacing.d.ts +7 -1
  120. package/dist/layout/spacing.d.ts.map +1 -1
  121. package/dist/layout/spacing.js +10 -1
  122. package/dist/layout/spacing.js.map +1 -1
  123. package/dist/mesh/geometry.d.ts +83 -0
  124. package/dist/mesh/geometry.d.ts.map +1 -0
  125. package/dist/mesh/geometry.js +441 -0
  126. package/dist/mesh/geometry.js.map +1 -0
  127. package/dist/mesh/index.d.ts +4 -0
  128. package/dist/mesh/index.js +4 -0
  129. package/dist/mesh/model.d.ts +28 -0
  130. package/dist/mesh/model.d.ts.map +1 -0
  131. package/dist/mesh/model.js +40 -0
  132. package/dist/mesh/model.js.map +1 -0
  133. package/dist/mesh/schema.d.ts +191 -0
  134. package/dist/mesh/schema.d.ts.map +1 -0
  135. package/dist/mesh/schema.js +56 -0
  136. package/dist/mesh/schema.js.map +1 -0
  137. package/dist/mutation-impact.d.ts +2 -0
  138. package/dist/mutation-impact.d.ts.map +1 -1
  139. package/dist/mutation-impact.js +18 -7
  140. package/dist/mutation-impact.js.map +1 -1
  141. package/dist/node-defaults.d.ts +3 -1
  142. package/dist/node-defaults.d.ts.map +1 -1
  143. package/dist/node-defaults.js +22 -6
  144. package/dist/node-defaults.js.map +1 -1
  145. package/dist/paints/index.d.ts +5 -3
  146. package/dist/paints/index.js +5 -3
  147. package/dist/paints/pattern.d.ts +5 -1
  148. package/dist/paints/pattern.d.ts.map +1 -1
  149. package/dist/paints/pattern.js +33 -1
  150. package/dist/paints/pattern.js.map +1 -1
  151. package/dist/paints/shows.d.ts +4 -1
  152. package/dist/paints/shows.d.ts.map +1 -1
  153. package/dist/paints/shows.js +8 -1
  154. package/dist/paints/shows.js.map +1 -1
  155. package/dist/paints/solid.d.ts +11 -0
  156. package/dist/paints/solid.d.ts.map +1 -0
  157. package/dist/paints/solid.js +18 -0
  158. package/dist/paints/solid.js.map +1 -0
  159. package/dist/paints/stills.d.ts +74 -0
  160. package/dist/paints/stills.d.ts.map +1 -0
  161. package/dist/paints/stills.js +113 -0
  162. package/dist/paints/stills.js.map +1 -0
  163. package/dist/plugin-data/field.d.ts.map +1 -1
  164. package/dist/plugin-data/field.js +2 -0
  165. package/dist/plugin-data/field.js.map +1 -1
  166. package/dist/plugin-data/fields.d.ts +67 -0
  167. package/dist/plugin-data/fields.d.ts.map +1 -1
  168. package/dist/plugin-data/fields.js +12 -7
  169. package/dist/plugin-data/fields.js.map +1 -1
  170. package/dist/resize.d.ts +10 -3
  171. package/dist/resize.d.ts.map +1 -1
  172. package/dist/resize.js +34 -3
  173. package/dist/resize.js.map +1 -1
  174. package/dist/scaling/index.d.ts +2 -2
  175. package/dist/scaling/index.js +2 -2
  176. package/dist/scaling/node.d.ts +2 -1
  177. package/dist/scaling/node.d.ts.map +1 -1
  178. package/dist/scaling/node.js +27 -7
  179. package/dist/scaling/node.js.map +1 -1
  180. package/dist/shaders/index.d.ts +2 -3
  181. package/dist/shaders/index.js +2 -3
  182. package/dist/shaders/model.d.ts +3 -11
  183. package/dist/shaders/model.d.ts.map +1 -1
  184. package/dist/shaders/model.js +13 -36
  185. package/dist/shaders/model.js.map +1 -1
  186. package/dist/shaders/schema.d.ts +1 -1
  187. package/dist/shaders/schema.js +1 -1
  188. package/dist/shaders/schema.js.map +1 -1
  189. package/dist/shape-with-text/document.js +276 -0
  190. package/dist/shape-with-text/document.js.map +1 -0
  191. package/dist/shape-with-text/geometry.d.ts +13 -1
  192. package/dist/shape-with-text/geometry.d.ts.map +1 -1
  193. package/dist/shape-with-text/geometry.js +103 -41
  194. package/dist/shape-with-text/geometry.js.map +1 -1
  195. package/dist/shape-with-text/index.d.ts +2 -2
  196. package/dist/shape-with-text/index.js +2 -2
  197. package/dist/shared-style-index.d.ts +21 -0
  198. package/dist/shared-style-index.d.ts.map +1 -0
  199. package/dist/shared-style-index.js +72 -0
  200. package/dist/shared-style-index.js.map +1 -0
  201. package/dist/shared-styles.d.ts +3 -3
  202. package/dist/shared-styles.d.ts.map +1 -1
  203. package/dist/shared-styles.js +16 -7
  204. package/dist/shared-styles.js.map +1 -1
  205. package/dist/slides/drop.d.ts +32 -0
  206. package/dist/slides/drop.d.ts.map +1 -0
  207. package/dist/slides/drop.js +81 -0
  208. package/dist/slides/drop.js.map +1 -0
  209. package/dist/slides/index.d.ts +56 -0
  210. package/dist/slides/index.d.ts.map +1 -0
  211. package/dist/slides/index.js +134 -0
  212. package/dist/slides/index.js.map +1 -0
  213. package/dist/slides/motion.d.ts +55 -0
  214. package/dist/slides/motion.d.ts.map +1 -0
  215. package/dist/slides/motion.js +142 -0
  216. package/dist/slides/motion.js.map +1 -0
  217. package/dist/slides/playback.d.ts +59 -0
  218. package/dist/slides/playback.d.ts.map +1 -0
  219. package/dist/slides/playback.js +188 -0
  220. package/dist/slides/playback.js.map +1 -0
  221. package/dist/slides/types.d.ts +62 -0
  222. package/dist/slides/types.d.ts.map +1 -0
  223. package/dist/slides/types.js +39 -0
  224. package/dist/slides/types.js.map +1 -0
  225. package/dist/statuses/workflow.js +1 -1
  226. package/dist/text/direction.d.ts +6 -3
  227. package/dist/text/direction.d.ts.map +1 -1
  228. package/dist/text/direction.js +12 -12
  229. package/dist/text/direction.js.map +1 -1
  230. package/dist/text/index.d.ts +2 -1
  231. package/dist/text/index.js +3 -2
  232. package/dist/text/name.d.ts +22 -0
  233. package/dist/text/name.d.ts.map +1 -0
  234. package/dist/text/name.js +38 -0
  235. package/dist/text/name.js.map +1 -0
  236. package/dist/text/references.d.ts.map +1 -1
  237. package/dist/text/references.js +1 -2
  238. package/dist/text/references.js.map +1 -1
  239. package/dist/thumbnail.d.ts +23 -0
  240. package/dist/thumbnail.d.ts.map +1 -0
  241. package/dist/thumbnail.js +47 -0
  242. package/dist/thumbnail.js.map +1 -0
  243. package/dist/transfer/apply.d.ts.map +1 -1
  244. package/dist/transfer/apply.js +14 -3
  245. package/dist/transfer/apply.js.map +1 -1
  246. package/dist/transfer/copied.d.ts +6 -1
  247. package/dist/transfer/copied.d.ts.map +1 -1
  248. package/dist/transfer/copied.js +2 -2
  249. package/dist/transfer/copied.js.map +1 -1
  250. package/dist/transfer/dependencies.d.ts +4 -1
  251. package/dist/transfer/dependencies.d.ts.map +1 -1
  252. package/dist/transfer/dependencies.js +10 -1
  253. package/dist/transfer/dependencies.js.map +1 -1
  254. package/dist/transfer/history.js +2 -0
  255. package/dist/transfer/history.js.map +1 -1
  256. package/dist/transfer/identity.js +18 -3
  257. package/dist/transfer/identity.js.map +1 -1
  258. package/dist/transfer/index.d.ts +2 -1
  259. package/dist/transfer/index.js +4 -3
  260. package/dist/transfer/library.d.ts +45 -0
  261. package/dist/transfer/library.d.ts.map +1 -0
  262. package/dist/transfer/library.js +102 -0
  263. package/dist/transfer/library.js.map +1 -0
  264. package/dist/transfer/nodes.d.ts.map +1 -1
  265. package/dist/transfer/nodes.js +9 -0
  266. package/dist/transfer/nodes.js.map +1 -1
  267. package/dist/transfer/plan.d.ts +9 -0
  268. package/dist/transfer/plan.d.ts.map +1 -1
  269. package/dist/transfer/plan.js +51 -6
  270. package/dist/transfer/plan.js.map +1 -1
  271. package/dist/transfer/remove.js +7 -1
  272. package/dist/transfer/remove.js.map +1 -1
  273. package/dist/transfer/validation.js +8 -4
  274. package/dist/transfer/validation.js.map +1 -1
  275. package/dist/transfer/variables.d.ts.map +1 -1
  276. package/dist/transfer/variables.js +2 -1
  277. package/dist/transfer/variables.js.map +1 -1
  278. package/dist/types.d.ts +90 -12
  279. package/dist/types.d.ts.map +1 -1
  280. package/dist/types.js +33 -1
  281. package/dist/types.js.map +1 -1
  282. package/dist/variables/bindings.d.ts +11 -6
  283. package/dist/variables/bindings.d.ts.map +1 -1
  284. package/dist/variables/bindings.js +162 -38
  285. package/dist/variables/bindings.js.map +1 -1
  286. package/dist/variables/easing.d.ts +48 -0
  287. package/dist/variables/easing.d.ts.map +1 -0
  288. package/dist/variables/easing.js +321 -0
  289. package/dist/variables/easing.js.map +1 -0
  290. package/dist/variables/formula/index.d.ts +4 -2
  291. package/dist/variables/formula/index.d.ts.map +1 -1
  292. package/dist/variables/formula/index.js +26 -9
  293. package/dist/variables/formula/index.js.map +1 -1
  294. package/dist/variables/formula/parse.js +1 -1
  295. package/dist/variables/formula/schema.js +1 -1
  296. package/dist/variables/formula/signatures.d.ts +2 -2
  297. package/dist/variables/formula/signatures.d.ts.map +1 -1
  298. package/dist/variables/formula/signatures.js.map +1 -1
  299. package/dist/variables/formula/tree.d.ts +2 -2
  300. package/dist/variables/formula/tree.d.ts.map +1 -1
  301. package/dist/variables/formula/tree.js.map +1 -1
  302. package/dist/variables/index.d.ts +22 -5
  303. package/dist/variables/index.d.ts.map +1 -1
  304. package/dist/variables/index.js +67 -17
  305. package/dist/variables/index.js.map +1 -1
  306. package/dist/variables/lookup.js +1 -1
  307. package/dist/variables/lookup.js.map +1 -1
  308. package/dist/variables/motion.d.ts +46 -0
  309. package/dist/variables/motion.d.ts.map +1 -0
  310. package/dist/variables/motion.js +107 -0
  311. package/dist/variables/motion.js.map +1 -0
  312. package/dist/variables/paints.d.ts +10 -2
  313. package/dist/variables/paints.d.ts.map +1 -1
  314. package/dist/variables/paints.js +24 -10
  315. package/dist/variables/paints.js.map +1 -1
  316. package/dist/variables/resolution.d.ts.map +1 -1
  317. package/dist/variables/resolution.js +10 -9
  318. package/dist/variables/resolution.js.map +1 -1
  319. package/dist/variables/schema.d.ts +59 -1
  320. package/dist/variables/schema.d.ts.map +1 -1
  321. package/dist/variables/schema.js +36 -1
  322. package/dist/variables/schema.js.map +1 -1
  323. package/dist/variables/style-bindings.d.ts +23 -0
  324. package/dist/variables/style-bindings.d.ts.map +1 -0
  325. package/dist/variables/style-bindings.js +83 -0
  326. package/dist/variables/style-bindings.js.map +1 -0
  327. package/package.json +21 -2
  328. package/src/behaviours/index.ts +1 -0
  329. package/src/behaviours/kinds.ts +5 -1
  330. package/src/behaviours/model.ts +2 -2
  331. package/src/behaviours/schema.ts +19 -2
  332. package/src/behaviours/spec.ts +5 -0
  333. package/src/behaviours/transition.ts +46 -0
  334. package/src/checkpoint.ts +2 -0
  335. package/src/color/index.ts +15 -24
  336. package/src/color/management.ts +144 -168
  337. package/src/color/okhcl.ts +62 -43
  338. package/src/color/schema.ts +13 -0
  339. package/src/constraints.ts +2 -1
  340. package/src/copy.ts +29 -0
  341. package/src/corners.ts +3 -0
  342. package/src/css/index.ts +1 -0
  343. package/src/css/motion.ts +51 -0
  344. package/src/css/shadows.ts +7 -6
  345. package/src/css/values.ts +7 -3
  346. package/src/fields/layout.ts +9 -0
  347. package/src/font-style.ts +8 -3
  348. package/src/generated/index.ts +15 -3
  349. package/src/geometry.ts +13 -1
  350. package/src/graph.ts +72 -9
  351. package/src/group-bounds.ts +54 -13
  352. package/src/hit-test.ts +13 -8
  353. package/src/instances/fields.ts +2 -0
  354. package/src/instances/index.ts +71 -12
  355. package/src/instances/sync.ts +93 -11
  356. package/src/layout/flow.ts +34 -0
  357. package/src/layout/index.ts +1 -0
  358. package/src/layout/keywords.ts +7 -1
  359. package/src/layout/sizing.ts +30 -0
  360. package/src/layout/spacing.ts +12 -0
  361. package/src/mesh/geometry.ts +433 -0
  362. package/src/mesh/index.ts +3 -0
  363. package/src/mesh/model.ts +50 -0
  364. package/src/mesh/schema.ts +81 -0
  365. package/src/mutation-impact.ts +23 -7
  366. package/src/node-defaults.ts +22 -5
  367. package/src/paints/index.ts +2 -0
  368. package/src/paints/pattern.ts +55 -0
  369. package/src/paints/shows.ts +9 -0
  370. package/src/paints/solid.ts +10 -0
  371. package/src/paints/stills.ts +182 -0
  372. package/src/plugin-data/field.ts +3 -0
  373. package/src/plugin-data/fields.ts +15 -2
  374. package/src/resize.ts +32 -20
  375. package/src/scaling/index.ts +1 -1
  376. package/src/scaling/node.ts +43 -6
  377. package/src/shaders/index.ts +0 -1
  378. package/src/shaders/model.ts +19 -49
  379. package/src/shaders/schema.ts +1 -1
  380. package/src/shape-with-text/document.ts +175 -0
  381. package/src/shape-with-text/geometry.ts +99 -27
  382. package/src/shared-style-index.ts +106 -0
  383. package/src/shared-styles.ts +21 -14
  384. package/src/slides/drop.ts +94 -0
  385. package/src/slides/index.ts +125 -0
  386. package/src/slides/motion.ts +169 -0
  387. package/src/slides/playback.ts +200 -0
  388. package/src/slides/types.ts +94 -0
  389. package/src/text/direction.ts +13 -23
  390. package/src/text/index.ts +1 -0
  391. package/src/text/name.ts +39 -0
  392. package/src/text/references.ts +3 -3
  393. package/src/thumbnail.ts +52 -0
  394. package/src/transfer/apply.ts +16 -3
  395. package/src/transfer/copied.ts +7 -2
  396. package/src/transfer/dependencies.ts +10 -1
  397. package/src/transfer/history.ts +2 -0
  398. package/src/transfer/identity.ts +34 -2
  399. package/src/transfer/index.ts +6 -0
  400. package/src/transfer/library.ts +153 -0
  401. package/src/transfer/nodes.ts +20 -0
  402. package/src/transfer/plan.ts +96 -10
  403. package/src/transfer/remove.ts +6 -2
  404. package/src/transfer/validation.ts +15 -7
  405. package/src/transfer/variables.ts +8 -2
  406. package/src/types.ts +114 -10
  407. package/src/variables/bindings.ts +260 -36
  408. package/src/variables/easing.ts +282 -0
  409. package/src/variables/formula/index.ts +33 -14
  410. package/src/variables/formula/signatures.ts +6 -2
  411. package/src/variables/formula/tree.ts +3 -3
  412. package/src/variables/index.ts +90 -37
  413. package/src/variables/lookup.ts +1 -1
  414. package/src/variables/motion.ts +151 -0
  415. package/src/variables/paints.ts +29 -7
  416. package/src/variables/resolution.ts +11 -5
  417. package/src/variables/schema.ts +41 -0
  418. package/src/variables/style-bindings.ts +137 -0
  419. package/dist/shaders/still.d.ts +0 -18
  420. package/dist/shaders/still.d.ts.map +0 -1
  421. package/dist/shaders/still.js +0 -36
  422. package/dist/shaders/still.js.map +0 -1
  423. package/src/shaders/still.ts +0 -41
@@ -8,6 +8,12 @@ import { createInstanceOverrideState } from './instances/overrides'
8
8
  import { NO_LETTER_SPACING } from './text/lengths'
9
9
  import type { NodeType, SceneNode, SourceMetadata } from './types'
10
10
 
11
+ /** The name a layer of `type` starts with: its type in words, as Figma names a new layer. */
12
+ export function defaultNodeName(type: NodeType): string {
13
+ const words = type.toLowerCase().replaceAll('_', ' ')
14
+ return words.charAt(0).toUpperCase() + words.slice(1)
15
+ }
16
+
11
17
  export function createDefaultSourceMetadata(): SourceMetadata {
12
18
  return {
13
19
  format: null,
@@ -21,6 +27,7 @@ export function createDefaultSourceMetadata(): SourceMetadata {
21
27
  layout: null,
22
28
  symbolOverrides: [],
23
29
  componentPropAssignments: [],
30
+ hiddenSlotAssignments: [],
24
31
  derivedSymbolData: [],
25
32
  derivedSymbolDataLayoutVersion: null,
26
33
  uniformScaleFactor: null
@@ -79,7 +86,7 @@ export function createDefaultNode(
79
86
  const defaults = {
80
87
  id: generateId(),
81
88
  type,
82
- name: type.charAt(0) + type.slice(1).toLowerCase(),
89
+ name: defaultNodeName(type),
83
90
  parentId: null,
84
91
  childIds: ownList(overrides.childIds),
85
92
  x: 0,
@@ -208,6 +215,8 @@ export function createDefaultNode(
208
215
  // Figma's: the golden-ratio star, whose inner points line up with its outer ones.
209
216
  starInnerRadius: (3 - Math.sqrt(5)) / 2,
210
217
  shapeWithTextType: 'SQUARE',
218
+ slide: null,
219
+ animation: null,
211
220
  shapeUserHeight: 0,
212
221
  shapeTruncates: false,
213
222
  componentId: null,
@@ -264,7 +273,8 @@ export const SIDE_STROKE_TYPES: ReadonlySet<NodeType> = new Set<NodeType>([
264
273
  'FRAME',
265
274
  'COMPONENT',
266
275
  'COMPONENT_SET',
267
- 'INSTANCE'
276
+ 'INSTANCE',
277
+ 'SLIDE'
268
278
  ])
269
279
 
270
280
  /** The kinds that hold layers of their own on the canvas: what a shadow or a clip encloses. */
@@ -274,7 +284,10 @@ export const LAYER_CONTAINER_TYPES: ReadonlySet<NodeType> = new Set<NodeType>([
274
284
  'SECTION',
275
285
  'COMPONENT',
276
286
  'COMPONENT_SET',
277
- 'INSTANCE'
287
+ 'INSTANCE',
288
+ 'SLIDE',
289
+ 'SLIDE_ROW',
290
+ 'SLIDE_GRID'
278
291
  ])
279
292
 
280
293
  export function isLayerContainer(node: Pick<SceneNode, 'type'>): boolean {
@@ -286,7 +299,8 @@ export const CLIPPING_TYPES: ReadonlySet<NodeType> = new Set<NodeType>([
286
299
  'FRAME',
287
300
  'COMPONENT',
288
301
  'COMPONENT_SET',
289
- 'INSTANCE'
302
+ 'INSTANCE',
303
+ 'SLIDE'
290
304
  ])
291
305
 
292
306
  /**
@@ -306,5 +320,8 @@ export const CONTAINER_TYPES = new Set<NodeType>([
306
320
  'SECTION',
307
321
  'COMPONENT',
308
322
  'COMPONENT_SET',
309
- 'INSTANCE'
323
+ 'INSTANCE',
324
+ 'SLIDE',
325
+ 'SLIDE_ROW',
326
+ 'SLIDE_GRID'
310
327
  ])
@@ -1,3 +1,5 @@
1
1
  export * from './pattern'
2
2
  export * from './schema'
3
3
  export * from './shows'
4
+ export * from './solid'
5
+ export * from './stills'
@@ -1,3 +1,4 @@
1
+ import type { SceneGraph } from '../graph'
1
2
  import type { Rect, Vector } from '../primitives'
2
3
  import type { Fill, SceneNode } from '../types'
3
4
 
@@ -43,3 +44,57 @@ export function patternTileLayout(
43
44
 
44
45
  return { rect: { x: 0, y: 0, width, height }, scale, positions }
45
46
  }
47
+
48
+ function addPatternSourceIds(paints: readonly Fill[], ids: string[]) {
49
+ for (const paint of paints) {
50
+ if (paint.type === 'PATTERN' && paint.sourceNodeId) {
51
+ ids.push(paint.sourceNodeId)
52
+ }
53
+ }
54
+ }
55
+
56
+ export function patternSourceIds(node: SceneNode): string[] {
57
+ const ids: string[] = []
58
+ addPatternSourceIds(node.fills, ids)
59
+ addPatternSourceIds(node.strokes, ids)
60
+ addPatternSourceIds(node.textDecorationFills, ids)
61
+ for (const region of node.vectorNetwork?.regions ?? []) {
62
+ addPatternSourceIds(region.fills ?? [], ids)
63
+ }
64
+ for (const run of node.styleRuns) {
65
+ addPatternSourceIds(run.style.fills ?? [], ids)
66
+ addPatternSourceIds(run.style.textDecorationFills ?? [], ids)
67
+ }
68
+ return ids
69
+ }
70
+
71
+ function indexBySourceId(graph: SceneGraph): Map<string, SceneNode> {
72
+ const index = new Map<string, SceneNode>()
73
+ for (const node of graph.getAllNodes()) {
74
+ if (node.source.id && !index.has(node.source.id)) {
75
+ index.set(node.source.id, node)
76
+ }
77
+ }
78
+ return index
79
+ }
80
+
81
+ export function createPatternSourceLookup(
82
+ graph: SceneGraph
83
+ ): (sourceId: string) => SceneNode | null {
84
+ let bySourceId: Map<string, SceneNode> | null = null
85
+ return (sourceId) => {
86
+ const direct = graph.getNode(sourceId)
87
+ if (direct) {
88
+ return direct
89
+ }
90
+ bySourceId ??= indexBySourceId(graph)
91
+ return bySourceId.get(sourceId) ?? null
92
+ }
93
+ }
94
+
95
+ export function resolvedPatternSourceIds(
96
+ node: SceneNode,
97
+ findSource: (sourceId: string) => SceneNode | null
98
+ ): string[] {
99
+ return patternSourceIds(node).flatMap((sourceId) => findSource(sourceId)?.id ?? [])
100
+ }
@@ -11,3 +11,12 @@ export function paintShows(paint: Fill): boolean {
11
11
  if (paint.type === 'SOLID') return paint.color.a > 0
12
12
  return true
13
13
  }
14
+
15
+ /** A Figma shader paint, which OpenPencil cannot draw: Figma keeps the program outside the file. */
16
+ export function isFigmaShaderPaint(paint: Fill): boolean {
17
+ return paint.type === 'CUSTOM'
18
+ }
19
+
20
+ export function isDrawnPaint(paint: Fill): boolean {
21
+ return paint.visible && !isFigmaShaderPaint(paint)
22
+ }
@@ -0,0 +1,10 @@
1
+ import type { Color } from '../primitives'
2
+ import type { Fill } from '../types'
3
+
4
+ /**
5
+ * A color as a solid paint holds it: its channels at full alpha, and its alpha as the paint's
6
+ * opacity, which shapes draw at alone and text draws at times its color's alpha.
7
+ */
8
+ export function solidPaintColor(color: Color): Pick<Fill, 'color' | 'opacity'> {
9
+ return { color: { ...color, a: 1 }, opacity: color.a }
10
+ }
@@ -0,0 +1,182 @@
1
+ import { sha1 } from '@noble/hashes/legacy.js'
2
+ import { bytesToHex, utf8ToBytes } from '@noble/hashes/utils.js'
3
+
4
+ import { randomHex } from '@open-pencil/std/random'
5
+
6
+ import { TRANSPARENT } from '../constants'
7
+ import { imagePaintHashes } from '../images'
8
+ import { readAllPluginData, withAllPluginData, type PluginDataField } from '../plugin-data/field'
9
+ import { OPEN_PENCIL_PLUGIN_DATA } from '../plugin-data/fields'
10
+ import type { Size } from '../primitives'
11
+ import type { Fill, SceneNode } from '../types'
12
+
13
+ /**
14
+ * Paints OpenPencil draws itself, such as shaders and mesh gradients, kept as an image fill of
15
+ * their still frame, so `.fig` files, the Figma clipboard, and every format that reads images
16
+ * show them. What draws the frame is plugin data on the layer, one entry per paint, matched to
17
+ * the paint by the frame's image hash. A paint whose image is replaced, as in Figma, then draws
18
+ * as the image it holds.
19
+ *
20
+ * Frames are drawn and stored the same way for every renderer that draws one: the editor's
21
+ * canvas and the tools that prebuild documents. Figma must be able to read them, which rules out
22
+ * WebP.
23
+ */
24
+ export interface StillPaint {
25
+ /** The hash of the paint's image: the still frame. */
26
+ image: string
27
+ }
28
+
29
+ /** Every entry a node keeps under `field`, whether or not a paint still shows it. */
30
+ export function readStillPaints<T extends StillPaint>(
31
+ node: Pick<SceneNode, 'pluginData'>,
32
+ field: PluginDataField<T>
33
+ ): T[] {
34
+ return readAllPluginData(node.pluginData, field)
35
+ }
36
+
37
+ /**
38
+ * The entry under `field` that `paint` of `node` shows: an image paint whose image is that
39
+ * entry's frame. Null for any other paint, including one whose image was replaced.
40
+ */
41
+ export function stillPaintOf<T extends StillPaint>(
42
+ node: Pick<SceneNode, 'pluginData'>,
43
+ paint: Fill,
44
+ field: PluginDataField<T>
45
+ ): T | null {
46
+ if (paint.type !== 'IMAGE' || !paint.imageHash) return null
47
+ return readStillPaints(node, field).find((entry) => entry.image === paint.imageHash) ?? null
48
+ }
49
+
50
+ /**
51
+ * The node's plugin data with `field`'s entries set by their image, keeping only entries a fill
52
+ * or stroke of `paints` still shows, so removing or replacing a paint leaves no entry behind.
53
+ */
54
+ export function withStillPaints<T extends StillPaint>(
55
+ node: Pick<SceneNode, 'pluginData'>,
56
+ paints: readonly Fill[],
57
+ field: PluginDataField<T>,
58
+ entries: readonly T[] = []
59
+ ): SceneNode['pluginData'] {
60
+ const shown = new Set(imagePaintHashes(paints))
61
+ const byImage = new Map(readStillPaints(node, field).map((entry) => [entry.image, entry]))
62
+ for (const entry of entries) byImage.set(entry.image, entry)
63
+ return withAllPluginData(
64
+ node.pluginData,
65
+ field,
66
+ [...byImage.values()].filter((entry) => shown.has(entry.image))
67
+ )
68
+ }
69
+
70
+ /**
71
+ * A new image paint for a still frame not yet drawn. Its image is unique to this paint, so no
72
+ * other paint's entry claims it until the frame is drawn.
73
+ */
74
+ export function createStillPaint(): { paint: Fill; image: string } {
75
+ const image = randomHex(20)
76
+ return {
77
+ paint: {
78
+ type: 'IMAGE',
79
+ color: TRANSPARENT,
80
+ opacity: 1,
81
+ visible: true,
82
+ imageHash: image,
83
+ imageScaleMode: 'FILL'
84
+ },
85
+ image
86
+ }
87
+ }
88
+
89
+ /** A short key that tells one drawn value from another, which a drawn frame records. */
90
+ export function stillContentKey(value: unknown): string {
91
+ return bytesToHex(sha1(utf8ToBytes(JSON.stringify(value))))
92
+ }
93
+
94
+ /** The layer size and content key a frame was drawn for. */
95
+ export interface StillFrame {
96
+ width: number
97
+ height: number
98
+ key: string
99
+ }
100
+
101
+ /**
102
+ * Whether a frame was drawn for the content `key` names at the layer's size now, so undoing a
103
+ * change after reopening the document does not keep a frame of the newer content.
104
+ */
105
+ export function isStillFrameCurrent(
106
+ frame: StillFrame | undefined,
107
+ key: string,
108
+ size: Size
109
+ ): boolean {
110
+ return (
111
+ frame?.key === key &&
112
+ Math.round(frame.width) === Math.round(size.width) &&
113
+ Math.round(frame.height) === Math.round(size.height)
114
+ )
115
+ }
116
+
117
+ /** Renames the image a stored entry of `field` names, or says it names none. */
118
+ function stillPaintRenamer<T extends StillPaint>(field: PluginDataField<T>) {
119
+ return {
120
+ key: field.key,
121
+ rename(value: string, rename: (image: string) => string | null): string | null {
122
+ const paint = field.decode(value)
123
+ const renamed = paint ? rename(paint.image) : null
124
+ return paint && renamed && renamed !== paint.image
125
+ ? field.encode({ ...paint, image: renamed })
126
+ : null
127
+ }
128
+ }
129
+ }
130
+
131
+ /** The plugin-data fields whose entries name a paint's still frame: shaders and meshes. */
132
+ const STILL_PAINT_RENAMERS = [
133
+ stillPaintRenamer(OPEN_PENCIL_PLUGIN_DATA.shader),
134
+ stillPaintRenamer(OPEN_PENCIL_PLUGIN_DATA.mesh)
135
+ ]
136
+
137
+ /**
138
+ * The stored value of OpenPencil plugin-data entry `key` with the still frame it names renamed by
139
+ * `rename`, so the paint is found under its image's new name; null when the entry names no still
140
+ * frame or its name stays.
141
+ */
142
+ export function renameStillPaintImage(
143
+ key: string,
144
+ value: string,
145
+ rename: (image: string) => string | null
146
+ ): string | null {
147
+ return STILL_PAINT_RENAMERS.find((renamer) => renamer.key === key)?.rename(value, rename) ?? null
148
+ }
149
+
150
+ /** Frames are drawn at twice the layer's size, for sharp high-density displays. */
151
+ const FRAME_SCALE = 2
152
+ /** The longest side a frame is drawn at, however large the layer. */
153
+ const MAX_FRAME_EDGE = 2048
154
+ /** JPEG quality for opaque frames: no visible difference from PNG at a fraction of the size. */
155
+ const JPEG_QUALITY = 0.9
156
+
157
+ /** The pixels a frame for a layer of `size` is drawn at. */
158
+ export function stillFramePixels(size: Size): Size {
159
+ const scale = Math.min(FRAME_SCALE, MAX_FRAME_EDGE / Math.max(size.width, size.height, 1))
160
+ return {
161
+ width: Math.max(1, Math.round(size.width * scale)),
162
+ height: Math.max(1, Math.round(size.height * scale))
163
+ }
164
+ }
165
+
166
+ export interface StillFrameEncoding {
167
+ type: 'image/jpeg' | 'image/png'
168
+ /** For `canvas.toBlob` and `toDataURL`; PNG takes none. */
169
+ quality?: number
170
+ }
171
+
172
+ /**
173
+ * The encoding a frame with these RGBA pixels is stored in: JPEG when every pixel is opaque, which
174
+ * is about 25 times smaller than PNG for a shader, and PNG when any pixel lets the layer behind
175
+ * show through, which JPEG cannot keep.
176
+ */
177
+ export function stillFrameEncoding(rgba: ArrayLike<number>): StillFrameEncoding {
178
+ for (let alpha = 3; alpha < rgba.length; alpha += 4) {
179
+ if (rgba[alpha] !== 255) return { type: 'image/png' }
180
+ }
181
+ return { type: 'image/jpeg', quality: JPEG_QUALITY }
182
+ }
@@ -42,6 +42,8 @@ export function jsonPluginDataField<T>(
42
42
  key,
43
43
  role,
44
44
  decode(value) {
45
+ // Most layers carry no entry at all; validating that absence builds an issue per read.
46
+ if (value == null) return undefined
45
47
  const parsed = v.safeParse(stored, value)
46
48
  return parsed.success ? parsed.output : undefined
47
49
  },
@@ -60,6 +62,7 @@ export function textPluginDataField<const T extends string>(
60
62
  key,
61
63
  role,
62
64
  decode(value) {
65
+ if (value == null) return undefined
63
66
  const parsed = v.safeParse(schema, value)
64
67
  return parsed.success ? parsed.output : undefined
65
68
  },
@@ -2,11 +2,13 @@ import * as v from 'valibot'
2
2
 
3
3
  import { behaviourSchema } from '../behaviours/schema'
4
4
  import type { OkHCLPayload } from '../color/okhcl'
5
+ import { exportColorProfileSchema } from '../color/schema'
5
6
  import { commentThreadsSchema } from '../comments/schema'
6
7
  import { isExportFormatId, type ExportFormatId } from '../export-format'
7
8
  import { clampExportScale } from '../export-scale'
8
9
  import { FIG_COMPRESSIONS } from '../fig-compression'
9
10
  import { iconSchema, iconTintSchema } from '../icons/schema'
11
+ import { meshPaintSchema } from '../mesh/schema'
10
12
  import type { Rect } from '../primitives'
11
13
  import { shaderPaintSchema } from '../shaders/schema'
12
14
  import { nodeStatusSchema, statusWorkflowSchema } from '../statuses/schema'
@@ -70,7 +72,7 @@ const exportSettingsSchema: v.GenericSchema<unknown, ExportSetting[]> = v.array(
70
72
  ),
71
73
  contentsOnly: v.optional(v.boolean()),
72
74
  useAbsoluteBounds: v.optional(v.boolean()),
73
- colorProfile: v.optional(v.picklist(['DOCUMENT', 'SRGB', 'DISPLAY_P3_V4'])),
75
+ colorProfile: v.optional(exportColorProfileSchema),
74
76
  svgOutlineText: v.optional(v.boolean()),
75
77
  svgIdAttribute: v.optional(v.boolean()),
76
78
  svgSimplifyStroke: v.optional(v.boolean())
@@ -194,6 +196,15 @@ export const OPEN_PENCIL_PLUGIN_DATA = {
194
196
  'bookkeeping',
195
197
  sourceLibraryPublicationSchema
196
198
  ),
199
+ /**
200
+ * The layer chosen as the document's thumbnail, on the DOCUMENT node. Figma keeps its own
201
+ * choice outside the file, so a `.fig` carries only this one.
202
+ */
203
+ thumbnail: jsonPluginDataField(
204
+ 'thumbnail',
205
+ 'bookkeeping',
206
+ v.pipe(v.string(), v.nonEmpty(), v.maxLength(64))
207
+ ),
197
208
  /** Canvas comment threads, deleted ones included, on the DOCUMENT node. */
198
209
  comments: jsonPluginDataField('comments', 'bookkeeping', commentThreadsSchema),
199
210
  /** The statuses layers can be in, on the DOCUMENT node. */
@@ -227,7 +238,9 @@ export const OPEN_PENCIL_PLUGIN_DATA = {
227
238
  /** Which of an icon path's paints its icon's color sets, on each path the source drew in it. */
228
239
  iconTint: jsonPluginDataField('iconTint', 'content', iconTintSchema),
229
240
  /** One entry per paint that draws a shader, matched to its image paint by the frame's hash. */
230
- shader: jsonPluginDataField('shader', 'content', shaderPaintSchema)
241
+ shader: jsonPluginDataField('shader', 'content', shaderPaintSchema),
242
+ /** One entry per paint that draws a mesh gradient, matched to its image paint by the frame's hash. */
243
+ mesh: jsonPluginDataField('mesh', 'content', meshPaintSchema)
231
244
  } satisfies Record<string, PluginDataKey>
232
245
 
233
246
  const NOT_CONTENT = Object.values(OPEN_PENCIL_PLUGIN_DATA).filter(
package/src/resize.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { pick } from 'es-toolkit/object'
2
+
1
3
  import { CONSTRAINT_PARENT_TYPES } from './constraints'
2
4
  import { getNodeLocalMatrix } from './coordinate'
3
5
  import {
@@ -22,24 +24,24 @@ import type { ConstraintType, DerivedTextGlyph, SceneNode, Stroke, VectorNetwork
22
24
  * geometry that must scale with the node, and textPathBox is the layout box the
23
25
  * glyphs were reflowed against.
24
26
  */
25
- export type ResizeSnapshot = Pick<
26
- SceneNode,
27
- | 'type'
28
- | 'x'
29
- | 'y'
30
- | 'width'
31
- | 'height'
32
- | 'flipX'
33
- | 'flipY'
34
- | 'vectorNetwork'
35
- | 'fillGeometry'
36
- | 'strokeGeometry'
37
- | 'derivedTextGlyphs'
38
- | 'strokes'
39
- | 'textPathData'
40
- | 'textPathBox'
41
- >
42
-
27
+ const RESIZE_SNAPSHOT_FIELDS = [
28
+ 'type',
29
+ 'x',
30
+ 'y',
31
+ 'width',
32
+ 'height',
33
+ 'flipX',
34
+ 'flipY',
35
+ 'vectorNetwork',
36
+ 'fillGeometry',
37
+ 'strokeGeometry',
38
+ 'derivedTextGlyphs',
39
+ 'strokes',
40
+ 'textPathData',
41
+ 'textPathBox'
42
+ ] as const satisfies readonly (keyof SceneNode)[]
43
+
44
+ export type ResizeSnapshot = Pick<SceneNode, (typeof RESIZE_SNAPSHOT_FIELDS)[number]>
43
45
  interface ResizeGraph {
44
46
  readonly rootId: string
45
47
  getNode(id: string): SceneNode | undefined
@@ -361,9 +363,19 @@ function constrainedGeometryChanges(
361
363
  return scalesGeometry(orig, current) ? snapshotGeometry(orig) : {}
362
364
  }
363
365
 
366
+ /**
367
+ * A node's resize state holding its own geometry rather than copies of it. It stays the state the
368
+ * resize began from only while nothing edits that geometry in place, as a resize plan does not:
369
+ * it writes new paths and outlines.
370
+ */
371
+ export function sharedResizeSnapshot(node: SceneNode): ResizeSnapshot {
372
+ return pick(node, RESIZE_SNAPSHOT_FIELDS)
373
+ }
374
+
364
375
  export function collectResizeDescendants(
365
376
  graph: ResizeGraph,
366
- rootId: string
377
+ rootId: string,
378
+ snapshot: (node: SceneNode) => ResizeSnapshot = createResizeSnapshot
367
379
  ): Map<string, ResizeSnapshot> | null {
368
380
  const root = graph.getNode(rootId)
369
381
  if (!root || !CONSTRAINT_CONTAINER_TYPES.has(root.type)) return null
@@ -375,7 +387,7 @@ export function collectResizeDescendants(
375
387
  for (const childId of parent.childIds) {
376
388
  const child = graph.getNode(childId)
377
389
  if (!child) continue
378
- snapshots.set(childId, createResizeSnapshot(child))
390
+ snapshots.set(childId, snapshot(child))
379
391
  collect(childId)
380
392
  }
381
393
  }
@@ -1,4 +1,4 @@
1
- export { scaleNodeChanges } from './node'
1
+ export { scaleNodeChanges, scaledTextStyleLengths } from './node'
2
2
  export {
3
3
  MIN_RESCALE,
4
4
  rescaleNodeChanges,
@@ -1,3 +1,5 @@
1
+ import { pick } from 'es-toolkit/object'
2
+
1
3
  import { cloneVectorNetwork, copyDerivedGlyphs, scaleGeometryPaths } from '../copy'
2
4
  import { scaledTextLength } from '../text/lengths'
3
5
  import { TEXT_PARAGRAPH_SPACING_FIELDS } from '../text/paragraphs'
@@ -10,6 +12,7 @@ import {
10
12
  type SceneNode,
11
13
  type Stroke,
12
14
  type StyleRun,
15
+ type TextLength,
13
16
  type TextParagraphStyle
14
17
  } from '../types'
15
18
 
@@ -56,6 +59,45 @@ function scaledFills(fills: readonly Fill[], scale: number): Fill[] {
56
59
  }))
57
60
  }
58
61
 
62
+ const TEXT_STYLE_LENGTH_FIELDS = [
63
+ 'fontSize',
64
+ 'lineHeight',
65
+ 'letterSpacing',
66
+ 'paragraphSpacing',
67
+ 'paragraphIndent',
68
+ 'listSpacing'
69
+ ] as const satisfies readonly (keyof SceneNode)[]
70
+
71
+ const TEXT_STYLE_LENGTHS: ReadonlySet<string> = new Set(TEXT_STYLE_LENGTH_FIELDS)
72
+
73
+ export function isTextStyleLength(field: string): boolean {
74
+ return TEXT_STYLE_LENGTHS.has(field)
75
+ }
76
+
77
+ function isTextLength(value: unknown): value is TextLength {
78
+ return typeof value === 'object' && value !== null && 'unit' in value && 'value' in value
79
+ }
80
+
81
+ function lengthAtScale(value: unknown, scale: number): unknown {
82
+ if (typeof value === 'number') {
83
+ return value * scale
84
+ }
85
+ return isTextLength(value) ? scaledTextLength(value, scale) : value
86
+ }
87
+
88
+ export function scaledTextStyleLengths<Values extends object>(
89
+ values: Values,
90
+ scale: number
91
+ ): Values {
92
+ const scaled = { ...values }
93
+ for (const [field, value] of Object.entries(values)) {
94
+ if (isTextStyleLength(field)) {
95
+ Object.assign(scaled, { [field]: lengthAtScale(value, scale) })
96
+ }
97
+ }
98
+ return scaled
99
+ }
100
+
59
101
  function scaledStyleRuns(styleRuns: readonly StyleRun[], scale: number): StyleRun[] {
60
102
  return styleRuns.map((run) => ({
61
103
  ...structuredClone(run),
@@ -162,15 +204,10 @@ export function scaleNodeChanges(
162
204
  topRightRadius: node.topRightRadius * scale,
163
205
  bottomRightRadius: node.bottomRightRadius * scale,
164
206
  bottomLeftRadius: node.bottomLeftRadius * scale,
165
- fontSize: node.fontSize * scale,
166
- letterSpacing: scaledTextLength(node.letterSpacing, scale),
167
- lineHeight: node.lineHeight && scaledTextLength(node.lineHeight, scale),
207
+ ...scaledTextStyleLengths(pick(node, TEXT_STYLE_LENGTH_FIELDS), scale),
168
208
  textDecorationThickness: scaledOptional(node.textDecorationThickness, scale),
169
209
  textUnderlineOffset: scaledOptional(node.textUnderlineOffset, scale),
170
210
  styleRuns: scaledStyleRuns(node.styleRuns, scale),
171
- listSpacing: node.listSpacing * scale,
172
- paragraphSpacing: node.paragraphSpacing * scale,
173
- paragraphIndent: node.paragraphIndent * scale,
174
211
  textParagraphs: scaledParagraphStyles(node.textParagraphs, scale),
175
212
  derivedTextHeight: scaledOptional(node.derivedTextHeight, scale),
176
213
  itemSpacing: node.itemSpacing * scale,
@@ -1,3 +1,2 @@
1
1
  export * from './model'
2
2
  export * from './schema'
3
- export * from './still'