hermesbuttons 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7JMZRFCQ.mjs → chunk-GK6K44OK.mjs} +34 -34
- package/dist/chunk-GK6K44OK.mjs.map +1 -0
- package/dist/{hermes-button-LIZ6A5MH.mjs → hermes-button-RRJ6D2US.mjs} +13 -13
- package/dist/hermes-button-RRJ6D2US.mjs.map +1 -0
- package/dist/{hermes-skill-button-AWROXEAX.mjs → hermes-skill-button-WZIOOH2O.mjs} +13 -13
- package/dist/hermes-skill-button-WZIOOH2O.mjs.map +1 -0
- package/dist/index.global.js +56 -56
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +75 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -75
- package/dist/index.mjs.map +1 -1
- package/dist/react.js +49 -49
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/vue.js +97 -97
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +55 -55
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7JMZRFCQ.mjs.map +0 -1
- package/dist/hermes-button-LIZ6A5MH.mjs.map +0 -1
- package/dist/hermes-skill-button-AWROXEAX.mjs.map +0 -1
package/dist/vue.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var H="agentpreferences";function P(){return typeof document<"u"}function q(){if(!P())return null;let r=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${H}=`));if(!r)return null;let l=r.slice(H.length+1);if(!l)return null;try{let t=decodeURIComponent(l),a=JSON.parse(t);return!a||typeof a!="object"||!Array.isArray(a.order)?null:{order:a.order.filter(o=>typeof o=="string"&&o.length>0)}}catch{return null}}function V(r){if(!P())return;let l=r.order.slice(0,24),t=JSON.stringify({order:l}),a=new Date;a.setFullYear(a.getFullYear()+1),document.cookie=`${H}=${encodeURIComponent(t)}; Path=/; SameSite=Lax; Expires=${a.toUTCString()}`}function f(r){if(!r||typeof r!="string")return;let t=q()?.order.filter(a=>a!==r)??[];V({order:[r,...t]})}var C=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
|
|
2
2
|
<!-- Wing helmet -->
|
|
3
3
|
<path d="M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z" fill="currentColor" opacity="0.2"/>
|
|
4
4
|
<path d="M12 2C8.5 2 6 4.5 6 7c0 1.5.5 2.8 1.5 3.8L6 14h12l-1.5-3.2C17.5 9.8 18 8.5 18 7c0-2.5-2.5-5-6-5z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/>
|
|
@@ -12,7 +12,7 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
12
12
|
<path d="M9.5 19c1.5 1 3.5 1 5 0" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" fill="none"/>
|
|
13
13
|
<!-- Eye -->
|
|
14
14
|
<circle cx="12" cy="7.5" r="1.5" fill="currentColor"/>
|
|
15
|
-
</svg>`,
|
|
15
|
+
</svg>`,_=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon">
|
|
16
16
|
<!-- Brain/memory symbol -->
|
|
17
17
|
<path d="M12 3C8 3 5 6 5 9c0 2 1 3.5 2 4.5V16a2 2 0 002 2h6a2 2 0 002-2v-2.5c1-1 2-2.5 2-4.5 0-3-3-6-7-6z" fill="currentColor" opacity="0.15"/>
|
|
18
18
|
<path d="M12 3C8 3 5 6 5 9c0 2 1 3.5 2 4.5V16a2 2 0 002 2h6a2 2 0 002-2v-2.5c1-1 2-2.5 2-4.5 0-3-3-6-7-6z" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linejoin="round"/>
|
|
@@ -23,14 +23,14 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
23
23
|
<!-- Sparkle -->
|
|
24
24
|
<circle cx="8" cy="6" r="0.8" fill="currentColor"/>
|
|
25
25
|
<circle cx="16" cy="6" r="0.8" fill="currentColor"/>
|
|
26
|
-
</svg>`,
|
|
26
|
+
</svg>`,w=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
|
|
27
27
|
<rect x="5" y="5" width="8" height="8" rx="1.5" stroke="currentColor" stroke-width="1.5" fill="none"/>
|
|
28
28
|
<path d="M3 10V3.5A1.5 1.5 0 014.5 2H10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
29
|
-
</svg>`,
|
|
29
|
+
</svg>`,D=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
|
|
30
30
|
<path d="M3 8.5l3.5 3.5L13 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
31
|
-
</svg>`;var
|
|
31
|
+
</svg>`;var I=`<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="hb-icon-sm">
|
|
32
32
|
<path d="M4 4l8 8m0-8l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
33
|
-
</svg>`;var n="#2B8CFF",v="#1E7AEB",
|
|
33
|
+
</svg>`;var n="#2B8CFF",v="#1E7AEB",F="#186BD4",i="43, 140, 255",u="#8FA3E8",E="#7B91DC",$="#6B82CC",c="143, 163, 232",A={branded:{bg:n,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:n,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:u,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:u,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},dark:{bg:"#141C2E",text:"#F1F5F9",border:"#2A3F5C",surface:"#1A2740",surfaceText:"#F1F5F9",muted:"#94A3B8",primary:n,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:n,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function m(r){return r!=="system"?A[r]:typeof window>"u"?A.light:window.matchMedia("(prefers-color-scheme: dark)").matches?A.dark:A.light}function x(r){return`
|
|
34
34
|
--hb-bg: ${r.bg};
|
|
35
35
|
--hb-text: ${r.text};
|
|
36
36
|
--hb-border: ${r.border};
|
|
@@ -41,7 +41,7 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
41
41
|
--hb-primary-text: ${r.primaryText};
|
|
42
42
|
--hb-code-bg: ${r.codeBg};
|
|
43
43
|
--hb-code-text: ${r.codeText};
|
|
44
|
-
`}var T={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},
|
|
44
|
+
`}var T={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},O={sm:{height:"2rem",fontSize:"0.75rem",iconSize:"0.875rem",padding:"0 0.75rem",ccPadding:"0 0.5rem",gap:"0.375rem",radius:"0.375rem"},md:{height:"2.5rem",fontSize:"0.875rem",iconSize:"1.125rem",padding:"0 1rem",ccPadding:"0 0.75rem",gap:"0.5rem",radius:"0.5rem"},lg:{height:"3rem",fontSize:"1rem",iconSize:"1.375rem",padding:"0 1.25rem",ccPadding:"0 1rem",gap:"0.625rem",radius:"0.625rem"}};var U=`
|
|
45
45
|
:host {
|
|
46
46
|
position: fixed;
|
|
47
47
|
inset: 0;
|
|
@@ -318,21 +318,21 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
318
318
|
@supports (padding: env(safe-area-inset-bottom)) {
|
|
319
319
|
.hb-dialog-footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
|
|
320
320
|
}
|
|
321
|
-
`,
|
|
322
|
-
<style>${
|
|
323
|
-
<div style="${
|
|
321
|
+
`,M=class extends HTMLElement{constructor(){super();this._mqCleanup=null;this.attachShadow({mode:"open"})}set options(t){this._options=t,this.render()}get options(){return this._options}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}resolvePopupTokens(){let{theme:t}=this._options;if(t==="dark"||t==="light")return m(t);let a=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return a?m("dark"):m("light");let e=a?m("dark"):m("light"),o=m(t);return{...e,primary:o.primary,primaryText:o.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:a,description:e,command:o,fullCommand:s,skillUrl:h}=this._options,d=this.resolvePopupTokens(),b=t==="hermes"?C:_,p=t==="hermes",k=s||o;this.shadowRoot.innerHTML=`
|
|
322
|
+
<style>${U}</style>
|
|
323
|
+
<div style="${x(d)}">
|
|
324
324
|
<div class="hb-backdrop" data-action="close"></div>
|
|
325
325
|
<div class="hb-dialog" role="dialog" aria-modal="true" aria-labelledby="hb-dialog-title">
|
|
326
326
|
<div class="hb-dialog-header">
|
|
327
|
-
<div class="hb-dialog-header-icon">${
|
|
327
|
+
<div class="hb-dialog-header-icon">${b}</div>
|
|
328
328
|
<div class="hb-dialog-header-text">
|
|
329
329
|
<div class="hb-dialog-title" id="hb-dialog-title">${a}</div>
|
|
330
330
|
${e?`<div class="hb-dialog-description">${e}</div>`:""}
|
|
331
331
|
</div>
|
|
332
|
-
<button class="hb-dialog-close" data-action="close" aria-label="Close">${
|
|
332
|
+
<button class="hb-dialog-close" data-action="close" aria-label="Close">${I}</button>
|
|
333
333
|
</div>
|
|
334
334
|
<div class="hb-dialog-body">
|
|
335
|
-
${p?this.renderHermesTerminalBody(
|
|
335
|
+
${p?this.renderHermesTerminalBody(k):this.renderHermesSkillBody(o,h)}
|
|
336
336
|
</div>
|
|
337
337
|
<div class="hb-dialog-footer">
|
|
338
338
|
${p?`
|
|
@@ -350,7 +350,7 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
350
350
|
<div class="hb-step-label">Copy this command to your clipboard</div>
|
|
351
351
|
<div class="hb-code-block">
|
|
352
352
|
<div class="hb-code-text"><span class="hb-code-prefix">$</span>${this.escapeHtml(t)}</div>
|
|
353
|
-
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${
|
|
353
|
+
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${w}<span>Copy</span></button>
|
|
354
354
|
</div>
|
|
355
355
|
</div>
|
|
356
356
|
</div>
|
|
@@ -367,7 +367,7 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
367
367
|
<div class="hb-step-label">Copy this prompt to your clipboard</div>
|
|
368
368
|
<div class="hb-code-block">
|
|
369
369
|
<div class="hb-code-text">${this.escapeHtml(o)}</div>
|
|
370
|
-
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(o)}">${
|
|
370
|
+
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(o)}">${w}<span>Copy</span></button>
|
|
371
371
|
</div>
|
|
372
372
|
</div>
|
|
373
373
|
</div>
|
|
@@ -384,7 +384,7 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
384
384
|
<div class="hb-step-label">Copy this command to your clipboard</div>
|
|
385
385
|
<div class="hb-code-block">
|
|
386
386
|
<div class="hb-code-text">${this.escapeHtml(t)}</div>
|
|
387
|
-
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${
|
|
387
|
+
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${w}<span>Copy</span></button>
|
|
388
388
|
</div>
|
|
389
389
|
</div>
|
|
390
390
|
</div>
|
|
@@ -394,7 +394,7 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
394
394
|
<div class="hb-step-label">Paste and send in your Hermes session</div>
|
|
395
395
|
</div>
|
|
396
396
|
</div>
|
|
397
|
-
`;return e}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let a=t.target.closest("[data-action]");if(!a)return;let e=a.dataset.action;if(e==="close")this.close();else if(e==="copy"){let o=a.dataset.command||"";this.copyToClipboard(o,a)}}),this.shadowRoot.addEventListener("keydown",t=>{t.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let t=this._options.theme;if(!(t==="system"||t==="branded"||t==="branded-alt")||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>this.render();e.addEventListener("change",o),this._mqCleanup=()=>e.removeEventListener("change",o)}async copyToClipboard(t,a){try{await navigator.clipboard.writeText(t);let e=a.querySelector("span"),o=a;a.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),o.innerHTML=`${
|
|
397
|
+
`;return e}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let a=t.target.closest("[data-action]");if(!a)return;let e=a.dataset.action;if(e==="close")this.close();else if(e==="copy"){let o=a.dataset.command||"";this.copyToClipboard(o,a)}}),this.shadowRoot.addEventListener("keydown",t=>{t.key==="Escape"&&this.close()}))}setupSystemThemeWatch(){this._mqCleanup?.(),this._mqCleanup=null;let t=this._options.theme;if(!(t==="system"||t==="branded"||t==="branded-alt")||typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>this.render();e.addEventListener("change",o),this._mqCleanup=()=>e.removeEventListener("change",o)}async copyToClipboard(t,a){try{await navigator.clipboard.writeText(t);let e=a.querySelector("span"),o=a;a.setAttribute("data-copied","true"),e&&(e.textContent="Copied!"),o.innerHTML=`${D}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{a.setAttribute("data-copied","false"),o.innerHTML=`${w}<span>Copy</span>`},2e3)}catch{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this._options.onCopy?.(t)}}close(){let t=this.shadowRoot?.querySelector(".hb-dialog"),a=this.shadowRoot?.querySelector(".hb-backdrop");t&&(t.style.animation="hb-scale-in 0.15s ease-in reverse"),a&&(a.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove()},140)}escapeHtml(t){let a=document.createElement("div");return a.textContent=t,a.innerHTML}escapeAttr(t){return t.replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}};typeof customElements<"u"&&!customElements.get("hermes-popup-dialog")&&customElements.define("hermes-popup-dialog",M);function R(r){let l=document.createElement("hermes-popup-dialog");return l.options=r,document.body.appendChild(l),l}var j=`
|
|
398
398
|
:host {
|
|
399
399
|
display: inline-block;
|
|
400
400
|
vertical-align: middle;
|
|
@@ -443,12 +443,12 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
443
443
|
box-shadow: 0 2px 8px rgba(${i}, 0.35);
|
|
444
444
|
}
|
|
445
445
|
:host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
|
|
446
|
-
background: ${
|
|
446
|
+
background: ${F};
|
|
447
447
|
transform: scale(0.98);
|
|
448
448
|
}
|
|
449
449
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
450
|
-
background: ${
|
|
451
|
-
box-shadow: 0 2px 8px rgba(${
|
|
450
|
+
background: ${E};
|
|
451
|
+
box-shadow: 0 2px 8px rgba(${c}, 0.35);
|
|
452
452
|
}
|
|
453
453
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
|
|
454
454
|
background: ${$};
|
|
@@ -498,15 +498,15 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
498
498
|
|
|
499
499
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn {
|
|
500
500
|
background: transparent;
|
|
501
|
-
border-color: ${
|
|
502
|
-
color: ${
|
|
501
|
+
border-color: ${u};
|
|
502
|
+
color: ${u};
|
|
503
503
|
}
|
|
504
504
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
505
|
-
background: rgba(${
|
|
506
|
-
box-shadow: 0 2px 8px rgba(${
|
|
505
|
+
background: rgba(${c}, 0.08);
|
|
506
|
+
box-shadow: 0 2px 8px rgba(${c}, 0.15);
|
|
507
507
|
}
|
|
508
508
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:active {
|
|
509
|
-
background: rgba(${
|
|
509
|
+
background: rgba(${c}, 0.14);
|
|
510
510
|
transform: scale(0.98);
|
|
511
511
|
}
|
|
512
512
|
|
|
@@ -557,13 +557,13 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn {
|
|
560
|
-
color: ${
|
|
560
|
+
color: ${u};
|
|
561
561
|
}
|
|
562
562
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
563
|
-
background: rgba(${
|
|
563
|
+
background: rgba(${c}, 0.1);
|
|
564
564
|
}
|
|
565
565
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:active {
|
|
566
|
-
background: rgba(${
|
|
566
|
+
background: rgba(${c}, 0.16);
|
|
567
567
|
transform: scale(0.98);
|
|
568
568
|
}
|
|
569
569
|
|
|
@@ -631,16 +631,16 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
631
631
|
.hb-btn-label {
|
|
632
632
|
letter-spacing: -0.01em;
|
|
633
633
|
}
|
|
634
|
-
`,
|
|
635
|
-
<style>${
|
|
634
|
+
`,S=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0,promptFlag:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),a=this.getAttribute("theme"),e=this.getAttribute("size"),o=this.getAttribute("variant"),s=this.getAttribute("shape"),h=this.getAttribute("popup"),d=this.getAttribute("prompt-flag"),b=this.getAttribute("popup-title"),p=this.getAttribute("popup-description");t!==null&&(this._options.command=t),a&&(this._options.theme=a),e&&(this._options.size=e),o&&(this._options.variant=o),s&&(this._options.shape=s),h!==null&&(this._options.popup=h!=="false"),d!==null&&(this._options.promptFlag=d!=="false"),b!==null&&(this._options.popupTitle=b),p!==null&&(this._options.popupDescription=p)}updateLightDOM(){let{command:t}=this._options,a=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.href=`https://hermes.ai/run?command=${encodeURIComponent(a)}`,e.textContent=`Run on Hermes: ${t}`,e.setAttribute("data-platform","hermes"),e.setAttribute("data-command",t),e.setAttribute("data-full-command",a)}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:t,promptFlag:a}=this._options;return a===!1?t:`hermes -p "${t}"`}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),a=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",o=m(t),s=this._options.size||"md",h=this._options.shape||"rounded",d=O[s],b=T[h][s];this.setAttribute("data-theme",a),this.setAttribute("data-variant",e);let p=e!=="filled"?"transparent":o.bg,k=e==="ghost"?"transparent":e==="outline"?o.primary:o.border,B=e!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=`
|
|
635
|
+
<style>${j}</style>
|
|
636
636
|
<button
|
|
637
637
|
class="hb-btn"
|
|
638
638
|
type="button"
|
|
639
639
|
style="
|
|
640
|
-
${
|
|
640
|
+
${x(o)}
|
|
641
641
|
--hb-bg: ${p};
|
|
642
|
-
--hb-border: ${
|
|
643
|
-
--hb-text: ${
|
|
642
|
+
--hb-border: ${k};
|
|
643
|
+
--hb-text: ${B};
|
|
644
644
|
--hb-accent-color: ${o.primary};
|
|
645
645
|
--hb-focus-color: ${o.primary};
|
|
646
646
|
--hb-height: ${d.height};
|
|
@@ -648,14 +648,14 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
648
648
|
--hb-icon-size: ${d.iconSize};
|
|
649
649
|
--hb-padding: ${d.ccPadding};
|
|
650
650
|
--hb-gap: ${d.gap};
|
|
651
|
-
--hb-radius: ${
|
|
651
|
+
--hb-radius: ${b};
|
|
652
652
|
"
|
|
653
653
|
aria-label="Run on Hermes: ${this._options.command.replace(/"/g,""")}"
|
|
654
654
|
>
|
|
655
|
-
<span class="hb-btn-icon" aria-hidden="true">${
|
|
655
|
+
<span class="hb-btn-icon" aria-hidden="true">${C}</span>
|
|
656
656
|
<span class="hb-btn-label">Run on Hermes</span>
|
|
657
657
|
</button>
|
|
658
|
-
`;let
|
|
658
|
+
`;let y=this.shadowRoot.querySelector(".hb-btn");y.addEventListener("click",()=>this.handleClick()),y.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:a,popupTitle:e,popupDescription:o}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:a,fullCommand:s}})),t===!1){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:s}}))});return}R({variant:"hermes",theme:this.getResolvedTheme(),title:e||"Run on Hermes",description:o||"Execute this command in your terminal to get started with Hermes Agent.",command:a,fullCommand:s,onCopy:h=>{this._options.onCopy?.(h),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:h}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();t.addEventListener("change",a),this._mqCleanup=()=>t.removeEventListener("change",a)}};S.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function z(r="hermes-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,S)}z();var G=`
|
|
659
659
|
:host {
|
|
660
660
|
display: inline-block;
|
|
661
661
|
vertical-align: middle;
|
|
@@ -704,12 +704,12 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
704
704
|
box-shadow: 0 2px 8px rgba(${i}, 0.35);
|
|
705
705
|
}
|
|
706
706
|
:host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
|
|
707
|
-
background: ${
|
|
707
|
+
background: ${F};
|
|
708
708
|
transform: scale(0.98);
|
|
709
709
|
}
|
|
710
710
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
711
|
-
background: ${
|
|
712
|
-
box-shadow: 0 2px 8px rgba(${
|
|
711
|
+
background: ${E};
|
|
712
|
+
box-shadow: 0 2px 8px rgba(${c}, 0.35);
|
|
713
713
|
}
|
|
714
714
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
|
|
715
715
|
background: ${$};
|
|
@@ -759,15 +759,15 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
759
759
|
|
|
760
760
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn {
|
|
761
761
|
background: transparent;
|
|
762
|
-
border-color: ${
|
|
763
|
-
color: ${
|
|
762
|
+
border-color: ${u};
|
|
763
|
+
color: ${u};
|
|
764
764
|
}
|
|
765
765
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
766
|
-
background: rgba(${
|
|
767
|
-
box-shadow: 0 2px 8px rgba(${
|
|
766
|
+
background: rgba(${c}, 0.08);
|
|
767
|
+
box-shadow: 0 2px 8px rgba(${c}, 0.15);
|
|
768
768
|
}
|
|
769
769
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:active {
|
|
770
|
-
background: rgba(${
|
|
770
|
+
background: rgba(${c}, 0.14);
|
|
771
771
|
transform: scale(0.98);
|
|
772
772
|
}
|
|
773
773
|
|
|
@@ -818,13 +818,13 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
818
818
|
}
|
|
819
819
|
|
|
820
820
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn {
|
|
821
|
-
color: ${
|
|
821
|
+
color: ${u};
|
|
822
822
|
}
|
|
823
823
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
824
|
-
background: rgba(${
|
|
824
|
+
background: rgba(${c}, 0.1);
|
|
825
825
|
}
|
|
826
826
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:active {
|
|
827
|
-
background: rgba(${
|
|
827
|
+
background: rgba(${c}, 0.16);
|
|
828
828
|
transform: scale(0.98);
|
|
829
829
|
}
|
|
830
830
|
|
|
@@ -892,16 +892,16 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
892
892
|
.hb-btn-label {
|
|
893
893
|
letter-spacing: -0.01em;
|
|
894
894
|
}
|
|
895
|
-
`,L=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),a=this.getAttribute("skill-url"),e=this.getAttribute("theme"),o=this.getAttribute("size"),s=this.getAttribute("variant"),h=this.getAttribute("shape"),d=this.getAttribute("popup"),
|
|
896
|
-
<style>${
|
|
895
|
+
`,L=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:!0};this._mqCleanup=null;this._rendered=!1;this.attachShadow({mode:"open"})}connectedCallback(){this.syncFromAttributes(),this.render(),this.updateLightDOM()}disconnectedCallback(){this._mqCleanup?.(),this._mqCleanup=null}attributeChangedCallback(){this._rendered&&(this.syncFromAttributes(),this.render(),this.updateLightDOM())}set options(t){this._options={...this._options,...t},this.render(),this.updateLightDOM()}get options(){return this._options}syncFromAttributes(){let t=this.getAttribute("command"),a=this.getAttribute("skill-url"),e=this.getAttribute("theme"),o=this.getAttribute("size"),s=this.getAttribute("variant"),h=this.getAttribute("shape"),d=this.getAttribute("popup"),b=this.getAttribute("popup-title"),p=this.getAttribute("popup-description");t!==null&&(this._options.command=t),a!==null&&(this._options.skillUrl=a),e&&(this._options.theme=e),o&&(this._options.size=o),s&&(this._options.variant=s),h&&(this._options.shape=h),d!==null&&(this._options.popup=d!=="false"),b!==null&&(this._options.popupTitle=b),p!==null&&(this._options.popupDescription=p)}updateLightDOM(){let{command:t,skillUrl:a}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes Skills: ${t}`),this._options.popup!==!1?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let e=this.querySelector("a[data-hb-crawl]");e||(e=document.createElement("a"),e.setAttribute("data-hb-crawl",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(e)),e.textContent=`Run on Hermes Skills: ${t}`,e.setAttribute("data-platform","hermes-skill"),e.setAttribute("data-command",t),a?(e.href=a,e.setAttribute("data-skill-url",a)):(e.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`,e.removeAttribute("data-skill-url"))}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),a=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,e=this._options.variant||"filled",o=m(t),s=this._options.size||"md",h=this._options.shape||"rounded",d=O[s],b=T[h][s];this.setAttribute("data-theme",a),this.setAttribute("data-variant",e);let p=e!=="filled"?"transparent":o.bg,k=e==="ghost"?"transparent":e==="outline"?o.primary:o.border,B=e!=="filled"?o.primary:o.text;this.shadowRoot.innerHTML=`
|
|
896
|
+
<style>${G}</style>
|
|
897
897
|
<button
|
|
898
898
|
class="hb-btn"
|
|
899
899
|
type="button"
|
|
900
900
|
style="
|
|
901
|
-
${
|
|
901
|
+
${x(o)}
|
|
902
902
|
--hb-bg: ${p};
|
|
903
|
-
--hb-border: ${
|
|
904
|
-
--hb-text: ${
|
|
903
|
+
--hb-border: ${k};
|
|
904
|
+
--hb-text: ${B};
|
|
905
905
|
--hb-accent-color: ${o.primary};
|
|
906
906
|
--hb-focus-color: ${o.primary};
|
|
907
907
|
--hb-height: ${d.height};
|
|
@@ -909,12 +909,12 @@ var w=`<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" c
|
|
|
909
909
|
--hb-icon-size: ${d.iconSize};
|
|
910
910
|
--hb-padding: ${d.padding};
|
|
911
911
|
--hb-gap: ${d.gap};
|
|
912
|
-
--hb-radius: ${
|
|
912
|
+
--hb-radius: ${b};
|
|
913
913
|
"
|
|
914
914
|
aria-label="Run on Hermes Skills: ${this._options.command.replace(/"/g,""")}"
|
|
915
915
|
>
|
|
916
|
-
<span class="hb-btn-icon" aria-hidden="true">${
|
|
916
|
+
<span class="hb-btn-icon" aria-hidden="true">${_}</span>
|
|
917
917
|
<span class="hb-btn-label">Run on Hermes Skills</span>
|
|
918
918
|
</button>
|
|
919
|
-
`;let
|
|
919
|
+
`;let y=this.shadowRoot.querySelector(".hb-btn");y.addEventListener("click",()=>this.handleClick()),y.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:a,skillUrl:e,popupTitle:o,popupDescription:s}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:a}})),t===!1){navigator.clipboard.writeText(a).then(()=>{this._options.onCopy?.(a),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:a}}))});return}R({variant:"hermes-skill",theme:this.getResolvedTheme(),title:o||"Run on Hermes Skills",description:s||"Copy and paste into a Hermes session to get started.",command:a,skillUrl:e,onCopy:h=>{this._options.onCopy?.(h),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:h}}))},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:!0,composed:!0}))}})}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();t.addEventListener("change",a),this._mqCleanup=()=>t.removeEventListener("change",a)}};L.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description"];function N(r="hermes-skill-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,L)}N();var W={install(r){if(z(),N(),r.config?.compilerOptions){let l=r.config.compilerOptions.isCustomElement;r.config.compilerOptions.isCustomElement=t=>t==="hermes-button"||t==="hermes-skill-button"||t==="hermes-popup-dialog"?!0:l?.(t)??!1}}},pt=W;export{W as HermesButtonsPlugin,pt as default};
|
|
920
920
|
//# sourceMappingURL=vue.mjs.map
|