yach.open.jssdk 4.4.3 → 4.4.4-beta2
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/dist/yach_jssdk_4.4.4-beta1.js +1 -0
- package/es/api/app/custom/talYoungFilesUpload.js +0 -2
- package/es/api/biz/chat/chooseConversationByCorpId.js +0 -2
- package/es/api/biz/chat/openSingleChat.js +0 -2
- package/es/api/biz/chat/openSquad.js +0 -2
- package/es/api/biz/chat/openTeamChat.js +0 -2
- package/es/api/biz/chat/pickConversation.js +0 -2
- package/es/api/biz/chat/sendP2PMsg.js +0 -2
- package/es/api/biz/contact/complexPicker.js +0 -2
- package/es/api/biz/contact/departmentsPicker.js +0 -2
- package/es/api/biz/group/groupComplexPicker.js +0 -2
- package/es/api/biz/map/multipointView.js +0 -2
- package/es/api/biz/map/view.js +0 -2
- package/es/api/biz/navigation/close.js +0 -2
- package/es/api/biz/navigation/goBack.js +0 -2
- package/es/api/biz/navigation/quit.js +0 -2
- package/es/api/biz/navigation/replace.js +0 -2
- package/es/api/biz/navigation/setIcon.js +0 -2
- package/es/api/biz/navigation/setLeft.js +0 -2
- package/es/api/biz/navigation/setMenu.js +0 -2
- package/es/api/biz/navigation/setPanGestureEnable.js +0 -2
- package/es/api/biz/navigation/setRight.js +0 -2
- package/es/api/biz/navigation/setTitle.js +0 -2
- package/es/api/biz/navigation/setTitleExpandIcon.js +0 -2
- package/es/api/biz/navigation/setWindowBig.js +0 -2
- package/es/api/biz/navigation/tencentMeeting.js +0 -2
- package/es/api/biz/navigation/tencentMeetingBegin.js +0 -2
- package/es/api/biz/navigation/updateExpandTitle.js +0 -2
- package/es/api/biz/telephone/call.js +0 -2
- package/es/api/biz/telephone/showCallMenu.js +0 -2
- package/es/api/biz/util/addAppToNav.js +0 -2
- package/es/api/biz/util/assistantCreate.js +0 -2
- package/es/api/biz/util/authFinish.js +0 -2
- package/es/api/biz/util/authStart.js +0 -2
- package/es/api/biz/util/chosen.js +0 -2
- package/es/api/biz/util/clipboardFileUpload.js +0 -2
- package/es/api/biz/util/closeWindow.js +0 -2
- package/es/api/biz/util/complain.js +0 -2
- package/es/api/biz/util/createModifySchedule.js +0 -2
- package/es/api/biz/util/datepicker.js +0 -2
- package/es/api/biz/util/datetimepicker.js +0 -2
- package/es/api/biz/util/disableScreenCapture.js +0 -2
- package/es/api/biz/util/downloadFile.js +0 -2
- package/es/api/biz/util/entergroupCheck.js +0 -2
- package/es/api/biz/util/externalLinkPreviewFile.js +0 -2
- package/es/api/biz/util/feedback.js +0 -2
- package/es/api/biz/util/getSingleWebviewData.js +0 -2
- package/es/api/biz/util/getTogetherConfig.js +0 -2
- package/es/api/biz/util/getToken.js +0 -2
- package/es/api/biz/util/injectScript.js +0 -2
- package/es/api/biz/util/invoice.js +0 -2
- package/es/api/biz/util/knowledgeBaseSelect.js +9 -3
- package/es/api/biz/util/knowledgeSelectParams.d.ts +12 -0
- package/es/api/biz/util/knowledgeSelectParams.js +19 -0
- package/es/api/biz/util/mediaFileUpload.js +0 -2
- package/es/api/biz/util/onlineDocmentOpenTeamChat.js +0 -2
- package/es/api/biz/util/open.js +0 -2
- package/es/api/biz/util/openFutureGroup.js +0 -2
- package/es/api/biz/util/openLink.js +0 -2
- package/es/api/biz/util/openMediaFileDialog.js +0 -2
- package/es/api/biz/util/openSingleWebview.js +0 -2
- package/es/api/biz/util/openSlidePanel.js +0 -2
- package/es/api/biz/util/openTalYoungToTopic.js +0 -2
- package/es/api/biz/util/openTogetherEyeWebview.js +0 -2
- package/es/api/biz/util/openUserSchedule.js +0 -2
- package/es/api/biz/util/openVideoPlayer.js +0 -2
- package/es/api/biz/util/previewFile.js +0 -2
- package/es/api/biz/util/previewImage.js +0 -2
- package/es/api/biz/util/proxy.js +0 -2
- package/es/api/biz/util/pushWorkMsg.js +0 -2
- package/es/api/biz/util/remind.js +0 -2
- package/es/api/biz/util/resetSessionUnread.js +0 -2
- package/es/api/biz/util/rouseApp.js +0 -2
- package/es/api/biz/util/savePic.js +0 -2
- package/es/api/biz/util/scan.js +0 -2
- package/es/api/biz/util/screen.js +0 -2
- package/es/api/biz/util/selectDepartment.js +0 -2
- package/es/api/biz/util/share.js +0 -2
- package/es/api/biz/util/takePicture.js +0 -2
- package/es/api/biz/util/topicEvent.js +0 -2
- package/es/api/biz/util/uploadAttachment.js +0 -2
- package/es/api/biz/util/weeklyRead.js +0 -2
- package/es/api/biz/util/yachEvent.js +0 -2
- package/es/api/biz/util/zfbAuth.js +0 -2
- package/es/api/biz/webViewMessage/send.js +0 -2
- package/es/api/device/audio/download.js +0 -2
- package/es/api/device/audio/onPlayEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd_v2.js +0 -2
- package/es/api/device/audio/pause.js +0 -2
- package/es/api/device/audio/play.js +0 -2
- package/es/api/device/audio/resume.js +0 -2
- package/es/api/device/audio/startRecord.js +0 -2
- package/es/api/device/audio/startRecord_v2.js +0 -2
- package/es/api/device/audio/stop.js +0 -2
- package/es/api/device/audio/stopRecord.js +0 -2
- package/es/api/device/audio/stopRecord_v2.js +0 -2
- package/es/api/device/base/checkStepPermission.js +0 -2
- package/es/api/device/base/getPhoneInfo.js +0 -2
- package/es/api/device/base/getUUID.js +0 -2
- package/es/api/device/connection/getNetworkType.js +0 -2
- package/es/api/device/connection/isAtTal.js +2 -4
- package/es/api/device/geolocation/get.js +0 -2
- package/es/api/device/geolocation/getSwitch.js +0 -2
- package/es/api/device/notification/actionSheet.js +0 -2
- package/es/api/device/notification/alert.js +0 -2
- package/es/api/device/notification/confirm.js +0 -2
- package/es/api/device/notification/hidePreloader.js +0 -4
- package/es/api/device/notification/showPreloader.js +0 -4
- package/es/api/device/notification/toast.js +0 -2
- package/es/api/device/notification/vibrate.js +0 -2
- package/es/api/device/system/getLang.js +0 -2
- package/es/api/device/system/setLight.js +0 -2
- package/es/api/initAPI.js +3 -5
- package/es/api/primary/createTab.js +0 -2
- package/es/api/primary/exitFullScreen.js +0 -2
- package/es/api/primary/fullScreen.js +0 -2
- package/es/api/primary/weeklyShare.js +0 -2
- package/es/api/runtime/permission/requestAuthCode.js +0 -2
- package/es/api/ui/pullToRefresh/disable.js +0 -2
- package/es/api/ui/pullToRefresh/enable.js +0 -2
- package/es/api/ui/pullToRefresh/stop.js +0 -2
- package/es/api/ui/webViewBounce/disable.js +0 -2
- package/es/api/util/domainStorage/getItem.js +0 -2
- package/es/api/util/domainStorage/removeItem.js +0 -2
- package/es/api/util/domainStorage/setItem.js +0 -2
- package/es/api/util/tool/flushLog.js +0 -2
- package/es/api/util/tool/log.js +0 -2
- package/es/index.d.ts +3 -1
- package/es/index.js +19 -28
- package/es/lib/bridge/mobile.js +12 -28
- package/es/lib/bridge/pc.js +11 -19
- package/es/lib/helper/apiHelper.js +0 -2
- package/es/lib/helper/codeMap.js +0 -2
- package/es/lib/helper/event.js +7 -19
- package/es/lib/helper/pcIframe.js +21 -51
- package/es/lib/index.js +8 -22
- package/es/lib/sdk/index.js +17 -39
- package/es/lib/sdk/sdk.typings.js +0 -1
- package/es/utils/bpitLog.js +4 -13
- package/es/utils/compareVersions.js +26 -53
- package/es/utils/console.js +1 -17
- package/es/utils/env.js +12 -19
- package/es/utils/index.js +1 -6
- package/libs/api/app/custom/talYoungFilesUpload.js +2 -7
- package/libs/api/biz/chat/chooseConversationByCorpId.js +1 -7
- package/libs/api/biz/chat/openSingleChat.js +1 -7
- package/libs/api/biz/chat/openSquad.js +1 -7
- package/libs/api/biz/chat/openTeamChat.js +1 -7
- package/libs/api/biz/chat/pickConversation.js +1 -7
- package/libs/api/biz/chat/sendP2PMsg.js +1 -7
- package/libs/api/biz/contact/complexPicker.js +1 -7
- package/libs/api/biz/contact/departmentsPicker.js +1 -7
- package/libs/api/biz/group/groupComplexPicker.js +1 -7
- package/libs/api/biz/map/multipointView.js +1 -7
- package/libs/api/biz/map/view.js +1 -7
- package/libs/api/biz/navigation/close.js +1 -7
- package/libs/api/biz/navigation/goBack.js +1 -7
- package/libs/api/biz/navigation/quit.js +1 -7
- package/libs/api/biz/navigation/replace.js +1 -7
- package/libs/api/biz/navigation/setIcon.js +1 -8
- package/libs/api/biz/navigation/setLeft.js +1 -8
- package/libs/api/biz/navigation/setMenu.js +1 -8
- package/libs/api/biz/navigation/setPanGestureEnable.js +1 -8
- package/libs/api/biz/navigation/setRight.js +1 -8
- package/libs/api/biz/navigation/setTitle.js +1 -7
- package/libs/api/biz/navigation/setTitleExpandIcon.js +1 -8
- package/libs/api/biz/navigation/setWindowBig.js +2 -7
- package/libs/api/biz/navigation/tencentMeeting.js +1 -7
- package/libs/api/biz/navigation/tencentMeetingBegin.js +1 -7
- package/libs/api/biz/navigation/updateExpandTitle.js +1 -7
- package/libs/api/biz/telephone/call.js +1 -7
- package/libs/api/biz/telephone/showCallMenu.js +1 -7
- package/libs/api/biz/util/addAppToNav.js +1 -7
- package/libs/api/biz/util/assistantCreate.js +1 -7
- package/libs/api/biz/util/authFinish.js +1 -7
- package/libs/api/biz/util/authStart.js +1 -7
- package/libs/api/biz/util/chosen.js +1 -7
- package/libs/api/biz/util/clipboardFileUpload.js +1 -7
- package/libs/api/biz/util/closeWindow.js +1 -7
- package/libs/api/biz/util/complain.js +1 -7
- package/libs/api/biz/util/createModifySchedule.js +1 -7
- package/libs/api/biz/util/datepicker.js +1 -7
- package/libs/api/biz/util/datetimepicker.js +1 -7
- package/libs/api/biz/util/disableScreenCapture.js +1 -7
- package/libs/api/biz/util/downloadFile.js +1 -7
- package/libs/api/biz/util/entergroupCheck.js +1 -7
- package/libs/api/biz/util/externalLinkPreviewFile.js +1 -7
- package/libs/api/biz/util/feedback.js +1 -7
- package/libs/api/biz/util/getSingleWebviewData.js +1 -7
- package/libs/api/biz/util/getTogetherConfig.js +1 -7
- package/libs/api/biz/util/getToken.js +1 -7
- package/libs/api/biz/util/injectScript.js +1 -7
- package/libs/api/biz/util/invoice.js +2 -7
- package/libs/api/biz/util/knowledgeBaseSelect.js +10 -8
- package/libs/api/biz/util/knowledgeSelectParams.d.ts +12 -0
- package/libs/api/biz/util/knowledgeSelectParams.js +26 -0
- package/libs/api/biz/util/mediaFileUpload.js +2 -7
- package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +1 -7
- package/libs/api/biz/util/open.js +1 -7
- package/libs/api/biz/util/openFutureGroup.js +1 -7
- package/libs/api/biz/util/openLink.js +1 -7
- package/libs/api/biz/util/openMediaFileDialog.js +2 -7
- package/libs/api/biz/util/openSingleWebview.js +1 -7
- package/libs/api/biz/util/openSlidePanel.js +1 -7
- package/libs/api/biz/util/openTalYoungToTopic.js +2 -7
- package/libs/api/biz/util/openTogetherEyeWebview.js +1 -7
- package/libs/api/biz/util/openUserSchedule.js +1 -7
- package/libs/api/biz/util/openVideoPlayer.js +1 -7
- package/libs/api/biz/util/previewFile.js +1 -7
- package/libs/api/biz/util/previewImage.js +1 -7
- package/libs/api/biz/util/proxy.js +1 -7
- package/libs/api/biz/util/pushWorkMsg.js +2 -7
- package/libs/api/biz/util/remind.js +1 -7
- package/libs/api/biz/util/resetSessionUnread.js +1 -7
- package/libs/api/biz/util/rouseApp.js +2 -7
- package/libs/api/biz/util/savePic.js +1 -7
- package/libs/api/biz/util/scan.js +1 -7
- package/libs/api/biz/util/screen.js +1 -7
- package/libs/api/biz/util/selectDepartment.js +1 -7
- package/libs/api/biz/util/share.js +1 -7
- package/libs/api/biz/util/takePicture.js +1 -7
- package/libs/api/biz/util/topicEvent.js +1 -7
- package/libs/api/biz/util/uploadAttachment.js +1 -7
- package/libs/api/biz/util/weeklyRead.js +1 -7
- package/libs/api/biz/util/yachEvent.js +1 -7
- package/libs/api/biz/util/zfbAuth.js +1 -7
- package/libs/api/biz/webViewMessage/send.js +1 -7
- package/libs/api/device/audio/download.js +1 -7
- package/libs/api/device/audio/onPlayEnd.js +1 -7
- package/libs/api/device/audio/onRecordEnd.js +1 -7
- package/libs/api/device/audio/onRecordEnd_v2.js +1 -7
- package/libs/api/device/audio/pause.js +1 -7
- package/libs/api/device/audio/play.js +1 -7
- package/libs/api/device/audio/resume.js +1 -7
- package/libs/api/device/audio/startRecord.js +1 -7
- package/libs/api/device/audio/startRecord_v2.js +1 -7
- package/libs/api/device/audio/stop.js +1 -7
- package/libs/api/device/audio/stopRecord.js +1 -7
- package/libs/api/device/audio/stopRecord_v2.js +1 -7
- package/libs/api/device/base/checkStepPermission.js +1 -7
- package/libs/api/device/base/getPhoneInfo.js +1 -7
- package/libs/api/device/base/getUUID.js +1 -7
- package/libs/api/device/connection/getNetworkType.js +1 -7
- package/libs/api/device/connection/isAtTal.js +3 -9
- package/libs/api/device/geolocation/get.js +1 -7
- package/libs/api/device/geolocation/getSwitch.js +1 -7
- package/libs/api/device/notification/actionSheet.js +1 -7
- package/libs/api/device/notification/alert.js +1 -7
- package/libs/api/device/notification/confirm.js +1 -7
- package/libs/api/device/notification/hidePreloader.js +2 -10
- package/libs/api/device/notification/showPreloader.js +2 -10
- package/libs/api/device/notification/toast.js +1 -7
- package/libs/api/device/notification/vibrate.js +1 -7
- package/libs/api/device/system/getLang.js +1 -7
- package/libs/api/device/system/setLight.js +1 -7
- package/libs/api/initAPI.js +4 -13
- package/libs/api/primary/createTab.js +1 -7
- package/libs/api/primary/exitFullScreen.js +1 -7
- package/libs/api/primary/fullScreen.js +1 -7
- package/libs/api/primary/weeklyShare.js +1 -7
- package/libs/api/runtime/permission/requestAuthCode.js +1 -7
- package/libs/api/ui/pullToRefresh/disable.js +1 -7
- package/libs/api/ui/pullToRefresh/enable.js +1 -7
- package/libs/api/ui/pullToRefresh/stop.js +1 -7
- package/libs/api/ui/webViewBounce/disable.js +1 -7
- package/libs/api/util/domainStorage/getItem.js +1 -7
- package/libs/api/util/domainStorage/removeItem.js +1 -7
- package/libs/api/util/domainStorage/setItem.js +1 -7
- package/libs/api/util/tool/flushLog.js +1 -7
- package/libs/api/util/tool/log.js +1 -7
- package/libs/index.d.ts +3 -1
- package/libs/index.js +280 -527
- package/libs/lib/bridge/index.js +6 -13
- package/libs/lib/bridge/mobile.js +16 -50
- package/libs/lib/bridge/pc.js +16 -37
- package/libs/lib/helper/apiHelper.js +1 -7
- package/libs/lib/helper/codeMap.js +1 -7
- package/libs/lib/helper/event.js +8 -28
- package/libs/lib/helper/pcIframe.js +20 -58
- package/libs/lib/index.js +10 -34
- package/libs/lib/sdk/index.js +18 -49
- package/libs/lib/sdk/sdk.typings.js +0 -4
- package/libs/utils/bpitLog.js +4 -16
- package/libs/utils/compareVersions.js +32 -77
- package/libs/utils/console.js +2 -18
- package/libs/utils/env.js +12 -21
- package/libs/utils/index.js +8 -21
- package/package.json +1 -1
- package/dist/yach_jssdk_4.4.3.js +0 -1
package/es/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { yachSdk } from './lib';
|
|
2
2
|
/*biz*****************************/
|
|
3
|
-
|
|
4
3
|
/**util*/
|
|
5
|
-
|
|
6
4
|
import { openLink } from './api/biz/util/openLink';
|
|
7
5
|
import { feedback } from './api/biz/util/feedback';
|
|
8
6
|
import { open } from './api/biz/util/open';
|
|
@@ -55,8 +53,8 @@ import { weeklyRead } from './api/biz/util/weeklyRead';
|
|
|
55
53
|
import { disableScreenCapture } from './api/biz/util/disableScreenCapture';
|
|
56
54
|
import { openFutureGroup } from './api/biz/util/openFutureGroup';
|
|
57
55
|
import { knowledgeBaseSelect } from './api/biz/util/knowledgeBaseSelect';
|
|
56
|
+
import { knowledgeSelectParams } from './api/biz/util/knowledgeSelectParams';
|
|
58
57
|
/**navigation*/
|
|
59
|
-
|
|
60
58
|
import { setIcon } from './api/biz/navigation/setIcon';
|
|
61
59
|
import { setTitle } from './api/biz/navigation/setTitle';
|
|
62
60
|
import { setMenu } from './api/biz/navigation/setMenu';
|
|
@@ -73,14 +71,11 @@ import { tencentMeeting } from './api/biz/navigation/tencentMeeting';
|
|
|
73
71
|
import { tencentMeetingBegin } from './api/biz/navigation/tencentMeetingBegin';
|
|
74
72
|
import { setPanGestureEnable } from './api/biz/navigation/setPanGestureEnable';
|
|
75
73
|
/**contact*/
|
|
76
|
-
|
|
77
74
|
import { complexPicker } from './api/biz/contact/complexPicker';
|
|
78
75
|
import { departmentsPicker } from './api/biz/contact/departmentsPicker';
|
|
79
76
|
/** group*/
|
|
80
|
-
|
|
81
77
|
import { groupComplexPicker } from './api/biz/group/groupComplexPicker';
|
|
82
78
|
/** chat*/
|
|
83
|
-
|
|
84
79
|
import { chooseConversationByCorpId } from './api/biz/chat/chooseConversationByCorpId';
|
|
85
80
|
import { pickConversation } from './api/biz/chat/pickConversation';
|
|
86
81
|
import { openSingleChat } from './api/biz/chat/openSingleChat';
|
|
@@ -88,16 +83,13 @@ import { openTeamChat } from './api/biz/chat/openTeamChat';
|
|
|
88
83
|
import { openSquad } from './api/biz/chat/openSquad';
|
|
89
84
|
import { sendP2PMsg } from './api/biz/chat/sendP2PMsg';
|
|
90
85
|
/* primary*****************************/
|
|
91
|
-
|
|
92
86
|
import { createTab } from './api/primary/createTab';
|
|
93
87
|
import { weeklyShare } from './api/primary/weeklyShare';
|
|
94
88
|
import { fullScreen } from './api/primary/fullScreen';
|
|
95
89
|
import { exitFullScreen } from './api/primary/exitFullScreen';
|
|
96
90
|
/* runtime*****************************/
|
|
97
|
-
|
|
98
91
|
import { requestAuthCode } from './api/runtime/permission/requestAuthCode';
|
|
99
92
|
/** device */
|
|
100
|
-
|
|
101
93
|
import { showPreloader, showCustomOverlayContent } from './api/device/notification/showPreloader';
|
|
102
94
|
import { hidePreloader, hideCustomOverlayContent } from './api/device/notification/hidePreloader';
|
|
103
95
|
import { vibrate } from './api/device/notification/vibrate';
|
|
@@ -127,40 +119,38 @@ import { startRecord_v2 } from './api/device/audio/startRecord_v2';
|
|
|
127
119
|
import { stopRecord_v2 } from './api/device/audio/stopRecord_v2';
|
|
128
120
|
import { setLight } from './api/device/system/setLight';
|
|
129
121
|
/** telephone */
|
|
130
|
-
|
|
131
122
|
import { showCallMenu } from './api/biz/telephone/showCallMenu';
|
|
132
123
|
import { call } from './api/biz/telephone/call';
|
|
133
124
|
/** ui */
|
|
134
|
-
|
|
135
125
|
import { disable as webViewBounceDisable } from './api/ui/webViewBounce/disable';
|
|
136
126
|
import { enable as pullToRefreshEnable } from './api/ui/pullToRefresh/enable';
|
|
137
127
|
import { stop as pullToRefreshStop } from './api/ui/pullToRefresh/stop';
|
|
138
|
-
import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable';
|
|
139
|
-
|
|
128
|
+
import { disable as pullToRefreshDisable } from './api/ui/pullToRefresh/disable';
|
|
129
|
+
// demainStorage
|
|
140
130
|
import { getItem } from './api/util/domainStorage/getItem';
|
|
141
131
|
import { setItem } from './api/util/domainStorage/setItem';
|
|
142
|
-
import { removeItem } from './api/util/domainStorage/removeItem';
|
|
143
|
-
|
|
132
|
+
import { removeItem } from './api/util/domainStorage/removeItem';
|
|
133
|
+
// log
|
|
144
134
|
import { writeLog } from './api/util/tool/log';
|
|
145
|
-
import { flushLog } from './api/util/tool/flushLog';
|
|
146
|
-
|
|
135
|
+
import { flushLog } from './api/util/tool/flushLog';
|
|
136
|
+
// screen
|
|
147
137
|
import { capturePage } from './api/biz/util/screen';
|
|
148
138
|
import { send as webViewMessageSend } from './api/biz/webViewMessage/send';
|
|
149
139
|
import { talYoungFilesUpload } from './api/app/custom/talYoungFilesUpload';
|
|
150
140
|
import { addAppToNav } from './api/biz/util/addAppToNav';
|
|
151
141
|
console.log('add rouseApp ------------>', rouseApp);
|
|
152
142
|
var _yachSdk$exportSdk = yachSdk.exportSdk,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, capturePage };
|
|
143
|
+
version = _yachSdk$exportSdk.version,
|
|
144
|
+
sdkVersion = _yachSdk$exportSdk.sdkVersion,
|
|
145
|
+
env = _yachSdk$exportSdk.env,
|
|
146
|
+
platform = _yachSdk$exportSdk.platform,
|
|
147
|
+
platformV2 = _yachSdk$exportSdk.platformV2,
|
|
148
|
+
config = _yachSdk$exportSdk.config,
|
|
149
|
+
ready = _yachSdk$exportSdk.ready,
|
|
150
|
+
error = _yachSdk$exportSdk.error,
|
|
151
|
+
on = _yachSdk$exportSdk.on,
|
|
152
|
+
off = _yachSdk$exportSdk.off;
|
|
153
|
+
export { version, sdkVersion, env, platform, platformV2, config, ready, error, on, off, openLink, feedback, open, openSlidePanel, share, previewFile, previewImage, downloadFile, uploadAttachment, clipboardFileUpload, proxy, datepicker, scan, chosen, openSingleWebview, getSingleWebviewData, injectScript, closeWindow, showCallMenu, call, setIcon, setTitle, setMenu, close, replacePage, quit, setRight, setTitleExpandIcon, updateExpandTitle, setLeft, goBack, complexPicker, departmentsPicker, groupComplexPicker, chooseConversationByCorpId, pickConversation, openSingleChat, openTeamChat, openSquad, sendP2PMsg, mapView, multipointView, requestAuthCode, createTab, weeklyShare, fullScreen, exitFullScreen, showPreloader, showCustomOverlayContent, hidePreloader, hideCustomOverlayContent, vibrate, toast, alert, confirm, getPhoneInfo, getUUID, checkStepPermission, getGeolocation, getGeolocationSwitch, getLang, startRecord, stopRecord, onRecordEnd, downloadAudio, playAudio, pauseAudio, stopAudio, onPlayEnd, resumeAudio, getNetworkType, isAtTal, webViewBounceDisable, pullToRefreshEnable, pullToRefreshStop, pullToRefreshDisable, getItem, setItem, removeItem, writeLog, flushLog, remind, takePicture, datetimepicker, actionSheet, webViewMessageSend, talYoungFilesUpload, openVideoPlayer, openMediaFileDialog, mediaFileUpload, invoice, pushWorkMsg, openTalYoungToTopic, getToken, authStart, authFinish, assistantCreate, yachEvent, topicEvent, openTogetherEyeWebview, getTogetherConfig, rouseApp, externalLinkPreviewFile, savePic, zfbAuth, complain, onRecordEnd_v2, startRecord_v2, stopRecord_v2, selectDepartment, setWindowBig, tencentMeeting, tencentMeetingBegin, createModifySchedule, onlineDocmentOpenTeamChat, entergroupCheck, resetSessionUnread, weeklyRead, openFutureGroup, knowledgeBaseSelect, knowledgeSelectParams, setLight, openUserSchedule, disableScreenCapture, setPanGestureEnable, addAppToNav, capturePage };
|
|
164
154
|
export default {
|
|
165
155
|
version: version,
|
|
166
156
|
sdkVersion: sdkVersion,
|
|
@@ -225,6 +215,7 @@ export default {
|
|
|
225
215
|
disableScreenCapture: disableScreenCapture,
|
|
226
216
|
addAppToNav: addAppToNav,
|
|
227
217
|
knowledgeBaseSelect: knowledgeBaseSelect,
|
|
218
|
+
knowledgeSelectParams: knowledgeSelectParams,
|
|
228
219
|
capturePage: capturePage
|
|
229
220
|
},
|
|
230
221
|
telephone: {
|
package/es/lib/bridge/mobile.js
CHANGED
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
2
|
-
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
3
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
4
|
-
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
5
1
|
import _setTimeout from "@babel/runtime-corejs3/core-js/set-timeout";
|
|
2
|
+
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
3
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
4
|
+
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
5
|
+
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
6
6
|
import Event from '../helper/event';
|
|
7
7
|
import { electronResCodeMap } from '../helper/codeMap';
|
|
8
8
|
import { log, bpitLog } from '../../utils';
|
|
9
|
-
|
|
10
9
|
function setupWebViewJavascriptBridge(callback) {
|
|
11
10
|
if (window.WebViewJavascriptBridge) {
|
|
12
11
|
return callback(WebViewJavascriptBridge);
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
if (window.WKWebViewJavascriptBridge) {
|
|
16
14
|
return callback(WKWebViewJavascriptBridge);
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
if (window.WVJBCallbacks) {
|
|
20
17
|
return window.WVJBCallbacks.push(callback);
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
window.WVJBCallbacks = [callback];
|
|
24
20
|
var WVJBIframe = document.createElement('iframe');
|
|
25
21
|
WVJBIframe.style.display = 'none';
|
|
26
22
|
WVJBIframe.src = 'https://__bridge_loaded__';
|
|
27
23
|
document.documentElement.appendChild(WVJBIframe);
|
|
28
|
-
|
|
29
24
|
_setTimeout(function () {
|
|
30
25
|
document.documentElement.removeChild(WVJBIframe);
|
|
31
26
|
}, 0);
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
var mobileBridgeInit = function mobileBridgeInit() {
|
|
35
29
|
return new _Promise(function (resolve, reject) {
|
|
36
30
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
@@ -77,17 +71,14 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
77
71
|
});
|
|
78
72
|
});
|
|
79
73
|
};
|
|
80
|
-
|
|
81
74
|
var mobileBridge = function mobileBridge(method, param) {
|
|
82
75
|
return new _Promise(function (resolve, reject) {
|
|
83
76
|
var p = _Object$assign({}, param);
|
|
84
|
-
|
|
85
77
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
86
78
|
if (param.control) {
|
|
87
79
|
bridge.registerHandler(method, function (data) {
|
|
88
80
|
var onSuccess = param.onSuccess;
|
|
89
81
|
delete p.onSuccess;
|
|
90
|
-
|
|
91
82
|
if ('function' === typeof onSuccess) {
|
|
92
83
|
onSuccess(data);
|
|
93
84
|
resolve({
|
|
@@ -97,14 +88,11 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
97
88
|
}
|
|
98
89
|
});
|
|
99
90
|
}
|
|
100
|
-
|
|
101
91
|
bridge.callHandler(method, param, function (e) {
|
|
102
92
|
var code = e.code,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
message = e.message,
|
|
94
|
+
data = e.data;
|
|
106
95
|
var _code = _parseInt(code);
|
|
107
|
-
|
|
108
96
|
var callbackStr = electronResCodeMap(_code);
|
|
109
97
|
var callbackFun = p[callbackStr];
|
|
110
98
|
log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
@@ -114,40 +102,37 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
114
102
|
_code: _code,
|
|
115
103
|
message: message,
|
|
116
104
|
callbackFun: callbackFun
|
|
117
|
-
});
|
|
118
|
-
|
|
105
|
+
});
|
|
106
|
+
// 请求失败
|
|
119
107
|
if (callbackStr === 'onFail') {
|
|
120
108
|
bpitLog({
|
|
121
109
|
method: method,
|
|
122
110
|
errorcode: _code,
|
|
123
111
|
message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
|
|
124
112
|
});
|
|
125
|
-
|
|
126
113
|
if ('function' === typeof callbackFun) {
|
|
127
114
|
message ? callbackFun({
|
|
128
115
|
code: code,
|
|
129
116
|
message: message
|
|
130
117
|
}) : callbackFun(data);
|
|
131
118
|
}
|
|
132
|
-
|
|
133
119
|
reject({
|
|
134
120
|
_code: _code,
|
|
135
121
|
message: message,
|
|
136
122
|
data: data
|
|
137
123
|
});
|
|
138
124
|
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
125
|
+
}
|
|
126
|
+
// 请求成功
|
|
142
127
|
if ('function' === typeof callbackFun) {
|
|
143
128
|
callbackFun(data || message);
|
|
144
129
|
}
|
|
145
|
-
|
|
146
130
|
resolve({
|
|
147
131
|
_code: _code,
|
|
148
132
|
message: message,
|
|
149
133
|
data: data
|
|
150
|
-
});
|
|
134
|
+
});
|
|
135
|
+
// if (_code === -2 || _code === 7) {
|
|
151
136
|
// bpitLog({
|
|
152
137
|
// method,
|
|
153
138
|
// errorcode: _code,
|
|
@@ -180,5 +165,4 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
180
165
|
});
|
|
181
166
|
});
|
|
182
167
|
};
|
|
183
|
-
|
|
184
168
|
export { mobileBridge, mobileBridgeInit };
|
package/es/lib/bridge/pc.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
2
|
-
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
3
|
-
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
4
1
|
import _Promise from "@babel/runtime-corejs3/core-js/promise";
|
|
2
|
+
import _parseInt from "@babel/runtime-corejs3/core-js/parse-int";
|
|
3
|
+
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
4
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
5
5
|
import PcIframe from '../helper/pcIframe';
|
|
6
6
|
import { electronResCodeMap } from '../helper/codeMap';
|
|
7
7
|
import { log, bpitLog } from '../../utils';
|
|
8
|
-
|
|
9
8
|
var PcBridgeInit = function PcBridgeInit() {
|
|
10
9
|
PcIframe.init();
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
var pcBridge = function pcBridge(method, param) {
|
|
14
12
|
return new _Promise(function (resolve, reject) {
|
|
15
13
|
return PcIframe.invokeAPI(method, param, function (_ref) {
|
|
16
14
|
var data = _ref.data,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
code = _ref.code,
|
|
16
|
+
message = _ref.message;
|
|
20
17
|
var _code = _parseInt(code);
|
|
21
|
-
|
|
22
18
|
var callbackStr = electronResCodeMap(_code);
|
|
23
19
|
var callbackFun = param[callbackStr];
|
|
24
20
|
log("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
@@ -28,15 +24,14 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
28
24
|
_code: _code,
|
|
29
25
|
message: message,
|
|
30
26
|
callbackFun: callbackFun
|
|
31
|
-
});
|
|
32
|
-
|
|
27
|
+
});
|
|
28
|
+
// 请求失败
|
|
33
29
|
if (callbackStr === 'onFail') {
|
|
34
30
|
bpitLog({
|
|
35
31
|
method: method,
|
|
36
32
|
errorcode: _code,
|
|
37
33
|
message: message || _JSON$stringify(data) || 'SDK执行失败回调,相关参数'
|
|
38
34
|
});
|
|
39
|
-
|
|
40
35
|
if ('function' === typeof callbackFun) {
|
|
41
36
|
console.log('wenai-code', code, _code);
|
|
42
37
|
var callbackData = Object.prototype.toString.call(data) === "[object Object]" ? _Object$assign(_Object$assign({}, data), {
|
|
@@ -49,25 +44,23 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
49
44
|
};
|
|
50
45
|
message ? callbackFun(callbackData) : callbackFun(data);
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
reject({
|
|
54
48
|
_code: _code,
|
|
55
49
|
message: message,
|
|
56
50
|
data: data
|
|
57
51
|
});
|
|
58
52
|
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
}
|
|
54
|
+
// 请求成功
|
|
62
55
|
if ('function' === typeof callbackFun) {
|
|
63
56
|
callbackFun(data || message);
|
|
64
57
|
}
|
|
65
|
-
|
|
66
58
|
resolve({
|
|
67
59
|
_code: _code,
|
|
68
60
|
message: message,
|
|
69
61
|
data: data
|
|
70
|
-
});
|
|
62
|
+
});
|
|
63
|
+
// if (_code === -2) {
|
|
71
64
|
// bpitLog({
|
|
72
65
|
// method,
|
|
73
66
|
// errorcode: _code,
|
|
@@ -90,5 +83,4 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
90
83
|
});
|
|
91
84
|
});
|
|
92
85
|
};
|
|
93
|
-
|
|
94
86
|
export { pcBridge, PcBridgeInit };
|
package/es/lib/helper/codeMap.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _Map from "@babel/runtime-corejs3/core-js/map";
|
|
2
2
|
var resCodeMap = new _Map([[0, 'onSuccess'], [-1, 'onCancel'], [-2, 'onFail'], [-3, 'onProgress'], [-4, 'onSubmit']]);
|
|
3
|
-
|
|
4
3
|
function electronResCodeMap(code) {
|
|
5
4
|
return resCodeMap.get(code) || 'onFail';
|
|
6
5
|
}
|
|
7
|
-
|
|
8
6
|
export { electronResCodeMap };
|
package/es/lib/helper/event.js
CHANGED
|
@@ -1,41 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
3
|
-
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
4
|
-
import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
|
|
1
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
2
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import _Array$isArray from "@babel/runtime-corejs3/core-js/array/is-array";
|
|
4
|
+
import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js/instance/index-of";
|
|
5
|
+
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
6
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js/instance/for-each";
|
|
7
|
+
var Event = /*#__PURE__*/_createClass(function Event() {
|
|
8
8
|
var _this = this;
|
|
9
|
-
|
|
10
9
|
_classCallCheck(this, Event);
|
|
11
|
-
|
|
12
10
|
this.on = function (event, fn) {
|
|
13
11
|
if (!event || 'function' !== typeof fn) throw 'eventName is null or handle is not a function, on fail';
|
|
14
12
|
if (!_Array$isArray(_this.eventsHandle[event])) _this.eventsHandle[event] = [];
|
|
15
|
-
|
|
16
13
|
_this.eventsHandle[event].push(fn);
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
this.off = function (event, fn) {
|
|
20
16
|
if (!event) throw 'eventName is null, invoke off fail';
|
|
21
|
-
|
|
22
17
|
if (!fn) {
|
|
23
18
|
_this.eventsHandle[event] = [];
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
if (_Array$isArray(_this.eventsHandle[event])) {
|
|
28
22
|
var _context, _context2;
|
|
29
|
-
|
|
30
23
|
var n = _indexOfInstanceProperty(_context = _this.eventsHandle[event]).call(_context, fn);
|
|
31
|
-
|
|
32
24
|
-1 !== n && _spliceInstanceProperty(_context2 = _this.eventsHandle[event]).call(_context2, n, 1);
|
|
33
25
|
}
|
|
34
26
|
};
|
|
35
|
-
|
|
36
27
|
this.execEvent = function (event, data) {
|
|
37
28
|
var _context3;
|
|
38
|
-
|
|
39
29
|
_Array$isArray(this.eventsHandle[event]) && _forEachInstanceProperty(_context3 = this.eventsHandle[event]).call(_context3, function (fn) {
|
|
40
30
|
try {
|
|
41
31
|
fn(data);
|
|
@@ -44,9 +34,7 @@ var Event = function Event() {
|
|
|
44
34
|
}
|
|
45
35
|
});
|
|
46
36
|
};
|
|
47
|
-
|
|
48
37
|
this.eventsHandle = {};
|
|
49
|
-
};
|
|
50
|
-
|
|
38
|
+
});
|
|
51
39
|
var event = new Event();
|
|
52
40
|
export default event;
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
1
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
3
2
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
|
+
import _Date$now from "@babel/runtime-corejs3/core-js/date/now";
|
|
4
|
+
import _JSON$stringify from "@babel/runtime-corejs3/core-js/json/stringify";
|
|
4
5
|
import { log } from '../../utils';
|
|
5
|
-
import Event from './event';
|
|
6
|
-
|
|
7
|
-
var GenPostMsg = function GenPostMsg(method, param, callback) {
|
|
6
|
+
import Event from './event';
|
|
7
|
+
// 处理posmessage参数
|
|
8
|
+
var GenPostMsg = /*#__PURE__*/_createClass(function GenPostMsg(method, param, callback) {
|
|
8
9
|
var _this = this;
|
|
9
|
-
|
|
10
10
|
_classCallCheck(this, GenPostMsg);
|
|
11
|
-
|
|
12
11
|
this.genid = function () {
|
|
13
12
|
var idStr = _Date$now().toString(36);
|
|
14
|
-
|
|
15
13
|
idStr += Math.random().toString(36).substr(3);
|
|
16
14
|
return idStr;
|
|
17
15
|
};
|
|
18
|
-
|
|
19
16
|
this.receiveResponse = function (data) {
|
|
20
17
|
//this.PromiseObj.resolve(data);
|
|
21
18
|
_this.callback(data);
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
this.getPayload = function () {
|
|
25
21
|
return {
|
|
26
22
|
msgId: _this.id,
|
|
@@ -30,7 +26,6 @@ var GenPostMsg = function GenPostMsg(method, param, callback) {
|
|
|
30
26
|
invokeType: _this.invokeType
|
|
31
27
|
};
|
|
32
28
|
};
|
|
33
|
-
|
|
34
29
|
this.id = this.genid();
|
|
35
30
|
this.PromiseObj = {
|
|
36
31
|
resolve: null,
|
|
@@ -39,7 +34,8 @@ var GenPostMsg = function GenPostMsg(method, param, callback) {
|
|
|
39
34
|
this.methodName = method;
|
|
40
35
|
this.plainMsg = param;
|
|
41
36
|
this.invokeType = param === null || param === void 0 ? void 0 : param.invokeType;
|
|
42
|
-
this.callback = callback;
|
|
37
|
+
this.callback = callback;
|
|
38
|
+
// this.result = new Promise(
|
|
43
39
|
// function (resolve, reject) {
|
|
44
40
|
// this.PromiseObj = {
|
|
45
41
|
// resolve,
|
|
@@ -47,81 +43,62 @@ var GenPostMsg = function GenPostMsg(method, param, callback) {
|
|
|
47
43
|
// };
|
|
48
44
|
// }.bind(this)
|
|
49
45
|
// );
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var Frame = function Frame() {
|
|
46
|
+
});
|
|
47
|
+
var Frame = /*#__PURE__*/_createClass(function Frame() {
|
|
53
48
|
var _this2 = this;
|
|
54
|
-
|
|
55
49
|
_classCallCheck(this, Frame);
|
|
56
|
-
|
|
57
50
|
this.addPending = function (e) {
|
|
58
51
|
_this2.pendingMsgs[e.id] = e;
|
|
59
52
|
};
|
|
60
|
-
|
|
61
53
|
this.deletePending = function (e) {
|
|
62
54
|
delete _this2.pendingMsgs[e.id];
|
|
63
55
|
};
|
|
64
|
-
|
|
65
56
|
this.getPending = function (t) {
|
|
66
57
|
return this.pendingMsgs[t];
|
|
67
58
|
};
|
|
68
|
-
|
|
69
59
|
this.invokeAPIInBrowserView = function (payload) {
|
|
70
60
|
window.sendTo(payload);
|
|
71
61
|
};
|
|
72
|
-
|
|
73
62
|
this.invokeAPIInWebview = function (payload) {
|
|
74
63
|
window.sendToHost(payload);
|
|
75
64
|
};
|
|
76
|
-
|
|
77
65
|
this.invokeAPI = function (method, param, callback) {
|
|
78
66
|
var genPostMsg = new GenPostMsg(method, param, callback);
|
|
79
|
-
|
|
80
67
|
var payload = _JSON$stringify(genPostMsg.getPayload());
|
|
81
|
-
|
|
82
68
|
var _param$invokeType = param.invokeType,
|
|
83
|
-
|
|
69
|
+
invokeType = _param$invokeType === void 0 ? '' : _param$invokeType;
|
|
84
70
|
invokeType === 'browserView' ? _this2.invokeAPIInBrowserView(payload) : _this2.invokeAPIInWebview(payload);
|
|
85
|
-
|
|
86
71
|
_this2.addPending(genPostMsg);
|
|
87
|
-
|
|
88
72
|
return genPostMsg;
|
|
89
73
|
};
|
|
90
|
-
|
|
91
74
|
this.handleCallback = function (datas, invokeType) {
|
|
92
75
|
var type = datas.type,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
76
|
+
methodName = datas.methodName,
|
|
77
|
+
eventName = datas.eventName,
|
|
78
|
+
msgId = datas.msgId,
|
|
79
|
+
_datas$data = datas.data,
|
|
80
|
+
data = _datas$data === void 0 ? {} : _datas$data,
|
|
81
|
+
code = datas.code,
|
|
82
|
+
message = datas.message,
|
|
83
|
+
msg = datas.msg;
|
|
102
84
|
if (type === 'request') {
|
|
103
85
|
// 壳子的调用
|
|
104
86
|
switch (methodName) {
|
|
105
87
|
case 'refresh':
|
|
106
88
|
window.location.reload();
|
|
107
89
|
break;
|
|
108
|
-
|
|
109
90
|
case 'back':
|
|
110
91
|
window.history.back();
|
|
111
92
|
break;
|
|
112
|
-
|
|
113
93
|
case 'forward':
|
|
114
94
|
window.history.forward();
|
|
115
95
|
break;
|
|
116
|
-
|
|
117
96
|
case 'event':
|
|
118
97
|
Event.execEvent(eventName, data);
|
|
119
98
|
break;
|
|
120
|
-
|
|
121
99
|
case 'zoomInClick':
|
|
122
100
|
var scrollTopVal = document.documentElement.scrollTop || document.body.scrollTop,
|
|
123
|
-
|
|
124
|
-
|
|
101
|
+
url = window.location.href;
|
|
125
102
|
if (invokeType === 'browserView') {
|
|
126
103
|
window.sendTo(_JSON$stringify({
|
|
127
104
|
type: type,
|
|
@@ -143,16 +120,13 @@ var Frame = function Frame() {
|
|
|
143
120
|
}
|
|
144
121
|
}));
|
|
145
122
|
}
|
|
146
|
-
|
|
147
123
|
break;
|
|
148
|
-
|
|
149
124
|
default:
|
|
150
125
|
break;
|
|
151
126
|
}
|
|
152
127
|
} else if (type === 'response') {
|
|
153
128
|
// 响应壳子的回调
|
|
154
129
|
var pending = _this2.getPending(msgId);
|
|
155
|
-
|
|
156
130
|
pending && pending.receiveResponse({
|
|
157
131
|
data: data,
|
|
158
132
|
code: code,
|
|
@@ -161,20 +135,16 @@ var Frame = function Frame() {
|
|
|
161
135
|
code != -3 && _this2.deletePending(msgId);
|
|
162
136
|
}
|
|
163
137
|
};
|
|
164
|
-
|
|
165
138
|
this.init = function () {
|
|
166
139
|
window.addEventListener('message', function (msg) {
|
|
167
140
|
log('electron res: ', msg);
|
|
168
|
-
|
|
169
141
|
_this2.handleCallback(msg.data || {});
|
|
170
142
|
});
|
|
171
143
|
window.receiveBrowserViewData && window.receiveBrowserViewData(function (e, response) {
|
|
172
144
|
return _this2.handleCallback(response);
|
|
173
145
|
});
|
|
174
146
|
};
|
|
175
|
-
|
|
176
147
|
this.pendingMsgs = {};
|
|
177
|
-
};
|
|
178
|
-
|
|
148
|
+
});
|
|
179
149
|
var frame = new Frame();
|
|
180
150
|
export default frame;
|