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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (869) hide show
  1. package/dist/arrow-caps.d.ts +14 -17
  2. package/dist/arrow-caps.d.ts.map +1 -1
  3. package/dist/arrow-caps.js +1 -2
  4. package/dist/asset-keys.d.ts +5 -8
  5. package/dist/asset-keys.d.ts.map +1 -1
  6. package/dist/asset-keys.js +2 -3
  7. package/dist/behaviours/index.d.ts +4 -3
  8. package/dist/behaviours/index.js +6 -5
  9. package/dist/behaviours/kinds.d.ts +38 -15
  10. package/dist/behaviours/kinds.d.ts.map +1 -1
  11. package/dist/behaviours/kinds.js +119 -4
  12. package/dist/behaviours/kinds.js.map +1 -1
  13. package/dist/behaviours/layers.d.ts +3 -6
  14. package/dist/behaviours/layers.d.ts.map +1 -1
  15. package/dist/behaviours/layers.js +1 -2
  16. package/dist/behaviours/listing.d.ts +58 -0
  17. package/dist/behaviours/listing.d.ts.map +1 -0
  18. package/dist/behaviours/listing.js +98 -0
  19. package/dist/behaviours/listing.js.map +1 -0
  20. package/dist/behaviours/model.d.ts +19 -16
  21. package/dist/behaviours/model.d.ts.map +1 -1
  22. package/dist/behaviours/model.js +14 -6
  23. package/dist/behaviours/model.js.map +1 -1
  24. package/dist/behaviours/schema.d.ts +16 -18
  25. package/dist/behaviours/schema.d.ts.map +1 -1
  26. package/dist/behaviours/schema.js +2 -3
  27. package/dist/behaviours/spec.d.ts +3 -6
  28. package/dist/behaviours/spec.d.ts.map +1 -1
  29. package/dist/behaviours/spec.js +4 -5
  30. package/dist/behaviours/transition.d.ts +6 -9
  31. package/dist/behaviours/transition.d.ts.map +1 -1
  32. package/dist/behaviours/transition.js +1 -2
  33. package/dist/bindings.js +2 -3
  34. package/dist/blur.d.ts +35 -0
  35. package/dist/blur.d.ts.map +1 -0
  36. package/dist/blur.js +69 -0
  37. package/dist/blur.js.map +1 -0
  38. package/dist/buffered-events.d.ts +3 -6
  39. package/dist/buffered-events.d.ts.map +1 -1
  40. package/dist/buffered-events.js +1 -2
  41. package/dist/buffered-events.js.map +1 -1
  42. package/dist/checkpoint.d.ts +3 -6
  43. package/dist/checkpoint.d.ts.map +1 -1
  44. package/dist/checkpoint.js +2 -3
  45. package/dist/clipping.d.ts +4 -7
  46. package/dist/clipping.d.ts.map +1 -1
  47. package/dist/clipping.js +4 -16
  48. package/dist/clipping.js.map +1 -1
  49. package/dist/color/contrast.d.ts +4 -7
  50. package/dist/color/contrast.d.ts.map +1 -1
  51. package/dist/color/contrast.js +2 -3
  52. package/dist/color/index.d.ts +13 -15
  53. package/dist/color/index.d.ts.map +1 -1
  54. package/dist/color/index.js +3 -4
  55. package/dist/color/management.d.ts +11 -14
  56. package/dist/color/management.d.ts.map +1 -1
  57. package/dist/color/management.js +2 -3
  58. package/dist/color/normalize.d.ts +1 -4
  59. package/dist/color/normalize.d.ts.map +1 -1
  60. package/dist/color/normalize.js +1 -2
  61. package/dist/color/okhcl.d.ts +16 -19
  62. package/dist/color/okhcl.d.ts.map +1 -1
  63. package/dist/color/okhcl.js +3 -4
  64. package/dist/color/schema.d.ts +4 -7
  65. package/dist/color/schema.d.ts.map +1 -1
  66. package/dist/color/schema.js +2 -3
  67. package/dist/comments/document.d.ts +3 -6
  68. package/dist/comments/document.d.ts.map +1 -1
  69. package/dist/comments/document.js +1 -2
  70. package/dist/comments/index.js +2 -2
  71. package/dist/comments/list.d.ts +5 -8
  72. package/dist/comments/list.d.ts.map +1 -1
  73. package/dist/comments/list.js +1 -2
  74. package/dist/comments/merge.d.ts +2 -5
  75. package/dist/comments/merge.d.ts.map +1 -1
  76. package/dist/comments/merge.js +1 -2
  77. package/dist/comments/schema.d.ts +2 -5
  78. package/dist/comments/schema.d.ts.map +1 -1
  79. package/dist/comments/schema.js +1 -2
  80. package/dist/comments/threads.d.ts +16 -19
  81. package/dist/comments/threads.d.ts.map +1 -1
  82. package/dist/comments/threads.js +8 -3
  83. package/dist/comments/threads.js.map +1 -1
  84. package/dist/components/exposure.d.ts +4 -7
  85. package/dist/components/exposure.d.ts.map +1 -1
  86. package/dist/components/exposure.js +1 -2
  87. package/dist/components/properties.d.ts +13 -16
  88. package/dist/components/properties.d.ts.map +1 -1
  89. package/dist/components/properties.js +3 -4
  90. package/dist/components/variants.d.ts +5 -8
  91. package/dist/components/variants.d.ts.map +1 -1
  92. package/dist/components/variants.js +1 -2
  93. package/dist/connectors/controls.d.ts +6 -9
  94. package/dist/connectors/controls.d.ts.map +1 -1
  95. package/dist/connectors/controls.js +2 -3
  96. package/dist/connectors/create.d.ts +3 -6
  97. package/dist/connectors/create.d.ts.map +1 -1
  98. package/dist/connectors/create.js +2 -3
  99. package/dist/connectors/elbow.js +0 -1
  100. package/dist/connectors/gaps.d.ts +1 -4
  101. package/dist/connectors/gaps.d.ts.map +1 -1
  102. package/dist/connectors/gaps.js +1 -2
  103. package/dist/connectors/hit.d.ts +1 -4
  104. package/dist/connectors/hit.d.ts.map +1 -1
  105. package/dist/connectors/hit.js +3 -4
  106. package/dist/connectors/index.d.ts +3 -3
  107. package/dist/connectors/index.js +6 -6
  108. package/dist/connectors/label.d.ts +4 -7
  109. package/dist/connectors/label.d.ts.map +1 -1
  110. package/dist/connectors/label.js +1 -2
  111. package/dist/connectors/layout.d.ts +8 -10
  112. package/dist/connectors/layout.d.ts.map +1 -1
  113. package/dist/connectors/layout.js +12 -10
  114. package/dist/connectors/layout.js.map +1 -1
  115. package/dist/connectors/pieces.d.ts +2 -5
  116. package/dist/connectors/pieces.d.ts.map +1 -1
  117. package/dist/connectors/pieces.js +3 -4
  118. package/dist/connectors/pieces.js.map +1 -1
  119. package/dist/connectors/route.d.ts +2 -5
  120. package/dist/connectors/route.d.ts.map +1 -1
  121. package/dist/connectors/route.js +4 -5
  122. package/dist/connectors/sides.d.ts +3 -6
  123. package/dist/connectors/sides.d.ts.map +1 -1
  124. package/dist/connectors/sides.js +2 -3
  125. package/dist/connectors/sublayers.d.ts +21 -24
  126. package/dist/connectors/sublayers.d.ts.map +1 -1
  127. package/dist/connectors/sublayers.js +3 -3
  128. package/dist/connectors/sublayers.js.map +1 -1
  129. package/dist/constants.d.ts +13 -16
  130. package/dist/constants.d.ts.map +1 -1
  131. package/dist/constants.js +1 -2
  132. package/dist/constraints.d.ts +6 -8
  133. package/dist/constraints.d.ts.map +1 -1
  134. package/dist/constraints.js +1 -2
  135. package/dist/coordinate.d.ts +27 -29
  136. package/dist/coordinate.d.ts.map +1 -1
  137. package/dist/coordinate.js +19 -38
  138. package/dist/coordinate.js.map +1 -1
  139. package/dist/copy.d.ts +31 -25
  140. package/dist/copy.d.ts.map +1 -1
  141. package/dist/copy.js +13 -5
  142. package/dist/copy.js.map +1 -1
  143. package/dist/corners.d.ts +8 -10
  144. package/dist/corners.d.ts.map +1 -1
  145. package/dist/corners.js +1 -2
  146. package/dist/css/blend.d.ts +1 -4
  147. package/dist/css/blend.d.ts.map +1 -1
  148. package/dist/css/blend.js +1 -2
  149. package/dist/css/grid.d.ts +1 -4
  150. package/dist/css/grid.d.ts.map +1 -1
  151. package/dist/css/grid.js +4 -5
  152. package/dist/css/index.js +2 -2
  153. package/dist/css/layout.d.ts +7 -10
  154. package/dist/css/layout.d.ts.map +1 -1
  155. package/dist/css/layout.js +2 -3
  156. package/dist/css/motion.d.ts +2 -5
  157. package/dist/css/motion.d.ts.map +1 -1
  158. package/dist/css/motion.js +2 -3
  159. package/dist/css/shadows.d.ts +1 -4
  160. package/dist/css/shadows.d.ts.map +1 -1
  161. package/dist/css/shadows.js +3 -4
  162. package/dist/css/text.d.ts +8 -11
  163. package/dist/css/text.d.ts.map +1 -1
  164. package/dist/css/text.js +1 -2
  165. package/dist/css/transform.d.ts +6 -9
  166. package/dist/css/transform.d.ts.map +1 -1
  167. package/dist/css/transform.js +2 -3
  168. package/dist/css/values.d.ts +9 -12
  169. package/dist/css/values.d.ts.map +1 -1
  170. package/dist/css/values.js +2 -3
  171. package/dist/cubic.d.ts +11 -5
  172. package/dist/cubic.d.ts.map +1 -1
  173. package/dist/cubic.js +71 -3
  174. package/dist/cubic.js.map +1 -1
  175. package/dist/events.js +1 -2
  176. package/dist/export-format.d.ts +5 -8
  177. package/dist/export-format.d.ts.map +1 -1
  178. package/dist/export-format.js +4 -3
  179. package/dist/export-format.js.map +1 -1
  180. package/dist/export-scale.d.ts +4 -7
  181. package/dist/export-scale.d.ts.map +1 -1
  182. package/dist/export-scale.js +1 -2
  183. package/dist/fields/appearance.d.ts +3 -6
  184. package/dist/fields/appearance.d.ts.map +1 -1
  185. package/dist/fields/appearance.js +1 -2
  186. package/dist/fields/geometry.d.ts +2 -5
  187. package/dist/fields/geometry.d.ts.map +1 -1
  188. package/dist/fields/geometry.js +1 -2
  189. package/dist/fields/index.js +1 -1
  190. package/dist/fields/layout.d.ts +4 -7
  191. package/dist/fields/layout.d.ts.map +1 -1
  192. package/dist/fields/layout.js +1 -2
  193. package/dist/fields/text.d.ts +5 -8
  194. package/dist/fields/text.d.ts.map +1 -1
  195. package/dist/fields/text.js +1 -2
  196. package/dist/fig-compression.d.ts +3 -6
  197. package/dist/fig-compression.d.ts.map +1 -1
  198. package/dist/fig-compression.js +1 -2
  199. package/dist/figjam/index.js +1 -1
  200. package/dist/figjam/palette.d.ts +21 -23
  201. package/dist/figjam/palette.d.ts.map +1 -1
  202. package/dist/figjam/palette.js +3 -4
  203. package/dist/figjam/text.d.ts +10 -13
  204. package/dist/figjam/text.d.ts.map +1 -1
  205. package/dist/figjam/text.js +1 -2
  206. package/dist/font-style.d.ts +18 -18
  207. package/dist/font-style.d.ts.map +1 -1
  208. package/dist/font-style.js +5 -5
  209. package/dist/font-style.js.map +1 -1
  210. package/dist/generated/index.d.ts +32 -16
  211. package/dist/generated/index.d.ts.map +1 -1
  212. package/dist/generated/index.js +37 -9
  213. package/dist/generated/index.js.map +1 -1
  214. package/dist/generated/kind.d.ts +17 -6
  215. package/dist/generated/kind.d.ts.map +1 -1
  216. package/dist/generated/shape-with-text.d.ts +10 -13
  217. package/dist/generated/shape-with-text.d.ts.map +1 -1
  218. package/dist/generated/shape-with-text.js +3 -3
  219. package/dist/generated/shape-with-text.js.map +1 -1
  220. package/dist/generated/spec.d.ts +45 -0
  221. package/dist/generated/spec.d.ts.map +1 -0
  222. package/dist/generated/spec.js +281 -0
  223. package/dist/generated/spec.js.map +1 -0
  224. package/dist/generated/sticky.d.ts +23 -26
  225. package/dist/generated/sticky.d.ts.map +1 -1
  226. package/dist/generated/sticky.js +4 -4
  227. package/dist/generated/sticky.js.map +1 -1
  228. package/dist/geometry.d.ts +43 -69
  229. package/dist/geometry.d.ts.map +1 -1
  230. package/dist/geometry.js +44 -76
  231. package/dist/geometry.js.map +1 -1
  232. package/dist/gradient.d.ts +15 -18
  233. package/dist/gradient.d.ts.map +1 -1
  234. package/dist/gradient.js +1 -2
  235. package/dist/graph.d.ts +4 -7
  236. package/dist/graph.d.ts.map +1 -1
  237. package/dist/graph.js +26 -19
  238. package/dist/graph.js.map +1 -1
  239. package/dist/group-bounds.d.ts +10 -12
  240. package/dist/group-bounds.d.ts.map +1 -1
  241. package/dist/group-bounds.js +5 -6
  242. package/dist/guides.d.ts +5 -8
  243. package/dist/guides.d.ts.map +1 -1
  244. package/dist/guides.js +2 -3
  245. package/dist/hit-test.d.ts +20 -12
  246. package/dist/hit-test.d.ts.map +1 -1
  247. package/dist/hit-test.js +51 -31
  248. package/dist/hit-test.js.map +1 -1
  249. package/dist/icons/fit.d.ts +2 -4
  250. package/dist/icons/fit.d.ts.map +1 -1
  251. package/dist/icons/fit.js +1 -2
  252. package/dist/icons/glyph.d.ts +3 -5
  253. package/dist/icons/glyph.d.ts.map +1 -1
  254. package/dist/icons/glyph.js +3 -4
  255. package/dist/icons/index.d.ts +1 -1
  256. package/dist/icons/index.js +2 -2
  257. package/dist/icons/model.d.ts +8 -11
  258. package/dist/icons/model.d.ts.map +1 -1
  259. package/dist/icons/model.js +1 -2
  260. package/dist/icons/schema.d.ts +8 -11
  261. package/dist/icons/schema.d.ts.map +1 -1
  262. package/dist/icons/schema.js +1 -2
  263. package/dist/ids.d.ts +2 -5
  264. package/dist/ids.d.ts.map +1 -1
  265. package/dist/ids.js +3 -4
  266. package/dist/images.d.ts +20 -21
  267. package/dist/images.d.ts.map +1 -1
  268. package/dist/images.js +7 -6
  269. package/dist/images.js.map +1 -1
  270. package/dist/index.d.ts +2 -2
  271. package/dist/index.js +3 -3
  272. package/dist/instances/assignments.js +1 -2
  273. package/dist/instances/content-marks.js +98 -0
  274. package/dist/instances/content-marks.js.map +1 -0
  275. package/dist/instances/content-size.js +3 -4
  276. package/dist/instances/copies.js +2 -3
  277. package/dist/instances/cycles.d.ts +3 -6
  278. package/dist/instances/cycles.d.ts.map +1 -1
  279. package/dist/instances/cycles.js +1 -2
  280. package/dist/instances/deleted.d.ts +23 -0
  281. package/dist/instances/deleted.d.ts.map +1 -0
  282. package/dist/instances/deleted.js +82 -0
  283. package/dist/instances/deleted.js.map +1 -0
  284. package/dist/instances/fields.d.ts +5 -8
  285. package/dist/instances/fields.d.ts.map +1 -1
  286. package/dist/instances/fields.js +9 -7
  287. package/dist/instances/fields.js.map +1 -1
  288. package/dist/instances/index.d.ts +21 -20
  289. package/dist/instances/index.d.ts.map +1 -1
  290. package/dist/instances/index.js +69 -12
  291. package/dist/instances/index.js.map +1 -1
  292. package/dist/instances/kept-overrides.js +4 -5
  293. package/dist/instances/lookup.d.ts +17 -0
  294. package/dist/instances/lookup.d.ts.map +1 -0
  295. package/dist/instances/lookup.js +48 -0
  296. package/dist/instances/lookup.js.map +1 -0
  297. package/dist/instances/main-component.d.ts +2 -5
  298. package/dist/instances/main-component.d.ts.map +1 -1
  299. package/dist/instances/main-component.js +1 -2
  300. package/dist/instances/matching.js +1 -2
  301. package/dist/instances/overrides.d.ts +23 -26
  302. package/dist/instances/overrides.d.ts.map +1 -1
  303. package/dist/instances/overrides.js +1 -2
  304. package/dist/instances/placement.js +3 -4
  305. package/dist/instances/protection.js +3 -4
  306. package/dist/instances/source-walk.js +1 -2
  307. package/dist/instances/swap.js +7 -8
  308. package/dist/instances/sync.js +27 -14
  309. package/dist/instances/sync.js.map +1 -1
  310. package/dist/instances/vector-geometry.js +2 -3
  311. package/dist/layout/aspect-ratio.d.ts +7 -9
  312. package/dist/layout/aspect-ratio.d.ts.map +1 -1
  313. package/dist/layout/aspect-ratio.js +1 -2
  314. package/dist/layout/flow.d.ts +3 -6
  315. package/dist/layout/flow.d.ts.map +1 -1
  316. package/dist/layout/flow.js +6 -5
  317. package/dist/layout/flow.js.map +1 -1
  318. package/dist/layout/guides.d.ts +13 -16
  319. package/dist/layout/guides.d.ts.map +1 -1
  320. package/dist/layout/guides.js +4 -5
  321. package/dist/layout/guides.js.map +1 -1
  322. package/dist/layout/index.d.ts +3 -2
  323. package/dist/layout/index.js +6 -5
  324. package/dist/layout/keywords.d.ts +7 -9
  325. package/dist/layout/keywords.d.ts.map +1 -1
  326. package/dist/layout/keywords.js +1 -2
  327. package/dist/layout/limits.d.ts +13 -16
  328. package/dist/layout/limits.d.ts.map +1 -1
  329. package/dist/layout/limits.js +1 -2
  330. package/dist/layout/sizing.d.ts +11 -13
  331. package/dist/layout/sizing.d.ts.map +1 -1
  332. package/dist/layout/sizing.js +1 -2
  333. package/dist/layout/spacing.d.ts +2 -5
  334. package/dist/layout/spacing.d.ts.map +1 -1
  335. package/dist/layout/spacing.js +1 -2
  336. package/dist/layout/stacking.d.ts +8 -0
  337. package/dist/layout/stacking.d.ts.map +1 -0
  338. package/dist/layout/stacking.js +12 -0
  339. package/dist/layout/stacking.js.map +1 -0
  340. package/dist/layout/strokes.d.ts +1 -4
  341. package/dist/layout/strokes.d.ts.map +1 -1
  342. package/dist/layout/strokes.js +1 -2
  343. package/dist/layout/writes.js +1 -2
  344. package/dist/layout/writes.js.map +1 -1
  345. package/dist/masks.d.ts +4 -7
  346. package/dist/masks.d.ts.map +1 -1
  347. package/dist/masks.js +1 -2
  348. package/dist/matrix.d.ts +3 -4
  349. package/dist/matrix.d.ts.map +1 -1
  350. package/dist/matrix.js +11 -3
  351. package/dist/matrix.js.map +1 -1
  352. package/dist/mesh/geometry.d.ts +21 -24
  353. package/dist/mesh/geometry.d.ts.map +1 -1
  354. package/dist/mesh/geometry.js +3 -14
  355. package/dist/mesh/geometry.js.map +1 -1
  356. package/dist/mesh/index.d.ts +1 -1
  357. package/dist/mesh/index.js +1 -1
  358. package/dist/mesh/model.d.ts +5 -8
  359. package/dist/mesh/model.d.ts.map +1 -1
  360. package/dist/mesh/model.js +2 -3
  361. package/dist/mesh/schema.d.ts +10 -13
  362. package/dist/mesh/schema.d.ts.map +1 -1
  363. package/dist/mesh/schema.js +3 -4
  364. package/dist/motion/apply.d.ts +42 -0
  365. package/dist/motion/apply.d.ts.map +1 -0
  366. package/dist/motion/apply.js +98 -0
  367. package/dist/motion/apply.js.map +1 -0
  368. package/dist/motion/edit.d.ts +53 -0
  369. package/dist/motion/edit.d.ts.map +1 -0
  370. package/dist/motion/edit.js +125 -0
  371. package/dist/motion/edit.js.map +1 -0
  372. package/dist/motion/effects.js +86 -0
  373. package/dist/motion/effects.js.map +1 -0
  374. package/dist/motion/evaluate.d.ts +33 -0
  375. package/dist/motion/evaluate.d.ts.map +1 -0
  376. package/dist/motion/evaluate.js +160 -0
  377. package/dist/motion/evaluate.js.map +1 -0
  378. package/dist/motion/fields.d.ts +69 -0
  379. package/dist/motion/fields.d.ts.map +1 -0
  380. package/dist/motion/fields.js +132 -0
  381. package/dist/motion/fields.js.map +1 -0
  382. package/dist/motion/index.d.ts +16 -0
  383. package/dist/motion/index.js +15 -0
  384. package/dist/motion/keyable.d.ts +32 -0
  385. package/dist/motion/keyable.d.ts.map +1 -0
  386. package/dist/motion/keyable.js +120 -0
  387. package/dist/motion/keyable.js.map +1 -0
  388. package/dist/motion/outline.d.ts +35 -0
  389. package/dist/motion/outline.d.ts.map +1 -0
  390. package/dist/motion/outline.js +59 -0
  391. package/dist/motion/outline.js.map +1 -0
  392. package/dist/motion/presets/index.d.ts +20 -0
  393. package/dist/motion/presets/index.d.ts.map +1 -0
  394. package/dist/motion/presets/index.js +166 -0
  395. package/dist/motion/presets/index.js.map +1 -0
  396. package/dist/motion/presets/settings.d.ts +43 -0
  397. package/dist/motion/presets/settings.d.ts.map +1 -0
  398. package/dist/motion/presets/settings.js +254 -0
  399. package/dist/motion/presets/settings.js.map +1 -0
  400. package/dist/motion/presets/stagger.d.ts +69 -0
  401. package/dist/motion/presets/stagger.d.ts.map +1 -0
  402. package/dist/motion/presets/stagger.js +185 -0
  403. package/dist/motion/presets/stagger.js.map +1 -0
  404. package/dist/motion/schema.d.ts +185 -0
  405. package/dist/motion/schema.d.ts.map +1 -0
  406. package/dist/motion/schema.js +62 -0
  407. package/dist/motion/schema.js.map +1 -0
  408. package/dist/motion/segment.d.ts +25 -0
  409. package/dist/motion/segment.d.ts.map +1 -0
  410. package/dist/motion/segment.js +73 -0
  411. package/dist/motion/segment.js.map +1 -0
  412. package/dist/motion/spec.d.ts +26 -0
  413. package/dist/motion/spec.d.ts.map +1 -0
  414. package/dist/motion/spec.js +175 -0
  415. package/dist/motion/spec.js.map +1 -0
  416. package/dist/motion/timeline.d.ts +16 -0
  417. package/dist/motion/timeline.d.ts.map +1 -0
  418. package/dist/motion/timeline.js +53 -0
  419. package/dist/motion/timeline.js.map +1 -0
  420. package/dist/motion/types.d.ts +49 -0
  421. package/dist/motion/types.d.ts.map +1 -0
  422. package/dist/motion/variables.d.ts +9 -0
  423. package/dist/motion/variables.d.ts.map +1 -0
  424. package/dist/motion/variables.js +25 -0
  425. package/dist/motion/variables.js.map +1 -0
  426. package/dist/mutation-impact.d.ts +7 -10
  427. package/dist/mutation-impact.d.ts.map +1 -1
  428. package/dist/mutation-impact.js +2 -3
  429. package/dist/node-defaults.d.ts +14 -15
  430. package/dist/node-defaults.d.ts.map +1 -1
  431. package/dist/node-defaults.js +133 -51
  432. package/dist/node-defaults.js.map +1 -1
  433. package/dist/order-keys.d.ts +8 -9
  434. package/dist/order-keys.d.ts.map +1 -1
  435. package/dist/order-keys.js +10 -2
  436. package/dist/order-keys.js.map +1 -1
  437. package/dist/outline/flatten.d.ts +3 -6
  438. package/dist/outline/flatten.d.ts.map +1 -1
  439. package/dist/outline/flatten.js +3 -4
  440. package/dist/outline/heads.js +1 -2
  441. package/dist/outline/hit.d.ts +2 -5
  442. package/dist/outline/hit.d.ts.map +1 -1
  443. package/dist/outline/hit.js +5 -6
  444. package/dist/outline/index.js +3 -3
  445. package/dist/outline/point.d.ts +4 -7
  446. package/dist/outline/point.d.ts.map +1 -1
  447. package/dist/outline/point.js +2 -3
  448. package/dist/outline/shapes.d.ts +4 -7
  449. package/dist/outline/shapes.d.ts.map +1 -1
  450. package/dist/outline/shapes.js +2 -3
  451. package/dist/paints/index.d.ts +2 -2
  452. package/dist/paints/index.js +4 -4
  453. package/dist/paints/pattern.d.ts +6 -9
  454. package/dist/paints/pattern.d.ts.map +1 -1
  455. package/dist/paints/pattern.js +1 -2
  456. package/dist/paints/schema.d.ts +4 -7
  457. package/dist/paints/schema.d.ts.map +1 -1
  458. package/dist/paints/schema.js +3 -4
  459. package/dist/paints/shows.d.ts +3 -6
  460. package/dist/paints/shows.d.ts.map +1 -1
  461. package/dist/paints/shows.js +1 -2
  462. package/dist/paints/solid.d.ts +1 -4
  463. package/dist/paints/solid.d.ts.map +1 -1
  464. package/dist/paints/solid.js +1 -2
  465. package/dist/paints/stills.d.ts +17 -17
  466. package/dist/paints/stills.d.ts.map +1 -1
  467. package/dist/paints/stills.js +22 -18
  468. package/dist/paints/stills.js.map +1 -1
  469. package/dist/parse-path.d.ts +12 -9
  470. package/dist/parse-path.d.ts.map +1 -1
  471. package/dist/parse-path.js +13 -3
  472. package/dist/parse-path.js.map +1 -1
  473. package/dist/paths/arc.d.ts +6 -9
  474. package/dist/paths/arc.d.ts.map +1 -1
  475. package/dist/paths/arc.js +1 -2
  476. package/dist/paths/index.d.ts +1 -1
  477. package/dist/paths/index.js +1 -1
  478. package/dist/paths/network.d.ts +13 -16
  479. package/dist/paths/network.d.ts.map +1 -1
  480. package/dist/paths/network.js +1 -2
  481. package/dist/paths/sink.d.ts +5 -8
  482. package/dist/paths/sink.d.ts.map +1 -1
  483. package/dist/paths/sink.js +1 -2
  484. package/dist/paths/smooth-corners.d.ts +3 -6
  485. package/dist/paths/smooth-corners.d.ts.map +1 -1
  486. package/dist/paths/smooth-corners.js +1 -2
  487. package/dist/plugin-data/field.d.ts +15 -18
  488. package/dist/plugin-data/field.d.ts.map +1 -1
  489. package/dist/plugin-data/field.js +1 -2
  490. package/dist/plugin-data/fields.d.ts +37 -11
  491. package/dist/plugin-data/fields.d.ts.map +1 -1
  492. package/dist/plugin-data/fields.js +35 -10
  493. package/dist/plugin-data/fields.js.map +1 -1
  494. package/dist/plugin-data/index.d.ts +2 -2
  495. package/dist/plugin-data/index.js +2 -2
  496. package/dist/polygon.d.ts +8 -8
  497. package/dist/polygon.d.ts.map +1 -1
  498. package/dist/polygon.js +7 -7
  499. package/dist/polygon.js.map +1 -1
  500. package/dist/preview.d.ts +3 -5
  501. package/dist/preview.d.ts.map +1 -1
  502. package/dist/preview.js +2 -3
  503. package/dist/primitives/index.d.ts +7 -9
  504. package/dist/primitives/index.d.ts.map +1 -1
  505. package/dist/primitives/index.js +1 -2
  506. package/dist/primitives/schema.d.ts +3 -6
  507. package/dist/primitives/schema.d.ts.map +1 -1
  508. package/dist/primitives/schema.js +1 -2
  509. package/dist/resize.d.ts +13 -15
  510. package/dist/resize.d.ts.map +1 -1
  511. package/dist/resize.js +5 -6
  512. package/dist/scaling/node.d.ts +2 -5
  513. package/dist/scaling/node.d.ts.map +1 -1
  514. package/dist/scaling/node.js +4 -5
  515. package/dist/scaling/snapshot.d.ts +5 -8
  516. package/dist/scaling/snapshot.d.ts.map +1 -1
  517. package/dist/scaling/snapshot.js +1 -2
  518. package/dist/scaling/tree.d.ts +6 -9
  519. package/dist/scaling/tree.d.ts.map +1 -1
  520. package/dist/scaling/tree.js +2 -3
  521. package/dist/shaders/index.d.ts +2 -2
  522. package/dist/shaders/index.js +2 -2
  523. package/dist/shaders/model.d.ts +54 -13
  524. package/dist/shaders/model.d.ts.map +1 -1
  525. package/dist/shaders/model.js +98 -7
  526. package/dist/shaders/model.js.map +1 -1
  527. package/dist/shaders/schema.d.ts +15 -8
  528. package/dist/shaders/schema.d.ts.map +1 -1
  529. package/dist/shaders/schema.js +11 -2
  530. package/dist/shaders/schema.js.map +1 -1
  531. package/dist/shape-with-text/document.js +9 -21
  532. package/dist/shape-with-text/document.js.map +1 -1
  533. package/dist/shape-with-text/fit.d.ts +6 -9
  534. package/dist/shape-with-text/fit.d.ts.map +1 -1
  535. package/dist/shape-with-text/fit.js +1 -2
  536. package/dist/shape-with-text/geometry.d.ts +7 -10
  537. package/dist/shape-with-text/geometry.d.ts.map +1 -1
  538. package/dist/shape-with-text/geometry.js +4 -7
  539. package/dist/shape-with-text/geometry.js.map +1 -1
  540. package/dist/shape-with-text/index.js +1 -1
  541. package/dist/shape-with-text/kinds.d.ts +4 -7
  542. package/dist/shape-with-text/kinds.d.ts.map +1 -1
  543. package/dist/shape-with-text/kinds.js +1 -2
  544. package/dist/shared-style-index.d.ts +2 -4
  545. package/dist/shared-style-index.d.ts.map +1 -1
  546. package/dist/shared-style-index.js +1 -2
  547. package/dist/shared-style-index.js.map +1 -1
  548. package/dist/shared-styles.d.ts +17 -19
  549. package/dist/shared-styles.d.ts.map +1 -1
  550. package/dist/shared-styles.js +5 -6
  551. package/dist/slides/drop.d.ts +5 -8
  552. package/dist/slides/drop.d.ts.map +1 -1
  553. package/dist/slides/drop.js +1 -2
  554. package/dist/slides/index.d.ts +19 -19
  555. package/dist/slides/index.d.ts.map +1 -1
  556. package/dist/slides/index.js +8 -5
  557. package/dist/slides/index.js.map +1 -1
  558. package/dist/slides/motion.d.ts +32 -16
  559. package/dist/slides/motion.d.ts.map +1 -1
  560. package/dist/slides/motion.js +30 -5
  561. package/dist/slides/motion.js.map +1 -1
  562. package/dist/slides/playback.d.ts +24 -21
  563. package/dist/slides/playback.d.ts.map +1 -1
  564. package/dist/slides/playback.js +45 -13
  565. package/dist/slides/playback.js.map +1 -1
  566. package/dist/slides/types.d.ts +8 -11
  567. package/dist/slides/types.d.ts.map +1 -1
  568. package/dist/slides/types.js +1 -2
  569. package/dist/slots/authoring.d.ts +6 -9
  570. package/dist/slots/authoring.d.ts.map +1 -1
  571. package/dist/slots/authoring.js +2 -3
  572. package/dist/slots/content.d.ts +5 -8
  573. package/dist/slots/content.d.ts.map +1 -1
  574. package/dist/slots/content.js +4 -5
  575. package/dist/slots/frames.d.ts +7 -9
  576. package/dist/slots/frames.d.ts.map +1 -1
  577. package/dist/slots/frames.js +3 -4
  578. package/dist/slots/frames.js.map +1 -1
  579. package/dist/slots/index.js +1 -1
  580. package/dist/slots/limits.d.ts +4 -7
  581. package/dist/slots/limits.d.ts.map +1 -1
  582. package/dist/slots/limits.js +1 -2
  583. package/dist/snap.d.ts +4 -7
  584. package/dist/snap.d.ts.map +1 -1
  585. package/dist/snap.js +7 -8
  586. package/dist/source-metadata.d.ts +1 -4
  587. package/dist/source-metadata.d.ts.map +1 -1
  588. package/dist/source-metadata.js +1 -2
  589. package/dist/specs/index.d.ts +3 -0
  590. package/dist/specs/index.js +3 -0
  591. package/dist/specs/model.d.ts +20 -0
  592. package/dist/specs/model.d.ts.map +1 -0
  593. package/dist/specs/model.js +32 -0
  594. package/dist/specs/model.js.map +1 -0
  595. package/dist/specs/schema.d.ts +24 -0
  596. package/dist/specs/schema.d.ts.map +1 -0
  597. package/dist/specs/schema.js +32 -0
  598. package/dist/specs/schema.js.map +1 -0
  599. package/dist/statuses/impact.d.ts +2 -5
  600. package/dist/statuses/impact.d.ts.map +1 -1
  601. package/dist/statuses/impact.js +2 -3
  602. package/dist/statuses/index.d.ts +1 -1
  603. package/dist/statuses/index.js +2 -2
  604. package/dist/statuses/node.d.ts +4 -7
  605. package/dist/statuses/node.d.ts.map +1 -1
  606. package/dist/statuses/node.js +1 -2
  607. package/dist/statuses/schema.d.ts +7 -9
  608. package/dist/statuses/schema.d.ts.map +1 -1
  609. package/dist/statuses/schema.js +1 -2
  610. package/dist/statuses/workflow.d.ts +9 -12
  611. package/dist/statuses/workflow.d.ts.map +1 -1
  612. package/dist/statuses/workflow.js +1 -2
  613. package/dist/strokes.d.ts +8 -10
  614. package/dist/strokes.d.ts.map +1 -1
  615. package/dist/strokes.js +2 -3
  616. package/dist/text/auto-resize.d.ts +4 -6
  617. package/dist/text/auto-resize.d.ts.map +1 -1
  618. package/dist/text/auto-resize.js +1 -2
  619. package/dist/text/direction.d.ts +5 -8
  620. package/dist/text/direction.d.ts.map +1 -1
  621. package/dist/text/direction.js +1 -2
  622. package/dist/text/index.d.ts +2 -2
  623. package/dist/text/index.js +5 -5
  624. package/dist/text/lengths.d.ts +9 -12
  625. package/dist/text/lengths.d.ts.map +1 -1
  626. package/dist/text/lengths.js +1 -2
  627. package/dist/text/lists.d.ts +17 -13
  628. package/dist/text/lists.d.ts.map +1 -1
  629. package/dist/text/lists.js +15 -4
  630. package/dist/text/lists.js.map +1 -1
  631. package/dist/text/name.d.ts +4 -7
  632. package/dist/text/name.d.ts.map +1 -1
  633. package/dist/text/name.js +1 -2
  634. package/dist/text/overflow.d.ts +5 -7
  635. package/dist/text/overflow.d.ts.map +1 -1
  636. package/dist/text/overflow.js +1 -2
  637. package/dist/text/paragraphs.d.ts +20 -23
  638. package/dist/text/paragraphs.d.ts.map +1 -1
  639. package/dist/text/paragraphs.js +8 -5
  640. package/dist/text/paragraphs.js.map +1 -1
  641. package/dist/text/path.js +1 -2
  642. package/dist/text/picture.d.ts +3 -6
  643. package/dist/text/picture.d.ts.map +1 -1
  644. package/dist/text/picture.js +2 -3
  645. package/dist/text/references.d.ts +3 -6
  646. package/dist/text/references.d.ts.map +1 -1
  647. package/dist/text/references.js +1 -2
  648. package/dist/text/runs.d.ts +6 -9
  649. package/dist/text/runs.d.ts.map +1 -1
  650. package/dist/text/runs.js +1 -2
  651. package/dist/text/schema.d.ts +1 -4
  652. package/dist/text/schema.d.ts.map +1 -1
  653. package/dist/text/schema.js +1 -2
  654. package/dist/thumbnail.d.ts +4 -7
  655. package/dist/thumbnail.d.ts.map +1 -1
  656. package/dist/thumbnail.js +1 -2
  657. package/dist/transfer/apply.d.ts +2 -5
  658. package/dist/transfer/apply.d.ts.map +1 -1
  659. package/dist/transfer/apply.js +2 -3
  660. package/dist/transfer/copied.d.ts +5 -8
  661. package/dist/transfer/copied.d.ts.map +1 -1
  662. package/dist/transfer/copied.js +3 -4
  663. package/dist/transfer/dependencies.d.ts +6 -9
  664. package/dist/transfer/dependencies.d.ts.map +1 -1
  665. package/dist/transfer/dependencies.js +13 -11
  666. package/dist/transfer/dependencies.js.map +1 -1
  667. package/dist/transfer/history.d.ts +1 -4
  668. package/dist/transfer/history.d.ts.map +1 -1
  669. package/dist/transfer/history.js +1 -2
  670. package/dist/transfer/identity.js +1 -2
  671. package/dist/transfer/index.d.ts +3 -3
  672. package/dist/transfer/index.js +6 -6
  673. package/dist/transfer/library.d.ts +5 -7
  674. package/dist/transfer/library.d.ts.map +1 -1
  675. package/dist/transfer/library.js +32 -12
  676. package/dist/transfer/library.js.map +1 -1
  677. package/dist/transfer/nodes.d.ts +2 -5
  678. package/dist/transfer/nodes.d.ts.map +1 -1
  679. package/dist/transfer/nodes.js +8 -6
  680. package/dist/transfer/nodes.js.map +1 -1
  681. package/dist/transfer/plan.d.ts +2 -5
  682. package/dist/transfer/plan.d.ts.map +1 -1
  683. package/dist/transfer/plan.js +2 -3
  684. package/dist/transfer/references.js +1 -2
  685. package/dist/transfer/remove.d.ts +1 -4
  686. package/dist/transfer/remove.d.ts.map +1 -1
  687. package/dist/transfer/remove.js +2 -3
  688. package/dist/transfer/resources.d.ts +2 -5
  689. package/dist/transfer/resources.d.ts.map +1 -1
  690. package/dist/transfer/resources.js +3 -4
  691. package/dist/transfer/validation.js +1 -2
  692. package/dist/transfer/variables.d.ts +3 -6
  693. package/dist/transfer/variables.d.ts.map +1 -1
  694. package/dist/transfer/variables.js +2 -3
  695. package/dist/types.d.ts +191 -142
  696. package/dist/types.d.ts.map +1 -1
  697. package/dist/types.js +15 -3
  698. package/dist/types.js.map +1 -1
  699. package/dist/undo.d.ts +5 -8
  700. package/dist/undo.d.ts.map +1 -1
  701. package/dist/undo.js +9 -3
  702. package/dist/undo.js.map +1 -1
  703. package/dist/variables/bindings.d.ts +24 -25
  704. package/dist/variables/bindings.d.ts.map +1 -1
  705. package/dist/variables/bindings.js +28 -23
  706. package/dist/variables/bindings.js.map +1 -1
  707. package/dist/variables/corners.d.ts +1 -4
  708. package/dist/variables/corners.d.ts.map +1 -1
  709. package/dist/variables/corners.js +1 -2
  710. package/dist/variables/easing.d.ts +24 -19
  711. package/dist/variables/easing.d.ts.map +1 -1
  712. package/dist/variables/easing.js +17 -17
  713. package/dist/variables/easing.js.map +1 -1
  714. package/dist/variables/fields.d.ts +21 -14
  715. package/dist/variables/fields.d.ts.map +1 -1
  716. package/dist/variables/fields.js +24 -6
  717. package/dist/variables/fields.js.map +1 -1
  718. package/dist/variables/formula/check.d.ts +2 -5
  719. package/dist/variables/formula/check.d.ts.map +1 -1
  720. package/dist/variables/formula/check.js +2 -3
  721. package/dist/variables/formula/evaluate.d.ts +1 -4
  722. package/dist/variables/formula/evaluate.d.ts.map +1 -1
  723. package/dist/variables/formula/evaluate.js +3 -4
  724. package/dist/variables/formula/index.d.ts +6 -8
  725. package/dist/variables/formula/index.d.ts.map +1 -1
  726. package/dist/variables/formula/index.js +4 -5
  727. package/dist/variables/formula/parse.js +5 -6
  728. package/dist/variables/formula/print.d.ts +2 -5
  729. package/dist/variables/formula/print.d.ts.map +1 -1
  730. package/dist/variables/formula/print.js +4 -5
  731. package/dist/variables/formula/schema.d.ts +2 -5
  732. package/dist/variables/formula/schema.d.ts.map +1 -1
  733. package/dist/variables/formula/schema.js +5 -6
  734. package/dist/variables/formula/signatures.d.ts +3 -6
  735. package/dist/variables/formula/signatures.d.ts.map +1 -1
  736. package/dist/variables/formula/signatures.js +1 -2
  737. package/dist/variables/formula/tokens.d.ts +5 -8
  738. package/dist/variables/formula/tokens.d.ts.map +1 -1
  739. package/dist/variables/formula/tokens.js +1 -2
  740. package/dist/variables/formula/tree.d.ts +6 -9
  741. package/dist/variables/formula/tree.d.ts.map +1 -1
  742. package/dist/variables/formula/tree.js +1 -2
  743. package/dist/variables/formula/tree.js.map +1 -1
  744. package/dist/variables/index.d.ts +30 -32
  745. package/dist/variables/index.d.ts.map +1 -1
  746. package/dist/variables/index.js +17 -18
  747. package/dist/variables/lookup.d.ts +11 -7
  748. package/dist/variables/lookup.d.ts.map +1 -1
  749. package/dist/variables/lookup.js +24 -3
  750. package/dist/variables/lookup.js.map +1 -1
  751. package/dist/variables/motion.d.ts +9 -12
  752. package/dist/variables/motion.d.ts.map +1 -1
  753. package/dist/variables/motion.js +3 -4
  754. package/dist/variables/paints.d.ts +18 -20
  755. package/dist/variables/paints.d.ts.map +1 -1
  756. package/dist/variables/paints.js +4 -5
  757. package/dist/variables/resolution.d.ts +22 -19
  758. package/dist/variables/resolution.d.ts.map +1 -1
  759. package/dist/variables/resolution.js +13 -5
  760. package/dist/variables/resolution.js.map +1 -1
  761. package/dist/variables/schema.d.ts +9 -12
  762. package/dist/variables/schema.d.ts.map +1 -1
  763. package/dist/variables/schema.js +3 -4
  764. package/dist/variables/style-bindings.d.ts +11 -13
  765. package/dist/variables/style-bindings.d.ts.map +1 -1
  766. package/dist/variables/style-bindings.js +2 -3
  767. package/dist/variables/subtree.js +1 -2
  768. package/dist/variables/text.d.ts +2 -5
  769. package/dist/variables/text.d.ts.map +1 -1
  770. package/dist/variables/text.js +3 -4
  771. package/dist/variables/token.d.ts +5 -8
  772. package/dist/variables/token.d.ts.map +1 -1
  773. package/dist/variables/token.js +1 -2
  774. package/dist/variables/units.js +3 -5
  775. package/dist/variables/units.js.map +1 -1
  776. package/dist/variables/value.d.ts +4 -7
  777. package/dist/variables/value.d.ts.map +1 -1
  778. package/dist/variables/value.js +4 -5
  779. package/dist/variant-name.d.ts +2 -5
  780. package/dist/variant-name.d.ts.map +1 -1
  781. package/dist/variant-name.js +1 -2
  782. package/dist/variant-properties.d.ts +4 -7
  783. package/dist/variant-properties.d.ts.map +1 -1
  784. package/dist/variant-properties.js +2 -3
  785. package/dist/vector-network.d.ts +17 -20
  786. package/dist/vector-network.d.ts.map +1 -1
  787. package/dist/vector-network.js +4 -5
  788. package/package.json +23 -5
  789. package/src/behaviours/index.ts +1 -0
  790. package/src/behaviours/kinds.ts +103 -1
  791. package/src/behaviours/listing.ts +142 -0
  792. package/src/behaviours/model.ts +21 -0
  793. package/src/blur.ts +88 -0
  794. package/src/clipping.ts +3 -4
  795. package/src/comments/threads.ts +8 -1
  796. package/src/connectors/layout.ts +10 -3
  797. package/src/connectors/sublayers.ts +2 -1
  798. package/src/coordinate.ts +17 -25
  799. package/src/copy.ts +15 -6
  800. package/src/cubic.ts +57 -1
  801. package/src/export-format.ts +11 -1
  802. package/src/font-style.ts +12 -4
  803. package/src/generated/index.ts +43 -6
  804. package/src/generated/kind.ts +16 -2
  805. package/src/generated/shape-with-text.ts +1 -0
  806. package/src/generated/spec.ts +243 -0
  807. package/src/generated/sticky.ts +2 -1
  808. package/src/geometry.ts +39 -88
  809. package/src/graph.ts +21 -6
  810. package/src/hit-test.ts +66 -26
  811. package/src/images.ts +4 -1
  812. package/src/instances/content-marks.ts +124 -0
  813. package/src/instances/deleted.ts +115 -0
  814. package/src/instances/fields.ts +7 -3
  815. package/src/instances/index.ts +94 -5
  816. package/src/instances/lookup.ts +61 -0
  817. package/src/instances/sync.ts +15 -0
  818. package/src/layout/flow.ts +5 -3
  819. package/src/layout/index.ts +1 -0
  820. package/src/layout/stacking.ts +14 -0
  821. package/src/matrix.ts +11 -1
  822. package/src/mesh/geometry.ts +2 -13
  823. package/src/motion/apply.ts +156 -0
  824. package/src/motion/edit.ts +148 -0
  825. package/src/motion/effects.ts +166 -0
  826. package/src/motion/evaluate.ts +181 -0
  827. package/src/motion/fields.ts +136 -0
  828. package/src/motion/index.ts +13 -0
  829. package/src/motion/keyable.ts +141 -0
  830. package/src/motion/outline.ts +72 -0
  831. package/src/motion/presets/index.ts +257 -0
  832. package/src/motion/presets/settings.ts +221 -0
  833. package/src/motion/presets/stagger.ts +242 -0
  834. package/src/motion/schema.ts +66 -0
  835. package/src/motion/segment.ts +83 -0
  836. package/src/motion/spec.ts +225 -0
  837. package/src/motion/timeline.ts +48 -0
  838. package/src/motion/types.ts +45 -0
  839. package/src/motion/variables.ts +33 -0
  840. package/src/node-defaults.ts +131 -49
  841. package/src/order-keys.ts +16 -2
  842. package/src/paints/stills.ts +16 -12
  843. package/src/parse-path.ts +15 -0
  844. package/src/plugin-data/fields.ts +40 -3
  845. package/src/polygon.ts +6 -4
  846. package/src/shaders/model.ts +124 -6
  847. package/src/shaders/schema.ts +12 -0
  848. package/src/shape-with-text/document.ts +7 -12
  849. package/src/shape-with-text/geometry.ts +1 -4
  850. package/src/slides/index.ts +8 -0
  851. package/src/slides/motion.ts +35 -1
  852. package/src/slides/playback.ts +51 -9
  853. package/src/slots/frames.ts +2 -3
  854. package/src/specs/index.ts +2 -0
  855. package/src/specs/model.ts +40 -0
  856. package/src/specs/schema.ts +43 -0
  857. package/src/text/lists.ts +20 -7
  858. package/src/text/paragraphs.ts +10 -3
  859. package/src/transfer/dependencies.ts +17 -11
  860. package/src/transfer/library.ts +36 -12
  861. package/src/transfer/nodes.ts +8 -0
  862. package/src/types.ts +71 -8
  863. package/src/undo.ts +10 -1
  864. package/src/variables/bindings.ts +33 -16
  865. package/src/variables/easing.ts +16 -17
  866. package/src/variables/fields.ts +30 -3
  867. package/src/variables/lookup.ts +24 -1
  868. package/src/variables/resolution.ts +15 -1
  869. package/src/variables/units.ts +2 -3
