25 lines
2.9 KiB
JavaScript
25 lines
2.9 KiB
JavaScript
import{n as e}from"./rolldown-runtime-DkW27tQK.js";import{er as t}from"./control-ui-foundation-CeFMP1Ly.js";import{dl as n,ml as r}from"./control-ui-core-pH6nakZ-.js";import{G as i,J as a,W as o,Z as s,at as c}from"./lit-runtime-BEtFSUCp.js";import{$n as l,tr as u}from"./control-ui-core-DGVkFhVB.js";import{Ft as d,Ht as f,Lt as p,Rt as m,qt as h}from"./control-ui-core-Br5DB0Zj.js";var g;function _(){return(_=e((()=>{o(),s(),u(),f(),r(),m(),d(),g=class extends n{constructor(...e){super(...e),this.navCollapsed=!1,this.historyOnly=!1,this.canGoBack=!1,this.canGoForward=!1}render(){let e=this.navCollapsed?h(`nav.expand`):h(`nav.collapse`);return a`
|
|
<nav class="macos-titlebar-controls" @mousedown=${l}>
|
|
${this.historyOnly?i:this.renderButton({label:e,icon:this.navCollapsed?p.panelLeftOpen:p.panelLeftClose,ariaExpanded:!this.navCollapsed,onClick:this.onToggleSidebar,className:`macos-titlebar-controls__sidebar-toggle`})}
|
|
${this.renderButton({label:h(`nav.back`),icon:p.chevronLeft,disabled:!this.canGoBack,onClick:()=>globalThis.history.back(),className:`macos-titlebar-controls__back`})}
|
|
${this.renderButton({label:h(`nav.forward`),icon:p.chevronRight,disabled:!this.canGoForward,onClick:()=>globalThis.history.forward(),className:`macos-titlebar-controls__forward`})}
|
|
${this.historyOnly?i:a`
|
|
${this.renderButton({label:h(`chat.openCommandPalette`),tooltip:h(`chat.commandPaletteTitle`),icon:p.search,onClick:this.onOpenPalette,className:`macos-titlebar-controls__search`})}
|
|
${this.navCollapsed?this.renderButton({label:h(`chat.runControls.newSession`),tooltip:this.newSessionDisabledReason,icon:p.plus,disabled:!!this.newSessionDisabledReason,onClick:this.onOpenNewSession,className:`macos-titlebar-controls__new-session`}):i}
|
|
`}
|
|
</nav>
|
|
`}renderButton(e){return a`
|
|
<openclaw-tooltip .content=${e.tooltip??e.label}>
|
|
<button
|
|
type="button"
|
|
class="topbar-icon-btn macos-titlebar-controls__button ${e.className}"
|
|
aria-label=${e.label}
|
|
aria-expanded=${e.ariaExpanded===void 0?i:String(e.ariaExpanded)}
|
|
?disabled=${e.disabled||!e.onClick}
|
|
@click=${e.onClick}
|
|
>
|
|
${e.icon}
|
|
</button>
|
|
</openclaw-tooltip>
|
|
`}},t([c({attribute:!1})],g.prototype,`navCollapsed`,void 0),t([c({attribute:!1})],g.prototype,`historyOnly`,void 0),t([c({attribute:!1})],g.prototype,`canGoBack`,void 0),t([c({attribute:!1})],g.prototype,`canGoForward`,void 0),t([c({attribute:!1})],g.prototype,`newSessionDisabledReason`,void 0),t([c({attribute:!1})],g.prototype,`onToggleSidebar`,void 0),t([c({attribute:!1})],g.prototype,`onOpenPalette`,void 0),t([c({attribute:!1})],g.prototype,`onOpenNewSession`,void 0),customElements.get(`openclaw-macos-titlebar-controls`)||customElements.define(`openclaw-macos-titlebar-controls`,g)})))()}_();
|
|
//# sourceMappingURL=macos-titlebar-controls.runtime-ByLqIm3x.js.map
|