@coventia/softphone 0.2.0 → 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 (47) hide show
  1. package/dist/{call-DUVnDxsz.d.cts → call-CaPDWVk3.d.cts} +50 -1
  2. package/dist/{call-DUVnDxsz.d.ts → call-CaPDWVk3.d.ts} +50 -1
  3. package/dist/{chunk-YWI6EQYS.js → chunk-EYEDPD7Y.js} +108 -15
  4. package/dist/chunk-EYEDPD7Y.js.map +1 -0
  5. package/dist/{chunk-LMJXX4YM.js → chunk-UHNLEBBO.js} +4 -2
  6. package/dist/chunk-UHNLEBBO.js.map +1 -0
  7. package/dist/element/index.d.ts +76 -11
  8. package/dist/element/index.js +1411 -478
  9. package/dist/element/index.js.map +1 -1
  10. package/dist/{engine-EPCKf-Bl.d.ts → engine-BgBsIcEa.d.ts} +1 -1
  11. package/dist/{engine-CDjkrXHY.d.cts → engine-CU2rEo3g.d.cts} +1 -1
  12. package/dist/index.cjs +318 -32
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +5 -5
  15. package/dist/index.d.ts +5 -5
  16. package/dist/index.js +157 -19
  17. package/dist/index.js.map +1 -1
  18. package/dist/react/index.cjs +2 -0
  19. package/dist/react/index.cjs.map +1 -1
  20. package/dist/react/index.d.cts +2 -2
  21. package/dist/react/index.d.ts +2 -2
  22. package/dist/react/index.js +1 -1
  23. package/dist/{softphone-BtdgZWkm.d.ts → softphone-DEt0TtQw.d.ts} +26 -10
  24. package/dist/{softphone-DHG9MTNg.d.cts → softphone-dZMkW8V1.d.cts} +26 -10
  25. package/dist/softphone.css +192 -46
  26. package/dist/{sources-5L2R4HTV.js → sources-M3GYMS6V.js} +58 -3
  27. package/dist/sources-M3GYMS6V.js.map +1 -0
  28. package/dist/testing/index.d.cts +2 -2
  29. package/dist/testing/index.d.ts +2 -2
  30. package/dist/ui/index.cjs +1308 -366
  31. package/dist/ui/index.cjs.map +1 -1
  32. package/dist/ui/index.d.cts +40 -7
  33. package/dist/ui/index.d.ts +40 -7
  34. package/dist/ui/index.js +1308 -369
  35. package/dist/ui/index.js.map +1 -1
  36. package/dist/zadarma/index.cjs +106 -13
  37. package/dist/zadarma/index.cjs.map +1 -1
  38. package/dist/zadarma/index.d.cts +2 -2
  39. package/dist/zadarma/index.d.ts +2 -2
  40. package/dist/zadarma/index.js +1 -1
  41. package/dist/zadarma-engine-L5DEFXUS.js +5 -0
  42. package/dist/{zadarma-engine-4VOPIBXG.js.map → zadarma-engine-L5DEFXUS.js.map} +1 -1
  43. package/package.json +1 -1
  44. package/dist/chunk-LMJXX4YM.js.map +0 -1
  45. package/dist/chunk-YWI6EQYS.js.map +0 -1
  46. package/dist/sources-5L2R4HTV.js.map +0 -1
  47. package/dist/zadarma-engine-4VOPIBXG.js +0 -5
@@ -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-DUVnDxsz.cjs';
4
- export { y as CallHistoryEntry, z as ContactsPage } from '../call-DUVnDxsz.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
@@ -75,8 +75,9 @@ interface SoftphoneWidgetProps {
75
75
  */
76
76
  readonly requireMic?: boolean;
77
77
  /**
78
- * Play call audio: the remote party, the inbound ring, the outbound ringback, and a short cue when
79
- * a connected call ends — by either side. **On by default.**
78
+ * Play call audio: the remote party, the inbound ring, the outbound ringback, a short cue when a
79
+ * connected call ends — by either side — and a key tone for each keypad press (the dialer, and the
80
+ * in-call keypad that sends DTMF). **On by default.**
80
81
  *
81
82
  * The remote-party half is not a nicety — nothing else attaches the `MediaStream`, so with this
82
83
  * off a connected call is silent in both directions. Turn it off only if the host attaches
@@ -149,13 +150,23 @@ interface DialpadProps {
149
150
  } | null;
150
151
  /** Called on any action that supersedes that outcome: a digit, a backspace, a dial. */
151
152
  readonly onIntent?: () => void;
153
+ /**
154
+ * Play a key tone when a digit is pressed. **On by default**; `SoftphoneWidget` passes its own
155
+ * `sounds` flag, so a host that silences the widget silences this too.
156
+ */
157
+ readonly keyTones?: boolean;
152
158
  }
