@ives_xxz/packages 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/AddComponent/main.js +32 -0
- package/AddComponent/package.json +26 -0
- package/AddComponent/panel/index.js +233 -0
- package/AddComponent/readme.md +38 -0
- package/AddComponent/scene-accessor.js +109 -0
- package/AddComponent/template-auto-dock.js +73 -0
- package/BitmapFontTools/i18n/en.js +1 -0
- package/BitmapFontTools/i18n/zh.js +1 -0
- package/BitmapFontTools/main.js +1 -0
- package/BitmapFontTools/package-lock.json +83 -0
- package/BitmapFontTools/package.json +37 -0
- package/BitmapFontTools/panel/font.css +1 -0
- package/BitmapFontTools/panel/font.js +58 -0
- package/BitmapFontTools/panel/font_panel.js +1 -0
- package/BitmapFontTools/panel/ttf.css +1 -0
- package/BitmapFontTools/panel/ttf.js +68 -0
- package/BitmapFontTools/panel/ttf_panel.js +1 -0
- package/FWAssetsFinder/main.js +9 -0
- package/FWAssetsFinder/package.json +20 -0
- package/FWAssetsFinder/panel/index.css +2 -0
- package/FWAssetsFinder/panel/index.html +52 -0
- package/FWAssetsFinder/panel/index.js +265 -0
- package/FWAssetsFinder/panel/less.css +71 -0
- package/FWAssetsFinder/panel/scene.js +194 -0
- package/FWExcelGenerator/main.js +367 -0
- package/FWExcelGenerator/package-lock.json +109 -0
- package/FWExcelGenerator/package.json +23 -0
- package/FWExcelGenerator/panel/index.js +648 -0
- package/FWLayerGenerator/main.js +186 -0
- package/FWLayerGenerator/package.json +21 -0
- package/FWLayerGenerator/panel/index.css +36 -0
- package/FWLayerGenerator/panel/index.html +17 -0
- package/FWLayerGenerator/panel/index.js +29 -0
- package/FWMask/inspector.js +26 -0
- package/FWMask/main.js +16 -0
- package/FWMask/package.json +6 -0
- package/FWPolygonPoints/main.js +149 -0
- package/FWPolygonPoints/package.json +9 -0
- package/PNG Auto Compress/CHANGELOG.md +32 -0
- package/PNG Auto Compress/LICENSE +21 -0
- package/PNG Auto Compress/README.md +113 -0
- package/PNG Auto Compress/config-manager.js +72 -0
- package/PNG Auto Compress/i18n/en.js +14 -0
- package/PNG Auto Compress/i18n/zh.js +14 -0
- package/PNG Auto Compress/images/setting.png +0 -0
- package/PNG Auto Compress/jsconfig.json +1 -0
- package/PNG Auto Compress/main.js +377 -0
- package/PNG Auto Compress/package.json +41 -0
- package/PNG Auto Compress/panel.setting/index.css +13 -0
- package/PNG Auto Compress/panel.setting/index.html +51 -0
- package/PNG Auto Compress/panel.setting/index.js +124 -0
- package/PNG Auto Compress/pngquant/macos/COPYRIGHT +687 -0
- package/PNG Auto Compress/pngquant/macos/README.md +78 -0
- package/PNG Auto Compress/pngquant/macos/pngquant +0 -0
- package/PNG Auto Compress/pngquant/macos/pngquant-compat +0 -0
- package/PNG Auto Compress/pngquant/windows/COPYRIGHT +687 -0
- package/PNG Auto Compress/pngquant/windows/Drag PNG here to reduce palette automatically.bat +11 -0
- package/PNG Auto Compress/pngquant/windows/Drag PNG here to reduce palette to 256.bat +10 -0
- package/PNG Auto Compress/pngquant/windows/README.txt +78 -0
- package/PNG Auto Compress/pngquant/windows/pngquant.exe +0 -0
- package/PNG Auto Compress/typings/cocos/editor.d.ts +1053 -0
- package/PNG Auto Compress/utils/file-utils.js +67 -0
- package/Quick Finder/CHANGELOG.md +100 -0
- package/Quick Finder/LICENSE +21 -0
- package/Quick Finder/README.en.md +141 -0
- package/Quick Finder/README.md +149 -0
- package/Quick Finder/i18n/en.js +42 -0
- package/Quick Finder/i18n/zh.js +42 -0
- package/Quick Finder/images/assets/animation-clip.png +0 -0
- package/Quick Finder/images/assets/asset.png +0 -0
- package/Quick Finder/images/assets/atlas.png +0 -0
- package/Quick Finder/images/assets/audio-clip.png +0 -0
- package/Quick Finder/images/assets/auto-atlas.png +0 -0
- package/Quick Finder/images/assets/bitmap-font.png +0 -0
- package/Quick Finder/images/assets/buffer.png +0 -0
- package/Quick Finder/images/assets/coffeescript.png +0 -0
- package/Quick Finder/images/assets/component.png +0 -0
- package/Quick Finder/images/assets/css.png +0 -0
- package/Quick Finder/images/assets/dragonbones-atlas.png +0 -0
- package/Quick Finder/images/assets/folder.png +0 -0
- package/Quick Finder/images/assets/html.png +0 -0
- package/Quick Finder/images/assets/javascript.png +0 -0
- package/Quick Finder/images/assets/json.png +0 -0
- package/Quick Finder/images/assets/label-atlas.png +0 -0
- package/Quick Finder/images/assets/markdown.png +0 -0
- package/Quick Finder/images/assets/material.png +0 -0
- package/Quick Finder/images/assets/mesh.png +0 -0
- package/Quick Finder/images/assets/mount.png +0 -0
- package/Quick Finder/images/assets/node.png +0 -0
- package/Quick Finder/images/assets/particle.png +0 -0
- package/Quick Finder/images/assets/physics-material.png +0 -0
- package/Quick Finder/images/assets/prefab.png +0 -0
- package/Quick Finder/images/assets/raw-asset.png +0 -0
- package/Quick Finder/images/assets/scene.png +0 -0
- package/Quick Finder/images/assets/shader.png +0 -0
- package/Quick Finder/images/assets/skeleton.png +0 -0
- package/Quick Finder/images/assets/spine.png +0 -0
- package/Quick Finder/images/assets/sprite-animation.png +0 -0
- package/Quick Finder/images/assets/sprite-atlas.png +0 -0
- package/Quick Finder/images/assets/sprite-frame.png +0 -0
- package/Quick Finder/images/assets/text.png +0 -0
- package/Quick Finder/images/assets/tiled-map.png +0 -0
- package/Quick Finder/images/assets/ttf-font.png +0 -0
- package/Quick Finder/images/assets/typescript.png +0 -0
- package/Quick Finder/images/search.png +0 -0
- package/Quick Finder/images/settings.png +0 -0
- package/Quick Finder/images/update.png +0 -0
- package/Quick Finder/images/version.png +0 -0
- package/Quick Finder/jsconfig.json +17 -0
- package/Quick Finder/lib/node-fetch.js +1649 -0
- package/Quick Finder/lib/vue.global.prod.js +7 -0
- package/Quick Finder/package.json +45 -0
- package/Quick Finder/src/common/config-manager.js +122 -0
- package/Quick Finder/src/eazax/browser-util.js +61 -0
- package/Quick Finder/src/eazax/color-util.js +37 -0
- package/Quick Finder/src/eazax/css/cocos-class.css +202 -0
- package/Quick Finder/src/eazax/css/cocos-tag.css +197 -0
- package/Quick Finder/src/eazax/css/eazax-colors.css +18 -0
- package/Quick Finder/src/eazax/editor-main-kit.js +53 -0
- package/Quick Finder/src/eazax/editor-main-util.js +112 -0
- package/Quick Finder/src/eazax/editor-renderer-kit.js +26 -0
- package/Quick Finder/src/eazax/file-util.js +158 -0
- package/Quick Finder/src/eazax/i18n.js +36 -0
- package/Quick Finder/src/eazax/main-event.js +81 -0
- package/Quick Finder/src/eazax/package-util.js +47 -0
- package/Quick Finder/src/eazax/renderer-event.js +80 -0
- package/Quick Finder/src/eazax/updater.js +92 -0
- package/Quick Finder/src/eazax/version-util.js +61 -0
- package/Quick Finder/src/eazax/window-util.js +80 -0
- package/Quick Finder/src/main/finder.js +101 -0
- package/Quick Finder/src/main/index.js +155 -0
- package/Quick Finder/src/main/opener.js +95 -0
- package/Quick Finder/src/main/panel-manager.js +159 -0
- package/Quick Finder/src/renderer/search/index.css +222 -0
- package/Quick Finder/src/renderer/search/index.html +46 -0
- package/Quick Finder/src/renderer/search/index.js +348 -0
- package/Quick Finder/src/renderer/settings/index.css +101 -0
- package/Quick Finder/src/renderer/settings/index.html +86 -0
- package/Quick Finder/src/renderer/settings/index.js +219 -0
- package/Quick Finder/typings/cocos/editor.d.ts +1053 -0
- package/Quick Finder/typings/vue.d.ts +1 -0
- package/README.md +93 -0
- package/package.json +12 -0
- package/unpack plist/main.js +253 -0
- package/unpack plist/package.json +13 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/CHANGELOG.md +30 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/LICENSE +21 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/README.en.md +111 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/README.md +115 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/i18n/en.js +55 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/i18n/zh.js +55 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/search.png +0 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/settings.png +0 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/update.png +0 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/images/version.png +0 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/jsconfig.json +17 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/lib/node-fetch.js +1649 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/lib/vue.global.prod.js +7 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/package.json +44 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/common/config-manager.js +104 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/browser-util.js +61 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/color-util.js +37 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/css/cocos-class.css +201 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/css/cocos-tag.css +197 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/css/eazax-colors.css +18 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/editor-main-kit.js +53 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/editor-main-util.js +147 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/editor-renderer-kit.js +26 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/file-util.js +158 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/i18n.js +36 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/main-event.js +81 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/package-util.js +47 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/renderer-event.js +80 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/updater.js +92 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/version-util.js +61 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/eazax/window-util.js +80 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/editor-api.js +90 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/finder.js +248 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/index.js +155 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/object-util.js +70 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/panel-manager.js +86 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/parser.js +161 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/main/printer.js +108 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/renderer/settings/index.css +61 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/renderer/settings/index.html +90 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/src/renderer/settings/index.js +191 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/typings/cocos/editor.d.ts +1053 -0
- package//345/274/225/347/224/250/346/237/245/346/211/276/345/231/250/typings/vue.d.ts +1 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* 主颜色 */
|
|
3
|
+
--main-color: #ffffff;
|
|
4
|
+
/* 文本颜色 */
|
|
5
|
+
--font-color: #333333;
|
|
6
|
+
/* 强调色 */
|
|
7
|
+
--accent-color: #2e88fb;
|
|
8
|
+
/* 边框调色 */
|
|
9
|
+
--border-color: #bdbdbd;
|
|
10
|
+
/* 按钮激活颜色 */
|
|
11
|
+
--btn-active-color: #0060dd;
|
|
12
|
+
/* 错误颜色 */
|
|
13
|
+
--error-color: #ff3030;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
* {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body {
|
|
21
|
+
margin: 0;
|
|
22
|
+
padding: 0;
|
|
23
|
+
background-color: rgba(0, 0, 0, 0);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#app {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
padding: 15px 0 15px 0;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 布局 */
|
|
36
|
+
.layout {
|
|
37
|
+
width: 500px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* 搜索 */
|
|
41
|
+
.search {
|
|
42
|
+
width: 500px;
|
|
43
|
+
height: 50px;
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
border-radius: 8px;
|
|
46
|
+
box-shadow: 5px 5px 15px 0px rgba(0, 0, 0, 0.25);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* 输入框 */
|
|
50
|
+
.search .input {
|
|
51
|
+
width: 420px;
|
|
52
|
+
background-color: var(--main-color);
|
|
53
|
+
padding: 0 0 0 18px;
|
|
54
|
+
border: 1px solid var(--border-color);
|
|
55
|
+
border-right: none;
|
|
56
|
+
border-radius: 8px 0 0 8px;
|
|
57
|
+
color: var(--font-color);
|
|
58
|
+
font-size: 20px;
|
|
59
|
+
user-select: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* 输入框:聚焦 */
|
|
63
|
+
.search .input:focus {
|
|
64
|
+
outline: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* 输入错误 */
|
|
68
|
+
.search .input-error {
|
|
69
|
+
animation: inputError 0.5s ease;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* 输入错误关键帧 */
|
|
73
|
+
@keyframes inputError {
|
|
74
|
+
0%,
|
|
75
|
+
50%,
|
|
76
|
+
100% {
|
|
77
|
+
color: var(--font-color);
|
|
78
|
+
}
|
|
79
|
+
25%,
|
|
80
|
+
75% {
|
|
81
|
+
color: var(--error-color);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* 按钮 */
|
|
86
|
+
.search .btn {
|
|
87
|
+
width: 80px;
|
|
88
|
+
margin: 0;
|
|
89
|
+
padding: 0;
|
|
90
|
+
background-color: var(--accent-color);
|
|
91
|
+
border: none;
|
|
92
|
+
border-radius: 0 8px 8px 0;
|
|
93
|
+
color: var(--main-color);
|
|
94
|
+
font-size: 20px;
|
|
95
|
+
user-select: none;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* 按钮:点击 */
|
|
100
|
+
.search .btn:active {
|
|
101
|
+
background-color: var(--btn-active-color);
|
|
102
|
+
color: #d8d8d8;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* 按钮:聚焦 */
|
|
106
|
+
.search .btn:focus {
|
|
107
|
+
outline: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* 结果 */
|
|
111
|
+
.result {
|
|
112
|
+
/* 这里需要将定位设为非 static,否则会被搜索栏的 box-shadow 遮挡 */
|
|
113
|
+
position: relative;
|
|
114
|
+
width: 500px;
|
|
115
|
+
margin: 5px 0 0 0;
|
|
116
|
+
background-color: var(--main-color);
|
|
117
|
+
border: 1px solid var(--border-color);
|
|
118
|
+
border-radius: 8px;
|
|
119
|
+
box-shadow: 5px 5px 15px 0px rgba(0, 0, 0, 0.25);
|
|
120
|
+
user-select: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* 结果列表 */
|
|
124
|
+
.result .list {
|
|
125
|
+
max-height: 450px;
|
|
126
|
+
overflow-x: hidden;
|
|
127
|
+
overflow-y: auto;
|
|
128
|
+
margin: 0;
|
|
129
|
+
padding: 0;
|
|
130
|
+
border-radius: 8px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* 结果列表::滚动条 */
|
|
134
|
+
.list::-webkit-scrollbar {
|
|
135
|
+
width: 12px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* 结果列表::滚动条轨道 */
|
|
139
|
+
.list::-webkit-scrollbar-track {
|
|
140
|
+
background-color: #f9f9f9;
|
|
141
|
+
border-radius: 0 8px 8px 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* 结果列表::滚动条滑块 */
|
|
145
|
+
.list::-webkit-scrollbar-thumb {
|
|
146
|
+
background-color: #cacaca;
|
|
147
|
+
/* 使用和背景色相同的边框来达到内边距的效果 */
|
|
148
|
+
border: 2px solid #f9f9f9;
|
|
149
|
+
border-radius: 6px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* 结果列表::滚动条滑块:虚指 */
|
|
153
|
+
.list::-webkit-scrollbar-thumb:hover {
|
|
154
|
+
background-color: #8d8c86;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* 结果列表-条目 */
|
|
158
|
+
.list .item {
|
|
159
|
+
min-height: 30px;
|
|
160
|
+
line-height: 20px;
|
|
161
|
+
padding: 5px 10px;
|
|
162
|
+
color: var(--font-color);
|
|
163
|
+
list-style: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* 结果列表-条目(选中) */
|
|
167
|
+
.list .item[selected='true'] {
|
|
168
|
+
background-color: var(--main-color);
|
|
169
|
+
color: var(--accent-color);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* 结果列表-条目:虚指 */
|
|
173
|
+
.list .item:hover {
|
|
174
|
+
background-color: var(--accent-color);
|
|
175
|
+
color: var(--main-color);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* 条目-信息 */
|
|
179
|
+
.item .info {
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* 条目-图标 */
|
|
185
|
+
.info .icon {
|
|
186
|
+
width: 16px;
|
|
187
|
+
height: 16px;
|
|
188
|
+
margin-right: 5px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* 条目-名称 */
|
|
192
|
+
.info .name {
|
|
193
|
+
font-size: 16px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* 条目-详情 */
|
|
197
|
+
.item .detail {
|
|
198
|
+
display: none;
|
|
199
|
+
height: 18px;
|
|
200
|
+
color: #bdbdbd;
|
|
201
|
+
line-height: 18px;
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
text-overflow: ellipsis;
|
|
205
|
+
direction: rtl;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* 条目选中或虚指时 */
|
|
209
|
+
.item:hover .detail,
|
|
210
|
+
.item[selected='true'] .detail {
|
|
211
|
+
display: block;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* 条目-路径 */
|
|
215
|
+
.detail .path {
|
|
216
|
+
font-size: 13px;
|
|
217
|
+
direction: ltr;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
[v-cloak] {
|
|
221
|
+
display: none;
|
|
222
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<!-- 样式 -->
|
|
7
|
+
<link rel="stylesheet" type="text/css" href="index.css">
|
|
8
|
+
<!-- 脚本 -->
|
|
9
|
+
<script type="text/javascript" src="../../../lib/vue.global.prod.js" defer></script>
|
|
10
|
+
<script type="text/javascript" src="index.js" defer></script>
|
|
11
|
+
</head>
|
|
12
|
+
|
|
13
|
+
<body>
|
|
14
|
+
<div id="app" v-cloak>
|
|
15
|
+
<!-- 布局 -->
|
|
16
|
+
<div class="layout">
|
|
17
|
+
<!-- 搜索 -->
|
|
18
|
+
<div class="search">
|
|
19
|
+
<!-- 输入框 -->
|
|
20
|
+
<input ref="input" class="input" type="text" v-model="keyword" :placeholder="t('searchPlaceholder')"
|
|
21
|
+
@input="onInputChange" @keydown.enter="onEnterBtnClick" @keydown.up="onUpBtnClick"
|
|
22
|
+
@keydown.down="onDownBtnClick" @keydown.left="onLeftBtnClick" @keydown.right="onRightBtnClick"
|
|
23
|
+
spellcheck="false" autofocus />
|
|
24
|
+
<!-- 按钮 -->
|
|
25
|
+
<button class="btn" v-text="t('searchBtn')" @click="onEnterBtnClick"></button>
|
|
26
|
+
</div>
|
|
27
|
+
<!-- 结果列表 -->
|
|
28
|
+
<div class="result" v-if="items.length > 0">
|
|
29
|
+
<ul class="list">
|
|
30
|
+
<li class="item" v-for="(item, index) in items" :key="index" :id="'item-' + index"
|
|
31
|
+
@click="onItemClick(item, index)" :selected="index === curIndex">
|
|
32
|
+
<div class="info">
|
|
33
|
+
<img class="icon" :src="getIcon(item.extname)" alt="icon"></img>
|
|
34
|
+
<span class="name">{{ item.name }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="detail">
|
|
37
|
+
<span class="path">{{ getPath(item.path) }}</span>
|
|
38
|
+
</div>
|
|
39
|
+
</li>
|
|
40
|
+
</ul>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</body>
|
|
45
|
+
|
|
46
|
+
</html>
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
const { sep } = require('path');
|
|
2
|
+
const { getUrlParam } = require('../../eazax/browser-util');
|
|
3
|
+
const { translate } = require('../../eazax/i18n');
|
|
4
|
+
const RendererEvent = require('../../eazax/renderer-event');
|
|
5
|
+
|
|
6
|
+
// 导入 Vue 工具函数
|
|
7
|
+
const { ref, onMounted, onBeforeUnmount, nextTick, createApp } = Vue;
|
|
8
|
+
|
|
9
|
+
/** 当前语言 */
|
|
10
|
+
const LANG = getUrlParam('lang');
|
|
11
|
+
|
|
12
|
+
// 构建 Vue 应用
|
|
13
|
+
const App = {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 设置
|
|
17
|
+
* @param {*} props
|
|
18
|
+
* @param {*} context
|
|
19
|
+
*/
|
|
20
|
+
setup(props, context) {
|
|
21
|
+
|
|
22
|
+
// 分帧加载定时器
|
|
23
|
+
let loadHandler = null;
|
|
24
|
+
|
|
25
|
+
// 输入框元素
|
|
26
|
+
const input = ref(null);
|
|
27
|
+
|
|
28
|
+
// 输入的关键字
|
|
29
|
+
const keyword = ref('');
|
|
30
|
+
// 关键词匹配返回的结果
|
|
31
|
+
const items = ref([]);
|
|
32
|
+
// 当前选中的项目下标
|
|
33
|
+
const curIndex = ref(-1);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 更新当前的选择
|
|
37
|
+
*/
|
|
38
|
+
function updateSelected() {
|
|
39
|
+
// 更新输入框的文本
|
|
40
|
+
keyword.value = items.value[curIndex.value].name;
|
|
41
|
+
// 只有当目标元素不在可视区域内才滚动
|
|
42
|
+
nextTick(() => {
|
|
43
|
+
const id = `item-${curIndex.value}`;
|
|
44
|
+
document.getElementById(id).scrollIntoViewIfNeeded(false);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 输入框更新回调
|
|
50
|
+
* @param {*} event
|
|
51
|
+
*/
|
|
52
|
+
function onInputChange(event) {
|
|
53
|
+
// 取消分帧加载
|
|
54
|
+
if (loadHandler) {
|
|
55
|
+
clearTimeout(loadHandler);
|
|
56
|
+
loadHandler = null;
|
|
57
|
+
}
|
|
58
|
+
// 取消当前选中
|
|
59
|
+
curIndex.value = -1;
|
|
60
|
+
// 关键字为空时不进行搜索
|
|
61
|
+
if (keyword.value === '') {
|
|
62
|
+
items.value.length = 0;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// 发消息给主进程进行关键词匹配
|
|
66
|
+
RendererEvent.send('match', keyword.value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 确认按钮点击回调
|
|
71
|
+
* @param {*} event
|
|
72
|
+
*/
|
|
73
|
+
function onEnterBtnClick(event) {
|
|
74
|
+
if (curIndex.value === -1) {
|
|
75
|
+
if (keyword.value !== '') {
|
|
76
|
+
// 输入框文本错误动画
|
|
77
|
+
const inputClasses = input.value.classList;
|
|
78
|
+
inputClasses.add('input-error');
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
inputClasses.remove('input-error');
|
|
81
|
+
}, 500);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
const item = items.value[curIndex.value];
|
|
85
|
+
// 更新输入框文本
|
|
86
|
+
keyword.value = item.name;
|
|
87
|
+
// 发消息给主进程
|
|
88
|
+
RendererEvent.send('open', item.path);
|
|
89
|
+
}
|
|
90
|
+
// 聚焦到输入框(此时焦点在按钮或列表上)
|
|
91
|
+
focusOnInputField();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 上箭头按键回调
|
|
96
|
+
* @param {*} event
|
|
97
|
+
*/
|
|
98
|
+
function onUpBtnClick(event) {
|
|
99
|
+
// 阻止默认事件(光标移动)
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
// 循环选择
|
|
102
|
+
if (curIndex.value > 0) {
|
|
103
|
+
curIndex.value--;
|
|
104
|
+
} else {
|
|
105
|
+
curIndex.value = items.value.length - 1;
|
|
106
|
+
}
|
|
107
|
+
// 更新选择
|
|
108
|
+
updateSelected();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 下箭头按键回调
|
|
113
|
+
* @param {*} event
|
|
114
|
+
*/
|
|
115
|
+
function onDownBtnClick(event) {
|
|
116
|
+
// 阻止默认事件(光标移动)
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
// 循环选择
|
|
119
|
+
if (curIndex.value >= items.value.length - 1) {
|
|
120
|
+
curIndex.value = 0;
|
|
121
|
+
} else {
|
|
122
|
+
curIndex.value++;
|
|
123
|
+
}
|
|
124
|
+
// 更新选择
|
|
125
|
+
updateSelected();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 左箭头按键回调
|
|
130
|
+
* @param {*} event
|
|
131
|
+
*/
|
|
132
|
+
function onLeftBtnClick(event) {
|
|
133
|
+
// 是否已选中项目
|
|
134
|
+
if (curIndex.value === -1) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
// 阻止默认事件(光标移动)
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
// 在资源管理器中显示并选中文件
|
|
140
|
+
focusOnFileInAssets();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* 右箭头按键回调
|
|
145
|
+
* @param {*} event
|
|
146
|
+
*/
|
|
147
|
+
function onRightBtnClick(event) {
|
|
148
|
+
// 是否已选中项目
|
|
149
|
+
if (curIndex.value === -1) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
// 阻止默认事件(光标移动)
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
// 在资源管理器中显示并选中文件
|
|
155
|
+
focusOnFileInAssets();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* 在资源管理器中显示并选中文件
|
|
160
|
+
*/
|
|
161
|
+
function focusOnFileInAssets() {
|
|
162
|
+
// 当前选中项目
|
|
163
|
+
const item = items.value[curIndex.value];
|
|
164
|
+
// 发消息给主进程
|
|
165
|
+
RendererEvent.send('focus', item.path);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 结果点击回调
|
|
170
|
+
* @param {{ name: string, path: string, extname: string }} item 数据
|
|
171
|
+
* @param {number} index 下标
|
|
172
|
+
*/
|
|
173
|
+
function onItemClick(item, index) {
|
|
174
|
+
curIndex.value = parseInt(index);
|
|
175
|
+
keyword.value = item.name;
|
|
176
|
+
// 添加组件
|
|
177
|
+
onEnterBtnClick(null);
|
|
178
|
+
// 聚焦到输入框(此时焦点在列表上)
|
|
179
|
+
// 换成在 onEnterBtnClick 里统一处理了
|
|
180
|
+
// focusOnInputField();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* 聚焦到输入框
|
|
185
|
+
*/
|
|
186
|
+
function focusOnInputField() {
|
|
187
|
+
input.value.focus();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* (主进程)数据更新回调
|
|
192
|
+
* @param {Electron.IpcRendererEvent} event
|
|
193
|
+
*/
|
|
194
|
+
function onDataUpdate(event) {
|
|
195
|
+
// console.log('onDataUpdate');
|
|
196
|
+
// 触发文件搜索
|
|
197
|
+
onInputChange(null);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* (主进程)匹配关键词回调
|
|
202
|
+
* @param {Electron.IpcRendererEvent} event
|
|
203
|
+
* @param {{ name: string, path: string, extname: string }[]} results 结果
|
|
204
|
+
*/
|
|
205
|
+
function onMatchReply(event, results) {
|
|
206
|
+
// console.log('onMatchReply', results);
|
|
207
|
+
// 清除已有数据
|
|
208
|
+
items.value.length = 0;
|
|
209
|
+
// 当只有一个结果时直接选中
|
|
210
|
+
if (results.length === 1) {
|
|
211
|
+
items.value = results;
|
|
212
|
+
curIndex.value = 0;
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
// 结果数量多时分段加载
|
|
216
|
+
if (results.length >= 200) {
|
|
217
|
+
// 每次加载的数量
|
|
218
|
+
const threshold = 400;
|
|
219
|
+
// 分段加载函数
|
|
220
|
+
const load = () => {
|
|
221
|
+
const length = results.length,
|
|
222
|
+
count = length >= threshold ? threshold : length,
|
|
223
|
+
part = results.splice(0, count);
|
|
224
|
+
// 加载一部分
|
|
225
|
+
for (let i = 0, l = part.length; i < l; i++) {
|
|
226
|
+
items.value.push(part[i]);
|
|
227
|
+
}
|
|
228
|
+
// 是否还有数据
|
|
229
|
+
if (results.length > 0) {
|
|
230
|
+
// 下一波继续
|
|
231
|
+
loadHandler = setTimeout(load);
|
|
232
|
+
} else {
|
|
233
|
+
// Done
|
|
234
|
+
loadHandler = null;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// 开始加载
|
|
238
|
+
load();
|
|
239
|
+
} else {
|
|
240
|
+
// 数量不多,更新结果列表
|
|
241
|
+
items.value = results;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* 获取图标
|
|
247
|
+
* @param {string} extname 扩展名
|
|
248
|
+
* @returns {string}
|
|
249
|
+
*/
|
|
250
|
+
function getIcon(extname) {
|
|
251
|
+
const iconName = ICON_MAP[extname] || 'asset';
|
|
252
|
+
return `../../../images/assets/${iconName}.png`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* 处理路径
|
|
257
|
+
* @param {string} path 完成路径
|
|
258
|
+
* @returns {string}
|
|
259
|
+
*/
|
|
260
|
+
function getPath(path) {
|
|
261
|
+
const start = path.indexOf(`${sep}assets`);
|
|
262
|
+
return path.slice(start + 1);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* 翻译
|
|
267
|
+
* @param {string} key
|
|
268
|
+
*/
|
|
269
|
+
function t(key) {
|
|
270
|
+
return translate(LANG, key);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* 生命周期:挂载后
|
|
275
|
+
*/
|
|
276
|
+
onMounted(() => {
|
|
277
|
+
// 监听事件
|
|
278
|
+
RendererEvent.on('data-update', onDataUpdate);
|
|
279
|
+
RendererEvent.on('match-reply', onMatchReply);
|
|
280
|
+
// 下一帧
|
|
281
|
+
nextTick(() => {
|
|
282
|
+
// 聚焦到输入框
|
|
283
|
+
focusOnInputField();
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 生命周期:卸载前
|
|
289
|
+
*/
|
|
290
|
+
onBeforeUnmount(() => {
|
|
291
|
+
// 取消事件监听
|
|
292
|
+
RendererEvent.removeAllListeners('data-update');
|
|
293
|
+
RendererEvent.removeAllListeners('match-reply');
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
return {
|
|
297
|
+
input,
|
|
298
|
+
keyword,
|
|
299
|
+
items,
|
|
300
|
+
curIndex,
|
|
301
|
+
onInputChange,
|
|
302
|
+
onEnterBtnClick,
|
|
303
|
+
onUpBtnClick,
|
|
304
|
+
onDownBtnClick,
|
|
305
|
+
onLeftBtnClick,
|
|
306
|
+
onRightBtnClick,
|
|
307
|
+
onItemClick,
|
|
308
|
+
getIcon,
|
|
309
|
+
getPath,
|
|
310
|
+
t,
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// 创建实例
|
|
318
|
+
const app = createApp(App);
|
|
319
|
+
// 挂载
|
|
320
|
+
app.mount('#app');
|
|
321
|
+
|
|
322
|
+
/** 文件扩展名对应图标表 */
|
|
323
|
+
const ICON_MAP = {
|
|
324
|
+
'.anim': 'animation-clip',
|
|
325
|
+
'.prefab': 'prefab',
|
|
326
|
+
'.fire': 'scene',
|
|
327
|
+
'.scene': 'scene',
|
|
328
|
+
'.effect': 'shader',
|
|
329
|
+
'.mesh': 'mesh',
|
|
330
|
+
'.FBX': 'mesh',
|
|
331
|
+
'.mtl': 'material',
|
|
332
|
+
'.pmtl': 'physics-material',
|
|
333
|
+
'.pac': 'auto-atlas',
|
|
334
|
+
'.ts': 'typescript',
|
|
335
|
+
'.js': 'javascript',
|
|
336
|
+
'.coffee': 'coffeescript',
|
|
337
|
+
'.json': 'json',
|
|
338
|
+
'.md': 'markdown',
|
|
339
|
+
'.html': 'html',
|
|
340
|
+
'.css': 'css',
|
|
341
|
+
'.txt': 'text',
|
|
342
|
+
'.ttf': 'ttf-font',
|
|
343
|
+
'.fnt': 'bitmap-font',
|
|
344
|
+
'.mp3': 'audio-clip',
|
|
345
|
+
'.png': 'atlas',
|
|
346
|
+
'.jpg': 'atlas',
|
|
347
|
+
'.plist': 'sprite-atlas',
|
|
348
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0 12px;
|
|
8
|
+
background-color: #454545;
|
|
9
|
+
color: #bdbdbd;
|
|
10
|
+
user-select: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#app {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* 标题 */
|
|
19
|
+
.title {
|
|
20
|
+
height: 24px;
|
|
21
|
+
font-size: 18px;
|
|
22
|
+
font-weight: 800;
|
|
23
|
+
margin: 15px 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* 属性容器 */
|
|
27
|
+
.properties {
|
|
28
|
+
overflow: visible;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* 文件类型 */
|
|
32
|
+
.openable {
|
|
33
|
+
height: 100px !important;
|
|
34
|
+
border: 1px solid #666666;
|
|
35
|
+
border-radius: 3px;
|
|
36
|
+
background-color: #333333;
|
|
37
|
+
padding: 5px 0;
|
|
38
|
+
box-shadow: inset 0 0 8px 2px rgba(0, 0, 0, 0.2);
|
|
39
|
+
overflow-y: scroll;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* 文件类型 项 */
|
|
43
|
+
.openable .item {
|
|
44
|
+
height: 20px;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.openable .item:not(:first-child) {
|
|
51
|
+
margin-top: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* 文件类型 项 勾选框 */
|
|
55
|
+
.openable .item .checkbox {
|
|
56
|
+
margin-left: 8px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* 文件类型 项 类型 */
|
|
60
|
+
.openable .item .type {
|
|
61
|
+
margin-left: 10px;
|
|
62
|
+
line-height: 20px;
|
|
63
|
+
font-size: 11px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.openable .item:hover .type {
|
|
67
|
+
color: #eeeeee;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* 应用按钮 */
|
|
71
|
+
.apply-btn {
|
|
72
|
+
min-width: 20px;
|
|
73
|
+
height: 33px;
|
|
74
|
+
background-image: linear-gradient(#4281b6, #4281b6);
|
|
75
|
+
border: 1px solid #171717;
|
|
76
|
+
border-radius: 3px;
|
|
77
|
+
color: #fff;
|
|
78
|
+
font-size: 16px;
|
|
79
|
+
font-weight: 800;
|
|
80
|
+
text-align: center;
|
|
81
|
+
outline: none;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.apply-btn:hover {
|
|
87
|
+
background-image: none;
|
|
88
|
+
background-color: #4c87b6;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.apply-btn:active {
|
|
92
|
+
background-image: none;
|
|
93
|
+
background-color: #2e6da2;
|
|
94
|
+
border-color: #fd942b;
|
|
95
|
+
color: #cdcdcd;
|
|
96
|
+
box-shadow: 1px 1px 10px #262626 inset;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[v-cloak] {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|