@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,99 @@
1
+ 'use strict';
2
+
3
+ require('@cratis/scene.model');
4
+ var shellComponents = require('../layouts/shellComponents.js');
5
+ require('../layouts/appShell.js');
6
+ require('../layouts/fullPage.js');
7
+ var elements = require('./elements.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
+ * Turns a {@link ScreenTemplate}'s content into slot content on the {@link Layout} that contains it.
13
+ *
14
+ * The rule has two halves, and both matter. Content filed under a slot the *layout* also declares stays
15
+ * under that name - which is how a sign-in template's branding half reaches the full-page layout's `aside`
16
+ * region rather than being buried inside the form column. Everything else flows into the slot the
17
+ * template's `fitsSlot` names, because that is what `fitsSlot` means: this template occupies that region.
18
+ *
19
+ * @param template The template to place.
20
+ * @param layout The layout it is placed into.
21
+ * @returns Slot content keyed by the layout's own slot names.
22
+ */ function templateContentInLayout(template, layout) {
23
+ const layoutSlots = new Set(layout.slots.map((slot)=>slot.name));
24
+ const placed = {};
25
+ const ownSlotOrder = template.slots.map((slot)=>slot.name);
26
+ const content = template.content ?? {};
27
+ for (const slotName of ownSlotOrder){
28
+ const elements = content[slotName];
29
+ if (!elements || elements.length === 0) {
30
+ continue;
31
+ }
32
+ const target = layoutSlots.has(slotName) ? slotName : template.fitsSlot;
33
+ if (!target) {
34
+ continue;
35
+ }
36
+ placed[target] = [
37
+ ...placed[target] ?? [],
38
+ ...elements
39
+ ];
40
+ }
41
+ return placed;
42
+ }
43
+ /**
44
+ * Folds a containment chain of screen templates into the outermost one.
45
+ *
46
+ * This is `fitsSlot` doing its job, applied repeatedly. A slice's template fits a slot on the feature's
47
+ * template, which fits a slot on the module's, which fits a slot on the application layout - so the way to
48
+ * place the slice is to place it in the feature, place *that* result in the module, and hand the module to
49
+ * the layout. Folding from the inside out means the rule is written once and the chain can be any depth.
50
+ *
51
+ * The alternative - filing a nested template's content under its own `fitsSlot` at the top level - looks
52
+ * right and is not: the layout has no `body` slot, so the content lands in a region nothing renders and
53
+ * the screen comes up empty with nothing to explain it.
54
+ *
55
+ * @param chain The templates from outermost to innermost. A chain of one is returned unchanged.
56
+ * @returns A template with the same slots and `fitsSlot` as the outermost, carrying the whole chain's content.
57
+ */ function nestScreenTemplates(chain) {
58
+ return chain.reduceRight((inner, outer)=>inner === outer ? outer : placeInside(outer, inner));
59
+ }
60
+ function placeInside(outer, inner) {
61
+ if (!inner.fitsSlot) {
62
+ return outer;
63
+ }
64
+ const innerContent = inner.slots.flatMap((slot)=>inner.content?.[slot.name] ?? []);
65
+ return {
66
+ ...outer,
67
+ content: {
68
+ ...outer.content,
69
+ [inner.fitsSlot]: [
70
+ ...outer.content?.[inner.fitsSlot] ?? [],
71
+ ...innerContent
72
+ ]
73
+ }
74
+ };
75
+ }
76
+ /**
77
+ * Builds the element tree that renders a {@link Screen}.
78
+ *
79
+ * The screen's slot content becomes the shell component's slots one-for-one, which is the whole trick: a
80
+ * layout's slots and a shell component's slots are the same vocabulary, so nothing has to translate
81
+ * between them and a slot filled under a name the shell does not read is a spec failure rather than a
82
+ * silently missing region.
83
+ *
84
+ * @param screen The screen to render.
85
+ * @returns The shell element, ready for `SceneElementView`.
86
+ */ function composeScreenElement(screen) {
87
+ const shell = shellComponents.shellComponentForLayout(screen.layout);
88
+ if (!shell) {
89
+ throw new Error(`Screen '${screen.name}' names the layout '${screen.layout}', which this blueprint does not provide.`);
90
+ }
91
+ return elements.externalComponent(`screen-${screen.name}`, shell, {
92
+ screenName: screen.name
93
+ }, screen.slotContent);
94
+ }
95
+
96
+ exports.composeScreenElement = composeScreenElement;
97
+ exports.nestScreenTemplates = nestScreenTemplates;
98
+ exports.templateContentInLayout = templateContentInLayout;
99
+ //# sourceMappingURL=composeScreen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composeScreen.js","sources":["../../../gallery/composeScreen.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 { ExternalComponent, Layout, SceneElement, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { shellComponentForLayout } from '../layouts';\nimport { externalComponent } from './elements';\n\n/**\n * Turns a {@link ScreenTemplate}'s content into slot content on the {@link Layout} that contains it.\n *\n * The rule has two halves, and both matter. Content filed under a slot the *layout* also declares stays\n * under that name - which is how a sign-in template's branding half reaches the full-page layout's `aside`\n * region rather than being buried inside the form column. Everything else flows into the slot the\n * template's `fitsSlot` names, because that is what `fitsSlot` means: this template occupies that region.\n *\n * @param template The template to place.\n * @param layout The layout it is placed into.\n * @returns Slot content keyed by the layout's own slot names.\n */\nexport function templateContentInLayout(template: ScreenTemplate, layout: Layout): Record<string, SceneElement[]> {\n const layoutSlots = new Set(layout.slots.map(slot => slot.name));\n const placed: Record<string, SceneElement[]> = {};\n const ownSlotOrder = template.slots.map(slot => slot.name);\n const content = template.content ?? {};\n\n for (const slotName of ownSlotOrder) {\n const elements = content[slotName];\n if (!elements || elements.length === 0) {\n continue;\n }\n\n const target = layoutSlots.has(slotName) ? slotName : template.fitsSlot;\n if (!target) {\n continue;\n }\n\n placed[target] = [...(placed[target] ?? []), ...elements];\n }\n\n return placed;\n}\n\n/**\n * Folds a containment chain of screen templates into the outermost one.\n *\n * This is `fitsSlot` doing its job, applied repeatedly. A slice's template fits a slot on the feature's\n * template, which fits a slot on the module's, which fits a slot on the application layout - so the way to\n * place the slice is to place it in the feature, place *that* result in the module, and hand the module to\n * the layout. Folding from the inside out means the rule is written once and the chain can be any depth.\n *\n * The alternative - filing a nested template's content under its own `fitsSlot` at the top level - looks\n * right and is not: the layout has no `body` slot, so the content lands in a region nothing renders and\n * the screen comes up empty with nothing to explain it.\n *\n * @param chain The templates from outermost to innermost. A chain of one is returned unchanged.\n * @returns A template with the same slots and `fitsSlot` as the outermost, carrying the whole chain's content.\n */\nexport function nestScreenTemplates(chain: ScreenTemplate[]): ScreenTemplate {\n return chain.reduceRight((inner, outer) => (inner === outer ? outer : placeInside(outer, inner)));\n}\n\nfunction placeInside(outer: ScreenTemplate, inner: ScreenTemplate): ScreenTemplate {\n if (!inner.fitsSlot) {\n return outer;\n }\n\n const innerContent = inner.slots.flatMap(slot => inner.content?.[slot.name] ?? []);\n return {\n ...outer,\n content: {\n ...outer.content,\n [inner.fitsSlot]: [...(outer.content?.[inner.fitsSlot] ?? []), ...innerContent],\n },\n };\n}\n\n/**\n * Builds the element tree that renders a {@link Screen}.\n *\n * The screen's slot content becomes the shell component's slots one-for-one, which is the whole trick: a\n * layout's slots and a shell component's slots are the same vocabulary, so nothing has to translate\n * between them and a slot filled under a name the shell does not read is a spec failure rather than a\n * silently missing region.\n *\n * @param screen The screen to render.\n * @returns The shell element, ready for `SceneElementView`.\n */\nexport function composeScreenElement(screen: Screen): ExternalComponent {\n const shell = shellComponentForLayout(screen.layout);\n if (!shell) {\n throw new Error(`Screen '${screen.name}' names the layout '${screen.layout}', which this blueprint does not provide.`);\n }\n\n return externalComponent(`screen-${screen.name}`, shell, { screenName: screen.name }, screen.slotContent);\n}\n"],"names":["templateContentInLayout","template","layout","layoutSlots","Set","slots","map","slot","name","placed","ownSlotOrder","content","slotName","elements","length","target","has","fitsSlot","nestScreenTemplates","chain","reduceRight","inner","outer","placeInside","innerContent","flatMap","composeScreenElement","screen","shell","shellComponentForLayout","Error","externalComponent","screenName","slot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AED,KAAqB,EAAA;IAC7D,IAAI,CAACA,KAAAA,CAAMJ,QAAQ,EAAE;QACjB,OAAOK,KAAAA;AACX,IAAA;AAEA,IAAA,MAAME,eAAeH,KAAAA,CAAMhB,KAAK,CAACoB,OAAO,CAAClB,CAAAA,IAAAA,GAAQc,KAAAA,CAAMV,OAAO,GAAGJ,IAAAA,CAAKC,IAAI,CAAC,IAAI,EAAE,CAAA;IACjF,OAAO;AACH,QAAA,GAAGc,KAAK;QACRX,OAAAA,EAAS;AACL,YAAA,GAAGW,MAAMX,OAAO;YAChB,CAACU,KAAAA,CAAMJ,QAAQ,GAAG;AAAKK,gBAAAA,GAAAA,KAAAA,CAAMX,OAAO,GAAGU,MAAMJ,QAAQ,CAAC,IAAI,EAAE;AAAMO,gBAAAA,GAAAA;AAAa;AACnF;AACJ,KAAA;AACJ;AAEA;;;;;;;;;;IAWO,SAASE,oBAAAA,CAAqBC,MAAc,EAAA;IAC/C,MAAMC,KAAAA,GAAQC,uCAAAA,CAAwBF,MAAAA,CAAOzB,MAAM,CAAA;AACnD,IAAA,IAAI,CAAC0B,KAAAA,EAAO;AACR,QAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,QAAQ,EAAEH,MAAAA,CAAOnB,IAAI,CAAC,oBAAoB,EAAEmB,MAAAA,CAAOzB,MAAM,CAAC,yCAAyC,CAAC,CAAA;AACzH,IAAA;IAEA,OAAO6B,0BAAAA,CAAkB,CAAC,OAAO,EAAEJ,OAAOnB,IAAI,CAAA,CAAE,EAAEoB,KAAAA,EAAO;AAAEI,QAAAA,UAAAA,EAAYL,OAAOnB;AAAK,KAAA,EAAGmB,OAAOM,WAAW,CAAA;AAC5G;;;;;;"}
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ // Copyright (c) Cratis. All rights reserved.
4
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
5
+ /**
6
+ * The component names the gallery borrows from this blueprint's dependencies.
7
+ *
8
+ * A screen template names components by their **bare** name and lets `resolveComponentName` pick the
9
+ * package, which is what makes a template portable across profiles. The cost is that a template can
10
+ * reference a name no active package declares, and the only symptom is a dashed red placeholder in the
11
+ * middle of an otherwise fine screen.
12
+ *
13
+ * Every name below was checked against the owning package's own manifest - `primeReactPackage.ts` and
14
+ * `cratisComponentsPackage.ts` - rather than assumed. Two that a dashboard obviously wants, `chart` and
15
+ * `fileUpload`, are deliberately absent from both, so the templates use what does exist (a table of
16
+ * figures, an image beside a button) rather than referencing something that would not render.
17
+ *
18
+ * This list exists because this package does not take an npm dependency on either of those packages - a
19
+ * blueprint declares its dependencies in its manifest, not in its bundler graph. When a host wires the
20
+ * real manifests together, it should resolve against those instead, and any name that drifted will fail
21
+ * this blueprint's specs immediately.
22
+ */ /**
23
+ * Names borrowed from the `PrimeReact` package, each present in its declared component list.
24
+ *
25
+ * `menu`, `breadcrumb` and `sidebar` are here even though the gallery uses this blueprint's versions of
26
+ * them, because PrimeReact really does declare all three - and leaving them out would hide the shadowing
27
+ * that makes a blueprint's own shell components win those bare names.
28
+ */ const primeReactComponentNames = [
29
+ 'avatar',
30
+ 'breadcrumb',
31
+ 'calendar',
32
+ 'card',
33
+ 'checkbox',
34
+ 'column',
35
+ 'dataTable',
36
+ 'dropdown',
37
+ 'image',
38
+ 'menu',
39
+ 'sidebar',
40
+ 'inputNumber',
41
+ 'inputText',
42
+ 'inputTextarea',
43
+ 'message',
44
+ 'password',
45
+ 'progressBar',
46
+ 'steps',
47
+ 'tag',
48
+ 'text',
49
+ 'timeline'
50
+ ];
51
+ /**
52
+ * Names borrowed from the `Cratis.Components` package.
53
+ *
54
+ * Deliberately short. The gallery's templates are built from primitives so that they stay legible as
55
+ * *structure*; an application replaces a seeded table with a real `dataPage` bound to a query, and that is
56
+ * the point at which the Arc-bound composites earn their place.
57
+ */ const cratisComponentsNames = [
58
+ 'dataPage',
59
+ 'observableDataTable',
60
+ 'commandDialog',
61
+ 'dialog'
62
+ ];
63
+ /** The names `core` guarantees, regardless of which packages a profile lists. */ const coreComponentNames = [
64
+ 'text',
65
+ 'button',
66
+ 'card'
67
+ ];
68
+
69
+ exports.coreComponentNames = coreComponentNames;
70
+ exports.cratisComponentsNames = cratisComponentsNames;
71
+ exports.primeReactComponentNames = primeReactComponentNames;
72
+ //# sourceMappingURL=dependencyComponentNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dependencyComponentNames.js","sources":["../../../gallery/dependencyComponentNames.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\n/**\n * The component names the gallery borrows from this blueprint's dependencies.\n *\n * A screen template names components by their **bare** name and lets `resolveComponentName` pick the\n * package, which is what makes a template portable across profiles. The cost is that a template can\n * reference a name no active package declares, and the only symptom is a dashed red placeholder in the\n * middle of an otherwise fine screen.\n *\n * Every name below was checked against the owning package's own manifest - `primeReactPackage.ts` and\n * `cratisComponentsPackage.ts` - rather than assumed. Two that a dashboard obviously wants, `chart` and\n * `fileUpload`, are deliberately absent from both, so the templates use what does exist (a table of\n * figures, an image beside a button) rather than referencing something that would not render.\n *\n * This list exists because this package does not take an npm dependency on either of those packages - a\n * blueprint declares its dependencies in its manifest, not in its bundler graph. When a host wires the\n * real manifests together, it should resolve against those instead, and any name that drifted will fail\n * this blueprint's specs immediately.\n */\n\n/**\n * Names borrowed from the `PrimeReact` package, each present in its declared component list.\n *\n * `menu`, `breadcrumb` and `sidebar` are here even though the gallery uses this blueprint's versions of\n * them, because PrimeReact really does declare all three - and leaving them out would hide the shadowing\n * that makes a blueprint's own shell components win those bare names.\n */\nexport const primeReactComponentNames: string[] = [\n 'avatar',\n 'breadcrumb',\n 'calendar',\n 'card',\n 'checkbox',\n 'column',\n 'dataTable',\n 'dropdown',\n 'image',\n 'menu',\n 'sidebar',\n 'inputNumber',\n 'inputText',\n 'inputTextarea',\n 'message',\n 'password',\n 'progressBar',\n 'steps',\n 'tag',\n 'text',\n 'timeline',\n];\n\n/**\n * Names borrowed from the `Cratis.Components` package.\n *\n * Deliberately short. The gallery's templates are built from primitives so that they stay legible as\n * *structure*; an application replaces a seeded table with a real `dataPage` bound to a query, and that is\n * the point at which the Arc-bound composites earn their place.\n */\nexport const cratisComponentsNames: string[] = ['dataPage', 'observableDataTable', 'commandDialog', 'dialog'];\n\n/** The names `core` guarantees, regardless of which packages a profile lists. */\nexport const coreComponentNames: string[] = ['text', 'button', 'card'];\n"],"names":["primeReactComponentNames","cratisComponentsNames","coreComponentNames"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;UA0BaA,wBAAAA,GAAqC;AAC9C,IAAA,QAAA;AACA,IAAA,YAAA;AACA,IAAA,UAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,WAAA;AACA,IAAA,UAAA;AACA,IAAA,OAAA;AACA,IAAA,MAAA;AACA,IAAA,SAAA;AACA,IAAA,aAAA;AACA,IAAA,WAAA;AACA,IAAA,eAAA;AACA,IAAA,SAAA;AACA,IAAA,UAAA;AACA,IAAA,aAAA;AACA,IAAA,OAAA;AACA,IAAA,KAAA;AACA,IAAA,MAAA;AACA,IAAA;;AAGJ;;;;;;UAOaC,qBAAAA,GAAkC;AAAC,IAAA,UAAA;AAAY,IAAA,qBAAA;AAAuB,IAAA,eAAA;AAAiB,IAAA;;AAEpG,kFACO,MAAMC,kBAAAA,GAA+B;AAAC,IAAA,MAAA;AAAQ,IAAA,QAAA;AAAU,IAAA;;;;;;;"}
@@ -0,0 +1,161 @@
1
+ 'use strict';
2
+
3
+ var TemplateSlotName = require('./TemplateSlotName.js');
4
+ var elements = require('./elements.js');
5
+ var widgets = require('./widgets.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 three dialog shapes an application repeats: confirm something destructive, capture a short form, and
11
+ * show a record without leaving the list behind it.
12
+ *
13
+ * A dialog template has no `fitsSlot`, and that absence is the whole distinction. A screen template is
14
+ * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it
15
+ * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it
16
+ * happens to be, so there is no parent slot for it to name.
17
+ */ /** Confirm: one question, two answers, and enough context to answer it. */ const confirmDialogTemplate = {
18
+ name: 'ConfirmDialog',
19
+ slots: [
20
+ {
21
+ name: TemplateSlotName.TemplateSlotName.Header
22
+ },
23
+ {
24
+ name: TemplateSlotName.TemplateSlotName.Body
25
+ },
26
+ {
27
+ name: TemplateSlotName.TemplateSlotName.Actions
28
+ }
29
+ ],
30
+ content: {
31
+ [TemplateSlotName.TemplateSlotName.Header]: [
32
+ elements.text('confirm-title', 'Archive this product?')
33
+ ],
34
+ [TemplateSlotName.TemplateSlotName.Body]: [
35
+ elements.text('confirm-message', 'Bamboo Watch will stop appearing in the catalog. Existing orders keep it.'),
36
+ elements.externalComponent('confirm-note', 'message', {
37
+ severity: 'warn',
38
+ text: 'This can be undone from the archive.'
39
+ })
40
+ ],
41
+ [TemplateSlotName.TemplateSlotName.Actions]: [
42
+ elements.panel('confirm-actions', [
43
+ elements.button('confirm-yes', 'Archive', {
44
+ severity: 'danger'
45
+ }),
46
+ elements.button('confirm-no', 'Keep it', {
47
+ severity: 'secondary'
48
+ })
49
+ ])
50
+ ]
51
+ },
52
+ displayName: 'Confirmation dialog',
53
+ description: 'One question with the consequence spelled out, and a way back.'
54
+ };
55
+ /** Form: a short capture that does not deserve a page of its own. */ const formDialogTemplate = {
56
+ name: 'FormDialog',
57
+ slots: [
58
+ {
59
+ name: TemplateSlotName.TemplateSlotName.Header
60
+ },
61
+ {
62
+ name: TemplateSlotName.TemplateSlotName.Body
63
+ },
64
+ {
65
+ name: TemplateSlotName.TemplateSlotName.Actions
66
+ }
67
+ ],
68
+ content: {
69
+ [TemplateSlotName.TemplateSlotName.Header]: [
70
+ elements.text('form-dialog-title', 'Invite someone')
71
+ ],
72
+ [TemplateSlotName.TemplateSlotName.Body]: [
73
+ widgets.field('form-dialog-email', 'Email', 'inputText', {
74
+ placeholder: 'them@contoso.com'
75
+ }),
76
+ widgets.field('form-dialog-role', 'Role', 'dropdown', {
77
+ options: [
78
+ 'Viewer',
79
+ 'Editor',
80
+ 'Administrator'
81
+ ]
82
+ }),
83
+ widgets.field('form-dialog-message', 'Message', 'inputTextarea', {
84
+ rows: 3
85
+ })
86
+ ],
87
+ [TemplateSlotName.TemplateSlotName.Actions]: [
88
+ elements.panel('form-dialog-actions', [
89
+ elements.button('form-dialog-send', 'Send invitation', {
90
+ severity: 'primary'
91
+ }),
92
+ elements.button('form-dialog-cancel', 'Cancel', {
93
+ severity: 'secondary'
94
+ })
95
+ ])
96
+ ]
97
+ },
98
+ displayName: 'Form dialog',
99
+ description: 'A handful of fields captured without leaving the page underneath.'
100
+ };
101
+ /** Detail: a record shown over the list it came from. */ const detailDialogTemplate = {
102
+ name: 'DetailDialog',
103
+ slots: [
104
+ {
105
+ name: TemplateSlotName.TemplateSlotName.Header
106
+ },
107
+ {
108
+ name: TemplateSlotName.TemplateSlotName.Body
109
+ },
110
+ {
111
+ name: TemplateSlotName.TemplateSlotName.SidePanel
112
+ },
113
+ {
114
+ name: TemplateSlotName.TemplateSlotName.Actions
115
+ }
116
+ ],
117
+ content: {
118
+ [TemplateSlotName.TemplateSlotName.Header]: [
119
+ elements.text('detail-dialog-title', 'ORD-4192')
120
+ ],
121
+ [TemplateSlotName.TemplateSlotName.Body]: [
122
+ elements.card('detail-dialog-summary', [
123
+ elements.text('detail-dialog-customer', 'Northwind Traders'),
124
+ elements.text('detail-dialog-total', '$1,240.00'),
125
+ elements.externalComponent('detail-dialog-status', 'tag', {
126
+ value: 'Shipped',
127
+ severity: 'success'
128
+ })
129
+ ])
130
+ ],
131
+ [TemplateSlotName.TemplateSlotName.SidePanel]: [
132
+ elements.externalComponent('detail-dialog-timeline', 'timeline', {
133
+ align: 'left'
134
+ })
135
+ ],
136
+ [TemplateSlotName.TemplateSlotName.Actions]: [
137
+ elements.panel('detail-dialog-actions', [
138
+ elements.button('detail-dialog-open', 'Open full record', {
139
+ severity: 'primary',
140
+ targetScreen: 'DetailView'
141
+ }),
142
+ elements.button('detail-dialog-close', 'Close', {
143
+ severity: 'secondary'
144
+ })
145
+ ])
146
+ ]
147
+ },
148
+ displayName: 'Detail dialog',
149
+ description: 'A record over the list it came from, with a route to the full page.'
150
+ };
151
+ /** The dialog templates this blueprint provides. */ const galleryDialogTemplates = [
152
+ confirmDialogTemplate,
153
+ formDialogTemplate,
154
+ detailDialogTemplate
155
+ ];
156
+
157
+ exports.confirmDialogTemplate = confirmDialogTemplate;
158
+ exports.detailDialogTemplate = detailDialogTemplate;
159
+ exports.formDialogTemplate = formDialogTemplate;
160
+ exports.galleryDialogTemplates = galleryDialogTemplates;
161
+ //# sourceMappingURL=dialogTemplates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialogTemplates.js","sources":["../../../gallery/dialogTemplates.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 { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, panel, text } from './elements';\nimport { field } from './widgets';\n\n/**\n * The three dialog shapes an application repeats: confirm something destructive, capture a short form, and\n * show a record without leaving the list behind it.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction. A screen template is\n * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it\n * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it\n * happens to be, so there is no parent slot for it to name.\n */\n\n/** Confirm: one question, two answers, and enough context to answer it. */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('confirm-title', 'Archive this product?')],\n [TemplateSlotName.Body]: [\n text('confirm-message', 'Bamboo Watch will stop appearing in the catalog. Existing orders keep it.'),\n externalComponent('confirm-note', 'message', { severity: 'warn', text: 'This can be undone from the archive.' }),\n ],\n [TemplateSlotName.Actions]: [\n panel('confirm-actions', [button('confirm-yes', 'Archive', { severity: 'danger' }), button('confirm-no', 'Keep it', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, and a way back.',\n};\n\n/** Form: a short capture that does not deserve a page of its own. */\nexport const formDialogTemplate: DialogTemplate = {\n name: 'FormDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('form-dialog-title', 'Invite someone')],\n [TemplateSlotName.Body]: [\n field('form-dialog-email', 'Email', 'inputText', { placeholder: 'them@contoso.com' }),\n field('form-dialog-role', 'Role', 'dropdown', { options: ['Viewer', 'Editor', 'Administrator'] }),\n field('form-dialog-message', 'Message', 'inputTextarea', { rows: 3 }),\n ],\n [TemplateSlotName.Actions]: [\n panel('form-dialog-actions', [button('form-dialog-send', 'Send invitation', { severity: 'primary' }), button('form-dialog-cancel', 'Cancel', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Form dialog',\n description: 'A handful of fields captured without leaving the page underneath.',\n};\n\n/** Detail: a record shown over the list it came from. */\nexport const detailDialogTemplate: DialogTemplate = {\n name: 'DetailDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('detail-dialog-title', 'ORD-4192')],\n [TemplateSlotName.Body]: [\n card('detail-dialog-summary', [\n text('detail-dialog-customer', 'Northwind Traders'),\n text('detail-dialog-total', '$1,240.00'),\n externalComponent('detail-dialog-status', 'tag', { value: 'Shipped', severity: 'success' }),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [externalComponent('detail-dialog-timeline', 'timeline', { align: 'left' })],\n [TemplateSlotName.Actions]: [\n panel('detail-dialog-actions', [button('detail-dialog-open', 'Open full record', { severity: 'primary', targetScreen: 'DetailView' }), button('detail-dialog-close', 'Close', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Detail dialog',\n description: 'A record over the list it came from, with a route to the full page.',\n};\n\n/** The dialog templates this blueprint provides. */\nexport const galleryDialogTemplates: DialogTemplate[] = [confirmDialogTemplate, formDialogTemplate, detailDialogTemplate];\n"],"names":["confirmDialogTemplate","name","slots","TemplateSlotName","Header","Body","Actions","content","text","externalComponent","severity","panel","button","displayName","description","formDialogTemplate","field","placeholder","options","rows","detailDialogTemplate","SidePanel","card","value","align","targetScreen","galleryDialogTemplates"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;AAQC,gFAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,kCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEH,YAAAA,IAAAA,EAAME,kCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEJ,YAAAA,IAAAA,EAAME,kCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,OAAAA,EAAS;QACL,CAACJ,iCAAAA,CAAiBC,MAAM,GAAG;AAACI,YAAAA,aAAAA,CAAK,eAAA,EAAiB,uBAAA;AAAyB,SAAA;QAC3E,CAACL,iCAAAA,CAAiBE,IAAI,GAAG;AACrBG,YAAAA,aAAAA,CAAK,iBAAA,EAAmB,2EAAA,CAAA;AACxBC,YAAAA,0BAAAA,CAAkB,gBAAgB,SAAA,EAAW;gBAAEC,QAAAA,EAAU,MAAA;gBAAQF,IAAAA,EAAM;AAAuC,aAAA;AACjH,SAAA;QACD,CAACL,iCAAAA,CAAiBG,OAAO,GAAG;AACxBK,YAAAA,cAAAA,CAAM,iBAAA,EAAmB;AAACC,gBAAAA,eAAAA,CAAO,eAAe,SAAA,EAAW;oBAAEF,QAAAA,EAAU;AA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AAA,CAAO,uBAAuB,OAAA,EAAS;oBAAEF,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AAC5M;AACL,KAAA;IACAG,WAAAA,EAAa,eAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qDACO,MAAMY,sBAAAA,GAA2C;AAAC1B,IAAAA,qBAAAA;AAAuBe,IAAAA,kBAAAA;AAAoBK,IAAAA;;;;;;;;"}
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ var scene_model = require('@cratis/scene.model');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * Constructors for the element trees the gallery templates are built from.
9
+ *
10
+ * `ExternalComponent` inherits fifteen required members from `FrameworkElement` and `VisualElement` -
11
+ * visibility, opacity, z-index, both size constraints, margin and both alignments - before it gets to the
12
+ * two that matter to a template author. Written as object literals, a page of realistic content is
13
+ * ninety percent boilerplate and unreadable. These put the defaults in one place so a template reads as
14
+ * the tree it is.
15
+ */ const elementDefaults = {
16
+ properties: {},
17
+ visibility: scene_model.Visibility.Visible,
18
+ isEnabled: true,
19
+ opacity: 1,
20
+ size: {},
21
+ zIndex: 0,
22
+ minimumSize: {},
23
+ maximumSize: {},
24
+ margin: {
25
+ left: 0,
26
+ top: 0,
27
+ right: 0,
28
+ bottom: 0
29
+ },
30
+ horizontalAlignment: scene_model.HorizontalAlignment.Stretch,
31
+ verticalAlignment: scene_model.VerticalAlignment.Stretch
32
+ };
33
+ /**
34
+ * An {@link ExternalComponent} naming a component by its **bare** name.
35
+ *
36
+ * Bare rather than package-qualified on purpose: `resolveComponentName` then decides which active package
37
+ * wins the name against the profile's priority order, so the same template renders with PrimeReact's
38
+ * widgets in one profile and somebody else's in another. A template that qualified its names would pin
39
+ * itself to one library and stop being a template.
40
+ */ function externalComponent(id, componentName, properties = {}, slots = {}) {
41
+ return {
42
+ ...elementDefaults,
43
+ id,
44
+ name: id,
45
+ properties,
46
+ componentName,
47
+ slots
48
+ };
49
+ }
50
+ /** A {@link Panel} grouping children, for a row or column of content inside a slot. */ function panel(id, children) {
51
+ return {
52
+ ...elementDefaults,
53
+ id,
54
+ name: id,
55
+ children
56
+ };
57
+ }
58
+ /** A `core:text` run - the one component name guaranteed to resolve in every profile. */ function text(id, value) {
59
+ return externalComponent(id, 'text', {
60
+ text: value
61
+ });
62
+ }
63
+ /** A `core:button`. */ function button(id, label, properties = {}) {
64
+ return externalComponent(id, 'button', {
65
+ label,
66
+ ...properties
67
+ });
68
+ }
69
+ /** A `core:card` wrapping content. */ function card(id, content, properties = {}) {
70
+ return externalComponent(id, 'card', properties, {
71
+ content
72
+ });
73
+ }
74
+
75
+ exports.button = button;
76
+ exports.card = card;
77
+ exports.externalComponent = externalComponent;
78
+ exports.panel = panel;
79
+ exports.text = text;
80
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sources":["../../../gallery/elements.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 { ExternalComponent, HorizontalAlignment, Panel, SceneElement, VerticalAlignment, Visibility } from '@cratis/scene.model';\n\n/**\n * Constructors for the element trees the gallery templates are built from.\n *\n * `ExternalComponent` inherits fifteen required members from `FrameworkElement` and `VisualElement` -\n * visibility, opacity, z-index, both size constraints, margin and both alignments - before it gets to the\n * two that matter to a template author. Written as object literals, a page of realistic content is\n * ninety percent boilerplate and unreadable. These put the defaults in one place so a template reads as\n * the tree it is.\n */\n\nconst elementDefaults = {\n properties: {},\n visibility: Visibility.Visible,\n isEnabled: true,\n opacity: 1,\n size: {},\n zIndex: 0,\n minimumSize: {},\n maximumSize: {},\n margin: { left: 0, top: 0, right: 0, bottom: 0 },\n horizontalAlignment: HorizontalAlignment.Stretch,\n verticalAlignment: VerticalAlignment.Stretch,\n};\n\n/**\n * An {@link ExternalComponent} naming a component by its **bare** name.\n *\n * Bare rather than package-qualified on purpose: `resolveComponentName` then decides which active package\n * wins the name against the profile's priority order, so the same template renders with PrimeReact's\n * widgets in one profile and somebody else's in another. A template that qualified its names would pin\n * itself to one library and stop being a template.\n */\nexport function externalComponent(\n id: string,\n componentName: string,\n properties: Record<string, unknown> = {},\n slots: Record<string, SceneElement[]> = {},\n): ExternalComponent {\n return { ...elementDefaults, id, name: id, properties, componentName, slots };\n}\n\n/** A {@link Panel} grouping children, for a row or column of content inside a slot. */\nexport function panel(id: string, children: SceneElement[]): Panel {\n return { ...elementDefaults, id, name: id, children };\n}\n\n/** A `core:text` run - the one component name guaranteed to resolve in every profile. */\nexport function text(id: string, value: string): ExternalComponent {\n return externalComponent(id, 'text', { text: value });\n}\n\n/** A `core:button`. */\nexport function button(id: string, label: string, properties: Record<string, unknown> = {}): ExternalComponent {\n return externalComponent(id, 'button', { label, ...properties });\n}\n\n/** A `core:card` wrapping content. */\nexport function card(id: string, content: SceneElement[], properties: Record<string, unknown> = {}): ExternalComponent {\n return externalComponent(id, 'card', properties, { content });\n}\n"],"names":["elementDefaults","properties","visibility","Visibility","Visible","isEnabled","opacity","size","zIndex","minimumSize","maximumSize","margin","left","top","right","bottom","horizontalAlignment","HorizontalAlignment","Stretch","verticalAlignment","VerticalAlignment","externalComponent","id","componentName","slots","name","panel","children","text","value","button","label","card","content"],"mappings":";;;;AAAA;AACA;AAIA;;;;;;;;AAQC,IAED,MAAMA,eAAAA,GAAkB;AACpBC,IAAAA,UAAAA,EAAY,EAAC;AACbC,IAAAA,UAAAA,EAAYC,uBAAWC,OAAO;IAC9BC,SAAAA,EAAW,IAAA;IACXC,OAAAA,EAAS,CAAA;AACTC,IAAAA,IAAAA,EAAM,EAAC;IACPC,MAAAA,EAAQ,CAAA;AACRC,IAAAA,WAAAA,EAAa,EAAC;AACdC,IAAAA,WAAAA,EAAa,EAAC;IACdC,MAAAA,EAAQ;QAAEC,IAAAA,EAAM,CAAA;QAAGC,GAAAA,EAAK,CAAA;QAAGC,KAAAA,EA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
3
+ var ComponentName = require('../ComponentName.js');
4
+ var elements = require('./elements.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
+ /** The contribution point the built-in navigation aggregation reads. */ const navigationContributionPoint = 'Navigation';
9
+ /**
10
+ * The gallery's navigation, declared once.
11
+ *
12
+ * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to
13
+ * the `Navigation` contribution point where `aggregateContributions` + `extractNavigationItem` turn them
14
+ * back into navigation items. A blueprint that maintained a menu *and* a separate navigation declaration
15
+ * would have two lists that agree right up until someone adds a screen to one of them.
16
+ */ const navigationEntries = [
17
+ {
18
+ label: 'Dashboard',
19
+ targetScreen: 'Dashboard',
20
+ icon: 'pi pi-home',
21
+ group: 'Workspace',
22
+ order: 10
23
+ },
24
+ {
25
+ label: 'Products',
26
+ targetScreen: 'CrudList',
27
+ icon: 'pi pi-box',
28
+ group: 'Workspace',
29
+ order: 20
30
+ },
31
+ {
32
+ label: 'Product detail',
33
+ targetScreen: 'DetailView',
34
+ icon: 'pi pi-file',
35
+ group: 'Workspace',
36
+ order: 30
37
+ },
38
+ {
39
+ label: 'New product',
40
+ targetScreen: 'FormPage',
41
+ icon: 'pi pi-plus-circle',
42
+ group: 'Workspace',
43
+ order: 40
44
+ },
45
+ {
46
+ label: 'Invoices',
47
+ targetScreen: 'Invoice',
48
+ icon: 'pi pi-receipt',
49
+ group: 'Workspace',
50
+ order: 50
51
+ },
52
+ {
53
+ label: 'Nothing yet',
54
+ targetScreen: 'Empty',
55
+ icon: 'pi pi-inbox',
56
+ group: 'Workspace',
57
+ order: 60
58
+ },
59
+ {
60
+ label: 'Users',
61
+ targetScreen: 'UserManagement',
62
+ icon: 'pi pi-users',
63
+ group: 'Administration',
64
+ order: 10
65
+ },
66
+ {
67
+ label: 'Your profile',
68
+ targetScreen: 'ProfileSettings',
69
+ icon: 'pi pi-user',
70
+ group: 'Administration',
71
+ order: 20
72
+ },
73
+ {
74
+ label: 'Documentation',
75
+ targetScreen: 'Documentation',
76
+ icon: 'pi pi-book',
77
+ group: 'Support',
78
+ order: 10
79
+ },
80
+ {
81
+ label: 'Help',
82
+ targetScreen: 'Help',
83
+ icon: 'pi pi-question-circle',
84
+ group: 'Support',
85
+ order: 20
86
+ }
87
+ ];
88
+ /**
89
+ * The element one navigation entry becomes.
90
+ *
91
+ * `routeParameterBindings` is present and empty rather than omitted, because that is what
92
+ * `extractNavigationItem` expects to read - and an omitted bag and an empty one are the same thing right
93
+ * up until something iterates it.
94
+ */ function navigationElement(entry, activeScreen) {
95
+ return elements.externalComponent(`nav-${entry.targetScreen}`, ComponentName.ComponentName.MenuItem, {
96
+ label: entry.label,
97
+ targetScreen: entry.targetScreen,
98
+ routeParameterBindings: {},
99
+ order: entry.order,
100
+ group: entry.group,
101
+ icon: entry.icon,
102
+ isActive: entry.targetScreen === activeScreen
103
+ });
104
+ }
105
+ /**
106
+ * The navigation as contributions to the `Navigation` contribution point.
107
+ *
108
+ * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes
109
+ * from whatever is currently in scope - so a screen that contributes an extra entry gets it in the
110
+ * navigation without the navigation knowing that screen exists.
111
+ */ const navigationContributions = navigationEntries.map((entry)=>({
112
+ contributionPointName: navigationContributionPoint,
113
+ content: navigationElement(entry),
114
+ order: entry.order
115
+ }));
116
+ /** The navigation entries of one group, in order. */ function entriesInGroup(group) {
117
+ return navigationEntries.filter((entry)=>entry.group === group).sort((first, second)=>first.order - second.order);
118
+ }
119
+ /** Every group named by the navigation, in first-declared order. */ const navigationGroups = [
120
+ ...new Set(navigationEntries.map((entry)=>entry.group))
121
+ ];
122
+
123
+ exports.entriesInGroup = entriesInGroup;
124
+ exports.navigationContributionPoint = navigationContributionPoint;
125
+ exports.navigationContributions = navigationContributions;
126
+ exports.navigationElement = navigationElement;
127
+ exports.navigationEntries = navigationEntries;
128
+ exports.navigationGroups = navigationGroups;
129
+ //# 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, SceneElement } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { NavigationEntry } from './NavigationEntry';\nimport { externalComponent } from './elements';\n\n/** The contribution point the built-in navigation aggregation reads. */\nexport const navigationContributionPoint = 'Navigation';\n\n/**\n * The gallery's navigation, 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 `aggregateContributions` + `extractNavigationItem` turn them\n * back into navigation items. A blueprint that maintained a menu *and* a separate navigation declaration\n * would have two lists that agree right up until someone adds a screen to one of them.\n */\nexport const navigationEntries: NavigationEntry[] = [\n { label: 'Dashboard', targetScreen: 'Dashboard', icon: 'pi pi-home', group: 'Workspace', order: 10 },\n { label: 'Products', targetScreen: 'CrudList', icon: 'pi pi-box', group: 'Workspace', order: 20 },\n { label: 'Product detail', targetScreen: 'DetailView', icon: 'pi pi-file', group: 'Workspace', order: 30 },\n { label: 'New product', targetScreen: 'FormPage', icon: 'pi pi-plus-circle', group: 'Workspace', order: 40 },\n { label: 'Invoices', targetScreen: 'Invoice', icon: 'pi pi-receipt', group: 'Workspace', order: 50 },\n { label: 'Nothing yet', targetScreen: 'Empty', icon: 'pi pi-inbox', group: 'Workspace', order: 60 },\n { label: 'Users', targetScreen: 'UserManagement', icon: 'pi pi-users', group: 'Administration', order: 10 },\n { label: 'Your profile', targetScreen: 'ProfileSettings', icon: 'pi pi-user', group: 'Administration', order: 20 },\n { label: 'Documentation', targetScreen: 'Documentation', icon: 'pi pi-book', group: 'Support', order: 10 },\n { label: 'Help', targetScreen: 'Help', icon: 'pi pi-question-circle', group: 'Support', order: 20 },\n];\n\n/**\n * The element one navigation entry becomes.\n *\n * `routeParameterBindings` is present and empty rather than omitted, because that is what\n * `extractNavigationItem` expects to read - and an omitted bag and an empty one are the same thing right\n * up until something iterates it.\n */\nexport function navigationElement(entry: NavigationEntry, activeScreen?: string): SceneElement {\n return externalComponent(`nav-${entry.targetScreen}`, ComponentName.MenuItem, {\n label: entry.label,\n targetScreen: entry.targetScreen,\n routeParameterBindings: {},\n order: entry.order,\n group: entry.group,\n icon: entry.icon,\n isActive: entry.targetScreen === activeScreen,\n });\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 in the\n * navigation without the navigation knowing that screen exists.\n */\nexport const navigationContributions: Contribution[] = navigationEntries.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 navigationEntries.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 navigationGroups: string[] = [...new Set(navigationEntries.map(entry => entry.group))];\n"],"names":["navigationContributionPoint","navigationEntries","label","targetScreen","icon","group","order","navigationElement","entry","activeScreen","externalComponent","ComponentName","MenuItem","routeParameterBindings","isActive","navigationContributions","map","contributionPointName","content","entriesInGroup","filter","sort","first","second","navigationGroups","Set"],"mappings":";;;;;AAAA;AACA;AAOA,yEACO,MAAMA,2BAAAA,GAA8B;AAE3C;;;;;;;UAQaC,iBAAAA,GAAuC;AAChD,IAAA;QAAEC,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,WAAA;QAAaC,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,WAAA;QAAaC,KAAAA,EAAO;AAAG,KAAA;AACnG,IAAA;QAAEJ,KAAAA,EAAO,UAAA;QAAYC,YAAAA,EAAc,UAAA;QAAYC,IAAAA,EAAM,WAAA;QAAaC,KAAAA,EAAO,WAAA;QAAaC,KAAAA,EAAO;AAAG,KAAA;AA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