@cratis/scene.model 4.38.0 → 4.40.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.
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/packages/BlueprintMetadata.js +14 -0
- package/dist/cjs/packages/BlueprintMetadata.js.map +1 -0
- package/dist/cjs/packages/BlueprintScreen.js +16 -0
- package/dist/cjs/packages/BlueprintScreen.js.map +1 -0
- package/dist/cjs/packages/ScenePackage.js +2 -1
- package/dist/cjs/packages/ScenePackage.js.map +1 -1
- package/dist/cjs/screens/TemplateMetadata.js +2 -1
- package/dist/cjs/screens/TemplateMetadata.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/packages/BlueprintMetadata.d.ts +10 -0
- package/dist/esm/packages/BlueprintMetadata.d.ts.map +1 -0
- package/dist/esm/packages/BlueprintMetadata.js +12 -0
- package/dist/esm/packages/BlueprintMetadata.js.map +1 -0
- package/dist/esm/packages/BlueprintScreen.d.ts +12 -0
- package/dist/esm/packages/BlueprintScreen.d.ts.map +1 -0
- package/dist/esm/packages/BlueprintScreen.js +14 -0
- package/dist/esm/packages/BlueprintScreen.js.map +1 -0
- package/dist/esm/packages/ScenePackage.d.ts +2 -0
- package/dist/esm/packages/ScenePackage.d.ts.map +1 -1
- package/dist/esm/packages/ScenePackage.js +2 -1
- package/dist/esm/packages/ScenePackage.js.map +1 -1
- package/dist/esm/packages/index.d.ts +2 -0
- package/dist/esm/packages/index.d.ts.map +1 -1
- package/dist/esm/packages/index.js +2 -0
- package/dist/esm/packages/index.js.map +1 -1
- package/dist/esm/screens/TemplateMetadata.d.ts +1 -0
- package/dist/esm/screens/TemplateMetadata.d.ts.map +1 -1
- package/dist/esm/screens/TemplateMetadata.js +2 -1
- package/dist/esm/screens/TemplateMetadata.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/packages/BlueprintMetadata.ts +31 -0
- package/packages/BlueprintScreen.ts +34 -0
- package/packages/ScenePackage.ts +9 -0
- package/packages/index.ts +2 -0
- package/screens/TemplateMetadata.ts +4 -1
package/package.json
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
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 { BlueprintScreen } from './BlueprintScreen';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What a domain blueprint declares about itself beyond what every package does: the business domain it serves, how it
|
|
8
|
+
* is described in a gallery, and the ready-to-use screens it brings with their navigation.
|
|
9
|
+
*
|
|
10
|
+
* A blueprint's own version is {@link ScenePackage.version}: there is deliberately no second version here to drift from
|
|
11
|
+
* it. That version is what a template reference pins (`TemplateReference.version`) and what "update available" compares.
|
|
12
|
+
* Its sample-data packs are {@link ScenePackage.sampleData}; {@link BlueprintMetadata.defaultSampleData} chooses among them.
|
|
13
|
+
*/
|
|
14
|
+
export interface BlueprintMetadata {
|
|
15
|
+
/** The business domain, as a lower-case slug (`crm`, `project-tracker`). Templates of the blueprint are categorised under `Business / <domain>`. */
|
|
16
|
+
domain: string;
|
|
17
|
+
|
|
18
|
+
/** One sentence, up to 200 characters, saying what the blueprint gives an application. Shown under the thumbnail in a gallery. */
|
|
19
|
+
description: string;
|
|
20
|
+
|
|
21
|
+
/** The package-relative path of the gallery thumbnail, `thumbnails/<name>.png`, `.webp`, `.jpg` or `.svg`. It is design-time only and never part of a runtime bundle. */
|
|
22
|
+
thumbnail: string;
|
|
23
|
+
|
|
24
|
+
/** The ready-to-use screens, in navigation order. */
|
|
25
|
+
screenSet: BlueprintScreen[];
|
|
26
|
+
|
|
27
|
+
/** The id of the sample-data pack a gallery preview and a new application start with; one of the package's `sampleData` ids. Required when the package ships more than one. */
|
|
28
|
+
defaultSampleData?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const BlueprintMetadataPropertyNames: (keyof BlueprintMetadata)[] = ['domain', 'description', 'thumbnail', 'screenSet', 'defaultSampleData'];
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { IconReference } from '../icons';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One screen of a domain blueprint's ready-to-use screen set, with where it sits in the navigation the blueprint
|
|
8
|
+
* brings. The screen itself (its layout, template and content) is a `Screen` the package provides under the same
|
|
9
|
+
* name; this is the part a gallery and a navigation builder need without loading it.
|
|
10
|
+
*/
|
|
11
|
+
export interface BlueprintScreen {
|
|
12
|
+
/** The name of the {@link Screen} the package provides. Unique within the screen set. */
|
|
13
|
+
name: string;
|
|
14
|
+
|
|
15
|
+
/** The title shown in the navigation and in the gallery. */
|
|
16
|
+
title: string;
|
|
17
|
+
|
|
18
|
+
/** One sentence saying what the screen is for. */
|
|
19
|
+
description?: string;
|
|
20
|
+
|
|
21
|
+
/** The name of the screen template the screen is built from, when it is built from one. */
|
|
22
|
+
template?: string;
|
|
23
|
+
|
|
24
|
+
/** The name of the screen this one sits under in the navigation; absent for a top-level screen. */
|
|
25
|
+
parent?: string;
|
|
26
|
+
|
|
27
|
+
/** Where the screen sits among its siblings; lower comes first, and screens without an order keep the order they are written in. */
|
|
28
|
+
order?: number;
|
|
29
|
+
|
|
30
|
+
/** The icon beside the title in the navigation. */
|
|
31
|
+
icon?: IconReference;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const BlueprintScreenPropertyNames: (keyof BlueprintScreen)[] = ['name', 'title', 'description', 'template', 'parent', 'order', 'icon'];
|
package/packages/ScenePackage.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { PackageDesignTimeMetadata } from '../descriptors';
|
|
|
5
5
|
import { IconLibrary } from '../icons';
|
|
6
6
|
import { PackageDependency } from './PackageDependency';
|
|
7
7
|
import { SampleDataPackReference } from '../sampleData';
|
|
8
|
+
import { BlueprintMetadata } from './BlueprintMetadata';
|
|
8
9
|
import { PackageKind } from './PackageKind';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -109,6 +110,13 @@ export interface ScenePackage {
|
|
|
109
110
|
* Stage production build never includes or resolves them.
|
|
110
111
|
*/
|
|
111
112
|
sampleData?: SampleDataPackReference[];
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* What a domain blueprint declares about itself: its domain, gallery description and thumbnail, and its ready-to-use
|
|
116
|
+
* screen set. Present for a domain {@link PackageKind.Blueprint}; a blueprint that only provides foundation layouts
|
|
117
|
+
* and templates has none.
|
|
118
|
+
*/
|
|
119
|
+
blueprint?: BlueprintMetadata;
|
|
112
120
|
}
|
|
113
121
|
|
|
114
122
|
export const ScenePackagePropertyNames: (keyof ScenePackage)[] = [
|
|
@@ -131,4 +139,5 @@ export const ScenePackagePropertyNames: (keyof ScenePackage)[] = [
|
|
|
131
139
|
'assets',
|
|
132
140
|
'runtimeSingletons',
|
|
133
141
|
'sampleData',
|
|
142
|
+
'blueprint',
|
|
134
143
|
];
|
package/packages/index.ts
CHANGED
|
@@ -39,8 +39,11 @@ export interface TemplateMetadata {
|
|
|
39
39
|
* presents something. Declaring slice kinds without scopes makes the default scope Slice.
|
|
40
40
|
*/
|
|
41
41
|
sliceKinds?: SliceKind[];
|
|
42
|
+
|
|
43
|
+
/** The package-relative path of the template's gallery thumbnail (`thumbnails/<name>.png|webp|jpg|svg`); required of every template of a domain blueprint. */
|
|
44
|
+
thumbnail?: string;
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
export const TemplateMetadataPropertyNames: (keyof TemplateMetadata)[] = [
|
|
45
|
-
'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl', 'sliceKinds',
|
|
48
|
+
'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl', 'sliceKinds', 'thumbnail',
|
|
46
49
|
];
|