@cratis/scene.blueprint.default 4.2.0 → 4.2.1
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/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -16
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts +0 -2
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts.map +0 -1
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +0 -61
- package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +0 -1
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts +0 -2
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts.map +0 -1
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js +0 -60
- package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js.map +0 -1
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +0 -2
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +0 -1
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js +0 -26
- package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +0 -1
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts +0 -2
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts.map +0 -1
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js +0 -32
- package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js.map +0 -1
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts +0 -2
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts.map +0 -1
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js +0 -40
- package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js.map +0 -1
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +0 -2
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +0 -1
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js +0 -27
- package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +0 -1
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +0 -2
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +0 -1
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +0 -41
- package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +0 -1
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts +0 -2
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts.map +0 -1
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js +0 -31
- package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js.map +0 -1
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +0 -2
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +0 -1
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js +0 -33
- package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +0 -1
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts +0 -2
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map +0 -1
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js +0 -44
- package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js.map +0 -1
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts +0 -2
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts.map +0 -1
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js +0 -60
- package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js.map +0 -1
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts +0 -2
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts.map +0 -1
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js +0 -28
- package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js.map +0 -1
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts +0 -2
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map +0 -1
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js +0 -38
- package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js.map +0 -1
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts +0 -2
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts.map +0 -1
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js +0 -39
- package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js.map +0 -1
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts +0 -2
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts.map +0 -1
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js +0 -37
- package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js.map +0 -1
- package/for_AppShell/when_rendering_a_gallery_screen.tsx +0 -85
- package/for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx +0 -77
- package/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts +0 -42
- package/for_defaultBlueprint/when_validating_the_bundle.ts +0 -43
- package/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts +0 -50
- package/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts +0 -36
- package/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +0 -53
- package/for_galleryScreenTemplates/when_following_the_nesting_chain.ts +0 -41
- package/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +0 -44
- package/for_galleryScreens/when_resolving_the_component_names_they_reference.ts +0 -60
- package/for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts +0 -76
- package/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts +0 -44
- package/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts +0 -61
- package/for_layoutWrapperClasses/when_rendering_each_mode.ts +0 -63
- package/for_navigation/when_aggregating_the_navigation_contributions.ts +0 -50
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cratis/scene.blueprint.default",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "The default blueprint: application shell layouts, the screen and dialog templates that go inside them, the components that fill their slots, and two themes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cratis",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"dist",
|
|
26
26
|
"**/*.ts",
|
|
27
27
|
"**/*.tsx",
|
|
28
|
-
"shell/layout.css"
|
|
28
|
+
"shell/layout.css",
|
|
29
|
+
"!**/for_*/**"
|
|
29
30
|
],
|
|
30
31
|
"main": "dist/cjs/index.js",
|
|
31
32
|
"module": "dist/esm/index.js",
|
|
@@ -53,25 +54,25 @@
|
|
|
53
54
|
"build-storybook": "storybook build"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@cratis/scene.engine": "4.2.
|
|
57
|
-
"@cratis/scene.model": "4.2.
|
|
58
|
-
"@cratis/scene.react": "4.2.
|
|
57
|
+
"@cratis/scene.engine": "4.2.1",
|
|
58
|
+
"@cratis/scene.model": "4.2.1",
|
|
59
|
+
"@cratis/scene.react": "4.2.1"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@cratis/scene.engine": "4.2.
|
|
62
|
-
"@cratis/scene.model": "4.2.
|
|
63
|
-
"@cratis/scene.react": "4.2.
|
|
64
|
-
"@primereact/core": "11.
|
|
65
|
-
"@primereact/headless": "11.
|
|
62
|
+
"@cratis/scene.engine": "4.2.1",
|
|
63
|
+
"@cratis/scene.model": "4.2.1",
|
|
64
|
+
"@cratis/scene.react": "4.2.1",
|
|
65
|
+
"@primereact/core": "11.2.0",
|
|
66
|
+
"@primereact/headless": "11.2.0",
|
|
66
67
|
"@primeuix/themes": "^3.0.1",
|
|
67
|
-
"@storybook/addon-links": "^10.6.
|
|
68
|
-
"@storybook/react": "^10.6.
|
|
69
|
-
"@storybook/react-vite": "^10.6.
|
|
70
|
-
"primeicons": "8.0.
|
|
71
|
-
"primereact": "11.
|
|
68
|
+
"@storybook/addon-links": "^10.6.1",
|
|
69
|
+
"@storybook/react": "^10.6.1",
|
|
70
|
+
"@storybook/react-vite": "^10.6.1",
|
|
71
|
+
"primeicons": "8.0.2",
|
|
72
|
+
"primereact": "11.2.0",
|
|
72
73
|
"react": "^19.3.0",
|
|
73
74
|
"react-dom": "^19.3.0",
|
|
74
|
-
"storybook": "^10.6.
|
|
75
|
+
"storybook": "^10.6.1"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
77
78
|
"@primereact/core": "^11.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_rendering_a_gallery_screen.d.ts","sourceRoot":"","sources":["../../../for_AppShell/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":""}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { PrimeReactProvider } from '@primereact/core';
|
|
4
|
-
import { SceneElementView, coreComponents, corePackage, mergePackageRegistries } from '@cratis/scene.react';
|
|
5
|
-
import { defaultBlueprint } from '../defaultBlueprint';
|
|
6
|
-
import { composeScreenElement, galleryComponentCatalog, galleryPreviewProfile, galleryScreen, resolveElementComponentNames } from '../gallery';
|
|
7
|
-
const registry = mergePackageRegistries([corePackage, defaultBlueprint]);
|
|
8
|
-
function renderGalleryScreen(name) {
|
|
9
|
-
const galleryItem = galleryScreen(name);
|
|
10
|
-
const element = resolveElementComponentNames(composeScreenElement(galleryItem), galleryPreviewProfile, galleryComponentCatalog);
|
|
11
|
-
render(_jsx(PrimeReactProvider, { children: _jsx(SceneElementView, { element: element, registry: registry, resolveBinding: () => undefined }) }));
|
|
12
|
-
}
|
|
13
|
-
function has(selector) {
|
|
14
|
-
return document.querySelector(selector) !== null;
|
|
15
|
-
}
|
|
16
|
-
describe('when rendering a gallery screen', () => {
|
|
17
|
-
describe('and it is an application-shell screen', () => {
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
renderGalleryScreen('Dashboard');
|
|
20
|
-
});
|
|
21
|
-
it('should render the shell wrapper with the default static mode', () => {
|
|
22
|
-
document.querySelector('.layout-wrapper').className.should.contain('layout-static');
|
|
23
|
-
});
|
|
24
|
-
it('should render the topbar', () => {
|
|
25
|
-
has('.layout-topbar').should.equal(true);
|
|
26
|
-
});
|
|
27
|
-
it('should render the sidebar panel the mode CSS positions', () => {
|
|
28
|
-
has('.layout-sidebar').should.equal(true);
|
|
29
|
-
});
|
|
30
|
-
it('should render the navigation the screen contributed', () => {
|
|
31
|
-
screen.getAllByRole('link', { name: /Products/ }).length.should.be.greaterThan(0);
|
|
32
|
-
});
|
|
33
|
-
it('should render the seeded content rather than a placeholder', () => {
|
|
34
|
-
screen.getAllByText('Revenue').length.should.be.greaterThan(0);
|
|
35
|
-
screen.getAllByText('$284,120').length.should.be.greaterThan(0);
|
|
36
|
-
});
|
|
37
|
-
it('should register the core registry alongside the blueprint one', () => {
|
|
38
|
-
Object.keys(coreComponents)
|
|
39
|
-
.every(key => key in registry)
|
|
40
|
-
.should.equal(true);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
describe('and it is a full-page screen', () => {
|
|
44
|
-
beforeEach(() => {
|
|
45
|
-
renderGalleryScreen('Login');
|
|
46
|
-
});
|
|
47
|
-
it('should render the chrome-less shell', () => {
|
|
48
|
-
has('.layout-full-page').should.equal(true);
|
|
49
|
-
});
|
|
50
|
-
it('should render the branding aside beside the form', () => {
|
|
51
|
-
has('.layout-full-page-aside').should.equal(true);
|
|
52
|
-
});
|
|
53
|
-
it('should not render an application topbar', () => {
|
|
54
|
-
has('.layout-topbar').should.equal(false);
|
|
55
|
-
});
|
|
56
|
-
it('should render the form the template seeded', () => {
|
|
57
|
-
screen.getAllByText('Sign in').length.should.be.greaterThan(0);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
//# sourceMappingURL=when_rendering_a_gallery_screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_rendering_a_gallery_screen.js","sourceRoot":"","sources":["../../../for_AppShell/when_rendering_a_gallery_screen.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE/I,MAAM,QAAQ,GAAG,sBAAsB,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,CA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AC,KAAK,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YAClD,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_switching_mode_and_reloading.d.ts","sourceRoot":"","sources":["../../../for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx"],"names":[],"mappings":""}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import { userEvent } from '@testing-library/user-event';
|
|
4
|
-
import { HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
|
|
5
|
-
import { LayoutConfigProvider, LayoutMode, layoutConfigStorageKey, readPersistedLayoutConfig, useLayoutConfig } from '../configuration';
|
|
6
|
-
import { LayoutModeSwitcher } from '../shell';
|
|
7
|
-
class FakeStorage {
|
|
8
|
-
entries = new Map();
|
|
9
|
-
getItem(key) {
|
|
10
|
-
return this.entries.has(key) ? this.entries.get(key) : null;
|
|
11
|
-
}
|
|
12
|
-
setItem(key, value) {
|
|
13
|
-
this.entries.set(key, value);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const switcherElement = {
|
|
17
|
-
id: 'mode-switcher',
|
|
18
|
-
name: 'mode-switcher',
|
|
19
|
-
properties: {},
|
|
20
|
-
visibility: Visibility.Visible,
|
|
21
|
-
isEnabled: true,
|
|
22
|
-
opacity: 1,
|
|
23
|
-
size: {},
|
|
24
|
-
zIndex: 0,
|
|
25
|
-
minimumSize: {},
|
|
26
|
-
maximumSize: {},
|
|
27
|
-
margin: { left: 0, top: 0, right: 0, bottom: 0 },
|
|
28
|
-
horizontalAlignment: HorizontalAlignment.Stretch,
|
|
29
|
-
verticalAlignment: VerticalAlignment.Stretch,
|
|
30
|
-
componentName: 'layoutModeSwitcher',
|
|
31
|
-
slots: {},
|
|
32
|
-
};
|
|
33
|
-
function CurrentMode() {
|
|
34
|
-
const { config, effectiveMode } = useLayoutConfig();
|
|
35
|
-
return _jsx("output", { "data-testid": 'mode', children: `${config.mode}/${effectiveMode}` });
|
|
36
|
-
}
|
|
37
|
-
describe('when switching mode and reloading', () => {
|
|
38
|
-
let storage;
|
|
39
|
-
beforeEach(async () => {
|
|
40
|
-
storage = new FakeStorage();
|
|
41
|
-
render(_jsxs(LayoutConfigProvider, { storage: storage, children: [_jsx(LayoutModeSwitcher, { element: switcherElement, slots: {} }), _jsx(CurrentMode, {})] }));
|
|
42
|
-
await userEvent.click(screen.getByRole('button', { name: 'Drawer' }));
|
|
43
|
-
});
|
|
44
|
-
it('should apply the chosen mode immediately', () => {
|
|
45
|
-
screen.getByTestId('mode').textContent.should.equal(`${LayoutMode.Drawer}/${LayoutMode.Drawer}`);
|
|
46
|
-
});
|
|
47
|
-
it('should mark the chosen mode as pressed', () => {
|
|
48
|
-
screen.getByRole('button', { name: 'Drawer' }).getAttribute('aria-pressed').should.equal('true');
|
|
49
|
-
});
|
|
50
|
-
it('should persist the choice under the storage key', () => {
|
|
51
|
-
storage.getItem(layoutConfigStorageKey).should.contain(LayoutMode.Drawer);
|
|
52
|
-
});
|
|
53
|
-
it('should come back with the same mode after a reload', () => {
|
|
54
|
-
readPersistedLayoutConfig(storage).mode.should.equal(LayoutMode.Drawer);
|
|
55
|
-
});
|
|
56
|
-
it('should not persist whether the sidebar happened to be open', () => {
|
|
57
|
-
storage.getItem(layoutConfigStorageKey).should.not.contain('isSidebarOpen');
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=when_switching_mode_and_reloading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_switching_mode_and_reloading.js","sourceRoot":"","sources":["../../../for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAqB,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxI,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,WAAW;IACb,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IACpC,OAAO,CAAC,GAAW;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACjE,CAAC;IAED,OAAO,CAAC,GAAW,EAAE,KAAa;QAC9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;CACJ;AAED,MAAM,eAAe,GAAsB;IACvC,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,eAAe;IACrB,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,UAAU,CAAC,OAAO;IAC9B,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,CAAC;IACT,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAA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,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACvD,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAE,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC1D,yBAAyB,CAAC,OAA6B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_evaluating_the_arrangement_at_each_size_class.d.ts","sourceRoot":"","sources":["../../../for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts"],"names":[],"mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { HeightSizeClass, WidthSizeClass } from '@cratis/scene.model';
|
|
2
|
-
import { evaluateFlowArrangement } from '@cratis/scene.engine';
|
|
3
|
-
import { appShellArrangement, appShellCompactHeightRoot, appShellCompactRoot, appShellCompactWidthRoot, appShellLayout, appShellRegularRoot, } from '../layouts';
|
|
4
|
-
describe('when evaluating the arrangement at each size class', () => {
|
|
5
|
-
const arrangement = appShellLayout.arrangement;
|
|
6
|
-
const regular = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Regular });
|
|
7
|
-
const compactWidth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Regular });
|
|
8
|
-
const compactHeight = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Compact });
|
|
9
|
-
const compactBoth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Compact });
|
|
10
|
-
it('should use the full tree at a regular width and height', () => {
|
|
11
|
-
regular.should.equal(appShellRegularRoot);
|
|
12
|
-
});
|
|
13
|
-
it('should collapse the sidebar out of the flow at a compact width', () => {
|
|
14
|
-
compactWidth.should.equal(appShellCompactWidthRoot);
|
|
15
|
-
});
|
|
16
|
-
it('should drop the breadcrumb and footer at a compact height', () => {
|
|
17
|
-
compactHeight.should.equal(appShellCompactHeightRoot);
|
|
18
|
-
});
|
|
19
|
-
it('should prefer the override targeting both axes when both are compact', () => {
|
|
20
|
-
compactBoth.should.equal(appShellCompactRoot);
|
|
21
|
-
});
|
|
22
|
-
it('should be the layout declared on the blueprint', () => {
|
|
23
|
-
arrangement.should.equal(appShellArrangement);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=when_evaluating_the_arrangement_at_each_size_class.js.map
|
package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_evaluating_the_arrangement_at_each_size_class.js","sourceRoot":"","sources":["../../../for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EACH,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,GACtB,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAChE,MAAM,WAAW,GAAG,cAAc,CAAC,WAA8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AC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_validating_the_bundle.d.ts","sourceRoot":"","sources":["../../../for_defaultBlueprint/when_validating_the_bundle.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { PackageKind } from '@cratis/scene.model';
|
|
2
|
-
import { validatePackageBundle } from '@cratis/scene.react';
|
|
3
|
-
import { defaultBlueprint, defaultBlueprintManifest } from '../defaultBlueprint';
|
|
4
|
-
import { defaultBlueprintName } from '../packageName';
|
|
5
|
-
describe('when validating the bundle', () => {
|
|
6
|
-
const problems = validatePackageBundle(defaultBlueprint);
|
|
7
|
-
it('should report no problems', () => {
|
|
8
|
-
problems.should.be.empty;
|
|
9
|
-
});
|
|
10
|
-
it('should declare itself a blueprint', () => {
|
|
11
|
-
defaultBlueprintManifest.kind.should.equal(PackageKind.Blueprint);
|
|
12
|
-
});
|
|
13
|
-
it('should be named as a blueprint package', () => {
|
|
14
|
-
defaultBlueprintManifest.name.should.equal(defaultBlueprintName);
|
|
15
|
-
});
|
|
16
|
-
it('should depend on the component libraries its shells are built from', () => {
|
|
17
|
-
defaultBlueprintManifest.dependencies.map(dependency => dependency.name).should.deep.equal(['PrimeReact', 'Cratis.Components']);
|
|
18
|
-
});
|
|
19
|
-
it('should declare only application shells as layouts', () => {
|
|
20
|
-
defaultBlueprintManifest.layouts.should.deep.equal(['AppShell', 'FullPage']);
|
|
21
|
-
});
|
|
22
|
-
it('should declare a screen template for every one it provides', () => {
|
|
23
|
-
defaultBlueprintManifest.screenTemplates.should.deep.equal((defaultBlueprint.screenTemplates ?? []).map(template => template.name));
|
|
24
|
-
});
|
|
25
|
-
it('should declare a dialog template for every one it provides', () => {
|
|
26
|
-
defaultBlueprintManifest.dialogTemplates.should.deep.equal((defaultBlueprint.dialogTemplates ?? []).map(template => template.name));
|
|
27
|
-
});
|
|
28
|
-
it('should ship a screen for every screen template', () => {
|
|
29
|
-
(defaultBlueprint.screens ?? []).map(screen => screen.name).should.deep.equal(defaultBlueprintManifest.screenTemplates);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=when_validating_the_bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_validating_the_bundle.js","sourceRoot":"","sources":["../../../for_defaultBlueprint/when_validating_the_bundle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IAEzD,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QACzC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAC9C,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC1E,wBAAwB,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACpI,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,wBAAwB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,wBAAwB,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACxI,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QAClE,wBAAwB,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACxI,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACtD,CAAC,gBAAgB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,eAAe,CAAC,CAAC;IAC5H,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_checking_attribution_and_tokens.d.ts","sourceRoot":"","sources":["../../../for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts"],"names":[],"mappings":""}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { incompatiblePackages } from '@cratis/scene.engine';
|
|
2
|
-
import { themeTokenProperty } from '@cratis/scene.react';
|
|
3
|
-
import { galleryProfile } from '../gallery';
|
|
4
|
-
import { darkTheme, defaultBlueprintThemes, lightTheme } from '../themes';
|
|
5
|
-
describe('when checking attribution and tokens', () => {
|
|
6
|
-
for (const theme of defaultBlueprintThemes) {
|
|
7
|
-
describe(`and the theme is '${theme.name}'`, () => {
|
|
8
|
-
it('should say who made it', () => {
|
|
9
|
-
(theme.author ?? '').should.not.be.empty;
|
|
10
|
-
});
|
|
11
|
-
it('should link to them', () => {
|
|
12
|
-
(theme.authorUrl ?? '').should.not.be.empty;
|
|
13
|
-
});
|
|
14
|
-
it('should state the license it is used under', () => {
|
|
15
|
-
(theme.license ?? '').should.not.be.empty;
|
|
16
|
-
});
|
|
17
|
-
it('should be compatible with every package the gallery profile activates', () => {
|
|
18
|
-
incompatiblePackages(theme, galleryProfile).should.be.empty;
|
|
19
|
-
});
|
|
20
|
-
it('should declare compatibility with core, which gets no implicit exemption', () => {
|
|
21
|
-
theme.compatibleWith.should.contain('core');
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
it('should define exactly the same token names in both themes', () => {
|
|
26
|
-
Object.keys(lightTheme.tokens ?? {})
|
|
27
|
-
.sort()
|
|
28
|
-
.should.deep.equal(Object.keys(darkTheme.tokens ?? {}).sort());
|
|
29
|
-
});
|
|
30
|
-
it('should ship one light and one dark theme', () => {
|
|
31
|
-
defaultBlueprintThemes.filter(theme => theme.isDark === true).should.have.lengthOf(1);
|
|
32
|
-
defaultBlueprintThemes.filter(theme => theme.isDark !== true).should.have.lengthOf(1);
|
|
33
|
-
});
|
|
34
|
-
it('should name tokens that become the custom properties the stylesheet reads', () => {
|
|
35
|
-
themeTokenProperty('primary.contrastColor').should.equal('--scene-primary-contrast-color');
|
|
36
|
-
themeTokenProperty('text.mutedColor').should.equal('--scene-text-muted-color');
|
|
37
|
-
themeTokenProperty('content.borderRadius').should.equal('--scene-content-border-radius');
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=when_checking_attribution_and_tokens.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_checking_attribution_and_tokens.js","sourceRoot":"","sources":["../../../for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE1E,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IAClD,KAAK,MAAM,KAAK,IAAI,sBAAsB,EAAE,CAAC;QACzC,QAAQ,CAAC,qBAAqB,KAAK,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE;YAC9C,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;gBAC9B,CAAC,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;YAC7C,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;gBAC3B,CAAC,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;YAChD,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;gBACjD,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC;YAC9C,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;gBAC7E,oBAAoB,CAAC,KAAK,E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AAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_evaluating_the_arrangement_at_each_size_class.d.ts","sourceRoot":"","sources":["../../../for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts"],"names":[],"mappings":""}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { HeightSizeClass, WidthSizeClass } from '@cratis/scene.model';
|
|
2
|
-
import { evaluateFlowArrangement } from '@cratis/scene.engine';
|
|
3
|
-
import { SlotName, fullPageCompactWidthRoot, fullPageLayout, fullPageRegularRoot } from '../layouts';
|
|
4
|
-
describe('when evaluating the arrangement at each size class', () => {
|
|
5
|
-
const arrangement = fullPageLayout.arrangement;
|
|
6
|
-
const regular = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Regular });
|
|
7
|
-
const compactWidth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Regular });
|
|
8
|
-
const compactHeight = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Compact });
|
|
9
|
-
const compactBoth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Compact });
|
|
10
|
-
it('should use the split tree at a regular width', () => {
|
|
11
|
-
regular.should.equal(fullPageRegularRoot);
|
|
12
|
-
});
|
|
13
|
-
it('should keep the split tree at a compact height, which the width override does not target', () => {
|
|
14
|
-
compactHeight.should.equal(fullPageRegularRoot);
|
|
15
|
-
});
|
|
16
|
-
it('should drop the branding aside at a compact width', () => {
|
|
17
|
-
compactWidth.should.equal(fullPageCompactWidthRoot);
|
|
18
|
-
});
|
|
19
|
-
it('should drop the branding aside whenever the width is compact, whatever the height is', () => {
|
|
20
|
-
compactBoth.should.equal(fullPageCompactWidthRoot);
|
|
21
|
-
});
|
|
22
|
-
it('should leave the compact-width tree with no reference to the aside slot', () => {
|
|
23
|
-
const leaves = fullPageCompactWidthRoot.children;
|
|
24
|
-
leaves.map(leaf => leaf.slotName).should.not.contain(SlotName.Aside);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=when_evaluating_the_arrangement_at_each_size_class.js.map
|
package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_evaluating_the_arrangement_at_each_size_class.js","sourceRoot":"","sources":["../../../for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgD,eAAe,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAErG,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAChE,MAAM,WAAW,GAAG,cAAc,CAAC,WAA8B,CAAC;IAElE,MAAM,OAAO,GAAG,uBAAuB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACzH,MAAM,YAAY,GAAG,uBAAuB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9H,MAAM,aAAa,GAAG,uBAAuB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/H,MAAM,WAAW,GAAG,uBAAuB,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAE7H,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACpD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0FAA0F,EAAE,GAAG,EAAE;QAChG,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QACzD,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC5F,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QAC/E,MAAM,MAAM,GAAI,wBAA0C,CAAC,QAA0B,CAAC;QACtF,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_checking_that_arrangements_reference_declared_slots.d.ts","sourceRoot":"","sources":["../../../for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts"],"names":[],"mappings":""}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defaultBlueprint } from '../defaultBlueprint';
|
|
2
|
-
import { galleryScreenTemplates } from '../gallery';
|
|
3
|
-
function slotNamesIn(node) {
|
|
4
|
-
if ('slotName' in node) {
|
|
5
|
-
return [node.slotName];
|
|
6
|
-
}
|
|
7
|
-
if ('children' in node) {
|
|
8
|
-
return node.children.flatMap(slotNamesIn);
|
|
9
|
-
}
|
|
10
|
-
return [];
|
|
11
|
-
}
|
|
12
|
-
function referencedSlots(arrangement) {
|
|
13
|
-
const flow = arrangement;
|
|
14
|
-
if (!flow?.root) {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
return [flow.root, ...(flow.overrides ?? []).map(override => override.root)].flatMap(slotNamesIn);
|
|
18
|
-
}
|
|
19
|
-
function undeclared(slots, arrangement) {
|
|
20
|
-
const declared = new Set(slots.map(slot => slot.name));
|
|
21
|
-
return [...new Set(referencedSlots(arrangement))].filter(name => !declared.has(name));
|
|
22
|
-
}
|
|
23
|
-
describe('when checking that arrangements reference declared slots', () => {
|
|
24
|
-
for (const layout of defaultBlueprint.layouts ?? []) {
|
|
25
|
-
it(`should reference only slots the '${layout.name}' layout declares`, () => {
|
|
26
|
-
undeclared(layout.slots, layout.arrangement).should.be.empty;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
for (const template of galleryScreenTemplates.filter(candidate => candidate.arrangement !== undefined)) {
|
|
30
|
-
it(`should reference only slots the '${template.name}' template declares`, () => {
|
|
31
|
-
undeclared(template.slots, template.arrangement).should.be.empty;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
for (const template of galleryScreenTemplates) {
|
|
35
|
-
it(`should file '${template.name}' content only under slots it declares`, () => {
|
|
36
|
-
const declared = new Set(template.slots.map(slot => slot.name));
|
|
37
|
-
Object.keys(template.content ?? {}).filter(name => !declared.has(name)).should.be.empty;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=when_checking_that_arrangements_reference_declared_slots.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_checking_that_arrangements_reference_declared_slots.js","sourceRoot":"","sources":["../../../for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_sl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ain.ts"],"names":[],"mappings":""}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { appShellLayout, fullPageLayout } from '../layouts';
|
|
2
|
-
import { featureSectionTemplate, galleryScreenTemplates, moduleWorkspaceTemplate, sliceSectionTemplate } from '../gallery';
|
|
3
|
-
function declares(slots, name) {
|
|
4
|
-
return name !== undefined && slots.some(slot => slot.name === name);
|
|
5
|
-
}
|
|
6
|
-
describe('when following the nesting chain', () => {
|
|
7
|
-
it('should fit the module template into a slot the application layout declares', () => {
|
|
8
|
-
declares(appShellLayout.slots, moduleWorkspaceTemplate.fitsSlot).should.be.true;
|
|
9
|
-
});
|
|
10
|
-
it('should fit the feature template into a slot the module template declares', () => {
|
|
11
|
-
declares(moduleWorkspaceTemplate.slots, featureSectionTemplate.fitsSlot).should.be.true;
|
|
12
|
-
});
|
|
13
|
-
it('should fit the slice template into a slot the feature template declares', () => {
|
|
14
|
-
declares(featureSectionTemplate.slots, sliceSectionTemplate.fitsSlot).should.be.true;
|
|
15
|
-
});
|
|
16
|
-
it('should resolve each level against its direct parent rather than globally', () => {
|
|
17
|
-
featureSectionTemplate.fitsSlot.should.equal(sliceSectionTemplate.fitsSlot);
|
|
18
|
-
});
|
|
19
|
-
it('should fit every other template into a slot one of the layouts declares', () => {
|
|
20
|
-
const layoutSlots = [...appShellLayout.slots, ...fullPageLayout.slots];
|
|
21
|
-
const templateSlots = galleryScreenTemplates.flatMap(template => template.slots);
|
|
22
|
-
galleryScreenTemplates
|
|
23
|
-
.filter(template => !declares(layoutSlots, template.fitsSlot) && !declares(templateSlots, template.fitsSlot))
|
|
24
|
-
.map(template => template.name)
|
|
25
|
-
.should.be.empty;
|
|
26
|
-
});
|
|
27
|
-
it('should give every screen template a slot to fit into', () => {
|
|
28
|
-
galleryScreenTemplates.filter(template => template.fitsSlot === undefined).map(template => template.name).should.be.empty;
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
//# sourceMappingURL=when_following_the_nesting_chain.js.map
|
|
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AAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QAC/E,MAAM,WAAW,GAAG,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,aAAa,GAAG,sBAAsB,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACjF,sBAAsB;aACjB,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;aAC5G,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;aAC9B,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC5D,sBAAsB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IAC9H,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_checking_the_layouts_and_slots_they_fill.d.ts","sourceRoot":"","sources":["../../../for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts"],"names":[],"mappings":""}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { defaultBlueprint } from '../defaultBlueprint';
|
|
2
|
-
import { galleryScreens } from '../gallery';
|
|
3
|
-
import { shellComponentForLayout } from '../layouts';
|
|
4
|
-
describe('when checking the layouts and slots they fill', () => {
|
|
5
|
-
const layouts = defaultBlueprint.layouts ?? [];
|
|
6
|
-
const layoutsByName = new Map(layouts.map(layout => [layout.name, layout]));
|
|
7
|
-
it('should have at least one screen to check', () => {
|
|
8
|
-
galleryScreens.should.not.be.empty;
|
|
9
|
-
});
|
|
10
|
-
for (const screen of galleryScreens) {
|
|
11
|
-
describe(`and the screen is '${screen.name}'`, () => {
|
|
12
|
-
const layout = layoutsByName.get(screen.layout);
|
|
13
|
-
it('should name a layout this blueprint provides', () => {
|
|
14
|
-
(layout !== undefined).should.be.true;
|
|
15
|
-
});
|
|
16
|
-
it('should fill only slots the layout declares', () => {
|
|
17
|
-
const declared = new Set((layout?.slots ?? []).map(slot => slot.name));
|
|
18
|
-
const filled = Object.keys(screen.slotContent);
|
|
19
|
-
filled.filter(name => !declared.has(name)).should.be.empty;
|
|
20
|
-
});
|
|
21
|
-
it('should fill the content slot, which is the only one every layout declares', () => {
|
|
22
|
-
(screen.slotContent.content?.length ?? 0).should.be.greaterThan(0);
|
|
23
|
-
});
|
|
24
|
-
it('should name a screen template this blueprint provides', () => {
|
|
25
|
-
(defaultBlueprint.screenTemplates ?? []).map(template => template.name).should.contain(screen.screenTemplate);
|
|
26
|
-
});
|
|
27
|
-
it('should render in a shell this blueprint provides', () => {
|
|
28
|
-
(shellComponentForLayout(screen.layout) !== undefined).should.be.true;
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=when_checking_the_layouts_and_slots_they_fill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_checking_the_layouts_and_slots_they_fill.js","sourceRoot":"","sources":["../../../for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,QAAQ,CAA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E;gBACjF,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;gBAC7D,CAAC,gBAAgB,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAClH,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;gBACxD,CAAC,uBAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;YAC1E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"when_resolving_the_component_names_they_reference.d.ts","sourceRoot":"","sources":["../../../for_galleryScreens/when_resolving_the_component_names_they_reference.ts"],"names":[],"mappings":""}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { resolveComponentName } from '@cratis/scene.engine';
|
|
2
|
-
import { ComponentName } from '../ComponentName';
|
|
3
|
-
import { composeScreenElement, distinctComponentNames, galleryComponentCatalog, galleryDialogTemplates, galleryProfile, galleryScreens, } from '../gallery';
|
|
4
|
-
import { defaultBlueprintName } from '../packageName';
|
|
5
|
-
describe('when resolving the component names they reference', () => {
|
|
6
|
-
const fromScreens = distinctComponentNames(galleryScreens.map(composeScreenElement));
|
|
7
|
-
const fromDialogs = distinctComponentNames(galleryDialogTemplates.flatMap(template => Object.values(template.content ?? {}).flat()));
|
|
8
|
-
const names = [...new Set([...fromScreens, ...fromDialogs])].sort();
|
|
9
|
-
const resolutions = names.map(name => ({ name, resolution: resolveComponentName(name, galleryProfile, galleryComponentCatalog) }));
|
|
10
|
-
const blueprintNames = new Set(Object.values(ComponentName));
|
|
11
|
-
it('should reference something', () => {
|
|
12
|
-
names.should.not.be.empty;
|
|
13
|
-
});
|
|
14
|
-
it('should reference something from the dialog templates too', () => {
|
|
15
|
-
fromDialogs.should.not.be.empty;
|
|
16
|
-
});
|
|
17
|
-
it('should resolve every referenced name against the profile', () => {
|
|
18
|
-
resolutions
|
|
19
|
-
.filter(entry => entry.resolution === undefined)
|
|
20
|
-
.map(entry => entry.name)
|
|
21
|
-
.should.be.empty;
|
|
22
|
-
});
|
|
23
|
-
it('should resolve this blueprint own names to this blueprint', () => {
|
|
24
|
-
resolutions
|
|
25
|
-
.filter(entry => blueprintNames.has(entry.name))
|
|
26
|
-
.filter(entry => entry.resolution?.package !== defaultBlueprintName)
|
|
27
|
-
.map(entry => entry.name)
|
|
28
|
-
.should.be.empty;
|
|
29
|
-
});
|
|
30
|
-
it('should shadow the component libraries for the names this blueprint also declares', () => {
|
|
31
|
-
const menu = resolveComponentName(ComponentName.Menu, galleryProfile, galleryComponentCatalog);
|
|
32
|
-
menu.package.should.equal(defaultBlueprintName);
|
|
33
|
-
menu.shadows.should.contain('PrimeReact');
|
|
34
|
-
});
|
|
35
|
-
it('should reference every shell component the blueprint registers except the ones a host places itself', () => {
|
|
36
|
-
const referenced = new Set(names);
|
|
37
|
-
const placedByAHostRatherThanATemplate = [ComponentName.Mask, ComponentName.ThemeSwitcher, ComponentName.LayoutModeSwitcher, ComponentName.RightPanel];
|
|
38
|
-
Object.values(ComponentName)
|
|
39
|
-
.filter(name => !placedByAHostRatherThanATemplate.includes(name))
|
|
40
|
-
.filter(name => !referenced.has(name))
|
|
41
|
-
.should.be.empty;
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=when_resolving_the_component_names_they_reference.js.map
|