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

14 lines
288 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{var e={4306:function(e,t){var n,o,r;
/*!
Block Editor: Updated the WordPress packages from Gutenberg 10.7.0 RC. This also includes: - The removal of the Post Author block. - Renaming build_query_vars_from_query_block function. - Update the block supports. Props gziolo. See #52991. -This line, and those below, will be ignored-- M package-lock.json M package.json M src/wp-includes/assets/script-loader-packages.php M src/wp-includes/block-supports/colors.php AM src/wp-includes/block-supports/elements.php D src/wp-includes/block-supports/padding.php AM src/wp-includes/block-supports/spacing.php M src/wp-includes/block-supports/typography.php M src/wp-includes/blocks/column/block.json M src/wp-includes/blocks/index.php D src/wp-includes/blocks/post-author D src/wp-includes/blocks/post-author.php M src/wp-includes/blocks/post-content.php M src/wp-includes/blocks/post-featured-image.php M src/wp-includes/blocks/query/block.json M src/wp-includes/blocks/query-loop/block.json M src/wp-includes/blocks/query-loop.php M src/wp-includes/blocks/query-pagination/block.json M src/wp-includes/blocks/query-pagination-next.php M src/wp-includes/blocks/query-pagination-numbers.php M src/wp-includes/blocks/site-tagline/block.json M src/wp-includes/blocks/site-title/block.json M src/wp-includes/blocks.php M src/wp-settings.php M tests/phpunit/tests/blocks/block.php M tools/webpack/packages.js Built from https://develop.svn.wordpress.org/trunk@50945 git-svn-id: http://core.svn.wordpress.org/trunk@50554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 06:14:23 -04:00
autosize 4.0.4
license: MIT
http://www.jacklmoore.com/autosize
*/o=[e,t],n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),s=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function a(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,a=function(){e.clientWidth!==n&&p()},i=function(t){window.removeEventListener("resize",a,!1),e.removeEventListener("input",p,!1),e.removeEventListener("keyup",p,!1),e.removeEventListener("autosize:destroy",i,!1),e.removeEventListener("autosize:update",p,!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",p,!1),window.addEventListener("resize",a,!1),e.addEventListener("input",p,!1),e.addEventListener("autosize:update",p,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:i,update:p}),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),p()}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 o=u(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function p(){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),o!==r){o=r;var a=s("autosize:resized");try{e.dispatchEvent(a)}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 a(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,o):n)||(e.exports=r)},6109: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()}))]}},66: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 o(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 o(e,n)}))}function s(e){return Object.keys(e).concat(f
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function yu(e){return"[object Object]"===Object.prototype.toString.call(e)}function vu(e){var t,n;return!1!==yu(e)&&(void 0===(t=e.constructor)||!1!==yu(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const{GlobalStylesContext:ku,cleanEmptyObject:wu}=m(_.privateApis);function Su(e,t){return Eu()(e,t,{isMergeableObject:vu})}function Pu(){const[e,t,n]=function(){const{globalStylesId:e,isReady:t,settings:n,styles:o}=(0,u.useSelect)((e=>{const{getEditedEntityRecord:t,hasFinishedResolution:n}=e(h.store),o=e(h.store).__experimentalGetCurrentGlobalStylesId(),r=o?t("root","globalStyles",o):void 0;let s=!1;return n("__experimentalGetCurrentGlobalStylesId")&&(s=!o||n("getEditedEntityRecord",["root","globalStyles",o])),{globalStylesId:o,isReady:s,settings:r?.settings,styles:r?.styles}}),[]),{getEditedEntityRecord:r}=(0,u.useSelect)(h.store),{editEntityRecord:s}=(0,u.useDispatch)(h.store);return[t,(0,S.useMemo)((()=>({settings:null!=n?n:{},styles:null!=o?o:{}})),[n,o]),(0,S.useCallback)(((t,n={})=>{var o,a;const i=r("root","globalStyles",e),l=t({styles:null!==(o=i?.styles)&&void 0!==o?o:{},settings:null!==(a=i?.settings)&&void 0!==a?a:{}});s("root","globalStyles",e,{styles:wu(l.styles)||{},settings:wu(l.settings)||{}},n)}),[e])]}(),[o,r]=function(){const e=(0,u.useSelect)((e=>e(h.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),s=(0,S.useMemo)((()=>r&&t?Su(r,t):{}),[t,r]);return(0,S.useMemo)((()=>({isReady:e&&o,user:t,base:r,merged:s,setUserConfig:n})),[s,t,r,n,e,o])}const Cu=[],Tu={};function xu(e){var t;return null!==(t=e(h.store).getEntityRecords("postType","wp_block",{per_page:-1}))&&void 0!==t?t:Cu}const Iu=["__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","__unstableGalleryWithImageBlocks","alignWide","blockInspectorTabs","allowedMimeTypes","bodyPlaceholder","canLockBlocks","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","sectionRootClientId","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableIsPreviewMode","__unstableResolvedAssets","__unstableIsBlockBasedTheme","__experimentalArchiveTitleTypeLabel","__experimentalArchiveTitleNameLabel"];const Bu=function(e,t,n,o){var r,s,a;const i=(0,rr.useViewportMatch)("medium"),{allowRightClickOverrides:l,blockTypes:d,focusMode:b,hasFixedToolbar:f,isDistractionFree:E,keepCaretInsideBlock:y,hasUploadPermissions:v,hiddenBlockTypes:k,canUseUnfilteredHTML:w,userCanCreatePages:P,pageOnFront:C,pageForPosts:T,userPatternCategories:I,restBlockPatternCategories:B,sectionRootClientId:N}=(0,u.useSelect)((e=>{var r;const{canUser:s,getRawEntityRecord:a,getEntityRecord:l,getUserPatternCategories:u,getBlockPatternCategories:d}=e(h.store),{get:p}=e(x.store),{getBlockTypes:m}=e(c.store),{getBlocksByName:g,getBlockAttributes:b}=e(_.store),f=s("read","settings")?l("root","site"):void 0;return{allowRightClickOverrides:p("core","allowRightClickOverrides"),blockTypes:m(),canUseUnfilteredHTML:a("postType",t,n)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:p("core","focusMode"),hasFixedToolbar:p("core","fixedToolbar")||!i,hiddenBlockTypes:p("core","hiddenBlockTypes"),isDistractionFree:p("core","distractionFree"),keepCaretInsideBlock:p("core","keepCaretInsideBlock"),hasUploadPermissions:null===(r=s("create","media"))||void 0===r||r,userCanCreatePages:s("create","pages"),pageOnFront:f?.page_on_front,pageForPosts:f?.page_for_posts,userPatternCategories:u(),restBlockPatternCategories:d(),sectionRootClientId:"template-locked"===o?null!==(y=g("core/post-content")?.[0])