PluginProbe
Gutenberg / 23.2.0
Gutenberg v23.2.0
24.0.0 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 All 403 releases
gutenberg / build / modules / core-abilities / index.min.js
build/modules/core-abilities
index.js 4.2 KB 4 months ago index.js.map 5.7 KB 4 months ago index.min.asset.php 200 B 4 months ago index.min.js 1.8 KB 4 months ago index.min.js.map 6.1 KB 4 months ago

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

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