@cratis/scene.blueprint.components 4.16.0 → 4.18.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 (40) hide show
  1. package/dist/cjs/gallery/navigation.js +7 -0
  2. package/dist/cjs/gallery/navigation.js.map +1 -1
  3. package/dist/cjs/gallery/screens.js +1 -1
  4. package/dist/cjs/gallery/screens.js.map +1 -1
  5. package/dist/cjs/index.js +1 -0
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/cjs/templates/SampleBindingName.js +1 -0
  8. package/dist/cjs/templates/SampleBindingName.js.map +1 -1
  9. package/dist/cjs/templates/commandTemplates.js +68 -1
  10. package/dist/cjs/templates/commandTemplates.js.map +1 -1
  11. package/dist/cjs/templates/screenTemplates.js +2 -2
  12. package/dist/cjs/templates/screenTemplates.js.map +1 -1
  13. package/dist/esm/gallery/ArcPages.stories.d.ts +1 -0
  14. package/dist/esm/gallery/ArcPages.stories.d.ts.map +1 -1
  15. package/dist/esm/gallery/ArcPages.stories.js +2 -1
  16. package/dist/esm/gallery/ArcPages.stories.js.map +1 -1
  17. package/dist/esm/gallery/navigation.d.ts.map +1 -1
  18. package/dist/esm/gallery/navigation.js +7 -0
  19. package/dist/esm/gallery/navigation.js.map +1 -1
  20. package/dist/esm/gallery/screens.js +1 -1
  21. package/dist/esm/gallery/screens.js.map +1 -1
  22. package/dist/esm/index.js +1 -1
  23. package/dist/esm/templates/SampleBindingName.d.ts +2 -1
  24. package/dist/esm/templates/SampleBindingName.d.ts.map +1 -1
  25. package/dist/esm/templates/SampleBindingName.js +1 -0
  26. package/dist/esm/templates/SampleBindingName.js.map +1 -1
  27. package/dist/esm/templates/commandTemplates.d.ts +1 -0
  28. package/dist/esm/templates/commandTemplates.d.ts.map +1 -1
  29. package/dist/esm/templates/commandTemplates.js +68 -2
  30. package/dist/esm/templates/commandTemplates.js.map +1 -1
  31. package/dist/esm/templates/screenTemplates.js +2 -2
  32. package/dist/esm/templates/screenTemplates.js.map +1 -1
  33. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  34. package/gallery/ArcPages.stories.tsx +4 -1
  35. package/gallery/navigation.ts +1 -0
  36. package/gallery/screens.ts +1 -1
  37. package/package.json +11 -11
  38. package/templates/SampleBindingName.ts +3 -0
  39. package/templates/commandTemplates.ts +39 -1
  40. package/templates/screenTemplates.ts +2 -2
