vite-uni-dev-tool 1.2.2 → 1.2.3
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/core.js +1 -1
- package/dist/type.d.ts +0 -2
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolData.ts +0 -2
- package/dist/v3/DevTool/components/DevToolWindow/hooks/useDevToolHandlers.ts +0 -13
- package/dist/v3/DevTool/components/DevToolWindow/index.vue +3 -15
- package/dist/v3/DevTool/components/NetworkList/NetworkIntercept.vue +1 -1
- package/dist/v3/DevTool/components/SourceCode/Line.vue +1 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DevStore as f}from"./modules/devStore/index.js";import{DevEvent as v}from"./modules/devEvent/index.js";import{DevIntercept as p}from"./modules/devIntercept/index.js";import{DevConsole as s}from"./modules/devConsole/index.js";import{getPlatform as T}from"./utils/utils.js";import"./utils/index.js";import{consoleProxy as d,setDevConsole as l}from"./core-shared.js";import{backup as H}from"./core-shared.js";import{i18n as D}from"./i18n/instance.js";import{sleep as g}from"./utils/date.js";const i=e=>D.t(e),c="1.2.
|
|
1
|
+
import{DevStore as f}from"./modules/devStore/index.js";import{DevEvent as v}from"./modules/devEvent/index.js";import{DevIntercept as p}from"./modules/devIntercept/index.js";import{DevConsole as s}from"./modules/devConsole/index.js";import{getPlatform as T}from"./utils/utils.js";import"./utils/index.js";import{consoleProxy as d,setDevConsole as l}from"./core-shared.js";import{backup as H}from"./core-shared.js";import{i18n as D}from"./i18n/instance.js";import{sleep as g}from"./utils/date.js";const i=e=>D.t(e),c="1.2.3",u="2026/3/10 15:43:22",m="https://gitee.com/cloud_l/vite-uni-dev-tool",r=new f,t=new v({store:r}),_={getDevToolDestroy:()=>t.getDevToolDestroy(),getDevToolOptions:()=>t.getDevToolOptions(),getRequestIndex:()=>t.getRequestIndex(),setRequestIndex:e=>t.setRequestIndex(e),getTransferIndex:()=>r.getTransferIndex(),setTransferIndex:e=>r.setTransferIndex(e),getScreenIndex:()=>r.getScreenIndex(),setScreenIndex:e=>r.setScreenIndex(e),getInterceptNetworkMap:()=>t.getInterceptNetworkMap(),updateConsole:e=>t.updateConsoleList(e),updateNetwork:(e,o)=>t.updateNetworkList(e,o),updateWs:e=>t.updateWsList(e),addWsTask:(e,o)=>t.addWsTask(e,o),removeWsTask:e=>t.removeWsTask(e),updateStorage:e=>t.updateStorage(e),updateTransfer:(e,o)=>t.updateTransfer(e,o),updateUniEvent:e=>t.updateUniEvent(e),updateScreen:(e,o)=>t.updateScreen(e,o),updateScanCode:e=>t.updateScanCode(e),updateNfc:e=>t.updateNfc(e),updateBluetooth:e=>t.updateBluetooth(e),updateRoute:e=>t.updateRouteList(e),updateUniEventCount:e=>t.updateUniEventCount(e),addTransferTask:(e,o)=>t.addTransferTask(e,o),removeTransferTask:e=>t.removeTransferTask(e),clearStorage:()=>t.clearStorage(!1),removeStorage:e=>t.removeStorage(e,!1),closeWindow:()=>t.closeDevToolWindow(),setVuexList:e=>t.setVuexList(e),setVueStore:e=>t.setVueStore(e),setPiniaList:e=>t.setPiniaList(e),setPiniaStore:e=>t.setPiniaStore(e)},n=new p({hooks:_});let a;t.setIntercept(n);function S(){if(typeof uni>"u")return;const e=T();try{const o=Object.getOwnPropertyDescriptor(uni,"__dev_tool_platform__");if(o&&o.configurable===!1)return;Object.defineProperty(uni,"__dev_tool_platform__",{value:e,configurable:!0})}catch{}}function y(e){if(!(typeof uni>"u"))try{const o=Object.getOwnPropertyDescriptor(uni,"__dev_tool_scan_code_collection__");if(o&&o.configurable===!1)return;Object.defineProperty(uni,"__dev_tool_scan_code_collection__",{value:e.devToolScanCode.bind(e),configurable:!0})}catch{}}function b(e){if(!(typeof uni>"u"))try{const o=Object.getOwnPropertyDescriptor(uni,"__dev_tool_nfc_collection__");if(o&&o.configurable===!1)return;Object.defineProperty(uni,"__dev_tool_nfc_collection__",{value:e.devToolNFC.bind(e),configurable:!0})}catch{}}function L(){return r.getDevToolOptions()}async function R(e){e!=null&&e.mode||d.error(`[DevTool] ${i("common.modeRequired")}`),S(),y(t),b(t),a=new s(t),l(a),r.setDevToolOptions({...e||{mode:""},zIndex:(e==null?void 0:e.zIndex)??998,devToolVersion:c,devToolBuildTime:u,devToolGit:m}),n.interceptVue(e==null?void 0:e.vueInstance),n.init({enableCaptureScreen:e==null?void 0:e.enableCaptureScreen,enableInterceptPromiseReject:e==null?void 0:e.enableInterceptPromiseReject}),r.getDevToolDestroy()||(t.addEventListener(),t.postMessage()),d.log(`[DevTool] ${i("common.initSuccess")}
|
|
2
2
|
${i("setting.devTool.currentVersion")}:${c}
|
|
3
3
|
${i("setting.devTool.buildTime")}:${u}
|
|
4
4
|
${i("common.debugSlogan")}`),t.startAbnormalUpload(),await g(100),t.updateRouteList()}function V(){r.getDevToolDestroy()||t.showDevToolButton()}function j(){r.getDevToolDestroy()||t.hideDevToolButton()}function N(){r.getDevToolDestroy()||t.openDevToolWindow()}function B(){r.getDevToolDestroy()||t.closeDevToolWindow()}function $(){r.getDevToolDestroy()&&(a=new s(t),l(a),t.createDevTool({devToolVersion:c,devToolBuildTime:u}))}function E(){r.getDevToolDestroy()||(t.destroyDevTool(),n.reset(),a=void 0,l(void 0))}function q(){r.getDevToolDestroy()||t.restartDevTool()}function A(){t.restartApp()}function U(e){return n.interceptVuexStorage(e)}function M(e){return n.interceptPiniaStore(e)}function z(e){t.uploadAbnormal(e)}export{H as backup,B as closeDevToolWindow,d as console,$ as createDevTool,E as destroyDevTool,L as getDevToolOptions,j as hideDevToolButton,R as initDevTool,M as interceptPiniaStore,U as interceptVuexStorage,N as openDevToolWindow,A as restartApp,q as restartDevTool,V as showDevToolButton,z as uploadAbnormal};
|
package/dist/type.d.ts
CHANGED
|
@@ -107,7 +107,6 @@ export function useDevToolData(props: DevToolWindowProps) {
|
|
|
107
107
|
const searchStorage = shallowRef('');
|
|
108
108
|
|
|
109
109
|
const activeTab = shallowRef(1);
|
|
110
|
-
const tabScrollLeft = shallowRef(0);
|
|
111
110
|
const theme = shallowRef('light');
|
|
112
111
|
let isActive = false;
|
|
113
112
|
|
|
@@ -398,7 +397,6 @@ export function useDevToolData(props: DevToolWindowProps) {
|
|
|
398
397
|
searchRoute,
|
|
399
398
|
searchStorage,
|
|
400
399
|
activeTab,
|
|
401
|
-
tabScrollLeft,
|
|
402
400
|
theme,
|
|
403
401
|
isFullScreen,
|
|
404
402
|
windowX,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { debounce } from '../../../../../utils/index';
|
|
2
1
|
import { setDevToolInfo } from '../../../../../modules/devToolInfo';
|
|
3
2
|
import type { DevTool } from '../../../../../type';
|
|
4
3
|
import { CMD_TYPE, MSG_TYPE, DEV_CORE_MESSAGE } from '../../../../../const';
|
|
@@ -18,7 +17,6 @@ export function useDevToolHandlers(
|
|
|
18
17
|
currentWebSocketType,
|
|
19
18
|
currentTransferType,
|
|
20
19
|
currentTransferCategory,
|
|
21
|
-
tabScrollLeft,
|
|
22
20
|
cacheInterceptConfig,
|
|
23
21
|
useTransition,
|
|
24
22
|
baseFontSize,
|
|
@@ -64,7 +62,6 @@ export function useDevToolHandlers(
|
|
|
64
62
|
currentNetworkType: currentNetworkType.value,
|
|
65
63
|
currentWebSocketType: currentWebSocketType.value,
|
|
66
64
|
theme: theme.value,
|
|
67
|
-
tabScrollLeft: tabScrollLeft.value,
|
|
68
65
|
cacheInterceptConfig: cacheInterceptConfig.value,
|
|
69
66
|
cacheNetworkLog: cacheNetworkLog.value,
|
|
70
67
|
cacheConsoleLog: cacheConsoleLog.value,
|
|
@@ -82,8 +79,6 @@ export function useDevToolHandlers(
|
|
|
82
79
|
});
|
|
83
80
|
}
|
|
84
81
|
|
|
85
|
-
const debounceSetWindowInfo = debounce(setWindowInfo, 200);
|
|
86
|
-
|
|
87
82
|
function onCloseWindow() {
|
|
88
83
|
emits('close');
|
|
89
84
|
setWindowInfo();
|
|
@@ -94,13 +89,6 @@ export function useDevToolHandlers(
|
|
|
94
89
|
setWindowInfo();
|
|
95
90
|
}
|
|
96
91
|
|
|
97
|
-
function onScrollTabs(e: any) {
|
|
98
|
-
tabScrollLeft.value = e.detail.scrollLeft;
|
|
99
|
-
debounceSetWindowInfo();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const debounceScrollTabs = debounce(onScrollTabs, 200);
|
|
103
|
-
|
|
104
92
|
function onConsoleChoose(type: string) {
|
|
105
93
|
if (type === 'clear') {
|
|
106
94
|
consoleList.value = [];
|
|
@@ -585,7 +573,6 @@ export function useDevToolHandlers(
|
|
|
585
573
|
return {
|
|
586
574
|
onCloseWindow,
|
|
587
575
|
onChangeTabs,
|
|
588
|
-
debounceScrollTabs,
|
|
589
576
|
onConsoleChoose,
|
|
590
577
|
onRunJS,
|
|
591
578
|
onSearchConsole,
|
|
@@ -34,12 +34,9 @@
|
|
|
34
34
|
]">
|
|
35
35
|
<view class="dev-tool-window-bg"></view>
|
|
36
36
|
<Tabs
|
|
37
|
-
data-drag-handle="1"
|
|
38
37
|
:model-value="activeTab"
|
|
39
38
|
:items="tabItems"
|
|
40
|
-
:scroll-left="tabScrollLeft"
|
|
41
39
|
@close="onCloseWindow"
|
|
42
|
-
@scroll="debounceScrollTabs"
|
|
43
40
|
@change="onChangeTabs">
|
|
44
41
|
<template #extra>
|
|
45
42
|
<CircularButton
|
|
@@ -418,7 +415,6 @@ import { onShow, onTabItemTap } from '@dcloudio/uni-app';
|
|
|
418
415
|
import {
|
|
419
416
|
onMounted,
|
|
420
417
|
computed,
|
|
421
|
-
nextTick,
|
|
422
418
|
onBeforeMount,
|
|
423
419
|
onUnmounted,
|
|
424
420
|
ref,
|
|
@@ -504,7 +500,6 @@ const overlay = useDevToolOverlay(props);
|
|
|
504
500
|
// 解构常用状态
|
|
505
501
|
const {
|
|
506
502
|
activeTab,
|
|
507
|
-
tabScrollLeft,
|
|
508
503
|
theme,
|
|
509
504
|
consoleList,
|
|
510
505
|
networkList,
|
|
@@ -613,7 +608,6 @@ const dynamicWindowStyle = computed(() => {
|
|
|
613
608
|
const {
|
|
614
609
|
onCloseWindow,
|
|
615
610
|
onChangeTabs,
|
|
616
|
-
debounceScrollTabs,
|
|
617
611
|
onConsoleChoose,
|
|
618
612
|
onRunJS,
|
|
619
613
|
onSearchConsole,
|
|
@@ -842,15 +836,9 @@ onMounted(() => {
|
|
|
842
836
|
? devToolInfo.barrageShowWhenOpen
|
|
843
837
|
: false;
|
|
844
838
|
|
|
845
|
-
//
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
nextTick(() => {
|
|
849
|
-
// 确保恢复的索引在当前可见 Tab 的范围内
|
|
850
|
-
const savedTab = devToolInfo?.activeTab || 0;
|
|
851
|
-
activeTab.value = savedTab < tabItems.value.length ? savedTab : 0;
|
|
852
|
-
});
|
|
853
|
-
}, 150);
|
|
839
|
+
// 确保恢复的索引在当前可见 Tab 的范围内
|
|
840
|
+
const savedTab = devToolInfo?.activeTab || 0;
|
|
841
|
+
activeTab.value = savedTab < tabItems.value.length ? savedTab : 0;
|
|
854
842
|
|
|
855
843
|
if (devToolInfo.windowSettings) {
|
|
856
844
|
isFullScreen.value = devToolInfo.windowSettings.isFullScreen ?? true;
|