@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
@@ -76,12 +76,10 @@
76
76
 
77
77
  <!-- 操作按钮(仅开发环境且非首页显示) -->
78
78
  <template #footer v-if="isDev && !modalIsHomeReadme">
79
- <div :class="$style.actionBar">
79
+ <div class="actionBar">
80
80
  <button
81
- :class="[
82
- $style.saveButton,
83
- { [$style.disabled]: !hasConfigChanges },
84
- ]"
81
+ class="saveButton"
82
+ :class="{ disabled: !hasConfigChanges }"
85
83
  @click="saveNoteConfig"
86
84
  :disabled="!hasConfigChanges || isSaving"
87
85
  type="button"
@@ -91,7 +89,7 @@
91
89
  <button
92
90
  v-if="hasConfigChanges"
93
91
  @click="resetNoteConfig"
94
- :class="$style.resetButton"
92
+ class="resetButton"
95
93
  type="button"
96
94
  >
97
95
  重置
@@ -100,15 +98,15 @@
100
98
 
101
99
  <!-- 保存进度提示 -->
102
100
  <Transition name="toast">
103
- <div v-if="isSaving && savingMessage" :class="$style.loadingToast">
104
- <div :class="$style.loadingSpinner"></div>
101
+ <div v-if="isSaving && savingMessage" class="loadingToast">
102
+ <div class="loadingSpinner"></div>
105
103
  <span>{{ savingMessage }}</span>
106
104
  </div>
107
105
  </Transition>
108
106
 
109
107
  <!-- 保存成功提示 -->
110
108
  <Transition name="toast">
111
- <div v-if="showSuccessToast" :class="$style.toast">✓ 保存成功</div>
109
+ <div v-if="showSuccessToast" class="toast">✓ 保存成功</div>
112
110
  </Transition>
113
111
  </template>
114
112
  </AboutModal>
@@ -618,4 +616,129 @@ watch(
618
616
  }
619
617
  </style>
620
618
 
