ext-keybinding_menu-25bff79c.js 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import{g as _}from"./index-d7fba904.js";function v(g,f){for(var t=0;t<f.length;t++){const a=f[t];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in g)){const s=Object.getOwnPropertyDescriptor(a,r);s&&Object.defineProperty(g,r,s.get?s:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}var y={exports:{}};(function(g,f){ace.define("ace/ext/menu_tools/settings_menu.css",["require","exports","module"],function(t,a,r){r.exports=`#ace_settingsmenu, #kbshortcutmenu {
  2. background-color: #F7F7F7;
  3. color: black;
  4. box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);
  5. padding: 1em 0.5em 2em 1em;
  6. overflow: auto;
  7. position: absolute;
  8. margin: 0;
  9. bottom: 0;
  10. right: 0;
  11. top: 0;
  12. z-index: 9991;
  13. cursor: default;
  14. }
  15. .ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {
  16. box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);
  17. background-color: rgba(255, 255, 255, 0.6);
  18. color: black;
  19. }
  20. .ace_optionsMenuEntry:hover {
  21. background-color: rgba(100, 100, 100, 0.1);
  22. transition: all 0.3s
  23. }
  24. .ace_closeButton {
  25. background: rgba(245, 146, 146, 0.5);
  26. border: 1px solid #F48A8A;
  27. border-radius: 50%;
  28. padding: 7px;
  29. position: absolute;
  30. right: -8px;
  31. top: -8px;
  32. z-index: 100000;
  33. }
  34. .ace_closeButton{
  35. background: rgba(245, 146, 146, 0.9);
  36. }
  37. .ace_optionsMenuKey {
  38. color: darkslateblue;
  39. font-weight: bold;
  40. }
  41. .ace_optionsMenuCommand {
  42. color: darkcyan;
  43. font-weight: normal;
  44. }
  45. .ace_optionsMenuEntry input, .ace_optionsMenuEntry button {
  46. vertical-align: middle;
  47. }
  48. .ace_optionsMenuEntry button[ace_selected_button=true] {
  49. background: #e7e7e7;
  50. box-shadow: 1px 0px 2px 0px #adadad inset;
  51. border-color: #adadad;
  52. }
  53. .ace_optionsMenuEntry button {
  54. background: white;
  55. border: 1px solid lightgray;
  56. margin: 0px;
  57. }
  58. .ace_optionsMenuEntry button:hover{
  59. background: #f0f0f0;
  60. }`}),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom","ace/ext/menu_tools/settings_menu.css"],function(t,a,r){var s=t("../../lib/dom"),b=t("./settings_menu.css");s.importCssString(b,"settings_menu.css",!1),r.exports.overlayPage=function(o,u,d){var n=document.createElement("div"),p=!1;function i(l){l.keyCode===27&&e()}function e(){n&&(document.removeEventListener("keydown",i),n.parentNode.removeChild(n),o&&o.focus(),n=null,d&&d())}function x(l){p=l,l&&(n.style.pointerEvents="none",u.style.pointerEvents="auto")}return n.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(o?"background-color: rgba(0, 0, 0, 0.3);":""),n.addEventListener("click",function(l){p||e()}),document.addEventListener("keydown",i),u.addEventListener("click",function(l){l.stopPropagation()}),n.appendChild(u),document.body.appendChild(n),o&&o.blur(),{close:e,setIgnoreFocusOut:x}}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(t,a,r){var s=t("../../lib/keys");r.exports.getEditorKeybordShortcuts=function(b){s.KEY_MODS;var c=[],o={};return b.keyBinding.$handlers.forEach(function(u){var d=u.commandKeyBinding;for(var n in d){var p=n.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),i=d[n];Array.isArray(i)||(i=[i]),i.forEach(function(e){typeof e!="string"&&(e=e.name),o[e]?o[e].key+="|"+p:(o[e]={key:p,command:e},c.push(o[e]))})}}),c}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(t,a,r){var s=t("../editor").Editor;function b(c){if(!document.getElementById("kbshortcutmenu")){var o=t("./menu_tools/overlay_page").overlayPage,u=t("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,d=u(c),n=document.createElement("div"),p=d.reduce(function(i,e){return i+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+e.command+'</span> : <span class="ace_optionsMenuKey">'+e.key+"</span></div>"},"");n.id="kbshortcutmenu",n.innerHTML="<h1>Keyboard Shortcuts</h1>"+p+"</div>",o(c,n)}}r.exports.init=function(c){s.prototype.showKeyboardShortcuts=function(){b(this)},c.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(o,u){o.showKeyboardShortcuts()}}])}}),function(){ace.require(["ace/ext/keybinding_menu"],function(t){g&&(g.exports=t)})}()})(y);var m=y.exports;const h=_(m),E=v({__proto__:null,default:h},[m]);export{E as e};