mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-19 09:05:22 +01:00
a41c798835
In addition to all the packages being updated to the latest versions, this commit also includes some mandatory changes to avoid editor breakage: - Update React to to 18.2.0. - Add the right stylesheets to support iframed block editors. Props ntsekouras, mamaduka, flixos90, desrosj, peterwilsoncc. See #57471. Built from https://develop.svn.wordpress.org/trunk@55246 git-svn-id: http://core.svn.wordpress.org/trunk@54779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
/*! This file is auto-generated */
|
||
!function(){"use strict";var t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:function(){return Z},computeCaretRect:function(){return y},documentHasSelection:function(){return v},documentHasTextSelection:function(){return E},documentHasUncollapsedSelection:function(){return T},focus:function(){return ft},getFilesFromDataTransfer:function(){return lt},getOffsetParent:function(){return A},getPhrasingContentSchema:function(){return ot},getRectangleFromRange:function(){return N},getScrollContainer:function(){return S},insertAfter:function(){return W},isEmpty:function(){return tt},isEntirelySelected:function(){return D},isFormElement:function(){return L},isHorizontalEdge:function(){return F},isNumberInput:function(){return j},isPhrasingContent:function(){return it},isRTL:function(){return M},isTextContent:function(){return ut},isTextField:function(){return w},isVerticalEdge:function(){return U},placeCaretAtHorizontalEdge:function(){return k},placeCaretAtVerticalEdge:function(){return G},remove:function(){return X},removeInvalidHTML:function(){return st},replace:function(){return Y},replaceTag:function(){return J},safeHTML:function(){return Q},unwrap:function(){return $},wrap:function(){return K}});var n={};t.r(n),t.d(n,{find:function(){return c}});var r={};function o(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(",")}function i(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function u(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&i(n)}function c(t){let{sequential:e=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.querySelectorAll(o(e));return Array.from(n).filter((t=>{if(!i(t))return!1;const{nodeName:e}=t;return"AREA"!==e||u(t)}))}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 f(t){return t.element}function d(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(d).map(f).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 c=t.hasOwnProperty(u);if(!i&&c)return e;if(c){const n=t[u];e=e.filter((t=>t!==n))}return t[u]=n,e.concat(n)}}(),[])}function p(t){return m(c(t))}function h(t){return m(c(t.ownerDocument.body)).reverse().find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING))}function g(t){return m(c(t.ownerDocument.body)).find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING))}function b(t,e){0}function N(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((t=>{let{width:e}=t;return e>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;b();const o=Array.from(r.childNodes).indexOf(e);b(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}const r=t.getClientRects();if(r.length>1)return null;let o=r[0];if(!o){b();const e=n.createTextNode("");(t=t.cloneRange()).insertNode(e),o=t.getClientRects()[0],b(e.parentNode),e.parentNode.removeChild(e)}return o}function y(t){const e=t.getSelection();b();const n=e.rangeCount?e.getRangeAt(0):null;return n?N(n):null}function E(t){b(t.defaultView);const e=t.defaultView.getSelection();b();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function C(t){return"INPUT"===(null==t?void 0:t.nodeName)}function w(t){return C(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function T(t){return E(t)||!!t.activeElement&&function(t){if(!C(t)&&!w(t))return!1;try{const{selectionStart:e,selectionEnd:n}=t;return null===e||e!==n}catch(t){return!0}}(t.activeElement)}function v(t){return!!t.activeElement&&(C(t.activeElement)||w(t.activeElement)||E(t))}function O(t){return b(t.ownerDocument.defaultView),t.ownerDocument.defaultView.getComputedStyle(t)}function S(t){if(t){if(t.scrollHeight>t.clientHeight){const{overflowY:e}=O(t);if(/(auto|scroll)/.test(e))return t}return t.ownerDocument===t.parentNode?t:S(t.parentNode)}}function A(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?"static"!==O(e).position?e:e.offsetParent:null}function R(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName}function D(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;b();const r=n.getSelection();b();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;b();const s=u.nodeType===u.TEXT_NODE?u.data.length:u.childNodes.length;return P(i,t,"firstChild")&&P(u,t,"lastChild")&&0===c&&a===s}function P(t,e,n){let r=e;do{if(t===r)return!0;r=r[n]}while(r);return!1}function L(t){if(!t)return!1;const{tagName:e}=t;return R(t)||"BUTTON"===e||"SELECT"===e}function M(t){return"rtl"===O(t).direction}function x(t){const e=Array.from(t.getClientRects());if(!e.length)return;const n=Math.min(...e.map((t=>{let{top:e}=t;return e})));return Math.max(...e.map((t=>{let{bottom:e}=t;return e})))-n}function I(t){const{anchorNode:e,focusNode:n,anchorOffset:r,focusOffset:o}=t;b(),b();const i=e.compareDocumentPosition(n);return!(i&e.DOCUMENT_POSITION_PRECEDING)&&(!!(i&e.DOCUMENT_POSITION_FOLLOWING)||(0!==i||r<=o))}function H(t,e,n,r){const o=r.style.zIndex,i=r.style.position,{position:u="static"}=O(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 _(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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;b();const i=o.getSelection();if(!i||!i.rangeCount)return!1;const u=i.getRangeAt(0),c=u.cloneRange(),a=I(i),s=i.isCollapsed;s||c.collapse(!a);const l=N(c),f=N(u);if(!l||!f)return!1;const d=x(u);if(!s&&d&&d>l.height&&a===e)return!1;const m=M(t)?!e:e,p=t.getBoundingClientRect(),h=m?p.left+1:p.right-1,g=e?p.top+1:p.bottom-1,y=H(r,h,g,t);if(!y)return!1;const E=N(y);if(!E)return!1;const C=e?"top":"bottom",w=m?"left":"right",T=E[C]-f[C],v=E[w]-l[w],O=Math.abs(T)<=1,S=Math.abs(v)<=1;return n?O:O&&S}function F(t,e){return _(t,e)}t.r(r),t.d(r,{find:function(){return p},findNext:function(){return g},findPrevious:function(){return h},isTabbableIndex:function(){return s}});var V=window.wp.deprecated,B=t.n(V);function j(t){return B()("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),C(t)&&"number"===t.type&&!isNaN(t.valueAsNumber)}function U(t,e){return _(t,e,!0)}function z(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:n<=i.left?n=i.left+1:n>=i.right&&(n=i.right-1);return H(r,n,o?i.bottom-1:i.top+1,t)}function q(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=z(t,e,n);if(!(r&&r.startContainer&&t.contains(r.startContainer)||(t.scrollIntoView(e),r=r=z(t,e,n),r&&r.startContainer&&t.contains(r.startContainer))))return;const{ownerDocument:o}=t,{defaultView:i}=o;b();const u=i.getSelection();b(),u.removeAllRanges(),u.addRange(r)}function k(t,e){return q(t,e,void 0)}function G(t,e,n){return q(t,e,null==n?void 0:n.left)}function W(t,e){b(e.parentNode),e.parentNode.insertBefore(t,e.nextSibling)}function X(t){b(t.parentNode),t.parentNode.removeChild(t)}function Y(t,e){b(t.parentNode),W(e,t.parentNode),X(t)}function $(t){const e=t.parentNode;for(b();t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function J(t,e){const n=t.ownerDocument.createElement(e);for(;t.firstChild;)n.appendChild(t.firstChild);return b(t.parentNode),t.parentNode.replaceChild(n,t),n}function K(t,e){b(e.parentNode),e.parentNode.insertBefore(t,e),t.appendChild(e)}function Q(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)X(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 Z(t){t=Q(t);const e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function tt(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(tt));default:return!0}}const et={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":{}},nt=["#text","br"];Object.keys(et).filter((t=>!nt.includes(t))).forEach((t=>{const{[t]:e,...n}=et;et[t].children=n}));const rt={...et,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 ot(t){if("paste"!==t)return rt;const{u:e,abbr:n,data:r,time:o,wbr:i,bdi:u,bdo:c,...a}={...rt,ins:{children:rt.ins.children},del:{children:rt.del.children}};return a}function it(t){const e=t.nodeName.toLowerCase();return ot().hasOwnProperty(e)||"span"===e}function ut(t){const e=t.nodeName.toLowerCase();return et.hasOwnProperty(e)||"span"===e}const ct=()=>{};function at(t,e,n,r){Array.from(t).forEach((t=>{var o,i;const u=t.nodeName.toLowerCase();if(n.hasOwnProperty(u)&&(!n[u].isMatch||null!==(o=(i=n[u]).isMatch)&&void 0!==o&&o.call(i,t))){if(function(t){return!!t&&t.nodeType===t.ELEMENT_NODE}(t)){const{attributes:o=[],classes:i=[],children:c,require:a=[],allowEmpty:s}=n[u];if(c&&!s&&tt(t))return void X(t);if(t.hasAttributes()&&(Array.from(t.attributes).forEach((e=>{let{name:n}=e;"class"===n||o.includes(n)||t.removeAttribute(n)})),t.classList&&t.classList.length)){const e=i.map((t=>"string"==typeof t?e=>e===t:t instanceof RegExp?e=>t.test(e):ct));Array.from(t.classList).forEach((n=>{e.some((t=>t(n)))||t.classList.remove(n)})),t.classList.length||t.removeAttribute("class")}if(t.hasChildNodes()){if("*"===c)return;if(c)a.length&&!t.querySelector(a.join(","))?(at(t.childNodes,e,n,r),$(t)):t.parentNode&&"BODY"===t.parentNode.nodeName&&it(t)?(at(t.childNodes,e,n,r),Array.from(t.childNodes).some((t=>!it(t)))&&$(t)):at(t.childNodes,e,c,r);else for(;t.firstChild;)X(t.firstChild)}}}else at(t.childNodes,e,n,r),r&&!it(t)&&t.nextElementSibling&&W(e.createElement("br"),t),$(t)}))}function st(t,e,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,at(r.body.childNodes,r,e,n),r.body.innerHTML}function lt(t){const e=Array.from(t.files);return Array.from(t.items).forEach((t=>{const n=t.getAsFile();n&&!e.find((t=>{let{name:e,type:r,size:o}=t;return e===n.name&&r===n.type&&o===n.size}))&&e.push(n)})),e}const ft={focusable:n,tabbable:r};(window.wp=window.wp||{}).dom=e}(); |