@cratis/scene.blueprint.default 3.2.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/cjs/ComponentName.js.map +1 -1
  2. package/dist/cjs/configuration/ColorScheme.js.map +1 -1
  3. package/dist/cjs/configuration/LayoutConfigProvider.js.map +1 -1
  4. package/dist/cjs/configuration/LayoutMode.js.map +1 -1
  5. package/dist/cjs/configuration/MenuTheme.js.map +1 -1
  6. package/dist/cjs/configuration/layoutConfigStorage.js.map +1 -1
  7. package/dist/cjs/configuration/layoutConfigTransitions.js.map +1 -1
  8. package/dist/cjs/configuration/layoutWrapperClasses.js.map +1 -1
  9. package/dist/cjs/defaultBlueprint.js.map +1 -1
  10. package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
  11. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
  12. package/dist/cjs/gallery/TemplateSlotName.js.map +1 -1
  13. package/dist/cjs/gallery/applicationChrome.js.map +1 -1
  14. package/dist/cjs/gallery/authTemplates.js.map +1 -1
  15. package/dist/cjs/gallery/componentNames.js.map +1 -1
  16. package/dist/cjs/gallery/composeScreen.js.map +1 -1
  17. package/dist/cjs/gallery/dependencyComponentNames.js.map +1 -1
  18. package/dist/cjs/gallery/dialogTemplates.js.map +1 -1
  19. package/dist/cjs/gallery/elements.js.map +1 -1
  20. package/dist/cjs/gallery/navigation.js.map +1 -1
  21. package/dist/cjs/gallery/nesting.js.map +1 -1
  22. package/dist/cjs/gallery/previewProfile.js.map +1 -1
  23. package/dist/cjs/gallery/resolveElementNames.js.map +1 -1
  24. package/dist/cjs/gallery/screens.js.map +1 -1
  25. package/dist/cjs/gallery/statusTemplates.js.map +1 -1
  26. package/dist/cjs/gallery/supportTemplates.js.map +1 -1
  27. package/dist/cjs/gallery/widgets.js.map +1 -1
  28. package/dist/cjs/gallery/workspaceTemplates.js.map +1 -1
  29. package/dist/cjs/layouts/LayoutName.js.map +1 -1
  30. package/dist/cjs/layouts/SlotName.js.map +1 -1
  31. package/dist/cjs/layouts/appShell.js.map +1 -1
  32. package/dist/cjs/layouts/defaultLayouts.js.map +1 -1
  33. package/dist/cjs/layouts/flowBuilders.js.map +1 -1
  34. package/dist/cjs/layouts/fullPage.js.map +1 -1
  35. package/dist/cjs/layouts/shellComponents.js.map +1 -1
  36. package/dist/cjs/packageName.js.map +1 -1
  37. package/dist/cjs/shell/AppShell.js.map +1 -1
  38. package/dist/cjs/shell/Breadcrumb.js.map +1 -1
  39. package/dist/cjs/shell/ConfigPanel.js.map +1 -1
  40. package/dist/cjs/shell/Footer.js.map +1 -1
  41. package/dist/cjs/shell/FullPageShell.js.map +1 -1
  42. package/dist/cjs/shell/LayoutModeSwitcher.js.map +1 -1
  43. package/dist/cjs/shell/Logo.js.map +1 -1
  44. package/dist/cjs/shell/Mask.js.map +1 -1
  45. package/dist/cjs/shell/Menu.js.map +1 -1
  46. package/dist/cjs/shell/MenuItem.js.map +1 -1
  47. package/dist/cjs/shell/PageHeader.js.map +1 -1
  48. package/dist/cjs/shell/RightPanel.js.map +1 -1
  49. package/dist/cjs/shell/Sidebar.js.map +1 -1
  50. package/dist/cjs/shell/ThemeOption.js.map +1 -1
  51. package/dist/cjs/shell/ThemeSwitcher.js.map +1 -1
  52. package/dist/cjs/shell/Topbar.js.map +1 -1
  53. package/dist/cjs/shell/UserMenu.js.map +1 -1
  54. package/dist/cjs/shell/elementProperties.js.map +1 -1
  55. package/dist/cjs/themes/LayoutThemeProvider.js.map +1 -1
  56. package/dist/cjs/themes/blueprintThemeCompatibility.js.map +1 -1
  57. package/dist/cjs/themes/dark.js.map +1 -1
  58. package/dist/cjs/themes/defaultBlueprintThemes.js.map +1 -1
  59. package/dist/cjs/themes/light.js.map +1 -1
  60. package/dist/esm/ComponentName.js.map +1 -1
  61. package/dist/esm/configuration/ColorScheme.js.map +1 -1
  62. package/dist/esm/configuration/LayoutConfigProvider.js.map +1 -1
  63. package/dist/esm/configuration/LayoutMode.js.map +1 -1
  64. package/dist/esm/configuration/MenuTheme.js.map +1 -1
  65. package/dist/esm/configuration/layoutConfigStorage.js.map +1 -1
  66. package/dist/esm/configuration/layoutConfigTransitions.js.map +1 -1
  67. package/dist/esm/configuration/layoutWrapperClasses.js.map +1 -1
  68. package/dist/esm/defaultBlueprint.js.map +1 -1
  69. package/dist/esm/defaultBlueprintComponents.js.map +1 -1
  70. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
  71. package/dist/esm/gallery/TemplateSlotName.js.map +1 -1
  72. package/dist/esm/gallery/applicationChrome.js.map +1 -1
  73. package/dist/esm/gallery/authTemplates.js.map +1 -1
  74. package/dist/esm/gallery/componentNames.js.map +1 -1
  75. package/dist/esm/gallery/composeScreen.js.map +1 -1
  76. package/dist/esm/gallery/dependencyComponentNames.js.map +1 -1
  77. package/dist/esm/gallery/dialogTemplates.js.map +1 -1
  78. package/dist/esm/gallery/elements.js.map +1 -1
  79. package/dist/esm/gallery/navigation.js.map +1 -1
  80. package/dist/esm/gallery/nesting.js.map +1 -1
  81. package/dist/esm/gallery/previewProfile.js.map +1 -1
  82. package/dist/esm/gallery/resolveElementNames.js.map +1 -1
  83. package/dist/esm/gallery/screens.js.map +1 -1
  84. package/dist/esm/gallery/statusTemplates.js.map +1 -1
  85. package/dist/esm/gallery/supportTemplates.js.map +1 -1
  86. package/dist/esm/gallery/widgets.js.map +1 -1
  87. package/dist/esm/gallery/workspaceTemplates.js.map +1 -1
  88. package/dist/esm/layouts/LayoutName.js.map +1 -1
  89. package/dist/esm/layouts/SlotName.js.map +1 -1
  90. package/dist/esm/layouts/appShell.js.map +1 -1
  91. package/dist/esm/layouts/defaultLayouts.js.map +1 -1
  92. package/dist/esm/layouts/flowBuilders.js.map +1 -1
  93. package/dist/esm/layouts/fullPage.js.map +1 -1
  94. package/dist/esm/layouts/shellComponents.js.map +1 -1
  95. package/dist/esm/packageName.js.map +1 -1
  96. package/dist/esm/shell/AppShell.js.map +1 -1
  97. package/dist/esm/shell/Breadcrumb.js.map +1 -1
  98. package/dist/esm/shell/ConfigPanel.js.map +1 -1
  99. package/dist/esm/shell/Footer.js.map +1 -1
  100. package/dist/esm/shell/FullPageShell.js.map +1 -1
  101. package/dist/esm/shell/LayoutModeSwitcher.js.map +1 -1
  102. package/dist/esm/shell/Logo.js.map +1 -1
  103. package/dist/esm/shell/Mask.js.map +1 -1
  104. package/dist/esm/shell/Menu.js.map +1 -1
  105. package/dist/esm/shell/MenuItem.js.map +1 -1
  106. package/dist/esm/shell/PageHeader.js.map +1 -1
  107. package/dist/esm/shell/RightPanel.js.map +1 -1
  108. package/dist/esm/shell/Sidebar.js.map +1 -1
  109. package/dist/esm/shell/ThemeOption.js.map +1 -1
  110. package/dist/esm/shell/ThemeSwitcher.js.map +1 -1
  111. package/dist/esm/shell/Topbar.js.map +1 -1
  112. package/dist/esm/shell/UserMenu.js.map +1 -1
  113. package/dist/esm/shell/elementProperties.js.map +1 -1
  114. package/dist/esm/themes/LayoutThemeProvider.js.map +1 -1
  115. package/dist/esm/themes/blueprintThemeCompatibility.js.map +1 -1
  116. package/dist/esm/themes/dark.js.map +1 -1
  117. package/dist/esm/themes/defaultBlueprintThemes.js.map +1 -1
  118. package/dist/esm/themes/light.js.map +1 -1
  119. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  120. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentName.js","sources":["../../ComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The bare names this package declares components under.\n *\n * A page template writes a bare name and `resolveComponentName` decides which active package wins it, so\n * these names are public API: renaming one breaks every template that referenced it, in this package and\n * in anyone else's. Keeping them in one enum means the manifest, the registry and every template\n * reference the same symbol, and the specs can prove all three agree rather than hoping they do.\n */\nexport enum ComponentName {\n /** The application shell - topbar, sidebar, breadcrumb, content, footer and an optional right panel. */\n AppShell = 'appShell',\n\n /** The chrome-less shell - content, an optional branding aside, and the configurator. */\n FullPageShell = 'fullPageShell',\n\n /** The fixed strip across the top of the application shell. */\n Topbar = 'topbar',\n\n /** The sidebar's own chrome, inside the shell-positioned panel. */\n Sidebar = 'sidebar',\n\n /** A navigation list. */\n Menu = 'menu',\n\n /** One entry in a navigation list, optionally with a submenu. */\n MenuItem = 'menuItem',\n\n /** The trail above the content. */\n Breadcrumb = 'breadcrumb',\n\n /** The strip below the content. */\n Footer = 'footer',\n\n /** The inspector panel down the right-hand edge. */\n RightPanel = 'rightPanel',\n\n /** The floating configurator: color scheme, layout mode, menu theme and theme. */\n ConfigPanel = 'configPanel',\n\n /** A screen's title, subtitle and actions. */\n PageHeader = 'pageHeader',\n\n /** The scrim behind a floating sidebar, which also closes it. */\n Mask = 'mask',\n\n /** The brand mark. */\n Logo = 'logo',\n\n /** The signed-in user's avatar and menu. */\n UserMenu = 'userMenu',\n\n /** Switches between the themes a host offers. */\n ThemeSwitcher = 'themeSwitcher',\n\n /** Switches between the layout modes. */\n LayoutModeSwitcher = 'layoutModeSwitcher',\n}\n"],"names":["ComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;6GAC8F,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8FAGf,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;oEAG1B,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wEAGI,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;8BAG1C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;sEAGwC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;wCAG9B,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;wCAGA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;yDAGiB,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uFAG8B,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;mDAGpC,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;sEAGmB,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;2BAG3C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;iDAGsB,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;sDAGK,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;8CAGR,aAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;AA9C/BA,IAAAA,OAAAA,aAAAA;AAgDX,CAAA,CAAA,EAAA;;;;"}
