WordPress/wp-includes/js/dist/keyboard-shortcuts.min.js
youknowriad ebca9841e8 Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.
This brings the JS packages up to date and is the first step that will allow us 
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:29:21 +00:00

2 lines
5.2 KiB
JavaScript

/*! This file is auto-generated */
this.wp=this.wp||{},this.wp.keyboardShortcuts=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="cFS5")}({"1ZqX":function(e,t){e.exports=window.wp.data},GRId:function(e,t){e.exports=window.wp.element},RxS6:function(e,t){e.exports=window.wp.keycodes},YLtl:function(e,t){e.exports=window.lodash},cFS5:function(e,t,n){"use strict";n.r(t),n.d(t,"store",(function(){return w})),n.d(t,"useShortcut",(function(){return C})),n.d(t,"ShortcutProvider",(function(){return E})),n.d(t,"__unstableUseShortcutEventMatch",(function(){return x}));var r={};n.r(r),n.d(r,"registerShortcut",(function(){return i})),n.d(r,"unregisterShortcut",(function(){return s}));var o={};n.r(o),n.d(o,"getShortcutKeyCombination",(function(){return y})),n.d(o,"getShortcutRepresentation",(function(){return h})),n.d(o,"getShortcutDescription",(function(){return v})),n.d(o,"getShortcutAliases",(function(){return S})),n.d(o,"getAllShortcutKeyCombinations",(function(){return g})),n.d(o,"getAllShortcutRawKeyCombinations",(function(){return m})),n.d(o,"getCategoryShortcuts",(function(){return O}));var u=n("1ZqX"),c=n("YLtl");var a=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(c.omit)(e,t.name)}return e};function i({name:e,category:t,description:n,keyCombination:r,aliases:o}){return{type:"REGISTER_SHORTCUT",name:e,category:t,keyCombination:r,aliases:o,description:n}}function s(e){return{type:"UNREGISTER_SHORTCUT",name:e}}var f=n("pPDe"),l=n("RxS6");const d=[],p={display:l.displayShortcut,raw:l.rawShortcut,ariaLabel:l.shortcutAriaLabel};function b(e,t){return e?e.modifier?p[t][e.modifier](e.character):e.character:null}function y(e,t){return e[t]?e[t].keyCombination:null}function h(e,t,n="display"){return b(y(e,t),n)}function v(e,t){return e[t]?e[t].description:null}function S(e,t){return e[t]&&e[t].aliases?e[t].aliases:d}const g=Object(f.a)((e,t)=>Object(c.compact)([y(e,t),...S(e,t)]),(e,t)=>[e[t]]),m=Object(f.a)((e,t)=>g(e,t).map(e=>b(e,"raw")),(e,t)=>[e[t]]),O=Object(f.a)((e,t)=>Object.entries(e).filter(([,e])=>e.category===t).map(([e])=>e),e=>[e]),w=Object(u.createReduxStore)("core/keyboard-shortcuts",{reducer:a,actions:r,selectors:o});Object(u.register)(w);var j=n("GRId");function x(){const{getAllShortcutKeyCombinations:e}=Object(u.useSelect)(w);return function(t,n){return e(t).some(({modifier:e,character:t})=>l.isKeyboardEvent[e](n,t))}}const R=Object(j.createContext)();function C(e,t,{isDisabled:n}={}){const r=Object(j.useContext)(R),o=x(),u=Object(j.useRef)();u.current=t,Object(j.useEffect)(()=>{if(!n)return r.current.add(t),()=>{r.current.delete(t)};function t(t){o(e,t)&&u.current(t)}},[e,n])}var T=n("wx14");const{Provider:D}=R;function E(e){const t=Object(j.useRef)(new Set);return Object(j.createElement)(D,{value:t},Object(j.createElement)("div",Object(T.a)({},e,{onKeyDown:function(n){e.onKeyDown&&e.onKeyDown(n);for(const e of t.current)e(n)}})))}},pPDe:function(e,t,n){"use strict";var r,o;function u(e){return[e]}function c(){var e={clear:function(){e.head=null}};return e}function a(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}r={},o="undefined"!=typeof WeakMap,t.a=function(e,t){var n,i;function s(){n=o?new WeakMap:c()}function f(){var n,r,o,u,c,s=arguments.length;for(u=new Array(s),o=0;o<s;o++)u[o]=arguments[o];for(c=t.apply(null,u),(n=i(c)).isUniqueByDependants||(n.lastDependants&&!a(c,n.lastDependants,0)&&n.clear(),n.lastDependants=c),r=n.head;r;){if(a(r.args,u,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,u)},u[0]=null,r.args=u,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=u),i=o?function(e){var t,o,u,a,i,s=n,f=!0;for(t=0;t<e.length;t++){if(o=e[t],!(i=o)||"object"!=typeof i){f=!1;break}s.has(o)?s=s.get(o):(u=new WeakMap,s.set(o,u),s=u)}return s.has(r)||((a=c()).isUniqueByDependants=f,s.set(r,a)),s.get(r)}:function(){return n},f.getDependants=t,f.clear=s,s(),f}},wx14:function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))}});