@cratis/scene.blueprint.default 4.12.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cjs/gallery/GalleryScreenPreview.js +6 -3
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/cjs/gallery/TemplatePreviewState.js +17 -0
- package/dist/cjs/gallery/TemplatePreviewState.js.map +1 -0
- package/dist/cjs/gallery/applyTemplatePreviewState.js +91 -0
- package/dist/cjs/gallery/applyTemplatePreviewState.js.map +1 -0
- package/dist/cjs/gallery/authTemplates.js +25 -6
- package/dist/cjs/gallery/authTemplates.js.map +1 -1
- package/dist/cjs/gallery/dialogTemplates.js +13 -3
- package/dist/cjs/gallery/dialogTemplates.js.map +1 -1
- package/dist/cjs/gallery/navigation.js +7 -0
- package/dist/cjs/gallery/navigation.js.map +1 -1
- package/dist/cjs/gallery/nesting.js +13 -3
- package/dist/cjs/gallery/nesting.js.map +1 -1
- package/dist/cjs/gallery/screens.js +10 -1
- package/dist/cjs/gallery/screens.js.map +1 -1
- package/dist/cjs/gallery/statusTemplates.js +19 -5
- package/dist/cjs/gallery/statusTemplates.js.map +1 -1
- package/dist/cjs/gallery/supportTemplates.js +23 -6
- package/dist/cjs/gallery/supportTemplates.js.map +1 -1
- package/dist/cjs/gallery/widgets.js +20 -6
- package/dist/cjs/gallery/widgets.js.map +1 -1
- package/dist/cjs/gallery/workspaceTemplates.js +137 -8
- package/dist/cjs/gallery/workspaceTemplates.js.map +1 -1
- package/dist/cjs/index.js +10 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts/appShell.js +5 -1
- package/dist/cjs/layouts/appShell.js.map +1 -1
- package/dist/cjs/layouts/fullPage.js +5 -1
- package/dist/cjs/layouts/fullPage.js.map +1 -1
- package/dist/cjs/templateProvenance.js +46 -0
- package/dist/cjs/templateProvenance.js.map +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts +1 -0
- package/dist/esm/gallery/ApplicationScreens.stories.d.ts.map +1 -1
- package/dist/esm/gallery/ApplicationScreens.stories.js +2 -1
- package/dist/esm/gallery/ApplicationScreens.stories.js.map +1 -1
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +3 -1
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -1
- package/dist/esm/gallery/GalleryScreenPreview.js +6 -3
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/esm/gallery/PreviewStates.stories.d.ts +36 -0
- package/dist/esm/gallery/PreviewStates.stories.d.ts.map +1 -0
- package/dist/esm/gallery/PreviewStates.stories.js +27 -0
- package/dist/esm/gallery/PreviewStates.stories.js.map +1 -0
- package/dist/esm/gallery/TemplatePreviewState.d.ts +7 -0
- package/dist/esm/gallery/TemplatePreviewState.d.ts.map +1 -0
- package/dist/esm/gallery/TemplatePreviewState.js +15 -0
- package/dist/esm/gallery/TemplatePreviewState.js.map +1 -0
- package/dist/esm/gallery/applyTemplatePreviewState.d.ts +6 -0
- package/dist/esm/gallery/applyTemplatePreviewState.d.ts.map +1 -0
- package/dist/esm/gallery/applyTemplatePreviewState.js +87 -0
- package/dist/esm/gallery/applyTemplatePreviewState.js.map +1 -0
- package/dist/esm/gallery/authTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/authTemplates.js +25 -6
- package/dist/esm/gallery/authTemplates.js.map +1 -1
- package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/dialogTemplates.js +13 -3
- package/dist/esm/gallery/dialogTemplates.js.map +1 -1
- package/dist/esm/gallery/index.d.ts +2 -0
- package/dist/esm/gallery/index.d.ts.map +1 -1
- package/dist/esm/gallery/index.js +2 -0
- package/dist/esm/gallery/index.js.map +1 -1
- package/dist/esm/gallery/navigation.d.ts.map +1 -1
- package/dist/esm/gallery/navigation.js +7 -0
- package/dist/esm/gallery/navigation.js.map +1 -1
- package/dist/esm/gallery/nesting.d.ts.map +1 -1
- package/dist/esm/gallery/nesting.js +13 -3
- package/dist/esm/gallery/nesting.js.map +1 -1
- package/dist/esm/gallery/screens.d.ts.map +1 -1
- package/dist/esm/gallery/screens.js +10 -1
- package/dist/esm/gallery/screens.js.map +1 -1
- package/dist/esm/gallery/statusTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/statusTemplates.js +19 -5
- package/dist/esm/gallery/statusTemplates.js.map +1 -1
- package/dist/esm/gallery/supportTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/supportTemplates.js +23 -6
- package/dist/esm/gallery/supportTemplates.js.map +1 -1
- package/dist/esm/gallery/widgets.d.ts +1 -1
- package/dist/esm/gallery/widgets.d.ts.map +1 -1
- package/dist/esm/gallery/widgets.js +20 -6
- package/dist/esm/gallery/widgets.js.map +1 -1
- package/dist/esm/gallery/workspaceTemplates.d.ts +1 -0
- package/dist/esm/gallery/workspaceTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/workspaceTemplates.js +139 -11
- package/dist/esm/gallery/workspaceTemplates.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layouts/appShell.d.ts.map +1 -1
- package/dist/esm/layouts/appShell.js +5 -1
- package/dist/esm/layouts/appShell.js.map +1 -1
- package/dist/esm/layouts/fullPage.d.ts.map +1 -1
- package/dist/esm/layouts/fullPage.js +5 -1
- package/dist/esm/layouts/fullPage.js.map +1 -1
- package/dist/esm/templateProvenance.d.ts +4 -0
- package/dist/esm/templateProvenance.d.ts.map +1 -0
- package/dist/esm/templateProvenance.js +43 -0
- package/dist/esm/templateProvenance.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/gallery/ApplicationScreens.stories.tsx +4 -1
- package/gallery/GalleryScreenPreview.tsx +8 -3
- package/gallery/PreviewStates.stories.tsx +56 -0
- package/gallery/TemplatePreviewState.ts +20 -0
- package/gallery/applyTemplatePreviewState.ts +69 -0
- package/gallery/authTemplates.ts +7 -0
- package/gallery/dialogTemplates.ts +4 -0
- package/gallery/index.ts +2 -0
- package/gallery/navigation.ts +1 -0
- package/gallery/nesting.ts +4 -0
- package/gallery/screens.ts +2 -1
- package/gallery/statusTemplates.ts +6 -1
- package/gallery/supportTemplates.ts +7 -1
- package/gallery/widgets.ts +14 -5
- package/gallery/workspaceTemplates.ts +64 -4
- package/index.ts +1 -0
- package/layouts/appShell.ts +2 -0
- package/layouts/fullPage.ts +2 -0
- package/package.json +8 -7
- package/templateProvenance.ts +37 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screens.js","sources":["../../../gallery/screens.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 { Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, fullPageLayout } from '../layouts';\nimport { BreadcrumbEntry, applicationChrome, fullPageChrome } from './applicationChrome';\nimport { nestScreenTemplates, templateContentInLayout } from './composeScreen';\nimport { authTemplates } from './authTemplates';\nimport { navigationContributions } from './navigation';\nimport { nestingChainTemplates } from './nesting';\nimport { statusTemplates } from './statusTemplates';\nimport { supportTemplates } from './supportTemplates';\nimport { workspaceTemplates } from './workspaceTemplates';\n\n/**\n * The screen templates this blueprint provides.\n *\n * Ten shapes for inside the application shell, ten for the full-page shell, and the three-level nesting\n * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names\n * and what the bundle provides; `validatePackageBundle` proves the two agree.\n */\nexport const galleryScreenTemplates: ScreenTemplate[] = [\n ...workspaceTemplates,\n ...supportTemplates,\n ...authTemplates,\n ...statusTemplates,\n ...nestingChainTemplates,\n];\n\n/** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */\nconst fullPageTemplateNames = new Set([...authTemplates, ...statusTemplates].map(template => template.name));\n\n/** The trail shown above each application-shell screen. */\nconst breadcrumbs: Record<string, BreadcrumbEntry[]> = {\n Dashboard: [{ label: 'Dashboard' }],\n CrudList: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n DetailView: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'Bamboo Watch' }],\n FormPage: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'New product' }],\n Empty: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n Documentation: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Documentation' }],\n ProfileSettings: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Your profile' }],\n UserManagement: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Users' }],\n Invoice: [{ label: 'Billing', targetScreen: 'Dashboard' }, { label: 'INV-2043' }],\n Help: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Help' }],\n ModuleWorkspace: [{ label: 'Operations' }],\n FeatureSection: [{ label: 'Operations', targetScreen: 'ModuleWorkspace' }, { label: 'Adjustments' }],\n SliceSection: [\n { label: 'Operations', targetScreen: 'ModuleWorkspace' },\n { label: 'Adjustments', targetScreen: 'FeatureSection' },\n { label: 'Record an adjustment' },\n ],\n};\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const isFullPage = fullPageTemplateNames.has(template.name);\n const layout: Layout = isFullPage ? fullPageLayout : appShellLayout;\n const chrome = isFullPage ? fullPageChrome() : applicationChrome(template.name, breadcrumbs[template.name] ?? [{ label: template.displayName ?? template.name }]);\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: isFullPage ? LayoutName.FullPage : LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(chrome, templateContentInLayout(placeable, layout)),\n forms: [],\n contributions: isFullPage ? [] : navigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three\n * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest\n * version of the story: nesting exists for the applications that need it, and costs nothing for the ones\n * that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/**\n * The gallery: one screen per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n */\nexport const galleryScreens: Screen[] = galleryScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function galleryScreen(name: string): Screen | undefined {\n return galleryScreens.find(screen => screen.name === name);\n}\n"],"names":["galleryScreenTemplates","workspaceTemplates","supportTemplates","authTemplates","statusTemplates","nestingChainTemplates","fullPageTemplateNames","Set","map","template","name","breadcrumbs","Dashboard","label","CrudList","targetScreen","DetailView","FormPage","Empty","Documentation","ProfileSettings","UserManagement","Invoice","Help","ModuleWorkspace","FeatureSection","SliceSection","screenFor","isFullPage","has","layout","fullPageLayout","appShellLayout","chrome","fullPageChrome","applicationChrome","displayName","placeable","nestScreenTemplates","containmentChainFor","LayoutName","FullPage","AppShell","screenTemplate","slotContent","mergeSlotContent","templateContentInLayout","forms","contributions","navigationContributions","depth","findIndex","candidate","slice","content","merged","slotName","elements","Object","entries","galleryScreens","galleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;UAOaA,sBAAAA,GAA2C;AACjDC,IAAAA,GAAAA,qCAAAA;AACAC,IAAAA,GAAAA,iCAAAA;AACAC,IAAAA,GAAAA,2BAAAA;AACAC,IAAAA,GAAAA,+BAAAA;AACAC,IAAAA,GAAAA;;AAGP,sHACA,MAAMC,qBAAAA,GAAwB,IAAIC,GAAAA,CAAI;AAAIJ,IAAAA,GAAAA,2BAAAA;AAAkBC,IAAAA,GAAAA;AAAgB,CAAA,CAACI,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASC,IAAI,CAAA,CAAA;AAE1G,4DACA,MAAMC,WAAAA,GAAiD;IACnDC,SAAAA,EAAW;AAAC,QAAA;YAAEC,KAAAA,EAAO;AAAY;AAAE,KAAA;IACnCC,QAAAA,EAAU;AAAC,QAAA;YAAED,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAW;AAAE,KAAA;IAClFG,UAAAA,EAAY;AAAC,QAAA;YAAEH,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO,UAAA;YAAYE,YAAAA,EAAc;AAAW,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAe;AAAE,KAAA;IACzII,QAAAA,EAAU;AAAC,QAAA;YAAEJ,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO,UAAA;YAAYE,YAAAA,EAAc;AAAW,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAc;AAAE,KAAA;IACtIK,KAAAA,EAAO;AAAC,QAAA;YAAEL,KAAAA,EAAO,SAAA;YAAWE,YAAAA,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GH,KAAAA,GAAQ,CAAA,CAAA;AAC3E;AAEA,SAASL,gBAAAA,CAAiBZ,MAAqD,EAAEqB,OAAsD,EAAA;AACnI,IAAA,MAAMC,MAAAA,GAAgC;AAAE,QAAA,GAAGtB;AAAO,KAAA;IAClD,KAAK,MAAM,CAACuB,QAAAA,EAAUC,QAAAA,CAAS,IAAIC,MAAAA,CAAOC,OAAO,CAACL,OAAAA,CAAAA,CAAU;QACxDC,MAAM,CAACC,SAAS,GAAG;eAAKD,MAAM,CAACC,QAAAA,CAAS,IAAI,EAAE;AAAMC,YAAAA,GAAAA;AAAS,SAAA;AACjE,IAAA;IAEA,OAAOF,MAAAA;AACX;AAEA;;;;;;AAMC,IACM,MAAMK,cAAAA,GAA2B5D,sBAAAA,CAAuBQ,GAAG,CAACmB,SAAAA;AAEnE,oFACO,SAASkC,aAAAA,CAAcnD,IAAY,EAAA;AACtC,IAAA,OAAOkD,eAAeE,IAAI,CAACC,CAAAA,MAAAA,GAAUA,MAAAA,CAAOrD,IAAI,KAAKA,IAAAA,CAAAA;AACzD;;;;"}
|
|
1
|
+
{"version":3,"file":"screens.js","sources":["../../../gallery/screens.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 { Layout, Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, fullPageLayout } from '../layouts';\nimport { BreadcrumbEntry, applicationChrome, fullPageChrome } from './applicationChrome';\nimport { nestScreenTemplates, templateContentInLayout } from './composeScreen';\nimport { authTemplates } from './authTemplates';\nimport { navigationContributions } from './navigation';\nimport { nestingChainTemplates } from './nesting';\nimport { statusTemplates } from './statusTemplates';\nimport { supportTemplates } from './supportTemplates';\nimport { workspaceTemplates } from './workspaceTemplates';\n\n/**\n * The screen templates this blueprint provides.\n *\n * Eleven shapes for inside the application shell, ten for the full-page shell, and the three-level nesting\n * chain that demonstrates how `fitsSlot` composes. The list is what the manifest's `screenTemplates` names\n * and what the bundle provides; `validatePackageBundle` proves the two agree.\n */\nexport const galleryScreenTemplates: ScreenTemplate[] = [\n ...workspaceTemplates,\n ...supportTemplates,\n ...authTemplates,\n ...statusTemplates,\n ...nestingChainTemplates,\n];\n\n/** Which layout each template renders inside - the application shell unless it is one of the chrome-less screens. */\nconst fullPageTemplateNames = new Set([...authTemplates, ...statusTemplates].map(template => template.name));\n\n/** The trail shown above each application-shell screen. */\nconst breadcrumbs: Record<string, BreadcrumbEntry[]> = {\n Dashboard: [{ label: 'Dashboard' }],\n CrudList: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n MasterDetail: [{ label: 'Sales', targetScreen: 'Dashboard' }, { label: 'Customers' }],\n DetailView: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'Bamboo Watch' }],\n FormPage: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products', targetScreen: 'CrudList' }, { label: 'New product' }],\n Empty: [{ label: 'Catalog', targetScreen: 'Dashboard' }, { label: 'Products' }],\n Documentation: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Documentation' }],\n ProfileSettings: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Your profile' }],\n UserManagement: [{ label: 'Administration', targetScreen: 'Dashboard' }, { label: 'Users' }],\n Invoice: [{ label: 'Billing', targetScreen: 'Dashboard' }, { label: 'INV-2043' }],\n Help: [{ label: 'Support', targetScreen: 'Dashboard' }, { label: 'Help' }],\n ModuleWorkspace: [{ label: 'Operations' }],\n FeatureSection: [{ label: 'Operations', targetScreen: 'ModuleWorkspace' }, { label: 'Adjustments' }],\n SliceSection: [\n { label: 'Operations', targetScreen: 'ModuleWorkspace' },\n { label: 'Adjustments', targetScreen: 'FeatureSection' },\n { label: 'Record an adjustment' },\n ],\n};\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const isFullPage = fullPageTemplateNames.has(template.name);\n const layout: Layout = isFullPage ? fullPageLayout : appShellLayout;\n const chrome = isFullPage ? fullPageChrome() : applicationChrome(template.name, breadcrumbs[template.name] ?? [{ label: template.displayName ?? template.name }]);\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: isFullPage ? LayoutName.FullPage : LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(chrome, templateContentInLayout(placeable, layout)),\n forms: [],\n contributions: isFullPage ? [] : navigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * Almost every template fits the layout's own `content` slot, so its chain is just itself. The three\n * nesting-chain templates are the exception, and the only ones that need the walk - which is the honest\n * version of the story: nesting exists for the applications that need it, and costs nothing for the ones\n * that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/**\n * The gallery: one screen per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n */\nexport const galleryScreens: Screen[] = galleryScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function galleryScreen(name: string): Screen | undefined {\n return galleryScreens.find(screen => screen.name === name);\n}\n"],"names":["galleryScreenTemplates","workspaceTemplates","supportTemplates","authTemplates","statusTemplates","nestingChainTemplates","fullPageTemplateNames","Set","map","template","name","breadcrumbs","Dashboard","label","CrudList","targetScreen","MasterDetail","DetailView","FormPage","Empty","Documentation","ProfileSettings","UserManagement","Invoice","Help","ModuleWorkspace","FeatureSection","SliceSection","screenFor","isFullPage","has","layout","fullPageLayout","appShellLayout","chrome","fullPageChrome","applicationChrome","displayName","placeable","nestScreenTemplates","containmentChainFor","LayoutName","FullPage","AppShell","screenTemplate","slotContent","mergeSlotContent","templateContentInLayout","forms","contributions","navigationContributions","depth","findIndex","candidate","slice","content","merged","slotName","elements","Object","entries","galleryScreens","galleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AAaA;;;;;;UAOaA,sBAAAA,GAA2C;AACjDC,IAAAA,GAAAA,qCAAAA;AACAC,IAAAA,GAAAA,iCAAAA;AACAC,IAAAA,GAAAA,2BAAAA;AACAC,IAAAA,GAAAA,+BAAAA;AACAC,IAAAA,GAAAA;;AAGP,sHACA,MAAMC,qBAAAA,GAAwB,IAAIC,GAAAA,CAAI;AAAIJ,IAAAA,GAAAA,2BAAAA;AAAkBC,IAAAA,GAAAA;AAAgB,CAAA,CAACI,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASC,IAAI,CAAA,CAAA;AAE1G,4DACA,MAAMC,WAAAA,GAAiD;IACnDC,SAAAA,EAAW;AAAC,QAAA;YAAEC,KAAAA,EAAO;AAAY;AAAE,KAAA;IACnCC,QAAAA,EAAU;AAAC,QAAA;YAAED,KAAAA,EAAO,SAAA;YAAWE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAW;AAAE,KAAA;IAClFG,YAAAA,EAAc;AAAC,QAAA;YAAEH,KAAAA,EAAO,OAAA;YAASE,YAAAA,EAAc;AAAY,SAAA;AAAG,QAAA;YAAEF,KAAAA,EAAO;AAAY;AAAE,KAAA;IACrFI,UAAAA,EAA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otName.js');
|
|
10
10
|
var elements = require('./elements.js');
|
|
11
11
|
var widgets = require('./widgets.js');
|
|
12
|
+
var templateProvenance = require('../templateProvenance.js');
|
|
12
13
|
|
|
13
14
|
// Copyright (c) Cratis. All rights reserved.
|
|
14
15
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -49,7 +50,10 @@ var widgets = require('./widgets.js');
|
|
|
49
50
|
]
|
|
50
51
|
},
|
|
51
52
|
displayName: 'Error',
|
|
52
|
-
description: 'A server-side failure, said plainly, with a way onward.'
|
|
53
|
+
description: 'A server-side failure, said plainly, with a way onward.',
|
|
54
|
+
metadata: {
|
|
55
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
56
|
+
}
|
|
53
57
|
};
|
|
54
58
|
/** Signed in, and still not allowed. */ const accessDeniedTemplate = {
|
|
55
59
|
name: 'AccessDenied',
|
|
@@ -81,7 +85,10 @@ var widgets = require('./widgets.js');
|
|
|
81
85
|
]
|
|
82
86
|
},
|
|
83
87
|
displayName: 'Access denied',
|
|
84
|
-
description: 'A refusal that distinguishes "not signed in" from "not allowed".'
|
|
88
|
+
description: 'A refusal that distinguishes "not signed in" from "not allowed".',
|
|
89
|
+
metadata: {
|
|
90
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
91
|
+
}
|
|
85
92
|
};
|
|
86
93
|
/** No such address. */ const notFoundTemplate = {
|
|
87
94
|
name: 'NotFound',
|
|
@@ -101,7 +108,8 @@ var widgets = require('./widgets.js');
|
|
|
101
108
|
elements.text('not-found-title', 'That page is not here'),
|
|
102
109
|
elements.text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),
|
|
103
110
|
elements.externalComponent('not-found-search', 'inputText', {
|
|
104
|
-
placeholder: 'Search instead'
|
|
111
|
+
placeholder: 'Search instead',
|
|
112
|
+
ariaLabel: 'Search'
|
|
105
113
|
}),
|
|
106
114
|
elements.button('not-found-home', 'Back to the dashboard', {
|
|
107
115
|
severity: 'secondary',
|
|
@@ -111,7 +119,10 @@ var widgets = require('./widgets.js');
|
|
|
111
119
|
]
|
|
112
120
|
},
|
|
113
121
|
displayName: 'Not found',
|
|
114
|
-
description: 'A wrong address, with a search box rather than a dead end.'
|
|
122
|
+
description: 'A wrong address, with a search box rather than a dead end.',
|
|
123
|
+
metadata: {
|
|
124
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
125
|
+
}
|
|
115
126
|
};
|
|
116
127
|
/** The page that has to do the selling. */ const landingTemplate = {
|
|
117
128
|
name: 'Landing',
|
|
@@ -173,7 +184,10 @@ var widgets = require('./widgets.js');
|
|
|
173
184
|
]
|
|
174
185
|
},
|
|
175
186
|
displayName: 'Landing',
|
|
176
|
-
description: 'The marketing front door, with its own navigation because it has no application chrome.'
|
|
187
|
+
description: 'The marketing front door, with its own navigation because it has no application chrome.',
|
|
188
|
+
metadata: {
|
|
189
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
190
|
+
}
|
|
177
191
|
};
|
|
178
192
|
/** The four status and marketing templates. */ const statusTemplates = [
|
|
179
193
|
errorTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusTemplates.js","sources":["../../../gallery/statusTemplates.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, panel, text } from './elements';\nimport { widget } from './widgets';\n\n/**\n * The four screens that are not part of anyone's plan: a server error, a refusal, a wrong address, and the\n * page that has to sell the product before any of the others exist.\n *\n * They use the full-page layout for the same reason the sign-in screens do - none of them has navigation\n * to render - and they matter more than their frequency suggests. An error page is the screen most likely\n * to be someone's first impression of how carefully an application was built.\n */\n\n/** Something broke on our side. */\nexport const errorTemplate: ScreenTemplate = {\n name: 'Error',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('error-card', [\n externalComponent('error-tag', 'tag', { value: '500', severity: 'danger' }),\n text('error-title', 'Something went wrong on our side'),\n text('error-message', 'The team has been told. Try again in a moment - nothing you were working on was lost.'),\n panel('error-actions', [\n button('error-retry', 'Try again', { severity: 'primary' }),\n button('error-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Error',\n description: 'A server-side failure, said plainly, with a way onward.',\n};\n\n/** Signed in, and still not allowed. */\nexport const accessDeniedTemplate: ScreenTemplate = {\n name: 'AccessDenied',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('denied-card', [\n externalComponent('denied-tag', 'tag', { value: '403', severity: 'warning' }),\n text('denied-title', 'You do not have access to this'),\n text('denied-message', 'Your account is signed in, but it is not allowed here. An administrator can change that.'),\n panel('denied-actions', [\n button('denied-request', 'Request access', { severity: 'primary' }),\n button('denied-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Access denied',\n description: 'A refusal that distinguishes \"not signed in\" from \"not allowed\".',\n};\n\n/** No such address. */\nexport const notFoundTemplate: ScreenTemplate = {\n name: 'NotFound',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('not-found-card', [\n externalComponent('not-found-tag', 'tag', { value: '404', severity: 'info' }),\n text('not-found-title', 'That page is not here'),\n text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),\n externalComponent('not-found-search', 'inputText', { placeholder: 'Search instead' }),\n button('not-found-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ],\n },\n displayName: 'Not found',\n description: 'A wrong address, with a search box rather than a dead end.',\n};\n\n/** The page that has to do the selling. */\nexport const landingTemplate: ScreenTemplate = {\n name: 'Landing',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n panel('landing-nav', [\n externalComponent('landing-logo', ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n button('landing-signin', 'Sign in', { severity: 'secondary', targetScreen: 'Login' }),\n button('landing-start', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n ],\n [TemplateSlotName.Body]: [\n card('landing-hero', [\n text('landing-headline', 'Ship the shell on day one'),\n text('landing-subhead', 'Eight menu modes, twenty screen templates and two themes, in one blueprint an application picks once.'),\n button('landing-cta', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n widget('landing-feature-modes', 'Every mode people expect', [text('landing-modes-text', 'Static, overlay, slim, slim+, compact, horizontal, reveal and drawer.')]),\n widget('landing-feature-themes', 'Themeable to the token', [text('landing-themes-text', 'Ten semantic tokens define the whole shell. Swap them and everything follows.')]),\n widget('landing-feature-templates', 'The pages you were going to build anyway', [\n text('landing-templates-text', 'Dashboard, list, detail, form, invoice, settings, help - and every screen around signing in.'),\n ]),\n ],\n [TemplateSlotName.Actions]: [\n panel('landing-footer', [text('landing-copyright', '© Contoso'), button('landing-contact', 'Talk to us', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Landing',\n description: 'The marketing front door, with its own navigation because it has no application chrome.',\n};\n\n/** The four status and marketing templates. */\nexport const statusTemplates: ScreenTemplate[] = [errorTemplate, accessDeniedTemplate, notFoundTemplate, landingTemplate];\n"],"names":["errorTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Body","content","card","externalComponent","value","severity","text","panel","button","targetScreen","displayName","description","accessDeniedTemplate","notFoundTemplate","placeholder","landingTemplate","Header","Actions","ComponentName","Logo","label","initials","widget","statusTemplates"],"mappings":";;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,wCAGM,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BAAyB,0BAAA,EAA4B;AAAChB,gBAAAA,aAAAA,CAAK,oBAAA,EAAsB,uEAAA;AAAyE,aAAA,CAAA;AACjKgB,YAAAA,cAAAA,CAAO,0BAA0B,wBAAA,EAA0B;AAAChB,gBAAAA,aAAAA,CAAK,qBAAA,EAAuB,+EAAA;AAAiF,aAAA,CAAA;AACzKgB,YAAAA,cAAAA,CAAO,6BAA6B,0CAAA,EAA4C;AAC5EhB,gBAAAA,aAAAA,CAAK,wBAAA,EAA0B,8FAAA;AAClC,aAAA;AACJ,SAAA;QACD,CAACP,iCAAAA,CAAiBkB,OAAO,GAAG;AACxBV,YAAAA,cAAAA,CAAM,gBAAA,EAAkB;AAACD,gBAAAA,aAAAA,CAAK,mBAAA,EAAqB,WAAA,CAAA;AAAcE,gBAAAA,eAAAA,CAAO,mBAAmB,YAAA,EAAc;oBAAEH,QAAAA,EAAU;AAAY,iBAAA;AAAG,aAAA;AACvI;AACL,KAAA;IACAK,WAAAA,EAAa,SAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,gDACO,MAAMY,eAAAA,GAAoC;AAAC9B,IAAAA,aAAAA;AAAemB,IAAAA,oBAAAA;AAAsBC,IAAAA,gBAAAA;AAAkBE,IAAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"statusTemplates.js","sources":["../../../gallery/statusTemplates.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, panel, text } from './elements';\nimport { widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The four screens that are not part of anyone's plan: a server error, a refusal, a wrong address, and the\n * page that has to sell the product before any of the others exist.\n *\n * They use the full-page layout for the same reason the sign-in screens do - none of them has navigation\n * to render - and they matter more than their frequency suggests. An error page is the screen most likely\n * to be someone's first impression of how carefully an application was built.\n */\n\n/** Something broke on our side. */\nexport const errorTemplate: ScreenTemplate = {\n name: 'Error',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('error-card', [\n externalComponent('error-tag', 'tag', { value: '500', severity: 'danger' }),\n text('error-title', 'Something went wrong on our side'),\n text('error-message', 'The team has been told. Try again in a moment - nothing you were working on was lost.'),\n panel('error-actions', [\n button('error-retry', 'Try again', { severity: 'primary' }),\n button('error-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Error',\n description: 'A server-side failure, said plainly, with a way onward.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Signed in, and still not allowed. */\nexport const accessDeniedTemplate: ScreenTemplate = {\n name: 'AccessDenied',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('denied-card', [\n externalComponent('denied-tag', 'tag', { value: '403', severity: 'warning' }),\n text('denied-title', 'You do not have access to this'),\n text('denied-message', 'Your account is signed in, but it is not allowed here. An administrator can change that.'),\n panel('denied-actions', [\n button('denied-request', 'Request access', { severity: 'primary' }),\n button('denied-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ]),\n ],\n },\n displayName: 'Access denied',\n description: 'A refusal that distinguishes \"not signed in\" from \"not allowed\".',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** No such address. */\nexport const notFoundTemplate: ScreenTemplate = {\n name: 'NotFound',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n card('not-found-card', [\n externalComponent('not-found-tag', 'tag', { value: '404', severity: 'info' }),\n text('not-found-title', 'That page is not here'),\n text('not-found-message', 'The link may be old, or the thing it pointed at may have been removed.'),\n externalComponent('not-found-search', 'inputText', { placeholder: 'Search instead', ariaLabel: 'Search' }),\n button('not-found-home', 'Back to the dashboard', { severity: 'secondary', targetScreen: 'Dashboard' }),\n ]),\n ],\n },\n displayName: 'Not found',\n description: 'A wrong address, with a search box rather than a dead end.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The page that has to do the selling. */\nexport const landingTemplate: ScreenTemplate = {\n name: 'Landing',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n panel('landing-nav', [\n externalComponent('landing-logo', ComponentName.Logo, { label: 'Contoso', initials: 'C' }),\n button('landing-signin', 'Sign in', { severity: 'secondary', targetScreen: 'Login' }),\n button('landing-start', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n ],\n [TemplateSlotName.Body]: [\n card('landing-hero', [\n text('landing-headline', 'Ship the shell on day one'),\n text('landing-subhead', 'Eight menu modes, twenty screen templates and two themes, in one blueprint an application picks once.'),\n button('landing-cta', 'Start free', { severity: 'primary', targetScreen: 'Register' }),\n ]),\n widget('landing-feature-modes', 'Every mode people expect', [text('landing-modes-text', 'Static, overlay, slim, slim+, compact, horizontal, reveal and drawer.')]),\n widget('landing-feature-themes', 'Themeable to the token', [text('landing-themes-text', 'Ten semantic tokens define the whole shell. Swap them and everything follows.')]),\n widget('landing-feature-templates', 'The pages you were going to build anyway', [\n text('landing-templates-text', 'Dashboard, list, detail, form, invoice, settings, help - and every screen around signing in.'),\n ]),\n ],\n [TemplateSlotName.Actions]: [\n panel('landing-footer', [text('landing-copyright', '© Contoso'), button('landing-contact', 'Talk to us', { severity: 'secondary' })]),\n ],\n },\n displayName: 'Landing',\n description: 'The marketing front door, with its own navigation because it has no application chrome.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The four status and marketing templates. */\nexport const statusTemplates: ScreenTemplate[] = [errorTemplate, accessDeniedTemplate, notFoundTemplate, landingTemplate];\n"],"names":["errorTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Body","content","card","externalComponent","value","severity","text","panel","button","targetScreen","displayName","description","metadata","defaultBlueprintTemplateProvenance","accessDeniedTemplate","notFoundTemplate","placeholder","ariaLabel","landingTemplate","Header","Actions","ComponentName","Logo","label","initials","widget","statusTemplates"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;AAOC,wCAGM,MAAMA,aAAAA,GAAgC;IACzCC,IAAAA,EAAM,OAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,iCAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAK,YAAA,EAAc;AACfC,gBAAAA,0BAAAA,CAAkB,aAAa,KAAA,EAAO;oBAAEC,KAAAA,EAAO,KAAA;oBAAOC,QAAAA,EAAU;AAAS,iBAAA,CAAA;AACzEC,gBAAAA,aAAAA,CAAK,aAAA,EAAe,kCAAA,CAAA;AACpBA,gBAAAA,aAAAA,CAAK,eAAA,EAAiB,uFAAA,CAAA;AACtBC,gBAAAA,cAAAA,CAAM,eAAA,EAAiB;AACnBC,oBAAAA,eAAAA,CAAO,eAAe,WAAA,EAAa;wBAAEH,QAAAA,EAAU;AAAU,qBAAA,CAAA;AACzDG,oBAAAA,eAAAA,CAAO,cAAc,uBAAA,EAAyB;wBAAEH,QAAAA,EAAU,WAAA;wBAAaI,YAAAA,EAAc;AAAY,qBAAA;AACpG,iBAAA;AACJ,aAAA;AACJ;AACL,KAAA;IACAC,WAAAA,EAAa,OAAA;IACbC,WAAAA,EAAa,yDAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAmC;AACtD;AAEA,yCACO,MAAMC,oBAAAA,GAAuC;IAChDpB,IAA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A;AAAeqB,IAAAA,oBAAAA;AAAsBC,IAAAA,gBAAAA;AAAkBG,IAAAA;;;;;;;"}
|
|
@@ -8,6 +8,7 @@ require('../layouts/fullPage.js');
|
|
|
8
8
|
var TemplateSlotName = require('./TemplateSlotName.js');
|
|
9
9
|
var elements = require('./elements.js');
|
|
10
10
|
var widgets = require('./widgets.js');
|
|
11
|
+
var templateProvenance = require('../templateProvenance.js');
|
|
11
12
|
|
|
12
13
|
// Copyright (c) Cratis. All rights reserved.
|
|
13
14
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -50,7 +51,10 @@ var widgets = require('./widgets.js');
|
|
|
50
51
|
]
|
|
51
52
|
},
|
|
52
53
|
displayName: 'Documentation',
|
|
53
|
-
description: 'Prose with a table of contents beside it.'
|
|
54
|
+
description: 'Prose with a table of contents beside it.',
|
|
55
|
+
metadata: {
|
|
56
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
57
|
+
}
|
|
54
58
|
};
|
|
55
59
|
/** Profile settings: the signed-in user editing their own account. */ const profileSettingsTemplate = {
|
|
56
60
|
name: 'ProfileSettings',
|
|
@@ -105,7 +109,10 @@ var widgets = require('./widgets.js');
|
|
|
105
109
|
]
|
|
106
110
|
},
|
|
107
111
|
displayName: 'Profile settings',
|
|
108
|
-
description: 'The signed-in user editing their own name, photo, password and notifications.'
|
|
112
|
+
description: 'The signed-in user editing their own name, photo, password and notifications.',
|
|
113
|
+
metadata: {
|
|
114
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
115
|
+
}
|
|
109
116
|
};
|
|
110
117
|
/** User management: administering everybody else. */ const userManagementTemplate = {
|
|
111
118
|
name: 'UserManagement',
|
|
@@ -182,7 +189,10 @@ var widgets = require('./widgets.js');
|
|
|
182
189
|
]
|
|
183
190
|
},
|
|
184
191
|
displayName: 'User management',
|
|
185
|
-
description: 'The people table, with roles, status and an invitation action.'
|
|
192
|
+
description: 'The people table, with roles, status and an invitation action.',
|
|
193
|
+
metadata: {
|
|
194
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
195
|
+
}
|
|
186
196
|
};
|
|
187
197
|
/** Invoice: a printable document, which is a different shape from a screen. */ const invoiceTemplate = {
|
|
188
198
|
name: 'Invoice',
|
|
@@ -260,7 +270,10 @@ var widgets = require('./widgets.js');
|
|
|
260
270
|
]
|
|
261
271
|
},
|
|
262
272
|
displayName: 'Invoice',
|
|
263
|
-
description: 'A printable document: parties, line items and totals.'
|
|
273
|
+
description: 'A printable document: parties, line items and totals.',
|
|
274
|
+
metadata: {
|
|
275
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
276
|
+
}
|
|
264
277
|
};
|
|
265
278
|
/** Help: the answers, and a way to ask when they are not there. */ const helpTemplate = {
|
|
266
279
|
name: 'Help',
|
|
@@ -282,7 +295,8 @@ var widgets = require('./widgets.js');
|
|
|
282
295
|
],
|
|
283
296
|
[TemplateSlotName.TemplateSlotName.Body]: [
|
|
284
297
|
elements.externalComponent('help-search', 'inputText', {
|
|
285
|
-
placeholder: 'Search help'
|
|
298
|
+
placeholder: 'Search help',
|
|
299
|
+
ariaLabel: 'Search help'
|
|
286
300
|
}),
|
|
287
301
|
widgets.widget('help-popular', 'Popular answers', [
|
|
288
302
|
elements.text('help-1', 'How do I invite someone to the workspace?'),
|
|
@@ -300,7 +314,10 @@ var widgets = require('./widgets.js');
|
|
|
300
314
|
]
|
|
301
315
|
},
|
|
302
316
|
displayName: 'Help',
|
|
303
|
-
description: 'Searchable answers with a route to a human.'
|
|
317
|
+
description: 'Searchable answers with a route to a human.',
|
|
318
|
+
metadata: {
|
|
319
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
320
|
+
}
|
|
304
321
|
};
|
|
305
322
|
/** The five support templates. */ const supportTemplates = [
|
|
306
323
|
documentationTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportTemplates.js","sources":["../../../gallery/supportTemplates.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 { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions, pageHeader, table, widget } from './widgets';\n\n/**\n * The five shapes an application needs that are not the CRUD loop: documentation, the signed-in user's own\n * settings, user administration, a printable document, and help.\n *\n * They are in the set because leaving them out is what makes a template line feel thin. Every real\n * application grows all five, and the ones that were never designed are the ones that end up looking like\n * a different product.\n */\n\n/** Documentation: a table of contents beside prose. */\nexport const documentationTemplate: ScreenTemplate = {\n name: 'Documentation',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.SidePanel]: [\n widget('docs-toc', 'On this page', [\n text('docs-toc-1', 'Getting started'),\n text('docs-toc-2', 'Configuring the shell'),\n text('docs-toc-3', 'Themes'),\n text('docs-toc-4', 'Publishing a blueprint'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n pageHeader('docs-header', 'Getting started', 'Everything you need to run the blueprint locally'),\n card('docs-body', [\n text('docs-intro', 'Install the blueprint, add it to a ui profile, and pick a layout. The shell reads its mode from the configurator and remembers it.'),\n externalComponent('docs-note', 'message', { severity: 'info', text: 'The shell needs its stylesheet imported once, at the host.' }),\n ]),\n ],\n },\n displayName: 'Documentation',\n description: 'Prose with a table of contents beside it.',\n};\n\n/** Profile settings: the signed-in user editing their own account. */\nexport const profileSettingsTemplate: ScreenTemplate = {\n name: 'ProfileSettings',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('profile-header', 'Your profile', 'How you appear to everyone else in the workspace')],\n [TemplateSlotName.Body]: [\n card('profile-identity', [\n externalComponent('profile-avatar', 'avatar', { label: 'AN', size: 'large', shape: 'circle' }),\n field('profile-name', 'Display name', 'inputText', { value: 'Amelia Nyquist' }),\n field('profile-email', 'Email', 'inputText', { value: 'amelia@contoso.com' }),\n externalComponent('profile-photo', 'image', { alt: 'Your current photo' }),\n button('profile-photo-change', 'Change photo', { severity: 'secondary' }),\n ]),\n card('profile-security', [\n field('profile-current', 'Current password', 'password', {}),\n field('profile-new', 'New password', 'password', { feedback: true }),\n field('profile-notify', 'Email me about mentions', 'checkbox', { checked: true }),\n ]),\n ],\n [TemplateSlotName.Actions]: [formActions('profile-actions', 'Save changes')],\n },\n displayName: 'Profile settings',\n description: 'The signed-in user editing their own name, photo, password and notifications.',\n};\n\n/** User management: administering everybody else. */\nexport const userManagementTemplate: ScreenTemplate = {\n name: 'UserManagement',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n pageHeader('users-header', 'Users', '34 people, 3 pending invitations', [button('users-invite', 'Invite people', { severity: 'primary', icon: 'pi pi-user-plus' })]),\n ],\n [TemplateSlotName.Body]: [\n table(\n 'users-table',\n [\n { field: 'name', header: 'Name' },\n { field: 'email', header: 'Email' },\n { field: 'role', header: 'Role' },\n { field: 'status', header: 'Status' },\n { field: 'lastSeen', header: 'Last seen' },\n ],\n [\n { name: 'Amelia Nyquist', email: 'amelia@contoso.com', role: 'Owner', status: 'Active', lastSeen: '2 minutes ago' },\n { name: 'Bjørn Holt', email: 'bjorn@contoso.com', role: 'Administrator', status: 'Active', lastSeen: 'Yesterday' },\n { name: 'Chidi Okafor', email: 'chidi@contoso.com', role: 'Editor', status: 'Active', lastSeen: '3 days ago' },\n { name: 'Dana Whitfield', email: 'dana@contoso.com', role: 'Viewer', status: 'Invited', lastSeen: 'Never' },\n ],\n ),\n ],\n },\n displayName: 'User management',\n description: 'The people table, with roles, status and an invitation action.',\n};\n\n/** Invoice: a printable document, which is a different shape from a screen. */\nexport const invoiceTemplate: ScreenTemplate = {\n name: 'Invoice',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n pageHeader('invoice-header', 'Invoice INV-2043', 'Issued 4 March · Due 3 April', [button('invoice-print', 'Print', { severity: 'secondary', icon: 'pi pi-print' })]),\n ],\n [TemplateSlotName.Body]: [\n card('invoice-parties', [\n text('invoice-from', 'From: Contoso Ltd, 4 Chandler Street, Dublin'),\n text('invoice-to', 'To: Northwind Traders, 18 Quay Road, Cork'),\n ]),\n table(\n 'invoice-lines',\n [\n { field: 'description', header: 'Description' },\n { field: 'quantity', header: 'Quantity' },\n { field: 'unitPrice', header: 'Unit price' },\n { field: 'amount', header: 'Amount' },\n ],\n [\n { description: 'Bamboo Watch', quantity: 12, unitPrice: '$65.00', amount: '$780.00' },\n { description: 'Blue Band', quantity: 4, unitPrice: '$79.00', amount: '$316.00' },\n { description: 'Expedited shipping', quantity: 1, unitPrice: '$144.00', amount: '$144.00' },\n ],\n ),\n card('invoice-total', [text('invoice-subtotal', 'Subtotal: $1,240.00'), text('invoice-vat', 'VAT (23%): $285.20'), text('invoice-due', 'Total due: $1,525.20')]),\n ],\n [TemplateSlotName.Actions]: [formActions('invoice-actions', 'Mark as paid', 'Send reminder')],\n },\n displayName: 'Invoice',\n description: 'A printable document: parties, line items and totals.',\n};\n\n/** Help: the answers, and a way to ask when they are not there. */\nexport const helpTemplate: ScreenTemplate = {\n name: 'Help',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('help-header', 'Help', 'Search the answers, or ask us directly')],\n [TemplateSlotName.Body]: [\n externalComponent('help-search', 'inputText', { placeholder: 'Search help' }),\n widget('help-popular', 'Popular answers', [\n text('help-1', 'How do I invite someone to the workspace?'),\n text('help-2', 'Why can I not see the sidebar on my phone?'),\n text('help-3', 'How do I change the theme?'),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('help-contact', 'Still stuck?', [text('help-contact-text', 'We answer within one working day.'), button('help-contact-button', 'Contact support', { severity: 'primary' })]),\n ],\n },\n displayName: 'Help',\n description: 'Searchable answers with a route to a human.',\n};\n\n/** The five support templates. */\nexport const supportTemplates: ScreenTemplate[] = [documentationTemplate, profileSettingsTemplate, userManagementTemplate, invoiceTemplate, helpTemplate];\n"],"names":["documentationTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","SidePanel","Body","content","widget","text","pageHeader","card","externalComponent","severity","displayName","description","profileSettingsTemplate","Header","Actions","label","size","shape","field","value","alt","button","feedback","checked","formActions","userManagementTemplate","Toolbar","icon","table","header","email","role","status","lastSeen","invoiceTemplate","quantity","unitPrice","amount","helpTemplate","placeholder","supportTemplates"],"mappings":";;;;;;;;;;;AAAA;AACA;AAQA;;;;;;;AAOC,4DAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBC;AAAU,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,kCAAiBE;AAAK;AAAE,KAAA;IAC9EC,OAAAA,EAAS;QACL,CAACH,iCAAAA,CAAiBC,SAAS,GAAG;AAC1BG,YAAAA,cAAAA,CAAO,YAAY,cAAA,EAAgB;AAC/BC,gBAAAA,aAAAA,CAAK,YAAA,EAAc,iBAAA,CAAA;AACnBA,gBAAAA,aAAAA,CAAK,YAAA,EAAc,uBAAA,CAAA;AACnBA,gBAAAA,aAAAA,CAAK,YAAA,EAAc,QAAA,CAAA;AACnBA,gBAAAA,aAAAA,CAAK,YAAA,EAAc,wBAAA;AACtB,aAAA;AACJ,SAAA;QACD,CAACL,iCAAAA,CAAiBE,IAAI,GAAG;A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AA,CAAA;AAC3EnC,YAAAA,cAAAA,CAAO,gBAAgB,iBAAA,EAAmB;AACtCC,gBAAAA,aAAAA,CAAK,QAAA,EAAU,2CAAA,CAAA;AACfA,gBAAAA,aAAAA,CAAK,QAAA,EAAU,4CAAA,CAAA;AACfA,gBAAAA,aAAAA,CAAK,QAAA,EAAU,4BAAA;AAClB,aAAA;AACJ,SAAA;QACD,CAACL,iCAAAA,CAAiBC,SAAS,GAAG;AAC1BG,YAAAA,cAAAA,CAAO,gBAAgB,cAAA,EAAgB;AAACC,gBAAAA,aAAAA,CAAK,mBAAA,EAAqB,mCAAA,CAAA;AAAsCgB,gBAAAA,eAAAA,CAAO,uBAAuB,iBAAA,EAAmB;oBAAEZ,QAAAA,EAAU;AAAU,iBAAA;AAAG,aAAA;AACrL;AACL,KAAA;IACAC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,mCACO,MAAM6B,gBAAAA,GAAqC;AAAC9C,IAAAA,qBAAAA;AAAuBkB,IAAAA,uBAAAA;AAAyBa,IAAAA,sBAAAA;AAAwBS,IAAAA,eAAAA;AAAiBI,IAAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"supportTemplates.js","sources":["../../../gallery/supportTemplates.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 { SlotName } from '../layouts';\nimport { TemplateSlotName } from './TemplateSlotName';\nimport { button, card, externalComponent, text } from './elements';\nimport { field, formActions, pageHeader, table, widget } from './widgets';\nimport { defaultBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The five shapes an application needs that are not the CRUD loop: documentation, the signed-in user's own\n * settings, user administration, a printable document, and help.\n *\n * They are in the set because leaving them out is what makes a template line feel thin. Every real\n * application grows all five, and the ones that were never designed are the ones that end up looking like\n * a different product.\n */\n\n/** Documentation: a table of contents beside prose. */\nexport const documentationTemplate: ScreenTemplate = {\n name: 'Documentation',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.SidePanel }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.SidePanel]: [\n widget('docs-toc', 'On this page', [\n text('docs-toc-1', 'Getting started'),\n text('docs-toc-2', 'Configuring the shell'),\n text('docs-toc-3', 'Themes'),\n text('docs-toc-4', 'Publishing a blueprint'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n pageHeader('docs-header', 'Getting started', 'Everything you need to run the blueprint locally'),\n card('docs-body', [\n text('docs-intro', 'Install the blueprint, add it to a ui profile, and pick a layout. The shell reads its mode from the configurator and remembers it.'),\n externalComponent('docs-note', 'message', { severity: 'info', text: 'The shell needs its stylesheet imported once, at the host.' }),\n ]),\n ],\n },\n displayName: 'Documentation',\n description: 'Prose with a table of contents beside it.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Profile settings: the signed-in user editing their own account. */\nexport const profileSettingsTemplate: ScreenTemplate = {\n name: 'ProfileSettings',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('profile-header', 'Your profile', 'How you appear to everyone else in the workspace')],\n [TemplateSlotName.Body]: [\n card('profile-identity', [\n externalComponent('profile-avatar', 'avatar', { label: 'AN', size: 'large', shape: 'circle' }),\n field('profile-name', 'Display name', 'inputText', { value: 'Amelia Nyquist' }),\n field('profile-email', 'Email', 'inputText', { value: 'amelia@contoso.com' }),\n externalComponent('profile-photo', 'image', { alt: 'Your current photo' }),\n button('profile-photo-change', 'Change photo', { severity: 'secondary' }),\n ]),\n card('profile-security', [\n field('profile-current', 'Current password', 'password', {}),\n field('profile-new', 'New password', 'password', { feedback: true }),\n field('profile-notify', 'Email me about mentions', 'checkbox', { checked: true }),\n ]),\n ],\n [TemplateSlotName.Actions]: [formActions('profile-actions', 'Save changes')],\n },\n displayName: 'Profile settings',\n description: 'The signed-in user editing their own name, photo, password and notifications.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** User management: administering everybody else. */\nexport const userManagementTemplate: ScreenTemplate = {\n name: 'UserManagement',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Toolbar]: [\n pageHeader('users-header', 'Users', '34 people, 3 pending invitations', [button('users-invite', 'Invite people', { severity: 'primary', icon: 'pi pi-user-plus' })]),\n ],\n [TemplateSlotName.Body]: [\n table(\n 'users-table',\n [\n { field: 'name', header: 'Name' },\n { field: 'email', header: 'Email' },\n { field: 'role', header: 'Role' },\n { field: 'status', header: 'Status' },\n { field: 'lastSeen', header: 'Last seen' },\n ],\n [\n { name: 'Amelia Nyquist', email: 'amelia@contoso.com', role: 'Owner', status: 'Active', lastSeen: '2 minutes ago' },\n { name: 'Bjørn Holt', email: 'bjorn@contoso.com', role: 'Administrator', status: 'Active', lastSeen: 'Yesterday' },\n { name: 'Chidi Okafor', email: 'chidi@contoso.com', role: 'Editor', status: 'Active', lastSeen: '3 days ago' },\n { name: 'Dana Whitfield', email: 'dana@contoso.com', role: 'Viewer', status: 'Invited', lastSeen: 'Never' },\n ],\n ),\n ],\n },\n displayName: 'User management',\n description: 'The people table, with roles, status and an invitation action.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Invoice: a printable document, which is a different shape from a screen. */\nexport const invoiceTemplate: ScreenTemplate = {\n name: 'Invoice',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n pageHeader('invoice-header', 'Invoice INV-2043', 'Issued 4 March · Due 3 April', [button('invoice-print', 'Print', { severity: 'secondary', icon: 'pi pi-print' })]),\n ],\n [TemplateSlotName.Body]: [\n card('invoice-parties', [\n text('invoice-from', 'From: Contoso Ltd, 4 Chandler Street, Dublin'),\n text('invoice-to', 'To: Northwind Traders, 18 Quay Road, Cork'),\n ]),\n table(\n 'invoice-lines',\n [\n { field: 'description', header: 'Description' },\n { field: 'quantity', header: 'Quantity' },\n { field: 'unitPrice', header: 'Unit price' },\n { field: 'amount', header: 'Amount' },\n ],\n [\n { description: 'Bamboo Watch', quantity: 12, unitPrice: '$65.00', amount: '$780.00' },\n { description: 'Blue Band', quantity: 4, unitPrice: '$79.00', amount: '$316.00' },\n { description: 'Expedited shipping', quantity: 1, unitPrice: '$144.00', amount: '$144.00' },\n ],\n ),\n card('invoice-total', [text('invoice-subtotal', 'Subtotal: $1,240.00'), text('invoice-vat', 'VAT (23%): $285.20'), text('invoice-due', 'Total due: $1,525.20')]),\n ],\n [TemplateSlotName.Actions]: [formActions('invoice-actions', 'Mark as paid', 'Send reminder')],\n },\n displayName: 'Invoice',\n description: 'A printable document: parties, line items and totals.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** Help: the answers, and a way to ask when they are not there. */\nexport const helpTemplate: ScreenTemplate = {\n name: 'Help',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [pageHeader('help-header', 'Help', 'Search the answers, or ask us directly')],\n [TemplateSlotName.Body]: [\n externalComponent('help-search', 'inputText', { placeholder: 'Search help', ariaLabel: 'Search help' }),\n widget('help-popular', 'Popular answers', [\n text('help-1', 'How do I invite someone to the workspace?'),\n text('help-2', 'Why can I not see the sidebar on my phone?'),\n text('help-3', 'How do I change the theme?'),\n ]),\n ],\n [TemplateSlotName.SidePanel]: [\n widget('help-contact', 'Still stuck?', [text('help-contact-text', 'We answer within one working day.'), button('help-contact-button', 'Contact support', { severity: 'primary' })]),\n ],\n },\n displayName: 'Help',\n description: 'Searchable answers with a route to a human.',\n metadata: { ...defaultBlueprintTemplateProvenance },\n};\n\n/** The five support templates. */\nexport const supportTemplates: ScreenTemplate[] = [documentationTemplate, profileSettingsTemplate, userManagementTemplate, invoiceTemplate, helpTemplate];\n"],"names":["documentationTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","SidePanel","Body","content","widget","text","pageHeader","card","externalComponent","severity","displayName","description","metadata","defaultBlueprintTemplateProvenance","profileSettingsTemplate","Header","Actions","label","size","shape","field","value","alt","button","feedback","checked","formActions","userManagementTemplate","Toolbar","icon","table","header","email","role","status","lastSeen","invoiceTemplate","quantity","unitPrice","amount","helpTemplate","placeholder","ariaLabel","supportTemplates"],"mappings":";;;;;;;;;;;;AAAA;AACA;AASA;;;;;;;AAOC,4DAGM,MAAMA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;AACNC,IAAAA,QAAAA,EAAUC,kBAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,kCAAiBC;AAAU,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,kCAAiBE;AAAK;AAAE,KAAA;IAC9EC,OAAAA,EAAS;QACL,CAACH,iCAAAA,CAAiBC,SAAS,GAAG;AAC1BG,YAAAA,cAAAA,CAAO,YAAY,cAAA,EAAgB;AAC/BC,gBAAAA,aAAAA,CAAK,YAAA,EAAc,iBAAA,CAAA;AACnBA,gBAAAA,aAAAA,CAAK,YAAA,EAAc,uBAAA,CAAA;AACnBA,gBAAAA,aAAAA,CAAK,YAAA,EAAc,QAAA,CAAA;AACnBA,gBAAAA,aAAAA,CAAK,YAAA,EAAc,wBAAA;AACtB,aAAA;AACJ,SAAA;QACD,CAACL,iCAAAA,CAAiBE,IAAI,GAAG;AACrBI,YAAAA,kBAAAA,CAAW,eAAe,iBAAA,EAAmB,kDAAA,CAAA;AAC7CC,YAAAA,aAAAA,CAAK,WAAA,EAAa;AACdF,gBAAAA,aAAAA,CAAK,YAAA,EAAc,oIAAA,CAAA;AACnBG,gBAAAA,0BAAAA,CAAkB,aAAa,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gBAAEiC,WAAAA,EAAa,aAAA;gBAAeC,SAAAA,EAAW;AAAc,aAAA,CAAA;AACrGtC,YAAAA,cAAAA,CAAO,gBAAgB,iBAAA,EAAmB;AACtCC,gBAAAA,aAAAA,CAAK,QAAA,EAAU,2CAAA,CAAA;AACfA,gBAAAA,aAAAA,CAAK,QAAA,EAAU,4CAAA,CAAA;AACfA,gBAAAA,aAAAA,CAAK,QAAA,EAAU,4BAAA;AAClB,aAAA;AACJ,SAAA;QACD,CAACL,iCAAAA,CAAiBC,SAAS,GAAG;AAC1BG,YAAAA,cAAAA,CAAO,gBAAgB,cAAA,EAAgB;AAACC,gBAAAA,aAAAA,CAAK,mBAAA,EAAqB,mCAAA,CAAA;AAAsCkB,gBAAAA,eAAAA,CAAO,uBAAuB,iBAAA,EAAmB;oBAAEd,QAAAA,EAAU;AAAU,iBAAA;AAAG,aAAA;AACrL;AACL,KAAA;IACAC,WAAAA,EAAa,MAAA;IACbC,WAAAA,EAAa,6CAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAmC;AACtD;AAEA,mCACO,MAAM8B,gBAAAA,GAAqC;AAACjD,IAAAA,qBAAAA;AAAuBoB,IAAAA,uBAAAA;AAAyBa,IAAAA,sBAAAA;AAAwBS,IAAAA,eAAAA;AAAiBI,IAAAA;;;;;;;;"}
|
|
@@ -41,12 +41,20 @@ var elements = require('./elements.js');
|
|
|
41
41
|
title
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* A table with real columns and real rows, so a list template looks like a list.
|
|
46
|
+
*
|
|
47
|
+
* The properties are the table's own vocabulary - `rows` for the records and `pageSize` to page them - so
|
|
48
|
+
* a host with the real table loaded shows the rows rather than an empty grid. `emptyMessage` is what the
|
|
49
|
+
* same table says once the rows are gone, which is how a preview shows a template's empty state.
|
|
50
|
+
*/ function table(id, columns, rows, emptyMessage = 'Nothing to show yet') {
|
|
45
51
|
return elements.externalComponent(id, 'dataTable', {
|
|
46
|
-
|
|
52
|
+
rows,
|
|
47
53
|
dataKey: columns[0]?.field ?? 'id',
|
|
48
|
-
|
|
49
|
-
rows
|
|
54
|
+
emptyMessage,
|
|
55
|
+
...rows.length > 8 ? {
|
|
56
|
+
pageSize: 8
|
|
57
|
+
} : {}
|
|
50
58
|
}, {
|
|
51
59
|
columns: columns.map((column)=>elements.externalComponent(`${id}-${column.field}`, 'column', {
|
|
52
60
|
field: column.field,
|
|
@@ -55,10 +63,16 @@ var elements = require('./elements.js');
|
|
|
55
63
|
}))
|
|
56
64
|
});
|
|
57
65
|
}
|
|
58
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* One labeled input in a form template. The visible label is a separate text element, so the input carries
|
|
68
|
+
* the same words as its accessible name - otherwise a screen reader announces an unnamed field.
|
|
69
|
+
*/ function field(id, label, componentName, properties = {}) {
|
|
59
70
|
return elements.panel(id, [
|
|
60
71
|
elements.text(`${id}-label`, label),
|
|
61
|
-
elements.externalComponent(`${id}-input`, componentName,
|
|
72
|
+
elements.externalComponent(`${id}-input`, componentName, {
|
|
73
|
+
ariaLabel: label,
|
|
74
|
+
...properties
|
|
75
|
+
})
|
|
62
76
|
]);
|
|
63
77
|
}
|
|
64
78
|
/** A row of buttons closing a form. */ function formActions(id, confirmLabel, cancelLabel = 'Cancel') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgets.js","sources":["../../../gallery/widgets.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 { button, card, externalComponent, panel, text } from './elements';\n\n/**\n * The repeated pieces the gallery's screen templates are built from.\n *\n * The gallery only earns its place if a preview shows something that looks like an application - a\n * dashboard with four stat cards over two columns of larger widgets, a list with real columns and real\n * rows. Seeded content that says \"Lorem ipsum\" proves the renderer runs and nothing else. These builders\n * are what keep twenty templates' worth of realistic content from becoming twenty pages of literals.\n */\n\n/** A screen's title, subtitle and actions - the furniture every template starts with. */\nexport function pageHeader(id: string, title: string, subtitle: string, actions: SceneElement[] = []): SceneElement {\n return externalComponent(id, ComponentName.PageHeader, { title, subtitle }, { actions });\n}\n\n/**\n * One of the four figures across the top of a dashboard - the composition Sakai's dashboard opens with,\n * and the one every template in the line has copied since.\n */\nexport function statCard(id: string, label: string, value: string, delta: string, icon: string): SceneElement {\n return card(id, [text(`${id}-label`, label), text(`${id}-value`, value), text(`${id}-delta`, delta)], { icon, variant: 'stat' });\n}\n\n/** A titled surface holding a widget's content. */\nexport function widget(id: string, title: string, content: SceneElement[]): SceneElement {\n return card(id, [text(`${id}-title`, title), ...content], { title });\n}\n\n
|
|
1
|
+
{"version":3,"file":"widgets.js","sources":["../../../gallery/widgets.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 { button, card, externalComponent, panel, text } from './elements';\n\n/**\n * The repeated pieces the gallery's screen templates are built from.\n *\n * The gallery only earns its place if a preview shows something that looks like an application - a\n * dashboard with four stat cards over two columns of larger widgets, a list with real columns and real\n * rows. Seeded content that says \"Lorem ipsum\" proves the renderer runs and nothing else. These builders\n * are what keep twenty templates' worth of realistic content from becoming twenty pages of literals.\n */\n\n/** A screen's title, subtitle and actions - the furniture every template starts with. */\nexport function pageHeader(id: string, title: string, subtitle: string, actions: SceneElement[] = []): SceneElement {\n return externalComponent(id, ComponentName.PageHeader, { title, subtitle }, { actions });\n}\n\n/**\n * One of the four figures across the top of a dashboard - the composition Sakai's dashboard opens with,\n * and the one every template in the line has copied since.\n */\nexport function statCard(id: string, label: string, value: string, delta: string, icon: string): SceneElement {\n return card(id, [text(`${id}-label`, label), text(`${id}-value`, value), text(`${id}-delta`, delta)], { icon, variant: 'stat' });\n}\n\n/** A titled surface holding a widget's content. */\nexport function widget(id: string, title: string, content: SceneElement[]): SceneElement {\n return card(id, [text(`${id}-title`, title), ...content], { title });\n}\n\n/**\n * A table with real columns and real rows, so a list template looks like a list.\n *\n * The properties are the table's own vocabulary - `rows` for the records and `pageSize` to page them - so\n * a host with the real table loaded shows the rows rather than an empty grid. `emptyMessage` is what the\n * same table says once the rows are gone, which is how a preview shows a template's empty state.\n */\nexport function table(id: string, columns: { field: string; header: string }[], rows: Record<string, unknown>[], emptyMessage = 'Nothing to show yet'): SceneElement {\n return externalComponent(\n id,\n 'dataTable',\n { rows, dataKey: columns[0]?.field ?? 'id', emptyMessage, ...(rows.length > 8 ? { pageSize: 8 } : {}) },\n { columns: columns.map(column => externalComponent(`${id}-${column.field}`, 'column', { field: column.field, header: column.header, sortable: true })) },\n );\n}\n\n/**\n * One labeled input in a form template. The visible label is a separate text element, so the input carries\n * the same words as its accessible name - otherwise a screen reader announces an unnamed field.\n */\nexport function field(id: string, label: string, componentName: string, properties: Record<string, unknown> = {}): SceneElement {\n return panel(id, [text(`${id}-label`, label), externalComponent(`${id}-input`, componentName, { ariaLabel: label, ...properties })]);\n}\n\n/** A row of buttons closing a form. */\nexport function formActions(id: string, confirmLabel: string, cancelLabel = 'Cancel'): SceneElement {\n return panel(id, [button(`${id}-confirm`, confirmLabel, { severity: 'primary' }), button(`${id}-cancel`, cancelLabel, { severity: 'secondary' })]);\n}\n\n/** The empty state a list shows before anything exists - the designed one, never a build-time apology. */\nexport function emptyState(id: string, title: string, message: string, actionLabel: string): SceneElement {\n return card(id, [\n externalComponent(`${id}-icon`, 'image', { alt: title }),\n text(`${id}-title`, title),\n text(`${id}-message`, message),\n button(`${id}-action`, actionLabel, { severity: 'primary' }),\n ]);\n}\n"],"names":["pageHeader","id","title","subtitle","actions","externalComponent","ComponentName","PageHeader","statCard","label","value","delta","icon","card","text","variant","widget","content","table","columns","rows","emptyMessage","dataKey","field","length","pageSize","map","column","header","sortable","componentName","properties","panel","ariaLabel","formActions","confirmLabel","cancel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AAA,CAAA;AAAID,QAAAA,eAAAA,CAAO,CAAA,EAAGpC,EAAAA,CAAG,OAAO,CAAC,EAAEmC,WAAAA,EAAa;YAAEE,QAAAA,EAAU;AAAY,SAAA;AAAG,KAAA,CAAA;AACrJ;AAEA,2GACO,SAASC,UAAAA,CAAWtC,EAAU,EAAEC,KAAa,EAAEsC,OAAe,EAAEC,WAAmB,EAAA;AACtF,IAAA,OAAO5B,cAAKZ,EAAAA,EAAI;AACZI,QAAAA,0BAAAA,CAAkB,CAAA,EAAGJ,EAAAA,CAAG,KAAK,CAAC,EAAE,OAAA,EAAS;YAAEyC,GAAAA,EAAKxC;AAAM,SAAA,CAAA;AACtDY,QAAAA,aAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,MAAM,CAAC,EAAEC,KAAAA,CAAAA;AACpBY,QAAAA,aAAAA,CAAK,CAAA,EAAGb,EAAAA,CAAG,QAAQ,CAAC,EAAEuC,OAAAA,CAAAA;AACtBH,QAAAA,eAAAA,CAAO,CAAA,EAAGpC,EAAAA,CAAG,OAAO,CAAC,EAAEwC,WAAAA,EAAa;YAAEH,QAAAA,EAAU;AAAU,SAAA;AAC7D,KAAA,CAAA;AACL;;;;;;;;"}
|
|
@@ -9,12 +9,13 @@ require('../layouts/fullPage.js');
|
|
|
9
9
|
var TemplateSlotName = require('./TemplateSlotName.js');
|
|
10
10
|
var elements = require('./elements.js');
|
|
11
11
|
var widgets = require('./widgets.js');
|
|
12
|
+
var templateProvenance = require('../templateProvenance.js');
|
|
12
13
|
|
|
13
14
|
// Copyright (c) Cratis. All rights reserved.
|
|
14
15
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
15
16
|
/**
|
|
16
|
-
* The
|
|
17
|
-
* designed empty state.
|
|
17
|
+
* The six workhorse shapes inside an application shell: a dashboard, a list, master/detail, a detail, a
|
|
18
|
+
* form and the designed empty state.
|
|
18
19
|
*
|
|
19
20
|
* Every one fits the layout's `content` slot, and every one carries realistic seeded content rather than
|
|
20
21
|
* placeholder text. A gallery whose dashboard shows four boxes labeled "Card" proves the renderer runs; a
|
|
@@ -168,7 +169,10 @@ var widgets = require('./widgets.js');
|
|
|
168
169
|
]
|
|
169
170
|
},
|
|
170
171
|
displayName: 'Dashboard',
|
|
171
|
-
description: 'Four stat cards over two columns of widgets - the composition every template line opens with.'
|
|
172
|
+
description: 'Four stat cards over two columns of widgets - the composition every template line opens with.',
|
|
173
|
+
metadata: {
|
|
174
|
+
...templateProvenance.sakaiCompositionProvenance
|
|
175
|
+
}
|
|
172
176
|
};
|
|
173
177
|
/** The list: a filter toolbar, a real table, and the row actions a list needs. */ const crudListTemplate = {
|
|
174
178
|
name: 'CrudList',
|
|
@@ -194,7 +198,8 @@ var widgets = require('./widgets.js');
|
|
|
194
198
|
})
|
|
195
199
|
]),
|
|
196
200
|
elements.externalComponent('crud-search', 'inputText', {
|
|
197
|
-
placeholder: 'Search products'
|
|
201
|
+
placeholder: 'Search products',
|
|
202
|
+
ariaLabel: 'Search products'
|
|
198
203
|
})
|
|
199
204
|
],
|
|
200
205
|
[TemplateSlotName.TemplateSlotName.Body]: [
|
|
@@ -259,7 +264,10 @@ var widgets = require('./widgets.js');
|
|
|
259
264
|
]
|
|
260
265
|
},
|
|
261
266
|
displayName: 'List',
|
|
262
|
-
description: 'A searchable table with a header, primary action and row data.'
|
|
267
|
+
description: 'A searchable table with a header, primary action and row data.',
|
|
268
|
+
metadata: {
|
|
269
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
270
|
+
}
|
|
263
271
|
};
|
|
264
272
|
/** The detail: a summary panel beside the record's own sections. */ const detailViewTemplate = {
|
|
265
273
|
name: 'DetailView',
|
|
@@ -310,7 +318,120 @@ var widgets = require('./widgets.js');
|
|
|
310
318
|
]
|
|
311
319
|
},
|
|
312
320
|
displayName: 'Detail',
|
|
313
|
-
description: 'One record: a header with actions, its sections, and a summary panel.'
|
|
321
|
+
description: 'One record: a header with actions, its sections, and a summary panel.',
|
|
322
|
+
metadata: {
|
|
323
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* Master/detail: the list and the selected record side by side, so working through records does not mean
|
|
328
|
+
* leaving the list. The detail region is an outlet that accepts detail screens, which is what lets a row's
|
|
329
|
+
* destination open a full detail screen in place.
|
|
330
|
+
*
|
|
331
|
+
* At a compact width the two stack, list first, because side-by-side on a phone is two unreadable halves.
|
|
332
|
+
*/ const masterDetailTemplate = {
|
|
333
|
+
name: 'MasterDetail',
|
|
334
|
+
fitsSlot: SlotName.SlotName.Content,
|
|
335
|
+
slots: [
|
|
336
|
+
{
|
|
337
|
+
name: TemplateSlotName.TemplateSlotName.Header
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: TemplateSlotName.TemplateSlotName.Primary
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: TemplateSlotName.TemplateSlotName.SidePanel
|
|
344
|
+
}
|
|
345
|
+
],
|
|
346
|
+
outlets: [
|
|
347
|
+
{
|
|
348
|
+
name: 'master-detail.detail',
|
|
349
|
+
description: 'The selected record.',
|
|
350
|
+
accepts: [
|
|
351
|
+
'Detail'
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
arrangement: {
|
|
356
|
+
root: flowBuilders.column([
|
|
357
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Header),
|
|
358
|
+
flowBuilders.grid([
|
|
359
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Primary),
|
|
360
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.SidePanel)
|
|
361
|
+
], 2, 16)
|
|
362
|
+
], 16),
|
|
363
|
+
overrides: [
|
|
364
|
+
{
|
|
365
|
+
width: scene_model.WidthSizeClass.Compact,
|
|
366
|
+
root: flowBuilders.column([
|
|
367
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Header),
|
|
368
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.Primary),
|
|
369
|
+
flowBuilders.slotLeaf(TemplateSlotName.TemplateSlotName.SidePanel)
|
|
370
|
+
], 16)
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
},
|
|
374
|
+
content: {
|
|
375
|
+
[TemplateSlotName.TemplateSlotName.Header]: [
|
|
376
|
+
widgets.pageHeader('master-header', 'Customers', '1,204 customers, 38 with overdue invoices')
|
|
377
|
+
],
|
|
378
|
+
[TemplateSlotName.TemplateSlotName.Primary]: [
|
|
379
|
+
widgets.table('customers-table', [
|
|
380
|
+
{
|
|
381
|
+
field: 'name',
|
|
382
|
+
header: 'Customer'
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
field: 'city',
|
|
386
|
+
header: 'City'
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
field: 'balance',
|
|
390
|
+
header: 'Balance'
|
|
391
|
+
}
|
|
392
|
+
], [
|
|
393
|
+
{
|
|
394
|
+
name: 'Northwind Traders',
|
|
395
|
+
city: 'Seattle',
|
|
396
|
+
balance: '$4,200.00'
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: 'Contoso Ltd',
|
|
400
|
+
city: 'Oslo',
|
|
401
|
+
balance: '$0.00'
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
name: 'Fabrikam',
|
|
405
|
+
city: 'Lyon',
|
|
406
|
+
balance: '$12,940.50'
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
name: 'Adventure Works',
|
|
410
|
+
city: 'Denver',
|
|
411
|
+
balance: '$318.20'
|
|
412
|
+
}
|
|
413
|
+
], 'No customers match the search')
|
|
414
|
+
],
|
|
415
|
+
[TemplateSlotName.TemplateSlotName.SidePanel]: [
|
|
416
|
+
widgets.widget('customer-detail', 'Northwind Traders', [
|
|
417
|
+
elements.text('customer-contact', 'Contact: Amelia Nyquist'),
|
|
418
|
+
elements.text('customer-terms', 'Payment terms: 30 days'),
|
|
419
|
+
elements.externalComponent('customer-status', 'tag', {
|
|
420
|
+
value: 'Overdue',
|
|
421
|
+
severity: 'warning'
|
|
422
|
+
}),
|
|
423
|
+
elements.button('customer-open', 'Open customer', {
|
|
424
|
+
severity: 'primary'
|
|
425
|
+
})
|
|
426
|
+
])
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
displayName: 'Master/detail',
|
|
430
|
+
description: 'A list beside the selected record, stacking on narrow screens.',
|
|
431
|
+
metadata: {
|
|
432
|
+
...templateProvenance.defaultBlueprintTemplateProvenance,
|
|
433
|
+
type: 'Workspace'
|
|
434
|
+
}
|
|
314
435
|
};
|
|
315
436
|
/** The form: fields, grouped, with the actions that close them. */ const formPageTemplate = {
|
|
316
437
|
name: 'FormPage',
|
|
@@ -360,7 +481,10 @@ var widgets = require('./widgets.js');
|
|
|
360
481
|
]
|
|
361
482
|
},
|
|
362
483
|
displayName: 'Form',
|
|
363
|
-
description: 'A grouped form with the field types an application actually uses.'
|
|
484
|
+
description: 'A grouped form with the field types an application actually uses.',
|
|
485
|
+
metadata: {
|
|
486
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
487
|
+
}
|
|
364
488
|
};
|
|
365
489
|
/** The empty state: what a list looks like before anything exists, designed rather than apologized for. */ const emptyTemplate = {
|
|
366
490
|
name: 'Empty',
|
|
@@ -376,11 +500,15 @@ var widgets = require('./widgets.js');
|
|
|
376
500
|
]
|
|
377
501
|
},
|
|
378
502
|
displayName: 'Empty state',
|
|
379
|
-
description: 'The designed empty state for a list that has nothing in it yet.'
|
|
503
|
+
description: 'The designed empty state for a list that has nothing in it yet.',
|
|
504
|
+
metadata: {
|
|
505
|
+
...templateProvenance.defaultBlueprintTemplateProvenance
|
|
506
|
+
}
|
|
380
507
|
};
|
|
381
508
|
/** The five workspace templates. */ const workspaceTemplates = [
|
|
382
509
|
dashboardTemplate,
|
|
383
510
|
crudListTemplate,
|
|
511
|
+
masterDetailTemplate,
|
|
384
512
|
detailViewTemplate,
|
|
385
513
|
formPageTemplate,
|
|
386
514
|
emptyTemplate
|
|
@@ -391,5 +519,6 @@ exports.dashboardTemplate = dashboardTemplate;
|
|
|
391
519
|
exports.detailViewTemplate = detailViewTemplate;
|
|
392
520
|
exports.emptyTemplate = emptyTemplate;
|
|
393
521
|
exports.formPageTemplate = formPageTemplate;
|
|
522
|
+
exports.masterDetailTemplate = masterDetailTemplate;
|
|
394
523
|
exports.workspaceTemplates = workspaceTemplates;
|
|
395
524
|
//# sourceMappingURL=workspaceTemplates.js.map
|