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
@@ -57,10 +57,7 @@
57
57
  :placeholder="t('network.placeholderHeaderValue')"
58
58
  :value="item.value"
59
59
  @input="onChangeHeader($event, 'value', index)" />
60
- <CircularButton
61
- style="margin-left: 6px"
62
- text="一"
63
- @click="onDeleteHeader(item)" />
60
+ <CircularButton text="一" @click="onDeleteHeader(item)" />
64
61
  </view>
65
62
  </checkbox-group>
66
63
 
@@ -107,10 +104,7 @@
107
104
  :placeholder="t('network.placeholderParamValue')"
108
105
  :value="item.value"
109
106
  @input="onChangeQuery($event, 'value', index)" />
110
- <CircularButton
111
- text="一"
112
- style="margin-left: 6px"
113
- @click="onDeleteQuery(item)" />
107
+ <CircularButton text="一" @click="onDeleteQuery(item)" />
114
108
  </view>
115
109
  </checkbox-group>
116
110
 
@@ -150,11 +144,11 @@
150
144
  </template>
151
145
  <script lang="ts" setup>
152
146
  import { computed, ref, reactive, onMounted } from 'vue';
153
- import CircularButton from '../CircularButton/index.vue';
147
+ import CircularButton from '../../../components/CircularButton/index.vue';
154
148
  import DevToolTitle from '../DevToolTitle/index.vue';
155
- import type { DevTool } from '../../type';
156
- import { useI18n } from '../../i18n';
157
- import { getThemeMainColor } from '../styles/theme';
149
+ import type { DevTool } from '../../../../type';
150
+ import { useI18n } from '../../../../i18n';
151
+ import { getThemeMainColor } from '../../../styles/theme';
158
152
  const { t } = useI18n();
159
153
  const themeColor = computed(() => getThemeMainColor(props.theme));
160
154
 
