@cratis/scene.model 4.22.1 → 4.24.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 (110) hide show
  1. package/descriptors/ComponentCategory.ts +40 -0
  2. package/descriptors/ComponentDescriptor.ts +22 -1
  3. package/descriptors/ComponentDesignModeDescriptor.ts +76 -0
  4. package/descriptors/PropertyDescriptor.ts +5 -1
  5. package/descriptors/PropertyEditorKind.ts +56 -1
  6. package/descriptors/PropertyEditorOptions.ts +51 -0
  7. package/descriptors/componentIcon.ts +16 -0
  8. package/descriptors/index.ts +4 -0
  9. package/dist/cjs/descriptors/ComponentCategory.js +25 -0
  10. package/dist/cjs/descriptors/ComponentCategory.js.map +1 -0
  11. package/dist/cjs/descriptors/ComponentDescriptor.js +5 -0
  12. package/dist/cjs/descriptors/ComponentDescriptor.js.map +1 -1
  13. package/dist/cjs/descriptors/ComponentDesignModeDescriptor.js +28 -0
  14. package/dist/cjs/descriptors/ComponentDesignModeDescriptor.js.map +1 -0
  15. package/dist/cjs/descriptors/PropertyDescriptor.js +1 -0
  16. package/dist/cjs/descriptors/PropertyDescriptor.js.map +1 -1
  17. package/dist/cjs/descriptors/PropertyEditorKind.js +23 -2
  18. package/dist/cjs/descriptors/PropertyEditorKind.js.map +1 -1
  19. package/dist/cjs/descriptors/PropertyEditorOptions.js +25 -0
  20. package/dist/cjs/descriptors/PropertyEditorOptions.js.map +1 -0
  21. package/dist/cjs/descriptors/componentIcon.js +19 -0
  22. package/dist/cjs/descriptors/componentIcon.js.map +1 -0
  23. package/dist/cjs/editing/DiagnosticCode.js +5 -0
  24. package/dist/cjs/editing/DiagnosticCode.js.map +1 -1
  25. package/dist/cjs/index.js +23 -0
  26. package/dist/cjs/index.js.map +1 -1
  27. package/dist/cjs/structure/ApplicationStructure.js +10 -0
  28. package/dist/cjs/structure/ApplicationStructure.js.map +1 -0
  29. package/dist/cjs/structure/FeatureNode.js +13 -0
  30. package/dist/cjs/structure/FeatureNode.js.map +1 -0
  31. package/dist/cjs/structure/ModuleNode.js +13 -0
  32. package/dist/cjs/structure/ModuleNode.js.map +1 -0
  33. package/dist/cjs/structure/SliceKind.js +15 -0
  34. package/dist/cjs/structure/SliceKind.js.map +1 -0
  35. package/dist/cjs/structure/SliceNode.js +12 -0
  36. package/dist/cjs/structure/SliceNode.js.map +1 -0
  37. package/dist/esm/descriptors/ComponentCategory.d.ts +13 -0
  38. package/dist/esm/descriptors/ComponentCategory.d.ts.map +1 -0
  39. package/dist/esm/descriptors/ComponentCategory.js +22 -0
  40. package/dist/esm/descriptors/ComponentCategory.js.map +1 -0
  41. package/dist/esm/descriptors/ComponentDescriptor.d.ts +7 -0
  42. package/dist/esm/descriptors/ComponentDescriptor.d.ts.map +1 -1
  43. package/dist/esm/descriptors/ComponentDescriptor.js +5 -0
  44. package/dist/esm/descriptors/ComponentDescriptor.js.map +1 -1
  45. package/dist/esm/descriptors/ComponentDesignModeDescriptor.d.ts +24 -0
  46. package/dist/esm/descriptors/ComponentDesignModeDescriptor.d.ts.map +1 -0
  47. package/dist/esm/descriptors/ComponentDesignModeDescriptor.js +24 -0
  48. package/dist/esm/descriptors/ComponentDesignModeDescriptor.js.map +1 -0
  49. package/dist/esm/descriptors/PropertyDescriptor.d.ts +2 -0
  50. package/dist/esm/descriptors/PropertyDescriptor.d.ts.map +1 -1
  51. package/dist/esm/descriptors/PropertyDescriptor.js +1 -0
  52. package/dist/esm/descriptors/PropertyDescriptor.js.map +1 -1
  53. package/dist/esm/descriptors/PropertyEditorKind.d.ts +17 -0
  54. package/dist/esm/descriptors/PropertyEditorKind.d.ts.map +1 -1
  55. package/dist/esm/descriptors/PropertyEditorKind.js +23 -2
  56. package/dist/esm/descriptors/PropertyEditorKind.js.map +1 -1
  57. package/dist/esm/descriptors/PropertyEditorOptions.d.ts +18 -0
  58. package/dist/esm/descriptors/PropertyEditorOptions.d.ts.map +1 -0
  59. package/dist/esm/descriptors/PropertyEditorOptions.js +22 -0
  60. package/dist/esm/descriptors/PropertyEditorOptions.js.map +1 -0
  61. package/dist/esm/descriptors/componentIcon.d.ts +4 -0
  62. package/dist/esm/descriptors/componentIcon.d.ts.map +1 -0
  63. package/dist/esm/descriptors/componentIcon.js +16 -0
  64. package/dist/esm/descriptors/componentIcon.js.map +1 -0
  65. package/dist/esm/descriptors/index.d.ts +4 -0
  66. package/dist/esm/descriptors/index.d.ts.map +1 -1
  67. package/dist/esm/descriptors/index.js +4 -0
  68. package/dist/esm/descriptors/index.js.map +1 -1
  69. package/dist/esm/editing/DiagnosticCode.d.ts +5 -1
  70. package/dist/esm/editing/DiagnosticCode.d.ts.map +1 -1
  71. package/dist/esm/editing/DiagnosticCode.js +5 -0
  72. package/dist/esm/editing/DiagnosticCode.js.map +1 -1
  73. package/dist/esm/index.d.ts +1 -0
  74. package/dist/esm/index.d.ts.map +1 -1
  75. package/dist/esm/index.js +9 -0
  76. package/dist/esm/index.js.map +1 -1
  77. package/dist/esm/structure/ApplicationStructure.d.ts +6 -0
  78. package/dist/esm/structure/ApplicationStructure.d.ts.map +1 -0
  79. package/dist/esm/structure/ApplicationStructure.js +8 -0
  80. package/dist/esm/structure/ApplicationStructure.js.map +1 -0
  81. package/dist/esm/structure/FeatureNode.d.ts +9 -0
  82. package/dist/esm/structure/FeatureNode.d.ts.map +1 -0
  83. package/dist/esm/structure/FeatureNode.js +11 -0
  84. package/dist/esm/structure/FeatureNode.js.map +1 -0
  85. package/dist/esm/structure/ModuleNode.d.ts +10 -0
  86. package/dist/esm/structure/ModuleNode.d.ts.map +1 -0
  87. package/dist/esm/structure/ModuleNode.js +11 -0
  88. package/dist/esm/structure/ModuleNode.js.map +1 -0
  89. package/dist/esm/structure/SliceKind.d.ts +6 -0
  90. package/dist/esm/structure/SliceKind.d.ts.map +1 -0
  91. package/dist/esm/structure/SliceKind.js +13 -0
  92. package/dist/esm/structure/SliceKind.js.map +1 -0
  93. package/dist/esm/structure/SliceNode.d.ts +8 -0
  94. package/dist/esm/structure/SliceNode.d.ts.map +1 -0
  95. package/dist/esm/structure/SliceNode.js +10 -0
  96. package/dist/esm/structure/SliceNode.js.map +1 -0
  97. package/dist/esm/structure/index.d.ts +6 -0
  98. package/dist/esm/structure/index.d.ts.map +1 -0
  99. package/dist/esm/structure/index.js +6 -0
  100. package/dist/esm/structure/index.js.map +1 -0
  101. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  102. package/editing/DiagnosticCode.ts +6 -0
  103. package/index.ts +1 -0
  104. package/package.json +1 -1
  105. package/structure/ApplicationStructure.ts +17 -0
  106. package/structure/FeatureNode.ts +23 -0
  107. package/structure/ModuleNode.ts +24 -0
  108. package/structure/SliceKind.ts +16 -0
  109. package/structure/SliceNode.ts +20 -0
  110. package/structure/index.ts +8 -0
