@cratis/scene.engine 4.2.0 → 4.3.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 (310) hide show
  1. package/dist/cjs/editing/DescriptorCatalog.js +42 -0
  2. package/dist/cjs/editing/DescriptorCatalog.js.map +1 -0
  3. package/dist/cjs/editing/EditSession.js +44 -0
  4. package/dist/cjs/editing/EditSession.js.map +1 -0
  5. package/dist/cjs/editing/applyEdit.js +83 -0
  6. package/dist/cjs/editing/applyEdit.js.map +1 -0
  7. package/dist/cjs/editing/applyEffectiveConfiguration.js +62 -0
  8. package/dist/cjs/editing/applyEffectiveConfiguration.js.map +1 -0
  9. package/dist/cjs/editing/collectComponents.js +34 -0
  10. package/dist/cjs/editing/collectComponents.js.map +1 -0
  11. package/dist/cjs/editing/describeNode.js +63 -0
  12. package/dist/cjs/editing/describeNode.js.map +1 -0
  13. package/dist/cjs/editing/diagnostics.js +36 -0
  14. package/dist/cjs/editing/diagnostics.js.map +1 -0
  15. package/dist/cjs/editing/documentPaths.js +45 -0
  16. package/dist/cjs/editing/documentPaths.js.map +1 -0
  17. package/dist/cjs/editing/exposureEdits.js +106 -0
  18. package/dist/cjs/editing/exposureEdits.js.map +1 -0
  19. package/dist/cjs/editing/exposureGrants.js +115 -0
  20. package/dist/cjs/editing/exposureGrants.js.map +1 -0
  21. package/dist/cjs/editing/indexDocument.js +400 -0
  22. package/dist/cjs/editing/indexDocument.js.map +1 -0
  23. package/dist/cjs/editing/inspect.js +127 -0
  24. package/dist/cjs/editing/inspect.js.map +1 -0
  25. package/dist/cjs/editing/instanceEdits.js +255 -0
  26. package/dist/cjs/editing/instanceEdits.js.map +1 -0
  27. package/dist/cjs/editing/layoutTypeDescriptors.js +425 -0
  28. package/dist/cjs/editing/layoutTypeDescriptors.js.map +1 -0
  29. package/dist/cjs/editing/layoutTypeEdits.js +141 -0
  30. package/dist/cjs/editing/layoutTypeEdits.js.map +1 -0
  31. package/dist/cjs/editing/nodeIds.js +115 -0
  32. package/dist/cjs/editing/nodeIds.js.map +1 -0
  33. package/dist/cjs/editing/pathAccess.js +53 -0
  34. package/dist/cjs/editing/pathAccess.js.map +1 -0
  35. package/dist/cjs/editing/propertyEdits.js +118 -0
  36. package/dist/cjs/editing/propertyEdits.js.map +1 -0
  37. package/dist/cjs/editing/resolveEffectiveConfiguration.js +200 -0
  38. package/dist/cjs/editing/resolveEffectiveConfiguration.js.map +1 -0
  39. package/dist/cjs/editing/resolveTemplateChain.js +100 -0
  40. package/dist/cjs/editing/resolveTemplateChain.js.map +1 -0
  41. package/dist/cjs/editing/structureEdits.js +231 -0
  42. package/dist/cjs/editing/structureEdits.js.map +1 -0
  43. package/dist/cjs/editing/validateBinding.js +111 -0
  44. package/dist/cjs/editing/validateBinding.js.map +1 -0
  45. package/dist/cjs/editing/validateValue.js +114 -0
  46. package/dist/cjs/editing/validateValue.js.map +1 -0
  47. package/dist/cjs/index.js +51 -0
  48. package/dist/cjs/index.js.map +1 -1
  49. package/dist/esm/editing/DescriptorCatalog.d.ts +9 -0
  50. package/dist/esm/editing/DescriptorCatalog.d.ts.map +1 -0
  51. package/dist/esm/editing/DescriptorCatalog.js +38 -0
  52. package/dist/esm/editing/DescriptorCatalog.js.map +1 -0
  53. package/dist/esm/editing/DocumentIndex.d.ts +31 -0
  54. package/dist/esm/editing/DocumentIndex.d.ts.map +1 -0
  55. package/dist/esm/editing/DocumentIndex.js +2 -0
  56. package/dist/esm/editing/DocumentIndex.js.map +1 -0
  57. package/dist/esm/editing/EditOutcome.d.ts +7 -0
  58. package/dist/esm/editing/EditOutcome.d.ts.map +1 -0
  59. package/dist/esm/editing/EditOutcome.js +2 -0
  60. package/dist/esm/editing/EditOutcome.js.map +1 -0
  61. package/dist/esm/editing/EditSession.d.ts +20 -0
  62. package/dist/esm/editing/EditSession.d.ts.map +1 -0
  63. package/dist/esm/editing/EditSession.js +42 -0
  64. package/dist/esm/editing/EditSession.js.map +1 -0
  65. package/dist/esm/editing/EditingContext.d.ts +8 -0
  66. package/dist/esm/editing/EditingContext.d.ts.map +1 -0
  67. package/dist/esm/editing/EditingContext.js +2 -0
  68. package/dist/esm/editing/EditingContext.js.map +1 -0
  69. package/dist/esm/editing/TemplateChain.d.ts +13 -0
  70. package/dist/esm/editing/TemplateChain.d.ts.map +1 -0
  71. package/dist/esm/editing/TemplateChain.js +2 -0
  72. package/dist/esm/editing/TemplateChain.js.map +1 -0
  73. package/dist/esm/editing/applyEdit.d.ts +5 -0
  74. package/dist/esm/editing/applyEdit.d.ts.map +1 -0
  75. package/dist/esm/editing/applyEdit.js +81 -0
  76. package/dist/esm/editing/applyEdit.js.map +1 -0
  77. package/dist/esm/editing/applyEffectiveConfiguration.d.ts +3 -0
  78. package/dist/esm/editing/applyEffectiveConfiguration.d.ts.map +1 -0
  79. package/dist/esm/editing/applyEffectiveConfiguration.js +60 -0
  80. package/dist/esm/editing/applyEffectiveConfiguration.js.map +1 -0
  81. package/dist/esm/editing/collectComponents.d.ts +3 -0
  82. package/dist/esm/editing/collectComponents.d.ts.map +1 -0
  83. package/dist/esm/editing/collectComponents.js +32 -0
  84. package/dist/esm/editing/collectComponents.js.map +1 -0
  85. package/dist/esm/editing/describeNode.d.ts +11 -0
  86. package/dist/esm/editing/describeNode.d.ts.map +1 -0
  87. package/dist/esm/editing/describeNode.js +60 -0
  88. package/dist/esm/editing/describeNode.js.map +1 -0
  89. package/dist/esm/editing/diagnostics.d.ts +6 -0
  90. package/dist/esm/editing/diagnostics.d.ts.map +1 -0
  91. package/dist/esm/editing/diagnostics.js +32 -0
  92. package/dist/esm/editing/diagnostics.js.map +1 -0
  93. package/dist/esm/editing/documentPaths.d.ts +8 -0
  94. package/dist/esm/editing/documentPaths.d.ts.map +1 -0
  95. package/dist/esm/editing/documentPaths.js +41 -0
  96. package/dist/esm/editing/documentPaths.js.map +1 -0
  97. package/dist/esm/editing/exposureEdits.d.ts +5 -0
  98. package/dist/esm/editing/exposureEdits.d.ts.map +1 -0
  99. package/dist/esm/editing/exposureEdits.js +103 -0
  100. package/dist/esm/editing/exposureEdits.js.map +1 -0
  101. package/dist/esm/editing/exposureGrants.d.ts +21 -0
  102. package/dist/esm/editing/exposureGrants.d.ts.map +1 -0
  103. package/dist/esm/editing/exposureGrants.js +112 -0
  104. package/dist/esm/editing/exposureGrants.js.map +1 -0
  105. package/dist/esm/editing/given/a_layout_document.d.ts +14 -0
  106. package/dist/esm/editing/given/a_layout_document.d.ts.map +1 -0
  107. package/dist/esm/editing/given/a_layout_document.js +67 -0
  108. package/dist/esm/editing/given/a_layout_document.js.map +1 -0
  109. package/dist/esm/editing/given/a_scene_document.d.ts +20 -0
  110. package/dist/esm/editing/given/a_scene_document.d.ts.map +1 -0
  111. package/dist/esm/editing/given/a_scene_document.js +110 -0
  112. package/dist/esm/editing/given/a_scene_document.js.map +1 -0
  113. package/dist/esm/editing/index.d.ts +19 -0
  114. package/dist/esm/editing/index.d.ts.map +1 -0
  115. package/dist/esm/editing/index.js +19 -0
  116. package/dist/esm/editing/index.js.map +1 -0
  117. package/dist/esm/editing/indexDocument.d.ts +6 -0
  118. package/dist/esm/editing/indexDocument.d.ts.map +1 -0
  119. package/dist/esm/editing/indexDocument.js +396 -0
  120. package/dist/esm/editing/indexDocument.js.map +1 -0
  121. package/dist/esm/editing/inspect.d.ts +8 -0
  122. package/dist/esm/editing/inspect.d.ts.map +1 -0
  123. package/dist/esm/editing/inspect.js +124 -0
  124. package/dist/esm/editing/inspect.js.map +1 -0
  125. package/dist/esm/editing/instanceEdits.d.ts +9 -0
  126. package/dist/esm/editing/instanceEdits.d.ts.map +1 -0
  127. package/dist/esm/editing/instanceEdits.js +248 -0
  128. package/dist/esm/editing/instanceEdits.js.map +1 -0
  129. package/dist/esm/editing/layoutTypeDescriptors.d.ts +5 -0
  130. package/dist/esm/editing/layoutTypeDescriptors.d.ts.map +1 -0
  131. package/dist/esm/editing/layoutTypeDescriptors.js +421 -0
  132. package/dist/esm/editing/layoutTypeDescriptors.js.map +1 -0
  133. package/dist/esm/editing/layoutTypeEdits.d.ts +4 -0
  134. package/dist/esm/editing/layoutTypeEdits.d.ts.map +1 -0
  135. package/dist/esm/editing/layoutTypeEdits.js +139 -0
  136. package/dist/esm/editing/layoutTypeEdits.js.map +1 -0
  137. package/dist/esm/editing/nodeIds.d.ts +14 -0
  138. package/dist/esm/editing/nodeIds.d.ts.map +1 -0
  139. package/dist/esm/editing/nodeIds.js +102 -0
  140. package/dist/esm/editing/nodeIds.js.map +1 -0
  141. package/dist/esm/editing/pathAccess.d.ts +7 -0
  142. package/dist/esm/editing/pathAccess.d.ts.map +1 -0
  143. package/dist/esm/editing/pathAccess.js +48 -0
  144. package/dist/esm/editing/pathAccess.js.map +1 -0
  145. package/dist/esm/editing/propertyEdits.d.ts +15 -0
  146. package/dist/esm/editing/propertyEdits.d.ts.map +1 -0
  147. package/dist/esm/editing/propertyEdits.js +113 -0
  148. package/dist/esm/editing/propertyEdits.js.map +1 -0
  149. package/dist/esm/editing/resolveEffectiveConfiguration.d.ts +5 -0
  150. package/dist/esm/editing/resolveEffectiveConfiguration.d.ts.map +1 -0
  151. package/dist/esm/editing/resolveEffectiveConfiguration.js +198 -0
  152. package/dist/esm/editing/resolveEffectiveConfiguration.js.map +1 -0
  153. package/dist/esm/editing/resolveTemplateChain.d.ts +4 -0
  154. package/dist/esm/editing/resolveTemplateChain.d.ts.map +1 -0
  155. package/dist/esm/editing/resolveTemplateChain.js +98 -0
  156. package/dist/esm/editing/resolveTemplateChain.js.map +1 -0
  157. package/dist/esm/editing/structureEdits.d.ts +6 -0
  158. package/dist/esm/editing/structureEdits.d.ts.map +1 -0
  159. package/dist/esm/editing/structureEdits.js +227 -0
  160. package/dist/esm/editing/structureEdits.js.map +1 -0
  161. package/dist/esm/editing/validateBinding.d.ts +7 -0
  162. package/dist/esm/editing/validateBinding.d.ts.map +1 -0
  163. package/dist/esm/editing/validateBinding.js +108 -0
  164. package/dist/esm/editing/validateBinding.js.map +1 -0
  165. package/dist/esm/editing/validateValue.d.ts +8 -0
  166. package/dist/esm/editing/validateValue.d.ts.map +1 -0
  167. package/dist/esm/editing/validateValue.js +111 -0
  168. package/dist/esm/editing/validateValue.js.map +1 -0
  169. package/dist/esm/index.d.ts +1 -0
  170. package/dist/esm/index.d.ts.map +1 -1
  171. package/dist/esm/index.js +14 -0
  172. package/dist/esm/index.js.map +1 -1
  173. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  174. package/editing/DescriptorCatalog.ts +51 -0
  175. package/editing/DocumentIndex.ts +73 -0
  176. package/editing/EditOutcome.ts +21 -0
  177. package/editing/EditSession.ts +50 -0
  178. package/editing/EditingContext.ts +23 -0
  179. package/editing/TemplateChain.ts +36 -0
  180. package/editing/applyEdit.ts +69 -0
  181. package/editing/applyEffectiveConfiguration.ts +53 -0
  182. package/editing/collectComponents.ts +36 -0
  183. package/editing/describeNode.ts +61 -0
  184. package/editing/diagnostics.ts +30 -0
  185. package/editing/documentPaths.ts +40 -0
  186. package/editing/exposureEdits.ts +119 -0
  187. package/editing/exposureGrants.ts +159 -0
  188. package/editing/given/a_layout_document.ts +88 -0
  189. package/editing/given/a_scene_document.ts +135 -0
  190. package/editing/index.ts +21 -0
  191. package/editing/indexDocument.ts +237 -0
  192. package/editing/inspect.ts +142 -0
  193. package/editing/instanceEdits.ts +243 -0
  194. package/editing/layoutTypeDescriptors.ts +191 -0
  195. package/editing/layoutTypeEdits.ts +135 -0
  196. package/editing/nodeIds.ts +111 -0
  197. package/editing/pathAccess.ts +81 -0
  198. package/editing/propertyEdits.ts +119 -0
  199. package/editing/resolveEffectiveConfiguration.ts +202 -0
  200. package/editing/resolveTemplateChain.ts +109 -0
  201. package/editing/structureEdits.ts +234 -0
  202. package/editing/validateBinding.ts +103 -0
  203. package/editing/validateValue.ts +130 -0
  204. package/index.ts +1 -0
  205. package/package.json +5 -4
  206. package/dist/esm/for_aggregateContributions/when_aggregating_by_contribution_point.d.ts +0 -2
  207. package/dist/esm/for_aggregateContributions/when_aggregating_by_contribution_point.d.ts.map +0 -1
  208. package/dist/esm/for_aggregateContributions/when_aggregating_by_contribution_point.js +0 -23
  209. package/dist/esm/for_aggregateContributions/when_aggregating_by_contribution_point.js.map +0 -1
  210. package/dist/esm/for_buildStarterProfile/when_checking_against_the_shared_fixture_corpus.d.ts +0 -2
  211. package/dist/esm/for_buildStarterProfile/when_checking_against_the_shared_fixture_corpus.d.ts.map +0 -1
  212. package/dist/esm/for_buildStarterProfile/when_checking_against_the_shared_fixture_corpus.js +0 -16
  213. package/dist/esm/for_buildStarterProfile/when_checking_against_the_shared_fixture_corpus.js.map +0 -1
  214. package/dist/esm/for_computeSizeClass/when_computing_the_size_class.d.ts +0 -2
  215. package/dist/esm/for_computeSizeClass/when_computing_the_size_class.d.ts.map +0 -1
  216. package/dist/esm/for_computeSizeClass/when_computing_the_size_class.js +0 -17
  217. package/dist/esm/for_computeSizeClass/when_computing_the_size_class.js.map +0 -1
  218. package/dist/esm/for_evaluateFlowArrangement/when_evaluating_against_the_shared_fixture_corpus.d.ts +0 -2
  219. package/dist/esm/for_evaluateFlowArrangement/when_evaluating_against_the_shared_fixture_corpus.d.ts.map +0 -1
  220. package/dist/esm/for_evaluateFlowArrangement/when_evaluating_against_the_shared_fixture_corpus.js +0 -43
  221. package/dist/esm/for_evaluateFlowArrangement/when_evaluating_against_the_shared_fixture_corpus.js.map +0 -1
  222. package/dist/esm/for_evaluateFreeformArrangement/when_evaluating_against_the_shared_fixture_corpus.d.ts +0 -2
  223. package/dist/esm/for_evaluateFreeformArrangement/when_evaluating_against_the_shared_fixture_corpus.d.ts.map +0 -1
  224. package/dist/esm/for_evaluateFreeformArrangement/when_evaluating_against_the_shared_fixture_corpus.js +0 -46
  225. package/dist/esm/for_evaluateFreeformArrangement/when_evaluating_against_the_shared_fixture_corpus.js.map +0 -1
  226. package/dist/esm/for_evaluateFreeformSlotArrangement/when_evaluating_against_the_shared_fixture_corpus.d.ts +0 -2
  227. package/dist/esm/for_evaluateFreeformSlotArrangement/when_evaluating_against_the_shared_fixture_corpus.d.ts.map +0 -1
  228. package/dist/esm/for_evaluateFreeformSlotArrangement/when_evaluating_against_the_shared_fixture_corpus.js +0 -25
  229. package/dist/esm/for_evaluateFreeformSlotArrangement/when_evaluating_against_the_shared_fixture_corpus.js.map +0 -1
  230. package/dist/esm/for_incompatibleStarterThemes/when_checking_against_the_shared_fixture_corpus.d.ts +0 -2
  231. package/dist/esm/for_incompatibleStarterThemes/when_checking_against_the_shared_fixture_corpus.d.ts.map +0 -1
  232. package/dist/esm/for_incompatibleStarterThemes/when_checking_against_the_shared_fixture_corpus.js +0 -17
  233. package/dist/esm/for_incompatibleStarterThemes/when_checking_against_the_shared_fixture_corpus.js.map +0 -1
  234. package/dist/esm/for_packageCatalog/when_querying_against_the_shared_fixture_corpus.d.ts +0 -2
  235. package/dist/esm/for_packageCatalog/when_querying_against_the_shared_fixture_corpus.d.ts.map +0 -1
  236. package/dist/esm/for_packageCatalog/when_querying_against_the_shared_fixture_corpus.js +0 -22
  237. package/dist/esm/for_packageCatalog/when_querying_against_the_shared_fixture_corpus.js.map +0 -1
  238. package/dist/esm/for_packageDependencies/fixtures.d.ts +0 -38
  239. package/dist/esm/for_packageDependencies/fixtures.d.ts.map +0 -1
  240. package/dist/esm/for_packageDependencies/fixtures.js +0 -5
  241. package/dist/esm/for_packageDependencies/fixtures.js.map +0 -1
  242. package/dist/esm/for_packageDependencies/when_resolving_against_the_shared_fixture_corpus.d.ts +0 -2
  243. package/dist/esm/for_packageDependencies/when_resolving_against_the_shared_fixture_corpus.d.ts.map +0 -1
  244. package/dist/esm/for_packageDependencies/when_resolving_against_the_shared_fixture_corpus.js +0 -29
  245. package/dist/esm/for_packageDependencies/when_resolving_against_the_shared_fixture_corpus.js.map +0 -1
  246. package/dist/esm/for_packageVersionRange/when_checking_against_the_shared_fixture_corpus.d.ts +0 -2
  247. package/dist/esm/for_packageVersionRange/when_checking_against_the_shared_fixture_corpus.d.ts.map +0 -1
  248. package/dist/esm/for_packageVersionRange/when_checking_against_the_shared_fixture_corpus.js +0 -10
  249. package/dist/esm/for_packageVersionRange/when_checking_against_the_shared_fixture_corpus.js.map +0 -1
  250. package/dist/esm/for_panelKind/when_telling_the_panels_apart.d.ts +0 -2
  251. package/dist/esm/for_panelKind/when_telling_the_panels_apart.d.ts.map +0 -1
  252. package/dist/esm/for_panelKind/when_telling_the_panels_apart.js +0 -38
  253. package/dist/esm/for_panelKind/when_telling_the_panels_apart.js.map +0 -1
  254. package/dist/esm/for_renderElement/when_rendering_a_mixed_tree.d.ts +0 -2
  255. package/dist/esm/for_renderElement/when_rendering_a_mixed_tree.d.ts.map +0 -1
  256. package/dist/esm/for_renderElement/when_rendering_a_mixed_tree.js +0 -46
  257. package/dist/esm/for_renderElement/when_rendering_a_mixed_tree.js.map +0 -1
  258. package/dist/esm/for_resolveBehaviors/when_resolving_additive_attachments.d.ts +0 -2
  259. package/dist/esm/for_resolveBehaviors/when_resolving_additive_attachments.d.ts.map +0 -1
  260. package/dist/esm/for_resolveBehaviors/when_resolving_additive_attachments.js +0 -68
  261. package/dist/esm/for_resolveBehaviors/when_resolving_additive_attachments.js.map +0 -1
  262. package/dist/esm/for_resolveComponentName/when_resolving_against_the_shared_fixture_corpus.d.ts +0 -2
  263. package/dist/esm/for_resolveComponentName/when_resolving_against_the_shared_fixture_corpus.d.ts.map +0 -1
  264. package/dist/esm/for_resolveComponentName/when_resolving_against_the_shared_fixture_corpus.js +0 -20
  265. package/dist/esm/for_resolveComponentName/when_resolving_against_the_shared_fixture_corpus.js.map +0 -1
  266. package/dist/esm/for_resolveScreenTemplates/when_resolving_against_the_shared_fixture_corpus.d.ts +0 -2
  267. package/dist/esm/for_resolveScreenTemplates/when_resolving_against_the_shared_fixture_corpus.d.ts.map +0 -1
  268. package/dist/esm/for_resolveScreenTemplates/when_resolving_against_the_shared_fixture_corpus.js +0 -30
  269. package/dist/esm/for_resolveScreenTemplates/when_resolving_against_the_shared_fixture_corpus.js.map +0 -1
  270. package/dist/esm/for_resolveStrings/when_resolving_a_strings_reference.d.ts +0 -2
  271. package/dist/esm/for_resolveStrings/when_resolving_a_strings_reference.d.ts.map +0 -1
  272. package/dist/esm/for_resolveStrings/when_resolving_a_strings_reference.js +0 -69
  273. package/dist/esm/for_resolveStrings/when_resolving_a_strings_reference.js.map +0 -1
  274. package/dist/esm/for_runActions/given/a_recording_dispatcher.d.ts +0 -21
  275. package/dist/esm/for_runActions/given/a_recording_dispatcher.d.ts.map +0 -1
  276. package/dist/esm/for_runActions/given/a_recording_dispatcher.js +0 -45
  277. package/dist/esm/for_runActions/given/a_recording_dispatcher.js.map +0 -1
  278. package/dist/esm/for_runActions/when_running_a_sequence_of_actions.d.ts +0 -2
  279. package/dist/esm/for_runActions/when_running_a_sequence_of_actions.d.ts.map +0 -1
  280. package/dist/esm/for_runActions/when_running_a_sequence_of_actions.js +0 -126
  281. package/dist/esm/for_runActions/when_running_a_sequence_of_actions.js.map +0 -1
  282. package/dist/esm/for_runActions/when_running_against_the_shared_fixture_corpus.d.ts +0 -2
  283. package/dist/esm/for_runActions/when_running_against_the_shared_fixture_corpus.d.ts.map +0 -1
  284. package/dist/esm/for_runActions/when_running_against_the_shared_fixture_corpus.js +0 -61
  285. package/dist/esm/for_runActions/when_running_against_the_shared_fixture_corpus.js.map +0 -1
  286. package/dist/esm/for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.d.ts +0 -2
  287. package/dist/esm/for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.d.ts.map +0 -1
  288. package/dist/esm/for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.js +0 -18
  289. package/dist/esm/for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.js.map +0 -1
  290. package/for_aggregateContributions/when_aggregating_by_contribution_point.ts +0 -31
  291. package/for_buildStarterProfile/when_checking_against_the_shared_fixture_corpus.ts +0 -32
  292. package/for_computeSizeClass/when_computing_the_size_class.ts +0 -23
  293. package/for_evaluateFlowArrangement/when_evaluating_against_the_shared_fixture_corpus.ts +0 -67
  294. package/for_evaluateFreeformArrangement/when_evaluating_against_the_shared_fixture_corpus.ts +0 -68
  295. package/for_evaluateFreeformSlotArrangement/when_evaluating_against_the_shared_fixture_corpus.ts +0 -47
  296. package/for_incompatibleStarterThemes/when_checking_against_the_shared_fixture_corpus.ts +0 -34
  297. package/for_packageCatalog/when_querying_against_the_shared_fixture_corpus.ts +0 -26
  298. package/for_packageDependencies/fixtures.ts +0 -44
  299. package/for_packageDependencies/when_resolving_against_the_shared_fixture_corpus.ts +0 -39
  300. package/for_packageVersionRange/when_checking_against_the_shared_fixture_corpus.ts +0 -13
  301. package/for_panelKind/when_telling_the_panels_apart.ts +0 -47
  302. package/for_renderElement/when_rendering_a_mixed_tree.ts +0 -58
  303. package/for_resolveBehaviors/when_resolving_additive_attachments.ts +0 -100
  304. package/for_resolveComponentName/when_resolving_against_the_shared_fixture_corpus.ts +0 -36
  305. package/for_resolveScreenTemplates/when_resolving_against_the_shared_fixture_corpus.ts +0 -49
  306. package/for_resolveStrings/when_resolving_a_strings_reference.ts +0 -85
  307. package/for_runActions/given/a_recording_dispatcher.ts +0 -72
  308. package/for_runActions/when_running_a_sequence_of_actions.ts +0 -226
  309. package/for_runActions/when_running_against_the_shared_fixture_corpus.ts +0 -124
  310. package/for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.ts +0 -37
