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.
Files changed (170) hide show
  1. package/README.md +54 -0
  2. package/dist/const.cjs +1 -1
  3. package/dist/const.d.ts +13 -0
  4. package/dist/const.d.ts.map +1 -1
  5. package/dist/const.js +1 -1
  6. package/dist/core-shared.d.ts +1 -1
  7. package/dist/core-shared.d.ts.map +1 -1
  8. package/dist/core-shared.js +1 -1
  9. package/dist/core.d.ts +10 -3
  10. package/dist/core.d.ts.map +1 -1
  11. package/dist/core.js +2 -2
  12. package/dist/i18n/locales/en.cjs +1 -1
  13. package/dist/i18n/locales/en.d.ts +86 -0
  14. package/dist/i18n/locales/en.d.ts.map +1 -1
  15. package/dist/i18n/locales/en.js +1 -1
  16. package/dist/i18n/locales/zh-Hans.cjs +1 -1
  17. package/dist/i18n/locales/zh-Hans.d.ts +87 -1
  18. package/dist/i18n/locales/zh-Hans.d.ts.map +1 -1
  19. package/dist/i18n/locales/zh-Hans.js +1 -1
  20. package/dist/modules/devConsole/index.cjs +1 -1
  21. package/dist/modules/devConsole/index.js +3 -3
  22. package/dist/modules/devEvent/index.cjs +3 -3
  23. package/dist/modules/devEvent/index.d.ts +1 -0
  24. package/dist/modules/devEvent/index.d.ts.map +1 -1
  25. package/dist/modules/devEvent/index.js +3 -3
  26. package/dist/modules/devIntercept/index.cjs +14 -13
  27. package/dist/modules/devIntercept/index.d.ts +20 -1
  28. package/dist/modules/devIntercept/index.d.ts.map +1 -1
  29. package/dist/modules/devIntercept/index.js +14 -13
  30. package/dist/modules/devStore/index.cjs +1 -1
  31. package/dist/modules/devStore/index.d.ts +21 -0
  32. package/dist/modules/devStore/index.d.ts.map +1 -1
  33. package/dist/modules/devStore/index.js +1 -1
  34. package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -3
  35. package/dist/plugins/uniDevTool/transform/transformMain.d.ts +2 -1
  36. package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
  37. package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
  38. package/dist/plugins/uniDevTool/transform/transformVue.cjs +31 -25
  39. package/dist/plugins/uniDevTool/transform/transformVue.d.ts +2 -1
  40. package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
  41. package/dist/plugins/uniDevTool/transform/transformVue.js +30 -24
  42. package/dist/plugins/uniDevTool/uniDevTool.cjs +3 -3
  43. package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -1
  44. package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
  45. package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
  46. package/dist/type.d.ts +50 -2
  47. package/dist/type.d.ts.map +1 -1
  48. package/dist/utils/language.cjs +1 -1
  49. package/dist/utils/language.d.ts.map +1 -1
  50. package/dist/utils/language.js +1 -1
  51. package/dist/utils/object.cjs +1 -1
  52. package/dist/utils/object.d.ts.map +1 -1
  53. package/dist/utils/object.js +1 -1
  54. package/dist/v3/DevTool/components/BluetoothList/BluetoothItem.vue +199 -0
  55. package/dist/v3/DevTool/components/BluetoothList/BluetoothTool.vue +730 -0
  56. package/dist/v3/DevTool/components/BluetoothList/index.vue +167 -0
  57. package/dist/v3/{CaptureScreen → DevTool/components/CaptureScreen}/index.vue +4 -4
  58. package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/ConsoleItem.vue +22 -16
  59. package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/RunJSInput.vue +4 -6
  60. package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/index.vue +21 -10
  61. package/dist/v3/{DevToolButton → DevTool/components/DevToolButton}/index.vue +7 -4
  62. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/DevToolOverlay.vue +17 -2
  63. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/const.ts +28 -5
  64. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/dataUtils.ts +1 -1
  65. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolData.ts +55 -6
  66. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolHandlers.ts +85 -5
  67. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/hooks/useDevToolOverlay.ts +25 -8
  68. package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/index.vue +67 -16
  69. package/dist/v3/{ElEvent → DevTool/components/ElEvent}/ElEventItem.vue +3 -3
  70. package/dist/v3/{ElEvent → DevTool/components/ElEvent}/index.vue +10 -13
  71. package/dist/v3/{Instance → DevTool/components/Instance}/index.vue +1 -1
  72. package/dist/v3/{Instance → DevTool/components/Instance}/transformTree.ts +1 -1
  73. package/dist/v3/{Instance → DevTool/components/Instance}/transformTreeCtx.ts +1 -1
  74. package/dist/v3/{InstanceDetail → DevTool/components/InstanceDetail}/index.vue +4 -4
  75. package/dist/v3/{JsonDetail → DevTool/components/JsonDetail}/index.vue +4 -4
  76. package/dist/v3/{NFCList → DevTool/components/NFCList}/NFCItem.vue +4 -5
  77. package/dist/v3/{NFCList → DevTool/components/NFCList}/NFCTool.vue +33 -57
  78. package/dist/v3/{NFCList → DevTool/components/NFCList}/index.vue +12 -16
  79. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/InterceptConfig.vue +20 -4
  80. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/InterceptItem.vue +3 -3
  81. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkDetail.vue +18 -27
  82. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkIntercept.vue +11 -16
  83. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkItem.vue +10 -14
  84. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/NetworkSend.vue +67 -34
  85. package/dist/v3/{NetworkList → DevTool/components/NetworkList}/index.vue +8 -8
  86. package/dist/v3/{Performance → DevTool/components/Performance}/index.vue +7 -4
  87. package/dist/v3/{Performance → DevTool/components/Performance}/modules/PerformanceWidget.vue +12 -9
  88. package/dist/v3/{Performance → DevTool/components/Performance}/modules/usePerformanceChart.ts +1 -1
  89. package/dist/v3/{Performance → DevTool/components/Performance}/modules/usePerformanceData.ts +2 -2
  90. package/dist/v3/{PiniaList → DevTool/components/PiniaList}/index.vue +5 -6
  91. package/dist/v3/{RouteList → DevTool/components/RouteList}/index.vue +21 -24
  92. package/dist/v3/{RunJS → DevTool/components/RunJS}/index.vue +3 -3
  93. package/dist/v3/{ScanCodeList → DevTool/components/ScanCodeList}/ScanCodeItem.vue +3 -4
  94. package/dist/v3/{ScanCodeList → DevTool/components/ScanCodeList}/index.vue +12 -16
  95. package/dist/v3/{SettingList → DevTool/components/SettingList}/index.vue +68 -0
  96. package/dist/v3/DevTool/components/SettingList/modules/SettingBarrage.vue +304 -0
  97. package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingDevTool.vue +8 -4
  98. package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingInfo.vue +47 -9
  99. package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingLanguage.vue +2 -2
  100. package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingLog.vue +2 -2
  101. package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingNetwork.vue +3 -3
  102. package/dist/v3/{SettingList → DevTool/components/SettingList}/modules/SettingTheme.vue +37 -7
  103. package/dist/v3/{SourceCode → DevTool/components/SourceCode}/Line.vue +22 -11
  104. package/dist/v3/{SourceCode → DevTool/components/SourceCode}/index.vue +8 -8
  105. package/dist/v3/{SourceCode → DevTool/components/SourceCode}/parseCode.ts +136 -228
  106. package/dist/v3/{StorageList → DevTool/components/StorageList}/index.vue +7 -7
  107. package/dist/v3/{TransferList → DevTool/components/TransferList}/TransferDetail.vue +6 -6
  108. package/dist/v3/{TransferList → DevTool/components/TransferList}/TransferItem.vue +4 -4
  109. package/dist/v3/{TransferList → DevTool/components/TransferList}/index.vue +8 -8
  110. package/dist/v3/{UniEvent → DevTool/components/UniEvent}/UniEventItem.vue +6 -7
  111. package/dist/v3/{UniEvent → DevTool/components/UniEvent}/index.vue +6 -6
  112. package/dist/v3/{VuexList → DevTool/components/VuexList}/index.vue +3 -3
  113. package/dist/v3/{WebSocket → DevTool/components/WebSocket}/WebSocketDetail.vue +8 -8
  114. package/dist/v3/{WebSocket → DevTool/components/WebSocket}/WebSocketItem.vue +4 -4
  115. package/dist/v3/{WebSocket → DevTool/components/WebSocket}/index.vue +8 -8
  116. package/dist/v3/DevTool/index.vue +179 -4
  117. package/dist/v3/{AppTransition → components/AppTransition}/index.vue +6 -0
  118. package/dist/v3/components/Barrage/BarrageItem.vue +137 -0
  119. package/dist/v3/components/Barrage/index.vue +202 -0
  120. package/dist/v3/components/DevErrorBoundary/index.vue +380 -0
  121. package/dist/v3/{DraggableContainer → components/DraggableContainer}/index.vue +1 -1
  122. package/dist/v3/{FilterInput → components/FilterInput}/index.vue +1 -1
  123. package/dist/v3/{JsonPretty → components/JsonPretty}/components/CheckController/index.vue +1 -1
  124. package/dist/v3/{JsonPretty → components/JsonPretty}/components/TreeNode/index.vue +11 -5
  125. package/dist/v3/{JsonPretty → components/JsonPretty}/index.vue +16 -13
  126. package/dist/v3/{JsonPretty → components/JsonPretty}/type.ts +1 -0
  127. package/dist/v3/{JsonPretty → components/JsonPretty}/utils/index.ts +1 -1
  128. package/dist/v3/{MovableContainer → components/MovableContainer}/index.vue +9 -5
  129. package/dist/v3/{Pick → components/Pick}/index.vue +1 -1
  130. package/dist/v3/{Tabs → components/Tabs}/index.vue +30 -4
  131. package/dist/v3/{VirtualList → components/VirtualList}/AutoSize.vue +1 -1
  132. package/dist/v3/{VirtualList → components/VirtualList}/index.vue +4 -0
  133. package/dist/v3/hooks/useBluetooth/index.ts +561 -0
  134. package/dist/v3/hooks/useRequest/index.ts +33 -20
  135. package/dist/v3/hooks/useWebsocket/README.md +79 -0
  136. package/dist/v3/hooks/useWebsocket/index.ts +253 -0
  137. package/dist/v3/styles/theme.css +17 -10
  138. package/package.json +67 -64
  139. package/dist/plugins/uniParseStock/index.d.ts +0 -10
  140. package/dist/plugins/uniParseStock/index.d.ts.map +0 -1
  141. /package/dist/v3/{ConsoleList → DevTool/components/ConsoleList}/staticTips.ts +0 -0
  142. /package/dist/v3/{DevToolTitle → DevTool/components/DevToolTitle}/index.vue +0 -0
  143. /package/dist/v3/{DevToolWindow → DevTool/components/DevToolWindow}/index.css +0 -0
  144. /package/dist/v3/{Instance → DevTool/components/Instance}/components/InstanceTreeNode.vue +0 -0
  145. /package/dist/v3/{Instance → DevTool/components/Instance}/flatten.ts +0 -0
  146. /package/dist/v3/{Instance → DevTool/components/Instance}/registry.ts +0 -0
  147. /package/dist/v3/{Instance → DevTool/components/Instance}/typing.d.ts +0 -0
  148. /package/dist/v3/{NFCList → DevTool/components/NFCList}/const.ts +0 -0
  149. /package/dist/v3/{NetworkList → DevTool/components/NetworkList}/const.ts +0 -0
  150. /package/dist/v3/{NetworkList → DevTool/components/NetworkList}/hooks/useNetworkForm.ts +0 -0
  151. /package/dist/v3/{NetworkList → DevTool/components/NetworkList}/utils.ts +0 -0
  152. /package/dist/v3/{Performance → DevTool/components/Performance}/modules/PerformanceMetrics.vue +0 -0
  153. /package/dist/v3/{SettingButton → DevTool/components/SettingButton}/index.vue +0 -0
  154. /package/dist/v3/{SettingList → DevTool/components/SettingList}/index.css +0 -0
  155. /package/dist/v3/{SettingList → DevTool/components/SettingList}/typing.d.ts +0 -0
  156. /package/dist/v3/{AutoSizer → components/AutoSizer}/index.vue +0 -0
  157. /package/dist/v3/{AutoSizer → components/AutoSizer}/index1.vue +0 -0
  158. /package/dist/v3/{AutoSizer → components/AutoSizer}/utils.ts +0 -0
  159. /package/dist/v3/{CircularButton → components/CircularButton}/index.vue +0 -0
  160. /package/dist/v3/{CustomSwiper → components/CustomSwiper}/CustomSwiperItem.vue +0 -0
  161. /package/dist/v3/{CustomSwiper → components/CustomSwiper}/index.vue +0 -0
  162. /package/dist/v3/{Empty → components/Empty}/empty.png +0 -0
  163. /package/dist/v3/{Empty → components/Empty}/index.vue +0 -0
  164. /package/dist/v3/{FilterSelect → components/FilterSelect}/index.vue +0 -0
  165. /package/dist/v3/{JsonPretty → components/JsonPretty}/components/Brackets/index.vue +0 -0
  166. /package/dist/v3/{JsonPretty → components/JsonPretty}/components/Carets/index.vue +0 -0
  167. /package/dist/v3/{JsonPretty → components/JsonPretty}/hooks/useClipboard.ts +0 -0
  168. /package/dist/v3/{JsonPretty → components/JsonPretty}/hooks/useError.ts +0 -0
  169. /package/dist/v3/{Tag → components/Tag}/index.vue +0 -0
  170. /package/dist/v3/{VirtualList → components/VirtualList}/readme.md +0 -0
