@cratis/scene.blueprint.default 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 (558) hide show
  1. package/.storybook/main.ts +32 -0
  2. package/.storybook/preview.ts +20 -0
  3. package/ComponentName.ts +60 -0
  4. package/README.md +204 -0
  5. package/configuration/ColorScheme.ts +17 -0
  6. package/configuration/LayoutConfigProvider.tsx +182 -0
  7. package/configuration/LayoutConfigState.ts +46 -0
  8. package/configuration/LayoutMode.ts +50 -0
  9. package/configuration/MenuTheme.ts +24 -0
  10. package/configuration/index.ts +11 -0
  11. package/configuration/layoutConfigStorage.ts +102 -0
  12. package/configuration/layoutConfigTransitions.ts +150 -0
  13. package/configuration/layoutWrapperClasses.ts +68 -0
  14. package/defaultBlueprint.ts +66 -0
  15. package/defaultBlueprintComponents.ts +51 -0
  16. package/dist/cjs/ComponentName.js +33 -0
  17. package/dist/cjs/ComponentName.js.map +1 -0
  18. package/dist/cjs/configuration/ColorScheme.js +23 -0
  19. package/dist/cjs/configuration/ColorScheme.js.map +1 -0
  20. package/dist/cjs/configuration/LayoutConfigProvider.js +96 -0
  21. package/dist/cjs/configuration/LayoutConfigProvider.js.map +1 -0
  22. package/dist/cjs/configuration/LayoutMode.js +38 -0
  23. package/dist/cjs/configuration/LayoutMode.js.map +1 -0
  24. package/dist/cjs/configuration/MenuTheme.js +26 -0
  25. package/dist/cjs/configuration/MenuTheme.js.map +1 -0
  26. package/dist/cjs/configuration/layoutConfigStorage.js +85 -0
  27. package/dist/cjs/configuration/layoutConfigStorage.js.map +1 -0
  28. package/dist/cjs/configuration/layoutConfigTransitions.js +158 -0
  29. package/dist/cjs/configuration/layoutConfigTransitions.js.map +1 -0
  30. package/dist/cjs/configuration/layoutWrapperClasses.js +62 -0
  31. package/dist/cjs/configuration/layoutWrapperClasses.js.map +1 -0
  32. package/dist/cjs/defaultBlueprint.js +92 -0
  33. package/dist/cjs/defaultBlueprint.js.map +1 -0
  34. package/dist/cjs/defaultBlueprintComponents.js +54 -0
  35. package/dist/cjs/defaultBlueprintComponents.js.map +1 -0
  36. package/dist/cjs/gallery/GalleryScreenPreview.js +63 -0
  37. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
  38. package/dist/cjs/gallery/TemplateSlotName.js +25 -0
  39. package/dist/cjs/gallery/TemplateSlotName.js.map +1 -0
  40. package/dist/cjs/gallery/applicationChrome.js +134 -0
  41. package/dist/cjs/gallery/applicationChrome.js.map +1 -0
  42. package/dist/cjs/gallery/authTemplates.js +234 -0
  43. package/dist/cjs/gallery/authTemplates.js.map +1 -0
  44. package/dist/cjs/gallery/componentNames.js +53 -0
  45. package/dist/cjs/gallery/componentNames.js.map +1 -0
  46. package/dist/cjs/gallery/composeScreen.js +99 -0
  47. package/dist/cjs/gallery/composeScreen.js.map +1 -0
  48. package/dist/cjs/gallery/dependencyComponentNames.js +72 -0
  49. package/dist/cjs/gallery/dependencyComponentNames.js.map +1 -0
  50. package/dist/cjs/gallery/dialogTemplates.js +161 -0
  51. package/dist/cjs/gallery/dialogTemplates.js.map +1 -0
  52. package/dist/cjs/gallery/elements.js +80 -0
  53. package/dist/cjs/gallery/elements.js.map +1 -0
  54. package/dist/cjs/gallery/navigation.js +129 -0
  55. package/dist/cjs/gallery/navigation.js.map +1 -0
  56. package/dist/cjs/gallery/nesting.js +129 -0
  57. package/dist/cjs/gallery/nesting.js.map +1 -0
  58. package/dist/cjs/gallery/previewProfile.js +68 -0
  59. package/dist/cjs/gallery/previewProfile.js.map +1 -0
  60. package/dist/cjs/gallery/resolveElementNames.js +63 -0
  61. package/dist/cjs/gallery/resolveElementNames.js.map +1 -0
  62. package/dist/cjs/gallery/screens.js +222 -0
  63. package/dist/cjs/gallery/screens.js.map +1 -0
  64. package/dist/cjs/gallery/statusTemplates.js +190 -0
  65. package/dist/cjs/gallery/statusTemplates.js.map +1 -0
  66. package/dist/cjs/gallery/supportTemplates.js +319 -0
  67. package/dist/cjs/gallery/supportTemplates.js.map +1 -0
  68. package/dist/cjs/gallery/widgets.js +94 -0
  69. package/dist/cjs/gallery/widgets.js.map +1 -0
  70. package/dist/cjs/gallery/workspaceTemplates.js +395 -0
  71. package/dist/cjs/gallery/workspaceTemplates.js.map +1 -0
  72. package/dist/cjs/index.js +220 -0
  73. package/dist/cjs/index.js.map +1 -0
  74. package/dist/cjs/layouts/LayoutName.js +19 -0
  75. package/dist/cjs/layouts/LayoutName.js.map +1 -0
  76. package/dist/cjs/layouts/SlotName.js +31 -0
  77. package/dist/cjs/layouts/SlotName.js.map +1 -0
  78. package/dist/cjs/layouts/appShell.js +160 -0
  79. package/dist/cjs/layouts/appShell.js.map +1 -0
  80. package/dist/cjs/layouts/defaultLayouts.js +20 -0
  81. package/dist/cjs/layouts/defaultLayouts.js.map +1 -0
  82. package/dist/cjs/layouts/flowBuilders.js +66 -0
  83. package/dist/cjs/layouts/flowBuilders.js.map +1 -0
  84. package/dist/cjs/layouts/fullPage.js +78 -0
  85. package/dist/cjs/layouts/fullPage.js.map +1 -0
  86. package/dist/cjs/layouts/shellComponents.js +29 -0
  87. package/dist/cjs/layouts/shellComponents.js.map +1 -0
  88. package/dist/cjs/package.json +3 -0
  89. package/dist/cjs/packageName.js +15 -0
  90. package/dist/cjs/packageName.js.map +1 -0
  91. package/dist/cjs/shell/AppShell.js +88 -0
  92. package/dist/cjs/shell/AppShell.js.map +1 -0
  93. package/dist/cjs/shell/Breadcrumb.js +33 -0
  94. package/dist/cjs/shell/Breadcrumb.js.map +1 -0
  95. package/dist/cjs/shell/ConfigPanel.js +128 -0
  96. package/dist/cjs/shell/ConfigPanel.js.map +1 -0
  97. package/dist/cjs/shell/Footer.js +28 -0
  98. package/dist/cjs/shell/Footer.js.map +1 -0
  99. package/dist/cjs/shell/FullPageShell.js +53 -0
  100. package/dist/cjs/shell/FullPageShell.js.map +1 -0
  101. package/dist/cjs/shell/LayoutModeSwitcher.js +58 -0
  102. package/dist/cjs/shell/LayoutModeSwitcher.js.map +1 -0
  103. package/dist/cjs/shell/Logo.js +44 -0
  104. package/dist/cjs/shell/Logo.js.map +1 -0
  105. package/dist/cjs/shell/Mask.js +34 -0
  106. package/dist/cjs/shell/Mask.js.map +1 -0
  107. package/dist/cjs/shell/Menu.js +36 -0
  108. package/dist/cjs/shell/Menu.js.map +1 -0
  109. package/dist/cjs/shell/MenuItem.js +65 -0
  110. package/dist/cjs/shell/MenuItem.js.map +1 -0
  111. package/dist/cjs/shell/PageHeader.js +43 -0
  112. package/dist/cjs/shell/PageHeader.js.map +1 -0
  113. package/dist/cjs/shell/RightPanel.js +30 -0
  114. package/dist/cjs/shell/RightPanel.js.map +1 -0
  115. package/dist/cjs/shell/Sidebar.js +51 -0
  116. package/dist/cjs/shell/Sidebar.js.map +1 -0
  117. package/dist/cjs/shell/ThemeOption.js +42 -0
  118. package/dist/cjs/shell/ThemeOption.js.map +1 -0
  119. package/dist/cjs/shell/ThemeSwitcher.js +50 -0
  120. package/dist/cjs/shell/ThemeSwitcher.js.map +1 -0
  121. package/dist/cjs/shell/Topbar.js +54 -0
  122. package/dist/cjs/shell/Topbar.js.map +1 -0
  123. package/dist/cjs/shell/UserMenu.js +68 -0
  124. package/dist/cjs/shell/UserMenu.js.map +1 -0
  125. package/dist/cjs/shell/elementProperties.js +56 -0
  126. package/dist/cjs/shell/elementProperties.js.map +1 -0
  127. package/dist/cjs/themes/LayoutThemeProvider.js +33 -0
  128. package/dist/cjs/themes/LayoutThemeProvider.js.map +1 -0
  129. package/dist/cjs/themes/blueprintThemeCompatibility.js +28 -0
  130. package/dist/cjs/themes/blueprintThemeCompatibility.js.map +1 -0
  131. package/dist/cjs/themes/dark.js +40 -0
  132. package/dist/cjs/themes/dark.js.map +1 -0
  133. package/dist/cjs/themes/defaultBlueprintThemes.js +19 -0
  134. package/dist/cjs/themes/defaultBlueprintThemes.js.map +1 -0
  135. package/dist/cjs/themes/light.js +43 -0
  136. package/dist/cjs/themes/light.js.map +1 -0
  137. package/dist/esm/ComponentName.d.ts +19 -0
  138. package/dist/esm/ComponentName.d.ts.map +1 -0
  139. package/dist/esm/ComponentName.js +31 -0
  140. package/dist/esm/ComponentName.js.map +1 -0
  141. package/dist/esm/configuration/ColorScheme.d.ts +6 -0
  142. package/dist/esm/configuration/ColorScheme.d.ts.map +1 -0
  143. package/dist/esm/configuration/ColorScheme.js +20 -0
  144. package/dist/esm/configuration/ColorScheme.js.map +1 -0
  145. package/dist/esm/configuration/LayoutConfigProvider.d.ts +29 -0
  146. package/dist/esm/configuration/LayoutConfigProvider.d.ts.map +1 -0
  147. package/dist/esm/configuration/LayoutConfigProvider.js +92 -0
  148. package/dist/esm/configuration/LayoutConfigProvider.js.map +1 -0
  149. package/dist/esm/configuration/LayoutConfigState.d.ts +14 -0
  150. package/dist/esm/configuration/LayoutConfigState.d.ts.map +1 -0
  151. package/dist/esm/configuration/LayoutConfigState.js +2 -0
  152. package/dist/esm/configuration/LayoutConfigState.js.map +1 -0
  153. package/dist/esm/configuration/LayoutMode.d.ts +12 -0
  154. package/dist/esm/configuration/LayoutMode.d.ts.map +1 -0
  155. package/dist/esm/configuration/LayoutMode.js +35 -0
  156. package/dist/esm/configuration/LayoutMode.js.map +1 -0
  157. package/dist/esm/configuration/MenuTheme.d.ts +7 -0
  158. package/dist/esm/configuration/MenuTheme.d.ts.map +1 -0
  159. package/dist/esm/configuration/MenuTheme.js +23 -0
  160. package/dist/esm/configuration/MenuTheme.js.map +1 -0
  161. package/dist/esm/configuration/index.d.ts +9 -0
  162. package/dist/esm/configuration/index.d.ts.map +1 -0
  163. package/dist/esm/configuration/index.js +9 -0
  164. package/dist/esm/configuration/index.js.map +1 -0
  165. package/dist/esm/configuration/layoutConfigStorage.d.ts +6 -0
  166. package/dist/esm/configuration/layoutConfigStorage.d.ts.map +1 -0
  167. package/dist/esm/configuration/layoutConfigStorage.js +81 -0
  168. package/dist/esm/configuration/layoutConfigStorage.js.map +1 -0
  169. package/dist/esm/configuration/layoutConfigTransitions.d.ts +22 -0
  170. package/dist/esm/configuration/layoutConfigTransitions.d.ts.map +1 -0
  171. package/dist/esm/configuration/layoutConfigTransitions.js +140 -0
  172. package/dist/esm/configuration/layoutConfigTransitions.js.map +1 -0
  173. package/dist/esm/configuration/layoutWrapperClasses.d.ts +4 -0
  174. package/dist/esm/configuration/layoutWrapperClasses.d.ts.map +1 -0
  175. package/dist/esm/configuration/layoutWrapperClasses.js +59 -0
  176. package/dist/esm/configuration/layoutWrapperClasses.js.map +1 -0
  177. package/dist/esm/defaultBlueprint.d.ts +5 -0
  178. package/dist/esm/defaultBlueprint.d.ts.map +1 -0
  179. package/dist/esm/defaultBlueprint.js +89 -0
  180. package/dist/esm/defaultBlueprint.js.map +1 -0
  181. package/dist/esm/defaultBlueprintComponents.d.ts +3 -0
  182. package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -0
  183. package/dist/esm/defaultBlueprintComponents.js +52 -0
  184. package/dist/esm/defaultBlueprintComponents.js.map +1 -0
  185. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts +2 -0
  186. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts.map +1 -0
  187. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +60 -0
  188. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +1 -0
  189. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts +2 -0
  190. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts.map +1 -0
  191. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js +60 -0
  192. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js.map +1 -0
  193. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
  194. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
  195. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js +26 -0
  196. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
  197. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts +2 -0
  198. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts.map +1 -0
  199. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js +32 -0
  200. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js.map +1 -0
  201. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts +2 -0
  202. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts.map +1 -0
  203. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js +40 -0
  204. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js.map +1 -0
  205. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
  206. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
  207. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js +27 -0
  208. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
  209. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
  210. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
  211. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +41 -0
  212. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
  213. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
  214. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
  215. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js +31 -0
  216. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
  217. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
  218. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
  219. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js +33 -0
  220. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
  221. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts +2 -0
  222. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
  223. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js +44 -0
  224. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js.map +1 -0
  225. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts +2 -0
  226. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts.map +1 -0
  227. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js +60 -0
  228. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js.map +1 -0
  229. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts +2 -0
  230. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts.map +1 -0
  231. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js +28 -0
  232. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js.map +1 -0
  233. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts +2 -0
  234. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map +1 -0
  235. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js +38 -0
  236. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js.map +1 -0
  237. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts +2 -0
  238. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts.map +1 -0
  239. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js +39 -0
  240. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js.map +1 -0
  241. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts +2 -0
  242. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts.map +1 -0
  243. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js +37 -0
  244. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js.map +1 -0
  245. package/dist/esm/gallery/ApplicationScreens.stories.d.ts +31 -0
  246. package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -0
  247. package/dist/esm/gallery/ApplicationScreens.stories.js +29 -0
  248. package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -0
  249. package/dist/esm/gallery/FullPageScreens.stories.d.ts +28 -0
  250. package/dist/esm/gallery/FullPageScreens.stories.d.ts.map +1 -0
  251. package/dist/esm/gallery/FullPageScreens.stories.js +26 -0
  252. package/dist/esm/gallery/FullPageScreens.stories.js.map +1 -0
  253. package/dist/esm/gallery/GalleryScreenPreview.d.ts +12 -0
  254. package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
  255. package/dist/esm/gallery/GalleryScreenPreview.js +60 -0
  256. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
  257. package/dist/esm/gallery/NavigationEntry.d.ts +8 -0
  258. package/dist/esm/gallery/NavigationEntry.d.ts.map +1 -0
  259. package/dist/esm/gallery/NavigationEntry.js +2 -0
  260. package/dist/esm/gallery/NavigationEntry.js.map +1 -0
  261. package/dist/esm/gallery/TemplateSlotName.d.ts +11 -0
  262. package/dist/esm/gallery/TemplateSlotName.d.ts.map +1 -0
  263. package/dist/esm/gallery/TemplateSlotName.js +23 -0
  264. package/dist/esm/gallery/TemplateSlotName.js.map +1 -0
  265. package/dist/esm/gallery/applicationChrome.d.ts +8 -0
  266. package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
  267. package/dist/esm/gallery/applicationChrome.js +131 -0
  268. package/dist/esm/gallery/applicationChrome.js.map +1 -0
  269. package/dist/esm/gallery/authTemplates.d.ts +9 -0
  270. package/dist/esm/gallery/authTemplates.d.ts.map +1 -0
  271. package/dist/esm/gallery/authTemplates.js +226 -0
  272. package/dist/esm/gallery/authTemplates.js.map +1 -0
  273. package/dist/esm/gallery/componentNames.d.ts +4 -0
  274. package/dist/esm/gallery/componentNames.d.ts.map +1 -0
  275. package/dist/esm/gallery/componentNames.js +50 -0
  276. package/dist/esm/gallery/componentNames.js.map +1 -0
  277. package/dist/esm/gallery/composeScreen.d.ts +5 -0
  278. package/dist/esm/gallery/composeScreen.d.ts.map +1 -0
  279. package/dist/esm/gallery/composeScreen.js +95 -0
  280. package/dist/esm/gallery/composeScreen.js.map +1 -0
  281. package/dist/esm/gallery/dependencyComponentNames.d.ts +4 -0
  282. package/dist/esm/gallery/dependencyComponentNames.d.ts.map +1 -0
  283. package/dist/esm/gallery/dependencyComponentNames.js +68 -0
  284. package/dist/esm/gallery/dependencyComponentNames.js.map +1 -0
  285. package/dist/esm/gallery/dialogTemplates.d.ts +6 -0
  286. package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -0
  287. package/dist/esm/gallery/dialogTemplates.js +156 -0
  288. package/dist/esm/gallery/dialogTemplates.js.map +1 -0
  289. package/dist/esm/gallery/elements.d.ts +7 -0
  290. package/dist/esm/gallery/elements.d.ts.map +1 -0
  291. package/dist/esm/gallery/elements.js +74 -0
  292. package/dist/esm/gallery/elements.js.map +1 -0
  293. package/dist/esm/gallery/index.d.ts +20 -0
  294. package/dist/esm/gallery/index.d.ts.map +1 -0
  295. package/dist/esm/gallery/index.js +20 -0
  296. package/dist/esm/gallery/index.js.map +1 -0
  297. package/dist/esm/gallery/navigation.d.ts +9 -0
  298. package/dist/esm/gallery/navigation.d.ts.map +1 -0
  299. package/dist/esm/gallery/navigation.js +122 -0
  300. package/dist/esm/gallery/navigation.js.map +1 -0
  301. package/dist/esm/gallery/nesting.d.ts +6 -0
  302. package/dist/esm/gallery/nesting.d.ts.map +1 -0
  303. package/dist/esm/gallery/nesting.js +124 -0
  304. package/dist/esm/gallery/nesting.js.map +1 -0
  305. package/dist/esm/gallery/previewProfile.d.ts +6 -0
  306. package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
  307. package/dist/esm/gallery/previewProfile.js +64 -0
  308. package/dist/esm/gallery/previewProfile.js.map +1 -0
  309. package/dist/esm/gallery/resolveElementNames.d.ts +4 -0
  310. package/dist/esm/gallery/resolveElementNames.d.ts.map +1 -0
  311. package/dist/esm/gallery/resolveElementNames.js +61 -0
  312. package/dist/esm/gallery/resolveElementNames.js.map +1 -0
  313. package/dist/esm/gallery/screens.d.ts +5 -0
  314. package/dist/esm/gallery/screens.d.ts.map +1 -0
  315. package/dist/esm/gallery/screens.js +218 -0
  316. package/dist/esm/gallery/screens.js.map +1 -0
  317. package/dist/esm/gallery/statusTemplates.d.ts +7 -0
  318. package/dist/esm/gallery/statusTemplates.d.ts.map +1 -0
  319. package/dist/esm/gallery/statusTemplates.js +184 -0
  320. package/dist/esm/gallery/statusTemplates.js.map +1 -0
  321. package/dist/esm/gallery/supportTemplates.d.ts +8 -0
  322. package/dist/esm/gallery/supportTemplates.d.ts.map +1 -0
  323. package/dist/esm/gallery/supportTemplates.js +312 -0
  324. package/dist/esm/gallery/supportTemplates.js.map +1 -0
  325. package/dist/esm/gallery/widgets.d.ts +12 -0
  326. package/dist/esm/gallery/widgets.d.ts.map +1 -0
  327. package/dist/esm/gallery/widgets.js +86 -0
  328. package/dist/esm/gallery/widgets.js.map +1 -0
  329. package/dist/esm/gallery/workspaceTemplates.d.ts +8 -0
  330. package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -0
  331. package/dist/esm/gallery/workspaceTemplates.js +388 -0
  332. package/dist/esm/gallery/workspaceTemplates.js.map +1 -0
  333. package/dist/esm/index.d.ts +10 -0
  334. package/dist/esm/index.d.ts.map +1 -0
  335. package/dist/esm/index.js +60 -0
  336. package/dist/esm/index.js.map +1 -0
  337. package/dist/esm/layouts/LayoutName.d.ts +5 -0
  338. package/dist/esm/layouts/LayoutName.d.ts.map +1 -0
  339. package/dist/esm/layouts/LayoutName.js +17 -0
  340. package/dist/esm/layouts/LayoutName.js.map +1 -0
  341. package/dist/esm/layouts/SlotName.d.ts +12 -0
  342. package/dist/esm/layouts/SlotName.d.ts.map +1 -0
  343. package/dist/esm/layouts/SlotName.js +29 -0
  344. package/dist/esm/layouts/SlotName.js.map +1 -0
  345. package/dist/esm/layouts/appShell.d.ts +8 -0
  346. package/dist/esm/layouts/appShell.d.ts.map +1 -0
  347. package/dist/esm/layouts/appShell.js +153 -0
  348. package/dist/esm/layouts/appShell.js.map +1 -0
  349. package/dist/esm/layouts/defaultLayouts.d.ts +3 -0
  350. package/dist/esm/layouts/defaultLayouts.d.ts.map +1 -0
  351. package/dist/esm/layouts/defaultLayouts.js +18 -0
  352. package/dist/esm/layouts/defaultLayouts.js.map +1 -0
  353. package/dist/esm/layouts/flowBuilders.d.ts +6 -0
  354. package/dist/esm/layouts/flowBuilders.d.ts.map +1 -0
  355. package/dist/esm/layouts/flowBuilders.js +61 -0
  356. package/dist/esm/layouts/flowBuilders.js.map +1 -0
  357. package/dist/esm/layouts/fullPage.d.ts +6 -0
  358. package/dist/esm/layouts/fullPage.d.ts.map +1 -0
  359. package/dist/esm/layouts/fullPage.js +73 -0
  360. package/dist/esm/layouts/fullPage.js.map +1 -0
  361. package/dist/esm/layouts/index.d.ts +8 -0
  362. package/dist/esm/layouts/index.d.ts.map +1 -0
  363. package/dist/esm/layouts/index.js +8 -0
  364. package/dist/esm/layouts/index.js.map +1 -0
  365. package/dist/esm/layouts/shellComponents.d.ts +3 -0
  366. package/dist/esm/layouts/shellComponents.d.ts.map +1 -0
  367. package/dist/esm/layouts/shellComponents.js +27 -0
  368. package/dist/esm/layouts/shellComponents.js.map +1 -0
  369. package/dist/esm/package.json +3 -0
  370. package/dist/esm/packageName.d.ts +2 -0
  371. package/dist/esm/packageName.d.ts.map +1 -0
  372. package/dist/esm/packageName.js +13 -0
  373. package/dist/esm/packageName.js.map +1 -0
  374. package/dist/esm/shell/AppShell.d.ts +3 -0
  375. package/dist/esm/shell/AppShell.d.ts.map +1 -0
  376. package/dist/esm/shell/AppShell.js +86 -0
  377. package/dist/esm/shell/AppShell.js.map +1 -0
  378. package/dist/esm/shell/Breadcrumb.d.ts +3 -0
  379. package/dist/esm/shell/Breadcrumb.d.ts.map +1 -0
  380. package/dist/esm/shell/Breadcrumb.js +31 -0
  381. package/dist/esm/shell/Breadcrumb.js.map +1 -0
  382. package/dist/esm/shell/ConfigPanel.d.ts +3 -0
  383. package/dist/esm/shell/ConfigPanel.d.ts.map +1 -0
  384. package/dist/esm/shell/ConfigPanel.js +126 -0
  385. package/dist/esm/shell/ConfigPanel.js.map +1 -0
  386. package/dist/esm/shell/Footer.d.ts +3 -0
  387. package/dist/esm/shell/Footer.d.ts.map +1 -0
  388. package/dist/esm/shell/Footer.js +26 -0
  389. package/dist/esm/shell/Footer.js.map +1 -0
  390. package/dist/esm/shell/FullPageShell.d.ts +3 -0
  391. package/dist/esm/shell/FullPageShell.d.ts.map +1 -0
  392. package/dist/esm/shell/FullPageShell.js +51 -0
  393. package/dist/esm/shell/FullPageShell.js.map +1 -0
  394. package/dist/esm/shell/LayoutModeSwitcher.d.ts +3 -0
  395. package/dist/esm/shell/LayoutModeSwitcher.d.ts.map +1 -0
  396. package/dist/esm/shell/LayoutModeSwitcher.js +56 -0
  397. package/dist/esm/shell/LayoutModeSwitcher.js.map +1 -0
  398. package/dist/esm/shell/LayoutModes.stories.d.ts +29 -0
  399. package/dist/esm/shell/LayoutModes.stories.d.ts.map +1 -0
  400. package/dist/esm/shell/LayoutModes.stories.js +43 -0
  401. package/dist/esm/shell/LayoutModes.stories.js.map +1 -0
  402. package/dist/esm/shell/Logo.d.ts +3 -0
  403. package/dist/esm/shell/Logo.d.ts.map +1 -0
  404. package/dist/esm/shell/Logo.js +42 -0
  405. package/dist/esm/shell/Logo.js.map +1 -0
  406. package/dist/esm/shell/Mask.d.ts +3 -0
  407. package/dist/esm/shell/Mask.d.ts.map +1 -0
  408. package/dist/esm/shell/Mask.js +31 -0
  409. package/dist/esm/shell/Mask.js.map +1 -0
  410. package/dist/esm/shell/Menu.d.ts +3 -0
  411. package/dist/esm/shell/Menu.d.ts.map +1 -0
  412. package/dist/esm/shell/Menu.js +34 -0
  413. package/dist/esm/shell/Menu.js.map +1 -0
  414. package/dist/esm/shell/MenuItem.d.ts +3 -0
  415. package/dist/esm/shell/MenuItem.d.ts.map +1 -0
  416. package/dist/esm/shell/MenuItem.js +63 -0
  417. package/dist/esm/shell/MenuItem.js.map +1 -0
  418. package/dist/esm/shell/PageHeader.d.ts +3 -0
  419. package/dist/esm/shell/PageHeader.d.ts.map +1 -0
  420. package/dist/esm/shell/PageHeader.js +41 -0
  421. package/dist/esm/shell/PageHeader.js.map +1 -0
  422. package/dist/esm/shell/RightPanel.d.ts +3 -0
  423. package/dist/esm/shell/RightPanel.d.ts.map +1 -0
  424. package/dist/esm/shell/RightPanel.js +28 -0
  425. package/dist/esm/shell/RightPanel.js.map +1 -0
  426. package/dist/esm/shell/Sidebar.d.ts +3 -0
  427. package/dist/esm/shell/Sidebar.d.ts.map +1 -0
  428. package/dist/esm/shell/Sidebar.js +49 -0
  429. package/dist/esm/shell/Sidebar.js.map +1 -0
  430. package/dist/esm/shell/ThemeOption.d.ts +10 -0
  431. package/dist/esm/shell/ThemeOption.d.ts.map +1 -0
  432. package/dist/esm/shell/ThemeOption.js +39 -0
  433. package/dist/esm/shell/ThemeOption.js.map +1 -0
  434. package/dist/esm/shell/ThemeSwitcher.d.ts +3 -0
  435. package/dist/esm/shell/ThemeSwitcher.d.ts.map +1 -0
  436. package/dist/esm/shell/ThemeSwitcher.js +48 -0
  437. package/dist/esm/shell/ThemeSwitcher.js.map +1 -0
  438. package/dist/esm/shell/Topbar.d.ts +3 -0
  439. package/dist/esm/shell/Topbar.d.ts.map +1 -0
  440. package/dist/esm/shell/Topbar.js +52 -0
  441. package/dist/esm/shell/Topbar.js.map +1 -0
  442. package/dist/esm/shell/UserMenu.d.ts +3 -0
  443. package/dist/esm/shell/UserMenu.d.ts.map +1 -0
  444. package/dist/esm/shell/UserMenu.js +66 -0
  445. package/dist/esm/shell/UserMenu.js.map +1 -0
  446. package/dist/esm/shell/elementProperties.d.ts +9 -0
  447. package/dist/esm/shell/elementProperties.d.ts.map +1 -0
  448. package/dist/esm/shell/elementProperties.js +48 -0
  449. package/dist/esm/shell/elementProperties.js.map +1 -0
  450. package/dist/esm/shell/index.d.ts +19 -0
  451. package/dist/esm/shell/index.d.ts.map +1 -0
  452. package/dist/esm/shell/index.js +19 -0
  453. package/dist/esm/shell/index.js.map +1 -0
  454. package/dist/esm/themes/LayoutThemeProvider.d.ts +9 -0
  455. package/dist/esm/themes/LayoutThemeProvider.d.ts.map +1 -0
  456. package/dist/esm/themes/LayoutThemeProvider.js +31 -0
  457. package/dist/esm/themes/LayoutThemeProvider.js.map +1 -0
  458. package/dist/esm/themes/Theming.stories.d.ts +21 -0
  459. package/dist/esm/themes/Theming.stories.d.ts.map +1 -0
  460. package/dist/esm/themes/Theming.stories.js +54 -0
  461. package/dist/esm/themes/Theming.stories.js.map +1 -0
  462. package/dist/esm/themes/blueprintThemeCompatibility.d.ts +2 -0
  463. package/dist/esm/themes/blueprintThemeCompatibility.d.ts.map +1 -0
  464. package/dist/esm/themes/blueprintThemeCompatibility.js +26 -0
  465. package/dist/esm/themes/blueprintThemeCompatibility.js.map +1 -0
  466. package/dist/esm/themes/dark.d.ts +3 -0
  467. package/dist/esm/themes/dark.d.ts.map +1 -0
  468. package/dist/esm/themes/dark.js +38 -0
  469. package/dist/esm/themes/dark.js.map +1 -0
  470. package/dist/esm/themes/defaultBlueprintThemes.d.ts +3 -0
  471. package/dist/esm/themes/defaultBlueprintThemes.d.ts.map +1 -0
  472. package/dist/esm/themes/defaultBlueprintThemes.js +17 -0
  473. package/dist/esm/themes/defaultBlueprintThemes.js.map +1 -0
  474. package/dist/esm/themes/index.d.ts +6 -0
  475. package/dist/esm/themes/index.d.ts.map +1 -0
  476. package/dist/esm/themes/index.js +6 -0
  477. package/dist/esm/themes/index.js.map +1 -0
  478. package/dist/esm/themes/light.d.ts +3 -0
  479. package/dist/esm/themes/light.d.ts.map +1 -0
  480. package/dist/esm/themes/light.js +41 -0
  481. package/dist/esm/themes/light.js.map +1 -0
  482. package/dist/esm/tsconfig.tsbuildinfo +1 -0
  483. package/for_AppShell/when_rendering_a_gallery_screen.tsx +76 -0
  484. package/for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx +77 -0
  485. package/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts +42 -0
  486. package/for_defaultBlueprint/when_validating_the_bundle.ts +43 -0
  487. package/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts +50 -0
  488. package/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts +36 -0
  489. package/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +53 -0
  490. package/for_galleryScreenTemplates/when_following_the_nesting_chain.ts +41 -0
  491. package/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +44 -0
  492. package/for_galleryScreens/when_resolving_the_component_names_they_reference.ts +60 -0
  493. package/for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts +76 -0
  494. package/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts +44 -0
  495. package/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts +61 -0
  496. package/for_layoutWrapperClasses/when_rendering_each_mode.ts +63 -0
  497. package/for_navigation/when_aggregating_the_navigation_contributions.ts +50 -0
  498. package/gallery/ApplicationScreens.stories.tsx +70 -0
  499. package/gallery/FullPageScreens.stories.tsx +60 -0
  500. package/gallery/GalleryScreenPreview.tsx +68 -0
  501. package/gallery/NavigationEntry.ts +27 -0
  502. package/gallery/TemplateSlotName.ts +36 -0
  503. package/gallery/applicationChrome.ts +110 -0
  504. package/gallery/authTemplates.ts +161 -0
  505. package/gallery/componentNames.ts +55 -0
  506. package/gallery/composeScreen.ts +95 -0
  507. package/gallery/dependencyComponentNames.ts +64 -0
  508. package/gallery/dialogTemplates.ts +79 -0
  509. package/gallery/elements.ts +65 -0
  510. package/gallery/index.ts +22 -0
  511. package/gallery/navigation.ts +71 -0
  512. package/gallery/nesting.ts +82 -0
  513. package/gallery/previewProfile.ts +59 -0
  514. package/gallery/resolveElementNames.ts +55 -0
  515. package/gallery/screens.ts +111 -0
  516. package/gallery/statusTemplates.ts +118 -0
  517. package/gallery/supportTemplates.ts +164 -0
  518. package/gallery/widgets.ts +63 -0
  519. package/gallery/workspaceTemplates.ts +198 -0
  520. package/index.ts +12 -0
  521. package/layouts/LayoutName.ts +18 -0
  522. package/layouts/SlotName.ts +44 -0
  523. package/layouts/appShell.ts +106 -0
  524. package/layouts/defaultLayouts.ts +15 -0
  525. package/layouts/flowBuilders.ts +49 -0
  526. package/layouts/fullPage.ts +48 -0
  527. package/layouts/index.ts +10 -0
  528. package/layouts/shellComponents.ts +28 -0
  529. package/package.json +68 -0
  530. package/packageName.ts +12 -0
  531. package/shell/AppShell.tsx +66 -0
  532. package/shell/Breadcrumb.tsx +31 -0
  533. package/shell/ConfigPanel.tsx +105 -0
  534. package/shell/Footer.tsx +23 -0
  535. package/shell/FullPageShell.tsx +41 -0
  536. package/shell/LayoutModeSwitcher.tsx +50 -0
  537. package/shell/LayoutModes.stories.tsx +83 -0
  538. package/shell/Logo.tsx +30 -0
  539. package/shell/Mask.tsx +29 -0
  540. package/shell/Menu.tsx +26 -0
  541. package/shell/MenuItem.tsx +39 -0
  542. package/shell/PageHeader.tsx +28 -0
  543. package/shell/RightPanel.tsx +23 -0
  544. package/shell/Sidebar.tsx +45 -0
  545. package/shell/ThemeOption.ts +60 -0
  546. package/shell/ThemeSwitcher.tsx +42 -0
  547. package/shell/Topbar.tsx +49 -0
  548. package/shell/UserMenu.tsx +53 -0
  549. package/shell/elementProperties.ts +64 -0
  550. package/shell/index.ts +21 -0
  551. package/shell/layout.css +821 -0
  552. package/themes/LayoutThemeProvider.tsx +41 -0
  553. package/themes/Theming.stories.tsx +89 -0
  554. package/themes/blueprintThemeCompatibility.ts +19 -0
  555. package/themes/dark.ts +38 -0
  556. package/themes/defaultBlueprintThemes.ts +14 -0
  557. package/themes/index.ts +8 -0
  558. package/themes/light.ts +41 -0
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ var ComponentName = require('../ComponentName.js');
4
+ var SlotName = require('../layouts/SlotName.js');
5
+ var flowBuilders = require('../layouts/flowBuilders.js');
6
+ require('../layouts/shellComponents.js');
7
+ require('../layouts/appShell.js');
8
+ require('../layouts/fullPage.js');
9
+ var TemplateSlotName = require('./TemplateSlotName.js');
10
+ var elements = require('./elements.js');
11
+ var widgets = require('./widgets.js');
12
+
13
+ // Copyright (c) Cratis. All rights reserved.
14
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
15
+ /**
16
+ * A worked three-level chain, from the application layout down to a slice.
17
+ *
18
+ * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by
19
+ * whatever contains it. A module's template fits the application layout's `content`; a feature's template
20
+ * fits a slot the module's template declares; a slice's fits one the feature's declares. Nothing here is a
21
+ * special case for a particular level - which is exactly why the hierarchy can be arbitrarily deep without
22
+ * a second mechanism.
23
+ *
24
+ * These three exist to make that concrete and to be asserted by a spec, because "it composes recursively"
25
+ * is the kind of claim that is true in a design document and wrong in the code.
26
+ */ /**
27
+ * Module level: fits the application shell's `content` slot.
28
+ *
29
+ * It brings its own header - a module always has a name and a description - and offers a body for the
30
+ * feature inside it plus an optional side panel.
31
+ */ const moduleWorkspaceTemplate = {
32
+ name: 'ModuleWorkspace',
33
+ fitsSlot: SlotName.SlotName.Content,
34
+ slots: [
35
+ {
36
+ name: TemplateSlotName.TemplateSlotName.Header
37
+ },
38
+ {
39
+ name: TemplateSlotName.TemplateSlotName.Body
40
+ },
41
+ {
42
+ name: TemplateSlotName.TemplateSlotName.SidePanel
43
+ }
44
+ ],
45
+ content: {
46
+ [TemplateSlotName.TemplateSlotName.Header]: [
47
+ widgets.pageHeader('module-header', 'Operations', 'Everything the operations module owns')
48
+ ]
49
+ },
50
+ displayName: 'Module workspace',
51
+ description: 'Module level: fits the application layout content slot and offers a body for one feature.'
52
+ };
53
+ /**
54
+ * Feature level: fits the module workspace's `body` slot.
55
+ *
56
+ * It brings a toolbar, because a feature is where actions belong - a module is a grouping, a slice is one
57
+ * behavior, and the feature in between is what a user thinks of as a screen with buttons on it.
58
+ */ const featureSectionTemplate = {
59
+ name: 'FeatureSection',
60
+ fitsSlot: TemplateSlotName.TemplateSlotName.Body,
61
+ slots: [
62
+ {
63
+ name: TemplateSlotName.TemplateSlotName.Toolbar
64
+ },
65
+ {
66
+ name: TemplateSlotName.TemplateSlotName.Body
67
+ }
68
+ ],
69
+ content: {
70
+ [TemplateSlotName.TemplateSlotName.Toolbar]: [
71
+ elements.button('feature-new', 'New', {
72
+ severity: 'primary',
73
+ icon: 'pi pi-plus'
74
+ }),
75
+ elements.button('feature-export', 'Export', {
76
+ severity: 'secondary',
77
+ icon: 'pi pi-download'
78
+ })
79
+ ]
80
+ },
81
+ displayName: 'Feature section',
82
+ description: 'Feature level: fits a module workspace body slot and brings the action toolbar.'
83
+ };
84
+ /**
85
+ * Slice level: fits the feature section's `body` slot.
86
+ *
87
+ * The end of the chain, and deliberately the thinnest thing in it - one behavior's surface, with somewhere
88
+ * to put it and somewhere to put its actions.
89
+ */ const sliceSectionTemplate = {
90
+ name: 'SliceSection',
91
+ fitsSlot: TemplateSlotName.TemplateSlotName.Body,
92
+ slots: [
93
+ {
94
+ name: TemplateSlotName.TemplateSlotName.Body
95
+ },
96
+ {
97
+ name: TemplateSlotName.TemplateSlotName.Actions
98
+ }
99
+ ],
100
+ arrangement: {
101
+ root: flowBuilders.column([
102
+ flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Body, {
103
+ grow: 1
104
+ }),
105
+ flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Actions)
106
+ ])
107
+ },
108
+ content: {
109
+ [TemplateSlotName.TemplateSlotName.Body]: [
110
+ elements.externalComponent('slice-body', ComponentName.ComponentName.PageHeader, {
111
+ title: 'Adjustment',
112
+ subtitle: 'One behavior, one surface'
113
+ })
114
+ ]
115
+ },
116
+ displayName: 'Slice section',
117
+ description: 'Slice level: fits a feature section body slot and hosts one behavior.'
118
+ };
119
+ /** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */ const nestingChainTemplates = [
120
+ moduleWorkspaceTemplate,
121
+ featureSectionTemplate,
122
+ sliceSectionTemplate
123
+ ];
124
+
125
+ exports.featureSectionTemplate = featureSectionTemplate;
126
+ exports.moduleWorkspaceTemplate = moduleWorkspaceTemplate;
127
+ exports.nestingChainTemplates = nestingChainTemplates;
128
+ exports.sliceSectionTemplate = sliceSectionTemplate;
129
+ //# sourceMappingURL=nesting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nesting.js","sources":["../../../gallery/nesting.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 { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName, column, slotLeaf } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, externalComponent } from './elements';\nimport { pageHeader } from './widgets';\n\n/**\n * A worked three-level chain, from the application layout down to a slice.\n *\n * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by\n * whatever contains it. A module's template fits the application layout's `content`; a feature's template\n * fits a slot the module's template declares; a slice's fits one the feature's declares. Nothing here is a\n * special case for a particular level - which is exactly why the hierarchy can be arbitrarily deep without\n * a second mechanism.\n *\n * These three exist to make that concrete and to be asserted by a spec, because \"it composes recursively\"\n * is the kind of claim that is true in a design document and wrong in the code.\n */\n\n/**\n * Module level: fits the application shell's `content` slot.\n *\n * It brings its own header - a module always has a name and a description - and offers a body for the\n * feature inside it plus an optional side panel.\n */\nexport const moduleWorkspaceTemplate: ScreenTemplate = {\n name: 'ModuleWorkspace',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('module-header', 'Operations', 'Everything the operations module owns')],\n },\n displayName: 'Module workspace',\n description: 'Module level: fits the application layout content slot and offers a body for one feature.',\n};\n\n/**\n * Feature level: fits the module workspace's `body` slot.\n *\n * It brings a toolbar, because a feature is where actions belong - a module is a grouping, a slice is one\n * behavior, and the feature in between is what a user thinks of as a screen with buttons on it.\n */\nexport const featureSectionTemplate: ScreenTemplate = {\n name: 'FeatureSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n button('feature-new', 'New', { severity: 'primary', icon: 'pi pi-plus' }),\n button('feature-export', 'Export', { severity: 'secondary', icon: 'pi pi-download' }),\n ],\n },\n displayName: 'Feature section',\n description: 'Feature level: fits a module workspace body slot and brings the action toolbar.',\n};\n\n/**\n * Slice level: fits the feature section's `body` slot.\n *\n * The end of the chain, and deliberately the thinnest thing in it - one behavior's surface, with somewhere\n * to put it and somewhere to put its actions.\n */\nexport const sliceSectionTemplate: ScreenTemplate = {\n name: 'SliceSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)]),\n },\n content: {\n [TemplateSlotName.Body]: [externalComponent('slice-body', ComponentName.PageHeader, { title: 'Adjustment', subtitle: 'One behavior, one surface' })],\n },\n displayName: 'Slice section',\n description: 'Slice level: fits a feature section body slot and hosts one behavior.',\n};\n\n/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */\nexport const nestingChainTemplates: ScreenTemplate[] = [moduleWorkspaceTemplate, featureSectionTemplate, sliceSectionTemplate];\n"],"names":["moduleWorkspaceTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","SidePanel","content","pageHeader","displayName","description","featureSectionTemplate","Toolbar","button","severity","icon","sliceSectionTemplate","Actions","arrangement","root","column","slotLeaf","grow","externalComponent","ComponentName","PageHeader","title","subtitle","nestingChainTemplates"],"mappings":";;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,kCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,kCAAiBG;AAAU;AAAE,KAAA;IACjHC,OAAAA,EAAS;QACL,CAACJ,iCAAAA,CAAiBC,MAAM,GAAG;AAACI,YAAAA,kBAAAA,CAAW,iBAAiB,YAAA,EAAc,uCAAA;AAAyC;AACnH,KAAA;IACAC,WAAAA,EAAa,kBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;UAMaC,sBAAAA,GAAyC;IAClDb,IAAAA,EAAM,gBAAA;AACNC,IAAAA,QAAAA,EAAUI,kCAAiBE,IAAI;IAC/BH,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBS;AAAQ,SAAA;AAAG,QAAA;AAAEd,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AwBK,IAAAA;;;;;;;;"}
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var ComponentName = require('../ComponentName.js');
4
+ var packageName = require('../packageName.js');
5
+ var dependencyComponentNames = require('./dependencyComponentNames.js');
6
+
7
+ // Copyright (c) Cratis. All rights reserved.
8
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
9
+ /**
10
+ * The profile the gallery is previewed against.
11
+ *
12
+ * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's
13
+ * compatibility is checked against exactly what the profile declares - and a profile that leans on the
14
+ * implicit fallback would make a theme look incompatible with a package the profile never admitted to
15
+ * using. Declaration order is ascending priority, so this blueprint's own names win over the component
16
+ * libraries', which is what lets it provide a `breadcrumb` of its own without hiding PrimeReact's.
17
+ */ const galleryProfile = {
18
+ name: 'Gallery',
19
+ targetPlatform: 'web',
20
+ packages: [
21
+ 'core',
22
+ 'PrimeReact',
23
+ 'Cratis.Components',
24
+ packageName.defaultBlueprintName
25
+ ]
26
+ };
27
+ /**
28
+ * The profile a *preview* resolves against, when only some of those packages are actually loaded.
29
+ *
30
+ * Same four packages, different order, and the difference is deliberate. This blueprint takes no npm
31
+ * dependency on PrimeReact's or Cratis Components' bundles - a blueprint declares its dependencies in its
32
+ * manifest, not in its bundler graph - so a preview run from this package has `core` and this blueprint
33
+ * implemented and nothing else. Ranking `core` above the two libraries means `text`, `button` and `card`
34
+ * resolve to something that exists, and the preview shows real content instead of a wall of placeholders.
35
+ *
36
+ * Names only the libraries declare - `dataTable`, `timeline`, `tag` - still resolve to them, find no
37
+ * implementation, and render as `UnresolvedComponent`'s dashed box naming what is missing. That is the
38
+ * right outcome rather than a papered-over one: previewing a blueprint against half a profile *should*
39
+ * look visibly incomplete. A host with all four bundles loaded uses {@link galleryProfile} and sees the
40
+ * real widgets.
41
+ */ const galleryPreviewProfile = {
42
+ name: 'Gallery preview',
43
+ targetPlatform: 'web',
44
+ packages: [
45
+ 'PrimeReact',
46
+ 'Cratis.Components',
47
+ 'core',
48
+ packageName.defaultBlueprintName
49
+ ]
50
+ };
51
+ /**
52
+ * The component catalog the gallery resolves against.
53
+ *
54
+ * This blueprint's own entry is its real declared component list; the other three are the subsets it
55
+ * borrows, each name checked against the owning package's own manifest (see `dependencyComponentNames.ts`).
56
+ * A host that has all four packages loaded should build this from their manifests instead - the shape is
57
+ * the same, and anything that has drifted then fails this blueprint's specs rather than a preview.
58
+ */ const galleryComponentCatalog = {
59
+ core: dependencyComponentNames.coreComponentNames,
60
+ PrimeReact: dependencyComponentNames.primeReactComponentNames,
61
+ 'Cratis.Components': dependencyComponentNames.cratisComponentsNames,
62
+ [packageName.defaultBlueprintName]: Object.values(ComponentName.ComponentName)
63
+ };
64
+
65
+ exports.galleryComponentCatalog = galleryComponentCatalog;
66
+ exports.galleryPreviewProfile = galleryPreviewProfile;
67
+ exports.galleryProfile = galleryProfile;
68
+ //# 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 { ComponentName } from '../ComponentName';\nimport { defaultBlueprintName } from '../packageName';\nimport { coreComponentNames, cratisComponentsNames, primeReactComponentNames } from './dependencyComponentNames';\n\n/**\n * The profile the gallery is previewed against.\n *\n * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's\n * compatibility is checked against exactly what the profile declares - and a profile that leans on the\n * implicit fallback would make a theme look incompatible with a package the profile never admitted to\n * using. Declaration order is ascending priority, so this blueprint's own names win over the component\n * libraries', which is what lets it provide a `breadcrumb` of its own without hiding PrimeReact's.\n */\nexport const galleryProfile: UiProfile = {\n name: 'Gallery',\n targetPlatform: 'web',\n packages: ['core', 'PrimeReact', 'Cratis.Components', defaultBlueprintName],\n};\n\n/**\n * The profile a *preview* resolves against, when only some of those packages are actually loaded.\n *\n * Same four packages, different order, and the difference is deliberate. This blueprint takes no npm\n * dependency on PrimeReact's or Cratis Components' bundles - a blueprint declares its dependencies in its\n * manifest, not in its bundler graph - so a preview run from this package has `core` and this blueprint\n * implemented and nothing else. Ranking `core` above the two libraries means `text`, `button` and `card`\n * resolve to something that exists, and the preview shows real content instead of a wall of placeholders.\n *\n * Names only the libraries declare - `dataTable`, `timeline`, `tag` - still resolve to them, find no\n * implementation, and render as `UnresolvedComponent`'s dashed box naming what is missing. That is the\n * right outcome rather than a papered-over one: previewing a blueprint against half a profile *should*\n * look visibly incomplete. A host with all four bundles loaded uses {@link galleryProfile} and sees the\n * real widgets.\n */\nexport const galleryPreviewProfile: UiProfile = {\n name: 'Gallery preview',\n targetPlatform: 'web',\n packages: ['PrimeReact', 'Cratis.Components', 'core', defaultBlueprintName],\n};\n\n/**\n * The component catalog the gallery resolves against.\n *\n * This blueprint's own entry is its real declared component list; the other three are the subsets it\n * borrows, each name checked against the owning package's own manifest (see `dependencyComponentNames.ts`).\n * A host that has all four packages loaded should build this from their manifests instead - the shape is\n * the same, and anything that has drifted then fails this blueprint's specs rather than a preview.\n */\nexport const galleryComponentCatalog: PackageCatalog = {\n core: coreComponentNames,\n PrimeReact: primeReactComponentNames,\n 'Cratis.Components': cratisComponentsNames,\n [defaultBlueprintName]: Object.values(ComponentName),\n};\n"],"names":["galleryProfile","name","targetPlatform","packages","defaultBlueprintName","galleryPreviewProfile","galleryComponentCatalog","core","coreComponentNames","PrimeReact","primeReactComponentNames","cratisComponentsNames","Object","values","ComponentName"],"mappings":";;;;;;AAAA;AACA;AAQA;;;;;;;;UASaA,cAAAA,GAA4B;IACrCC,IAAAA,EAAM,SAAA;IACNC,cAAAA,EAAgB,KAAA;IAChBC,QAAAA,EAAU;AAAC,QAAA,MAAA;AAAQ,QAAA,YAAA;AAAc,QAAA,mBAAA;AAAqBC,QAAAA;AAAqB;AAC/E;AAEA;;;;;;;;;;;;;;UAeaC,qBAAAA,GAAmC;IAC5CJ,IAAAA,EAAM,iBAAA;IACNC,cAAAA,EAAgB,KAAA;IAChBC,QAAAA,EAAU;AAAC,QAAA,YAAA;AAAc,QAAA,mBAAA;AAAqB,QAAA,MAAA;AAAQC,QAAAA;AAAqB;AAC/E;AAEA;;;;;;;UAQaE,uBAAAA,GAA0C;IACnDC,IAAAA,EAAMC,2CAAAA;IACNC,UAAAA,EAAYC,iDAAAA;IACZ,mBAAA,EAAqBC,8CAAAA;AACrB,IAAA,CAACP,gCAAAA,GAAuBQ,MAAAA,CAAOC,MAAM,CAACC,2BAAAA;AAC1C;;;;;;"}
@@ -0,0 +1,63 @@
1
+ 'use strict';
2
+
3
+ var scene_engine = require('@cratis/scene.engine');
4
+ var scene_react = require('@cratis/scene.react');
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
+ * Rewrites an element tree's bare component names into the keys the React registry is keyed by.
10
+ *
11
+ * The renderer looks a component up by `element.componentName` against a registry keyed by
12
+ * `componentRegistryKey(package, name)`, so something has to resolve bare names against the active profile
13
+ * first. Wiring that into the renderer proper is Stage's job and does not exist yet; this is the small
14
+ * local version that lets the gallery boot through the *real* engine and the *real* registry today rather
15
+ * than waiting for it.
16
+ *
17
+ * A name nothing declares is left exactly as written. That is deliberate: the renderer then falls back to
18
+ * `UnresolvedComponent` and shows a dashed red box naming the component, which is far more useful than a
19
+ * throw from inside a tree walk.
20
+ *
21
+ * @param element The tree to rewrite.
22
+ * @param profile The profile whose package priority decides which package wins a bare name.
23
+ * @param catalog Each active package's declared component names.
24
+ * @returns A new tree; the original is untouched.
25
+ */ function resolveElementComponentNames(element, profile, catalog) {
26
+ if (scene_engine.isExternalComponent(element)) {
27
+ const resolution = scene_engine.resolveComponentName(element.componentName, profile, catalog);
28
+ const resolved = {
29
+ ...element,
30
+ componentName: resolution ? scene_react.componentRegistryKey(resolution.package, resolution.name) : element.componentName,
31
+ slots: Object.fromEntries(Object.entries(element.slots).map(([name, children])=>[
32
+ name,
33
+ children.map((child)=>resolveElementComponentNames(child, profile, catalog))
34
+ ]))
35
+ };
36
+ return resolved;
37
+ }
38
+ if (scene_engine.isContentControl(element)) {
39
+ const contentControl = {
40
+ ...element,
41
+ content: resolveElementComponentNames(element.content, profile, catalog)
42
+ };
43
+ return contentControl;
44
+ }
45
+ if (scene_engine.isItemsControl(element)) {
46
+ const itemsControl = {
47
+ ...element,
48
+ itemTemplate: resolveElementComponentNames(element.itemTemplate, profile, catalog)
49
+ };
50
+ return itemsControl;
51
+ }
52
+ if (scene_engine.isPanel(element)) {
53
+ const panel = {
54
+ ...element,
55
+ children: element.children.map((child)=>resolveElementComponentNames(child, profile, catalog))
56
+ };
57
+ return panel;
58
+ }
59
+ return element;
60
+ }
61
+
62
+ exports.resolveElementComponentNames = resolveElementComponentNames;
63
+ //# sourceMappingURL=resolveElementNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveElementNames.js","sources":["../../../gallery/resolveElementNames.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 { ContentControl, ExternalComponent, ItemsControl, Panel, SceneElement, UiProfile } from '@cratis/scene.model';\nimport { PackageCatalog, isContentControl, isExternalComponent, isItemsControl, isPanel, resolveComponentName } from '@cratis/scene.engine';\nimport { componentRegistryKey } from '@cratis/scene.react';\n\n/**\n * Rewrites an element tree's bare component names into the keys the React registry is keyed by.\n *\n * The renderer looks a component up by `element.componentName` against a registry keyed by\n * `componentRegistryKey(package, name)`, so something has to resolve bare names against the active profile\n * first. Wiring that into the renderer proper is Stage's job and does not exist yet; this is the small\n * local version that lets the gallery boot through the *real* engine and the *real* registry today rather\n * than waiting for it.\n *\n * A name nothing declares is left exactly as written. That is deliberate: the renderer then falls back to\n * `UnresolvedComponent` and shows a dashed red box naming the component, which is far more useful than a\n * throw from inside a tree walk.\n *\n * @param element The tree to rewrite.\n * @param profile The profile whose package priority decides which package wins a bare name.\n * @param catalog Each active package's declared component names.\n * @returns A new tree; the original is untouched.\n */\nexport function resolveElementComponentNames(element: SceneElement, profile: UiProfile, catalog: PackageCatalog): SceneElement {\n if (isExternalComponent(element)) {\n const resolution = resolveComponentName(element.componentName, profile, catalog);\n const resolved: ExternalComponent = {\n ...element,\n componentName: resolution ? componentRegistryKey(resolution.package, resolution.name) : element.componentName,\n slots: Object.fromEntries(\n Object.entries(element.slots).map(([name, children]) => [name, children.map(child => resolveElementComponentNames(child, profile, catalog))]),\n ),\n };\n return resolved;\n }\n\n if (isContentControl(element)) {\n const contentControl: ContentControl = { ...element, content: resolveElementComponentNames(element.content, profile, catalog) };\n return contentControl;\n }\n\n if (isItemsControl(element)) {\n const itemsControl: ItemsControl = { ...element, itemTemplate: resolveElementComponentNames(element.itemTemplate, profile, catalog) };\n return itemsControl;\n }\n\n if (isPanel(element)) {\n const panel: Panel = { ...element, children: element.children.map(child => resolveElementComponentNames(child, profile, catalog)) };\n return panel;\n }\n\n return element;\n}\n"],"names":["resolveElementComponentNames","element","profile","catalog","isExternalComponent","resolution","resolveComponentName","componentName","resolved","componentRegistryKey","package","name","slots","Object","fromEntries","entries","map","children","child","isContentControl","contentControl","content","isItemsControl","itemsControl","itemTemplate","isPanel","panel"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;AAiBC,IACM,SAASA,4BAAAA,CAA6BC,OAAqB,EAAEC,OAAkB,EAAEC,OAAuB,EAAA;AAC3G,IAAA,IAAIC,iCAAoBH,OAAAA,CAAAA,EAAU;AAC9B,QAAA,MAAMI,UAAAA,GAAaC,iCAAAA,CAAqBL,OAAAA,CAAQM,aAAa,EAAEL,OAAAA,EAASC,OAAAA,CAAAA;AACxE,QAAA,MAAMK,QAAAA,GAA8B;AAChC,YAAA,GAAGP,OAAO;YACVM,aAAAA,EAAeF,UAAAA,GAAaI,iCAAqBJ,UAAAA,CAAWK,OAAO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;AACX,IAAA;IAEA,OAAOzB,OAAAA;AACX;;;;"}
@@ -0,0 +1,222 @@
1
+ 'use strict';
2
+
3
+ var LayoutName = require('../layouts/LayoutName.js');
4
+ require('@cratis/scene.model');
5
+ require('../layouts/shellComponents.js');
6
+ var appShell = require('../layouts/appShell.js');
7
+ var fullPage = require('../layouts/fullPage.js');
8
+ var applicationChrome = require('./applicationChrome.js');
9
+ var composeScreen = require('./composeScreen.js');
10
+ var authTemplates = require('./authTemplates.js');
11
+ var navigation = require('./navigation.js');
12
+ var nesting = require('./nesting.js');
13
+ var statusTemplates = require('./statusTemplates.js');
14
+ var supportTemplates = require('./supportTemplates.js');
15
+ var workspaceTemplates = require('./workspaceTemplates.js');
16
+
17
+ // Copyright (c) Cratis. All rights reserved.
18
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
19
+ /**
20
+ * The screen templates this blueprint provides.
21
+ *
22
+ * Ten shapes for inside the application shell, ten for the full-page shell, and the three-level nesting
23
+ * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names
24
+ * and what the bundle provides; `validatePackageBundle` proves the two agree.
25
+ */ const galleryScreenTemplates = [
26
+ ...workspaceTemplates.workspaceTemplates,
27
+ ...supportTemplates.supportTemplates,
28
+ ...authTemplates.authTemplates,
29
+ ...statusTemplates.statusTemplates,
30
+ ...nesting.nestingChainTemplates
31
+ ];
32
+ /** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */ const fullPageTemplateNames = new Set([
33
+ ...authTemplates.authTemplates,
34
+ ...statusTemplates.statusTemplates
35
+ ].map((template)=>template.name));
36
+ /** The trail shown above each application-shell screen. */ const breadcrumbs = {
37
+ Dashboard: [
38
+ {
39
+ label: 'Dashboard'
40
+ }
41
+ ],
42
+ CrudList: [
43
+ {
44
+ label: 'Catalog',
45
+ targetScreen: 'Dashboard'
46
+ },
47
+ {
48
+ label: 'Products'
49
+ }
50
+ ],
51
+ DetailView: [
52
+ {
53
+ label: 'Catalog',
54
+ targetScreen: 'Dashboard'
55
+ },
56
+ {
57
+ label: 'Products',
58
+ targetScreen: 'CrudList'
59
+ },
60
+ {
61
+ label: 'Bamboo Watch'
62
+ }
63
+ ],
64
+ FormPage: [
65
+ {
66
+ label: 'Catalog',
67
+ targetScreen: 'Dashboard'
68
+ },
69
+ {
70
+ label: 'Products',
71
+ targetScreen: 'CrudList'
72
+ },
73
+ {
74
+ label: 'New product'
75
+ }
76
+ ],
77
+ Empty: [
78
+ {
79
+ label: 'Catalog',
80
+ targetScreen: 'Dashboard'
81
+ },
82
+ {
83
+ label: 'Products'
84
+ }
85
+ ],
86
+ Documentation: [
87
+ {
88
+ label: 'Support',
89
+ targetScreen: 'Dashboard'
90
+ },
91
+ {
92
+ label: 'Documentation'
93
+ }
94
+ ],
95
+ ProfileSettings: [
96
+ {
97
+ label: 'Administration',
98
+ targetScreen: 'Dashboard'
99
+ },
100
+ {
101
+ label: 'Your profile'
102
+ }
103
+ ],
104
+ UserManagement: [
105
+ {
106
+ label: 'Administration',
107
+ targetScreen: 'Dashboard'
108
+ },
109
+ {
110
+ label: 'Users'
111
+ }
112
+ ],
113
+ Invoice: [
114
+ {
115
+ label: 'Billing',
116
+ targetScreen: 'Dashboard'
117
+ },
118
+ {
119
+ label: 'INV-2043'
120
+ }
121
+ ],
122
+ Help: [
123
+ {
124
+ label: 'Support',
125
+ targetScreen: 'Dashboard'
126
+ },
127
+ {
128
+ label: 'Help'
129
+ }
130
+ ],
131
+ ModuleWorkspace: [
132
+ {
133
+ label: 'Operations'
134
+ }
135
+ ],
136
+ FeatureSection: [
137
+ {
138
+ label: 'Operations',
139
+ targetScreen: 'ModuleWorkspace'
140
+ },
141
+ {
142
+ label: 'Adjustments'
143
+ }
144
+ ],
145
+ SliceSection: [
146
+ {
147
+ label: 'Operations',
148
+ targetScreen: 'ModuleWorkspace'
149
+ },
150
+ {
151
+ label: 'Adjustments',
152
+ targetScreen: 'FeatureSection'
153
+ },
154
+ {
155
+ label: 'Record an adjustment'
156
+ }
157
+ ]
158
+ };
159
+ /**
160
+ * Builds the {@link Screen} that instantiates one template.
161
+ *
162
+ * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the
163
+ * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,
164
+ * which is why adding a screen is a handful of lines rather than another copy of the chrome.
165
+ */ function screenFor(template) {
166
+ const isFullPage = fullPageTemplateNames.has(template.name);
167
+ const layout = isFullPage ? fullPage.fullPageLayout : appShell.appShellLayout;
168
+ const chrome = isFullPage ? applicationChrome.fullPageChrome() : applicationChrome.applicationChrome(template.name, breadcrumbs[template.name] ?? [
169
+ {
170
+ label: template.displayName ?? template.name
171
+ }
172
+ ]);
173
+ const placeable = composeScreen.nestScreenTemplates(containmentChainFor(template));
174
+ return {
175
+ name: template.name,
176
+ layout: isFullPage ? LayoutName.LayoutName.FullPage : LayoutName.LayoutName.AppShell,
177
+ screenTemplate: template.name,
178
+ slotContent: mergeSlotContent(chrome, composeScreen.templateContentInLayout(placeable, layout)),
179
+ forms: [],
180
+ contributions: isFullPage ? [] : navigation.navigationContributions
181
+ };
182
+ }
183
+ /**
184
+ * The chain of templates a screen renders through, outermost first.
185
+ *
186
+ * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three
187
+ * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest
188
+ * version of the story: nesting exists for the applications that need it, and costs nothing for the ones
189
+ * that do not.
190
+ */ function containmentChainFor(template) {
191
+ const depth = nesting.nestingChainTemplates.findIndex((candidate)=>candidate.name === template.name);
192
+ return depth < 0 ? [
193
+ template
194
+ ] : nesting.nestingChainTemplates.slice(0, depth + 1);
195
+ }
196
+ function mergeSlotContent(chrome, content) {
197
+ const merged = {
198
+ ...chrome
199
+ };
200
+ for (const [slotName, elements] of Object.entries(content)){
201
+ merged[slotName] = [
202
+ ...merged[slotName] ?? [],
203
+ ...elements
204
+ ];
205
+ }
206
+ return merged;
207
+ }
208
+ /**
209
+ * The gallery: one screen per template, ready to boot through the real engine.
210
+ *
211
+ * These exist so a preview is a working miniature application rather than a set of pictures - the same
212
+ * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate
213
+ * preview pipeline and nothing mocked.
214
+ */ const galleryScreens = galleryScreenTemplates.map(screenFor);
215
+ /** One gallery screen by name, for a story or a host that boots a specific one. */ function galleryScreen(name) {
216
+ return galleryScreens.find((screen)=>screen.name === name);
217
+ }
218
+
219
+ exports.galleryScreen = galleryScreen;
220
+ exports.galleryScreenTemplates = galleryScreenTemplates;
221
+ exports.galleryScreens = galleryScreens;
222
+ //# sourceMappingURL=screens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screens.js","sources":["../../../gallery/screens.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 { Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, fullPageLayout } from '../layouts';\nimport { BreadcrumbEntry, applicationChrome, fullPageChrome } from './applicationChrome';\nimport { nestScreenTemplates, templateContentInLayout } from './composeScreen';\nimport { authTemplates } from './authTemplates';\nimport { navigationContributions } from './navigation';\nimport { nestingChainTemplates } from './nesting';\nimport { statusTemplates } from './statusTemplates';\nimport { supportTemplates } from './supportTemplates';\nimport { workspaceTemplates } from './workspaceTemplates';\n\n/**\n * The screen templates this blueprint provides.\n *\n * Ten shapes for inside the application shell, ten for the full-page shell, and the three-level nesting\n * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names\n * and what the bundle provides; `validatePackageBundle` proves the two agree.\n */\nexport const galleryScreenTemplates: ScreenTemplate[] = [\n ...workspaceTemplates,\n ...supportTemplates,\n ...authTemplates,\n ...statusTemplates,\n ...nestingChainTemplates,\n];\n\n/** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */\nconst fullPageTemplateNames = new Set([...authTemplates, ...statusTemplates].map(template => template.name));\n\n/** The trail shown above each application-shell screen. */\nconst breadcrumbs: Record<string, BreadcrumbEntry[]> = {\n Dashboard: [{ label: 'Dashboard' }],\n CrudList: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n DetailView: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'Bamboo Watch' }],\n FormPage: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'New product' }],\n Empty: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n Documentation: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Documentation' }],\n ProfileSettings: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Your profile' }],\n UserManagement: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Users' }],\n Invoice: [{ label: 'Billing', targetScreen: 'Dashboard' }, { label: 'INV-2043' }],\n Help: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Help' }],\n ModuleWorkspace: [{ label: 'Operations' }],\n FeatureSection: [{ label: 'Operations', targetScreen: 'ModuleWorkspace' }, { label: 'Adjustments' }],\n SliceSection: [\n { label: 'Operations', targetScreen: 'ModuleWorkspace' },\n { label: 'Adjustments', targetScreen: 'FeatureSection' },\n { label: 'Record an adjustment' },\n ],\n};\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const isFullPage = fullPageTemplateNames.has(template.name);\n const layout: Layout = isFullPage ? fullPageLayout : appShellLayout;\n const chrome = isFullPage ? fullPageChrome() : applicationChrome(template.name, breadcrumbs[template.name] ?? [{ label: template.displayName ?? template.name }]);\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: isFullPage ? LayoutName.FullPage : LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(chrome, templateContentInLayout(placeable, layout)),\n forms: [],\n contributions: isFullPage ? [] : navigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three\n * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest\n * version of the story: nesting exists for the applications that need it, and costs nothing for the ones\n * that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/**\n * The gallery: one screen per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n */\nexport const galleryScreens: Screen[] = galleryScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function galleryScreen(name: string): Screen | undefined {\n return galleryScreens.find(screen => screen.name === name);\n}\n"],"names":["galleryScreenTemplates","workspaceTemplates","supportTemplates","authTemplates","statusTemplates","nestingChainTemplates","fullPageTemplateNames","Set","map","template","name","breadcrumbs","Dashboard","label","CrudList","targetScreen","DetailView","FormPage","Empty","Documentation","ProfileSettings","UserManagement","Invoice","Help","ModuleWorkspace","FeatureSection","SliceSection","screenFor","isFullPage","has","layout","fullPageLayout","appShellLayout","chrome","fullPageChrome","applicationChrome","displayName","placeable","nestScreenTemplates","containmentChainFor","LayoutName","FullPage","AppShell","screenTemplate","slotContent","mergeSlotContent","templateContentInLayout","forms","contributions","navigationContributions","depth","findIndex","candidate","slice","content","merged","slotName","elements","Object","entries","galleryScreens","galleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;UAOaA,sBAAAA,GAA2C;AACjDC,IAAAA,GAAAA,qCAAAA;AACAC,IAAAA,GAAAA,iCAAAA;AACAC,IAAAA,GAAAA,2BAAAA;AACAC,IAAAA,GAAAA,+BAAAA;AACAC,IAAAA,GAAAA;;AAGP,sHACA,MAAMC,qBAAAA,GAAwB,IAAIC,GAAAA,CAAI;AAAIJ,IAAAA,GAAAA,2BAAAA;AAAkBC,IAAAA,GAAAA;AAAgB,CAAA,CAACI,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASC,IAAI,CAAA,CAAA;AAE1G,4DACA,MAAMC,WAAAA,GAAiD;IACnDC,SAAAA,EAAW;AAAC,QAAA;YAAEC,KAAAA,EAAO;AAAY;AAAE,KAAA;IACnCC,QAAAA,EAAU;AAAC,QAAA;YAAED,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAW;AAAE,KAAA;IAClFG,UAAAA,EAAY;AAAC,QAAA;YAAEH,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO,UAAA;YAAYE,YAAAA,EAAc;AAAW,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAe;AAAE,KAAA;IACzII,QAAAA,EAAU;AAAC,QAAA;YAAEJ,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO,UAAA;YAAYE,YAAAA,EAAc;AAAW,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAc;AAAE,KAAA;IACtIK,KAAAA,EAAO;AAAC,QAAA;YAAEL,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SA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