@cratis/scene.blueprint.components 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/cjs/BorrowedComponentName.js.map +1 -1
  2. package/dist/cjs/ComponentName.js.map +1 -1
  3. package/dist/cjs/CompositeName.js.map +1 -1
  4. package/dist/cjs/componentsBlueprint.js.map +1 -1
  5. package/dist/cjs/componentsBlueprintComponents.js.map +1 -1
  6. package/dist/cjs/gallery/DialogTemplatePreview.js.map +1 -1
  7. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
  8. package/dist/cjs/gallery/applicationChrome.js.map +1 -1
  9. package/dist/cjs/gallery/navigation.js.map +1 -1
  10. package/dist/cjs/gallery/previewProfile.js.map +1 -1
  11. package/dist/cjs/gallery/screens.js.map +1 -1
  12. package/dist/cjs/header/ArcPageHeader.js.map +1 -1
  13. package/dist/cjs/header/deriveArcHeading.js.map +1 -1
  14. package/dist/cjs/header/humanizeBindingName.js.map +1 -1
  15. package/dist/cjs/packageName.js.map +1 -1
  16. package/dist/cjs/templates/SampleBindingName.js.map +1 -1
  17. package/dist/cjs/templates/commandTemplates.js.map +1 -1
  18. package/dist/cjs/templates/dataElements.js.map +1 -1
  19. package/dist/cjs/templates/dialogElements.js.map +1 -1
  20. package/dist/cjs/templates/dialogTemplates.js.map +1 -1
  21. package/dist/cjs/templates/editorElements.js.map +1 -1
  22. package/dist/cjs/templates/editorTemplates.js.map +1 -1
  23. package/dist/cjs/templates/elements.js.map +1 -1
  24. package/dist/cjs/templates/formElements.js.map +1 -1
  25. package/dist/cjs/templates/listTemplates.js.map +1 -1
  26. package/dist/cjs/templates/nesting.js.map +1 -1
  27. package/dist/cjs/templates/sampleData.js.map +1 -1
  28. package/dist/cjs/templates/screenTemplates.js.map +1 -1
  29. package/dist/cjs/templates/workspaceTemplates.js.map +1 -1
  30. package/dist/esm/BorrowedComponentName.js.map +1 -1
  31. package/dist/esm/ComponentName.js.map +1 -1
  32. package/dist/esm/CompositeName.js.map +1 -1
  33. package/dist/esm/componentsBlueprint.js.map +1 -1
  34. package/dist/esm/componentsBlueprintComponents.js.map +1 -1
  35. package/dist/esm/gallery/DialogTemplatePreview.js.map +1 -1
  36. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
  37. package/dist/esm/gallery/applicationChrome.js.map +1 -1
  38. package/dist/esm/gallery/navigation.js.map +1 -1
  39. package/dist/esm/gallery/previewProfile.js.map +1 -1
  40. package/dist/esm/gallery/screens.js.map +1 -1
  41. package/dist/esm/header/ArcPageHeader.js.map +1 -1
  42. package/dist/esm/header/deriveArcHeading.js.map +1 -1
  43. package/dist/esm/header/humanizeBindingName.js.map +1 -1
  44. package/dist/esm/packageName.js.map +1 -1
  45. package/dist/esm/templates/SampleBindingName.js.map +1 -1
  46. package/dist/esm/templates/commandTemplates.js.map +1 -1
  47. package/dist/esm/templates/dataElements.js.map +1 -1
  48. package/dist/esm/templates/dialogElements.js.map +1 -1
  49. package/dist/esm/templates/dialogTemplates.js.map +1 -1
  50. package/dist/esm/templates/editorElements.js.map +1 -1
  51. package/dist/esm/templates/editorTemplates.js.map +1 -1
  52. package/dist/esm/templates/elements.js.map +1 -1
  53. package/dist/esm/templates/formElements.js.map +1 -1
  54. package/dist/esm/templates/listTemplates.js.map +1 -1
  55. package/dist/esm/templates/nesting.js.map +1 -1
  56. package/dist/esm/templates/sampleData.js.map +1 -1
  57. package/dist/esm/templates/screenTemplates.js.map +1 -1
  58. package/dist/esm/templates/workspaceTemplates.js.map +1 -1
  59. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +20 -20