@@ -1,8 +1,8 @@
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';
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
  }
@@ -1,6 +1,6 @@
1
1
  import { ref, reactive, shallowRef, nextTick } from 'vue';
2
- import type { DevTool } from '../../../type';
3
- import { isMockWX, isAndroid } from '../../../utils/index';
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
- if (isWXLink) {
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
- if (!isUseDevSource) return;
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 '../AppTransition/index.vue';
418
- import Tabs from '../Tabs/index.vue';
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 '../CustomSwiper/index.vue';
437
- import CustomSwiperItem from '../CustomSwiper/CustomSwiperItem.vue';
438
- import DraggableContainer from '../DraggableContainer/index.vue';
439
- import CircularButton from '../CircularButton/index.vue';
440
- import { useI18n } from '../../i18n';
441
-
442
- import { DEV_CORE_MESSAGE, MSG_TYPE, CMD_TYPE } from '../../const';
443
- import { getCurrentPagePath } from '../../utils/index';
444
- import type { DevTool } from '../../type';
445
- import { getDevToolInfo, setDevToolInfo } from '../../modules/devToolInfo';
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 ?? 10;
828
- windowY.value = devToolInfo.windowSettings.y ?? 100;
829
- windowWidth.value = devToolInfo.windowSettings.width ?? 375;
830
- windowHeight.value = devToolInfo.windowSettings.height ?? 450;
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 '../Tag/index.vue';
48
- import type { DevTool } from '../../type';
49
- import { formatDate } from '../../utils';
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> {{ t('elEvent.title') }} </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 '../Tag/index.vue';
45
- import Empty from '../Empty/index.vue';
46
- import VirtualList from '../VirtualList/index.vue';
47
- import AutoSize from '../VirtualList/AutoSize.vue';
48
- import type { DevTool } from '../../type';
49
- import { useI18n } from '../../i18n';
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 '../VirtualList/index.vue';
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';
@@ -1,4 +1,4 @@
1
- import { isArray, isObject, isString } from '../../utils';
1
+ import { isArray, isObject, isString } from '../../../../utils';
2
2
  import {
3
3
  type ComponentInternalInstance,
4
4
  type VNode,
@@ -1,4 +1,4 @@
1
- import { isArray, isObject, isString } from '../../utils';
1
+ import { isArray, isObject, isString } from '../../../../utils';
2
2
  import { isRef, isReactive } from 'vue';
3
3
  import { getRecordedChildren } from './registry';
4
4
 
@@ -149,12 +149,12 @@ import {
149
149
  markRaw,
150
150
  type ComponentInternalInstance,
151
151
  } from 'vue';
152
- import { useI18n } from '../../i18n';
153
- import Tag from '../Tag/index.vue';
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 '../Empty/index.vue';
157
- import JsonPretty from '../JsonPretty/index.vue';
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 '../CircularButton/index.vue';
24
- import JsonPretty from '../JsonPretty/index.vue';
25
- import type { DevTool } from '../../type';
26
- import { useI18n } from '../../i18n';
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 '../../type';
43
- import { formatDate, isMockWX } from '../../utils';
44
- import { useI18n } from '../../i18n';
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