openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 4.67 kB
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{GN as t,IM as n,JN as r,JO as i,KO as a,MN as o,NM as s,YO as c,_k as l,aP as u,fN as d,iP as f,jN as p,nP as m,pN as h,qO as g,rP as _}from"./_2_____________________________.js";import{C as v,O as y,Rt as b,U as x,d as S,g as C,j as w,l as T,s as E,u as D,x as O}from"./_6____________________.js";import{A as k}from"./route-controls-runtime-LXiVRSj4.js";import{n as A,t as j}from"./command-discovery-english-zfhZUSVO.js";function M(e,...t){return{id:e,label:`shortcutsOverlay.labels.${e}`,combos:t}}function N(e,t){return{id:e,label:`shortcutsOverlay.sections.${e}`,entries:t}}function P(e=`enter`){let t=l();return z.map(n=>N(n.id,n.entries.filter(e=>!t||!(B.has(e.id)||e.id===`paletteStartSession`||e.id===`startNewSessionBackground`||e.id===`steerImmediately`||e.id===`saveQueuedMessage`)).map(n=>t&&n.id===`newline`?M(n.id,m.sendMessage):n.id===`newSession`?M(n.id,u()):!t&&e===`modifier-enter`&&B.has(n.id)?M(n.id,m.modifiedEnter):e===`modifier-enter`&&n.id===`startNewSessionBackground`?M(n.id,m.approveAlways):n)))}var F,I,L,R,z,B,V;function H(){return(H=e((()=>{D(),x(),a(),j(),_(),t(),i(),o(),h(),n(),k(),F=O(`<openclaw-modal-dialog><div class=dialog><header class=header><h2></h2><button class=close type=button><span aria-hidden=true></span></button></header><div class=body>`,1),I=O(`<section><h3>`),L=O(`<div class=shortcut-row><span></span><span class=combos>`),R=O(`<span class=combo>`),A(),z=[N(`general`,[M(`commandPalette`,m.commandPalette),M(`newSession`,m.newSession),M(`paletteStartSession`,m.modifiedEnter),M(`keyboardShortcuts`,m.keyboardShortcuts),M(`toggleSidebar`,m.toggleSidebar),M(`debugOverlay`,m.debugOverlay),M(`appearanceSettings`,m.appearanceSettings),M(`startNewSession`,m.sendMessage),M(`startNewSessionBackground`,m.modifiedEnter),M(`closeDialog`,m.escape)]),N(`chat`,[M(`archiveSession`,m.archiveSession),M(`sendMessage`,m.sendMessage),M(`newline`,m.newline),M(`steerImmediately`,m.modifiedEnter),M(`historyRecall`,m.historyPrevious,m.historyNext),M(`transcriptSearch`,m.transcriptSearch),M(`clearReply`,m.escape),M(`stopResponse`,m.escape),M(`cancelDictation`,m.escape),M(`saveQueuedMessage`,m.modifiedEnter)]),N(`panels`,[M(`terminalPanel`,m.terminalPanel),M(`homePanel`,m.homePanel),M(`workspaceFiles`,m.workspaceFiles),M(`sideChat`,m.sideChat),M(`browserPanel`,m.browserPanel),M(`desktopPanel`,m.desktopPanel),M(`discussionPanel`,m.discussionPanel),M(`dashboardPanel`,m.dashboardPanel),M(`reviewPanel`,m.reviewPanel)]),N(`sidebar`,[M(`toggleSessionSelect`,m.toggleSessionSelect),M(`extendSessionSelect`,m.extendSessionSelect)]),N(`imageViewer`,[M(`zoomIn`,m.zoomIn),M(`zoomOut`,m.zoomOut),M(`zoomReset`,m.zoomReset),M(`panImageHorizontal`,m.imagePanLeft,m.imagePanRight),M(`panImageVertical`,m.imagePanUp,m.imagePanDown)]),N(`approvals`,[M(`approveOnce`,m.modifiedEnter),M(`approveAlways`,m.approveAlways),M(`denyApproval`,m.denyApproval)])],B=new Set([`sendMessage`,`startNewSession`]),V=p(`openclaw-keyboard-shortcuts-dialog`,(e,t)=>{let n=e=>{e.preventDefault(),t.isOpen=!1},i=async n=>{let r=n.currentTarget,i=document.openClawModalLayers;if(n.defaultPrevented||n.repeat||!e.isOpen||!(r instanceof HTMLElement)||i?.size!==1||!i.has(r))return;let a=e.newSessionHost,o=a?.context,s=f(u(),n)&&a&&!a.onboardingMode&&c(o?.gateway.snapshot,{method:`sessions.create`,params:{},sessionScope:!0}).allowed;(s||f(m.keyboardShortcuts,n))&&(n.preventDefault(),n.stopPropagation(),t.isOpen=!1,await t.updateComplete,t.isConnected&&!t.isOpen&&s&&a.isConnected&&a.context===o&&g(a,`shortcut`))};return w(y,{get when(){return e.isOpen},get children(){var t=F(),a=t.firstChild.firstChild,o=a.firstChild,c=o.nextSibling,l=c.firstChild,u=a.nextSibling;return t._$$keydown=e=>void i(e),t.addEventListener(`modal-cancel`,n),t._$owner=b(),S(o,()=>r(`shortcutsOverlay.title`)),c._$$click=n,S(l,w(d,{name:`x`})),S(u,w(v,{get each(){return P(e.sendShortcut)},children:e=>(()=>{var t=I(),n=t.firstChild;return S(n,()=>r(e.label)),S(t,w(v,{get each(){return e.entries},children:e=>(()=>{var t=L(),n=t.firstChild,i=n.nextSibling;return S(n,()=>r(e.label)),S(i,w(v,{get each(){return e.combos},children:e=>(()=>{var t=R();return S(t,w(s,{combo:e,separateKeys:!0,always:!0})),t})()})),t})()}),null),t})()})),T(()=>({e:r(`shortcutsOverlay.title`),t:r(`common.close`)}),({e,t:n},r)=>{e!==r?.e&&C(t,`label`,e),n!==r?.t&&C(c,`aria-label`,n)}),t}})},{properties:{sendShortcut:{default:`enter`,attribute:!1},newSessionHost:{default:void 0,attribute:!1},isOpen:{default:!1,attribute:!1}},methods:{toggle:e=>{e.isOpen=!e.isOpen}}}),E([`keydown`,`click`])})))()}H();export{V as KeyboardShortcutsDialog};