package/dist/thumbnail.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { readPluginData, withPluginData } from "./plugin-data/field.js";
2
2
  import { OPEN_PENCIL_PLUGIN_DATA } from "./plugin-data/fields.js";
3
- //#region src/thumbnail.ts
3
+ // src/thumbnail.ts
4
4
  const { thumbnail } = OPEN_PENCIL_PLUGIN_DATA;
5
5
  /** Layers that frame a picture of their own, as Figma lets frames and sections be thumbnails. */
6
6
  const THUMBNAIL_TYPES = /* @__PURE__ */ new Set([
@@ -41,7 +41,6 @@ function setDocumentThumbnail(graph, nodeId) {
41
41
  if (!root) return;
42
42
  graph.updateNode(root.id, { pluginData: withPluginData(root.pluginData, thumbnail, nodeId ?? void 0) });
43
43
  }
44
- //#endregion
45
44
  export { canBeDocumentThumbnail, documentThumbnail, documentThumbnailId, setDocumentThumbnail };
46
45
 
47
46
  //# sourceMappingURL=thumbnail.js.map
@@ -1,9 +1,6 @@
1
1
  import { SceneGraph } from "../graph.js";
2
2
  import { prepareGraphTransfer } from "./plan.js";
3
- //#region src/transfer/apply.d.ts
4
- type GraphTransferPlan = ReturnType<typeof prepareGraphTransfer>;
3
+ export type GraphTransferPlan = ReturnType<typeof prepareGraphTransfer>;
5
4
  /** Revalidate at insertion time. Event-delivery failures after commit are not rollback failures. */
6
- declare function applyGraphTransfer(target: SceneGraph, input: GraphTransferPlan): void;
7
- //#endregion
8
- export { GraphTransferPlan, applyGraphTransfer };
5
+ export declare function applyGraphTransfer(target: SceneGraph, input: GraphTransferPlan): void;
9
6
  //# sourceMappingURL=apply.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","names":[],"sources":["../../src/transfer/apply.ts"],"mappings":";;;KAQY,oBAAoB,kBAAkB;;iBAqDlC,mBAAmB,QAAQ,YAAY,OAAO"}
1
+ {"version":3,"file":"apply.d.ts","names":[],"sources":["../../src/transfer/apply.ts"],"mappings":";;YAQY,oBAAoB,kBAAkB;;wBAqDlC,mBAAmB,QAAQ,YAAY,OAAO"}
@@ -1,8 +1,8 @@
1
+ import { isEqual } from "es-toolkit/predicate";
1
2
  import { heldTransferCollections, variableIdentityReferences } from "./identity.js";
2
3
  import { validateTransferReferences } from "./validation.js";
3
4
  import { prepareVariableTransfer } from "./variables.js";
4
- import { isEqual } from "es-toolkit/predicate";
5
- //#region src/transfer/apply.ts
5
+ // src/transfer/apply.ts
6
6
  function validate(target, plan) {
7
7
  validateTransferReferences(target, plan);
8
8
  const reserved = /* @__PURE__ */ new Set([
@@ -65,7 +65,6 @@ function applyGraphTransfer(target, input) {
65
65
  }
66
66
  });
67
67
  }
68
- //#endregion
69
68
  export { applyGraphTransfer, leaveHeldCollections };
70
69
 
71
70
  //# sourceMappingURL=apply.js.map
@@ -1,8 +1,7 @@
1
1
  import { SceneGraph } from "../graph.js";
2
2
  import { SceneNode } from "../types.js";
3
- //#region src/transfer/copied.d.ts
4
3
  /** How a layer's references to other layers are resolved anew. */
5
- interface ReferenceResolvers {
4
+ export interface ReferenceResolvers {
6
5
  /** The component a reference names now; `previous` is the one the layer named, if any. */
7
6
  component: (id: string, previous: string | null) => string;
8
7
  /** The layer an override names now; `component` is the one its instance now draws. */
@@ -18,7 +17,7 @@ interface ReferenceResolvers {
18
17
  variable: (id: string) => string;
19
18
  }
20
19
  /** Copies placed in another document, whose text links must follow the copy. */
21
- interface CopiedReferenceOptions {
20
+ export interface CopiedReferenceOptions {
22
21
  followTextLinks?: boolean;
23
22
  /**
24
23
  * Layers the target already holds in place of ones left out of the copy, by the ID each stands
@@ -27,7 +26,7 @@ interface CopiedReferenceOptions {
27
26
  aliases?: ReadonlyMap<string, string>;
28
27
  }
29
28
  /** The instance-swap properties `nodes` define, whose values name components. */
30
- declare function instanceSwapPropertyIds(nodes: Iterable<SceneNode>): Set<string>;
29
+ export declare function instanceSwapPropertyIds(nodes: Iterable<SceneNode>): Set<string>;
31
30
  /**
32
31
  * `node`'s references to other layers, resolved anew: its main component, the layers its
33
32
  * overrides change and the components they swap in, the components its instance-swap properties
@@ -35,7 +34,7 @@ declare function instanceSwapPropertyIds(nodes: Iterable<SceneNode>): Set<string
35
34
  * whose references these replace, so a resolver can keep what it already pointed at. Only the
36
35
  * fields whose references change are returned: every write is an update collaboration sends.
37
36
  */
38
- declare function resolvedReferences(node: SceneNode, previous: SceneNode, resolve: ReferenceResolvers, swapProperties: ReadonlySet<string>): Partial<SceneNode>;
37
+ export declare function resolvedReferences(node: SceneNode, previous: SceneNode, resolve: ReferenceResolvers, swapProperties: ReadonlySet<string>): Partial<SceneNode>;
39
38
  /**
40
39
  * Points copied layers at one another, as `prepareNodeTransfer` does for a paste: an instance's
41
40
  * main component, the layers its overrides change and the components they swap in, the
@@ -45,7 +44,5 @@ declare function resolvedReferences(node: SceneNode, previous: SceneNode, resolv
45
44
  * so do variable IDs, since the copies keep their source's variables. Text links follow the copy
46
45
  * only with `followTextLinks`, and `aliases` points references at layers already there.
47
46
  */
48
- declare function remapCopiedReferences(graph: SceneGraph, mappedIds: ReadonlyMap<string, string>, options?: CopiedReferenceOptions): void;
49
- //#endregion
50
- export { CopiedReferenceOptions, ReferenceResolvers, instanceSwapPropertyIds, remapCopiedReferences, resolvedReferences };
47
+ export declare function remapCopiedReferences(graph: SceneGraph, mappedIds: ReadonlyMap<string, string>, options?: CopiedReferenceOptions): void;
51
48
  //# sourceMappingURL=copied.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"copied.d.ts","names":[],"sources":["../../src/transfer/copied.ts"],"mappings":";;;;UASiB;;EAEf,YAAY,YAAY;;EAExB,QAAQ,YAAY;;EAEpB,WAAW;;;;;;EAMX,QAAQ;EACR,WAAW;;;UAII;EACf;;;;;EAKA,UAAU;;;iBAUI,wBAAwB,OAAO,SAAS,aAAa;;;;;;;;iBAWrD,mBACd,MAAM,WACN,UAAU,WACV,SAAS,oBACT,gBAAgB,sBACf,QAAQ;;;;;;;;;;iBA8DK,sBACd,OAAO,YACP,WAAW,6BACX,UAAS"}
1
+ {"version":3,"file":"copied.d.ts","names":[],"sources":["../../src/transfer/copied.ts"],"mappings":";;;iBASiB;;EAEf,YAAY,YAAY;;EAExB,QAAQ,YAAY;;EAEpB,WAAW;;;;;;EAMX,QAAQ;EACR,WAAW;;;iBAII;EACf;;;;;EAKA,UAAU;;;wBAUI,wBAAwB,OAAO,SAAS,aAAa;;;;;;;;wBAWrD,mBACd,MAAM,WACN,UAAU,WACV,SAAS,oBACT,gBAAgB,sBACf,QAAQ;;;;;;;;;;wBA8DK,sBACd,OAAO,YACP,WAAW,6BACX,UAAS"}
@@ -1,8 +1,8 @@
1
+ import { isEqual, mapValues } from "es-toolkit";
2
+ import { componentPropertyDefinitions } from "../components/properties.js";
1
3
  import { remapInstanceOverrideState } from "../instances/overrides.js";
2
4
  import { remapStyleRunReferences } from "../text/references.js";
3
- import { componentPropertyDefinitions } from "../components/properties.js";
4
- import { isEqual, mapValues } from "es-toolkit";
5
- //#region src/transfer/copied.ts
5
+ // src/transfer/copied.ts
6
6
  function swapPropertyIds(definitions) {
7
7
  return definitions.filter((definition) => definition.type === "INSTANCE_SWAP").map((definition) => definition.id);
8
8
  }
@@ -77,7 +77,6 @@ function remapCopiedReferences(graph, mappedIds, options = {}) {
77
77
  if (Object.keys(changes).length > 0) graph.updateNode(node.id, changes);
78
78
  }
79
79
  }
80
- //#endregion
81
80
  export { instanceSwapPropertyIds, remapCopiedReferences, resolvedReferences };
82
81
 
83
82
  //# sourceMappingURL=copied.js.map
@@ -1,8 +1,7 @@
1
1
  import { SceneGraph } from "../graph.js";
2
2
  import { SceneNode } from "../types.js";
3
- //#region src/transfer/dependencies.d.ts
4
3
  /** What layers need from their document to draw the same in another one. */
5
- interface LayerDependencies {
4
+ export interface LayerDependencies {
6
5
  /** The variables the layers and their styles bind, and every variable those alias. */
7
6
  variables: Set<string>;
8
7
  /**
@@ -19,23 +18,21 @@ interface LayerDependencies {
19
18
  * The variables a layer names: its own bindings, its characters', its overrides', and those its
20
19
  * behaviour's transition, slide transition and animation follow.
21
20
  */
22
- declare function layerVariableIds(node: SceneNode): string[];
21
+ export declare function layerVariableIds(node: SceneNode): string[];
23
22
  /**
24
23
  * The images a layer paints with: its fills, strokes, vector regions, text decorations, and
25
- * characters.
24
+ * characters, and the frames its Shader effects draw.
26
25
  */
27
- declare function layerImageHashes(node: SceneNode): string[];
26
+ export declare function layerImageHashes(node: SceneNode): string[];
28
27
  /**
29
28
  * The variables, collections, styles, and images `layers` depend on, as a copy into another
30
29
  * document must carry them: a style brings what it binds and paints with in turn, and a variable
31
30
  * brings the variables it aliases.
32
31
  */
33
- declare function layerDependencies(graph: SceneGraph, layers: Iterable<SceneNode>): LayerDependencies;
32
+ export declare function layerDependencies(graph: SceneGraph, layers: Iterable<SceneNode>): LayerDependencies;
34
33
  /**
35
34
  * These variables and every variable they alias, at any depth, with their collections and the
36
35
  * collections a kept expression names a mode of.
37
36
  */
38
- declare function variableDependencies(graph: SceneGraph, ids: Iterable<string>): Pick<LayerDependencies, 'variables' | 'collections'>;
39
- //#endregion
40
- export { LayerDependencies, layerDependencies, layerImageHashes, layerVariableIds, variableDependencies };
37
+ export declare function variableDependencies(graph: SceneGraph, ids: Iterable<string>): Pick<LayerDependencies, 'variables' | 'collections'>;
41
38
  //# sourceMappingURL=dependencies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.d.ts","names":[],"sources":["../../src/transfer/dependencies.ts"],"mappings":";;;;UAeiB;;EAEf,WAAW;;;;;EAKX,aAAa;;EAEb,QAAQ;;EAER,QAAQ;;;;;;iBAOM,iBAAiB,MAAM;;;;;iBAmBvB,iBAAiB,MAAM;;;;;;iBAkBvB,kBACd,OAAO,YACP,QAAQ,SAAS,aAChB;;;;;iBA8Ba,qBACd,OAAO,YACP,KAAK,mBACJ,KAAK"}
1
+ {"version":3,"file":"dependencies.d.ts","names":[],"sources":["../../src/transfer/dependencies.ts"],"mappings":";;;iBAiBiB;;EAEf,WAAW;;;;;EAKX,aAAa;;EAEb,QAAQ;;EAER,QAAQ;;;;;;wBAOM,iBAAiB,MAAM;;;;;wBAoBvB,iBAAiB,MAAM;;;;;;wBAqBvB,kBACd,OAAO,YACP,QAAQ,SAAS,aAChB;;;;;wBA8Ba,qBACd,OAAO,YACP,KAAK,mBACJ,KAAK"}
@@ -1,14 +1,16 @@
1
- import { overriddenBindingField } from "../instances/overrides.js";
2
- import { isUnsupportedVariableValue, variableValueReferences } from "../variables/value.js";
3
- import { styleRunReferences } from "../text/references.js";
4
- import { referencedStyleIds, sharedStyleLayers } from "../shared-styles.js";
5
- import { regionFills } from "../vector-network.js";
1
+ import { appendAll } from "@open-pencil/std/arrays";
6
2
  import { readBehaviour } from "../behaviours/model.js";
7
3
  import { transitionVariableIds } from "../behaviours/transition.js";
8
4
  import { imagePaintHashes } from "../images.js";
5
+ import { overriddenBindingField } from "../instances/overrides.js";
6
+ import { keyframeVariableIds } from "../motion/variables.js";
7
+ import { shaderEffectImages } from "../shaders/model.js";
8
+ import { referencedStyleIds, sharedStyleLayers } from "../shared-styles.js";
9
9
  import { slideVariableIds } from "../slides/motion.js";
10
- import { appendAll } from "@open-pencil/std/arrays";
11
- //#region src/transfer/dependencies.ts
10
+ import { styleRunReferences } from "../text/references.js";
11
+ import { isUnsupportedVariableValue, variableValueReferences } from "../variables/value.js";
12
+ import { regionFills } from "../vector-network.js";
13
+ // src/transfer/dependencies.ts
12
14
  /**
13
15
  * The variables a layer names: its own bindings, its characters', its overrides', and those its
14
16
  * behaviour's transition, slide transition and animation follow.
@@ -21,22 +23,23 @@ function layerVariableIds(node) {
21
23
  ...Object.values(node.boundVariables),
22
24
  ...behaviour ? transitionVariableIds(behaviour) : [],
23
25
  ...slideVariableIds(node),
26
+ ...keyframeVariableIds(node),
24
27
  ...styleRunReferences(node.styleRuns).variables,
25
28
  ...overridden.flatMap(([field, value]) => typeof value === "string" && overriddenBindingField(field) !== null ? [value] : [])
26
29
  ];
27
30
  }
28
31
  /**
29
32
  * The images a layer paints with: its fills, strokes, vector regions, text decorations, and
30
- * characters.
33
+ * characters, and the frames its Shader effects draw.
31
34
  */
32
35
  function layerImageHashes(node) {
33
- return imagePaintHashes([
36
+ return [...imagePaintHashes([
34
37
  ...node.fills,
35
38
  ...node.strokes,
36
39
  ...regionFills(node.vectorNetwork),
37
40
  ...node.textDecorationFills,
38
41
  ...node.styleRuns.flatMap((run) => [...run.style.fills ?? [], ...run.style.textDecorationFills ?? []])
39
- ]);
42
+ ]), ...shaderEffectImages(node.effects)];
40
43
  }
41
44
  /**
42
45
  * The variables, collections, styles, and images `layers` depend on, as a copy into another
@@ -104,7 +107,6 @@ function variableDependencies(graph, ids) {
104
107
  collections
105
108
  };
106
109
  }
107
- //#endregion
108
110
  export { layerDependencies, layerImageHashes, layerVariableIds, variableDependencies };
109
111
 
110
112
  //# sourceMappingURL=dependencies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.js","names":[],"sources":["../../src/transfer/dependencies.ts"],"sourcesContent":["import { appendAll } from '@open-pencil/std/arrays'\n\nimport { readBehaviour } from '../behaviours/model'\nimport { transitionVariableIds } from '../behaviours/transition'\nimport type { SceneGraph } from '../graph'\nimport { imagePaintHashes } from '../images'\nimport { overriddenBindingField } from '../instances/overrides'\nimport { referencedStyleIds, sharedStyleLayers } from '../shared-styles'\nimport { slideVariableIds } from '../slides/motion'\nimport { styleRunReferences } from '../text/references'\nimport type { SceneNode } from '../types'\nimport { isUnsupportedVariableValue, variableValueReferences } from '../variables/value'\nimport { regionFills } from '../vector-network'\n\n/** What layers need from their document to draw the same in another one. */\nexport interface LayerDependencies {\n /** The variables the layers and their styles bind, and every variable those alias. */\n variables: Set<string>\n /**\n * The collections of those variables, those the layers set a mode of, and those a kept\n * expression names a mode of.\n */\n collections: Set<string>\n /** The shared styles the layers use, as the style layers that define them. */\n styles: SceneNode[]\n /** The images the layers and their styles paint with. */\n images: Set<string>\n}\n\n/**\n * The variables a layer names: its own bindings, its characters', its overrides', and those its\n * behaviour's transition, slide transition and animation follow.\n */\nexport function layerVariableIds(node: SceneNode): string[] {\n const { self, descendants } = node.instanceOverrides\n const overridden = [...self, ...[...descendants.values()].flatMap((fields) => [...fields])]\n const behaviour = readBehaviour(node)\n return [\n ...Object.values(node.boundVariables),\n ...(behaviour ? transitionVariableIds(behaviour) : []),\n ...slideVariableIds(node),\n ...styleRunReferences(node.styleRuns).variables,\n ...overridden.flatMap(([field, value]) =>\n typeof value === 'string' && overriddenBindingField(field) !== null ? [value] : []\n )\n ]\n}\n\n/**\n * The images a layer paints with: its fills, strokes, vector regions, text decorations, and\n * characters.\n */\nexport function layerImageHashes(node: SceneNode): string[] {\n return imagePaintHashes([\n ...node.fills,\n ...node.strokes,\n ...regionFills(node.vectorNetwork),\n ...node.textDecorationFills,\n ...node.styleRuns.flatMap((run) => [\n ...(run.style.fills ?? []),\n ...(run.style.textDecorationFills ?? [])\n ])\n ])\n}\n\n/**\n * The variables, collections, styles, and images `layers` depend on, as a copy into another\n * document must carry them: a style brings what it binds and paints with in turn, and a variable\n * brings the variables it aliases.\n */\nexport function layerDependencies(\n graph: SceneGraph,\n layers: Iterable<SceneNode>\n): LayerDependencies {\n const collections = new Set<string>()\n const images = new Set<string>()\n const styles = new Map<string, SceneNode>()\n const pending: string[] = []\n let styleLayers: Map<string, SceneNode> | undefined\n const styleLayer = (id: string): SceneNode | undefined =>\n (styleLayers ??= sharedStyleLayers(graph)).get(id)\n const visit = (node: SceneNode): void => {\n for (const hash of layerImageHashes(node)) images.add(hash)\n appendAll(pending, layerVariableIds(node))\n for (const id of Object.keys(node.variableModes))\n if (graph.variableCollections.has(id)) collections.add(id)\n for (const id of referencedStyleIds(node)) {\n const style = styles.has(id) ? undefined : styleLayer(id)\n if (!style) continue\n styles.set(id, style)\n visit(style)\n }\n }\n for (const node of layers) visit(node)\n const resolved = variableDependencies(graph, pending)\n for (const id of resolved.collections) collections.add(id)\n return { variables: resolved.variables, collections, styles: [...styles.values()], images }\n}\n\n/**\n * These variables and every variable they alias, at any depth, with their collections and the\n * collections a kept expression names a mode of.\n */\nexport function variableDependencies(\n graph: SceneGraph,\n ids: Iterable<string>\n): Pick<LayerDependencies, 'variables' | 'collections'> {\n const pending = [...ids]\n const variables = new Set<string>()\n const collections = new Set<string>()\n let modeCollections: Map<string, string> | undefined\n const collectionOfMode = (modeId: string): string | undefined => {\n modeCollections ??= new Map(\n [...graph.variableCollections.values()].flatMap((collection) =>\n collection.modes.map((mode) => [mode.modeId, collection.id] as const)\n )\n )\n return modeCollections.get(modeId)\n }\n for (let id = pending.pop(); id !== undefined; id = pending.pop()) {\n if (variables.has(id)) continue\n const variable = graph.variables.get(id)\n if (!variable) continue\n variables.add(id)\n collections.add(variable.collectionId)\n for (const value of Object.values(variable.valuesByMode)) {\n appendAll(pending, variableValueReferences(value))\n // A kept expression can name a mode of a collection none of its aliases reach.\n if (!isUnsupportedVariableValue(value)) continue\n for (const modeId of value.modes) {\n const collection = collectionOfMode(modeId)\n if (collection) collections.add(collection)\n }\n }\n }\n return { variables, collections }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAAgB,iBAAiB,MAA2B;CAC1D,MAAM,EAAE,MAAM,gBAAgB,KAAK;CACnC,MAAM,aAAa,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,YAAY,OAAO,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC;CAC1F,MAAM,YAAY,cAAc,IAAI;CACpC,OAAO;EACL,GAAG,OAAO,OAAO,KAAK,cAAc;EACpC,GAAI,YAAY,sBAAsB,SAAS,IAAI,CAAC;EACpD,GAAG,iBAAiB,IAAI;EACxB,GAAG,mBAAmB,KAAK,SAAS,CAAC,CAAC;EACtC,GAAG,WAAW,SAAS,CAAC,OAAO,WAC7B,OAAO,UAAU,YAAY,uBAAuB,KAAK,MAAM,OAAO,CAAC,KAAK,IAAI,CAAC,CACnF;CACF;AACF;;;;;AAMA,SAAgB,iBAAiB,MAA2B;CAC1D,OAAO,iBAAiB;EACtB,GAAG,KAAK;EACR,GAAG,KAAK;EACR,GAAG,YAAY,KAAK,aAAa;EACjC,GAAG,KAAK;EACR,GA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,IAAI,IACtB,CAAC,GAAG,MAAM,oBAAoB,OAAO,CAAC,CAAC,CAAC,SAAS,eAC/C,WAAW,MAAM,KAAK,SAAS,CAAC,KAAK,QAAQ,WAAW,EAAE,CAAU,CACtE,CACF;EACA,OAAO,gBAAgB,IAAI,MAAM;CACnC;CACA,KAAK,IAAI,KAAK,QAAQ,IAAI,GAAG,OAAO,KAAA,GAAW,KAAK,QAAQ,IAAI,GAAG;EACjE,IAAI,UAAU,IAAI,EAAE,GAAG;EACvB,MAAM,WAAW,MAAM,UAAU,IAAI,EAAE;EACvC,IAAI,CAAC,UAAU;EACf,UAAU,IAAI,EAAE;EAChB,YAAY,IAAI,SAAS,YAAY;EACrC,KAAK,MAAM,SAAS,OAAO,OAAO,SAAS,YAAY,GAAG;GACxD,UAAU,SAAS,wBAAwB,KAAK,CAAC;GAEjD,IAAI,CAAC,2BAA2B,KAAK,GAAG;GACxC,KAAK,MAAM,UAAU,MAAM,OAAO;IAChC,MAAM,aAAa,iBAAiB,MAAM;IAC1C,IAAI,YAAY,YAAY,IAAI,UAAU;GAC5C;EACF;CACF;CACA,OAAO;EAAE;EAAW;CAAY;AAClC"}
1
+ {"version":3,"file":"dependencies.js","names":[],"sources":["../../src/transfer/dependencies.ts"],"sourcesContent":["import { appendAll } from '@open-pencil/std/arrays'\n\nimport { readBehaviour } from '../behaviours/model'\nimport { transitionVariableIds } from '../behaviours/transition'\nimport type { SceneGraph } from '../graph'\nimport { imagePaintHashes } from '../images'\nimport { overriddenBindingField } from '../instances/overrides'\nimport { keyframeVariableIds } from '../motion/variables'\nimport { shaderEffectImages } from '../shaders/model'\nimport { referencedStyleIds, sharedStyleLayers } from '../shared-styles'\nimport { slideVariableIds } from '../slides/motion'\nimport { styleRunReferences } from '../text/references'\nimport type { SceneNode } from '../types'\nimport { isUnsupportedVariableValue, variableValueReferences } from '../variables/value'\nimport { regionFills } from '../vector-network'\n\n/** What layers need from their document to draw the same in another one. */\nexport interface LayerDependencies {\n /** The variables the layers and their styles bind, and every variable those alias. */\n variables: Set<string>\n /**\n * The collections of those variables, those the layers set a mode of, and those a kept\n * expression names a mode of.\n */\n collections: Set<string>\n /** The shared styles the layers use, as the style layers that define them. */\n styles: SceneNode[]\n /** The images the layers and their styles paint with. */\n images: Set<string>\n}\n\n/**\n * The variables a layer names: its own bindings, its characters', its overrides', and those its\n * behaviour's transition, slide transition and animation follow.\n */\nexport function layerVariableIds(node: SceneNode): string[] {\n const { self, descendants } = node.instanceOverrides\n const overridden = [...self, ...[...descendants.values()].flatMap((fields) => [...fields])]\n const behaviour = readBehaviour(node)\n return [\n ...Object.values(node.boundVariables),\n ...(behaviour ? transitionVariableIds(behaviour) : []),\n ...slideVariableIds(node),\n ...keyframeVariableIds(node),\n ...styleRunReferences(node.styleRuns).variables,\n ...overridden.flatMap(([field, value]) =>\n typeof value === 'string' && overriddenBindingField(field) !== null ? [value] : []\n )\n ]\n}\n\n/**\n * The images a layer paints with: its fills, strokes, vector regions, text decorations, and\n * characters, and the frames its Shader effects draw.\n */\nexport function layerImageHashes(node: SceneNode): string[] {\n return [\n ...imagePaintHashes([\n ...node.fills,\n ...node.strokes,\n ...regionFills(node.vectorNetwork),\n ...node.textDecorationFills,\n ...node.styleRuns.flatMap((run) => [\n ...(run.style.fills ?? []),\n ...(run.style.textDecorationFills ?? [])\n ])\n ]),\n ...shaderEffectImages(node.effects)\n ]\n}\n\n/**\n * The variables, collections, styles, and images `layers` depend on, as a copy into another\n * document must carry them: a style brings what it binds and paints with in turn, and a variable\n * brings the variables it aliases.\n */\nexport function layerDependencies(\n graph: SceneGraph,\n layers: Iterable<SceneNode>\n): LayerDependencies {\n const collections = new Set<string>()\n const images = new Set<string>()\n const styles = new Map<string, SceneNode>()\n const pending: string[] = []\n let styleLayers: Map<string, SceneNode> | undefined\n const styleLayer = (id: string): SceneNode | undefined =>\n (styleLayers ??= sharedStyleLayers(graph)).get(id)\n const visit = (node: SceneNode): void => {\n for (const hash of layerImageHashes(node)) images.add(hash)\n appendAll(pending, layerVariableIds(node))\n for (const id of Object.keys(node.variableModes))\n if (graph.variableCollections.has(id)) collections.add(id)\n for (const id of referencedStyleIds(node)) {\n const style = styles.has(id) ? undefined : styleLayer(id)\n if (!style) continue\n styles.set(id, style)\n visit(style)\n }\n }\n for (const node of layers) visit(node)\n const resolved = variableDependencies(graph, pending)\n for (const id of resolved.collections) collections.add(id)\n return { variables: resolved.variables, collections, styles: [...styles.values()], images }\n}\n\n/**\n * These variables and every variable they alias, at any depth, with their collections and the\n * collections a kept expression names a mode of.\n */\nexport function variableDependencies(\n graph: SceneGraph,\n ids: Iterable<string>\n): Pick<LayerDependencies, 'variables' | 'collections'> {\n const pending = [...ids]\n const variables = new Set<string>()\n const collections = new Set<string>()\n let modeCollections: Map<string, string> | undefined\n const collectionOfMode = (modeId: string): string | undefined => {\n modeCollections ??= new Map(\n [...graph.variableCollections.values()].flatMap((collection) =>\n collection.modes.map((mode) => [mode.modeId, collection.id] as const)\n )\n )\n return modeCollections.get(modeId)\n }\n for (let id = pending.pop(); id !== undefined; id = pending.pop()) {\n if (variables.has(id)) continue\n const variable = graph.variables.get(id)\n if (!variable) continue\n variables.add(id)\n collections.add(variable.collectionId)\n for (const value of Object.values(variable.valuesByMode)) {\n appendAll(pending, variableValueReferences(value))\n // A kept expression can name a mode of a collection none of its aliases reach.\n if (!isUnsupportedVariableValue(value)) continue\n for (const modeId of value.modes) {\n const collection = collectionOfMode(modeId)\n if (collection) collections.add(collection)\n }\n }\n }\n return { variables, collections }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmCA,SAAgB,iBAAiB,MAA2B;CAC1D,MAAM,EAAE,MAAM,gBAAgB,KAAK;CACnC,MAAM,aAAa,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,YAAY,OAAO,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,GAAG,MAAM,CAAC,CAAC;CAC1F,MAAM,YAAY,cAAc,IAAI;CACpC,OAAO;EACL,GAAG,OAAO,OAAO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from "../graph.js";
2
2
  import { GraphTransferPlan } from "./apply.js";
3
- //#region src/transfer/history.d.ts
4
3
  /** Capture post-placement state for redo; this does not authorize deleting shared resources. */
5
- declare function captureTransferredState(graph: SceneGraph, original: GraphTransferPlan): GraphTransferPlan;
6
- //#endregion
7
- export { captureTransferredState };
4
+ export declare function captureTransferredState(graph: SceneGraph, original: GraphTransferPlan): GraphTransferPlan;
8
5
  //# sourceMappingURL=history.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","names":[],"sources":["../../src/transfer/history.ts"],"mappings":";;;;iBAKgB,wBACd,OAAO,YACP,UAAU,oBACT"}
1
+ {"version":3,"file":"history.d.ts","names":[],"sources":["../../src/transfer/history.ts"],"mappings":";;;wBAKgB,wBACd,OAAO,YACP,UAAU,oBACT"}
@@ -1,5 +1,5 @@
1
1
  import { cloneNodeProps } from "../copy.js";
2
- //#region src/transfer/history.ts
2
+ // src/transfer/history.ts
3
3
  /** Capture post-placement state for redo; this does not authorize deleting shared resources. */
4
4
  function captureTransferredState(graph, original) {
5
5
  const requireValue = (value, kind, id) => {
@@ -27,7 +27,6 @@ function captureTransferredState(graph, original) {
27
27
  images: new Map([...original.images.keys()].map((hash) => [hash, requireValue(graph.images.get(hash), "image", hash).slice()]))
28
28
  };
29
29
  }
30
- //#endregion
31
30
  export { captureTransferredState };
32
31
 
33
32
  //# sourceMappingURL=history.js.map
@@ -1,4 +1,4 @@
1
- //#region src/transfer/identity.ts
1
+ // src/transfer/identity.ts
2
2
  function variableIdentityReferences(variables, collections, heldVariableIds = []) {
3
3
  return {
4
4
  variables: new Map([...variables.map((variable) => variable.id), ...heldVariableIds].map((id) => [id, id])),
@@ -21,7 +21,6 @@ function heldTransferCollections(target, plan) {
21
21
  };
22
22
  });
23
23
  }
24
- //#endregion
25
24
  export { heldTransferCollections, variableIdentityReferences };
26
25
 
27
26
  //# sourceMappingURL=identity.js.map
@@ -1,9 +1,9 @@
1
- import { GraphTransferInput, prepareGraphTransfer } from "./plan.js";
2
- import { GraphTransferPlan, applyGraphTransfer } from "./apply.js";
3
1
  import { removeGraphTransfer } from "./remove.js";
4
2
  import { captureTransferredState } from "./history.js";
5
- import { VariableTransferReferences, copyVariableTables, prepareVariableTransfer } from "./variables.js";
3
+ import { GraphTransferPlan, applyGraphTransfer } from "./apply.js";
4
+ import { GraphTransferInput, prepareGraphTransfer } from "./plan.js";
6
5
  import { NodeTransferReferences, prepareNodeTransfer } from "./nodes.js";
6
+ import { VariableTransferReferences, copyVariableTables, prepareVariableTransfer } from "./variables.js";
7
7
  import { CopiedReferenceOptions, ReferenceResolvers, instanceSwapPropertyIds, remapCopiedReferences, resolvedReferences } from "./copied.js";
8
8
  import { LayerDependencies, layerDependencies, layerImageHashes, layerVariableIds, variableDependencies } from "./dependencies.js";
9
9
  import { ResourceReferences, remappedResourceReferences } from "./resources.js";
@@ -1,11 +1,11 @@
1
- import { instanceSwapPropertyIds, remapCopiedReferences, resolvedReferences } from "./copied.js";
2
- import { remappedResourceReferences } from "./resources.js";
3
- import { prepareNodeTransfer } from "./nodes.js";
4
- import { copyVariableTables, prepareVariableTransfer } from "./variables.js";
5
- import { applyGraphTransfer } from "./apply.js";
6
1
  import { removeGraphTransfer } from "./remove.js";
7
2
  import { captureTransferredState } from "./history.js";
8
- import { libraryModeOf, matchLibraryResources, withoutLibraryKey } from "./library.js";
3
+ import { applyGraphTransfer } from "./apply.js";
9
4
  import { prepareGraphTransfer } from "./plan.js";
5
+ import { prepareNodeTransfer } from "./nodes.js";
6
+ import { copyVariableTables, prepareVariableTransfer } from "./variables.js";
7
+ import { instanceSwapPropertyIds, remapCopiedReferences, resolvedReferences } from "./copied.js";
10
8
  import { layerDependencies, layerImageHashes, layerVariableIds, variableDependencies } from "./dependencies.js";
9
+ import { remappedResourceReferences } from "./resources.js";
10
+ import { libraryModeOf, matchLibraryResources, withoutLibraryKey } from "./library.js";
11
11
  export { applyGraphTransfer, captureTransferredState, copyVariableTables, instanceSwapPropertyIds, layerDependencies, layerImageHashes, layerVariableIds, libraryModeOf, matchLibraryResources, prepareGraphTransfer, prepareNodeTransfer, prepareVariableTransfer, remapCopiedReferences, remappedResourceReferences, removeGraphTransfer, resolvedReferences, variableDependencies, withoutLibraryKey };
@@ -1,21 +1,20 @@
1
1
  import { SceneGraph } from "../graph.js";
2
2
  import { SceneNode, Variable, VariableCollection, VariableCollectionMode } from "../types.js";
3
- //#region src/transfer/library.d.ts
4
3
  /** A library asset's identity: its key and the version references by key carry with it. */
5
4
  interface LibraryIdentity {
6
5
  key?: string;
7
6
  version?: string;
8
7
  }
9
8
  /** A copy without the library key and version it came with: the document's own. */
10
- declare function withoutLibraryKey<T extends LibraryIdentity>(item: T): T;
9
+ export declare function withoutLibraryKey<T extends LibraryIdentity>(item: T): T;
11
10
  /** The library mode a mode stands for: the one it came from, or else itself. */
12
- declare function libraryModeOf(mode: VariableCollectionMode): string;
11
+ export declare function libraryModeOf(mode: VariableCollectionMode): string;
13
12
  /**
14
13
  * How a transfer meets the copies the target already holds of the library resources it brings,
15
14
  * so that a document keeps one copy of each library asset, as Figma does: a pasted layer binds
16
15
  * to the copy the document has, which the reader would otherwise find twice under one key.
17
16
  */
18
- interface LibraryReuse {
17
+ export interface LibraryReuse {
19
18
  /** Source collections the target holds, by the target collection holding them. */
20
19
  collections: Map<string, string>;
21
20
  /** Modes of those collections, by the target mode each stands for. */
@@ -35,11 +34,10 @@ interface LibraryReuse {
35
34
  * `targetStyles` is the target's `sharedStyleLayers` when the caller has it already; the target
36
35
  * is searched for styles only when the transfer brings one.
37
36
  */
38
- declare function matchLibraryResources(target: SceneGraph, source: {
37
+ export declare function matchLibraryResources(target: SceneGraph, source: {
39
38
  collections: Iterable<VariableCollection>;
40
39
  variables: Iterable<Variable>;
41
40
  styles: Iterable<SceneNode>;
42
41
  }, targetStyles?: ReadonlyMap<string, SceneNode>): LibraryReuse;
43
- //#endregion
44
- export { LibraryReuse, libraryModeOf, matchLibraryResources, withoutLibraryKey };
42
+ export {};
45
43
  //# sourceMappingURL=library.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","names":[],"sources":["../../src/transfer/library.ts"],"mappings":";;;;UAKU;EACR;EACA;;;iBAQc,kBAAkB,UAAU,iBAAiB,MAAM,IAAI;;iBAiBvD,cAAc,MAAM;;;;;;UAqCnB;;EAEf,aAAa;;EAEb,OAAO;;EAEP,WAAW;;EAEX,QAAQ;;;;;EAKR,OAAO;;;;;;;iBAQO,sBACd,QAAQ,YACR;EACE,aAAa,SAAS;EACtB,WAAW,SAAS;EACpB,QAAQ,SAAS;GAEnB,eAAe,oBAAoB,aAClC"}
1
+ {"version":3,"file":"library.d.ts","names":[],"sources":["../../src/transfer/library.ts"],"mappings":";;;UAKU;EACR;EACA;;;wBAac,kBAAkB,UAAU,iBAAiB,MAAM,IAAI;;wBA6CvD,cAAc,MAAM;;;;;;iBAqCnB;;EAEf,aAAa;;EAEb,OAAO;;EAEP,WAAW;;EAEX,QAAQ;;;;;EAKR,OAAO;;;;;;;wBAQO,sBACd,QAAQ,YACR;EACE,aAAa,SAAS;EACtB,WAAW,SAAS;EACpB,QAAQ,SAAS;GAEnB,eAAe,oBAAoB,aAClC"}
@@ -1,8 +1,12 @@
1
1
  import { sharedStyleLayers } from "../shared-styles.js";
2
- //#region src/transfer/library.ts
2
+ // src/transfer/library.ts
3
3
  function sameAsset(a, b) {
4
4
  return !!a.key && a.key === b.key && a.version === b.version;
5
5
  }
6
+ /** One string per library asset, to index copies by; none for an asset without a key. */
7
+ function assetId({ key, version }) {
8
+ return key ? `${key}\u0000${version ?? ""}` : void 0;
9
+ }
6
10
  /** A copy without the library key and version it came with: the document's own. */
7
11
  function withoutLibraryKey(item) {
8
12
  const copy = { ...item };
@@ -18,6 +22,30 @@ function styleLibraryIdentity(style) {
18
22
  version: typeof version === "string" ? version : void 0
19
23
  };
20
24
  }
25
+ function matchLibraryStyles(target, sourceStyles, targetStyles) {
26
+ const incoming = [...sourceStyles].flatMap((style) => {
27
+ const key = assetId(styleLibraryIdentity(style));
28
+ return key && style.source.id ? [{
29
+ key,
30
+ id: style.source.id
31
+ }] : [];
32
+ });
33
+ const styles = /* @__PURE__ */ new Map();
34
+ if (incoming.length === 0) return styles;
35
+ const unmatched = new Set(incoming.map((style) => style.key));
36
+ const copies = /* @__PURE__ */ new Map();
37
+ for (const style of (targetStyles ?? sharedStyleLayers(target)).values()) {
38
+ const key = assetId(styleLibraryIdentity(style));
39
+ if (!key || !unmatched.delete(key)) continue;
40
+ if (style.source.id) copies.set(key, style.source.id);
41
+ if (unmatched.size === 0) break;
42
+ }
43
+ for (const { key, id } of incoming) {
44
+ const copyId = copies.get(key);
45
+ if (copyId) styles.set(id, copyId);
46
+ }
47
+ return styles;
48
+ }
21
49
  /** The library mode a mode stands for: the one it came from, or else itself. */
22
50
  function libraryModeOf(mode) {
23
51
  return mode.libraryModeId ?? mode.modeId;
@@ -56,8 +84,8 @@ function matchLibraryResources(target, source, targetStyles) {
56
84
  };
57
85
  const claimed = /* @__PURE__ */ new Set();
58
86
  const firstCopy = (item) => {
59
- if (!item.key) return true;
60
- const identity = `${item.key}\u0000${item.version ?? ""}`;
87
+ const identity = assetId(item);
88
+ if (!identity) return true;
61
89
  if (claimed.has(identity)) {
62
90
  reuse.local.add(item.id);
63
91
  return false;
@@ -86,17 +114,9 @@ function matchLibraryResources(target, source, targetStyles) {
86
114
  if (reuse.collections.get(variable.collectionId) === copy.collectionId && !copy.deleted) reuse.variables.set(variable.id, copy.id);
87
115
  else reuse.local.add(variable.id);
88
116
  }
89
- const incoming = [...source.styles];
90
- if (incoming.length === 0) return reuse;
91
- const styles = [...(targetStyles ?? sharedStyleLayers(target)).values()].filter((style) => styleLibraryIdentity(style).key);
92
- for (const style of incoming) {
93
- const identity = styleLibraryIdentity(style);
94
- const copy = styles.find((candidate) => sameAsset(styleLibraryIdentity(candidate), identity));
95
- if (style.source.id && copy?.source.id) reuse.styles.set(style.source.id, copy.source.id);
96
- }
117
+ reuse.styles = matchLibraryStyles(target, source.styles, targetStyles);
97
118
  return reuse;
98
119
  }
99
- //#endregion
100
120
  export { libraryModeOf, matchLibraryResources, withoutLibraryKey };
101
121
 
102
122
  //# sourceMappingURL=library.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"library.js","names":[],"sources":["../../src/transfer/library.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { sharedStyleLayers } from '../shared-styles'\nimport type { SceneNode, Variable, VariableCollection, VariableCollectionMode } from '../types'\n\n/** A library asset's identity: its key and the version references by key carry with it. */\ninterface LibraryIdentity {\n key?: string\n version?: string\n}\n\nfunction sameAsset(a: LibraryIdentity, b: LibraryIdentity): boolean {\n return !!a.key && a.key === b.key && a.version === b.version\n}\n\n/** A copy without the library key and version it came with: the document's own. */\nexport function withoutLibraryKey<T extends LibraryIdentity>(item: T): T {\n const copy = { ...item }\n delete copy.key\n delete copy.version\n return copy\n}\n\n/** The library key and version a style taken from a library keeps from its file. */\nfunction styleLibraryIdentity(style: SceneNode): LibraryIdentity {\n const { key, version } = style.source.fig.rawNodeFields\n return {\n key: typeof key === 'string' ? key : undefined,\n version: typeof version === 'string' ? version : undefined\n }\n}\n\n/** The library mode a mode stands for: the one it came from, or else itself. */\nexport function libraryModeOf(mode: VariableCollectionMode): string {\n return mode.libraryModeId ?? mode.modeId\n}\n\n/**\n * Which of `copy`'s modes each of `collection`'s stands for, or undefined when one has none. A mode\n * takes the copy's mode that came from the same library mode; where there is none, as in a copy\n * made before modes kept that link, an unpaired mode with its name, as `pairModes` in Core's\n * library import pairs them.\n */\nfunction pairedModes(\n collection: VariableCollection,\n copy: VariableCollection\n): Map<string, string> | undefined {\n const unpaired = new Map(copy.modes.map((mode) => [mode.modeId, mode]))\n const paired = new Map<string, string>()\n const pair = (\n mode: VariableCollectionMode,\n match: (candidate: VariableCollectionMode) => boolean\n ) => {\n const found = [...unpaired.values()].find(match)\n if (!found) return\n unpaired.delete(found.modeId)\n paired.set(mode.modeId, found.modeId)\n }\n for (const mode of collection.modes)\n pair(mode, (candidate) => candidate.libraryModeId === libraryModeOf(mode))\n for (const mode of collection.modes)\n if (!paired.has(mode.modeId)) pair(mode, (candidate) => candidate.name === mode.name)\n return paired.size === collection.modes.length ? paired : undefined\n}\n\n/**\n * How a transfer meets the copies the target already holds of the library resources it brings,\n * so that a document keeps one copy of each library asset, as Figma does: a pasted layer binds\n * to the copy the document has, which the reader would otherwise find twice under one key.\n */\nexport interface LibraryReuse {\n /** Source collections the target holds, by the target collection holding them. */\n collections: Map<string, string>\n /** Modes of those collections, by the target mode each stands for. */\n modes: Map<string, string>\n /** Source variables the target holds, by the target variable. */\n variables: Map<string, string>\n /** Source styles the target holds, by the style ID layers name the target's copy with. */\n styles: Map<string, string>\n /**\n * Library resources the target holds a copy of that cannot take this one's place, such as a\n * collection whose modes do not pair: the transfer makes them its own, without their key.\n */\n local: Set<string>\n}\n\n/**\n * Matches the library resources a transfer brings against the copies the target holds.\n * `targetStyles` is the target's `sharedStyleLayers` when the caller has it already; the target\n * is searched for styles only when the transfer brings one.\n */\nexport function matchLibraryResources(\n target: SceneGraph,\n source: {\n collections: Iterable<VariableCollection>\n variables: Iterable<Variable>\n styles: Iterable<SceneNode>\n },\n targetStyles?: ReadonlyMap<string, SceneNode>\n): LibraryReuse {\n const reuse: LibraryReuse = {\n collections: new Map(),\n modes: new Map(),\n variables: new Map(),\n styles: new Map(),\n local: new Set()\n }\n // A transfer can bring one library asset twice, as a file 0.17 saved can hold it: the first\n // copy is the library's, and the others become the document's own.\n const claimed = new Set<string>()\n const firstCopy = (item: LibraryIdentity & { id: string }): boolean => {\n if (!item.key) return true\n const identity = `${item.key}\\u0000${item.version ?? ''}`\n if (claimed.has(identity)) {\n reuse.local.add(item.id)\n return false\n }\n claimed.add(identity)\n return true\n }\n const collections = [...target.variableCollections.values()]\n for (const collection of source.collections) {\n if (!firstCopy(collection)) continue\n const copy = collections.find((candidate) => sameAsset(candidate, collection))\n if (!copy) continue\n const modes = copy.deleted ? undefined : pairedModes(collection, copy)\n if (!modes) {\n reuse.local.add(collection.id)\n continue\n }\n reuse.collections.set(collection.id, copy.id)\n for (const [mode, targetMode] of modes) reuse.modes.set(mode, targetMode)\n }\n const variables = [...target.variables.values()]\n for (const variable of source.variables) {\n if (!firstCopy(variable)) continue\n const copy = variables.find((candidate) => sameAsset(candidate, variable))\n if (!copy) continue\n if (reuse.collections.get(variable.collectionId) === copy.collectionId && !copy.deleted)\n reuse.variables.set(variable.id, copy.id)\n else reuse.local.add(variable.id)\n }\n const incoming = [...source.styles]\n if (incoming.length === 0) return reuse\n const styles = [...(targetStyles ?? sharedStyleLayers(target)).values()].filter(\n (style) => styleLibraryIdentity(style).key\n )\n for (const style of incoming) {\n const identity = styleLibraryIdentity(style)\n const copy = styles.find((candidate) => sameAsset(styleLibraryIdentity(candidate), identity))\n if (style.source.id && copy?.source.id) reuse.styles.set(style.source.id, copy.source.id)\n }\n return reuse\n}\n"],"mappings":";;AAUA,SAAS,UAAU,GAAoB,GAA6B;CAClE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE;AACvD;;AAGA,SAAgB,kBAA6C,MAAY;CACvE,MAAM,OAAO,EAAE,GAAG,KAAK;CACvB,OAAO,KAAK;CACZ,OAAO,KAAK;CACZ,OAAO;AACT;;AAGA,SAAS,qBAAqB,OAAmC;CAC/D,MAAM,EAAE,KAAK,YAAY,MAAM,OAAO,IAAI;CAC1C,OAAO;EACL,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAA;EACrC,SAAS,OAAO,YAAY,WAAW,UAAU,KAAA;CACnD;AACF;;AAGA,SAAgB,cAAc,MAAsC;CAClE,OAAO,KAAK,iBAAiB,KAAK;AACpC;;;;;;;AAQA,SAAS,YACP,YACA,MACiC;CACjC,MAAM,WAAW,IAAI,IAAI,KAAK,MAAM,KAAK,SAAS,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC;CACtE,MAAM,yBAAS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,YAAY,IAAI;EACrE,IAAI,CAAC,OAAO;GACV,MAAM,MAAM,IAAI,WAAW,EAAE;GAC7B;EACF;EACA,MAAM,YAAY,IAAI,WAAW,IAAI,KAAK,EAAE;EAC5C,KAAK,MAAM,CAAC,MAAM,eAAe,OAAO,MAAM,MAAM,IAAI,MAAM,UAAU;CAC1E;CACA,MAAM,YAAY,CAAC,GAAG,OAAO,UAAU,OAAO,CAAC;CAC/C,KAAK,MAAM,YAAY,OAAO,WAAW;EACvC,IAAI,CAAC,UAAU,QAAQ,GAAG;EAC1B,MAAM,OAAO,UAAU,MAAM,cAAc,UAAU,WAAW,QAAQ,CAAC;EACzE,IAAI,CAAC,MAAM;EACX,IAAI,MAAM,YAAY,IAAI,SAAS,YAAY,MAAM,KAAK,gBAAgB,CAAC,KAAK,SAC9E,MAAM,UAAU,IAAI,SAAS,IAAI,KAAK,EAAE;OACrC,MAAM,MAAM,IAAI,SAAS,EAAE;CAClC;CACA,MAAM,WAAW,CAAC,GAAG,OAAO,MAAM;CAClC,IAAI,SAAS,WAAW,GAAG,OAAO;CAClC,MAAM,SAAS,CAAC,IAAI,gBAAgB,kBAAkB,MAAM,EAAA,CAAG,OAAO,CAAC,CAAC,CAAC,QACtE,UAAU,qBAAqB,KAAK,CAAC,CAAC,GACzC;CACA,KAAK,MAAM,SAAS,UAAU;EAC5B,MAAM,WAAW,qBAAqB,KAAK;EAC3C,MAAM,OAAO,OAAO,MAAM,cAAc,UAAU,qBAAqB,SAAS,GAAG,QAAQ,CAAC;EAC5F,IAAI,MAAM,OAAO,MAAM,MAAM,OAAO,IAAI,MAAM,OAAO,IAAI,MAAM,OAAO,IAAI,KAAK,OAAO,EAAE;CAC1F;CACA,OAAO;AACT"}
1
+ {"version":3,"file":"library.js","names":[],"sources":["../../src/transfer/library.ts"],"sourcesContent":["import type { SceneGraph } from '../graph'\nimport { sharedStyleLayers } from '../shared-styles'\nimport type { SceneNode, Variable, VariableCollection, VariableCollectionMode } from '../types'\n\n/** A library asset's identity: its key and the version references by key carry with it. */\ninterface LibraryIdentity {\n key?: string\n version?: string\n}\n\nfunction sameAsset(a: LibraryIdentity, b: LibraryIdentity): boolean {\n return !!a.key && a.key === b.key && a.version === b.version\n}\n\n/** One string per library asset, to index copies by; none for an asset without a key. */\nfunction assetId({ key, version }: LibraryIdentity): string | undefined {\n return key ? `${key}\\u0000${version ?? ''}` : undefined\n}\n\n/** A copy without the library key and version it came with: the document's own. */\nexport function withoutLibraryKey<T extends LibraryIdentity>(item: T): T {\n const copy = { ...item }\n delete copy.key\n delete copy.version\n return copy\n}\n\n/** The library key and version a style taken from a library keeps from its file. */\nfunction styleLibraryIdentity(style: SceneNode): LibraryIdentity {\n const { key, version } = style.source.fig.rawNodeFields\n return {\n key: typeof key === 'string' ? key : undefined,\n version: typeof version === 'string' ? version : undefined\n }\n}\n\nfunction matchLibraryStyles(\n target: SceneGraph,\n sourceStyles: Iterable<SceneNode>,\n targetStyles?: ReadonlyMap<string, SceneNode>\n): Map<string, string> {\n const incoming = [...sourceStyles].flatMap((style) => {\n const key = assetId(styleLibraryIdentity(style))\n return key && style.source.id ? [{ key, id: style.source.id }] : []\n })\n const styles = new Map<string, string>()\n if (incoming.length === 0) return styles\n\n const unmatched = new Set(incoming.map((style) => style.key))\n const copies = new Map<string, string>()\n for (const style of (targetStyles ?? sharedStyleLayers(target)).values()) {\n const key = assetId(styleLibraryIdentity(style))\n if (!key || !unmatched.delete(key)) continue\n // Older documents can hold duplicates. Use the first matching copy, as before.\n if (style.source.id) copies.set(key, style.source.id)\n if (unmatched.size === 0) break\n }\n for (const { key, id } of incoming) {\n const copyId = copies.get(key)\n if (copyId) styles.set(id, copyId)\n }\n return styles\n}\n\n/** The library mode a mode stands for: the one it came from, or else itself. */\nexport function libraryModeOf(mode: VariableCollectionMode): string {\n return mode.libraryModeId ?? mode.modeId\n}\n\n/**\n * Which of `copy`'s modes each of `collection`'s stands for, or undefined when one has none. A mode\n * takes the copy's mode that came from the same library mode; where there is none, as in a copy\n * made before modes kept that link, an unpaired mode with its name, as `pairModes` in Core's\n * library import pairs them.\n */\nfunction pairedModes(\n collection: VariableCollection,\n copy: VariableCollection\n): Map<string, string> | undefined {\n const unpaired = new Map(copy.modes.map((mode) => [mode.modeId, mode]))\n const paired = new Map<string, string>()\n const pair = (\n mode: VariableCollectionMode,\n match: (candidate: VariableCollectionMode) => boolean\n ) => {\n const found = [...unpaired.values()].find(match)\n if (!found) return\n unpaired.delete(found.modeId)\n paired.set(mode.modeId, found.modeId)\n }\n for (const mode of collection.modes)\n pair(mode, (candidate) => candidate.libraryModeId === libraryModeOf(mode))\n for (const mode of collection.modes)\n if (!paired.has(mode.modeId)) pair(mode, (candidate) => candidate.name === mode.name)\n return paired.size === collection.modes.length ? paired : undefined\n}\n\n/**\n * How a transfer meets the copies the target already holds of the library resources it brings,\n * so that a document keeps one copy of each library asset, as Figma does: a pasted layer binds\n * to the copy the document has, which the reader would otherwise find twice under one key.\n */\nexport interface LibraryReuse {\n /** Source collections the target holds, by the target collection holding them. */\n collections: Map<string, string>\n /** Modes of those collections, by the target mode each stands for. */\n modes: Map<string, string>\n /** Source variables the target holds, by the target variable. */\n variables: Map<string, string>\n /** Source styles the target holds, by the style ID layers name the target's copy with. */\n styles: Map<string, string>\n /**\n * Library resources the target holds a copy of that cannot take this one's place, such as a\n * collection whose modes do not pair: the transfer makes them its own, without their key.\n */\n local: Set<string>\n}\n\n/**\n * Matches the library resources a transfer brings against the copies the target holds.\n * `targetStyles` is the target's `sharedStyleLayers` when the caller has it already; the target\n * is searched for styles only when the transfer brings one.\n */\nexport function matchLibraryResources(\n target: SceneGraph,\n source: {\n collections: Iterable<VariableCollection>\n variables: Iterable<Variable>\n styles: Iterable<SceneNode>\n },\n targetStyles?: ReadonlyMap<string, SceneNode>\n): LibraryReuse {\n const reuse: LibraryReuse = {\n collections: new Map(),\n modes: new Map(),\n variables: new Map(),\n styles: new Map(),\n local: new Set()\n }\n // A transfer can bring one library asset twice, as a file 0.17 saved can hold it: the first\n // copy is the library's, and the others become the document's own.\n const claimed = new Set<string>()\n const firstCopy = (item: LibraryIdentity & { id: string }): boolean => {\n const identity = assetId(item)\n if (!identity) return true\n if (claimed.has(identity)) {\n reuse.local.add(item.id)\n return false\n }\n claimed.add(identity)\n return true\n }\n const collections = [...target.variableCollections.values()]\n for (const collection of source.collections) {\n if (!firstCopy(collection)) continue\n const copy = collections.find((candidate) => sameAsset(candidate, collection))\n if (!copy) continue\n const modes = copy.deleted ? undefined : pairedModes(collection, copy)\n if (!modes) {\n reuse.local.add(collection.id)\n continue\n }\n reuse.collections.set(collection.id, copy.id)\n for (const [mode, targetMode] of modes) reuse.modes.set(mode, targetMode)\n }\n const variables = [...target.variables.values()]\n for (const variable of source.variables) {\n if (!firstCopy(variable)) continue\n const copy = variables.find((candidate) => sameAsset(candidate, variable))\n if (!copy) continue\n if (reuse.collections.get(variable.collectionId) === copy.collectionId && !copy.deleted)\n reuse.variables.set(variable.id, copy.id)\n else reuse.local.add(variable.id)\n }\n reuse.styles = matchLibraryStyles(target, source.styles, targetStyles)\n return reuse\n}\n"],"mappings":";;AAUA,SAAS,UAAU,GAAoB,GAA6B;CAClE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE;AACvD;;AAGA,SAAS,QAAQ,EAAE,KAAK,WAAgD;CACtE,OAAO,MAAM,GAAG,IAAI,QAAQ,WAAW,OAAO,KAAA;AAChD;;AAGA,SAAgB,kBAA6C,MAAY;CACvE,MAAM,OAAO,EAAE,GAAG,KAAK;CACvB,OAAO,KAAK;CACZ,OAAO,KAAK;CACZ,OAAO;AACT;;AAGA,SAAS,qBAAqB,OAAmC;CAC/D,MAAM,EAAE,KAAK,YAAY,MAAM,OAAO,IAAI;CAC1C,OAAO;EACL,KAAK,OAAO,QAAQ,WAAW,MAAM,KAAA;EACrC,SAAS,OAAO,YAAY,WAAW,UAAU,KAAA;CACnD;AACF;AAEA,SAAS,mBAC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CAAC,GAAG,OAAO,UAAU,OAAO,CAAC;CAC/C,KAAK,MAAM,YAAY,OAAO,WAAW;EACvC,IAAI,CAAC,UAAU,QAAQ,GAAG;EAC1B,MAAM,OAAO,UAAU,MAAM,cAAc,UAAU,WAAW,QAAQ,CAAC;EACzE,IAAI,CAAC,MAAM;EACX,IAAI,MAAM,YAAY,IAAI,SAAS,YAAY,MAAM,KAAK,gBAAgB,CAAC,KAAK,SAC9E,MAAM,UAAU,IAAI,SAAS,IAAI,KAAK,EAAE;OACrC,MAAM,MAAM,IAAI,SAAS,EAAE;CAClC;CACA,MAAM,SAAS,mBAAmB,QAAQ,OAAO,QAAQ,YAAY;CACrE,OAAO;AACT"}
@@ -1,14 +1,11 @@
1
1
  import { ComponentPropertyType, SceneNode } from "../types.js";
2
2
  import { VariableTransferReferences } from "./variables.js";
3
- //#region src/transfer/nodes.d.ts
4
- interface NodeTransferReferences extends VariableTransferReferences {
3
+ export interface NodeTransferReferences extends VariableTransferReferences {
5
4
  nodes: ReadonlyMap<string, string>;
6
5
  styles: ReadonlyMap<string, string>;
7
6
  properties: ReadonlyMap<string, string>;
8
7
  propertyTypes: ReadonlyMap<string, ComponentPropertyType>;
9
8
  }
10
9
  /** Prepare runtime references without rewriting original format identities or ordinary text. */
11
- declare function prepareNodeTransfer(source: SceneNode, refs: NodeTransferReferences): Partial<SceneNode>;
12
- //#endregion
13
- export { NodeTransferReferences, prepareNodeTransfer };
10
+ export declare function prepareNodeTransfer(source: SceneNode, refs: NodeTransferReferences): Partial<SceneNode>;
14
11
  //# sourceMappingURL=nodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","names":[],"sources":["../../src/transfer/nodes.ts"],"mappings":";;;UA6CiB,+BAA+B;EAC9C,OAAO;EACP,QAAQ;EACR,YAAY;EACZ,eAAe,oBAAoB;;;iBAIrB,oBACd,QAAQ,WACR,MAAM,yBACL,QAAQ"}
1
+ {"version":3,"file":"nodes.d.ts","names":[],"sources":["../../src/transfer/nodes.ts"],"mappings":";;iBA+CiB,+BAA+B;EAC9C,OAAO;EACP,QAAQ;EACR,YAAY;EACZ,eAAe,oBAAoB;;;wBAIrB,oBACd,QAAQ,WACR,MAAM,yBACL,QAAQ"}
@@ -1,13 +1,14 @@
1
- import { overriddenBindingField, remapInstanceOverrideState } from "../instances/overrides.js";
2
- import { cloneNodeProps } from "../copy.js";
3
- import { styleRunReferences } from "../text/references.js";
4
- import { referencedStyleIds } from "../shared-styles.js";
5
1
  import { readBehaviour, withBehaviour } from "../behaviours/model.js";
6
2
  import { mapTransitionVariables, transitionVariableIds } from "../behaviours/transition.js";
3
+ import { cloneNodeProps } from "../copy.js";
4
+ import { overriddenBindingField, remapInstanceOverrideState } from "../instances/overrides.js";
5
+ import { keyframeVariableIds, mapKeyframeVariables } from "../motion/variables.js";
6
+ import { referencedStyleIds } from "../shared-styles.js";
7
7
  import { mapSlideVariables, slideVariableIds } from "../slides/motion.js";
8
+ import { styleRunReferences } from "../text/references.js";
8
9
  import { requireTransferReference } from "./references.js";
9
10
  import { remappedResourceReferences } from "./resources.js";
10
- //#region src/transfer/nodes.ts
11
+ // src/transfer/nodes.ts
11
12
  function semanticTransferReferences(node) {
12
13
  const runs = styleRunReferences(node.styleRuns);
13
14
  const behaviour = readBehaviour(node);
@@ -16,6 +17,7 @@ function semanticTransferReferences(node) {
16
17
  ...Object.values(node.boundVariables),
17
18
  ...behaviour ? transitionVariableIds(behaviour) : [],
18
19
  ...slideVariableIds(node),
20
+ ...keyframeVariableIds(node),
19
21
  ...runs.variables,
20
22
  ...referencedStyleIds(node),
21
23
  ...Object.entries(node.componentPropertyAssignments).flatMap(([id, value]) => [id, value]),
@@ -72,10 +74,10 @@ function prepareNodeTransfer(source, refs) {
72
74
  const behaviour = readBehaviour(source);
73
75
  if (behaviour && transitionVariableIds(behaviour).length > 0) result.pluginData = withBehaviour(source, mapTransitionVariables(behaviour, (id) => refs.variables.get(id)));
74
76
  if (slideVariableIds(source).length > 0) Object.assign(result, mapSlideVariables(source, (id) => refs.variables.get(id)));
77
+ if (keyframeVariableIds(source).length > 0) Object.assign(result, mapKeyframeVariables(source, (id) => refs.variables.get(id)));
75
78
  result.componentPropertyValues = { ...source.componentPropertyValues };
76
79
  return result;
77
80
  }
78
- //#endregion
79
81
  export { prepareNodeTransfer, semanticTransferReferences };
80
82
 
81
83
  //# sourceMappingURL=nodes.js.map