WordPress/wp-includes/js/dist/plugins.min.js
youknowriad 1de40f71be Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress. 
This includes features like:

 - DataViews.
 - Customization tools like box shadow, background size and repeat.
 - UI improvements in the site editor. 
 - Preferences sharing between the post and site editors.
 - Unified panels and editors between post and site editors.
 - Improved template mode in the post editor.
 - Iterations to multiple interactive blocks.
 - Preparing the blocks and UI for pattern overrides.
 - and a lot more.

Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377


git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 21:07:12 +00:00

2 lines
4.3 KiB
JavaScript

/*! This file is auto-generated */
!function(){"use strict";var e={n:function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(r,{a:r}),r},d:function(n,r){for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{PluginArea:function(){return P},getPlugin:function(){return h},getPlugins:function(){return y},registerPlugin:function(){return v},unregisterPlugin:function(){return w},usePluginContext:function(){return c},withPluginContext:function(){return p}});var r=window.React;var t=window.wp.element,o=window.wp.hooks,i=window.wp.isShallowEqual,u=e.n(i),l=window.wp.compose;const s=(0,t.createContext)({name:null,icon:null}),a=s.Provider;function c(){return(0,t.useContext)(s)}const p=e=>(0,l.createHigherOrderComponent)((n=>t=>(0,r.createElement)(s.Consumer,null,(o=>(0,r.createElement)(n,{...t,...e(o,t)})))),"withPluginContext");class g extends t.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){const{name:n,onError:r}=this.props;r&&r(n,e)}render(){return this.state.hasError?null:this.props.children}}var d=window.wp.primitives;var f=(0,r.createElement)(d.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(d.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));const m={};function v(e,n){if("object"!=typeof n)return console.error("No settings object provided!"),null;if("string"!=typeof e)return console.error("Plugin name must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(e))return console.error('Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'),null;m[e]&&console.error(`Plugin "${e}" is already registered.`),n=(0,o.applyFilters)("plugins.registerPlugin",n,e);const{render:r,scope:t}=n;if("function"!=typeof r)return console.error('The "render" property must be specified and must be a valid function.'),null;if(t){if("string"!=typeof t)return console.error("Plugin scope must be string."),null;if(!/^[a-z][a-z0-9-]*$/.test(t))return console.error('Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'),null}return m[e]={name:e,icon:f,...n},(0,o.doAction)("plugins.pluginRegistered",n,e),n}function w(e){if(!m[e])return void console.error('Plugin "'+e+'" is not registered.');const n=m[e];return delete m[e],(0,o.doAction)("plugins.pluginUnregistered",n,e),n}function h(e){return m[e]}function y(e){return Object.values(m).filter((n=>n.scope===e))}const x=function(e,n){var r,t,o=0;function i(){var i,u,l=r,s=arguments.length;e:for(;l;){if(l.args.length===arguments.length){for(u=0;u<s;u++)if(l.args[u]!==arguments[u]){l=l.next;continue e}return l!==r&&(l===t&&(t=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=r,l.prev=null,r.prev=l,r=l),l.val}l=l.next}for(i=new Array(s),u=0;u<s;u++)i[u]=arguments[u];return l={args:i,val:e.apply(null,i)},r?(r.prev=l,l.next=r):t=l,o===n.maxSize?(t=t.prev).next=null:o++,r=l,l.val}return n=n||{},i.clear=function(){r=null,t=null,o=0},i}(((e,n)=>({icon:e,name:n})));var P=function({scope:e,onError:n}){const i=(0,t.useMemo)((()=>{let n=[];return{subscribe(e){return(0,o.addAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered",e),(0,o.addAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered",e),()=>{(0,o.removeAction)("plugins.pluginRegistered","core/plugins/plugin-area/plugins-registered"),(0,o.removeAction)("plugins.pluginUnregistered","core/plugins/plugin-area/plugins-unregistered")}},getValue(){const r=y(e);return u()(n,r)||(n=r),n}}}),[e]),l=(0,t.useSyncExternalStore)(i.subscribe,i.getValue);return(0,r.createElement)("div",{style:{display:"none"}},l.map((({icon:e,name:t,render:o})=>(0,r.createElement)(a,{key:t,value:x(e,t)},(0,r.createElement)(g,{name:t,onError:n},(0,r.createElement)(o,null))))))};(window.wp=window.wp||{}).plugins=n}();