obi-sdk 0.3.11 → 0.3.12
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/modular/ui.js +6 -143
- package/dist/modular/ui.js.map +1 -1
- package/dist/obi-sdk.standalone.iife.js +40 -40
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +32 -32
- package/dist/obi-sdk.umd.js.map +1 -1
- package/dist/ui/components/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/ui/components/control-panel.d.ts +0 -12
package/dist/modular/ui.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { S as SDKState } from "./chunks/types-82772f00.js";
|
|
2
2
|
import { i, n, a as i$1, x } from "./chunks/obi-widget-dffef845.js";
|
|
3
3
|
import { A, C, c, d, D, N, b, O, S } from "./chunks/obi-widget-dffef845.js";
|
|
4
|
-
var __defProp
|
|
5
|
-
var __getOwnPropDesc
|
|
6
|
-
var __decorateClass
|
|
7
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
8
|
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
9
9
|
if (decorator = decorators[i2])
|
|
10
10
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
11
|
if (kind && result)
|
|
12
|
-
__defProp
|
|
12
|
+
__defProp(target, key, result);
|
|
13
13
|
return result;
|
|
14
14
|
};
|
|
15
15
|
class ObiStatusWidget extends i$1 {
|
|
@@ -76,151 +76,15 @@ ObiStatusWidget.styles = i`
|
|
|
76
76
|
color: #1f2937;
|
|
77
77
|
}
|
|
78
78
|
`;
|
|
79
|
-
__decorateClass
|
|
79
|
+
__decorateClass([
|
|
80
80
|
n({ type: String })
|
|
81
81
|
], ObiStatusWidget.prototype, "state", 2);
|
|
82
82
|
if (!customElements.get("obi-status-widget")) {
|
|
83
83
|
customElements.define("obi-status-widget", ObiStatusWidget);
|
|
84
84
|
}
|
|
85
85
|
const statusWidget = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ObiStatusWidget }, Symbol.toStringTag, { value: "Module" }));
|
|
86
|
-
var __defProp = Object.defineProperty;
|
|
87
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
88
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
89
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
90
|
-
for (var i2 = decorators.length - 1, decorator; i2 >= 0; i2--)
|
|
91
|
-
if (decorator = decorators[i2])
|
|
92
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
93
|
-
if (kind && result)
|
|
94
|
-
__defProp(target, key, result);
|
|
95
|
-
return result;
|
|
96
|
-
};
|
|
97
|
-
class ObiControlPanel extends i$1 {
|
|
98
|
-
constructor() {
|
|
99
|
-
super(...arguments);
|
|
100
|
-
this.state = SDKState.READY;
|
|
101
|
-
this.voiceEnabled = true;
|
|
102
|
-
this.screenEnabled = true;
|
|
103
|
-
}
|
|
104
|
-
render() {
|
|
105
|
-
const isActive = this.state === SDKState.AGENT_SPEAKING;
|
|
106
|
-
const isReady = this.state === SDKState.READY;
|
|
107
|
-
return x`
|
|
108
|
-
<div class="control-container">
|
|
109
|
-
<div class="control-header">Obi Controls</div>
|
|
110
|
-
<div class="control-buttons">
|
|
111
|
-
<button
|
|
112
|
-
class="btn-voice"
|
|
113
|
-
?disabled=${!isReady || !this.voiceEnabled}
|
|
114
|
-
@click=${this.handleVoiceClick}
|
|
115
|
-
>
|
|
116
|
-
Start Voice
|
|
117
|
-
</button>
|
|
118
|
-
|
|
119
|
-
<button
|
|
120
|
-
class="btn-screen"
|
|
121
|
-
?disabled=${!isReady || !this.screenEnabled}
|
|
122
|
-
@click=${this.handleScreenClick}
|
|
123
|
-
>
|
|
124
|
-
Capture Screen
|
|
125
|
-
</button>
|
|
126
|
-
|
|
127
|
-
<button class="btn-stop" ?disabled=${!isActive} @click=${this.handleStopClick}>
|
|
128
|
-
Stop
|
|
129
|
-
</button>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
`;
|
|
133
|
-
}
|
|
134
|
-
handleVoiceClick() {
|
|
135
|
-
this.dispatchEvent(new CustomEvent("voice-start"));
|
|
136
|
-
}
|
|
137
|
-
handleScreenClick() {
|
|
138
|
-
this.dispatchEvent(new CustomEvent("screen-start"));
|
|
139
|
-
}
|
|
140
|
-
handleStopClick() {
|
|
141
|
-
this.dispatchEvent(new CustomEvent("stop"));
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
ObiControlPanel.styles = i`
|
|
145
|
-
:host {
|
|
146
|
-
display: block;
|
|
147
|
-
font-family: Arial, sans-serif;
|
|
148
|
-
--obi-primary: #3b82f6;
|
|
149
|
-
--obi-danger: #ef4444;
|
|
150
|
-
--obi-gray: #6b7280;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.control-container {
|
|
154
|
-
display: flex;
|
|
155
|
-
flex-direction: column;
|
|
156
|
-
padding: 16px;
|
|
157
|
-
border-radius: 8px;
|
|
158
|
-
background-color: #ffffff;
|
|
159
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
160
|
-
max-width: 300px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.control-header {
|
|
164
|
-
margin-bottom: 16px;
|
|
165
|
-
font-size: 16px;
|
|
166
|
-
font-weight: 600;
|
|
167
|
-
color: #111827;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.control-buttons {
|
|
171
|
-
display: flex;
|
|
172
|
-
gap: 8px;
|
|
173
|
-
margin-bottom: 16px;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
button {
|
|
177
|
-
padding: 8px 12px;
|
|
178
|
-
border: none;
|
|
179
|
-
border-radius: 4px;
|
|
180
|
-
font-size: 14px;
|
|
181
|
-
font-weight: 500;
|
|
182
|
-
cursor: pointer;
|
|
183
|
-
transition:
|
|
184
|
-
background-color 0.2s,
|
|
185
|
-
opacity 0.2s;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
button:disabled {
|
|
189
|
-
opacity: 0.5;
|
|
190
|
-
cursor: not-allowed;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.btn-voice {
|
|
194
|
-
background-color: var(--obi-primary);
|
|
195
|
-
color: white;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.btn-screen {
|
|
199
|
-
background-color: var(--obi-primary);
|
|
200
|
-
color: white;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.btn-stop {
|
|
204
|
-
background-color: var(--obi-danger);
|
|
205
|
-
color: white;
|
|
206
|
-
}
|
|
207
|
-
`;
|
|
208
|
-
__decorateClass([
|
|
209
|
-
n({ type: String })
|
|
210
|
-
], ObiControlPanel.prototype, "state", 2);
|
|
211
|
-
__decorateClass([
|
|
212
|
-
n({ type: Boolean })
|
|
213
|
-
], ObiControlPanel.prototype, "voiceEnabled", 2);
|
|
214
|
-
__decorateClass([
|
|
215
|
-
n({ type: Boolean })
|
|
216
|
-
], ObiControlPanel.prototype, "screenEnabled", 2);
|
|
217
|
-
if (!customElements.get("obi-control-panel")) {
|
|
218
|
-
customElements.define("obi-control-panel", ObiControlPanel);
|
|
219
|
-
}
|
|
220
|
-
const controlPanel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ObiControlPanel }, Symbol.toStringTag, { value: "Module" }));
|
|
221
86
|
function defineCustomElements() {
|
|
222
87
|
Promise.resolve().then(() => statusWidget);
|
|
223
|
-
Promise.resolve().then(() => controlPanel);
|
|
224
88
|
import("./chunks/obi-widget-dffef845.js").then((n2) => n2.o);
|
|
225
89
|
import("./chunks/obi-widget-dffef845.js").then((n2) => n2.j);
|
|
226
90
|
import("./chunks/obi-widget-dffef845.js").then((n2) => n2.k);
|
|
@@ -238,7 +102,6 @@ export {
|
|
|
238
102
|
D as DotLoader,
|
|
239
103
|
N as NavIcon,
|
|
240
104
|
b as NavigationBar,
|
|
241
|
-
ObiControlPanel,
|
|
242
105
|
ObiStatusWidget,
|
|
243
106
|
O as ObiWidget,
|
|
244
107
|
S as SearchingLoader,
|
package/dist/modular/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sources":["../../src/ui/components/status-widget.ts","../../src/ui/components/
|
|
1
|
+
{"version":3,"file":"ui.js","sources":["../../src/ui/components/status-widget.ts","../../src/ui/components/index.ts"],"sourcesContent":["import { SDKState } from \"@obi/obi-session\"\nimport { LitElement, html, css } from \"lit\"\nimport { property } from \"lit/decorators.js\"\n\nexport class ObiStatusWidget extends LitElement {\n @property({ type: String })\n state: SDKState = SDKState.READY\n\n static styles = css`\n :host {\n display: inline-block;\n font-family: Arial, sans-serif;\n }\n\n .status-container {\n display: flex;\n align-items: center;\n padding: 8px 12px;\n border-radius: 16px;\n background-color: #f3f4f6;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);\n }\n\n .status-indicator {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n margin-right: 8px;\n }\n\n .ready {\n background-color: #10b981;\n }\n\n .active {\n background-color: #3b82f6;\n }\n\n .error {\n background-color: #ef4444;\n }\n\n .status-text {\n font-size: 14px;\n font-weight: 500;\n color: #1f2937;\n }\n `\n\n render() {\n return html`\n <div class=\"status-container\">\n <div class=\"status-indicator ${this.state}\"></div>\n <div class=\"status-text\">${this.getStatusText()}</div>\n </div>\n `\n }\n\n private getStatusText(): string {\n switch (this.state) {\n case SDKState.READY:\n return \"Ready\"\n case SDKState.ERROR:\n return \"Error\"\n default:\n return \"Unknown\"\n }\n }\n}\n\nif (!customElements.get(\"obi-status-widget\")) {\n customElements.define(\"obi-status-widget\", ObiStatusWidget)\n}\n","export * from \"./status-widget\"\nexport * from \"./obi-widget\"\nexport * from \"./audio-equalizer\"\nexport * from \"./dot-loader\"\nexport * from \"./nav-icon\"\nexport * from \"./navigation-bar\"\nexport * from \"./searching-loader\"\nexport * from \"./courses/courses\"\nexport * from \"./courses/course-modal\"\n\n// Function to define all custom elements at once for development\nexport function defineCustomElements() {\n // Import all components to ensure they're registered\n // This is primarily useful for development\n import(\"./status-widget\")\n import(\"./obi-widget\")\n import(\"./audio-equalizer\")\n import(\"./dot-loader\")\n import(\"./nav-icon\")\n import(\"./navigation-bar\")\n import(\"./searching-loader\")\n import(\"./courses/courses\")\n import(\"./courses/course-modal\")\n}\n"],"names":["LitElement","html","css","property","n"],"mappings":";;;;;;;;;;;;;;AAIO,MAAM,wBAAwBA,IAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA;AAEL,SAAA,QAAkB,SAAS;AAAA,EAAA;AAAA,EA2C3B,SAAS;AACA,WAAAC;AAAAA;AAAAA,uCAE4B,KAAK,KAAK;AAAA,mCACd,KAAK,eAAe;AAAA;AAAA;AAAA,EAGrD;AAAA,EAEQ,gBAAwB;AAC9B,YAAQ,KAAK,OAAO;AAAA,MAClB,KAAK,SAAS;AACL,eAAA;AAAA,MACT,KAAK,SAAS;AACL,eAAA;AAAA,MACT;AACS,eAAA;AAAA,IACX;AAAA,EACF;AACF;AAhEa,gBAIJ,SAASC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAFhB,gBAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ;AAAA,GADf,gBAEX,WAAA,SAAA,CAAA;AAgEF,IAAI,CAAC,eAAe,IAAI,mBAAmB,GAAG;AAC7B,iBAAA,OAAO,qBAAqB,eAAe;AAC5D;AC7DO,MAAA,eAAA,uBAAA,OAAA,uBAAA,eAAA,EAAA,WAAA,MAAA,gBAAA,GAAA,OAAA,aAAA,EAAA,OAAA,SAAA,CAAA,CAAA;AAAA,SAAS,uBAAuB;AAGrC;AACA,SAAO,iCAAc,EAAA,KAAA,CAAAC,OAAAA,GAAA,CAAA;AACrB,SAAO,iCAAmB,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AAC1B,SAAO,iCAAc,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AACrB,SAAO,iCAAY,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AACnB,SAAO,iCAAkB,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AACzB,SAAO,iCAAoB,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AAC3B,SAAO,iCAAmB,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AAC1B,SAAO,iCAAwB,EAAA,KAAA,CAAAA,OAAAA,GAAA,CAAA;AACjC;"}
|