@cratis/scene.blueprint.components 4.24.0 → 4.25.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/templates/commandTemplates.js +3 -0
- package/dist/cjs/templates/commandTemplates.js.map +1 -1
- package/dist/cjs/templates/dialogTemplates.js +6 -3
- package/dist/cjs/templates/dialogTemplates.js.map +1 -1
- package/dist/cjs/templates/editorTemplates.js +4 -2
- package/dist/cjs/templates/editorTemplates.js.map +1 -1
- package/dist/cjs/templates/listTemplates.js +9 -0
- package/dist/cjs/templates/listTemplates.js.map +1 -1
- package/dist/cjs/templates/nesting.js +6 -3
- package/dist/cjs/templates/nesting.js.map +1 -1
- package/dist/cjs/templates/workspaceTemplates.js +4 -2
- package/dist/cjs/templates/workspaceTemplates.js.map +1 -1
- package/dist/esm/templates/commandTemplates.d.ts.map +1 -1
- package/dist/esm/templates/commandTemplates.js +4 -1
- package/dist/esm/templates/commandTemplates.js.map +1 -1
- package/dist/esm/templates/dialogTemplates.js +6 -3
- package/dist/esm/templates/dialogTemplates.js.map +1 -1
- package/dist/esm/templates/editorTemplates.js +4 -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 +10 -1
- package/dist/esm/templates/listTemplates.js.map +1 -1
- package/dist/esm/templates/nesting.js +6 -3
- package/dist/esm/templates/nesting.js.map +1 -1
- package/dist/esm/templates/workspaceTemplates.js +4 -2
- package/dist/esm/templates/workspaceTemplates.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/templates/commandTemplates.ts +2 -2
- package/templates/dialogTemplates.ts +3 -3
- package/templates/editorTemplates.ts +2 -2
- package/templates/listTemplates.ts +4 -4
- package/templates/nesting.ts +3 -3
- package/templates/workspaceTemplates.ts +2 -2
|
@@ -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';\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;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAc,gBAAA,EAAkBC,iBAAAA,CAAkBC,gBAAgB,EAAE,wBAAwB,QAAA,EAAU;AAClGC,gBAAAA,WAAAA,CAAY,yBAAyB,QAAA,EAAU,QAAA,CAAA;gBAC/CC,cAAAA,CAAe,uBAAA,EAAyB,UAAU,QAAA,EAAU,eAAA,CAAA;AAC5DC,gBAAAA,aAAAA,CAAc,4BAA4B,WAAA,EAAa,gBAAA,CAAA;gBACvDC,aAAAA,CAAc,qBAAA,EAAuB,QAAQ,MAAA,EAAQ,CAAA;AACxD,aAAA;AACJ;AACL,KAAA;IACAC,WAAAA,EAAa,gBAAA;IACbC,WAAAA,EAAa,6FAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;
|
|
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, category: 'Business / Dialog' },\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, category: 'Business / Dialog' },\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, category: 'Business / Dialog' },\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","category","confirmDialogTemplate","dialog","icon","busyDialogTemplate","busyIndicatorDialog","componentsDialogTemplates"],"mappings":";;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BaA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAc,gBAAA,EAAkBC,iBAAAA,CAAkBC,gBAAgB,EAAE,wBAAwB,QAAA,EAAU;AAClGC,gBAAAA,WAAAA,CAAY,yBAAyB,QAAA,EAAU,QAAA,CAAA;gBAC/CC,cAAAA,CAAe,uBAAA,EAAyB,UAAU,QAAA,EAAU,eAAA,CAAA;AAC5DC,gBAAAA,aAAAA,CAAc,4BAA4B,WAAA,EAAa,gBAAA,CAAA;gBACvDC,aAAAA,CAAc,qBAAA,EAAuB,QAAQ,MAAA,EAAQ,CAAA;AACxD,aAAA;AACJ;AACL,KAAA;IACAC,WAAAA,EAAa,gBAAA;IACbC,WAAAA,EAAa,6FAAA;IACbC,QAAAA,EAAU;A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ayName: 'Schema editor page',
|
|
78
78
|
description: "An event type's schema edited as a typed property tree, with the actions that evolve it.",
|
|
79
79
|
metadata: {
|
|
80
|
-
...componentsBlueprintTemplateProvenance
|
|
80
|
+
...componentsBlueprintTemplateProvenance,
|
|
81
|
+
category: 'Business / Editor'
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
/**
|
|
@@ -163,7 +164,8 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
163
164
|
displayName: 'Object editor page',
|
|
164
165
|
description: 'One document edited against its schema, with its navigation trail and its version history.',
|
|
165
166
|
metadata: {
|
|
166
|
-
...componentsBlueprintTemplateProvenance
|
|
167
|
+
...componentsBlueprintTemplateProvenance,
|
|
168
|
+
category: 'Business / Editor'
|
|
167
169
|
}
|
|
168
170
|
};
|
|
169
171
|
/** The two editor-shaped templates. */ const editorTemplates = [
|
|
@@ -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';\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,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,gBAAA,EAAkB;gBACtBC,aAAAA,CAAc,aAAA,EAAe,mBAAmB,cAAA,EAAgB,MA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AGC;AAAsC;AACzD;AAEA,wCACO,MAAMgB,eAAAA,GAAoC;AAAC5C,IAAAA,wBAAAA;AAA0B6B,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, category: 'Business / Editor' },\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, category: 'Business / Editor' },\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","category","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;AA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L,CAACT,gBAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,aAAAA,CAAc,eAAA,EAAiB;gBAC3BC,KAAAA,EAAO,UAAA;gBACPC,QAAAA,EAAU,0DAAA;gBACVC,OAAAA,EAAS,SAAA;AACTkB,gBAAAA,KAAAA,EAAOC,kBAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAACjC,gBAAAA,CAAiBE,OAAO,GAAG;YAACgC,qBAAAA,CAAsB,cAAA,CAAA;AAAiBC,YAAAA,WAAAA,CAAY,gBAAA,EAAkB,SAAA;AAAW,SAAA;QAC7G,CAACnC,gBAAAA,CAAiBG,IAAI,GAAG;AACrBiC,YAAAA,aAAAA,CAAc,cAAA,EAAgB;AAACnB,gBAAAA,IAAAA,CAAK,eAAe,UAAA,EAAY;AAACoB,oBAAAA,mBAAAA,CAAoB,eAAA,EAAiB,IAAA;AAAM,iBAAA;AAAE,aAAA;AAChH,SAAA;QACD,CAACrC,gBAAAA,CAAiByB,SAAS,GAAG;AAACR,YAAAA,IAAAA,CAAK,kBAAkB,SAAA,EAAW;gBAACqB,WAAAA,CAAY,qBAAA;AAAuB,aAAA;AAAE;AAC3G,KAAA;IACAnB,WAAAA,EAAa,oBAAA;IACbC,WAAAA,EAAa,4FAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC,qCAAqC;QAAEC,QAAAA,EAAU;AAAoB;AACxF;AAEA,wCACO,MAAMgB,eAAAA,GAAoC;AAAC7C,IAAAA,wBAAAA;AAA0B8B,IAAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"listTemplates.d.ts","sourceRoot":"","sources":["../../../templates/listTemplates.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAA4C,MAAM,qBAAqB,CAAC;AA+B/F,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TemplateScope, WidthSizeClass } from '@cratis/scene.model';
|
|
1
|
+
import { SliceKind, TemplateScope, WidthSizeClass } from '@cratis/scene.model';
|
|
2
2
|
import { TemplateSlotName, SlotName, column, slotLeaf, row } from '@cratis/scene.blueprint.default';
|
|
3
3
|
import { dataPage, observableDataTable, invoiceTableOptions, invoiceColumns } from './dataElements.js';
|
|
4
4
|
import { objectNavigationalBar, objectContentEditor, timeMachine } from './editorElements.js';
|
|
@@ -68,6 +68,9 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
68
68
|
category: 'Business / List',
|
|
69
69
|
scopes: [
|
|
70
70
|
TemplateScope.Slice
|
|
71
|
+
],
|
|
72
|
+
sliceKinds: [
|
|
73
|
+
SliceKind.StateView
|
|
71
74
|
]
|
|
72
75
|
},
|
|
73
76
|
displayName: 'Data list page',
|
|
@@ -113,6 +116,9 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
113
116
|
category: 'Business / Live operations',
|
|
114
117
|
scopes: [
|
|
115
118
|
TemplateScope.Slice
|
|
119
|
+
],
|
|
120
|
+
sliceKinds: [
|
|
121
|
+
SliceKind.StateView
|
|
116
122
|
]
|
|
117
123
|
},
|
|
118
124
|
displayName: 'Observable data list page',
|
|
@@ -192,6 +198,9 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
192
198
|
category: 'Business / Master detail',
|
|
193
199
|
scopes: [
|
|
194
200
|
TemplateScope.Slice
|
|
201
|
+
],
|
|
202
|
+
sliceKinds: [
|
|
203
|
+
SliceKind.StateView
|
|
195
204
|
]
|
|
196
205
|
},
|
|
197
206
|
displayName: 'Data list with detail page',
|
|
@@ -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';\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,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,CA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ACH;AACL,KAAA;IACA7B,OAAAA,EAAS;QACL,CAACH,gBAAAA,CAAiBC,MAAM,GAAG;AACvBG,YAAAA,aAAAA,CAAc,oBAAA,EAAsB;gBAChCC,KAAAA,EAAO,UAAA;gBACPC,QAAAA,EAAU,+CAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,KAAAA,EAAOC,kBAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAACV,gBAAAA,CAAiBE,IAAI,GAAG;AAACa,YAAAA,QAAAA,CAAS,kBAAA,EAAoBN,iBAAAA,CAAkBC,WAAW,EAAEM,mBAAAA,EAAqBC,cAAAA;AAAgB,SAAA;QAC3H,CAACjB,gBAAAA,CAAiBgC,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;IACA3B,QAAAA,EAAU;AAAE,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
|
+
{"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, SliceKind, 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], sliceKinds: [SliceKind.StateView] },\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], sliceKinds: [SliceKind.StateView] },\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], sliceKinds: [SliceKind.StateView] },\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","sliceKinds","SliceKind","StateView","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,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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,YAAAA,aAAAA,CAAc,oBAAA,EAAsB;gBAChCC,KAAAA,EAAO,UAAA;gBACPC,QAAAA,EAAU,+CAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,KAAAA,EAAOC,kBAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAACV,gBAAAA,CAAiBE,IAAI,GAAG;AAACa,YAAAA,QAAAA,CAAS,kBAAA,EAAoBN,iBAAAA,CAAkBC,WAAW,EAAEM,mBAAAA,EAAqBC,cAAAA;AAAgB,SAAA;QAC3H,CAACjB,gBAAAA,CAAiBmC,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;IACA9B,QAAAA,EAAU;AAAE,QAAA,GAAGC,qCAAqC;QAAEC,IAAAA,EAAM,QAAA;QAAUC,QAAAA,EAAU,0BAAA;QAA4BC,MAAAA,EAAQ;AAACC,YAAAA,aAAAA,CAAcC;AAAM,SAAA;QAAEC,UAAAA,EAAY;AAACC,YAAAA,SAAAA,CAAUC;AAAU;AAAC,KAAA;IAC7KC,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMoB,aAAAA,GAAkC;AAACvD,IAAAA,oBAAAA;AAAsBoC,IAAAA,8BAAAA;AAAgCI,IAAAA;;;"}
|
|
@@ -61,7 +61,8 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
61
61
|
displayName: 'Data module page',
|
|
62
62
|
description: 'Module level: fits the application layout content slot and offers a body for one feature.',
|
|
63
63
|
metadata: {
|
|
64
|
-
...componentsBlueprintTemplateProvenance
|
|
64
|
+
...componentsBlueprintTemplateProvenance,
|
|
65
|
+
category: 'Business / Workspace'
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
/**
|
|
@@ -102,7 +103,8 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
102
103
|
displayName: 'Data feature section',
|
|
103
104
|
description: 'Feature level: fits a module page body slot, brings the action toolbar and a live view.',
|
|
104
105
|
metadata: {
|
|
105
|
-
...componentsBlueprintTemplateProvenance
|
|
106
|
+
...componentsBlueprintTemplateProvenance,
|
|
107
|
+
category: 'Business / Section'
|
|
106
108
|
}
|
|
107
109
|
};
|
|
108
110
|
/**
|
|
@@ -142,7 +144,8 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
142
144
|
displayName: 'Command slice section',
|
|
143
145
|
description: 'Slice level: fits a feature section primary slot and hosts one command behavior.',
|
|
144
146
|
metadata: {
|
|
145
|
-
...componentsBlueprintTemplateProvenance
|
|
147
|
+
...componentsBlueprintTemplateProvenance,
|
|
148
|
+
category: 'Business / Section'
|
|
146
149
|
}
|
|
147
150
|
};
|
|
148
151
|
/** The chain, outermost first - what a spec walks to prove `fitsSlot` resolves at every level. */ const nestingChainTemplates = [
|
|
@@ -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';\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;;;;;;;;;;;;;;;;;;;;;;;UA0BaA,sBAAAA,GAAyC;IAClDC,IAAAA,EAAM,gBAAA;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;AAAU;AAAE,KAAA;IACjHC,OAAAA,EAAS;QACL,CAACJ,gBAAAA,CAAiBC,MAAM,GAAG;AACvBI,YAAAA,aAAAA,CAAc,eAAA,EAAiB;gBAC3BC,KAAAA,EAAO,SAAA;gBACPC,QAAAA,EAAU,oCAAA;gBACVC,OAAAA,EAAS;AACb,aAAA;AACH,SAAA;QACD,CAACR,gBAAAA,CAAiBG,SAAS,GAAG;AAACM,YAAAA,IAAAA,CAAK,kBAAkB,SAAA,EAAW;AAACC,gBAAAA,WAAAA,CAAY,qBAAA,EAAuB,mBAAA;AAAqB,aAAA;AAAE;AAChI,KAAA;IACAC,WAAAA,EAAa,kBAAA;IACbC,WAAAA,EAAa,2FAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;
|
|
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, category: 'Business / Workspace' },\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, category: 'Business / Section' },\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, category: 'Business / Section' },\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","category","dataFeatureSectionTemplate","Toolbar","Primary","Secondary","toolbar","toolbarButton","toolbarSeparator","observableDataTable","SampleBindingName","InvoicesInFlight","invoiceTableOptions","invoiceColumns","commandSliceSectionTemplate","Actions","command","RecordAdjustment","nestingChainTemplates"],"mappings":";;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;;;;UA0BaA,sBAAAA,GAAyC;IAClDC,IAAAA,EAAM,gBAAA;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;AAAU;AAAE,KAAA;IACjHC,OAAAA,EAAS;QACL,CAACJ,gBAAAA,CAAiBC,MAAM,GAAG;AACvBI,YAAAA,aAAAA,CAAc,eAAA,EAAiB;gBAC3BC,KAAAA,EAAO,SAAA;gBACPC,QAAAA,EAAU,oCAAA;gBACV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|
117
117
|
displayName: 'Master-detail page',
|
|
118
118
|
description: 'A queried list in the larger column with the selected record and its history in the narrower one.',
|
|
119
119
|
metadata: {
|
|
120
|
-
...componentsBlueprintTemplateProvenance
|
|
120
|
+
...componentsBlueprintTemplateProvenance,
|
|
121
|
+
category: 'Business / Master detail'
|
|
121
122
|
}
|
|
122
123
|
};
|
|
123
124
|
/**
|
|
@@ -203,7 +204,8 @@ import { componentsBlueprintTemplateProvenance } from '../templateProvenance.js'
|
|
|
203
204
|
displayName: 'Dashboard page',
|
|
204
205
|
description: 'A row of query-backed widgets over a wide and a narrow column, each bound to its own query.',
|
|
205
206
|
metadata: {
|
|
206
|
-
...componentsBlueprintTemplateProvenance
|
|
207
|
+
...componentsBlueprintTemplateProvenance,
|
|
208
|
+
category: 'Business / Dashboard'
|
|
207
209
|
}
|
|
208
210
|
};
|
|
209
211
|
/** The two workspace-shaped templates. */ const workspaceTemplates = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaceTemplates.js","sources":["../../../templates/workspaceTemplates.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, grid, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { ColumnDefinition } from './ColumnDefinition';\nimport { adjustmentColumns, dataTable, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, timeMachine } from './editorElements';\nimport { arcPageHeader, page } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { TableOptions } from './TableOptions';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The two whole-workspace shapes: a master-detail arrangement, and a dashboard of data widgets.\n *\n * Both are arrangements of *several* bindings rather than one, which is what separates them from the list\n * templates. That is also what makes them the templates most worth shipping: an application can wire one\n * query without help, and gets a page that looks like every other page in the product only if something\n * has already decided how four of them sit together.\n */\n\n/** The columns of the revenue widget's query. */\nconst revenueColumns: ColumnDefinition[] = [\n { field: 'month', header: 'Month' },\n { field: 'invoiced', header: 'Invoiced' },\n { field: 'collected', header: 'Collected' },\n];\n\n/** The columns of the open-tickets widget's query. */\nconst ticketColumns: ColumnDefinition[] = [\n { field: 'reference', header: 'Reference' },\n { field: 'subject', header: 'Subject' },\n { field: 'age', header: 'Age' },\n];\n\n/** Table options for a widget-sized table, where there is no search box to filter across. */\nconst widgetTableOptions: TableOptions = { emptyMessage: 'Nothing to show yet', dataKey: 'id' };\n\n/**\n * Master and detail: the list in the larger column, the selected record in the narrower one.\n *\n * The difference from `DataListWithDetailPage` is real and worth having both. That template is a whole\n * `dataPage` - its own title bar, menubar and filtering - with a detail region added beside it. This one is\n * a plain `dataTable` next to a detail region, which is the right shape when the page's chrome comes from\n * the *feature* around it rather than from the list itself. Reaching for the wrong one shows up as a page\n * with two toolbars.\n *\n * The grid collapses to a single column at a compact width, because a master and a detail side by side on a\n * phone is the arrangement that made \"master-detail does not work on mobile\" a truism.\n */\nexport const masterDetailPageTemplate: ScreenTemplate = {\n name: 'MasterDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.Secondary)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('master-detail-header', {\n title: 'Invoices',\n subtitle: 'Pick an invoice on the left to inspect it on the right',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Primary]: [\n page('master-detail-master', 'Invoices', [dataTable('master-detail-table', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)]),\n ],\n [TemplateSlotName.Secondary]: [\n page('master-detail-detail', 'Selected invoice', [\n objectContentEditor('master-detail-document', false),\n timeMachine('master-detail-history'),\n ]),\n ],\n },\n displayName: 'Master-detail page',\n description: 'A queried list in the larger column with the selected record and its history in the narrower one.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/**\n * A dashboard of data widgets - four queries arranged so the page reads in the order people already read it.\n *\n * The composition is the one every template line settles on: a row of figures across the top, then a wide\n * column and a narrow one. Copying it is the point rather than a shortcut - it is the arrangement the eye\n * already knows how to scan, and a dashboard that invents its own costs the reader a moment on every visit.\n *\n * What this blueprint adds is that every widget is a *query*, not a picture. Each one names a proxy a host\n * registers, so the dashboard is live the moment the application wires it, with nothing to replace.\n */\nexport const dashboardPageTemplate: ScreenTemplate = {\n name: 'DashboardPage',\n fitsSlot: SlotName.Content,\n slots: [\n { name: TemplateSlotName.Header },\n { name: TemplateSlotName.Stats },\n { name: TemplateSlotName.Primary },\n { name: TemplateSlotName.Secondary },\n ],\n arrangement: {\n root: column([\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Stats),\n grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16),\n ]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column(\n [\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Stats),\n slotLeaf(TemplateSlotName.Primary),\n slotLeaf(TemplateSlotName.Secondary),\n ],\n 16,\n ),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('dashboard-header', {\n title: 'Billing',\n subtitle: 'Four queries, arranged the way people already read a dashboard',\n section: 'Operations',\n query: SampleBindingName.RevenueByMonth,\n }),\n ],\n [TemplateSlotName.Stats]: [\n page('dashboard-stat-revenue', 'Revenue by month', [\n dataTable('dashboard-stat-revenue-table', SampleBindingName.RevenueByMonth, widgetTableOptions, revenueColumns),\n ]),\n page('dashboard-stat-flight', 'In flight', [\n observableDataTable('dashboard-stat-flight-table', SampleBindingName.InvoicesInFlight, widgetTableOptions, invoiceColumns),\n ]),\n page('dashboard-stat-tickets', 'Open tickets', [\n dataTable('dashboard-stat-tickets-table', SampleBindingName.OpenTickets, widgetTableOptions, ticketColumns),\n ]),\n ],\n [TemplateSlotName.Primary]: [\n page('dashboard-invoices', 'Recent invoices', [\n dataTable('dashboard-invoices-table', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n page('dashboard-adjustments', 'Adjustments', [\n dataTable('dashboard-adjustments-table', SampleBindingName.AllAdjustments, widgetTableOptions, adjustmentColumns),\n ]),\n ],\n },\n displayName: 'Dashboard page',\n description: 'A row of query-backed widgets over a wide and a narrow column, each bound to its own query.',\n metadata: { ...componentsBlueprintTemplateProvenance },\n};\n\n/** The two workspace-shaped templates. */\nexport const workspaceTemplates: ScreenTemplate[] = [masterDetailPageTemplate, dashboardPageTemplate];\n"],"names":["revenueColumns","field","header","ticketColumns","widgetTableOptions","emptyMessage","dataKey","masterDetailPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Primary","Secondary","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","page","dataTable","invoiceTableOptions","invoiceColumns","objectContentEditor","timeMachine","displayName","description","metadata","componentsBlueprintTemplateProvenance","dashboardPageTemplate","Stats","RevenueByMonth","observableDataTable","InvoicesInFlight","OpenTickets","AllAdjustments","adjustmentColumns","workspaceTemplates"],"mappings":";;;;;;;;AAAA;AACA;AAYA;;;;;;;sDAUA,MAAMA,cAAAA,GAAqC;AACvC,IAAA;QAAEC,KAAAA,EAAO,OAAA;QAASC,MAAAA,EAAQ;AAAQ,KAAA;AAClC,IAAA;QAAED,KAAAA,EAAO,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AAkBc,cAAc,EAAE3C,kBAAAA,EAAoBJ,cAAAA;AACnG,aAAA,CAAA;AACDmC,YAAAA,IAAAA,CAAK,yBAAyB,WAAA,EAAa;AACvCa,gBAAAA,mBAAAA,CAAoB,6BAAA,EAA+Bf,iBAAAA,CAAkBgB,gBAAgB,EAAE7C,kBAAAA,EAAoBkC,cAAAA;AAC9G,aAAA,CAAA;AACDH,YAAAA,IAAAA,CAAK,0BAA0B,cAAA,EAAgB;AAC3CC,gBAAAA,SAAAA,CAAU,8BAAA,EAAgCH,iBAAAA,CAAkBiB,WAAW,EAAE9C,kBAAAA,EAAoBD,aAAAA;AAChG,aAAA;AACJ,SAAA;QACD,CAACU,gBAAAA,CAAiBE,OAAO,GAAG;AACxBoB,YAAAA,IAAAA,CAAK,sBAAsB,iBAAA,EAAmB;AAC1CC,gBAAAA,SAAAA,CAAU,0BAAA,EAA4BH,iBAAAA,CAAkBC,WAAW,EAAEG,mBAAAA,EAAqBC,cAAAA;AAC7F,aAAA;AACJ,SAAA;QACD,CAACzB,gBAAAA,CAAiBG,SAAS,GAAG;AAC1BmB,YAAAA,IAAAA,CAAK,yBAAyB,aAAA,EAAe;AACzCC,gBAAAA,SAAAA,CAAU,6BAAA,EAA+BH,iBAAAA,CAAkBkB,cAAc,EAAE/C,kBAAAA,EAAoBgD,iBAAAA;AAClG,aAAA;AACJ;AACL,KAAA;IACAX,WAAAA,EAAa,gBAAA;IACbC,WAAAA,EAAa,6FAAA;IACbC,QAAAA,EAAU;AAAE,QAAA,GAAGC;AAAsC;AACzD;AAEA,2CACO,MAAMS,kBAAAA,GAAuC;AAAC9C,IAAAA,wBAAAA;AAA0BsC,IAAAA;;;"}
|
|
1
|
+
{"version":3,"file":"workspaceTemplates.js","sources":["../../../templates/workspaceTemplates.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, grid, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { ColumnDefinition } from './ColumnDefinition';\nimport { adjustmentColumns, dataTable, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, timeMachine } from './editorElements';\nimport { arcPageHeader, page } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\nimport { TableOptions } from './TableOptions';\nimport { componentsBlueprintTemplateProvenance } from '../templateProvenance';\n\n/**\n * The two whole-workspace shapes: a master-detail arrangement, and a dashboard of data widgets.\n *\n * Both are arrangements of *several* bindings rather than one, which is what separates them from the list\n * templates. That is also what makes them the templates most worth shipping: an application can wire one\n * query without help, and gets a page that looks like every other page in the product only if something\n * has already decided how four of them sit together.\n */\n\n/** The columns of the revenue widget's query. */\nconst revenueColumns: ColumnDefinition[] = [\n { field: 'month', header: 'Month' },\n { field: 'invoiced', header: 'Invoiced' },\n { field: 'collected', header: 'Collected' },\n];\n\n/** The columns of the open-tickets widget's query. */\nconst ticketColumns: ColumnDefinition[] = [\n { field: 'reference', header: 'Reference' },\n { field: 'subject', header: 'Subject' },\n { field: 'age', header: 'Age' },\n];\n\n/** Table options for a widget-sized table, where there is no search box to filter across. */\nconst widgetTableOptions: TableOptions = { emptyMessage: 'Nothing to show yet', dataKey: 'id' };\n\n/**\n * Master and detail: the list in the larger column, the selected record in the narrower one.\n *\n * The difference from `DataListWithDetailPage` is real and worth having both. That template is a whole\n * `dataPage` - its own title bar, menubar and filtering - with a detail region added beside it. This one is\n * a plain `dataTable` next to a detail region, which is the right shape when the page's chrome comes from\n * the *feature* around it rather than from the list itself. Reaching for the wrong one shows up as a page\n * with two toolbars.\n *\n * The grid collapses to a single column at a compact width, because a master and a detail side by side on a\n * phone is the arrangement that made \"master-detail does not work on mobile\" a truism.\n */\nexport const masterDetailPageTemplate: ScreenTemplate = {\n name: 'MasterDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Primary }, { name: TemplateSlotName.Secondary }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Primary), slotLeaf(TemplateSlotName.Secondary)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('master-detail-header', {\n title: 'Invoices',\n subtitle: 'Pick an invoice on the left to inspect it on the right',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Primary]: [\n page('master-detail-master', 'Invoices', [dataTable('master-detail-table', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)]),\n ],\n [TemplateSlotName.Secondary]: [\n page('master-detail-detail', 'Selected invoice', [\n objectContentEditor('master-detail-document', false),\n timeMachine('master-detail-history'),\n ]),\n ],\n },\n displayName: 'Master-detail page',\n description: 'A queried list in the larger column with the selected record and its history in the narrower one.',\n metadata: { ...componentsBlueprintTemplateProvenance, category: 'Business / Master detail' },\n};\n\n/**\n * A dashboard of data widgets - four queries arranged so the page reads in the order people already read it.\n *\n * The composition is the one every template line settles on: a row of figures across the top, then a wide\n * column and a narrow one. Copying it is the point rather than a shortcut - it is the arrangement the eye\n * already knows how to scan, and a dashboard that invents its own costs the reader a moment on every visit.\n *\n * What this blueprint adds is that every widget is a *query*, not a picture. Each one names a proxy a host\n * registers, so the dashboard is live the moment the application wires it, with nothing to replace.\n */\nexport const dashboardPageTemplate: ScreenTemplate = {\n name: 'DashboardPage',\n fitsSlot: SlotName.Content,\n slots: [\n { name: TemplateSlotName.Header },\n { name: TemplateSlotName.Stats },\n { name: TemplateSlotName.Primary },\n { name: TemplateSlotName.Secondary },\n ],\n arrangement: {\n root: column([\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Stats),\n grid([slotLeaf(TemplateSlotName.Primary, { span: 2 }), slotLeaf(TemplateSlotName.Secondary)], 3, 16),\n ]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column(\n [\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Stats),\n slotLeaf(TemplateSlotName.Primary),\n slotLeaf(TemplateSlotName.Secondary),\n ],\n 16,\n ),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('dashboard-header', {\n title: 'Billing',\n subtitle: 'Four queries, arranged the way people already read a dashboard',\n section: 'Operations',\n query: SampleBindingName.RevenueByMonth,\n }),\n ],\n [TemplateSlotName.Stats]: [\n page('dashboard-stat-revenue', 'Revenue by month', [\n dataTable('dashboard-stat-revenue-table', SampleBindingName.RevenueByMonth, widgetTableOptions, revenueColumns),\n ]),\n page('dashboard-stat-flight', 'In flight', [\n observableDataTable('dashboard-stat-flight-table', SampleBindingName.InvoicesInFlight, widgetTableOptions, invoiceColumns),\n ]),\n page('dashboard-stat-tickets', 'Open tickets', [\n dataTable('dashboard-stat-tickets-table', SampleBindingName.OpenTickets, widgetTableOptions, ticketColumns),\n ]),\n ],\n [TemplateSlotName.Primary]: [\n page('dashboard-invoices', 'Recent invoices', [\n dataTable('dashboard-invoices-table', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n [TemplateSlotName.Secondary]: [\n page('dashboard-adjustments', 'Adjustments', [\n dataTable('dashboard-adjustments-table', SampleBindingName.AllAdjustments, widgetTableOptions, adjustmentColumns),\n ]),\n ],\n },\n displayName: 'Dashboard page',\n description: 'A row of query-backed widgets over a wide and a narrow column, each bound to its own query.',\n metadata: { ...componentsBlueprintTemplateProvenance, category: 'Business / Dashboard' },\n};\n\n/** The two workspace-shaped templates. */\nexport const workspaceTemplates: ScreenTemplate[] = [masterDetailPageTemplate, dashboardPageTemplate];\n"],"names":["revenueColumns","field","header","ticketColumns","widgetTableOptions","emptyMessage","dataKey","masterDetailPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Primary","Secondary","arrangement","root","column","slotLeaf","grid","span","overrides","width","WidthSizeClass","Compact","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","page","dataTable","invoiceTableOptions","invoiceColumns","objectContentEditor","timeMachine","displayName","description","metadata","componentsBlueprintTemplateProvenance","category","dashboardPageTemplate","Stats","RevenueByMonth","observableDataTable","InvoicesInFlight","OpenTickets","AllAdjustments","adjustmentColumns","workspaceTemplates"],"mappings":";;;;;;;;AAAA;AACA;AAYA;;;;;;;sDAUA,MAAMA,cAAAA,GAAqC;AACvC,IAAA;QAAEC,KAAAA,EAAO,OAAA;QAASC,MAAAA,EAAQ;AAAQ,KAAA;AAClC,IAAA;QAAED,KAAAA,EAAO,UAAA;QAAYC,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAED,KAAAA,EAAO,WAAA;QAAaC,MAAAA,EAAQ;AAAY;AAC7C,CAAA;AAED,uDACA,MAAMC,aAAAA,GAAoC;AACtC,IAAA;QAAEF,KAAAA,EAAO,WAAA;QAAaC,MAAAA,EAAQ;AAAY,KAAA;AAC1C,IAAA;QAAED,KAAAA,EAAO,SAAA;QAAWC,MAAAA,EAAQ;AAAU,KAAA;AACtC,IAAA;QAAED,KAAAA,EAAO,KAAA;QAAOC,MAAAA,EAAQ;AAAM;AACjC,CAAA;AAED,8FACA,MAAME,kBAAAA,GAAmC;IAAEC,YAAAA,EAAc,qBAAA;IAAuBC,OAAAA,EAAS;AAAK,CAAA;AAE9F;;;;;;;;;;;UAYaC,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,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