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

7 lines
20 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{var e={5755:(e,t)=>{var n;
Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2. This includes: **Various** - Fix multi selection for nested blocks https://github.com/WordPress/gutenberg/pull/32536 - Consistently show the drop indicator while dragging blocks https://github.com/WordPress/gutenberg/pull/31896 - Fix horizontal drop indicator https://github.com/WordPress/gutenberg/pull/32589 - Fix Safari flickering issue https://github.com/WordPress/gutenberg/pull/32581 - Silence useSelect zombie bug errors https://github.com/WordPress/gutenberg/pull/32088 **Template Editor** - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451 **Widgets Editor** - Add block breadcrumb https://github.com/WordPress/gutenberg/pull/32498 https://github.com/WordPress/gutenberg/pull/32528 https://github.com/WordPress/gutenberg/pull/32569 - Saved deleted and restored widgets. https://github.com/WordPress/gutenberg/pull/32534 - Fix unsaved changes detection https://github.com/WordPress/gutenberg/pull/32573 - Fix button spacing in the header https://github.com/WordPress/gutenberg/pull/32585 - Avoid extra undo levels https://github.com/WordPress/gutenberg/pull/32572 - Move Legacy Widget block to the `@wordpress/widgets` package https://github.com/WordPress/gutenberg/pull/32501 - Fix Social Links color inheritance https://github.com/WordPress/gutenberg/pull/32625 - Use Button appender https://github.com/WordPress/gutenberg/pull/32580 **Global Styles (theme.json)** - Separate the presets per origin in the block editor settings https://github.com/WordPress/gutenberg/pull/32358 https://github.com/WordPress/gutenberg/pull/32622 - Use CSS Custom Properties for the preset styles https://github.com/WordPress/gutenberg/pull/32627 **Performance** - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/32567 Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf. See #53397. Built from https://develop.svn.wordpress.org/trunk@51149 git-svn-id: http://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 10:52:30 +02:00
/*!
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 17:43:29 +02:00
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/!function(){"use strict";var i={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var o=r.apply(null,n);o&&e.push(o)}}else if("object"===a){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var s in n)i.call(n,s)&&n[s]&&e.push(s)}}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},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 i={};(()=>{"use strict";n.r(i),n.d(i,{MoveToWidgetArea:()=>X,addWidgetIdToBlock:()=>K,getWidgetIdFromBlock:()=>q,registerLegacyWidgetBlock:()=>ee,registerLegacyWidgetVariations:()=>Y,registerWidgetGroupBlock:()=>te});var e={};n.r(e),n.d(e,{metadata:()=>W,name:()=>j,settings:()=>O});var t={};n.r(t),n.d(t,{metadata:()=>Q,name:()=>Z,settings:()=>U});const r=window.wp.blocks,a=window.React,o=window.wp.primitives,s=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M6 3H8V5H16V3H18V5C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H6C4.89543 21 4 20.1046 4 19V7C4 5.89543 4.89543 5 6 5V3ZM18 6.5H6C5.72386 6.5 5.5 6.72386 5.5 7V8H18.5V7C18.5 6.72386 18.2761 6.5 18 6.5ZM18.5 9.5H5.5V19C5.5 19.2761 5.72386 19.5 6 19.5H18C18.2761 19.5 18.5 19.2761 18.5 19V9.5ZM11 11H13V13H11V11ZM7 11V13H9V11H7ZM15 13V11H17V13H15Z"}));var l=n(5755),c=n.n(l);const d=window.wp.blockEditor,m=window.wp.components,u=(0,a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(o.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),h=window.wp.i18n,w=window.wp.element,g=window.wp.data,p=window.wp.coreData;function f({selectedId:e,onSelect:t}){const n=(0,g.useSelect)((e=>{var t;const n=null!==(t=e(d.store).getSettings()?.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return e(p.store).getWidgetTypes({per_page:-1})?.filter((e=>!n.includes(e.id)))}),[]);return n?0===n.length?(0,h.__)("There are no widgets available."):(0,a.createElement)(m.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,h.__)("Select a legacy widget to display:"),value:null!=e?e:"",options:[{value:"",label:(0,h.__)("Select widget")},...n.map((e=>({value:e.id,label:e.name})))],onChange:e=>{if(e){const i=n.find((t=>t.id===e));t({selectedId:i.id,isMulti:i.is_multi})}else t({selectedId:null})}}):(0,a.createElement)(m.Spinner,null)}function v({name:e,description:t}){return(0,a.createElement)("div",{className:"wp-block-legacy-widget-inspector-card"},(0,a.createElement)("h3",{className:"wp-block-legacy-widget-inspector-card__name"},e),(0,a.createElement)("span",null,t))}const b=window.wp.notices,y=window.wp.compose,E=window.wp.apiFetch;var _=n.n(E);class k{constructor({id:e,idBase:t,instance:n,onChangeInstance:i,onChangeHasPreview:r,onError:a}){this.id=e,this.idBase=t,this._instance=n,this._hasPreview=null,this.onChangeInstance=i,this.onChangeHasPreview=r,this.onError=a,this.number=++B,this.handleFormChange=(0,y.debounce)(this.handleFormChange.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}in