@cratis/scene.blueprint.components 4.9.0 → 4.11.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 (44) hide show
  1. package/dist/cjs/componentsBlueprint.js +7 -7
  2. package/dist/cjs/gallery/GalleryScreenPreview.js +109 -16
  3. package/dist/cjs/gallery/GalleryScreenPreview.js.map +1 -1
  4. package/dist/cjs/gallery/businessGallery.js +34 -0
  5. package/dist/cjs/gallery/businessGallery.js.map +1 -0
  6. package/dist/cjs/index.js +3 -0
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/templates/commandTemplates.js +8 -0
  9. package/dist/cjs/templates/commandTemplates.js.map +1 -1
  10. package/dist/cjs/templates/listTemplates.js +21 -0
  11. package/dist/cjs/templates/listTemplates.js.map +1 -1
  12. package/dist/esm/componentsBlueprint.js +7 -7
  13. package/dist/esm/gallery/BusinessGalleryCategory.d.ts +6 -0
  14. package/dist/esm/gallery/BusinessGalleryCategory.d.ts.map +1 -0
  15. package/dist/esm/gallery/BusinessGalleryCategory.js +2 -0
  16. package/dist/esm/gallery/BusinessGalleryCategory.js.map +1 -0
  17. package/dist/esm/gallery/GalleryScreenPreview.d.ts +4 -3
  18. package/dist/esm/gallery/GalleryScreenPreview.d.ts.map +1 -1
  19. package/dist/esm/gallery/GalleryScreenPreview.js +114 -22
  20. package/dist/esm/gallery/GalleryScreenPreview.js.map +1 -1
  21. package/dist/esm/gallery/businessGallery.d.ts +4 -0
  22. package/dist/esm/gallery/businessGallery.d.ts.map +1 -0
  23. package/dist/esm/gallery/businessGallery.js +32 -0
  24. package/dist/esm/gallery/businessGallery.js.map +1 -0
  25. package/dist/esm/gallery/index.d.ts +2 -0
  26. package/dist/esm/gallery/index.d.ts.map +1 -1
  27. package/dist/esm/gallery/index.js +2 -0
  28. package/dist/esm/gallery/index.js.map +1 -1
  29. package/dist/esm/index.js +2 -1
  30. package/dist/esm/index.js.map +1 -1
  31. package/dist/esm/templates/commandTemplates.d.ts.map +1 -1
  32. package/dist/esm/templates/commandTemplates.js +8 -0
  33. package/dist/esm/templates/commandTemplates.js.map +1 -1
  34. package/dist/esm/templates/listTemplates.d.ts.map +1 -1
  35. package/dist/esm/templates/listTemplates.js +22 -1
  36. package/dist/esm/templates/listTemplates.js.map +1 -1
  37. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  38. package/gallery/BusinessGalleryCategory.ts +12 -0
  39. package/gallery/GalleryScreenPreview.tsx +85 -19
  40. package/gallery/businessGallery.ts +19 -0
  41. package/gallery/index.ts +2 -0
  42. package/package.json +11 -11
  43. package/templates/commandTemplates.ts +2 -1
  44. package/templates/listTemplates.ts +4 -1
@@ -3,14 +3,7 @@
3
3
  var scene_model = require('@cratis/scene.model');
4
4
  var ComponentName = require('./ComponentName.js');
5
5
  var componentsBlueprintComponents = require('./componentsBlueprintComponents.js');
6
- require('./gallery/navigation.js');
7
6
  require('@cratis/scene.blueprint.default');
8
- var screens = require('./gallery/screens.js');
9
- require('./gallery/previewProfile.js');
10
- require('./gallery/GalleryScreenPreview.js');
11
- require('react/jsx-runtime');
12
- require('react');
13
- require('@cratis/scene.react');
14
7
  require('./templates/listTemplates.js');
15
8
  require('./templates/workspaceTemplates.js');
16
9
  require('./templates/commandTemplates.js');
@@ -18,6 +11,13 @@ require('./templates/editorTemplates.js');
18
11
  require('./templates/nesting.js');
19
12
  var dialogTemplates = require('./templates/dialogTemplates.js');
20
13
  var screenTemplates = require('./templates/screenTemplates.js');
14
+ require('./gallery/navigation.js');
15
+ var screens = require('./gallery/screens.js');
16
+ require('./gallery/previewProfile.js');
17
+ require('./gallery/GalleryScreenPreview.js');
18
+ require('react/jsx-runtime');
19
+ require('react');
20
+ require('@cratis/scene.react');
21
21
  var packageName = require('./packageName.js');
22
22
 
23
23
  // Copyright (c) Cratis. All rights reserved.
@@ -2,10 +2,20 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
+ var core = require('@primereact/core');
6
+ var scene_model = require('@cratis/scene.model');
5
7
  var scene_react = require('@cratis/scene.react');
6
8
  var scene_components = require('@cratis/scene.components');
7
9
  var scene_blueprint_default = require('@cratis/scene.blueprint.default');
8
10
  var componentsBlueprintComponents = require('../componentsBlueprintComponents.js');
11
+ var packageName = require('../packageName.js');
12
+ require('../templates/listTemplates.js');
13
+ require('../templates/workspaceTemplates.js');
14
+ require('../templates/commandTemplates.js');
15
+ require('../templates/editorTemplates.js');
16
+ require('../templates/nesting.js');
17
+ var dialogTemplates = require('../templates/dialogTemplates.js');
18
+ var screenTemplates = require('../templates/screenTemplates.js');
9
19
  var previewProfile = require('./previewProfile.js');
10
20
  var screens = require('./screens.js');
11
21
 
@@ -19,12 +29,86 @@ var screens = require('./screens.js');
19
29
  * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a
20
30
  * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a
21
31
  * placeholder until a host registers its query.