@@ -63,4 +63,10 @@ export enum DiagnosticCode {
63
63
  IncompatibleIconLibrary = 'incompatibleIconLibrary',
64
64
  IconCatalogUnavailable = 'iconCatalogUnavailable',
65
65
  IconNotVerified = 'iconNotVerified',
66
+
67
+ // Component metadata
68
+ ComponentCategoryMissing = 'componentCategoryMissing',
69
+ ComponentCategoryUnknown = 'componentCategoryUnknown',
70
+ ComponentDesignModeInvalid = 'componentDesignModeInvalid',
71
+ PropertyEditorOptionsInvalid = 'propertyEditorOptionsInvalid',
66
72
  }
package/index.ts CHANGED
@@ -17,3 +17,4 @@ export * from './queries';
17
17
  export * from './descriptors';
18
18
  export * from './exposure';
19
19
  export * from './editing';
20
+ export * from './structure';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene.model",
3
- "version": "4.22.1",
3
+ "version": "4.24.0",
4
4
  "description": "The TypeScript mirror of Cratis.Scene.Model — the platform-agnostic Screen object model.",
5
5
  "keywords": [
6
6
  "cratis",
@@ -0,0 +1,17 @@
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 { ModuleNode } from './ModuleNode';
5
+
6
+ /**
7
+ * A read-only description of which modules, features and slices an application has, and what kind each slice is.
8
+ *
9
+ * It is a reference input supplied by the host (Stage's converter, Studio); it is not persisted in a scene document.
10
+ * Ids are the dotted qualified ids already used by `DestinationReference`, for example `sales.orders.PlaceOrder`.
11
+ */
12
+ export interface ApplicationStructure {
13
+ /** The modules of the application, in declaration order. */
14
+ modules: ModuleNode[];
15
+ }
16
+
17
+ export const ApplicationStructurePropertyNames: (keyof ApplicationStructure)[] = ['modules'];
@@ -0,0 +1,23 @@
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 { SliceNode } from './SliceNode';
5
+
6
+ /**
7
+ * A feature in the application hierarchy; features nest.
8
+ */
9
+ export interface FeatureNode {
10
+ /** The feature identity, unique among its siblings; its qualified form is the dotted path from the module. */
11
+ id: string;
12
+
13
+ /** The display name. */
14
+ name: string;
15
+
16
+ /** The sub-features. */
17
+ features: FeatureNode[];
18
+
19
+ /** The slices that belong directly to this feature. */
20
+ slices: SliceNode[];
21
+ }
22
+
23
+ export const FeatureNodePropertyNames: (keyof FeatureNode)[] = ['id', 'name', 'features', 'slices'];
@@ -0,0 +1,24 @@
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 { FeatureNode } from './FeatureNode';
5
+ import { SliceNode } from './SliceNode';
6
+
7
+ /**
8
+ * A module in the application hierarchy.
9
+ */
10
+ export interface ModuleNode {
11
+ /** The module identity, unique in the application; the first segment of every qualified id below it. */
12
+ id: string;
13
+
14
+ /** The display name. */
15
+ name: string;
16
+
17
+ /** The module's top-level features, first feature first. */
18
+ features: FeatureNode[];
19
+
20
+ /** The slices that belong directly to the module, when it has any. */
21
+ slices?: SliceNode[];
22
+ }
23
+
24
+ export const ModuleNodePropertyNames: (keyof ModuleNode)[] = ['id', 'name', 'features', 'slices'];
@@ -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
+ * What kind of event-model slice a slice node is.
6
+ */
7
+ export enum SliceKind {
8
+ /** A slice that accepts a command - user input that changes state. */
9
+ StateChange = 'StateChange',
10
+
11
+ /** A slice that projects state into a read model for display. */
12
+ StateView = 'StateView',
13
+
14
+ /** A slice that reacts to events without user input. */
15
+ Automation = 'Automation',
16
+ }
@@ -0,0 +1,20 @@
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 { SliceKind } from './SliceKind';
5
+
6
+ /**
7
+ * A slice in the application hierarchy.
8
+ */
9
+ export interface SliceNode {
10
+ /** The slice identity, unique among the siblings of its feature or module; its qualified form is `module.feature.Slice`. */
11
+ id: string;
12
+
13
+ /** The display name. */
14
+ name: string;
15
+
16
+ /** Whether the slice is a state change, a state view or an automation. */
17
+ kind: SliceKind;
18
+ }
19
+
20
+ export const SliceNodePropertyNames: (keyof SliceNode)[] = ['id', 'name', 'kind'];
@@ -0,0 +1,8 @@
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 './SliceKind';
5
+ export * from './SliceNode';
6
+ export * from './FeatureNode';
7
+ export * from './ModuleNode';
8
+ export * from './ApplicationStructure';