vite-uni-dev-tool 0.0.23 → 0.0.25

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 (40) hide show
  1. package/README.md +15 -3
  2. package/dist/core.d.ts +3 -3
  3. package/dist/core.d.ts.map +1 -1
  4. package/dist/core.js +47 -50
  5. package/dist/devEvent/index.d.ts.map +1 -1
  6. package/dist/devEvent/index.js +15 -7
  7. package/dist/devIntercept/index.d.ts.map +1 -1
  8. package/dist/devIntercept/index.js +56 -55
  9. package/dist/devStore/index.d.ts +5 -1
  10. package/dist/devStore/index.d.ts.map +1 -1
  11. package/dist/devStore/index.js +19 -14
  12. package/dist/type.d.ts +4 -0
  13. package/dist/type.d.ts.map +1 -1
  14. package/dist/v2/AutoSizer/index.vue +1 -1
  15. package/dist/v2/ConsoleList/ConsoleItem.vue +1 -1
  16. package/dist/v2/DevToolButton/index.vue +2 -2
  17. package/dist/v3/AutoSizer/index.vue +1 -1
  18. package/dist/v3/CaptureScreen/index.vue +5 -1
  19. package/dist/v3/ConsoleList/ConsoleItem.vue +1 -1
  20. package/dist/v3/ConsoleList/RunJSInput.vue +1 -0
  21. package/dist/v3/DevToolButton/index.vue +3 -2
  22. package/dist/v3/DevToolWindow/index.vue +16 -0
  23. package/dist/v3/JsonPretty/components/Brackets/index.vue +3 -0
  24. package/dist/v3/JsonPretty/components/Carets/index.vue +2 -3
  25. package/dist/v3/NetworkList/InterceptConfig.vue +13 -34
  26. package/dist/v3/NetworkList/NetworkDetail.vue +11 -16
  27. package/dist/v3/NetworkList/NetworkSend.vue +20 -29
  28. package/dist/v3/RunJS/index.vue +1 -1
  29. package/dist/v3/SettingList/const.d.ts +2 -0
  30. package/dist/v3/SettingList/const.d.ts.map +1 -0
  31. package/dist/v3/SettingList/index.vue +7 -3
  32. package/dist/v3/SourceCode/Line.vue +2 -1
  33. package/dist/v3/Tabs/index.vue +5 -14
  34. package/dist/v3/Tag/index.vue +1 -1
  35. package/dist/v3/UniEvent/index.vue +7 -6
  36. package/dist/v3/UploadList/UploadDetail.vue +2 -2
  37. package/dist/v3/UploadList/index.vue +3 -3
  38. package/dist/v3/WebSocket/WebSocketDetail.vue +9 -15
  39. package/dist/v3/WebSocket/WebSocketItem.vue +6 -7
  40. package/package.json +1 -1
@@ -155,12 +155,17 @@
155
155
  <button
156
156
  size="mini"
157
157
  :disabled="!isFinished"
158
+ class="network-send-button"
158
159
  @click="emit('openDetail', network)"
159
160
  >
160
161
  详情
161
162
  </button>
162
- <button size="mini" @click="onReset">重置</button>
163
- <button size="mini" @click="onSend">发送</button>
163
+ <button size="mini" class="network-send-button" @click="onReset">
164
+ 重置
165
+ </button>
166
+ <button size="mini" class="network-send-button-last" @click="onSend">
167
+ 发送
168
+ </button>
164
169
  </view>
165
170
  </view>
166
171
  </template>
