@cratis/scene.model 4.26.0 → 4.27.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 (84) hide show
  1. package/descriptors/CollectionOperation.ts +6 -0
  2. package/dist/cjs/descriptors/CollectionOperation.js +4 -0
  3. package/dist/cjs/descriptors/CollectionOperation.js.map +1 -1
  4. package/dist/cjs/exposure/InstanceContribution.js +2 -1
  5. package/dist/cjs/exposure/InstanceContribution.js.map +1 -1
  6. package/dist/cjs/index.js +16 -0
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/navigation/ApplicationLogo.js +13 -0
  9. package/dist/cjs/navigation/ApplicationLogo.js.map +1 -0
  10. package/dist/cjs/navigation/ApplicationNavigation.js +11 -0
  11. package/dist/cjs/navigation/ApplicationNavigation.js.map +1 -0
  12. package/dist/cjs/navigation/ModuleNavigation.js +11 -0
  13. package/dist/cjs/navigation/ModuleNavigation.js.map +1 -0
  14. package/dist/cjs/navigation/NavItem.js +15 -0
  15. package/dist/cjs/navigation/NavItem.js.map +1 -0
  16. package/dist/cjs/navigation/NavigationModel.js +11 -0
  17. package/dist/cjs/navigation/NavigationModel.js.map +1 -0
  18. package/dist/cjs/navigation/NavigationRegion.js +12 -0
  19. package/dist/cjs/navigation/NavigationRegion.js.map +1 -0
  20. package/dist/cjs/navigation/NavigationRegionKind.js +14 -0
  21. package/dist/cjs/navigation/NavigationRegionKind.js.map +1 -0
  22. package/dist/cjs/navigation/NavigationRegionMode.js +15 -0
  23. package/dist/cjs/navigation/NavigationRegionMode.js.map +1 -0
  24. package/dist/esm/descriptors/CollectionOperation.d.ts +2 -1
  25. package/dist/esm/descriptors/CollectionOperation.d.ts.map +1 -1
  26. package/dist/esm/descriptors/CollectionOperation.js +4 -0
  27. package/dist/esm/descriptors/CollectionOperation.js.map +1 -1
  28. package/dist/esm/exposure/InstanceContribution.d.ts +1 -0
  29. package/dist/esm/exposure/InstanceContribution.d.ts.map +1 -1
  30. package/dist/esm/exposure/InstanceContribution.js +2 -1
  31. package/dist/esm/exposure/InstanceContribution.js.map +1 -1
  32. package/dist/esm/index.d.ts +1 -0
  33. package/dist/esm/index.d.ts.map +1 -1
  34. package/dist/esm/index.js +8 -0
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/navigation/ApplicationLogo.d.ts +6 -0
  37. package/dist/esm/navigation/ApplicationLogo.d.ts.map +1 -0
  38. package/dist/esm/navigation/ApplicationLogo.js +11 -0
  39. package/dist/esm/navigation/ApplicationLogo.js.map +1 -0
  40. package/dist/esm/navigation/ApplicationNavigation.d.ts +8 -0
  41. package/dist/esm/navigation/ApplicationNavigation.d.ts.map +1 -0
  42. package/dist/esm/navigation/ApplicationNavigation.js +9 -0
  43. package/dist/esm/navigation/ApplicationNavigation.js.map +1 -0
  44. package/dist/esm/navigation/ModuleNavigation.d.ts +7 -0
  45. package/dist/esm/navigation/ModuleNavigation.d.ts.map +1 -0
  46. package/dist/esm/navigation/ModuleNavigation.js +9 -0
  47. package/dist/esm/navigation/ModuleNavigation.js.map +1 -0
  48. package/dist/esm/navigation/NavItem.d.ts +11 -0
  49. package/dist/esm/navigation/NavItem.d.ts.map +1 -0
  50. package/dist/esm/navigation/NavItem.js +13 -0
  51. package/dist/esm/navigation/NavItem.js.map +1 -0
  52. package/dist/esm/navigation/NavigationModel.d.ts +8 -0
  53. package/dist/esm/navigation/NavigationModel.d.ts.map +1 -0
  54. package/dist/esm/navigation/NavigationModel.js +9 -0
  55. package/dist/esm/navigation/NavigationModel.js.map +1 -0
  56. package/dist/esm/navigation/NavigationRegion.d.ts +10 -0
  57. package/dist/esm/navigation/NavigationRegion.d.ts.map +1 -0
  58. package/dist/esm/navigation/NavigationRegion.js +10 -0
  59. package/dist/esm/navigation/NavigationRegion.js.map +1 -0
  60. package/dist/esm/navigation/NavigationRegionKind.d.ts +5 -0
  61. package/dist/esm/navigation/NavigationRegionKind.d.ts.map +1 -0
  62. package/dist/esm/navigation/NavigationRegionKind.js +12 -0
  63. package/dist/esm/navigation/NavigationRegionKind.js.map +1 -0
  64. package/dist/esm/navigation/NavigationRegionMode.d.ts +6 -0
  65. package/dist/esm/navigation/NavigationRegionMode.d.ts.map +1 -0
  66. package/dist/esm/navigation/NavigationRegionMode.js +13 -0
  67. package/dist/esm/navigation/NavigationRegionMode.js.map +1 -0
  68. package/dist/esm/navigation/index.d.ts +9 -0
  69. package/dist/esm/navigation/index.d.ts.map +1 -0
  70. package/dist/esm/navigation/index.js +9 -0
  71. package/dist/esm/navigation/index.js.map +1 -0
  72. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  73. package/exposure/InstanceContribution.ts +8 -1
  74. package/index.ts +1 -0
  75. package/navigation/ApplicationLogo.ts +15 -0
  76. package/navigation/ApplicationNavigation.ts +18 -0
  77. package/navigation/ModuleNavigation.ts +17 -0
  78. package/navigation/NavItem.ts +32 -0
  79. package/navigation/NavigationModel.ts +18 -0
  80. package/navigation/NavigationRegion.ts +25 -0
  81. package/navigation/NavigationRegionKind.ts +13 -0
  82. package/navigation/NavigationRegionMode.ts +16 -0
  83. package/navigation/index.ts +11 -0
  84. package/package.json +1 -1