22
- */ const componentsPreviewRegistry = {
23
- ...scene_react.coreComponents,
24
- ...scene_components.cratisComponents,
25
- ...scene_blueprint_default.defaultBlueprintComponents,
26
- ...componentsBlueprintComponents.componentsBlueprintComponents
27
- };
32
+ */ const previewComponent = ({ element })=>/*#__PURE__*/ jsxRuntime.jsx("span", {
33
+ "data-preview-component": element.componentName,
34
+ children: String(element.properties.label ?? element.componentName)
35
+ });
36
+ const componentsPreviewBundles = [
37
+ scene_react.corePackage,
38
+ {
39
+ manifest: {
40
+ name: 'Tailwind',
41
+ version: '4.0.0',
42
+ kind: scene_model.PackageKind.Styling,
43
+ dependencies: [],
44
+ components: [],
45
+ layouts: [],
46
+ screenTemplates: [],
47
+ dialogTemplates: [],
48
+ themes: [],
49
+ assets: [
50
+ 'styles/tailwind.css',
51
+ 'fonts/inter.woff2'
52
+ ]
53
+ },
54
+ components: {}
55
+ },
56
+ {
57
+ manifest: {
58
+ name: 'PrimeReact',
59
+ version: '11.1.0',
60
+ kind: scene_model.PackageKind.ComponentLibrary,
61
+ dependencies: [
62
+ {
63
+ name: 'Tailwind'
64
+ }
65
+ ],
66
+ components: previewProfile.primeReactComponentNames,
67
+ layouts: [],
68
+ screenTemplates: [],
69
+ dialogTemplates: [],
70
+ themes: []
71
+ },
72
+ components: Object.fromEntries(previewProfile.primeReactComponentNames.map((name)=>[
73
+ `PrimeReact:${name}`,
74
+ previewComponent
75
+ ]))
76
+ },
77
+ scene_components.cratisComponentsPackage,
78
+ scene_blueprint_default.defaultBlueprint,
79
+ {
80
+ manifest: {
81
+ name: packageName.componentsBlueprintName,
82
+ version: '1.0.0',
83
+ kind: scene_model.PackageKind.Blueprint,
84
+ dependencies: [
85
+ {
86
+ name: 'Cratis.Blueprint.Default'
87
+ },
88
+ {
89
+ name: 'Cratis.Components'
90
+ }
91
+ ],
92
+ components: Object.keys(componentsBlueprintComponents.componentsBlueprintComponents).map((name)=>name.slice(`${packageName.componentsBlueprintName}:`.length)),
93
+ layouts: [],
94
+ screenTemplates: screenTemplates.componentsScreenTemplates.map((template)=>template.name),
95
+ dialogTemplates: dialogTemplates.componentsDialogTemplates.map((template)=>template.name),
96
+ themes: []
97
+ },
98
+ components: componentsBlueprintComponents.componentsBlueprintComponents,
99
+ screenTemplates: screenTemplates.componentsScreenTemplates,
100
+ dialogTemplates: dialogTemplates.componentsDialogTemplates,
101
+ screens: screens.componentsGalleryScreens
102
+ }
103
+ ];
104
+ /** Compatibility registry for callers that render individual gallery elements directly. */ const componentsPreviewRegistry = scene_react.resolvePackageHost({
105
+ profile: previewProfile.componentsBlueprintProfile,
106
+ bundles: componentsPreviewBundles,
107
+ policy: {
108
+ allowExecutableImports: false,
109
+ allowNetworkAssets: false
110
+ }
111
+ }).components;
28
112
  /**
29
113
  * Boots one gallery screen through the real engine.
30
114
  *
@@ -36,7 +120,7 @@ var screens = require('./screens.js');
36
120
  * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being
37
121
  * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and
38
122
  * previewing them without the thing they were designed to sit in would prove the wrong thing.
39
- */ function GalleryScreenPreview({ screenName, initialConfig, registry = componentsPreviewRegistry }) {
123
+ */ function GalleryScreenPreview({ screenName, initialConfig, bundles = componentsPreviewBundles }) {
40
124
  const element = react.useMemo(()=>{
41
125
  const screen = screens.componentsGalleryScreen(screenName);
42
126
  if (!screen) {
@@ -46,20 +130,29 @@ var screens = require('./screens.js');
46
130
  }, [
47
131
  screenName
48
132
  ]);
49
- return /*#__PURE__*/ jsxRuntime.jsx(scene_blueprint_default.LayoutConfigProvider, {
50
- initialConfig: initialConfig,
51
- storage: null,
52
- children: /*#__PURE__*/ jsxRuntime.jsx(scene_blueprint_default.LayoutThemeProvider, {
53
- themes: scene_blueprint_default.defaultBlueprintThemes,
54
- children: /*#__PURE__*/ jsxRuntime.jsx(scene_react.SceneElementView, {
55
- element: element,
56
- registry: registry,
57
- resolveBinding: ()=>undefined
133
+ return /*#__PURE__*/ jsxRuntime.jsx(core.PrimeReactProvider, {
134
+ children: /*#__PURE__*/ jsxRuntime.jsx(scene_blueprint_default.LayoutConfigProvider, {
135
+ initialConfig: initialConfig,
136
+ storage: null,
137
+ children: /*#__PURE__*/ jsxRuntime.jsx(scene_blueprint_default.LayoutThemeProvider, {
138
+ themes: scene_blueprint_default.defaultBlueprintThemes,
139
+ children: /*#__PURE__*/ jsxRuntime.jsx(scene_react.PackageHostView, {
140
+ configuration: {
141
+ profile: previewProfile.componentsBlueprintProfile,
142
+ bundles,
143
+ policy: {
144
+ allowExecutableImports: false,
145
+ allowNetworkAssets: false
146
+ }
147
+ },
148
+ element: element
149
+ })
58
150
  })
59
151
  })
60
152
  });
61
153
  }
62
154
 
63
155
  exports.GalleryScreenPreview = GalleryScreenPreview;
156
+ exports.componentsPreviewBundles = componentsPreviewBundles;
64
157
  exports.componentsPreviewRegistry = componentsPreviewRegistry;
65
158
  //# sourceMappingURL=GalleryScreenPreview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { ComponentRegistry, SceneElementView, coreComponents } from '@cratis/scene.react';\nimport { cratisComponents } from '@cratis/scene.components';\nimport { LayoutConfigProvider, LayoutConfigState, LayoutThemeProvider, composeScreenElement, defaultBlueprintComponents, defaultBlueprintThemes, resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsBlueprintComponents } from '../componentsBlueprintComponents';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile } from './previewProfile';\nimport { componentsGalleryScreen } from './screens';\n\n/**\n * The registry a preview resolves against: `core`, `Cratis.Components`, the default blueprint, and this one.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's own\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n *\n * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a\n * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a\n * placeholder until a host registers its query.\n */\nexport const componentsPreviewRegistry: ComponentRegistry = {\n ...coreComponents,\n ...cratisComponents,\n ...defaultBlueprintComponents,\n ...componentsBlueprintComponents,\n};\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a layout mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The component registry to render against. Defaults to {@link componentsPreviewRegistry}. */\n registry?: ComponentRegistry;\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real `Screen`, its element tree is resolved by the\n * real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real registry.\n * That is the point of shipping a gallery at all - a mockup proves someone can draw an invoice list, and\n * this proves the blueprint renders one.\n *\n * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being\n * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and\n * previewing them without the thing they were designed to sit in would prove the wrong thing.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, registry = componentsPreviewRegistry }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = componentsGalleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), componentsBlueprintProfile, componentsBlueprintCatalog);\n }, [screenName]);\n\n return (\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={defaultBlueprintThemes}>\n <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n );\n}\n"],"names":["componentsPreviewRegistry","coreComponents","cratisComponents","defaultBlueprintComponents","componentsBlueprintComponents","GalleryScreenPreview","screenName","initialConfig","registry","element","useMemo","screen","componentsGalleryScreen","Error","resolveElementComponentNames","composeScreenElement","componentsBlueprintProfile","componentsBlueprintCatalog","_jsx","LayoutConfigProvider","storage","LayoutThemeProvider","themes","defaultBlueprintThemes","SceneElementView","resolveBinding","undefined"],"mappings":";;;;;;;;;;;AAWA;;;;;;;;;;UAWaA,yBAAAA,GAA+C;AACxD,IAAA,GAAGC,0BAAc;AACjB,IAAA,GAAGC,iCAAgB;AACnB,IAAA,GAAGC,kDAA0B;AAC7B,IAAA,GAAGC;AACP;AAaA;;;;;;;;;;;IAYO,SAASC,oBAAAA,CAAqB,EAAEC,UAAU,EAAEC,aAAa,EAAEC,QAAAA,GAAWR,yBAAyB,EAA6B,EAAA;AAC/H,IAAA,MAAMS,UAAUC,aAAAA,CAAQ,IAAA;AACpB,QAAA,MAAMC,SAASC,+BAAAA,CAAwBN,UAAAA,CAAAA;AACvC,QAAA,IAAI,CAACK,MAAAA,EAAQ;AACT,YAAA,MAAM,IAAIE,KAAAA,CAAM,CAAC,iCAAiC,EAAEP,UAAAA,CAAW,EAAE,CAAC,CAAA;AACtE,QAAA;QAEA,OAAOQ,oDAAAA,CAA6BC,4CAAAA,CAAqBJ,MAAAA,CAAAA,EAASK,yCAAAA,EAA4BC,yCAAAA,CAAAA;IAClG,CAAA,EAAG;AAACX,QAAAA;AAAW,KAAA,CAAA;AAEf,IAAA,qBACIY,cAAA,CAACC,4CAAAA,EAAAA;QAAqBZ,aAAAA,EAAeA,aAAAA;QAAea,OAAAA,EAAS,IAAA;AACzD,QAAA,QAAA,gBAAAF,cAAA,CAACG,2CAAAA,EAAAA;YAAoBC,MAAAA,EAAQC,8CAAAA;AACzB,YAAA,QAAA,gBAAAL,cAAA,CAACM,4BAAAA,EAAAA;gBAAiBf,OAAAA,EAASA,OAAAA;gBAASD,QAAAA,EAAUA,QAAAA;AAAUiB,gBAAAA,cAAAA,EAAgB,IAAMC;;;;AAI9F;;;"}
1
+ {"version":3,"file":"GalleryScreenPreview.js","sources":["../../../gallery/GalleryScreenPreview.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useMemo } from 'react';\nimport { PrimeReactProvider } from '@primereact/core';\nimport { PackageKind } from '@cratis/scene.model';\nimport { ComponentRegistry, PackageHostView, RegisteredComponentProps, ScenePackageBundle, corePackage, resolvePackageHost } from '@cratis/scene.react';\nimport { cratisComponentsPackage } from '@cratis/scene.components';\nimport { defaultBlueprint, LayoutConfigProvider, LayoutConfigState, LayoutThemeProvider, composeScreenElement, defaultBlueprintThemes, resolveElementComponentNames } from '@cratis/scene.blueprint.default';\nimport { componentsBlueprintComponents } from '../componentsBlueprintComponents';\nimport { componentsBlueprintName } from '../packageName';\nimport { componentsDialogTemplates, componentsScreenTemplates } from '../templates';\nimport { componentsBlueprintCatalog, componentsBlueprintProfile, primeReactComponentNames } from './previewProfile';\nimport { componentsGalleryScreen, componentsGalleryScreens } from './screens';\n\n/**\n * The registry a preview resolves against: `core`, `Cratis.Components`, the default blueprint, and this one.\n *\n * Merged by hand rather than through `mergePackageRegistries`, because reaching for this blueprint's own\n * *bundle* here would be circular - the bundle is assembled from the gallery this file belongs to. Registry\n * keys carry their package name, so merge order cannot cause a collision either way.\n *\n * Four of the profile's five packages are present. `PrimeReact` is not, which is why a `column` inside a\n * table comes out unresolved - and it never reaches the DOM, because the table it belongs to is a\n * placeholder until a host registers its query.\n */\nconst previewComponent = ({ element }: RegisteredComponentProps) => <span data-preview-component={element.componentName}>{String(element.properties.label ?? element.componentName)}</span>;\n\nexport const componentsPreviewBundles: ScenePackageBundle[] = [\n corePackage,\n {\n manifest: {\n name: 'Tailwind',\n version: '4.0.0',\n kind: PackageKind.Styling,\n dependencies: [],\n components: [],\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n assets: ['styles/tailwind.css', 'fonts/inter.woff2'],\n },\n components: {},\n },\n {\n manifest: {\n name: 'PrimeReact',\n version: '11.1.0',\n kind: PackageKind.ComponentLibrary,\n dependencies: [{ name: 'Tailwind' }],\n components: primeReactComponentNames,\n layouts: [],\n screenTemplates: [],\n dialogTemplates: [],\n themes: [],\n },\n components: Object.fromEntries(primeReactComponentNames.map(name => [`PrimeReact:${name}`, previewComponent])),\n },\n cratisComponentsPackage,\n defaultBlueprint,\n {\n manifest: {\n name: componentsBlueprintName,\n version: '1.0.0',\n kind: PackageKind.Blueprint,\n dependencies: [{ name: 'Cratis.Blueprint.Default' }, { name: 'Cratis.Components' }],\n components: Object.keys(componentsBlueprintComponents).map(name => name.slice(`${componentsBlueprintName}:`.length)),\n layouts: [],\n screenTemplates: componentsScreenTemplates.map(template => template.name),\n dialogTemplates: componentsDialogTemplates.map(template => template.name),\n themes: [],\n },\n components: componentsBlueprintComponents,\n screenTemplates: componentsScreenTemplates,\n dialogTemplates: componentsDialogTemplates,\n screens: componentsGalleryScreens,\n },\n];\n\n/** Compatibility registry for callers that render individual gallery elements directly. */\nexport const componentsPreviewRegistry: ComponentRegistry = resolvePackageHost({\n profile: componentsBlueprintProfile,\n bundles: componentsPreviewBundles,\n policy: { allowExecutableImports: false, allowNetworkAssets: false },\n}).components;\n\nexport interface GalleryScreenPreviewProps {\n /** The name of the gallery screen to boot. */\n screenName: string;\n\n /** Configuration to start from - a story pinning a layout mode, or a host restoring a session. */\n initialConfig?: Partial<LayoutConfigState>;\n\n /** The approved package set to render against. Defaults to {@link componentsPreviewBundles}. */\n bundles?: ScenePackageBundle[];\n}\n\n/**\n * Boots one gallery screen through the real engine.\n *\n * Nothing here is a preview-only path: the screen is a real `Screen`, its element tree is resolved by the\n * real `resolveComponentName`, and it is rendered by the real `SceneElementView` against the real registry.\n * That is the point of shipping a gallery at all - a mockup proves someone can draw an invoice list, and\n * this proves the blueprint renders one.\n *\n * `LayoutConfigProvider` and `LayoutThemeProvider` are the default blueprint's, because the shell being\n * previewed is the default blueprint's shell. This package provides Arc-bound pages to put inside it, and\n * previewing them without the thing they were designed to sit in would prove the wrong thing.\n */\nexport function GalleryScreenPreview({ screenName, initialConfig, bundles = componentsPreviewBundles }: GalleryScreenPreviewProps) {\n const element = useMemo(() => {\n const screen = componentsGalleryScreen(screenName);\n if (!screen) {\n throw new Error(`The gallery has no screen named '${screenName}'.`);\n }\n\n return resolveElementComponentNames(composeScreenElement(screen), componentsBlueprintProfile, componentsBlueprintCatalog);\n }, [screenName]);\n\n return (\n <PrimeReactProvider>\n <LayoutConfigProvider initialConfig={initialConfig} storage={null}>\n <LayoutThemeProvider themes={defaultBlueprintThemes}>\n <PackageHostView\n configuration={{\n profile: componentsBlueprintProfile,\n bundles,\n policy: { allowExecutableImports: false, allowNetworkAssets: false },\n }}\n element={element} />\n </LayoutThemeProvider>\n </LayoutConfigProvider>\n </PrimeReactProvider>\n );\n}\n"],"names":["previewComponent","element","_jsx","span","data-preview-component","componentName","String","properties","label","componentsPreviewBundles","corePackage","manifest","name","version","kind","PackageKind","Styling","dependencies","components","layouts","screenTemplates","dialogTemplates","themes","assets","ComponentLibrary","primeReactComponentNames","Object","fromEntries","map","cratisComponentsPackage","defaultBlueprint","componentsBlueprintName","Blueprint","keys","componentsBlueprintComponents","slice","length","componentsScreenTemplates","template","componentsDialogTemplates","screens","componentsGalleryScreens","componentsPreviewRegistry","resolvePackageHost","profile","componentsBlueprintProfile","bundles","policy","allowExecutableImports","allowNetworkAssets","GalleryScreenPreview","screenName","initialConfig","useMemo","screen","componentsGalleryScreen","Error","resolveElementComponentNames","composeScreenElement","componentsBlueprintCatalog","PrimeReactProvider","LayoutConfigProvider","storage","LayoutThemeProvider","defaultBlueprintThemes","PackageHostView","configuration"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;;;AAUC,IACD,MAAMA,gBAAAA,GAAmB,CAAC,EAAEC,OAAO,EAA4B,iBAAKC,cAAA,CAACC,MAAAA,EAAAA;AAAKC,QAAAA,wBAAAA,EAAwBH,QAAQI,aAAa;AAAGC,QAAAA,QAAAA,EAAAA,MAAAA,CAAOL,QAAQM,UAAU,CAACC,KAAK,IAAIP,QAAQI,aAAa;;MAErKI,wBAAAA,GAAiD;AAC1DC,IAAAA,uBAAAA;AACA,IAAA;QACIC,QAAAA,EAAU;YACNC,IAAAA,EAAM,UAAA;YACNC,OAAAA,EAAS,OAAA;AACTC,YAAAA,IAAAA,EAAMC,wBAAYC,OAAO;AACzBC,YAAAA,YAAAA,EAAc,EAAE;AAChBC,YAAAA,UAAAA,EAAY,EAAE;AACdC,YAAAA,OAAAA,EAAS,EAAE;AACXC,YAAAA,eAAAA,EAAiB,EAAE;AACnBC,YAAAA,eAAAA,EAAiB,EAAE;AACnBC,YAAAA,MAAAA,EAAQ,EAAE;YACVC,MAAAA,EAAQ;AAAC,gBAAA,qBAAA;AAAuB,gBAAA;AAAoB;AACxD,SAAA;AACAL,QAAAA,UAAAA,EAAY;AAChB,KAAA;AACA,IAAA;QACIP,QAAAA,EAAU;YACNC,IAAAA,EAAM,YAAA;YACNC,OAAAA,EAAS,QAAA;AACTC,YAA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C,wBAAAA,OAAAA;wBACAC,MAAAA,EAAQ;4BAAEC,sBAAAA,EAAwB,KAAA;4BAAOC,kBAAAA,EAAoB;AAAM;AACvE,qBAAA;oBACAhD,OAAAA,EAASA;;;;;AAKjC;;;;"}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ require('@cratis/scene.blueprint.default');
4
+ require('../templates/listTemplates.js');
5
+ require('../templates/workspaceTemplates.js');
6
+ require('../templates/commandTemplates.js');
7
+ require('../templates/editorTemplates.js');
8
+ require('../templates/nesting.js');
9
+ require('../templates/dialogTemplates.js');
10
+ var screenTemplates = require('../templates/screenTemplates.js');
11
+
12
+ // Copyright (c) Cratis. All rights reserved.
13
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
14
+ /**
15
+ * Returns templates grouped by visible gallery category and filtered by scope metadata.
16
+ */ function businessGallery(scope, templates = screenTemplates.componentsPageTemplates) {
17
+ const categories = new Map();
18
+ for (const template of templates.filter((template)=>template.metadata?.scopes?.includes(scope))){
19
+ const category = template.metadata?.category ?? 'Business / Other';
20
+ categories.set(category, [
21
+ ...categories.get(category) ?? [],
22
+ template
23
+ ]);
24
+ }
25
+ return [
26
+ ...categories.entries()
27
+ ].map(([category, categoryTemplates])=>({
28
+ category,
29
+ templates: categoryTemplates
30
+ }));
31
+ }
32
+
33
+ exports.businessGallery = businessGallery;
34
+ //# sourceMappingURL=businessGallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"businessGallery.js","sources":["../../../gallery/businessGallery.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { BusinessGalleryCategory } from './BusinessGalleryCategory';\nimport { componentsPageTemplates } from '../templates';\n\n/**\n * Returns templates grouped by visible gallery category and filtered by scope metadata.\n */\nexport function businessGallery(scope: TemplateScope, templates: ScreenTemplate[] = componentsPageTemplates): BusinessGalleryCategory[] {\n const categories = new Map<string, ScreenTemplate[]>();\n for (const template of templates.filter(template => template.metadata?.scopes?.includes(scope))) {\n const category = template.metadata?.category ?? 'Business / Other';\n categories.set(category, [...(categories.get(category) ?? []), template]);\n }\n\n return [...categories.entries()].map(([category, categoryTemplates]) => ({ category, templates: categoryTemplates }));\n}\n"],"names":["businessGallery","scope","templates","componentsPageTemplates","categories","Map","template","filter","metadata","scopes","includes","category","set","get","entries","map","categoryTemplates"],"mappings":";;;;;;;;;;;AAAA;AACA;AAMA;;AAEC,IACM,SAASA,eAAAA,CAAgBC,KAAoB,EAAEC,YAA8BC,uCAAuB,EAAA;AACvG,IAAA,MAAMC,aAAa,IAAIC,GAAAA,EAAAA;AACvB,IAAA,KAAK,MAAMC,QAAAA,IAAYJ,SAAAA,CAAUK,MAAM,CAACD,CAAAA,QAAAA,GAAYA,QAAAA,CAASE,QAAQ,EAAEC,MAAAA,EAAQC,QAAAA,CAAST,KAAAA,CAAAA,CAAAA,CAAS;AAC7F,QAAA,MAAMU,QAAAA,GAAWL,QAAAA,CAASE,QAAQ,EAAEG,QAAAA,IAAY,kBAAA;QAChDP,UAAAA,CAAWQ,GAAG,CAACD,QAAAA,EAAU;eAAKP,UAAAA,CAAWS,GAAG,CAACF,QAAAA,CAAAA,IAAa,EAAE;AAAGL,YAAAA;AAAS,SAAA,CAAA;AAC5E,IAAA;IAEA,OAAO;AAAIF,QAAAA,GAAAA,UAAAA,CAAWU,OAAO;AAAG,KAAA,CAACC,GAAG,CAAC,CAAC,CAACJ,QAAAA,EAAUK,iBAAAA,CAAkB,IAAM;AAAEL,YAAAA,QAAAA;YAAUT,SAAAA,EAAWc;SAAkB,CAAA,CAAA;AACtH;;"}
package/dist/cjs/index.js CHANGED
@@ -21,6 +21,7 @@ var editorTemplates = require('./templates/editorTemplates.js');
21
21
  var nesting = require('./templates/nesting.js');
22
22
  var dialogTemplates = require('./templates/dialogTemplates.js');
23
23
  var screenTemplates = require('./templates/screenTemplates.js');
24
+ var businessGallery = require('./gallery/businessGallery.js');
24
25
  var navigation = require('./gallery/navigation.js');
25
26
  var applicationChrome = require('./gallery/applicationChrome.js');
26
27
  var screens = require('./gallery/screens.js');
@@ -98,6 +99,7 @@ exports.componentsDialogTemplates = dialogTemplates.componentsDialogTemplates;
98
99
  exports.confirmDialogTemplate = dialogTemplates.confirmDialogTemplate;
99
100
  exports.componentsPageTemplates = screenTemplates.componentsPageTemplates;
100
101
  exports.componentsScreenTemplates = screenTemplates.componentsScreenTemplates;
102
+ exports.businessGallery = businessGallery.businessGallery;
101
103
  exports.componentsNavigationContributions = navigation.componentsNavigationContributions;
102
104
  exports.componentsNavigationEntries = navigation.componentsNavigationEntries;
103
105
  exports.componentsNavigationGroups = navigation.componentsNavigationGroups;
@@ -111,6 +113,7 @@ exports.componentsBlueprintCatalog = previewProfile.componentsBlueprintCatalog;
111
113
  exports.componentsBlueprintProfile = previewProfile.componentsBlueprintProfile;
112
114
  exports.primeReactComponentNames = previewProfile.primeReactComponentNames;
113
115
  exports.GalleryScreenPreview = GalleryScreenPreview.GalleryScreenPreview;
116
+ exports.componentsPreviewBundles = GalleryScreenPreview.componentsPreviewBundles;
114
117
  exports.componentsPreviewRegistry = GalleryScreenPreview.componentsPreviewRegistry;
115
118
  exports.DialogTemplatePreview = DialogTemplatePreview.DialogTemplatePreview;
116
119
  exports.componentsBlueprintComponents = componentsBlueprintComponents.componentsBlueprintComponents;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var scene_model = require('@cratis/scene.model');
3
4
  var scene_blueprint_default = require('@cratis/scene.blueprint.default');
4
5
  var elements = require('./elements.js');
5
6
  var formElements = require('./formElements.js');
@@ -70,6 +71,13 @@ var SampleBindingName = require('./SampleBindingName.js');
70
71
  ])
71
72
  ]
72
73
  },
74
+ metadata: {
75
+ type: 'Form',
76
+ category: 'Business / Command',
77
+ scopes: [
78
+ scene_model.TemplateScope.Slice
79
+ ]
80
+ },
73
81
  displayName: 'Command form page',
74
82
  description: 'A generated command form under a header that states the command, with its own action bar.'
75
83
  };
@@ -1 +1 @@
1
- {"version":3,"file":"commandTemplates.js","sources":["../../../templates/commandTemplates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { commandForm } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The write side: a page whose body is one command, and whose action bar submits it.\n */\n\n/**\n * A command form page - a header, the generated form, and the bar that closes it.\n *\n * The form is `commandForm`, which is `AutoCommandForm`: it reads the command's own property descriptors\n * and picks a field component per property type. That is the whole reason a *template* can ship a form at\n * all. A template that listed fields by hand would be a snapshot of a command as it looked the day the\n * template was written, and would go quietly wrong the first time a property was added on the backend.\n * This one follows the command, which is the same guarantee Arc's generated proxies give everywhere else.\n *\n * `exclude` names the properties the form should not generate. `invoiceId` is excluded because it is the\n * event-source identity - Arc resolves it, and a form offering to type it in is offering to break it.\n *\n * The action bar is the template's rather than the form's, and it declares its own slot for that reason: a\n * screen replacing \"Register\" with \"Register and approve\" should not have to replace the form.\n */\nexport const commandFormPageTemplate: ScreenTemplate = {\n name: 'CommandFormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('command-form-header', {\n title: 'Register an invoice',\n subtitle: 'The form follows the command, so a property added on the backend shows up here',\n section: 'Billing',\n command: SampleBindingName.RegisterInvoice,\n }),\n ],\n [TemplateSlotName.Body]: [page('command-form-body', '', [commandForm('command-form', SampleBindingName.RegisterInvoice, ['invoiceId'])])],\n [TemplateSlotName.Actions]: [\n toolbar('command-form-actions', [\n toolbarButton('command-form-submit', 'Register the invoice', 'pi pi-check', 'Register'),\n toolbarSeparator('command-form-separator'),\n toolbarButton('command-form-cancel', 'Discard and go back', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n displayName: 'Command form page',\n description: 'A generated command form under a header that states the command, with its own action bar.',\n};\n\n/** The command-shaped templates. */\nexport const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate];\n"],"names":["commandFormPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","Actions","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","command","SampleBindingName","RegisterInvoice","page","commandForm","toolbar","toolbarButton","toolbarSeparator","displayName","description","commandTemplates"],"mappings":";;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,yCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,yCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAE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],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ScreenTemplate, TemplateScope } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarSeparator } from './elements';\nimport { commandForm } from './formElements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The write side: a page whose body is one command, and whose action bar submits it.\n */\n\n/**\n * A command form page - a header, the generated form, and the bar that closes it.\n *\n * The form is `commandForm`, which is `AutoCommandForm`: it reads the command's own property descriptors\n * and picks a field component per property type. That is the whole reason a *template* can ship a form at\n * all. A template that listed fields by hand would be a snapshot of a command as it looked the day the\n * template was written, and would go quietly wrong the first time a property was added on the backend.\n * This one follows the command, which is the same guarantee Arc's generated proxies give everywhere else.\n *\n * `exclude` names the properties the form should not generate. `invoiceId` is excluded because it is the\n * event-source identity - Arc resolves it, and a form offering to type it in is offering to break it.\n *\n * The action bar is the template's rather than the form's, and it declares its own slot for that reason: a\n * screen replacing \"Register\" with \"Register and approve\" should not have to replace the form.\n */\nexport const commandFormPageTemplate: ScreenTemplate = {\n name: 'CommandFormPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)], 16),\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('command-form-header', {\n title: 'Register an invoice',\n subtitle: 'The form follows the command, so a property added on the backend shows up here',\n section: 'Billing',\n command: SampleBindingName.RegisterInvoice,\n }),\n ],\n [TemplateSlotName.Body]: [page('command-form-body', '', [commandForm('command-form', SampleBindingName.RegisterInvoice, ['invoiceId'])])],\n [TemplateSlotName.Actions]: [\n toolbar('command-form-actions', [\n toolbarButton('command-form-submit', 'Register the invoice', 'pi pi-check', 'Register'),\n toolbarSeparator('command-form-separator'),\n toolbarButton('command-form-cancel', 'Discard and go back', 'pi pi-times', 'Cancel'),\n ]),\n ],\n },\n metadata: { type: 'Form', category: 'Business / Command', scopes: [TemplateScope.Slice] },\n displayName: 'Command form page',\n description: 'A generated command form under a header that states the command, with its own action bar.',\n};\n\n/** The command-shaped templates. */\nexport const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate];\n"],"names":["commandFormPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","Actions","arrangement","root","column","slotLeaf","grow","content","arcPageHeader","title","subtitle","section","command","SampleBindingName","RegisterInvoice","page","commandForm","toolbar","toolbarButton","toolbarSeparator","metadata","type","category","scopes","TemplateScope","Slice","displayName","description","commandTemplates"],"mappings":";;;;;;;;AAAA;AACA;AAQA;;;;;;;;;;;;;;;;UAmBaA,uBAAAA,GAA0C;IACnDC,IAAAA,EAAM,iBAAA;AACNC,IAAAA,QAAAA,EAAUC,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,yCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,yCAAiBE;AAAK,SAAA;AAAG,QAAA;AAAEP,YAAAA,IAAAA,EAAMK,yCAAiBG;AAAQ;AAAE,KAAA;IAC/GC,WAAAA,EAAa;AACTC,QAAAA,IAAAA,EAAMC,8BAAAA,CAAO;AAACC,YAAAA,gCAAAA,CAASP,yCAAiBC,MAAM,CAAA;YAAGM,gCAAAA,CAASP,wCAAAA,CAAiBE,IAAI,EAAE;gBAAEM,IAAAA,EAAM;AAAE,aAAA,CAAA;AAAID,YAAAA,gCAAAA,CAASP,yCAAiBG,OAAO;SAAE,EAAE,EAAA;AACxI,KAAA;IACAM,OAAAA,EAAS;QACL,CAACT,wCAAAA,CAAiBC,MAAM,GAAG;AACvBS,YAAAA,sBAAAA,CAAc,qBAAA,EAAuB;gBACjCC,KAAAA,EAAO,qBAAA;gBACPC,QAAAA,EAAU,gFAAA;gBACVC,OAAAA,EAAS,SAAA;AACTC,gBAAAA,OAAAA,EAASC,oCAAkBC;AAC/B,aAAA;AACH,SAAA;QACD,CAAChB,wCAAAA,CAAiBE,IAAI,GAAG;AAACe,YAAAA,aAAAA,CAAK,qBAAqB,EAAA,EAAI;gBAACC,wBAAAA,CAAY,cAAA,EAAgBH,mCAAAA,CAAkBC,eAAe,EAAE;AAAC,oBAAA;AAAY,iBAAA;AAAE,aAAA;AAAE,SAAA;QACzI,CAAChB,wCAAAA,CAAiBG,OAAO,GAAG;AACxBgB,YAAAA,gBAAAA,CAAQ,sBAAA,EAAwB;gBAC5BC,sBAAAA,CAAc,qBAAA,EAAuB,wBAAwB,aAAA,EAAe,UAAA,CAAA;gBAC5EC,yBAAAA,CAAiB,wBAAA,CAAA;gBACjBD,sBAAAA,CAAc,qBAAA,EAAuB,uBAAuB,aAAA,EAAe,QAAA;AAC9E,aAAA;AACJ;AACL,KAAA;IACAE,QAAAA,EAAU;QAAEC,IAAAA,EAAM,MAAA;QAAQC,QAAAA,EAAU,oBAAA;QAAsBC,MAAAA,EAAQ;AAACC,YAAAA,yBAAAA,CAAcC;AAAM;AAAC,KAAA;IACxFC,WAAAA,EAAa,mBAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,qCACO,MAAMC,gBAAAA,GAAqC;AAACpC,IAAAA;;;;"}
@@ -63,6 +63,13 @@ var SampleBindingName = require('./SampleBindingName.js');
63
63
  dataElements.dataPage('data-list-body', SampleBindingName.SampleBindingName.AllInvoices, dataElements.invoiceTableOptions, dataElements.invoiceColumns)
64
64
  ]
65
65
  },
66
+ metadata: {
67
+ type: 'List',
68
+ category: 'Business / List',
69
+ scopes: [
70
+ scene_model.TemplateScope.Slice
71
+ ]
72
+ },
66
73
  displayName: 'Data list page',
67
74
  description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.'
68
75
  };
@@ -100,6 +107,13 @@ var SampleBindingName = require('./SampleBindingName.js');
100
107
  ])
