WordPress/wp-includes/js/dist/keyboard-shortcuts.min.js
gziolo 6e4458c935 Build: Use hashed/deterministic moduleIDs in webpack config
Props peterwilsoncc, desrosj.
Fixes #53192.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 12:20:04 +00:00

2 lines
4.5 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.keyboardShortcuts=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="./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js")}({"./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js":function(e,t,r){"use strict";r.r(t),r.d(t,"store",(function(){return S})),r.d(t,"useShortcut",(function(){return O}));var n={};r.r(n),r.d(n,"registerShortcut",(function(){return s})),r.d(n,"unregisterShortcut",(function(){return c}));var o={};r.r(o),r.d(o,"getShortcutKeyCombination",(function(){return h})),r.d(o,"getShortcutRepresentation",(function(){return m})),r.d(o,"getShortcutDescription",(function(){return b})),r.d(o,"getShortcutAliases",(function(){return w})),r.d(o,"getAllShortcutRawKeyCombinations",(function(){return g})),r.d(o,"getCategoryShortcuts",(function(){return v}));var a=r("@wordpress/data"),u=r("lodash");var i=function(e={},t){switch(t.type){case"REGISTER_SHORTCUT":return{...e,[t.name]:{category:t.category,keyCombination:t.keyCombination,aliases:t.aliases,description:t.description}};case"UNREGISTER_SHORTCUT":return Object(u.omit)(e,t.name)}return e};function s({name:e,category:t,description:r,keyCombination:n,aliases:o}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:n,aliases:o,description:r}}function c(e){return{type:"UNREGISTER_SHORTCUT",name:e}}var d=r("./node_modules/rememo/es/rememo.js"),l=r("@wordpress/keycodes");const p=[],f={display:l.displayShortcut,raw:l.rawShortcut,ariaLabel:l.shortcutAriaLabel};function y(e,t){return e?e.modifier?f[t][e.modifier](e.character):e.character:null}function h(e,t){return e[t]?e[t].keyCombination:null}function m(e,t,r="display"){return y(h(e,t),r)}function b(e,t){return e[t]?e[t].description:null}function w(e,t){return e[t]&&e[t].aliases?e[t].aliases:p}const g=Object(d.a)((e,t)=>Object(u.compact)([y(h(e,t),"raw"),...w(e,t).map(e=>y(e,"raw"))]),(e,t)=>[e[t]]),v=Object(d.a)((e,t)=>Object.entries(e).filter(([,e])=>e.category===t).map(([e])=>e),e=>[e]),S=Object(a.createReduxStore)("core/keyboard-shortcuts",{reducer:i,actions:n,selectors:o});Object(a.register)(S);var j=r("@wordpress/compose");var O=function(e,t,r){const n=Object(a.useSelect)(t=>t(S).getAllShortcutRawKeyCombinations(e),[e]);Object(j.useKeyboardShortcut)(n,t,r)}},"./node_modules/rememo/es/rememo.js":function(e,t,r){"use strict";var n,o;function a(e){return[e]}function u(){var e={clear:function(){e.head=null}};return e}function i(e,t,r){var n;if(e.length!==t.length)return!1;for(n=r;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}n={},o="undefined"!=typeof WeakMap,t.a=function(e,t){var r,s;function c(){r=o?new WeakMap:u()}function d(){var r,n,o,a,u,c=arguments.length;for(a=new Array(c),o=0;o<c;o++)a[o]=arguments[o];for(u=t.apply(null,a),(r=s(u)).isUniqueByDependants||(r.lastDependants&&!i(u,r.lastDependants,0)&&r.clear(),r.lastDependants=u),n=r.head;n;){if(i(n.args,a,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:e.apply(null,a)},a[0]=null,n.args=a,r.head&&(r.head.prev=n,n.next=r.head),r.head=n,n.val}return t||(t=a),s=o?function(e){var t,o,a,i,s,c=r,d=!0;for(t=0;t<e.length;t++){if(o=e[t],!(s=o)||"object"!=typeof s){d=!1;break}c.has(o)?c=c.get(o):(a=new WeakMap,c.set(o,a),c=a)}return c.has(n)||((i=u()).isUniqueByDependants=d,c.set(n,i)),c.get(n)}:function(){return r},d.getDependants=t,d.clear=c,c(),d}},"@wordpress/compose":function(e,t){e.exports=window.wp.compose},"@wordpress/data":function(e,t){e.exports=window.wp.data},"@wordpress/keycodes":function(e,t){e.exports=window.wp.keycodes},lodash:function(e,t){e.exports=window.lodash}});