@@ -468,7 +462,7 @@ onMounted(() => {
468
462
  }
469
463
 
470
464
  .network-send-form {
471
- height: calc(100% - 32px - 42px);
465
+ height: calc(100% - 32px - 56px);
472
466
  overflow: auto;
473
467
  }
474
468
 
@@ -481,52 +475,93 @@ onMounted(() => {
481
475
  box-sizing: border-box;
482
476
  }
483
477
 
478
+ .network-send-control:first-child {
479
+ margin-top: 0;
480
+ }
481
+
484
482
  .radio-group {
485
483
  display: flex;
486
484
  flex-wrap: wrap;
485
+ gap: 8px 0; /* Add gap between rows if wrapped */
487
486
  }
488
487
 
489
488
  .radio-group-item {
490
489
  display: flex;
491
490
  align-items: center;
492
491
  width: 25%;
493
- margin-bottom: 6px;
492
+ font-size: 14px;
494
493
  }
495
494
 
496
495
  .network-input {
497
- padding: 0 6px;
496
+ width: 100%;
497
+ box-sizing: border-box;
498
+ padding: 0 8px;
498
499
  height: 24px;
500
+ font-size: 14px;
501
+ border-radius: 4px;
499
502
  border: 1px solid var(--dev-tool-border-color);
503
+ background-color: transparent;
504
+ transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
505
+ color: var(--dev-tool-text-color, inherit);
506
+ }
507
+
508
+ .network-input:focus {
509
+ border-color: var(--dev-tool-primary-color, #9254de);
510
+ box-shadow: 0 0 0 2px rgb(146 84 222 / 10%);
500
511
  }
501
512
 
502
513
  .network-textarea {
503
- padding: 6px;
514
+ padding: 8px;
504
515
  width: 100%;
505
516
  box-sizing: border-box;
506
- font-size: 12px;
517
+ font-size: 14px;
518
+ border-radius: 4px;
507
519
  border: 1px solid var(--dev-tool-border-color);
520
+ background-color: transparent;
521
+ transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
522
+ color: var(--dev-tool-text-color, inherit);
523
+ min-height: 80px;
524
+ }
525
+
526
+ .network-textarea:focus {
527
+ border-color: var(--dev-tool-primary-color, #9254de);
528
+ box-shadow: 0 0 0 2px rgb(146 84 222 / 10%);
508
529
  }
509
530
 
510
531
  .form-error-message {
511
- padding: 0 6px;
532
+ padding: 4px 6px;
512
533
  height: 24px;
513
534
  line-height: 24px;
514
- color: red;
535
+ color: #ff4d4f; /* softer red */
536
+ font-size: 12px;
515
537
  }
516
538
 
517
- .network-header-item {
539
+ .network-header-list,
540
+ .network-param-list {
541
+ display: flex;
542
+ flex-direction: column;
543
+ gap: 8px;
544
+ margin-bottom: 8px;
545
+ }
546
+
547
+ .network-header-item,
548
+ .network-param-item {
518
549
  display: flex;
519
550
  align-items: center;
551
+ gap: 8px;
552
+ }
553
+
554
+ .network-header-item .network-input,
555
+ .network-param-item .network-input {
556
+ flex: 1;
557
+ min-width: 0; /* Prevents flex item from overflowing */
520
558
  }
521
559
 
522
560
  .network-empty {
523
561
  color: var(--dev-tool-info-color);
524
562
  text-align: center;
525
- }
526
-
527
- .network-param-item {
528
- display: flex;
529
- align-items: center;
563
+ padding: 12px 0;
564
+ font-size: 13px;
530
565
  }
531
566
 
532
567
  .network-body-data-item {
@@ -538,19 +573,17 @@ onMounted(() => {
538
573
  position: sticky;
539
574
  display: flex;
540
575
  justify-content: space-between;
541
-
542
- /* gap: 6px; */
576
+ gap: 12px;
543
577
  width: 100%;
544
- margin-top: 12px;
578
+ margin-top: 16px;
579
+ padding-bottom: 16px;
545
580
  background-color: var(--dev-tool-bg3-color);
546
581
  }
547
582
 
548
- .network-send-button {
549
- width: 100%;
550
- margin-right: 6px;
551
- }
552
-
583
+ .network-send-button,
553
584
  .network-send-button-last {
554
- width: 100%;
585
+ flex: 1;
586
+ margin: 0 !important; /* override default margin */
587
+ border-radius: 6px;
555
588
  }
556
589
  </style>
@@ -58,18 +58,18 @@
58
58
  </view>
59
59
  </template>
60
60
  <script lang="ts" setup>
61
- import Tag from '../Tag/index.vue';
61
+ import Tag from '../../../components/Tag/index.vue';
62
62
  import NetworkItem from './NetworkItem.vue';
63
- import Empty from '../Empty/index.vue';
64
- import FilterInput from '../FilterInput/index.vue';
65
- import Pick from '../Pick/index.vue';
66
- import type { DevTool } from '../../type';
67
- import VirtualList from '../VirtualList/index.vue';
68
- import AutoSize from '../VirtualList/AutoSize.vue';
63
+ import Empty from '../../../components/Empty/index.vue';
64
+ import FilterInput from '../../../components/FilterInput/index.vue';
65
+ import Pick from '../../../components/Pick/index.vue';
66
+ import type { DevTool } from '../../../../type';
67
+ import VirtualList from '../../../components/VirtualList/index.vue';
68
+ import AutoSize from '../../../components/VirtualList/AutoSize.vue';
69
69
  import DevToolTitle from '../DevToolTitle/index.vue';
70
70
 
71
71
  import { sortMap } from './const';
72
- import { useI18n } from '../../i18n';
72
+ import { useI18n } from '../../../../i18n';
73
73
  import { computed } from 'vue';
74
74
 
75
75
  const { t } = useI18n();
@@ -136,14 +136,17 @@
136
136
 
137
137
  <script setup lang="ts">
138
138
  import { ref, computed, onMounted, onUnmounted, getCurrentInstance } from 'vue';
139
- import { getDevToolInfo, setDevToolInfo } from '../../modules/devToolInfo';
139
+ import {
140
+ getDevToolInfo,
141
+ setDevToolInfo,
142
+ } from '../../../../modules/devToolInfo';
140
143
  import PerformanceMetrics from './modules/PerformanceMetrics.vue';
141
144
  import { usePerformanceData } from './modules/usePerformanceData';
142
145
  import { usePerformanceChart } from './modules/usePerformanceChart';
143
- import { MSG_TYPE, DEV_CORE_MESSAGE } from '../../const';
146
+ import { MSG_TYPE, DEV_CORE_MESSAGE } from '../../../../const';
144
147
  import DevToolTitle from '../DevToolTitle/index.vue';
145
- import { useI18n } from '../../i18n';
146
- import { getThemeMainColor } from '../styles/theme';
148
+ import { useI18n } from '../../../../i18n';
149
+ import { getThemeMainColor } from '../../../styles/theme';
147
150
  const { t } = useI18n();
148
151
  const themeColor = computed(() => getThemeMainColor(props.theme));
149
152
 
@@ -39,14 +39,17 @@
39
39
 
40
40
  <script setup lang="ts">
41
41
  import { computed, onMounted, onUnmounted, getCurrentInstance, ref } from 'vue';
42
- import DraggableContainer from '../../DraggableContainer/index.vue';
42
+ import DraggableContainer from '../../../../components/DraggableContainer/index.vue';
43
43
  import PerformanceMetrics from './PerformanceMetrics.vue';
44
44
  import { usePerformanceData } from './usePerformanceData';
45
45
  import { usePerformanceChart } from './usePerformanceChart';
46
- import CircularButton from '../../CircularButton/index.vue';
47
- import { MSG_TYPE, DEV_CORE_MESSAGE } from '../../../const';
48
- import { getDevToolInfo, setDevToolInfo } from '../../../modules/devToolInfo';
49
- import { debounce } from '../../../utils';
46
+ import CircularButton from '../../../../components/CircularButton/index.vue';
47
+ import { MSG_TYPE, DEV_CORE_MESSAGE } from '../../../../../const';
48
+ import {
49
+ getDevToolInfo,
50
+ setDevToolInfo,
51
+ } from '../../../../../modules/devToolInfo';
52
+ import { debounce } from '../../../../../utils';
50
53
 
51
54
  const props = withDefaults(
52
55
  defineProps<{
@@ -179,12 +182,12 @@ const onMonitorChange = (enabled: boolean) => {
179
182
  onMounted(() => {
180
183
  const info = getDevToolInfo();
181
184
  if (info && info.performancePosition) {
182
- x.value = info.performancePosition.left;
183
- y.value = info.performancePosition.top;
185
+ x.value = Number(info.performancePosition.left) || 10;
186
+ y.value = Number(info.performancePosition.top) || 200;
184
187
  if (info.performancePosition.width)
185
- width.value = info.performancePosition.width;
188
+ width.value = Number(info.performancePosition.width) || 240;
186
189
  if (info.performancePosition.height)
187
- height.value = info.performancePosition.height;
190
+ height.value = Number(info.performancePosition.height) || 180;
188
191
  }
189
192
  loadSettings();
190
193
 
@@ -1,5 +1,5 @@
1
1
  import { ref, computed, nextTick } from 'vue';
2
- import { raf, caf } from '../../../utils';
2
+ import { raf, caf } from '../../../../../utils';
3
3
 
4
4
  export function usePerformanceChart(opts: {
5
5
  theme: any;
@@ -1,6 +1,6 @@
1
1
  import { ref } from 'vue';
2
- import { MSG_TYPE } from '../../../const';
3
- import { raf, caf } from '../../../utils';
2
+ import { MSG_TYPE } from '../../../../../const';
3
+ import { raf, caf } from '../../../../../utils';
4
4
 
5
5
  const fps = ref(0);
6
6
  const cpuLoad = ref(0);
@@ -15,19 +15,18 @@
15
15
  :nodeSelectable="() => false"
16
16
  :pathCollapsible="() => false"
17
17
  @update:data="onUpdateData"
18
- @nodeClick="onNodeClick"
19
- />
18
+ @nodeClick="onNodeClick" />
20
19
  <Empty v-else />
21
20
  </view>
22
21
  </view>
23
22
  </template>
24
23
  <script lang="ts" setup>
25
24
  import { computed } from 'vue';
26
- import JsonPretty from '../JsonPretty/index.vue';
27
- import Empty from '../Empty/index.vue';
25
+ import JsonPretty from '../../../components/JsonPretty/index.vue';
26
+ import Empty from '../../../components/Empty/index.vue';
28
27
  import DevToolTitle from '../DevToolTitle/index.vue';
29
- import { getValueByPath } from '../../utils';
30
- import { useI18n } from '../../i18n';
28
+ import { getValueByPath } from '../../../../utils';
29
+ import { useI18n } from '../../../../i18n';
31
30
 
32
31
  const { t } = useI18n();
33
32
 
@@ -8,8 +8,7 @@
8
8
  :placeholder="t('common.searchNamePath')"
9
9
  :modelValue="modelValue"
10
10
  @search="emit('search', $event)"
11
- @update:modelValue="emit('update:modelValue', $event)"
12
- />
11
+ @update:modelValue="emit('update:modelValue', $event)" />
13
12
  <Tag mode="clear" @click="onRefresh">{{ t('common.refresh') }}</Tag>
14
13
  </view>
15
14
 
@@ -17,16 +16,15 @@
17
16
  :data="routeList"
18
17
  :pageSize="15"
19
18
  :height="contentHeight - 32 - 32"
20
- className="route-list"
21
- >
19
+ :dataChangeScrollToTop="false"
20
+ className="route-list">
22
21
  <template v-slot="{ list, start, itemsHeight, onSizeChange }">
23
22
  <AutoSize
24
23
  v-for="(item, index) in list"
25
24
  :index="start + index"
26
25
  :key="start + index"
27
26
  :itemsHeight="itemsHeight"
28
- :onSizeChange="onSizeChange"
29
- >
27
+ :onSizeChange="onSizeChange">
30
28
  <view class="route-item">
31
29
  <view class="route-item-name">
32
30
  <view v-html="item.name" />
@@ -44,8 +42,7 @@
44
42
  mode="main"
45
43
  style="margin-left: auto"
46
44
  customStyle="margin-left: auto"
47
- @click="onGoTo(item)"
48
- >
45
+ @click="onGoTo(item)">
49
46
  {{ t('common.navigate') }}
50
47
  </Tag>
51
48
  </view>
@@ -71,14 +68,14 @@
71
68
  </view>
72
69
  </view>
73
70
  <view class="route-item-info">
74
- <view
75
- >{{ t('route.lastDuration') }}:
76
- {{ formatDuration(item.duration) }}</view
77
- >
78
- <view
79
- >{{ t('route.totalDuration') }}:
80
- {{ formatDuration(item.totalDuration) }}</view
81
- >
71
+ <view>
72
+ {{ t('route.lastDuration') }}:
73
+ {{ formatDuration(item.duration) }}
74
+ </view>
75
+ <view>
76
+ {{ t('route.totalDuration') }}:
77
+ {{ formatDuration(item.totalDuration) }}
78
+ </view>
82
79
  </view>
83
80
  </view>
84
81
  </AutoSize>
@@ -88,15 +85,15 @@
88
85
  </view>
89
86
  </template>
90
87
  <script lang="ts" setup>
91
- import Tag from '../Tag/index.vue';
92
- import Empty from '../Empty/index.vue';
93
- import FilterInput from '../FilterInput/index.vue';
94
- import type { DevTool } from '../../type';
95
- import VirtualList from '../VirtualList/index.vue';
96
- import AutoSize from '../VirtualList/AutoSize.vue';
97
- import { formatDate, formatDuration } from '../../utils';
88
+ import Tag from '../../../components/Tag/index.vue';
89
+ import Empty from '../../../components/Empty/index.vue';
90
+ import FilterInput from '../../../components/FilterInput/index.vue';
91
+ import type { DevTool } from '../../../../type';
92
+ import VirtualList from '../../../components/VirtualList/index.vue';
93
+ import AutoSize from '../../../components/VirtualList/AutoSize.vue';
94
+ import { formatDate, formatDuration } from '../../../../utils';
98
95
  import DevToolTitle from '../DevToolTitle/index.vue';
99
- import { useI18n } from '../../i18n';
96
+ import { useI18n } from '../../../../i18n';
100
97
 
101
98
  const { t } = useI18n();
102
99
 
@@ -34,9 +34,9 @@
34
34
  </template>
35
35
  <script lang="ts" setup>
36
36
  import { ref } from 'vue';
37
- import type { DevTool } from '../../type';
38
- import FilterInput from '../FilterInput/index.vue';
39
- import Tag from '../Tag/index.vue';
37
+ import type { DevTool } from '../../../../type';
38
+ import FilterInput from '../../../components/FilterInput/index.vue';
39
+ import Tag from '../../../components/Tag/index.vue';
40
40
 
41
41
  defineProps<{ runJSList: DevTool.RunJSItem[]; modelValue: string }>();
42
42
 
@@ -19,16 +19,15 @@
19
19
 
20
20
  <view
21
21
  :class="`scan-code-item-right ${isUseDevSource ? 'link' : ''}`"
22
- @click="emit('openCode', scanCodeItem?.stack)"
23
- >
22
+ @click="emit('openCode', scanCodeItem?.stack)">
24
23
  {{ scanCodeItem?.stack }}
25
24
  </view>
26
25
  </view>
27
26
  </template>
28
27
  <script lang="ts" setup>
29
28
  import { computed } from 'vue';
30
- import type { DevTool } from '../../type';
31
- import { formatDate, isMockWX } from '../../utils';
29
+ import type { DevTool } from '../../../../type';
30
+ import { formatDate, isMockWX } from '../../../../utils';
32
31
 
33
32
  const props = defineProps<{
34
33
  scanCodeItem: DevTool.ScanCodeItem;
@@ -1,16 +1,15 @@
1
1
  <template>
2
2
  <view class="scan-code-content">
3
3
  <view class="scan-code-control">
4
- <DevToolTitle> {{ t('scanCode.title') }} </DevToolTitle>
4
+ <DevToolTitle>{{ t('scanCode.title') }}</DevToolTitle>
5
5
  <Tag
6
6
  mode="clear"
7
7
  style="margin: 0 16px 0 auto"
8
8
  customStyle="margin:0 16px 0 auto"
9
- @click="onClickScanCode"
10
- >
9
+ @click="onClickScanCode">
11
10
  {{ t('common.scan') }}
12
11
  </Tag>
13
- <Tag mode="clear" @click="emit('clear')"> {{ t('common.clear') }} </Tag>
12
+ <Tag mode="clear" @click="emit('clear')">{{ t('common.clear') }}</Tag>
14
13
  </view>
15
14
 
16
15
  <VirtualList
@@ -19,8 +18,7 @@
19
18
  :pageSize="20"
20
19
  :height="contentHeight - 32 * 2"
21
20
  :data="scanCodeList"
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,15 +26,13 @@
28
26
  :index="start + index"
29
27
  :id="`dev-scan-code${index}`"
30
28
  :itemsHeight="itemsHeight"
31
- :onSizeChange="onSizeChange"
32
- >
29
+ :onSizeChange="onSizeChange">
33
30
  <ScanCodeItem
34
31
  :scanCodeItem="item"
35
32
  :mode="mode"
36
33
  :useDevSource="useDevSource"
37
34
  @openJson="emit('openJson', $event)"
38
- @openCode="emit('openCode', $event)"
39
- />
35
+ @openCode="emit('openCode', $event)" />
40
36
  </AutoSize>
41
37
  </template>
42
38
  </VirtualList>
@@ -47,12 +43,12 @@
47
43
  <script lang="ts" setup>
48
44
  import DevToolTitle from '../DevToolTitle/index.vue';
49
45
  import ScanCodeItem from './ScanCodeItem.vue';
50
- import Tag from '../Tag/index.vue';
51
- import Empty from '../Empty/index.vue';
52
- import VirtualList from '../VirtualList/index.vue';
53
- import AutoSize from '../VirtualList/AutoSize.vue';
54
- import type { DevTool } from '../../type';
55
- import { useI18n } from '../../i18n';
46
+ import Tag from '../../../components/Tag/index.vue';
47
+ import Empty from '../../../components/Empty/index.vue';
48
+ import VirtualList from '../../../components/VirtualList/index.vue';
49
+ import AutoSize from '../../../components/VirtualList/AutoSize.vue';
50
+ import type { DevTool } from '../../../../type';
51
+ import { useI18n } from '../../../../i18n';
56
52
 
57
53
  const { t } = useI18n();
58
54
 
@@ -39,6 +39,25 @@
39
39
  :cache-console-log="cacheConsoleLog"
40
40
  @export-log="onExportLog"
41
41
  @change-cache-console-log="onChangeCacheConsoleLog" />
42
+ <SettingBarrage
43
+ :theme="theme"
44
+ :barrage-visible="barrageVisible"
45
+ :barrage-max-tracks="barrageMaxTracks"
46
+ :barrage-track-height="barrageTrackHeight"
47
+ :barrage-start-top="barrageStartTop"
48
+ :barrage-duration="barrageDuration"
49
+ :barrage-max-length="barrageMaxLength"
50
+ :barrage-types="barrageTypes"
51
+ :barrage-show-when-open="barrageShowWhenOpen"
52
+ :sizeFormat="sizeFormat"
53
+ @change-barrage="onChangeBarrage"
54
+ @change-barrage-max-tracks="onChangeBarrageMaxTracks"
55
+ @change-barrage-track-height="onChangeBarrageTrackHeight"
56
+ @change-barrage-start-top="onChangeBarrageStartTop"
57
+ @change-barrage-duration="onChangeBarrageDuration"
58
+ @change-barrage-max-length="onChangeBarrageMaxLength"
59
+ @change-barrage-types="onChangeBarrageTypes"
60
+ @change-barrage-show-when-open="onChangeBarrageShowWhenOpen" />
42
61
  </scroll-view>
43
62
  </template>
44
63
 
@@ -49,6 +68,7 @@ import SettingNetwork from './modules/SettingNetwork.vue';
49
68
  import SettingTheme from './modules/SettingTheme.vue';
50
69
  import SettingInfo from './modules/SettingInfo.vue';
51
70
  import SettingLog from './modules/SettingLog.vue';
71
+ import SettingBarrage from './modules/SettingBarrage.vue';
52
72
 
53
73
  defineProps<{
54
74
  theme?: string; // Added theme prop here as per instruction for SettingLanguage
@@ -57,12 +77,20 @@ defineProps<{
57
77
  cacheInterceptConfig?: boolean;
58
78
  cacheNetworkLog?: boolean;
59
79
  cacheConsoleLog?: boolean;
80
+ barrageVisible?: boolean;
60
81
  useTransition?: boolean;
61
82
  baseFontSize?: number;
62
83
  tagFontSize?: number;
63
84
  tipsFontSize?: number;
64
85
  fontFamily?: string;
65
86
  fontWeight?: string;
87
+ barrageMaxTracks?: number; // 新增
88
+ barrageTrackHeight?: number; // 新增
89
+ barrageStartTop?: number; // 新增
90
+ barrageDuration?: number; // 时长
91
+ barrageMaxLength?: number; // 长度
92
+ barrageTypes?: string[]; // 类型
93
+ barrageShowWhenOpen?: boolean;
66
94
  buildInfo?: {
67
95
  devToolVersion?: string;
68
96
  devToolBuildTime?: string;
@@ -87,6 +115,14 @@ const emit = defineEmits<{
87
115
  (e: 'change-cache-intercept-config', value: boolean): void;
88
116
  (e: 'change-cache-network-log', value: boolean): void;
89
117
  (e: 'change-cache-console-log', value: boolean): void;
118
+ (e: 'change-barrage', value: boolean): void;
119
+ (e: 'change-barrage-max-tracks', value: number): void;
120
+ (e: 'change-barrage-track-height', value: number): void;
121
+ (e: 'change-barrage-start-top', value: number): void;
122
+ (e: 'change-barrage-duration', value: number): void;
123
+ (e: 'change-barrage-max-length', value: number): void;
124
+ (e: 'change-barrage-types', value: string[]): void;
125
+ (e: 'change-barrage-show-when-open', value: boolean): void;
90
126
  (e: 'change-use-transition', value: boolean): void;
91
127
  (e: 'changeFont', data: any): void;
92
128
  (e: 'openJson', data: any): void;
@@ -124,6 +160,38 @@ function onChangeCacheConsoleLog(v: boolean) {
124
160
  emit('change-cache-console-log', v);
125
161
  }
126
162
 
163
+ function onChangeBarrageDuration(v: number) {
164
+ emit('change-barrage-duration', v);
165
+ }
166
+
167
+ function onChangeBarrageMaxLength(v: number) {
168
+ emit('change-barrage-max-length', v);
169
+ }
170
+
171
+ function onChangeBarrageTypes(v: string[]) {
172
+ emit('change-barrage-types', v);
173
+ }
174
+
175
+ function onChangeBarrageShowWhenOpen(v: boolean) {
176
+ emit('change-barrage-show-when-open', v);
177
+ }
178
+
179
+ function onChangeBarrage(v: boolean) {
180
+ emit('change-barrage', v);
181
+ }
182
+
183
+ function onChangeBarrageMaxTracks(v: number) {
184
+ emit('change-barrage-max-tracks', v);
185
+ }
186
+
187
+ function onChangeBarrageTrackHeight(v: number) {
188
+ emit('change-barrage-track-height', v);
189
+ }
190
+
191
+ function onChangeBarrageStartTop(v: number) {
192
+ emit('change-barrage-start-top', v);
193
+ }
194
+
127
195
  function onChangeTheme(v: string) {
128
196
  emit('changeTheme', v);
129
197
  }