@@ -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;AAKA;;;;;;;;;;;;UAaaA,2BAAAA,GAAiD;AAC1D,IAAA;QAAEC,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,eAAA;QAAiBC,IAAAA,EAAM,iBAAA;QAAmBC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG,KAAA;AAC1G,IAAA;QAAEJ,KAAAA,EAAO,UAAA;QAAYC,YAAAA,EAAc,cAAA;QAAgBC,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG,KAAA;AACnG,IAAA;QAAEJ,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,wBAAA;QAA0BC,IAAAA,EAAM,YAAA;QAAcC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QAAuBC,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG;;AAG5H;;;;;;UAOaC,iCAAAA,GAAoDN,2BAAAA,CAA4BO,GAAG,CAACC,CAAAA,SAAU;QACvGC,qBAAAA,EAAuBC,2BAAAA;AACvBC,QAAAA,OAAAA,EAASC,iBAAAA,CAAkBJ,KAAAA,CAAAA;AAC3BH,QAAAA,KAAAA,EAAOG,MAAMH;AACjB,KAAA,CAAA;AAEA,sDACO,SAASQ,cAAAA,CAAeT,KAAa,EAAA;AACxC,IAAA,OAAOJ,4BAA4Bc,MAAM,CAACN,CAAAA,KAAAA,GAASA,KAAAA,CAAMJ,KAAK,KAAKA,KAAAA,CAAAA,CAAOW,IAAI,CAAC,CAACC,KAAAA,EAAOC,MAAAA,GAAWD,MAAMX,KAAK,GAAGY,OAAOZ,KAAK,CAAA;AAChI;AAEA,qEACO,MAAMa,0BAAAA,GAAuC;AAAI,IAAA,GAAA,IAAIC,IAAInB,2BAAAA,CAA4BO,GAAG,CAACC,CAAAA,KAAAA,GAASA,MAAMJ,KAAK,CAAA;;AAEpH,qFACO,SAASgB,aAAAA,CAAcC,UAAkB,EAAA;IAC5C,OAAOrB,2BAAAA,CAA4BsB,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;AAKA;;;;;;;;;;;;UAaaA,2BAAAA,GAAiD;AAC1D,IAAA;QAAEC,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,eAAA;QAAiBC,IAAAA,EAAM,iBAAA;QAAmBC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG,KAAA;AAC1G,IAAA;QAAEJ,KAAAA,EAAO,UAAA;QAAYC,YAAAA,EAAc,cAAA;QAAgBC,IAAAA,EAAM,YAAA;QAAcC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG,KAAA;AACnG,IAAA;QAAEJ,KAAAA,EAAO,WAAA;QAAaC,YAAAA,EAAc,wBAAA;QAA0BC,IAAAA,EAAM,YAAA;QAAcC,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AAuBC,IAAAA,EAAM,cAAA;QAAgBC,KAAAA,EAAO,SAAA;QAAWC,KAAAA,EAAO;AAAG;;AAG5H;;;;;;UAOaC,iCAAAA,GAAoDN,2BAAAA,CAA4BO,GAAG,CAACC,CAAAA,SAAU;QACvGC,qBAAAA,EAAuBC,2BAAAA;AACvBC,QAAAA,OAAAA,EAASC,iBAAAA,CAAkBJ,KAAAA,CAAAA;AAC3BH,QAAAA,KAAAA,EAAOG,MAAMH;AACjB,KAAA,CAAA;AAEA,sDACO,SAASQ,cAAAA,CAAeT,KAAa,EAAA;AACxC,IAAA,OAAOJ,4BAA4Bc,MAAM,CAACN,CAAAA,KAAAA,GAASA,KAAAA,CAAMJ,KAAK,KAAKA,KAAAA,CAAAA,CAAOW,IAAI,CAAC,CAACC,KAAAA,EAAOC,MAAAA,GAAWD,MAAMX,KAAK,GAAGY,OAAOZ,KAAK,CAAA;AAChI;AAEA,qEACO,MAAMa,0BAAAA,GAAuC;AAAI,IAAA,GAAA,IAAIC,IAAInB,2BAAAA,CAA4BO,GAAG,CAACC,CAAAA,KAAAA,GAASA,MAAMJ,KAAK,CAAA;;AAEpH,qFACO,SAASgB,aAAAA,CAAcC,UAAkB,EAAA;IAC5C,OAAOrB,2BAAAA,CAA4BsB,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,+BAAAA,CAAgCH,IAAI;AAAEI,QAAAA,oBAAAA;AAAsBC,QAAAA;AAAwB;AACzH;AAEA;;;;;UAMaC,0BAAAA,GAA6C;AACtD,IAAA,CAACC,mBAAAA,CAAoBP,IAAI,GAAGO,oBAAoBC,UAAU;IAC1DC,UAAAA,EAAYX,wBAAAA;AACZ,IAAA,CAACK,+BAAAA,CAAgCH,IAAI,GAAGG,gCAAgCK,UAAU;IAClF,CAACJ,oBAAAA,GAAuBM,wBAAAA,CAAyBF,UAAU;AAC3D,IAAA,CAACH,uBAAAA,GAA0BM,MAAAA,CAAOC,MAAM,CAACC,aAAAA;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,+BAAAA,CAAgCH,IAAI;AAAEI,QAAAA,oBAAAA;AAAsBC,QAAAA;AAAwB;AACzH;AAEA;;;;;UAMaC,0BAAAA,GAA6C;AACtD,IAAA,CAACC,mBAAAA,CAAoBP,IAAI,GAAGO,oBAAoBC,UAAU;IAC1DC,UAAAA,EAAYX,wBAAAA;AACZ,IAAA,CAACK,+BAAAA,CAAgCH,IAAI,GAAGG,gCAAgCK,UAAU;IAClF,CAACJ,oBAAAA,GAAuBM,wBAAAA,CAAyBF,UAAU;AAC3D,IAAA,CAACH,uBAAAA,GAA0BM,MAAAA,CAAOC,MAAM,CAACC,aAAAA;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,oBAAoBC,mBAAAA,CAAoBH,QAAAA,CAAAA,CAAAA;IAE1D,OAAO;AACHI,QAAAA,IAAAA,EAAMJ,SAASI,IAAI;AACnBC,QAAAA,MAAAA,EAAQC,WAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBR,SAASI,IAAI;AAC7BK,QAAAA,WAAAA,EAAaC,iBAAiBC,2BAAAA,CAA4BX,QAAAA,CAASI,IAAI,CAAA,EAAGQ,wBAAwBX,SAAAA,EAAWY,cAAAA,CAAAA,CAAAA;AAC7GC,QAAAA,KAAAA,EAAO,EAAE;QACTC,aAAAA,EAAeC;AACnB,KAAA;AACJ;AAEA;;;;;;;IAQA,SAASb,oBAAoBH,QAAwB,EAAA;IACjD,MAAMiB,KAAAA,GAAQC,qBAAAA,CAAsBC,SAAS,CAACC,CAAAA,YAAaA,SAAAA,CAAUhB,IAAI,KAAKJ,QAAAA,CAASI,IAAI,CAAA;AAC3F,IAAA,OAAOa,QAAQ,CAAA,GAAI;AAACjB,QAAAA;AAAS,KAAA,GAAGkB,qBAAAA,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,yBAAAA,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
+ {"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,oBAAoBC,mBAAAA,CAAoBH,QAAAA,CAAAA,CAAAA;IAE1D,OAAO;AACHI,QAAAA,IAAAA,EAAMJ,SAASI,IAAI;AACnBC,QAAAA,MAAAA,EAAQC,WAAWC,QAAQ;AAC3BC,QAAAA,cAAAA,EAAgBR,SAASI,IAAI;AAC7BK,QAAAA,WAAAA,EAAaC,iBAAiBC,2BAAAA,CAA4BX,QAAAA,CAASI,IAAI,CAAA,EAAGQ,wBAAwBX,SAAAA,EAAWY,cAAAA,CAAAA,CAAAA;AAC7GC,QAAAA,KAAAA,EAAO,EAAE;QACTC,aAAAA,EAAeC;AACnB,KAAA;AACJ;AAEA;;;;;;;IAQA,SAASb,oBAAoBH,QAAwB,EAAA;IACjD,MAAMiB,KAAAA,GAAQC,qBAAAA,CAAsBC,SAAS,CAACC,CAAAA,YAAaA,SAAAA,CAAUhB,IAAI,KAAKJ,QAAAA,CAASI,IAAI,CAAA;AAC3F,IAAA,OAAOa,QAAQ,CAAA,GAAI;AAACjB,QAAAA;AAAS,KAAA,GAAGkB,qBAAAA,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,yBAAAA,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;AAMA;;;;;;;;;;;;;;;;AAgBC,IACM,SAASA,aAAAA,CAAc,EAAEC,OAAO,EAAEC,KAAK,EAA4B,EAAA;AACtE,IAAA,MAAMC,KAAAA,GAAQC,qBAAAA,CAAsBH,OAAAA,EAASI,WAAAA,CAAYC,KAAK,CAAA;IAC9D,MAAMC,IAAAA,GAAOJ,MAAMK,IAAI,KAAKC,YAAYJ,WAAAA,CAAYK,OAAO,GAAGL,WAAAA,CAAYC,KAAK;IAC/E,MAAMK,OAAAA,GAAUJ,SAASF,WAAAA,CAAYC,KAAK,GAAGH,KAAAA,GAAQC,qBAAAA,CAAsBH,OAAAA,EAASI,WAAAA,CAAYK,OAAO,CAAA;AACvG,IAAA,MAAME,OAAAA,GAAUC,gBAAAA,CAAiBZ,OAAAA,CAAQa,UAAU,EAAEH,OAAAA,EAASJ,IAAAA,CAAAA;AAE9D,IAAA,qBACIQ,IAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,oBAAA;AAAqBC,QAAAA,eAAAA,EAAejB,QAAQkB,EAAE;AAAEC,QAAAA,oBAAAA,EAAoBR,QAAQS,WAAW;;0BAClGN,IAAA,CAACC,KAAAA,EAAAA;;kCACGM,GAAA,CAACC,KAAAA,EAAAA;wBAAIN,SAAAA,EAAU,0BAAA;wBAA2BO,YAAAA,EAAW,YAAA;kCAChDZ,OAAAA,CAAQa,KAAK,CAACC,IAAI,CAAC,KAAA;;kCAExBJ,GAAA,CAACK,IAAAA,EAAAA;wBAAGV,SAAAA,EAAU,0BAAA;AAA4BL,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQgB;;oBACjDhB,OAAAA,CAAQiB,QAAQ,kBAAIP,GAAA,CAACQ,GAAAA,EAAAA;wBAAEb,SAAAA,EAAU,6BAAA;AAA+BL,wBAAAA,QAAAA,EAAAA,OAAAA,CAAQiB;;kCACzEP,GAAA,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,GAAA,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,aA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AA,OAAAA,CAAQsB;;;;AAElFhC,YAAAA,CAAAA,MAAMiC,OAAO,EAAEC,UAAU,CAAA,IAAK,mBAAKd,GAAA,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,cAAAA,CAAeJ,UAAAA,EAAY,OAAA,CAAA,KAAaC,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,GAAY,eAAA,GAAkBC,mBAAAA,CAAoBN,OAAAA,CAAQI,IAAI,CAAA,CAAA;IACrI,MAAMG,OAAAA,GAAUJ,eAAeJ,UAAAA,EAAY,SAAA,CAAA;IAE3C,OAAO;AACHG,QAAAA,KAAAA;AACAM,QAAAA,QAAAA,EAAUL,eAAeJ,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,cAAAA,CAAeJ,UAAAA,EAAY,OAAA,CAAA,KAAaC,OAAAA,CAAQI,IAAI,KAAKC,SAAAA,GAAY,eAAA,GAAkBC,mBAAAA,CAAoBN,OAAAA,CAAQI,IAAI,CAAA,CAAA;IACrI,MAAMG,OAAAA,GAAUJ,eAAeJ,UAAAA,EAAY,SAAA,CAAA;IAE3C,OAAO;AACHG,QAAAA,KAAAA;AACAM,QAAAA,QAAAA,EAAUL,eAAeJ,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,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAA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ratis. 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,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,iBAAiBG;AAAQ;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,MAAAA,CAAO;AAACC,YAAAA,QAAAA,CAASP,iBAAiBC,MAAM,CAAA;YAAGM,QAAAA,CAASP,gBAAAA,CAAiBE,IAAI,EAAE;gBAAEM,IAAAA,EAAM;AAAE,aAAA,CAAA;AAAID,YAAAA,QAAAA,CAASP,iBAAiBG,OAAO;SAAE,EAAE,EAAA;AACxI,KAAA;IACAM,OAAAA,EAAS;QACL,CAACT,gBAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,aAAAA,CAAc,qBAAA,EAAuB;gBACjCC,KAAAA,EAAO,qBAAA;gBACPC,QAAAA,EAAU,gFAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,OAAAA,EAASC,kBAAkBC;AAC/B,aAAA;AACH,SAAA;QACD,CAAChB,gBAAAA,CAAiBE,IAAI,GAAG;AAACe,YAAAA,IAAAA,CAAK,qBAAqB,EAAA,EAAI;gBAACC,WAAAA,CAAY,cAAA,EAAgBH,iBAAAA,CAAkBC,eAAe,EAAE;AAAC,oBAAA;AAAY,iBAAA;AAAE,aAAA;AAAE,SAAA;QACzI,CAAChB,gBAAAA,CAAiBG,OAAO,GAAG;AACxBgB,YAAAA,OAAAA,CAAQ,sBAAA,EAAwB;gBAC5BC,aAAAA,CAAc,qBAAA,EAAuB,wBAAwB,aAAA,EAAe,UAAA,CAAA;gBAC5EC,gBAAAA,CAAiB,wBAAA,CAAA;gBACjBD,aAAAA,CAAc,qBAAA,EAAuB,uBAAuB,aAAA,EAAe,QAAA;AAC9E,aAAA;AACJ;AACL,KAAA;IACAE,WAAAA,EAAa,mBAAA;IACbC,WAAAA,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","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,kBAAkB,CAAA,EAAGJ,EAAAA,CAAG,CAAC,EAAEG,WAAWE,KAAK,CAAA,CAAE,EAAEC,qBAAAA,CAAsBC,MAAM,EAAE;AACzEF,YAAAA,KAAAA,EAAOF,WAAWE,KAAK;AACvBG,YAAAA,MAAAA,EAAQL,WAAWK,MAAM;YACzBC,QAAAA,EAAU;AACd,SAAA,CAAA,CAAA;AAER;AAEA;;;;;;;;;;;IAYO,SAASC,QAAAA,CAASV,EAAU,EAAEW,KAAa,EAAEC,OAAqB,EAAEX,WAA+B,EAAA;AACtG,IAAA,OAAOG,iBAAAA,CAAkBJ,EAAAA,EAAIa,aAAAA,CAAcC,QAAQ,EAAE;AAAEH,QAAAA,KAAAA;QAAOI,KAAAA,EAAO,EAAA;AAAI,QAAA,GAAGH;KAAQ,EAAG;AAAEI,QAAAA,OA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C;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,kBAAkB,CAAA,EAAGJ,EAAAA,CAAG,CAAC,EAAEG,WAAWE,KAAK,CAAA,CAAE,EAAEC,qBAAAA,CAAsBC,MAAM,EAAE;AACzEF,YAAAA,KAAAA,EAAOF,WAAWE,KAAK;AACvBG,YAAAA,MAAAA,EAAQL,WAAWK,MAAM;YACzBC,QAAAA,EAAU;AACd,SAAA,CAAA,CAAA;AAER;AAEA;;;;;;;;;;;IAYO,SAASC,QAAAA,CAASV,EAAU,EAAEW,KAAa,EAAEC,OAAqB,EAAEX,WAA+B,EAAA;AACtG,IAAA,OAAOG,iBAAAA,CAAkBJ,EAAAA,EAAIa,aAAAA,CAAcC,QAAQ,EAAE;AAAEH,QAAAA,KAAAA;QAAOI,KAAAA,EAAO,EAAA;AAAI,QAAA,GAAGH;KAAQ,EAAG;AAAEI,QAAAA,OAAAA,EAASjB,OAAAA,CAAQ,CAAA,EAAGC,EAAAA,CAAG,OAAO,CAAC,EAAEC,WAAAA;AAAa,KAAA,CAAA;AAC3I;AAEA;;;;;IAMO,SAASgB,SAAAA,CAAUjB,EAAU,EAAEW,KAAa,EAAEC,OAAqB,EAAEX,WAA+B,EAAA;AACvG,IAAA,OAAOG,iBAAAA,CAAkBJ,EAAAA,EAAIa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C;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,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,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,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,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,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,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,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,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,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,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,iBAAAA,CAAkBL,EAAAA,EAAIM,aAAAA,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","componentsDialogTemplates"],"mappings":";;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BaA,qBAAAA,GAAwC;IACjDC,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBE,YAAAA,aAAAA,CAAc,gBAAA,EAAkBC,iBAAAA,CAAkBC,gBAAgB,EAAE,wBAAwB,QAAA,EAAU;AAClGC,gBAAAA,WAAAA,CAAY,yBAAyB,QAAA,EAAU,QAAA,CAAA;gBAC/CC,cAAAA,CAAe,uBAAA,EAAyB,UAAU,QAAA,EAAU,eAAA,CAAA;AAC5DC,gBAAAA,aAAAA,CAAc,4BAA4B,WAAA,EAAa,gBAAA,CAAA;gBACvDC,aAAAA,CAAc,qBAAA,EAAuB,QAAQ,MAAA,EAAQ,CAAA;AACxD,aAAA;AACJ;AACL,KAAA;IACAC,WAAAA,EAAa,gBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA;;;;;;;;;;UAWaC,qBAAAA,GAAwC;IACjDd,IAAAA,EAAM,eAAA;IACNC,KAAAA,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;YACrBY,MAAAA,CAAO,gBAAA,EAAkB,oBAAA,EAAsB,SAAA,EAAW,SAAA,EAAW;AACjEC,gBAAAA,IAAAA,CAAK,qBAAA,EAAuB,4BAAA,CAAA;gBAC5BP,cAAAA,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,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBe,YAAAA,mBAAAA,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;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,EAAO;AAAC,QAAA;AAAED,YAAAA,IAAAA,EAAME,iBAAiBC;AAAK;AAAE,KAAA;IACxCC,OAAAA,EAAS;QACL,CAACF,gBAAAA,CAAiBC,IAAI,GAAG;AACrBe,YAAAA,mBAAAA,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,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcC,YAAY,EAAE;QACrDC,MAAAA,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A;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,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcC,YAAY,EAAE;QACrDC,MAAAA,EAAQC,aAAAA;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,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcM,mBAAmB,EAAE;QAAEC,MAAAA,EAAQC,eAAAA;QAAiBN,MAAAA,EAAQC,aAAAA;AAAeC,QAAAA;AAAS,KAAA,CAAA;AAC/H;AAEA,sFACO,SAASK,qBAAAA,CAAsBd,EAAU,EAAA;AAC5C,IAAA,OAAOI,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcU,qBAAqB,EAAE;QAAEC,cAAAA,EAAgBC;AAAsB,KAAA,CAAA;AAC9G;AAEA;;;;;;IAOO,SAASC,WAAAA,CAAYlB,EAAU,EAAA;AAClC,IAAA,OAAOI,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcc,WAAW,EAAE;QAAEC,QAAAA,EAAUC,eAAAA;QAAiBC,mBAAAA,EAAqB;AAAE,KAAA,CAAA;AAChH;AAEA;;;;;;AAMC,IACM,SAASC,WAAAA,CAAYvB,EAAU,EAAEwB,KAAa,EAAA;AACjD,IAAA,OAAOpB,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAcoB,WAAW,EAAE;AAAED,QAAAA,KAAAA;QAAOE,OAAAA,EAASC,cAAAA;QAAgBC,iBAAAA,EAAmB;AAAiB,KAAA,CAAA;AAClI;AAEA,wEACO,SAASC,QAAAA,CAAS7B,EAAU,EAAE8B,WAAmB,EAAEC,OAA2C,EAAA;AACjG,IAAA,OAAO3B,iBAAAA,CAAkBJ,EAAAA,EAAIK,aAAAA,CAAc2B,QAAQ,EAAE;AAAEF,QAAAA,WAAAA;AAAaC,QAAAA,OAAAA;QAASE,SAAAA,EAAW;AAAK,KAAA,CAAA;AACjG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"editorTemplates.js","sources":["../../../templates/editorTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { filterPanel, objectContentEditor, objectNavigationalBar, schemaEditor, timeMachine } from './editorElements';\nimport { arcPageHeader, errorBoundary, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The two inspection pages: one for a type's shape, one for an instance's content.\n *\n * These are the templates to open first when looking at this blueprint, because they are the two that\n * render completely with nothing registered. The schema editor, the document editor, the navigational bar\n * and the time machine all read their content out of the property bag rather than from a query, so a\n * preview of either page is a working page rather than a page of placeholders.\n *\n * That is not a trick to make a demo look better. It is the honest shape of the library: most of\n * `@cratis/components` is Arc-bound and needs a host, and a meaningful part of it is not. A blueprint built\n * on it should make both halves visible.\n */\n\n/**\n * The schema editor page: an event type's shape, edited as a typed property tree.\n *\n * Its header names no binding, and that is correct rather than an omission. A schema is design-time\n * metadata about an event type, not a read model anyone queries, so there is nothing for the header to be\n * bound to - and the header says `No binding` instead of implying a wiring step that does not exist. It is\n * the one page in this package where the unbound state is the finished state.\n *\n * `canEdit` is paired with `canNotEditReason` deliberately: in an event-sourced application a stored event\n * type's schema is very often deliberately locked, and saying why in the same place is what stops that\n * from reading as a bug.\n */\nexport const schemaEditorPageTemplate: ScreenTemplate = {\n name: 'SchemaEditorPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Toolbar), slotLeaf(TemplateSlotName.Body, { grow: 1 })], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('schema-header', {\n title: 'InvoiceRegistered',\n subtitle: 'The shape of the event, and what a new generation would be allowed to change',\n section: 'Event types',\n }),\n ],\n [TemplateSlotName.Toolbar]: [\n toolbar('schema-toolbar', [\n toolbarButton('schema-edit', 'Edit the schema', 'pi pi-pencil', 'Edit'),\n toolbarButton('schema-generation', 'Start a new generation', 'pi pi-clone', 'New generation'),\n toolbarSeparator('schema-separator'),\n toolbarButton('schema-download', 'Download as JSON Schema', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n page('schema-body', 'InvoiceRegistered', [schemaEditor('schema-editor', 'InvoiceRegistered', true)]),\n ],\n },\n displayName: 'Schema editor page',\n description: \"An event type's schema edited as a typed property tree, with the actions that evolve it.\",\n};\n\n/**\n * The object editor page: one document, its trail, and its history beside it.\n *\n * Bound to `InvoiceById`, because that is what a real page like this is: you arrive with an id, the query\n * fetches the record, and the editor renders it against its schema. The editors themselves take their\n * content from the property bag, so the page is fully legible before the query is wired - and the header\n * still says which query it is waiting for.\n *\n * The document is wrapped in an `errorBoundary` and the history is not, which is the decision this element\n * exists to let a template make. A malformed document should cost the document region; it should not take\n * the trail and the timeline down with it, and the timeline is the thing you would reach for to find out\n * *when* the document became malformed.\n */\nexport const objectEditorPageTemplate: ScreenTemplate = {\n name: 'ObjectEditorPage',\n fitsSlot: SlotName.Content,\n slots: [\n { name: TemplateSlotName.Header },\n { name: TemplateSlotName.Toolbar },\n { name: TemplateSlotName.Body },\n { name: TemplateSlotName.SidePanel },\n ],\n arrangement: {\n root: column([\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16),\n ]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column(\n [\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n slotLeaf(TemplateSlotName.Body),\n slotLeaf(TemplateSlotName.SidePanel),\n ],\n 16,\n ),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('object-header', {\n title: 'INV-2043',\n subtitle: 'The document as it stands, and every version it has been',\n section: 'Billing',\n query: SampleBindingName.InvoiceById,\n }),\n ],\n [TemplateSlotName.Toolbar]: [objectNavigationalBar('object-trail'), filterPanel('object-filters', 'Filters')],\n [TemplateSlotName.Body]: [\n errorBoundary('object-guard', [page('object-body', 'Document', [objectContentEditor('object-editor', true)])]),\n ],\n [TemplateSlotName.SidePanel]: [page('object-history', 'History', [timeMachine('object-time-machine')])],\n },\n displayName: 'Object editor page',\n description: 'One document edited against its schema, with its navigation trail and its version history.',\n};\n\n/** The two editor-shaped templates. */\nexport const editorTemplates: ScreenTemplate[] = [schemaEditorPageTemplate, objectEditorPageTemplate];\n"],"names":["schemaEditorPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Toolbar","Body","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","toolbar","toolbarButton","toolbarSeparator","page","schemaEditor","displayName","description","objectEditorPageTemplate","SidePanel","row","overrides","width","WidthSizeClass","Compact","query","SampleBindingName","InvoiceById","objectNavigationalBar","filterPanel","errorBoundary","objectContentEditor","timeMachine","editorTemplates"],"mappings":";;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;;;;;UAyBaA,wBAAAA,GAA2C;IACpDC,IAAAA,EAAM,kBAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAQ,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,iBAAiBG;AAAK;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,MAAAA,CAAO;AAACC,YAAAA,QAAAA,CAASP,iBAAiBC,MAAM,CAAA;AAAGM,YAAAA,QAAAA,CAASP,iBAAiBE,OAAO,CAAA;YAAGK,QAAAA,CAASP,gBAAAA,CAAiBG,IAAI,EAAE;gBAAEK,IAAAA,EAAM;AAAE,aAAA;SAAG,EAAE,EAAA;AACxI,KAAA;IACAC,OAAAA,EAAS;QACL,CAACT,gBAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,aAAAA,CAAc,eAAA,EAAiB;gBAC3BC,KAAAA,EAAO,mBAAA;gBACPC,QAAAA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B,WAAAA,CAAY,qBAAA;AAAuB,aAAA;AAAE;AAC3G,KAAA;IACAhB,WAAAA,EAAa,oBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMgB,eAAAA,GAAoC;AAAC1C,IAAAA,wBAAAA;AAA0B2B,IAAAA;;;;;"}
1
+ {"version":3,"file":"editorTemplates.js","sources":["../../../templates/editorTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { filterPanel, objectContentEditor, objectNavigationalBar, schemaEditor, timeMachine } from './editorElements';\nimport { arcPageHeader, errorBoundary, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The two inspection pages: one for a type's shape, one for an instance's content.\n *\n * These are the templates to open first when looking at this blueprint, because they are the two that\n * render completely with nothing registered. The schema editor, the document editor, the navigational bar\n * and the time machine all read their content out of the property bag rather than from a query, so a\n * preview of either page is a working page rather than a page of placeholders.\n *\n * That is not a trick to make a demo look better. It is the honest shape of the library: most of\n * `@cratis/components` is Arc-bound and needs a host, and a meaningful part of it is not. A blueprint built\n * on it should make both halves visible.\n */\n\n/**\n * The schema editor page: an event type's shape, edited as a typed property tree.\n *\n * Its header names no binding, and that is correct rather than an omission. A schema is design-time\n * metadata about an event type, not a read model anyone queries, so there is nothing for the header to be\n * bound to - and the header says `No binding` instead of implying a wiring step that does not exist. It is\n * the one page in this package where the unbound state is the finished state.\n *\n * `canEdit` is paired with `canNotEditReason` deliberately: in an event-sourced application a stored event\n * type's schema is very often deliberately locked, and saying why in the same place is what stops that\n * from reading as a bug.\n */\nexport const schemaEditorPageTemplate: ScreenTemplate = {\n name: 'SchemaEditorPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Toolbar }, { name: TemplateSlotName.Body }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Toolbar), slotLeaf(TemplateSlotName.Body, { grow: 1 })], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('schema-header', {\n title: 'InvoiceRegistered',\n subtitle: 'The shape of the event, and what a new generation would be allowed to change',\n section: 'Event types',\n }),\n ],\n [TemplateSlotName.Toolbar]: [\n toolbar('schema-toolbar', [\n toolbarButton('schema-edit', 'Edit the schema', 'pi pi-pencil', 'Edit'),\n toolbarButton('schema-generation', 'Start a new generation', 'pi pi-clone', 'New generation'),\n toolbarSeparator('schema-separator'),\n toolbarButton('schema-download', 'Download as JSON Schema', 'pi pi-download'),\n ]),\n ],\n [TemplateSlotName.Body]: [\n page('schema-body', 'InvoiceRegistered', [schemaEditor('schema-editor', 'InvoiceRegistered', true)]),\n ],\n },\n displayName: 'Schema editor page',\n description: \"An event type's schema edited as a typed property tree, with the actions that evolve it.\",\n};\n\n/**\n * The object editor page: one document, its trail, and its history beside it.\n *\n * Bound to `InvoiceById`, because that is what a real page like this is: you arrive with an id, the query\n * fetches the record, and the editor renders it against its schema. The editors themselves take their\n * content from the property bag, so the page is fully legible before the query is wired - and the header\n * still says which query it is waiting for.\n *\n * The document is wrapped in an `errorBoundary` and the history is not, which is the decision this element\n * exists to let a template make. A malformed document should cost the document region; it should not take\n * the trail and the timeline down with it, and the timeline is the thing you would reach for to find out\n * *when* the document became malformed.\n */\nexport const objectEditorPageTemplate: ScreenTemplate = {\n name: 'ObjectEditorPage',\n fitsSlot: SlotName.Content,\n slots: [\n { name: TemplateSlotName.Header },\n { name: TemplateSlotName.Toolbar },\n { name: TemplateSlotName.Body },\n { name: TemplateSlotName.SidePanel },\n ],\n arrangement: {\n root: column([\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16),\n ]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column(\n [\n slotLeaf(TemplateSlotName.Header),\n slotLeaf(TemplateSlotName.Toolbar),\n slotLeaf(TemplateSlotName.Body),\n slotLeaf(TemplateSlotName.SidePanel),\n ],\n 16,\n ),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('object-header', {\n title: 'INV-2043',\n subtitle: 'The document as it stands, and every version it has been',\n section: 'Billing',\n query: SampleBindingName.InvoiceById,\n }),\n ],\n [TemplateSlotName.Toolbar]: [objectNavigationalBar('object-trail'), filterPanel('object-filters', 'Filters')],\n [TemplateSlotName.Body]: [\n errorBoundary('object-guard', [page('object-body', 'Document', [objectContentEditor('object-editor', true)])]),\n ],\n [TemplateSlotName.SidePanel]: [page('object-history', 'History', [timeMachine('object-time-machine')])],\n },\n displayName: 'Object editor page',\n description: 'One document edited against its schema, with its navigation trail and its version history.',\n};\n\n/** The two editor-shaped templates. */\nexport const editorTemplates: ScreenTemplate[] = [schemaEditorPageTemplate, objectEditorPageTemplate];\n"],"names":["schemaEditorPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Toolbar","Body","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","toolbar","toolbarButton","toolbarSeparator","page","schemaEditor","displayName","description","objectEditorPageTemplate","SidePanel","row","overrides","width","WidthSizeClass","Compact","query","SampleBindingName","InvoiceById","objectNavigationalBar","filterPanel","errorBoundary","objectContentEditor","timeMachine","editorTemplates"],"mappings":";;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;;;;;;;UAyBaA,wBAAAA,GAA2C;IACpDC,IAAAA,EAAM,kBAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAA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S,SAAA;AACTe,gBAAAA,KAAAA,EAAOC,kBAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAAC9B,gBAAAA,CAAiBE,OAAO,GAAG;YAAC6B,qBAAAA,CAAsB,cAAA,CAAA;AAAiBC,YAAAA,WAAAA,CAAY,gBAAA,EAAkB,SAAA;AAAW,SAAA;QAC7G,CAAChC,gBAAAA,CAAiBG,IAAI,GAAG;AACrB8B,YAAAA,aAAAA,CAAc,cAAA,EAAgB;AAAChB,gBAAAA,IAAAA,CAAK,eAAe,UAAA,EAAY;AAACiB,oBAAAA,mBAAAA,CAAoB,eAAA,EAAiB,IAAA;AAAM,iBAAA;AAAE,aAAA;AAChH,SAAA;QACD,CAAClC,gBAAAA,CAAiBsB,SAAS,GAAG;AAACL,YAAAA,IAAAA,CAAK,kBAAkB,SAAA,EAAW;gBAACkB,WAAAA,CAAY,qBAAA;AAAuB,aAAA;AAAE;AAC3G,KAAA;IACAhB,WAAAA,EAAa,oBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMgB,eAAAA,GAAoC;AAAC1C,IAAAA,wBAAAA;AAA0B2B,IAAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"elements.js","sources":["../../../templates/elements.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 { ComponentName } from '../ComponentName';\nimport { CompositeName } from '../CompositeName';\nimport { ArcHeaderOptions } from './ArcHeaderOptions';\n\n/**\n * The page furniture every template in this package repeats.\n *\n * `externalComponent` is imported from the default blueprint rather than written again, and that is worth\n * pausing on: `ExternalComponent` inherits fifteen required members before it reaches the two a template\n * author cares about, so a package that redeclared those defaults would be maintaining a second copy of a\n * decision it does not own. Borrowing the builder is the same choice as depending on the shell - this\n * blueprint layers on the default one, so it uses its parts.\n */\n\n/**\n * This blueprint's page header, given its heading and the one binding the page is about.\n *\n * Every template opens with one. The header derives the trail and the design-time binding state itself, so\n * a template states the page's subject once instead of repeating it in a title, a trail and a table.\n */\nexport function arcPageHeader(id: string, options: ArcHeaderOptions, actions: SceneElement[] = []): SceneElement {\n return externalComponent(id, ComponentName.ArcPageHeader, { ...options }, { actions });\n}\n\n/**\n * The library's `page` primitive wrapping content.\n *\n * A `div` would have done structurally, and would have been wrong: `page` is the full-height flex column\n * every other component in `@cratis/components` is laid out inside, drawn from the same `--cratis-*`\n * tokens as the tables and dialogs it contains. Content wrapped in it gets that consistency for free, and\n * content wrapped in a `div` has to reinvent it and will drift.\n */\nexport function page(id: string, title: string, content: SceneElement[], panel = true): SceneElement {\n return externalComponent(id, CompositeName.Page, { title, showTitle: title.length > 0, panel }, { content });\n}\n\n/** One button in a tool palette. `title` is the accessible name as well as the tooltip, so it is never omitted. */\nexport function toolbarButton(id: string, title: string, icon: string, text?: string): SceneElement {\n return externalComponent(id, CompositeName.ToolbarButton, { title, icon, text });\n}\n\n/** Related buttons kept together inside a toolbar. */\nexport function toolbarGroup(id: string, buttons: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.ToolbarGroup, { orientation: 'horizontal' }, { content: buttons });\n}\n\n/** The divider between groups of tools. */\nexport function toolbarSeparator(id: string): SceneElement {\n return externalComponent(id, CompositeName.ToolbarSeparator, { orientation: 'horizontal' });\n}\n\n/**\n * A horizontal tool palette.\n *\n * `draggable` is deliberately left off rather than set per button - it is a property of the palette, and\n * setting it per button is how you end up with a palette that is half draggable.\n */\nexport function toolbar(id: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.Toolbar, { orientation: 'horizontal' }, { content });\n}\n\n/**\n * Scopes a failure to one region of a page.\n *\n * React's default is that a throw anywhere unmounts the whole tree, which on a composed screen means one\n * broken widget takes the navigation with it. Which regions deserve a boundary is a decision about the\n * page, which is exactly why it belongs in a template rather than in the renderer.\n */\nexport function errorBoundary(id: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.ErrorBoundary, {}, { content });\n}\n\n/** An icon, given a PrimeIcons class name. */\nexport function icon(id: string, iconName: string): SceneElement {\n return externalComponent(id, CompositeName.Icon, { icon: iconName });\n}\n"],"names":["arcPageHeader","id","options","actions","externalComponent","ComponentName","ArcPageHeader","page","title","content","panel","CompositeName","Page","showTitle","length","toolbarButton","icon","text","ToolbarButton","toolbarGroup","buttons","ToolbarGroup","orientation","toolbarSeparator","ToolbarSeparator","toolbar","Toolbar","errorBoundary","ErrorBoundary","iconName","Icon"],"mappings":";;;;AAAA;AACA;AAQA;;;;;;;;;;;;;IAgBO,SAASA,aAAAA,CAAcC,EAAU,EAAEC,OAAyB,EAAEC,UAA0B,EAAE,EAAA;AAC7F,IAAA,OAAOC,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcC,aAAa,EAAE;AAAE,QAAA,GAAGJ;KAAQ,EAAG;AAAEC,QAAAA;AAAQ,KAAA,CAAA;AACxF;AAEA;;;;;;;IAQO,SAASI,IAAAA,CAAKN,EAAU,EAAEO,KAAa,EAAEC,OAAuB,EAAEC,KAAAA,GAAQ,IAAI,EAAA;AACjF,IAAA,OAAON,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAcC,IAAI,EAAE;AAAEJ,QAAAA,KAAAA;QAAOK,SAAAA,EAAWL,KAAAA,CAAMM,MAAM,GAAG,CAAA;AAAGJ,QAAAA;KAAM,EAAG;AAAED,QAAAA;AAAQ,KAAA,CAAA;AAC9G;AAEA,oHACO,SAASM,aAAAA,CAAcd,EAAU,EAAEO,KAAa,EAAEQ,IAAY,EAAEC,IAAa,EAAA;AAChF,IAAA,OAAOb,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAcO,aAAa,EAAE;AAAEV,QAAAA,KAAAA;AAAOQ,QAAAA,IAAAA;AAAMC,QAAAA;AAAK,KAAA,CAAA;AAClF;AAEA,uDACO,SAASE,YAAAA,CAAalB,EAAU,EAAEmB,OAAuB,EAAA;AAC5D,IAAA,OAAOhB,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAcU,YAAY,EAAE;QAAEC,WAAAA,EAAa;KAAa,EAAG;QAAEb,OAAAA,EAASW;AAAQ,KAAA,CAAA;AAC/G;AAEA,4CACO,SAASG,gBAAAA,CAAiBtB,EAAU,EAAA;AACvC,IAAA,OAAOG,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAca,gBAAgB,EAAE;QAAEF,WAAAA,EAAa;AAAa,KAAA,CAAA;AAC7F;AAEA;;;;;AAKC,IACM,SAASG,OAAAA,CAAQxB,EAAU,EAAEQ,OAAuB,EAAA;AACvD,IAAA,OAAOL,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAce,OAAO,EAAE;QAAEJ,WAAAA,EAAa;KAAa,EAAG;AAAEb,QAAAA;AAAQ,KAAA,CAAA;AACjG;AAEA;;;;;;AAMC,IACM,SAASkB,aAAAA,CAAc1B,EAAU,EAAEQ,OAAuB,EAAA;AAC7D,IAAA,OAAOL,kBAAkBH,EAAAA,EAAIU,aAAAA,CAAciB,aAAa,EAAE,EAAC,EAAG;AAAEnB,QAAAA;AAAQ,KAAA,CAAA;AAC5E;AAEA,+CACO,SAASO,IAAAA,CAAKf,EAAU,EAAE4B,QAAgB,EAAA;AAC7C,IAAA,OAAOzB,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAcmB,IAAI,EAAE;QAAEd,IAAAA,EAAMa;AAAS,KAAA,CAAA;AACtE;;;;"}
1
+ {"version":3,"file":"elements.js","sources":["../../../templates/elements.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 { ComponentName } from '../ComponentName';\nimport { CompositeName } from '../CompositeName';\nimport { ArcHeaderOptions } from './ArcHeaderOptions';\n\n/**\n * The page furniture every template in this package repeats.\n *\n * `externalComponent` is imported from the default blueprint rather than written again, and that is worth\n * pausing on: `ExternalComponent` inherits fifteen required members before it reaches the two a template\n * author cares about, so a package that redeclared those defaults would be maintaining a second copy of a\n * decision it does not own. Borrowing the builder is the same choice as depending on the shell - this\n * blueprint layers on the default one, so it uses its parts.\n */\n\n/**\n * This blueprint's page header, given its heading and the one binding the page is about.\n *\n * Every template opens with one. The header derives the trail and the design-time binding state itself, so\n * a template states the page's subject once instead of repeating it in a title, a trail and a table.\n */\nexport function arcPageHeader(id: string, options: ArcHeaderOptions, actions: SceneElement[] = []): SceneElement {\n return externalComponent(id, ComponentName.ArcPageHeader, { ...options }, { actions });\n}\n\n/**\n * The library's `page` primitive wrapping content.\n *\n * A `div` would have done structurally, and would have been wrong: `page` is the full-height flex column\n * every other component in `@cratis/components` is laid out inside, drawn from the same `--cratis-*`\n * tokens as the tables and dialogs it contains. Content wrapped in it gets that consistency for free, and\n * content wrapped in a `div` has to reinvent it and will drift.\n */\nexport function page(id: string, title: string, content: SceneElement[], panel = true): SceneElement {\n return externalComponent(id, CompositeName.Page, { title, showTitle: title.length > 0, panel }, { content });\n}\n\n/** One button in a tool palette. `title` is the accessible name as well as the tooltip, so it is never omitted. */\nexport function toolbarButton(id: string, title: string, icon: string, text?: string): SceneElement {\n return externalComponent(id, CompositeName.ToolbarButton, { title, icon, text });\n}\n\n/** Related buttons kept together inside a toolbar. */\nexport function toolbarGroup(id: string, buttons: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.ToolbarGroup, { orientation: 'horizontal' }, { content: buttons });\n}\n\n/** The divider between groups of tools. */\nexport function toolbarSeparator(id: string): SceneElement {\n return externalComponent(id, CompositeName.ToolbarSeparator, { orientation: 'horizontal' });\n}\n\n/**\n * A horizontal tool palette.\n *\n * `draggable` is deliberately left off rather than set per button - it is a property of the palette, and\n * setting it per button is how you end up with a palette that is half draggable.\n */\nexport function toolbar(id: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.Toolbar, { orientation: 'horizontal' }, { content });\n}\n\n/**\n * Scopes a failure to one region of a page.\n *\n * React's default is that a throw anywhere unmounts the whole tree, which on a composed screen means one\n * broken widget takes the navigation with it. Which regions deserve a boundary is a decision about the\n * page, which is exactly why it belongs in a template rather than in the renderer.\n */\nexport function errorBoundary(id: string, content: SceneElement[]): SceneElement {\n return externalComponent(id, CompositeName.ErrorBoundary, {}, { content });\n}\n\n/** An icon, given a PrimeIcons class name. */\nexport function icon(id: string, iconName: string): SceneElement {\n return externalComponent(id, CompositeName.Icon, { icon: iconName });\n}\n"],"names":["arcPageHeader","id","options","actions","externalComponent","ComponentName","ArcPageHeader","page","title","content","panel","CompositeName","Page","showTitle","length","toolbarButton","icon","text","ToolbarButton","toolbarGroup","buttons","ToolbarGroup","orientation","toolbarSeparator","ToolbarSeparator","toolbar","Toolbar","errorBoundary","ErrorBoundary","iconName","Icon"],"mappings":";;;;AAAA;AACA;AAQA;;;;;;;;;;;;;IAgBO,SAASA,aAAAA,CAAcC,EAAU,EAAEC,OAAyB,EAAEC,UAA0B,EAAE,EAAA;AAC7F,IAAA,OAAOC,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcC,aAAa,EAAE;AAAE,QAAA,GAAGJ;KAAQ,EAAG;AAAEC,QAAAA;AAAQ,KAAA,CAAA;AACxF;AAEA;;;;;;;IAQO,SAASI,IAAAA,CAAKN,EAAU,EAAEO,KAAa,EAAEC,OAAuB,EAAEC,KAAAA,GAAQ,IAAI,EAAA;AACjF,IAAA,OAAON,iBAAAA,CAAkBH,EAAAA,EAAIU,aAAAA,CAAcC,IAAI,EAAE;AAAEJ,QAAAA,KAAAA;QAAOK,SAAAA,EAAWL,KAAAA,CAAMM,MAAM,GAAG,CAAA;AAAGJ,QAAAA;KAAM,EAAG;AAAED,QAAAA;AAAQ,KAAA,CAAA;AAC9G;AAEA,oHACO,SAASM,aAAAA,CAAcd,EAAU,EAAEO,KAAa,EAAEQ,IAAY,EAAEC,IAAa,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Content":["// 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 Arc-bound form elements this blueprint's templates are built from.\n *\n * Every field carries a `property` name, which the library turns into an accessor onto the command\n * instance. That indirection is not incidental: a hand-written form binds a field with\n * `value={command => command.number}` and is typechecked against the generated proxy, and a template has\n * no types to check against because it is data. The name is what survives, so the name is what a field\n * carries.\n */\n\n/**\n * A whole form generated from the command's own property descriptors.\n *\n * `commandForm` is `AutoCommandForm`, not `CommandForm`, and that is what makes it worth shipping in a\n * template at all: a template that listed every field by hand would go stale the moment a property was\n * added to the command on the backend, and a stale template is worse than no template. This one follows\n * the command, which is the same guarantee Arc's generated proxies give the rest of the stack.\n *\n * @param exclude Properties the surrounding template places itself, so the generated form does not produce a second copy.\n */\nexport function commandForm(id: string, command: string, exclude?: string[]): SceneElement {\n return externalComponent(id, CompositeName.CommandForm, { command, exclude });\n}\n\n/** A single-line text field bound to one command property. */\nexport function inputTextField(id: string, property: string, title: string, placeholder?: string): SceneElement {\n return externalComponent(id, CompositeName.InputTextField, { property, title, placeholder });\n}\n\n/** A numeric field bound to one command property. */\nexport function numberField(id: string, property: string, title: string): SceneElement {\n return externalComponent(id, CompositeName.NumberField, { property, title });\n}\n\n/** A multi-line text field bound to one command property. */\nexport function textAreaField(id: string, property: string, title: string, rows = 3): SceneElement {\n return externalComponent(id, CompositeName.TextAreaField, { property, title, rows });\n}\n\n/** A date field bound to one command property. */\nexport function calendarField(id: string, property: string, title: string): SceneElement {\n return externalComponent(id, CompositeName.CalendarField, { property, title });\n}\n\n/**\n * A single-selection field over a list the template carries inline.\n *\n * Inline options only. A list that has to come from the backend is a different thing entirely - bind it to\n * a query - because a property bag is the wrong place for data, and a template that embedded a real\n * lookup table would be shipping someone else's reference data.\n */\nexport function dropdownField(id: string, property: string, title: string, options: { label: string; value: string }[]): SceneElement {\n return externalComponent(id, CompositeName.DropdownField, { property, title, options });\n}\n"],"names":["commandForm","id","command","exclude","externalComponent","CompositeName","CommandForm","inputTextField","property","title","placeholder","InputTextField","numberField","NumberField","textAreaField","rows","TextAreaField","calendarField","CalendarField","dropdownField","options","DropdownField"],"mappings":";;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,WAAAA,CAAYC,EAAU,EAAEC,OAAe,EAAEC,OAAkB,EAAA;AACvE,IAAA,OAAOC,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcC,WAAW,EAAE;AAAEJ,QAAAA,OAAAA;AAASC,QAAAA;AAAQ,KAAA,CAAA;AAC/E;AAEA,+DACO,SAASI,cAAAA,CAAeN,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAEC,WAAoB,EAAA;AAC5F,IAAA,OAAON,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcM,cAAc,EAAE;AAAEH,QAAAA,QAAAA;AAAUC,QAAAA,KAAAA;AAAOC,QAAAA;AAAY,KAAA,CAAA;AAC9F;AAEA,sDACO,SAASE,WAAAA,CAAYX,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAA;AACnE,IAAA,OAAOL,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcQ,WAAW,EAAE;AAAEL,QAAAA,QAAAA;AAAUC,QAAAA;AAAM,KAAA,CAAA;AAC9E;AAEA,8DACO,SAASK,aAAAA,CAAcb,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAEM,IAAAA,GAAO,CAAC,EAAA;AAC/E,IAAA,OAAOX,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcW,aAAa,EAAE;AAAER,QAAAA,QAAAA;AAAUC,QAAAA,KAAAA;AAAOM,QAAAA;AAAK,KAAA,CAAA;AACtF;AAEA,mDACO,SAASE,aAAAA,CAAchB,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAA;AACrE,IAAA,OAAOL,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAca,aAAa,EAAE;AAAEV,QAAAA,QAAAA;AAAUC,QAAAA;AAAM,KAAA,CAAA;AAChF;AAEA;;;;;;IAOO,SAASU,aAAAA,CAAclB,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAEW,OAA2C,EAAA;AAClH,IAAA,OAAOhB,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcgB,aAAa,EAAE;AAAEb,QAAAA,QAAAA;AAAUC,QAAAA,KAAAA;AAAOW,QAAAA;AAAQ,KAAA,CAAA;AACzF;;;;"}
1
+ {"version":3,"file":"formElements.js","sources":["../../../templates/formElements.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 Arc-bound form elements this blueprint's templates are built from.\n *\n * Every field carries a `property` name, which the library turns into an accessor onto the command\n * instance. That indirection is not incidental: a hand-written form binds a field with\n * `value={command => command.number}` and is typechecked against the generated proxy, and a template has\n * no types to check against because it is data. The name is what survives, so the name is what a field\n * carries.\n */\n\n/**\n * A whole form generated from the command's own property descriptors.\n *\n * `commandForm` is `AutoCommandForm`, not `CommandForm`, and that is what makes it worth shipping in a\n * template at all: a template that listed every field by hand would go stale the moment a property was\n * added to the command on the backend, and a stale template is worse than no template. This one follows\n * the command, which is the same guarantee Arc's generated proxies give the rest of the stack.\n *\n * @param exclude Properties the surrounding template places itself, so the generated form does not produce a second copy.\n */\nexport function commandForm(id: string, command: string, exclude?: string[]): SceneElement {\n return externalComponent(id, CompositeName.CommandForm, { command, exclude });\n}\n\n/** A single-line text field bound to one command property. */\nexport function inputTextField(id: string, property: string, title: string, placeholder?: string): SceneElement {\n return externalComponent(id, CompositeName.InputTextField, { property, title, placeholder });\n}\n\n/** A numeric field bound to one command property. */\nexport function numberField(id: string, property: string, title: string): SceneElement {\n return externalComponent(id, CompositeName.NumberField, { property, title });\n}\n\n/** A multi-line text field bound to one command property. */\nexport function textAreaField(id: string, property: string, title: string, rows = 3): SceneElement {\n return externalComponent(id, CompositeName.TextAreaField, { property, title, rows });\n}\n\n/** A date field bound to one command property. */\nexport function calendarField(id: string, property: string, title: string): SceneElement {\n return externalComponent(id, CompositeName.CalendarField, { property, title });\n}\n\n/**\n * A single-selection field over a list the template carries inline.\n *\n * Inline options only. A list that has to come from the backend is a different thing entirely - bind it to\n * a query - because a property bag is the wrong place for data, and a template that embedded a real\n * lookup table would be shipping someone else's reference data.\n */\nexport function dropdownField(id: string, property: string, title: string, options: { label: string; value: string }[]): SceneElement {\n return externalComponent(id, CompositeName.DropdownField, { property, title, options });\n}\n"],"names":["commandForm","id","command","exclude","externalComponent","CompositeName","CommandForm","inputTextField","property","title","placeholder","InputTextField","numberField","NumberField","textAreaField","rows","TextAreaField","calendarField","CalendarField","dropdownField","options","DropdownField"],"mappings":";;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;;;AAmBC,IACM,SAASA,WAAAA,CAAYC,EAAU,EAAEC,OAAe,EAAEC,OAAkB,EAAA;AACvE,IAAA,OAAOC,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcC,WAAW,EAAE;AAAEJ,QAAAA,OAAAA;AAASC,QAAAA;AAAQ,KAAA,CAAA;AAC/E;AAEA,+DACO,SAASI,cAAAA,CAAeN,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAEC,WAAoB,EAAA;AAC5F,IAAA,OAAON,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcM,cAAc,EAAE;AAAEH,QAAAA,QAAAA;AAAUC,QAAAA,KAAAA;AAAOC,QAAAA;AAAY,KAAA,CAAA;AAC9F;AAEA,sDACO,SAASE,WAAAA,CAAYX,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAA;AACnE,IAAA,OAAOL,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcQ,WAAW,EAAE;AAAEL,QAAAA,QAAAA;AAAUC,QAAAA;AAAM,KAAA,CAAA;AAC9E;AAEA,8DACO,SAASK,aAAAA,CAAcb,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAEM,IAAAA,GAAO,CAAC,EAAA;AAC/E,IAAA,OAAOX,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcW,aAAa,EAAE;AAAER,QAAAA,QAAAA;AAAUC,QAAAA,KAAAA;AAAOM,QAAAA;AAAK,KAAA,CAAA;AACtF;AAEA,mDACO,SAASE,aAAAA,CAAchB,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAA;AACrE,IAAA,OAAOL,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAca,aAAa,EAAE;AAAEV,QAAAA,QAAAA;AAAUC,QAAAA;AAAM,KAAA,CAAA;AAChF;AAEA;;;;;;IAOO,SAASU,aAAAA,CAAclB,EAAU,EAAEO,QAAgB,EAAEC,KAAa,EAAEW,OAA2C,EAAA;AAClH,IAAA,OAAOhB,iBAAAA,CAAkBH,EAAAA,EAAII,aAAAA,CAAcgB,aAAa,EAAE;AAAEb,QAAAA,QAAAA;AAAUC,QAAAA,KAAAA;AAAOW,QAAAA;AAAQ,KAAA,CAAA;AACzF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { dataPage, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, objectNavigationalBar, timeMachine } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarGroup, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three list shapes an Arc application repeats: a list, a live list, and a list with the selected\n * record beside it.\n *\n * All three fill the application shell's `content` slot, which is the only slot the default blueprint's\n * `AppShell` layout declares for a screen - so an application that has picked the default blueprint can\n * drop any of these in without arranging anything.\n *\n * What makes them worth shipping is what is *already wired*. A list page is not \"a table in a slot\"; it is\n * a query name, a set of columns, an empty message, a data key, a filter field list, a header that states\n * what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven\n * per screen is how a list page ends up subtly different on every screen of an application.\n */\n\n/**\n * The archetype: a `dataPage` filling the body, under a header that says what it is bound to.\n *\n * `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole\n * list-screen composite, with its title bar, menubar, filterable table and optional details pane driven\n * from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of\n * modeling for a worse result, and this template is the answer to that: an application supplies a query\n * name and has a working list page.\n */\nexport const dataListPageTemplate: ScreenTemplate = {\n name: 'DataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader(\n 'data-list-header',\n { title: 'Invoices', subtitle: 'Every invoice, filterable and paged against the server', section: 'Billing', query: SampleBindingName.AllInvoices },\n [\n toolbar('data-list-actions', [\n toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),\n toolbarSeparator('data-list-separator'),\n toolbarGroup('data-list-export', [\n toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),\n toolbarButton('data-list-print', 'Print', 'pi pi-print'),\n ]),\n ]),\n ],\n ),\n ],\n [TemplateSlotName.Body]: [dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n },\n displayName: 'Data list page',\n description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.',\n};\n\n/**\n * The live variant: the same page shape over an observable query.\n *\n * A separate template rather than a flag, for the same reason `observableDataTable` is a separate name\n * from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is\n * configured. An observable query opens a subscription and the page re-renders when the read model\n * changes on the server. Choosing this template is an application saying its data is live, and that is a\n * decision worth being able to read off the screen rather than infer from a property.\n */\nexport const observableDataListPageTemplate: ScreenTemplate = {\n name: 'ObservableDataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('observable-list-header', {\n title: 'Invoices in flight',\n subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',\n section: 'Billing',\n query: SampleBindingName.InvoicesInFlight,\n }),\n ],\n [TemplateSlotName.Body]: [\n page('observable-list-body', 'In flight', [\n observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n displayName: 'Observable data list page',\n description: 'A live list over an observable query, which re-renders when the read model changes on the server.',\n};\n\n/**\n * List plus detail: the whole list screen, with the selected record's document and history beside it.\n *\n * The detail region is built from the library's Arc-free editors, which is the interesting part. They read\n * their content out of the property bag rather than from a query, so this half of the page renders fully\n * at design time while the list half is still a placeholder - and in an event-sourced application the\n * record's *history* is as natural a thing to show as its current values, which is why the time machine is\n * here rather than in some optional extra.\n *\n * Its arrangement drops the detail column below the list at a compact width, because a document editor and\n * a paged table side by side on a phone are two unreadable slivers.\n */\nexport const dataListWithDetailPageTemplate: ScreenTemplate = {\n name: 'DataListWithDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('list-detail-header', {\n title: 'Invoices',\n subtitle: 'The list, with the selected invoice beside it',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Body]: [dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n [TemplateSlotName.SidePanel]: [\n page('list-detail-panel', 'Selected invoice', [\n objectNavigationalBar('list-detail-trail'),\n objectContentEditor('list-detail-document', false),\n timeMachine('list-detail-history'),\n ]),\n ],\n },\n displayName: 'Data list with detail page',\n description: 'A dataPage beside a detail region showing the selected record document and its history.',\n};\n\n/** The three list-shaped templates. */\nexport const listTemplates: ScreenTemplate[] = [dataListPageTemplate, observableDataListPageTemplate, dataListWithDetailPageTemplate];\n"],"names":["dataListPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","toolbar","toolbarButton","toolbarSeparator","toolbarGroup","dataPage","invoiceTableOptions","invoiceColumns","displayName","description","observableDataListPageTemplate","InvoicesInFlight","page","observableDataTable","dataListWithDetailPageTemplate","SidePanel","arrangement","root","column","slotLeaf","row","grow","overrides","width","WidthSizeClass","Compact","objectNavigationalBar","objectContentEditor","timeMachine","listTemplates"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;UAuBaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM,cAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,iBAAiBE;AAAK;AAAE,KAAA;IAC3EC,OAAAA,EAAS;QACL,CAACH,g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M,CAAA;AAAG4B,oBAAAA,QAAAA,CAAS7B,iBAAiBE,IAAI,CAAA;AAAG2B,oBAAAA,QAAAA,CAAS7B,iBAAiByB,SAAS;iBAAE,EAAE,EAAA;AAC7H;AACH;AACL,KAAA;IACAtB,OAAAA,EAAS;QACL,CAACH,gBAAAA,CAAiBC,MAAM,GAAG;AACvBG,YAAAA,aAAAA,CAAc,oBAAA,EAAsB;gBAChCC,KAAAA,EAAO,UAAA;gBACPC,QAAAA,EAAU,+CAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,KAAAA,EAAOC,kBAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAACV,gBAAAA,CAAiBE,IAAI,GAAG;AAACa,YAAAA,QAAAA,CAAS,kBAAA,EAAoBN,iBAAAA,CAAkBC,WAAW,EAAEM,mBAAAA,EAAqBC,cAAAA;AAAgB,SAAA;QAC3H,CAACjB,gBAAAA,CAAiByB,SAAS,GAAG;AAC1BH,YAAAA,IAAAA,CAAK,qBAAqB,kBAAA,EAAoB;gBAC1Cc,qBAAAA,CAAsB,mBAAA,CAAA;AACtBC,gBAAAA,mBAAAA,CAAoB,sBAAA,EAAwB,KAAA,CAAA;gBAC5CC,WAAAA,CAAY,qBAAA;AACf,aAAA;AACJ;AACL,KAAA;IACApB,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMoB,aAAAA,GAAkC;AAAC7C,IAAAA,oBAAAA;AAAsB0B,IAAAA,8BAAAA;AAAgCI,IAAAA;;;;;"}
1
+ {"version":3,"file":"listTemplates.js","sources":["../../../templates/listTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { dataPage, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, objectNavigationalBar, timeMachine } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarGroup, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three list shapes an Arc application repeats: a list, a live list, and a list with the selected\n * record beside it.\n *\n * All three fill the application shell's `content` slot, which is the only slot the default blueprint's\n * `AppShell` layout declares for a screen - so an application that has picked the default blueprint can\n * drop any of these in without arranging anything.\n *\n * What makes them worth shipping is what is *already wired*. A list page is not \"a table in a slot\"; it is\n * a query name, a set of columns, an empty message, a data key, a filter field list, a header that states\n * what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven\n * per screen is how a list page ends up subtly different on every screen of an application.\n */\n\n/**\n * The archetype: a `dataPage` filling the body, under a header that says what it is bound to.\n *\n * `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole\n * list-screen composite, with its title bar, menubar, filterable table and optional details pane driven\n * from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of\n * modeling for a worse result, and this template is the answer to that: an application supplies a query\n * name and has a working list page.\n */\nexport const dataListPageTemplate: ScreenTemplate = {\n name: 'DataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader(\n 'data-list-header',\n { title: 'Invoices', subtitle: 'Every invoice, filterable and paged against the server', section: 'Billing', query: SampleBindingName.AllInvoices },\n [\n toolbar('data-list-actions', [\n toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),\n toolbarSeparator('data-list-separator'),\n toolbarGroup('data-list-export', [\n toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),\n toolbarButton('data-list-print', 'Print', 'pi pi-print'),\n ]),\n ]),\n ],\n ),\n ],\n [TemplateSlotName.Body]: [dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n },\n displayName: 'Data list page',\n description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.',\n};\n\n/**\n * The live variant: the same page shape over an observable query.\n *\n * A separate template rather than a flag, for the same reason `observableDataTable` is a separate name\n * from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is\n * configured. An observable query opens a subscription and the page re-renders when the read model\n * changes on the server. Choosing this template is an application saying its data is live, and that is a\n * decision worth being able to read off the screen rather than infer from a property.\n */\nexport const observableDataListPageTemplate: ScreenTemplate = {\n name: 'ObservableDataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('observable-list-header', {\n title: 'Invoices in flight',\n subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',\n section: 'Billing',\n query: SampleBindingName.InvoicesInFlight,\n }),\n ],\n [TemplateSlotName.Body]: [\n page('observable-list-body', 'In flight', [\n observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n displayName: 'Observable data list page',\n description: 'A live list over an observable query, which re-renders when the read model changes on the server.',\n};\n\n/**\n * List plus detail: the whole list screen, with the selected record's document and history beside it.\n *\n * The detail region is built from the library's Arc-free editors, which is the interesting part. They read\n * their content out of the property bag rather than from a query, so this half of the page renders fully\n * at design time while the list half is still a placeholder - and in an event-sourced application the\n * record's *history* is as natural a thing to show as its current values, which is why the time machine is\n * here rather than in some optional extra.\n *\n * Its arrangement drops the detail column below the list at a compact width, because a document editor and\n * a paged table side by side on a phone are two unreadable slivers.\n */\nexport const dataListWithDetailPageTemplate: ScreenTemplate = {\n name: 'DataListWithDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('list-detail-header', {\n title: 'Invoices',\n subtitle: 'The list, with the selected invoice beside it',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Body]: [dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n [TemplateSlotName.SidePanel]: [\n page('list-detail-panel', 'Selected invoice', [\n objectNavigationalBar('list-detail-trail'),\n objectContentEditor('list-detail-document', false),\n timeMachine('list-detail-history'),\n ]),\n ],\n },\n displayName: 'Data list with detail page',\n description: 'A dataPage beside a detail region showing the selected record document and its history.',\n};\n\n/** The three list-shaped templates. */\nexport const listTemplates: ScreenTemplate[] = [dataListPageTemplate, observableDataListPageTemplate, dataListWithDetailPageTemplate];\n"],"names":["dataListPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","toolbar","toolbarButton","toolbarSeparator","toolbarGroup","dataPage","invoiceTableOptions","invoiceColumns","displayName","description","observableDataListPageTemplate","InvoicesInFlight","page","observableDataTable","dataListWithDetailPageTemplate","SidePanel","arrangement","root","column","slotLeaf","row","grow","overrides","width","WidthSizeClass","Compact","objectNavigationalBar","objectContentEditor","timeMachine","listTemplates"],"mappings":";;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;UAuBaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM,cAAA;AACNC,IAAAA,QAAAA,EAAUC,SAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,iBAAiBC;AAAO,SAAA;AA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