WordPress/wp-includes/js/dist/element.min.js

9 lines
12 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{"use strict";var e={4140:(e,t,n)=>{var r=n(5795);t.H=r.createRoot,t.c=r.hydrateRoot},5795:e=>{e.exports=window.ReactDOM}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{Children:()=>o.Children,Component:()=>o.Component,Fragment:()=>o.Fragment,Platform:()=>w,PureComponent:()=>o.PureComponent,RawHTML:()=>I,StrictMode:()=>o.StrictMode,Suspense:()=>o.Suspense,cloneElement:()=>o.cloneElement,concatChildren:()=>g,createContext:()=>o.createContext,createElement:()=>o.createElement,createInterpolateElement:()=>m,createPortal:()=>v.createPortal,createRef:()=>o.createRef,createRoot:()=>b.H,findDOMNode:()=>v.findDOMNode,flushSync:()=>v.flushSync,forwardRef:()=>o.forwardRef,hydrate:()=>v.hydrate,hydrateRoot:()=>b.c,isEmptyElement:()=>k,isValidElement:()=>o.isValidElement,lazy:()=>o.lazy,memo:()=>o.memo,render:()=>v.render,renderToString:()=>K,startTransition:()=>o.startTransition,switchChildrenNodeName:()=>y,unmountComponentAtNode:()=>v.unmountComponentAtNode,useCallback:()=>o.useCallback,useContext:()=>o.useContext,useDebugValue:()=>o.useDebugValue,useDeferredValue:()=>o.useDeferredValue,useEffect:()=>o.useEffect,useId:()=>o.useId,useImperativeHandle:()=>o.useImperativeHandle,useInsertionEffect:()=>o.useInsertionEffect,useLayoutEffect:()=>o.useLayoutEffect,useMemo:()=>o.useMemo,useReducer:()=>o.useReducer,useRef:()=>o.useRef,useState:()=>o.useState,useSyncExternalStore:()=>o.useSyncExternalStore,useTransition:()=>o.useTransition});const o=window.React;let i,a,s,l;const c=/<(\/)?(\w+)\s*(\/)?>/g;function u(e,t,n,r,o){return{element:e,tokenStart:t,tokenLength:n,prevOffset:r,leadingTextStart:o,children:[]}}const d=e=>{const t="object"==typeof e,n=t&&Object.values(e);return t&&n.length&&n.every((e=>(0,o.isValidElement)(e)))};function p(e){const t=function(){const e=c.exec(i);if(null===e)return["no-more-tokens"];const t=e.index,[n,r,o,a]=e,s=n.length;if(a)return["self-closed",o,t,s];if(r)return["closer",o,t,s];return["opener",o,t,s]}(),[n,r,d,p]=t,m=l.length,g=d>a?a:null;if(!e[r])return f(),!1;switch(n){case"no-more-tokens":if(0!==m){const{leadingTextStart:e,tokenStart:t}=l.pop();s.push(i.substr(e,t))}return f(),!1;case"self-closed":return 0===m?(null!==g&&s.push(i.substr(g,d-g)),s.push(e[r]),a=d+p,!0):(h(u(e[r],d,p)),a=d+p,!0);case"opener":return l.push(u(e[r],d,p,d+p,g)),a=d+p,!0;case"closer":if(1===m)return function(e){const{element:t,leadingTextStart:n,prevOffset:r,tokenStart:a,children:c}=l.pop(),u=e?i.substr(r,e-r):i.substr(r);u&&c.push(u);null!==n&&s.push(i.substr(n,a-n));s.push((0,o.cloneElement)(t,null,...c))}(d),a=d+p,!0;const t=l.pop(),n=i.substr(t.prevOffset,d-t.prevOffset);t.children.push(n),t.prevOffset=d+p;const c=u(t.element,t.tokenStart,t.tokenLength,d+p);return c.children=t.children,h(c),a=d+p,!0;default:return f(),!1}}function f(){const e=i.length-a;0!==e&&s.push(i.substr(a,e))}function h(e){const{element:t,tokenStart:n,tokenLength:r,prevOffset:a,children:s}=e,c=l[l.length-1],u=i.substr(c.prevOffset,n-c.prevOffset);u&&c.children.push(u),c.children.push((0,o.cloneElement)(t,null,...s)),c.prevOffset=a||n+r}const m=(e,t)=>{if(i=e,a=0,s=[],l=[],c.lastIndex=0,!d(t))throw new TypeError("The conversionMap provided is not valid. It must be an object with values that are React Elements");do{}while(p(t));return(0,o.createElement)(o.Fragment,null,...s)};function g(...e){return e.reduce(((e,t,n)=>(o.Children.forEach(t,((t,r)=>{t&&"string"!=typeof t&&(t=(0,o.cloneElement)(t,{key:[n,r].join()})),e.push(t)})),e)),[])}function y(e,t){return e&&o.Children.map(e,((e,n)=>{if("string"==typeof e?.valueOf())return(0,o.createElement)(t,{key:n},e);const{children:r,...i}=e.props;return(0,o.createElement)(t,{key:n,...i},r)}))
Editor: Sync changes from the Gutenberg plugin 14.1 release Updated WordPress packages necessary for releasing WordPress 6.1 Beta 1: - @wordpress/a11y@3.17.1 - @wordpress/annotations@2.17.2 - @wordpress/api-fetch@6.14.1 - @wordpress/autop@3.17.1 - @wordpress/babel-plugin-import-jsx-pragma@4.0.1 - @wordpress/babel-plugin-makepot@5.1.1 - @wordpress/babel-preset-default@7.1.1 - @wordpress/base-styles@4.8.1 - @wordpress/blob@3.17.1 - @wordpress/block-directory@3.15.2 - @wordpress/block-editor@10.0.2 - @wordpress/block-library@7.14.2 - @wordpress/block-serialization-default-parser@4.17.1 - @wordpress/block-serialization-spec-parser@4.17.1 - @wordpress/blocks@11.16.2 - @wordpress/browserslist-config@5.0.1 - @wordpress/components@21.0.2 - @wordpress/compose@5.15.2 - @wordpress/core-data@5.0.2 - @wordpress/create-block-tutorial-template@2.5.1 - @wordpress/create-block@4.1.1 - @wordpress/custom-templated-path-webpack-plugin@2.1.3 - @wordpress/customize-widgets@3.14.2 - @wordpress/data-controls@2.17.2 - @wordpress/data@7.1.2 - @wordpress/date@4.17.1 - @wordpress/dependency-extraction-webpack-plugin@4.0.2 - @wordpress/deprecated@3.17.1 - @wordpress/docgen@1.26.1 - @wordpress/dom-ready@3.17.1 - @wordpress/dom@3.17.2 - @wordpress/e2e-test-utils@8.1.1 - @wordpress/e2e-tests@5.1.2 - @wordpress/edit-post@6.14.2 - @wordpress/edit-site@4.14.2 - @wordpress/edit-widgets@4.14.2 - @wordpress/editor@12.16.2 - @wordpress/element@4.15.1 - @wordpress/env@5.2.1 - @wordpress/escape-html@2.17.1 - @wordpress/eslint-plugin@13.1.1 - @wordpress/format-library@3.15.2 - @wordpress/hooks@3.17.1 - @wordpress/html-entities@3.17.1 - @wordpress/i18n@4.17.1 - @wordpress/icons@9.8.1 - @wordpress/interface@4.16.2 - @wordpress/is-shallow-equal@4.17.1 - @wordpress/jest-console@6.0.1 - @wordpress/jest-preset-default@9.0.1 - @wordpress/jest-puppeteer-axe@5.0.1 - @wordpress/keyboard-shortcuts@3.15.2 - @wordpress/keycodes@3.17.1 - @wordpress/lazy-import@1.4.3 - @wordpress/library-export-default-webpack-plugin@2.3.3 - @wordpress/list-reusable-blocks@3.15.2 - @wordpress/media-utils@4.8.1 - @wordpress/notices@3.17.2 - @wordpress/npm-package-json-lint-config@4.2.1 - @wordpress/nux@5.15.2 - @wordpress/plugins@4.15.2 - @wordpress/postcss-plugins-preset@4.1.1 - @wordpress/postcss-themes@5.0.1 - @wordpress/preferences-persistence@1.9.1 - @wordpress/preferences@2.9.2 - @wordpress/prettier-config@2.0.1 - @wordpress/primitives@3.15.1 - @wordpress/priority-queue@2.17.2 - @wordpress/project-management-automation@1.16.1 - @wordpress/react-i18n@3.15.1 - @wordpress/readable-js-assets-webpack-plugin@2.0.1 - @wordpress/redux-routine@4.17.1 - @wordpress/reusable-blocks@3.15.2 - @wordpress/rich-text@5.15.2 - @wordpress/scripts@24.1.2 - @wordpress/server-side-render@3.15.2 - @wordpress/shortcode@3.17.1 - @wordpress/style-engine@1.0.1 - @wordpress/stylelint-config@21.0.1 - @wordpress/token-list@2.17.1 - @wordpress/url@3.18.1 - @wordpress/viewport@4.15.2 - @wordpress/warning@2.17.1 - @wordpress/widgets@2.15.2 - @wordpress/wordcount@3.17.1 Props bernhard-reiter, cbravobernal, czapla, oandregal, isabel_brison, andrewserong, mciampini. See #56467. Built from https://develop.svn.wordpress.org/trunk@54257 git-svn-id: http://core.svn.wordpress.org/trunk@53816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-09-20 11:43:29 -04:00
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function S(e){return"[object Object]"===Object.prototype.toString.call(e)}var x=function(){return x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},x.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function O(e){return e.toLowerCase()}var C=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],E=/[^A-Z0-9]+/gi;function R(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function T(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?C:n,o=t.stripRegexp,i=void 0===o?E:o,a=t.transform,s=void 0===a?O:a,l=t.delimiter,c=void 0===l?" ":l,u=R(R(e,r,"$1\0$2"),i,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}(e,x({delimiter:"."},t))}function A(e,t){return void 0===t&&(t={}),T(e,x({delimiter:"-"},t))}const M=window.wp.escapeHtml;function I({children:e,...t}){let n="";return o.Children.toArray(e).forEach((e=>{"string"==typeof e&&""!==e.trim()&&(n+=e)})),(0,o.createElement)("div",{dangerouslySetInnerHTML:{__html:n},...t})}const{Provider:L,Consumer:P}=(0,o.createContext)(void 0),j=(0,o.forwardRef)((()=>null)),H=new Set(["string","boolean","number"]),z=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),D=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"]),V=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"]),W=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 _(e,t){return t.some((t=>0===e.indexOf(t)))}function F(e){return"key"===e||"children"===e}function N(e,t){return"style"===e?function(e){if(t=e,!1===S(t)||void 0!==(n=t.constructor)&&(!1===S(r=n.prototype)||!1===r.hasOwnProperty("isPrototypeOf")))return e;var t,n,r;let o;for(const t in e){const n=e[t];if(null==n)continue;o?o+=";":o="";o+=B(t)+":"+Y(t,n)}return o}(t):t}const U=["accentHeight","alignmentBaseline","arabicForm","baselineShift","capHeight","clipPath","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","dominantBaseline","enableBackground","fillOpacity","fillRule","floodColor","floodOpacity","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","horizAdvX","horizOriginX","imageRendering","letterSpacing","lightingColor","markerEnd","markerMid","markerStart","overlinePosition","overlineThickness","paintOrder","panose1","pointerEvents","renderingIntent","shapeRendering","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","textAnchor","textDecoration","textRendering","underlinePosition","underlineThickness","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","vectorEffect","vertAdvY","vertOriginX","vertOriginY","wor