@cratis/scene.blueprint.default 4.40.0 → 4.42.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/ComponentName.ts +9 -0
- package/defaultBlueprint.ts +1 -0
- package/defaultBlueprintComponents.ts +4 -1
- package/dist/cjs/ComponentName.js +3 -0
- package/dist/cjs/ComponentName.js.map +1 -1
- package/dist/cjs/defaultBlueprint.js +20 -1
- package/dist/cjs/defaultBlueprint.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponentMetadata.js +11 -0
- package/dist/cjs/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/cjs/defaultBlueprintComponents.js +17 -0
- package/dist/cjs/defaultBlueprintComponents.js.map +1 -1
- package/dist/cjs/foundation/ActionButton.js.map +1 -1
- package/dist/cjs/foundation/ActionButtonControl.js +46 -0
- package/dist/cjs/foundation/ActionButtonControl.js.map +1 -0
- package/dist/cjs/foundation/DialogFrame.js +196 -0
- package/dist/cjs/foundation/DialogFrame.js.map +1 -0
- package/dist/cjs/foundation/FormScreenBody.js +13 -3
- package/dist/cjs/foundation/FormScreenBody.js.map +1 -1
- package/dist/cjs/foundation/Notice.js +51 -0
- package/dist/cjs/foundation/Notice.js.map +1 -0
- package/dist/cjs/foundation/formModel.js +1 -0
- package/dist/cjs/foundation/formModel.js.map +1 -1
- package/dist/cjs/foundation/foundationComponentMetadata.js +22 -0
- package/dist/cjs/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/cjs/foundation/foundationDescriptors.js +89 -0
- package/dist/cjs/foundation/foundationDescriptors.js.map +1 -1
- package/dist/cjs/foundation/foundationSamples.js +29 -0
- package/dist/cjs/foundation/foundationSamples.js.map +1 -1
- package/dist/cjs/foundation/foundationStrings.js +3 -1
- package/dist/cjs/foundation/foundationStrings.js.map +1 -1
- package/dist/cjs/foundation/templates/boardScreenTemplate.js +76 -0
- package/dist/cjs/foundation/templates/boardScreenTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/dashboardScreenTemplate.js +128 -0
- package/dist/cjs/foundation/templates/dashboardScreenTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/dialogTemplates.js +254 -0
- package/dist/cjs/foundation/templates/dialogTemplates.js.map +1 -0
- package/dist/cjs/foundation/templates/formScreenTemplate.js +71 -0
- package/dist/cjs/foundation/templates/formScreenTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/index.js +57 -0
- package/dist/cjs/foundation/templates/index.js.map +1 -0
- package/dist/cjs/foundation/templates/listScreenTemplate.js +124 -0
- package/dist/cjs/foundation/templates/listScreenTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/masterDetailScreenTemplate.js +79 -0
- package/dist/cjs/foundation/templates/masterDetailScreenTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/recordPageTemplate.js +137 -0
- package/dist/cjs/foundation/templates/recordPageTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/stateScreenTemplates.js +252 -0
- package/dist/cjs/foundation/templates/stateScreenTemplates.js.map +1 -0
- package/dist/cjs/foundation/templates/templateParts.js +38 -0
- package/dist/cjs/foundation/templates/templateParts.js.map +1 -0
- package/dist/cjs/foundation/templates/wizardScreenTemplate.js +95 -0
- package/dist/cjs/foundation/templates/wizardScreenTemplate.js.map +1 -0
- package/dist/cjs/foundation/templates/workspaceScreenTemplate.js +62 -0
- package/dist/cjs/foundation/templates/workspaceScreenTemplate.js.map +1 -0
- package/dist/cjs/gallery/GalleryDialogPreview.js +62 -0
- package/dist/cjs/gallery/GalleryDialogPreview.js.map +1 -0
- package/dist/cjs/gallery/GalleryScreenPreview.js +78 -4
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/cjs/gallery/applicationChrome.js +18 -1
- package/dist/cjs/gallery/applicationChrome.js.map +1 -1
- package/dist/cjs/gallery/composeScreen.js +5 -3
- package/dist/cjs/gallery/composeScreen.js.map +1 -1
- package/dist/cjs/gallery/dialogTemplates.js +41 -36
- package/dist/cjs/gallery/dialogTemplates.js.map +1 -1
- package/dist/cjs/gallery/screens.js +87 -3
- package/dist/cjs/gallery/screens.js.map +1 -1
- package/dist/cjs/index.js +61 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/ComponentName.d.ts +3 -0
- package/dist/esm/ComponentName.d.ts.map +1 -1
- package/dist/esm/ComponentName.js +3 -0
- package/dist/esm/ComponentName.js.map +1 -1
- package/dist/esm/defaultBlueprint.d.ts.map +1 -1
- package/dist/esm/defaultBlueprint.js +20 -1
- package/dist/esm/defaultBlueprint.js.map +1 -1
- package/dist/esm/defaultBlueprintComponentMetadata.js +11 -0
- package/dist/esm/defaultBlueprintComponentMetadata.js.map +1 -1
- package/dist/esm/defaultBlueprintComponents.d.ts.map +1 -1
- package/dist/esm/defaultBlueprintComponents.js +17 -0
- package/dist/esm/defaultBlueprintComponents.js.map +1 -1
- package/dist/esm/foundation/ActionButton.d.ts +1 -1
- package/dist/esm/foundation/ActionButton.d.ts.map +1 -1
- package/dist/esm/foundation/ActionButton.js.map +1 -1
- package/dist/esm/foundation/ActionButtonControl.d.ts +3 -0
- package/dist/esm/foundation/ActionButtonControl.d.ts.map +1 -0
- package/dist/esm/foundation/ActionButtonControl.js +44 -0
- package/dist/esm/foundation/ActionButtonControl.js.map +1 -0
- package/dist/esm/foundation/DialogFrame.d.ts +14 -0
- package/dist/esm/foundation/DialogFrame.d.ts.map +1 -0
- package/dist/esm/foundation/DialogFrame.js +190 -0
- package/dist/esm/foundation/DialogFrame.js.map +1 -0
- package/dist/esm/foundation/FormScreenBody.d.ts.map +1 -1
- package/dist/esm/foundation/FormScreenBody.js +13 -3
- package/dist/esm/foundation/FormScreenBody.js.map +1 -1
- package/dist/esm/foundation/Notice.d.ts +3 -0
- package/dist/esm/foundation/Notice.d.ts.map +1 -0
- package/dist/esm/foundation/Notice.js +49 -0
- package/dist/esm/foundation/Notice.js.map +1 -0
- package/dist/esm/foundation/formModel.d.ts +2 -1
- package/dist/esm/foundation/formModel.d.ts.map +1 -1
- package/dist/esm/foundation/formModel.js +1 -0
- package/dist/esm/foundation/formModel.js.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.d.ts.map +1 -1
- package/dist/esm/foundation/foundationComponentMetadata.js +22 -0
- package/dist/esm/foundation/foundationComponentMetadata.js.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.d.ts.map +1 -1
- package/dist/esm/foundation/foundationDescriptors.js +89 -0
- package/dist/esm/foundation/foundationDescriptors.js.map +1 -1
- package/dist/esm/foundation/foundationSamples.d.ts.map +1 -1
- package/dist/esm/foundation/foundationSamples.js +29 -0
- package/dist/esm/foundation/foundationSamples.js.map +1 -1
- package/dist/esm/foundation/foundationStrings.d.ts +2 -0
- package/dist/esm/foundation/foundationStrings.d.ts.map +1 -1
- package/dist/esm/foundation/foundationStrings.js +3 -1
- package/dist/esm/foundation/foundationStrings.js.map +1 -1
- package/dist/esm/foundation/index.d.ts +4 -0
- package/dist/esm/foundation/index.d.ts.map +1 -1
- package/dist/esm/foundation/index.js +4 -0
- package/dist/esm/foundation/index.js.map +1 -1
- package/dist/esm/foundation/templates/boardScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/boardScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/boardScreenTemplate.js +74 -0
- package/dist/esm/foundation/templates/boardScreenTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/dashboardScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/dashboardScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/dashboardScreenTemplate.js +126 -0
- package/dist/esm/foundation/templates/dashboardScreenTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/dialogTemplates.d.ts +20 -0
- package/dist/esm/foundation/templates/dialogTemplates.d.ts.map +1 -0
- package/dist/esm/foundation/templates/dialogTemplates.js +243 -0
- package/dist/esm/foundation/templates/dialogTemplates.js.map +1 -0
- package/dist/esm/foundation/templates/formScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/formScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/formScreenTemplate.js +69 -0
- package/dist/esm/foundation/templates/formScreenTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/index.d.ts +13 -0
- package/dist/esm/foundation/templates/index.d.ts.map +1 -0
- package/dist/esm/foundation/templates/index.js +27 -0
- package/dist/esm/foundation/templates/index.js.map +1 -0
- package/dist/esm/foundation/templates/listScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/listScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/listScreenTemplate.js +122 -0
- package/dist/esm/foundation/templates/listScreenTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/masterDetailScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/masterDetailScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/masterDetailScreenTemplate.js +77 -0
- package/dist/esm/foundation/templates/masterDetailScreenTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/recordPageTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/recordPageTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/recordPageTemplate.js +135 -0
- package/dist/esm/foundation/templates/recordPageTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.d.ts +8 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.d.ts.map +1 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.js +245 -0
- package/dist/esm/foundation/templates/stateScreenTemplates.js.map +1 -0
- package/dist/esm/foundation/templates/templateParts.d.ts +6 -0
- package/dist/esm/foundation/templates/templateParts.d.ts.map +1 -0
- package/dist/esm/foundation/templates/templateParts.js +33 -0
- package/dist/esm/foundation/templates/templateParts.js.map +1 -0
- package/dist/esm/foundation/templates/wizardScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/wizardScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/wizardScreenTemplate.js +93 -0
- package/dist/esm/foundation/templates/wizardScreenTemplate.js.map +1 -0
- package/dist/esm/foundation/templates/workspaceScreenTemplate.d.ts +3 -0
- package/dist/esm/foundation/templates/workspaceScreenTemplate.d.ts.map +1 -0
- package/dist/esm/foundation/templates/workspaceScreenTemplate.js +60 -0
- package/dist/esm/foundation/templates/workspaceScreenTemplate.js.map +1 -0
- package/dist/esm/gallery/FoundationDialogs.stories.d.ts +35 -0
- package/dist/esm/gallery/FoundationDialogs.stories.d.ts.map +1 -0
- package/dist/esm/gallery/FoundationDialogs.stories.js +38 -0
- package/dist/esm/gallery/FoundationDialogs.stories.js.map +1 -0
- package/dist/esm/gallery/GalleryDialogPreview.d.ts +17 -0
- package/dist/esm/gallery/GalleryDialogPreview.d.ts.map +1 -0
- package/dist/esm/gallery/GalleryDialogPreview.js +59 -0
- package/dist/esm/gallery/GalleryDialogPreview.js.map +1 -0
- package/dist/esm/gallery/GalleryScreenPreview.d.ts +13 -2
- package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -1
- package/dist/esm/gallery/GalleryScreenPreview.js +77 -5
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/esm/gallery/applicationChrome.d.ts.map +1 -1
- package/dist/esm/gallery/applicationChrome.js +18 -1
- package/dist/esm/gallery/applicationChrome.js.map +1 -1
- package/dist/esm/gallery/composeScreen.d.ts.map +1 -1
- package/dist/esm/gallery/composeScreen.js +5 -3
- package/dist/esm/gallery/composeScreen.js.map +1 -1
- package/dist/esm/gallery/dialogTemplates.d.ts.map +1 -1
- package/dist/esm/gallery/dialogTemplates.js +42 -37
- package/dist/esm/gallery/dialogTemplates.js.map +1 -1
- package/dist/esm/gallery/index.d.ts +1 -0
- package/dist/esm/gallery/index.d.ts.map +1 -1
- package/dist/esm/gallery/index.js +1 -0
- package/dist/esm/gallery/index.js.map +1 -1
- package/dist/esm/gallery/screens.d.ts.map +1 -1
- package/dist/esm/gallery/screens.js +87 -3
- package/dist/esm/gallery/screens.js.map +1 -1
- package/dist/esm/index.js +17 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/foundation/ActionButton.tsx +1 -1
- package/foundation/ActionButtonControl.tsx +37 -0
- package/foundation/DialogFrame.tsx +138 -0
- package/foundation/FormScreenBody.tsx +6 -3
- package/foundation/Notice.tsx +33 -0
- package/foundation/formModel.ts +1 -0
- package/foundation/foundationComponentMetadata.ts +3 -0
- package/foundation/foundationDescriptors.ts +41 -0
- package/foundation/foundationSamples.ts +3 -0
- package/foundation/foundationStrings.ts +2 -0
- package/foundation/index.ts +4 -0
- package/foundation/templates/boardScreenTemplate.ts +28 -0
- package/foundation/templates/dashboardScreenTemplate.ts +37 -0
- package/foundation/templates/dialogTemplates.ts +114 -0
- package/foundation/templates/formScreenTemplate.ts +28 -0
- package/foundation/templates/index.ts +28 -0
- package/foundation/templates/listScreenTemplate.ts +37 -0
- package/foundation/templates/masterDetailScreenTemplate.ts +28 -0
- package/foundation/templates/recordPageTemplate.ts +36 -0
- package/foundation/templates/stateScreenTemplates.ts +107 -0
- package/foundation/templates/templateParts.ts +30 -0
- package/foundation/templates/wizardScreenTemplate.ts +33 -0
- package/foundation/templates/workspaceScreenTemplate.ts +27 -0
- package/gallery/FoundationDialogs.stories.tsx +74 -0
- package/gallery/GalleryDialogPreview.tsx +68 -0
- package/gallery/GalleryScreenPreview.tsx +64 -5
- package/gallery/applicationChrome.ts +6 -1
- package/gallery/composeScreen.ts +4 -2
- package/gallery/dialogTemplates.ts +22 -17
- package/gallery/index.ts +1 -0
- package/gallery/screens.ts +18 -2
- package/package.json +10 -8
- package/sampleData/foundation-en.json +661 -0
- package/shell/layout.css +219 -0
- package/thumbnails/BoardScreen.svg +15 -0
- package/thumbnails/ConfirmDialog.svg +12 -0
- package/thumbnails/DashboardScreen.svg +18 -0
- package/thumbnails/DetailDialog.svg +11 -0
- package/thumbnails/ErrorScreen.svg +11 -0
- package/thumbnails/FilterDialog.svg +16 -0
- package/thumbnails/ForbiddenScreen.svg +10 -0
- package/thumbnails/FormDialog.svg +12 -0
- package/thumbnails/FormScreen.svg +14 -0
- package/thumbnails/ListScreen.svg +16 -0
- package/thumbnails/LoginScreen.svg +12 -0
- package/thumbnails/LookupDialog.svg +13 -0
- package/thumbnails/MasterDetailScreen.svg +22 -0
- package/thumbnails/NotFoundScreen.svg +9 -0
- package/thumbnails/QuickCreateDialog.svg +12 -0
- package/thumbnails/RecordPage.svg +17 -0
- package/thumbnails/SideSheet.svg +13 -0
- package/thumbnails/WizardScreen.svg +16 -0
- package/thumbnails/WorkspaceScreen.svg +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"masterDetailScreenTemplate.js","sources":["../../../../foundation/templates/masterDetailScreenTemplate.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, WidthSizeClass } from '@cratis/scene.model';\nimport { column, grid, row, slotLeaf } from '../../layouts/flowBuilders';\nimport { component, foundationTemplateProvenance, fromQuery, thumbnailOf } from './templateParts';\n\n/**\n * The master/detail: a list beside the selected record. The selection lives in the address, so a link opens a record and the back button returns to the\n * list; on a phone the two become a navigation stack - the list, then the record with a way back. It lives in a module workspace's `moduleContent`.\n */\nexport const masterDetailScreenTemplate: ScreenTemplate = {\n name: 'MasterDetailScreen',\n fitsSlot: 'WorkspaceScreen.moduleContent',\n slots: [{ name: 'list' }, { name: 'details' }],\n arrangement: {\n root: grid([slotLeaf('list'), slotLeaf('details', { span: 2 })], 3, 16),\n overrides: [{ width: WidthSizeClass.Compact, root: column([slotLeaf('list'), slotLeaf('details')], 16) }],\n },\n content: {\n list: [component('md-list', 'dataList', { label: 'Accounts', rows: fromQuery('Deals'), columns: fromQuery('DealColumns'), titleField: 'name', selectionMode: 'single', urlKey: 'md' })],\n details: [component('md-detail', 'tabSet', { tabs: fromQuery('RecordTabs'), urlKey: 'mdtab', label: 'Account' })],\n },\n displayName: 'Master/detail with address selection',\n description: 'A list beside the selected record that stacks into a navigation stack on a phone.',\n outlets: [{ name: 'master-detail.detail', description: 'The selected record.', accepts: ['Detail'] }],\n metadata: { ...foundationTemplateProvenance, type: 'Workspace', category: 'Foundation / Workspace', thumbnail: thumbnailOf('MasterDetailScreen') },\n};\n"],"names":["masterDetailScreenTemplate","name","fitsSlot","slots","arrangement","root","grid","slotLeaf","span","overrides","width","WidthSizeClass","Compact","column","content","list","component","label","rows","fromQuery","columns","titleField","selectionMode","urlKey","details","tabs","displayName","description","outlets","accepts","metadata","foundationTemplateProvenance","type","category","thumbnail","thumbnailOf"],"mappings":";;;;AAAA;AACA;AAMA;;;UAIaA,0BAAAA,GAA6C;IACtDC,IAAAA,EAAM,oBAAA;IACNC,QAAAA,EAAU,+BAAA;IACVC,KAAAA,EAAO;AAAC,QAAA;YAAEF,IAAAA,EAAM;AAAO,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAU;AAAE,KAAA;IAC9CG,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,IAAAA,CAAK;YAACC,QAAAA,CAAS,MAAA,CAAA;AAASA,YAAAA,QAAAA,CAAS,SAAA,EAAW;gBAAEC,IAAAA,EAAM;AAAE,aAAA;AAAG,SAAA,EAAE,CAAA,EAAG,EAAA,CAAA;QACpEC,SAAAA,EAAW;AAAC,YAAA;AAAEC,gBAAAA,KAAAA,EAAOC,eAAeC,OAAO;AAAEP,gBAAAA,IAAAA,EAAMQ,MAAAA,CAAO;oBAACN,QAAAA,CAAS,MAAA,CAAA;oBAASA,QAAAA,CAAS,SAAA;iBAAW,EAAE,EAAA;AAAI;AAAE;AAC7G,KAAA;IACAO,OAAAA,EAAS;QACLC,IAAAA,EAAM;AAACC,YAAAA,SAAAA,CAAU,WAAW,UAAA,EAAY;gBAAEC,KAAAA,EAAO,UAAA;AAAYC,gBAAAA,IAAAA,EAAMC,SAAAA,CAAU,OAAA,CAAA;AAAUC,gBAAAA,OAAAA,EAASD,SAAAA,CAAU,aAAA,CAAA;gBAAgBE,UAAAA,EAAY,MAAA;gBAAQC,aAAAA,EAAe,QAAA;gBAAUC,MAAAA,EAAQ;AAAK,aAAA;AAAG,SAAA;QACvLC,OAAAA,EAAS;AAACR,YAAAA,SAAAA,CAAU,aAAa,QAAA,EAAU;AAAES,gBAAAA,IAAAA,EAAMN,SAAAA,CAAU,YAAA,CAAA;gBAAeI,MAAAA,EAAQ,OAAA;gBAASN,KAAAA,EAAO;AAAU,aAAA;AAAG;AACrH,KAAA;IACAS,WAAAA,EAAa,sCAAA;IACbC,WAAAA,EAAa,mFAAA;IACbC,OAAAA,EAAS;AAAC,QAAA;YAAE3B,IAAAA,EAAM,sBAAA;YAAwB0B,WAAAA,EAAa,sBAAA;YAAwBE,OAAAA,EAAS;AAAC,gBAAA;AAAS;AAAC;AAAE,KAAA;IACrGC,QAAAA,EAAU;AAAE,QAAA,GAAGC,4BAA4B;QAAEC,IAAAA,EAAM,WAAA;QAAaC,QAAAA,EAAU,wBAAA;AAA0BC,QAAAA,SAAAA,EAAWC,WAAAA,CAAY,oBAAA;AAAsB;AACrJ;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordPageTemplate.d.ts","sourceRoot":"","sources":["../../../../foundation/templates/recordPageTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAQrE,eAAO,MAAM,kBAAkB,EAAE,cAwBhC,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { WidthSizeClass } from '@cratis/scene.model';
|
|
2
|
+
import { column, slotLeaf, grid } from '../../layouts/flowBuilders.js';
|
|
3
|
+
import { component, fromQuery, foundationTemplateProvenance, thumbnailOf } from './templateParts.js';
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The record page: a header, the key facts, then tabs (overview, related, files, history) with the record's main content, its related records and its
|
|
9
|
+
* activity, and an aside. The tabs are configurable by changing one property.
|
|
10
|
+
*/ const recordPageTemplate = {
|
|
11
|
+
name: 'RecordPage',
|
|
12
|
+
fitsSlot: 'content',
|
|
13
|
+
slots: [
|
|
14
|
+
{
|
|
15
|
+
name: 'header'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'summary'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'tabs'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'main'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'related'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'activity'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'aside'
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
arrangement: {
|
|
37
|
+
root: column([
|
|
38
|
+
slotLeaf('header'),
|
|
39
|
+
slotLeaf('summary'),
|
|
40
|
+
grid([
|
|
41
|
+
column([
|
|
42
|
+
slotLeaf('tabs'),
|
|
43
|
+
slotLeaf('main'),
|
|
44
|
+
slotLeaf('related'),
|
|
45
|
+
slotLeaf('activity')
|
|
46
|
+
], 16, {
|
|
47
|
+
span: 2
|
|
48
|
+
}),
|
|
49
|
+
slotLeaf('aside')
|
|
50
|
+
], 3, 16)
|
|
51
|
+
], 16),
|
|
52
|
+
overrides: [
|
|
53
|
+
{
|
|
54
|
+
width: WidthSizeClass.Compact,
|
|
55
|
+
root: column([
|
|
56
|
+
slotLeaf('header'),
|
|
57
|
+
slotLeaf('summary'),
|
|
58
|
+
slotLeaf('tabs'),
|
|
59
|
+
slotLeaf('main'),
|
|
60
|
+
slotLeaf('related'),
|
|
61
|
+
slotLeaf('activity'),
|
|
62
|
+
slotLeaf('aside')
|
|
63
|
+
], 16)
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
content: {
|
|
68
|
+
header: [
|
|
69
|
+
component('record-header', 'pageHeader', {
|
|
70
|
+
title: fromQuery('RecordValues', '0.name'),
|
|
71
|
+
subtitle: 'Account'
|
|
72
|
+
})
|
|
73
|
+
],
|
|
74
|
+
summary: [
|
|
75
|
+
component('record-value', 'statCard', {
|
|
76
|
+
label: 'Lifetime value',
|
|
77
|
+
value: fromQuery('Kpis', '0.value'),
|
|
78
|
+
format: 'currency',
|
|
79
|
+
currency: 'USD'
|
|
80
|
+
}),
|
|
81
|
+
component('record-status', 'statusChip', {
|
|
82
|
+
status: fromQuery('Deals', '0.status'),
|
|
83
|
+
tone: 'info'
|
|
84
|
+
}),
|
|
85
|
+
component('record-people', 'avatarStack', {
|
|
86
|
+
people: fromQuery('People')
|
|
87
|
+
})
|
|
88
|
+
],
|
|
89
|
+
tabs: [
|
|
90
|
+
component('record-tabs', 'tabSet', {
|
|
91
|
+
tabs: fromQuery('RecordTabs'),
|
|
92
|
+
urlKey: 'tab',
|
|
93
|
+
label: 'Record sections'
|
|
94
|
+
})
|
|
95
|
+
],
|
|
96
|
+
main: [
|
|
97
|
+
component('record-form', 'formScreenBody', {
|
|
98
|
+
mode: 'readOnly',
|
|
99
|
+
sections: fromQuery('RecordSections'),
|
|
100
|
+
values: fromQuery('RecordValues', '0')
|
|
101
|
+
})
|
|
102
|
+
],
|
|
103
|
+
related: [
|
|
104
|
+
component('record-related', 'dataList', {
|
|
105
|
+
label: 'Related deals',
|
|
106
|
+
rows: fromQuery('Deals'),
|
|
107
|
+
columns: fromQuery('DealColumns'),
|
|
108
|
+
titleField: 'name',
|
|
109
|
+
pageSize: 5
|
|
110
|
+
})
|
|
111
|
+
],
|
|
112
|
+
activity: [
|
|
113
|
+
component('record-activity', 'activityFeed', {
|
|
114
|
+
label: 'History',
|
|
115
|
+
entries: fromQuery('Activity')
|
|
116
|
+
})
|
|
117
|
+
],
|
|
118
|
+
aside: [
|
|
119
|
+
component('record-checklist', 'checklistSection', {
|
|
120
|
+
sections: fromQuery('Checklist')
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
displayName: 'Record page',
|
|
125
|
+
description: 'One record: its key facts, tabbed sections, related records and history.',
|
|
126
|
+
metadata: {
|
|
127
|
+
...foundationTemplateProvenance,
|
|
128
|
+
type: 'Detail',
|
|
129
|
+
category: 'Foundation / Detail',
|
|
130
|
+
thumbnail: thumbnailOf('RecordPage')
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export { recordPageTemplate };
|
|
135
|
+
//# sourceMappingURL=recordPageTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordPageTemplate.js","sources":["../../../../foundation/templates/recordPageTemplate.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, WidthSizeClass } from '@cratis/scene.model';\nimport { column, grid, row, slotLeaf } from '../../layouts/flowBuilders';\nimport { component, foundationTemplateProvenance, fromQuery, thumbnailOf } from './templateParts';\n\n/**\n * The record page: a header, the key facts, then tabs (overview, related, files, history) with the record's main content, its related records and its\n * activity, and an aside. The tabs are configurable by changing one property.\n */\nexport const recordPageTemplate: ScreenTemplate = {\n name: 'RecordPage',\n fitsSlot: 'content',\n slots: [{ name: 'header' }, { name: 'summary' }, { name: 'tabs' }, { name: 'main' }, { name: 'related' }, { name: 'activity' }, { name: 'aside' }],\n arrangement: {\n root: column([slotLeaf('header'), slotLeaf('summary'), grid([column([slotLeaf('tabs'), slotLeaf('main'), slotLeaf('related'), slotLeaf('activity')], 16, { span: 2 }), slotLeaf('aside')], 3, 16)], 16),\n overrides: [{ width: WidthSizeClass.Compact, root: column([slotLeaf('header'), slotLeaf('summary'), slotLeaf('tabs'), slotLeaf('main'), slotLeaf('related'), slotLeaf('activity'), slotLeaf('aside')], 16) }],\n },\n content: {\n header: [component('record-header', 'pageHeader', { title: fromQuery('RecordValues', '0.name'), subtitle: 'Account' })],\n summary: [\n component('record-value', 'statCard', { label: 'Lifetime value', value: fromQuery('Kpis', '0.value'), format: 'currency', currency: 'USD' }),\n component('record-status', 'statusChip', { status: fromQuery('Deals', '0.status'), tone: 'info' }),\n component('record-people', 'avatarStack', { people: fromQuery('People') }),\n ],\n tabs: [component('record-tabs', 'tabSet', { tabs: fromQuery('RecordTabs'), urlKey: 'tab', label: 'Record sections' })],\n main: [component('record-form', 'formScreenBody', { mode: 'readOnly', sections: fromQuery('RecordSections'), values: fromQuery('RecordValues', '0') })],\n related: [component('record-related', 'dataList', { label: 'Related deals', rows: fromQuery('Deals'), columns: fromQuery('DealColumns'), titleField: 'name', pageSize: 5 })],\n activity: [component('record-activity', 'activityFeed', { label: 'History', entries: fromQuery('Activity') })],\n aside: [component('record-checklist', 'checklistSection', { sections: fromQuery('Checklist') })],\n },\n displayName: 'Record page',\n description: 'One record: its key facts, tabbed sections, related records and history.',\n metadata: { ...foundationTemplateProvenance, type: 'Detail', category: 'Foundation / Detail', thumbnail: thumbnailOf('RecordPage') },\n};\n"],"names":["recordPageTemplate","name","fitsSlot","slots","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","header","component","title","fromQuery","subtitle","summary","label","value","format","currency","status","tone","people","tabs","urlKey","main","mode","sections","values","related","rows","columns","titleField","pageSize","activity","entries","aside","displayName","description","metadata","foundationTemplateProvenance","type","category","thumbnail","thumbnailOf"],"mappings":";;;;AAAA;AACA;AAMA;;;UAIaA,kBAAAA,GAAqC;IAC9CC,IAAAA,EAAM,YAAA;IACNC,QAAAA,EAAU,SAAA;IACVC,KAAAA,EAAO;AAAC,QAAA;YAAEF,IAAAA,EAAM;AAAS,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAU,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAO,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAO,SAAA;AAAG,QAAA;YAAEA,IAA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A;AAAWmB,gBAAAA,OAAAA,EAAStB,SAAAA,CAAU,UAAA;AAAY,aAAA;AAAG,SAAA;QAC9GuB,KAAAA,EAAO;AAACzB,YAAAA,SAAAA,CAAU,oBAAoB,kBAAA,EAAoB;AAAEgB,gBAAAA,QAAAA,EAAUd,SAAAA,CAAU,WAAA;AAAa,aAAA;AAAG;AACpG,KAAA;IACAwB,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa,0EAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC,4BAA4B;QAAEC,IAAAA,EAAM,QAAA;QAAUC,QAAAA,EAAU,qBAAA;AAAuBC,QAAAA,SAAAA,EAAWC,WAAAA,CAAY,YAAA;AAAc;AACvI;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ScreenTemplate } from '@cratis/scene.model';
|
|
2
|
+
export declare const loginScreenTemplate: ScreenTemplate;
|
|
3
|
+
export declare const notFoundScreenTemplate: ScreenTemplate;
|
|
4
|
+
export declare const forbiddenScreenTemplate: ScreenTemplate;
|
|
5
|
+
export declare const errorScreenTemplate: ScreenTemplate;
|
|
6
|
+
export declare const stateScreenTemplates: ScreenTemplate[];
|
|
7
|
+
export declare const foundationTemplateAliases: Record<string, string>;
|
|
8
|
+
//# sourceMappingURL=stateScreenTemplates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateScreenTemplates.d.ts","sourceRoot":"","sources":["../../../../foundation/templates/stateScreenTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAoB,MAAM,qBAAqB,CAAC;AAgBvE,eAAO,MAAM,mBAAmB,EAAE,cAkBjC,CAAC;AAGF,eAAO,MAAM,sBAAsB,EAAE,cAapC,CAAC;AAMF,eAAO,MAAM,uBAAuB,EAAE,cAcrC,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,cAkBjC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,cAAc,EAAgG,CAAC;AAGlJ,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM5D,CAAC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { panel, externalComponent } from '../../gallery/elements.js';
|
|
2
|
+
import { actionButton } from './dialogTemplates.js';
|
|
3
|
+
import { column, slotLeaf } from '../../layouts/flowBuilders.js';
|
|
4
|
+
import { component, fromQuery, foundationTemplateProvenance, thumbnailOf } from './templateParts.js';
|
|
5
|
+
|
|
6
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
7
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
8
|
+
const metadataOf = (name, type)=>({
|
|
9
|
+
...foundationTemplateProvenance,
|
|
10
|
+
type,
|
|
11
|
+
category: `Foundation / ${type}`,
|
|
12
|
+
thumbnail: thumbnailOf(name)
|
|
13
|
+
});
|
|
14
|
+
/** The way back every state screen offers: home, which is always somewhere the person is allowed to be. */ const backToDashboard = (id)=>actionButton(id, {
|
|
15
|
+
label: 'Back to the dashboard',
|
|
16
|
+
emphasis: 'secondary',
|
|
17
|
+
targetScreen: 'DashboardScreen'
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* The sign-in screen: the logo, the sign-in form, a slot for the identity providers the application offers (`providers` - buttons, each starting its
|
|
21
|
+
* provider's flow, which the application fills), an error area that is a live region and says why a sign-in failed, and a link to help. The form is
|
|
22
|
+
* made of the foundation's form components, so it validates and announces like every other form.
|
|
23
|
+
*/ const loginScreenTemplate = {
|
|
24
|
+
name: 'LoginScreen',
|
|
25
|
+
fitsSlot: 'content',
|
|
26
|
+
slots: [
|
|
27
|
+
{
|
|
28
|
+
name: 'logo'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'error'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'form'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'providers'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'help'
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
arrangement: {
|
|
44
|
+
root: column([
|
|
45
|
+
slotLeaf('logo'),
|
|
46
|
+
slotLeaf('error'),
|
|
47
|
+
slotLeaf('form'),
|
|
48
|
+
slotLeaf('providers'),
|
|
49
|
+
slotLeaf('help')
|
|
50
|
+
], 16)
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
logo: [
|
|
54
|
+
externalComponent('login-logo', 'logo', {
|
|
55
|
+
label: 'Contoso',
|
|
56
|
+
initials: 'C'
|
|
57
|
+
})
|
|
58
|
+
],
|
|
59
|
+
error: [
|
|
60
|
+
component('login-error', 'notice', {
|
|
61
|
+
text: fromQuery('SignInError', '0.message'),
|
|
62
|
+
tone: 'danger'
|
|
63
|
+
})
|
|
64
|
+
],
|
|
65
|
+
form: [
|
|
66
|
+
component('login-form', 'formScreenBody', {
|
|
67
|
+
mode: 'create',
|
|
68
|
+
saveAndNew: false,
|
|
69
|
+
strings: {
|
|
70
|
+
formSave: 'Sign in',
|
|
71
|
+
formCancel: 'Clear'
|
|
72
|
+
},
|
|
73
|
+
sections: fromQuery('SignInSections'),
|
|
74
|
+
values: fromQuery('SignInValues', '0'),
|
|
75
|
+
errors: fromQuery('FormErrors', '0')
|
|
76
|
+
})
|
|
77
|
+
],
|
|
78
|
+
providers: [
|
|
79
|
+
panel('login-providers', [
|
|
80
|
+
actionButton('login-microsoft', {
|
|
81
|
+
label: 'Continue with Microsoft',
|
|
82
|
+
emphasis: 'secondary'
|
|
83
|
+
}),
|
|
84
|
+
actionButton('login-github', {
|
|
85
|
+
label: 'Continue with GitHub',
|
|
86
|
+
emphasis: 'secondary'
|
|
87
|
+
})
|
|
88
|
+
])
|
|
89
|
+
],
|
|
90
|
+
help: [
|
|
91
|
+
actionButton('login-help', {
|
|
92
|
+
label: 'Need help signing in?',
|
|
93
|
+
emphasis: 'quiet',
|
|
94
|
+
targetScreen: 'ForbiddenScreen'
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
displayName: 'Sign in',
|
|
99
|
+
description: 'A sign-in form with a slot for identity providers, an error area and a help link.',
|
|
100
|
+
metadata: metadataOf('LoginScreen', 'Auth')
|
|
101
|
+
};
|
|
102
|
+
/** The wrong address: what happened in words, a search, and the way home. */ const notFoundScreenTemplate = {
|
|
103
|
+
name: 'NotFoundScreen',
|
|
104
|
+
fitsSlot: 'content',
|
|
105
|
+
slots: [
|
|
106
|
+
{
|
|
107
|
+
name: 'message'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'search'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
name: 'actions'
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
arrangement: {
|
|
117
|
+
root: column([
|
|
118
|
+
slotLeaf('message'),
|
|
119
|
+
slotLeaf('search'),
|
|
120
|
+
slotLeaf('actions')
|
|
121
|
+
], 16)
|
|
122
|
+
},
|
|
123
|
+
content: {
|
|
124
|
+
message: [
|
|
125
|
+
component('not-found-message', 'emptyState', {
|
|
126
|
+
icon: 'file',
|
|
127
|
+
headline: 'That page is not here',
|
|
128
|
+
hint: 'The link may be old, or the thing it pointed at may have been removed.'
|
|
129
|
+
})
|
|
130
|
+
],
|
|
131
|
+
search: [
|
|
132
|
+
component('not-found-search', 'globalSearch', {
|
|
133
|
+
label: 'Search the application',
|
|
134
|
+
placeholder: 'Search instead'
|
|
135
|
+
})
|
|
136
|
+
],
|
|
137
|
+
actions: [
|
|
138
|
+
backToDashboard('not-found-home')
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
displayName: 'Not found',
|
|
142
|
+
description: 'A wrong address explained, with a search and a link home.',
|
|
143
|
+
metadata: metadataOf('NotFoundScreen', 'State')
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The refusal: signed in, and still not allowed. It says so and offers to ask for access, and it shows nothing of what was refused - the template binds
|
|
147
|
+
* no data at all, so there is nothing to leak.
|
|
148
|
+
*/ const forbiddenScreenTemplate = {
|
|
149
|
+
name: 'ForbiddenScreen',
|
|
150
|
+
fitsSlot: 'content',
|
|
151
|
+
slots: [
|
|
152
|
+
{
|
|
153
|
+
name: 'message'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'actions'
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
arrangement: {
|
|
160
|
+
root: column([
|
|
161
|
+
slotLeaf('message'),
|
|
162
|
+
slotLeaf('actions')
|
|
163
|
+
], 16)
|
|
164
|
+
},
|
|
165
|
+
content: {
|
|
166
|
+
message: [
|
|
167
|
+
component('forbidden-message', 'emptyState', {
|
|
168
|
+
icon: 'lock',
|
|
169
|
+
headline: 'You do not have access to this',
|
|
170
|
+
hint: 'Your account is signed in, but it is not allowed here. An administrator can change that.',
|
|
171
|
+
actionLabel: 'Request access'
|
|
172
|
+
})
|
|
173
|
+
],
|
|
174
|
+
actions: [
|
|
175
|
+
backToDashboard('forbidden-home')
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
displayName: 'Forbidden',
|
|
179
|
+
description: 'A refusal that offers to request access and shows none of what was refused.',
|
|
180
|
+
metadata: metadataOf('ForbiddenScreen', 'State')
|
|
181
|
+
};
|
|
182
|
+
/** The failure on our side: a plain message, a retry, and the support reference id a person can quote. */ const errorScreenTemplate = {
|
|
183
|
+
name: 'ErrorScreen',
|
|
184
|
+
fitsSlot: 'content',
|
|
185
|
+
slots: [
|
|
186
|
+
{
|
|
187
|
+
name: 'message'
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'reference'
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'actions'
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
arrangement: {
|
|
197
|
+
root: column([
|
|
198
|
+
slotLeaf('message'),
|
|
199
|
+
slotLeaf('reference'),
|
|
200
|
+
slotLeaf('actions')
|
|
201
|
+
], 16)
|
|
202
|
+
},
|
|
203
|
+
content: {
|
|
204
|
+
message: [
|
|
205
|
+
component('error-message', 'emptyState', {
|
|
206
|
+
icon: 'alert',
|
|
207
|
+
headline: 'Something went wrong on our side',
|
|
208
|
+
hint: 'The team has been told. Nothing you were working on was lost.',
|
|
209
|
+
actionLabel: 'Try again'
|
|
210
|
+
})
|
|
211
|
+
],
|
|
212
|
+
reference: [
|
|
213
|
+
panel('error-reference', [
|
|
214
|
+
externalComponent('error-reference-label', 'text', {
|
|
215
|
+
text: 'Support reference'
|
|
216
|
+
}),
|
|
217
|
+
externalComponent('error-reference-id', 'text', {
|
|
218
|
+
text: fromQuery('SupportReference', '0.id')
|
|
219
|
+
})
|
|
220
|
+
])
|
|
221
|
+
],
|
|
222
|
+
actions: [
|
|
223
|
+
backToDashboard('error-home')
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
displayName: 'Error',
|
|
227
|
+
description: 'A generic failure with a retry and the support reference id to quote.',
|
|
228
|
+
metadata: metadataOf('ErrorScreen', 'State')
|
|
229
|
+
};
|
|
230
|
+
/** The four auth and state screens of Part B 2.11. The legacy `Login`, `NotFound`, `AccessDenied` and `Error` remain as they were. */ const stateScreenTemplates = [
|
|
231
|
+
loginScreenTemplate,
|
|
232
|
+
notFoundScreenTemplate,
|
|
233
|
+
forbiddenScreenTemplate,
|
|
234
|
+
errorScreenTemplate
|
|
235
|
+
];
|
|
236
|
+
/** The earlier template each spec-named one stands beside: the old name keeps working, and is the alias of the new. */ const foundationTemplateAliases = {
|
|
237
|
+
LoginScreen: 'Login',
|
|
238
|
+
NotFoundScreen: 'NotFound',
|
|
239
|
+
ForbiddenScreen: 'AccessDenied',
|
|
240
|
+
ErrorScreen: 'Error',
|
|
241
|
+
QuickCreateDialog: 'FormDialog'
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export { errorScreenTemplate, forbiddenScreenTemplate, foundationTemplateAliases, loginScreenTemplate, notFoundScreenTemplate, stateScreenTemplates };
|
|
245
|
+
//# sourceMappingURL=stateScreenTemplates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateScreenTemplates.js","sources":["../../../../foundation/templates/stateScreenTemplates.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, TemplateMetadata } from '@cratis/scene.model';\nimport { externalComponent, panel } from '../../gallery/elements';\nimport { actionButton } from './dialogTemplates';\nimport { column, slotLeaf } from '../../layouts/flowBuilders';\nimport { component, foundationTemplateProvenance, fromQuery, thumbnailOf } from './templateParts';\n\nconst metadataOf = (name: string, type: 'Auth' | 'State'): TemplateMetadata => ({ ...foundationTemplateProvenance, type, category: `Foundation / ${type}`, thumbnail: thumbnailOf(name) });\n\n/** The way back every state screen offers: home, which is always somewhere the person is allowed to be. */\nconst backToDashboard = (id: string) => actionButton(id, { label: 'Back to the dashboard', emphasis: 'secondary', targetScreen: 'DashboardScreen' });\n\n/**\n * The sign-in screen: the logo, the sign-in form, a slot for the identity providers the application offers (`providers` - buttons, each starting its\n * provider's flow, which the application fills), an error area that is a live region and says why a sign-in failed, and a link to help. The form is\n * made of the foundation's form components, so it validates and announces like every other form.\n */\nexport const loginScreenTemplate: ScreenTemplate = {\n name: 'LoginScreen',\n fitsSlot: 'content',\n slots: [{ name: 'logo' }, { name: 'error' }, { name: 'form' }, { name: 'providers' }, { name: 'help' }],\n arrangement: { root: column([slotLeaf('logo'), slotLeaf('error'), slotLeaf('form'), slotLeaf('providers'), slotLeaf('help')], 16) },\n content: {\n logo: [externalComponent('login-logo', 'logo', { label: 'Contoso', initials: 'C' })],\n error: [component('login-error', 'notice', { text: fromQuery('SignInError', '0.message'), tone: 'danger' })],\n form: [component('login-form', 'formScreenBody', {\n mode: 'create', saveAndNew: false, strings: { formSave: 'Sign in', formCancel: 'Clear' },\n sections: fromQuery('SignInSections'), values: fromQuery('SignInValues', '0'), errors: fromQuery('FormErrors', '0'),\n })],\n providers: [panel('login-providers', [actionButton('login-microsoft', { label: 'Continue with Microsoft', emphasis: 'secondary' }), actionButton('login-github', { label: 'Continue with GitHub', emphasis: 'secondary' })])],\n help: [actionButton('login-help', { label: 'Need help signing in?', emphasis: 'quiet', targetScreen: 'ForbiddenScreen' })],\n },\n displayName: 'Sign in',\n description: 'A sign-in form with a slot for identity providers, an error area and a help link.',\n metadata: metadataOf('LoginScreen', 'Auth'),\n};\n\n/** The wrong address: what happened in words, a search, and the way home. */\nexport const notFoundScreenTemplate: ScreenTemplate = {\n name: 'NotFoundScreen',\n fitsSlot: 'content',\n slots: [{ name: 'message' }, { name: 'search' }, { name: 'actions' }],\n arrangement: { root: column([slotLeaf('message'), slotLeaf('search'), slotLeaf('actions')], 16) },\n content: {\n message: [component('not-found-message', 'emptyState', { icon: 'file', headline: 'That page is not here', hint: 'The link may be old, or the thing it pointed at may have been removed.' })],\n search: [component('not-found-search', 'globalSearch', { label: 'Search the application', placeholder: 'Search instead' })],\n actions: [backToDashboard('not-found-home')],\n },\n displayName: 'Not found',\n description: 'A wrong address explained, with a search and a link home.',\n metadata: metadataOf('NotFoundScreen', 'State'),\n};\n\n/**\n * The refusal: signed in, and still not allowed. It says so and offers to ask for access, and it shows nothing of what was refused - the template binds\n * no data at all, so there is nothing to leak.\n */\nexport const forbiddenScreenTemplate: ScreenTemplate = {\n name: 'ForbiddenScreen',\n fitsSlot: 'content',\n slots: [{ name: 'message' }, { name: 'actions' }],\n arrangement: { root: column([slotLeaf('message'), slotLeaf('actions')], 16) },\n content: {\n message: [component('forbidden-message', 'emptyState', {\n icon: 'lock', headline: 'You do not have access to this', hint: 'Your account is signed in, but it is not allowed here. An administrator can change that.', actionLabel: 'Request access',\n })],\n actions: [backToDashboard('forbidden-home')],\n },\n displayName: 'Forbidden',\n description: 'A refusal that offers to request access and shows none of what was refused.',\n metadata: metadataOf('ForbiddenScreen', 'State'),\n};\n\n/** The failure on our side: a plain message, a retry, and the support reference id a person can quote. */\nexport const errorScreenTemplate: ScreenTemplate = {\n name: 'ErrorScreen',\n fitsSlot: 'content',\n slots: [{ name: 'message' }, { name: 'reference' }, { name: 'actions' }],\n arrangement: { root: column([slotLeaf('message'), slotLeaf('reference'), slotLeaf('actions')], 16) },\n content: {\n message: [component('error-message', 'emptyState', {\n icon: 'alert', headline: 'Something went wrong on our side', hint: 'The team has been told. Nothing you were working on was lost.', actionLabel: 'Try again',\n })],\n reference: [panel('error-reference', [\n externalComponent('error-reference-label', 'text', { text: 'Support reference' }),\n externalComponent('error-reference-id', 'text', { text: fromQuery('SupportReference', '0.id') }),\n ])],\n actions: [backToDashboard('error-home')],\n },\n displayName: 'Error',\n description: 'A generic failure with a retry and the support reference id to quote.',\n metadata: metadataOf('ErrorScreen', 'State'),\n};\n\n/** The four auth and state screens of Part B 2.11. The legacy `Login`, `NotFound`, `AccessDenied` and `Error` remain as they were. */\nexport const stateScreenTemplates: ScreenTemplate[] = [loginScreenTemplate, notFoundScreenTemplate, forbiddenScreenTemplate, errorScreenTemplate];\n\n/** The earlier template each spec-named one stands beside: the old name keeps working, and is the alias of the new. */\nexport const foundationTemplateAliases: Record<string, string> = {\n LoginScreen: 'Login',\n NotFoundScreen: 'NotFound',\n ForbiddenScreen: 'AccessDenied',\n ErrorScreen: 'Error',\n QuickCreateDialog: 'FormDialog',\n};\n"],"names":["metadataOf","name","type","foundationTemplateProvenance","category","thumbnail","thumbnailOf","backToDashboard","id","actionButton","label","emphasis","targetScreen","loginScreenTemplate","fitsSlot","slots","arrangement","root","column","slotLeaf","content","logo","externalComponent","initials","error","component","text","fromQuery","tone","form","mode","saveAndNew","strings","formSave","formCancel","sections","values","errors","providers","panel","help","displayName","description","metadata","notFoundScreenTemplate","message","icon","headline","hint","search","placeholder","actions","forbiddenScreenTemplate","actionLabel","errorScreenTemplate","reference","stateScreenTemplates","foundationTemplateAliases","LoginScreen","NotFoundScreen","ForbiddenScreen","ErrorScreen","QuickCreateDialog"],"mappings":";;;;;AAAA;AACA;AAQA,M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A,EAAMC,UAAU,kBAAA,EAAoB,MAAA;AAAQ,iBAAA;AACjG,aAAA;AAAE,SAAA;QACHwB,OAAAA,EAAS;YAAC5C,eAAAA,CAAgB,YAAA;AAAc;AAC5C,KAAA;IACAkC,WAAAA,EAAa,OAAA;IACbC,WAAAA,EAAa,uEAAA;AACbC,IAAAA,QAAAA,EAAU3C,WAAW,aAAA,EAAe,OAAA;AACxC;AAEA,uIACO,MAAMwD,oBAAAA,GAAyC;AAAC3C,IAAAA,mBAAAA;AAAqB+B,IAAAA,sBAAAA;AAAwBQ,IAAAA,uBAAAA;AAAyBE,IAAAA;;AAE7H,wHACO,MAAMG,yBAAAA,GAAoD;IAC7DC,WAAAA,EAAa,OAAA;IACbC,cAAAA,EAAgB,UAAA;IAChBC,eAAAA,EAAiB,cAAA;IACjBC,WAAAA,EAAa,OAAA;IACbC,iBAAAA,EAAmB;AACvB;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BindingExpression, ExternalComponent, SceneElement, TemplateMetadata } from '@cratis/scene.model';
|
|
2
|
+
export declare const foundationTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'>;
|
|
3
|
+
export declare const thumbnailOf: (templateName: string) => string;
|
|
4
|
+
export declare const fromQuery: (query: string, path?: string) => BindingExpression;
|
|
5
|
+
export declare const component: (id: string, componentName: string, properties?: Record<string, unknown>, slots?: Record<string, SceneElement[]>) => ExternalComponent;
|
|
6
|
+
//# sourceMappingURL=templateParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateParts.d.ts","sourceRoot":"","sources":["../../../../foundation/templates/templateParts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAqB,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAQ9H,eAAO,MAAM,4BAA4B,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAK3H,CAAC;AAGF,eAAO,MAAM,WAAW,iBAAkB,MAAM,KAAG,MAA0C,CAAC;AAM9F,eAAO,MAAM,SAAS,UAAW,MAAM,oBAAc,iBAA2E,CAAC;AAGjI,eAAO,MAAM,SAAS,OAAQ,MAAM,iBAAiB,MAAM,eAAc,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAc,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,KAAQ,iBACzF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BindingSourceKind } from '@cratis/scene.model';
|
|
2
|
+
import { externalComponent } from '../../gallery/elements.js';
|
|
3
|
+
import { defaultBlueprintTemplateProvenance } from '../../templateProvenance.js';
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The provenance every foundation template carries. The foundation components draw themselves with no component library, so unlike the earlier
|
|
9
|
+
* gallery templates these require no PrimeReact or Cratis.Components: a host with only this blueprint renders them.
|
|
10
|
+
*/ const foundationTemplateProvenance = {
|
|
11
|
+
compatibility: {
|
|
12
|
+
scene: defaultBlueprintTemplateProvenance.compatibility.scene
|
|
13
|
+
},
|
|
14
|
+
attribution: {
|
|
15
|
+
author: 'Cratis',
|
|
16
|
+
url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.default'
|
|
17
|
+
},
|
|
18
|
+
license: 'MIT',
|
|
19
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
20
|
+
};
|
|
21
|
+
/** The package-relative thumbnail path of a foundation template. */ const thumbnailOf = (templateName)=>`thumbnails/${templateName}.svg`;
|
|
22
|
+
/**
|
|
23
|
+
* A property taken from a query result - never a value. A template declares *where* its data comes from and the sample-data pack, or the real
|
|
24
|
+
* query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).
|
|
25
|
+
*/ const fromQuery = (query, path = '')=>({
|
|
26
|
+
kind: BindingSourceKind.QueryResult,
|
|
27
|
+
query,
|
|
28
|
+
path
|
|
29
|
+
});
|
|
30
|
+
/** A component of this blueprint, by its bare name, with its properties and slot content. */ const component = (id, componentName, properties = {}, slots = {})=>externalComponent(id, componentName, properties, slots);
|
|
31
|
+
|
|
32
|
+
export { component, foundationTemplateProvenance, fromQuery, thumbnailOf };
|
|
33
|
+
//# sourceMappingURL=templateParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateParts.js","sources":["../../../../foundation/templates/templateParts.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 { BindingExpression, BindingSourceKind, ExternalComponent, SceneElement, TemplateMetadata } from '@cratis/scene.model';\nimport { externalComponent } from '../../gallery/elements';\nimport { defaultBlueprintTemplateProvenance } from '../../templateProvenance';\n\n/**\n * The provenance every foundation template carries. The foundation components draw themselves with no component library, so unlike the earlier\n * gallery templates these require no PrimeReact or Cratis.Components: a host with only this blueprint renders them.\n */\nexport const foundationTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'> = {\n compatibility: { scene: defaultBlueprintTemplateProvenance.compatibility!.scene },\n attribution: { author: 'Cratis', url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.default' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/** The package-relative thumbnail path of a foundation template. */\nexport const thumbnailOf = (templateName: string): string => `thumbnails/${templateName}.svg`;\n\n/**\n * A property taken from a query result - never a value. A template declares *where* its data comes from and the sample-data pack, or the real\n * query, supplies the rows (spec SD1); `path` reaches into the result (`0.value` is the first row's `value`, an empty path is the whole result).\n */\nexport const fromQuery = (query: string, path = ''): BindingExpression => ({ kind: BindingSourceKind.QueryResult, query, path });\n\n/** A component of this blueprint, by its bare name, with its properties and slot content. */\nexport const component = (id: string, componentName: string, properties: Record<string, unknown> = {}, slots: Record<string, SceneElement[]> = {}): ExternalComponent =>\n externalComponent(id, componentName, properties, slots);\n"],"names":["foundationTemplateProvenance","compatibility","scene","defaultBlueprintTemplateProvenance","attribution","author","url","license","licenseUrl","thumbnailOf","templateName","fromQuery","query","path","kind","BindingSourceKind","QueryResult","component","id","componentName","properties","slots","externalComponent"],"mappings":";;;;AAAA;AACA;AAMA;;;UAIaA,4BAAAA,GAAmH;IAC5HC,aAAAA,EAAe;QAAEC,KAAAA,EAAOC,kCAAAA,CAAmCF,aAAa,CAAEC;AAAM,KAAA;IAChFE,WAAAA,EAAa;QAAEC,MAAAA,EAAQ,QAAA;QAAUC,GAAAA,EAAK;AAAgF,KAAA;IACtHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA,qEACO,MAAMC,WAAAA,GAAc,CAACC,YAAAA,GAAiC,CAAC,WAAW,EAAEA,YAAAA,CAAa,IAAI;AAE5F;;;UAIaC,SAAAA,GAAY,CAACC,OAAeC,IAAAA,GAAO,EAAE,IAAyB;AAAEC,QAAAA,IAAAA,EAAMC,kBAAkBC,WAAW;AAAEJ,QAAAA,KAAAA;AAAOC,QAAAA;AAAK,KAAA;AAE9H,8FACO,MAAMI,YAAY,CAACC,EAAAA,EAAYC,eAAuBC,UAAAA,GAAsC,EAAE,EAAEC,KAAAA,GAAwC,EAAE,GAC7IC,kBAAkBJ,EAAAA,EAAIC,aAAAA,EAAeC,YAAYC,KAAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizardScreenTemplate.d.ts","sourceRoot":"","sources":["../../../../foundation/templates/wizardScreenTemplate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAQrE,eAAO,MAAM,oBAAoB,EAAE,cAqBlC,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { WidthSizeClass } from '@cratis/scene.model';
|
|
2
|
+
import { column, slotLeaf } from '../../layouts/flowBuilders.js';
|
|
3
|
+
import { component, fromQuery, foundationTemplateProvenance, thumbnailOf } from './templateParts.js';
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* The wizard: linear steps with a progress list, Back and Next, and a save-draft. The last step is the review. Where the person has got to survives a refresh,
|
|
9
|
+
* and a refresh can never land past a step that was not done. The content of each step is the slot named by its id.
|
|
10
|
+
*/ const wizardScreenTemplate = {
|
|
11
|
+
name: 'WizardScreen',
|
|
12
|
+
fitsSlot: 'content',
|
|
13
|
+
slots: [
|
|
14
|
+
{
|
|
15
|
+
name: 'header'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'progress'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'step'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'actions'
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
arrangement: {
|
|
28
|
+
root: column([
|
|
29
|
+
slotLeaf('header'),
|
|
30
|
+
slotLeaf('progress'),
|
|
31
|
+
slotLeaf('step'),
|
|
32
|
+
slotLeaf('actions')
|
|
33
|
+
], 16),
|
|
34
|
+
overrides: [
|
|
35
|
+
{
|
|
36
|
+
width: WidthSizeClass.Compact,
|
|
37
|
+
root: column([
|
|
38
|
+
slotLeaf('header'),
|
|
39
|
+
slotLeaf('progress'),
|
|
40
|
+
slotLeaf('step'),
|
|
41
|
+
slotLeaf('actions')
|
|
42
|
+
], 16)
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
content: {
|
|
47
|
+
header: [
|
|
48
|
+
component('wizard-header', 'pageHeader', {
|
|
49
|
+
title: 'New account',
|
|
50
|
+
subtitle: 'Three short steps'
|
|
51
|
+
})
|
|
52
|
+
],
|
|
53
|
+
progress: [
|
|
54
|
+
component('wizard-progress', 'wizardProgress', {
|
|
55
|
+
steps: fromQuery('WizardSteps'),
|
|
56
|
+
urlKey: 'step'
|
|
57
|
+
}, {
|
|
58
|
+
details: [
|
|
59
|
+
component('wizard-details', 'formScreenBody', {
|
|
60
|
+
mode: 'create',
|
|
61
|
+
sections: fromQuery('RecordSections'),
|
|
62
|
+
values: fromQuery('RecordValues', '0')
|
|
63
|
+
})
|
|
64
|
+
],
|
|
65
|
+
people: [
|
|
66
|
+
component('wizard-people', 'avatarStack', {
|
|
67
|
+
people: fromQuery('People')
|
|
68
|
+
})
|
|
69
|
+
],
|
|
70
|
+
review: [
|
|
71
|
+
component('wizard-review', 'formScreenBody', {
|
|
72
|
+
mode: 'readOnly',
|
|
73
|
+
sections: fromQuery('RecordSections'),
|
|
74
|
+
values: fromQuery('RecordValues', '0')
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
],
|
|
79
|
+
step: [],
|
|
80
|
+
actions: []
|
|
81
|
+
},
|
|
82
|
+
displayName: 'Wizard',
|
|
83
|
+
description: 'Linear steps with progress, back and next, a saved draft and a review step.',
|
|
84
|
+
metadata: {
|
|
85
|
+
...foundationTemplateProvenance,
|
|
86
|
+
type: 'Wizard',
|
|
87
|
+
category: 'Foundation / Wizard',
|
|
88
|
+
thumbnail: thumbnailOf('WizardScreen')
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { wizardScreenTemplate };
|
|
93
|
+
//# sourceMappingURL=wizardScreenTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizardScreenTemplate.js","sources":["../../../../foundation/templates/wizardScreenTemplate.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, WidthSizeClass } from '@cratis/scene.model';\nimport { column, grid, row, slotLeaf } from '../../layouts/flowBuilders';\nimport { component, foundationTemplateProvenance, fromQuery, thumbnailOf } from './templateParts';\n\n/**\n * The wizard: linear steps with a progress list, Back and Next, and a save-draft. The last step is the review. Where the person has got to survives a refresh,\n * and a refresh can never land past a step that was not done. The content of each step is the slot named by its id.\n */\nexport const wizardScreenTemplate: ScreenTemplate = {\n name: 'WizardScreen',\n fitsSlot: 'content',\n slots: [{ name: 'header' }, { name: 'progress' }, { name: 'step' }, { name: 'actions' }],\n arrangement: {\n root: column([slotLeaf('header'), slotLeaf('progress'), slotLeaf('step'), slotLeaf('actions')], 16),\n overrides: [{ width: WidthSizeClass.Compact, root: column([slotLeaf('header'), slotLeaf('progress'), slotLeaf('step'), slotLeaf('actions')], 16) }],\n },\n content: {\n header: [component('wizard-header', 'pageHeader', { title: 'New account', subtitle: 'Three short steps' })],\n progress: [component('wizard-progress', 'wizardProgress', { steps: fromQuery('WizardSteps'), urlKey: 'step' }, {\n details: [component('wizard-details', 'formScreenBody', { mode: 'create', sections: fromQuery('RecordSections'), values: fromQuery('RecordValues', '0') })],\n people: [component('wizard-people', 'avatarStack', { people: fromQuery('People') })],\n review: [component('wizard-review', 'formScreenBody', { mode: 'readOnly', sections: fromQuery('RecordSections'), values: fromQuery('RecordValues', '0') })],\n })],\n step: [],\n actions: [],\n },\n displayName: 'Wizard',\n description: 'Linear steps with progress, back and next, a saved draft and a review step.',\n metadata: { ...foundationTemplateProvenance, type: 'Wizard', category: 'Foundation / Wizard', thumbnail: thumbnailOf('WizardScreen') },\n};\n"],"names":["wizardScreenTemplate","name","fitsSlot","slots","arrangement","root","column","slotLeaf","overrides","width","WidthSizeClass","Compact","content","header","component","title","subtitle","progress","steps","fromQuery","urlKey","details","mode","sections","values","people","review","step","actions","displayName","description","metadata","foundationTemplateProvenance","type","category","thumbnail","thumbnailOf"],"mappings":";;;;AAAA;AACA;AAMA;;;UAIaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM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