@94ai/nf-softphone 3.3.17 → 3.3.19

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 CHANGED
@@ -193,7 +193,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
193
193
  ignore: () => void;
194
194
  hangup: () => void;
195
195
  sendDtmf: () => void;
196
- iframe: import("vue-demi").Ref<any>;
196
+ iframeDom: import("vue-demi").Ref<any>;
197
197
  containerScrolling: import("vue-demi").Ref<any>;
198
198
  }> & import("vue/types/v3-component-options").ExtractComputedReturns<{}> & import("vue-demi").ComponentCustomProperties & Readonly<import("vue-demi").ExtractPropTypes<{
199
199
  scrollview: {
@@ -311,7 +311,7 @@ declare const _default: import("vue/types/v3-component-public-instance").Compone
311
311
  ignore: () => void;
312
312
  hangup: () => void;
313
313
  sendDtmf: () => void;
314
- iframe: import("vue-demi").Ref<any>;
314
+ iframeDom: import("vue-demi").Ref<any>;
315
315
  containerScrolling: import("vue-demi").Ref<any>;
316
316
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
317
317
  "softphone-connect": (event: any) => void;
@@ -91,15 +91,15 @@ __sfc_main.setup = (__props, __ctx) => {
91
91
  const emit = __ctx.emit;
92
92
  const container = vueDemi.ref();
93
93
  const iframeContainer = vueDemi.ref();
94
- const iframe2 = vueDemi.ref();
94
+ const iframeDom = vueDemi.ref();
95
95
  const instance = (_a = vueDemi.getCurrentInstance()) == null ? void 0 : _a.proxy;
96
96
  const getContextDomElement = (el) => {
97
97
  const parent = (instance == null ? void 0 : instance.$el) || document;
98
98
  return (props.selector ? parent.querySelector(props.selector) ?? document.querySelector(props.selector) ?? parent : parent).querySelector(el);
99
99
  };
100
100
  const handlingCommunication = (e) => {
101
- const iframe3 = getContextDomElement(".nf-softphone-iframe");
102
- if (iframe3) {
101
+ const iframe = getContextDomElement(".nf-softphone-iframe");
102
+ if (iframe) {
103
103
  let data = {};
104
104
  try {
105
105
  data = JSON.parse(e.data);
@@ -107,9 +107,9 @@ __sfc_main.setup = (__props, __ctx) => {
107
107
  }
108
108
  if (data.type === "softphone-expand") {
109
109
  if (data.data === "expand") {
110
- iframe3.setAttribute("style", "position: fixed;z-index:999;");
110
+ iframe.setAttribute("style", "position: fixed;z-index:999;");
111
111
  } else if (data.data === "shrink") {
112
- iframe3.removeAttribute("style");
112
+ iframe.removeAttribute("style");
113
113
  }
114
114
  return;
115
115
  }
@@ -189,7 +189,7 @@ __sfc_main.setup = (__props, __ctx) => {
189
189
  left
190
190
  } = await refreshStyle() || {};
191
191
  if (top && left) {
192
- (_a2 = iframe2.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
192
+ (_a2 = iframeDom.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
193
193
  type: "softphone-scroll",
194
194
  origin: props.origin,
195
195
  ancestorOrigin: props.ancestorOrigin,
@@ -218,7 +218,7 @@ __sfc_main.setup = (__props, __ctx) => {
218
218
  url += agentTag ? `&agentTag=${agentTag}` : "";
219
219
  url += agentId ? `&agentId=${agentId}` : "";
220
220
  url += `&appKey=${appKey}&appSecret=${appSecret}&extStatus=${extStatus}&paddingTop=${top}px&paddingLeft=${left}px`;
221
- iframe2.value.src = url;
221
+ iframeDom.value.src = url;
222
222
  window.addEventListener("message", handlingCommunication, false);
223
223
  if (props.scrollview) {
224
224
  (_a2 = document.querySelector(props.scrollview)) == null ? void 0 : _a2.addEventListener("scroll", handlingScroll);
@@ -235,7 +235,7 @@ __sfc_main.setup = (__props, __ctx) => {
235
235
  });
236
236
  const postMessageCommunicate = (type, status) => {
237
237
  var _a2;
238
- (_a2 = iframe2.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
238
+ (_a2 = iframeDom.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
239
239
  origin: props.origin,
240
240
  ancestorOrigin: props.ancestorOrigin,
241
241
  type,
@@ -269,7 +269,7 @@ __sfc_main.setup = (__props, __ctx) => {
269
269
  return Object.assign({
270
270
  container,
271
271
  iframeContainer,
272
- iframe: iframe2,
272
+ iframeDom,
273
273
  containerScrolling
274
274
  }, {
275
275
  connect,
@@ -279,13 +279,10 @@ __sfc_main.setup = (__props, __ctx) => {
279
279
  ignore,
280
280
  hangup,
281
281
  sendDtmf,
282
- iframe: iframe2,
282
+ iframeDom,
283
283
  containerScrolling
284
284
  });
285
285
  };
286
- __sfc_main.components = Object.assign({
287
- iframe
288
- }, __sfc_main.components);
289
286
  var _sfc_render = function render() {
290
287
  var _vm = this, _c = _vm._self._c;
291
288
  _vm._self._setupProxy;
@@ -301,7 +298,7 @@ var _sfc_render = function render() {
301
298
  ref: "iframeContainer",
302
299
  staticClass: "nf-softphone-iframe-container"
303
300
  }, [_c("iframe", {
304
- ref: "iframe",
301
+ ref: "iframeDom",
305
302
  staticClass: "nf-softphone-iframe",
306
303
  attrs: {
307
304
  "src": "",
@@ -397,8 +394,8 @@ class SoftphoneManager {
397
394
  };
398
395
  this.handlingCommunication = (e) => {
399
396
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
400
- const iframe2 = this.getContextDomElement(".nf-softphone-iframe");
401
- if (iframe2) {
397
+ const iframe = this.getContextDomElement(".nf-softphone-iframe");
398
+ if (iframe) {
402
399
  let data = {};
403
400
  try {
404
401
  data = JSON.parse(e.data);
@@ -406,9 +403,9 @@ class SoftphoneManager {
406
403
  }
407
404
  if (data.type === "softphone-expand") {
408
405
  if (data.data === "expand") {
409
- iframe2.setAttribute("style", "position: fixed;z-index:999;");
406
+ iframe.setAttribute("style", "position: fixed;z-index:999;");
410
407
  } else if (data.data === "shrink") {
411
- iframe2.removeAttribute("style");
408
+ iframe.removeAttribute("style");
412
409
  }
413
410
  return;
414
411
  }
@@ -472,18 +469,18 @@ class SoftphoneManager {
472
469
  this.handlerDomGenerater = () => {
473
470
  const container = document.createElement("div");
474
471
  const iframeContainer = document.createElement("div");
475
- const iframe2 = document.createElement("iframe");
472
+ const iframe = document.createElement("iframe");
476
473
  const uuid = commonUtils.generateUUID();
477
474
  this.option.instanceMap[uuid] = container;
478
475
  container.setAttribute("id", uuid);
479
476
  container.setAttribute("class", "nf-softphone-container");
480
477
  iframeContainer.setAttribute("class", "nf-softphone-iframe-container");
481
- iframe2.setAttribute("class", "nf-softphone-iframe");
482
- iframe2.setAttribute("src", "");
483
- iframe2.setAttribute("frameborder", "0");
484
- iframe2.setAttribute("scrolling", "no");
485
- iframe2.setAttribute("allow", "camera *; microphone *");
486
- iframeContainer.appendChild(iframe2);
478
+ iframe.setAttribute("class", "nf-softphone-iframe");
479
+ iframe.setAttribute("src", "");
480
+ iframe.setAttribute("frameborder", "0");
481
+ iframe.setAttribute("scrolling", "no");
482
+ iframe.setAttribute("allow", "camera *; microphone *");
483
+ iframeContainer.appendChild(iframe);
487
484
  container.appendChild(iframeContainer);
488
485
  const destination = this.option.el ? this.getContextDomElement(this.option.el) ?? document.body : document.body;
489
486
  destination.appendChild(container);
@@ -505,7 +502,7 @@ class SoftphoneManager {
505
502
  url += agentTag ? `&agentTag=${agentTag}` : "";
506
503
  url += agentId ? `&agentId=${agentId}` : "";
507
504
  url += `&appKey=${appKey}&appSecret=${appSecret}&extStatus=${extStatus}&paddingTop=${top}px&paddingLeft=${left}px`;
508
- iframe2.src = url;
505
+ iframe.src = url;
509
506
  };
510
507
  this.initSoftphone = (option) => {
511
508
  this.option = option ? { ...this.option, ...option } : this.option;
@@ -514,9 +511,9 @@ class SoftphoneManager {
514
511
  return this;
515
512
  };
516
513
  this.postMessageCommunicate = (type, status) => {
517
- const iframe2 = this.getContextDomElement(".nf-softphone-iframe");
518
- if (iframe2) {
519
- iframe2.contentWindow.postMessage(JSON.stringify({
514
+ const iframe = this.getContextDomElement(".nf-softphone-iframe");
515
+ if (iframe) {
516
+ iframe.contentWindow.postMessage(JSON.stringify({
520
517
  origin: this.option.origin,
521
518
  ancestorOrigin: this.option.ancestorOrigin,
522
519
  type,
@@ -89,15 +89,15 @@ __sfc_main.setup = (__props, __ctx) => {
89
89
  const emit = __ctx.emit;
90
90
  const container = ref();
91
91
  const iframeContainer = ref();
92
- const iframe2 = ref();
92
+ const iframeDom = ref();
93
93
  const instance = (_a = getCurrentInstance()) == null ? void 0 : _a.proxy;
94
94
  const getContextDomElement = (el) => {
95
95
  const parent = (instance == null ? void 0 : instance.$el) || document;
96
96
  return (props.selector ? parent.querySelector(props.selector) ?? document.querySelector(props.selector) ?? parent : parent).querySelector(el);
97
97
  };
98
98
  const handlingCommunication = (e) => {
99
- const iframe3 = getContextDomElement(".nf-softphone-iframe");
100
- if (iframe3) {
99
+ const iframe = getContextDomElement(".nf-softphone-iframe");
100
+ if (iframe) {
101
101
  let data = {};
102
102
  try {
103
103
  data = JSON.parse(e.data);
@@ -105,9 +105,9 @@ __sfc_main.setup = (__props, __ctx) => {
105
105
  }
106
106
  if (data.type === "softphone-expand") {
107
107
  if (data.data === "expand") {
108
- iframe3.setAttribute("style", "position: fixed;z-index:999;");
108
+ iframe.setAttribute("style", "position: fixed;z-index:999;");
109
109
  } else if (data.data === "shrink") {
110
- iframe3.removeAttribute("style");
110
+ iframe.removeAttribute("style");
111
111
  }
112
112
  return;
113
113
  }
@@ -187,7 +187,7 @@ __sfc_main.setup = (__props, __ctx) => {
187
187
  left
188
188
  } = await refreshStyle() || {};
189
189
  if (top && left) {
190
- (_a2 = iframe2.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
190
+ (_a2 = iframeDom.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
191
191
  type: "softphone-scroll",
192
192
  origin: props.origin,
193
193
  ancestorOrigin: props.ancestorOrigin,
@@ -216,7 +216,7 @@ __sfc_main.setup = (__props, __ctx) => {
216
216
  url += agentTag ? `&agentTag=${agentTag}` : "";
217
217
  url += agentId ? `&agentId=${agentId}` : "";
218
218
  url += `&appKey=${appKey}&appSecret=${appSecret}&extStatus=${extStatus}&paddingTop=${top}px&paddingLeft=${left}px`;
219
- iframe2.value.src = url;
219
+ iframeDom.value.src = url;
220
220
  window.addEventListener("message", handlingCommunication, false);
221
221
  if (props.scrollview) {
222
222
  (_a2 = document.querySelector(props.scrollview)) == null ? void 0 : _a2.addEventListener("scroll", handlingScroll);
@@ -233,7 +233,7 @@ __sfc_main.setup = (__props, __ctx) => {
233
233
  });
234
234
  const postMessageCommunicate = (type, status) => {
235
235
  var _a2;
236
- (_a2 = iframe2.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
236
+ (_a2 = iframeDom.value) == null ? void 0 : _a2.contentWindow.postMessage(JSON.stringify({
237
237
  origin: props.origin,
238
238
  ancestorOrigin: props.ancestorOrigin,
239
239
  type,
@@ -267,7 +267,7 @@ __sfc_main.setup = (__props, __ctx) => {
267
267
  return Object.assign({
268
268
  container,
269
269
  iframeContainer,
270
- iframe: iframe2,
270
+ iframeDom,
271
271
  containerScrolling
272
272
  }, {
273
273
  connect,
@@ -277,13 +277,10 @@ __sfc_main.setup = (__props, __ctx) => {
277
277
  ignore,
278
278
  hangup,
279
279
  sendDtmf,
280
- iframe: iframe2,
280
+ iframeDom,
281
281
  containerScrolling
282
282
  });
283
283
  };
284
- __sfc_main.components = Object.assign({
285
- iframe
286
- }, __sfc_main.components);
287
284
  var _sfc_render = function render() {
288
285
  var _vm = this, _c = _vm._self._c;
289
286
  _vm._self._setupProxy;
@@ -299,7 +296,7 @@ var _sfc_render = function render() {
299
296
  ref: "iframeContainer",
300
297
  staticClass: "nf-softphone-iframe-container"
301
298
  }, [_c("iframe", {
302
- ref: "iframe",
299
+ ref: "iframeDom",
303
300
  staticClass: "nf-softphone-iframe",
304
301
  attrs: {
305
302
  "src": "",
@@ -395,8 +392,8 @@ class SoftphoneManager {
395
392
  };
396
393
  this.handlingCommunication = (e) => {
397
394
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
398
- const iframe2 = this.getContextDomElement(".nf-softphone-iframe");
399
- if (iframe2) {
395
+ const iframe = this.getContextDomElement(".nf-softphone-iframe");
396
+ if (iframe) {
400
397
  let data = {};
401
398
  try {
402
399
  data = JSON.parse(e.data);
@@ -404,9 +401,9 @@ class SoftphoneManager {
404
401
  }
405
402
  if (data.type === "softphone-expand") {
406
403
  if (data.data === "expand") {
407
- iframe2.setAttribute("style", "position: fixed;z-index:999;");
404
+ iframe.setAttribute("style", "position: fixed;z-index:999;");
408
405
  } else if (data.data === "shrink") {
409
- iframe2.removeAttribute("style");
406
+ iframe.removeAttribute("style");
410
407
  }
411
408
  return;
412
409
  }
@@ -470,18 +467,18 @@ class SoftphoneManager {
470
467
  this.handlerDomGenerater = () => {
471
468
  const container = document.createElement("div");
472
469
  const iframeContainer = document.createElement("div");
473
- const iframe2 = document.createElement("iframe");
470
+ const iframe = document.createElement("iframe");
474
471
  const uuid = generateUUID();
475
472
  this.option.instanceMap[uuid] = container;
476
473
  container.setAttribute("id", uuid);
477
474
  container.setAttribute("class", "nf-softphone-container");
478
475
  iframeContainer.setAttribute("class", "nf-softphone-iframe-container");
479
- iframe2.setAttribute("class", "nf-softphone-iframe");
480
- iframe2.setAttribute("src", "");
481
- iframe2.setAttribute("frameborder", "0");
482
- iframe2.setAttribute("scrolling", "no");
483
- iframe2.setAttribute("allow", "camera *; microphone *");
484
- iframeContainer.appendChild(iframe2);
476
+ iframe.setAttribute("class", "nf-softphone-iframe");
477
+ iframe.setAttribute("src", "");
478
+ iframe.setAttribute("frameborder", "0");
479
+ iframe.setAttribute("scrolling", "no");
480
+ iframe.setAttribute("allow", "camera *; microphone *");
481
+ iframeContainer.appendChild(iframe);
485
482
  container.appendChild(iframeContainer);
486
483
  const destination = this.option.el ? this.getContextDomElement(this.option.el) ?? document.body : document.body;
487
484
  destination.appendChild(container);
@@ -503,7 +500,7 @@ class SoftphoneManager {
503
500
  url += agentTag ? `&agentTag=${agentTag}` : "";
504
501
  url += agentId ? `&agentId=${agentId}` : "";
505
502
  url += `&appKey=${appKey}&appSecret=${appSecret}&extStatus=${extStatus}&paddingTop=${top}px&paddingLeft=${left}px`;
506
- iframe2.src = url;
503
+ iframe.src = url;
507
504
  };
508
505
  this.initSoftphone = (option) => {
509
506
  this.option = option ? { ...this.option, ...option } : this.option;
@@ -512,9 +509,9 @@ class SoftphoneManager {
512
509
  return this;
513
510
  };
514
511
  this.postMessageCommunicate = (type, status) => {
515
- const iframe2 = this.getContextDomElement(".nf-softphone-iframe");
516
- if (iframe2) {
517
- iframe2.contentWindow.postMessage(JSON.stringify({
512
+ const iframe = this.getContextDomElement(".nf-softphone-iframe");
513
+ if (iframe) {
514
+ iframe.contentWindow.postMessage(JSON.stringify({
518
515
  origin: this.option.origin,
519
516
  ancestorOrigin: this.option.ancestorOrigin,
520
517
  type,
@@ -38,7 +38,7 @@ declare const _default: import("vue-demi").DefineComponent<__VLS_WithDefaults<__
38
38
  ignore: () => void;
39
39
  hangup: () => void;
40
40
  sendDtmf: () => void;
41
- iframe: import("vue-demi").Ref<any>;
41
+ iframeDom: import("vue-demi").Ref<any>;
42
42
  containerScrolling: import("vue-demi").Ref<any>;
43
43
  }, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
44
44
  "softphone-connect": (event: any) => void;
@@ -3,7 +3,7 @@
3
3
  <div class="nf-softphone-container" ref="container" :class="{'nf-transparent': containerScrolling === true}">
4
4
  <div class="nf-softphone-iframe-container" ref="iframeContainer">
5
5
  <iframe
6
- ref="iframe"
6
+ ref="iframeDom"
7
7
  class="nf-softphone-iframe"
8
8
  src=""
9
9
  frameborder="0"
@@ -82,7 +82,7 @@ const emit = defineEmits<{
82
82
 
83
83
  const container = ref()
84
84
  const iframeContainer = ref()
85
- const iframe = ref()
85
+ const iframeDom = ref()
86
86
  const instance = getCurrentInstance()?.proxy
87
87
 
88
88
  const getContextDomElement = (el: string) => {
@@ -187,7 +187,7 @@ const handlingScroll = debounce(async () => {
187
187
  left,
188
188
  } = (await refreshStyle() || {})
189
189
  if (top && left) {
190
- iframe.value?.contentWindow.postMessage(JSON.stringify({
190
+ iframeDom.value?.contentWindow.postMessage(JSON.stringify({
191
191
  type: 'softphone-scroll',
192
192
  origin: props.origin,
193
193
  ancestorOrigin: props.ancestorOrigin,
@@ -216,7 +216,7 @@ onMounted(async () => {
216
216
  url += agentTag ? `&agentTag=${agentTag}` : ''
217
217
  url += agentId ? `&agentId=${agentId}` : ''
218
218
  url += `&appKey=${appKey}&appSecret=${appSecret}&extStatus=${extStatus}&paddingTop=${top}px&paddingLeft=${left}px`
219
- iframe.value.src = url
219
+ iframeDom.value.src = url
220
220
  window.addEventListener('message', handlingCommunication, false);
221
221
  if (props.scrollview) {
222
222
  document.querySelector(props.scrollview)?.addEventListener('scroll', handlingScroll)
@@ -233,7 +233,7 @@ onUnmounted(() => {
233
233
  })
234
234
 
235
235
  const postMessageCommunicate = (type, status?: boolean) => {
236
- iframe.value?.contentWindow.postMessage(JSON.stringify({
236
+ iframeDom.value?.contentWindow.postMessage(JSON.stringify({
237
237
  origin: props.origin,
238
238
  ancestorOrigin: props.ancestorOrigin,
239
239
  type,
@@ -277,7 +277,7 @@ defineExpose({
277
277
  ignore,
278
278
  hangup,
279
279
  sendDtmf,
280
- iframe,
280
+ iframeDom,
281
281
  containerScrolling
282
282
  })
283
283
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-softphone",
3
- "version": "3.3.17",
3
+ "version": "3.3.19",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -14,7 +14,7 @@
14
14
  "url": "http://94ai.gitlab.com/ui/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^3.3.17",
17
+ "@94ai/nf-theme-chalk": "^3.3.19",
18
18
  "vue-demi": "^0.14.5"
19
19
  },
20
20
  "peerDependenciesMeta": {
@@ -30,5 +30,5 @@
30
30
  "types": "lib/index.d.ts",
31
31
  "main": "lib/nf-softphone.cjs.js",
32
32
  "module": "lib/nf-softphone.esm-bundler.js",
33
- "gitHead": "6c22ca6497060d2c3789c9dade757bf202919452"
33
+ "gitHead": "4762f1f5a9bf3df93f2e3898edd8e046931870d0"
34
34
  }