@we-debug/miniprogram 0.49.2 → 0.51.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 (49) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/api-view/index.js +277 -0
  3. package/dist/api-view/index.json +6 -0
  4. package/dist/api-view/index.less +1 -0
  5. package/dist/api-view/index.wxml +154 -0
  6. package/dist/api-view/index.wxss +592 -0
  7. package/dist/api-view/utils.js +90 -0
  8. package/dist/cell/index.wxss +1 -1
  9. package/dist/cell-item/index.wxss +1 -1
  10. package/dist/host-behavior.js +1 -0
  11. package/dist/host-empty/index.js +1 -0
  12. package/dist/host-empty/index.json +3 -0
  13. package/dist/host-empty/index.wxml +1 -0
  14. package/dist/index/index.js +134 -23
  15. package/dist/index/index.json +8 -0
  16. package/dist/index/index.wxml +68 -28
  17. package/dist/index/index.wxss +75 -7
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +2 -0
  20. package/dist/json-view/index.js +2 -1
  21. package/dist/json-view/index.wxml +2 -1
  22. package/dist/launcher/index.js +193 -0
  23. package/dist/launcher/index.json +4 -0
  24. package/dist/launcher/index.less +1 -0
  25. package/dist/launcher/index.wxml +17 -0
  26. package/dist/launcher/index.wxss +58 -0
  27. package/dist/less/_variable.less +8 -0
  28. package/dist/less/api-view.less +14 -0
  29. package/dist/less/button.less +3 -3
  30. package/dist/less/cell-item.less +1 -1
  31. package/dist/less/cell.less +1 -1
  32. package/dist/less/index.less +90 -9
  33. package/dist/less/launcher.less +79 -0
  34. package/dist/less/mask.less +21 -4
  35. package/dist/less/network-view.less +685 -0
  36. package/dist/less/rule.less +8 -8
  37. package/dist/mask/index.js +38 -3
  38. package/dist/mask/index.wxss +20 -4
  39. package/dist/network-view/index.js +300 -0
  40. package/dist/network-view/index.json +6 -0
  41. package/dist/network-view/index.less +1 -0
  42. package/dist/network-view/index.wxml +209 -0
  43. package/dist/network-view/index.wxss +582 -0
  44. package/dist/network-view/utils.js +240 -0
  45. package/dist/rule/index.wxss +11 -11
  46. package/dist/table-view/index.js +11 -18
  47. package/dist/ui-behavior.js +1 -0
  48. package/package.json +3 -3
  49. package/test/host-behavior.test.js +27 -0