1
+ {"version":3,"file":"ComponentName.js","sources":["../../ComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The bare names this package declares components under.\n *\n * A page template writes a bare name and `resolveComponentName` decides which active package wins it, so\n * these names are public API: renaming one breaks every template that referenced it, in this package and\n * in anyone else's. Keeping them in one enum means the manifest, the registry and every template\n * reference the same symbol, and the specs can prove all three agree rather than hoping they do.\n */\nexport enum ComponentName {\n /** The application shell - topbar, sidebar, breadcrumb, content, footer and an optional right panel. */\n AppShell = 'appShell',\n\n /** The chrome-less shell - content, an optional branding aside, and the configurator. */\n FullPageShell = 'fullPageShell',\n\n /** The fixed strip across the top of the application shell. */\n Topbar = 'topbar',\n\n /** The sidebar's own chrome, inside the shell-positioned panel. */\n Sidebar = 'sidebar',\n\n /** A navigation list. */\n Menu = 'menu',\n\n /** One entry in a navigation list, optionally with a submenu. */\n MenuItem = 'menuItem',\n\n /** The trail above the content. */\n Breadcrumb = 'breadcrumb',\n\n /** The strip below the content. */\n Footer = 'footer',\n\n /** The inspector panel down the right-hand edge. */\n RightPanel = 'rightPanel',\n\n /** The floating configurator: color scheme, layout mode, menu theme and theme. */\n ConfigPanel = 'configPanel',\n\n /** A screen's title, subtitle and actions. */\n PageHeader = 'pageHeader',\n\n /** The scrim behind a floating sidebar, which also closes it. */\n Mask = 'mask',\n\n /** The brand mark. */\n Logo = 'logo',\n\n /** The signed-in user's avatar and menu. */\n UserMenu = 'userMenu',\n\n /** Switches between the themes a host offers. */\n ThemeSwitcher = 'themeSwitcher',\n\n /** Switches between the layout modes. */\n LayoutModeSwitcher = 'layoutModeSwitcher',\n}\n"],"names":["ComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;6GAC8F,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;8FAGf,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;oEAG1B,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wEAGI,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;8BAG1C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;sEAGwC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;wCAG9B,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;wCAGA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;yDAGiB,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;uFAG8B,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;mDAGpC,aAAA,CAAA,YAAA,CAAA,GAAA,YAAA;sEAGmB,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;2BAG3C,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;iDAGsB,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;sDAGK,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;8CAGR,aAAA,CAAA,oBAAA,CAAA,GAAA,oBAAA;AA9C/BA,IAAAA,OAAAA,aAAAA;AAgDX,CAAA,CAAA,EAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorScheme.js","sources":["../../../configuration/ColorScheme.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The light/dark axis of the configurator.\n *\n * The shell never paints a color for a scheme itself - it only records which one is chosen, so the host\n * can hand {@link SceneThemeProvider} a matching {@link Theme}. Keeping the choice and the palette apart\n * is what lets a third-party theme participate in the same switch as the two this package ships.\n */\nexport enum ColorScheme {\n Light = 'light',\n Dark = 'dark',\n}\n\n/** Every {@link ColorScheme}, in the order a configurator should offer them. */\nexport const colorSchemes: ColorScheme[] = [ColorScheme.Light, ColorScheme.Dark];\n"],"names":["ColorScheme","colorSchemes"],"mappings":";;AAAA;AACA;AAEA;;;;;;IAOO,IAAKA,WAAAA,iBAAAA,SAAAA,WAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,WAAAA;AAGX,CAAA,CAAA,EAAA;AAED,iFACO,MAAMC,YAAAA,GAA8B;;;;;;;;"}
1
+ {"version":3,"file":"ColorScheme.js","sources":["../../../configuration/ColorScheme.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The light/dark axis of the configurator.\n *\n * The shell never paints a color for a scheme itself - it only records which one is chosen, so the host\n * can hand {@link SceneThemeProvider} a matching {@link Theme}. Keeping the choice and the palette apart\n * is what lets a third-party theme participate in the same switch as the two this package ships.\n */\nexport enum ColorScheme {\n Light = 'light',\n Dark = 'dark',\n}\n\n/** Every {@link ColorScheme}, in the order a configurator should offer them. */\nexport const colorSchemes: ColorScheme[] = [ColorScheme.Light, ColorScheme.Dark];\n"],"names":["ColorScheme","colorSchemes"],"mappings":";;AAAA;AACA;AAEA;;;;;;IAOO,IAAKA,WAAAA,iBAAAA,SAAAA,WAAAA,EAAAA;;;AAAAA,IAAAA,OAAAA,WAAAA;AAGX,CAAA,CAAA,EAAA;AAED,iFACO,MAAMC,YAAAA,GAA8B;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutConfigProvider.js","sources":["../../../configuration/LayoutConfigProvider.tsx"],"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 { ReactNode, createContext, useContext, useEffect, useMemo, useState } from 'react';\nimport { ColorScheme } from './ColorScheme';\nimport { LayoutConfigState } from './LayoutConfigState';\nimport { LayoutMode } from './LayoutMode';\nimport { MenuTheme } from './MenuTheme';\nimport { persistLayoutConfig, readPersistedLayoutConfig } from './layoutConfigStorage';\nimport { isLayoutMaskVisible, layoutWrapperClasses } from './layoutWrapperClasses';\nimport {\n effectiveLayoutMode,\n isMobileWidth,\n mobileMediaQuery,\n toggleSidebar,\n toggleSidebarAnchor,\n withColorScheme,\n withMenuTheme,\n withMobile,\n withMode,\n withSidebarOpen,\n withSidebarRevealed,\n withThemeName,\n} from './layoutConfigTransitions';\n\n/**\n * What {@link useLayoutConfig} hands a shell component: the current state, the values every part of the\n * shell derives from it, and one function per transition.\n *\n * The derived values live here rather than being recomputed per component so that the topbar, the\n * sidebar and the mask cannot end up disagreeing about which mode is in force - the exact class of bug a\n * shell with per-component state produces.\n */\nexport interface LayoutConfigContextValue {\n /** The current state. */\n config: LayoutConfigState;\n\n /** The mode actually in force, with the mobile override applied. */\n effectiveMode: LayoutMode;\n\n /** The classes for the shell's wrapper element. */\n wrapperClasses: string[];\n\n /** Whether the scrim behind a floating sidebar should be showing. */\n isMaskVisible: boolean;\n\n /** Chooses a different mode. Below the mobile breakpoint the choice is still recorded, but the shell keeps rendering off-canvas. */\n setMode(mode: LayoutMode): void;\n\n /** Chooses how the sidebar surface is tinted. */\n setMenuTheme(menuTheme: MenuTheme): void;\n\n /** Chooses the light/dark axis. */\n setColorScheme(colorScheme: ColorScheme): void;\n\n /** Records which theme is applied. */\n setThemeName(themeName: string): void;\n\n /** Opens or closes the sidebar. */\n setSidebarOpen(isOpen: boolean): void;\n\n /** Flips the sidebar between open and closed. */\n toggleSidebar(): void;\n\n /** Holds a `reveal`/`drawer` sidebar out, or lets it fall back. */\n setSidebarRevealed(isRevealed: boolean): void;\n\n /** Pins or unpins a `reveal`/`drawer` sidebar. */\n toggleSidebarAnchor(): void;\n}\n\nconst LayoutConfigContext = createContext<LayoutConfigContextValue | undefined>(undefined);\n\nexport interface LayoutConfigProviderProps {\n /** Values to start from, overriding both the defaults and anything persisted - a story or a spec pinning a mode. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /**\n * Where preferences are read from and written to. Defaults to `window.localStorage` when there is a\n * window; pass a fake in a spec, or `null` to opt out of persistence entirely.\n */\n storage?: Storage | null;\n\n /**\n * The width the shell should consider its viewport, for a host that renders it into a sized element\n * rather than the window - Studio's preview surface, where the device frame is a few hundred pixels\n * wide while the real window is a desktop one. When given, this replaces the `matchMedia` listener\n * entirely rather than competing with it.\n */\n viewportWidth?: number;\n\n /** The shell this configuration applies to. */\n children?: ReactNode;\n}\n\n/**\n * Owns the shell's configuration and keeps it in step with the viewport and with `localStorage`.\n *\n * One provider rather than state per shell component is what makes the modes work at all: the topbar's\n * toggle, the sidebar's pin, the mask's click-to-close and the configurator's mode picker are four\n * different components acting on one machine. It is also what makes a chosen mode survive a reload, which\n * is the whole reason a mode picker is worth having.\n */\nexport function LayoutConfigProvider({ initialConfig, storage, viewportWidth, children }: LayoutConfigProviderProps) {\n const resolvedStorage = useMemo(() => (storage !== undefined ? storage ?? undefined : defaultStorage()), [storage]);\n const [config, setConfig] = useState<LayoutConfigState>(() => ({\n ...readPersistedLayoutConfig(resolvedStorage),\n ...initialConfig,\n }));\n\n useEffect(() => {\n persistLayoutConfig(config, resolvedStorage);\n }, [config, resolvedStorage]);\n\n const isReportedMobile = viewportWidth === undefined ? undefined : isMobileWidth(viewportWidth);\n useEffect(() => {\n if (isReportedMobile !== undefined) {\n setConfig(current => withMobile(current, isReportedMobile));\n return;\n }\n\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return;\n }\n\n const query = window.matchMedia(mobileMediaQuery);\n setConfig(current => withMobile(current, query.matches));\n\n const listener = (event: MediaQueryListEvent) => setConfig(current => withMobile(current, event.matches));\n query.addEventListener('change', listener);\n return () => query.removeEventListener('change', listener);\n }, [isReportedMobile]);\n\n const value = useMemo<LayoutConfigContextValue>(\n () => ({\n config,\n effectiveMode: effectiveLayoutMode(config),\n wrapperClasses: layoutWrapperClasses(config),\n isMaskVisible: isLayoutMaskVisible(config),\n setMode: mode => setConfig(current => withMode(current, mode)),\n setMenuTheme: menuTheme => setConfig(current => withMenuTheme(current, menuTheme)),\n setColorScheme: colorScheme => setConfig(current => withColorScheme(current, colorScheme)),\n setThemeName: themeName => setConfig(current => withThemeName(current, themeName)),\n setSidebarOpen: isOpen => setConfig(current => withSidebarOpen(current, isOpen)),\n toggleSidebar: () => setConfig(toggleSidebar),\n setSidebarRevealed: isRevealed => setConfig(current => withSidebarRevealed(current, isRevealed)),\n toggleSidebarAnchor: () => setConfig(toggleSidebarAnchor),\n }),\n [config],\n );\n\n return <LayoutConfigContext.Provider value={value}>{children}</LayoutConfigContext.Provider>;\n}\n\n/**\n * The shell configuration, or `undefined` when there is no {@link LayoutConfigProvider} above.\n *\n * This is what lets the shell components put a provider around themselves when a host has not - a gallery\n * preview drops a single `appShell` element into a renderer with no wrapper of its own, and it still has\n * to work.\n */\nexport function useOptionalLayoutConfig(): LayoutConfigContextValue | undefined {\n return useContext(LayoutConfigContext);\n}\n\n/**\n * The shell configuration. Throws when there is no {@link LayoutConfigProvider} above, because every\n * alternative - a silent default, a no-op setter - produces a shell whose buttons do nothing and says\n * nothing about why.\n */\nexport function useLayoutConfig(): LayoutConfigContextValue {\n const value = useOptionalLayoutConfig();\n if (!value) {\n throw new Error('useLayoutConfig() requires a <LayoutConfigProvider> above it.');\n }\n\n return value;\n}\n\nfunction defaultStorage(): Storage | undefined {\n return typeof window !== 'undefined' ? window.localStorage : undefined;\n}\n"],"names":["LayoutConfigContext","createContext","undefined","LayoutConfigProvider","initialConfig","storage","viewportWidth","children","resolvedStorage","useMemo","defaultStorage","config","setConfig","useState","readPersistedLayoutConfig","useEffect","persistLayoutConfig","isReportedMobile","isMobileWidth","current","withMobile","window","matchMedia","query","mobileMediaQuery","matches","listener","event","addEventListener","removeEventListener","value","effectiveMode","effectiveLayoutMode","wrapperClasses","layoutWrapperClasses","isMaskVisible","isLayoutMaskVisible","setMode","mode","withMode","setMenuTheme","menuTheme","withMenuTheme","setColorScheme","colorScheme","withColorScheme","setThemeName","themeName","withThemeName","setSidebarOpen","isOpen","withSidebarOpen","toggleSidebar","setSidebarRevealed","isRevealed","withSidebarRevealed","toggleSidebarAnchor","_jsx","Provider","useOptionalLayoutConfig","useContext","useLayoutConfig","Error","localStorage"],"mappings":";;;;;;;;AAuEA,MAAMA,oCAAsBC,mBAAAA,CAAoDC,SAAAA,CAAAA;AAwBhF;;;;;;;IAQO,SAASC,oBAAAA,CAAqB,EAAEC,aAAa,EAAEC,OAAO,EAAEC,aAAa,EAAEC,QAAQ,EAA6B,EAAA;AAC/G,IAAA,MAAMC,kBAAkBC,aAAAA,CAAQ,IAAOJ,YAAYH,SAAAA,GAAYG,OAAAA,IAAWH,YAAYQ,cAAAA,EAAAA,EAAmB;AAACL,QAAAA;AAAQ,KAAA,CAAA;AAClH,IAAA,MAAM,CAACM,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,cAAAA,CAA4B,KAAO;AAC3D,YAAA,GAAGC,8CAA0BN,eAAAA,CAAgB;AAC7C,YAAA,GAAGJ;SACP,CAAA,CAAA;IAEAW,eAAAA,CAAU,IAAA;AACNC,QAAAA,uCAAAA,CAAoBL,MAAAA,EAAQH,eAAAA,CAAAA;IAChC,CAAA,EAAG;AAACG,QAAAA,MAAAA;AAAQH,QAAAA;AAAgB,KAAA,CAAA;AAE5B,IAAA,MAAMS,gBAAAA,GAAmBX,aAAAA,KAAkBJ,SAAAA,GAAYA,SAAAA,GAAYgB,qCAAAA,CAAcZ,aAAAA,CAAAA;IACjFS,eAAAA,CAAU,IAAA;AACN,QAAA,IAAIE,qBAAqBf,SAAAA,EAAW;YAChCU,SAAAA,CAAUO,CAAAA,OAAAA,GAAWC,kCAAAA,CAAWD,OAAAA,EAASF,gBAAAA,CAAAA,CAAAA;AACzC,YAAA;AACJ,QAAA;AAEA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ACjE;;;;;;"}
1
+ {"version":3,"file":"LayoutConfigProvider.js","sources":["../../../configuration/LayoutConfigProvider.tsx"],"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 { ReactNode, createContext, useContext, useEffect, useMemo, useState } from 'react';\nimport { ColorScheme } from './ColorScheme';\nimport { LayoutConfigState } from './LayoutConfigState';\nimport { LayoutMode } from './LayoutMode';\nimport { MenuTheme } from './MenuTheme';\nimport { persistLayoutConfig, readPersistedLayoutConfig } from './layoutConfigStorage';\nimport { isLayoutMaskVisible, layoutWrapperClasses } from './layoutWrapperClasses';\nimport {\n effectiveLayoutMode,\n isMobileWidth,\n mobileMediaQuery,\n toggleSidebar,\n toggleSidebarAnchor,\n withColorScheme,\n withMenuTheme,\n withMobile,\n withMode,\n withSidebarOpen,\n withSidebarRevealed,\n withThemeName,\n} from './layoutConfigTransitions';\n\n/**\n * What {@link useLayoutConfig} hands a shell component: the current state, the values every part of the\n * shell derives from it, and one function per transition.\n *\n * The derived values live here rather than being recomputed per component so that the topbar, the\n * sidebar and the mask cannot end up disagreeing about which mode is in force - the exact class of bug a\n * shell with per-component state produces.\n */\nexport interface LayoutConfigContextValue {\n /** The current state. */\n config: LayoutConfigState;\n\n /** The mode actually in force, with the mobile override applied. */\n effectiveMode: LayoutMode;\n\n /** The classes for the shell's wrapper element. */\n wrapperClasses: string[];\n\n /** Whether the scrim behind a floating sidebar should be showing. */\n isMaskVisible: boolean;\n\n /** Chooses a different mode. Below the mobile breakpoint the choice is still recorded, but the shell keeps rendering off-canvas. */\n setMode(mode: LayoutMode): void;\n\n /** Chooses how the sidebar surface is tinted. */\n setMenuTheme(menuTheme: MenuTheme): void;\n\n /** Chooses the light/dark axis. */\n setColorScheme(colorScheme: ColorScheme): void;\n\n /** Records which theme is applied. */\n setThemeName(themeName: string): void;\n\n /** Opens or closes the sidebar. */\n setSidebarOpen(isOpen: boolean): void;\n\n /** Flips the sidebar between open and closed. */\n toggleSidebar(): void;\n\n /** Holds a `reveal`/`drawer` sidebar out, or lets it fall back. */\n setSidebarRevealed(isRevealed: boolean): void;\n\n /** Pins or unpins a `reveal`/`drawer` sidebar. */\n toggleSidebarAnchor(): void;\n}\n\nconst LayoutConfigContext = createContext<LayoutConfigContextValue | undefined>(undefined);\n\nexport interface LayoutConfigProviderProps {\n /** Values to start from, overriding both the defaults and anything persisted - a story or a spec pinning a mode. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /**\n * Where preferences are read from and written to. Defaults to `window.localStorage` when there is a\n * window; pass a fake in a spec, or `null` to opt out of persistence entirely.\n */\n storage?: Storage | null;\n\n /**\n * The width the shell should consider its viewport, for a host that renders it into a sized element\n * rather than the window - Studio's preview surface, where the device frame is a few hundred pixels\n * wide while the real window is a desktop one. When given, this replaces the `matchMedia` listener\n * entirely rather than competing with it.\n */\n viewportWidth?: number;\n\n /** The shell this configuration applies to. */\n children?: ReactNode;\n}\n\n/**\n * Owns the shell's configuration and keeps it in step with the viewport and with `localStorage`.\n *\n * One provider rather than state per shell component is what makes the modes work at all: the topbar's\n * toggle, the sidebar's pin, the mask's click-to-close and the configurator's mode picker are four\n * different components acting on one machine. It is also what makes a chosen mode survive a reload, which\n * is the whole reason a mode picker is worth having.\n */\nexport function LayoutConfigProvider({ initialConfig, storage, viewportWidth, children }: LayoutConfigProviderProps) {\n const resolvedStorage = useMemo(() => (storage !== undefined ? storage ?? undefined : defaultStorage()), [storage]);\n const [config, setConfig] = useState<LayoutConfigState>(() => ({\n ...readPersistedLayoutConfig(resolvedStorage),\n ...initialConfig,\n }));\n\n useEffect(() => {\n persistLayoutConfig(config, resolvedStorage);\n }, [config, resolvedStorage]);\n\n const isReportedMobile = viewportWidth === undefined ? undefined : isMobileWidth(viewportWidth);\n useEffect(() => {\n if (isReportedMobile !== undefined) {\n setConfig(current => withMobile(current, isReportedMobile));\n return;\n }\n\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {\n return;\n }\n\n const query = window.matchMedia(mobileMediaQuery);\n setConfig(current => withMobile(current, query.matches));\n\n const listener = (event: MediaQueryListEvent) => setConfig(current => withMobile(current, event.matches));\n query.addEventListener('change', listener);\n return () => query.removeEventListener('change', listener);\n }, [isReportedMobile]);\n\n const value = useMemo<LayoutConfigContextValue>(\n () => ({\n config,\n effectiveMode: effectiveLayoutMode(config),\n wrapperClasses: layoutWrapperClasses(config),\n isMaskVisible: isLayoutMaskVisible(config),\n setMode: mode => setConfig(current => withMode(current, mode)),\n setMenuTheme: menuTheme => setConfig(current => withMenuTheme(current, menuTheme)),\n setColorScheme: colorScheme => setConfig(current => withColorScheme(current, colorScheme)),\n setThemeName: themeName => setConfig(current => withThemeName(current, themeName)),\n setSidebarOpen: isOpen => setConfig(current => withSidebarOpen(current, isOpen)),\n toggleSidebar: () => setConfig(toggleSidebar),\n setSidebarRevealed: isRevealed => setConfig(current => withSidebarRevealed(current, isRevealed)),\n toggleSidebarAnchor: () => setConfig(toggleSidebarAnchor),\n }),\n [config],\n );\n\n return <LayoutConfigContext.Provider value={value}>{children}</LayoutConfigContext.Provider>;\n}\n\n/**\n * The shell configuration, or `undefined` when there is no {@link LayoutConfigProvider} above.\n *\n * This is what lets the shell components put a provider around themselves when a host has not - a gallery\n * preview drops a single `appShell` element into a renderer with no wrapper of its own, and it still has\n * to work.\n */\nexport function useOptionalLayoutConfig(): LayoutConfigContextValue | undefined {\n return useContext(LayoutConfigContext);\n}\n\n/**\n * The shell configuration. Throws when there is no {@link LayoutConfigProvider} above, because every\n * alternative - a silent default, a no-op setter - produces a shell whose buttons do nothing and says\n * nothing about why.\n */\nexport function useLayoutConfig(): LayoutConfigContextValue {\n const value = useOptionalLayoutConfig();\n if (!value) {\n throw new Error('useLayoutConfig() requires a <LayoutConfigProvider> above it.');\n }\n\n return value;\n}\n\nfunction defaultStorage(): Storage | undefined {\n return typeof window !== 'undefined' ? window.localStorage : undefined;\n}\n"],"names":["LayoutConfigContext","createContext","undefined","LayoutConfigProvider","initialConfig","storage","viewportWidth","children","resolvedStorage","useMemo","defaultStorage","config","setConfig","useState","readPersistedLayoutConfig","useEffect","persistLayoutConfig","isReportedMobile","isMobileWidth","current","withMobile","window","matchMedia","query","mobileMediaQuery","matches","listener","event","addEventListener","removeEventListener","value","effectiveMode","effectiveLayoutMode","wrapperClasses","layoutWrapperClasses","isMaskVisible","isLayoutMaskVisible","setMode","mode","withMode","setMenuTheme","menuTheme","withMenuTheme","setColorScheme","colorScheme","withColorScheme","setThemeName","themeName","withThemeName","setSidebarOpen","isOpen","withSidebarOpen","toggleSidebar","setSidebarRevealed","isRevealed","withSidebarRevealed","toggleSidebarAnchor","_jsx","Provider","useOptionalLayoutConfig","useContext","useLayoutConfig","Error","localStorage"],"mappings":";;;;;;;;AAuEA,MAAMA,oCAAsBC,mBAAAA,CAAoDC,SAAAA,CAAAA;AAwBhF;;;;;;;IAQO,SAASC,oBAAAA,CAAqB,EAAEC,aAAa,EAAEC,OAAO,EAAEC,aAAa,EAAEC,QAAQ,EAA6B,EAAA;AAC/G,IAAA,MAAMC,kBAAkBC,aAAAA,CAAQ,IAAOJ,YAAYH,SAAAA,GAAYG,OAAAA,IAAWH,YAAYQ,cAAAA,EAAAA,EAAmB;AAACL,QAAAA;AAAQ,KAAA,CAAA;AAClH,IAAA,MAAM,CAACM,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,cAAAA,CAA4B,KAAO;AAC3D,YAAA,GAAGC,8CAA0BN,eAAAA,CAAgB;AAC7C,YAAA,GAAGJ;SACP,CAAA,CAAA;IAEAW,eAAAA,CAAU,IAAA;AACNC,QAAAA,uCAAAA,CAAoBL,MAAAA,EAAQH,eAAAA,CAAAA;IAChC,CAAA,EAAG;AAACG,QAAAA,MAAAA;AAAQH,QAAAA;AAAgB,KAAA,CAAA;AAE5B,IAAA,MAAMS,gBAAAA,GAAmBX,aAAAA,KAAkBJ,SAAAA,GAAYA,SAAAA,GAAYgB,qCAAAA,CAAcZ,aAAAA,CAAAA;I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IAAIgC,KAAAA,CAAM,+DAAA,CAAA;AACpB,IAAA;IAEA,OAAOhC,KAAAA;AACX;AAEA,SAASpB,cAAAA,GAAAA;AACL,IAAA,OAAO,OAAOW,MAAAA,KAAW,WAAA,GAAcA,MAAAA,CAAO0C,YAAY,GAAG7D,SAAAA;AACjE;;;;"}
@@ -1 +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;;;;;;;;;;;;;;"}
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;;;;;;;;;;;;"}
@@ -1 +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;;;;;;;;;"}
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;;;;;;;"}
@@ -1 +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,OA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"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,QAA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sB,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;;;;"}
@@ -1 +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,mBAA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EH,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;;;;;;;;;;;;;;;;;;;;"}
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,KA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a,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;;;;;;;;;;;;;;;;;;"}
@@ -1 +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","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AAMW,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;;;;;"}
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;;;"}
@@ -1 +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 license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\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","license","licenseUrl","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,iCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU7B,wBAAAA;IACVQ,UAAAA,EAAYsB,qDAAAA;IACZlB,OAAAA,EAASmB,6BAAAA;IACTjB,eAAAA,EAAiBC,8BAAAA;IACjBG,eAAAA,EAAiBC,sCAAAA;IACjBa,OAAAA,EAASC,sBAAAA;IACTb,MAAAA,EAAQC;AACZ;;;;;"}
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 license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\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","license","licenseUrl","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,iCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;UAWaC,gBAAAA,GAAuC;IAChDC,QAAAA,EAAU7B,wBAAAA;IACVQ,UAAAA,EAAYsB,qDAAAA;IACZlB,OAAAA,EAASmB,6BAAAA;IACTjB,eAAAA,EAAiBC,8BAAAA;IACjBG,eAAAA,EAAiBC,sCAAAA;IACjBa,OAAAA,EAASC,sBAAAA;IACTb,MAAAA,EAAQC;AACZ;;;"}
@@ -1 +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","LayoutModeSwitc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IA,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;;;;"}
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;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"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 { useMemo } from 'react';\nimport { Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","element","useMemo","screen","galleryScreen","Error","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;;;;AAcA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,0BAAc;AAAE,IAAA,GAAGC;AAA2B;AAgB5G;;;;;;;;;;;;AAYC,IACM,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAAA,GAASC,6CAAsB,EAAEC,QAAAA,GAAWR,sBAAsB,EAA6B,EAAA;AAC7J,IAAA,MAAMS,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,qBAAAA,CAAcR,UAAAA,CAAAA;AAC7B,QAAA,IAAI,CAACO,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAET,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;QAEA,OAAOU,gDAAAA,CAA6BC,kCAAAA,CAAqBJ,MAAAA,CAAAA,EAASK,oCAAAA,EAAuBC,sCAAAA,CAAAA;IAC7F,CAAA,EAAG;AAACb,QAAAA;AAAW,KAAA,CAAA;AAEf,IAAA,qBACIc,cAAA,CAACC,yCAAAA,EAAAA;QAAqBd,aAAAA,EAAeA,aAAAA;QAAee,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,uCAAAA,EAAAA;YAAoBf,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAY,cAAA,CAACI,4BAAAA,EAAAA;gBAAiBb,OAAAA,EAASA,OAAAA;gBAASD,QAAAA,EAAUA,QAAAA;AAAUe,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;;;;"}
1
+ {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"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 { useMemo } from 'react';\nimport { Theme } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { LayoutConfigProvider, LayoutConfigState } from '../configuration';\nimport { defaultBlueprintComponents } from '../defaultBlueprintComponents';\nimport { LayoutThemeProvider, defaultBlueprintThemes } from '../themes';\nimport { composeScreenElement } from './composeScreen';\nimport { galleryComponentCatalog, galleryPreviewProfile } from './previewProfile';\nimport { resolveElementComponentNames } from './resolveElementNames';\nimport { galleryScreen } from './screens';\n\n/**\n * The registry a preview resolves against when a host does not supply one: `core` plus this blueprint.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n */\nexport const galleryPreviewRegistry: ComponentRegistry = { ...coreComponents, ...defaultBlueprintComponents };\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The themes the configurator may switch between. Defaults to the two this blueprint ships. */\n themes?: Theme[];\n\n /** The component registry to render against. Defaults to `core` plus this blueprint's own components. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real {@link Screen}, its element tree is resolved by\n * the real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real\n * registry. That is the point of shipping a gallery at all - a mockup proves that someone can draw a\n * dashboard, and this proves the blueprint renders one.\n *\n * Component names belonging to packages the host has not loaded resolve but find no implementation, and\n * come out as `UnresolvedComponent`'s dashed red box naming what is missing. That is the designed outcome:\n * a preview of a blueprint against half a profile should look visibly incomplete rather than quietly\n * wrong.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, themes = defaultBlueprintThemes, registry = galleryPreviewRegistry }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = galleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), galleryPreviewProfile, galleryComponentCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={themes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["galleryPreviewRegistry","coreComponents","defaultBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","themes","defaultBlueprintThemes","registry","element","useMemo","screen","galleryScreen","Error","resolveElementComponentNames","composeScreenElement","galleryPreviewProfile","galleryComponentCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;;;;AAcA;;;;;;UAOaA,sBAAAA,GAA4C;AAAE,IAAA,GAAGC,0BAAc;AAAE,IAAA,GAAGC;AAA2B;AAgB5G;;;;;;;;;;;;AAYC,IACM,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,MAAAA,GAASC,6CAAsB,EAAEC,QAAAA,GAAWR,sBAAsB,EAA6B,EAAA;AAC7J,IAAA,MAAMS,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,qBAAAA,CAAcR,UAAAA,CAAAA;AAC7B,QAAA,IAAI,CAACO,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAET,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;QAEA,OAAOU,gDAAAA,CAA6BC,kCAAAA,CAAqBJ,MAAAA,CAAAA,EAASK,oCAAAA,EAAuBC,sCAAAA,CAAAA;IAC7F,CAAA,EAAG;AAACb,QAAAA;AAAW,KAAA,CAAA;AAEf,IAAA,qBACIc,cAAA,CAACC,yCAAAA,EAAAA;QAAqBd,aAAAA,EAAeA,aAAAA;QAAee,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,uCAAAA,EAAAA;YAAoBf,MAAAA,EAAQA,MAAAA;AACzB,YAAA,QAAA,gBAAAY,cAAA,CAACI,4BAAAA,EAAAA;gBAAiBb,OAAAA,EAASA,OAAAA;gBAASD,QAAAA,EAAUA,QAAAA;AAAUe,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateSlotName.js","sources":["../../../gallery/TemplateSlotName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The slots the gallery's screen templates offer to whatever they contain.\n *\n * Distinct from {@link SlotName}, which is the *layout's* vocabulary. A screen template declares its own\n * slots, and a template nested inside it names one of these in `fitsSlot` - so the same name means\n * different places at different depths, and that is fine: `fitsSlot` is always resolved against the direct\n * parent, never globally.\n */\nexport enum TemplateSlotName {\n /** A template's own title area. */\n Header = 'header',\n\n /** The main region a nested template fits into. */\n Body = 'body',\n\n /** An optional column beside the body. */\n SidePanel = 'sidePanel',\n\n /** The action strip above a body. */\n Toolbar = 'toolbar',\n\n /** Buttons belonging to a header or a form. */\n Actions = 'actions',\n\n /** The row of figures a dashboard opens with. */\n Stats = 'stats',\n\n /** The larger left-hand column of a dashboard. */\n Primary = 'primary',\n\n /** The narrower right-hand column of a dashboard. */\n Secondary = 'secondary',\n}\n"],"names":["TemplateSlotName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,gBAAAA,iBAAAA,SAAAA,gBAAAA,EAAAA;wCACyB,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wDAGgB,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAA;+CAGT,gBAAA,CAAA,WAAA,CAAA,GAAA,WAAA;0CAGL,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;oDAGU,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;sDAGE,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAA;uDAGC,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;0DAGG,gBAAA,CAAA,WAAA,CAAA,GAAA,WAAA;AAtB3CA,IAAAA,OAAAA,gBAAAA;AAwBX,CAAA,CAAA,EAAA;;;;"}
1
+ {"version":3,"file":"TemplateSlotName.js","sources":["../../../gallery/TemplateSlotName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The slots the gallery's screen templates offer to whatever they contain.\n *\n * Distinct from {@link SlotName}, which is the *layout's* vocabulary. A screen template declares its own\n * slots, and a template nested inside it names one of these in `fitsSlot` - so the same name means\n * different places at different depths, and that is fine: `fitsSlot` is always resolved against the direct\n * parent, never globally.\n */\nexport enum TemplateSlotName {\n /** A template's own title area. */\n Header = 'header',\n\n /** The main region a nested template fits into. */\n Body = 'body',\n\n /** An optional column beside the body. */\n SidePanel = 'sidePanel',\n\n /** The action strip above a body. */\n Toolbar = 'toolbar',\n\n /** Buttons belonging to a header or a form. */\n Actions = 'actions',\n\n /** The row of figures a dashboard opens with. */\n Stats = 'stats',\n\n /** The larger left-hand column of a dashboard. */\n Primary = 'primary',\n\n /** The narrower right-hand column of a dashboard. */\n Secondary = 'secondary',\n}\n"],"names":["TemplateSlotName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,IAAKA,gBAAAA,iBAAAA,SAAAA,gBAAAA,EAAAA;wCACyB,gBAAA,CAAA,QAAA,CAAA,GAAA,QAAA;wDAGgB,gBAAA,CAAA,MAAA,CAAA,GAAA,MAAA;+CAGT,gBAAA,CAAA,WAAA,CAAA,GAAA,WAAA;0CAGL,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;oDAGU,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;sDAGE,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAA;uDAGC,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAA;0DAGG,gBAAA,CAAA,WAAA,CAAA,GAAA,WAAA;AAtB3CA,IAAAA,OAAAA,gBAAAA;AAwBX,CAAA,CAAA,EAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.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 { SceneElement } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { defaultBlueprintThemes } from '../themes';\nimport { externalComponent } from './elements';\nimport { entriesInGroup, navigationElement, navigationGroups } from './navigation';\n\n/**\n * The chrome every screen in the application shell shares: the topbar, the sidebar, the menu, the footer\n * and the configurator.\n *\n * It is built once, per screen, rather than repeated in twenty templates. A screen template describes what\n * is *different* about a screen; if it also had to describe the topbar, then adding an item to the menu\n * would mean editing twenty files, and nineteen of them would eventually be missed.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, ComponentName.Logo, { label: 'Contoso', initials: 'C', targetScreen: 'Dashboard' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return navigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n ComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationElement(entry, activeScreen)) },\n ),\n );\n}\n\n/** The configurator, offering the themes this blueprint ships. */\nfunction configPanel(): SceneElement {\n return externalComponent(ComponentName.ConfigPanel, ComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/** One trail entry: a label, and the screen it goes back to. */\nexport interface BreadcrumbEntry {\n /** What the entry is called. */\n label: string;\n\n /** The screen it navigates back to, or undefined for the current page. */\n targetScreen?: string;\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is the point of chrome.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current.\n * @param breadcrumb The trail above the content.\n * @returns Slot content keyed by the {@link SlotName}s the `AppShell` layout declares.\n */\nexport function applicationChrome(activeScreen: string, breadcrumb: BreadcrumbEntry[]): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n ComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n externalComponent('topbar-user', ComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Owner',\n initials: 'AN',\n items: [\n { label: 'Your profile', icon: 'pi pi-user', targetScreen: 'ProfileSettings' },\n { label: 'Help', icon: 'pi pi-question-circle', targetScreen: 'Help' },\n { label: 'Lock', icon: 'pi pi-lock', targetScreen: 'LockScreen' },\n ],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', ComponentName.Sidebar, { title: 'Contoso' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', ComponentName.Breadcrumb, {\n homeTargetScreen: 'Dashboard',\n items: breadcrumb,\n }),\n ],\n [SlotName.Footer]: [externalComponent('footer', ComponentName.Footer, { text: '© Contoso · Built with Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n\n/**\n * The full-page shell's slot content: the configurator and nothing else.\n *\n * A sign-in screen has no navigation to render, but it does have to honor the chosen theme - it is very\n * often the first page anyone sees, and arriving at a light sign-in page before a dark application is a\n * jarring way to start.\n */\nexport function fullPageChrome(): Record<string, SceneElement[]> {\n return { [SlotName.ConfigPanel]: [configPanel()] };\n}\n"],"names":["logo","id","externalComponent","ComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","navigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationElement","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","applicationChrome","breadcrumb","SlotName","Topbar","end","UserMenu","role","icon","Sidebar","Breadcrumb","homeTargetScreen","Footer","text","fullPageChrome"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,wEAGD,SAASA,IAAAA,CAAKC,EAAU,EAAA;AACpB,IAAA,OAAOC,0BAAAA,CAAkBD,EAAAA,EAAIE,2BAAAA,CAAcC,IAAI,EAAE;QAAEC,KAAAA,EAAO,SAAA;QAAWC,QAAAA,EAAU,GAAA;QAAKC,YAAAA,EAAc;AAAY,KAAA,CAAA;AAClH;AAEA,iFACA,SAASC,YAAAA,CAAaC,YAAoB,EAAA;AACtC,IAAA,OAAOC,2BAAAA,CAAiBC,GAAG,CAACC,CAAAA,QACxBV,0BAAAA,CACI,CAAC,KAAK,EAAEU,MAAMC,WAAW,EAAA,CAAA,CAAI,EAC7BV,2BAAAA,CAAcW,IAAI,EAClB;YAAEC,KAAAA,EAAOH,KAAAA;YAAOP,KAAAA,EAAOO;SAAM,EAC7B;AAAEI,YAAAA,KAAAA,EAAOC,0BAAeL,KAAAA,CAAAA,CAAOD,GAAG,CAACO,CAAAA,KAAAA,GAASC,6BAAkBD,KAAAA,EAAOT,YAAAA,CAAAA;AAAe,SAAA,CAAA,CAAA;AAGhG;AAEA,mEACA,SAASW,WAAAA,GAAAA;AACL,IAAA,OA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,SAAA,EAAWC,2BAAAA,CAAcgC,OAAO,EAAE;gBAAEpB,KAAAA,EAAO;aAAU,EAAG;gBAAEf,IAAAA,EAAM;oBAACA,IAAAA,CAAK,cAAA;AAAgB;AAAC,aAAA;AAAG,SAAA;AACjI,QAAA,CAAC6B,iBAAAA,CAASf,IAAI,GAAGN,YAAAA,CAAaC,YAAAA,CAAAA;QAC9B,CAACoB,iBAAAA,CAASO,UAAU,GAAG;YACnBlC,0BAAAA,CAAkB,YAAA,EAAcC,2BAAAA,CAAciC,UAAU,EAAE;gBACtDC,gBAAAA,EAAkB,WAAA;gBAClBrB,KAAAA,EAAOY;AACX,aAAA;AACH,SAAA;QACD,CAACC,iBAAAA,CAASS,MAAM,GAAG;YAACpC,0BAAAA,CAAkB,QAAA,EAAUC,2BAAAA,CAAcmC,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAsC,aAAA;AAAG,SAAA;QACvH,CAACV,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ;AAEA;;;;;;AAMC,IACM,SAASoB,cAAAA,GAAAA;IACZ,OAAO;QAAE,CAACX,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAAC,KAAA;AACrD;;;;;"}
1
+ {"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.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 { SceneElement } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { defaultBlueprintThemes } from '../themes';\nimport { externalComponent } from './elements';\nimport { entriesInGroup, navigationElement, navigationGroups } from './navigation';\n\n/**\n * The chrome every screen in the application shell shares: the topbar, the sidebar, the menu, the footer\n * and the configurator.\n *\n * It is built once, per screen, rather than repeated in twenty templates. A screen template describes what\n * is *different* about a screen; if it also had to describe the topbar, then adding an item to the menu\n * would mean editing twenty files, and nineteen of them would eventually be missed.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, ComponentName.Logo, { label: 'Contoso', initials: 'C', targetScreen: 'Dashboard' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return navigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n ComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationElement(entry, activeScreen)) },\n ),\n );\n}\n\n/** The configurator, offering the themes this blueprint ships. */\nfunction configPanel(): SceneElement {\n return externalComponent(ComponentName.ConfigPanel, ComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/** One trail entry: a label, and the screen it goes back to. */\nexport interface BreadcrumbEntry {\n /** What the entry is called. */\n label: string;\n\n /** The screen it navigates back to, or undefined for the current page. */\n targetScreen?: string;\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is the point of chrome.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current.\n * @param breadcrumb The trail above the content.\n * @returns Slot content keyed by the {@link SlotName}s the `AppShell` layout declares.\n */\nexport function applicationChrome(activeScreen: string, breadcrumb: BreadcrumbEntry[]): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n ComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n externalComponent('topbar-user', ComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Owner',\n initials: 'AN',\n items: [\n { label: 'Your profile', icon: 'pi pi-user', targetScreen: 'ProfileSettings' },\n { label: 'Help', icon: 'pi pi-question-circle', targetScreen: 'Help' },\n { label: 'Lock', icon: 'pi pi-lock', targetScreen: 'LockScreen' },\n ],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', ComponentName.Sidebar, { title: 'Contoso' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', ComponentName.Breadcrumb, {\n homeTargetScreen: 'Dashboard',\n items: breadcrumb,\n }),\n ],\n [SlotName.Footer]: [externalComponent('footer', ComponentName.Footer, { text: '© Contoso · Built with Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n\n/**\n * The full-page shell's slot content: the configurator and nothing else.\n *\n * A sign-in screen has no navigation to render, but it does have to honor the chosen theme - it is very\n * often the first page anyone sees, and arriving at a light sign-in page before a dark application is a\n * jarring way to start.\n */\nexport function fullPageChrome(): Record<string, SceneElement[]> {\n return { [SlotName.ConfigPanel]: [configPanel()] };\n}\n"],"names":["logo","id","externalComponent","ComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","navigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationElement","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","applicationChrome","breadcrumb","SlotName","Topbar","end","UserMenu","role","icon","Sidebar","Breadcrumb","homeTargetScreen","Footer","text","fullPageChrome"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,wEAGD,SAASA,IAAAA,CAAKC,EAAU,EAAA;AACpB,IAAA,OAAOC,0BAAAA,CAAkBD,EAAAA,EAAIE,2BAAAA,CAAcC,IAAI,EAAE;QAAEC,KAAAA,EAAO,SAAA;QAAWC,QAAAA,EAAU,GAAA;QAAKC,YAAAA,EAAc;AAAY,KAAA,CAAA;AAClH;AAEA,iFACA,SAASC,YAAAA,CAAaC,YAAoB,EAAA;AACtC,IAAA,OAAOC,2BAAAA,CAAiBC,GAAG,CAACC,CAAAA,QACxBV,0BAAAA,CACI,CAAC,KAAK,EAAEU,MAAMC,WAAW,EAAA,CA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AAC7E,4BAAA;gCAAEF,KAAAA,EAAO,MAAA;gCAAQ6B,IAAAA,EAAM,uBAAA;gCAAyB3B,YAAAA,EAAc;AAAO,6BAAA;AACrE,4BAAA;gCAAEF,KAAAA,EAAO,MAAA;gCAAQ6B,IAAAA,EAAM,YAAA;gCAAc3B,YAAAA,EAAc;AAAa;AACnE;AACL,qBAAA;AACH;AACL,aAAA;AAEP,SAAA;QACD,CAACsB,iBAAAA,CAASM,OAAO,GAAG;YAACjC,0BAAAA,CAAkB,SAAA,EAAWC,2BAAAA,CAAcgC,OAAO,EAAE;gBAAEpB,KAAAA,EAAO;aAAU,EAAG;gBAAEf,IAAAA,EAAM;oBAACA,IAAAA,CAAK,cAAA;AAAgB;AAAC,aAAA;AAAG,SAAA;AACjI,QAAA,CAAC6B,iBAAAA,CAASf,IAAI,GAAGN,YAAAA,CAAaC,YAAAA,CAAAA;QAC9B,CAACoB,iBAAAA,CAASO,UAAU,GAAG;YACnBlC,0BAAAA,CAAkB,YAAA,EAAcC,2BAAAA,CAAciC,UAAU,EAAE;gBACtDC,gBAAAA,EAAkB,WAAA;gBAClBrB,KAAAA,EAAOY;AACX,aAAA;AACH,SAAA;QACD,CAACC,iBAAAA,CAASS,MAAM,GAAG;YAACpC,0BAAAA,CAAkB,QAAA,EAAUC,2BAAAA,CAAcmC,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAsC,aAAA;AAAG,SAAA;QACvH,CAACV,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ;AAEA;;;;;;AAMC,IACM,SAASoB,cAAAA,GAAAA;IACZ,OAAO;QAAE,CAACX,iBAAAA,CAASR,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAAC,KAAA;AACrD;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"authTemplates.js","sources":["../../../gallery/authTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions } from './widgets';\n\n/**\n * The six screens that stand between someone and the application: sign in, register, forgotten password,\n * new password, verification and the lock screen.\n *\n * All six fit the full-page layout's `content` slot and fill its `aside` with the branding half. That\n * split - a colored panel of brand next to a narrow column of form - is the shape the premium PrimeTek\n * templates use for every one of them, and the reason it works is that it gives the form somewhere to be\n * *small*, which is what a sign-in form should be.\n */\n\n/** The branding half every authentication screen shares. */\nfunction brandingAside(id: string, headline: string, supporting: string) {\n return [\n externalComponent(`${id}-logo`, ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n text(`${id}-headline`, headline),\n text(`${id}-supporting`, supporting),\n ];\n}\n\n/** Sign in. */\nexport const loginTemplate: ScreenTemplate = {\n name: 'Login',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('login', 'Welcome back', 'Everything your team shipped since you were last here is waiting.'),\n [TemplateSlotName.Body]: [\n card('login-card', [\n text('login-title', 'Sign in'),\n field('login-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('login-password', 'Password', 'password', { feedback: false }),\n field('login-remember', 'Keep me signed in', 'checkbox', {}),\n formActions('login-actions', 'Sign in', 'Use a different account'),\n button('login-forgot', 'I forgot my password', { link: true, targetScreen: 'ForgotPassword' }),\n ]),\n ],\n },\n displayName: 'Sign in',\n description: 'Email and password beside the branding panel.',\n};\n\n/** Register. */\nexport const registerTemplate: ScreenTemplate = {\n name: 'Register',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('register', 'Start in two minutes', 'No card, no call, no sales engineer. Just an account.'),\n [TemplateSlotName.Body]: [\n card('register-card', [\n text('register-title', 'Create your account'),\n field('register-name', 'Full name', 'inputText', {}),\n field('register-email', 'Work email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('register-password', 'Password', 'password', { feedback: true }),\n field('register-terms', 'I accept the terms of service', 'checkbox', {}),\n formActions('register-actions', 'Create account', 'I already have one'),\n ]),\n ],\n },\n displayName: 'Register',\n description: 'Account creation with a password strength meter and the terms checkbox.',\n};\n\n/** Forgotten password: ask for the address. */\nexport const forgotPasswordTemplate: ScreenTemplate = {\n name: 'ForgotPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('forgot', 'It happens', 'Tell us the address you signed up with and we will send a link.'),\n [TemplateSlotName.Body]: [\n card('forgot-card', [\n text('forgot-title', 'Reset your password'),\n field('forgot-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n formActions('forgot-actions', 'Send the link', 'Back to sign in'),\n ]),\n ],\n },\n displayName: 'Forgotten password',\n description: 'One field and one button - the whole point is that it asks for nothing else.',\n};\n\n/** New password: the other end of the link. */\nexport const newPasswordTemplate: ScreenTemplate = {\n name: 'NewPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('new-password', 'Almost there', 'Choose something you have not used anywhere else.'),\n [TemplateSlotName.Body]: [\n card('new-password-card', [\n text('new-password-title', 'Choose a new password'),\n field('new-password-value', 'New password', 'password', { feedback: true }),\n field('new-password-confirm', 'Confirm it', 'password', { feedback: false }),\n formActions('new-password-actions', 'Set the password', 'Cancel'),\n ]),\n ],\n },\n displayName: 'New password',\n description: 'Where a reset link lands: choose it, confirm it, done.',\n};\n\n/** Verification: the code from the email. */\nexport const verificationTemplate: ScreenTemplate = {\n name: 'Verification',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('verification', 'Check your email', 'We sent a six-digit code. It expires in ten minutes.'),\n [TemplateSlotName.Body]: [\n card('verification-card', [\n text('verification-title', 'Enter the code'),\n externalComponent('verification-steps', 'steps', { model: ['Account', 'Verify', 'Done'], activeIndex: 1 }),\n field('verification-code', 'Six-digit code', 'inputText', { maxLength: 6 }),\n formActions('verification-actions', 'Verify', 'Send it again'),\n ]),\n ],\n },\n displayName: 'Verification',\n description: 'The code step, with the progress indicator that tells you how much is left.',\n};\n\n/** Lock screen: the session is still there, the person has to prove they are. */\nexport const lockScreenTemplate: ScreenTemplate = {\n name: 'LockScreen',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('lock', 'Locked', 'Your work is exactly where you left it.'),\n [TemplateSlotName.Body]: [\n card('lock-card', [\n externalComponent('lock-avatar', 'avatar', { label: 'AN', size: 'xlarge', shape: 'circle' }),\n text('lock-name', 'Amelia Nyquist'),\n field('lock-password', 'Password', 'password', { feedback: false }),\n formActions('lock-actions', 'Unlock', 'Sign in as someone else'),\n ]),\n ],\n },\n displayName: 'Lock screen',\n description: 'One person, one password, and no way to lose what was open.',\n};\n\n/** The six authentication templates. */\nexport const authTemplates: ScreenTemplate[] = [\n loginTemplate,\n registerTemplate,\n forgotPasswordTemplate,\n newPasswordTemplate,\n verificationTemplate,\n lockScreenTemplate,\n];\n"],"names":["brandingAside","id","headline","supporting","externalComponent","ComponentName","Logo","label","initials","text","loginTemplate","name","fitsSlot","SlotName","Content","slots","Aside","TemplateSlotName","Body","content","card","field","placeholder","feedback","formActions","button","link","targetScreen","displayName","description","registerTemplate","forgotPasswordTemplate","newPasswordTemplate","verificationTemplate","model","activeIndex","maxLength","lockScreenTemplate","size","shape","authTemplates"],"mappings":";;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;;iEAWA,SAASA,aAAAA,CAAcC,EAAU,EAAEC,QAAgB,EAAEC,UAAkB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AA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAME,kBAASG;AAAM,SAAA;AAAG,QAAA;AAAEL,YAAAA,IAAAA,EAAMM,kCAAiBC;AAAK;AAAE,KAAA;IAClEC,OAAAA,EAAS;AACL,QAAA,CAACN,kBAASG,KAAK,GAAGhB,aAAAA,CAAc,QAAQ,QAAA,EAAU,yCAAA,CAAA;QAClD,CAACiB,iCAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAK,WAAA,EAAa;AACdhB,gBAAAA,0BAAAA,CAAkB,eAAe,QAAA,EAAU;oBAAEG,KAAAA,EAAO,IAAA;oBAAM+B,IAAAA,EAAM,QAAA;oBAAUC,KAAAA,EAAO;AAAS,iBAAA,CAAA;AAC1F9B,gBAAAA,aAAAA,CAAK,WAAA,EAAa,gBAAA,CAAA;gBAClBY,aAAAA,CAAM,eAAA,EAAiB,YAAY,UAAA,EAAY;oBAAEE,QAAAA,EAAU;AAAM,iBAAA,CAAA;AACjEC,gBAAAA,mBAAAA,CAAY,gBAAgB,QAAA,EAAU,yBAAA;AACzC,aAAA;AACJ;AACL,KAAA;IACAI,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,yCACO,MAAMW,aAAAA,GAAkC;AAC3C9B,IAAAA,aAAAA;AACAoB,IAAAA,gBAAAA;AACAC,IAAAA,sBAAAA;AACAC,IAAAA,mBAAAA;AACAC,IAAAA,oBAAAA;AACAI,IAAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"authTemplates.js","sources":["../../../gallery/authTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate } from '@cratis/scene.model';\nimport { ComponentName } from '../ComponentName';\nimport { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions } from './widgets';\n\n/**\n * The six screens that stand between someone and the application: sign in, register, forgotten password,\n * new password, verification and the lock screen.\n *\n * All six fit the full-page layout's `content` slot and fill its `aside` with the branding half. That\n * split - a colored panel of brand next to a narrow column of form - is the shape the premium PrimeTek\n * templates use for every one of them, and the reason it works is that it gives the form somewhere to be\n * *small*, which is what a sign-in form should be.\n */\n\n/** The branding half every authentication screen shares. */\nfunction brandingAside(id: string, headline: string, supporting: string) {\n return [\n externalComponent(`${id}-logo`, ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n text(`${id}-headline`, headline),\n text(`${id}-supporting`, supporting),\n ];\n}\n\n/** Sign in. */\nexport const loginTemplate: ScreenTemplate = {\n name: 'Login',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('login', 'Welcome back', 'Everything your team shipped since you were last here is waiting.'),\n [TemplateSlotName.Body]: [\n card('login-card', [\n text('login-title', 'Sign in'),\n field('login-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('login-password', 'Password', 'password', { feedback: false }),\n field('login-remember', 'Keep me signed in', 'checkbox', {}),\n formActions('login-actions', 'Sign in', 'Use a different account'),\n button('login-forgot', 'I forgot my password', { link: true, targetScreen: 'ForgotPassword' }),\n ]),\n ],\n },\n displayName: 'Sign in',\n description: 'Email and password beside the branding panel.',\n};\n\n/** Register. */\nexport const registerTemplate: ScreenTemplate = {\n name: 'Register',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('register', 'Start in two minutes', 'No card, no call, no sales engineer. Just an account.'),\n [TemplateSlotName.Body]: [\n card('register-card', [\n text('register-title', 'Create your account'),\n field('register-name', 'Full name', 'inputText', {}),\n field('register-email', 'Work email', 'inputText', { placeholder: 'you@contoso.com' }),\n field('register-password', 'Password', 'password', { feedback: true }),\n field('register-terms', 'I accept the terms of service', 'checkbox', {}),\n formActions('register-actions', 'Create account', 'I already have one'),\n ]),\n ],\n },\n displayName: 'Register',\n description: 'Account creation with a password strength meter and the terms checkbox.',\n};\n\n/** Forgotten password: ask for the address. */\nexport const forgotPasswordTemplate: ScreenTemplate = {\n name: 'ForgotPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('forgot', 'It happens', 'Tell us the address you signed up with and we will send a link.'),\n [TemplateSlotName.Body]: [\n card('forgot-card', [\n text('forgot-title', 'Reset your password'),\n field('forgot-email', 'Email', 'inputText', { placeholder: 'you@contoso.com' }),\n formActions('forgot-actions', 'Send the link', 'Back to sign in'),\n ]),\n ],\n },\n displayName: 'Forgotten password',\n description: 'One field and one button - the whole point is that it asks for nothing else.',\n};\n\n/** New password: the other end of the link. */\nexport const newPasswordTemplate: ScreenTemplate = {\n name: 'NewPassword',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('new-password', 'Almost there', 'Choose something you have not used anywhere else.'),\n [TemplateSlotName.Body]: [\n card('new-password-card', [\n text('new-password-title', 'Choose a new password'),\n field('new-password-value', 'New password', 'password', { feedback: true }),\n field('new-password-confirm', 'Confirm it', 'password', { feedback: false }),\n formActions('new-password-actions', 'Set the password', 'Cancel'),\n ]),\n ],\n },\n displayName: 'New password',\n description: 'Where a reset link lands: choose it, confirm it, done.',\n};\n\n/** Verification: the code from the email. */\nexport const verificationTemplate: ScreenTemplate = {\n name: 'Verification',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('verification', 'Check your email', 'We sent a six-digit code. It expires in ten minutes.'),\n [TemplateSlotName.Body]: [\n card('verification-card', [\n text('verification-title', 'Enter the code'),\n externalComponent('verification-steps', 'steps', { model: ['Account', 'Verify', 'Done'], activeIndex: 1 }),\n field('verification-code', 'Six-digit code', 'inputText', { maxLength: 6 }),\n formActions('verification-actions', 'Verify', 'Send it again'),\n ]),\n ],\n },\n displayName: 'Verification',\n description: 'The code step, with the progress indicator that tells you how much is left.',\n};\n\n/** Lock screen: the session is still there, the person has to prove they are. */\nexport const lockScreenTemplate: ScreenTemplate = {\n name: 'LockScreen',\n fitsSlot: SlotName.Content,\n slots: [{ name: SlotName.Aside }, { name: TemplateSlotName.Body }],\n content: {\n [SlotName.Aside]: brandingAside('lock', 'Locked', 'Your work is exactly where you left it.'),\n [TemplateSlotName.Body]: [\n card('lock-card', [\n externalComponent('lock-avatar', 'avatar', { label: 'AN', size: 'xlarge', shape: 'circle' }),\n text('lock-name', 'Amelia Nyquist'),\n field('lock-password', 'Password', 'password', { feedback: false }),\n formActions('lock-actions', 'Unlock', 'Sign in as someone else'),\n ]),\n ],\n },\n displayName: 'Lock screen',\n description: 'One person, one password, and no way to lose what was open.',\n};\n\n/** The six authentication templates. */\nexport const authTemplates: ScreenTemplate[] = [\n loginTemplate,\n registerTemplate,\n forgotPasswordTemplate,\n newPasswordTemplate,\n verificationTemplate,\n lockScreenTemplate,\n];\n"],"names":["brandingAside","id","headline","supporting","externalComponent","ComponentName","Logo","label","initials","text","loginTemplate","name","fitsSlot","SlotName","Content","slots","Aside","TemplateSlotName","Body","content","card","field","placeholder","feedback","formActions","button","link","targetScreen","displayName","description","registerTemplate","forgotPasswordTemplate","newPasswordTemplate","verificationTemplate","model","activeIndex","maxLength","lockScreenTemplate","size","shape","authTemplates"],"mappings":";;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;;iEAWA,SAASA,aAAAA,CAAcC,EAAU,EAAEC,QAAgB,EAAEC,UAAkB,EAAA;IACnE,OAAO;AACHC,QAAAA,0BAAAA,CAAkB,GAAGH,EAAAA,CAAG,KAAK,CAAC,EAAEI,2BAAAA,CAAcC,IAAI,EAAE;YAAEC,KAAAA,EAAO,SAAA;YAAWC,QAAAA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;AAAK;AAAE,KAAA;IAClEC,OAAAA,EAAS;AACL,QAAA,CAACN,kBAASG,KAAK,GAAGhB,aAAAA,CAAc,QAAQ,QAAA,EAAU,yCAAA,CAAA;QAClD,CAACiB,iCAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAK,WAAA,EAAa;AACdhB,gBAAAA,0BAAAA,CAAkB,eAAe,QAAA,EAAU;oBAAEG,KAAAA,EAAO,IAAA;oBAAM+B,IAAAA,EAAM,QAAA;oBAAUC,KAAAA,EAAO;AAAS,iBAAA,CAAA;AAC1F9B,gBAAAA,aAAAA,CAAK,WAAA,EAAa,gBAAA,CAAA;gBAClBY,aAAAA,CAAM,eAAA,EAAiB,YAAY,UAAA,EAAY;oBAAEE,QAAAA,EAAU;AAAM,iBAAA,CAAA;AACjEC,gBAAAA,mBAAAA,CAAY,gBAAgB,QAAA,EAAU,yBAAA;AACzC,aAAA;AACJ;AACL,KAAA;IACAI,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,yCACO,MAAMW,aAAAA,GAAkC;AAC3C9B,IAAAA,aAAAA;AACAoB,IAAAA,gBAAAA;AACAC,IAAAA,sBAAAA;AACAC,IAAAA,mBAAAA;AACAC,IAAAA,oBAAAA;AACAI,IAAAA;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"componentNames.js","sources":["../../../gallery/componentNames.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 { SceneElement } from '@cratis/scene.model';\nimport { isContentControl, isExternalComponent, isItemsControl, isPanel } from '@cratis/scene.engine';\n\n/**\n * Every component name an element tree references.\n *\n * A blueprint's templates name components the blueprint itself does not provide - the widgets come from\n * the component libraries it depends on - and a name no active package declares renders as a dashed red\n * placeholder somewhere inside a screen, with nothing pointing back at the template that wrote it.\n * Collecting the names up front is what lets that be a failed check at build or design time instead.\n *\n * The walk uses the engine's own kind guards rather than its own, so it visits exactly the branches the\n * renderer visits and cannot drift from it.\n *\n * @param element The root to walk.\n * @returns Every `componentName` found, in encounter order, with duplicates.\n */\nexport function componentNamesIn(element: SceneElement): string[] {\n const names: string[] = [];\n\n if (isExternalComponent(element)) {\n names.push(element.componentName);\n for (const children of Object.values(element.slots)) {\n for (const child of children) {\n names.push(...componentNamesIn(child));\n }\n }\n }\n\n if (isContentControl(element)) {\n names.push(...componentNamesIn(element.content));\n }\n\n if (isItemsControl(element)) {\n names.push(...componentNamesIn(element.itemTemplate));\n }\n\n if (isPanel(element)) {\n for (const child of element.children) {\n names.push(...componentNamesIn(child));\n }\n }\n\n return names;\n}\n\n/**\n * Every distinct component name a set of element trees references, sorted so a report of them is stable.\n */\nexport function distinctComponentNames(elements: SceneElement[]): string[] {\n return [...new Set(elements.flatMap(componentNamesIn))].sort();\n}\n"],"names":["componentNamesIn","element","names","isExternalComponent","push","componentName","children","Object","values","slots","child","isContentControl","content","isItemsControl","itemTemplate","isPanel","distinctComponentNames","elements","Set","flatMap","sort"],"mappings":";;;;AAAA;AACA;AAKA;;;;;;;;;;;;;IAcO,SAASA,gBAAAA,CAAiBC,OAAqB,EAAA;AAClD,IAAA,MAAMC,QAAkB,EAAE;AAE1B,IAAA,IAAIC,iCAAoBF,OAAAA,CAAAA,EAAU;QAC9BC,KAAAA,CAAME,IAAI,CAACH,OAAAA,CAAQI,aAAa,CAAA;AAChC,QAAA,KAAK,MAAMC,QAAAA,IAAYC,MAAAA,CAAOC,MAAM,CAACP,OAAAA,CAAQQ,KAAK,CAAA,CAAG;YACjD,KAAK,MAAMC,SAASJ,QAAAA,CAAU;gBAC1BJ,KAAAA,CAAME,IAAI,IAAIJ,gBAAAA,CAAiBU,KAAAA,CAAAA,CAAAA;AACnC,YAAA;AACJ,QAAA;AACJ,IAAA;AAEA,IAAA,IAAIC,8BAAiBV,OAAAA,CAAAA,EAAU;AAC3BC,QAAAA,KAAAA,CAAME,IAAI,CAAA,GAAIJ,gBAAAA,CAAiBC,OAAAA,CAAQW,OAAO,CAAA,CAAA;AAClD,IAAA;AAEA,IAAA,IAAIC,4BAAeZ,OAAAA,CAAAA,EAAU;AACzBC,QAAAA,KAAAA,CAAME,IAAI,CAAA,GAAIJ,gBAAAA,CAAiBC,OAAAA,CAAQa,YAAY,CAAA,CAAA;AACvD,IAAA;AAEA,IAAA,IAAIC,qBAAQd,OAAAA,CAAAA,EAAU;AAClB,QAAA,KAAK,MAAMS,KAAAA,IAAST,OAAAA,CAAQK,QAAQ,CAAE;YAClCJ,KAAAA,CAAME,IAAI,IAAIJ,gBAAAA,CAAiBU,KAAAA,CAAAA,CAAAA;AACnC,QAAA;AACJ,IAAA;IAEA,OAAOR,KAAAA;AACX;AAEA;;IAGO,SAASc,sBAAAA,CAAuBC,QAAwB,EAAA;IAC3D,OAAO;WAAI,IAAIC,GAAAA,CAAID,QAAAA,CAASE,OAAO,CAACnB,gBAAAA,CAAAA;AAAmB,KAAA,CAACoB,IAAI,EAAA;AAChE;;;;;"}
1
+ {"version":3,"file":"componentNames.js","sources":["../../../gallery/componentNames.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 { SceneElement } from '@cratis/scene.model';\nimport { isContentControl, isExternalComponent, isItemsControl, isPanel } from '@cratis/scene.engine';\n\n/**\n * Every component name an element tree references.\n *\n * A blueprint's templates name components the blueprint itself does not provide - the widgets come from\n * the component libraries it depends on - and a name no active package declares renders as a dashed red\n * placeholder somewhere inside a screen, with nothing pointing back at the template that wrote it.\n * Collecting the names up front is what lets that be a failed check at build or design time instead.\n *\n * The walk uses the engine's own kind guards rather than its own, so it visits exactly the branches the\n * renderer visits and cannot drift from it.\n *\n * @param element The root to walk.\n * @returns Every `componentName` found, in encounter order, with duplicates.\n */\nexport function componentNamesIn(element: SceneElement): string[] {\n const names: string[] = [];\n\n if (isExternalComponent(element)) {\n names.push(element.componentName);\n for (const children of Object.values(element.slots)) {\n for (const child of children) {\n names.push(...componentNamesIn(child));\n }\n }\n }\n\n if (isContentControl(element)) {\n names.push(...componentNamesIn(element.content));\n }\n\n if (isItemsControl(element)) {\n names.push(...componentNamesIn(element.itemTemplate));\n }\n\n if (isPanel(element)) {\n for (const child of element.children) {\n names.push(...componentNamesIn(child));\n }\n }\n\n return names;\n}\n\n/**\n * Every distinct component name a set of element trees references, sorted so a report of them is stable.\n */\nexport function distinctComponentNames(elements: SceneElement[]): string[] {\n return [...new Set(elements.flatMap(componentNamesIn))].sort();\n}\n"],"names":["componentNamesIn","element","names","isExternalComponent","push","componentName","children","Object","values","slots","child","isContentControl","content","isItemsControl","itemTemplate","isPanel","distinctComponentNames","elements","Set","flatMap","sort"],"mappings":";;;;AAAA;AACA;AAKA;;;;;;;;;;;;;IAcO,SAASA,gBAAAA,CAAiBC,OAAqB,EAAA;AAClD,IAAA,MAAMC,QAAkB,EAAE;AAE1B,IAAA,IAAIC,iCAAoBF,OAAAA,CAAAA,EAAU;QAC9BC,KAAAA,CAAME,IAAI,CAACH,OAAAA,CAAQI,aAAa,CAAA;AAChC,QAAA,KAAK,MAAMC,QAAAA,IAAYC,MAAAA,CAAOC,MAAM,CAACP,OAAAA,CAAQQ,KAAK,CAAA,CAAG;YACjD,KAAK,MAAMC,SAASJ,QAAAA,CAAU;gBAC1BJ,KAAAA,CAAME,IAAI,IAAIJ,gBAAAA,CAAiBU,KAAAA,CAAAA,CAAAA;AACnC,YAAA;AACJ,QAAA;AACJ,IAAA;AAEA,IAAA,IAAIC,8BAAiBV,OAAAA,CAAAA,EAAU;AAC3BC,QAAAA,KAAAA,CAAME,IAAI,CAAA,GAAIJ,gBAAAA,CAAiBC,OAAAA,CAAQW,OAAO,CAAA,CAAA;AAClD,IAAA;AAEA,IAAA,IAAIC,4BAAeZ,OAAAA,CAAAA,EAAU;AACzBC,QAAAA,KAAAA,CAAME,IAAI,CAAA,GAAIJ,gBAAAA,CAAiBC,OAAAA,CAAQa,YAAY,CAAA,CAAA;AACvD,IAAA;AAEA,IAAA,IAAIC,qBAAQd,OAAAA,CAAAA,EAAU;AAClB,QAAA,KAAK,MAAMS,KAAAA,IAAST,OAAAA,CAAQK,QAAQ,CAAE;YAClCJ,KAAAA,CAAME,IAAI,IAAIJ,gBAAAA,CAAiBU,KAAAA,CAAAA,CAAAA;AACnC,QAAA;AACJ,IAAA;IAEA,OAAOR,KAAAA;AACX;AAEA;;IAGO,SAASc,sBAAAA,CAAuBC,QAAwB,EAAA;IAC3D,OAAO;WAAI,IAAIC,GAAAA,CAAID,QAAAA,CAASE,OAAO,CAACnB,gBAAAA,CAAAA;AAAmB,KAAA,CAACoB,IAAI,EAAA;AAChE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"composeScreen.js","sources":["../../../gallery/composeScreen.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent, Layout, SceneElement, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { shellComponentForLayout } from '../layouts';\nimport { externalComponent } from './elements';\n\n/**\n * Turns a {@link ScreenTemplate}'s content into slot content on the {@link Layout} that contains it.\n *\n * The rule has two halves, and both matter. Content filed under a slot the *layout* also declares stays\n * under that name - which is how a sign-in template's branding half reaches the full-page layout's `aside`\n * region rather than being buried inside the form column. Everything else flows into the slot the\n * template's `fitsSlot` names, because that is what `fitsSlot` means: this template occupies that region.\n *\n * @param template The template to place.\n * @param layout The layout it is placed into.\n * @returns Slot content keyed by the layout's own slot names.\n */\nexport function templateContentInLayout(template: ScreenTemplate, layout: Layout): Record<string, SceneElement[]> {\n const layoutSlots = new Set(layout.slots.map(slot => slot.name));\n const placed: Record<string, SceneElement[]> = {};\n const ownSlotOrder = template.slots.map(slot => slot.name);\n const content = template.content ?? {};\n\n for (const slotName of ownSlotOrder) {\n const elements = content[slotName];\n if (!elements || elements.length === 0) {\n continue;\n }\n\n const target = layoutSlots.has(slotName) ? slotName : template.fitsSlot;\n if (!target) {\n continue;\n }\n\n placed[target] = [...(placed[target] ?? []), ...elements];\n }\n\n return placed;\n}\n\n/**\n * Folds a containment chain of screen templates into the outermost one.\n *\n * This is `fitsSlot` doing its job, applied repeatedly. A slice's template fits a slot on the feature's\n * template, which fits a slot on the module's, which fits a slot on the application layout - so the way to\n * place the slice is to place it in the feature, place *that* result in the module, and hand the module to\n * the layout. Folding from the inside out means the rule is written once and the chain can be any depth.\n *\n * The alternative - filing a nested template's content under its own `fitsSlot` at the top level - looks\n * right and is not: the layout has no `body` slot, so the content lands in a region nothing renders and\n * the screen comes up empty with nothing to explain it.\n *\n * @param chain The templates from outermost to innermost. A chain of one is returned unchanged.\n * @returns A template with the same slots and `fitsSlot` as the outermost, carrying the whole chain's content.\n */\nexport function nestScreenTemplates(chain: ScreenTemplate[]): ScreenTemplate {\n return chain.reduceRight((inner, outer) => (inner === outer ? outer : placeInside(outer, inner)));\n}\n\nfunction placeInside(outer: ScreenTemplate, inner: ScreenTemplate): ScreenTemplate {\n if (!inner.fitsSlot) {\n return outer;\n }\n\n const innerContent = inner.slots.flatMap(slot => inner.content?.[slot.name] ?? []);\n return {\n ...outer,\n content: {\n ...outer.content,\n [inner.fitsSlot]: [...(outer.content?.[inner.fitsSlot] ?? []), ...innerContent],\n },\n };\n}\n\n/**\n * Builds the element tree that renders a {@link Screen}.\n *\n * The screen's slot content becomes the shell component's slots one-for-one, which is the whole trick: a\n * layout's slots and a shell component's slots are the same vocabulary, so nothing has to translate\n * between them and a slot filled under a name the shell does not read is a spec failure rather than a\n * silently missing region.\n *\n * @param screen The screen to render.\n * @returns The shell element, ready for `SceneElementView`.\n */\nexport function composeScreenElement(screen: Screen): ExternalComponent {\n const shell = shellComponentForLayout(screen.layout);\n if (!shell) {\n throw new Error(`Screen '${screen.name}' names the layout '${screen.layout}', which this blueprint does not provide.`);\n }\n\n return externalComponent(`screen-${screen.name}`, shell, { screenName: screen.name }, screen.slotContent);\n}\n"],"names":["templateContentInLayout","template","layout","layoutSlots","Set","slots","map","slot","name","placed","ownSlotOrder","content","slotName","elements","length","target","has","fitsSlot","nestScreenTemplates","chain","reduceRight","inner","outer","placeInside","innerContent","flatMap","composeScreenElement","screen","shell","shellComponentForLayout","Error","externalComponent","screenName","slotContent"],"mappings":";;;;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,uBAAAA,CAAwBC,QAAwB,EAAEC,MAAc,EAAA;IAC5E,MAAMC,WAAAA,GAAc,IAAIC,GAAAA,CAAIF,MAAAA,CAAOG,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA,CAAA;AAC9D,IAAA,MAAMC,SAAyC,EAAC;IAChD,MAAMC,YAAAA,GAAeT,SAASI,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA;AACzD,IAAA,MAAMG,OAAAA,GAAUV,QAAAA,CAASU,OAAO,IAAI,EAAC;IAErC,KAAK,MAAMC,YAAYF,YAAAA,CAAc;QACjC,MAAMG,QAAAA,GAAWF,OAAO,CAACC,QAAAA,CAAS;AAClC,QAAA,IAAI,CAACC,QAAAA,IAAYA,QAAAA,CAASC,MAAM,KAAK,CAAA,EAAG;AACpC,YAAA;AACJ,QAAA;AAEA,QAAA,MAAMC,SAASZ,WAAAA,CAAYa,GAAG,CAACJ,QAAAA,CAAAA,GAAYA,QAAAA,GAAWX,SAASgB,QAAQ;AACvE,QAAA,IAAI,CAACF,MAAAA,EAAQ;AACT,YAAA;AACJ,QAAA;QAEAN,MAAM,CAACM,OAAO,GAAG;eAAKN,MAAM,CAACM,MAAAA,CAAO,IAAI,EAAE;AAAMF,YAAAA,GAAAA;AAAS,SAAA;AAC7D,IAAA;IAEA,OAAOJ,MAAAA;AACX;AAEA;;;;;;;;;;;;;;IAeO,SAASS,mBAAAA,CAAoBC,KAAuB,EAAA;IACvD,OAAOA,KAAAA,CAAMC,WAAW,CAAC,CAACC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.js","sources":["../../../gallery/composeScreen.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ExternalComponent, Layout, SceneElement, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { shellComponentForLayout } from '../layouts';\nimport { externalComponent } from './elements';\n\n/**\n * Turns a {@link ScreenTemplate}'s content into slot content on the {@link Layout} that contains it.\n *\n * The rule has two halves, and both matter. Content filed under a slot the *layout* also declares stays\n * under that name - which is how a sign-in template's branding half reaches the full-page layout's `aside`\n * region rather than being buried inside the form column. Everything else flows into the slot the\n * template's `fitsSlot` names, because that is what `fitsSlot` means: this template occupies that region.\n *\n * @param template The template to place.\n * @param layout The layout it is placed into.\n * @returns Slot content keyed by the layout's own slot names.\n */\nexport function templateContentInLayout(template: ScreenTemplate, layout: Layout): Record<string, SceneElement[]> {\n const layoutSlots = new Set(layout.slots.map(slot => slot.name));\n const placed: Record<string, SceneElement[]> = {};\n const ownSlotOrder = template.slots.map(slot => slot.name);\n const content = template.content ?? {};\n\n for (const slotName of ownSlotOrder) {\n const elements = content[slotName];\n if (!elements || elements.length === 0) {\n continue;\n }\n\n const target = layoutSlots.has(slotName) ? slotName : template.fitsSlot;\n if (!target) {\n continue;\n }\n\n placed[target] = [...(placed[target] ?? []), ...elements];\n }\n\n return placed;\n}\n\n/**\n * Folds a containment chain of screen templates into the outermost one.\n *\n * This is `fitsSlot` doing its job, applied repeatedly. A slice's template fits a slot on the feature's\n * template, which fits a slot on the module's, which fits a slot on the application layout - so the way to\n * place the slice is to place it in the feature, place *that* result in the module, and hand the module to\n * the layout. Folding from the inside out means the rule is written once and the chain can be any depth.\n *\n * The alternative - filing a nested template's content under its own `fitsSlot` at the top level - looks\n * right and is not: the layout has no `body` slot, so the content lands in a region nothing renders and\n * the screen comes up empty with nothing to explain it.\n *\n * @param chain The templates from outermost to innermost. A chain of one is returned unchanged.\n * @returns A template with the same slots and `fitsSlot` as the outermost, carrying the whole chain's content.\n */\nexport function nestScreenTemplates(chain: ScreenTemplate[]): ScreenTemplate {\n return chain.reduceRight((inner, outer) => (inner === outer ? outer : placeInside(outer, inner)));\n}\n\nfunction placeInside(outer: ScreenTemplate, inner: ScreenTemplate): ScreenTemplate {\n if (!inner.fitsSlot) {\n return outer;\n }\n\n const innerContent = inner.slots.flatMap(slot => inner.content?.[slot.name] ?? []);\n return {\n ...outer,\n content: {\n ...outer.content,\n [inner.fitsSlot]: [...(outer.content?.[inner.fitsSlot] ?? []), ...innerContent],\n },\n };\n}\n\n/**\n * Builds the element tree that renders a {@link Screen}.\n *\n * The screen's slot content becomes the shell component's slots one-for-one, which is the whole trick: a\n * layout's slots and a shell component's slots are the same vocabulary, so nothing has to translate\n * between them and a slot filled under a name the shell does not read is a spec failure rather than a\n * silently missing region.\n *\n * @param screen The screen to render.\n * @returns The shell element, ready for `SceneElementView`.\n */\nexport function composeScreenElement(screen: Screen): ExternalComponent {\n const shell = shellComponentForLayout(screen.layout);\n if (!shell) {\n throw new Error(`Screen '${screen.name}' names the layout '${screen.layout}', which this blueprint does not provide.`);\n }\n\n return externalComponent(`screen-${screen.name}`, shell, { screenName: screen.name }, screen.slotContent);\n}\n"],"names":["templateContentInLayout","template","layout","layoutSlots","Set","slots","map","slot","name","placed","ownSlotOrder","content","slotName","elements","length","target","has","fitsSlot","nestScreenTemplates","chain","reduceRight","inner","outer","placeInside","innerContent","flatMap","composeScreenElement","screen","shell","shellComponentForLayout","Error","externalComponent","screenName","slotContent"],"mappings":";;;;;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,IACM,SAASA,uBAAAA,CAAwBC,QAAwB,EAAEC,MAAc,EAAA;IAC5E,MAAMC,WAAAA,GAAc,IAAIC,GAAAA,CAAIF,MAAAA,CAAOG,KAAK,CAACC,GAAG,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,IAAI,CAAA,CAAA;AAC9D,IAAA,MAAMC,SAAyC,EAAC;IAChD,MAAMC,YAA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AAAA,EAAS;AACL,YAAA,GAAGW,MAAMX,OAAO;YAChB,CAACU,KAAAA,CAAMJ,QAAQ,GAAG;AAAKK,gBAAAA,GAAAA,KAAAA,CAAMX,OAAO,GAAGU,MAAMJ,QAAQ,CAAC,IAAI,EAAE;AAAMO,gBAAAA,GAAAA;AAAa;AACnF;AACJ,KAAA;AACJ;AAEA;;;;;;;;;;IAWO,SAASE,oBAAAA,CAAqBC,MAAc,EAAA;IAC/C,MAAMC,KAAAA,GAAQC,uCAAAA,CAAwBF,MAAAA,CAAOzB,MAAM,CAAA;AACnD,IAAA,IAAI,CAAC0B,KAAAA,EAAO;AACR,QAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,QAAQ,EAAEH,MAAAA,CAAOnB,IAAI,CAAC,oBAAoB,EAAEmB,MAAAA,CAAOzB,MAAM,CAAC,yCAAyC,CAAC,CAAA;AACzH,IAAA;IAEA,OAAO6B,0BAAAA,CAAkB,CAAC,OAAO,EAAEJ,OAAOnB,IAAI,CAAA,CAAE,EAAEoB,KAAAA,EAAO;AAAEI,QAAAA,UAAAA,EAAYL,OAAOnB;AAAK,KAAA,EAAGmB,OAAOM,WAAW,CAAA;AAC5G;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dependencyComponentNames.js","sources":["../../../gallery/dependencyComponentNames.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The component names the gallery borrows from this blueprint's dependencies.\n *\n * A screen template names components by their **bare** name and lets `resolveComponentName` pick the\n * package, which is what makes a template portable across profiles. The cost is that a template can\n * reference a name no active package declares, and the only symptom is a dashed red placeholder in the\n * middle of an otherwise fine screen.\n *\n * Every name below was checked against the owning package's own manifest - `primeReactPackage.ts` and\n * `cratisComponentsPackage.ts` - rather than assumed. Two that a dashboard obviously wants, `chart` and\n * `fileUpload`, are deliberately absent from both, so the templates use what does exist (a table of\n * figures, an image beside a button) rather than referencing something that would not render.\n *\n * This list exists because this package does not take an npm dependency on either of those packages - a\n * blueprint declares its dependencies in its manifest, not in its bundler graph. When a host wires the\n * real manifests together, it should resolve against those instead, and any name that drifted will fail\n * this blueprint's specs immediately.\n */\n\n/**\n * Names borrowed from the `PrimeReact` package, each present in its declared component list.\n *\n * `menu`, `breadcrumb` and `sidebar` are here even though the gallery uses this blueprint's versions of\n * them, because PrimeReact really does declare all three - and leaving them out would hide the shadowing\n * that makes a blueprint's own shell components win those bare names.\n */\nexport const primeReactComponentNames: string[] = [\n 'avatar',\n 'breadcrumb',\n 'calendar',\n 'card',\n 'checkbox',\n 'column',\n 'dataTable',\n 'dropdown',\n 'image',\n 'menu',\n 'sidebar',\n 'inputNumber',\n 'inputText',\n 'inputTextarea',\n 'message',\n 'password',\n 'progressBar',\n 'steps',\n 'tag',\n 'text',\n 'timeline',\n];\n\n/**\n * Names borrowed from the `Cratis.Components` package.\n *\n * Deliberately short. The gallery's templates are built from primitives so that they stay legible as\n * *structure*; an application replaces a seeded table with a real `dataPage` bound to a query, and that is\n * the point at which the Arc-bound composites earn their place.\n */\nexport const cratisComponentsNames: string[] = ['dataPage', 'observableDataTable', 'commandDialog', 'dialog'];\n\n/** The names `core` guarantees, regardless of which packages a profile lists. */\nexport const coreComponentNames: string[] = ['text', 'button', 'card'];\n"],"names":["primeReactComponentNames","cratisComponentsNames","coreComponentNames"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;UA0BaA,wBAAAA,GAAqC;AAC9C,IAAA,QAAA;AACA,IAAA,YAAA;AACA,IAAA,UAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,WAAA;AACA,IAAA,UAAA;AACA,IAAA,OAAA;AACA,IAAA,MAAA;AACA,IAAA,SAAA;AACA,IAAA,aAAA;AACA,IAAA,WAAA;AACA,IAAA,eAAA;AACA,IAAA,SAAA;AACA,IAAA,UAAA;AACA,IAAA,aAAA;AACA,IAAA,OAAA;AACA,IAAA,KAAA;AACA,IAAA,MAAA;AACA,IAAA;;AAGJ;;;;;;UAOaC,qBAAAA,GAAkC;AAAC,IAAA,UAAA;AAAY,IAAA,qBAAA;AAAuB,IAAA,eAAA;AAAiB,IAAA;;AAEpG,kFACO,MAAMC,kBAAAA,GAA+B;AAAC,IAAA,MAAA;AAAQ,IAAA,QAAA;AAAU,IAAA;;;;;;;"}
1
+ {"version":3,"file":"dependencyComponentNames.js","sources":["../../../gallery/dependencyComponentNames.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The component names the gallery borrows from this blueprint's dependencies.\n *\n * A screen template names components by their **bare** name and lets `resolveComponentName` pick the\n * package, which is what makes a template portable across profiles. The cost is that a template can\n * reference a name no active package declares, and the only symptom is a dashed red placeholder in the\n * middle of an otherwise fine screen.\n *\n * Every name below was checked against the owning package's own manifest - `primeReactPackage.ts` and\n * `cratisComponentsPackage.ts` - rather than assumed. Two that a dashboard obviously wants, `chart` and\n * `fileUpload`, are deliberately absent from both, so the templates use what does exist (a table of\n * figures, an image beside a button) rather than referencing something that would not render.\n *\n * This list exists because this package does not take an npm dependency on either of those packages - a\n * blueprint declares its dependencies in its manifest, not in its bundler graph. When a host wires the\n * real manifests together, it should resolve against those instead, and any name that drifted will fail\n * this blueprint's specs immediately.\n */\n\n/**\n * Names borrowed from the `PrimeReact` package, each present in its declared component list.\n *\n * `menu`, `breadcrumb` and `sidebar` are here even though the gallery uses this blueprint's versions of\n * them, because PrimeReact really does declare all three - and leaving them out would hide the shadowing\n * that makes a blueprint's own shell components win those bare names.\n */\nexport const primeReactComponentNames: string[] = [\n 'avatar',\n 'breadcrumb',\n 'calendar',\n 'card',\n 'checkbox',\n 'column',\n 'dataTable',\n 'dropdown',\n 'image',\n 'menu',\n 'sidebar',\n 'inputNumber',\n 'inputText',\n 'inputTextarea',\n 'message',\n 'password',\n 'progressBar',\n 'steps',\n 'tag',\n 'text',\n 'timeline',\n];\n\n/**\n * Names borrowed from the `Cratis.Components` package.\n *\n * Deliberately short. The gallery's templates are built from primitives so that they stay legible as\n * *structure*; an application replaces a seeded table with a real `dataPage` bound to a query, and that is\n * the point at which the Arc-bound composites earn their place.\n */\nexport const cratisComponentsNames: string[] = ['dataPage', 'observableDataTable', 'commandDialog', 'dialog'];\n\n/** The names `core` guarantees, regardless of which packages a profile lists. */\nexport const coreComponentNames: string[] = ['text', 'button', 'card'];\n"],"names":["primeReactComponentNames","cratisComponentsNames","coreComponentNames"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;;;UA0BaA,wBAAAA,GAAqC;AAC9C,IAAA,QAAA;AACA,IAAA,YAAA;AACA,IAAA,UAAA;AACA,IAAA,MAAA;AACA,IAAA,UAAA;AACA,IAAA,QAAA;AACA,IAAA,WAAA;AACA,IAAA,UAAA;AACA,IAAA,OAAA;AACA,IAAA,MAAA;AACA,IAAA,SAAA;AACA,IAAA,aAAA;AACA,IAAA,WAAA;AACA,IAAA,eAAA;AACA,IAAA,SAAA;AACA,IAAA,UAAA;AACA,IAAA,aAAA;AACA,IAAA,OAAA;AACA,IAAA,KAAA;AACA,IAAA,MAAA;AACA,IAAA;;AAGJ;;;;;;UAOaC,qBAAAA,GAAkC;AAAC,IAAA,UAAA;AAAY,IAAA,qBAAA;AAAuB,IAAA,eAAA;AAAiB,IAAA;;AAEpG,kFACO,MAAMC,kBAAAA,GAA+B;AAAC,IAAA,MAAA;AAAQ,IAAA,QAAA;AAAU,IAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dialogTemplates.js","sources":["../../../gallery/dialogTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, panel, text } from './elements';\nimport { field } from './widgets';\n\n/**\n * The three dialog shapes an application repeats: confirm something destructive, capture a short form, and\n * show a record without leaving the list behind it.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction. A screen template is\n * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it\n * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it\n * happens to be, so there is no parent slot for it to name.\n */\n\n/** Confirm: one question, two answers, and enough context to answer it. */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('confirm-title', 'Archive this product?')],\n [TemplateSlotName.Body]: [\n text('confirm-message', 'Bamboo Watch will stop appearing in the catalog. Existing orders keep it.'),\n externalComponent('confirm-note', 'message', { severity: 'warn', text: 'This can be undone from the archive.' }),\n ],\n [TemplateSlotName.Actions]: [\n panel('confirm-actions', [button('confirm-yes', 'Archive', { severity: 'danger' }), button('confirm-no', 'Keep it', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, and a way back.',\n};\n\n/** Form: a short capture that does not deserve a page of its own. */\nexport const formDialogTemplate: DialogTemplate = {\n name: 'FormDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('form-dialog-title', 'Invite someone')],\n [TemplateSlotName.Body]: [\n field('form-dialog-email', 'Email', 'inputText', { placeholder: 'them@contoso.com' }),\n field('form-dialog-role', 'Role', 'dropdown', { options: ['Viewer', 'Editor', 'Administrator'] }),\n field('form-dialog-message', 'Message', 'inputTextarea', { rows: 3 }),\n ],\n [TemplateSlotName.Actions]: [\n panel('form-dialog-actions', [button('form-dialog-send', 'Send invitation', { severity: 'primary' }), button('form-dialog-cancel', 'Cancel', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Form dialog',\n description: 'A handful of fields captured without leaving the page underneath.',\n};\n\n/** Detail: a record shown over the list it came from. */\nexport const detailDialogTemplate: DialogTemplate = {\n name: 'DetailDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('detail-dialog-title', 'ORD-4192')],\n [TemplateSlotName.Body]: [\n card('detail-dialog-summary', [\n text('detail-dialog-customer', 'Northwind Traders'),\n text('detail-dialog-total', '$1,240.00'),\n externalComponent('detail-dialog-status', 'tag', { value: 'Shipped', severity: 'success' }),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [externalComponent('detail-dialog-timeline', 'timeline', { align: 'left' })],\n [TemplateSlotName.Actions]: [\n panel('detail-dialog-actions', [button('detail-dialog-open', 'Open full record', { severity: 'primary', targetScreen: 'DetailView' }), button('detail-dialog-close', 'Close', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Detail dialog',\n description: 'A record over the list it came from, with a route to the full page.',\n};\n\n/** The dialog templates this blueprint provides. */\nexport const galleryDialogTemplates: DialogTemplate[] = [confirmDialogTemplate, formDialogTemplate, detailDialogTemplate];\n"],"names":["confirmDialogTemplate","name","slots","TemplateSlotName","Header","Body","Actions","content","text","externalComponent","severity","panel","button","displayName","description","formDialogTemplate","field","placeholder","options","rows","detailDialogTemplate","SidePanel","card","value","align","targetScreen","galleryDialogTemplates"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;AAQC,gFAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,kCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEH,YAAAA,IAAAA,EAAME,kCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEJ,YAAAA,IAAAA,EAAME,kCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,OAAAA,EAAS;QACL,CAACJ,iCAAAA,CAAiBC,MAAM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c,KAAAA,EAAO,SAAA;oBAAWb,QAAAA,EAAU;AAAU,iBAAA;AAC5F,aAAA;AACJ,SAAA;QACD,CAACP,iCAAAA,CAAiBkB,SAAS,GAAG;AAACZ,YAAAA,0BAAAA,CAAkB,0BAA0B,UAAA,EAAY;gBAAEe,KAAAA,EAAO;AAAO,aAAA;AAAG,SAAA;QAC1G,CAACrB,iCAAAA,CAAiBG,OAAO,GAAG;AACxBK,YAAAA,cAAAA,CAAM,uBAAA,EAAyB;AAACC,gBAAAA,eAAAA,CAAO,sBAAsB,kBAAA,EAAoB;oBAAEF,QAAAA,EAAU,SAAA;oBAAWe,YAAAA,EAAc;AAAa,iBAAA,CAAA;AAAIb,gBAAAA,eAAAA,CAAO,uBAAuB,OAAA,EAAS;oBAAEF,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AAC5M;AACL,KAAA;IACAG,WAAAA,EAAa,eAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qDACO,MAAMY,sBAAAA,GAA2C;AAAC1B,IAAAA,qBAAAA;AAAuBe,IAAAA,kBAAAA;AAAoBK,IAAAA;;;;;;;;"}
1
+ {"version":3,"file":"dialogTemplates.js","sources":["../../../gallery/dialogTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, panel, text } from './elements';\nimport { field } from './widgets';\n\n/**\n * The three dialog shapes an application repeats: confirm something destructive, capture a short form, and\n * show a record without leaving the list behind it.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction. A screen template is\n * *placed* - it fills a slot on whatever contains it, and the containment chain is what decides where it\n * appears. A dialog is *summoned*: it opens over the application from wherever the code that opened it\n * happens to be, so there is no parent slot for it to name.\n */\n\n/** Confirm: one question, two answers, and enough context to answer it. */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('confirm-title', 'Archive this product?')],\n [TemplateSlotName.Body]: [\n text('confirm-message', 'Bamboo Watch will stop appearing in the catalog. Existing orders keep it.'),\n externalComponent('confirm-note', 'message', { severity: 'warn', text: 'This can be undone from the archive.' }),\n ],\n [TemplateSlotName.Actions]: [\n panel('confirm-actions', [button('confirm-yes', 'Archive', { severity: 'danger' }), button('confirm-no', 'Keep it', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, and a way back.',\n};\n\n/** Form: a short capture that does not deserve a page of its own. */\nexport const formDialogTemplate: DialogTemplate = {\n name: 'FormDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('form-dialog-title', 'Invite someone')],\n [TemplateSlotName.Body]: [\n field('form-dialog-email', 'Email', 'inputText', { placeholder: 'them@contoso.com' }),\n field('form-dialog-role', 'Role', 'dropdown', { options: ['Viewer', 'Editor', 'Administrator'] }),\n field('form-dialog-message', 'Message', 'inputTextarea', { rows: 3 }),\n ],\n [TemplateSlotName.Actions]: [\n panel('form-dialog-actions', [button('form-dialog-send', 'Send invitation', { severity: 'primary' }), button('form-dialog-cancel', 'Cancel', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Form dialog',\n description: 'A handful of fields captured without leaving the page underneath.',\n};\n\n/** Detail: a record shown over the list it came from. */\nexport const detailDialogTemplate: DialogTemplate = {\n name: 'DetailDialog',\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [text('detail-dialog-title', 'ORD-4192')],\n [TemplateSlotName.Body]: [\n card('detail-dialog-summary', [\n text('detail-dialog-customer', 'Northwind Traders'),\n text('detail-dialog-total', '$1,240.00'),\n externalComponent('detail-dialog-status', 'tag', { value: 'Shipped', severity: 'success' }),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [externalComponent('detail-dialog-timeline', 'timeline', { align: 'left' })],\n [TemplateSlotName.Actions]: [\n panel('detail-dialog-actions', [button('detail-dialog-open', 'Open full record', { severity: 'primary', targetScreen: 'DetailView' }), button('detail-dialog-close', 'Close', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Detail dialog',\n description: 'A record over the list it came from, with a route to the full page.',\n};\n\n/** The dialog templates this blueprint provides. */\nexport const galleryDialogTemplates: DialogTemplate[] = [confirmDialogTemplate, formDialogTemplate, detailDialogTemplate];\n"],"names":["confirmDialogTemplate","name","slots","TemplateSlotName","Header","Body","Actions","content","text","externalComponent","severity","panel","button","displayName","description","formDialogTemplate","field","placeholder","options","rows","detailDialogTemplate","SidePanel","card","value","align","targetScreen","galleryDialogTemplates"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;AAQC,gFAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,kCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEH,YAAAA,IAAAA,EAAME,kCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEJ,YAAAA,IAAAA,EAAME,kCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,OAAAA,EAAS;QACL,CAACJ,iCAAAA,CAAiBC,MAAM,GAAG;AAACI,YAAAA,aAAAA,CAAK,eAAA,EAAiB,uBAAA;AAAyB,SAAA;QAC3E,CAACL,iCAAAA,CAAiBE,IAAI,GAAG;AACrBG,YAAAA,aAAAA,CAAK,iBAAA,EAAmB,2EAAA,CAAA;AACxBC,YAAAA,0BAAAA,CAAkB,gBAAgB,SAAA,EAAW;gBAAEC,QAAAA,EAAU,MAAA;gBAAQF,IAAAA,EAAM;AAAuC,aAAA;A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