@tnotesjs/core 0.1.20 → 0.1.22

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 (49) hide show
  1. package/dist/{chunk-4MO7F7Q4.js → chunk-BSTQOJVE.js} +1 -1
  2. package/dist/{chunk-SQVHJR2Z.js → chunk-O4DCXHOV.js} +0 -3
  3. package/dist/cli/index.js +2 -2
  4. package/dist/index.js +1 -1
  5. package/dist/vitepress/config/index.js +2 -2
  6. package/package.json +3 -4
  7. package/types/config.ts +0 -1
  8. package/vitepress/components/CodeBlockFullscreen/CodeBlockFullscreen.vue +2 -2
  9. package/vitepress/components/CodeBlockFullscreen/index.ts +1 -5
  10. package/vitepress/components/CodeBlockFullscreen/styles.css +4 -4
  11. package/vitepress/components/Discussions/Discussions.vue +37 -4
  12. package/vitepress/components/EnWordList/EnWordList.vue +135 -15
  13. package/vitepress/components/EnWordList/RightClickMenu.vue +33 -10
  14. package/vitepress/components/Footprints/Footprints.vue +105 -10
  15. package/vitepress/components/Layout/AboutModal.vue +242 -16
  16. package/vitepress/components/Layout/AboutPanel.vue +258 -44
  17. package/vitepress/components/Layout/ContentCollapse.vue +1 -14
  18. package/vitepress/components/Layout/DocBeforeControls.vue +221 -19
  19. package/vitepress/components/Layout/ImagePreview.vue +212 -9
  20. package/vitepress/components/Layout/Layout.vue +133 -10
  21. package/vitepress/components/Layout/NavBarSettingsTrigger.vue +0 -2
  22. package/vitepress/components/Layout/SidebarNavBefore.vue +0 -1
  23. package/vitepress/components/Layout/SidebarResizeHandle.vue +2 -10
  24. package/vitepress/components/Layout/ToggleFullContent.vue +14 -2
  25. package/vitepress/components/Layout/ToggleSidebar.vue +14 -3
  26. package/vitepress/components/LoadingPage/LoadingPage.vue +1 -6
  27. package/vitepress/components/MarkMap/MarkMap.vue +162 -3
  28. package/vitepress/components/Mermaid/Mermaid.vue +300 -22
  29. package/vitepress/components/NotesTable/NotesTable.vue +86 -10
  30. package/vitepress/components/Settings/Settings.vue +434 -57
  31. package/vitepress/components/Settings/SettingsDialog.vue +1 -11
  32. package/vitepress/components/SidebarCard/MindMapView.vue +28 -28
  33. package/vitepress/components/SidebarCard/SidebarCard.vue +3 -4
  34. package/vitepress/components/Tooltip/Tooltip.vue +28 -28
  35. package/vitepress/configs/markdown.config.ts +3 -2
  36. package/vitepress/theme/styles/base.scss +2 -2
  37. package/vitepress/components/Discussions/Discussions.module.scss +0 -32
  38. package/vitepress/components/EnWordList/EnWordList.module.scss +0 -124
  39. package/vitepress/components/EnWordList/RightClickMenu.module.scss +0 -22
  40. package/vitepress/components/Footprints/Footprints.module.scss +0 -93
  41. package/vitepress/components/Layout/AboutModal.module.scss +0 -233
  42. package/vitepress/components/Layout/ImagePreview.module.scss +0 -201
  43. package/vitepress/components/Layout/Layout.module.scss +0 -661
  44. package/vitepress/components/Layout/ToggleFullContent.module.scss +0 -11
  45. package/vitepress/components/Layout/ToggleSidebar.module.scss +0 -11
  46. package/vitepress/components/MarkMap/MarkMap.module.scss +0 -159
  47. package/vitepress/components/Mermaid/Mermaid.module.scss +0 -275
  48. package/vitepress/components/NotesTable/NotesTable.module.scss +0 -77
  49. package/vitepress/components/Settings/Settings.module.scss +0 -375
@@ -1,30 +1,28 @@
1
1
  <template>
2
- <div :class="$style.docBeforeContainer">
3
- <div :class="$style.leftArea">
2
+ <div class="docBeforeContainer">
3
+ <div class="leftArea">
4
4
  <div
5
- :class="[$style.toggleSidebarBox, $style.pcOnly]"
5
+ class="toggleSidebarBox pcOnly"
6
6
  v-show="!isFullContentMode"
7
7
  >
8
8
  <ToggleSidebar />
9
9
  </div>
