1- < << << << HEAD
21import { Map } from 'immutable' ;
32
43import { EditorLocation , Notification , UiState } from '../records' ;
54
65const defaultState = new UiState ( ) ;
76
87function addNotification ( state , type , severity , metadata = { } ) {
9- = === ===
10- import Immutable from 'immutable' ;
11- import {
12- updateEditorColumnFlex ,
13- updateWorkspaceRowFlex ,
14- } from '../util/resize' ;
15-
16-
17- const DEFAULT_COLUMN_FLEX = new Immutable . List ( [ '1' , '1' , '1' ] ) ;
18- const DEFAULT_ROW_FLEX = new Immutable . List ( [ '1' , '1' ] ) ;
19- export const DEFAULT_WORKSPACE = new Immutable . Map ( {
20- columnFlex : DEFAULT_COLUMN_FLEX ,
21- rowFlex : DEFAULT_ROW_FLEX ,
22- isDraggingColumnDivider : false ,
23- } ) ;
24-
25- const defaultState = new Immutable . Map ( ) .
26- set ( 'editors' , new Immutable . Map ( {
27- typing : false ,
28- requestedFocusedLine : null ,
29- textSizeIsLarge : false ,
30- focusedSelector : null ,
31- focusedEditor : null ,
32- } ) ) .
33- set ( 'workspace' , DEFAULT_WORKSPACE ) .
34- set ( 'notifications' , new Immutable . Map ( ) ) .
35- set ( 'topBar' , new Immutable . Map ( { openMenu : null } ) ) .
36- set ( 'lastRefreshTimestamp' , null ) ;
37-
38- function addNotification ( state , type , severity , payload = { } ) {
39- > >>> >>> 54 c9f3a ... Update Element Highlighter
408 return state . setIn (
419 [ 'notifications' , type ] ,
4210 new Notification ( { type, severity, metadata : new Map ( metadata ) } ) ,
@@ -72,9 +40,10 @@ export default function ui(stateIn, action) {
7240 case 'UPDATE_PROJECT_SOURCE' :
7341 return state . set ( 'isTyping' , true ) ;
7442
75- case 'CURRENT_FOCUSED_SELECTOR_CHANGED ' :
43+ case 'UPDATE_HIGHLIGHTER_SELECTOR ' :
7644 return state . setIn (
77- [ 'editors' , 'focusedSelector' ] , action . payload ,
45+ [ 'editors' , 'highlighterSelector' ] ,
46+ action . payload . selector ,
7847 ) ;
7948
8049 case 'USER_DONE_TYPING' :
@@ -90,7 +59,6 @@ export default function ui(stateIn, action) {
9059 } ) ,
9160 ) ;
9261
93- < << << << HEAD
9462 case 'CLEAR_CONSOLE_ENTRIES' :
9563 return state . set (
9664 'requestedFocusedLine' ,
@@ -100,34 +68,6 @@ export default function ui(stateIn, action) {
10068 column : 0 ,
10169 } ) ,
10270 ) ;
103- = === ===
104- case 'EDITOR_FOCUSED_REQUESTED_LINE' :
105- return state . setIn ( [ 'editors' , 'requestedFocusedLine' ] , null ) ;
106-
107- case 'EDITOR_FOCUSED' :
108- return state . setIn (
109- [ 'editors' , 'focusedEditor' ] ,
110- action . payload . language ,
111- ) ;
112-
113- case 'EDITOR_BLURRED' :
114- return state . setIn (
115- [ 'editors' , 'focusedEditor' ] ,
116- null ,
117- ) ;
118-
119- case 'EDITOR_RESIZED' :
120- return state . setIn (
121- [ 'editors' , 'focusedSelector' ] ,
122- null ,
123- ) ;
124-
125- case 'DRAG_ROW_DIVIDER' :
126- return state . updateIn ( [ 'workspace' , 'columnFlex' ] , ( prevFlex ) => {
127- const newFlex = updateEditorColumnFlex ( action . payload ) ;
128- return newFlex ? Immutable . fromJS ( newFlex ) : prevFlex ;
129- } ) ;
130- > >>> >>> 23 eb7f2 ... Updates to element highlighter
13171
13272 case 'EDITOR_FOCUSED_REQUESTED_LINE' :
13373 return state . set ( 'requestedFocusedLine' , null ) ;
0 commit comments