WordPress/wp-includes/js/dist/keyboard-shortcuts.min.js
gziolo b8871304cf Editor: Update WordPress packages from Gutenberg 10.5
Applies changes between the Gutenberg plugin v10.4 and v10.5. It contains the latest version of WordPress packages and PHP changes applied to non-experimental features.

Props youknowriad.
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 11:48:27 +00:00

2 lines
7.2 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.keyboardShortcuts=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=471)}({11:function(t,e){t.exports=window.wp.compose},12:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(38);var o=r(28),u=r(39);function a(t,e){return Object(n.a)(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,u=[],a=!0,i=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);a=!0);}catch(t){i=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(i)throw o}}return u}}(t,e)||Object(o.a)(t,e)||Object(u.a)()}},15:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(24);var o=r(42),u=r(28);function a(t){return function(t){if(Array.isArray(t))return Object(n.a)(t)}(t)||Object(o.a)(t)||Object(u.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},17:function(t,e){t.exports=window.wp.keycodes},2:function(t,e){t.exports=window.lodash},24:function(t,e,r){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}r.d(e,"a",(function(){return n}))},28:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(24);function o(t,e){if(t){if("string"==typeof t)return Object(n.a)(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(t,e):void 0}}},38:function(t,e,r){"use strict";function n(t){if(Array.isArray(t))return t}r.d(e,"a",(function(){return n}))},39:function(t,e,r){"use strict";function n(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}r.d(e,"a",(function(){return n}))},4:function(t,e){t.exports=window.wp.data},40:function(t,e,r){"use strict";var n,o;function u(t){return[t]}function a(){var t={clear:function(){t.head=null}};return t}function i(t,e,r){var n;if(t.length!==e.length)return!1;for(n=r;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}n={},o="undefined"!=typeof WeakMap,e.a=function(t,e){var r,c;function f(){r=o?new WeakMap:a()}function s(){var r,n,o,u,a,f=arguments.length;for(u=new Array(f),o=0;o<f;o++)u[o]=arguments[o];for(a=e.apply(null,u),(r=c(a)).isUniqueByDependants||(r.lastDependants&&!i(a,r.lastDependants,0)&&r.clear(),r.lastDependants=a),n=r.head;n;){if(i(n.args,u,1))return n!==r.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=r.head,n.prev=null,r.head.prev=n,r.head=n),n.val;n=n.next}return n={val:t.apply(null,u)},u[0]=null,n.args=u,r.head&&(r.head.prev=n,n.next=r.head),r.head=n,n.val}return e||(e=u),c=o?function(t){var e,o,u,i,c,f=r,s=!0;for(e=0;e<t.length;e++){if(o=t[e],!(c=o)||"object"!=typeof c){s=!1;break}f.has(o)?f=f.get(o):(u=new WeakMap,f.set(o,u),f=u)}return f.has(n)||((i=a()).isUniqueByDependants=s,f.set(n,i)),f.get(n)}:function(){return r},s.getDependants=e,s.clear=f,f(),s}},42:function(t,e,r){"use strict";function n(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}r.d(e,"a",(function(){return n}))},471:function(t,e,r){"use strict";r.r(e),r.d(e,"store",(function(){return T})),r.d(e,"useShortcut",(function(){return C}));var n={};r.r(n),r.d(n,"registerShortcut",(function(){return l})),r.d(n,"unregisterShortcut",(function(){return d}));var o={};r.r(o),r.d(o,"getShortcutKeyCombination",(function(){return m})),r.d(o,"getShortcutRepresentation",(function(){return j})),r.d(o,"getShortcutDescription",(function(){return S})),r.d(o,"getShortcutAliases",(function(){return w})),r.d(o,"getAllShortcutRawKeyCombinations",(function(){return x})),r.d(o,"getCategoryShortcuts",(function(){return R}));var u=r(4),a=r(5),i=r(2);function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){Object(a.a)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"REGISTER_SHORTCUT":return f(f({},t),{},Object(a.a)({},e.name,{category:e.category,keyCombination:e.keyCombination,aliases:e.aliases,description:e.description}));case"UNREGISTER_SHORTCUT":return Object(i.omit)(t,e.name)}return t};function l(t){var e=t.name,r=t.category,n=t.description;return{type:"REGISTER_SHORTCUT",name:e,category:r,keyCombination:t.keyCombination,aliases:t.aliases,description:n}}function d(t){return{type:"UNREGISTER_SHORTCUT",name:t}}var p=r(12),b=r(15),y=r(40),h=r(17),v=[],O={display:h.displayShortcut,raw:h.rawShortcut,ariaLabel:h.shortcutAriaLabel};function g(t,e){return t?t.modifier?O[e][t.modifier](t.character):t.character:null}function m(t,e){return t[e]?t[e].keyCombination:null}function j(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"display",n=m(t,e);return g(n,r)}function S(t,e){return t[e]?t[e].description:null}function w(t,e){return t[e]&&t[e].aliases?t[e].aliases:v}var x=Object(y.a)((function(t,e){return Object(i.compact)([g(m(t,e),"raw")].concat(Object(b.a)(w(t,e).map((function(t){return g(t,"raw")})))))}),(function(t,e){return[t[e]]})),R=Object(y.a)((function(t,e){return Object.entries(t).filter((function(t){return Object(p.a)(t,2)[1].category===e})).map((function(t){return Object(p.a)(t,1)[0]}))}),(function(t){return[t]})),T=Object(u.createReduxStore)("core/keyboard-shortcuts",{reducer:s,actions:n,selectors:o});Object(u.register)(T);var A=r(11);var C=function(t,e,r){var n=Object(u.useSelect)((function(e){return e(T).getAllShortcutRawKeyCombinations(t)}),[t]);Object(A.useKeyboardShortcut)(n,e,r)}},5: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}))}});