@cratis/scene.blueprint.components 4.12.0 → 4.13.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/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/templateProvenance.js +35 -0
- package/dist/cjs/templateProvenance.js.map +1 -0
- package/dist/cjs/templates/commandTemplates.js +2 -0
- package/dist/cjs/templates/commandTemplates.js.map +1 -1
- package/dist/cjs/templates/dialogTemplates.js +13 -3
- package/dist/cjs/templates/dialogTemplates.js.map +1 -1
- package/dist/cjs/templates/editorTemplates.js +9 -2
- package/dist/cjs/templates/editorTemplates.js.map +1 -1
- package/dist/cjs/templates/listTemplates.js +4 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -1
- package/dist/cjs/templates/nesting.js +13 -3
- package/dist/cjs/templates/nesting.js.map +1 -1
- package/dist/cjs/templates/workspaceTemplates.js +9 -2
- package/dist/cjs/templates/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 +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/templateProvenance.d.ts +3 -0
- package/dist/esm/templateProvenance.d.ts.map +1 -0
- package/dist/esm/templateProvenance.js +33 -0
- package/dist/esm/templateProvenance.js.map +1 -0
- package/dist/esm/templates/commandTemplates.d.ts.map +1 -1
- package/dist/esm/templates/commandTemplates.js +2 -0
- package/dist/esm/templates/commandTemplates.js.map +1 -1
- package/dist/esm/templates/dialogTemplates.d.ts.map +1 -1
- package/dist/esm/templates/dialogTemplates.js +13 -3
- package/dist/esm/templates/dialogTemplates.js.map +1 -1
- package/dist/esm/templates/editorTemplates.d.ts.map +1 -1
- package/dist/esm/templates/editorTemplates.js +9 -2
- package/dist/esm/templates/editorTemplates.js.map +1 -1
- package/dist/esm/templates/listTemplates.d.ts.map +1 -1
- package/dist/esm/templates/listTemplates.js +4 -0
- package/dist/esm/templates/listTemplates.js.map +1 -1
- package/dist/esm/templates/nesting.d.ts.map +1 -1
- package/dist/esm/templates/nesting.js +13 -3
- package/dist/esm/templates/nesting.js.map +1 -1
- package/dist/esm/templates/workspaceTemplates.d.ts.map +1 -1
- package/dist/esm/templates/workspaceTemplates.js +9 -2
- package/dist/esm/templates/workspaceTemplates.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/index.ts +1 -0
- package/package.json +11 -11
- package/templateProvenance.ts +25 -0
- package/templates/commandTemplates.ts +2 -1
- package/templates/dialogTemplates.ts +4 -0
- package/templates/editorTemplates.ts +3 -0
- package/templates/listTemplates.ts +4 -3
- package/templates/nesting.ts +4 -0
- package/templates/workspaceTemplates.ts +3 -0
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.d.ts","sourceRoot":"","sources":["../../templateProvenance.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAUvD,eAAO,MAAM,qCAAqC,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,YAAY,CAWpI,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* The compatibility, attribution and license metadata every template this blueprint ships carries.
|
|
5
|
+
*
|
|
6
|
+
* Templates are written against the Scene model that introduced template provenance, against the default
|
|
7
|
+
* blueprint whose shell and slots they fill, and against the Cratis Components composites they are built from -
|
|
8
|
+
* the same dependencies the manifest declares. `describeTemplateCatalog` checks every template against them,
|
|
9
|
+
* and this package's specs prove each one comes out compatible.
|
|
10
|
+
*/ const componentsBlueprintTemplateProvenance = {
|
|
11
|
+
compatibility: {
|
|
12
|
+
scene: '^4.13.0',
|
|
13
|
+
packages: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Cratis.Blueprint.Default',
|
|
16
|
+
versionRange: '^1.0.0'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'Cratis.Components',
|
|
20
|
+
versionRange: '^3.0.0'
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
attribution: {
|
|
25
|
+
author: 'Cratis',
|
|
26
|
+
url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.components'
|
|
27
|
+
},
|
|
28
|
+
license: 'MIT',
|
|
29
|
+
licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE'
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { componentsBlueprintTemplateProvenance };
|
|
33
|
+
//# sourceMappingURL=templateProvenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateProvenance.js","sources":["../../templateProvenance.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 { TemplateMetadata } from '@cratis/scene.model';\n\n/**\n * The compatibility, attribution and license metadata every template this blueprint ships carries.\n *\n * Templates are written against the Scene model that introduced template provenance, against the default\n * blueprint whose shell and slots they fill, and against the Cratis Components composites they are built from -\n * the same dependencies the manifest declares. `describeTemplateCatalog` checks every template against them,\n * and this package's specs prove each one comes out compatible.\n */\nexport const componentsBlueprintTemplateProvenance: Pick<TemplateMetadata, 'compatibility' | 'attribution' | 'license' | 'licenseUrl'> = {\n compatibility: {\n scene: '^4.13.0',\n packages: [\n { name: 'Cratis.Blueprint.Default', versionRange: '^1.0.0' },\n { name: 'Cratis.Components', versionRange: '^3.0.0' },\n ],\n },\n attribution: { author: 'Cratis', url: 'https://github.com/Cratis/Scene/tree/main/Source/JavaScript/blueprint.components' },\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n"],"names":["componentsBlueprintTemplateProvenance","compatibility","scene","packages","name","versionRange","attribution","author","url","license","licenseUrl"],"mappings":"AAAA;AACA;AAIA;;;;;;;UAQaA,qCAAAA,GAA4H;IACrIC,aAAAA,EAAe;QACXC,KAAAA,EAAO,SAAA;QACPC,QAAAA,EAAU;AACN,YAAA;gBAAEC,IAAAA,EAAM,0BAAA;gBAA4BC,YAAAA,EAAc;AAAS,aAAA;AAC3D,YAAA;gBAAED,IAAAA,EAAM,mBAAA;gBAAqBC,YAAAA,EAAc;AAAS;AACvD;AACL,KAAA;IACAC,WAAAA,EAAa;QAAEC,MAAAA,EAAQ,QAAA;QAAUC,GAAAA,EAAK;AAAmF,KAAA;IACzHC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandTemplates.d.ts","sourceRoot":"","sources":["../../../templates/commandTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"commandTemplates.d.ts","sourceRoot":"","sources":["../../../templates/commandTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiB,MAAM,qBAAqB,CAAC;AA0BpE,eAAO,MAAM,uBAAuB,EAAE,cA4BrC,CAAC;AAGF,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAA8B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { TemplateSlotName, column, slotLeaf, SlotName } from '@cratis/scene.blue
|
|
|
3
3
|
import { toolbar, toolbarButton, toolbarSeparator, page, arcPageHeader } from './elements.js';
|
|
4
4
|
import { commandForm } from './formElements.js';
|
|
5
5
|
import { SampleBindingName } from './SampleBindingName.js';
|
|
6
|
+
import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
6
7
|
|
|
7
8
|
// Copyright (c) Cratis. All rights reserved.
|
|
8
9
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -70,6 +71,7 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
70
71
|
]
|
|
71
72
|
},
|
|
72
73
|
metadata: {
|
|
74
|
+
...componentsBlueprintTemplateProvenance,
|
|
73
75
|
type: 'Form',
|
|
74
76
|
category: 'Business / Command',
|
|
75
77
|
scopes: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandTemplates.js","sources":["../../../templates/commandTemplates.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, TemplateScope } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { commandForm } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The write side: a page whose body is one command, and whose action bar submits it.\n */\n\n/**\n * A command form page - a header, the generated form, and the bar that closes it.\n *\n * The form is `commandForm`, which is `AutoCommandForm`: it reads the command's own property descriptors\n * and picks a field component per property type. That is the whole reason a *template* can ship a form at\n * all. A template that listed fields by hand would be a snapshot of a command as it looked the day the\n * template was written, and would go quietly wrong the first time a property was added on the backend.\n * This one follows the command, which is the same guarantee Arc's generated proxies give everywhere else.\n *\n * `exclude` names the properties the form should not generate. `invoiceId` is excluded because it is the\n * event-source identity - Arc resolves it, and a form offering to type it in is offering to break it.\n *\n * The action bar is the template's rather than the form's, and it declares its own slot for that reason: a\n * screen replacing \"Register\" with \"Register and approve\" should not have to replace the form.\n */\nexport const commandFormPageTemplate: ScreenTemplate = {\n name: 'CommandFormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('command-form-header', {\n title: 'Register an invoice',\n subtitle: 'The form follows the command, so a property added on the backend shows up here',\n section: 'Billing',\n command: SampleBindingName.RegisterInvoice,\n }),\n ],\n [TemplateSlotName.Body]: [page('command-form-body', '', [commandForm('command-form', SampleBindingName.RegisterInvoice, ['invoiceId'])])],\n [TemplateSlotName.Actions]: [\n toolbar('command-form-actions', [\n toolbarButton('command-form-submit', 'Register the invoice', 'pi pi-check', 'Register'),\n toolbarSeparator('command-form-separator'),\n toolbarButton('command-form-cancel', 'Discard and go back', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n metadata: { type: 'Form', category: 'Business / Command', scopes: [TemplateScope.Slice] },\n displayName: 'Command form page',\n description: 'A generated command form under a header that states the command, with its own action bar.',\n};\n\n/** The command-shaped templates. */\nexport const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate];\n"],"names":["commandFormPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","Actions","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","command","SampleBindingName","RegisterInvoice","page","commandForm","toolbar","toolbarButton","toolbarSeparator","metadata","type","category","scopes","TemplateScope","Slice","displayName","description","commandTemplates"],"mappings":"
|
|
1
|
+
{"version":3,"file":"commandTemplates.js","sources":["../../../templates/commandTemplates.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, TemplateScope } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { commandForm } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The write side: a page whose body is one command, and whose action bar submits it.\n */\n\n/**\n * A command form page - a header, the generated form, and the bar that closes it.\n *\n * The form is `commandForm`, which is `AutoCommandForm`: it reads the command's own property descriptors\n * and picks a field component per property type. That is the whole reason a *template* can ship a form at\n * all. A template that listed fields by hand would be a snapshot of a command as it looked the day the\n * template was written, and would go quietly wrong the first time a property was added on the backend.\n * This one follows the command, which is the same guarantee Arc's generated proxies give everywhere else.\n *\n * `exclude` names the properties the form should not generate. `invoiceId` is excluded because it is the\n * event-source identity - Arc resolves it, and a form offering to type it in is offering to break it.\n *\n * The action bar is the template's rather than the form's, and it declares its own slot for that reason: a\n * screen replacing \"Register\" with \"Register and approve\" should not have to replace the form.\n */\nexport const commandFormPageTemplate: ScreenTemplate = {\n name: 'CommandFormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('command-form-header', {\n title: 'Register an invoice',\n subtitle: 'The form follows the command, so a property added on the backend shows up here',\n section: 'Billing',\n command: SampleBindingName.RegisterInvoice,\n }),\n ],\n [TemplateSlotName.Body]: [page('command-form-body', '', [commandForm('command-form', SampleBindingName.RegisterInvoice, ['invoiceId'])])],\n [TemplateSlotName.Actions]: [\n toolbar('command-form-actions', [\n toolbarButton('command-form-submit', 'Register the invoice', 'pi pi-check', 'Register'),\n toolbarSeparator('command-form-separator'),\n toolbarButton('command-form-cancel', 'Discard and go back', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n metadata: { ...componentsBlueprintTemplateProvenance, type: 'Form', category: 'Business / Command', scopes: [TemplateScope.Slice] },\n displayName: 'Command form page',\n description: 'A generated command form under a header that states the command, with its own action bar.',\n};\n\n/** The command-shaped templates. */\nexport const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate];\n"],"names":["commandFormPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","Actions","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","command","SampleBindingName","RegisterInvoice","page","commandForm","toolbar","toolbarButton","toolbarSeparator","metadata","componentsBlueprintTemplateProvenance","type","category","scopes","TemplateScope","Slice","displayName","description","commandTemplates"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,iBAAiBG;AAAQ;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,MAAAA,CAAO;AAACC,YAAAA,QAAAA,CAASP,iBAAiBC,MAAM,CAAA;YAAGM,QAAAA,CAASP,gBAAAA,CAAiBE,IAAI,EAAE;gBAAEM,IAAAA,EAAM;AAAE,aAAA,CAAA;AAAID,YAAAA,QAAAA,CAASP,iBAAiBG,OAAO;SAAE,EAAE,EAAA;AACxI,KAAA;IACAM,OAAAA,EAAS;QACL,CAACT,gBAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,aAAAA,CAAc,qBAAA,EAAuB;gBACjCC,KAAAA,EAAO,qBAAA;gBACPC,QAAAA,EAAU,gFAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,OAAAA,EAASC,kBAAkBC;AAC/B,aAAA;AACH,SAAA;QACD,CAAChB,gBAAAA,CAAiBE,IAAI,GAAG;AAACe,YAAAA,IAAAA,CAAK,qBAAqB,EAAA,EAAI;gBAACC,WAAAA,CAAY,cAAA,EAAgBH,iBAAAA,CAAkBC,eAAe,EAAE;AAAC,oBAAA;AAAY,iBAAA;AAAE,aAAA;AAAE,SAAA;QACzI,CAAChB,gBAAAA,CAAiBG,OAAO,GAAG;AACxBgB,YAAAA,OAAAA,CAAQ,sBAAA,EAAwB;gBAC5BC,aAAAA,CAAc,qBAAA,EAAuB,wBAAwB,aAAA,EAAe,UAAA,CAAA;gBAC5EC,gBAAAA,CAAiB,wBAAA,CAAA;gBACjBD,aAAAA,CAAc,qBAAA,EAAuB,uBAAuB,aAAA,EAAe,QAAA;AAC9E,aAAA;AACJ;AACL,KAAA;IACAE,QAAAA,EAAU;AAAE,QAAA,GAAGC,qCAAqC;QAAEC,IAAAA,EAAM,MAAA;QAAQC,QAAAA,EAAU,oBAAA;QAAsBC,MAAAA,EAAQ;AAACC,YAAAA,aAAAA,CAAcC;AAAM;AAAC,KAAA;IAClIC,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qCACO,MAAMC,gBAAAA,GAAqC;AAACrC,IAAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogTemplates.d.ts","sourceRoot":"","sources":["../../../templates/dialogTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"dialogTemplates.d.ts","sourceRoot":"","sources":["../../../templates/dialogTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAsCrD,eAAO,MAAM,qBAAqB,EAAE,cAgBnC,CAAC;AAaF,eAAO,MAAM,qBAAqB,EAAE,cAcnC,CAAC;AAUF,eAAO,MAAM,kBAAkB,EAAE,cAWhC,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,cAAc,EAAuE,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { commandDialog, dialog, busyIndicatorDialog } from './dialogElements.js'
|
|
|
3
3
|
import { icon } from './elements.js';
|
|
4
4
|
import { numberField, inputTextField, calendarField, textAreaField } from './formElements.js';
|
|
5
5
|
import { SampleBindingName } from './SampleBindingName.js';
|
|
6
|
+
import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
6
7
|
|
|
7
8
|
// Copyright (c) Cratis. All rights reserved.
|
|
8
9
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -51,7 +52,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
51
52
|
]
|
|
52
53
|
},
|
|
53
54
|
displayName: 'Command dialog',
|
|
54
|
-
description: 'A short capture whose confirm button submits the command and only closes when it succeeded.'
|
|
55
|
+
description: 'A short capture whose confirm button submits the command and only closes when it succeeded.',
|
|
56
|
+
metadata: {
|
|
57
|
+
...componentsBlueprintTemplateProvenance
|
|
58
|
+
}
|
|
55
59
|
};
|
|
56
60
|
/**
|
|
57
61
|
* A confirmation dialog: one question, the consequence spelled out, and a way back.
|
|
@@ -79,7 +83,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
79
83
|
]
|
|
80
84
|
},
|
|
81
85
|
displayName: 'Confirmation dialog',
|
|
82
|
-
description: 'One question with the consequence spelled out, answered through Arc dialog context.'
|
|
86
|
+
description: 'One question with the consequence spelled out, answered through Arc dialog context.',
|
|
87
|
+
metadata: {
|
|
88
|
+
...componentsBlueprintTemplateProvenance
|
|
89
|
+
}
|
|
83
90
|
};
|
|
84
91
|
/**
|
|
85
92
|
* A busy dialog: the blocking spinner shown while a long-running command is in flight.
|
|
@@ -101,7 +108,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
101
108
|
]
|
|
102
109
|
},
|
|
103
110
|
displayName: 'Busy dialog',
|
|
104
|
-
description: 'The blocking spinner shown while a long-running command is in flight, with wording chosen up front.'
|
|
111
|
+
description: 'The blocking spinner shown while a long-running command is in flight, with wording chosen up front.',
|
|
112
|
+
metadata: {
|
|
113
|
+
...componentsBlueprintTemplateProvenance
|
|
114
|
+
}
|
|
105
115
|
};
|
|
106
116
|
/** The dialog templates this blueprint provides. */ const componentsDialogTemplates = [
|
|
107
117
|
commandDialogTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogTemplates.js","sources":["../../../templates/dialogTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from '@cratis/scene.blueprint.default';\nimport { busyIndicatorDialog, commandDialog, dialog } from './dialogElements';\nimport { icon } from './elements';\nimport { calendarField, inputTextField, numberField, textAreaField } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three dialog shapes an Arc application repeats: submit a command, confirm something destructive, and\n * say that something long-running is in flight.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction from a screen template. A\n * screen template is *placed* - it fills a slot on whatever contains it, and the containment chain decides\n * where it appears. A dialog is *summoned*: it opens over the application from wherever the code that\n * opened it happens to be, so there is no parent slot for it to name.\n *\n * Every one of these declares exactly one slot, which is a real departure from how the default blueprint\n * builds its dialogs, and the reason is worth stating. The default blueprint composes a dialog out of\n * primitives - a title, a message, a row of buttons - because primitives are all it has. Here the library\n * ships whole dialogs that resolve their result through Arc's dialog context, so the frame, the title bar\n * and the buttons all belong to the composite. A template that declared `header` and `actions` slots would\n * be offering regions that render *outside* the modal, which is worse than not offering them: a screen\n * would fill them, and the content would appear somewhere nobody expected.\n */\n\n/**\n * A command dialog: a short capture whose confirm button is the command's execution.\n *\n * Worth reaching for instead of composing `dialog` with `commandForm`, because a hand-composed pair has no\n * way to keep the dialog open on a rejected command without reimplementing the protocol. This one submits,\n * feeds the backend's validation results back onto the fields, and only closes when the command succeeded.\n *\n * The fields are placed by hand rather than generated, which is the opposite choice from `CommandFormPage`\n * and deliberate. A dialog is a *short* capture: three or four properties chosen because they are the ones\n * a person can answer in an overlay. Generating every property of the command would turn an overlay into a\n * page, which is precisely the decision a dialog is supposed to have already made.\n */\nexport const commandDialogTemplate: DialogTemplate = {\n name: 'CommandDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n commandDialog('command-dialog', SampleBindingName.RecordAdjustment, 'Record an adjustment', 'Record', [\n numberField('command-dialog-amount', 'amount', 'Amount'),\n inputTextField('command-dialog-reason', 'reason', 'Reason', 'Damaged goods'),\n calendarField('command-dialog-effective', 'effective', 'Effective from'),\n textAreaField('command-dialog-note', 'note', 'Note', 3),\n ]),\n ],\n },\n displayName: 'Command dialog',\n description: 'A short capture whose confirm button submits the command and only closes when it succeeded.',\n};\n\n/**\n * A confirmation dialog: one question, the consequence spelled out, and a way back.\n *\n * The Arc-aware `dialog` rather than PrimeReact's, because a caller `await`s a `DialogResult` from it\n * instead of threading `visible` state and callbacks by hand - which is the difference between a\n * confirmation you can call from a handler and one you have to wire into a component's state.\n *\n * The confirm label says what will happen rather than `OK`. A confirmation whose buttons are `OK` and\n * `Cancel` makes the reader map the question onto the answer under time pressure, which is exactly when\n * they will get it wrong.\n */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n dialog('confirm-dialog', 'Void this invoice?', 'Void it', 'Keep it', [\n icon('confirm-dialog-icon', 'pi pi-exclamation-triangle'),\n inputTextField('confirm-dialog-reason', 'reason', 'Why is it being voided?', 'Duplicate of INV-2041'),\n ]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, answered through Arc dialog context.',\n};\n\n/**\n * A busy dialog: the blocking spinner shown while a long-running command is in flight.\n *\n * In a running application the Arc dialog host renders this, threading its own title and message through.\n * Shipping it as a template is what lets its wording be *designed* rather than discovered the first time an\n * operation takes a while - which is the only moment anyone ever sees it, and the worst possible moment to\n * be reading a sentence nobody wrote on purpose.\n */\nexport const busyDialogTemplate: DialogTemplate = {\n name: 'BusyDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n busyIndicatorDialog('busy-dialog', 'Recording the adjustment', 'The invoice will reappear as soon as the read model catches up.'),\n ],\n },\n displayName: 'Busy dialog',\n description: 'The blocking spinner shown while a long-running command is in flight, with wording chosen up front.',\n};\n\n/** The dialog templates this blueprint provides. */\nexport const componentsDialogTemplates: DialogTemplate[] = [commandDialogTemplate, confirmDialogTemplate, busyDialogTemplate];\n"],"names":["commandDialogTemplate","name","slots","TemplateSlotName","Body","content","commandDialog","SampleBindingName","RecordAdjustment","numberField","inputTextField","calendarField","textAreaField","displayName","description","confirmDialogTemplate","dialog","icon","busyDialogTemplate","busyIndicatorDialog","componentsDialogTemplates"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dialogTemplates.js","sources":["../../../templates/dialogTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogTemplate } from '@cratis/scene.model';\nimport { TemplateSlotName } from '@cratis/scene.blueprint.default';\nimport { busyIndicatorDialog, commandDialog, dialog } from './dialogElements';\nimport { icon } from './elements';\nimport { calendarField, inputTextField, numberField, textAreaField } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The three dialog shapes an Arc application repeats: submit a command, confirm something destructive, and\n * say that something long-running is in flight.\n *\n * A dialog template has no `fitsSlot`, and that absence is the whole distinction from a screen template. A\n * screen template is *placed* - it fills a slot on whatever contains it, and the containment chain decides\n * where it appears. A dialog is *summoned*: it opens over the application from wherever the code that\n * opened it happens to be, so there is no parent slot for it to name.\n *\n * Every one of these declares exactly one slot, which is a real departure from how the default blueprint\n * builds its dialogs, and the reason is worth stating. The default blueprint composes a dialog out of\n * primitives - a title, a message, a row of buttons - because primitives are all it has. Here the library\n * ships whole dialogs that resolve their result through Arc's dialog context, so the frame, the title bar\n * and the buttons all belong to the composite. A template that declared `header` and `actions` slots would\n * be offering regions that render *outside* the modal, which is worse than not offering them: a screen\n * would fill them, and the content would appear somewhere nobody expected.\n */\n\n/**\n * A command dialog: a short capture whose confirm button is the command's execution.\n *\n * Worth reaching for instead of composing `dialog` with `commandForm`, because a hand-composed pair has no\n * way to keep the dialog open on a rejected command without reimplementing the protocol. This one submits,\n * feeds the backend's validation results back onto the fields, and only closes when the command succeeded.\n *\n * The fields are placed by hand rather than generated, which is the opposite choice from `CommandFormPage`\n * and deliberate. A dialog is a *short* capture: three or four properties chosen because they are the ones\n * a person can answer in an overlay. Generating every property of the command would turn an overlay into a\n * page, which is precisely the decision a dialog is supposed to have already made.\n */\nexport const commandDialogTemplate: DialogTemplate = {\n name: 'CommandDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n commandDialog('command-dialog', SampleBindingName.RecordAdjustment, 'Record an adjustment', 'Record', [\n numberField('command-dialog-amount', 'amount', 'Amount'),\n inputTextField('command-dialog-reason', 'reason', 'Reason', 'Damaged goods'),\n calendarField('command-dialog-effective', 'effective', 'Effective from'),\n textAreaField('command-dialog-note', 'note', 'Note', 3),\n ]),\n ],\n },\n displayName: 'Command dialog',\n description: 'A short capture whose confirm button submits the command and only closes when it succeeded.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/**\n * A confirmation dialog: one question, the consequence spelled out, and a way back.\n *\n * The Arc-aware `dialog` rather than PrimeReact's, because a caller `await`s a `DialogResult` from it\n * instead of threading `visible` state and callbacks by hand - which is the difference between a\n * confirmation you can call from a handler and one you have to wire into a component's state.\n *\n * The confirm label says what will happen rather than `OK`. A confirmation whose buttons are `OK` and\n * `Cancel` makes the reader map the question onto the answer under time pressure, which is exactly when\n * they will get it wrong.\n */\nexport const confirmDialogTemplate: DialogTemplate = {\n name: 'ConfirmDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n dialog('confirm-dialog', 'Void this invoice?', 'Void it', 'Keep it', [\n icon('confirm-dialog-icon', 'pi pi-exclamation-triangle'),\n inputTextField('confirm-dialog-reason', 'reason', 'Why is it being voided?', 'Duplicate of INV-2041'),\n ]),\n ],\n },\n displayName: 'Confirmation dialog',\n description: 'One question with the consequence spelled out, answered through Arc dialog context.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/**\n * A busy dialog: the blocking spinner shown while a long-running command is in flight.\n *\n * In a running application the Arc dialog host renders this, threading its own title and message through.\n * Shipping it as a template is what lets its wording be *designed* rather than discovered the first time an\n * operation takes a while - which is the only moment anyone ever sees it, and the worst possible moment to\n * be reading a sentence nobody wrote on purpose.\n */\nexport const busyDialogTemplate: DialogTemplate = {\n name: 'BusyDialog',\n slots: [{ name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Body]: [\n busyIndicatorDialog('busy-dialog', 'Recording the adjustment', 'The invoice will reappear as soon as the read model catches up.'),\n ],\n },\n displayName: 'Busy dialog',\n description: 'The blocking spinner shown while a long-running command is in flight, with wording chosen up front.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/** The dialog templates this blueprint provides. */\nexport const componentsDialogTemplates: DialogTemplate[] = [commandDialogTemplate, confirmDialogTemplate, busyDialogTemplate];\n"],"names":["commandDialogTemplate","name","slots","TemplateSlotName","Body","content","commandDialog","SampleBindingName","RecordAdjustment","numberField","inputTextField","calendarField","textAreaField","displayName","description","metadata","componentsBlueprintTemplateProvenance","confirmDialogTemplate","dialog","icon","busyDialogTemplate","busyIndicatorDialog","componentsDialogTemplates"],"mappings":";;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BaA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACN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IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBiB,YAAAA,mBAAAA,CAAoB,eAAe,0BAAA,EAA4B,iEAAA;AAClE;AACL,KAAA;IACAR,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa,qGAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAsC;AACzD;AAEA,qDACO,MAAMM,yBAAAA,GAA8C;AAACtB,IAAAA,qBAAAA;AAAuBiB,IAAAA,qBAAAA;AAAuBG,IAAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorTemplates.d.ts","sourceRoot":"","sources":["../../../templates/editorTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"editorTemplates.d.ts","sourceRoot":"","sources":["../../../templates/editorTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAgCrE,eAAO,MAAM,wBAAwB,EAAE,cA8BtC,CAAC;AAeF,eAAO,MAAM,wBAAwB,EAAE,cAgDtC,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,cAAc,EAAyD,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { TemplateSlotName, column, slotLeaf, SlotName, row } from '@cratis/scene
|
|
|
3
3
|
import { schemaEditor, timeMachine, objectContentEditor, objectNavigationalBar, filterPanel } from './editorElements.js';
|
|
4
4
|
import { page, toolbar, toolbarButton, toolbarSeparator, arcPageHeader, errorBoundary } from './elements.js';
|
|
5
5
|
import { SampleBindingName } from './SampleBindingName.js';
|
|
6
|
+
import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
6
7
|
|
|
7
8
|
// Copyright (c) Cratis. All rights reserved.
|
|
8
9
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -74,7 +75,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
74
75
|
]
|
|
75
76
|
},
|
|
76
77
|
displayName: 'Schema editor page',
|
|
77
|
-
description: "An event type's schema edited as a typed property tree, with the actions that evolve it."
|
|
78
|
+
description: "An event type's schema edited as a typed property tree, with the actions that evolve it.",
|
|
79
|
+
metadata: {
|
|
80
|
+
...componentsBlueprintTemplateProvenance
|
|
81
|
+
}
|
|
78
82
|
};
|
|
79
83
|
/**
|
|
80
84
|
* The object editor page: one document, its trail, and its history beside it.
|
|
@@ -157,7 +161,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
157
161
|
]
|
|
158
162
|
},
|
|
159
163
|
displayName: 'Object editor page',
|
|
160
|
-
description: 'One document edited against its schema, with its navigation trail and its version history.'
|
|
164
|
+
description: 'One document edited against its schema, with its navigation trail and its version history.',
|
|
165
|
+
metadata: {
|
|
166
|
+
...componentsBlueprintTemplateProvenance
|
|
167
|
+
}
|
|
161
168
|
};
|
|
162
169
|
/** The two editor-shaped templates. */ const editorTemplates = [
|
|
163
170
|
schemaEditorPageTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorTemplates.js","sources":["../../../templates/editorTemplates.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 { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { filterPanel, objectContentEditor, objectNavigationalBar, schemaEditor, timeMachine } from './editorElements';\nimport { arcPageHeader, errorBoundary, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The two inspection pages: one for a type's shape, one for an instance's content.\n *\n * These are the templates to open first when looking at this blueprint, because they are the two that\n * render completely with nothing registered. The schema editor, the document editor, the navigational bar\n * and the time machine all read their content out of the property bag rather than from a query, so a\n * preview of either page is a working page rather than a page of placeholders.\n *\n * That is not a trick to make a demo look better. It is the honest shape of the library: most of\n * `@cratis/components` is Arc-bound and needs a host, and a meaningful part of it is not. A blueprint built\n * on it should make both halves visible.\n */\n\n/**\n * The schema editor page: an event type's shape, edited as a typed property tree.\n *\n * Its header names no binding, and that is correct rather than an omission. A schema is design-time\n * metadata about an event type, not a read model anyone queries, so there is nothing for the header to be\n * bound to - and the header says `No binding` instead of implying a wiring step that does not exist. It is\n * the one page in this package where the unbound state is the finished state.\n *\n * `canEdit` is paired with `canNotEditReason` deliberately: in an event-sourced application a stored event\n * type's schema is very often deliberately locked, and saying why in the same place is what stops that\n * from reading as a bug.\n */\nexport const schemaEditorPageTemplate: ScreenTemplate = {\n name: 'SchemaEditorPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Toolbar), slotLeaf(TemplateSlotName.Body, { grow: 1 })], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('schema-header', {\n title: 'InvoiceRegistered',\n subtitle: 'The shape of the event, and what a new generation would be allowed to change',\n section: 'Event types',\n }),\n ],\n [TemplateSlotName.Toolbar]: [\n toolbar('schema-toolbar', [\n toolbarButton('schema-edit', 'Edit the schema', 'pi pi-pencil', 'Edit'),\n toolbarButton('schema-generation', 'Start a new generation', 'pi pi-clone', 'New generation'),\n toolbarSeparator('schema-separator'),\n toolbarButton('schema-download', 'Download as JSON Schema', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n page('schema-body', 'InvoiceRegistered', [schemaEditor('schema-editor', 'InvoiceRegistered', true)]),\n ],\n },\n displayName: 'Schema editor page',\n description: \"An event type's schema edited as a typed property tree, with the actions that evolve it.\",\n};\n\n/**\n * The object editor page: one document, its trail, and its history beside it.\n *\n * Bound to `InvoiceById`, because that is what a real page like this is: you arrive with an id, the query\n * fetches the record, and the editor renders it against its schema. The editors themselves take their\n * content from the property bag, so the page is fully legible before the query is wired - and the header\n * still says which query it is waiting for.\n *\n * The document is wrapped in an `errorBoundary` and the history is not, which is the decision this element\n * exists to let a template make. A malformed document should cost the document region; it should not take\n * the trail and the timeline down with it, and the timeline is the thing you would reach for to find out\n * *when* the document became malformed.\n */\nexport const objectEditorPageTemplate: ScreenTemplate = {\n name: 'ObjectEditorPage',\n fitsSlot: SlotName.Content,\n slots: [\n { name: TemplateSlotName.Header },\n { name: TemplateSlotName.Toolbar },\n { name: TemplateSlotName.Body },\n { name: TemplateSlotName.SidePanel },\n ],\n arrangement: {\n root: column([\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16),\n ]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column(\n [\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n slotLeaf(TemplateSlotName.Body),\n slotLeaf(TemplateSlotName.SidePanel),\n ],\n 16,\n ),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('object-header', {\n title: 'INV-2043',\n subtitle: 'The document as it stands, and every version it has been',\n section: 'Billing',\n query: SampleBindingName.InvoiceById,\n }),\n ],\n [TemplateSlotName.Toolbar]: [objectNavigationalBar('object-trail'), filterPanel('object-filters', 'Filters')],\n [TemplateSlotName.Body]: [\n errorBoundary('object-guard', [page('object-body', 'Document', [objectContentEditor('object-editor', true)])]),\n ],\n [TemplateSlotName.SidePanel]: [page('object-history', 'History', [timeMachine('object-time-machine')])],\n },\n displayName: 'Object editor page',\n description: 'One document edited against its schema, with its navigation trail and its version history.',\n};\n\n/** The two editor-shaped templates. */\nexport const editorTemplates: ScreenTemplate[] = [schemaEditorPageTemplate, objectEditorPageTemplate];\n"],"names":["schemaEditorPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Toolbar","Body","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","toolbar","toolbarButton","toolbarSeparator","page","schemaEditor","displayName","description","objectEditorPageTemplate","SidePanel","row","overrides","width","WidthSizeClass","Compact","query","SampleBindingName","InvoiceById","objectNavigationalBar","filterPanel","errorBoundary","objectContentEditor","timeMachine","editorTemplates"],"mappings":";;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;;;;;UAyBaA,wBAAAA,GAA2C;IACpDC,IAAAA,EAAM,kBAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAQ,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,iBAAiBG;AAAK;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,MAAAA,CAAO;AAACC,YAAAA,QAAAA,CAASP,iBAAiBC,MAAM,CAAA;AAAGM,YAAAA,QAAAA,CAASP,iBAAiBE,OAAO,CAAA;YAAGK,QAAAA,CAASP,gBAAAA,CAAiBG,IAAI,EAAE;gBAAEK,IAAAA,EAAM;AAAE,aAAA;SAAG,EAAE,EAAA;AACxI,KAAA;IACAC,OAAAA,EAAS;QACL,CAACT,gBAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,aAAAA,CAAc,eAAA,EAAiB;gBAC3BC,KAAAA,EAAO,mBAAA;gBACPC,QAAAA,EAAU,8EAAA;gBACVC,OAAAA,EAAS;AACb,aAAA;AACH,SAAA;QACD,CAACb,gBAAAA,CAAiBE,OAAO,GAAG;AACxBY,YAAAA,OAAAA,CAAQ,g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B,eAAAA,GAAoC;AAAC1C,IAAAA,wBAAAA;AAA0B2B,IAAAA;;;"}
|
|
1
|
+
{"version":3,"file":"editorTemplates.js","sources":["../../../templates/editorTemplates.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 { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { filterPanel, objectContentEditor, objectNavigationalBar, schemaEditor, timeMachine } from './editorElements';\nimport { arcPageHeader, errorBoundary, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The two inspection pages: one for a type's shape, one for an instance's content.\n *\n * These are the templates to open first when looking at this blueprint, because they are the two that\n * render completely with nothing registered. The schema editor, the document editor, the navigational bar\n * and the time machine all read their content out of the property bag rather than from a query, so a\n * preview of either page is a working page rather than a page of placeholders.\n *\n * That is not a trick to make a demo look better. It is the honest shape of the library: most of\n * `@cratis/components` is Arc-bound and needs a host, and a meaningful part of it is not. A blueprint built\n * on it should make both halves visible.\n */\n\n/**\n * The schema editor page: an event type's shape, edited as a typed property tree.\n *\n * Its header names no binding, and that is correct rather than an omission. A schema is design-time\n * metadata about an event type, not a read model anyone queries, so there is nothing for the header to be\n * bound to - and the header says `No binding` instead of implying a wiring step that does not exist. It is\n * the one page in this package where the unbound state is the finished state.\n *\n * `canEdit` is paired with `canNotEditReason` deliberately: in an event-sourced application a stored event\n * type's schema is very often deliberately locked, and saying why in the same place is what stops that\n * from reading as a bug.\n */\nexport const schemaEditorPageTemplate: ScreenTemplate = {\n name: 'SchemaEditorPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Toolbar), slotLeaf(TemplateSlotName.Body, { grow: 1 })], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('schema-header', {\n title: 'InvoiceRegistered',\n subtitle: 'The shape of the event, and what a new generation would be allowed to change',\n section: 'Event types',\n }),\n ],\n [TemplateSlotName.Toolbar]: [\n toolbar('schema-toolbar', [\n toolbarButton('schema-edit', 'Edit the schema', 'pi pi-pencil', 'Edit'),\n toolbarButton('schema-generation', 'Start a new generation', 'pi pi-clone', 'New generation'),\n toolbarSeparator('schema-separator'),\n toolbarButton('schema-download', 'Download as JSON Schema', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n page('schema-body', 'InvoiceRegistered', [schemaEditor('schema-editor', 'InvoiceRegistered', true)]),\n ],\n },\n displayName: 'Schema editor page',\n description: \"An event type's schema edited as a typed property tree, with the actions that evolve it.\",\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/**\n * The object editor page: one document, its trail, and its history beside it.\n *\n * Bound to `InvoiceById`, because that is what a real page like this is: you arrive with an id, the query\n * fetches the record, and the editor renders it against its schema. The editors themselves take their\n * content from the property bag, so the page is fully legible before the query is wired - and the header\n * still says which query it is waiting for.\n *\n * The document is wrapped in an `errorBoundary` and the history is not, which is the decision this element\n * exists to let a template make. A malformed document should cost the document region; it should not take\n * the trail and the timeline down with it, and the timeline is the thing you would reach for to find out\n * *when* the document became malformed.\n */\nexport const objectEditorPageTemplate: ScreenTemplate = {\n name: 'ObjectEditorPage',\n fitsSlot: SlotName.Content,\n slots: [\n { name: TemplateSlotName.Header },\n { name: TemplateSlotName.Toolbar },\n { name: TemplateSlotName.Body },\n { name: TemplateSlotName.SidePanel },\n ],\n arrangement: {\n root: column([\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16),\n ]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column(\n [\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n slotLeaf(TemplateSlotName.Body),\n slotLeaf(TemplateSlotName.SidePanel),\n ],\n 16,\n ),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('object-header', {\n title: 'INV-2043',\n subtitle: 'The document as it stands, and every version it has been',\n section: 'Billing',\n query: SampleBindingName.InvoiceById,\n }),\n ],\n [TemplateSlotName.Toolbar]: [objectNavigationalBar('object-trail'), filterPanel('object-filters', 'Filters')],\n [TemplateSlotName.Body]: [\n errorBoundary('object-guard', [page('object-body', 'Document', [objectContentEditor('object-editor', true)])]),\n ],\n [TemplateSlotName.SidePanel]: [page('object-history', 'History', [timeMachine('object-time-machine')])],\n },\n displayName: 'Object editor page',\n description: 'One document edited against its schema, with its navigation trail and its version history.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/** The two editor-shaped templates. */\nexport const editorTemplates: ScreenTemplate[] = [schemaEditorPageTemplate, objectEditorPageTemplate];\n"],"names":["schemaEditorPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Toolbar","Body","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","toolbar","toolbarButton","toolbarSeparator","page","schemaEditor","displayName","description","metadata","componentsBlueprintTemplateProvenance","objectEditorPageTemplate","SidePanel","row","overrides","width","WidthSizeClass","Compact","query","SampleBindingName","InvoiceById","objectNavigationalBar","filterPanel","errorBoundary","objectContentEditor","timeMachine","editorTemplates"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;;;UAyBaA,wBAAAA,GAA2C;IACpDC,IAAAA,EAAM,kBAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN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,EAAO,UAAA;gBACPC,QAAAA,EAAU,0DAAA;gBACVC,OAAAA,EAAS,SAAA;AACTiB,gBAAAA,KAAAA,EAAOC,kBAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAAChC,gBAAAA,CAAiBE,OAAO,GAAG;YAAC+B,qBAAAA,CAAsB,cAAA,CAAA;AAAiBC,YAAAA,WAAAA,CAAY,gBAAA,EAAkB,SAAA;AAAW,SAAA;QAC7G,CAAClC,gBAAAA,CAAiBG,IAAI,GAAG;AACrBgC,YAAAA,aAAAA,CAAc,cAAA,EAAgB;AAAClB,gBAAAA,IAAAA,CAAK,eAAe,UAAA,EAAY;AAACmB,oBAAAA,mBAAAA,CAAoB,eAAA,EAAiB,IAAA;AAAM,iBAAA;AAAE,aAAA;AAChH,SAAA;QACD,CAACpC,gBAAAA,CAAiBwB,SAAS,GAAG;AAACP,YAAAA,IAAAA,CAAK,kBAAkB,SAAA,EAAW;gBAACoB,WAAAA,CAAY,qBAAA;AAAuB,aAAA;AAAE;AAC3G,KAAA;IACAlB,WAAAA,EAAa,oBAAA;IACbC,WAAAA,EAAa,4FAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAsC;AACzD;AAEA,wCACO,MAAMgB,eAAAA,GAAoC;AAAC5C,IAAAA,wBAAAA;AAA0B6B,IAAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAiC,MAAM,qBAAqB,CAAC;AA+BpF,eAAO,MAAM,oBAAoB,EAAE,cA2BlC,CAAC;AAWF,eAAO,MAAM,8BAA8B,EAAE,cAsB5C,CAAC;AAcF,eAAO,MAAM,8BAA8B,EAAE,cAkC5C,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,cAAc,EAA2F,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { dataPage, observableDataTable, invoiceTableOptions, invoiceColumns } fr
|
|
|
4
4
|
import { objectNavigationalBar, objectContentEditor, timeMachine } from './editorElements.js';
|
|
5
5
|
import { arcPageHeader, toolbar, toolbarButton, toolbarSeparator, toolbarGroup, page } from './elements.js';
|
|
6
6
|
import { SampleBindingName } from './SampleBindingName.js';
|
|
7
|
+
import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
7
8
|
|
|
8
9
|
// Copyright (c) Cratis. All rights reserved.
|
|
9
10
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -62,6 +63,7 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
62
63
|
]
|
|
63
64
|
},
|
|
64
65
|
metadata: {
|
|
66
|
+
...componentsBlueprintTemplateProvenance,
|
|
65
67
|
type: 'List',
|
|
66
68
|
category: 'Business / List',
|
|
67
69
|
scopes: [
|
|
@@ -106,6 +108,7 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
106
108
|
]
|
|
107
109
|
},
|
|
108
110
|
metadata: {
|
|
111
|
+
...componentsBlueprintTemplateProvenance,
|
|
109
112
|
type: 'List',
|
|
110
113
|
category: 'Business / Live operations',
|
|
111
114
|
scopes: [
|
|
@@ -184,6 +187,7 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
184
187
|
]
|
|
185
188
|
},
|
|
186
189
|
metadata: {
|
|
190
|
+
...componentsBlueprintTemplateProvenance,
|
|
187
191
|
type: 'Detail',
|
|
188
192
|
category: 'Business / Master detail',
|
|
189
193
|
scopes: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.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, TemplateScope, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { dataPage, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, objectNavigationalBar, timeMachine } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarGroup, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three list shapes an Arc application repeats: a list, a live list, and a list with the selected\n * record beside it.\n *\n * All three fill the application shell's `content` slot, which is the only slot the default blueprint's\n * `AppShell` layout declares for a screen - so an application that has picked the default blueprint can\n * drop any of these in without arranging anything.\n *\n * What makes them worth shipping is what is *already wired*. A list page is not \"a table in a slot\"; it is\n * a query name, a set of columns, an empty message, a data key, a filter field list, a header that states\n * what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven\n * per screen is how a list page ends up subtly different on every screen of an application.\n */\n\n/**\n * The archetype: a `dataPage` filling the body, under a header that says what it is bound to.\n *\n * `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole\n * list-screen composite, with its title bar, menubar, filterable table and optional details pane driven\n * from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of\n * modeling for a worse result, and this template is the answer to that: an application supplies a query\n * name and has a working list page.\n */\nexport const dataListPageTemplate: ScreenTemplate = {\n name: 'DataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader(\n 'data-list-header',\n { title: 'Invoices', subtitle: 'Every invoice, filterable and paged against the server', section: 'Billing', query: SampleBindingName.AllInvoices },\n [\n toolbar('data-list-actions', [\n toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),\n toolbarSeparator('data-list-separator'),\n toolbarGroup('data-list-export', [\n toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),\n toolbarButton('data-list-print', 'Print', 'pi pi-print'),\n ]),\n ]),\n ],\n ),\n ],\n [TemplateSlotName.Body]: [dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n },\n metadata: { type: 'List', category: 'Business / List', scopes: [TemplateScope.Slice] },\n displayName: 'Data list page',\n description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.',\n};\n\n/**\n * The live variant: the same page shape over an observable query.\n *\n * A separate template rather than a flag, for the same reason `observableDataTable` is a separate name\n * from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is\n * configured. An observable query opens a subscription and the page re-renders when the read model\n * changes on the server. Choosing this template is an application saying its data is live, and that is a\n * decision worth being able to read off the screen rather than infer from a property.\n */\nexport const observableDataListPageTemplate: ScreenTemplate = {\n name: 'ObservableDataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('observable-list-header', {\n title: 'Invoices in flight',\n subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',\n section: 'Billing',\n query: SampleBindingName.InvoicesInFlight,\n }),\n ],\n [TemplateSlotName.Body]: [\n page('observable-list-body', 'In flight', [\n observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n metadata: { type: 'List', category: 'Business / Live operations', scopes: [TemplateScope.Slice] },\n displayName: 'Observable data list page',\n description: 'A live list over an observable query, which re-renders when the read model changes on the server.',\n};\n\n/**\n * List plus detail: the whole list screen, with the selected record's document and history beside it.\n *\n * The detail region is built from the library's Arc-free editors, which is the interesting part. They read\n * their content out of the property bag rather than from a query, so this half of the page renders fully\n * at design time while the list half is still a placeholder - and in an event-sourced application the\n * record's *history* is as natural a thing to show as its current values, which is why the time machine is\n * here rather than in some optional extra.\n *\n * Its arrangement drops the detail column below the list at a compact width, because a document editor and\n * a paged table side by side on a phone are two unreadable slivers.\n */\nexport const dataListWithDetailPageTemplate: ScreenTemplate = {\n name: 'DataListWithDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('list-detail-header', {\n title: 'Invoices',\n subtitle: 'The list, with the selected invoice beside it',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Body]: [dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n [TemplateSlotName.SidePanel]: [\n page('list-detail-panel', 'Selected invoice', [\n objectNavigationalBar('list-detail-trail'),\n objectContentEditor('list-detail-document', false),\n timeMachine('list-detail-history'),\n ]),\n ],\n },\n metadata: { type: 'Detail', category: 'Business / Master detail', scopes: [TemplateScope.Slice] },\n displayName: 'Data list with detail page',\n description: 'A dataPage beside a detail region showing the selected record document and its history.',\n};\n\n/** The three list-shaped templates. */\nexport const listTemplates: ScreenTemplate[] = [dataListPageTemplate, observableDataListPageTemplate, dataListWithDetailPageTemplate];\n"],"names":["dataListPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","toolbar","toolbarButton","toolbarSeparator","toolbarGroup","dataPage","invoiceTableOptions","invoiceColumns","metadata","type","category","scopes","TemplateScope","Slice","displayName","description","observableDataListPageTemplate","InvoicesInFlight","page","observableDataTable","dataListWithDetailPageTemplate","SidePanel","arrangement","root","column","slotLeaf","row","grow","overrides","width","WidthSizeClass","Compact","objectNavigationalBar","objectContentEditor","timeMachine","listTemplates"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;UAuBaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM,cAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK;AAAE,KAAA;IAC3EC,OAAAA,EAAS;QACL,CAACH,gBAAAA,CAAiBC,MAAM,GAAG;AACvBG,YAAAA,aAAAA,CACI,kBAAA,EACA;gBAAEC,KAAAA,EAAO,UAAA;gBAAYC,QAAAA,EAAU,wDAAA;gBAA0DC,OAAAA,EAAS,SAAA;AAAWC,gBAAAA,KAAAA,EAAOC,kBAAkBC;aAAY,EAClJ;AACIC,gBAAAA,OAAAA,CAAQ,mBAAA,EAAqB;oBACzBC,aAAAA,CAAc,eAAA,EAAiB,uBAAuB,YAAA,EAAc,KAAA,CAAA;AACpEA,oBAAAA,aAAAA,CAAc,qBAAqB,SAAA,EAAW,eAAA,CAAA;oBAC9CC,gBAAAA,CAAiB,qBAAA,CAAA;AACjBC,oBAAAA,YAAAA,CAAa,kBAAA,EAAoB;AAC7BF,wBAAAA,aAAAA,CAAc,sBAAsB,iBAAA,EAAmB,gBAAA,CAAA;AACvDA,wBAAAA,aAAAA,CAAc,mBAAmB,OAAA,EAAS,aAAA;AAC7C,qBAAA;AACJ,iBAAA;AACJ,aAAA;AAER,SAAA;QACD,CAACZ,gBAAAA,CAAiBE,IAAI,GAAG;AAACa,YAAAA,QAAAA,CAAS,gBAAA,EAAkBN,iBAAAA,CAAkBC,WAAW,EAAEM,mBAAAA,EAAqBC,cAAAA;AAAgB;AAC7H,KAAA;IACAC,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AEM,mBAAAA,EAAqBC,cAAAA;AAAgB,SAAA;QAC3H,CAACjB,gBAAAA,CAAiB+B,SAAS,GAAG;AAC1BH,YAAAA,IAAAA,CAAK,qBAAqB,kBAAA,EAAoB;gBAC1Cc,qBAAAA,CAAsB,mBAAA,CAAA;AACtBC,gBAAAA,mBAAAA,CAAoB,sBAAA,EAAwB,KAAA,CAAA;gBAC5CC,WAAAA,CAAY,qBAAA;AACf,aAAA;AACJ;AACL,KAAA;IACA1B,QAAAA,EAAU;QAAEC,IAAAA,EAAM,QAAA;QAAUC,QAAAA,EAAU,0BAAA;QAA4BC,MAAAA,EAAQ;AAACC,YAAAA,aAAAA,CAAcC;AAAM;AAAC,KAAA;IAChGC,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMoB,aAAAA,GAAkC;AAACnD,IAAAA,oBAAAA;AAAsBgC,IAAAA,8BAAAA;AAAgCI,IAAAA;;;"}
|
|
1
|
+
{"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.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, TemplateScope, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { dataPage, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, objectNavigationalBar, timeMachine } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarGroup, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The three list shapes an Arc application repeats: a list, a live list, and a list with the selected\n * record beside it.\n *\n * All three fill the application shell's `content` slot, which is the only slot the default blueprint's\n * `AppShell` layout declares for a screen - so an application that has picked the default blueprint can\n * drop any of these in without arranging anything.\n *\n * What makes them worth shipping is what is *already wired*. A list page is not \"a table in a slot\"; it is\n * a query name, a set of columns, an empty message, a data key, a filter field list, a header that states\n * what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven\n * per screen is how a list page ends up subtly different on every screen of an application.\n */\n\n/**\n * The archetype: a `dataPage` filling the body, under a header that says what it is bound to.\n *\n * `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole\n * list-screen composite, with its title bar, menubar, filterable table and optional details pane driven\n * from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of\n * modeling for a worse result, and this template is the answer to that: an application supplies a query\n * name and has a working list page.\n */\nexport const dataListPageTemplate: ScreenTemplate = {\n name: 'DataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader(\n 'data-list-header',\n { title: 'Invoices', subtitle: 'Every invoice, filterable and paged against the server', section: 'Billing', query: SampleBindingName.AllInvoices },\n [\n toolbar('data-list-actions', [\n toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),\n toolbarSeparator('data-list-separator'),\n toolbarGroup('data-list-export', [\n toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),\n toolbarButton('data-list-print', 'Print', 'pi pi-print'),\n ]),\n ]),\n ],\n ),\n ],\n [TemplateSlotName.Body]: [dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n },\n metadata: { ...componentsBlueprintTemplateProvenance, type: 'List', category: 'Business / List', scopes: [TemplateScope.Slice] },\n displayName: 'Data list page',\n description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.',\n};\n\n/**\n * The live variant: the same page shape over an observable query.\n *\n * A separate template rather than a flag, for the same reason `observableDataTable` is a separate name\n * from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is\n * configured. An observable query opens a subscription and the page re-renders when the read model\n * changes on the server. Choosing this template is an application saying its data is live, and that is a\n * decision worth being able to read off the screen rather than infer from a property.\n */\nexport const observableDataListPageTemplate: ScreenTemplate = {\n name: 'ObservableDataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('observable-list-header', {\n title: 'Invoices in flight',\n subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',\n section: 'Billing',\n query: SampleBindingName.InvoicesInFlight,\n }),\n ],\n [TemplateSlotName.Body]: [\n page('observable-list-body', 'In flight', [\n observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n metadata: { ...componentsBlueprintTemplateProvenance, type: 'List', category: 'Business / Live operations', scopes: [TemplateScope.Slice] },\n displayName: 'Observable data list page',\n description: 'A live list over an observable query, which re-renders when the read model changes on the server.',\n};\n\n/**\n * List plus detail: the whole list screen, with the selected record's document and history beside it.\n *\n * The detail region is built from the library's Arc-free editors, which is the interesting part. They read\n * their content out of the property bag rather than from a query, so this half of the page renders fully\n * at design time while the list half is still a placeholder - and in an event-sourced application the\n * record's *history* is as natural a thing to show as its current values, which is why the time machine is\n * here rather than in some optional extra.\n *\n * Its arrangement drops the detail column below the list at a compact width, because a document editor and\n * a paged table side by side on a phone are two unreadable slivers.\n */\nexport const dataListWithDetailPageTemplate: ScreenTemplate = {\n name: 'DataListWithDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('list-detail-header', {\n title: 'Invoices',\n subtitle: 'The list, with the selected invoice beside it',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Body]: [dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n [TemplateSlotName.SidePanel]: [\n page('list-detail-panel', 'Selected invoice', [\n objectNavigationalBar('list-detail-trail'),\n objectContentEditor('list-detail-document', false),\n timeMachine('list-detail-history'),\n ]),\n ],\n },\n metadata: { ...componentsBlueprintTemplateProvenance, type: 'Detail', category: 'Business / Master detail', scopes: [TemplateScope.Slice] },\n displayName: 'Data list with detail page',\n description: 'A dataPage beside a detail region showing the selected record document and its history.',\n};\n\n/** The three list-shaped templates. */\nexport const listTemplates: ScreenTemplate[] = [dataListPageTemplate, observableDataListPageTemplate, dataListWithDetailPageTemplate];\n"],"names":["dataListPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","toolbar","toolbarButton","toolbarSeparator","toolbarGroup","dataPage","invoiceTableOptions","invoiceColumns","metadata","componentsBlueprintTemplateProvenance","type","category","scopes","TemplateScope","Slice","displayName","description","observableDataListPageTemplate","InvoicesInFlight","page","observableDataTable","dataListWithDetailPageTemplate","SidePanel","arrangement","root","column","slotLeaf","row","grow","overrides","width","WidthSizeClass","Compact","objectNavigationalBar","objectContentEditor","timeMachine","listTemplates"],"mappings":";;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;UAuBaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM,cAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iB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QAAA,GAAGC,qCAAqC;QAAEC,IAAAA,EAAM,QAAA;QAAUC,QAAAA,EAAU,0BAAA;QAA4BC,MAAAA,EAAQ;AAACC,YAAAA,aAAAA,CAAcC;AAAM;AAAC,KAAA;IAC1IC,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMoB,aAAAA,GAAkC;AAACpD,IAAAA,oBAAAA;AAAsBiC,IAAAA,8BAAAA;AAAgCI,IAAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../../../templates/nesting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"nesting.d.ts","sourceRoot":"","sources":["../../../templates/nesting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAkCrD,eAAO,MAAM,sBAAsB,EAAE,cAiBpC,CAAC;AASF,eAAO,MAAM,0BAA0B,EAAE,cAsBxC,CAAC;AAUF,eAAO,MAAM,2BAA2B,EAAE,cAuBzC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,cAAc,EAAsF,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { observableDataTable, invoiceTableOptions, invoiceColumns } from './data
|
|
|
3
3
|
import { filterPanel } from './editorElements.js';
|
|
4
4
|
import { page, arcPageHeader, toolbar, toolbarButton, toolbarSeparator } from './elements.js';
|
|
5
5
|
import { SampleBindingName } from './SampleBindingName.js';
|
|
6
|
+
import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
6
7
|
|
|
7
8
|
// Copyright (c) Cratis. All rights reserved.
|
|
8
9
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -58,7 +59,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
58
59
|
]
|
|
59
60
|
},
|
|
60
61
|
displayName: 'Data module page',
|
|
61
|
-
description: 'Module level: fits the application layout content slot and offers a body for one feature.'
|
|
62
|
+
description: 'Module level: fits the application layout content slot and offers a body for one feature.',
|
|
63
|
+
metadata: {
|
|
64
|
+
...componentsBlueprintTemplateProvenance
|
|
65
|
+
}
|
|
62
66
|
};
|
|
63
67
|
/**
|
|
64
68
|
* Feature level: fits the module page's `body` slot.
|
|
@@ -96,7 +100,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
96
100
|
]
|
|
97
101
|
},
|
|
98
102
|
displayName: 'Data feature section',
|
|
99
|
-
description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.'
|
|
103
|
+
description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.',
|
|
104
|
+
metadata: {
|
|
105
|
+
...componentsBlueprintTemplateProvenance
|
|
106
|
+
}
|
|
100
107
|
};
|
|
101
108
|
/**
|
|
102
109
|
* Slice level: fits the feature section's `primary` slot.
|
|
@@ -133,7 +140,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
133
140
|
]
|
|
134
141
|
},
|
|
135
142
|
displayName: 'Command slice section',
|
|
136
|
-
description: 'Slice level: fits a feature section primary slot and hosts one command behavior.'
|
|
143
|
+
description: 'Slice level: fits a feature section primary slot and hosts one command behavior.',
|
|
144
|
+
metadata: {
|
|
145
|
+
...componentsBlueprintTemplateProvenance
|
|
146
|
+
}
|
|
137
147
|
};
|
|
138
148
|
/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */ const nestingChainTemplates = [
|
|
139
149
|
dataModulePageTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nesting.js","sources":["../../../templates/nesting.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, TemplateSlotName } from '@cratis/scene.blueprint.default';\nimport { invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { filterPanel } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * A worked three-level chain, from the application layout down to one behavior.\n *\n * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by\n * whatever contains it. A module's template fits the application layout's `content`; a feature's fits a\n * slot the module's declares; a slice's fits one the feature's declares. Nothing here is a special case\n * for a particular level, which is exactly why the hierarchy can be arbitrarily deep with no second\n * mechanism.\n *\n * The slot names are chosen so that each fitted name is declared by exactly one container in the chain -\n * `body` only by the module, `primary` only by the feature. That is not decoration: `resolveScreenTemplates`\n * places a template only when the containers in scope agree on exactly one home for it, and reports it as\n * unplaced rather than guessing when two of them declare the same name. A chain that reused `body` at\n * three levels would read fine and resolve to nothing.\n *\n * The whole chain is Arc-bound, which is the point of it living in *this* blueprint rather than being a\n * second copy of the default one's. It ends where a Cratis slice really ends: a button that summons the\n * command dialog.\n */\n\n/**\n * Module level: fits the application shell's `content` slot.\n *\n * A module always has a name and a description, so it brings its own header, and it offers a body for the\n * feature inside it plus a side panel for the filters that apply across the whole module.\n */\nexport const dataModulePageTemplate: ScreenTemplate = {\n name: 'DataModulePage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('module-header', {\n title: 'Billing',\n subtitle: 'Everything the billing module owns',\n section: 'Operations',\n }),\n ],\n [TemplateSlotName.SidePanel]: [page('module-filters', 'Filters', [filterPanel('module-filter-panel', 'Filter the module')])],\n },\n displayName: 'Data module page',\n description: 'Module level: fits the application layout content slot and offers a body for one feature.',\n};\n\n/**\n * Feature level: fits the module page's `body` slot.\n *\n * A feature is where actions belong - a module is a grouping and a slice is one behavior, and the feature\n * in between is what a user thinks of as \"the screen with the buttons on it\". It offers a primary region\n * for the slice and a secondary one for the live view of what that slice is doing.\n */\nexport const dataFeatureSectionTemplate: ScreenTemplate = {\n name: 'DataFeatureSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n content: {\n [TemplateSlotName.Toolbar]: [\n toolbar('feature-toolbar', [\n toolbarButton('feature-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('feature-adjust', 'Record an adjustment', 'pi pi-pencil', 'Adjust'),\n toolbarSeparator('feature-separator'),\n toolbarButton('feature-export', 'Export the feature data', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n page('feature-live', 'In flight', [\n observableDataTable('feature-live-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n displayName: 'Data feature section',\n description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.',\n};\n\n/**\n * Slice level: fits the feature section's `primary` slot.\n *\n * The end of the chain, and deliberately the thinnest thing in it. A slice is one behavior, and in a\n * Cratis application that behavior is one command - so its surface is a header saying what the command is\n * and whether it is wired, and the action that summons it. The capture itself happens in the `CommandDialog`\n * dialog template, which is why this template has no form on it and does not need one.\n */\nexport const commandSliceSectionTemplate: ScreenTemplate = {\n name: 'CommandSliceSection',\n fitsSlot: TemplateSlotName.Primary,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('slice-header', {\n title: 'Record an adjustment',\n subtitle: 'One behavior, one command, one button',\n section: 'Adjustments',\n command: SampleBindingName.RecordAdjustment,\n }),\n ],\n [TemplateSlotName.Actions]: [\n toolbar('slice-actions', [\n toolbarButton('slice-record', 'Record an adjustment', 'pi pi-check', 'Record'),\n toolbarButton('slice-cancel', 'Leave the invoice as it is', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n displayName: 'Command slice section',\n description: 'Slice level: fits a feature section primary slot and hosts one command behavior.',\n};\n\n/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */\nexport const nestingChainTemplates: ScreenTemplate[] = [dataModulePageTemplate, dataFeatureSectionTemplate, commandSliceSectionTemplate];\n"],"names":["dataModulePageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","SidePanel","content","arcPageHeader","title","subtitle","section","page","filterPanel","displayName","description","dataFeatureSectionTemplate","Toolbar","Primary","Secondary","toolbar","toolbarButton","toolbarSeparator","observableDataTable","SampleBindingName","InvoicesInFlight","invoiceTableOptions","invoiceColumns","commandSliceSectionTemplate","Actions","command","RecordAdjustment","nestingChainTemplates"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nesting.js","sources":["../../../templates/nesting.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, TemplateSlotName } from '@cratis/scene.blueprint.default';\nimport { invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { filterPanel } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * A worked three-level chain, from the application layout down to one behavior.\n *\n * The nesting rule is one rule applied at every depth: a template names, in `fitsSlot`, a slot declared by\n * whatever contains it. A module's template fits the application layout's `content`; a feature's fits a\n * slot the module's declares; a slice's fits one the feature's declares. Nothing here is a special case\n * for a particular level, which is exactly why the hierarchy can be arbitrarily deep with no second\n * mechanism.\n *\n * The slot names are chosen so that each fitted name is declared by exactly one container in the chain -\n * `body` only by the module, `primary` only by the feature. That is not decoration: `resolveScreenTemplates`\n * places a template only when the containers in scope agree on exactly one home for it, and reports it as\n * unplaced rather than guessing when two of them declare the same name. A chain that reused `body` at\n * three levels would read fine and resolve to nothing.\n *\n * The whole chain is Arc-bound, which is the point of it living in *this* blueprint rather than being a\n * second copy of the default one's. It ends where a Cratis slice really ends: a button that summons the\n * command dialog.\n */\n\n/**\n * Module level: fits the application shell's `content` slot.\n *\n * A module always has a name and a description, so it brings its own header, and it offers a body for the\n * feature inside it plus a side panel for the filters that apply across the whole module.\n */\nexport const dataModulePageTemplate: ScreenTemplate = {\n name: 'DataModulePage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('module-header', {\n title: 'Billing',\n subtitle: 'Everything the billing module owns',\n section: 'Operations',\n }),\n ],\n [TemplateSlotName.SidePanel]: [page('module-filters', 'Filters', [filterPanel('module-filter-panel', 'Filter the module')])],\n },\n displayName: 'Data module page',\n description: 'Module level: fits the application layout content slot and offers a body for one feature.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/**\n * Feature level: fits the module page's `body` slot.\n *\n * A feature is where actions belong - a module is a grouping and a slice is one behavior, and the feature\n * in between is what a user thinks of as \"the screen with the buttons on it\". It offers a primary region\n * for the slice and a secondary one for the live view of what that slice is doing.\n */\nexport const dataFeatureSectionTemplate: ScreenTemplate = {\n name: 'DataFeatureSection',\n fitsSlot: TemplateSlotName.Body,\n slots: [{ name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n content: {\n [TemplateSlotName.Toolbar]: [\n toolbar('feature-toolbar', [\n toolbarButton('feature-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('feature-adjust', 'Record an adjustment', 'pi pi-pencil', 'Adjust'),\n toolbarSeparator('feature-separator'),\n toolbarButton('feature-export', 'Export the feature data', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n page('feature-live', 'In flight', [\n observableDataTable('feature-live-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n displayName: 'Data feature section',\n description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/**\n * Slice level: fits the feature section's `primary` slot.\n *\n * The end of the chain, and deliberately the thinnest thing in it. A slice is one behavior, and in a\n * Cratis application that behavior is one command - so its surface is a header saying what the command is\n * and whether it is wired, and the action that summons it. The capture itself happens in the `CommandDialog`\n * dialog template, which is why this template has no form on it and does not need one.\n */\nexport const commandSliceSectionTemplate: ScreenTemplate = {\n name: 'CommandSliceSection',\n fitsSlot: TemplateSlotName.Primary,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Actions }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('slice-header', {\n title: 'Record an adjustment',\n subtitle: 'One behavior, one command, one button',\n section: 'Adjustments',\n command: SampleBindingName.RecordAdjustment,\n }),\n ],\n [TemplateSlotName.Actions]: [\n toolbar('slice-actions', [\n toolbarButton('slice-record', 'Record an adjustment', 'pi pi-check', 'Record'),\n toolbarButton('slice-cancel', 'Leave the invoice as it is', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n displayName: 'Command slice section',\n description: 'Slice level: fits a feature section primary slot and hosts one command behavior.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */\nexport const nestingChainTemplates: ScreenTemplate[] = [dataModulePageTemplate, dataFeatureSectionTemplate, commandSliceSectionTemplate];\n"],"names":["dataModulePageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","SidePanel","content","arcPageHeader","title","subtitle","section","page","filterPanel","displayName","description","metadata","componentsBlueprintTemplateProvenance","dataFeatureSectionTemplate","Toolbar","Primary","Secondary","toolbar","toolbarButton","toolbarSeparator","observableDataTable","SampleBindingName","InvoicesInFlight","invoiceTableOptions","invoiceColumns","commandSliceSectionTemplate","Actions","command","RecordAdjustment","nestingChainTemplates"],"mappings":";;;;;;;AAAA;AACA;AAUA;;;;;;;;;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wB,aAAA,EAAe,QAAA,CAAA;gBACrEA,aAAAA,CAAc,cAAA,EAAgB,8BAA8B,aAAA,EAAe,QAAA;AAC9E,aAAA;AACJ;AACL,KAAA;IACAT,WAAAA,EAAa,uBAAA;IACbC,WAAAA,EAAa,kFAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAsC;AACzD;AAEA,mGACO,MAAMiB,qBAAAA,GAA0C;AAACrC,IAAAA,sBAAAA;AAAwBqB,IAAAA,0BAAAA;AAA4BY,IAAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceTemplates.d.ts","sourceRoot":"","sources":["../../../templates/workspaceTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"workspaceTemplates.d.ts","sourceRoot":"","sources":["../../../templates/workspaceTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAkB,MAAM,qBAAqB,CAAC;AAgDrE,eAAO,MAAM,wBAAwB,EAAE,cAmCtC,CAAC;AAYF,eAAO,MAAM,qBAAqB,EAAE,cAgEnC,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,cAAc,EAAsD,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { dataTable, observableDataTable, invoiceColumns, invoiceTableOptions, ad
|
|
|
4
4
|
import { objectContentEditor, timeMachine } from './editorElements.js';
|
|
5
5
|
import { page, arcPageHeader } from './elements.js';
|
|
6
6
|
import { SampleBindingName } from './SampleBindingName.js';
|
|
7
|
+
import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js';
|
|
7
8
|
|
|
8
9
|
// Copyright (c) Cratis. All rights reserved.
|
|
9
10
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -114,7 +115,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
114
115
|
]
|
|
115
116
|
},
|
|
116
117
|
displayName: 'Master-detail page',
|
|
117
|
-
description: 'A queried list in the larger column with the selected record and its history in the narrower one.'
|
|
118
|
+
description: 'A queried list in the larger column with the selected record and its history in the narrower one.',
|
|
119
|
+
metadata: {
|
|
120
|
+
...componentsBlueprintTemplateProvenance
|
|
121
|
+
}
|
|
118
122
|
};
|
|
119
123
|
/**
|
|
120
124
|
* A dashboard of data widgets - four queries arranged so the page reads in the order people already read it.
|
|
@@ -197,7 +201,10 @@ import { SampleBindingName } from './SampleBindingName.js';
|
|
|
197
201
|
]
|
|
198
202
|
},
|
|
199
203
|
displayName: 'Dashboard page',
|
|
200
|
-
description: 'A row of query-backed widgets over a wide and a narrow column, each bound to its own query.'
|
|
204
|
+
description: 'A row of query-backed widgets over a wide and a narrow column, each bound to its own query.',
|
|
205
|
+
metadata: {
|
|
206
|
+
...componentsBlueprintTemplateProvenance
|
|
207
|
+
}
|
|
201
208
|
};
|
|
202
209
|
/** The two workspace-shaped templates. */ const workspaceTemplates = [
|
|
203
210
|
masterDetailPageTemplate,
|