@voidable/ui 0.6.1 → 0.8.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 +168 -9
- package/dist/angular/index.d.ts +20 -0
- package/dist/angular/index.js +78 -0
- package/dist/autoloader-core.d.ts +45 -0
- package/dist/autoloader-table.generated.d.ts +5 -0
- package/dist/autoloader.d.ts +13 -0
- package/dist/autoloader.js +229 -0
- package/dist/base.d.ts +173 -2
- package/dist/base.js +2 -9
- package/dist/chunks/base-CMruMbxC.js +824 -0
- package/dist/chunks/disclosure-Bj_49GcC.js +23 -0
- package/dist/chunks/dismiss-Drsy_dE5.js +37 -0
- package/dist/chunks/form-control-C0vH6gii.js +300 -0
- package/dist/chunks/keyboard-MQpfTX5I.js +46 -0
- package/dist/chunks/keyboard-activation-CV0m4hkn.js +29 -0
- package/dist/chunks/modal-D_YVy2vg.js +71 -0
- package/dist/chunks/overlay-BywGMcDW.js +467 -0
- package/dist/chunks/parts-D30c8OoG.js +229 -0
- package/dist/chunks/{shape-FJvZa8FW.js → shape-C_LW7EjG.js} +12 -4
- package/dist/components/accordion.d.ts +38 -10
- package/dist/components/accordion.js +51 -53
- package/dist/components/action-input.d.ts +64 -6
- package/dist/components/action-input.js +84 -41
- package/dist/components/alert.d.ts +24 -10
- package/dist/components/alert.js +26 -27
- package/dist/components/avatar.d.ts +8 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +8 -3
- package/dist/components/badge.js +2 -2
- package/dist/components/banner.d.ts +21 -10
- package/dist/components/banner.js +27 -27
- package/dist/components/bar-chart.d.ts +30 -6
- package/dist/components/bar-chart.js +29 -39
- package/dist/components/breadcrumbs.d.ts +19 -6
- package/dist/components/breadcrumbs.js +16 -22
- package/dist/components/button.d.ts +64 -10
- package/dist/components/button.js +70 -26
- package/dist/components/calendar.d.ts +65 -10
- package/dist/components/calendar.js +157 -106
- package/dist/components/card.d.ts +14 -9
- package/dist/components/card.js +8 -22
- package/dist/components/carousel.d.ts +65 -14
- package/dist/components/carousel.js +84 -93
- package/dist/components/charts/scale.d.ts +0 -1
- package/dist/components/charts/shape.d.ts +0 -1
- package/dist/components/checkbox-group.d.ts +38 -5
- package/dist/components/checkbox-group.js +61 -20
- package/dist/components/checkbox.d.ts +53 -7
- package/dist/components/checkbox.js +66 -29
- package/dist/components/collapsible.d.ts +29 -9
- package/dist/components/collapsible.js +42 -44
- package/dist/components/color-picker.d.ts +20 -4
- package/dist/components/color-picker.js +35 -29
- package/dist/components/combobox.d.ts +84 -10
- package/dist/components/combobox.js +142 -45
- package/dist/components/compose-input.d.ts +8 -1
- package/dist/components/compose-input.js +9 -3
- package/dist/components/dialog.d.ts +24 -20
- package/dist/components/dialog.js +8 -57
- package/dist/components/divider.d.ts +8 -1
- package/dist/components/divider.js +3 -3
- package/dist/components/donut-chart.d.ts +28 -5
- package/dist/components/donut-chart.js +55 -54
- package/dist/components/drawer.d.ts +19 -18
- package/dist/components/drawer.js +9 -53
- package/dist/components/dropdown-menu.d.ts +62 -7
- package/dist/components/dropdown-menu.js +124 -33
- package/dist/components/editable.d.ts +37 -3
- package/dist/components/editable.js +45 -24
- package/dist/components/error-fallback.d.ts +36 -5
- package/dist/components/error-fallback.js +73 -23
- package/dist/components/field.d.ts +38 -4
- package/dist/components/field.js +63 -21
- package/dist/components/file-upload.d.ts +23 -2
- package/dist/components/file-upload.js +47 -24
- package/dist/components/gauge.d.ts +48 -9
- package/dist/components/gauge.js +57 -55
- package/dist/components/hamburger.d.ts +19 -4
- package/dist/components/hamburger.js +28 -19
- package/dist/components/hover-card.d.ts +40 -14
- package/dist/components/hover-card.js +76 -59
- package/dist/components/indicator.d.ts +18 -7
- package/dist/components/indicator.js +16 -18
- package/dist/components/input.d.ts +70 -5
- package/dist/components/input.js +83 -20
- package/dist/components/line-chart.d.ts +27 -5
- package/dist/components/line-chart.js +19 -21
- package/dist/components/list.d.ts +10 -1
- package/dist/components/list.js +3 -3
- package/dist/components/menu.d.ts +67 -21
- package/dist/components/menu.js +116 -115
- package/dist/components/multiselect.d.ts +108 -13
- package/dist/components/multiselect.js +207 -70
- package/dist/components/nav-bar.d.ts +12 -7
- package/dist/components/nav-bar.js +11 -21
- package/dist/components/nav-menu.d.ts +52 -12
- package/dist/components/nav-menu.js +68 -70
- package/dist/components/number-input.d.ts +76 -8
- package/dist/components/number-input.js +117 -51
- package/dist/components/pagination.d.ts +19 -1
- package/dist/components/pagination.js +68 -7
- package/dist/components/panel.d.ts +16 -8
- package/dist/components/panel.js +20 -20
- package/dist/components/pin-input.d.ts +41 -4
- package/dist/components/pin-input.js +45 -27
- package/dist/components/popover.d.ts +29 -11
- package/dist/components/popover.js +47 -35
- package/dist/components/progress.d.ts +7 -3
- package/dist/components/progress.js +3 -3
- package/dist/components/radio-group.d.ts +30 -5
- package/dist/components/radio-group.js +56 -19
- package/dist/components/radio.d.ts +47 -7
- package/dist/components/radio.js +68 -29
- package/dist/components/scroll-area.d.ts +8 -5
- package/dist/components/scroll-area.js +19 -20
- package/dist/components/segmented-control.d.ts +52 -8
- package/dist/components/segmented-control.js +66 -36
- package/dist/components/select.d.ts +59 -12
- package/dist/components/select.js +96 -46
- package/dist/components/sidebar.d.ts +22 -3
- package/dist/components/sidebar.js +20 -10
- package/dist/components/skeleton.d.ts +5 -2
- package/dist/components/skeleton.js +4 -4
- package/dist/components/slider.d.ts +27 -5
- package/dist/components/slider.js +29 -17
- package/dist/components/spinner.d.ts +6 -2
- package/dist/components/spinner.js +3 -3
- package/dist/components/stat.d.ts +21 -4
- package/dist/components/stat.js +7 -3
- package/dist/components/status-dot.d.ts +4 -1
- package/dist/components/status-dot.js +3 -3
- package/dist/components/stepper.d.ts +5 -1
- package/dist/components/stepper.js +2 -2
- package/dist/components/switch.d.ts +24 -5
- package/dist/components/switch.js +37 -19
- package/dist/components/table.d.ts +51 -2
- package/dist/components/table.js +157 -8
- package/dist/components/tabs.d.ts +49 -17
- package/dist/components/tabs.js +85 -54
- package/dist/components/tag.d.ts +17 -7
- package/dist/components/tag.js +19 -21
- package/dist/components/tags-input.d.ts +33 -4
- package/dist/components/tags-input.js +40 -30
- package/dist/components/textarea.d.ts +61 -5
- package/dist/components/textarea.js +58 -21
- package/dist/components/toast.d.ts +89 -15
- package/dist/components/toast.js +105 -30
- package/dist/components/toggle-group.d.ts +30 -3
- package/dist/components/toggle-group.js +43 -16
- package/dist/components/toggle.d.ts +25 -4
- package/dist/components/toggle.js +28 -18
- package/dist/components/tooltip.d.ts +31 -12
- package/dist/components/tooltip.js +62 -28
- package/dist/components.json +1518 -0
- package/dist/custom-elements.json +31817 -0
- package/dist/dev/index.d.ts +40 -0
- package/dist/dev/rules.d.ts +46 -0
- package/dist/dev/table.generated.d.ts +8 -0
- package/dist/dev/types.d.ts +113 -0
- package/dist/dev.js +3364 -0
- package/dist/disclosure.d.ts +30 -0
- package/dist/dismiss.d.ts +20 -0
- package/dist/form-control.d.ts +92 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +24 -24
- package/dist/keyboard-activation.d.ts +31 -0
- package/dist/keyboard.d.ts +32 -0
- package/dist/modal.d.ts +44 -0
- package/dist/overlay.d.ts +249 -0
- package/dist/parts.d.ts +171 -0
- package/dist/projection.d.ts +370 -0
- package/dist/types/elements.d.ts +648 -0
- package/dist/types/react.d.ts +163 -0
- package/dist/types/solid.d.ts +164 -0
- package/dist/types/solid2.d.ts +161 -0
- package/dist/types/svelte.d.ts +154 -0
- package/dist/types/vue.d.ts +156 -0
- package/dist/vscode.html-custom-data.json +6004 -0
- package/dist/web-types.json +8365 -0
- package/package.json +113 -21
- package/dist/base.d.ts.map +0 -1
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/action-input.d.ts.map +0 -1
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/banner.d.ts.map +0 -1
- package/dist/components/bar-chart.d.ts.map +0 -1
- package/dist/components/breadcrumbs.d.ts.map +0 -1
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/charts/scale.d.ts.map +0 -1
- package/dist/components/charts/shape.d.ts.map +0 -1
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/color-picker.d.ts.map +0 -1
- package/dist/components/combobox.d.ts.map +0 -1
- package/dist/components/compose-input.d.ts.map +0 -1
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/divider.d.ts.map +0 -1
- package/dist/components/donut-chart.d.ts.map +0 -1
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/editable.d.ts.map +0 -1
- package/dist/components/error-fallback.d.ts.map +0 -1
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/file-upload.d.ts.map +0 -1
- package/dist/components/gauge.d.ts.map +0 -1
- package/dist/components/hamburger.d.ts.map +0 -1
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/indicator.d.ts.map +0 -1
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/line-chart.d.ts.map +0 -1
- package/dist/components/list.d.ts.map +0 -1
- package/dist/components/menu.d.ts.map +0 -1
- package/dist/components/multiselect.d.ts.map +0 -1
- package/dist/components/nav-bar.d.ts.map +0 -1
- package/dist/components/nav-menu.d.ts.map +0 -1
- package/dist/components/number-input.d.ts.map +0 -1
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/panel.d.ts.map +0 -1
- package/dist/components/pin-input.d.ts.map +0 -1
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/segmented-control.d.ts.map +0 -1
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/stat.d.ts.map +0 -1
- package/dist/components/status-dot.d.ts.map +0 -1
- package/dist/components/stepper.d.ts.map +0 -1
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tag.d.ts.map +0 -1
- package/dist/components/tags-input.d.ts.map +0 -1
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/toast.d.ts.map +0 -1
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DevWarning } from './types.js';
|
|
2
|
+
export type { DevWarning, WarningKind } from './types.js';
|
|
3
|
+
export interface DevOptions {
|
|
4
|
+
/** Throw a `VoidDevError` instead of logging, and report every occurrence (for test suites). */
|
|
5
|
+
throw?: boolean;
|
|
6
|
+
/** Receive each warning instead of `console.warn`. */
|
|
7
|
+
onWarning?: (warning: DevWarning) => void;
|
|
8
|
+
/** Tags to leave alone, for `void-*` elements your own code defines. */
|
|
9
|
+
ignoreTags?: readonly string[];
|
|
10
|
+
/** Attribute names (or patterns) to leave alone on every element. */
|
|
11
|
+
ignoreAttributes?: readonly (string | RegExp)[];
|
|
12
|
+
/** `void-*` event names to leave alone, for events your own code dispatches. */
|
|
13
|
+
ignoreEvents?: readonly string[];
|
|
14
|
+
/** How long nothing may happen (load, a component being defined, a resource arriving) before the page counts as settled and undefined tags, wrong parents and missing children are judged. Default 500. */
|
|
15
|
+
settleMs?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Thrown in `throw` mode. `warning` carries the structured problem. */
|
|
18
|
+
export declare class VoidDevError extends Error {
|
|
19
|
+
readonly warning: DevWarning;
|
|
20
|
+
constructor(warning: DevWarning);
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
var VOIDABLE_DEV: DevOptions | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare function configure(options: DevOptions): void;
|
|
26
|
+
/** Also watch a ShadowRoot or other subtree the document does not contain. */
|
|
27
|
+
export declare function observe(root: ParentNode & Node): void;
|
|
28
|
+
/**
|
|
29
|
+
* Check `root` (default: the document) now, synchronously, including undefined
|
|
30
|
+
* tags and missing children (nothing is waited for). Reports each problem as
|
|
31
|
+
* the observer would; in `throw` mode the first one throws. Returns the
|
|
32
|
+
* problems found, deduplicated or not: this call always lists them all.
|
|
33
|
+
*/
|
|
34
|
+
export declare function check(root?: ParentNode & Node): DevWarning[];
|
|
35
|
+
/** Resolves when the deferred checks (undefined tags, parents, required children) have run. */
|
|
36
|
+
export declare function settled(): Promise<readonly DevWarning[]>;
|
|
37
|
+
/** Every warning reported so far (once per kind, element type and attribute). */
|
|
38
|
+
export declare function warnings(): readonly DevWarning[];
|
|
39
|
+
/** Forget what was reported, so the same problems can be reported again. */
|
|
40
|
+
export declare function reset(): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DevRenamedAttribute, DevTable, DevWarning } from './types.js';
|
|
2
|
+
export declare function isForeignAttribute(name: string): boolean;
|
|
3
|
+
/** The closest candidate to `input`, or undefined when nothing is plausibly meant. */
|
|
4
|
+
export declare function suggest(input: string, candidates: readonly string[], synonyms?: boolean): string | undefined;
|
|
5
|
+
/** `<void-button id="save" color="primary">`: the tag, its identity and the attribute at issue. */
|
|
6
|
+
export declare function describe(el: Element, attribute?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* The markup to write instead of the 0.8-renamed attribute `name="value"`
|
|
9
|
+
* (#23): the replacement given for that value, else the new name with the same
|
|
10
|
+
* value, else the advice.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renamedReplacement(rule: DevRenamedAttribute, value: string): string;
|
|
13
|
+
/** The problem with attribute `name` on `el`, if any. */
|
|
14
|
+
export declare function checkAttribute(table: DevTable, el: Element, name: string): DevWarning | undefined;
|
|
15
|
+
/** Every attribute problem on `el`. */
|
|
16
|
+
export declare function checkAttributes(table: DevTable, el: Element): DevWarning[];
|
|
17
|
+
/** A child that is not inside any parent the manifest allows. */
|
|
18
|
+
export declare function checkParent(table: DevTable, el: Element): DevWarning | undefined;
|
|
19
|
+
/** Required child tags that are missing under `el`. */
|
|
20
|
+
export declare function checkRequired(table: DevTable, el: Element): DevWarning[];
|
|
21
|
+
/** An element that must have an accessible name and has none. Judged after upgrade, from the live DOM. */
|
|
22
|
+
export declare function checkName(table: DevTable, el: Element): DevWarning | undefined;
|
|
23
|
+
/** A `void-*` tag with no definition, once the page has settled. */
|
|
24
|
+
export declare function checkDefined(table: DevTable, el: Element, autoloading: boolean, styled?: readonly string[]): DevWarning | undefined;
|
|
25
|
+
/** A `void-*` event listener for a name nothing dispatches. */
|
|
26
|
+
export declare function checkEvent(table: DevTable, target: EventTarget, type: string, renamedEvents?: Readonly<Record<string, string>>): DevWarning | undefined;
|
|
27
|
+
/** Dedupe key: once per element type, kind and attribute (or child, or event name). */
|
|
28
|
+
export declare function keyOf(w: DevWarning): string;
|
|
29
|
+
/**
|
|
30
|
+
* Problems with the parts of `el` (a component, or a part with parts of its
|
|
31
|
+
* own): a required part that is missing, a child that is not a part where the
|
|
32
|
+
* component takes only parts (usually the implicit form the parts replaced:
|
|
33
|
+
* a bare button for a trigger, loose text for a body), a part repeated more
|
|
34
|
+
* often than allowed, parts out of order.
|
|
35
|
+
*/
|
|
36
|
+
export declare function checkParts(table: DevTable, el: Element): DevWarning[];
|
|
37
|
+
/** A part that wraps one control (`<void-popover-trigger>`) holding none, or more than one. */
|
|
38
|
+
export declare function checkControl(table: DevTable, el: Element): DevWarning | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* A component that enhances a native control the author writes inside it
|
|
41
|
+
* (`<void-select>` around a `<select>`) without one: usually the old form,
|
|
42
|
+
* native options written straight into the component.
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkNative(table: DevTable, el: Element): DevWarning | undefined;
|
|
45
|
+
/** A tag that explicit parts replaced (`<void-tab-panel>`). */
|
|
46
|
+
export declare function checkRemoved(removed: Readonly<Record<string, string>>, el: Element): DevWarning | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DevTable } from './types.js';
|
|
2
|
+
export declare const table: DevTable;
|
|
3
|
+
/** CSS-only `void-*` tags: styled by the theme, never registered, never "unknown". */
|
|
4
|
+
export declare const styled: readonly string[];
|
|
5
|
+
/** Tags that were replaced by explicit parts, with the fix. */
|
|
6
|
+
export declare const removed: Readonly<Record<string, string>>;
|
|
7
|
+
/** Event names removed in 0.8 (#23), with what to listen for instead. */
|
|
8
|
+
export declare const renamedEvents: Readonly<Record<string, string>>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How one attribute's value is validated: `0` any string, `1` boolean, `2`
|
|
3
|
+
* boolean that also reads the string "false", `3` number, a string array is the
|
|
4
|
+
* closed set of allowed values.
|
|
5
|
+
*/
|
|
6
|
+
export type AttrRule = 0 | 1 | 2 | 3 | readonly string[];
|
|
7
|
+
/** Validation data for one tag, generated from the Custom Elements Manifest. */
|
|
8
|
+
export interface DevTag {
|
|
9
|
+
/** Module name under `components/` that registers the tag. */
|
|
10
|
+
m: string;
|
|
11
|
+
/** Declared attributes. */
|
|
12
|
+
a: Readonly<Record<string, AttrRule>>;
|
|
13
|
+
/** Host attributes the component sets on itself (not API, never reported). */
|
|
14
|
+
h?: readonly string[];
|
|
15
|
+
/** Events the element dispatches (including ones that bubble from children). */
|
|
16
|
+
e: readonly string[];
|
|
17
|
+
/** Tags the element must sit inside (anywhere above it). */
|
|
18
|
+
p?: readonly string[];
|
|
19
|
+
/** Tags the element cannot work without (somewhere below it). */
|
|
20
|
+
r?: readonly string[];
|
|
21
|
+
/** Advice for attributes people guess that do not exist. */
|
|
22
|
+
x?: Readonly<Record<string, string>>;
|
|
23
|
+
/** Its explicit parts (#52). */
|
|
24
|
+
q?: DevParts;
|
|
25
|
+
/** 1 for a CSS-only part: styled by the theme, never registered. */
|
|
26
|
+
c?: 1;
|
|
27
|
+
/** What gives the element its accessible name (it must have one). */
|
|
28
|
+
n?: DevName;
|
|
29
|
+
/** The native control the author writes inside it (`select` in `<void-select>`), with the correct markup. */
|
|
30
|
+
v?: {
|
|
31
|
+
tag: string;
|
|
32
|
+
fix: string;
|
|
33
|
+
};
|
|
34
|
+
/** What was renamed or removed in 0.8 (#23), with the form to write instead. */
|
|
35
|
+
l?: DevRenamed;
|
|
36
|
+
}
|
|
37
|
+
/** One renamed or removed attribute (cem/supplement.js `renamed`). */
|
|
38
|
+
export interface DevRenamedAttribute {
|
|
39
|
+
/** The new attribute, written with the same value. */
|
|
40
|
+
to?: string;
|
|
41
|
+
/** Replacement markup for one old value (`''`: written with no value). */
|
|
42
|
+
values?: Readonly<Record<string, string>>;
|
|
43
|
+
/** What to do when neither applies. */
|
|
44
|
+
fix?: string;
|
|
45
|
+
}
|
|
46
|
+
/** What was renamed or removed on one tag in 0.8 (#23). */
|
|
47
|
+
export interface DevRenamed {
|
|
48
|
+
/** Old attribute -> its replacement. */
|
|
49
|
+
a?: Readonly<Record<string, DevRenamedAttribute>>;
|
|
50
|
+
/** Attribute -> { old value -> new value }. */
|
|
51
|
+
v?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
52
|
+
/** Old event name -> what to listen for instead. */
|
|
53
|
+
e?: Readonly<Record<string, string>>;
|
|
54
|
+
}
|
|
55
|
+
/** The explicit parts of a component (or of a part that has parts of its own). */
|
|
56
|
+
export interface DevParts {
|
|
57
|
+
/** `parts`: every child element must be a part; `any`: parts mixed with other content. */
|
|
58
|
+
k: 'parts' | 'any';
|
|
59
|
+
/** The parts must appear in the listed order. */
|
|
60
|
+
o?: 1;
|
|
61
|
+
/** Non-part elements allowed between the owner and its parts (`form`). */
|
|
62
|
+
t?: readonly string[];
|
|
63
|
+
/** The correct markup in one line. */
|
|
64
|
+
s: string;
|
|
65
|
+
/** Advice for loose children: the implicit form the parts replaced. */
|
|
66
|
+
l?: string;
|
|
67
|
+
/** The parts, in canonical order. */
|
|
68
|
+
n: ReadonlyArray<{
|
|
69
|
+
t: string;
|
|
70
|
+
r?: 1;
|
|
71
|
+
x?: number;
|
|
72
|
+
c?: 1;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
/** The sources of an accessible name for one tag (cem/supplement.js `accessibleName`). */
|
|
76
|
+
export interface DevName {
|
|
77
|
+
/** Attributes of the element that name it. */
|
|
78
|
+
a: readonly string[];
|
|
79
|
+
/** The element's own content names it. */
|
|
80
|
+
c?: 1;
|
|
81
|
+
/** Part elements (own descendants) that name it when they hold text. */
|
|
82
|
+
t?: readonly string[];
|
|
83
|
+
/** Ancestors that name it: `[tag, ...attributes]`; with no attributes the ancestor alone is enough. */
|
|
84
|
+
p?: readonly (readonly string[])[];
|
|
85
|
+
/** What to do about it. */
|
|
86
|
+
h: string;
|
|
87
|
+
}
|
|
88
|
+
export type DevTable = Readonly<Record<string, DevTag>>;
|
|
89
|
+
export type WarningKind = 'unknown-attribute' | 'invalid-value' | 'boolean-false' | 'wrong-parent' | 'missing-child' | 'undefined-element' | 'unknown-event'
|
|
90
|
+
/** A required part (#52) is missing. */
|
|
91
|
+
| 'missing-part'
|
|
92
|
+
/** A child of a component that takes only parts is not one of them (the implicit form it replaced, usually). */
|
|
93
|
+
| 'unknown-child'
|
|
94
|
+
/** A part appears more often than allowed, or out of order. */
|
|
95
|
+
| 'part-misuse'
|
|
96
|
+
/** A tag that explicit parts replaced. */
|
|
97
|
+
| 'legacy-markup'
|
|
98
|
+
/** The element needs an accessible name and nothing gives it one. */
|
|
99
|
+
| 'missing-name'
|
|
100
|
+
/** A page script keeps removing an attribute a component manages on itself; the component stopped restoring it. */
|
|
101
|
+
| 'attribute-fight';
|
|
102
|
+
/** One reported problem. */
|
|
103
|
+
export interface DevWarning {
|
|
104
|
+
kind: WarningKind;
|
|
105
|
+
/** The tag the problem is about (the element type, or the listener's target). */
|
|
106
|
+
tag: string;
|
|
107
|
+
/** The attribute, child tag or event name involved. */
|
|
108
|
+
subject: string;
|
|
109
|
+
/** The text sent to `console.warn`. */
|
|
110
|
+
message: string;
|
|
111
|
+
/** The element, when there is one (events have none). */
|
|
112
|
+
element?: Element;
|
|
113
|
+
}
|