diff --git a/sketch/gleam.toml b/sketch/gleam.toml index 1de9fe8..02fa655 100644 --- a/sketch/gleam.toml +++ b/sketch/gleam.toml @@ -18,7 +18,7 @@ path = "sketch" [dependencies] gleam_erlang = ">= 0.25.0 and < 1.0.0" gleam_otp = ">= 0.10.0 and < 1.0.0" -gleam_stdlib = ">= 0.34.0 and < 1.0.0" +gleam_stdlib = ">= 0.42.0 and < 1.0.0" [dev-dependencies] birdie = ">= 1.2.5 and < 2.0.0" diff --git a/sketch/manifest.toml b/sketch/manifest.toml index 8ae63ca..e4df45e 100644 --- a/sketch/manifest.toml +++ b/sketch/manifest.toml @@ -35,5 +35,5 @@ packages = [ birdie = { version = ">= 1.2.5 and < 2.0.0" } gleam_erlang = { version = ">= 0.25.0 and < 1.0.0" } gleam_otp = { version = ">= 0.10.0 and < 1.0.0" } -gleam_stdlib = { version = ">= 0.34.0 and < 1.0.0" } +gleam_stdlib = { version = ">= 0.42.0 and < 1.0.0" } startest = { version = ">= 0.6.0 and < 1.0.0" } diff --git a/sketch/src/sketch.gleam b/sketch/src/sketch.gleam index 5302667..e1881e7 100644 --- a/sketch/src/sketch.gleam +++ b/sketch/src/sketch.gleam @@ -30,7 +30,7 @@ pub fn render(cache: StyleSheet) -> String { } @target(javascript) -/// Convert a `Class` to its class name, to use it anywhere in your application. +/// Converts a `Class` to its class name, to use it anywhere in your application. /// It always returns the StyleSheet, because the class can have been pushed /// in the StyleSheet itself. pub fn class_name(class: Class, stylesheet: StyleSheet) -> #(StyleSheet, String) { @@ -45,6 +45,8 @@ pub fn class_name(class: Class, stylesheet: StyleSheet) -> #(StyleSheet, String) } @target(javascript) +/// Pushes an `@rule` in the StyleSheet, to get it bundled in the outputted CSS. +/// It returns the StyleSheet with the rule added. pub fn at_rule(rule: AtRule, stylesheet: StyleSheet) -> StyleSheet { let cache = cache.at_rule(rule, stylesheet.cache) StyleSheet(..stylesheet, cache:) diff --git a/sketch/src/sketch/css.gleam b/sketch/src/sketch/css.gleam index bf64183..f069467 100644 --- a/sketch/src/sketch/css.gleam +++ b/sketch/src/sketch/css.gleam @@ -23,7 +23,7 @@ pub type Style = pub type Class = style.Class -/// Represents an at-rule. +/// Represents an [at-rule](https://developer.mozilla.org/docs/Web/CSS/At-rule). pub type AtRule = style.AtRule @@ -137,15 +137,15 @@ pub fn all(value: String) -> Style { /// --- /// /// This property is a shorthand for the following CSS properties: -/// [`animation-delay`](https://developer.mozilla.org/docs/Web/CSS/animation-delay) -/// [`animation-direction`](https://developer.mozilla.org/docs/Web/CSS/animation-direction) -/// [`animation-duration`](https://developer.mozilla.org/docs/Web/CSS/animation-duration) -/// [`animation-fill-mode`](https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode) -/// [`animation-iteration-count`](https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count) -/// [`animation-name`](https://developer.mozilla.org/docs/Web/CSS/animation-name) -/// [`animation-play-state`](https://developer.mozilla.org/docs/Web/CSS/animation-play-state) -/// [`animation-timeline`](https://developer.mozilla.org/docs/Web/CSS/animation-timeline) -/// [`animation-timing-function`](https://developer.mozilla.org/docs/Web/CSS/animation-timing-function) +/// - [`animation-delay`](https://developer.mozilla.org/docs/Web/CSS/animation-delay) +/// - [`animation-direction`](https://developer.mozilla.org/docs/Web/CSS/animation-direction) +/// - [`animation-duration`](https://developer.mozilla.org/docs/Web/CSS/animation-duration) +/// - [`animation-fill-mode`](https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode) +/// - [`animation-iteration-count`](https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count) +/// - [`animation-name`](https://developer.mozilla.org/docs/Web/CSS/animation-name) +/// - [`animation-play-state`](https://developer.mozilla.org/docs/Web/CSS/animation-play-state) +/// - [`animation-timeline`](https://developer.mozilla.org/docs/Web/CSS/animation-timeline) +/// - [`animation-timing-function`](https://developer.mozilla.org/docs/Web/CSS/animation-timing-function) /// /// --- /// diff --git a/sketch/src/sketch/css/font_face.gleam b/sketch/src/sketch/css/font_face.gleam index 3823863..489f94d 100644 --- a/sketch/src/sketch/css/font_face.gleam +++ b/sketch/src/sketch/css/font_face.gleam @@ -1,3 +1,11 @@ +//// The `@font-face` CSS at-rule specifies a custom font with which to display +//// text; the font can be loaded from either a remote server or a +//// locally-installed font on the user's own computer. +//// +//// --- +//// +//// [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/@font-face) + import gleam/float /// A `FontFace` is a part of a `@font-face` rule. diff --git a/sketch/src/sketch/css/keyframe.gleam b/sketch/src/sketch/css/keyframe.gleam index 6d4913e..75bfafa 100644 --- a/sketch/src/sketch/css/keyframe.gleam +++ b/sketch/src/sketch/css/keyframe.gleam @@ -1,3 +1,13 @@ +//// The `@keyframes` CSS [at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule) +//// controls the intermediate steps in a CSS animation sequence by defining +//// styles for keyframes (or waypoints) along the animation sequence. This +//// gives more control over the intermediate steps of the animation sequence +//// than [transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transitions). +//// +//// --- +//// +//// [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/@keyframes) + import gleam/int import sketch/internals/cache/cache as style diff --git a/sketch_css/gleam.toml b/sketch_css/gleam.toml index 3abbca8..1ad1e49 100644 --- a/sketch_css/gleam.toml +++ b/sketch_css/gleam.toml @@ -21,7 +21,7 @@ path = "sketch_css" argv = ">= 1.0.2 and < 2.0.0" glance = ">= 2.0.0 and < 3.0.0" gleam_erlang = ">= 0.25.0 and < 1.0.0" -gleam_stdlib = ">= 0.34.0 and < 2.0.0" +gleam_stdlib = ">= 0.42.0 and < 2.0.0" glint = ">= 1.2.0 and < 2.0.0" simplifile = ">= 2.0.1 and < 3.0.0" sketch = {path = "../sketch"} diff --git a/sketch_css/manifest.toml b/sketch_css/manifest.toml index 24a39b8..20ee474 100644 --- a/sketch_css/manifest.toml +++ b/sketch_css/manifest.toml @@ -39,7 +39,7 @@ argv = { version = ">= 1.0.2 and < 2.0.0" } birdie = { version = ">= 1.2.5 and < 2.0.0" } glance = { version = ">= 2.0.0 and < 3.0.0" } gleam_erlang = { version = ">= 0.25.0 and < 1.0.0" } -gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleam_stdlib = { version = ">= 0.42.0 and < 2.0.0" } glint = { version = ">= 1.2.0 and < 2.0.0" } pprint = { version = ">= 1.0.4 and < 2.0.0" } simplifile = { version = ">= 2.0.1 and < 3.0.0" } diff --git a/sketch_lustre/gleam.toml b/sketch_lustre/gleam.toml index fdf2a77..60c7fb3 100644 --- a/sketch_lustre/gleam.toml +++ b/sketch_lustre/gleam.toml @@ -14,7 +14,7 @@ repo = "sketch" path = "sketch_lustre" [dependencies] -gleam_stdlib = ">= 0.34.0 and < 2.0.0" +gleam_stdlib = ">= 0.42.0 and < 2.0.0" lustre = ">= 4.6.0 and < 5.0.0" sketch = {path = "../sketch"} diff --git a/sketch_lustre/manifest.toml b/sketch_lustre/manifest.toml index b9e74a0..e7a5169 100644 --- a/sketch_lustre/manifest.toml +++ b/sketch_lustre/manifest.toml @@ -12,7 +12,7 @@ packages = [ ] [requirements] -gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleam_stdlib = { version = ">= 0.42.0 and < 2.0.0" } gleeunit = { version = ">= 1.0.0 and < 2.0.0" } lustre = { version = ">= 4.6.0 and < 5.0.0" } sketch = { path = "../sketch" } diff --git a/sketch_lustre/src/sketch/lustre/element.gleam b/sketch_lustre/src/sketch/lustre/element.gleam index d077ff2..106f5c1 100644 --- a/sketch_lustre/src/sketch/lustre/element.gleam +++ b/sketch_lustre/src/sketch/lustre/element.gleam @@ -12,7 +12,7 @@ import sketch/css /// 1:1 representation of a `lustre/element.Element`. /// -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#Element) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#Element) pub opaque type Element(msg) { Nothing Text(content: String) @@ -27,17 +27,17 @@ pub opaque type Element(msg) { ) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#none) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#none) pub fn none() -> Element(a) { Nothing } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#text) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#text) pub fn text(content: String) -> Element(a) { Text(content) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) pub fn element( tag tag: String, class class: css.Class, @@ -48,7 +48,7 @@ pub fn element( Element("", "", tag, class, attributes, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) pub fn element_( tag tag: String, attributes attributes: List(Attribute(msg)), @@ -57,7 +57,7 @@ pub fn element_( Element("", "", tag, option.None, attributes, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) pub fn namespaced( namespace namespace: String, tag tag: String, @@ -69,7 +69,7 @@ pub fn namespaced( Element("", namespace, tag, class, attributes, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) pub fn namespaced_( namespace namespace: String, tag tag: String, @@ -79,13 +79,13 @@ pub fn namespaced_( Element("", namespace, tag, option.None, attributes, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#fragment) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#fragment) pub fn fragment(children: List(Element(msg))) -> Element(msg) { let attrs = [attribute.style([#("display", "contents")])] Element("", "", "lustre-fragment", option.None, attrs, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#keyed) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#keyed) pub fn keyed( element: fn(List(Element(msg))) -> Element(msg), children: List(#(String, Element(msg))), @@ -106,7 +106,7 @@ fn do_keyed(element: Element(msg), key: String) -> Element(msg) { } } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#map) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#map) pub fn map(element: Element(a), mapper: fn(a) -> b) -> Element(b) { case element { Nothing -> Nothing diff --git a/sketch_lustre_experimental/gleam.toml b/sketch_lustre_experimental/gleam.toml index 2303f1a..0ebd321 100644 --- a/sketch_lustre_experimental/gleam.toml +++ b/sketch_lustre_experimental/gleam.toml @@ -1,19 +1,20 @@ name = "sketch_lustre_experimental" version = "0.1.0" -# Fill out these fields if you intend to generate HTML documentation or publish -# your project to the Hex package manager. -# -# description = "" -# licences = ["Apache-2.0"] -# repository = { type = "github", user = "", repo = "" } -# links = [{ title = "Website", href = "" }] -# -# For a full reference of all the available options, you can have a look at -# https://gleam.run/writing-gleam/gleam-toml/. +description = "An experimental Sketch runtime package, made to work with Lustre!" +internal_modules = ["sketch/lustre/expermental/internals", "sketch/lustre/experimental/internals/*"] +licences = ["MIT"] +links = [{title = "Sponsor", href = "https://github.com/sponsors/ghivert"}] +gleam = ">= 1.6.0" + +[repository] +type = "github" +user = "ghivert" +repo = "sketch" +path = "sketch_lustre_experimental" [dependencies] -gleam_stdlib = ">= 0.34.0 and < 2.0.0" +gleam_stdlib = ">= 0.42.0 and < 2.0.0" lustre = ">= 4.6.1 and < 5.0.0" sketch = {path = "../sketch"} diff --git a/sketch_lustre_experimental/manifest.toml b/sketch_lustre_experimental/manifest.toml index 34ffd1b..f8c903b 100644 --- a/sketch_lustre_experimental/manifest.toml +++ b/sketch_lustre_experimental/manifest.toml @@ -12,7 +12,7 @@ packages = [ ] [requirements] -gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleam_stdlib = { version = ">= 0.42.0 and < 2.0.0" } gleeunit = { version = ">= 1.0.0 and < 2.0.0" } lustre = { version = ">= 4.6.1 and < 5.0.0" } sketch = { path = "../sketch" } diff --git a/sketch_lustre_experimental/src/sketch/lustre/experimental/element.gleam b/sketch_lustre_experimental/src/sketch/lustre/experimental/element.gleam index 4d722a9..328de27 100644 --- a/sketch_lustre_experimental/src/sketch/lustre/experimental/element.gleam +++ b/sketch_lustre_experimental/src/sketch/lustre/experimental/element.gleam @@ -8,26 +8,26 @@ import sketch/css import sketch/lustre/experimental/internals/global /// Alias for `lustre/element.Element`. \ -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#Element) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#Element) pub type Element(msg) = el.Element(msg) -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#keyed) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#keyed) pub const keyed = el.keyed -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#fragment) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#fragment) pub const fragment = el.fragment -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#none) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#none) pub const none = el.none -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#text) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#text) pub const text = el.text -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#map) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#map) pub const map = el.map -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) pub fn element( tag tag: String, class class: css.Class, @@ -38,7 +38,7 @@ pub fn element( el.element(tag, [attribute.class(class_name), ..attributes], children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#element) pub fn element_( tag tag: String, attributes attributes: List(Attribute(msg)), @@ -47,7 +47,7 @@ pub fn element_( el.element(tag, attributes, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) pub fn namespaced( tag tag: String, namespace namespace: String, @@ -60,7 +60,7 @@ pub fn namespaced( el.namespaced(tag, namespace, attributes, children) } -/// [Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) +/// [Lustre Documentation](https://hexdocs.pm/lustre/lustre/element.html#namespaced) pub fn namespaced_( tag tag: String, namespace namespace: String, diff --git a/sketch_redraw/gleam.toml b/sketch_redraw/gleam.toml index d34f727..32108df 100644 --- a/sketch_redraw/gleam.toml +++ b/sketch_redraw/gleam.toml @@ -14,7 +14,7 @@ repo = "sketch" path = "sketch_redraw" [dependencies] -gleam_stdlib = ">= 0.34.0 and < 2.0.0" +gleam_stdlib = ">= 0.42.0 and < 2.0.0" redraw = ">= 2.0.0 and < 3.0.0" sketch = {path = "../sketch"} redraw_dom = ">= 2.0.0 and < 3.0.0" diff --git a/sketch_redraw/manifest.toml b/sketch_redraw/manifest.toml index fca41d5..7969349 100644 --- a/sketch_redraw/manifest.toml +++ b/sketch_redraw/manifest.toml @@ -13,7 +13,7 @@ packages = [ ] [requirements] -gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" } +gleam_stdlib = { version = ">= 0.42.0 and < 2.0.0" } gleeunit = { version = ">= 1.0.0 and < 2.0.0" } redraw = { version = ">= 2.0.0 and < 3.0.0" } redraw_dom = { version = ">= 2.0.0 and < 3.0.0" }