10
- <div :class="[$style.vscodeBox, $style.pcOnly]" v-show="vscodeNotesDir">
10
+ <div class="vscodeBox pcOnly" v-show="vscodeNotesDir">
11
11
  <a
12
12
  :href="vscodeNotesDir"
13
- aria-label="open in vscode"
14
13
  title="open in vscode"
15
14
  target="_blank"
16
15
  >
17
16
  <img :src="icon__vscode" alt="open in vscode" />
18
17
  </a>
19
18
  </div>
20
- <div :class="[$style.contentToggleBox, $style.pcOnly]">
19
+ <div class="contentToggleBox pcOnly">
21
20
  <ToggleFullContent />
22
21
  </div>
23
22
  <!-- 知识库的 GitHub 链接(仅首页显示,PC 端) -->
24
- <div :class="[$style.githubRepoBox, $style.pcOnly]" v-show="isHomeReadme">
23
+ <div class="githubRepoBox pcOnly" v-show="isHomeReadme">
25
24
  <a
26
25
  :href="`https://github.com/tnotesjs/${vpData.page.value.title.toLowerCase()}/blob/main/README.md`"
27
- :aria-label="`tnotesjs github - ${vpData.page.value.title.toLowerCase()} 笔记仓库链接`"
28
26
  :title="`tnotesjs github - ${vpData.page.value.title.toLowerCase()} 笔记仓库链接`"
29
27
  target="_blank"
30
28
  rel="noopener"
@@ -33,11 +31,11 @@
33
31
  </a>
34
32
  </div>
35
33
  </div>
36
- <div :class="$style.rightArea">
34
+ <div class="rightArea">
37
35
  <!-- 一键复制笔记内容按钮 -->
38
- <div :class="$style.collapseAllBtn" v-show="currentNoteId">
36
+ <div class="collapseAllBtn" v-show="currentNoteId">
39
37
  <button
40
- :class="$style.collapseAllButton"
38
+ class="collapseAllButton"
41
39
  @click="copyNoteContent"
42
40
  title="复制笔记原始内容"
43
41
  type="button"
@@ -46,15 +44,15 @@
46
44
  </button>
47
45
  </div>
48
46
  <Transition name="toast">
49
- <div v-if="showCopyToast" :class="$style.toast">✓ 复制成功</div>
47
+ <div v-if="showCopyToast" class="toast">✓ 复制成功</div>
50
48
  </Transition>
51
49
  <!-- 全局折叠/展开按钮 -->
52
50
  <div
53
- :class="$style.collapseAllBtn"
51
+ class="collapseAllBtn"
54
52
  v-show="currentNoteId || isHomeReadme"
55
53
  >
56
54
  <button
57
- :class="$style.collapseAllButton"
55
+ class="collapseAllButton"
58
56
  @click="toggleAllCollapse"
59
57
  :title="allCollapsed ? '展开所有区域' : '折叠所有区域'"
60
58
  type="button"
@@ -64,17 +62,15 @@
64
62
  </div>
65
63
  <!-- 单个图标,点击打开 modal,只在有笔记数据的页面显示 -->
66
64
  <div
67
- :class="$style.aboutBtn"
65
+ class="aboutBtn"
68
66
  v-show="
69
67
  (currentNoteId && created_at && updated_at) ||
70
68
  (isHomeReadme && homeReadmeCreatedAt && homeReadmeUpdatedAt)
71
69
  "
72
70
  >
73
71
  <button
74
- :class="$style.aboutIconButton"
72
+ class="aboutIconButton"
75
73
  @click="$emit('open-time-modal')"
76
- aria-haspopup="dialog"
77
- :aria-expanded="timeModalOpen"
78
74
  :title="isHomeReadme ? '关于这个知识库' : '关于这篇笔记'"
79
75
  type="button"
80
76
  >
@@ -146,4 +142,210 @@ function toggleAllCollapse() {
146
142
  }
147
143
  </script>
148
144
 
