@cratis/scene.blueprint.components 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BorrowedComponentName.js.map +1 -1
- package/dist/cjs/ComponentName.js.map +1 -1
- package/dist/cjs/CompositeName.js.map +1 -1
- package/dist/cjs/componentsBlueprint.js.map +1 -1
- package/dist/cjs/componentsBlueprintComponents.js.map +1 -1
- package/dist/cjs/gallery/DialogTemplatePreview.js.map +1 -1
- package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/cjs/gallery/applicationChrome.js.map +1 -1
- package/dist/cjs/gallery/navigation.js.map +1 -1
- package/dist/cjs/gallery/previewProfile.js.map +1 -1
- package/dist/cjs/gallery/screens.js.map +1 -1
- package/dist/cjs/header/ArcPageHeader.js.map +1 -1
- package/dist/cjs/header/deriveArcHeading.js.map +1 -1
- package/dist/cjs/header/humanizeBindingName.js.map +1 -1
- package/dist/cjs/packageName.js.map +1 -1
- package/dist/cjs/templates/SampleBindingName.js.map +1 -1
- package/dist/cjs/templates/commandTemplates.js.map +1 -1
- package/dist/cjs/templates/dataElements.js.map +1 -1
- package/dist/cjs/templates/dialogElements.js.map +1 -1
- package/dist/cjs/templates/dialogTemplates.js.map +1 -1
- package/dist/cjs/templates/editorElements.js.map +1 -1
- package/dist/cjs/templates/editorTemplates.js.map +1 -1
- package/dist/cjs/templates/elements.js.map +1 -1
- package/dist/cjs/templates/formElements.js.map +1 -1
- package/dist/cjs/templates/listTemplates.js.map +1 -1
- package/dist/cjs/templates/nesting.js.map +1 -1
- package/dist/cjs/templates/sampleData.js.map +1 -1
- package/dist/cjs/templates/screenTemplates.js.map +1 -1
- package/dist/cjs/templates/workspaceTemplates.js.map +1 -1
- package/dist/esm/BorrowedComponentName.js.map +1 -1
- package/dist/esm/ComponentName.js.map +1 -1
- package/dist/esm/CompositeName.js.map +1 -1
- package/dist/esm/componentsBlueprint.js.map +1 -1
- package/dist/esm/componentsBlueprintComponents.js.map +1 -1
- package/dist/esm/gallery/DialogTemplatePreview.js.map +1 -1
- package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
- package/dist/esm/gallery/applicationChrome.js.map +1 -1
- package/dist/esm/gallery/navigation.js.map +1 -1
- package/dist/esm/gallery/previewProfile.js.map +1 -1
- package/dist/esm/gallery/screens.js.map +1 -1
- package/dist/esm/header/ArcPageHeader.js.map +1 -1
- package/dist/esm/header/deriveArcHeading.js.map +1 -1
- package/dist/esm/header/humanizeBindingName.js.map +1 -1
- package/dist/esm/packageName.js.map +1 -1
- package/dist/esm/templates/SampleBindingName.js.map +1 -1
- package/dist/esm/templates/commandTemplates.js.map +1 -1
- package/dist/esm/templates/dataElements.js.map +1 -1
- package/dist/esm/templates/dialogElements.js.map +1 -1
- package/dist/esm/templates/dialogTemplates.js.map +1 -1
- package/dist/esm/templates/editorElements.js.map +1 -1
- package/dist/esm/templates/editorTemplates.js.map +1 -1
- package/dist/esm/templates/elements.js.map +1 -1
- package/dist/esm/templates/formElements.js.map +1 -1
- package/dist/esm/templates/listTemplates.js.map +1 -1
- package/dist/esm/templates/nesting.js.map +1 -1
- package/dist/esm/templates/sampleData.js.map +1 -1
- package/dist/esm/templates/screenTemplates.js.map +1 -1
- package/dist/esm/templates/workspaceTemplates.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BorrowedComponentName.js","sources":["../../BorrowedComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Names this blueprint's templates reference that come from neither `Cratis.Components` nor itself.\n *\n * There is one, and it is worth stating why rather than leaving it as a bare string in a builder.\n *\n * `Cratis.Components`' data table and data page take their columns as children - the library's own\n * documentation says the columns arrive in the `content` slot - but the library declares no `column` name\n * of its own, because its tables are `DataTableForQuery` wrapping PrimeReact's `DataTable`, and a column\n * is PrimeReact's `Column`. So a template that wants a table with real columns has to name PrimeReact's,\n * and this blueprint's manifest declares PrimeReact as a dependency partly for that reason.\n *\n * It is checked the same way every other borrowed name in this repository is: against the owning\n * package's own manifest, by a spec, rather than assumed. The default blueprint learned that the hard way\n * when it referenced `chart` and `fileUpload`, which neither library declares.\n */\nexport enum BorrowedComponentName {\n /** PrimeReact's `Column` - one column of a data table, given a `field` and a `header`. */\n Column = 'column',\n}\n"],"names":["BorrowedComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;IAeO,IAAKA,qBAAAA,iBAAAA,SAAAA,qBAAAA,EAAAA;+FACgF,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAA;AADhFA,IAAAA,OAAAA,qBAAAA;AAGX,CAAA,CAAA,EAAA
|
|
1
|
+
{"version":3,"file":"BorrowedComponentName.js","sources":["../../BorrowedComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Names this blueprint's templates reference that come from neither `Cratis.Components` nor itself.\n *\n * There is one, and it is worth stating why rather than leaving it as a bare string in a builder.\n *\n * `Cratis.Components`' data table and data page take their columns as children - the library's own\n * documentation says the columns arrive in the `content` slot - but the library declares no `column` name\n * of its own, because its tables are `DataTableForQuery` wrapping PrimeReact's `DataTable`, and a column\n * is PrimeReact's `Column`. So a template that wants a table with real columns has to name PrimeReact's,\n * and this blueprint's manifest declares PrimeReact as a dependency partly for that reason.\n *\n * It is checked the same way every other borrowed name in this repository is: against the owning\n * package's own manifest, by a spec, rather than assumed. The default blueprint learned that the hard way\n * when it referenced `chart` and `fileUpload`, which neither library declares.\n */\nexport enum BorrowedComponentName {\n /** PrimeReact's `Column` - one column of a data table, given a `field` and a `header`. */\n Column = 'column',\n}\n"],"names":["BorrowedComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;IAeO,IAAKA,qBAAAA,iBAAAA,SAAAA,qBAAAA,EAAAA;+FACgF,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAA;AADhFA,IAAAA,OAAAA,qBAAAA;AAGX,CAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentName.js","sources":["../../ComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The bare names this package declares components under.\n *\n * There is exactly one, and that is the design rather than an unfinished list. This blueprint's value is\n * in its **templates** - a `dataPage` already wired to a query, a `commandForm` page with its action bar -\n * and a template is data a host can rearrange. A component is code it cannot. So the rule this package\n * holds itself to is: register a component only when a template's content tree genuinely cannot express\n * the composition, and reach for a template every other time. A blueprint whose value sat in its\n * components rather than its templates would have misunderstood its job.\n *\n * {@link ArcPageHeader} is the one thing that clears that bar. Everything else in this package is a tree.\n */\nexport enum ComponentName {\n /**\n * A page header that derives its heading, its subtitle and its breadcrumb trail from **one** binding\n * name, and reports whether that binding is registered.\n *\n * A content tree cannot do this. It can hold a title, a subtitle and a trail as three literals, but\n * it cannot *derive* them from a single `query`/`command` property, and it certainly cannot look that\n * name up in the binding registry to say whether a host has wired it. Both are behavior at render\n * time, not structure - which is exactly the line this package uses to decide what earns a component.\n */\n ArcPageHeader = 'arcPageHeader',\n}\n"],"names":["ComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;IAYO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;AACR;;;;;;;;AAQC,QAAA,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;AATOA,IAAAA,OAAAA,aAAAA;AAWX,CAAA,CAAA,EAAA
|
|
1
|
+
{"version":3,"file":"ComponentName.js","sources":["../../ComponentName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The bare names this package declares components under.\n *\n * There is exactly one, and that is the design rather than an unfinished list. This blueprint's value is\n * in its **templates** - a `dataPage` already wired to a query, a `commandForm` page with its action bar -\n * and a template is data a host can rearrange. A component is code it cannot. So the rule this package\n * holds itself to is: register a component only when a template's content tree genuinely cannot express\n * the composition, and reach for a template every other time. A blueprint whose value sat in its\n * components rather than its templates would have misunderstood its job.\n *\n * {@link ArcPageHeader} is the one thing that clears that bar. Everything else in this package is a tree.\n */\nexport enum ComponentName {\n /**\n * A page header that derives its heading, its subtitle and its breadcrumb trail from **one** binding\n * name, and reports whether that binding is registered.\n *\n * A content tree cannot do this. It can hold a title, a subtitle and a trail as three literals, but\n * it cannot *derive* them from a single `query`/`command` property, and it certainly cannot look that\n * name up in the binding registry to say whether a host has wired it. Both are behavior at render\n * time, not structure - which is exactly the line this package uses to decide what earns a component.\n */\n ArcPageHeader = 'arcPageHeader',\n}\n"],"names":["ComponentName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;IAYO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;AACR;;;;;;;;AAQC,QAAA,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;AATOA,IAAAA,OAAAA,aAAAA;AAWX,CAAA,CAAA,EAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeName.js","sources":["../../CompositeName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The `Cratis.Components` names this blueprint's templates are built from.\n *\n * These are not this package's names - `Cratis.Components` declares every one of them, and this blueprint\n * only writes them into its templates. They are collected here anyway, for two reasons.\n *\n * The first is the ordinary one: a bare name written inline is a magic string, and a typo in it renders as\n * a dashed red box in the middle of a screen with nothing pointing back at the template that caused it.\n *\n * The second is what makes this worth an enum rather than a comment. A spec asserts that every member\n * below appears in `cratisComponentsPackageManifest.components`, so this file is a standing check that\n * this blueprint and the component library it is built from still agree. If a name is ever renamed\n * upstream, that spec fails here rather than a screen failing silently in someone's application.\n *\n * A screen template writes bare names on purpose: `resolveComponentName` decides which active package\n * wins each one against the profile's priority order, so a template that qualified its names would pin\n * itself to one library and stop being a template.\n */\nexport enum CompositeName {\n /** The library's page primitive - a full-height column whose optional panel chrome matches everything inside it. */\n Page = 'page',\n\n /** The whole list-screen composite: title bar, menubar, filterable table and optional details pane, all from one query. */\n DataPage = 'dataPage',\n\n /** A table that performs a query, pages against the server, and wires filtering and sorting back into it. */\n DataTable = 'dataTable',\n\n /** The live variant - an observable query, a WebSocket subscription, and a re-render when the read model changes. */\n ObservableDataTable = 'observableDataTable',\n\n /** A form generated from a command's own property descriptors, so it follows the command rather than going stale. */\n CommandForm = 'commandForm',\n\n /** A single-line text field bound to one command property. */\n InputTextField = 'inputTextField',\n\n /** A numeric field bound to one command property. */\n NumberField = 'numberField',\n\n /** A multi-line text field bound to one command property. */\n TextAreaField = 'textAreaField',\n\n /** A single-selection field over a list the screen carries inline. */\n DropdownField = 'dropdownField',\n\n /** A date field bound to one command property. */\n CalendarField = 'calendarField',\n\n /** The Arc-aware dialog, whose result resolves through Arc's dialog context rather than through `visible` state. */\n Dialog = 'dialog',\n\n /** A dialog whose confirm button *is* the command's execution - it submits, feeds validation back, and only closes on success. */\n CommandDialog = 'commandDialog',\n\n /** The blocking spinner shown while a long-running command is in flight. */\n BusyIndicatorDialog = 'busyIndicatorDialog',\n\n /** An icon, with the shorthand forms people actually write normalized into the class PrimeIcons expects. */\n Icon = 'icon',\n\n /** A standalone selection control, not bound to a command property. */\n Dropdown = 'dropdown',\n\n /** Scopes a failure to a region, so one broken widget does not take the screen with it. */\n ErrorBoundary = 'errorBoundary',\n\n /** Renders an arbitrary JSON document against its schema, with a control per declared type. */\n ObjectContentEditor = 'objectContentEditor',\n\n /** The trail that says where you are inside a nested document, and lets you climb back out. */\n ObjectNavigationalBar = 'objectNavigationalBar',\n\n /** Edits a JSON schema as a typed property tree rather than as text. */\n SchemaEditor = 'schemaEditor',\n\n /** Scrubs through successive versions of something on a timeline. */\n TimeMachine = 'timeMachine',\n\n /** The filter toggle and the panel it anchors, as one placeable element. */\n FilterPanel = 'filterPanel',\n\n /** The container for a tool palette, which also establishes the drag context its buttons read. */\n Toolbar = 'toolbar',\n\n /** One button in a tool palette. */\n ToolbarButton = 'toolbarButton',\n\n /** Related buttons kept together inside a toolbar. */\n ToolbarGroup = 'toolbarGroup',\n\n /** The divider between groups of tools. */\n ToolbarSeparator = 'toolbarSeparator',\n}\n"],"names":["CompositeName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;IAkBO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;yHAC0G,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;gIAGO,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;kHAGd,aAAA,CAAA,WAAA,CAAA,GAAA,WAAA;0HAGQ,aAAA,CAAA,qBAAA,CAAA,GAAA,qBAAA;0HAGA,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;mEAGvD,aAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;0DAGT,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;kEAGQ,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;2EAGS,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;uDAGpB,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;yHAGkE,aAAA,CAAA,QAAA,CAAA,GAAA,QAAA;uIAGc,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;iFAGtD,aAAA,CAAA,qBAAA,CAAA,GAAA,qBAAA;iHAGgC,aAAA,CAAA,MAAA,CAAA,GAAA,MAAA;4EAGrC,aAAA,CAAA,UAAA,CAAA,GAAA,UAAA;gGAGoB,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;oGAGI,aAAA,CAAA,qBAAA,CAAA,GAAA,qBAAA;oGAGA,aAAA,CAAA,uBAAA,CAAA,GAAA,uBAAA;6EAGvB,aAAA,CAAA,cAAA,CAAA,GAAA,cAAA;0EAGH,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;iFAGO,aAAA,CAAA,aAAA,CAAA,GAAA,aAAA;uGAGsB,aAAA,CAAA,SAAA,CAAA,GAAA,SAAA;yCAG9D,aAAA,CAAA,eAAA,CAAA,GAAA,eAAA;2DAGkB,aAAA,CAAA,cAAA,CAAA,GAAA,cAAA;gDAGX,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AAzEjCA,IAAAA,OAAAA,aAAAA;AA2EX,CAAA,CAAA,EAAA
|
|
1
|
+
{"version":3,"file":"CompositeName.js","sources":["../../CompositeName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The `Cratis.Components` names this blueprint's templates are built from.\n *\n * These are not this package's names - `Cratis.Components` declares every one of them, and this blueprint\n * only writes them into its templates. They are collected here anyway, for two reasons.\n *\n * The first is the ordinary one: a bare name written inline is a magic string, and a typo in it renders as\n * a dashed red box in the middle of a screen with nothing pointing back at the template that caused it.\n *\n * The second is what makes this worth an enum rather than a comment. A spec asserts that every member\n * below appears in `cratisComponentsPackageManifest.components`, so this file is a standing check that\n * this blueprint and the component library it is built from still agree. If a name is ever renamed\n * upstream, that spec fails here rather than a screen failing silently in someone's application.\n *\n * A screen template writes bare names on purpose: `resolveComponentName` decides which active package\n * wins each one against the profile's priority order, so a template that qualified its names would pin\n * itself to one library and stop being a template.\n */\nexport enum CompositeName {\n /** The library's page primitive - a full-height column whose optional panel chrome matches everything inside it. */\n Page = 'page',\n\n /** The whole list-screen composite: title bar, menubar, filterable table and optional details pane, all from one query. */\n DataPage = 'dataPage',\n\n /** A table that performs a query, pages against the server, and wires filtering and sorting back into it. */\n DataTable = 'dataTable',\n\n /** The live variant - an observable query, a WebSocket subscription, and a re-render when the read model changes. */\n ObservableDataTable = 'observableDataTable',\n\n /** A form generated from a command's own property descriptors, so it follows the command rather than going stale. */\n CommandForm = 'commandForm',\n\n /** A single-line text field bound to one command property. */\n InputTextField = 'inputTextField',\n\n /** A numeric field bound to one command property. */\n NumberField = 'numberField',\n\n /** A multi-line text field bound to one command property. */\n TextAreaField = 'textAreaField',\n\n /** A single-selection field over a list the screen carries inline. */\n DropdownField = 'dropdownField',\n\n /** A date field bound to one command property. */\n CalendarField = 'calendarField',\n\n /** The Arc-aware dialog, whose result resolves through Arc's dialog context rather than through `visible` state. */\n Dialog = 'dialog',\n\n /** A dialog whose confirm button *is* the command's execution - it submits, feeds validation back, and only closes on success. */\n CommandDialog = 'commandDialog',\n\n /** The blocking spinner shown while a long-running command is in flight. */\n BusyIndicatorDialog = 'busyIndicatorDialog',\n\n /** An icon, with the shorthand forms people actually write normalized into the class PrimeIcons expects. */\n Icon = 'icon',\n\n /** A standalone selection control, not bound to a command property. */\n Dropdown = 'dropdown',\n\n /** Scopes a failure to a region, so one broken widget does not take the screen with it. */\n ErrorBoundary = 'errorBoundary',\n\n /** Renders an arbitrary JSON document against its schema, with a control per declared type. */\n ObjectContentEditor = 'objectContentEditor',\n\n /** The trail that says where you are inside a nested document, and lets you climb back out. */\n ObjectNavigationalBar = 'objectNavigationalBar',\n\n /** Edits a JSON schema as a typed property tree rather than as text. */\n SchemaEditor = 'schemaEditor',\n\n /** Scrubs through successive versions of something on a timeline. */\n TimeMachine = 'timeMachine',\n\n /** The filter toggle and the panel it anchors, as one placeable element. */\n FilterPanel = 'filterPanel',\n\n /** The container for a tool palette, which also establishes the drag context its buttons read. */\n Toolbar = 'toolbar',\n\n /** One button in a tool palette. */\n ToolbarButton = 'toolbarButton',\n\n /** Related buttons kept together inside a toolbar. */\n ToolbarGroup = 'toolbarGroup',\n\n /** The divider between groups of tools. */\n ToolbarSeparator = 'toolbarSeparator',\n}\n"],"names":["CompositeName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;IAkBO,IAAKA,aAAAA,iBAAAA,SAAAA,aAAAA,EAAAA;yHAC0G,aAAA,CAAA,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ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { componentsBlueprintComponents } from './componentsBlueprintComponents';\nimport { componentsGalleryScreens } from './gallery';\nimport { componentsBlueprintName } from './packageName';\nimport { componentsDialogTemplates, componentsScreenTemplates } from './templates';\n\n/**\n * This blueprint's declaration.\n *\n * Where the default blueprint answers \"what does an application look like\", this one answers \"what does a\n * *page* look like once it is bound to Arc\". Its templates are whole pages already wired to the composites\n * in `Cratis.Components`: a data list page is a `dataPage` with its query, columns, empty message, data key\n * and filter fields all decided, under a header that says what it is bound to. An application picks the\n * template and supplies a query name.\n *\n * `layouts` is empty, and that is the most important line in this file.\n *\n * A layout is an application's base navigational shell, and an application has exactly one. This package\n * deliberately ships none: it depends on `Cratis.Blueprint.Default` and reuses that blueprint's `AppShell`,\n * its slot vocabulary, its shell components and its themes. That is what the dependency on another\n * blueprint *means* - and this is the first blueprint-on-blueprint dependency in Scene, so it is worth\n * stating plainly rather than leaving to be inferred from an empty array.\n *\n * The alternative would have been to ship a second application shell. It would have looked like value and\n * been the opposite: an application can activate only one shell, so the two blueprints would have become\n * mutually exclusive, and picking Arc-bound pages would have meant giving up the eight layout modes, the\n * themes and the navigation that the default blueprint already does well. Layering means both can be\n * active at once, which is the only arrangement in which either is worth having.\n *\n * `themes` is empty for the same reason at a smaller scale: the shell being themed is the default\n * blueprint's, so its themes are the right ones, and a theme shipped here would be this package asserting\n * a look for a shell it does not own.\n */\nexport const componentsBlueprintManifest: ScenePackage = {\n name: componentsBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: [],\n screenTemplates: componentsScreenTemplates.map(template => template.name),\n dialogTemplates: componentsDialogTemplates.map(template => template.name),\n themes: [],\n displayName: 'Cratis Components Blueprint',\n description: 'Arc-bound screen and dialog templates: whole pages built from the Cratis Components composites, for the default blueprint shell.',\n module: '@cratis/scene.blueprint.components',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * This blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a template the bundle never provided is a failure that\n * only shows up when someone picks that template and gets nothing.\n *\n * The screens are the gallery: real `Screen` instances naming the default blueprint's `AppShell`, its\n * chrome and one of these templates, so a preview boots them through the real engine as a working\n * miniature application rather than a set of pictures. They render with unregistered bindings, which is the\n * normal design-time state - the placeholders naming each wanted binding are exactly what should be there.\n */\nexport const componentsBlueprint: ScenePackageBundle = {\n manifest: componentsBlueprintManifest,\n components: componentsBlueprintComponents,\n screenTemplates: componentsScreenTemplates,\n dialogTemplates: componentsDialogTemplates,\n screens: componentsGalleryScreens,\n};\n"],"names":["componentsBlueprintManifest","name","componentsBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","screenTemplates","componentsScreenTemplates","map","template","dialogTemplates","componentsDialogTemplates","themes","displayName","description","module","license","licenseUrl","componentsBlueprint","manifest","componentsBlueprintComponents","screens","componentsGalleryScreens"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BaA,2BAAAA,GAA4C;IACrDC,IAAAA,EAAMC,mCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAA2B,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACnFO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,2BAAAA,CAAAA;AAC1BC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiBC,0CAA0BC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASf,IAAI,CAAA;AACxEgB,IAAAA,eAAAA,EAAiBC,0CAA0BH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASf,IAAI,CAAA;AACxEkB,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,6BAAA;IACbC,WAAAA,EAAa,kIAAA;IACbC,MAAAA,EAAQ,oCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;;UAYaC,mBAAAA,GAA0C;IACnDC,QAAAA,EAAU1B,2BAAAA;IACVQ,UAAAA,EAAYmB,2DAAAA;IACZd,eAAAA,EAAiBC,yCAAAA;IACjBG,eAAAA,EAAiBC,yCAAAA;IACjBU,OAAAA,EAASC;AACb
|
|
1
|
+
{"version":3,"file":"componentsBlueprint.js","sources":["../../componentsBlueprint.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { PackageKind, ScenePackage } from '@cratis/scene.model';\nimport { ScenePackageBundle } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { componentsBlueprintComponents } from './componentsBlueprintComponents';\nimport { componentsGalleryScreens } from './gallery';\nimport { componentsBlueprintName } from './packageName';\nimport { componentsDialogTemplates, componentsScreenTemplates } from './templates';\n\n/**\n * This blueprint's declaration.\n *\n * Where the default blueprint answers \"what does an application look like\", this one answers \"what does a\n * *page* look like once it is bound to Arc\". Its templates are whole pages already wired to the composites\n * in `Cratis.Components`: a data list page is a `dataPage` with its query, columns, empty message, data key\n * and filter fields all decided, under a header that says what it is bound to. An application picks the\n * template and supplies a query name.\n *\n * `layouts` is empty, and that is the most important line in this file.\n *\n * A layout is an application's base navigational shell, and an application has exactly one. This package\n * deliberately ships none: it depends on `Cratis.Blueprint.Default` and reuses that blueprint's `AppShell`,\n * its slot vocabulary, its shell components and its themes. That is what the dependency on another\n * blueprint *means* - and this is the first blueprint-on-blueprint dependency in Scene, so it is worth\n * stating plainly rather than leaving to be inferred from an empty array.\n *\n * The alternative would have been to ship a second application shell. It would have looked like value and\n * been the opposite: an application can activate only one shell, so the two blueprints would have become\n * mutually exclusive, and picking Arc-bound pages would have meant giving up the eight layout modes, the\n * themes and the navigation that the default blueprint already does well. Layering means both can be\n * active at once, which is the only arrangement in which either is worth having.\n *\n * `themes` is empty for the same reason at a smaller scale: the shell being themed is the default\n * blueprint's, so its themes are the right ones, and a theme shipped here would be this package asserting\n * a look for a shell it does not own.\n */\nexport const componentsBlueprintManifest: ScenePackage = {\n name: componentsBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default' }, { name: 'Cratis.Components' }],\n components: Object.values(ComponentName),\n layouts: [],\n screenTemplates: componentsScreenTemplates.map(template => template.name),\n dialogTemplates: componentsDialogTemplates.map(template => template.name),\n themes: [],\n displayName: 'Cratis Components Blueprint',\n description: 'Arc-bound screen and dialog templates: whole pages built from the Cratis Components composites, for the default blueprint shell.',\n module: '@cratis/scene.blueprint.components',\n license: 'MIT',\n licenseUrl: 'https://github.com/Cratis/Scene/blob/main/LICENSE',\n};\n\n/**\n * This blueprint as a loadable bundle.\n *\n * The manifest names things; this provides them. `validatePackageBundle` is what proves the two agree, and\n * this package's specs run it - a manifest promising a template the bundle never provided is a failure that\n * only shows up when someone picks that template and gets nothing.\n *\n * The screens are the gallery: real `Screen` instances naming the default blueprint's `AppShell`, its\n * chrome and one of these templates, so a preview boots them through the real engine as a working\n * miniature application rather than a set of pictures. They render with unregistered bindings, which is the\n * normal design-time state - the placeholders naming each wanted binding are exactly what should be there.\n */\nexport const componentsBlueprint: ScenePackageBundle = {\n manifest: componentsBlueprintManifest,\n components: componentsBlueprintComponents,\n screenTemplates: componentsScreenTemplates,\n dialogTemplates: componentsDialogTemplates,\n screens: componentsGalleryScreens,\n};\n"],"names":["componentsBlueprintManifest","name","componentsBlueprintName","version","kind","PackageKind","Blueprint","dependencies","components","Object","values","ComponentName","layouts","screenTemplates","componentsScreenTemplates","map","template","dialogTemplates","componentsDialogTemplates","themes","displayName","description","module","license","licenseUrl","componentsBlueprint","manifest","componentsBlueprintComponents","screens","componentsGalleryScreens"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;UA2BaA,2BAAAA,GAA4C;IACrDC,IAAAA,EAAMC,mCAAAA;IACNC,OAAAA,EAAS,OAAA;AACTC,IAAAA,IAAAA,EAAMC,wBAAYC,SAAS;IAC3BC,YAAAA,EAAc;AAAC,QAAA;YAAEN,IAAAA,EAAM;AAA2B,SAAA;AAAG,QAAA;YAAEA,IAAAA,EAAM;AAAoB;AAAE,KAAA;IACnFO,UAAAA,EAAYC,MAAAA,CAAOC,MAAM,CAACC,2BAAAA,CAAAA;AAC1BC,IAAAA,OAAAA,EAAS,EAAE;AACXC,IAAAA,eAAAA,EAAiBC,0CAA0BC,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASf,IAAI,CAAA;AACxEgB,IAAAA,eAAAA,EAAiBC,0CAA0BH,GAAG,CAACC,CAAAA,QAAAA,GAAYA,SAASf,IAAI,CAAA;AACxEkB,IAAAA,MAAAA,EAAQ,EAAE;IACVC,WAAAA,EAAa,6BAAA;IACbC,WAAAA,EAAa,kIAAA;IACbC,MAAAA,EAAQ,oCAAA;IACRC,OAAAA,EAAS,KAAA;IACTC,UAAAA,EAAY;AAChB;AAEA;;;;;;;;;;;UAYaC,mBAAAA,GAA0C;IACnDC,QAAAA,EAAU1B,2BAAAA;IACVQ,UAAAA,EAAYmB,2DAAAA;IACZd,eAAAA,EAAiBC,yCAAAA;IACjBG,eAAAA,EAAiBC,yCAAAA;IACjBU,OAAAA,EAASC;AACb;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentsBlueprintComponents.js","sources":["../../componentsBlueprintComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { componentsBlueprintName } from './packageName';\nimport { ArcPageHeader } from './header';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n *\n * One entry, and a short registry is the healthy outcome here rather than a gap. What this blueprint\n * contributes is templates; a component only appears when a template genuinely could not express the\n * composition, and `validatePackageBundle` proves that whatever *is* here is also declared in the manifest.\n */\nexport const componentsBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(componentsBlueprintName, ComponentName.ArcPageHeader)]: ArcPageHeader,\n};\n"],"names":["componentsBlueprintComponents","componentRegistryKey","componentsBlueprintName","ComponentName","ArcPageHeader"],"mappings":";;;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;UAYaA,6BAAAA,GAAmD;AAC5D,IAAA,CAACC,gCAAAA,CAAqBC,mCAAAA,EAAyBC,2BAAAA,CAAcC,aAAa,IAAIA;AAClF
|
|
1
|
+
{"version":3,"file":"componentsBlueprintComponents.js","sources":["../../componentsBlueprintComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentRegistry, componentRegistryKey } from '@cratis/scene.react';\nimport { ComponentName } from './ComponentName';\nimport { componentsBlueprintName } from './packageName';\nimport { ArcPageHeader } from './header';\n\n/**\n * The components this package registers, keyed the way the renderer looks them up.\n *\n * Every key is built with `componentRegistryKey` rather than written out, because the separator between\n * package and component name is the registry's own business - it is deliberately not the `.` a screen uses\n * to qualify a name, so that a package name containing dots stays unambiguous. Building a key by hand is\n * how a component ends up registered under something no lookup will ever produce.\n *\n * One entry, and a short registry is the healthy outcome here rather than a gap. What this blueprint\n * contributes is templates; a component only appears when a template genuinely could not express the\n * composition, and `validatePackageBundle` proves that whatever *is* here is also declared in the manifest.\n */\nexport const componentsBlueprintComponents: ComponentRegistry = {\n [componentRegistryKey(componentsBlueprintName, ComponentName.ArcPageHeader)]: ArcPageHeader,\n};\n"],"names":["componentsBlueprintComponents","componentRegistryKey","componentsBlueprintName","ComponentName","ArcPageHeader"],"mappings":";;;;;;;;AAAA;AACA;AAOA;;;;;;;;;;;UAYaA,6BAAAA,GAAmD;AAC5D,IAAA,CAACC,gCAAAA,CAAqBC,mCAAAA,EAAyBC,2BAAAA,CAAcC,aAAa,IAAIA;AAClF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTemplatePreview.js","sources":["../../../gallery/DialogTemplatePreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView } from '@cratis/scene.react';\nimport { resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsDialogTemplates } from '../templates';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsPreviewRegistry } from './GalleryScreenPreview';\n\nexport interface DialogTemplatePreviewProps {\n /** The name of the dialog template to boot. */\n templateName: string;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one dialog template through the real engine.\n *\n * A dialog has no layout and no shell, because it occupies no slot - it opens *over* whatever is already\n * on screen. So there is nothing to compose it into: the template's own content is the whole tree, and it\n * goes straight through `resolveComponentName` and `SceneElementView` exactly as a screen's does.\n *\n * Each of these templates declares one slot, so flattening the content is the whole of \"assembling\" it.\n * That is a consequence of the composites owning their own frames rather than a simplification here.\n */\nexport function DialogTemplatePreview({ templateName, registry = componentsPreviewRegistry }: DialogTemplatePreviewProps) {\n const elements = useMemo(() => {\n const template = componentsDialogTemplates.find(candidate => candidate.name === templateName);\n if (!template) {\n throw new Error(`This blueprint has no dialog template named '${templateName}'.`);\n }\n\n return Object.values(template.content ?? {})\n .flat()\n .map((element: SceneElement) => resolveElementComponentNames(element, componentsBlueprintProfile, componentsBlueprintCatalog));\n }, [templateName]);\n\n return (\n <>\n {elements.map(element => (\n <SceneElementView key={element.id} element={element} registry={registry} resolveBinding={() => undefined} />\n ))}\n </>\n );\n}\n"],"names":["DialogTemplatePreview","templateName","registry","componentsPreviewRegistry","elements","useMemo","template","componentsDialogTemplates","find","candidate","name","Error","Object","values","content","flat","map","element","resolveElementComponentNames","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","_Fragment","SceneElementView","resolveBinding","undefined","id"],"mappings":";;;;;;;;;;;;;;;;AAmBA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsB,EAAEC,YAAY,EAAEC,QAAAA,GAAWC,8CAAyB,EAA8B,EAAA;AACpH,IAAA,MAAMC,WAAWC,aAAAA,CAAQ,IAAA;QACrB,MAAMC,QAAAA,GAAWC,0CAA0BC,IAAI,CAACC,CAAAA,SAAAA,GAAaA,SAAAA,CAAUC,IAAI,KAAKT,YAAAA,CAAAA;AAChF,QAAA,IAAI,CAACK,QAAAA,EAAU;AACX,YAAA,MAAM,IAAIK,KAAAA,CAAM,CAAC,6CAA6C,EAAEV,YAAAA,CAAa,EAAE,CAAC,CAAA;AACpF,QAAA;AAEA,QAAA,OAAOW,OAAOC,MAAM,CAACP,QAAAA,CAASQ,OAAO,IAAI,EAAC,CAAA,CACrCC,IAAI,EAAA,CACJC,GAAG,CAAC,CAACC,OAAAA,GAA0BC,oDAAAA,CAA6BD,SAASE,yCAAAA,EAA4BC,yCAAAA,CAAAA,CAAAA;IAC1G,CAAA,EAAG;AAACnB,QAAAA;AAAa,KAAA,CAAA;IAEjB,qBACIoB,cAAA,CAAAC,mBAAA,EAAA;AACKlB,QAAAA,QAAAA,EAAAA,QAAAA,CAASY,GAAG,CAACC,CAAAA,OAAAA,iBACVI,cAAA,CAACE,4BAAAA,EAAAA;gBAAkCN,OAAAA,EAASA,OAAAA;gBAASf,QAAAA,EAAUA,QAAAA;AAAUsB,gBAAAA,cAAAA,EAAgB,IAAMC;AAAxER,aAAAA,EAAAA,OAAAA,CAAQS,EAAE,CAAA;;AAIjD
|
|
1
|
+
{"version":3,"file":"DialogTemplatePreview.js","sources":["../../../gallery/DialogTemplatePreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentRegistry, SceneElementView } from '@cratis/scene.react';\nimport { resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsDialogTemplates } from '../templates';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsPreviewRegistry } from './GalleryScreenPreview';\n\nexport interface DialogTemplatePreviewProps {\n /** The name of the dialog template to boot. */\n templateName: string;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one dialog template through the real engine.\n *\n * A dialog has no layout and no shell, because it occupies no slot - it opens *over* whatever is already\n * on screen. So there is nothing to compose it into: the template's own content is the whole tree, and it\n * goes straight through `resolveComponentName` and `SceneElementView` exactly as a screen's does.\n *\n * Each of these templates declares one slot, so flattening the content is the whole of \"assembling\" it.\n * That is a consequence of the composites owning their own frames rather than a simplification here.\n */\nexport function DialogTemplatePreview({ templateName, registry = componentsPreviewRegistry }: DialogTemplatePreviewProps) {\n const elements = useMemo(() => {\n const template = componentsDialogTemplates.find(candidate => candidate.name === templateName);\n if (!template) {\n throw new Error(`This blueprint has no dialog template named '${templateName}'.`);\n }\n\n return Object.values(template.content ?? {})\n .flat()\n .map((element: SceneElement) => resolveElementComponentNames(element, componentsBlueprintProfile, componentsBlueprintCatalog));\n }, [templateName]);\n\n return (\n <>\n {elements.map(element => (\n <SceneElementView key={element.id} element={element} registry={registry} resolveBinding={() => undefined} />\n ))}\n </>\n );\n}\n"],"names":["DialogTemplatePreview","templateName","registry","componentsPreviewRegistry","elements","useMemo","template","componentsDialogTemplates","find","candidate","name","Error","Object","values","content","flat","map","element","resolveElementComponentNames","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","_Fragment","SceneElementView","resolveBinding","undefined","id"],"mappings":";;;;;;;;;;;;;;;;AAmBA;;;;;;;;;IAUO,SAASA,qBAAAA,CAAsB,EAAEC,YAAY,EAAEC,QAAAA,GAAWC,8CAAyB,EAA8B,EAAA;AACpH,IAAA,MAAMC,WAAWC,aAAAA,CAAQ,IAAA;QACrB,MAAMC,QAAAA,GAAWC,0CAA0BC,IAAI,CAACC,CAAAA,SAAAA,GAAaA,SAAAA,CAAUC,IAAI,KAAKT,YAAAA,CAAAA;AAChF,QAAA,IAAI,CAACK,QAAAA,EAAU;AACX,YAAA,MAAM,IAAIK,KAAAA,CAAM,CAAC,6CAA6C,EAAEV,YAAAA,CAAa,EAAE,CAAC,CAAA;AACpF,QAAA;AAEA,QAAA,OAAOW,OAAOC,MAAM,CAACP,QAAAA,CAASQ,OAAO,IAAI,EAAC,CAAA,CACrCC,IAAI,EAAA,CACJC,GAAG,CAAC,CAACC,OAAAA,GAA0BC,oDAAAA,CAA6BD,SAASE,yCAAAA,EAA4BC,yCAAAA,CAAAA,CAAAA;IAC1G,CAAA,EAAG;AAACnB,QAAAA;AAAa,KAAA,CAAA;IAEjB,qBACIoB,cAAA,CAAAC,mBAAA,EAAA;AACKlB,QAAAA,QAAAA,EAAAA,QAAAA,CAASY,GAAG,CAACC,CAAAA,OAAAA,iBACVI,cAAA,CAACE,4BAAAA,EAAAA;gBAAkCN,OAAAA,EAASA,OAAAA;gBAASf,QAAAA,EAAUA,QAAAA;AAAUsB,gBAAAA,cAAAA,EAAgB,IAAMC;AAAxER,aAAAA,EAAAA,OAAAA,CAAQS,EAAE,CAAA;;AAIjD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { cratisComponents } from '@cratis/scene.components';\nimport { LayoutConfigProvider, LayoutConfigState, LayoutThemeProvider, composeScreenElement, defaultBlueprintComponents, defaultBlueprintThemes, resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsBlueprintComponents } from '../componentsBlueprintComponents';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsGalleryScreen } from './screens';\n\n/**\n * The registry a preview resolves against: `core`, `Cratis.Components`, the default blueprint, and this one.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's own\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n *\n * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a\n * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a\n * placeholder until a host registers its query.\n */\nexport const componentsPreviewRegistry: ComponentRegistry = {\n ...coreComponents,\n ...cratisComponents,\n ...defaultBlueprintComponents,\n ...componentsBlueprintComponents,\n};\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a layout mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real `Screen`, its element tree is resolved by the\n * real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real registry.\n * That is the point of shipping a gallery at all - a mockup proves someone can draw an invoice list, and\n * this proves the blueprint renders one.\n *\n * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being\n * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and\n * previewing them without the thing they were designed to sit in would prove the wrong thing.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, registry = componentsPreviewRegistry }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = componentsGalleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), componentsBlueprintProfile, componentsBlueprintCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={defaultBlueprintThemes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["componentsPreviewRegistry","coreComponents","cratisComponents","defaultBlueprintComponents","componentsBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","registry","element","useMemo","screen","componentsGalleryScreen","Error","resolveElementComponentNames","composeScreenElement","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","themes","defaultBlueprintThemes","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;AAWA;;;;;;;;;;UAWaA,yBAAAA,GAA+C;AACxD,IAAA,GAAGC,0BAAc;AACjB,IAAA,GAAGC,iCAAgB;AACnB,IAAA,GAAGC,kDAA0B;AAC7B,IAAA,GAAGC;AACP;AAaA;;;;;;;;;;;IAYO,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,QAAAA,GAAWR,yBAAyB,EAA6B,EAAA;AAC/H,IAAA,MAAMS,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,+BAAAA,CAAwBN,UAAAA,CAAAA;AACvC,QAAA,IAAI,CAACK,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAEP,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;QAEA,OAAOQ,oDAAAA,CAA6BC,4CAAAA,CAAqBJ,MAAAA,CAAAA,EAASK,yCAAAA,EAA4BC,yCAAAA,CAAAA;IAClG,CAAA,EAAG;AAACX,QAAAA;AAAW,KAAA,CAAA;AAEf,IAAA,qBACIY,cAAA,CAACC,4CAAAA,EAAAA;QAAqBZ,aAAAA,EAAeA,aAAAA;QAAea,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,2CAAAA,EAAAA;YAAoBC,MAAAA,EAAQC,8CAAAA;AACzB,YAAA,QAAA,gBAAAL,cAAA,CAACM,4BAAAA,EAAAA;gBAAiBf,OAAAA,EAASA,OAAAA;gBAASD,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F
|
|
1
|
+
{"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { cratisComponents } from '@cratis/scene.components';\nimport { LayoutConfigProvider, LayoutConfigState, LayoutThemeProvider, composeScreenElement, defaultBlueprintComponents, defaultBlueprintThemes, resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsBlueprintComponents } from '../componentsBlueprintComponents';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsGalleryScreen } from './screens';\n\n/**\n * The registry a preview resolves against: `core`, `Cratis.Components`, the default blueprint, and this one.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's own\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n *\n * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a\n * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a\n * placeholder until a host registers its query.\n */\nexport const componentsPreviewRegistry: ComponentRegistry = {\n ...coreComponents,\n ...cratisComponents,\n ...defaultBlueprintComponents,\n ...componentsBlueprintComponents,\n};\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a layout mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real `Screen`, its element tree is resolved by the\n * real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real registry.\n * That is the point of shipping a gallery at all - a mockup proves someone can draw an invoice list, and\n * this proves the blueprint renders one.\n *\n * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being\n * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and\n * previewing them without the thing they were designed to sit in would prove the wrong thing.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, registry = componentsPreviewRegistry }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = componentsGalleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), componentsBlueprintProfile, componentsBlueprintCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={defaultBlueprintThemes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["componentsPreviewRegistry","coreComponents","cratisComponents","defaultBlueprintComponents","componentsBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","registry","element","useMemo","screen","componentsGalleryScreen","Error","resolveElementComponentNames","composeScreenElement","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","themes","defaultBlueprintThemes","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;AAWA;;;;;;;;;;UAWaA,yBAAAA,GAA+C;AACxD,IAAA,GAAGC,0BAAc;AACjB,IAAA,GAAGC,iCAAgB;AACnB,IAAA,GAAGC,kDAA0B;AAC7B,IAAA,GAAGC;AACP;AAaA;;;;;;;;;;;IAYO,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,QAAAA,GAAWR,yBAAyB,EAA6B,EAAA;AAC/H,IAAA,MAAMS,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,+BAAAA,CAAwBN,UAAAA,CAAAA;AACvC,QAAA,IAAI,CAACK,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAEP,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;QAEA,OAAOQ,oDAAAA,CAA6BC,4CAAAA,CAAqBJ,MAAAA,CAAAA,EAASK,yCAAAA,EAA4BC,yCAAAA,CAAAA;IAClG,CAAA,EAAG;AAACX,QAAAA;AAAW,KAAA,CAAA;AAEf,IAAA,qBACIY,cAAA,CAACC,4CAAAA,EAAAA;QAAqBZ,aAAAA,EAAeA,aAAAA;QAAea,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,2CAAAA,EAAAA;YAAoBC,MAAAA,EAAQC,8CAAAA;AACzB,YAAA,QAAA,gBAAAL,cAAA,CAACM,4BAAAA,EAAAA;gBAAiBf,OAAAA,EAASA,OAAAA;gBAASD,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentName as DefaultComponentName, SlotName, defaultBlueprintThemes, externalComponent } from '@cratis/scene.blueprint.default';\nimport { componentsNavigationGroups, entriesInGroup, groupOfScreen, labelOfScreen } from './navigation';\n\n/**\n * The application-shell chrome every gallery screen in this package shares.\n *\n * Every element here names a component the **default blueprint** declares - `topbar`, `sidebar`, `menu`,\n * `breadcrumb`, `footer`, `configPanel`, `logo`, `userMenu` - and every slot is one of that blueprint's\n * `SlotName`s. That is this package's dependency on it made concrete rather than merely declared: this\n * blueprint contributes Arc-bound *pages*, and borrows the shell those pages live in.\n *\n * A blueprint that shipped its own topbar and its own sidebar would be a rival to the default one rather\n * than a layer on it, and an application would have to choose. Since a profile activates one blueprint's\n * layouts and both blueprints' templates, layering is what makes the two usable together at all.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, DefaultComponentName.Logo, { label: 'Contoso Billing', initials: 'CB', targetScreen: 'DashboardPage' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return componentsNavigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n DefaultComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationItem(entry.targetScreen, entry.label, entry.icon, entry.order, group, activeScreen)) },\n ),\n );\n}\n\nfunction navigationItem(targetScreen: string, label: string, icon: string, order: number, group: string, activeScreen: string): SceneElement {\n return externalComponent(`nav-${targetScreen}`, DefaultComponentName.MenuItem, {\n label,\n targetScreen,\n routeParameterBindings: {},\n order,\n group,\n icon,\n isActive: targetScreen === activeScreen,\n });\n}\n\n/** The configurator, offering the themes the default blueprint ships - this package ships none of its own. */\nfunction configPanel(): SceneElement {\n return externalComponent(DefaultComponentName.ConfigPanel, DefaultComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/**\n * The trail above a screen's content, derived from the navigation rather than declared a second time.\n *\n * A hand-written table of breadcrumbs per screen is a second statement of where each screen sits, and the\n * two drift the first time a screen is renamed. The navigation already knows the group and the label, so\n * the trail follows from it.\n */\nfunction breadcrumbEntries(activeScreen: string): { label: string; targetScreen?: string }[] {\n const group = groupOfScreen(activeScreen);\n const label = labelOfScreen(activeScreen) ?? activeScreen;\n return group === undefined ? [{ label }] : [{ label: group, targetScreen: 'DashboardPage' }, { label }];\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is what chrome is for.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current and its trail is built.\n * @returns Slot content keyed by the {@link SlotName}s the default blueprint's `AppShell` layout declares.\n */\nexport function componentsApplicationChrome(activeScreen: string): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n DefaultComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n externalComponent('topbar-user', DefaultComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Billing owner',\n initials: 'AN',\n items: [{ label: 'Invoice document', icon: 'pi pi-file-edit', targetScreen: 'ObjectEditorPage' }],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', DefaultComponentName.Sidebar, { title: 'Contoso Billing' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', DefaultComponentName.Breadcrumb, { homeTargetScreen: 'DashboardPage', items: breadcrumbEntries(activeScreen) }),\n ],\n [SlotName.Footer]: [externalComponent('footer', DefaultComponentName.Footer, { text: '© Contoso · Arc-bound pages from Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n"],"names":["logo","id","externalComponent","DefaultComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","componentsNavigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationItem","icon","order","MenuItem","routeParameterBindings","isActive","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","breadcrumbEntries","groupOfScreen","labelOfScreen","undefined","componentsApplicationChrome","SlotName","Topbar","end","UserMenu","role","Sidebar","Breadcrumb","homeTargetScreen","Footer","text"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,wEAGD,SAASA,IAAAA,CAAKC,EAAU,EAAA;AACpB,IAAA,OAAOC,yCAAAA,CAAkBD,EAAAA,EAAIE,qCAAAA,CAAqBC,IAAI,EAAE;QAAEC,KAAAA,EAAO,iBAAA;QAAmBC,QAAAA,EAAU,IAAA;QAAMC,YAAAA,EAAc;AAAgB,KAAA,CAAA;AACtI;AAEA,iFACA,SAASC,YAAAA,CAAaC,YAAoB,EAAA;AACtC,IAAA,OAAOC,qCAAAA,CAA2BC,GAAG,CAACC,CAAAA,QAClCV,yCAAAA,CACI,CAAC,KAAK,EAAEU,MAAMC,WAAW,EAAA,CAAA,CAAI,EAC7BV,qCAAAA,CAAqBW,IAAI,EACzB;YAAEC,KAAAA,EAAOH,KAAAA;YAAOP,KAAAA,EAAOO;SAAM,EAC7B;AAAEI,YAAAA,KAAAA,EAAOC,0BAAeL,KAAAA,CAAAA,CAAOD,GAAG,CAACO,CAAAA,KAAAA,GAASC,eAAeD,KAAAA,CAAMX,YAAY,EAAEW,KAAAA,CAAMb,KAAK,EAAEa,KAAAA,CAAME,IAAI,EAAEF,KAAAA,CAAMG,KAAK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AAA,EAAUC,qCAAAA,CAAqB0C,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAgD,aAAA;AAAG,SAAA;QACxI,CAACT,gCAAAA,CAASX,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ
|
|
1
|
+
{"version":3,"file":"applicationChrome.js","sources":["../../../gallery/applicationChrome.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { ComponentName as DefaultComponentName, SlotName, defaultBlueprintThemes, externalComponent } from '@cratis/scene.blueprint.default';\nimport { componentsNavigationGroups, entriesInGroup, groupOfScreen, labelOfScreen } from './navigation';\n\n/**\n * The application-shell chrome every gallery screen in this package shares.\n *\n * Every element here names a component the **default blueprint** declares - `topbar`, `sidebar`, `menu`,\n * `breadcrumb`, `footer`, `configPanel`, `logo`, `userMenu` - and every slot is one of that blueprint's\n * `SlotName`s. That is this package's dependency on it made concrete rather than merely declared: this\n * blueprint contributes Arc-bound *pages*, and borrows the shell those pages live in.\n *\n * A blueprint that shipped its own topbar and its own sidebar would be a rival to the default one rather\n * than a layer on it, and an application would have to choose. Since a profile activates one blueprint's\n * layouts and both blueprints' templates, layering is what makes the two usable together at all.\n */\n\n/** The brand mark, shared by the topbar and the sidebar header. */\nfunction logo(id: string): SceneElement {\n return externalComponent(id, DefaultComponentName.Logo, { label: 'Contoso Billing', initials: 'CB', targetScreen: 'DashboardPage' });\n}\n\n/** One menu section per navigation group, each holding that group's entries. */\nfunction menuSections(activeScreen: string): SceneElement[] {\n return componentsNavigationGroups.map(group =>\n externalComponent(\n `menu-${group.toLowerCase()}`,\n DefaultComponentName.Menu,\n { title: group, label: group },\n { items: entriesInGroup(group).map(entry => navigationItem(entry.targetScreen, entry.label, entry.icon, entry.order, group, activeScreen)) },\n ),\n );\n}\n\nfunction navigationItem(targetScreen: string, label: string, icon: string, order: number, group: string, activeScreen: string): SceneElement {\n return externalComponent(`nav-${targetScreen}`, DefaultComponentName.MenuItem, {\n label,\n targetScreen,\n routeParameterBindings: {},\n order,\n group,\n icon,\n isActive: targetScreen === activeScreen,\n });\n}\n\n/** The configurator, offering the themes the default blueprint ships - this package ships none of its own. */\nfunction configPanel(): SceneElement {\n return externalComponent(DefaultComponentName.ConfigPanel, DefaultComponentName.ConfigPanel, {\n title: 'Settings',\n themes: defaultBlueprintThemes.map(theme => ({ name: theme.name, label: theme.name, isDark: theme.isDark ?? false })),\n });\n}\n\n/**\n * The trail above a screen's content, derived from the navigation rather than declared a second time.\n *\n * A hand-written table of breadcrumbs per screen is a second statement of where each screen sits, and the\n * two drift the first time a screen is renamed. The navigation already knows the group and the label, so\n * the trail follows from it.\n */\nfunction breadcrumbEntries(activeScreen: string): { label: string; targetScreen?: string }[] {\n const group = groupOfScreen(activeScreen);\n const label = labelOfScreen(activeScreen) ?? activeScreen;\n return group === undefined ? [{ label }] : [{ label: group, targetScreen: 'DashboardPage' }, { label }];\n}\n\n/**\n * The application shell's slot content for one screen.\n *\n * Only the breadcrumb and which menu entry is marked active differ from screen to screen - everything else\n * is identical, which is what chrome is for.\n *\n * @param activeScreen The screen being rendered, so its menu entry is marked current and its trail is built.\n * @returns Slot content keyed by the {@link SlotName}s the default blueprint's `AppShell` layout declares.\n */\nexport function componentsApplicationChrome(activeScreen: string): Record<string, SceneElement[]> {\n return {\n [SlotName.Topbar]: [\n externalComponent(\n 'topbar',\n DefaultComponentName.Topbar,\n {},\n {\n logo: [logo('topbar-logo')],\n end: [\n externalComponent('topbar-user', DefaultComponentName.UserMenu, {\n name: 'Amelia Nyquist',\n role: 'Billing owner',\n initials: 'AN',\n items: [{ label: 'Invoice document', icon: 'pi pi-file-edit', targetScreen: 'ObjectEditorPage' }],\n }),\n ],\n },\n ),\n ],\n [SlotName.Sidebar]: [externalComponent('sidebar', DefaultComponentName.Sidebar, { title: 'Contoso Billing' }, { logo: [logo('sidebar-logo')] })],\n [SlotName.Menu]: menuSections(activeScreen),\n [SlotName.Breadcrumb]: [\n externalComponent('breadcrumb', DefaultComponentName.Breadcrumb, { homeTargetScreen: 'DashboardPage', items: breadcrumbEntries(activeScreen) }),\n ],\n [SlotName.Footer]: [externalComponent('footer', DefaultComponentName.Footer, { text: '© Contoso · Arc-bound pages from Cratis Scene' })],\n [SlotName.ConfigPanel]: [configPanel()],\n };\n}\n"],"names":["logo","id","externalComponent","DefaultComponentName","Logo","label","initials","targetScreen","menuSections","activeScreen","componentsNavigationGroups","map","group","toLowerCase","Menu","title","items","entriesInGroup","entry","navigationItem","icon","order","MenuItem","routeParameterBindings","isActive","configPanel","ConfigPanel","themes","defaultBlueprintThemes","theme","name","isDark","breadcrumbEntries","groupOfScreen","labelOfScreen","undefined","componentsApplicationChrome","SlotName","Topbar","end","UserMenu","role","Sidebar","Breadcrumb","homeTargetScreen","Footer","text"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;AAWC,wEAGD,SAASA,IAAAA,CAAKC,EAAU,EAAA;AACpB,IAAA,OAAOC,yCAAAA,CAAkBD,EAAAA,EAAIE,qCAAAA,CAAqBC,IAAI,EAAE;QAAEC,KAAAA,EAAO,iBAAA;QAAmBC,QAAAA,EAAU,IAAA;QAAMC,YAAAA,EAAc;AAAgB,KAAA,CAAA;AACtI;AAEA,iFACA,SAASC,YAAAA,CAAaC,YAAoB,EAAA;AACtC,IAAA,OAAOC,qCAAAA,CAA2BC,GAAG,CAACC,CAAAA,QAClCV,yCAAAA,CACI,CAAC,KAAK,EAAEU,MAAMC,WAAW,EAAA,CAAA,CAAI,EAC7BV,qCAAAA,CAAqBW,IAAI,EACzB;YAAEC,KAAAA,EAAOH,KAAAA;YAAOP,KAAAA,EAAOO;SAAM,EAC7B;AAAEI,YAAAA,KAAAA,EAAOC,0BAAeL,KAAAA,CAAAA,CAAOD,GAAG,CAACO,CAAAA,KAAAA,GAASC,eAAeD,KAAAA,CAAMX,YAAY,EAAEW,KAAAA,CAA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,CAAC4B,gCAAAA,CAASQ,MAAM,GAAG;YAAC3C,yCAAAA,CAAkB,QAAA,EAAUC,qCAAAA,CAAqB0C,MAAM,EAAE;gBAAEC,IAAAA,EAAM;AAAgD,aAAA;AAAG,SAAA;QACxI,CAACT,gCAAAA,CAASX,WAAW,GAAG;AAACD,YAAAA,WAAAA;AAAc;AAC3C,KAAA;AACJ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sources":["../../../gallery/navigation.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 { Contribution } from '@cratis/scene.model';\nimport { NavigationEntry, navigationContributionPoint, navigationElement } from '@cratis/scene.blueprint.default';\n\n/**\n * The navigation for this blueprint's gallery, declared once.\n *\n * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to\n * the `Navigation` contribution point where the default blueprint's aggregation turns them back into\n * navigation items. Maintaining a menu *and* a separate navigation declaration would mean two lists that\n * agree right up until someone adds a screen to one of them.\n *\n * `navigationElement` and the contribution point name are the default blueprint's, not this package's.\n * Reimplementing them here would produce a menu that looked identical and contributed to a contribution\n * point nothing reads - which is the exact failure mode a blueprint-on-blueprint dependency exists to\n * avoid.\n */\nexport const componentsNavigationEntries: NavigationEntry[] = [\n { label: 'Dashboard', targetScreen: 'DashboardPage', icon: 'pi pi-chart-bar', group: 'Billing', order: 10 },\n { label: 'Invoices', targetScreen: 'DataListPage', icon: 'pi pi-list', group: 'Billing', order: 20 },\n { label: 'In flight', targetScreen: 'ObservableDataListPage', icon: 'pi pi-bolt', group: 'Billing', order: 30 },\n { label: 'Invoices and detail', targetScreen: 'DataListWithDetailPage', icon: 'pi pi-window-maximize', group: 'Billing', order: 40 },\n { label: 'Master and detail', targetScreen: 'MasterDetailPage', icon: 'pi pi-table', group: 'Billing', order: 50 },\n { label: 'Register an invoice', targetScreen: 'CommandFormPage', icon: 'pi pi-plus-circle', group: 'Billing', order: 60 },\n { label: 'Event type schema', targetScreen: 'SchemaEditorPage', icon: 'pi pi-sitemap', group: 'Inspect', order: 10 },\n { label: 'Invoice document', targetScreen: 'ObjectEditorPage', icon: 'pi pi-file-edit', group: 'Inspect', order: 20 },\n { label: 'Billing module', targetScreen: 'DataModulePage', icon: 'pi pi-th-large', group: 'Nesting', order: 10 },\n { label: 'Adjustments feature', targetScreen: 'DataFeatureSection', icon: 'pi pi-folder', group: 'Nesting', order: 20 },\n { label: 'Record an adjustment', targetScreen: 'CommandSliceSection', icon: 'pi pi-pencil', group: 'Nesting', order: 30 },\n];\n\n/**\n * The navigation as contributions to the `Navigation` contribution point.\n *\n * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes\n * from whatever is currently in scope - so a screen that contributes an extra entry gets it into the\n * navigation without the navigation knowing that screen exists.\n */\nexport const componentsNavigationContributions: Contribution[] = componentsNavigationEntries.map(entry => ({\n contributionPointName: navigationContributionPoint,\n content: navigationElement(entry),\n order: entry.order,\n}));\n\n/** The navigation entries of one group, in order. */\nexport function entriesInGroup(group: string): NavigationEntry[] {\n return componentsNavigationEntries.filter(entry => entry.group === group).sort((first, second) => first.order - second.order);\n}\n\n/** Every group named by the navigation, in first-declared order. */\nexport const componentsNavigationGroups: string[] = [...new Set(componentsNavigationEntries.map(entry => entry.group))];\n\n/** The section a screen belongs to, for the first entry of its breadcrumb trail. */\nexport function groupOfScreen(screenName: string): string | undefined {\n return componentsNavigationEntries.find(entry => entry.targetScreen === screenName)?.group;\n}\n\n/** The navigation label of a screen, for the last entry of its breadcrumb trail. */\nexport function labelOfScreen(screenName: string): string | undefined {\n return componentsNavigationEntries.find(entry => entry.targetScreen === screenName)?.label;\n}\n"],"names":["componentsNavigationEntries","label","targetScreen","icon","group","order","componentsNavigationContributions","map","entry","contributionPointName","navigationContributionPoint","content","navigationElement","entriesInGroup","filter","sort","first","second","componentsNavigationGroups","Set","groupOfScreen","screenName","find","labelOfScreen"],"mappings":";;;;AAAA;AACA;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BsB,IAAI,CAACd,CAAAA,QAASA,KAAAA,CAAMN,YAAY,KAAKmB,UAAAA,CAAAA,EAAajB,KAAAA;AACzF;AAEA,qFACO,SAASmB,aAAAA,CAAcF,UAAkB,EAAA;IAC5C,OAAOrB,2BAAAA,CAA4BsB,IAAI,CAACd,CAAAA,QAASA,KAAAA,CAAMN,YAAY,KAAKmB,UAAAA,CAAAA,EAAapB,KAAAA;AACzF
|
|
1
|
+
{"version":3,"file":"navigation.js","sources":["../../../gallery/navigation.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 { Contribution } from '@cratis/scene.model';\nimport { NavigationEntry, navigationContributionPoint, navigationElement } from '@cratis/scene.blueprint.default';\n\n/**\n * The navigation for this blueprint's gallery, declared once.\n *\n * One list, two consumers: the sidebar menu renders it as `menuItem` elements, and the same elements go to\n * the `Navigation` contribution point where the default blueprint's aggregation turns them back into\n * navigation items. Maintaining a menu *and* a separate navigation declaration would mean two lists that\n * agree right up until someone adds a screen to one of them.\n *\n * `navigationElement` and the contribution point name are the default blueprint's, not this package's.\n * Reimplementing them here would produce a menu that looked identical and contributed to a contribution\n * point nothing reads - which is the exact failure mode a blueprint-on-blueprint dependency exists to\n * avoid.\n */\nexport const componentsNavigationEntries: NavigationEntry[] = [\n { label: 'Dashboard', targetScreen: 'DashboardPage', icon: 'pi pi-chart-bar', group: 'Billing', order: 10 },\n { label: 'Invoices', targetScreen: 'DataListPage', icon: 'pi pi-list', group: 'Billing', order: 20 },\n { label: 'In flight', targetScreen: 'ObservableDataListPage', icon: 'pi pi-bolt', group: 'Billing', order: 30 },\n { label: 'Invoices and detail', targetScreen: 'DataListWithDetailPage', icon: 'pi pi-window-maximize', group: 'Billing', order: 40 },\n { label: 'Master and detail', targetScreen: 'MasterDetailPage', icon: 'pi pi-table', group: 'Billing', order: 50 },\n { label: 'Register an invoice', targetScreen: 'CommandFormPage', icon: 'pi pi-plus-circle', group: 'Billing', order: 60 },\n { label: 'Event type schema', targetScreen: 'SchemaEditorPage', icon: 'pi pi-sitemap', group: 'Inspect', order: 10 },\n { label: 'Invoice document', targetScreen: 'ObjectEditorPage', icon: 'pi pi-file-edit', group: 'Inspect', order: 20 },\n { label: 'Billing module', targetScreen: 'DataModulePage', icon: 'pi pi-th-large', group: 'Nesting', order: 10 },\n { label: 'Adjustments feature', targetScreen: 'DataFeatureSection', icon: 'pi pi-folder', group: 'Nesting', order: 20 },\n { label: 'Record an adjustment', targetScreen: 'CommandSliceSection', icon: 'pi pi-pencil', group: 'Nesting', order: 30 },\n];\n\n/**\n * The navigation as contributions to the `Navigation` contribution point.\n *\n * A screen carries these in its `contributions`, and anything bound to the contribution point recomputes\n * from whatever is currently in scope - so a screen that contributes an extra entry gets it into the\n * navigation without the navigation knowing that screen exists.\n */\nexport const componentsNavigationContributions: Contribution[] = componentsNavigationEntries.map(entry => ({\n contributionPointName: navigationContributionPoint,\n content: navigationElement(entry),\n order: entry.order,\n}));\n\n/** The navigation entries of one group, in order. */\nexport function entriesInGroup(group: string): NavigationEntry[] {\n return componentsNavigationEntries.filter(entry => entry.group === group).sort((first, second) => first.order - second.order);\n}\n\n/** Every group named by the navigation, in first-declared order. */\nexport const componentsNavigationGroups: string[] = [...new Set(componentsNavigationEntries.map(entry => entry.group))];\n\n/** The section a screen belongs to, for the first entry of its breadcrumb trail. */\nexport function groupOfScreen(screenName: string): string | undefined {\n return componentsNavigationEntries.find(entry => entry.targetScreen === screenName)?.group;\n}\n\n/** The navigation label of a screen, for the last entry of its breadcrumb trail. */\nexport function labelOfScreen(screenName: string): string | undefined {\n return componentsNavigationEntries.find(entry => entry.targetScreen === screenName)?.label;\n}\n"],"names":["componentsNavigationEntries","label","targetScreen","icon","group","order","componentsNavigationContributions","map","entry","contributionPointName","navigationContributionPoint","content","navigationElement","entriesInGroup","filter","sort","first","second","componentsNavigationGroups","Set","groupOfScreen","screenName","find","labelOfScreen"],"mappings":";;;;AAAA;AACA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4BsB,IAAI,CAACd,CAAAA,QAASA,KAAAA,CAAMN,YAAY,KAAKmB,UAAAA,CAAAA,EAAajB,KAAAA;AACzF;AAEA,qFACO,SAASmB,aAAAA,CAAcF,UAAkB,EAAA;IAC5C,OAAOrB,2BAAAA,CAA4BsB,IAAI,CAACd,CAAAA,QAASA,KAAAA,CAAMN,YAAY,KAAKmB,UAAAA,CAAAA,EAAapB,KAAAA;AACzF;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"previewProfile.js","sources":["../../../gallery/previewProfile.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 { UiProfile } from '@cratis/scene.model';\nimport { PackageCatalog } from '@cratis/scene.engine';\nimport { corePackageManifest } from '@cratis/scene.react';\nimport { cratisComponentsPackageManifest } from '@cratis/scene.components';\nimport { defaultBlueprintManifest, defaultBlueprintName } from '@cratis/scene.blueprint.default';\nimport { ComponentName } from '../ComponentName';\nimport { componentsBlueprintName } from '../packageName';\n\n/**\n * The names this blueprint borrows from `PrimeReact`.\n *\n * Every other package in the catalog below contributes its *real* manifest, because this package takes an\n * npm dependency on each of them. `PrimeReact` is the exception: this blueprint depends on it in the\n * manifest sense - `column` comes from there - without depending on its bundle, so its declaration is not\n * importable here and the borrowed names are written out instead.\n *\n * Every name below was checked against `primeReactPackage.ts`'s own component list rather than assumed.\n * The default blueprint learned why that matters when it referenced `chart` and `fileUpload`, which\n * neither library declares - names that look obvious and render as dashed red boxes.\n *\n * A host that has all five packages loaded should build this catalog from their manifests instead. The\n * shape is the same, and anything that has drifted then fails this blueprint's specs rather than a preview.\n */\nexport const primeReactComponentNames: string[] = ['column', 'dataTable', 'table', 'dialog', 'button', 'card', 'text', 'toolbar', 'dropdown', 'tooltip', 'menu', 'breadcrumb', 'sidebar'];\n\n/**\n * The profile this blueprint's templates resolve against.\n *\n * Declaration order is ascending priority, which is why this exact order matters rather than being\n * cosmetic. `Cratis.Components` outranks `PrimeReact`, so a template naming `table` or `dialog` gets the\n * Arc-aware one and PrimeReact's is recorded as shadowed. Both blueprints outrank both libraries, so\n * `pageHeader` and `arcPageHeader` resolve to the packages that declare them. And this blueprint sits at\n * the top, which costs nothing today - it declares one name nobody else does - but is the correct place\n * for the package doing the layering.\n *\n * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's\n * compatibility is checked against exactly what a profile declares, and a profile leaning on the implicit\n * fallback would make a theme look incompatible with a package the profile never admitted to using.\n *\n * Unlike the default blueprint, this package needs no separate *preview* profile. That blueprint takes no\n * npm dependency on the libraries its templates reference, so previewing it from its own package resolves\n * most names to implementations that are not loaded. This one depends on `@cratis/scene.components` and\n * `@cratis/scene.blueprint.default` for real, so everything its templates name is loadable except\n * PrimeReact's `column` - and a `column` never reaches the DOM at design time anyway, because the table it\n * belongs to is a placeholder until a host registers its query.\n */\nexport const componentsBlueprintProfile: UiProfile = {\n name: 'Arc pages',\n targetPlatform: 'web',\n packages: ['core', 'PrimeReact', cratisComponentsPackageManifest.name, defaultBlueprintName, componentsBlueprintName],\n};\n\n/**\n * The component catalog the templates resolve against.\n *\n * Four of the five entries are the owning package's real declared list, read straight off its manifest, so\n * a name renamed upstream fails a spec here instead of rendering as a dashed box in someone's application.\n */\nexport const componentsBlueprintCatalog: PackageCatalog = {\n [corePackageManifest.name]: corePackageManifest.components,\n PrimeReact: primeReactComponentNames,\n [cratisComponentsPackageManifest.name]: cratisComponentsPackageManifest.components,\n [defaultBlueprintName]: defaultBlueprintManifest.components,\n [componentsBlueprintName]: Object.values(ComponentName),\n};\n"],"names":["primeReactComponentNames","componentsBlueprintProfile","name","targetPlatform","packages","cratisComponentsPackageManifest","defaultBlueprintName","componentsBlueprintName","componentsBlueprintCatalog","corePackageManifest","components","PrimeReact","defaultBlueprintManifest","Object","values","ComponentName"],"mappings":";;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;UAeaA,wBAAAA,GAAqC;AAAC,IAAA,QAAA;AAAU,IAAA,WAAA;AAAa,IAAA,OAAA;AAAS,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,MAAA;AAAQ,IAAA,MAAA;AAAQ,IAAA,SAAA;AAAW,IAAA,UAAA;AAAY,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA;;AAE/K;;;;;;;;;;;;;;;;;;;;UAqBaC,0BAAAA,GAAwC;IACjDC,IAAAA,EAAM,WAAA;IACNC,cAAAA,EAAgB,KAAA;IAChBC,QAAAA,EAAU;AAAC,QAAA,MAAA;AAAQ,QAAA,YAAA;AAAcC,QAAAA,gDAAAA,CAAgCH,IAAI;AAAEI,QAAAA,4CAAAA;AAAsBC,QAAAA;AAAwB;AACzH;AAEA;;;;;UAMaC,0BAAAA,GAA6C;AACtD,IAAA,CAACC,+BAAAA,CAAoBP,IAAI,GAAGO,gCAAoBC,UAAU;IAC1DC,UAAAA,EAAYX,wBAAAA;AACZ,IAAA,CAACK,gDAAAA,CAAgCH,IAAI,GAAGG,iDAAgCK,UAAU;IAClF,CAACJ,4CAAAA,GAAuBM,gDAAAA,CAAyBF,UAAU;AAC3D,IAAA,CAACH,mCAAAA,GAA0BM,MAAAA,CAAOC,MAAM,CAACC,2BAAAA;AAC7C
|
|
1
|
+
{"version":3,"file":"previewProfile.js","sources":["../../../gallery/previewProfile.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 { UiProfile } from '@cratis/scene.model';\nimport { PackageCatalog } from '@cratis/scene.engine';\nimport { corePackageManifest } from '@cratis/scene.react';\nimport { cratisComponentsPackageManifest } from '@cratis/scene.components';\nimport { defaultBlueprintManifest, defaultBlueprintName } from '@cratis/scene.blueprint.default';\nimport { ComponentName } from '../ComponentName';\nimport { componentsBlueprintName } from '../packageName';\n\n/**\n * The names this blueprint borrows from `PrimeReact`.\n *\n * Every other package in the catalog below contributes its *real* manifest, because this package takes an\n * npm dependency on each of them. `PrimeReact` is the exception: this blueprint depends on it in the\n * manifest sense - `column` comes from there - without depending on its bundle, so its declaration is not\n * importable here and the borrowed names are written out instead.\n *\n * Every name below was checked against `primeReactPackage.ts`'s own component list rather than assumed.\n * The default blueprint learned why that matters when it referenced `chart` and `fileUpload`, which\n * neither library declares - names that look obvious and render as dashed red boxes.\n *\n * A host that has all five packages loaded should build this catalog from their manifests instead. The\n * shape is the same, and anything that has drifted then fails this blueprint's specs rather than a preview.\n */\nexport const primeReactComponentNames: string[] = ['column', 'dataTable', 'table', 'dialog', 'button', 'card', 'text', 'toolbar', 'dropdown', 'tooltip', 'menu', 'breadcrumb', 'sidebar'];\n\n/**\n * The profile this blueprint's templates resolve against.\n *\n * Declaration order is ascending priority, which is why this exact order matters rather than being\n * cosmetic. `Cratis.Components` outranks `PrimeReact`, so a template naming `table` or `dialog` gets the\n * Arc-aware one and PrimeReact's is recorded as shadowed. Both blueprints outrank both libraries, so\n * `pageHeader` and `arcPageHeader` resolve to the packages that declare them. And this blueprint sits at\n * the top, which costs nothing today - it declares one name nobody else does - but is the correct place\n * for the package doing the layering.\n *\n * `core` is listed explicitly rather than left to `effectivePackages` to prepend, because a theme's\n * compatibility is checked against exactly what a profile declares, and a profile leaning on the implicit\n * fallback would make a theme look incompatible with a package the profile never admitted to using.\n *\n * Unlike the default blueprint, this package needs no separate *preview* profile. That blueprint takes no\n * npm dependency on the libraries its templates reference, so previewing it from its own package resolves\n * most names to implementations that are not loaded. This one depends on `@cratis/scene.components` and\n * `@cratis/scene.blueprint.default` for real, so everything its templates name is loadable except\n * PrimeReact's `column` - and a `column` never reaches the DOM at design time anyway, because the table it\n * belongs to is a placeholder until a host registers its query.\n */\nexport const componentsBlueprintProfile: UiProfile = {\n name: 'Arc pages',\n targetPlatform: 'web',\n packages: ['core', 'PrimeReact', cratisComponentsPackageManifest.name, defaultBlueprintName, componentsBlueprintName],\n};\n\n/**\n * The component catalog the templates resolve against.\n *\n * Four of the five entries are the owning package's real declared list, read straight off its manifest, so\n * a name renamed upstream fails a spec here instead of rendering as a dashed box in someone's application.\n */\nexport const componentsBlueprintCatalog: PackageCatalog = {\n [corePackageManifest.name]: corePackageManifest.components,\n PrimeReact: primeReactComponentNames,\n [cratisComponentsPackageManifest.name]: cratisComponentsPackageManifest.components,\n [defaultBlueprintName]: defaultBlueprintManifest.components,\n [componentsBlueprintName]: Object.values(ComponentName),\n};\n"],"names":["primeReactComponentNames","componentsBlueprintProfile","name","targetPlatform","packages","cratisComponentsPackageManifest","defaultBlueprintName","componentsBlueprintName","componentsBlueprintCatalog","corePackageManifest","components","PrimeReact","defaultBlueprintManifest","Object","values","ComponentName"],"mappings":";;;;;;;;AAAA;AACA;AAUA;;;;;;;;;;;;;;UAeaA,wBAAAA,GAAqC;AAAC,IAAA,QAAA;AAAU,IAAA,WAAA;AAAa,IAAA,OAAA;AAAS,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,MAAA;AAAQ,IAAA,MAAA;AAAQ,IAAA,SAAA;AAAW,IAAA,UAAA;AAAY,IAAA,SAAA;AAAW,IAAA,MAAA;AAAQ,IAAA,YAAA;AAAc,IAAA;;AAE/K;;;;;;;;;;;;;;;;;;;;UAqBaC,0BAAAA,GAAwC;IACjDC,IAAAA,EAAM,WAAA;IACNC,cAAAA,EAAgB,KAAA;IAChBC,QAAAA,EAAU;AAAC,QAAA,MAAA;AAAQ,QAAA,YAAA;AAAcC,QAAAA,gDAAAA,CAAgCH,IAAI;AAAEI,QAAAA,4CAAAA;AAAsBC,QAAAA;AAAwB;AACzH;AAEA;;;;;UAMaC,0BAAAA,GAA6C;AACtD,IAAA,CAACC,+BAAAA,CAAoBP,IAAI,GAAGO,gCAAoBC,UAAU;IAC1DC,UAAAA,EAAYX,wBAAAA;AACZ,IAAA,CAACK,gDAAAA,CAAgCH,IAAI,GAAGG,iDAAgCK,UAAU;IAClF,CAACJ,4CAAAA,GAAuBM,gDAAAA,CAAyBF,UAAU;AAC3D,IAAA,CAACH,mCAAAA,GAA0BM,MAAAA,CAAOC,MAAM,CAACC,2BAAAA;AAC7C;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screens.js","sources":["../../../gallery/screens.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, nestScreenTemplates, templateContentInLayout } from '@cratis/scene.blueprint.default';\nimport { componentsScreenTemplates, nestingChainTemplates } from '../templates';\nimport { componentsApplicationChrome } from './applicationChrome';\nimport { componentsNavigationContributions } from './navigation';\n\n/**\n * The gallery: one {@link Screen} per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n *\n * They will render with unregistered bindings, and that is the normal design-time state rather than a\n * shortcoming of the gallery. A host owns the generated Arc proxies; a gallery is not a host. What a\n * preview therefore shows is every Arc-bound region as a placeholder naming the binding it wanted, every\n * Arc-free region rendered for real, and a header on each page saying which of the two you are looking at.\n *\n * Every screen renders in the default blueprint's `AppShell`. There is no full-page variant here because\n * there is no Arc-bound page that belongs outside the application shell - a sign-in screen queries nothing\n * and submits no command, so it stays where it already is, in the default blueprint.\n */\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(componentsApplicationChrome(template.name), templateContentInLayout(placeable, appShellLayout)),\n forms: [],\n contributions: componentsNavigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * The eight page templates fit the layout's own `content` slot, so each one's chain is just itself. The\n * three nesting-chain templates are the exception and the only ones that need the walk - which is the\n * honest version of the story: nesting exists for the applications that need it, and costs nothing for the\n * ones that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/** One screen per screen template this blueprint provides. */\nexport const componentsGalleryScreens: Screen[] = componentsScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function componentsGalleryScreen(name: string): Screen | undefined {\n return componentsGalleryScreens.find(screen => screen.name === name);\n}\n"],"names":["screenFor","template","placeable","nestScreenTemplates","containmentChainFor","name","layout","LayoutName","AppShell","screenTemplate","slotContent","mergeSlotContent","componentsApplicationChrome","templateContentInLayout","appShellLayout","forms","contributions","componentsNavigationContributions","depth","nestingChainTemplates","findIndex","candidate","slice","chrome","content","merged","slotName","elements","Object","entries","componentsGalleryScreens","componentsScreenTemplates","map","componentsGalleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;;;;IAwBA,SAASA,UAAUC,QAAwB,EAAA;IACvC,MAAMC,SAAAA,GAAYC,4CAAoBC,mBAAAA,CAAoBH,QAAAA,CAAAA,CAAAA;IAE1D,OAAO;AACHI,QAAAA,IAAAA,EAAMJ,SAASI,IAAI;AACnBC,QAAAA,MAAAA,EAAQC,mCAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBR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. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Screen, ScreenTemplate } from '@cratis/scene.model';\nimport { LayoutName, appShellLayout, nestScreenTemplates, templateContentInLayout } from '@cratis/scene.blueprint.default';\nimport { componentsScreenTemplates, nestingChainTemplates } from '../templates';\nimport { componentsApplicationChrome } from './applicationChrome';\nimport { componentsNavigationContributions } from './navigation';\n\n/**\n * The gallery: one {@link Screen} per template, ready to boot through the real engine.\n *\n * These exist so a preview is a working miniature application rather than a set of pictures - the same\n * `Screen` shape Stage produces, put through the same `Scene.Engine` and `Scene.React`, with no separate\n * preview pipeline and nothing mocked.\n *\n * They will render with unregistered bindings, and that is the normal design-time state rather than a\n * shortcoming of the gallery. A host owns the generated Arc proxies; a gallery is not a host. What a\n * preview therefore shows is every Arc-bound region as a placeholder naming the binding it wanted, every\n * Arc-free region rendered for real, and a header on each page saying which of the two you are looking at.\n *\n * Every screen renders in the default blueprint's `AppShell`. There is no full-page variant here because\n * there is no Arc-bound page that belongs outside the application shell - a sign-in screen queries nothing\n * and submits no command, so it stays where it already is, in the default blueprint.\n */\n\n/**\n * Builds the {@link Screen} that instantiates one template.\n *\n * A screen is an instance, not a shape: it names the layout it renders in, the template it fills, the\n * content that fills it, and what it contributes elsewhere. Everything structural comes from the template,\n * which is why adding a screen is a handful of lines rather than another copy of the chrome.\n */\nfunction screenFor(template: ScreenTemplate): Screen {\n const placeable = nestScreenTemplates(containmentChainFor(template));\n\n return {\n name: template.name,\n layout: LayoutName.AppShell,\n screenTemplate: template.name,\n slotContent: mergeSlotContent(componentsApplicationChrome(template.name), templateContentInLayout(placeable, appShellLayout)),\n forms: [],\n contributions: componentsNavigationContributions,\n };\n}\n\n/**\n * The chain of templates a screen renders through, outermost first.\n *\n * The eight page templates fit the layout's own `content` slot, so each one's chain is just itself. The\n * three nesting-chain templates are the exception and the only ones that need the walk - which is the\n * honest version of the story: nesting exists for the applications that need it, and costs nothing for the\n * ones that do not.\n */\nfunction containmentChainFor(template: ScreenTemplate): ScreenTemplate[] {\n const depth = nestingChainTemplates.findIndex(candidate => candidate.name === template.name);\n return depth < 0 ? [template] : nestingChainTemplates.slice(0, depth + 1);\n}\n\nfunction mergeSlotContent(chrome: Record<string, Screen['slotContent'][string]>, content: Record<string, Screen['slotContent'][string]>): Screen['slotContent'] {\n const merged: Screen['slotContent'] = { ...chrome };\n for (const [slotName, elements] of Object.entries(content)) {\n merged[slotName] = [...(merged[slotName] ?? []), ...elements];\n }\n\n return merged;\n}\n\n/** One screen per screen template this blueprint provides. */\nexport const componentsGalleryScreens: Screen[] = componentsScreenTemplates.map(screenFor);\n\n/** One gallery screen by name, for a story or a host that boots a specific one. */\nexport function componentsGalleryScreen(name: string): Screen | undefined {\n return componentsGalleryScreens.find(screen => screen.name === name);\n}\n"],"names":["screenFor","template","placeable","nestScreenTemplates","containmentChainFor","name","layout","LayoutName","AppShell","screenTemplate","slotContent","mergeSlotContent","componentsApplicationChrome","templateContentInLayout","appShellLayout","forms","contributions","componentsNavigationContributions","depth","nestingChainTemplates","findIndex","candidate","slice","chrome","content","merged","slotName","elements","Object","entries","componentsGalleryScreens","componentsScreenTemplates","map","componentsGalleryScreen","find","screen"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;;;;IAwBA,SAASA,UAAUC,QAAwB,EAAA;IACvC,MAAMC,SAAAA,GAAYC,4CAAoBC,mBAAAA,CAAoBH,QAAAA,CAAAA,CAAAA;IAE1D,OAAO;AACHI,QAAAA,IAAAA,EAAMJ,SAASI,IAAI;AACnBC,QAAAA,MAAAA,EAAQC,mCAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBR,SAASI,IAAI;AAC7BK,QAAAA,WAAAA,EAAaC,iBAAiBC,6CAAAA,CAA4BX,QAAAA,CAASI,IAAI,CAAA,EAAGQ,gDAAwBX,SAAAA,EAAWY,sCAAAA,CAAAA,CAAAA;AAC7GC,QAAAA,KAAAA,EAAO,EAAE;QACTC,aAAAA,EAAeC;AACnB,KAAA;AACJ;AAEA;;;;;;;IAQA,SAASb,oBAAoBH,QAAwB,EAAA;IACjD,MAAMiB,KAAAA,GAAQC,6BAAAA,CAAsBC,SAAS,CAACC,CAAAA,YAAaA,SAAAA,CAAUhB,IAAI,KAAKJ,QAAAA,CAASI,IAAI,CAAA;AAC3F,IAAA,OAAOa,QAAQ,CAAA,GAAI;AAACjB,QAAAA;AAAS,KAAA,GAAGkB,6BAAAA,CAAsBG,KAAK,CAAC,CAAA,EAAGJ,KAAAA,GAAQ,CAAA,CAAA;AAC3E;AAEA,SAASP,gBAAAA,CAAiBY,MAAqD,EAAEC,OAAsD,EAAA;AACnI,IAAA,MAAMC,MAAAA,GAAgC;AAAE,QAAA,GAAGF;AAAO,KAAA;IAClD,KAAK,MAAM,CAACG,QAAAA,EAAUC,QAAAA,CAAS,IAAIC,MAAAA,CAAOC,OAAO,CAACL,OAAAA,CAAAA,CAAU;QACxDC,MAAM,CAACC,SAAS,GAAG;eAAKD,MAAM,CAACC,QAAAA,CAAS,IAAI,EAAE;AAAMC,YAAAA,GAAAA;AAAS,SAAA;AACjE,IAAA;IAEA,OAAOF,MAAAA;AACX;AAEA,+DACO,MAAMK,2BAAqCC,yCAAAA,CAA0BC,GAAG,CAAChC,SAAAA;AAEhF,oFACO,SAASiC,uBAAAA,CAAwB5B,IAAY,EAAA;AAChD,IAAA,OAAOyB,yBAAyBI,IAAI,CAACC,CAAAA,MAAAA,GAAUA,MAAAA,CAAO9B,IAAI,KAAKA,IAAAA,CAAAA;AACnE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcPageHeader.js","sources":["../../../header/ArcPageHeader.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { BindingKind, resolveElementBinding } from '@cratis/scene.components';\nimport { deriveArcHeading } from './deriveArcHeading';\n\n/**\n * The one component this blueprint registers: a page header whose heading, trail and design-time state all\n * follow from a single binding name.\n *\n * Every template in this package opens with one, and every template gives it the same binding its body is\n * built around - `AllInvoices` on the list page, `RecordAdjustment` on the command page. Saying it once is\n * the point. A hand-authored header repeats the page's subject in the title, again in the trail, and a\n * third time in the table below it, and those three copies drift the first time anything is renamed.\n *\n * It also reports whether the binding is registered, which is what makes a design-time preview readable.\n * A page whose body is one dashed placeholder is ambiguous - is the name wrong, or has the host simply not\n * wired anything yet? The header answers that at the top of the page, in words, without opening a debugger.\n *\n * The `layout-page-header` class names are the default blueprint's, not this package's. That is this\n * blueprint's whole posture in one detail: it reuses the shell it depends on rather than shipping a rival\n * one, so a page of Arc-bound content sits inside the default shell looking like it belongs there.\n */\nexport function ArcPageHeader({ element, slots }: RegisteredComponentProps) {\n const query = resolveElementBinding(element, BindingKind.Query);\n const kind = query.name === undefined ? BindingKind.Command : BindingKind.Query;\n const binding = kind === BindingKind.Query ? query : resolveElementBinding(element, BindingKind.Command);\n const heading = deriveArcHeading(element.properties, binding, kind);\n\n return (\n <div className='layout-page-header' data-scene-id={element.id} data-scene-binding={heading.bindingName}>\n <div>\n <nav className='layout-page-header-trail' aria-label='Breadcrumb'>\n {heading.trail.join(' › ')}\n </nav>\n <h1 className='layout-page-header-title'>{heading.title}</h1>\n {heading.subtitle && <p className='layout-page-header-subtitle'>{heading.subtitle}</p>}\n <span data-scene-binding-state={heading.isBound ? 'bound' : 'unbound'}>{heading.bindingLabel}</span>\n </div>\n {(slots.actions?.length ?? 0) > 0 && <div className='layout-page-header-actions'>{slots.actions}</div>}\n </div>\n );\n}\n"],"names":["ArcPageHeader","element","slots","query","resolveElementBinding","BindingKind","Query","kind","name","undefined","Command","binding","heading","deriveArcHeading","properties","_jsxs","div","className","data-scene-id","id","data-scene-binding","bindingName","_jsx","nav","aria-label","trail","join","h1","title","subtitle","p","span","data-scene-binding-state","isBound","bindingLabel","actions","length"],"mappings":";;;;;;AAAA;AACA;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AAG,OAAA,GAAU,SAAA;AAAYrB,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQsB;;;;AAElFhC,YAAAA,CAAAA,MAAMiC,OAAO,EAAEC,UAAU,CAAA,IAAK,mBAAKd,cAAA,CAACN,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,4BAAA;AAA8Bf,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMiC;;;;AAGpG
|
|
1
|
+
{"version":3,"file":"ArcPageHeader.js","sources":["../../../header/ArcPageHeader.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { RegisteredComponentProps } from '@cratis/scene.react';\nimport { BindingKind, resolveElementBinding } from '@cratis/scene.components';\nimport { deriveArcHeading } from './deriveArcHeading';\n\n/**\n * The one component this blueprint registers: a page header whose heading, trail and design-time state all\n * follow from a single binding name.\n *\n * Every template in this package opens with one, and every template gives it the same binding its body is\n * built around - `AllInvoices` on the list page, `RecordAdjustment` on the command page. Saying it once is\n * the point. A hand-authored header repeats the page's subject in the title, again in the trail, and a\n * third time in the table below it, and those three copies drift the first time anything is renamed.\n *\n * It also reports whether the binding is registered, which is what makes a design-time preview readable.\n * A page whose body is one dashed placeholder is ambiguous - is the name wrong, or has the host simply not\n * wired anything yet? The header answers that at the top of the page, in words, without opening a debugger.\n *\n * The `layout-page-header` class names are the default blueprint's, not this package's. That is this\n * blueprint's whole posture in one detail: it reuses the shell it depends on rather than shipping a rival\n * one, so a page of Arc-bound content sits inside the default shell looking like it belongs there.\n */\nexport function ArcPageHeader({ element, slots }: RegisteredComponentProps) {\n const query = resolveElementBinding(element, BindingKind.Query);\n const kind = query.name === undefined ? BindingKind.Command : BindingKind.Query;\n const binding = kind === BindingKind.Query ? query : resolveElementBinding(element, BindingKind.Command);\n const heading = deriveArcHeading(element.properties, binding, kind);\n\n return (\n <div className='layout-page-header' data-scene-id={element.id} data-scene-binding={heading.bindingName}>\n <div>\n <nav className='layout-page-header-trail' aria-label='Breadcrumb'>\n {heading.trail.join(' › ')}\n </nav>\n <h1 className='layout-page-header-title'>{heading.title}</h1>\n {heading.subtitle && <p className='layout-page-header-subtitle'>{heading.subtitle}</p>}\n <span data-scene-binding-state={heading.isBound ? 'bound' : 'unbound'}>{heading.bindingLabel}</span>\n </div>\n {(slots.actions?.length ?? 0) > 0 && <div className='layout-page-header-actions'>{slots.actions}</div>}\n </div>\n );\n}\n"],"names":["ArcPageHeader","element","slots","query","resolveElementBinding","BindingKind","Query","kind","name","undefined","Command","binding","heading","deriveArcHeading","properties","_jsxs","div","className","data-scene-id","id","data-scene-binding","bindingName","_jsx","nav","aria-label","trail","join","h1","title","subtitle","p","span","data-scene-binding-state","isBound","bindingLabel","actions","length"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;AAgBC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACtE,IAAA,MAAMC,KAAAA,GAAQC,sCAAAA,CAAsBH,OAAAA,EAASI,4BAAAA,CAAYC,KAAK,CAAA;IAC9D,MAAMC,IAAAA,GAAOJ,MAAMK,IAAI,KAAKC,YAAYJ,4BAAAA,CAAYK,OAAO,GAAGL,4BAAAA,CAAYC,KAAK;IAC/E,MAAMK,OAAAA,GAAUJ,SAASF,4BAAAA,CAAYC,KAAK,GAAGH,KAAAA,GAAQC,sCAAAA,CAAsBH,OAAAA,EAASI,4BAAAA,CAAYK,OAAO,CAAA;AACvG,IAAA,MAAME,OAAAA,GAAUC,iCAAAA,CAAiBZ,OAAAA,CAAQa,UAAU,EAAEH,OAAAA,EAASJ,IAAAA,CAAAA;AAE9D,IAAA,qBACIQ,eAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,oBAAA;AAAqBC,QAAAA,eAAAA,EAAejB,QAAQkB,EAAE;AAAEC,QAAAA,oBAAAA,EAAoBR,QAAQS,WAAW;;0BAClGN,eAAA,CAACC,KAAAA,EAAAA;;kCACGM,cAAA,CAACC,KAAAA,EAAAA;wBAAIN,SAAAA,EAAU,0BAAA;wBAA2BO,YAAAA,EAAW,YAAA;kCAChDZ,OAAAA,CAAQa,KAAK,CAACC,IAAI,CAAC,KAAA;;kCAExBJ,cAAA,CAACK,IAAAA,EAAAA;wBAAGV,SAAAA,EAAU,0BAAA;AAA4BL,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQgB;;oBACjDhB,OAAAA,CAAQiB,QAAQ,kBAAIP,cAAA,CAACQ,GAAAA,EAAAA;wBAAEb,SAAAA,EAAU,6BAAA;AAA+BL,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQiB;;kCACzEP,cAAA,CAACS,MAAAA,EAAAA;wBAAKC,0BAAAA,EAA0BpB,OAAAA,CAAQqB,OAAO,GAAG,OAAA,GAAU,SAAA;AAAYrB,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQsB;;;;AAElFhC,YAAAA,CAAAA,MAAMiC,OAAO,EAAEC,UAAU,CAAA,IAAK,mBAAKd,cAAA,CAACN,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,4BAAA;AAA8Bf,gBAAAA,QAAAA,EAAAA,KAAAA,CAAMiC;;;;AAGpG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deriveArcHeading.js","sources":["../../../header/deriveArcHeading.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 { BindingKind, ElementBinding, stringProperty } from '@cratis/scene.components';\nimport { ArcHeading } from './ArcHeading';\nimport { humanizeBindingName } from './humanizeBindingName';\n\n/**\n * Derives everything a page header shows from one binding and the few properties around it.\n *\n * This function is the entire argument for {@link ArcPageHeader} being a component at all. A screen\n * template can hold a title, a subtitle and a breadcrumb trail perfectly well - they are three literals in\n * a property bag, and a tree is the right place for literals. What a tree cannot do is *derive* them from\n * a single binding name and a registry lookup, and that is what an Arc-bound page needs: the page is about\n * `AllInvoices`, so the heading, the trail and the design-time state should all follow from saying so once.\n *\n * The three binding states are kept apart deliberately, because they are three different problems with\n * three different fixes. No name at all means the template is incomplete. A name nothing is registered\n * under means the host has not wired it - which is the *normal* state at design time, not an error. A\n * resolved name means the page will really talk to a backend.\n *\n * @param properties The element's property bag - `title`, `subtitle` and `section` are read from it.\n * @param binding What the element asked for at its binding site, and what the registry produced.\n * @param kind Whether the binding was a query or a command, so the state can be described in the right words.\n * @returns The derived {@link ArcHeading}.\n */\nexport function deriveArcHeading(properties: Record<string, unknown>, binding: ElementBinding, kind: BindingKind): ArcHeading {\n const title = stringProperty(properties, 'title') ?? (binding.name === undefined ? 'Untitled page' : humanizeBindingName(binding.name));\n const section = stringProperty(properties, 'section');\n\n return {\n title,\n subtitle: stringProperty(properties, 'subtitle'),\n trail: section === undefined ? [title] : [section, title],\n bindingName: binding.name,\n isBound: binding.target !== undefined,\n bindingLabel: bindingLabelFor(binding, kind),\n };\n}\n\nfunction bindingLabelFor(binding: ElementBinding, kind: BindingKind): string {\n if (binding.name === undefined) {\n return 'No binding';\n }\n\n return binding.target === undefined ? `No ${kind} registered as ${binding.name}` : `Bound to ${kind} ${binding.name}`;\n}\n"],"names":["deriveArcHeading","properties","binding","kind","title","stringProperty","name","undefined","humanizeBindingName","section","subtitle","trail","bindingName","isBound","target","bindingLabel","bindingLabelFor"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;AAkBC,IACM,SAASA,gBAAAA,CAAiBC,UAAmC,EAAEC,OAAuB,EAAEC,IAAiB,EAAA;AAC5G,IAAA,MAAMC,KAAAA,GAAQC,+BAAAA,CAAeJ,UAAAA,EAAY,OAAA,CAAA,KAAaC,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,GAAY,eAAA,GAAkBC,uCAAAA,CAAoBN,OAAAA,CAAQI,IAAI,CAAA,CAAA;IACrI,MAAMG,OAAAA,GAAUJ,gCAAeJ,UAAAA,EAAY,SAAA,CAAA;IAE3C,OAAO;AACHG,QAAAA,KAAAA;AACAM,QAAAA,QAAAA,EAAUL,gCAAeJ,UAAAA,EAAY,UAAA,CAAA;AACrCU,QAAAA,KAAAA,EAAOF,YAAYF,SAAAA,GAAY;AAACH,YAAAA;SAAM,GAAG;AAACK,YAAAA,OAAAA;AAASL,YAAAA;AAAM,SAAA;AACzDQ,QAAAA,WAAAA,EAAaV,QAAQI,IAAI;QACzBO,OAAAA,EAASX,OAAAA,CAAQY,MAAM,KAAKP,SAAAA;AAC5BQ,QAAAA,YAAAA,EAAcC,gBAAgBd,OAAAA,EAASC,IAAAA;AAC3C,KAAA;AACJ;AAEA,SAASa,eAAAA,CAAgBd,OAAuB,EAAEC,IAAiB,EAAA;IAC/D,IAAID,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,EAAW;QAC5B,OAAO,YAAA;AACX,IAAA;IAEA,OAAOL,OAAAA,CAAQY,MAAM,KAAKP,SAAAA,GAAY,CAAC,GAAG,EAAEJ,IAAAA,CAAK,eAAe,EAAED,OAAAA,CAAQI,IAAI,CAAA,CAAE,GAAG,CAAC,SAAS,EAAEH,KAAK,CAAC,EAAED,OAAAA,CAAQI,IAAI,CAAA,CAAE;AACzH
|
|
1
|
+
{"version":3,"file":"deriveArcHeading.js","sources":["../../../header/deriveArcHeading.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 { BindingKind, ElementBinding, stringProperty } from '@cratis/scene.components';\nimport { ArcHeading } from './ArcHeading';\nimport { humanizeBindingName } from './humanizeBindingName';\n\n/**\n * Derives everything a page header shows from one binding and the few properties around it.\n *\n * This function is the entire argument for {@link ArcPageHeader} being a component at all. A screen\n * template can hold a title, a subtitle and a breadcrumb trail perfectly well - they are three literals in\n * a property bag, and a tree is the right place for literals. What a tree cannot do is *derive* them from\n * a single binding name and a registry lookup, and that is what an Arc-bound page needs: the page is about\n * `AllInvoices`, so the heading, the trail and the design-time state should all follow from saying so once.\n *\n * The three binding states are kept apart deliberately, because they are three different problems with\n * three different fixes. No name at all means the template is incomplete. A name nothing is registered\n * under means the host has not wired it - which is the *normal* state at design time, not an error. A\n * resolved name means the page will really talk to a backend.\n *\n * @param properties The element's property bag - `title`, `subtitle` and `section` are read from it.\n * @param binding What the element asked for at its binding site, and what the registry produced.\n * @param kind Whether the binding was a query or a command, so the state can be described in the right words.\n * @returns The derived {@link ArcHeading}.\n */\nexport function deriveArcHeading(properties: Record<string, unknown>, binding: ElementBinding, kind: BindingKind): ArcHeading {\n const title = stringProperty(properties, 'title') ?? (binding.name === undefined ? 'Untitled page' : humanizeBindingName(binding.name));\n const section = stringProperty(properties, 'section');\n\n return {\n title,\n subtitle: stringProperty(properties, 'subtitle'),\n trail: section === undefined ? [title] : [section, title],\n bindingName: binding.name,\n isBound: binding.target !== undefined,\n bindingLabel: bindingLabelFor(binding, kind),\n };\n}\n\nfunction bindingLabelFor(binding: ElementBinding, kind: BindingKind): string {\n if (binding.name === undefined) {\n return 'No binding';\n }\n\n return binding.target === undefined ? `No ${kind} registered as ${binding.name}` : `Bound to ${kind} ${binding.name}`;\n}\n"],"names":["deriveArcHeading","properties","binding","kind","title","stringProperty","name","undefined","humanizeBindingName","section","subtitle","trail","bindingName","isBound","target","bindingLabel","bindingLabelFor"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;;AAkBC,IACM,SAASA,gBAAAA,CAAiBC,UAAmC,EAAEC,OAAuB,EAAEC,IAAiB,EAAA;AAC5G,IAAA,MAAMC,KAAAA,GAAQC,+BAAAA,CAAeJ,UAAAA,EAAY,OAAA,CAAA,KAAaC,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,GAAY,eAAA,GAAkBC,uCAAAA,CAAoBN,OAAAA,CAAQI,IAAI,CAAA,CAAA;IACrI,MAAMG,OAAAA,GAAUJ,gCAAeJ,UAAAA,EAAY,SAAA,CAAA;IAE3C,OAAO;AACHG,QAAAA,KAAAA;AACAM,QAAAA,QAAAA,EAAUL,gCAAeJ,UAAAA,EAAY,UAAA,CAAA;AACrCU,QAAAA,KAAAA,EAAOF,YAAYF,SAAAA,GAAY;AAACH,YAAAA;SAAM,GAAG;AAACK,YAAAA,OAAAA;AAASL,YAAAA;AAAM,SAAA;AACzDQ,QAAAA,WAAAA,EAAaV,QAAQI,IAAI;QACzBO,OAAAA,EAASX,OAAAA,CAAQY,MAAM,KAAKP,SAAAA;AAC5BQ,QAAAA,YAAAA,EAAcC,gBAAgBd,OAAAA,EAASC,IAAAA;AAC3C,KAAA;AACJ;AAEA,SAASa,eAAAA,CAAgBd,OAAuB,EAAEC,IAAiB,EAAA;IAC/D,IAAID,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,EAAW;QAC5B,OAAO,YAAA;AACX,IAAA;IAEA,OAAOL,OAAAA,CAAQY,MAAM,KAAKP,SAAAA,GAAY,CAAC,GAAG,EAAEJ,IAAAA,CAAK,eAAe,EAAED,OAAAA,CAAQI,IAAI,CAAA,CAAE,GAAG,CAAC,SAAS,EAAEH,KAAK,CAAC,EAAED,OAAAA,CAAQI,IAAI,CAAA,CAAE;AACzH;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanizeBindingName.js","sources":["../../../header/humanizeBindingName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Reads an Arc binding name as a sentence: `AllInvoices` becomes `All invoices`.\n *\n * Arc proxy names are the C# artifact names - a `[ReadModel]`'s static query method, a `[Command]` record -\n * so they arrive in PascalCase and describe exactly what the page is about. Using them as the fallback\n * heading means a page template is legible before anyone has written a title, and the heading a designer\n * sees at design time is the one the backend actually named.\n *\n * Only the boundary between a lowercase or numeric character and an uppercase one is treated as a word\n * break, so a run of capitals stays together: `AllPIIRecords` reads as `All PIIRecords` rather than being\n * chopped into initials. That is the right trade - a wrong word break in an acronym is much more jarring\n * than a missing one. For the same reason a word is only lowered when it looks like an ordinary\n * capitalized word, so an acronym keeps its shape instead of being flattened into `piirecords`.\n *\n * @param name The binding name as a screen wrote it.\n * @returns The name as a sentence, with only the first word capitalized.\n */\nexport function humanizeBindingName(name: string): string {\n const words = name\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .split(/\\s+/)\n .filter(word => word.length > 0);\n\n if (words.length === 0) {\n return name;\n }\n\n return [words[0], ...words.slice(1).map(lowered)].join(' ');\n}\n\nfunction lowered(word: string): string {\n return /^[A-Z][a-z]/.test(word) ? `${word[0].toLowerCase()}${word.slice(1)}` : word;\n}\n"],"names":["humanizeBindingName","name","words","replace","split","filter","word","length","slice","map","lowered","join","test","toLowerCase"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;IAiBO,SAASA,mBAAAA,CAAoBC,IAAY,EAAA;AAC5C,IAAA,MAAMC,KAAAA,GAAQD,IAAAA,CACTE,OAAO,CAAC,sBAAsB,OAAA,CAAA,CAC9BC,KAAK,CAAC,KAAA,CAAA,CACNC,MAAM,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,MAAM,GAAG,CAAA,CAAA;IAElC,IAAIL,KAAAA,CAAMK,MAAM,KAAK,CAAA,EAAG;QACpB,OAAON,IAAAA;AACX,IAAA;IAEA,OAAO;AAACC,QAAAA,KAAK,CAAC,CAAA,CAAE;AAAKA,QAAAA,GAAAA,KAAAA,CAAMM,KAAK,CAAC,CAAA,CAAA,CAAGC,GAAG,CAACC,OAAAA;AAAS,KAAA,CAACC,IAAI,CAAC,GAAA,CAAA;AAC3D;AAEA,SAASD,QAAQJ,IAAY,EAAA;AACzB,IAAA,OAAO,aAAA,CAAcM,IAAI,CAACN,IAAAA,CAAAA,GAAQ,GAAGA,IAAI,CAAC,CAAA,CAAE,CAACO,WAAW,EAAA,CAAA,EAAKP,IAAAA,CAAKE,KAAK,CAAC,IAAI,GAAGF,IAAAA;AACnF
|
|
1
|
+
{"version":3,"file":"humanizeBindingName.js","sources":["../../../header/humanizeBindingName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Reads an Arc binding name as a sentence: `AllInvoices` becomes `All invoices`.\n *\n * Arc proxy names are the C# artifact names - a `[ReadModel]`'s static query method, a `[Command]` record -\n * so they arrive in PascalCase and describe exactly what the page is about. Using them as the fallback\n * heading means a page template is legible before anyone has written a title, and the heading a designer\n * sees at design time is the one the backend actually named.\n *\n * Only the boundary between a lowercase or numeric character and an uppercase one is treated as a word\n * break, so a run of capitals stays together: `AllPIIRecords` reads as `All PIIRecords` rather than being\n * chopped into initials. That is the right trade - a wrong word break in an acronym is much more jarring\n * than a missing one. For the same reason a word is only lowered when it looks like an ordinary\n * capitalized word, so an acronym keeps its shape instead of being flattened into `piirecords`.\n *\n * @param name The binding name as a screen wrote it.\n * @returns The name as a sentence, with only the first word capitalized.\n */\nexport function humanizeBindingName(name: string): string {\n const words = name\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .split(/\\s+/)\n .filter(word => word.length > 0);\n\n if (words.length === 0) {\n return name;\n }\n\n return [words[0], ...words.slice(1).map(lowered)].join(' ');\n}\n\nfunction lowered(word: string): string {\n return /^[A-Z][a-z]/.test(word) ? `${word[0].toLowerCase()}${word.slice(1)}` : word;\n}\n"],"names":["humanizeBindingName","name","words","replace","split","filter","word","length","slice","map","lowered","join","test","toLowerCase"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;IAiBO,SAASA,mBAAAA,CAAoBC,IAAY,EAAA;AAC5C,IAAA,MAAMC,KAAAA,GAAQD,IAAAA,CACTE,OAAO,CAAC,sBAAsB,OAAA,CAAA,CAC9BC,KAAK,CAAC,KAAA,CAAA,CACNC,MAAM,CAACC,CAAAA,IAAAA,GAAQA,IAAAA,CAAKC,MAAM,GAAG,CAAA,CAAA;IAElC,IAAIL,KAAAA,CAAMK,MAAM,KAAK,CAAA,EAAG;QACpB,OAAON,IAAAA;AACX,IAAA;IAEA,OAAO;AAACC,QAAAA,KAAK,CAAC,CAAA,CAAE;AAAKA,QAAAA,GAAAA,KAAAA,CAAMM,KAAK,CAAC,CAAA,CAAA,CAAGC,GAAG,CAACC,OAAAA;AAAS,KAAA,CAACC,IAAI,CAAC,GAAA,CAAA;AAC3D;AAEA,SAASD,QAAQJ,IAAY,EAAA;AACzB,IAAA,OAAO,aAAA,CAAcM,IAAI,CAACN,IAAAA,CAAAA,GAAQ,GAAGA,IAAI,CAAC,CAAA,CAAE,CAACO,WAAW,EAAA,CAAA,EAAKP,IAAAA,CAAKE,KAAK,CAAC,IAAI,GAAGF,IAAAA;AACnF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The name this blueprint is known by inside a `ui profile`.\n *\n * It is not the npm package name: a profile lists Scene package names, a `PackageDependency` refers to\n * one, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own\n * rather than inside the manifest, so the registry can key off it without importing the manifest that\n * describes the registry.\n */\nexport const componentsBlueprintName = 'Cratis.Blueprint.Components';\n"],"names":["componentsBlueprintName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,MAAMA,uBAAAA,GAA0B
|
|
1
|
+
{"version":3,"file":"packageName.js","sources":["../../packageName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The name this blueprint is known by inside a `ui profile`.\n *\n * It is not the npm package name: a profile lists Scene package names, a `PackageDependency` refers to\n * one, and `componentRegistryKey` builds every registry key from this. It therefore lives on its own\n * rather than inside the manifest, so the registry can key off it without importing the manifest that\n * describes the registry.\n */\nexport const componentsBlueprintName = 'Cratis.Blueprint.Components';\n"],"names":["componentsBlueprintName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;IAQO,MAAMA,uBAAAA,GAA0B;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SampleBindingName.js","sources":["../../../templates/SampleBindingName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The Arc query and command names this blueprint's templates ship bound to.\n *\n * A template carries a binding *name*, never a class - the binding registry in `@cratis/scene.components`\n * is what turns a name into the generated proxy at render time, and only a host owns those proxies. So a\n * template has to write some name, and these are the ones it writes.\n *\n * They are defaults, not fixtures. An application picking `DataListPage` replaces `AllInvoices` with its\n * own query and the page is done; nothing else about the template changes. Shipping a template with no\n * name at all would have been the alternative, and it is a worse one - it renders as a diagram of a page\n * rather than a page, and the thing a template most needs to prove is that it composes into something\n * real.\n *\n * The names are deliberately in the shape Arc generates: a `[ReadModel]`'s static query method\n * (`AllInvoices`), and a `[Command]` record (`RegisterInvoice`). A designer reading a preview should\n * recognize them as the artifacts they would really be wiring.\n *\n * This is an enum of *this package's defaults*, not of every name a binding may take. The element builders\n * therefore take a plain `string`, so an application can point the same builders at `AllPurchaseOrders`\n * without having to widen anything - the set of Arc proxies in an application is open, and a closed type\n * over it would make these builders usable only for the invoices they ship bound to.\n */\nexport enum SampleBindingName {\n /** Every invoice - the snapshot query a list page reads. */\n AllInvoices = 'AllInvoices',\n\n /** Invoices still being processed - an observable query, so the page is live. */\n InvoicesInFlight = 'InvoicesInFlight',\n\n /** One invoice by its id - what a detail region reads. */\n InvoiceById = 'InvoiceById',\n\n /** Revenue aggregated by month - a dashboard widget's query. */\n RevenueByMonth = 'RevenueByMonth',\n\n /** Open support tickets - a second dashboard widget's query. */\n OpenTickets = 'OpenTickets',\n\n /** Every adjustment recorded against an invoice. */\n AllAdjustments = 'AllAdjustments',\n\n /** Registers a new invoice - the command a form page submits. */\n RegisterInvoice = 'RegisterInvoice',\n\n /** Records an adjustment against an invoice - the command a dialog submits. */\n RecordAdjustment = 'RecordAdjustment',\n}\n"],"names":["SampleBindingName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;IAsBO,IAAKA,iBAAAA,iBAAAA,SAAAA,iBAAAA,EAAAA;iEACkD,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;sFAGqB,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;+DAGvB,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;qEAGM,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;qEAGA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;yDAGZ,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;sEAGa,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;oFAGc,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AAtBrEA,IAAAA,OAAAA,iBAAAA;AAwBX,CAAA,CAAA,EAAA
|
|
1
|
+
{"version":3,"file":"SampleBindingName.js","sources":["../../../templates/SampleBindingName.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * The Arc query and command names this blueprint's templates ship bound to.\n *\n * A template carries a binding *name*, never a class - the binding registry in `@cratis/scene.components`\n * is what turns a name into the generated proxy at render time, and only a host owns those proxies. So a\n * template has to write some name, and these are the ones it writes.\n *\n * They are defaults, not fixtures. An application picking `DataListPage` replaces `AllInvoices` with its\n * own query and the page is done; nothing else about the template changes. Shipping a template with no\n * name at all would have been the alternative, and it is a worse one - it renders as a diagram of a page\n * rather than a page, and the thing a template most needs to prove is that it composes into something\n * real.\n *\n * The names are deliberately in the shape Arc generates: a `[ReadModel]`'s static query method\n * (`AllInvoices`), and a `[Command]` record (`RegisterInvoice`). A designer reading a preview should\n * recognize them as the artifacts they would really be wiring.\n *\n * This is an enum of *this package's defaults*, not of every name a binding may take. The element builders\n * therefore take a plain `string`, so an application can point the same builders at `AllPurchaseOrders`\n * without having to widen anything - the set of Arc proxies in an application is open, and a closed type\n * over it would make these builders usable only for the invoices they ship bound to.\n */\nexport enum SampleBindingName {\n /** Every invoice - the snapshot query a list page reads. */\n AllInvoices = 'AllInvoices',\n\n /** Invoices still being processed - an observable query, so the page is live. */\n InvoicesInFlight = 'InvoicesInFlight',\n\n /** One invoice by its id - what a detail region reads. */\n InvoiceById = 'InvoiceById',\n\n /** Revenue aggregated by month - a dashboard widget's query. */\n RevenueByMonth = 'RevenueByMonth',\n\n /** Open support tickets - a second dashboard widget's query. */\n OpenTickets = 'OpenTickets',\n\n /** Every adjustment recorded against an invoice. */\n AllAdjustments = 'AllAdjustments',\n\n /** Registers a new invoice - the command a form page submits. */\n RegisterInvoice = 'RegisterInvoice',\n\n /** Records an adjustment against an invoice - the command a dialog submits. */\n RecordAdjustment = 'RecordAdjustment',\n}\n"],"names":["SampleBindingName"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;;;;;;;;;;;;;;IAsBO,IAAKA,iBAAAA,iBAAAA,SAAAA,iBAAAA,EAAAA;iEACkD,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;sFAGqB,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;+DAGvB,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;qEAGM,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;qEAGA,iBAAA,CAAA,aAAA,CAAA,GAAA,aAAA;yDAGZ,iBAAA,CAAA,gBAAA,CAAA,GAAA,gBAAA;sEAGa,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAA;oFAGc,iBAAA,CAAA,kBAAA,CAAA,GAAA,kBAAA;AAtBrEA,IAAAA,OAAAA,iBAAAA;AAwBX,CAAA,CAAA,EAAA;;"}
|
|
@@ -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 } 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 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","displayName","description","commandTemplates"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,yCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,yCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,yCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,8BAAAA,CAAO;AAACC,YAAAA,gCAAAA,CAASP,yCAAiBC,MAAM,CAAA;YAAGM,gCAAAA,CAASP,wCAAAA,CAAiBE,IAAI,EAAE;gBAAEM,IAAAA,EAAM;AAAE,aAAA,CAAA;AAAID,YAAAA,gCAAAA,CAASP,yCAAiBG,OAAO;SAAE,EAAE,EAAA;AACxI,KAAA;IACAM,OAAAA,EAAS;QACL,CAACT,wCAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,sBAAAA,CAAc,qBAAA,EAAuB;gBACjCC,KAAAA,EAAO,qBAAA;gBACPC,QAAAA,EAAU,gFAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,OAAAA,EAASC,oCAAkBC;AAC/B,aAAA;AACH,SAAA;QACD,CAAChB,wCAAAA,CAAiBE,IAAI,GAAG;AAACe,YAAAA,aAAAA,CAAK,qBAAqB,EAAA,EAAI;gBAACC,wBAAAA,CAAY,cAAA,EAAgBH,mCAAAA,CAAkBC,eAAe,EAAE;AAAC,oBAAA;AAAY,iBAAA;AAAE,aAAA;AAAE,SAAA;QACzI,CAAChB,wCAAAA,CAAiBG,OAAO,GAAG;AACxBgB,YAAAA,gBAAAA,CAAQ,sBAAA,EAAwB;gBAC5BC,sBAAAA,CAAc,qBAAA,EAAuB,wBAAwB,aAAA,EAAe,UAAA,CAAA;gBAC5EC,yBAAAA,CAAiB,wBAAA,CAAA;gBACjBD,sBAAAA,CAAc,qBAAA,EAAuB,uBAAuB,aAAA,EAAe,QAAA;AAC9E,aAAA;AACJ;AACL,KAAA;IACAE,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qCACO,MAAMC,gBAAAA,GAAqC;AAAC9B,IAAAA
|
|
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 } 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 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","displayName","description","commandTemplates"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,Y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EAAa;AACjB;AAEA,qCACO,MAAMC,gBAAAA,GAAqC;AAAC9B,IAAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataElements.js","sources":["../../../templates/dataElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { BorrowedComponentName } from '../BorrowedComponentName';\nimport { CompositeName } from '../CompositeName';\nimport { ColumnDefinition } from './ColumnDefinition';\nimport { TableOptions } from './TableOptions';\n\n/**\n * The Arc-bound data elements this blueprint's templates are built from.\n *\n * Each one is a single `ExternalComponent` carrying a query *name* in its property bag, which is the whole\n * contract: `resolveElementBinding` in `@cratis/scene.components` reads that name out at render time and\n * looks it up in the binding registry, and a name nothing is registered under renders as a placeholder\n * naming what it wanted. Nothing here invents a second way to reach a backend, because there is only one\n * and it belongs to the component library.\n */\n\n/**\n * The columns of a data table, as the `content` slot children the library's tables take.\n *\n * The name is PrimeReact's rather than `Cratis.Components`' - see {@link BorrowedComponentName.Column} for\n * why - and `sortable` is set on every column because a table that performs a real query can sort against\n * the server, and a column that quietly cannot is the more surprising default.\n */\nexport function columns(id: string, definitions: ColumnDefinition[]): SceneElement[] {\n return definitions.map(definition =>\n externalComponent(`${id}-${definition.field}`, BorrowedComponentName.Column, {\n field: definition.field,\n header: definition.header,\n sortable: true,\n }),\n );\n}\n\n/**\n * A `dataPage` - the library's whole list-screen composite, driven from one query.\n *\n * This is the archetype the package exists for. Reproducing it out of a table, a toolbar and a filter in a\n * screen would be pages of modeling for a worse result, and every one of those pages would then be an\n * application's to maintain. Here it is one element with a name in it.\n *\n * Its own `title` is deliberately empty. Every template in this package opens with an `arcPageHeader`, and\n * that header already states the page's name, its trail and what it is bound to; letting the composite\n * print the same word again directly underneath would be two sources for one fact, and they would\n * disagree the first time either changed.\n */\nexport function dataPage(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.DataPage, { query, title: '', ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/**\n * A `dataTable` - the same server-side querying without the page chrome around it.\n *\n * Used where a template already has a header of its own and only needs the rows, which is most places a\n * table appears inside a larger page.\n */\nexport function dataTable(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.DataTable, { query, ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/**\n * An `observableDataTable` - the live variant.\n *\n * A separate element rather than a flag, because the difference is in the *proxy* a host registers: an\n * observable query opens a subscription and re-renders when the read model changes, and a plain one does\n * not. A template that names an observable query is stating that its data is live, which is a design\n * decision worth being able to read off the page.\n */\nexport function observableDataTable(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.ObservableDataTable, { query, ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/** The columns of the invoice list every list-shaped template in this package shows. */\nexport const invoiceColumns: ColumnDefinition[] = [\n { field: 'number', header: 'Number' },\n { field: 'customer', header: 'Customer' },\n { field: 'issued', header: 'Issued' },\n { field: 'amount', header: 'Amount' },\n { field: 'status', header: 'Status' },\n];\n\n/** The columns of the adjustment list, for the templates that show one. */\nexport const adjustmentColumns: ColumnDefinition[] = [\n { field: 'recorded', header: 'Recorded' },\n { field: 'reason', header: 'Reason' },\n { field: 'amount', header: 'Amount' },\n];\n\n/** The table options an invoice list uses, so eight templates cannot disagree about the empty message. */\nexport const invoiceTableOptions: TableOptions = {\n emptyMessage: 'No invoices yet',\n dataKey: 'invoiceId',\n globalFilterFields: ['number', 'customer', 'status'],\n};\n"],"names":["columns","id","definitions","map","definition","externalComponent","field","BorrowedComponentName","Column","header","sortable","dataPage","query","options","CompositeName","DataPage","title","content","dataTable","DataTable","observableDataTable","ObservableDataTable","invoiceColumns","adjustmentColumns","invoiceTableOptions","emptyMessage","dataKey","globalF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+B,EAAA;AACjH,IAAA,OAAOG,yCAAAA,CAAkBJ,EAAAA,EAAIa,2BAAAA,CAAcO,mBAAmB,EAAE;AAAET,QAAAA,KAAAA;AAAO,QAAA,GAAGC;KAAQ,EAAG;AAAEI,QAAAA,OAAAA,EAASjB,OAAAA,CAAQ,CAAA,EAAGC,EAAAA,CAAG,OAAO,CAAC,EAAEC,WAAAA;AAAa,KAAA,CAAA;AAC3I;AAEA,yFACO,MAAMoB,cAAAA,GAAqC;AAC9C,IAAA;QAAEhB,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,UAAA;QAAYG,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS;;AAGxC,4EACO,MAAMc,iBAAAA,GAAwC;AACjD,IAAA;QAAEjB,KAAAA,EAAO,UAAA;QAAYG,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS;;AAGxC,2GACO,MAAMe,mBAAAA,GAAoC;IAC7CC,YAAAA,EAAc,iBAAA;IACdC,OAAAA,EAAS,WAAA;IACTC,kBAAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,UAAA;AAAY,QAAA;AAAS;AACxD
|
|
1
|
+
{"version":3,"file":"dataElements.js","sources":["../../../templates/dataElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { BorrowedComponentName } from '../BorrowedComponentName';\nimport { CompositeName } from '../CompositeName';\nimport { ColumnDefinition } from './ColumnDefinition';\nimport { TableOptions } from './TableOptions';\n\n/**\n * The Arc-bound data elements this blueprint's templates are built from.\n *\n * Each one is a single `ExternalComponent` carrying a query *name* in its property bag, which is the whole\n * contract: `resolveElementBinding` in `@cratis/scene.components` reads that name out at render time and\n * looks it up in the binding registry, and a name nothing is registered under renders as a placeholder\n * naming what it wanted. Nothing here invents a second way to reach a backend, because there is only one\n * and it belongs to the component library.\n */\n\n/**\n * The columns of a data table, as the `content` slot children the library's tables take.\n *\n * The name is PrimeReact's rather than `Cratis.Components`' - see {@link BorrowedComponentName.Column} for\n * why - and `sortable` is set on every column because a table that performs a real query can sort against\n * the server, and a column that quietly cannot is the more surprising default.\n */\nexport function columns(id: string, definitions: ColumnDefinition[]): SceneElement[] {\n return definitions.map(definition =>\n externalComponent(`${id}-${definition.field}`, BorrowedComponentName.Column, {\n field: definition.field,\n header: definition.header,\n sortable: true,\n }),\n );\n}\n\n/**\n * A `dataPage` - the library's whole list-screen composite, driven from one query.\n *\n * This is the archetype the package exists for. Reproducing it out of a table, a toolbar and a filter in a\n * screen would be pages of modeling for a worse result, and every one of those pages would then be an\n * application's to maintain. Here it is one element with a name in it.\n *\n * Its own `title` is deliberately empty. Every template in this package opens with an `arcPageHeader`, and\n * that header already states the page's name, its trail and what it is bound to; letting the composite\n * print the same word again directly underneath would be two sources for one fact, and they would\n * disagree the first time either changed.\n */\nexport function dataPage(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.DataPage, { query, title: '', ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/**\n * A `dataTable` - the same server-side querying without the page chrome around it.\n *\n * Used where a template already has a header of its own and only needs the rows, which is most places a\n * table appears inside a larger page.\n */\nexport function dataTable(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.DataTable, { query, ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/**\n * An `observableDataTable` - the live variant.\n *\n * A separate element rather than a flag, because the difference is in the *proxy* a host registers: an\n * observable query opens a subscription and re-renders when the read model changes, and a plain one does\n * not. A template that names an observable query is stating that its data is live, which is a design\n * decision worth being able to read off the page.\n */\nexport function observableDataTable(id: string, query: string, options: TableOptions, definitions: ColumnDefinition[]): SceneElement {\n return externalComponent(id, CompositeName.ObservableDataTable, { query, ...options }, { content: columns(`${id}-column`, definitions) });\n}\n\n/** The columns of the invoice list every list-shaped template in this package shows. */\nexport const invoiceColumns: ColumnDefinition[] = [\n { field: 'number', header: 'Number' },\n { field: 'customer', header: 'Customer' },\n { field: 'issued', header: 'Issued' },\n { field: 'amount', header: 'Amount' },\n { field: 'status', header: 'Status' },\n];\n\n/** The columns of the adjustment list, for the templates that show one. */\nexport const adjustmentColumns: ColumnDefinition[] = [\n { field: 'recorded', header: 'Recorded' },\n { field: 'reason', header: 'Reason' },\n { field: 'amount', header: 'Amount' },\n];\n\n/** The table options an invoice list uses, so eight templates cannot disagree about the empty message. */\nexport const invoiceTableOptions: TableOptions = {\n emptyMessage: 'No invoices yet',\n dataKey: 'invoiceId',\n globalFilterFields: ['number', 'customer', 'status'],\n};\n"],"names":["columns","id","definitions","map","definition","externalComponent","field","BorrowedComponentName","Column","header","sortable","dataPage","query","options","CompositeName","DataPage","title","content","dataTable","DataTable","observableDataTable","ObservableDataTable","invoiceColumns","adjustmentColumns","invoiceTableOptions","emptyMessage","dataKey","globalFilterFields"],"mappings":";;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;AAgBC,IACM,SAASA,OAAAA,CAAQC,EAAU,EAAEC,WAA+B,EAAA;AAC/D,IAAA,OAAOA,YAAYC,GAAG,CAACC,CAAAA,UAAAA,GACnBC,0CAAkB,CAAA,EAAGJ,EAAAA,CAAG,CAAC,EAAEG,WAAWE,KAAK,CAAA,CA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Aa,KAAA,CAAA;AAC3I;AAEA,yFACO,MAAMoB,cAAAA,GAAqC;AAC9C,IAAA;QAAEhB,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,UAAA;QAAYG,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS;;AAGxC,4EACO,MAAMc,iBAAAA,GAAwC;AACjD,IAAA;QAAEjB,KAAAA,EAAO,UAAA;QAAYG,MAAAA,EAAQ;AAAW,KAAA;AACxC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS,KAAA;AACpC,IAAA;QAAEH,KAAAA,EAAO,QAAA;QAAUG,MAAAA,EAAQ;AAAS;;AAGxC,2GACO,MAAMe,mBAAAA,GAAoC;IAC7CC,YAAAA,EAAc,iBAAA;IACdC,OAAAA,EAAS,WAAA;IACTC,kBAAAA,EAAoB;AAAC,QAAA,QAAA;AAAU,QAAA,UAAA;AAAY,QAAA;AAAS;AACxD;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialogElements.js","sources":["../../../templates/dialogElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { CompositeName } from '../CompositeName';\n\n/**\n * The dialog elements this blueprint's dialog templates are built from.\n *\n * Each is a whole dialog rather than a piece of one, and that is why this package's dialog templates look\n * so different from the default blueprint's. The default blueprint composes a dialog out of primitives - a\n * title, a message, a row of buttons - because it has nothing better available. Here the library ships\n * dialogs that resolve their result through Arc's dialog context, so the frame, the buttons and the\n * protocol behind them all belong to the composite. A template's job is to configure one, not to rebuild it.\n */\n\n/**\n * The Arc-aware dialog: a frame whose result resolves through Arc's dialog context.\n *\n * Worth shadowing PrimeReact's `dialog` for. PrimeReact's is a modal frame and nothing more; this one lets\n * a caller `await` a `DialogResult` instead of threading `visible` state and callbacks by hand, which is\n * the difference between a dialog you can call and a dialog you have to wire.\n *\n * `visible` is left at the adapter's default of `true`, because a dialog placed in a template is placed to\n * be seen; a host that drives visibility sets the property itself.\n */\nexport function dialog(id: string, title: string, okLabel: string, cancelLabel: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.Dialog, { title, okLabel, cancelLabel, width: '28rem' }, { content });\n}\n\n/**\n * A dialog whose confirm button *is* the command's execution.\n *\n * Worth using instead of composing `dialog` with `commandForm`, because a hand-composed pair has no way to\n * keep the dialog open on a rejected command without reimplementing the protocol: this one submits, feeds\n * the backend's validation results back onto the fields, and only closes when the command succeeded.\n */\nexport function commandDialog(id: string, command: string, title: string, okLabel: string, fields: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.CommandDialog, { command, title, okLabel, cancelLabel: 'Cancel', width: '32rem' }, { content: fields });\n}\n\n/**\n * The blocking spinner shown while a long-running command is in flight.\n *\n * In a running application it is the Arc dialog host that renders this, threading its own title and\n * message through. Shipping it as a template is what lets its wording and placement be *designed* rather\n * than discovered the first time an operation takes a while - which is the only moment anyone ever sees it,\n * and the worst moment to be reading a sentence nobody wrote on purpose.\n */\nexport function busyIndicatorDialog(id: string, title: string, message: string): SceneElement {\n return externalComponent(id, CompositeName.BusyIndicatorDialog, { title, message });\n}\n"],"names":["dialog","id","title","okLabel","cancelLabel","content","externalComponent","CompositeName","Dialog","width","commandDialog","command","fields","CommandDialog","busyIndicatorDialog","message","BusyIndicatorDialog"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;IAoBO,SAASA,MAAAA,CAAOC,EAAU,EAAEC,KAAa,EAAEC,OAAe,EAAEC,WAAmB,EAAEC,OAAuB,EAAA;AAC3G,IAAA,OAAOC,yCAAAA,CAAkBL,EAAAA,EAAIM,2BAAAA,CAAcC,MAAM,EAAE;AAAEN,QAAAA,KAAAA;AAAOC,QAAAA,OAAAA;AAASC,QAAAA,WAAAA;QAAaK,KAAAA,EAAO;KAAQ,EAAG;AAAEJ,QAAAA;AAAQ,KAAA,CAAA;AAClH;AAEA;;;;;;IAOO,SAASK,aAAAA,CAAcT,EAAU,EAAEU,OAAe,EAAET,KAAa,EAAEC,OAAe,EAAES,MAAsB,EAAA;AAC7G,IAAA,OAAON,yCAAAA,CAAkBL,EAAAA,EAAIM,2BAAAA,CAAcM,aAAa,EAAE;AAAEF,QAAAA,OAAAA;AAAST,QAAAA,KAAAA;AAAOC,QAAAA,OAAAA;QAASC,WAAAA,EAAa,QAAA;QAAUK,KAAAA,EAAO;KAAQ,EAAG;QAAEJ,OAAAA,EAASO;AAAO,KAAA,CAAA;AACpJ;AAEA;;;;;;;AAOC,IACM,SAASE,mBAAAA,CAAoBb,EAAU,EAAEC,KAAa,EAAEa,OAAe,EAAA;AAC1E,IAAA,OAAOT,yCAAAA,CAAkBL,EAAAA,EAAIM,2BAAAA,CAAcS,mBAAmB,EAAE;AAAEd,QAAAA,KAAAA;AAAOa,QAAAA;AAAQ,KAAA,CAAA;AACrF
|
|
1
|
+
{"version":3,"file":"dialogElements.js","sources":["../../../templates/dialogElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { CompositeName } from '../CompositeName';\n\n/**\n * The dialog elements this blueprint's dialog templates are built from.\n *\n * Each is a whole dialog rather than a piece of one, and that is why this package's dialog templates look\n * so different from the default blueprint's. The default blueprint composes a dialog out of primitives - a\n * title, a message, a row of buttons - because it has nothing better available. Here the library ships\n * dialogs that resolve their result through Arc's dialog context, so the frame, the buttons and the\n * protocol behind them all belong to the composite. A template's job is to configure one, not to rebuild it.\n */\n\n/**\n * The Arc-aware dialog: a frame whose result resolves through Arc's dialog context.\n *\n * Worth shadowing PrimeReact's `dialog` for. PrimeReact's is a modal frame and nothing more; this one lets\n * a caller `await` a `DialogResult` instead of threading `visible` state and callbacks by hand, which is\n * the difference between a dialog you can call and a dialog you have to wire.\n *\n * `visible` is left at the adapter's default of `true`, because a dialog placed in a template is placed to\n * be seen; a host that drives visibility sets the property itself.\n */\nexport function dialog(id: string, title: string, okLabel: string, cancelLabel: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.Dialog, { title, okLabel, cancelLabel, width: '28rem' }, { content });\n}\n\n/**\n * A dialog whose confirm button *is* the command's execution.\n *\n * Worth using instead of composing `dialog` with `commandForm`, because a hand-composed pair has no way to\n * keep the dialog open on a rejected command without reimplementing the protocol: this one submits, feeds\n * the backend's validation results back onto the fields, and only closes when the command succeeded.\n */\nexport function commandDialog(id: string, command: string, title: string, okLabel: string, fields: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.CommandDialog, { command, title, okLabel, cancelLabel: 'Cancel', width: '32rem' }, { content: fields });\n}\n\n/**\n * The blocking spinner shown while a long-running command is in flight.\n *\n * In a running application it is the Arc dialog host that renders this, threading its own title and\n * message through. Shipping it as a template is what lets its wording and placement be *designed* rather\n * than discovered the first time an operation takes a while - which is the only moment anyone ever sees it,\n * and the worst moment to be reading a sentence nobody wrote on purpose.\n */\nexport function busyIndicatorDialog(id: string, title: string, message: string): SceneElement {\n return externalComponent(id, CompositeName.BusyIndicatorDialog, { title, message });\n}\n"],"names":["dialog","id","title","okLabel","cancelLabel","content","externalComponent","CompositeName","Dialog","width","commandDialog","command","fields","CommandDialog","busyIndicatorDialog","message","BusyIndicatorDialog"],"mappings":";;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;IAoBO,SAASA,MAAAA,CAAOC,EAAU,EAAEC,KAAa,EAAEC,OAAe,EAAEC,WAAmB,EAAEC,OAAuB,EAAA;AAC3G,IAAA,OAAOC,yCAAAA,CAAkBL,EAAAA,EAAIM,2BAAAA,CAAcC,MAAM,EAAE;AAAEN,QAAAA,KAAAA;AAAOC,QAAAA,OAAAA;AAASC,QAAAA,WAAAA;QAAaK,KAAAA,EAAO;KAAQ,EAAG;AAAEJ,QAAAA;AAAQ,KAAA,CAAA;AAClH;AAEA;;;;;;IAOO,SAASK,aAAAA,CAAcT,EAAU,EAAEU,OAAe,EAAET,KAAa,EAAEC,OAAe,EAAES,MAAsB,EAAA;AAC7G,IAAA,OAAON,yCAAAA,CAAkBL,EAAAA,EAAIM,2BAAAA,CAAcM,aAAa,EAAE;AAAEF,QAAAA,OAAAA;AAAST,QAAAA,KAAAA;AAAOC,QAAAA,OAAAA;QAASC,WAAAA,EAAa,QAAA;QAAUK,KAAAA,EAAO;KAAQ,EAAG;QAAEJ,OAAAA,EAASO;AAAO,KAAA,CAAA;AACpJ;AAEA;;;;;;;AAOC,IACM,SAASE,mBAAAA,CAAoBb,EAAU,EAAEC,KAAa,EAAEa,OAAe,EAAA;AAC1E,IAAA,OAAOT,yCAAAA,CAAkBL,EAAAA,EAAIM,2BAAAA,CAAcS,mBAAmB,EAAE;AAAEd,QAAAA,KAAAA;AAAOa,QAAAA;AAAQ,KAAA,CAAA;AACrF;;;;"}
|
|
@@ -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","components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IAC9CjB,IAAAA,EAAM,YAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,yCAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,wCAAAA,CAAiBC,IAAI,GAAG;AACrBe,YAAAA,kCAAAA,CAAoB,eAAe,0BAAA,EAA4B,iEAAA;AAClE;AACL,KAAA;IACAN,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qDACO,MAAMM,yBAAAA,GAA8C;AAACpB,IAAAA,qBAAAA;AAAuBe,IAAAA,qBAAAA;AAAuBG,IAAAA
|
|
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":";;;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BaA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,yCAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,wCAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,4BAAAA,CAAc,gBAAA,EAAkBC,mCAAAA,CAAkBC,gBAAgB,EAAE,wBAAwB,QAAA,EAAU;AAClGC,gBAAAA,wBAAAA,CAAY,yBAAyB,QAAA,EAAU,QAAA,CAAA;gBAC/CC,2BAAAA,CAAe,uBAAA,EAAyB,UAAU,QAAA,EAAU,eAAA,CAAA;AAC5DC,gBAAAA,0BAAAA,CAAc,4BAA4B,WAAA,EAAa,gBAAA,CAAA;gBACvDC,0BAAAA,CAAc,qBAAA,EAAuB,QAAQ,MAAA,EAAQ,CAAA;AACxD,aAAA;AACJ;AACL,KAAA;IACAC,WAAAA,EAAa,gBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;;;;;;UAWaC,qBAAAA,GAAwC;IACjDd,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,yCAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,wCAAAA,CAAiBC,IAAI,GAAG;YACrBY,qBAAAA,CAAO,gBAAA,EAAkB,oBAAA,EAAsB,SAAA,EAAW,SAAA,EAAW;AACjEC,gBAAAA,aAAAA,CAAK,qBAAA,EAAuB,4BAAA,CAAA;gBAC5BP,2BAAAA,CAAe,uBAAA,EAAyB,UAAU,yBAAA,EAA2B,uBAAA;AAChF,aAAA;AACJ;AACL,KAAA;IACAG,WAAAA,EAAa,qBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;;;UAQaI,kBAAAA,GAAqC;IAC9CjB,IAAAA,EAAM,YAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,yCAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,wCAAAA,CAAiBC,IAAI,GAAG;AACrBe,YAAAA,kCAAAA,CAAoB,eAAe,0BAAA,EAA4B,iEAAA;AAClE;AACL,KAAA;IACAN,WAAAA,EAAa,aAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qDACO,MAAMM,yBAAAA,GAA8C;AAACpB,IAAAA,qBAAAA;AAAuBe,IAAAA,qBAAAA;AAAuBG,IAAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorElements.js","sources":["../../../templates/editorElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { CompositeName } from '../CompositeName';\nimport { invoiceDocument, invoiceFilters, invoiceNavigationPath, invoiceSchema, invoiceVersions } from './sampleData';\n\n/**\n * The Arc-free editing and inspection elements this blueprint's templates are built from.\n *\n * Unlike everything else in this package these need no binding at all - they take their content straight\n * out of the property bag - so a template built from them renders as a working page with no host, no\n * proxies and no backend. That is what makes the editor templates the ones to open first when looking at\n * this blueprint.\n */\n\n/**\n * A JSON schema edited as a typed property tree rather than as text.\n *\n * `canEdit` and `canNotEditReason` belong together: in an event-sourced application a schema is very often\n * deliberately read-only, and saying *why* in the same place is what keeps that from looking like a bug.\n */\nexport function schemaEditor(id: string, eventTypeName: string, canEdit: boolean, canNotEditReason?: string): SceneElement {\n return externalComponent(id, CompositeName.SchemaEditor, {\n schema: invoiceSchema,\n eventTypeName,\n canEdit,\n canNotEditReason,\n editMode: canEdit,\n });\n}\n\n/** A document rendered against its schema, so nested values are navigable and each is edited by its declared type. */\nexport function objectContentEditor(id: string, editMode: boolean): SceneElement {\n return externalComponent(id, CompositeName.ObjectContentEditor, { object: invoiceDocument, schema: invoiceSchema, editMode });\n}\n\n/** The trail saying where you are inside a nested document, and the way back out. */\nexport function objectNavigationalBar(id: string): SceneElement {\n return externalComponent(id, CompositeName.ObjectNavigationalBar, { navigationPath: invoiceNavigationPath });\n}\n\n/**\n * The timeline of successive versions.\n *\n * Worth a place on a detail page in a way it would not be in a CRUD application: in an event-sourced\n * system everything *has* a history rather than only a current value, so scrubbing through it is the\n * natural way to look at a record rather than a special feature.\n */\nexport function timeMachine(id: string): SceneElement {\n return externalComponent(id, CompositeName.TimeMachine, { versions: invoiceVersions, currentVersionIndex: 0 });\n}\n\n/**\n * The filter toggle and the panel it anchors, as one element.\n *\n * One element rather than two because `FilterPanel` is a portal anchored to a button - it renders next to\n * whatever opened it, so it cannot be placed on its own, and the element tree has no way to express an\n * anchor relationship. The adapter owns both halves, and a template places one thing.\n */\nexport function filterPanel(id: string, label: string): SceneElement {\n return externalComponent(id, CompositeName.FilterPanel, { label, filters: invoiceFilters, searchPlaceholder: 'Search filters' });\n}\n\n/** A standalone selection control, not bound to a command property. */\nexport function dropdown(id: string, placeholder: string, options: { label: string; value: string }[]): SceneElement {\n return externalComponent(id, CompositeName.Dropdown, { placeholder, options, showClear: true });\n}\n"],"names":["schemaEditor","id","eventTypeName","canEdit","canNotEditReason","externalComponent","CompositeName","SchemaEditor","schema","invoiceSchema","editMode","objectContentEditor","ObjectContentEditor","object","invoiceDocument","objectNavigationalBar","ObjectNavigationalBar","navigationPath","invoiceNavigationPath","timeMachine","TimeMachine","versions","invoiceVersions","currentVersionIndex","filterPanel","label","FilterPanel","filters","invoiceFilters","searchPlaceholder","dropdown","placeholder","options","Dropdown","showClear"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;;;;;IAeO,SAASA,YAAAA,CAAaC,EAAU,EAAEC,aAAqB,EAAEC,OAAgB,EAAEC,gBAAyB,EAAA;AACvG,IAAA,OAAOC,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcC,YAAY,EAAE;QACrDC,MAAAA,EAAQC,wBAAAA;AACRP,QAAAA,aAAAA;AACAC,QAAAA,OAAAA;AACAC,QAAAA,gBAAAA;QACAM,QAAAA,EAAUP;AACd,KAAA,CAAA;AACJ;AAEA,uHACO,SAASQ,mBAAAA,CAAoBV,EAAU,EAAES,QAAiB,EAAA;AAC7D,IAAA,OAAOL,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcM,mBAAmB,EAAE;QAAEC,MAAAA,EAAQC,0BAAAA;QAAiBN,MAAAA,EAAQC,wBAAAA;AAAeC,QAAAA;AAAS,KAAA,CAAA;AAC/H;AAEA,sFACO,SAASK,qBAAAA,CAAsBd,EAAU,EAAA;AAC5C,IAAA,OAAOI,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcU,qBAAqB,EAAE;QAAEC,cAAAA,EAAgBC;AAAsB,KAAA,CAAA;AAC9G;AAEA;;;;;;IAOO,SAASC,WAAAA,CAAYlB,EAAU,EAAA;AAClC,IAAA,OAAOI,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcc,WAAW,EAAE;QAAEC,QAAAA,EAAUC,0BAAAA;QAAiBC,mBAAAA,EAAqB;AAAE,KAAA,CAAA;AAChH;AAEA;;;;;;AAMC,IACM,SAASC,WAAAA,CAAYvB,EAAU,EAAEwB,KAAa,EAAA;AACjD,IAAA,OAAOpB,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcoB,WAAW,EAAE;AAAED,QAAAA,KAAAA;QAAOE,OAAAA,EAASC,yBAAAA;QAAgBC,iBAAAA,EAAmB;AAAiB,KAAA,CAAA;AAClI;AAEA,wEACO,SAASC,QAAAA,CAAS7B,EAAU,EAAE8B,WAAmB,EAAEC,OAA2C,EAAA;AACjG,IAAA,OAAO3B,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAc2B,QAAQ,EAAE;AAAEF,QAAAA,WAAAA;AAAaC,QAAAA,OAAAA;QAASE,SAAAA,EAAW;AAAK,KAAA,CAAA;AACjG
|
|
1
|
+
{"version":3,"file":"editorElements.js","sources":["../../../templates/editorElements.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SceneElement } from '@cratis/scene.model';\nimport { externalComponent } from '@cratis/scene.blueprint.default';\nimport { CompositeName } from '../CompositeName';\nimport { invoiceDocument, invoiceFilters, invoiceNavigationPath, invoiceSchema, invoiceVersions } from './sampleData';\n\n/**\n * The Arc-free editing and inspection elements this blueprint's templates are built from.\n *\n * Unlike everything else in this package these need no binding at all - they take their content straight\n * out of the property bag - so a template built from them renders as a working page with no host, no\n * proxies and no backend. That is what makes the editor templates the ones to open first when looking at\n * this blueprint.\n */\n\n/**\n * A JSON schema edited as a typed property tree rather than as text.\n *\n * `canEdit` and `canNotEditReason` belong together: in an event-sourced application a schema is very often\n * deliberately read-only, and saying *why* in the same place is what keeps that from looking like a bug.\n */\nexport function schemaEditor(id: string, eventTypeName: string, canEdit: boolean, canNotEditReason?: string): SceneElement {\n return externalComponent(id, CompositeName.SchemaEditor, {\n schema: invoiceSchema,\n eventTypeName,\n canEdit,\n canNotEditReason,\n editMode: canEdit,\n });\n}\n\n/** A document rendered against its schema, so nested values are navigable and each is edited by its declared type. */\nexport function objectContentEditor(id: string, editMode: boolean): SceneElement {\n return externalComponent(id, CompositeName.ObjectContentEditor, { object: invoiceDocument, schema: invoiceSchema, editMode });\n}\n\n/** The trail saying where you are inside a nested document, and the way back out. */\nexport function objectNavigationalBar(id: string): SceneElement {\n return externalComponent(id, CompositeName.ObjectNavigationalBar, { navigationPath: invoiceNavigationPath });\n}\n\n/**\n * The timeline of successive versions.\n *\n * Worth a place on a detail page in a way it would not be in a CRUD application: in an event-sourced\n * system everything *has* a history rather than only a current value, so scrubbing through it is the\n * natural way to look at a record rather than a special feature.\n */\nexport function timeMachine(id: string): SceneElement {\n return externalComponent(id, CompositeName.TimeMachine, { versions: invoiceVersions, currentVersionIndex: 0 });\n}\n\n/**\n * The filter toggle and the panel it anchors, as one element.\n *\n * One element rather than two because `FilterPanel` is a portal anchored to a button - it renders next to\n * whatever opened it, so it cannot be placed on its own, and the element tree has no way to express an\n * anchor relationship. The adapter owns both halves, and a template places one thing.\n */\nexport function filterPanel(id: string, label: string): SceneElement {\n return externalComponent(id, CompositeName.FilterPanel, { label, filters: invoiceFilters, searchPlaceholder: 'Search filters' });\n}\n\n/** A standalone selection control, not bound to a command property. */\nexport function dropdown(id: string, placeholder: string, options: { label: string; value: string }[]): SceneElement {\n return externalComponent(id, CompositeName.Dropdown, { placeholder, options, showClear: true });\n}\n"],"names":["schemaEditor","id","eventTypeName","canEdit","canNotEditReason","externalComponent","CompositeName","SchemaEditor","schema","invoiceSchema","editMode","objectContentEditor","ObjectContentEditor","object","invoiceDocument","objectNavigationalBar","ObjectNavigationalBar","navigationPath","invoiceNavigationPath","timeMachine","TimeMachine","versions","invoiceVersions","currentVersionIndex","filterPanel","label","FilterPanel","filters","invoiceFilters","searchPlaceholder","dropdown","placeholder","options","Dropdown","showClear"],"mappings":";;;;;;AAAA;AACA;AAOA;;;;;;;;;;;;IAeO,SAASA,YAAAA,CAAaC,EAAU,EAAEC,aAAqB,EAAEC,OAAgB,EAAEC,gBAAyB,EAAA;AACvG,IAAA,OAAOC,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcC,YAAY,EAAE;QACrDC,MAAAA,EAAQC,wBAAAA;AACRP,QAAAA,aAAAA;AACAC,QAAAA,OAAAA;AACAC,QAAAA,gBAAAA;QACAM,QAAAA,EAAUP;AACd,KAAA,CAAA;AACJ;AAEA,uHACO,SAASQ,mBAAAA,CAAoBV,EAAU,EAAES,QAAiB,EAAA;AAC7D,IAAA,OAAOL,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcM,mBAAmB,EAAE;QAAEC,MAAAA,EAAQC,0BAAAA;QAAiBN,MAAAA,EAAQC,wBAAAA;AAAeC,QAAAA;AAAS,KAAA,CAAA;AAC/H;AAEA,sFACO,SAASK,qBAAAA,CAAsBd,EAAU,EAAA;AAC5C,IAAA,OAAOI,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcU,qBAAqB,EAAE;QAAEC,cAAAA,EAAgBC;AAAsB,KAAA,CAAA;AAC9G;AAEA;;;;;;IAOO,SAASC,WAAAA,CAAYlB,EAAU,EAAA;AAClC,IAAA,OAAOI,yCAAAA,CAAkBJ,EAAAA,EAAIK,2BAAAA,CAAcc,WAAW,EAAE;QAAEC,QAAAA,EAAUC,0BAAAA;QAAiBC,mBAAAA,EAAqB;AAAE,KAAA,CAAA;AAChH;AAEA;;;;;;AAMC,IACM,SA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