@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.
Files changed (77) hide show
  1. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  2. package/package.json +17 -16
  3. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts +0 -2
  4. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.d.ts.map +0 -1
  5. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js +0 -61
  6. package/dist/esm/for_AppShell/when_rendering_a_gallery_screen.js.map +0 -1
  7. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts +0 -2
  8. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.d.ts.map +0 -1
  9. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js +0 -60
  10. package/dist/esm/for_LayoutConfigProvider/when_switching_mode_and_reloading.js.map +0 -1
  11. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +0 -2
  12. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +0 -1
  13. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js +0 -26
  14. package/dist/esm/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +0 -1
  15. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts +0 -2
  16. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.d.ts.map +0 -1
  17. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js +0 -32
  18. package/dist/esm/for_defaultBlueprint/when_validating_the_bundle.js.map +0 -1
  19. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts +0 -2
  20. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.d.ts.map +0 -1
  21. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js +0 -40
  22. package/dist/esm/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.js.map +0 -1
  23. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts +0 -2
  24. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.d.ts.map +0 -1
  25. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js +0 -27
  26. package/dist/esm/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.js.map +0 -1
  27. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts +0 -2
  28. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.d.ts.map +0 -1
  29. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js +0 -41
  30. package/dist/esm/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.js.map +0 -1
  31. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts +0 -2
  32. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.d.ts.map +0 -1
  33. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js +0 -31
  34. package/dist/esm/for_galleryScreenTemplates/when_following_the_nesting_chain.js.map +0 -1
  35. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts +0 -2
  36. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.d.ts.map +0 -1
  37. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js +0 -33
  38. package/dist/esm/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.js.map +0 -1
  39. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts +0 -2
  40. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.d.ts.map +0 -1
  41. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js +0 -44
  42. package/dist/esm/for_galleryScreens/when_resolving_the_component_names_they_reference.js.map +0 -1
  43. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts +0 -2
  44. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.d.ts.map +0 -1
  45. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js +0 -60
  46. package/dist/esm/for_layoutConfigStorage/when_restoring_a_persisted_configuration.js.map +0 -1
  47. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts +0 -2
  48. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.d.ts.map +0 -1
  49. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js +0 -28
  50. package/dist/esm/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.js.map +0 -1
  51. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts +0 -2
  52. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map +0 -1
  53. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js +0 -38
  54. package/dist/esm/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.js.map +0 -1
  55. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts +0 -2
  56. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.d.ts.map +0 -1
  57. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js +0 -39
  58. package/dist/esm/for_layoutWrapperClasses/when_rendering_each_mode.js.map +0 -1
  59. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts +0 -2
  60. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.d.ts.map +0 -1
  61. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js +0 -37
  62. package/dist/esm/for_navigation/when_aggregating_the_navigation_contributions.js.map +0 -1
  63. package/for_AppShell/when_rendering_a_gallery_screen.tsx +0 -85
  64. package/for_LayoutConfigProvider/when_switching_mode_and_reloading.tsx +0 -77
  65. package/for_appShellLayout/when_evaluating_the_arrangement_at_each_size_class.ts +0 -42
  66. package/for_defaultBlueprint/when_validating_the_bundle.ts +0 -43
  67. package/for_defaultBlueprintThemes/when_checking_attribution_and_tokens.ts +0 -50
  68. package/for_fullPageLayout/when_evaluating_the_arrangement_at_each_size_class.ts +0 -36
  69. package/for_galleryScreenTemplates/when_checking_that_arrangements_reference_declared_slots.ts +0 -53
  70. package/for_galleryScreenTemplates/when_following_the_nesting_chain.ts +0 -41
  71. package/for_galleryScreens/when_checking_the_layouts_and_slots_they_fill.ts +0 -44
  72. package/for_galleryScreens/when_resolving_the_component_names_they_reference.ts +0 -60
  73. package/for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts +0 -76
  74. package/for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts +0 -44
  75. package/for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts +0 -61
  76. package/for_layoutWrapperClasses/when_rendering_each_mode.ts +0 -63
  77. package/for_navigation/when_aggregating_the_navigation_contributions.ts +0 -50
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_resolving_the_component_names_they_reference.js","sourceRoot":"","sources":["../../../for_galleryScreens/when_resolving_the_component_names_they_reference.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACH,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,cAAc,EACd,cAAc,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC/D,MAAM,WAAW,GAAG,sBAAsB,CAAC,cAA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//# sourceMappingURL=when_restoring_a_persisted_configuration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_restoring_a_persisted_configuration.d.ts","sourceRoot":"","sources":["../../../for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts"],"names":[],"mappings":""}
@@ -1,60 +0,0 @@
1
- import { ColorScheme, LayoutMode, MenuTheme, defaultLayoutConfigState, layoutConfigStorageKey, persistLayoutConfig, readPersistedLayoutConfig, withMobile, withMode, withSidebarAnchored } from '../configuration';
2
- class FakeStorage {
3
- entries = new Map();
4
- getItem(key) {
5
- return this.entries.has(key) ? this.entries.get(key) : null;
6
- }
7
- setItem(key, value) {
8
- this.entries.set(key, value);
9
- }
10
- }
11
- function storageWith(raw) {
12
- const storage = new FakeStorage();
13
- storage.setItem(layoutConfigStorageKey, raw);
14
- return storage;
15
- }
16
- describe('when restoring a persisted configuration', () => {
17
- it('should fall back to the defaults when nothing was persisted', () => {
18
- readPersistedLayoutConfig(new FakeStorage()).should.deep.equal(defaultLayoutConfigState());
19
- });
20
- it('should fall back to the defaults when there is no storage at all', () => {
21
- readPersistedLayoutConfig(undefined).should.deep.equal(defaultLayoutConfigState());
22
- });
23
- it('should round-trip the preferences that are worth keeping', () => {
24
- const storage = new FakeStorage();
25
- const chosen = withSidebarAnchored(withMode(defaultLayoutConfigState(), LayoutMode.Drawer), true);
26
- persistLayoutConfig(chosen, storage);
27
- const restored = readPersistedLayoutConfig(storage);
28
- restored.mode.should.equal(LayoutMode.Drawer);
29
- restored.isSidebarAnchored.should.be.true;
30
- });
31
- it('should not restore the transient state', () => {
32
- const storage = new FakeStorage();
33
- persistLayoutConfig(withMobile(defaultLayoutConfigState(), true), storage);
34
- readPersistedLayoutConfig(storage).isMobile.should.be.false;
35
- });
36
- it('should ignore an unrecognized mode rather than putting a class no rule matches on the wrapper', () => {
37
- readPersistedLayoutConfig(storageWith('{"mode":"kaleidoscope"}')).mode.should.equal(defaultLayoutConfigState().mode);
38
- });
39
- it('should ignore an unrecognized menu theme and color scheme', () => {
40
- const restored = readPersistedLayoutConfig(storageWith('{"menuTheme":"neon","colorScheme":"sepia"}'));
41
- restored.menuTheme.should.equal(MenuTheme.Light);
42
- restored.colorScheme.should.equal(ColorScheme.Light);
43
- });
44
- it('should survive malformed json', () => {
45
- readPersistedLayoutConfig(storageWith('{ not json')).should.deep.equal(defaultLayoutConfigState());
46
- });
47
- it('should survive json that is not an object', () => {
48
- readPersistedLayoutConfig(storageWith('[1,2,3]')).should.deep.equal(defaultLayoutConfigState());
49
- });
50
- it('should not throw when storage refuses to write', () => {
51
- const refusing = {
52
- getItem: () => null,
53
- setItem: () => {
54
- throw new Error('QuotaExceededError');
55
- },
56
- };
57
- (() => persistLayoutConfig(defaultLayoutConfigState(), refusing)).should.not.throw();
58
- });
59
- });
60
- //# sourceMappingURL=when_restoring_a_persisted_configuration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_restoring_a_persisted_configuration.js","sourceRoot":"","sources":["../../../for_layoutConfigStorage/when_restoring_a_persisted_configuration.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,UAAU,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEnN,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,SAAS,WAAW,CAA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AAC;QAExB,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,wBAAwB,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;IACzF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_anchoring_a_reveal_sidebar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_anchoring_a_reveal_sidebar.d.ts","sourceRoot":"","sources":["../../../for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts"],"names":[],"mappings":""}
@@ -1,28 +0,0 @@
1
- import { LayoutMode, defaultLayoutConfigState, isPointerRevealMode, toggleSidebarAnchor, withMode, withSidebarRevealed, } from '../configuration';
2
- describe('when anchoring a reveal sidebar', () => {
3
- const reveal = withMode(defaultLayoutConfigState(), LayoutMode.Reveal);
4
- const anchored = toggleSidebarAnchor(reveal);
5
- it('should recognize reveal and drawer as the pointer-driven modes', () => {
6
- isPointerRevealMode(LayoutMode.Reveal).should.be.true;
7
- isPointerRevealMode(LayoutMode.Drawer).should.be.true;
8
- isPointerRevealMode(LayoutMode.Static).should.be.false;
9
- });
10
- it('should hold the sidebar out as soon as it is anchored', () => {
11
- anchored.isSidebarRevealed.should.be.true;
12
- });
13
- it('should ignore the pointer while anchored', () => {
14
- withSidebarRevealed(anchored, false).should.equal(anchored);
15
- });
16
- it('should let the pointer take over again once unanchored', () => {
17
- const unanchored = toggleSidebarAnchor(anchored);
18
- unanchored.isSidebarAnchored.should.be.false;
19
- withSidebarRevealed(unanchored, true).isSidebarRevealed.should.be.true;
20
- });
21
- it('should keep the pin across a mode change, since it is a preference rather than transient state', () => {
22
- withMode(anchored, LayoutMode.Drawer).isSidebarAnchored.should.be.true;
23
- });
24
- it('should drop a pointer-held reveal when the mode changes', () => {
25
- withMode(withSidebarRevealed(reveal, true), LayoutMode.Static).isSidebarRevealed.should.be.false;
26
- });
27
- });
28
- //# sourceMappingURL=when_anchoring_a_reveal_sidebar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_anchoring_a_reveal_sidebar.js","sourceRoot":"","sources":["../../../for_layoutConfigTransitions/when_anchoring_a_reveal_sidebar.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,UAAU,EACV,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,GACtB,MAAM,kBAAkB,CAAC;AAE1B,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,wBAAwB,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE7C,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACtE,mBAAmB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QACtD,mBAAmB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QACtD,mBAAmB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC7D,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAChD,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAC9D,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACjD,UAAU,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;QAC7C,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gGAAgG,EAAE,GAAG,EAAE;QACtG,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QAC/D,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IACrG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_the_viewport_crosses_the_mobile_breakpoint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_the_viewport_crosses_the_mobile_breakpoint.d.ts","sourceRoot":"","sources":["../../../for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts"],"names":[],"mappings":""}
@@ -1,38 +0,0 @@
1
- import { LayoutMode, defaultLayoutConfigState, effectiveLayoutMode, isMobileWidth, layoutModes, layoutWrapperClasses, mobileBreakpoint, toggleSidebar, withMobile, withMode, } from '../configuration';
2
- describe('when the viewport crosses the mobile breakpoint', () => {
3
- const desktop = withMode(defaultLayoutConfigState(), LayoutMode.Slim);
4
- const mobile = withMobile(desktop, true);
5
- const backToDesktop = withMobile(mobile, false);
6
- it('should treat the breakpoint itself as mobile, matching the stylesheet', () => {
7
- isMobileWidth(mobileBreakpoint).should.be.true;
8
- isMobileWidth(mobileBreakpoint + 1).should.be.false;
9
- });
10
- it('should force every mode off-canvas below the breakpoint', () => {
11
- for (const mode of layoutModes) {
12
- effectiveLayoutMode(withMobile(withMode(desktop, mode), true)).should.equal(LayoutMode.Overlay);
13
- }
14
- });
15
- it('should keep the chosen mode rather than overwriting it', () => {
16
- mobile.mode.should.equal(LayoutMode.Slim);
17
- });
18
- it('should close the sidebar on the way in so the page is not covered on arrival', () => {
19
- mobile.isSidebarOpen.should.be.false;
20
- });
21
- it('should mark the wrapper mobile', () => {
22
- layoutWrapperClasses(mobile).should.contain('layout-mobile');
23
- });
24
- it('should mark the wrapper mobile-active once the sidebar is opened', () => {
25
- layoutWrapperClasses(toggleSidebar(mobile)).should.contain('layout-mobile-active');
26
- });
27
- it('should restore the chosen mode on the way back out', () => {
28
- effectiveLayoutMode(backToDesktop).should.equal(LayoutMode.Slim);
29
- });
30
- it('should leave the state untouched when the regime has not actually changed', () => {
31
- withMobile(mobile, true).should.equal(mobile);
32
- });
33
- it('should reopen a static sidebar on the way back out, since docked is its resting state', () => {
34
- const staticMobile = withMobile(withMode(defaultLayoutConfigState(), LayoutMode.Static), true);
35
- withMobile(staticMobile, false).isSidebarOpen.should.be.true;
36
- });
37
- });
38
- //# sourceMappingURL=when_the_viewport_crosses_the_mobile_breakpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_the_viewport_crosses_the_mobile_breakpoint.js","sourceRoot":"","sources":["../../../for_layoutConfigTransitions/when_the_viewport_crosses_the_mobile_breakpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,UAAU,EACV,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,QAAQ,GACX,MAAM,kBAAkB,CAAC;AAE1B,QAAQ,CAAC,iDAAiD,EAAE,GAAG,EAAE;IAC7D,MAAM,OAAO,GAAG,QAAQ,CAAC,wBAAwB,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IACtE,MA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CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC1D,mBAAmB,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2EAA2E,EAAE,GAAG,EAAE;QACjF,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uFAAuF,EAAE,GAAG,EAAE;QAC7F,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,wBAAwB,EAAE,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;QAC/F,UAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_rendering_each_mode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_rendering_each_mode.d.ts","sourceRoot":"","sources":["../../../for_layoutWrapperClasses/when_rendering_each_mode.ts"],"names":[],"mappings":""}
@@ -1,39 +0,0 @@
1
- import { LayoutMode, defaultLayoutConfigState, isLayoutMaskVisible, layoutModes, layoutWrapperClasses, toggleSidebar, withMobile, withMode, withSidebarAnchored, withSidebarRevealed, } from '../configuration';
2
- describe('when rendering each mode', () => {
3
- const started = defaultLayoutConfigState();
4
- it('should always start with the wrapper class', () => {
5
- layoutWrapperClasses(started)[0].should.equal('layout-wrapper');
6
- });
7
- for (const mode of layoutModes) {
8
- it(`should put the '${mode}' mode class on the wrapper`, () => {
9
- layoutWrapperClasses(withMode(started, mode)).should.contain(`layout-${mode}`);
10
- });
11
- }
12
- it('should mark a closed static sidebar inactive', () => {
13
- layoutWrapperClasses(toggleSidebar(withMode(started, LayoutMode.Static))).should.contain('layout-static-inactive');
14
- });
15
- it('should not mark an open static sidebar inactive', () => {
16
- layoutWrapperClasses(withMode(started, LayoutMode.Static)).should.not.contain('layout-static-inactive');
17
- });
18
- it('should mark an opened overlay sidebar active', () => {
19
- layoutWrapperClasses(toggleSidebar(withMode(started, LayoutMode.Overlay))).should.contain('layout-overlay-active');
20
- });
21
- it('should mark a revealed sidebar active', () => {
22
- layoutWrapperClasses(withSidebarRevealed(withMode(started, LayoutMode.Reveal), true)).should.contain('layout-sidebar-active');
23
- });
24
- it('should mark an anchored sidebar anchored', () => {
25
- layoutWrapperClasses(withSidebarAnchored(withMode(started, LayoutMode.Drawer), true)).should.contain('layout-sidebar-anchored');
26
- });
27
- it('should not mark a static sidebar anchored, since only reveal and drawer answer to the pointer', () => {
28
- layoutWrapperClasses(withSidebarAnchored(withMode(started, LayoutMode.Static), true)).should.not.contain('layout-sidebar-anchored');
29
- });
30
- it('should show the mask only while a floating sidebar is open', () => {
31
- isLayoutMaskVisible(toggleSidebar(withMode(started, LayoutMode.Overlay))).should.be.true;
32
- isLayoutMaskVisible(withMode(started, LayoutMode.Overlay)).should.be.false;
33
- isLayoutMaskVisible(withMode(started, LayoutMode.Static)).should.be.false;
34
- });
35
- it('should show the mask on mobile once the sidebar is opened, whatever the chosen mode', () => {
36
- isLayoutMaskVisible(toggleSidebar(withMobile(withMode(started, LayoutMode.Horizontal), true))).should.be.true;
37
- });
38
- });
39
- //# sourceMappingURL=when_rendering_each_mode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_rendering_each_mode.js","sourceRoot":"","sources":["../../../for_layoutWrapperClasses/when_rendering_each_mode.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,UAAU,EACV,wBAAwB,EACxB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,mBAAmB,GACtB,MAAM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AAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IAClH,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=when_aggregating_the_navigation_contributions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_aggregating_the_navigation_contributions.d.ts","sourceRoot":"","sources":["../../../for_navigation/when_aggregating_the_navigation_contributions.ts"],"names":[],"mappings":""}
@@ -1,37 +0,0 @@
1
- import { aggregateContributions } from '@cratis/scene.engine';
2
- import { extractNavigationItem } from '@cratis/scene.react';
3
- import { galleryScreen, galleryScreenTemplates, navigationContributionPoint, navigationContributions, navigationEntries } from '../gallery';
4
- describe('when aggregating the navigation contributions', () => {
5
- const aggregated = aggregateContributions(navigationContributions, navigationContributionPoint);
6
- const items = aggregated.map(extractNavigationItem).filter((item) => item !== undefined);
7
- it('should aggregate one contribution per navigation entry', () => {
8
- aggregated.should.have.lengthOf(navigationEntries.length);
9
- });
10
- it('should extract every one of them as a navigation item', () => {
11
- items.should.have.lengthOf(navigationEntries.length);
12
- });
13
- it('should carry the label and target screen through the property bag unchanged', () => {
14
- const dashboard = items.find(item => item.targetScreen === 'Dashboard');
15
- dashboard.label.should.equal('Dashboard');
16
- });
17
- it('should carry the group so an aggregated navigation can section itself', () => {
18
- items.filter(item => item.group === undefined).should.be.empty;
19
- });
20
- it('should carry a route parameter bag rather than leaving it undefined', () => {
21
- items.filter(item => item.routeParameterBindings === undefined).should.be.empty;
22
- });
23
- it('should point every entry at a screen template this blueprint provides', () => {
24
- const provided = new Set(galleryScreenTemplates.map(template => template.name));
25
- items.filter(item => !provided.has(item.targetScreen)).map(item => item.targetScreen).should.be.empty;
26
- });
27
- it('should point every entry at a screen the gallery actually ships', () => {
28
- items.filter(item => galleryScreen(item.targetScreen) === undefined).map(item => item.targetScreen).should.be.empty;
29
- });
30
- it('should carry the contributions on every application-shell screen', () => {
31
- galleryScreen('Dashboard').contributions.should.have.lengthOf(navigationEntries.length);
32
- });
33
- it('should not carry navigation on a full-page screen, which has no navigation to render', () => {
34
- galleryScreen('Login').contributions.should.be.empty;
35
- });
36
- });
37
- //# sourceMappingURL=when_aggregating_the_navigation_contributions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"when_aggregating_the_navigation_contributions.js","sourceRoot":"","sources":["../../../for_navigation/when_aggregating_the_navigation_contributions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5I,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;IAC3D,MAAM,UAAU,GAAG,sBAAsB,CAAC,uBAAuB,EAAE,2BAA2B,CAAC,CAAC;IAChG,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAA0B,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAEjH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAC9D,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC7D,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6EAA6E,EAAE,GAAG,EAAE;QACnF,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,KAAK,WA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IAEH,EAAE,CAAC,kEAAkE,EAAE,GAAG,EAAE;QACxE,aAAa,CAAC,WAAW,CAAE,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC5F,aAAa,CAAC,OAAO,CAAE,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -1,85 +0,0 @@
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 { render, screen } from '@testing-library/react';
5
- import { PrimeReactProvider } from '@primereact/core';
6
- import { SceneElementView, coreComponents, corePackage, mergePackageRegistries } from '@cratis/scene.react';
7
- import { defaultBlueprint } from '../defaultBlueprint';
8
- import { composeScreenElement, galleryComponentCatalog, galleryPreviewProfile, galleryScreen, resolveElementComponentNames } from '../gallery';
9
-
10
- const registry = mergePackageRegistries([corePackage, defaultBlueprint]);
11
-
12
- // PrimeReact 11 components resolve their configuration through `PrimeReactProvider` and throw without
13
- // one, and these screens render five of them - the topbar toggle, the sidebar pin, the user menu, the
14
- // breadcrumb and the configurator's drawer. No preset is handed over: these specs assert structure and
15
- // text, and a theme would only add runtime CSS nothing here reads.
16
- function renderGalleryScreen(name: string) {
17
- const galleryItem = galleryScreen(name)!;
18
- const element = resolveElementComponentNames(composeScreenElement(galleryItem), galleryPreviewProfile, galleryComponentCatalog);
19
- render(
20
- <PrimeReactProvider>
21
- <SceneElementView element={element} registry={registry} resolveBinding={() => undefined} />
22
- </PrimeReactProvider>,
23
- );
24
- }
25
-
26
- function has(selector: string): boolean {
27
- return document.querySelector(selector) !== null;
28
- }
29
-
30
- describe('when rendering a gallery screen', () => {
31
- describe('and it is an application-shell screen', () => {
32
- beforeEach(() => {
33
- renderGalleryScreen('Dashboard');
34
- });
35
-
36
- it('should render the shell wrapper with the default static mode', () => {
37
- document.querySelector('.layout-wrapper')!.className.should.contain('layout-static');
38
- });
39
-
40
- it('should render the topbar', () => {
41
- has('.layout-topbar').should.equal(true);
42
- });
43
-
44
- it('should render the sidebar panel the mode CSS positions', () => {
45
- has('.layout-sidebar').should.equal(true);
46
- });
47
-
48
- it('should render the navigation the screen contributed', () => {
49
- screen.getAllByRole('link', { name: /Products/ }).length.should.be.greaterThan(0);
50
- });
51
-
52
- it('should render the seeded content rather than a placeholder', () => {
53
- screen.getAllByText('Revenue').length.should.be.greaterThan(0);
54
- screen.getAllByText('$284,120').length.should.be.greaterThan(0);
55
- });
56
-
57
- it('should register the core registry alongside the blueprint one', () => {
58
- Object.keys(coreComponents)
59
- .every(key => key in registry)
60
- .should.equal(true);
61
- });
62
- });
63
-
64
- describe('and it is a full-page screen', () => {
65
- beforeEach(() => {
66
- renderGalleryScreen('Login');
67
- });
68
-
69
- it('should render the chrome-less shell', () => {
70
- has('.layout-full-page').should.equal(true);
71
- });
72
-
73
- it('should render the branding aside beside the form', () => {
74
- has('.layout-full-page-aside').should.equal(true);
75
- });
76
-
77
- it('should not render an application topbar', () => {
78
- has('.layout-topbar').should.equal(false);
79
- });
80
-
81
- it('should render the form the template seeded', () => {
82
- screen.getAllByText('Sign in').length.should.be.greaterThan(0);
83
- });
84
- });
85
- });
@@ -1,77 +0,0 @@
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 { render, screen } from '@testing-library/react';
5
- import { userEvent } from '@testing-library/user-event';
6
- import { ExternalComponent, HorizontalAlignment, VerticalAlignment, Visibility } from '@cratis/scene.model';
7
- import { LayoutConfigProvider, LayoutMode, layoutConfigStorageKey, readPersistedLayoutConfig, useLayoutConfig } from '../configuration';
8
- import { LayoutModeSwitcher } from '../shell';
9
-
10
- class FakeStorage {
11
- entries = new Map<string, string>();
12
- getItem(key: string): string | null {
13
- return this.entries.has(key) ? this.entries.get(key)! : null;
14
- }
15
-
16
- setItem(key: string, value: string): void {
17
- this.entries.set(key, value);
18
- }
19
- }
20
-
21
- const switcherElement: ExternalComponent = {
22
- id: 'mode-switcher',
23
- name: 'mode-switcher',
24
- properties: {},
25
- visibility: Visibility.Visible,
26
- isEnabled: true,
27
- opacity: 1,
28
- size: {},
29
- zIndex: 0,
30
- minimumSize: {},
31
- maximumSize: {},
32
- margin: { left: 0, top: 0, right: 0, bottom: 0 },
33
- horizontalAlignment: HorizontalAlignment.Stretch,
34
- verticalAlignment: VerticalAlignment.Stretch,
35
- componentName: 'layoutModeSwitcher',
36
- slots: {},
37
- };
38
-
39
- function CurrentMode() {
40
- const { config, effectiveMode } = useLayoutConfig();
41
- return <output data-testid='mode'>{`${config.mode}/${effectiveMode}`}</output>;
42
- }
43
-
44
- describe('when switching mode and reloading', () => {
45
- let storage: FakeStorage;
46
-
47
- beforeEach(async () => {
48
- storage = new FakeStorage();
49
- render(
50
- <LayoutConfigProvider storage={storage as unknown as Storage}>
51
- <LayoutModeSwitcher element={switcherElement} slots={{}} />
52
- <CurrentMode />
53
- </LayoutConfigProvider>,
54
- );
55
- await userEvent.click(screen.getByRole('button', { name: 'Drawer' }));
56
- });
57
-
58
- it('should apply the chosen mode immediately', () => {
59
- screen.getByTestId('mode').textContent!.should.equal(`${LayoutMode.Drawer}/${LayoutMode.Drawer}`);
60
- });
61
-
62
- it('should mark the chosen mode as pressed', () => {
63
- screen.getByRole('button', { name: 'Drawer' }).getAttribute('aria-pressed')!.should.equal('true');
64
- });
65
-
66
- it('should persist the choice under the storage key', () => {
67
- storage.getItem(layoutConfigStorageKey)!.should.contain(LayoutMode.Drawer);
68
- });
69
-
70
- it('should come back with the same mode after a reload', () => {
71
- readPersistedLayoutConfig(storage as unknown as Storage).mode.should.equal(LayoutMode.Drawer);
72
- });
73
-
74
- it('should not persist whether the sidebar happened to be open', () => {
75
- storage.getItem(layoutConfigStorageKey)!.should.not.contain('isSidebarOpen');
76
- });
77
- });
@@ -1,42 +0,0 @@
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 { FlowArrangement, HeightSizeClass, WidthSizeClass } from '@cratis/scene.model';
5
- import { evaluateFlowArrangement } from '@cratis/scene.engine';
6
- import {
7
- appShellArrangement,
8
- appShellCompactHeightRoot,
9
- appShellCompactRoot,
10
- appShellCompactWidthRoot,
11
- appShellLayout,
12
- appShellRegularRoot,
13
- } from '../layouts';
14
-
15
- describe('when evaluating the arrangement at each size class', () => {
16
- const arrangement = appShellLayout.arrangement as FlowArrangement;
17
-
18
- const regular = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Regular });
19
- const compactWidth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Regular });
20
- const compactHeight = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Compact });
21
- const compactBoth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Compact });
22
-
23
- it('should use the full tree at a regular width and height', () => {
24
- regular.should.equal(appShellRegularRoot);
25
- });
26
-
27
- it('should collapse the sidebar out of the flow at a compact width', () => {
28
- compactWidth.should.equal(appShellCompactWidthRoot);
29
- });
30
-
31
- it('should drop the breadcrumb and footer at a compact height', () => {
32
- compactHeight.should.equal(appShellCompactHeightRoot);
33
- });
34
-
35
- it('should prefer the override targeting both axes when both are compact', () => {
36
- compactBoth.should.equal(appShellCompactRoot);
37
- });
38
-
39
- it('should be the layout declared on the blueprint', () => {
40
- arrangement.should.equal(appShellArrangement);
41
- });
42
- });
@@ -1,43 +0,0 @@
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 { PackageKind } from '@cratis/scene.model';
5
- import { validatePackageBundle } from '@cratis/scene.react';
6
- import { defaultBlueprint, defaultBlueprintManifest } from '../defaultBlueprint';
7
- import { defaultBlueprintName } from '../packageName';
8
-
9
- describe('when validating the bundle', () => {
10
- const problems = validatePackageBundle(defaultBlueprint);
11
-
12
- it('should report no problems', () => {
13
- problems.should.be.empty;
14
- });
15
-
16
- it('should declare itself a blueprint', () => {
17
- defaultBlueprintManifest.kind.should.equal(PackageKind.Blueprint);
18
- });
19
-
20
- it('should be named as a blueprint package', () => {
21
- defaultBlueprintManifest.name.should.equal(defaultBlueprintName);
22
- });
23
-
24
- it('should depend on the component libraries its shells are built from', () => {
25
- defaultBlueprintManifest.dependencies.map(dependency => dependency.name).should.deep.equal(['PrimeReact', 'Cratis.Components']);
26
- });
27
-
28
- it('should declare only application shells as layouts', () => {
29
- defaultBlueprintManifest.layouts.should.deep.equal(['AppShell', 'FullPage']);
30
- });
31
-
32
- it('should declare a screen template for every one it provides', () => {
33
- defaultBlueprintManifest.screenTemplates.should.deep.equal((defaultBlueprint.screenTemplates ?? []).map(template => template.name));
34
- });
35
-
36
- it('should declare a dialog template for every one it provides', () => {
37
- defaultBlueprintManifest.dialogTemplates.should.deep.equal((defaultBlueprint.dialogTemplates ?? []).map(template => template.name));
38
- });
39
-
40
- it('should ship a screen for every screen template', () => {
41
- (defaultBlueprint.screens ?? []).map(screen => screen.name).should.deep.equal(defaultBlueprintManifest.screenTemplates);
42
- });
43
- });
@@ -1,50 +0,0 @@
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 { incompatiblePackages } from '@cratis/scene.engine';
5
- import { themeTokenProperty } from '@cratis/scene.react';
6
- import { galleryProfile } from '../gallery';
7
- import { darkTheme, defaultBlueprintThemes, lightTheme } from '../themes';
8
-
9
- describe('when checking attribution and tokens', () => {
10
- for (const theme of defaultBlueprintThemes) {
11
- describe(`and the theme is '${theme.name}'`, () => {
12
- it('should say who made it', () => {
13
- (theme.author ?? '').should.not.be.empty;
14
- });
15
-
16
- it('should link to them', () => {
17
- (theme.authorUrl ?? '').should.not.be.empty;
18
- });
19
-
20
- it('should state the license it is used under', () => {
21
- (theme.license ?? '').should.not.be.empty;
22
- });
23
-
24
- it('should be compatible with every package the gallery profile activates', () => {
25
- incompatiblePackages(theme, galleryProfile).should.be.empty;
26
- });
27
-
28
- it('should declare compatibility with core, which gets no implicit exemption', () => {
29
- theme.compatibleWith.should.contain('core');
30
- });
31
- });
32
- }
33
-
34
- it('should define exactly the same token names in both themes', () => {
35
- Object.keys(lightTheme.tokens ?? {})
36
- .sort()
37
- .should.deep.equal(Object.keys(darkTheme.tokens ?? {}).sort());
38
- });
39
-
40
- it('should ship one light and one dark theme', () => {
41
- defaultBlueprintThemes.filter(theme => theme.isDark === true).should.have.lengthOf(1);
42
- defaultBlueprintThemes.filter(theme => theme.isDark !== true).should.have.lengthOf(1);
43
- });
44
-
45
- it('should name tokens that become the custom properties the stylesheet reads', () => {
46
- themeTokenProperty('primary.contrastColor').should.equal('--scene-primary-contrast-color');
47
- themeTokenProperty('text.mutedColor').should.equal('--scene-text-muted-color');
48
- themeTokenProperty('content.borderRadius').should.equal('--scene-content-border-radius');
49
- });
50
- });
@@ -1,36 +0,0 @@
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 { FlowArrangement, FlowContainer, FlowSlotLeaf, HeightSizeClass, WidthSizeClass } from '@cratis/scene.model';
5
- import { evaluateFlowArrangement } from '@cratis/scene.engine';
6
- import { SlotName, fullPageCompactWidthRoot, fullPageLayout, fullPageRegularRoot } from '../layouts';
7
-
8
- describe('when evaluating the arrangement at each size class', () => {
9
- const arrangement = fullPageLayout.arrangement as FlowArrangement;
10
-
11
- const regular = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Regular });
12
- const compactWidth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Regular });
13
- const compactHeight = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Regular, height: HeightSizeClass.Compact });
14
- const compactBoth = evaluateFlowArrangement(arrangement, { width: WidthSizeClass.Compact, height: HeightSizeClass.Compact });
15
-
16
- it('should use the split tree at a regular width', () => {
17
- regular.should.equal(fullPageRegularRoot);
18
- });
19
-
20
- it('should keep the split tree at a compact height, which the width override does not target', () => {
21
- compactHeight.should.equal(fullPageRegularRoot);
22
- });
23
-
24
- it('should drop the branding aside at a compact width', () => {
25
- compactWidth.should.equal(fullPageCompactWidthRoot);
26
- });
27
-
28
- it('should drop the branding aside whenever the width is compact, whatever the height is', () => {
29
- compactBoth.should.equal(fullPageCompactWidthRoot);
30
- });
31
-
32
- it('should leave the compact-width tree with no reference to the aside slot', () => {
33
- const leaves = (fullPageCompactWidthRoot as FlowContainer).children as FlowSlotLeaf[];
34
- leaves.map(leaf => leaf.slotName).should.not.contain(SlotName.Aside);
35
- });
36
- });