vite-uni-dev-tool 0.0.12 → 0.0.14
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/dist/const.d.ts +133 -0
- package/dist/const.d.ts.map +1 -0
- package/dist/const.js +36 -0
- package/dist/core.d.ts +52 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +80 -0
- package/dist/devConsole/index.d.ts +169 -0
- package/dist/devConsole/index.d.ts.map +1 -0
- package/dist/devConsole/index.js +270 -0
- package/dist/devEvent/index.d.ts +286 -0
- package/dist/devEvent/index.d.ts.map +1 -0
- package/dist/devEvent/index.js +435 -0
- package/dist/devEventBus/index.d.ts +42 -0
- package/dist/devEventBus/index.d.ts.map +1 -0
- package/dist/devEventBus/index.js +70 -0
- package/dist/devIntercept/index.d.ts +119 -0
- package/dist/devIntercept/index.d.ts.map +1 -0
- package/dist/devIntercept/index.js +582 -0
- package/dist/devRunJS/index.d.ts +67 -0
- package/dist/devRunJS/index.d.ts.map +1 -0
- package/dist/devStore/index.d.ts +178 -0
- package/dist/devStore/index.d.ts.map +1 -0
- package/dist/devStore/index.js +395 -0
- package/dist/devToolInfo/index.d.ts +17 -0
- package/dist/devToolInfo/index.d.ts.map +1 -0
- package/dist/devToolInfo/index.js +15 -0
- package/{dev → dist}/plugins/uniDevTool/uniDevTool.d.ts +7 -1
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -0
- package/dist/plugins/uniDevTool/uniDevTool.js +35 -0
- package/{dev → dist}/plugins/utils/index.d.ts +3 -0
- package/{dev → dist}/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +1 -0
- package/dist/type.d.ts +264 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/utils/array.d.ts +2 -0
- package/dist/utils/array.d.ts.map +1 -0
- package/dist/utils/array.js +12 -0
- package/dist/utils/date.d.ts +19 -0
- package/dist/utils/date.d.ts.map +1 -0
- package/dist/utils/date.js +40 -0
- package/dist/utils/file.d.ts +11 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +87 -0
- package/dist/utils/function.d.ts +28 -0
- package/dist/utils/function.d.ts.map +1 -0
- package/dist/utils/function.js +46 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +55 -0
- package/dist/utils/ip.d.ts +5 -0
- package/dist/utils/ip.d.ts.map +1 -0
- package/dist/utils/ip.js +21 -0
- package/dist/utils/language.d.ts +29 -0
- package/dist/utils/language.d.ts.map +1 -0
- package/dist/utils/language.js +50 -0
- package/dist/utils/object.d.ts +49 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +118 -0
- package/dist/utils/page.d.ts +7 -0
- package/dist/utils/page.d.ts.map +1 -0
- package/dist/utils/page.js +7 -0
- package/dist/utils/platform.d.ts +4 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +14 -0
- package/dist/utils/string.d.ts +45 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +88 -0
- package/dist/utils/utils.d.ts +16 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/v2/AppInfo/index.vue +41 -0
- package/dist/v2/AutoSizer/index.vue +189 -0
- package/dist/v2/AutoSizer/index1.vue +193 -0
- package/dist/v2/AutoSizer/utils.d.ts +5 -0
- package/dist/v2/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v2/CaptureScreen/index.vue +78 -0
- package/dist/v2/CloseButton/index.vue +32 -0
- package/dist/v2/Connection/index.vue +94 -0
- package/dist/v2/ConsoleList/ConsoleItem.vue +235 -0
- package/dist/v2/ConsoleList/RunJSInput.vue +243 -0
- package/dist/v2/ConsoleList/index.vue +164 -0
- package/dist/v2/ConsoleList/staticTips.js +1144 -0
- package/dist/v2/DevTool/index.vue +162 -0
- package/dist/v2/DevToolButton/index.vue +228 -0
- package/dist/v2/DevToolTitle/index.vue +28 -0
- package/dist/v2/DevToolWindow/index.vue +1051 -0
- package/dist/v2/DeviceInfo/index.vue +48 -0
- package/dist/v2/Empty/index.vue +40 -0
- package/dist/v2/FilterInput/index.vue +100 -0
- package/dist/v2/JsonPretty/components/Brackets/index.vue +30 -0
- package/dist/v2/JsonPretty/components/Carets/index.vue +65 -0
- package/dist/v2/JsonPretty/components/CheckController/index.vue +127 -0
- package/dist/v2/JsonPretty/components/TreeNode/index.vue +417 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v2/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v2/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v2/JsonPretty/index.vue +531 -0
- package/dist/v2/JsonPretty/type.d.ts +93 -0
- package/dist/v2/JsonPretty/type.d.ts.map +1 -0
- package/dist/v2/JsonPretty/utils/index.js +211 -0
- package/dist/v2/NetworkList/NetworkDetail.vue +215 -0
- package/dist/v2/NetworkList/NetworkItem.vue +135 -0
- package/dist/v2/NetworkList/index.vue +148 -0
- package/dist/v2/PiniaList/index.vue +79 -0
- package/dist/v2/RouteList/index.vue +137 -0
- package/dist/v2/SettingList/index.vue +318 -0
- package/dist/v2/SourceCode/index.vue +237 -0
- package/dist/v2/StorageList/index.vue +165 -0
- package/dist/v2/SystemInfo/index.vue +49 -0
- package/dist/v2/Tabs/index.vue +127 -0
- package/dist/v2/Tag/index.vue +91 -0
- package/dist/v2/UniEvent/UniEventItem.vue +157 -0
- package/dist/v2/UniEvent/index.vue +127 -0
- package/dist/v2/UploadList/UploadDetail.vue +204 -0
- package/dist/v2/UploadList/UploadItem.vue +134 -0
- package/dist/v2/UploadList/index.vue +143 -0
- package/dist/v2/VirtualList/index.vue +140 -0
- package/dist/v2/VirtualListPro/AutoSize.vue +50 -0
- package/dist/v2/VirtualListPro/index.vue +255 -0
- package/dist/v2/VuexList/index.vue +80 -0
- package/dist/v2/WebSocket/WebSocketItem.vue +129 -0
- package/dist/v2/WebSocket/WebSocketList.vue +183 -0
- package/dist/v2/WebSocket/index.vue +155 -0
- package/dist/v2/WindowInfo/index.vue +49 -0
- package/{dev/components → dist/v3}/AppInfo/index.vue +0 -1
- package/dist/v3/AutoSizer/utils.d.ts +5 -0
- package/dist/v3/AutoSizer/utils.d.ts.map +1 -0
- package/dist/v3/AutoSizer/utils.ts +49 -0
- package/{dev/components → dist/v3}/CloseButton/index.vue +5 -2
- package/{dev/components → dist/v3}/ConsoleList/ConsoleItem.vue +10 -9
- package/{dev/components → dist/v3}/ConsoleList/RunJSInput.vue +5 -2
- package/dist/v3/ConsoleList/staticTips.d.ts +13 -0
- package/dist/v3/ConsoleList/staticTips.d.ts.map +1 -0
- package/{dev/components → dist/v3}/DevTool/index.vue +33 -4
- package/{dev/components → dist/v3}/DevToolWindow/index.vue +67 -4
- package/dist/v3/Empty/empty.png +0 -0
- package/{dev/components → dist/v3}/FilterInput/index.vue +5 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +4 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useClipboard.ts +21 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts +8 -0
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +1 -0
- package/dist/v3/JsonPretty/hooks/useError.ts +21 -0
- package/{dev/components → dist/v3}/JsonPretty/index.vue +10 -10
- package/dist/v3/JsonPretty/type.d.ts +93 -0
- package/dist/v3/JsonPretty/type.d.ts.map +1 -0
- package/dist/v3/JsonPretty/type.ts +125 -0
- package/dist/v3/JsonPretty/utils/index.d.ts +10 -0
- package/dist/v3/JsonPretty/utils/index.d.ts.map +1 -0
- package/{dev/components → dist/v3}/NetworkList/NetworkDetail.vue +2 -2
- package/{dev/components → dist/v3}/NetworkList/NetworkItem.vue +2 -1
- package/dist/v3/RunJS/index.vue +128 -0
- package/{dev/components → dist/v3}/SettingList/index.vue +128 -37
- package/{dev/components → dist/v3}/SourceCode/index.vue +2 -2
- package/{dev/components → dist/v3}/Tag/index.vue +4 -4
- package/{dev/components → dist/v3}/UploadList/UploadDetail.vue +3 -15
- package/{dev/components → dist/v3}/UploadList/UploadItem.vue +1 -1
- package/dist/v3/VirtualListPro/readme.md +40 -0
- package/{dev/components → dist/v3}/WebSocket/WebSocketItem.vue +1 -1
- package/{dev/components → dist/v3}/WebSocket/WebSocketList.vue +3 -15
- package/package.json +5 -5
- package/dev/components/Button/index.vue +0 -34
- package/dev/components/Checkbox/index.vue +0 -40
- package/dev/components/Code/index.vue +0 -230
- package/dev/components/ConsoleList/Code.vue +0 -227
- package/dev/const.ts +0 -164
- package/dev/core.ts +0 -118
- package/dev/devConsole/index.ts +0 -350
- package/dev/devEvent/index.ts +0 -810
- package/dev/devEventBus/index.ts +0 -94
- package/dev/devIntercept/index.ts +0 -745
- package/dev/devRunJS/index.ts +0 -170
- package/dev/devStore/index.ts +0 -732
- package/dev/devToolInfo/index.ts +0 -26
- package/dev/plugins/uniDevTool/uniDevTool.d.ts.map +0 -1
- package/dev/plugins/uniDevTool/uniDevTool.js +0 -36
- package/dev/plugins/utils/index.js +0 -1
- package/dev/shims-uni.d.ts +0 -43
- package/dev/type.ts +0 -291
- package/dev/utils/array.ts +0 -15
- package/dev/utils/date.ts +0 -75
- package/dev/utils/file.ts +0 -121
- package/dev/utils/function.ts +0 -192
- package/dev/utils/index.d.ts +0 -6
- package/dev/utils/index.ts +0 -51
- package/dev/utils/ip.ts +0 -79
- package/dev/utils/language.ts +0 -77
- package/dev/utils/object.ts +0 -306
- package/dev/utils/page.ts +0 -13
- package/dev/utils/platform.ts +0 -14
- package/dev/utils/string.ts +0 -133
- package/dev/utils/utils.ts +0 -198
- /package/{dev → dist}/index.d.ts +0 -0
- /package/{dev → dist}/index.d.ts.map +0 -0
- /package/{dev → dist}/index.js +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +0 -0
- /package/{dev → dist}/plugins/uniGlobalComponents/uniGlobalComponents.js +0 -0
- /package/{dev/components → dist/v2}/AutoSizer/utils.ts +0 -0
- /package/{dev/components → dist/v2}/Empty/empty.png +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useClipboard.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/hooks/useError.ts +0 -0
- /package/{dev/components → dist/v2}/JsonPretty/type.ts +0 -0
- /package/{dev/components → dist/v2}/RunJS/index.vue +0 -0
- /package/{dev/components → dist/v2}/VirtualListPro/readme.md +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index.vue +0 -0
- /package/{dev/components → dist/v3}/AutoSizer/index1.vue +0 -0
- /package/{dev/components → dist/v3}/CaptureScreen/index.vue +0 -0
- /package/{dev/components → dist/v3}/Connection/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/index.vue +0 -0
- /package/{dev/components → dist/v3}/ConsoleList/staticTips.ts +0 -0
- /package/{dev/components → dist/v3}/DevToolButton/index.vue +0 -0
- /package/{dev/components → dist/v3}/DevToolTitle/index.vue +0 -0
- /package/{dev/components → dist/v3}/DeviceInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Empty/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Brackets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/Carets/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/CheckController/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/components/TreeNode/index.vue +0 -0
- /package/{dev/components → dist/v3}/JsonPretty/utils/index.ts +0 -0
- /package/{dev/components → dist/v3}/NetworkList/index.vue +0 -0
- /package/{dev/components → dist/v3}/PiniaList/index.vue +0 -0
- /package/{dev/components → dist/v3}/RouteList/index.vue +0 -0
- /package/{dev/components → dist/v3}/StorageList/index.vue +0 -0
- /package/{dev/components → dist/v3}/SystemInfo/index.vue +0 -0
- /package/{dev/components → dist/v3}/Tabs/index.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/UniEventItem.vue +0 -0
- /package/{dev/components → dist/v3}/UniEvent/index.vue +0 -0
- /package/{dev/components → dist/v3}/UploadList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualList/index.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/AutoSize.vue +0 -0
- /package/{dev/components → dist/v3}/VirtualListPro/index.vue +0 -0
- /package/{dev/components → dist/v3}/VuexList/index.vue +0 -0
- /package/{dev/components → dist/v3}/WebSocket/index.vue +0 -0
- /package/{dev/components → dist/v3}/WindowInfo/index.vue +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view class="dev-tool">
|
|
2
|
+
<view :class="`dev-tool dev-tool-${theme}`">
|
|
3
3
|
<DevToolButton
|
|
4
4
|
v-if="devToolButtonVisible"
|
|
5
5
|
:buttonSize="buttonProps.buttonSize"
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
:mode="mode"
|
|
18
18
|
:useDevSource="useDevSource"
|
|
19
19
|
:zIndex="zIndex + 1"
|
|
20
|
+
:theme="theme"
|
|
20
21
|
@close="onShowDevToolWindow(false)"
|
|
21
22
|
@sendMessage="onSendMessage"
|
|
23
|
+
@changeTheme="onChangeTheme"
|
|
22
24
|
/>
|
|
23
25
|
</view>
|
|
24
26
|
</template>
|
|
@@ -64,6 +66,8 @@ const zIndex = ref(1000);
|
|
|
64
66
|
|
|
65
67
|
const useDevSource = ref(false);
|
|
66
68
|
|
|
69
|
+
const theme = ref<string>('dart');
|
|
70
|
+
|
|
67
71
|
function onDevToolButtonClick() {
|
|
68
72
|
onShowDevToolWindow(true);
|
|
69
73
|
onSendMessage({
|
|
@@ -113,6 +117,10 @@ function onDevOptionSend(options: DevTool.DevToolOptions) {
|
|
|
113
117
|
}
|
|
114
118
|
}
|
|
115
119
|
|
|
120
|
+
function onChangeTheme(t: string) {
|
|
121
|
+
theme.value = t;
|
|
122
|
+
}
|
|
123
|
+
|
|
116
124
|
onLoad(() => {
|
|
117
125
|
// 共享状态
|
|
118
126
|
|
|
@@ -169,7 +177,6 @@ onHide(() => {
|
|
|
169
177
|
<style scoped>
|
|
170
178
|
.dev-tool {
|
|
171
179
|
--dev-tool-main-color: #9254de;
|
|
172
|
-
--dev-tool-border-color: #f0f0f0;
|
|
173
180
|
--dev-tool-normal-bg-color: #f9f9f9;
|
|
174
181
|
--dev-tool-warn-color: #ffa940;
|
|
175
182
|
--dev-tool-warn-bg-color: #fff7e6;
|
|
@@ -181,8 +188,30 @@ onHide(() => {
|
|
|
181
188
|
--dev-tool-base-font-size: 12px;
|
|
182
189
|
--dev-tool-tag-font-size: 10px;
|
|
183
190
|
--dev-tool-tips-font-size: 10px;
|
|
184
|
-
font-size: 12px;
|
|
185
|
-
|
|
186
191
|
-webkit-tap-highlight-color: transparent;
|
|
187
192
|
}
|
|
193
|
+
.dev-tool-light {
|
|
194
|
+
--dev-tool-bg-color: rgba(255, 255, 255, 0.8);
|
|
195
|
+
--dev-tool-bg2-color: rgba(255, 255, 255, 0.95);
|
|
196
|
+
|
|
197
|
+
--dev-tool-text-color: #000;
|
|
198
|
+
--dev-tool-border-color: #f0f0f0;
|
|
199
|
+
--dev-tool-info-color: #9c9c9c;
|
|
200
|
+
--dev-tool-log-color: #f9f9f9;
|
|
201
|
+
--dev-tool-nil-color: #020201;
|
|
202
|
+
--dev-tool-string-color: #888888;
|
|
203
|
+
--dev-tool-number-color: #1d8ce0;
|
|
204
|
+
--dev-tool-boolean-color: #1d8ce0;
|
|
205
|
+
--dev-tool-symbol-color: bisque;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.dev-tool-dart {
|
|
209
|
+
--dev-tool-bg-color: rgba(0, 0, 0, 0.8);
|
|
210
|
+
--dev-tool-bg2-color: rgba(43, 43, 43, 0.8);
|
|
211
|
+
|
|
212
|
+
--dev-tool-text-color: #fff;
|
|
213
|
+
--dev-tool-border-color: #3d3d3d;
|
|
214
|
+
|
|
215
|
+
--dev-tool-log-color: #f9f9f9;
|
|
216
|
+
}
|
|
188
217
|
</style>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
2
|
+
<view
|
|
3
|
+
class="dev-tool-window"
|
|
4
|
+
v-if="open"
|
|
5
|
+
:style="{ zIndex: zIndex }"
|
|
6
|
+
:class="`dev-tool-window dev-tool-window-${theme}`"
|
|
7
|
+
>
|
|
3
8
|
<!-- :style="{
|
|
4
9
|
height: `${systemInfo?.safeArea?.height}px`
|
|
5
10
|
}" -->
|
|
@@ -143,6 +148,7 @@
|
|
|
143
148
|
v-if="swiperShow(15)"
|
|
144
149
|
:devToolVisible="devToolVisible"
|
|
145
150
|
:sizeFormat="sizeFormat"
|
|
151
|
+
:theme="theme"
|
|
146
152
|
@showDevButton="onShowDevButton"
|
|
147
153
|
@restartDevTool="onRestartDevTool"
|
|
148
154
|
@restartApp="onRestartApp"
|
|
@@ -150,6 +156,7 @@
|
|
|
150
156
|
@screenshot="onScreenshot"
|
|
151
157
|
@clearCache="onClearCache"
|
|
152
158
|
@destroyDevTool="onDestroyDevTool"
|
|
159
|
+
@changeTheme="onChangeTheme"
|
|
153
160
|
/>
|
|
154
161
|
</swiper-item>
|
|
155
162
|
</swiper>
|
|
@@ -362,6 +369,7 @@ const searchUpload = ref('');
|
|
|
362
369
|
const searchWs = ref('');
|
|
363
370
|
const searchRoute = ref('');
|
|
364
371
|
const searchStorage = ref('');
|
|
372
|
+
const theme = ref('light');
|
|
365
373
|
|
|
366
374
|
const props = withDefaults(
|
|
367
375
|
defineProps<{
|
|
@@ -573,10 +581,15 @@ onMounted(() => {
|
|
|
573
581
|
currentConsoleType.value = devToolInfo?.currentConsoleType || 'all';
|
|
574
582
|
currentNetworkType.value = devToolInfo?.currentNetworkType || 'all';
|
|
575
583
|
tabScrollLeft.value = devToolInfo?.tabScrollLeft || 0;
|
|
584
|
+
theme.value = devToolInfo?.theme || 'light';
|
|
576
585
|
}
|
|
577
586
|
if (props.data) {
|
|
578
587
|
listenPostMessage(props.data);
|
|
579
588
|
}
|
|
589
|
+
|
|
590
|
+
uni.onThemeChange((res) => {
|
|
591
|
+
theme.value = res.theme;
|
|
592
|
+
});
|
|
580
593
|
});
|
|
581
594
|
|
|
582
595
|
onLoad(() => {
|
|
@@ -986,6 +999,14 @@ function onDestroyDevTool() {
|
|
|
986
999
|
});
|
|
987
1000
|
}
|
|
988
1001
|
|
|
1002
|
+
function onChangeTheme(t: string) {
|
|
1003
|
+
theme.value = t;
|
|
1004
|
+
|
|
1005
|
+
setDevToolInfo({
|
|
1006
|
+
theme: t,
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
|
|
989
1010
|
function onChangeVuex(value: Record<string, any>) {
|
|
990
1011
|
basicSendMessage({
|
|
991
1012
|
type: DEV_VUEX_CHANGE,
|
|
@@ -1003,6 +1024,20 @@ function onChangePinia(value: Record<string, any>) {
|
|
|
1003
1024
|
|
|
1004
1025
|
<style scoped>
|
|
1005
1026
|
.dev-tool-window {
|
|
1027
|
+
--dev-tool-main-color: #9254de;
|
|
1028
|
+
--dev-tool-normal-bg-color: #f9f9f9;
|
|
1029
|
+
--dev-tool-warn-color: #ffa940;
|
|
1030
|
+
--dev-tool-warn-bg-color: #fff7e6;
|
|
1031
|
+
--dev-tool-error-color: #ff4d4f;
|
|
1032
|
+
--dev-tool-error-bg-color: #fff1f0;
|
|
1033
|
+
--dev-tool-success-color: #bae637;
|
|
1034
|
+
--dev-tool-success-bg-color: #fcffe6;
|
|
1035
|
+
|
|
1036
|
+
--dev-tool-base-font-size: 12px;
|
|
1037
|
+
--dev-tool-tag-font-size: 10px;
|
|
1038
|
+
--dev-tool-tips-font-size: 10px;
|
|
1039
|
+
-webkit-tap-highlight-color: transparent;
|
|
1040
|
+
|
|
1006
1041
|
position: fixed;
|
|
1007
1042
|
top: 0;
|
|
1008
1043
|
left: 0;
|
|
@@ -1018,19 +1053,47 @@ function onChangePinia(value: Record<string, any>) {
|
|
|
1018
1053
|
width: 100vw;
|
|
1019
1054
|
height: 100vh;
|
|
1020
1055
|
font-size: 14px;
|
|
1056
|
+
color: var(--dev-tool-text-color);
|
|
1021
1057
|
box-sizing: border-box;
|
|
1058
|
+
transition: color 0.3s;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.dev-tool-window-light {
|
|
1062
|
+
--dev-tool-bg-color: rgba(255, 255, 255, 0.8);
|
|
1063
|
+
--dev-tool-bg2-color: rgba(255, 255, 255, 0.95);
|
|
1064
|
+
|
|
1065
|
+
--dev-tool-text-color: #000;
|
|
1066
|
+
--dev-tool-border-color: #f0f0f0;
|
|
1067
|
+
--dev-tool-info-color: #9c9c9c;
|
|
1068
|
+
--dev-tool-log-color: #f9f9f9;
|
|
1069
|
+
--dev-tool-nil-color: #020201;
|
|
1070
|
+
--dev-tool-string-color: #888888;
|
|
1071
|
+
--dev-tool-number-color: #1d8ce0;
|
|
1072
|
+
--dev-tool-boolean-color: #1d8ce0;
|
|
1073
|
+
--dev-tool-symbol-color: bisque;
|
|
1022
1074
|
}
|
|
1023
|
-
.dev-tool-window
|
|
1075
|
+
.dev-tool-window-dart {
|
|
1076
|
+
--dev-tool-bg-color: rgba(0, 0, 0, 0.8);
|
|
1077
|
+
--dev-tool-bg2-color: rgba(43, 43, 43, 0.8);
|
|
1078
|
+
|
|
1079
|
+
--dev-tool-text-color: #fff;
|
|
1080
|
+
--dev-tool-border-color: #3d3d3d;
|
|
1081
|
+
|
|
1082
|
+
--dev-tool-log-color: #f9f9f9;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
.dev-tool-window-bg {
|
|
1024
1086
|
position: absolute;
|
|
1025
1087
|
z-index: -1;
|
|
1026
1088
|
top: 0;
|
|
1027
1089
|
left: 0;
|
|
1028
1090
|
width: 100vw;
|
|
1029
1091
|
height: 100vh;
|
|
1030
|
-
background:
|
|
1092
|
+
background-color: var(--dev-tool-bg-color);
|
|
1031
1093
|
backdrop-filter: blur(6px);
|
|
1094
|
+
transition: background-color 0.3s;
|
|
1032
1095
|
}
|
|
1033
|
-
.dev-tool-window
|
|
1096
|
+
.dev-tool-window-container {
|
|
1034
1097
|
height: calc(100% - 32px);
|
|
1035
1098
|
overflow: auto;
|
|
1036
1099
|
}
|
|
Binary file
|
|
@@ -56,10 +56,10 @@ const debounceInput = debounce(onInput, 500);
|
|
|
56
56
|
height: 24px;
|
|
57
57
|
|
|
58
58
|
border-radius: 4px;
|
|
59
|
-
border: 1px solid
|
|
59
|
+
border: 1px solid var(--dev-tool-border-color);
|
|
60
60
|
|
|
61
|
-
background-color:
|
|
62
|
-
transition:
|
|
61
|
+
background-color: var(--dev-tool-bg-color);
|
|
62
|
+
transition: background-color 0.3s;
|
|
63
63
|
box-sizing: border-box;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -69,10 +69,11 @@ const debounceInput = debounce(onInput, 500);
|
|
|
69
69
|
box-sizing: border-box;
|
|
70
70
|
border-radius: 5;
|
|
71
71
|
font-family: inherit;
|
|
72
|
-
color:
|
|
72
|
+
color: var(--dev-tool-text-color);
|
|
73
73
|
font-weight: 400;
|
|
74
74
|
font: unset;
|
|
75
75
|
height: 24px;
|
|
76
|
+
transition: color 0.3s;
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
.filter-input-clear {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClipboard.d.ts","sourceRoot":"","sources":["../../../../dev/v3/JsonPretty/hooks/useClipboard.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY;mBAGE,MAAM;EAenC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
|
|
3
|
+
export function useClipboard() {
|
|
4
|
+
const copied = ref(false);
|
|
5
|
+
|
|
6
|
+
const copy = async (source: string) => {
|
|
7
|
+
try {
|
|
8
|
+
await navigator.clipboard.writeText(source);
|
|
9
|
+
copied.value = true;
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
copied.value = false;
|
|
12
|
+
}, 300);
|
|
13
|
+
} catch (err) {
|
|
14
|
+
console.error("[json-pretty] Copy failed: ", err);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
copy
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useError.d.ts","sourceRoot":"","sources":["../../../../dev/v3/JsonPretty/hooks/useError.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACrB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,EAAE,eAAe;;EAc1E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { watchEffect } from "vue";
|
|
2
|
+
|
|
3
|
+
type UseErrorOptions = {
|
|
4
|
+
emitListener: boolean;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function useError(message: string, { emitListener }: UseErrorOptions) {
|
|
8
|
+
const emit = () => {
|
|
9
|
+
throw new Error(`[VueJsonPretty] ${message}`);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
watchEffect(() => {
|
|
13
|
+
if (emitListener) {
|
|
14
|
+
emit();
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
emit
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
</VirtualListPro>
|
|
70
70
|
<template v-else>
|
|
71
71
|
<TreeNode
|
|
72
|
-
v-for="item in
|
|
72
|
+
v-for="item in flatData"
|
|
73
73
|
:key="item.id"
|
|
74
74
|
:data="data"
|
|
75
75
|
:rootPath="rootPath"
|
|
@@ -300,9 +300,9 @@ const updateVisibleData = (scrollTop: number = 0) => {
|
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
// 事件处理
|
|
303
|
-
const handleTreeScroll = (e: ScrollEvent) => {
|
|
304
|
-
|
|
305
|
-
};
|
|
303
|
+
// const handleTreeScroll = (e: ScrollEvent) => {
|
|
304
|
+
// // updateVisibleData(e?.detail?.scrollTop ?? 0);
|
|
305
|
+
// };
|
|
306
306
|
|
|
307
307
|
const handleSelectedChange = ({ path }: NodeDataType) => {
|
|
308
308
|
const type = props.selectableType;
|
|
@@ -379,11 +379,11 @@ watchEffect(() => {
|
|
|
379
379
|
}
|
|
380
380
|
});
|
|
381
381
|
|
|
382
|
-
watchEffect(() => {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
});
|
|
382
|
+
// watchEffect(() => {
|
|
383
|
+
// if (flatData.value) {
|
|
384
|
+
// // updateVisibleData();
|
|
385
|
+
// }
|
|
386
|
+
// });
|
|
387
387
|
|
|
388
388
|
watch(
|
|
389
389
|
() => props.deep,
|
|
@@ -415,7 +415,7 @@ watch(
|
|
|
415
415
|
|
|
416
416
|
// 生命周期钩子
|
|
417
417
|
onMounted(() => {
|
|
418
|
-
updateVisibleData();
|
|
418
|
+
// updateVisibleData();
|
|
419
419
|
});
|
|
420
420
|
|
|
421
421
|
onUpdated(() => {
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
|
+
|
|
3
|
+
export type JsonPrettyNodeProps = {
|
|
4
|
+
data: any;
|
|
5
|
+
rootPath: string;
|
|
6
|
+
indent: number;
|
|
7
|
+
showLength: boolean;
|
|
8
|
+
showDoubleQuotes: boolean;
|
|
9
|
+
renderNodeKey: any;
|
|
10
|
+
renderNodeValue: any;
|
|
11
|
+
};
|
|
12
|
+
export interface NodeDataType extends JSONFlattenReturnType {
|
|
13
|
+
id: number;
|
|
14
|
+
}
|
|
15
|
+
export interface JSONFlattenOptions {
|
|
16
|
+
key?: string;
|
|
17
|
+
index?: number;
|
|
18
|
+
showComma: boolean;
|
|
19
|
+
length: number;
|
|
20
|
+
type: 'content' | 'objectStart' | 'objectEnd' | 'objectCollapsed' | 'arrayStart' | 'arrayEnd' | 'arrayCollapsed';
|
|
21
|
+
}
|
|
22
|
+
export type JSONDataType = string | number | boolean | unknown[] | Record<string, unknown> | null;
|
|
23
|
+
export interface JSONFlattenReturnType extends JSONFlattenOptions {
|
|
24
|
+
content: string | number | null | boolean;
|
|
25
|
+
level: number;
|
|
26
|
+
path: string;
|
|
27
|
+
}
|
|
28
|
+
export type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
|
|
29
|
+
type SelectableType = 'single' | 'multiple' | null;
|
|
30
|
+
export type TreeNodeProps = Partial<{
|
|
31
|
+
data: any;
|
|
32
|
+
indent: number;
|
|
33
|
+
showLength: boolean;
|
|
34
|
+
showDoubleQuotes: boolean;
|
|
35
|
+
selectableType: SelectableType;
|
|
36
|
+
showSelectController: boolean;
|
|
37
|
+
showLine: boolean;
|
|
38
|
+
showLineNumber: boolean;
|
|
39
|
+
showNodeActions: boolean;
|
|
40
|
+
selectOnClickNode: boolean;
|
|
41
|
+
highlightSelectedNode: boolean;
|
|
42
|
+
showIcon: boolean;
|
|
43
|
+
theme: string;
|
|
44
|
+
showKeyValueSpace: boolean;
|
|
45
|
+
editable: boolean;
|
|
46
|
+
editableTrigger: string;
|
|
47
|
+
node: NodeDataType;
|
|
48
|
+
checked: boolean;
|
|
49
|
+
collapsed: boolean;
|
|
50
|
+
style: CSSProperties;
|
|
51
|
+
fontSize: string;
|
|
52
|
+
onNodeClick: (node: NodeDataType) => void;
|
|
53
|
+
onNodeMouseover: (node: NodeDataType) => void;
|
|
54
|
+
onBracketsClick: (collapsed: boolean, node: NodeDataType) => void;
|
|
55
|
+
onIconClick: (collapsed: boolean, node: NodeDataType) => void;
|
|
56
|
+
onValueChange: (value: boolean, path: string) => void;
|
|
57
|
+
onSelectedChange: (node: NodeDataType) => void;
|
|
58
|
+
}> & TreeNodeRequiredProps;
|
|
59
|
+
export type TreeNodeRequiredProps = {
|
|
60
|
+
node: NodeDataType;
|
|
61
|
+
rootPath: string;
|
|
62
|
+
nodeSelectable: (node: NodeDataType) => boolean;
|
|
63
|
+
};
|
|
64
|
+
export type TreeRequired = TreeNodeRequiredProps & {};
|
|
65
|
+
export type Tree = Partial<TreeNodeProps> & Partial<{
|
|
66
|
+
deep: number;
|
|
67
|
+
collapsedNodeLength: number;
|
|
68
|
+
virtual: boolean;
|
|
69
|
+
itemHeight: number;
|
|
70
|
+
height: number;
|
|
71
|
+
selectedValue: string | Array<any>;
|
|
72
|
+
collapsedOnClickBrackets: boolean;
|
|
73
|
+
style: CSSProperties;
|
|
74
|
+
pathCollapsible: (node: NodeDataType) => boolean;
|
|
75
|
+
/** 超过行数将会自动启用虚拟列表 */
|
|
76
|
+
autoVirtualRow: number;
|
|
77
|
+
} & TreeRequired>;
|
|
78
|
+
export interface ScrollEvent {
|
|
79
|
+
detail: {
|
|
80
|
+
scrollLeft: number;
|
|
81
|
+
scrollTop: number;
|
|
82
|
+
scrollHeight: number;
|
|
83
|
+
scrollWidth: number;
|
|
84
|
+
deltaX: number;
|
|
85
|
+
deltaY: number;
|
|
86
|
+
};
|
|
87
|
+
target: EventTarget;
|
|
88
|
+
currentTarget: EventTarget;
|
|
89
|
+
timeStamp: number;
|
|
90
|
+
type: string;
|
|
91
|
+
}
|
|
92
|
+
export {};
|
|
93
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../dev/v3/JsonPretty/type.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { CSSProperties } from 'vue';
|
|
2
|
+
|
|
3
|
+
export type JsonPrettyNodeProps = {
|
|
4
|
+
data: any;
|
|
5
|
+
rootPath: string;
|
|
6
|
+
indent: number;
|
|
7
|
+
showLength: boolean;
|
|
8
|
+
showDoubleQuotes: boolean;
|
|
9
|
+
renderNodeKey: any;
|
|
10
|
+
renderNodeValue: any;
|
|
11
|
+
};
|
|
12
|
+
export interface NodeDataType extends JSONFlattenReturnType {
|
|
13
|
+
id: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface JSONFlattenOptions {
|
|
17
|
+
key?: string;
|
|
18
|
+
index?: number;
|
|
19
|
+
showComma: boolean;
|
|
20
|
+
length: number;
|
|
21
|
+
type:
|
|
22
|
+
| 'content'
|
|
23
|
+
| 'objectStart'
|
|
24
|
+
| 'objectEnd'
|
|
25
|
+
| 'objectCollapsed'
|
|
26
|
+
| 'arrayStart'
|
|
27
|
+
| 'arrayEnd'
|
|
28
|
+
| 'arrayCollapsed';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type JSONDataType =
|
|
32
|
+
| string
|
|
33
|
+
| number
|
|
34
|
+
| boolean
|
|
35
|
+
| unknown[]
|
|
36
|
+
| Record<string, unknown>
|
|
37
|
+
| null;
|
|
38
|
+
|
|
39
|
+
export interface JSONFlattenReturnType extends JSONFlattenOptions {
|
|
40
|
+
content: string | number | null | boolean;
|
|
41
|
+
level: number;
|
|
42
|
+
path: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type StyleValue =
|
|
46
|
+
| false
|
|
47
|
+
| null
|
|
48
|
+
| undefined
|
|
49
|
+
| string
|
|
50
|
+
| CSSProperties
|
|
51
|
+
| Array<StyleValue>;
|
|
52
|
+
|
|
53
|
+
// 定义 Props 类型
|
|
54
|
+
type SelectableType = 'single' | 'multiple' | null;
|
|
55
|
+
|
|
56
|
+
export type TreeNodeProps = Partial<{
|
|
57
|
+
data: any;
|
|
58
|
+
indent: number;
|
|
59
|
+
showLength: boolean;
|
|
60
|
+
showDoubleQuotes: boolean;
|
|
61
|
+
selectableType: SelectableType;
|
|
62
|
+
showSelectController: boolean;
|
|
63
|
+
showLine: boolean;
|
|
64
|
+
showLineNumber: boolean;
|
|
65
|
+
showNodeActions: boolean;
|
|
66
|
+
selectOnClickNode: boolean;
|
|
67
|
+
highlightSelectedNode: boolean;
|
|
68
|
+
showIcon: boolean;
|
|
69
|
+
theme: string;
|
|
70
|
+
showKeyValueSpace: boolean;
|
|
71
|
+
editable: boolean;
|
|
72
|
+
editableTrigger: string;
|
|
73
|
+
node: NodeDataType;
|
|
74
|
+
checked: boolean;
|
|
75
|
+
collapsed: boolean;
|
|
76
|
+
style: CSSProperties;
|
|
77
|
+
fontSize: string;
|
|
78
|
+
onNodeClick: (node: NodeDataType) => void;
|
|
79
|
+
onNodeMouseover: (node: NodeDataType) => void;
|
|
80
|
+
onBracketsClick: (collapsed: boolean, node: NodeDataType) => void;
|
|
81
|
+
onIconClick: (collapsed: boolean, node: NodeDataType) => void;
|
|
82
|
+
onValueChange: (value: boolean, path: string) => void;
|
|
83
|
+
onSelectedChange: (node: NodeDataType) => void;
|
|
84
|
+
}> &
|
|
85
|
+
TreeNodeRequiredProps;
|
|
86
|
+
|
|
87
|
+
export type TreeNodeRequiredProps = {
|
|
88
|
+
node: NodeDataType;
|
|
89
|
+
rootPath: string;
|
|
90
|
+
nodeSelectable: (node: NodeDataType) => boolean;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export type TreeRequired = TreeNodeRequiredProps & {};
|
|
94
|
+
|
|
95
|
+
export type Tree = Partial<TreeNodeProps> &
|
|
96
|
+
Partial<
|
|
97
|
+
{
|
|
98
|
+
deep: number;
|
|
99
|
+
collapsedNodeLength: number;
|
|
100
|
+
virtual: boolean;
|
|
101
|
+
itemHeight: number;
|
|
102
|
+
height: number;
|
|
103
|
+
selectedValue: string | Array<any>;
|
|
104
|
+
collapsedOnClickBrackets: boolean;
|
|
105
|
+
style: CSSProperties;
|
|
106
|
+
pathCollapsible: (node: NodeDataType) => boolean;
|
|
107
|
+
/** 超过行数将会自动启用虚拟列表 */
|
|
108
|
+
autoVirtualRow: number;
|
|
109
|
+
} & TreeRequired
|
|
110
|
+
>;
|
|
111
|
+
|
|
112
|
+
export interface ScrollEvent {
|
|
113
|
+
detail: {
|
|
114
|
+
scrollLeft: number; // 横向滚动距离
|
|
115
|
+
scrollTop: number; // 纵向滚动距离
|
|
116
|
+
scrollHeight: number; // 可滚动区域的高度
|
|
117
|
+
scrollWidth: number; // 可滚动区域的宽度
|
|
118
|
+
deltaX: number; // 横向滚动增量
|
|
119
|
+
deltaY: number; // 纵向滚动增量
|
|
120
|
+
};
|
|
121
|
+
target: EventTarget; // 事件源组件
|
|
122
|
+
currentTarget: EventTarget; // 当前组件
|
|
123
|
+
timeStamp: number; // 事件触发时间戳
|
|
124
|
+
type: string; // 事件类型,这里是 'scroll'
|
|
125
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSONDataType, JSONFlattenOptions, JSONFlattenReturnType } from '../type';
|
|
2
|
+
|
|
3
|
+
export declare function emitError(message: string): void;
|
|
4
|
+
export declare function getDataType(value: unknown): string;
|
|
5
|
+
export declare function jsonFlatten(data: JSONDataType, path?: string, level?: number, options?: JSONFlattenOptions): JSONFlattenReturnType[];
|
|
6
|
+
export declare function arrFlat<T extends unknown[]>(arr: T): unknown[];
|
|
7
|
+
export declare function cloneDeep<T extends unknown>(source: T, hash?: WeakMap<object, any>): T;
|
|
8
|
+
export declare function stringToAutoType(source: string): unknown;
|
|
9
|
+
export declare function isFunction(value: unknown): value is Function;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../dev/v3/JsonPretty/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAElD;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,YAAY,EAClB,IAAI,SAAS,EACb,KAAK,SAAI,EACT,OAAO,CAAC,EAAE,kBAAkB,GAC3B,qBAAqB,EAAE,CAqFzB;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,EAAE,CAe9D;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EACzC,MAAM,EAAE,CAAC,EACT,IAAI,uBAAgB,GACnB,CAAC,CAmBH;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAoBxD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D"}
|
|
@@ -156,7 +156,7 @@ function onClose() {
|
|
|
156
156
|
left: 0;
|
|
157
157
|
padding: 0 16px;
|
|
158
158
|
|
|
159
|
-
background-color:
|
|
159
|
+
background-color: var(--dev-tool-bg-color);
|
|
160
160
|
box-sizing: border-box;
|
|
161
161
|
}
|
|
162
162
|
.network-detail .network-detail-control {
|
|
@@ -185,7 +185,7 @@ function onClose() {
|
|
|
185
185
|
.network-detail .network-detail-header .net-detail-item > view:first-child {
|
|
186
186
|
white-space: nowrap;
|
|
187
187
|
margin-right: 8px;
|
|
188
|
-
color:
|
|
188
|
+
color: var(--dev-tool-info-color);
|
|
189
189
|
}
|
|
190
190
|
.network-detail .network-detail-payload {
|
|
191
191
|
word-break: break-all;
|
|
@@ -103,7 +103,8 @@ function onClose() {
|
|
|
103
103
|
align-items: center;
|
|
104
104
|
justify-content: space-between;
|
|
105
105
|
margin-top: 4px;
|
|
106
|
-
color:
|
|
106
|
+
color: var(--dev-tool-text-color);
|
|
107
|
+
transition: color 0.3s;
|
|
107
108
|
}
|
|
108
109
|
.slide-fade-enter-active {
|
|
109
110
|
transition: all 0.8s ease-out;
|