-module(lustre@attribute). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]). -define(FILEPATH, "src/lustre/attribute.gleam"). -export([attribute/2, property/2, accesskey/1, autocapitalize/1, autocorrect/1, autofocus/1, class/1, none/0, classes/1, contenteditable/1, data/2, dir/1, draggable/1, enterkeyhint/1, hidden/1, id/1, inert/1, inputmode/1, is/1, itemid/1, itemprop/1, itemscope/1, itemtype/1, lang/1, nonce/1, popover/1, spellcheck/1, style/2, styles/1, tabindex/1, title/1, translate/1, writingsuggestions/1, open/1, href/1, target/1, download/1, ping/1, rel/1, hreflang/1, referrerpolicy/1, as_/1, blocking/1, integrity/1, alt/1, src/1, srcset/1, sizes/1, crossorigin/1, usemap/1, ismap/1, width/1, height/1, decoding/1, loading/1, fetchpriority/1, accept_charset/1, action/1, enctype/1, method/1, novalidate/1, accept/1, alpha/1, autocomplete/1, checked/1, default_checked/1, colorspace/1, cols/1, dirname/1, disabled/1, for/1, form/1, formaction/1, formenctype/1, formmethod/1, formnovalidate/1, formtarget/1, list/1, max/1, maxlength/1, min/1, minlength/1, multiple/1, name/1, pattern/1, placeholder/1, popovertarget/1, popovertargetaction/1, readonly/1, required/1, rows/1, selected/1, default_selected/1, size/1, step/1, type_/1, value/1, default_value/1, http_equiv/1, content/1, charset/1, media/1, autoplay/1, controls/1, loop/1, muted/1, playsinline/1, poster/1, preload/1, shadowrootmode/1, shadowrootdelegatesfocus/1, shadowrootclonable/1, shadowrootserializable/1, abbr/1, colspan/1, headers/1, rowspan/1, span/1, scope/1, datetime/1, aria/2, role/1, aria_activedescendant/1, aria_atomic/1, aria_autocomplete/1, aria_braillelabel/1, aria_brailleroledescription/1, aria_busy/1, aria_checked/1, aria_colcount/1, aria_colindex/1, aria_colindextext/1, aria_colspan/1, aria_controls/1, aria_current/1, aria_describedby/1, aria_description/1, aria_details/1, aria_disabled/1, aria_errormessage/1, aria_expanded/1, aria_flowto/1, aria_haspopup/1, aria_hidden/1, aria_invalid/1, aria_keyshortcuts/1, aria_label/1, aria_labelledby/1, aria_level/1, aria_live/1, aria_modal/1, aria_multiline/1, aria_multiselectable/1, aria_orientation/1, aria_owns/1, aria_placeholder/1, aria_posinset/1, aria_pressed/1, aria_readonly/1, aria_relevant/1, aria_required/1, aria_roledescription/1, aria_rowcount/1, aria_rowindex/1, aria_rowindextext/1, aria_rowspan/1, aria_selected/1, aria_setsize/1, aria_sort/1, aria_valuemax/1, aria_valuemin/1, aria_valuenow/1, aria_valuetext/1]). -if(?OTP_RELEASE >= 27). -define(MODULEDOC(Str), -moduledoc(Str)). -define(DOC(Str), -doc(Str)). -else. -define(MODULEDOC(Str), -compile([])). -define(DOC(Str), -compile([])). -endif. -file("src/lustre/attribute.gleam", 34). ?DOC( " Create an HTML attribute. This is like saying `element.setAttribute(\"class\", \"wibble\")`\n" " in JavaScript. Attributes will be rendered when calling [`element.to_string`](./element.html#to_string).\n" "\n" " > **Note**: there is a subtle difference between attributes and properties. You\n" " > can read more about the implications of this\n" " > [here](https://github.com/lustre-labs/lustre/blob/main/pages/hints/attributes-vs-properties.md).\n" ). -spec attribute(binary(), binary()) -> lustre@vdom@vattr:attribute(any()). attribute(Name, Value) -> lustre@vdom@vattr:attribute(Name, Value). -file("src/lustre/attribute.gleam", 53). ?DOC( " Create a DOM property. This is like saying `element.className = \"wibble\"` in\n" " JavaScript. Properties will be **not** be rendered when calling\n" " [`element.to_string`](./element.html#to_string).\n" "\n" " > **Note**: there is a subtle difference between attributes and properties. You\n" " > can read more about the implications of this\n" " > [here](https://github.com/lustre-labs/lustre/blob/main/pages/hints/attributes-vs-properties.md).\n" ). -spec property(binary(), gleam@json:json()) -> lustre@vdom@vattr:attribute(any()). property(Name, Value) -> lustre@vdom@vattr:property(Name, Value). -file("src/lustre/attribute.gleam", 38). -spec boolean_attribute(binary(), boolean()) -> lustre@vdom@vattr:attribute(any()). boolean_attribute(Name, Value) -> case Value of true -> attribute(Name, <<""/utf8>>); false -> property(Name, gleam@json:bool(false)) end. -file("src/lustre/attribute.gleam", 79). ?DOC( " Defines a shortcut key to activate or focus the element. Multiple options\n" " may be provided as a set of space-separated characters that are exactly one\n" " code point each.\n" "\n" " The way to activate the access key depends on the browser and its platform:\n" "\n" " | | Windows | Linux | Mac OS |\n" " |---------|-------------------|---------------------|---------------------|\n" " | Firefox | Alt + Shift + key | Alt + Shift + key | Ctrl + Option + key |\n" " | Chrome | Alt + key | Ctrl + Option + key | Ctrl + Option + key |\n" " | Safari | | | Ctrl + Option + key |\n" ). -spec accesskey(binary()) -> lustre@vdom@vattr:attribute(any()). accesskey(Key) -> attribute(<<"accesskey"/utf8>>, Key). -file("src/lustre/attribute.gleam", 112). ?DOC( " Controls whether text input is automatically capitalised. The following values\n" " are accepted:\n" "\n" " | Value | Mode |\n" " |--------------|------------|\n" " | \"\" | default |\n" " | \"none\" | none |\n" " | \"off\" | |\n" " | \"sentences\" | sentences |\n" " | \"on\" | |\n" " | \"words\" | words |\n" " | \"characters\" | characters |\n" "\n" " The autocapitalisation processing model is based on the following five modes:\n" "\n" " - **default**: The user agent and input method should make their own determination\n" " of whether or not to enable autocapitalization.\n" "\n" " - **none**: No autocapitalisation should be applied (all letters should default\n" " to lowercase).\n" "\n" " - **sentences**: The first letter of each sentence should default to a capital\n" " letter; all other letters should default to lowercase.\n" "\n" " - **words**: The first letter of each word should default to a capital letter;\n" " all other letters should default to lowercase.\n" "\n" " - **characters**: All letters should default to uppercase.\n" ). -spec autocapitalize(binary()) -> lustre@vdom@vattr:attribute(any()). autocapitalize(Value) -> attribute(<<"autocapitalize"/utf8>>, Value). -file("src/lustre/attribute.gleam", 122). ?DOC( " Controls whether the user agent may automatically correct mispelled words\n" " while typing. Whether or not spelling is corrected is left up to the user\n" " agent and may also depend on the user's settings.\n" "\n" " When disabled the user agent is **never** allowed to correct spelling.\n" ). -spec autocorrect(boolean()) -> lustre@vdom@vattr:attribute(any()). autocorrect(Enabled) -> boolean_attribute(<<"autocorrect"/utf8>>, Enabled). -file("src/lustre/attribute.gleam", 133). ?DOC( " For server-rendered HTML, this attribute controls whether an element should\n" " be focused when the page first loads.\n" "\n" " > **Note**: Lustre's runtime augments that native behaviour of this attribute.\n" " > Whenever it is toggled true, the element will be automatically focused even\n" " > if it already exists in the DOM.\n" ). -spec autofocus(boolean()) -> lustre@vdom@vattr:attribute(any()). autofocus(Should_autofocus) -> boolean_attribute(<<"autofocus"/utf8>>, Should_autofocus). -file("src/lustre/attribute.gleam", 148). ?DOC( " A class is a non-unique identifier for an element primarily used for styling\n" " purposes. You can provide multiple classes as a space-separated list and any\n" " style rules that apply to any of the classes will be applied to the element.\n" "\n" " To conditionally toggle classes on and off, you can use the [`classes`](#classes)\n" " function instead.\n" "\n" " > **Note**: unlike most attributes, multiple `class` attributes are merged\n" " > with any existing other classes on an element. Classes added _later_ in the\n" " > list will override classes added earlier.\n" ). -spec class(binary()) -> lustre@vdom@vattr:attribute(any()). class(Name) -> attribute(<<"class"/utf8>>, Name). -file("src/lustre/attribute.gleam", 61). ?DOC( " Create an empty attribute. This is not added to the DOM and not rendered when\n" " calling [`element.to_string`](./element.html#to_string), but it is useful for\n" " _conditionally_ adding attributes to an element.\n" ). -spec none() -> lustre@vdom@vattr:attribute(any()). none() -> class(<<""/utf8>>). -file("src/lustre/attribute.gleam", 165). -spec do_classes(list({binary(), boolean()}), binary()) -> binary(). do_classes(Names, Class) -> case Names of [] -> Class; [{Name, true} | Rest] -> <<<<<>/binary, " "/utf8>>/binary, (do_classes(Rest, Class))/binary>>; [{_, false} | Rest@1] -> do_classes(Rest@1, Class) end. -file("src/lustre/attribute.gleam", 161). ?DOC( " A class is a non-unique identifier for an element primarily used for styling\n" " purposes. You can provide multiple classes as a space-separated list and any\n" " style rules that apply to any of the classes will be applied to the element.\n" " This function allows you to conditionally toggle classes on and off.\n" "\n" " > **Note**: unlike most attributes, multiple `class` attributes are merged\n" " > with any existing other classes on an element. Classes added _later_ in the\n" " > list will override classes added earlier.\n" ). -spec classes(list({binary(), boolean()})) -> lustre@vdom@vattr:attribute(any()). classes(Names) -> class(do_classes(Names, <<""/utf8>>)). -file("src/lustre/attribute.gleam", 186). ?DOC( " Indicates whether the element's content is editable by the user, allowing them\n" " to modify the HTML content directly. The following values are accepted:\n" "\n" " | Value | Description |\n" " |--------------|-------------------------------------------------------|\n" " | \"true\" | The element is editable. |\n" " | \"\" | |\n" " | \"false\" | The element is not editable. |\n" " | \"plain-text\" | The element is editable without rich text formatting. |\n" "\n" " > **Note**: setting the value to an empty string does *not* disable this\n" " > attribute, and is instead equivalent to setting it to `\"true\"`!\n" ). -spec contenteditable(binary()) -> lustre@vdom@vattr:attribute(any()). contenteditable(Is_editable) -> attribute(<<"contenteditable"/utf8>>, Is_editable). -file("src/lustre/attribute.gleam", 195). ?DOC( " Add a `data-*` attribute to an HTML element. The key will be prefixed by\n" " `\"data-\"`, and accessible from JavaScript or in Gleam decoders under the\n" " path `element.dataset.key` where `key` is the key you provide to this\n" " function.\n" ). -spec data(binary(), binary()) -> lustre@vdom@vattr:attribute(any()). data(Key, Value) -> attribute(<<"data-"/utf8, Key/binary>>, Value). -file("src/lustre/attribute.gleam", 213). ?DOC( " Specifies the text direction of the element's content. The following values\n" " are accepted:\n" "\n" " | Value | Description |\n" " |--------|----------------------------------------------------------------------|\n" " | \"ltr\" | The element's content is left-to-right. |\n" " | \"rtl\" | The element's content is right-to-left. |\n" " | \"auto\" | The element's content direction is determined by the content itself. |\n" "\n" " > **Note**: the `\"auto\"` value should only be used as a last resort in cases\n" " > where the content's direction is truly unknown. The heuristic used by\n" " > browsers is naive and only considers the first character available that\n" " > indicates the direction.\n" ). -spec dir(binary()) -> lustre@vdom@vattr:attribute(any()). dir(Direction) -> attribute(<<"dir"/utf8>>, Direction). -file("src/lustre/attribute.gleam", 220). ?DOC( " Indicates whether the element can be dragged as part of the HTML drag-and-drop\n" " API.\n" ). -spec draggable(boolean()) -> lustre@vdom@vattr:attribute(any()). draggable(Is_draggable) -> attribute(<<"draggable"/utf8>>, case Is_draggable of true -> <<"true"/utf8>>; false -> <<"false"/utf8>> end). -file("src/lustre/attribute.gleam", 245). ?DOC( " Specifies what action label (or potentially icon) to present for the \"enter\"\n" " key on virtual keyboards such as mobile devices. The following values are\n" " accepted:\n" "\n" " | Value | Example |\n" " |------------|----------------|\n" " | \"enter\" | \"return\", \"↵\" |\n" " | \"done\" | \"done\", \"✅\" |\n" " | \"go\" | \"go\" |\n" " | \"next\" | \"next\" |\n" " | \"previous\" | \"return\" |\n" " | \"search\" | \"search\", \"🔍\" |\n" " | \"send\" | \"send\" |\n" "\n" " The examples listed are demonstrative and may not be the actual labels used\n" " by user agents. When unspecified or invalid, the user agent may use contextual\n" " information such as the type of an input to determine the label.\n" ). -spec enterkeyhint(binary()) -> lustre@vdom@vattr:attribute(any()). enterkeyhint(Value) -> attribute(<<"enterkeyhint"/utf8>>, Value). -file("src/lustre/attribute.gleam", 255). ?DOC( " Indicates whether the element is relevant to the page's current state. A\n" " hidden element is not visible to the user and is inaccessible to assistive\n" " technologies such as screen readers. This makes it unsuitable for simple\n" " presentation purposes, but it can be useful for example to render something\n" " that may be made visible later.\n" ). -spec hidden(boolean()) -> lustre@vdom@vattr:attribute(any()). hidden(Is_hidden) -> boolean_attribute(<<"hidden"/utf8>>, Is_hidden). -file("src/lustre/attribute.gleam", 264). ?DOC( " The `\"id\"` attribute is used to uniquely identify a single element within a\n" " document. It can be used to reference the element in CSS with the selector\n" " `#id`, in JavaScript with `document.getElementById(\"id\")`, or by anchors on\n" " the same page with the URL `\"#id\"`.\n" ). -spec id(binary()) -> lustre@vdom@vattr:attribute(any()). id(Value) -> attribute(<<"id"/utf8>>, Value). -file("src/lustre/attribute.gleam", 274). ?DOC( " Marks the element as inert, meaning it is not currently interactive and does\n" " not receive user input. For sighted users, it's common to style inert elements\n" " in a way that makes them visually distinct from active elements, such as by\n" " greying them out: this can help avoid confusion for users who may not otherwise\n" " know the content they are looking at is inactive.\n" ). -spec inert(boolean()) -> lustre@vdom@vattr:attribute(any()). inert(Is_inert) -> boolean_attribute(<<"inert"/utf8>>, Is_inert). -file("src/lustre/attribute.gleam", 295). ?DOC( " Hints to the user agent about what type of virtual keyboard to display when\n" " the user interacts with the element. The following values are accepted:\n" "\n" " | Value | Description |\n" " |--------------|---------------------------------------------------------------|\n" " | \"none\" | No virtual keyboard should be displayed. |\n" " | \"text\" | A standard text input keyboard. |\n" " | \"decimal\" | A numeric keyboard with locale-appropriate separator. |\n" " | \"numeric\" | A numeric keyboard. |\n" " | \"tel\" | A telephone keypad including \"#\" and \"*\". |\n" " | \"email\" | A keyboard for entering email addresses including \"@\" and \".\" |\n" " | \"url\" | A keyboard for entering URLs including \"/\" and \".\". |\n" " | \"search\" | A keyboard for entering search queries should be shown. |\n" "\n" " The `\"none\"` value should only be used in cases where you are rendering a\n" " custom input method, otherwise the user will not be able to enter any text!\n" ). -spec inputmode(binary()) -> lustre@vdom@vattr:attribute(any()). inputmode(Value) -> attribute(<<"inputmode"/utf8>>, Value). -file("src/lustre/attribute.gleam", 302). ?DOC( " Specifies the [customised built-in element](https://html.spec.whatwg.org/#customized-built-in-element)\n" " to be used in place of the native element this attribute is applied to.\n" ). -spec is(binary()) -> lustre@vdom@vattr:attribute(any()). is(Value) -> attribute(<<"is"/utf8>>, Value). -file("src/lustre/attribute.gleam", 310). ?DOC( " Used as part of the [Microdata](https://schema.org/docs/gs.html) format to\n" " specify the global unique identifier of an item, for example books that are\n" " identifiable by their ISBN.\n" ). -spec itemid(binary()) -> lustre@vdom@vattr:attribute(any()). itemid(Id) -> attribute(<<"itemid"/utf8>>, Id). -file("src/lustre/attribute.gleam", 318). ?DOC( " Used as part of the [Microdata](https://schema.org/docs/gs.html) format to\n" " specify that the content of the element is to be treated as a value of the\n" " given property name.\n" ). -spec itemprop(binary()) -> lustre@vdom@vattr:attribute(any()). itemprop(Name) -> attribute(<<"itemprop"/utf8>>, Name). -file("src/lustre/attribute.gleam", 326). ?DOC( " Used as part of the [Microdata](https://schema.org/docs/gs.html) format to\n" " indicate that the element and its descendants form a single item of key-value\n" " data.\n" ). -spec itemscope(boolean()) -> lustre@vdom@vattr:attribute(any()). itemscope(Has_scope) -> boolean_attribute(<<"itemscope"/utf8>>, Has_scope). -file("src/lustre/attribute.gleam", 335). ?DOC( " Used as part of the [Microdata](https://schema.org/docs/gs.html) format to\n" " specify the type of item being described. This is a URL that points to\n" " a schema containing the vocabulary used for an item's key-value pairs, such\n" " as a schema.org type.\n" ). -spec itemtype(binary()) -> lustre@vdom@vattr:attribute(any()). itemtype(Url) -> attribute(<<"itemtype"/utf8>>, Url). -file("src/lustre/attribute.gleam", 346). ?DOC( " Specifies the language of the element's content and the language of any of\n" " this element's attributes that contain text. The `\"lang\"` attribute applies\n" " to the element itself and all of its descendants, unless overridden by\n" " another `\"lang\"` attribute on a descendant element.\n" "\n" " The value must be a valid [BCP 47 language tag](https://tools.ietf.org/html/bcp47).\n" ). -spec lang(binary()) -> lustre@vdom@vattr:attribute(any()). lang(Language) -> attribute(<<"lang"/utf8>>, Language). -file("src/lustre/attribute.gleam", 353). ?DOC( " A cryptographic nonce used by CSP (Content Security Policy) to allow or\n" " deny the fetch of a given resource.\n" ). -spec nonce(binary()) -> lustre@vdom@vattr:attribute(any()). nonce(Value) -> attribute(<<"nonce"/utf8>>, Value). -file("src/lustre/attribute.gleam", 378). ?DOC( " Specifies that the element should be treated as a popover, rendering it in\n" " the top-layer above all other content when the popover is active. The following\n" " values are accepted:\n" "\n" " | Value | Description |\n" " |--------------|------------------------------------------------|\n" " | \"auto\" | Closes other popovers when opened. |\n" " | \"\" | |\n" " | \"manual\" | Does not close other popovers when opened. |\n" " | \"hint\" | Closes only other \"hint\" popovers when opened. |\n" "\n" " All modes except `\"manual\"` support \"light dismiss\" letting the user close\n" " the popover by clicking outside of it, as well as respond to close requests\n" " letting the user dismiss a popover by pressing the \"escape\" key or by using\n" " the dismiss gesture on any assistive technology.\n" "\n" " Popovers can be triggered either programmatically through the `showPopover()`\n" " method, or by assigning an [`id`](#id) to the element and including the\n" " [`popovertarget`](#popovertarget) attribute on the element that should trigger\n" " the popover.\n" ). -spec popover(binary()) -> lustre@vdom@vattr:attribute(any()). popover(Value) -> attribute(<<"popover"/utf8>>, Value). -file("src/lustre/attribute.gleam", 386). ?DOC( " Indicates whether the element's content should be checked for spelling errors.\n" " This typically only applies to inputs and textareas, or elements that are\n" " [`contenteditable`](#contenteditable).\n" ). -spec spellcheck(boolean()) -> lustre@vdom@vattr:attribute(any()). spellcheck(Should_check) -> attribute(<<"spellcheck"/utf8>>, case Should_check of true -> <<"true"/utf8>>; false -> <<"false"/utf8>> end). -file("src/lustre/attribute.gleam", 401). ?DOC( " Provide a single property name and value to be used as inline styles for the\n" " element. If either the property name or value is empty, this attribute will\n" " be ignored.\n" "\n" " > **Note**: unlike most attributes, multiple `style` attributes are merged\n" " > with any existing other styles on an element. Styles added _later_ in the\n" " > list will override styles added earlier.\n" ). -spec style(binary(), binary()) -> lustre@vdom@vattr:attribute(any()). style(Property, Value) -> case {Property, Value} of {<<""/utf8>>, _} -> class(<<""/utf8>>); {_, <<""/utf8>>} -> class(<<""/utf8>>); {_, _} -> attribute( <<"style"/utf8>>, <<<<<>/binary, Value/binary>>/binary, ";"/utf8>> ) end. -file("src/lustre/attribute.gleam", 419). -spec do_styles(list({binary(), binary()}), binary()) -> binary(). do_styles(Properties, Styles) -> case Properties of [] -> Styles; [{<<""/utf8>>, _} | Rest] -> do_styles(Rest, Styles); [{_, <<""/utf8>>} | Rest] -> do_styles(Rest, Styles); [{Name, Value} | Rest@1] -> do_styles( Rest@1, <<<<<<<>/binary, ":"/utf8>>/binary, Value/binary>>/binary, ";"/utf8>> ) end. -file("src/lustre/attribute.gleam", 415). ?DOC( " Provide a list of property-value pairs to be used as inline styles for the\n" " element. Empty properties or values are omitted from the final style string.\n" "\n" " > **Note**: unlike most attributes, multiple `styles` attributes are merged\n" " > with any existing other styles on an element. Styles added _later_ in the\n" " > list will override styles added earlier.\n" ). -spec styles(list({binary(), binary()})) -> lustre@vdom@vattr:attribute(any()). styles(Properties) -> attribute(<<"style"/utf8>>, do_styles(Properties, <<""/utf8>>)). -file("src/lustre/attribute.gleam", 447). ?DOC( " Specifies the tabbing order of the element. If an element is not typically\n" " focusable, such as a `
`, it will be made focusable when this attribute\n" " is set.\n" "\n" " Any integer value is accepted, but the following values are recommended:\n" "\n" " - `-1`: indicates the element may receive focus, but should not be sequentially\n" " focusable. The user agent may choose to ignore this preference if, for\n" " example, the user agent is a screen reader.\n" "\n" " - `0`: indicates the element may receive focus and should be placed in the\n" " sequential focus order in the order it appears in the DOM.\n" "\n" " - any positive integer: indicates the element should be placed in the sequential\n" " focus order relative to other elements with a positive tabindex.\n" "\n" " Values other than `0` and `-1` are generally not recommended as managing\n" " the relative order of focusable elements can be difficult and error-prone.\n" ). -spec tabindex(integer()) -> lustre@vdom@vattr:attribute(any()). tabindex(Index) -> attribute(<<"tabindex"/utf8>>, erlang:integer_to_binary(Index)). -file("src/lustre/attribute.gleam", 459). ?DOC( " Annotate an element with additional information that may be suitable as a\n" " tooltip, such as a description of a link or image.\n" "\n" " It is **not** recommended to use the `title` attribute as a way of providing\n" " accessibility information to assistive technologies. User agents often do not\n" " expose the `title` attribute to keyboard-only users or touch devices, for\n" " example.\n" ). -spec title(binary()) -> lustre@vdom@vattr:attribute(any()). title(Text) -> attribute(<<"title"/utf8>>, Text). -file("src/lustre/attribute.gleam", 481). ?DOC( " Controls whether an element's content may be translated by the user agent\n" " when the page is localised. This includes both the element's text content\n" " and some of its attributes:\n" "\n" " | Attribute | Element(s) |\n" " |-------------|--------------------------------------------|\n" " | abbr | th |\n" " | alt | area, img, input |\n" " | content | meta |\n" " | download | a, area |\n" " | label | optgroup, option, track |\n" " | lang | * |\n" " | placeholder | input, textarea |\n" " | srcdoc | iframe |\n" " | title | * |\n" " | style | * |\n" " | value | input (with type=\"button\" or type=\"reset\") |\n" ). -spec translate(boolean()) -> lustre@vdom@vattr:attribute(any()). translate(Should_translate) -> attribute(<<"translate"/utf8>>, case Should_translate of true -> <<"yes"/utf8>>; false -> <<"no"/utf8>> end). -file("src/lustre/attribute.gleam", 490). ?DOC(" Indicates if writing suggestions should be enabled for this element.\n"). -spec writingsuggestions(boolean()) -> lustre@vdom@vattr:attribute(any()). writingsuggestions(Enabled) -> attribute(<<"writingsuggestions"/utf8>>, case Enabled of true -> <<"true"/utf8>>; false -> <<"false"/utf8>> end). -file("src/lustre/attribute.gleam", 501). ?DOC(" Indicates whether the details element is open or closed.\n"). -spec open(boolean()) -> lustre@vdom@vattr:attribute(any()). open(Is_open) -> boolean_attribute(<<"open"/utf8>>, Is_open). -file("src/lustre/attribute.gleam", 510). ?DOC( " Specifies the URL of a linked resource. This attribute can be used on various\n" " elements to create hyperlinks or to load resources.\n" ). -spec href(binary()) -> lustre@vdom@vattr:attribute(any()). href(Url) -> attribute(<<"href"/utf8>>, Url). -file("src/lustre/attribute.gleam", 528). ?DOC( " Specifies where to display the linked resource or where to open the link.\n" " The following values are accepted:\n" "\n" " | Value | Description |\n" " |-----------|---------------------------------------------------------|\n" " | \"_self\" | Open in the same frame/window (default) |\n" " | \"_blank\" | Open in a new window or tab |\n" " | \"_parent\" | Open in the parent frame |\n" " | \"_top\" | Open in the full body of the window |\n" " | framename | Open in a named frame |\n" "\n" " > **Note**: consider against using `\"_blank\"` for links to external sites as it\n" " > removes user control over their browsing experience.\n" ). -spec target(binary()) -> lustre@vdom@vattr:attribute(any()). target(Value) -> attribute(<<"target"/utf8>>, Value). -file("src/lustre/attribute.gleam", 535). ?DOC( " Indicates that the linked resource should be downloaded rather than displayed.\n" " When provided with a value, it suggests a filename for the downloaded file.\n" ). -spec download(binary()) -> lustre@vdom@vattr:attribute(any()). download(Filename) -> attribute(<<"download"/utf8>>, Filename). -file("src/lustre/attribute.gleam", 543). ?DOC( " Provides a space-separated list of URLs that will be notified if the user\n" " follows the hyperlink. These URLs will receive POST requests with bodies\n" " of type `ping/1.0`.\n" ). -spec ping(list(binary())) -> lustre@vdom@vattr:attribute(any()). ping(Urls) -> attribute(<<"ping"/utf8>>, gleam@string:join(Urls, <<" "/utf8>>)). -file("src/lustre/attribute.gleam", 550). ?DOC( " Specifies the relationship between the current document and the linked resource.\n" " Multiple relationship values can be provided as a space-separated list.\n" ). -spec rel(binary()) -> lustre@vdom@vattr:attribute(any()). rel(Value) -> attribute(<<"rel"/utf8>>, Value). -file("src/lustre/attribute.gleam", 557). ?DOC( " Specifies the language of the linked resource. The value must be a valid\n" " [BCP 47 language tag](https://tools.ietf.org/html/bcp47).\n" ). -spec hreflang(binary()) -> lustre@vdom@vattr:attribute(any()). hreflang(Language) -> attribute(<<"hreflang"/utf8>>, Language). -file("src/lustre/attribute.gleam", 575). ?DOC( " Specifies the referrer policy for fetches initiated by the element. The\n" " following values are accepted:\n" "\n" " | Value | Description |\n" " |-----------------------------------|--------------------------------------------------------|\n" " | \"no-referrer\" | No Referer header is sent |\n" " | \"no-referrer-when-downgrade\" | Only send Referer for same-origin or more secure |\n" " | \"origin\" | Send only the origin part of the URL |\n" " | \"origin-when-cross-origin\" | Full URL for same-origin, origin only for cross-origin |\n" " | \"same-origin\" | Only send Referer for same-origin requests |\n" " | \"strict-origin\" | Like origin, but only to equally secure destinations |\n" " | \"strict-origin-when-cross-origin\" | Default policy with varying levels of restriction |\n" " | \"unsafe-url\" | Always send the full URL |\n" ). -spec referrerpolicy(binary()) -> lustre@vdom@vattr:attribute(any()). referrerpolicy(Value) -> attribute(<<"referrerpolicy"/utf8>>, Value). -file("src/lustre/attribute.gleam", 601). ?DOC( " Specifies the type of the resource being linked to, which is necessary for\n" " request matching, application of correct content security policy, and setting\n" " of correct Accept request header.\n" "\n" " > **Note**: this attribute is required when rel=\"preload\" has been set on the\n" " > `` element, optional when `rel=\"modulepreload\"` has been set, and\n" " > otherwise should not be used.\n" "\n" " | Value | Applies to |\n" " |------------|----------------------------------|\n" " | \"audio\" | `