621
- <style module src="./Layout.module.scss" scoped></style>
619
+ <style scoped lang="scss">
620
+ /* 操作栏样式 */
621
+ .actionBar {
622
+ display: flex;
623
+ gap: 0.75rem;
624
+ justify-content: flex-end;
625
+ width: 100%;
626
+ margin-top: 0.5rem;
627
+ }
628
+
629
+ /* 保存按钮样式 */
630
+ .saveButton {
631
+ padding: 0.625rem 1.5rem;
632
+ background: linear-gradient(135deg, var(--vp-c-brand-1), var(--vp-c-brand-2));
633
+ color: white;
634
+ border: none;
635
+ border-radius: 8px;
636
+ font-size: 0.95rem;
637
+ font-weight: 600;
638
+ cursor: pointer;
639
+ transition: all 0.2s ease;
640
+ box-shadow: 0 2px 8px rgba(var(--vp-c-brand-rgb), 0.3);
641
+
642
+ &:hover:not(:disabled) {
643
+ transform: translateY(-2px);
644
+ box-shadow: 0 4px 12px rgba(var(--vp-c-brand-rgb), 0.4);
645
+ }
646
+
647
+ &:active:not(:disabled) {
648
+ transform: translateY(0);
649
+ }
650
+
651
+ &.disabled,
652
+ &:disabled {
653
+ opacity: 0.4;
654
+ cursor: not-allowed;
655
+ transform: none;
656
+ box-shadow: none;
657
+ }
658
+ }
659
+
660
+ /* 重置按钮样式 */
661
+ .resetButton {
662
+ padding: 0.625rem 1.5rem;
663
+ background: transparent;
664
+ color: var(--vp-c-text-2);
665
+ border: 1px solid var(--vp-c-divider);
666
+ border-radius: 8px;
667
+ font-size: 0.95rem;
668
+ font-weight: 500;
669
+ cursor: pointer;
670
+ transition: all 0.2s ease;
671
+
672
+ &:hover {
673
+ color: var(--vp-c-text-1);
674
+ border-color: var(--vp-c-brand-1);
675
+ background: var(--vp-c-bg-soft);
676
+ }
677
+
678
+ &:active {
679
+ transform: scale(0.98);
680
+ }
681
+ }
682
+
683
+ /* Toast 提示样式 */
684
+ .toast {
685
+ position: fixed;
686
+ bottom: 2rem;
687
+ right: 2rem;
688
+ padding: 0.75rem 1.5rem;
689
+ background: var(--vp-c-brand-1);
690
+ color: white;
691
+ border-radius: 8px;
692
+ font-size: 0.9rem;
693
+ font-weight: 500;
694
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
695
+ z-index: 9999;
696
+ }
697
+
698
+ /* Loading Toast 样式 */
699
+ .loadingToast {
700
+ position: fixed;
701
+ bottom: 2rem;
702
+ right: 2rem;
703
+ padding: 0.75rem 1.5rem;
704
+ background: var(--vp-c-bg-soft);
705
+ color: var(--vp-c-text-1);
706
+ border: 1px solid var(--vp-c-divider);
707
+ border-radius: 8px;
708
+ font-size: 0.9rem;
709
+ font-weight: 500;
710
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
711
+ z-index: 9999;
712
+ display: flex;
713
+ align-items: center;
714
+ gap: 0.75rem;
715
+ }
716
+
717
+ /* Loading 旋转动画 */
718
+ .loadingSpinner {
719
+ width: 16px;
720
+ height: 16px;
721
+ border: 2px solid var(--vp-c-divider);
722
+ border-top-color: var(--vp-c-brand-1);
723
+ border-radius: 50%;
724
+ animation: spin 0.8s linear infinite;
725
+ }
726
+
727
+ @keyframes spin {
728
+ to {
729
+ transform: rotate(360deg);
730
+ }
731
+ }
732
+
733
+ /* Toast 过渡动画 */
734
+ :global(.toast-enter-active),
735
+ :global(.toast-leave-active) {
736
+ transition: all 0.3s ease;
737
+ }
738
+
739
+ :global(.toast-enter-from),
740
+ :global(.toast-leave-to) {
741
+ opacity: 0;
742
+ transform: translateY(20px);
743
+ }
744
+ </style>
@@ -3,14 +3,12 @@
3
3
  type="button"
4
4
  class="tnotes-nav-settings-trigger"
5
5
  title="打开设置"
6
- aria-label="打开设置"
7
6
  @click="open"
8
7
  >
9
8
  <img
10
9
  :src="icon__setting"
11
10
  class="tnotes-nav-settings-icon"
12
11
  alt=""
13
- aria-hidden="true"
14
12
  />
15
13
  </button>
16
14
  </template>
@@ -17,7 +17,6 @@
17
17
  { 'is-active': isCatalogActive },
18
18
  ]"
19
19
  :href="catalogLink"
20
- :aria-current="isCatalogActive ? 'page' : undefined"
21
20
  >
22
21
  目录
23
22
  </a>
@@ -10,26 +10,18 @@
10
10
  <div
11
11
  v-if="!hidden"
12
12
  class="resize-hotspot"
13
- :aria-label="`拖动调整侧边栏宽度,当前 ${width}px`"
14
- role="separator"
15
- aria-orientation="vertical"
16
- :aria-valuemin="minWidth"
17
- :aria-valuemax="maxWidth"
18
- :aria-valuenow="width"
19
13
  @mousedown.prevent="startResize"
20
14
  ></div>
21
15
 
22
- <div v-if="!hidden" class="resize-indicator" aria-hidden="true"></div>
16
+ <div v-if="!hidden" class="resize-indicator"></div>
23
17
 
24
18
  <button
25
19
  class="sidebar-edge-toggle"
26
20
  type="button"
27
- :aria-label="toggleTitle"
28
- :aria-pressed="hidden"
29
21
  @click.stop="toggleSidebar"
30
22
  >
31
23
  <img :src="toggleIcon" alt="" />
32
- <span class="sidebar-edge-tooltip" role="tooltip">
24
+ <span class="sidebar-edge-tooltip">
33
25
  <span>{{ toggleActionText }}</span>
34
26
  <kbd>{{ shortcutText }}</kbd>
