@cratis/scene.blueprint.components 0.1.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 (332) hide show
  1. package/.storybook/main.ts +61 -0
  2. package/.storybook/preview.tsx +42 -0
  3. package/BorrowedComponentName.ts +22 -0
  4. package/ComponentName.ts +27 -0
  5. package/CompositeName.ts +97 -0
  6. package/README.md +40 -0
  7. package/componentsBlueprint.ts +72 -0
  8. package/componentsBlueprintComponents.ts +23 -0
  9. package/dist/cjs/BorrowedComponentName.js +25 -0
  10. package/dist/cjs/BorrowedComponentName.js.map +1 -0
  11. package/dist/cjs/ComponentName.js +30 -0
  12. package/dist/cjs/ComponentName.js.map +1 -0
  13. package/dist/cjs/CompositeName.js +52 -0
  14. package/dist/cjs/CompositeName.js.map +1 -0
  15. package/dist/cjs/componentsBlueprint.js +93 -0
  16. package/dist/cjs/componentsBlueprint.js.map +1 -0
  17. package/dist/cjs/componentsBlueprintComponents.js +27 -0
  18. package/dist/cjs/componentsBlueprintComponents.js.map +1 -0
  19. package/dist/cjs/gallery/DialogTemplatePreview.js +46 -0
  20. package/dist/cjs/gallery/DialogTemplatePreview.js.map +1 -0
  21. package/dist/cjs/gallery/GalleryScreenPreview.js +65 -0
  22. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
  23. package/dist/cjs/gallery/applicationChrome.js +137 -0
  24. package/dist/cjs/gallery/applicationChrome.js.map +1 -0
  25. package/dist/cjs/gallery/navigation.js +128 -0
  26. package/dist/cjs/gallery/navigation.js.map +1 -0
  27. package/dist/cjs/gallery/previewProfile.js +87 -0
  28. package/dist/cjs/gallery/previewProfile.js.map +1 -0
  29. package/dist/cjs/gallery/screens.js +80 -0
  30. package/dist/cjs/gallery/screens.js.map +1 -0
  31. package/dist/cjs/header/ArcPageHeader.js +65 -0
  32. package/dist/cjs/header/ArcPageHeader.js.map +1 -0
  33. package/dist/cjs/header/deriveArcHeading.js +51 -0
  34. package/dist/cjs/header/deriveArcHeading.js.map +1 -0
  35. package/dist/cjs/header/humanizeBindingName.js +36 -0
  36. package/dist/cjs/header/humanizeBindingName.js.map +1 -0
  37. package/dist/cjs/index.js +119 -0
  38. package/dist/cjs/index.js.map +1 -0
  39. package/dist/cjs/package.json +3 -0
  40. package/dist/cjs/packageName.js +15 -0
  41. package/dist/cjs/packageName.js.map +1 -0
  42. package/dist/cjs/templates/SampleBindingName.js +39 -0
  43. package/dist/cjs/templates/SampleBindingName.js.map +1 -0
  44. package/dist/cjs/templates/commandTemplates.js +82 -0
  45. package/dist/cjs/templates/commandTemplates.js.map +1 -0
  46. package/dist/cjs/templates/dataElements.js +131 -0
  47. package/dist/cjs/templates/dataElements.js.map +1 -0
  48. package/dist/cjs/templates/dialogElements.js +69 -0
  49. package/dist/cjs/templates/dialogElements.js.map +1 -0
  50. package/dist/cjs/templates/dialogTemplates.js +118 -0
  51. package/dist/cjs/templates/dialogTemplates.js.map +1 -0
  52. package/dist/cjs/templates/editorElements.js +81 -0
  53. package/dist/cjs/templates/editorElements.js.map +1 -0
  54. package/dist/cjs/templates/editorTemplates.js +172 -0
  55. package/dist/cjs/templates/editorTemplates.js.map +1 -0
  56. package/dist/cjs/templates/elements.js +101 -0
  57. package/dist/cjs/templates/elements.js.map +1 -0
  58. package/dist/cjs/templates/formElements.js +77 -0
  59. package/dist/cjs/templates/formElements.js.map +1 -0
  60. package/dist/cjs/templates/listTemplates.js +187 -0
  61. package/dist/cjs/templates/listTemplates.js.map +1 -0
  62. package/dist/cjs/templates/nesting.js +150 -0
  63. package/dist/cjs/templates/nesting.js.map +1 -0
  64. package/dist/cjs/templates/sampleData.js +141 -0
  65. package/dist/cjs/templates/sampleData.js.map +1 -0
  66. package/dist/cjs/templates/screenTemplates.js +41 -0
  67. package/dist/cjs/templates/screenTemplates.js.map +1 -0
  68. package/dist/cjs/templates/workspaceTemplates.js +212 -0
  69. package/dist/cjs/templates/workspaceTemplates.js.map +1 -0
  70. package/dist/esm/BorrowedComponentName.d.ts +4 -0
  71. package/dist/esm/BorrowedComponentName.d.ts.map +1 -0
  72. package/dist/esm/BorrowedComponentName.js +23 -0
  73. package/dist/esm/BorrowedComponentName.js.map +1 -0
  74. package/dist/esm/ComponentName.d.ts +4 -0
  75. package/dist/esm/ComponentName.d.ts.map +1 -0
  76. package/dist/esm/ComponentName.js +28 -0
  77. package/dist/esm/ComponentName.js.map +1 -0
  78. package/dist/esm/CompositeName.d.ts +28 -0
  79. package/dist/esm/CompositeName.d.ts.map +1 -0
  80. package/dist/esm/CompositeName.js +50 -0
  81. package/dist/esm/CompositeName.js.map +1 -0
  82. package/dist/esm/componentsBlueprint.d.ts +5 -0
  83. package/dist/esm/componentsBlueprint.d.ts.map +1 -0
  84. package/dist/esm/componentsBlueprint.js +90 -0
  85. package/dist/esm/componentsBlueprint.js.map +1 -0
  86. package/dist/esm/componentsBlueprintComponents.d.ts +3 -0
  87. package/dist/esm/componentsBlueprintComponents.d.ts.map +1 -0
  88. package/dist/esm/componentsBlueprintComponents.js +25 -0
  89. package/dist/esm/componentsBlueprintComponents.js.map +1 -0
  90. package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.d.ts +2 -0
  91. package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.d.ts.map +1 -0
  92. package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js +57 -0
  93. package/dist/esm/for_ArcPageHeader/when_rendering_a_gallery_screen.js.map +1 -0
  94. package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.d.ts +2 -0
  95. package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.d.ts.map +1 -0
  96. package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.js +26 -0
  97. package/dist/esm/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.js.map +1 -0
  98. package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.d.ts +2 -0
  99. package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.d.ts.map +1 -0
  100. package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js +65 -0
  101. package/dist/esm/for_componentsBlueprint/when_resolving_its_dependencies.js.map +1 -0
  102. package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.d.ts +2 -0
  103. package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.d.ts.map +1 -0
  104. package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.js +41 -0
  105. package/dist/esm/for_componentsBlueprint/when_validating_the_bundle.js.map +1 -0
  106. package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
  107. package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
  108. package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.js +38 -0
  109. package/dist/esm/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
  110. package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
  111. package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
  112. package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +47 -0
  113. package/dist/esm/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
  114. package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
  115. package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
  116. package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.js +56 -0
  117. package/dist/esm/for_componentsScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
  118. package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.d.ts +2 -0
  119. package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.d.ts.map +1 -0
  120. package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.js +31 -0
  121. package/dist/esm/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.js.map +1 -0
  122. package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.d.ts +2 -0
  123. package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
  124. package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.js +54 -0
  125. package/dist/esm/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.js.map +1 -0
  126. package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.d.ts +2 -0
  127. package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.d.ts.map +1 -0
  128. package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.js +27 -0
  129. package/dist/esm/for_deriveArcHeading/when_no_binding_is_named.js.map +1 -0
  130. package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.d.ts +2 -0
  131. package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.d.ts.map +1 -0
  132. package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.js +18 -0
  133. package/dist/esm/for_deriveArcHeading/when_the_binding_is_not_registered.js.map +1 -0
  134. package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.d.ts +2 -0
  135. package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.d.ts.map +1 -0
  136. package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.js +26 -0
  137. package/dist/esm/for_deriveArcHeading/when_the_binding_is_registered.js.map +1 -0
  138. package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.d.ts +2 -0
  139. package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.d.ts.map +1 -0
  140. package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.js +25 -0
  141. package/dist/esm/for_humanizeBindingName/when_reading_a_proxy_name.js.map +1 -0
  142. package/dist/esm/gallery/ArcPages.stories.d.ts +30 -0
  143. package/dist/esm/gallery/ArcPages.stories.d.ts.map +1 -0
  144. package/dist/esm/gallery/ArcPages.stories.js +34 -0
  145. package/dist/esm/gallery/ArcPages.stories.js.map +1 -0
  146. package/dist/esm/gallery/Bindings.stories.d.ts +22 -0
  147. package/dist/esm/gallery/Bindings.stories.d.ts.map +1 -0
  148. package/dist/esm/gallery/Bindings.stories.js +78 -0
  149. package/dist/esm/gallery/Bindings.stories.js.map +1 -0
  150. package/dist/esm/gallery/DialogTemplatePreview.d.ts +7 -0
  151. package/dist/esm/gallery/DialogTemplatePreview.d.ts.map +1 -0
  152. package/dist/esm/gallery/DialogTemplatePreview.js +44 -0
  153. package/dist/esm/gallery/DialogTemplatePreview.js.map +1 -0
  154. package/dist/esm/gallery/DialogTemplates.stories.d.ts +21 -0
  155. package/dist/esm/gallery/DialogTemplates.stories.d.ts.map +1 -0
  156. package/dist/esm/gallery/DialogTemplates.stories.js +23 -0
  157. package/dist/esm/gallery/DialogTemplates.stories.js.map +1 -0
  158. package/dist/esm/gallery/GalleryScreenPreview.d.ts +10 -0
  159. package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
  160. package/dist/esm/gallery/GalleryScreenPreview.js +62 -0
  161. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
  162. package/dist/esm/gallery/applicationChrome.d.ts +3 -0
  163. package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
  164. package/dist/esm/gallery/applicationChrome.js +135 -0
  165. package/dist/esm/gallery/applicationChrome.js.map +1 -0
  166. package/dist/esm/gallery/index.d.ts +7 -0
  167. package/dist/esm/gallery/index.d.ts.map +1 -0
  168. package/dist/esm/gallery/index.js +7 -0
  169. package/dist/esm/gallery/index.js.map +1 -0
  170. package/dist/esm/gallery/navigation.d.ts +9 -0
  171. package/dist/esm/gallery/navigation.d.ts.map +1 -0
  172. package/dist/esm/gallery/navigation.js +121 -0
  173. package/dist/esm/gallery/navigation.js.map +1 -0
  174. package/dist/esm/gallery/previewProfile.d.ts +6 -0
  175. package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
  176. package/dist/esm/gallery/previewProfile.js +83 -0
  177. package/dist/esm/gallery/previewProfile.js.map +1 -0
  178. package/dist/esm/gallery/screens.d.ts +4 -0
  179. package/dist/esm/gallery/screens.d.ts.map +1 -0
  180. package/dist/esm/gallery/screens.js +77 -0
  181. package/dist/esm/gallery/screens.js.map +1 -0
  182. package/dist/esm/header/ArcHeading.d.ts +9 -0
  183. package/dist/esm/header/ArcHeading.d.ts.map +1 -0
  184. package/dist/esm/header/ArcHeading.js +2 -0
  185. package/dist/esm/header/ArcHeading.js.map +1 -0
  186. package/dist/esm/header/ArcPageHeader.d.ts +3 -0
  187. package/dist/esm/header/ArcPageHeader.d.ts.map +1 -0
  188. package/dist/esm/header/ArcPageHeader.js +63 -0
  189. package/dist/esm/header/ArcPageHeader.js.map +1 -0
  190. package/dist/esm/header/deriveArcHeading.d.ts +4 -0
  191. package/dist/esm/header/deriveArcHeading.d.ts.map +1 -0
  192. package/dist/esm/header/deriveArcHeading.js +49 -0
  193. package/dist/esm/header/deriveArcHeading.js.map +1 -0
  194. package/dist/esm/header/humanizeBindingName.d.ts +2 -0
  195. package/dist/esm/header/humanizeBindingName.d.ts.map +1 -0
  196. package/dist/esm/header/humanizeBindingName.js +34 -0
  197. package/dist/esm/header/humanizeBindingName.js.map +1 -0
  198. package/dist/esm/header/index.d.ts +5 -0
  199. package/dist/esm/header/index.d.ts.map +1 -0
  200. package/dist/esm/header/index.js +5 -0
  201. package/dist/esm/header/index.js.map +1 -0
  202. package/dist/esm/index.d.ts +10 -0
  203. package/dist/esm/index.d.ts.map +1 -0
  204. package/dist/esm/index.js +30 -0
  205. package/dist/esm/index.js.map +1 -0
  206. package/dist/esm/package.json +3 -0
  207. package/dist/esm/packageName.d.ts +2 -0
  208. package/dist/esm/packageName.d.ts.map +1 -0
  209. package/dist/esm/packageName.js +13 -0
  210. package/dist/esm/packageName.js.map +1 -0
  211. package/dist/esm/templates/ArcHeaderOptions.d.ts +8 -0
  212. package/dist/esm/templates/ArcHeaderOptions.d.ts.map +1 -0
  213. package/dist/esm/templates/ArcHeaderOptions.js +2 -0
  214. package/dist/esm/templates/ArcHeaderOptions.js.map +1 -0
  215. package/dist/esm/templates/ColumnDefinition.d.ts +5 -0
  216. package/dist/esm/templates/ColumnDefinition.d.ts.map +1 -0
  217. package/dist/esm/templates/ColumnDefinition.js +2 -0
  218. package/dist/esm/templates/ColumnDefinition.js.map +1 -0
  219. package/dist/esm/templates/SampleBindingName.d.ts +11 -0
  220. package/dist/esm/templates/SampleBindingName.d.ts.map +1 -0
  221. package/dist/esm/templates/SampleBindingName.js +37 -0
  222. package/dist/esm/templates/SampleBindingName.js.map +1 -0
  223. package/dist/esm/templates/TableOptions.d.ts +6 -0
  224. package/dist/esm/templates/TableOptions.d.ts.map +1 -0
  225. package/dist/esm/templates/TableOptions.js +2 -0
  226. package/dist/esm/templates/TableOptions.js.map +1 -0
  227. package/dist/esm/templates/commandTemplates.d.ts +4 -0
  228. package/dist/esm/templates/commandTemplates.d.ts.map +1 -0
  229. package/dist/esm/templates/commandTemplates.js +79 -0
  230. package/dist/esm/templates/commandTemplates.js.map +1 -0
  231. package/dist/esm/templates/dataElements.d.ts +11 -0
  232. package/dist/esm/templates/dataElements.d.ts.map +1 -0
  233. package/dist/esm/templates/dataElements.js +123 -0
  234. package/dist/esm/templates/dataElements.js.map +1 -0
  235. package/dist/esm/templates/dialogElements.d.ts +5 -0
  236. package/dist/esm/templates/dialogElements.d.ts.map +1 -0
  237. package/dist/esm/templates/dialogElements.js +65 -0
  238. package/dist/esm/templates/dialogElements.js.map +1 -0
  239. package/dist/esm/templates/dialogTemplates.d.ts +6 -0
  240. package/dist/esm/templates/dialogTemplates.d.ts.map +1 -0
  241. package/dist/esm/templates/dialogTemplates.js +113 -0
  242. package/dist/esm/templates/dialogTemplates.js.map +1 -0
  243. package/dist/esm/templates/editorElements.d.ts +11 -0
  244. package/dist/esm/templates/editorElements.d.ts.map +1 -0
  245. package/dist/esm/templates/editorElements.js +74 -0
  246. package/dist/esm/templates/editorElements.js.map +1 -0
  247. package/dist/esm/templates/editorTemplates.d.ts +5 -0
  248. package/dist/esm/templates/editorTemplates.d.ts.map +1 -0
  249. package/dist/esm/templates/editorTemplates.js +168 -0
  250. package/dist/esm/templates/editorTemplates.js.map +1 -0
  251. package/dist/esm/templates/elements.d.ts +11 -0
  252. package/dist/esm/templates/elements.d.ts.map +1 -0
  253. package/dist/esm/templates/elements.js +92 -0
  254. package/dist/esm/templates/elements.js.map +1 -0
  255. package/dist/esm/templates/formElements.d.ts +11 -0
  256. package/dist/esm/templates/formElements.d.ts.map +1 -0
  257. package/dist/esm/templates/formElements.js +70 -0
  258. package/dist/esm/templates/formElements.js.map +1 -0
  259. package/dist/esm/templates/index.d.ts +18 -0
  260. package/dist/esm/templates/index.d.ts.map +1 -0
  261. package/dist/esm/templates/index.js +18 -0
  262. package/dist/esm/templates/index.js.map +1 -0
  263. package/dist/esm/templates/listTemplates.d.ts +6 -0
  264. package/dist/esm/templates/listTemplates.d.ts.map +1 -0
  265. package/dist/esm/templates/listTemplates.js +182 -0
  266. package/dist/esm/templates/listTemplates.js.map +1 -0
  267. package/dist/esm/templates/nesting.d.ts +6 -0
  268. package/dist/esm/templates/nesting.d.ts.map +1 -0
  269. package/dist/esm/templates/nesting.js +145 -0
  270. package/dist/esm/templates/nesting.js.map +1 -0
  271. package/dist/esm/templates/sampleData.d.ts +10 -0
  272. package/dist/esm/templates/sampleData.d.ts.map +1 -0
  273. package/dist/esm/templates/sampleData.js +134 -0
  274. package/dist/esm/templates/sampleData.js.map +1 -0
  275. package/dist/esm/templates/screenTemplates.d.ts +4 -0
  276. package/dist/esm/templates/screenTemplates.d.ts.map +1 -0
  277. package/dist/esm/templates/screenTemplates.js +38 -0
  278. package/dist/esm/templates/screenTemplates.js.map +1 -0
  279. package/dist/esm/templates/workspaceTemplates.d.ts +5 -0
  280. package/dist/esm/templates/workspaceTemplates.d.ts.map +1 -0
  281. package/dist/esm/templates/workspaceTemplates.js +208 -0
  282. package/dist/esm/templates/workspaceTemplates.js.map +1 -0
  283. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  284. package/for_ArcPageHeader/when_rendering_a_gallery_screen.tsx +79 -0
  285. package/for_CompositeName/when_checking_the_names_against_the_packages_that_declare_them.ts +41 -0
  286. package/for_componentsBlueprint/when_resolving_its_dependencies.ts +85 -0
  287. package/for_componentsBlueprint/when_validating_the_bundle.ts +55 -0
  288. package/for_componentsGalleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +56 -0
  289. package/for_componentsScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +66 -0
  290. package/for_componentsScreenTemplates/when_following_the_nesting_chain.ts +83 -0
  291. package/for_componentsScreenTemplates/when_placing_them_in_the_default_blueprint_layout.ts +51 -0
  292. package/for_componentsScreenTemplates/when_resolving_the_component_names_they_reference.ts +72 -0
  293. package/for_deriveArcHeading/when_no_binding_is_named.ts +42 -0
  294. package/for_deriveArcHeading/when_the_binding_is_not_registered.ts +25 -0
  295. package/for_deriveArcHeading/when_the_binding_is_registered.ts +35 -0
  296. package/for_humanizeBindingName/when_reading_a_proxy_name.ts +34 -0
  297. package/gallery/ArcPages.stories.tsx +80 -0
  298. package/gallery/Bindings.stories.tsx +134 -0
  299. package/gallery/DialogTemplatePreview.tsx +49 -0
  300. package/gallery/DialogTemplates.stories.tsx +44 -0
  301. package/gallery/GalleryScreenPreview.tsx +70 -0
  302. package/gallery/applicationChrome.ts +108 -0
  303. package/gallery/index.ts +9 -0
  304. package/gallery/navigation.ts +63 -0
  305. package/gallery/previewProfile.ts +68 -0
  306. package/gallery/screens.ts +75 -0
  307. package/header/ArcHeading.ts +39 -0
  308. package/header/ArcPageHeader.tsx +44 -0
  309. package/header/deriveArcHeading.ts +47 -0
  310. package/header/humanizeBindingName.ts +36 -0
  311. package/header/index.ts +7 -0
  312. package/index.ts +12 -0
  313. package/package.json +71 -0
  314. package/packageName.ts +12 -0
  315. package/templates/ArcHeaderOptions.ts +27 -0
  316. package/templates/ColumnDefinition.ts +18 -0
  317. package/templates/SampleBindingName.ts +50 -0
  318. package/templates/TableOptions.ts +22 -0
  319. package/templates/commandTemplates.ts +59 -0
  320. package/templates/dataElements.ts +97 -0
  321. package/templates/dialogElements.ts +53 -0
  322. package/templates/dialogTemplates.ts +105 -0
  323. package/templates/editorElements.ts +69 -0
  324. package/templates/editorTemplates.ts +129 -0
  325. package/templates/elements.ts +81 -0
  326. package/templates/formElements.ts +61 -0
  327. package/templates/index.ts +20 -0
  328. package/templates/listTemplates.ts +142 -0
  329. package/templates/nesting.ts +118 -0
  330. package/templates/sampleData.ts +81 -0
  331. package/templates/screenTemplates.ts +35 -0
  332. package/templates/workspaceTemplates.ts +163 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentsBlueprint.js","sources":["../../componentsBlueprint.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 { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { componentsBlueprintComponents } from './componentsBlueprintComponents';\nimport { componentsGalleryScreens } from './gallery';\nimport { componentsBlueprintName } from './packageName';\nimport { componentsDialogTemplates, componentsScreenTemplates } from './templates';\n\n/**\n * This blueprint's declaration.\n *\n * Where the default blueprint answers \"what does an application look like\", this one answers \"what does a\n * *page* look like once it is bound to Arc\". Its templates are whole pages already wired to the composites\n * in `Cratis.Components`: a data list page is a `dataPage` with its query, columns, empty message, data key\n * and filter fields all decided, under a header that says what it is bound to. An application picks the\n * template and supplies a query name.\n *\n * `layouts` is empty, and that is the most important line in this file.\n *\n * A layout is an application's base navigational shell, and an application has exactly one. This package\n * deliberately ships none: it depends on `Cratis.Blueprint.Default` and reuses that blueprint's `AppShell`,\n * its slot vocabulary, its shell components and its themes. That is what the dependency on another\n * blueprint *means* - and this is the first blueprint-on-blueprint dependency in Scene, so it is worth\n * stating plainly rather than leaving to be inferred from an empty array.\n *\n * The alternative would have been to ship a second application shell. It would have looked like value and\n * been the opposite: an application can activate only one shell, so the two blueprints would have become\n * mutually exclusive, and picking Arc-bound pages would have meant giving up the eight layout modes, the\n * themes and the navigation that the default blueprint already does well. Layering means both can be\n * active at once, which is the only arrangement in which either is worth having.\n *\n * `themes` is empty for the same reason at a smaller scale: the shell being themed is the default\n * blueprint's, so its themes are the right ones, and a theme shipped here would be this package asserting\n * a look for a shell it does not own.\n */\nexport const componentsBlueprintManifest: ScenePackage = {\n name: componentsBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: [],\n screenTemplates: componentsScreenTemplates.map(template => template.name),\n dialogTemplates: componentsDialogTemplates.map(template => template.name),\n themes: [],\n displayName: 'Cratis Components Blueprint',\n description: 'Arc-bound screen and dialog templates: whole pages built from the Cratis Components composites, for the default blueprint shell.',\n module: '@cratis/scene.blueprint.components',\n};\n\n/**\n * This blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a template the bundle never provided is a failure that\n * only shows up when someone picks that template and gets nothing.\n *\n * The screens are the gallery: real `Screen` instances naming the default blueprint's `AppShell`, its\n * chrome and one of these templates, so a preview boots them through the real engine as a working\n * miniature application rather than a set of pictures. They render with unregistered bindings, which is the\n * normal design-time state - the placeholders naming each wanted binding are exactly what should be there.\n */\nexport const componentsBlueprint: ScenePackageBundle = {\n manifest: componentsBlueprintManifest,\n components: componentsBlueprintComponents,\n screenTemplates: componentsScreenTemplates,\n dialogTemplates: componentsDialogTemplates,\n screens: componentsGalleryScreens,\n};\n"],"names":["componentsBlueprintManifest","name","componentsBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","screenTemplates","componentsScreenTemplates","map","template","dialogTemplates","componentsDialogTemplates","themes","displayName","description","module","componentsBlueprint","manifest","componentsBlueprintComponents","screens","componentsGalleryScreens"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BaA,2BAAAA,GAA4C;IACrDC,IAAAA,EAAMC,mCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAA2B,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACnFO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,2BAAAA,CAAAA;AAC1BC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiBC,0CAA0BC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASf,IAAI,CAAA;AACxEgB,IAAAA,eAAAA,EAAiBC,0CAA0BH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASf,IAAI,CAAA;AACxEkB,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,6BAAA;IACbC,WAAAA,EAAa,kIAAA;IACbC,MAAAA,EAAQ;AACZ;AAEA;;;;;;;;;;;UAYaC,mBAAAA,GAA0C;IACnDC,QAAAA,EAAUxB,2BAAAA;IACVQ,UAAAA,EAAYiB,2DAAAA;IACZZ,eAAAA,EAAiBC,yCAAAA;IACjBG,eAAAA,EAAiBC,yCAAAA;IACjBQ,OAAAA,EAASC;AACb;;;;;"}
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var scene_react = require('@cratis/scene.react');
4
+ var ComponentName = require('./ComponentName.js');
5
+ var packageName = require('./packageName.js');
6
+ require('@cratis/scene.components');
7
+ var ArcPageHeader = require('./header/ArcPageHeader.js');
8
+
9
+ // Copyright (c) Cratis. All rights reserved.
10
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
11
+ /**
12
+ * The components this package registers, keyed the way the renderer looks them up.
13
+ *
14
+ * Every key is built with `componentRegistryKey` rather than written out, because the separator between
15
+ * package and component name is the registry's own business - it is deliberately not the `.` a screen uses
16
+ * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is
17
+ * how a component ends up registered under something no lookup will ever produce.
18
+ *
19
+ * One entry, and a short registry is the healthy outcome here rather than a gap. What this blueprint
20
+ * contributes is templates; a component only appears when a template genuinely could not express the
21
+ * composition, and `validatePackageBundle` proves that whatever *is* here is also declared in the manifest.
22
+ */ const componentsBlueprintComponents = {
23
+ [scene_react.componentRegistryKey(packageName.componentsBlueprintName, ComponentName.ComponentName.ArcPageHeader)]: ArcPageHeader.ArcPageHeader
24
+ };
25
+
26
+ exports.componentsBlueprintComponents = componentsBlueprintComponents;
27
+ //# sourceMappingURL=componentsBlueprintComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentsBlueprintComponents.js","sources":["../../componentsBlueprintComponents.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 { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { componentsBlueprintName } from './packageName';\nimport { ArcPageHeader } from './header';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n *\n * One entry, and a short registry is the healthy outcome here rather than a gap. What this blueprint\n * contributes is templates; a component only appears when a template genuinely could not express the\n * composition, and `validatePackageBundle` proves that whatever *is* here is also declared in the manifest.\n */\nexport const componentsBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(componentsBlueprintName, ComponentName.ArcPageHeader)]: ArcPageHeader,\n};\n"],"names":["componentsBlueprintComponents","componentRegistryKey","componentsBlueprintName","ComponentName","ArcPageHeader"],"mappings":";;;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;UAYaA,6BAAAA,GAAmD;AAC5D,IAAA,CAACC,gCAAAA,CAAqBC,mCAAAA,EAAyBC,2BAAAA,CAAcC,aAAa,IAAIA;AAClF;;;;"}
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var scene_react = require('@cratis/scene.react');
6
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
7
+ require('../templates/listTemplates.js');
8
+ require('../templates/workspaceTemplates.js');
9
+ require('../templates/commandTemplates.js');
10
+ require('../templates/editorTemplates.js');
11
+ require('../templates/nesting.js');
12
+ var dialogTemplates = require('../templates/dialogTemplates.js');
13
+ require('../templates/screenTemplates.js');
14
+ var previewProfile = require('./previewProfile.js');
15
+ var GalleryScreenPreview = require('./GalleryScreenPreview.js');
16
+
17
+ /**
18
+ * Boots one dialog template through the real engine.
19
+ *
20
+ * A dialog has no layout and no shell, because it occupies no slot - it opens *over* whatever is already
21
+ * on screen. So there is nothing to compose it into: the template's own content is the whole tree, and it
22
+ * goes straight through `resolveComponentName` and `SceneElementView` exactly as a screen's does.
23
+ *
24
+ * Each of these templates declares one slot, so flattening the content is the whole of "assembling" it.
25
+ * That is a consequence of the composites owning their own frames rather than a simplification here.
26
+ */ function DialogTemplatePreview({ templateName, registry = GalleryScreenPreview.componentsPreviewRegistry }) {
27
+ const elements = react.useMemo(()=>{
28
+ const template = dialogTemplates.componentsDialogTemplates.find((candidate)=>candidate.name === templateName);
29
+ if (!template) {
30
+ throw new Error(`This blueprint has no dialog template named '${templateName}'.`);
31
+ }
32
+ return Object.values(template.content ?? {}).flat().map((element)=>scene_blueprint_default.resolveElementComponentNames(element, previewProfile.componentsBlueprintProfile, previewProfile.componentsBlueprintCatalog));
33
+ }, [
34
+ templateName
35
+ ]);
36
+ return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
37
+ children: elements.map((element)=>/*#__PURE__*/ jsxRuntime.jsx(scene_react.SceneElementView, {
38
+ element: element,
39
+ registry: registry,
40
+ resolveBinding: ()=>undefined
41
+ }, element.id))
42
+ });
43
+ }
44
+
45
+ exports.DialogTemplatePreview = DialogTemplatePreview;
46
+ //# sourceMappingURL=DialogTemplatePreview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogTemplatePreview.js","sources":["../../../gallery/DialogTemplatePreview.tsx"],"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 { useMemo } from 'react';\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView } from '@cratis/scene.react';\nimport { resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsDialogTemplates } from '../templates';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsPreviewRegistry } from './GalleryScreenPreview';\n\nexport interface DialogTemplatePreviewProps {\n /** The name of the dialog template to boot. */\n templateName: string;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one dialog template through the real engine.\n *\n * A dialog has no layout and no shell, because it occupies no slot - it opens *over* whatever is already\n * on screen. So there is nothing to compose it into: the template's own content is the whole tree, and it\n * goes straight through `resolveComponentName` and `SceneElementView` exactly as a screen's does.\n *\n * Each of these templates declares one slot, so flattening the content is the whole of \"assembling\" it.\n * That is a consequence of the composites owning their own frames rather than a simplification here.\n */\nexport function DialogTemplatePreview({ templateName, registry = componentsPreviewRegistry }: DialogTemplatePreviewProps) {\n const elements = useMemo(() => {\n const template = componentsDialogTemplates.find(candidate => candidate.name === templateName);\n if (!template) {\n throw new Error(`This blueprint has no dialog template named '${templateName}'.`);\n }\n\n return Object.values(template.content ?? {})\n .flat()\n .map((element: SceneElement) => resolveElementComponentNames(element, componentsBlueprintProfile, componentsBlueprintCatalog));\n }, [templateName]);\n\n return (\n <>\n {elements.map(element => (\n <SceneElementView key={element.id} element={element} registry={registry} resolveBinding={() => undefined} />\n ))}\n </>\n );\n}\n"],"names":["DialogTemplatePreview","templateName","registry","componentsPreviewRegistry","elements","useMemo","template","componentsDialogTemplates","find","candidate","name","Error","Object","values","content","flat","map","element","resolveElementComponentNames","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","_Fragment","SceneElementView","resolveBinding","undefined","id"],"mappings":";;;;;;;;;;;;;;;;AAmBA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsB,EAAEC,YAAY,EAAEC,QAAAA,GAAWC,8CAAyB,EAA8B,EAAA;AACpH,IAAA,MAAMC,WAAWC,aAAAA,CAAQ,IAAA;QACrB,MAAMC,QAAAA,GAAWC,0CAA0BC,IAAI,CAACC,CAAAA,SAAAA,GAAaA,SAAAA,CAAUC,IAAI,KAAKT,YAAAA,CAAAA;AAChF,QAAA,IAAI,CAACK,QAAAA,EAAU;AACX,YAAA,MAAM,IAAIK,KAAAA,CAAM,CAAC,6CAA6C,EAAEV,YAAAA,CAAa,EAAE,CAAC,CAAA;AACpF,QAAA;AAEA,QAAA,OAAOW,OAAOC,MAAM,CAACP,QAAAA,CAASQ,OAAO,IAAI,EAAC,CAAA,CACrCC,IAAI,EAAA,CACJC,GAAG,CAAC,CAACC,OAAAA,GAA0BC,oDAAAA,CAA6BD,SAASE,yCAAAA,EAA4BC,yCAAAA,CAAAA,CAAAA;IAC1G,CAAA,EAAG;AAACnB,QAAAA;AAAa,KAAA,CAAA;IAEjB,qBACIoB,cAAA,CAAAC,mBAAA,EAAA;AACKlB,QAAAA,QAAAA,EAAAA,QAAAA,CAASY,GAAG,CAACC,CAAAA,OAAAA,iBACVI,cAAA,CAACE,4BAAAA,EAAAA;gBAAkCN,OAAAA,EAASA,OAAAA;gBAASf,QAAAA,EAAUA,QAAAA;AAAUsB,gBAAAA,cAAAA,EAAgB,IAAMC;AAAxER,aAAAA,EAAAA,OAAAA,CAAQS,EAAE,CAAA;;AAIjD;;;;"}
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var scene_react = require('@cratis/scene.react');
6
+ var scene_components = require('@cratis/scene.components');
7
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
8
+ var componentsBlueprintComponents = require('../componentsBlueprintComponents.js');
9
+ var previewProfile = require('./previewProfile.js');
10
+ var screens = require('./screens.js');
11
+
12
+ /**
13
+ * The registry a preview resolves against: `core`, `Cratis.Components`, the default blueprint, and this one.
14
+ *
15
+ * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's own
16
+ * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry
17
+ * keys carry their package name, so merge order cannot cause a collision either way.
18
+ *
19
+ * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a
20
+ * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a
21
+ * placeholder until a host registers its query.
22
+ */ const componentsPreviewRegistry = {
23
+ ...scene_react.coreComponents,
24
+ ...scene_components.cratisComponents,
25
+ ...scene_blueprint_default.defaultBlueprintComponents,
26
+ ...componentsBlueprintComponents.componentsBlueprintComponents
27
+ };
28
+ /**
29
+ * Boots one gallery screen through the real engine.
30
+ *
31
+ * Nothing here is a preview-only path: the screen is a real `Screen`, its element tree is resolved by the
32
+ * real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real registry.
33
+ * That is the point of shipping a gallery at all - a mockup proves someone can draw an invoice list, and
34
+ * this proves the blueprint renders one.
35
+ *
36
+ * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being
37
+ * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and
38
+ * previewing them without the thing they were designed to sit in would prove the wrong thing.
39
+ */ function GalleryScreenPreview({ screenName, initialConfig, registry = componentsPreviewRegistry }) {
40
+ const element = react.useMemo(()=>{
41
+ const screen = screens.componentsGalleryScreen(screenName);
42
+ if (!screen) {
43
+ throw new Error(`The gallery has no screen named '${screenName}'.`);
44
+ }
45
+ return scene_blueprint_default.resolveElementComponentNames(scene_blueprint_default.composeScreenElement(screen), previewProfile.componentsBlueprintProfile, previewProfile.componentsBlueprintCatalog);
46
+ }, [
47
+ screenName
48
+ ]);
49
+ return /*#__PURE__*/ jsxRuntime.jsx(scene_blueprint_default.LayoutConfigProvider, {
50
+ initialConfig: initialConfig,
51
+ storage: null,
52
+ children: /*#__PURE__*/ jsxRuntime.jsx(scene_blueprint_default.LayoutThemeProvider, {
53
+ themes: scene_blueprint_default.defaultBlueprintThemes,
54
+ children: /*#__PURE__*/ jsxRuntime.jsx(scene_react.SceneElementView, {
55
+ element: element,
56
+ registry: registry,
57
+ resolveBinding: ()=>undefined
58
+ })
59
+ })
60
+ });
61
+ }
62
+
63
+ exports.GalleryScreenPreview = GalleryScreenPreview;
64
+ exports.componentsPreviewRegistry = componentsPreviewRegistry;
65
+ //# sourceMappingURL=GalleryScreenPreview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"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 { useMemo } from 'react';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { cratisComponents } from '@cratis/scene.components';\nimport { LayoutConfigProvider, LayoutConfigState, LayoutThemeProvider, composeScreenElement, defaultBlueprintComponents, defaultBlueprintThemes, resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsBlueprintComponents } from '../componentsBlueprintComponents';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsGalleryScreen } from './screens';\n\n/**\n * The registry a preview resolves against: `core`, `Cratis.Components`, the default blueprint, and this one.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's own\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n *\n * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a\n * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a\n * placeholder until a host registers its query.\n */\nexport const componentsPreviewRegistry: ComponentRegistry = {\n ...coreComponents,\n ...cratisComponents,\n ...defaultBlueprintComponents,\n ...componentsBlueprintComponents,\n};\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a layout mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real `Screen`, its element tree is resolved by the\n * real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real registry.\n * That is the point of shipping a gallery at all - a mockup proves someone can draw an invoice list, and\n * this proves the blueprint renders one.\n *\n * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being\n * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and\n * previewing them without the thing they were designed to sit in would prove the wrong thing.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, registry = componentsPreviewRegistry }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = componentsGalleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), componentsBlueprintProfile, componentsBlueprintCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={defaultBlueprintThemes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["componentsPreviewRegistry","coreComponents","cratisComponents","defaultBlueprintComponents","componentsBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","registry","element","useMemo","screen","componentsGalleryScreen","Error","resolveElementComponentNames","composeScreenElement","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","themes","defaultBlueprintThemes","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;AAWA;;;;;;;;;;UAWaA,yBAAAA,GAA+C;AACxD,IAAA,GAAGC,0BAAc;AACjB,IAAA,GAAGC,iCAAgB;AACnB,IAAA,GAAGC,kDAA0B;AAC7B,IAAA,GAAGC;AACP;AAaA;;;;;;;;;;;IAYO,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,QAAAA,GAAWR,yBAAyB,EAA6B,EAAA;AAC/H,IAAA,MAAMS,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,+BAAAA,CAAwBN,UAAAA,CAAAA;AACvC,QAAA,IAAI,CAACK,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAEP,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;QAEA,OAAOQ,oDAAAA,CAA6BC,4CAAAA,CAAqBJ,MAAAA,CAAAA,EAASK,yCAAAA,EAA4BC,yCAAAA,CAAAA;IAClG,CAAA,EAAG;AAACX,QAAAA;AAAW,KAAA,CAAA;AAEf,IAAA,qBACIY,cAAA,CAACC,4CAAAA,EAAAA;QAAqBZ,aAAAA,EAAeA,aAAAA;QAAea,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,2CAAAA,EAAAA;YAAoBC,MAAAA,EAAQC,8CAAAA;AACzB,YAAA,QAAA,gBAAAL,cAAA,CAACM,4BAAAA,EAAAA;gBAAiBf,OAAAA,EAASA,OAAAA;gBAASD,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;;;;"}
@@ -0,0 +1,137 @@
1
+ 'use strict';
2
+
3
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
4
+ var navigation = require('./navigation.js');
5
+
6
+ // Copyright (c) Cratis. All rights reserved.
7
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
8
+ /**
9
+ * The application-shell chrome every gallery screen in this package shares.
10
+ *
11
+ * Every element here names a component the **default blueprint** declares - `topbar`, `sidebar`, `menu`,
12
+ * `breadcrumb`, `footer`, `configPanel`, `logo`, `userMenu` - and every slot is one of that blueprint's
13
+ * `SlotName`s. That is this package's dependency on it made concrete rather than merely declared: this
14
+ * blueprint contributes Arc-bound *pages*, and borrows the shell those pages live in.
15
+ *
16
+ * A blueprint that shipped its own topbar and its own sidebar would be a rival to the default one rather
17
+ * than a layer on it, and an application would have to choose. Since a profile activates one blueprint's
18
+ * layouts and both blueprints' templates, layering is what makes the two usable together at all.
19
+ */ /** The brand mark, shared by the topbar and the sidebar header. */ function logo(id) {
20
+ return scene_blueprint_default.externalComponent(id, scene_blueprint_default.ComponentName.Logo, {
21
+ label: 'Contoso Billing',
22
+ initials: 'CB',
23
+ targetScreen: 'DashboardPage'
24
+ });
25
+ }
26
+ /** One menu section per navigation group, each holding that group's entries. */ function menuSections(activeScreen) {
27
+ return navigation.componentsNavigationGroups.map((group)=>scene_blueprint_default.externalComponent(`menu-${group.toLowerCase()}`, scene_blueprint_default.ComponentName.Menu, {
28
+ title: group,
29
+ label: group
30
+ }, {
31
+ items: navigation.entriesInGroup(group).map((entry)=>navigationItem(entry.targetScreen, entry.label, entry.icon, entry.order, group, activeScreen))
32
+ }));
33
+ }
34
+ function navigationItem(targetScreen, label, icon, order, group, activeScreen) {
35
+ return scene_blueprint_default.externalComponent(`nav-${targetScreen}`, scene_blueprint_default.ComponentName.MenuItem, {
36
+ label,
37
+ targetScreen,
38
+ routeParameterBindings: {},
39
+ order,
40
+ group,
41
+ icon,
42
+ isActive: targetScreen === activeScreen
43
+ });
44
+ }
45
+ /** The configurator, offering the themes the default blueprint ships - this package ships none of its own. */ function configPanel() {
46
+ return scene_blueprint_default.externalComponent(scene_blueprint_default.ComponentName.ConfigPanel, scene_blueprint_default.ComponentName.ConfigPanel, {
47
+ title: 'Settings',
48
+ themes: scene_blueprint_default.defaultBlueprintThemes.map((theme)=>({
49
+ name: theme.name,
50
+ label: theme.name,
51
+ isDark: theme.isDark ?? false
52
+ }))
53
+ });
54
+ }
55
+ /**
56
+ * The trail above a screen's content, derived from the navigation rather than declared a second time.
57
+ *
58
+ * A hand-written table of breadcrumbs per screen is a second statement of where each screen sits, and the
59
+ * two drift the first time a screen is renamed. The navigation already knows the group and the label, so
60
+ * the trail follows from it.
61
+ */ function breadcrumbEntries(activeScreen) {
62
+ const group = navigation.groupOfScreen(activeScreen);
63
+ const label = navigation.labelOfScreen(activeScreen) ?? activeScreen;
64
+ return group === undefined ? [
65
+ {
66
+ label
67
+ }
68
+ ] : [
69
+ {
70
+ label: group,
71
+ targetScreen: 'DashboardPage'
72
+ },
73
+ {
74
+ label
75
+ }
76
+ ];
77
+ }
78
+ /**
79
+ * The application shell's slot content for one screen.
80
+ *
81
+ * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else
82
+ * is identical, which is what chrome is for.
83
+ *
84
+ * @param activeScreen The screen being rendered, so its menu entry is marked current and its trail is built.
85
+ * @returns Slot content keyed by the {@link SlotName}s the default blueprint's `AppShell` layout declares.
86
+ */ function componentsApplicationChrome(activeScreen) {
87
+ return {
88
+ [scene_blueprint_default.SlotName.Topbar]: [
89
+ scene_blueprint_default.externalComponent('topbar', scene_blueprint_default.ComponentName.Topbar, {}, {
90
+ logo: [
91
+ logo('topbar-logo')
92
+ ],
93
+ end: [
94
+ scene_blueprint_default.externalComponent('topbar-user', scene_blueprint_default.ComponentName.UserMenu, {
95
+ name: 'Amelia Nyquist',
96
+ role: 'Billing owner',
97
+ initials: 'AN',
98
+ items: [
99
+ {
100
+ label: 'Invoice document',
101
+ icon: 'pi pi-file-edit',
102
+ targetScreen: 'ObjectEditorPage'
103
+ }
104
+ ]
105
+ })
106
+ ]
107
+ })
108
+ ],
109
+ [scene_blueprint_default.SlotName.Sidebar]: [
110
+ scene_blueprint_default.externalComponent('sidebar', scene_blueprint_default.ComponentName.Sidebar, {
111
+ title: 'Contoso Billing'
112
+ }, {
113
+ logo: [
114
+ logo('sidebar-logo')
115
+ ]
116
+ })
117
+ ],
118
+ [scene_blueprint_default.SlotName.Menu]: menuSections(activeScreen),
119
+ [scene_blueprint_default.SlotName.Breadcrumb]: [
120
+ scene_blueprint_default.externalComponent('breadcrumb', scene_blueprint_default.ComponentName.Breadcrumb, {
121
+ homeTargetScreen: 'DashboardPage',
122
+ items: breadcrumbEntries(activeScreen)
123
+ })
124
+ ],
125
+ [scene_blueprint_default.SlotName.Footer]: [
126
+ scene_blueprint_default.externalComponent('footer', scene_blueprint_default.ComponentName.Footer, {
127
+ text: '© Contoso · Arc-bound pages from Cratis Scene'
128
+ })
129
+ ],
130
+ [scene_blueprint_default.SlotName.ConfigPanel]: [
131
+ configPanel()
132
+ ]
133
+ };
134
+ }
135
+
136
+ exports.componentsApplicationChrome = componentsApplicationChrome;
137
+ //# sourceMappingURL=applicationChrome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.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 { SceneElement } from '@cratis/scene.model';\nimport { ComponentName as DefaultComponentName, SlotName, defaultBlueprintThemes, externalComponent } from '@cratis/scene.blueprint.default';\nimport { componentsNavigationGroups, entriesInGroup, groupOfScreen, labelOfScreen } from './navigation';\n\n/**\n * The application-shell chrome every gallery screen in this package shares.\n *\n * Every element here names a component the **default blueprint** declares - `topbar`, `sidebar`, `menu`,\n * `breadcrumb`, `footer`, `configPanel`, `logo`, `userMenu` - and every slot is one of that blueprint's\n * `SlotName`s. That is this package's dependency on it made concrete rather than merely declared: this\n * blueprint contributes Arc-bound *pages*, and borrows the shell those pages live in.\n *\n * A blueprint that shipped its own topbar and its own sidebar would be a rival to the default one rather\n * than a layer on it, and an application would have to choose. Since a profile activates one blueprint's\n * layouts and both blueprints' templates, layering is what makes the two usable together at all.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, DefaultComponentName.Logo, { label: 'Contoso Billing', initials: 'CB', targetScreen: 'DashboardPage' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return componentsNavigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n DefaultComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationItem(entry.targetScreen, entry.label, entry.icon, entry.order, group, activeScreen)) },\n ),\n );\n}\n\nfunction navigationItem(targetScreen: string, label: string, icon: string, order: number, group: string, activeScreen: string): SceneElement {\n return externalComponent(`nav-${targetScreen}`, DefaultComponentName.MenuItem, {\n label,\n targetScreen,\n routeParameterBindings: {},\n order,\n group,\n icon,\n isActive: targetScreen === activeScreen,\n });\n}\n\n/** The configurator, offering the themes the default blueprint ships - this package ships none of its own. */\nfunction configPanel(): SceneElement {\n return externalComponent(DefaultComponentName.ConfigPanel, DefaultComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/**\n * The trail above a screen's content, derived from the navigation rather than declared a second time.\n *\n * A hand-written table of breadcrumbs per screen is a second statement of where each screen sits, and the\n * two drift the first time a screen is renamed. The navigation already knows the group and the label, so\n * the trail follows from it.\n */\nfunction breadcrumbEntries(activeScreen: string): { label: string; targetScreen?: string }[] {\n const group = groupOfScreen(activeScreen);\n const label = labelOfScreen(activeScreen) ?? activeScreen;\n return group === undefined ? [{ label }] : [{ label: group, targetScreen: 'DashboardPage' }, { label }];\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is what chrome is for.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current and its trail is built.\n * @returns Slot content keyed by the {@link SlotName}s the default blueprint's `AppShell` layout declares.\n */\nexport function componentsApplicationChrome(activeScreen: string): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n DefaultComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n externalComponent('topbar-user', DefaultComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Billing owner',\n initials: 'AN',\n items: [{ label: 'Invoice document', icon: 'pi pi-file-edit', targetScreen: 'ObjectEditorPage' }],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', DefaultComponentName.Sidebar, { title: 'Contoso Billing' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', DefaultComponentName.Breadcrumb, { homeTargetScreen: 'DashboardPage', items: breadcrumbEntries(activeScreen) }),\n ],\n [SlotName.Footer]: [externalComponent('footer', DefaultComponentName.Footer, { text: '© Contoso · Arc-bound pages from Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n"],"names":["logo","id","externalComponent","DefaultComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","componentsNavigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationItem","icon","order","MenuItem","routeParameterBindings","isActive","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","breadcrumbEntries","groupOfScreen","labelOfScreen","undefined","componentsApplicationChrome","SlotName","Topbar","end","UserMenu","role","Sidebar","Breadcrumb","homeTargetScreen","Footer","text"],"mappings":";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4BAAA;gCAAEX,KAAAA,EAAO,kBAAA;gCAAoBe,IAAAA,EAAM,iBAAA;gCAAmBb,YAAAA,EAAc;AAAmB;AAAE;AACrG,qBAAA;AACH;AACL,aAAA;AAEP,SAAA;QACD,CAAC8B,gCAAAA,CAASK,OAAO,GAAG;YAACxC,yCAAAA,CAAkB,SAAA,EAAWC,qCAAAA,CAAqBuC,OAAO,EAAE;gBAAE3B,KAAAA,EAAO;aAAkB,EAAG;gBAAEf,IAAAA,EAAM;oBAACA,IAAAA,CAAK,cAAA;AAAgB;AAAC,aAAA;AAAG,SAAA;AAChJ,QAAA,CAACqC,gCAAAA,CAASvB,IAAI,GAAGN,YAAAA,CAAaC,YAAAA,CAAAA;QAC9B,CAAC4B,gCAAAA,CAASM,UAAU,GAAG;YACnBzC,yCAAAA,CAAkB,YAAA,EAAcC,qCAAAA,CAAqBwC,UAAU,EAAE;gBAAEC,gBAAAA,EAAkB,eAAA;AAAiB5B,gBAAAA,KAAAA,EAAOgB,iBAAAA,CAAkBvB,YAAAA;AAAc,aAAA;AAChJ,SAAA;QACD,CAAC4B,gCAAAA,CAASQ,MAAM,GAAG;YAAC3C,yCAAAA,CAAkB,QAAA,EAAUC,qCAAAA,CAAqB0C,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAgD,aAAA;AAAG,SAAA;QACxI,CAACT,gCAAAA,CAASX,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ;;;;"}
@@ -0,0 +1,128 @@
1
+ 'use strict';
2
+
3
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
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
+ /**
8
+ * The navigation for this blueprint's gallery, declared once.
9
+ *
10
+ * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to
11
+ * the `Navigation` contribution point where the default blueprint's aggregation turns them back into
12
+ * navigation items. Maintaining a menu *and* a separate navigation declaration would mean two lists that
13
+ * agree right up until someone adds a screen to one of them.
14
+ *
15
+ * `navigationElement` and the contribution point name are the default blueprint's, not this package's.
16
+ * Reimplementing them here would produce a menu that looked identical and contributed to a contribution
17
+ * point nothing reads - which is the exact failure mode a blueprint-on-blueprint dependency exists to
18
+ * avoid.
19
+ */ const componentsNavigationEntries = [
20
+ {
21
+ label: 'Dashboard',
22
+ targetScreen: 'DashboardPage',
23
+ icon: 'pi pi-chart-bar',
24
+ group: 'Billing',
25
+ order: 10
26
+ },
27
+ {
28
+ label: 'Invoices',
29
+ targetScreen: 'DataListPage',
30
+ icon: 'pi pi-list',
31
+ group: 'Billing',
32
+ order: 20
33
+ },
34
+ {
35
+ label: 'In flight',
36
+ targetScreen: 'ObservableDataListPage',
37
+ icon: 'pi pi-bolt',
38
+ group: 'Billing',
39
+ order: 30
40
+ },
41
+ {
42
+ label: 'Invoices and detail',
43
+ targetScreen: 'DataListWithDetailPage',
44
+ icon: 'pi pi-window-maximize',
45
+ group: 'Billing',
46
+ order: 40
47
+ },
48
+ {
49
+ label: 'Master and detail',
50
+ targetScreen: 'MasterDetailPage',
51
+ icon: 'pi pi-table',
52
+ group: 'Billing',
53
+ order: 50
54
+ },
55
+ {
56
+ label: 'Register an invoice',
57
+ targetScreen: 'CommandFormPage',
58
+ icon: 'pi pi-plus-circle',
59
+ group: 'Billing',
60
+ order: 60
61
+ },
62
+ {
63
+ label: 'Event type schema',
64
+ targetScreen: 'SchemaEditorPage',
65
+ icon: 'pi pi-sitemap',
66
+ group: 'Inspect',
67
+ order: 10
68
+ },
69
+ {
70
+ label: 'Invoice document',
71
+ targetScreen: 'ObjectEditorPage',
72
+ icon: 'pi pi-file-edit',
73
+ group: 'Inspect',
74
+ order: 20
75
+ },
76
+ {
77
+ label: 'Billing module',
78
+ targetScreen: 'DataModulePage',
79
+ icon: 'pi pi-th-large',
80
+ group: 'Nesting',
81
+ order: 10
82
+ },
83
+ {
84
+ label: 'Adjustments feature',
85
+ targetScreen: 'DataFeatureSection',
86
+ icon: 'pi pi-folder',
87
+ group: 'Nesting',
88
+ order: 20
89
+ },
90
+ {
91
+ label: 'Record an adjustment',
92
+ targetScreen: 'CommandSliceSection',
93
+ icon: 'pi pi-pencil',
94
+ group: 'Nesting',
95
+ order: 30
96
+ }
97
+ ];
98
+ /**
99
+ * The navigation as contributions to the `Navigation` contribution point.
100
+ *
101
+ * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes
102
+ * from whatever is currently in scope - so a screen that contributes an extra entry gets it into the
103
+ * navigation without the navigation knowing that screen exists.
104
+ */ const componentsNavigationContributions = componentsNavigationEntries.map((entry)=>({
105
+ contributionPointName: scene_blueprint_default.navigationContributionPoint,
106
+ content: scene_blueprint_default.navigationElement(entry),
107
+ order: entry.order
108
+ }));
109
+ /** The navigation entries of one group, in order. */ function entriesInGroup(group) {
110
+ return componentsNavigationEntries.filter((entry)=>entry.group === group).sort((first, second)=>first.order - second.order);
111
+ }
112
+ /** Every group named by the navigation, in first-declared order. */ const componentsNavigationGroups = [
113
+ ...new Set(componentsNavigationEntries.map((entry)=>entry.group))
114
+ ];
115
+ /** The section a screen belongs to, for the first entry of its breadcrumb trail. */ function groupOfScreen(screenName) {
116
+ return componentsNavigationEntries.find((entry)=>entry.targetScreen === screenName)?.group;
117
+ }
118
+ /** The navigation label of a screen, for the last entry of its breadcrumb trail. */ function labelOfScreen(screenName) {
119
+ return componentsNavigationEntries.find((entry)=>entry.targetScreen === screenName)?.label;
120
+ }
121
+
122
+ exports.componentsNavigationContributions = componentsNavigationContributions;
123
+ exports.componentsNavigationEntries = componentsNavigationEntries;
124
+ exports.componentsNavigationGroups = componentsNavigationGroups;
125
+ exports.entriesInGroup = entriesInGroup;
126
+ exports.groupOfScreen = groupOfScreen;
127
+ exports.labelOfScreen = labelOfScreen;
128
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sources":["../../../gallery/navigation.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 { Contribution } from '@cratis/scene.model';\nimport { NavigationEntry, navigationContributionPoint, navigationElement } from '@cratis/scene.blueprint.default';\n\n/**\n * The navigation for this blueprint's gallery, declared once.\n *\n * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to\n * the `Navigation` contribution point where the default blueprint's aggregation turns them back into\n * navigation items. Maintaining a menu *and* a separate navigation declaration would mean two lists that\n * agree right up until someone adds a screen to one of them.\n *\n * `navigationElement` and the contribution point name are the default blueprint's, not this package's.\n * Reimplementing them here would produce a menu that looked identical and contributed to a contribution\n * point nothing reads - which is the exact failure mode a blueprint-on-blueprint dependency exists to\n * avoid.\n */\nexport const componentsNavigationEntries: NavigationEntry[] = [\n { label: 'Dashboard', targetScreen: 'DashboardPage', icon: 'pi pi-chart-bar', group: 'Billing', order: 10 },\n { label: 'Invoices', targetScreen: 'DataListPage', icon: 'pi pi-list', group: 'Billing', order: 20 },\n { label: 'In flight', targetScreen: 'ObservableDataListPage', icon: 'pi pi-bolt', group: 'Billing', order: 30 },\n { label: 'Invoices and detail', targetScreen: 'DataListWithDetailPage', icon: 'pi pi-window-maximize', group: 'Billing', order: 40 },\n { label: 'Master and detail', targetScreen: 'MasterDetailPage', icon: 'pi pi-table', group: 'Billing', order: 50 },\n { label: 'Register an invoice', targetScreen: 'CommandFormPage', icon: 'pi pi-plus-circle', group: 'Billing', order: 60 },\n { label: 'Event type schema', targetScreen: 'SchemaEditorPage', icon: 'pi pi-sitemap', group: 'Inspect', order: 10 },\n { label: 'Invoice document', targetScreen: 'ObjectEditorPage', icon: 'pi pi-file-edit', group: 'Inspect', order: 20 },\n { label: 'Billing module', targetScreen: 'DataModulePage', icon: 'pi pi-th-large', group: 'Nesting', order: 10 },\n { label: 'Adjustments feature', targetScreen: 'DataFeatureSection', icon: 'pi pi-folder', group: 'Nesting', order: 20 },\n { label: 'Record an adjustment', targetScreen: 'CommandSliceSection', icon: 'pi pi-pencil', group: 'Nesting', order: 30 },\n];\n\n/**\n * The navigation as contributions to the `Navigation` contribution point.\n *\n * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes\n * from whatever is currently in scope - so a screen that contributes an extra entry gets it into the\n * navigation without the navigation knowing that screen exists.\n */\nexport const componentsNavigationContributions: Contribution[] = componentsNavigationEntries.map(entry => ({\n contributionPointName: navigationContributionPoint,\n content: navigationElement(entry),\n order: entry.order,\n}));\n\n/** The navigation entries of one group, in order. */\nexport function entriesInGroup(group: string): NavigationEntry[] {\n return componentsNavigationEntries.filter(entry => entry.group === group).sort((first, second) => first.order - second.order);\n}\n\n/** Every group named by the navigation, in first-declared order. */\nexport const componentsNavigationGroups: string[] = [...new Set(componentsNavigationEntries.map(entry => entry.group))];\n\n/** The section a screen belongs to, for the first entry of its breadcrumb trail. */\nexport function groupOfScreen(screenName: string): string | undefined {\n return componentsNavigationEntries.find(entry => entry.targetScreen === screenName)?.group;\n}\n\n/** The navigation label of a screen, for the last entry of its breadcrumb trail. */\nexport function labelOfScreen(screenName: string): string | undefined {\n return componentsNavigationEntries.find(entry => entry.targetScreen === screenName)?.label;\n}\n"],"names":["componentsNavigationEntries","label","targetScreen","icon","group","order","componentsNavigationContributions","map","entry","contributionPointName","navigationContributionPoint","content","navigationElement","entriesInGroup","filter","sort","first","second","componentsNavigationGroups","Set","groupOfScreen","screenName","find","labelOfScreen"],"mappings":";;;;AAAA;AACA;AAKA;;;;;;;;;;;;UAaaA,2BAAAA,GAAiD;AAC1D,IAAA;QAAEC,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,eAAA;QAAiBC,IAAAA,EAAM,iBAAA;QAAmBC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG,KAAA;AAC1G,IAAA;QAAEJ,KAAAA,EAAO,UAAA;QAAYC,YAAAA,EAAc,cAAA;QAAgBC,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,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/scene.react');
4
+ var scene_components = require('@cratis/scene.components');
5
+ var scene_blueprint_default = require('@cratis/scene.blueprint.default');
6
+ var ComponentName = require('../ComponentName.js');
7
+ var packageName = require('../packageName.js');
8
+
9
+ // Copyright (c) Cratis. All rights reserved.
10
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
11
+ /**
12
+ * The names this blueprint borrows from `PrimeReact`.
13
+ *
14
+ * Every other package in the catalog below contributes its *real* manifest, because this package takes an
15
+ * npm dependency on each of them. `PrimeReact` is the exception: this blueprint depends on it in the
16
+ * manifest sense - `column` comes from there - without depending on its bundle, so its declaration is not
17
+ * importable here and the borrowed names are written out instead.
18
+ *
19
+ * Every name below was checked against `primeReactPackage.ts`'s own component list rather than assumed.
20
+ * The default blueprint learned why that matters when it referenced `chart` and `fileUpload`, which
21
+ * neither library declares - names that look obvious and render as dashed red boxes.
22
+ *
23
+ * A host that has all five packages loaded should build this catalog from their manifests instead. The
24
+ * shape is the same, and anything that has drifted then fails this blueprint's specs rather than a preview.
25
+ */ const primeReactComponentNames = [
26
+ 'column',
27
+ 'dataTable',
28
+ 'table',
29
+ 'dialog',
30
+ 'button',
31
+ 'card',
32
+ 'text',
33
+ 'toolbar',
34
+ 'dropdown',
35
+ 'tooltip',
36
+ 'menu',
37
+ 'breadcrumb',
38
+ 'sidebar'
39
+ ];
40
+ /**
41
+ * The profile this blueprint's templates resolve against.
42
+ *
43
+ * Declaration order is ascending priority, which is why this exact order matters rather than being
44
+ * cosmetic. `Cratis.Components` outranks `PrimeReact`, so a template naming `table` or `dialog` gets the
45
+ * Arc-aware one and PrimeReact's is recorded as shadowed. Both blueprints outrank both libraries, so
46
+ * `pageHeader` and `arcPageHeader` resolve to the packages that declare them. And this blueprint sits at
47
+ * the top, which costs nothing today - it declares one name nobody else does - but is the correct place
48
+ * for the package doing the layering.
49
+ *
50
+ * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's
51
+ * compatibility is checked against exactly what a profile declares, and a profile leaning on the implicit
52
+ * fallback would make a theme look incompatible with a package the profile never admitted to using.
53
+ *
54
+ * Unlike the default blueprint, this package needs no separate *preview* profile. That blueprint takes no
55
+ * npm dependency on the libraries its templates reference, so previewing it from its own package resolves
56
+ * most names to implementations that are not loaded. This one depends on `@cratis/scene.components` and
57
+ * `@cratis/scene.blueprint.default` for real, so everything its templates name is loadable except
58
+ * PrimeReact's `column` - and a `column` never reaches the DOM at design time anyway, because the table it
59
+ * belongs to is a placeholder until a host registers its query.
60
+ */ const componentsBlueprintProfile = {
61
+ name: 'Arc pages',
62
+ targetPlatform: 'web',
63
+ packages: [
64
+ 'core',
65
+ 'PrimeReact',
66
+ scene_components.cratisComponentsPackageManifest.name,
67
+ scene_blueprint_default.defaultBlueprintName,
68
+ packageName.componentsBlueprintName
69
+ ]
70
+ };
71
+ /**
72
+ * The component catalog the templates resolve against.
73
+ *
74
+ * Four of the five entries are the owning package's real declared list, read straight off its manifest, so
75
+ * a name renamed upstream fails a spec here instead of rendering as a dashed box in someone's application.
76
+ */ const componentsBlueprintCatalog = {
77
+ [scene_react.corePackageManifest.name]: scene_react.corePackageManifest.components,
78
+ PrimeReact: primeReactComponentNames,
79
+ [scene_components.cratisComponentsPackageManifest.name]: scene_components.cratisComponentsPackageManifest.components,
80
+ [scene_blueprint_default.defaultBlueprintName]: scene_blueprint_default.defaultBlueprintManifest.components,
81
+ [packageName.componentsBlueprintName]: Object.values(ComponentName.ComponentName)
82
+ };
83
+
84
+ exports.componentsBlueprintCatalog = componentsBlueprintCatalog;
85
+ exports.componentsBlueprintProfile = componentsBlueprintProfile;
86
+ exports.primeReactComponentNames = primeReactComponentNames;
87
+ //# sourceMappingURL=previewProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewProfile.js","sources":["../../../gallery/previewProfile.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 { UiProfile } from '@cratis/scene.model';\nimport { PackageCatalog } from '@cratis/scene.engine';\nimport { corePackageManifest } from '@cratis/scene.react';\nimport { cratisComponentsPackageManifest } from '@cratis/scene.components';\nimport { defaultBlueprintManifest, defaultBlueprintName } from '@cratis/scene.blueprint.default';\nimport { ComponentName } from '../ComponentName';\nimport { componentsBlueprintName } from '../packageName';\n\n/**\n * The names this blueprint borrows from `PrimeReact`.\n *\n * Every other package in the catalog below contributes its *real* manifest, because this package takes an\n * npm dependency on each of them. `PrimeReact` is the exception: this blueprint depends on it in the\n * manifest sense - `column` comes from there - without depending on its bundle, so its declaration is not\n * importable here and the borrowed names are written out instead.\n *\n * Every name below was checked against `primeReactPackage.ts`'s own component list rather than assumed.\n * The default blueprint learned why that matters when it referenced `chart` and `fileUpload`, which\n * neither library declares - names that look obvious and render as dashed red boxes.\n *\n * A host that has all five packages loaded should build this catalog from their manifests instead. The\n * shape is the same, and anything that has drifted then fails this blueprint's specs rather than a preview.\n */\nexport const primeReactComponentNames: string[] = ['column', 'dataTable', 'table', 'dialog', 'button', 'card', 'text', 'toolbar', 'dropdown', 'tooltip', 'menu', 'breadcrumb', 'sidebar'];\n\n/**\n * The profile this blueprint's templates resolve against.\n *\n * Declaration order is ascending priority, which is why this exact order matters rather than being\n * cosmetic. `Cratis.Components` outranks `PrimeReact`, so a template naming `table` or `dialog` gets the\n * Arc-aware one and PrimeReact's is recorded as shadowed. Both blueprints outrank both libraries, so\n * `pageHeader` and `arcPageHeader` resolve to the packages that declare them. And this blueprint sits at\n * the top, which costs nothing today - it declares one name nobody else does - but is the correct place\n * for the package doing the layering.\n *\n * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's\n * compatibility is checked against exactly what a profile declares, and a profile leaning on the implicit\n * fallback would make a theme look incompatible with a package the profile never admitted to using.\n *\n * Unlike the default blueprint, this package needs no separate *preview* profile. That blueprint takes no\n * npm dependency on the libraries its templates reference, so previewing it from its own package resolves\n * most names to implementations that are not loaded. This one depends on `@cratis/scene.components` and\n * `@cratis/scene.blueprint.default` for real, so everything its templates name is loadable except\n * PrimeReact's `column` - and a `column` never reaches the DOM at design time anyway, because the table it\n * belongs to is a placeholder until a host registers its query.\n */\nexport const componentsBlueprintProfile: UiProfile = {\n name: 'Arc pages',\n targetPlatform: 'web',\n packages: ['core', 'PrimeReact', cratisComponentsPackageManifest.name, defaultBlueprintName, componentsBlueprintName],\n};\n\n/**\n * The component catalog the templates resolve against.\n *\n * Four of the five entries are the owning package's real declared list, read straight off its manifest, so\n * a name renamed upstream fails a spec here instead of rendering as a dashed box in someone's application.\n */\nexport const componentsBlueprintCatalog: PackageCatalog = {\n [corePackageManifest.name]: corePackageManifest.components,\n PrimeReact: primeReactComponentNames,\n [cratisComponentsPackageManifest.name]: cratisComponentsPackageManifest.components,\n [defaultBlueprintName]: defaultBlueprintManifest.components,\n [componentsBlueprintName]: Object.values(ComponentName),\n};\n"],"names":["primeReactComponentNames","componentsBlueprintProfile","name","targetPlatform","packages","cratisComponentsPackageManifest","defaultBlueprintName","componentsBlueprintName","componentsBlueprintCatalog","corePackageManifest","components","PrimeReact","defaultBlueprintManifest","Object","values","ComponentName"],"mappings":";;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;UAeaA,wBAAAA,GAAqC;AAAC,IAAA,QAAA;AAAU,IAAA,WAAA;AAAa,IAAA,OAAA;AAAS,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,MAAA;AAAQ,IAAA,MAAA;AAAQ,IAAA,SAAA;AAAW,IAAA,UAAA;AAAY,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA;;AAE/K;;;;;;;;;;;;;;;;;;;;UAqBaC,0BAAAA,GAAwC;IACjDC,IAAAA,EAAM,WAAA;IACNC,cAAAA,EAAgB,KAAA;IAChBC,QAAAA,EAAU;AAAC,QAAA,MAAA;AAAQ,QAAA,YAAA;AAAcC,QAAAA,gDAAAA,CAAgCH,IAAI;AAAEI,QAAAA,4CAAAA;AAAsBC,QAAAA;AAAwB;AACzH;AAEA;;;;;UAMaC,0BAAAA,GAA6C;AACtD,IAAA,CAACC,+BAAAA,CAAoBP,IAAI,GAAGO,gCAAoBC,UAAU;IAC1DC,UAAAA,EAAYX,wBAAAA;AACZ,IAAA,CAACK,gDAAAA,CAAgCH,IAAI,GAAGG,iDAAgCK,UAAU;IAClF,CAACJ,4CAAAA,GAAuBM,gDAAAA,CAAyBF,UAAU;AAC3D,IAAA,CAACH,mCAAAA,GAA0BM,MAAAA,CAAOC,MAAM,CAACC,2BAAAA;AAC7C;;;;;;"}