@@ -15,9 +15,7 @@ import {
15
15
BreakPoint ,
16
16
ɵMatchMedia as MatchMedia ,
17
17
StylesheetMap ,
18
- sortAscendingPriority ,
19
- LayoutConfigOptions ,
20
- LAYOUT_CONFIG ,
18
+ sortAscendingPriority
21
19
} from '@angular/flex-layout/core' ;
22
20
23
21
import { ServerMatchMedia } from './server-match-media' ;
@@ -33,8 +31,7 @@ import {ServerMatchMedia} from './server-match-media';
33
31
*/
34
32
export function generateStaticFlexLayoutStyles ( serverSheet : StylesheetMap ,
35
33
mediaController : ServerMatchMedia ,
36
- breakpoints : BreakPoint [ ] ,
37
- layoutConfig : LayoutConfigOptions ) {
34
+ breakpoints : BreakPoint [ ] ) {
38
35
// Store the custom classes in the following map, that way only
39
36
// one class gets allocated per HTMLElement, and each class can
40
37
// be referenced in the static media queries
@@ -55,20 +52,7 @@ export function generateStaticFlexLayoutStyles(serverSheet: StylesheetMap,
55
52
mediaController . deactivateBreakpoint ( breakpoints [ i ] ) ;
56
53
} ) ;
57
54
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
+
72
56
73
57
return styleText ;
74
58
}
@@ -80,14 +64,12 @@ export function generateStaticFlexLayoutStyles(serverSheet: StylesheetMap,
80
64
export function FLEX_SSR_SERIALIZER_FACTORY ( serverSheet : StylesheetMap ,
81
65
mediaController : ServerMatchMedia ,
82
66
_document : Document ,
83
- breakpoints : BreakPoint [ ] ,
84
- layoutConfig : LayoutConfigOptions ) {
67
+ breakpoints : BreakPoint [ ] ) {
85
68
return ( ) => {
86
69
// This is the style tag that gets inserted into the head of the DOM,
87
70
// populated with the manual media queries
88
71
const styleTag = _document . createElement ( 'style' ) ;
89
- const styleText = generateStaticFlexLayoutStyles ( serverSheet , mediaController , breakpoints ,
90
- layoutConfig ) ;
72
+ const styleText = generateStaticFlexLayoutStyles ( serverSheet , mediaController , breakpoints ) ;
91
73
styleTag . classList . add ( `${ CLASS_NAME } ssr` ) ;
92
74
styleTag . textContent = styleText ;
93
75
_document . head ! . appendChild ( styleTag ) ;
@@ -105,8 +87,7 @@ export const SERVER_PROVIDERS = [
105
87
StylesheetMap ,
106
88
MatchMedia ,
107
89
DOCUMENT ,
108
- BREAKPOINTS ,
109
- LAYOUT_CONFIG ,
90
+ BREAKPOINTS
110
91
] ,
111
92
multi : true
112
93
} ,
0 commit comments