@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
@@ -1,61 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
3
- import { InteractionActionKind, InteractionTriggerKind, NotificationLevel } from '@cratis/scene.model';
4
- import { resolveBehaviors } from '../resolveBehaviors';
5
- import { InteractionStop, runActions } from '../runActions';
6
- import { pathEchoingContext, RecordingDispatcher } from './given/a_recording_dispatcher';
7
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'interaction-fixtures.json');
8
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8'));
9
- function attachment(fixture) {
10
- return {
11
- level: fixture.level,
12
- depth: fixture.depth,
13
- behaviors: fixture.behaviors.map(behavior => ({
14
- name: behavior.name ?? undefined,
15
- order: behavior.order,
16
- bindings: [
17
- {
18
- trigger: { kind: InteractionTriggerKind[behavior.trigger] },
19
- actions: [],
20
- },
21
- ],
22
- })),
23
- };
24
- }
25
- function action(fixture) {
26
- return {
27
- kind: InteractionActionKind[fixture.kind] ?? fixture.kind,
28
- command: fixture.command,
29
- query: fixture.query,
30
- screen: fixture.screen,
31
- dialogTemplate: fixture.dialogTemplate,
32
- level: fixture.level === undefined ? undefined : NotificationLevel[fixture.level],
33
- message: fixture.text === undefined ? undefined : { text: fixture.text },
34
- onSuccess: (fixture.onSuccess ?? []).map(action),
35
- onFailure: (fixture.onFailure ?? []).map(action),
36
- onResult: (fixture.onResult ?? []).map(action),
37
- };
38
- }
39
- function callsWithoutArguments(calls) {
40
- return calls.map(call => call.replace(/:\{.*\}$/, ''));
41
- }
42
- describe('when running against the shared fixture corpus', () => {
43
- for (const fixture of corpus.resolutionCases) {
44
- it(`should resolve the case where ${fixture.name}`, () => {
45
- const resolved = resolveBehaviors(fixture.attachments.map(attachment), InteractionTriggerKind[fixture.trigger]);
46
- resolved.map(candidate => candidate.behaviorName ?? null).should.eql(fixture.expected);
47
- });
48
- }
49
- for (const fixture of corpus.sequencingCases) {
50
- it(`should sequence the case where ${fixture.name}`, async () => {
51
- const dispatcher = new RecordingDispatcher();
52
- dispatcher.commandSucceeds = fixture.commandSucceeds;
53
- dispatcher.confirmAnswer = fixture.confirmAnswer;
54
- const run = await runActions(fixture.actions.map(action), dispatcher, pathEchoingContext);
55
- callsWithoutArguments(dispatcher.calls).should.eql(fixture.expectedCalls);
56
- run.stop.should.equal(InteractionStop[fixture.expectedStop]);
57
- run.findings.map(finding => finding.kind).should.eql(fixture.expectedFindings ?? []);
58
- });
59
- }
60
- });
61
- //# sourceMappingURL=when_running_against_the_shared_fixture_corpus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_running_against_the_shared_fixture_corpus.js","sourceRoot":"","sources":["../../../for_runActions/when_running_against_the_shared_fixture_corpus.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_checking_against_the_shared_fixture_corpus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_checking_against_the_shared_fixture_corpus.d.ts","sourceRoot":"","sources":["../../../for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
3
- import { applicableThemePackages, incompatiblePackages } from '../index';
4
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'theme-compatibility-fixtures.json');
5
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8'));
6
- describe('when checking against the shared fixture corpus', () => {
7
- for (const fixtureCase of corpus.cases) {
8
- const theme = { name: 'test-theme', compatibleWith: fixtureCase.theme.compatibleWith };
9
- const profile = { name: 'test-profile', targetPlatform: 'web', packages: fixtureCase.profile.packages };
10
- it(`should match the expected incompatible packages for "${fixtureCase.name}"`, () => {
11
- incompatiblePackages(theme, profile).should.deep.equal(fixtureCase.expectedIncompatible);
12
- });
13
- it(`should match the expected applicable packages for "${fixtureCase.name}"`, () => {
14
- applicableThemePackages(theme, profile).should.deep.equal(fixtureCase.expectedApplicable);
15
- });
16
- }
17
- });
18
- //# sourceMappingURL=when_checking_against_the_shared_fixture_corpus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_checking_against_the_shared_fixture_corpus.js","sourceRoot":"","sources":["../../../for_themeCompatibility/when_checking_against_the_shared_fixture_corpus.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAczE,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,mCAAmC,CAAC,CAAC;AAC5G,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAkB,CAAC;AAEhF,QAAQ,CAAC,iDAAiD,EAAE,GAAG,EAAE;IAC7D,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACrC,MAAM,KAAK,GAAU,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;QAC9F,MAAM,OAAO,GAAc,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEnH,EAAE,CAAC,wDAAwD,WAAW,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE;YACjF,oBAAoB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sDAAsD,WAAW,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE;YAC/E,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QAC9F,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,31 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { Contribution } from '@cratis/scene.model';
5
- import { aggregateContributions } from '../index';
6
-
7
- function contribution(contributionPointName: string, id: string, order?: number): Contribution {
8
- return { contributionPointName, content: { id, properties: {} }, order };
9
- }
10
-
11
- describe('when aggregating by contribution point', () => {
12
- it('should exclude contributions targeting a different contribution point', () => {
13
- const result = aggregateContributions([contribution('Navigation', 'a'), contribution('Toolbar', 'b')], 'Navigation');
14
- result.map(item => item.content.id).should.deep.equal(['a']);
15
- });
16
-
17
- it('should sort ordered contributions ascending by order', () => {
18
- const result = aggregateContributions([contribution('Navigation', 'second', 20), contribution('Navigation', 'first', 10)], 'Navigation');
19
- result.map(item => item.content.id).should.deep.equal(['first', 'second']);
20
- });
21
-
22
- it('should sort unordered contributions after every ordered one', () => {
23
- const result = aggregateContributions([contribution('Navigation', 'unordered'), contribution('Navigation', 'ordered', 10)], 'Navigation');
24
- result.map(item => item.content.id).should.deep.equal(['ordered', 'unordered']);
25
- });
26
-
27
- it('should preserve original relative order among unordered contributions', () => {
28
- const result = aggregateContributions([contribution('Navigation', 'first'), contribution('Navigation', 'second')], 'Navigation');
29
- result.map(item => item.content.id).should.deep.equal(['first', 'second']);
30
- });
31
- });
@@ -1,32 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- import { UiStarter } from '@cratis/scene.model';
7
- import { buildStarterProfile } from '../index';
8
-
9
- interface FixtureCase {
10
- name: string;
11
- starter: UiStarter;
12
- targetPlatform: string;
13
- expectedProfile: { name: string; targetPlatform: string; packages: string[] };
14
- }
15
-
16
- interface FixtureCorpus {
17
- profileCases: FixtureCase[];
18
- }
19
-
20
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'ui-starter-fixtures.json');
21
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8')) as FixtureCorpus;
22
-
23
- describe('when checking against the shared fixture corpus', () => {
24
- for (const fixtureCase of corpus.profileCases) {
25
- it(`should build the expected profile for "${fixtureCase.name}"`, () => {
26
- const profile = buildStarterProfile(fixtureCase.starter, fixtureCase.targetPlatform);
27
- profile.name.should.equal(fixtureCase.expectedProfile.name);
28
- profile.targetPlatform.should.equal(fixtureCase.expectedProfile.targetPlatform);
29
- profile.packages.should.deep.equal(fixtureCase.expectedProfile.packages);
30
- });
31
- }
32
- });
@@ -1,23 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { HeightSizeClass, WidthSizeClass } from '@cratis/scene.model';
5
- import { computeSizeClass, defaultHeightBreakpoint, defaultWidthBreakpoint } from '../index';
6
-
7
- describe('when computing the size class', () => {
8
- it('should be compact by compact below both breakpoints', () => {
9
- computeSizeClass(320, 480).should.deep.equal({ width: WidthSizeClass.Compact, height: HeightSizeClass.Compact });
10
- });
11
-
12
- it('should be regular width below height breakpoint only', () => {
13
- computeSizeClass(1024, 480).should.deep.equal({ width: WidthSizeClass.Regular, height: HeightSizeClass.Compact });
14
- });
15
-
16
- it('should be regular by regular at exactly both breakpoints', () => {
17
- computeSizeClass(defaultWidthBreakpoint, defaultHeightBreakpoint).should.deep.equal({ width: WidthSizeClass.Regular, height: HeightSizeClass.Regular });
18
- });
19
-
20
- it('should honor a custom breakpoint', () => {
21
- computeSizeClass(500, 500, 400).width.should.equal(WidthSizeClass.Regular);
22
- });
23
- });
@@ -1,67 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- import { ExternalComponent, FlowArrangement, FlowLeaf, FlowOverride, HeightSizeClass, HorizontalAlignment, SizeClass, VerticalAlignment, Visibility, WidthSizeClass } from '@cratis/scene.model';
7
- import { evaluateFlowArrangement } from '../index';
8
-
9
- interface FixtureOverride {
10
- width: WidthSizeClass | null;
11
- height: HeightSizeClass | null;
12
- tag: string;
13
- }
14
-
15
- interface FixtureCase {
16
- name: string;
17
- rootTag: string;
18
- overrides: FixtureOverride[];
19
- sizeClass: SizeClass;
20
- expectedTag: string;
21
- }
22
-
23
- interface FixtureCorpus {
24
- flowCases: FixtureCase[];
25
- }
26
-
27
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'layout-evaluation-fixtures.json');
28
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8')) as FixtureCorpus;
29
-
30
- function leaf(tag: string): FlowLeaf {
31
- const content: ExternalComponent = {
32
- id: tag,
33
- name: tag,
34
- properties: {},
35
- visibility: Visibility.Visible,
36
- isEnabled: true,
37
- opacity: 1,
38
- size: {},
39
- zIndex: 0,
40
- minimumSize: {},
41
- maximumSize: {},
42
- margin: { left: 0, top: 0, right: 0, bottom: 0 },
43
- horizontalAlignment: HorizontalAlignment.Stretch,
44
- verticalAlignment: VerticalAlignment.Stretch,
45
- componentName: 'core:text',
46
- slots: {},
47
- };
48
- return { content };
49
- }
50
-
51
- describe('when evaluating against the shared fixture corpus', () => {
52
- for (const fixtureCase of corpus.flowCases) {
53
- it(`should match the expected tag for "${fixtureCase.name}"`, () => {
54
- const arrangement: FlowArrangement = {
55
- root: leaf(fixtureCase.rootTag),
56
- overrides: fixtureCase.overrides.map((override): FlowOverride => ({
57
- width: override.width ?? undefined,
58
- height: override.height ?? undefined,
59
- root: leaf(override.tag),
60
- })),
61
- };
62
-
63
- const result = evaluateFlowArrangement(arrangement, fixtureCase.sizeClass) as FlowLeaf;
64
- (result.content as ExternalComponent).id.should.equal(fixtureCase.expectedTag);
65
- });
66
- }
67
- });
@@ -1,68 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- import { ElementPlacement, ExternalComponent, FreeformArrangement, HeightSizeClass, HorizontalAlignment, SizeClass, VerticalAlignment, Visibility, WidthSizeClass } from '@cratis/scene.model';
7
- import { evaluateFreeformArrangement } from '../index';
8
-
9
- interface FixtureVariant {
10
- width: WidthSizeClass;
11
- height: HeightSizeClass;
12
- tag: string;
13
- }
14
-
15
- interface FixtureCase {
16
- name: string;
17
- variants: FixtureVariant[];
18
- sizeClass: SizeClass;
19
- expectedTag: string | null;
20
- }
21
-
22
- interface FixtureCorpus {
23
- freeformCases: FixtureCase[];
24
- }
25
-
26
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'layout-evaluation-fixtures.json');
27
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8')) as FixtureCorpus;
28
-
29
- function placement(tag: string): ElementPlacement {
30
- const element: ExternalComponent = {
31
- id: tag,
32
- name: tag,
33
- properties: {},
34
- visibility: Visibility.Visible,
35
- isEnabled: true,
36
- opacity: 1,
37
- size: {},
38
- zIndex: 0,
39
- minimumSize: {},
40
- maximumSize: {},
41
- margin: { left: 0, top: 0, right: 0, bottom: 0 },
42
- horizontalAlignment: HorizontalAlignment.Stretch,
43
- verticalAlignment: VerticalAlignment.Stretch,
44
- componentName: 'core:text',
45
- slots: {},
46
- };
47
- return { element, x: 0, y: 0, width: 0, height: 0 };
48
- }
49
-
50
- describe('when evaluating against the shared fixture corpus', () => {
51
- for (const fixtureCase of corpus.freeformCases) {
52
- it(`should match the expected tag for "${fixtureCase.name}"`, () => {
53
- const arrangement: FreeformArrangement = {
54
- variants: fixtureCase.variants.map(variant => ({
55
- sizeClass: { width: variant.width, height: variant.height },
56
- placements: [placement(variant.tag)],
57
- })),
58
- };
59
-
60
- const result = evaluateFreeformArrangement(arrangement, fixtureCase.sizeClass);
61
- if (fixtureCase.expectedTag === null) {
62
- (result === undefined).should.be.true;
63
- } else {
64
- (result!.placements[0].element as ExternalComponent).id.should.equal(fixtureCase.expectedTag);
65
- }
66
- });
67
- }
68
- });
@@ -1,47 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- import { FreeformSlotArrangement, HeightSizeClass, SizeClass, WidthSizeClass } from '@cratis/scene.model';
7
- import { evaluateFreeformSlotArrangement } from '../index';
8
-
9
- interface FixtureVariant {
10
- width: WidthSizeClass;
11
- height: HeightSizeClass;
12
- tag: string;
13
- }
14
-
15
- interface FixtureCase {
16
- name: string;
17
- variants: FixtureVariant[];
18
- sizeClass: SizeClass;
19
- expectedTag: string | null;
20
- }
21
-
22
- interface FixtureCorpus {
23
- freeformCases: FixtureCase[];
24
- }
25
-
26
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'layout-evaluation-fixtures.json');
27
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8')) as FixtureCorpus;
28
-
29
- describe('when evaluating against the shared fixture corpus', () => {
30
- for (const fixtureCase of corpus.freeformCases) {
31
- it(`should match the expected tag for "${fixtureCase.name}"`, () => {
32
- const arrangement: FreeformSlotArrangement = {
33
- variants: fixtureCase.variants.map(variant => ({
34
- sizeClass: { width: variant.width, height: variant.height },
35
- placements: [{ slotName: variant.tag, x: 0, y: 0, width: 0, height: 0 }],
36
- })),
37
- };
38
-
39
- const result = evaluateFreeformSlotArrangement(arrangement, fixtureCase.sizeClass);
40
- if (fixtureCase.expectedTag === null) {
41
- (result === undefined).should.be.true;
42
- } else {
43
- result!.placements[0].slotName.should.equal(fixtureCase.expectedTag);
44
- }
45
- });
46
- }
47
- });
@@ -1,34 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- import { Theme, UiStarter } from '@cratis/scene.model';
7
- import { incompatibleStarterThemes } from '../index';
8
-
9
- interface FixtureCase {
10
- name: string;
11
- starter: UiStarter;
12
- themes: Record<string, Theme>;
13
- expectedIncompatible: string[];
14
- }
15
-
16
- interface FixtureCorpus {
17
- themeCases: FixtureCase[];
18
- }
19
-
20
- const manifestPath = join(import.meta.dirname, '..', '..', '..', '..', 'ui-starter-fixtures.json');
21
- const corpus = JSON.parse(readFileSync(manifestPath, 'utf-8')) as FixtureCorpus;
22
-
23
- describe('when checking against the shared fixture corpus', () => {
24
- for (const fixtureCase of corpus.themeCases) {
25
- const themes: Record<string, Theme> = {};
26
- for (const [themeName, theme] of Object.entries(fixtureCase.themes)) {
27
- themes[themeName] = { name: themeName, compatibleWith: theme.compatibleWith };
28
- }
29
-
30
- it(`should match the expected incompatible themes for "${fixtureCase.name}"`, () => {
31
- incompatibleStarterThemes(fixtureCase.starter, themes).should.deep.equal(fixtureCase.expectedIncompatible);
32
- });
33
- }
34
- });
@@ -1,26 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { availablePackagesFor, baseComponentLibraries, componentsForPackages } from '../index';
5
- import { CatalogFixtureCase, corpus } from '../for_packageDependencies/fixtures';
6
-
7
- function run(fixtureCase: CatalogFixtureCase): string[] {
8
- switch (fixtureCase.query) {
9
- case 'baseComponentLibraries':
10
- return baseComponentLibraries(corpus.catalog).map((scenePackage) => scenePackage.name);
11
- case 'availableFor':
12
- return availablePackagesFor(corpus.catalog, fixtureCase.selected ?? []).map((scenePackage) => scenePackage.name);
13
- case 'componentsFor':
14
- return componentsForPackages(corpus.catalog, fixtureCase.selected ?? []);
15
- default:
16
- throw new Error(`The fixture corpus asks for an unknown query '${fixtureCase.query}'`);
17
- }
18
- }
19
-
20
- describe('when querying against the shared fixture corpus', () => {
21
- for (const fixtureCase of corpus.catalogCases) {
22
- it(`should match the expected result for "${fixtureCase.name}"`, () => {
23
- run(fixtureCase).should.deep.equal(fixtureCase.expected);
24
- });
25
- }
26
- });
@@ -1,44 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { readFileSync } from 'node:fs';
5
- import { join } from 'node:path';
6
- import { ScenePackage } from '@cratis/scene.model';
7
-
8
- export interface ResolutionFixtureCase {
9
- name: string;
10
- selected: string[];
11
- expectedPackages: string[];
12
- expectedAdded: string[];
13
- expectedMissing: { package: string; dependsOn: string }[];
14
- expectedVersionConflicts: { package: string; dependsOn: string; requiredRange: string; actualVersion: string }[];
15
- expectedCycles: string[][];
16
- }
17
-
18
- export interface VersionRangeFixtureCase {
19
- version: string;
20
- range: string | null;
21
- expected: boolean;
22
- }
23
-
24
- export interface CatalogFixtureCase {
25
- name: string;
26
- query: string;
27
- selected?: string[];
28
- expected: string[];
29
- }
30
-
31
- interface FixtureCorpus {
32
- catalog: ScenePackage[];
33
- resolutionCases: ResolutionFixtureCase[];
34
- versionRangeCases: VersionRangeFixtureCase[];
35
- catalogCases: CatalogFixtureCase[];
36
- }
37
-
38
- const fixturePath = join(import.meta.dirname, '..', '..', '..', '..', 'package-dependency-fixtures.json');
39
-
40
- /**
41
- * The same corpus the C# specs read, so both languages resolve against an identical catalog rather than
42
- * two hand-written ones that can quietly diverge.
43
- */
44
- export const corpus = JSON.parse(readFileSync(fixturePath, 'utf-8')) as FixtureCorpus;
@@ -1,39 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { isPackageSelectionValid, resolvePackageDependencies } from '../index';
5
- import { corpus } from './fixtures';
6
-
7
- describe('when resolving against the shared fixture corpus', () => {
8
- for (const fixtureCase of corpus.resolutionCases) {
9
- const selection = resolvePackageDependencies(fixtureCase.selected, corpus.catalog);
10
-
11
- it(`should order the packages as expected for "${fixtureCase.name}"`, () => {
12
- selection.packages.should.deep.equal(fixtureCase.expectedPackages);
13
- });
14
-
15
- it(`should report the expected transitively added packages for "${fixtureCase.name}"`, () => {
16
- selection.added.should.deep.equal(fixtureCase.expectedAdded);
17
- });
18
-
19
- it(`should report the expected missing dependencies for "${fixtureCase.name}"`, () => {
20
- selection.missing.should.deep.equal(fixtureCase.expectedMissing);
21
- });
22
-
23
- it(`should report the expected version conflicts for "${fixtureCase.name}"`, () => {
24
- selection.versionConflicts.should.deep.equal(fixtureCase.expectedVersionConflicts);
25
- });
26
-
27
- it(`should report the expected cycles for "${fixtureCase.name}"`, () => {
28
- selection.cycles.should.deep.equal(fixtureCase.expectedCycles);
29
- });
30
-
31
- it(`should consider "${fixtureCase.name}" valid only when nothing is wrong`, () => {
32
- const expectedValid =
33
- fixtureCase.expectedMissing.length === 0 &&
34
- fixtureCase.expectedVersionConflicts.length === 0 &&
35
- fixtureCase.expectedCycles.length === 0;
36
- isPackageSelectionValid(selection).should.equal(expectedValid);
37
- });
38
- }
39
- });
@@ -1,13 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { isVersionSatisfiedBy } from '../index';
5
- import { corpus } from '../for_packageDependencies/fixtures';
6
-
7
- describe('when checking against the shared fixture corpus', () => {
8
- for (const fixtureCase of corpus.versionRangeCases) {
9
- it(`should decide ${fixtureCase.version} against '${fixtureCase.range ?? '<null>'}' the same way the corpus does`, () => {
10
- isVersionSatisfiedBy(fixtureCase.version, fixtureCase.range ?? undefined).should.equal(fixtureCase.expected);
11
- });
12
- }
13
- });
@@ -1,47 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { Canvas, DockPanel, Grid, HorizontalAlignment, Orientation, Panel, StackPanel, VerticalAlignment, Visibility, WrapPanel } from '@cratis/scene.model';
5
- import { isCanvas, isDockPanel, isGrid, isStackPanel, isWrapPanel } from '../index';
6
-
7
- const base = {
8
- id: 'panel',
9
- properties: {},
10
- visibility: Visibility.Visible,
11
- isEnabled: true,
12
- opacity: 1,
13
- zIndex: 0,
14
- size: {},
15
- name: 'panel',
16
- minimumSize: {},
17
- maximumSize: {},
18
- margin: { left: 0, top: 0, right: 0, bottom: 0 },
19
- horizontalAlignment: HorizontalAlignment.Stretch,
20
- verticalAlignment: VerticalAlignment.Stretch,
21
- children: [],
22
- };
23
-
24
- const canvas: Canvas = { ...base, extent: { width: 1280, height: 800 } };
25
- const grid: Grid = { ...base, rows: [], columns: [] };
26
- const dock: DockPanel = { ...base, lastChildFill: true };
27
- const stack: StackPanel = { ...base, orientation: Orientation.Vertical, spacing: 0 };
28
- const wrap: WrapPanel = { ...base, orientation: Orientation.Horizontal };
29
- const plain: Panel = { ...base };
30
-
31
- describe('when telling the panels apart', () => {
32
- it('should recognize a canvas by its extent', () => isCanvas(canvas).should.be.true);
33
- it('should recognize a grid by its tracks', () => isGrid(grid).should.be.true);
34
- it('should recognize a dock panel by its fill flag', () => isDockPanel(dock).should.be.true);
35
- it('should recognize a stack panel by its spacing', () => isStackPanel(stack).should.be.true);
36
- it('should recognize a wrap panel by an orientation with no spacing', () => isWrapPanel(wrap).should.be.true);
37
-
38
- it('should not mistake a stack panel for a wrap panel', () => isWrapPanel(stack).should.be.false);
39
- it('should not mistake a wrap panel for a stack panel', () => isStackPanel(wrap).should.be.false);
40
- it('should not mistake a grid for a dock panel', () => isDockPanel(grid).should.be.false);
41
- it('should not mistake a canvas for a grouping panel', () => isCanvas(plain).should.be.false);
42
- it('should leave a canvas unclaimed by the arranging guards', () =>
43
- [isGrid(canvas), isDockPanel(canvas), isStackPanel(canvas), isWrapPanel(canvas)].should.have.members([false, false, false, false]));
44
-
45
- it('should leave a plain panel unclaimed by every guard', () =>
46
- [isCanvas(plain), isGrid(plain), isDockPanel(plain), isStackPanel(plain), isWrapPanel(plain)].should.have.members([false, false, false, false, false]));
47
- });
@@ -1,58 +0,0 @@
1
- // Copyright (c) Cratis. All rights reserved.
2
- // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
-
4
- import { ContentControl, Control, ExternalComponent, HorizontalAlignment, ItemsControl, Panel, VerticalAlignment, Visibility } from '@cratis/scene.model';
5
- import { Renderer, renderElement } from '../index';
6
-
7
- function control(id: string): Control {
8
- return {
9
- id,
10
- name: id,
11
- properties: {},
12
- visibility: Visibility.Visible,
13
- isEnabled: true,
14
- opacity: 1,
15
- size: {},
16
- zIndex: 0,
17
- minimumSize: {},
18
- maximumSize: {},
19
- margin: { left: 0, top: 0, right: 0, bottom: 0 },
20
- horizontalAlignment: HorizontalAlignment.Stretch,
21
- verticalAlignment: VerticalAlignment.Stretch,
22
- borderThickness: { left: 0, top: 0, right: 0, bottom: 0 },
23
- padding: { left: 0, top: 0, right: 0, bottom: 0 },
24
- tabIndex: 0,
25
- };
26
- }
27
-
28
- class StringRenderer implements Renderer<string> {
29
- renderContentControl(element: ContentControl, content: string): string {
30
- return `ContentControl(${element.id})[${content}]`;
31
- }
32
-
33
- renderItemsControl(element: ItemsControl, items: string[]): string {
34
- return `ItemsControl(${element.id})[${items.join(',')}]`;
35
- }
36
-
37
- renderExternalComponent(element: ExternalComponent, slots: Record<string, string[]>): string {
38
- const slotsText = Object.entries(slots).map(([name, children]) => `${name}=${children.join(',')}`).join(';');
39
- return `ExternalComponent(${element.componentName})[${slotsText}]`;
40
- }
41
-
42
- renderPanel(element: Panel, children: string[]): string {
43
- return `Panel(${element.id})[${children.join(',')}]`;
44
- }
45
- }
46
-
47
- describe('when rendering a mixed tree', () => {
48
- const badge: ExternalComponent = { ...control('badge'), componentName: 'core:badge', slots: {} };
49
- const itemTemplate: ContentControl = { ...control('row'), content: badge };
50
- const items: ItemsControl = { ...control('items'), itemsSource: { path: 'rows' }, itemTemplate };
51
- const root: Panel = { ...control('root'), children: [items] };
52
-
53
- const output = renderElement(root, new StringRenderer(), binding => (binding.path === 'rows' ? [{}, {}] : []));
54
-
55
- it('should render the panel wrapping the items control', () => output.should.equal(
56
- 'Panel(root)[ItemsControl(items)[ContentControl(row)[ExternalComponent(core:badge)[]],ContentControl(row)[ExternalComponent(core:badge)[]]]]',
57
- ));
58
- });