35
27
  </span>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <img @click="toggle" :class="$style.contentToggleBtn" :aria-pressed="full" :title="full ? '退出全屏内容区' : '全屏显示内容区'" :src="full ? icon__fullscreen_exit : icon__fullscreen" alt="" />
2
+ <img @click="toggle" class="contentToggleBtn" :title="full ? '退出全屏内容区' : '全屏显示内容区'" :src="full ? icon__fullscreen_exit : icon__fullscreen" alt="" />
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
@@ -32,4 +32,16 @@ function toggle() {
32
32
  }
33
33
  </script>
34
34
 
35
- <style module src="./ToggleFullContent.module.scss"></style>
35
+ <style scoped lang="scss">
36
+ .contentToggleBtn {
37
+ width: 1.5rem;
38
+ height: 1.5rem;
39
+ padding: 3px;
40
+ cursor: pointer;
41
+ transition: all 0.2s;
42
+
43
+ &:hover {
44
+ background: var(--vp-c-bg-alt);
45
+ }
46
+ }
47
+ </style>
@@ -2,8 +2,7 @@
2
2
  <template>
3
3
  <img
4
4
  @click="toggleSidebar"
5
- :class="$style.sidebarToggleBtn"
6
- :aria-pressed="hidden"
5
+ class="sidebarToggleBtn"
7
6
  :title="hidden ? '显示侧边栏' : '隐藏侧边栏'"
8
7
  :src="hidden ? icon__next : icon__prev"
9
8
  alt=""
@@ -23,4 +22,16 @@ onMounted(() => {
23
22
  })
24
23
  </script>
25
24
 
26
- <style module src="./ToggleSidebar.module.scss"></style>
25
+ <style scoped lang="scss">
26
+ .sidebarToggleBtn {
27
+ width: 1.5rem;
28
+ height: 1.5rem;
29
+ padding: 3px;
30
+ cursor: pointer;
31
+ transition: all 0.2s;
32
+
33
+ &:hover {
34
+ background: var(--vp-c-bg-alt);
35
+ }
36
+ }
37
+ </style>
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <ClientOnly>
3
3
  <Teleport to="body">
4
- <div
5
- v-if="visible"
6
- class="tnotes-loading-overlay"
7
- role="alert"
8
- aria-live="polite"
9
- >
4
+ <div v-if="visible" class="tnotes-loading-overlay">
10
5
  <div class="loading-container">
11
6
  <div class="spinner"></div>
12
7
  <h2>{{ message }}</h2>
