skill-base 2.0.4 → 2.0.6

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 (46) hide show
  1. package/README.md +177 -115
  2. package/bin/skill-base.js +7 -0
  3. package/package.json +3 -1
  4. package/src/cappy.js +416 -0
  5. package/src/database.js +11 -0
  6. package/src/index.js +87 -24
  7. package/src/middleware/auth.js +96 -32
  8. package/src/routes/auth.js +1 -1
  9. package/src/routes/skills.js +10 -5
  10. package/src/utils/zip.js +15 -4
  11. package/static/android-chrome-192x192.png +0 -0
  12. package/static/android-chrome-512x512.png +0 -0
  13. package/static/apple-touch-icon.png +0 -0
  14. package/static/assets/index-BgwubB87.css +1 -0
  15. package/static/assets/index-DBHCo8Mz.js +230 -0
  16. package/static/favicon-16x16.png +0 -0
  17. package/static/favicon-32x32.png +0 -0
  18. package/static/favicon.ico +0 -0
  19. package/static/favicon.svg +14 -0
  20. package/static/index.html +18 -248
  21. package/static/site.webmanifest +1 -0
  22. package/static/admin/users.html +0 -593
  23. package/static/cli-code.html +0 -203
  24. package/static/css/.gitkeep +0 -0
  25. package/static/css/style.css +0 -1567
  26. package/static/diff.html +0 -466
  27. package/static/file.html +0 -443
  28. package/static/js/.gitkeep +0 -0
  29. package/static/js/admin/users.js +0 -346
  30. package/static/js/app.js +0 -508
  31. package/static/js/auth.js +0 -151
  32. package/static/js/cli-code.js +0 -184
  33. package/static/js/collaborators.js +0 -283
  34. package/static/js/diff.js +0 -540
  35. package/static/js/file.js +0 -619
  36. package/static/js/i18n.js +0 -739
  37. package/static/js/index.js +0 -168
  38. package/static/js/publish.js +0 -718
  39. package/static/js/settings.js +0 -124
  40. package/static/js/setup.js +0 -157
  41. package/static/js/skill.js +0 -808
  42. package/static/login.html +0 -82
  43. package/static/publish.html +0 -459
  44. package/static/settings.html +0 -163
  45. package/static/setup.html +0 -101
  46. package/static/skill.html +0 -851
