orb-ui 0.2.4 → 0.3.0
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/README.md +50 -10
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/livekit/index.d.ts +129 -0
- package/dist/adapters/types.d.ts +4 -8
- package/dist/adapters/vapi/index.d.ts +2 -2
- package/dist/adapters.cjs +1 -1
- package/dist/adapters.js +425 -73
- package/dist/components/Orb/Orb.d.ts +1 -1
- package/dist/components/Orb/Orb.types.d.ts +31 -10
- package/dist/components/Orb/index.d.ts +1 -1
- package/dist/components/Orb/signals.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/orb-ui.cjs +2 -2
- package/dist/orb-ui.js +126 -147
- package/package.json +7 -4
package/dist/orb-ui.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime");function n(e){
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime");function n(e,t,n){return e??t?.state??n.state}function r(e,t,n){return e===void 0?t===`listening`?n.inputVolume??n.volume??0:t===`speaking`?n.outputVolume??n.volume??0:n.volume??0:e}function i(e,t){let n={state:`idle`},r=t=>{n=t,e(t)},i=(e=>{r(e)});return i.onStateChange=e=>{t(),r({...n,state:e})},i.onVolumeChange=e=>{t(),r({...n,volume:e})},i}var a=[`idle`,`connecting`,`listening`,`thinking`,`speaking`,`error`],o={idle:`#888`,connecting:`#f0c040`,listening:`#40c0f0`,thinking:`#c084fc`,speaking:`#40f080`,error:`#f04040`};function s({state:e,volume:n,size:r,className:i,style:s,disabled:c=!1,onStart:l,onStop:u,...d}){return(0,t.jsxs)(`div`,{...d,className:i,style:{width:r,fontFamily:`monospace`,fontSize:12,background:`#111`,color:`#ccc`,border:`1px solid #333`,borderRadius:8,padding:12,boxSizing:`border-box`,userSelect:`none`,...s},children:[(0,t.jsx)(`div`,{style:{color:`#555`,marginBottom:10,fontSize:10,letterSpacing:1},children:`ORB DEBUG`}),(0,t.jsxs)(`div`,{style:{marginBottom:8},children:[(0,t.jsx)(`span`,{style:{color:`#555`},children:`state `}),(0,t.jsx)(`span`,{style:{color:o[e],fontWeight:`bold`},children:e})]}),(0,t.jsxs)(`div`,{style:{marginBottom:10},children:[(0,t.jsx)(`span`,{style:{color:`#555`},children:`volume `}),(0,t.jsx)(`span`,{style:{color:`#ccc`},children:n.toFixed(2)}),(0,t.jsx)(`div`,{style:{marginTop:4,height:4,background:`#222`,borderRadius:2,overflow:`hidden`},children:(0,t.jsx)(`div`,{style:{height:`100%`,width:`${n*100}%`,background:o[e],borderRadius:2,transition:`width 50ms linear`}})})]}),(0,t.jsxs)(`div`,{style:{marginBottom:10},children:[(0,t.jsx)(`div`,{style:{color:`#555`,marginBottom:4,fontSize:10},children:`force state`}),(0,t.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:4},children:a.map(n=>(0,t.jsx)(`button`,{disabled:c,style:{fontSize:10,padding:`2px 6px`,background:e===n?o[n]:`#222`,color:e===n?`#000`:`#888`,border:`1px solid ${e===n?o[n]:`#333`}`,borderRadius:3,cursor:c?`not-allowed`:`pointer`},onClick:()=>{console.warn(`[orb-ui debug] To force state '${n}', use controlled mode: <Orb state="${n}" />`)},children:n},n))})]}),(0,t.jsxs)(`div`,{style:{display:`flex`,gap:6},children:[(0,t.jsx)(`button`,{disabled:c,onClick:l,style:{flex:1,padding:`4px 0`,background:`#1a3a1a`,color:`#40f080`,border:`1px solid #40f080`,borderRadius:4,cursor:c?`not-allowed`:`pointer`,fontSize:11},children:`Start`}),(0,t.jsx)(`button`,{disabled:c,onClick:u,style:{flex:1,padding:`4px 0`,background:`#3a1a1a`,color:`#f04040`,border:`1px solid #f04040`,borderRadius:4,cursor:c?`not-allowed`:`pointer`,fontSize:11},children:`Stop`})]})]})}var c=typeof window<`u`?e.useLayoutEffect:e.useEffect;function l(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}var u={idle:`#cccccc`,connecting:`#cccccc`,listening:`#999999`,thinking:`#d8d8d8`,speaking:`#e8e8e8`,error:`#f87171`},d=`
|
|
2
2
|
@keyframes orb-circle-idle-pulse {
|
|
3
3
|
from { transform: scale(1); }
|
|
4
4
|
to { transform: scale(1.06); }
|
|
@@ -8,4 +8,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
|
|
|
8
8
|
50% { opacity: 0.6; transform: scale(0.95); }
|
|
9
9
|
100% { opacity: 1; transform: scale(1); }
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,f=.95,p=.08,m=.82,h=.18,g=24,_=0,v=.55,y=.12,b=.002;function x({state:n,volume:r,size:i,className:a,style:o,disabled:s=!1,interactive:x=!1,onClick:S,...C}){let w=(0,e.useRef)(null),T=(0,e.useRef)(null),E=(0,e.useRef)(null),D=(0,e.useRef)(0),O=(0,e.useRef)(r);c(()=>{O.current=r},[r]);let k=(0,e.useRef)(1),A=(0,e.useRef)(0),j=(0,e.useRef)(l(u.idle)),M=.06,N=(0,e.useRef)(m),P=(0,e.useRef)(h);(0,e.useEffect)(()=>{let e=`orb-circle-keyframes`;if(!document.getElementById(e)){let t=document.createElement(`style`);t.id=e,t.textContent=d,document.head.appendChild(t)}},[]),(0,e.useEffect)(()=>{let e=w.current;if(e)if(n===`listening`||n===`speaking`){let t=n===`speaking`?f:m,r=n===`speaking`?p:h,i=n===`speaking`?g:_,a=()=>{let o=O.current;N.current+=(t-N.current)*M,P.current+=(r-P.current)*M;let s=N.current+o*P.current,c=o*i;n===`listening`?(k.current+=(s-k.current)*v,A.current+=(c-A.current)*v):(k.current=s,A.current=c);let d=l(u[n]),[f,p,m]=j.current;j.current=[f+(d[0]-f)*.05,p+(d[1]-p)*.05,m+(d[2]-m)*.05];let[h,g,_]=j.current.map(Math.round);e.style.transform=`scale(${k.current})`,e.style.background=`rgb(${h},${g},${_})`,e.style.boxShadow=`none`,e.style.animation=`none`;let y=T.current;if(y){let e=A.current;y.style.transform=`scale(${k.current})`,y.style.boxShadow=e>.5?`0 0 ${e}px ${e*.4}px rgb(${h},${g},${_})`:`none`}D.current=requestAnimationFrame(a)};return D.current=requestAnimationFrame(a),()=>{cancelAnimationFrame(D.current)}}else{cancelAnimationFrame(D.current);let t=u[n]??u.idle,r=l(t),i=()=>{k.current+=(1-k.current)*y,A.current+=(0-A.current)*y;let[a,o,s]=j.current;j.current=[a+(r[0]-a)*y,o+(r[1]-o)*y,s+(r[2]-s)*y];let[c,l,u]=j.current.map(Math.round);e.style.transform=`scale(${k.current})`,e.style.background=`rgb(${c},${l},${u})`,e.style.boxShadow=`none`,e.style.animation=`none`,T.current&&(T.current.style.transform=`scale(${k.current})`,T.current.style.boxShadow=`none`);let d=Math.abs(k.current-1)<b,f=A.current<.1,p=j.current.every((e,t)=>Math.abs(e-r[t])<1);if(d&&f&&p){k.current=1,A.current=0,j.current=r,e.style.transform=``,e.style.boxShadow=`none`,e.style.background=t,T.current&&(T.current.style.transform=`scale(1)`,T.current.style.boxShadow=`none`),n===`idle`?e.style.animation=`orb-circle-idle-pulse 3s ease-in-out infinite alternate`:n===`connecting`||n===`thinking`?e.style.animation=`orb-circle-connecting-pulse 1.5s ease-in-out infinite`:e.style.animation=`none`;return}D.current=requestAnimationFrame(i)};return D.current=requestAnimationFrame(i),()=>cancelAnimationFrame(D.current)}},[n]);let F=i*.55,I={width:i,height:i,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,...o},L=(0,t.jsxs)(`span`,{ref:E,onMouseEnter:()=>{E.current&&!s&&(E.current.style.transform=`scale(1.06)`,E.current.style.filter=`brightness(1.12)`)},onMouseLeave:()=>{E.current&&(E.current.style.transform=`scale(1)`,E.current.style.filter=`brightness(1)`)},onTouchEnd:()=>{setTimeout(()=>{E.current&&(E.current.style.transform=`scale(1)`,E.current.style.filter=`brightness(1)`)},200)},style:{position:`relative`,display:`inline-block`,transition:`transform 0.3s ease, filter 0.3s ease`,cursor:x?s?`not-allowed`:`pointer`:`default`,borderRadius:`50%`,lineHeight:0},children:[(0,t.jsx)(`span`,{ref:T,style:{position:`absolute`,display:`block`,width:F,height:F,borderRadius:`50%`,pointerEvents:`none`}}),(0,t.jsx)(`span`,{ref:w,style:{position:`relative`,display:`block`,width:F,height:F,borderRadius:`50%`,background:u[n]}})]});return x?(0,t.jsx)(`button`,{...C,type:`button`,className:a,disabled:s,onClick:s?void 0:S,style:{appearance:`none`,WebkitAppearance:`none`,border:0,padding:0,margin:0,background:`transparent`,color:`inherit`,font:`inherit`,cursor:s?`not-allowed`:`pointer`,...I},children:L}):(0,t.jsx)(`div`,{...C,className:a,style:I,children:L})}var S=5,C=1.4,w=Math.PI*2/S,T={idle:`#cccccc`,connecting:`#cccccc`,listening:`#999999`,thinking:`#d8d8d8`,speaking:`#e8e8e8`,error:`#f87171`};function E(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function D({state:n,volume:r,size:i,className:a,style:o,disabled:s=!1,interactive:c=!1,onClick:l,...u}){let d=(0,e.useRef)([]),f=(0,e.useRef)(null),p=(0,e.useRef)(0),m=(0,e.useRef)(Array(S).fill(0)),h=(0,e.useRef)(r),g=(0,e.useRef)(!1),_=(0,e.useRef)(0),v=(0,e.useRef)(E(T.idle)),y=(0,e.useRef)(null),b=(0,e.useRef)(Array(S).fill(0)),x=(0,e.useRef)(n);(0,e.useEffect)(()=>{n!==x.current&&(b.current=[...m.current],y.current=Date.now(),x.current=n)},[n]),(0,e.useEffect)(()=>{h.current=r},[r]),(0,e.useEffect)(()=>{let e=i*.55,t=i*.06,r=T[n]??T.idle,a=i*.1,o=Array.from({length:S},(e,t)=>{let n=(S-1)/2;return 1-.7*(Math.abs(t-n)/n)}),s=()=>{let e=g.current?a:0;_.current+=(e-_.current)*.15},c=(t,r)=>{s();let i=E(r),[a,c,l]=v.current;v.current=[a+(i[0]-a)*.08,c+(i[1]-c)*.08,l+(i[2]-l)*.08];let[u,f,p]=v.current.map(Math.round),m=`rgb(${u},${f},${p})`;for(let r=0;r<S;r++){let i=d.current[r];if(!i)continue;let a=n===`idle`?o[r]:1,s=_.current*a;i.style.height=`${Math.min(t[r]+s,e)}px`,i.style.background=m,i.style.animation=`none`}};if(n===`listening`||n===`speaking`){let i=n===`speaking`?1:.4,a=()=>{let o=h.current,s=Date.now()/1e3;for(let r=0;r<S;r++){let a=.5+.15*Math.sin(s*C*i*Math.PI*2+r*w),c=t+(e-t)*o*a;if(y.current!==null){let e=Date.now()-y.current,t=Math.min(e/300,1),n=1-(1-t)*(1-t);c=b.current[r]+(c-b.current[r])*n,t>=1&&(y.current=null)}let l=n===`listening`?.45:1;m.current[r]+=(c-m.current[r])*l}c(m.current,r),p.current=requestAnimationFrame(a)};return p.current=requestAnimationFrame(a),()=>cancelAnimationFrame(p.current)}if(n===`connecting`||n===`thinking`){let n=Date.now(),i=()=>{let a=(Date.now()-n)/1e3;s();for(let n=0;n<S;n++){let r=(a*.6+n/S*.5)%1,i=r<.5?Math.sin(r/.5*Math.PI):0,o=t+(e*.4-t)*i;m.current[n]+=(o-m.current[n])*.15}c(m.current,r),p.current=requestAnimationFrame(i)};return p.current=requestAnimationFrame(i),()=>cancelAnimationFrame(p.current)}cancelAnimationFrame(p.current);let l=()=>{s();for(let e=0;e<S;e++)m.current[e]+=(t-m.current[e])*.16;c(m.current,r),p.current=requestAnimationFrame(l)};return p.current=requestAnimationFrame(l),()=>cancelAnimationFrame(p.current)},[n,i]);let D=i*.055,O=i*.035,k=i*.03,A=i*.55,j=i*.06,M={width:i,height:i,display:`flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,...o},N=(0,t.jsx)(`span`,{ref:f,onMouseEnter:()=>{s||(g.current=!0,f.current&&(f.current.style.filter=`brightness(1.35)`))},onMouseLeave:()=>{g.current=!1,f.current&&(f.current.style.filter=`brightness(1)`)},onTouchEnd:()=>{setTimeout(()=>{g.current=!1,f.current&&(f.current.style.filter=`brightness(1)`)},200)},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:O,transition:`filter 0.3s ease`,cursor:c?s?`not-allowed`:`pointer`:`default`},children:Array.from({length:S},(e,r)=>(0,t.jsx)(`span`,{ref:e=>{d.current[r]=e},style:{width:D,minHeight:j,maxHeight:A,height:j,borderRadius:k,background:T[n]??T.idle}},r))});return c?(0,t.jsx)(`button`,{...u,type:`button`,className:a,disabled:s,onClick:s?void 0:l,style:{appearance:`none`,WebkitAppearance:`none`,border:0,padding:0,margin:0,background:`transparent`,color:`inherit`,font:`inherit`,cursor:s?`not-allowed`:`pointer`,...M},children:N}):(0,t.jsx)(`div`,{...u,className:a,style:M,children:N})}var O=!1;function k(){return globalThis.process?.env?.NODE_ENV===`production`}function A(){O||k()||(O=!0,console.warn(`[orb-ui] Callback-object adapters are deprecated. Use subscribe(listener) and emit OrbSignal objects instead. Legacy adapters will be removed in 0.5.0.`))}function j({signal:a,state:o,volume:c,adapter:l,theme:u=`debug`,size:d=200,className:f,style:p,disabled:m=!1,onStart:h,onStop:g,..._}){let[v,y]=(0,e.useState)({state:`idle`});(0,e.useEffect)(()=>{if(y({state:`idle`}),!l)return;let e=i(y,A);return l.subscribe(e)},[l]);let b=a??v,S=n(o,a,v),C=r(c,S,b),w=S!==`idle`&&S!==`error`,T=(0,e.useCallback)(()=>{m||(w?g?g():l?.stop?.():h?h():l?.start?.())},[l,m,w,h,g]),E=w?!!(l?.stop||g):!!(l?.start||h),O=E&&!m?T:void 0,k={state:S,volume:C,size:d,className:f,style:p,disabled:m,..._,"aria-label":_[`aria-label`]??(E?`${w?`Stop`:`Start`} voice session`:void 0)},j={...k,interactive:E};switch(u){case`circle`:return(0,t.jsx)(x,{...j,onClick:O});case`bars`:return(0,t.jsx)(D,{...j,onClick:O});default:return(0,t.jsx)(s,{...k,onStart:m?void 0:h??(()=>l?.start?.()),onStop:m?void 0:g??(()=>l?.stop?.())})}}exports.Orb=j,exports.VoiceOrb=j;
|
package/dist/orb-ui.js
CHANGED
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
2
2
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
|
-
//#region src/
|
|
4
|
-
function s(e) {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
//#region src/components/Orb/signals.ts
|
|
4
|
+
function s(e, t, n) {
|
|
5
|
+
return e ?? t?.state ?? n.state;
|
|
6
|
+
}
|
|
7
|
+
function c(e, t, n) {
|
|
8
|
+
return e === void 0 ? t === "listening" ? n.inputVolume ?? n.volume ?? 0 : t === "speaking" ? n.outputVolume ?? n.volume ?? 0 : n.volume ?? 0 : e;
|
|
9
|
+
}
|
|
10
|
+
function l(e, t) {
|
|
11
|
+
let n = { state: "idle" }, r = (t) => {
|
|
12
|
+
n = t, e(t);
|
|
13
|
+
}, i = ((e) => {
|
|
14
|
+
r(e);
|
|
15
|
+
});
|
|
16
|
+
return i.onStateChange = (e) => {
|
|
17
|
+
t(), r({
|
|
18
|
+
...n,
|
|
19
|
+
state: e
|
|
20
|
+
});
|
|
21
|
+
}, i.onVolumeChange = (e) => {
|
|
22
|
+
t(), r({
|
|
23
|
+
...n,
|
|
24
|
+
volume: e
|
|
25
|
+
});
|
|
26
|
+
}, i;
|
|
7
27
|
}
|
|
8
28
|
//#endregion
|
|
9
29
|
//#region src/themes/debug/DebugTheme.tsx
|
|
10
|
-
var
|
|
30
|
+
var u = [
|
|
11
31
|
"idle",
|
|
12
32
|
"connecting",
|
|
13
33
|
"listening",
|
|
34
|
+
"thinking",
|
|
14
35
|
"speaking",
|
|
15
36
|
"error"
|
|
16
|
-
],
|
|
37
|
+
], d = {
|
|
17
38
|
idle: "#888",
|
|
18
39
|
connecting: "#f0c040",
|
|
19
40
|
listening: "#40c0f0",
|
|
41
|
+
thinking: "#c084fc",
|
|
20
42
|
speaking: "#40f080",
|
|
21
43
|
error: "#f04040"
|
|
22
44
|
};
|
|
23
|
-
function
|
|
45
|
+
function f({ state: e, volume: t, size: n, className: r, style: i, disabled: s = !1, onStart: c, onStop: l, ...f }) {
|
|
24
46
|
return /* @__PURE__ */ o("div", {
|
|
25
47
|
...f,
|
|
26
48
|
className: r,
|
|
@@ -54,7 +76,7 @@ function u({ state: e, volume: t, size: n, className: r, style: i, disabled: s =
|
|
|
54
76
|
children: "state "
|
|
55
77
|
}), /* @__PURE__ */ a("span", {
|
|
56
78
|
style: {
|
|
57
|
-
color:
|
|
79
|
+
color: d[e],
|
|
58
80
|
fontWeight: "bold"
|
|
59
81
|
},
|
|
60
82
|
children: e
|
|
@@ -82,7 +104,7 @@ function u({ state: e, volume: t, size: n, className: r, style: i, disabled: s =
|
|
|
82
104
|
children: /* @__PURE__ */ a("div", { style: {
|
|
83
105
|
height: "100%",
|
|
84
106
|
width: `${t * 100}%`,
|
|
85
|
-
background:
|
|
107
|
+
background: d[e],
|
|
86
108
|
borderRadius: 2,
|
|
87
109
|
transition: "width 50ms linear"
|
|
88
110
|
} })
|
|
@@ -104,14 +126,14 @@ function u({ state: e, volume: t, size: n, className: r, style: i, disabled: s =
|
|
|
104
126
|
flexWrap: "wrap",
|
|
105
127
|
gap: 4
|
|
106
128
|
},
|
|
107
|
-
children:
|
|
129
|
+
children: u.map((t) => /* @__PURE__ */ a("button", {
|
|
108
130
|
disabled: s,
|
|
109
131
|
style: {
|
|
110
132
|
fontSize: 10,
|
|
111
133
|
padding: "2px 6px",
|
|
112
|
-
background: e === t ?
|
|
134
|
+
background: e === t ? d[t] : "#222",
|
|
113
135
|
color: e === t ? "#000" : "#888",
|
|
114
|
-
border: `1px solid ${e === t ?
|
|
136
|
+
border: `1px solid ${e === t ? d[t] : "#333"}`,
|
|
115
137
|
borderRadius: 3,
|
|
116
138
|
cursor: s ? "not-allowed" : "pointer"
|
|
117
139
|
},
|
|
@@ -129,7 +151,7 @@ function u({ state: e, volume: t, size: n, className: r, style: i, disabled: s =
|
|
|
129
151
|
},
|
|
130
152
|
children: [/* @__PURE__ */ a("button", {
|
|
131
153
|
disabled: s,
|
|
132
|
-
onClick:
|
|
154
|
+
onClick: c,
|
|
133
155
|
style: {
|
|
134
156
|
flex: 1,
|
|
135
157
|
padding: "4px 0",
|
|
@@ -143,7 +165,7 @@ function u({ state: e, volume: t, size: n, className: r, style: i, disabled: s =
|
|
|
143
165
|
children: "Start"
|
|
144
166
|
}), /* @__PURE__ */ a("button", {
|
|
145
167
|
disabled: s,
|
|
146
|
-
onClick:
|
|
168
|
+
onClick: l,
|
|
147
169
|
style: {
|
|
148
170
|
flex: 1,
|
|
149
171
|
padding: "4px 0",
|
|
@@ -162,53 +184,54 @@ function u({ state: e, volume: t, size: n, className: r, style: i, disabled: s =
|
|
|
162
184
|
}
|
|
163
185
|
//#endregion
|
|
164
186
|
//#region src/themes/circle/CircleTheme.tsx
|
|
165
|
-
var
|
|
166
|
-
function
|
|
187
|
+
var p = typeof window < "u" ? n : t;
|
|
188
|
+
function m(e) {
|
|
167
189
|
return [
|
|
168
190
|
parseInt(e.slice(1, 3), 16),
|
|
169
191
|
parseInt(e.slice(3, 5), 16),
|
|
170
192
|
parseInt(e.slice(5, 7), 16)
|
|
171
193
|
];
|
|
172
194
|
}
|
|
173
|
-
var
|
|
195
|
+
var h = {
|
|
174
196
|
idle: "#cccccc",
|
|
175
197
|
connecting: "#cccccc",
|
|
176
198
|
listening: "#999999",
|
|
199
|
+
thinking: "#d8d8d8",
|
|
177
200
|
speaking: "#e8e8e8",
|
|
178
201
|
error: "#f87171"
|
|
179
|
-
},
|
|
180
|
-
function
|
|
202
|
+
}, g = "\n@keyframes orb-circle-idle-pulse {\n from { transform: scale(1); }\n to { transform: scale(1.06); }\n}\n@keyframes orb-circle-connecting-pulse {\n 0% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.6; transform: scale(0.95); }\n 100% { opacity: 1; transform: scale(1); }\n}\n", _ = .95, v = .08, y = .82, b = .18, x = 24, S = 0, C = .55, w = .12, T = .002;
|
|
203
|
+
function E({ state: e, volume: n, size: i, className: s, style: c, disabled: l = !1, interactive: u = !1, onClick: d, ...f }) {
|
|
181
204
|
let E = r(null), D = r(null), O = r(null), k = r(0), A = r(n);
|
|
182
|
-
|
|
205
|
+
p(() => {
|
|
183
206
|
A.current = n;
|
|
184
207
|
}, [n]);
|
|
185
|
-
let j = r(1), M = r(0), N = r(
|
|
208
|
+
let j = r(1), M = r(0), N = r(m(h.idle)), P = .06, F = r(y), I = r(b);
|
|
186
209
|
t(() => {
|
|
187
210
|
let e = "orb-circle-keyframes";
|
|
188
211
|
if (!document.getElementById(e)) {
|
|
189
212
|
let t = document.createElement("style");
|
|
190
|
-
t.id = e, t.textContent =
|
|
213
|
+
t.id = e, t.textContent = g, document.head.appendChild(t);
|
|
191
214
|
}
|
|
192
215
|
}, []), t(() => {
|
|
193
216
|
let t = E.current;
|
|
194
217
|
if (t) if (e === "listening" || e === "speaking") {
|
|
195
|
-
let n = e === "speaking" ?
|
|
218
|
+
let n = e === "speaking" ? _ : y, r = e === "speaking" ? v : b, i = e === "speaking" ? x : S, a = () => {
|
|
196
219
|
let o = A.current;
|
|
197
220
|
F.current += (n - F.current) * P, I.current += (r - I.current) * P;
|
|
198
221
|
let s = F.current + o * I.current, c = o * i;
|
|
199
|
-
e === "listening" ? (j.current += (s - j.current) *
|
|
200
|
-
let l =
|
|
222
|
+
e === "listening" ? (j.current += (s - j.current) * C, M.current += (c - M.current) * C) : (j.current = s, M.current = c);
|
|
223
|
+
let l = m(h[e]), [u, d, f] = N.current;
|
|
201
224
|
N.current = [
|
|
202
225
|
u + (l[0] - u) * .05,
|
|
203
226
|
d + (l[1] - d) * .05,
|
|
204
|
-
|
|
227
|
+
f + (l[2] - f) * .05
|
|
205
228
|
];
|
|
206
|
-
let [
|
|
207
|
-
t.style.transform = `scale(${j.current})`, t.style.background = `rgb(${
|
|
229
|
+
let [p, g, _] = N.current.map(Math.round);
|
|
230
|
+
t.style.transform = `scale(${j.current})`, t.style.background = `rgb(${p},${g},${_})`, t.style.boxShadow = "none", t.style.animation = "none";
|
|
208
231
|
let v = D.current;
|
|
209
232
|
if (v) {
|
|
210
233
|
let e = M.current;
|
|
211
|
-
v.style.transform = `scale(${j.current})`, v.style.boxShadow = e > .5 ? `0 0 ${e}px ${e * .4}px rgb(${
|
|
234
|
+
v.style.transform = `scale(${j.current})`, v.style.boxShadow = e > .5 ? `0 0 ${e}px ${e * .4}px rgb(${p},${g},${_})` : "none";
|
|
212
235
|
}
|
|
213
236
|
k.current = requestAnimationFrame(a);
|
|
214
237
|
};
|
|
@@ -217,19 +240,19 @@ function w({ state: e, volume: n, size: i, className: s, style: c, disabled: l =
|
|
|
217
240
|
};
|
|
218
241
|
} else {
|
|
219
242
|
cancelAnimationFrame(k.current);
|
|
220
|
-
let n =
|
|
221
|
-
j.current += (1 - j.current) *
|
|
243
|
+
let n = h[e] ?? h.idle, r = m(n), i = () => {
|
|
244
|
+
j.current += (1 - j.current) * w, M.current += (0 - M.current) * w;
|
|
222
245
|
let [a, o, s] = N.current;
|
|
223
246
|
N.current = [
|
|
224
|
-
a + (r[0] - a) *
|
|
225
|
-
o + (r[1] - o) *
|
|
226
|
-
s + (r[2] - s) *
|
|
247
|
+
a + (r[0] - a) * w,
|
|
248
|
+
o + (r[1] - o) * w,
|
|
249
|
+
s + (r[2] - s) * w
|
|
227
250
|
];
|
|
228
251
|
let [c, l, u] = N.current.map(Math.round);
|
|
229
252
|
t.style.transform = `scale(${j.current})`, t.style.background = `rgb(${c},${l},${u})`, t.style.boxShadow = "none", t.style.animation = "none", D.current && (D.current.style.transform = `scale(${j.current})`, D.current.style.boxShadow = "none");
|
|
230
|
-
let d = Math.abs(j.current - 1) <
|
|
253
|
+
let d = Math.abs(j.current - 1) < T, f = M.current < .1, p = N.current.every((e, t) => Math.abs(e - r[t]) < 1);
|
|
231
254
|
if (d && f && p) {
|
|
232
|
-
j.current = 1, M.current = 0, N.current = r, t.style.transform = "", t.style.boxShadow = "none", t.style.background = n, D.current && (D.current.style.transform = "scale(1)", D.current.style.boxShadow = "none"), e === "idle" ? t.style.animation = "orb-circle-idle-pulse 3s ease-in-out infinite alternate" : e === "connecting" ? t.style.animation = "orb-circle-connecting-pulse 1.5s ease-in-out infinite" : t.style.animation = "none";
|
|
255
|
+
j.current = 1, M.current = 0, N.current = r, t.style.transform = "", t.style.boxShadow = "none", t.style.background = n, D.current && (D.current.style.transform = "scale(1)", D.current.style.boxShadow = "none"), e === "idle" ? t.style.animation = "orb-circle-idle-pulse 3s ease-in-out infinite alternate" : e === "connecting" || e === "thinking" ? t.style.animation = "orb-circle-connecting-pulse 1.5s ease-in-out infinite" : t.style.animation = "none";
|
|
233
256
|
return;
|
|
234
257
|
}
|
|
235
258
|
k.current = requestAnimationFrame(i);
|
|
@@ -284,16 +307,16 @@ function w({ state: e, volume: n, size: i, className: s, style: c, disabled: l =
|
|
|
284
307
|
width: L,
|
|
285
308
|
height: L,
|
|
286
309
|
borderRadius: "50%",
|
|
287
|
-
background:
|
|
310
|
+
background: h[e]
|
|
288
311
|
}
|
|
289
312
|
})]
|
|
290
313
|
});
|
|
291
314
|
return u ? /* @__PURE__ */ a("button", {
|
|
292
|
-
...
|
|
315
|
+
...f,
|
|
293
316
|
type: "button",
|
|
294
317
|
className: s,
|
|
295
318
|
disabled: l,
|
|
296
|
-
onClick: l ? void 0 :
|
|
319
|
+
onClick: l ? void 0 : d,
|
|
297
320
|
style: {
|
|
298
321
|
appearance: "none",
|
|
299
322
|
WebkitAppearance: "none",
|
|
@@ -308,7 +331,7 @@ function w({ state: e, volume: n, size: i, className: s, style: c, disabled: l =
|
|
|
308
331
|
},
|
|
309
332
|
children: z
|
|
310
333
|
}) : /* @__PURE__ */ a("div", {
|
|
311
|
-
...
|
|
334
|
+
...f,
|
|
312
335
|
className: s,
|
|
313
336
|
style: R,
|
|
314
337
|
children: z
|
|
@@ -316,43 +339,44 @@ function w({ state: e, volume: n, size: i, className: s, style: c, disabled: l =
|
|
|
316
339
|
}
|
|
317
340
|
//#endregion
|
|
318
341
|
//#region src/themes/bars/BarsTheme.tsx
|
|
319
|
-
var
|
|
342
|
+
var D = 5, O = 1.4, k = Math.PI * 2 / D, A = {
|
|
320
343
|
idle: "#cccccc",
|
|
321
344
|
connecting: "#cccccc",
|
|
322
345
|
listening: "#999999",
|
|
346
|
+
thinking: "#d8d8d8",
|
|
323
347
|
speaking: "#e8e8e8",
|
|
324
348
|
error: "#f87171"
|
|
325
349
|
};
|
|
326
|
-
function
|
|
350
|
+
function j(e) {
|
|
327
351
|
return [
|
|
328
352
|
parseInt(e.slice(1, 3), 16),
|
|
329
353
|
parseInt(e.slice(3, 5), 16),
|
|
330
354
|
parseInt(e.slice(5, 7), 16)
|
|
331
355
|
];
|
|
332
356
|
}
|
|
333
|
-
function
|
|
334
|
-
let f = r([]), p = r(null), m = r(0), h = r(Array(
|
|
357
|
+
function M({ state: e, volume: n, size: i, className: o, style: s, disabled: c = !1, interactive: l = !1, onClick: u, ...d }) {
|
|
358
|
+
let f = r([]), p = r(null), m = r(0), h = r(Array(D).fill(0)), g = r(n), _ = r(!1), v = r(0), y = r(j(A.idle)), b = r(null), x = r(Array(D).fill(0)), S = r(e);
|
|
335
359
|
t(() => {
|
|
336
360
|
e !== S.current && (x.current = [...h.current], b.current = Date.now(), S.current = e);
|
|
337
361
|
}, [e]), t(() => {
|
|
338
362
|
g.current = n;
|
|
339
363
|
}, [n]), t(() => {
|
|
340
|
-
let t = i * .55, n = i * .06, r =
|
|
341
|
-
let n = (
|
|
364
|
+
let t = i * .55, n = i * .06, r = A[e] ?? A.idle, a = i * .1, o = Array.from({ length: D }, (e, t) => {
|
|
365
|
+
let n = (D - 1) / 2;
|
|
342
366
|
return 1 - .7 * (Math.abs(t - n) / n);
|
|
343
367
|
}), s = () => {
|
|
344
368
|
let e = _.current ? a : 0;
|
|
345
369
|
v.current += (e - v.current) * .15;
|
|
346
370
|
}, c = (n, r) => {
|
|
347
371
|
s();
|
|
348
|
-
let i =
|
|
372
|
+
let i = j(r), [a, c, l] = y.current;
|
|
349
373
|
y.current = [
|
|
350
374
|
a + (i[0] - a) * .08,
|
|
351
375
|
c + (i[1] - c) * .08,
|
|
352
376
|
l + (i[2] - l) * .08
|
|
353
377
|
];
|
|
354
378
|
let [u, d, p] = y.current.map(Math.round), m = `rgb(${u},${d},${p})`;
|
|
355
|
-
for (let r = 0; r <
|
|
379
|
+
for (let r = 0; r < D; r++) {
|
|
356
380
|
let i = f.current[r];
|
|
357
381
|
if (!i) continue;
|
|
358
382
|
let a = e === "idle" ? o[r] : 1, s = v.current * a;
|
|
@@ -362,8 +386,8 @@ function A({ state: e, volume: n, size: i, className: o, style: s, disabled: c =
|
|
|
362
386
|
if (e === "listening" || e === "speaking") {
|
|
363
387
|
let i = e === "speaking" ? 1 : .4, a = () => {
|
|
364
388
|
let o = g.current, s = Date.now() / 1e3;
|
|
365
|
-
for (let r = 0; r <
|
|
366
|
-
let a = .5 + .15 * Math.sin(s *
|
|
389
|
+
for (let r = 0; r < D; r++) {
|
|
390
|
+
let a = .5 + .15 * Math.sin(s * O * i * Math.PI * 2 + r * k), c = n + (t - n) * o * a;
|
|
367
391
|
if (b.current !== null) {
|
|
368
392
|
let e = Date.now() - b.current, t = Math.min(e / 300, 1), n = 1 - (1 - t) * (1 - t);
|
|
369
393
|
c = x.current[r] + (c - x.current[r]) * n, t >= 1 && (b.current = null);
|
|
@@ -375,12 +399,12 @@ function A({ state: e, volume: n, size: i, className: o, style: s, disabled: c =
|
|
|
375
399
|
};
|
|
376
400
|
return m.current = requestAnimationFrame(a), () => cancelAnimationFrame(m.current);
|
|
377
401
|
}
|
|
378
|
-
if (e === "connecting") {
|
|
402
|
+
if (e === "connecting" || e === "thinking") {
|
|
379
403
|
let e = Date.now(), i = () => {
|
|
380
404
|
let a = (Date.now() - e) / 1e3;
|
|
381
405
|
s();
|
|
382
|
-
for (let e = 0; e <
|
|
383
|
-
let r = (a * .6 + e /
|
|
406
|
+
for (let e = 0; e < D; e++) {
|
|
407
|
+
let r = (a * .6 + e / D * .5) % 1, i = r < .5 ? Math.sin(r / .5 * Math.PI) : 0, o = n + (t * .4 - n) * i;
|
|
384
408
|
h.current[e] += (o - h.current[e]) * .15;
|
|
385
409
|
}
|
|
386
410
|
c(h.current, r), m.current = requestAnimationFrame(i);
|
|
@@ -390,12 +414,12 @@ function A({ state: e, volume: n, size: i, className: o, style: s, disabled: c =
|
|
|
390
414
|
cancelAnimationFrame(m.current);
|
|
391
415
|
let l = () => {
|
|
392
416
|
s();
|
|
393
|
-
for (let e = 0; e <
|
|
417
|
+
for (let e = 0; e < D; e++) h.current[e] += (n - h.current[e]) * .16;
|
|
394
418
|
c(h.current, r), m.current = requestAnimationFrame(l);
|
|
395
419
|
};
|
|
396
420
|
return m.current = requestAnimationFrame(l), () => cancelAnimationFrame(m.current);
|
|
397
421
|
}, [e, i]);
|
|
398
|
-
let C = i * .055, w = i * .035,
|
|
422
|
+
let C = i * .055, w = i * .035, T = i * .03, E = i * .55, M = i * .06, N = {
|
|
399
423
|
width: i,
|
|
400
424
|
height: i,
|
|
401
425
|
display: "flex",
|
|
@@ -424,17 +448,17 @@ function A({ state: e, volume: n, size: i, className: o, style: s, disabled: c =
|
|
|
424
448
|
transition: "filter 0.3s ease",
|
|
425
449
|
cursor: l ? c ? "not-allowed" : "pointer" : "default"
|
|
426
450
|
},
|
|
427
|
-
children: Array.from({ length:
|
|
451
|
+
children: Array.from({ length: D }, (t, n) => /* @__PURE__ */ a("span", {
|
|
428
452
|
ref: (e) => {
|
|
429
453
|
f.current[n] = e;
|
|
430
454
|
},
|
|
431
455
|
style: {
|
|
432
456
|
width: C,
|
|
433
457
|
minHeight: M,
|
|
434
|
-
maxHeight:
|
|
458
|
+
maxHeight: E,
|
|
435
459
|
height: M,
|
|
436
|
-
borderRadius:
|
|
437
|
-
background:
|
|
460
|
+
borderRadius: T,
|
|
461
|
+
background: A[e] ?? A.idle
|
|
438
462
|
}
|
|
439
463
|
}, n))
|
|
440
464
|
});
|
|
@@ -466,101 +490,56 @@ function A({ state: e, volume: n, size: i, className: o, style: s, disabled: c =
|
|
|
466
490
|
}
|
|
467
491
|
//#endregion
|
|
468
492
|
//#region src/components/Orb/Orb.tsx
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
let e = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);
|
|
473
|
-
navigator.mediaDevices.getUserMedia = async (t) => {
|
|
474
|
-
let n = await e(t);
|
|
475
|
-
return t?.audio && (a = n), n;
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
function o(o) {
|
|
479
|
-
if (!(!a || t)) try {
|
|
480
|
-
e = new AudioContext(), t = e.createAnalyser(), t.fftSize = 256, n = e.createMediaStreamSource(a), n.connect(t);
|
|
481
|
-
let c = new Uint8Array(t.frequencyBinCount), l = () => {
|
|
482
|
-
if (!t) return;
|
|
483
|
-
t.getByteFrequencyData(c);
|
|
484
|
-
let e = 0;
|
|
485
|
-
for (let t = 0; t < c.length; t++) e += c[t] * c[t];
|
|
486
|
-
let n = Math.sqrt(e / c.length) / 255, a = n > i ? .7 : .3;
|
|
487
|
-
i += (n - i) * a, o(s(i)), r = requestAnimationFrame(l);
|
|
488
|
-
};
|
|
489
|
-
r = requestAnimationFrame(l);
|
|
490
|
-
} catch (e) {
|
|
491
|
-
console.warn("[orb-ui] Mic monitor failed:", e);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function c() {
|
|
495
|
-
cancelAnimationFrame(r), r = 0, i = 0, n?.disconnect(), n = null, t = null;
|
|
496
|
-
}
|
|
497
|
-
function l() {
|
|
498
|
-
c(), e &&= (e.close().catch(() => {}), null), a?.getTracks().forEach((e) => {
|
|
499
|
-
e.readyState === "live" && e.stop();
|
|
500
|
-
}), a = null;
|
|
501
|
-
}
|
|
502
|
-
return {
|
|
503
|
-
start: o,
|
|
504
|
-
stop: c,
|
|
505
|
-
release: l
|
|
506
|
-
};
|
|
493
|
+
var N = !1;
|
|
494
|
+
function P() {
|
|
495
|
+
return globalThis.process?.env?.NODE_ENV === "production";
|
|
507
496
|
}
|
|
508
|
-
function
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
onVolumeChange: b
|
|
514
|
-
});
|
|
515
|
-
}, [s]);
|
|
516
|
-
let E = n ?? _;
|
|
497
|
+
function F() {
|
|
498
|
+
N || P() || (N = !0, console.warn("[orb-ui] Callback-object adapters are deprecated. Use subscribe(listener) and emit OrbSignal objects instead. Legacy adapters will be removed in 0.5.0."));
|
|
499
|
+
}
|
|
500
|
+
function I({ signal: n, state: r, volume: o, adapter: u, theme: d = "debug", size: p = 200, className: m, style: h, disabled: g = !1, onStart: _, onStop: v, ...y }) {
|
|
501
|
+
let [b, x] = i({ state: "idle" });
|
|
517
502
|
t(() => {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
clearTimeout(t), e.stop(), T.current = !1, S(0);
|
|
525
|
-
};
|
|
526
|
-
} else e.stop(), T.current = !1, S(0);
|
|
527
|
-
}, [E, s]), t(() => () => C.current.release(), []);
|
|
528
|
-
let D = o ?? (E === "listening" && T.current ? x : y), O = E !== "idle" && E !== "error", k = e(() => {
|
|
529
|
-
p || (O ? h ? h() : s?.stop?.() : m ? m() : s?.start?.());
|
|
503
|
+
if (x({ state: "idle" }), !u) return;
|
|
504
|
+
let e = l(x, F);
|
|
505
|
+
return u.subscribe(e);
|
|
506
|
+
}, [u]);
|
|
507
|
+
let S = n ?? b, C = s(r, n, b), w = c(o, C, S), T = C !== "idle" && C !== "error", D = e(() => {
|
|
508
|
+
g || (T ? v ? v() : u?.stop?.() : _ ? _() : u?.start?.());
|
|
530
509
|
}, [
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
]),
|
|
537
|
-
state:
|
|
538
|
-
volume:
|
|
539
|
-
size:
|
|
540
|
-
className:
|
|
541
|
-
style:
|
|
542
|
-
disabled:
|
|
543
|
-
...
|
|
544
|
-
"aria-label":
|
|
545
|
-
},
|
|
546
|
-
...
|
|
547
|
-
interactive:
|
|
510
|
+
u,
|
|
511
|
+
g,
|
|
512
|
+
T,
|
|
513
|
+
_,
|
|
514
|
+
v
|
|
515
|
+
]), O = T ? !!(u?.stop || v) : !!(u?.start || _), k = O && !g ? D : void 0, A = {
|
|
516
|
+
state: C,
|
|
517
|
+
volume: w,
|
|
518
|
+
size: p,
|
|
519
|
+
className: m,
|
|
520
|
+
style: h,
|
|
521
|
+
disabled: g,
|
|
522
|
+
...y,
|
|
523
|
+
"aria-label": y["aria-label"] ?? (O ? `${T ? "Stop" : "Start"} voice session` : void 0)
|
|
524
|
+
}, j = {
|
|
525
|
+
...A,
|
|
526
|
+
interactive: O
|
|
548
527
|
};
|
|
549
|
-
switch (
|
|
550
|
-
case "circle": return /* @__PURE__ */ a(
|
|
551
|
-
...
|
|
552
|
-
onClick:
|
|
528
|
+
switch (d) {
|
|
529
|
+
case "circle": return /* @__PURE__ */ a(E, {
|
|
530
|
+
...j,
|
|
531
|
+
onClick: k
|
|
553
532
|
});
|
|
554
|
-
case "bars": return /* @__PURE__ */ a(
|
|
555
|
-
...
|
|
556
|
-
onClick:
|
|
533
|
+
case "bars": return /* @__PURE__ */ a(M, {
|
|
534
|
+
...j,
|
|
535
|
+
onClick: k
|
|
557
536
|
});
|
|
558
|
-
default: return /* @__PURE__ */ a(
|
|
559
|
-
...
|
|
560
|
-
onStart:
|
|
561
|
-
onStop:
|
|
537
|
+
default: return /* @__PURE__ */ a(f, {
|
|
538
|
+
...A,
|
|
539
|
+
onStart: g ? void 0 : _ ?? (() => u?.start?.()),
|
|
540
|
+
onStop: g ? void 0 : v ?? (() => u?.stop?.())
|
|
562
541
|
});
|
|
563
542
|
}
|
|
564
543
|
}
|
|
565
544
|
//#endregion
|
|
566
|
-
export {
|
|
545
|
+
export { I as Orb, I as VoiceOrb };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "orb-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React voice agent UI components with animated voice orbs, audio-reactive themes, and adapters for Vapi, ElevenLabs, and custom realtime voice AI apps.",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "React voice agent UI components with animated voice orbs, audio-reactive themes, and adapters for Vapi, ElevenLabs, LiveKit, and custom realtime voice AI apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/orb-ui.cjs",
|
|
7
7
|
"module": "./dist/orb-ui.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@vitejs/plugin-react": "^6.0.2",
|
|
36
36
|
"eslint": "^10.4.0",
|
|
37
37
|
"globals": "^17.6.0",
|
|
38
|
+
"livekit-client": "2.20.0",
|
|
38
39
|
"prettier": "^3.8.3",
|
|
39
40
|
"react": "^18.3.1",
|
|
40
41
|
"react-dom": "^18.3.1",
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
"realtime-voice",
|
|
62
63
|
"state-machine",
|
|
63
64
|
"vapi",
|
|
64
|
-
"elevenlabs"
|
|
65
|
+
"elevenlabs",
|
|
66
|
+
"livekit"
|
|
65
67
|
],
|
|
66
68
|
"license": "MIT",
|
|
67
69
|
"author": "Alexander Chen",
|
|
@@ -81,12 +83,13 @@
|
|
|
81
83
|
"build": "tsc && vite build",
|
|
82
84
|
"build:demo": "pnpm --filter orb-ui-demo build",
|
|
83
85
|
"changeset": "changeset",
|
|
84
|
-
"check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm typecheck:examples && pnpm test && pnpm build && pnpm typecheck:package && pnpm build:demo",
|
|
86
|
+
"check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm typecheck:examples && pnpm test && pnpm build && pnpm typecheck:package && pnpm typecheck:demo && pnpm build:demo",
|
|
85
87
|
"dev": "vite build --watch",
|
|
86
88
|
"dev:demo": "pnpm --filter orb-ui-demo dev",
|
|
87
89
|
"format": "prettier . --write",
|
|
88
90
|
"format:check": "prettier . --check",
|
|
89
91
|
"typecheck": "tsc --noEmit",
|
|
92
|
+
"typecheck:demo": "pnpm --filter orb-ui-demo typecheck",
|
|
90
93
|
"typecheck:examples": "tsc -p tsconfig.type-tests.json --noEmit",
|
|
91
94
|
"typecheck:package": "tsc -p tsconfig.package-types.json --noEmit",
|
|
92
95
|
"lint": "eslint .",
|