WordPress/wp-includes/js/dist/notices.min.js
aduth 0feb55f633 Editor: Update packages to apply bugfixes from Gutenberg 5.5.
- @wordpress/block-editor@2.0.1
- @wordpress/block-library@2.4.4
- @wordpress/blocks@6.2.4
- @wordpress/components@7.3.1
- @wordpress/dom@2.2.4
- @wordpress/e2e-tests@1.1.4
- @wordpress/edit-post@3.3.4
- @wordpress/editor@9.2.4
- @wordpress/format-library@1.4.4
- @wordpress/list-reusable-blocks@1.3.4
- @wordpress/nux@3.2.4

Props iseulde, kjellr, aduth, get_dave, talldanwp, jorgefilipecosta, afercia, nosolosw, jasmussen, netweb .

See https://github.com/WordPress/gutenberg/pull/14987 .
See https://github.com/WordPress/gutenberg/pull/15020 .
Fixes #46951 .

Built from https://develop.svn.wordpress.org/trunk@45255


git-svn-id: http://core.svn.wordpress.org/trunk@45064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-22 12:40:04 +00:00

1 line
11 KiB
JavaScript

this.wp=this.wp||{},this.wp.notices=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=371)}({15:function(t,e,r){"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}r.d(e,"a",function(){return n})},17:function(t,e,r){"use strict";var n=r(34);function o(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||Object(n.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}r.d(e,"a",function(){return o})},2:function(t,e){!function(){t.exports=this.lodash}()},23:function(t,e,r){t.exports=r(54)},34:function(t,e,r){"use strict";function n(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}r.d(e,"a",function(){return n})},371:function(t,e,r){"use strict";r.r(e);var n={};r.r(n),r.d(n,"createNotice",function(){return v}),r.d(n,"createSuccessNotice",function(){return g}),r.d(n,"createInfoNotice",function(){return m}),r.d(n,"createErrorNotice",function(){return b}),r.d(n,"createWarningNotice",function(){return w}),r.d(n,"removeNotice",function(){return O});var o={};r.r(o),r.d(o,"getNotices",function(){return j});var i=r(5),c=r(17),a=r(2),u=r(15),f=r(7),s=function(t){return function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,o=n[t];if(void 0===o)return r;var i=e(r[o],n);return i===r[o]?r:Object(f.a)({},r,Object(u.a)({},o,i))}}}("context")(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"CREATE_NOTICE":return[].concat(Object(c.a)(Object(a.reject)(t,{id:e.notice.id})),[e.notice]);case"REMOVE_NOTICE":return Object(a.reject)(t,{id:e.id})}return t}),l=r(23),h=r.n(l),p="global",d="info",y=h.a.mark(v);function v(){var t,e,r,n,o,i,c,u,f,s,l,v,g,m,b=arguments;return h.a.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t=b.length>0&&void 0!==b[0]?b[0]:d,e=b.length>1?b[1]:void 0,r=b.length>2&&void 0!==b[2]?b[2]:{},n=r.speak,o=void 0===n||n,i=r.isDismissible,c=void 0===i||i,u=r.context,f=void 0===u?p:u,s=r.id,l=void 0===s?Object(a.uniqueId)(f):s,v=r.actions,g=void 0===v?[]:v,m=r.__unstableHTML,e=String(e),!o){h.next=8;break}return h.next=8,{type:"SPEAK",message:e};case 8:return h.next=10,{type:"CREATE_NOTICE",context:f,notice:{id:l,status:t,content:e,__unstableHTML:m,isDismissible:c,actions:g}};case 10:case"end":return h.stop()}},y,this)}function g(t,e){return v("success",t,e)}function m(t,e){return v("info",t,e)}function b(t,e){return v("error",t,e)}function w(t,e){return v("warning",t,e)}function O(t){return{type:"REMOVE_NOTICE",id:t,context:arguments.length>1&&void 0!==arguments[1]?arguments[1]:p}}var x=[];function j(t){return t[arguments.length>1&&void 0!==arguments[1]?arguments[1]:p]||x}var E=r(48),L={SPEAK:function(t){Object(E.speak)(t.message,"assertive")}};Object(i.registerStore)("core/notices",{reducer:s,actions:n,selectors:o,controls:L})},48:function(t,e){!function(){t.exports=this.wp.a11y}()},5:function(t,e){!function(){t.exports=this.wp.data}()},54:function(t,e,r){var n=function(){return this||"object"==typeof self&&self}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,i=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=r(55),o)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}},55:function(t,e){!function(e){"use strict";var r,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag",f="object"==typeof t,s=e.regeneratorRuntime;if(s)f&&(t.exports=s);else{(s=e.regeneratorRuntime=f?t.exports:{}).wrap=w;var l="suspendedStart",h="suspendedYield",p="executing",d="completed",y={},v={};v[c]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(k([])));m&&m!==n&&o.call(m,c)&&(v=m);var b=E.prototype=x.prototype=Object.create(v);j.prototype=b.constructor=E,E.constructor=j,E[u]=j.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===j||"GeneratorFunction"===(e.displayName||e.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(b),t},s.awrap=function(t){return{__await:t}},L(_.prototype),_.prototype[a]=function(){return this},s.AsyncIterator=_,s.async=function(t,e,r,n){var o=new _(w(t,e,r,n));return s.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},L(b),b[u]="Generator",b[c]=function(){return this},b.toString=function(){return"[object Generator]"},s.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},s.values=k,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return a.type="throw",a.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return n("end");if(c.tryLoc<=this.prev){var u=o.call(c,"catchLoc"),f=o.call(c,"finallyLoc");if(u&&f){if(this.prev<c.catchLoc)return n(c.catchLoc,!0);if(this.prev<c.finallyLoc)return n(c.finallyLoc)}else if(u){if(this.prev<c.catchLoc)return n(c.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return n(c.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),y}}}function w(t,e,r,n){var o=e&&e.prototype instanceof x?e:x,i=Object.create(o.prototype),c=new T(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return R()}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var a=N(c,r);if(a){if(a===y)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var u=O(t,e,r);if("normal"===u.type){if(n=r.done?d:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,c),i}function O(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}function x(){}function j(){}function E(){}function L(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function _(t){var e;this._invoke=function(r,n){function i(){return new Promise(function(e,i){!function e(r,n,i,c){var a=O(t[r],t,n);if("throw"!==a.type){var u=a.arg,f=u.value;return f&&"object"==typeof f&&o.call(f,"__await")?Promise.resolve(f.__await).then(function(t){e("next",t,i,c)},function(t){e("throw",t,i,c)}):Promise.resolve(f).then(function(t){u.value=t,i(u)},function(t){return e("throw",t,i,c)})}c(a.arg)}(r,n,e,i)})}return e=e?e.then(i,i):i()}}function N(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,N(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=O(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,y):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}return{next:R}}function R(){return{value:r,done:!0}}}(function(){return this||"object"==typeof self&&self}()||Function("return this")())},7:function(t,e,r){"use strict";r.d(e,"a",function(){return o});var n=r(15);function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),o.forEach(function(e){Object(n.a)(t,e,r[e])})}return t}}});