elm-pages 3.0.0-beta.29 → 3.0.0-beta.30
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/codegen/elm-pages-codegen.cjs +54 -49
- package/package.json +1 -1
- package/src/Pages/PageUrl.elm +12 -1
- package/src/QueryParams.elm +2 -12
|
@@ -29601,6 +29601,59 @@ var $author$project$Gen$Pages$Fetcher$call_ = {
|
|
|
29601
29601
|
[submitArg, submitArg0]));
|
|
29602
29602
|
})
|
|
29603
29603
|
};
|
|
29604
|
+
var $author$project$Gen$Pages$PageUrl$call_ = {
|
|
29605
|
+
parseQueryParams: function (parseQueryParamsArg) {
|
|
29606
|
+
return A2(
|
|
29607
|
+
$author$project$Elm$apply,
|
|
29608
|
+
$author$project$Elm$value(
|
|
29609
|
+
{
|
|
29610
|
+
annotation: $elm$core$Maybe$Just(
|
|
29611
|
+
A2(
|
|
29612
|
+
$author$project$Elm$Annotation$function,
|
|
29613
|
+
_List_fromArray(
|
|
29614
|
+
[$author$project$Elm$Annotation$string]),
|
|
29615
|
+
A3(
|
|
29616
|
+
$author$project$Elm$Annotation$namedWith,
|
|
29617
|
+
_List_Nil,
|
|
29618
|
+
'Dict',
|
|
29619
|
+
_List_fromArray(
|
|
29620
|
+
[
|
|
29621
|
+
$author$project$Elm$Annotation$string,
|
|
29622
|
+
$author$project$Elm$Annotation$list($author$project$Elm$Annotation$string)
|
|
29623
|
+
])))),
|
|
29624
|
+
importFrom: _List_fromArray(
|
|
29625
|
+
['Pages', 'PageUrl']),
|
|
29626
|
+
name: 'parseQueryParams'
|
|
29627
|
+
}),
|
|
29628
|
+
_List_fromArray(
|
|
29629
|
+
[parseQueryParamsArg]));
|
|
29630
|
+
},
|
|
29631
|
+
toUrl: function (toUrlArg) {
|
|
29632
|
+
return A2(
|
|
29633
|
+
$author$project$Elm$apply,
|
|
29634
|
+
$author$project$Elm$value(
|
|
29635
|
+
{
|
|
29636
|
+
annotation: $elm$core$Maybe$Just(
|
|
29637
|
+
A2(
|
|
29638
|
+
$author$project$Elm$Annotation$function,
|
|
29639
|
+
_List_fromArray(
|
|
29640
|
+
[
|
|
29641
|
+
A3($author$project$Elm$Annotation$namedWith, _List_Nil, 'PageUrl', _List_Nil)
|
|
29642
|
+
]),
|
|
29643
|
+
A3(
|
|
29644
|
+
$author$project$Elm$Annotation$namedWith,
|
|
29645
|
+
_List_fromArray(
|
|
29646
|
+
['Url']),
|
|
29647
|
+
'Url',
|
|
29648
|
+
_List_Nil))),
|
|
29649
|
+
importFrom: _List_fromArray(
|
|
29650
|
+
['Pages', 'PageUrl']),
|
|
29651
|
+
name: 'toUrl'
|
|
29652
|
+
}),
|
|
29653
|
+
_List_fromArray(
|
|
29654
|
+
[toUrlArg]));
|
|
29655
|
+
}
|
|
29656
|
+
};
|
|
29604
29657
|
var $author$project$Gen$PagesMsg$call_ = {
|
|
29605
29658
|
fromMsg: function (fromMsgArg) {
|
|
29606
29659
|
return A2(
|
|
@@ -29672,54 +29725,6 @@ var $author$project$Gen$PagesMsg$call_ = {
|
|
|
29672
29725
|
[mapArg, mapArg0]));
|
|
29673
29726
|
})
|
|
29674
29727
|
};
|
|
29675
|
-
var $author$project$Gen$QueryParams$call_ = {
|
|
29676
|
-
fromString: function (fromStringArg) {
|
|
29677
|
-
return A2(
|
|
29678
|
-
$author$project$Elm$apply,
|
|
29679
|
-
$author$project$Elm$value(
|
|
29680
|
-
{
|
|
29681
|
-
annotation: $elm$core$Maybe$Just(
|
|
29682
|
-
A2(
|
|
29683
|
-
$author$project$Elm$Annotation$function,
|
|
29684
|
-
_List_fromArray(
|
|
29685
|
-
[$author$project$Elm$Annotation$string]),
|
|
29686
|
-
A3(
|
|
29687
|
-
$author$project$Elm$Annotation$namedWith,
|
|
29688
|
-
_List_Nil,
|
|
29689
|
-
'Dict',
|
|
29690
|
-
_List_fromArray(
|
|
29691
|
-
[
|
|
29692
|
-
$author$project$Elm$Annotation$string,
|
|
29693
|
-
$author$project$Elm$Annotation$list($author$project$Elm$Annotation$string)
|
|
29694
|
-
])))),
|
|
29695
|
-
importFrom: _List_fromArray(
|
|
29696
|
-
['QueryParams']),
|
|
29697
|
-
name: 'fromString'
|
|
29698
|
-
}),
|
|
29699
|
-
_List_fromArray(
|
|
29700
|
-
[fromStringArg]));
|
|
29701
|
-
},
|
|
29702
|
-
toString: function (toStringArg) {
|
|
29703
|
-
return A2(
|
|
29704
|
-
$author$project$Elm$apply,
|
|
29705
|
-
$author$project$Elm$value(
|
|
29706
|
-
{
|
|
29707
|
-
annotation: $elm$core$Maybe$Just(
|
|
29708
|
-
A2(
|
|
29709
|
-
$author$project$Elm$Annotation$function,
|
|
29710
|
-
_List_fromArray(
|
|
29711
|
-
[
|
|
29712
|
-
A3($author$project$Elm$Annotation$namedWith, _List_Nil, 'QueryParams', _List_Nil)
|
|
29713
|
-
]),
|
|
29714
|
-
$author$project$Elm$Annotation$string)),
|
|
29715
|
-
importFrom: _List_fromArray(
|
|
29716
|
-
['QueryParams']),
|
|
29717
|
-
name: 'toString'
|
|
29718
|
-
}),
|
|
29719
|
-
_List_fromArray(
|
|
29720
|
-
[toStringArg]));
|
|
29721
|
-
}
|
|
29722
|
-
};
|
|
29723
29728
|
var $author$project$Gen$Tuple$call_ = {
|
|
29724
29729
|
first: function (firstArg) {
|
|
29725
29730
|
return A2(
|
|
@@ -36920,7 +36925,7 @@ var $author$project$GenerateMain$otherFile = F2(
|
|
|
36920
36925
|
$author$project$Gen$Dict$empty,
|
|
36921
36926
|
A2(
|
|
36922
36927
|
$author$project$Gen$Maybe$map,
|
|
36923
|
-
$author$project$Gen$
|
|
36928
|
+
$author$project$Gen$Pages$PageUrl$call_.parseQueryParams,
|
|
36924
36929
|
A2($author$project$Elm$get, 'query', record)))),
|
|
36925
36930
|
_Utils_Tuple2(
|
|
36926
36931
|
'fragment',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elm-pages",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.30",
|
|
5
5
|
"homepage": "https://elm-pages.com",
|
|
6
6
|
"moduleResolution": "node",
|
|
7
7
|
"description": "Type-safe static sites, written in pure elm with your own custom elm-markup syntax.",
|
package/src/Pages/PageUrl.elm
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
module Pages.PageUrl exposing
|
|
1
|
+
module Pages.PageUrl exposing
|
|
2
|
+
( PageUrl, toUrl
|
|
3
|
+
, parseQueryParams
|
|
4
|
+
)
|
|
2
5
|
|
|
3
6
|
{-| Same as a Url in `elm/url`, but slightly more structured. The path portion of the URL is parsed into a `List String` representing each segment, and
|
|
4
7
|
the query params are parsed into a `Dict String (List String)`.
|
|
5
8
|
|
|
6
9
|
@docs PageUrl, toUrl
|
|
7
10
|
|
|
11
|
+
@docs parseQueryParams
|
|
12
|
+
|
|
8
13
|
-}
|
|
9
14
|
|
|
10
15
|
import Dict exposing (Dict)
|
|
@@ -39,3 +44,9 @@ toUrl url =
|
|
|
39
44
|
url.query |> QueryParams.toString |> Just
|
|
40
45
|
, fragment = url.fragment
|
|
41
46
|
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
{-| -}
|
|
50
|
+
parseQueryParams : String -> Dict String (List String)
|
|
51
|
+
parseQueryParams =
|
|
52
|
+
QueryParams.fromString
|
package/src/QueryParams.elm
CHANGED
|
@@ -31,18 +31,8 @@ toString queryParams =
|
|
|
31
31
|
|
|
32
32
|
{-| -}
|
|
33
33
|
fromString : String -> Dict String (List String)
|
|
34
|
-
fromString
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
prepareQuery : Maybe String -> Dict String (List String)
|
|
39
|
-
prepareQuery maybeQuery =
|
|
40
|
-
case maybeQuery of
|
|
41
|
-
Nothing ->
|
|
42
|
-
Dict.empty
|
|
43
|
-
|
|
44
|
-
Just qry ->
|
|
45
|
-
List.foldr addParam Dict.empty (String.split "&" qry)
|
|
34
|
+
fromString query =
|
|
35
|
+
List.foldr addParam Dict.empty (String.split "&" query)
|
|
46
36
|
|
|
47
37
|
|
|
48
38
|
addParam : String -> Dict String (List String) -> Dict String (List String)
|