Binary file
Binary file
Binary file
@@ -0,0 +1,14 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
4
+ <stop offset="0%" style="stop-color:#0a0a0f"/>
5
+ <stop offset="100%" style="stop-color:#13141a"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <rect width="100" height="100" rx="16" fill="url(#bg)"/>
9
+ <g transform="translate(50,50)" stroke="#00FFA3" stroke-width="5" fill="none" stroke-linecap="round" stroke-linejoin="round">
10
+ <path d="M0,-28 L24,-14 L24,14 L0,28 L-24,14 L-24,-14 Z"/>
11
+ <path d="M-24,-14 L0,0 L24,-14"/>
12
+ <path d="M0,0 L0,28"/>
13
+ </g>
14
+ </svg>
package/static/index.html CHANGED
@@ -1,251 +1,21 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Skill Base</title>
7
- <link rel="stylesheet" href="/css/style.css">
8
- <style>
9
- /* 页面标题区域 */
10
- .page-header {
11
- margin-bottom: var(--spacing-lg);
12
- }
13
-
14
- .page-title {
15
- font-size: 1.75rem;
16
- font-weight: 700;
17
- color: var(--text-color);
18
- margin-bottom: var(--spacing-md);
19
- }
20
-
21
- /* 搜索栏 */
22
- .search-container {
23
- max-width: 500px;
24
- }
25
-
26
- /* Skill 卡片网格 */
27
- .skill-grid {
28
- display: grid;
29
- grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
30
- gap: var(--spacing-lg);
31
- }
32
-
33
- .skill-card {
34
- background-color: var(--white);
35
- border-radius: var(--radius);
36
- box-shadow: var(--shadow);
37
- padding: var(--spacing-lg);
38
- cursor: pointer;
39
- transition: var(--transition);
40
- text-decoration: none;
41
- color: inherit;
42
- display: block;
43
- }
44
-
45
- .skill-card:hover {
46
- box-shadow: var(--shadow-md);
47
- transform: translateY(-2px);
48
- text-decoration: none;
49
- }
50
-
51
- .skill-card-header {
52
- display: flex;
53
- align-items: flex-start;
54
- justify-content: space-between;
55
- margin-bottom: var(--spacing-sm);
56
- }
57
-
58
- .skill-card-name {
59
- font-size: 1.125rem;
60
- font-weight: 600;
61
- color: var(--text-color);
62
- margin: 0;
63
- }
64
-
65
- .skill-card-desc {
66
- font-size: 0.875rem;
67
- color: var(--text-secondary);
68
- line-height: 1.5;
69
- margin-bottom: var(--spacing-md);
70
- display: -webkit-box;
71
- -webkit-line-clamp: 2;
72
- -webkit-box-orient: vertical;
73
- overflow: hidden;
74
- }
75
-
76
- .skill-card-footer {
77
- display: flex;
78
- align-items: center;
79
- justify-content: space-between;
80
- font-size: 0.75rem;
81
- color: var(--text-muted);
82
- }
83
-
84
- .skill-card-meta {
85
- display: flex;
86
- align-items: center;
87
- gap: var(--spacing-md);
88
- }
89
-
90
- .skill-card-owner {
91
- display: flex;
92
- align-items: center;
93
- gap: var(--spacing-xs);
94
- }
95
-
96
- /* 空状态 */
97
- .empty-state {
98
- text-align: center;
99
- padding: var(--spacing-xl) var(--spacing-md);
100
- color: var(--text-secondary);
101
- }
102
-
103
- .empty-state-icon {
104
- font-size: 4rem;
105
- margin-bottom: var(--spacing-md);
106
- opacity: 0.5;
107
- }
108
-
109
- .empty-state-text {
110
- font-size: 1rem;
111
- margin-bottom: var(--spacing-md);
112
- }
113
-
114
- /* 浮动按钮 */
115
- .fab {
116
- position: fixed;
117
- bottom: var(--spacing-xl);
118
- right: var(--spacing-xl);
119
- width: 56px;
120
- height: 56px;
121
- border-radius: 50%;
122
- background-color: var(--primary-color);
123
- color: var(--white);
124
- border: none;
125
- box-shadow: var(--shadow-lg);
126
- cursor: pointer;
127
- display: flex;
128
- align-items: center;
129
- justify-content: center;
130
- transition: var(--transition);
131
- text-decoration: none;
132
- font-size: 1.5rem;
133
- }
134
-
135
- .fab:hover {
136
- background-color: var(--primary-hover);
137
- transform: scale(1.1);
138
- text-decoration: none;
139
- }
140
-
141
- /* Loading 骨架屏 */
142
- .skeleton-card {
143
- background-color: var(--white);
144
- border-radius: var(--radius);
145
- box-shadow: var(--shadow);
146
- padding: var(--spacing-lg);
147
- }
148
-
149
- .skeleton-title {
150
- height: 24px;
151
- width: 60%;
152
- margin-bottom: var(--spacing-sm);
153
- }
154
-
155
- .skeleton-desc {
156
- height: 16px;
157
- width: 100%;
158
- margin-bottom: var(--spacing-xs);
159
- }
160
-
161
- .skeleton-desc-short {
162
- height: 16px;
163
- width: 75%;
164
- margin-bottom: var(--spacing-md);
165
- }
166
-
167
- .skeleton-footer {
168
- height: 14px;
169
- width: 50%;
170
- }
171
-
172
- @media (max-width: 768px) {
173
- .skill-grid {
174
- grid-template-columns: 1fr;
175
- }
176
-
177
- .fab {
178
- bottom: var(--spacing-lg);
179
- right: var(--spacing-lg);
180
- }
181
- }
182
- </style>
183
- </head>
184
- <body class="app-devtools">
185
- <!-- 导航栏 -->
186
- <nav class="navbar">
187
- <div class="container">
188
- <a href="/" class="navbar-brand">
189
- <svg class="navbar-brand-icon" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>
190
- <span>Skill Base</span>
191
- </a>
192
- <div class="navbar-nav">
193
- <a href="/" class="active" data-i18n="nav.home">首页</a>
194
- <a href="/publish.html" class="hide-mobile" data-i18n="nav.publish">发布</a>
195
- </div>
196
- <!-- 用户区域由 JS 动态渲染 -->
197
- </div>
198
- </nav>
199
-
200
- <!-- 页面内容 -->
201
- <main class="page-content">
202
- <div class="container">
203
- <!-- 页面标题 + 搜索 -->
204
- <div class="page-header">
205
- <!-- <h1 class="page-title">Skill Base</h1> -->
206
- <div class="search-container">
207
- <div class="search-bar">
208
- <input
209
- type="search"
210
- id="searchInput"
211
- data-i18n-placeholder="index.searchPlaceholder"
212
- placeholder="搜索 Skill..."
213
- autocomplete="off"
214
- >
215
- <span class="search-icon">
216
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
217
- <circle cx="11" cy="11" r="8"/>
218
- <line x1="21" y1="21" x2="16.65" y2="16.65"/>
219
- </svg>
220
- </span>
221
- <button type="button" class="clear-btn" id="clearSearch">
222
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
223
- <line x1="18" y1="6" x2="6" y2="18"/>
224
- <line x1="6" y1="6" x2="18" y2="18"/>
225
- </svg>
226
- </button>
227
- </div>
228
- </div>
229
- </div>
230
-
231
- <!-- Skill 列表 -->
232
- <div id="skill-list" class="skill-grid">
233
- <!-- 由 JS 动态渲染 -->
234
- </div>
235
- </div>
236
- </main>
237
-
238
- <!-- 浮动发布按钮 -->
239
- <a href="/publish.html" class="fab" data-i18n-title="index.fabTitle" title="发布新版本">
240
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
241
- <line x1="12" y1="5" x2="12" y2="19"/>
242
- <line x1="5" y1="12" x2="19" y2="12"/>
243
- </svg>
244
- </a>
245
-
246
- <!-- 引入 JS -->
247
- <script src="/js/i18n.js"></script>
248
- <script src="/js/app.js"></script>
249
- <script src="/js/index.js"></script>
250
- </body>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="icon" type="image/svg+xml" href="./favicon.svg">
6
+ <link rel="alternate icon" sizes="32x32" href="./favicon-32x32.png">
7
+ <link rel="alternate icon" sizes="16x16" href="./favicon-16x16.png">
8
+ <link rel="apple-touch-icon" href="./apple-touch-icon.png">
9
+ <link rel="manifest" href="./site.webmanifest">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
11
+ <title>Skill Base</title>
12
+ <link rel="preconnect" href="https://fonts.googleapis.com">
13
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
14
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
15
+ <script type="module" crossorigin src="./assets/index-DBHCo8Mz.js"></script>
16
+ <link rel="stylesheet" crossorigin href="./assets/index-BgwubB87.css">
17
+ </head>
18
+ <body>
19
+ <div id="app"></div>
20
+ </body>
251
21
  </html>
@@ -0,0 +1 @@
1
+ {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}