@@ -1,4 +1,4 @@
1−module Internal.Model exposing (..)
1+module Internal.Model exposing (Aligned(..), Angle, Attribute(..), Axis(..), Children(..), Color(..), Description(..), Element(..), EmbedStyle(..), FocusStyle, Font(..), Gathered, HAlign(..), HoverSetting(..), LayoutContext(..), Length(..), Location(..), NodeName(..), Option(..), OptionRecord, Padding(..), Property(..), PseudoClass(..), RenderMode(..), Shadow, Spacing(..), Style(..), TransformComponent(..), Transformation(..), VAlign(..), XYZ, addNodeName, addWhen, alignXName, alignYName, asColumn, asEl, asGrid, asParagraph, asRow, asTextColumn, boxShadowName, columnClass, composeTransformation, contextClasses, createElement, defaultOptions, div, element, embedKeyed, embedWith, extractSpacingAndPadding, filter, finalizeNode, floatClass, focusDefaultStyle, formatBoxShadow, formatColor, formatColorClass, formatDropShadow, formatTextShadow, gatherAttrRecursive, get, getHeight, getSpacing, getStyleName, getWidth, gridClass, htmlClass, lengthClassName, map, mapAttr, mapAttrFromStyle, noStyleSheet, onlyStyles, optionsToRecord, paddingName, pageClass, paragraphClass, reduceRecursive, reduceRecursiveCalcName, reduceStyles, reduceStylesRecursive, removeNever, renderFocusStyle, renderFont, renderFontClassName, renderHeight, renderRoot, renderWidth, rootStyle, rowClass, singleClass, skippable, sortedReduce, spacingName, staticRoot, tag, textElement, textElementFill, textShadowName, toHtml, toStyleSheet, toStyleSheetString, transformClass, transformValue, unit, unstyled, untransformed, unwrapDecorations, unwrapDecsHelper)
22
33{-| -}
44
@@ -275,6 +275,7 @@ finalizeNode has node attributes children embedMode parentContext =
275275 AsRow ->
276276 if Flag.present Flag.widthFill has && not (Flag.present Flag.widthBetween has) then
277277 html
278+
278279 else if Flag.present Flag.alignRight has then
279280 Html.u
280281 [ Html.Attributes.class
@@ -288,6 +289,7 @@ finalizeNode has node attributes children embedMode parentContext =
288289 )
289290 ]
290291 [ html ]
292+
291293 else if Flag.present Flag.centerX has then
292294 Html.s
293295 [ Html.Attributes.class
@@ -301,12 +303,14 @@ finalizeNode has node attributes children embedMode parentContext =
301303 )
302304 ]
303305 [ html ]
306+
304307 else
305308 html
306309
307310 AsColumn ->
308311 if Flag.present Flag.heightFill has && not (Flag.present Flag.heightBetween has) then
309312 html
313+
310314 else if Flag.present Flag.centerY has then
311315 Html.s
312316 [ Html.Attributes.class
@@ -319,6 +323,7 @@ finalizeNode has node attributes children embedMode parentContext =
319323 )
320324 ]
321325 [ html ]
326+
322327 else if Flag.present Flag.alignBottom has then
323328 Html.u
324329 [ Html.Attributes.class
@@ -331,6 +336,7 @@ finalizeNode has node attributes children embedMode parentContext =
331336 )
332337 ]
333338 [ html ]
339+
334340 else
335341 html
336342
@@ -349,6 +355,7 @@ embedWith static opts styles children =
349355 |> toStyleSheet opts
350356 )
351357 :: children
358+
352359 else
353360 (styles
354361 |> List.foldl reduceStyles ( Set.empty, [ renderFocusStyle opts.focus ] )
@@ -372,6 +379,7 @@ embedKeyed static opts styles children =
372379 |> toStyleSheet opts
373380 )
374381 :: children
382+
375383 else
376384 ( "dynamic-stylesheet"
377385 , styles
@@ -397,6 +405,7 @@ reduceStylesRecursive cache found styles =
397405 in
398406 if Set.member styleName cache then
399407 reduceStylesRecursive cache found remaining
408+
400409 else
401410 reduceStylesRecursive (Set.insert styleName cache) (head :: found) remaining
402411
@@ -409,6 +418,7 @@ reduceStyles style (( cache, existing ) as nevermind) =
409418 in
410419 if Set.member styleName cache then
411420 nevermind
421+
412422 else
413423 ( Set.insert styleName cache
414424 , style :: existing
@@ -434,6 +444,7 @@ reduceRecursiveCalcName found styles =
434444 headOfList :: other :: remaining ->
435445 if headOfList /= other then
436446 reduceRecursiveCalcName (headOfList :: found) (other :: remaining)
447+
437448 else
438449 reduceRecursiveCalcName found (other :: remaining)
439450
@@ -450,6 +461,7 @@ reduceRecursive found styles =
450461 ( headOfListName, headOfList ) :: ( otherName, other ) :: remaining ->
451462 if headOfListName /= otherName then
452463 reduceRecursive (headOfList :: found) (( otherName, other ) :: remaining)
464+
453465 else
454466 reduceRecursive found (( otherName, other ) :: remaining)
455467
@@ -674,6 +686,7 @@ skippable flag style =
674686
675687 _ ->
676688 False
689+
677690 else
678691 case style of
679692 FontSize i ->
@@ -719,6 +732,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
719732 Class flag exactClassName ->
720733 if Flag.present flag has then
721734 gatherAttrRecursive classes node has transform styles attrs children remaining
735+
722736 else
723737 gatherAttrRecursive (exactClassName ++ " " ++ classes) node (Flag.add flag has) transform styles attrs children remaining
724738
@@ -728,6 +742,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
728742 StyleClass flag style ->
729743 if Flag.present flag has then
730744 gatherAttrRecursive classes node has transform styles attrs children remaining
745+
731746 else if skippable flag style then
732747 gatherAttrRecursive (getStyleName style ++ " " ++ classes)
733748 node
@@ -737,6 +752,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
737752 attrs
738753 children
739754 remaining
755+
740756 else
741757 gatherAttrRecursive (getStyleName style ++ " " ++ classes)
742758 node
@@ -760,6 +776,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
760776 Width width ->
761777 if Flag.present Flag.width has then
762778 gatherAttrRecursive classes node has transform styles attrs children remaining
779+
763780 else
764781 case width of
765782 Px px ->
@@ -792,6 +809,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
792809 attrs
793810 children
794811 remaining
812+
795813 else
796814 gatherAttrRecursive (classes ++ " " ++ Internal.Style.classes.widthFillPortion ++ " width-fill-" ++ String.fromInt portion)
797815 node
@@ -829,6 +847,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
829847 Height height ->
830848 if Flag.present Flag.height has then
831849 gatherAttrRecursive classes node has transform styles attrs children remaining
850+
832851 else
833852 case height of
834853 Px px ->
@@ -868,6 +887,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
868887 attrs
869888 children
870889 remaining
890+
871891 else
872892 gatherAttrRecursive (classes ++ " " ++ (Internal.Style.classes.heightFillPortion ++ " height-fill-" ++ String.fromInt portion))
873893 node
@@ -919,8 +939,10 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
919939 Heading i ->
920940 if i <= 1 then
921941 gatherAttrRecursive classes (addNodeName "h1" node) has transform styles attrs children remaining
942+
922943 else if i < 7 then
923944 gatherAttrRecursive classes (addNodeName ("h" ++ String.fromInt i) node) has transform styles attrs children remaining
945+
924946 else
925947 gatherAttrRecursive classes (addNodeName "h6" node) has transform styles attrs children remaining
926948
@@ -1037,6 +1059,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
10371059 newClasses =
10381060 if location == Behind then
10391061 Internal.Style.classes.hasBehind ++ " " ++ classes
1062+
10401063 else
10411064 classes
10421065 in
@@ -1045,6 +1068,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
10451068 AlignX x ->
10461069 if Flag.present Flag.xAlign has then
10471070 gatherAttrRecursive classes node has transform styles attrs children remaining
1071+
10481072 else
10491073 gatherAttrRecursive (alignXName x ++ " " ++ classes)
10501074 node
@@ -1071,6 +1095,7 @@ gatherAttrRecursive classes node has transform styles attrs children elementAttr
10711095 AlignY y ->
10721096 if Flag.present Flag.yAlign has then
10731097 gatherAttrRecursive classes node has transform styles attrs children remaining
1098+
10741099 else
10751100 gatherAttrRecursive (alignYName y ++ " " ++ classes)
10761101 node
@@ -1114,6 +1139,7 @@ renderWidth w =
11141139 , Internal.Style.classes.widthFill
11151140 , []
11161141 )
1142+
11171143 else
11181144 ( Flag.add Flag.widthFill Flag.none
11191145 , Internal.Style.classes.widthFillPortion ++ " width-fill-" ++ String.fromInt portion
@@ -1195,6 +1221,7 @@ renderHeight h =
11951221 , Internal.Style.classes.heightFill
11961222 , []
11971223 )
1224+
11981225 else
11991226 ( Flag.add Flag.heightFill Flag.none
12001227 , Internal.Style.classes.heightFillPortion ++ " height-fill-" ++ String.fromInt portion
@@ -1323,6 +1350,7 @@ createElement context children rendered =
13231350 ( html context :: htmls
13241351 , existingStyles
13251352 )
1353+
13261354 else
13271355 ( html context :: htmls
13281356 , existingStyles
@@ -1333,13 +1361,16 @@ createElement context children rendered =
13331361 ( styled.html NoStyleSheet context :: htmls
13341362 , if List.isEmpty existingStyles then
13351363 styled.styles
1364+
13361365 else
13371366 styled.styles ++ existingStyles
13381367 )
1368+
13391369 else
13401370 ( styled.html NoStyleSheet context :: htmls
13411371 , if List.isEmpty existingStyles then
13421372 styled.styles
1373+
13431374 else
13441375 styled.styles ++ existingStyles
13451376 )
@@ -1361,16 +1392,19 @@ createElement context children rendered =
13611392 ( VirtualDom.text
13621393 (if context == asParagraph then
13631394 str ++ " "
1395+
13641396 else
13651397 str
13661398 )
13671399 :: htmls
13681400 , existingStyles
13691401 )
1402+
13701403 else
13711404 ( textElement
13721405 (if context == asParagraph then
13731406 str ++ " "
1407+
13741408 else
13751409 str
13761410 )
@@ -1388,6 +1422,7 @@ createElement context children rendered =
13881422 ( ( key, html context ) :: htmls
13891423 , existingStyles
13901424 )
1425+
13911426 else
13921427 ( ( key, html context ) :: htmls
13931428 , existingStyles
@@ -1399,13 +1434,16 @@ createElement context children rendered =
13991434 :: htmls
14001435 , if List.isEmpty existingStyles then
14011436 styled.styles
1437+
14021438 else
14031439 styled.styles ++ existingStyles
14041440 )
1441+
14051442 else
14061443 ( ( key, styled.html NoStyleSheet context ) :: htmls
14071444 , if List.isEmpty existingStyles then
14081445 styled.styles
1446+
14091447 else
14101448 styled.styles ++ existingStyles
14111449 )
@@ -1424,6 +1462,7 @@ createElement context children rendered =
14241462 , VirtualDom.text
14251463 (if context == asParagraph then
14261464 str ++ " "
1465+
14271466 else
14281467 str
14291468 )
@@ -1431,11 +1470,13 @@ createElement context children rendered =
14311470 :: htmls
14321471 , existingStyles
14331472 )
1473+
14341474 else
14351475 ( ( key
14361476 , textElement
14371477 (if context == asParagraph then
14381478 str ++ " "
1479+
14391480 else
14401481 str
14411482 )
@@ -1455,6 +1496,7 @@ createElement context children rendered =
14551496 newStyles =
14561497 if List.isEmpty styles then
14571498 rendered.styles
1499+
14581500 else
14591501 rendered.styles ++ styles
14601502 in
@@ -1482,6 +1524,7 @@ createElement context children rendered =
14821524 newStyles =
14831525 if List.isEmpty styles then
14841526 rendered.styles
1527+
14851528 else
14861529 rendered.styles ++ styles
14871530 in
@@ -1520,6 +1563,7 @@ staticRoot =
15201563addWhen ifThis x to =
15211564 if ifThis then
15221565 x :: to
1566+
15231567 else
15241568 to
15251569
@@ -1550,18 +1594,21 @@ filter attrs =
15501594 Width width ->
15511595 if Set.member "width" has then
15521596 ( found, has )
1597+
15531598 else
15541599 ( x :: found, Set.insert "width" has )
15551600
15561601 Height height ->
15571602 if Set.member "height" has then
15581603 ( found, has )
1604+
15591605 else
15601606 ( x :: found, Set.insert "height" has )
15611607
15621608 Describe description ->
15631609 if Set.member "described" has then
15641610 ( found, has )
1611+
15651612 else
15661613 ( x :: found, Set.insert "described" has )
15671614
@@ -1571,18 +1618,21 @@ filter attrs =
15711618 AlignX _ ->
15721619 if Set.member "align-x" has then
15731620 ( found, has )
1621+
15741622 else
15751623 ( x :: found, Set.insert "align-x" has )
15761624
15771625 AlignY _ ->
15781626 if Set.member "align-y" has then
15791627 ( found, has )
1628+
15801629 else
15811630 ( x :: found, Set.insert "align-y" has )
15821631
15831632 TransformComponent _ _ ->
15841633 if Set.member "transform" has then
15851634 ( found, has )
1635+
15861636 else
15871637 ( x :: found, Set.insert "transform" has )
15881638 )
@@ -1598,6 +1648,7 @@ get attrs isAttr =
15981648 (\x found ->
15991649 if isAttr x then
16001650 x :: found
1651+
16011652 else
16021653 found
16031654 )
@@ -2030,6 +2081,7 @@ toStyleSheetString options stylesheet =
20302081 renderProps force (Property key val) existing =
20312082 if force then
20322083 existing ++ "\n " ++ key ++ ": " ++ val ++ " !important;"
2084+
20332085 else
20342086 existing ++ "\n " ++ key ++ ": " ++ val ++ ";"
20352087
@@ -2519,6 +2571,7 @@ formatBoxShadow shadow =
25192571 List.filterMap identity
25202572 [ if shadow.inset then
25212573 Just "inset"
2574+
25222575 else
25232576 Nothing
25242577 , Just <| String.fromFloat (Tuple.first shadow.offset) ++ "px"
@@ -2533,6 +2586,7 @@ boxShadowName shadow =
25332586 String.concat <|
25342587 [ if shadow.inset then
25352588 "box-inset"
2589+
25362590 else
25372591 "box-"
25382592 , String.fromFloat (Tuple.first shadow.offset) ++ "px"