@tnotesjs/core 0.1.21 → 0.1.23

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 (122) hide show
  1. package/README.md +87 -87
  2. package/dist/{chunk-4MO7F7Q4.js → chunk-BSTQOJVE.js} +1 -1
  3. package/dist/{chunk-SQVHJR2Z.js → chunk-O4DCXHOV.js} +0 -3
  4. package/dist/cli/index.js +2 -2
  5. package/dist/index.js +1 -1
  6. package/dist/vitepress/config/index.js +2 -2
  7. package/package.json +3 -4
  8. package/types/config.ts +60 -61
  9. package/types/index.ts +11 -11
  10. package/types/note.ts +33 -33
  11. package/vitepress/assets/icons/icon__check.svg +3 -3
  12. package/vitepress/assets/icons/icon__clipboard.svg +7 -7
  13. package/vitepress/assets/icons/icon__close.svg +1 -1
  14. package/vitepress/assets/icons/icon__collapse.svg +1 -1
  15. package/vitepress/assets/icons/icon__confirm.svg +1 -1
  16. package/vitepress/assets/icons/icon__copy.svg +4 -4
  17. package/vitepress/assets/icons/icon__focus.svg +1 -1
  18. package/vitepress/assets/icons/icon__fold.svg +3 -3
  19. package/vitepress/assets/icons/icon__folder.svg +1 -1
  20. package/vitepress/assets/icons/icon__fullscreen.svg +1 -1
  21. package/vitepress/assets/icons/icon__fullscreen_exit.svg +1 -1
  22. package/vitepress/assets/icons/icon__github.svg +3 -3
  23. package/vitepress/assets/icons/icon__mindmap.svg +1 -1
  24. package/vitepress/assets/icons/icon__next.svg +1 -1
  25. package/vitepress/assets/icons/icon__number_gray.svg +1 -1
  26. package/vitepress/assets/icons/icon__number_purple.svg +1 -1
  27. package/vitepress/assets/icons/icon__prev.svg +1 -1
  28. package/vitepress/assets/icons/icon__restore.svg +1 -1
  29. package/vitepress/assets/icons/icon__rotate.svg +4 -4
  30. package/vitepress/assets/icons/icon__search.svg +1 -1
  31. package/vitepress/assets/icons/icon__sidebar_collapsed.svg +1 -1
  32. package/vitepress/assets/icons/icon__sidebar_opened.svg +1 -1
  33. package/vitepress/assets/icons/icon__totop.svg +5 -5
  34. package/vitepress/assets/icons/icon__vscode.svg +5 -5
  35. package/vitepress/assets/icons/icon__zoom_fit.svg +1 -1
  36. package/vitepress/assets/icons/icon__zoom_in.svg +1 -1
  37. package/vitepress/assets/icons/icon__zoom_out.svg +1 -1
  38. package/vitepress/assets/icons/icon__zoom_reset.svg +1 -1
  39. package/vitepress/assets/icons/index.ts +39 -39
  40. package/vitepress/components/BilibiliOutsidePlayer/BilibiliOutsidePlayer.vue +20 -20
  41. package/vitepress/components/CodeBlockFullscreen/CodeBlockFullscreen.vue +369 -369
  42. package/vitepress/components/CodeBlockFullscreen/index.ts +209 -213
  43. package/vitepress/components/CodeBlockFullscreen/styles.css +126 -126
  44. package/vitepress/components/Discussions/Discussions.vue +244 -211
  45. package/vitepress/components/EnWordList/EnWordList.vue +663 -543
  46. package/vitepress/components/EnWordList/RightClickMenu.vue +89 -66
  47. package/vitepress/components/Footprints/Footprints.vue +472 -377
  48. package/vitepress/components/Layout/AboutModal.vue +331 -105
  49. package/vitepress/components/Layout/AboutPanel.vue +484 -270
  50. package/vitepress/components/Layout/ContentCollapse.vue +590 -603
  51. package/vitepress/components/Layout/CustomSidebar.vue +817 -817
  52. package/vitepress/components/Layout/DocBeforeControls.vue +351 -149
  53. package/vitepress/components/Layout/DocFooter.vue +233 -233
  54. package/vitepress/components/Layout/ImagePreview.vue +484 -281
  55. package/vitepress/components/Layout/Layout.vue +744 -621
  56. package/vitepress/components/Layout/NavBarSettingsTrigger.vue +0 -2
  57. package/vitepress/components/Layout/NoteStatus.vue +140 -140
  58. package/vitepress/components/Layout/SidebarItems.vue +1083 -1083
  59. package/vitepress/components/Layout/SidebarNavBefore.vue +170 -171
  60. package/vitepress/components/Layout/SidebarResizeHandle.vue +311 -319
  61. package/vitepress/components/Layout/Swiper.vue +167 -167
  62. package/vitepress/components/Layout/ToggleFullContent.vue +47 -35
  63. package/vitepress/components/Layout/ToggleSidebar.vue +37 -26
  64. package/vitepress/components/Layout/composables/useCollapseControl.ts +88 -88
  65. package/vitepress/components/Layout/composables/useNoteConfig.ts +119 -119
  66. package/vitepress/components/Layout/composables/useNoteSave.ts +178 -178
  67. package/vitepress/components/Layout/composables/useNoteValidation.ts +85 -85
  68. package/vitepress/components/Layout/composables/useRedirect.ts +113 -113
  69. package/vitepress/components/Layout/composables/useSidebarLayout.ts +122 -122
  70. package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +85 -85
  71. package/vitepress/components/Layout/homeReadme.data.ts +124 -124
  72. package/vitepress/components/LoadingPage/LoadingPage.vue +1 -6
  73. package/vitepress/components/MarkMap/MarkMap.vue +564 -405
  74. package/vitepress/components/Mermaid/Mermaid.vue +643 -365
  75. package/vitepress/components/NotesTable/NotesTable.vue +174 -98
  76. package/vitepress/components/NotesTable/README.md +67 -67
  77. package/vitepress/components/Settings/Settings.vue +711 -334
  78. package/vitepress/components/Settings/SettingsDialog.vue +1 -11
  79. package/vitepress/components/SidebarCard/MindMapView.vue +484 -484
  80. package/vitepress/components/SidebarCard/NotesTrendChart.vue +108 -108
  81. package/vitepress/components/SidebarCard/SidebarCard.vue +945 -946
  82. package/vitepress/components/Tooltip/Tooltip.vue +70 -70
  83. package/vitepress/components/constants.ts +109 -109
  84. package/vitepress/components/notesConfig.data.ts +73 -73
  85. package/vitepress/components/sidebar.data.ts +59 -59
  86. package/vitepress/components/tnotes-config.data.ts +21 -21
  87. package/vitepress/components/utils.ts +26 -26
  88. package/vitepress/config/index.ts +169 -169
  89. package/vitepress/configs/constants.ts +26 -26
  90. package/vitepress/configs/head.config.ts +25 -25
  91. package/vitepress/configs/index.ts +9 -9
  92. package/vitepress/configs/markdown-it.d.ts +23 -23
  93. package/vitepress/configs/markdown.config.ts +368 -367
  94. package/vitepress/configs/theme.config.ts +108 -108
  95. package/vitepress/plugins/buildProgressPlugin.ts +434 -434
  96. package/vitepress/plugins/getNoteByConfigIdPlugin.ts +107 -107
  97. package/vitepress/plugins/renameNotePlugin.ts +68 -68
  98. package/vitepress/plugins/sidebarStructurePlugin.ts +260 -260
  99. package/vitepress/plugins/updateConfigPlugin.ts +63 -63
  100. package/vitepress/theme/index.ts +137 -137
  101. package/vitepress/theme/styles/base.scss +66 -64
  102. package/vitepress/theme/styles/components/404.scss +31 -31
  103. package/vitepress/theme/styles/components/collapse.scss +172 -172
  104. package/vitepress/theme/styles/components/markmap.scss +101 -101
  105. package/vitepress/theme/styles/components/swiper.scss +255 -255
  106. package/vitepress/theme/styles/index.scss +25 -25
  107. package/vitepress/theme/styles/layout.scss +78 -78
  108. package/vitepress/theme/styles/utilities.scss +39 -39
  109. package/vitepress/theme/styles/vitepress-override.scss +25 -25
  110. package/vitepress/components/Discussions/Discussions.module.scss +0 -32
  111. package/vitepress/components/EnWordList/EnWordList.module.scss +0 -124
  112. package/vitepress/components/EnWordList/RightClickMenu.module.scss +0 -22
  113. package/vitepress/components/Footprints/Footprints.module.scss +0 -93
  114. package/vitepress/components/Layout/AboutModal.module.scss +0 -233
  115. package/vitepress/components/Layout/ImagePreview.module.scss +0 -201
  116. package/vitepress/components/Layout/Layout.module.scss +0 -661
  117. package/vitepress/components/Layout/ToggleFullContent.module.scss +0 -11
  118. package/vitepress/components/Layout/ToggleSidebar.module.scss +0 -11
  119. package/vitepress/components/MarkMap/MarkMap.module.scss +0 -159
  120. package/vitepress/components/Mermaid/Mermaid.module.scss +0 -275
  121. package/vitepress/components/NotesTable/NotesTable.module.scss +0 -77
  122. package/vitepress/components/Settings/Settings.module.scss +0 -375