@@ -31,6 +31,13 @@ export interface InstanceContribution {
31
31
 
32
32
  /** The items a collection property gets from this instance, in order. */
33
33
  items?: ContributedItem[];
34
+
35
+ /**
36
+ * For a collection: hide the items the owner and the levels above put in it, so only this instance's own items
37
+ * remain. The hidden items stay where they are and come back when this is cleared. It needs the `replace`
38
+ * operation to be exposed.
39
+ */
40
+ replaceOwnerItems?: boolean;
34
41
  }
35
42
 
36
- export const InstanceContributionPropertyNames: (keyof InstanceContribution)[] = ['instance', 'component', 'path', 'value', 'items'];
43
+ export const InstanceContributionPropertyNames: (keyof InstanceContribution)[] = ['instance', 'component', 'path', 'value', 'items', 'replaceOwnerItems'];
package/index.ts CHANGED
@@ -19,3 +19,4 @@ export * from './descriptors';
19
19
  export * from './exposure';
20
20
  export * from './editing';
21
21
  export * from './structure';
22
+ export * from './navigation';
@@ -0,0 +1,15 @@
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
+ * The application's logo. It is defined at the application level only; a module shows it locked.
6
+ */
7
+ export interface ApplicationLogo {
8
+ /** The image reference. */
9
+ image: string;
10
+
11
+ /** The application name shown with or instead of the image. */
12
+ title: string;
13
+ }
14
+
15
+ export const ApplicationLogoPropertyNames: (keyof ApplicationLogo)[] = ['image', 'title'];
@@ -0,0 +1,18 @@
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 { ApplicationLogo } from './ApplicationLogo';
5
+ import { NavigationRegion } from './NavigationRegion';
6
+
7
+ /**
8
+ * The application-level navigation: the base every module inherits, extends or overrides.
9
+ */
10
+ export interface ApplicationNavigation {
11
+ /** The regions the application defines items for. */
12
+ regions: NavigationRegion[];
13
+
14
+ /** The application logo. */
15
+ logo?: ApplicationLogo;
16
+ }
17
+
18
+ export const ApplicationNavigationPropertyNames: (keyof ApplicationNavigation)[] = ['regions', 'logo'];
@@ -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 { NavigationRegion } from './NavigationRegion';
5
+
6
+ /**
7
+ * The navigation a module declares for the regions it changes. A region it does not declare inherits the application's.
8
+ */
9
+ export interface ModuleNavigation {
10
+ /** The module identity. */
11
+ module: string;
12
+
13
+ /** The regions the module changes. */
14
+ regions: NavigationRegion[];
15
+ }
16
+
17
+ export const ModuleNavigationPropertyNames: (keyof ModuleNavigation)[] = ['module', 'regions'];
@@ -0,0 +1,32 @@
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 { DestinationReference } from '../common';
5
+
6
+ /**
7
+ * One item of a navigation region.
8
+ */
9
+ export interface NavItem {
10
+ /** The item identity, unique in its region at the level that owns it. */
11
+ id: string;
12
+
13
+ /** The text shown for the item. */
14
+ title: string;
15
+
16
+ /** Qualified icon reference, when the item has one. */
17
+ icon?: string;
18
+
19
+ /**
20
+ * What the item navigates to: `module`, and optionally `feature` (a dotted path inside the module). A module
21
+ * without a feature goes to the module's first feature.
22
+ */
23
+ target?: DestinationReference;
24
+
25
+ /** The rendering slot - an outlet id - the target renders into; `content`, the primary outlet, when absent. */
26
+ slot?: string;
27
+
28
+ /** The sub-items; only a sidebar item has them. */
29
+ children?: NavItem[];
30
+ }
31
+
32
+ export const NavItemPropertyNames: (keyof NavItem)[] = ['id', 'title', 'icon', 'target', 'slot', 'children'];
@@ -0,0 +1,18 @@
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 { ApplicationNavigation } from './ApplicationNavigation';
5
+ import { ModuleNavigation } from './ModuleNavigation';
6
+
7
+ /**
8
+ * All the navigation an application declares: its own regions and the regions each module changes.
9
+ */
10
+ export interface NavigationModel {
11
+ /** The application-level navigation. */
12
+ application: ApplicationNavigation;
13
+
14
+ /** The per-module navigation; a module that is not listed inherits everything. */
15
+ modules: ModuleNavigation[];
16
+ }
17
+
18
+ export const NavigationModelPropertyNames: (keyof NavigationModel)[] = ['application', 'modules'];
@@ -0,0 +1,25 @@
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 { NavigationRegionKind } from './NavigationRegionKind';
5
+ import { NavigationRegionMode } from './NavigationRegionMode';
6
+ import { NavItem } from './NavItem';
7
+
8
+ /**
9
+ * The items one level (the application or a module) defines for one navigation region.
10
+ */
11
+ export interface NavigationRegion {
12
+ /** Which region the items belong to. */
13
+ region: NavigationRegionKind;
14
+
15
+ /**
16
+ * How a module's items relate to the application's. Absent at the application level, which is the base, and
17
+ * meaning `inherit` at a module.
18
+ */
19
+ mode?: NavigationRegionMode;
20
+
21
+ /** The items, in order. */
22
+ items: NavItem[];
23
+ }
24
+
25
+ export const NavigationRegionPropertyNames: (keyof NavigationRegion)[] = ['region', 'mode', 'items'];
@@ -0,0 +1,13 @@
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
+ * The navigation regions an application shell has.
6
+ */
7
+ export enum NavigationRegionKind {
8
+ /** The flat strip along the top. */
9
+ Topbar = 'topbar',
10
+
11
+ /** The side list, whose items may have sub-items. */
12
+ Sidebar = 'sidebar',
13
+ }
@@ -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 a module's region relates to the application's items for the same region.
6
+ */
7
+ export enum NavigationRegionMode {
8
+ /** Effective items are the application items; the module's own items are cleared. */
9
+ Inherit = 'inherit',
10
+
11
+ /** Effective items are the application items followed by the module's items. */
12
+ Extend = 'extend',
13
+
14
+ /** Effective items are the module's items only. */
15
+ Override = 'override',
16
+ }
@@ -0,0 +1,11 @@
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 './NavigationRegionKind';
5
+ export * from './NavigationRegionMode';
6
+ export * from './NavItem';
7
+ export * from './NavigationRegion';
8
+ export * from './ApplicationLogo';
9
+ export * from './ApplicationNavigation';
10
+ export * from './ModuleNavigation';
11
+ export * from './NavigationModel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/scene.model",
3
- "version": "4.26.0",
3
+ "version": "4.27.0",
4
4
  "description": "The TypeScript mirror of Cratis.Scene.Model — the platform-agnostic Screen object model.",
5
5
  "keywords": [
6
6
  "cratis",