149
- <style module src="./Layout.module.scss"></style>
145
+ <style scoped lang="scss">
146
+ /* doc-before-container 主容器 */
147
+ .docBeforeContainer {
148
+ display: flex;
149
+ margin-bottom: 1rem;
150
+ align-items: center;
151
+ justify-content: space-between;
152
+ animation: slideDown 0.3s ease-out;
153
+
154
+ .leftArea {
155
+ display: flex;
156
+ align-items: center;
157
+ gap: 1rem;
158
+ }
159
+
160
+ .rightArea {
161
+ display: flex;
162
+ align-items: center;
163
+ gap: 0.75rem;
164
+ font-style: italic;
165
+ font-size: 0.7rem;
166
+ position: relative;
167
+ }
168
+
169
+ /* 默认隐藏,当屏幕宽度 >= 960px 时显示,因为当宽度小于 960px 时,侧边栏会自动隐藏 */
170
+ .toggleSidebarBox,
171
+ .contentToggleBox {
172
+ display: none;
173
+ }
174
+
175
+ .vscodeBox,
176
+ .githubRepoBox {
177
+ width: 1.5rem;
178
+ height: 1.5rem;
179
+ padding: 3px;
180
+ transition: all 0.2s ease;
181
+ border-radius: 4px;
182
+
183
+ &:hover {
184
+ background: var(--vp-c-bg-alt);
185
+ transform: scale(1.05);
186
+ }
187
+
188
+ a {
189
+ display: block;
190
+ width: 100%;
191
+ height: 100%;
192
+ }
193
+
194
+ img {
195
+ width: 100%;
196
+ height: 100%;
197
+ display: block;
198
+ }
199
+ }
200
+
201
+ /* collapse all button */
202
+ .collapseAllBtn {
203
+ display: inline-block;
204
+ margin-right: 8px;
205
+ }
206
+
207
+ .collapseAllButton {
208
+ background: none;
209
+ border: none;
210
+ cursor: pointer;
211
+ padding: 4px;
212
+ display: inline-flex;
213
+ align-items: center;
214
+ justify-content: center;
215
+ border-radius: 4px;
216
+ transition: all 0.2s ease;
217
+
218
+ &:hover {
219
+ background: var(--vp-c-bg-soft);
220
+ }
221
+
222
+ img {
223
+ width: 16px;
224
+ height: 16px;
225
+ opacity: 0.6;
226
+ transition: opacity 0.2s ease;
227
+ }
228
+
229
+ &:hover img {
230
+ opacity: 1;
231
+ }
232
+ }
233
+
234
+ /* about icon button */
235
+ .aboutBtn {
236
+ display: inline-block;
237
+ }
238
+
239
+ .aboutIconButton {
240
+ background: transparent;
241
+ border: none;
242
+ cursor: pointer;
243
+ padding: 0.15rem;
244
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
245
+ color: var(--vp-c-brand-1);
246
+ font-weight: 700;
247
+ font-size: 1rem;
248
+ border-radius: 50%;
249
+ width: 1.5rem;
250
+ height: 1.5rem;
251
+ display: flex;
252
+ align-items: center;
253
+ justify-content: center;
254
+ position: relative;
255
+
256
+ &::before {
257
+ content: '';
258
+ position: absolute;
259
+ inset: -2px;
260
+ border-radius: 50%;
261
+ border: 2px solid var(--vp-c-brand-1);
262
+ opacity: 0;
263
+ transition: opacity 0.3s ease;
264
+ }
265
+
266
+ &:hover {
267
+ font-size: 1.3rem;
268
+ background: var(--vp-c-brand-soft);
269
+ transform: rotate(180deg);
270
+
271
+ &::before {
272
+ opacity: 0.3;
273
+ animation: pulse 1s ease-in-out infinite;
274
+ }
275
+ }
276
+
277
+ &:active {
278
+ transform: rotate(180deg) scale(0.95);
279
+ }
280
+ }
281
+
282
+ .toast {
283
+ position: fixed;
284
+ bottom: 2rem;
285
+ right: 2rem;
286
+ padding: 0.75rem 1.5rem;
287
+ background: var(--vp-c-brand-1);
288
+ color: white;
289
+ border-radius: 8px;
290
+ font-size: 0.9rem;
291
+ font-weight: 500;
292
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
293
+ z-index: 9999;
294
+ }
295
+ }
296
+
297
+ /* PC 端专用按钮(移动端隐藏) */
298
+ .pcOnly {
299
+ display: block;
300
+ }
301
+
302
+ @media (max-width: 768px) {
303
+ .pcOnly {
304
+ display: none !important;
305
+ }
306
+ }
307
+
308
+ @media (min-width: 960px) {
309
+ .docBeforeContainer {
310
+ .toggleSidebarBox,
311
+ .contentToggleBox {
312
+ display: block;
313
+ }
314
+ }
315
+ }
316
+
317
+ @keyframes slideDown {
318
+ from {
319
+ opacity: 0;
320
+ transform: translateY(-10px);
321
+ }
322
+ to {
323
+ opacity: 1;
324
+ transform: translateY(0);
325
+ }
326
+ }
327
+
328
+ @keyframes pulse {
329
+ 0%,
330
+ 100% {
331
+ transform: scale(1);
332
+ opacity: 0.3;
333
+ }
334
+ 50% {
335
+ transform: scale(1.1);
336
+ opacity: 0.5;
337
+ }
338
+ }
339
+
340
+ /* Toast 过渡动画 */
341
+ :global(.toast-enter-active),
342
+ :global(.toast-leave-active) {
343
+ transition: all 0.3s ease;
344
+ }
345
+
346
+ :global(.toast-enter-from),
347
+ :global(.toast-leave-to) {
348
+ opacity: 0;
349
+ transform: translateY(20px);
350
+ }
351
+ </style>
@@ -2,14 +2,14 @@
2
2
  <!-- #region img preview -->
