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
@@ -0,0 +1,304 @@
1
+ <template>
2
+ <view class="setting-item" :class="theme">
3
+ <DevToolTitle>{{ t('common.barrage') }}</DevToolTitle>
4
+ <view class="setting-item-content">
5
+ <!-- 开启弹幕 -->
6
+ <view class="setting-row">
7
+ <view class="setting-label">{{ t('common.enableBarrage') }}</view>
8
+ <switch
9
+ :checked="barrageVisible"
10
+ @change="onBarrageChange"
11
+ color="var(--dev-tool-main-color)"
12
+ style="transform: scale(0.7)" />
13
+ </view>
14
+
15
+ <!-- 主窗口打开时显示 -->
16
+ <view v-if="barrageVisible" class="setting-row">
17
+ <view class="setting-label">{{ t('common.barrageShowWhenOpen') }}</view>
18
+ <switch
19
+ :checked="barrageShowWhenOpen"
20
+ @change="onBarrageShowWhenOpenChange"
21
+ color="var(--dev-tool-main-color)"
22
+ style="transform: scale(0.7)" />
23
+ </view>
24
+
25
+ <view v-if="barrageVisible" class="barrage-advanced">
26
+ <!-- 轨道数量 -->
27
+ <view class="setting-row-group">
28
+ <view class="setting-row-header">
29
+ <view class="setting-label">
30
+ {{ t('common.barrageMaxTracks') }}
31
+ </view>
32
+ <view class="setting-value">{{ barrageMaxTracks }}</view>
33
+ </view>
34
+ <slider
35
+ class="barrage-slider"
36
+ :value="barrageMaxTracks"
37
+ min="1"
38
+ max="20"
39
+ step="1"
40
+ activeColor="var(--dev-tool-main-color)"
41
+ backgroundColor="var(--dev-tool-border-color)"
42
+ block-size="16"
43
+ @change="onMaxTracksChange" />
44
+ </view>
45
+
46
+ <!-- 轨道高度 -->
47
+ <view class="setting-row-group">
48
+ <view class="setting-row-header">
49
+ <view class="setting-label">
50
+ {{ t('common.barrageTrackHeight') }}
51
+ </view>
52
+ <view class="setting-value">{{ barrageTrackHeight }}px</view>
53
+ </view>
54
+ <slider
55
+ class="barrage-slider"
56
+ :value="barrageTrackHeight"
57
+ min="20"
58
+ max="60"
59
+ step="2"
60
+ activeColor="var(--dev-tool-main-color)"
61
+ backgroundColor="var(--dev-tool-border-color)"
62
+ block-size="16"
63
+ @change="onTrackHeightChange" />
64
+ </view>
65
+
66
+ <!-- 起始高度 -->
67
+ <view class="setting-row-group">
68
+ <view class="setting-row-header">
69
+ <view class="setting-label">{{ t('common.barrageStartTop') }}</view>
70
+ <view class="setting-value">{{ barrageStartTop }}px</view>
71
+ </view>
72
+ <slider
73
+ class="barrage-slider"
74
+ :value="barrageStartTop"
75
+ min="0"
76
+ max="200"
77
+ step="5"
78
+ activeColor="var(--dev-tool-main-color)"
79
+ backgroundColor="var(--dev-tool-border-color)"
80
+ block-size="16"
81
+ @change="onStartTopChange" />
82
+ </view>
83
+
84
+ <!-- 弹幕停留时长 -->
85
+ <view class="setting-row-group">
86
+ <view class="setting-row-header">
87
+ <view class="setting-label">{{ t('common.barrageDuration') }}</view>
88
+ <view class="setting-value">{{ barrageDuration }}s</view>
89
+ </view>
90
+ <slider
91
+ class="barrage-slider"
92
+ :value="barrageDuration"
93
+ min="3"
94
+ max="20"
95
+ step="1"
96
+ activeColor="var(--dev-tool-main-color)"
97
+ backgroundColor="var(--dev-tool-border-color)"
98
+ block-size="16"
99
+ @change="onDurationChange" />
100
+ </view>
101
+
102
+ <!-- 弹幕文字截断长度 -->
103
+ <view class="setting-row-group">
104
+ <view class="setting-row-header">
105
+ <view class="setting-label">
106
+ {{ t('common.barrageMaxLength') }}
107
+ </view>
108
+ <view class="setting-value">{{ barrageMaxLength }}</view>
109
+ </view>
110
+ <slider
111
+ class="barrage-slider"
112
+ :value="barrageMaxLength"
113
+ min="10"
114
+ max="500"
115
+ step="10"
116
+ activeColor="var(--dev-tool-main-color)"
117
+ backgroundColor="var(--dev-tool-border-color)"
118
+ block-size="16"
119
+ @change="onMaxLengthChange" />
120
+ </view>
121
+
122
+ <!-- 显示类型 -->
123
+ <view class="setting-row-group">
124
+ <view class="setting-row-header">
125
+ <view class="setting-label">{{ t('common.barrageTypes') }}</view>
126
+ </view>
127
+ <checkbox-group class="type-checkbox-group" @change="onTypesChange">
128
+ <label
129
+ v-for="item in allTypes"
130
+ :key="item"
131
+ class="type-checkbox-item">
132
+ <checkbox
133
+ :value="item"
134
+ :checked="(barrageTypes || []).includes(item)"
135
+ color="var(--dev-tool-main-color)"
136
+ style="transform: scale(0.8)" />
137
+ <text class="type-checkbox-label">{{ item }}</text>
138
+ </label>
139
+ </checkbox-group>
140
+ </view>
141
+ </view>
142
+ </view>
143
+ </view>
144
+ </template>
145
+
146
+ <script lang="ts" setup>
147
+ import { useI18n } from '../../../../../i18n';
148
+ import DevToolTitle from '../../DevToolTitle/index.vue';
149
+
150
+ const { t } = useI18n();
151
+
152
+ const props = defineProps<{
153
+ theme?: string;
154
+ barrageVisible?: boolean;
155
+ barrageMaxTracks?: number;
156
+ barrageTrackHeight?: number;
157
+ barrageStartTop?: number;
158
+ barrageDuration?: number;
159
+ barrageMaxLength?: number;
160
+ barrageTypes?: string[];
161
+ barrageShowWhenOpen?: boolean;
162
+ }>();
163
+
164
+ const emit = defineEmits<{
165
+ (e: 'change-barrage', value: boolean): void;
166
+ (e: 'change-barrage-max-tracks', value: number): void;
167
+ (e: 'change-barrage-track-height', value: number): void;
168
+ (e: 'change-barrage-start-top', value: number): void;
169
+ (e: 'change-barrage-duration', value: number): void;
170
+ (e: 'change-barrage-max-length', value: number): void;
171
+ (e: 'change-barrage-types', value: string[]): void;
172
+ (e: 'change-barrage-show-when-open', value: boolean): void;
173
+ }>();
174
+
175
+ const allTypes = [
176
+ 'log',
177
+ 'info',
178
+ 'warn',
179
+ 'error',
180
+ 'network',
181
+ 'transfer',
182
+ 'websocket',
183
+ ];
184
+
185
+ function onBarrageChange(e: any) {
186
+ emit('change-barrage', e.detail.value);
187
+ }
188
+
189
+ function onBarrageShowWhenOpenChange(e: any) {
190
+ emit('change-barrage-show-when-open', !!e.detail.value);
191
+ }
192
+
193
+ function onMaxTracksChange(e: any) {
194
+ emit('change-barrage-max-tracks', e.detail.value);
195
+ }
196
+
197
+ function onTrackHeightChange(e: any) {
198
+ emit('change-barrage-track-height', e.detail.value);
199
+ }
200
+
201
+ function onStartTopChange(e: any) {
202
+ emit('change-barrage-start-top', e.detail.value);
203
+ }
204
+
205
+ function onDurationChange(e: any) {
206
+ emit('change-barrage-duration', e.detail.value);
207
+ }
208
+
209
+ function onMaxLengthChange(e: any) {
210
+ emit('change-barrage-max-length', e.detail.value);
211
+ }
212
+
213
+ function onTypesChange(e: any) {
214
+ let values = e.detail.value;
215
+ // 如果全部取消,至少保留一个之前的
216
+ if (
217
+ values.length === 0 &&
218
+ props.barrageTypes &&
219
+ props.barrageTypes.length > 0
220
+ ) {
221
+ // 这里可以根据需求决定是否强制保留,暂时跟随用户操作
222
+ }
223
+ emit('change-barrage-types', values);
224
+ }
225
+ </script>
226
+
227
+ <style scoped>
228
+ .setting-item {
229
+ padding: 12px 16px;
230
+ border-bottom: 1px solid var(--dev-tool-border-color);
231
+ }
232
+
233
+ .setting-item-header {
234
+ margin-bottom: 12px;
235
+ }
236
+
237
+ .setting-item-title {
238
+ font-size: 14px;
239
+ font-weight: bold;
240
+ color: var(--dev-tool-text-color);
241
+ }
242
+
243
+ .barrage-advanced {
244
+ margin-top: 8px;
245
+ padding-top: 8px;
246
+ border-top: 1px dashed var(--dev-tool-border-color);
247
+ }
248
+
249
+ .setting-row {
250
+ display: flex;
251
+ justify-content: space-between;
252
+ align-items: center;
253
+ height: 36px;
254
+ }
255
+
256
+ .setting-row-group {
257
+ margin-top: 12px;
258
+ }
259
+
260
+ .setting-row-header {
261
+ display: flex;
262
+ justify-content: space-between;
263
+ align-items: center;
264
+ margin-bottom: 4px;
265
+ }
266
+
267
+ .setting-label {
268
+ font-size: 12px;
269
+ color: var(--dev-tool-text-color-secondary);
270
+ }
271
+
272
+ .setting-value {
273
+ font-size: 12px;
274
+ font-weight: 500;
275
+ color: var(--dev-tool-main-color);
276
+ background: rgb(0 122 255 / 10%);
277
+ padding: 2px 6px;
278
+ border-radius: 4px;
279
+ }
280
+
281
+ .barrage-slider {
282
+ margin: 0;
283
+ padding: 8px 0;
284
+ }
285
+
286
+ .type-checkbox-group {
287
+ display: flex;
288
+ flex-wrap: wrap;
289
+ gap: 12px;
290
+ margin-top: 8px;
291
+ }
292
+
293
+ .type-checkbox-item {
294
+ display: flex;
295
+ align-items: center;
296
+ margin-right: 4px;
297
+ }
298
+
299
+ .type-checkbox-label {
300
+ font-size: 12px;
301
+ color: var(--dev-tool-text-color);
302
+ margin-left: -4px;
303
+ }
304
+ </style>
@@ -106,11 +106,14 @@
106
106
  import { onMounted, ref, computed } from 'vue';
