mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-17 08:05:21 +01:00
48299521c6
The following package versions were changed: @wordpress/a11y: 2.5.1 -> 2.6.0 @wordpress/annotations: 1.9.0 -> 1.10.0 @wordpress/api-fetch: 3.8.0 -> 3.9.0 @wordpress/blob: 2.5.1 -> 2.6.0 @wordpress/block-directory: 1.2.0 -> 1.3.0 @wordpress/block-editor: 3.4.0 -> 3.5.0 @wordpress/block-library: 2.11.0 -> 2.12.0 @wordpress/blocks: 6.9.0 -> 6.10.0 @wordpress/components: 8.5.0 -> 9.0.0 @wordpress/compose: 3.9.0 -> 3.10.0 @wordpress/core-data: 2.9.0 -> 2.10.0 @wordpress/data: 4.11.0 -> 4.12.0 @wordpress/data-controls: 1.5.0 -> 1.6.0 @wordpress/dom: 2.6.0 -> 2.7.0 @wordpress/dom-ready: 2.5.1 -> 2.6.0 @wordpress/e2e-test-utils: 4.0.0 -> 4.1.0 @wordpress/edit-post: 3.10.0 -> 3.11.0 @wordpress/editor: 9.9.0 -> 9.10.0 @wordpress/format-library: 1.11.0 -> 1.12.0 @wordpress/i18n: 3.7.0 -> 3.8.0 @wordpress/is-shallow-equal: 1.6.1 -> 1.7.0 @wordpress/keycodes: 2.7.0 -> 2.8.0 @wordpress/list-reusable-blocks: 1.10.0 -> 1.11.0 @wordpress/media-utils: 1.4.0 -> 1.5.0 @wordpress/notices: 1.10.0 -> 1.11.0 @wordpress/nux: 3.9.0 -> 3.10.0 @wordpress/plugins: 2.9.0 -> 2.10.0 @wordpress/priority-queue: 1.3.1 -> 1.4.0 @wordpress/rich-text: 3.9.0 -> 3.10.0 @wordpress/scripts: 6.1.1 -> 6.2.0 @wordpress/server-side-render: 1.5.0 -> 1.6.0 @wordpress/viewport: 2.10.0 -> 2.11.0 The following package was added: @wordpress/keyboard-shortcuts Props gziolo. Fixes #49204. Built from https://develop.svn.wordpress.org/trunk@47106 git-svn-id: http://core.svn.wordpress.org/trunk@46906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2 lines
8.6 KiB
JavaScript
2 lines
8.6 KiB
JavaScript
/*! This file is auto-generated */
|
|
this.wp=this.wp||{},this.wp.apiFetch=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=376)}({1:function(e,t){!function(){e.exports=this.wp.i18n}()},20:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(40);function o(e,t){if(null==e)return{};var r,o,a=Object(n.a)(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(o=0;o<u.length;o++)r=u[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}},23:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},25:function(e,t){!function(){e.exports=this.wp.url}()},376:function(e,t,r){"use strict";r.r(t);var n=r(6),o=r(20),a=r(1);var u=function(e){function t(e,r){var o=e.headers,a=void 0===o?{}:o;for(var u in a)if("x-wp-nonce"===u.toLowerCase())return r(e);return r(Object(n.a)({},e,{headers:Object(n.a)({},a,{"X-WP-Nonce":t.nonce})}))}return t.nonce=e,t},c=function(e,t){var r,o,a=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),a=(o=e.endpoint.replace(/^\//,""))?r+"/"+o:r),delete e.namespace,delete e.endpoint,t(Object(n.a)({},e,{path:a}))},i=function(e){return function(t,r){return c(t,(function(t){var o,a=t.url,u=t.path;return"string"==typeof u&&(o=e,-1!==e.indexOf("?")&&(u=u.replace("?","&")),u=u.replace(/^\//,""),"string"==typeof o&&-1!==o.indexOf("?")&&(u=u.replace("?","&")),a=o+u),r(Object(n.a)({},t,{url:a}))}))}};function s(e){var t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map((function(e){return e.split("=")})).sort((function(e,t){return e[0].localeCompare(t[0])})).map((function(e){return e.join("=")})).join("&"):n}var f=function(e){var t=Object.keys(e).reduce((function(t,r){return t[s(r)]=e[r],t}),{});return function(e,r){var n=e.parse,o=void 0===n||n;if("string"==typeof e.path){var a=e.method||"GET",u=s(e.path);if(o&&"GET"===a&&t[u])return Promise.resolve(t[u].body);if("OPTIONS"===a&&t[a]&&t[a][u])return Promise.resolve(t[a][u])}return r(e)}},p=r(23),l=r.n(p),d=r(44),h=r(25),b=function(e,t){var r=e.path,a=e.url,u=Object(o.a)(e,["path","url"]);return Object(n.a)({},u,{url:a&&Object(h.addQueryArgs)(a,t),path:r&&Object(h.addQueryArgs)(r,t)})},v=function(e){return e.json?e.json():Promise.reject(e)},O=function(e){return function(e){if(!e)return{};var t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},j=function(e){var t=e.path&&-1!==e.path.indexOf("per_page=-1"),r=e.url&&-1!==e.url.indexOf("per_page=-1");return t||r},y=function(){var e=Object(d.a)(l.a.mark((function e(t,r){var o,a,u,c,i,s;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",r(t));case 2:if(j(t)){e.next=4;break}return e.abrupt("return",r(t));case 4:return e.next=6,r(Object(n.a)({},b(t,{per_page:100}),{parse:!1}));case 6:return o=e.sent,e.next=9,v(o);case 9:if(a=e.sent,Array.isArray(a)){e.next=12;break}return e.abrupt("return",a);case 12:if(u=O(o)){e.next=15;break}return e.abrupt("return",a);case 15:c=[].concat(a);case 16:if(!u){e.next=27;break}return e.next=19,r(Object(n.a)({},t,{path:void 0,url:u,parse:!1}));case 19:return i=e.sent,e.next=22,v(i);case 22:s=e.sent,c=c.concat(s),u=O(i),e.next=16;break;case 27:return e.abrupt("return",c);case 28:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),m=new Set(["PATCH","PUT","DELETE"]),g="GET";var w=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===e.status?null:e.json?e.json():Promise.reject(e):e},x=function(e){var t={code:"invalid_json",message:Object(a.__)("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},P=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(w(e,t)).catch((function(e){return _(e,t)}))};function _(e){if(!(!(arguments.length>1&&void 0!==arguments[1])||arguments[1]))throw e;return x(e).then((function(e){var t={code:"unknown_error",message:Object(a.__)("An unknown error occurred.")};throw e||t}))}var T=function(e,t){if(!(e.path&&-1!==e.path.indexOf("/wp/v2/media")||e.url&&-1!==e.url.indexOf("/wp/v2/media")))return t(e,t);var r=0;return t(Object(n.a)({},e,{parse:!1})).catch((function(n){var o=n.headers.get("x-wp-upload-attachment-id");return n.status>=500&&n.status<600&&o?function e(n){return r++,t({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?e(n):(t({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))}(o).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:Object(a.__)("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(n)})):_(n,e.parse)})).then((function(t){return P(t,e.parse)}))},S={Accept:"application/json, */*;q=0.1"},k={credentials:"include"},A=[function(e,t){return"string"!=typeof e.url||Object(h.hasQueryArg)(e.url,"_locale")||(e.url=Object(h.addQueryArgs)(e.url,{_locale:"user"})),"string"!=typeof e.path||Object(h.hasQueryArg)(e.path,"_locale")||(e.path=Object(h.addQueryArgs)(e.path,{_locale:"user"})),t(e,t)},c,function(e,t){var r=e.method,o=void 0===r?g:r;return m.has(o.toUpperCase())&&(e=Object(n.a)({},e,{headers:Object(n.a)({},e.headers,{"X-HTTP-Method-Override":o,"Content-Type":"application/json"}),method:"POST"})),t(e,t)},y];var E=function(e){if(e.status>=200&&e.status<300)return e;throw e},M=function(e){var t=e.url,r=e.path,u=e.data,c=e.parse,i=void 0===c||c,s=Object(o.a)(e,["url","path","data","parse"]),f=e.body,p=e.headers;return p=Object(n.a)({},S,p),u&&(f=JSON.stringify(u),p["Content-Type"]="application/json"),window.fetch(t||r,Object(n.a)({},k,s,{body:f,headers:p})).then((function(e){return Promise.resolve(e).then(E).catch((function(e){return _(e,i)})).then((function(e){return P(e,i)}))}),(function(){throw{code:"fetch_error",message:Object(a.__)("You are probably offline.")}}))};function C(e){var t=[].concat(A,[M]);return new Promise((function(r,n){(function e(r){return function(n){var o=t[r];return r===t.length-1?o(n):o(n,e(r+1))}})(0)(e).then(r).catch((function(t){if("rest_cookie_invalid_nonce"!==t.code)return n(t);window.fetch(C.nonceEndpoint).then(E).then((function(e){return e.text()})).then((function(t){C.nonceMiddleware.nonce=t,C(e).then(r).catch(n)})).catch(n)}))}))}C.use=function(e){A.unshift(e)},C.setFetchHandler=function(e){M=e},C.createNonceMiddleware=u,C.createPreloadingMiddleware=f,C.createRootURLMiddleware=i,C.fetchAllMiddleware=y,C.mediaUploadMiddleware=T;t.default=C},40:function(e,t,r){"use strict";function n(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}r.d(t,"a",(function(){return n}))},44:function(e,t,r){"use strict";function n(e,t,r,n,o,a,u){try{var c=e[a](u),i=c.value}catch(e){return void r(e)}c.done?t(i):Promise.resolve(i).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var u=e.apply(t,r);function c(e){n(u,o,a,c,i,"next",e)}function i(e){n(u,o,a,c,i,"throw",e)}c(void 0)}))}}r.d(t,"a",(function(){return o}))},6:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(9);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Object(n.a)(e,t,r[t])}))}return e}},9:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"a",(function(){return n}))}}).default; |