@@ -15,9 +15,7 @@ import {
1515 BreakPoint ,
1616 ɵMatchMedia as MatchMedia ,
1717 StylesheetMap ,
18- sortAscendingPriority ,
19- LayoutConfigOptions ,
20- LAYOUT_CONFIG ,
18+ sortAscendingPriority
2119} from '@angular/flex-layout/core' ;
2220
2321import { ServerMatchMedia } from './server-match-media' ;
@@ -33,8 +31,7 @@ import {ServerMatchMedia} from './server-match-media';
3331 */
3432export function generateStaticFlexLayoutStyles ( serverSheet : StylesheetMap ,
3533 mediaController : ServerMatchMedia ,
36- breakpoints : BreakPoint [ ] ,
37- layoutConfig : LayoutConfigOptions ) {
34+ breakpoints : BreakPoint [ ] ) {
3835 // Store the custom classes in the following map, that way only
3936 // one class gets allocated per HTMLElement, and each class can
4037 // be referenced in the static media queries
@@ -55,20 +52,7 @@ export function generateStaticFlexLayoutStyles(serverSheet: StylesheetMap,
5552 mediaController . deactivateBreakpoint ( breakpoints [ i ] ) ;
5653 } ) ;
5754
58- const serverBps = layoutConfig . ssrObserveBreakpoints ;
59- if ( serverBps ) {
60- serverBps
61- . reduce ( ( acc : BreakPoint [ ] , serverBp : string ) => {
62- const foundBp = breakpoints . find ( bp => serverBp === bp . alias ) ;
63- if ( ! foundBp ) {
64- console . warn ( `FlexLayoutServerModule: unknown breakpoint alias "${ serverBp } "` ) ;
65- } else {
66- acc . push ( foundBp ) ;
67- }
68- return acc ;
69- } , [ ] )
70- . forEach ( mediaController . activateBreakpoint ) ;
71- }
55+
7256
7357 return styleText ;
7458}
@@ -80,14 +64,12 @@ export function generateStaticFlexLayoutStyles(serverSheet: StylesheetMap,
8064export function FLEX_SSR_SERIALIZER_FACTORY ( serverSheet : StylesheetMap ,
8165 mediaController : ServerMatchMedia ,
8266 _document : Document ,
83- breakpoints : BreakPoint [ ] ,
84- layoutConfig : LayoutConfigOptions ) {
67+ breakpoints : BreakPoint [ ] ) {
8568 return ( ) => {
8669 // This is the style tag that gets inserted into the head of the DOM,
8770 // populated with the manual media queries
8871 const styleTag = _document . createElement ( 'style' ) ;
89- const styleText = generateStaticFlexLayoutStyles ( serverSheet , mediaController , breakpoints ,
90- layoutConfig ) ;
72+ const styleText = generateStaticFlexLayoutStyles ( serverSheet , mediaController , breakpoints ) ;
9173 styleTag . classList . add ( `${ CLASS_NAME } ssr` ) ;
9274 styleTag . textContent = styleText ;
9375 _document . head ! . appendChild ( styleTag ) ;
@@ -105,8 +87,7 @@ export const SERVER_PROVIDERS = [
10587 StylesheetMap ,
10688 MatchMedia ,
10789 DOCUMENT ,
108- BREAKPOINTS ,
109- LAYOUT_CONFIG ,
90+ BREAKPOINTS
11091 ] ,
11192 multi : true
11293 } ,
0 commit comments