101
108
  ]
102
109
  },
110
+ metadata: {
111
+ type: 'List',
112
+ category: 'Business / Live operations',
113
+ scopes: [
114
+ scene_model.TemplateScope.Slice
115
+ ]
116
+ },
103
117
  displayName: 'Observable data list page',
104
118
  description: 'A live list over an observable query, which re-renders when the read model changes on the server.'
105
119
  };
@@ -171,6 +185,13 @@ var SampleBindingName = require('./SampleBindingName.js');
171
185
  ])
172
186
  ]
173
187
  },
188
+ metadata: {
189
+ type: 'Detail',
190
+ category: 'Business / Master detail',
191
+ scopes: [
192
+ scene_model.TemplateScope.Slice
193
+ ]
194
+ },
174
195
  displayName: 'Data list with detail page',
175
196
  description: 'A dataPage beside a detail region showing the selected record document and its history.'
176
197
  };
@@ -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,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,yCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,yCAAiBE;AAAK;AAAE,KAAA;IAC3EC,OAAAA,EAAS;QACL,CAACH,wCAAAA,CAAiBC,MAAM,GAAG;AACvBG,YAAAA,sBAAAA,CACI,kBAAA,EACA;gBAAEC,KAAAA,EAAO,UAAA;gBAAYC,QAAAA,EAAU,wDAAA;gBAA0DC,OAAAA,EAAS,SAAA;AAAWC,gBAAAA,KAAAA,EAAOC,oCAAkBC;aAAY,EAClJ;AACIC,gBAAAA,gBAAAA,CAAQ,mBAAA,EAAqB;oBACzBC,sBAAAA,CAAc,eAAA,EAAiB,uBAAuB,YAAA,EAAc,KAAA,CAAA;AACpEA,oBAAAA,sBAAAA,CAAc,qBAAqB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AS,SAAA;AACTC,gBAAAA,KAAAA,EAAOC,oCAAkBC;AAC7B,aAAA;AACH,SAAA;QACD,CAACV,wCAAAA,CAAiBE,IAAI,GAAG;AAACa,YAAAA,qBAAAA,CAAS,kBAAA,EAAoBN,mCAAAA,CAAkBC,WAAW,EAAEM,gCAAAA,EAAqBC,2BAAAA;AAAgB,SAAA;QAC3H,CAACjB,wCAAAA,CAAiByB,SAAS,GAAG;AAC1BH,YAAAA,aAAAA,CAAK,qBAAqB,kBAAA,EAAoB;gBAC1Cc,oCAAAA,CAAsB,mBAAA,CAAA;AACtBC,gBAAAA,kCAAAA,CAAoB,sBAAA,EAAwB,KAAA,CAAA;gBAC5CC,0BAAAA,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, TemplateScope, WidthSizeClass } from '@cratis/scene.model';\nimport { SlotName, TemplateSlotName, column, row, slotLeaf } from '@cratis/scene.blueprint.default';\nimport { dataPage, invoiceColumns, invoiceTableOptions, observableDataTable } from './dataElements';\nimport { objectContentEditor, objectNavigationalBar, timeMachine } from './editorElements';\nimport { arcPageHeader, page, toolbar, toolbarButton, toolbarGroup, toolbarSeparator } from './elements';\nimport { SampleBindingName } from './SampleBindingName';\n\n/**\n * The three list shapes an Arc application repeats: a list, a live list, and a list with the selected\n * record beside it.\n *\n * All three fill the application shell's `content` slot, which is the only slot the default blueprint's\n * `AppShell` layout declares for a screen - so an application that has picked the default blueprint can\n * drop any of these in without arranging anything.\n *\n * What makes them worth shipping is what is *already wired*. A list page is not \"a table in a slot\"; it is\n * a query name, a set of columns, an empty message, a data key, a filter field list, a header that states\n * what the page is bound to, and an action bar. Every one of those is a decision, and repeating all seven\n * per screen is how a list page ends up subtly different on every screen of an application.\n */\n\n/**\n * The archetype: a `dataPage` filling the body, under a header that says what it is bound to.\n *\n * `dataPage` is the single highest-leverage name `Cratis.Components` exposes - the library's whole\n * list-screen composite, with its title bar, menubar, filterable table and optional details pane driven\n * from one query. Building the same thing out of a `table` and a `toolbar` in a screen is pages of\n * modeling for a worse result, and this template is the answer to that: an application supplies a query\n * name and has a working list page.\n */\nexport const dataListPageTemplate: ScreenTemplate = {\n name: 'DataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader(\n 'data-list-header',\n { title: 'Invoices', subtitle: 'Every invoice, filterable and paged against the server', section: 'Billing', query: SampleBindingName.AllInvoices },\n [\n toolbar('data-list-actions', [\n toolbarButton('data-list-new', 'Register an invoice', 'pi pi-plus', 'New'),\n toolbarButton('data-list-refresh', 'Refresh', 'pi pi-refresh'),\n toolbarSeparator('data-list-separator'),\n toolbarGroup('data-list-export', [\n toolbarButton('data-list-download', 'Download as CSV', 'pi pi-download'),\n toolbarButton('data-list-print', 'Print', 'pi pi-print'),\n ]),\n ]),\n ],\n ),\n ],\n [TemplateSlotName.Body]: [dataPage('data-list-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n },\n metadata: { type: 'List', category: 'Business / List', scopes: [TemplateScope.Slice] },\n displayName: 'Data list page',\n description: 'A dataPage bound to one query, under a header that states the binding - the whole list screen in two elements.',\n};\n\n/**\n * The live variant: the same page shape over an observable query.\n *\n * A separate template rather than a flag, for the same reason `observableDataTable` is a separate name\n * from `dataTable`: the difference lives in the *proxy* a host registers, not in how the page is\n * configured. An observable query opens a subscription and the page re-renders when the read model\n * changes on the server. Choosing this template is an application saying its data is live, and that is a\n * decision worth being able to read off the screen rather than infer from a property.\n */\nexport const observableDataListPageTemplate: ScreenTemplate = {\n name: 'ObservableDataListPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }],\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('observable-list-header', {\n title: 'Invoices in flight',\n subtitle: 'Updates as the read model changes - no refresh button, because there is nothing to refresh',\n section: 'Billing',\n query: SampleBindingName.InvoicesInFlight,\n }),\n ],\n [TemplateSlotName.Body]: [\n page('observable-list-body', 'In flight', [\n observableDataTable('observable-list-table', SampleBindingName.InvoicesInFlight, invoiceTableOptions, invoiceColumns),\n ]),\n ],\n },\n metadata: { type: 'List', category: 'Business / Live operations', scopes: [TemplateScope.Slice] },\n displayName: 'Observable data list page',\n description: 'A live list over an observable query, which re-renders when the read model changes on the server.',\n};\n\n/**\n * List plus detail: the whole list screen, with the selected record's document and history beside it.\n *\n * The detail region is built from the library's Arc-free editors, which is the interesting part. They read\n * their content out of the property bag rather than from a query, so this half of the page renders fully\n * at design time while the list half is still a placeholder - and in an event-sourced application the\n * record's *history* is as natural a thing to show as its current values, which is why the time machine is\n * here rather than in some optional extra.\n *\n * Its arrangement drops the detail column below the list at a compact width, because a document editor and\n * a paged table side by side on a phone are two unreadable slivers.\n */\nexport const dataListWithDetailPageTemplate: ScreenTemplate = {\n name: 'DataListWithDetailPage',\n fitsSlot: SlotName.Content,\n slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.SidePanel }],\n arrangement: {\n root: column([slotLeaf(TemplateSlotName.Header), row([slotLeaf(TemplateSlotName.Body, { grow: 2 }), slotLeaf(TemplateSlotName.SidePanel, { grow: 1 })], 16)]),\n overrides: [\n {\n width: WidthSizeClass.Compact,\n root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body), slotLeaf(TemplateSlotName.SidePanel)], 16),\n },\n ],\n },\n content: {\n [TemplateSlotName.Header]: [\n arcPageHeader('list-detail-header', {\n title: 'Invoices',\n subtitle: 'The list, with the selected invoice beside it',\n section: 'Billing',\n query: SampleBindingName.AllInvoices,\n }),\n ],\n [TemplateSlotName.Body]: [dataPage('list-detail-body', SampleBindingName.AllInvoices, invoiceTableOptions, invoiceColumns)],\n [TemplateSlotName.SidePanel]: [\n page('list-detail-panel', 'Selected invoice', [\n objectNavigationalBar('list-detail-trail'),\n objectContentEditor('list-detail-document', false),\n timeMachine('list-detail-history'),\n ]),\n ],\n },\n metadata: { type: 'Detail', category: 'Business / Master detail', scopes: [TemplateScope.Slice] },\n displayName: 'Data list with detail page',\n description: 'A dataPage beside a detail region showing the selected record document and its history.',\n};\n\n/** The three list-shaped templates. */\nexport const listTemplates: ScreenTemplate[] = [dataListPageTemplate, observableDataListPageTemplate, dataListWithDetailPageTemplate];\n"],"names":["dataListPageTemplate","name","fitsSlot","SlotName","Content","slots","TemplateSlotName","Header","Body","content","arcPageHeader","title","subtitle","section","query","SampleBindingName","AllInvoices","toolbar","toolbarButton","toolbarSeparator","toolbarGroup","dataPage","invoiceTableOptions","invoiceColumns","metadata","type","category","scopes","TemplateScope","Slice","displayName","description","observableDataListPageTemplate","InvoicesInFlight","page","observableDataTable","dataListWithDetailPageTemplate","SidePanel","arrangement","root","column","slotLeaf","row","grow","overrides","width","WidthSizeClass","Compact","objectNavigationalBar","objectContentEditor","timeMachine","listTemplates"],"mappings":";;;;;;;;;AAAA;AACA;AASA;;;;;;;;;;;;;;;;;;;;UAuBaA,oBAAAA,GAAuC;IAChDC,IAAAA,EAAM,cAAA;AACNC,IAAAA,QAAAA,EAAUC,iCAASC,OAAO;IAC1BC,KAAAA,EAAO;AAAC,QAAA;AAAEJ,YAAAA,IAAAA,EAAMK,yCAAiBC;AAAO,SAAA;AAAG,QAAA;AAAEN,YAAAA,IAAAA,EAAMK,yCAAiBE;AAAK;AAAE,KAAA;IAC3EC,OAAAA,EAAS;QACL,CAACH,wCAAAA,CAAiBC,MAAM,GAAG;AACvB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A;IAChGC,WAAAA,EAAa,4BAAA;IACbC,WAAAA,EAAa;AACjB;AAEA,wCACO,MAAMoB,aAAAA,GAAkC;AAACnD,IAAAA,oBAAAA;AAAsBgC,IAAAA,8BAAAA;AAAgCI,IAAAA;;;;;;"}
@@ -1,14 +1,7 @@
1
1
  import { PackageKind } from '@cratis/scene.model';
