@moondraft/import 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +34 -0
  3. package/README.md +36 -2
  4. package/SOURCE.md +394 -0
  5. package/dist/adapter/convert.d.ts +144 -0
  6. package/dist/adapter/convert.js +2811 -0
  7. package/dist/adapter/figma-descriptions.d.ts +7 -0
  8. package/dist/adapter/figma-descriptions.js +34 -0
  9. package/dist/adapter/figma-grids.d.ts +12 -0
  10. package/dist/adapter/figma-grids.js +175 -0
  11. package/dist/adapter/figma-handoff.d.ts +12 -0
  12. package/dist/adapter/figma-handoff.js +167 -0
  13. package/dist/adapter/figma-hyperlinks.d.ts +13 -0
  14. package/dist/adapter/figma-hyperlinks.js +77 -0
  15. package/dist/adapter/figma.d.ts +12 -0
  16. package/dist/adapter/figma.js +40 -0
  17. package/dist/adapter/file-components.d.ts +20 -0
  18. package/dist/adapter/file-components.js +352 -0
  19. package/dist/adapter/file-resources.d.ts +29 -0
  20. package/dist/adapter/file-resources.js +851 -0
  21. package/dist/adapter/image-crop.d.ts +18 -0
  22. package/dist/adapter/image-crop.js +30 -0
  23. package/dist/adapter/index.d.ts +6 -0
  24. package/dist/adapter/index.js +9 -0
  25. package/dist/adapter/link.d.ts +49 -0
  26. package/dist/adapter/link.js +892 -0
  27. package/dist/adapter/payload.d.ts +31 -0
  28. package/dist/adapter/payload.js +78 -0
  29. package/dist/adapter/shapes.d.ts +31 -0
  30. package/dist/adapter/shapes.js +75 -0
  31. package/dist/adapter/variables.d.ts +45 -0
  32. package/dist/adapter/variables.js +106 -0
  33. package/dist/figma-file.d.ts +38 -0
  34. package/dist/figma-file.js +97 -0
  35. package/dist/figma-worker.d.ts +11 -0
  36. package/dist/figma-worker.js +12 -0
  37. package/dist/figma.d.ts +26 -0
  38. package/dist/figma.js +230 -0
  39. package/dist/index.d.ts +29 -0
  40. package/dist/index.js +50 -0
  41. package/dist/report.d.ts +42 -0
  42. package/dist/report.js +142 -0
  43. package/dist/serialize.d.ts +7 -0
  44. package/dist/serialize.js +79 -0
  45. package/dist/svg.d.ts +33 -0
  46. package/dist/svg.js +44 -0
  47. package/dist/syntax.d.ts +8 -0
  48. package/dist/syntax.js +19 -0
  49. package/dist/taco/figma-import/clipboard.d.ts +25 -0
  50. package/dist/taco/figma-import/clipboard.js +87 -0
  51. package/dist/taco/figma-import/clipboardSize.d.ts +31 -0
  52. package/dist/taco/figma-import/clipboardSize.js +107 -0
  53. package/dist/taco/figma-import/container/compression.d.ts +9 -0
  54. package/dist/taco/figma-import/container/compression.js +174 -0
  55. package/dist/taco/figma-import/container/error.d.ts +15 -0
  56. package/dist/taco/figma-import/container/error.js +19 -0
  57. package/dist/taco/figma-import/container/kiwiContainer.d.ts +41 -0
  58. package/dist/taco/figma-import/container/kiwiContainer.js +61 -0
  59. package/dist/taco/figma-import/container/limits.d.ts +22 -0
  60. package/dist/taco/figma-import/container/limits.js +22 -0
  61. package/dist/taco/figma-import/container/zip.d.ts +14 -0
  62. package/dist/taco/figma-import/container/zip.js +154 -0
  63. package/dist/taco/figma-import/figFile.d.ts +34 -0
  64. package/dist/taco/figma-import/figFile.js +91 -0
  65. package/dist/taco/figma-import/figFileDocument.d.ts +25 -0
  66. package/dist/taco/figma-import/figFileDocument.js +100 -0
  67. package/dist/taco/figma-import/import/blobs.d.ts +10 -0
  68. package/dist/taco/figma-import/import/blobs.js +23 -0
  69. package/dist/taco/figma-import/import/carry.d.ts +24 -0
  70. package/dist/taco/figma-import/import/carry.js +66 -0
  71. package/dist/taco/figma-import/import/componentProps.d.ts +90 -0
  72. package/dist/taco/figma-import/import/componentProps.js +329 -0
  73. package/dist/taco/figma-import/import/componentSets.d.ts +85 -0
  74. package/dist/taco/figma-import/import/componentSets.js +647 -0
  75. package/dist/taco/figma-import/import/converters/effects.d.ts +31 -0
  76. package/dist/taco/figma-import/import/converters/effects.js +127 -0
  77. package/dist/taco/figma-import/import/converters/ellipse.d.ts +7 -0
  78. package/dist/taco/figma-import/import/converters/ellipse.js +54 -0
  79. package/dist/taco/figma-import/import/converters/exportSettings.d.ts +4 -0
  80. package/dist/taco/figma-import/import/converters/exportSettings.js +49 -0
  81. package/dist/taco/figma-import/import/converters/frame.d.ts +21 -0
  82. package/dist/taco/figma-import/import/converters/frame.js +63 -0
  83. package/dist/taco/figma-import/import/converters/gradient.d.ts +74 -0
  84. package/dist/taco/figma-import/import/converters/gradient.js +108 -0
  85. package/dist/taco/figma-import/import/converters/group.d.ts +19 -0
  86. package/dist/taco/figma-import/import/converters/group.js +30 -0
  87. package/dist/taco/figma-import/import/converters/image.d.ts +13 -0
  88. package/dist/taco/figma-import/import/converters/image.js +94 -0
  89. package/dist/taco/figma-import/import/converters/layout.d.ts +33 -0
  90. package/dist/taco/figma-import/import/converters/layout.js +187 -0
  91. package/dist/taco/figma-import/import/converters/line.d.ts +11 -0
  92. package/dist/taco/figma-import/import/converters/line.js +40 -0
  93. package/dist/taco/figma-import/import/converters/rectangle.d.ts +3 -0
  94. package/dist/taco/figma-import/import/converters/rectangle.js +11 -0
  95. package/dist/taco/figma-import/import/converters/section.d.ts +8 -0
  96. package/dist/taco/figma-import/import/converters/section.js +29 -0
  97. package/dist/taco/figma-import/import/converters/shared.d.ts +71 -0
  98. package/dist/taco/figma-import/import/converters/shared.js +372 -0
  99. package/dist/taco/figma-import/import/converters/text.d.ts +54 -0
  100. package/dist/taco/figma-import/import/converters/text.js +707 -0
  101. package/dist/taco/figma-import/import/converters/vector.d.ts +105 -0
  102. package/dist/taco/figma-import/import/converters/vector.js +609 -0
  103. package/dist/taco/figma-import/import/converters/vectorNetwork.d.ts +114 -0
  104. package/dist/taco/figma-import/import/converters/vectorNetwork.js +503 -0
  105. package/dist/taco/figma-import/import/fields.d.ts +15 -0
  106. package/dist/taco/figma-import/import/fields.js +29 -0
  107. package/dist/taco/figma-import/import/instances.d.ts +184 -0
  108. package/dist/taco/figma-import/import/instances.js +1530 -0
  109. package/dist/taco/figma-import/import/nestingCycles.d.ts +86 -0
  110. package/dist/taco/figma-import/import/nestingCycles.js +488 -0
  111. package/dist/taco/figma-import/import/slots.d.ts +56 -0
  112. package/dist/taco/figma-import/import/slots.js +96 -0
  113. package/dist/taco/figma-import/import/styles.d.ts +48 -0
  114. package/dist/taco/figma-import/import/styles.js +48 -0
  115. package/dist/taco/figma-import/import/tree.d.ts +66 -0
  116. package/dist/taco/figma-import/import/tree.js +194 -0
  117. package/dist/taco/figma-import/import/types.d.ts +232 -0
  118. package/dist/taco/figma-import/import/types.js +33 -0
  119. package/dist/taco/figma-import/import/variables.d.ts +137 -0
  120. package/dist/taco/figma-import/import/variables.js +769 -0
  121. package/dist/taco/figma-import/import/variantTrees.d.ts +20 -0
  122. package/dist/taco/figma-import/import/variantTrees.js +520 -0
  123. package/dist/taco/figma-import/import/walk.d.ts +207 -0
  124. package/dist/taco/figma-import/import/walk.js +1464 -0
  125. package/dist/taco/figma-import/index.d.ts +22 -0
  126. package/dist/taco/figma-import/index.js +13 -0
  127. package/dist/taco/figma-import/kiwi/byteReader.d.ts +37 -0
  128. package/dist/taco/figma-import/kiwi/byteReader.js +151 -0
  129. package/dist/taco/figma-import/kiwi/error.d.ts +14 -0
  130. package/dist/taco/figma-import/kiwi/error.js +29 -0
  131. package/dist/taco/figma-import/kiwi/limits.d.ts +18 -0
  132. package/dist/taco/figma-import/kiwi/limits.js +18 -0
  133. package/dist/taco/figma-import/kiwi/message.d.ts +12 -0
  134. package/dist/taco/figma-import/kiwi/message.js +147 -0
  135. package/dist/taco/figma-import/kiwi/schema.d.ts +42 -0
  136. package/dist/taco/figma-import/kiwi/schema.js +206 -0
  137. package/dist/taco/figma-import/kiwi/types.d.ts +46 -0
  138. package/dist/taco/figma-import/kiwi/types.js +18 -0
  139. package/dist/taco/model/agent-hidden-fields.d.ts +20 -0
  140. package/dist/taco/model/agent-hidden-fields.js +29 -0
  141. package/dist/taco/model/asset-users.d.ts +23 -0
  142. package/dist/taco/model/asset-users.js +128 -0
  143. package/dist/taco/model/auto-layout-lines.d.ts +32 -0
  144. package/dist/taco/model/auto-layout-lines.js +70 -0
  145. package/dist/taco/model/codec.d.ts +444 -0
  146. package/dist/taco/model/codec.js +5665 -0
  147. package/dist/taco/model/color.d.ts +11 -0
  148. package/dist/taco/model/color.js +61 -0
  149. package/dist/taco/model/comment-operations.d.ts +102 -0
  150. package/dist/taco/model/comment-operations.js +227 -0
  151. package/dist/taco/model/component-evaluation.d.ts +96 -0
  152. package/dist/taco/model/component-evaluation.js +555 -0
  153. package/dist/taco/model/component-expressions.d.ts +242 -0
  154. package/dist/taco/model/component-expressions.js +1082 -0
  155. package/dist/taco/model/component-properties.d.ts +111 -0
  156. package/dist/taco/model/component-properties.js +339 -0
  157. package/dist/taco/model/component-samples.d.ts +83 -0
  158. package/dist/taco/model/component-samples.js +290 -0
  159. package/dist/taco/model/component-validity.d.ts +85 -0
  160. package/dist/taco/model/component-validity.js +397 -0
  161. package/dist/taco/model/components.d.ts +155 -0
  162. package/dist/taco/model/components.js +505 -0
  163. package/dist/taco/model/connector-ends.d.ts +20 -0
  164. package/dist/taco/model/connector-ends.js +188 -0
  165. package/dist/taco/model/connector-geometry.d.ts +74 -0
  166. package/dist/taco/model/connector-geometry.js +293 -0
  167. package/dist/taco/model/corner-radii.d.ts +26 -0
  168. package/dist/taco/model/corner-radii.js +47 -0
  169. package/dist/taco/model/derivations.d.ts +81 -0
  170. package/dist/taco/model/derivations.js +151 -0
  171. package/dist/taco/model/export-settings.d.ts +53 -0
  172. package/dist/taco/model/export-settings.js +156 -0
  173. package/dist/taco/model/expressions/ast.d.ts +153 -0
  174. package/dist/taco/model/expressions/ast.js +6 -0
  175. package/dist/taco/model/expressions/cache.d.ts +23 -0
  176. package/dist/taco/model/expressions/cache.js +43 -0
  177. package/dist/taco/model/expressions/check.d.ts +72 -0
  178. package/dist/taco/model/expressions/check.js +517 -0
  179. package/dist/taco/model/expressions/completion.d.ts +61 -0
  180. package/dist/taco/model/expressions/completion.js +421 -0
  181. package/dist/taco/model/expressions/evaluate.d.ts +32 -0
  182. package/dist/taco/model/expressions/evaluate.js +519 -0
  183. package/dist/taco/model/expressions/forms.d.ts +84 -0
  184. package/dist/taco/model/expressions/forms.js +200 -0
  185. package/dist/taco/model/expressions/index.d.ts +14 -0
  186. package/dist/taco/model/expressions/index.js +17 -0
  187. package/dist/taco/model/expressions/lexer.d.ts +42 -0
  188. package/dist/taco/model/expressions/lexer.js +213 -0
  189. package/dist/taco/model/expressions/library.d.ts +33 -0
  190. package/dist/taco/model/expressions/library.js +117 -0
  191. package/dist/taco/model/expressions/names.d.ts +43 -0
  192. package/dist/taco/model/expressions/names.js +99 -0
  193. package/dist/taco/model/expressions/parser.d.ts +15 -0
  194. package/dist/taco/model/expressions/parser.js +438 -0
  195. package/dist/taco/model/expressions/rename.d.ts +34 -0
  196. package/dist/taco/model/expressions/rename.js +46 -0
  197. package/dist/taco/model/expressions/source.d.ts +15 -0
  198. package/dist/taco/model/expressions/source.js +161 -0
  199. package/dist/taco/model/expressions/types.d.ts +119 -0
  200. package/dist/taco/model/expressions/types.js +102 -0
  201. package/dist/taco/model/expressions/values.d.ts +97 -0
  202. package/dist/taco/model/expressions/values.js +160 -0
  203. package/dist/taco/model/geometry-limits.d.ts +16 -0
  204. package/dist/taco/model/geometry-limits.js +67 -0
  205. package/dist/taco/model/geometry.d.ts +47 -0
  206. package/dist/taco/model/geometry.js +193 -0
  207. package/dist/taco/model/group-bounds.d.ts +38 -0
  208. package/dist/taco/model/group-bounds.js +144 -0
  209. package/dist/taco/model/id-table.d.ts +37 -0
  210. package/dist/taco/model/id-table.js +80 -0
  211. package/dist/taco/model/index.d.ts +25 -0
  212. package/dist/taco/model/index.js +27 -0
  213. package/dist/taco/model/instance-resolver.d.ts +376 -0
  214. package/dist/taco/model/instance-resolver.js +1778 -0
  215. package/dist/taco/model/layer-syntax.d.ts +340 -0
  216. package/dist/taco/model/layer-syntax.js +3506 -0
  217. package/dist/taco/model/layout/constraints.d.ts +84 -0
  218. package/dist/taco/model/layout/constraints.js +445 -0
  219. package/dist/taco/model/layout/frame-layout.d.ts +46 -0
  220. package/dist/taco/model/layout/frame-layout.js +618 -0
  221. package/dist/taco/model/layout/node-sizing.d.ts +163 -0
  222. package/dist/taco/model/layout/node-sizing.js +486 -0
  223. package/dist/taco/model/legacy-connector-caps.d.ts +15 -0
  224. package/dist/taco/model/legacy-connector-caps.js +70 -0
  225. package/dist/taco/model/linear-call.d.ts +48 -0
  226. package/dist/taco/model/linear-call.js +58 -0
  227. package/dist/taco/model/new-nodes.d.ts +145 -0
  228. package/dist/taco/model/new-nodes.js +277 -0
  229. package/dist/taco/model/node-builder.d.ts +449 -0
  230. package/dist/taco/model/node-builder.js +2294 -0
  231. package/dist/taco/model/node-table-watch.d.ts +36 -0
  232. package/dist/taco/model/node-table-watch.js +63 -0
  233. package/dist/taco/model/node-transform.d.ts +39 -0
  234. package/dist/taco/model/node-transform.js +79 -0
  235. package/dist/taco/model/node-users-index.d.ts +10 -0
  236. package/dist/taco/model/node-users-index.js +82 -0
  237. package/dist/taco/model/operation-references.d.ts +80 -0
  238. package/dist/taco/model/operation-references.js +399 -0
  239. package/dist/taco/model/operations.d.ts +610 -0
  240. package/dist/taco/model/operations.js +2882 -0
  241. package/dist/taco/model/overlay-table.d.ts +71 -0
  242. package/dist/taco/model/overlay-table.js +171 -0
  243. package/dist/taco/model/override-remap.d.ts +69 -0
  244. package/dist/taco/model/override-remap.js +230 -0
  245. package/dist/taco/model/parent-table.d.ts +53 -0
  246. package/dist/taco/model/parent-table.js +193 -0
  247. package/dist/taco/model/problem-collector.d.ts +27 -0
  248. package/dist/taco/model/problem-collector.js +101 -0
  249. package/dist/taco/model/sha256.d.ts +10 -0
  250. package/dist/taco/model/sha256.js +79 -0
  251. package/dist/taco/model/shape-geometry.d.ts +96 -0
  252. package/dist/taco/model/shape-geometry.js +368 -0
  253. package/dist/taco/model/shared-node-table.d.ts +97 -0
  254. package/dist/taco/model/shared-node-table.js +546 -0
  255. package/dist/taco/model/slots.d.ts +113 -0
  256. package/dist/taco/model/slots.js +281 -0
  257. package/dist/taco/model/stroke-settings.d.ts +37 -0
  258. package/dist/taco/model/stroke-settings.js +90 -0
  259. package/dist/taco/model/svg-path-import.d.ts +89 -0
  260. package/dist/taco/model/svg-path-import.js +219 -0
  261. package/dist/taco/model/text-measurement.d.ts +142 -0
  262. package/dist/taco/model/text-measurement.js +846 -0
  263. package/dist/taco/model/text-reads.d.ts +66 -0
  264. package/dist/taco/model/text-reads.js +128 -0
  265. package/dist/taco/model/text-sizer.d.ts +358 -0
  266. package/dist/taco/model/text-sizer.js +996 -0
  267. package/dist/taco/model/theme-users.d.ts +59 -0
  268. package/dist/taco/model/theme-users.js +312 -0
  269. package/dist/taco/model/thumbnail.d.ts +15 -0
  270. package/dist/taco/model/thumbnail.js +34 -0
  271. package/dist/taco/model/types.d.ts +2369 -0
  272. package/dist/taco/model/types.js +366 -0
  273. package/dist/taco/model/unknown-property.d.ts +5 -0
  274. package/dist/taco/model/unknown-property.js +7 -0
  275. package/dist/taco/model/validated-documents.d.ts +22 -0
  276. package/dist/taco/model/validated-documents.js +22 -0
  277. package/dist/taco/model/variable-modes.d.ts +61 -0
  278. package/dist/taco/model/variable-modes.js +438 -0
  279. package/dist/taco/model/variable-references.d.ts +54 -0
  280. package/dist/taco/model/variable-references.js +183 -0
  281. package/dist/taco/model/variables.d.ts +24 -0
  282. package/dist/taco/model/variables.js +151 -0
  283. package/dist/taco/model/vector-network.d.ts +34 -0
  284. package/dist/taco/model/vector-network.js +411 -0
  285. package/dist/taco/svg-import/import-svg.d.ts +36 -0
  286. package/dist/taco/svg-import/import-svg.js +729 -0
  287. package/dist/taco/svg-import/index.d.ts +3 -0
  288. package/dist/taco/svg-import/index.js +3 -0
  289. package/dist/taco/svg-import/limits/limits.d.ts +79 -0
  290. package/dist/taco/svg-import/limits/limits.js +160 -0
  291. package/dist/taco/svg-import/paint/gradients.d.ts +64 -0
  292. package/dist/taco/svg-import/paint/gradients.js +429 -0
  293. package/dist/taco/svg-import/paint/paint.d.ts +32 -0
  294. package/dist/taco/svg-import/paint/paint.js +162 -0
  295. package/dist/taco/svg-import/paths/paths.d.ts +58 -0
  296. package/dist/taco/svg-import/paths/paths.js +205 -0
  297. package/dist/taco/svg-import/public-types.d.ts +279 -0
  298. package/dist/taco/svg-import/public-types.js +56 -0
  299. package/dist/taco/svg-import/report/report.d.ts +44 -0
  300. package/dist/taco/svg-import/report/report.js +79 -0
  301. package/dist/taco/svg-import/reuse/reuse.d.ts +99 -0
  302. package/dist/taco/svg-import/reuse/reuse.js +840 -0
  303. package/dist/taco/svg-import/shapes/shapes.d.ts +35 -0
  304. package/dist/taco/svg-import/shapes/shapes.js +386 -0
  305. package/dist/taco/svg-import/structure/effects.d.ts +26 -0
  306. package/dist/taco/svg-import/structure/effects.js +618 -0
  307. package/dist/taco/svg-import/structure/image.d.ts +24 -0
  308. package/dist/taco/svg-import/structure/image.js +495 -0
  309. package/dist/taco/svg-import/structure/walk.d.ts +85 -0
  310. package/dist/taco/svg-import/structure/walk.js +544 -0
  311. package/dist/taco/svg-import/style/color.d.ts +40 -0
  312. package/dist/taco/svg-import/style/color.js +275 -0
  313. package/dist/taco/svg-import/style/computed.d.ts +214 -0
  314. package/dist/taco/svg-import/style/computed.js +1534 -0
  315. package/dist/taco/svg-import/style/css.d.ts +127 -0
  316. package/dist/taco/svg-import/style/css.js +541 -0
  317. package/dist/taco/svg-import/style/media.d.ts +25 -0
  318. package/dist/taco/svg-import/style/media.js +307 -0
  319. package/dist/taco/svg-import/style/properties.d.ts +43 -0
  320. package/dist/taco/svg-import/style/properties.js +135 -0
  321. package/dist/taco/svg-import/style/selector-reach.d.ts +30 -0
  322. package/dist/taco/svg-import/style/selector-reach.js +169 -0
  323. package/dist/taco/svg-import/style/selector-validity.d.ts +14 -0
  324. package/dist/taco/svg-import/style/selector-validity.js +307 -0
  325. package/dist/taco/svg-import/text/text.d.ts +29 -0
  326. package/dist/taco/svg-import/text/text.js +545 -0
  327. package/dist/taco/svg-import/transform/matrix.d.ts +111 -0
  328. package/dist/taco/svg-import/transform/matrix.js +229 -0
  329. package/dist/taco/svg-import/tree/element-data.d.ts +52 -0
  330. package/dist/taco/svg-import/tree/element-data.js +155 -0
  331. package/dist/taco/svg-import/tree/elements.d.ts +36 -0
  332. package/dist/taco/svg-import/tree/elements.js +121 -0
  333. package/dist/taco/svg-import/units/length.d.ts +43 -0
  334. package/dist/taco/svg-import/units/length.js +125 -0
  335. package/dist/taco/svg-import/units/viewbox.d.ts +35 -0
  336. package/dist/taco/svg-import/units/viewbox.js +77 -0
  337. package/package.json +55 -4
