vite-uni-dev-tool 1.0.0 → 1.2.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/README.md +54 -0
- package/dist/const.cjs +1 -1
- package/dist/const.d.ts +13 -0
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -1
- package/dist/core-shared.d.ts +1 -1
- package/dist/core-shared.d.ts.map +1 -1
- package/dist/core-shared.js +1 -1
- package/dist/core.d.ts +10 -3
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +2 -2
- package/dist/i18n/locales/en.cjs +1 -1
- package/dist/i18n/locales/en.d.ts +86 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +1 -1
- package/dist/i18n/locales/zh-Hans.cjs +1 -1
- package/dist/i18n/locales/zh-Hans.d.ts +87 -1
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -1
- package/dist/i18n/locales/zh-Hans.js +1 -1
- package/dist/modules/devConsole/index.cjs +1 -1
- package/dist/modules/devConsole/index.js +3 -3
- package/dist/modules/devEvent/index.cjs +3 -3
- package/dist/modules/devEvent/index.d.ts +1 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -1
- package/dist/modules/devEvent/index.js +3 -3
- package/dist/modules/devIntercept/index.cjs +14 -13
- package/dist/modules/devIntercept/index.d.ts +20 -1
- package/dist/modules/devIntercept/index.d.ts.map +1 -1
- package/dist/modules/devIntercept/index.js +14 -13
- package/dist/modules/devStore/index.cjs +1 -1
- package/dist/modules/devStore/index.d.ts +21 -0
- package/dist/modules/devStore/index.d.ts.map +1 -1
- package/dist/modules/devStore/index.js +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -3
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts +2 -1
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +31 -25
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +2 -1
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +30 -24
- package/dist/plugins/uniDevTool/uniDevTool.cjs +3 -3
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/type.d.ts +50 -2
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/language.cjs +1 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -1
- package/dist/utils/object.cjs +1 -1
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -1
- package/dist/v3/DevTool/components/BluetoothList/BluetoothItem.vue +199 -0
- package/dist/v3/DevTool/components/BluetoothList/BluetoothTool.vue +730 -0
- package/dist/v3/DevTool/components/BluetoothList/index.vue +167 -0
- package/dist/v3/{CaptureScreen → DevTool/components/CaptureScreen}/index.vue +4 -4
- package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/ConsoleItem.vue +22 -16
- package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/RunJSInput.vue +4 -6
- package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/index.vue +21 -10
- package/dist/v3/{DevToolButton → DevTool/components/DevToolButton}/index.vue +7 -4
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/DevToolOverlay.vue +17 -2
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/const.ts +28 -5
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/dataUtils.ts +1 -1
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolData.ts +55 -6
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolHandlers.ts +85 -5
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolOverlay.ts +25 -8
- package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/index.vue +67 -16
- package/dist/v3/{ElEvent → DevTool/components/ElEvent}/ElEventItem.vue +3 -3
- package/dist/v3/{ElEvent → DevTool/components/ElEvent}/index.vue +10 -13
- package/dist/v3/{Instance → DevTool/components/Instance}/index.vue +1 -1
- package/dist/v3/{Instance → DevTool/components/Instance}/transformTree.ts +1 -1
- package/dist/v3/{Instance → DevTool/components/Instance}/transformTreeCtx.ts +1 -1
- package/dist/v3/{InstanceDetail → DevTool/components/InstanceDetail}/index.vue +4 -4
- package/dist/v3/{JsonDetail → DevTool/components/JsonDetail}/index.vue +4 -4
- package/dist/v3/{NFCList → DevTool/components/NFCList}/NFCItem.vue +4 -5
- package/dist/v3/{NFCList → DevTool/components/NFCList}/NFCTool.vue +33 -57
- package/dist/v3/{NFCList → DevTool/components/NFCList}/index.vue +12 -16
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/InterceptConfig.vue +20 -4
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/InterceptItem.vue +3 -3
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkDetail.vue +18 -27
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkIntercept.vue +11 -16
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkItem.vue +10 -14
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkSend.vue +67 -34
- package/dist/v3/{NetworkList → DevTool/components/NetworkList}/index.vue +8 -8
- package/dist/v3/{Performance → DevTool/components/Performance}/index.vue +7 -4
- package/dist/v3/{Performance → DevTool/components/Performance}/modules/PerformanceWidget.vue +12 -9
- package/dist/v3/{Performance → DevTool/components/Performance}/modules/usePerformanceChart.ts +1 -1
- package/dist/v3/{Performance → DevTool/components/Performance}/modules/usePerformanceData.ts +2 -2
- package/dist/v3/{PiniaList → DevTool/components/PiniaList}/index.vue +5 -6
- package/dist/v3/{RouteList → DevTool/components/RouteList}/index.vue +21 -24
- package/dist/v3/{RunJS → DevTool/components/RunJS}/index.vue +3 -3
- package/dist/v3/{ScanCodeList → DevTool/components/ScanCodeList}/ScanCodeItem.vue +3 -4
- package/dist/v3/{ScanCodeList → DevTool/components/ScanCodeList}/index.vue +12 -16
- package/dist/v3/{SettingList → DevTool/components/SettingList}/index.vue +68 -0
- package/dist/v3/DevTool/components/SettingList/modules/SettingBarrage.vue +304 -0
- package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingDevTool.vue +8 -4
- package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingInfo.vue +47 -9
- package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingLanguage.vue +2 -2
- package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingLog.vue +2 -2
- package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingNetwork.vue +3 -3
- package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingTheme.vue +37 -7
- package/dist/v3/{SourceCode → DevTool/components/SourceCode}/Line.vue +22 -11
- package/dist/v3/{SourceCode → DevTool/components/SourceCode}/index.vue +8 -8
- package/dist/v3/{SourceCode → DevTool/components/SourceCode}/parseCode.ts +136 -228
- package/dist/v3/{StorageList → DevTool/components/StorageList}/index.vue +7 -7
- package/dist/v3/{TransferList → DevTool/components/TransferList}/TransferDetail.vue +6 -6
- package/dist/v3/{TransferList → DevTool/components/TransferList}/TransferItem.vue +4 -4
- package/dist/v3/{TransferList → DevTool/components/TransferList}/index.vue +8 -8
- package/dist/v3/{UniEvent → DevTool/components/UniEvent}/UniEventItem.vue +6 -7
- package/dist/v3/{UniEvent → DevTool/components/UniEvent}/index.vue +6 -6
- package/dist/v3/{VuexList → DevTool/components/VuexList}/index.vue +3 -3
- package/dist/v3/{WebSocket → DevTool/components/WebSocket}/WebSocketDetail.vue +8 -8
- package/dist/v3/{WebSocket → DevTool/components/WebSocket}/WebSocketItem.vue +4 -4
- package/dist/v3/{WebSocket → DevTool/components/WebSocket}/index.vue +8 -8
- package/dist/v3/DevTool/index.vue +179 -4
- package/dist/v3/{AppTransition → components/AppTransition}/index.vue +6 -0
- package/dist/v3/components/Barrage/BarrageItem.vue +137 -0
- package/dist/v3/components/Barrage/index.vue +202 -0
- package/dist/v3/components/DevErrorBoundary/index.vue +380 -0
- package/dist/v3/{DraggableContainer → components/DraggableContainer}/index.vue +1 -1
- package/dist/v3/{FilterInput → components/FilterInput}/index.vue +1 -1
- package/dist/v3/{JsonPretty → components/JsonPretty}/components/CheckController/index.vue +1 -1
- package/dist/v3/{JsonPretty → components/JsonPretty}/components/TreeNode/index.vue +11 -5
- package/dist/v3/{JsonPretty → components/JsonPretty}/index.vue +16 -13
- package/dist/v3/{JsonPretty → components/JsonPretty}/type.ts +1 -0
- package/dist/v3/{JsonPretty → components/JsonPretty}/utils/index.ts +1 -1
- package/dist/v3/{MovableContainer → components/MovableContainer}/index.vue +9 -5
- package/dist/v3/{Pick → components/Pick}/index.vue +1 -1
- package/dist/v3/{Tabs → components/Tabs}/index.vue +30 -4
- package/dist/v3/{VirtualList → components/VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/{VirtualList → components/VirtualList}/index.vue +4 -0
- package/dist/v3/hooks/useBluetooth/index.ts +561 -0
- package/dist/v3/hooks/useRequest/index.ts +33 -20
- package/dist/v3/hooks/useWebsocket/README.md +79 -0
- package/dist/v3/hooks/useWebsocket/index.ts +253 -0
- package/dist/v3/styles/theme.css +17 -10
- package/package.json +67 -64
- package/dist/plugins/uniParseStock/index.d.ts +0 -10
- package/dist/plugins/uniParseStock/index.d.ts.map +0 -1
- /package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/staticTips.ts +0 -0
- /package/dist/v3/{DevToolTitle → DevTool/components/DevToolTitle}/index.vue +0 -0
- /package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/index.css +0 -0
- /package/dist/v3/{Instance → DevTool/components/Instance}/components/InstanceTreeNode.vue +0 -0
- /package/dist/v3/{Instance → DevTool/components/Instance}/flatten.ts +0 -0
- /package/dist/v3/{Instance → DevTool/components/Instance}/registry.ts +0 -0
- /package/dist/v3/{Instance → DevTool/components/Instance}/typing.d.ts +0 -0
- /package/dist/v3/{NFCList → DevTool/components/NFCList}/const.ts +0 -0
- /package/dist/v3/{NetworkList → DevTool/components/NetworkList}/const.ts +0 -0
- /package/dist/v3/{NetworkList → DevTool/components/NetworkList}/hooks/useNetworkForm.ts +0 -0
- /package/dist/v3/{NetworkList → DevTool/components/NetworkList}/utils.ts +0 -0
- /package/dist/v3/{Performance → DevTool/components/Performance}/modules/PerformanceMetrics.vue +0 -0
- /package/dist/v3/{SettingButton → DevTool/components/SettingButton}/index.vue +0 -0
- /package/dist/v3/{SettingList → DevTool/components/SettingList}/index.css +0 -0
- /package/dist/v3/{SettingList → DevTool/components/SettingList}/typing.d.ts +0 -0
- /package/dist/v3/{AutoSizer → components/AutoSizer}/index.vue +0 -0
- /package/dist/v3/{AutoSizer → components/AutoSizer}/index1.vue +0 -0
- /package/dist/v3/{AutoSizer → components/AutoSizer}/utils.ts +0 -0
- /package/dist/v3/{CircularButton → components/CircularButton}/index.vue +0 -0
- /package/dist/v3/{CustomSwiper → components/CustomSwiper}/CustomSwiperItem.vue +0 -0
- /package/dist/v3/{CustomSwiper → components/CustomSwiper}/index.vue +0 -0
- /package/dist/v3/{Empty → components/Empty}/empty.png +0 -0
- /package/dist/v3/{Empty → components/Empty}/index.vue +0 -0
- /package/dist/v3/{FilterSelect → components/FilterSelect}/index.vue +0 -0
- /package/dist/v3/{JsonPretty → components/JsonPretty}/components/Brackets/index.vue +0 -0
- /package/dist/v3/{JsonPretty → components/JsonPretty}/components/Carets/index.vue +0 -0
- /package/dist/v3/{JsonPretty → components/JsonPretty}/hooks/useClipboard.ts +0 -0
- /package/dist/v3/{JsonPretty → components/JsonPretty}/hooks/useError.ts +0 -0
- /package/dist/v3/{Tag → components/Tag}/index.vue +0 -0
- /package/dist/v3/{VirtualList → components/VirtualList}/readme.md +0 -0
package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolHandlers.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { debounce } from '
|
|
2
|
-
import { setDevToolInfo } from '
|
|
3
|
-
import type { DevTool } from '
|
|
4
|
-
import { CMD_TYPE, MSG_TYPE, DEV_CORE_MESSAGE } from '
|
|
5
|
-
import { hightLight } from '
|
|
1
|
+
import { debounce } from '../../../../../utils/index';
|
|
2
|
+
import { setDevToolInfo } from '../../../../../modules/devToolInfo';
|
|
3
|
+
import type { DevTool } from '../../../../../type';
|
|
4
|
+
import { CMD_TYPE, MSG_TYPE, DEV_CORE_MESSAGE } from '../../../../../const';
|
|
5
|
+
import { hightLight } from '../../../../../utils/index';
|
|
6
6
|
|
|
7
7
|
export function useDevToolHandlers(props: any, emits: any, state: any) {
|
|
8
8
|
const {
|
|
@@ -39,6 +39,8 @@ export function useDevToolHandlers(props: any, emits: any, state: any) {
|
|
|
39
39
|
searchConsole,
|
|
40
40
|
theme,
|
|
41
41
|
currentNetworkSort,
|
|
42
|
+
barrageVisible,
|
|
43
|
+
barrageShowWhenOpen,
|
|
42
44
|
} = state;
|
|
43
45
|
|
|
44
46
|
/** 发送消息给核心模块 */
|
|
@@ -69,6 +71,8 @@ export function useDevToolHandlers(props: any, emits: any, state: any) {
|
|
|
69
71
|
interceptNetworkList: interceptNetworkList.value,
|
|
70
72
|
performanceShowFps: state.performanceShowFps.value,
|
|
71
73
|
performanceShowCpu: state.performanceShowCpu.value,
|
|
74
|
+
barrageVisible: barrageVisible.value,
|
|
75
|
+
barrageShowWhenOpen: barrageShowWhenOpen.value,
|
|
72
76
|
});
|
|
73
77
|
}
|
|
74
78
|
|
|
@@ -457,6 +461,15 @@ export function useDevToolHandlers(props: any, emits: any, state: any) {
|
|
|
457
461
|
uni.$emit('DEV_CHANGE_PERFORMANCE_SHOW_CPU', show);
|
|
458
462
|
}
|
|
459
463
|
|
|
464
|
+
function onChangeBarrage(show: boolean) {
|
|
465
|
+
state.barrageVisible.value = show;
|
|
466
|
+
setDevToolInfo({
|
|
467
|
+
barrageVisible: show,
|
|
468
|
+
});
|
|
469
|
+
basicSendMessage({ type: CMD_TYPE.BARRAGE_TOGGLE, data: { show } });
|
|
470
|
+
uni.$emit(DEV_CORE_MESSAGE, { type: MSG_TYPE.BARRAGE_VISIBLE, data: show });
|
|
471
|
+
}
|
|
472
|
+
|
|
460
473
|
function onChangeVuex(value: any) {
|
|
461
474
|
basicSendMessage({ type: CMD_TYPE.VUEX_CHANGE, data: value });
|
|
462
475
|
}
|
|
@@ -496,6 +509,65 @@ export function useDevToolHandlers(props: any, emits: any, state: any) {
|
|
|
496
509
|
basicSendMessage({ type: CMD_TYPE.INTERCEPT_UPDATE, data: ni });
|
|
497
510
|
}
|
|
498
511
|
|
|
512
|
+
function onChangeBarrageMaxTracks(val: number) {
|
|
513
|
+
state.barrageMaxTracks.value = val;
|
|
514
|
+
basicSendMessage({
|
|
515
|
+
type: CMD_TYPE.BARRAGE_MAX_TRACKS,
|
|
516
|
+
data: { value: val },
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function onChangeBarrageTrackHeight(val: number) {
|
|
521
|
+
state.barrageTrackHeight.value = val;
|
|
522
|
+
basicSendMessage({
|
|
523
|
+
type: CMD_TYPE.BARRAGE_TRACK_HEIGHT,
|
|
524
|
+
data: { value: val },
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function onChangeBarrageStartTop(val: number) {
|
|
529
|
+
state.barrageStartTop.value = val;
|
|
530
|
+
basicSendMessage({
|
|
531
|
+
type: CMD_TYPE.BARRAGE_START_TOP,
|
|
532
|
+
data: { value: val },
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
function onChangeBarrageDuration(val: number) {
|
|
537
|
+
state.barrageDuration.value = val;
|
|
538
|
+
basicSendMessage({
|
|
539
|
+
type: CMD_TYPE.BARRAGE_DURATION,
|
|
540
|
+
data: { value: val },
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
function onChangeBarrageMaxLength(val: number) {
|
|
545
|
+
state.barrageMaxLength.value = val;
|
|
546
|
+
basicSendMessage({
|
|
547
|
+
type: CMD_TYPE.BARRAGE_MAX_LENGTH,
|
|
548
|
+
data: { value: val },
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function onChangeBarrageTypes(val: string[]) {
|
|
553
|
+
state.barrageTypes.value = val;
|
|
554
|
+
basicSendMessage({
|
|
555
|
+
type: CMD_TYPE.BARRAGE_TYPES,
|
|
556
|
+
data: { value: val },
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function onChangeBarrageShowWhenOpen(val: boolean) {
|
|
561
|
+
state.barrageShowWhenOpen.value = val;
|
|
562
|
+
setDevToolInfo({
|
|
563
|
+
barrageShowWhenOpen: val,
|
|
564
|
+
});
|
|
565
|
+
basicSendMessage({
|
|
566
|
+
type: CMD_TYPE.SET_BARRAGE_SHOW_WHEN_OPEN,
|
|
567
|
+
data: { value: val },
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
|
|
499
571
|
return {
|
|
500
572
|
onCloseWindow,
|
|
501
573
|
onChangeTabs,
|
|
@@ -544,6 +616,14 @@ export function useDevToolHandlers(props: any, emits: any, state: any) {
|
|
|
544
616
|
onChangePerformance,
|
|
545
617
|
onChangePerformanceShowFps,
|
|
546
618
|
onChangePerformanceShowCpu,
|
|
619
|
+
onChangeBarrage,
|
|
620
|
+
onChangeBarrageMaxTracks,
|
|
621
|
+
onChangeBarrageTrackHeight,
|
|
622
|
+
onChangeBarrageStartTop,
|
|
623
|
+
onChangeBarrageDuration,
|
|
624
|
+
onChangeBarrageMaxLength,
|
|
625
|
+
onChangeBarrageTypes,
|
|
626
|
+
onChangeBarrageShowWhenOpen,
|
|
547
627
|
basicSendMessage,
|
|
548
628
|
};
|
|
549
629
|
}
|
package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolOverlay.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, reactive, shallowRef, nextTick } from 'vue';
|
|
2
|
-
import type { DevTool } from '
|
|
3
|
-
import { isMockWX, isAndroid } from '
|
|
2
|
+
import type { DevTool } from '../../../../../type';
|
|
3
|
+
import { isMockWX, isAndroid } from '../../../../../utils/index';
|
|
4
4
|
import { emptyNetwork } from '../const';
|
|
5
5
|
|
|
6
6
|
export function useDevToolOverlay(props: any) {
|
|
@@ -17,6 +17,8 @@ export function useDevToolOverlay(props: any) {
|
|
|
17
17
|
const showNfcTool = ref(false);
|
|
18
18
|
const showTransferDetail = ref(false);
|
|
19
19
|
const showWebSocketDetail = ref(false);
|
|
20
|
+
const showBluetoothTool = ref(false);
|
|
21
|
+
const bluetoothDevice = shallowRef<DevTool.BluetoothItem | null>(null);
|
|
20
22
|
|
|
21
23
|
const network = reactive<DevTool.NetworkItem>({ ...emptyNetwork });
|
|
22
24
|
const transfer = reactive<DevTool.TransferItem>({
|
|
@@ -34,17 +36,21 @@ export function useDevToolOverlay(props: any) {
|
|
|
34
36
|
function onOpenCode(value?: string) {
|
|
35
37
|
if (!value) return;
|
|
36
38
|
stack.value = value;
|
|
37
|
-
const isWXLink = isMockWX(value ?? '') || props.mode !== 'development';
|
|
38
|
-
const isUseDevSource = !isWXLink && props.useDevSource;
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
// 微信小程序下的虚拟路径,只能在小程序真机调试下打开
|
|
41
|
+
if (isMockWX(value)) {
|
|
41
42
|
uni.showToast({
|
|
42
43
|
icon: 'none',
|
|
43
44
|
title: '[DevTool] 请在小程序真机调试模式下查看源码',
|
|
44
45
|
});
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
const isDev = props.mode === 'development';
|
|
50
|
+
const isUseDevSource = props.useDevSource;
|
|
51
|
+
|
|
52
|
+
// 非开发环境且未显式开启 useDevSource,不打开源码面板
|
|
53
|
+
if (!isDev && !isUseDevSource) return;
|
|
48
54
|
|
|
49
55
|
if (isAndroid()) {
|
|
50
56
|
if (props.sourceFileServers && props.sourceFileServers?.length > 0) {
|
|
@@ -76,6 +82,15 @@ export function useDevToolOverlay(props: any) {
|
|
|
76
82
|
showNfcTool.value = false;
|
|
77
83
|
}
|
|
78
84
|
|
|
85
|
+
function onOpenBluetoothTool(device: DevTool.BluetoothItem) {
|
|
86
|
+
bluetoothDevice.value = device;
|
|
87
|
+
showBluetoothTool.value = true;
|
|
88
|
+
}
|
|
89
|
+
function onCloseBluetoothTool() {
|
|
90
|
+
showBluetoothTool.value = false;
|
|
91
|
+
bluetoothDevice.value = null;
|
|
92
|
+
}
|
|
93
|
+
|
|
79
94
|
function onOpenNetworkDetail(ni?: DevTool.NetworkItem) {
|
|
80
95
|
Object.assign(network, emptyNetwork);
|
|
81
96
|
Object.assign(network, ni);
|
|
@@ -154,6 +169,8 @@ export function useDevToolOverlay(props: any) {
|
|
|
154
169
|
showNfcTool,
|
|
155
170
|
showTransferDetail,
|
|
156
171
|
showWebSocketDetail,
|
|
172
|
+
showBluetoothTool,
|
|
173
|
+
bluetoothDevice,
|
|
157
174
|
}),
|
|
158
175
|
network,
|
|
159
176
|
transfer,
|
|
@@ -177,8 +194,8 @@ export function useDevToolOverlay(props: any) {
|
|
|
177
194
|
onCloseTransferDetail,
|
|
178
195
|
onOpenWebSocketDetail,
|
|
179
196
|
onCloseWebSocketDetail,
|
|
197
|
+
onOpenBluetoothTool,
|
|
198
|
+
onCloseBluetoothTool,
|
|
180
199
|
},
|
|
181
200
|
};
|
|
182
201
|
}
|
|
183
|
-
|
|
184
|
-
import { emptyNetwork as _emptyNetwork } from '../const';
|
|
@@ -282,6 +282,17 @@
|
|
|
282
282
|
@openTool="overlay.handlers.onOpenNfcTool" />
|
|
283
283
|
</CustomSwiperItem>
|
|
284
284
|
|
|
285
|
+
<!-- Bluetooth -->
|
|
286
|
+
<CustomSwiperItem
|
|
287
|
+
v-if="isTabVisible('Bluetooth')"
|
|
288
|
+
:key="tabIndex.Bluetooth"
|
|
289
|
+
style="width: 100%; height: 100%">
|
|
290
|
+
<BluetoothList
|
|
291
|
+
v-if="swiperShow(tabIndex.Bluetooth)"
|
|
292
|
+
:contentHeight="dynamicContentHeight"
|
|
293
|
+
@openTool="overlay.handlers.onOpenBluetoothTool" />
|
|
294
|
+
</CustomSwiperItem>
|
|
295
|
+
|
|
285
296
|
<!-- Storage -->
|
|
286
297
|
<CustomSwiperItem
|
|
287
298
|
v-if="isTabVisible('Storage')"
|
|
@@ -341,6 +352,14 @@
|
|
|
341
352
|
:performanceVisible="performanceVisible"
|
|
342
353
|
:performanceShowFps="performanceShowFps"
|
|
343
354
|
:performanceShowCpu="performanceShowCpu"
|
|
355
|
+
:barrage-visible="barrageVisible"
|
|
356
|
+
:barrage-max-tracks="barrageMaxTracks"
|
|
357
|
+
:barrage-track-height="barrageTrackHeight"
|
|
358
|
+
:barrage-start-top="barrageStartTop"
|
|
359
|
+
:barrage-duration="barrageDuration"
|
|
360
|
+
:barrage-max-length="barrageMaxLength"
|
|
361
|
+
:barrage-types="barrageTypes"
|
|
362
|
+
:barrage-show-when-open="barrageShowWhenOpen"
|
|
344
363
|
:sizeFormat="sizeFormat"
|
|
345
364
|
:buildInfo="buildInfo"
|
|
346
365
|
:cache-intercept-config="cacheInterceptConfig"
|
|
@@ -365,6 +384,14 @@
|
|
|
365
384
|
@change-cache-intercept-config="onChangeCacheInterceptConfig"
|
|
366
385
|
@change-cache-network-log="onChangeCacheNetworkLog"
|
|
367
386
|
@change-cache-console-log="onChangeCacheConsoleLog"
|
|
387
|
+
@change-barrage="onChangeBarrage"
|
|
388
|
+
@change-barrage-max-tracks="onChangeBarrageMaxTracks"
|
|
389
|
+
@change-barrage-track-height="onChangeBarrageTrackHeight"
|
|
390
|
+
@change-barrage-start-top="onChangeBarrageStartTop"
|
|
391
|
+
@change-barrage-duration="onChangeBarrageDuration"
|
|
392
|
+
@change-barrage-max-length="onChangeBarrageMaxLength"
|
|
393
|
+
@change-barrage-types="onChangeBarrageTypes"
|
|
394
|
+
@change-barrage-show-when-open="onChangeBarrageShowWhenOpen"
|
|
368
395
|
@change-use-transition="onChangeUseTransition"
|
|
369
396
|
@changeFont="onChangeFontSize"
|
|
370
397
|
@onChangePerformanceShowFps="onChangePerformanceShowFps"
|
|
@@ -414,8 +441,8 @@ import {
|
|
|
414
441
|
ref,
|
|
415
442
|
watch,
|
|
416
443
|
} from 'vue';
|
|
417
|
-
import AppTransition from '
|
|
418
|
-
import Tabs from '
|
|
444
|
+
import AppTransition from '../../../components/AppTransition/index.vue';
|
|
445
|
+
import Tabs from '../../../components/Tabs/index.vue';
|
|
419
446
|
import ConsoleList from '../ConsoleList/index.vue';
|
|
420
447
|
import NetworkList from '../NetworkList/index.vue';
|
|
421
448
|
import StorageList from '../StorageList/index.vue';
|
|
@@ -431,18 +458,22 @@ import UniEvent from '../UniEvent/index.vue';
|
|
|
431
458
|
import CaptureScreen from '../CaptureScreen/index.vue';
|
|
432
459
|
import ScanCodeList from '../ScanCodeList/index.vue';
|
|
433
460
|
import NFCList from '../NFCList/index.vue';
|
|
461
|
+
import BluetoothList from '../BluetoothList/index.vue';
|
|
434
462
|
import InstanceDetail from '../InstanceDetail/index.vue';
|
|
435
463
|
import DevToolOverlay from './DevToolOverlay.vue';
|
|
436
|
-
import CustomSwiper from '
|
|
437
|
-
import CustomSwiperItem from '
|
|
438
|
-
import DraggableContainer from '
|
|
439
|
-
import CircularButton from '
|
|
440
|
-
import { useI18n } from '
|
|
441
|
-
|
|
442
|
-
import { DEV_CORE_MESSAGE, MSG_TYPE, CMD_TYPE } from '
|
|
443
|
-
import { getCurrentPagePath } from '
|
|
444
|
-
import type { DevTool } from '
|
|
445
|
-
import {
|
|
464
|
+
import CustomSwiper from '../../../components/CustomSwiper/index.vue';
|
|
465
|
+
import CustomSwiperItem from '../../../components/CustomSwiper/CustomSwiperItem.vue';
|
|
466
|
+
import DraggableContainer from '../../../components/DraggableContainer/index.vue';
|
|
467
|
+
import CircularButton from '../../../components/CircularButton/index.vue';
|
|
468
|
+
import { useI18n } from '../../../../i18n';
|
|
469
|
+
|
|
470
|
+
import { DEV_CORE_MESSAGE, MSG_TYPE, CMD_TYPE } from '../../../../const';
|
|
471
|
+
import { getCurrentPagePath } from '../../../../utils/index';
|
|
472
|
+
import type { DevTool } from '../../../../type';
|
|
473
|
+
import {
|
|
474
|
+
getDevToolInfo,
|
|
475
|
+
setDevToolInfo,
|
|
476
|
+
} from '../../../../modules/devToolInfo';
|
|
446
477
|
import { getTabItems, tabIndex } from './const';
|
|
447
478
|
|
|
448
479
|
// 引入 Hooks
|
|
@@ -532,6 +563,14 @@ const {
|
|
|
532
563
|
performanceVisible,
|
|
533
564
|
performanceShowFps,
|
|
534
565
|
performanceShowCpu,
|
|
566
|
+
barrageVisible,
|
|
567
|
+
barrageMaxTracks,
|
|
568
|
+
barrageTrackHeight,
|
|
569
|
+
barrageStartTop,
|
|
570
|
+
barrageDuration,
|
|
571
|
+
barrageMaxLength,
|
|
572
|
+
barrageTypes,
|
|
573
|
+
barrageShowWhenOpen,
|
|
535
574
|
isFullScreen,
|
|
536
575
|
windowX,
|
|
537
576
|
windowY,
|
|
@@ -640,6 +679,14 @@ const {
|
|
|
640
679
|
onChangePerformance,
|
|
641
680
|
onChangePerformanceShowFps,
|
|
642
681
|
onChangePerformanceShowCpu,
|
|
682
|
+
onChangeBarrage,
|
|
683
|
+
onChangeBarrageMaxTracks,
|
|
684
|
+
onChangeBarrageTrackHeight,
|
|
685
|
+
onChangeBarrageStartTop,
|
|
686
|
+
onChangeBarrageDuration,
|
|
687
|
+
onChangeBarrageMaxLength,
|
|
688
|
+
onChangeBarrageTypes,
|
|
689
|
+
onChangeBarrageShowWhenOpen,
|
|
643
690
|
basicSendMessage,
|
|
644
691
|
} = handlers;
|
|
645
692
|
|
|
@@ -811,6 +858,10 @@ onMounted(() => {
|
|
|
811
858
|
'ElEvent',
|
|
812
859
|
'UniEvent',
|
|
813
860
|
];
|
|
861
|
+
barrageShowWhenOpen.value =
|
|
862
|
+
devToolInfo?.barrageShowWhenOpen !== undefined
|
|
863
|
+
? devToolInfo.barrageShowWhenOpen
|
|
864
|
+
: false;
|
|
814
865
|
|
|
815
866
|
// 延迟恢复滚动位置,确保布局已渲染
|
|
816
867
|
setTimeout(() => {
|
|
@@ -824,10 +875,10 @@ onMounted(() => {
|
|
|
824
875
|
|
|
825
876
|
if (devToolInfo.windowSettings) {
|
|
826
877
|
isFullScreen.value = devToolInfo.windowSettings.isFullScreen ?? true;
|
|
827
|
-
windowX.value = devToolInfo.windowSettings.x
|
|
828
|
-
windowY.value = devToolInfo.windowSettings.y
|
|
829
|
-
windowWidth.value = devToolInfo.windowSettings.width
|
|
830
|
-
windowHeight.value = devToolInfo.windowSettings.height
|
|
878
|
+
windowX.value = Number(devToolInfo.windowSettings.x) || 10;
|
|
879
|
+
windowY.value = Number(devToolInfo.windowSettings.y) || 100;
|
|
880
|
+
windowWidth.value = Number(devToolInfo.windowSettings.width) || 375;
|
|
881
|
+
windowHeight.value = Number(devToolInfo.windowSettings.height) || 450;
|
|
831
882
|
}
|
|
832
883
|
}
|
|
833
884
|
if (props.data) {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
</view>
|
|
45
45
|
</template>
|
|
46
46
|
<script lang="ts" setup>
|
|
47
|
-
import Tag from '
|
|
48
|
-
import type { DevTool } from '
|
|
49
|
-
import { formatDate } from '
|
|
47
|
+
import Tag from '../../../components/Tag/index.vue';
|
|
48
|
+
import type { DevTool } from '../../../../type';
|
|
49
|
+
import { formatDate } from '../../../../utils';
|
|
50
50
|
|
|
51
51
|
const props = defineProps<{
|
|
52
52
|
eventItem: DevTool.ElEventItem;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="el-event-content">
|
|
3
3
|
<view class="el-event-control">
|
|
4
|
-
<DevToolTitle>
|
|
4
|
+
<DevToolTitle>{{ t('elEvent.title') }}</DevToolTitle>
|
|
5
5
|
|
|
6
6
|
<Tag
|
|
7
7
|
mode="clear"
|
|
8
8
|
style="margin-left: auto"
|
|
9
9
|
customStyle="margin-left: auto"
|
|
10
|
-
@click="emit('clear')"
|
|
11
|
-
>
|
|
10
|
+
@click="emit('clear')">
|
|
12
11
|
{{ t('common.clear') }}
|
|
13
12
|
</Tag>
|
|
14
13
|
</view>
|
|
@@ -19,8 +18,7 @@
|
|
|
19
18
|
:pageSize="20"
|
|
20
19
|
:height="contentHeight - 32 * 2"
|
|
21
20
|
:data="elEventList"
|
|
22
|
-
:scrollWithAnimation="true"
|
|
23
|
-
>
|
|
21
|
+
:scrollWithAnimation="true">
|
|
24
22
|
<template #default="{ list, start, itemsHeight, onSizeChange }">
|
|
25
23
|
<AutoSize
|
|
26
24
|
v-for="(item, index) in list"
|
|
@@ -28,8 +26,7 @@
|
|
|
28
26
|
:index="start + index"
|
|
29
27
|
:id="`dev-el-event-${index}`"
|
|
30
28
|
:itemsHeight="itemsHeight"
|
|
31
|
-
:onSizeChange="onSizeChange"
|
|
32
|
-
>
|
|
29
|
+
:onSizeChange="onSizeChange">
|
|
33
30
|
<ElEventItem :eventItem="item" @openJson="emit('openJson', $event)" />
|
|
34
31
|
</AutoSize>
|
|
35
32
|
</template>
|
|
@@ -41,12 +38,12 @@
|
|
|
41
38
|
<script lang="ts" setup>
|
|
42
39
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
43
40
|
import ElEventItem from './ElEventItem.vue';
|
|
44
|
-
import Tag from '
|
|
45
|
-
import Empty from '
|
|
46
|
-
import VirtualList from '
|
|
47
|
-
import AutoSize from '
|
|
48
|
-
import type { DevTool } from '
|
|
49
|
-
import { useI18n } from '
|
|
41
|
+
import Tag from '../../../components/Tag/index.vue';
|
|
42
|
+
import Empty from '../../../components/Empty/index.vue';
|
|
43
|
+
import VirtualList from '../../../components/VirtualList/index.vue';
|
|
44
|
+
import AutoSize from '../../../components/VirtualList/AutoSize.vue';
|
|
45
|
+
import type { DevTool } from '../../../../type';
|
|
46
|
+
import { useI18n } from '../../../../i18n';
|
|
50
47
|
|
|
51
48
|
const { t } = useI18n();
|
|
52
49
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</VirtualList>
|
|
23
23
|
</template>
|
|
24
24
|
<script lang="ts" setup>
|
|
25
|
-
import VirtualList from '
|
|
25
|
+
import VirtualList from '../../../components/VirtualList/index.vue';
|
|
26
26
|
import InstanceTreeNode from './components/InstanceTreeNode.vue';
|
|
27
27
|
import { computed, ref, markRaw, shallowRef, watch } from 'vue';
|
|
28
28
|
import { simpleTreeCtx, resetUidCount } from './transformTreeCtx';
|
|
@@ -149,12 +149,12 @@ import {
|
|
|
149
149
|
markRaw,
|
|
150
150
|
type ComponentInternalInstance,
|
|
151
151
|
} from 'vue';
|
|
152
|
-
import { useI18n } from '
|
|
153
|
-
import Tag from '
|
|
152
|
+
import { useI18n } from '../../../../i18n';
|
|
153
|
+
import Tag from '../../../components/Tag/index.vue';
|
|
154
154
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
155
155
|
import InstanceTree from '../Instance/index.vue';
|
|
156
|
-
import Empty from '
|
|
157
|
-
import JsonPretty from '
|
|
156
|
+
import Empty from '../../../components/Empty/index.vue';
|
|
157
|
+
import JsonPretty from '../../../components/JsonPretty/index.vue';
|
|
158
158
|
|
|
159
159
|
const { t } = useI18n();
|
|
160
160
|
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
<script lang="ts" setup>
|
|
22
22
|
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
23
|
-
import CircularButton from '
|
|
24
|
-
import JsonPretty from '
|
|
25
|
-
import type { DevTool } from '
|
|
26
|
-
import { useI18n } from '
|
|
23
|
+
import CircularButton from '../../../components/CircularButton/index.vue';
|
|
24
|
+
import JsonPretty from '../../../components/JsonPretty/index.vue';
|
|
25
|
+
import type { DevTool } from '../../../../type';
|
|
26
|
+
import { useI18n } from '../../../../i18n';
|
|
27
27
|
|
|
28
28
|
const { t } = useI18n();
|
|
29
29
|
|
|
@@ -31,17 +31,16 @@
|
|
|
31
31
|
|
|
32
32
|
<view
|
|
33
33
|
:class="`nfc-item-right ${isUseDevSource ? 'link' : ''}`"
|
|
34
|
-
@click="emit('openCode', nfcItem?.stack)"
|
|
35
|
-
>
|
|
34
|
+
@click="emit('openCode', nfcItem?.stack)">
|
|
36
35
|
{{ nfcItem?.stack }}
|
|
37
36
|
</view>
|
|
38
37
|
</view>
|
|
39
38
|
</template>
|
|
40
39
|
<script lang="ts" setup>
|
|
41
40
|
import { computed } from 'vue';
|
|
42
|
-
import type { DevTool } from '
|
|
43
|
-
import { formatDate, isMockWX } from '
|
|
44
|
-
import { useI18n } from '
|
|
41
|
+
import type { DevTool } from '../../../../type';
|
|
42
|
+
import { formatDate, isMockWX } from '../../../../utils';
|
|
43
|
+
import { useI18n } from '../../../../i18n';
|
|
45
44
|
|
|
46
45
|
const { t } = useI18n();
|
|
47
46
|
|