@@ -1,78 +1,78 @@
1
- /**
2
- * 布局层样式
3
- * - 全局布局控制
4
- * - 响应式布局
5
- * - 特殊布局模式(侧边栏隐藏、全屏等)
6
- */
7
-
8
- :root {
9
- --tn-sidebar-width: 260px;
10
- --tn-sidebar-layout-width: var(--tn-sidebar-width);
11
- --vp-sidebar-width: var(--tn-sidebar-width);
12
- }
13
-
14
- // 侧边栏样式重写
15
- .VPSidebar {
16
- width: var(--tn-sidebar-layout-width, var(--tn-sidebar-width)) !important;
17
- padding-top: var(--vp-nav-height) !important;
18
- padding-left: 1rem !important;
19
- padding-right: 1rem !important;
20
- padding-bottom: 1rem !important;
21
- }
22
-
23
- /* ===================================== */
24
- /* #region 侧边栏隐藏模式 */
25
- /* ===================================== */
26
-
27
- .hide-sidebar .VPSidebar {
28
- padding-left: 0 !important;
29
- padding-right: 0 !important;
30
- overflow: hidden;
31
- transform: translateX(-100%);
32
- pointer-events: none;
33
- transition: transform 0.25s ease, opacity 0.25s ease;
34
- }
35
-
36
- .hide-sidebar .VPNavBarTitle {
37
- display: none !important;
38
- }
39
-
40
- .hide-sidebar .VPNavBar {
41
- background-color: var(--vp-nav-bg-color) !important;
42
- }
43
-
44
- /* 主体内容往左补齐,与导航栏标题左对齐 */
45
- .hide-sidebar .VPContent {
46
- margin-left: 0 !important;
47
- padding-left: calc((100vw - var(--vp-layout-max-width)) / 2) !important;
48
- }
49
-
50
- /* #endregion */
51
-
52
- /* ===================================== */
53
- /* #region 全屏内容模式 */
54
- /* ===================================== */
55
-
56
- .content-fullscreen .VPSidebar,
57
- .content-fullscreen .VPNav,
58
- .content-fullscreen .VPLocalNav,
59
- .content-fullscreen .VPDocFooter,
60
- .content-fullscreen .VPNavBar {
61
- display: none !important;
62
- }
63
-
64
- .content-fullscreen .VPContent {
65
- margin: 0 !important;
66
- padding: 0 2rem !important;
67
- max-width: 100% !important;
68
- }
69
-
70
- .content-fullscreen body {
71
- overflow: auto;
72
- }
73
-
74
- .content-fullscreen .VPDoc .content-container {
75
- max-width: none !important;
76
- }
77
-
78
- /* #endregion */
1
+ /**
2
+ * 布局层样式
3
+ * - 全局布局控制
4
+ * - 响应式布局
5
+ * - 特殊布局模式(侧边栏隐藏、全屏等)
6
+ */
7
+
8
+ :root {
9
+ --tn-sidebar-width: 260px;
10
+ --tn-sidebar-layout-width: var(--tn-sidebar-width);
11
+ --vp-sidebar-width: var(--tn-sidebar-width);
12
+ }
13
+
14
+ // 侧边栏样式重写
15
+ .VPSidebar {
16
+ width: var(--tn-sidebar-layout-width, var(--tn-sidebar-width)) !important;
17
+ padding-top: var(--vp-nav-height) !important;
18
+ padding-left: 1rem !important;
19
+ padding-right: 1rem !important;
20
+ padding-bottom: 1rem !important;
21
+ }
22
+
23
+ /* ===================================== */
24
+ /* #region 侧边栏隐藏模式 */
25
+ /* ===================================== */
26
+
27
+ .hide-sidebar .VPSidebar {
28
+ padding-left: 0 !important;
29
+ padding-right: 0 !important;
30
+ overflow: hidden;
31
+ transform: translateX(-100%);
32
+ pointer-events: none;
33
+ transition: transform 0.25s ease, opacity 0.25s ease;
34
+ }
35
+
36
+ .hide-sidebar .VPNavBarTitle {
37
+ display: none !important;
38
+ }
39
+
40
+ .hide-sidebar .VPNavBar {
41
+ background-color: var(--vp-nav-bg-color) !important;
42
+ }
43
+
44
+ /* 主体内容往左补齐,与导航栏标题左对齐 */
45
+ .hide-sidebar .VPContent {
46
+ margin-left: 0 !important;
47
+ padding-left: calc((100vw - var(--vp-layout-max-width)) / 2) !important;
48
+ }
49
+
50
+ /* #endregion */
51
+
52
+ /* ===================================== */
53
+ /* #region 全屏内容模式 */
54
+ /* ===================================== */
55
+
56
+ .content-fullscreen .VPSidebar,
57
+ .content-fullscreen .VPNav,
58
+ .content-fullscreen .VPLocalNav,
59
+ .content-fullscreen .VPDocFooter,
60
+ .content-fullscreen .VPNavBar {
61
+ display: none !important;
62
+ }
63
+
64
+ .content-fullscreen .VPContent {
65
+ margin: 0 !important;
66
+ padding: 0 2rem !important;
67
+ max-width: 100% !important;
68
+ }
69
+
70
+ .content-fullscreen body {
71
+ overflow: auto;
72
+ }
73
+
74
+ .content-fullscreen .VPDoc .content-container {
75
+ max-width: none !important;
76
+ }
77
+
78
+ /* #endregion */
@@ -1,39 +1,39 @@
1
- /**
2
- * 工具类和通用动画
3
- */
4
-
5
- /* ===================================== */
6
- /* #region 通用动画 */
7
- /* ===================================== */
8
-
9
- @keyframes fadeIn {
10
- from {
11
- opacity: 0;
12
- }
13
- to {
14
- opacity: 1;
15
- }
16
- }
17
-
18
- @keyframes slideDown {
19
- from {
20
- opacity: 0;
21
- transform: translateY(-10px);
22
- }
23
- to {
24
- opacity: 1;
25
- transform: translateY(0);
26
- }
27
- }
28
-
29
- @keyframes pulse {
30
- 0%,
31
- 100% {
32
- opacity: 1;
33
- }
34
- 50% {
35
- opacity: 0.5;
36
- }
37
- }
38
-
39
- /* #endregion */
1
+ /**
2
+ * 工具类和通用动画
3
+ */
4
+
5
+ /* ===================================== */
6
+ /* #region 通用动画 */
7
+ /* ===================================== */
8
+
9
+ @keyframes fadeIn {
10
+ from {
11
+ opacity: 0;
12
+ }
13
+ to {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
18
+ @keyframes slideDown {
19
+ from {
20
+ opacity: 0;
21
+ transform: translateY(-10px);
22
+ }
23
+ to {
24
+ opacity: 1;
25
+ transform: translateY(0);
26
+ }
27
+ }
28
+
29
+ @keyframes pulse {
30
+ 0%,
31
+ 100% {
32
+ opacity: 1;
33
+ }
34
+ 50% {
35
+ opacity: 0.5;
36
+ }
37
+ }
38
+
39
+ /* #endregion */
@@ -1,25 +1,25 @@
1
- /**
2
- * VitePress 默认主题覆盖
3
- * 用于修改 VitePress 内置组件的样式
4
- */
5
-
6
- /* ===================================== */
7
- /* #region 隐藏默认的 last updated */
8
- /* ===================================== */
9
-
10
- .last-updated {
11
- display: none;
12
- }
13
-
14
- /* #endregion */
15
-
16
- /* ===================================== */
17
- /* #region 修复 Discussions 边框问题 */
18
- /* ===================================== */
19
-
20
- .VPDoc.has-aside .content-container {
21
- padding: 0 2px !important;
22
- max-width: none !important;
23
- }
24
-
25
- /* #endregion */
1
+ /**
2
+ * VitePress 默认主题覆盖
3
+ * 用于修改 VitePress 内置组件的样式
4
+ */
5
+
6
+ /* ===================================== */
7
+ /* #region 隐藏默认的 last updated */
8
+ /* ===================================== */
9
+
10
+ .last-updated {
11
+ display: none;
12
+ }
13
+
14
+ /* #endregion */
15
+
16
+ /* ===================================== */
17
+ /* #region 修复 Discussions 边框问题 */
18
+ /* ===================================== */
19
+
20
+ .VPDoc.has-aside .content-container {
21
+ padding: 0 2px !important;
22
+ max-width: none !important;
23
+ }
24
+
25
+ /* #endregion */
@@ -1,32 +0,0 @@
1
- /* #region:same as vitepress theme */
2
- .h2 {
3
- margin: 48px 0 16px;
4
- border-top: 1px solid var(--vp-c-divider);
5
- padding-top: 24px;
6
- letter-spacing: -0.02em;
7
- line-height: 32px;
8
- font-size: 1.2rem;
9
- text-align: center;
10
- }
11
-
12
- /* #endregion:same as vitepress theme */
13
-
14
- .discussionsLink {
15
- display: inline-flex;
16
- align-items: center;
17
- gap: 0.5em;
18
- color: var(--vp-c-brand-1);
19
- text-decoration: none;
20
- opacity: 0.9;
21
- transition: opacity 0.25s;
22
-
23
- &:hover {
24
- opacity: 0.5;
25
- }
26
- }
27
-
28
- .githubIcon {
29
- width: 1em;
30
- height: 1em;
31
- flex-shrink: 0;
32
- }
@@ -1,124 +0,0 @@
1
- /**
2
- * .vitepress/components/EnWordList/EnWordList.module.scss
3
- *
4
- * EnWordList 组件样式
5
- */
6
-
7
- .enWordList {
8
- // Checkbox 样式
9
- input[type='checkbox'] {
10
- margin: 8px;
11
- transform: scale(1.3);
12
- cursor: pointer;
13
- }
14
-
15
- // 链接样式
16
- a {
17
- text-decoration: none;
18
- color: #4fc3f7;
19
-
20
- &:hover {
21
- text-decoration: underline !important;
22
- }
23
-
24
- &.lineThrough {
25
- color: #999;
26
- text-decoration: line-through;
27
- }
28
-
29
- &.textRed {
30
- color: #f40 !important;
31
- }
32
- }
33
-
34
- // 单词列表样式
35
- ol {
36
- list-style-type: decimal;
37
- padding-left: 20px;
38
-
39
- li {
40
- display: flex;
41
- align-items: center;
42
- margin-bottom: 8px;
43
- transition: all 0.3s ease;
44
-
45
- &.pronounced {
46
- background-color: rgba(255, 255, 0, 0.1);
47
- }
48
- }
49
- }
50
-
51
- // 序号样式
52
- .index {
53
- margin-right: 10px;
54
- color: #aaa;
55
- }
56
- }
57
-
58
- // 单词卡片样式(🌑 暗色悬浮卡片)
59
- .wordCard {
60
- position: fixed;
61
- z-index: 9999;
62
- background: #1e1e1e;
63
- border: 1px solid #333;
64
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
65
- padding: 12px 16px;
66
- max-width: 600px;
67
- min-width: 200px;
68
- min-height: 100px;
69
- font-size: 14px;
70
- line-height: 1.4;
71
- border-radius: 8px;
72
- color: #eee;
73
- pointer-events: auto;
74
- font-family: sans-serif;
75
- cursor: move;
76
-
77
- // 关闭按钮
78
- .closeBtn {
79
- position: absolute;
80
- right: 5px;
81
- top: 5px;
82
- background: none;
83
- border: none;
84
- font-size: 16px;
85
- cursor: pointer;
86
- color: #ccc;
87
-
88
- &:hover {
89
- color: white;
90
- }
91
- }
92
- }
93
-
94
- // 卡片内容包裹器
95
- .wordCardContentWrapper {
96
- width: 100%;
97
- height: 100%;
98
- overflow: auto;
99
- }
100
-
101
- // 卡片内容样式
102
- .wordCardContent {
103
- :deep(ul) {
104
- margin: 0.5rem 0;
105
- padding-left: 1rem;
106
- }
107
- }
108
-
109
- // 调整大小手柄
110
- .resizeHandle {
111
- position: absolute;
112
- right: 0;
113
- bottom: 0;
114
- width: 12px;
115
- height: 12px;
116
- background-color: #666;
117
- cursor: nwse-resize;
118
- z-index: 2;
119
- border-radius: 50%;
120
-
121
- &:hover {
122
- background-color: #aaa;
123
- }
124
- }
@@ -1,22 +0,0 @@
1
- // RightClickMenu 组件样式
2
-
3
- .rightClickMenu {
4
- position: fixed;
5
- z-index: 99999;
6
- background: #2c2c2c;
7
- border: 1px solid #444;
8
- border-radius: 6px;
9
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
10
- font-size: 13px;
11
- color: #eee;
12
- cursor: pointer;
13
- user-select: none;
14
- }
15
-
16
- .menuItem {
17
- padding: 8px 16px;
18
-
19
- &:hover {
20
- background-color: #444;
21
- }
22
- }
@@ -1,93 +0,0 @@
1
- // Footprints 组件样式
2
-
3
- // 其他信息容器和时间容器
4
- .otherInfoContainer,
5
- .timeContainer {
6
- font-size: 0.8rem;
7
- color: gray;
8
- }
9
-
10
- // 文本容器
11
- .textContainer {
12
- position: relative;
13
- margin-bottom: 1rem;
14
- }
15
-
16
- // 文本内容
17
- .textContent {
18
- overflow: hidden;
19
- transition: max-height 0.3s ease;
20
-
21
- // 折叠状态:隐藏从第三个开始的所有一级子元素
22
- &.collapsed > :nth-child(n + 3) {
23
- display: none;
24
- }
25
- }
26
-
27
- // 切换按钮
28
- .toggleButton {
29
- display: block;
30
- margin-top: 0.5rem;
31
- background-color: transparent;
32
- color: #007bff;
33
- border: none;
34
- cursor: pointer;
35
- text-align: left;
36
- font-size: 1rem;
37
-
38
- &:hover {
39
- text-decoration: underline;
40
- }
41
- }
42
-
43
- // 图片容器
44
- .imageContainer {
45
- display: flex;
46
- width: 100%;
47
- flex-wrap: wrap;
48
-
49
- img {
50
- width: calc(33.33% - 10px);
51
- aspect-ratio: 1; // 设置宽高比为 1:1
52
- object-fit: cover;
53
- cursor: pointer;
54
- margin: 0.3rem;
55
- }
56
- }
57
-
58
- // 模态框
59
- .modal {
60
- display: flex;
61
- position: fixed;
62
- z-index: 1000;
63
- left: 0;
64
- top: 0;
65
- width: 100%;
66
- height: 100%;
67
- overflow: auto;
68
- background-color: rgba(0, 0, 0, 1);
69
- align-items: center;
70
- justify-content: center;
71
- }
72
-
73
- // 模态框内容(图片)
74
- .modalContent {
75
- position: absolute;
76
- top: 50%;
77
- left: 50%;
78
- transform: translate(-50%, -50%);
79
- max-width: 90%;
80
- max-height: 90%;
81
- cursor: grab;
82
- }
83
-
84
- // 关闭按钮
85
- .close {
86
- position: absolute;
87
- top: 20px;
88
- right: 30px;
89
- color: white;
90
- font-size: 30px;
91
- font-weight: bold;
92
- cursor: pointer;
93
- }