Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lue-bird/elm-scroll
items rolled up on both sides of a focus
https://github.com/lue-bird/elm-scroll
elm focus-list select-list zipper
Last synced: 26 days ago
JSON representation
items rolled up on both sides of a focus
- Host: GitHub
- URL: https://github.com/lue-bird/elm-scroll
- Owner: lue-bird
- License: other
- Created: 2022-12-16T16:48:35.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-03T10:34:22.000Z (about 1 year ago)
- Last Synced: 2024-12-09T18:02:08.613Z (about 1 month ago)
- Topics: elm, focus-list, select-list, zipper
- Language: Elm
- Homepage: https://dark.elm.dmy.fr/packages/lue-bird/elm-scroll/latest/
- Size: 162 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: change.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
README
> items rolled up on both sides of a focus
## 📜 [`Scroll`](https://package.elm-lang.org/packages/lue-bird/elm-scroll/latest/)
→ good fit for dynamic choice selection: tabs, playlist, ...
[↑ examples](https://github.com/lue-bird/elm-scroll/tree/master/example)`Scroll` can even focus a gap
[`Down` or `Up`](https://dark.elm.dmy.fr/packages/lue-bird/elm-linear-direction/latest/)
from every item```elm
import Linear exposing (Direction(..))
import Emptiable exposing (filled)
import Stack exposing (topBelow)
import Scroll exposing (Scroll, FocusGap)Scroll.empty
--: Scroll item_ FocusGap Possibly
|> Scroll.focusAlter (\_ -> -1 |> filled)
--: Scroll number_ FocusGap never_
|> Scroll.sideAlter Up
(\_ -> topBelow 1 [ 2, 3 ])
--: Scroll number_ FocusGap never_
|> Scroll.toGap Up
--: Scroll number_ FocusGap Possibly
|> Scroll.focusAlter (\_ -> 0 |> filled)
--: Scroll number_ FocusGap never_
|> Scroll.toStack
--> topBelow -1 [ 0, 1, 2, 3 ]
```## suggestions?
→ See [contributing.md](https://github.com/lue-bird/elm-scroll/blob/master/contributing.md)
## alternatives
- [zwilias/elm-holey-zipper](https://package.elm-lang.org/packages/zwilias/elm-holey-zipper/latest).
unsafe; a bit cluttered; no `map (Location -> ...)`, `dragFocus`, `toNonEmptyList`, `sideAlter` (so no squeezing in multiple items, ...)
- [turboMaCk/non-empty-list-alias: `List.NonEmpty.Zipper`](https://dark.elm.dmy.fr/packages/turboMaCk/non-empty-list-alias/latest/List-NonEmpty-Zipper)
complete; cluttered (for example `update` & `map`); some unintuitive names
- [miyamoen/select-list](https://dark.elm.dmy.fr/packages/miyamoen/select-list/latest/SelectList)
complete; a bit cluttered; no `focusWhere`
- [yotamDvir/elm-pivot](https://dark.elm.dmy.fr/packages/yotamDvir/elm-pivot/latest/)
complete; cluttered; no `map (Location -> ...)`
- [staeter/ziplist](https://dark.elm.dmy.fr/packages/staeter/ziplist/latest/)
navigation works; a bit cluttered; no `map (Location -> ...)`, `sideAlter` (so no squeezing in multiple items, ...)
- [wernerdegroot/listzipper](https://dark.elm.dmy.fr/packages/wernerdegroot/listzipper/latest/List-Zipper)
navigation works; no `dragFocus`, `map (Location -> ...)`, `toNonEmptyList`
- [stoeffel/list-focus](https://package.elm-lang.org/packages/stoeffel/list-focus/1.0.0/)
no clutter included but also no access of before and after, no `length`, `toList`, `map (Location -> ...)`, `toNonEmptyList`
- [alexanderkiel/list-selection](https://dark.elm.dmy.fr/packages/alexanderkiel/list-selection/latest/List-Selection)
& [NoRedInk/list-selection](https://dark.elm.dmy.fr/packages/NoRedInk/list-selection/latest/List-Selection)
very incomplete, impossible to extract focused item safely; no navigation, insertion, `side`, ...
- [jjant/elm-comonad-zipper](https://dark.elm.dmy.fr/packages/jjant/elm-comonad-zipper/latest/)
incomplete; no `dragFocus`, `toNonEmptyList`, `sideAlter` (so no squeezing in multiple items, ...)
- [guid75/ziplist](https://dark.elm.dmy.fr/packages/guid75/ziplist/latest/)
extremely incomplete
- [arowM/elm-reference: `Reference.List`](https://dark.elm.dmy.fr/packages/arowM/elm-reference/latest/Reference-List)
only `overList`, sides impossible to access & alter