vite-uni-dev-tool 0.0.48 → 1.0.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/README.md +20 -0
- package/dist/const.cjs +1 -0
- package/dist/const.d.ts +78 -161
- package/dist/const.d.ts.map +1 -1
- package/dist/const.js +1 -47
- package/dist/core-shared.d.ts +44 -0
- package/dist/core-shared.d.ts.map +1 -0
- package/dist/core-shared.js +1 -0
- package/dist/core.d.ts +2 -40
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +4 -159
- package/dist/i18n/index.cjs +1 -0
- package/dist/i18n/index.d.ts +9 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/instance.cjs +1 -0
- package/dist/i18n/instance.d.ts +15 -0
- package/dist/i18n/instance.d.ts.map +1 -0
- package/dist/i18n/instance.js +1 -0
- package/dist/i18n/locales/en.cjs +1 -0
- package/dist/i18n/locales/en.d.ts +470 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/zh-Hans.cjs +1 -0
- package/dist/i18n/locales/zh-Hans.d.ts +476 -0
- package/dist/i18n/locales/zh-Hans.d.ts.map +1 -0
- package/dist/i18n/locales/zh-Hans.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/devConsole/index.cjs +4 -0
- package/dist/{devConsole → modules/devConsole}/index.d.ts +1 -1
- package/dist/modules/devConsole/index.d.ts.map +1 -0
- package/dist/modules/devConsole/index.js +4 -0
- package/dist/modules/devEvent/index.cjs +5 -0
- package/dist/modules/devEvent/index.d.ts +115 -0
- package/dist/modules/devEvent/index.d.ts.map +1 -0
- package/dist/modules/devEvent/index.js +5 -0
- package/dist/modules/devIntercept/index.cjs +13 -0
- package/dist/modules/devIntercept/index.d.ts +71 -0
- package/dist/modules/devIntercept/index.d.ts.map +1 -0
- package/dist/modules/devIntercept/index.js +13 -0
- package/dist/modules/devStore/index.cjs +1 -0
- package/dist/modules/devStore/index.d.ts +159 -0
- package/dist/modules/devStore/index.d.ts.map +1 -0
- package/dist/modules/devStore/index.js +1 -0
- package/dist/modules/devToolInfo/index.cjs +1 -0
- package/dist/modules/devToolInfo/index.d.ts +27 -0
- package/dist/modules/devToolInfo/index.d.ts.map +1 -0
- package/dist/modules/devToolInfo/index.js +1 -0
- package/dist/plugins/uniDevTool/transform/transformApp.cjs +44 -0
- package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformApp.js +17 -17
- package/dist/plugins/uniDevTool/transform/transformMain.cjs +3 -0
- package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformMain.js +3 -3
- package/dist/plugins/uniDevTool/transform/transformVue.cjs +41 -0
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts +1 -2
- package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/transform/transformVue.js +32 -19
- package/dist/plugins/uniDevTool/uniDevTool.cjs +5 -0
- package/dist/plugins/uniDevTool/uniDevTool.d.ts +3 -11
- package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
- package/dist/plugins/uniDevTool/uniDevTool.js +3 -3
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.cjs +19 -0
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.d.ts.map +1 -1
- package/dist/plugins/uniGlobalComponents/uniGlobalComponents.js +11 -19
- package/dist/plugins/uniParseStock/index.d.ts +10 -0
- package/dist/plugins/uniParseStock/index.d.ts.map +1 -0
- package/dist/plugins/utils/index.cjs +2 -0
- package/dist/plugins/utils/index.d.ts +1 -3
- package/dist/plugins/utils/index.d.ts.map +1 -1
- package/dist/plugins/utils/index.js +2 -2
- package/dist/shims-uni.d.ts +140 -0
- package/dist/type.d.ts +174 -16
- package/dist/type.d.ts.map +1 -1
- package/dist/utils/array.cjs +1 -0
- package/dist/utils/array.d.ts.map +1 -1
- package/dist/utils/array.js +1 -12
- package/dist/utils/date.cjs +1 -0
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/date.js +1 -59
- package/dist/utils/file.cjs +1 -0
- package/dist/utils/file.d.ts.map +1 -1
- package/dist/utils/file.js +1 -85
- package/dist/utils/function.cjs +1 -0
- package/dist/utils/function.d.ts +13 -0
- package/dist/utils/function.d.ts.map +1 -1
- package/dist/utils/function.js +1 -68
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -63
- package/dist/utils/ip.cjs +1 -0
- package/dist/utils/ip.d.ts +1 -1
- package/dist/utils/ip.d.ts.map +1 -1
- package/dist/utils/ip.js +1 -45
- package/dist/utils/language.cjs +1 -0
- package/dist/utils/language.d.ts +2 -1
- package/dist/utils/language.d.ts.map +1 -1
- package/dist/utils/language.js +1 -63
- package/dist/utils/object.cjs +1 -0
- package/dist/utils/object.d.ts +4 -5
- package/dist/utils/object.d.ts.map +1 -1
- package/dist/utils/object.js +1 -136
- package/dist/utils/openLink.cjs +1 -0
- package/dist/utils/openLink.d.ts.map +1 -1
- package/dist/utils/openLink.js +1 -28
- package/dist/utils/page.cjs +1 -0
- package/dist/utils/page.d.ts.map +1 -1
- package/dist/utils/page.js +1 -7
- package/dist/utils/platform.cjs +1 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +1 -17
- package/dist/utils/string.cjs +1 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +1 -114
- package/dist/utils/utils.cjs +1 -0
- package/dist/utils/utils.d.ts +1 -1
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +1 -126
- package/dist/v3/AppTransition/index.vue +170 -0
- package/dist/v3/AutoSizer/index.vue +4 -5
- package/dist/v3/AutoSizer/index1.vue +4 -6
- package/dist/v3/AutoSizer/utils.ts +1 -1
- package/dist/v3/CaptureScreen/index.vue +19 -8
- package/dist/v3/CircularButton/index.vue +64 -13
- package/dist/v3/ConsoleList/ConsoleItem.vue +56 -5
- package/dist/v3/ConsoleList/RunJSInput.vue +10 -6
- package/dist/v3/ConsoleList/index.vue +51 -35
- package/dist/v3/CustomSwiper/CustomSwiperItem.vue +49 -0
- package/dist/v3/CustomSwiper/index.vue +104 -0
- package/dist/v3/DevTool/fps-collector.render.ts +148 -0
- package/dist/v3/DevTool/index.vue +209 -102
- package/dist/v3/DevToolButton/index.vue +40 -59
- package/dist/v3/DevToolTitle/index.vue +4 -1
- package/dist/v3/DevToolWindow/DevToolOverlay.vue +182 -0
- package/dist/v3/DevToolWindow/const.ts +47 -69
- package/dist/v3/DevToolWindow/hooks/dataUtils.ts +48 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolData.ts +338 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolHandlers.ts +549 -0
- package/dist/v3/DevToolWindow/hooks/useDevToolOverlay.ts +184 -0
- package/dist/v3/DevToolWindow/index.css +89 -0
- package/dist/v3/DevToolWindow/index.vue +800 -1450
- package/dist/v3/DraggableContainer/index.vue +456 -0
- package/dist/v3/ElEvent/ElEventItem.vue +4 -3
- package/dist/v3/ElEvent/index.vue +26 -9
- package/dist/v3/Empty/index.vue +1 -0
- package/dist/v3/FilterInput/index.vue +8 -22
- package/dist/v3/FilterSelect/index.vue +37 -24
- package/dist/v3/Instance/components/InstanceTreeNode.vue +265 -0
- package/dist/v3/Instance/flatten.ts +226 -0
- package/dist/v3/Instance/index.vue +94 -0
- package/dist/v3/Instance/registry.ts +49 -0
- package/dist/v3/Instance/transformTree.ts +375 -0
- package/dist/v3/Instance/transformTreeCtx.ts +268 -0
- package/dist/v3/{InstanceTree → Instance}/typing.d.ts +15 -2
- package/dist/v3/InstanceDetail/index.vue +433 -44
- package/dist/v3/JsonDetail/index.vue +12 -8
- package/dist/v3/JsonPretty/components/Brackets/index.vue +1 -0
- package/dist/v3/JsonPretty/components/Carets/index.vue +2 -1
- package/dist/v3/JsonPretty/components/CheckController/index.vue +26 -15
- package/dist/v3/JsonPretty/components/TreeNode/index.vue +42 -20
- package/dist/v3/JsonPretty/index.vue +60 -37
- package/dist/v3/JsonPretty/utils/index.ts +41 -44
- package/dist/v3/MovableContainer/index.vue +89 -0
- package/dist/v3/NFCList/NFCItem.vue +14 -14
- package/dist/v3/NFCList/NFCTool.vue +99 -81
- package/dist/v3/NFCList/index.vue +14 -10
- package/dist/v3/NetworkList/InterceptConfig.vue +154 -364
- package/dist/v3/NetworkList/InterceptItem.vue +14 -6
- package/dist/v3/NetworkList/NetworkDetail.vue +34 -29
- package/dist/v3/NetworkList/NetworkIntercept.vue +11 -8
- package/dist/v3/NetworkList/NetworkItem.vue +27 -11
- package/dist/v3/NetworkList/NetworkSend.vue +132 -290
- package/dist/v3/NetworkList/hooks/useNetworkForm.ts +86 -0
- package/dist/v3/NetworkList/index.vue +32 -24
- package/dist/v3/NetworkList/utils.ts +101 -0
- package/dist/v3/Performance/index.vue +495 -0
- package/dist/v3/Performance/modules/PerformanceMetrics.vue +153 -0
- package/dist/v3/Performance/modules/PerformanceWidget.vue +249 -0
- package/dist/v3/Performance/modules/usePerformanceChart.ts +460 -0
- package/dist/v3/Performance/modules/usePerformanceData.ts +258 -0
- package/dist/v3/Pick/index.vue +322 -0
- package/dist/v3/PiniaList/index.vue +38 -17
- package/dist/v3/RouteList/index.vue +32 -15
- package/dist/v3/RunJS/index.vue +30 -10
- package/dist/v3/ScanCodeList/ScanCodeItem.vue +2 -9
- package/dist/v3/ScanCodeList/index.vue +12 -9
- package/dist/v3/SettingButton/index.vue +45 -0
- package/dist/v3/SettingList/index.css +120 -0
- package/dist/v3/SettingList/index.vue +96 -537
- package/dist/v3/SettingList/modules/SettingDevTool.vue +208 -0
- package/dist/v3/SettingList/modules/SettingInfo.vue +119 -0
- package/dist/v3/SettingList/modules/SettingLanguage.vue +74 -0
- package/dist/v3/SettingList/modules/SettingLog.vue +230 -0
- package/dist/v3/SettingList/modules/SettingNetwork.vue +120 -0
- package/dist/v3/SettingList/modules/SettingTheme.vue +312 -0
- package/dist/v3/SourceCode/Line.vue +15 -2
- package/dist/v3/SourceCode/index.vue +25 -24
- package/dist/v3/SourceCode/parseCode.ts +114 -56
- package/dist/v3/StorageList/index.vue +33 -33
- package/dist/v3/Tabs/index.vue +31 -28
- package/dist/v3/Tag/index.vue +39 -20
- package/dist/v3/TransferList/TransferDetail.vue +268 -0
- package/dist/v3/TransferList/TransferItem.vue +125 -0
- package/dist/v3/TransferList/index.vue +181 -0
- package/dist/v3/UniEvent/UniEventItem.vue +1 -0
- package/dist/v3/UniEvent/index.vue +28 -29
- package/dist/v3/{VirtualListPro → VirtualList}/AutoSize.vue +1 -1
- package/dist/v3/VirtualList/index.vue +382 -82
- package/dist/v3/VuexList/index.vue +38 -17
- package/dist/v3/WebSocket/WebSocketDetail.vue +142 -80
- package/dist/v3/WebSocket/WebSocketItem.vue +10 -4
- package/dist/v3/WebSocket/index.vue +44 -30
- package/dist/v3/hooks/useNFC/index.ts +6 -6
- package/dist/v3/hooks/useNFC/typing.d.ts +2 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.ts +215 -626
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.ts +54 -85
- package/dist/v3/hooks/useNFC/utils.ts +3 -3
- package/dist/v3/hooks/useRequest/index.ts +2 -2
- package/dist/v3/hooks/useScanCode/index.ts +10 -8
- package/dist/v3/styles/theme.css +290 -0
- package/dist/v3/styles/theme.ts +12 -0
- package/package.json +25 -5
- package/dist/devConsole/index.d.ts.map +0 -1
- package/dist/devConsole/index.js +0 -273
- package/dist/devEvent/index.d.ts +0 -328
- package/dist/devEvent/index.d.ts.map +0 -1
- package/dist/devEvent/index.js +0 -697
- package/dist/devEventBus/index.d.ts +0 -42
- package/dist/devEventBus/index.d.ts.map +0 -1
- package/dist/devEventBus/index.js +0 -70
- package/dist/devIntercept/index.d.ts +0 -281
- package/dist/devIntercept/index.d.ts.map +0 -1
- package/dist/devIntercept/index.js +0 -949
- package/dist/devRunJS/index.d.ts +0 -67
- package/dist/devRunJS/index.d.ts.map +0 -1
- package/dist/devStore/index.d.ts +0 -199
- package/dist/devStore/index.d.ts.map +0 -1
- package/dist/devStore/index.js +0 -562
- package/dist/devToolInfo/index.d.ts +0 -17
- package/dist/devToolInfo/index.d.ts.map +0 -1
- package/dist/devToolInfo/index.js +0 -15
- package/dist/v3/AutoSizer/utils.d.ts +0 -5
- package/dist/v3/AutoSizer/utils.d.ts.map +0 -1
- package/dist/v3/ConsoleList/staticTips.d.ts +0 -13
- package/dist/v3/ConsoleList/staticTips.d.ts.map +0 -1
- package/dist/v3/DevToolWindow/const.d.ts +0 -46
- package/dist/v3/DevToolWindow/const.d.ts.map +0 -1
- package/dist/v3/InstanceTree/components/InstanceTreeNode.vue +0 -81
- package/dist/v3/InstanceTree/flatten.d.ts +0 -10
- package/dist/v3/InstanceTree/flatten.d.ts.map +0 -1
- package/dist/v3/InstanceTree/flatten.ts +0 -75
- package/dist/v3/InstanceTree/index.vue +0 -51
- package/dist/v3/InstanceTree/transformTree.d.ts +0 -17
- package/dist/v3/InstanceTree/transformTree.d.ts.map +0 -1
- package/dist/v3/InstanceTree/transformTree.ts +0 -237
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts +0 -4
- package/dist/v3/JsonPretty/hooks/useClipboard.d.ts.map +0 -1
- package/dist/v3/JsonPretty/hooks/useError.d.ts +0 -8
- package/dist/v3/JsonPretty/hooks/useError.d.ts.map +0 -1
- package/dist/v3/JsonPretty/type.d.ts +0 -94
- package/dist/v3/JsonPretty/type.d.ts.map +0 -1
- package/dist/v3/JsonPretty/utils/index.d.ts +0 -10
- package/dist/v3/JsonPretty/utils/index.d.ts.map +0 -1
- package/dist/v3/NFCList/const.d.ts +0 -13
- package/dist/v3/NFCList/const.d.ts.map +0 -1
- package/dist/v3/NetworkList/const.d.ts +0 -5
- package/dist/v3/NetworkList/const.d.ts.map +0 -1
- package/dist/v3/SourceCode/parseCode.d.ts +0 -27
- package/dist/v3/SourceCode/parseCode.d.ts.map +0 -1
- package/dist/v3/UploadList/UploadDetail.vue +0 -255
- package/dist/v3/UploadList/UploadItem.vue +0 -122
- package/dist/v3/UploadList/index.vue +0 -125
- package/dist/v3/VirtualListPro/index.vue +0 -229
- package/dist/v3/hooks/useContainerStyle.d.ts +0 -15
- package/dist/v3/hooks/useContainerStyle.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/index.d.ts +0 -5
- package/dist/v3/hooks/useNFC/index.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCAndroid.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts +0 -2
- package/dist/v3/hooks/useNFC/useNFCMpWeiXin.d.ts.map +0 -1
- package/dist/v3/hooks/useNFC/utils.d.ts +0 -95
- package/dist/v3/hooks/useNFC/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/index.d.ts +0 -126
- package/dist/v3/hooks/useRequest/index.d.ts.map +0 -1
- package/dist/v3/hooks/useRequest/utils.d.ts +0 -35
- package/dist/v3/hooks/useRequest/utils.d.ts.map +0 -1
- package/dist/v3/hooks/useScanCode/index.d.ts +0 -36
- package/dist/v3/hooks/useScanCode/index.d.ts.map +0 -1
- /package/dist/v3/{VirtualListPro → VirtualList}/readme.md +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="capture-screen-content">
|
|
3
3
|
<view class="capture-screen-control">
|
|
4
|
-
<DevToolTitle>
|
|
4
|
+
<DevToolTitle> {{ t('captureScreen.title') }} </DevToolTitle>
|
|
5
5
|
<Tag
|
|
6
6
|
style="margin-left: auto"
|
|
7
7
|
customStyle="margin-left: auto"
|
|
8
8
|
mode="clear"
|
|
9
9
|
@click="emit('clear')"
|
|
10
10
|
>
|
|
11
|
-
|
|
11
|
+
{{ t('common.clear') }}
|
|
12
12
|
</Tag>
|
|
13
13
|
</view>
|
|
14
14
|
|
|
@@ -19,22 +19,28 @@
|
|
|
19
19
|
:key="index"
|
|
20
20
|
>
|
|
21
21
|
<view class="capture-info-row">
|
|
22
|
-
|
|
22
|
+
{{ t('captureScreen.type') }}:<Tag mode="primary">{{
|
|
23
|
+
item.type
|
|
24
|
+
}}</Tag>
|
|
23
25
|
</view>
|
|
24
|
-
<view class="capture-info-row"
|
|
26
|
+
<view class="capture-info-row"
|
|
27
|
+
>{{ t('captureScreen.page') }}:{{ item.position }}</view
|
|
28
|
+
>
|
|
25
29
|
<view
|
|
26
30
|
class="capture-info-row-time"
|
|
27
31
|
v-if="item.type === 'captureScreen'"
|
|
28
32
|
>
|
|
29
|
-
<view
|
|
33
|
+
<view
|
|
34
|
+
>{{ t('captureScreen.captureTime') }}:{{ item.startTime }}</view
|
|
35
|
+
>
|
|
30
36
|
<!-- <view>结束时间:{{ item.endTime }}</view> -->
|
|
31
37
|
</view>
|
|
32
38
|
<view class="capture-info-row-time" v-else>
|
|
33
|
-
<view
|
|
34
|
-
<view
|
|
39
|
+
<view>{{ t('captureScreen.startTime') }}:{{ item.startTime }}</view>
|
|
40
|
+
<view>{{ t('captureScreen.endTime') }}:{{ item.endTime }}</view>
|
|
35
41
|
</view>
|
|
36
42
|
<view class="capture-info-row" v-if="item.path">
|
|
37
|
-
|
|
43
|
+
{{ t('captureScreen.path') }}:{{ item.path }}
|
|
38
44
|
</view>
|
|
39
45
|
</view>
|
|
40
46
|
|
|
@@ -47,6 +53,9 @@ import DevToolTitle from '../DevToolTitle/index.vue';
|
|
|
47
53
|
import type { DevTool } from '../../type';
|
|
48
54
|
import Empty from '../Empty/index.vue';
|
|
49
55
|
import Tag from '../Tag/index.vue';
|
|
56
|
+
import { useI18n } from '../../i18n';
|
|
57
|
+
|
|
58
|
+
const { t } = useI18n();
|
|
50
59
|
|
|
51
60
|
defineProps<{
|
|
52
61
|
screenList: DevTool.ScreenItem[];
|
|
@@ -82,6 +91,7 @@ const emit = defineEmits<{
|
|
|
82
91
|
padding: 16px;
|
|
83
92
|
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
84
93
|
}
|
|
94
|
+
|
|
85
95
|
.capture-info-row {
|
|
86
96
|
display: flex;
|
|
87
97
|
align-items: center;
|
|
@@ -89,6 +99,7 @@ const emit = defineEmits<{
|
|
|
89
99
|
line-height: 24px;
|
|
90
100
|
word-break: break-all;
|
|
91
101
|
}
|
|
102
|
+
|
|
92
103
|
.capture-info-row-time {
|
|
93
104
|
display: flex;
|
|
94
105
|
justify-content: space-between;
|
|
@@ -1,15 +1,45 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<view
|
|
3
|
-
|
|
2
|
+
<view
|
|
3
|
+
class="circular-button"
|
|
4
|
+
:style="[computedStyle, customStyle]"
|
|
5
|
+
@click="onClick">
|
|
6
|
+
<slot>{{ text }}</slot>
|
|
4
7
|
</view>
|
|
5
8
|
</template>
|
|
9
|
+
|
|
6
10
|
<script lang="ts" setup>
|
|
7
|
-
|
|
11
|
+
import { computed } from 'vue';
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(
|
|
14
|
+
defineProps<{
|
|
15
|
+
text?: string;
|
|
16
|
+
customStyle?: string | Record<string, any>;
|
|
17
|
+
size?: string | number;
|
|
18
|
+
type?: 'default' | 'primary' | 'warn' | 'error';
|
|
19
|
+
}>(),
|
|
20
|
+
{
|
|
21
|
+
text: '',
|
|
22
|
+
size: '22px',
|
|
23
|
+
type: 'default',
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<{
|
|
28
|
+
(e: 'click', event: MouseEvent | TouchEvent): void;
|
|
29
|
+
}>();
|
|
8
30
|
|
|
9
|
-
const
|
|
31
|
+
const computedStyle = computed(() => {
|
|
32
|
+
const sizeValue =
|
|
33
|
+
typeof props.size === 'number' ? `${props.size}px` : props.size;
|
|
34
|
+
return {
|
|
35
|
+
width: sizeValue,
|
|
36
|
+
height: sizeValue,
|
|
37
|
+
fontSize: `calc(${sizeValue} * 0.6)`,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
10
40
|
|
|
11
|
-
function onClick() {
|
|
12
|
-
emit('click');
|
|
41
|
+
function onClick(e: MouseEvent | TouchEvent) {
|
|
42
|
+
emit('click', e);
|
|
13
43
|
}
|
|
14
44
|
</script>
|
|
15
45
|
|
|
@@ -19,15 +49,36 @@ function onClick() {
|
|
|
19
49
|
display: flex;
|
|
20
50
|
align-items: center;
|
|
21
51
|
justify-content: center;
|
|
22
|
-
width: 24px;
|
|
23
|
-
height: 24px;
|
|
24
|
-
margin-left: auto;
|
|
25
52
|
border-radius: 50%;
|
|
26
|
-
border: 1px solid var(--dev-tool-
|
|
53
|
+
border: 1px solid var(--dev-tool-border-color);
|
|
27
54
|
box-sizing: border-box;
|
|
28
55
|
color: var(--dev-tool-text-color);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
user-select: none;
|
|
58
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
59
|
+
pointer-events: auto;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
line-height: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Hover state - using active bg color for consistency */
|
|
65
|
+
@media (hover: hover) {
|
|
66
|
+
.circular-button:hover {
|
|
67
|
+
background-color: var(--dev-tool-active-bg-color);
|
|
68
|
+
border-color: var(--dev-tool-text-color);
|
|
69
|
+
opacity: 0.9;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.circular-button:active {
|
|
74
|
+
transform: scale(0.85);
|
|
75
|
+
background-color: var(--dev-tool-active-bg-color);
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Different types if needed */
|
|
80
|
+
.circular-button-primary {
|
|
81
|
+
color: var(--dev-tool-main-color);
|
|
82
|
+
border-color: var(--dev-tool-main-color);
|
|
32
83
|
}
|
|
33
84
|
</style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
|
|
1
2
|
<template>
|
|
2
3
|
<view :id="id" :class="['console-item', `console-item-${consoleItem.type}`]">
|
|
3
4
|
<view class="console-args">
|
|
@@ -5,9 +6,19 @@
|
|
|
5
6
|
v-for="(item, index) in consoleItem.args"
|
|
6
7
|
:key="index"
|
|
7
8
|
:class="`console-arg console-arg-${item.type}`"
|
|
8
|
-
v-html="item.shortValue || item.value"
|
|
9
9
|
@click="onClickArg(item)"
|
|
10
10
|
>
|
|
11
|
+
<template v-if="item.type === 'image'">
|
|
12
|
+
<image
|
|
13
|
+
:src="item.value"
|
|
14
|
+
:title="item.value"
|
|
15
|
+
mode="aspectFit"
|
|
16
|
+
class="console-arg-image"
|
|
17
|
+
/>
|
|
18
|
+
<view v-html="item.shortValue || item.value"></view>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<view v-else v-html="item.shortValue || item.value"></view>
|
|
11
22
|
</view>
|
|
12
23
|
</view>
|
|
13
24
|
<view class="console-position">
|
|
@@ -27,9 +38,11 @@
|
|
|
27
38
|
<view>
|
|
28
39
|
<view class="console-time">{{ consoleItem.time }}</view>
|
|
29
40
|
<view v-if="consoleItem.executionTime" class="console-time">
|
|
30
|
-
|
|
41
|
+
{{ t('common.executionTime') }}: {{ consoleItem?.executionTime }}ms
|
|
31
42
|
</view>
|
|
43
|
+
<!-- eslint-disable-next-line vue/no-v-text-v-html-on-component -->
|
|
32
44
|
<view class="console-other" v-html="consoleItem.position"></view>
|
|
45
|
+
<!-- eslint-disable-next-line vue/no-v-text-v-html-on-component -->
|
|
33
46
|
<view
|
|
34
47
|
v-if="consoleItem.stack"
|
|
35
48
|
v-html="consoleItem.stack"
|
|
@@ -46,6 +59,9 @@ import { computed } from 'vue';
|
|
|
46
59
|
import Tag from '../Tag/index.vue';
|
|
47
60
|
import type { DevTool } from '../../type';
|
|
48
61
|
import { isMockWX, openOutLink } from '../../utils';
|
|
62
|
+
import { useI18n } from '../../i18n';
|
|
63
|
+
|
|
64
|
+
const { t } = useI18n();
|
|
49
65
|
const props = defineProps<{
|
|
50
66
|
consoleItem: DevTool.ConsoleItem;
|
|
51
67
|
sourceFileServers?: string[];
|
|
@@ -57,7 +73,7 @@ const props = defineProps<{
|
|
|
57
73
|
|
|
58
74
|
const emit = defineEmits<{
|
|
59
75
|
(e: 'openCode', value: string): void;
|
|
60
|
-
(e: 'openJson', value:
|
|
76
|
+
(e: 'openJson', value: { title?: string; data: Record<string, any> }): void;
|
|
61
77
|
}>();
|
|
62
78
|
|
|
63
79
|
const isUseDevSource = computed(() => {
|
|
@@ -70,9 +86,13 @@ const isUseDevSource = computed(() => {
|
|
|
70
86
|
|
|
71
87
|
function onClickArg(item: DevTool.Arg) {
|
|
72
88
|
if (item.type === 'object' || item.type === 'array') {
|
|
73
|
-
emit('openJson', item);
|
|
89
|
+
emit('openJson', { data: item.value });
|
|
74
90
|
} else if (item.type === 'link') {
|
|
75
91
|
openOutLink(item.value);
|
|
92
|
+
} else if (item.type === 'image') {
|
|
93
|
+
uni.previewImage({
|
|
94
|
+
urls: [item.value],
|
|
95
|
+
});
|
|
76
96
|
}
|
|
77
97
|
}
|
|
78
98
|
</script>
|
|
@@ -82,18 +102,23 @@ function onClickArg(item: DevTool.Arg) {
|
|
|
82
102
|
border-bottom: 1px solid var(--dev-tool-border-color);
|
|
83
103
|
font-size: var(--dev-tool-base-font-size);
|
|
84
104
|
}
|
|
105
|
+
|
|
85
106
|
.console-args {
|
|
86
107
|
display: flex;
|
|
87
108
|
flex-wrap: wrap;
|
|
88
109
|
width: 100%;
|
|
110
|
+
|
|
89
111
|
/* color: #000; */
|
|
112
|
+
|
|
90
113
|
/* color: var(--dev-tool-text-color); */
|
|
91
114
|
}
|
|
115
|
+
|
|
92
116
|
.console-arg {
|
|
93
117
|
margin-right: 4px;
|
|
94
118
|
white-space: pre-line;
|
|
95
119
|
word-break: break-all;
|
|
96
120
|
}
|
|
121
|
+
|
|
97
122
|
.console-position {
|
|
98
123
|
display: flex;
|
|
99
124
|
align-items: flex-start;
|
|
@@ -107,10 +132,12 @@ function onClickArg(item: DevTool.Arg) {
|
|
|
107
132
|
display: flex;
|
|
108
133
|
align-items: center;
|
|
109
134
|
}
|
|
135
|
+
|
|
110
136
|
.console-time {
|
|
111
137
|
margin-right: auto;
|
|
112
138
|
word-break: break-all;
|
|
113
139
|
}
|
|
140
|
+
|
|
114
141
|
.console-other {
|
|
115
142
|
word-break: break-all;
|
|
116
143
|
}
|
|
@@ -132,15 +159,19 @@ function onClickArg(item: DevTool.Arg) {
|
|
|
132
159
|
border-radius: 50%;
|
|
133
160
|
background-color: var(--dev-tool-success-color);
|
|
134
161
|
}
|
|
162
|
+
|
|
135
163
|
.console-item-info {
|
|
136
164
|
color: var(--dev-tool-info-color);
|
|
137
165
|
}
|
|
166
|
+
|
|
138
167
|
.console-item-log {
|
|
139
168
|
color: var(--dev-tool-info-color);
|
|
140
169
|
}
|
|
170
|
+
|
|
141
171
|
.console-item-warn {
|
|
142
172
|
background-color: var(--dev-tool-warn-bg-color);
|
|
143
173
|
}
|
|
174
|
+
|
|
144
175
|
.console-item-error {
|
|
145
176
|
background-color: var(--dev-tool-error-bg-color);
|
|
146
177
|
}
|
|
@@ -148,26 +179,46 @@ function onClickArg(item: DevTool.Arg) {
|
|
|
148
179
|
.console-arg-null {
|
|
149
180
|
color: var(--dev-tool-nil-color);
|
|
150
181
|
}
|
|
182
|
+
|
|
151
183
|
.console-arg-undefined {
|
|
152
184
|
color: var(--dev-tool-nil-color);
|
|
153
185
|
}
|
|
186
|
+
|
|
154
187
|
.console-arg-string {
|
|
155
188
|
color: var(--dev-tool-nil-color);
|
|
156
189
|
}
|
|
190
|
+
|
|
157
191
|
.console-arg-number {
|
|
158
192
|
color: var(--dev-tool-number-color);
|
|
159
193
|
}
|
|
194
|
+
|
|
160
195
|
.console-arg-boolean {
|
|
161
196
|
color: var(--dev-tool-boolean-color);
|
|
162
197
|
}
|
|
198
|
+
|
|
163
199
|
.console-arg-symbol {
|
|
164
200
|
color: var(--dev-tool-symbol-color);
|
|
165
201
|
}
|
|
166
202
|
|
|
167
203
|
.console-arg-object,
|
|
168
204
|
.console-arg-array,
|
|
169
|
-
.console-arg-link
|
|
205
|
+
.console-arg-link,
|
|
206
|
+
.console-arg-image {
|
|
170
207
|
text-decoration: underline;
|
|
171
208
|
color: var(--dev-tool-attribute-color);
|
|
172
209
|
}
|
|
210
|
+
|
|
211
|
+
.console-arg-image {
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.console-arg-image > image {
|
|
217
|
+
width: 100px;
|
|
218
|
+
height: 88px;
|
|
219
|
+
|
|
220
|
+
/* border: 1px solid var(--dev-tool-border-color); */
|
|
221
|
+
border-radius: 4px;
|
|
222
|
+
margin-right: 12px;
|
|
223
|
+
}
|
|
173
224
|
</style>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<input
|
|
5
5
|
:value="code"
|
|
6
6
|
class="run-js-input"
|
|
7
|
-
placeholder="
|
|
7
|
+
:placeholder="t('common.runPlaceholder')"
|
|
8
8
|
@confirm="debounceConfirm"
|
|
9
9
|
@input="onChange"
|
|
10
10
|
/>
|
|
@@ -30,6 +30,9 @@ import {
|
|
|
30
30
|
type Tip,
|
|
31
31
|
} from './staticTips';
|
|
32
32
|
import { debounce } from '../../utils';
|
|
33
|
+
import { useI18n } from '../../i18n';
|
|
34
|
+
|
|
35
|
+
const { t } = useI18n();
|
|
33
36
|
|
|
34
37
|
const emit = defineEmits<{
|
|
35
38
|
(e: 'run', value: string): void;
|
|
@@ -48,7 +51,7 @@ function onConfirm() {
|
|
|
48
51
|
|
|
49
52
|
emit('run', value);
|
|
50
53
|
}
|
|
51
|
-
const debounceConfirm = debounce(onConfirm, 500, true);
|
|
54
|
+
const debounceConfirm = debounce(onConfirm, 500, { leading: true });
|
|
52
55
|
|
|
53
56
|
/**
|
|
54
57
|
* 1.对象,方法,变量 在 ; ( , =,==,=== , + , - , * , / , && , || ?? 之后 开始提示
|
|
@@ -141,7 +144,7 @@ function onChange(e: any) {
|
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
}
|
|
144
|
-
function onChoose(
|
|
147
|
+
function onChoose(_name: string) {
|
|
145
148
|
// TODO 选择提示
|
|
146
149
|
// const lastIndex = code.value.lastIndexOf(';');
|
|
147
150
|
// const con =
|
|
@@ -224,10 +227,10 @@ function findFunction(fn: string) {
|
|
|
224
227
|
max-height: 200px;
|
|
225
228
|
padding: 0 16px 0 36px;
|
|
226
229
|
box-sizing: border-box;
|
|
227
|
-
overflow
|
|
228
|
-
|
|
229
|
-
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.1);
|
|
230
|
+
overflow: hidden auto;
|
|
231
|
+
box-shadow: 0 0 4px 0 rgb(0 0 0 / 10%);
|
|
230
232
|
}
|
|
233
|
+
|
|
231
234
|
.run-js-tips-item {
|
|
232
235
|
display: flex;
|
|
233
236
|
align-items: center;
|
|
@@ -239,6 +242,7 @@ function findFunction(fn: string) {
|
|
|
239
242
|
overflow: hidden;
|
|
240
243
|
text-overflow: ellipsis;
|
|
241
244
|
}
|
|
245
|
+
|
|
242
246
|
.run-js-tips-item-active {
|
|
243
247
|
border: 1px solid var(--dev-tool-main-color);
|
|
244
248
|
}
|
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="console-content">
|
|
3
3
|
<view class="console-control">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
>
|
|
16
|
-
{{ item.label }}
|
|
4
|
+
<DevToolTitle>{{ t('common.console') }}</DevToolTitle>
|
|
5
|
+
<FilterInput v-model="modelValue" @search="emit('search', $event)" />
|
|
6
|
+
<Pick
|
|
7
|
+
v-model="currentConsoleType"
|
|
8
|
+
:options="filterOptions"
|
|
9
|
+
:readonly="true"
|
|
10
|
+
:placeholder="t('common.selectType')"
|
|
11
|
+
customStyle="width: 100px; flex: none;"
|
|
12
|
+
@change="onFilterChange" />
|
|
13
|
+
<Tag mode="clear" @click="emit('choose', 'clear')">
|
|
14
|
+
{{ t('common.clear') }}
|
|
17
15
|
</Tag>
|
|
18
16
|
</view>
|
|
19
17
|
|
|
20
|
-
<
|
|
18
|
+
<VirtualList
|
|
21
19
|
:data="consoleList"
|
|
22
20
|
:pageSize="15"
|
|
23
21
|
:scrollIntoView="scrollIntoView"
|
|
24
22
|
:scrollWithAnimation="true"
|
|
25
23
|
:height="contentHeight - 32 - 32 - 32"
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
:dataChangeScrollToTop="false"
|
|
25
|
+
className="console-list">
|
|
28
26
|
<template v-slot="{ list, start, itemsHeight, onSizeChange }">
|
|
29
27
|
<AutoSize
|
|
30
28
|
v-for="(item, index) in list"
|
|
31
29
|
:index="start + index"
|
|
32
30
|
:key="start + index"
|
|
33
31
|
:itemsHeight="itemsHeight"
|
|
34
|
-
:onSizeChange="onSizeChange"
|
|
35
|
-
>
|
|
32
|
+
:onSizeChange="onSizeChange">
|
|
36
33
|
<ConsoleItem
|
|
37
34
|
:consoleItem="item"
|
|
38
35
|
:sourceFileServers="sourceFileServers"
|
|
@@ -41,12 +38,11 @@
|
|
|
41
38
|
:id="`dev-console-${index}`"
|
|
42
39
|
:zIndex="zIndex"
|
|
43
40
|
@openCode="emit('openCode', $event)"
|
|
44
|
-
@openJson="emit('openJson', $event)"
|
|
45
|
-
/>
|
|
41
|
+
@openJson="emit('openJson', $event)" />
|
|
46
42
|
</AutoSize>
|
|
47
43
|
<Empty v-if="!consoleList || consoleList.length === 0" />
|
|
48
44
|
</template>
|
|
49
|
-
</
|
|
45
|
+
</VirtualList>
|
|
50
46
|
<RunJSInput @run="emit('run', $event)" />
|
|
51
47
|
</view>
|
|
52
48
|
</template>
|
|
@@ -55,18 +51,21 @@ import ConsoleItem from './ConsoleItem.vue';
|
|
|
55
51
|
import Tag from '../Tag/index.vue';
|
|
56
52
|
import Empty from '../Empty/index.vue';
|
|
57
53
|
import FilterInput from '../FilterInput/index.vue';
|
|
54
|
+
import Pick from '../Pick/index.vue';
|
|
58
55
|
import RunJSInput from './RunJSInput.vue';
|
|
59
56
|
import type { DevTool } from '../../type';
|
|
60
|
-
import { nextTick, onMounted, ref,
|
|
57
|
+
import { nextTick, onMounted, ref, computed } from 'vue';
|
|
61
58
|
import { debounce } from '../../utils';
|
|
62
|
-
import
|
|
63
|
-
import AutoSize from '../
|
|
59
|
+
import VirtualList from '../VirtualList/index.vue';
|
|
60
|
+
import AutoSize from '../VirtualList/AutoSize.vue';
|
|
61
|
+
import DevToolTitle from '../DevToolTitle/index.vue';
|
|
62
|
+
import { useI18n } from '../../i18n';
|
|
63
|
+
|
|
64
|
+
const { t } = useI18n();
|
|
64
65
|
|
|
65
66
|
type ConsoleType = 'all' | 'log' | 'info' | 'warn' | 'error' | 'clear';
|
|
66
67
|
const props = defineProps<{
|
|
67
68
|
consoleList: DevTool.ConsoleItem[];
|
|
68
|
-
currentConsoleType: string;
|
|
69
|
-
modelValue: string;
|
|
70
69
|
sourceFileServers?: string[];
|
|
71
70
|
mode?: string;
|
|
72
71
|
useDevSource?: boolean;
|
|
@@ -76,17 +75,24 @@ const props = defineProps<{
|
|
|
76
75
|
const emit = defineEmits<{
|
|
77
76
|
(e: 'choose', type: ConsoleType): void;
|
|
78
77
|
(e: 'search', value: string): void;
|
|
79
|
-
(e: 'update:modelValue', value: string): void;
|
|
80
78
|
(e: 'run', value: string): void;
|
|
81
79
|
(e: 'openCode', value: string): void;
|
|
82
|
-
(e: 'openJson', value:
|
|
80
|
+
(e: 'openJson', value: { title?: string; data: Record<string, any> }): void;
|
|
83
81
|
}>();
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
|
|
83
|
+
const modelValue = defineModel<string>('modelValue', { required: true });
|
|
84
|
+
const currentConsoleType = defineModel<string>('currentConsoleType', {
|
|
85
|
+
required: true,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const consoleFilterItems = computed<
|
|
89
|
+
{
|
|
90
|
+
label: string;
|
|
91
|
+
value: ConsoleType;
|
|
92
|
+
}[]
|
|
93
|
+
>(() => [
|
|
88
94
|
{
|
|
89
|
-
label: '
|
|
95
|
+
label: t('common.all'),
|
|
90
96
|
value: 'all',
|
|
91
97
|
},
|
|
92
98
|
{
|
|
@@ -106,10 +112,18 @@ const consoleFilterItems: {
|
|
|
106
112
|
value: 'error',
|
|
107
113
|
},
|
|
108
114
|
{
|
|
109
|
-
label: '
|
|
115
|
+
label: t('common.clear'),
|
|
110
116
|
value: 'clear',
|
|
111
117
|
},
|
|
112
|
-
];
|
|
118
|
+
]);
|
|
119
|
+
|
|
120
|
+
const filterOptions = computed(() => {
|
|
121
|
+
return consoleFilterItems.value.filter((item) => item.value !== 'clear');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
function onFilterChange(item: { label: string; value: any }) {
|
|
125
|
+
emit('choose', item.value);
|
|
126
|
+
}
|
|
113
127
|
|
|
114
128
|
const scrollIntoView = ref('');
|
|
115
129
|
|
|
@@ -128,9 +142,11 @@ onMounted(() => {
|
|
|
128
142
|
height: 100%;
|
|
129
143
|
font-size: var(--dev-tool-base-font-size);
|
|
130
144
|
}
|
|
145
|
+
|
|
131
146
|
.console-list {
|
|
132
147
|
height: calc(100% - 32px - 32px);
|
|
133
148
|
}
|
|
149
|
+
|
|
134
150
|
.console-control {
|
|
135
151
|
display: flex;
|
|
136
152
|
align-items: center;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="custom-swiper-item" :style="customStyle">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</view>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
export default {
|
|
9
|
+
options: {
|
|
10
|
+
virtualHost: true, // 开启虚拟节点,使组件标签不渲染,属性直接透传
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
defineProps<{
|
|
17
|
+
customStyle?: string | Record<string, any>;
|
|
18
|
+
}>();
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped>
|
|
22
|
+
.custom-swiper-item {
|
|
23
|
+
flex-shrink: 0;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
overflow-y: auto;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
|
|
29
|
+
/* 解决模糊问题 */
|
|
30
|
+
backface-visibility: hidden;
|
|
31
|
+
transform: translateZ(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* #ifdef H5 || APP-PLUS */
|
|
35
|
+
.custom-swiper-item::-webkit-scrollbar {
|
|
36
|
+
display: none;
|
|
37
|
+
width: 0;
|
|
38
|
+
height: 0;
|
|
39
|
+
background-color: transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.custom-swiper-item::-webkit-scrollbar-thumb {
|
|
43
|
+
width: 0;
|
|
44
|
+
height: 0;
|
|
45
|
+
background-color: transparent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* #endif */
|
|
49
|
+
</style>
|