@we-debug/miniprogram 0.43.5 → 0.44.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.44.0](https://github.com/dlhandsome/we-debug/compare/v0.43.5...v0.44.0) (2025-03-10)
7
+
8
+
9
+ ### Features
10
+
11
+ * **miniprogram:** added table view ([d9ddefa](https://github.com/dlhandsome/we-debug/commit/d9ddefa1e7590a9f0ccb161523587cc710b519a3))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [0.43.5](https://github.com/dlhandsome/we-debug/compare/v0.43.4...v0.43.5) (2025-03-10)
7
18
 
8
19
 
@@ -0,0 +1,431 @@
1
+ .table-view {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ background: #ffffff;
7
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
8
+ }
9
+
10
+ /* 操作栏样式 */
11
+ .action-bar {
12
+ padding: 8px 12px;
13
+ border-bottom: 1px solid #e0e0e0;
14
+ display: flex;
15
+ justify-content: space-between;
16
+ align-items: center;
17
+ background: #f5f5f5;
18
+ height: 40px;
19
+ flex-shrink: 0;
20
+ }
21
+
22
+ .actions {
23
+ display: flex;
24
+ gap: 6px;
25
+ align-items: center;
26
+ }
27
+
28
+ .search-box {
29
+ flex: 1;
30
+ margin: 0 8px;
31
+ position: relative;
32
+ max-width: 300px;
33
+ height: 28px;
34
+ display: flex;
35
+ align-items: center;
36
+ }
37
+
38
+ .search-input {
39
+ width: 100%;
40
+ height: 100%;
41
+ padding: 0 8px 0 28px;
42
+ border: 1px solid #dadce0;
43
+ border-radius: 4px;
44
+ font-size: 13px;
45
+ background: #ffffff;
46
+ transition: all 0.2s ease;
47
+ }
48
+
49
+ .search-input:focus {
50
+ border-color: #4d4fec;
51
+ box-shadow: 0 0 0 1px #4d4fec;
52
+ }
53
+
54
+ .search-box::before {
55
+ content: '';
56
+ position: absolute;
57
+ left: 8px;
58
+ top: 50%;
59
+ transform: translateY(-50%);
60
+ width: 14px;
61
+ height: 14px;
62
+ 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%3Cpath d='M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z'/%3E%3C/svg%3E") no-repeat center;
63
+ background-size: contain;
64
+ opacity: 0.5;
65
+ }
66
+
67
+ .btn {
68
+ width: 28px;
69
+ height: 28px;
70
+ padding: 0;
71
+ font-size: 13px;
72
+ border: 1px solid #dadce0;
73
+ border-radius: 4px;
74
+ transition: all 0.2s ease;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ position: relative;
79
+ overflow: hidden;
80
+ background: #ffffff;
81
+ color: #5f6368;
82
+ flex-shrink: 0;
83
+ }
84
+
85
+ .btn .icon {
86
+ font-size: 16px;
87
+ line-height: 1;
88
+ display: flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ width: 16px;
92
+ height: 16px;
93
+ }
94
+
95
+ .btn .icon.trash {
96
+ width: 14px;
97
+ height: 14px;
98
+ background: 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") no-repeat center;
99
+ background-size: contain;
100
+ opacity: 1;
101
+ }
102
+
103
+ .btn:hover {
104
+ background: #f8f9fa;
105
+ }
106
+
107
+ .btn:active {
108
+ background: #f1f3f4;
109
+ }
110
+
111
+
112
+ .btn.refresh:hover {
113
+ background: rgba(77, 79, 236, 0.1);
114
+ }
115
+
116
+ .btn.refresh:active {
117
+ background: rgba(77, 79, 236, 0.2);
118
+ }
119
+
120
+ .btn.clear {
121
+ color: #5f6368;
122
+ border-color: #dadce0;
123
+ }
124
+
125
+ .btn.clear:hover {
126
+ background: #f8f9fa;
127
+ }
128
+
129
+ .btn.clear:active {
130
+ background: #f1f3f4;
131
+ }
132
+
133
+ /* 表格容器 */
134
+ .table-container {
135
+ flex: 1;
136
+ position: relative;
137
+ overflow: hidden;
138
+ }
139
+
140
+ /* 表格样式 */
141
+ .table-header {
142
+ display: flex;
143
+ padding: 8px 12px;
144
+ background: #f8f9fa;
145
+ border-bottom: 1px solid #dadce0;
146
+ font-weight: 500;
147
+ color: #5f6368;
148
+ font-size: 13px;
149
+ height: 32px;
150
+ align-items: center;
151
+ }
152
+
153
+ .table-body {
154
+ height: calc(100% - 32px);
155
+ overflow-y: auto;
156
+ }
157
+
158
+ .table-row {
159
+ display: flex;
160
+ padding: 8px 12px;
161
+ border-bottom: 1px solid #f1f3f4;
162
+ transition: all 0.2s ease;
163
+ height: 32px;
164
+ align-items: center;
165
+ font-size: 13px;
166
+ position: relative;
167
+ z-index: 1;
168
+ }
169
+
170
+ .table-row:hover {
171
+ background-color: #f8f9fa;
172
+ }
173
+
174
+ .table-row:active {
175
+ background-color: rgba(77, 79, 236, 0.2);
176
+ }
177
+
178
+ /* 当抽屉打开时,禁用表格行的点击效果 */
179
+ .drawer.show ~ .table-body .table-row:active {
180
+ background-color: transparent;
181
+ }
182
+
183
+ @keyframes highlight {
184
+ 0% {
185
+ background-color: rgba(77, 79, 236, 0.2);
186
+ }
187
+ 100% {
188
+ background-color: transparent;
189
+ }
190
+ }
191
+
192
+ .table-row.highlight {
193
+ animation: highlight 3s ease-out;
194
+ }
195
+
196
+ .col {
197
+ padding: 0 8px;
198
+ overflow: hidden;
199
+ text-overflow: ellipsis;
200
+ white-space: nowrap;
201
+ line-height: 1.4;
202
+ }
203
+
204
+ .col.key {
205
+ width: 30%;
206
+ color: #202124;
207
+ font-weight: 500;
208
+ }
209
+
210
+ .col.value {
211
+ width: 50%;
212
+ color: #5f6368;
213
+ }
214
+
215
+ .col.type {
216
+ width: 20%;
217
+ color: #5f6368;
218
+ text-align: right;
219
+ font-size: 12px;
220
+ }
221
+
222
+ /* 抽屉样式 */
223
+ .drawer {
224
+ position: absolute;
225
+ top: 0;
226
+ right: -100%;
227
+ width: 100%;
228
+ height: 100%;
229
+ background: #ffffff;
230
+ box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
231
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
232
+ z-index: 100;
233
+ display: flex;
234
+ flex-direction: column;
235
+ border-left: 1px solid #e0e0e0;
236
+ pointer-events: auto;
237
+ }
238
+
239
+ .drawer.show {
240
+ right: 0;
241
+ }
242
+
243
+ .drawer-header {
244
+ display: flex;
245
+ align-items: center;
246
+ justify-content: space-between;
247
+ padding: 8px 12px;
248
+ border-bottom: 1px solid #e0e0e0;
249
+ background: #f8f9fa;
250
+ height: 32px;
251
+ position: relative;
252
+ }
253
+
254
+ .drawer-header::after {
255
+ content: '';
256
+ position: absolute;
257
+ bottom: 0;
258
+ left: 0;
259
+ right: 0;
260
+ height: 1px;
261
+ background: linear-gradient(to right, transparent, #e0e0e0, transparent);
262
+ opacity: 0.5;
263
+ }
264
+
265
+ .drawer-title {
266
+ font-size: 13px;
267
+ font-weight: 500;
268
+ color: #202124;
269
+ flex: 1;
270
+ margin-right: 8px;
271
+ overflow: hidden;
272
+ text-overflow: ellipsis;
273
+ white-space: nowrap;
274
+ display: flex;
275
+ align-items: center;
276
+ }
277
+
278
+ .drawer-title::before {
279
+ content: '';
280
+ display: inline-block;
281
+ width: 3px;
282
+ height: 14px;
283
+ background: #4d4fec;
284
+ margin-right: 8px;
285
+ border-radius: 2px;
286
+ }
287
+
288
+ .drawer-close {
289
+ width: 24px;
290
+ height: 24px;
291
+ display: flex;
292
+ align-items: center;
293
+ justify-content: center;
294
+ color: #5f6368;
295
+ border-radius: 50%;
296
+ transition: all 0.2s ease;
297
+ position: relative;
298
+ }
299
+
300
+ .drawer-close::before {
301
+ content: '×';
302
+ font-size: 16px;
303
+ line-height: 1;
304
+ position: absolute;
305
+ top: 50%;
306
+ left: 50%;
307
+ transform: translate(-50%, -50%);
308
+ }
309
+
310
+ .drawer-close:hover {
311
+ background: #f1f3f4;
312
+ }
313
+
314
+ .drawer-close:active {
315
+ background: #e8eaed;
316
+ color: #202124;
317
+ }
318
+
319
+ .drawer-content {
320
+ flex: 1;
321
+ overflow-y: auto;
322
+ padding: 16px;
323
+ background: #ffffff;
324
+ }
325
+
326
+ .value-preview {
327
+ background: #f8f9fa;
328
+ border-radius: 8px;
329
+ padding: 16px;
330
+ border: 1px solid #e0e0e0;
331
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
332
+ transition: all 0.2s ease;
333
+ }
334
+
335
+ .value-preview:hover {
336
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
337
+ }
338
+
339
+ .type-info {
340
+ font-size: 12px;
341
+ color: #5f6368;
342
+ margin-bottom: 12px;
343
+ padding-bottom: 8px;
344
+ border-bottom: 1px solid #e0e0e0;
345
+ display: flex;
346
+ align-items: center;
347
+ justify-content: space-between;
348
+ }
349
+
350
+ .copy-btn {
351
+ width: 20px;
352
+ height: 20px;
353
+ display: flex;
354
+ align-items: center;
355
+ justify-content: center;
356
+ border-radius: 4px;
357
+ transition: all 0.2s ease;
358
+ cursor: pointer;
359
+ }
360
+
361
+ .copy-btn:hover {
362
+ background: #f1f3f4;
363
+ }
364
+
365
+ .copy-btn:active {
366
+ background: #e8eaed;
367
+ }
368
+
369
+ .icon.copy {
370
+ width: 14px;
371
+ height: 14px;
372
+ background: 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") no-repeat center;
373
+ background-size: contain;
374
+ opacity: 0.8;
375
+ }
376
+
377
+ .text-value {
378
+ font-family: 'Consolas', 'Monaco', monospace;
379
+ font-size: 13px;
380
+ white-space: pre-wrap;
381
+ word-break: break-all;
382
+ color: #202124;
383
+ line-height: 1.6;
384
+ padding: 4px 0;
385
+ }
386
+
387
+ /* 滚动条样式 */
388
+ .drawer-content::-webkit-scrollbar {
389
+ width: 8px;
390
+ }
391
+
392
+ .drawer-content::-webkit-scrollbar-track {
393
+ background: transparent;
394
+ }
395
+
396
+ .drawer-content::-webkit-scrollbar-thumb {
397
+ background: #dadce0;
398
+ border-radius: 4px;
399
+ }
400
+
401
+ .drawer-content::-webkit-scrollbar-thumb:hover {
402
+ background: #bdc1c6;
403
+ }
404
+
405
+ /* 当抽屉打开时,禁用表格区域的点击事件 */
406
+ .drawer.show ~ .table-body {
407
+ pointer-events: none;
408
+ }
409
+
410
+ .data-size {
411
+ font-size: 12px;
412
+ color: #5f6368;
413
+ margin-left: 12px;
414
+ padding: 4px 8px;
415
+ background: #f8f9fa;
416
+ border-radius: 4px;
417
+ border: 1px solid #e0e0e0;
418
+ display: flex;
419
+ align-items: center;
420
+ gap: 4px;
421
+ }
422
+
423
+ .size-label {
424
+ color: #5f6368;
425
+ opacity: 0.8;
426
+ }
427
+
428
+ .size-value {
429
+ color: #202124;
430
+ font-weight: 500;
431
+ }
@@ -0,0 +1,218 @@
1
+ Component({
2
+ properties: {
3
+ data: {
4
+ type: Array,
5
+ value: []
6
+ }
7
+ },
8
+
9
+ data: {
10
+ searchText: '',
11
+ showDrawer: false,
12
+ selectedItem: null,
13
+ filteredData: [],
14
+ parsedData: [],
15
+ dataSize: '0 KB'
16
+ },
17
+
18
+ observers: {
19
+ data: function (data) {
20
+ if (!Array.isArray(data)) {
21
+ console.error('TableView: data must be an array');
22
+ return;
23
+ }
24
+
25
+ // 计算数据大小
26
+ const dataSize = this.calculateDataSize(data);
27
+ this.setData({ dataSize });
28
+
29
+ // 解析数据源中的每个对象
30
+ const parsedData = data
31
+ .map(item => {
32
+ if (typeof item !== 'object' || item === null) {
33
+ console.warn('TableView: invalid item in data array:', item);
34
+ return null;
35
+ }
36
+
37
+ // 获取对象的第一个属性
38
+ const key = Object.keys(item)[0];
39
+ const value = item[key];
40
+
41
+ // 确定值的类型
42
+ let type = typeof value;
43
+ if (Array.isArray(value)) {
44
+ type = 'array';
45
+ } else if (value === null) {
46
+ type = 'null';
47
+ } else if (type === 'object') {
48
+ type = 'object';
49
+ }
50
+
51
+ // 序列化对象和数组类型的值
52
+ let serializedValue = value;
53
+ if (type === 'object' || type === 'array') {
54
+ try {
55
+ serializedValue = JSON.stringify(value, null, 2);
56
+ } catch (e) {
57
+ console.error('TableView: failed to serialize value:', e);
58
+ serializedValue = String(value);
59
+ }
60
+ }
61
+
62
+ return {
63
+ key,
64
+ value,
65
+ type,
66
+ serializedValue,
67
+ highlight: false
68
+ };
69
+ })
70
+ .filter(item => item !== null);
71
+
72
+ this.setData({
73
+ parsedData,
74
+ filteredData: parsedData
75
+ });
76
+ }
77
+ },
78
+
79
+ methods: {
80
+ calculateDataSize(data) {
81
+ try {
82
+ const jsonString = JSON.stringify(data);
83
+ const bytes = new TextEncoder().encode(jsonString).length;
84
+
85
+ if (bytes < 1024) {
86
+ return `${bytes} B`;
87
+ } else if (bytes < 1024 * 1024) {
88
+ return `${(bytes / 1024).toFixed(1)} KB`;
89
+ } else {
90
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
91
+ }
92
+ } catch (e) {
93
+ console.error('TableView: failed to calculate data size:', e);
94
+ return '0 B';
95
+ }
96
+ },
97
+
98
+ handleSearch(e) {
99
+ const searchText = e.detail.value.toLowerCase();
100
+ this.setData({ searchText });
101
+
102
+ const filteredData = this.data.parsedData.filter(item => {
103
+ const keyMatch = item.key.toLowerCase().includes(searchText);
104
+ const valueMatch = String(item.value).toLowerCase().includes(searchText);
105
+ return keyMatch || valueMatch;
106
+ });
107
+
108
+ this.setData({ filteredData });
109
+ },
110
+
111
+ handleClear() {
112
+ this.setData({
113
+ searchText: '',
114
+ filteredData: this.data.parsedData,
115
+ dataSize: '0 B'
116
+ });
117
+ },
118
+
119
+ handleRefresh() {
120
+ // 重新解析数据
121
+ const parsedData = this.data.data.map(item => {
122
+ const key = Object.keys(item)[0];
123
+ const value = item[key];
124
+
125
+ let type = typeof value;
126
+ if (Array.isArray(value)) {
127
+ type = 'array';
128
+ } else if (value === null) {
129
+ type = 'null';
130
+ } else if (type === 'object') {
131
+ type = 'object';
132
+ }
133
+
134
+ let serializedValue = value;
135
+ if (type === 'object' || type === 'array') {
136
+ try {
137
+ serializedValue = JSON.stringify(value, null, 2);
138
+ } catch (e) {
139
+ console.error('TableView: failed to serialize value:', e);
140
+ serializedValue = String(value);
141
+ }
142
+ }
143
+
144
+ return {
145
+ key,
146
+ value,
147
+ type,
148
+ serializedValue,
149
+ highlight: true
150
+ };
151
+ });
152
+
153
+ // 更新数据大小
154
+ const dataSize = this.calculateDataSize(this.data.data);
155
+
156
+ this.setData({
157
+ parsedData,
158
+ filteredData: parsedData,
159
+ dataSize
160
+ });
161
+
162
+ // 3秒后移除高亮效果
163
+ setTimeout(() => {
164
+ const filteredData = this.data.filteredData.map(item => ({
165
+ ...item,
166
+ highlight: false
167
+ }));
168
+ this.setData({ filteredData });
169
+ }, 3000);
170
+ },
171
+
172
+ handleValueClick(e) {
173
+ const item = e.currentTarget.dataset.item;
174
+ this.setData({
175
+ selectedItem: item,
176
+ showDrawer: true
177
+ });
178
+ },
179
+
180
+ handleCloseDrawer() {
181
+ this.setData({
182
+ showDrawer: false,
183
+ selectedItem: null
184
+ });
185
+ },
186
+
187
+ handleCopyValue() {
188
+ const { selectedItem } = this.data;
189
+ if (!selectedItem) return;
190
+
191
+ // 获取要复制的值
192
+ const valueToCopy =
193
+ selectedItem.type === 'object' || selectedItem.type === 'array'
194
+ ? selectedItem.serializedValue
195
+ : String(selectedItem.value);
196
+
197
+ // 复制到剪贴板
198
+ wx.setClipboardData({
199
+ data: valueToCopy,
200
+ success: () => {
201
+ wx.showToast({
202
+ title: '已复制',
203
+ icon: 'success',
204
+ duration: 1500
205
+ });
206
+ },
207
+ fail: err => {
208
+ console.error('TableView: failed to copy value:', err);
209
+ wx.showToast({
210
+ title: '复制失败',
211
+ icon: 'error',
212
+ duration: 1500
213
+ });
214
+ }
215
+ });
216
+ }
217
+ }
218
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "json-viewer": "../json-view/index"
5
+ }
6
+ }
@@ -0,0 +1 @@
1
+ @import '../less/table-view.less';
@@ -0,0 +1,83 @@
1
+ <view class="table-view">
2
+ <!-- 操作栏 -->
3
+ <view class="action-bar">
4
+ <view class="btn refresh" bindtap="handleRefresh" title="刷新">
5
+ <view class="icon">↻</view>
6
+ </view>
7
+ <view class="search-box">
8
+ <input
9
+ class="search-input"
10
+ placeholder="输入关键字过滤"
11
+ value="{{searchText}}"
12
+ bindinput="handleSearch"
13
+ />
14
+ </view>
15
+ <view class="btn clear" bindtap="handleClear" title="清空">
16
+ <view class="icon trash"></view>
17
+ </view>
18
+ <view class="data-size">
19
+ <text class="size-label">Current Size:</text>
20
+ <text class="size-value">{{dataSize}}</text>
21
+ </view>
22
+ </view>
23
+
24
+ <!-- 表格区域 -->
25
+ <view class="table-container">
26
+ <!-- 表格头部 -->
27
+ <view class="table-header">
28
+ <view class="col key">Key</view>
29
+ <view class="col value">Value</view>
30
+ <view class="col type">Type</view>
31
+ </view>
32
+
33
+ <!-- 表格内容 -->
34
+ <scroll-view class="table-body" scroll-y>
35
+ <view
36
+ class="table-row {{item.highlight ? 'highlight' : ''}}"
37
+ wx:for="{{filteredData}}"
38
+ wx:key="key"
39
+ bindtap="handleValueClick"
40
+ data-item="{{item}}"
41
+ >
42
+ <view class="col key">{{item.key}}</view>
43
+ <view class="col value">
44
+ <block wx:if="{{item.type === 'object' || item.type === 'array'}}">
45
+ {{item.serializedValue}}
46
+ </block>
47
+ <block wx:else>
48
+ {{item.value}}
49
+ </block>
50
+ </view>
51
+ <view class="col type">{{item.type}}</view>
52
+ </view>
53
+ </scroll-view>
54
+
55
+ <!-- 详情抽屉 -->
56
+ <view class="drawer {{showDrawer ? 'show' : ''}}" style="width: 70%">
57
+ <view class="drawer-header">
58
+ <view class="drawer-title">{{selectedItem.key}}</view>
59
+ <view class="drawer-close" bindtap="handleCloseDrawer">×</view>
60
+ </view>
61
+
62
+ <view class="drawer-content">
63
+ <view class="value-preview">
64
+ <view class="type-info">
65
+ <text>类型:{{selectedItem.type}}</text>
66
+ <view class="copy-btn" bindtap="handleCopyValue" title="复制值">
67
+ <view class="icon copy"></view>
68
+ </view>
69
+ </view>
70
+ <block wx:if="{{selectedItem.type === 'object' || selectedItem.type === 'array'}}">
71
+ <json-view
72
+ json-data="{{selectedItem.value}}"
73
+ expand-level="1"
74
+ />
75
+ </block>
76
+ <block wx:else>
77
+ <text class="text-value">{{selectedItem.value}}</text>
78
+ </block>
79
+ </view>
80
+ </view>
81
+ </view>
82
+ </view>
83
+ </view>
@@ -0,0 +1,374 @@
1
+ .table-view {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ background: #ffffff;
7
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
8
+ }
9
+ /* 操作栏样式 */
10
+ .action-bar {
11
+ padding: 8px 12px;
12
+ border-bottom: 1px solid #e0e0e0;
13
+ display: flex;
14
+ justify-content: space-between;
15
+ align-items: center;
16
+ background: #f5f5f5;
17
+ height: 40px;
18
+ flex-shrink: 0;
19
+ }
20
+ .actions {
21
+ display: flex;
22
+ gap: 6px;
23
+ align-items: center;
24
+ }
25
+ .search-box {
26
+ flex: 1;
27
+ margin: 0 8px;
28
+ position: relative;
29
+ max-width: 300px;
30
+ height: 28px;
31
+ display: flex;
32
+ align-items: center;
33
+ }
34
+ .search-input {
35
+ width: 100%;
36
+ height: 100%;
37
+ padding: 0 8px 0 28px;
38
+ border: 1px solid #dadce0;
39
+ border-radius: 4px;
40
+ font-size: 13px;
41
+ background: #ffffff;
42
+ transition: all 0.2s ease;
43
+ }
44
+ .search-input:focus {
45
+ border-color: #4d4fec;
46
+ box-shadow: 0 0 0 1px #4d4fec;
47
+ }
48
+ .search-box::before {
49
+ content: '';
50
+ position: absolute;
51
+ left: 8px;
52
+ top: 50%;
53
+ transform: translateY(-50%);
54
+ width: 14px;
55
+ height: 14px;
56
+ 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%3Cpath d='M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z'/%3E%3C/svg%3E") no-repeat center;
57
+ background-size: contain;
58
+ opacity: 0.5;
59
+ }
60
+ .btn {
61
+ width: 28px;
62
+ height: 28px;
63
+ padding: 0;
64
+ font-size: 13px;
65
+ border: 1px solid #dadce0;
66
+ border-radius: 4px;
67
+ transition: all 0.2s ease;
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ position: relative;
72
+ overflow: hidden;
73
+ background: #ffffff;
74
+ color: #5f6368;
75
+ flex-shrink: 0;
76
+ }
77
+ .btn .icon {
78
+ font-size: 16px;
79
+ line-height: 1;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ width: 16px;
84
+ height: 16px;
85
+ }
86
+ .btn .icon.trash {
87
+ width: 14px;
88
+ height: 14px;
89
+ background: 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") no-repeat center;
90
+ background-size: contain;
91
+ opacity: 1;
92
+ }
93
+ .btn:hover {
94
+ background: #f8f9fa;
95
+ }
96
+ .btn:active {
97
+ background: #f1f3f4;
98
+ }
99
+ .btn.refresh:hover {
100
+ background: rgba(77, 79, 236, 0.1);
101
+ }
102
+ .btn.refresh:active {
103
+ background: rgba(77, 79, 236, 0.2);
104
+ }
105
+ .btn.clear {
106
+ color: #5f6368;
107
+ border-color: #dadce0;
108
+ }
109
+ .btn.clear:hover {
110
+ background: #f8f9fa;
111
+ }
112
+ .btn.clear:active {
113
+ background: #f1f3f4;
114
+ }
115
+ /* 表格容器 */
116
+ .table-container {
117
+ flex: 1;
118
+ position: relative;
119
+ overflow: hidden;
120
+ }
121
+ /* 表格样式 */
122
+ .table-header {
123
+ display: flex;
124
+ padding: 8px 12px;
125
+ background: #f8f9fa;
126
+ border-bottom: 1px solid #dadce0;
127
+ font-weight: 500;
128
+ color: #5f6368;
129
+ font-size: 13px;
130
+ height: 32px;
131
+ align-items: center;
132
+ }
133
+ .table-body {
134
+ height: calc(100% - 32px);
135
+ overflow-y: auto;
136
+ }
137
+ .table-row {
138
+ display: flex;
139
+ padding: 8px 12px;
140
+ border-bottom: 1px solid #f1f3f4;
141
+ transition: all 0.2s ease;
142
+ height: 32px;
143
+ align-items: center;
144
+ font-size: 13px;
145
+ position: relative;
146
+ z-index: 1;
147
+ }
148
+ .table-row:hover {
149
+ background-color: #f8f9fa;
150
+ }
151
+ .table-row:active {
152
+ background-color: rgba(77, 79, 236, 0.2);
153
+ }
154
+ /* 当抽屉打开时,禁用表格行的点击效果 */
155
+ .drawer.show ~ .table-body .table-row:active {
156
+ background-color: transparent;
157
+ }
158
+ @keyframes highlight {
159
+ 0% {
160
+ background-color: rgba(77, 79, 236, 0.2);
161
+ }
162
+ 100% {
163
+ background-color: transparent;
164
+ }
165
+ }
166
+ .table-row.highlight {
167
+ animation: highlight 3s ease-out;
168
+ }
169
+ .col {
170
+ padding: 0 8px;
171
+ overflow: hidden;
172
+ text-overflow: ellipsis;
173
+ white-space: nowrap;
174
+ line-height: 1.4;
175
+ }
176
+ .col.key {
177
+ width: 30%;
178
+ color: #202124;
179
+ font-weight: 500;
180
+ }
181
+ .col.value {
182
+ width: 50%;
183
+ color: #5f6368;
184
+ }
185
+ .col.type {
186
+ width: 20%;
187
+ color: #5f6368;
188
+ text-align: right;
189
+ font-size: 12px;
190
+ }
191
+ /* 抽屉样式 */
192
+ .drawer {
193
+ position: absolute;
194
+ top: 0;
195
+ right: -100%;
196
+ width: 100%;
197
+ height: 100%;
198
+ background: #ffffff;
199
+ box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
200
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
201
+ z-index: 100;
202
+ display: flex;
203
+ flex-direction: column;
204
+ border-left: 1px solid #e0e0e0;
205
+ pointer-events: auto;
206
+ }
207
+ .drawer.show {
208
+ right: 0;
209
+ }
210
+ .drawer-header {
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: space-between;
214
+ padding: 8px 12px;
215
+ border-bottom: 1px solid #e0e0e0;
216
+ background: #f8f9fa;
217
+ height: 32px;
218
+ position: relative;
219
+ }
220
+ .drawer-header::after {
221
+ content: '';
222
+ position: absolute;
223
+ bottom: 0;
224
+ left: 0;
225
+ right: 0;
226
+ height: 1px;
227
+ background: linear-gradient(to right, transparent, #e0e0e0, transparent);
228
+ opacity: 0.5;
229
+ }
230
+ .drawer-title {
231
+ font-size: 13px;
232
+ font-weight: 500;
233
+ color: #202124;
234
+ flex: 1;
235
+ margin-right: 8px;
236
+ overflow: hidden;
237
+ text-overflow: ellipsis;
238
+ white-space: nowrap;
239
+ display: flex;
240
+ align-items: center;
241
+ }
242
+ .drawer-title::before {
243
+ content: '';
244
+ display: inline-block;
245
+ width: 3px;
246
+ height: 14px;
247
+ background: #4d4fec;
248
+ margin-right: 8px;
249
+ border-radius: 2px;
250
+ }
251
+ .drawer-close {
252
+ width: 24px;
253
+ height: 24px;
254
+ display: flex;
255
+ align-items: center;
256
+ justify-content: center;
257
+ color: #5f6368;
258
+ border-radius: 50%;
259
+ transition: all 0.2s ease;
260
+ position: relative;
261
+ }
262
+ .drawer-close::before {
263
+ content: '×';
264
+ font-size: 16px;
265
+ line-height: 1;
266
+ position: absolute;
267
+ top: 50%;
268
+ left: 50%;
269
+ transform: translate(-50%, -50%);
270
+ }
271
+ .drawer-close:hover {
272
+ background: #f1f3f4;
273
+ }
274
+ .drawer-close:active {
275
+ background: #e8eaed;
276
+ color: #202124;
277
+ }
278
+ .drawer-content {
279
+ flex: 1;
280
+ overflow-y: auto;
281
+ padding: 16px;
282
+ background: #ffffff;
283
+ }
284
+ .value-preview {
285
+ background: #f8f9fa;
286
+ border-radius: 8px;
287
+ padding: 16px;
288
+ border: 1px solid #e0e0e0;
289
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
290
+ transition: all 0.2s ease;
291
+ }
292
+ .value-preview:hover {
293
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
294
+ }
295
+ .type-info {
296
+ font-size: 12px;
297
+ color: #5f6368;
298
+ margin-bottom: 12px;
299
+ padding-bottom: 8px;
300
+ border-bottom: 1px solid #e0e0e0;
301
+ display: flex;
302
+ align-items: center;
303
+ justify-content: space-between;
304
+ }
305
+ .copy-btn {
306
+ width: 20px;
307
+ height: 20px;
308
+ display: flex;
309
+ align-items: center;
310
+ justify-content: center;
311
+ border-radius: 4px;
312
+ transition: all 0.2s ease;
313
+ cursor: pointer;
314
+ }
315
+ .copy-btn:hover {
316
+ background: #f1f3f4;
317
+ }
318
+ .copy-btn:active {
319
+ background: #e8eaed;
320
+ }
321
+ .icon.copy {
322
+ width: 14px;
323
+ height: 14px;
324
+ background: 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") no-repeat center;
325
+ background-size: contain;
326
+ opacity: 0.8;
327
+ }
328
+ .text-value {
329
+ font-family: 'Consolas', 'Monaco', monospace;
330
+ font-size: 13px;
331
+ white-space: pre-wrap;
332
+ word-break: break-all;
333
+ color: #202124;
334
+ line-height: 1.6;
335
+ padding: 4px 0;
336
+ }
337
+ /* 滚动条样式 */
338
+ .drawer-content::-webkit-scrollbar {
339
+ width: 8px;
340
+ }
341
+ .drawer-content::-webkit-scrollbar-track {
342
+ background: transparent;
343
+ }
344
+ .drawer-content::-webkit-scrollbar-thumb {
345
+ background: #dadce0;
346
+ border-radius: 4px;
347
+ }
348
+ .drawer-content::-webkit-scrollbar-thumb:hover {
349
+ background: #bdc1c6;
350
+ }
351
+ /* 当抽屉打开时,禁用表格区域的点击事件 */
352
+ .drawer.show ~ .table-body {
353
+ pointer-events: none;
354
+ }
355
+ .data-size {
356
+ font-size: 12px;
357
+ color: #5f6368;
358
+ margin-left: 12px;
359
+ padding: 4px 8px;
360
+ background: #f8f9fa;
361
+ border-radius: 4px;
362
+ border: 1px solid #e0e0e0;
363
+ display: flex;
364
+ align-items: center;
365
+ gap: 4px;
366
+ }
367
+ .size-label {
368
+ color: #5f6368;
369
+ opacity: 0.8;
370
+ }
371
+ .size-value {
372
+ color: #202124;
373
+ font-weight: 500;
374
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@we-debug/miniprogram",
3
- "version": "0.43.5",
3
+ "version": "0.44.0",
4
4
  "description": "we-debug miniprogram component",
5
5
  "author": {
6
6
  "name": "dlhandsome"
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@we-debug/core": "0.43.4"
29
+ "@we-debug/core": "0.44.0"
30
30
  },
31
31
  "readme": "ERROR: No README data found!",
32
32
  "_id": "@we-debug/core@0.3.5",
33
33
  "_commitid": "6c3f04b",
34
- "gitHead": "accdda789f3a1a2bee8753a4615d99ed30f9bcc6"
34
+ "gitHead": "d7451a394de645a2db8e32c81f07df47a6e5aa26"
35
35
  }