Skip to content

Commit ab2af49

Browse files
committed
Fix split resize in release builds by vendoring SplitPane
To support Elm 0.19.1 (and crucially to support optimize mode), this is vendored version of [quentin/elm-split-pane](https://github.com/quentin/elm-split-pane) which builds on a series of forks: * The original: [doodledood/elm-split-pane](https://github.com/doodledood/elm-split-pane) * 0.19.0 support: [whale9490/elm-split-pane](https://github.com/whale9490/elm-split-pane) * 0.19.1 support: [quentin/elm-split-pane](https://github.com/quentin/elm-split-pane)
1 parent 3a2e725 commit ab2af49

File tree

7 files changed

+824
-12
lines changed

7 files changed

+824
-12
lines changed

elm.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
"rtfeldman/elm-iso8601-date-strings": "1.1.4",
3131
"ryan-haskell/date-format": "1.0.0",
3232
"stoeffel/set-extra": "1.2.3",
33-
"wernerdegroot/listzipper": "4.0.0",
34-
"whale9490/elm-split-pane": "1.0.0"
33+
"wernerdegroot/listzipper": "4.0.0"
3534
},
3635
"indirect": {
3736
"elm/bytes": "1.0.8",
@@ -46,4 +45,4 @@
4645
"direct": {},
4746
"indirect": {}
4847
}
49-
}
48+
}

src/SplitPane/Bound.elm

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
module SplitPane.Bound exposing (Bound, Bounded, getValue, putValue, updateValue, putBound, createBound, createBounded)
2+
3+
{-| This module defines a value that is between two other values.
4+
5+
@docs Bound, Bounded, getValue, putValue, updateValue, putBound, createBound, createBounded
6+
7+
-}
8+
9+
10+
{-| Type that defines a border of values
11+
-}
12+
type alias Bound a =
13+
( a, a )
14+
15+
16+
{-| Type that defines a value that is within a border of two other values
17+
-}
18+
type alias Bounded a =
19+
( a, Bound a )
20+
21+
22+
{-| Create a new bounded value.
23+
-}
24+
getValue : Bounded comparable -> comparable
25+
getValue value =
26+
Tuple.first value
27+
28+
29+
{-| Create a new bounded value.
30+
-}
31+
createBounded : comparable -> Bound comparable -> Bounded comparable
32+
createBounded value bound =
33+
putValue ( value, bound ) value
34+
35+
36+
{-| Change the value that is bounded.
37+
-}
38+
putValue : Bounded comparable -> comparable -> Bounded comparable
39+
putValue ( _, bound ) value =
40+
( boundTo bound value, bound )
41+
42+
43+
{-| Update the value that is bounded.
44+
-}
45+
updateValue : (comparable -> comparable) -> Bounded comparable -> Bounded comparable
46+
updateValue f ( value, bound ) =
47+
( boundTo bound (f value), bound )
48+
49+
50+
{-| Change the bound of the bounded value.
51+
-}
52+
putBound : Bounded comparable -> Bound comparable -> Bounded comparable
53+
putBound ( value, _ ) bound =
54+
( value, bound )
55+
56+
57+
{-| Create a new bound that can be used to restrict a value.
58+
-}
59+
createBound : comparable -> comparable -> Bound comparable
60+
createBound a b =
61+
( min a b, max a b )
62+
63+
64+
boundTo : Bound comparable -> comparable -> comparable
65+
boundTo ( a, b ) =
66+
min b << max a

src/SplitPane/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SplitPane
2+
3+
To support Elm 0.19.1 (and crucially to support optimize mode), this is
4+
vendored version of [quentin/elm-split-pane](https://github.com/quentin/elm-split-pane) which builds on a series of forks:
5+
6+
7+
* The original: [doodledood/elm-split-pane](https://github.com/doodledood/elm-split-pane)
8+
* 0.19.0 support: [whale9490/elm-split-pane](https://github.com/whale9490/elm-split-pane)
9+
* 0.19.1 support: [quentin/elm-split-pane](https://github.com/quentin/elm-split-pane)

0 commit comments

Comments
 (0)