@ctrl/dom 0.1.13 → 0.1.15
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/dist/aria/_chunks/{roles-list--7uYUGyR.cjs → roles-list-C57tqF4n.cjs} +2 -2
- package/dist/aria/_chunks/roles-list-DEwbBc_c.js +4 -0
- package/dist/aria/index.cjs +1 -1
- package/dist/aria/index.js +1 -1
- package/dist/aria/internal.cjs +1 -1
- package/dist/aria/internal.js +1 -1
- package/dist/aria/types/forms.d.ts +6 -13
- package/dist/bridge/internal.js +1 -1
- package/dist/dom/_chunks/src-C4oa-U7z.js +49 -0
- package/dist/dom/index.js +1 -1
- package/dist/dom/internal.js +1 -1
- package/dist/dom/types/collections/HTMLCollection.d.ts +10 -5
- package/dist/dom/types/events/Event.d.ts +16 -3
- package/dist/dom/types/events/EventTarget.d.ts +3 -3
- package/dist/dom/types/events/UIEvents.d.ts +10 -1
- package/dist/dom/types/events/activation.d.ts +2 -0
- package/dist/dom/types/events/dispatch.d.ts +1 -6
- package/dist/dom/types/events/listeners.d.ts +36 -18
- package/dist/dom/types/html/forms/HTMLInputElement.d.ts +1 -3
- package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +0 -4
- package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +0 -4
- package/dist/dom/types/html/forms/form-associated.d.ts +17 -9
- package/dist/dom/types/html/forms/user-validity.d.ts +5 -6
- package/dist/dom/types/html/reflect.d.ts +1 -0
- package/dist/dom/types/internal.d.ts +1 -1
- package/dist/dom/types/keys.d.ts +2 -0
- package/dist/dom/types/nodes/Document.d.ts +12 -1
- package/dist/dom/types/nodes/Element.d.ts +2 -7
- package/dist/dom/types/nodes/Node.d.ts +4 -1
- package/dist/dom/types/nodes/attributes.d.ts +23 -1
- package/dist/dom/types/nodes/tree.d.ts +6 -0
- package/package.json +1 -1
- package/dist/aria/_chunks/roles-list-b_Z0ZWwY.js +0 -4
- package/dist/dom/_chunks/src-BHNEJboS.js +0 -49
package/dist/aria/internal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/roles-list
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/roles-list-C57tqF4n.cjs");let t=require("@ctrl/dom/internal");function tlRoleMatches(t,n,r){let i=e.z(t),a=i.roleAttr;if(a!==null){if(!r){let e=a.indexOf(` `);return e===-1?a===n:e===n.length&&a.startsWith(n)}let e=0,t=a.length;for(;e<=t;){let r=a.indexOf(` `,e);if(r===-1&&(r=t),r>e&&r-e===n.length&&a.startsWith(n,e))return!0;e=r+1}return!1}return i.role===n}exports.anyTag=e.M,exports.ariaCheckedState=e.l,exports.ariaPressedState=e.u,exports.computeAccessibleDescriptionImpl=e.C,exports.computeAccessibleNameImpl=e.w,exports.computeAriaBusy=e.d,exports.computeAriaChecked=e.f,exports.computeAriaCurrent=e.p,exports.computeAriaExpanded=e.m,exports.computeAriaPressed=e.h,exports.computeAriaSelected=e.g,exports.computeAriaValueMax=e._,exports.computeAriaValueMin=e.v,exports.computeAriaValueNow=e.y,exports.computeAriaValueText=e.b,exports.computeHeadingLevel=e.x,exports.computeTextAlternativeImpl=e.T,exports.daaExplicitRole=e.N,exports.daaGetRole=e.P,exports.daaImplicitRole=e.F,exports.getImplicitRoles=e.I,exports.getRolesImpl=e.n,exports.implOf=e.A,exports.implicitRole=e.L,exports.implicitRoleJestDom=e.R,exports.inputType=e.V,exports.isDisabledImpl=e.S,exports.isDisplayInline=e.D,exports.isDisplayNone=e.O,exports.isInaccessibleImpl=e.a,exports.isInaccessibleWithStyle=e.o,Object.defineProperty(exports,"isLabelable",{enumerable:!0,get:function(){return t.isLabelable}}),exports.isSubtreeInaccessibleImpl=e.c,exports.isVisibilityHidden=e.k,exports.labelMapForTree=e.H,exports.labelsOf=e.U,exports.queryIdRefs=e.j,exports.tlRole=e.B,exports.tlRoleMatches=tlRoleMatches,exports.withStyleOverride=e.E;
|
package/dist/aria/internal.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,D as r,E as i,F as a,H as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,U as g,V as _,W as v,_ as y,a as b,b as x,c as S,d as C,f as w,g as T,h as E,j as D,k as O,l as k,m as A,n as j,o as M,p as N,u as P,v as F,w as I,x as L,y as R,z}from"./_chunks/roles-list-
|
|
1
|
+
import{A as e,B as t,C as n,D as r,E as i,F as a,H as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,U as g,V as _,W as v,_ as y,a as b,b as x,c as S,d as C,f as w,g as T,h as E,j as D,k as O,l as k,m as A,n as j,o as M,p as N,u as P,v as F,w as I,x as L,y as R,z}from"./_chunks/roles-list-DEwbBc_c.js";function tlRoleMatches(e,t,n){let r=z(e),i=r.roleAttr;if(i!==null){if(!n){let e=i.indexOf(` `);return e===-1?i===t:e===t.length&&i.startsWith(t)}let e=0,r=i.length;for(;e<=r;){let n=i.indexOf(` `,e);if(n===-1&&(n=r),n>e&&n-e===t.length&&i.startsWith(t,e))return!0;e=n+1}return!1}return r.role===t}export{l as anyTag,k as ariaCheckedState,P as ariaPressedState,n as computeAccessibleDescriptionImpl,I as computeAccessibleNameImpl,C as computeAriaBusy,w as computeAriaChecked,N as computeAriaCurrent,A as computeAriaExpanded,E as computeAriaPressed,T as computeAriaSelected,y as computeAriaValueMax,F as computeAriaValueMin,R as computeAriaValueNow,x as computeAriaValueText,L as computeHeadingLevel,h as computeTextAlternativeImpl,u as daaExplicitRole,f as daaGetRole,a as daaImplicitRole,s as getImplicitRoles,j as getRolesImpl,e as implOf,c as implicitRole,p as implicitRoleJestDom,_ as inputType,m as isDisabledImpl,r as isDisplayInline,d as isDisplayNone,b as isInaccessibleImpl,M as isInaccessibleWithStyle,o as isLabelable,S as isSubtreeInaccessibleImpl,O as isVisibilityHidden,g as labelMapForTree,v as labelsOf,D as queryIdRefs,t as tlRole,tlRoleMatches,i as withStyleOverride};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type NodeImpl } from "@ctrl/dom/internal";
|
|
1
|
+
import { isLabelable, type NodeImpl } from "@ctrl/dom/internal";
|
|
2
|
+
export { isLabelable };
|
|
2
3
|
export declare function inputType(impl: NodeImpl): string;
|
|
3
4
|
/** Whether `impl` is an HTML-namespace element with the given tag. */
|
|
4
5
|
export declare function isHTML(impl: NodeImpl, tag: number): boolean;
|
|
@@ -16,21 +17,13 @@ export declare function selectSize(impl: NodeImpl): number;
|
|
|
16
17
|
export declare function optionSelected(option: NodeImpl): boolean;
|
|
17
18
|
/** `select.selectedOptions`, in tree order. */
|
|
18
19
|
export declare function selectedOptions(select: NodeImpl): NodeImpl[];
|
|
19
|
-
/** https://html.spec.whatwg.org/multipage/forms.html#category-label (as jsdom implements it). */
|
|
20
|
-
export declare function isLabelable(impl: NodeImpl): boolean;
|
|
21
20
|
/**
|
|
22
|
-
* `element.labels` as jsdom computes it: null for non-labelable elements, otherwise the
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* A label names the element by `for` (only when it has an ID), or is an ancestor without `for`
|
|
26
|
-
* whose first labelable descendant it is. Ancestors are O(depth), and the document lists its
|
|
27
|
-
* connected labels with `for` (Document[$forLabels], kept by @ctrl/dom's HTMLLabelElement), so
|
|
28
|
-
* only a detached control with an ID walks its tree.
|
|
21
|
+
* `element.labels` as jsdom computes it: null for non-labelable elements, otherwise the label
|
|
22
|
+
* elements (tree order, same tree) whose labeled control is the element (@ctrl/dom's labelsFor).
|
|
29
23
|
*/
|
|
30
24
|
export declare function labelsOf(impl: NodeImpl): NodeImpl[] | null;
|
|
31
25
|
/**
|
|
32
|
-
* The label associations of `impl`'s tree (labelable control → its labels in tree order)
|
|
33
|
-
*
|
|
34
|
-
* ByLabelText builds it once per query).
|
|
26
|
+
* The label associations of `impl`'s tree (labelable control → its labels in tree order) in one
|
|
27
|
+
* walk, for resolving many elements' labels at once (Testing Library's ByLabelText, per query).
|
|
35
28
|
*/
|
|
36
29
|
export declare function labelMapForTree(impl: NodeImpl): Map<NodeImpl, NodeImpl[]>;
|
package/dist/bridge/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Generated by scripts/release.ts (writeBridges): the running ctrl-dom environment's DOM, else a fresh load.
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
const dom = globalThis[Symbol.for("ctrl-dom.dom.modules")]?.internal ?? createRequire(import.meta.url)("../dom/internal.js");
|
|
4
|
-
export const { $_proto__, $aboutBase, $active, $assocGen, $attr, $attributes, $availableToElementInternals, $badInput, $baseFor, $baseOverride, $baseURL, $baseVersion, $block, $byCtor, $byName, $cache, $callback, $checked, $checkedSet, $childNodes, $childWindows, $children, $classList, $clipboard, $clonable, $closed, $coll, $compiled, $compiledFor, $condition, $constructed, $constructingEntryList, $contentType, $controlsCache, $controlsDoc, $controlsVersion, $cookieJar, $cookies, $css, $current, $customElements, $customValidity, $cx, $data, $dataset, $declarative, $defaultNamespace, $defaultValueOverride, $delegatesFocus, $derived, $devicePixelRatio, $dirtiness, $dirtyChecked, $dirtyValue, $disabled, $disallowModification, $doc, $dropEffect, $ec, $effectAllowed, $el, $elements, $entries, $eo, $error, $file, $files, $fill, $filter, $firingSubmissionEvents, $focused, $forLabels, $form, $forms, $frameCallbacks, $frameElement, $frameId, $frameTask, $frameTime, $generation, $globalObject, $hasTransients, $height, $history, $home, $host, $href, $id, $idleCallbacks, $idleId, $ids, $impl, $implementation, $indeterminate, $index, $indexed, $inflight, $info, $innerHeight, $innerWidth, $is2D, $isHTML, $items, $keyText, $kind, $labels, $layerName, $list, $listeners, $localStorage, $location, $lockedForReset, $m, $matches, $media, $mediaQueryLists, $mode, $name, $names, $namespaces, $navigator, $nodes, $onchange, $options, $owner, $ownerNode, $ownerRule, $parent, $parentRule, $parentWindow, $pastNames, $pointerBeforeReference, $preApplied, $preChecked, $preCheckedRadio, $preIndeterminate, $prefix, $prelude, $presentationStyle, $pseudo, $queries, $ranges, $rawValue, $readonly, $readyState, $rebuildVersion, $record, $records, $rects, $reference, $result, $root, $rules, $running, $runningFrame, $sc, $screen, $scrollRestoration, $scrollX, $scrollY, $selDir, $selEnd, $selSet, $selStart, $selectedOptions, $selectedness, $selection, $selector, $serializable, $sessionStorage, $settled, $shadowRoot, $shed, $sheet, $sheets, $slotAssignment, $so, $states, $style, $styleVersion, $supportsText, $systemId, $target, $targets, $tasks, $timers, $title, $type, $types, $uiValue, $updating, $updatingSelectedContent, $uri, $url, $userActivation, $userEdited, $userValidity, $validity, $value, $version, $visualViewport, $w, $whatToShow, $whenDefined, $width, $window, $writeBuffer, $x, $xhr, $y, $z, ATTRIBUTE_NODE, AttrRecord, CDATA_SECTION_NODE, COMMENT_NODE, COMPAT, COMPAT_PROFILES, DEFAULT_COMPAT, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, DeclBlock, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, EventState, FAILURE_CHANNEL, F_ADOPT_HOOK, F_ARIA_ATTRS, F_ATTR_HOOK, F_CE_CUSTOM, F_CHILDREN_HOOK, F_CHILD_LIST, F_CONNECTED, F_CONNECT_HOOK, F_CONTENTEDITABLE_ATTR, F_CUSTOM, F_DATA_ATTRS, F_FACE, F_HAS_SHADOW, F_HAS_STYLE_ATTR, F_HTML, F_INERT_ATTR, F_MO_REGISTERED, F_SHADOW_ROOT, F_TABINDEX_ATTR, GLOBAL_EVENT_HANDLER_EVENTS, HTMLCollection, HTML_NS, INPUT_TYPE_NAMES, MATHML_NS, NOTATION_NODE, NodeCache, NodeImpl, NodeList, PROCESSING_INSTRUCTION_NODE, SPAN_CHANNEL, SVG_NS, T, TEXT_NODE, VirtualClock, VirtualTimeout, WINDOW_EVENT_HANDLER_EVENTS, XLINK_NS, XMLNS_NS, XML_NS, adoptedStyleSheetsOf, ariaAttr, asciiLowercase, assignManually, assignedElements, assignedNodes, assignedSlot, attachShadowRoot, attr, attrAssociatedElement, attrAssociatedElements, attrNode, canSkipZeroDelayWait, captureInterfaceBaseline, childAt, classTokens, clearUIValue, clockNow, clockStats, closest, compareBoundaryPoints,
|
|
4
|
+
export const { $_proto__, $aboutBase, $active, $assocGen, $attr, $attributes, $availableToElementInternals, $badInput, $baseFor, $baseOverride, $baseURL, $baseVersion, $block, $byCtor, $byName, $cache, $callback, $checked, $checkedSet, $childNodes, $childWindows, $children, $classList, $clipboard, $clonable, $closed, $coll, $compiled, $compiledFor, $condition, $constructed, $constructingEntryList, $contentType, $controlsCache, $controlsDoc, $controlsVersion, $cookieJar, $cookies, $css, $current, $customElements, $customValidity, $cx, $data, $dataset, $declarative, $defaultNamespace, $defaultValueOverride, $delegatesFocus, $derived, $devicePixelRatio, $dirtiness, $dirtyChecked, $dirtyValue, $disabled, $disallowModification, $doc, $dropEffect, $ec, $effectAllowed, $el, $elements, $entries, $eo, $error, $file, $files, $fill, $filter, $firingSubmissionEvents, $focused, $forLabels, $form, $forms, $frameCallbacks, $frameElement, $frameId, $frameTask, $frameTime, $generation, $globalObject, $hasTransients, $height, $history, $home, $host, $href, $id, $idleCallbacks, $idleId, $ids, $impl, $implementation, $indeterminate, $index, $indexed, $inflight, $info, $innerHeight, $innerWidth, $is2D, $isHTML, $items, $keyText, $kind, $labels, $layerName, $list, $listeners, $localStorage, $location, $lockedForReset, $m, $matches, $media, $mediaQueryLists, $mode, $name, $names, $namespaces, $navigator, $nodes, $onchange, $options, $owner, $ownerNode, $ownerRule, $parent, $parentRule, $parentWindow, $pastNames, $pointerBeforeReference, $preApplied, $preChecked, $preCheckedRadio, $preIndeterminate, $prefix, $prelude, $presentationStyle, $pseudo, $queries, $radios, $ranges, $rawValue, $readonly, $readyState, $rebuildVersion, $record, $records, $rects, $reference, $result, $root, $rules, $running, $runningFrame, $sc, $screen, $scrollRestoration, $scrollX, $scrollY, $selDir, $selEnd, $selSet, $selStart, $selectedOptions, $selectedness, $selection, $selector, $serializable, $sessionStorage, $settled, $shadowRoot, $shed, $sheet, $sheets, $slotAssignment, $so, $states, $style, $styleVersion, $supportsText, $systemId, $target, $targets, $tasks, $timers, $title, $treeVersion, $type, $types, $uiValue, $updating, $updatingSelectedContent, $uri, $url, $userActivation, $userEdited, $userValidity, $validity, $value, $version, $visualViewport, $w, $whatToShow, $whenDefined, $width, $window, $writeBuffer, $x, $xhr, $y, $z, ATTRIBUTE_NODE, AttrRecord, CDATA_SECTION_NODE, COMMENT_NODE, COMPAT, COMPAT_PROFILES, DEFAULT_COMPAT, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, DeclBlock, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, EventState, FAILURE_CHANNEL, F_ADOPT_HOOK, F_ARIA_ATTRS, F_ATTR_HOOK, F_CE_CUSTOM, F_CHILDREN_HOOK, F_CHILD_LIST, F_CONNECTED, F_CONNECT_HOOK, F_CONTENTEDITABLE_ATTR, F_CUSTOM, F_DATA_ATTRS, F_FACE, F_HAS_SHADOW, F_HAS_STYLE_ATTR, F_HTML, F_INERT_ATTR, F_MO_REGISTERED, F_SHADOW_ROOT, F_TABINDEX_ATTR, GLOBAL_EVENT_HANDLER_EVENTS, HTMLCollection, HTML_NS, INPUT_TYPE_NAMES, MATHML_NS, NOTATION_NODE, NodeCache, NodeImpl, NodeList, PROCESSING_INSTRUCTION_NODE, SPAN_CHANNEL, SVG_NS, T, TEXT_NODE, VirtualClock, VirtualTimeout, WINDOW_EVENT_HANDLER_EVENTS, XLINK_NS, XMLNS_NS, XML_NS, adoptedStyleSheetsOf, ariaAttr, asciiLowercase, assignManually, assignedElements, assignedNodes, assignedSlot, attachShadowRoot, attr, attrAssociatedElement, attrAssociatedElements, attrNode, canSkipZeroDelayWait, captureInterfaceBaseline, childAt, classTokens, clearUIValue, clockNow, clockStats, closest, compareBoundaryPoints, compatExposes, computedDisplay, computedValue, computedVisibility, constructEntryList, controlValue, createEvent, createFileList, createLinkSheet, currentStyleVersion, defaultButton, deferredCompatMembers, derivedCache, describeCall, describeNode, dispatch, dispatchTrusted, ensureCollectionIndexGetters, ensureIndexGetters, evaluateMediaQueryList, faceState, findFlattenedSlottables, findSlot, fireAnEvent, fireSyntheticPointerEvent, firstElementChild, foreignImmediatesPending, formOwner, getAttribute, getComputedStyle, getComputedStyleOverride, getCurrentEvent, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getEventHandler, getUISelection, getUIValue, guardInterfaceDefinitions, hasAttr, hasAuthorStyles, hasExplicitAttrElements, hasListeners, hasReadonlyAttribute, hasUIValue, hiddenGlobals, implicitSubmission, indexGetterTable, indexOf, inputChecked, inputIndeterminate, inputType, inputTypeFromAttr, inspectNode, installClock, installEventHandlers, isActuallyDisabled, isAsciiWhitespace, isAutofilled, isChecked, isClockTimer, isDefault, isDisabled, isDisplayNone, isDisplayNoneInclusive, isEditableControl, isEnabled, isFACE, isInRange, isInclusiveAncestor, isIndeterminate, isInvalid, isLabelable, isListed, isMutable, isNumericType, isOptional, isOutOfRange, isPlaceholderShown, isReadOnly, isReadWrite, isRequired, isResettable, isSubmitButton, isSubmittable, isTextControl, isTextualType, isValid, isValidDoctypeName, isValidElementLocalName, isValidNamespacePrefix, isVisibilityHidden, labeledControl, labelsFor, lastElementChild, listOfOptions, matchMediaText, matches, mediaEnvironment, nextElementInTree, nextElementSibling, nextInTree, nextSkippingChildren, nodeCache, nodeGetTheParent, nodeLength, notifyMutationObservers, optionSelected, parseDeclBlock, parseFragment, parseMediaQueryList, peekDerivedCache, pointerEvents, pointerEventsNone, prefixFlag, previousElementSibling, previousInTree, pseudoContent, querySelector, querySelectorAll, quote, registerOwnerSheet, removeAllEventListeners, removeAttribute, removeOwnerSheet, replaceData, reportException, resolveCompat, restoreInterfaces, retarget, serializeChildren, serializeNode, setAdoptedStyleSheets, setAssignedSlotLookup, setAttribute, setCheckedFromUI, setComputedColorMode, setEventHandler, setFailureSnapshot, setFilesFromUI, setNodeDescriber, setNotImplementedHandler, setOptionSelectedFromUI, setTrusted, setUISelection, setUIValue, setUncaughtExceptionHandler, skipIdleTime, skipZeroDelayWait, spanChannel, splitOnAsciiWhitespace, splitText, styleElementRemoved, styleElementSheet, styleElementUpdated, styleSheetsOf, styledDisplay, subscribeTestFailures, supportsSelection, supportsSelectionType, tagId, tagName, tracePromise, traceSync, tracing, trackGlobalTimers, treeRoot, uaDisplay, unregisterOwnerSheet, validateAndExtract, valueMode, virtualDate, virtualPerformance, windowHooks, windowInterfaces, withNamedProperties } = dom;
|