hermesbuttons 1.1.0 → 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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var P="agentpreferences";function N(){return typeof document<"u"}function V(){if(!N())return null;let r=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${P}=`));if(!r)return null;let n=r.slice(P.length+1);if(!n)return null;try{let t=decodeURIComponent(n),e=JSON.parse(t);return !e||typeof e!="object"||!Array.isArray(e.order)?null:{order:e.order.filter(a=>typeof a=="string"&&a.length>0)}}catch{return null}}function j(r){if(!N())return;let n=r.order.slice(0,24),t=JSON.stringify({order:n}),e=new Date;e.setFullYear(e.getFullYear()+1),document.cookie=`${P}=${encodeURIComponent(t)}; Path=/; SameSite=Lax; Expires=${e.toUTCString()}`;}function f(r){if(!r||typeof r!="string")return;let t=V()?.order.filter(e=>e!==r)??[];j({order:[r,...t]});}var w=`<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 @@
|
|
|
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>`,C=`<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 @@
|
|
|
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>`,A=`<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
|
|
33
|
+
</svg>`;var i="#2B8CFF",v="#1E7AEB",T="#186BD4",s="43, 140, 255",u="#8FA3E8",R="#7B91DC",S="#6B82CC",c="143, 163, 232",_={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:i,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:i,primaryText:"#FFFFFF",codeBg:"#0A0E18",codeText:"#F1F5F9"},light:{bg:"#FFFFFF",text:"#0F172A",border:"#CBD5E1",surface:"#F8FAFC",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"}};function b(r){return r!=="system"?_[r]:typeof window>"u"?_.light:window.matchMedia("(prefers-color-scheme: dark)").matches?_.dark:_.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 @@
|
|
|
41
41
|
--hb-primary-text: ${r.primaryText};
|
|
42
42
|
--hb-code-bg: ${r.codeBg};
|
|
43
43
|
--hb-code-text: ${r.codeText};
|
|
44
|
-
`}var
|
|
44
|
+
`}var O={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},L={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 W=`
|
|
45
45
|
:host {
|
|
46
46
|
position: fixed;
|
|
47
47
|
inset: 0;
|
|
@@ -318,24 +318,24 @@
|
|
|
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
|
+
`,B=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 b(t);let e=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return e?b("dark"):b("light");let o=e?b("dark"):b("light"),a=b(t);return {...o,primary:a.primary,primaryText:a.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:e,description:o,command:a,fullCommand:d,skillUrl:l}=this._options,h=this.resolvePopupTokens(),m=t==="hermes"?w:C,p=t==="hermes",k=d||a;this.shadowRoot.innerHTML=`
|
|
322
|
+
<style>${W}</style>
|
|
323
|
+
<div style="${x(h)}">
|
|
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
327
|
<div class="hb-dialog-header-icon">${m}</div>
|
|
328
328
|
<div class="hb-dialog-header-text">
|
|
329
|
-
<div class="hb-dialog-title" id="hb-dialog-title">${
|
|
330
|
-
${
|
|
329
|
+
<div class="hb-dialog-title" id="hb-dialog-title">${e}</div>
|
|
330
|
+
${o?`<div class="hb-dialog-description">${o}</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
|
-
${
|
|
335
|
+
${p?this.renderHermesTerminalBody(k):this.renderHermesSkillBody(a,l)}
|
|
336
336
|
</div>
|
|
337
337
|
<div class="hb-dialog-footer">
|
|
338
|
-
${
|
|
338
|
+
${p?`
|
|
339
339
|
<div class="hb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your terminal to run</div>
|
|
340
340
|
`:`
|
|
341
341
|
<div class="hb-hint">Press <kbd>\u2318</kbd>+<kbd>V</kbd> or <kbd>Ctrl</kbd>+<kbd>V</kbd> in your Hermes session to run</div>
|
|
@@ -350,7 +350,7 @@
|
|
|
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)}">${A}<span>Copy</span></button>
|
|
354
354
|
</div>
|
|
355
355
|
</div>
|
|
356
356
|
</div>
|
|
@@ -360,14 +360,14 @@
|
|
|
360
360
|
<div class="hb-step-label">Paste and run in your terminal</div>
|
|
361
361
|
</div>
|
|
362
362
|
</div>
|
|
363
|
-
`}renderHermesSkillBody(t,
|
|
363
|
+
`}renderHermesSkillBody(t,e){let o="";if(e){let a=`Install the skill from ${e} and run ${t}`;o+=`
|
|
364
364
|
<div class="hb-step">
|
|
365
365
|
<div class="hb-step-num">1</div>
|
|
366
366
|
<div class="hb-step-content">
|
|
367
367
|
<div class="hb-step-label">Copy this prompt to your clipboard</div>
|
|
368
368
|
<div class="hb-code-block">
|
|
369
|
-
<div class="hb-code-text">${this.escapeHtml(
|
|
370
|
-
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(
|
|
369
|
+
<div class="hb-code-text">${this.escapeHtml(a)}</div>
|
|
370
|
+
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(a)}">${A}<span>Copy</span></button>
|
|
371
371
|
</div>
|
|
372
372
|
</div>
|
|
373
373
|
</div>
|
|
@@ -377,14 +377,14 @@
|
|
|
377
377
|
<div class="hb-step-label">Paste into a Hermes session \u2014 the agent will fetch the skill and set it up for you</div>
|
|
378
378
|
</div>
|
|
379
379
|
</div>
|
|
380
|
-
`;}else
|
|
380
|
+
`;}else o+=`
|
|
381
381
|
<div class="hb-step">
|
|
382
382
|
<div class="hb-step-num">1</div>
|
|
383
383
|
<div class="hb-step-content">
|
|
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)}">${A}<span>Copy</span></button>
|
|
388
388
|
</div>
|
|
389
389
|
</div>
|
|
390
390
|
</div>
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
<div class="hb-step-label">Paste and send in your Hermes session</div>
|
|
395
395
|
</div>
|
|
396
396
|
</div>
|
|
397
|
-
`;return
|
|
397
|
+
`;return o}setupListeners(){this.shadowRoot&&(this.shadowRoot.addEventListener("click",t=>{let e=t.target.closest("[data-action]");if(!e)return;let o=e.dataset.action;if(o==="close")this.close();else if(o==="copy"){let a=e.dataset.command||"";this.copyToClipboard(a,e);}}),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 o=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>this.render();o.addEventListener("change",a),this._mqCleanup=()=>o.removeEventListener("change",a);}async copyToClipboard(t,e){try{await navigator.clipboard.writeText(t);let o=e.querySelector("span"),a=e;e.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),a.innerHTML=`${D}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{e.setAttribute("data-copied","false"),a.innerHTML=`${A}<span>Copy</span>`;},2e3);}catch{let o=document.createElement("textarea");o.value=t,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o),this._options.onCopy?.(t);}}close(){let t=this.shadowRoot?.querySelector(".hb-dialog"),e=this.shadowRoot?.querySelector(".hb-backdrop");t&&(t.style.animation="hb-scale-in 0.15s ease-in reverse"),e&&(e.style.animation="hb-fade-in 0.15s ease-in reverse"),setTimeout(()=>{this._options.onClose?.(),this.remove();},140);}escapeHtml(t){let e=document.createElement("div");return e.textContent=t,e.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",B);function E(r){let n=document.createElement("hermes-popup-dialog");return n.options=r,document.body.appendChild(n),n}var G=`
|
|
398
398
|
:host {
|
|
399
399
|
display: inline-block;
|
|
400
400
|
vertical-align: middle;
|
|
@@ -447,8 +447,8 @@
|
|
|
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: ${R};
|
|
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: ${S};
|
|
@@ -484,8 +484,8 @@
|
|
|
484
484
|
|
|
485
485
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn {
|
|
486
486
|
background: transparent;
|
|
487
|
-
border-color: ${
|
|
488
|
-
color: ${
|
|
487
|
+
border-color: ${i};
|
|
488
|
+
color: ${i};
|
|
489
489
|
}
|
|
490
490
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
|
|
491
491
|
background: rgba(${s}, 0.08);
|
|
@@ -502,11 +502,11 @@
|
|
|
502
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
|
|
|
@@ -516,7 +516,7 @@
|
|
|
516
516
|
color: #F1F5F9;
|
|
517
517
|
}
|
|
518
518
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
|
|
519
|
-
border-color: ${
|
|
519
|
+
border-color: ${i};
|
|
520
520
|
background: rgba(${s}, 0.08);
|
|
521
521
|
}
|
|
522
522
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
|
|
@@ -530,7 +530,7 @@
|
|
|
530
530
|
color: #0F172A;
|
|
531
531
|
}
|
|
532
532
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
|
|
533
|
-
border-color: ${
|
|
533
|
+
border-color: ${i};
|
|
534
534
|
background: rgba(${s}, 0.05);
|
|
535
535
|
}
|
|
536
536
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
|
|
@@ -546,7 +546,7 @@
|
|
|
546
546
|
}
|
|
547
547
|
|
|
548
548
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn {
|
|
549
|
-
color: ${
|
|
549
|
+
color: ${i};
|
|
550
550
|
}
|
|
551
551
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
|
|
552
552
|
background: rgba(${s}, 0.1);
|
|
@@ -560,10 +560,10 @@
|
|
|
560
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
|
|
|
@@ -592,7 +592,7 @@
|
|
|
592
592
|
/* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */
|
|
593
593
|
|
|
594
594
|
.hb-btn:focus-visible {
|
|
595
|
-
outline: 2px solid var(--hb-focus-color, ${
|
|
595
|
+
outline: 2px solid var(--hb-focus-color, ${i});
|
|
596
596
|
outline-offset: 2px;
|
|
597
597
|
}
|
|
598
598
|
|
|
@@ -615,15 +615,15 @@
|
|
|
615
615
|
--hb-icon-accent: rgba(255,255,255,0.2);
|
|
616
616
|
}
|
|
617
617
|
:host([data-variant="filled"][data-theme="dark"]) .hb-btn-icon {
|
|
618
|
-
color: var(--hb-accent-color, ${
|
|
618
|
+
color: var(--hb-accent-color, ${i});
|
|
619
619
|
}
|
|
620
620
|
:host([data-variant="filled"][data-theme="light"]) .hb-btn-icon {
|
|
621
|
-
color: var(--hb-accent-color, ${
|
|
621
|
+
color: var(--hb-accent-color, ${i});
|
|
622
622
|
}
|
|
623
623
|
|
|
624
624
|
:host([data-variant="outline"]) .hb-btn-icon,
|
|
625
625
|
:host([data-variant="ghost"]) .hb-btn-icon {
|
|
626
|
-
color: var(--hb-accent-color, ${
|
|
626
|
+
color: var(--hb-accent-color, ${i});
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
/* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */
|
|
@@ -631,18 +631,18 @@
|
|
|
631
631
|
.hb-btn-label {
|
|
632
632
|
letter-spacing: -0.01em;
|
|
633
633
|
}
|
|
634
|
-
`,F=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true,promptFlag:true};this._mqCleanup=null;this._rendered=false;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"),
|
|
635
|
-
<style>${
|
|
634
|
+
`,F=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true,promptFlag:true};this._mqCleanup=null;this._rendered=false;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"),e=this.getAttribute("theme"),o=this.getAttribute("size"),a=this.getAttribute("variant"),d=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("prompt-flag"),m=this.getAttribute("popup-title"),p=this.getAttribute("popup-description");t!==null&&(this._options.command=t),e&&(this._options.theme=e),o&&(this._options.size=o),a&&(this._options.variant=a),d&&(this._options.shape=d),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.promptFlag=h!=="false"),m!==null&&(this._options.popupTitle=m),p!==null&&(this._options.popupDescription=p);}updateLightDOM(){let{command:t}=this._options,e=this.getFullCommand();this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let o=this.querySelector("a[data-hb-crawl]");o||(o=document.createElement("a"),o.setAttribute("data-hb-crawl",""),o.setAttribute("aria-hidden","true"),o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(o)),o.href=`https://hermes.ai/run?command=${encodeURIComponent(e)}`,o.textContent=`Run on Hermes: ${t}`,o.setAttribute("data-platform","hermes"),o.setAttribute("data-command",t),o.setAttribute("data-full-command",e);}getResolvedTheme(){return this._options.theme||"branded"}getFullCommand(){let{command:t,promptFlag:e}=this._options;return e===false?t:`hermes -p "${t}"`}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),e=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,o=this._options.variant||"filled",a=b(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=L[d],m=O[l][d];this.setAttribute("data-theme",e),this.setAttribute("data-variant",o);let p=o!=="filled"?"transparent":a.bg,k=o==="ghost"?"transparent":o==="outline"?a.primary:a.border,z=o!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=`
|
|
635
|
+
<style>${G}</style>
|
|
636
636
|
<button
|
|
637
637
|
class="hb-btn"
|
|
638
638
|
type="button"
|
|
639
639
|
style="
|
|
640
|
-
${
|
|
641
|
-
--hb-bg: ${
|
|
642
|
-
--hb-border: ${
|
|
643
|
-
--hb-text: ${
|
|
644
|
-
--hb-accent-color: ${
|
|
645
|
-
--hb-focus-color: ${
|
|
640
|
+
${x(a)}
|
|
641
|
+
--hb-bg: ${p};
|
|
642
|
+
--hb-border: ${k};
|
|
643
|
+
--hb-text: ${z};
|
|
644
|
+
--hb-accent-color: ${a.primary};
|
|
645
|
+
--hb-focus-color: ${a.primary};
|
|
646
646
|
--hb-height: ${h.height};
|
|
647
647
|
--hb-font-size: ${h.fontSize};
|
|
648
648
|
--hb-icon-size: ${h.iconSize};
|
|
@@ -652,10 +652,10 @@
|
|
|
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">${w}</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=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:e,popupTitle:o,popupDescription:a}=this._options,d=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:true,composed:true,detail:{command:e,fullCommand:d}})),t===false){navigator.clipboard.writeText(d).then(()=>{this._options.onCopy?.(d),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:true,composed:true,detail:{command:d}}));});return}E({variant:"hermes",theme:this.getResolvedTheme(),title:o||"Run on Hermes",description:a||"Execute this command in your terminal to get started with Hermes Agent.",command:e,fullCommand:d,onCopy:l=>{this._options.onCopy?.(l),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:true,composed:true,detail:{command:l}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:true,composed:true}));}});}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>this.render();t.addEventListener("change",e),this._mqCleanup=()=>t.removeEventListener("change",e);}};F.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function H(r="hermes-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,F);}H();function K(r){let n=document.createElement("hermes-button");return n.options=r,n}var Y=`
|
|
659
659
|
:host {
|
|
660
660
|
display: inline-block;
|
|
661
661
|
vertical-align: middle;
|
|
@@ -708,8 +708,8 @@
|
|
|
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: ${R};
|
|
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: ${S};
|
|
@@ -745,8 +745,8 @@
|
|
|
745
745
|
|
|
746
746
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn {
|
|
747
747
|
background: transparent;
|
|
748
|
-
border-color: ${
|
|
749
|
-
color: ${
|
|
748
|
+
border-color: ${i};
|
|
749
|
+
color: ${i};
|
|
750
750
|
}
|
|
751
751
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
|
|
752
752
|
background: rgba(${s}, 0.08);
|
|
@@ -763,11 +763,11 @@
|
|
|
763
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
|
|
|
@@ -777,7 +777,7 @@
|
|
|
777
777
|
color: #F1F5F9;
|
|
778
778
|
}
|
|
779
779
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
|
|
780
|
-
border-color: ${
|
|
780
|
+
border-color: ${i};
|
|
781
781
|
background: rgba(${s}, 0.08);
|
|
782
782
|
}
|
|
783
783
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
color: #0F172A;
|
|
792
792
|
}
|
|
793
793
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
|
|
794
|
-
border-color: ${
|
|
794
|
+
border-color: ${i};
|
|
795
795
|
background: rgba(${s}, 0.05);
|
|
796
796
|
}
|
|
797
797
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
|
|
@@ -807,7 +807,7 @@
|
|
|
807
807
|
}
|
|
808
808
|
|
|
809
809
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn {
|
|
810
|
-
color: ${
|
|
810
|
+
color: ${i};
|
|
811
811
|
}
|
|
812
812
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
|
|
813
813
|
background: rgba(${s}, 0.1);
|
|
@@ -821,10 +821,10 @@
|
|
|
821
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
|
|
|
@@ -853,7 +853,7 @@
|
|
|
853
853
|
/* \u2500\u2500\u2500 FOCUS \u2500\u2500\u2500 */
|
|
854
854
|
|
|
855
855
|
.hb-btn:focus-visible {
|
|
856
|
-
outline: 2px solid var(--hb-focus-color, ${
|
|
856
|
+
outline: 2px solid var(--hb-focus-color, ${i});
|
|
857
857
|
outline-offset: 2px;
|
|
858
858
|
}
|
|
859
859
|
|
|
@@ -876,15 +876,15 @@
|
|
|
876
876
|
--hb-icon-accent: rgba(255,255,255,0.2);
|
|
877
877
|
}
|
|
878
878
|
:host([data-variant="filled"][data-theme="dark"]) .hb-btn-icon {
|
|
879
|
-
color: var(--hb-accent-color, ${
|
|
879
|
+
color: var(--hb-accent-color, ${i});
|
|
880
880
|
}
|
|
881
881
|
:host([data-variant="filled"][data-theme="light"]) .hb-btn-icon {
|
|
882
|
-
color: var(--hb-accent-color, ${
|
|
882
|
+
color: var(--hb-accent-color, ${i});
|
|
883
883
|
}
|
|
884
884
|
|
|
885
885
|
:host([data-variant="outline"]) .hb-btn-icon,
|
|
886
886
|
:host([data-variant="ghost"]) .hb-btn-icon {
|
|
887
|
-
color: var(--hb-accent-color, ${
|
|
887
|
+
color: var(--hb-accent-color, ${i});
|
|
888
888
|
}
|
|
889
889
|
|
|
890
890
|
/* \u2500\u2500\u2500 LABEL \u2500\u2500\u2500 */
|
|
@@ -892,18 +892,18 @@
|
|
|
892
892
|
.hb-btn-label {
|
|
893
893
|
letter-spacing: -0.01em;
|
|
894
894
|
}
|
|
895
|
-
`,$=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true};this._mqCleanup=null;this._rendered=false;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"),
|
|
896
|
-
<style>${
|
|
895
|
+
`,$=class extends HTMLElement{constructor(){super();this._options={command:"",theme:"branded",size:"md",variant:"filled",popup:true};this._mqCleanup=null;this._rendered=false;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"),e=this.getAttribute("skill-url"),o=this.getAttribute("theme"),a=this.getAttribute("size"),d=this.getAttribute("variant"),l=this.getAttribute("shape"),h=this.getAttribute("popup"),m=this.getAttribute("popup-title"),p=this.getAttribute("popup-description");t!==null&&(this._options.command=t),e!==null&&(this._options.skillUrl=e),o&&(this._options.theme=o),a&&(this._options.size=a),d&&(this._options.variant=d),l&&(this._options.shape=l),h!==null&&(this._options.popup=h!=="false"),m!==null&&(this._options.popupTitle=m),p!==null&&(this._options.popupDescription=p);}updateLightDOM(){let{command:t,skillUrl:e}=this._options;this.setAttribute("role","button"),this.setAttribute("tabindex","0"),this.setAttribute("aria-label",`Run on Hermes Skills: ${t}`),this._options.popup!==false?this.setAttribute("aria-haspopup","dialog"):this.removeAttribute("aria-haspopup");let o=this.querySelector("a[data-hb-crawl]");o||(o=document.createElement("a"),o.setAttribute("data-hb-crawl",""),o.setAttribute("aria-hidden","true"),o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;",this.appendChild(o)),o.textContent=`Run on Hermes Skills: ${t}`,o.setAttribute("data-platform","hermes-skill"),o.setAttribute("data-command",t),e?(o.href=e,o.setAttribute("data-skill-url",e)):(o.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`,o.removeAttribute("data-skill-url"));}getResolvedTheme(){return this._options.theme||"branded"}render(){if(!this.shadowRoot)return;let t=this.getResolvedTheme(),e=t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,o=this._options.variant||"filled",a=b(t),d=this._options.size||"md",l=this._options.shape||"rounded",h=L[d],m=O[l][d];this.setAttribute("data-theme",e),this.setAttribute("data-variant",o);let p=o!=="filled"?"transparent":a.bg,k=o==="ghost"?"transparent":o==="outline"?a.primary:a.border,z=o!=="filled"?a.primary:a.text;this.shadowRoot.innerHTML=`
|
|
896
|
+
<style>${Y}</style>
|
|
897
897
|
<button
|
|
898
898
|
class="hb-btn"
|
|
899
899
|
type="button"
|
|
900
900
|
style="
|
|
901
|
-
${
|
|
902
|
-
--hb-bg: ${
|
|
903
|
-
--hb-border: ${
|
|
904
|
-
--hb-text: ${
|
|
905
|
-
--hb-accent-color: ${
|
|
906
|
-
--hb-focus-color: ${
|
|
901
|
+
${x(a)}
|
|
902
|
+
--hb-bg: ${p};
|
|
903
|
+
--hb-border: ${k};
|
|
904
|
+
--hb-text: ${z};
|
|
905
|
+
--hb-accent-color: ${a.primary};
|
|
906
|
+
--hb-focus-color: ${a.primary};
|
|
907
907
|
--hb-height: ${h.height};
|
|
908
908
|
--hb-font-size: ${h.fontSize};
|
|
909
909
|
--hb-icon-size: ${h.iconSize};
|
|
@@ -913,9 +913,9 @@
|
|
|
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">${C}</span>
|
|
917
917
|
<span class="hb-btn-label">Run on Hermes Skills</span>
|
|
918
918
|
</button>
|
|
919
|
-
`;let
|
|
920
|
-
exports.ALT_BRAND_COLOR=u;exports.BRAND_COLOR=
|
|
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=true,this.setupSystemThemeWatch();}handleClick(){let{popup:t,command:e,skillUrl:o,popupTitle:a,popupDescription:d}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:true,composed:true,detail:{command:e}})),t===false){navigator.clipboard.writeText(e).then(()=>{this._options.onCopy?.(e),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:true,composed:true,detail:{command:e}}));});return}E({variant:"hermes-skill",theme:this.getResolvedTheme(),title:a||"Run on Hermes Skills",description:d||"Copy and paste into a Hermes session to get started.",command:e,skillUrl:o,onCopy:l=>{this._options.onCopy?.(l),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:true,composed:true,detail:{command:l}}));},onClose:()=>{this.dispatchEvent(new CustomEvent("hb-close",{bubbles:true,composed:true}));}});}setupSystemThemeWatch(){if(this._mqCleanup?.(),this._mqCleanup=null,this.getResolvedTheme()!=="system"||typeof window>"u")return;let t=window.matchMedia("(prefers-color-scheme: dark)"),e=()=>this.render();t.addEventListener("change",e),this._mqCleanup=()=>t.removeEventListener("change",e);}};$.observedAttributes=["command","skill-url","theme","size","variant","shape","popup","popup-title","popup-description"];function M(r="hermes-skill-button"){typeof customElements>"u"||customElements.get(r)||customElements.define(r,$);}M();function J(r){let n=document.createElement("hermes-skill-button");return n.options=r,n}function q(){if(typeof document>"u")return [];let r=[];return document.querySelectorAll("hermes-button").forEach(n=>{let t=n.getAttribute("command")||"",a=n.getAttribute("prompt-flag")!=="false"?`hermes -p "${t}"`:t;r.push({platform:"hermes",command:t,fullCommand:a});}),document.querySelectorAll("hermes-skill-button").forEach(n=>{let t=n.getAttribute("command")||"",e=n.getAttribute("skill-url")||void 0;r.push({platform:"hermes-skill",command:t,...e&&{skillUrl:e}});}),r}function U(){let r=q();return r.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:r.map(t=>{if(t.platform==="hermes")return {"@type":"Action",name:`Run on Hermes: ${t.command}`,description:t.command,target:{"@type":"EntryPoint",urlTemplate:`https://hermes.ai/run?command=${encodeURIComponent(t.fullCommand||t.command)}`,actionPlatform:"https://hermes.ai/run"},object:{"@type":"SoftwareSourceCode",runtimePlatform:"Hermes Agent",text:t.fullCommand||t.command}};let e={"@type":"EntryPoint",actionPlatform:"https://hermes.ai/skills"};t.skillUrl?e.urlTemplate=t.skillUrl:e.urlTemplate=`https://hermes.ai/skills?command=${encodeURIComponent(t.command)}`;let o={"@type":"Action",name:`Run on Hermes Skills: ${t.command}`,description:t.command,target:e};return t.skillUrl&&(o.object={"@type":"SoftwareApplication",name:t.command,downloadUrl:t.skillUrl,applicationCategory:"AI Skill",operatingSystem:"Hermes Agent"}),o})}}function Z(){if(typeof document>"u")return;let r=document.querySelector("script[data-hermesbuttons-jsonld]");r&&r.remove();let n=U();if(!n||!("potentialAction"in n))return;let t=document.createElement("script");t.type="application/ld+json",t.setAttribute("data-hermesbuttons-jsonld",""),t.textContent=JSON.stringify(n,null,2),document.head.appendChild(t);}function vt(){H(),M();}
|
|
920
|
+
exports.ALT_BRAND_COLOR=u;exports.BRAND_COLOR=i;exports.HERMES_ICON=w;exports.HERMES_SKILL_ICON=C;exports.HermesButton=F;exports.HermesPopupDialog=B;exports.HermesSkillButton=$;exports.createHermesButton=K;exports.createHermesSkillButton=J;exports.discoverButtons=q;exports.generateStructuredData=U;exports.injectStructuredData=Z;exports.register=vt;exports.registerHermesButton=H;exports.registerHermesSkillButton=M;exports.resolveTheme=b;exports.showPopup=E;exports.themes=_;//# sourceMappingURL=index.js.map
|
|
921
921
|
//# sourceMappingURL=index.js.map
|