elm-pages 3.0.0-beta.40 → 3.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/codegen/elm-pages-codegen.cjs +251 -285
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
- package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
- package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
- package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
- package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
- package/generator/src/RouteBuilder.elm +19 -60
- package/generator/src/SharedTemplate.elm +5 -5
- package/generator/src/compatibility-key.js +2 -2
- package/package.json +2 -2
- package/src/ApiRoute.elm +3 -31
- package/src/BackendTask.elm +18 -24
- package/src/FormData.elm +21 -1
- package/src/Head/Seo.elm +4 -4
- package/src/Internal/Request.elm +84 -4
- package/src/Pages/ConcurrentSubmission.elm +127 -0
- package/src/Pages/Form.elm +151 -40
- package/src/Pages/FormData.elm +19 -0
- package/src/Pages/Internal/NotFoundReason.elm +4 -4
- package/src/Pages/Internal/Platform/Cli.elm +30 -17
- package/src/Pages/Internal/Platform/CompatibilityKey.elm +1 -1
- package/src/Pages/Internal/Platform.elm +39 -38
- package/src/Pages/Internal/ResponseSketch.elm +2 -2
- package/src/Pages/Manifest.elm +23 -7
- package/src/Pages/Navigation.elm +85 -0
- package/src/Pages/PageUrl.elm +3 -3
- package/src/Pages/ProgramConfig.elm +13 -11
- package/src/Pages/Script.elm +64 -7
- package/src/Pages/Url.elm +3 -3
- package/src/PagesMsg.elm +9 -3
- package/src/RenderRequest.elm +7 -7
- package/src/Scaffold/Form.elm +28 -5
- package/src/Scaffold/Route.elm +82 -53
- package/src/Server/Request.elm +446 -952
- package/src/Server/Session.elm +141 -91
- package/src/Server/SetCookie.elm +71 -31
- package/src/{Path.elm → UrlPath.elm} +21 -21
- package/src/Pages/Transition.elm +0 -79
package/src/Pages/Transition.elm
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
module Pages.Transition exposing
|
|
2
|
-
( Transition(..), LoadingState(..), map, FormData
|
|
3
|
-
, FetcherState, FetcherSubmitStatus(..)
|
|
4
|
-
)
|
|
5
|
-
|
|
6
|
-
{-|
|
|
7
|
-
|
|
8
|
-
@docs Transition, LoadingState, map, FormData
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## Fetchers
|
|
12
|
-
|
|
13
|
-
@docs FetcherState, FetcherSubmitStatus
|
|
14
|
-
|
|
15
|
-
-}
|
|
16
|
-
|
|
17
|
-
import Form
|
|
18
|
-
import Path exposing (Path)
|
|
19
|
-
import Time
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{-| -}
|
|
23
|
-
type alias FormData =
|
|
24
|
-
{ fields : List ( String, String )
|
|
25
|
-
, method : Form.Method
|
|
26
|
-
, action : String
|
|
27
|
-
, id : Maybe String
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{-| -}
|
|
32
|
-
type Transition
|
|
33
|
-
= Submitting FormData
|
|
34
|
-
| LoadAfterSubmit FormData Path LoadingState
|
|
35
|
-
| Loading Path LoadingState
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{-| -}
|
|
39
|
-
type LoadingState
|
|
40
|
-
= Redirecting
|
|
41
|
-
| Load
|
|
42
|
-
| ActionRedirect
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{-| -}
|
|
46
|
-
type alias FetcherState actionData =
|
|
47
|
-
{ status : FetcherSubmitStatus actionData
|
|
48
|
-
, payload : FormData
|
|
49
|
-
, initiatedAt : Time.Posix
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{-| -}
|
|
54
|
-
type FetcherSubmitStatus actionData
|
|
55
|
-
= FetcherSubmitting
|
|
56
|
-
| FetcherReloading actionData
|
|
57
|
-
| FetcherComplete actionData
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{-| -}
|
|
61
|
-
map : (a -> b) -> FetcherState a -> FetcherState b
|
|
62
|
-
map mapFn fetcherState =
|
|
63
|
-
{ status = mapStatus mapFn fetcherState.status
|
|
64
|
-
, payload = fetcherState.payload
|
|
65
|
-
, initiatedAt = fetcherState.initiatedAt
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
mapStatus : (a -> b) -> FetcherSubmitStatus a -> FetcherSubmitStatus b
|
|
70
|
-
mapStatus mapFn fetcherSubmitStatus =
|
|
71
|
-
case fetcherSubmitStatus of
|
|
72
|
-
FetcherSubmitting ->
|
|
73
|
-
FetcherSubmitting
|
|
74
|
-
|
|
75
|
-
FetcherReloading value ->
|
|
76
|
-
FetcherReloading (mapFn value)
|
|
77
|
-
|
|
78
|
-
FetcherComplete value ->
|
|
79
|
-
FetcherComplete (mapFn value)
|