@@ -0,0 +1,114 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ function isRecord(value) {
8
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
9
+ }
10
+ function isNonEmptyString(value) {
11
+ return typeof value === 'string' && value.length > 0;
12
+ }
13
+ /**
14
+ * Checks a value against a property descriptor.
15
+ *
16
+ * @param descriptor The property the value is for.
17
+ * @param value The value to check. `undefined` means "not set", which is fine unless the property is required.
18
+ * @returns The reason the value is not acceptable, or `undefined` when it is.
19
+ */ function validateValue(descriptor, value) {
20
+ const constraints = descriptor.constraints ?? {};
21
+ if (value === undefined || value === null) {
22
+ return constraints.required ? 'a value is required' : undefined;
23
+ }
24
+ switch(descriptor.valueType){
25
+ case scene_model.PropertyValueType.String:
26
+ {
27
+ if (typeof value !== 'string') return 'expected a string';
28
+ if (constraints.minimumLength !== undefined && value.length < constraints.minimumLength) return `must be at least ${constraints.minimumLength} characters`;
29
+ if (constraints.maximumLength !== undefined && value.length > constraints.maximumLength) return `must be at most ${constraints.maximumLength} characters`;
30
+ if (constraints.pattern !== undefined && !new RegExp(`^(?:${constraints.pattern})$`).test(value)) return `must match ${constraints.pattern}`;
31
+ return undefined;
32
+ }
33
+ case scene_model.PropertyValueType.Number:
34
+ {
35
+ if (typeof value !== 'number' || !Number.isFinite(value)) return 'expected a number';
36
+ if (constraints.integer && !Number.isInteger(value)) return 'expected a whole number';
37
+ if (constraints.minimum !== undefined && value < constraints.minimum) return `must be at least ${constraints.minimum}`;
38
+ if (constraints.maximum !== undefined && value > constraints.maximum) return `must be at most ${constraints.maximum}`;
39
+ return undefined;
40
+ }
41
+ case scene_model.PropertyValueType.Boolean:
42
+ return typeof value === 'boolean' ? undefined : 'expected true or false';
43
+ case scene_model.PropertyValueType.Enum:
44
+ return (descriptor.choices ?? []).some((choice)=>choice.value === value) ? undefined : 'not one of the allowed choices';
45
+ case scene_model.PropertyValueType.Icon:
46
+ if (!isRecord(value) || !isNonEmptyString(value.library) || !isNonEmptyString(value.key)) return 'expected an icon reference with a library and a key';
47
+ return value.variant === undefined || typeof value.variant === 'string' ? undefined : 'the icon variant must be a string';
48
+ case scene_model.PropertyValueType.Destination:
49
+ if (!isRecord(value) || !isNonEmptyString(value.screen)) return 'expected a destination naming a screen';
50
+ return value.routeParameterBindings === undefined || isRecord(value.routeParameterBindings) ? undefined : 'routeParameterBindings must be an object';
51
+ case scene_model.PropertyValueType.QueryReference:
52
+ if (isNonEmptyString(value)) return undefined;
53
+ if (!isRecord(value) || !isNonEmptyString(value.queryId) || !isNonEmptyString(value.query)) return 'expected a query name or a query binding';
54
+ return Array.isArray(value.arguments) && Array.isArray(value.results) ? undefined : 'a query binding needs arguments and results lists';
55
+ case scene_model.PropertyValueType.Collection:
56
+ return validateCollection(descriptor, value);
57
+ default:
58
+ return isRecord(value) || Array.isArray(value) ? undefined : 'expected a structured value';
59
+ }
60
+ }
61
+ function validateCollection(descriptor, value) {
62
+ if (!Array.isArray(value)) return 'expected a list';
63
+ const constraints = descriptor.constraints ?? {};
64
+ if (constraints.minimumItems !== undefined && value.length < constraints.minimumItems) return `needs at least ${constraints.minimumItems} items`;
65
+ if (constraints.maximumItems !== undefined && value.length > constraints.maximumItems) return `allows at most ${constraints.maximumItems} items`;
66
+ const identities = new Set();
67
+ for (const item of value){
68
+ if (!isRecord(item) || !isNonEmptyString(item.id)) return 'every item needs an id';
69
+ if (identities.has(item.id)) return `the item id '${item.id}' is used twice`;
70
+ identities.add(item.id);
71
+ const { id: _identity, ...values } = item;
72
+ const problem = validateItemValues(descriptor.item, values).at(0);
73
+ if (problem) return `item '${item.id}': ${problem.field} ${problem.problem}`;
74
+ }
75
+ return undefined;
76
+ }
77
+ /**
78
+ * Checks a collection item's field values against the collection's item descriptor.
79
+ *
80
+ * @param itemDescriptor What the items look like.
81
+ * @param values The item's field values, keyed by field path.
82
+ * @returns Every field that is unknown or has an unacceptable value.
83
+ */ function validateItemValues(itemDescriptor, values) {
84
+ const fields = itemDescriptor?.properties ?? [];
85
+ const problems = [];
86
+ for (const [field, fieldValue] of Object.entries(values)){
87
+ const fieldDescriptor = fields.find((candidate)=>candidate.path === field);
88
+ if (!fieldDescriptor) {
89
+ problems.push({
90
+ field,
91
+ problem: 'is not a field of this collection\'s items'
92
+ });
93
+ continue;
94
+ }
95
+ const problem = validateValue(fieldDescriptor, fieldValue);
96
+ if (problem) problems.push({
97
+ field,
98
+ problem
99
+ });
100
+ }
101
+ for (const fieldDescriptor of fields){
102
+ if (fieldDescriptor.constraints?.required && values[fieldDescriptor.path] === undefined) {
103
+ problems.push({
104
+ field: fieldDescriptor.path,
105
+ problem: 'a value is required'
106
+ });
107
+ }
108
+ }
109
+ return problems;
110
+ }
111
+
112
+ exports.validateItemValues = validateItemValues;
113
+ exports.validateValue = validateValue;
114
+ //# sourceMappingURL=validateValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateValue.js","sources":["../../../editing/validateValue.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CollectionItemDescriptor, PropertyDescriptor, PropertyValueType } from '@cratis/scene.model';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.length > 0;\n}\n\n/**\n * Checks a value against a property descriptor.\n *\n * @param descriptor The property the value is for.\n * @param value The value to check. `undefined` means \"not set\", which is fine unless the property is required.\n * @returns The reason the value is not acceptable, or `undefined` when it is.\n */\nexport function validateValue(descriptor: PropertyDescriptor, value: unknown): string | undefined {\n const constraints = descriptor.constraints ?? {};\n if (value === undefined || value === null) {\n return constraints.required ? 'a value is required' : undefined;\n }\n\n switch (descriptor.valueType) {\n case PropertyValueType.String: {\n if (typeof value !== 'string') return 'expected a string';\n if (constraints.minimumLength !== undefined && value.length < constraints.minimumLength) return `must be at least ${constraints.minimumLength} characters`;\n if (constraints.maximumLength !== undefined && value.length > constraints.maximumLength) return `must be at most ${constraints.maximumLength} characters`;\n if (constraints.pattern !== undefined && !new RegExp(`^(?:${constraints.pattern})$`).test(value)) return `must match ${constraints.pattern}`;\n return undefined;\n }\n\n case PropertyValueType.Number: {\n if (typeof value !== 'number' || !Number.isFinite(value)) return 'expected a number';\n if (constraints.integer && !Number.isInteger(value)) return 'expected a whole number';\n if (constraints.minimum !== undefined && value < constraints.minimum) return `must be at least ${constraints.minimum}`;\n if (constraints.maximum !== undefined && value > constraints.maximum) return `must be at most ${constraints.maximum}`;\n return undefined;\n }\n\n case PropertyValueType.Boolean:\n return typeof value === 'boolean' ? undefined : 'expected true or false';\n\n case PropertyValueType.Enum:\n return (descriptor.choices ?? []).some(choice => choice.value === value) ? undefined : 'not one of the allowed choices';\n\n case PropertyValueType.Icon:\n if (!isRecord(value) || !isNonEmptyString(value.library) || !isNonEmptyString(value.key)) return 'expected an icon reference with a library and a key';\n return value.variant === undefined || typeof value.variant === 'string' ? undefined : 'the icon variant must be a string';\n\n case PropertyValueType.Destination:\n if (!isRecord(value) || !isNonEmptyString(value.screen)) return 'expected a destination naming a screen';\n return value.routeParameterBindings === undefined || isRecord(value.routeParameterBindings)\n ? undefined\n : 'routeParameterBindings must be an object';\n\n case PropertyValueType.QueryReference:\n if (isNonEmptyString(value)) return undefined;\n if (!isRecord(value) || !isNonEmptyString(value.queryId) || !isNonEmptyString(value.query)) return 'expected a query name or a query binding';\n return Array.isArray(value.arguments) && Array.isArray(value.results) ? undefined : 'a query binding needs arguments and results lists';\n\n case PropertyValueType.Collection:\n return validateCollection(descriptor, value);\n\n default:\n return isRecord(value) || Array.isArray(value) ? undefined : 'expected a structured value';\n }\n}\n\nfunction validateCollection(descriptor: PropertyDescriptor, value: unknown): string | undefined {\n if (!Array.isArray(value)) return 'expected a list';\n const constraints = descriptor.constraints ?? {};\n if (constraints.minimumItems !== undefined && value.length < constraints.minimumItems) return `needs at least ${constraints.minimumItems} items`;\n if (constraints.maximumItems !== undefined && value.length > constraints.maximumItems) return `allows at most ${constraints.maximumItems} items`;\n\n const identities = new Set<string>();\n for (const item of value) {\n if (!isRecord(item) || !isNonEmptyString(item.id)) return 'every item needs an id';\n if (identities.has(item.id)) return `the item id '${item.id}' is used twice`;\n identities.add(item.id);\n\n const { id: _identity, ...values } = item;\n const problem = validateItemValues(descriptor.item, values).at(0);\n if (problem) return `item '${item.id}': ${problem.field} ${problem.problem}`;\n }\n\n return undefined;\n}\n\n/**\n * One field of a collection item that does not fit its descriptor.\n */\nexport interface ItemFieldProblem {\n field: string;\n problem: string;\n}\n\n/**\n * Checks a collection item's field values against the collection's item descriptor.\n *\n * @param itemDescriptor What the items look like.\n * @param values The item's field values, keyed by field path.\n * @returns Every field that is unknown or has an unacceptable value.\n */\nexport function validateItemValues(itemDescriptor: CollectionItemDescriptor | undefined, values: Record<string, unknown>): ItemFieldProblem[] {\n const fields = itemDescriptor?.properties ?? [];\n const problems: ItemFieldProblem[] = [];\n\n for (const [field, fieldValue] of Object.entries(values)) {\n const fieldDescriptor = fields.find(candidate => candidate.path === field);\n if (!fieldDescriptor) {\n problems.push({ field, problem: 'is not a field of this collection\\'s items' });\n continue;\n }\n\n const problem = validateValue(fieldDescriptor, fieldValue);\n if (problem) problems.push({ field, problem });\n }\n\n for (const fieldDescriptor of fields) {\n if (fieldDescriptor.constraints?.required && values[fieldDescriptor.path] === undefined) {\n problems.push({ field: fieldDescriptor.path, problem: 'a value is required' });\n }\n }\n\n return problems;\n}\n"],"names":["isRecord","value","Array","isArray","isNonEmptyString","length","validateValue","descriptor","constraints","undefined","required","valueType","PropertyValueType","String","minimumLength","maximumLength","pattern","RegExp","test","Number","isFinite","integer","isInteger","minimum","maximum","Boolean","Enum","choices","some","choice","Icon","library","key","variant","Destination","screen","routeParameterBindings","QueryReference","queryId","query","arguments","results","Collection","validateCollection","minimumItems","maximumItems","identities","Set","item","id","has","add","_identity","values","problem","validateItemValues","at","field","itemDescriptor","fields","properties","problems","fieldValue","Object","entries","fieldDescriptor","find","candidate","path","push"],"mappings":";;;;AAAA;AACA;AAIA,SAASA,SAASC,KAAc,EAAA;IAC5B,OAAOA,KAAAA,KAAU,QAAQ,OAAOA,KAAAA,KAAU,YAAY,CAACC,KAAAA,CAAMC,OAAO,CAACF,KAAAA,CAAAA;AACzE;AAEA,SAASG,iBAAiBH,KAAc,EAAA;AACpC,IAAA,OAAO,OAAOA,KAAAA,KAAU,QAAA,IA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AAI,CAACQ,eAAAA,EAAiB;AAClBJ,YAAAA,QAAAA,CAASQ,IAAI,CAAC;AAAEZ,gBAAAA,KAAAA;gBAAOH,OAAAA,EAAS;AAA6C,aAAA,CAAA;AAC7E,YAAA;AACJ,QAAA;QAEA,MAAMA,OAAAA,GAAUhD,cAAc2D,eAAAA,EAAiBH,UAAAA,CAAAA;QAC/C,IAAIR,OAAAA,EAASO,QAAAA,CAASQ,IAAI,CAAC;AAAEZ,YAAAA,KAAAA;AAAOH,YAAAA;AAAQ,SAAA,CAAA;AAChD,IAAA;IAEA,KAAK,MAAMW,mBAAmBN,MAAAA,CAAQ;QAClC,IAAIM,eAAAA,CAAgBzD,WAAW,EAAEE,QAAAA,IAAY2C,MAAM,CAACY,eAAAA,CAAgBG,IAAI,CAAC,KAAK3D,SAAAA,EAAW;AACrFoD,YAAAA,QAAAA,CAASQ,IAAI,CAAC;AAAEZ,gBAAAA,KAAAA,EAAOQ,gBAAgBG,IAAI;gBAAEd,OAAAA,EAAS;AAAsB,aAAA,CAAA;AAChF,QAAA;AACJ,IAAA;IAEA,OAAOO,QAAAA;AACX;;;"}
package/dist/cjs/index.js CHANGED
@@ -21,6 +21,20 @@ var incompatibleStarterThemes = require('./incompatibleStarterThemes.js');
21
21
  var runActions = require('./runActions.js');