107
107
  import DevToolTitle from '../../DevToolTitle/index.vue';
108
108
  import SettingButton from '../../SettingButton/index.vue';
109
- import { openOutLink } from '../../../utils';
110
- import { useI18n } from '../../../i18n';
109
+ import { openOutLink } from '../../../../../utils';
110
+ import { useI18n } from '../../../../../i18n';
111
111
  import { getTabItems } from '../../DevToolWindow/const';
112
- import { getDevToolInfo, setDevToolInfo } from '../../../modules/devToolInfo';
113
- import { getThemeMainColor } from '../../styles/theme';
112
+ import {
113
+ getDevToolInfo,
114
+ setDevToolInfo,
115
+ } from '../../../../../modules/devToolInfo';
116
+ import { getThemeMainColor } from '../../../../styles/theme';
114
117
 
115
118
  const { t } = useI18n();
116
119
 
@@ -169,6 +172,7 @@ onMounted(() => {
169
172
  'CaptureScreen',
170
173
  'ScanCode',
171
174
  'NFC',
175
+ 'Bluetooth',
172
176
  'ElEvent',
173
177
  'UniEvent',
174
178
  ];
@@ -2,6 +2,40 @@
2
2
  <view class="setting-item">
3
3
  <DevToolTitle>{{ t('setting.info.title') }}</DevToolTitle>
4
4
  <view class="setting-item-content">
5
+ <template v-if="systemInfoBase">
6
+ <view class="setting-row">
7
+ <view>{{ t('setting.info.systemEnv') }}:</view>
8
+ <view>
9
+ {{ systemInfoBase.osName }} {{ systemInfoBase.osVersion }}
10
+ </view>
11
+ </view>
12
+ <view class="setting-row">
13
+ <view>{{ t('setting.info.deviceBrand') }}:</view>
14
+ <view>
15
+ {{ systemInfoBase.deviceBrand }} {{ systemInfoBase.deviceModel }}
16
+ </view>
17
+ </view>
18
+ <view class="setting-row">
19
+ <view>{{ t('setting.info.hostVersion') }}:</view>
20
+ <view>
21
+ {{ systemInfoBase.hostName }} {{ systemInfoBase.hostVersion }}
22
+ </view>
23
+ </view>
24
+ <view class="setting-row">
25
+ <view>{{ t('setting.info.sdkVersion') }}:</view>
26
+ <view>{{ systemInfoBase.hostSDKVersion || 'N/A' }}</view>
27
+ </view>
28
+ <view class="setting-row">
29
+ <view>{{ t('setting.info.platform') }}:</view>
30
+ <view>{{ systemInfoBase.uniPlatform }}</view>
31
+ </view>
32
+ <view class="setting-row">
33
+ <SettingButton @click="onLookSystemInfo">
34
+ {{ t('setting.info.viewSystem') }}
35
+ </SettingButton>
36
+ </view>
37
+ </template>
38
+
5
39
  <view class="setting-row">{{ t('setting.info.viewWindow') }}:</view>
6
40
  <view class="setting-tips">
7
41
  {{ t('setting.info.viewWindowTip') }}
@@ -18,14 +52,6 @@
18
52
  {{ t('setting.info.viewDevice') }}
19
53
  </SettingButton>
20
54
 
21
- <view class="setting-row">{{ t('setting.info.viewSystem') }}:</view>
22
- <view class="setting-tips">
23
- {{ t('setting.info.viewSystemTip') }}
24
- </view>
25
- <SettingButton @click="onLookSystemInfo">
26
- {{ t('setting.info.viewSystem') }}
27
- </SettingButton>
28
-
29
55
  <view class="setting-row">{{ t('setting.info.viewAppInfo') }}:</view>
30
56
  <view class="setting-tips">
31
57
  {{ t('setting.info.viewAppInfoTip') }}
@@ -40,9 +66,21 @@
40
66
  <script setup lang="ts">
41
67
  import DevToolTitle from '../../DevToolTitle/index.vue';
42
68
  import SettingButton from '../../SettingButton/index.vue';
43
- import { useI18n } from '../../../i18n';
69
+ import { useI18n } from '../../../../../i18n';
70
+ import { onMounted, ref } from 'vue';
44
71
 
45
72
  const { t } = useI18n();
73
+ const systemInfoBase = ref<any>(null);
74
+
75
+ onMounted(() => {
76
+ if (uni.getSystemInfoSync) {
77
+ try {
78
+ systemInfoBase.value = uni.getSystemInfoSync();
79
+ } catch (_e) {
80
+ // ignore
81
+ }
82
+ }
83
+ });
46
84
 
47
85
  defineProps<{
48
86
  theme?: string;
@@ -21,9 +21,9 @@
21
21
  <script setup lang="ts">
22
22
  import { computed, ref } from 'vue';
23
23
  import DevToolTitle from '../../DevToolTitle/index.vue';
24
- import Pick from '../../Pick/index.vue';
24
+ import Pick from '../../../../components/Pick/index.vue';
25
25
  import SettingButton from '../../SettingButton/index.vue';
26
- import { useI18n } from '../../../i18n';
26
+ import { useI18n } from '../../../../../i18n';
27
27
 
28
28
  const { t, locale, setLocale } = useI18n();
29
29
 
@@ -161,8 +161,8 @@
161
161
  import { computed, reactive } from 'vue';
162
162
  import DevToolTitle from '../../DevToolTitle/index.vue';
163
163
  import SettingButton from '../../SettingButton/index.vue';
164
- import { useI18n } from '../../../i18n';
165
- import { getThemeMainColor } from '../../styles/theme';
164
+ import { useI18n } from '../../../../../i18n';
165
+ import { getThemeMainColor } from '../../../../styles/theme';
166
166
 
167
167
  const { t } = useI18n();
168
168
  const themeColor = computed(() => getThemeMainColor(props.theme));
@@ -81,9 +81,9 @@
81
81
  <script setup lang="ts">
82
82
  import { computed } from 'vue';
83
83
  import DevToolTitle from '../../DevToolTitle/index.vue';
84
- import Tag from '../../Tag/index.vue';
85
- import { useI18n } from '../../../i18n';
86
- import { getThemeMainColor } from '../../styles/theme';
84
+ import Tag from '../../../../components/Tag/index.vue';
85
+ import { useI18n } from '../../../../../i18n';
86
+ import { getThemeMainColor } from '../../../../styles/theme';
87
87
 
88
88
  const { t } = useI18n();
89
89
  const themeColor = computed(() => getThemeMainColor(props.theme));
@@ -94,9 +94,20 @@
94
94
  :options="fontWeightList"
95
95
  custom-style="width: 150px" />
96
96
  </view>
97
- <SettingButton @click="onSave">
97
+ <SettingButton @click="onSave" style="margin-bottom: 8px">
98
98
  {{ t('setting.theme.save') }}
99
99
  </SettingButton>
100
+
101
+ <SettingButton @click="onToggleSafeArea" style="margin-bottom: 8px">
102
+ {{
103
+ showingSafeArea
104
+ ? t('setting.theme.hideSafeArea')
105
+ : t('setting.theme.showSafeArea')
106
+ }}
107
+ </SettingButton>
108
+ <view class="setting-tips" style="margin-bottom: 12px">
109
+ {{ t('setting.theme.showSafeAreaTip') }}
110
+ </view>
100
111
  </view>
101
112
  </view>
102
113
  </template>
@@ -105,9 +116,14 @@
105
116
  import { ref, watch, computed } from 'vue';
106
117
  import DevToolTitle from '../../DevToolTitle/index.vue';
107
118
  import SettingButton from '../../SettingButton/index.vue';
108
- import Pick from '../../Pick/index.vue';
109
- import { useI18n } from '../../../i18n';
110
- import { getThemeMainColor } from '../../styles/theme';
119
+ import Pick from '../../../../components/Pick/index.vue';
120
+ import { useI18n } from '../../../../../i18n';
121
+ import { getThemeMainColor } from '../../../../styles/theme';
122
+ import { DEV_UI_MESSAGE } from '../../../../../const';
123
+ import {
124
+ getDevToolInfo,
125
+ setDevToolInfo,
126
+ } from '../../../../../modules/devToolInfo';
111
127
 
112
128
  const { t } = useI18n();
113
129
  const themeColor = computed(() => getThemeMainColor(props.theme));
@@ -162,6 +178,17 @@ const localTipsFontSize = ref(props.tipsFontSize || 10);
162
178
  const localFontFamily = ref(props.fontFamily || '');
163
179
  const localFontWeight = ref(props.fontWeight || 'normal');
164
180
 
181
+ const showingSafeArea = ref(getDevToolInfo()?.showingSafeArea || false);
182
+
183
+ function onToggleSafeArea() {
184
+ showingSafeArea.value = !showingSafeArea.value;
185
+ setDevToolInfo({ showingSafeArea: showingSafeArea.value });
186
+ uni.$emit(DEV_UI_MESSAGE, {
187
+ type: 'TOGGLE_SAFE_AREA',
188
+ data: showingSafeArea.value,
189
+ });
190
+ }
191
+
165
192
  const fontWeightList = [
166
193
  { label: 'Normal (400)', value: 'normal' },
167
194
  { label: 'Medium (500)', value: '500' },
@@ -220,16 +247,19 @@ function onToggleTransition() {
220
247
  emit('changeUseTransition', !props.useTransition);
221
248
  }
222
249
 
250
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
223
251
  function onBaseFontSizeInput(e: any) {
224
- localBaseFontSize.value = e.detail.value;
252
+ localBaseFontSize.value = Number(e.detail.value);
225
253
  }
226
254
 
255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
227
256
  function onTagFontSizeInput(e: any) {
228
- localTagFontSize.value = e.detail.value;
257
+ localTagFontSize.value = Number(e.detail.value);
229
258
  }
230
259
 
260
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
231
261
  function onTipsFontSizeInput(e: any) {
232
- localTipsFontSize.value = e.detail.value;
262
+ localTipsFontSize.value = Number(e.detail.value);
233
263
  }
234
264
 
235
265
  function onSave() {
@@ -1,15 +1,13 @@
1
1
  <template>
2
2
  <view
3
3
  :class="['source-code-line', active ? 'source-code-line-active' : '']"
4
- :id="id"
5
- >
4
+ :id="id">
6
5
  <view class="source-code-line-num" v-if="showNum">{{ num }}</view>
7
6
  <view :class="['source-code-line-content', line.class]">
8
7
  <view
9
8
  v-for="(item, index) in line.words"
10
9
  :key="index"
11
- :class="['source-code-line-word', item.class]"
12
- >
10
+ :class="['source-code-line-word', item.class]">
13
11
  {{ item.word }}
14
12
  </view>
15
13
  </view>
@@ -37,6 +35,8 @@ const _props = withDefaults(
37
35
  display: flex;
38
36
  align-items: center;
39
37
  height: 20px;
38
+ font-family: Consolas, Monaco, 'Courier New', monospace;
39
+ position: relative;
40
40
  }
41
41
 
42
42
  .source-code-line-active {
@@ -47,10 +47,14 @@ const _props = withDefaults(
47
47
  }
48
48
 
49
49
  .source-code-line-num {
50
+ position: sticky;
51
+ left: 0;
52
+ z-index: 1;
53
+ background-color: var(--dev-tool-bg3-color);
50
54
  flex-shrink: 0;
51
55
  width: 30px;
52
56
  padding: 0 6px;
53
- margin-right: 6px;
57
+ margin-right: 15px;
54
58
  text-align: right;
55
59
  height: 20px;
56
60
  border-right: 1px solid var(--dev-tool-border-color);
@@ -58,20 +62,27 @@ const _props = withDefaults(
58
62
 
59
63
  .source-code-line-content {
60
64
  display: flex;
61
- white-space: nowrap;
65
+ white-space: pre;
62
66
  height: 20px;
67
+ user-select: text; /* 方便后续选取或直接开启 contenteditable 编辑 */
63
68
  }
64
69
 
65
70
  .source-code-line-word {
66
- white-space: nowrap;
71
+ white-space: pre;
72
+ box-sizing: border-box;
67
73
  }
68
74
 
69
- .source-code-pre-note {
70
- color: var(--dev-tool-note-color);
75
+ .source-code-pre-space {
76
+ border-left: 1px dashed var(--dev-tool-border-color);
77
+
78
+ /* The color can be made softer if default border is too prominent */
79
+ border-left-color: rgb(146 84 222 / 15%); /* matching theme slightly */
80
+ margin-left: -1px; /* collapse border so spaces stay aligned perfectly */
81
+ padding-left: 1px;
71
82
  }
72
83
 
73
- .source-code-pre-space {
74
- width: 8px;
84
+ .source-code-pre-note {
85
+ color: var(--dev-tool-note-color);
75
86
  }
76
87
 
77
88
  .source-code-pre-keyword {
@@ -32,14 +32,14 @@
32
32
  </view>
33
33
  </template>
34
34
  <script lang="ts" setup>
35
- import { computed, ref, onMounted } from 'vue';
36
- // import FilterInput from '../FilterInput/index.vue';
37
- import CircularButton from '../CircularButton/index.vue';
38
- import VirtualList from '../VirtualList/index.vue';
39
- import Empty from '../Empty/index.vue';
40
- import AutoSize from '../VirtualList/AutoSize.vue';
35
+ import { computed, ref, shallowRef, onMounted } from 'vue';
36
+ // import FilterInput from '../../../components/FilterInput/index.vue';
37
+ import CircularButton from '../../../components/CircularButton/index.vue';
38
+ import VirtualList from '../../../components/VirtualList/index.vue';
39
+ import Empty from '../../../components/Empty/index.vue';
40
+ import AutoSize from '../../../components/VirtualList/AutoSize.vue';
41
41
  import Line from './Line.vue';
42
- import { isAndroid, parseStock } from '../../utils';
42
+ import { isAndroid, parseStock } from '../../../../utils';
43
43
  import { parseCode, type LineInfo } from './parseCode';
44
44
  const props = defineProps<{
45
45
  url: string;
@@ -63,7 +63,7 @@ const _scrollIntoView = ref('');
63
63
 
64
64
  // let backupCodes: string[] = [];
65
65
 
66
- const codes = ref<LineInfo[]>([]);
66
+ const codes = shallowRef<LineInfo[]>([]);
67
67
  // const defaultCurrent = ref(1);
68
68
  const pageSize = 50;
69
69