elm-pages 2.1.9 → 2.1.10
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/generator/src/basepath-middleware.js +15 -9
- package/generator/src/build.js +50 -1
- package/generator/src/cli.js +13 -9
- package/generator/src/dev-server.js +11 -4
- package/generator/src/generate-template-module-connector.js +17 -4
- package/generator/src/init.js +4 -0
- package/generator/src/pre-render-html.js +9 -9
- package/generator/src/seo-renderer.js +21 -2
- package/package.json +4 -2
- package/src/AriaLiveAnnouncer.elm +2 -2
- package/src/DataSource/File.elm +2 -1
- package/src/DataSource/Glob.elm +30 -3
- package/src/DataSource.elm +5 -5
- package/src/Head.elm +17 -2
- package/src/HtmlPrinter.elm +4 -3
- package/src/Pages/Internal/Platform/Cli.elm +57 -33
- package/src/Pages/Internal/Platform/StaticResponses.elm +1 -1
- package/src/Pages/ProgramConfig.elm +1 -1
- package/src/Pages/Review/NoContractViolations.elm +4 -5
- package/src/Pages/Secrets.elm +2 -0
- package/src/{ElmHtml → Test/Html/Internal/ElmHtml}/Constants.elm +16 -10
- package/src/{ElmHtml → Test/Html/Internal/ElmHtml}/Helpers.elm +2 -2
- package/src/{ElmHtml → Test/Html/Internal/ElmHtml}/InternalTypes.elm +69 -132
- package/src/{ElmHtml → Test/Html/Internal/ElmHtml}/Markdown.elm +5 -22
- package/src/{ElmHtml → Test/Html/Internal/ElmHtml}/ToString.elm +13 -15
- package/src/Test/Internal/KernelConstants.elm +34 -0
- package/src/ElmHtml/ToElmString.elm +0 -151
- package/src/ElmHtml/ToHtml.elm +0 -82
package/src/ElmHtml/ToHtml.elm
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
module ElmHtml.ToHtml exposing (toHtml, factsToAttributes)
|
|
2
|
-
|
|
3
|
-
{-| This module is particularly useful for putting parsed Html into Elm.Html at runtime.
|
|
4
|
-
Estentially allowing the user to use tools like html-to-elm on their code.
|
|
5
|
-
|
|
6
|
-
@docs toHtml, factsToAttributes
|
|
7
|
-
|
|
8
|
-
-}
|
|
9
|
-
|
|
10
|
-
import Dict exposing (Dict)
|
|
11
|
-
import ElmHtml.InternalTypes exposing (..)
|
|
12
|
-
import Html
|
|
13
|
-
import Html.Attributes
|
|
14
|
-
import Html.Events
|
|
15
|
-
import Json.Decode
|
|
16
|
-
import Json.Encode
|
|
17
|
-
import String
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
{-| Turns ElmHtml into normal Elm Html
|
|
21
|
-
-}
|
|
22
|
-
toHtml : ElmHtml msg -> Html.Html msg
|
|
23
|
-
toHtml elmHtml =
|
|
24
|
-
case elmHtml of
|
|
25
|
-
TextTag text ->
|
|
26
|
-
Html.text text.text
|
|
27
|
-
|
|
28
|
-
NodeEntry { tag, children, facts } ->
|
|
29
|
-
Html.node tag [] (List.map toHtml children)
|
|
30
|
-
|
|
31
|
-
CustomNode record ->
|
|
32
|
-
--let
|
|
33
|
-
-- _ =
|
|
34
|
-
-- Debug.log "Custom node is not supported" ""
|
|
35
|
-
--in
|
|
36
|
-
Html.text ""
|
|
37
|
-
|
|
38
|
-
MarkdownNode record ->
|
|
39
|
-
--let
|
|
40
|
-
-- _ =
|
|
41
|
-
-- Debug.log "Markdown node is not supported" ""
|
|
42
|
-
--in
|
|
43
|
-
Html.text ""
|
|
44
|
-
|
|
45
|
-
NoOp ->
|
|
46
|
-
Html.text ""
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
stylesToAttribute : Dict String String -> List (Html.Attribute msg)
|
|
50
|
-
stylesToAttribute =
|
|
51
|
-
Dict.toList
|
|
52
|
-
>> List.map (\( k, v ) -> Html.Attributes.style k v)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
eventsToAttributes : Dict String (Json.Decode.Decoder msg) -> List (Html.Attribute msg)
|
|
56
|
-
eventsToAttributes =
|
|
57
|
-
Dict.toList
|
|
58
|
-
>> List.map (\( x, y ) -> Html.Events.on x y)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
stringAttributesToAttributes : Dict String String -> List (Html.Attribute msg)
|
|
62
|
-
stringAttributesToAttributes =
|
|
63
|
-
Dict.toList
|
|
64
|
-
>> List.map (\( x, y ) -> Html.Attributes.attribute x y)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
boolAttributesToAttributes : Dict String Bool -> List (Html.Attribute msg)
|
|
68
|
-
boolAttributesToAttributes =
|
|
69
|
-
Dict.toList
|
|
70
|
-
>> List.map (\( x, y ) -> Html.Attributes.property x (Json.Encode.bool y))
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{-| Turns a fact record into a list of attributes
|
|
74
|
-
-}
|
|
75
|
-
factsToAttributes : Facts msg -> List (Html.Attribute msg)
|
|
76
|
-
factsToAttributes facts =
|
|
77
|
-
List.concat
|
|
78
|
-
[ stylesToAttribute facts.styles
|
|
79
|
-
, eventsToAttributes facts.events
|
|
80
|
-
, stringAttributesToAttributes facts.stringAttributes
|
|
81
|
-
, boolAttributesToAttributes facts.boolAttributes
|
|
82
|
-
]
|