22
22
  var resolveBehaviors = require('./resolveBehaviors.js');
23
23
  var resolveStrings = require('./resolveStrings.js');
24
+ var diagnostics = require('./editing/diagnostics.js');
25
+ var nodeIds = require('./editing/nodeIds.js');
26
+ var layoutTypeDescriptors = require('./editing/layoutTypeDescriptors.js');
27
+ var DescriptorCatalog = require('./editing/DescriptorCatalog.js');
28
+ var validateValue = require('./editing/validateValue.js');
29
+ var validateBinding = require('./editing/validateBinding.js');
30
+ var collectComponents = require('./editing/collectComponents.js');
31
+ var resolveTemplateChain = require('./editing/resolveTemplateChain.js');
32
+ var exposureGrants = require('./editing/exposureGrants.js');
33
+ var resolveEffectiveConfiguration = require('./editing/resolveEffectiveConfiguration.js');
34
+ var applyEffectiveConfiguration = require('./editing/applyEffectiveConfiguration.js');
35
+ var indexDocument = require('./editing/indexDocument.js');
36
+ var inspect = require('./editing/inspect.js');
37
+ var applyEdit = require('./editing/applyEdit.js');
24
38
 
25
39
 
26
40
 
@@ -75,4 +89,41 @@ exports.resolveIntervalBehaviors = resolveBehaviors.resolveIntervalBehaviors;
75
89
  exports.isStringsReference = resolveStrings.isStringsReference;