@@ -0,0 +1,11 @@
1
+ /** A colour's red, green, blue and alpha components, each from 0 to 1. */
2
+ export type ColorComponents = readonly [number, number, number, number];
3
+ /**
4
+ * Reads the model's colour forms: #rgb, #rgba, #rrggbb, #rrggbbaa,
5
+ * transparent, and rgb()/rgba() with comma or space separated components
6
+ * and optional alpha. Comma syntax requires matching RGB units and a comma
7
+ * before alpha; space syntax permits mixed units and a slash before alpha.
8
+ * Components and alpha may be percentages.
9
+ * Returns undefined for a malformed colour.
10
+ */
11
+ export declare function parseColor(value: unknown): ColorComponents | undefined;
@@ -0,0 +1,61 @@
1
+ function trimWhitespace(source) {
2
+ // CSS whitespace includes line breaks and form feeds, but not other Unicode spaces.
3
+ return source.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g, "");
4
+ }
5
+ function component(source, maximum) {
6
+ const value = trimWhitespace(source);
7
+ if (!/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?%?$/i.test(value))
8
+ return undefined;
9
+ const percent = value.endsWith("%");
10
+ const number = Number(percent ? value.slice(0, -1) : value);
11
+ const limit = percent ? 100 : maximum;
12
+ return Number.isFinite(number) && number >= 0 && number <= limit ? number / limit : undefined;
13
+ }
14
+ /**
15
+ * Reads the model's colour forms: #rgb, #rgba, #rrggbb, #rrggbbaa,
16
+ * transparent, and rgb()/rgba() with comma or space separated components
17
+ * and optional alpha. Comma syntax requires matching RGB units and a comma
18
+ * before alpha; space syntax permits mixed units and a slash before alpha.
19
+ * Components and alpha may be percentages.
20
+ * Returns undefined for a malformed colour.
21
+ */
22
+ export function parseColor(value) {
23
+ if (typeof value !== "string")
24
+ return undefined;
25
+ const source = trimWhitespace(value);
26
+ if (source.toLowerCase() === "transparent")
27
+ return [0, 0, 0, 0];
28
+ if (source.startsWith("#")) {
29
+ const digits = source.slice(1);
30
+ if (!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(digits))
31
+ return undefined;
32
+ const expanded = digits.length <= 4 ? [...digits].map((digit) => digit + digit).join("") : digits;
33
+ const channels = expanded.match(/.{2}/g).map((channel) => Number.parseInt(channel, 16) / 255);
34
+ return [channels[0], channels[1], channels[2], channels[3] ?? 1];
35
+ }
36
+ const match = /^(?:rgb|rgba)\((.*)\)$/is.exec(source);
37
+ if (match === null)
38
+ return undefined;
39
+ const body = match[1];
40
+ const commaSyntax = body.includes(",");
41
+ const alphaParts = body.split("/");
42
+ if (alphaParts.length > 2 || (commaSyntax && alphaParts.length !== 1))
43
+ return undefined;
44
+ const colorParts = commaSyntax
45
+ ? alphaParts[0].split(",").map(trimWhitespace)
46
+ : trimWhitespace(alphaParts[0]).split(/[ \t\n\r\f]+/);
47
+ let alphaPart = alphaParts[1];
48
+ if (commaSyntax && colorParts.length === 4)
49
+ alphaPart = colorParts.pop();
50
+ if (colorParts.length !== 3)
51
+ return undefined;
52
+ if (commaSyntax && !colorParts.every((part) => part.endsWith("%") === colorParts[0].endsWith("%")))
53
+ return undefined;
54
+ const red = component(colorParts[0], 255);
55
+ const green = component(colorParts[1], 255);
56
+ const blue = component(colorParts[2], 255);
57
+ const alpha = alphaPart === undefined ? 1 : component(alphaPart, 1);
58
+ return red === undefined || green === undefined || blue === undefined || alpha === undefined
59
+ ? undefined
60
+ : [red, green, blue, alpha];
61
+ }
@@ -0,0 +1,102 @@
1
+ import type { CommentAgentStatus, CommentEditRecord, CommentMessage, CommentThread, CommentThreadDigest, DesignDocument } from "./types.ts";
2
+ /**
3
+ * Operations on `DesignDocument.commentThreads`. They change no layer, page,
4
+ * component, asset or theme, and no other operation changes a comment
5
+ * thread. `DocumentStore` keeps comments outside its undo history: see
6
+ * `DocumentStore.dispatch`.
7
+ *
8
+ * - `comment.insert`: adds a thread at `index` in `commentThreads`, or at
9
+ * the end without `index`. Its ID must be new. Inverse: `comment.remove`.
10
+ * - `comment.remove`: deletes a thread. Inverse: `comment.insert` at the
11
+ * index it had.
12
+ * - `comment.add-message`: adds a message at `index` in the thread's
13
+ * messages, or at the end without `index`. Its ID must be new in the
14
+ * thread. Inverse: `comment.remove-message`.
15
+ * - `comment.remove-message`: deletes one message; a thread keeps at least
16
+ * one. Inverse: `comment.add-message` at the index it had.
17
+ * - `comment.edit-message`: replaces the text of one message. Inverse: the
18
+ * same operation with the old text.
19
+ * - `comment.set-resolved`: marks the thread resolved, or open again.
20
+ * - `comment.set-agent-state`: sets the agent fields it names (at least
21
+ * one); `null` removes `agentSession` or `agentStatus`. Inverse: the same
22
+ * fields at their old values.
23
+ * - `comment.add-digest` and `comment.remove-digest`: as for messages, on
24
+ * the thread's digests.
25
+ * - `comment.add-edit-record` and `comment.remove-edit-record`: as for
26
+ * messages, on the thread's edit records (since 0.32.0). A record's ID
27
+ * must be new in the whole document, not only in its thread.
28
+ *
29
+ * A thread that is missing, or a result that is not a valid thread, fails
30
+ * the whole edit, as every operation does.
31
+ * @since 0.31.0
32
+ */
33
+ export type CommentOperation = {
34
+ readonly type: "comment.insert";
35
+ readonly thread: CommentThread;
36
+ readonly index?: number;
37
+ } | {
38
+ readonly type: "comment.remove";
39
+ readonly threadId: string;
40
+ } | {
41
+ readonly type: "comment.add-message";
42
+ readonly threadId: string;
43
+ readonly message: CommentMessage;
44
+ readonly index?: number;
45
+ } | {
46
+ readonly type: "comment.remove-message";
47
+ readonly threadId: string;
48
+ readonly messageId: string;
49
+ } | {
50
+ readonly type: "comment.edit-message";
51
+ readonly threadId: string;
52
+ readonly messageId: string;
53
+ readonly body: string;
54
+ } | {
55
+ readonly type: "comment.set-resolved";
56
+ readonly threadId: string;
57
+ readonly resolved: boolean;
58
+ } | {
59
+ readonly type: "comment.set-agent-state";
60
+ readonly threadId: string;
61
+ readonly addressedToAgent?: boolean;
62
+ readonly agentSession?: string | null;
63
+ readonly agentStatus?: CommentAgentStatus | null;
64
+ } | {
65
+ readonly type: "comment.add-digest";
66
+ readonly threadId: string;
67
+ readonly digest: CommentThreadDigest;
68
+ readonly index?: number;
69
+ } | {
70
+ readonly type: "comment.remove-digest";
71
+ readonly threadId: string;
72
+ readonly digestId: string;
73
+ } | {
74
+ readonly type: "comment.add-edit-record";
75
+ readonly threadId: string;
76
+ readonly record: CommentEditRecord;
77
+ readonly index?: number;
78
+ } | {
79
+ readonly type: "comment.remove-edit-record";
80
+ readonly threadId: string;
81
+ readonly recordId: string;
82
+ };
83
+ /** Every `CommentOperation` type. @since 0.31.0 */
84
+ export declare const COMMENT_OPERATION_TYPES: ReadonlySet<CommentOperation["type"]>;
85
+ /** True for an operation on comment threads. @since 0.31.0 */
86
+ export declare function isCommentOperation(operation: {
87
+ readonly type: string;
88
+ }): operation is CommentOperation;
89
+ /**
90
+ * Checks the shape of one comment operation, as `assertOperation` does for the rest. Each field is
91
+ * checked through the problem collector, so a collecting check reports every bad field.
92
+ */
93
+ export declare function assertCommentOperationShape(operation: Record<string, unknown>): void;
94
+ /** The result of one comment operation; `inverse` is absent when nothing changed. */
95
+ export interface CommentOperationResult {
96
+ readonly document: DesignDocument;
97
+ readonly inverse?: CommentOperation;
98
+ /** The thread the operation wrote, or `undefined` when nothing changed. */
99
+ readonly threadId?: string;
100
+ }
101
+ /** Applies one comment operation. Throws a `ModelError` when it does not fit the document. */
102
+ export declare function applyCommentOperation(document: DesignDocument, operation: CommentOperation): CommentOperationResult;
@@ -0,0 +1,227 @@
1
+ import { COMMENT_AGENT_STATUSES, ModelError, assertCommentMessage, assertCommentThread, assertCommentThreadDigest, assertCommentEditRecord, } from "./codec.js";
2
+ import { attempt } from "./problem-collector.js";
3
+ /** Every `CommentOperation` type. @since 0.31.0 */
4
+ export const COMMENT_OPERATION_TYPES = new Set([
5
+ "comment.insert",
6
+ "comment.remove",
7
+ "comment.add-message",
8
+ "comment.remove-message",
9
+ "comment.edit-message",
10
+ "comment.set-resolved",
11
+ "comment.set-agent-state",
12
+ "comment.add-digest",
13
+ "comment.remove-digest",
14
+ "comment.add-edit-record",
15
+ "comment.remove-edit-record",
16
+ ]);
17
+ /** True for an operation on comment threads. @since 0.31.0 */
18
+ export function isCommentOperation(operation) {
19
+ return COMMENT_OPERATION_TYPES.has(operation.type);
20
+ }
21
+ function fail(message, path) {
22
+ throw new ModelError("INVALID_SCHEMA", message, path);
23
+ }
24
+ function onlyKeys(operation, allowed) {
25
+ for (const key of Object.keys(operation)) {
26
+ if (!allowed.includes(key))
27
+ attempt((_, path) => fail(`Unknown property ${key}`, path), key, `$operation.${key}`);
28
+ }
29
+ }
30
+ function idString(value, path) {
31
+ if (typeof value !== "string" || value.length === 0)
32
+ fail("Expected a string", path);
33
+ }
34
+ function optionalIndex(value, path) {
35
+ if (value === undefined)
36
+ return;
37
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0) {
38
+ fail("Expected a non-negative integer", path);
39
+ }
40
+ }
41
+ /** Checks one field: true when `ok`, else the problem `message` at `path`, recorded while the checks collect. */
42
+ function field(ok, message, path) {
43
+ if (!ok)
44
+ attempt(() => fail(message, path), undefined, path);
45
+ }
46
+ /**
47
+ * Checks the shape of one comment operation, as `assertOperation` does for the rest. Each field is
48
+ * checked through the problem collector, so a collecting check reports every bad field.
49
+ */
50
+ export function assertCommentOperationShape(operation) {
51
+ const type = operation.type;
52
+ if (type !== "comment.insert")
53
+ attempt(idString, operation.threadId, "$operation.threadId");
54
+ switch (type) {
55
+ case "comment.insert":
56
+ onlyKeys(operation, ["type", "thread", "index"]);
57
+ attempt(assertCommentThread, operation.thread, "$");
58
+ attempt(optionalIndex, operation.index, "$operation.index");
59
+ return;
60
+ case "comment.remove":
61
+ onlyKeys(operation, ["type", "threadId"]);
62
+ return;
63
+ case "comment.add-message":
64
+ onlyKeys(operation, ["type", "threadId", "message", "index"]);
65
+ attempt(assertCommentMessage, operation.message, "$");
66
+ attempt(optionalIndex, operation.index, "$operation.index");
67
+ return;
68
+ case "comment.remove-message":
69
+ onlyKeys(operation, ["type", "threadId", "messageId"]);
70
+ attempt(idString, operation.messageId, "$operation.messageId");
71
+ return;
72
+ case "comment.edit-message":
73
+ onlyKeys(operation, ["type", "threadId", "messageId", "body"]);
74
+ attempt(idString, operation.messageId, "$operation.messageId");
75
+ field(typeof operation.body === "string" && operation.body.trim().length > 0, "A comment message must have text other than white space", "$operation.body");
76
+ return;
77
+ case "comment.set-resolved":
78
+ onlyKeys(operation, ["type", "threadId", "resolved"]);
79
+ field(typeof operation.resolved === "boolean", "Expected a boolean", "$operation.resolved");
80
+ return;
81
+ case "comment.set-agent-state": {
82
+ onlyKeys(operation, ["type", "threadId", "addressedToAgent", "agentSession", "agentStatus"]);
83
+ const { addressedToAgent, agentSession, agentStatus } = operation;
84
+ field(addressedToAgent !== undefined || agentSession !== undefined || agentStatus !== undefined, "Set at least one of addressedToAgent, agentSession and agentStatus", "$operation");
85
+ field(addressedToAgent === undefined || typeof addressedToAgent === "boolean", "Expected a boolean", "$operation.addressedToAgent");
86
+ field(agentSession === undefined || agentSession === null || typeof agentSession === "string", "Expected a string or null", "$operation.agentSession");
87
+ field(agentStatus === undefined || agentStatus === null
88
+ || COMMENT_AGENT_STATUSES.includes(agentStatus), `Expected ${COMMENT_AGENT_STATUSES.map((status) => JSON.stringify(status)).join(", ")} or null`, "$operation.agentStatus");
89
+ return;
90
+ }
91
+ case "comment.add-digest":
92
+ onlyKeys(operation, ["type", "threadId", "digest", "index"]);
93
+ attempt(assertCommentThreadDigest, operation.digest, "$");
94
+ attempt(optionalIndex, operation.index, "$operation.index");
95
+ return;
96
+ case "comment.remove-digest":
97
+ onlyKeys(operation, ["type", "threadId", "digestId"]);
98
+ attempt(idString, operation.digestId, "$operation.digestId");
99
+ return;
100
+ case "comment.add-edit-record":
101
+ onlyKeys(operation, ["type", "threadId", "record", "index"]);
102
+ attempt(assertCommentEditRecord, operation.record, "$");
103
+ attempt(optionalIndex, operation.index, "$operation.index");
104
+ return;
105
+ case "comment.remove-edit-record":
106
+ onlyKeys(operation, ["type", "threadId", "recordId"]);
107
+ attempt(idString, operation.recordId, "$operation.recordId");
108
+ return;
109
+ }
110
+ }
111
+ function operationError(message) {
112
+ throw new ModelError("INVALID_SCHEMA", message, "$operations");
113
+ }
114
+ function placeAt(items, item, index, what) {
115
+ const at = index ?? items.length;
116
+ if (at > items.length)
117
+ operationError(`${what} index ${at} is past the end (${items.length})`);
118
+ return [...items.slice(0, at), item, ...items.slice(at)];
119
+ }
120
+ /** Applies one comment operation. Throws a `ModelError` when it does not fit the document. */
121
+ export function applyCommentOperation(document, operation) {
122
+ const threads = document.commentThreads;
123
+ // The host finds an edit record by its ID alone, so a record ID must not be used in another thread.
124
+ const recordIdFree = (record, threadId) => {
125
+ const user = threads.find((entry) => entry.id !== threadId && entry.editRecords.some((kept) => kept.id === record.id));
126
+ if (user !== undefined)
127
+ operationError(`Edit record ID "${record.id}" is already used in comment thread ${user.id}`);
128
+ };
129
+ if (operation.type === "comment.insert") {
130
+ if (threads.some((thread) => thread.id === operation.thread.id)) {
131
+ operationError(`Comment thread ${operation.thread.id} already exists`);
132
+ }
133
+ for (const record of operation.thread.editRecords)
134
+ recordIdFree(record, operation.thread.id);
135
+ return {
136
+ document: { ...document, commentThreads: placeAt(threads, operation.thread, operation.index, "Comment thread") },
137
+ inverse: { type: "comment.remove", threadId: operation.thread.id },
138
+ threadId: operation.thread.id,
139
+ };
140
+ }
141
+ const at = threads.findIndex((thread) => thread.id === operation.threadId);
142
+ const thread = threads[at];
143
+ if (thread === undefined)
144
+ operationError(`Missing comment thread ${operation.threadId}`);
145
+ if (operation.type === "comment.remove") {
146
+ return {
147
+ document: { ...document, commentThreads: threads.filter((_, index) => index !== at) },
148
+ inverse: { type: "comment.insert", thread, index: at },
149
+ threadId: thread.id,
150
+ };
151
+ }
152
+ const changed = (next, inverse) => {
153
+ assertCommentThread(next);
154
+ return {
155
+ document: { ...document, commentThreads: threads.map((entry, index) => index === at ? next : entry) },
156
+ inverse,
157
+ threadId: thread.id,
158
+ };
159
+ };
160
+ const messageIndex = (messageId) => {
161
+ const index = thread.messages.findIndex((message) => message.id === messageId);
162
+ if (index < 0)
163
+ operationError(`Comment thread ${thread.id} has no message ${messageId}`);
164
+ return index;
165
+ };
166
+ const editRecordIndex = (recordId) => {
167
+ const index = thread.editRecords.findIndex((entry) => entry.id === recordId);
168
+ if (index < 0)
169
+ operationError(`Comment thread ${thread.id} has no edit record ${recordId}`);
170
+ return index;
171
+ };
172
+ switch (operation.type) {
173
+ case "comment.add-message":
174
+ return changed({ ...thread, messages: placeAt(thread.messages, operation.message, operation.index, "Comment message") }, { type: "comment.remove-message", threadId: thread.id, messageId: operation.message.id });
175
+ case "comment.remove-message": {
176
+ const index = messageIndex(operation.messageId);
177
+ return changed({ ...thread, messages: thread.messages.filter((_, entry) => entry !== index) }, { type: "comment.add-message", threadId: thread.id, message: thread.messages[index], index });
178
+ }
179
+ case "comment.edit-message": {
180
+ const index = messageIndex(operation.messageId);
181
+ const previous = thread.messages[index];
182
+ if (previous.body === operation.body)
183
+ return { document };
184
+ return changed({ ...thread, messages: thread.messages.map((message, entry) => entry === index ? { ...message, body: operation.body } : message) }, { type: "comment.edit-message", threadId: thread.id, messageId: operation.messageId, body: previous.body });
185
+ }
186
+ case "comment.set-resolved":
187
+ if (thread.resolved === operation.resolved)
188
+ return { document };
189
+ return changed({ ...thread, resolved: operation.resolved }, { type: "comment.set-resolved", threadId: thread.id, resolved: thread.resolved });
190
+ case "comment.set-agent-state": {
191
+ const { agentSession, agentStatus, ...rest } = thread;
192
+ const session = operation.agentSession === undefined ? agentSession : operation.agentSession ?? undefined;
193
+ const status = operation.agentStatus === undefined ? agentStatus : operation.agentStatus ?? undefined;
194
+ const addressedToAgent = operation.addressedToAgent ?? thread.addressedToAgent;
195
+ if (session === agentSession && status === agentStatus && addressedToAgent === thread.addressedToAgent) {
196
+ return { document };
197
+ }
198
+ return changed({
199
+ ...rest,
200
+ addressedToAgent,
201
+ ...(session === undefined ? {} : { agentSession: session }),
202
+ ...(status === undefined ? {} : { agentStatus: status }),
203
+ }, {
204
+ type: "comment.set-agent-state",
205
+ threadId: thread.id,
206
+ ...(operation.addressedToAgent === undefined ? {} : { addressedToAgent: thread.addressedToAgent }),
207
+ ...(operation.agentSession === undefined ? {} : { agentSession: agentSession ?? null }),
208
+ ...(operation.agentStatus === undefined ? {} : { agentStatus: agentStatus ?? null }),
209
+ });
210
+ }
211
+ case "comment.add-digest":
212
+ return changed({ ...thread, digests: placeAt(thread.digests, operation.digest, operation.index, "Thread digest") }, { type: "comment.remove-digest", threadId: thread.id, digestId: operation.digest.id });
213
+ case "comment.remove-digest": {
214
+ const index = thread.digests.findIndex((digest) => digest.id === operation.digestId);
215
+ if (index < 0)
216
+ operationError(`Comment thread ${thread.id} has no digest ${operation.digestId}`);
217
+ return changed({ ...thread, digests: thread.digests.filter((_, entry) => entry !== index) }, { type: "comment.add-digest", threadId: thread.id, digest: thread.digests[index], index });
218
+ }
219
+ case "comment.add-edit-record":
220
+ recordIdFree(operation.record, thread.id);
221
+ return changed({ ...thread, editRecords: placeAt(thread.editRecords, operation.record, operation.index, "Edit record") }, { type: "comment.remove-edit-record", threadId: thread.id, recordId: operation.record.id });
222
+ case "comment.remove-edit-record": {
223
+ const index = editRecordIndex(operation.recordId);
224
+ return changed({ ...thread, editRecords: thread.editRecords.filter((_, entry) => entry !== index) }, { type: "comment.add-edit-record", threadId: thread.id, record: thread.editRecords[index], index });
225
+ }
226
+ }
227
+ }
@@ -0,0 +1,96 @@
1
+ import { type ExpressionField } from "./component-expressions.ts";
2
+ import type { Expression, ExpressionError } from "./expressions/ast.ts";
3
+ import { ExpressionCache } from "./expressions/cache.ts";
4
+ import { type ExpressionValue } from "./expressions/values.ts";
5
+ import { type ComponentDefinition, type ComponentPropertyValue, type ComponentPropertyValues, type ComputableField, type DesignDocument, type NodeId, type SceneNode, type TextParagraph, type VariableModes } from "./types.ts";
6
+ /**
7
+ * A stored expression or condition that does not parse or check. It is not
8
+ * evaluated: the field shows its stored value, and a condition counts as no
9
+ * condition (design 8.5).
10
+ * @since 0.25.0
11
+ */
12
+ export interface ComponentExpressionError {
13
+ readonly nodeId: NodeId;
14
+ readonly field: ExpressionField;
15
+ readonly source: string;
16
+ readonly errors: readonly ExpressionError[];
17
+ }
18
+ /**
19
+ * A component's layer tree for one set of property values, before overrides
20
+ * and layout: the layers a condition leaves out, and the layers with
21
+ * computed fields written into their model fields.
22
+ * @since 0.25.0
23
+ */
24
+ export interface ComputedComponent {
25
+ /** Layers with at least one computed field, by stored ID; every other layer is as stored. */
26
+ readonly nodes: ReadonlyMap<NodeId, SceneNode>;
27
+ /** Layers whose condition is false. Their sublayers are left out with them and are not listed. */
28
+ readonly leftOut: ReadonlySet<NodeId>;
29
+ /** Computed values these property values make invalid; each field shows its stored value. */
30
+ readonly errors: readonly ComponentExpressionError[];
31
+ }
32
+ /** The checked expressions of one layer. */
33
+ interface CheckedLayer {
34
+ readonly condition?: Expression;
35
+ readonly fields: readonly {
36
+ readonly field: ComputableField;
37
+ readonly expression: Expression;
38
+ }[];
39
+ }
40
+ /**
41
+ * A component's expressions after parsing and checking, kept per
42
+ * component version by the resolver's cache.
43
+ * @since 0.25.0
44
+ */
45
+ export interface ComponentProgram {
46
+ readonly layers: ReadonlyMap<NodeId, CheckedLayer>;
47
+ readonly errors: readonly ComponentExpressionError[];
48
+ /** True when the component has no properties and no valid expressions, so evaluation is skipped. */
49
+ readonly empty: boolean;
50
+ }
51
+ /** The result for a component with nothing to compute. */
52
+ export declare const UNCOMPUTED_COMPONENT: ComputedComponent;
53
+ /**
54
+ * Parses and checks every expression and condition on `component`'s layers
55
+ * (nested components are not entered). `cache` and `version` let a later
56
+ * call reuse the parsed forms while the component and variables are
57
+ * unchanged.
58
+ */
59
+ export declare function checkComponentProgram(document: DesignDocument, component: ComponentDefinition, cache?: ExpressionCache, version?: string | number): ComponentProgram;
60
+ /**
61
+ * The instance's values for `component`'s properties with defaults filled
62
+ * in, in the component's property order: the key of a computed result.
63
+ * @since 0.25.0
64
+ */
65
+ export declare function filledPropertyValues(component: ComponentDefinition, values?: ComponentPropertyValues): readonly ComponentPropertyValue[];
66
+ /**
67
+ * Evaluates `program` for an instance with `propertyValues`: conditions
68
+ * first (a left-out layer's fields are not computed), then the computed
69
+ * fields, written into the layer's model fields. Variables read in `modes`,
70
+ * the modes in effect at the instance (its component root's and its own
71
+ * choices included), with each layer's own `variableModes` on top for that
72
+ * layer and its sublayers.
73
+ */
74
+ export declare function evaluateComponentProgram(document: DesignDocument, component: ComponentDefinition, program: ComponentProgram, propertyValues?: ComponentPropertyValues, modes?: VariableModes): ComputedComponent;
75
+ /** Whether a characters value leaves the linked source runs unchanged. */
76
+ export declare function linkedParagraphsMatch(characters: string, source: readonly TextParagraph[]): boolean;
77
+ /**
78
+ * Text layers: the whole text as one plain string, paragraphs separated by
79
+ * `"\n"`, every character taking the style of the first run and every
80
+ * paragraph the fields of the first paragraph. The paragraphs after the first
81
+ * take the space above of the source's second paragraph, or the first's when
82
+ * it has one; without one of their own, the text's `paragraphSpacing` puts
83
+ * them apart.
84
+ */
85
+ export declare function paragraphsFromCharacters(characters: string, source: readonly TextParagraph[]): readonly TextParagraph[];
86
+ /**
87
+ * `node` with each computed value written into its model field and clamped
88
+ * to the field's range. Fields the node type cannot compute are ignored. A
89
+ * text layer that sizes itself is measured again when its text changed.
90
+ * @since 0.25.0
91
+ */
92
+ export declare function applyComputedFields(document: DesignDocument, node: SceneNode, results: readonly {
93
+ readonly field: ComputableField;
94
+ readonly value: ExpressionValue;
95
+ }[], onError?: (field: ComputableField, message: string) => void): SceneNode;
96
+ export {};