@94ai/nf-microphone 8.3.23 → 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.
@@ -5367,14 +5367,6 @@ __sfc_main.setup = (__props, __ctx) => {
5367
5367
  constructor(key) {
5368
5368
  this.key = key;
5369
5369
  }
5370
- /**
5371
- * 获取 UserInfo
5372
- */
5373
- getUserInfo() {
5374
- return {};
5375
- }
5376
- setUserInfo(data) {
5377
- }
5378
5370
  /**
5379
5371
  * 获取分机信息
5380
5372
  */
@@ -5711,36 +5703,6 @@ __sfc_main.setup = (__props, __ctx) => {
5711
5703
  });
5712
5704
  new SoftphoneNotity().useWujieSoftphoneNotity();
5713
5705
  }
5714
- registerQiankunMicroApps() {
5715
- const appConfig = this.getMicroAppConfig()[0];
5716
- appConfig.props.shared.getUserInfo = getUserInfo;
5717
- appConfig.props.shared.setUserInfo = setUserInfo;
5718
- qiankun.registerMicroApps([appConfig], {
5719
- // qiankun 生命周期钩子 - 加载前
5720
- beforeLoad: [(app) => {
5721
- return Promise.resolve();
5722
- }],
5723
- // qiankun 生命周期钩子 - 挂载后
5724
- afterMount: [(app) => {
5725
- return Promise.resolve();
5726
- }],
5727
- // qiankun 生命周期钩子 - 卸载后
5728
- afterUnmount: [(app) => {
5729
- return Promise.resolve();
5730
- }]
5731
- });
5732
- this.initState();
5733
- }
5734
- startQiankun() {
5735
- this.registerQiankunMicroApps();
5736
- qiankun.start({
5737
- singular: false,
5738
- prefetch: "all",
5739
- sandbox: {
5740
- experimentalStyleIsolation: true
5741
- }
5742
- });
5743
- }
5744
5706
  startWujie() {
5745
5707
  this.registerWujieMicroApps();
5746
5708
  wujie.startApp({
@@ -5748,13 +5710,6 @@ __sfc_main.setup = (__props, __ctx) => {
5748
5710
  el: nfMicrophone.value
5749
5711
  });
5750
5712
  }
5751
- startMicrotask() {
5752
- if (this.mode === "wujie") {
5753
- this.startWujie();
5754
- } else {
5755
- this.startQiankun();
5756
- }
5757
- }
5758
5713
  }
5759
5714
  _qiankunActions = new WeakMap();
5760
5715
  const nfMicrophoneInstance = new MicroManager();
@@ -6618,7 +6573,7 @@ class SoftphoneManager {
6618
6573
  }