@@ -0,0 +1,582 @@
1
+ .nv {
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ width: 100%;
6
+ height: 100%;
7
+ overflow: hidden;
8
+ background: #ffffff;
9
+ color: #202124;
10
+ font-size: 13px;
11
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
12
+ }
13
+ /* 操作栏 */
14
+ .nv-toolbar {
15
+ display: flex;
16
+ align-items: center;
17
+ height: 40px;
18
+ padding: 0 8px;
19
+ background: #f5f5f5;
20
+ border-bottom: 1px solid #e0e0e0;
21
+ flex-shrink: 0;
22
+ box-sizing: border-box;
23
+ }
24
+ .nv-btn {
25
+ width: 28px;
26
+ height: 28px;
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ background: #ffffff;
31
+ border: 1px solid #dadce0;
32
+ border-radius: 4px;
33
+ flex-shrink: 0;
34
+ box-sizing: border-box;
35
+ transition: all 0.2s ease;
36
+ }
37
+ .nv-btn:active {
38
+ background: #f1f3f4;
39
+ }
40
+ .nv-record {
41
+ width: 12px;
42
+ height: 12px;
43
+ border-radius: 50%;
44
+ border: 2px solid #5f6368;
45
+ box-sizing: border-box;
46
+ }
47
+ .nv-record.on {
48
+ border: none;
49
+ background: #d93025;
50
+ }
51
+ .nv-icon {
52
+ width: 14px;
53
+ height: 14px;
54
+ background-repeat: no-repeat;
55
+ background-position: center;
56
+ background-size: contain;
57
+ flex-shrink: 0;
58
+ }
59
+ .nv-icon.trash {
60
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z'/%3E%3C/svg%3E");
61
+ }
62
+ .nv-icon.copy {
63
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
64
+ opacity: 0.8;
65
+ }
66
+ .nv-search {
67
+ position: relative;
68
+ flex: 1;
69
+ min-width: 0;
70
+ height: 28px;
71
+ margin: 0 6px;
72
+ }
73
+ .nv-search::before {
74
+ content: '';
75
+ position: absolute;
76
+ left: 8px;
77
+ top: 50%;
78
+ width: 14px;
79
+ height: 14px;
80
+ transform: translateY(-50%);
81
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235f6368'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat center;
82
+ background-size: contain;
83
+ opacity: 0.5;
84
+ z-index: 1;
85
+ }
86
+ .nv-search-input {
87
+ width: 100%;
88
+ height: 28px;
89
+ min-height: 28px;
90
+ padding: 0 8px 0 28px;
91
+ font-size: 13px;
92
+ background: #ffffff;
93
+ border: 1px solid #dadce0;
94
+ border-radius: 4px;
95
+ box-sizing: border-box;
96
+ }
97
+ .nv-chip {
98
+ display: flex;
99
+ align-items: center;
100
+ height: 28px;
101
+ padding: 0 8px;
102
+ margin-left: 6px;
103
+ font-size: 12px;
104
+ color: #5f6368;
105
+ background: #f8f9fa;
106
+ border: 1px solid #e0e0e0;
107
+ border-radius: 4px;
108
+ flex-shrink: 0;
109
+ box-sizing: border-box;
110
+ }
111
+ .nv-chip.active {
112
+ color: #4d4fec;
113
+ background: rgba(77, 79, 236, 0.08);
114
+ border-color: rgba(77, 79, 236, 0.3);
115
+ }
116
+ .nv-checkbox {
117
+ position: relative;
118
+ width: 12px;
119
+ height: 12px;
120
+ margin-right: 4px;
121
+ border: 1px solid #9aa0a6;
122
+ border-radius: 2px;
123
+ background: #ffffff;
124
+ box-sizing: border-box;
125
+ }
126
+ .nv-checkbox.checked {
127
+ background: #4d4fec;
128
+ border-color: #4d4fec;
129
+ }
130
+ .nv-checkbox.checked::after {
131
+ content: '';
132
+ position: absolute;
133
+ left: 3px;
134
+ top: 0;
135
+ width: 3px;
136
+ height: 7px;
137
+ border: solid #ffffff;
138
+ border-width: 0 2px 2px 0;
139
+ transform: rotate(45deg);
140
+ }
141
+ /* 类型筛选,与面板底部分组胶囊一致 */
142
+ .nv-types {
143
+ height: 36px;
144
+ white-space: nowrap;
145
+ border-bottom: 1px solid #e0e0e0;
146
+ flex-shrink: 0;
147
+ box-sizing: border-box;
148
+ }
149
+ .nv-type {
150
+ display: inline-block;
151
+ height: 24px;
152
+ line-height: 24px;
153
+ padding: 0 12px;
154
+ margin: 6px 0 0 8px;
155
+ font-size: 12px;
156
+ border-radius: 24px;
157
+ background: #f8f8f8;
158
+ color: #202124;
159
+ }
160
+ .nv-type.active {
161
+ background: rgba(77, 79, 236, 0.05);
162
+ color: #4d4fec;
163
+ }
164
+ /* 表格 */
165
+ .nv-table {
166
+ flex: 1;
167
+ display: flex;
168
+ flex-direction: column;
169
+ min-height: 0;
170
+ }
171
+ .nv-row {
172
+ display: flex;
173
+ align-items: center;
174
+ min-height: 40px;
175
+ padding: 0 4px;
176
+ border-bottom: 1px solid #f1f3f4;
177
+ box-sizing: border-box;
178
+ transition: background-color 0.2s ease;
179
+ }
180
+ .nv-row:active {
181
+ background-color: rgba(77, 79, 236, 0.2);
182
+ }
183
+ .nv-row.selected {
184
+ background-color: rgba(77, 79, 236, 0.08);
185
+ }
186
+ .nv-row.error .nv-col,
187
+ .nv-row.error .nv-name {
188
+ color: #d93025;
189
+ }
190
+ .nv-row.pending .nv-col,
191
+ .nv-row.pending .nv-name {
192
+ color: #9aa0a6;
193
+ }
194
+ .nv-head {
195
+ min-height: 32px;
196
+ background: #f8f9fa;
197
+ border-bottom: 1px solid #dadce0;
198
+ flex-shrink: 0;
199
+ }
200
+ .nv-head:active {
201
+ background: #f8f9fa;
202
+ }
203
+ .nv-head .nv-col {
204
+ color: #5f6368;
205
+ font-weight: 500;
206
+ }
207
+ .nv-body {
208
+ flex: 1;
209
+ height: 0;
210
+ }
211
+ .nv-col {
212
+ padding: 0 4px;
213
+ overflow: hidden;
214
+ text-overflow: ellipsis;
215
+ white-space: nowrap;
216
+ line-height: 1.4;
217
+ color: #5f6368;
218
+ box-sizing: border-box;
219
+ }
220
+ .nv-col.name {
221
+ flex: 1;
222
+ min-width: 0;
223
+ }
224
+ .nv-col.status {
225
+ width: 50px;
226
+ }
227
+ .nv-col.method {
228
+ width: 60px;
229
+ }
230
+ .nv-col.size {
231
+ width: 54px;
232
+ text-align: right;
233
+ font-size: 12px;
234
+ }
235
+ .nv-col.time {
236
+ width: 56px;
237
+ text-align: right;
238
+ font-size: 12px;
239
+ }
240
+ .nv-name {
241
+ overflow: hidden;
242
+ text-overflow: ellipsis;
243
+ white-space: nowrap;
244
+ color: #202124;
245
+ font-weight: 500;
246
+ }
247
+ .nv-dir {
248
+ overflow: hidden;
249
+ text-overflow: ellipsis;
250
+ white-space: nowrap;
251
+ font-size: 11px;
252
+ color: #9aa0a6;
253
+ }
254
+ .nv-empty {
255
+ padding-top: 56px;
256
+ text-align: center;
257
+ color: #d9d9d9;
258
+ font-size: 16px;
259
+ }
260
+ .nv-empty-sub {
261
+ margin-top: 8px;
262
+ font-size: 12px;
263
+ color: #9aa0a6;
264
+ }
265
+ /* 状态栏 */
266
+ .nv-statusbar {
267
+ display: flex;
268
+ align-items: center;
269
+ height: 36px;
270
+ padding: 0 6px;
271
+ background: #f5f5f5;
272
+ border-top: 1px solid #e0e0e0;
273
+ flex-shrink: 0;
274
+ box-sizing: border-box;
275
+ overflow: hidden;
276
+ }
277
+ .nv-stat {
278
+ display: flex;
279
+ align-items: center;
280
+ min-width: 0;
281
+ height: 22px;
282
+ padding: 0 5px;
283
+ margin-right: 4px;
284
+ font-size: 11px;
285
+ white-space: nowrap;
286
+ overflow: hidden;
287
+ background: #f8f9fa;
288
+ border: 1px solid #e0e0e0;
289
+ border-radius: 4px;
290
+ box-sizing: border-box;
291
+ }
292
+ .nv-stat:last-child {
293
+ margin-right: 0;
294
+ }
295
+ .nv-stat-label {
296
+ margin-right: 4px;
297
+ color: #5f6368;
298
+ opacity: 0.8;
299
+ }
300
+ .nv-stat-value {
301
+ color: #202124;
302
+ font-weight: 500;
303
+ }
304
+ /* 详情抽屉 */
305
+ .nv-drawer {
306
+ position: absolute;
307
+ top: 0;
308
+ right: -100%;
309
+ width: 100%;
310
+ height: 100%;
311
+ display: flex;
312
+ flex-direction: column;
313
+ background: #ffffff;
314
+ border-left: 1px solid #e0e0e0;
315
+ box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
316
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
317
+ z-index: 100;
318
+ box-sizing: border-box;
319
+ }
320
+ .nv-drawer.show {
321
+ right: 0;
322
+ }
323
+ .nv-drawer-header {
324
+ display: flex;
325
+ align-items: center;
326
+ justify-content: space-between;
327
+ height: 40px;
328
+ padding: 0 8px 0 12px;
329
+ background: #f8f9fa;
330
+ border-bottom: 1px solid #e0e0e0;
331
+ flex-shrink: 0;
332
+ box-sizing: border-box;
333
+ }
334
+ .nv-drawer-title {
335
+ flex: 1;
336
+ min-width: 0;
337
+ margin-right: 8px;
338
+ display: flex;
339
+ align-items: center;
340
+ overflow: hidden;
341
+ text-overflow: ellipsis;
342
+ white-space: nowrap;
343
+ font-size: 13px;
344
+ font-weight: 500;
345
+ color: #202124;
346
+ }
347
+ .nv-drawer-title::before {
348
+ content: '';
349
+ display: inline-block;
350
+ width: 3px;
351
+ height: 14px;
352
+ margin-right: 8px;
353
+ background: #4d4fec;
354
+ border-radius: 2px;
355
+ flex-shrink: 0;
356
+ }
357
+ .nv-drawer-title.error {
358
+ color: #d93025;
359
+ }
360
+ .nv-drawer-close {
361
+ position: relative;
362
+ width: 24px;
363
+ height: 24px;
364
+ border-radius: 50%;
365
+ color: #5f6368;
366
+ flex-shrink: 0;
367
+ transition: all 0.2s ease;
368
+ }
369
+ .nv-drawer-close::before {
370
+ content: '×';
371
+ position: absolute;
372
+ top: 50%;
373
+ left: 50%;
374
+ font-size: 18px;
375
+ line-height: 1;
376
+ transform: translate(-50%, -50%);
377
+ }
378
+ .nv-drawer-close:active {
379
+ background: #e8eaed;
380
+ color: #202124;
381
+ }
382
+ .nv-tabs {
383
+ display: flex;
384
+ height: 36px;
385
+ border-bottom: 1px solid #e0e0e0;
386
+ flex-shrink: 0;
387
+ box-sizing: border-box;
388
+ }
389
+ .nv-tab {
390
+ flex: 1;
391
+ height: 34px;
392
+ line-height: 34px;
393
+ text-align: center;
394
+ font-size: 12px;
395
+ color: #5f6368;
396
+ border-bottom: 2px solid transparent;
397
+ }
398
+ .nv-tab.active {
399
+ color: #4d4fec;
400
+ font-weight: 500;
401
+ border-bottom-color: #4d4fec;
402
+ }
403
+ .nv-drawer-body {
404
+ flex: 1;
405
+ height: 0;
406
+ padding: 12px;
407
+ box-sizing: border-box;
408
+ }
409
+ .nv-flex {
410
+ display: flex;
411
+ flex-direction: column;
412
+ overflow: hidden;
413
+ }
414
+ /* 内容卡片,与 table-view 的 value-preview 一致 */
415
+ .nv-card {
416
+ margin: 0 1px 12px;
417
+ padding: 10px 12px;
418
+ background: #f8f9fa;
419
+ border: 1px solid #e0e0e0;
420
+ border-radius: 8px;
421
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
422
+ box-sizing: border-box;
423
+ flex-shrink: 0;
424
+ }
425
+ .nv-card-fill {
426
+ flex: 1;
427
+ min-height: 160px;
428
+ display: flex;
429
+ flex-direction: column;
430
+ margin-bottom: 1px;
431
+ }
432
+ .nv-card-title {
433
+ display: flex;
434
+ align-items: center;
435
+ justify-content: space-between;
436
+ padding-bottom: 8px;
437
+ margin-bottom: 6px;
438
+ font-size: 12px;
439
+ font-weight: 500;
440
+ color: #5f6368;
441
+ border-bottom: 1px solid #e0e0e0;
442
+ flex-shrink: 0;
443
+ }
444
+ .nv-count {
445
+ margin-left: 6px;
446
+ padding: 0 6px;
447
+ font-size: 11px;
448
+ line-height: 16px;
449
+ color: #4d4fec;
450
+ background: rgba(77, 79, 236, 0.08);
451
+ border-radius: 8px;
452
+ }
453
+ .nv-copy-btn {
454
+ width: 20px;
455
+ height: 20px;
456
+ display: flex;
457
+ align-items: center;
458
+ justify-content: center;
459
+ border-radius: 4px;
460
+ }
461
+ .nv-copy-btn:active {
462
+ background: #e8eaed;
463
+ }
464
+ .nv-kv {
465
+ display: flex;
466
+ padding: 4px 0;
467
+ font-size: 12px;
468
+ line-height: 1.6;
469
+ word-break: break-all;
470
+ }
471
+ .nv-k {
472
+ flex-shrink: 0;
473
+ width: 42%;
474
+ margin-right: 8px;
475
+ color: #5f6368;
476
+ font-weight: 500;
477
+ word-break: break-word;
478
+ overflow-wrap: break-word;
479
+ }
480
+ .nv-v {
481
+ flex: 1;
482
+ min-width: 0;
483
+ color: #202124;
484
+ font-family: 'Consolas', 'Monaco', monospace;
485
+ }
486
+ .nv-v.error {
487
+ color: #d93025;
488
+ }
489
+ .nv-none {
490
+ padding: 4px 0;
491
+ font-size: 12px;
492
+ color: #9aa0a6;
493
+ }
494
+ .nv-json {
495
+ flex: 1;
496
+ height: 0;
497
+ margin: 0 -12px -10px;
498
+ }
499
+ .nv-code {
500
+ display: block;
501
+ font-family: 'Consolas', 'Monaco', monospace;
502
+ font-size: 13px;
503
+ line-height: 1.6;
504
+ white-space: pre-wrap;
505
+ word-break: break-all;
506
+ color: #202124;
507
+ }
508
+ .nv-json .nv-code {
509
+ padding: 4px 12px 10px;
510
+ }
511
+ .nv-placeholder {
512
+ padding-top: 48px;
513
+ text-align: center;
514
+ font-size: 14px;
515
+ color: #d9d9d9;
516
+ }
517
+ .nv-placeholder.error {
518
+ color: #d93025;
519
+ }
520
+ .nv-actions {
521
+ display: flex;
522
+ padding-bottom: 4px;
523
+ }
524
+ .nv-action {
525
+ display: flex;
526
+ align-items: center;
527
+ height: 28px;
528
+ padding: 0 10px;
529
+ margin-right: 8px;
530
+ font-size: 12px;
531
+ color: #4d4fec;
532
+ background: #ffffff;
533
+ border: 1px solid #dadce0;
534
+ border-radius: 4px;
535
+ box-sizing: border-box;
536
+ transition: all 0.2s ease;
537
+ }
538
+ .nv-action .nv-icon {
539
+ width: 12px;
540
+ height: 12px;
541
+ margin-right: 4px;
542
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234d4fec'%3E%3Cpath d='M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z'/%3E%3C/svg%3E");
543
+ opacity: 1;
544
+ }
545
+ .nv-action:active {
546
+ background: rgba(77, 79, 236, 0.08);
547
+ }
548
+ .nv-phase {
549
+ display: flex;
550
+ align-items: center;
551
+ padding: 4px 0;
552
+ font-size: 12px;
553
+ }
554
+ .nv-phase-label {
555
+ width: 40%;
556
+ flex-shrink: 0;
557
+ color: #5f6368;
558
+ overflow: hidden;
559
+ text-overflow: ellipsis;
560
+ white-space: nowrap;
561
+ }
562
+ .nv-phase-track {
563
+ position: relative;
564
+ flex: 1;
565
+ height: 8px;
566
+ margin: 0 8px;
567
+ background: #ffffff;
568
+ border-radius: 4px;
569
+ overflow: hidden;
570
+ }
571
+ .nv-phase-bar {
572
+ position: absolute;
573
+ top: 0;
574
+ height: 8px;
575
+ border-radius: 4px;
576
+ }
577
+ .nv-phase-time {
578
+ width: 56px;
579
+ flex-shrink: 0;
580
+ text-align: right;
581
+ color: #202124;
582
+ }