3
3
  <div
4
4
  v-show="preview.visible"
5
- :class="$style.tnPreview"
5
+ class="tnPreview"
6
6
  @click.self="closePreview"
7
7
  @wheel.prevent="onWheel"
8
8
  >
9
9
  <!-- 左侧切换按钮 -->
10
10
  <button
11
11
  v-if="preview.images.length > 1"
12
- :class="[$style.nav, $style.navLeft]"
12
+ class="nav navLeft"
13
13
  @click.stop="prevImage"
14
14
  >
15
15
  <img :src="icon__prev" alt="prev" />
@@ -17,13 +17,13 @@
17
17
  <!-- 右侧切换按钮 -->
18
18
  <button
19
19
  v-if="preview.images.length > 1"
20
- :class="[$style.nav, $style.navRight]"
20
+ class="nav navRight"
21
21
  @click.stop="nextImage"
22
22
  >
23
23
  <img :src="icon__next" alt="next" />
24
24
  </button>
25
25
 
26
- <div :class="$style.toolbar">
26
+ <div class="toolbar">
27
27
  <button @click.stop="zoomOut" title="缩小">
28
28
  <img :src="icon__zoom_out" alt="zoom out" />
29
29
  </button>
@@ -33,14 +33,15 @@
33
33
  <button @click.stop="zoomIn" title="放大">
34
34
  <img :src="icon__zoom_in" alt="zoom in" />
35
35
  </button>
36
- <button :class="$style.close" @click.stop="closePreview" title="关闭">
36
+ <button class="close" @click.stop="closePreview" title="关闭">
37
37
  <img :src="icon__close" alt="close" />
38
38
  </button>
39
39
  </div>
40
40
 
41
41
  <img
42
42
  ref="previewImg"
43
- :class="[$style.img, { [$style.dragging]: isDragging }]"
43
+ class="img"
44
+ :class="{ dragging: isDragging }"
44
45
  :src="preview.src"
45
46
  :style="previewStyle"
46
47
  @pointerdown="onPointerDown"
@@ -48,7 +49,7 @@
48
49
  />
49
50
 
50
51
  <!-- 底部页码指示器 -->
51
- <div v-if="preview.images.length > 1" :class="$style.counter">
52
+ <div v-if="preview.images.length > 1" class="counter">
52
53
  {{ preview.index + 1 }} / {{ preview.images.length }}
53
54
  </div>
54
55
  </div>
@@ -56,7 +57,7 @@
56
57
  </template>
57
58
 
58
59
  <script setup>
59
- import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
60
+ import { ref, computed, onMounted, onBeforeUnmount } from 'vue'
60
61
 
