diff -r 48c4eec2b7e6 -r 8c2e4d02f4ef wp/wp-includes/js/dist/dom.js --- a/wp/wp-includes/js/dist/dom.js Fri Sep 05 18:40:08 2025 +0200 +++ b/wp/wp-includes/js/dist/dom.js Fri Sep 05 18:52:52 2025 +0200 @@ -70,6 +70,7 @@ isNumberInput: () => (/* reexport */ isNumberInput), isPhrasingContent: () => (/* reexport */ isPhrasingContent), isRTL: () => (/* reexport */ isRTL), + isSelectionForward: () => (/* reexport */ isSelectionForward), isTextContent: () => (/* reexport */ isTextContent), isTextField: () => (/* reexport */ isTextField), isVerticalEdge: () => (/* reexport */ isVerticalEdge), @@ -101,7 +102,7 @@ isTabbableIndex: () => (isTabbableIndex) }); -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/focusable.js +;// ./node_modules/@wordpress/dom/build-module/focusable.js /** * References: * @@ -133,7 +134,7 @@ * @return {string} CSS selector. */ function buildSelector(sequential) { - return [sequential ? '[tabindex]:not([tabindex^="-"])' : '[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe:not([tabindex^="-"])', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(','); + return [sequential ? '[tabindex]:not([tabindex^="-"])' : '[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe:not([tabindex^="-"])', 'object', 'embed', 'summary', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(','); } /** @@ -196,13 +197,13 @@ nodeName } = element; if ('AREA' === nodeName) { - return isValidFocusableArea( /** @type {HTMLAreaElement} */element); + return isValidFocusableArea(/** @type {HTMLAreaElement} */element); } return true; }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/tabbable.js +;// ./node_modules/@wordpress/dom/build-module/tabbable.js /** * Internal dependencies */ @@ -249,7 +250,7 @@ function createStatefulCollapseRadioGroup() { /** @type {Record} */ const CHOSEN_RADIO_BY_NAME = {}; - return function collapseRadioGroup( /** @type {MaybeHTMLInputElement[]} */result, /** @type {MaybeHTMLInputElement} */element) { + return function collapseRadioGroup(/** @type {MaybeHTMLInputElement[]} */result, /** @type {MaybeHTMLInputElement} */element) { const { nodeName, type, @@ -377,12 +378,12 @@ element.compareDocumentPosition(focusable) & element.DOCUMENT_POSITION_FOLLOWING); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/utils/assert-is-defined.js +;// ./node_modules/@wordpress/dom/build-module/utils/assert-is-defined.js function assertIsDefined(val, name) { if (false) {} } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-rectangle-from-range.js +;// ./node_modules/@wordpress/dom/build-module/dom/get-rectangle-from-range.js /** * Internal dependencies */ @@ -493,7 +494,7 @@ return rect; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/compute-caret-rect.js +;// ./node_modules/@wordpress/dom/build-module/dom/compute-caret-rect.js /** * Internal dependencies */ @@ -517,7 +518,7 @@ return getRectangleFromRange(range); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/document-has-text-selection.js +;// ./node_modules/@wordpress/dom/build-module/dom/document-has-text-selection.js /** * Internal dependencies */ @@ -542,7 +543,7 @@ return !!range && !range.collapsed; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-html-input-element.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-html-input-element.js /* eslint-disable jsdoc/valid-types */ /** * @param {Node} node @@ -553,7 +554,7 @@ return node?.nodeName === 'INPUT'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-text-field.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-text-field.js /** * Internal dependencies */ @@ -575,7 +576,7 @@ return isHTMLInputElement(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' || /** @type {HTMLElement} */node.contentEditable === 'true'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/input-field-has-uncollapsed-selection.js +;// ./node_modules/@wordpress/dom/build-module/dom/input-field-has-uncollapsed-selection.js /** * Internal dependencies */ @@ -627,7 +628,7 @@ } } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/document-has-uncollapsed-selection.js +;// ./node_modules/@wordpress/dom/build-module/dom/document-has-uncollapsed-selection.js /** * Internal dependencies */ @@ -647,7 +648,7 @@ return documentHasTextSelection(doc) || !!doc.activeElement && inputFieldHasUncollapsedSelection(doc.activeElement); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/document-has-selection.js +;// ./node_modules/@wordpress/dom/build-module/dom/document-has-selection.js /** * Internal dependencies */ @@ -667,7 +668,7 @@ return !!doc.activeElement && (isHTMLInputElement(doc.activeElement) || isTextField(doc.activeElement) || documentHasTextSelection(doc)); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-computed-style.js +;// ./node_modules/@wordpress/dom/build-module/dom/get-computed-style.js /** * Internal dependencies */ @@ -684,7 +685,7 @@ return element.ownerDocument.defaultView.getComputedStyle(element); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-scroll-container.js +;// ./node_modules/@wordpress/dom/build-module/dom/get-scroll-container.js /** * Internal dependencies */ @@ -732,10 +733,10 @@ } // Continue traversing. - return getScrollContainer( /** @type {Element} */node.parentNode, direction); + return getScrollContainer(/** @type {Element} */node.parentNode, direction); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-offset-parent.js +;// ./node_modules/@wordpress/dom/build-module/dom/get-offset-parent.js /** * Internal dependencies */ @@ -767,7 +768,7 @@ // If the closest element is already positioned, return it, as offsetParent // does not otherwise consider the node itself. - if (getComputedStyle( /** @type {Element} */closestElement).position !== 'static') { + if (getComputedStyle(/** @type {Element} */closestElement).position !== 'static') { return closestElement; } @@ -775,7 +776,7 @@ return /** @type {Node & { offsetParent: Node }} */closestElement.offsetParent; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-input-or-text-area.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-input-or-text-area.js /* eslint-disable jsdoc/valid-types */ /** * @param {Element} element @@ -786,7 +787,7 @@ return element.tagName === 'INPUT' || element.tagName === 'TEXTAREA'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-entirely-selected.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-entirely-selected.js /** * Internal dependencies */ @@ -858,7 +859,7 @@ return false; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-form-element.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-form-element.js /** * Internal dependencies */ @@ -883,7 +884,7 @@ return checkForInputTextarea || tagName === 'BUTTON' || tagName === 'SELECT'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-rtl.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-rtl.js /** * Internal dependencies */ @@ -900,7 +901,7 @@ return getComputedStyle(element).direction === 'rtl'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/get-range-height.js +;// ./node_modules/@wordpress/dom/build-module/dom/get-range-height.js /** * Gets the height of the range without ignoring zero width rectangles, which * some browsers ignore when creating a union. @@ -922,7 +923,7 @@ return lowestBottom - highestTop; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-selection-forward.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-selection-forward.js /** * Internal dependencies */ @@ -972,7 +973,7 @@ return true; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/caret-range-from-point.js +;// ./node_modules/@wordpress/dom/build-module/dom/caret-range-from-point.js /** * Polyfill. * Get a collapsed range for a given point. @@ -1010,7 +1011,7 @@ * @typedef {{ readonly offset: number; readonly offsetNode: Node; getClientRect(): DOMRect | null; }} CaretPosition */ -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/hidden-caret-range-from-point.js +;// ./node_modules/@wordpress/dom/build-module/dom/hidden-caret-range-from-point.js /** * Internal dependencies */ @@ -1047,7 +1048,7 @@ return range; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/scroll-if-no-range.js +;// ./node_modules/@wordpress/dom/build-module/dom/scroll-if-no-range.js /** * If no range range can be created or it is outside the container, the element * may be out of view, so scroll it into view and try again. @@ -1073,7 +1074,7 @@ return range; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-edge.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-edge.js /** * Internal dependencies */ @@ -1179,7 +1180,7 @@ return onlyVertical ? hasVerticalDiff : hasVerticalDiff && hasHorizontalDiff; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-horizontal-edge.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-horizontal-edge.js /** * Internal dependencies */ @@ -1197,10 +1198,10 @@ return isEdge(container, isReverse); } -;// CONCATENATED MODULE: external ["wp","deprecated"] +;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-number-input.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-number-input.js /** * WordPress dependencies */ @@ -1228,7 +1229,7 @@ return isHTMLInputElement(node) && node.type === 'number' && !isNaN(node.valueAsNumber); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-vertical-edge.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-vertical-edge.js /** * Internal dependencies */ @@ -1246,7 +1247,7 @@ return isEdge(container, isReverse, true); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-edge.js +;// ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-edge.js /** * Internal dependencies */ @@ -1333,7 +1334,7 @@ selection.addRange(range); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-horizontal-edge.js +;// ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-horizontal-edge.js /** * Internal dependencies */ @@ -1349,7 +1350,7 @@ return placeCaretAtEdge(container, isReverse, undefined); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-vertical-edge.js +;// ./node_modules/@wordpress/dom/build-module/dom/place-caret-at-vertical-edge.js /** * Internal dependencies */ @@ -1366,7 +1367,7 @@ return placeCaretAtEdge(container, isReverse, rect?.left); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/insert-after.js +;// ./node_modules/@wordpress/dom/build-module/dom/insert-after.js /** * Internal dependencies */ @@ -1385,7 +1386,7 @@ referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/remove.js +;// ./node_modules/@wordpress/dom/build-module/dom/remove.js /** * Internal dependencies */ @@ -1402,7 +1403,7 @@ node.parentNode.removeChild(node); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/replace.js +;// ./node_modules/@wordpress/dom/build-module/dom/replace.js /** * Internal dependencies */ @@ -1423,7 +1424,7 @@ remove(processedNode); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/unwrap.js +;// ./node_modules/@wordpress/dom/build-module/dom/unwrap.js /** * Internal dependencies */ @@ -1445,7 +1446,7 @@ parent.removeChild(node); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/replace-tag.js +;// ./node_modules/@wordpress/dom/build-module/dom/replace-tag.js /** * Internal dependencies */ @@ -1469,7 +1470,7 @@ return newNode; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/wrap.js +;// ./node_modules/@wordpress/dom/build-module/dom/wrap.js /** * Internal dependencies */ @@ -1487,7 +1488,7 @@ newNode.appendChild(referenceNode); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/safe-html.js +;// ./node_modules/@wordpress/dom/build-module/dom/safe-html.js /** * Internal dependencies */ @@ -1526,7 +1527,7 @@ return body.innerHTML; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/strip-html.js +;// ./node_modules/@wordpress/dom/build-module/dom/strip-html.js /** * Internal dependencies */ @@ -1548,7 +1549,7 @@ return doc.body.textContent || ''; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-empty.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-empty.js /** * Recursively checks if an element is empty. An element is not empty if it * contains text or contains elements with attributes such as images. @@ -1575,7 +1576,7 @@ } } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/phrasing-content.js +;// ./node_modules/@wordpress/dom/build-module/phrasing-content.js /** * All phrasing content elements. * @@ -1771,7 +1772,7 @@ return textContentSchema.hasOwnProperty(tag) || tag === 'span'; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/is-element.js +;// ./node_modules/@wordpress/dom/build-module/dom/is-element.js /* eslint-disable jsdoc/valid-types */ /** * @param {Node | null | undefined} node @@ -1782,7 +1783,7 @@ return !!node && node.nodeType === node.ELEMENT_NODE; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/clean-node-list.js +;// ./node_modules/@wordpress/dom/build-module/dom/clean-node-list.js /** * Internal dependencies */ @@ -1818,7 +1819,7 @@ * @param {boolean} inline Whether to clean for inline mode. */ function cleanNodeList(nodeList, doc, schema, inline) { - Array.from(nodeList).forEach(( /** @type {Node & { nextElementSibling?: unknown }} */node) => { + Array.from(nodeList).forEach((/** @type {Node & { nextElementSibling?: unknown }} */node) => { const tag = node.nodeName.toLowerCase(); // It's a valid child, if the tag exists in the schema without an isMatch @@ -1854,10 +1855,13 @@ // TODO: Explore patching this in jsdom-jscore. if (node.classList && node.classList.length) { const mattchers = classes.map(item => { - if (typeof item === 'string') { - return ( /** @type {string} */className) => className === item; + if (item === '*') { + // Keep all classes. + return () => true; + } else if (typeof item === 'string') { + return (/** @type {string} */className) => className === item; } else if (item instanceof RegExp) { - return ( /** @type {string} */className) => item.test(className); + return (/** @type {string} */className) => item.test(className); } return noop; }); @@ -1917,7 +1921,7 @@ }); } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/remove-invalid-html.js +;// ./node_modules/@wordpress/dom/build-module/dom/remove-invalid-html.js /** * Internal dependencies */ @@ -1939,7 +1943,7 @@ return doc.body.innerHTML; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/dom/index.js +;// ./node_modules/@wordpress/dom/build-module/dom/index.js @@ -1967,7 +1971,8 @@ -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/data-transfer.js + +;// ./node_modules/@wordpress/dom/build-module/data-transfer.js /** * Gets all files from a DataTransfer object. * @@ -1990,7 +1995,7 @@ return files; } -;// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/index.js +;// ./node_modules/@wordpress/dom/build-module/index.js /** * Internal dependencies */