PluginProbe
Gutenberg / 23.5.3
Gutenberg v23.5.3
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / build / modules / core-abilities / index.min.js

index.min.js in Gutenberg 23.5.3, at build/modules/core-abilities/index.min.js

3 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var u=Object.create;var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var h=(e,t,i,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!b.call(e,r)&&r!==i&&c(e,r,{get:()=>t[r],enumerable:!(a=A(t,r))||a.enumerable});return e};var d=(e,t,i)=>(i=e!=null?u(w(e)):{},h(t||!e||!e.__esModule?c(i,"default",{value:e,enumerable:!0}):i,e));var p=l((z,f)=>{f.exports=window.wp.apiFetch});var y=l((C,m)=>{m.exports=window.wp.url});var o=d(p(),1),n=d(y(),1);import{registerAbility as T,registerAbilityCategory as I}from"@wordpress/abilities";var g="/wp-abilities/v1",E=`${g}/abilities`,P=`${g}/categories`;function S(e){return async t=>{let i="POST";e.meta?.annotations?.readonly?i="GET":e.meta?.annotations?.destructive&&e.meta?.annotations?.idempotent&&(i="DELETE");let a=`${E}/${e.name}/run`,r={method:i};return["GET","DELETE"].includes(i)&&t!==null&&t!==void 0?a=(0,n.addQueryArgs)(a,{input:t}):i==="POST"&&t!==null&&t!==void 0&&(r.data={input:t}),(0,o.default)({path:a,...r})}}async function x(){try{let e=await(0,o.default)({path:(0,n.addQueryArgs)(P,{per_page:-1,context:"edit"})});if(e&&Array.isArray(e))for(let t of e)I(t.slug,{label:t.label,description:t.description,meta:{annotations:{serverRegistered:!0}}})}catch(e){console.error("Failed to fetch ability categories:",e)}}async function O(){try{let e=await(0,o.default)({path:(0,n.addQueryArgs)(E,{per_page:-1,context:"edit"})});if(e&&Array.isArray(e))for(let t of e)T({...t,callback:S(t),meta:{annotations:{...t.meta?.annotations,serverRegistered:!0}}})}catch(e){console.error("Failed to fetch abilities:",e)}}var s=null;function F(){return s||(s=(async()=>{await x(),await O()})()),s}export{F as initialize};
2 //# sourceMappingURL=index.min.js.map
3