2
2
  import { ComponentName } from './ComponentName.js';
3
3
  import { componentsBlueprintComponents } from './componentsBlueprintComponents.js';
4
- import './gallery/navigation.js';
5
4
  import '@cratis/scene.blueprint.default';
6
- import { componentsGalleryScreens } from './gallery/screens.js';
7
- import './gallery/previewProfile.js';
8
- import './gallery/GalleryScreenPreview.js';
9
- import 'react/jsx-runtime';
10
- import 'react';
11
- import '@cratis/scene.react';
12
5
  import './templates/listTemplates.js';
13
6
  import './templates/workspaceTemplates.js';
14
7
  import './templates/commandTemplates.js';
@@ -16,6 +9,13 @@ import './templates/editorTemplates.js';
16
9
  import './templates/nesting.js';
17
10
  import { componentsDialogTemplates } from './templates/dialogTemplates.js';
18
11
  import { componentsScreenTemplates } from './templates/screenTemplates.js';
12
+ import './gallery/navigation.js';
13
+ import { componentsGalleryScreens } from './gallery/screens.js';
14
+ import './gallery/previewProfile.js';
15
+ import './gallery/GalleryScreenPreview.js';
16
+ import 'react/jsx-runtime';
17
+ import 'react';
18
+ import '@cratis/scene.react';
19
19
  import { componentsBlueprintName } from './packageName.js';