@@ -21,7 +21,7 @@ const meta = {
21
21
  docs: {
22
22
  description: {
23
23
  component:
24
- 'The eight Arc-bound page templates plus the three-level nesting chain, each booted as a screen inside the default ' +
24
+ 'The nine Arc-bound page templates plus the three-level nesting chain, each booted as a screen inside the default ' +
25
25
  "blueprint's application shell. Nothing is registered in the binding registry, so every Arc-bound region names the " +
26
26
  'binding it wanted and every page header says which query or command a host still has to wire. That is the normal ' +
27
27
  'design-time state - see the *Bindings* stories for what changes when a host registers one.',
@@ -53,6 +53,9 @@ export const DashboardPage: Story = { args: { screenName: 'DashboardPage' } };
53
53
  /** A generated command form with its own action bar. */
54
54
  export const CommandFormPage: Story = { args: { screenName: 'CommandFormPage' } };
55
55
 
56
+ /** A module's settings as a generated command form, with save and discard. */
57
+ export const SettingsPage: Story = { args: { screenName: 'SettingsPage' } };
58
+
56
59
  /** An event type's schema, edited as a typed property tree - and fully rendered, because nothing on it is Arc-bound. */
57
60
  export const SchemaEditorPage: Story = { args: { screenName: 'SchemaEditorPage' } };
58
61
 
@@ -24,6 +24,7 @@ export const componentsNavigationEntries: NavigationEntry[] = [
24
24
  { label: 'Invoices and detail', targetScreen: 'DataListWithDetailPage', icon: 'pi pi-window-maximize', group: 'Billing', order: 40 },
25
25
  { label: 'Master and detail', targetScreen: 'MasterDetailPage', icon: 'pi pi-table', group: 'Billing', order: 50 },
26
26
  { label: 'Register an invoice', targetScreen: 'CommandFormPage', icon: 'pi pi-plus-circle', group: 'Billing', order: 60 },
27
+ { label: 'Settings', targetScreen: 'SettingsPage', icon: 'pi pi-cog', group: 'Billing', order: 70 },
27
28
  { label: 'Event type schema', targetScreen: 'SchemaEditorPage', icon: 'pi pi-sitemap', group: 'Inspect', order: 10 },
28
29
  { label: 'Invoice document', targetScreen: 'ObjectEditorPage', icon: 'pi pi-file-edit', group: 'Inspect', order: 20 },
29
30
  { label: 'Billing module', targetScreen: 'DataModulePage', icon: 'pi pi-th-large', group: 'Nesting', order: 10 },
@@ -47,7 +47,7 @@ function screenFor(template: ScreenTemplate): Screen {
47
47
  /**
48
48
  * The chain of templates a screen renders through, outermost first.
49
49
  *
50
- * The eight page templates fit the layout's own `content` slot, so each one's chain is just itself. The
50
+ * The nine page templates fit the layout's own `content` slot, so each one's chain is just itself. The
51
51
  * three nesting-chain templates are the exception and the only ones that need the walk - which is the
52
52
  * honest version of the story: nesting exists for the applications that need it, and costs nothing for the
53
53
  * ones that do not.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene.blueprint.components",
3
- "version": "4.16.0",
3
+ "version": "4.18.0",
4
4
  "description": "A blueprint of Arc-bound screen and dialog templates: full pages built from Cratis Components composites, so a data list, a command form or a master-detail screen is a template rather than something you assemble.",
5
5
  "keywords": [
6
6
  "cratis",
@@ -52,19 +52,19 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@cratis/components": "^4.25.0",
55
- "@cratis/scene.blueprint.default": "4.16.0",
56
- "@cratis/scene.components": "4.16.0",
57
- "@cratis/scene.engine": "4.16.0",
58
- "@cratis/scene.model": "4.16.0",
59
- "@cratis/scene.react": "4.16.0"
55
+ "@cratis/scene.blueprint.default": "4.18.0",
56
+ "@cratis/scene.components": "4.18.0",
57
+ "@cratis/scene.engine": "4.18.0",
58
+ "@cratis/scene.model": "4.18.0",
59
+ "@cratis/scene.react": "4.18.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@cratis/components": "^4.25.0",
63
- "@cratis/scene.blueprint.default": "4.16.0",
64
- "@cratis/scene.components": "4.16.0",
65
- "@cratis/scene.engine": "4.16.0",
66
- "@cratis/scene.model": "4.16.0",
67
- "@cratis/scene.react": "4.16.0",
63
+ "@cratis/scene.blueprint.default": "4.18.0",
64
+ "@cratis/scene.components": "4.18.0",
65
+ "@cratis/scene.engine": "4.18.0",
66
+ "@cratis/scene.model": "4.18.0",
67
+ "@cratis/scene.react": "4.18.0",
68
68
  "@primereact/core": "11.2.0",
69
69
  "@primereact/headless": "11.2.0",
70
70
  "@storybook/addon-links": "^10.6.1",
@@ -47,4 +47,7 @@ export enum SampleBindingName {
47
47
 
48
48
  /** Records an adjustment against an invoice - the command a dialog submits. */
49
49
  RecordAdjustment = 'RecordAdjustment',
50
+
51
+ /** Changes how the billing module behaves - the command a settings page submits. */
52
+ ChangeBillingSettings = 'ChangeBillingSettings',
50
53
  }
@@ -57,5 +57,43 @@ export const commandFormPageTemplate: ScreenTemplate = {
57
57
  description: 'A generated command form under a header that states the command, with its own action bar.',
58
58
  };
59
59
 
60
+ /**
61
+ * A settings page - the same generated-form shape as `CommandFormPage`, for the command that changes how a
62
+ * module behaves rather than one that records something. The header says what the settings govern, the
63
+ * form follows the settings command, and the bar saves or discards.
64
+ *
65
+ * Settings are a page of their own rather than a dialog because they are visited, read and left; a dialog
66
+ * would hide the module the reader is configuring.
67
+ */
68
+ export const settingsPageTemplate: ScreenTemplate = {
69
+ name: 'SettingsPage',
70
+ fitsSlot: SlotName.Content,
71
+ slots: [{ name: TemplateSlotName.Header }, { name: TemplateSlotName.Body }, { name: TemplateSlotName.Actions }],
72
+ arrangement: {
73
+ root: column([slotLeaf(TemplateSlotName.Header), slotLeaf(TemplateSlotName.Body, { grow: 1 }), slotLeaf(TemplateSlotName.Actions)], 16),
74
+ },
75
+ content: {
76
+ [TemplateSlotName.Header]: [
77
+ arcPageHeader('settings-header', {
78
+ title: 'Billing settings',
79
+ subtitle: 'Payment terms, reminders and numbering for every invoice the module registers',
80
+ section: 'Billing',
81
+ command: SampleBindingName.ChangeBillingSettings,
82
+ }),
83
+ ],
84
+ [TemplateSlotName.Body]: [page('settings-body', '', [commandForm('settings-form', SampleBindingName.ChangeBillingSettings, ['billingId'])])],
85
+ [TemplateSlotName.Actions]: [
86
+ toolbar('settings-actions', [
87
+ toolbarButton('settings-save', 'Save the settings', 'pi pi-save', 'Save'),
88
+ toolbarSeparator('settings-separator'),
89
+ toolbarButton('settings-discard', 'Discard changes', 'pi pi-undo', 'Discard'),
90
+ ]),
91
+ ],
92
+ },
93
+ metadata: { ...componentsBlueprintTemplateProvenance, type: 'Form', category: 'Business / Settings', scopes: [TemplateScope.Module] },
94
+ displayName: 'Settings page',
95
+ description: "A module's settings as a generated command form, with save and discard.",
96
+ };
97
+
60
98
  /** The command-shaped templates. */
61
- export const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate];
99
+ export const commandTemplates: ScreenTemplate[] = [commandFormPageTemplate, settingsPageTemplate];
@@ -24,12 +24,12 @@ export const componentsScreenTemplates: ScreenTemplate[] = [
24
24
  ];
25
25
 
26
26
  /**
27
- * The eight templates that fill the application layout's own `content` slot directly.
27
+ * The nine templates that fill the application layout's own `content` slot directly.
28
28
  *
29
29
  * Kept apart from the nesting chain because `fitsSlot` is resolved against *the containers in scope*, and
30
30
  * these two groups are never in scope together. Each of these is a whole page an application places on its
31
31
  * own; the chain's three are one page assembled from three levels. Resolving them as one set would ask
32
- * `resolveScreenTemplates` which of eight `body`-declaring templates the feature section belongs to, and it
32
+ * `resolveScreenTemplates` which of nine `body`-declaring templates the feature section belongs to, and it
33
33
  * would rightly answer that it cannot tell.
34
34
  */
35
35
  export const componentsPageTemplates: ScreenTemplate[] = [...listTemplates, ...workspaceTemplates, ...commandTemplates, ...editorTemplates];