@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,648 @@
|
|
|
1
|
+
|
|
2
|
+
Editor.Panel.extend({
|
|
3
|
+
style: `
|
|
4
|
+
#main {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
height: 100%;
|
|
8
|
+
padding: 20px;
|
|
9
|
+
background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
|
|
10
|
+
color: #e0e0e0;
|
|
11
|
+
overflow: auto;
|
|
12
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.header {
|
|
17
|
+
text-align: center;
|
|
18
|
+
margin-bottom: 30px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.header h1 {
|
|
22
|
+
font-size: 24px;
|
|
23
|
+
color: #64b5f6;
|
|
24
|
+
margin-bottom: 10px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.header p {
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
color: #90a4ae;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.upload-area {
|
|
33
|
+
border: 2px dashed #546e7a;
|
|
34
|
+
border-radius: 10px;
|
|
35
|
+
padding: 30px;
|
|
36
|
+
text-align: center;
|
|
37
|
+
background-color: rgba(41, 50, 60, 0.5);
|
|
38
|
+
transition: all 0.3s ease;
|
|
39
|
+
margin-bottom: 25px;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.upload-area:hover, .upload-area.drag-over {
|
|
44
|
+
border-color: #64b5f6;
|
|
45
|
+
background-color: rgba(41, 50, 60, 0.7);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.upload-icon {
|
|
49
|
+
font-size: 48px;
|
|
50
|
+
margin-bottom: 15px;
|
|
51
|
+
color: #64b5f6;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.upload-text {
|
|
55
|
+
margin: 10px 0;
|
|
56
|
+
color: #b0bec5;
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
button {
|
|
61
|
+
background-color: #1976d2;
|
|
62
|
+
color: white;
|
|
63
|
+
border: none;
|
|
64
|
+
padding: 12px 24px;
|
|
65
|
+
border-radius: 6px;
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
font-size: 16px;
|
|
68
|
+
transition: all 0.3s;
|
|
69
|
+
margin-top: 10px;
|
|
70
|
+
font-weight: 500;
|
|
71
|
+
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
button:hover {
|
|
75
|
+
background-color: #2196f3;
|
|
76
|
+
transform: translateY(-2px);
|
|
77
|
+
box-shadow: 0 4px 8px rgba(0,0,0,0.3);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
button:active {
|
|
81
|
+
transform: translateY(0);
|
|
82
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.info-box {
|
|
86
|
+
background-color: #37474f;
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
padding: 20px;
|
|
89
|
+
margin-bottom: 25px;
|
|
90
|
+
border-left: 4px solid #64b5f6;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.info-box h3 {
|
|
94
|
+
margin-bottom: 15px;
|
|
95
|
+
color: #bb86fc;
|
|
96
|
+
font-size: 18px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.info-box ol {
|
|
100
|
+
padding-left: 25px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.info-box li {
|
|
104
|
+
margin-bottom: 10px;
|
|
105
|
+
line-height: 1.5;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.result-area {
|
|
110
|
+
background-color: rgba(27, 94, 32, 0.8);
|
|
111
|
+
border-radius: 8px;
|
|
112
|
+
padding: 20px;
|
|
113
|
+
margin-bottom: 20px;
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.success-message {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
margin-bottom: 20px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.success-icon {
|
|
124
|
+
font-size: 28px;
|
|
125
|
+
margin-right: 15px;
|
|
126
|
+
color: #a5d6a7;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.success-text {
|
|
130
|
+
font-size: 20px;
|
|
131
|
+
font-weight: bold;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.files-list h3 {
|
|
135
|
+
margin-bottom: 15px;
|
|
136
|
+
color: #bb86fc;
|
|
137
|
+
font-size: 18px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.files-list ul {
|
|
141
|
+
list-style-type: none;
|
|
142
|
+
padding-left: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.files-list li {
|
|
146
|
+
margin-bottom: 10px;
|
|
147
|
+
color: #e0e0e0;
|
|
148
|
+
padding: 10px;
|
|
149
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
150
|
+
border-radius: 6px;
|
|
151
|
+
font-size: 14px;
|
|
152
|
+
font-family: monospace;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.files-list li:before {
|
|
161
|
+
content: '📄';
|
|
162
|
+
margin-right: 10px;
|
|
163
|
+
font-size: 18px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.preview-container {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-wrap: wrap;
|
|
169
|
+
gap: 20px;
|
|
170
|
+
margin-top: 20px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.preview-box {
|
|
174
|
+
flex: 1;
|
|
175
|
+
min-width: 250px;
|
|
176
|
+
background-color: #263238;
|
|
177
|
+
border-radius: 8px;
|
|
178
|
+
padding: 15px;
|
|
179
|
+
overflow: auto;
|
|
180
|
+
max-height: 250px;
|
|
181
|
+
box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.preview-box h4 {
|
|
185
|
+
color: #bb86fc;
|
|
186
|
+
margin-bottom: 12px;
|
|
187
|
+
font-size: 16px;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.preview-box h4:before {
|
|
193
|
+
content: '🌐';
|
|
194
|
+
margin-right: 8px;
|
|
195
|
+
font-size: 18px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.preview-box pre {
|
|
199
|
+
white-space: pre-wrap;
|
|
200
|
+
font-family: 'Consolas', monospace;
|
|
201
|
+
font-size: 13px;
|
|
202
|
+
color: #e0e0e0;
|
|
203
|
+
line-height: 1.5;
|
|
204
|
+
margin: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.error-area {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
background-color: rgba(183, 28, 28, 0.8);
|
|
211
|
+
border-radius: 8px;
|
|
212
|
+
padding: 20px;
|
|
213
|
+
margin-bottom: 20px;
|
|
214
|
+
display: none;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.error-icon {
|
|
218
|
+
font-size: 28px;
|
|
219
|
+
margin-right: 15px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.error-text {
|
|
223
|
+
font-size: 18px;
|
|
224
|
+
font-weight: 500;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.footer {
|
|
228
|
+
text-align: center;
|
|
229
|
+
margin-top: auto;
|
|
230
|
+
padding-top: 20px;
|
|
231
|
+
color: #90a4ae;
|
|
232
|
+
font-size: 13px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.export-complete {
|
|
236
|
+
position: fixed;
|
|
237
|
+
top: 50%;
|
|
238
|
+
left: 50%;
|
|
239
|
+
transform: translate(-50%, -50%);
|
|
240
|
+
background: linear-gradient(135deg, #2e7d32, #1b5e20);
|
|
241
|
+
border-radius: 15px;
|
|
242
|
+
padding: 50px 40px;
|
|
243
|
+
text-align: center;
|
|
244
|
+
z-index: 1000;
|
|
245
|
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
|
|
246
|
+
min-width: 400px;
|
|
247
|
+
max-width: 90%;
|
|
248
|
+
display: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.complete-icon {
|
|
252
|
+
font-size: 80px;
|
|
253
|
+
margin-bottom: 25px;
|
|
254
|
+
color: #4caf50;
|
|
255
|
+
animation: pulse 1.5s infinite;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@keyframes pulse {
|
|
259
|
+
0% { transform: scale(1); }
|
|
260
|
+
50% { transform: scale(1.1); }
|
|
261
|
+
100% { transform: scale(1); }
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.complete-text {
|
|
265
|
+
font-size: 32px;
|
|
266
|
+
font-weight: bold;
|
|
267
|
+
margin-bottom: 30px;
|
|
268
|
+
color: #ffffff;
|
|
269
|
+
text-shadow: 0 2px 10px rgba(0,0,0,0.5);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.path-info {
|
|
273
|
+
background-color: rgba(255,255,255,0.1);
|
|
274
|
+
padding: 15px;
|
|
275
|
+
border-radius: 8px;
|
|
276
|
+
margin: 25px 0;
|
|
277
|
+
font-size: 16px;
|
|
278
|
+
text-align: left;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.path-info div {
|
|
282
|
+
margin: 10px 0;
|
|
283
|
+
display: flex;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.path-label {
|
|
287
|
+
font-weight: bold;
|
|
288
|
+
min-width: 120px;
|
|
289
|
+
color: #bb86fc;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.path-value {
|
|
293
|
+
flex: 1;
|
|
294
|
+
font-family: monospace;
|
|
295
|
+
word-break: break-all;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.languages-list {
|
|
299
|
+
display: flex;
|
|
300
|
+
flex-wrap: wrap;
|
|
301
|
+
gap: 10px;
|
|
302
|
+
margin: 15px 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.language-tag {
|
|
306
|
+
background-color: #64b5f6;
|
|
307
|
+
color: #1e1e1e;
|
|
308
|
+
padding: 5px 10px;
|
|
309
|
+
border-radius: 20px;
|
|
310
|
+
font-size: 14px;
|
|
311
|
+
font-weight: bold;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.progress-container {
|
|
315
|
+
width: 100%;
|
|
316
|
+
background-color: rgba(255,255,255,0.1);
|
|
317
|
+
border-radius: 8px;
|
|
318
|
+
margin: 20px 0;
|
|
319
|
+
overflow: hidden;
|
|
320
|
+
display: none;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.progress-bar {
|
|
324
|
+
height: 10px;
|
|
325
|
+
background: linear-gradient(90deg, #2196f3, #64b5f6);
|
|
326
|
+
border-radius: 8px;
|
|
327
|
+
width: 0%;
|
|
328
|
+
transition: width 0.3s ease;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.status-text {
|
|
332
|
+
text-align: center;
|
|
333
|
+
font-size: 16px;
|
|
334
|
+
margin-top: 10px;
|
|
335
|
+
color: #90a4ae;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.overlay {
|
|
339
|
+
position: fixed;
|
|
340
|
+
top: 0;
|
|
341
|
+
left: 0;
|
|
342
|
+
width: 100%;
|
|
343
|
+
height: 100%;
|
|
344
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
345
|
+
z-index: 999;
|
|
346
|
+
display: none;
|
|
347
|
+
}
|
|
348
|
+
`,
|
|
349
|
+
|
|
350
|
+
template: `
|
|
351
|
+
<div id="main">
|
|
352
|
+
<div class="overlay" id="overlay"></div>
|
|
353
|
+
|
|
354
|
+
<div class="export-complete" id="export-complete">
|
|
355
|
+
<div class="complete-icon">✅</div>
|
|
356
|
+
<div class="complete-text">导出成功!</div>
|
|
357
|
+
|
|
358
|
+
<div class="path-info">
|
|
359
|
+
<div>
|
|
360
|
+
<span class="path-label">工作表名称:</span>
|
|
361
|
+
<span class="path-value" id="sheet-name-display"></span>
|
|
362
|
+
</div>
|
|
363
|
+
<div>
|
|
364
|
+
<span class="path-label">输出路径:</span>
|
|
365
|
+
<span class="path-value" id="output-path-display">bundle/</span>
|
|
366
|
+
</div>
|
|
367
|
+
<div>
|
|
368
|
+
<span class="path-label">支持语言:</span>
|
|
369
|
+
<div class="languages-list" id="languages-list"></div>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
|
|
373
|
+
<button id="close-btn">关闭</button>
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
<div class="header">
|
|
377
|
+
<h1>Excel转多语言工具</h1>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
<div class="upload-area" id="drop-area">
|
|
381
|
+
<div class="upload-icon">📤</div>
|
|
382
|
+
<div class="upload-text">拖放Excel文件到此处</div>
|
|
383
|
+
<div class="upload-text">或</div>
|
|
384
|
+
<button id="select-btn">选择Excel文件</button>
|
|
385
|
+
<input type="file" id="file-input" accept=".xlsx" style="display: none;">
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
<div class="progress-container" id="progress-container">
|
|
389
|
+
<div class="progress-bar" id="progress-bar"></div>
|
|
390
|
+
<div class="status-text" id="status-text">正在处理...</div>
|
|
391
|
+
</div>
|
|
392
|
+
|
|
393
|
+
<div class="info-box">
|
|
394
|
+
<h3>使用说明:</h3>
|
|
395
|
+
<ol>
|
|
396
|
+
<li>Excel文件第一行必须是列头,第一列为id,第二列为key,第三列为描述,其他列为语言代码</li>
|
|
397
|
+
<li>第三行开始为实际数据</li>
|
|
398
|
+
<li>转换后将在bundle目录下生成语言文件</li>
|
|
399
|
+
<li>生成路径:根据工作表名称放在assets/bundle/xxx/script/language/目录下,如果文件夹为子目录则需要提供完整路径
|
|
400
|
+
根据_进行分割,如common子包放在assets/bundle/common/common,则工作表命名为common_common,如hall子包在
|
|
401
|
+
assets/bundle/hall,则工作表命名为hall即可
|
|
402
|
+
<li>支持任意数量的语言列</li>
|
|
403
|
+
<li>支持文本中的特殊字符和换行</li>
|
|
404
|
+
</ol>
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
<div class="result-area" id="result-area">
|
|
408
|
+
<div class="success-message">
|
|
409
|
+
<div class="success-icon">✓</div>
|
|
410
|
+
<div class="success-text" id="success-message">转换成功!</div>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
<div class="files-list">
|
|
414
|
+
<h3>生成文件:</h3>
|
|
415
|
+
<ul id="file-list"></ul>
|
|
416
|
+
</div>
|
|
417
|
+
|
|
418
|
+
<h3 style="margin-top: 20px; color: #bb86fc;">语言文件预览:</h3>
|
|
419
|
+
<div class="preview-container" id="preview-container"></div>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
<div class="error-area" id="error-area">
|
|
423
|
+
<div class="error-icon">⚠️</div>
|
|
424
|
+
<div class="error-text" id="error-message"></div>
|
|
425
|
+
</div>
|
|
426
|
+
</div>
|
|
427
|
+
`,
|
|
428
|
+
|
|
429
|
+
$: {
|
|
430
|
+
main: '#main',
|
|
431
|
+
dropArea: '#drop-area',
|
|
432
|
+
fileInput: '#file-input',
|
|
433
|
+
selectBtn: '#select-btn',
|
|
434
|
+
resultArea: '#result-area',
|
|
435
|
+
errorArea: '#error-area',
|
|
436
|
+
fileList: '#file-list',
|
|
437
|
+
previewContainer: '#preview-container',
|
|
438
|
+
successMessage: '#success-message',
|
|
439
|
+
errorMessage: '#error-message',
|
|
440
|
+
progressContainer: '#progress-container',
|
|
441
|
+
progressBar: '#progress-bar',
|
|
442
|
+
statusText: '#status-text',
|
|
443
|
+
exportComplete: '#export-complete',
|
|
444
|
+
sheetNameDisplay: '#sheet-name-display',
|
|
445
|
+
outputPathDisplay: '#output-path-display',
|
|
446
|
+
languagesList: '#languages-list',
|
|
447
|
+
closeBtn: '#close-btn',
|
|
448
|
+
overlay: '#overlay'
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
messages: {
|
|
452
|
+
'excel-to-lang:conversion-result'(event, result) {
|
|
453
|
+
this.handleConversionResult(result);
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
|
|
457
|
+
ready() {
|
|
458
|
+
// 初始化状态
|
|
459
|
+
this.$resultArea.style.display = 'none';
|
|
460
|
+
this.$errorArea.style.display = 'none';
|
|
461
|
+
this.$exportComplete.style.display = 'none';
|
|
462
|
+
this.$progressContainer.style.display = 'none';
|
|
463
|
+
this.$overlay.style.display = 'none';
|
|
464
|
+
|
|
465
|
+
// 初始化拖放区域
|
|
466
|
+
this.initDropArea();
|
|
467
|
+
|
|
468
|
+
// 绑定文件选择按钮
|
|
469
|
+
this.$selectBtn.addEventListener('click', () => {
|
|
470
|
+
this.$fileInput.click();
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
// 监听文件选择
|
|
474
|
+
this.$fileInput.addEventListener('change', (e) => {
|
|
475
|
+
if (e.target.files.length > 0) {
|
|
476
|
+
this.handleFile(e.target.files[0]);
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
// 绑定关闭按钮
|
|
483
|
+
this.$closeBtn.addEventListener('click', () => {
|
|
484
|
+
this.$exportComplete.style.display = 'none';
|
|
485
|
+
this.$overlay.style.display = 'none';
|
|
486
|
+
});
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
},
|
|
490
|
+
|
|
491
|
+
initDropArea() {
|
|
492
|
+
const dropArea = this.$dropArea;
|
|
493
|
+
|
|
494
|
+
// 防止默认拖放行为
|
|
495
|
+
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
|
496
|
+
dropArea.addEventListener(eventName, this.preventDefaults, false);
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
// 高亮拖放区域
|
|
500
|
+
['dragenter', 'dragover'].forEach(eventName => {
|
|
501
|
+
dropArea.addEventListener(eventName, () => {
|
|
502
|
+
dropArea.classList.add('drag-over');
|
|
503
|
+
}, false);
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
['dragleave', 'drop'].forEach(eventName => {
|
|
507
|
+
dropArea.addEventListener(eventName, () => {
|
|
508
|
+
dropArea.classList.remove('drag-over');
|
|
509
|
+
}, false);
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// 处理文件拖放
|
|
513
|
+
dropArea.addEventListener('drop', (e) => {
|
|
514
|
+
const dt = e.dataTransfer;
|
|
515
|
+
if (dt.files.length > 0) {
|
|
516
|
+
this.handleFile(dt.files[0]);
|
|
517
|
+
}
|
|
518
|
+
}, false);
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
preventDefaults(e) {
|
|
522
|
+
e.preventDefault();
|
|
523
|
+
e.stopPropagation();
|
|
524
|
+
},
|
|
525
|
+
|
|
526
|
+
handleFile(file) {
|
|
527
|
+
if (!file.name.endsWith('.xlsx')) {
|
|
528
|
+
this.showError('请选择.xlsx格式的Excel文件');
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// 显示进度条
|
|
533
|
+
this.$progressContainer.style.display = 'block';
|
|
534
|
+
this.$dropArea.style.display = 'none';
|
|
535
|
+
this.$progressBar.style.width = '30%';
|
|
536
|
+
this.$statusText.textContent = '正在读取Excel文件...';
|
|
537
|
+
|
|
538
|
+
// 发送转换请求到主进程
|
|
539
|
+
if (Editor && Editor.Ipc) Editor.Ipc.sendToMain('excel-to-lang:convert-excel', file.path);
|
|
540
|
+
|
|
541
|
+
},
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
handleConversionResult(result) {
|
|
546
|
+
// 隐藏进度条
|
|
547
|
+
this.$progressContainer.style.display = 'none';
|
|
548
|
+
|
|
549
|
+
if (result.success) {
|
|
550
|
+
// 显示完成状态
|
|
551
|
+
this.$exportComplete.style.display = 'block';
|
|
552
|
+
this.$overlay.style.display = 'block';
|
|
553
|
+
|
|
554
|
+
// 显示输出路径
|
|
555
|
+
this.$outputPathDisplay.textContent = `bundle/${result.sheetName}/script/language`;
|
|
556
|
+
|
|
557
|
+
// // 显示支持的语言列表
|
|
558
|
+
// this.$languagesList.innerHTML = '';
|
|
559
|
+
// result.languages.forEach(lang => {
|
|
560
|
+
// const tag = document.createElement('div');
|
|
561
|
+
// tag.className = 'language-tag';
|
|
562
|
+
// tag.textContent = lang;
|
|
563
|
+
// this.$languagesList.appendChild(tag);
|
|
564
|
+
// });
|
|
565
|
+
|
|
566
|
+
// 显示结果区域
|
|
567
|
+
this.$resultArea.style.display = 'block';
|
|
568
|
+
this.$errorArea.style.display = 'none';
|
|
569
|
+
|
|
570
|
+
// 更新成功消息
|
|
571
|
+
this.$successMessage.textContent = result.message;
|
|
572
|
+
|
|
573
|
+
// // 显示生成的文件列表
|
|
574
|
+
// this.$fileList.innerHTML = '';
|
|
575
|
+
// Object.values(result.files).flat().forEach(filePath => {
|
|
576
|
+
// const li = document.createElement('li');
|
|
577
|
+
// li.textContent = path.relative(Editor.Project.path, filePath);
|
|
578
|
+
// this.$fileList.appendChild(li);
|
|
579
|
+
// });
|
|
580
|
+
|
|
581
|
+
// 清空预览容器
|
|
582
|
+
this.$previewContainer.innerHTML = '';
|
|
583
|
+
|
|
584
|
+
// // 为每种语言创建预览框
|
|
585
|
+
// result.languages.forEach(lang => {
|
|
586
|
+
// const previewBox = document.createElement('div');
|
|
587
|
+
// previewBox.className = 'preview-box';
|
|
588
|
+
|
|
589
|
+
// const langHeader = document.createElement('h4');
|
|
590
|
+
// langHeader.textContent = `${lang}.ts`;
|
|
591
|
+
|
|
592
|
+
// const pre = document.createElement('pre');
|
|
593
|
+
// pre.textContent = `export default ${this.formatPreview(result.langData[lang])};`;
|
|
594
|
+
|
|
595
|
+
// previewBox.appendChild(langHeader);
|
|
596
|
+
// previewBox.appendChild(pre);
|
|
597
|
+
|
|
598
|
+
// this.$previewContainer.appendChild(previewBox);
|
|
599
|
+
// });
|
|
600
|
+
// 重置上传区域
|
|
601
|
+
this.resetUploadArea();
|
|
602
|
+
} else {
|
|
603
|
+
// 显示错误信息
|
|
604
|
+
this.showError(result.message);
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
|
|
608
|
+
formatPreview(data) {
|
|
609
|
+
const entries = Object.entries(data);
|
|
610
|
+
if (entries.length === 0) return '{}';
|
|
611
|
+
|
|
612
|
+
const items = entries.map(([key, value]) =>
|
|
613
|
+
` "${key}": "${value}"`
|
|
614
|
+
).join(',\n');
|
|
615
|
+
|
|
616
|
+
return `{\n${items}\n}`;
|
|
617
|
+
},
|
|
618
|
+
|
|
619
|
+
showError(message) {
|
|
620
|
+
this.$errorArea.style.display = 'flex';
|
|
621
|
+
this.$resultArea.style.display = 'none';
|
|
622
|
+
this.$exportComplete.style.display = 'none';
|
|
623
|
+
this.$overlay.style.display = 'none';
|
|
624
|
+
this.$errorMessage.textContent = message;
|
|
625
|
+
|
|
626
|
+
// 重置上传区域
|
|
627
|
+
this.resetUploadArea();
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
resetUploadArea() {
|
|
631
|
+
this.$dropArea.style.display = 'block';
|
|
632
|
+
this.$dropArea.innerHTML = `
|
|
633
|
+
<div class="upload-icon">📤</div>
|
|
634
|
+
<div class="upload-text">拖放Excel文件到此处</div>
|
|
635
|
+
<div class="upload-text">或</div>
|
|
636
|
+
<button id="select-btn">选择Excel文件</button>
|
|
637
|
+
`;
|
|
638
|
+
|
|
639
|
+
// 重新绑定按钮事件
|
|
640
|
+
this.$selectBtn = this.$dropArea.querySelector('#select-btn');
|
|
641
|
+
this.$selectBtn.addEventListener('click', () => {
|
|
642
|
+
this.$fileInput.click();
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
// 重新初始化拖放事件
|
|
646
|
+
this.initDropArea();
|
|
647
|
+
}
|
|
648
|
+
});
|