hermesbuttons 1.1.2 → 1.1.3
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-GK6K44OK.mjs → chunk-5UWHHBVU.mjs} +28 -45
- package/dist/{chunk-GK6K44OK.mjs.map → chunk-5UWHHBVU.mjs.map} +1 -1
- package/dist/{hermes-button-RRJ6D2US.mjs → hermes-button-S6YLK72O.mjs} +2 -2
- package/dist/{hermes-skill-button-WZIOOH2O.mjs → hermes-skill-button-UHZHZUIU.mjs} +37 -37
- package/dist/hermes-skill-button-UHZHZUIU.mjs.map +1 -0
- package/dist/index.d.mts +0 -7
- package/dist/index.d.ts +0 -7
- package/dist/index.global.js +67 -84
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +82 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -99
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +0 -7
- package/dist/react.d.ts +0 -7
- package/dist/react.js +63 -80
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/vue.d.mts +0 -4
- package/dist/vue.d.ts +0 -4
- package/dist/vue.js +87 -104
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +71 -88
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/hermes-skill-button-WZIOOH2O.mjs.map +0 -1
- /package/dist/{hermes-button-RRJ6D2US.mjs.map → hermes-button-S6YLK72O.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var N="agentpreferences";function P(){return typeof document<"u"}function j(){if(!P())return null;let a=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${N}=`));if(!a)return null;let n=a.slice(N.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(r=>typeof r=="string"&&r.length>0)}}catch{return null}}function U(a){if(!P())return;let n=a.order.slice(0,24),t=JSON.stringify({order:n}),e=new Date;e.setFullYear(e.getFullYear()+1),document.cookie=`${N}=${encodeURIComponent(t)}; Path=/; SameSite=Lax; Expires=${e.toUTCString()}`;}function f(a){if(!a||typeof a!="string")return;let t=j()?.order.filter(e=>e!==a)??[];U({order:[a,...t]});}var y=`<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"/>
|
|
@@ -23,25 +23,25 @@
|
|
|
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>`,F=`<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
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
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 i="#2B8CFF",v="#1E7AEB",T="#186BD4",
|
|
34
|
-
--hb-bg: ${
|
|
35
|
-
--hb-text: ${
|
|
36
|
-
--hb-border: ${
|
|
37
|
-
--hb-surface: ${
|
|
38
|
-
--hb-surface-text: ${
|
|
39
|
-
--hb-muted: ${
|
|
40
|
-
--hb-primary: ${
|
|
41
|
-
--hb-primary-text: ${
|
|
42
|
-
--hb-code-bg: ${
|
|
43
|
-
--hb-code-text: ${
|
|
44
|
-
`}var
|
|
33
|
+
</svg>`;var i="#2B8CFF",v="#1E7AEB",T="#186BD4",d="43, 140, 255",m="#8FA3E8",$="#7B91DC",R="#6B82CC",c="143, 163, 232",w={branded:{bg:i,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:i,primaryText:"#FFFFFF",codeBg:"#0F172A",codeText:"#F1F5F9"},"branded-alt":{bg:m,text:"#FFFFFF",border:"transparent",surface:"#FFFFFF",surfaceText:"#0F172A",muted:"#64748B",primary:m,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(a){return a!=="system"?w[a]:typeof window>"u"?w.light:window.matchMedia("(prefers-color-scheme: dark)").matches?w.dark:w.light}function x(a){return `
|
|
34
|
+
--hb-bg: ${a.bg};
|
|
35
|
+
--hb-text: ${a.text};
|
|
36
|
+
--hb-border: ${a.border};
|
|
37
|
+
--hb-surface: ${a.surface};
|
|
38
|
+
--hb-surface-text: ${a.surfaceText};
|
|
39
|
+
--hb-muted: ${a.muted};
|
|
40
|
+
--hb-primary: ${a.primary};
|
|
41
|
+
--hb-primary-text: ${a.primaryText};
|
|
42
|
+
--hb-code-bg: ${a.codeBg};
|
|
43
|
+
--hb-code-text: ${a.codeText};
|
|
44
|
+
`}var S={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 W=`
|
|
45
45
|
:host {
|
|
46
46
|
position: fixed;
|
|
47
47
|
inset: 0;
|
|
@@ -318,13 +318,13 @@
|
|
|
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
|
-
`,
|
|
321
|
+
`,L=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"),r=b(t);return {...o,primary:r.primary,primaryText:r.primaryText}}render(){if(!this.shadowRoot||!this._options)return;let{variant:t,title:e,description:o,command:r,fullCommand:s}=this._options,l=this.resolvePopupTokens(),h=t==="hermes"?y:C,p=t==="hermes",u=s||r;this.shadowRoot.innerHTML=`
|
|
322
322
|
<style>${W}</style>
|
|
323
|
-
<div style="${x(
|
|
323
|
+
<div style="${x(l)}">
|
|
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">${h}</div>
|
|
328
328
|
<div class="hb-dialog-header-text">
|
|
329
329
|
<div class="hb-dialog-title" id="hb-dialog-title">${e}</div>
|
|
330
330
|
${o?`<div class="hb-dialog-description">${o}</div>`:""}
|
|
@@ -332,7 +332,7 @@
|
|
|
332
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(u):this.renderHermesSkillBody(r)}
|
|
336
336
|
</div>
|
|
337
337
|
<div class="hb-dialog-footer">
|
|
338
338
|
${p?`
|
|
@@ -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)}">${F}<span>Copy</span></button>
|
|
354
354
|
</div>
|
|
355
355
|
</div>
|
|
356
356
|
</div>
|
|
@@ -360,41 +360,24 @@
|
|
|
360
360
|
<div class="hb-step-label">Paste and run in your terminal</div>
|
|
361
361
|
</div>
|
|
362
362
|
</div>
|
|
363
|
-
`}renderHermesSkillBody(t
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
</div>
|
|
372
|
-
</div>
|
|
373
|
-
</div>
|
|
374
|
-
<div class="hb-step">
|
|
375
|
-
<div class="hb-step-num">2</div>
|
|
376
|
-
<div class="hb-step-content">
|
|
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
|
-
</div>
|
|
379
|
-
</div>
|
|
380
|
-
`;}else o+=`
|
|
381
|
-
<div class="hb-step">
|
|
382
|
-
<div class="hb-step-num">1</div>
|
|
383
|
-
<div class="hb-step-content">
|
|
384
|
-
<div class="hb-step-label">Copy this command to your clipboard</div>
|
|
385
|
-
<div class="hb-code-block">
|
|
386
|
-
<div class="hb-code-text">${this.escapeHtml(t)}</div>
|
|
387
|
-
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${A}<span>Copy</span></button>
|
|
388
|
-
</div>
|
|
363
|
+
`}renderHermesSkillBody(t){return `
|
|
364
|
+
<div class="hb-step">
|
|
365
|
+
<div class="hb-step-num">1</div>
|
|
366
|
+
<div class="hb-step-content">
|
|
367
|
+
<div class="hb-step-label">Copy this command to your clipboard</div>
|
|
368
|
+
<div class="hb-code-block">
|
|
369
|
+
<div class="hb-code-text">${this.escapeHtml(t)}</div>
|
|
370
|
+
<button class="hb-copy-btn" data-action="copy" data-command="${this.escapeAttr(t)}">${F}<span>Copy</span></button>
|
|
389
371
|
</div>
|
|
390
372
|
</div>
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
</div>
|
|
373
|
+
</div>
|
|
374
|
+
<div class="hb-step">
|
|
375
|
+
<div class="hb-step-num">2</div>
|
|
376
|
+
<div class="hb-step-content">
|
|
377
|
+
<div class="hb-step-label">Paste and send in your Hermes session</div>
|
|
396
378
|
</div>
|
|
397
|
-
|
|
379
|
+
</div>
|
|
380
|
+
`}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 r=e.dataset.command||"";this.copyToClipboard(r,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)"),r=()=>this.render();o.addEventListener("change",r),this._mqCleanup=()=>o.removeEventListener("change",r);}async copyToClipboard(t,e){try{await navigator.clipboard.writeText(t);let o=e.querySelector("span"),r=e;e.setAttribute("data-copied","true"),o&&(o.textContent="Copied!"),r.innerHTML=`${D}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{e.setAttribute("data-copied","false"),r.innerHTML=`${F}<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",L);function A(a){let n=document.createElement("hermes-popup-dialog");return n.options=a,document.body.appendChild(n),n}var G=`
|
|
398
381
|
:host {
|
|
399
382
|
display: inline-block;
|
|
400
383
|
vertical-align: middle;
|
|
@@ -440,18 +423,18 @@
|
|
|
440
423
|
}
|
|
441
424
|
:host([data-variant="filled"][data-theme="branded"]) .hb-btn:hover {
|
|
442
425
|
background: ${v};
|
|
443
|
-
box-shadow: 0 2px 8px rgba(${
|
|
426
|
+
box-shadow: 0 2px 8px rgba(${d}, 0.35);
|
|
444
427
|
}
|
|
445
428
|
:host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
|
|
446
429
|
background: ${T};
|
|
447
430
|
transform: scale(0.98);
|
|
448
431
|
}
|
|
449
432
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
450
|
-
background: ${
|
|
433
|
+
background: ${$};
|
|
451
434
|
box-shadow: 0 2px 8px rgba(${c}, 0.35);
|
|
452
435
|
}
|
|
453
436
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
|
|
454
|
-
background: ${
|
|
437
|
+
background: ${R};
|
|
455
438
|
transform: scale(0.98);
|
|
456
439
|
}
|
|
457
440
|
|
|
@@ -488,18 +471,18 @@
|
|
|
488
471
|
color: ${i};
|
|
489
472
|
}
|
|
490
473
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
|
|
491
|
-
background: rgba(${
|
|
492
|
-
box-shadow: 0 2px 8px rgba(${
|
|
474
|
+
background: rgba(${d}, 0.08);
|
|
475
|
+
box-shadow: 0 2px 8px rgba(${d}, 0.15);
|
|
493
476
|
}
|
|
494
477
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn:active {
|
|
495
|
-
background: rgba(${
|
|
478
|
+
background: rgba(${d}, 0.14);
|
|
496
479
|
transform: scale(0.98);
|
|
497
480
|
}
|
|
498
481
|
|
|
499
482
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn {
|
|
500
483
|
background: transparent;
|
|
501
|
-
border-color: ${
|
|
502
|
-
color: ${
|
|
484
|
+
border-color: ${m};
|
|
485
|
+
color: ${m};
|
|
503
486
|
}
|
|
504
487
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
505
488
|
background: rgba(${c}, 0.08);
|
|
@@ -517,10 +500,10 @@
|
|
|
517
500
|
}
|
|
518
501
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
|
|
519
502
|
border-color: ${i};
|
|
520
|
-
background: rgba(${
|
|
503
|
+
background: rgba(${d}, 0.08);
|
|
521
504
|
}
|
|
522
505
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
|
|
523
|
-
background: rgba(${
|
|
506
|
+
background: rgba(${d}, 0.14);
|
|
524
507
|
transform: scale(0.98);
|
|
525
508
|
}
|
|
526
509
|
|
|
@@ -531,10 +514,10 @@
|
|
|
531
514
|
}
|
|
532
515
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
|
|
533
516
|
border-color: ${i};
|
|
534
|
-
background: rgba(${
|
|
517
|
+
background: rgba(${d}, 0.05);
|
|
535
518
|
}
|
|
536
519
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
|
|
537
|
-
background: rgba(${
|
|
520
|
+
background: rgba(${d}, 0.1);
|
|
538
521
|
transform: scale(0.98);
|
|
539
522
|
}
|
|
540
523
|
|
|
@@ -549,15 +532,15 @@
|
|
|
549
532
|
color: ${i};
|
|
550
533
|
}
|
|
551
534
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
|
|
552
|
-
background: rgba(${
|
|
535
|
+
background: rgba(${d}, 0.1);
|
|
553
536
|
}
|
|
554
537
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn:active {
|
|
555
|
-
background: rgba(${
|
|
538
|
+
background: rgba(${d}, 0.16);
|
|
556
539
|
transform: scale(0.98);
|
|
557
540
|
}
|
|
558
541
|
|
|
559
542
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn {
|
|
560
|
-
color: ${
|
|
543
|
+
color: ${m};
|
|
561
544
|
}
|
|
562
545
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
563
546
|
background: rgba(${c}, 0.1);
|
|
@@ -631,31 +614,31 @@
|
|
|
631
614
|
.hb-btn-label {
|
|
632
615
|
letter-spacing: -0.01em;
|
|
633
616
|
}
|
|
634
|
-
`,
|
|
617
|
+
`,_=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"),r=this.getAttribute("variant"),s=this.getAttribute("shape"),l=this.getAttribute("popup"),h=this.getAttribute("prompt-flag"),p=this.getAttribute("popup-title"),u=this.getAttribute("popup-description");t!==null&&(this._options.command=t),e&&(this._options.theme=e),o&&(this._options.size=o),r&&(this._options.variant=r),s&&(this._options.shape=s),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.promptFlag=h!=="false"),p!==null&&(this._options.popupTitle=p),u!==null&&(this._options.popupDescription=u);}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",r=b(t),s=this._options.size||"md",l=this._options.shape||"rounded",h=O[s],p=S[l][s];this.setAttribute("data-theme",e),this.setAttribute("data-variant",o);let u=o!=="filled"?"transparent":r.bg,M=o==="ghost"?"transparent":o==="outline"?r.primary:r.border,z=o!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
|
|
635
618
|
<style>${G}</style>
|
|
636
619
|
<button
|
|
637
620
|
class="hb-btn"
|
|
638
621
|
type="button"
|
|
639
622
|
style="
|
|
640
|
-
${x(
|
|
641
|
-
--hb-bg: ${
|
|
642
|
-
--hb-border: ${
|
|
623
|
+
${x(r)}
|
|
624
|
+
--hb-bg: ${u};
|
|
625
|
+
--hb-border: ${M};
|
|
643
626
|
--hb-text: ${z};
|
|
644
|
-
--hb-accent-color: ${
|
|
645
|
-
--hb-focus-color: ${
|
|
627
|
+
--hb-accent-color: ${r.primary};
|
|
628
|
+
--hb-focus-color: ${r.primary};
|
|
646
629
|
--hb-height: ${h.height};
|
|
647
630
|
--hb-font-size: ${h.fontSize};
|
|
648
631
|
--hb-icon-size: ${h.iconSize};
|
|
649
632
|
--hb-padding: ${h.ccPadding};
|
|
650
633
|
--hb-gap: ${h.gap};
|
|
651
|
-
--hb-radius: ${
|
|
634
|
+
--hb-radius: ${p};
|
|
652
635
|
"
|
|
653
636
|
aria-label="Run on Hermes: ${this._options.command.replace(/"/g,""")}"
|
|
654
637
|
>
|
|
655
|
-
<span class="hb-btn-icon" aria-hidden="true">${
|
|
638
|
+
<span class="hb-btn-icon" aria-hidden="true">${y}</span>
|
|
656
639
|
<span class="hb-btn-label">Run on Hermes</span>
|
|
657
640
|
</button>
|
|
658
|
-
`;let
|
|
641
|
+
`;let k=this.shadowRoot.querySelector(".hb-btn");k.addEventListener("click",()=>this.handleClick()),k.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:r}=this._options,s=this.getFullCommand();if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:true,composed:true,detail:{command:e,fullCommand:s}})),t===false){navigator.clipboard.writeText(s).then(()=>{this._options.onCopy?.(s),f("hermes"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:true,composed:true,detail:{command:s}}));});return}A({variant:"hermes",theme:this.getResolvedTheme(),title:o||"Run on Hermes",description:r||"Execute this command in your terminal to get started with Hermes Agent.",command:e,fullCommand:s,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);}};_.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function B(a="hermes-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_);}B();function K(a){let n=document.createElement("hermes-button");return n.options=a,n}var Y=`
|
|
659
642
|
:host {
|
|
660
643
|
display: inline-block;
|
|
661
644
|
vertical-align: middle;
|
|
@@ -701,18 +684,18 @@
|
|
|
701
684
|
}
|
|
702
685
|
:host([data-variant="filled"][data-theme="branded"]) .hb-btn:hover {
|
|
703
686
|
background: ${v};
|
|
704
|
-
box-shadow: 0 2px 8px rgba(${
|
|
687
|
+
box-shadow: 0 2px 8px rgba(${d}, 0.35);
|
|
705
688
|
}
|
|
706
689
|
:host([data-variant="filled"][data-theme="branded"]) .hb-btn:active {
|
|
707
690
|
background: ${T};
|
|
708
691
|
transform: scale(0.98);
|
|
709
692
|
}
|
|
710
693
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
711
|
-
background: ${
|
|
694
|
+
background: ${$};
|
|
712
695
|
box-shadow: 0 2px 8px rgba(${c}, 0.35);
|
|
713
696
|
}
|
|
714
697
|
:host([data-variant="filled"][data-theme="branded-alt"]) .hb-btn:active {
|
|
715
|
-
background: ${
|
|
698
|
+
background: ${R};
|
|
716
699
|
transform: scale(0.98);
|
|
717
700
|
}
|
|
718
701
|
|
|
@@ -749,18 +732,18 @@
|
|
|
749
732
|
color: ${i};
|
|
750
733
|
}
|
|
751
734
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn:hover {
|
|
752
|
-
background: rgba(${
|
|
753
|
-
box-shadow: 0 2px 8px rgba(${
|
|
735
|
+
background: rgba(${d}, 0.08);
|
|
736
|
+
box-shadow: 0 2px 8px rgba(${d}, 0.15);
|
|
754
737
|
}
|
|
755
738
|
:host([data-variant="outline"][data-theme="branded"]) .hb-btn:active {
|
|
756
|
-
background: rgba(${
|
|
739
|
+
background: rgba(${d}, 0.14);
|
|
757
740
|
transform: scale(0.98);
|
|
758
741
|
}
|
|
759
742
|
|
|
760
743
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn {
|
|
761
744
|
background: transparent;
|
|
762
|
-
border-color: ${
|
|
763
|
-
color: ${
|
|
745
|
+
border-color: ${m};
|
|
746
|
+
color: ${m};
|
|
764
747
|
}
|
|
765
748
|
:host([data-variant="outline"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
766
749
|
background: rgba(${c}, 0.08);
|
|
@@ -778,10 +761,10 @@
|
|
|
778
761
|
}
|
|
779
762
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:hover {
|
|
780
763
|
border-color: ${i};
|
|
781
|
-
background: rgba(${
|
|
764
|
+
background: rgba(${d}, 0.08);
|
|
782
765
|
}
|
|
783
766
|
:host([data-variant="outline"][data-theme="dark"]) .hb-btn:active {
|
|
784
|
-
background: rgba(${
|
|
767
|
+
background: rgba(${d}, 0.14);
|
|
785
768
|
transform: scale(0.98);
|
|
786
769
|
}
|
|
787
770
|
|
|
@@ -792,10 +775,10 @@
|
|
|
792
775
|
}
|
|
793
776
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:hover {
|
|
794
777
|
border-color: ${i};
|
|
795
|
-
background: rgba(${
|
|
778
|
+
background: rgba(${d}, 0.05);
|
|
796
779
|
}
|
|
797
780
|
:host([data-variant="outline"][data-theme="light"]) .hb-btn:active {
|
|
798
|
-
background: rgba(${
|
|
781
|
+
background: rgba(${d}, 0.1);
|
|
799
782
|
transform: scale(0.98);
|
|
800
783
|
}
|
|
801
784
|
|
|
@@ -810,15 +793,15 @@
|
|
|
810
793
|
color: ${i};
|
|
811
794
|
}
|
|
812
795
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn:hover {
|
|
813
|
-
background: rgba(${
|
|
796
|
+
background: rgba(${d}, 0.1);
|
|
814
797
|
}
|
|
815
798
|
:host([data-variant="ghost"][data-theme="branded"]) .hb-btn:active {
|
|
816
|
-
background: rgba(${
|
|
799
|
+
background: rgba(${d}, 0.16);
|
|
817
800
|
transform: scale(0.98);
|
|
818
801
|
}
|
|
819
802
|
|
|
820
803
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn {
|
|
821
|
-
color: ${
|
|
804
|
+
color: ${m};
|
|
822
805
|
}
|
|
823
806
|
:host([data-variant="ghost"][data-theme="branded-alt"]) .hb-btn:hover {
|
|
824
807
|
background: rgba(${c}, 0.1);
|
|
@@ -892,30 +875,30 @@
|
|
|
892
875
|
.hb-btn-label {
|
|
893
876
|
letter-spacing: -0.01em;
|
|
894
877
|
}
|
|
895
|
-
|
|
878
|
+
`,E=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("theme"),o=this.getAttribute("size"),r=this.getAttribute("variant"),s=this.getAttribute("shape"),l=this.getAttribute("popup"),h=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),r&&(this._options.variant=r),s&&(this._options.shape=s),l!==null&&(this._options.popup=l!=="false"),h!==null&&(this._options.popupTitle=h),p!==null&&(this._options.popupDescription=p);}updateLightDOM(){let{command:t}=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 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),e.href=`https://hermes.ai/skills?command=${encodeURIComponent(t)}`;}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",r=b(t),s=this._options.size||"md",l=this._options.shape||"rounded",h=O[s],p=S[l][s];this.setAttribute("data-theme",e),this.setAttribute("data-variant",o);let u=o!=="filled"?"transparent":r.bg,M=o==="ghost"?"transparent":o==="outline"?r.primary:r.border,z=o!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
|
|
896
879
|
<style>${Y}</style>
|
|
897
880
|
<button
|
|
898
881
|
class="hb-btn"
|
|
899
882
|
type="button"
|
|
900
883
|
style="
|
|
901
|
-
${x(
|
|
902
|
-
--hb-bg: ${
|
|
903
|
-
--hb-border: ${
|
|
884
|
+
${x(r)}
|
|
885
|
+
--hb-bg: ${u};
|
|
886
|
+
--hb-border: ${M};
|
|
904
887
|
--hb-text: ${z};
|
|
905
|
-
--hb-accent-color: ${
|
|
906
|
-
--hb-focus-color: ${
|
|
888
|
+
--hb-accent-color: ${r.primary};
|
|
889
|
+
--hb-focus-color: ${r.primary};
|
|
907
890
|
--hb-height: ${h.height};
|
|
908
891
|
--hb-font-size: ${h.fontSize};
|
|
909
892
|
--hb-icon-size: ${h.iconSize};
|
|
910
893
|
--hb-padding: ${h.padding};
|
|
911
894
|
--hb-gap: ${h.gap};
|
|
912
|
-
--hb-radius: ${
|
|
895
|
+
--hb-radius: ${p};
|
|
913
896
|
"
|
|
914
897
|
aria-label="Run on Hermes Skills: ${this._options.command.replace(/"/g,""")}"
|
|
915
898
|
>
|
|
916
899
|
<span class="hb-btn-icon" aria-hidden="true">${C}</span>
|
|
917
900
|
<span class="hb-btn-label">Run on Hermes Skills</span>
|
|
918
901
|
</button>
|
|
919
|
-
`;let
|
|
920
|
-
exports.ALT_BRAND_COLOR=
|
|
902
|
+
`;let k=this.shadowRoot.querySelector(".hb-btn");k.addEventListener("click",()=>this.handleClick()),k.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:r}=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}A({variant:"hermes-skill",theme:this.getResolvedTheme(),title:o||"Run on Hermes Skills",description:r||"Copy and paste into a Hermes session to get started.",command:e,onCopy:s=>{this._options.onCopy?.(s),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:true,composed:true,detail:{command:s}}));},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);}};E.observedAttributes=["command","theme","size","variant","shape","popup","popup-title","popup-description"];function H(a="hermes-skill-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,E);}H();function J(a){let n=document.createElement("hermes-skill-button");return n.options=a,n}function q(){if(typeof document>"u")return [];let a=[];return document.querySelectorAll("hermes-button").forEach(n=>{let t=n.getAttribute("command")||"",r=n.getAttribute("prompt-flag")!=="false"?`hermes -p "${t}"`:t;a.push({platform:"hermes",command:t,fullCommand:r});}),document.querySelectorAll("hermes-skill-button").forEach(n=>{let t=n.getAttribute("command")||"";a.push({platform:"hermes-skill",command:t});}),a}function V(){let a=q();return a.length===0?{}:{"@context":"https://schema.org","@type":"WebPage",potentialAction:a.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",urlTemplate:`https://hermes.ai/skills?command=${encodeURIComponent(t.command)}`};return {"@type":"Action",name:`Run on Hermes Skills: ${t.command}`,description:t.command,target:e}})}}function Z(){if(typeof document>"u")return;let a=document.querySelector("script[data-hermesbuttons-jsonld]");a&&a.remove();let n=V();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(){B(),H();}
|
|
903
|
+
exports.ALT_BRAND_COLOR=m;exports.BRAND_COLOR=i;exports.HERMES_ICON=y;exports.HERMES_SKILL_ICON=C;exports.HermesButton=_;exports.HermesPopupDialog=L;exports.HermesSkillButton=E;exports.createHermesButton=K;exports.createHermesSkillButton=J;exports.discoverButtons=q;exports.generateStructuredData=V;exports.injectStructuredData=Z;exports.register=vt;exports.registerHermesButton=B;exports.registerHermesSkillButton=H;exports.resolveTheme=b;exports.showPopup=A;exports.themes=w;//# sourceMappingURL=index.js.map
|
|
921
904
|
//# sourceMappingURL=index.js.map
|