@cratis/scene.model 4.12.0 → 4.13.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/descriptors/PackageDesignTimeMetadata.ts +7 -1
- package/dist/cjs/descriptors/PackageDesignTimeMetadata.js +2 -1
- package/dist/cjs/descriptors/PackageDesignTimeMetadata.js.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/screens/Outlet.js +2 -1
- package/dist/cjs/screens/Outlet.js.map +1 -1
- package/dist/cjs/screens/TemplateAttribution.js +14 -0
- package/dist/cjs/screens/TemplateAttribution.js.map +1 -0
- package/dist/cjs/screens/TemplateCompatibility.js +11 -0
- package/dist/cjs/screens/TemplateCompatibility.js.map +1 -0
- package/dist/cjs/screens/TemplateMetadata.js +5 -1
- package/dist/cjs/screens/TemplateMetadata.js.map +1 -1
- package/dist/esm/descriptors/PackageDesignTimeMetadata.d.ts +1 -0
- package/dist/esm/descriptors/PackageDesignTimeMetadata.d.ts.map +1 -1
- package/dist/esm/descriptors/PackageDesignTimeMetadata.js +2 -1
- package/dist/esm/descriptors/PackageDesignTimeMetadata.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/screens/Outlet.d.ts +1 -0
- package/dist/esm/screens/Outlet.d.ts.map +1 -1
- package/dist/esm/screens/Outlet.js +2 -1
- package/dist/esm/screens/Outlet.js.map +1 -1
- package/dist/esm/screens/TemplateAttribution.d.ts +7 -0
- package/dist/esm/screens/TemplateAttribution.d.ts.map +1 -0
- package/dist/esm/screens/TemplateAttribution.js +12 -0
- package/dist/esm/screens/TemplateAttribution.js.map +1 -0
- package/dist/esm/screens/TemplateCompatibility.d.ts +7 -0
- package/dist/esm/screens/TemplateCompatibility.d.ts.map +1 -0
- package/dist/esm/screens/TemplateCompatibility.js +9 -0
- package/dist/esm/screens/TemplateCompatibility.js.map +1 -0
- package/dist/esm/screens/TemplateMetadata.d.ts +6 -0
- package/dist/esm/screens/TemplateMetadata.d.ts.map +1 -1
- package/dist/esm/screens/TemplateMetadata.js +5 -1
- package/dist/esm/screens/TemplateMetadata.js.map +1 -1
- package/dist/esm/screens/index.d.ts +2 -0
- package/dist/esm/screens/index.d.ts.map +1 -1
- package/dist/esm/screens/index.js +2 -0
- package/dist/esm/screens/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/screens/Outlet.ts +8 -1
- package/screens/TemplateAttribution.ts +18 -0
- package/screens/TemplateCompatibility.ts +21 -0
- package/screens/TemplateMetadata.ts +14 -1
- package/screens/index.ts +2 -0
package/package.json
CHANGED
package/screens/Outlet.ts
CHANGED
|
@@ -10,6 +10,13 @@ export interface Outlet {
|
|
|
10
10
|
|
|
11
11
|
/** Optional description for designers. */
|
|
12
12
|
description?: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The semantic template types (`TemplateMetadata.type`) a screen must have to be placed in this outlet,
|
|
16
|
+
* such as `Detail` or `Form`. Absent accepts any screen. A destination that places a screen of another
|
|
17
|
+
* type here is diagnosed as an incompatible outlet rather than rendered somewhere it was not designed for.
|
|
18
|
+
*/
|
|
19
|
+
accepts?: string[];
|
|
13
20
|
}
|
|
14
21
|
|
|
15
|
-
export const OutletPropertyNames: (keyof Outlet)[] = ['name', 'description'];
|
|
22
|
+
export const OutletPropertyNames: (keyof Outlet)[] = ['name', 'description', 'accepts'];
|
|
@@ -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
|
+
/**
|
|
5
|
+
* Who authored a template and what must accompany it when it is reused.
|
|
6
|
+
*/
|
|
7
|
+
export interface TemplateAttribution {
|
|
8
|
+
/** The person or organization that authored the template. */
|
|
9
|
+
author: string;
|
|
10
|
+
|
|
11
|
+
/** An absolute `https` URL where the template's source or documentation lives. */
|
|
12
|
+
url?: string;
|
|
13
|
+
|
|
14
|
+
/** An attribution notice a license requires to travel with the template, shown by a template browser. */
|
|
15
|
+
notice?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const TemplateAttributionPropertyNames: (keyof TemplateAttribution)[] = ['author', 'url', 'notice'];
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { PackageDependency } from '../packages/PackageDependency';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which Scene and package versions a template was authored and verified against.
|
|
8
|
+
*
|
|
9
|
+
* A template names components, slots and bindings that only exist in particular versions of Scene and of
|
|
10
|
+
* the packages that provide them. Declaring the ranges lets a catalog mark a template as incompatible with
|
|
11
|
+
* the active package set before an author picks it, instead of rendering placeholders after they have.
|
|
12
|
+
*/
|
|
13
|
+
export interface TemplateCompatibility {
|
|
14
|
+
/** The Scene model version range the template requires, such as `^4.13.0`. */
|
|
15
|
+
scene: string;
|
|
16
|
+
|
|
17
|
+
/** The packages, and their version ranges, whose components or layouts the template uses. */
|
|
18
|
+
packages?: PackageDependency[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const TemplateCompatibilityPropertyNames: (keyof TemplateCompatibility)[] = ['scene', 'packages'];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
|
+
import { TemplateAttribution } from './TemplateAttribution';
|
|
5
|
+
import { TemplateCompatibility } from './TemplateCompatibility';
|
|
6
|
+
|
|
4
7
|
/** The application hierarchy at which a reusable template is selected. */
|
|
5
8
|
export enum TemplateScope {
|
|
6
9
|
Application = 'Application',
|
|
@@ -21,6 +24,16 @@ export interface TemplateMetadata {
|
|
|
21
24
|
category?: string;
|
|
22
25
|
/** Explicit scope restriction. Absent uses the structural role; an empty list allows no scope. */
|
|
23
26
|
scopes?: TemplateScope[];
|
|
27
|
+
/** The Scene and package versions the template requires. Required for every shipped template. */
|
|
28
|
+
compatibility?: TemplateCompatibility;
|
|
29
|
+
/** Who authored the template. Required for every shipped template. */
|
|
30
|
+
attribution?: TemplateAttribution;
|
|
31
|
+
/** The SPDX license identifier the template is available under, such as `MIT`. Required for every shipped template. */
|
|
32
|
+
license?: string;
|
|
33
|
+
/** An absolute `https` URL to the license terms. */
|
|
34
|
+
licenseUrl?: string;
|
|
24
35
|
}
|
|
25
36
|
|
|
26
|
-
export const TemplateMetadataPropertyNames: (keyof TemplateMetadata)[] = [
|
|
37
|
+
export const TemplateMetadataPropertyNames: (keyof TemplateMetadata)[] = [
|
|
38
|
+
'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl',
|
|
39
|
+
];
|
package/screens/index.ts
CHANGED