@cratis/scene.model 4.68.3 → 4.69.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 +12 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/profiles/CornerStyle.js +13 -0
- package/dist/cjs/profiles/CornerStyle.js.map +1 -0
- package/dist/cjs/profiles/LogoKind.js +13 -0
- package/dist/cjs/profiles/LogoKind.js.map +1 -0
- package/dist/cjs/profiles/ProfileAppearance.js +3 -1
- package/dist/cjs/profiles/ProfileAppearance.js.map +1 -1
- package/dist/cjs/profiles/ProfileIdentity.js +12 -0
- package/dist/cjs/profiles/ProfileIdentity.js.map +1 -0
- package/dist/cjs/profiles/ProfileLogo.js +13 -0
- package/dist/cjs/profiles/ProfileLogo.js.map +1 -0
- package/dist/cjs/profiles/UiProfile.js +2 -1
- package/dist/cjs/profiles/UiProfile.js.map +1 -1
- package/dist/cjs/sampleData/SampleDataPackReference.js +6 -5
- package/dist/cjs/sampleData/SampleDataPackReference.js.map +1 -1
- package/dist/cjs/sampleData/SampleStatus.js +14 -0
- package/dist/cjs/sampleData/SampleStatus.js.map +1 -0
- package/dist/cjs/sampleData/SampleStatusClassification.js +13 -0
- package/dist/cjs/sampleData/SampleStatusClassification.js.map +1 -0
- package/dist/cjs/screens/TemplateMetadata.js +4 -1
- package/dist/cjs/screens/TemplateMetadata.js.map +1 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/profiles/CornerStyle.d.ts +6 -0
- package/dist/esm/profiles/CornerStyle.d.ts.map +1 -0
- package/dist/esm/profiles/CornerStyle.js +11 -0
- package/dist/esm/profiles/CornerStyle.js.map +1 -0
- package/dist/esm/profiles/LogoKind.d.ts +6 -0
- package/dist/esm/profiles/LogoKind.d.ts.map +1 -0
- package/dist/esm/profiles/LogoKind.js +11 -0
- package/dist/esm/profiles/LogoKind.js.map +1 -0
- package/dist/esm/profiles/ProfileAppearance.d.ts +3 -0
- package/dist/esm/profiles/ProfileAppearance.d.ts.map +1 -1
- package/dist/esm/profiles/ProfileAppearance.js +3 -1
- package/dist/esm/profiles/ProfileAppearance.js.map +1 -1
- package/dist/esm/profiles/ProfileIdentity.d.ts +8 -0
- package/dist/esm/profiles/ProfileIdentity.d.ts.map +1 -0
- package/dist/esm/profiles/ProfileIdentity.js +10 -0
- package/dist/esm/profiles/ProfileIdentity.js.map +1 -0
- package/dist/esm/profiles/ProfileLogo.d.ts +9 -0
- package/dist/esm/profiles/ProfileLogo.d.ts.map +1 -0
- package/dist/esm/profiles/ProfileLogo.js +11 -0
- package/dist/esm/profiles/ProfileLogo.js.map +1 -0
- package/dist/esm/profiles/UiProfile.d.ts +2 -0
- package/dist/esm/profiles/UiProfile.d.ts.map +1 -1
- package/dist/esm/profiles/UiProfile.js +2 -1
- package/dist/esm/profiles/UiProfile.js.map +1 -1
- package/dist/esm/profiles/index.d.ts +4 -0
- package/dist/esm/profiles/index.d.ts.map +1 -1
- package/dist/esm/profiles/index.js +4 -0
- package/dist/esm/profiles/index.js.map +1 -1
- package/dist/esm/sampleData/SampleDataPackReference.d.ts +5 -0
- package/dist/esm/sampleData/SampleDataPackReference.d.ts.map +1 -1
- package/dist/esm/sampleData/SampleDataPackReference.js +6 -5
- package/dist/esm/sampleData/SampleDataPackReference.js.map +1 -1
- package/dist/esm/sampleData/SampleStatus.d.ts +7 -0
- package/dist/esm/sampleData/SampleStatus.d.ts.map +1 -0
- package/dist/esm/sampleData/SampleStatus.js +12 -0
- package/dist/esm/sampleData/SampleStatus.js.map +1 -0
- package/dist/esm/sampleData/SampleStatusClassification.d.ts +8 -0
- package/dist/esm/sampleData/SampleStatusClassification.d.ts.map +1 -0
- package/dist/esm/sampleData/SampleStatusClassification.js +11 -0
- package/dist/esm/sampleData/SampleStatusClassification.js.map +1 -0
- package/dist/esm/sampleData/index.d.ts +2 -0
- package/dist/esm/sampleData/index.d.ts.map +1 -1
- package/dist/esm/sampleData/index.js +2 -0
- package/dist/esm/sampleData/index.js.map +1 -1
- package/dist/esm/screens/TemplateMetadata.d.ts +3 -0
- package/dist/esm/screens/TemplateMetadata.d.ts.map +1 -1
- package/dist/esm/screens/TemplateMetadata.js +4 -1
- package/dist/esm/screens/TemplateMetadata.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/profiles/CornerStyle.ts +14 -0
- package/profiles/LogoKind.ts +14 -0
- package/profiles/ProfileAppearance.ts +9 -2
- package/profiles/ProfileIdentity.ts +21 -0
- package/profiles/ProfileLogo.ts +27 -0
- package/profiles/UiProfile.ts +6 -1
- package/profiles/index.ts +4 -0
- package/sampleData/SampleDataPackReference.ts +15 -1
- package/sampleData/SampleStatus.ts +17 -0
- package/sampleData/SampleStatusClassification.ts +15 -0
- package/sampleData/index.ts +2 -0
- package/screens/TemplateMetadata.ts +10 -1
package/package.json
CHANGED
|
@@ -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
|
+
/** How rounded the corners of buttons, cards, the logo block and menu items are. */
|
|
5
|
+
export enum CornerStyle {
|
|
6
|
+
/** Square-ish corners: 4 px. */
|
|
7
|
+
Sharp = 'Sharp',
|
|
8
|
+
|
|
9
|
+
/** The theme's own corner radius. The default. */
|
|
10
|
+
Default = 'Default',
|
|
11
|
+
|
|
12
|
+
/** Generously rounded corners: 18 px. */
|
|
13
|
+
Round = 'Round',
|
|
14
|
+
}
|
|
@@ -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
|
+
/** How the application's logo is made: characters on the accent block, an icon on the accent block, or the author's own image. */
|
|
5
|
+
export enum LogoKind {
|
|
6
|
+
/** One or two characters on a block in the accent colour. The default. */
|
|
7
|
+
Initials = 'Initials',
|
|
8
|
+
|
|
9
|
+
/** One icon from the closed set of logo icons on a block in the accent colour. */
|
|
10
|
+
Icon = 'Icon',
|
|
11
|
+
|
|
12
|
+
/** The author's own image, drawn without the accent block. */
|
|
13
|
+
Image = 'Image',
|
|
14
|
+
}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
4
|
import { ColorScheme } from './ColorScheme';
|
|
5
|
+
import { CornerStyle } from './CornerStyle';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* How an application looks beyond the {@link UiProfile.theme} it selects: the colour scheme
|
|
8
|
+
* How an application looks beyond the {@link UiProfile.theme} it selects: the colour scheme, the accent colour, the corner style and the font.
|
|
8
9
|
*/
|
|
9
10
|
export interface ProfileAppearance {
|
|
10
11
|
/** Whether the application is light, dark or follows the system. Absent leaves the theme's own default. */
|
|
@@ -12,6 +13,12 @@ export interface ProfileAppearance {
|
|
|
12
13
|
|
|
13
14
|
/** The accent colour as a CSS colour (for example `#4f46e5`). Absent keeps the theme's accent. */
|
|
14
15
|
accent?: string;
|
|
16
|
+
|
|
17
|
+
/** How rounded corners are. Absent keeps the theme's own corner radius. */
|
|
18
|
+
corners?: CornerStyle;
|
|
19
|
+
|
|
20
|
+
/** The font, by the id of an entry in the font catalog (for example `inter`). Absent keeps the theme's own font. */
|
|
21
|
+
font?: string;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
|
-
export const ProfileAppearancePropertyNames: (keyof ProfileAppearance)[] = ['colorScheme', 'accent'];
|
|
24
|
+
export const ProfileAppearancePropertyNames: (keyof ProfileAppearance)[] = ['colorScheme', 'accent', 'corners', 'font'];
|
|
@@ -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 { ProfileLogo } from './ProfileLogo';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Who the application is: the name and the logo every blueprint draws, set once for the whole application. Switching the shell or the menu
|
|
8
|
+
* mode never changes them; changing them changes every blueprint at once.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProfileIdentity {
|
|
11
|
+
/** The application name the shell shows. Absent means the host's application name. */
|
|
12
|
+
name?: string;
|
|
13
|
+
|
|
14
|
+
/** The logo. Absent means initials taken from the name. */
|
|
15
|
+
logo?: ProfileLogo;
|
|
16
|
+
|
|
17
|
+
/** Whether the name is shown beside the logo mark. Absent means it is shown. */
|
|
18
|
+
showName?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const ProfileIdentityPropertyNames: (keyof ProfileIdentity)[] = ['name', 'logo', 'showName'];
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { LogoKind } from './LogoKind';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The application's logo. Every member is kept even when the {@link ProfileLogo.kind} does not use it, so switching the type
|
|
8
|
+
* back shows what was entered before.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProfileLogo {
|
|
11
|
+
/** How the logo is made. Absent means initials. */
|
|
12
|
+
kind?: LogoKind;
|
|
13
|
+
|
|
14
|
+
/** Up to two characters for the initials logo. Empty or absent means the first letter of the name, upper-cased. */
|
|
15
|
+
initials?: string;
|
|
16
|
+
|
|
17
|
+
/** One of the closed set of logo icons (see `logoIcons` in the engine) for the icon logo. */
|
|
18
|
+
icon?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The image for the image logo, as a `data:` URI with base64 content (PNG, JPG, SVG or WebP, up to 400 KB of image data).
|
|
22
|
+
* The image travels inline in the profile so it is stored and exported with it.
|
|
23
|
+
*/
|
|
24
|
+
image?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const ProfileLogoPropertyNames: (keyof ProfileLogo)[] = ['kind', 'initials', 'icon', 'image'];
|
package/profiles/UiProfile.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { SampleDataSelection } from '../sampleData';
|
|
5
5
|
import { ProfileAppearance } from './ProfileAppearance';
|
|
6
6
|
import { ProfileDefaults } from './ProfileDefaults';
|
|
7
|
+
import { ProfileIdentity } from './ProfileIdentity';
|
|
7
8
|
import { RootTemplate } from './RootTemplate';
|
|
8
9
|
import { TargetSizeClass } from '../sizeClasses';
|
|
9
10
|
|
|
@@ -67,11 +68,14 @@ export interface UiProfile {
|
|
|
67
68
|
*/
|
|
68
69
|
root?: RootTemplate;
|
|
69
70
|
|
|
70
|
-
/** The colour scheme
|
|
71
|
+
/** The colour scheme, accent colour, corner style and font the application presents. Absent keeps the theme's defaults. */
|
|
71
72
|
appearance?: ProfileAppearance;
|
|
72
73
|
|
|
73
74
|
/** Application-wide authoring defaults such as the template new screens start from. Absent for none. */
|
|
74
75
|
defaults?: ProfileDefaults;
|
|
76
|
+
|
|
77
|
+
/** The application's name and logo, set once and drawn by every blueprint. Absent uses the host's application name and initials taken from it. */
|
|
78
|
+
identity?: ProfileIdentity;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
export const UiProfilePropertyNames: (keyof UiProfile)[] = [
|
|
@@ -85,4 +89,5 @@ export const UiProfilePropertyNames: (keyof UiProfile)[] = [
|
|
|
85
89
|
'root',
|
|
86
90
|
'appearance',
|
|
87
91
|
'defaults',
|
|
92
|
+
'identity',
|
|
88
93
|
];
|
package/profiles/index.ts
CHANGED
|
@@ -5,5 +5,9 @@ export * from './UiProfile';
|
|
|
5
5
|
export * from './Theme';
|
|
6
6
|
export * from './ColorScheme';
|
|
7
7
|
export * from './ProfileAppearance';
|
|
8
|
+
export * from './CornerStyle';
|
|
9
|
+
export * from './LogoKind';
|
|
10
|
+
export * from './ProfileLogo';
|
|
11
|
+
export * from './ProfileIdentity';
|
|
8
12
|
export * from './ProfileDefaults';
|
|
9
13
|
export * from './RootTemplate';
|
|
@@ -1,6 +1,8 @@
|
|
|
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 { SampleStatusClassification } from './SampleStatusClassification';
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* How a {@link ScenePackage} declares a sample-data pack it ships: the pack's identity, enough to list it in
|
|
6
8
|
* a selector without loading it, and where its JSON file lives (`sampleData/<name>.json`).
|
|
@@ -17,6 +19,18 @@ export interface SampleDataPackReference {
|
|
|
17
19
|
|
|
18
20
|
/** The package-relative path of the pack file, under `sampleData/` and ending in `.json`. */
|
|
19
21
|
path: string;
|
|
22
|
+
|
|
23
|
+
/** One line saying what the pack is, shown under its name in a selector. */
|
|
24
|
+
description?: string;
|
|
25
|
+
|
|
26
|
+
/** The names of the pack's main table's columns, in the order a preview shows them. */
|
|
27
|
+
columns?: string[];
|
|
28
|
+
|
|
29
|
+
/** The column whose values are drawn as status pills. */
|
|
30
|
+
statusColumn?: string;
|
|
31
|
+
|
|
32
|
+
/** Which values of the status column are good, pending, bad or neutral; any other value is neutral. */
|
|
33
|
+
statuses?: SampleStatusClassification;
|
|
20
34
|
}
|
|
21
35
|
|
|
22
|
-
export const SampleDataPackReferencePropertyNames: (keyof SampleDataPackReference)[] = ['id', 'title', 'locale', 'path'];
|
|
36
|
+
export const SampleDataPackReferencePropertyNames: (keyof SampleDataPackReference)[] = ['id', 'title', 'locale', 'path', 'description', 'columns', 'statusColumn', 'statuses'];
|
|
@@ -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
|
+
/** How a pill for a status value is coloured. */
|
|
5
|
+
export enum SampleStatus {
|
|
6
|
+
/** A positive state: active, delivered, approved. */
|
|
7
|
+
Good = 'good',
|
|
8
|
+
|
|
9
|
+
/** A state that is in progress or waiting. */
|
|
10
|
+
Pending = 'pending',
|
|
11
|
+
|
|
12
|
+
/** A negative state: rejected, overdue, out of stock. */
|
|
13
|
+
Bad = 'bad',
|
|
14
|
+
|
|
15
|
+
/** Anything else; the class of every value the pack does not name. */
|
|
16
|
+
Neutral = 'neutral',
|
|
17
|
+
}
|
|
@@ -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
|
+
/** Which values of a pack's status column belong to which {@link SampleStatus}. A value in none of the lists is neutral. */
|
|
5
|
+
export interface SampleStatusClassification {
|
|
6
|
+
good?: string[];
|
|
7
|
+
|
|
8
|
+
pending?: string[];
|
|
9
|
+
|
|
10
|
+
bad?: string[];
|
|
11
|
+
|
|
12
|
+
neutral?: string[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const SampleStatusClassificationPropertyNames: (keyof SampleStatusClassification)[] = ['good', 'pending', 'bad', 'neutral'];
|
package/sampleData/index.ts
CHANGED
|
@@ -57,8 +57,17 @@ export interface TemplateMetadata {
|
|
|
57
57
|
|
|
58
58
|
/** For a shell: the name of the slot every screen's content is placed in. Absent means `content`. */
|
|
59
59
|
primaryOutlet?: string;
|
|
60
|
+
|
|
61
|
+
/** For a shell: the navigation mode the application starts in when the shell is chosen. The author can change it afterwards. */
|
|
62
|
+
defaultMenuMode?: string;
|
|
63
|
+
|
|
64
|
+
/** For a shell offered as a card: its title. Falls back to the template's display name, then its name. */
|
|
65
|
+
displayName?: string;
|
|
66
|
+
|
|
67
|
+
/** For a shell offered as a card: its one-line description. */
|
|
68
|
+
description?: string;
|
|
60
69
|
}
|
|
61
70
|
|
|
62
71
|
export const TemplateMetadataPropertyNames: (keyof TemplateMetadata)[] = [
|
|
63
|
-
'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl', 'sliceKinds', 'thumbnail', 'role', 'primaryOutlet',
|
|
72
|
+
'type', 'category', 'scopes', 'compatibility', 'attribution', 'license', 'licenseUrl', 'sliceKinds', 'thumbnail', 'role', 'primaryOutlet', 'defaultMenuMode', 'displayName', 'description',
|
|
64
73
|
];
|