@ctrl/dom 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/NOTICE +338 -0
- package/README.md +362 -2
- package/dist/aria/_chunks/roles-list-CYZF-l9K.js +1503 -0
- package/dist/aria/_chunks/roles-list-D4WCyRO_.cjs +1754 -0
- package/dist/aria/index.cjs +232 -0
- package/dist/aria/index.js +198 -0
- package/dist/aria/internal.cjs +69 -0
- package/dist/aria/internal.js +30 -0
- package/dist/aria/types/accname.d.ts +40 -0
- package/dist/aria/types/data/aria-query.d.ts +61 -0
- package/dist/aria/types/data/aria-query.generated.d.ts +2 -0
- package/dist/aria/types/forms.d.ts +25 -0
- package/dist/aria/types/hidden.d.ts +38 -0
- package/dist/aria/types/index.d.ts +46 -0
- package/dist/aria/types/internal.d.ts +15 -0
- package/dist/aria/types/role.d.ts +27 -0
- package/dist/aria/types/roles-list.d.ts +18 -0
- package/dist/aria/types/states.d.ts +29 -0
- package/dist/aria/types/style.d.ts +18 -0
- package/dist/aria/types/tree.d.ts +20 -0
- package/dist/bridge/index.cjs +3 -0
- package/dist/bridge/index.js +4 -0
- package/dist/bridge/internal.cjs +3 -0
- package/dist/bridge/internal.js +4 -0
- package/dist/cli/_chunks/report-DdncYfuJ.js +93 -0
- package/dist/cli/ctrl-dom.js +199 -0
- package/dist/cli/jest-reporter.js +55 -0
- package/dist/cli/vitest-reporter.js +81 -0
- package/dist/dom/_chunks/src-DWP2w3IQ.js +47516 -0
- package/dist/dom/index.js +3 -0
- package/dist/dom/internal.js +434 -0
- package/dist/dom/types/collections/DOMStringMap.d.ts +8 -0
- package/dist/dom/types/collections/DOMTokenList.d.ts +33 -0
- package/dist/dom/types/collections/HTMLCollection.d.ts +62 -0
- package/dist/dom/types/collections/NamedNodeMap.d.ts +22 -0
- package/dist/dom/types/collections/NodeList.d.ts +43 -0
- package/dist/dom/types/collections/indexed.d.ts +8 -0
- package/dist/dom/types/collections/iterator.d.ts +8 -0
- package/dist/dom/types/css/CSS.d.ts +21 -0
- package/dist/dom/types/css/CSSStyleDeclaration.d.ts +57 -0
- package/dist/dom/types/css/cascade.d.ts +159 -0
- package/dist/dom/types/css/colors.d.ts +28 -0
- package/dist/dom/types/css/computed.d.ts +22 -0
- package/dist/dom/types/css/cssom.d.ts +363 -0
- package/dist/dom/types/css/data/properties.d.ts +1 -0
- package/dist/dom/types/css/declarations.d.ts +40 -0
- package/dist/dom/types/css/index.d.ts +5 -0
- package/dist/dom/types/css/inline-count.d.ts +2 -0
- package/dist/dom/types/css/internal.d.ts +11 -0
- package/dist/dom/types/css/layout-mode.d.ts +4 -0
- package/dist/dom/types/css/layout.d.ts +63 -0
- package/dist/dom/types/css/media.d.ts +55 -0
- package/dist/dom/types/css/parser.d.ts +93 -0
- package/dist/dom/types/css/properties.d.ts +28 -0
- package/dist/dom/types/css/resize-observer.d.ts +19 -0
- package/dist/dom/types/css/selector-info.d.ts +13 -0
- package/dist/dom/types/css/shorthands.d.ts +33 -0
- package/dist/dom/types/css/stylesheets.d.ts +93 -0
- package/dist/dom/types/css/supports.d.ts +4 -0
- package/dist/dom/types/css/tokenizer.d.ts +91 -0
- package/dist/dom/types/css/values.d.ts +91 -0
- package/dist/dom/types/css/view.d.ts +44 -0
- package/dist/dom/types/events/DataTransfer.d.ts +62 -0
- package/dist/dom/types/events/Event.d.ts +115 -0
- package/dist/dom/types/events/EventTarget.d.ts +22 -0
- package/dist/dom/types/events/UIEvents.d.ts +308 -0
- package/dist/dom/types/events/activation.d.ts +7 -0
- package/dist/dom/types/events/convert.d.ts +16 -0
- package/dist/dom/types/events/createEvent.d.ts +3 -0
- package/dist/dom/types/events/dispatch.d.ts +39 -0
- package/dist/dom/types/events/events.d.ts +200 -0
- package/dist/dom/types/events/fire.d.ts +21 -0
- package/dist/dom/types/events/handlers.d.ts +14 -0
- package/dist/dom/types/events/listeners.d.ts +32 -0
- package/dist/dom/types/events/report.d.ts +10 -0
- package/dist/dom/types/html/HTMLElement.d.ts +126 -0
- package/dist/dom/types/html/MathMLElement.d.ts +6 -0
- package/dist/dom/types/html/SVGElement.d.ts +145 -0
- package/dist/dom/types/html/anchor.d.ts +16 -0
- package/dist/dom/types/html/aria-reflection.d.ts +14 -0
- package/dist/dom/types/html/collection.d.ts +5 -0
- package/dist/dom/types/html/custom-elements.d.ts +129 -0
- package/dist/dom/types/html/elements.d.ts +202 -0
- package/dist/dom/types/html/events.d.ts +22 -0
- package/dist/dom/types/html/focus.d.ts +63 -0
- package/dist/dom/types/html/forms/FileList.d.ts +1 -0
- package/dist/dom/types/html/forms/FormData.d.ts +7 -0
- package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +36 -0
- package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +29 -0
- package/dist/dom/types/html/forms/HTMLFormElement.d.ts +61 -0
- package/dist/dom/types/html/forms/HTMLInputElement.d.ts +204 -0
- package/dist/dom/types/html/forms/HTMLLabelElement.d.ts +15 -0
- package/dist/dom/types/html/forms/HTMLOptionElement.d.ts +61 -0
- package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +74 -0
- package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +96 -0
- package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +82 -0
- package/dist/dom/types/html/forms/autofill.d.ts +10 -0
- package/dist/dom/types/html/forms/collections.d.ts +112 -0
- package/dist/dom/types/html/forms/common.d.ts +36 -0
- package/dist/dom/types/html/forms/face.d.ts +59 -0
- package/dist/dom/types/html/forms/form-associated.d.ts +46 -0
- package/dist/dom/types/html/forms/form-submission.d.ts +55 -0
- package/dist/dom/types/html/forms/index.d.ts +17 -0
- package/dist/dom/types/html/forms/input-type.d.ts +50 -0
- package/dist/dom/types/html/forms/microsyntaxes.d.ts +52 -0
- package/dist/dom/types/html/forms/state.d.ts +54 -0
- package/dist/dom/types/html/forms/ui.d.ts +35 -0
- package/dist/dom/types/html/forms/user-validity.d.ts +19 -0
- package/dist/dom/types/html/forms/validation.d.ts +76 -0
- package/dist/dom/types/html/index.d.ts +13 -0
- package/dist/dom/types/html/innerText.d.ts +9 -0
- package/dist/dom/types/html/interactive.d.ts +43 -0
- package/dist/dom/types/html/invokers.d.ts +39 -0
- package/dist/dom/types/html/media.d.ts +86 -0
- package/dist/dom/types/html/reflect.d.ts +67 -0
- package/dist/dom/types/html/registry.d.ts +9 -0
- package/dist/dom/types/html/resources.d.ts +55 -0
- package/dist/dom/types/html/shared.d.ts +22 -0
- package/dist/dom/types/html/slot.d.ts +15 -0
- package/dist/dom/types/html/template.d.ts +18 -0
- package/dist/dom/types/html/top-layer.d.ts +73 -0
- package/dist/dom/types/index.d.ts +50 -0
- package/dist/dom/types/internal.d.ts +61 -0
- package/dist/dom/types/keys.d.ts +209 -0
- package/dist/dom/types/nodes/Attr.d.ts +25 -0
- package/dist/dom/types/nodes/CharacterData.d.ts +35 -0
- package/dist/dom/types/nodes/Document.d.ts +169 -0
- package/dist/dom/types/nodes/DocumentFragment.d.ts +12 -0
- package/dist/dom/types/nodes/DocumentType.d.ts +17 -0
- package/dist/dom/types/nodes/Element.d.ts +142 -0
- package/dist/dom/types/nodes/Node.d.ts +112 -0
- package/dist/dom/types/nodes/NodeImpl.d.ts +90 -0
- package/dist/dom/types/nodes/ShadowRoot.d.ts +43 -0
- package/dist/dom/types/nodes/attr-nodes.d.ts +8 -0
- package/dist/dom/types/nodes/attributes.d.ts +46 -0
- package/dist/dom/types/nodes/cache.d.ts +38 -0
- package/dist/dom/types/nodes/character-data.d.ts +5 -0
- package/dist/dom/types/nodes/clone.d.ts +5 -0
- package/dist/dom/types/nodes/constants.d.ts +52 -0
- package/dist/dom/types/nodes/create.d.ts +42 -0
- package/dist/dom/types/nodes/derived.d.ts +26 -0
- package/dist/dom/types/nodes/inspect.d.ts +2 -0
- package/dist/dom/types/nodes/mixins.d.ts +41 -0
- package/dist/dom/types/nodes/names.d.ts +15 -0
- package/dist/dom/types/nodes/slots.d.ts +38 -0
- package/dist/dom/types/nodes/tags.d.ts +8 -0
- package/dist/dom/types/nodes/traverse.d.ts +21 -0
- package/dist/dom/types/nodes/tree.d.ts +47 -0
- package/dist/dom/types/observers/MutationObserver.d.ts +33 -0
- package/dist/dom/types/observers/MutationRecord.d.ts +17 -0
- package/dist/dom/types/observers/queue.d.ts +45 -0
- package/dist/dom/types/parser/entities-data.d.ts +3 -0
- package/dist/dom/types/parser/entities.d.ts +11 -0
- package/dist/dom/types/parser/index.d.ts +34 -0
- package/dist/dom/types/parser/tags.d.ts +182 -0
- package/dist/dom/types/parser/tokenizer.d.ts +109 -0
- package/dist/dom/types/parser/treebuilder.d.ts +271 -0
- package/dist/dom/types/parser/xml.d.ts +14 -0
- package/dist/dom/types/selectors/compile.d.ts +154 -0
- package/dist/dom/types/selectors/filter.d.ts +21 -0
- package/dist/dom/types/selectors/html-predicates.d.ts +1 -0
- package/dist/dom/types/selectors/index.d.ts +16 -0
- package/dist/dom/types/selectors/internal.d.ts +87 -0
- package/dist/dom/types/selectors/parser.d.ts +310 -0
- package/dist/dom/types/selectors/serialize.d.ts +20 -0
- package/dist/dom/types/selectors/state.d.ts +43 -0
- package/dist/dom/types/serializer/index.d.ts +29 -0
- package/dist/dom/types/trace.d.ts +51 -0
- package/dist/dom/types/traversal/Range.d.ts +113 -0
- package/dist/dom/types/traversal/Selection.d.ts +45 -0
- package/dist/dom/types/traversal/TreeWalker.d.ts +77 -0
- package/dist/dom/types/traversal/live.d.ts +46 -0
- package/dist/dom/types/webidl-runtime.d.ts +18 -0
- package/dist/dom/types/webidl.d.ts +34 -0
- package/dist/dom/types/window/DOMStringList.d.ts +14 -0
- package/dist/dom/types/window/FileList.d.ts +11 -0
- package/dist/dom/types/window/FileReader.d.ts +27 -0
- package/dist/dom/types/window/History.d.ts +43 -0
- package/dist/dom/types/window/Location.d.ts +46 -0
- package/dist/dom/types/window/Navigator.d.ts +79 -0
- package/dist/dom/types/window/Screen.d.ts +27 -0
- package/dist/dom/types/window/Storage.d.ts +28 -0
- package/dist/dom/types/window/Window.d.ts +329 -0
- package/dist/dom/types/window/abort.d.ts +4 -0
- package/dist/dom/types/window/browsing-context.d.ts +12 -0
- package/dist/dom/types/window/clock.d.ts +153 -0
- package/dist/dom/types/window/compat.d.ts +34 -0
- package/dist/dom/types/window/cookies.d.ts +21 -0
- package/dist/dom/types/window/current.d.ts +7 -0
- package/dist/dom/types/window/document.d.ts +19 -0
- package/dist/dom/types/window/events.d.ts +11 -0
- package/dist/dom/types/window/fallbacks.d.ts +20 -0
- package/dist/dom/types/window/geometry.d.ts +133 -0
- package/dist/dom/types/window/globals.d.ts +7 -0
- package/dist/dom/types/window/hooks.d.ts +22 -0
- package/dist/dom/types/window/host-originals.d.ts +9 -0
- package/dist/dom/types/window/interfaces.d.ts +13 -0
- package/dist/dom/types/window/isolation.d.ts +20 -0
- package/dist/dom/types/window/media.d.ts +33 -0
- package/dist/dom/types/window/not-implemented.d.ts +23 -0
- package/dist/dom/types/window/observers.d.ts +42 -0
- package/dist/dom/types/window/origin.d.ts +3 -0
- package/dist/dom/types/window/timers.d.ts +28 -0
- package/dist/dom/types/window/xhr.d.ts +108 -0
- package/dist/jest-dom/_chunks/matchers-CDnnXUfG.js +2211 -0
- package/dist/jest-dom/_chunks/matchers-D988Ducb.cjs +2516 -0
- package/dist/jest-dom/index.cjs +5 -0
- package/dist/jest-dom/index.js +6 -0
- package/dist/jest-dom/jest-globals.cjs +6 -0
- package/dist/jest-dom/jest-globals.js +7 -0
- package/dist/jest-dom/matchers.cjs +53 -0
- package/dist/jest-dom/matchers.js +3 -0
- package/dist/jest-dom/types/bun.d.ts +13 -0
- package/dist/jest-dom/types/index.d.ts +3 -0
- package/dist/jest-dom/types/jest-globals.d.ts +13 -0
- package/dist/jest-dom/types/jest.d.ts +15 -0
- package/dist/jest-dom/types/matchers-standalone.d.ts +32 -0
- package/dist/jest-dom/types/matchers.d.ts +1079 -0
- package/dist/jest-dom/types/package.json +1 -0
- package/dist/jest-dom/types/vitest.d.ts +16 -0
- package/dist/jest-dom/vitest.cjs +6 -0
- package/dist/jest-dom/vitest.js +7 -0
- package/dist/react/_chunks/pure-DZ97z2oT.cjs +498 -0
- package/dist/react/_chunks/pure-PtE2hivW.js +420 -0
- package/dist/react/dont-cleanup-after-each.cjs +3 -0
- package/dist/react/dont-cleanup-after-each.js +4 -0
- package/dist/react/index.cjs +47 -0
- package/dist/react/index.js +35 -0
- package/dist/react/pure.cjs +17 -0
- package/dist/react/pure.js +5 -0
- package/dist/react/types/act-compat.d.ts +6 -0
- package/dist/react/types/config.d.ts +9 -0
- package/dist/react/types/dont-cleanup-after-each.d.ts +1 -0
- package/dist/react/types/dtl.d.ts +1 -0
- package/dist/react/types/fire-event.d.ts +3 -0
- package/dist/react/types/index.d.ts +1 -0
- package/dist/react/types/pure.d.ts +136 -0
- package/dist/register/index.js +11 -0
- package/dist/register/pure.js +147 -0
- package/dist/register/types/index.d.ts +1 -0
- package/dist/register/types/pure.d.ts +36 -0
- package/dist/testing-library/_chunks/aria-snapshot-diff-D7PzpXew.cjs +1170 -0
- package/dist/testing-library/_chunks/aria-snapshot-diff-Q8Wj33K0.js +985 -0
- package/dist/testing-library/agent.cjs +721 -0
- package/dist/testing-library/agent.js +713 -0
- package/dist/testing-library/index.cjs +2469 -0
- package/dist/testing-library/index.js +2390 -0
- package/dist/testing-library/types/agent.d.ts +56 -0
- package/dist/testing-library/types/aria-role.d.ts +99 -0
- package/dist/testing-library/types/aria-snapshot.d.ts +43 -0
- package/dist/testing-library/types/config.d.ts +27 -0
- package/dist/testing-library/types/events.d.ts +118 -0
- package/dist/testing-library/types/get-node-text.d.ts +1 -0
- package/dist/testing-library/types/get-queries-for-element.d.ts +182 -0
- package/dist/testing-library/types/index.d.ts +24 -0
- package/dist/testing-library/types/matches.d.ts +46 -0
- package/dist/testing-library/types/pretty-dom.d.ts +37 -0
- package/dist/testing-library/types/queries.d.ts +315 -0
- package/dist/testing-library/types/query-helpers.d.ts +112 -0
- package/dist/testing-library/types/role-helpers.d.ts +19 -0
- package/dist/testing-library/types/screen.d.ts +30 -0
- package/dist/testing-library/types/suggestions.d.ts +46 -0
- package/dist/testing-library/types/wait-for-element-to-be-removed.d.ts +6 -0
- package/dist/testing-library/types/wait-for.d.ts +12 -0
- package/dist/user-event/index.cjs +3910 -0
- package/dist/user-event/index.js +3885 -0
- package/dist/user-event/types/clipboard/copy.d.ts +2 -0
- package/dist/user-event/types/clipboard/cut.d.ts +2 -0
- package/dist/user-event/types/clipboard/index.d.ts +3 -0
- package/dist/user-event/types/clipboard/paste.d.ts +3 -0
- package/dist/user-event/types/convenience/click.d.ts +5 -0
- package/dist/user-event/types/convenience/hover.d.ts +4 -0
- package/dist/user-event/types/convenience/index.d.ts +3 -0
- package/dist/user-event/types/convenience/tab.d.ts +4 -0
- package/dist/user-event/types/ctrl-dom.d.ts +50 -0
- package/dist/user-event/types/document/UI.d.ts +35 -0
- package/dist/user-event/types/document/copySelection.d.ts +2 -0
- package/dist/user-event/types/document/getValueOrTextContent.d.ts +2 -0
- package/dist/user-event/types/document/index.d.ts +5 -0
- package/dist/user-event/types/document/interceptor.d.ts +20 -0
- package/dist/user-event/types/document/patchFocus.d.ts +7 -0
- package/dist/user-event/types/document/prepareDocument.d.ts +2 -0
- package/dist/user-event/types/document/trackValue.d.ts +13 -0
- package/dist/user-event/types/dom-types.d.ts +56 -0
- package/dist/user-event/types/event/behavior/click.d.ts +1 -0
- package/dist/user-event/types/event/behavior/cut.d.ts +1 -0
- package/dist/user-event/types/event/behavior/index.d.ts +8 -0
- package/dist/user-event/types/event/behavior/keydown.d.ts +1 -0
- package/dist/user-event/types/event/behavior/keypress.d.ts +1 -0
- package/dist/user-event/types/event/behavior/keyup.d.ts +1 -0
- package/dist/user-event/types/event/behavior/paste.d.ts +1 -0
- package/dist/user-event/types/event/behavior/registry.d.ts +9 -0
- package/dist/user-event/types/event/createEvent.d.ts +8 -0
- package/dist/user-event/types/event/dispatchEvent.d.ts +6 -0
- package/dist/user-event/types/event/eventMap.d.ts +265 -0
- package/dist/user-event/types/event/focus.d.ts +6 -0
- package/dist/user-event/types/event/index.d.ts +7 -0
- package/dist/user-event/types/event/input.d.ts +3 -0
- package/dist/user-event/types/event/radio.d.ts +5 -0
- package/dist/user-event/types/event/selection/getInputRange.d.ts +6 -0
- package/dist/user-event/types/event/selection/getTargetTypeAndSelection.d.ts +11 -0
- package/dist/user-event/types/event/selection/index.d.ts +15 -0
- package/dist/user-event/types/event/selection/modifySelection.d.ts +9 -0
- package/dist/user-event/types/event/selection/modifySelectionPerMouse.d.ts +8 -0
- package/dist/user-event/types/event/selection/moveSelection.d.ts +5 -0
- package/dist/user-event/types/event/selection/resolveCaretPosition.d.ts +9 -0
- package/dist/user-event/types/event/selection/selectAll.d.ts +6 -0
- package/dist/user-event/types/event/selection/setSelection.d.ts +11 -0
- package/dist/user-event/types/event/selection/setSelectionPerMouse.d.ts +9 -0
- package/dist/user-event/types/event/selection/setSelectionRange.d.ts +7 -0
- package/dist/user-event/types/event/selection/updateSelectionOnFocus.d.ts +6 -0
- package/dist/user-event/types/event/types.d.ts +21 -0
- package/dist/user-event/types/event/wrapEvent.d.ts +2 -0
- package/dist/user-event/types/index.d.ts +6 -0
- package/dist/user-event/types/keyboard/index.d.ts +3 -0
- package/dist/user-event/types/keyboard/keyMap.d.ts +5 -0
- package/dist/user-event/types/keyboard/parseKeyDef.d.ts +17 -0
- package/dist/user-event/types/options.d.ts +121 -0
- package/dist/user-event/types/pointer/index.d.ts +29 -0
- package/dist/user-event/types/pointer/keyMap.d.ts +2 -0
- package/dist/user-event/types/pointer/parseKeyDef.d.ts +6 -0
- package/dist/user-event/types/setup/api.d.ts +23 -0
- package/dist/user-event/types/setup/directApi.d.ts +25 -0
- package/dist/user-event/types/setup/dtl.d.ts +20 -0
- package/dist/user-event/types/setup/index.d.ts +22 -0
- package/dist/user-event/types/setup/setup.d.ts +45 -0
- package/dist/user-event/types/setup/wrapAsync.d.ts +4 -0
- package/dist/user-event/types/system/index.d.ts +13 -0
- package/dist/user-event/types/system/keyLocation.d.ts +11 -0
- package/dist/user-event/types/system/keyboard.d.ts +46 -0
- package/dist/user-event/types/system/pointer/buttons.d.ts +25 -0
- package/dist/user-event/types/system/pointer/device.d.ts +8 -0
- package/dist/user-event/types/system/pointer/index.d.ts +21 -0
- package/dist/user-event/types/system/pointer/mouse.d.ts +31 -0
- package/dist/user-event/types/system/pointer/pointer.d.ts +32 -0
- package/dist/user-event/types/system/pointer/shared.d.ts +21 -0
- package/dist/user-event/types/utility/clear.d.ts +3 -0
- package/dist/user-event/types/utility/index.d.ts +4 -0
- package/dist/user-event/types/utility/selectOptions.d.ts +4 -0
- package/dist/user-event/types/utility/type.d.ts +10 -0
- package/dist/user-event/types/utility/upload.d.ts +6 -0
- package/dist/user-event/types/utils/click/isClickableInput.d.ts +17 -0
- package/dist/user-event/types/utils/dataTransfer/Blob.d.ts +4 -0
- package/dist/user-event/types/utils/dataTransfer/Clipboard.d.ts +12 -0
- package/dist/user-event/types/utils/dataTransfer/DataTransfer.d.ts +3 -0
- package/dist/user-event/types/utils/dataTransfer/FileList.d.ts +2 -0
- package/dist/user-event/types/utils/edit/isContentEditable.d.ts +8 -0
- package/dist/user-event/types/utils/edit/isEditable.d.ts +26 -0
- package/dist/user-event/types/utils/edit/maxLength.d.ts +16 -0
- package/dist/user-event/types/utils/edit/setFiles.d.ts +11 -0
- package/dist/user-event/types/utils/edit/timeValue.d.ts +5 -0
- package/dist/user-event/types/utils/focus/cursor.d.ts +5 -0
- package/dist/user-event/types/utils/focus/getActiveElement.d.ts +3 -0
- package/dist/user-event/types/utils/focus/getTabDestination.d.ts +2 -0
- package/dist/user-event/types/utils/focus/isFocusable.d.ts +2 -0
- package/dist/user-event/types/utils/focus/selection.d.ts +9 -0
- package/dist/user-event/types/utils/focus/selector.d.ts +1 -0
- package/dist/user-event/types/utils/index.d.ts +29 -0
- package/dist/user-event/types/utils/keyDef/readNextDescriptor.d.ts +21 -0
- package/dist/user-event/types/utils/misc/cloneEvent.d.ts +2 -0
- package/dist/user-event/types/utils/misc/findClosest.d.ts +2 -0
- package/dist/user-event/types/utils/misc/getDocumentFromNode.d.ts +2 -0
- package/dist/user-event/types/utils/misc/getTreeDiff.d.ts +2 -0
- package/dist/user-event/types/utils/misc/getWindow.d.ts +2 -0
- package/dist/user-event/types/utils/misc/isDescendantOrSelf.d.ts +2 -0
- package/dist/user-event/types/utils/misc/isDisabled.d.ts +2 -0
- package/dist/user-event/types/utils/misc/isElementType.d.ts +6 -0
- package/dist/user-event/types/utils/misc/isVisible.d.ts +2 -0
- package/dist/user-event/types/utils/misc/level.d.ts +9 -0
- package/dist/user-event/types/utils/misc/wait.d.ts +6 -0
- package/dist/user-event/types/utils/pointer/cssPointerEvents.d.ts +4 -0
- package/dist/vitest-environment/failure-snapshot.js +42 -0
- package/dist/vitest-environment/index.js +185 -0
- package/dist/vitest-environment/plugin.js +90 -0
- package/dist/vitest-environment/types/failure-snapshot.d.ts +1 -0
- package/dist/vitest-environment/types/index.d.ts +29 -0
- package/dist/vitest-environment/types/plugin.d.ts +33 -0
- package/jest-preset.cjs +17 -0
- package/package.json +177 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { $a as CharacterData, $i as ValidityState, $t as HTMLMediaElement, A as FileReader, Aa as DOMMatrix, Ai as CSSSupportsRule, An as HTMLObjectElement, As as DragEvent, At as SVGScriptElement, B as HTMLOutputElement, Bn as HTMLTableColElement, Bs as UIEvent, Bt as SVGTitleElement, Ci as CSSPropertyRule, Cn as HTMLLIElement, Cr as AbstractRange, Cs as PromiseRejectionEvent, Ct as SVGPathElement, D as DataTransferItemList, Di as CSSStartingStyleRule, Dn as HTMLMetaElement, Ds as TransitionEvent, Dt as SVGRadialGradientElement, E as DataTransferItem, Ei as CSSScopeRule, En as HTMLMenuElement, Es as ToggleEvent, Et as SVGPolylineElement, F as FormData, Fa as DOMRectList, Fn as HTMLQuoteElement, Fo as NodeList, Fs as PointerEvent, Ft as SVGTSpanElement, G as HTMLButtonElement, Ga as DOMTokenList, Gn as HTMLTrackElement, Gt as HTMLStyleElement, H as HTMLFieldSetElement, Hn as HTMLTableRowElement, Ht as SVGViewElement, Ia as DOMRectReadOnly, In as HTMLSourceElement, Is as TextEvent, It as SVGTextContentElement, J as Option, Ji as CSSStyleDeclaration, Jn as Image, Jt as HTMLTemplateElement, K as HTMLOptGroupElement, Ka as ShadowRoot, Kn as HTMLUListElement, Kt as HTMLTitleElement, L as HTMLFormElement, Ln as HTMLSpanElement, Lr as getComputedStyle, Ls as Touch, Lt as SVGTextElement, M as XMLHttpRequestEventTarget, Ma as DOMPoint, Mi as StyleSheet, Mn as HTMLParamElement, Ms as InputEvent, Mt as SVGStyleElement, N as XMLHttpRequestUpload, Na as DOMPointReadOnly, Ni as StyleSheetList, Nn as HTMLPictureElement, Ns as KeyboardEvent, Nt as SVGSwitchElement, O as IntersectionObserver, Oi as CSSStyleRule, On as HTMLModElement, Or as CommandEvent, Os as ClipboardEvent, Ot as SVGRectElement, P as installGlobals, Pa as DOMRect, Pn as HTMLPreElement, Po as MutationRecord, Ps as MouseEvent, Pt as SVGSymbolElement, Q as HTMLInputElement, Qa as CDATASection, Qt as HTMLAudioElement, R as HTMLDataListElement, Rn as HTMLTableCaptionElement, Rs as TouchEvent, Rt as SVGTextPathElement, Si as CSSPageRule, Sn as HTMLImageElement, Sr as TreeWalker, Ss as ProgressEvent, St as SVGMetadataElement, T as DataTransfer, Ta as Element, Ti as CSSRuleList, Tn as HTMLMarqueeElement, Tr as StaticRange, Ts as SubmitEvent, Tt as SVGPolygonElement, U as HTMLLegendElement, Ua as Attr, Un as HTMLTableSectionElement, Ut as HTMLLinkElement, V as HTMLProgressElement, Va as NamedNodeMap, Vn as HTMLTableElement, Vs as WheelEvent, Vt as SVGUseElement, W as HTMLLabelElement, Wa as DOMStringMap, Wn as HTMLTimeElement, Ws as Event, Wt as HTMLScriptElement, X as HTMLSelectElement, Xa as DocumentType, Xn as ElementInternals, Xt as HTMLDialogElement, Yn as CustomStateSet, Yt as HTMLDetailsElement, Z as HTMLTextAreaElement, Za as DocumentFragment, Zn as HTMLElement, Zt as Audio, _i as CSSLayerBlockRule, _n as HTMLHRElement, _r as XMLDocument, _s as FormDataEvent, _t as SVGImageElement, ai as MediaQueryList, an as HTMLBRElement, ar as Storage, at as SVGCircleElement, bi as CSSNamespaceRule, bn as HTMLHtmlElement, br as NodeFilter, bs as PageTransitionEvent, bt as SVGMarkerElement, ci as MediaQueryListEvent, cn as HTMLCanvasElement, cr as Clipboard, cs as currentDocument, ct as SVGDescElement, di as CSSContainerRule, dn as HTMLDirectoryElement, dr as History, ds as setCurrentWindow, dt as SVGFilterElement, ea as HTMLFormControlsCollection, en as HTMLVideoElement, eo as Comment, es as EventTarget, et as FileList, fi as CSSFontFaceRule, fn as HTMLDivElement, fr as Location, fs as AnimationEvent, ft as SVGForeignObjectElement, gi as CSSKeyframesRule, gn as HTMLFrameSetElement, gr as Document, gs as ErrorEvent, gt as SVGGraphicsElement, hi as CSSKeyframeRule, hn as HTMLFrameElement, hr as DOMImplementation, hs as CustomEvent, ht as SVGGradientElement, in as HTMLAreaElement, it as SVGAnimatedString, j as XMLHttpRequest, ja as DOMMatrixReadOnly, ji as MediaList, jn as HTMLParagraphElement, js as FocusEvent, jt as SVGStopElement, k as ResizeObserver, ki as CSSStyleSheet, kn as HTMLOListElement, ks as CompositionEvent, kt as SVGSVGElement, ln as HTMLDListElement, lr as ClipboardItem, ls as currentWindow, lt as SVGElement, mi as CSSImportRule, mn as HTMLFontElement, mr as XMLSerializer, ms as CloseEvent, mt as SVGGeometryElement, na as RadioNodeList, nn as TimeRanges, no as Text, nr as createWindow, nt as MathMLElement, on as HTMLBaseElement, or as Screen, ot as SVGClipPathElement, pi as CSSGroupingRule, pn as HTMLEmbedElement, pr as DOMParser, ps as BeforeUnloadEvent, pt as SVGGElement, q as HTMLOptionElement, qn as HTMLUnknownElement, qt as HTMLSlotElement, rn as HTMLAnchorElement, ro as HTMLCollection, rt as SVGAElement, sn as HTMLBodyElement, sr as VisualViewport, st as SVGDefsElement, t as CSS, ta as HTMLOptionsCollection, tn as MediaError, to as ProcessingInstruction, tr as Window, ui as CSSConditionRule, un as HTMLDataElement, uo as Node, ur as Navigator, us as currentWindowOrNull, ut as SVGEllipseElement, vi as CSSLayerStatementRule, vn as HTMLHeadElement, vs as HashChangeEvent, vt as SVGLineElement, w as MutationObserver, wi as CSSRule, wn as HTMLMapElement, wr as Range, ws as StorageEvent, wt as SVGPatternElement, xi as CSSNestedDeclarations, xn as HTMLIFrameElement, xr as NodeIterator, xs as PopStateEvent, xt as SVGMaskElement, ya as CustomElementRegistry, yi as CSSMediaRule, yn as HTMLHeadingElement, yr as Selection, ys as MessageEvent, yt as SVGLinearGradientElement, z as HTMLMeterElement, zn as HTMLTableCellElement, zs as TouchList, zt as SVGTextPositioningElement } from "./_chunks/src-DWP2w3IQ.js";
|
|
2
|
+
|
|
3
|
+
export { AbstractRange, AnimationEvent, Attr, Audio, BeforeUnloadEvent, CDATASection, CSS, CSSConditionRule, CSSContainerRule, CSSFontFaceRule, CSSGroupingRule, CSSImportRule, CSSKeyframeRule, CSSKeyframesRule, CSSLayerBlockRule, CSSLayerStatementRule, CSSMediaRule, CSSNamespaceRule, CSSNestedDeclarations, CSSPageRule, CSSPropertyRule, CSSRule, CSSRuleList, CSSScopeRule, CSSStartingStyleRule, CSSStyleDeclaration, CSSStyleRule, CSSStyleSheet, CSSSupportsRule, CharacterData, Clipboard, ClipboardEvent, ClipboardItem, CloseEvent, CommandEvent, Comment, CompositionEvent, CustomElementRegistry, CustomEvent, CustomStateSet, DOMImplementation, DOMMatrix, DOMMatrixReadOnly, DOMParser, DOMPoint, DOMPointReadOnly, DOMRect, DOMRectList, DOMRectReadOnly, DOMStringMap, DOMTokenList, DataTransfer, DataTransferItem, DataTransferItemList, Document, Document as HTMLDocument, DocumentFragment, DocumentType, DragEvent, Element, ElementInternals, ErrorEvent, Event, EventTarget, FileList, FileReader, FocusEvent, FormData, FormDataEvent, HTMLAnchorElement, HTMLAreaElement, HTMLAudioElement, HTMLBRElement, HTMLBaseElement, HTMLBodyElement, HTMLButtonElement, HTMLCanvasElement, HTMLCollection, HTMLDListElement, HTMLDataElement, HTMLDataListElement, HTMLDetailsElement, HTMLDialogElement, HTMLDirectoryElement, HTMLDivElement, HTMLElement, HTMLEmbedElement, HTMLFieldSetElement, HTMLFontElement, HTMLFormControlsCollection, HTMLFormElement, HTMLFrameElement, HTMLFrameSetElement, HTMLHRElement, HTMLHeadElement, HTMLHeadingElement, HTMLHtmlElement, HTMLIFrameElement, HTMLImageElement, HTMLInputElement, HTMLLIElement, HTMLLabelElement, HTMLLegendElement, HTMLLinkElement, HTMLMapElement, HTMLMarqueeElement, HTMLMediaElement, HTMLMenuElement, HTMLMetaElement, HTMLMeterElement, HTMLModElement, HTMLOListElement, HTMLObjectElement, HTMLOptGroupElement, HTMLOptionElement, HTMLOptionsCollection, HTMLOutputElement, HTMLParagraphElement, HTMLParamElement, HTMLPictureElement, HTMLPreElement, HTMLProgressElement, HTMLQuoteElement, HTMLScriptElement, HTMLSelectElement, HTMLSlotElement, HTMLSourceElement, HTMLSpanElement, HTMLStyleElement, HTMLTableCaptionElement, HTMLTableCellElement, HTMLTableColElement, HTMLTableElement, HTMLTableRowElement, HTMLTableSectionElement, HTMLTemplateElement, HTMLTextAreaElement, HTMLTimeElement, HTMLTitleElement, HTMLTrackElement, HTMLUListElement, HTMLUnknownElement, HTMLVideoElement, HashChangeEvent, History, Image, InputEvent, IntersectionObserver, KeyboardEvent, Location, MathMLElement, MediaError, MediaList, MediaQueryList, MediaQueryListEvent, MessageEvent, MouseEvent, MutationObserver, MutationRecord, NamedNodeMap, Navigator, Node, NodeFilter, NodeIterator, NodeList, Option, PageTransitionEvent, PointerEvent, PopStateEvent, ProcessingInstruction, ProgressEvent, PromiseRejectionEvent, RadioNodeList, Range, ResizeObserver, SVGAElement, SVGAnimatedString, SVGCircleElement, SVGClipPathElement, SVGDefsElement, SVGDescElement, SVGElement, SVGEllipseElement, SVGFilterElement, SVGForeignObjectElement, SVGGElement, SVGGeometryElement, SVGGradientElement, SVGGraphicsElement, SVGImageElement, SVGLineElement, SVGLinearGradientElement, SVGMarkerElement, SVGMaskElement, SVGMetadataElement, SVGPathElement, SVGPatternElement, SVGPolygonElement, SVGPolylineElement, SVGRadialGradientElement, SVGRectElement, SVGSVGElement, SVGScriptElement, SVGStopElement, SVGStyleElement, SVGSwitchElement, SVGSymbolElement, SVGTSpanElement, SVGTextContentElement, SVGTextElement, SVGTextPathElement, SVGTextPositioningElement, SVGTitleElement, SVGUseElement, SVGViewElement, Screen, Selection, ShadowRoot, StaticRange, Storage, StorageEvent, StyleSheet, StyleSheetList, SubmitEvent, Text, TextEvent, TimeRanges, ToggleEvent, Touch, TouchEvent, TouchList, TransitionEvent, TreeWalker, UIEvent, ValidityState, VisualViewport, WheelEvent, Window, XMLDocument, XMLHttpRequest, XMLHttpRequestEventTarget, XMLHttpRequestUpload, XMLSerializer, createWindow, currentDocument, currentWindow, currentWindowOrNull, getComputedStyle, installGlobals, setCurrentWindow };
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
import { $ as sanitizeValue, $c as $el, $d as DOCUMENT_NODE, $l as $mediaQueryLists, $n as attrAssociatedElements, $o as NodeImpl, $r as createOwnerSheet, $s as $availableToElementInternals, $u as $settled, Ac as $cookies, Ad as $w, Af as XLINK_NS, Al as $implementation, Ao as setAttribute, Ar as defaultButton, Au as $records, Ba as validateAndExtract, Bc as $defaultValueOverride, Bd as VirtualClock, Bi as fireSyntheticPointerEvent, Bl as $items, Bo as childAt, Br as computedVisibility, Bu as $scrollRestoration, C as optionSelected, Ca as installEventHandlers, Cc as $constructed, Cd as $userActivation, Cf as F_SHADOW_ROOT, Cl as $host, Co as asciiLowercase, Cu as $pseudo, Da as getElementsByClassName, Dc as $controlsDoc, Dd as $value, Df as PROCESSING_INSTRUCTION_NODE, Dl as $idleId, Do as hasAttr, Dr as nodeLength, Du as $readonly, Ea as attachShadowRoot, Ec as $controlsCache, Ed as $validity, Ef as NOTATION_NODE, El as $idleCallbacks, Eo as getAttribute, Er as compareBoundaryPoints, Eu as $rawValue, Fc as $cx, Fd as $writeBuffer, Fi as parseMediaQueryList, Fl as $info, Fo as NodeList, Fr as styleElementRemoved, Fu as $rules, Gc as $dirtyChecked, Gd as installClock, Gi as deferredCompatMembers, Gl as $list, Go as nextElementInTree, Gr as isVisibilityHidden, Gs as EventState, Gu as $selSet, Ha as attrNode, Hc as $derived, Hd as clockNow, Hi as COMPAT_PROFILES, Hl as $kind, Ho as indexOf, Hr as hasAuthorStyles, Hs as hasListeners, Hu as $scrollY, I as installedWindowMethods, Ic as $data, Id as $x, Ii as NodeCache, Il as $innerHeight, Io as ensureIndexGetters, Ir as styleElementUpdated, Iu as $running, Ja as serializeNode, Jc as $disallowModification, Jd as virtualPerformance, Jl as $location, Jo as nextSkippingChildren, Jr as pseudoContent, Js as $aboutBase, Ju as $selectedness, Kc as $dirtyValue, Kd as skipIdleTime, Ki as hiddenGlobals, Kl as $listeners, Ko as nextElementSibling, Kr as pointerEvents, Ks as setTrusted, Ku as $selStart, La as isValidDoctypeName, Lc as $dataset, Ld as $xhr, Li as nodeCache, Ll as $innerWidth, Lo as indexGetterTable, Lr as getComputedStyle, Lu as $runningFrame, Mc as $current, Md as $whenDefined, Mf as XML_NS, Ml as $index, Mo as activeObservers, Mr as isSubmitButton, Mu as $reference, Nc as $customElements, Nd as $width, Nl as $indexed, No as notifyMutationObservers, Nr as setNotImplementedHandler, Nu as $result, Oa as getElementsByTagName, Oc as $controlsVersion, Od as $version, Of as SVG_NS, Ol as $ids, Oo as isAsciiWhitespace, Ou as $readyState, Pc as $customValidity, Pd as $window, Pi as matchMediaText, Pl as $inflight, Pr as isEditable$1, Pu as $root, Qc as $effectAllowed, Qd as DOCUMENT_FRAGMENT_NODE, Qi as isFACE, Ql as $media, Qn as attrAssociatedElement, Qo as AttrRecord, Qr as createLinkSheet, Qs as $attributes, Qu as $sessionStorage, Ra as isValidElementLocalName, Rc as $declarative, Rd as $y, Ri as dispatchTrusted, Rl as $is2D, Ro as derivedCache, Rr as computedDisplay, Ru as $sc, S as isValid, Sa as getEventHandler, Sc as $condition, Sd as $url, Sf as F_MO_REGISTERED, Sl as $home, So as tagName, Su as $presentationStyle, Tc as $contentType, Td as $userValidity, Tf as MATHML_NS, Tl as $id, To as classTokens, Tu as $ranges, Uc as $devicePixelRatio, Ud as clockSkipped, Ui as DEFAULT_COMPAT, Ul as $labels, Uo as isInclusiveAncestor, Ur as isDisplayNone, Us as removeAllEventListeners, Uu as $selDir, Vc as $delegatesFocus, Vd as VirtualTimeout, Vi as COMPAT, Vl as $keyText, Vo as firstElementChild, Vr as currentStyleVersion, Vu as $scrollX, Wc as $dirtiness, Wd as clockStats, Wi as compatExposes, Wl as $layerName, Wo as lastElementChild, Wr as isDisplayNoneInclusive, Wu as $selEnd, Xc as $dropEffect, Xd as CDATA_SECTION_NODE, Xi as parseDeclBlock, Xl as $m, Xo as previousInTree, Xr as uaDisplay, Xs as $assocGen, Xu as $selector, Y as optionSelect, Ya as parseFragment, Yc as $doc, Yd as ATTRIBUTE_NODE, Yi as DeclBlock, Yl as $lockedForReset, Yo as previousElementSibling, Yr as setComputedColorMode, Ys as $active, Yu as $selection, Zc as $ec, Zd as COMMENT_NODE, Zi as faceState, Zl as $matches, Zo as treeRoot, Zr as adoptedStyleSheetsOf, Zs as $attr, Zu as $serializable, _ as isPlaceholderShown, _a as supportsSelectionType, _c as $clonable, _d as $types, _f as F_CUSTOM, _l as $generation, _o as assignedSlot, _u as $preChecked, a as inputIndeterminate, aa as isActuallyDisabled, ac as $block, ad as $so, af as DOCUMENT_POSITION_PRECEDING, al as $files, ao as withNamedProperties, as as setAssignedSlotLookup, au as $nodes, b as isRequired, ba as GLOBAL_EVENT_HANDLER_EVENTS, bc as $compiled, bd as $updatingSelectedContent, bf as F_HAS_STYLE_ATTR, bl as $height, bo as T, bu as $prefix, c as isDefault, ca as isResettable, cc as $cache, cd as $styleVersion, cf as ENTITY_NODE, cl as $firingSubmissionEvents, co as querySelector, cu as $owner, d as isInRange, da as labelsFor, dc as $checkedSet, dd as $target, df as F_ATTR_HOOK, dl as $forms, do as inspectNode, du as $parent, ec as $badInput, ed as $shadowRoot, ef as DOCUMENT_POSITION_CONTAINED_BY, ei as registerOwnerSheet, el as $elements, er as hasExplicitAttrElements, eu as $mode, f as isIndeterminate, fa as INPUT_TYPE_NAMES, fc as $childNodes, fd as $targets, ff as F_CE_CUSTOM, fl as $frameCallbacks, fo as replaceData, fu as $parentRule, g as isOutOfRange, ga as isTextualType, gc as $clipboard, gd as $type, gf as F_CONNECT_HOOK, gl as $frameTime, go as assignedNodes, gu as $preApplied, h as isOptional, ha as isNumericType, hc as $classList, hd as $title, hf as F_CONNECTED, hl as $frameTask, ho as assignedElements, hu as $pointerBeforeReference, i as inputChecked, ia as formOwner, ic as $baseVersion, id as $slotAssignment, if as DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, ii as unregisterOwnerSheet, il as $file, io as ensureCollectionIndexGetters, ir as trackGlobalTimers, is as retarget, iu as $navigator, jc as $css, jd as $whatToShow, jf as XMLNS_NS, jl as $indeterminate, jo as splitOnAsciiWhitespace, jr as implicitSubmission, ju as $rects, ka as getElementsByTagNameNS, kc as $cookieJar, kd as $visualViewport, kf as TEXT_NODE, kl as $impl, ko as removeAttribute, kr as constructEntryList, ku as $record, l as isDisabled, la as isSubmittable, lc as $callback, ld as $supportsText, lf as ENTITY_REFERENCE_NODE, li as windowHooks, ll as $focused, lo as querySelectorAll, lu as $ownerNode, m as isMutable, ma as inputTypeFromAttr, mc as $children, md as $timers, mf as F_CHILD_LIST, ml as $frameId, mo as assignManually, mu as $pastNames, n as controlValue, nc as $baseOverride, nd as $sheet, nf as DOCUMENT_POSITION_DISCONNECTED, ni as setAdoptedStyleSheets, nl as $eo, ns as getCurrentEvent, nu as $names, o as isAutofilled, oa as isLabelable, oc as $byCtor, od as $states, of as DOCUMENT_TYPE_NODE, oi as evaluateMediaQueryList, ol as $fill, oo as closest, os as reportException, ou as $onchange, p as isInvalid, pa as inputType, pc as $childWindows, pd as $tasks, pf as F_CHILDREN_HOOK, pl as $frameElement, po as splitText, pu as $parentWindow, qa as serializeChildren, qc as $disabled, qd as virtualDate, qi as resolveCompat, ql as $localStorage, qo as nextInTree, qr as pointerEventsNone, qs as $_proto__, qu as $selectedOptions, r as hasReadonlyAttribute, ra as listOfOptions, rc as $baseURL, rd as $sheets, rf as DOCUMENT_POSITION_FOLLOWING, ri as styleSheetsOf, rl as $error, ro as HTMLCollection, rr as windowInterfaces, rs as nodeGetTheParent, ru as $namespaces, s as isChecked, sa as isListed, sc as $byName, sd as $style, sf as ELEMENT_NODE, si as mediaEnvironment, sl as $filter, so as matches, ss as setUncaughtExceptionHandler, su as $options, tc as $baseFor, td as $shed, tf as DOCUMENT_POSITION_CONTAINS, ti as removeOwnerSheet, tl as $entries, tr as Window, ts as dispatch, tt as createFileList, tu as $name, u as isEnabled, ua as labeledControl, uc as $checked, ud as $systemId, uf as F_ADOPT_HOOK, ul as $form, uu as $ownerRule, v as isReadOnly, va as valueMode, vc as $closed, vd as $uiValue, vf as F_FACE, vl as $globalObject, vo as findFlattenedSlottables, vr as createEvent, vu as $preCheckedRadio, wa as setEventHandler, wc as $constructingEntryList, wd as $userEdited, wf as HTML_NS, wl as $href, wo as attr, wu as $queries, x as isTextControl, xa as WINDOW_EVENT_HANDLER_EVENTS, xc as $compiledFor, xd as $uri, xf as F_HTML, xl as $history, xo as tagId, xu as $prelude, y as isReadWrite, yc as $coll, yd as $updating, yf as F_HAS_SHADOW, yl as $hasTransients, yo as findSlot, yu as $preIndeterminate, za as isValidNamespacePrefix, zc as $defaultNamespace, zd as $z, zi as fireAnEvent, zl as $isHTML, zo as peekDerivedCache, zr as computedValue, zu as $screen } from "./_chunks/src-DWP2w3IQ.js";
|
|
2
|
+
import { constants, createContext, runInContext } from "node:vm";
|
|
3
|
+
import * as diagnosticsChannel from "node:diagnostics_channel";
|
|
4
|
+
|
|
5
|
+
// src/window/isolation.ts
|
|
6
|
+
let baseline = null;
|
|
7
|
+
function targets() {
|
|
8
|
+
const out = /* @__PURE__ */ new Set();
|
|
9
|
+
const interfaces = windowInterfaces();
|
|
10
|
+
for (const name in interfaces) {
|
|
11
|
+
const value = interfaces[name];
|
|
12
|
+
if (value === null || typeof value !== "object" && typeof value !== "function") continue;
|
|
13
|
+
out.add(value);
|
|
14
|
+
const proto = value.prototype;
|
|
15
|
+
if (typeof value === "function" && proto !== null && typeof proto === "object") out.add(proto);
|
|
16
|
+
}
|
|
17
|
+
out.add(Window.prototype);
|
|
18
|
+
return [...out];
|
|
19
|
+
}
|
|
20
|
+
function snapshot(target) {
|
|
21
|
+
const map = /* @__PURE__ */ new Map();
|
|
22
|
+
for (const key of Reflect.ownKeys(target)) map.set(key, Object.getOwnPropertyDescriptor(target, key));
|
|
23
|
+
return map;
|
|
24
|
+
}
|
|
25
|
+
/** The objects in the baseline (interface objects and their prototypes). */
|
|
26
|
+
let guarded = null;
|
|
27
|
+
/** Record the pristine interface state (first call wins; later calls are no-ops). */
|
|
28
|
+
function captureInterfaceBaseline() {
|
|
29
|
+
if (baseline !== null) return;
|
|
30
|
+
baseline = /* @__PURE__ */ new Map();
|
|
31
|
+
guarded = /* @__PURE__ */ new WeakSet();
|
|
32
|
+
for (const t of targets()) {
|
|
33
|
+
baseline.set(t, snapshot(t));
|
|
34
|
+
guarded.add(t);
|
|
35
|
+
}
|
|
36
|
+
ownObjectCreateMaps();
|
|
37
|
+
}
|
|
38
|
+
/** A realm that lives as long as the process (see ownObjectCreateMaps). */
|
|
39
|
+
let mapOwner = null;
|
|
40
|
+
/**
|
|
41
|
+
* V8 caches the map `Object.create(proto)` builds on `proto`, with the calling realm's `Object`
|
|
42
|
+
* as its constructor, and reuses it from every realm. For prototypes every test file shares — the
|
|
43
|
+
* interface prototypes, and the outer realm's Object.prototype, which every `module.exports` Jest
|
|
44
|
+
* makes inherits from and bundlers' CommonJS interop (`__toESM`) hands to Object.create — the
|
|
45
|
+
* first test file to call it would own the map, and the objects each later file makes with it
|
|
46
|
+
* would keep that file's realm (window, document, module graph) alive for the rest of the worker.
|
|
47
|
+
* So a small permanent realm makes them first. Again after each restore: changing a prototype can
|
|
48
|
+
* replace its map, and the cache with it.
|
|
49
|
+
*/
|
|
50
|
+
function ownObjectCreateMaps() {
|
|
51
|
+
if (baseline === null) return;
|
|
52
|
+
const owner = mapOwner ??= runInContext("(prototypes) => prototypes.map((p) => Object.create(p))", createContext(constants.DONT_CONTEXTIFY));
|
|
53
|
+
const prototypes = [Object.prototype];
|
|
54
|
+
for (const target of baseline.keys()) if (typeof target !== "function") prototypes.push(target);
|
|
55
|
+
owner(prototypes);
|
|
56
|
+
}
|
|
57
|
+
/** `desc` with `configurable: true` when it would define a non-configurable property. */
|
|
58
|
+
function configurableDescriptor(desc) {
|
|
59
|
+
return desc !== null && typeof desc === "object" && desc.configurable !== true ? {
|
|
60
|
+
...desc,
|
|
61
|
+
configurable: true
|
|
62
|
+
} : desc;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Make properties a test file defines on interface objects and prototypes configurable, so
|
|
66
|
+
* `restoreInterfaces()` can undo them. `Object.defineProperty`/`defineProperties` default to
|
|
67
|
+
* non-configurable: shadow-dom-testing-library adds `ShadowRoot.prototype.outerHTML` that way,
|
|
68
|
+
* the getter outlived its file, and the next file in the worker crashed reading
|
|
69
|
+
* `ShadowRoot.prototype.outerHTML` (it calls the getter on the prototype). Patches `realm`'s own
|
|
70
|
+
* `Object.defineProperty`, `Object.defineProperties` and `Reflect.defineProperty` (a test file's
|
|
71
|
+
* vm global has its own intrinsics; @ctrl/dom's code in the outer realm is unaffected). Call after
|
|
72
|
+
* `captureInterfaceBaseline()`. docs/deviations.md.
|
|
73
|
+
*/
|
|
74
|
+
function guardInterfaceDefinitions(realm) {
|
|
75
|
+
const set = guarded;
|
|
76
|
+
if (set === null) return;
|
|
77
|
+
const O = realm.Object;
|
|
78
|
+
const R = realm.Reflect;
|
|
79
|
+
const defineProperty = O.defineProperty;
|
|
80
|
+
const defineProperties = O.defineProperties;
|
|
81
|
+
const reflectDefineProperty = R.defineProperty;
|
|
82
|
+
const wrappers = {
|
|
83
|
+
defineProperty(o, key, desc) {
|
|
84
|
+
return defineProperty(o, key, set.has(o) ? configurableDescriptor(desc) : desc);
|
|
85
|
+
},
|
|
86
|
+
defineProperties(o, props) {
|
|
87
|
+
if (!set.has(o) || props === null || typeof props !== "object") return defineProperties(o, props);
|
|
88
|
+
const coerced = {};
|
|
89
|
+
for (const key of Reflect.ownKeys(props)) if (Object.getOwnPropertyDescriptor(props, key)?.enumerable) coerced[key] = configurableDescriptor(props[key]);
|
|
90
|
+
return defineProperties(o, coerced);
|
|
91
|
+
},
|
|
92
|
+
reflectDefineProperty(o, key, desc) {
|
|
93
|
+
return reflectDefineProperty(o, key, set.has(o) ? configurableDescriptor(desc) : desc);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
Object.defineProperty(wrappers.reflectDefineProperty, "name", { value: "defineProperty" });
|
|
97
|
+
Object.defineProperty(O, "defineProperty", {
|
|
98
|
+
value: wrappers.defineProperty,
|
|
99
|
+
writable: true,
|
|
100
|
+
configurable: true,
|
|
101
|
+
enumerable: false
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(O, "defineProperties", {
|
|
104
|
+
value: wrappers.defineProperties,
|
|
105
|
+
writable: true,
|
|
106
|
+
configurable: true,
|
|
107
|
+
enumerable: false
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(R, "defineProperty", {
|
|
110
|
+
value: wrappers.reflectDefineProperty,
|
|
111
|
+
writable: true,
|
|
112
|
+
configurable: true,
|
|
113
|
+
enumerable: false
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/** https://tc39.es/ecma262/#array-index (canonical numeric strings below 2^32 - 1). */
|
|
117
|
+
function isArrayIndex(key) {
|
|
118
|
+
if (typeof key !== "string" || key === "" || key.length > 10) return false;
|
|
119
|
+
const n = Number(key);
|
|
120
|
+
return n >>> 0 === n && n !== 4294967295 && String(n) === key;
|
|
121
|
+
}
|
|
122
|
+
function sameDescriptor(a, b) {
|
|
123
|
+
return a.value === b.value && a.get === b.get && a.set === b.set && a.writable === b.writable && a.enumerable === b.enumerable && a.configurable === b.configurable;
|
|
124
|
+
}
|
|
125
|
+
/** Undo every change made to interface objects/prototypes since the baseline. Returns how many properties were restored. */
|
|
126
|
+
function restoreInterfaces() {
|
|
127
|
+
if (baseline === null) return 0;
|
|
128
|
+
let restored = 0;
|
|
129
|
+
for (const [target, original] of baseline) {
|
|
130
|
+
const keys = Reflect.ownKeys(target);
|
|
131
|
+
for (const key of keys) {
|
|
132
|
+
if (original.has(key) || isArrayIndex(key)) continue;
|
|
133
|
+
if (Reflect.deleteProperty(target, key)) restored++;
|
|
134
|
+
}
|
|
135
|
+
for (const [key, desc] of original) {
|
|
136
|
+
if (isArrayIndex(key)) continue;
|
|
137
|
+
const current = Object.getOwnPropertyDescriptor(target, key);
|
|
138
|
+
if (current !== void 0 && sameDescriptor(current, desc)) continue;
|
|
139
|
+
try {
|
|
140
|
+
Object.defineProperty(target, key, desc);
|
|
141
|
+
restored++;
|
|
142
|
+
} catch {}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
ownObjectCreateMaps();
|
|
146
|
+
return restored;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// src/trace.ts
|
|
150
|
+
const SPAN_CHANNEL = "ctrl-dom:span";
|
|
151
|
+
const channel = typeof diagnosticsChannel.tracingChannel === "function" ? diagnosticsChannel.tracingChannel(SPAN_CHANNEL) : null;
|
|
152
|
+
/** The tracing channel, for subscribers. Null where the runtime has none. */
|
|
153
|
+
function spanChannel() {
|
|
154
|
+
return channel;
|
|
155
|
+
}
|
|
156
|
+
/** Whether a span would be recorded: check this before formatting a description. */
|
|
157
|
+
function tracing() {
|
|
158
|
+
return channel !== null && channel.hasSubscribers;
|
|
159
|
+
}
|
|
160
|
+
/** Run `fn` as a span. Call only when `tracing()` is true. */
|
|
161
|
+
function traceSync(op, description, fn) {
|
|
162
|
+
const span = {
|
|
163
|
+
op,
|
|
164
|
+
description,
|
|
165
|
+
data: {},
|
|
166
|
+
async: false
|
|
167
|
+
};
|
|
168
|
+
const skipped = clockSkipped();
|
|
169
|
+
return channel.traceSync((s) => {
|
|
170
|
+
try {
|
|
171
|
+
return fn(s);
|
|
172
|
+
} finally {
|
|
173
|
+
recordSkipped(s, skipped);
|
|
174
|
+
}
|
|
175
|
+
}, span, void 0, span);
|
|
176
|
+
}
|
|
177
|
+
/** Run promise-returning `fn` as a span that ends when the promise settles. Call only when `tracing()` is true. */
|
|
178
|
+
function tracePromise(op, description, fn) {
|
|
179
|
+
const span = {
|
|
180
|
+
op,
|
|
181
|
+
description,
|
|
182
|
+
data: {},
|
|
183
|
+
async: true
|
|
184
|
+
};
|
|
185
|
+
const skipped = clockSkipped();
|
|
186
|
+
return channel.tracePromise((s) => fn(s).finally(() => recordSkipped(s, skipped)), span, void 0, span);
|
|
187
|
+
}
|
|
188
|
+
/** How much idle time the virtual clock skipped while the span ran (a findBy's timeout, a debounce). */
|
|
189
|
+
function recordSkipped(span, before) {
|
|
190
|
+
const skipped = clockSkipped() - before;
|
|
191
|
+
if (skipped > 0) span.data["clock.skipped_ms"] = Math.round(skipped);
|
|
192
|
+
}
|
|
193
|
+
const MAX_DESCRIPTION = 160;
|
|
194
|
+
/** `name(arg, arg, ...)` with each argument short and readable, for a span description. */
|
|
195
|
+
function describeCall(name, args) {
|
|
196
|
+
let out = `${name}(`;
|
|
197
|
+
for (let i = 0; i < args.length; i++) {
|
|
198
|
+
if (args[i] === void 0 && i === args.length - 1) break;
|
|
199
|
+
out += (i > 0 ? ", " : "") + describeValue(args[i], 0);
|
|
200
|
+
if (out.length > MAX_DESCRIPTION) return `${out.slice(0, 159)}…)`;
|
|
201
|
+
}
|
|
202
|
+
return `${out})`;
|
|
203
|
+
}
|
|
204
|
+
function describeValue(value, depth) {
|
|
205
|
+
if (typeof value === "string") return JSON.stringify(value.length > 40 ? `${value.slice(0, 39)}…` : value);
|
|
206
|
+
if (typeof value === "function") return value.name ? `${value.name}()` : "fn";
|
|
207
|
+
if (value instanceof RegExp) return String(value);
|
|
208
|
+
if (value === null || typeof value !== "object") return String(value);
|
|
209
|
+
if (value[$impl] !== void 0) return describeNode(value);
|
|
210
|
+
if (Array.isArray(value)) return depth > 0 ? "[…]" : `[${value.slice(0, 3).map((v) => describeValue(v, depth + 1)).join(", ")}${value.length > 3 ? ", …" : ""}]`;
|
|
211
|
+
if (depth > 0) return "{…}";
|
|
212
|
+
const entries = Object.entries(value).slice(0, 4);
|
|
213
|
+
if (entries.length === 0) return "{}";
|
|
214
|
+
return `{ ${entries.map(([k, v]) => `${k}: ${describeValue(v, depth + 1)}`).join(", ")} }`;
|
|
215
|
+
}
|
|
216
|
+
let nodeDescriber = null;
|
|
217
|
+
/**
|
|
218
|
+
* Lets a higher layer name elements in span descriptions: @ctrl/dom/aria registers role and accessible
|
|
219
|
+
* name (`button "Save"`), the way queries find them. Called only while tracing.
|
|
220
|
+
*/
|
|
221
|
+
function setNodeDescriber(describer) {
|
|
222
|
+
nodeDescriber = describer;
|
|
223
|
+
}
|
|
224
|
+
/** An element as a span description shows it: `button "Save"` (see setNodeDescriber), else `<input "Email">`. */
|
|
225
|
+
function describeNode(node) {
|
|
226
|
+
const n = node;
|
|
227
|
+
if (n.nodeType === 9) return "document";
|
|
228
|
+
if (n.nodeType !== 1 || typeof n.localName !== "string") return n.nodeType === 3 ? "#text" : "node";
|
|
229
|
+
if (nodeDescriber !== null) try {
|
|
230
|
+
const described = nodeDescriber(node);
|
|
231
|
+
if (described) return described;
|
|
232
|
+
} catch {}
|
|
233
|
+
if (n.localName === "body" || n.localName === "html") return `<${n.localName}>`;
|
|
234
|
+
const label = n.getAttribute?.("aria-label") || n.textContent?.trim().replace(/\s+/g, " ") || n.getAttribute?.("placeholder") || n.getAttribute?.("name") || "";
|
|
235
|
+
return label === "" ? `<${n.localName}>` : `<${n.localName} ${quote(label)}>`;
|
|
236
|
+
}
|
|
237
|
+
/** A short JSON string: names and labels in descriptions stay under ~40 characters. */
|
|
238
|
+
function quote(text) {
|
|
239
|
+
return JSON.stringify(text.length > 40 ? `${text.slice(0, 39)}…` : text);
|
|
240
|
+
}
|
|
241
|
+
const FAILURE_CHANNEL = "sentry-tests:failure";
|
|
242
|
+
let failureSnapshot = null;
|
|
243
|
+
/**
|
|
244
|
+
* Lets a higher layer describe the page of a failed test: @ctrl/dom/testing-library registers its
|
|
245
|
+
* accessibility snapshot. Called only when a test fails with @ctrl/sentry-tests reporting.
|
|
246
|
+
*/
|
|
247
|
+
function setFailureSnapshot(snapshot) {
|
|
248
|
+
failureSnapshot = snapshot;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* While an environment runs, add the page's accessibility snapshot and the virtual clock to the
|
|
252
|
+
* failures @ctrl/sentry-tests reports from it (only those of `getDocument()`'s document: another
|
|
253
|
+
* environment's subscriber may be listening in the same process). Returns the unsubscribe.
|
|
254
|
+
*/
|
|
255
|
+
function subscribeTestFailures(getDocument) {
|
|
256
|
+
const failures = diagnosticsChannel.channel(FAILURE_CHANNEL);
|
|
257
|
+
const onFailure = (message) => {
|
|
258
|
+
const m = message;
|
|
259
|
+
const document = getDocument();
|
|
260
|
+
if (document == null || m.document !== document) return;
|
|
261
|
+
const clock = clockStats();
|
|
262
|
+
if (clock !== null) m.contexts.clock = {
|
|
263
|
+
skipped_ms: Math.round(clock.skippedMs),
|
|
264
|
+
pending_timers: clock.pendingTimers
|
|
265
|
+
};
|
|
266
|
+
if (failureSnapshot === null || document.body == null) return;
|
|
267
|
+
try {
|
|
268
|
+
m.attachments.push({
|
|
269
|
+
filename: "accessibility-snapshot.txt",
|
|
270
|
+
contentType: "text/plain",
|
|
271
|
+
data: failureSnapshot(document.body)
|
|
272
|
+
});
|
|
273
|
+
} catch {}
|
|
274
|
+
};
|
|
275
|
+
failures.subscribe(onFailure);
|
|
276
|
+
return () => failures.unsubscribe(onFailure);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// src/html/forms/ui.ts
|
|
280
|
+
function implOf(el) {
|
|
281
|
+
return el[$impl] ?? el;
|
|
282
|
+
}
|
|
283
|
+
/** Input types a user types characters into (text-like, email, number, date/time fields). */
|
|
284
|
+
function isTypingType(type) {
|
|
285
|
+
return isTextualType(type) || type === 12 || type >= 7 && type <= 11;
|
|
286
|
+
}
|
|
287
|
+
/** Whether the user can edit the element's value by typing (mutable text control or editing host). */
|
|
288
|
+
function isEditable(el) {
|
|
289
|
+
const impl = implOf(el);
|
|
290
|
+
if (impl.tag === T.input) return isTypingType(inputType(impl)) && isMutable(impl);
|
|
291
|
+
if (impl.tag === T.textarea) return isMutable(impl);
|
|
292
|
+
return isEditable$1(impl);
|
|
293
|
+
}
|
|
294
|
+
/** Whether the selection APIs (selectionStart, setSelectionRange, ...) work on the element. */
|
|
295
|
+
function supportsSelection(el) {
|
|
296
|
+
const impl = implOf(el);
|
|
297
|
+
if (impl.tag === T.textarea) return true;
|
|
298
|
+
return impl.tag === T.input && supportsSelectionType(inputType(impl));
|
|
299
|
+
}
|
|
300
|
+
/** Whether the element has a UI value/selection (input in value mode or textarea). */
|
|
301
|
+
function hasUIValue(el) {
|
|
302
|
+
const impl = implOf(el);
|
|
303
|
+
if (impl.tag === T.textarea) return true;
|
|
304
|
+
return impl.tag === T.input && valueMode(inputType(impl)) === 0;
|
|
305
|
+
}
|
|
306
|
+
/** The value as the user sees it (raw typed text), falling back to `.value`. */
|
|
307
|
+
function getUIValue(el) {
|
|
308
|
+
const impl = implOf(el);
|
|
309
|
+
if (impl.tag === T.input) {
|
|
310
|
+
const input = impl.node;
|
|
311
|
+
return input[$uiValue] ?? input.value;
|
|
312
|
+
}
|
|
313
|
+
if (impl.tag === T.textarea) return impl.node.value;
|
|
314
|
+
return "";
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Set the value as a user edit: sanitizes like the browser, marks the value dirty and
|
|
318
|
+
* "last changed by a user edit" (tooLong/tooShort apply), records badInput when the typed text
|
|
319
|
+
* cannot be represented (e.g. "1e" in a number field). Does not fire events.
|
|
320
|
+
*/
|
|
321
|
+
function setUIValue(el, value) {
|
|
322
|
+
const impl = implOf(el);
|
|
323
|
+
if (impl.tag === T.input) {
|
|
324
|
+
const input = impl.node;
|
|
325
|
+
const type = inputType(impl);
|
|
326
|
+
if (valueMode(type) !== 0) return;
|
|
327
|
+
const sanitized = sanitizeValue(type, value, impl);
|
|
328
|
+
impl.doc[$version]++;
|
|
329
|
+
input[$value] = sanitized;
|
|
330
|
+
input[$dirtyValue] = true;
|
|
331
|
+
input[$userEdited] = true;
|
|
332
|
+
input[$uiValue] = sanitized === value ? null : value;
|
|
333
|
+
input[$badInput] = sanitized === "" && value !== "" && type !== 5 && !isTextualType(type);
|
|
334
|
+
const len = value.length;
|
|
335
|
+
if (input[$selStart] > len) input[$selStart] = len;
|
|
336
|
+
if (input[$selEnd] > len) input[$selEnd] = len;
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
if (impl.tag === T.textarea) {
|
|
340
|
+
const ta = impl.node;
|
|
341
|
+
impl.doc[$version]++;
|
|
342
|
+
ta[$rawValue] = value;
|
|
343
|
+
ta[$dirtyValue] = true;
|
|
344
|
+
ta[$userEdited] = true;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
/** Forget the UI value (the next getUIValue returns `.value`). */
|
|
348
|
+
function clearUIValue(el) {
|
|
349
|
+
const impl = implOf(el);
|
|
350
|
+
if (impl.tag === T.input) {
|
|
351
|
+
const input = impl.node;
|
|
352
|
+
input[$uiValue] = null;
|
|
353
|
+
input[$badInput] = false;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/** The caret/selection inside an input or textarea (works for every value-mode input type). */
|
|
357
|
+
function getUISelection(el) {
|
|
358
|
+
const host = implOf(el).node;
|
|
359
|
+
const len = getUIValue(el).length;
|
|
360
|
+
return {
|
|
361
|
+
start: Math.min(host[$selStart], len),
|
|
362
|
+
end: Math.min(host[$selEnd], len),
|
|
363
|
+
direction: host[$selDir]
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
/** Set the caret/selection as the user would (no exceptions for email/number inputs). */
|
|
367
|
+
function setUISelection(el, start, end = start, direction = "none") {
|
|
368
|
+
const impl = implOf(el);
|
|
369
|
+
if (impl.tag !== T.input && impl.tag !== T.textarea) return;
|
|
370
|
+
const host = impl.node;
|
|
371
|
+
const len = getUIValue(el).length;
|
|
372
|
+
let s = Math.max(0, Math.min(start, end));
|
|
373
|
+
let e = Math.max(start, end);
|
|
374
|
+
if (e > len) e = len;
|
|
375
|
+
if (s > e) s = e;
|
|
376
|
+
host[$selStart] = s;
|
|
377
|
+
host[$selEnd] = e;
|
|
378
|
+
host[$selDir] = direction;
|
|
379
|
+
}
|
|
380
|
+
/** Replace a file input's selected files as the file picker would (no events). */
|
|
381
|
+
function setFilesFromUI(el, files) {
|
|
382
|
+
const impl = implOf(el);
|
|
383
|
+
if (impl.tag !== T.input || inputType(impl) !== 17) return;
|
|
384
|
+
impl.doc[$version]++;
|
|
385
|
+
impl.node[$files] = createFileList(files);
|
|
386
|
+
}
|
|
387
|
+
/** Set an option's selectedness as the user would (dirty; single selects deselect the rest). */
|
|
388
|
+
function setOptionSelectedFromUI(option, selected) {
|
|
389
|
+
const impl = implOf(option);
|
|
390
|
+
if (impl.tag !== T.option) return;
|
|
391
|
+
const o = impl.node;
|
|
392
|
+
o._setSelectedness(selected);
|
|
393
|
+
o[$dirtiness] = true;
|
|
394
|
+
const select = optionSelect(impl);
|
|
395
|
+
if (select !== null) {
|
|
396
|
+
const s = select.node;
|
|
397
|
+
if (selected) s._deselectOthers(impl);
|
|
398
|
+
s._updateSelectedContent();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/** Set a checkbox/radio's checkedness as the user would (dirty; radio groups stay exclusive). */
|
|
402
|
+
function setCheckedFromUI(el, checked) {
|
|
403
|
+
const impl = implOf(el);
|
|
404
|
+
if (impl.tag !== T.input) return;
|
|
405
|
+
impl.node._setCheckedness(checked, true);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// src/internal.ts
|
|
409
|
+
const OWN_GET_COMPUTED_STYLE = Window.prototype.getComputedStyle;
|
|
410
|
+
let memoView = null;
|
|
411
|
+
let memoFn = null;
|
|
412
|
+
let memoResult = null;
|
|
413
|
+
/**
|
|
414
|
+
* The user-replaced `getComputedStyle` of `node`'s window (`ownerDocument.defaultView`), bound
|
|
415
|
+
* to that window, or null when it is @ctrl/dom's own (the prototype method, or the bound copy
|
|
416
|
+
* installGlobals put on a host global) or there is no window / no function.
|
|
417
|
+
*/
|
|
418
|
+
function getComputedStyleOverride(node) {
|
|
419
|
+
const view = node.doc.defaultView;
|
|
420
|
+
if (view === null || view === void 0) return null;
|
|
421
|
+
const fn = view.getComputedStyle;
|
|
422
|
+
if (fn === OWN_GET_COMPUTED_STYLE || typeof fn !== "function" || installedWindowMethods.has(fn)) return null;
|
|
423
|
+
if (memoFn?.deref() === fn && memoView?.deref() === view) {
|
|
424
|
+
const memo = memoResult.deref();
|
|
425
|
+
if (memo !== void 0) return memo;
|
|
426
|
+
}
|
|
427
|
+
const result = fn.bind(view);
|
|
428
|
+
memoView = new WeakRef(view);
|
|
429
|
+
memoFn = new WeakRef(fn);
|
|
430
|
+
memoResult = new WeakRef(result);
|
|
431
|
+
return result;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export { $_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, $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, $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_ATTR_HOOK, F_CE_CUSTOM, F_CHILDREN_HOOK, F_CHILD_LIST, F_CONNECTED, F_CONNECT_HOOK, F_CUSTOM, F_FACE, F_HAS_SHADOW, F_HAS_STYLE_ATTR, F_HTML, F_MO_REGISTERED, F_SHADOW_ROOT, 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, activeObservers, adoptedStyleSheetsOf, asciiLowercase, assignManually, assignedElements, assignedNodes, assignedSlot, attachShadowRoot, attr, attrAssociatedElement, attrAssociatedElements, attrNode, 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, 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, isDefault, isDisabled, isDisplayNone, isDisplayNoneInclusive, isEditable as 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, 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, spanChannel, splitOnAsciiWhitespace, splitText, styleElementRemoved, createOwnerSheet as styleElementSheet, styleElementUpdated, styleSheetsOf, subscribeTestFailures, supportsSelection, supportsSelectionType, tagId, tagName, tracePromise, traceSync, tracing, trackGlobalTimers, treeRoot, uaDisplay, unregisterOwnerSheet, validateAndExtract, valueMode, virtualDate, virtualPerformance, windowHooks, windowInterfaces, withNamedProperties };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
/** @internal `element.dataset` for `el` (nodes/Element.ts). */
|
|
3
|
+
export declare function createDOMStringMap(el: NodeImpl): DOMStringMap;
|
|
4
|
+
export declare class DOMStringMap {
|
|
5
|
+
[name: string]: string | undefined;
|
|
6
|
+
/** @internal Use createDOMStringMap. */
|
|
7
|
+
constructor(el: NodeImpl);
|
|
8
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
export declare class DOMTokenList {
|
|
3
|
+
#private;
|
|
4
|
+
/** @internal */
|
|
5
|
+
constructor(el: NodeImpl, attributeName: string, supportedTokens?: readonly string[] | null);
|
|
6
|
+
get length(): number;
|
|
7
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-item */
|
|
8
|
+
item(index: number): string | null;
|
|
9
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-contains */
|
|
10
|
+
contains(token: string): boolean;
|
|
11
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-add */
|
|
12
|
+
add(...tokens: string[]): void;
|
|
13
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-remove */
|
|
14
|
+
remove(...tokens: string[]): void;
|
|
15
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-toggle */
|
|
16
|
+
toggle(token: string, force?: boolean): boolean;
|
|
17
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-replace */
|
|
18
|
+
replace(token: string, newToken: string): boolean;
|
|
19
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-supports */
|
|
20
|
+
supports(token: string): boolean;
|
|
21
|
+
/** https://dom.spec.whatwg.org/#dom-domtokenlist-value */
|
|
22
|
+
get value(): string;
|
|
23
|
+
set value(value: string);
|
|
24
|
+
toString(): string;
|
|
25
|
+
/** @internal Remove the associated attribute entirely (used by some reflecting setters). */
|
|
26
|
+
_clear(): void;
|
|
27
|
+
[index: number]: string;
|
|
28
|
+
forEach: (callback: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: unknown) => void;
|
|
29
|
+
entries: () => ArrayIterator<[number, string]>;
|
|
30
|
+
keys: () => ArrayIterator<number>;
|
|
31
|
+
values: () => ArrayIterator<string>;
|
|
32
|
+
[Symbol.iterator]: () => ArrayIterator<string>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Document } from "../nodes/Document.js";
|
|
2
|
+
import type { Element } from "../nodes/Element.js";
|
|
3
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
4
|
+
import { $coll, $items, $version } from "../keys.js";
|
|
5
|
+
export type ElementFilter = (el: NodeImpl) => boolean;
|
|
6
|
+
/** @internal Monomorphic state record of an HTMLCollection. */
|
|
7
|
+
export declare class CollectionState {
|
|
8
|
+
root: NodeImpl;
|
|
9
|
+
/** true: only element children of root; false: descendants matching `filter`. */
|
|
10
|
+
childrenOnly: boolean;
|
|
11
|
+
filter: ElementFilter | null;
|
|
12
|
+
items: Element[];
|
|
13
|
+
doc: Document | null;
|
|
14
|
+
version: number;
|
|
15
|
+
constructor(root: NodeImpl, childrenOnly: boolean, filter: ElementFilter | null);
|
|
16
|
+
/** nodes/derived.ts: release the (stale) members once a node was removed from the document. */
|
|
17
|
+
_dropSnapshot(): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class HTMLCollection {
|
|
20
|
+
[$coll]: CollectionState;
|
|
21
|
+
/** Free for subclasses that override `_snapshot()` (not used by the base class). */
|
|
22
|
+
[$items]: Element[] | null;
|
|
23
|
+
[$version]: number;
|
|
24
|
+
/** @internal Use the static factories or a subclass. */
|
|
25
|
+
constructor(root: NodeImpl, childrenOnly?: boolean, filter?: ElementFilter | null);
|
|
26
|
+
/**
|
|
27
|
+
* @internal Collection state (prototype accessor, so it is not an own property name).
|
|
28
|
+
* TODO(html): html/collection.ts and html/forms/collections.ts could read `this[$coll]`.
|
|
29
|
+
*/
|
|
30
|
+
get _s(): CollectionState;
|
|
31
|
+
/** @internal The collection root. */
|
|
32
|
+
get _rootImpl(): NodeImpl;
|
|
33
|
+
/** @internal Element children of `root` (ParentNode.children). */
|
|
34
|
+
static _childrenOf(root: NodeImpl): HTMLCollection;
|
|
35
|
+
/** @internal Descendant elements of `root` matching `filter`, in tree order. */
|
|
36
|
+
static _descendants(root: NodeImpl, filter: ElementFilter | null): HTMLCollection;
|
|
37
|
+
/**
|
|
38
|
+
* @internal Fill `out` with the members in tree order. Subclasses override this for custom
|
|
39
|
+
* membership; it runs only when the document changed since the last snapshot.
|
|
40
|
+
*/
|
|
41
|
+
_collect(out: Element[]): void;
|
|
42
|
+
/** @internal Current members (shared array: do not mutate). */
|
|
43
|
+
_snapshot(): Element[];
|
|
44
|
+
get length(): number;
|
|
45
|
+
/** https://dom.spec.whatwg.org/#dom-htmlcollection-item */
|
|
46
|
+
item(index: number): Element | null;
|
|
47
|
+
/** https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key */
|
|
48
|
+
namedItem(key: string): Element | null;
|
|
49
|
+
/** https://dom.spec.whatwg.org/#ref-for-dfn-supported-property-names */
|
|
50
|
+
_supportedPropertyNames(): string[];
|
|
51
|
+
[index: number]: Element;
|
|
52
|
+
[Symbol.iterator]: () => ArrayIterator<Element>;
|
|
53
|
+
}
|
|
54
|
+
/** @internal Make sure prototype index getters cover `n` items (subclasses that override both `_snapshot` and `length`). */
|
|
55
|
+
export declare function ensureCollectionIndexGetters(n: number): void;
|
|
56
|
+
/**
|
|
57
|
+
* Wrap a collection in a Proxy that implements WebIDL named properties
|
|
58
|
+
* (https://webidl.spec.whatwg.org/#legacy-platform-object-getownproperty) on top of
|
|
59
|
+
* `namedItem` / `_supportedPropertyNames`. Use only where named access is common enough to
|
|
60
|
+
* justify the per-read Proxy cost (form.elements, document.forms).
|
|
61
|
+
*/
|
|
62
|
+
export declare function withNamedProperties<C extends HTMLCollection>(collection: C): C;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
import type { Attr } from "../nodes/Attr.js";
|
|
3
|
+
declare const $el: unique symbol;
|
|
4
|
+
export declare class NamedNodeMap {
|
|
5
|
+
[$el]: NodeImpl;
|
|
6
|
+
/** @internal */
|
|
7
|
+
constructor(el: NodeImpl);
|
|
8
|
+
get length(): number;
|
|
9
|
+
/** https://dom.spec.whatwg.org/#dom-namednodemap-item */
|
|
10
|
+
item(index: number): Attr | null;
|
|
11
|
+
/** https://dom.spec.whatwg.org/#dom-namednodemap-getnameditem */
|
|
12
|
+
getNamedItem(qualifiedName: string): Attr | null;
|
|
13
|
+
getNamedItemNS(namespace: string | null, localName: string): Attr | null;
|
|
14
|
+
setNamedItem(attr: Attr): Attr | null;
|
|
15
|
+
setNamedItemNS(attr: Attr): Attr | null;
|
|
16
|
+
/** https://dom.spec.whatwg.org/#dom-namednodemap-removenameditem */
|
|
17
|
+
removeNamedItem(qualifiedName: string): Attr;
|
|
18
|
+
removeNamedItemNS(namespace: string | null, localName: string): Attr;
|
|
19
|
+
[index: number]: Attr;
|
|
20
|
+
[Symbol.iterator]: () => ArrayIterator<Attr>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Node } from "../nodes/Node.js";
|
|
2
|
+
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
3
|
+
import { CollectionIterator } from "./iterator.js";
|
|
4
|
+
import { $items, $version } from "../keys.js";
|
|
5
|
+
export declare class NodeList {
|
|
6
|
+
#private;
|
|
7
|
+
/** For lazy subclasses: their cached snapshot (subclasses manage these). */
|
|
8
|
+
[$items]: Node[] | null;
|
|
9
|
+
[$version]: number;
|
|
10
|
+
/**
|
|
11
|
+
* @internal Use `NodeList._static` / `NodeList._live`. Subclasses call `super(null)` and
|
|
12
|
+
* override `_snapshot()`.
|
|
13
|
+
*/
|
|
14
|
+
constructor(parent: NodeImpl | null, _items?: Node[] | null);
|
|
15
|
+
/** @internal A static NodeList over `items` (the array is not retained). */
|
|
16
|
+
static _static(items: readonly Node[]): NodeList;
|
|
17
|
+
/** @internal A static NodeList over NodeImpls (avoids an intermediate wrapper array). */
|
|
18
|
+
static _staticFromImpls(items: readonly NodeImpl[]): NodeList;
|
|
19
|
+
/** @internal The live `childNodes` list of `parent`. */
|
|
20
|
+
static _live(parent: NodeImpl): NodeList;
|
|
21
|
+
/** @internal Called by tree.ts after `node` was linked as the LAST child of a flagged parent. */
|
|
22
|
+
static _appended(list: NodeList, node: Node): void;
|
|
23
|
+
/** @internal Called by tree.ts after the LAST child of a flagged parent was unlinked. */
|
|
24
|
+
static _popped(list: NodeList): void;
|
|
25
|
+
/** @internal Called by tree.ts after any other change to a flagged parent's children. */
|
|
26
|
+
static _rebuild(list: NodeList): void;
|
|
27
|
+
/**
|
|
28
|
+
* @internal Current members. Lazy subclasses override this; for plain lists it copies the
|
|
29
|
+
* own index properties.
|
|
30
|
+
*/
|
|
31
|
+
_snapshot(): Node[];
|
|
32
|
+
get length(): number;
|
|
33
|
+
/** https://dom.spec.whatwg.org/#dom-nodelist-item */
|
|
34
|
+
item(index: number): Node | null;
|
|
35
|
+
/** @internal values() / @@iterator: lazy lists are read through their snapshot. */
|
|
36
|
+
static _values(self: unknown): CollectionIterator;
|
|
37
|
+
[index: number]: Node;
|
|
38
|
+
forEach: (callback: (value: Node, key: number, parent: NodeList) => void, thisArg?: unknown) => void;
|
|
39
|
+
entries: () => ArrayIterator<[number, Node]>;
|
|
40
|
+
keys: () => ArrayIterator<number>;
|
|
41
|
+
values: () => ArrayIterator<Node>;
|
|
42
|
+
[Symbol.iterator]: () => ArrayIterator<Node>;
|
|
43
|
+
}
|