@yinshan-tech/webrtc-react 0.1.0 → 0.8.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 +78 -66
- package/dist/CallWidget.d.ts +41 -0
- package/dist/CallWidget.js +266 -0
- package/dist/CallWidget.js.map +1 -0
- package/dist/OutboundCallButton.d.ts +43 -0
- package/dist/OutboundCallButton.js +92 -0
- package/dist/OutboundCallButton.js.map +1 -0
- package/dist/OutboundModeShell.d.ts +59 -0
- package/dist/OutboundModeShell.js +270 -0
- package/dist/OutboundModeShell.js.map +1 -0
- package/dist/SoftphoneProvider.d.ts +13 -0
- package/dist/SoftphoneProvider.js +21 -0
- package/dist/SoftphoneProvider.js.map +1 -0
- package/dist/ensureCallWidgetHost.d.ts +7 -0
- package/dist/ensureCallWidgetHost.js +57 -0
- package/dist/ensureCallWidgetHost.js.map +1 -0
- package/dist/hooks.d.ts +19 -0
- package/dist/hooks.js +67 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/injectSoftphoneStyles.d.ts +2 -0
- package/dist/injectSoftphoneStyles.js +15 -0
- package/dist/injectSoftphoneStyles.js.map +1 -0
- package/dist/styles.css +603 -0
- package/dist/stylesInject.d.ts +2 -0
- package/dist/stylesInject.js +3 -0
- package/dist/stylesInject.js.map +1 -0
- package/package.json +24 -10
package/dist/styles.css
ADDED
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
/* @yinshan-tech/webrtc-react — override via CSS variables / className */
|
|
2
|
+
|
|
3
|
+
.wro-root {
|
|
4
|
+
--wro-btn-bg: #ef4444;
|
|
5
|
+
--wro-btn-color: #fff;
|
|
6
|
+
--wro-btn-radius: 8px;
|
|
7
|
+
--wro-btn-padding: 6px 14px;
|
|
8
|
+
--wro-btn-font-size: 14px;
|
|
9
|
+
--wro-modal-z: 1000;
|
|
10
|
+
font-family:
|
|
11
|
+
system-ui,
|
|
12
|
+
-apple-system,
|
|
13
|
+
"Segoe UI",
|
|
14
|
+
Roboto,
|
|
15
|
+
sans-serif;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.wro-btn {
|
|
19
|
+
background: var(--wro-btn-bg);
|
|
20
|
+
color: var(--wro-btn-color);
|
|
21
|
+
border: none;
|
|
22
|
+
border-radius: var(--wro-btn-radius);
|
|
23
|
+
padding: var(--wro-btn-padding);
|
|
24
|
+
font-size: var(--wro-btn-font-size);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wro-btn:disabled {
|
|
29
|
+
opacity: 0.55;
|
|
30
|
+
cursor: not-allowed;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Floating call card (no full-screen mask) */
|
|
34
|
+
.wro-call {
|
|
35
|
+
position: fixed;
|
|
36
|
+
top: 20px;
|
|
37
|
+
right: 20px;
|
|
38
|
+
z-index: var(--wro-modal-z);
|
|
39
|
+
width: 320px;
|
|
40
|
+
padding: 20px 24px 28px;
|
|
41
|
+
background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%);
|
|
42
|
+
color: #0f172a;
|
|
43
|
+
border-radius: 20px;
|
|
44
|
+
box-shadow:
|
|
45
|
+
0 12px 40px rgba(15, 23, 42, 0.16),
|
|
46
|
+
0 2px 8px rgba(15, 23, 42, 0.06);
|
|
47
|
+
text-align: center;
|
|
48
|
+
cursor: grab;
|
|
49
|
+
user-select: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.wro-call.is-dragging {
|
|
53
|
+
cursor: grabbing;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.wro-call button {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.wro-call__minimize {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 10px;
|
|
63
|
+
right: 10px;
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
width: 28px;
|
|
68
|
+
height: 28px;
|
|
69
|
+
padding: 0;
|
|
70
|
+
color: rgba(0, 0, 0, 0.45);
|
|
71
|
+
background: transparent;
|
|
72
|
+
border: none;
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.wro-call__minimize:hover {
|
|
78
|
+
color: rgba(0, 0, 0, 0.85);
|
|
79
|
+
background: rgba(0, 0, 0, 0.06);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.wro-call__avatar {
|
|
83
|
+
position: relative;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
width: 72px;
|
|
88
|
+
height: 72px;
|
|
89
|
+
margin: 8px auto 16px;
|
|
90
|
+
color: #fff;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
font-size: 28px;
|
|
93
|
+
background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.wro-call__avatar.is-calling::after {
|
|
99
|
+
position: absolute;
|
|
100
|
+
inset: -6px;
|
|
101
|
+
border: 2px solid rgba(59, 130, 246, 0.45);
|
|
102
|
+
border-radius: 50%;
|
|
103
|
+
animation: wro-ring 1.6s ease-out infinite;
|
|
104
|
+
content: "";
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.wro-call__avatar.is-connected {
|
|
108
|
+
background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);
|
|
109
|
+
box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.wro-call__avatar.is-failed {
|
|
113
|
+
background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);
|
|
114
|
+
box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.wro-call__avatar.is-ended {
|
|
118
|
+
background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);
|
|
119
|
+
box-shadow: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wro-call__name {
|
|
123
|
+
max-width: 100%;
|
|
124
|
+
margin-bottom: 8px;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
font-size: 20px;
|
|
128
|
+
line-height: 1.3;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
text-overflow: ellipsis;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.wro-call__status {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
min-height: 36px;
|
|
138
|
+
margin-bottom: 8px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.wro-call__state {
|
|
142
|
+
font-size: 14px;
|
|
143
|
+
color: #64748b;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.wro-call__state.is-calling {
|
|
147
|
+
color: #2563eb;
|
|
148
|
+
animation: wro-blink 1.5s ease-in-out infinite;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.wro-call__state.is-failed {
|
|
152
|
+
color: #dc2626;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.wro-call__state.is-timeout {
|
|
156
|
+
color: #d97706;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.wro-call__state.is-ended {
|
|
160
|
+
color: #64748b;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.wro-call__duration {
|
|
164
|
+
color: #16a34a;
|
|
165
|
+
font-weight: 700;
|
|
166
|
+
font-size: 28px;
|
|
167
|
+
font-variant-numeric: tabular-nums;
|
|
168
|
+
letter-spacing: 1px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.wro-call__actions {
|
|
172
|
+
display: flex;
|
|
173
|
+
gap: 28px;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
margin-top: 16px;
|
|
176
|
+
cursor: grab;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.wro-call__action {
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-direction: column;
|
|
182
|
+
gap: 8px;
|
|
183
|
+
align-items: center;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.wro-call__circle {
|
|
187
|
+
display: inline-flex;
|
|
188
|
+
align-items: center;
|
|
189
|
+
justify-content: center;
|
|
190
|
+
width: 56px;
|
|
191
|
+
height: 56px;
|
|
192
|
+
padding: 0;
|
|
193
|
+
color: #fff;
|
|
194
|
+
border: none;
|
|
195
|
+
border-radius: 50%;
|
|
196
|
+
box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
transition:
|
|
199
|
+
transform 0.15s ease,
|
|
200
|
+
box-shadow 0.15s ease;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.wro-call__circle:hover:not(:disabled) {
|
|
204
|
+
transform: translateY(-1px);
|
|
205
|
+
box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.wro-call__circle:disabled {
|
|
209
|
+
background: #fecaca !important;
|
|
210
|
+
box-shadow: none;
|
|
211
|
+
cursor: not-allowed;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.wro-call__circle.is-unmuted {
|
|
215
|
+
background: #16a34a;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.wro-call__circle.is-muted {
|
|
219
|
+
background: #dc2626;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.wro-call__circle.is-hangup {
|
|
223
|
+
background: #ef4444;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.wro-call__circle.is-hangup:hover:not(:disabled) {
|
|
227
|
+
background: #dc2626;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.wro-call__hangup-icon {
|
|
231
|
+
display: inline-flex;
|
|
232
|
+
transform: rotate(135deg);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.wro-call__label {
|
|
236
|
+
color: #475569;
|
|
237
|
+
font-size: 13px;
|
|
238
|
+
line-height: 1;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.wro-call-mini {
|
|
242
|
+
position: fixed;
|
|
243
|
+
top: 20px;
|
|
244
|
+
right: 20px;
|
|
245
|
+
z-index: var(--wro-modal-z);
|
|
246
|
+
display: flex;
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
gap: 4px;
|
|
249
|
+
width: 220px;
|
|
250
|
+
min-height: 64px;
|
|
251
|
+
padding: 12px 14px;
|
|
252
|
+
background: #fff;
|
|
253
|
+
border: 1px solid #e2e8f0;
|
|
254
|
+
border-radius: 12px;
|
|
255
|
+
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
|
|
256
|
+
cursor: grab;
|
|
257
|
+
user-select: none;
|
|
258
|
+
transition:
|
|
259
|
+
box-shadow 0.2s ease,
|
|
260
|
+
transform 0.2s ease;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.wro-call-mini.is-dragging {
|
|
264
|
+
cursor: grabbing;
|
|
265
|
+
transition: none;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.wro-call-mini:hover {
|
|
269
|
+
box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
|
|
270
|
+
transform: translateY(-1px);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.wro-call-mini__name {
|
|
274
|
+
overflow: hidden;
|
|
275
|
+
color: #0f172a;
|
|
276
|
+
font-weight: 600;
|
|
277
|
+
font-size: 14px;
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
text-overflow: ellipsis;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.wro-call-mini__duration {
|
|
283
|
+
color: #16a34a;
|
|
284
|
+
font-weight: 700;
|
|
285
|
+
font-size: 16px;
|
|
286
|
+
font-variant-numeric: tabular-nums;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.wro-call-mini__status {
|
|
290
|
+
color: #2563eb;
|
|
291
|
+
font-size: 12px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
@keyframes wro-blink {
|
|
295
|
+
0%,
|
|
296
|
+
100% {
|
|
297
|
+
opacity: 1;
|
|
298
|
+
}
|
|
299
|
+
50% {
|
|
300
|
+
opacity: 0.45;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@keyframes wro-ring {
|
|
305
|
+
0% {
|
|
306
|
+
transform: scale(0.92);
|
|
307
|
+
opacity: 0.7;
|
|
308
|
+
}
|
|
309
|
+
100% {
|
|
310
|
+
transform: scale(1.18);
|
|
311
|
+
opacity: 0;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* OutboundModeShell — dark workbench chrome */
|
|
316
|
+
.wro-shell {
|
|
317
|
+
--wro-shell-bg: #1a2332;
|
|
318
|
+
--wro-shell-panel: #243044;
|
|
319
|
+
--wro-shell-text: #e8eef7;
|
|
320
|
+
--wro-shell-muted: #8b9bb4;
|
|
321
|
+
--wro-shell-accent: #2dd4bf;
|
|
322
|
+
--wro-shell-green: #22c55e;
|
|
323
|
+
position: fixed;
|
|
324
|
+
top: 20px;
|
|
325
|
+
right: 20px;
|
|
326
|
+
z-index: var(--wro-modal-z);
|
|
327
|
+
width: 360px;
|
|
328
|
+
padding: 0 0 16px;
|
|
329
|
+
color: var(--wro-shell-text);
|
|
330
|
+
background: var(--wro-shell-bg);
|
|
331
|
+
border-radius: 12px;
|
|
332
|
+
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
|
|
333
|
+
cursor: grab;
|
|
334
|
+
user-select: none;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.wro-shell.is-dragging {
|
|
338
|
+
cursor: grabbing;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.wro-shell__header {
|
|
342
|
+
display: flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: space-between;
|
|
345
|
+
padding: 12px 14px;
|
|
346
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.wro-shell__title {
|
|
350
|
+
display: inline-flex;
|
|
351
|
+
gap: 8px;
|
|
352
|
+
align-items: center;
|
|
353
|
+
color: var(--wro-shell-accent);
|
|
354
|
+
font-weight: 600;
|
|
355
|
+
font-size: 14px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.wro-shell__title-icon {
|
|
359
|
+
display: inline-flex;
|
|
360
|
+
color: var(--wro-shell-accent);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.wro-shell__title-icon svg {
|
|
364
|
+
width: 16px;
|
|
365
|
+
height: 16px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.wro-shell__icon-btn {
|
|
369
|
+
display: inline-flex;
|
|
370
|
+
align-items: center;
|
|
371
|
+
justify-content: center;
|
|
372
|
+
width: 28px;
|
|
373
|
+
height: 28px;
|
|
374
|
+
padding: 0;
|
|
375
|
+
color: var(--wro-shell-muted);
|
|
376
|
+
background: transparent;
|
|
377
|
+
border: none;
|
|
378
|
+
border-radius: 6px;
|
|
379
|
+
cursor: pointer;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.wro-shell__icon-btn:hover {
|
|
383
|
+
color: var(--wro-shell-text);
|
|
384
|
+
background: rgba(255, 255, 255, 0.06);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.wro-shell__mode-bar {
|
|
388
|
+
display: flex;
|
|
389
|
+
flex-direction: column;
|
|
390
|
+
gap: 10px;
|
|
391
|
+
padding: 12px 14px 0;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.wro-shell__agent-status {
|
|
395
|
+
display: flex;
|
|
396
|
+
align-items: center;
|
|
397
|
+
justify-content: space-between;
|
|
398
|
+
color: var(--wro-shell-muted);
|
|
399
|
+
font-size: 13px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.wro-shell__agent-status-value {
|
|
403
|
+
color: var(--wro-shell-green);
|
|
404
|
+
font-weight: 600;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.wro-shell__mode-actions {
|
|
408
|
+
display: flex;
|
|
409
|
+
gap: 8px;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.wro-shell__mode-actions > * {
|
|
413
|
+
flex: 1;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.wro-shell__call-status {
|
|
417
|
+
display: flex;
|
|
418
|
+
flex-wrap: wrap;
|
|
419
|
+
gap: 6px;
|
|
420
|
+
align-items: center;
|
|
421
|
+
justify-content: center;
|
|
422
|
+
margin-top: 16px;
|
|
423
|
+
padding: 0 16px;
|
|
424
|
+
text-align: center;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.wro-shell__state {
|
|
428
|
+
color: var(--wro-shell-muted);
|
|
429
|
+
font-size: 14px;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.wro-shell__state.is-calling {
|
|
433
|
+
color: var(--wro-shell-accent);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.wro-shell__state.is-connected {
|
|
437
|
+
color: var(--wro-shell-green);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.wro-shell__state.is-failed {
|
|
441
|
+
color: #f87171;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.wro-shell__number {
|
|
445
|
+
margin-top: 8px;
|
|
446
|
+
padding: 0 16px;
|
|
447
|
+
color: #fff;
|
|
448
|
+
font-weight: 700;
|
|
449
|
+
font-size: 26px;
|
|
450
|
+
line-height: 1.2;
|
|
451
|
+
text-align: center;
|
|
452
|
+
letter-spacing: 0.5px;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.wro-shell__name {
|
|
456
|
+
margin-top: 6px;
|
|
457
|
+
padding: 0 16px;
|
|
458
|
+
overflow: hidden;
|
|
459
|
+
color: var(--wro-shell-muted);
|
|
460
|
+
font-size: 13px;
|
|
461
|
+
text-align: center;
|
|
462
|
+
white-space: nowrap;
|
|
463
|
+
text-overflow: ellipsis;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.wro-shell__idle-hint {
|
|
467
|
+
min-height: 8px;
|
|
468
|
+
margin-top: 12px;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.wro-shell__duration {
|
|
472
|
+
margin-top: 14px;
|
|
473
|
+
color: var(--wro-shell-green);
|
|
474
|
+
font-weight: 700;
|
|
475
|
+
font-size: 28px;
|
|
476
|
+
font-variant-numeric: tabular-nums;
|
|
477
|
+
text-align: center;
|
|
478
|
+
letter-spacing: 1px;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.wro-shell__actions {
|
|
482
|
+
display: flex;
|
|
483
|
+
gap: 20px;
|
|
484
|
+
justify-content: center;
|
|
485
|
+
margin-top: 14px;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.wro-shell__circle {
|
|
489
|
+
display: inline-flex;
|
|
490
|
+
align-items: center;
|
|
491
|
+
justify-content: center;
|
|
492
|
+
width: 52px;
|
|
493
|
+
height: 52px;
|
|
494
|
+
padding: 0;
|
|
495
|
+
color: #fff;
|
|
496
|
+
border: none;
|
|
497
|
+
border-radius: 50%;
|
|
498
|
+
cursor: pointer;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.wro-shell__circle.is-unmuted {
|
|
502
|
+
background: #16a34a;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.wro-shell__circle.is-muted {
|
|
506
|
+
background: #dc2626;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.wro-shell__circle.is-hangup {
|
|
510
|
+
background: #ef4444;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.wro-shell__circle:disabled {
|
|
514
|
+
opacity: 0.45;
|
|
515
|
+
cursor: not-allowed;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.wro-shell__hangup-icon {
|
|
519
|
+
display: inline-flex;
|
|
520
|
+
transform: rotate(135deg);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.wro-shell__batch {
|
|
524
|
+
margin: 16px 14px 0;
|
|
525
|
+
padding: 12px;
|
|
526
|
+
background: var(--wro-shell-panel);
|
|
527
|
+
border-radius: 8px;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.wro-shell__batch-head {
|
|
531
|
+
display: flex;
|
|
532
|
+
align-items: center;
|
|
533
|
+
justify-content: space-between;
|
|
534
|
+
margin-bottom: 8px;
|
|
535
|
+
color: var(--wro-shell-accent);
|
|
536
|
+
font-size: 13px;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
.wro-shell__batch-bar {
|
|
540
|
+
height: 6px;
|
|
541
|
+
overflow: hidden;
|
|
542
|
+
background: rgba(255, 255, 255, 0.08);
|
|
543
|
+
border-radius: 999px;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.wro-shell__batch-bar-fill {
|
|
547
|
+
height: 100%;
|
|
548
|
+
background: var(--wro-shell-accent);
|
|
549
|
+
border-radius: 999px;
|
|
550
|
+
transition: width 0.2s ease;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.wro-shell__batch-stats {
|
|
554
|
+
display: flex;
|
|
555
|
+
justify-content: space-between;
|
|
556
|
+
margin-top: 8px;
|
|
557
|
+
color: var(--wro-shell-muted);
|
|
558
|
+
font-size: 12px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.wro-shell-mini {
|
|
562
|
+
position: fixed;
|
|
563
|
+
top: 20px;
|
|
564
|
+
right: 20px;
|
|
565
|
+
z-index: var(--wro-modal-z);
|
|
566
|
+
display: flex;
|
|
567
|
+
flex-direction: column;
|
|
568
|
+
gap: 4px;
|
|
569
|
+
width: 220px;
|
|
570
|
+
min-height: 64px;
|
|
571
|
+
padding: 12px 14px;
|
|
572
|
+
color: var(--wro-shell-text, #e8eef7);
|
|
573
|
+
background: #1a2332;
|
|
574
|
+
border: 1px solid rgba(255, 255, 255, 0.08);
|
|
575
|
+
border-radius: 12px;
|
|
576
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
577
|
+
cursor: grab;
|
|
578
|
+
user-select: none;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.wro-shell-mini.is-dragging {
|
|
582
|
+
cursor: grabbing;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.wro-shell-mini__name {
|
|
586
|
+
overflow: hidden;
|
|
587
|
+
font-weight: 600;
|
|
588
|
+
font-size: 14px;
|
|
589
|
+
white-space: nowrap;
|
|
590
|
+
text-overflow: ellipsis;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.wro-shell-mini__duration {
|
|
594
|
+
color: #22c55e;
|
|
595
|
+
font-weight: 700;
|
|
596
|
+
font-size: 16px;
|
|
597
|
+
font-variant-numeric: tabular-nums;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.wro-shell-mini__status {
|
|
601
|
+
color: #2dd4bf;
|
|
602
|
+
font-size: 12px;
|
|
603
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Auto-generated from styles.css — do not edit. */
|
|
2
|
+
export declare const STYLES_CSS = "/* @yinshan-tech/webrtc-react \u2014 override via CSS variables / className */\n\n.wro-root {\n --wro-btn-bg: #ef4444;\n --wro-btn-color: #fff;\n --wro-btn-radius: 8px;\n --wro-btn-padding: 6px 14px;\n --wro-btn-font-size: 14px;\n --wro-modal-z: 1000;\n font-family:\n system-ui,\n -apple-system,\n \"Segoe UI\",\n Roboto,\n sans-serif;\n}\n\n.wro-btn {\n background: var(--wro-btn-bg);\n color: var(--wro-btn-color);\n border: none;\n border-radius: var(--wro-btn-radius);\n padding: var(--wro-btn-padding);\n font-size: var(--wro-btn-font-size);\n cursor: pointer;\n}\n\n.wro-btn:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n\n/* Floating call card (no full-screen mask) */\n.wro-call {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 320px;\n padding: 20px 24px 28px;\n background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%);\n color: #0f172a;\n border-radius: 20px;\n box-shadow:\n 0 12px 40px rgba(15, 23, 42, 0.16),\n 0 2px 8px rgba(15, 23, 42, 0.06);\n text-align: center;\n cursor: grab;\n user-select: none;\n}\n\n.wro-call.is-dragging {\n cursor: grabbing;\n}\n\n.wro-call button {\n cursor: pointer;\n}\n\n.wro-call__minimize {\n position: absolute;\n top: 10px;\n right: 10px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: rgba(0, 0, 0, 0.45);\n background: transparent;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n}\n\n.wro-call__minimize:hover {\n color: rgba(0, 0, 0, 0.85);\n background: rgba(0, 0, 0, 0.06);\n}\n\n.wro-call__avatar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 72px;\n margin: 8px auto 16px;\n color: #fff;\n font-weight: 600;\n font-size: 28px;\n background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);\n border-radius: 50%;\n box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);\n}\n\n.wro-call__avatar.is-calling::after {\n position: absolute;\n inset: -6px;\n border: 2px solid rgba(59, 130, 246, 0.45);\n border-radius: 50%;\n animation: wro-ring 1.6s ease-out infinite;\n content: \"\";\n}\n\n.wro-call__avatar.is-connected {\n background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);\n box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);\n}\n\n.wro-call__avatar.is-failed {\n background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);\n box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);\n}\n\n.wro-call__avatar.is-ended {\n background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);\n box-shadow: none;\n}\n\n.wro-call__name {\n max-width: 100%;\n margin-bottom: 8px;\n overflow: hidden;\n font-weight: 600;\n font-size: 20px;\n line-height: 1.3;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call__status {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n margin-bottom: 8px;\n}\n\n.wro-call__state {\n font-size: 14px;\n color: #64748b;\n}\n\n.wro-call__state.is-calling {\n color: #2563eb;\n animation: wro-blink 1.5s ease-in-out infinite;\n}\n\n.wro-call__state.is-failed {\n color: #dc2626;\n}\n\n.wro-call__state.is-timeout {\n color: #d97706;\n}\n\n.wro-call__state.is-ended {\n color: #64748b;\n}\n\n.wro-call__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n letter-spacing: 1px;\n}\n\n.wro-call__actions {\n display: flex;\n gap: 28px;\n justify-content: center;\n margin-top: 16px;\n cursor: grab;\n}\n\n.wro-call__action {\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n}\n\n.wro-call__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);\n cursor: pointer;\n transition:\n transform 0.15s ease,\n box-shadow 0.15s ease;\n}\n\n.wro-call__circle:hover:not(:disabled) {\n transform: translateY(-1px);\n box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);\n}\n\n.wro-call__circle:disabled {\n background: #fecaca !important;\n box-shadow: none;\n cursor: not-allowed;\n}\n\n.wro-call__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-call__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-call__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-call__circle.is-hangup:hover:not(:disabled) {\n background: #dc2626;\n}\n\n.wro-call__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-call__label {\n color: #475569;\n font-size: 13px;\n line-height: 1;\n}\n\n.wro-call-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n background: #fff;\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\n cursor: grab;\n user-select: none;\n transition:\n box-shadow 0.2s ease,\n transform 0.2s ease;\n}\n\n.wro-call-mini.is-dragging {\n cursor: grabbing;\n transition: none;\n}\n\n.wro-call-mini:hover {\n box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);\n transform: translateY(-1px);\n}\n\n.wro-call-mini__name {\n overflow: hidden;\n color: #0f172a;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call-mini__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-call-mini__status {\n color: #2563eb;\n font-size: 12px;\n}\n\n@keyframes wro-blink {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.45;\n }\n}\n\n@keyframes wro-ring {\n 0% {\n transform: scale(0.92);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1.18);\n opacity: 0;\n }\n}\n\n/* OutboundModeShell \u2014 dark workbench chrome */\n.wro-shell {\n --wro-shell-bg: #1a2332;\n --wro-shell-panel: #243044;\n --wro-shell-text: #e8eef7;\n --wro-shell-muted: #8b9bb4;\n --wro-shell-accent: #2dd4bf;\n --wro-shell-green: #22c55e;\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 360px;\n padding: 0 0 16px;\n color: var(--wro-shell-text);\n background: var(--wro-shell-bg);\n border-radius: 12px;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 14px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__title {\n display: inline-flex;\n gap: 8px;\n align-items: center;\n color: var(--wro-shell-accent);\n font-weight: 600;\n font-size: 14px;\n}\n\n.wro-shell__title-icon {\n display: inline-flex;\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__title-icon svg {\n width: 16px;\n height: 16px;\n}\n\n.wro-shell__icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: var(--wro-shell-muted);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n}\n\n.wro-shell__icon-btn:hover {\n color: var(--wro-shell-text);\n background: rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__mode-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 12px 14px 0;\n}\n\n.wro-shell__agent-status {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--wro-shell-muted);\n font-size: 13px;\n}\n\n.wro-shell__agent-status-value {\n color: var(--wro-shell-green);\n font-weight: 600;\n}\n\n.wro-shell__mode-actions {\n display: flex;\n gap: 8px;\n}\n\n.wro-shell__mode-actions > * {\n flex: 1;\n}\n\n.wro-shell__call-status {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n justify-content: center;\n margin-top: 16px;\n padding: 0 16px;\n text-align: center;\n}\n\n.wro-shell__state {\n color: var(--wro-shell-muted);\n font-size: 14px;\n}\n\n.wro-shell__state.is-calling {\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__state.is-connected {\n color: var(--wro-shell-green);\n}\n\n.wro-shell__state.is-failed {\n color: #f87171;\n}\n\n.wro-shell__number {\n margin-top: 8px;\n padding: 0 16px;\n color: #fff;\n font-weight: 700;\n font-size: 26px;\n line-height: 1.2;\n text-align: center;\n letter-spacing: 0.5px;\n}\n\n.wro-shell__name {\n margin-top: 6px;\n padding: 0 16px;\n overflow: hidden;\n color: var(--wro-shell-muted);\n font-size: 13px;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell__idle-hint {\n min-height: 8px;\n margin-top: 12px;\n}\n\n.wro-shell__duration {\n margin-top: 14px;\n color: var(--wro-shell-green);\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n text-align: center;\n letter-spacing: 1px;\n}\n\n.wro-shell__actions {\n display: flex;\n gap: 20px;\n justify-content: center;\n margin-top: 14px;\n}\n\n.wro-shell__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 52px;\n height: 52px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.wro-shell__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-shell__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-shell__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-shell__circle:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.wro-shell__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-shell__batch {\n margin: 16px 14px 0;\n padding: 12px;\n background: var(--wro-shell-panel);\n border-radius: 8px;\n}\n\n.wro-shell__batch-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n color: var(--wro-shell-accent);\n font-size: 13px;\n}\n\n.wro-shell__batch-bar {\n height: 6px;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.08);\n border-radius: 999px;\n}\n\n.wro-shell__batch-bar-fill {\n height: 100%;\n background: var(--wro-shell-accent);\n border-radius: 999px;\n transition: width 0.2s ease;\n}\n\n.wro-shell__batch-stats {\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n color: var(--wro-shell-muted);\n font-size: 12px;\n}\n\n.wro-shell-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n color: var(--wro-shell-text, #e8eef7);\n background: #1a2332;\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell-mini.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell-mini__name {\n overflow: hidden;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell-mini__duration {\n color: #22c55e;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-shell-mini__status {\n color: #2dd4bf;\n font-size: 12px;\n}\n";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Auto-generated from styles.css — do not edit. */
|
|
2
|
+
export const STYLES_CSS = "/* @yinshan-tech/webrtc-react — override via CSS variables / className */\n\n.wro-root {\n --wro-btn-bg: #ef4444;\n --wro-btn-color: #fff;\n --wro-btn-radius: 8px;\n --wro-btn-padding: 6px 14px;\n --wro-btn-font-size: 14px;\n --wro-modal-z: 1000;\n font-family:\n system-ui,\n -apple-system,\n \"Segoe UI\",\n Roboto,\n sans-serif;\n}\n\n.wro-btn {\n background: var(--wro-btn-bg);\n color: var(--wro-btn-color);\n border: none;\n border-radius: var(--wro-btn-radius);\n padding: var(--wro-btn-padding);\n font-size: var(--wro-btn-font-size);\n cursor: pointer;\n}\n\n.wro-btn:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n\n/* Floating call card (no full-screen mask) */\n.wro-call {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 320px;\n padding: 20px 24px 28px;\n background: linear-gradient(180deg, #f8fafc 0%, #ffffff 42%);\n color: #0f172a;\n border-radius: 20px;\n box-shadow:\n 0 12px 40px rgba(15, 23, 42, 0.16),\n 0 2px 8px rgba(15, 23, 42, 0.06);\n text-align: center;\n cursor: grab;\n user-select: none;\n}\n\n.wro-call.is-dragging {\n cursor: grabbing;\n}\n\n.wro-call button {\n cursor: pointer;\n}\n\n.wro-call__minimize {\n position: absolute;\n top: 10px;\n right: 10px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: rgba(0, 0, 0, 0.45);\n background: transparent;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n}\n\n.wro-call__minimize:hover {\n color: rgba(0, 0, 0, 0.85);\n background: rgba(0, 0, 0, 0.06);\n}\n\n.wro-call__avatar {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 72px;\n margin: 8px auto 16px;\n color: #fff;\n font-weight: 600;\n font-size: 28px;\n background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);\n border-radius: 50%;\n box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);\n}\n\n.wro-call__avatar.is-calling::after {\n position: absolute;\n inset: -6px;\n border: 2px solid rgba(59, 130, 246, 0.45);\n border-radius: 50%;\n animation: wro-ring 1.6s ease-out infinite;\n content: \"\";\n}\n\n.wro-call__avatar.is-connected {\n background: linear-gradient(145deg, #22c55e 0%, #15803d 100%);\n box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);\n}\n\n.wro-call__avatar.is-failed {\n background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);\n box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);\n}\n\n.wro-call__avatar.is-ended {\n background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);\n box-shadow: none;\n}\n\n.wro-call__name {\n max-width: 100%;\n margin-bottom: 8px;\n overflow: hidden;\n font-weight: 600;\n font-size: 20px;\n line-height: 1.3;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call__status {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n margin-bottom: 8px;\n}\n\n.wro-call__state {\n font-size: 14px;\n color: #64748b;\n}\n\n.wro-call__state.is-calling {\n color: #2563eb;\n animation: wro-blink 1.5s ease-in-out infinite;\n}\n\n.wro-call__state.is-failed {\n color: #dc2626;\n}\n\n.wro-call__state.is-timeout {\n color: #d97706;\n}\n\n.wro-call__state.is-ended {\n color: #64748b;\n}\n\n.wro-call__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n letter-spacing: 1px;\n}\n\n.wro-call__actions {\n display: flex;\n gap: 28px;\n justify-content: center;\n margin-top: 16px;\n cursor: grab;\n}\n\n.wro-call__action {\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: center;\n}\n\n.wro-call__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 56px;\n height: 56px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);\n cursor: pointer;\n transition:\n transform 0.15s ease,\n box-shadow 0.15s ease;\n}\n\n.wro-call__circle:hover:not(:disabled) {\n transform: translateY(-1px);\n box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);\n}\n\n.wro-call__circle:disabled {\n background: #fecaca !important;\n box-shadow: none;\n cursor: not-allowed;\n}\n\n.wro-call__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-call__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-call__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-call__circle.is-hangup:hover:not(:disabled) {\n background: #dc2626;\n}\n\n.wro-call__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-call__label {\n color: #475569;\n font-size: 13px;\n line-height: 1;\n}\n\n.wro-call-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n background: #fff;\n border: 1px solid #e2e8f0;\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);\n cursor: grab;\n user-select: none;\n transition:\n box-shadow 0.2s ease,\n transform 0.2s ease;\n}\n\n.wro-call-mini.is-dragging {\n cursor: grabbing;\n transition: none;\n}\n\n.wro-call-mini:hover {\n box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);\n transform: translateY(-1px);\n}\n\n.wro-call-mini__name {\n overflow: hidden;\n color: #0f172a;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-call-mini__duration {\n color: #16a34a;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-call-mini__status {\n color: #2563eb;\n font-size: 12px;\n}\n\n@keyframes wro-blink {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.45;\n }\n}\n\n@keyframes wro-ring {\n 0% {\n transform: scale(0.92);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1.18);\n opacity: 0;\n }\n}\n\n/* OutboundModeShell — dark workbench chrome */\n.wro-shell {\n --wro-shell-bg: #1a2332;\n --wro-shell-panel: #243044;\n --wro-shell-text: #e8eef7;\n --wro-shell-muted: #8b9bb4;\n --wro-shell-accent: #2dd4bf;\n --wro-shell-green: #22c55e;\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n width: 360px;\n padding: 0 0 16px;\n color: var(--wro-shell-text);\n background: var(--wro-shell-bg);\n border-radius: 12px;\n box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 14px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__title {\n display: inline-flex;\n gap: 8px;\n align-items: center;\n color: var(--wro-shell-accent);\n font-weight: 600;\n font-size: 14px;\n}\n\n.wro-shell__title-icon {\n display: inline-flex;\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__title-icon svg {\n width: 16px;\n height: 16px;\n}\n\n.wro-shell__icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n color: var(--wro-shell-muted);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n}\n\n.wro-shell__icon-btn:hover {\n color: var(--wro-shell-text);\n background: rgba(255, 255, 255, 0.06);\n}\n\n.wro-shell__mode-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 12px 14px 0;\n}\n\n.wro-shell__agent-status {\n display: flex;\n align-items: center;\n justify-content: space-between;\n color: var(--wro-shell-muted);\n font-size: 13px;\n}\n\n.wro-shell__agent-status-value {\n color: var(--wro-shell-green);\n font-weight: 600;\n}\n\n.wro-shell__mode-actions {\n display: flex;\n gap: 8px;\n}\n\n.wro-shell__mode-actions > * {\n flex: 1;\n}\n\n.wro-shell__call-status {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n justify-content: center;\n margin-top: 16px;\n padding: 0 16px;\n text-align: center;\n}\n\n.wro-shell__state {\n color: var(--wro-shell-muted);\n font-size: 14px;\n}\n\n.wro-shell__state.is-calling {\n color: var(--wro-shell-accent);\n}\n\n.wro-shell__state.is-connected {\n color: var(--wro-shell-green);\n}\n\n.wro-shell__state.is-failed {\n color: #f87171;\n}\n\n.wro-shell__number {\n margin-top: 8px;\n padding: 0 16px;\n color: #fff;\n font-weight: 700;\n font-size: 26px;\n line-height: 1.2;\n text-align: center;\n letter-spacing: 0.5px;\n}\n\n.wro-shell__name {\n margin-top: 6px;\n padding: 0 16px;\n overflow: hidden;\n color: var(--wro-shell-muted);\n font-size: 13px;\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell__idle-hint {\n min-height: 8px;\n margin-top: 12px;\n}\n\n.wro-shell__duration {\n margin-top: 14px;\n color: var(--wro-shell-green);\n font-weight: 700;\n font-size: 28px;\n font-variant-numeric: tabular-nums;\n text-align: center;\n letter-spacing: 1px;\n}\n\n.wro-shell__actions {\n display: flex;\n gap: 20px;\n justify-content: center;\n margin-top: 14px;\n}\n\n.wro-shell__circle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 52px;\n height: 52px;\n padding: 0;\n color: #fff;\n border: none;\n border-radius: 50%;\n cursor: pointer;\n}\n\n.wro-shell__circle.is-unmuted {\n background: #16a34a;\n}\n\n.wro-shell__circle.is-muted {\n background: #dc2626;\n}\n\n.wro-shell__circle.is-hangup {\n background: #ef4444;\n}\n\n.wro-shell__circle:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n.wro-shell__hangup-icon {\n display: inline-flex;\n transform: rotate(135deg);\n}\n\n.wro-shell__batch {\n margin: 16px 14px 0;\n padding: 12px;\n background: var(--wro-shell-panel);\n border-radius: 8px;\n}\n\n.wro-shell__batch-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 8px;\n color: var(--wro-shell-accent);\n font-size: 13px;\n}\n\n.wro-shell__batch-bar {\n height: 6px;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.08);\n border-radius: 999px;\n}\n\n.wro-shell__batch-bar-fill {\n height: 100%;\n background: var(--wro-shell-accent);\n border-radius: 999px;\n transition: width 0.2s ease;\n}\n\n.wro-shell__batch-stats {\n display: flex;\n justify-content: space-between;\n margin-top: 8px;\n color: var(--wro-shell-muted);\n font-size: 12px;\n}\n\n.wro-shell-mini {\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: var(--wro-modal-z);\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 220px;\n min-height: 64px;\n padding: 12px 14px;\n color: var(--wro-shell-text, #e8eef7);\n background: #1a2332;\n border: 1px solid rgba(255, 255, 255, 0.08);\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n cursor: grab;\n user-select: none;\n}\n\n.wro-shell-mini.is-dragging {\n cursor: grabbing;\n}\n\n.wro-shell-mini__name {\n overflow: hidden;\n font-weight: 600;\n font-size: 14px;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.wro-shell-mini__duration {\n color: #22c55e;\n font-weight: 700;\n font-size: 16px;\n font-variant-numeric: tabular-nums;\n}\n\n.wro-shell-mini__status {\n color: #2dd4bf;\n font-size: 12px;\n}\n";
|
|
3
|
+
//# sourceMappingURL=stylesInject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stylesInject.js","sourceRoot":"","sources":["../src/stylesInject.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,+rWAA+rW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yinshan-tech/webrtc-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React UI for @yinshan-tech/webrtc-sdk:
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "React UI for @yinshan-tech/webrtc-sdk Softphone: button, call widget, hooks (no antd)",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./styles.css": "./dist/styles.css"
|
|
15
|
+
},
|
|
7
16
|
"sideEffects": [
|
|
8
17
|
"./dist/styles.css"
|
|
9
18
|
],
|
|
@@ -12,20 +21,25 @@
|
|
|
12
21
|
"README.md"
|
|
13
22
|
],
|
|
14
23
|
"scripts": {
|
|
15
|
-
"
|
|
24
|
+
"prebuild": "node scripts/embed-css.mjs",
|
|
25
|
+
"build": "rm -rf dist && npm run prebuild && tsc -p tsconfig.json && cp src/styles.css dist/styles.css",
|
|
26
|
+
"prepare": "npm run build",
|
|
27
|
+
"prepublishOnly": "npm run build"
|
|
16
28
|
},
|
|
17
29
|
"peerDependencies": {
|
|
18
|
-
"@yinshan-tech/webrtc-sdk": "^0.
|
|
19
|
-
"react": ">=
|
|
20
|
-
"react-dom": ">=
|
|
30
|
+
"@yinshan-tech/webrtc-sdk": "^0.8.0",
|
|
31
|
+
"react": ">=18.0.0",
|
|
32
|
+
"react-dom": ">=18.0.0"
|
|
21
33
|
},
|
|
22
34
|
"devDependencies": {
|
|
23
|
-
"@types/react": "^
|
|
24
|
-
"@types/react-dom": "^
|
|
35
|
+
"@types/react": "^18.3.0",
|
|
36
|
+
"@types/react-dom": "^18.3.0",
|
|
37
|
+
"@yinshan-tech/webrtc-sdk": "file:../webrtc-sdk",
|
|
25
38
|
"typescript": "^4.8.3"
|
|
26
39
|
},
|
|
27
40
|
"keywords": [
|
|
28
41
|
"webrtc",
|
|
42
|
+
"softphone",
|
|
29
43
|
"outbound",
|
|
30
44
|
"react",
|
|
31
45
|
"call-center"
|