| @@ -1,7 +1,8 @@ | ||
| 1 | -!function(){"use strict";var n={d:function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r:function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})}},t={};n.r(t),n.d(t,{ALT:function(){return S},BACKSPACE:function(){return i},COMMAND:function(){return A},CTRL:function(){return E},DELETE:function(){return C},DOWN:function(){return w},END:function(){return s},ENTER:function(){return c},ESCAPE:function(){return f},F10:function(){return g},HOME:function(){return p},LEFT:function(){return h},PAGEDOWN:function(){return d},PAGEUP:function(){return a},RIGHT:function(){return m},SHIFT:function(){return P},SPACE:function(){return l},TAB:function(){return u},UP:function(){return y},ZERO:function(){return v},displayShortcut:function(){return T},displayShortcutList:function(){return L},isKeyboardEvent:function(){return M},modifiers:function(){return O},rawShortcut:function(){return b},shortcutAriaLabel:function(){return _}});var e=window.lodash,r=window.wp.i18n;function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!n){if("undefined"==typeof window)return!1;n=window}const{platform:t}=n.navigator;return-1!==t.indexOf("Mac")||(0,e.includes)(["iPad","iPhone"],t)}const i=8,u=9,c=13,f=27,l=32,a=33,d=34,s=35,p=36,h=37,y=38,m=39,w=40,C=46,g=121,S="alt",E="ctrl",A="meta",P="shift",v=48,O={primary:n=>n()?[A]:[E],primaryShift:n=>n()?[P,A]:[E,P],primaryAlt:n=>n()?[S,A]:[E,S],secondary:n=>n()?[P,S,A]:[E,P,S],access:n=>n()?[E,S]:[P,S],ctrl:()=>[E],alt:()=>[S],ctrlShift:()=>[E,P],shift:()=>[P],shiftAlt:()=>[P,S],undefined:()=>[]},b=(0,e.mapValues)(O,(n=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;return[...n(e),t.toLowerCase()].join("+")})),L=(0,e.mapValues)(O,(n=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const i=r(),u={[S]:i?"⌥":"Alt",[E]:i?"⌃":"Ctrl",[A]:"⌘",[P]:i?"⇧":"Shift"},c=n(r).reduce(((n,t)=>{const r=(0,e.get)(u,t,t);return i?[...n,r]:[...n,r,"+"]}),[]),f=(0,e.capitalize)(t);return[...c,f]})),T=(0,e.mapValues)(L,(n=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;return n(t,e).join("")})),_=(0,e.mapValues)(O,(n=>function(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const u=i(),c={[P]:"Shift",[A]:u?"Command":"Control",[E]:"Control",[S]:u?"Option":"Alt", | |
| 1 | +(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ALT:()=>j,BACKSPACE:()=>f,COMMAND:()=>T,CTRL:()=>L,DELETE:()=>b,DOWN:()=>E,END:()=>v,ENTER:()=>h,ESCAPE:()=>g,F10:()=>P,HOME:()=>A,LEFT:()=>C,PAGEDOWN:()=>w,PAGEUP:()=>y,RIGHT:()=>S,SHIFT:()=>R,SPACE:()=>m,TAB:()=>p,UP:()=>O,ZERO:()=>_,displayShortcut:()=>x,displayShortcutList:()=>k,isAppleOS:()=>d,isKeyboardEvent:()=>N,modifiers:()=>M,rawShortcut:()=>Z,shortcutAriaLabel:()=>D});var r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function n(e){return e.toLowerCase()}Object.create,Object.create;var o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],i=/[^A-Z0-9]+/gi;function a(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function l(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}function c(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,l=void 0===r?o:r,c=t.stripRegexp,u=void 0===c?i:c,s=t.transform,d=void 0===s?n:s,f=t.delimiter,p=void 0===f?" ":f,h=a(a(e,l,"$1\0$2"),u,"\0"),g=0,m=h.length;"\0"===h.charAt(g);)g++;for(;"\0"===h.charAt(m-1);)m--;return h.slice(g,m).split("\0").map(d).join(p)}(e,r({delimiter:" ",transform:l},t))}const u=window.lodash,s=window.wp.i18n;function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!e){if("undefined"==typeof window)return!1;e=window}const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}const f=8,p=9,h=13,g=27,m=32,y=33,w=34,v=35,A=36,C=37,O=38,S=39,E=40,b=46,P=121,j="alt",L="ctrl",T="meta",R="shift",_=48,M={primary:e=>e()?[T]:[L],primaryShift:e=>e()?[R,T]:[L,R],primaryAlt:e=>e()?[j,T]:[L,j],secondary:e=>e()?[R,j,T]:[L,R,j],access:e=>e()?[L,j]:[R,j],ctrl:()=>[L],alt:()=>[j],ctrlShift:()=>[L,R],shift:()=>[R],shiftAlt:()=>[R,j],undefined:()=>[]},Z=(0,u.mapValues)(M,(e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;return[...e(r),t.toLowerCase()].join("+")})),k=(0,u.mapValues)(M,(e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;const n=r(),o={[j]:n?"⌥":"Alt",[L]:n?"⌃":"Ctrl",[T]:"⌘",[R]:n?"⇧":"Shift"},i=e(r).reduce(((e,t)=>{const r=(0,u.get)(o,t,t);return n?[...e,r]:[...e,r,"+"]}),[]),a=c(t,{stripRegexp:/[^A-Z0-9`,\.\\]/gi});return[...i,a]})),x=(0,u.mapValues)(k,(e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;return e(t,r).join("")})),D=(0,u.mapValues)(M,(e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;const n=r(),o={[R]:"Shift",[T]:n?"Command":"Control",[L]:"Control",[j]:n?"Option":"Alt", | |
| 2 | 2 | /* translators: comma as in the character ',' */ |
| 3 | -",":(0,r.__)("Comma"), | |
| 3 | +",":(0,s.__)("Comma"), | |
| 4 | 4 | /* translators: period as in the character '.' */ |
| 5 | -".":(0,r.__)("Period"), | |
| 5 | +".":(0,s.__)("Period"), | |
| 6 | 6 | /* translators: backtick as in the character '`' */ |
| 7 | -"`":(0,r.__)("Backtick")};return[...n(i),t].map((n=>(0,e.capitalize)((0,e.get)(c,n,n)))).join(u?" ":" + ")}));function j(n){return[S,E,A,P].filter((t=>n[`${t}Key`]))}const M=(0,e.mapValues)(O,(n=>function(t,r){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;const u=n(i),c=j(t);if((0,e.xor)(u,c).length)return!1;let f=t.key.toLowerCase();return r?(t.altKey&&1===r.length&&(f=String.fromCharCode(t.keyCode).toLowerCase()),"del"===r&&(r="delete"),f===r.toLowerCase()):(0,e.includes)(u,f)}));(window.wp=window.wp||{}).keycodes=t}(); | |
| 7 | +"`":(0,s.__)("Backtick")};return[...e(r),t].map((e=>c((0,u.get)(o,e,e)))).join(n?" ":" + ")}));function K(e){return[j,L,T,R].filter((t=>e[`${t}Key`]))}const N=(0,u.mapValues)(M,(e=>function(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d;const o=e(n),i=K(t),a=o.filter((e=>!i.includes(e))),l=i.filter((e=>!o.includes(e)));if(a.length>0||l.length>0)return!1;let c=t.key.toLowerCase();return r?(t.altKey&&1===r.length&&(c=String.fromCharCode(t.keyCode).toLowerCase()),n()||t.shiftKey&&1===r.length&&"Comma"===t.code&&(c=","),"del"===r&&(r="delete"),c===r.toLowerCase()):o.includes(c)}));(window.wp=window.wp||{}).keycodes=t})(); | |
| 8 | +//# sourceMappingURL=index.min.js.map | |