hermesbuttons 1.1.2 → 1.1.4
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 +70 -87
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +89 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +89 -106
- 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 +2 -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.d.mts
CHANGED
|
@@ -27,8 +27,6 @@ interface HermesButtonOptions {
|
|
|
27
27
|
interface HermesSkillButtonOptions {
|
|
28
28
|
/** The slash command to run in Hermes (e.g. "/research-assistant") */
|
|
29
29
|
command: string;
|
|
30
|
-
/** URL to a downloadable skill package (.zip, SKILL.md, or plugin.json) */
|
|
31
|
-
skillUrl?: string;
|
|
32
30
|
/** Theme variant. Default: 'branded' */
|
|
33
31
|
theme?: Theme;
|
|
34
32
|
/** Button size. Default: 'md' */
|
|
@@ -41,8 +39,6 @@ interface HermesSkillButtonOptions {
|
|
|
41
39
|
popup?: boolean;
|
|
42
40
|
/** Callback fired after the command is copied */
|
|
43
41
|
onCopy?: (command: string) => void;
|
|
44
|
-
/** Callback fired when the skill package is downloaded */
|
|
45
|
-
onDownload?: (url: string) => void;
|
|
46
42
|
/** Custom popup title */
|
|
47
43
|
popupTitle?: string;
|
|
48
44
|
/** Custom popup description */
|
|
@@ -55,7 +51,6 @@ interface PopupOptions {
|
|
|
55
51
|
description?: string;
|
|
56
52
|
command: string;
|
|
57
53
|
fullCommand?: string;
|
|
58
|
-
skillUrl?: string;
|
|
59
54
|
onCopy?: (command: string) => void;
|
|
60
55
|
onClose?: () => void;
|
|
61
56
|
}
|
|
@@ -156,7 +151,6 @@ interface ButtonMetadata {
|
|
|
156
151
|
platform: 'hermes' | 'hermes-skill';
|
|
157
152
|
command: string;
|
|
158
153
|
fullCommand?: string;
|
|
159
|
-
skillUrl?: string;
|
|
160
154
|
}
|
|
161
155
|
declare function discoverButtons(): ButtonMetadata[];
|
|
162
156
|
declare function generateStructuredData(): object;
|
|
@@ -184,7 +178,6 @@ interface HermesButtonAttributes {
|
|
|
184
178
|
|
|
185
179
|
interface HermesSkillButtonAttributes {
|
|
186
180
|
command?: string;
|
|
187
|
-
'skill-url'?: string;
|
|
188
181
|
theme?: Theme;
|
|
189
182
|
size?: Size;
|
|
190
183
|
variant?: Variant;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,8 +27,6 @@ interface HermesButtonOptions {
|
|
|
27
27
|
interface HermesSkillButtonOptions {
|
|
28
28
|
/** The slash command to run in Hermes (e.g. "/research-assistant") */
|
|
29
29
|
command: string;
|
|
30
|
-
/** URL to a downloadable skill package (.zip, SKILL.md, or plugin.json) */
|
|
31
|
-
skillUrl?: string;
|
|
32
30
|
/** Theme variant. Default: 'branded' */
|
|
33
31
|
theme?: Theme;
|
|
34
32
|
/** Button size. Default: 'md' */
|
|
@@ -41,8 +39,6 @@ interface HermesSkillButtonOptions {
|
|
|
41
39
|
popup?: boolean;
|
|
42
40
|
/** Callback fired after the command is copied */
|
|
43
41
|
onCopy?: (command: string) => void;
|
|
44
|
-
/** Callback fired when the skill package is downloaded */
|
|
45
|
-
onDownload?: (url: string) => void;
|
|
46
42
|
/** Custom popup title */
|
|
47
43
|
popupTitle?: string;
|
|
48
44
|
/** Custom popup description */
|
|
@@ -55,7 +51,6 @@ interface PopupOptions {
|
|
|
55
51
|
description?: string;
|
|
56
52
|
command: string;
|
|
57
53
|
fullCommand?: string;
|
|
58
|
-
skillUrl?: string;
|
|
59
54
|
onCopy?: (command: string) => void;
|
|
60
55
|
onClose?: () => void;
|
|
61
56
|
}
|
|
@@ -156,7 +151,6 @@ interface ButtonMetadata {
|
|
|
156
151
|
platform: 'hermes' | 'hermes-skill';
|
|
157
152
|
command: string;
|
|
158
153
|
fullCommand?: string;
|
|
159
|
-
skillUrl?: string;
|
|
160
154
|
}
|
|
161
155
|
declare function discoverButtons(): ButtonMetadata[];
|
|
162
156
|
declare function generateStructuredData(): object;
|
|
@@ -184,7 +178,6 @@ interface HermesButtonAttributes {
|
|
|
184
178
|
|
|
185
179
|
interface HermesSkillButtonAttributes {
|
|
186
180
|
command?: string;
|
|
187
|
-
'skill-url'?: string;
|
|
188
181
|
theme?: Theme;
|
|
189
182
|
size?: Size;
|
|
190
183
|
variant?: Variant;
|
package/dist/index.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var HermesButtons=(()=>{var
|
|
1
|
+
"use strict";var HermesButtons=(()=>{var z=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Q=(a,n)=>{for(var t in n)z(a,t,{get:n[t],enumerable:!0})},tt=(a,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Z(n))!X.call(a,o)&&o!==t&&z(a,o,{get:()=>n[o],enumerable:!(e=J(n,o))||e.enumerable});return a};var et=a=>tt(z({},"__esModule",{value:!0}),a);var ht={};Q(ht,{ALT_BRAND_COLOR:()=>m,BRAND_COLOR:()=>i,HERMES_ICON:()=>x,HERMES_SKILL_ICON:()=>k,HermesButton:()=>A,HermesPopupDialog:()=>F,HermesSkillButton:()=>_,createHermesButton:()=>U,createHermesSkillButton:()=>W,discoverButtons:()=>D,generateStructuredData:()=>I,injectStructuredData:()=>G,register:()=>dt,registerHermesButton:()=>T,registerHermesSkillButton:()=>$,resolveTheme:()=>p,showPopup:()=>C,themes:()=>y});var P="agentpreferences";function q(){return typeof document<"u"}function ot(){if(!q())return null;let a=document.cookie.split(";").map(t=>t.trim()).find(t=>t.startsWith(`${P}=`));if(!a)return null;let n=a.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(r=>typeof r=="string"&&r.length>0)}}catch{return null}}function at(a){if(!q())return;let n=a.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(a){if(!a||typeof a!="string")return;let t=ot()?.order.filter(e=>e!==a)??[];at({order:[a,...t]})}var x=`<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,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>`,R=`<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>`,V=`<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 j=`<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",
|
|
33
|
+
</svg>`;var i="#2B8CFF",v="#1E7AEB",S="#186BD4",d="43, 140, 255",m="#8FA3E8",O="#7B91DC",L="#6B82CC",c="143, 163, 232",y={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 p(a){return a!=="system"?y[a]:typeof window>"u"?y.light:window.matchMedia("(prefers-color-scheme: dark)").matches?y.dark:y.light}function w(a){return`
|
|
34
34
|
--hb-bg: ${a.bg};
|
|
35
35
|
--hb-text: ${a.text};
|
|
36
36
|
--hb-border: ${a.border};
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
--hb-primary-text: ${a.primaryText};
|
|
42
42
|
--hb-code-bg: ${a.codeBg};
|
|
43
43
|
--hb-code-text: ${a.codeText};
|
|
44
|
-
`}var
|
|
44
|
+
`}var B={rounded:{sm:"0.375rem",md:"0.5rem",lg:"0.625rem"},pill:{sm:"999px",md:"999px",lg:"999px"},square:{sm:"0",md:"0",lg:"0"}},H={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 rt=`
|
|
45
45
|
:host {
|
|
46
46
|
position: fixed;
|
|
47
47
|
inset: 0;
|
|
@@ -318,21 +318,21 @@
|
|
|
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="${w(
|
|
321
|
+
`,F=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 p(t);let e=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;if(t==="system")return e?p("dark"):p("light");let o=e?p("dark"):p("light"),r=p(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"?x:k,b=t==="hermes",u=s||r;this.shadowRoot.innerHTML=`
|
|
322
|
+
<style>${rt}</style>
|
|
323
|
+
<div style="${w(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
|
-
<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">${j}</button>
|
|
333
333
|
</div>
|
|
334
334
|
<div class="hb-dialog-body">
|
|
335
|
-
${b?this.renderHermesTerminalBody(
|
|
335
|
+
${b?this.renderHermesTerminalBody(u):this.renderHermesSkillBody(r)}
|
|
336
336
|
</div>
|
|
337
337
|
<div class="hb-dialog-footer">
|
|
338
338
|
${b?`
|
|
@@ -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)}">${R}<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 e+=`
|
|
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)}">${$}<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)}">${R}<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=`${V}<span>Copied!</span>`,this._options.onCopy?.(t),setTimeout(()=>{e.setAttribute("data-copied","false"),r.innerHTML=`${R}<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",F);function C(a){let n=document.createElement("hermes-popup-dialog");return n.options=a,document.body.appendChild(n),n}var nt=`
|
|
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
|
-
background: ${
|
|
429
|
+
background: ${S};
|
|
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: ${O};
|
|
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: ${L};
|
|
455
438
|
transform: scale(0.98);
|
|
456
439
|
}
|
|
457
440
|
|
|
@@ -488,11 +471,11 @@
|
|
|
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
|
|
|
@@ -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,10 +532,10 @@
|
|
|
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
|
|
|
@@ -631,16 +614,16 @@
|
|
|
631
614
|
.hb-btn-label {
|
|
632
615
|
letter-spacing: -0.01em;
|
|
633
616
|
}
|
|
634
|
-
`,A=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"),
|
|
635
|
-
<style>${
|
|
617
|
+
`,A=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"),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"),b=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"),b!==null&&(this._options.popupTitle=b),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!==!1?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===!1?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=p(t),s=this._options.size||"md",l=this._options.shape||"rounded",h=H[s],b=B[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,N=o!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
|
|
618
|
+
<style>${nt}</style>
|
|
636
619
|
<button
|
|
637
620
|
class="hb-btn"
|
|
638
621
|
type="button"
|
|
639
622
|
style="
|
|
640
623
|
${w(r)}
|
|
641
|
-
--hb-bg: ${
|
|
642
|
-
--hb-border: ${
|
|
643
|
-
--hb-text: ${
|
|
624
|
+
--hb-bg: ${u};
|
|
625
|
+
--hb-border: ${M};
|
|
626
|
+
--hb-text: ${N};
|
|
644
627
|
--hb-accent-color: ${r.primary};
|
|
645
628
|
--hb-focus-color: ${r.primary};
|
|
646
629
|
--hb-height: ${h.height};
|
|
@@ -648,14 +631,14 @@
|
|
|
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: ${b};
|
|
652
635
|
"
|
|
653
636
|
aria-label="Run on Hermes: ${this._options.command.replace(/"/g,""")}"
|
|
654
637
|
>
|
|
655
638
|
<span class="hb-btn-icon" aria-hidden="true">${x}</span>
|
|
656
639
|
<span class="hb-btn-label">Run on Hermes</span>
|
|
657
640
|
</button>
|
|
658
|
-
`;let
|
|
641
|
+
`;let E=this.shadowRoot.querySelector(".hb-btn");E.addEventListener("click",()=>this.handleClick()),E.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,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:!0,composed:!0,detail:{command:e,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}C({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:!0,composed:!0,detail:{command:l}}))},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)"),e=()=>this.render();t.addEventListener("change",e),this._mqCleanup=()=>t.removeEventListener("change",e)}};A.observedAttributes=["command","theme","size","variant","shape","popup","prompt-flag","popup-title","popup-description"];function T(a="hermes-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,A)}T();function U(a){let n=document.createElement("hermes-button");return n.options=a,n}var it=`
|
|
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
|
-
background: ${
|
|
690
|
+
background: ${S};
|
|
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: ${O};
|
|
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: ${L};
|
|
716
699
|
transform: scale(0.98);
|
|
717
700
|
}
|
|
718
701
|
|
|
@@ -749,11 +732,11 @@
|
|
|
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
|
|
|
@@ -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,10 +793,10 @@
|
|
|
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
|
|
|
@@ -892,16 +875,16 @@
|
|
|
892
875
|
.hb-btn-label {
|
|
893
876
|
letter-spacing: -0.01em;
|
|
894
877
|
}
|
|
895
|
-
`,_=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"),
|
|
896
|
-
<style>${
|
|
878
|
+
`,_=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"),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"),b=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),b!==null&&(this._options.popupDescription=b)}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!==!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),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=p(t),s=this._options.size||"md",l=this._options.shape||"rounded",h=H[s],b=B[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,N=o!=="filled"?r.primary:r.text;this.shadowRoot.innerHTML=`
|
|
879
|
+
<style>${it}</style>
|
|
897
880
|
<button
|
|
898
881
|
class="hb-btn"
|
|
899
882
|
type="button"
|
|
900
883
|
style="
|
|
901
884
|
${w(r)}
|
|
902
|
-
--hb-bg: ${
|
|
903
|
-
--hb-border: ${
|
|
904
|
-
--hb-text: ${
|
|
885
|
+
--hb-bg: ${u};
|
|
886
|
+
--hb-border: ${M};
|
|
887
|
+
--hb-text: ${N};
|
|
905
888
|
--hb-accent-color: ${r.primary};
|
|
906
889
|
--hb-focus-color: ${r.primary};
|
|
907
890
|
--hb-height: ${h.height};
|
|
@@ -909,12 +892,12 @@
|
|
|
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: ${b};
|
|
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">${k}</span>
|
|
917
900
|
<span class="hb-btn-label">Run on Hermes Skills</span>
|
|
918
901
|
</button>
|
|
919
|
-
`;let
|
|
902
|
+
`;let E=this.shadowRoot.querySelector(".hb-btn");E.addEventListener("click",()=>this.handleClick()),E.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),this.handleClick())}),this._rendered=!0,this.setupSystemThemeWatch()}handleClick(){let{popup:t,command:e,popupTitle:o,popupDescription:r}=this._options;if(this.dispatchEvent(new CustomEvent("hb-open",{bubbles:!0,composed:!0,detail:{command:e}})),t===!1){navigator.clipboard.writeText(e).then(()=>{this._options.onCopy?.(e),f("hermes-skill"),this.dispatchEvent(new CustomEvent("hb-copy",{bubbles:!0,composed:!0,detail:{command:e}}))});return}C({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:!0,composed:!0,detail:{command:s}}))},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)"),e=()=>this.render();t.addEventListener("change",e),this._mqCleanup=()=>t.removeEventListener("change",e)}};_.observedAttributes=["command","theme","size","variant","shape","popup","popup-title","popup-description"];function $(a="hermes-skill-button"){typeof customElements>"u"||customElements.get(a)||customElements.define(a,_)}$();function W(a){let n=document.createElement("hermes-skill-button");return n.options=a,n}function D(){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 I(){let a=D();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 G(){if(typeof document>"u")return;let a=document.querySelector("script[data-hermesbuttons-jsonld]");a&&a.remove();let n=I();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)}var K="https://hermesbuttons.vercel.app/api/ping",Y=!1;function st(){if(Y||typeof window>"u"||typeof navigator>"u")return;let a=window.location?.origin;if(!(!a||a==="null"||a.startsWith("file:"))){Y=!0;try{let n=JSON.stringify({origin:a}),t=new Blob([n],{type:"text/plain"});typeof navigator.sendBeacon=="function"?navigator.sendBeacon(K,t):fetch(K,{method:"POST",body:n,keepalive:!0}).catch(()=>{})}catch{}}}if(typeof window<"u")try{st()}catch{}function dt(){T(),$()}return et(ht);})();
|
|
920
903
|
//# sourceMappingURL=index.global.js.map
|