61
62
  import {
62
63
  icon__close,
@@ -279,4 +280,206 @@ onBeforeUnmount(() => {
279
280
  })
280
281
  </script>
281
282
 
282
- <style module src="./ImagePreview.module.scss"></style>
283
+ <style scoped lang="scss">
284
+ /* 预览遮罩层 */
285
+ .tnPreview {
286
+ position: fixed;
287
+ inset: 0;
288
+ z-index: 3000;
289
+ background: rgba(0, 0, 0, 0.85);
290
+ display: flex;
291
+ align-items: center;
292
+ justify-content: center;
293
+ backdrop-filter: blur(4px);
294
+ animation: fadeIn 0.2s ease-out;
295
+ }
296
+
297
+ @keyframes fadeIn {
298
+ from {
299
+ opacity: 0;
300
+ }
301
+ to {
302
+ opacity: 1;
303
+ }
304
+ }
305
+
306
+ /* 工具栏 */
307
+ .toolbar {
308
+ position: absolute;
309
+ top: 16px;
310
+ right: 16px;
311
+ display: flex;
312
+ gap: 10px;
313
+ z-index: 2;
314
+
315
+ button {
316
+ width: 36px;
317
+ height: 36px;
318
+ display: flex;
319
+ align-items: center;
320
+ justify-content: center;
321
+ background: rgba(42, 42, 42, 0.85);
322
+ border: 1px solid rgba(255, 255, 255, 0.15);
323
+ border-radius: 8px;
324
+ cursor: pointer;
325
+ transition: all 0.2s ease;
326
+
327
+ img {
328
+ width: 18px;
329
+ height: 18px;
330
+ transition: transform 0.2s ease;
331
+ }
332
+
333
+ &:hover {
334
+ background: rgba(255, 255, 255, 0.15);
335
+ transform: translateY(-2px);
336
+
337
+ img {
338
+ transform: scale(1.1);
339
+ }
340
+ }
341
+
342
+ &:active {
343
+ transform: translateY(0);
344
+ }
345
+ }
346
+ }
347
+
348
+ .close {
349
+ &:hover img {
350
+ transform: rotate(90deg) scale(1.1) !important;
351
+ }
352
+ }
353
+
354
+ /* 左右切换按钮 */
355
+ .nav {
356
+ position: absolute;
357
+ top: 50%;
358
+ transform: translateY(-50%);
359
+ width: 56px;
360
+ height: 56px;
361
+ display: flex;
362
+ align-items: center;
363
+ justify-content: center;
364
+ background: rgba(0, 0, 0, 0.3);
365
+ border: none;
366
+ border-radius: 50%;
367
+ cursor: pointer;
368
+ z-index: 2;
369
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
370
+
371
+ img {
372
+ width: 2rem;
373
+ height: 2rem;
374
+ transition: transform 0.3s ease;
375
+ }
376
+
377
+ &:hover {
378
+ background: rgba(0, 0, 0, 0.7);
379
+ transform: translateY(-50%) scale(1.15);
380
+
381
+ img {
382
+ filter: brightness(1.2);
383
+ }
384
+ }
385
+
386
+ &:active {
387
+ transform: translateY(-50%) scale(1.05);
388
+ }
389
+ }
390
+
391
+ .navLeft {
392
+ left: 24px;
393
+
394
+ &:hover img {
395
+ transform: translateX(-2px);
396
+ }
397
+ }
398
+
399
+ .navRight {
400
+ right: 24px;
401
+
402
+ &:hover img {
403
+ transform: translateX(2px);
404
+ }
405
+ }
406
+
407
+ /* 预览图片 */
408
+ .img {
409
+ max-width: 90vw;
410
+ max-height: 90vh;
411
+ user-select: none;
412
+ transition: transform 0.1s ease-out;
413
+
414
+ &.dragging {
415
+ cursor: grabbing !important;
416
+ }
417
+ }
418
+
419
+ /* 底部页码指示器 */
420
+ .counter {
421
+ position: absolute;
422
+ bottom: 20px;
423
+ left: 50%;
424
+ transform: translateX(-50%);
425
+ background: rgba(0, 0, 0, 0.65);
426
+ color: #fff;
427
+ padding: 8px 16px;
428
+ border-radius: 16px;
429
+ font-size: 0.9rem;
430
+ font-weight: 500;
431
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
432
+ z-index: 2;
433
+ user-select: none;
434
+ backdrop-filter: blur(8px);
435
+ border: 1px solid rgba(255, 255, 255, 0.1);
436
+ }
437
+
438
+ /* 响应式设计 */
439
+ @media (max-width: 768px) {
440
+ .nav {
441
+ width: 48px;
442
+ height: 48px;
443
+
444
+ img {
445
+ width: 1.5rem;
446
+ height: 1.5rem;
447
+ }
448
+ }
449
+
450
+ .navLeft {
451
+ left: 12px;
452
+ }
453
+
454
+ .navRight {
455
+ right: 12px;
456
+ }
457
+
458
+ .toolbar {
459
+ top: 12px;
460
+ right: 12px;
461
+ gap: 8px;
462
+
463
+ button {
464
+ width: 32px;
465
+ height: 32px;
466
+
467
+ img {
468
+ width: 16px;
469
+ height: 16px;
470
+ }
471
+ }
472
+ }
473
+
474
+ .counter {
475
+ bottom: 16px;
476
+ font-size: 0.85rem;
477
+ padding: 6px 14px;
478
+ }
479
+
480
+ .img {
481
+ max-width: 95vw;
482
+ max-height: 85vh;
483
+ }
484
+ }
485
+ </style>