@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.
- package/.storybook/main.ts +32 -0
- package/.storybook/preview.ts +20 -0
- package/ComponentName.ts +60 -0
- package/README.md +204 -0
- package/configuration/ColorScheme.ts +17 -0
- package/configuration/LayoutConfigProvider.tsx +182 -0
- package/configuration/LayoutConfigState.ts +46 -0
- package/configuration/LayoutMode.ts +50 -0
- package/configuration/MenuTheme.ts +24 -0
- package/configuration/index.ts +11 -0
- package/configuration/layoutConfigStorage.ts +102 -0
- package/configuration/layoutConfigTransitions.ts +150 -0
- package/configuration/layoutWrapperClasses.ts +68 -0
- package/defaultBlueprint.ts +66 -0
- package/defaultBlueprintComponents.ts +51 -0
- package/dist/cjs/ComponentName.js +33 -0
- package/dist/cjs/ComponentName.js.map +1 -0
- package/dist/cjs/configuration/ColorScheme.js +23 -0
- package/dist/cjs/configuration/ColorScheme.js.map +1 -0
- package/dist/cjs/configuration/LayoutConfigProvider.js +96 -0
- package/dist/cjs/configuration/LayoutConfigProvider.js.map +1 -0
- package/dist/cjs/configuration/LayoutMode.js +38 -0
- package/dist/cjs/configuration/LayoutMode.js.map +1 -0
- package/dist/cjs/configuration/MenuTheme.js +26 -0
- package/dist/cjs/configuration/MenuTheme.js.map +1 -0
- package/dist/cjs/configuration/layoutConfigStorage.js +85 -0
- package/dist/cjs/configuration/layoutConfigStorage.js.map +1 -0
- package/dist/cjs/configuration/layoutConfigTransitions.js +158 -0
- package/dist/cjs/configuration/layoutConfigTransitions.js.map +1 -0
- package/dist/cjs/configuration/layoutWrapperClasses.js +62 -0
- package/dist/cjs/configuration/layoutWrapperClasses.js.map +1 -0
- package/dist/cjs/defaultBlueprint.js +92 -0
- package/dist/cjs/defaultBlueprint.js.map +1 -0
- package/dist/cjs/defaultBlueprintComponents.js +54 -0
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js +63 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/cjs/gallery/TemplateSlotName.js +25 -0
- package/dist/cjs/gallery/TemplateSlotName.js.map +1 -0
- package/dist/cjs/gallery/applicationChrome.js +134 -0
- package/dist/cjs/gallery/applicationChrome.js.map +1 -0
- package/dist/cjs/gallery/authTemplates.js +234 -0
- package/dist/cjs/gallery/authTemplates.js.map +1 -0
- package/dist/cjs/gallery/componentNames.js +53 -0
- package/dist/cjs/gallery/componentNames.js.map +1 -0
- package/dist/cjs/gallery/composeScreen.js +99 -0
- package/dist/cjs/gallery/composeScreen.js.map +1 -0
- package/dist/cjs/gallery/dependencyComponentNames.js +72 -0
- package/dist/cjs/gallery/dependencyComponentNames.js.map +1 -0
- package/dist/cjs/gallery/dialogTemplates.js +161 -0
- package/dist/cjs/gallery/dialogTemplates.js.map +1 -0
- package/dist/cjs/gallery/elements.js +80 -0
- package/dist/cjs/gallery/elements.js.map +1 -0
- package/dist/cjs/gallery/navigation.js +129 -0
- package/dist/cjs/gallery/navigation.js.map +1 -0
- package/dist/cjs/gallery/nesting.js +129 -0
- package/dist/cjs/gallery/nesting.js.map +1 -0
- package/dist/cjs/gallery/previewProfile.js +68 -0
- package/dist/cjs/gallery/previewProfile.js.map +1 -0
- package/dist/cjs/gallery/resolveElementNames.js +63 -0
- package/dist/cjs/gallery/resolveElementNames.js.map +1 -0
- package/dist/cjs/gallery/screens.js +222 -0
- package/dist/cjs/gallery/screens.js.map +1 -0
- package/dist/cjs/gallery/statusTemplates.js +190 -0
- package/dist/cjs/gallery/statusTemplates.js.map +1 -0
- package/dist/cjs/gallery/supportTemplates.js +319 -0
- package/dist/cjs/gallery/supportTemplates.js.map +1 -0
- package/dist/cjs/gallery/widgets.js +94 -0
- package/dist/cjs/gallery/widgets.js.map +1 -0
- package/dist/cjs/gallery/workspaceTemplates.js +395 -0
- package/dist/cjs/gallery/workspaceTemplates.js.map +1 -0
- package/dist/cjs/index.js +220 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/layouts/LayoutName.js +19 -0
- package/dist/cjs/layouts/LayoutName.js.map +1 -0
- package/dist/cjs/layouts/SlotName.js +31 -0
- package/dist/cjs/layouts/SlotName.js.map +1 -0
- package/dist/cjs/layouts/appShell.js +160 -0
- package/dist/cjs/layouts/appShell.js.map +1 -0
- package/dist/cjs/layouts/defaultLayouts.js +20 -0
- package/dist/cjs/layouts/defaultLayouts.js.map +1 -0
- package/dist/cjs/layouts/flowBuilders.js +66 -0
- package/dist/cjs/layouts/flowBuilders.js.map +1 -0
- package/dist/cjs/layouts/fullPage.js +78 -0
- package/dist/cjs/layouts/fullPage.js.map +1 -0
- package/dist/cjs/layouts/shellComponents.js +29 -0
- package/dist/cjs/layouts/shellComponents.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/packageName.js +15 -0
- package/dist/cjs/packageName.js.map +1 -0
- package/dist/cjs/shell/AppShell.js +88 -0
- package/dist/cjs/shell/AppShell.js.map +1 -0
- package/dist/cjs/shell/Breadcrumb.js +33 -0
- package/dist/cjs/shell/Breadcrumb.js.map +1 -0
- package/dist/cjs/shell/ConfigPanel.js +128 -0
- package/dist/cjs/shell/ConfigPanel.js.map +1 -0
- package/dist/cjs/shell/Footer.js +28 -0
- package/dist/cjs/shell/Footer.js.map +1 -0
- package/dist/cjs/shell/FullPageShell.js +53 -0
- package/dist/cjs/shell/FullPageShell.js.map +1 -0
- package/dist/cjs/shell/LayoutModeSwitcher.js +58 -0
- package/dist/cjs/shell/LayoutModeSwitcher.js.map +1 -0
- package/dist/cjs/shell/Logo.js +44 -0
- package/dist/cjs/shell/Logo.js.map +1 -0
- package/dist/cjs/shell/Mask.js +34 -0
- package/dist/cjs/shell/Mask.js.map +1 -0
- package/dist/cjs/shell/Menu.js +36 -0
- package/dist/cjs/shell/Menu.js.map +1 -0
- package/dist/cjs/shell/MenuItem.js +65 -0
- package/dist/cjs/shell/MenuItem.js.map +1 -0
- package/dist/cjs/shell/PageHeader.js +43 -0
- package/dist/cjs/shell/PageHeader.js.map +1 -0
- package/dist/cjs/shell/RightPanel.js +30 -0
- package/dist/cjs/shell/RightPanel.js.map +1 -0
- package/dist/cjs/shell/Sidebar.js +51 -0
- package/dist/cjs/shell/Sidebar.js.map +1 -0
- package/dist/cjs/shell/ThemeOption.js +42 -0
- package/dist/cjs/shell/ThemeOption.js.map +1 -0
- package/dist/cjs/shell/ThemeSwitcher.js +50 -0
- package/dist/cjs/shell/ThemeSwitcher.js.map +1 -0
- package/dist/cjs/shell/Topbar.js +54 -0
- package/dist/cjs/shell/Topbar.js.map +1 -0
- package/dist/cjs/shell/UserMenu.js +68 -0
- package/dist/cjs/shell/UserMenu.js.map +1 -0
- package/dist/cjs/shell/elementProperties.js +56 -0
- package/dist/cjs/shell/elementProperties.js.map +1 -0
- package/dist/cjs/themes/LayoutThemeProvider.js +33 -0
- package/dist/cjs/themes/LayoutThemeProvider.js.map +1 -0
- package/dist/cjs/themes/blueprintThemeCompatibility.js +28 -0
- package/dist/cjs/themes/blueprintThemeCompatibility.js.map +1 -0
- package/dist/cjs/themes/dark.js +40 -0
- package/dist/cjs/themes/dark.js.map +1 -0
- package/dist/cjs/themes/defaultBlueprintThemes.js +19 -0
- package/dist/cjs/themes/defaultBlueprintThemes.js.map +1 -0
- package/dist/cjs/themes/light.js +43 -0
- package/dist/cjs/themes/light.js.map +1 -0
- package/dist/esm/ComponentName.d.ts +19 -0
- package/dist/esm/ComponentName.d.ts.map +1 -0
- package/dist/esm/ComponentName.js +31 -0
- package/dist/esm/ComponentName.js.map +1 -0
- package/dist/esm/configuration/ColorScheme.d.ts +6 -0
- package/dist/esm/configuration/ColorScheme.d.ts.map +1 -0
- package/dist/esm/configuration/ColorScheme.js +20 -0
- package/dist/esm/configuration/ColorScheme.js.map +1 -0
- package/dist/esm/configuration/LayoutConfigProvider.d.ts +29 -0
- package/dist/esm/configuration/LayoutConfigProvider.d.ts.map +1 -0
- package/dist/esm/configuration/LayoutConfigProvider.js +92 -0
- package/dist/esm/configuration/LayoutConfigProvider.js.map +1 -0
- package/dist/esm/configuration/LayoutConfigState.d.ts +14 -0
- package/dist/esm/configuration/LayoutConfigState.d.ts.map +1 -0
- package/dist/esm/configuration/LayoutConfigState.js +2 -0
- package/dist/esm/configuration/LayoutConfigState.js.map +1 -0
- package/dist/esm/configuration/LayoutMode.d.ts +12 -0
- package/dist/esm/configuration/LayoutMode.d.ts.map +1 -0
- package/dist/esm/configuration/LayoutMode.js +35 -0
- package/dist/esm/configuration/LayoutMode.js.map +1 -0
- package/dist/esm/configuration/MenuTheme.d.ts +7 -0
- package/dist/esm/configuration/MenuTheme.d.ts.map +1 -0
- package/dist/esm/configuration/MenuTheme.js +23 -0
- package/dist/esm/configuration/MenuTheme.js.map +1 -0
- package/dist/esm/configuration/index.d.ts +9 -0
- package/dist/esm/configuration/index.d.ts.map +1 -0
- package/dist/esm/configuration/index.js +9 -0
- package/dist/esm/configuration/index.js.map +1 -0
- package/dist/esm/configuration/layoutConfigStorage.d.ts +6 -0
- package/dist/esm/configuration/layoutConfigStorage.d.ts.map +1 -0
- package/dist/esm/configuration/layoutConfigStorage.js +81 -0
- package/dist/esm/configuration/layoutConfigStorage.js.map +1 -0
- package/dist/esm/configuration/layoutConfigTransitions.d.ts +22 -0
- package/dist/esm/configuration/layoutConfigTransitions.d.ts.map +1 -0
- package/dist/esm/configuration/layoutConfigTransitions.js +140 -0
- package/dist/esm/configuration/layoutConfigTransitions.js.map +1 -0
- package/dist/esm/configuration/layoutWrapperClasses.d.ts +4 -0
- package/dist/esm/configuration/layoutWrapperClasses.d.ts.map +1 -0
- package/dist/esm/configuration/layoutWrapperClasses.js +59 -0
- package/dist/esm/configuration/layoutWrapperClasses.js.map +1 -0
- package/dist/esm/defaultBlueprint.d.ts +5 -0
- package/dist/esm/defaultBlueprint.d.ts.map +1 -0
- package/dist/esm/defaultBlueprint.js +89 -0
- package/dist/esm/defaultBlueprint.js.map +1 -0
- package/dist/esm/defaultBlueprintComponents.d.ts +3 -0
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -0
- package/dist/esm/defaultBlueprintComponents.js +52 -0
- package/dist/esm/defaultBlueprintComponents.js.map +1 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts +2 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts.map +1 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +60 -0
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +1 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts +2 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts.map +1 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js +60 -0
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js.map +1 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js +26 -0
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts +2 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts.map +1 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js +32 -0
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js.map +1 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts +2 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts.map +1 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js +40 -0
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js.map +1 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +2 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +1 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js +27 -0
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +2 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +41 -0
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts +2 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts.map +1 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js +31 -0
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js.map +1 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +2 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +1 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js +33 -0
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +1 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts +2 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map +1 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js +44 -0
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js.map +1 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts +2 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts.map +1 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js +60 -0
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts +2 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js +28 -0
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts +2 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map +1 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js +38 -0
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js.map +1 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts +2 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts.map +1 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js +39 -0
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js.map +1 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts +2 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts.map +1 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js +37 -0
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js.map +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts +31 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.js +29 -0
- package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -0
- package/dist/esm/gallery/FullPageScreens.stories.d.ts +28 -0
- package/dist/esm/gallery/FullPageScreens.stories.d.ts.map +1 -0
- package/dist/esm/gallery/FullPageScreens.stories.js +26 -0
- package/dist/esm/gallery/FullPageScreens.stories.js.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +12 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.js +60 -0
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -0
- package/dist/esm/gallery/NavigationEntry.d.ts +8 -0
- package/dist/esm/gallery/NavigationEntry.d.ts.map +1 -0
- package/dist/esm/gallery/NavigationEntry.js +2 -0
- package/dist/esm/gallery/NavigationEntry.js.map +1 -0
- package/dist/esm/gallery/TemplateSlotName.d.ts +11 -0
- package/dist/esm/gallery/TemplateSlotName.d.ts.map +1 -0
- package/dist/esm/gallery/TemplateSlotName.js +23 -0
- package/dist/esm/gallery/TemplateSlotName.js.map +1 -0
- package/dist/esm/gallery/applicationChrome.d.ts +8 -0
- package/dist/esm/gallery/applicationChrome.d.ts.map +1 -0
- package/dist/esm/gallery/applicationChrome.js +131 -0
- package/dist/esm/gallery/applicationChrome.js.map +1 -0
- package/dist/esm/gallery/authTemplates.d.ts +9 -0
- package/dist/esm/gallery/authTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/authTemplates.js +226 -0
- package/dist/esm/gallery/authTemplates.js.map +1 -0
- package/dist/esm/gallery/componentNames.d.ts +4 -0
- package/dist/esm/gallery/componentNames.d.ts.map +1 -0
- package/dist/esm/gallery/componentNames.js +50 -0
- package/dist/esm/gallery/componentNames.js.map +1 -0
- package/dist/esm/gallery/composeScreen.d.ts +5 -0
- package/dist/esm/gallery/composeScreen.d.ts.map +1 -0
- package/dist/esm/gallery/composeScreen.js +95 -0
- package/dist/esm/gallery/composeScreen.js.map +1 -0
- package/dist/esm/gallery/dependencyComponentNames.d.ts +4 -0
- package/dist/esm/gallery/dependencyComponentNames.d.ts.map +1 -0
- package/dist/esm/gallery/dependencyComponentNames.js +68 -0
- package/dist/esm/gallery/dependencyComponentNames.js.map +1 -0
- package/dist/esm/gallery/dialogTemplates.d.ts +6 -0
- package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/dialogTemplates.js +156 -0
- package/dist/esm/gallery/dialogTemplates.js.map +1 -0
- package/dist/esm/gallery/elements.d.ts +7 -0
- package/dist/esm/gallery/elements.d.ts.map +1 -0
- package/dist/esm/gallery/elements.js +74 -0
- package/dist/esm/gallery/elements.js.map +1 -0
- package/dist/esm/gallery/index.d.ts +20 -0
- package/dist/esm/gallery/index.d.ts.map +1 -0
- package/dist/esm/gallery/index.js +20 -0
- package/dist/esm/gallery/index.js.map +1 -0
- package/dist/esm/gallery/navigation.d.ts +9 -0
- package/dist/esm/gallery/navigation.d.ts.map +1 -0
- package/dist/esm/gallery/navigation.js +122 -0
- package/dist/esm/gallery/navigation.js.map +1 -0
- package/dist/esm/gallery/nesting.d.ts +6 -0
- package/dist/esm/gallery/nesting.d.ts.map +1 -0
- package/dist/esm/gallery/nesting.js +124 -0
- package/dist/esm/gallery/nesting.js.map +1 -0
- package/dist/esm/gallery/previewProfile.d.ts +6 -0
- package/dist/esm/gallery/previewProfile.d.ts.map +1 -0
- package/dist/esm/gallery/previewProfile.js +64 -0
- package/dist/esm/gallery/previewProfile.js.map +1 -0
- package/dist/esm/gallery/resolveElementNames.d.ts +4 -0
- package/dist/esm/gallery/resolveElementNames.d.ts.map +1 -0
- package/dist/esm/gallery/resolveElementNames.js +61 -0
- package/dist/esm/gallery/resolveElementNames.js.map +1 -0
- package/dist/esm/gallery/screens.d.ts +5 -0
- package/dist/esm/gallery/screens.d.ts.map +1 -0
- package/dist/esm/gallery/screens.js +218 -0
- package/dist/esm/gallery/screens.js.map +1 -0
- package/dist/esm/gallery/statusTemplates.d.ts +7 -0
- package/dist/esm/gallery/statusTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/statusTemplates.js +184 -0
- package/dist/esm/gallery/statusTemplates.js.map +1 -0
- package/dist/esm/gallery/supportTemplates.d.ts +8 -0
- package/dist/esm/gallery/supportTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/supportTemplates.js +312 -0
- package/dist/esm/gallery/supportTemplates.js.map +1 -0
- package/dist/esm/gallery/widgets.d.ts +12 -0
- package/dist/esm/gallery/widgets.d.ts.map +1 -0
- package/dist/esm/gallery/widgets.js +86 -0
- package/dist/esm/gallery/widgets.js.map +1 -0
- package/dist/esm/gallery/workspaceTemplates.d.ts +8 -0
- package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -0
- package/dist/esm/gallery/workspaceTemplates.js +388 -0
- package/dist/esm/gallery/workspaceTemplates.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +60 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/layouts/LayoutName.d.ts +5 -0
- package/dist/esm/layouts/LayoutName.d.ts.map +1 -0
- package/dist/esm/layouts/LayoutName.js +17 -0
- package/dist/esm/layouts/LayoutName.js.map +1 -0
- package/dist/esm/layouts/SlotName.d.ts +12 -0
- package/dist/esm/layouts/SlotName.d.ts.map +1 -0
- package/dist/esm/layouts/SlotName.js +29 -0
- package/dist/esm/layouts/SlotName.js.map +1 -0
- package/dist/esm/layouts/appShell.d.ts +8 -0
- package/dist/esm/layouts/appShell.d.ts.map +1 -0
- package/dist/esm/layouts/appShell.js +153 -0
- package/dist/esm/layouts/appShell.js.map +1 -0
- package/dist/esm/layouts/defaultLayouts.d.ts +3 -0
- package/dist/esm/layouts/defaultLayouts.d.ts.map +1 -0
- package/dist/esm/layouts/defaultLayouts.js +18 -0
- package/dist/esm/layouts/defaultLayouts.js.map +1 -0
- package/dist/esm/layouts/flowBuilders.d.ts +6 -0
- package/dist/esm/layouts/flowBuilders.d.ts.map +1 -0
- package/dist/esm/layouts/flowBuilders.js +61 -0
- package/dist/esm/layouts/flowBuilders.js.map +1 -0
- package/dist/esm/layouts/fullPage.d.ts +6 -0
- package/dist/esm/layouts/fullPage.d.ts.map +1 -0
- package/dist/esm/layouts/fullPage.js +73 -0
- package/dist/esm/layouts/fullPage.js.map +1 -0
- package/dist/esm/layouts/index.d.ts +8 -0
- package/dist/esm/layouts/index.d.ts.map +1 -0
- package/dist/esm/layouts/index.js +8 -0
- package/dist/esm/layouts/index.js.map +1 -0
- package/dist/esm/layouts/shellComponents.d.ts +3 -0
- package/dist/esm/layouts/shellComponents.d.ts.map +1 -0
- package/dist/esm/layouts/shellComponents.js +27 -0
- package/dist/esm/layouts/shellComponents.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/packageName.d.ts +2 -0
- package/dist/esm/packageName.d.ts.map +1 -0
- package/dist/esm/packageName.js +13 -0
- package/dist/esm/packageName.js.map +1 -0
- package/dist/esm/shell/AppShell.d.ts +3 -0
- package/dist/esm/shell/AppShell.d.ts.map +1 -0
- package/dist/esm/shell/AppShell.js +86 -0
- package/dist/esm/shell/AppShell.js.map +1 -0
- package/dist/esm/shell/Breadcrumb.d.ts +3 -0
- package/dist/esm/shell/Breadcrumb.d.ts.map +1 -0
- package/dist/esm/shell/Breadcrumb.js +31 -0
- package/dist/esm/shell/Breadcrumb.js.map +1 -0
- package/dist/esm/shell/ConfigPanel.d.ts +3 -0
- package/dist/esm/shell/ConfigPanel.d.ts.map +1 -0
- package/dist/esm/shell/ConfigPanel.js +126 -0
- package/dist/esm/shell/ConfigPanel.js.map +1 -0
- package/dist/esm/shell/Footer.d.ts +3 -0
- package/dist/esm/shell/Footer.d.ts.map +1 -0
- package/dist/esm/shell/Footer.js +26 -0
- package/dist/esm/shell/Footer.js.map +1 -0
- package/dist/esm/shell/FullPageShell.d.ts +3 -0
- package/dist/esm/shell/FullPageShell.d.ts.map +1 -0
- package/dist/esm/shell/FullPageShell.js +51 -0
- package/dist/esm/shell/FullPageShell.js.map +1 -0
- package/dist/esm/shell/LayoutModeSwitcher.d.ts +3 -0
- package/dist/esm/shell/LayoutModeSwitcher.d.ts.map +1 -0
- package/dist/esm/shell/LayoutModeSwitcher.js +56 -0
- package/dist/esm/shell/LayoutModeSwitcher.js.map +1 -0
- package/dist/esm/shell/LayoutModes.stories.d.ts +29 -0
- package/dist/esm/shell/LayoutModes.stories.d.ts.map +1 -0
- package/dist/esm/shell/LayoutModes.stories.js +43 -0
- package/dist/esm/shell/LayoutModes.stories.js.map +1 -0
- package/dist/esm/shell/Logo.d.ts +3 -0
- package/dist/esm/shell/Logo.d.ts.map +1 -0
- package/dist/esm/shell/Logo.js +42 -0
- package/dist/esm/shell/Logo.js.map +1 -0
- package/dist/esm/shell/Mask.d.ts +3 -0
- package/dist/esm/shell/Mask.d.ts.map +1 -0
- package/dist/esm/shell/Mask.js +31 -0
- package/dist/esm/shell/Mask.js.map +1 -0
- package/dist/esm/shell/Menu.d.ts +3 -0
- package/dist/esm/shell/Menu.d.ts.map +1 -0
- package/dist/esm/shell/Menu.js +34 -0
- package/dist/esm/shell/Menu.js.map +1 -0
- package/dist/esm/shell/MenuItem.d.ts +3 -0
- package/dist/esm/shell/MenuItem.d.ts.map +1 -0
- package/dist/esm/shell/MenuItem.js +63 -0
- package/dist/esm/shell/MenuItem.js.map +1 -0
- package/dist/esm/shell/PageHeader.d.ts +3 -0
- package/dist/esm/shell/PageHeader.d.ts.map +1 -0
- package/dist/esm/shell/PageHeader.js +41 -0
- package/dist/esm/shell/PageHeader.js.map +1 -0
- package/dist/esm/shell/RightPanel.d.ts +3 -0
- package/dist/esm/shell/RightPanel.d.ts.map +1 -0
- package/dist/esm/shell/RightPanel.js +28 -0
- package/dist/esm/shell/RightPanel.js.map +1 -0
- package/dist/esm/shell/Sidebar.d.ts +3 -0
- package/dist/esm/shell/Sidebar.d.ts.map +1 -0
- package/dist/esm/shell/Sidebar.js +49 -0
- package/dist/esm/shell/Sidebar.js.map +1 -0
- package/dist/esm/shell/ThemeOption.d.ts +10 -0
- package/dist/esm/shell/ThemeOption.d.ts.map +1 -0
- package/dist/esm/shell/ThemeOption.js +39 -0
- package/dist/esm/shell/ThemeOption.js.map +1 -0
- package/dist/esm/shell/ThemeSwitcher.d.ts +3 -0
- package/dist/esm/shell/ThemeSwitcher.d.ts.map +1 -0
- package/dist/esm/shell/ThemeSwitcher.js +48 -0
- package/dist/esm/shell/ThemeSwitcher.js.map +1 -0
- package/dist/esm/shell/Topbar.d.ts +3 -0
- package/dist/esm/shell/Topbar.d.ts.map +1 -0
- package/dist/esm/shell/Topbar.js +52 -0
- package/dist/esm/shell/Topbar.js.map +1 -0
- package/dist/esm/shell/UserMenu.d.ts +3 -0
- package/dist/esm/shell/UserMenu.d.ts.map +1 -0
- package/dist/esm/shell/UserMenu.js +66 -0
- package/dist/esm/shell/UserMenu.js.map +1 -0
- package/dist/esm/shell/elementProperties.d.ts +9 -0
- package/dist/esm/shell/elementProperties.d.ts.map +1 -0
- package/dist/esm/shell/elementProperties.js +48 -0
- package/dist/esm/shell/elementProperties.js.map +1 -0
- package/dist/esm/shell/index.d.ts +19 -0
- package/dist/esm/shell/index.d.ts.map +1 -0
- package/dist/esm/shell/index.js +19 -0
- package/dist/esm/shell/index.js.map +1 -0
- package/dist/esm/themes/LayoutThemeProvider.d.ts +9 -0
- package/dist/esm/themes/LayoutThemeProvider.d.ts.map +1 -0
- package/dist/esm/themes/LayoutThemeProvider.js +31 -0
- package/dist/esm/themes/LayoutThemeProvider.js.map +1 -0
- package/dist/esm/themes/Theming.stories.d.ts +21 -0
- package/dist/esm/themes/Theming.stories.d.ts.map +1 -0
- package/dist/esm/themes/Theming.stories.js +54 -0
- package/dist/esm/themes/Theming.stories.js.map +1 -0
- package/dist/esm/themes/blueprintThemeCompatibility.d.ts +2 -0
- package/dist/esm/themes/blueprintThemeCompatibility.d.ts.map +1 -0
- package/dist/esm/themes/blueprintThemeCompatibility.js +26 -0
- package/dist/esm/themes/blueprintThemeCompatibility.js.map +1 -0
- package/dist/esm/themes/dark.d.ts +3 -0
- package/dist/esm/themes/dark.d.ts.map +1 -0
- package/dist/esm/themes/dark.js +38 -0
- package/dist/esm/themes/dark.js.map +1 -0
- package/dist/esm/themes/defaultBlueprintThemes.d.ts +3 -0
- package/dist/esm/themes/defaultBlueprintThemes.d.ts.map +1 -0
- package/dist/esm/themes/defaultBlueprintThemes.js +17 -0
- package/dist/esm/themes/defaultBlueprintThemes.js.map +1 -0
- package/dist/esm/themes/index.d.ts +6 -0
- package/dist/esm/themes/index.d.ts.map +1 -0
- package/dist/esm/themes/index.js +6 -0
- package/dist/esm/themes/index.js.map +1 -0
- package/dist/esm/themes/light.d.ts +3 -0
- package/dist/esm/themes/light.d.ts.map +1 -0
- package/dist/esm/themes/light.js +41 -0
- package/dist/esm/themes/light.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/for_AppShell/when_rendering_a_gallery_screen.tsx +76 -0
- package/for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx +77 -0
- package/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts +42 -0
- package/for_defaultBlueprint/when_validating_the_bundle.ts +43 -0
- package/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts +50 -0
- package/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts +36 -0
- package/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +53 -0
- package/for_galleryScreenTemplates/when_following_the_nesting_chain.ts +41 -0
- package/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +44 -0
- package/for_galleryScreens/when_resolving_the_component_names_they_reference.ts +60 -0
- package/for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts +76 -0
- package/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts +44 -0
- package/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts +61 -0
- package/for_layoutWrapperClasses/when_rendering_each_mode.ts +63 -0
- package/for_navigation/when_aggregating_the_navigation_contributions.ts +50 -0
- package/gallery/ApplicationScreens.stories.tsx +70 -0
- package/gallery/FullPageScreens.stories.tsx +60 -0
- package/gallery/GalleryScreenPreview.tsx +68 -0
- package/gallery/NavigationEntry.ts +27 -0
- package/gallery/TemplateSlotName.ts +36 -0
- package/gallery/applicationChrome.ts +110 -0
- package/gallery/authTemplates.ts +161 -0
- package/gallery/componentNames.ts +55 -0
- package/gallery/composeScreen.ts +95 -0
- package/gallery/dependencyComponentNames.ts +64 -0
- package/gallery/dialogTemplates.ts +79 -0
- package/gallery/elements.ts +65 -0
- package/gallery/index.ts +22 -0
- package/gallery/navigation.ts +71 -0
- package/gallery/nesting.ts +82 -0
- package/gallery/previewProfile.ts +59 -0
- package/gallery/resolveElementNames.ts +55 -0
- package/gallery/screens.ts +111 -0
- package/gallery/statusTemplates.ts +118 -0
- package/gallery/supportTemplates.ts +164 -0
- package/gallery/widgets.ts +63 -0
- package/gallery/workspaceTemplates.ts +198 -0
- package/index.ts +12 -0
- package/layouts/LayoutName.ts +18 -0
- package/layouts/SlotName.ts +44 -0
- package/layouts/appShell.ts +106 -0
- package/layouts/defaultLayouts.ts +15 -0
- package/layouts/flowBuilders.ts +49 -0
- package/layouts/fullPage.ts +48 -0
- package/layouts/index.ts +10 -0
- package/layouts/shellComponents.ts +28 -0
- package/package.json +68 -0
- package/packageName.ts +12 -0
- package/shell/AppShell.tsx +66 -0
- package/shell/Breadcrumb.tsx +31 -0
- package/shell/ConfigPanel.tsx +105 -0
- package/shell/Footer.tsx +23 -0
- package/shell/FullPageShell.tsx +41 -0
- package/shell/LayoutModeSwitcher.tsx +50 -0
- package/shell/LayoutModes.stories.tsx +83 -0
- package/shell/Logo.tsx +30 -0
- package/shell/Mask.tsx +29 -0
- package/shell/Menu.tsx +26 -0
- package/shell/MenuItem.tsx +39 -0
- package/shell/PageHeader.tsx +28 -0
- package/shell/RightPanel.tsx +23 -0
- package/shell/Sidebar.tsx +45 -0
- package/shell/ThemeOption.ts +60 -0
- package/shell/ThemeSwitcher.tsx +42 -0
- package/shell/Topbar.tsx +49 -0
- package/shell/UserMenu.tsx +53 -0
- package/shell/elementProperties.ts +64 -0
- package/shell/index.ts +21 -0
- package/shell/layout.css +821 -0
- package/themes/LayoutThemeProvider.tsx +41 -0
- package/themes/Theming.stories.tsx +89 -0
- package/themes/blueprintThemeCompatibility.ts +19 -0
- package/themes/dark.ts +38 -0
- package/themes/defaultBlueprintThemes.ts +14 -0
- package/themes/index.ts +8 -0
- 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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"when_rendering_a_gallery_screen.d.ts","sourceRoot":"","sources":["../../../for_AppShell/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":""}
|