@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,5 @@
|
|
|
1
|
+
import type { Element } from '../dom-types.js';
|
|
2
|
+
import { type Instance } from '../setup/index.js';
|
|
3
|
+
export declare function click(this: Instance, element: Element): Promise<void>;
|
|
4
|
+
export declare function dblClick(this: Instance, element: Element): Promise<void>;
|
|
5
|
+
export declare function tripleClick(this: Instance, element: Element): Promise<void>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { NodeImpl } from '@ctrl/dom/internal';
|
|
2
|
+
import type { Element, Node } from './dom-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* @ctrl/dom html-forms UI state (`src/html/forms/ui.ts`, re-exported from `@ctrl/dom/internal`).
|
|
5
|
+
* All functions take the public wrapper of an <input> or <textarea>.
|
|
6
|
+
*/
|
|
7
|
+
export interface CtrlDomFormsUI {
|
|
8
|
+
/** The value as displayed in the UI (unsanitized; e.g. "1e" while typing into type=number). */
|
|
9
|
+
getUIValue(el: Element): string;
|
|
10
|
+
/**
|
|
11
|
+
* Set the value as a user edit: sanitizes, sets the dirty value flag, keeps the raw UI value,
|
|
12
|
+
* and never invokes an own-property `value` setter on the instance (React's value tracker
|
|
13
|
+
* does not observe it). Fires no events.
|
|
14
|
+
*/
|
|
15
|
+
setUIValue(el: Element, value: string): void;
|
|
16
|
+
/** Forget the UI value (the next getUIValue returns `.value`). */
|
|
17
|
+
clearUIValue(el: Element): void;
|
|
18
|
+
/** UI selection; available for every value-mode input type, not only those supporting the selection API. */
|
|
19
|
+
getUISelection(el: Element): {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
direction: 'forward' | 'backward' | 'none';
|
|
23
|
+
};
|
|
24
|
+
/** Set the UI selection (clamped to the UI value). Fires no events. */
|
|
25
|
+
setUISelection(el: Element, start: number, end?: number, direction?: 'forward' | 'backward' | 'none'): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Contract expected from @ctrl/dom css (`src/css/internal.ts`).
|
|
29
|
+
*
|
|
30
|
+
* TODO(css): export from `@ctrl/dom/internal`.
|
|
31
|
+
*/
|
|
32
|
+
export interface CtrlDomCss {
|
|
33
|
+
/** Computed value of `property` for the element (specified + inherited, no layout). */
|
|
34
|
+
computedValue(el: NodeImpl, property: string): string;
|
|
35
|
+
isDisplayNone(el: NodeImpl): boolean;
|
|
36
|
+
isVisibilityHidden(el: NodeImpl): boolean;
|
|
37
|
+
}
|
|
38
|
+
/** @ctrl/dom UI value/selection hooks, or null while html-forms does not provide them. */
|
|
39
|
+
export declare const ctrlDomUI: CtrlDomFormsUI | null;
|
|
40
|
+
/** @ctrl/dom computed-style fast reads, or null while css does not provide them. */
|
|
41
|
+
export declare const ctrlDomCss: CtrlDomCss | null;
|
|
42
|
+
/**
|
|
43
|
+
* Let `ms` of idle time pass on @ctrl/dom's idle-skipping clock (src/window/clock.ts), as a real
|
|
44
|
+
* wait would there; false when a timer falls due in that time. True without such a clock.
|
|
45
|
+
*/
|
|
46
|
+
export declare function skipIdleTime(ms: number): boolean;
|
|
47
|
+
/** The NodeImpl behind an @ctrl/dom wrapper, or null for nodes of other DOM implementations. */
|
|
48
|
+
export declare function implOf(node: Node | null | undefined): NodeImpl | null;
|
|
49
|
+
/** Whether `el` is an @ctrl/dom element and the html-forms UI hooks are available. */
|
|
50
|
+
export declare function hasCtrlDomUI(el: Element): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HTMLInputElement, HTMLTextAreaElement } from '../dom-types.js';
|
|
2
|
+
declare const UIValue: unique symbol;
|
|
3
|
+
declare const UISelection: unique symbol;
|
|
4
|
+
interface UISelection {
|
|
5
|
+
anchorOffset: number;
|
|
6
|
+
focusOffset: number;
|
|
7
|
+
}
|
|
8
|
+
export type UIValueString = string & {
|
|
9
|
+
[UIValue]: true;
|
|
10
|
+
};
|
|
11
|
+
export type UISelectionStart = number & {
|
|
12
|
+
[UISelection]: true;
|
|
13
|
+
};
|
|
14
|
+
export declare function isUIValue(value: string | UIValueString): value is UIValueString;
|
|
15
|
+
export declare function isUISelectionStart(start: number | UISelectionStart | null): start is UISelectionStart;
|
|
16
|
+
export declare function setUIValue(element: HTMLInputElement | HTMLTextAreaElement, value: string): void;
|
|
17
|
+
export declare function getUIValue(element: HTMLInputElement | HTMLTextAreaElement): string;
|
|
18
|
+
/** Flag the IDL value as clean. This does not change the value. */
|
|
19
|
+
export declare function setUIValueClean(element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
20
|
+
export declare function clearInitialValue(element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
21
|
+
export declare function getInitialValue(element: HTMLInputElement | HTMLTextAreaElement): string | undefined;
|
|
22
|
+
export declare function setUISelectionRaw(element: HTMLInputElement | HTMLTextAreaElement, selection: UISelection): void;
|
|
23
|
+
export declare function setUISelection(element: HTMLInputElement | HTMLTextAreaElement, { focusOffset: focusOffsetParam, anchorOffset: anchorOffsetParam, }: {
|
|
24
|
+
anchorOffset?: number;
|
|
25
|
+
focusOffset: number;
|
|
26
|
+
}, mode?: 'replace' | 'modify'): void;
|
|
27
|
+
export type UISelectionRange = UISelection & {
|
|
28
|
+
startOffset: number;
|
|
29
|
+
endOffset: number;
|
|
30
|
+
};
|
|
31
|
+
export declare function getUISelection(element: HTMLInputElement | HTMLTextAreaElement): UISelectionRange;
|
|
32
|
+
export declare function hasUISelection(element: HTMLInputElement | HTMLTextAreaElement): boolean;
|
|
33
|
+
/** Flag the IDL selection as clean. This does not change the selection. */
|
|
34
|
+
export declare function setUISelectionClean(element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { getUISelection, getUIValue, setUISelection, setUIValue, clearInitialValue, } from './UI.js';
|
|
2
|
+
export type { UISelectionRange } from './UI.js';
|
|
3
|
+
export { getValueOrTextContent } from './getValueOrTextContent.js';
|
|
4
|
+
export { copySelection } from './copySelection.js';
|
|
5
|
+
export { commitValueAfterInput } from './trackValue.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Element, HTMLInputElement, HTMLTextAreaElement } from '../dom-types.js';
|
|
2
|
+
type anyFunc = (...a: any[]) => any;
|
|
3
|
+
type Params<Prop> = Prop extends anyFunc ? Parameters<Prop> : [Prop];
|
|
4
|
+
type ImplReturn<Prop> = Prop extends anyFunc ? Parameters<Prop> : Prop;
|
|
5
|
+
export declare function prepareInterceptor<ElementType extends Element, PropName extends keyof ElementType>(element: ElementType, propName: PropName, interceptorImpl: (this: ElementType, ...args: Params<ElementType[PropName]>) => {
|
|
6
|
+
/**
|
|
7
|
+
* React tracks the changes on element properties.
|
|
8
|
+
* This workaround tries to alter the DOM element without React noticing,
|
|
9
|
+
* so that it later picks up the change.
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/facebook/react/blob/148f8e497c7d37a3c7ab99f01dec2692427272b1/packages/react-dom/src/client/inputValueTracking.js#L51-L104
|
|
12
|
+
*/
|
|
13
|
+
applyNative?: boolean;
|
|
14
|
+
realArgs?: ImplReturn<ElementType[PropName]>;
|
|
15
|
+
then?: () => void;
|
|
16
|
+
}): void;
|
|
17
|
+
export declare function prepareValueInterceptor(element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
18
|
+
export declare function prepareSelectionInterceptor(element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
19
|
+
export declare function prepareRangeTextInterceptor(element: HTMLInputElement | HTMLTextAreaElement): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLElement } from '../dom-types.js';
|
|
2
|
+
type HTMLElementConstructor = {
|
|
3
|
+
prototype: HTMLElement;
|
|
4
|
+
};
|
|
5
|
+
export declare function patchFocus(HTMLElement: HTMLElementConstructor): void;
|
|
6
|
+
export declare function restoreFocus(HTMLElement: HTMLElementConstructor): void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLInputElement, HTMLTextAreaElement } from '../dom-types.js';
|
|
2
|
+
declare const TrackChanges: unique symbol;
|
|
3
|
+
type TrackedElement = (HTMLInputElement | HTMLTextAreaElement) & {
|
|
4
|
+
[TrackChanges]?: {
|
|
5
|
+
previousValue?: string;
|
|
6
|
+
tracked?: string[];
|
|
7
|
+
nextValue?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare function startTrackValue(element: TrackedElement): void;
|
|
11
|
+
export declare function trackOrSetValue(element: TrackedElement, v: string): void;
|
|
12
|
+
export declare function commitValueAfterInput(element: TrackedElement, cursorOffset: number): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Published declarations: these are the lib.dom types (see scripts/build.ts).
|
|
2
|
+
export type EventInit = globalThis.EventInit;
|
|
3
|
+
export type UIEventInit = globalThis.UIEventInit;
|
|
4
|
+
export type EventModifierInit = globalThis.EventModifierInit;
|
|
5
|
+
export type MouseEventInit = globalThis.MouseEventInit;
|
|
6
|
+
export type PointerEventInit = globalThis.PointerEventInit;
|
|
7
|
+
export type KeyboardEventInit = globalThis.KeyboardEventInit;
|
|
8
|
+
export type InputEventInit = globalThis.InputEventInit;
|
|
9
|
+
export type FocusEventInit = globalThis.FocusEventInit;
|
|
10
|
+
export type ClipboardEventInit = globalThis.ClipboardEventInit;
|
|
11
|
+
export type AddEventListenerOptions = globalThis.AddEventListenerOptions;
|
|
12
|
+
export type EventTarget = globalThis.EventTarget;
|
|
13
|
+
export type Event = globalThis.Event;
|
|
14
|
+
export type UIEvent = globalThis.UIEvent;
|
|
15
|
+
export type MouseEvent = globalThis.MouseEvent;
|
|
16
|
+
export type PointerEvent = globalThis.PointerEvent;
|
|
17
|
+
export type KeyboardEvent = globalThis.KeyboardEvent;
|
|
18
|
+
export type InputEvent = globalThis.InputEvent;
|
|
19
|
+
export type FocusEvent = globalThis.FocusEvent;
|
|
20
|
+
export type ClipboardEvent = globalThis.ClipboardEvent;
|
|
21
|
+
export type DocumentEventMap = globalThis.DocumentEventMap;
|
|
22
|
+
export type NodeListOf<T extends Node> = globalThis.NodeListOf<T>;
|
|
23
|
+
export type HTMLCollectionOf<T extends Element> = globalThis.HTMLCollectionOf<T>;
|
|
24
|
+
export type Node = globalThis.Node;
|
|
25
|
+
export type ChildNode = globalThis.ChildNode;
|
|
26
|
+
export type ParentNode = globalThis.ParentNode;
|
|
27
|
+
export type Text = globalThis.Text;
|
|
28
|
+
export type Element = globalThis.Element;
|
|
29
|
+
export type CSSStyleDeclaration = globalThis.CSSStyleDeclaration;
|
|
30
|
+
export type HTMLElement = globalThis.HTMLElement;
|
|
31
|
+
export type HTMLInputElement = globalThis.HTMLInputElement;
|
|
32
|
+
export type HTMLTextAreaElement = globalThis.HTMLTextAreaElement;
|
|
33
|
+
export type HTMLButtonElement = globalThis.HTMLButtonElement;
|
|
34
|
+
export type HTMLSelectElement = globalThis.HTMLSelectElement;
|
|
35
|
+
export type HTMLOptionElement = globalThis.HTMLOptionElement;
|
|
36
|
+
export type HTMLLabelElement = globalThis.HTMLLabelElement;
|
|
37
|
+
export type HTMLAnchorElement = globalThis.HTMLAnchorElement;
|
|
38
|
+
export type HTMLFormElement = globalThis.HTMLFormElement;
|
|
39
|
+
export type HTMLIFrameElement = globalThis.HTMLIFrameElement;
|
|
40
|
+
export type HTMLFieldSetElement = globalThis.HTMLFieldSetElement;
|
|
41
|
+
export type HTMLElementTagNameMap = globalThis.HTMLElementTagNameMap;
|
|
42
|
+
export type ShadowRoot = globalThis.ShadowRoot;
|
|
43
|
+
export type Range = globalThis.Range;
|
|
44
|
+
export type Selection = globalThis.Selection;
|
|
45
|
+
export type Document = globalThis.Document;
|
|
46
|
+
export type Blob = globalThis.Blob;
|
|
47
|
+
export type File = globalThis.File;
|
|
48
|
+
export type FileList = globalThis.FileList;
|
|
49
|
+
export type DataTransferItem = globalThis.DataTransferItem;
|
|
50
|
+
export type DataTransferItemList = globalThis.DataTransferItemList;
|
|
51
|
+
export type DataTransfer = globalThis.DataTransfer;
|
|
52
|
+
export type ClipboardItem = globalThis.ClipboardItem;
|
|
53
|
+
export type Clipboard = globalThis.Clipboard;
|
|
54
|
+
export type FileReader = globalThis.FileReader;
|
|
55
|
+
export type Navigator = globalThis.Navigator;
|
|
56
|
+
export type Window = globalThis.Window;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocumentEventMap, Element } from '../../dom-types.js';
|
|
2
|
+
import { type Instance } from '../../setup/index.js';
|
|
3
|
+
import { type EventType } from '../types.js';
|
|
4
|
+
export interface BehaviorPlugin<Type extends EventType> {
|
|
5
|
+
(event: DocumentEventMap[Type], target: Element, instance: Instance): void | (() => void);
|
|
6
|
+
}
|
|
7
|
+
export declare const behavior: {
|
|
8
|
+
[Type in EventType]?: BehaviorPlugin<Type>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Element } from '../dom-types.js';
|
|
2
|
+
import { type EventType, type EventTypeInit, type FixedDocumentEventMap } from './types.js';
|
|
3
|
+
/** Supplies the UIEvent modifier members (System.assignUIEventModifiers). */
|
|
4
|
+
interface ModifierSource {
|
|
5
|
+
assignUIEventModifiers(init: Record<string, unknown>): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createEvent<K extends EventType>(type: K, target: Element, init?: EventTypeInit<K>, modifiers?: ModifierSource): FixedDocumentEventMap[K];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Element, Event } from '../dom-types.js';
|
|
2
|
+
import { type Instance } from '../setup/index.js';
|
|
3
|
+
import { type EventType, type EventTypeInit } from './types.js';
|
|
4
|
+
export declare function dispatchUIEvent<K extends EventType>(this: Instance, target: Element, type: K, init?: EventTypeInit<K>, preventDefault?: boolean): boolean;
|
|
5
|
+
export declare function dispatchEvent(this: Instance, target: Element, event: Event, preventDefault?: boolean): boolean;
|
|
6
|
+
export declare function dispatchDOMEvent<K extends EventType>(target: Element, type: K, init?: EventTypeInit<K>): void;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { type EventType } from './types.js';
|
|
2
|
+
export declare const eventMap: {
|
|
3
|
+
readonly auxclick: {
|
|
4
|
+
readonly EventType: 'PointerEvent';
|
|
5
|
+
readonly defaultInit: {
|
|
6
|
+
readonly bubbles: true;
|
|
7
|
+
readonly cancelable: true;
|
|
8
|
+
readonly composed: true;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
readonly beforeinput: {
|
|
12
|
+
readonly EventType: 'InputEvent';
|
|
13
|
+
readonly defaultInit: {
|
|
14
|
+
readonly bubbles: true;
|
|
15
|
+
readonly cancelable: true;
|
|
16
|
+
readonly composed: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly blur: {
|
|
20
|
+
readonly EventType: 'FocusEvent';
|
|
21
|
+
readonly defaultInit: {
|
|
22
|
+
readonly bubbles: false;
|
|
23
|
+
readonly cancelable: false;
|
|
24
|
+
readonly composed: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
readonly click: {
|
|
28
|
+
readonly EventType: 'PointerEvent';
|
|
29
|
+
readonly defaultInit: {
|
|
30
|
+
readonly bubbles: true;
|
|
31
|
+
readonly cancelable: true;
|
|
32
|
+
readonly composed: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly contextmenu: {
|
|
36
|
+
readonly EventType: 'PointerEvent';
|
|
37
|
+
readonly defaultInit: {
|
|
38
|
+
readonly bubbles: true;
|
|
39
|
+
readonly cancelable: true;
|
|
40
|
+
readonly composed: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly copy: {
|
|
44
|
+
readonly EventType: 'ClipboardEvent';
|
|
45
|
+
readonly defaultInit: {
|
|
46
|
+
readonly bubbles: true;
|
|
47
|
+
readonly cancelable: true;
|
|
48
|
+
readonly composed: true;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly change: {
|
|
52
|
+
readonly EventType: 'Event';
|
|
53
|
+
readonly defaultInit: {
|
|
54
|
+
readonly bubbles: true;
|
|
55
|
+
readonly cancelable: false;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly cut: {
|
|
59
|
+
readonly EventType: 'ClipboardEvent';
|
|
60
|
+
readonly defaultInit: {
|
|
61
|
+
readonly bubbles: true;
|
|
62
|
+
readonly cancelable: true;
|
|
63
|
+
readonly composed: true;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly dblclick: {
|
|
67
|
+
readonly EventType: 'MouseEvent';
|
|
68
|
+
readonly defaultInit: {
|
|
69
|
+
readonly bubbles: true;
|
|
70
|
+
readonly cancelable: true;
|
|
71
|
+
readonly composed: true;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly focus: {
|
|
75
|
+
readonly EventType: 'FocusEvent';
|
|
76
|
+
readonly defaultInit: {
|
|
77
|
+
readonly bubbles: false;
|
|
78
|
+
readonly cancelable: false;
|
|
79
|
+
readonly composed: true;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly focusin: {
|
|
83
|
+
readonly EventType: 'FocusEvent';
|
|
84
|
+
readonly defaultInit: {
|
|
85
|
+
readonly bubbles: true;
|
|
86
|
+
readonly cancelable: false;
|
|
87
|
+
readonly composed: true;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly focusout: {
|
|
91
|
+
readonly EventType: 'FocusEvent';
|
|
92
|
+
readonly defaultInit: {
|
|
93
|
+
readonly bubbles: true;
|
|
94
|
+
readonly cancelable: false;
|
|
95
|
+
readonly composed: true;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
readonly keydown: {
|
|
99
|
+
readonly EventType: 'KeyboardEvent';
|
|
100
|
+
readonly defaultInit: {
|
|
101
|
+
readonly bubbles: true;
|
|
102
|
+
readonly cancelable: true;
|
|
103
|
+
readonly composed: true;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
readonly keypress: {
|
|
107
|
+
readonly EventType: 'KeyboardEvent';
|
|
108
|
+
readonly defaultInit: {
|
|
109
|
+
readonly bubbles: true;
|
|
110
|
+
readonly cancelable: true;
|
|
111
|
+
readonly composed: true;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
readonly keyup: {
|
|
115
|
+
readonly EventType: 'KeyboardEvent';
|
|
116
|
+
readonly defaultInit: {
|
|
117
|
+
readonly bubbles: true;
|
|
118
|
+
readonly cancelable: true;
|
|
119
|
+
readonly composed: true;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
readonly paste: {
|
|
123
|
+
readonly EventType: 'ClipboardEvent';
|
|
124
|
+
readonly defaultInit: {
|
|
125
|
+
readonly bubbles: true;
|
|
126
|
+
readonly cancelable: true;
|
|
127
|
+
readonly composed: true;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
readonly input: {
|
|
131
|
+
readonly EventType: 'InputEvent';
|
|
132
|
+
readonly defaultInit: {
|
|
133
|
+
readonly bubbles: true;
|
|
134
|
+
readonly cancelable: false;
|
|
135
|
+
readonly composed: true;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
readonly mousedown: {
|
|
139
|
+
readonly EventType: 'MouseEvent';
|
|
140
|
+
readonly defaultInit: {
|
|
141
|
+
readonly bubbles: true;
|
|
142
|
+
readonly cancelable: true;
|
|
143
|
+
readonly composed: true;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly mouseenter: {
|
|
147
|
+
readonly EventType: 'MouseEvent';
|
|
148
|
+
readonly defaultInit: {
|
|
149
|
+
readonly bubbles: false;
|
|
150
|
+
readonly cancelable: false;
|
|
151
|
+
readonly composed: true;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly mouseleave: {
|
|
155
|
+
readonly EventType: 'MouseEvent';
|
|
156
|
+
readonly defaultInit: {
|
|
157
|
+
readonly bubbles: false;
|
|
158
|
+
readonly cancelable: false;
|
|
159
|
+
readonly composed: true;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readonly mousemove: {
|
|
163
|
+
readonly EventType: 'MouseEvent';
|
|
164
|
+
readonly defaultInit: {
|
|
165
|
+
readonly bubbles: true;
|
|
166
|
+
readonly cancelable: true;
|
|
167
|
+
readonly composed: true;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
readonly mouseout: {
|
|
171
|
+
readonly EventType: 'MouseEvent';
|
|
172
|
+
readonly defaultInit: {
|
|
173
|
+
readonly bubbles: true;
|
|
174
|
+
readonly cancelable: true;
|
|
175
|
+
readonly composed: true;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
readonly mouseover: {
|
|
179
|
+
readonly EventType: 'MouseEvent';
|
|
180
|
+
readonly defaultInit: {
|
|
181
|
+
readonly bubbles: true;
|
|
182
|
+
readonly cancelable: true;
|
|
183
|
+
readonly composed: true;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
readonly mouseup: {
|
|
187
|
+
readonly EventType: 'MouseEvent';
|
|
188
|
+
readonly defaultInit: {
|
|
189
|
+
readonly bubbles: true;
|
|
190
|
+
readonly cancelable: true;
|
|
191
|
+
readonly composed: true;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
readonly pointerover: {
|
|
195
|
+
readonly EventType: 'PointerEvent';
|
|
196
|
+
readonly defaultInit: {
|
|
197
|
+
readonly bubbles: true;
|
|
198
|
+
readonly cancelable: true;
|
|
199
|
+
readonly composed: true;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
readonly pointerenter: {
|
|
203
|
+
readonly EventType: 'PointerEvent';
|
|
204
|
+
readonly defaultInit: {
|
|
205
|
+
readonly bubbles: false;
|
|
206
|
+
readonly cancelable: false;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
readonly pointerdown: {
|
|
210
|
+
readonly EventType: 'PointerEvent';
|
|
211
|
+
readonly defaultInit: {
|
|
212
|
+
readonly bubbles: true;
|
|
213
|
+
readonly cancelable: true;
|
|
214
|
+
readonly composed: true;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
readonly pointermove: {
|
|
218
|
+
readonly EventType: 'PointerEvent';
|
|
219
|
+
readonly defaultInit: {
|
|
220
|
+
readonly bubbles: true;
|
|
221
|
+
readonly cancelable: true;
|
|
222
|
+
readonly composed: true;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
readonly pointerup: {
|
|
226
|
+
readonly EventType: 'PointerEvent';
|
|
227
|
+
readonly defaultInit: {
|
|
228
|
+
readonly bubbles: true;
|
|
229
|
+
readonly cancelable: true;
|
|
230
|
+
readonly composed: true;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
readonly pointercancel: {
|
|
234
|
+
readonly EventType: 'PointerEvent';
|
|
235
|
+
readonly defaultInit: {
|
|
236
|
+
readonly bubbles: true;
|
|
237
|
+
readonly cancelable: false;
|
|
238
|
+
readonly composed: true;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
readonly pointerout: {
|
|
242
|
+
readonly EventType: 'PointerEvent';
|
|
243
|
+
readonly defaultInit: {
|
|
244
|
+
readonly bubbles: true;
|
|
245
|
+
readonly cancelable: true;
|
|
246
|
+
readonly composed: true;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
readonly pointerleave: {
|
|
250
|
+
readonly EventType: 'PointerEvent';
|
|
251
|
+
readonly defaultInit: {
|
|
252
|
+
readonly bubbles: false;
|
|
253
|
+
readonly cancelable: false;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
readonly submit: {
|
|
257
|
+
readonly EventType: 'Event';
|
|
258
|
+
readonly defaultInit: {
|
|
259
|
+
readonly bubbles: true;
|
|
260
|
+
readonly cancelable: true;
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
export declare function isMouseEvent(type: EventType): boolean;
|
|
265
|
+
export declare function isKeyboardEvent(type: EventType): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type EventType, type PointerCoords } from './types.js';
|
|
2
|
+
export type { EventType, PointerCoords };
|
|
3
|
+
export { dispatchEvent, dispatchUIEvent, dispatchDOMEvent, } from './dispatchEvent.js';
|
|
4
|
+
export { blurElement, focusElement } from './focus.js';
|
|
5
|
+
export { input } from './input.js';
|
|
6
|
+
export type { SelectionRange } from './selection/index.js';
|
|
7
|
+
export { isAllSelected, modifySelectionPerMouseMove, setSelectionPerMouseDown, selectAll, } from './selection/index.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Node, Range } from '../../dom-types.js';
|
|
2
|
+
import { type UISelectionRange } from '../../document/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get the range that would be overwritten by input.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getInputRange(focusNode: Node): UISelectionRange | Range | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Node } from '../../dom-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Determine which selection logic and selection ranges to consider.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getTargetTypeAndSelection(node: Node): {
|
|
6
|
+
readonly type: 'input';
|
|
7
|
+
readonly selection: import("../../document/UI.js").UISelectionRange;
|
|
8
|
+
} | {
|
|
9
|
+
readonly type: "contenteditable" | "default";
|
|
10
|
+
readonly selection: import("../../dom-types.js").Selection | null | undefined;
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type EditableInputOrTextarea } from '../../utils/index.js';
|
|
2
|
+
export { getInputRange } from './getInputRange.js';
|
|
3
|
+
export { modifySelection } from './modifySelection.js';
|
|
4
|
+
export { moveSelection } from './moveSelection.js';
|
|
5
|
+
export { setSelectionPerMouseDown } from './setSelectionPerMouse.js';
|
|
6
|
+
export { modifySelectionPerMouseMove } from './modifySelectionPerMouse.js';
|
|
7
|
+
export { isAllSelected, selectAll } from './selectAll.js';
|
|
8
|
+
export { setSelectionRange } from './setSelectionRange.js';
|
|
9
|
+
export { setSelection } from './setSelection.js';
|
|
10
|
+
export { updateSelectionOnFocus } from './updateSelectionOnFocus.js';
|
|
11
|
+
export type SelectionRange = {
|
|
12
|
+
node: EditableInputOrTextarea;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node } from '../../dom-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extend/shrink the selection like with Shift+Arrows or Shift+Mouse
|
|
4
|
+
*/
|
|
5
|
+
export declare function modifySelection({ focusNode, focusOffset, }: {
|
|
6
|
+
focusNode: Node;
|
|
7
|
+
/** DOM Offset */
|
|
8
|
+
focusOffset: number;
|
|
9
|
+
}): void;
|