@94ai/nf-softphone 9.0.0 → 10.0.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/lib/index.d.ts +779 -779
- package/lib/nf-softphone.cjs.js +5 -4
- package/lib/nf-softphone.esm-bundler.js +5 -4
- package/lib/nf-softphone.vue.d.ts +193 -193
- package/lib/softphone-pure.d.ts +94 -94
- package/lib/softphone.d.ts +49 -49
- package/lib/style/css.d.ts +1 -0
- package/lib/style/index.d.ts +1 -0
- package/lib/type.d.ts +46 -46
- package/package/html/softphone.js +2 -4
- package/package/html/util.js +2 -1
- package/package/nf-softphone.vue +3 -1
- package/package/softphone-pure.ts +10 -26
- package/package/softphone.ts +1 -3
- package/package.json +8 -8
package/lib/softphone.d.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { Option } from '../..nf-softphone/lib/type';
|
|
2
|
-
export declare class SoftphoneManager {
|
|
3
|
-
id: any;
|
|
4
|
-
timer: any;
|
|
5
|
-
constructor();
|
|
6
|
-
option: Partial<Option>;
|
|
7
|
-
loadCssCode: (code: any) => void;
|
|
8
|
-
removeCssCode: () => void;
|
|
9
|
-
getContextDomElement: (el: string) => Element | null;
|
|
10
|
-
getSoftphoneDomElement: (el: string) => Element | null;
|
|
11
|
-
signOverdued: (data: {
|
|
12
|
-
sign: string;
|
|
13
|
-
timestamp: string | number;
|
|
14
|
-
}) => void;
|
|
15
|
-
handlingCommunication: (e: {
|
|
1
|
+
import { Option } from '../..nf-softphone/lib/type';
|
|
2
|
+
export declare class SoftphoneManager {
|
|
3
|
+
id: any;
|
|
4
|
+
timer: any;
|
|
5
|
+
constructor();
|
|
6
|
+
option: Partial<Option>;
|
|
7
|
+
loadCssCode: (code: any) => void;
|
|
8
|
+
removeCssCode: () => void;
|
|
9
|
+
getContextDomElement: (el: string) => Element | null;
|
|
10
|
+
getSoftphoneDomElement: (el: string) => Element | null;
|
|
11
|
+
signOverdued: (data: {
|
|
12
|
+
sign: string;
|
|
13
|
+
timestamp: string | number;
|
|
14
|
+
}) => void;
|
|
15
|
+
handlingCommunication: (e: {
|
|
16
16
|
data: `{
|
|
17
17
|
type: string,
|
|
18
18
|
ancestorOrigin: string,
|
|
19
19
|
origin: string,
|
|
20
20
|
data: 'expand' | 'shrink'
|
|
21
|
-
}` | string;
|
|
22
|
-
}) => void;
|
|
23
|
-
handlingScroll: (...args: any[]) => any;
|
|
24
|
-
handlerInteractive: () => void;
|
|
25
|
-
handlerDomRemove: () => void;
|
|
26
|
-
_containerScrolling: any;
|
|
27
|
-
get containerScrolling(): boolean;
|
|
28
|
-
set containerScrolling(value: boolean);
|
|
29
|
-
handlingScrollTransparent: () => void;
|
|
30
|
-
refreshStyle: () => Promise<{
|
|
31
|
-
top: number;
|
|
32
|
-
left: number;
|
|
33
|
-
leftMargin: string;
|
|
34
|
-
} | {
|
|
35
|
-
leftMargin: number;
|
|
36
|
-
top: number;
|
|
37
|
-
left: number;
|
|
38
|
-
}>;
|
|
39
|
-
handlerDomGenerater: () => Promise<void>;
|
|
40
|
-
initSoftphone: (option: any) => this;
|
|
41
|
-
postMessageCommunicate: (type: any, status?: boolean | undefined, param?: any) => void;
|
|
42
|
-
connect: () => void;
|
|
43
|
-
disconnect: () => void;
|
|
44
|
-
seatsStatusChange: (status: boolean) => void;
|
|
45
|
-
accept: () => void;
|
|
46
|
-
ignore: () => void;
|
|
47
|
-
hangup: () => void;
|
|
48
|
-
sendDtmf: () => void;
|
|
49
|
-
requestOpenApi: (param: any) => Promise<unknown>;
|
|
50
|
-
removeTimer: () => void;
|
|
51
|
-
destroy: () => void;
|
|
52
|
-
}
|
|
53
|
-
declare const softphoneManager: SoftphoneManager;
|
|
54
|
-
export default softphoneManager;
|
|
21
|
+
}` | string;
|
|
22
|
+
}) => void;
|
|
23
|
+
handlingScroll: (...args: any[]) => any;
|
|
24
|
+
handlerInteractive: () => void;
|
|
25
|
+
handlerDomRemove: () => void;
|
|
26
|
+
_containerScrolling: any;
|
|
27
|
+
get containerScrolling(): boolean;
|
|
28
|
+
set containerScrolling(value: boolean);
|
|
29
|
+
handlingScrollTransparent: () => void;
|
|
30
|
+
refreshStyle: () => Promise<{
|
|
31
|
+
top: number;
|
|
32
|
+
left: number;
|
|
33
|
+
leftMargin: string;
|
|
34
|
+
} | {
|
|
35
|
+
leftMargin: number;
|
|
36
|
+
top: number;
|
|
37
|
+
left: number;
|
|
38
|
+
}>;
|
|
39
|
+
handlerDomGenerater: () => Promise<void>;
|
|
40
|
+
initSoftphone: (option: any) => this;
|
|
41
|
+
postMessageCommunicate: (type: any, status?: boolean | undefined, param?: any) => void;
|
|
42
|
+
connect: () => void;
|
|
43
|
+
disconnect: () => void;
|
|
44
|
+
seatsStatusChange: (status: boolean) => void;
|
|
45
|
+
accept: () => void;
|
|
46
|
+
ignore: () => void;
|
|
47
|
+
hangup: () => void;
|
|
48
|
+
sendDtmf: () => void;
|
|
49
|
+
requestOpenApi: (param: any) => Promise<unknown>;
|
|
50
|
+
removeTimer: () => void;
|
|
51
|
+
destroy: () => void;
|
|
52
|
+
}
|
|
53
|
+
declare const softphoneManager: SoftphoneManager;
|
|
54
|
+
export default softphoneManager;
|
package/lib/style/css.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/style/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/lib/type.d.ts
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
export declare type Option = {
|
|
2
|
-
origin: string;
|
|
3
|
-
ancestorOrigin: string;
|
|
4
|
-
destinationOrigin: string;
|
|
5
|
-
scrollingText: string;
|
|
6
|
-
scrollview: string;
|
|
7
|
-
envMap: Record<Env, string>;
|
|
8
|
-
env: string;
|
|
9
|
-
selector: string;
|
|
10
|
-
el: string;
|
|
11
|
-
agentTag: string;
|
|
12
|
-
agentId: string;
|
|
13
|
-
appKey: string;
|
|
14
|
-
appSecret: string;
|
|
15
|
-
timestamp: string | number;
|
|
16
|
-
sign: string;
|
|
17
|
-
sgGateway: string;
|
|
18
|
-
sgBase: string;
|
|
19
|
-
sgOpen: string;
|
|
20
|
-
sgDomain: string;
|
|
21
|
-
extStatus: '0' | '1';
|
|
22
|
-
instanceMap: Record<string, any>;
|
|
23
|
-
requestOpenApiCallBackMap: Record<string, any>;
|
|
24
|
-
callShow: '0' | '1';
|
|
25
|
-
transferToLaborShow: '0' | '1';
|
|
26
|
-
restShow: '0' | '1';
|
|
27
|
-
networkDetectShow: '0' | '1';
|
|
28
|
-
muteShow: '0' | '1';
|
|
29
|
-
logShow: '0' | '1';
|
|
30
|
-
timingShow: '0' | '1';
|
|
31
|
-
signShow: '0' | '1';
|
|
32
|
-
softphoneConnectCallBack: Function;
|
|
33
|
-
softphoneCallRefreshCallBack: Function;
|
|
34
|
-
softphoneSeatStatusChangeCallBack: Function;
|
|
35
|
-
softphoneAcceptCallBack: Function;
|
|
36
|
-
softphoneIgnoreCallBack: Function;
|
|
37
|
-
softphoneHangupCallBack: Function;
|
|
38
|
-
softphoneSessionStateChangeCallBack: Function;
|
|
39
|
-
softphoneIncomingCallBack: Function;
|
|
40
|
-
softphoneSendDtmfCallBack: Function;
|
|
41
|
-
softphoneAutoIgnoreCallback: Function;
|
|
42
|
-
softphoneConnectRegisteredCallBack: Function;
|
|
43
|
-
softphoneSignOverduedCallBack: Function;
|
|
44
|
-
softphoneRequestOpenApiCallBack: Function;
|
|
45
|
-
};
|
|
46
|
-
export declare type Env = 'test' | 'dev' | 'sg' | 'gray' | 'prod';
|
|
1
|
+
export declare type Option = {
|
|
2
|
+
origin: string;
|
|
3
|
+
ancestorOrigin: string;
|
|
4
|
+
destinationOrigin: string;
|
|
5
|
+
scrollingText: string;
|
|
6
|
+
scrollview: string;
|
|
7
|
+
envMap: Record<Env, string>;
|
|
8
|
+
env: string;
|
|
9
|
+
selector: string;
|
|
10
|
+
el: string;
|
|
11
|
+
agentTag: string;
|
|
12
|
+
agentId: string;
|
|
13
|
+
appKey: string;
|
|
14
|
+
appSecret: string;
|
|
15
|
+
timestamp: string | number;
|
|
16
|
+
sign: string;
|
|
17
|
+
sgGateway: string;
|
|
18
|
+
sgBase: string;
|
|
19
|
+
sgOpen: string;
|
|
20
|
+
sgDomain: string;
|
|
21
|
+
extStatus: '0' | '1';
|
|
22
|
+
instanceMap: Record<string, any>;
|
|
23
|
+
requestOpenApiCallBackMap: Record<string, any>;
|
|
24
|
+
callShow: '0' | '1';
|
|
25
|
+
transferToLaborShow: '0' | '1';
|
|
26
|
+
restShow: '0' | '1';
|
|
27
|
+
networkDetectShow: '0' | '1';
|
|
28
|
+
muteShow: '0' | '1';
|
|
29
|
+
logShow: '0' | '1';
|
|
30
|
+
timingShow: '0' | '1';
|
|
31
|
+
signShow: '0' | '1';
|
|
32
|
+
softphoneConnectCallBack: Function;
|
|
33
|
+
softphoneCallRefreshCallBack: Function;
|
|
34
|
+
softphoneSeatStatusChangeCallBack: Function;
|
|
35
|
+
softphoneAcceptCallBack: Function;
|
|
36
|
+
softphoneIgnoreCallBack: Function;
|
|
37
|
+
softphoneHangupCallBack: Function;
|
|
38
|
+
softphoneSessionStateChangeCallBack: Function;
|
|
39
|
+
softphoneIncomingCallBack: Function;
|
|
40
|
+
softphoneSendDtmfCallBack: Function;
|
|
41
|
+
softphoneAutoIgnoreCallback: Function;
|
|
42
|
+
softphoneConnectRegisteredCallBack: Function;
|
|
43
|
+
softphoneSignOverduedCallBack: Function;
|
|
44
|
+
softphoneRequestOpenApiCallBack: Function;
|
|
45
|
+
};
|
|
46
|
+
export declare type Env = 'test' | 'dev' | 'sg' | 'gray' | 'prod';
|
|
@@ -95,9 +95,7 @@ class SoftphoneManager {
|
|
|
95
95
|
const styleId = 'nf-softphone'
|
|
96
96
|
const css = document.getElementById(styleId)
|
|
97
97
|
if (css) {
|
|
98
|
-
|
|
99
|
-
css.parentNode.removeChild(css);
|
|
100
|
-
}
|
|
98
|
+
css.parentNode.removeChild(css);
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
|
|
@@ -111,7 +109,7 @@ class SoftphoneManager {
|
|
|
111
109
|
* 隔离软电话容器内容
|
|
112
110
|
*/
|
|
113
111
|
getSoftphoneDomElement = (el) => {
|
|
114
|
-
return this.getContextDomElement(this.option.el)
|
|
112
|
+
return this.getContextDomElement(this.option.el)?.querySelector(el) || this.getContextDomElement(el) || document.querySelector(el)
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
signOverdued = (data) => {
|
package/package/html/util.js
CHANGED
package/package/nf-softphone.vue
CHANGED
|
@@ -276,10 +276,12 @@ const handlingScroll = debounce(async () => {
|
|
|
276
276
|
}, 500, false)
|
|
277
277
|
|
|
278
278
|
onMounted(async () => {
|
|
279
|
+
const position = await refreshStyle()
|
|
280
|
+
if (!position || !iframeDom.value) return
|
|
279
281
|
const {
|
|
280
282
|
top,
|
|
281
283
|
left
|
|
282
|
-
} =
|
|
284
|
+
} = position
|
|
283
285
|
const {
|
|
284
286
|
envMap,
|
|
285
287
|
env,
|
|
@@ -61,7 +61,8 @@ function generateUUID() { // Public Domain/MIT
|
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
// Private scroll scheduler: the only call site uses trailing execution.
|
|
65
|
+
function debounce(func, wait) {
|
|
65
66
|
let timeout, args, context, timestamp, result
|
|
66
67
|
|
|
67
68
|
const later = function() {
|
|
@@ -73,26 +74,18 @@ function debounce(func, wait, immediate) {
|
|
|
73
74
|
timeout = setTimeout(later, wait - last)
|
|
74
75
|
} else {
|
|
75
76
|
timeout = null
|
|
76
|
-
|
|
77
|
-
if (!
|
|
78
|
-
result = func.apply(context, args)
|
|
79
|
-
if (!timeout) context = args = null
|
|
80
|
-
}
|
|
77
|
+
result = func.apply(context, args)
|
|
78
|
+
if (!timeout) context = args = null
|
|
81
79
|
}
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
return function(...
|
|
82
|
+
return function(...callArgs) {
|
|
83
|
+
args = callArgs
|
|
85
84
|
// @ts-ignore
|
|
86
85
|
context = this
|
|
87
86
|
timestamp = +new Date()
|
|
88
|
-
const callNow = immediate && !timeout
|
|
89
87
|
// 如果延时不存在,重新设定延时
|
|
90
88
|
if (!timeout) timeout = setTimeout(later, wait)
|
|
91
|
-
if (callNow) {
|
|
92
|
-
result = func.apply(context, args)
|
|
93
|
-
// @ts-ignore
|
|
94
|
-
context = args = null
|
|
95
|
-
}
|
|
96
89
|
|
|
97
90
|
return result
|
|
98
91
|
}
|
|
@@ -151,18 +144,11 @@ if (typeof Promise !== 'undefined') {
|
|
|
151
144
|
};
|
|
152
145
|
}
|
|
153
146
|
|
|
154
|
-
//
|
|
155
|
-
async function nextTick(
|
|
147
|
+
// Private DOM-generation barrier; all callers await it without a callback.
|
|
148
|
+
async function nextTick() {
|
|
156
149
|
return new Promise((resolve) => {
|
|
157
150
|
// 将回调函数和 resolve 函数封装成一个新的回调
|
|
158
151
|
callbacks.push(() => {
|
|
159
|
-
if (cb) {
|
|
160
|
-
try {
|
|
161
|
-
cb();
|
|
162
|
-
} catch (e) {
|
|
163
|
-
console.error('Error in nextTick callback:', e);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
152
|
// 当回调执行完毕后,resolve Promise
|
|
167
153
|
resolve(true);
|
|
168
154
|
});
|
|
@@ -291,9 +277,7 @@ export class SoftphoneManager {
|
|
|
291
277
|
const styleId = 'nf-softphone'
|
|
292
278
|
const css = document.getElementById(styleId)
|
|
293
279
|
if (css) {
|
|
294
|
-
|
|
295
|
-
css.parentNode.removeChild(css);
|
|
296
|
-
}
|
|
280
|
+
css.parentNode!.removeChild(css);
|
|
297
281
|
}
|
|
298
282
|
}
|
|
299
283
|
|
|
@@ -405,7 +389,7 @@ export class SoftphoneManager {
|
|
|
405
389
|
}
|
|
406
390
|
}), '*')
|
|
407
391
|
}
|
|
408
|
-
}, 500
|
|
392
|
+
}, 500)
|
|
409
393
|
|
|
410
394
|
handlerInteractive = () => {
|
|
411
395
|
/**
|
package/package/softphone.ts
CHANGED
|
@@ -123,9 +123,7 @@ export class SoftphoneManager {
|
|
|
123
123
|
const styleId = 'nf-softphone'
|
|
124
124
|
const css = document.getElementById(styleId)
|
|
125
125
|
if (css) {
|
|
126
|
-
|
|
127
|
-
css.parentNode.removeChild(css);
|
|
128
|
-
}
|
|
126
|
+
css.parentNode!.removeChild(css);
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
129
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@94ai/nf-softphone",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "zoujiahe <zoujiahe@94ai.com>",
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
"url": "http://gitlab.94ai.pro/ui/common-ui.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@94ai/common-utils": "^
|
|
18
|
-
"@94ai/nf-theme-chalk": "^
|
|
19
|
-
"vue-demi": "^0.14.5"
|
|
17
|
+
"@94ai/common-utils": "^10.0.0",
|
|
18
|
+
"@94ai/nf-theme-chalk": "^10.0.0",
|
|
19
|
+
"vue-demi": "^0.14.5",
|
|
20
|
+
"@94ai/vue2-runtime-helpers": "1.0.1"
|
|
20
21
|
},
|
|
21
22
|
"peerDependenciesMeta": {
|
|
22
23
|
"@vue/composition-api": {
|
|
@@ -25,11 +26,10 @@
|
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
28
|
"@vue/composition-api": "^1.0.0-rc.1",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
29
|
+
"vue": "^2.0.0 || >=3.0.0",
|
|
30
|
+
"element-ui": ">=2.13.2"
|
|
30
31
|
},
|
|
31
32
|
"types": "lib/index.d.ts",
|
|
32
33
|
"main": "lib/nf-softphone.cjs.js",
|
|
33
|
-
"module": "lib/nf-softphone.esm-bundler.js"
|
|
34
|
-
"gitHead": "afe3016f0e42dfb7fedf6cbbe400ec08bf4b8662"
|
|
34
|
+
"module": "lib/nf-softphone.esm-bundler.js"
|
|
35
35
|
}
|