@coventia/softphone 0.2.1 → 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.
Files changed (38) hide show
  1. package/dist/{call-VKq1I8yP.d.cts → call-CaPDWVk3.d.cts} +44 -1
  2. package/dist/{call-VKq1I8yP.d.ts → call-CaPDWVk3.d.ts} +44 -1
  3. package/dist/{chunk-LMJXX4YM.js → chunk-UHNLEBBO.js} +4 -2
  4. package/dist/chunk-UHNLEBBO.js.map +1 -0
  5. package/dist/element/index.d.ts +68 -9
  6. package/dist/element/index.js +962 -114
  7. package/dist/element/index.js.map +1 -1
  8. package/dist/{engine-C0BOkIcW.d.ts → engine-BgBsIcEa.d.ts} +1 -1
  9. package/dist/{engine-BlQBo2Ys.d.cts → engine-CU2rEo3g.d.cts} +1 -1
  10. package/dist/index.cjs +120 -10
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +5 -5
  13. package/dist/index.d.ts +5 -5
  14. package/dist/index.js +69 -10
  15. package/dist/index.js.map +1 -1
  16. package/dist/react/index.cjs +2 -0
  17. package/dist/react/index.cjs.map +1 -1
  18. package/dist/react/index.d.cts +2 -2
  19. package/dist/react/index.d.ts +2 -2
  20. package/dist/react/index.js +1 -1
  21. package/dist/{softphone-Cyq3hiIM.d.ts → softphone-DEt0TtQw.d.ts} +26 -10
  22. package/dist/{softphone-DlGV12Xp.d.cts → softphone-dZMkW8V1.d.cts} +26 -10
  23. package/dist/softphone.css +110 -12
  24. package/dist/{sources-IRKNQPWW.js → sources-M3GYMS6V.js} +54 -3
  25. package/dist/sources-M3GYMS6V.js.map +1 -0
  26. package/dist/testing/index.d.cts +2 -2
  27. package/dist/testing/index.d.ts +2 -2
  28. package/dist/ui/index.cjs +885 -28
  29. package/dist/ui/index.cjs.map +1 -1
  30. package/dist/ui/index.d.cts +25 -3
  31. package/dist/ui/index.d.ts +25 -3
  32. package/dist/ui/index.js +885 -31
  33. package/dist/ui/index.js.map +1 -1
  34. package/dist/zadarma/index.d.cts +2 -2
  35. package/dist/zadarma/index.d.ts +2 -2
  36. package/package.json +1 -1
  37. package/dist/chunk-LMJXX4YM.js.map +0 -1
  38. package/dist/sources-IRKNQPWW.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { g as Contact, u as ContactsSource, v as HistorySource, a as Call } from '../call-VKq1I8yP.cjs';
4
- export { y as CallHistoryEntry, z as ContactsPage } from '../call-VKq1I8yP.cjs';
3
+ import { g as Contact, x as ContactsSource, y as HistorySource, a as Call, k as RingtoneOption } from '../call-CaPDWVk3.cjs';
4
+ export { D as CallHistoryEntry, G as ContactsPage } from '../call-CaPDWVk3.cjs';
5
5
 
6
6
  /**
7
7
  * Shaped like a Lucide icon (`size`, `className`, both optional — every SVG prop Lucide's own icons
@@ -196,4 +196,26 @@ declare function HistoryTab({ source }: Readonly<{
196
196
  source: HistorySource;
197
197
  }>): react.JSX.Element;
198
198
 
199
- export { CallScreen, ContactsSource, ContactsTab, Dialpad, HistorySource, HistoryTab, MicPermissionGate, type SoftphoneTheme, SoftphoneWidget, type SoftphoneWidgetProps };
199
+ /** A running preview. */
200
+ interface RingtonePreview {
201
+ /** Stops it now. Safe to call more than once, and after it ended. */
202
+ stop(): void;
203
+ /**
204
+ * Settles once the preview is over — played to its end, or `stop()` called. Rejects only when the file
205
+ * could not be downloaded or decoded (a `stop()` before that resolves it instead).
206
+ */
207
+ readonly done: Promise<void>;
208
+ }
209
+ /**
210
+ * Plays one ringtone briefly, the way the softphone's Ajustes does — same sound, level, loop points and
211
+ * length. For a host's own ringtone picker where no softphone is involved, such as an organization-default
212
+ * setting (custom-ringtone.md §4.7): the built-in "Clásico" (`url: null`) is generated in code, so there is
213
+ * no file such a page could play by itself.
214
+ *
215
+ * Call it from a user gesture (a click): that is when a browser lets audio start.
216
+ */
217
+ declare function previewRingtone(ringtone: Pick<RingtoneOption, 'url'> & Partial<Pick<RingtoneOption, 'loop'>>, options?: {
218
+ readonly sinkId?: string | null;
219
+ }): RingtonePreview;
220
+
221
+ export { CallScreen, ContactsSource, ContactsTab, Dialpad, HistorySource, HistoryTab, MicPermissionGate, type RingtonePreview, type SoftphoneTheme, SoftphoneWidget, type SoftphoneWidgetProps, previewRingtone };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { g as Contact, u as ContactsSource, v as HistorySource, a as Call } from '../call-VKq1I8yP.js';
4
- export { y as CallHistoryEntry, z as ContactsPage } from '../call-VKq1I8yP.js';
3
+ import { g as Contact, x as ContactsSource, y as HistorySource, a as Call, k as RingtoneOption } from '../call-CaPDWVk3.js';
4
+ export { D as CallHistoryEntry, G as ContactsPage } from '../call-CaPDWVk3.js';
5
5
 
6
6
  /**
7
7
  * Shaped like a Lucide icon (`size`, `className`, both optional — every SVG prop Lucide's own icons
@@ -196,4 +196,26 @@ declare function HistoryTab({ source }: Readonly<{
196
196
  source: HistorySource;
197
197
  }>): react.JSX.Element;
198
198
 
199
- export { CallScreen, ContactsSource, ContactsTab, Dialpad, HistorySource, HistoryTab, MicPermissionGate, type SoftphoneTheme, SoftphoneWidget, type SoftphoneWidgetProps };
199
+ /** A running preview. */
200
+ interface RingtonePreview {
201
+ /** Stops it now. Safe to call more than once, and after it ended. */
202
+ stop(): void;
203
+ /**
204
+ * Settles once the preview is over — played to its end, or `stop()` called. Rejects only when the file
205
+ * could not be downloaded or decoded (a `stop()` before that resolves it instead).
206
+ */
207
+ readonly done: Promise<void>;
208
+ }
209
+ /**
210
+ * Plays one ringtone briefly, the way the softphone's Ajustes does — same sound, level, loop points and
211
+ * length. For a host's own ringtone picker where no softphone is involved, such as an organization-default
212
+ * setting (custom-ringtone.md §4.7): the built-in "Clásico" (`url: null`) is generated in code, so there is
213
+ * no file such a page could play by itself.
214
+ *
215
+ * Call it from a user gesture (a click): that is when a browser lets audio start.
216
+ */
217
+ declare function previewRingtone(ringtone: Pick<RingtoneOption, 'url'> & Partial<Pick<RingtoneOption, 'loop'>>, options?: {
218
+ readonly sinkId?: string | null;
219
+ }): RingtonePreview;
220
+
221
+ export { CallScreen, ContactsSource, ContactsTab, Dialpad, HistorySource, HistoryTab, MicPermissionGate, type RingtonePreview, type SoftphoneTheme, SoftphoneWidget, type SoftphoneWidgetProps, previewRingtone };