packages feed

brick 0.37.1 → 0.37.2

raw patch · 3 files changed

+17/−5 lines, 3 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Brick.AttrMap: instance Data.Semigroup.Semigroup Brick.AttrMap.AttrName
- Brick.Themes: instance Data.Semigroup.Semigroup Brick.Themes.CustomAttr
- Brick.Widgets.List: instance (GHC.Show.Show n, GHC.Show.Show e) => GHC.Show.Show (Brick.Widgets.List.List n e)
- Data.Text.Markup: instance Data.Semigroup.Semigroup (Data.Text.Markup.Markup a)
+ Brick.AttrMap: instance GHC.Base.Semigroup Brick.AttrMap.AttrName
+ Brick.Themes: instance GHC.Base.Semigroup Brick.Themes.CustomAttr
+ Brick.Widgets.List: instance (GHC.Show.Show e, GHC.Show.Show n) => GHC.Show.Show (Brick.Widgets.List.List n e)
+ Data.Text.Markup: instance GHC.Base.Semigroup (Data.Text.Markup.Markup a)
- Brick.BorderMap: eBottomL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.BorderMap: eBottomL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.BorderMap: eLeftL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.BorderMap: eLeftL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.BorderMap: eRightL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.BorderMap: eRightL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.BorderMap: eTopL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.BorderMap: eTopL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.Forms: FormField :: n -> (b -> Maybe a) -> Bool -> (Bool -> b -> Widget n) -> (BrickEvent n e -> b -> EventM n b) -> FormField a b e n
+ Brick.Forms: FormField :: n -> b -> Maybe a -> Bool -> Bool -> b -> Widget n -> BrickEvent n e -> b -> EventM n b -> FormField a b e n
- Brick.Main: App :: (s -> [Widget n]) -> (s -> [CursorLocation n] -> Maybe (CursorLocation n)) -> (s -> BrickEvent n e -> EventM n (Next s)) -> (s -> EventM n s) -> (s -> AttrMap) -> App s e n
+ Brick.Main: App :: s -> [Widget n] -> s -> [CursorLocation n] -> Maybe (CursorLocation n) -> s -> BrickEvent n e -> EventM n (Next s) -> s -> EventM n s -> s -> AttrMap -> App s e n
- Brick.Types: bordersL :: forall n_aBPx. Lens' (Result n_aBPx) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_azTD. Lens' (Result n_azTD) (BorderMap DynBorder)
- Brick.Types: cursorLocationL :: forall n_aBdv. Lens' (CursorLocation n_aBdv) Location
+ Brick.Types: cursorLocationL :: forall n_azjA. Lens' (CursorLocation n_azjA) Location
- Brick.Types: cursorLocationNameL :: forall n_aBdv n_aCbs. Lens (CursorLocation n_aBdv) (CursorLocation n_aCbs) (Maybe n_aBdv) (Maybe n_aCbs)
+ Brick.Types: cursorLocationNameL :: forall n_azjA n_aAfa. Lens (CursorLocation n_azjA) (CursorLocation n_aAfa) (Maybe n_azjA) (Maybe n_aAfa)
- Brick.Types: cursorsL :: forall n_aBPx. Lens' (Result n_aBPx) [CursorLocation n_aBPx]
+ Brick.Types: cursorsL :: forall n_azTD. Lens' (Result n_azTD) [CursorLocation n_azTD]
- Brick.Types: eBottomL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.Types: eBottomL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.Types: eLeftL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.Types: eLeftL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.Types: eRightL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.Types: eRightL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.Types: eTopL :: forall a_aebT. Lens' (Edges a_aebT) a_aebT
+ Brick.Types: eTopL :: forall a_adTy. Lens' (Edges a_adTy) a_adTy
- Brick.Types: extentsL :: forall n_aBPx. Lens' (Result n_aBPx) [Extent n_aBPx]
+ Brick.Types: extentsL :: forall n_azTD. Lens' (Result n_azTD) [Extent n_azTD]
- Brick.Types: imageL :: forall n_aBPx. Lens' (Result n_aBPx) Image
+ Brick.Types: imageL :: forall n_azTD. Lens' (Result n_azTD) Image
- Brick.Types: visibilityRequestsL :: forall n_aBPx. Lens' (Result n_aBPx) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_azTD. Lens' (Result n_azTD) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a14B5 a_a14BL. Lens (Dialog a_a14B5) (Dialog a_a14BL) [(String, a_a14B5)] [(String, a_a14BL)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a11Lj a_a11M0. Lens (Dialog a_a11Lj) (Dialog a_a11M0) [(String, a_a11Lj)] [(String, a_a11M0)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a14B5. Lens' (Dialog a_a14B5) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a11Lj. Lens' (Dialog a_a11Lj) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a14B5. Lens' (Dialog a_a14B5) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a11Lj. Lens' (Dialog a_a11Lj) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a14B5. Lens' (Dialog a_a14B5) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a11Lj. Lens' (Dialog a_a11Lj) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a107F n_a107G t_a108n. Lens (Editor t_a107F n_a107G) (Editor t_a108n n_a107G) (TextZipper t_a107F) (TextZipper t_a108n)
+ Brick.Widgets.Edit: editContentsL :: forall t_aXok n_aXol t_aXp4. Lens (Editor t_aXok n_aXol) (Editor t_aXp4 n_aXol) (TextZipper t_aXok) (TextZipper t_aXp4)
- Brick.Widgets.List: listElementsL :: forall n_a19r0 e_a19r1 e_a19Bd. Lens (List n_a19r0 e_a19r1) (List n_a19r0 e_a19Bd) (Vector e_a19r1) (Vector e_a19Bd)
+ Brick.Widgets.List: listElementsL :: forall n_a16i5 e_a16i6 e_a16rN. Lens (List n_a16i5 e_a16i6) (List n_a16i5 e_a16rN) (Vector e_a16i6) (Vector e_a16rN)
- Brick.Widgets.List: listItemHeightL :: forall n_a19r0 e_a19r1. Lens' (List n_a19r0 e_a19r1) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a16i5 e_a16i6. Lens' (List n_a16i5 e_a16i6) Int
- Brick.Widgets.List: listNameL :: forall n_a19r0 e_a19r1 n_a19Be. Lens (List n_a19r0 e_a19r1) (List n_a19Be e_a19r1) n_a19r0 n_a19Be
+ Brick.Widgets.List: listNameL :: forall n_a16i5 e_a16i6 n_a16rO. Lens (List n_a16i5 e_a16i6) (List n_a16rO e_a16i6) n_a16i5 n_a16rO
- Brick.Widgets.List: listSelectedL :: forall n_a19r0 e_a19r1. Lens' (List n_a19r0 e_a19r1) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a16i5 e_a16i6. Lens' (List n_a16i5 e_a16i6) (Maybe Int)

Files

CHANGELOG.md view
@@ -2,6 +2,13 @@ Brick changelog --------------- +0.37.2+------++Bug fixes:+ * Theme customization files can now use empty lists for style+   customization.+ 0.37.1 ------ 
brick.cabal view
@@ -1,5 +1,5 @@ name:                brick-version:             0.37.1+version:             0.37.2 synopsis:            A declarative terminal user interface library description:   Write terminal applications painlessly with 'brick'! You write an
src/Brick/Themes.hs view
@@ -235,8 +235,9 @@  parseStyle :: T.Text -> Either String Style parseStyle s =-    let lookupStyle n = case lookup n normalizedStyles of-            Just sty -> Right sty+    let lookupStyle "" = Right Nothing+        lookupStyle n = case lookup n normalizedStyles of+            Just sty -> Right $ Just sty             Nothing  -> Left $ T.unpack $ "Invalid style: " <> n         stripped = T.strip $ T.toLower s         normalize (n, a) = (T.toLower n, a)@@ -246,11 +247,15 @@         unbracketed = T.tail $ T.init stripped         parseStyleList = do             ss <- mapM lookupStyle $ T.strip <$> T.splitOn "," unbracketed-            return $ foldr (.|.) 0 ss+            return $ foldr (.|.) 0 $ catMaybes ss      in if bracketed        then parseStyleList-       else lookupStyle stripped+       else do+           result <- lookupStyle stripped+           case result of+               Nothing -> Left $ "Invalid style: " <> show stripped+               Just sty -> Right sty  themeParser :: Theme -> IniParser (Maybe CustomAttr, M.Map AttrName CustomAttr) themeParser t = do