20
20
 
21
21
  // Copyright (c) Cratis. All rights reserved.
@@ -0,0 +1,6 @@
1
+ import { ScreenTemplate } from '@cratis/scene.model';
2
+ export interface BusinessGalleryCategory {
3
+ category: string;
4
+ templates: ScreenTemplate[];
5
+ }
6
+ //# sourceMappingURL=BusinessGalleryCategory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BusinessGalleryCategory.d.ts","sourceRoot":"","sources":["../../../gallery/BusinessGalleryCategory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BusinessGalleryCategory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BusinessGalleryCategory.js","sourceRoot":"","sources":["../../../gallery/BusinessGalleryCategory.ts"],"names":[],"mappings":""}
@@ -1,10 +1,11 @@
1
- import { ComponentRegistry } from '@cratis/scene.react';
1
+ import { ComponentRegistry, ScenePackageBundle } from '@cratis/scene.react';
2
2
  import { LayoutConfigState } from '@cratis/scene.blueprint.default';
3
+ export declare const componentsPreviewBundles: ScenePackageBundle[];
3
4
  export declare const componentsPreviewRegistry: ComponentRegistry;
4
5
  export interface GalleryScreenPreviewProps {
5
6
  screenName: string;
6
7
  initialConfig?: Partial<LayoutConfigState>;
7
- registry?: ComponentRegistry;
8
+ bundles?: ScenePackageBundle[];
8
9
  }
