git.iko.soy/rowtype-yoga/psfp
on master help sign in
Move fill in the gaps component to components
commit969116c6b351eb9f4a39bf61dbc68522f42fda09 authorMark Eibes <mark.eibes@gmail.com> dateFri 10 Apr 2020, 22:13 (7 years ago) parente569abd
20 files changed+1031−586
blog/.psc-ide-port−1 blog/src/components/FillInTheGaps.purs+1−1 components/src/React/Basic/Hooks/Spring/Stories.purs+23−14 components/src/Yoga/Button/Component.purs+103−74 components/src/Yoga/Card/Component.purs+27−50 components/src/Yoga/Compiler.purs+1 components/src/Yoga/Compiler/Api.purs+53 components/src/Yoga/Compiler/Types.purs+11 components/src/Yoga/FillInTheGaps/Component.purs+232 components/src/Yoga/FillInTheGaps/Stories.purs+60 components/src/Yoga/FillInTheGaps/Styles.purs+23 components/src/Yoga/Highlighter.purs+3 components/src/Yoga/Highlighter/Monaco.purs+24 components/src/Yoga/Highlighter/Types.purs+15 components/src/Yoga/Modal/Stories.purs−1 components/src/Yoga/Monaco/Editor.js+215−212 components/src/Yoga/Monaco/Editor.purs+2 components/src/Yoga/Monaco/Editor.ts+234−228 components/src/Yoga/Theme.purs+2−2 components/src/Yoga/Theme/Default.purs+2−3
blog/.psc-ide-portdeleted−1
@@ -1 +0,0 @@
1−15408
blog/src/components/FillInTheGaps.purs+1−1
@@ -204,7 +204,7 @@ mkFillInTheGaps fetch = do
204204 guard (isJust item)
205205 $ join item
206206 # foldMap \_ ->
207− [element clickAway (justifill { style: props, onClick: modifyResult (const Nothing) })]
207+ [element clickAway (justifill { allowEscape: true, style: props, onClick: modifyResult (const Nothing) })]
208208 , fragment
209209 $ modalTransitions
210210 >>= \{ item, key, props } ->
components/src/React/Basic/Hooks/Spring/Stories.purs+23−14
@@ -1,8 +1,12 @@
11module React.Basic.Hooks.Spring.Stories where
22
33import Prelude hiding (add)
4−import Data.Maybe (Maybe(..))
4+import Data.Function.Uncurried (mkFn2)
5+import Data.Int (pow)
6+import Data.Maybe (Maybe(..), isJust)
7+import Data.Monoid (guard)
58import Data.Tuple.Nested ((/\))
9+import Debug.Trace (spy)
610import Effect (Effect)
711import Effect.Unsafe (unsafePerformEffect)
812import JSS (jssClasses)
@@ -20,6 +24,7 @@ import Yoga.Button.Component (mkButton)
2024import Yoga.Card.Component (mkCard)
2125import Yoga.Centre.Component as Centre
2226import Yoga.Cluster.Component as Cluster
27+import Yoga.Helpers ((?||))
2328import Yoga.Spec.Helpers (withDarkTheme)
2429import Yoga.Stack.Component as Stack
2530import Yoga.Theme.Styles (makeStylesJSS)
@@ -92,24 +97,28 @@ mkTransition = do
9297 { from: { opacity: 0.0, transform: "translate3d(-50vw, 0px, 0.0) scale3d(0.2, 0.2, 0.2)", position: "absolute" }
9398 , enter: { opacity: 1.0, transform: "translate3d(0.0, 0px, 0.0) scale3d(1.0,1.0,1.0)" }
9499 , leave: { opacity: 0.0, transform: "translate3d(50vw, 0px, 0.0) scale3d(0.0, 0.0, 1.0)" }
95− , config: { mass: 5, tension: 500, friction: 100 }
100+ , config: { mass: 1, tension: 100, friction: 12, clamp: true, easing: pow 2 }
101+ , unique: true
96102 }
97103 pure
98104 $ fragment
99105 $ ( transitions
100106 <#> \{ item, key, props } ->
101− if item == Just true then
102− animatedDiv
103− { className: classes.div
104− , style: props
105− , children: [ jsx card {} [ R.text "hello, you" ] ]
106− }
107− else
108− animatedDiv
109− { className: classes.div
110− , style: props
111− , children: [ jsx card {} [ R.text "hello, again" ] ]
112− }
107+ guard (item # isJust)
108+ $ if item == Just true then
109+ animatedDiv
110+ { className: classes.div
111+ , style: props
112+ , key: "you"
113+ , children: [ jsx card {} [ R.text "hello, you" ] ]
114+ }
115+ else
116+ animatedDiv
117+ { className: classes.div
118+ , style: props
119+ , key: "again"
120+ , children: [ jsx card {} [ R.text "hello, again" ] ]
121+ }
113122 )
114123 <> [ jsx button { onClick: handler_ (modifyToggled not) } [ R.text "Toggle" ] ]
115124
components/src/Yoga/Button/Component.purs+103−74
@@ -1,9 +1,10 @@
11module Yoga.Button.Component where
22
33import Prelude
4−import CSS (Color, angular, black, cssStringRGBA, deg, desaturate, pct, saturate)
4+import CSS (Color, ColorSpace(..), angular, black, cssStringRGBA, deg, desaturate, pct, saturate)
55import CSS as C
66import CSS as Color
7+import Color (mixCubehelix)
78import Color.Scheme.Clrs (blue)
89import Data.Array.NonEmpty as NEA
910import Data.Foldable (intercalate)
@@ -42,20 +43,53 @@ highlightStyles =
4243 { highlightedButton:
4344 { background:
4445 linearGradient
45− "135deg"
46− [ withAlpha (if theme.isLight then 0.15 else 0.07) theme.backgroundColourDarker
47− , withAlpha (if theme.isLight then 0.15 else 0.07) theme.backgroundColourLighter
46+ "180deg"
47+ [ withAlpha (if theme.isLight then 0.2 else 0.2) (Color.lighten 0.5 theme.highlightColour)
48+ , withAlpha (if theme.isLight then 0.15 else 0.4) (Color.darken 0.5 theme.highlightColour)
4849 ]
49− , color: theme.backgroundColour
50+ <> " ,"
51+ <> linearGradient
52+ "225deg"
53+ [ theme.highlightColourRotatedBackwards
54+ , theme.highlightColourRotatedForwards
55+ ]
56+ , color: Color.cssStringRGBA theme.backgroundColour <> " !important"
57+ , boxShadow:
58+ "0 var(--s-5) var(--s-2)" <> (Color.cssStringRGBA $ withAlpha 0.2 Color.black)
59+ , backgroundClip: "border-box"
60+ , "-webkit-background-clip": "border-box"
61+ , textFillColor: theme.backgroundColour
62+ , "-webkit-text-fill-color": theme.backgroundColour
63+ , "&:active":
64+ { boxShadow:
65+ i "inset var(--s-3) var(--s-3) var(--s-3) "
66+ (cssStringRGBA $ Color.darken 0.5 theme.backgroundColourDarker)
67+ ", inset calc(-1 * var(--s-3)) calc(-1 * -var(--s-3)) var(--s-3) "
68+ (cssStringRGBA $ Color.darken 0.2 theme.backgroundColourDarkest) ∷
69+ String
70+ , color: Color.darken 0.05 theme.backgroundColour
71+ , textFillColor: Color.darken 0.05 theme.backgroundColour
72+ , background:
73+ linearGradient
74+ "0deg"
75+ [ withAlpha (if theme.isLight then 0.2 else 0.2) (Color.darken 0.1 theme.highlightColour)
76+ , withAlpha (if theme.isLight then 0.15 else 0.4) (Color.darken 0.8 theme.highlightColour)
77+ ]
78+ <> " ,"
79+ <> linearGradient
80+ "225deg"
81+ [ theme.highlightColourRotatedBackwards
82+ , theme.highlightColourRotatedForwards
83+ ]
84+ }
5085 }
5186 }
5287
5388styles ∷
5489 JSSClasses YogaTheme {}
55− ( "@keyframes gradientBG" ∷ JSSElem StyleProps
56− , btn ∷ JSSElem StyleProps
57− , buttonContainer ∷ JSSElem StyleProps
90+ ( btn ∷ JSSElem StyleProps
5891 , disabled ∷ JSSElem StyleProps
92+ , container ∷ JSSElem StyleProps
5993 )
6094styles =
6195 jssClasses
@@ -69,95 +103,90 @@ styles =
69103
70104 less amount x = if Color.isLight x then darken amount x else lighten amount x
71105 in
72− { buttonContainer:
73− { padding: "var(--s-4)"
74− , background:
75− linearGradient "225deg"
76− [ theme.highlightColourRotatedBackwards
77− , theme.highlightColourRotatedForwards
78− ]
79− , borderRadius: "var(--s1)"
80− , height: "calc(var(--s1) - var(--s1-3))"
81− , minWidth: "var(--s2)"
82− , boxSizing: "border-box"
83− , boxShadow:
84− ( cssStringRGBA (Color.rgba 0 0 0 0.15)
85− )
86− <> " 0 var(--s-5) var(--s-5) var(--s-5)"
87− }
88− , "@keyframes gradientBG":
89− { "0%": { backgroundPosition: "0% 50%" }
90− , "50%": { backgroundPosition: "100% 50%" }
91− , "100%": { backgroundPosition: "0% 50%" }
92− }
106+ { container:
107+ \props ->
108+ { borderRadius: "var(--s1)"
109+ , "-webkit-background-clip": "border-box"
110+ , backgroundClip: "border-box"
111+ , background:
112+ linearGradient (if theme.isLight then "180deg" else "0deg")
113+ [ more 0.02 $ Color.mix HSL theme.backgroundColour theme.highlightColourRotatedBackwards 0.05 # (flip (Color.mix HSL theme.highlightColourRotatedForwards) (if theme.isLight then 0.94 else 0.85))
114+ , less 0.03 $ Color.mix HSL theme.backgroundColour theme.highlightColourRotatedForwards 0.05 # (flip (Color.mix HSL theme.highlightColourRotatedBackwards) (if theme.isLight then 0.84 else 0.70))
115+ ]
116+ , display: "inline-block"
117+ }
93118 , btn:
94− { width: "calc(100%)"
95− , background:
96− linearGradient "80deg"
97− [ less 0.03 theme.backgroundColour
98− , less 0.05 theme.backgroundColour
119+ { background:
120+ linearGradient "127deg"
121+ [ theme.highlightColourRotatedBackwards # Color.rotateHue (-10.0)
122+ , theme.highlightColourRotatedForwards # Color.rotateHue (10.0)
99123 ]
100− , color:
101− let
102− c = theme.highlightColour
103− in
104− if Color.isLight c then Color.rotateHue (-10.0) c else Color.lighten 0.2 c
124+ , boxShadow:
125+ "0 var(--s-5) var(--s-2)" <> (Color.cssStringRGBA $ withAlpha 0.1 Color.black)
126+ , padding: "calc(var(--s0) - var(--s-4)) var(--s1) calc(var(--s0) - var(--s-5)) var(--s1)"
127+ , backgroundClip: "text"
128+ , "-webkit-background-clip": "text"
129+ , textFillColor: "transparent"
130+ , "-webkit-text-fill-color": "transparent"
105131 , borderRadius: "var(--s1)"
106132 , border: "0"
107− , height: "calc(var(--s2))"
108− , fontSize: "calc(var(--s-1))"
133+ -- , height: "calc(var(--s2) + var(--s-2))"
134+ , fontSize: "calc(var(--s-2) + var(--s-3))"
109135 , fontFamily: NEA.head theme.textFontFamily
110− , fontWeight: "600"
111− , padding: "0 var(--s0) 0 var(--s0)"
112− , letterSpacing: "var(--s-5)"
136+ , fontWeight: "500"
137+ , letterSpacing: "var(--s-4)"
113138 , textTransform: "uppercase"
114139 , outline: "none"
115140 , "&:focus":
116141 { boxShadow:
117− ( i "var(--s-4) 0 var(--s-2)"
118− (cssStringRGBA theme.highlightColourRotatedForwards)
119− ", calc(-1 * var(--s-4)) 0 var(--s-2)"
120− (cssStringRGBA theme.highlightColourRotatedForwards)
121− ", 0 calc(-1 * var(--s-4)) var(--s-2)"
122− (cssStringRGBA theme.highlightColourRotatedBackwards)
123− ", 0 var(--s-4) var(--s-2)"
124− (cssStringRGBA theme.highlightColourRotatedBackwards)
125− ) ∷
142+ i "var(--s-4) 0 var(--s-2)"
143+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedForwards)
144+ ", calc(-1 * var(--s-4)) 0 var(--s-2)"
145+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedForwards)
146+ ", 0 calc(-1 * var(--s-4)) var(--s-2)"
147+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedBackwards)
148+ ", 0 var(--s-4) var(--s-2)"
149+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedBackwards) ∷
126150 String
127151 }
128152 , "&:active":
129153 { boxShadow:
130− ( i "inset var(--s-3) var(--s-3) var(--s-3) "
131− (cssStringRGBA $ darken 0.3 theme.backgroundColourDarker)
132− ", inset calc(-1 * var(--s-3)) calc(-1 * -var(--s-3)) var(--s-3) "
133− (cssStringRGBA theme.backgroundColourDarkest)
134− ) ∷
154+ i "inset var(--s-3) var(--s-3) var(--s-3) "
155+ (cssStringRGBA $ darken 0.5 theme.backgroundColourDarker)
156+ ", inset calc(-1 * var(--s-3)) calc(-1 * -var(--s-3)) var(--s-3) "
157+ (cssStringRGBA $ darken 0.2 theme.backgroundColourDarkest)
158+ ", var(--s-4) 0 var(--s-2)"
159+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedForwards)
160+ ", calc(-1 * var(--s-4)) 0 var(--s-2)"
161+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedForwards)
162+ ", 0 calc(-1 * var(--s-4)) var(--s-2)"
163+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedBackwards)
164+ ", 0 var(--s-4) var(--s-2)"
165+ (cssStringRGBA $ withAlpha 0.5 theme.highlightColourRotatedBackwards) ∷
135166 String
136167 , background:
137− linearGradient
138− "135deg"
139− [ withAlpha (if theme.isLight then 0.15 else 0.07) theme.backgroundColourLighter
140− , withAlpha (if theme.isLight then 0.15 else 0.07) theme.backgroundColourDarker
168+ linearGradient (if theme.isLight then "0deg" else "180deg")
169+ [ less 0.04 $ withAlpha 0.92 theme.backgroundColour
170+ , less 0.09 $ withAlpha 0.92 theme.backgroundColour
141171 ]
142− <> ","
143− <> linearGradient
144− "180deg"
145− [ Color.rgba 0 0 10 0.17
146− , Color.rgba 0 0 10 0.03
147− , Color.rgba 0 0 10 0.067
148− ]
149− , color: theme.backgroundColour
172+ , color: more 0.02 theme.highlightColour
173+ , textFillColor: more 0.02 theme.highlightColour
150174 }
151175 , "&:disabled":
152− { boxShadow: "0 0 0 black"
153− , background: less 0.1 theme.backgroundColour
176+ { boxShadow: "none"
177+ , backgroundClip: "border-box"
178+ , "-webkit-background-clip": "border-box"
179+ , textFillColor: "initial"
180+ , "-webkit-text-fill-color": "initial"
181+ , background: "transparent"
154182 , color: less 0.2 theme.backgroundColour
155183 }
156184 }
157185 , "disabled":
158186 { background:
159− (cssStringRGBA $ less 0.1 theme.backgroundColour)
187+ (cssStringRGBA $ withAlpha 0.5 $ less 0.1 theme.backgroundColour)
160188 <> " !important"
189+ , boxShadow: "none !important"
161190 }
162191 }
163192
@@ -181,7 +210,7 @@ mkButton = do
181210 className = props.className ?|| ""
182211 pure
183212 $ R.div
184− { className: classes.buttonContainer <> " " <> if buttonType == DisabledButton then classes.disabled else ""
213+ { className: classes.container <> " " <> if buttonType == DisabledButton then classes.disabled else ""
185214 , children:
186215 [ R.button
187216 $ { className:
components/src/Yoga/Card/Component.purs+27−50
@@ -1,7 +1,7 @@
11module Yoga.Card.Component where
22
33import Prelude
4−import CSS (angular, deg, linearGradient, pct)
4+import CSS (BackgroundImage, angular, deg, linearGradient, pct)
55import Color (cssStringRGBA)
66import Color as Color
77import Data.Interpolate (i)
@@ -13,76 +13,53 @@ import React.Basic (JSX)
1313import React.Basic.Helpers (jsx)
1414import React.Basic.Hooks (ReactComponent, component)
1515import React.Basic.Hooks as React
16+import Record.Extra (pick)
1617import Yoga.Box.Component as Box
17−import Yoga.Helpers ((?||))
18+import Yoga.Helpers (ifJustTrue, (?||))
19+import Yoga.Theme (withAlpha)
1820import Yoga.Theme.Styles (makeStylesJSS)
1921import Yoga.Theme.Types (CSSTheme, YogaTheme)
2022
2123type StyleProps
22− = {}
24+ = ( zoomOnHover ∷ Maybe Boolean )
2325
24−styles ∷ JSSClasses YogaTheme StyleProps ( card ∷ JSSElem StyleProps )
26+styles ∷ JSSClasses YogaTheme { | StyleProps } ( card ∷ JSSElem { | StyleProps } )
2527styles =
2628 jssClasses \(theme ∷ CSSTheme) ->
27− let
28− lighten x = Color.lighten if theme.isLight then (0.5 * x) else 1.7 * x
29−
30− darken x = Color.darken if theme.isLight then 1.0 * x else (1.2 * x)
31−
32− normal =
33− if theme.isLight then
34− darken 0.03 $ theme.backgroundColour
35− else
36− lighten 0.015 theme.backgroundColour
37−
38− dark =
39− if theme.isLight then
40− darken 0.03 normal
41− else
42− darken 0.05 normal
43−
44− light =
45− if theme.isLight then
46− lighten 0.10 normal
47− else
48− lighten 0.05 normal
49− in
50− { card:
51− { borderRadius: "var(--s1)"
29+ { card:
30+ \props ->
31+ { borderRadius: "var(--s-2)"
5232 , boxShadow:
5333 i -- bottom right
54− "var(--s-2) var(--s-2) var(--s-1) "
55− (cssStringRGBA dark)
56− --bottom left
57− ", calc(-1 * var(--s-2)) var(--s-2) var(--s-1) "
58− (cssStringRGBA normal)
59− --top left
60− ", calc(-1 * var(--s-2)) calc(-1 * var(--s-2)) var(--s-1) "
61− (cssStringRGBA light)
62− --top right
63− ", var(--s-2) calc(-1 * var(--s-2)) var(--s-1) "
64− (cssStringRGBA normal) ∷
34+ "var(--s-5) var(--s-3) var(--s-3) "
35+ (cssStringRGBA $ withAlpha 0.13 Color.black)
36+ ", calc(var(--s-5) * -1) calc(-1 * var(--s-5)) var(--s-2) "
37+ (cssStringRGBA $ withAlpha 0.1 Color.black) ∷
6538 String
66− , background:
67− linearGradient (angular (-45.0 # deg))
68− [ dark /\ (0.0 # pct)
69− , light /\ (100.0 # pct)
70− ]
39+ , transform: ifJustTrue props.zoomOnHover $ "scale3d(0.9, 0.9, 1.0)"
40+ , transition: "transform 0.2s ease-in-out"
41+ , "&:hover":
42+ { transform: "scale3d(1.0, 1.0, 1.0)"
43+ }
7144 }
72− }
45+ }
46+
47+type Props r
48+ = ( kids ∷ Array JSX
49+ , className ∷ Maybe String
50+ | r
51+ )
7352
7453mkCard ∷
7554 Effect
7655 ( ReactComponent
77− { kids ∷ Array JSX
78− , className ∷ Maybe String
79− }
56+ { | Props (StyleProps) }
8057 )
8158mkCard = do
8259 useStyles <- makeStylesJSS styles
8360 box <- Box.makeComponent
8461 component "Card" \props@{ kids, className } -> React.do
85− classes <- useStyles {}
62+ classes <- useStyles (pick props)
8663 pure
8764 $ jsx box
8865 { className: classes.card <> " " <> (className ?|| "")
components/src/Yoga/Compiler.pursnew file+1
@@ -0,0 +1 @@
1+module Yoga.Compiler where
components/src/Yoga/Compiler/Api.pursnew file+53
@@ -0,0 +1,53 @@
1+module Yoga.Compiler.Api where
2+
3+import Prelude
4+import Data.Either (Either(..))
5+import Data.Maybe (Maybe(..))
6+import Effect.Aff (Aff, attempt, error, message, throwError)
7+import Milkis as M
8+import Shared.Json (readAff)
9+import Shared.Models.Body as Body
10+import Simple.JSON (writeJSON)
11+import Yoga.Compiler.Types (Compiler)
12+
13+apiCompiler ∷ M.Fetch -> { | Compiler () }
14+apiCompiler fetch =
15+ { compileAndRun
16+ }
17+ where
18+ compileAndRun ∷ Body.CompileRequest -> Aff (Either Body.CompileResult Body.RunResult)
19+ compileAndRun body = do
20+ response <-
21+ attempt
22+ $ fetch (M.URL "/api/compileAndRun")
23+ { method: M.postMethod
24+ , body: writeJSON body
25+ , headers: M.makeHeaders { "Content-Type": "application/json" }
26+ }
27+ case response of
28+ Left l ->
29+ pure
30+ ( Left
31+ { resultType: ""
32+ , result:
33+ [ { allSpans: []
34+ , errorCode: ""
35+ , errorLink: ""
36+ , filename: ""
37+ , message: message l
38+ , moduleName: Nothing
39+ , position:
40+ { endColumn: 0
41+ , endLine: 0
42+ , startColumn: 0
43+ , startLine: 0
44+ }
45+ , suggestion: Nothing
46+ }
47+ ]
48+ }
49+ )
50+ Right r -> case M.statusCode r of
51+ 200 -> M.json r >>= readAff <#> Right
52+ 422 -> M.json r >>= readAff <#> Left
53+ code -> throwError (error $ "Unexpected response code " <> show code)
components/src/Yoga/Compiler/Types.pursnew file+11
@@ -0,0 +1,11 @@
1+module Yoga.Compiler.Types where
2+
3+import Data.Either (Either)
4+import Effect.Aff (Aff)
5+import Shared.Models.Body as Body
6+
7+type Compiler r
8+ = ( compileAndRun ∷
9+ Body.CompileRequest -> Aff (Either Body.CompileResult Body.RunResult)
10+ | r
11+ )
components/src/Yoga/FillInTheGaps/Component.pursnew file+232
@@ -0,0 +1,232 @@
1+module Yoga.FillInTheGaps.Component where
2+
3+import Prelude
4+import Data.Array (foldMap, intercalate)
5+import Data.Array as A
6+import Data.Either (Either(..))
7+import Data.Foldable (foldl)
8+import Data.Function.Uncurried (mkFn2)
9+import Data.Lens ((%~))
10+import Data.Lens.Index (ix)
11+import Data.Maybe (Maybe(..), fromMaybe', isJust, isNothing)
12+import Data.Monoid (guard)
13+import Data.String (Pattern(..), split)
14+import Data.String as S
15+import Data.String.Regex (Regex)
16+import Data.String.Regex as Regex
17+import Data.String.Regex.Flags as RegexFlags
18+import Data.String.Regex.Unsafe (unsafeRegex)
19+import Data.Tuple.Nested ((/\))
20+import Effect (Effect)
21+import Effect.Aff (launchAff_)
22+import Effect.Class (liftEffect)
23+import Justifill (justifill)
24+import Partial.Unsafe (unsafeCrashWith)
25+import React.Basic (JSX, ReactComponent, element, fragment)
26+import React.Basic.DOM (css)
27+import React.Basic.DOM as R
28+import React.Basic.Events (handler_)
29+import React.Basic.Helpers (jsx)
30+import React.Basic.Hooks (component, useState)
31+import React.Basic.Hooks as React
32+import React.Basic.Hooks.Spring (useTransition)
33+import Shared.Models.Body (CompileResult, RunResult)
34+import Type.Row (type (+))
35+import Yoga.Button.Component (ButtonType(..), mkButton)
36+import Yoga.ClickAway.Component as ClickAway
37+import Yoga.CloseIcon.Component as CloseIcon
38+import Yoga.Cluster.Component as Cluster
39+import Yoga.Compiler.Types (Compiler)
40+import Yoga.Helpers ((?||))
41+import Yoga.Highlighter.Types (Highlighter)
42+import Yoga.InlineCode.Component as InlineCode
43+import Yoga.Modal.Component as Modal
44+
45+data Segment
46+ = ExpectedResult String
47+ | Start
48+ | End
49+ | Filler String
50+ | Hole Int String
51+
52+derive instance eqSegment ∷ Eq Segment
53+getResult ∷ Segment -> Maybe String
54+getResult = case _ of
55+ ExpectedResult r -> Just r
56+ _ -> Nothing
57+
58+findResult ∷ Array Segment -> String
59+findResult = fromMaybe' (\_ -> unsafeCrashWith "Even teachers make mistakes") <<< A.findMap getResult
60+
61+toCode ∷ Array (Array Segment) -> String
62+toCode lines = intercalate "\n" mapped
63+ where
64+ mapped = lines <#> (intercalate "" <<< map segmentToCode)
65+ segmentToCode = case _ of
66+ Filler s -> s
67+ Hole _ s -> s
68+ _ -> ""
69+
70+complete ∷ Array (Array Segment) -> Boolean
71+complete arr = foldl f true (join arr)
72+ where
73+ f acc seg =
74+ acc
75+ && case seg of
76+ Hole _ s -> s /= ""
77+ _ -> true
78+
79+visibleRange ∷ Array (Array Segment) -> { end ∷ Int, start ∷ Int }
80+visibleRange arr = { start, end }
81+ where
82+ start = A.findIndex (_ == [ Start ]) arr ?|| 0
83+ end = A.findIndex (_ == [ End ]) arr ?|| A.length arr
84+
85+renderSegments ∷ ReactComponent InlineCode.Props -> ((Array (Array Segment) -> Array (Array Segment)) -> Effect Unit) -> Array (Array Segment) -> JSX
86+renderSegments ic update arrs = R.div_ (A.mapWithIndex renderLine arrs)
87+ where
88+ { start, end } = visibleRange arrs
89+ renderLine i l = R.div_ (A.mapWithIndex (renderSegment i) l)
90+ renderSegment i j s =
91+ if between start end i then case s of
92+ Filler s' -> R.code_ [ R.text s' ]
93+ Hole width _ ->
94+ element ic
95+ $ justifill
96+ { width
97+ , onSubmit: update <<< updateSegments i j
98+ }
99+ _ -> mempty
100+ else
101+ mempty
102+
103+updateSegments ∷ Int -> Int -> String -> Array (Array Segment) -> Array (Array Segment)
104+updateSegments i j v = (ix i <<< ix j) %~ f
105+ where
106+ f = case _ of
107+ Hole h _ -> Hole h v
108+ _ -> unsafeCrashWith "Updated a non-hole"
109+
110+holeRegex ∷ Regex
111+holeRegex = unsafeRegex "({-.*?-})" RegexFlags.global
112+
113+resultRegex ∷ Regex
114+resultRegex = unsafeRegex "--result" RegexFlags.global
115+
116+startRegex ∷ Regex
117+startRegex = unsafeRegex "--start here" RegexFlags.global
118+
119+endRegex ∷ Regex
120+endRegex = unsafeRegex "--end here" RegexFlags.global
121+
122+rawSegments ∷ String -> Array String
123+rawSegments = Regex.split holeRegex
124+
125+toSegment ∷ String -> Segment
126+toSegment = case _ of
127+ x
128+ | Regex.test holeRegex x -> Hole (S.length x - 4) ""
129+ x
130+ | S.indexOf (Pattern "--result ") x == Just 0 -> ExpectedResult ((S.stripPrefix (Pattern "--result ") x) ?|| "")
131+ x
132+ | Regex.test startRegex x -> Start
133+ x
134+ | Regex.test endRegex x -> End
135+ other -> Filler other
136+
137+type Ctx r
138+ = (Compiler + Highlighter r)
139+
140+makeComponent ∷ { | Ctx () } -> Effect (ReactComponent { code ∷ String })
141+makeComponent { compileAndRun, highlight } = do
142+ ic <- InlineCode.makeComponent
143+ modal <- Modal.makeComponent
144+ closeIcon <- CloseIcon.makeComponent
145+ cluster <- Cluster.makeComponent
146+ clickAway <- ClickAway.makeComponent
147+ button <- mkButton
148+ component "FillInTheGaps" \{ code } -> React.do
149+ let
150+ lines = split (Pattern "\n") code
151+
152+ initialSegments = lines <#> \line -> rawSegments line <#> toSegment
153+ segments /\ modifySegments <- useState initialSegments
154+ result /\ modifyResult <- useState Nothing
155+ modalTransitions <-
156+ useTransition [ result ] (Just show)
157+ $ css
158+ { from: { opacity: 0.0, transform: "translate3d(-50%, -50%, 0) scale3d(0.3, 0.3, 1.0)" }
159+ , enter: { opacity: 1.0, transform: "translate3d(-50%, -50%, 0) scale3d(1.0, 1.0, 1.0)" }
160+ , leave: { opacity: 0.0, transform: "translate3d(-50%, -50%, 0) scale3d(0.3, 0.3, 1.0)" }
161+ , config:
162+ mkFn2 \_ state -> case state of
163+ "leave" -> { mass: 1.0, tension: 140, friction: 15 }
164+ _ -> { mass: 1.0, tension: 170, friction: 20 }
165+ }
166+ clickAwayTransitions <-
167+ useTransition [ result ] (Just show)
168+ $ css
169+ { from: { opacity: 0.0 }
170+ , enter: { opacity: 1.0 }
171+ , leave: { opacity: 0.0 }
172+ , config:
173+ mkFn2 \_ state -> case state of
174+ "leave" -> { mass: 1.0, tension: 140, friction: 15 }
175+ _ -> { mass: 1.0, tension: 170, friction: 20 }
176+ }
177+ let
178+ expectedResult = findResult (join segments)
179+
180+ onClick =
181+ launchAff_ do
182+ do
183+ res <- compileAndRun { code: toCode segments }
184+ modifyResult (const (Just $ res)) # liftEffect
185+ pure
186+ $ fragment
187+ $ [ renderSegments ic (modifySegments) segments
188+ , jsx cluster {}
189+ [ R.div_
190+ [ jsx button
191+ { onClick: handler_ onClick
192+ , buttonType:
193+ if complete segments && isNothing result then
194+ HighlightedButton
195+ else
196+ DisabledButton
197+ }
198+ [ R.text "Try it" ]
199+ ]
200+ ]
201+ , fragment
202+ $ clickAwayTransitions
203+ >>= \{ item, key, props } ->
204+ guard (isJust item)
205+ $ join item
206+ # foldMap \_ ->
207+ [ element clickAway (justifill { allowEscape: true, style: props, onClick: modifyResult (const Nothing) }) ]
208+ , fragment
209+ $ modalTransitions
210+ >>= \{ item, key, props } ->
211+ guard (isJust item)
212+ $ join item
213+ # foldMap \r ->
214+ [ jsx modal
215+ { title:
216+ case r of
217+ (Right { stdout })
218+ | S.stripSuffix (S.Pattern "\n") stdout == Just expectedResult -> "Hooray!"
219+ (Left l) -> "Does not compile"
220+ (Right _) -> "Not " <> (findResult $ join segments)
221+ , icon: element closeIcon { onClick: modifyResult (const Nothing), style: Nothing }
222+ , style: props
223+ }
224+ [ R.pre_ [ R.text $ compileResultToString result ] ]
225+ ]
226+ ]
227+
228+compileResultToString ∷ Maybe (Either CompileResult RunResult) -> String
229+compileResultToString = case _ of
230+ Nothing -> ""
231+ Just (Left cr) -> cr.result <#> _.message # intercalate "\n"
232+ Just (Right r) -> r.stdout
components/src/Yoga/FillInTheGaps/Stories.pursnew file+60
@@ -0,0 +1,60 @@
1+module Yoga.FillInTheGaps.Stories where
2+
3+import Prelude hiding (add)
4+import Data.Either (Either(..))
5+import Data.Maybe (Maybe(..))
6+import Data.String as String
7+import Debug.Trace (spy)
8+import Effect (Effect)
9+import Storybook.Decorator.FullScreen (fullScreenDecorator)
10+import Storybook.React (Storybook, add, addDecorator, storiesOf)
11+import Yoga.FillInTheGaps.Component as FillInTheGaps
12+import Yoga.Highlighter.Types (HTMLString(..), Language(..))
13+
14+ctx ∷ { | FillInTheGaps.Ctx () }
15+ctx =
16+ { compileAndRun
17+ , highlight
18+ }
19+ where
20+ highlight c Purescript = pure (HTMLString c)
21+ compileAndRun = case _ of
22+ { code }
23+ | code == correctCode -> pure (Right { code: Nothing, stdout: "Hello World\n", stderr: "" })
24+ other -> pure (Right { code: Nothing, stdout: "Not hello world", stderr: "" })
25+
26+stories ∷ Effect Storybook
27+stories = do
28+ storiesOf "FillInTheGaps" do
29+ addDecorator fullScreenDecorator
30+ add "The FillInTheGaps" (FillInTheGaps.makeComponent ctx)
31+ [ { code: codeWithHoles }
32+ ]
33+
34+codeWithHoles =
35+ """
36+--result Hello World
37+module Main where
38+import Batteries
39+
40+main :: Effect Unit
41+--start here
42+main = log
43+ "{-Hello World-}"
44+--end here
45+"""
46+
47+correctCode =
48+ String.replace
49+ (String.Pattern "{-Hello World-}")
50+ (String.Replacement "Hello World")
51+ <<< String.replace
52+ (String.Pattern "--result Hello World")
53+ (String.Replacement "")
54+ <<< String.replace
55+ (String.Pattern "--start here")
56+ (String.Replacement "")
57+ <<< String.replace
58+ (String.Pattern "--end here")
59+ (String.Replacement "")
60+ $ codeWithHoles
components/src/Yoga/FillInTheGaps/Styles.pursnew file+23
@@ -0,0 +1,23 @@
1+module Yoga.FillInTheGaps.Styles where
2+
3+import Prelude hiding (top)
4+import JSS (JSSClasses, JSSElem, jssClasses)
5+import Yoga.Theme.Types (YogaTheme)
6+
7+type PropsR
8+ = ()
9+
10+type Props
11+ = Record PropsR
12+
13+type Classes a
14+ = ( blue ∷ a
15+ , green ∷ a
16+ )
17+
18+styles ∷ JSSClasses YogaTheme Props (Classes (JSSElem Props))
19+styles =
20+ jssClasses \theme ->
21+ { blue: { color: theme.blue }
22+ , green: { color: theme.green }
23+ }
components/src/Yoga/Highlighter.pursnew file+3
@@ -0,0 +1,3 @@
1+module Yoga.Highlighter where
2+
3+import Yoga.Highlighter.Types (Highlighter)
components/src/Yoga/Highlighter/Monaco.pursnew file+24
@@ -0,0 +1,24 @@
1+module Yoga.Highlighter.Monaco where
2+
3+import Prelude
4+import Control.Promise as Promise
5+import Effect.Aff (Aff)
6+import Yoga.Editor (Editor, colorizeImpl)
7+import Yoga.Highlighter.Types (HTMLString(..), Highlighter, Language(..))
8+
9+monacoHighlighter ∷ Editor -> { | Highlighter () }
10+monacoHighlighter editor =
11+ { highlight
12+ }
13+ where
14+ langToString ∷ Language -> String
15+ langToString Purescript = "purescript"
16+ highlight ∷ String -> Language -> Aff HTMLString
17+ highlight code lang =
18+ HTMLString
19+ <$> Promise.toAff
20+ ( colorizeImpl code
21+ (langToString lang)
22+ { tabSize: 2 }
23+ editor
24+ )
components/src/Yoga/Highlighter/Types.pursnew file+15
@@ -0,0 +1,15 @@
1+module Yoga.Highlighter.Types where
2+
3+import Effect.Aff (Aff)
4+
5+data Language
6+ = Purescript
7+
8+newtype HTMLString
9+ = HTMLString String
10+
11+type Highlighter r
12+ = ( highlight ∷
13+ String -> Language -> Aff HTMLString
14+ | r
15+ )
components/src/Yoga/Modal/Stories.purs−1
@@ -4,7 +4,6 @@ import Prelude hiding (add)
44import Data.Maybe (Maybe(..))
55import Data.Monoid (guard)
66import Data.Tuple.Nested ((/\))
7−import Debug.Trace (spy)
87import Effect (Effect)
98import Justifill (justifill)
109import React.Basic.DOM (css)
components/src/Yoga/Monaco/Editor.js+215−212
@@ -58,6 +58,9 @@ exports.getValue = function (editor) {
5858 return editor.getValue();
5959 };
6060};
61+exports.colorizeImpl = function (text) { return function (languageId) { return function (options) { return function (editor) {
62+ return editor.colorize(text, languageId, options);
63+}; }; }; };
6164exports.setValue = function (value) { return function (editor) { return function () { return editor.setValue(value); }; }; };
6265exports.defineThemeImpl = function (monacoInstance) { return function (name) { return function (theme) { return function () {
6366 return monacoInstance.editor.defineTheme(name, theme);
@@ -91,84 +94,84 @@ exports.vsCodeTheme = function (bg) { return ({
9194 rules: [
9295 {
9396 foreground: "008e00",
94− token: "comment"
97+ token: "comment",
9598 },
9699 {
97100 foreground: "7d4726",
98− token: "meta.preprocessor"
101+ token: "meta.preprocessor",
99102 },
100103 {
101104 foreground: "7d4726",
102− token: "keyword.control.import"
105+ token: "keyword.control.import",
103106 },
104107 {
105108 foreground: "df0002",
106− token: "string"
109+ token: "string",
107110 },
108111 {
109112 foreground: "3a00dc",
110− token: "constant.numeric"
113+ token: "constant.numeric",
111114 },
112115 {
113116 foreground: "c800a4",
114− token: "constant.language"
117+ token: "constant.language",
115118 },
116119 {
117120 foreground: "275a5e",
118− token: "constant.character"
121+ token: "constant.character",
119122 },
120123 {
121124 foreground: "275a5e",
122− token: "constant.other"
125+ token: "constant.other",
123126 },
124127 {
125128 foreground: "c800a4",
126− token: "variable.language"
129+ token: "variable.language",
127130 },
128131 {
129132 foreground: "c800a4",
130− token: "variable.other"
133+ token: "variable.other",
131134 },
132135 {
133136 foreground: "c800a4",
134− token: "keyword"
137+ token: "keyword",
135138 },
136139 {
137140 foreground: "c900a4",
138− token: "storage"
141+ token: "storage",
139142 },
140143 {
141144 foreground: "438288",
142− token: "entity.name.class"
145+ token: "entity.name.class",
143146 },
144147 {
145148 foreground: "790ead",
146− token: "entity.name.tag"
149+ token: "entity.name.tag",
147150 },
148151 {
149152 foreground: "450084",
150− token: "entity.other.attribute-name"
153+ token: "entity.other.attribute-name",
151154 },
152155 {
153156 foreground: "450084",
154− token: "support.function"
157+ token: "support.function",
155158 },
156159 {
157160 foreground: "450084",
158− token: "support.constant"
161+ token: "support.constant",
159162 },
160163 {
161164 foreground: "790ead",
162− token: "support.type"
165+ token: "support.type",
163166 },
164167 {
165168 foreground: "790ead",
166− token: "support.class"
169+ token: "support.class",
167170 },
168171 {
169172 foreground: "790ead",
170− token: "support.other.variable"
171− }
173+ token: "support.other.variable",
174+ },
172175 ],
173176 colors: {
174177 "editor.foreground": "#000000",
@@ -176,8 +179,8 @@ exports.vsCodeTheme = function (bg) { return ({
176179 "editor.selectionBackground": "#B5D5FF",
177180 "editor.lineHighlightBackground": "#00000012",
178181 "editorCursor.foreground": "#000000",
179− "editorWhitespace.foreground": "#BFBFBF"
180− }
182+ "editorWhitespace.foreground": "#BFBFBF",
183+ },
181184}); };
182185exports.nightOwlTheme = function (bg) { return ({
183186 base: "vs-dark",
@@ -185,664 +188,664 @@ exports.nightOwlTheme = function (bg) { return ({
185188 rules: [
186189 {
187190 foreground: "637777",
188− token: "comment"
191+ token: "comment",
189192 },
190193 {
191194 foreground: "addb67",
192− token: "string"
195+ token: "string",
193196 },
194197 {
195198 foreground: "ecc48d",
196− token: "vstring.quoted"
199+ token: "vstring.quoted",
197200 },
198201 {
199202 foreground: "ecc48d",
200− token: "variable.other.readwrite.js"
203+ token: "variable.other.readwrite.js",
201204 },
202205 {
203206 foreground: "5ca7e4",
204− token: "string.regexp"
207+ token: "string.regexp",
205208 },
206209 {
207210 foreground: "5ca7e4",
208− token: "string.regexp keyword.other"
211+ token: "string.regexp keyword.other",
209212 },
210213 {
211214 foreground: "5f7e97",
212− token: "meta.function punctuation.separator.comma"
215+ token: "meta.function punctuation.separator.comma",
213216 },
214217 {
215218 foreground: "f78c6c",
216− token: "constant.numeric"
219+ token: "constant.numeric",
217220 },
218221 {
219222 foreground: "f78c6c",
220− token: "constant.character.numeric"
223+ token: "constant.character.numeric",
221224 },
222225 {
223226 foreground: "addb67",
224− token: "variable"
227+ token: "variable",
225228 },
226229 {
227230 foreground: "c792ea",
228− token: "keyword"
231+ token: "keyword",
229232 },
230233 {
231234 foreground: "c792ea",
232− token: "punctuation.accessor"
235+ token: "punctuation.accessor",
233236 },
234237 {
235238 foreground: "c792ea",
236− token: "storage"
239+ token: "storage",
237240 },
238241 {
239242 foreground: "c792ea",
240− token: "meta.var.expr"
243+ token: "meta.var.expr",
241244 },
242245 {
243246 foreground: "c792ea",
244− token: "meta.class meta.method.declaration meta.var.expr storage.type.jsm"
247+ token: "meta.class meta.method.declaration meta.var.expr storage.type.jsm",
245248 },
246249 {
247250 foreground: "c792ea",
248− token: "storage.type.property.js"
251+ token: "storage.type.property.js",
249252 },
250253 {
251254 foreground: "c792ea",
252− token: "storage.type.property.ts"
255+ token: "storage.type.property.ts",
253256 },
254257 {
255258 foreground: "c792ea",
256− token: "storage.type.property.tsx"
259+ token: "storage.type.property.tsx",
257260 },
258261 {
259262 foreground: "82aaff",
260− token: "storage.type"
263+ token: "storage.type",
261264 },
262265 {
263266 foreground: "ffcb8b",
264− token: "entity.name.class"
267+ token: "entity.name.class",
265268 },
266269 {
267270 foreground: "ffcb8b",
268− token: "meta.class entity.name.type.class"
271+ token: "meta.class entity.name.type.class",
269272 },
270273 {
271274 foreground: "addb67",
272− token: "entity.other.inherited-class"
275+ token: "entity.other.inherited-class",
273276 },
274277 {
275278 foreground: "82aaff",
276− token: "entity.name.function"
279+ token: "entity.name.function",
277280 },
278281 {
279282 foreground: "addb67",
280− token: "punctuation.definition.variable"
283+ token: "punctuation.definition.variable",
281284 },
282285 {
283286 foreground: "d3423e",
284− token: "punctuation.section.embedded"
287+ token: "punctuation.section.embedded",
285288 },
286289 {
287290 foreground: "d6deeb",
288− token: "punctuation.terminator.expression"
291+ token: "punctuation.terminator.expression",
289292 },
290293 {
291294 foreground: "d6deeb",
292− token: "punctuation.definition.arguments"
295+ token: "punctuation.definition.arguments",
293296 },
294297 {
295298 foreground: "d6deeb",
296− token: "punctuation.definition.array"
299+ token: "punctuation.definition.array",
297300 },
298301 {
299302 foreground: "d6deeb",
300− token: "punctuation.section.array"
303+ token: "punctuation.section.array",
301304 },
302305 {
303306 foreground: "d6deeb",
304− token: "meta.array"
307+ token: "meta.array",
305308 },
306309 {
307310 foreground: "d9f5dd",
308− token: "punctuation.definition.list.begin"
311+ token: "punctuation.definition.list.begin",
309312 },
310313 {
311314 foreground: "d9f5dd",
312− token: "punctuation.definition.list.end"
315+ token: "punctuation.definition.list.end",
313316 },
314317 {
315318 foreground: "d9f5dd",
316− token: "punctuation.separator.arguments"
319+ token: "punctuation.separator.arguments",
317320 },
318321 {
319322 foreground: "d9f5dd",
320− token: "punctuation.definition.list"
323+ token: "punctuation.definition.list",
321324 },
322325 {
323326 foreground: "d3423e",
324− token: "string.template meta.template.expression"
327+ token: "string.template meta.template.expression",
325328 },
326329 {
327330 foreground: "d6deeb",
328− token: "string.template punctuation.definition.string"
331+ token: "string.template punctuation.definition.string",
329332 },
330333 {
331334 foreground: "c792ea",
332335 fontStyle: "italic",
333− token: "italic"
336+ token: "italic",
334337 },
335338 {
336339 foreground: "addb67",
337340 fontStyle: "bold",
338− token: "bold"
341+ token: "bold",
339342 },
340343 {
341344 foreground: "82aaff",
342− token: "constant.language"
345+ token: "constant.language",
343346 },
344347 {
345348 foreground: "82aaff",
346− token: "punctuation.definition.constant"
349+ token: "punctuation.definition.constant",
347350 },
348351 {
349352 foreground: "82aaff",
350− token: "variable.other.constant"
353+ token: "variable.other.constant",
351354 },
352355 {
353356 foreground: "7fdbca",
354− token: "support.function.construct"
357+ token: "support.function.construct",
355358 },
356359 {
357360 foreground: "7fdbca",
358− token: "keyword.other.new"
361+ token: "keyword.other.new",
359362 },
360363 {
361364 foreground: "82aaff",
362− token: "constant.character"
365+ token: "constant.character",
363366 },
364367 {
365368 foreground: "82aaff",
366− token: "constant.other"
369+ token: "constant.other",
367370 },
368371 {
369372 foreground: "f78c6c",
370− token: "constant.character.escape"
373+ token: "constant.character.escape",
371374 },
372375 {
373376 foreground: "addb67",
374− token: "entity.other.inherited-class"
377+ token: "entity.other.inherited-class",
375378 },
376379 {
377380 foreground: "d7dbe0",
378− token: "variable.parameter"
381+ token: "variable.parameter",
379382 },
380383 {
381384 foreground: "7fdbca",
382− token: "entity.name.tag"
385+ token: "entity.name.tag",
383386 },
384387 {
385388 foreground: "cc2996",
386− token: "punctuation.definition.tag.html"
389+ token: "punctuation.definition.tag.html",
387390 },
388391 {
389392 foreground: "cc2996",
390− token: "punctuation.definition.tag.begin"
393+ token: "punctuation.definition.tag.begin",
391394 },
392395 {
393396 foreground: "cc2996",
394− token: "punctuation.definition.tag.end"
397+ token: "punctuation.definition.tag.end",
395398 },
396399 {
397400 foreground: "addb67",
398− token: "entity.other.attribute-name"
401+ token: "entity.other.attribute-name",
399402 },
400403 {
401404 foreground: "addb67",
402− token: "entity.name.tag.custom"
405+ token: "entity.name.tag.custom",
403406 },
404407 {
405408 foreground: "82aaff",
406− token: "support.function"
409+ token: "support.function",
407410 },
408411 {
409412 foreground: "82aaff",
410− token: "support.constant"
413+ token: "support.constant",
411414 },
412415 {
413416 foreground: "7fdbca",
414− token: "upport.constant.meta.property-value"
417+ token: "upport.constant.meta.property-value",
415418 },
416419 {
417420 foreground: "addb67",
418− token: "support.type"
421+ token: "support.type",
419422 },
420423 {
421424 foreground: "addb67",
422− token: "support.class"
425+ token: "support.class",
423426 },
424427 {
425428 foreground: "addb67",
426− token: "support.variable.dom"
429+ token: "support.variable.dom",
427430 },
428431 {
429432 foreground: "7fdbca",
430− token: "support.constant"
433+ token: "support.constant",
431434 },
432435 {
433436 foreground: "7fdbca",
434− token: "keyword.other.special-method"
437+ token: "keyword.other.special-method",
435438 },
436439 {
437440 foreground: "7fdbca",
438− token: "keyword.other.new"
441+ token: "keyword.other.new",
439442 },
440443 {
441444 foreground: "7fdbca",
442− token: "keyword.other.debugger"
445+ token: "keyword.other.debugger",
443446 },
444447 {
445448 foreground: "7fdbca",
446− token: "keyword.control"
449+ token: "keyword.control",
447450 },
448451 {
449452 foreground: "c792ea",
450− token: "keyword.operator.comparison"
453+ token: "keyword.operator.comparison",
451454 },
452455 {
453456 foreground: "c792ea",
454− token: "keyword.control.flow.js"
457+ token: "keyword.control.flow.js",
455458 },
456459 {
457460 foreground: "c792ea",
458− token: "keyword.control.flow.ts"
461+ token: "keyword.control.flow.ts",
459462 },
460463 {
461464 foreground: "c792ea",
462− token: "keyword.control.flow.tsx"
465+ token: "keyword.control.flow.tsx",
463466 },
464467 {
465468 foreground: "c792ea",
466− token: "keyword.control.ruby"
469+ token: "keyword.control.ruby",
467470 },
468471 {
469472 foreground: "c792ea",
470− token: "keyword.control.module.ruby"
473+ token: "keyword.control.module.ruby",
471474 },
472475 {
473476 foreground: "c792ea",
474− token: "keyword.control.class.ruby"
477+ token: "keyword.control.class.ruby",
475478 },
476479 {
477480 foreground: "c792ea",
478− token: "keyword.control.def.ruby"
481+ token: "keyword.control.def.ruby",
479482 },
480483 {
481484 foreground: "c792ea",
482− token: "keyword.control.loop.js"
485+ token: "keyword.control.loop.js",
483486 },
484487 {
485488 foreground: "c792ea",
486− token: "keyword.control.loop.ts"
489+ token: "keyword.control.loop.ts",
487490 },
488491 {
489492 foreground: "c792ea",
490− token: "keyword.control.import.js"
493+ token: "keyword.control.import.js",
491494 },
492495 {
493496 foreground: "c792ea",
494− token: "keyword.control.import.ts"
497+ token: "keyword.control.import.ts",
495498 },
496499 {
497500 foreground: "c792ea",
498− token: "keyword.control.import.tsx"
501+ token: "keyword.control.import.tsx",
499502 },
500503 {
501504 foreground: "c792ea",
502− token: "keyword.control.from.js"
505+ token: "keyword.control.from.js",
503506 },
504507 {
505508 foreground: "c792ea",
506− token: "keyword.control.from.ts"
509+ token: "keyword.control.from.ts",
507510 },
508511 {
509512 foreground: "c792ea",
510− token: "keyword.control.from.tsx"
513+ token: "keyword.control.from.tsx",
511514 },
512515 {
513516 foreground: "ffffff",
514517 background: "ff2c83",
515− token: "invalid"
518+ token: "invalid",
516519 },
517520 {
518521 foreground: "ffffff",
519522 background: "d3423e",
520− token: "invalid.deprecated"
523+ token: "invalid.deprecated",
521524 },
522525 {
523526 foreground: "7fdbca",
524− token: "keyword.operator"
527+ token: "keyword.operator",
525528 },
526529 {
527530 foreground: "c792ea",
528− token: "keyword.operator.relational"
531+ token: "keyword.operator.relational",
529532 },
530533 {
531534 foreground: "c792ea",
532− token: "keyword.operator.assignement"
535+ token: "keyword.operator.assignement",
533536 },
534537 {
535538 foreground: "c792ea",
536− token: "keyword.operator.arithmetic"
539+ token: "keyword.operator.arithmetic",
537540 },
538541 {
539542 foreground: "c792ea",
540− token: "keyword.operator.bitwise"
543+ token: "keyword.operator.bitwise",
541544 },
542545 {
543546 foreground: "c792ea",
544− token: "keyword.operator.increment"
547+ token: "keyword.operator.increment",
545548 },
546549 {
547550 foreground: "c792ea",
548− token: "keyword.operator.ternary"
551+ token: "keyword.operator.ternary",
549552 },
550553 {
551554 foreground: "637777",
552− token: "comment.line.double-slash"
555+ token: "comment.line.double-slash",
553556 },
554557 {
555558 foreground: "cdebf7",
556− token: "object"
559+ token: "object",
557560 },
558561 {
559562 foreground: "ff5874",
560− token: "constant.language.null"
563+ token: "constant.language.null",
561564 },
562565 {
563566 foreground: "d6deeb",
564− token: "meta.brace"
567+ token: "meta.brace",
565568 },
566569 {
567570 foreground: "c792ea",
568− token: "meta.delimiter.period"
571+ token: "meta.delimiter.period",
569572 },
570573 {
571574 foreground: "d9f5dd",
572− token: "punctuation.definition.string"
575+ token: "punctuation.definition.string",
573576 },
574577 {
575578 foreground: "ff5874",
576− token: "constant.language.boolean"
579+ token: "constant.language.boolean",
577580 },
578581 {
579582 foreground: "ffffff",
580− token: "object.comma"
583+ token: "object.comma",
581584 },
582585 {
583586 foreground: "7fdbca",
584− token: "variable.parameter.function"
587+ token: "variable.parameter.function",
585588 },
586589 {
587590 foreground: "80cbc4",
588− token: "support.type.vendor.property-name"
591+ token: "support.type.vendor.property-name",
589592 },
590593 {
591594 foreground: "80cbc4",
592− token: "support.constant.vendor.property-value"
595+ token: "support.constant.vendor.property-value",
593596 },
594597 {
595598 foreground: "80cbc4",
596− token: "support.type.property-name"
599+ token: "support.type.property-name",
597600 },
598601 {
599602 foreground: "80cbc4",
600− token: "meta.property-list entity.name.tag"
603+ token: "meta.property-list entity.name.tag",
601604 },
602605 {
603606 foreground: "57eaf1",
604− token: "meta.property-list entity.name.tag.reference"
607+ token: "meta.property-list entity.name.tag.reference",
605608 },
606609 {
607610 foreground: "f78c6c",
608− token: "constant.other.color.rgb-value punctuation.definition.constant"
611+ token: "constant.other.color.rgb-value punctuation.definition.constant",
609612 },
610613 {
611614 foreground: "ffeb95",
612− token: "constant.other.color"
615+ token: "constant.other.color",
613616 },
614617 {
615618 foreground: "ffeb95",
616− token: "keyword.other.unit"
619+ token: "keyword.other.unit",
617620 },
618621 {
619622 foreground: "c792ea",
620− token: "meta.selector"
623+ token: "meta.selector",
621624 },
622625 {
623626 foreground: "fad430",
624− token: "entity.other.attribute-name.id"
627+ token: "entity.other.attribute-name.id",
625628 },
626629 {
627630 foreground: "80cbc4",
628− token: "meta.property-name"
631+ token: "meta.property-name",
629632 },
630633 {
631634 foreground: "c792ea",
632− token: "entity.name.tag.doctype"
635+ token: "entity.name.tag.doctype",
633636 },
634637 {
635638 foreground: "c792ea",
636− token: "meta.tag.sgml.doctype"
639+ token: "meta.tag.sgml.doctype",
637640 },
638641 {
639642 foreground: "d9f5dd",
640− token: "punctuation.definition.parameters"
643+ token: "punctuation.definition.parameters",
641644 },
642645 {
643646 foreground: "ecc48d",
644− token: "string.quoted"
647+ token: "string.quoted",
645648 },
646649 {
647650 foreground: "ecc48d",
648− token: "string.quoted.double"
651+ token: "string.quoted.double",
649652 },
650653 {
651654 foreground: "ecc48d",
652− token: "string.quoted.single"
655+ token: "string.quoted.single",
653656 },
654657 {
655658 foreground: "addb67",
656− token: "support.constant.math"
659+ token: "support.constant.math",
657660 },
658661 {
659662 foreground: "addb67",
660− token: "support.type.property-name.json"
663+ token: "support.type.property-name.json",
661664 },
662665 {
663666 foreground: "addb67",
664− token: "support.constant.json"
667+ token: "support.constant.json",
665668 },
666669 {
667670 foreground: "c789d6",
668− token: "meta.structure.dictionary.value.json string.quoted.double"
671+ token: "meta.structure.dictionary.value.json string.quoted.double",
669672 },
670673 {
671674 foreground: "80cbc4",
672− token: "string.quoted.double.json punctuation.definition.string.json"
675+ token: "string.quoted.double.json punctuation.definition.string.json",
673676 },
674677 {
675678 foreground: "ff5874",
676− token: "meta.structure.dictionary.json meta.structure.dictionary.value constant.language"
679+ token: "meta.structure.dictionary.json meta.structure.dictionary.value constant.language",
677680 },
678681 {
679682 foreground: "d6deeb",
680− token: "variable.other.ruby"
683+ token: "variable.other.ruby",
681684 },
682685 {
683686 foreground: "ecc48d",
684− token: "entity.name.type.class.ruby"
687+ token: "entity.name.type.class.ruby",
685688 },
686689 {
687690 foreground: "ecc48d",
688− token: "keyword.control.class.ruby"
691+ token: "keyword.control.class.ruby",
689692 },
690693 {
691694 foreground: "ecc48d",
692− token: "meta.class.ruby"
695+ token: "meta.class.ruby",
693696 },
694697 {
695698 foreground: "7fdbca",
696− token: "constant.language.symbol.hashkey.ruby"
699+ token: "constant.language.symbol.hashkey.ruby",
697700 },
698701 {
699702 foreground: "e0eddd",
700703 background: "a57706",
701704 fontStyle: "italic",
702− token: "meta.diff"
705+ token: "meta.diff",
703706 },
704707 {
705708 foreground: "e0eddd",
706709 background: "a57706",
707710 fontStyle: "italic",
708− token: "meta.diff.header"
711+ token: "meta.diff.header",
709712 },
710713 {
711714 foreground: "ef535090",
712715 fontStyle: "italic",
713− token: "markup.deleted"
716+ token: "markup.deleted",
714717 },
715718 {
716719 foreground: "a2bffc",
717720 fontStyle: "italic",
718− token: "markup.changed"
721+ token: "markup.changed",
719722 },
720723 {
721724 foreground: "a2bffc",
722725 fontStyle: "italic",
723− token: "meta.diff.header.git"
726+ token: "meta.diff.header.git",
724727 },
725728 {
726729 foreground: "a2bffc",
727730 fontStyle: "italic",
728− token: "meta.diff.header.from-file"
731+ token: "meta.diff.header.from-file",
729732 },
730733 {
731734 foreground: "a2bffc",
732735 fontStyle: "italic",
733− token: "meta.diff.header.to-file"
736+ token: "meta.diff.header.to-file",
734737 },
735738 {
736739 foreground: "219186",
737740 background: "eae3ca",
738− token: "markup.inserted"
741+ token: "markup.inserted",
739742 },
740743 {
741744 foreground: "d3201f",
742− token: "other.package.exclude"
745+ token: "other.package.exclude",
743746 },
744747 {
745748 foreground: "d3201f",
746− token: "other.remove"
749+ token: "other.remove",
747750 },
748751 {
749752 foreground: "269186",
750− token: "other.add"
753+ token: "other.add",
751754 },
752755 {
753756 foreground: "ff5874",
754− token: "constant.language.python"
757+ token: "constant.language.python",
755758 },
756759 {
757760 foreground: "82aaff",
758− token: "variable.parameter.function.python"
761+ token: "variable.parameter.function.python",
759762 },
760763 {
761764 foreground: "82aaff",
762− token: "meta.function-call.arguments.python"
765+ token: "meta.function-call.arguments.python",
763766 },
764767 {
765768 foreground: "b2ccd6",
766− token: "meta.function-call.python"
769+ token: "meta.function-call.python",
767770 },
768771 {
769772 foreground: "b2ccd6",
770− token: "meta.function-call.generic.python"
773+ token: "meta.function-call.generic.python",
771774 },
772775 {
773776 foreground: "d6deeb",
774− token: "punctuation.python"
777+ token: "punctuation.python",
775778 },
776779 {
777780 foreground: "addb67",
778− token: "entity.name.function.decorator.python"
781+ token: "entity.name.function.decorator.python",
779782 },
780783 {
781784 foreground: "8eace3",
782− token: "source.python variable.language.special"
785+ token: "source.python variable.language.special",
783786 },
784787 {
785788 foreground: "82b1ff",
786− token: "markup.heading.markdown"
789+ token: "markup.heading.markdown",
787790 },
788791 {
789792 foreground: "c792ea",
790793 fontStyle: "italic",
791− token: "markup.italic.markdown"
794+ token: "markup.italic.markdown",
792795 },
793796 {
794797 foreground: "addb67",
795798 fontStyle: "bold",
796− token: "markup.bold.markdown"
799+ token: "markup.bold.markdown",
797800 },
798801 {
799802 foreground: "697098",
800− token: "markup.quote.markdown"
803+ token: "markup.quote.markdown",
801804 },
802805 {
803806 foreground: "80cbc4",
804− token: "markup.inline.raw.markdown"
807+ token: "markup.inline.raw.markdown",
805808 },
806809 {
807810 foreground: "ff869a",
808− token: "markup.underline.link.markdown"
811+ token: "markup.underline.link.markdown",
809812 },
810813 {
811814 foreground: "ff869a",
812− token: "markup.underline.link.image.markdown"
815+ token: "markup.underline.link.image.markdown",
813816 },
814817 {
815818 foreground: "d6deeb",
816− token: "string.other.link.title.markdown"
819+ token: "string.other.link.title.markdown",
817820 },
818821 {
819822 foreground: "d6deeb",
820− token: "string.other.link.description.markdown"
823+ token: "string.other.link.description.markdown",
821824 },
822825 {
823826 foreground: "82b1ff",
824− token: "punctuation.definition.string.markdown"
827+ token: "punctuation.definition.string.markdown",
825828 },
826829 {
827830 foreground: "82b1ff",
828− token: "punctuation.definition.string.begin.markdown"
831+ token: "punctuation.definition.string.begin.markdown",
829832 },
830833 {
831834 foreground: "82b1ff",
832− token: "punctuation.definition.string.end.markdown"
835+ token: "punctuation.definition.string.end.markdown",
833836 },
834837 {
835838 foreground: "82b1ff",
836− token: "meta.link.inline.markdown punctuation.definition.string"
839+ token: "meta.link.inline.markdown punctuation.definition.string",
837840 },
838841 {
839842 foreground: "7fdbca",
840− token: "punctuation.definition.metadata.markdown"
843+ token: "punctuation.definition.metadata.markdown",
841844 },
842845 {
843846 foreground: "82b1ff",
844− token: "beginning.punctuation.definition.list.markdown"
845− }
847+ token: "beginning.punctuation.definition.list.markdown",
848+ },
846849 ],
847850 colors: {
848851 "editor.foreground": "#d6deeb",
@@ -853,8 +856,8 @@ exports.nightOwlTheme = function (bg) { return ({
853856 "editorCursor.foreground": "#80a4c2",
854857 "editorWhitespace.foreground": "#2e2040",
855858 "editorIndentGuide.background": "#5e81ce52",
856− "editor.selectionHighlightBorder": "#122d42"
857− }
859+ "editor.selectionHighlightBorder": "#122d42",
860+ },
858861}); };
859862exports.purescriptSyntax = {
860863 displayName: "Purescript",
@@ -895,7 +898,7 @@ exports.purescriptSyntax = {
895898 "|",
896899 "foreign",
897900 "forall",
898− "∷"
901+ "∷",
899902 ],
900903 extraKeywords: [],
901904 typeKeywords: [],
@@ -909,11 +912,11 @@ exports.purescriptSyntax = {
909912 root: [
910913 [
911914 "((?:[A-Z]@idchars\\.)+)([a-z]@idchars)",
912− ["identifier.namespace", "identifier"]
915+ ["identifier.namespace", "identifier"],
913916 ],
914917 [
915918 "((?:[A-Z]@idchars\\.)+)([A-Z]@idchars)",
916− ["identifier.namespace", "constructor"]
919+ ["identifier.namespace", "constructor"],
917920 ],
918921 [
919922 "[a-z]@idchars(?!\\.)",
@@ -923,9 +926,9 @@ exports.purescriptSyntax = {
923926 "@typeStart": { token: "keyword", next: "@type_type" },
924927 "@keywords": "keyword",
925928 "@extraKeywords": "keyword",
926− "@default": "identifier"
927− }
928− }
929+ "@default": "identifier",
930+ },
931+ },
929932 ],
930933 ["[A-Z]@idchars", "type.identifier"],
931934 ["_@idchars", "identifier.wildcard"],
@@ -940,9 +943,9 @@ exports.purescriptSyntax = {
940943 cases: {
941944 "@keywords": "keyword.operator",
942945 "@extraKeywords": "keyword.operator",
943− "@default": "operator"
944− }
945− }
946+ "@default": "operator",
947+ },
948+ },
946949 ],
947950 ["[0-9]+\\.[0-9]+([eE][\\-+]?[0-9]+)?", "number.float"],
948951 ["0[xX][0-9a-fA-F]+", "number.hex"],
@@ -952,49 +955,49 @@ exports.purescriptSyntax = {
952955 ["'[^\\\\']'", "string"],
953956 ["(')(@escapes)(')", ["string", "string.escape", "string"]],
954957 ["'", "string.invalid"],
955− ["^[ ]*#.*", "namespace"]
958+ ["^[ ]*#.*", "namespace"],
956959 ],
957960 whitespace: [
958961 ["[ \\r\\n]+", ""],
959962 ["{-", "comment", "@comment"],
960− ["--.*$", "comment"]
963+ ["--.*$", "comment"],
961964 ],
962965 comment: [
963966 ["[^\\{\\-]+", "comment"],
964967 ["{-", "comment", "@push"],
965968 ["-}", "comment", "@pop"],
966− ["[\\{\\-]", "comment"]
969+ ["[\\{\\-]", "comment"],
967970 ],
968971 string: [
969972 ['[^\\\\"]+', "string"],
970973 ["@escapes", "string.escape"],
971974 ["\\\\.", "string.escape.invalid"],
972− ['"', { token: "string.quote", bracket: "@close", next: "@pop" }]
975+ ['"', { token: "string.quote", bracket: "@close", next: "@pop" }],
973976 ],
974977 type_type: [
975978 ["\\=", "keyword"],
976979 ["^\\s*(?!\\-\\-|\\{\\-)[^\\s]", { token: "@rematch", next: "@pop" }],
977− { include: "@type" }
980+ { include: "@type" },
978981 ],
979982 type_data: [
980983 ["([=|])(\\s*)([A-Z]@idchars)", ["keyword.operator", "", "constructor"]],
981984 ["^\\s*$", { token: "", next: "@pop" }],
982− { include: "@type" }
985+ { include: "@type" },
983986 ],
984987 type_line: [
985988 ["^\\s*(?!\\-\\-|\\{\\-)[_a-z]", { token: "@rematch", next: "@pop" }],
986989 ["[^=]*=", { token: "@rematch", next: "@pop" }],
987− { include: "@type" }
990+ { include: "@type" },
988991 ],
989992 type: [
990993 ["[(\\[]", { token: "@brackets.type" }, "@type_nested"],
991− { include: "@type_content" }
994+ { include: "@type_content" },
992995 ],
993996 type_nested: [
994997 ["[)\\]]", { token: "@brackets.type" }, "@pop"],
995998 ["[(\\[]", { token: "@brackets.type" }, "@push"],
996999 [",", "delimiter.type"],
997− { include: "@type_content" }
1000+ { include: "@type_content" },
9981001 ],
9991002 type_content: [
10001003 { include: "@whitespace" },
@@ -1002,7 +1005,7 @@ exports.purescriptSyntax = {
10021005 ["_@idchars", "type.identifier.typevar"],
10031006 [
10041007 "((?:[A-Z]@idchars\\.)*)([A-Z]@idchars)",
1005− ["type.identifier.namespace", "type.identifier"]
1008+ ["type.identifier.namespace", "type.identifier"],
10061009 ],
10071010 [
10081011 "((?:[A-Z]@idchars\\.)*)([a-z]@idchars)",
@@ -1010,12 +1013,12 @@ exports.purescriptSyntax = {
10101013 cases: {
10111014 "@typeKeywords": ["type.identifier.namespace", "type.keyword"],
10121015 "@keywords": { token: "@rematch", next: "@pop" },
1013− "@default": ["type.identifier.namespace", "type.identifier"]
1014− }
1015− }
1016+ "@default": ["type.identifier.namespace", "type.identifier"],
1017+ },
1018+ },
10161019 ],
10171020 ["::|->|[\\.:|]", "type.operator"],
1018− ["[\\s\\S]", "@rematch", "@pop"]
1019− ]
1020− }
1021+ ["[\\s\\S]", "@rematch", "@pop"],
1022+ ],
1023+ },
10211024};
components/src/Yoga/Monaco/Editor.purs+2
@@ -56,6 +56,8 @@ foreign import getValue ∷ Editor -> Effect String
5656
5757foreign import setValue ∷ String -> Editor -> Effect Unit
5858
59+foreign import colorizeImpl ∷ String -> String -> { tabSize ∷ Int } -> Editor -> Promise String
60+
5961foreign import data Monaco ∷ Type
6062
6163foreign import data Editor ∷ Type
components/src/Yoga/Monaco/Editor.ts+234−228
@@ -5,37 +5,42 @@ exports.monacoEditorImpl = async () => {
55 return x.default;
66};
77
8−exports.getValue = function(editor) {
9− return function() {
8+exports.getValue = function (editor) {
9+ return function () {
1010 return editor.getValue();
1111 };
1212};
1313
14−exports.setValue = (value: String) => editor => () => editor.setValue(value);
14+exports.colorizeImpl = (text: string) => (languageId: string) => (
15+ options: any
16+) => (editor: any): Promise<string> =>
17+ editor.colorize(text, languageId, options);
1518
16−exports.defineThemeImpl = monacoInstance => name => theme => () =>
19+exports.setValue = (value: string) => (editor) => () => editor.setValue(value);
20+
21+exports.defineThemeImpl = (monacoInstance) => (name) => (theme) => () =>
1722 monacoInstance.editor.defineTheme(name, theme);
1823
19−exports.setThemeImpl = function(monacoInstance) {
20− return function(theme) {
21− return function() {
24+exports.setThemeImpl = function (monacoInstance) {
25+ return function (theme) {
26+ return function () {
2227 return monacoInstance.editor.setTheme(theme);
2328 };
2429 };
2530};
2631
27−exports.registerLanguageImpl = function(monacoInstance) {
28− return function(languageId) {
29− return function() {
32+exports.registerLanguageImpl = function (monacoInstance) {
33+ return function (languageId) {
34+ return function () {
3035 monacoInstance.languages.register({ id: languageId });
3136 };
3237 };
3338};
3439
35−exports.setMonarchTokensProviderImpl = function(monacoInstance) {
36− return function(name) {
37− return function(monarchLanguage) {
38− return function() {
40+exports.setMonarchTokensProviderImpl = function (monacoInstance) {
41+ return function (name) {
42+ return function (monarchLanguage) {
43+ return function () {
3944 return monacoInstance.languages.setMonarchTokensProvider(
4045 name,
4146 monarchLanguage
@@ -45,90 +50,90 @@ exports.setMonarchTokensProviderImpl = function(monacoInstance) {
4550 };
4651};
4752
48−exports.vsCodeTheme = bg => ({
53+exports.vsCodeTheme = (bg) => ({
4954 base: "vs",
5055 inherit: true,
5156 rules: [
5257 {
5358 foreground: "008e00",
54− token: "comment"
59+ token: "comment",
5560 },
5661 {
5762 foreground: "7d4726",
58− token: "meta.preprocessor"
63+ token: "meta.preprocessor",
5964 },
6065 {
6166 foreground: "7d4726",
62− token: "keyword.control.import"
67+ token: "keyword.control.import",
6368 },
6469 {
6570 foreground: "df0002",
66− token: "string"
71+ token: "string",
6772 },
6873 {
6974 foreground: "3a00dc",
70− token: "constant.numeric"
75+ token: "constant.numeric",
7176 },
7277 {
7378 foreground: "c800a4",
74− token: "constant.language"
79+ token: "constant.language",
7580 },
7681 {
7782 foreground: "275a5e",
78− token: "constant.character"
83+ token: "constant.character",
7984 },
8085 {
8186 foreground: "275a5e",
82− token: "constant.other"
87+ token: "constant.other",
8388 },
8489 {
8590 foreground: "c800a4",
86− token: "variable.language"
91+ token: "variable.language",
8792 },
8893 {
8994 foreground: "c800a4",
90− token: "variable.other"
95+ token: "variable.other",
9196 },
9297 {
9398 foreground: "c800a4",
94− token: "keyword"
99+ token: "keyword",
95100 },
96101 {
97102 foreground: "c900a4",
98− token: "storage"
103+ token: "storage",
99104 },
100105 {
101106 foreground: "438288",
102− token: "entity.name.class"
107+ token: "entity.name.class",
103108 },
104109 {
105110 foreground: "790ead",
106− token: "entity.name.tag"
111+ token: "entity.name.tag",
107112 },
108113 {
109114 foreground: "450084",
110− token: "entity.other.attribute-name"
115+ token: "entity.other.attribute-name",
111116 },
112117 {
113118 foreground: "450084",
114− token: "support.function"
119+ token: "support.function",
115120 },
116121 {
117122 foreground: "450084",
118− token: "support.constant"
123+ token: "support.constant",
119124 },
120125 {
121126 foreground: "790ead",
122− token: "support.type"
127+ token: "support.type",
123128 },
124129 {
125130 foreground: "790ead",
126− token: "support.class"
131+ token: "support.class",
127132 },
128133 {
129134 foreground: "790ead",
130− token: "support.other.variable"
131− }
135+ token: "support.other.variable",
136+ },
132137 ],
133138 colors: {
134139 "editor.foreground": "#000000",
@@ -136,675 +141,676 @@ exports.vsCodeTheme = bg => ({
136141 "editor.selectionBackground": "#B5D5FF",
137142 "editor.lineHighlightBackground": "#00000012",
138143 "editorCursor.foreground": "#000000",
139− "editorWhitespace.foreground": "#BFBFBF"
140− }
144+ "editorWhitespace.foreground": "#BFBFBF",
145+ },
141146});
142147
143−exports.nightOwlTheme = bg => ({
148+exports.nightOwlTheme = (bg) => ({
144149 base: "vs-dark",
145150 inherit: true,
146151 rules: [
147152 {
148153 foreground: "637777",
149− token: "comment"
154+ token: "comment",
150155 },
151156 {
152157 foreground: "addb67",
153− token: "string"
158+ token: "string",
154159 },
155160 {
156161 foreground: "ecc48d",
157− token: "vstring.quoted"
162+ token: "vstring.quoted",
158163 },
159164 {
160165 foreground: "ecc48d",
161− token: "variable.other.readwrite.js"
166+ token: "variable.other.readwrite.js",
162167 },
163168 {
164169 foreground: "5ca7e4",
165− token: "string.regexp"
170+ token: "string.regexp",
166171 },
167172 {
168173 foreground: "5ca7e4",
169− token: "string.regexp keyword.other"
174+ token: "string.regexp keyword.other",
170175 },
171176 {
172177 foreground: "5f7e97",
173− token: "meta.function punctuation.separator.comma"
178+ token: "meta.function punctuation.separator.comma",
174179 },
175180 {
176181 foreground: "f78c6c",
177− token: "constant.numeric"
182+ token: "constant.numeric",
178183 },
179184 {
180185 foreground: "f78c6c",
181− token: "constant.character.numeric"
186+ token: "constant.character.numeric",
182187 },
183188 {
184189 foreground: "addb67",
185− token: "variable"
190+ token: "variable",
186191 },
187192 {
188193 foreground: "c792ea",
189− token: "keyword"
194+ token: "keyword",
190195 },
191196 {
192197 foreground: "c792ea",
193− token: "punctuation.accessor"
198+ token: "punctuation.accessor",
194199 },
195200 {
196201 foreground: "c792ea",
197− token: "storage"
202+ token: "storage",
198203 },
199204 {
200205 foreground: "c792ea",
201− token: "meta.var.expr"
206+ token: "meta.var.expr",
202207 },
203208 {
204209 foreground: "c792ea",
205− token: "meta.class meta.method.declaration meta.var.expr storage.type.jsm"
210+ token:
211+ "meta.class meta.method.declaration meta.var.expr storage.type.jsm",
206212 },
207213 {
208214 foreground: "c792ea",
209− token: "storage.type.property.js"
215+ token: "storage.type.property.js",
210216 },
211217 {
212218 foreground: "c792ea",
213− token: "storage.type.property.ts"
219+ token: "storage.type.property.ts",
214220 },
215221 {
216222 foreground: "c792ea",
217− token: "storage.type.property.tsx"
223+ token: "storage.type.property.tsx",
218224 },
219225 {
220226 foreground: "82aaff",
221− token: "storage.type"
227+ token: "storage.type",
222228 },
223229 {
224230 foreground: "ffcb8b",
225− token: "entity.name.class"
231+ token: "entity.name.class",
226232 },
227233 {
228234 foreground: "ffcb8b",
229− token: "meta.class entity.name.type.class"
235+ token: "meta.class entity.name.type.class",
230236 },
231237 {
232238 foreground: "addb67",
233− token: "entity.other.inherited-class"
239+ token: "entity.other.inherited-class",
234240 },
235241 {
236242 foreground: "82aaff",
237− token: "entity.name.function"
243+ token: "entity.name.function",
238244 },
239245 {
240246 foreground: "addb67",
241− token: "punctuation.definition.variable"
247+ token: "punctuation.definition.variable",
242248 },
243249 {
244250 foreground: "d3423e",
245− token: "punctuation.section.embedded"
251+ token: "punctuation.section.embedded",
246252 },
247253 {
248254 foreground: "d6deeb",
249− token: "punctuation.terminator.expression"
255+ token: "punctuation.terminator.expression",
250256 },
251257 {
252258 foreground: "d6deeb",
253− token: "punctuation.definition.arguments"
259+ token: "punctuation.definition.arguments",
254260 },
255261 {
256262 foreground: "d6deeb",
257− token: "punctuation.definition.array"
263+ token: "punctuation.definition.array",
258264 },
259265 {
260266 foreground: "d6deeb",
261− token: "punctuation.section.array"
267+ token: "punctuation.section.array",
262268 },
263269 {
264270 foreground: "d6deeb",
265− token: "meta.array"
271+ token: "meta.array",
266272 },
267273 {
268274 foreground: "d9f5dd",
269− token: "punctuation.definition.list.begin"
275+ token: "punctuation.definition.list.begin",
270276 },
271277 {
272278 foreground: "d9f5dd",
273− token: "punctuation.definition.list.end"
279+ token: "punctuation.definition.list.end",
274280 },
275281 {
276282 foreground: "d9f5dd",
277− token: "punctuation.separator.arguments"
283+ token: "punctuation.separator.arguments",
278284 },
279285 {
280286 foreground: "d9f5dd",
281− token: "punctuation.definition.list"
287+ token: "punctuation.definition.list",
282288 },
283289 {
284290 foreground: "d3423e",
285− token: "string.template meta.template.expression"
291+ token: "string.template meta.template.expression",
286292 },
287293 {
288294 foreground: "d6deeb",
289− token: "string.template punctuation.definition.string"
295+ token: "string.template punctuation.definition.string",
290296 },
291297 {
292298 foreground: "c792ea",
293299 fontStyle: "italic",
294− token: "italic"
300+ token: "italic",
295301 },
296302 {
297303 foreground: "addb67",
298304 fontStyle: "bold",
299− token: "bold"
305+ token: "bold",
300306 },
301307 {
302308 foreground: "82aaff",
303− token: "constant.language"
309+ token: "constant.language",
304310 },
305311 {
306312 foreground: "82aaff",
307− token: "punctuation.definition.constant"
313+ token: "punctuation.definition.constant",
308314 },
309315 {
310316 foreground: "82aaff",
311− token: "variable.other.constant"
317+ token: "variable.other.constant",
312318 },
313319 {
314320 foreground: "7fdbca",
315− token: "support.function.construct"
321+ token: "support.function.construct",
316322 },
317323 {
318324 foreground: "7fdbca",
319− token: "keyword.other.new"
325+ token: "keyword.other.new",
320326 },
321327 {
322328 foreground: "82aaff",
323− token: "constant.character"
329+ token: "constant.character",
324330 },
325331 {
326332 foreground: "82aaff",
327− token: "constant.other"
333+ token: "constant.other",
328334 },
329335 {
330336 foreground: "f78c6c",
331− token: "constant.character.escape"
337+ token: "constant.character.escape",
332338 },
333339 {
334340 foreground: "addb67",
335− token: "entity.other.inherited-class"
341+ token: "entity.other.inherited-class",
336342 },
337343 {
338344 foreground: "d7dbe0",
339− token: "variable.parameter"
345+ token: "variable.parameter",
340346 },
341347 {
342348 foreground: "7fdbca",
343− token: "entity.name.tag"
349+ token: "entity.name.tag",
344350 },
345351 {
346352 foreground: "cc2996",
347− token: "punctuation.definition.tag.html"
353+ token: "punctuation.definition.tag.html",
348354 },
349355 {
350356 foreground: "cc2996",
351− token: "punctuation.definition.tag.begin"
357+ token: "punctuation.definition.tag.begin",
352358 },
353359 {
354360 foreground: "cc2996",
355− token: "punctuation.definition.tag.end"
361+ token: "punctuation.definition.tag.end",
356362 },
357363 {
358364 foreground: "addb67",
359− token: "entity.other.attribute-name"
365+ token: "entity.other.attribute-name",
360366 },
361367 {
362368 foreground: "addb67",
363− token: "entity.name.tag.custom"
369+ token: "entity.name.tag.custom",
364370 },
365371 {
366372 foreground: "82aaff",
367− token: "support.function"
373+ token: "support.function",
368374 },
369375 {
370376 foreground: "82aaff",
371− token: "support.constant"
377+ token: "support.constant",
372378 },
373379 {
374380 foreground: "7fdbca",
375− token: "upport.constant.meta.property-value"
381+ token: "upport.constant.meta.property-value",
376382 },
377383 {
378384 foreground: "addb67",
379− token: "support.type"
385+ token: "support.type",
380386 },
381387 {
382388 foreground: "addb67",
383− token: "support.class"
389+ token: "support.class",
384390 },
385391 {
386392 foreground: "addb67",
387− token: "support.variable.dom"
393+ token: "support.variable.dom",
388394 },
389395 {
390396 foreground: "7fdbca",
391− token: "support.constant"
397+ token: "support.constant",
392398 },
393399 {
394400 foreground: "7fdbca",
395− token: "keyword.other.special-method"
401+ token: "keyword.other.special-method",
396402 },
397403 {
398404 foreground: "7fdbca",
399− token: "keyword.other.new"
405+ token: "keyword.other.new",
400406 },
401407 {
402408 foreground: "7fdbca",
403− token: "keyword.other.debugger"
409+ token: "keyword.other.debugger",
404410 },
405411 {
406412 foreground: "7fdbca",
407− token: "keyword.control"
413+ token: "keyword.control",
408414 },
409415 {
410416 foreground: "c792ea",
411− token: "keyword.operator.comparison"
417+ token: "keyword.operator.comparison",
412418 },
413419 {
414420 foreground: "c792ea",
415− token: "keyword.control.flow.js"
421+ token: "keyword.control.flow.js",
416422 },
417423 {
418424 foreground: "c792ea",
419− token: "keyword.control.flow.ts"
425+ token: "keyword.control.flow.ts",
420426 },
421427 {
422428 foreground: "c792ea",
423− token: "keyword.control.flow.tsx"
429+ token: "keyword.control.flow.tsx",
424430 },
425431 {
426432 foreground: "c792ea",
427− token: "keyword.control.ruby"
433+ token: "keyword.control.ruby",
428434 },
429435 {
430436 foreground: "c792ea",
431− token: "keyword.control.module.ruby"
437+ token: "keyword.control.module.ruby",
432438 },
433439 {
434440 foreground: "c792ea",
435− token: "keyword.control.class.ruby"
441+ token: "keyword.control.class.ruby",
436442 },
437443 {
438444 foreground: "c792ea",
439− token: "keyword.control.def.ruby"
445+ token: "keyword.control.def.ruby",
440446 },
441447 {
442448 foreground: "c792ea",
443− token: "keyword.control.loop.js"
449+ token: "keyword.control.loop.js",
444450 },
445451 {
446452 foreground: "c792ea",
447− token: "keyword.control.loop.ts"
453+ token: "keyword.control.loop.ts",
448454 },
449455 {
450456 foreground: "c792ea",
451− token: "keyword.control.import.js"
457+ token: "keyword.control.import.js",
452458 },
453459 {
454460 foreground: "c792ea",
455− token: "keyword.control.import.ts"
461+ token: "keyword.control.import.ts",
456462 },
457463 {
458464 foreground: "c792ea",
459− token: "keyword.control.import.tsx"
465+ token: "keyword.control.import.tsx",
460466 },
461467 {
462468 foreground: "c792ea",
463− token: "keyword.control.from.js"
469+ token: "keyword.control.from.js",
464470 },
465471 {
466472 foreground: "c792ea",
467− token: "keyword.control.from.ts"
473+ token: "keyword.control.from.ts",
468474 },
469475 {
470476 foreground: "c792ea",
471− token: "keyword.control.from.tsx"
477+ token: "keyword.control.from.tsx",
472478 },
473479 {
474480 foreground: "ffffff",
475481 background: "ff2c83",
476− token: "invalid"
482+ token: "invalid",
477483 },
478484 {
479485 foreground: "ffffff",
480486 background: "d3423e",
481− token: "invalid.deprecated"
487+ token: "invalid.deprecated",
482488 },
483489 {
484490 foreground: "7fdbca",
485− token: "keyword.operator"
491+ token: "keyword.operator",
486492 },
487493 {
488494 foreground: "c792ea",
489− token: "keyword.operator.relational"
495+ token: "keyword.operator.relational",
490496 },
491497 {
492498 foreground: "c792ea",
493− token: "keyword.operator.assignement"
499+ token: "keyword.operator.assignement",
494500 },
495501 {
496502 foreground: "c792ea",
497− token: "keyword.operator.arithmetic"
503+ token: "keyword.operator.arithmetic",
498504 },
499505 {
500506 foreground: "c792ea",
501− token: "keyword.operator.bitwise"
507+ token: "keyword.operator.bitwise",
502508 },
503509 {
504510 foreground: "c792ea",
505− token: "keyword.operator.increment"
511+ token: "keyword.operator.increment",
506512 },
507513 {
508514 foreground: "c792ea",
509− token: "keyword.operator.ternary"
515+ token: "keyword.operator.ternary",
510516 },
511517 {
512518 foreground: "637777",
513− token: "comment.line.double-slash"
519+ token: "comment.line.double-slash",
514520 },
515521 {
516522 foreground: "cdebf7",
517− token: "object"
523+ token: "object",
518524 },
519525 {
520526 foreground: "ff5874",
521− token: "constant.language.null"
527+ token: "constant.language.null",
522528 },
523529 {
524530 foreground: "d6deeb",
525− token: "meta.brace"
531+ token: "meta.brace",
526532 },
527533 {
528534 foreground: "c792ea",
529− token: "meta.delimiter.period"
535+ token: "meta.delimiter.period",
530536 },
531537 {
532538 foreground: "d9f5dd",
533− token: "punctuation.definition.string"
539+ token: "punctuation.definition.string",
534540 },
535541 {
536542 foreground: "ff5874",
537− token: "constant.language.boolean"
543+ token: "constant.language.boolean",
538544 },
539545 {
540546 foreground: "ffffff",
541− token: "object.comma"
547+ token: "object.comma",
542548 },
543549 {
544550 foreground: "7fdbca",
545− token: "variable.parameter.function"
551+ token: "variable.parameter.function",
546552 },
547553 {
548554 foreground: "80cbc4",
549− token: "support.type.vendor.property-name"
555+ token: "support.type.vendor.property-name",
550556 },
551557 {
552558 foreground: "80cbc4",
553− token: "support.constant.vendor.property-value"
559+ token: "support.constant.vendor.property-value",
554560 },
555561 {
556562 foreground: "80cbc4",
557− token: "support.type.property-name"
563+ token: "support.type.property-name",
558564 },
559565 {
560566 foreground: "80cbc4",
561− token: "meta.property-list entity.name.tag"
567+ token: "meta.property-list entity.name.tag",
562568 },
563569 {
564570 foreground: "57eaf1",
565− token: "meta.property-list entity.name.tag.reference"
571+ token: "meta.property-list entity.name.tag.reference",
566572 },
567573 {
568574 foreground: "f78c6c",
569− token: "constant.other.color.rgb-value punctuation.definition.constant"
575+ token: "constant.other.color.rgb-value punctuation.definition.constant",
570576 },
571577 {
572578 foreground: "ffeb95",
573− token: "constant.other.color"
579+ token: "constant.other.color",
574580 },
575581 {
576582 foreground: "ffeb95",
577− token: "keyword.other.unit"
583+ token: "keyword.other.unit",
578584 },
579585 {
580586 foreground: "c792ea",
581− token: "meta.selector"
587+ token: "meta.selector",
582588 },
583589 {
584590 foreground: "fad430",
585− token: "entity.other.attribute-name.id"
591+ token: "entity.other.attribute-name.id",
586592 },
587593 {
588594 foreground: "80cbc4",
589− token: "meta.property-name"
595+ token: "meta.property-name",
590596 },
591597 {
592598 foreground: "c792ea",
593− token: "entity.name.tag.doctype"
599+ token: "entity.name.tag.doctype",
594600 },
595601 {
596602 foreground: "c792ea",
597− token: "meta.tag.sgml.doctype"
603+ token: "meta.tag.sgml.doctype",
598604 },
599605 {
600606 foreground: "d9f5dd",
601− token: "punctuation.definition.parameters"
607+ token: "punctuation.definition.parameters",
602608 },
603609 {
604610 foreground: "ecc48d",
605− token: "string.quoted"
611+ token: "string.quoted",
606612 },
607613 {
608614 foreground: "ecc48d",
609− token: "string.quoted.double"
615+ token: "string.quoted.double",
610616 },
611617 {
612618 foreground: "ecc48d",
613− token: "string.quoted.single"
619+ token: "string.quoted.single",
614620 },
615621 {
616622 foreground: "addb67",
617− token: "support.constant.math"
623+ token: "support.constant.math",
618624 },
619625 {
620626 foreground: "addb67",
621− token: "support.type.property-name.json"
627+ token: "support.type.property-name.json",
622628 },
623629 {
624630 foreground: "addb67",
625− token: "support.constant.json"
631+ token: "support.constant.json",
626632 },
627633 {
628634 foreground: "c789d6",
629− token: "meta.structure.dictionary.value.json string.quoted.double"
635+ token: "meta.structure.dictionary.value.json string.quoted.double",
630636 },
631637 {
632638 foreground: "80cbc4",
633− token: "string.quoted.double.json punctuation.definition.string.json"
639+ token: "string.quoted.double.json punctuation.definition.string.json",
634640 },
635641 {
636642 foreground: "ff5874",
637643 token:
638− "meta.structure.dictionary.json meta.structure.dictionary.value constant.language"
644+ "meta.structure.dictionary.json meta.structure.dictionary.value constant.language",
639645 },
640646 {
641647 foreground: "d6deeb",
642− token: "variable.other.ruby"
648+ token: "variable.other.ruby",
643649 },
644650 {
645651 foreground: "ecc48d",
646− token: "entity.name.type.class.ruby"
652+ token: "entity.name.type.class.ruby",
647653 },
648654 {
649655 foreground: "ecc48d",
650− token: "keyword.control.class.ruby"
656+ token: "keyword.control.class.ruby",
651657 },
652658 {
653659 foreground: "ecc48d",
654− token: "meta.class.ruby"
660+ token: "meta.class.ruby",
655661 },
656662 {
657663 foreground: "7fdbca",
658− token: "constant.language.symbol.hashkey.ruby"
664+ token: "constant.language.symbol.hashkey.ruby",
659665 },
660666 {
661667 foreground: "e0eddd",
662668 background: "a57706",
663669 fontStyle: "italic",
664− token: "meta.diff"
670+ token: "meta.diff",
665671 },
666672 {
667673 foreground: "e0eddd",
668674 background: "a57706",
669675 fontStyle: "italic",
670− token: "meta.diff.header"
676+ token: "meta.diff.header",
671677 },
672678 {
673679 foreground: "ef535090",
674680 fontStyle: "italic",
675− token: "markup.deleted"
681+ token: "markup.deleted",
676682 },
677683 {
678684 foreground: "a2bffc",
679685 fontStyle: "italic",
680− token: "markup.changed"
686+ token: "markup.changed",
681687 },
682688 {
683689 foreground: "a2bffc",
684690 fontStyle: "italic",
685− token: "meta.diff.header.git"
691+ token: "meta.diff.header.git",
686692 },
687693 {
688694 foreground: "a2bffc",
689695 fontStyle: "italic",
690− token: "meta.diff.header.from-file"
696+ token: "meta.diff.header.from-file",
691697 },
692698 {
693699 foreground: "a2bffc",
694700 fontStyle: "italic",
695− token: "meta.diff.header.to-file"
701+ token: "meta.diff.header.to-file",
696702 },
697703 {
698704 foreground: "219186",
699705 background: "eae3ca",
700− token: "markup.inserted"
706+ token: "markup.inserted",
701707 },
702708 {
703709 foreground: "d3201f",
704− token: "other.package.exclude"
710+ token: "other.package.exclude",
705711 },
706712 {
707713 foreground: "d3201f",
708− token: "other.remove"
714+ token: "other.remove",
709715 },
710716 {
711717 foreground: "269186",
712− token: "other.add"
718+ token: "other.add",
713719 },
714720 {
715721 foreground: "ff5874",
716− token: "constant.language.python"
722+ token: "constant.language.python",
717723 },
718724 {
719725 foreground: "82aaff",
720− token: "variable.parameter.function.python"
726+ token: "variable.parameter.function.python",
721727 },
722728 {
723729 foreground: "82aaff",
724− token: "meta.function-call.arguments.python"
730+ token: "meta.function-call.arguments.python",
725731 },
726732 {
727733 foreground: "b2ccd6",
728− token: "meta.function-call.python"
734+ token: "meta.function-call.python",
729735 },
730736 {
731737 foreground: "b2ccd6",
732− token: "meta.function-call.generic.python"
738+ token: "meta.function-call.generic.python",
733739 },
734740 {
735741 foreground: "d6deeb",
736− token: "punctuation.python"
742+ token: "punctuation.python",
737743 },
738744 {
739745 foreground: "addb67",
740− token: "entity.name.function.decorator.python"
746+ token: "entity.name.function.decorator.python",
741747 },
742748 {
743749 foreground: "8eace3",
744− token: "source.python variable.language.special"
750+ token: "source.python variable.language.special",
745751 },
746752 {
747753 foreground: "82b1ff",
748− token: "markup.heading.markdown"
754+ token: "markup.heading.markdown",
749755 },
750756 {
751757 foreground: "c792ea",
752758 fontStyle: "italic",
753− token: "markup.italic.markdown"
759+ token: "markup.italic.markdown",
754760 },
755761 {
756762 foreground: "addb67",
757763 fontStyle: "bold",
758− token: "markup.bold.markdown"
764+ token: "markup.bold.markdown",
759765 },
760766 {
761767 foreground: "697098",
762− token: "markup.quote.markdown"
768+ token: "markup.quote.markdown",
763769 },
764770 {
765771 foreground: "80cbc4",
766− token: "markup.inline.raw.markdown"
772+ token: "markup.inline.raw.markdown",
767773 },
768774 {
769775 foreground: "ff869a",
770− token: "markup.underline.link.markdown"
776+ token: "markup.underline.link.markdown",
771777 },
772778 {
773779 foreground: "ff869a",
774− token: "markup.underline.link.image.markdown"
780+ token: "markup.underline.link.image.markdown",
775781 },
776782 {
777783 foreground: "d6deeb",
778− token: "string.other.link.title.markdown"
784+ token: "string.other.link.title.markdown",
779785 },
780786 {
781787 foreground: "d6deeb",
782− token: "string.other.link.description.markdown"
788+ token: "string.other.link.description.markdown",
783789 },
784790 {
785791 foreground: "82b1ff",
786− token: "punctuation.definition.string.markdown"
792+ token: "punctuation.definition.string.markdown",
787793 },
788794 {
789795 foreground: "82b1ff",
790− token: "punctuation.definition.string.begin.markdown"
796+ token: "punctuation.definition.string.begin.markdown",
791797 },
792798 {
793799 foreground: "82b1ff",
794− token: "punctuation.definition.string.end.markdown"
800+ token: "punctuation.definition.string.end.markdown",
795801 },
796802 {
797803 foreground: "82b1ff",
798− token: "meta.link.inline.markdown punctuation.definition.string"
804+ token: "meta.link.inline.markdown punctuation.definition.string",
799805 },
800806 {
801807 foreground: "7fdbca",
802− token: "punctuation.definition.metadata.markdown"
808+ token: "punctuation.definition.metadata.markdown",
803809 },
804810 {
805811 foreground: "82b1ff",
806− token: "beginning.punctuation.definition.list.markdown"
807− }
812+ token: "beginning.punctuation.definition.list.markdown",
813+ },
808814 ],
809815 colors: {
810816 "editor.foreground": "#d6deeb",
@@ -815,8 +821,8 @@ exports.nightOwlTheme = bg => ({
815821 "editorCursor.foreground": "#80a4c2",
816822 "editorWhitespace.foreground": "#2e2040",
817823 "editorIndentGuide.background": "#5e81ce52",
818− "editor.selectionHighlightBorder": "#122d42"
819− }
824+ "editor.selectionHighlightBorder": "#122d42",
825+ },
820826});
821827
822828exports.purescriptSyntax = {
@@ -861,7 +867,7 @@ exports.purescriptSyntax = {
861867 "|",
862868 "foreign",
863869 "forall",
864− "∷"
870+ "∷",
865871 ],
866872
867873 extraKeywords: [],
@@ -882,11 +888,11 @@ exports.purescriptSyntax = {
882888 root: [
883889 [
884890 "((?:[A-Z]@idchars\\.)+)([a-z]@idchars)",
885− ["identifier.namespace", "identifier"]
891+ ["identifier.namespace", "identifier"],
886892 ],
887893 [
888894 "((?:[A-Z]@idchars\\.)+)([A-Z]@idchars)",
889− ["identifier.namespace", "constructor"]
895+ ["identifier.namespace", "constructor"],
890896 ],
891897
892898 [
@@ -897,9 +903,9 @@ exports.purescriptSyntax = {
897903 "@typeStart": { token: "keyword", next: "@type_type" },
898904 "@keywords": "keyword",
899905 "@extraKeywords": "keyword",
900− "@default": "identifier"
901− }
902− }
906+ "@default": "identifier",
907+ },
908+ },
903909 ],
904910
905911 ["[A-Z]@idchars", "type.identifier"],
@@ -920,9 +926,9 @@ exports.purescriptSyntax = {
920926 cases: {
921927 "@keywords": "keyword.operator",
922928 "@extraKeywords": "keyword.operator",
923− "@default": "operator"
924− }
925− }
929+ "@default": "operator",
930+ },
931+ },
926932 ],
927933
928934 ["[0-9]+\\.[0-9]+([eE][\\-+]?[0-9]+)?", "number.float"],
@@ -936,57 +942,57 @@ exports.purescriptSyntax = {
936942 ["(')(@escapes)(')", ["string", "string.escape", "string"]],
937943 ["'", "string.invalid"],
938944
939− ["^[ ]*#.*", "namespace"]
945+ ["^[ ]*#.*", "namespace"],
940946 ],
941947
942948 whitespace: [
943949 ["[ \\r\\n]+", ""],
944950 ["{-", "comment", "@comment"],
945− ["--.*$", "comment"]
951+ ["--.*$", "comment"],
946952 ],
947953
948954 comment: [
949955 ["[^\\{\\-]+", "comment"],
950956 ["{-", "comment", "@push"],
951957 ["-}", "comment", "@pop"],
952− ["[\\{\\-]", "comment"]
958+ ["[\\{\\-]", "comment"],
953959 ],
954960
955961 string: [
956962 ['[^\\\\"]+', "string"],
957963 ["@escapes", "string.escape"],
958964 ["\\\\.", "string.escape.invalid"],
959− ['"', { token: "string.quote", bracket: "@close", next: "@pop" }]
965+ ['"', { token: "string.quote", bracket: "@close", next: "@pop" }],
960966 ],
961967
962968 type_type: [
963969 ["\\=", "keyword"],
964970 ["^\\s*(?!\\-\\-|\\{\\-)[^\\s]", { token: "@rematch", next: "@pop" }],
965− { include: "@type" }
971+ { include: "@type" },
966972 ],
967973
968974 type_data: [
969975 ["([=|])(\\s*)([A-Z]@idchars)", ["keyword.operator", "", "constructor"]],
970976 ["^\\s*$", { token: "", next: "@pop" }],
971− { include: "@type" }
977+ { include: "@type" },
972978 ],
973979
974980 type_line: [
975981 ["^\\s*(?!\\-\\-|\\{\\-)[_a-z]", { token: "@rematch", next: "@pop" }],
976982 ["[^=]*=", { token: "@rematch", next: "@pop" }],
977− { include: "@type" }
983+ { include: "@type" },
978984 ],
979985
980986 type: [
981987 ["[(\\[]", { token: "@brackets.type" }, "@type_nested"],
982− { include: "@type_content" }
988+ { include: "@type_content" },
983989 ],
984990
985991 type_nested: [
986992 ["[)\\]]", { token: "@brackets.type" }, "@pop"],
987993 ["[(\\[]", { token: "@brackets.type" }, "@push"],
988994 [",", "delimiter.type"],
989− { include: "@type_content" }
995+ { include: "@type_content" },
990996 ],
991997
992998 type_content: [
@@ -997,7 +1003,7 @@ exports.purescriptSyntax = {
9971003
9981004 [
9991005 "((?:[A-Z]@idchars\\.)*)([A-Z]@idchars)",
1000− ["type.identifier.namespace", "type.identifier"]
1006+ ["type.identifier.namespace", "type.identifier"],
10011007 ],
10021008 [
10031009 "((?:[A-Z]@idchars\\.)*)([a-z]@idchars)",
@@ -1005,13 +1011,13 @@ exports.purescriptSyntax = {
10051011 cases: {
10061012 "@typeKeywords": ["type.identifier.namespace", "type.keyword"],
10071013 "@keywords": { token: "@rematch", next: "@pop" },
1008− "@default": ["type.identifier.namespace", "type.identifier"]
1009− }
1010− }
1014+ "@default": ["type.identifier.namespace", "type.identifier"],
1015+ },
1016+ },
10111017 ],
10121018
10131019 ["::|->|[\\.:|]", "type.operator"],
1014− ["[\\s\\S]", "@rematch", "@pop"]
1015− ]
1016− }
1020+ ["[\\s\\S]", "@rematch", "@pop"],
1021+ ],
1022+ },
10171023};
components/src/Yoga/Theme.purs+2−2
@@ -76,9 +76,9 @@ fromTheme theme =
7676 >>> RB.insert (f ∷ _ "highlightColourDark")
7777 (theme.highlightColour # darken 0.2 # desaturate 0.35)
7878 >>> RB.insert (f ∷ _ "highlightColourRotatedForwards")
79− (theme.highlightColour # rotateHue (20.0))
79+ (theme.highlightColour # rotateHue (30.0))
8080 >>> RB.insert (f ∷ _ "highlightColourRotatedBackwards")
81− (theme.highlightColour # rotateHue (-20.0))
81+ (theme.highlightColour # rotateHue (-30.0))
8282 -- altHighlight
8383
8484 >>> RB.insert (f ∷ _ "altHighlightColourDark")
components/src/Yoga/Theme/Default.purs+2−3
@@ -16,11 +16,10 @@ hex c = c # Color.fromHexString # fromMaybe' \_ -> unsafeCrashWith $ "Invalid he
1616
1717darkTheme ∷ Theme
1818darkTheme =
19− { backgroundColour: Color.hsl 228.0 0.12 0.20
19+ { backgroundColour: Color.hsl 238.0 0.12 0.20
2020 , textColour: Color.hsl 225.0 0.28 0.90
2121 , interfaceColour: Color.hsl 225.0 0.48 0.12
22− , highlightColour: Color.hsl 300.0 0.58 0.77
23− -- , highlightColour: Color.hsl 33.0 0.37 0.8
22+ , highlightColour: Color.hsl 265.0 0.58 0.77
2423 , altHighlightColour: Color.hsl 84.0 0.617 0.631
2524 , textFontFamily: cons' "Rubik" systemFontStack
2625 , headingFontFamily: cons' "Rubik" systemFontStack