@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,9 @@
1
+ export * from './LayoutMode';
2
+ export * from './ColorScheme';
3
+ export * from './MenuTheme';
4
+ export * from './LayoutConfigState';
5
+ export * from './layoutConfigTransitions';
6
+ export * from './layoutWrapperClasses';
7
+ export * from './layoutConfigStorage';
8
+ export * from './LayoutConfigProvider';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../configuration/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { LayoutConfigState } from './LayoutConfigState';
2
+ export declare const layoutConfigStorageKey = "cratis.scene.blueprint.default";
3
+ export type PersistedLayoutConfig = Pick<LayoutConfigState, 'mode' | 'menuTheme' | 'colorScheme' | 'themeName' | 'isSidebarAnchored'>;
4
+ export declare function readPersistedLayoutConfig(storage?: Storage): LayoutConfigState;
5
+ export declare function persistLayoutConfig(state: LayoutConfigState, storage?: Storage): void;
6
+ //# sourceMappingURL=layoutConfigStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutConfigStorage.d.ts","sourceRoot":"","sources":["../../../configuration/layoutConfigStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,eAAO,MAAM,sBAAsB,mCAAmC,CAAC;AAUvE,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,mBAAmB,CAAC,CAAC;AActI,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAe9E;AAYD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAkBrF"}
@@ -0,0 +1,81 @@
1
+ import { ColorScheme } from './ColorScheme.js';
2
+ import { LayoutMode } from './LayoutMode.js';
3
+ import { MenuTheme } from './MenuTheme.js';
4
+ import { defaultLayoutConfigState } from './layoutConfigTransitions.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 `localStorage` key the shell persists its configuration under. */ const layoutConfigStorageKey = 'cratis.scene.blueprint.default';
9
+ /**
10
+ * Reads the persisted configuration back, falling back to {@link defaultLayoutConfigState} for anything
11
+ * missing or unrecognized.
12
+ *
13
+ * Everything is validated against the enums rather than trusted, because `localStorage` is shared with
14
+ * every other script on the origin and outlives the version of this package that wrote it. An unknown
15
+ * mode left in place would put a class on the wrapper that no stylesheet rule matches - a shell with no
16
+ * sidebar at all, and no error to explain it.
17
+ *
18
+ * @param storage The storage to read from, or `undefined` when there is none (server-side rendering).
19
+ * @returns The restored state, with defaults filled in.
20
+ */ function readPersistedLayoutConfig(storage) {
21
+ const defaults = defaultLayoutConfigState();
22
+ const stored = readRecord(storage);
23
+ if (!stored) {
24
+ return defaults;
25
+ }
26
+ return {
27
+ ...defaults,
28
+ mode: enumValue(Object.values(LayoutMode), stored.mode) ?? defaults.mode,
29
+ menuTheme: enumValue(Object.values(MenuTheme), stored.menuTheme) ?? defaults.menuTheme,
30
+ colorScheme: enumValue(Object.values(ColorScheme), stored.colorScheme) ?? defaults.colorScheme,
31
+ themeName: typeof stored.themeName === 'string' ? stored.themeName : defaults.themeName,
32
+ isSidebarAnchored: typeof stored.isSidebarAnchored === 'boolean' ? stored.isSidebarAnchored : defaults.isSidebarAnchored
33
+ };
34
+ }
35
+ /**
36
+ * Writes the durable parts of the configuration.
37
+ *
38
+ * Storage can throw - Safari's private mode and a full quota both do - and a shell that cannot remember a
39
+ * preference is a far smaller problem than one that crashes on a mode switch, so a failure here is
40
+ * swallowed rather than propagated.
41
+ *
42
+ * @param state The state to persist.
43
+ * @param storage The storage to write to, or `undefined` when there is none.
44
+ */ function persistLayoutConfig(state, storage) {
45
+ if (!storage) {
46
+ return;
47
+ }
48
+ const persisted = {
49
+ mode: state.mode,
50
+ menuTheme: state.menuTheme,
51
+ colorScheme: state.colorScheme,
52
+ themeName: state.themeName,
53
+ isSidebarAnchored: state.isSidebarAnchored
54
+ };
55
+ try {
56
+ storage.setItem(layoutConfigStorageKey, JSON.stringify(persisted));
57
+ } catch {
58
+ // A browser that refuses to store a preference still has to render the shell.
59
+ }
60
+ }
61
+ function readRecord(storage) {
62
+ if (!storage) {
63
+ return undefined;
64
+ }
65
+ try {
66
+ const raw = storage.getItem(layoutConfigStorageKey);
67
+ if (!raw) {
68
+ return undefined;
69
+ }
70
+ const parsed = JSON.parse(raw);
71
+ return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : undefined;
72
+ } catch {
73
+ return undefined;
74
+ }
75
+ }
76
+ function enumValue(values, candidate) {
77
+ return typeof candidate === 'string' && values.includes(candidate) ? candidate : undefined;
78
+ }
79
+
80
+ export { layoutConfigStorageKey, persistLayoutConfig, readPersistedLayoutConfig };
81
+ //# sourceMappingURL=layoutConfigStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutConfigStorage.js","sources":["../../../configuration/layoutConfigStorage.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 { ColorScheme } from './ColorScheme';\nimport { LayoutConfigState } from './LayoutConfigState';\nimport { LayoutMode } from './LayoutMode';\nimport { MenuTheme } from './MenuTheme';\nimport { defaultLayoutConfigState } from './layoutConfigTransitions';\n\n/** The `localStorage` key the shell persists its configuration under. */\nexport const layoutConfigStorageKey = 'cratis.scene.blueprint.default';\n\n/**\n * The parts of {@link LayoutConfigState} worth surviving a reload.\n *\n * Deliberately not the whole record: whether the sidebar happened to be open, whether the pointer was\n * over it, and whether the viewport was narrow are all facts about the moment rather than preferences, and\n * restoring them produces a shell that opens in a state the user never chose. The pin *is* a preference,\n * so it stays.\n */\nexport type PersistedLayoutConfig = Pick<LayoutConfigState, 'mode' | 'menuTheme' | 'colorScheme' | 'themeName' | 'isSidebarAnchored'>;\n\n/**\n * Reads the persisted configuration back, falling back to {@link defaultLayoutConfigState} for anything\n * missing or unrecognized.\n *\n * Everything is validated against the enums rather than trusted, because `localStorage` is shared with\n * every other script on the origin and outlives the version of this package that wrote it. An unknown\n * mode left in place would put a class on the wrapper that no stylesheet rule matches - a shell with no\n * sidebar at all, and no error to explain it.\n *\n * @param storage The storage to read from, or `undefined` when there is none (server-side rendering).\n * @returns The restored state, with defaults filled in.\n */\nexport function readPersistedLayoutConfig(storage?: Storage): LayoutConfigState {\n const defaults = defaultLayoutConfigState();\n const stored = readRecord(storage);\n if (!stored) {\n return defaults;\n }\n\n return {\n ...defaults,\n mode: enumValue(Object.values(LayoutMode), stored.mode) ?? defaults.mode,\n menuTheme: enumValue(Object.values(MenuTheme), stored.menuTheme) ?? defaults.menuTheme,\n colorScheme: enumValue(Object.values(ColorScheme), stored.colorScheme) ?? defaults.colorScheme,\n themeName: typeof stored.themeName === 'string' ? stored.themeName : defaults.themeName,\n isSidebarAnchored: typeof stored.isSidebarAnchored === 'boolean' ? stored.isSidebarAnchored : defaults.isSidebarAnchored,\n };\n}\n\n/**\n * Writes the durable parts of the configuration.\n *\n * Storage can throw - Safari's private mode and a full quota both do - and a shell that cannot remember a\n * preference is a far smaller problem than one that crashes on a mode switch, so a failure here is\n * swallowed rather than propagated.\n *\n * @param state The state to persist.\n * @param storage The storage to write to, or `undefined` when there is none.\n */\nexport function persistLayoutConfig(state: LayoutConfigState, storage?: Storage): void {\n if (!storage) {\n return;\n }\n\n const persisted: PersistedLayoutConfig = {\n mode: state.mode,\n menuTheme: state.menuTheme,\n colorScheme: state.colorScheme,\n themeName: state.themeName,\n isSidebarAnchored: state.isSidebarAnchored,\n };\n\n try {\n storage.setItem(layoutConfigStorageKey, JSON.stringify(persisted));\n } catch {\n // A browser that refuses to store a preference still has to render the shell.\n }\n}\n\nfunction readRecord(storage?: Storage): Record<string, unknown> | undefined {\n if (!storage) {\n return undefined;\n }\n\n try {\n const raw = storage.getItem(layoutConfigStorageKey);\n if (!raw) {\n return undefined;\n }\n\n const parsed = JSON.parse(raw) as unknown;\n return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? (parsed as Record<string, unknown>) : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction enumValue<TValue extends string>(values: TValue[], candidate: unknown): TValue | undefined {\n return typeof candidate === 'string' && values.includes(candidate as TValue) ? (candidate as TValue) : undefined;\n}\n"],"names":["layoutConfigStorageKey","readPersistedLayoutConfig","storage","defaults","defaultLayoutConfigState","stored","readRecord","mode","enumValue","Object","values","LayoutMode","menuTheme","MenuTheme","colorScheme","ColorScheme","themeName","isSidebarAnchored","persistLayoutConfig","state","persisted","setItem","JSON","stringify","undefined","raw","getItem","parsed","parse","Array","isArray","candidate","includes"],"mappings":";;;;;AAAA;AACA;AAQA,0EACO,MAAMA,sBAAAA,GAAyB;AAYtC;;;;;;;;;;;IAYO,SAASC,yBAAAA,CAA0BC,OAAiB,EAAA;AACvD,IAAA,MAAMC,QAAAA,GAAWC,wBAAAA,EAAAA;AACjB,IAAA,MAAMC,SAASC,UAAAA,CAAWJ,OAAAA,CAAAA;AAC1B,IAAA,IAAI,CAACG,MAAAA,EAAQ;QACT,OAAOF,QAAAA;AACX,IAAA;IAEA,OAAO;AACH,QAAA,GAAGA,QAAQ;QACXI,IAAAA,EAAMC,SAAAA,CAAUC,OAAOC,MAAM,CAACC,aAAaN,MAAAA,CAAOE,IAAI,CAAA,IAAKJ,QAAAA,CAASI,IAAI;QACxEK,SAAAA,EAAWJ,SAAAA,CAAUC,OAAOC,MAAM,CAACG,YAAYR,MAAAA,CAAOO,SAAS,CAAA,IAAKT,QAAAA,CAASS,SAAS;QACtFE,WAAAA,EAAaN,SAAAA,CAAUC,OAAOC,MAAM,CAACK,cAAcV,MAAAA,CAAOS,WAAW,CAAA,IAAKX,QAAAA,CAASW,WAAW;QAC9FE,SAAAA,EAAW,OAAOX,OAAOW,SAAS,KAAK,WAAWX,MAAAA,CAAOW,SAAS,GAAGb,QAAAA,CAASa,SAAS;QACvFC,iBAAAA,EAAmB,OAAOZ,OAAOY,iBAAiB,KAAK,YAAYZ,MAAAA,CAAOY,iBAAiB,GAAGd,QAAAA,CAASc;AAC3G,KAAA;AACJ;AAEA;;;;;;;;;AASC,IACM,SAASC,mBAAAA,CAAoBC,KAAwB,EAAEjB,OAAiB,EAAA;AAC3E,IAAA,IAAI,CAACA,OAAAA,EAAS;AACV,QAAA;AACJ,IAAA;AAEA,IAAA,MAAMkB,SAAAA,GAAmC;AACrCb,QAAAA,IAAAA,EAAMY,MAAMZ,IAAI;AAChBK,QAAAA,SAAAA,EAAWO,MAAMP,SAAS;AAC1BE,QAAAA,WAAAA,EAAaK,MAAML,WAAW;AAC9BE,QAAAA,SAAAA,EAAWG,MAAMH,SAAS;AAC1BC,QAAAA,iBAAAA,EAAmBE,MAAMF;AAC7B,KAAA;IAEA,IAAI;AACAf,QAAAA,OAAAA,CAAQmB,OAAO,CAACrB,sBAAAA,EAAwBsB,IAAAA,CAAKC,SAAS,CAACH,SAAAA,CAAAA,CAAAA;AAC3D,IAAA,CAAA,CAAE,OAAM;;AAER,IAAA;AACJ;AAEA,SAASd,WAAWJ,OAAiB,EAAA;AACjC,IAAA,IAAI,CAACA,OAAAA,EAAS;QACV,OAAOsB,SAAAA;AACX,IAAA;IAEA,IAAI;QACA,MAAMC,GAAAA,GAAMvB,OAAAA,CAAQwB,OAAO,CAAC1B,sBAAAA,CAAAA;AAC5B,QAAA,IAAI,CAACyB,GAAAA,EAAK;YACN,OAAOD,SAAAA;AACX,QAAA;QAEA,MAAMG,MAAAA,GAASL,IAAAA,CAAKM,KAAK,CAACH,GAAAA,CAAAA;QAC1B,OAAO,OAAOE,MAAAA,KAAW,QAAA,IAAYA,MAAAA,KAAW,IAAA,IAAQ,CAACE,KAAAA,CAAMC,OAAO,CAACH,MAAAA,CAAAA,GAAWA,MAAAA,GAAqCH,SAAAA;AAC3H,IAAA,CAAA,CAAE,OAAM;QACJ,OAAOA,SAAAA;AACX,IAAA;AACJ;AAEA,SAAShB,SAAAA,CAAiCE,MAAgB,EAAEqB,SAAkB,EAAA;AAC1E,IAAA,OAAO,OAAOA,SAAAA,KAAc,QAAA,IAAYrB,OAAOsB,QAAQ,CAACD,aAAwBA,SAAAA,GAAuBP,SAAAA;AAC3G;;;;"}
@@ -0,0 +1,22 @@
1
+ import { ColorScheme } from './ColorScheme';
2
+ import { LayoutConfigState } from './LayoutConfigState';
3
+ import { LayoutMode } from './LayoutMode';
4
+ import { MenuTheme } from './MenuTheme';
5
+ export declare const mobileBreakpoint = 991;
6
+ export declare const mobileMediaQuery = "(max-width: 991px)";
7
+ export declare function isMobileWidth(width: number): boolean;
8
+ export declare function defaultLayoutConfigState(): LayoutConfigState;
9
+ export declare function effectiveLayoutMode(state: LayoutConfigState): LayoutMode;
10
+ export declare function isOffCanvasMode(mode: LayoutMode): boolean;
11
+ export declare function isPointerRevealMode(mode: LayoutMode): boolean;
12
+ export declare function withMode(state: LayoutConfigState, mode: LayoutMode): LayoutConfigState;
13
+ export declare function withMobile(state: LayoutConfigState, isMobile: boolean): LayoutConfigState;
14
+ export declare function withSidebarOpen(state: LayoutConfigState, isSidebarOpen: boolean): LayoutConfigState;
15
+ export declare function toggleSidebar(state: LayoutConfigState): LayoutConfigState;
16
+ export declare function withSidebarRevealed(state: LayoutConfigState, isSidebarRevealed: boolean): LayoutConfigState;
17
+ export declare function withSidebarAnchored(state: LayoutConfigState, isSidebarAnchored: boolean): LayoutConfigState;
18
+ export declare function toggleSidebarAnchor(state: LayoutConfigState): LayoutConfigState;
19
+ export declare function withColorScheme(state: LayoutConfigState, colorScheme: ColorScheme): LayoutConfigState;
20
+ export declare function withMenuTheme(state: LayoutConfigState, menuTheme: MenuTheme): LayoutConfigState;
21
+ export declare function withThemeName(state: LayoutConfigState, themeName: string): LayoutConfigState;
22
+ //# sourceMappingURL=layoutConfigTransitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutConfigTransitions.d.ts","sourceRoot":"","sources":["../../../configuration/layoutConfigTransitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAGpC,eAAO,MAAM,gBAAgB,uBAAuC,CAAC;AAMrE,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAMD,wBAAgB,wBAAwB,IAAI,iBAAiB,CAW5D;AAUD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAExE;AAGD,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEzD;AAGD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAE7D;AAUD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,GAAG,iBAAiB,CAEtF;AASD,wBAAgB,UAAU,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,GAAG,iBAAiB,CAWzF;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,OAAO,GAAG,iBAAiB,CAEnG;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,iBAAiB,CAEzE;AASD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,GAAG,iBAAiB,CAM3G;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,GAAG,iBAAiB,CAE3G;AAGD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,iBAAiB,CAE/E;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,GAAG,iBAAiB,CAErG;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,SAAS,GAAG,iBAAiB,CAE/F;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAE5F"}
@@ -0,0 +1,140 @@
1
+ import { ColorScheme } from './ColorScheme.js';
2
+ import { LayoutMode } from './LayoutMode.js';
3
+ import { MenuTheme } from './MenuTheme.js';
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * The viewport width, in CSS pixels, below which the shell stops honoring the chosen {@link LayoutMode}
9
+ * and forces the off-canvas one. 991 is the breakpoint the PrimeTek template line uses throughout; the
10
+ * value is exported rather than buried in a media query so the resize listener and the stylesheet cannot
11
+ * disagree about where the boundary is.
12
+ */ const mobileBreakpoint = 991;
13
+ /** The media query the shell watches to know whether it is in the mobile regime. */ const mobileMediaQuery = `(max-width: ${mobileBreakpoint}px)`;
14
+ /**
15
+ * Whether a viewport width falls in the mobile regime. Inclusive of the breakpoint itself, so this and
16
+ * {@link mobileMediaQuery}'s `max-width` agree on the boundary rather than disagreeing by one pixel.
17
+ */ function isMobileWidth(width) {
18
+ return width <= mobileBreakpoint;
19
+ }
20
+ /**
21
+ * The state a shell starts in when nothing has been persisted: the docked sidebar every application
22
+ * template defaults to, on a light scheme, with the theme this package ships as its light one.
23
+ */ function defaultLayoutConfigState() {
24
+ return {
25
+ mode: LayoutMode.Static,
26
+ menuTheme: MenuTheme.Light,
27
+ colorScheme: ColorScheme.Light,
28
+ themeName: 'Scene Default Light',
29
+ isSidebarOpen: true,
30
+ isSidebarAnchored: false,
31
+ isSidebarRevealed: false,
32
+ isMobile: false
33
+ };
34
+ }
35
+ /**
36
+ * The mode the shell actually renders, as opposed to the one the user picked.
37
+ *
38
+ * Below the mobile breakpoint every mode collapses to {@link LayoutMode.Overlay}: a docked 18rem sidebar,
39
+ * an icon rail or a horizontal menu strip are all unusable on a phone, so the template line forces
40
+ * off-canvas there and hides the mode picker. Deriving it rather than overwriting `mode` is what lets the
41
+ * chosen mode come back untouched when the viewport grows again.
42
+ */ function effectiveLayoutMode(state) {
43
+ return state.isMobile ? LayoutMode.Overlay : state.mode;
44
+ }
45
+ /** Whether the mode keeps the sidebar off-canvas until something opens it. */ function isOffCanvasMode(mode) {
46
+ return mode === LayoutMode.Overlay;
47
+ }
48
+ /** Whether the mode is one of the two that react to the pointer - `reveal` slides in, `drawer` grows. */ function isPointerRevealMode(mode) {
49
+ return mode === LayoutMode.Reveal || mode === LayoutMode.Drawer;
50
+ }
51
+ /**
52
+ * Chooses a different mode.
53
+ *
54
+ * Switching also resets the sidebar's transient state, because "open" means something different in each
55
+ * mode: a static sidebar starts docked, every other mode starts closed, and a reveal/drawer panel that
56
+ * was hovered out must not stay out under a mode that has no hover behavior. The pin survives, since it
57
+ * is a preference rather than transient state.
58
+ */ function withMode(state, mode) {
59
+ return {
60
+ ...state,
61
+ mode,
62
+ isSidebarOpen: mode === LayoutMode.Static,
63
+ isSidebarRevealed: false
64
+ };
65
+ }
66
+ /**
67
+ * Records that the viewport crossed the mobile breakpoint.
68
+ *
69
+ * Entering the mobile regime closes the sidebar so the page is not covered on arrival; leaving it
70
+ * restores whatever the chosen mode considers its resting state. Both directions are recomputed rather
71
+ * than remembered, so a mode switch made while mobile still lands correctly on the way back out.
72
+ */ function withMobile(state, isMobile) {
73
+ if (state.isMobile === isMobile) {
74
+ return state;
75
+ }
76
+ return {
77
+ ...state,
78
+ isMobile,
79
+ isSidebarOpen: isMobile ? false : state.mode === LayoutMode.Static,
80
+ isSidebarRevealed: false
81
+ };
82
+ }
83
+ /** Opens or closes the sidebar. */ function withSidebarOpen(state, isSidebarOpen) {
84
+ return {
85
+ ...state,
86
+ isSidebarOpen
87
+ };
88
+ }
89
+ /** Flips the sidebar between open and closed - what the topbar's menu button does in every mode. */ function toggleSidebar(state) {
90
+ return withSidebarOpen(state, !state.isSidebarOpen);
91
+ }
92
+ /**
93
+ * Holds a `reveal`/`drawer` sidebar out, or lets it fall back.
94
+ *
95
+ * An anchored sidebar ignores the pointer entirely - that is the whole point of pinning it - so this is a
96
+ * no-op while {@link LayoutConfigState.isSidebarAnchored} is set rather than something the pointer can
97
+ * fight with.
98
+ */ function withSidebarRevealed(state, isSidebarRevealed) {
99
+ if (state.isSidebarAnchored) {
100
+ return state;
101
+ }
102
+ return {
103
+ ...state,
104
+ isSidebarRevealed
105
+ };
106
+ }
107
+ /**
108
+ * Pins or unpins a `reveal`/`drawer` sidebar. Pinning implies revealed, so the panel does not snap shut
109
+ * the moment the pointer leaves the pin button that just pinned it.
110
+ */ function withSidebarAnchored(state, isSidebarAnchored) {
111
+ return {
112
+ ...state,
113
+ isSidebarAnchored,
114
+ isSidebarRevealed: isSidebarAnchored
115
+ };
116
+ }
117
+ /** Flips the pin - what the sidebar's anchor button does. */ function toggleSidebarAnchor(state) {
118
+ return withSidebarAnchored(state, !state.isSidebarAnchored);
119
+ }
120
+ /** Chooses the light/dark axis. */ function withColorScheme(state, colorScheme) {
121
+ return {
122
+ ...state,
123
+ colorScheme
124
+ };
125
+ }
126
+ /** Chooses how the sidebar surface is tinted. */ function withMenuTheme(state, menuTheme) {
127
+ return {
128
+ ...state,
129
+ menuTheme
130
+ };
131
+ }
132
+ /** Records which {@link Theme} is applied, so a theme switcher reflects the truth after a host-driven change. */ function withThemeName(state, themeName) {
133
+ return {
134
+ ...state,
135
+ themeName
136
+ };
137
+ }
138
+
139
+ export { defaultLayoutConfigState, effectiveLayoutMode, isMobileWidth, isOffCanvasMode, isPointerRevealMode, mobileBreakpoint, mobileMediaQuery, toggleSidebar, toggleSidebarAnchor, withColorScheme, withMenuTheme, withMobile, withMode, withSidebarAnchored, withSidebarOpen, withSidebarRevealed, withThemeName };
140
+ //# sourceMappingURL=layoutConfigTransitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutConfigTransitions.js","sources":["../../../configuration/layoutConfigTransitions.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 { ColorScheme } from './ColorScheme';\nimport { LayoutConfigState } from './LayoutConfigState';\nimport { LayoutMode } from './LayoutMode';\nimport { MenuTheme } from './MenuTheme';\n\n/**\n * The viewport width, in CSS pixels, below which the shell stops honoring the chosen {@link LayoutMode}\n * and forces the off-canvas one. 991 is the breakpoint the PrimeTek template line uses throughout; the\n * value is exported rather than buried in a media query so the resize listener and the stylesheet cannot\n * disagree about where the boundary is.\n */\nexport const mobileBreakpoint = 991;\n\n/** The media query the shell watches to know whether it is in the mobile regime. */\nexport const mobileMediaQuery = `(max-width: ${mobileBreakpoint}px)`;\n\n/**\n * Whether a viewport width falls in the mobile regime. Inclusive of the breakpoint itself, so this and\n * {@link mobileMediaQuery}'s `max-width` agree on the boundary rather than disagreeing by one pixel.\n */\nexport function isMobileWidth(width: number): boolean {\n return width <= mobileBreakpoint;\n}\n\n/**\n * The state a shell starts in when nothing has been persisted: the docked sidebar every application\n * template defaults to, on a light scheme, with the theme this package ships as its light one.\n */\nexport function defaultLayoutConfigState(): LayoutConfigState {\n return {\n mode: LayoutMode.Static,\n menuTheme: MenuTheme.Light,\n colorScheme: ColorScheme.Light,\n themeName: 'Scene Default Light',\n isSidebarOpen: true,\n isSidebarAnchored: false,\n isSidebarRevealed: false,\n isMobile: false,\n };\n}\n\n/**\n * The mode the shell actually renders, as opposed to the one the user picked.\n *\n * Below the mobile breakpoint every mode collapses to {@link LayoutMode.Overlay}: a docked 18rem sidebar,\n * an icon rail or a horizontal menu strip are all unusable on a phone, so the template line forces\n * off-canvas there and hides the mode picker. Deriving it rather than overwriting `mode` is what lets the\n * chosen mode come back untouched when the viewport grows again.\n */\nexport function effectiveLayoutMode(state: LayoutConfigState): LayoutMode {\n return state.isMobile ? LayoutMode.Overlay : state.mode;\n}\n\n/** Whether the mode keeps the sidebar off-canvas until something opens it. */\nexport function isOffCanvasMode(mode: LayoutMode): boolean {\n return mode === LayoutMode.Overlay;\n}\n\n/** Whether the mode is one of the two that react to the pointer - `reveal` slides in, `drawer` grows. */\nexport function isPointerRevealMode(mode: LayoutMode): boolean {\n return mode === LayoutMode.Reveal || mode === LayoutMode.Drawer;\n}\n\n/**\n * Chooses a different mode.\n *\n * Switching also resets the sidebar's transient state, because \"open\" means something different in each\n * mode: a static sidebar starts docked, every other mode starts closed, and a reveal/drawer panel that\n * was hovered out must not stay out under a mode that has no hover behavior. The pin survives, since it\n * is a preference rather than transient state.\n */\nexport function withMode(state: LayoutConfigState, mode: LayoutMode): LayoutConfigState {\n return { ...state, mode, isSidebarOpen: mode === LayoutMode.Static, isSidebarRevealed: false };\n}\n\n/**\n * Records that the viewport crossed the mobile breakpoint.\n *\n * Entering the mobile regime closes the sidebar so the page is not covered on arrival; leaving it\n * restores whatever the chosen mode considers its resting state. Both directions are recomputed rather\n * than remembered, so a mode switch made while mobile still lands correctly on the way back out.\n */\nexport function withMobile(state: LayoutConfigState, isMobile: boolean): LayoutConfigState {\n if (state.isMobile === isMobile) {\n return state;\n }\n\n return {\n ...state,\n isMobile,\n isSidebarOpen: isMobile ? false : state.mode === LayoutMode.Static,\n isSidebarRevealed: false,\n };\n}\n\n/** Opens or closes the sidebar. */\nexport function withSidebarOpen(state: LayoutConfigState, isSidebarOpen: boolean): LayoutConfigState {\n return { ...state, isSidebarOpen };\n}\n\n/** Flips the sidebar between open and closed - what the topbar's menu button does in every mode. */\nexport function toggleSidebar(state: LayoutConfigState): LayoutConfigState {\n return withSidebarOpen(state, !state.isSidebarOpen);\n}\n\n/**\n * Holds a `reveal`/`drawer` sidebar out, or lets it fall back.\n *\n * An anchored sidebar ignores the pointer entirely - that is the whole point of pinning it - so this is a\n * no-op while {@link LayoutConfigState.isSidebarAnchored} is set rather than something the pointer can\n * fight with.\n */\nexport function withSidebarRevealed(state: LayoutConfigState, isSidebarRevealed: boolean): LayoutConfigState {\n if (state.isSidebarAnchored) {\n return state;\n }\n\n return { ...state, isSidebarRevealed };\n}\n\n/**\n * Pins or unpins a `reveal`/`drawer` sidebar. Pinning implies revealed, so the panel does not snap shut\n * the moment the pointer leaves the pin button that just pinned it.\n */\nexport function withSidebarAnchored(state: LayoutConfigState, isSidebarAnchored: boolean): LayoutConfigState {\n return { ...state, isSidebarAnchored, isSidebarRevealed: isSidebarAnchored };\n}\n\n/** Flips the pin - what the sidebar's anchor button does. */\nexport function toggleSidebarAnchor(state: LayoutConfigState): LayoutConfigState {\n return withSidebarAnchored(state, !state.isSidebarAnchored);\n}\n\n/** Chooses the light/dark axis. */\nexport function withColorScheme(state: LayoutConfigState, colorScheme: ColorScheme): LayoutConfigState {\n return { ...state, colorScheme };\n}\n\n/** Chooses how the sidebar surface is tinted. */\nexport function withMenuTheme(state: LayoutConfigState, menuTheme: MenuTheme): LayoutConfigState {\n return { ...state, menuTheme };\n}\n\n/** Records which {@link Theme} is applied, so a theme switcher reflects the truth after a host-driven change. */\nexport function withThemeName(state: LayoutConfigState, themeName: string): LayoutConfigState {\n return { ...state, themeName };\n}\n"],"names":["mobileBreakpoint","mobileMediaQuery","isMobileWidth","width","defaultLayoutConfigState","mode","LayoutMode","Static","menuTheme","MenuTheme","Light","colorScheme","ColorScheme","themeName","isSidebarOpen","isSidebarAnchored","isSidebarRevealed","isMobile","effectiveLayoutMode","state","Overlay","isOffCanvasMode","isPointerRevealMode","Reveal","Drawer","withMode","withMobile","withSidebarOpen","toggleSidebar","withSidebarRevealed","withSidebarAnchored","toggleSidebarAnchor","withColorScheme","withMenuTheme","withThemeName"],"mappings":";;;;AAAA;AACA;AAOA;;;;;IAMO,MAAMA,gBAAAA,GAAmB;AAEhC,qFACO,MAAMC,gBAAAA,GAAmB,CAAC,YAAY,EAAED,gBAAAA,CAAiB,GAAG;AAEnE;;;IAIO,SAASE,aAAAA,CAAcC,KAAa,EAAA;AACvC,IAAA,OAAOA,KAAAA,IAASH,gBAAAA;AACpB;AAEA;;;AAGC,IACM,SAASI,wBAAAA,GAAAA;IACZ,OAAO;AACHC,QAAAA,IAAAA,EAAMC,WAAWC,MAAM;AACvBC,QAAAA,SAAAA,EAAWC,UAAUC,KAAK;AAC1BC,QAAAA,WAAAA,EAAaC,YAAYF,KAAK;QAC9BG,SAAAA,EAAW,qBAAA;QACXC,aAAAA,EAAe,IAAA;QACfC,iBAAAA,EAAmB,KAAA;QACnBC,iBAAAA,EAAmB,KAAA;QACnBC,QAAAA,EAAU;AACd,KAAA;AACJ;AAEA;;;;;;;IAQO,SAASC,mBAAAA,CAAoBC,KAAwB,EAAA;AACxD,IAAA,OAAOA,MAAMF,QAAQ,GAAGX,WAAWc,OAAO,GAAGD,MAAMd,IAAI;AAC3D;AAEA,+EACO,SAASgB,eAAAA,CAAgBhB,IAAgB,EAAA;IAC5C,OAAOA,IAAAA,KAASC,WAAWc,OAAO;AACtC;AAEA,0GACO,SAASE,mBAAAA,CAAoBjB,IAAgB,EAAA;AAChD,IAAA,OAAOA,SAASC,UAAAA,CAAWiB,MAAM,IAAIlB,IAAAA,KAASC,WAAWkB,MAAM;AACnE;AAEA;;;;;;;AAOC,IACM,SAASC,QAAAA,CAASN,KAAwB,EAAEd,IAAgB,EAAA;IAC/D,OAAO;AAAE,QAAA,GAAGc,KAAK;AAAEd,QAAAA,IAAAA;QAAMS,aAAAA,EAAeT,IAAAA,KAASC,WAAWC,MAAM;QAAES,iBAAAA,EAAmB;AAAM,KAAA;AACjG;AAEA;;;;;;AAMC,IACM,SAASU,UAAAA,CAAWP,KAAwB,EAAEF,QAAiB,EAAA;IAClE,IAAIE,KAAAA,CAAMF,QAAQ,KAAKA,QAAAA,EAAU;QAC7B,OAAOE,KAAAA;AACX,IAAA;IAEA,OAAO;AACH,QAAA,GAAGA,KAAK;AACRF,QAAAA,QAAAA;AACAH,QAAAA,aAAAA,EAAeG,WAAW,KAAA,GAAQE,KAAAA,CAAMd,IAAI,KAAKC,WAAWC,MAAM;QAClES,iBAAAA,EAAmB;AACvB,KAAA;AACJ;AAEA,oCACO,SAASW,eAAAA,CAAgBR,KAAwB,EAAEL,aAAsB,EAAA;IAC5E,OAAO;AAAE,QAAA,GAAGK,KAAK;AAAEL,QAAAA;AAAc,KAAA;AACrC;AAEA,qGACO,SAASc,aAAAA,CAAcT,KAAwB,EAAA;AAClD,IAAA,OAAOQ,eAAAA,CAAgBR,KAAAA,EAAO,CAACA,KAAAA,CAAML,aAAa,CAAA;AACtD;AAEA;;;;;;AAMC,IACM,SAASe,mBAAAA,CAAoBV,KAAwB,EAAEH,iBAA0B,EAAA;IACpF,IAAIG,KAAAA,CAAMJ,iBAAiB,EAAE;QACzB,OAAOI,KAAAA;AACX,IAAA;IAEA,OAAO;AAAE,QAAA,GAAGA,KAAK;AAAEH,QAAAA;AAAkB,KAAA;AACzC;AAEA;;;AAGC,IACM,SAASc,mBAAAA,CAAoBX,KAAwB,EAAEJ,iBAA0B,EAAA;IACpF,OAAO;AAAE,QAAA,GAAGI,KAAK;AAAEJ,QAAAA,iBAAAA;QAAmBC,iBAAAA,EAAmBD;AAAkB,KAAA;AAC/E;AAEA,8DACO,SAASgB,mBAAAA,CAAoBZ,KAAwB,EAAA;AACxD,IAAA,OAAOW,mBAAAA,CAAoBX,KAAAA,EAAO,CAACA,KAAAA,CAAMJ,iBAAiB,CAAA;AAC9D;AAEA,oCACO,SAASiB,eAAAA,CAAgBb,KAAwB,EAAER,WAAwB,EAAA;IAC9E,OAAO;AAAE,QAAA,GAAGQ,KAAK;AAAER,QAAAA;AAAY,KAAA;AACnC;AAEA,kDACO,SAASsB,aAAAA,CAAcd,KAAwB,EAAEX,SAAoB,EAAA;IACxE,OAAO;AAAE,QAAA,GAAGW,KAAK;AAAEX,QAAAA;AAAU,KAAA;AACjC;AAEA,kHACO,SAAS0B,aAAAA,CAAcf,KAAwB,EAAEN,SAAiB,EAAA;IACrE,OAAO;AAAE,QAAA,GAAGM,KAAK;AAAEN,QAAAA;AAAU,KAAA;AACjC;;;;"}
@@ -0,0 +1,4 @@
1
+ import { LayoutConfigState } from './LayoutConfigState';
2
+ export declare function layoutWrapperClasses(state: LayoutConfigState): string[];
3
+ export declare function isLayoutMaskVisible(state: LayoutConfigState): boolean;
4
+ //# sourceMappingURL=layoutWrapperClasses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutWrapperClasses.d.ts","sourceRoot":"","sources":["../../../configuration/layoutWrapperClasses.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAqBxD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,EAAE,CAkCvE;AAOD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAErE"}
@@ -0,0 +1,59 @@
1
+ import { LayoutMode } from './LayoutMode.js';
2
+ import { effectiveLayoutMode, isPointerRevealMode } from './layoutConfigTransitions.js';
3
+
4
+ // Copyright (c) Cratis. All rights reserved.
5
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
6
+ /**
7
+ * Turns the shell's state into the wrapper class list its stylesheet keys off - the single seam between
8
+ * the state machine and the CSS.
9
+ *
10
+ * Every class name here is the one the PrimeTek template line already uses (`layout-static`,
11
+ * `layout-overlay-active`, `layout-sidebar-anchored`, `layout-mobile-active`, ...), so a stylesheet
12
+ * written against those templates keeps working and anyone who has themed one can read this shell's DOM
13
+ * without a translation table.
14
+ *
15
+ * The mode class reflects the *effective* mode, so the off-canvas rules a phone needs come from the same
16
+ * `layout-overlay` block a desktop overlay uses instead of a parallel mobile-only ruleset. The chosen mode
17
+ * is still emitted separately as `data-layout-mode`, so a configurator can show what the user picked even
18
+ * while the viewport overrides it.
19
+ *
20
+ * @param state The current shell state.
21
+ * @returns The classes to put on the shell's wrapper element, always starting with `layout-wrapper`.
22
+ */ function layoutWrapperClasses(state) {
23
+ const mode = effectiveLayoutMode(state);
24
+ const classes = [
25
+ 'layout-wrapper',
26
+ `layout-${mode}`,
27
+ `layout-menu-${state.menuTheme}`,
28
+ `layout-color-scheme-${state.colorScheme}`
29
+ ];
30
+ if (mode === LayoutMode.Static && !state.isSidebarOpen) {
31
+ classes.push('layout-static-inactive');
32
+ }
33
+ if (mode === LayoutMode.Overlay && state.isSidebarOpen && !state.isMobile) {
34
+ classes.push('layout-overlay-active');
35
+ }
36
+ if (isPointerRevealMode(mode) && state.isSidebarRevealed) {
37
+ classes.push('layout-sidebar-active');
38
+ }
39
+ if (isPointerRevealMode(mode) && state.isSidebarAnchored) {
40
+ classes.push('layout-sidebar-anchored');
41
+ }
42
+ if (state.isMobile) {
43
+ classes.push('layout-mobile');
44
+ }
45
+ if (state.isMobile && state.isSidebarOpen) {
46
+ classes.push('layout-mobile-active');
47
+ }
48
+ return classes;
49
+ }
50
+ /**
51
+ * Whether the scrim that dims the content behind a floating sidebar should be showing. Overlay and mobile
52
+ * both cover the page, and both need the click-anywhere-to-close the mask provides; a docked or rail
53
+ * sidebar covers nothing and must not dim anything.
54
+ */ function isLayoutMaskVisible(state) {
55
+ return effectiveLayoutMode(state) === LayoutMode.Overlay && state.isSidebarOpen;
56
+ }
57
+
58
+ export { isLayoutMaskVisible, layoutWrapperClasses };
59
+ //# sourceMappingURL=layoutWrapperClasses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutWrapperClasses.js","sources":["../../../configuration/layoutWrapperClasses.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 { LayoutConfigState } from './LayoutConfigState';\nimport { LayoutMode } from './LayoutMode';\nimport { effectiveLayoutMode, isPointerRevealMode } from './layoutConfigTransitions';\n\n/**\n * Turns the shell's state into the wrapper class list its stylesheet keys off - the single seam between\n * the state machine and the CSS.\n *\n * Every class name here is the one the PrimeTek template line already uses (`layout-static`,\n * `layout-overlay-active`, `layout-sidebar-anchored`, `layout-mobile-active`, ...), so a stylesheet\n * written against those templates keeps working and anyone who has themed one can read this shell's DOM\n * without a translation table.\n *\n * The mode class reflects the *effective* mode, so the off-canvas rules a phone needs come from the same\n * `layout-overlay` block a desktop overlay uses instead of a parallel mobile-only ruleset. The chosen mode\n * is still emitted separately as `data-layout-mode`, so a configurator can show what the user picked even\n * while the viewport overrides it.\n *\n * @param state The current shell state.\n * @returns The classes to put on the shell's wrapper element, always starting with `layout-wrapper`.\n */\nexport function layoutWrapperClasses(state: LayoutConfigState): string[] {\n const mode = effectiveLayoutMode(state);\n const classes = [\n 'layout-wrapper',\n `layout-${mode}`,\n `layout-menu-${state.menuTheme}`,\n `layout-color-scheme-${state.colorScheme}`,\n ];\n\n if (mode === LayoutMode.Static && !state.isSidebarOpen) {\n classes.push('layout-static-inactive');\n }\n\n if (mode === LayoutMode.Overlay && state.isSidebarOpen && !state.isMobile) {\n classes.push('layout-overlay-active');\n }\n\n if (isPointerRevealMode(mode) && state.isSidebarRevealed) {\n classes.push('layout-sidebar-active');\n }\n\n if (isPointerRevealMode(mode) && state.isSidebarAnchored) {\n classes.push('layout-sidebar-anchored');\n }\n\n if (state.isMobile) {\n classes.push('layout-mobile');\n }\n\n if (state.isMobile && state.isSidebarOpen) {\n classes.push('layout-mobile-active');\n }\n\n return classes;\n}\n\n/**\n * Whether the scrim that dims the content behind a floating sidebar should be showing. Overlay and mobile\n * both cover the page, and both need the click-anywhere-to-close the mask provides; a docked or rail\n * sidebar covers nothing and must not dim anything.\n */\nexport function isLayoutMaskVisible(state: LayoutConfigState): boolean {\n return effectiveLayoutMode(state) === LayoutMode.Overlay && state.isSidebarOpen;\n}\n"],"names":["layoutWrapperClasses","state","mode","effectiveLayoutMode","classes","menuTheme","colorScheme","LayoutMode","Static","isSidebarOpen","push","Overlay","isMobile","isPointerRevealMode","isSidebarRevealed","isSidebarAnchored","isLayoutMaskVisible"],"mappings":";;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;IAiBO,SAASA,oBAAAA,CAAqBC,KAAwB,EAAA;AACzD,IAAA,MAAMC,OAAOC,mBAAAA,CAAoBF,KAAAA,CAAAA;AACjC,IAAA,MAAMG,OAAAA,GAAU;AACZ,QAAA,gBAAA;QACA,CAAC,OAAO,EAAEF,IAAAA,CAAAA,CAAM;AAChB,QAAA,CAAC,YAAY,EAAED,KAAAA,CAAMI,SAAS,CAAA,CAAE;AAChC,QAAA,CAAC,oBAAoB,EAAEJ,KAAAA,CAAMK,WAAW,CAAA;AAC3C,KAAA;AAED,IAAA,IAAIJ,SAASK,UAAAA,CAAWC,MAAM,IAAI,CAACP,KAAAA,CAAMQ,aAAa,EAAE;AACpDL,QAAAA,OAAAA,CAAQM,IAAI,CAAC,wBAAA,CAAA;AACjB,IAAA;IAEA,IAAIR,IAAAA,KAASK,UAAAA,CAAWI,OAAO,IAAIV,KAAAA,CAAMQ,aAAa,IAAI,CAACR,KAAAA,CAAMW,QAAQ,EAAE;AACvER,QAAAA,OAAAA,CAAQM,IAAI,CAAC,uBAAA,CAAA;AACjB,IAAA;AAEA,IAAA,IAAIG,mBAAAA,CAAoBX,IAAAA,CAAAA,IAASD,KAAAA,CAAMa,iBAAiB,EAAE;AACtDV,QAAAA,OAAAA,CAAQM,IAAI,CAAC,uBAAA,CAAA;AACjB,IAAA;AAEA,IAAA,IAAIG,mBAAAA,CAAoBX,IAAAA,CAAAA,IAASD,KAAAA,CAAMc,iBAAiB,EAAE;AACtDX,QAAAA,OAAAA,CAAQM,IAAI,CAAC,yBAAA,CAAA;AACjB,IAAA;IAEA,IAAIT,KAAAA,CAAMW,QAAQ,EAAE;AAChBR,QAAAA,OAAAA,CAAQM,IAAI,CAAC,eAAA,CAAA;AACjB,IAAA;AAEA,IAAA,IAAIT,KAAAA,CAAMW,QAAQ,IAAIX,KAAAA,CAAMQ,aAAa,EAAE;AACvCL,QAAAA,OAAAA,CAAQM,IAAI,CAAC,sBAAA,CAAA;AACjB,IAAA;IAEA,OAAON,OAAAA;AACX;AAEA;;;;IAKO,SAASY,mBAAAA,CAAoBf,KAAwB,EAAA;AACxD,IAAA,OAAOE,oBAAoBF,KAAAA,CAAAA,KAAWM,UAAAA,CAAWI,OAAO,IAAIV,MAAMQ,aAAa;AACnF;;;;"}
@@ -0,0 +1,5 @@
1
+ import { ScenePackage } from '@cratis/scene.model';
2
+ import { ScenePackageBundle } from '@cratis/scene.react';
3
+ export declare const defaultBlueprintManifest: ScenePackage;
4
+ export declare const defaultBlueprint: ScenePackageBundle;
5
+ //# sourceMappingURL=defaultBlueprint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultBlueprint.d.ts","sourceRoot":"","sources":["../../defaultBlueprint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AA2BzD,eAAO,MAAM,wBAAwB,EAAE,YAatC,CAAC;AAaF,eAAO,MAAM,gBAAgB,EAAE,kBAQ9B,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { PackageKind } from '@cratis/scene.model';
2
+ import { ComponentName } from './ComponentName.js';
3
+ import { defaultBlueprintComponents } from './defaultBlueprintComponents.js';
4
+ import './gallery/elements.js';
5
+ import './gallery/navigation.js';
6
+ import { LayoutName } from './layouts/LayoutName.js';
7
+ import './layouts/shellComponents.js';
8
+ import './layouts/appShell.js';
9
+ import './layouts/fullPage.js';
10
+ import { defaultLayouts } from './layouts/defaultLayouts.js';
11
+ import { defaultBlueprintName } from './packageName.js';
12
+ import { defaultBlueprintThemes } from './themes/defaultBlueprintThemes.js';
13
+ import 'react/jsx-runtime';
14
+ import 'react';
15
+ import '@cratis/scene.react';
16
+ import './gallery/nesting.js';
17
+ import './gallery/workspaceTemplates.js';
18
+ import './gallery/supportTemplates.js';
19
+ import './gallery/authTemplates.js';
20
+ import './gallery/statusTemplates.js';
21
+ import { galleryDialogTemplates } from './gallery/dialogTemplates.js';
22
+ import { galleryScreenTemplates, galleryScreens } from './gallery/screens.js';
23
+ import '@cratis/scene.engine';
24
+ import './gallery/previewProfile.js';
25
+ import './gallery/GalleryScreenPreview.js';
26
+
27
+ // Copyright (c) Cratis. All rights reserved.
28
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
29
+ /**
30
+ * The default blueprint's declaration.
31
+ *
32
+ * A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that
33
+ * are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside
34
+ * them, the components that fill their slots, and the themes that color all of it. Picking the parts
35
+ * separately is how an application ends up with a sidebar from one design language and a form from
36
+ * another.
37
+ *
38
+ * The dependency list is what makes a blueprint honest about what it is built from. This one declares
39
+ * PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and
40
+ * Cratis Components, which its screen templates fill their content with. A profile that activated this
41
+ * blueprint without them would render a shell whose every control was a dashed red placeholder, and
42
+ * `resolvePackageDependencies` exists to catch that when the profile is configured rather than when
43
+ * someone opens the page.
44
+ *
45
+ * `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen
46
+ * template, not a layout, and is listed as one.
47
+ */ const defaultBlueprintManifest = {
48
+ name: defaultBlueprintName,
49
+ version: '1.0.0',
50
+ kind: PackageKind.Blueprint,
51
+ dependencies: [
52
+ {
53
+ name: 'PrimeReact'
54
+ },
55
+ {
56
+ name: 'Cratis.Components'
57
+ }
58
+ ],
59
+ components: Object.values(ComponentName),
60
+ layouts: Object.values(LayoutName),
61
+ screenTemplates: galleryScreenTemplates.map((template)=>template.name),
62
+ dialogTemplates: galleryDialogTemplates.map((template)=>template.name),
63
+ themes: defaultBlueprintThemes.map((theme)=>theme.name),
64
+ displayName: 'Cratis Default Blueprint',
65
+ description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',
66
+ module: '@cratis/scene.blueprint.default'
67
+ };
68
+ /**
69
+ * The default blueprint as a loadable bundle.
70
+ *
71
+ * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and
72
+ * this package's specs run it - a manifest promising a component the bundle never registered renders as a
73
+ * dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.
74
+ *
75
+ * The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the
76
+ * content that fills it, so a preview boots them through the real engine as a working miniature
77
+ * application rather than a set of pictures.
78
+ */ const defaultBlueprint = {
79
+ manifest: defaultBlueprintManifest,
80
+ components: defaultBlueprintComponents,
81
+ layouts: defaultLayouts,
82
+ screenTemplates: galleryScreenTemplates,
83
+ dialogTemplates: galleryDialogTemplates,
84
+ screens: galleryScreens,
85
+ themes: defaultBlueprintThemes
86
+ };
87
+
88
+ export { defaultBlueprint, defaultBlueprintManifest };
89
+ //# sourceMappingURL=defaultBlueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultBlueprint.js","sources":["../../defaultBlueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintComponents } from './defaultBlueprintComponents';\nimport { galleryDialogTemplates, galleryScreenTemplates, galleryScreens } from './gallery';\nimport { LayoutName, defaultLayouts } from './layouts';\nimport { defaultBlueprintName } from './packageName';\nimport { defaultBlueprintThemes } from './themes';\n\n/**\n * The default blueprint's declaration.\n *\n * A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that\n * are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside\n * them, the components that fill their slots, and the themes that color all of it. Picking the parts\n * separately is how an application ends up with a sidebar from one design language and a form from\n * another.\n *\n * The dependency list is what makes a blueprint honest about what it is built from. This one declares\n * PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and\n * Cratis Components, which its screen templates fill their content with. A profile that activated this\n * blueprint without them would render a shell whose every control was a dashed red placeholder, and\n * `resolvePackageDependencies` exists to catch that when the profile is configured rather than when\n * someone opens the page.\n *\n * `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen\n * template, not a layout, and is listed as one.\n */\nexport const defaultBlueprintManifest: ScenePackage = {\n name: defaultBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'PrimeReact' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: Object.values(LayoutName),\n screenTemplates: galleryScreenTemplates.map(template => template.name),\n dialogTemplates: galleryDialogTemplates.map(template => template.name),\n themes: defaultBlueprintThemes.map(theme => theme.name),\n displayName: 'Cratis Default Blueprint',\n description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',\n module: '@cratis/scene.blueprint.default',\n};\n\n/**\n * The default blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a component the bundle never registered renders as a\n * dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.\n *\n * The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the\n * content that fills it, so a preview boots them through the real engine as a working miniature\n * application rather than a set of pictures.\n */\nexport const defaultBlueprint: ScenePackageBundle = {\n manifest: defaultBlueprintManifest,\n components: defaultBlueprintComponents,\n layouts: defaultLayouts,\n screenTemplates: galleryScreenTemplates,\n dialogTemplates: galleryDialogTemplates,\n screens: galleryScreens,\n themes: defaultBlueprintThemes,\n};\n"],"names":["defaultBlueprintManifest","name","defaultBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","LayoutName","screenTemplates","galleryScreenTemplates","map","template","dialogTemplates","galleryDialogTemplates","themes","defaultBlueprintThemes","theme","displayName","description","module","defaultBlueprint","manifest","defaultBlueprintComponents","defaultLayouts","screens","galleryScreens"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAWA;;;;;;;;;;;;;;;;;;UAmBaA,wBAAAA,GAAyC;IAClDC,IAAAA,EAAMC,oBAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,YAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAAa,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACrEO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,aAAAA,CAAAA;IAC1BC,OAAAA,EAASH,MAAAA,CAAOC,MAAM,CAACG,UAAAA,CAAAA;AACvBC,IAAAA,eAAAA,EAAiBC,uBAAuBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEiB,IAAAA,eAAAA,EAAiBC,uBAAuBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEmB,IAAAA,MAAAA,EAAQC,uBAAuBL,GAAG,CAACM,CAAAA,KAAAA,GAASA,MAAMrB,IAAI,CAAA;IACtDsB,WAAAA,EAAa,0BAAA;IACbC,WAAAA,EAAa,4HAAA;IACbC,MAAAA,EAAQ;AACZ;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU3B,wBAAAA;IACVQ,UAAAA,EAAYoB,0BAAAA;IACZhB,OAAAA,EAASiB,cAAAA;IACTf,eAAAA,EAAiBC,sBAAAA;IACjBG,eAAAA,EAAiBC,sBAAAA;IACjBW,OAAAA,EAASC,cAAAA;IACTX,MAAAA,EAAQC;AACZ;;;;"}
@@ -0,0 +1,3 @@
1
+ import { ComponentRegistry } from '@cratis/scene.react';
2
+ export declare const defaultBlueprintComponents: ComponentRegistry;
3
+ //# sourceMappingURL=defaultBlueprintComponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultBlueprintComponents.d.ts","sourceRoot":"","sources":["../../defaultBlueprintComponents.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AA8B9E,eAAO,MAAM,0BAA0B,EAAE,iBAiBxC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { componentRegistryKey } from '@cratis/scene.react';
2
+ import { ComponentName } from './ComponentName.js';
3
+ import { defaultBlueprintName } from './packageName.js';
4
+ import 'react/jsx-runtime';
5
+ import 'react';
6
+ import { AppShell } from './shell/AppShell.js';
7
+ import { FullPageShell } from './shell/FullPageShell.js';
8
+ import { Topbar } from './shell/Topbar.js';
9
+ import { Sidebar } from './shell/Sidebar.js';
10
+ import { Menu } from './shell/Menu.js';
11
+ import { MenuItem } from './shell/MenuItem.js';
12
+ import { Breadcrumb } from './shell/Breadcrumb.js';
13
+ import { Footer } from './shell/Footer.js';
14
+ import { RightPanel } from './shell/RightPanel.js';
15
+ import { ConfigPanel } from './shell/ConfigPanel.js';
16
+ import { PageHeader } from './shell/PageHeader.js';
17
+ import { Mask } from './shell/Mask.js';
18
+ import { Logo } from './shell/Logo.js';
19
+ import { UserMenu } from './shell/UserMenu.js';
20
+ import { ThemeSwitcher } from './shell/ThemeSwitcher.js';
21
+ import { LayoutModeSwitcher } from './shell/LayoutModeSwitcher.js';
22
+
23
+ // Copyright (c) Cratis. All rights reserved.
24
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
25
+ /**
26
+ * The components this package registers, keyed the way the renderer looks them up.
27
+ *
28
+ * Every key is built with `componentRegistryKey` rather than written out, because the separator between
29
+ * package and component name is the registry's own business - it is deliberately not the `.` a screen uses
30
+ * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is
31
+ * how a component ends up registered under something no lookup will ever produce.
32
+ */ const defaultBlueprintComponents = {
33
+ [componentRegistryKey(defaultBlueprintName, ComponentName.AppShell)]: AppShell,
34
+ [componentRegistryKey(defaultBlueprintName, ComponentName.FullPageShell)]: FullPageShell,
35
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Topbar)]: Topbar,
36
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Sidebar)]: Sidebar,
37
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Menu)]: Menu,
38
+ [componentRegistryKey(defaultBlueprintName, ComponentName.MenuItem)]: MenuItem,
39
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Breadcrumb)]: Breadcrumb,
40
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Footer)]: Footer,
41
+ [componentRegistryKey(defaultBlueprintName, ComponentName.RightPanel)]: RightPanel,
42
+ [componentRegistryKey(defaultBlueprintName, ComponentName.ConfigPanel)]: ConfigPanel,
43
+ [componentRegistryKey(defaultBlueprintName, ComponentName.PageHeader)]: PageHeader,
44
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Mask)]: Mask,
45
+ [componentRegistryKey(defaultBlueprintName, ComponentName.Logo)]: Logo,
46
+ [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,
47
+ [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,
48
+ [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher
49
+ };
50
+
51
+ export { defaultBlueprintComponents };
52
+ //# sourceMappingURL=defaultBlueprintComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultBlueprintComponents.js","sources":["../../defaultBlueprintComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { defaultBlueprintName } from './packageName';\nimport {\n AppShell,\n Breadcrumb,\n ConfigPanel,\n Footer,\n FullPageShell,\n LayoutModeSwitcher,\n Logo,\n Mask,\n Menu,\n MenuItem,\n PageHeader,\n RightPanel,\n Sidebar,\n ThemeSwitcher,\n Topbar,\n UserMenu,\n} from './shell';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n */\nexport const defaultBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(defaultBlueprintName, ComponentName.AppShell)]: AppShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.FullPageShell)]: FullPageShell,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Topbar)]: Topbar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Sidebar)]: Sidebar,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Menu)]: Menu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.MenuItem)]: MenuItem,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Breadcrumb)]: Breadcrumb,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Footer)]: Footer,\n [componentRegistryKey(defaultBlueprintName, ComponentName.RightPanel)]: RightPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ConfigPanel)]: ConfigPanel,\n [componentRegistryKey(defaultBlueprintName, ComponentName.PageHeader)]: PageHeader,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Mask)]: Mask,\n [componentRegistryKey(defaultBlueprintName, ComponentName.Logo)]: Logo,\n [componentRegistryKey(defaultBlueprintName, ComponentName.UserMenu)]: UserMenu,\n [componentRegistryKey(defaultBlueprintName, ComponentName.ThemeSwitcher)]: ThemeSwitcher,\n [componentRegistryKey(defaultBlueprintName, ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher,\n};\n"],"names":["defaultBlueprintComponents","componentRegistryKey","defaultBlueprintName","ComponentName","AppShell","FullPageShell","Topbar","Sidebar","Menu","MenuItem","Breadcrumb","Footer","RightPanel","ConfigPanel","PageHeader","Mask","Logo","UserMenu","ThemeSwitcher","LayoutModeSwitcher"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAwBA;;;;;;;UAQaA,0BAAAA,GAAgD;AACzD,IAAA,CAACC,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcC,QAAQ,IAAIA,QAAAA;AACtE,IAAA,CAACH,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcE,aAAa,IAAIA,aAAAA;AAC3E,IAAA,CAACJ,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcG,MAAM,IAAIA,MAAAA;AACpE,IAAA,CAACL,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcI,OAAO,IAAIA,OAAAA;AACrE,IAAA,CAACN,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcK,IAAI,IAAIA,IAAAA;AAClE,IAAA,CAACP,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcM,QAAQ,IAAIA,QAAAA;AACtE,IAAA,CAACR,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcO,UAAU,IAAIA,UAAAA;AACxE,IAAA,CAACT,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcQ,MAAM,IAAIA,MAAAA;AACpE,IAAA,CAACV,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcS,UAAU,IAAIA,UAAAA;AACxE,IAAA,CAACX,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcU,WAAW,IAAIA,WAAAA;AACzE,IAAA,CAACZ,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcW,UAAU,IAAIA,UAAAA;AACxE,IAAA,CAACb,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcY,IAAI,IAAIA,IAAAA;AAClE,IAAA,CAACd,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAca,IAAI,IAAIA,IAAAA;AAClE,IAAA,CAACf,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcc,QAAQ,IAAIA,QAAAA;AACtE,IAAA,CAAChB,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAce,aAAa,IAAIA,aAAAA;AAC3E,IAAA,CAACjB,oBAAAA,CAAqBC,oBAAAA,EAAsBC,aAAAA,CAAcgB,kBAAkB,IAAIA;AACpF;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=when_rendering_a_gallery_screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when_rendering_a_gallery_screen.d.ts","sourceRoot":"","sources":["../../../for_AppShell/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":""}