@sippet-ai/operator-widget 0.0.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/LICENSE +2 -0
- package/README.md +136 -0
- package/cdn/loader.js +146 -0
- package/custom-elements.json +2241 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/voip-widget/index.d.ts +18 -0
- package/dist/components/voip-widget/index.js +4 -0
- package/dist/components/voip-widget/voip-widget-contacts-tab.d.ts +14 -0
- package/dist/components/voip-widget/voip-widget-contacts-tab.js +45 -0
- package/dist/components/voip-widget/voip-widget-history-tab.d.ts +13 -0
- package/dist/components/voip-widget/voip-widget-history-tab.js +43 -0
- package/dist/components/voip-widget/voip-widget-launcher.d.ts +18 -0
- package/dist/components/voip-widget/voip-widget-launcher.js +100 -0
- package/dist/components/voip-widget/voip-widget-panel.d.ts +21 -0
- package/dist/components/voip-widget/voip-widget-panel.js +193 -0
- package/dist/components/voip-widget/voip-widget-phone-tab.d.ts +21 -0
- package/dist/components/voip-widget/voip-widget-phone-tab.js +187 -0
- package/dist/components/voip-widget/voip-widget-queue-tab.d.ts +14 -0
- package/dist/components/voip-widget/voip-widget-queue-tab.js +49 -0
- package/dist/components/voip-widget/voip-widget-settings-tab.d.ts +21 -0
- package/dist/components/voip-widget/voip-widget-settings-tab.js +135 -0
- package/dist/components/voip-widget/voip-widget.d.ts +142 -0
- package/dist/components/voip-widget/voip-widget.js +1329 -0
- package/dist/components/voip-widget/voip-widget.types.d.ts +22 -0
- package/dist/components/voip-widget/voip-widget.types.js +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/realtime.d.ts +1 -0
- package/dist/lib/realtime.js +1 -0
- package/dist/lib/sippet.d.ts +40 -0
- package/dist/lib/sippet.js +197 -0
- package/dist/lib/tailwindMixin.d.ts +6 -0
- package/dist/lib/tailwindMixin.js +24 -0
- package/dist/styles/tailwind.global.css +2 -0
- package/dist/styles/tailwind.global.css.js +1 -0
- package/package.json +126 -0
- package/react/SippetAIVoipWidget.d.ts +158 -0
- package/react/SippetAIVoipWidget.js +72 -0
- package/react/SippetAIVoipWidgetContactsTab.d.ts +67 -0
- package/react/SippetAIVoipWidgetContactsTab.js +29 -0
- package/react/SippetAIVoipWidgetHistoryTab.d.ts +55 -0
- package/react/SippetAIVoipWidgetHistoryTab.js +26 -0
- package/react/SippetAIVoipWidgetLauncher.d.ts +83 -0
- package/react/SippetAIVoipWidgetLauncher.js +41 -0
- package/react/SippetAIVoipWidgetPanel.d.ts +87 -0
- package/react/SippetAIVoipWidgetPanel.js +43 -0
- package/react/SippetAIVoipWidgetPhoneTab.d.ts +87 -0
- package/react/SippetAIVoipWidgetPhoneTab.js +43 -0
- package/react/SippetAIVoipWidgetQueueTab.d.ts +67 -0
- package/react/SippetAIVoipWidgetQueueTab.js +27 -0
- package/react/SippetAIVoipWidgetSettingsTab.d.ts +91 -0
- package/react/SippetAIVoipWidgetSettingsTab.js +47 -0
- package/react/index.d.ts +8 -0
- package/react/index.js +8 -0
- package/react/react-utils.js +67 -0
- package/types/custom-element-jsx.d.ts +956 -0
- package/types/custom-element-svelte.d.ts +264 -0
- package/types/custom-element-vuejs.d.ts +234 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
SippetAIVoipWidget as SippetAIVoipWidgetElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../dist/components/voip-widget/index.js";
|
|
6
|
+
|
|
7
|
+
export type { SippetAIVoipWidgetElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface SippetAIVoipWidgetProps extends Pick<
|
|
10
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
+
| "children"
|
|
12
|
+
| "dir"
|
|
13
|
+
| "hidden"
|
|
14
|
+
| "id"
|
|
15
|
+
| "lang"
|
|
16
|
+
| "slot"
|
|
17
|
+
| "style"
|
|
18
|
+
| "title"
|
|
19
|
+
| "translate"
|
|
20
|
+
| "onClick"
|
|
21
|
+
| "onFocus"
|
|
22
|
+
| "onBlur"
|
|
23
|
+
> {
|
|
24
|
+
/** undefined */
|
|
25
|
+
sessionAuth?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
incomingCall?: boolean;
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
incomingFromQueue?: boolean;
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
open?: boolean;
|
|
35
|
+
|
|
36
|
+
/** undefined */
|
|
37
|
+
apiKey?: SippetAIVoipWidgetElement["apiKey"];
|
|
38
|
+
|
|
39
|
+
/** undefined */
|
|
40
|
+
apiOrigin?: SippetAIVoipWidgetElement["apiOrigin"];
|
|
41
|
+
|
|
42
|
+
/** undefined */
|
|
43
|
+
sipUrl?: SippetAIVoipWidgetElement["sipUrl"];
|
|
44
|
+
|
|
45
|
+
/** undefined */
|
|
46
|
+
sipUser?: SippetAIVoipWidgetElement["sipUser"];
|
|
47
|
+
|
|
48
|
+
/** undefined */
|
|
49
|
+
sipUserId?: SippetAIVoipWidgetElement["sipUserId"];
|
|
50
|
+
|
|
51
|
+
/** undefined */
|
|
52
|
+
sipPassword?: SippetAIVoipWidgetElement["sipPassword"];
|
|
53
|
+
|
|
54
|
+
/** undefined */
|
|
55
|
+
sipWebSocketUrl?: SippetAIVoipWidgetElement["sipWebSocketUrl"];
|
|
56
|
+
|
|
57
|
+
/** undefined */
|
|
58
|
+
userName?: SippetAIVoipWidgetElement["userName"];
|
|
59
|
+
|
|
60
|
+
/** undefined */
|
|
61
|
+
userEmail?: SippetAIVoipWidgetElement["userEmail"];
|
|
62
|
+
|
|
63
|
+
/** undefined */
|
|
64
|
+
availability?: SippetAIVoipWidgetElement["availability"];
|
|
65
|
+
|
|
66
|
+
/** undefined */
|
|
67
|
+
queueCount?: SippetAIVoipWidgetElement["queueCount"];
|
|
68
|
+
|
|
69
|
+
/** undefined */
|
|
70
|
+
incomingCallerName?: SippetAIVoipWidgetElement["incomingCallerName"];
|
|
71
|
+
|
|
72
|
+
/** undefined */
|
|
73
|
+
contacts?: SippetAIVoipWidgetElement["contacts"];
|
|
74
|
+
|
|
75
|
+
/** undefined */
|
|
76
|
+
history?: SippetAIVoipWidgetElement["history"];
|
|
77
|
+
|
|
78
|
+
/** undefined */
|
|
79
|
+
queuedCalls?: SippetAIVoipWidgetElement["queuedCalls"];
|
|
80
|
+
|
|
81
|
+
/** undefined */
|
|
82
|
+
activeTab?: SippetAIVoipWidgetElement["activeTab"];
|
|
83
|
+
|
|
84
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
85
|
+
className?: string;
|
|
86
|
+
|
|
87
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
88
|
+
exportparts?: string;
|
|
89
|
+
|
|
90
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
91
|
+
htmlFor?: string;
|
|
92
|
+
|
|
93
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
94
|
+
key?: number | string;
|
|
95
|
+
|
|
96
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
97
|
+
part?: string;
|
|
98
|
+
|
|
99
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
100
|
+
ref?: React.Ref<SippetAIVoipWidgetElement>;
|
|
101
|
+
|
|
102
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
103
|
+
tabIndex?: number;
|
|
104
|
+
|
|
105
|
+
/** undefined */
|
|
106
|
+
onVoipTransfer?: (event: CustomEvent) => void;
|
|
107
|
+
|
|
108
|
+
/** undefined */
|
|
109
|
+
onVoipCallState?: (event: CustomEvent) => void;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A VoIP widget web component allowing real-time telephony for Sippet AI integrations
|
|
114
|
+
*
|
|
115
|
+
* ## Attributes & Properties
|
|
116
|
+
*
|
|
117
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
118
|
+
*
|
|
119
|
+
* - `api-key`/`apiKey`: undefined
|
|
120
|
+
* - `session-auth`/`sessionAuth`: undefined
|
|
121
|
+
* - `api-origin`/`apiOrigin`: undefined
|
|
122
|
+
* - `sipUrl`: undefined
|
|
123
|
+
* - `sipUser`: undefined
|
|
124
|
+
* - `sip-user-id`/`sipUserId`: undefined
|
|
125
|
+
* - `sipPassword`: undefined
|
|
126
|
+
* - `sipWebSocketUrl`: undefined
|
|
127
|
+
* - `userName`: undefined
|
|
128
|
+
* - `userEmail`: undefined
|
|
129
|
+
* - `availability`: undefined
|
|
130
|
+
* - `queueCount`: undefined
|
|
131
|
+
* - `incomingCall`: undefined
|
|
132
|
+
* - `incomingCallerName`: undefined
|
|
133
|
+
* - `incomingFromQueue`: undefined
|
|
134
|
+
* - `contacts`: undefined
|
|
135
|
+
* - `history`: undefined
|
|
136
|
+
* - `queuedCalls`: undefined
|
|
137
|
+
* - `open`: undefined
|
|
138
|
+
* - `activeTab`: undefined
|
|
139
|
+
*
|
|
140
|
+
* ## Events
|
|
141
|
+
*
|
|
142
|
+
* Events that will be emitted by the component.
|
|
143
|
+
*
|
|
144
|
+
* - `voip-transfer`: undefined
|
|
145
|
+
* - `voip-call-state`: undefined
|
|
146
|
+
*
|
|
147
|
+
* ## Methods
|
|
148
|
+
*
|
|
149
|
+
* Methods that can be called to access component functionality.
|
|
150
|
+
*
|
|
151
|
+
* - `openPanel(tab: VoipTab = 'phone') => void`: undefined
|
|
152
|
+
* - `callNumber(phoneNumber: string) => void`: undefined
|
|
153
|
+
* - `answerCall() => void`: undefined
|
|
154
|
+
* - `declineCall() => void`: undefined
|
|
155
|
+
* - `toggleHold() => void`: undefined
|
|
156
|
+
* - `transferTo(queue: string) => void`: undefined
|
|
157
|
+
*/
|
|
158
|
+
export const SippetAIVoipWidget: React.ForwardRefExoticComponent<SippetAIVoipWidgetProps>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../dist/components/voip-widget/index.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const SippetAIVoipWidget = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
sessionAuth,
|
|
9
|
+
incomingCall,
|
|
10
|
+
incomingFromQueue,
|
|
11
|
+
open,
|
|
12
|
+
apiKey,
|
|
13
|
+
apiOrigin,
|
|
14
|
+
sipUrl,
|
|
15
|
+
sipUser,
|
|
16
|
+
sipUserId,
|
|
17
|
+
sipPassword,
|
|
18
|
+
sipWebSocketUrl,
|
|
19
|
+
userName,
|
|
20
|
+
userEmail,
|
|
21
|
+
availability,
|
|
22
|
+
queueCount,
|
|
23
|
+
incomingCallerName,
|
|
24
|
+
contacts,
|
|
25
|
+
history,
|
|
26
|
+
queuedCalls,
|
|
27
|
+
activeTab,
|
|
28
|
+
exportparts,
|
|
29
|
+
htmlFor,
|
|
30
|
+
part,
|
|
31
|
+
tabIndex,
|
|
32
|
+
...restProps
|
|
33
|
+
} = props;
|
|
34
|
+
|
|
35
|
+
/** Event listeners - run once */
|
|
36
|
+
useEventListener(ref, "voip-transfer", props.onVoipTransfer);
|
|
37
|
+
useEventListener(ref, "voip-call-state", props.onVoipCallState);
|
|
38
|
+
|
|
39
|
+
return React.createElement(
|
|
40
|
+
"sippetai-voip-widget",
|
|
41
|
+
{
|
|
42
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
43
|
+
...restProps,
|
|
44
|
+
"api-key": apiKey ?? props["api-key"],
|
|
45
|
+
"api-origin": apiOrigin ?? props["api-origin"],
|
|
46
|
+
sipUrl: sipUrl,
|
|
47
|
+
sipUser: sipUser,
|
|
48
|
+
"sip-user-id": sipUserId ?? props["sip-user-id"],
|
|
49
|
+
sipPassword: sipPassword,
|
|
50
|
+
sipWebSocketUrl: sipWebSocketUrl,
|
|
51
|
+
userName: userName,
|
|
52
|
+
userEmail: userEmail,
|
|
53
|
+
availability: availability,
|
|
54
|
+
queueCount: queueCount,
|
|
55
|
+
incomingCallerName: incomingCallerName,
|
|
56
|
+
contacts: contacts,
|
|
57
|
+
history: history,
|
|
58
|
+
queuedCalls: queuedCalls,
|
|
59
|
+
activeTab: activeTab,
|
|
60
|
+
exportparts: exportparts,
|
|
61
|
+
for: htmlFor,
|
|
62
|
+
part: part,
|
|
63
|
+
tabindex: tabIndex,
|
|
64
|
+
"session-auth": sessionAuth ? true : undefined,
|
|
65
|
+
incomingCall: incomingCall ? true : undefined,
|
|
66
|
+
incomingFromQueue: incomingFromQueue ? true : undefined,
|
|
67
|
+
open: open ? true : undefined,
|
|
68
|
+
style: { ...props.style },
|
|
69
|
+
},
|
|
70
|
+
props.children,
|
|
71
|
+
);
|
|
72
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
SippetAIVoipWidgetContactsTab as SippetAIVoipWidgetContactsTabElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../dist/components/voip-widget/voip-widget-contacts-tab.js";
|
|
6
|
+
|
|
7
|
+
export type { SippetAIVoipWidgetContactsTabElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface SippetAIVoipWidgetContactsTabProps extends Pick<
|
|
10
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
+
| "children"
|
|
12
|
+
| "dir"
|
|
13
|
+
| "hidden"
|
|
14
|
+
| "id"
|
|
15
|
+
| "lang"
|
|
16
|
+
| "slot"
|
|
17
|
+
| "style"
|
|
18
|
+
| "title"
|
|
19
|
+
| "translate"
|
|
20
|
+
| "onClick"
|
|
21
|
+
| "onFocus"
|
|
22
|
+
| "onBlur"
|
|
23
|
+
> {
|
|
24
|
+
/** undefined */
|
|
25
|
+
contacts?: SippetAIVoipWidgetContactsTabElement["contacts"];
|
|
26
|
+
|
|
27
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
28
|
+
className?: string;
|
|
29
|
+
|
|
30
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
31
|
+
exportparts?: string;
|
|
32
|
+
|
|
33
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
34
|
+
htmlFor?: string;
|
|
35
|
+
|
|
36
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
37
|
+
key?: number | string;
|
|
38
|
+
|
|
39
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
40
|
+
part?: string;
|
|
41
|
+
|
|
42
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
43
|
+
ref?: React.Ref<SippetAIVoipWidgetContactsTabElement>;
|
|
44
|
+
|
|
45
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
46
|
+
tabIndex?: number;
|
|
47
|
+
|
|
48
|
+
/** undefined */
|
|
49
|
+
onName?: (event: CustomEvent) => void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* ## Attributes & Properties
|
|
56
|
+
*
|
|
57
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
58
|
+
*
|
|
59
|
+
* - `contacts`: undefined
|
|
60
|
+
*
|
|
61
|
+
* ## Events
|
|
62
|
+
*
|
|
63
|
+
* Events that will be emitted by the component.
|
|
64
|
+
*
|
|
65
|
+
* - `name`: undefined
|
|
66
|
+
*/
|
|
67
|
+
export const SippetAIVoipWidgetContactsTab: React.ForwardRefExoticComponent<SippetAIVoipWidgetContactsTabProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../dist/components/voip-widget/voip-widget-contacts-tab.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const SippetAIVoipWidgetContactsTab = forwardRef(
|
|
6
|
+
(props, forwardedRef) => {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const { contacts, exportparts, htmlFor, part, tabIndex, ...restProps } =
|
|
9
|
+
props;
|
|
10
|
+
|
|
11
|
+
/** Event listeners - run once */
|
|
12
|
+
useEventListener(ref, "name", props.onName);
|
|
13
|
+
|
|
14
|
+
return React.createElement(
|
|
15
|
+
"sippetai-voip-widget-contacts-tab",
|
|
16
|
+
{
|
|
17
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
18
|
+
...restProps,
|
|
19
|
+
contacts: contacts,
|
|
20
|
+
exportparts: exportparts,
|
|
21
|
+
for: htmlFor,
|
|
22
|
+
part: part,
|
|
23
|
+
tabindex: tabIndex,
|
|
24
|
+
style: { ...props.style },
|
|
25
|
+
},
|
|
26
|
+
props.children,
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SippetAIVoipWidgetHistoryTab as SippetAIVoipWidgetHistoryTabElement } from "../dist/components/voip-widget/voip-widget-history-tab.js";
|
|
3
|
+
|
|
4
|
+
export type { SippetAIVoipWidgetHistoryTabElement };
|
|
5
|
+
|
|
6
|
+
export interface SippetAIVoipWidgetHistoryTabProps extends Pick<
|
|
7
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
8
|
+
| "children"
|
|
9
|
+
| "dir"
|
|
10
|
+
| "hidden"
|
|
11
|
+
| "id"
|
|
12
|
+
| "lang"
|
|
13
|
+
| "slot"
|
|
14
|
+
| "style"
|
|
15
|
+
| "title"
|
|
16
|
+
| "translate"
|
|
17
|
+
| "onClick"
|
|
18
|
+
| "onFocus"
|
|
19
|
+
| "onBlur"
|
|
20
|
+
> {
|
|
21
|
+
/** undefined */
|
|
22
|
+
history?: SippetAIVoipWidgetHistoryTabElement["history"];
|
|
23
|
+
|
|
24
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
25
|
+
className?: string;
|
|
26
|
+
|
|
27
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
28
|
+
exportparts?: string;
|
|
29
|
+
|
|
30
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
31
|
+
htmlFor?: string;
|
|
32
|
+
|
|
33
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
34
|
+
key?: number | string;
|
|
35
|
+
|
|
36
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
37
|
+
part?: string;
|
|
38
|
+
|
|
39
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
40
|
+
ref?: React.Ref<SippetAIVoipWidgetHistoryTabElement>;
|
|
41
|
+
|
|
42
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
43
|
+
tabIndex?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
*
|
|
49
|
+
* ## Attributes & Properties
|
|
50
|
+
*
|
|
51
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
52
|
+
*
|
|
53
|
+
* - `history`: undefined
|
|
54
|
+
*/
|
|
55
|
+
export const SippetAIVoipWidgetHistoryTab: React.ForwardRefExoticComponent<SippetAIVoipWidgetHistoryTabProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../dist/components/voip-widget/voip-widget-history-tab.js";
|
|
3
|
+
import { createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const SippetAIVoipWidgetHistoryTab = forwardRef(
|
|
6
|
+
(props, forwardedRef) => {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
const { history, exportparts, htmlFor, part, tabIndex, ...restProps } =
|
|
9
|
+
props;
|
|
10
|
+
|
|
11
|
+
return React.createElement(
|
|
12
|
+
"sippetai-voip-widget-history-tab",
|
|
13
|
+
{
|
|
14
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
15
|
+
...restProps,
|
|
16
|
+
history: history,
|
|
17
|
+
exportparts: exportparts,
|
|
18
|
+
for: htmlFor,
|
|
19
|
+
part: part,
|
|
20
|
+
tabindex: tabIndex,
|
|
21
|
+
style: { ...props.style },
|
|
22
|
+
},
|
|
23
|
+
props.children,
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
SippetAIVoipWidgetLauncher as SippetAIVoipWidgetLauncherElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../dist/components/voip-widget/voip-widget-launcher.js";
|
|
6
|
+
|
|
7
|
+
export type { SippetAIVoipWidgetLauncherElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface SippetAIVoipWidgetLauncherProps extends Pick<
|
|
10
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
+
| "children"
|
|
12
|
+
| "dir"
|
|
13
|
+
| "hidden"
|
|
14
|
+
| "id"
|
|
15
|
+
| "lang"
|
|
16
|
+
| "slot"
|
|
17
|
+
| "style"
|
|
18
|
+
| "title"
|
|
19
|
+
| "translate"
|
|
20
|
+
| "onClick"
|
|
21
|
+
| "onFocus"
|
|
22
|
+
| "onBlur"
|
|
23
|
+
> {
|
|
24
|
+
/** undefined */
|
|
25
|
+
open?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
incomingCall?: boolean;
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
incomingFromQueue?: boolean;
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
queueCount?: SippetAIVoipWidgetLauncherElement["queueCount"];
|
|
35
|
+
|
|
36
|
+
/** undefined */
|
|
37
|
+
incomingCallerName?: SippetAIVoipWidgetLauncherElement["incomingCallerName"];
|
|
38
|
+
|
|
39
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
40
|
+
className?: string;
|
|
41
|
+
|
|
42
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
43
|
+
exportparts?: string;
|
|
44
|
+
|
|
45
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
46
|
+
htmlFor?: string;
|
|
47
|
+
|
|
48
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
49
|
+
key?: number | string;
|
|
50
|
+
|
|
51
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
52
|
+
part?: string;
|
|
53
|
+
|
|
54
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
55
|
+
ref?: React.Ref<SippetAIVoipWidgetLauncherElement>;
|
|
56
|
+
|
|
57
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
58
|
+
tabIndex?: number;
|
|
59
|
+
|
|
60
|
+
/** undefined */
|
|
61
|
+
onName?: (event: CustomEvent) => void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
*
|
|
67
|
+
* ## Attributes & Properties
|
|
68
|
+
*
|
|
69
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
70
|
+
*
|
|
71
|
+
* - `open`: undefined
|
|
72
|
+
* - `queueCount`: undefined
|
|
73
|
+
* - `incomingCall`: undefined
|
|
74
|
+
* - `incomingFromQueue`: undefined
|
|
75
|
+
* - `incomingCallerName`: undefined
|
|
76
|
+
*
|
|
77
|
+
* ## Events
|
|
78
|
+
*
|
|
79
|
+
* Events that will be emitted by the component.
|
|
80
|
+
*
|
|
81
|
+
* - `name`: undefined
|
|
82
|
+
*/
|
|
83
|
+
export const SippetAIVoipWidgetLauncher: React.ForwardRefExoticComponent<SippetAIVoipWidgetLauncherProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../dist/components/voip-widget/voip-widget-launcher.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const SippetAIVoipWidgetLauncher = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
open,
|
|
9
|
+
incomingCall,
|
|
10
|
+
incomingFromQueue,
|
|
11
|
+
queueCount,
|
|
12
|
+
incomingCallerName,
|
|
13
|
+
exportparts,
|
|
14
|
+
htmlFor,
|
|
15
|
+
part,
|
|
16
|
+
tabIndex,
|
|
17
|
+
...restProps
|
|
18
|
+
} = props;
|
|
19
|
+
|
|
20
|
+
/** Event listeners - run once */
|
|
21
|
+
useEventListener(ref, "name", props.onName);
|
|
22
|
+
|
|
23
|
+
return React.createElement(
|
|
24
|
+
"sippetai-voip-widget-launcher",
|
|
25
|
+
{
|
|
26
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
27
|
+
...restProps,
|
|
28
|
+
queueCount: queueCount,
|
|
29
|
+
incomingCallerName: incomingCallerName,
|
|
30
|
+
exportparts: exportparts,
|
|
31
|
+
for: htmlFor,
|
|
32
|
+
part: part,
|
|
33
|
+
tabindex: tabIndex,
|
|
34
|
+
open: open ? true : undefined,
|
|
35
|
+
incomingCall: incomingCall ? true : undefined,
|
|
36
|
+
incomingFromQueue: incomingFromQueue ? true : undefined,
|
|
37
|
+
style: { ...props.style },
|
|
38
|
+
},
|
|
39
|
+
props.children,
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
SippetAIVoipWidgetPanel as SippetAIVoipWidgetPanelElement,
|
|
4
|
+
CustomEvent,
|
|
5
|
+
} from "../dist/components/voip-widget/voip-widget-panel.js";
|
|
6
|
+
|
|
7
|
+
export type { SippetAIVoipWidgetPanelElement, CustomEvent };
|
|
8
|
+
|
|
9
|
+
export interface SippetAIVoipWidgetPanelProps extends Pick<
|
|
10
|
+
React.AllHTMLAttributes<HTMLElement>,
|
|
11
|
+
| "children"
|
|
12
|
+
| "dir"
|
|
13
|
+
| "hidden"
|
|
14
|
+
| "id"
|
|
15
|
+
| "lang"
|
|
16
|
+
| "slot"
|
|
17
|
+
| "style"
|
|
18
|
+
| "title"
|
|
19
|
+
| "translate"
|
|
20
|
+
| "onClick"
|
|
21
|
+
| "onFocus"
|
|
22
|
+
| "onBlur"
|
|
23
|
+
> {
|
|
24
|
+
/** undefined */
|
|
25
|
+
incomingCall?: boolean;
|
|
26
|
+
|
|
27
|
+
/** undefined */
|
|
28
|
+
incomingFromQueue?: boolean;
|
|
29
|
+
|
|
30
|
+
/** undefined */
|
|
31
|
+
userName?: SippetAIVoipWidgetPanelElement["userName"];
|
|
32
|
+
|
|
33
|
+
/** undefined */
|
|
34
|
+
availability?: SippetAIVoipWidgetPanelElement["availability"];
|
|
35
|
+
|
|
36
|
+
/** undefined */
|
|
37
|
+
activeTab?: SippetAIVoipWidgetPanelElement["activeTab"];
|
|
38
|
+
|
|
39
|
+
/** undefined */
|
|
40
|
+
incomingCallerName?: SippetAIVoipWidgetPanelElement["incomingCallerName"];
|
|
41
|
+
|
|
42
|
+
/** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */
|
|
43
|
+
className?: string;
|
|
44
|
+
|
|
45
|
+
/** Contains a space-separated list of the part names of the element that should be exposed on the host element. */
|
|
46
|
+
exportparts?: string;
|
|
47
|
+
|
|
48
|
+
/** Used for labels to link them with their inputs (using input id). */
|
|
49
|
+
htmlFor?: string;
|
|
50
|
+
|
|
51
|
+
/** Used to help React identify which items have changed, are added, or are removed within a list. */
|
|
52
|
+
key?: number | string;
|
|
53
|
+
|
|
54
|
+
/** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */
|
|
55
|
+
part?: string;
|
|
56
|
+
|
|
57
|
+
/** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */
|
|
58
|
+
ref?: React.Ref<SippetAIVoipWidgetPanelElement>;
|
|
59
|
+
|
|
60
|
+
/** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */
|
|
61
|
+
tabIndex?: number;
|
|
62
|
+
|
|
63
|
+
/** undefined */
|
|
64
|
+
onName?: (event: CustomEvent) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
*
|
|
70
|
+
* ## Attributes & Properties
|
|
71
|
+
*
|
|
72
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
73
|
+
*
|
|
74
|
+
* - `userName`: undefined
|
|
75
|
+
* - `availability`: undefined
|
|
76
|
+
* - `activeTab`: undefined
|
|
77
|
+
* - `incomingCall`: undefined
|
|
78
|
+
* - `incomingFromQueue`: undefined
|
|
79
|
+
* - `incomingCallerName`: undefined
|
|
80
|
+
*
|
|
81
|
+
* ## Events
|
|
82
|
+
*
|
|
83
|
+
* Events that will be emitted by the component.
|
|
84
|
+
*
|
|
85
|
+
* - `name`: undefined
|
|
86
|
+
*/
|
|
87
|
+
export const SippetAIVoipWidgetPanel: React.ForwardRefExoticComponent<SippetAIVoipWidgetPanelProps>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { forwardRef, useRef } from "react";
|
|
2
|
+
import "../dist/components/voip-widget/voip-widget-panel.js";
|
|
3
|
+
import { useEventListener, createForwardedRefHandler } from "./react-utils.js";
|
|
4
|
+
|
|
5
|
+
export const SippetAIVoipWidgetPanel = forwardRef((props, forwardedRef) => {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const {
|
|
8
|
+
incomingCall,
|
|
9
|
+
incomingFromQueue,
|
|
10
|
+
userName,
|
|
11
|
+
availability,
|
|
12
|
+
activeTab,
|
|
13
|
+
incomingCallerName,
|
|
14
|
+
exportparts,
|
|
15
|
+
htmlFor,
|
|
16
|
+
part,
|
|
17
|
+
tabIndex,
|
|
18
|
+
...restProps
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
/** Event listeners - run once */
|
|
22
|
+
useEventListener(ref, "name", props.onName);
|
|
23
|
+
|
|
24
|
+
return React.createElement(
|
|
25
|
+
"sippetai-voip-widget-panel",
|
|
26
|
+
{
|
|
27
|
+
ref: createForwardedRefHandler(ref, forwardedRef),
|
|
28
|
+
...restProps,
|
|
29
|
+
userName: userName,
|
|
30
|
+
availability: availability,
|
|
31
|
+
activeTab: activeTab,
|
|
32
|
+
incomingCallerName: incomingCallerName,
|
|
33
|
+
exportparts: exportparts,
|
|
34
|
+
for: htmlFor,
|
|
35
|
+
part: part,
|
|
36
|
+
tabindex: tabIndex,
|
|
37
|
+
incomingCall: incomingCall ? true : undefined,
|
|
38
|
+
incomingFromQueue: incomingFromQueue ? true : undefined,
|
|
39
|
+
style: { ...props.style },
|
|
40
|
+
},
|
|
41
|
+
props.children,
|
|
42
|
+
);
|
|
43
|
+
});
|