6619
6574
  startWujie() {
6620
6575
  this.registerWujieMicroApps();
6621
- startApp({
6576
+ wujie.startApp({
6622
6577
  name: props.name,
6623
6578
  el: props.el
6624
6579
  });
@@ -18,7 +18,7 @@ var __privateSet = (obj, member, value, setter) => {
18
18
  };
19
19
  import { defineComponent, ref, onMounted } from "vue-demi";
20
20
  import { initGlobalState, addGlobalUncaughtErrorHandler, loadMicroApp, registerMicroApps, start } from "qiankun";
21
- import { bus, setupApp, startApp as startApp$1 } from "wujie";
21
+ import { bus, setupApp, startApp } from "wujie";
22
22
  import { onUnmounted } from "vue";
23
23
  import { normalizeComponent } from "@94ai/vue2-runtime-helpers";
24
24
  function isDomainOrIP(str) {
@@ -5365,14 +5365,6 @@ __sfc_main.setup = (__props, __ctx) => {
5365
5365
  constructor(key) {
5366
5366
  this.key = key;
5367
5367
  }
5368
- /**
5369
- * 获取 UserInfo
5370
- */
5371
- getUserInfo() {
5372
- return {};
5373
- }
5374
- setUserInfo(data) {
5375
- }
5376
5368
  /**
5377
5369
  * 获取分机信息
5378
5370
  */
@@ -5709,50 +5701,13 @@ __sfc_main.setup = (__props, __ctx) => {
5709
5701
  });
5710
5702
  new SoftphoneNotity().useWujieSoftphoneNotity();
5711
5703
  }
5712
- registerQiankunMicroApps() {
5713
- const appConfig = this.getMicroAppConfig()[0];
5714
- appConfig.props.shared.getUserInfo = getUserInfo;
5715
- appConfig.props.shared.setUserInfo = setUserInfo;
5716
- registerMicroApps([appConfig], {
5717
- // qiankun 生命周期钩子 - 加载前
5718
- beforeLoad: [(app) => {
5719
- return Promise.resolve();
5720
- }],
5721
- // qiankun 生命周期钩子 - 挂载后
5722
- afterMount: [(app) => {
5723
- return Promise.resolve();
5724
- }],
5725
- // qiankun 生命周期钩子 - 卸载后
5726
- afterUnmount: [(app) => {
5727
- return Promise.resolve();
5728
- }]
5729
- });
5730
- this.initState();
5731
- }
5732
- startQiankun() {
5733
- this.registerQiankunMicroApps();
5734
- start({
5735
- singular: false,
5736
- prefetch: "all",
5737
- sandbox: {
5738
- experimentalStyleIsolation: true
5739
- }
5740
- });
5741
- }
5742
5704
  startWujie() {
5743
5705
  this.registerWujieMicroApps();
5744
- startApp$1({
5706
+ startApp({
5745
5707
  name: props.name,
5746
5708
  el: nfMicrophone.value
5747
5709
  });
5748
5710
  }
5749
- startMicrotask() {
5750
- if (this.mode === "wujie") {
5751
- this.startWujie();
5752
- } else {
5753
- this.startQiankun();
5754
- }
5755
- }
5756
5711
  }
5757
5712
  _qiankunActions = new WeakMap();
5758
5713
  const nfMicrophoneInstance = new MicroManager();
@@ -1,5 +1,5 @@
1
1
  const { addGlobalUncaughtErrorHandler, initGlobalState, registerMicroApps, loadMicroApp, start } = window.qiankun
2
- const { bus, setupApp } = window.wujie
2
+ const { bus, setupApp, startApp } = window.wujie
3
3
  class SoftphoneManager {
4
4
  nfMicrophoneInstance
5
5
  option = {
@@ -515,20 +515,17 @@ class SoftphoneManager {
515
515
  const shared = new Shared('default')
516
516
  if (props.getOfflineInfo) {
517
517
  shared.getOfflineInfo = async (data) => {
518
- return await props.getOfflineInfo
519
- !(data)
518
+ return await props.getOfflineInfo(data)
520
519
  }
521
520
  }
522
521
  if (props.changeALittleRest) {
523
522
  shared.changeALittleRest = async (data) => {
524
- return await props.changeALittleRest
525
- !(data)
523
+ return await props.changeALittleRest(data)
526
524
  }
527
525
  }
528
526
  if (props.quickCallWin) {
529
527
  shared.quickCallWin = async (data) => {
530
- return await props.quickCallWin
531
- !(data)
528
+ return await props.quickCallWin(data)
532
529
  }
533
530
  }
534
531
  (Object.keys(props.envMap).reduce((res, currentValue) => {
@@ -1,6 +1,6 @@
1
- import { isDomainOrIP } from 'packages/nf-microphone/lib/util'
1
+ import { isDomainOrIP } from './util'
2
2
  import { addGlobalUncaughtErrorHandler, initGlobalState, registerMicroApps, loadMicroApp, start } from 'qiankun'
3
- import { bus, setupApp } from 'wujie'
3
+ import { bus, setupApp, startApp } from 'wujie'
4
4
  import { Option } from './types'
5
5
  import CryptoJS from 'crypto-js'
6
6
  // @ts-ignore
@@ -16,9 +16,7 @@ import {
16
16
  ref
17
17
  } from 'vue-demi'
18
18
  import {
19
- registerMicroApps,
20
19
  loadMicroApp,
21
- start,
22
20
  addGlobalUncaughtErrorHandler,
23
21
  initGlobalState
24
22
  } from 'qiankun'
@@ -219,16 +217,6 @@ class Shared {
219
217
  this.key = key
220
218
  }
221
219
 
222
- /**
223
- * 获取 UserInfo
224
- */
225
- getUserInfo() {
226
- return {}
227
- }
228
-
229
- setUserInfo(data) {
230
- }
231
-
232
220
  /**
233
221
  * 获取分机信息
234
222
  */
@@ -604,43 +592,6 @@ class MicroManager {
604
592
  (new SoftphoneNotity()).useWujieSoftphoneNotity()
605
593
  }
606
594
 
607
- registerQiankunMicroApps() {
608
- const appConfig = this.getMicroAppConfig()[0]
609
- appConfig.props.shared.getUserInfo = getUserInfo
610
- appConfig.props.shared.setUserInfo = setUserInfo
611
-
612
- registerMicroApps([appConfig], {
613
- // qiankun 生命周期钩子 - 加载前
614
- beforeLoad: [(app) => {
615
- // 加载子应用前,加载进度条
616
- // NProgress.start()
617
- return Promise.resolve()
618
- }],
619
- // qiankun 生命周期钩子 - 挂载后
620
- afterMount: [(app) => {
621
- // 加载子应用前,进度条加载完成
622
- // NProgress.done()
623
- return Promise.resolve()
624
- }],
625
- // qiankun 生命周期钩子 - 卸载后
626
- afterUnmount: [app => {
627
- return Promise.resolve()
628
- }]
629
- })
630
- this.initState()
631
- }
632
-
633
- startQiankun() {
634
- this.registerQiankunMicroApps()
635
- start({
636
- singular: false,
637
- prefetch: 'all',
638
- sandbox: {
639
- experimentalStyleIsolation: true
640
- }
641
- })
642
- }
643
-
644
595
  startWujie() {
645
596
  this.registerWujieMicroApps()
646
597
  // @ts-ignore
@@ -650,13 +601,6 @@ class MicroManager {
650
601
  })
651
602
  }
652
603
 
653
- startMicrotask() {
654
- if (this.mode === 'wujie') {
655
- this.startWujie()
656
- } else {
657
- this.startQiankun()
658
- }
659
- }
660
604
  }
661
605
  const nfMicrophoneInstance = new MicroManager()
662
606
  // 通知
@@ -859,7 +803,7 @@ const setUserInfo = (userInfo) => {
859
803
  }
860
804
 
861
805
  onMounted(() => {
862
- // 注册软电话微应用
806
+ // 组件仅直接挂载应用;注册式启动由独立 SoftphoneManager 管理。
863
807
  if (props.mode === 'qiankun') {
864
808
  nfMicrophoneInstance.loadQiankunMicroApps()
865
809
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@94ai/nf-microphone",
3
- "version": "8.3.23",
3
+ "version": "10.0.0",
4
4
  "description": "> TODO: description",
5
5
  "keywords": [],
6
6
  "author": "zoujiahe <zoujiahe@94ai.com>",
@@ -11,14 +11,15 @@
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",
14
- "url": "http://94ai.gitlab.com/ui/common-ui.git"
14
+ "url": "http://gitlab.94ai.pro/ui/common-ui.git"
15
15
  },
16
16
  "dependencies": {
17
- "@94ai/nf-theme-chalk": "^8.3.23",
17
+ "@94ai/nf-theme-chalk": "^10.0.0",
18
18
  "crypto-js": "^4.2.0",
19
19
  "qiankun": "^2.10.16",
20
20
  "vue-demi": "^0.14.5",
21
- "wujie": "^1.0.22"
21
+ "wujie": "^1.0.22",
22
+ "@94ai/vue2-runtime-helpers": "1.0.1"
22
23
  },
23
24
  "peerDependenciesMeta": {
24
25
  "@vue/composition-api": {
@@ -27,11 +28,10 @@
27
28
  },
28
29
  "peerDependencies": {
29
30
  "@vue/composition-api": "^1.0.0-rc.1",
30
- "element-ui": ">=2.13.2",
31
- "vue": "^2.0.0 || >=3.0.0"
31
+ "vue": "^2.0.0 || >=3.0.0",
32
+ "element-ui": ">=2.13.2"
32
33
  },
33
34
  "types": "lib/index.d.ts",
34
35
  "main": "lib/nf-microphone.cjs.js",
35
- "module": "lib/nf-microphone.esm-bundler.js",
36
- "gitHead": "74e871c7972dc4576480bee02b1dc61a3eafc6ba"
36
+ "module": "lib/nf-microphone.esm-bundler.js"
37
37
  }