@staylift-tech/conv-widget 0.0.1
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 +220 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-BDscJkkF.js +1464 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/staylift-orb.cjs.entry.js +117 -0
- package/dist/cjs/staylift-widget.cjs.entry.js +26479 -0
- package/dist/cjs/staylift-widget.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +13 -0
- package/dist/collection/components/staylift-orb/staylift-orb.css +15 -0
- package/dist/collection/components/staylift-orb/staylift-orb.js +229 -0
- package/dist/collection/components/staylift-widget/staylift-widget.css +578 -0
- package/dist/collection/components/staylift-widget/staylift-widget.js +898 -0
- package/dist/collection/index.js +3 -0
- package/dist/collection/types.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-DnOZjbwA.js +1 -0
- package/dist/components/staylift-orb.d.ts +11 -0
- package/dist/components/staylift-orb.js +1 -0
- package/dist/components/staylift-widget.d.ts +11 -0
- package/dist/components/staylift-widget.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-DAtfDq5B.js +1456 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/staylift-orb.entry.js +115 -0
- package/dist/esm/staylift-widget.entry.js +26477 -0
- package/dist/esm/staylift-widget.js +21 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/staylift-widget/index.esm.js +1 -0
- package/dist/staylift-widget/p-37510f2e.entry.js +1 -0
- package/dist/staylift-widget/p-94923740.entry.js +1 -0
- package/dist/staylift-widget/p-DAtfDq5B.js +2 -0
- package/dist/staylift-widget/p-DQuL1Twl.js +1 -0
- package/dist/staylift-widget/staylift-widget.esm.js +1 -0
- package/dist/types/components/staylift-orb/staylift-orb.d.ts +19 -0
- package/dist/types/components/staylift-widget/staylift-widget.d.ts +80 -0
- package/dist/types/components.d.ts +212 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +1839 -0
- package/dist/types/types.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# Staylift Conversational Widget
|
|
2
|
+
|
|
3
|
+
**Voice + Text Chat** widget for hotels, powered by ElevenLabs Conversational AI.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎙️ **Voice Calls** - Natural voice conversations with AI
|
|
8
|
+
- 💬 **Text Chat** - Type messages when you can't talk
|
|
9
|
+
- 🌍 **Multi-language** - EN, PL, DE built-in (extensible)
|
|
10
|
+
- 🎨 **Customizable** - Match your hotel's branding
|
|
11
|
+
- 📱 **Responsive** - Works on mobile and desktop
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
### CDN (For hotels)
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<staylift-widget
|
|
19
|
+
agent-id="your-elevenlabs-agent-id"
|
|
20
|
+
brand-name="Your Hotel Name"
|
|
21
|
+
primary-color="#8b5cf6"
|
|
22
|
+
></staylift-widget>
|
|
23
|
+
|
|
24
|
+
<script src="https://unpkg.com/@staylift/conv-widget"></script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### NPM (For developers)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @staylift/conv-widget
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
import '@staylift/conv-widget';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## How It Works
|
|
38
|
+
|
|
39
|
+
1. User clicks the floating orb → Chat window opens
|
|
40
|
+
2. User clicks phone button → Voice call starts
|
|
41
|
+
3. User can **speak** OR **type** messages
|
|
42
|
+
4. All messages appear in the chat history
|
|
43
|
+
5. ElevenLabs AI responds via voice + text
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
### Required
|
|
48
|
+
|
|
49
|
+
| Attribute | Description |
|
|
50
|
+
|-----------|-------------|
|
|
51
|
+
| `agent-id` | Your ElevenLabs Conversational AI Agent ID |
|
|
52
|
+
|
|
53
|
+
### Appearance
|
|
54
|
+
|
|
55
|
+
| Attribute | Default | Description |
|
|
56
|
+
|-----------|---------|-------------|
|
|
57
|
+
| `brand-name` | "Virtual Concierge" | Hotel name in header |
|
|
58
|
+
| `subtitle` | "Ask me anything..." | Subtitle text |
|
|
59
|
+
| `primary-color` | "#10b981" | Brand color (hex) |
|
|
60
|
+
| `background-color` | "#ffffff" | Background color |
|
|
61
|
+
| `text-color` | "#1f2937" | Text color |
|
|
62
|
+
| `logo-url` | - | Custom logo image URL |
|
|
63
|
+
|
|
64
|
+
### Layout
|
|
65
|
+
|
|
66
|
+
| Attribute | Default | Options |
|
|
67
|
+
|-----------|---------|---------|
|
|
68
|
+
| `variant` | "floating" | `floating`, `inline`, `compact` |
|
|
69
|
+
| `position` | "bottom-right" | `bottom-right`, `bottom-left`, `top-right`, `top-left` |
|
|
70
|
+
|
|
71
|
+
### Behavior
|
|
72
|
+
|
|
73
|
+
| Attribute | Default | Description |
|
|
74
|
+
|-----------|---------|-------------|
|
|
75
|
+
| `language` | "en" | UI language (`en`, `pl`, `de`) |
|
|
76
|
+
| `auto-expand` | false | Open chat on page load |
|
|
77
|
+
| `show-branding` | true | Show "Powered by Staylift" |
|
|
78
|
+
|
|
79
|
+
## Events
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
const widget = document.querySelector('staylift-widget');
|
|
83
|
+
|
|
84
|
+
// Connection
|
|
85
|
+
widget.addEventListener('conversationStarted', () => {
|
|
86
|
+
console.log('Voice call connected');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
widget.addEventListener('conversationEnded', () => {
|
|
90
|
+
console.log('Voice call ended');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Messages
|
|
94
|
+
widget.addEventListener('messageReceived', (event) => {
|
|
95
|
+
const { role, content } = event.detail;
|
|
96
|
+
console.log(`${role}: ${content}`);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// Status
|
|
100
|
+
widget.addEventListener('statusChanged', (event) => {
|
|
101
|
+
console.log('Status:', event.detail); // 'disconnected' | 'connecting' | 'connected'
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Errors
|
|
105
|
+
widget.addEventListener('widgetError', (event) => {
|
|
106
|
+
console.error('Error:', event.detail.message);
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Methods
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
const widget = document.querySelector('staylift-widget');
|
|
114
|
+
|
|
115
|
+
// Start voice call
|
|
116
|
+
await widget.startConversation();
|
|
117
|
+
|
|
118
|
+
// End voice call
|
|
119
|
+
await widget.endConversation();
|
|
120
|
+
|
|
121
|
+
// Send text message (while connected)
|
|
122
|
+
await widget.sendMessage('What time is checkout?');
|
|
123
|
+
|
|
124
|
+
// Get current status
|
|
125
|
+
const status = await widget.getStatus();
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Variants
|
|
129
|
+
|
|
130
|
+
### Floating (Default)
|
|
131
|
+
Full chat window that appears when clicking the orb.
|
|
132
|
+
|
|
133
|
+
```html
|
|
134
|
+
<staylift-widget
|
|
135
|
+
agent-id="xxx"
|
|
136
|
+
variant="floating"
|
|
137
|
+
position="bottom-right"
|
|
138
|
+
></staylift-widget>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Inline
|
|
142
|
+
Embed directly in your page.
|
|
143
|
+
|
|
144
|
+
```html
|
|
145
|
+
<staylift-widget
|
|
146
|
+
agent-id="xxx"
|
|
147
|
+
variant="inline"
|
|
148
|
+
></staylift-widget>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Compact
|
|
152
|
+
Minimal horizontal bar.
|
|
153
|
+
|
|
154
|
+
```html
|
|
155
|
+
<staylift-widget
|
|
156
|
+
agent-id="xxx"
|
|
157
|
+
variant="compact"
|
|
158
|
+
></staylift-widget>
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Development
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Install dependencies
|
|
165
|
+
npm install
|
|
166
|
+
|
|
167
|
+
# Start dev server
|
|
168
|
+
npm start
|
|
169
|
+
|
|
170
|
+
# Build for production
|
|
171
|
+
npm run build
|
|
172
|
+
|
|
173
|
+
# Publish to npm
|
|
174
|
+
npm publish --access public
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Framework Integration
|
|
178
|
+
|
|
179
|
+
### React / Next.js
|
|
180
|
+
|
|
181
|
+
```jsx
|
|
182
|
+
'use client';
|
|
183
|
+
import { useEffect } from 'react';
|
|
184
|
+
|
|
185
|
+
export default function VoiceWidget() {
|
|
186
|
+
useEffect(() => {
|
|
187
|
+
import('@staylift/voice-widget');
|
|
188
|
+
}, []);
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<staylift-widget
|
|
192
|
+
agent-id="your-agent-id"
|
|
193
|
+
brand-name="Your Hotel"
|
|
194
|
+
/>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Vue
|
|
200
|
+
|
|
201
|
+
```vue
|
|
202
|
+
<template>
|
|
203
|
+
<staylift-widget
|
|
204
|
+
agent-id="your-agent-id"
|
|
205
|
+
brand-name="Your Hotel"
|
|
206
|
+
/>
|
|
207
|
+
</template>
|
|
208
|
+
|
|
209
|
+
<script setup>
|
|
210
|
+
import '@staylift/conv-widget';
|
|
211
|
+
</script>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Browser Support
|
|
215
|
+
|
|
216
|
+
Chrome 67+, Firefox 63+, Safari 10.1+, Edge 79+
|
|
217
|
+
|
|
218
|
+
## License
|
|
219
|
+
|
|
220
|
+
MIT © Staylift
|