@cratis/scene.model 4.27.0 → 4.28.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 (42) hide show
  1. package/dist/cjs/index.js +6 -0
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/structure/SliceNode.js +3 -1
  4. package/dist/cjs/structure/SliceNode.js.map +1 -1
  5. package/dist/cjs/toolbar/Toolbar.js +10 -0
  6. package/dist/cjs/toolbar/Toolbar.js.map +1 -0
  7. package/dist/cjs/toolbar/ToolbarButton.js +15 -0
  8. package/dist/cjs/toolbar/ToolbarButton.js.map +1 -0
  9. package/dist/cjs/toolbar/ToolbarEmphasis.js +15 -0
  10. package/dist/cjs/toolbar/ToolbarEmphasis.js.map +1 -0
  11. package/dist/esm/index.d.ts +1 -0
  12. package/dist/esm/index.d.ts.map +1 -1
  13. package/dist/esm/index.js +3 -0
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/structure/SliceNode.d.ts +2 -0
  16. package/dist/esm/structure/SliceNode.d.ts.map +1 -1
  17. package/dist/esm/structure/SliceNode.js +3 -1
  18. package/dist/esm/structure/SliceNode.js.map +1 -1
  19. package/dist/esm/toolbar/Toolbar.d.ts +6 -0
  20. package/dist/esm/toolbar/Toolbar.d.ts.map +1 -0
  21. package/dist/esm/toolbar/Toolbar.js +8 -0
  22. package/dist/esm/toolbar/Toolbar.js.map +1 -0
  23. package/dist/esm/toolbar/ToolbarButton.d.ts +11 -0
  24. package/dist/esm/toolbar/ToolbarButton.d.ts.map +1 -0
  25. package/dist/esm/toolbar/ToolbarButton.js +13 -0
  26. package/dist/esm/toolbar/ToolbarButton.js.map +1 -0
  27. package/dist/esm/toolbar/ToolbarEmphasis.d.ts +6 -0
  28. package/dist/esm/toolbar/ToolbarEmphasis.d.ts.map +1 -0
  29. package/dist/esm/toolbar/ToolbarEmphasis.js +13 -0
  30. package/dist/esm/toolbar/ToolbarEmphasis.js.map +1 -0
  31. package/dist/esm/toolbar/index.d.ts +4 -0
  32. package/dist/esm/toolbar/index.d.ts.map +1 -0
  33. package/dist/esm/toolbar/index.js +4 -0
  34. package/dist/esm/toolbar/index.js.map +1 -0
  35. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  36. package/index.ts +1 -0
  37. package/package.json +1 -1
  38. package/structure/SliceNode.ts +7 -1
  39. package/toolbar/Toolbar.ts +14 -0
  40. package/toolbar/ToolbarButton.ts +36 -0
  41. package/toolbar/ToolbarEmphasis.ts +16 -0
  42. package/toolbar/index.ts +6 -0
package/index.ts CHANGED
@@ -20,3 +20,4 @@ export * from './exposure';
20
20
  export * from './editing';
21
21
  export * from './structure';
22
22
  export * from './navigation';
23
+ export * from './toolbar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene.model",
3
- "version": "4.27.0",
3
+ "version": "4.28.0",
4
4
  "description": "The TypeScript mirror of Cratis.Scene.Model — the platform-agnostic Screen object model.",
5
5
  "keywords": [
6
6
  "cratis",
@@ -15,6 +15,12 @@ export interface SliceNode {
15
15
 
16
16
  /** Whether the slice is a state change, a state view or an automation. */
17
17
  kind: SliceKind;
18
+
19
+ /** The command a state change slice accepts; the slice `id` when absent. */
20
+ command?: string;
21
+
22
+ /** The dialog template the slice opens as a task dialog; the host's default form dialog when absent. */
23
+ dialogTemplate?: string;
18
24
  }
19
25
 
20
- export const SliceNodePropertyNames: (keyof SliceNode)[] = ['id', 'name', 'kind'];
26
+ export const SliceNodePropertyNames: (keyof SliceNode)[] = ['id', 'name', 'kind', 'command', 'dialogTemplate'];
@@ -0,0 +1,14 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ToolbarButton } from './ToolbarButton';
5
+
6
+ /**
7
+ * The buttons of a toolbar, in order.
8
+ */
9
+ export interface Toolbar {
10
+ /** The buttons. */
11
+ buttons: ToolbarButton[];
12
+ }
13
+
14
+ export const ToolbarPropertyNames: (keyof Toolbar)[] = ['buttons'];
@@ -0,0 +1,36 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { ToolbarEmphasis } from './ToolbarEmphasis';
5
+
6
+ /**
7
+ * A toolbar button that invokes a state change slice. It is a `core:toolbarItem` with `kind: Action`, a `slice`
8
+ * and an `emphasis`.
9
+ */
10
+ export interface ToolbarButton {
11
+ /** The button identity. */
12
+ id: string;
13
+
14
+ /** The text shown on the button. */
15
+ title: string;
16
+
17
+ /**
18
+ * The qualified id of the state change slice the button invokes, for example `sales.orders.PlaceOrder`; absent
19
+ * for a button that has none yet.
20
+ */
21
+ slice?: string;
22
+
23
+ /** How prominent the button is; `secondary` when absent. */
24
+ emphasis?: ToolbarEmphasis;
25
+
26
+ /** Qualified icon reference, when the button has one. */
27
+ icon?: string;
28
+
29
+ /**
30
+ * The command a hand-authored button names instead of a slice. It is turned into the slice that accepts the command
31
+ * when exactly one does.
32
+ */
33
+ target?: string;
34
+ }
35
+
36
+ export const ToolbarButtonPropertyNames: (keyof ToolbarButton)[] = ['id', 'title', 'slice', 'emphasis', 'icon', 'target'];
@@ -0,0 +1,16 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ /**
5
+ * How prominent a toolbar button is.
6
+ */
7
+ export enum ToolbarEmphasis {
8
+ /** The main action of the page: a solid, accented button. */
9
+ Primary = 'primary',
10
+
11
+ /** A regular action: an outlined button. The default. */
12
+ Secondary = 'secondary',
13
+
14
+ /** A minor action: a plain button without a frame. */
15
+ Quiet = 'quiet',
16
+ }
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ export * from './ToolbarEmphasis';
5
+ export * from './ToolbarButton';
6
+ export * from './Toolbar';