@liascript/editor 1.1.6--0.15.12 → 1.1.7--0.16.0

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 (156) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/README.md +1 -1
  3. package/dist/{Base.9a5d63ee.js → Base.605d9ab5.js} +1 -1
  4. package/dist/{Base.a9e738fa.js → Base.d8e1fc60.js} +1 -1
  5. package/dist/index.11182e74.js +1 -0
  6. package/dist/index.55026812.js +1 -0
  7. package/dist/index.691fb05c.js +1 -0
  8. package/dist/index.756a5816.css +1 -0
  9. package/dist/index.796e2c5e.js +1 -0
  10. package/dist/index.html +1 -1
  11. package/dist/jszip.min.0e12e848.js +13 -0
  12. package/dist/jszip.min.a7b69263.js +13 -0
  13. package/package.json +9 -2
  14. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/LICENSE +0 -11
  15. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/README.md +0 -172
  16. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/artifacts.dat +0 -0
  17. package/.elm/0.19.1/packages/BrianHicks/elm-string-graphemes/1.0.4/docs.json +0 -1
  18. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/LICENSE +0 -27
  19. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/README.md +0 -107
  20. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/artifacts.dat +0 -0
  21. package/.elm/0.19.1/packages/NoRedInk/elm-json-decode-pipeline/1.0.1/docs.json +0 -1
  22. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/LICENSE +0 -29
  23. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/README.md +0 -51
  24. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/artifacts.dat +0 -0
  25. package/.elm/0.19.1/packages/andre-dietrich/elm-conditional/1.0.0/docs.json +0 -1
  26. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/LICENSE +0 -21
  27. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/README.md +0 -313
  28. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/artifacts.dat +0 -0
  29. package/.elm/0.19.1/packages/andre-dietrich/elm-random-regex/1.0.9/docs.json +0 -1
  30. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/LICENSE +0 -202
  31. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/README.md +0 -820
  32. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/artifacts.dat +0 -0
  33. package/.elm/0.19.1/packages/andre-dietrich/elm-svgbob/5.0.2/docs.json +0 -1
  34. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/LICENSE +0 -24
  35. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/README.md +0 -7
  36. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/artifacts.dat +0 -0
  37. package/.elm/0.19.1/packages/andre-dietrich/parser-combinators/4.1.0/docs.json +0 -1
  38. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/LICENSE +0 -11
  39. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/README.md +0 -57
  40. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/artifacts.dat +0 -0
  41. package/.elm/0.19.1/packages/avh4/elm-color/1.0.0/docs.json +0 -1
  42. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/LICENSE +0 -11
  43. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/README.md +0 -58
  44. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/artifacts.dat +0 -0
  45. package/.elm/0.19.1/packages/danfishgold/base64-bytes/1.1.0/docs.json +0 -1
  46. package/.elm/0.19.1/packages/elm/browser/1.0.2/LICENSE +0 -11
  47. package/.elm/0.19.1/packages/elm/browser/1.0.2/README.md +0 -21
  48. package/.elm/0.19.1/packages/elm/browser/1.0.2/artifacts.dat +0 -0
  49. package/.elm/0.19.1/packages/elm/browser/1.0.2/docs.json +0 -1
  50. package/.elm/0.19.1/packages/elm/bytes/1.0.8/LICENSE +0 -30
  51. package/.elm/0.19.1/packages/elm/bytes/1.0.8/README.md +0 -56
  52. package/.elm/0.19.1/packages/elm/bytes/1.0.8/artifacts.dat +0 -0
  53. package/.elm/0.19.1/packages/elm/bytes/1.0.8/docs.json +0 -1
  54. package/.elm/0.19.1/packages/elm/core/1.0.5/LICENSE +0 -11
  55. package/.elm/0.19.1/packages/elm/core/1.0.5/README.md +0 -30
  56. package/.elm/0.19.1/packages/elm/core/1.0.5/artifacts.dat +0 -0
  57. package/.elm/0.19.1/packages/elm/core/1.0.5/docs.json +0 -1
  58. package/.elm/0.19.1/packages/elm/file/1.0.5/LICENSE +0 -30
  59. package/.elm/0.19.1/packages/elm/file/1.0.5/README.md +0 -127
  60. package/.elm/0.19.1/packages/elm/file/1.0.5/artifacts.dat +0 -0
  61. package/.elm/0.19.1/packages/elm/file/1.0.5/docs.json +0 -1
  62. package/.elm/0.19.1/packages/elm/html/1.0.0/LICENSE +0 -30
  63. package/.elm/0.19.1/packages/elm/html/1.0.0/README.md +0 -50
  64. package/.elm/0.19.1/packages/elm/html/1.0.0/artifacts.dat +0 -0
  65. package/.elm/0.19.1/packages/elm/html/1.0.0/docs.json +0 -1
  66. package/.elm/0.19.1/packages/elm/http/2.0.0/LICENSE +0 -30
  67. package/.elm/0.19.1/packages/elm/http/2.0.0/README.md +0 -36
  68. package/.elm/0.19.1/packages/elm/http/2.0.0/artifacts.dat +0 -0
  69. package/.elm/0.19.1/packages/elm/http/2.0.0/docs.json +0 -1
  70. package/.elm/0.19.1/packages/elm/json/1.1.3/LICENSE +0 -30
  71. package/.elm/0.19.1/packages/elm/json/1.1.3/README.md +0 -63
  72. package/.elm/0.19.1/packages/elm/json/1.1.3/artifacts.dat +0 -0
  73. package/.elm/0.19.1/packages/elm/json/1.1.3/docs.json +0 -1
  74. package/.elm/0.19.1/packages/elm/random/1.0.0/LICENSE +0 -30
  75. package/.elm/0.19.1/packages/elm/random/1.0.0/README.md +0 -46
  76. package/.elm/0.19.1/packages/elm/random/1.0.0/artifacts.dat +0 -0
  77. package/.elm/0.19.1/packages/elm/random/1.0.0/docs.json +0 -1
  78. package/.elm/0.19.1/packages/elm/regex/1.0.0/LICENSE +0 -30
  79. package/.elm/0.19.1/packages/elm/regex/1.0.0/README.md +0 -59
  80. package/.elm/0.19.1/packages/elm/regex/1.0.0/artifacts.dat +0 -0
  81. package/.elm/0.19.1/packages/elm/regex/1.0.0/docs.json +0 -1
  82. package/.elm/0.19.1/packages/elm/svg/1.0.1/LICENSE +0 -30
  83. package/.elm/0.19.1/packages/elm/svg/1.0.1/README.md +0 -62
  84. package/.elm/0.19.1/packages/elm/svg/1.0.1/artifacts.dat +0 -0
  85. package/.elm/0.19.1/packages/elm/svg/1.0.1/docs.json +0 -1
  86. package/.elm/0.19.1/packages/elm/time/1.0.0/LICENSE +0 -30
  87. package/.elm/0.19.1/packages/elm/time/1.0.0/README.md +0 -94
  88. package/.elm/0.19.1/packages/elm/time/1.0.0/artifacts.dat +0 -0
  89. package/.elm/0.19.1/packages/elm/time/1.0.0/docs.json +0 -1
  90. package/.elm/0.19.1/packages/elm/url/1.0.0/LICENSE +0 -27
  91. package/.elm/0.19.1/packages/elm/url/1.0.0/README.md +0 -32
  92. package/.elm/0.19.1/packages/elm/url/1.0.0/artifacts.dat +0 -0
  93. package/.elm/0.19.1/packages/elm/url/1.0.0/docs.json +0 -1
  94. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/LICENSE +0 -30
  95. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/README.md +0 -5
  96. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/artifacts.dat +0 -0
  97. package/.elm/0.19.1/packages/elm/virtual-dom/1.0.3/docs.json +0 -1
  98. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/LICENSE +0 -21
  99. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/README.md +0 -19
  100. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/artifacts.dat +0 -0
  101. package/.elm/0.19.1/packages/elm-community/list-extra/8.7.0/docs.json +0 -1
  102. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/LICENSE +0 -29
  103. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/README.md +0 -31
  104. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/artifacts.dat +0 -0
  105. package/.elm/0.19.1/packages/elm-community/random-extra/3.2.0/docs.json +0 -1
  106. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/LICENSE +0 -11
  107. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/README.md +0 -73
  108. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/artifacts.dat +0 -0
  109. package/.elm/0.19.1/packages/f0i/statistics/2.0.0/docs.json +0 -1
  110. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/LICENSE +0 -373
  111. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/README.md +0 -77
  112. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/artifacts.dat +0 -0
  113. package/.elm/0.19.1/packages/folkertdev/elm-flate/2.0.5/docs.json +0 -1
  114. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/LICENSE +0 -9
  115. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/README.md +0 -112
  116. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/artifacts.dat +0 -0
  117. package/.elm/0.19.1/packages/justgook/elm-image/5.0.0/docs.json +0 -1
  118. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/LICENSE +0 -11
  119. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/README.md +0 -67
  120. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/artifacts.dat +0 -0
  121. package/.elm/0.19.1/packages/jxxcarlson/elm-pseudorandom/1.0.3/docs.json +0 -1
  122. package/.elm/0.19.1/packages/lock +0 -0
  123. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/LICENSE +0 -27
  124. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/README.md +0 -32
  125. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/artifacts.dat +0 -0
  126. package/.elm/0.19.1/packages/pablohirafuji/elm-qrcode/4.0.2/docs.json +0 -1
  127. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/LICENSE +0 -25
  128. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/README.md +0 -14
  129. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/artifacts.dat +0 -0
  130. package/.elm/0.19.1/packages/pilatch/flip/1.0.0/docs.json +0 -1
  131. package/.elm/0.19.1/packages/registry.dat +0 -0
  132. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/LICENSE +0 -29
  133. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/README.md +0 -13
  134. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/artifacts.dat +0 -0
  135. package/.elm/0.19.1/packages/rtfeldman/elm-hex/1.0.0/docs.json +0 -1
  136. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/LICENSE +0 -27
  137. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/README.md +0 -72
  138. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/artifacts.dat +0 -0
  139. package/.elm/0.19.1/packages/tesk9/accessible-html/4.1.1/docs.json +0 -1
  140. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/LICENSE +0 -22
  141. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/README.md +0 -27
  142. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/artifacts.dat +0 -0
  143. package/.elm/0.19.1/packages/truqu/elm-base64/2.0.4/docs.json +0 -1
  144. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/LICENSE +0 -27
  145. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/README.md +0 -34
  146. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/artifacts.dat +0 -0
  147. package/.elm/0.19.1/packages/truqu/elm-md5/1.1.0/docs.json +0 -1
  148. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/LICENSE +0 -29
  149. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/README.md +0 -8
  150. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/artifacts.dat +0 -0
  151. package/.elm/0.19.1/packages/zwilias/elm-utf-tools/2.0.1/docs.json +0 -1
  152. package/dist/index.270309fa.js +0 -1
  153. package/dist/index.2b67d179.js +0 -1
  154. package/dist/index.3d681c84.js +0 -1
  155. package/dist/index.72230c64.css +0 -1
  156. package/dist/index.d57ed7b9.js +0 -1