9
- export declare function GalleryScreenPreview({ screenName, initialConfig, registry }: GalleryScreenPreviewProps): import("react").JSX.Element;
10
+ export declare function GalleryScreenPreview({ screenName, initialConfig, bundles }: GalleryScreenPreviewProps): import("react").JSX.Element;
10
11
  //# sourceMappingURL=GalleryScreenPreview.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GalleryScreenPreview.d.ts","sourceRoot":"","sources":["../../../gallery/GalleryScreenPreview.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAwB,iBAAiB,EAA+H,MAAM,iCAAiC,CAAC;AAgBvN,eAAO,MAAM,yBAAyB,EAAE,iBAKvC,CAAC;AAEF,MAAM,WAAW,yBAAyB;IAEtC,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAG3C,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAcD,wBAAgB,oBAAoB,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,QAAoC,EAAE,EAAE,yBAAyB,+BAiBlI"}
1
+ {"version":3,"file":"GalleryScreenPreview.d.ts","sourceRoot":"","sources":["../../../gallery/GalleryScreenPreview.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAA6C,kBAAkB,EAAmC,MAAM,qBAAqB,CAAC;AAExJ,OAAO,EAA0C,iBAAiB,EAAmG,MAAM,iCAAiC,CAAC;AAoB7M,eAAO,MAAM,wBAAwB,EAAE,kBAAkB,EAkDxD,CAAC;AAGF,eAAO,MAAM,yBAAyB,EAAE,iBAI3B,CAAC;AAEd,MAAM,WAAW,yBAAyB;IAEtC,UAAU,EAAE,MAAM,CAAC;IAGnB,aAAa,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAG3C,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC;AAcD,wBAAgB,oBAAoB,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAkC,EAAE,EAAE,yBAAyB,+BAyBhI"}