153
- declare function Dialpad({ outcome, onIntent }?: DialpadProps): react.JSX.Element;
159
+ declare function Dialpad({ outcome, onIntent, keyTones }?: DialpadProps): react.JSX.Element;
154
160
 
155
161
  /** The active-call view: incoming, outgoing and in-call in one, switched on call.state. */
156
- declare function CallScreen({ call, incomingCallAction, }: Readonly<{
162
+ declare function CallScreen({ call, incomingCallAction, keyTones, }: Readonly<{
157
163
  call: Call;
158
164
  incomingCallAction?: ContactAction;
165
+ /**
166
+ * Play a tone for each keypad press. **On by default**; `SoftphoneWidget` passes its own `sounds`
167
+ * flag, so a host that silences the widget silences this too.
168
+ */
169
+ keyTones?: boolean;
159
170
  }>): react.JSX.Element | null;
160
171
 
161
172
  /**
@@ -185,4 +196,26 @@ declare function HistoryTab({ source }: Readonly<{
185
196
  source: HistorySource;
186
197
  }>): react.JSX.Element;
187
198
 
188
- 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-DUVnDxsz.js';
4
- export { y as CallHistoryEntry, z as ContactsPage } from '../call-DUVnDxsz.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
@@ -75,8 +75,9 @@ interface SoftphoneWidgetProps {
75
75
  */
76
76
  readonly requireMic?: boolean;
77
77
  /**
78
- * Play call audio: the remote party, the inbound ring, the outbound ringback, and a short cue when
79
- * a connected call ends — by either side. **On by default.**
78
+ * Play call audio: the remote party, the inbound ring, the outbound ringback, a short cue when a
79
+ * connected call ends — by either side — and a key tone for each keypad press (the dialer, and the
80
+ * in-call keypad that sends DTMF). **On by default.**
80
81
  *
81
82
  * The remote-party half is not a nicety — nothing else attaches the `MediaStream`, so with this
82
83
  * off a connected call is silent in both directions. Turn it off only if the host attaches
@@ -149,13 +150,23 @@ interface DialpadProps {
149
150
  } | null;
150
151
  /** Called on any action that supersedes that outcome: a digit, a backspace, a dial. */
151
152
  readonly onIntent?: () => void;
153
+ /**
154
+ * Play a key tone when a digit is pressed. **On by default**; `SoftphoneWidget` passes its own
155
+ * `sounds` flag, so a host that silences the widget silences this too.
156
+ */
157
+ readonly keyTones?: boolean;
152
158
  }
153
- declare function Dialpad({ outcome, onIntent }?: DialpadProps): react.JSX.Element;
159
+ declare function Dialpad({ outcome, onIntent, keyTones }?: DialpadProps): react.JSX.Element;
154
160
 
155
161
  /** The active-call view: incoming, outgoing and in-call in one, switched on call.state. */
156
- declare function CallScreen({ call, incomingCallAction, }: Readonly<{
162
+ declare function CallScreen({ call, incomingCallAction, keyTones, }: Readonly<{
157
163
  call: Call;
158
164
  incomingCallAction?: ContactAction;
165
+ /**
166
+ * Play a tone for each keypad press. **On by default**; `SoftphoneWidget` passes its own `sounds`
167
+ * flag, so a host that silences the widget silences this too.
168
+ */
169
+ keyTones?: boolean;
159
170
  }>): react.JSX.Element | null;
160
171
 
161
172
  /**
@@ -185,4 +196,26 @@ declare function HistoryTab({ source }: Readonly<{
185
196
  source: HistorySource;
186
197
  }>): react.JSX.Element;
187
198
 
188
- 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 };