WordPress/wp-includes/js/dist/dom.min.js
youknowriad ebca9841e8 Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.
This brings the JS packages up to date and is the first step that will allow us 
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.

Built from https://develop.svn.wordpress.org/trunk@52042


git-svn-id: http://core.svn.wordpress.org/trunk@51634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:29:21 +00:00

2 lines
13 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.dom=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="2sUP")}({"2sUP":function(t,e,n){"use strict";n.r(e),n.d(e,"focus",(function(){return rt})),n.d(e,"computeCaretRect",(function(){return N})),n.d(e,"documentHasTextSelection",(function(){return E})),n.d(e,"documentHasUncollapsedSelection",(function(){return T})),n.d(e,"documentHasSelection",(function(){return O})),n.d(e,"getRectangleFromRange",(function(){return y})),n.d(e,"getScrollContainer",(function(){return x})),n.d(e,"getOffsetParent",(function(){return A})),n.d(e,"isEntirelySelected",(function(){return P})),n.d(e,"isHorizontalEdge",(function(){return H})),n.d(e,"isNumberInput",(function(){return v})),n.d(e,"isTextField",(function(){return w})),n.d(e,"isVerticalEdge",(function(){return I})),n.d(e,"placeCaretAtHorizontalEdge",(function(){return F})),n.d(e,"placeCaretAtVerticalEdge",(function(){return B})),n.d(e,"replace",(function(){return q})),n.d(e,"remove",(function(){return z})),n.d(e,"insertAfter",(function(){return U})),n.d(e,"unwrap",(function(){return k})),n.d(e,"replaceTag",(function(){return X})),n.d(e,"wrap",(function(){return Y})),n.d(e,"__unstableStripHTML",(function(){return G})),n.d(e,"isEmpty",(function(){return $})),n.d(e,"removeInvalidHTML",(function(){return et})),n.d(e,"isRTL",(function(){return M})),n.d(e,"safeHTML",(function(){return W})),n.d(e,"getPhrasingContentSchema",(function(){return Q})),n.d(e,"isPhrasingContent",(function(){return Z})),n.d(e,"isTextContent",(function(){return tt})),n.d(e,"getFilesFromDataTransfer",(function(){return nt}));var r={};n.r(r),n.d(r,"find",(function(){return u}));var o={};function i(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function u(t,{sequential:e=!1}={}){const n=t.querySelectorAll(function(t){return[t?'[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(",")}(e));return Array.from(n).filter(t=>{if(!i(t))return!1;const{nodeName:e}=t;return"AREA"!==e||function(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&i(n)}(t)})}n.r(o),n.d(o,"isTabbableIndex",(function(){return s})),n.d(o,"find",(function(){return p})),n.d(o,"findPrevious",(function(){return h})),n.d(o,"findNext",(function(){return b}));var c=n("YLtl");function a(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function s(t){return-1!==a(t)}function l(t,e){return{element:t,index:e}}function d(t){return t.element}function f(t,e){const n=a(t.element),r=a(e.element);return n===r?t.index-e.index:n-r}function m(t){return t.filter(s).map(l).sort(f).map(d).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:u}=n;if("INPUT"!==r||"radio"!==o||!u)return e.concat(n);const a=t.hasOwnProperty(u);if(!(i||!a))return e;if(a){const n=t[u];e=Object(c.without)(e,n)}return t[u]=n,e.concat(n)}}(),[])}function p(t){return m(u(t))}function h(t){const e=u(t.ownerDocument.body),n=e.indexOf(t);return e.length=n,Object(c.last)(m(e))}function b(t){const e=u(t.ownerDocument.body),n=e.indexOf(t),r=e.slice(n+1);return Object(c.first)(m(r))}function g(t,e){0}function y(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter(({width:t})=>t>1);if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:u}=n[0];for(const{top:t,bottom:e,left:c,right:a}of n)t<r&&(r=t),e>o&&(o=e),c<i&&(i=c),a>u&&(u=a);return new window.DOMRect(i,r,u-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;g();const o=Array.from(r.childNodes).indexOf(e);g(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}let r=t.getClientRects()[0];if(!r){g();const e=n.createTextNode("");(t=t.cloneRange()).insertNode(e),r=t.getClientRects()[0],g(e.parentNode),e.parentNode.removeChild(e)}return r}function N(t){const e=t.getSelection();g();const n=e.rangeCount?e.getRangeAt(0):null;return n?y(n):null}function E(t){g(t.defaultView);const e=t.defaultView.getSelection();g();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function C(t){return!!t&&"INPUT"===t.nodeName}function w(t){return C(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function v(t){return C(t)&&"number"===t.type&&!!t.valueAsNumber}function T(t){return E(t)||!!t.activeElement&&function(t){if(!w(t)&&!v(t))return!1;try{const{selectionStart:e,selectionEnd:n}=t;return null!==e&&e!==n}catch(t){return!1}}(t.activeElement)}function O(t){return!!t.activeElement&&(w(t.activeElement)||v(t.activeElement)||E(t))}function S(t){return g(t.ownerDocument.defaultView),t.ownerDocument.defaultView.getComputedStyle(t)}function x(t){if(t){if(t.scrollHeight>t.clientHeight){const{overflowY:e}=S(t);if(/(auto|scroll)/.test(e))return t}return x(t.parentNode)}}function A(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?"static"!==S(e).position?e:e.offsetParent:null}function R(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName}function P(t){if(R(t))return 0===t.selectionStart&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;const{ownerDocument:e}=t,{defaultView:n}=e;g();const r=n.getSelection();g();const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:u,startOffset:c,endOffset:a}=o;if(i===t&&u===t&&0===c&&a===t.childNodes.length)return!0;t.lastChild;g();const s=u.nodeType===u.TEXT_NODE?u.data.length:u.childNodes.length;return L(i,t,"firstChild")&&L(u,t,"lastChild")&&0===c&&a===s}function L(t,e,n){let r=e;do{if(t===r)return!0;r=r[n]}while(r);return!1}function M(t){return"rtl"===S(t).direction}function D(t,e,n,r){const o=r.style.zIndex,i=r.style.position,{position:u="static"}=S(r);"static"===u&&(r.style.position="relative"),r.style.zIndex="10000";const c=function(t,e,n){if(t.caretRangeFromPoint)return t.caretRangeFromPoint(e,n);if(!t.caretPositionFromPoint)return null;const r=t.caretPositionFromPoint(e,n);if(!r)return null;const o=t.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}(t,e,n);return r.style.zIndex=o,r.style.position=i,c}function j(t,e,n=!1){if(R(t)&&"number"==typeof t.selectionStart)return t.selectionStart===t.selectionEnd&&(e?0===t.selectionStart:t.value.length===t.selectionStart);if(!t.isContentEditable)return!0;const{ownerDocument:r}=t,{defaultView:o}=r;g();const i=o.getSelection();if(!i||!i.rangeCount)return!1;const u=i.getRangeAt(0),c=u.cloneRange(),a=function(t){const{anchorNode:e,focusNode:n,anchorOffset:r,focusOffset:o}=t;g(),g();const i=e.compareDocumentPosition(n);return!(i&e.DOCUMENT_POSITION_PRECEDING)&&(!!(i&e.DOCUMENT_POSITION_FOLLOWING)||(0!==i||r<=o))}(i),s=i.isCollapsed;s||c.collapse(!a);const l=y(c),d=y(u);if(!l||!d)return!1;const f=function(t){const e=Array.from(t.getClientRects());if(!e.length)return;const n=Math.min(...e.map(({top:t})=>t));return Math.max(...e.map(({bottom:t})=>t))-n}(u);if(!s&&f&&f>l.height&&a===e)return!1;const m=M(t)?!e:e,p=t.getBoundingClientRect(),h=D(r,m?p.left+1:p.right-1,e?p.top+1:p.bottom-1,t);if(!h)return!1;const b=y(h);if(!b)return!1;const N=e?"top":"bottom",E=m?"left":"right",C=b[N]-d[N],w=b[E]-l[E],v=Math.abs(C)<=1,T=Math.abs(w)<=1;return n?v:v&&T}function H(t,e){return j(t,e)}function I(t,e){return j(t,e,!0)}function _(t,e,n){const{ownerDocument:r}=t,o=M(t)?!e:e,i=t.getBoundingClientRect();void 0===n&&(n=e?i.right-1:i.left+1);return D(r,n,o?i.bottom-1:i.top+1,t)}function V(t,e,n){if(!t)return;if(t.focus(),R(t)){if("number"!=typeof t.selectionStart)return;return void(e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0))}if(!t.isContentEditable)return;let r=_(t,e,n);if(!(r&&r.startContainer&&t.contains(r.startContainer)||(t.scrollIntoView(e),r=r=_(t,e,n),r&&r.startContainer&&t.contains(r.startContainer))))return;const{ownerDocument:o}=t,{defaultView:i}=o;g();const u=i.getSelection();g(),u.removeAllRanges(),u.addRange(r)}function F(t,e){return V(t,e,void 0)}function B(t,e,n){return V(t,e,null==n?void 0:n.left)}function U(t,e){g(e.parentNode),e.parentNode.insertBefore(t,e.nextSibling)}function z(t){g(t.parentNode),t.parentNode.removeChild(t)}function q(t,e){g(t.parentNode),U(e,t.parentNode),z(t)}function k(t){const e=t.parentNode;for(g();t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function X(t,e){const n=t.ownerDocument.createElement(e);for(;t.firstChild;)n.appendChild(t.firstChild);return g(t.parentNode),t.parentNode.replaceChild(n,t),n}function Y(t,e){g(e.parentNode),e.parentNode.insertBefore(t,e),t.appendChild(e)}function W(t){const{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;const n=e.getElementsByTagName("*");let r=n.length;for(;r--;){const t=n[r];if("SCRIPT"===t.tagName)z(t);else{let e=t.attributes.length;for(;e--;){const{name:n}=t.attributes[e];n.startsWith("on")&&t.removeAttribute(n)}}}return e.innerHTML}function G(t){t=W(t);const e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function $(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return!t.hasAttributes()&&(!t.hasChildNodes()||Array.from(t.childNodes).every($));default:return!0}}const J={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}};Object(c.without)(Object.keys(J),"#text","br").forEach(t=>{J[t].children=Object(c.omit)(J,t)});const K={...J,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","autoplay","mediagroup","loop","muted","controls","width","height"]}};function Q(t){return"paste"!==t?K:Object(c.omit)({...K,ins:{children:K.ins.children},del:{children:K.del.children}},["u","abbr","data","time","wbr","bdi","bdo"])}function Z(t){const e=t.nodeName.toLowerCase();return Q().hasOwnProperty(e)||"span"===e}function tt(t){const e=t.nodeName.toLowerCase();return J.hasOwnProperty(e)||"span"===e}function et(t,e,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,function t(e,n,r,o){Array.from(e).forEach(e=>{var i,u;const a=e.nodeName.toLowerCase();if(r.hasOwnProperty(a)&&(!r[a].isMatch||null!==(i=(u=r[a]).isMatch)&&void 0!==i&&i.call(u,e))){if(function(t){return!!t&&t.nodeType===t.ELEMENT_NODE}(e)){const{attributes:i=[],classes:u=[],children:s,require:l=[],allowEmpty:d}=r[a];if(s&&!d&&$(e))return void z(e);if(e.hasAttributes()&&(Array.from(e.attributes).forEach(({name:t})=>{"class"===t||Object(c.includes)(i,t)||e.removeAttribute(t)}),e.classList&&e.classList.length)){const t=u.map(t=>"string"==typeof t?e=>e===t:t instanceof RegExp?e=>t.test(e):c.noop);Array.from(e.classList).forEach(n=>{t.some(t=>t(n))||e.classList.remove(n)}),e.classList.length||e.removeAttribute("class")}if(e.hasChildNodes()){if("*"===s)return;if(s)l.length&&!e.querySelector(l.join(","))?(t(e.childNodes,n,r,o),k(e)):e.parentNode&&"BODY"===e.parentNode.nodeName&&Z(e)?(t(e.childNodes,n,r,o),Array.from(e.childNodes).some(t=>!Z(t))&&k(e)):t(e.childNodes,n,s,o);else for(;e.firstChild;)z(e.firstChild)}}}else t(e.childNodes,n,r,o),o&&!Z(e)&&e.nextElementSibling&&U(n.createElement("br"),e),k(e)})}(r.body.childNodes,r,e,n),r.body.innerHTML}function nt(t){const e=Array.from(t.files);return Array.from(t.items).forEach(t=>{const n=t.getAsFile();n&&!e.find(({name:t,type:e,size:r})=>t===n.name&&e===n.type&&r===n.size)&&e.push(n)}),e}const rt={focusable:r,tabbable:o}},YLtl:function(t,e){t.exports=window.lodash}});