76
90
  exports.resolveStringsInElement = resolveStrings.resolveStringsInElement;
77
91
  exports.resolveStringsValue = resolveStrings.resolveStringsValue;
92
+ exports.errorDiagnostic = diagnostics.errorDiagnostic;
93
+ exports.hasErrors = diagnostics.hasErrors;
94
+ exports.warningDiagnostic = diagnostics.warningDiagnostic;
95
+ exports.dialogTemplateNodeId = nodeIds.dialogTemplateNodeId;
96
+ exports.elementNodeId = nodeIds.elementNodeId;
97
+ exports.flowNodeId = nodeIds.flowNodeId;
98
+ exports.freeformNodeId = nodeIds.freeformNodeId;
99
+ exports.layoutNodeId = nodeIds.layoutNodeId;
100
+ exports.ownerArrangementId = nodeIds.ownerArrangementId;
101
+ exports.placementNodeId = nodeIds.placementNodeId;
102
+ exports.scopeInstanceId = nodeIds.scopeInstanceId;
103
+ exports.scopeNodeId = nodeIds.scopeNodeId;
104
+ exports.screenNodeId = nodeIds.screenNodeId;
105
+ exports.screenTemplateNodeId = nodeIds.screenTemplateNodeId;
106
+ exports.slotNodeId = nodeIds.slotNodeId;
107
+ exports.layoutTypeDescriptors = layoutTypeDescriptors.layoutTypeDescriptors;
108
+ exports.placementProperties = layoutTypeDescriptors.placementProperties;
109
+ exports.templateProperties = layoutTypeDescriptors.templateProperties;
110
+ exports.createDescriptorCatalog = DescriptorCatalog.createDescriptorCatalog;
111
+ exports.findComponentDescriptor = DescriptorCatalog.findComponentDescriptor;
112
+ exports.findLayoutTypeDescriptor = DescriptorCatalog.findLayoutTypeDescriptor;
113
+ exports.validateItemValues = validateValue.validateItemValues;
114
+ exports.validateValue = validateValue.validateValue;
115
+ exports.areTypesCompatible = validateBinding.areTypesCompatible;
116
+ exports.validateBinding = validateBinding.validateBinding;
117
+ exports.collectComponents = collectComponents.collectComponents;
118
+ exports.resolveTemplateChain = resolveTemplateChain.resolveTemplateChain;
119
+ exports.computeExposureGrants = exposureGrants.computeExposureGrants;
120
+ exports.grantKey = exposureGrants.grantKey;
121
+ exports.resolveEffectiveConfiguration = resolveEffectiveConfiguration.resolveEffectiveConfiguration;
122
+ exports.applyEffectiveConfiguration = applyEffectiveConfiguration.applyEffectiveConfiguration;
123
+ exports.flowLayoutType = indexDocument.flowLayoutType;
124
+ exports.indexDocument = indexDocument.indexDocument;
125
+ exports.panelLayoutType = indexDocument.panelLayoutType;
126
+ exports.inspect = inspect.inspect;
127
+ exports.provenanceOf = inspect.provenanceOf;
128
+ exports.applyEdit = applyEdit.applyEdit;
78
129
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ import { ComponentDescriptor, LayoutTypeDescriptor } from '@cratis/scene.model';
2
+ export interface DescriptorCatalog {
3
+ components: ComponentDescriptor[];
4
+ layoutTypes: LayoutTypeDescriptor[];
5
+ }
6
+ export declare function createDescriptorCatalog(componentDescriptors?: ComponentDescriptor[]): DescriptorCatalog;
7
+ export declare function findComponentDescriptor(catalog: DescriptorCatalog, componentName: string): ComponentDescriptor | undefined;
8
+ export declare function findLayoutTypeDescriptor(catalog: DescriptorCatalog, type: string): LayoutTypeDescriptor | undefined;
9
+ //# sourceMappingURL=DescriptorCatalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DescriptorCatalog.d.ts","sourceRoot":"","sources":["../../../editing/DescriptorCatalog.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAUhF,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAQD,wBAAgB,uBAAuB,CAAC,oBAAoB,GAAE,mBAAmB,EAAO,GAAG,iBAAiB,CAK3G;AAQD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAM1H;AAKD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAEnH"}
@@ -0,0 +1,38 @@
1
+ import { layoutTypeDescriptors } from './layoutTypeDescriptors.js';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * Builds a catalog from the component descriptors of the active packages, plus the built-in layout types.
7
+ *
8
+ * When two descriptors name the same component the later one wins, which is the same override-priority rule
9
+ * the profile's package order already means for components.
10
+ */ function createDescriptorCatalog(componentDescriptors = []) {
11
+ const byComponent = new Map();
12
+ for (const descriptor of componentDescriptors)byComponent.set(descriptor.component, descriptor);
13
+ return {
14
+ components: [
15
+ ...byComponent.values()
16
+ ],
17
+ layoutTypes: layoutTypeDescriptors
18
+ };
19
+ }
20
+ /**
21
+ * Finds the descriptor of a component by the name an element carries.
22
+ *
23
+ * An exact match wins. Otherwise a bare name (`dataTable`) finds the one descriptor whose component ends in
24
+ * `:dataTable`; a bare name that several packages describe has no single answer, so it finds none.
25
+ */ function findComponentDescriptor(catalog, componentName) {
26
+ const exact = catalog.components.find((descriptor)=>descriptor.component === componentName);
27
+ if (exact) return exact;
28
+ const matches = catalog.components.filter((descriptor)=>descriptor.component.endsWith(`:${componentName}`));
29
+ return matches.length === 1 ? matches[0] : undefined;
30
+ }
31
+ /**
32
+ * Finds the descriptor of a layout type.
33
+ */ function findLayoutTypeDescriptor(catalog, type) {
34
+ return catalog.layoutTypes.find((descriptor)=>descriptor.type === type);
35
+ }
36
+
37
+ export { createDescriptorCatalog, findComponentDescriptor, findLayoutTypeDescriptor };
38
+ //# sourceMappingURL=DescriptorCatalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DescriptorCatalog.js","sources":["../../../editing/DescriptorCatalog.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentDescriptor, LayoutTypeDescriptor } from '@cratis/scene.model';\nimport { layoutTypeDescriptors } from './layoutTypeDescriptors';\n\n/**\n * Everything an editor knows how to describe: the component descriptors packages contribute, and the layout types\n * the model itself defines.\n *\n * It is a derived view over what packages ship - not a registry anything registers into. Build one from the\n * descriptors of the packages a profile lists, and rebuild it when the list changes.\n */\nexport interface DescriptorCatalog {\n components: ComponentDescriptor[];\n layoutTypes: LayoutTypeDescriptor[];\n}\n\n/**\n * Builds a catalog from the component descriptors of the active packages, plus the built-in layout types.\n *\n * When two descriptors name the same component the later one wins, which is the same override-priority rule\n * the profile's package order already means for components.\n */\nexport function createDescriptorCatalog(componentDescriptors: ComponentDescriptor[] = []): DescriptorCatalog {\n const byComponent = new Map<string, ComponentDescriptor>();\n for (const descriptor of componentDescriptors) byComponent.set(descriptor.component, descriptor);\n\n return { components: [...byComponent.values()], layoutTypes: layoutTypeDescriptors };\n}\n\n/**\n * Finds the descriptor of a component by the name an element carries.\n *\n * An exact match wins. Otherwise a bare name (`dataTable`) finds the one descriptor whose component ends in\n * `:dataTable`; a bare name that several packages describe has no single answer, so it finds none.\n */\nexport function findComponentDescriptor(catalog: DescriptorCatalog, componentName: string): ComponentDescriptor | undefined {\n const exact = catalog.components.find(descriptor => descriptor.component === componentName);\n if (exact) return exact;\n\n const matches = catalog.components.filter(descriptor => descriptor.component.endsWith(`:${componentName}`));\n return matches.length === 1 ? matches[0] : undefined;\n}\n\n/**\n * Finds the descriptor of a layout type.\n */\nexport function findLayoutTypeDescriptor(catalog: DescriptorCatalog, type: string): LayoutTypeDescriptor | undefined {\n return catalog.layoutTypes.find(descriptor => descriptor.type === type);\n}\n"],"names":["createDescriptorCatalog","componentDescriptors","byComponent","Map","descriptor","set","component","components","values","layoutTypes","layoutTypeDescriptors","findComponentDescriptor","catalog","componentName","exact","find","matches","filter","endsWith","length","undefined","findLayoutTypeDescriptor","type"],"mappings":";;AAAA;AACA;AAiBA;;;;;AAKC,IACM,SAASA,uBAAAA,CAAwBC,oBAAAA,GAA8C,EAAE,EAAA;AACpF,IAAA,MAAMC,cAAc,IAAIC,GAAAA,EAAAA;IACxB,KAAK,MAAMC,cAAcH,oBAAAA,CAAsBC,WAAAA,CAAYG,GAAG,CAACD,UAAAA,CAAWE,SAAS,EAAEF,UAAAA,CAAAA;IAErF,OAAO;QAAEG,UAAAA,EAAY;AAAIL,YAAAA,GAAAA,WAAAA,CAAYM,MAAM;AAAG,SAAA;QAAEC,WAAAA,EAAaC;AAAsB,KAAA;AACvF;AAEA;;;;;AAKC,IACM,SAASC,uBAAAA,CAAwBC,OAA0B,EAAEC,aAAqB,EAAA;IACrF,MAAMC,KAAAA,GAAQF,OAAAA,CAAQL,UAAU,CAACQ,IAAI,CAACX,CAAAA,UAAAA,GAAcA,UAAAA,CAAWE,SAAS,KAAKO,aAAAA,CAAAA;AAC7E,IAAA,IAAIC,OAAO,OAAOA,KAAAA;AAElB,IAAA,MAAME,UAAUJ,OAAAA,CAAQL,UAAU,CAACU,MAAM,CAACb,CAAAA,UAAAA,GAAcA,UAAAA,CAAWE,SAAS,CAACY,QAAQ,CAAC,CAAC,CAAC,EAAEL,aAAAA,CAAAA,CAAe,CAAA,CAAA;AACzG,IAAA,OAAOG,QAAQG,MAAM,KAAK,IAAIH,OAAO,CAAC,EAAE,GAAGI,SAAAA;AAC/C;AAEA;;AAEC,IACM,SAASC,wBAAAA,CAAyBT,OAA0B,EAAEU,IAAY,EAAA;IAC7E,OAAOV,OAAAA,CAAQH,WAAW,CAACM,IAAI,CAACX,CAAAA,UAAAA,GAAcA,UAAAA,CAAWkB,IAAI,KAAKA,IAAAA,CAAAA;AACtE;;"}
@@ -0,0 +1,31 @@
1
+ import { SceneDiagnostic, SceneNodeKind } from '@cratis/scene.model';
2
+ export type DocumentPath = (string | number)[];
3
+ export interface ListLocation {
4
+ path: DocumentPath;
5
+ index: number;
6
+ }
7
+ export interface NodeRecord {
8
+ id: string;
9
+ kind: SceneNodeKind;
10
+ typeId: string;
11
+ label: string;
12
+ path: DocumentPath;
13
+ value: unknown;
14
+ parentId?: string;
15
+ owner: string;
16
+ ownerKind: SceneNodeKind;
17
+ list?: ListLocation;
18
+ leafId?: string;
19
+ placementIds?: string[];
20
+ mirror?: {
21
+ prefix: DocumentPath;
22
+ others: DocumentPath[];
23
+ };
24
+ slotName?: string;
25
+ contentPath?: DocumentPath;
26
+ }
27
+ export interface DocumentIndex {
28
+ nodes: Map<string, NodeRecord>;
29
+ diagnostics: SceneDiagnostic[];
30
+ }
31
+ //# sourceMappingURL=DocumentIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentIndex.d.ts","sourceRoot":"","sources":["../../../editing/DocumentIndex.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKrE,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAK/C,MAAM,WAAW,YAAY;IAEzB,IAAI,EAAE,YAAY,CAAC;IAGnB,KAAK,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC;IAGpB,MAAM,EAAE,MAAM,CAAC;IAGf,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IAEf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,aAAa,CAAC;IAGzB,IAAI,CAAC,EAAE,YAAY,CAAC;IAGpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAMxB,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAG1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,YAAY,CAAC;CAC9B;AAKD,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/B,WAAW,EAAE,eAAe,EAAE,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DocumentIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentIndex.js","sourceRoot":"","sources":["../../../editing/DocumentIndex.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { SceneDiagnostic, SceneDocument } from '@cratis/scene.model';
2
+ export interface EditOutcome {
3
+ model: SceneDocument;
4
+ diagnostics: SceneDiagnostic[];
5
+ applied: boolean;
6
+ }
7
+ //# sourceMappingURL=EditOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditOutcome.d.ts","sourceRoot":"","sources":["../../../editing/EditOutcome.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKrE,MAAM,WAAW,WAAW;IAKxB,KAAK,EAAE,aAAa,CAAC;IAGrB,WAAW,EAAE,eAAe,EAAE,CAAC;IAG/B,OAAO,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditOutcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditOutcome.js","sourceRoot":"","sources":["../../../editing/EditOutcome.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { SceneDocument } from '@cratis/scene.model';
2
+ import { EditingContext } from './EditingContext';
3
+ import { DocumentIndex, NodeRecord } from './DocumentIndex';
4
+ import { ExposureGrant, ExposureGrants } from './exposureGrants';
5
+ import { TemplateChain } from './TemplateChain';
6
+ import { EffectiveConfiguration } from '@cratis/scene.model';
7
+ export declare class EditSession {
8
+ readonly document: SceneDocument;
9
+ readonly context: EditingContext;
10
+ readonly index: DocumentIndex;
11
+ readonly chain: TemplateChain;
12
+ readonly grants: ExposureGrants;
13
+ readonly configuration: EffectiveConfiguration;
14
+ constructor(document: SceneDocument, context: EditingContext);
15
+ get scopeInstance(): string | undefined;
16
+ get scopeGrants(): Map<string, ExposureGrant>;
17
+ isLocal(record: NodeRecord): boolean;
18
+ sourceOf(record: NodeRecord): string;
19
+ }
20
+ //# sourceMappingURL=EditSession.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditSession.d.ts","sourceRoot":"","sources":["../../../editing/EditSession.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAyB,MAAM,kBAAkB,CAAC;AAKxF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,qBAAa,WAAW;IAMR,QAAQ,CAAC,QAAQ,EAAE,aAAa;IAAE,QAAQ,CAAC,OAAO,EAAE,cAAc;IAL9E,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC;IAE/C,YAAqB,QAAQ,EAAE,aAAa,EAAW,OAAO,EAAE,cAAc,EAK7E;IAGD,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAGD,IAAI,WAAW,IAAI,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAE5C;IAGD,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAEnC;IAGD,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAEnC;CACJ"}
@@ -0,0 +1,42 @@
1
+ import { ProvenanceKind } from '@cratis/scene.model';
2
+ import { computeExposureGrants } from './exposureGrants.js';
3
+ import { indexDocument } from './indexDocument.js';
4
+ import { provenanceOf } from './inspect.js';
5
+ import { resolveEffectiveConfiguration } from './resolveEffectiveConfiguration.js';
6
+ import { resolveTemplateChain } from './resolveTemplateChain.js';
7
+
8
+ // Copyright (c) Cratis. All rights reserved.
9
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
10
+ /**
11
+ * Everything an edit needs to decide whether it is allowed, worked out once against the document as it was.
12
+ */ class EditSession {
13
+ document;
14
+ context;
15
+ index;
16
+ chain;
17
+ grants;
18
+ configuration;
19
+ constructor(document, context){
20
+ this.document = document;
21
+ this.context = context;
22
+ this.index = indexDocument(document);
23
+ this.chain = resolveTemplateChain(document, context.scope);
24
+ this.grants = computeExposureGrants(this.chain, context.catalog);
25
+ this.configuration = resolveEffectiveConfiguration(this.chain, document.instanceContributions, context.catalog);
26
+ }
27
+ /** The instance id the scope contributes as, or `undefined` when the scope was not found. */ get scopeInstance() {
28
+ return this.chain.levels.at(-1)?.instance;
29
+ }
30
+ /** What the scope's instance may configure on inherited components. */ get scopeGrants() {
31
+ return (this.scopeInstance === undefined ? undefined : this.grants.byInstance.get(this.scopeInstance)) ?? new Map();
32
+ }
33
+ /** Whether the scope itself owns the node. */ isLocal(record) {
34
+ return provenanceOf(record, this.chain, this.scopeGrants).kind === ProvenanceKind.Local;
35
+ }
36
+ /** Where an inherited node comes from, for a message. */ sourceOf(record) {
37
+ return record.owner;
38
+ }
39
+ }
40
+
41
+ export { EditSession };
42
+ //# sourceMappingURL=EditSession.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditSession.js","sources":["../../../editing/EditSession.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ProvenanceKind, SceneDocument } from '@cratis/scene.model';\nimport { EditingContext } from './EditingContext';\nimport { DocumentIndex, NodeRecord } from './DocumentIndex';\nimport { ExposureGrant, ExposureGrants, computeExposureGrants } from './exposureGrants';\nimport { indexDocument } from './indexDocument';\nimport { provenanceOf } from './inspect';\nimport { resolveEffectiveConfiguration } from './resolveEffectiveConfiguration';\nimport { resolveTemplateChain } from './resolveTemplateChain';\nimport { TemplateChain } from './TemplateChain';\nimport { EffectiveConfiguration } from '@cratis/scene.model';\n\n/**\n * Everything an edit needs to decide whether it is allowed, worked out once against the document as it was.\n */\nexport class EditSession {\n readonly index: DocumentIndex;\n readonly chain: TemplateChain;\n readonly grants: ExposureGrants;\n readonly configuration: EffectiveConfiguration;\n\n constructor(readonly document: SceneDocument, readonly context: EditingContext) {\n this.index = indexDocument(document);\n this.chain = resolveTemplateChain(document, context.scope);\n this.grants = computeExposureGrants(this.chain, context.catalog);\n this.configuration = resolveEffectiveConfiguration(this.chain, document.instanceContributions, context.catalog);\n }\n\n /** The instance id the scope contributes as, or `undefined` when the scope was not found. */\n get scopeInstance(): string | undefined {\n return this.chain.levels.at(-1)?.instance;\n }\n\n /** What the scope's instance may configure on inherited components. */\n get scopeGrants(): Map<string, ExposureGrant> {\n return (this.scopeInstance === undefined ? undefined : this.grants.byInstance.get(this.scopeInstance)) ?? new Map();\n }\n\n /** Whether the scope itself owns the node. */\n isLocal(record: NodeRecord): boolean {\n return provenanceOf(record, this.chain, this.scopeGrants).kind === ProvenanceKind.Local;\n }\n\n /** Where an inherited node comes from, for a message. */\n sourceOf(record: NodeRecord): string {\n return record.owner;\n }\n}\n"],"names":["EditSession","index","chain","grants","configuration","context","document","indexDocument","resolveTemplateChain","scope","computeExposureGrants","catalog","resolveEffectiveConfiguration","instanceContributions","scopeInstance","levels","at","instance","scopeGrants","undefined","byInstance","get","Map","isLocal","record","provenanceOf","kind","ProvenanceKind","Local","sourceOf","owner"],"mappings":";;;;;;;AAAA;AACA;AAaA;;AAEC,IACM,MAAMA,WAAAA,CAAAA;;;IACAC,KAAAA;IACAC,KAAAA;IACAC,MAAAA;IACAC,aAAAA;AAET,IAAA,WAAA,CAAY,QAAgC,EAAWC,OAAuB,CAAE;aAA3DC,QAAAA,GAAAA,QAAAA;aAAkCD,OAAAA,GAAAA,OAAAA;QACnD,IAAI,CAACJ,KAAK,GAAGM,aAAAA,CAAcD,QAAAA,CAAAA;AAC3B,QAAA,IAAI,CAACJ,KAAK,GAAGM,oBAAAA,CAAqBF,QAAAA,EAAUD,QAAQI,KAAK,CAAA;QACzD,IAAI,CAACN,MAAM,GAAGO,qBAAAA,CAAsB,IAAI,CAACR,KAAK,EAAEG,OAAAA,CAAQM,OAAO,CAAA;AAC/D,QAAA,IAAI,CAACP,aAAa,GAAGQ,6BAAAA,CAA8B,IAAI,CAACV,KAAK,EAAEI,QAAAA,CAASO,qBAAqB,EAAER,OAAAA,CAAQM,OAAO,CAAA;AAClH,IAAA;kGAGA,IAAIG,aAAAA,GAAoC;QACpC,OAAO,IAAI,CAACZ,KAAK,CAACa,MAAM,CAACC,EAAE,CAAC,EAAC,CAAA,EAAIC,QAAAA;AACrC,IAAA;4EAGA,IAAIC,WAAAA,GAA0C;QAC1C,OAAQ,CAAA,IAAI,CAACJ,aAAa,KAAKK,SAAAA,GAAYA,YAAY,IAAI,CAAChB,MAAM,CAACiB,UAAU,CAACC,GAAG,CAAC,IAAI,CAACP,aAAa,CAAA,KAAM,IAAIQ,GAAAA,EAAAA;AAClH,IAAA;mDAGAC,OAAAA,CAAQC,MAAkB,EAAW;AACjC,QAAA,OAAOC,YAAAA,CAAaD,MAAAA,EAAQ,IAAI,CAACtB,KAAK,EAAE,IAAI,CAACgB,WAAW,CAAA,CAAEQ,IAAI,KAAKC,eAAeC,KAAK;AAC3F,IAAA;8DAGAC,QAAAA,CAASL,MAAkB,EAAU;AACjC,QAAA,OAAOA,OAAOM,KAAK;AACvB,IAAA;AACJ;;"}
@@ -0,0 +1,8 @@
1
+ import { EditingScope, QueryCandidate } from '@cratis/scene.model';
2
+ import { DescriptorCatalog } from './DescriptorCatalog';
3
+ export interface EditingContext {
4
+ catalog: DescriptorCatalog;
5
+ scope: EditingScope;
6
+ queryCandidates?: QueryCandidate[];
7
+ }
8
+ //# sourceMappingURL=EditingContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditingContext.d.ts","sourceRoot":"","sources":["../../../editing/EditingContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,MAAM,WAAW,cAAc;IAE3B,OAAO,EAAE,iBAAiB,CAAC;IAG3B,KAAK,EAAE,YAAY,CAAC;IAMpB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EditingContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditingContext.js","sourceRoot":"","sources":["../../../editing/EditingContext.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { ExposedProperty, ExternalComponent, SceneDiagnostic, SceneNodeKind } from '@cratis/scene.model';
2
+ export interface TemplateChainLevel {
3
+ owner: string;
4
+ kind: SceneNodeKind;
5
+ instance: string;
6
+ elements: ExternalComponent[];
7
+ exposures: ExposedProperty[];
8
+ }
9
+ export interface TemplateChain {
10
+ levels: TemplateChainLevel[];
11
+ diagnostics: SceneDiagnostic[];
12
+ }
13
+ //# sourceMappingURL=TemplateChain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateChain.d.ts","sourceRoot":"","sources":["../../../editing/TemplateChain.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKzG,MAAM,WAAW,kBAAkB;IAE/B,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,aAAa,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAG9B,SAAS,EAAE,eAAe,EAAE,CAAC;CAChC;AAOD,MAAM,WAAW,aAAa;IAE1B,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAG7B,WAAW,EAAE,eAAe,EAAE,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TemplateChain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemplateChain.js","sourceRoot":"","sources":["../../../editing/TemplateChain.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { SceneDocument, SceneEdit } from '@cratis/scene.model';
2
+ import { EditOutcome } from './EditOutcome';
3
+ import { EditingContext } from './EditingContext';
4
+ export declare function applyEdit(model: SceneDocument, edit: SceneEdit, context: EditingContext): EditOutcome;
5
+ //# sourceMappingURL=applyEdit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyEdit.d.ts","sourceRoot":"","sources":["../../../editing/applyEdit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmC,aAAa,EAAE,SAAS,EAAiB,MAAM,qBAAqB,CAAC;AAE/G,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAqDlD,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,WAAW,CASrG"}
@@ -0,0 +1,81 @@
1
+ import { DiagnosticCode, SceneEditKind } from '@cratis/scene.model';
2
+ import { hasErrors, errorDiagnostic } from './diagnostics.js';
3
+ import { EditSession } from './EditSession.js';
4
+ import { applyUnexposeProperty, applyExposeProperty } from './exposureEdits.js';
5
+ import { applyEditCollectionItem, applyReorderCollectionItem, applyRemoveCollectionItem, applyAddCollectionItem, applyResetInstanceValue, applySetInstanceValue } from './instanceEdits.js';
6
+ import { applyChangeLayoutType } from './layoutTypeEdits.js';
7
+ import { cloneData } from './pathAccess.js';
8
+ import { applyResetProperty, applySetProperty } from './propertyEdits.js';
9
+ import { applyRemoveNode, applyMoveNode, applyInsertNode } from './structureEdits.js';
10
+
11
+ // Copyright (c) Cratis. All rights reserved.
12
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
13
+ function run(session, edit, clone, diagnostics) {
14
+ const handle = (handler)=>handler(session, edit, clone, diagnostics);
15
+ switch(edit.kind){
16
+ case SceneEditKind.SetProperty:
17
+ return handle(applySetProperty);
18
+ case SceneEditKind.ResetProperty:
19
+ return handle(applyResetProperty);
20
+ case SceneEditKind.ChangeLayoutType:
21
+ return handle(applyChangeLayoutType);
22
+ case SceneEditKind.InsertNode:
23
+ return handle(applyInsertNode);
24
+ case SceneEditKind.MoveNode:
25
+ return handle(applyMoveNode);
26
+ case SceneEditKind.RemoveNode:
27
+ return handle(applyRemoveNode);
28
+ case SceneEditKind.SetInstanceValue:
29
+ return handle(applySetInstanceValue);
30
+ case SceneEditKind.ResetInstanceValue:
31
+ return handle(applyResetInstanceValue);
32
+ case SceneEditKind.AddCollectionItem:
33
+ return handle(applyAddCollectionItem);
34
+ case SceneEditKind.RemoveCollectionItem:
35
+ return handle(applyRemoveCollectionItem);
36
+ case SceneEditKind.ReorderCollectionItem:
37
+ return handle(applyReorderCollectionItem);
38
+ case SceneEditKind.EditCollectionItem:
39
+ return handle(applyEditCollectionItem);
40
+ case SceneEditKind.ExposeProperty:
41
+ return handle(applyExposeProperty);
42
+ case SceneEditKind.UnexposeProperty:
43
+ return handle(applyUnexposeProperty);
44
+ default:
45
+ diagnostics.push(errorDiagnostic(DiagnosticCode.InvalidEdit, `'${edit.kind}' is not an edit this engine knows.`));
46
+ }
47
+ }
48
+ /**
49
+ * Applies one edit to a document.
50
+ *
51
+ * Pure and immutable: the document passed in is never changed, and the result is a new document. Edits are plain
52
+ * data, so a host can persist them and build undo and redo by keeping the documents either side. On any error the
53
+ * prior document comes back - the same object - together with the diagnostics, so a refused edit leaves nothing
54
+ * half done.
55
+ *
56
+ * What an edit may touch follows the editing scope. Nodes the scope owns are edited directly; inherited nodes are
57
+ * read-only, and their exposed properties are configured with the instance edits, which are checked against what
58
+ * each owner exposed.
59
+ *
60
+ * @param model The document to edit.
61
+ * @param edit What to do.
62
+ * @param context The catalog and the editing scope.
63
+ */ function applyEdit(model, edit, context) {
64
+ const session = new EditSession(model, context);
65
+ const clone = cloneData(model);
66
+ const diagnostics = [];
67
+ run(session, edit, clone, diagnostics);
68
+ if (hasErrors(diagnostics)) return {
69
+ model,
70
+ diagnostics,
71
+ applied: false
72
+ };
73
+ return {
74
+ model: clone,
75
+ diagnostics,
76
+ applied: true
77
+ };
78
+ }
79
+
80
+ export { applyEdit };
81
+ //# sourceMappingURL=applyEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyEdit.js","sources":["../../../editing/applyEdit.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCode, SceneDiagnostic, SceneDocument, SceneEdit, SceneEditKind } from '@cratis/scene.model';\nimport { errorDiagnostic, hasErrors } from './diagnostics';\nimport { EditOutcome } from './EditOutcome';\nimport { EditingContext } from './EditingContext';\nimport { EditSession } from './EditSession';\nimport { applyExposeProperty, applyUnexposeProperty } from './exposureEdits';\nimport {\n applyAddCollectionItem, applyEditCollectionItem, applyRemoveCollectionItem, applyReorderCollectionItem,\n applyResetInstanceValue, applySetInstanceValue,\n} from './instanceEdits';\nimport { applyChangeLayoutType } from './layoutTypeEdits';\nimport { cloneData } from './pathAccess';\nimport { applyResetProperty, applySetProperty } from './propertyEdits';\nimport { applyInsertNode, applyMoveNode, applyRemoveNode } from './structureEdits';\n\ntype Handler<TEdit extends SceneEdit> = (session: EditSession, edit: TEdit, clone: SceneDocument, diagnostics: SceneDiagnostic[]) => void;\n\nfunction run(session: EditSession, edit: SceneEdit, clone: SceneDocument, diagnostics: SceneDiagnostic[]): void {\n const handle = <TEdit extends SceneEdit>(handler: Handler<TEdit>) => handler(session, edit as TEdit, clone, diagnostics);\n\n switch (edit.kind) {\n case SceneEditKind.SetProperty: return handle(applySetProperty);\n case SceneEditKind.ResetProperty: return handle(applyResetProperty);\n case SceneEditKind.ChangeLayoutType: return handle(applyChangeLayoutType);\n case SceneEditKind.InsertNode: return handle(applyInsertNode);\n case SceneEditKind.MoveNode: return handle(applyMoveNode);\n case SceneEditKind.RemoveNode: return handle(applyRemoveNode);\n case SceneEditKind.SetInstanceValue: return handle(applySetInstanceValue);\n case SceneEditKind.ResetInstanceValue: return handle(applyResetInstanceValue);\n case SceneEditKind.AddCollectionItem: return handle(applyAddCollectionItem);\n case SceneEditKind.RemoveCollectionItem: return handle(applyRemoveCollectionItem);\n case SceneEditKind.ReorderCollectionItem: return handle(applyReorderCollectionItem);\n case SceneEditKind.EditCollectionItem: return handle(applyEditCollectionItem);\n case SceneEditKind.ExposeProperty: return handle(applyExposeProperty);\n case SceneEditKind.UnexposeProperty: return handle(applyUnexposeProperty);\n default:\n diagnostics.push(errorDiagnostic(DiagnosticCode.InvalidEdit, `'${(edit as { kind?: string }).kind}' is not an edit this engine knows.`));\n }\n}\n\n/**\n * Applies one edit to a document.\n *\n * Pure and immutable: the document passed in is never changed, and the result is a new document. Edits are plain\n * data, so a host can persist them and build undo and redo by keeping the documents either side. On any error the\n * prior document comes back - the same object - together with the diagnostics, so a refused edit leaves nothing\n * half done.\n *\n * What an edit may touch follows the editing scope. Nodes the scope owns are edited directly; inherited nodes are\n * read-only, and their exposed properties are configured with the instance edits, which are checked against what\n * each owner exposed.\n *\n * @param model The document to edit.\n * @param edit What to do.\n * @param context The catalog and the editing scope.\n */\nexport function applyEdit(model: SceneDocument, edit: SceneEdit, context: EditingContext): EditOutcome {\n const session = new EditSession(model, context);\n const clone = cloneData(model);\n const diagnostics: SceneDiagnostic[] = [];\n\n run(session, edit, clone, diagnostics);\n\n if (hasErrors(diagnostics)) return { model, diagnostics, applied: false };\n return { model: clone, diagnostics, applied: true };\n}\n"],"names":["run","session","edit","clone","diagnostics","handle","handler","kind","SceneEditKind","SetProperty","applySetProperty","ResetProperty","applyResetProperty","ChangeLayoutType","applyChangeLayoutType","InsertNode","applyInsertNode","MoveNode","applyMoveNode","RemoveNode","applyRemoveNode","SetInstanceValue","applySetInstanceValue","ResetInstanceValue","applyResetInstanceValue","AddCollectionItem","applyAddCollectionItem","RemoveCollectionItem","applyRemoveCollectionItem","ReorderCollectionItem","applyReorderCollectionItem","EditCollectionItem","applyEditCollectionItem","ExposeProperty","applyExposeProperty","UnexposeProperty","applyUnexposeProperty","push","errorDiagnostic","DiagnosticCode","InvalidEdit","applyEdit","model","context","EditSession","cloneData","hasErrors","applied"],"mappings":";;;;;;;;;;AAAA;AACA;AAmBA,SAASA,IAAIC,OAAoB,EAAEC,IAAe,EAAEC,KAAoB,EAAEC,WAA8B,EAAA;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,CAAO6B,mBAAAA,CAAAA;AACjD,QAAA,KAAK1B,cAAc2B,gBAAgB;AAAE,YAAA,OAAO9B,MAAAA,CAAO+B,qBAAAA,CAAAA;AACnD,QAAA;AACIhC,YAAAA,WAAAA,CAAYiC,IAAI,CAACC,eAAAA,CAAgBC,cAAAA,CAAeC,WAAW,EAAE,CAAC,CAAC,EAAE,IAACtC,CAA2BK,IAAI,CAAC,mCAAmC,CAAC,CAAA,CAAA;AAC9I;AACJ;AAEA;;;;;;;;;;;;;;;AAeC,IACM,SAASkC,SAAAA,CAAUC,KAAoB,EAAExC,IAAe,EAAEyC,OAAuB,EAAA;IACpF,MAAM1C,OAAAA,GAAU,IAAI2C,WAAAA,CAAYF,KAAAA,EAAOC,OAAAA,CAAAA;AACvC,IAAA,MAAMxC,QAAQ0C,SAAAA,CAAUH,KAAAA,CAAAA;AACxB,IAAA,MAAMtC,cAAiC,EAAE;IAEzCJ,GAAAA,CAAIC,OAAAA,EAASC,MAAMC,KAAAA,EAAOC,WAAAA,CAAAA;IAE1B,IAAI0C,SAAAA,CAAU1C,cAAc,OAAO;AAAEsC,QAAAA,KAAAA;AAAOtC,QAAAA,WAAAA;QAAa2C,OAAAA,EAAS;AAAM,KAAA;IACxE,OAAO;QAAEL,KAAAA,EAAOvC,KAAAA;AAAOC,QAAAA,WAAAA;QAAa2C,OAAAA,EAAS;AAAK,KAAA;AACtD;;"}
@@ -0,0 +1,3 @@
1
+ import { EffectiveConfiguration, SceneElement } from '@cratis/scene.model';
2
+ export declare function applyEffectiveConfiguration(element: SceneElement, configuration: EffectiveConfiguration): SceneElement;
3
+ //# sourceMappingURL=applyEffectiveConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyEffectiveConfiguration.d.ts","sourceRoot":"","sources":["../../../editing/applyEffectiveConfiguration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,sBAAsB,EAA0C,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAcnI,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,sBAAsB,GAAG,YAAY,CAmCtH"}