@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,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* How the application shell arranges its sidebar against its content.
|
|
7
|
+
*
|
|
8
|
+
* The vocabulary - and the `layout-<mode>` wrapper class each value maps to - is deliberately the one
|
|
9
|
+
* PrimeTek's template line has used unchanged across Sakai, Diamond, Atlantis, Freya, Apollo, Ultima,
|
|
10
|
+
* Avalon and Verona. Anyone who has themed a PrimeReact application recognizes it, and a shell that
|
|
11
|
+
* invents its own names forces them to learn a second one for no gain.
|
|
12
|
+
*
|
|
13
|
+
* Every value here is user-selectable. Mobile deliberately is not - see {@link effectiveLayoutMode}.
|
|
14
|
+
*/ var LayoutMode = /*#__PURE__*/ function(LayoutMode) {
|
|
15
|
+
/** Sidebar permanently docked; content is pushed by a matching margin, never covered. */ LayoutMode["Static"] = "static";
|
|
16
|
+
/** Sidebar parked off-canvas; opening floats it over the content behind a mask. */ LayoutMode["Overlay"] = "overlay";
|
|
17
|
+
/** Icon-only rail with circular buttons; submenus pop out as a floating panel. */ LayoutMode["Slim"] = "slim";
|
|
18
|
+
/** Wider rail with each icon's label stacked directly beneath it. */ LayoutMode["SlimPlus"] = "slim-plus";
|
|
19
|
+
/** The icon-only rail again, with square buttons, and the topbar shifted by the rail width. */ LayoutMode["Compact"] = "compact";
|
|
20
|
+
/** Sidebar flows into the topbar strip as a horizontal row; submenus drop down. */ LayoutMode["Horizontal"] = "horizontal";
|
|
21
|
+
/** Full panel translated off-left leaving a strip of icons; hovering slides it in over the content. */ LayoutMode["Reveal"] = "reveal";
|
|
22
|
+
/** Collapsed rail that animates its width to full on hover - it grows where reveal slides. */ LayoutMode["Drawer"] = "drawer";
|
|
23
|
+
return LayoutMode;
|
|
24
|
+
}({});
|
|
25
|
+
/** Every {@link LayoutMode}, in the order a configurator should offer them. */ const layoutModes = [
|
|
26
|
+
"static",
|
|
27
|
+
"overlay",
|
|
28
|
+
"slim",
|
|
29
|
+
"slim-plus",
|
|
30
|
+
"compact",
|
|
31
|
+
"horizontal",
|
|
32
|
+
"reveal",
|
|
33
|
+
"drawer"
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
exports.LayoutMode = LayoutMode;
|
|
37
|
+
exports.layoutModes = layoutModes;
|
|
38
|
+
//# sourceMappingURL=LayoutMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutMode.js","sources":["../../../configuration/LayoutMode.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * How the application shell arranges its sidebar against its content.\n *\n * The vocabulary - and the `layout-<mode>` wrapper class each value maps to - is deliberately the one\n * PrimeTek's template line has used unchanged across Sakai, Diamond, Atlantis, Freya, Apollo, Ultima,\n * Avalon and Verona. Anyone who has themed a PrimeReact application recognizes it, and a shell that\n * invents its own names forces them to learn a second one for no gain.\n *\n * Every value here is user-selectable. Mobile deliberately is not - see {@link effectiveLayoutMode}.\n */\nexport enum LayoutMode {\n /** Sidebar permanently docked; content is pushed by a matching margin, never covered. */\n Static = 'static',\n\n /** Sidebar parked off-canvas; opening floats it over the content behind a mask. */\n Overlay = 'overlay',\n\n /** Icon-only rail with circular buttons; submenus pop out as a floating panel. */\n Slim = 'slim',\n\n /** Wider rail with each icon's label stacked directly beneath it. */\n SlimPlus = 'slim-plus',\n\n /** The icon-only rail again, with square buttons, and the topbar shifted by the rail width. */\n Compact = 'compact',\n\n /** Sidebar flows into the topbar strip as a horizontal row; submenus drop down. */\n Horizontal = 'horizontal',\n\n /** Full panel translated off-left leaving a strip of icons; hovering slides it in over the content. */\n Reveal = 'reveal',\n\n /** Collapsed rail that animates its width to full on hover - it grows where reveal slides. */\n Drawer = 'drawer',\n}\n\n/** Every {@link LayoutMode}, in the order a configurator should offer them. */\nexport const layoutModes: LayoutMode[] = [\n LayoutMode.Static,\n LayoutMode.Overlay,\n LayoutMode.Slim,\n LayoutMode.SlimPlus,\n LayoutMode.Compact,\n LayoutMode.Horizontal,\n LayoutMode.Reveal,\n LayoutMode.Drawer,\n];\n"],"names":["LayoutMode","layoutModes"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;IAUO,IAAKA,UAAAA,iBAAAA,SAAAA,UAAAA,EAAAA;8FAC+E,UAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wFAGN,UAAA,CAAA,SAAA,CAAA,GAAA,SAAA;uFAGD,UAAA,CAAA,MAAA,CAAA,GAAA,MAAA;0EAGb,UAAA,CAAA,UAAA,CAAA,GAAA,WAAA;oGAG0B,UAAA,CAAA,SAAA,CAAA,GAAA,SAAA;wFAGZ,UAAA,CAAA,YAAA,CAAA,GAAA,YAAA;4GAGoB,UAAA,CAAA,QAAA,CAAA,GAAA,QAAA;mGAGT,UAAA,CAAA,QAAA,CAAA,GAAA,QAAA;AAtBpFA,IAAAA,OAAAA,UAAAA;AAwBX,CAAA,CAAA,EAAA;AAED,gFACO,MAAMC,WAAAA,GAA4B;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* How the sidebar surface is tinted, independently of the overall {@link ColorScheme}.
|
|
7
|
+
*
|
|
8
|
+
* A dark sidebar against a light page is the single most common brand customization in the PrimeTek
|
|
9
|
+
* template line, which is why menu theme is its own configurator axis rather than something implied by
|
|
10
|
+
* the color scheme. The shell resolves each value from the active theme's tokens, so a menu theme never
|
|
11
|
+
* introduces a color of its own.
|
|
12
|
+
*/ var MenuTheme = /*#__PURE__*/ function(MenuTheme) {
|
|
13
|
+
/** The sidebar uses the theme's ordinary card surface. */ MenuTheme["Light"] = "light";
|
|
14
|
+
/** The sidebar uses an inverted surface, regardless of the page's color scheme. */ MenuTheme["Dark"] = "dark";
|
|
15
|
+
/** The sidebar uses the theme's primary color as its surface. */ MenuTheme["Primary"] = "primary";
|
|
16
|
+
return MenuTheme;
|
|
17
|
+
}({});
|
|
18
|
+
/** Every {@link MenuTheme}, in the order a configurator should offer them. */ const menuThemes = [
|
|
19
|
+
"light",
|
|
20
|
+
"dark",
|
|
21
|
+
"primary"
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
exports.MenuTheme = MenuTheme;
|
|
25
|
+
exports.menuThemes = menuThemes;
|
|
26
|
+
//# sourceMappingURL=MenuTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuTheme.js","sources":["../../../configuration/MenuTheme.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * How the sidebar surface is tinted, independently of the overall {@link ColorScheme}.\n *\n * A dark sidebar against a light page is the single most common brand customization in the PrimeTek\n * template line, which is why menu theme is its own configurator axis rather than something implied by\n * the color scheme. The shell resolves each value from the active theme's tokens, so a menu theme never\n * introduces a color of its own.\n */\nexport enum MenuTheme {\n /** The sidebar uses the theme's ordinary card surface. */\n Light = 'light',\n\n /** The sidebar uses an inverted surface, regardless of the page's color scheme. */\n Dark = 'dark',\n\n /** The sidebar uses the theme's primary color as its surface. */\n Primary = 'primary',\n}\n\n/** Every {@link MenuTheme}, in the order a configurator should offer them. */\nexport const menuThemes: MenuTheme[] = [MenuTheme.Light, MenuTheme.Dark, MenuTheme.Primary];\n"],"names":["MenuTheme","menuThemes"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,SAAAA,iBAAAA,SAAAA,SAAAA,EAAAA;+DACgD,SAAA,CAAA,OAAA,CAAA,GAAA,OAAA;wFAGyB,SAAA,CAAA,MAAA,CAAA,GAAA,MAAA;sEAGlB,SAAA,CAAA,SAAA,CAAA,GAAA,SAAA;AAPvDA,IAAAA,OAAAA,SAAAA;AASX,CAAA,CAAA,EAAA;AAED,+EACO,MAAMC,UAAAA,GAA0B;;;;;;;;;"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ColorScheme = require('./ColorScheme.js');
|
|
4
|
+
var LayoutMode = require('./LayoutMode.js');
|
|
5
|
+
var MenuTheme = require('./MenuTheme.js');
|
|
6
|
+
var layoutConfigTransitions = require('./layoutConfigTransitions.js');
|
|
7
|
+
|
|
8
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
9
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
10
|
+
/** The `localStorage` key the shell persists its configuration under. */ const layoutConfigStorageKey = 'cratis.scene.blueprint.default';
|
|
11
|
+
/**
|
|
12
|
+
* Reads the persisted configuration back, falling back to {@link defaultLayoutConfigState} for anything
|
|
13
|
+
* missing or unrecognized.
|
|
14
|
+
*
|
|
15
|
+
* Everything is validated against the enums rather than trusted, because `localStorage` is shared with
|
|
16
|
+
* every other script on the origin and outlives the version of this package that wrote it. An unknown
|
|
17
|
+
* mode left in place would put a class on the wrapper that no stylesheet rule matches - a shell with no
|
|
18
|
+
* sidebar at all, and no error to explain it.
|
|
19
|
+
*
|
|
20
|
+
* @param storage The storage to read from, or `undefined` when there is none (server-side rendering).
|
|
21
|
+
* @returns The restored state, with defaults filled in.
|
|
22
|
+
*/ function readPersistedLayoutConfig(storage) {
|
|
23
|
+
const defaults = layoutConfigTransitions.defaultLayoutConfigState();
|
|
24
|
+
const stored = readRecord(storage);
|
|
25
|
+
if (!stored) {
|
|
26
|
+
return defaults;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
...defaults,
|
|
30
|
+
mode: enumValue(Object.values(LayoutMode.LayoutMode), stored.mode) ?? defaults.mode,
|
|
31
|
+
menuTheme: enumValue(Object.values(MenuTheme.MenuTheme), stored.menuTheme) ?? defaults.menuTheme,
|
|
32
|
+
colorScheme: enumValue(Object.values(ColorScheme.ColorScheme), stored.colorScheme) ?? defaults.colorScheme,
|
|
33
|
+
themeName: typeof stored.themeName === 'string' ? stored.themeName : defaults.themeName,
|
|
34
|
+
isSidebarAnchored: typeof stored.isSidebarAnchored === 'boolean' ? stored.isSidebarAnchored : defaults.isSidebarAnchored
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Writes the durable parts of the configuration.
|
|
39
|
+
*
|
|
40
|
+
* Storage can throw - Safari's private mode and a full quota both do - and a shell that cannot remember a
|
|
41
|
+
* preference is a far smaller problem than one that crashes on a mode switch, so a failure here is
|
|
42
|
+
* swallowed rather than propagated.
|
|
43
|
+
*
|
|
44
|
+
* @param state The state to persist.
|
|
45
|
+
* @param storage The storage to write to, or `undefined` when there is none.
|
|
46
|
+
*/ function persistLayoutConfig(state, storage) {
|
|
47
|
+
if (!storage) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const persisted = {
|
|
51
|
+
mode: state.mode,
|
|
52
|
+
menuTheme: state.menuTheme,
|
|
53
|
+
colorScheme: state.colorScheme,
|
|
54
|
+
themeName: state.themeName,
|
|
55
|
+
isSidebarAnchored: state.isSidebarAnchored
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
storage.setItem(layoutConfigStorageKey, JSON.stringify(persisted));
|
|
59
|
+
} catch {
|
|
60
|
+
// A browser that refuses to store a preference still has to render the shell.
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function readRecord(storage) {
|
|
64
|
+
if (!storage) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const raw = storage.getItem(layoutConfigStorageKey);
|
|
69
|
+
if (!raw) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
const parsed = JSON.parse(raw);
|
|
73
|
+
return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) ? parsed : undefined;
|
|
74
|
+
} catch {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function enumValue(values, candidate) {
|
|
79
|
+
return typeof candidate === 'string' && values.includes(candidate) ? candidate : undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exports.layoutConfigStorageKey = layoutConfigStorageKey;
|
|
83
|
+
exports.persistLayoutConfig = persistLayoutConfig;
|
|
84
|
+
exports.readPersistedLayoutConfig = readPersistedLayoutConfig;
|
|
85
|
+
//# 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,gDAAAA,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,wBAAaN,MAAAA,CAAOE,IAAI,CAAA,IAAKJ,QAAAA,CAASI,IAAI;QACxEK,SAAAA,EAAWJ,SAAAA,CAAUC,OAAOC,MAAM,CAACG,sBAAYR,MAAAA,CAAOO,SAAS,CAAA,IAAKT,QAAAA,CAASS,SAAS;QACtFE,WAAAA,EAAaN,SAAAA,CAAUC,OAAOC,MAAM,CAACK,0BAAcV,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,158 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ColorScheme = require('./ColorScheme.js');
|
|
4
|
+
var LayoutMode = require('./LayoutMode.js');
|
|
5
|
+
var MenuTheme = require('./MenuTheme.js');
|
|
6
|
+
|
|
7
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
8
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
9
|
+
/**
|
|
10
|
+
* The viewport width, in CSS pixels, below which the shell stops honoring the chosen {@link LayoutMode}
|
|
11
|
+
* and forces the off-canvas one. 991 is the breakpoint the PrimeTek template line uses throughout; the
|
|
12
|
+
* value is exported rather than buried in a media query so the resize listener and the stylesheet cannot
|
|
13
|
+
* disagree about where the boundary is.
|
|
14
|
+
*/ const mobileBreakpoint = 991;
|
|
15
|
+
/** The media query the shell watches to know whether it is in the mobile regime. */ const mobileMediaQuery = `(max-width: ${mobileBreakpoint}px)`;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a viewport width falls in the mobile regime. Inclusive of the breakpoint itself, so this and
|
|
18
|
+
* {@link mobileMediaQuery}'s `max-width` agree on the boundary rather than disagreeing by one pixel.
|
|
19
|
+
*/ function isMobileWidth(width) {
|
|
20
|
+
return width <= mobileBreakpoint;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The state a shell starts in when nothing has been persisted: the docked sidebar every application
|
|
24
|
+
* template defaults to, on a light scheme, with the theme this package ships as its light one.
|
|
25
|
+
*/ function defaultLayoutConfigState() {
|
|
26
|
+
return {
|
|
27
|
+
mode: LayoutMode.LayoutMode.Static,
|
|
28
|
+
menuTheme: MenuTheme.MenuTheme.Light,
|
|
29
|
+
colorScheme: ColorScheme.ColorScheme.Light,
|
|
30
|
+
themeName: 'Scene Default Light',
|
|
31
|
+
isSidebarOpen: true,
|
|
32
|
+
isSidebarAnchored: false,
|
|
33
|
+
isSidebarRevealed: false,
|
|
34
|
+
isMobile: false
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The mode the shell actually renders, as opposed to the one the user picked.
|
|
39
|
+
*
|
|
40
|
+
* Below the mobile breakpoint every mode collapses to {@link LayoutMode.Overlay}: a docked 18rem sidebar,
|
|
41
|
+
* an icon rail or a horizontal menu strip are all unusable on a phone, so the template line forces
|
|
42
|
+
* off-canvas there and hides the mode picker. Deriving it rather than overwriting `mode` is what lets the
|
|
43
|
+
* chosen mode come back untouched when the viewport grows again.
|
|
44
|
+
*/ function effectiveLayoutMode(state) {
|
|
45
|
+
return state.isMobile ? LayoutMode.LayoutMode.Overlay : state.mode;
|
|
46
|
+
}
|
|
47
|
+
/** Whether the mode keeps the sidebar off-canvas until something opens it. */ function isOffCanvasMode(mode) {
|
|
48
|
+
return mode === LayoutMode.LayoutMode.Overlay;
|
|
49
|
+
}
|
|
50
|
+
/** Whether the mode is one of the two that react to the pointer - `reveal` slides in, `drawer` grows. */ function isPointerRevealMode(mode) {
|
|
51
|
+
return mode === LayoutMode.LayoutMode.Reveal || mode === LayoutMode.LayoutMode.Drawer;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Chooses a different mode.
|
|
55
|
+
*
|
|
56
|
+
* Switching also resets the sidebar's transient state, because "open" means something different in each
|
|
57
|
+
* mode: a static sidebar starts docked, every other mode starts closed, and a reveal/drawer panel that
|
|
58
|
+
* was hovered out must not stay out under a mode that has no hover behavior. The pin survives, since it
|
|
59
|
+
* is a preference rather than transient state.
|
|
60
|
+
*/ function withMode(state, mode) {
|
|
61
|
+
return {
|
|
62
|
+
...state,
|
|
63
|
+
mode,
|
|
64
|
+
isSidebarOpen: mode === LayoutMode.LayoutMode.Static,
|
|
65
|
+
isSidebarRevealed: false
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Records that the viewport crossed the mobile breakpoint.
|
|
70
|
+
*
|
|
71
|
+
* Entering the mobile regime closes the sidebar so the page is not covered on arrival; leaving it
|
|
72
|
+
* restores whatever the chosen mode considers its resting state. Both directions are recomputed rather
|
|
73
|
+
* than remembered, so a mode switch made while mobile still lands correctly on the way back out.
|
|
74
|
+
*/ function withMobile(state, isMobile) {
|
|
75
|
+
if (state.isMobile === isMobile) {
|
|
76
|
+
return state;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
...state,
|
|
80
|
+
isMobile,
|
|
81
|
+
isSidebarOpen: isMobile ? false : state.mode === LayoutMode.LayoutMode.Static,
|
|
82
|
+
isSidebarRevealed: false
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** Opens or closes the sidebar. */ function withSidebarOpen(state, isSidebarOpen) {
|
|
86
|
+
return {
|
|
87
|
+
...state,
|
|
88
|
+
isSidebarOpen
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** Flips the sidebar between open and closed - what the topbar's menu button does in every mode. */ function toggleSidebar(state) {
|
|
92
|
+
return withSidebarOpen(state, !state.isSidebarOpen);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Holds a `reveal`/`drawer` sidebar out, or lets it fall back.
|
|
96
|
+
*
|
|
97
|
+
* An anchored sidebar ignores the pointer entirely - that is the whole point of pinning it - so this is a
|
|
98
|
+
* no-op while {@link LayoutConfigState.isSidebarAnchored} is set rather than something the pointer can
|
|
99
|
+
* fight with.
|
|
100
|
+
*/ function withSidebarRevealed(state, isSidebarRevealed) {
|
|
101
|
+
if (state.isSidebarAnchored) {
|
|
102
|
+
return state;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
...state,
|
|
106
|
+
isSidebarRevealed
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Pins or unpins a `reveal`/`drawer` sidebar. Pinning implies revealed, so the panel does not snap shut
|
|
111
|
+
* the moment the pointer leaves the pin button that just pinned it.
|
|
112
|
+
*/ function withSidebarAnchored(state, isSidebarAnchored) {
|
|
113
|
+
return {
|
|
114
|
+
...state,
|
|
115
|
+
isSidebarAnchored,
|
|
116
|
+
isSidebarRevealed: isSidebarAnchored
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/** Flips the pin - what the sidebar's anchor button does. */ function toggleSidebarAnchor(state) {
|
|
120
|
+
return withSidebarAnchored(state, !state.isSidebarAnchored);
|
|
121
|
+
}
|
|
122
|
+
/** Chooses the light/dark axis. */ function withColorScheme(state, colorScheme) {
|
|
123
|
+
return {
|
|
124
|
+
...state,
|
|
125
|
+
colorScheme
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/** Chooses how the sidebar surface is tinted. */ function withMenuTheme(state, menuTheme) {
|
|
129
|
+
return {
|
|
130
|
+
...state,
|
|
131
|
+
menuTheme
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** Records which {@link Theme} is applied, so a theme switcher reflects the truth after a host-driven change. */ function withThemeName(state, themeName) {
|
|
135
|
+
return {
|
|
136
|
+
...state,
|
|
137
|
+
themeName
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
exports.defaultLayoutConfigState = defaultLayoutConfigState;
|
|
142
|
+
exports.effectiveLayoutMode = effectiveLayoutMode;
|
|
143
|
+
exports.isMobileWidth = isMobileWidth;
|
|
144
|
+
exports.isOffCanvasMode = isOffCanvasMode;
|
|
145
|
+
exports.isPointerRevealMode = isPointerRevealMode;
|
|
146
|
+
exports.mobileBreakpoint = mobileBreakpoint;
|
|
147
|
+
exports.mobileMediaQuery = mobileMediaQuery;
|
|
148
|
+
exports.toggleSidebar = toggleSidebar;
|
|
149
|
+
exports.toggleSidebarAnchor = toggleSidebarAnchor;
|
|
150
|
+
exports.withColorScheme = withColorScheme;
|
|
151
|
+
exports.withMenuTheme = withMenuTheme;
|
|
152
|
+
exports.withMobile = withMobile;
|
|
153
|
+
exports.withMode = withMode;
|
|
154
|
+
exports.withSidebarAnchored = withSidebarAnchored;
|
|
155
|
+
exports.withSidebarOpen = withSidebarOpen;
|
|
156
|
+
exports.withSidebarRevealed = withSidebarRevealed;
|
|
157
|
+
exports.withThemeName = withThemeName;
|
|
158
|
+
//# 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,sBAAWC,MAAM;AACvBC,QAAAA,SAAAA,EAAWC,oBAAUC,KAAK;AAC1BC,QAAAA,WAAAA,EAAaC,wBAAYF,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,sBAAWc,OAAO,GAAGD,MAAMd,IAAI;AAC3D;AAEA,+EACO,SAASgB,eAAAA,CAAgBhB,IAAgB,EAAA;IAC5C,OAAOA,IAAAA,KAASC,sBAAWc,OAAO;AACtC;AAEA,0GACO,SAASE,mBAAAA,CAAoBjB,IAAgB,EAAA;AAChD,IAAA,OAAOA,SAASC,qBAAAA,CAAWiB,MAAM,IAAIlB,IAAAA,KAASC,sBAAWkB,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,sBAAWC,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,sBAAWC,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,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var LayoutMode = require('./LayoutMode.js');
|
|
4
|
+
var layoutConfigTransitions = require('./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
|
+
/**
|
|
9
|
+
* Turns the shell's state into the wrapper class list its stylesheet keys off - the single seam between
|
|
10
|
+
* the state machine and the CSS.
|
|
11
|
+
*
|
|
12
|
+
* Every class name here is the one the PrimeTek template line already uses (`layout-static`,
|
|
13
|
+
* `layout-overlay-active`, `layout-sidebar-anchored`, `layout-mobile-active`, ...), so a stylesheet
|
|
14
|
+
* written against those templates keeps working and anyone who has themed one can read this shell's DOM
|
|
15
|
+
* without a translation table.
|
|
16
|
+
*
|
|
17
|
+
* The mode class reflects the *effective* mode, so the off-canvas rules a phone needs come from the same
|
|
18
|
+
* `layout-overlay` block a desktop overlay uses instead of a parallel mobile-only ruleset. The chosen mode
|
|
19
|
+
* is still emitted separately as `data-layout-mode`, so a configurator can show what the user picked even
|
|
20
|
+
* while the viewport overrides it.
|
|
21
|
+
*
|
|
22
|
+
* @param state The current shell state.
|
|
23
|
+
* @returns The classes to put on the shell's wrapper element, always starting with `layout-wrapper`.
|
|
24
|
+
*/ function layoutWrapperClasses(state) {
|
|
25
|
+
const mode = layoutConfigTransitions.effectiveLayoutMode(state);
|
|
26
|
+
const classes = [
|
|
27
|
+
'layout-wrapper',
|
|
28
|
+
`layout-${mode}`,
|
|
29
|
+
`layout-menu-${state.menuTheme}`,
|
|
30
|
+
`layout-color-scheme-${state.colorScheme}`
|
|
31
|
+
];
|
|
32
|
+
if (mode === LayoutMode.LayoutMode.Static && !state.isSidebarOpen) {
|
|
33
|
+
classes.push('layout-static-inactive');
|
|
34
|
+
}
|
|
35
|
+
if (mode === LayoutMode.LayoutMode.Overlay && state.isSidebarOpen && !state.isMobile) {
|
|
36
|
+
classes.push('layout-overlay-active');
|
|
37
|
+
}
|
|
38
|
+
if (layoutConfigTransitions.isPointerRevealMode(mode) && state.isSidebarRevealed) {
|
|
39
|
+
classes.push('layout-sidebar-active');
|
|
40
|
+
}
|
|
41
|
+
if (layoutConfigTransitions.isPointerRevealMode(mode) && state.isSidebarAnchored) {
|
|
42
|
+
classes.push('layout-sidebar-anchored');
|
|
43
|
+
}
|
|
44
|
+
if (state.isMobile) {
|
|
45
|
+
classes.push('layout-mobile');
|
|
46
|
+
}
|
|
47
|
+
if (state.isMobile && state.isSidebarOpen) {
|
|
48
|
+
classes.push('layout-mobile-active');
|
|
49
|
+
}
|
|
50
|
+
return classes;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Whether the scrim that dims the content behind a floating sidebar should be showing. Overlay and mobile
|
|
54
|
+
* both cover the page, and both need the click-anywhere-to-close the mask provides; a docked or rail
|
|
55
|
+
* sidebar covers nothing and must not dim anything.
|
|
56
|
+
*/ function isLayoutMaskVisible(state) {
|
|
57
|
+
return layoutConfigTransitions.effectiveLayoutMode(state) === LayoutMode.LayoutMode.Overlay && state.isSidebarOpen;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
exports.isLayoutMaskVisible = isLayoutMaskVisible;
|
|
61
|
+
exports.layoutWrapperClasses = layoutWrapperClasses;
|
|
62
|
+
//# 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,2CAAAA,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,qBAAAA,CAAWC,MAAM,IAAI,CAACP,KAAAA,CAAMQ,aAAa,EAAE;AACpDL,QAAAA,OAAAA,CAAQM,IAAI,CAAC,wBAAA,CAAA;AACjB,IAAA;IAEA,IAAIR,IAAAA,KAASK,qBAAAA,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,2CAAAA,CAAoBX,IAAAA,CAAAA,IAASD,KAAAA,CAAMa,iBAAiB,EAAE;AACtDV,QAAAA,OAAAA,CAAQM,IAAI,CAAC,uBAAA,CAAA;AACjB,IAAA;AAEA,IAAA,IAAIG,2CAAAA,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,4CAAoBF,KAAAA,CAAAA,KAAWM,qBAAAA,CAAWI,OAAO,IAAIV,MAAMQ,aAAa;AACnF;;;;;"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_model = require('@cratis/scene.model');
|
|
4
|
+
var ComponentName = require('./ComponentName.js');
|
|
5
|
+
var defaultBlueprintComponents = require('./defaultBlueprintComponents.js');
|
|
6
|
+
require('./gallery/elements.js');
|
|
7
|
+
require('./gallery/navigation.js');
|
|
8
|
+
var LayoutName = require('./layouts/LayoutName.js');
|
|
9
|
+
require('./layouts/shellComponents.js');
|
|
10
|
+
require('./layouts/appShell.js');
|
|
11
|
+
require('./layouts/fullPage.js');
|
|
12
|
+
var defaultLayouts = require('./layouts/defaultLayouts.js');
|
|
13
|
+
var packageName = require('./packageName.js');
|
|
14
|
+
var defaultBlueprintThemes = require('./themes/defaultBlueprintThemes.js');
|
|
15
|
+
require('react/jsx-runtime');
|
|
16
|
+
require('react');
|
|
17
|
+
require('@cratis/scene.react');
|
|
18
|
+
require('./gallery/nesting.js');
|
|
19
|
+
require('./gallery/workspaceTemplates.js');
|
|
20
|
+
require('./gallery/supportTemplates.js');
|
|
21
|
+
require('./gallery/authTemplates.js');
|
|
22
|
+
require('./gallery/statusTemplates.js');
|
|
23
|
+
var dialogTemplates = require('./gallery/dialogTemplates.js');
|
|
24
|
+
var screens = require('./gallery/screens.js');
|
|
25
|
+
require('@cratis/scene.engine');
|
|
26
|
+
require('./gallery/previewProfile.js');
|
|
27
|
+
require('./gallery/GalleryScreenPreview.js');
|
|
28
|
+
|
|
29
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
30
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
31
|
+
/**
|
|
32
|
+
* The default blueprint's declaration.
|
|
33
|
+
*
|
|
34
|
+
* A blueprint is the package an application picks once to get a coherent shape: the {@link Layout}s that
|
|
35
|
+
* are its base navigational look, the {@link ScreenTemplate}s and {@link DialogTemplate}s that go inside
|
|
36
|
+
* them, the components that fill their slots, and the themes that color all of it. Picking the parts
|
|
37
|
+
* separately is how an application ends up with a sidebar from one design language and a form from
|
|
38
|
+
* another.
|
|
39
|
+
*
|
|
40
|
+
* The dependency list is what makes a blueprint honest about what it is built from. This one declares
|
|
41
|
+
* PrimeReact - the shell's buttons, breadcrumb, overlay menu and drawer are PrimeReact 10 components - and
|
|
42
|
+
* Cratis Components, which its screen templates fill their content with. A profile that activated this
|
|
43
|
+
* blueprint without them would render a shell whose every control was a dashed red placeholder, and
|
|
44
|
+
* `resolvePackageDependencies` exists to catch that when the profile is configured rather than when
|
|
45
|
+
* someone opens the page.
|
|
46
|
+
*
|
|
47
|
+
* `layouts` lists only true application shells. A dashboard, a CRUD list or a sign-in screen is a screen
|
|
48
|
+
* template, not a layout, and is listed as one.
|
|
49
|
+
*/ const defaultBlueprintManifest = {
|
|
50
|
+
name: packageName.defaultBlueprintName,
|
|
51
|
+
version: '1.0.0',
|
|
52
|
+
kind: scene_model.PackageKind.Blueprint,
|
|
53
|
+
dependencies: [
|
|
54
|
+
{
|
|
55
|
+
name: 'PrimeReact'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Cratis.Components'
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
components: Object.values(ComponentName.ComponentName),
|
|
62
|
+
layouts: Object.values(LayoutName.LayoutName),
|
|
63
|
+
screenTemplates: screens.galleryScreenTemplates.map((template)=>template.name),
|
|
64
|
+
dialogTemplates: dialogTemplates.galleryDialogTemplates.map((template)=>template.name),
|
|
65
|
+
themes: defaultBlueprintThemes.defaultBlueprintThemes.map((theme)=>theme.name),
|
|
66
|
+
displayName: 'Cratis Default Blueprint',
|
|
67
|
+
description: 'Application shells with eight menu modes, the components that fill their slots, and a full screen and dialog template set.',
|
|
68
|
+
module: '@cratis/scene.blueprint.default'
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The default blueprint as a loadable bundle.
|
|
72
|
+
*
|
|
73
|
+
* The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and
|
|
74
|
+
* this package's specs run it - a manifest promising a component the bundle never registered renders as a
|
|
75
|
+
* dashed red placeholder somewhere deep inside a screen, a long way from the declaration that caused it.
|
|
76
|
+
*
|
|
77
|
+
* The screens are the gallery: real {@link Screen} instances naming a layout, a screen template and the
|
|
78
|
+
* content that fills it, so a preview boots them through the real engine as a working miniature
|
|
79
|
+
* application rather than a set of pictures.
|
|
80
|
+
*/ const defaultBlueprint = {
|
|
81
|
+
manifest: defaultBlueprintManifest,
|
|
82
|
+
components: defaultBlueprintComponents.defaultBlueprintComponents,
|
|
83
|
+
layouts: defaultLayouts.defaultLayouts,
|
|
84
|
+
screenTemplates: screens.galleryScreenTemplates,
|
|
85
|
+
dialogTemplates: dialogTemplates.galleryDialogTemplates,
|
|
86
|
+
screens: screens.galleryScreens,
|
|
87
|
+
themes: defaultBlueprintThemes.defaultBlueprintThemes
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
exports.defaultBlueprint = defaultBlueprint;
|
|
91
|
+
exports.defaultBlueprintManifest = defaultBlueprintManifest;
|
|
92
|
+
//# 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,gCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,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,2BAAAA,CAAAA;IAC1BC,OAAAA,EAASH,MAAAA,CAAOC,MAAM,CAACG,qBAAAA,CAAAA;AACvBC,IAAAA,eAAAA,EAAiBC,+BAAuBC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEiB,IAAAA,eAAAA,EAAiBC,uCAAuBH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAAShB,IAAI,CAAA;AACrEmB,IAAAA,MAAAA,EAAQC,8CAAuBL,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,qDAAAA;IACZhB,OAAAA,EAASiB,6BAAAA;IACTf,eAAAA,EAAiBC,8BAAAA;IACjBG,eAAAA,EAAiBC,sCAAAA;IACjBW,OAAAA,EAASC,sBAAAA;IACTX,MAAAA,EAAQC;AACZ;;;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var scene_react = require('@cratis/scene.react');
|
|
4
|
+
var ComponentName = require('./ComponentName.js');
|
|
5
|
+
var packageName = require('./packageName.js');
|
|
6
|
+
require('react/jsx-runtime');
|
|
7
|
+
require('react');
|
|
8
|
+
var AppShell = require('./shell/AppShell.js');
|
|
9
|
+
var FullPageShell = require('./shell/FullPageShell.js');
|
|
10
|
+
var Topbar = require('./shell/Topbar.js');
|
|
11
|
+
var Sidebar = require('./shell/Sidebar.js');
|
|
12
|
+
var Menu = require('./shell/Menu.js');
|
|
13
|
+
var MenuItem = require('./shell/MenuItem.js');
|
|
14
|
+
var Breadcrumb = require('./shell/Breadcrumb.js');
|
|
15
|
+
var Footer = require('./shell/Footer.js');
|
|
16
|
+
var RightPanel = require('./shell/RightPanel.js');
|
|
17
|
+
var ConfigPanel = require('./shell/ConfigPanel.js');
|
|
18
|
+
var PageHeader = require('./shell/PageHeader.js');
|
|
19
|
+
var Mask = require('./shell/Mask.js');
|
|
20
|
+
var Logo = require('./shell/Logo.js');
|
|
21
|
+
var UserMenu = require('./shell/UserMenu.js');
|
|
22
|
+
var ThemeSwitcher = require('./shell/ThemeSwitcher.js');
|
|
23
|
+
var LayoutModeSwitcher = require('./shell/LayoutModeSwitcher.js');
|
|
24
|
+
|
|
25
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
26
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
27
|
+
/**
|
|
28
|
+
* The components this package registers, keyed the way the renderer looks them up.
|
|
29
|
+
*
|
|
30
|
+
* Every key is built with `componentRegistryKey` rather than written out, because the separator between
|
|
31
|
+
* package and component name is the registry's own business - it is deliberately not the `.` a screen uses
|
|
32
|
+
* to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is
|
|
33
|
+
* how a component ends up registered under something no lookup will ever produce.
|
|
34
|
+
*/ const defaultBlueprintComponents = {
|
|
35
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.AppShell)]: AppShell.AppShell,
|
|
36
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.FullPageShell)]: FullPageShell.FullPageShell,
|
|
37
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Topbar)]: Topbar.Topbar,
|
|
38
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Sidebar)]: Sidebar.Sidebar,
|
|
39
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Menu)]: Menu.Menu,
|
|
40
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.MenuItem)]: MenuItem.MenuItem,
|
|
41
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Breadcrumb)]: Breadcrumb.Breadcrumb,
|
|
42
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Footer)]: Footer.Footer,
|
|
43
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.RightPanel)]: RightPanel.RightPanel,
|
|
44
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.ConfigPanel)]: ConfigPanel.ConfigPanel,
|
|
45
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.PageHeader)]: PageHeader.PageHeader,
|
|
46
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Mask)]: Mask.Mask,
|
|
47
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.Logo)]: Logo.Logo,
|
|
48
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.UserMenu)]: UserMenu.UserMenu,
|
|
49
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.ThemeSwitcher)]: ThemeSwitcher.ThemeSwitcher,
|
|
50
|
+
[scene_react.componentRegistryKey(packageName.defaultBlueprintName, ComponentName.ComponentName.LayoutModeSwitcher)]: LayoutModeSwitcher.LayoutModeSwitcher
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
exports.defaultBlueprintComponents = defaultBlueprintComponents;
|
|
54
|
+
//# 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,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcC,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAACH,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcE,aAAa,IAAIA,2BAAAA;AAC3E,IAAA,CAACJ,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcG,MAAM,IAAIA,aAAAA;AACpE,IAAA,CAACL,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcI,OAAO,IAAIA,eAAAA;AACrE,IAAA,CAACN,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcK,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACP,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcM,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAACR,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcO,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACT,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcQ,MAAM,IAAIA,aAAAA;AACpE,IAAA,CAACV,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcS,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACX,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcU,WAAW,IAAIA,uBAAAA;AACzE,IAAA,CAACZ,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcW,UAAU,IAAIA,qBAAAA;AACxE,IAAA,CAACb,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcY,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACd,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAca,IAAI,IAAIA,SAAAA;AAClE,IAAA,CAACf,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcc,QAAQ,IAAIA,iBAAAA;AACtE,IAAA,CAAChB,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAce,aAAa,IAAIA,2BAAAA;AAC3E,IAAA,CAACjB,gCAAAA,CAAqBC,gCAAAA,EAAsBC,2BAAAA,CAAcgB,kBAAkB,IAAIA;AACpF;;;;"}
|