WordPress/wp-includes/js/dist/edit-site.min.js

19 lines
306 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
!function(){var e={6411:function(e,t){var n,a,r;
/*!
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/a=[e,t],n=function(e,t){"use strict";var n,a,r="function"==typeof Map?new Map:(n=[],a=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return a[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),a.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),a.splice(t,1))}}),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function s(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,a=null,s=function(){e.clientWidth!==n&&m()},i=function(t){window.removeEventListener("resize",s,!1),e.removeEventListener("input",m,!1),e.removeEventListener("keyup",m,!1),e.removeEventListener("autosize:destroy",i,!1),e.removeEventListener("autosize:update",m,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",i,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",m,!1),window.addEventListener("resize",s,!1),e.addEventListener("input",m,!1),e.addEventListener("autosize:update",m,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:i,update:m}),l()}function l(){var n=window.getComputedStyle(e,null);"vertical"===n.resize?e.style.resize="none":"both"===n.resize&&(e.style.resize="horizontal"),t="content-box"===n.boxSizing?-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),isNaN(t)&&(t=0),m()}function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function d(){if(0!==e.scrollHeight){var a=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,a.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function m(){d();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),d(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),a!==r){a=r;var s=o("autosize:resized");try{e.dispatchEvent(s)}catch(e){}}}}function i(e){var t=r.get(e);t&&t.destroy()}function l(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return s(e,t)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],l),e}),t.default=c,e.exports=t.default},void 0===(r="function"==typeof n?n.apply(t,a):n)||(e.exports=r)},4403:function(e,t){var n;
/*!
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
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var s=r.apply(null,n);s&&e.push(s)}}else if("object"===o){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var i in n)a.call(n,i)&&n[i]&&e.push(i)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:function(e){e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1919:function(e){"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function i(e,t,n){var r={};return n.isMergeableObject(e)&&o(e).forEach((function(t){r[t]=a(e[t],n)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(o,n)(e[o],t[o],n):r[o]=a(t[o],n))})),r}function l(e,n,o){(o=o||{}).arrayMerge=o.arrayMerge||r,o.isMergeableObject=o.isMergeableObject||t,o.cloneUnlessOtherwiseSpecified=a;var s=Array.isArray(n);return s===Array.isArray(e)?s?o.arrayMerge(e,n,o):i(e,n,o):a(n,o)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},8981:function(e,t){var n,a,r;a=[],void 0===(r="function"==typeof(n=function(){return function e(t,n,a){var r,o,s=window,i="application/octet-stream",l=a||i,c=t,u=!n&&!a&&c,d=document.createElement("a"),m=function(e){return String(e)},p=s.Blob||s.MozBlob||s.WebKitBlob||m,_=n||"download";if(p=p.call?p.bind(s):Blob,"true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),u&&u.length<2048&&(_=u.split("/").pop().split("?")[0],d.href=u,-1!==d.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,_,i)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&p!==m))return navigator.msSaveBlob?navigator.msSaveBlob(E(c),_):f(c);l=(c=E(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var h=0,y=new Uint8Array(c.length),v=y.length;h<v;++h)y[h]=c.charCodeAt(h);c=new p([y],{type:l})}function E(e){for(var t=e.split(/[:;,]/),n=t[1],a=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=a.length,o=0,s=new Uint8Array(r);o<r;++o)s[o]=a.charCodeAt(o);return new p([s],{type:n})}function f(e,t){if("download"in d)return d.href=e,d.setAttribute("download",_),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout((function(){d.click(),document.body.removeChild(d),!0===t&&setTimeout((function(){s.URL.revokeObjectURL(d.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function oa(e){return"[object Object]"===Object.prototype.toString.call(e)}function sa(e){var t,n;return!1!==oa(e)&&(void 0===(t=e.constructor)||!1!==oa(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:ia,cleanEmptyObject:la}=nt(we.privateApis);function ca(e,t){return ra()(e,t,{isMergeableObject:sa})}function ua(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:a}=(0,d.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:n}=e(_.store),a=e(_.store).__experimentalGetCurrentGlobalStylesId(),r=a?t("root","globalStyles",a):void 0;let o=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(o=!a||n("getEditedEntityRecord",["root","globalStyles",a])),{globalStylesId:a,isReady:o,settings:r?.settings,styles:r?.styles}}),[]),{getEditedEntityRecord:r}=(0,d.useSelect)(_.store),{editEntityRecord:o}=(0,d.useDispatch)(_.store);return[t,(0,l.useMemo)((()=>({settings:null!=n?n:{},styles:null!=a?a:{}})),[n,a]),(0,l.useCallback)(((t,n={})=>{var a,s;const i=r("root","globalStyles",e),l=t({styles:null!==(a=i?.styles)&&void 0!==a?a:{},settings:null!==(s=i?.settings)&&void 0!==s?s:{}});o("root","globalStyles",e,{styles:la(l.styles)||{},settings:la(l.settings)||{}},n)}),[e])]}(),[a,r]=function(){const e=(0,d.useSelect)((e=>e(_.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),o=(0,l.useMemo)((()=>r&&t?ca(r,t):{}),[t,r]);return(0,l.useMemo)((()=>({isReady:e&&a,user:t,base:r,merged:o,setUserConfig:n})),[o,t,r,n,e,a])}function da({children:e}){const t=ua();return t.isReady?(0,l.createElement)(ia.Provider,{value:t},e):null}const{useGlobalSetting:ma,useGlobalStyle:pa,useGlobalStylesOutput:_a}=nt(we.privateApis),ga={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},ha={hover:{opacity:1},start:{opacity:.5}},ya={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};var va=({label:e,isFocused:t,withHoverView:n})=>{const[a]=pa("typography.fontWeight"),[r="serif"]=pa("typography.fontFamily"),[o=r]=pa("elements.h1.typography.fontFamily"),[s=a]=pa("elements.h1.typography.fontWeight"),[i="black"]=pa("color.text"),[c=i]=pa("elements.h1.color.text"),[u="white"]=pa("color.background"),[d]=pa("color.gradient"),[m]=_a(),p=(0,re.useReducedMotion)(),[_]=ma("color.palette.core"),[g]=ma("color.palette.theme"),[h]=ma("color.palette.custom"),[y,E]=(0,l.useState)(!1),[f,{width:b}]=(0,re.useResizeObserver)(),w=b?b/248:1,S=(null!=g?g:[]).concat(null!=h?h:[]).concat(null!=_?_:[]),k=S.filter((({color:e})=>e!==u&&e!==c)).slice(0,2),C=(0,l.useMemo)((()=>m?[...m,{css:"html{overflow:hidden}body{min-width: 0;padding: 0;border: none;}",isGlobalStyles:!0}]:m),[m]),x=!!b;return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{style:{position:"relative"}},f),x&&(0,l.createElement)(we.__unstableIframe,{className:"edit-site-global-styles-preview__iframe",style:{height:152*w},onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),tabIndex:-1},(0,l.createElement)(we.__unstableEditorStyles,{styles:C}),(0,l.createElement)(v.__unstableMotion.div,{style:{height:152*w,width:"100%",background:null!=d?d:u,cursor:n?"pointer":void 0},initial:"start",animate:(y||t)&&!p&&e?"hover":"start"},(0,l.createElement)(v.__unstableMotion.div,{variants:ga,style:{height:"100%",overflow:"hidden"}},(0,l.createElement)(v.__experimentalHStack,{spacing:10*w,justify:"center",style:{height:"100%",overflow:"hidden"}},(0,l.createElement)(v.__unstableMotion.div,{style:{fontFamily:o,fontSize:65*w,color:c,fontWeight:s},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"}},"Aa"),(0,l.createElement)(v.__experimentalVStack,{spacing:4*w},k.map((({slug:e,color:t},n)=>(0,l.createElement)(v.__unstableMotion.div,{key:e,style:{height:32*w,width:32*w,background:t,borderRadius:32*w/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===n?.2:.1}})))))),(0,l.createElement)(v.__unstableMotion.div,{variants:n&&ha,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1}},(0,l.createElement)(v.__experimentalHStac