@@ -1,59 +0,0 @@
1
- # Regex in Elm
2
-
3
- **Generally speaking, it will be easier and nicer to use a parsing library like [`elm/parser`][elm] instead of this.**
4
-
5
- [elm]: https://package.elm-lang.org/packages/elm/parser/latest
6
-
7
- That said, sometimes you may want the kind of regular expressions that appear in JavaScript. Maybe you found some regex on StackOverflow and just want to place it in your code directly. This library supports that scenario.
8
-
9
-
10
-
11
- ## Future Plans
12
-
13
- I hope that _other_ packages will spring up for common parsing tasks, making `regex` less and less useful.
14
-
15
- So instead of searching Stack Overflow for "email regex" we could have a well-tested package for validating emails. Instead of searching Stack Overflow for "phone numbers" we could have a well-tested package for validating phone numbers that gathered a bunch of helpful information on handling international numbers. Etc.
16
-
17
- And as the community handles more and more cases in an _excellent_ way, I hope a day will come when no one wants the `regex` package anymore.
18
-
19
-
20
- <br>
21
-
22
-
23
- ## Historical Notes
24
-
25
- I want to draw a distinction between **regular expressions** and **regex**. These are related, but not the same. I think understanding the distinction helps motivate why I recommend against using this package.
26
-
27
-
28
- ### Regular Expressions
29
-
30
- In theoritical computer science, the idea of a “regular expression” is a simple expression that matches a set of strings. For example:
31
-
32
- - `a` matches `"a"`
33
- - `ab` matches `"ab"`
34
- - `ab*` matches `"a"`, `"ab"`, `"abb"`, `"abbb"`, `"abbbb"`, etc.
35
- - `(ab)*` matches `""`, `"ab"`, `"abab"`, `"ababab"`, `"abababab"`, etc.
36
- - `a|b` matches `"a"` and `"b"`
37
- - `a|(bb)*` matches `"a"`, `""`, `"bb"`, `"bbbb"`, `"bbbb"`, `"bbbbbb"`, etc.
38
-
39
- So you basically have `*` to repeat, parentheses for grouping, and `|` for providing alternatives. That is it! A simple syntax that can describe a bunch of different things.
40
-
41
- It also has quite beautiful relationships to finite automata, context-free grammers, turing machines, etc. If you are into this sort of thing, I highly recommend [Introduction to the Theory of Computation](https://math.mit.edu/~sipser/book.html) by Michael Sipser!
42
-
43
-
44
- ### Regex
45
-
46
- So people came up with that simple thing in computer science, and on its surface, it looks like a good way to match email addresses, phone numbers, etc. But regular expressions only match or not. How can we _extract_ information from the string as well? Well, this is how regex was born.
47
-
48
- A bunch of extensions were added to the root idea, significantly complicating the syntax and behavior. For example, instead of using parentheses just for grouping, parentheses also extract information. But wait, how does `(a|b)*` work if we are extracting everything inside the parens? What should be extracted from matching strings like `"aabb"` or `"aba"` now?
49
-
50
- So lots of things like that were added, and the result is called “regex” and it appears in a bunch of common programming languages like Perl, Python, and JavaScript.
51
-
52
-
53
- ### Reflections
54
-
55
- The regex idea has become quite influential. It is “good enough” for a lot of cases, but it is also quite confusing and difficult to use reliably. If you look around Stack Overflow, you will find tons of questions like "how do I parse an email address?" and many folks just copy/paste the answers without really reading or understanding the regex thoroughly. Does the regex really work? What exactly do you want to allow and disallow?
56
-
57
- The root issue is that regular expressions were not _meant_ to parse everything. For example, regular expressions are unable to describe sets of strings with balanced parentheses, so no regular expression can describe the set of `"()"`, `"(())"`, `"((()))"`, etc. (That means [they cannot parse matching HTML tags](https://stackoverflow.com/a/1732454) either!) But you _can_ do that with context-free grammars! With one really elegant addition! So the limitations of regular expressions are actually their whole point. They are _supposed_ to be simple to show why other formulations can express more.
58
-
59
- So this is why I recommend the [`elm/parser`][elm] package over this one. It _is_ meant to parse everything, and in a way that works really nice with Elm.
@@ -1 +0,0 @@
1
- [{"name":"Regex","comment":" A library for working with regex. The syntax matches the [`RegExp`][js]\nlibrary from JavaScript.\n\n[js]: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions\n\n# Create\n@docs Regex, fromString, fromStringWith, Options, never\n\n# Use\n@docs contains, split, find, replace, Match\n\n# Fancier Uses\n@docs splitAtMost, findAtMost, replaceAtMost\n\n","unions":[{"name":"Regex","comment":" A regular expression [as specified in JavaScript][js].\n\n[js]: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions\n\n","args":[],"cases":[]}],"aliases":[{"name":"Match","comment":" The details about a particular match:\n\n * `match` &mdash; the full string of the match.\n * `index` &mdash; the index of the match in the original string.\n * `number` &mdash; if you find many matches, you can think of each one\n as being labeled with a `number` starting at one. So the first time you\n find a match, that is match `number` one. Second time is match `number` two.\n This is useful when paired with `replace` if replacement is dependent on how\n many times a pattern has appeared before.\n * `submatches` &mdash; a `Regex` can have [subpatterns][sub], sup-parts that\n are in parentheses. This is a list of all these submatches. This is kind of\n garbage to use, and using a package like [`elm/parser`][parser] is\n probably easier.\n\n[sub]: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions#Using_Parenthesized_Substring_Matches\n[parser]: /packages/elm/parser/latest\n\n","args":[],"type":"{ match : String.String, index : Basics.Int, number : Basics.Int, submatches : List.List (Maybe.Maybe String.String) }"},{"name":"Options","comment":"","args":[],"type":"{ caseInsensitive : Basics.Bool, multiline : Basics.Bool }"}],"values":[{"name":"contains","comment":" Check to see if a Regex is contained in a string.\n\n import Regex\n\n digit : Regex.Regex\n digit =\n Maybe.withDefault Regex.never <|\n Regex.fromString \"[0-9]\"\n\n -- Regex.contains digit \"abc123\" == True\n -- Regex.contains digit \"abcxyz\" == False\n","type":"Regex.Regex -> String.String -> Basics.Bool"},{"name":"find","comment":" Find matches in a string:\n\n import Regex\n\n location : Regex.Regex\n location =\n Maybe.withDefault Regex.never <|\n Regex.fromString \"[oi]n a (\\\\w+)\"\n\n places : List Regex.Match\n places =\n Regex.find location \"I am on a boat in a lake.\"\n\n -- map .match places == [ \"on a boat\", \"in a lake\" ]\n -- map .submatches places == [ [Just \"boat\"], [Just \"lake\"] ]\n\nIf you need `submatches` for some reason, a library like\n[`elm/parser`][parser] will probably lead to better code in the long run.\n\n[parser]: /packages/elm/parser/latest\n","type":"Regex.Regex -> String.String -> List.List Regex.Match"},{"name":"findAtMost","comment":" Just like `find` but it stops after some number of matches.\n\nA library like [`elm/parser`][parser] will probably lead to better code in\nthe long run.\n\n[parser]: /packages/elm/parser/latest\n","type":"Basics.Int -> Regex.Regex -> String.String -> List.List Regex.Match"},{"name":"fromString","comment":" Try to create a `Regex`. Not all strings are valid though, so you get a\n`Maybe' back. This means you can safely accept input from users.\n\n import Regex\n\n lowerCase : Regex.Regex\n lowerCase =\n Maybe.withDefault Regex.never <|\n Regex.fromString \"[a-z]+\"\n\n**Note:** There are some [shorthand character classes][short] like `\\w` for\nword characters, `\\s` for whitespace characters, and `\\d` for digits. **Make\nsure they are properly escaped!** If you specify them directly in your code,\nthey would look like `\"\\\\w\\\\s\\\\d\"`.\n\n[short]: https://www.regular-expressions.info/shorthand.html\n","type":"String.String -> Maybe.Maybe Regex.Regex"},{"name":"fromStringWith","comment":" Create a `Regex` with some additional options. For example, you can define\n`fromString` like this:\n\n import Regex\n\n fromString : String -> Maybe Regex.Regex\n fromString string =\n fromStringWith { caseInsensitive = False, multiline = False } string\n\n","type":"Regex.Options -> String.String -> Maybe.Maybe Regex.Regex"},{"name":"never","comment":" A regular expression that never matches any string.\n","type":"Regex.Regex"},{"name":"replace","comment":" Replace matches. The function from `Match` to `String` lets\nyou use the details of a specific match when making replacements.\n\n import Regex\n\n userReplace : String -> (Regex.Match -> String) -> String -> String\n userReplace userRegex replacer string =\n case Regex.fromString userRegex of\n Nothing ->\n string\n\n Just regex ->\n Regex.replace regex replacer string\n\n devowel : String -> String\n devowel string =\n userReplace \"[aeiou]\" (\\_ -> \"\") string\n\n -- devowel \"The quick brown fox\" == \"Th qck brwn fx\"\n\n reverseWords : String -> String\n reverseWords string =\n userReplace \"\\\\w+\" (.match >> String.reverse) string\n\n -- reverseWords \"deliver mined parts\" == \"reviled denim strap\"\n","type":"Regex.Regex -> (Regex.Match -> String.String) -> String.String -> String.String"},{"name":"replaceAtMost","comment":" Just like `replace` but it stops after some number of matches.\n\nA library like [`elm/parser`][parser] will probably lead to better code in\nthe long run.\n\n[parser]: /packages/elm/parser/latest\n","type":"Basics.Int -> Regex.Regex -> (Regex.Match -> String.String) -> String.String -> String.String"},{"name":"split","comment":" Split a string. The following example will split on commas and tolerate\nwhitespace on either side of the comma:\n\n import Regex\n\n comma : Regex.Regex\n comma =\n Maybe.withDefault Regex.never <|\n Regex.fromString \" *, *\"\n\n -- Regex.split comma \"tom,99,90,85\" == [\"tom\",\"99\",\"90\",\"85\"]\n -- Regex.split comma \"tom, 99, 90, 85\" == [\"tom\",\"99\",\"90\",\"85\"]\n -- Regex.split comma \"tom , 99, 90, 85\" == [\"tom\",\"99\",\"90\",\"85\"]\n\nIf you want some really fancy splits, a library like\n[`elm/parser`][parser] will probably be easier to use.\n\n[parser]: /packages/elm/parser/latest\n","type":"Regex.Regex -> String.String -> List.List String.String"},{"name":"splitAtMost","comment":" Just like `split` but it stops after some number of matches.\n\nA library like [`elm/parser`][parser] will probably lead to better code in\nthe long run.\n\n[parser]: /packages/elm/parser/latest\n","type":"Basics.Int -> Regex.Regex -> String.String -> List.List String.String"}],"binops":[]}]
@@ -1,30 +0,0 @@
1
- Copyright (c) 2014-present, Evan Czaplicki
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright
9
- notice, this list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above
12
- copyright notice, this list of conditions and the following
13
- disclaimer in the documentation and/or other materials provided
14
- with the distribution.
15
-
16
- * Neither the name of Evan Czaplicki nor the names of other
17
- contributors may be used to endorse or promote products derived
18
- from this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,62 +0,0 @@
1
- # SVG in Elm
2
-
3
- Scalable vector graphics (SVG) is a way to display lines, rectangles, circles, arcs, etc.
4
-
5
- The API is a bit wonky, but (1) it is manageable if you look through MDN docs like [these](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect) and (2) you can attach event listeners to any shapes and lines you create!
6
-
7
-
8
- ## Example
9
-
10
- ```elm
11
- import Svg exposing (..)
12
- import Svg.Attributes exposing (..)
13
-
14
- main =
15
- svg
16
- [ width "120"
17
- , height "120"
18
- , viewBox "0 0 120 120"
19
- ]
20
- [ rect
21
- [ x "10"
22
- , y "10"
23
- , width "100"
24
- , height "100"
25
- , rx "15"
26
- , ry "15"
27
- ]
28
- []
29
- , circle
30
- [ cx "50"
31
- , cy "50"
32
- , r "50"
33
- ]
34
- []
35
- ]
36
- ```
37
-
38
- I highly recommend consulting the MDN docs on SVG to learn how to draw various shapes!
39
-
40
-
41
- ## Make visualizations!
42
-
43
- SVG is great for data visualizations, and I really want people in the Elm community to explore more in that direction! My instinct is that functions like `view : data -> Svg msg` will be way easier to work with than what is available in other languages. Just give the data! No need to have data and interaction deeply interwoven in complex ways.
44
-
45
- ### Make visualization packages?
46
-
47
- I think [`terezka/line-charts`](https://terezka.github.io/line-charts/) is a really great effort in this direction. Notice that [the docs](https://package.elm-lang.org/packages/terezka/line-charts/1.0.0/LineChart) present a really smooth learning path. Getting something on screen is really simple, and then it builds on that basic understanding to give you more capabilities. There are tons of examples as well. I really love seeing work like this!
48
-
49
- So if you are interested in doing something like this, I recommend:
50
-
51
- - Reading [The Visual Display of Quantitative Information](https://www.edwardtufte.com/tufte/books_vdqi) by Edward Tufte.
52
- - Learning about [designing for color blindness](https://www.alanzucconi.com/2015/12/16/color-blindness/)
53
- - Learning about different color spaces, like [CIELUV](https://en.wikipedia.org/wiki/CIELUV) for changing colors without changing the perceived brightness, [cubehelix](https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/) for heatmaps with nice brightness properties, and how to do [color conversions](https://www.cs.rit.edu/~ncs/color/t_convert.html) in general
54
-
55
- In other words, try to learn as much as possible first! Anyone can show dots on a grid, but a great package will build expertise into the API itself, quietly leading people towards better design and accessibility. Ideally it will help people learn the important principles as well, because it is not just about getting data on screen, it is about helping people understand complex information!
56
-
57
-
58
- ## Future Plans
59
-
60
- This package should only change to account for new SVG tags and attributes.
61
-
62
- Just like [`elm/html`](https://package.elm-lang.org/packages/elm/html/latest), this package is designed to be predictable. Every node takes two arguments (a list of attributes and a list of children) even though in many cases it is possible to do something nicer. So if you want nice helpers for simple shapes (for example) I recommend creating a separate package that builds upon this one.
@@ -1 +0,0 @@
1
- [{"name":"Svg","comment":"\n\n# SVG Nodes\n@docs Svg, Attribute, text, node, map\n\n# HTML Embedding\n@docs svg, foreignObject\n\n# Graphics elements\n@docs circle, ellipse, image, line, path, polygon, polyline, rect, use\n\n# Animation elements\n@docs animate, animateColor, animateMotion, animateTransform, mpath, set\n\n# Descriptive elements\n@docs desc, metadata, title\n\n# Containers\n@docs a, defs, g, marker, mask, pattern, switch, symbol\n\n# Text\n@docs altGlyph, altGlyphDef, altGlyphItem, glyph, glyphRef, textPath, text_,\n tref, tspan\n\n# Fonts\n@docs font\n\n# Gradients\n@docs linearGradient, radialGradient, stop\n\n# Filters\n@docs feBlend, feColorMatrix, feComponentTransfer, feComposite,\n feConvolveMatrix, feDiffuseLighting, feDisplacementMap, feFlood, feFuncA,\n feFuncB, feFuncG, feFuncR, feGaussianBlur, feImage, feMerge, feMergeNode,\n feMorphology, feOffset, feSpecularLighting, feTile, feTurbulence\n\n# Light source elements\n@docs feDistantLight, fePointLight, feSpotLight\n\n# Miscellaneous\n@docs clipPath, colorProfile, cursor, filter, style, view\n","unions":[],"aliases":[{"name":"Attribute","comment":" Set attributes on your `Svg`.\n","args":["msg"],"type":"VirtualDom.Attribute msg"},{"name":"Svg","comment":" The core building block to create SVG. This library is filled with helper\nfunctions to create these `Svg` values.\n\nThis is backed by `VirtualDom.Node` in `evancz/virtual-dom`, but you do not\nneed to know any details about that to use this library!\n","args":["msg"],"type":"VirtualDom.Node msg"}],"values":[{"name":"a","comment":" The SVG Anchor Element defines a hyperlink.\n","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"altGlyph","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"altGlyphDef","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"altGlyphItem","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"animate","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"animateColor","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"animateMotion","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"animateTransform","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"circle","comment":" The circle element is an SVG basic shape, used to create circles based on\na center point and a radius.\n\n circle [ cx \"60\", cy \"60\", r \"50\" ] []\n","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"clipPath","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"colorProfile","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"cursor","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"defs","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"desc","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"ellipse","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feBlend","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feColorMatrix","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feComponentTransfer","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feComposite","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feConvolveMatrix","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feDiffuseLighting","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feDisplacementMap","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feDistantLight","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feFlood","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feFuncA","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feFuncB","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feFuncG","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feFuncR","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feGaussianBlur","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feImage","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feMerge","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feMergeNode","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feMorphology","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feOffset","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"fePointLight","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feSpecularLighting","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feSpotLight","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feTile","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"feTurbulence","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"filter","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"font","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"foreignObject","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Html.Html msg) -> Svg.Svg msg"},{"name":"g","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"glyph","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"glyphRef","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"image","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"line","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"linearGradient","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"map","comment":" Transform the messages produced by some `Svg`.\n","type":"(a -> msg) -> Svg.Svg a -> Svg.Svg msg"},{"name":"marker","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"mask","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"metadata","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"mpath","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"node","comment":" Create any SVG node. To create a `<rect>` helper function, you would write:\n\n rect : List (Attribute msg) -> List (Svg msg) -> Svg msg\n rect attributes children =\n node \"rect\" attributes children\n\nYou should always be able to use the helper functions already defined in this\nlibrary though!\n","type":"String.String -> List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"path","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"pattern","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"polygon","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"polyline","comment":" The polyline element is an SVG basic shape, used to create a series of\nstraight lines connecting several points. Typically a polyline is used to\ncreate open shapes.\n\n polyline [ fill \"none\", stroke \"black\", points \"20,100 40,60 70,80 100,20\" ] []\n","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"radialGradient","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"rect","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"set","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"stop","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"style","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"svg","comment":" The root `<svg>` node for any SVG scene. This example shows a scene\ncontaining a rounded rectangle:\n\n import Svg exposing (..)\n import Svg.Attributes exposing (..)\n\n roundRect =\n svg\n [ width \"120\", height \"120\", viewBox \"0 0 120 120\" ]\n [ rect [ x \"10\", y \"10\", width \"100\", height \"100\", rx \"15\", ry \"15\" ] [] ]\n","type":"List.List (Html.Attribute msg) -> List.List (Svg.Svg msg) -> Html.Html msg"},{"name":"switch","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"symbol","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"text","comment":" A simple text node, no tags at all.\n\nWarning: not to be confused with `text_` which produces the SVG `<text>` tag!\n","type":"String.String -> Svg.Svg msg"},{"name":"textPath","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"text_","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"title","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"tref","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"tspan","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"use","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"},{"name":"view","comment":"","type":"List.List (Svg.Attribute msg) -> List.List (Svg.Svg msg) -> Svg.Svg msg"}],"binops":[]},{"name":"Svg.Attributes","comment":"\n\n# Regular attributes\n@docs accentHeight, accelerate, accumulate, additive, alphabetic, allowReorder,\n amplitude, arabicForm, ascent, attributeName, attributeType, autoReverse,\n azimuth, baseFrequency, baseProfile, bbox, begin, bias, by, calcMode,\n capHeight, class, clipPathUnits, contentScriptType, contentStyleType, cx, cy,\n d, decelerate, descent, diffuseConstant, divisor, dur, dx, dy, edgeMode,\n elevation, end, exponent, externalResourcesRequired, filterRes, filterUnits,\n format, from, fx, fy, g1, g2, glyphName, glyphRef, gradientTransform,\n gradientUnits, hanging, height, horizAdvX, horizOriginX, horizOriginY, id,\n ideographic, in_, in2, intercept, k, k1, k2, k3, k4, kernelMatrix,\n kernelUnitLength, keyPoints, keySplines, keyTimes, lang, lengthAdjust,\n limitingConeAngle, local, markerHeight, markerUnits, markerWidth,\n maskContentUnits, maskUnits, mathematical, max, media, method, min, mode,\n name, numOctaves, offset, operator, order, orient, orientation, origin,\n overlinePosition, overlineThickness, panose1, path, pathLength,\n patternContentUnits, patternTransform, patternUnits, pointOrder, points,\n pointsAtX, pointsAtY, pointsAtZ, preserveAlpha, preserveAspectRatio,\n primitiveUnits, r, radius, refX, refY, renderingIntent, repeatCount,\n repeatDur, requiredExtensions, requiredFeatures, restart, result, rotate,\n rx, ry, scale, seed, slope, spacing, specularConstant, specularExponent,\n speed, spreadMethod, startOffset, stdDeviation, stemh, stemv, stitchTiles,\n strikethroughPosition, strikethroughThickness, string, style, surfaceScale,\n systemLanguage, tableValues, target, targetX, targetY, textLength, title, to,\n transform, type_, u1, u2, underlinePosition, underlineThickness, unicode,\n unicodeRange, unitsPerEm, vAlphabetic, vHanging, vIdeographic, vMathematical,\n values, version, vertAdvY, vertOriginX, vertOriginY, viewBox, viewTarget,\n width, widths, x, xHeight, x1, x2, xChannelSelector, xlinkActuate,\n xlinkArcrole, xlinkHref, xlinkRole, xlinkShow, xlinkTitle, xlinkType,\n xmlBase, xmlLang, xmlSpace, y, y1, y2, yChannelSelector, z, zoomAndPan\n\n# Presentation attributes\n@docs alignmentBaseline, baselineShift, clipPath, clipRule, clip,\n colorInterpolationFilters, colorInterpolation, colorProfile, colorRendering,\n color, cursor, direction, display, dominantBaseline, enableBackground,\n fillOpacity, fillRule, fill, filter, floodColor, floodOpacity, fontFamily,\n fontSizeAdjust, fontSize, fontStretch, fontStyle, fontVariant, fontWeight,\n glyphOrientationHorizontal, glyphOrientationVertical, imageRendering,\n kerning, letterSpacing, lightingColor, markerEnd, markerMid, markerStart,\n mask, opacity, overflow, pointerEvents, shapeRendering, stopColor,\n stopOpacity, strokeDasharray, strokeDashoffset, strokeLinecap,\n strokeLinejoin, strokeMiterlimit, strokeOpacity, strokeWidth, stroke,\n textAnchor, textDecoration, textRendering, unicodeBidi, visibility,\n wordSpacing, writingMode\n\n","unions":[],"aliases":[],"values":[{"name":"accelerate","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"accentHeight","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"accumulate","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"additive","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"alignmentBaseline","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"allowReorder","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"alphabetic","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"amplitude","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"arabicForm","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"ascent","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"attributeName","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"attributeType","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"autoReverse","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"azimuth","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"baseFrequency","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"baseProfile","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"baselineShift","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"bbox","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"begin","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"bias","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"by","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"calcMode","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"capHeight","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"class","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"clip","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"clipPath","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"clipPathUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"clipRule","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"color","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"colorInterpolation","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"colorInterpolationFilters","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"colorProfile","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"colorRendering","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"contentScriptType","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"contentStyleType","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"cursor","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"cx","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"cy","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"d","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"decelerate","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"descent","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"diffuseConstant","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"direction","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"display","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"divisor","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"dominantBaseline","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"dur","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"dx","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"dy","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"edgeMode","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"elevation","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"enableBackground","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"end","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"exponent","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"externalResourcesRequired","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fill","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fillOpacity","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fillRule","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"filter","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"filterRes","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"filterUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"floodColor","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"floodOpacity","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontFamily","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontSize","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontSizeAdjust","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontStretch","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontStyle","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontVariant","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fontWeight","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"format","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"from","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fx","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"fy","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"g1","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"g2","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"glyphName","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"glyphOrientationHorizontal","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"glyphOrientationVertical","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"glyphRef","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"gradientTransform","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"gradientUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"hanging","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"height","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"horizAdvX","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"horizOriginX","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"horizOriginY","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"id","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"ideographic","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"imageRendering","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"in2","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"in_","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"intercept","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"k","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"k1","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"k2","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"k3","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"k4","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"kernelMatrix","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"kernelUnitLength","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"kerning","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"keyPoints","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"keySplines","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"keyTimes","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"lang","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"lengthAdjust","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"letterSpacing","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"lightingColor","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"limitingConeAngle","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"local","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"markerEnd","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"markerHeight","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"markerMid","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"markerStart","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"markerUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"markerWidth","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"mask","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"maskContentUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"maskUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"mathematical","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"max","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"media","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"method","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"min","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"mode","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"name","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"numOctaves","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"offset","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"opacity","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"operator","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"order","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"orient","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"orientation","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"origin","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"overflow","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"overlinePosition","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"overlineThickness","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"panose1","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"path","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"pathLength","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"patternContentUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"patternTransform","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"patternUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"pointOrder","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"pointerEvents","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"points","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"pointsAtX","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"pointsAtY","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"pointsAtZ","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"preserveAlpha","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"preserveAspectRatio","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"primitiveUnits","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"r","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"radius","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"refX","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"refY","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"renderingIntent","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"repeatCount","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"repeatDur","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"requiredExtensions","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"requiredFeatures","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"restart","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"result","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"rotate","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"rx","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"ry","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"scale","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"seed","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"shapeRendering","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"slope","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"spacing","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"specularConstant","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"specularExponent","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"speed","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"spreadMethod","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"startOffset","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stdDeviation","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stemh","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stemv","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stitchTiles","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stopColor","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stopOpacity","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strikethroughPosition","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strikethroughThickness","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"string","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"stroke","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeDasharray","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeDashoffset","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeLinecap","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeLinejoin","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeMiterlimit","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeOpacity","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"strokeWidth","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"style","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"surfaceScale","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"systemLanguage","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"tableValues","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"target","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"targetX","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"targetY","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"textAnchor","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"textDecoration","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"textLength","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"textRendering","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"title","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"to","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"transform","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"type_","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"u1","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"u2","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"underlinePosition","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"underlineThickness","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"unicode","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"unicodeBidi","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"unicodeRange","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"unitsPerEm","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vAlphabetic","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vHanging","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vIdeographic","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vMathematical","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"values","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"version","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vertAdvY","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vertOriginX","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"vertOriginY","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"viewBox","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"viewTarget","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"visibility","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"width","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"widths","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"wordSpacing","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"writingMode","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"x","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"x1","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"x2","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xChannelSelector","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xHeight","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkActuate","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkArcrole","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkHref","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkRole","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkShow","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkTitle","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xlinkType","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xmlBase","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xmlLang","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"xmlSpace","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"y","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"y1","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"y2","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"yChannelSelector","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"z","comment":"","type":"String.String -> Svg.Attribute msg"},{"name":"zoomAndPan","comment":"","type":"String.String -> Svg.Attribute msg"}],"binops":[]},{"name":"Svg.Events","comment":"\n\n# Mouse\n@docs onClick, onMouseDown, onMouseUp, onMouseOver, onMouseOut\n\n# Custom\n@docs on, stopPropagationOn, preventDefaultOn, custom\n\n","unions":[],"aliases":[],"values":[{"name":"custom","comment":" Create an event listener that may [`stopPropagation`][stop] or\n[`preventDefault`][prevent].\n\n[stop]: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation\n[prevent]: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault\n\n**Note:** If you need something even more custom (like capture phase) check\nout the lower-level event API in `elm/virtual-dom`.\n","type":"String.String -> Json.Decode.Decoder { message : msg, stopPropagation : Basics.Bool, preventDefault : Basics.Bool } -> Svg.Attribute msg"},{"name":"on","comment":" Create a custom event listener. Normally this will not be necessary, but\nyou have the power! Here is how `onClick` is defined for example:\n\n import Json.Decode as Decode\n\n onClick : msg -> Attribute msg\n onClick message =\n on \"click\" (Decode.succeed message)\n\nThe first argument is the event name in the same format as with JavaScript's\n[`addEventListener`][aEL] function.\n\nThe second argument is a JSON decoder. Read more about these [here][decoder].\nWhen an event occurs, the decoder tries to turn the event object into an Elm\nvalue. If successful, the value is routed to your `update` function. In the\ncase of `onClick` we always just succeed with the given `message`.\n\nIf this is confusing, work through the [Elm Architecture Tutorial][tutorial].\nIt really helps!\n\n[aEL]: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n[decoder]: /packages/elm/json/latest/Json-Decode\n[tutorial]: https://github.com/evancz/elm-architecture-tutorial/\n\n**Note:** This creates a [passive][] event listener, enabling optimizations for\ntouch, scroll, and wheel events in some browsers.\n\n[passive]: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n","type":"String.String -> Json.Decode.Decoder msg -> Svg.Attribute msg"},{"name":"onClick","comment":"","type":"msg -> Svg.Attribute msg"},{"name":"onMouseDown","comment":"","type":"msg -> Svg.Attribute msg"},{"name":"onMouseOut","comment":"","type":"msg -> Svg.Attribute msg"},{"name":"onMouseOver","comment":"","type":"msg -> Svg.Attribute msg"},{"name":"onMouseUp","comment":"","type":"msg -> Svg.Attribute msg"},{"name":"preventDefaultOn","comment":" Create an event listener that may [`preventDefault`][prevent]. Your decoder\nmust produce a message and a `Bool` that decides if `preventDefault` should\nbe called.\n\nFor example, the `onSubmit` function in this library *always* prevents the\ndefault behavior:\n\n[prevent]: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault\n\n onSubmit : msg -> Attribute msg\n onSubmit msg =\n preventDefaultOn \"submit\" (Json.map alwaysPreventDefault (Json.succeed msg))\n\n alwaysPreventDefault : msg -> ( msg, Bool )\n alwaysPreventDefault msg =\n ( msg, True )\n","type":"String.String -> Json.Decode.Decoder ( msg, Basics.Bool ) -> Svg.Attribute msg"},{"name":"stopPropagationOn","comment":" Create an event listener that may [`stopPropagation`][stop]. Your decoder\nmust produce a message and a `Bool` that decides if `stopPropagation` should\nbe called.\n\n[stop]: https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation\n\n**Note:** This creates a [passive][] event listener, enabling optimizations for\ntouch, scroll, and wheel events in some browsers.\n\n[passive]: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n","type":"String.String -> Json.Decode.Decoder ( msg, Basics.Bool ) -> Svg.Attribute msg"}],"binops":[]},{"name":"Svg.Keyed","comment":" A keyed node helps optimize cases where children are getting added, moved,\nremoved, etc. Common examples include:\n\n - The user can delete items from a list.\n - The user can create new items in a list.\n - You can sort a list based on name or date or whatever.\n\nWhen you use a keyed node, every child is paired with a string identifier. This\nmakes it possible for the underlying diffing algorithm to reuse nodes more\nefficiently.\n\n# Keyed Nodes\n@docs node\n\n","unions":[],"aliases":[],"values":[{"name":"node","comment":" Works just like `Svg.node`, but you add a unique identifier to each child\nnode. You want this when you have a list of nodes that is changing: adding\nnodes, removing nodes, etc. In these cases, the unique identifiers help make\nthe DOM modifications more efficient.\n","type":"String.String -> List.List (Svg.Attribute msg) -> List.List ( String.String, Svg.Svg msg ) -> Svg.Svg msg"}],"binops":[]},{"name":"Svg.Lazy","comment":" Since all Elm functions are pure we have a guarantee that the same input\nwill always result in the same output. This module gives us tools to be lazy\nabout building `Svg` that utilize this fact.\n\nRather than immediately applying functions to their arguments, the `lazy`\nfunctions just bundle the function and arguments up for later. When diffing\nthe old and new virtual DOM, it checks to see if all the arguments are equal.\nIf so, it skips calling the function!\n\nThis is a really cheap test and often makes things a lot faster, but definitely\nbenchmark to be sure!\n\n@docs lazy, lazy2, lazy3, lazy4, lazy5, lazy6, lazy7, lazy8\n","unions":[],"aliases":[],"values":[{"name":"lazy","comment":" A performance optimization that delays the building of virtual DOM nodes.\n\nCalling `(view model)` will definitely build some virtual DOM, perhaps a lot of\nit. Calling `(lazy view model)` delays the call until later. During diffing, we\ncan check to see if `model` is referentially equal to the previous value used,\nand if so, we just stop. No need to build up the tree structure and diff it,\nwe know if the input to `view` is the same, the output must be the same!\n","type":"(a -> Svg.Svg msg) -> a -> Svg.Svg msg"},{"name":"lazy2","comment":" Same as `lazy` but checks on two arguments.\n","type":"(a -> b -> Svg.Svg msg) -> a -> b -> Svg.Svg msg"},{"name":"lazy3","comment":" Same as `lazy` but checks on three arguments.\n","type":"(a -> b -> c -> Svg.Svg msg) -> a -> b -> c -> Svg.Svg msg"},{"name":"lazy4","comment":" Same as `lazy` but checks on four arguments.\n","type":"(a -> b -> c -> d -> Svg.Svg msg) -> a -> b -> c -> d -> Svg.Svg msg"},{"name":"lazy5","comment":" Same as `lazy` but checks on five arguments.\n","type":"(a -> b -> c -> d -> e -> Svg.Svg msg) -> a -> b -> c -> d -> e -> Svg.Svg msg"},{"name":"lazy6","comment":" Same as `lazy` but checks on six arguments.\n","type":"(a -> b -> c -> d -> e -> f -> Svg.Svg msg) -> a -> b -> c -> d -> e -> f -> Svg.Svg msg"},{"name":"lazy7","comment":" Same as `lazy` but checks on seven arguments.\n","type":"(a -> b -> c -> d -> e -> f -> g -> Svg.Svg msg) -> a -> b -> c -> d -> e -> f -> g -> Svg.Svg msg"},{"name":"lazy8","comment":" Same as `lazy` but checks on eight arguments.\n","type":"(a -> b -> c -> d -> e -> f -> g -> h -> Svg.Svg msg) -> a -> b -> c -> d -> e -> f -> g -> h -> Svg.Svg msg"}],"binops":[]}]
@@ -1,30 +0,0 @@
1
- Copyright (c) 2018-present, Evan Czaplicki
2
-
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright
9
- notice, this list of conditions and the following disclaimer.
10
-
11
- * Redistributions in binary form must reproduce the above
12
- copyright notice, this list of conditions and the following
13
- disclaimer in the documentation and/or other materials provided
14
- with the distribution.
15
-
16
- * Neither the name of Evan Czaplicki nor the names of other
17
- contributors may be used to endorse or promote products derived
18
- from this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,94 +0,0 @@
1
- # Time
2
-
3
- To work with time successfully in programming, we need three different concepts:
4
-
5
- - **Human Time** &mdash; This is what you see on clocks (8am) or on calendars (May 3rd). Great! But if my phone call is at 8am in Boston, what time is it for my friend in Vancouver? If it is at 8am in Tokyo, is that even the same day in New York? (No!) So between [time zones][tz] based on ever-changing political boundaries and inconsistent use of [daylight saving time][dst], human time should basically never be stored in your `Model` or database! It is only for display!
6
-
7
- - **POSIX Time** &mdash; With POSIX time, it does not matter where you live or what time of year it is. It is just the number of seconds elapsed since some arbitrary moment (in 1970). Everywhere you go on Earth, POSIX time is the same.
8
-
9
- - **Time Zones** &mdash; A “time zone” is a bunch of data that allows you to turn POSIX time into human time. This is _not_ just `UTC-7` or `UTC+3` though! Time zones are way more complicated than a simple offset! Every time [Florida switches to DST forever][florida] or [Samoa switches from UTC-11 to UTC+13][samoa], some poor soul adds a note to the [IANA time zone database][iana]. That database is loaded onto every computer, and between POSIX time and all the corner cases in the database, we can figure out human times!
10
-
11
- [tz]: https://en.wikipedia.org/wiki/Time_zone
12
- [dst]: https://en.wikipedia.org/wiki/Daylight_saving_time
13
- [iana]: https://en.wikipedia.org/wiki/IANA_time_zone_database
14
- [samoa]: https://en.wikipedia.org/wiki/Time_in_Samoa
15
- [florida]: https://www.npr.org/sections/thetwo-way/2018/03/08/591925587/
16
-
17
- So to show a human being a time, you must always know **the POSIX time** and **their time zone**. That is it. So all that “human time” stuff is for your `view` function, not your `Model`.
18
-
19
-
20
- ## Example
21
-
22
- To figure out a human time, you need to ask two questions: (1) what POSIX time is it? and (2) what time zone am I in? Once you have that, you can decide how to show it on screen:
23
-
24
- ```elm
25
- import Time exposing (utc, toHour, toMinute, toSecond)
26
-
27
- toUtcString : Time.Posix -> String
28
- toUtcString time =
29
- String.fromInt (toHour utc time)
30
- ++ ":" ++
31
- String.fromInt (toMinute utc time)
32
- ++ ":" ++
33
- String.fromInt (toSecond utc time)
34
- ++ " (UTC)"
35
- ```
36
-
37
- Notice that we provide the `utc` time zone to `toHour` and `toMinute`!
38
-
39
- Go [here](https://elm-lang.org/examples/time) for a little example application that uses time. It can help you get everything hooked up in practice!
40
-
41
-
42
- ## Recurring Events
43
-
44
- A lot of programmers need to handle recurring events. This meeting repeats every Monday. This event is the first Wednesday of each month. And there are always exceptions where a recurring event gets moved! **Using human time does not solve this!**
45
-
46
- To properly handle recurring events, you need to create a custom `type` for your particular problem. Say you want to model a weekly event:
47
-
48
- ```elm
49
- import Time
50
-
51
- type alias WeeklyEvent =
52
- { weekday : Time.Weekday -- which day is it on
53
- , hour : Int -- at what hour?
54
- , zone : Time.Zone -- what time zone is that hour in?
55
- , start : Time.Posix -- when was the first event?
56
- , exceptions : List (Int, Maybe Event) -- are there any skips?
57
- }
58
- ```
59
-
60
- The first two fields (`weekday` and `hour`) are the most straight forward. You gotta know what day and what time! But that is not enough information for people in different time zones. Tom created the recurring event for hour 16, but how do I show that in Tokyo or New York? Or even in Tom’s location?! The `zone` lets us pin `weekday` and `hour` to a specific POSIX time, so we can show it elsewhere.
61
-
62
- Great! But what about shifting the meeting by one day for a holiday? Well, if you define a `start` time, you can store `exceptions` as offsets from the first ever event. So if _only_ the third event was cancelled, you could store `[ (3, Nothing) ]` which would say “ignore the third event, and do not replace it with some other specific event.”
63
-
64
- ### Implications
65
-
66
- Now the particular kinds of recurring events _you_ need are specific to _your_ application. Weekly? Monthly? Always has start and end of range? Allows exceptions? I am not convinced that a generic design is possible for all scenarios, but maybe with further exploration, we will find that it is.
67
-
68
- **So if you need recurring events, you have to model them yourself.** There is no shortcut. Putting May 3rd in your `Model` is not gonna do it. It is a trap. Thinking in human time is always a trap!
69
-
70
-
71
- ## ISO 8601
72
-
73
- [ISO 8601][8601] is not supported by this package because:
74
-
75
- > The ISO 8601 format has lead to a great deal of confusion. Specifically because it gives the _illusion_ that it can handle time zones. It cannot! It allows you to specify an offset from UTC like `-05:00`, but is that a time in Quebec, Miami, Cuba, or Equador? Are they doing daylight saving time right now?
76
- >
77
- > Point is, **the only thing ISO 8601 is good for is representing a `Time.Posix`, but less memory efficient and more confusing.** So I recommend using `Time.posixToMillis` and `Time.millisToPosix` for any client/server communication you control.
78
-
79
- That said, many endpoints use ISO 8601 for some reason, and it can therefore be quite useful in practice. I think the community should make some packages that define `fromIso8601 : String -> Maybe Time.Posix` in Elm. People can use `elm/parser` to make a fancy implementation, but maybe there is some faster or smaller implementation possible with `String.split` and such. Folks should experiment, and later on, we can revisit if any of them belong in this library.
80
-
81
- [8601]: https://en.wikipedia.org/wiki/ISO_8601
82
-
83
-
84
- ## Future Plans
85
-
86
- Right now this library gives basic `Posix` and `Zone` functions, but there are a couple important things it does not cover right now:
87
-
88
- 1. How do I get _my_ time zone?
89
- 2. How do I get another time zone by name?
90
- 3. How do I display a time for a specific region? (e.g. `DD/MM/YYYY` vs `MM/DD/YYYY`)
91
-
92
- I think points (2) and (3) should be explored by the community before we add anything here. Maybe we can have a package that hard codes the IANA time zone database? Maybe we can have a package that provides HTTP requests to ask for specific time zone data? Etc.
93
-
94
- **Note:** If you make progress that potentially needs coordination with other developers, **talk to people**. Present your work on [discourse](https://discourse.elm-lang.org/) to learn what the next steps might be. Is the idea good? Does it need more work? Are there other things to consider? Etc. Just opening an issue like “I totally redid the API” is not how we run things here, so focus on making a strong case through normal packages and friendly communication! And on timelines, we try to make one _great_ choice ever (not a _different_ choice every month) so things will take longer than in the JS world.
@@ -1 +0,0 @@
1
- [{"name":"Time","comment":" Library for working with time and time zones.\n\n# Time\n@docs Posix, now, every, posixToMillis, millisToPosix\n\n# Time Zones\n@docs Zone, utc, here\n\n# Human Times\n@docs toYear, toMonth, toDay, toWeekday, toHour, toMinute, toSecond, toMillis\n\n# Weeks and Months\n@docs Weekday, Month\n\n# For Package Authors\n@docs customZone, getZoneName, ZoneName\n\n","unions":[{"name":"Month","comment":" Represents a `Month` so that you can convert it to a `String` or `Int`\nhowever you please. For example, if you need the Danish representation, you\ncan say:\n\n toDanishMonth : Month -> String\n toDanishMonth month =\n case month of\n Jan -> \"januar\"\n Feb -> \"februar\"\n Mar -> \"marts\"\n Apr -> \"april\"\n May -> \"maj\"\n Jun -> \"juni\"\n Jul -> \"juli\"\n Aug -> \"august\"\n Sep -> \"september\"\n Oct -> \"oktober\"\n Nov -> \"november\"\n Dec -> \"december\"\n","args":[],"cases":[["Jan",[]],["Feb",[]],["Mar",[]],["Apr",[]],["May",[]],["Jun",[]],["Jul",[]],["Aug",[]],["Sep",[]],["Oct",[]],["Nov",[]],["Dec",[]]]},{"name":"Posix","comment":" A computer representation of time. It is the same all over Earth, so if we\nhave a phone call or meeting at a certain POSIX time, there is no ambiguity.\n\nIt is very hard for humans to _read_ a POSIX time though, so we use functions\nlike [`toHour`](#toHour) and [`toMinute`](#toMinute) to `view` them.\n","args":[],"cases":[]},{"name":"Weekday","comment":" Represents a `Weekday` so that you can convert it to a `String` or `Int`\nhowever you please. For example, if you need the Japanese representation, you\ncan say:\n\n toJapaneseWeekday : Weekday -> String\n toJapaneseWeekday weekday =\n case weekday of\n Mon -> \"月\"\n Tue -> \"火\"\n Wed -> \"水\"\n Thu -> \"木\"\n Fri -> \"金\"\n Sat -> \"土\"\n Sun -> \"日\"\n","args":[],"cases":[["Mon",[]],["Tue",[]],["Wed",[]],["Thu",[]],["Fri",[]],["Sat",[]],["Sun",[]]]},{"name":"Zone","comment":" Information about a particular time zone.\n\nThe [IANA Time Zone Database][iana] tracks things like UTC offsets and\ndaylight-saving rules so that you can turn a `Posix` time into local times\nwithin a time zone.\n\nSee [`utc`](#utc), [`here`](#here), and [`Browser.Env`][env] to learn how to\nobtain `Zone` values.\n\n[iana]: https://www.iana.org/time-zones\n[env]: /packages/elm/browser/latest/Browser#Env\n","args":[],"cases":[]},{"name":"ZoneName","comment":" **Intended for package authors.**\n\nThe `getZoneName` function relies on a JavaScript API that is not supported\nin all browsers yet, so it can return the following:\n\n -- in more recent browsers\n Name \"Europe/Moscow\"\n Name \"America/Havana\"\n\n -- in older browsers\n Offset 180\n Offset -300\n\nSo if the real info is not available, it will tell you the current UTC offset\nin minutes, just like what `here` uses to make zones like `customZone -60 []`.\n","args":[],"cases":[["Name",["String.String"]],["Offset",["Basics.Int"]]]}],"aliases":[],"values":[{"name":"customZone","comment":" **Intended for package authors.**\n\nThe documentation of [`here`](#here) explains that it has certain accuracy\nlimitations that block on adding new APIs to JavaScript. The `customZone`\nfunction is a stopgap that takes:\n\n1. A default offset in minutes. So `Etc/GMT-5` is `customZone (-5 * 60) []`\nand `Etc/GMT+9` is `customZone (9 * 60) []`.\n2. A list of exceptions containing their `start` time in \"minutes since the Unix\nepoch\" and their `offset` in \"minutes from UTC\"\n\nHuman times will be based on the nearest `start`, falling back on the default\noffset if the time is older than all of the exceptions.\n\nWhen paired with `getZoneName`, this allows you to load the real IANA time zone\ndatabase however you want: HTTP, cache, hardcode, etc.\n\n**Note:** If you use this, please share your work in an Elm community forum!\nI am sure others would like to hear about it, and more experience reports will\nhelp me and the any potential TC39 proposal.\n","type":"Basics.Int -> List.List { start : Basics.Int, offset : Basics.Int } -> Time.Zone"},{"name":"every","comment":" Get the current time periodically. How often though? Well, you provide an\ninterval in milliseconds (like `1000` for a second or `60 * 1000` for a minute\nor `60 * 60 * 1000` for an hour) and that is how often you get a new time!\n\nCheck out [this example](https://elm-lang.org/examples/time) to see how to use\nit in an application.\n\n**This function is not for animation.** Use the [`elm/animation-frame`][af]\npackage for that sort of thing! It syncs up with repaints and will end up\nbeing much smoother for any moving visuals.\n\n[af]: /packages/elm/animation-frame/latest\n","type":"Basics.Float -> (Time.Posix -> msg) -> Platform.Sub.Sub msg"},{"name":"getZoneName","comment":" **Intended for package authors.**\n\nUse `Intl.DateTimeFormat().resolvedOptions().timeZone` to try to get names\nlike `Europe/Moscow` or `America/Havana`. From there you can look it up in any\nIANA data you loaded yourself.\n","type":"Task.Task x Time.ZoneName"},{"name":"here","comment":" Produce a `Zone` based on the current UTC offset. You can use this to figure\nout what day it is where you are:\n\n import Task exposing (Task)\n import Time\n\n whatDayIsIt : Task x Int\n whatDayIsIt =\n Task.map2 Time.toDay Time.here Time.now\n\n**Accuracy Note:** This function can only give time zones like `Etc/GMT+9` or\n`Etc/GMT-6`. It cannot give you `Europe/Stockholm`, `Asia/Tokyo`, or any other\nnormal time zone from the [full list][tz] due to limitations in JavaScript.\nFor example, if you run `here` in New York City, the resulting `Zone` will\nnever be `America/New_York`. Instead you get `Etc/GMT-5` or `Etc/GMT-4`\ndepending on Daylight Saving Time. So even though browsers must have internal\naccess to `America/New_York` to figure out that offset, there is no public API\nto get the full information. This means the `Zone` you get from this function\nwill act weird if (1) an application stays open across a Daylight Saving Time\nboundary or (2) you try to use it on historical data.\n\n**Future Note:** We can improve `here` when there is good browser support for\nJavaScript functions that (1) expose the IANA time zone database and (2) let\nyou ask the time zone of the computer. The committee that reviews additions to\nJavaScript is called TC39, and I encourage you to push for these capabilities! I\ncannot do it myself unfortunately.\n\n**Alternatives:** See the `customZone` docs to learn how to implement stopgaps.\n\n[tz]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n","type":"Task.Task x Time.Zone"},{"name":"millisToPosix","comment":" Turn milliseconds into a `Posix` time.\n","type":"Basics.Int -> Time.Posix"},{"name":"now","comment":" Get the POSIX time at the moment when this task is run.\n","type":"Task.Task x Time.Posix"},{"name":"posixToMillis","comment":" Turn a `Posix` time into the number of milliseconds since 1970 January 1\nat 00:00:00 UTC. It was a Thursday.\n","type":"Time.Posix -> Basics.Int"},{"name":"toDay","comment":" What day is it?! (Days go from 1 to 31)\n\n import Time exposing (toDay, utc, millisToPosix)\n\n toDay utc (millisToPosix 0) == 1\n toDay nyc (millisToPosix 0) == 31\n\n -- pretend `nyc` is the `Zone` for America/New_York.\n\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toHour","comment":" What hour is it? (From 0 to 23)\n\n import Time exposing (toHour, utc, millisToPosix)\n\n toHour utc (millisToPosix 0) == 0 -- 12am\n toHour nyc (millisToPosix 0) == 19 -- 7pm\n\n -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toMillis","comment":"\n import Time exposing (toMillis, utc, millisToPosix)\n\n toMillis utc (millisToPosix 0) == 0\n toMillis utc (millisToPosix 1234) == 234\n toMillis utc (millisToPosix 5678) == 678\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toMinute","comment":" What minute is it? (From 0 to 59)\n\n import Time exposing (toMinute, utc, millisToPosix)\n\n toMinute utc (millisToPosix 0) == 0\n\nThis can be different in different time zones. Some time zones are offset\nby 30 or 45 minutes!\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toMonth","comment":" What month is it?!\n\n import Time exposing (toMonth, utc, millisToPosix)\n\n toMonth utc (millisToPosix 0) == Jan\n toMonth nyc (millisToPosix 0) == Dec\n\n -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Time.Month"},{"name":"toSecond","comment":" What second is it?\n\n import Time exposing (toSecond, utc, millisToPosix)\n\n toSecond utc (millisToPosix 0) == 0\n toSecond utc (millisToPosix 1234) == 1\n toSecond utc (millisToPosix 5678) == 5\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toWeekday","comment":" What day of the week is it?\n\n import Time exposing (toWeekday, utc, millisToPosix)\n\n toWeekday utc (millisToPosix 0) == Thu\n toWeekday nyc (millisToPosix 0) == Wed\n\n -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Time.Weekday"},{"name":"toYear","comment":" What year is it?!\n\n import Time exposing (toYear, utc, millisToPosix)\n\n toYear utc (millisToPosix 0) == 1970\n toYear nyc (millisToPosix 0) == 1969\n\n -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"utc","comment":" The time zone for Coordinated Universal Time ([UTC][])\n\nThe `utc` zone has no time adjustments. It never observes daylight-saving\ntime and it never shifts around based on political restructuring.\n\n[UTC]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time\n","type":"Time.Zone"}],"binops":[]}]
@@ -1,27 +0,0 @@
1
- Copyright (c) 2016, Evan Czaplicki
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
-
14
- * Neither the name of the {organization} nor the names of its
15
- contributors may be used to endorse or promote products derived from
16
- this software without specific prior written permission.
17
-
18
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,32 +0,0 @@
1
- # Work with URLs
2
-
3
- This package helps you (1) build new URLs and (2) parse existing URLs into nice Elm data structures.
4
-
5
- These tasks are quite common when building web apps in Elm with [`Browser.application`](https://package.elm-lang.org/packages/elm/browser/latest/Browser#application)!
6
-
7
-
8
- ## What is a URL?
9
-
10
- A URL is defined by Tim Berners-Lee in [this document](https://tools.ietf.org/html/rfc3986). It is worth reading, but I will try to share some highlights. He shares an example like this:
11
-
12
- ```
13
- https://example.com:8042/over/there?name=ferret#nose
14
- \___/ \______________/\_________/ \_________/ \__/
15
- | | | | |
16
- scheme authority path query fragment
17
- ```
18
-
19
- And here are some facts that I found surprising:
20
-
21
- - **ASCII** &mdash; The spec only talks about ASCII characters. Behavior with other encodings is unspecified, so if you use a UTF-8 character directly, it may be handled differently by browsers, packages, and servers! No one is wrong. It is just unspecified. So I would stick to ASCII to be safe.
22
- - **Escaping** &mdash; There are some reserved characters in the spec, like `/`, `?`, and `#`. So what happens when you need those in your query? The spec allows you to “escape” characters (`/` => `%2F`, `?` => `%3F`, `#` => `%23`) so it is clearly not a reserved characters anymore. The spec calls this [percent-encoding](https://tools.ietf.org/html/rfc3986#section-2.1). The basic idea is to look up the hex code in [the ASCII table](https://ascii.cl/) and put a `%` in front. There are many subtleties though, so I recommend reading [this](https://en.wikipedia.org/wiki/Percent-encoding) for more details!
23
-
24
- > **Note:** The difference between a URI and a URL is kind of subtle. [This post](https://danielmiessler.com/study/url-uri/) explains the difference nicely. I decided to call this library `elm/url` because it is primarily concerned with HTTP which does need actual locations.
25
-
26
-
27
- ## Related Work
28
-
29
- The API in `Url.Parser` is quite distinctive. I first saw the general idea in Chris Done&rsquo;s [formatting][] library. Based on that, Noah and I outlined the API you see in `Url.Parser`. Noah then found Rudi Grinberg&rsquo;s [post][] about type safe routing in OCaml. It was exactly what we were going for. We had even used the names `s` and `(</>)` in our draft API! In the end, we ended up using the “final encoding” of the EDSL that had been left as an exercise for the reader. Very fun to work through!
30
-
31
- [formatting]: https://chrisdone.com/posts/formatting
32
- [post]: http://rgrinberg.com/posts/primitive-type-safe-routing/