@@ -207,25 +212,25 @@ const state = reactive<{
207
212
 
208
213
  const defaultHeader = [
209
214
  {
210
- id: 1,
215
+ id: '1',
211
216
  key: 'Accept',
212
217
  value: '*/*',
213
218
  checked: false,
214
219
  },
215
220
  {
216
- id: 2,
221
+ id: '2',
217
222
  key: 'Accept-Language',
218
223
  value: 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
219
224
  checked: false,
220
225
  },
221
226
  {
222
- id: 3,
227
+ id: '3',
223
228
  key: 'Cache-Control',
224
229
  value: 'no-cache',
225
230
  checked: false,
226
231
  },
227
232
  {
228
- id: 4,
233
+ id: '4',
229
234
  key: 'Content-Type',
230
235
  value: 'application/json; charset=utf-8',
231
236
  checked: true,
@@ -233,7 +238,7 @@ const defaultHeader = [
233
238
  ];
234
239
 
235
240
  type PB = {
236
- id: number;
241
+ id: string;
237
242
  key: string;
238
243
  value: string;
239
244
  checked: boolean;
@@ -243,7 +248,7 @@ const headerList = reactive([...defaultHeader]);
243
248
 
244
249
  const queryList = reactive<PB[]>([
245
250
  {
246
- id: 1,
251
+ id: '1',
247
252
  key: 'a',
248
253
  value: '123',
249
254
  checked: true,
@@ -441,7 +446,7 @@ function onDeleteHeader(item: any) {
441
446
  }
442
447
 
443
448
  function onAddHeader() {
444
- const id = Date.now();
449
+ const id = Date.now().toString();
445
450
  headerList.push({
446
451
  id,
447
452
  key: '',
@@ -466,7 +471,7 @@ function onDeleteQuery(item: any) {
466
471
  queryList.splice(index, 1);
467
472
  }
468
473
  function onAddQuery() {
469
- const id = Date.now();
474
+ const id = Date.now().toString();
470
475
  queryList.push({
471
476
  id,
472
477
  key: '',
@@ -500,7 +505,7 @@ function arrayToObject(arr: any[]) {
500
505
 
501
506
  function objectToArray<T extends Record<string, any>>(obj: T) {
502
507
  return Object.entries(obj).map(([key, value]) => ({
503
- id: Date.now(),
508
+ id: Date.now().toString(),
504
509
  key,
505
510
  value,
506
511
  checked: true,
@@ -562,7 +567,7 @@ function handleResendNetwork() {
562
567
  return {
563
568
  ...item,
564
569
  checked: true,
565
- id: index,
570
+ id: index.toString(),
566
571
  };
567
572
  }) ?? [];
568
573
 
@@ -631,13 +636,6 @@ onMounted(() => {
631
636
  box-sizing: border-box;
632
637
  }
633
638
 
634
- .network-send-control :deep(.tag) {
635
- margin-right: 16px;
636
- }
637
- .network-send-control :deep(.tag):last-child {
638
- margin-right: 0;
639
- }
640
-
641
639
  .radio-group {
642
640
  display: flex;
643
641
  flex-wrap: wrap;
@@ -671,9 +669,6 @@ onMounted(() => {
671
669
  color: red;
672
670
  }
673
671
 
674
- .network-header-list {
675
- }
676
-
677
672
  .network-header-item {
678
673
  display: flex;
679
674
  align-items: center;
@@ -684,15 +679,11 @@ onMounted(() => {
684
679
  text-align: center;
685
680
  }
686
681
 
687
- .network-param-list {
688
- }
689
682
  .network-param-item {
690
683
  display: flex;
691
684
  align-items: center;
692
685
  }
693
686
 
694
- .network-body-data {
695
- }
696
687
  .network-body-data-item {
697
688
  display: flex;
698
689
  align-items: center;
@@ -707,11 +698,11 @@ onMounted(() => {
707
698
  margin-top: 12px;
708
699
  background-color: var(--dev-tool-bg3-color);
709
700
  }
710
- .network-send-buttons button {
701
+ .network-send-button {
711
702
  width: 100%;
712
703
  margin-right: 6px;
713
704
  }
714
- .network-send-buttons button:last-child {
715
- margin: 0;
705
+ .network-send-button-last {
706
+ width: 100%;
716
707
  }
717
708
  </style>
@@ -10,7 +10,7 @@
10
10
  <Tag mode="clear" @click="emit('clear')">清空</Tag>
11
11
  </view>
12
12
  <view class="run-js-list">
13
- <view class="run-js-item" v-for="item in runJSList">
13
+ <view class="run-js-item" v-for="item in runJSList" :key="item.timer">
14
14
  <view :class="`run-js-item-icon run-js-item-${item.mode}`"></view>
15
15
  <view class="run-js-item-duration" v-if="item.mode === 'output'">
16
16
  {{ item.duration }}ms
@@ -0,0 +1,2 @@
1
+ export declare const version = "";
2
+ //# sourceMappingURL=const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../dev/v3/SettingList/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,KAAK,CAAC"}
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <view class="setting-content">
3
3
  <view class="setting-item">
4
- <DevToolTitle>DevTool({{ version }}-vue3)</DevToolTitle>
4
+ <DevToolTitle>
5
+ DevTool {{ buildInfo?.devToolVersion }}-vue3
6
+ </DevToolTitle>
5
7
  <view class="setting-item-content">
6
8
  <view class="setting-row">
7
9
  <view>显示调试按钮:</view>
@@ -184,13 +186,15 @@
184
186
  import { reactive } from 'vue';
185
187
  import DevToolTitle from '../DevToolTitle/index.vue';
186
188
 
187
- const version = __VERSION__ ?? '1.0.0';
188
-
189
189
  const props = defineProps<{
190
190
  devToolVisible?: boolean;
191
191
  sizeFormat?: string;
192
192
  theme?: string;
193
193
  cacheInterceptConfig?: boolean;
194
+ buildInfo?: {
195
+ devToolVersion?: string;
196
+ devToolBuildTime?: string;
197
+ };
194
198
  }>();
195
199
  const setting = reactive({
196
200
  restartDevTool: false,
@@ -6,7 +6,8 @@
6
6
  <view class="source-code-line-num" v-if="showNum">{{ num }}</view>
7
7
  <view :class="['source-code-line-content', line.class]">
8
8
  <view
9
- v-for="item in line.words"
9
+ v-for="(item, index) in line.words"
10
+ :key="index"
10
11
  :class="['source-code-line-word', item.class]"
11
12
  >
12
13
  {{ item.word }}
@@ -6,6 +6,7 @@
6
6
  scroll-x="true"
7
7
  enable-flex="true"
8
8
  scroll-with-animation
9
+ :show-scrollbar="false"
9
10
  :scrollLeft="scrollLeft"
10
11
  :scroll-into-view="scrollIntoView"
11
12
  @scroll="onScroll"
@@ -80,7 +81,7 @@ function onScroll(e: any) {
80
81
  box-sizing: border-box;
81
82
  font-size: var(--dev-tool-base-font-size);
82
83
  }
83
- .tabs .tabs-list {
84
+ .tabs-list {
84
85
  display: flex;
85
86
  align-items: center;
86
87
  flex: 1;
@@ -90,18 +91,8 @@ function onScroll(e: any) {
90
91
  white-space: nowrap;
91
92
  width: 100%;
92
93
  }
93
- .tabs-list ::-webkit-scrollbar {
94
- display: none;
95
- width: 0;
96
- height: 0;
97
- background-color: transparent;
98
- }
99
- .tabs-list ::-webkit-scrollbar-thumb {
100
- width: 0;
101
- height: 0;
102
- background-color: transparent;
103
- }
104
- .tabs .tabs-item {
94
+
95
+ .tabs-item {
105
96
  display: inline-block;
106
97
  padding: 0 16px;
107
98
  height: 32px;
@@ -111,7 +102,7 @@ function onScroll(e: any) {
111
102
  transition: all 0.3s;
112
103
  cursor: pointer;
113
104
  }
114
- .tabs .tabs-item-active {
105
+ .tabs-item-active {
115
106
  color: var(--dev-tool-main-color);
116
107
  border-color: var(--dev-tool-main-color);
117
108
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view
3
- :class="`tag tag-${mode} ${active ? 'tag-active' : ''}`"
3
+ :class="['tag', `tag-${mode}`, active ? 'tag-active' : '']"
4
4
  @click="onClick"
5
5
  >
6
6
  <slot></slot>
@@ -3,25 +3,25 @@
3
3
  <DevToolTitle innerStyle="padding: 0 16px">事件触发统计</DevToolTitle>
4
4
  <view class="uni-event-statistics">
5
5
  <view class="uni-event-statistics-item">
6
- <view>on: </view>
6
+ <view class="uni-event-statistics-item-name">on: </view>
7
7
  <Tag mode="log" style="flex: 1; justify-content: center">
8
8
  {{ eventCount?.on ?? 0 }}
9
9
  </Tag>
10
10
  </view>
11
11
  <view class="uni-event-statistics-item">
12
- <view>once: </view>
12
+ <view class="uni-event-statistics-item-name">once: </view>
13
13
  <Tag mode="warn" style="flex: 1; justify-content: center">
14
14
  {{ eventCount?.once ?? 0 }}
15
15
  </Tag>
16
16
  </view>
17
17
  <view class="uni-event-statistics-item">
18
- <view>emit: </view>
18
+ <view class="uni-event-statistics-item-name">emit: </view>
19
19
  <Tag mode="main" style="flex: 1; justify-content: center">
20
20
  {{ eventCount?.emit ?? 0 }}
21
21
  </Tag>
22
22
  </view>
23
23
  <view class="uni-event-statistics-item">
24
- <view>off: </view>
24
+ <view class="uni-event-statistics-item-name">off: </view>
25
25
  <Tag mode="error" style="flex: 1; justify-content: center">
26
26
  {{ eventCount?.off ?? 0 }}
27
27
  </Tag>
@@ -36,7 +36,8 @@
36
36
  </DevToolTitle>
37
37
  <view class="uni-event-list">
38
38
  <UniEventItem
39
- v-for="item in eventList"
39
+ v-for="(item, index) in eventList"
40
+ :key="index"
40
41
  :eventItem="item"
41
42
  :mode="mode"
42
43
  :useDevSource="useDevSource"
@@ -90,7 +91,7 @@ const emit = defineEmits<{
90
91
  align-items: center;
91
92
  width: 25%;
92
93
  }
93
- .uni-event-statistics-item view:first-child {
94
+ .uni-event-statistics-item-name {
94
95
  margin-right: 8px;
95
96
  }
96
97
  .uni-event-list {
@@ -44,7 +44,7 @@
44
44
  v-for="item in upload?.headers?.requestHeader"
45
45
  :key="item.key"
46
46
  >
47
- <view>{{ item.key }}:</view>
47
+ <view class="upload-detail-item-key">{{ item.key }}:</view>
48
48
  {{ item.value }}
49
49
  </view>
50
50
  </template>
@@ -198,7 +198,7 @@ function onClose() {
198
198
  word-break: break-all;
199
199
  font-size: 12px;
200
200
  }
201
- .upload-detail-item > view:first-child {
201
+ .upload-detail-item-key {
202
202
  white-space: nowrap;
203
203
  margin-right: 8px;
204
204
  color: var(--dev-tool-info-color);
@@ -57,9 +57,9 @@ defineProps<{
57
57
  currentUploadType: string;
58
58
  uploadList: DevTool.UploadItem[];
59
59
  modelValue: string;
60
- mode: string;
60
+ mode?: string;
61
61
  zIndex: number;
62
- useDevSource: boolean;
62
+ useDevSource?: boolean;
63
63
  }>();
64
64
 
65
65
  const emit = defineEmits<{
@@ -67,7 +67,7 @@ const emit = defineEmits<{
67
67
  (e: 'update:modelValue', value: string): void;
68
68
  (e: 'search', value: string): void;
69
69
  (e: 'openDetail', value: DevTool.UploadItem): void;
70
- (e: 'openCode', value: string): void;
70
+ (e: 'openCode', value?: string): void;
71
71
  }>();
72
72
  const uploadFilterItems = [
73
73
  {
@@ -7,6 +7,7 @@
7
7
  v-for="item in selectItems"
8
8
  :active="item.value === currentSelect"
9
9
  :key="item.value"
10
+ style="margin-right: 16px"
10
11
  @click="onSelect(item)"
11
12
  >
12
13
  {{ item.label }}
@@ -18,22 +19,22 @@
18
19
  <DevToolTitle> 常规 </DevToolTitle>
19
20
  <view class="web-socket-detail-item">
20
21
  <view>请求地址:</view>
21
- <view>{{ ws.url }}</view>
22
+ <view>{{ ws?.url }}</view>
22
23
  </view>
23
24
 
24
25
  <view class="web-socket-detail-item">
25
26
  <view>请求方法:</view>
26
- <Tag mode="info">{{ ws.method }}</Tag>
27
+ <Tag mode="info">{{ ws?.method }}</Tag>
27
28
  </view>
28
29
 
29
30
  <DevToolTitle>请求头</DevToolTitle>
30
- <template v-if="ws.headers && ws.headers?.length > 0">
31
+ <template v-if="ws?.headers && ws.headers?.length > 0">
31
32
  <view
32
33
  class="web-socket-detail-item"
33
34
  v-for="item in ws.headers"
34
35
  :key="item.key"
35
36
  >
36
- <view>{{ item.key }}: </view>
37
+ <view class="web-socket-detail-item-key">{{ item.key }}: </view>
37
38
  {{ item.value }}
38
39
  </view>
39
40
  </template>
@@ -42,13 +43,13 @@
42
43
  <template v-if="currentSelect === 'message'">
43
44
  <view class="web-socket-detail-control">
44
45
  <DevToolTitle>消息列表</DevToolTitle>
45
- <Tag mode="clear" style="margin-left: auto" @click="emit('clear', ws)">
46
+ <Tag mode="clear" style="margin-left: auto" @click="emit('clear', ws!)">
46
47
  清除
47
48
  </Tag>
48
49
  </view>
49
50
 
50
51
  <view class="web-socket-data-list">
51
- <template v-if="ws.message && ws.message.length > 0">
52
+ <template v-if="ws?.message && ws.message.length > 0">
52
53
  <view
53
54
  v-for="item in ws.message"
54
55
  :key="item.time"
@@ -87,7 +88,7 @@ import Empty from '../Empty/index.vue';
87
88
  import { formatDate } from '../../utils/index';
88
89
  import type { DevTool } from '../../type';
89
90
 
90
- defineProps<{ ws: DevTool.WS; zIndex?: number }>();
91
+ defineProps<{ ws?: DevTool.WS; zIndex?: number }>();
91
92
  const emit = defineEmits<{
92
93
  (e: 'close'): void;
93
94
  (e: 'clear', value: DevTool.WS): void;
@@ -168,13 +169,6 @@ function onChangeText(e: any) {
168
169
  box-sizing: border-box;
169
170
  }
170
171
 
171
- .web-socket-detail-control :deep(.tag) {
172
- margin-right: 16px;
173
- }
174
- .web-socket-detail-control :deep(.tag):last-child {
175
- margin-right: 0;
176
- }
177
-
178
172
  .web-socket-list-title {
179
173
  min-height: 32px;
180
174
  display: flex;
@@ -194,7 +188,7 @@ function onChangeText(e: any) {
194
188
  font-size: 12px;
195
189
  }
196
190
 
197
- .web-socket-detail-item > view:first-child {
191
+ .web-socket-detail-item-key {
198
192
  white-space: nowrap;
199
193
  margin-right: 8px;
200
194
  color: var(--dev-tool-info-color);
@@ -44,18 +44,17 @@ const emit = defineEmits<{ (e: 'openDetail', value: DevTool.WS): void }>();
44
44
  <style scoped>
45
45
  .websocket-item {
46
46
  padding: 16px;
47
-
48
47
  box-sizing: border-box;
49
48
  border-bottom: 1px solid var(--dev-tool-border-color);
50
49
  font-size: var(--dev-tool-base-font-size);
51
50
  }
52
- .websocket-item .websocket-url-row {
51
+ .websocket-url-row {
53
52
  display: flex;
54
53
  align-items: center;
55
54
  word-break: break-all;
56
55
  }
57
56
 
58
- .websocket-item .websocket-url-row .websocket-url {
57
+ .websocket-url {
59
58
  margin-left: 4px;
60
59
  flex: 1;
61
60
  white-space: nowrap;
@@ -63,14 +62,14 @@ const emit = defineEmits<{ (e: 'openDetail', value: DevTool.WS): void }>();
63
62
  text-overflow: ellipsis;
64
63
  }
65
64
 
66
- .websocket-item .websocket-url-row .websocket-detail-icon {
65
+ .websocket-detail-icon {
67
66
  flex-shrink: 0;
68
67
  margin-left: auto;
69
68
  }
70
- .websocket-item .websocket-url-row .websocket-detail-active {
69
+ .websocket-detail-active {
71
70
  transform: rotate(135deg);
72
71
  }
73
- .websocket-item .websocket-info {
72
+ .websocket-info {
74
73
  display: flex;
75
74
  align-items: center;
76
75
  justify-content: space-between;
@@ -78,7 +77,7 @@ const emit = defineEmits<{ (e: 'openDetail', value: DevTool.WS): void }>();
78
77
  color: var(--dev-tool-info-color);
79
78
  }
80
79
 
81
- .websocket-item .websocket-info .websocket-info-last {
80
+ .websocket-info-last {
82
81
  white-space: nowrap;
83
82
  flex: 1;
84
83
  overflow: hidden;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-uni-dev-tool",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "description": "vite-uni-dev-tool, debug, uni-app, 一处编写,到处调试",
5
5
  "keywords": [
6
6
  "vite",