packages feed

brick 0.50.1 → 0.51

raw patch · 32 files changed

+139/−7 lines, 32 filesbinary-addedPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Brick.Focus: focusRingToList :: FocusRing n -> [n]
- Brick.BorderMap: eBottomL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.BorderMap: eBottomL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.BorderMap: eLeftL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.BorderMap: eLeftL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.BorderMap: eRightL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.BorderMap: eRightL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.BorderMap: eTopL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.BorderMap: eTopL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.Types: bordersL :: forall n_aGnz. Lens' (Result n_aGnz) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_aGvW. Lens' (Result n_aGvW) (BorderMap DynBorder)
- Brick.Types: cursorLocationL :: forall n_aF2a. Lens' (CursorLocation n_aF2a) Location
+ Brick.Types: cursorLocationL :: forall n_aFax. Lens' (CursorLocation n_aFax) Location
- Brick.Types: cursorLocationNameL :: forall n_aF2a n_aH0L. Lens (CursorLocation n_aF2a) (CursorLocation n_aH0L) (Maybe n_aF2a) (Maybe n_aH0L)
+ Brick.Types: cursorLocationNameL :: forall n_aFax n_aH98. Lens (CursorLocation n_aFax) (CursorLocation n_aH98) (Maybe n_aFax) (Maybe n_aH98)
- Brick.Types: cursorsL :: forall n_aGnz. Lens' (Result n_aGnz) [CursorLocation n_aGnz]
+ Brick.Types: cursorsL :: forall n_aGvW. Lens' (Result n_aGvW) [CursorLocation n_aGvW]
- Brick.Types: eBottomL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.Types: eBottomL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.Types: eLeftL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.Types: eLeftL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.Types: eRightL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.Types: eRightL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.Types: eTopL :: forall a_aj9v. Lens' (Edges a_aj9v) a_aj9v
+ Brick.Types: eTopL :: forall a_ajhG. Lens' (Edges a_ajhG) a_ajhG
- Brick.Types: extentsL :: forall n_aGnz. Lens' (Result n_aGnz) [Extent n_aGnz]
+ Brick.Types: extentsL :: forall n_aGvW. Lens' (Result n_aGvW) [Extent n_aGvW]
- Brick.Types: imageL :: forall n_aGnz. Lens' (Result n_aGnz) Image
+ Brick.Types: imageL :: forall n_aGvW. Lens' (Result n_aGvW) Image
- Brick.Types: visibilityRequestsL :: forall n_aGnz. Lens' (Result n_aGnz) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_aGvW. Lens' (Result n_aGvW) [VisibilityRequest]
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1gIb a_a1gIS. Lens (Dialog a_a1gIb) (Dialog a_a1gIS) [(String, a_a1gIb)] [(String, a_a1gIS)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1gQy a_a1gRf. Lens (Dialog a_a1gQy) (Dialog a_a1gRf) [(String, a_a1gQy)] [(String, a_a1gRf)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1gIb. Lens' (Dialog a_a1gIb) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1gQy. Lens' (Dialog a_a1gQy) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1gIb. Lens' (Dialog a_a1gIb) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1gQy. Lens' (Dialog a_a1gQy) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1gIb. Lens' (Dialog a_a1gIb) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1gQy. Lens' (Dialog a_a1gQy) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a1bCE n_a1bCF t_a1bDo. Lens (Editor t_a1bCE n_a1bCF) (Editor t_a1bDo n_a1bCF) (TextZipper t_a1bCE) (TextZipper t_a1bDo)
+ Brick.Widgets.Edit: editContentsL :: forall t_a1bL1 n_a1bL2 t_a1bLL. Lens (Editor t_a1bL1 n_a1bL2) (Editor t_a1bLL n_a1bL2) (TextZipper t_a1bL1) (TextZipper t_a1bLL)
- Brick.Widgets.FileBrowser: fileBrowserEntryFilterL :: forall n_a1rbd. Lens' (FileBrowser n_a1rbd) (Maybe (FileInfo -> Bool))
+ Brick.Widgets.FileBrowser: fileBrowserEntryFilterL :: forall n_a1rjX. Lens' (FileBrowser n_a1rjX) (Maybe (FileInfo -> Bool))
- Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1rbd. Lens' (FileBrowser n_a1rbd) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1rjX. Lens' (FileBrowser n_a1rjX) (FileInfo -> Bool)
- Brick.Widgets.List: listElementsL :: forall n_a1lOz t_a1lOA e_a1lOB t_a1m39 e_a1m3a. Lens (GenericList n_a1lOz t_a1lOA e_a1lOB) (GenericList n_a1lOz t_a1m39 e_a1m3a) (t_a1lOA e_a1lOB) (t_a1m39 e_a1m3a)
+ Brick.Widgets.List: listElementsL :: forall n_a1lXj t_a1lXk e_a1lXl t_a1mbT e_a1mbU. Lens (GenericList n_a1lXj t_a1lXk e_a1lXl) (GenericList n_a1lXj t_a1mbT e_a1mbU) (t_a1lXk e_a1lXl) (t_a1mbT e_a1mbU)
- Brick.Widgets.List: listItemHeightL :: forall n_a1lOz t_a1lOA e_a1lOB. Lens' (GenericList n_a1lOz t_a1lOA e_a1lOB) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1lXj t_a1lXk e_a1lXl. Lens' (GenericList n_a1lXj t_a1lXk e_a1lXl) Int
- Brick.Widgets.List: listNameL :: forall n_a1lOz t_a1lOA e_a1lOB n_a1m3b. Lens (GenericList n_a1lOz t_a1lOA e_a1lOB) (GenericList n_a1m3b t_a1lOA e_a1lOB) n_a1lOz n_a1m3b
+ Brick.Widgets.List: listNameL :: forall n_a1lXj t_a1lXk e_a1lXl n_a1mbV. Lens (GenericList n_a1lXj t_a1lXk e_a1lXl) (GenericList n_a1mbV t_a1lXk e_a1lXl) n_a1lXj n_a1mbV
- Brick.Widgets.List: listSelectedL :: forall n_a1lOz t_a1lOA e_a1lOB. Lens' (GenericList n_a1lOz t_a1lOA e_a1lOB) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1lXj t_a1lXk e_a1lXl. Lens' (GenericList n_a1lXj t_a1lXk e_a1lXl) (Maybe Int)

Files

CHANGELOG.md view
@@ -2,6 +2,21 @@ Brick changelog --------------- +0.51+----++API changes:+ * Added Brick.Focus.focusRingToList, which returns all of the elements+   in a focus ring as a list, starting with the focused entry and+   wrapping around (#257; thanks @4eUeP)++Bug fixes:+ * Fix Brick.Widgets.FileBrowser.fileExtensionMatch to match directories+   and also match symlinks that link to directories (thanks @YVee1)++Other changes:+ * Added demonstration program screenshot gallery (thanks @drola)+ 0.50.1 ------ 
README.md view
@@ -94,7 +94,7 @@ * [The official brick user guide](https://github.com/jtdaugherty/brick/blob/master/docs/guide.rst) * [Samuel Tay's brick tutorial](https://github.com/jtdaugherty/brick/blob/master/docs/samtay-tutorial.md) * Haddock (all modules)-* [Demo programs](https://github.com/jtdaugherty/brick/blob/master/programs)+* [Demo programs](https://github.com/jtdaugherty/brick/blob/master/programs) ([Screenshots](https://github.com/jtdaugherty/brick/blob/master/docs/programs-screenshots.md)) * [FAQ](https://github.com/jtdaugherty/brick/blob/master/FAQ.md)  Feature Overview
brick.cabal view
@@ -1,5 +1,5 @@ name:                brick-version:             0.50.1+version:             0.51 synopsis:            A declarative terminal user interface library description:   Write terminal applications painlessly with 'brick'! You write an@@ -43,7 +43,32 @@                      docs/guide.rst,                      docs/samtay-tutorial.md,                      docs/snake-demo.gif,-                     CHANGELOG.md+                     CHANGELOG.md,+                     docs/programs-screenshots.md,+                     docs/programs-screenshots/brick-attr-demo.png,+                     docs/programs-screenshots/brick-border-demo.png,+                     docs/programs-screenshots/brick-cache-demo.png,+                     docs/programs-screenshots/brick-custom-event-demo.png,+                     docs/programs-screenshots/brick-dialog-demo.png,+                     docs/programs-screenshots/brick-dynamic-border-demo.png,+                     docs/programs-screenshots/brick-edit-demo.png,+                     docs/programs-screenshots/brick-file-browser-demo.png,+                     docs/programs-screenshots/brick-fill-demo.png,+                     docs/programs-screenshots/brick-form-demo.png,+                     docs/programs-screenshots/brick-hello-world-demo.png,+                     docs/programs-screenshots/brick-layer-demo.png,+                     docs/programs-screenshots/brick-list-demo.png,+                     docs/programs-screenshots/brick-list-vi-demo.png,+                     docs/programs-screenshots/brick-markup-demo.png,+                     docs/programs-screenshots/brick-mouse-demo.png,+                     docs/programs-screenshots/brick-padding-demo.png,+                     docs/programs-screenshots/brick-progressbar-demo.png,+                     docs/programs-screenshots/brick-readme-demo.png,+                     docs/programs-screenshots/brick-suspend-resume-demo.png,+                     docs/programs-screenshots/brick-text-wrap-demo.png,+                     docs/programs-screenshots/brick-theme-demo.png,+                     docs/programs-screenshots/brick-viewport-scroll-demo.png,+                     docs/programs-screenshots/brick-visibility-demo.png  Source-Repository head   type:     git
+ docs/programs-screenshots.md view
@@ -0,0 +1,73 @@+# Demo program screenshots++## [AttrDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/AttrDemo.hs)+![attr demo](./programs-screenshots/brick-attr-demo.png)++## [BorderDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/BorderDemo.hs)+![border demo](./programs-screenshots/brick-border-demo.png)++## [CacheDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/CacheDemo.hs)+![cache demo](./programs-screenshots/brick-cache-demo.png)++## [CustomEventDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/CustomEventDemo.hs)+![custom-event demo](./programs-screenshots/brick-custom-event-demo.png)++## [DialogDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/DialogDemo.hs)+![dialog demo](./programs-screenshots/brick-dialog-demo.png)++## [DynamicBorderDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/DynamicBorderDemo.hs)+![dynamic-border demo](./programs-screenshots/brick-dynamic-border-demo.png)++## [EditDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/EditDemo.hs)+![edit demo](./programs-screenshots/brick-edit-demo.png)++## [FileBrowserDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/FileBrowserDemo.hs)+![file-browser demo](./programs-screenshots/brick-file-browser-demo.png)++## [FillDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/FillDemo.hs)+![fill demo](./programs-screenshots/brick-fill-demo.png)++## [FormDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/FormDemo.hs)+![form demo](./programs-screenshots/brick-form-demo.png)++## [HelloWorldDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/HelloWorldDemo.hs)+![hello-world demo](./programs-screenshots/brick-hello-world-demo.png)++## [LayerDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/LayerDemo.hs)+![layer demo](./programs-screenshots/brick-layer-demo.png)++## [ListDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/ListDemo.hs)+![list demo](./programs-screenshots/brick-list-demo.png)++## [ListViDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/ListViDemo.hs)+![list-vi demo](./programs-screenshots/brick-list-vi-demo.png)++## [MarkupDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/MarkupDemo.hs)+![markup demo](./programs-screenshots/brick-markup-demo.png)++## [MouseDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/MouseDemo.hs)+![mouse demo](./programs-screenshots/brick-mouse-demo.png)++## [PaddingDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/PaddingDemo.hs)+![padding demo](./programs-screenshots/brick-padding-demo.png)++## [ProgressBarDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/ProgressBarDemo.hs)+![progressbar demo](./programs-screenshots/brick-progressbar-demo.png)++## [ReadmeDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/ReadmeDemo.hs)+![readme demo](./programs-screenshots/brick-readme-demo.png)++## [SuspendAndResumeDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/SuspendAndResumeDemo.hs)+![suspend-resume demo](./programs-screenshots/brick-suspend-resume-demo.png)++## [TextWrapDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/TextWrapDemo.hs)+![text-wrap demo](./programs-screenshots/brick-text-wrap-demo.png)++## [ThemeDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/ThemeDemo.hs)+![theme demo](./programs-screenshots/brick-theme-demo.png)++## [ViewportScrollDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/ViewportScrollDemo.hs)+![viewport-scroll demo](./programs-screenshots/brick-viewport-scroll-demo.png)++## [VisibilityDemo.hs](https://github.com/jtdaugherty/brick/blob/master/programs/VisibilityDemo.hs)+![visibility demo](./programs-screenshots/brick-visibility-demo.png)
+ docs/programs-screenshots/brick-attr-demo.png view

binary file changed (absent → 52808 bytes)

+ docs/programs-screenshots/brick-border-demo.png view

binary file changed (absent → 19670 bytes)

+ docs/programs-screenshots/brick-cache-demo.png view

binary file changed (absent → 44698 bytes)

+ docs/programs-screenshots/brick-custom-event-demo.png view

binary file changed (absent → 12081 bytes)

+ docs/programs-screenshots/brick-dialog-demo.png view

binary file changed (absent → 14232 bytes)

+ docs/programs-screenshots/brick-dynamic-border-demo.png view

binary file changed (absent → 25746 bytes)

+ docs/programs-screenshots/brick-edit-demo.png view

binary file changed (absent → 18668 bytes)

+ docs/programs-screenshots/brick-file-browser-demo.png view

binary file changed (absent → 43038 bytes)

+ docs/programs-screenshots/brick-fill-demo.png view

binary file changed (absent → 12794 bytes)

+ docs/programs-screenshots/brick-form-demo.png view

binary file changed (absent → 20724 bytes)

+ docs/programs-screenshots/brick-hello-world-demo.png view

binary file changed (absent → 10794 bytes)

+ docs/programs-screenshots/brick-layer-demo.png view

binary file changed (absent → 22655 bytes)

+ docs/programs-screenshots/brick-list-demo.png view

binary file changed (absent → 18011 bytes)

+ docs/programs-screenshots/brick-list-vi-demo.png view

binary file changed (absent → 18448 bytes)

+ docs/programs-screenshots/brick-markup-demo.png view

binary file changed (absent → 12852 bytes)

+ docs/programs-screenshots/brick-mouse-demo.png view

binary file changed (absent → 35768 bytes)

+ docs/programs-screenshots/brick-padding-demo.png view

binary file changed (absent → 22308 bytes)

+ docs/programs-screenshots/brick-progressbar-demo.png view

binary file changed (absent → 16385 bytes)

+ docs/programs-screenshots/brick-readme-demo.png view

binary file changed (absent → 11141 bytes)

+ docs/programs-screenshots/brick-suspend-resume-demo.png view

binary file changed (absent → 12771 bytes)

+ docs/programs-screenshots/brick-text-wrap-demo.png view

binary file changed (absent → 27669 bytes)

+ docs/programs-screenshots/brick-theme-demo.png view

binary file changed (absent → 13429 bytes)

+ docs/programs-screenshots/brick-viewport-scroll-demo.png view

binary file changed (absent → 32432 bytes)

+ docs/programs-screenshots/brick-visibility-demo.png view

binary file changed (absent → 50627 bytes)

src/Brick/Focus.hs view
@@ -10,6 +10,7 @@   , focusGetCurrent   , focusSetCurrent   , focusRingLength+  , focusRingToList   , focusRingCursor   , withFocusRing   , focusRingModify@@ -80,6 +81,14 @@ -- | Get the size of the FocusRing. focusRingLength :: FocusRing n -> Int focusRingLength (FocusRing l) = C.size l++-- | Return all of the entries in the focus ring, starting with the+-- currently-focused entry and wrapping around the ring.+--+-- For example, if a ring contains A, B, C, and D, and the current entry+-- is B, the result will be [B, C, D, A].+focusRingToList :: FocusRing n -> [n]+focusRingToList (FocusRing l) = C.rightElements l  -- | Modify the internal circular list structure of a focus ring -- directly. This function permits modification of the circular list
src/Brick/Widgets/Core.hs view
@@ -660,7 +660,7 @@ catDynBorder towardsA towardsB a b     -- Currently, we check if the 'BorderStyle's are exactly the same. In the     -- future, it might be nice to relax this restriction. For example, if a-    -- horizontal border is being rewritten to accomodate a neighboring+    -- horizontal border is being rewritten to accommodate a neighboring     -- vertical border, all we care about is that the two 'bsVertical's line up     -- sanely. After all, if the horizontal border's 'bsVertical' is the same     -- as the vertical one's, and the horizontal border's 'BorderStyle' is
src/Brick/Widgets/FileBrowser.hs view
@@ -777,6 +777,16 @@ -- regular file with the specified extension. For example, an extension -- argument of @"xml"@ would match regular files @test.xml@ and -- @TEST.XML@ and it will match directories regardless of name.+--+-- This matcher also matches symlinks if and only if their targets are+-- directories. This is intended to make it possible to use this matcher+-- to find files with certain extensions, but also support directory+-- traversal via symlinks. fileExtensionMatch :: String -> FileInfo -> Bool-fileExtensionMatch ext i =-    ('.' : (toLower <$> ext)) `isSuffixOf` (toLower <$> fileInfoFilename i)+fileExtensionMatch ext i = case fileInfoFileType i of+    Just Directory -> True+    Just RegularFile -> ('.' : (toLower <$> ext)) `isSuffixOf` (toLower <$> fileInfoFilename i)+    Just SymbolicLink -> case fileInfoLinkTargetType i of+        Just Directory -> True+        _ -> False+    _ -> False
src/Brick/Widgets/List.hs view
@@ -561,7 +561,7 @@         clamp 0 (if null t then length l - 1 else i) i  -- | Set the selected index for a list to the index of the first--- occurence of the specified element if it is in the list, or leave+-- occurrence of the specified element if it is in the list, or leave -- the list unmodified otherwise. -- -- /O(n)/.  Only evaluates as much of the container as needed.