@cratis/scene.model 4.56.0 → 4.58.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 +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/profiles/ColorScheme.js +13 -0
- package/dist/cjs/profiles/ColorScheme.js.map +1 -0
- package/dist/cjs/profiles/ProfileAppearance.js +11 -0
- package/dist/cjs/profiles/ProfileAppearance.js.map +1 -0
- package/dist/cjs/profiles/ProfileDefaults.js +10 -0
- package/dist/cjs/profiles/ProfileDefaults.js.map +1 -0
- package/dist/cjs/profiles/RootTemplate.js +11 -0
- package/dist/cjs/profiles/RootTemplate.js.map +1 -0
- package/dist/cjs/profiles/UiProfile.js +4 -1
- package/dist/cjs/profiles/UiProfile.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/profiles/ColorScheme.d.ts +6 -0
- package/dist/esm/profiles/ColorScheme.d.ts.map +1 -0
- package/dist/esm/profiles/ColorScheme.js +11 -0
- package/dist/esm/profiles/ColorScheme.js.map +1 -0
- package/dist/esm/profiles/ProfileAppearance.d.ts +7 -0
- package/dist/esm/profiles/ProfileAppearance.d.ts.map +1 -0
- package/dist/esm/profiles/ProfileAppearance.js +9 -0
- package/dist/esm/profiles/ProfileAppearance.js.map +1 -0
- package/dist/esm/profiles/ProfileDefaults.d.ts +6 -0
- package/dist/esm/profiles/ProfileDefaults.d.ts.map +1 -0
- package/dist/esm/profiles/ProfileDefaults.js +8 -0
- package/dist/esm/profiles/ProfileDefaults.js.map +1 -0
- package/dist/esm/profiles/RootTemplate.d.ts +7 -0
- package/dist/esm/profiles/RootTemplate.d.ts.map +1 -0
- package/dist/esm/profiles/RootTemplate.js +9 -0
- package/dist/esm/profiles/RootTemplate.js.map +1 -0
- package/dist/esm/profiles/UiProfile.d.ts +6 -0
- package/dist/esm/profiles/UiProfile.d.ts.map +1 -1
- package/dist/esm/profiles/UiProfile.js +4 -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/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/profiles/ColorScheme.ts +12 -0
- package/profiles/ProfileAppearance.ts +17 -0
- package/profiles/ProfileDefaults.ts +14 -0
- package/profiles/RootTemplate.ts +21 -0
- package/profiles/UiProfile.ts +20 -0
- package/profiles/index.ts +4 -0
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
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 colour scheme an application presents: always light, always dark, or following the viewer's system preference. */
|
|
5
|
+
export enum ColorScheme {
|
|
6
|
+
/** Always the light variant of the theme. */
|
|
7
|
+
Light = 'Light',
|
|
8
|
+
/** Always the dark variant of the theme. */
|
|
9
|
+
Dark = 'Dark',
|
|
10
|
+
/** Follow the viewer's operating-system preference. */
|
|
11
|
+
System = 'System',
|
|
12
|
+
}
|
|
@@ -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 { ColorScheme } from './ColorScheme';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* How an application looks beyond the {@link UiProfile.theme} it selects: the colour scheme and the accent colour.
|
|
8
|
+
*/
|
|
9
|
+
export interface ProfileAppearance {
|
|
10
|
+
/** Whether the application is light, dark or follows the system. Absent leaves the theme's own default. */
|
|
11
|
+
colorScheme?: ColorScheme;
|
|
12
|
+
|
|
13
|
+
/** The accent colour as a CSS colour (for example `#4f46e5`). Absent keeps the theme's accent. */
|
|
14
|
+
accent?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const ProfileAppearancePropertyNames: (keyof ProfileAppearance)[] = ['colorScheme', 'accent'];
|
|
@@ -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
|
+
import { TemplateReference } from '../screens/TemplateReference';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Application-wide authoring defaults that belong to the profile rather than to a screen.
|
|
8
|
+
*/
|
|
9
|
+
export interface ProfileDefaults {
|
|
10
|
+
/** The template a newly created screen starts from. Absent when new screens start without one. */
|
|
11
|
+
newScreenTemplate?: TemplateReference;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ProfileDefaultsPropertyNames: (keyof ProfileDefaults)[] = ['newScreenTemplate'];
|
|
@@ -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 { TemplateReference } from '../screens/TemplateReference';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The application's root template - its shell. The shell is either a layout or an application-scope screen template with the
|
|
8
|
+
* root role; this reference names it, pinned like any other template reference, and carries the shell's own configuration.
|
|
9
|
+
*/
|
|
10
|
+
export interface RootTemplate {
|
|
11
|
+
/** Which template is the shell: an own template, or a blueprint template with a version pin. */
|
|
12
|
+
template: TemplateReference;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The shell's own configurable items (for example `navigationMode` or `showFooter`), keyed by the shell's exposed option
|
|
16
|
+
* name. Absent when the profile leaves every option at the shell's default.
|
|
17
|
+
*/
|
|
18
|
+
options?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const RootTemplatePropertyNames: (keyof RootTemplate)[] = ['template', 'options'];
|
package/profiles/UiProfile.ts
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
4
|
import { SampleDataSelection } from '../sampleData';
|
|
5
|
+
import { ProfileAppearance } from './ProfileAppearance';
|
|
6
|
+
import { ProfileDefaults } from './ProfileDefaults';
|
|
7
|
+
import { RootTemplate } from './RootTemplate';
|
|
5
8
|
import { TargetSizeClass } from '../sizeClasses';
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -39,6 +42,7 @@ export interface UiProfile {
|
|
|
39
42
|
/**
|
|
40
43
|
* The name of the {@link Layout} this profile renders inside — the application's base navigational
|
|
41
44
|
* shell, normally provided by a blueprint in `packages`. Absent when the profile does not select one.
|
|
45
|
+
* Legacy: still readable, superseded by {@link UiProfile.root}.
|
|
42
46
|
*/
|
|
43
47
|
layout?: string;
|
|
44
48
|
|
|
@@ -55,6 +59,19 @@ export interface UiProfile {
|
|
|
55
59
|
* part of a production build. Absent selects the blueprint's default pack, then generated data.
|
|
56
60
|
*/
|
|
57
61
|
sampleData?: SampleDataSelection;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The application's root template (its shell): a template reference - own or blueprint, with a version pin - and the
|
|
65
|
+
* shell's own options. Supersedes {@link UiProfile.layout}; absent falls back to `layout` and then to the blueprint's
|
|
66
|
+
* default shell.
|
|
67
|
+
*/
|
|
68
|
+
root?: RootTemplate;
|
|
69
|
+
|
|
70
|
+
/** The colour scheme and accent colour the application presents. Absent keeps the theme's defaults. */
|
|
71
|
+
appearance?: ProfileAppearance;
|
|
72
|
+
|
|
73
|
+
/** Application-wide authoring defaults such as the template new screens start from. Absent for none. */
|
|
74
|
+
defaults?: ProfileDefaults;
|
|
58
75
|
}
|
|
59
76
|
|
|
60
77
|
export const UiProfilePropertyNames: (keyof UiProfile)[] = [
|
|
@@ -65,4 +82,7 @@ export const UiProfilePropertyNames: (keyof UiProfile)[] = [
|
|
|
65
82
|
'layout',
|
|
66
83
|
'theme',
|
|
67
84
|
'sampleData',
|
|
85
|
+
'root',
|
|
86
|
+
'appearance',
|
|
87
|
+
'defaults',
|
|
68
88
|
];
|