vite-uni-dev-tool 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/core.js +1 -1
  2. package/dist/devIntercept/index.d.ts +3 -3
  3. package/dist/devIntercept/index.d.ts.map +1 -1
  4. package/dist/devIntercept/index.js +117 -114
  5. package/dist/plugins/uniDevTool/transform/transformApp.d.ts +32 -0
  6. package/dist/plugins/uniDevTool/transform/transformApp.d.ts.map +1 -0
  7. package/dist/plugins/uniDevTool/transform/transformApp.js +32 -0
  8. package/dist/plugins/uniDevTool/transform/transformMain.d.ts +26 -0
  9. package/dist/plugins/uniDevTool/transform/transformMain.d.ts.map +1 -0
  10. package/dist/plugins/uniDevTool/transform/transformMain.js +3 -0
  11. package/dist/plugins/uniDevTool/transform/transformVue.d.ts +41 -0
  12. package/dist/plugins/uniDevTool/transform/transformVue.d.ts.map +1 -0
  13. package/dist/plugins/uniDevTool/transform/transformVue.js +9 -0
  14. package/dist/plugins/uniDevTool/uniDevTool.d.ts +7 -3
  15. package/dist/plugins/uniDevTool/uniDevTool.d.ts.map +1 -1
  16. package/dist/plugins/uniDevTool/uniDevTool.js +3 -33
  17. package/dist/plugins/utils/index.d.ts +32 -0
  18. package/dist/plugins/utils/index.d.ts.map +1 -1
  19. package/dist/plugins/utils/index.js +1 -1
  20. package/dist/type.d.ts +2 -2
  21. package/dist/type.d.ts.map +1 -1
  22. package/dist/v2/AppInfo/index.vue +41 -0
  23. package/dist/v2/AutoSizer/index.vue +189 -0
  24. package/dist/v2/AutoSizer/index1.vue +193 -0
  25. package/dist/v2/AutoSizer/utils.ts +49 -0
  26. package/dist/v2/CaptureScreen/index.vue +78 -0
  27. package/dist/v2/CloseButton/index.vue +32 -0
  28. package/dist/v2/Connection/index.vue +94 -0
  29. package/dist/v2/ConsoleList/ConsoleItem.vue +235 -0
  30. package/dist/v2/ConsoleList/RunJSInput.vue +243 -0
  31. package/dist/v2/ConsoleList/index.vue +164 -0
  32. package/dist/v2/ConsoleList/staticTips.js +1144 -0
  33. package/dist/v2/DevTool/index.vue +162 -0
  34. package/dist/v2/DevToolButton/index.vue +228 -0
  35. package/dist/v2/DevToolTitle/index.vue +28 -0
  36. package/dist/v2/DevToolWindow/index.vue +1051 -0
  37. package/dist/v2/DeviceInfo/index.vue +48 -0
  38. package/dist/v2/Empty/empty.png +0 -0
  39. package/dist/v2/Empty/index.vue +40 -0
  40. package/dist/v2/FilterInput/index.vue +100 -0
  41. package/dist/v2/JsonPretty/components/Brackets/index.vue +30 -0
  42. package/dist/v2/JsonPretty/components/Carets/index.vue +65 -0
  43. package/dist/v2/JsonPretty/components/CheckController/index.vue +127 -0
  44. package/dist/v2/JsonPretty/components/TreeNode/index.vue +417 -0
  45. package/dist/v2/JsonPretty/hooks/useClipboard.ts +21 -0
  46. package/dist/v2/JsonPretty/hooks/useError.ts +21 -0
  47. package/dist/v2/JsonPretty/index.vue +531 -0
  48. package/dist/v2/JsonPretty/type.ts +125 -0
  49. package/dist/v2/JsonPretty/utils/index.js +211 -0
  50. package/dist/v2/NetworkList/NetworkDetail.vue +215 -0
  51. package/dist/v2/NetworkList/NetworkItem.vue +135 -0
  52. package/dist/v2/NetworkList/index.vue +148 -0
  53. package/dist/v2/PiniaList/index.vue +79 -0
  54. package/dist/v2/RouteList/index.vue +137 -0
  55. package/dist/v2/RunJS/index.vue +128 -0
  56. package/dist/v2/SettingList/index.vue +318 -0
  57. package/dist/v2/SourceCode/index.vue +237 -0
  58. package/dist/v2/StorageList/index.vue +165 -0
  59. package/dist/v2/SystemInfo/index.vue +49 -0
  60. package/dist/v2/Tabs/index.vue +127 -0
  61. package/dist/v2/Tag/index.vue +91 -0
  62. package/dist/v2/UniEvent/UniEventItem.vue +157 -0
  63. package/dist/v2/UniEvent/index.vue +127 -0
  64. package/dist/v2/UploadList/UploadDetail.vue +204 -0
  65. package/dist/v2/UploadList/UploadItem.vue +134 -0
  66. package/dist/v2/UploadList/index.vue +143 -0
  67. package/dist/v2/VirtualList/index.vue +140 -0
  68. package/dist/v2/VirtualListPro/AutoSize.vue +50 -0
  69. package/dist/v2/VirtualListPro/index.vue +255 -0
  70. package/dist/v2/VirtualListPro/readme.md +40 -0
  71. package/dist/v2/VuexList/index.vue +80 -0
  72. package/dist/v2/WebSocket/WebSocketItem.vue +129 -0
  73. package/dist/v2/WebSocket/WebSocketList.vue +183 -0
  74. package/dist/v2/WebSocket/index.vue +155 -0
  75. package/dist/v2/WindowInfo/index.vue +49 -0
  76. package/dist/v3/AppInfo/index.vue +35 -0
  77. package/dist/v3/AutoSizer/index.vue +193 -0
  78. package/dist/v3/AutoSizer/index1.vue +186 -0
  79. package/dist/v3/AutoSizer/utils.ts +49 -0
  80. package/dist/v3/CaptureScreen/index.vue +62 -0
  81. package/dist/v3/CloseButton/index.vue +29 -0
  82. package/dist/v3/Connection/index.vue +88 -0
  83. package/dist/v3/ConsoleList/ConsoleItem.vue +208 -0
  84. package/dist/v3/ConsoleList/RunJSInput.vue +240 -0
  85. package/dist/v3/ConsoleList/index.vue +139 -0
  86. package/dist/v3/ConsoleList/staticTips.ts +1145 -0
  87. package/dist/v3/DevTool/index.vue +217 -0
  88. package/dist/v3/DevToolButton/index.vue +210 -0
  89. package/dist/v3/DevToolTitle/index.vue +21 -0
  90. package/dist/v3/DevToolWindow/index.vue +1116 -0
  91. package/dist/v3/DeviceInfo/index.vue +32 -0
  92. package/dist/v3/Empty/empty.png +0 -0
  93. package/dist/v3/Empty/index.vue +28 -0
  94. package/dist/v3/FilterInput/index.vue +87 -0
  95. package/dist/v3/JsonPretty/components/Brackets/index.vue +23 -0
  96. package/dist/v3/JsonPretty/components/Carets/index.vue +59 -0
  97. package/dist/v3/JsonPretty/components/CheckController/index.vue +125 -0
  98. package/dist/v3/JsonPretty/components/TreeNode/index.vue +349 -0
  99. package/dist/v3/JsonPretty/hooks/useClipboard.ts +21 -0
  100. package/dist/v3/JsonPretty/hooks/useError.ts +21 -0
  101. package/dist/v3/JsonPretty/index.vue +476 -0
  102. package/dist/v3/JsonPretty/type.ts +125 -0
  103. package/dist/v3/JsonPretty/utils/index.ts +172 -0
  104. package/dist/v3/NetworkList/NetworkDetail.vue +194 -0
  105. package/dist/v3/NetworkList/NetworkItem.vue +120 -0
  106. package/dist/v3/NetworkList/index.vue +128 -0
  107. package/dist/v3/PiniaList/index.vue +64 -0
  108. package/dist/v3/RouteList/index.vue +121 -0
  109. package/dist/v3/RunJS/index.vue +128 -0
  110. package/dist/v3/SettingList/index.vue +313 -0
  111. package/dist/v3/SourceCode/index.vue +231 -0
  112. package/dist/v3/StorageList/index.vue +170 -0
  113. package/dist/v3/SystemInfo/index.vue +34 -0
  114. package/dist/v3/Tabs/index.vue +123 -0
  115. package/dist/v3/Tag/index.vue +89 -0
  116. package/dist/v3/UniEvent/UniEventItem.vue +126 -0
  117. package/dist/v3/UniEvent/index.vue +98 -0
  118. package/dist/v3/UploadList/UploadDetail.vue +192 -0
  119. package/dist/v3/UploadList/UploadItem.vue +117 -0
  120. package/dist/v3/UploadList/index.vue +117 -0
  121. package/dist/v3/VirtualList/index.vue +112 -0
  122. package/dist/v3/VirtualListPro/AutoSize.vue +43 -0
  123. package/dist/v3/VirtualListPro/index.vue +238 -0
  124. package/dist/v3/VirtualListPro/readme.md +40 -0
  125. package/dist/v3/VuexList/index.vue +54 -0
  126. package/dist/v3/WebSocket/WebSocketItem.vue +103 -0
  127. package/dist/v3/WebSocket/WebSocketList.vue +161 -0
  128. package/dist/v3/WebSocket/index.vue +124 -0
  129. package/dist/v3/WindowInfo/index.vue +33 -0
  130. package/package.json +1 -1
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <view class="device-info-content">
3
+ <JsonPretty :data="deviceInfo" v-if="showJson" />
4
+ <Empty v-else />
5
+ </view>
6
+ </template>
7
+
8
+ <script>
9
+ import Empty from '../Empty/index.vue';
10
+ import JsonPretty from '../JsonPretty/index.vue';
11
+
12
+ export default {
13
+ components: {
14
+ Empty,
15
+ JsonPretty,
16
+ },
17
+ props: {
18
+ deviceInfo: {
19
+ type: Object,
20
+ default: () => ({}),
21
+ },
22
+ },
23
+ computed: {
24
+ showJson() {
25
+ try {
26
+ const str = JSON.stringify(this.deviceInfo);
27
+ // 判断是否为有效对象且非空
28
+ if (
29
+ typeof this.deviceInfo === 'object' &&
30
+ (str === '' || str === '{}')
31
+ ) {
32
+ return false;
33
+ }
34
+ return true;
35
+ } catch (error) {
36
+ return false;
37
+ }
38
+ },
39
+ },
40
+ };
41
+ </script>
42
+
43
+ <style>
44
+ .device-info-content {
45
+ padding: 16px;
46
+ font-size: var(--dev-tool-base-font-size);
47
+ }
48
+ </style>
Binary file
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <view class="dev-tool-empty">
3
+ <image :src="empty" class="dev-tool-empty-image" />
4
+ <text class="dev-tool-empty-text">{{ text }}</text>
5
+ </view>
6
+ </template>
7
+ <script>
8
+ import empty from './empty.png';
9
+ export default {
10
+ props: {
11
+ text: {
12
+ type: String,
13
+ default: '暂无调试信息',
14
+ },
15
+ },
16
+ data() {
17
+ return {
18
+ empty,
19
+ };
20
+ },
21
+ };
22
+ </script>
23
+ <style scoped>
24
+ .dev-tool-empty {
25
+ display: flex;
26
+ flex-direction: column;
27
+ justify-content: center;
28
+ align-items: center;
29
+ margin: 0 auto;
30
+ }
31
+ .dev-tool-empty-image {
32
+ margin-top: 50px;
33
+ width: 50px;
34
+ height: 50px;
35
+ }
36
+
37
+ .dev-tool-empty-text {
38
+ color: #888;
39
+ }
40
+ </style>
@@ -0,0 +1,100 @@
1
+ <template>
2
+ <view class="filter-input-wrapper">
3
+ <input
4
+ :class="`filter-input`"
5
+ :value="modelValue"
6
+ :placeholder="placeholder || '请输入'"
7
+ @confirm="debounceInput"
8
+ />
9
+ <view class="filter-input-clear" @click="onClear"> × </view>
10
+ </view>
11
+ </template>
12
+
13
+ <script>
14
+ import { debounce } from '../../utils';
15
+
16
+ export default {
17
+ props: {
18
+ placeholder: {
19
+ type: String,
20
+ default: '请输入',
21
+ },
22
+ modelValue: {
23
+ type: String,
24
+ default: '',
25
+ },
26
+ },
27
+
28
+ data() {
29
+ return {
30
+ isActive: false,
31
+ };
32
+ },
33
+
34
+ methods: {
35
+ onInput(e) {
36
+ const value = e.detail.value;
37
+ this.$emit('update:modelValue', value);
38
+ this.$emit('search', value);
39
+ },
40
+
41
+ onClear() {
42
+ this.$emit('update:modelValue', '');
43
+ this.$emit('search', '');
44
+ },
45
+
46
+ openSearch(open) {
47
+ this.isActive = open;
48
+ this.$emit('openSearch', open);
49
+ if (!open && this.modelValue) {
50
+ this.$emit('update:modelValue', '');
51
+ this.$emit('search', '');
52
+ }
53
+ },
54
+ },
55
+
56
+ created() {
57
+ this.debounceInput = debounce(this.onInput, 500);
58
+ },
59
+ };
60
+ </script>
61
+
62
+ <style scoped>
63
+ .filter-input-wrapper {
64
+ flex: 1;
65
+ display: flex;
66
+ align-items: center;
67
+ padding: 0 8px;
68
+ width: 100%;
69
+ height: 24px;
70
+
71
+ border-radius: 4px;
72
+ border: 1px solid var(--dev-tool-border-color);
73
+
74
+ background-color: var(--dev-tool-bg-color);
75
+ transition: background-color 0.3s;
76
+ box-sizing: border-box;
77
+ }
78
+
79
+ .filter-input {
80
+ flex: 1;
81
+ box-shadow: none;
82
+ box-sizing: border-box;
83
+ border-radius: 5;
84
+ font-family: inherit;
85
+ color: var(--dev-tool-text-color);
86
+ font-weight: 400;
87
+ font: unset;
88
+ height: 24px;
89
+ transition: color 0.3s;
90
+ }
91
+
92
+ .filter-input-clear {
93
+ padding-left: 8px;
94
+ }
95
+
96
+ .filter-input-icon {
97
+ width: 24px;
98
+ height: 24px;
99
+ }
100
+ </style>
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <view class="json-pretty-tree-brackets" @click="onClick">
3
+ {{ data }}
4
+ </view>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ props: {
10
+ data: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ },
15
+ methods: {
16
+ onClick(e) {
17
+ this.$emit('click', e);
18
+ },
19
+ },
20
+ };
21
+ </script>
22
+
23
+ <style>
24
+ .json-pretty-tree-brackets {
25
+ cursor: pointer;
26
+ }
27
+ .json-pretty-tree-brackets:hover {
28
+ color: var(--json-pretty-primary-color);
29
+ }
30
+ </style>
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <view
3
+ v-if="isOpen || isClose"
4
+ :class="`json-pretty-carets json-pretty-carets-${
5
+ isOpen ? 'open' : 'close'
6
+ }`"
7
+ @click="onClick"
8
+ >
9
+ <view class="json-pretty-caret-down"></view>
10
+ </view>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ props: {
16
+ nodeType: {
17
+ type: String,
18
+ required: true,
19
+ },
20
+ },
21
+ computed: {
22
+ isOpen() {
23
+ return this.nodeType === 'objectStart' || this.nodeType === 'arrayStart';
24
+ },
25
+ isClose() {
26
+ return (
27
+ this.nodeType === 'objectCollapsed' ||
28
+ this.nodeType === 'arrayCollapsed'
29
+ );
30
+ },
31
+ },
32
+ methods: {
33
+ onClick(e) {
34
+ this.$emit('click', e);
35
+ },
36
+ },
37
+ };
38
+ </script>
39
+
40
+ <style>
41
+ .json-pretty-carets {
42
+ position: absolute;
43
+ right: 0;
44
+ cursor: pointer;
45
+ }
46
+ .json-pretty-carets svg {
47
+ transition: transform 0.3s;
48
+ }
49
+
50
+ .json-pretty-carets::hover {
51
+ color: var(--json-pretty-primary-color);
52
+ }
53
+
54
+ .json-pretty-carets-close {
55
+ transform: rotate(-90deg);
56
+ }
57
+
58
+ .json-pretty-caret-down {
59
+ margin: 7px 4px;
60
+ border: 3px solid #000;
61
+ border-top-color: transparent;
62
+ border-left-color: transparent;
63
+ transform: rotate(45deg);
64
+ }
65
+ </style>
@@ -0,0 +1,127 @@
1
+ <template>
2
+ <view
3
+ :class="`json-pretty-check-controller ${model ? 'is-checked' : ''}`"
4
+ @click="onClick"
5
+ >
6
+ <checkbox
7
+ v-if="uiType === 'checkbox'"
8
+ :checked="model"
9
+ style="transform: scale(0.6)"
10
+ @change="onChange"
11
+ />
12
+ <radio
13
+ v-if="uiType === 'radio'"
14
+ :checked="model"
15
+ style="transform: scale(0.6)"
16
+ @change="onChange"
17
+ />
18
+ </view>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ props: {
24
+ checked: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
28
+ isMultiple: {
29
+ type: Boolean,
30
+ default: true,
31
+ },
32
+ },
33
+ computed: {
34
+ uiType() {
35
+ return this.isMultiple ? 'checkbox' : 'radio';
36
+ },
37
+ model: {
38
+ get() {
39
+ return this.checked;
40
+ },
41
+ set(val) {
42
+ this.$emit('update:modelValue', val);
43
+ },
44
+ },
45
+ },
46
+ methods: {
47
+ onChange() {
48
+ this.$emit('change', !this.model);
49
+ },
50
+ onClick(e) {
51
+ e.stopPropagation();
52
+ },
53
+ },
54
+ };
55
+ </script>
56
+
57
+ <style>
58
+ .json-pretty-check-controller {
59
+ position: absolute;
60
+ left: 0;
61
+ }
62
+ .json-pretty-check-controller.is-checked .json-pretty-check-controller-inner {
63
+ background-color: var(--json-pretty-color-primary);
64
+ border-color: var(--json-pretty-color-primary);
65
+ }
66
+ .json-pretty-check-controller.is-checked
67
+ .json-pretty-check-controller-inner.is-checkbox:after {
68
+ transform: rotate(45deg) scaleY(1);
69
+ }
70
+ .json-pretty-check-controller.is-checked
71
+ .json-pretty-check-controller-inner.is-radio:after {
72
+ transform: translate(-50%, -50%) scale(1);
73
+ }
74
+ .json-pretty-check-controller .json-pretty-check-controller-inner {
75
+ display: inline-block;
76
+ position: relative;
77
+ border: 1px solid var(--json-pretty-border-color);
78
+ border-radius: 2px;
79
+ vertical-align: middle;
80
+ box-sizing: border-box;
81
+ width: 16px;
82
+ height: 16px;
83
+ background-color: #fff;
84
+ z-index: 1;
85
+ cursor: pointer;
86
+ transition:
87
+ border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
88
+ background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
89
+ }
90
+ .json-pretty-check-controller .json-pretty-check-controller-inner:after {
91
+ box-sizing: content-box;
92
+ content: '';
93
+ border: 2px solid #fff;
94
+ border-left: 0;
95
+ border-top: 0;
96
+ height: 8px;
97
+ left: 4px;
98
+ position: absolute;
99
+ top: 1px;
100
+ transform: rotate(45deg) scaleY(0);
101
+ width: 4px;
102
+ transition: transform 0.15s cubic-bezier(0.71, -0.46, 0.88, 0.6) 0.05s;
103
+ transform-origin: center;
104
+ }
105
+ .json-pretty-check-controller .json-pretty-check-controller-inner.is-radio {
106
+ border-radius: 100%;
107
+ }
108
+ .json-pretty-check-controller
109
+ .json-pretty-check-controller-inner.is-radio:after {
110
+ border-radius: 100%;
111
+ height: 4px;
112
+ background-color: #fff;
113
+ left: 50%;
114
+ top: 50%;
115
+ }
116
+ .json-pretty-check-controller .json-pretty-check-controller-original {
117
+ opacity: 0;
118
+ outline: none;
119
+ position: absolute;
120
+ z-index: -1;
121
+ top: 0;
122
+ left: 0;
123
+ right: 0;
124
+ bottom: 0;
125
+ margin: 0;
126
+ }
127
+ </style>