mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-02 16:59:35 +01:00
6e4458c935
Props peterwilsoncc, desrosj. Fixes #53192. Built from https://develop.svn.wordpress.org/trunk@50940 git-svn-id: http://core.svn.wordpress.org/trunk@50549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
/*! This file is auto-generated */
|
|
this.wp=this.wp||{},this.wp.element=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./node_modules/@wordpress/element/build-module/index.js")}({"./node_modules/@wordpress/element/build-module/index.js":function(e,t,n){"use strict";n.r(t),n.d(t,"createInterpolateElement",(function(){return m})),n.d(t,"Children",(function(){return r.Children})),n.d(t,"cloneElement",(function(){return r.cloneElement})),n.d(t,"Component",(function(){return r.Component})),n.d(t,"createContext",(function(){return r.createContext})),n.d(t,"createElement",(function(){return r.createElement})),n.d(t,"createRef",(function(){return r.createRef})),n.d(t,"forwardRef",(function(){return r.forwardRef})),n.d(t,"Fragment",(function(){return r.Fragment})),n.d(t,"isValidElement",(function(){return r.isValidElement})),n.d(t,"memo",(function(){return r.memo})),n.d(t,"StrictMode",(function(){return r.StrictMode})),n.d(t,"useCallback",(function(){return r.useCallback})),n.d(t,"useContext",(function(){return r.useContext})),n.d(t,"useDebugValue",(function(){return r.useDebugValue})),n.d(t,"useEffect",(function(){return r.useEffect})),n.d(t,"useImperativeHandle",(function(){return r.useImperativeHandle})),n.d(t,"useLayoutEffect",(function(){return r.useLayoutEffect})),n.d(t,"useMemo",(function(){return r.useMemo})),n.d(t,"useReducer",(function(){return r.useReducer})),n.d(t,"useRef",(function(){return r.useRef})),n.d(t,"useState",(function(){return r.useState})),n.d(t,"lazy",(function(){return r.lazy})),n.d(t,"Suspense",(function(){return r.Suspense})),n.d(t,"concatChildren",(function(){return b})),n.d(t,"switchChildrenNodeName",(function(){return y})),n.d(t,"createPortal",(function(){return g.createPortal})),n.d(t,"findDOMNode",(function(){return g.findDOMNode})),n.d(t,"render",(function(){return g.render})),n.d(t,"unmountComponentAtNode",(function(){return g.unmountComponentAtNode})),n.d(t,"isEmptyElement",(function(){return w})),n.d(t,"Platform",(function(){return O})),n.d(t,"renderToString",(function(){return D})),n.d(t,"RawHTML",(function(){return S}));var r=n("react");let o,u,c,i;const s=/<(\/)?(\w+)\s*(\/)?>/g;function a(e,t,n,r,o){return{element:e,tokenStart:t,tokenLength:n,prevOffset:r,leadingTextStart:o,children:[]}}const l=e=>{const t="object"==typeof e,n=t&&Object.values(e);return t&&n.length&&n.every(e=>Object(r.isValidElement)(e))};function d(e){const t=function(){const e=s.exec(o);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,u,c]=e,i=n.length;if(c)return["self-closed",u,t,i];if(r)return["closer",u,t,i];return["opener",u,t,i]}(),[n,l,d,m]=t,h=i.length,b=d>u?u:null;if(!e[l])return f(),!1;switch(n){case"no-more-tokens":if(0!==h){const{leadingTextStart:e,tokenStart:t}=i.pop();c.push(o.substr(e,t))}return f(),!1;case"self-closed":return 0===h?(null!==b&&c.push(o.substr(b,d-b)),c.push(e[l]),u=d+m,!0):(p(a(e[l],d,m)),u=d+m,!0);case"opener":return i.push(a(e[l],d,m,d+m,b)),u=d+m,!0;case"closer":if(1===h)return function(e){const{element:t,leadingTextStart:n,prevOffset:u,tokenStart:s,children:a}=i.pop(),l=e?o.substr(u,e-u):o.substr(u);l&&a.push(l);null!==n&&c.push(o.substr(n,s-n));c.push(Object(r.cloneElement)(t,null,...a))}(d),u=d+m,!0;const t=i.pop(),n=o.substr(t.prevOffset,d-t.prevOffset);t.children.push(n),t.prevOffset=d+m;const s=a(t.element,t.tokenStart,t.tokenLength,d+m);return s.children=t.children,p(s),u=d+m,!0;default:return f(),!1}}function f(){const e=o.length-u;0!==e&&c.push(o.substr(u,e))}function p(e){const{element:t,tokenStart:n,tokenLength:u,prevOffset:c,children:s}=e,a=i[i.length-1],l=o.substr(a.prevOffset,n-a.prevOffset);l&&a.children.push(l),a.children.push(Object(r.cloneElement)(t,null,...s)),a.prevOffset=c||n+u}var m=(e,t)=>{if(o=e,u=0,c=[],i=[],s.lastIndex=0,!l(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are WPElements");do{}while(d(t));return Object(r.createElement)(r.Fragment,null,...c)},h=n("lodash");function b(...e){return e.reduce((e,t,n)=>(r.Children.forEach(t,(t,o)=>{t&&"string"!=typeof t&&(t=Object(r.cloneElement)(t,{key:[n,o].join()})),e.push(t)}),e),[])}function y(e,t){return e&&r.Children.map(e,(e,n)=>{if(Object(h.isString)(e))return Object(r.createElement)(t,{key:n},e);const{children:o,...u}=e.props;return Object(r.createElement)(t,{key:n,...u},o)})}var g=n("react-dom");const w=e=>!Object(h.isNumber)(e)&&(Object(h.isString)(e)||Object(h.isArray)(e)?!e.length:!e);var O={OS:"web",select:e=>"web"in e?e.web:e.default},v=n("@wordpress/escape-html");function S({children:e,...t}){return Object(r.createElement)("div",{dangerouslySetInnerHTML:{__html:e},...t})}const{Provider:j,Consumer:x}=Object(r.createContext)(void 0),k=Object(r.forwardRef)(()=>null),C=new Set(["string","boolean","number"]),E=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),M=new Set(["allowfullscreen","allowpaymentrequest","allowusermedia","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","typemustmatch"]),_=new Set(["autocapitalize","autocomplete","charset","contenteditable","crossorigin","decoding","dir","draggable","enctype","formenctype","formmethod","http-equiv","inputmode","kind","method","preload","scope","shape","spellcheck","translate","type","wrap"]),I=new Set(["animation","animationIterationCount","baselineShift","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","cx","cy","fillOpacity","flexGrow","flexShrink","floodOpacity","fontWeight","gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart","lineHeight","opacity","order","orphans","r","rx","ry","shapeImageThreshold","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","x","y","zIndex","zoom"]);function T(e,t){return t.some(t=>0===e.indexOf(t))}function R(e){return"key"===e||"children"===e}function L(e,t){switch(e){case"style":return function(e){if(!Object(h.isPlainObject)(e))return e;let t;for(const n in e){const r=e[n];if(null==r)continue;t?t+=";":t="";const o=H(n),u=N(n,r);t+=o+":"+u}return t}(t)}return t}function P(e){switch(e){case"htmlFor":return"for";case"className":return"class"}return e.toLowerCase()}function H(e){return Object(h.startsWith)(e,"--")?e:T(e,["ms","O","Moz","Webkit"])?"-"+Object(h.kebabCase)(e):Object(h.kebabCase)(e)}function N(e,t){return"number"!=typeof t||0===t||I.has(e)?t:t+"px"}function A(e,t,n={}){if(null==e||!1===e)return"";if(Array.isArray(e))return z(e,t,n);switch(typeof e){case"string":return Object(v.escapeHTML)(e);case"number":return e.toString()}const{type:o,props:u}=e;switch(o){case r.StrictMode:case r.Fragment:return z(u.children,t,n);case S:const{children:e,...o}=u;return $(Object(h.isEmpty)(o)?null:"div",{...o,dangerouslySetInnerHTML:{__html:e}},t,n)}switch(typeof o){case"string":return $(o,u,t,n);case"function":return o.prototype&&"function"==typeof o.prototype.render?function(e,t,n,r={}){const o=new e(t,r);"function"==typeof o.getChildContext&&Object.assign(r,o.getChildContext());return A(o.render(),n,r)}(o,u,t,n):A(o(u,n),t,n)}switch(o&&o.$$typeof){case j.$$typeof:return z(u.children,u.value,n);case x.$$typeof:return A(u.children(t||o._currentValue),t,n);case k.$$typeof:return A(o.render(u),t,n)}return""}function $(e,t,n,r={}){let o="";if("textarea"===e&&t.hasOwnProperty("value")?(o=z(t.value,n,r),t=Object(h.omit)(t,"value")):t.dangerouslySetInnerHTML&&"string"==typeof t.dangerouslySetInnerHTML.__html?o=t.dangerouslySetInnerHTML.__html:void 0!==t.children&&(o=z(t.children,n,r)),!e)return o;const u=function(e){let t="";for(const n in e){const r=P(n);if(!Object(v.isValidAttributeName)(r))continue;let o=L(n,e[n]);if(!C.has(typeof o))continue;if(R(n))continue;const u=M.has(r);if(u&&!1===o)continue;const c=u||T(n,["data-","aria-"])||_.has(r);("boolean"!=typeof o||c)&&(t+=" "+r,u||("string"==typeof o&&(o=Object(v.escapeAttribute)(o)),t+='="'+o+'"'))}return t}(t);return E.has(e)?"<"+e+u+"/>":"<"+e+u+">"+o+"</"+e+">"}function z(e,t,n={}){let r="";e=Object(h.castArray)(e);for(let o=0;o<e.length;o++){r+=A(e[o],t,n)}return r}var D=A},"@wordpress/escape-html":function(e,t){e.exports=window.wp.escapeHtml},lodash:function(e,t){e.exports=window.lodash},react:function(e,t){e.exports=window.React},"react-dom":function(e,t){e.exports=window.ReactDOM}}); |