@@ -178,7 +178,6 @@ function addUpdateButton(toolbar: HTMLElement) {
178
178
  // levelInput.style.background = 'var(--vp-c-bg)'
179
179
  levelInput.style.color = 'var(--vp-c-tip-1)'
180
180
  levelInput.title = '展开层级'
181
- levelInput.setAttribute('aria-label', 'markmap-expand-level')
182
181
 
183
182
  // 保存引用,供外部(props 改变)同步输入值
184
183
  toolbarLevelInput = levelInput
@@ -394,7 +393,7 @@ onBeforeUnmount(() => {
394
393
 
395
394
  <template>
396
395
  <div
397
- :class="$style.markmapContainer"
396
+ class="markmapContainer"
398
397
  ref="containerRef"
399
398
  style="position: relative"
400
399
  >
@@ -402,4 +401,164 @@ onBeforeUnmount(() => {
402
401
  </div>
403
402
  </template>
404
403
 
405
- <style module src="./MarkMap.module.scss"></style>
404
+ <style scoped lang="scss">
405
+ /**
406
+ * MarkMap 组件样式
407
+ * 全局样式(.mm-toolbar, .mm-toolbar-item 等)已移至 global-components.css
408
+ */
409
+
410
+ .markmapContainer {
411
+ border-radius: 8px;
412
+ padding: 1rem;
413
+ overflow: auto;
414
+ position: relative;
415
+ margin: 1.5rem 0;
416
+ transition: all 0.3s ease;
417
+ background-color: #fff;
418
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
419
+
420
+ &:hover {
421
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
422
+ }
423
+
424
+ svg {
425
+ min-width: 100%;
426
+ display: block;
427
+ transition: height 0.3s ease;
428
+
429
+ text:empty {
430
+ animation: pulse 1.5s ease-in-out infinite;
431
+ }
432
+ }
433
+
434
+ /* 鼠标悬停显示 toolbar */
435
+ &:hover :global(.mm-toolbar) {
436
+ opacity: 1;
437
+ pointer-events: auto;
438
+ }
439
+ }
440
+
441
+ /* dark background */
442
+ :global(.markmap-dark) .markmapContainer {
443
+ background-color: #1d1d1d;
444
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
445
+
446
+ &:hover {
447
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
448
+ }
449
+ }
450
+
451
+ /* 按钮组样式 */
452
+ .btnGroup {
453
+ color: var(--vp-c-brand-1);
454
+
455
+ input {
456
+ display: inline-block;
457
+ width: 2rem;
458
+ text-align: center;
459
+ border: 1px solid var(--vp-c-divider);
460
+ border-radius: 4px;
461
+ padding: 2px 4px;
462
+ background: var(--vp-c-bg);
463
+ color: var(--vp-c-text-1);
464
+ transition: all 0.2s ease;
465
+
466
+ &:focus {
467
+ outline: none;
468
+ border-color: var(--vp-c-brand-1);
469
+ box-shadow: 0 0 0 2px rgba(var(--vp-c-brand-1), 0.1);
470
+ }
471
+
472
+ &:hover {
473
+ border-color: var(--vp-c-brand-2);
474
+ }
475
+ }
476
+
477
+ button {
478
+ outline: none;
479
+ border: none;
480
+ cursor: pointer;
481
+ padding: 4px 8px;
482
+ border-radius: 4px;
483
+ background-color: #f0f0f0;
484
+ transition: all 0.2s ease;
485
+ font-weight: 500;
486
+
487
+ &:hover {
488
+ background-color: #e0e0e0;
489
+ transform: translateY(-1px);
490
+ }
491
+
492
+ &:active {
493
+ transform: translateY(0);
494
+ }
495
+ }
496
+ }
497
+
498
+ :global(.markmap-dark) .btnGroup {
499
+ button {
500
+ background-color: #333;
501
+ color: #fff;
502
+
503
+ &:hover {
504
+ background-color: #444;
505
+ }
506
+ }
507
+
508
+ input {
509
+ background-color: #2a2a2a;
510
+ border-color: #444;
511
+ color: #fff;
512
+
513
+ &:focus {
514
+ border-color: var(--vp-c-brand-1);
515
+ }
516
+ }
517
+ }
518
+
519
+ /* 全屏样式 */
520
+ .markmapContainer:fullscreen,
521
+ .markmapContainer:-ms-fullscreen,
522
+ .markmapContainer:-webkit-full-screen {
523
+ width: 100%;
524
+ height: 100%;
525
+ padding: 20px;
526
+ background: white;
527
+ display: flex;
528
+ flex-direction: column;
529
+ justify-content: center;
530
+ box-shadow: none;
531
+ }
532
+
533
+ :global(.markmap-dark) .markmapContainer:fullscreen,
534
+ :global(.markmap-dark) .markmapContainer:-ms-fullscreen,
535
+ :global(.markmap-dark) .markmapContainer:-webkit-full-screen {
536
+ background: #1d1d1d;
537
+ }
538
+
539
+ /* 响应式设计 */
540
+ @media (max-width: 768px) {
541
+ .markmapContainer {
542
+ padding: 0.75rem;
543
+ margin: 1rem 0;
544
+ }
545
+ }
546
+
547
+ @media (max-width: 480px) {
548
+ .markmapContainer {
549
+ padding: 0.5rem;
550
+ margin: 0.75rem 0;
551
+ }
552
+ }
553
+
554
+ /* 加载动画 */
555
+ @keyframes pulse {
556
+ 0%,
557
+ 100% {
558
+ opacity: 1;
559
+ }
560
+ 50% {
561
+ opacity: 0.5;
562
+ }
563
+ }
564
+ </style>