@weftui/core 0.27.1 → 0.29.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.
- package/README.md +11 -10
- package/dist/{index-DMNuAQXj.d.ts → index-4cTlhojA.d.ts} +47 -35
- package/dist/index.d.ts +77 -135
- package/dist/types/index.d.ts +1 -1
- package/docs/explanation/boundaries-and-suspense.md +37 -18
- package/docs/explanation/combinator-api.md +14 -12
- package/docs/explanation/reactive-primitives.md +15 -15
- package/docs/explanation/rendering-model.md +20 -18
- package/docs/explanation/services-and-context.md +39 -29
- package/docs/how-to/add-routing.md +76 -52
- package/docs/how-to/author-components.md +46 -32
- package/docs/how-to/compose-behavior-and-markup.md +144 -0
- package/docs/how-to/handle-forms.md +6 -6
- package/docs/how-to/load-async-data.md +15 -13
- package/docs/how-to/load-data-with-rpc.md +34 -30
- package/docs/how-to/provide-services.md +54 -74
- package/docs/how-to/render-keyed-lists.md +10 -8
- package/docs/how-to/render-on-the-server.md +19 -14
- package/docs/how-to/show-navigation-progress.md +10 -8
- package/docs/how-to/split-routes-lazily.md +16 -14
- package/docs/how-to/style-reactively.md +13 -13
- package/docs/how-to/use-element-refs.md +10 -8
- package/docs/index.md +20 -18
- package/docs/reference/core.md +44 -40
- package/docs/reference/dom.md +395 -58
- package/docs/reference/router.md +71 -49
- package/docs/tutorial/01-your-first-app.md +10 -11
- package/docs/tutorial/02-reactivity.md +11 -8
- package/docs/tutorial/03-services-and-async.md +19 -13
- package/docs/tutorial/04-errors-and-server.md +17 -7
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @weftui/core
|
|
2
2
|
|
|
3
|
-
> Element builders and combinators for [Weft](https://weftui.dev)
|
|
3
|
+
> Element builders and combinators for [Weft](https://weftui.dev): reactive UI, woven from [Effect](https://effect.website).
|
|
4
4
|
|
|
5
5
|
The authoring layer of Weft. Build your component tree with `h`, compose it with `Boundary` and `List`, and let streams drive every update. Every node **is** an Effect: components return `Node<E, R>` (an alias for `Effect.Effect<ElementDescriptor, E, R>`), so error and requirement channels accumulate through the tree and every Effect combinator applies to nodes directly.
|
|
6
6
|
|
|
7
|
-
This package is renderer-agnostic
|
|
7
|
+
This package is renderer-agnostic. Pair it with [`@weftui/dom`](https://weftui.dev/docs/reference/dom) to render to the browser and the server.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -20,18 +20,18 @@ Weft tracks Effect 4's beta line. This release is built and tested against `effe
|
|
|
20
20
|
|
|
21
21
|
| Export | What it is |
|
|
22
22
|
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
-
| `h` | Proxy namespace of element builders
|
|
24
|
-
| `Component` | `Component.gen` / `Component.make
|
|
23
|
+
| `h` | Proxy namespace of element builders: `h.div`, `h.span`, `h.button`, … plus `h.fragment` for wrapper-less groups. |
|
|
24
|
+
| `Component` | `Component.gen` / `Component.make`: reusable components whose reactive prop channels propagate to the call site. |
|
|
25
25
|
| `Boundary` | Error boundaries (`catch`, `catchTag`, `catchTags`, `catchFilter`, `catchIf`, `catchCause`), plus `Boundary.suspend` (async fallbacks) and `Boundary.rpc` (server-data seam). |
|
|
26
|
-
| `List` | `List.each
|
|
26
|
+
| `List` | `List.each`: the keyed list combinator; renders once per key and reconciles across emissions. |
|
|
27
27
|
| `Source` | The reactive prop vocabulary (`A \| Effect \| Stream \| Subscribable`) + `Source.toSubscribable`. |
|
|
28
|
-
| `Node<E,R>` | The core tree type
|
|
28
|
+
| `Node<E,R>` | The core tree type: an alias for `Effect.Effect<ElementDescriptor, E, R>`. |
|
|
29
29
|
|
|
30
30
|
## Example
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
33
|
import { h } from "@weftui/core";
|
|
34
|
-
import {
|
|
34
|
+
import { WeftApp } from "@weftui/dom/client";
|
|
35
35
|
import { Effect, SubscriptionRef } from "effect";
|
|
36
36
|
|
|
37
37
|
const Counter = () =>
|
|
@@ -45,7 +45,8 @@ const Counter = () =>
|
|
|
45
45
|
]);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const app = WeftApp.make();
|
|
49
|
+
void Effect.runPromise(WeftApp.mount(app, Counter(), document.getElementById("root")!));
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
## Documentation
|
|
@@ -53,9 +54,9 @@ void Effect.runPromise(mount(Counter(), document.getElementById("root")!));
|
|
|
53
54
|
- Full docs: **https://weftui.dev**
|
|
54
55
|
- `@weftui/core` API reference: **https://weftui.dev/docs/reference/core**
|
|
55
56
|
- The rendering model (why no virtual DOM): **https://weftui.dev/docs/explanation/rendering-model**
|
|
56
|
-
- Bundled with this package: see the [`./docs`](./docs) directory in `node_modules/@weftui/core/docs
|
|
57
|
+
- Bundled with this package: see the [`./docs`](./docs) directory in `node_modules/@weftui/core/docs`. The complete tutorial, how-to, explanation, and reference tree ships on disk for offline and agent use.
|
|
57
58
|
|
|
58
|
-
**New to Effect?** Read the [Effect docs](https://effect.website/docs/getting-started/introduction) first
|
|
59
|
+
**New to Effect?** Read the [Effect docs](https://effect.website/docs/getting-started/introduction) first, since Weft assumes the fundamentals.
|
|
59
60
|
|
|
60
61
|
## License
|
|
61
62
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Cause, Effect, Option, Scope, Stream, SubscriptionRef } from "effect";
|
|
2
|
-
|
|
3
|
-
//#region src/subscribable/index.d.ts
|
|
4
2
|
declare namespace index_d_exports {
|
|
5
3
|
export { Subscribable, TypeId, changes, get, isSubscribable, make };
|
|
6
4
|
}
|
|
@@ -10491,7 +10489,7 @@ declare namespace DataType {
|
|
|
10491
10489
|
}
|
|
10492
10490
|
//#endregion
|
|
10493
10491
|
//#region src/source/source.d.ts
|
|
10494
|
-
declare const NoPropValue_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => Cause.YieldableError & {
|
|
10492
|
+
declare const NoPropValue_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
10495
10493
|
readonly _tag: "NoPropValue";
|
|
10496
10494
|
} & Readonly<A>;
|
|
10497
10495
|
/**
|
|
@@ -10515,7 +10513,7 @@ declare namespace Source {
|
|
|
10515
10513
|
* contributes its value channel; a static value is itself.
|
|
10516
10514
|
*
|
|
10517
10515
|
* Checked in the same order as `OpenPropSource` (`combinator/types.ts`) so an
|
|
10518
|
-
* `Effect
|
|
10516
|
+
* `Effect`, which is itself iterable for generators, never reaches the static
|
|
10519
10517
|
* fallback. The props-object analog is `PropsE`/`PropsR` in `combinator/types.ts`.
|
|
10520
10518
|
*/
|
|
10521
10519
|
type Success<S> = S extends Stream.Stream<infer A, any, any> ? A : S extends Effect.Effect<infer A, any, any> ? A : S extends Subscribable<infer A, any, any> ? A : S;
|
|
@@ -10543,7 +10541,7 @@ declare namespace Source {
|
|
|
10543
10541
|
//#endregion
|
|
10544
10542
|
//#region src/types/html/attributes.d.ts
|
|
10545
10543
|
type HTMLAttributeSource<T> = Source.Source<T | undefined>;
|
|
10546
|
-
type StyleProperties = { [K in keyof Properties]?: HTMLAttributeSource<Properties[K]
|
|
10544
|
+
type StyleProperties = { [K in keyof Properties]?: HTMLAttributeSource<Properties[K]>; };
|
|
10547
10545
|
type StyleAttributeValue = string | StyleProperties | Source.Source<string> | Source.Source<StyleProperties>;
|
|
10548
10546
|
//#endregion
|
|
10549
10547
|
//#region src/types/html/aria.d.ts
|
|
@@ -10844,7 +10842,15 @@ type HTMLReferrerPolicy = "no-referrer" | "no-referrer-when-downgrade" | "origin
|
|
|
10844
10842
|
type HTMLRole = "alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "caption" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "command" | "complementary" | "composite" | "contentinfo" | "definition" | "deletion" | "dialog" | "directory" | "document" | "emphasis" | "feed" | "figure" | "form" | "generic" | "grid" | "gridcell" | "group" | "heading" | "img" | "input" | "insertion" | "landmark" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "meter" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "range" | "region" | "roletype" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "section" | "sectionhead" | "select" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "structure" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "timer" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem" | "widget" | "window";
|
|
10845
10843
|
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
|
|
10846
10844
|
children?: HTMLAttributeSource<Renderable>;
|
|
10847
|
-
|
|
10845
|
+
/**
|
|
10846
|
+
* A ref to this element, or an array of refs that all receive it (fan-out,
|
|
10847
|
+
* typically from `Props.merge`). The array arm accepts refs of any element
|
|
10848
|
+
* type because `SubscriptionRef` is invariant: composing a behavior
|
|
10849
|
+
* primitive's `SubscriptionRef<Option<HTMLElement>>` with a caller's
|
|
10850
|
+
* `SubscriptionRef<Option<HTMLInputElement>>` is the point of fan-out, and an
|
|
10851
|
+
* exactly-typed array would reject it. The single-ref arm stays precise.
|
|
10852
|
+
*/
|
|
10853
|
+
ref?: SubscriptionRef.SubscriptionRef<Option.Option<T>> | ReadonlyArray<SubscriptionRef.SubscriptionRef<Option.Option<any>>>;
|
|
10848
10854
|
/**
|
|
10849
10855
|
* Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout.
|
|
10850
10856
|
*/
|
|
@@ -10978,7 +10984,7 @@ interface AHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
10978
10984
|
*/
|
|
10979
10985
|
download?: HTMLAttributeSource<string>;
|
|
10980
10986
|
/**
|
|
10981
|
-
* The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs
|
|
10987
|
+
* The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs, and they can use any URL scheme supported by browsers: Sections of a page with fragment URLs Pieces of media files with media fragments Telephone numbers with tel: URLs Email addresses with mailto: URLs While web browsers may not support other URL schemes, web sites can with registerProtocolHandler()
|
|
10982
10988
|
*/
|
|
10983
10989
|
href?: HTMLAttributeSource<string>;
|
|
10984
10990
|
/**
|
|
@@ -11357,7 +11363,7 @@ interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11357
11363
|
*/
|
|
11358
11364
|
formnovalidate?: HTMLAttributeSource<boolean>;
|
|
11359
11365
|
/**
|
|
11360
|
-
* If the button is a submit button, this attribute is a author-defined name or standardized, underscore-prefixed keyword indicating where to display the response from submitting the form. This is the name of, or keyword for, a browsing context (a tab, window, or `<iframe>`). If this attribute is specified, it overrides the target attribute of the button's form owner. The following keywords have special meanings: _self: Load the response into the same browsing context as the current one. This is the default if the attribute is not specified. _blank: Load the response into a new unnamed browsing context
|
|
11366
|
+
* If the button is a submit button, this attribute is a author-defined name or standardized, underscore-prefixed keyword indicating where to display the response from submitting the form. This is the name of, or keyword for, a browsing context (a tab, window, or `<iframe>`). If this attribute is specified, it overrides the target attribute of the button's form owner. The following keywords have special meanings: _self: Load the response into the same browsing context as the current one. This is the default if the attribute is not specified. _blank: Load the response into a new unnamed browsing context, usually a new tab or window, depending on the user's browser settings. _parent: Load the response into the parent browsing context of the current one. If there is no parent, this option behaves the same way as _self. _top: Load the response into the top-level browsing context (that is, the browsing context that is an ancestor of the current one, and has no parent). If there is no parent, this option behaves the same way as _self.
|
|
11361
11367
|
*/
|
|
11362
11368
|
formtarget?: HTMLAttributeSource<string>;
|
|
11363
11369
|
/**
|
|
@@ -11479,7 +11485,7 @@ interface DelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11479
11485
|
}
|
|
11480
11486
|
interface DetailsHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
11481
11487
|
/**
|
|
11482
|
-
* This Boolean attribute indicates whether or not the details
|
|
11488
|
+
* This Boolean attribute indicates whether or not the details (that is, the contents of the `<details>` element) are currently visible. The details are shown when this attribute exists, or hidden when this attribute is absent. By default this attribute is absent which means the details are not visible. Note: You have to remove this attribute entirely to make the details hidden. open="false" makes the details visible because this attribute is Boolean.
|
|
11483
11489
|
*/
|
|
11484
11490
|
open?: HTMLAttributeSource<boolean>;
|
|
11485
11491
|
}
|
|
@@ -11519,7 +11525,7 @@ interface FieldsetHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11519
11525
|
*/
|
|
11520
11526
|
disabled?: HTMLAttributeSource<boolean>;
|
|
11521
11527
|
/**
|
|
11522
|
-
* This attribute takes the value of the id attribute of a `<form>` element you want the `<fieldset>` to be part of, even if it is not inside the form. Please note that usage of this is confusing
|
|
11528
|
+
* This attribute takes the value of the id attribute of a `<form>` element you want the `<fieldset>` to be part of, even if it is not inside the form. Please note that usage of this is confusing: if you want the `<input>` elements inside the `<fieldset>` to be associated with the form, you need to use the form attribute directly on those elements. You can check which elements are associated with a form via JavaScript, using HTMLFormElement.elements.
|
|
11523
11529
|
*/
|
|
11524
11530
|
form?: HTMLAttributeSource<string>;
|
|
11525
11531
|
/**
|
|
@@ -11723,7 +11729,7 @@ interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11723
11729
|
*/
|
|
11724
11730
|
referrerpolicy?: HTMLAttributeSource<HTMLReferrerPolicy>;
|
|
11725
11731
|
/**
|
|
11726
|
-
* Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions: allow-downloads-without-user-activation : Allows for downloads to occur without a gesture from the user. allow-downloads: Allows for downloads to occur with a gesture from the user. allow-forms: Allows the resource to submit forms. If this keyword is not used, form submission is blocked. allow-modals: Lets the resource open modal windows. allow-orientation-lock: Lets the resource lock the screen orientation. allow-pointer-lock: Lets the resource use the Pointer Lock API. allow-popups: Allows popups (such as window.open(), target="_blank", or showModalDialog()). If this keyword is not used, the popup will silently fail to open. allow-popups-to-escape-sandbox: Lets the sandboxed document open new windows without those windows inheriting the sandboxing. For example, this can safely sandbox an advertisement without forcing the same restrictions upon the page the ad links to. allow-presentation: Lets the resource start a presentation session. allow-same-origin: If this token is not used, the resource is treated as being from a special origin that always fails the same-origin policy (potentially preventing access to data storage/cookies and some JavaScript APIs). allow-scripts: Lets the resource run scripts (but not create popup windows). allow-storage-access-by-user-activation : Lets the resource request access to the parent's storage capabilities with the Storage Access API. allow-top-navigation: Lets the resource navigate the top-level browsing context (the one named _top). allow-top-navigation-by-user-activation: Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture. Notes about sandboxing: When the embedded document has the same origin as the embedding page, it is strongly discouraged to use both allow-scripts and allow-same-origin, as that lets the embedded document remove the sandbox attribute
|
|
11732
|
+
* Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions: allow-downloads-without-user-activation : Allows for downloads to occur without a gesture from the user. allow-downloads: Allows for downloads to occur with a gesture from the user. allow-forms: Allows the resource to submit forms. If this keyword is not used, form submission is blocked. allow-modals: Lets the resource open modal windows. allow-orientation-lock: Lets the resource lock the screen orientation. allow-pointer-lock: Lets the resource use the Pointer Lock API. allow-popups: Allows popups (such as window.open(), target="_blank", or showModalDialog()). If this keyword is not used, the popup will silently fail to open. allow-popups-to-escape-sandbox: Lets the sandboxed document open new windows without those windows inheriting the sandboxing. For example, this can safely sandbox an advertisement without forcing the same restrictions upon the page the ad links to. allow-presentation: Lets the resource start a presentation session. allow-same-origin: If this token is not used, the resource is treated as being from a special origin that always fails the same-origin policy (potentially preventing access to data storage/cookies and some JavaScript APIs). allow-scripts: Lets the resource run scripts (but not create popup windows). allow-storage-access-by-user-activation : Lets the resource request access to the parent's storage capabilities with the Storage Access API. allow-top-navigation: Lets the resource navigate the top-level browsing context (the one named _top). allow-top-navigation-by-user-activation: Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture. Notes about sandboxing: When the embedded document has the same origin as the embedding page, it is strongly discouraged to use both allow-scripts and allow-same-origin, as that lets the embedded document remove the sandbox attribute, making it no more secure than not using the sandbox attribute at all. Sandboxing is useless if the attacker can display content outside a sandboxed iframe, such as if the viewer opens the frame in a new tab. Such content should be also served from a separate origin to limit potential damage. The sandbox attribute is unsupported in Internet Explorer 9 and earlier.
|
|
11727
11733
|
*/
|
|
11728
11734
|
sandbox?: HTMLAttributeSource<HTMLIframeSandbox>;
|
|
11729
11735
|
/**
|
|
@@ -11839,7 +11845,7 @@ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11839
11845
|
*/
|
|
11840
11846
|
autocorrect?: HTMLAttributeSource<string>;
|
|
11841
11847
|
/**
|
|
11842
|
-
* Introduced in the HTML Media Capture specification and valid for the file input type only, the capture attribute defines which media
|
|
11848
|
+
* Introduced in the HTML Media Capture specification and valid for the file input type only, the capture attribute defines which media (microphone, video, or camera) should be used to capture a new file for upload with file upload control in supporting scenarios. See the file input type.
|
|
11843
11849
|
*/
|
|
11844
11850
|
capture?: HTMLAttributeSource<string>;
|
|
11845
11851
|
/**
|
|
@@ -11939,7 +11945,7 @@ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11939
11945
|
*/
|
|
11940
11946
|
required?: HTMLAttributeSource<boolean>;
|
|
11941
11947
|
/**
|
|
11942
|
-
* The results attribute
|
|
11948
|
+
* The results attribute (supported only by Safari) is a numeric value that lets you override the maximum number of entries to be displayed in the `<input>` element's natively-provided drop-down menu of previous search queries.The value must be a non-negative decimal number. If not provided, or an invalid value is given, the browser's default maximum number of entries is used.
|
|
11943
11949
|
*/
|
|
11944
11950
|
results?: HTMLAttributeSource<string>;
|
|
11945
11951
|
/**
|
|
@@ -11951,7 +11957,7 @@ interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
11951
11957
|
*/
|
|
11952
11958
|
src?: HTMLAttributeSource<string>;
|
|
11953
11959
|
/**
|
|
11954
|
-
* Valid for the numeric input types, including number, date/time input types, and range, the step attribute is a number that specifies the granularity that the value must adhere to. If not explicitly included: step defaults to 1 for number and range. For the date/time input types, step is expressed in seconds, with the default step being 60 seconds. The step scale factor is 1000 (which converts the seconds to milliseconds, as used in other algorithms). The value must be a positive number
|
|
11960
|
+
* Valid for the numeric input types, including number, date/time input types, and range, the step attribute is a number that specifies the granularity that the value must adhere to. If not explicitly included: step defaults to 1 for number and range. For the date/time input types, step is expressed in seconds, with the default step being 60 seconds. The step scale factor is 1000 (which converts the seconds to milliseconds, as used in other algorithms). The value must be a positive number (integer or float) or the special value any, which means no stepping is implied, and any value is allowed (barring other constraints, such as min and max). If any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping: the min value and increments of the step value, up to the max value, if specified. For example, if you have `<input type="number" min="10" step="2">`, then any even integer, 10 or greater, is valid. If omitted, `<input type="number">`, any integer is valid, but floats (like 4.2) are not valid, because step defaults to 1. For 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as `<input type="number" min="-5.2">` Note: When the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid pseudoclass. See Client-side validation for more information.
|
|
11955
11961
|
*/
|
|
11956
11962
|
step?: HTMLAttributeSource<number | string>;
|
|
11957
11963
|
/**
|
|
@@ -12005,7 +12011,7 @@ interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
12005
12011
|
}
|
|
12006
12012
|
interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
12007
12013
|
/**
|
|
12008
|
-
* The value of the for attribute must be a single id for a labelable form-related element in the same document as the `<label>` element. So, any given label element can be associated with only one form control. The first element in the document with an id attribute matching the value of the for attribute is the labeled control for this label element
|
|
12014
|
+
* The value of the for attribute must be a single id for a labelable form-related element in the same document as the `<label>` element. So, any given label element can be associated with only one form control. The first element in the document with an id attribute matching the value of the for attribute is the labeled control for this label element. If the element with that id is actually a labelable element. If it is not a labelable element, then the for attribute has no effect. If there are other elements that also match the id value, later in the document, they are not considered. Multiple label elements can be given the same value for their for attribute; doing so causes the associated form control (the form control that for value references) to have multiple labels. Note: A `<label>` element can have both a for attribute and a contained control element, as long as the for attribute points to the contained control element.
|
|
12009
12015
|
*/
|
|
12010
12016
|
for?: HTMLAttributeSource<string>;
|
|
12011
12017
|
/** */
|
|
@@ -12057,11 +12063,11 @@ interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
12057
12063
|
*/
|
|
12058
12064
|
imagesrcset?: HTMLAttributeSource<string>;
|
|
12059
12065
|
/**
|
|
12060
|
-
* Contains inline metadata
|
|
12066
|
+
* Contains inline metadata: a base64-encoded cryptographic hash of the resource (file) you're telling the browser to fetch. The browser can use this to verify that the fetched resource has been delivered free of unexpected manipulation. See Subresource Integrity.
|
|
12061
12067
|
*/
|
|
12062
12068
|
integrity?: HTMLAttributeSource<string>;
|
|
12063
12069
|
/**
|
|
12064
|
-
* This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query. This attribute is mainly useful when linking to external stylesheets
|
|
12070
|
+
* This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query. This attribute is mainly useful when linking to external stylesheets: it allows the user agent to pick the best adapted one for the device it runs on. Notes: In HTML 4, this can only be a simple white-space-separated list of media description literals, i.e., media types and groups, where defined and allowed as values for this attribute, such as print, screen, aural, braille. HTML5 extended this to any kind of media queries, which are a superset of the allowed values of HTML 4. Browsers not supporting CSS3 Media Queries won't necessarily recognize the adequate link; do not forget to set fallback links, the restricted set of media queries defined in HTML 4.
|
|
12065
12071
|
*/
|
|
12066
12072
|
media?: HTMLAttributeSource<number | string | (number | string)[]>;
|
|
12067
12073
|
/**
|
|
@@ -12193,7 +12199,7 @@ interface MetaHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
12193
12199
|
*/
|
|
12194
12200
|
content?: HTMLAttributeSource<string>;
|
|
12195
12201
|
/**
|
|
12196
|
-
* Defines a pragma directive. The attribute is named http-equiv(alent) because all the allowed values are names of particular HTTP headers: content-security-policy Allows page authors to define a content policy for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks. content-type Declares the MIME type and character encoding of the document. If specified, the content attribute must have the value "text/html; charset=utf-8". This is equivalent to a `<meta>` element with the charset attribute specified, and carries the same restriction on placement within the document. Note: Can only be used in documents served with a text/html
|
|
12202
|
+
* Defines a pragma directive. The attribute is named http-equiv(alent) because all the allowed values are names of particular HTTP headers: content-security-policy Allows page authors to define a content policy for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks. content-type Declares the MIME type and character encoding of the document. If specified, the content attribute must have the value "text/html; charset=utf-8". This is equivalent to a `<meta>` element with the charset attribute specified, and carries the same restriction on placement within the document. Note: Can only be used in documents served with a text/html, not in documents served with an XML MIME type. default-style Sets the name of the default CSS style sheet set. x-ua-compatible If specified, the content attribute must have the value "IE=edge". User agents are required to ignore this pragma. refresh This instruction specifies: The number of seconds until the page should be reloaded - only if the content attribute contains a positive integer. The number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';url=', and a valid URL. Accessibility concerns Pages set with a refresh value run the risk of having the time interval being too short. People navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. The abrupt, unannounced updating of the page content may also be disorienting for people experiencing low vision conditions. MDN Understanding WCAG, Guideline 2.1 explanations MDN Understanding WCAG, Guideline 3.1 explanations Understanding Success Criterion 2.2.1 | W3C Understanding WCAG 2.0 Understanding Success Criterion 2.2.4 | W3C Understanding WCAG 2.0 Understanding Success Criterion 3.2.5 | W3C Understanding WCAG 2.0
|
|
12197
12203
|
*/
|
|
12198
12204
|
"http-equiv"?: HTMLAttributeSource<"content-type" | "default-style" | "refresh" | "x-ua-compatible" | "content-security-policy">;
|
|
12199
12205
|
/** */
|
|
@@ -12419,7 +12425,7 @@ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
12419
12425
|
*/
|
|
12420
12426
|
crossorigin?: HTMLAttributeSource<HTMLCrossorigin>;
|
|
12421
12427
|
/**
|
|
12422
|
-
* This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded. Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating. This attribute must not be used if the src attribute is absent (i.e. for inline scripts), in this case it would have no effect. The defer attribute has no effect on module scripts
|
|
12428
|
+
* This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded. Scripts with the defer attribute will prevent the DOMContentLoaded event from firing until the script has loaded and finished evaluating. This attribute must not be used if the src attribute is absent (i.e. for inline scripts), in this case it would have no effect. The defer attribute has no effect on module scripts: they defer by default. Scripts with the defer attribute will execute in the order in which they appear in the document. This attribute allows the elimination of parser-blocking JavaScript where the browser would have to load and evaluate scripts before continuing to parse. async has a similar effect in this case.
|
|
12423
12429
|
*/
|
|
12424
12430
|
defer?: HTMLAttributeSource<boolean>;
|
|
12425
12431
|
/**
|
|
@@ -12431,7 +12437,7 @@ interface ScriptHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
12431
12437
|
*/
|
|
12432
12438
|
language?: HTMLAttributeSource<string>;
|
|
12433
12439
|
/**
|
|
12434
|
-
* This Boolean attribute is set to indicate that the script should not be executed in browsers that support ES2015 modules
|
|
12440
|
+
* This Boolean attribute is set to indicate that the script should not be executed in browsers that support ES2015 modules. In effect, this can be used to serve fallback scripts to older browsers that do not support modular JavaScript code.
|
|
12435
12441
|
*/
|
|
12436
12442
|
nomodule?: HTMLAttributeSource<boolean>;
|
|
12437
12443
|
/**
|
|
@@ -12861,7 +12867,7 @@ interface TrackHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
|
12861
12867
|
*/
|
|
12862
12868
|
label?: HTMLAttributeSource<string>;
|
|
12863
12869
|
/**
|
|
12864
|
-
* Address of the track (.vtt file). Must be a valid URL. This attribute must be specified and its URL value must have the same origin as the document
|
|
12870
|
+
* Address of the track (.vtt file). Must be a valid URL. This attribute must be specified and its URL value must have the same origin as the document, unless the `<audio>` or `<video>` parent element of the track element has a crossorigin attribute.
|
|
12865
12871
|
*/
|
|
12866
12872
|
src?: HTMLAttributeSource<string>;
|
|
12867
12873
|
/**
|
|
@@ -13318,7 +13324,7 @@ interface HTMLElements {
|
|
|
13318
13324
|
*/
|
|
13319
13325
|
colgroup: ColgroupHTMLAttributes<HTMLTableColElement>;
|
|
13320
13326
|
/**
|
|
13321
|
-
* The `<content>` HTML element
|
|
13327
|
+
* The `<content>` HTML element (an obsolete part of the Web Components suite of technologies) was used inside of Shadow DOM as an insertion point, and wasn't meant to be used in ordinary HTML. It has now been replaced by the `<slot>` element, which creates a point in the DOM at which a shadow DOM can be inserted.
|
|
13322
13328
|
*
|
|
13323
13329
|
* **Content:** Flow content.
|
|
13324
13330
|
*
|
|
@@ -13381,7 +13387,7 @@ interface HTMLElements {
|
|
|
13381
13387
|
*
|
|
13382
13388
|
* | Attribute | Type | Description
|
|
13383
13389
|
* |--|--|--
|
|
13384
|
-
* | `open` | _Boolean_ | This Boolean attribute indicates whether or not the details
|
|
13390
|
+
* | `open` | _Boolean_ | This Boolean attribute indicates whether or not the details (that is, the contents of the `<details>` element) are currently visible.
|
|
13385
13391
|
* | `tabindex` | _Int_ | .
|
|
13386
13392
|
*
|
|
13387
13393
|
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details)
|
|
@@ -13733,7 +13739,7 @@ interface HTMLElements {
|
|
|
13733
13739
|
* | `autocomplete` | _AutoComplete_ | (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide.
|
|
13734
13740
|
* | `autocorrect` | _String_ | A Safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field.
|
|
13735
13741
|
* | `autofocus` | _String_ | A Boolean attribute which, if present, indicates that the input should automatically have focus when the page has finished loading (or when the `<dialog>` containing the element has been displayed).
|
|
13736
|
-
* | `capture` | _String_ | Introduced in the HTML Media Capture specification and valid for the file input type only, the capture attribute defines which media
|
|
13742
|
+
* | `capture` | _String_ | Introduced in the HTML Media Capture specification and valid for the file input type only, the capture attribute defines which media (microphone, video, or camera) should be used to capture a new file for upload with file upload control in supporting scenarios.
|
|
13737
13743
|
* | `checked` | _Boolean_ | Valid for both radio and checkbox types, checked is a Boolean attribute.
|
|
13738
13744
|
* | `dirname` | _String_ | Valid for text and search input types only, the dirname attribute enables the submission of the directionality of the element.
|
|
13739
13745
|
* | `disabled` | _Boolean_ | A Boolean attribute which, if present, indicates that the user should not be able to interact with the input.
|
|
@@ -13760,7 +13766,7 @@ interface HTMLElements {
|
|
|
13760
13766
|
* | `placeholder` | _String_ | The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field.
|
|
13761
13767
|
* | `readonly` | _Boolean_ | A Boolean attribute which, if present, indicates that the user should not be able to edit the value of the input.
|
|
13762
13768
|
* | `required` | _Boolean_ | required is a Boolean attribute which, if present, indicates that the user must specify a value for the input before the owning form can be submitted.
|
|
13763
|
-
* | `results` | _String_ | The results attribute
|
|
13769
|
+
* | `results` | _String_ | The results attribute (supported only by Safari) is a numeric value that lets you override the maximum number of entries to be displayed in the `<input>` element's natively-provided drop-down menu of previous search queries.
|
|
13764
13770
|
* | `size` | _NonZeroUint_ | Valid for email, password, tel, and text input types only.
|
|
13765
13771
|
* | `src` | _URL_ | Valid for the image input button only, the src is string specifying the URL of the image file to display to represent the graphical submit button.
|
|
13766
13772
|
* | `step` | _String_ | Valid for the numeric input types, including number, date/time input types, and range, the step attribute is a number that specifies the granularity that the value must adhere to.
|
|
@@ -13866,7 +13872,7 @@ interface HTMLElements {
|
|
|
13866
13872
|
* | `hreflang` | _BCP47_ | This attribute indicates the language of the linked resource.
|
|
13867
13873
|
* | `imagesizes` | _SourceSizeList_ | For rel="preload" and as="image" only, the imagesizes attribute is a sizes attribute that indicates to preload the appropriate resource used by an img element with corresponding values for its srcset and sizes attributes.
|
|
13868
13874
|
* | `imagesrcset` | _SrcSet_ | For rel="preload" and as="image" only, the imagesrcset attribute is a sourceset attribute that indicates to preload the appropriate resource used by an img element with corresponding values for its srcset and sizes attributes.
|
|
13869
|
-
* | `integrity` | _String_ | Contains inline metadata
|
|
13875
|
+
* | `integrity` | _String_ | Contains inline metadata: a base64-encoded cryptographic hash of the resource (file) you’re telling the browser to fetch.
|
|
13870
13876
|
* | `media` | _MediaQueryList_ | This attribute specifies the media that the linked resource applies to.
|
|
13871
13877
|
* | `methods` | _String_ | The value of this attribute provides information about the functions that might be performed on an object.
|
|
13872
13878
|
* | `prefetch` | _String_ | Identifies a resource that might be required by the next navigation and that the user agent should retrieve it.
|
|
@@ -14067,7 +14073,7 @@ interface HTMLElements {
|
|
|
14067
14073
|
*/
|
|
14068
14074
|
object: ObjectHTMLAttributes<HTMLObjectElement>;
|
|
14069
14075
|
/**
|
|
14070
|
-
* The `<ol>` HTML element represents an ordered list of items
|
|
14076
|
+
* The `<ol>` HTML element represents an ordered list of items, typically rendered as a numbered list.
|
|
14071
14077
|
*
|
|
14072
14078
|
* **Content:** Zero or more `<li>`, `<script>` and `<template>` elements.
|
|
14073
14079
|
*
|
|
@@ -14278,7 +14284,7 @@ interface HTMLElements {
|
|
|
14278
14284
|
* | `defer` | _Boolean_ | This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded.
|
|
14279
14285
|
* | `integrity` | _String_ | This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected manipulation.
|
|
14280
14286
|
* | `language` | _String_ | Like the type attribute, this attribute identifies the scripting language in use.
|
|
14281
|
-
* | `nomodule` | _Boolean_ | This Boolean attribute is set to indicate that the script should not be executed in browsers that support ES2015 modules
|
|
14287
|
+
* | `nomodule` | _Boolean_ | This Boolean attribute is set to indicate that the script should not be executed in browsers that support ES2015 modules. In effect, this can be used to serve fallback scripts to older browsers that do not support modular JavaScript code.
|
|
14282
14288
|
* | `nonce` | _String_ | A cryptographic nonce (number used once) to allow scripts in a script-src Content-Security-Policy.
|
|
14283
14289
|
* | `referrerpolicy` | _ReferrerPolicy_ | Indicates which referrer to send when fetching the script, or resources fetched by the script: no-referrer: The Referer header will not be sent.
|
|
14284
14290
|
* | `src` | _URL_ | This attribute specifies the URI of an external script; this can be used as an alternative to embedding a script directly within a document.
|
|
@@ -14315,7 +14321,7 @@ interface HTMLElements {
|
|
|
14315
14321
|
*/
|
|
14316
14322
|
select: SelectHTMLAttributes<HTMLSelectElement>;
|
|
14317
14323
|
/**
|
|
14318
|
-
* The `<shadow>` HTML element
|
|
14324
|
+
* The `<shadow>` HTML element (an obsolete part of the Web Components technology suite) was intended to be used as a shadow DOM insertion point. You might have used it if you have created multiple shadow roots under a shadow host. It is not useful in ordinary HTML.
|
|
14319
14325
|
*
|
|
14320
14326
|
* **Content:** Flow content
|
|
14321
14327
|
*
|
|
@@ -14323,7 +14329,7 @@ interface HTMLElements {
|
|
|
14323
14329
|
*/
|
|
14324
14330
|
shadow: HTMLAttributes<HTMLElement>;
|
|
14325
14331
|
/**
|
|
14326
|
-
* The `<slot>` HTML element
|
|
14332
|
+
* The `<slot>` HTML element (part of the Web Components technology suite) is a placeholder inside a web component that you can fill with your own markup, which lets you create separate DOM trees and present them together.
|
|
14327
14333
|
*
|
|
14328
14334
|
* **Content:** Transparent
|
|
14329
14335
|
*
|
|
@@ -14433,7 +14439,7 @@ interface HTMLElements {
|
|
|
14433
14439
|
*/
|
|
14434
14440
|
sup: HTMLAttributes<HTMLElement>;
|
|
14435
14441
|
/**
|
|
14436
|
-
* The `<table>` HTML element represents tabular data
|
|
14442
|
+
* The `<table>` HTML element represents tabular data: information presented in a two-dimensional table comprised of rows and columns of cells containing data.
|
|
14437
14443
|
*
|
|
14438
14444
|
* **Content:** In this order: an optional `<caption>` element, zero or more `<colgroup>` elements, an optional `<thead>` element, either one of the following: zero or more `<tbody>` elements one or more `<tr>` elements an optional `<tfoot>` element
|
|
14439
14445
|
*
|
|
@@ -14626,7 +14632,7 @@ interface HTMLElements {
|
|
|
14626
14632
|
*/
|
|
14627
14633
|
tr: TrHTMLAttributes<HTMLTableRowElement>;
|
|
14628
14634
|
/**
|
|
14629
|
-
* The `<track>` HTML element is used as a child of the media elements, `<audio>` and `<video>`. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files)
|
|
14635
|
+
* The `<track>` HTML element is used as a child of the media elements, `<audio>` and `<video>`. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files): Web Video Text Tracks.
|
|
14630
14636
|
*
|
|
14631
14637
|
* | Attribute | Type | Description
|
|
14632
14638
|
* |--|--|--
|
|
@@ -14703,7 +14709,7 @@ interface HTMLElements {
|
|
|
14703
14709
|
*/
|
|
14704
14710
|
video: VideoHTMLAttributes<HTMLVideoElement>;
|
|
14705
14711
|
/**
|
|
14706
|
-
* The `<wbr>` HTML element represents a word break opportunity
|
|
14712
|
+
* The `<wbr>` HTML element represents a word break opportunity: a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location.
|
|
14707
14713
|
*
|
|
14708
14714
|
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr)
|
|
14709
14715
|
*/
|
|
@@ -14722,7 +14728,13 @@ type ImagePreserveAspectRatio = SVGPreserveAspectRatio | "defer none" | "defer x
|
|
|
14722
14728
|
type SVGUnits = "userSpaceOnUse" | "objectBoundingBox";
|
|
14723
14729
|
interface SVGAttributes<T> extends DOMAttributes<T> {
|
|
14724
14730
|
children?: HTMLAttributeSource<Renderable>;
|
|
14725
|
-
|
|
14731
|
+
/**
|
|
14732
|
+
* A ref to this element, or an array of refs that all receive it (fan-out,
|
|
14733
|
+
* typically from `Props.merge`). The array arm accepts refs of any element
|
|
14734
|
+
* type because `SubscriptionRef` is invariant; see the note on
|
|
14735
|
+
* `HTMLAttributes.ref`.
|
|
14736
|
+
*/
|
|
14737
|
+
ref?: SubscriptionRef.SubscriptionRef<Option.Option<T>> | ReadonlyArray<SubscriptionRef.SubscriptionRef<Option.Option<any>>>;
|
|
14726
14738
|
id?: HTMLAttributeSource<string>;
|
|
14727
14739
|
lang?: HTMLAttributeSource<string>;
|
|
14728
14740
|
/**
|
|
@@ -15195,7 +15207,7 @@ type ElementType = symbol | string | ((props: Record<string, unknown>) => unknow
|
|
|
15195
15207
|
/**
|
|
15196
15208
|
* Virtual element descriptor produced by `h`, `h.fragment`, `Suspense`, and
|
|
15197
15209
|
* components, and consumed by the renderers. This is the resolved value of a
|
|
15198
|
-
* {@link Node}
|
|
15210
|
+
* {@link Node}: a plain object, not a browser DOM `Node`.
|
|
15199
15211
|
*/
|
|
15200
15212
|
interface ElementDescriptor {
|
|
15201
15213
|
readonly type: ElementType;
|