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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/codegen/elm-pages-codegen.cjs +251 -285
  3. package/generator/dead-code-review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  4. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  5. package/generator/dead-code-review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
  6. package/generator/review/elm-stuff/tests-0.19.1/elm-stuff/0.19.1/d.dat +0 -0
  7. package/generator/review/elm-stuff/tests-0.19.1/js/node_runner.js +1 -1
  8. package/generator/review/elm-stuff/tests-0.19.1/js/node_supervisor.js +1 -1
  9. package/generator/src/RouteBuilder.elm +19 -60
  10. package/generator/src/SharedTemplate.elm +5 -5
  11. package/generator/src/compatibility-key.js +2 -2
  12. package/package.json +2 -2
  13. package/src/ApiRoute.elm +3 -31
  14. package/src/BackendTask.elm +18 -24
  15. package/src/FormData.elm +21 -1
  16. package/src/Head/Seo.elm +4 -4
  17. package/src/Internal/Request.elm +84 -4
  18. package/src/Pages/ConcurrentSubmission.elm +127 -0
  19. package/src/Pages/Form.elm +151 -40
  20. package/src/Pages/FormData.elm +19 -0
  21. package/src/Pages/Internal/NotFoundReason.elm +4 -4
  22. package/src/Pages/Internal/Platform/Cli.elm +30 -17
  23. package/src/Pages/Internal/Platform/CompatibilityKey.elm +1 -1
  24. package/src/Pages/Internal/Platform.elm +39 -38
  25. package/src/Pages/Internal/ResponseSketch.elm +2 -2
  26. package/src/Pages/Manifest.elm +23 -7
  27. package/src/Pages/Navigation.elm +85 -0
  28. package/src/Pages/PageUrl.elm +3 -3
  29. package/src/Pages/ProgramConfig.elm +13 -11
  30. package/src/Pages/Script.elm +64 -7
  31. package/src/Pages/Url.elm +3 -3
  32. package/src/PagesMsg.elm +9 -3
  33. package/src/RenderRequest.elm +7 -7
  34. package/src/Scaffold/Form.elm +28 -5
  35. package/src/Scaffold/Route.elm +82 -53
  36. package/src/Server/Request.elm +446 -952
  37. package/src/Server/Session.elm +141 -91
  38. package/src/Server/SetCookie.elm +71 -31
  39. package/src/{Path.elm → UrlPath.elm} +21 -21
  40. package/src/Pages/Transition.elm +0 -79
@@ -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)