@tnotesjs/core 0.1.21 → 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 (47) 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/Discussions/Discussions.vue +37 -4
  11. package/vitepress/components/EnWordList/EnWordList.vue +135 -15
  12. package/vitepress/components/EnWordList/RightClickMenu.vue +33 -10
  13. package/vitepress/components/Footprints/Footprints.vue +105 -10
  14. package/vitepress/components/Layout/AboutModal.vue +242 -16
  15. package/vitepress/components/Layout/AboutPanel.vue +258 -44
  16. package/vitepress/components/Layout/ContentCollapse.vue +1 -14
  17. package/vitepress/components/Layout/DocBeforeControls.vue +221 -19
  18. package/vitepress/components/Layout/ImagePreview.vue +212 -9
  19. package/vitepress/components/Layout/Layout.vue +133 -10
  20. package/vitepress/components/Layout/NavBarSettingsTrigger.vue +0 -2
  21. package/vitepress/components/Layout/SidebarNavBefore.vue +0 -1
  22. package/vitepress/components/Layout/SidebarResizeHandle.vue +2 -10
  23. package/vitepress/components/Layout/ToggleFullContent.vue +14 -2
  24. package/vitepress/components/Layout/ToggleSidebar.vue +14 -3
  25. package/vitepress/components/LoadingPage/LoadingPage.vue +1 -6
  26. package/vitepress/components/MarkMap/MarkMap.vue +162 -3
  27. package/vitepress/components/Mermaid/Mermaid.vue +300 -22
  28. package/vitepress/components/NotesTable/NotesTable.vue +86 -10
  29. package/vitepress/components/Settings/Settings.vue +434 -57
  30. package/vitepress/components/Settings/SettingsDialog.vue +1 -11
  31. package/vitepress/components/SidebarCard/MindMapView.vue +28 -28
  32. package/vitepress/components/SidebarCard/SidebarCard.vue +3 -4
  33. package/vitepress/components/Tooltip/Tooltip.vue +28 -28
  34. package/vitepress/configs/markdown.config.ts +3 -2
  35. package/vitepress/components/Discussions/Discussions.module.scss +0 -32
  36. package/vitepress/components/EnWordList/EnWordList.module.scss +0 -124
  37. package/vitepress/components/EnWordList/RightClickMenu.module.scss +0 -22
  38. package/vitepress/components/Footprints/Footprints.module.scss +0 -93
  39. package/vitepress/components/Layout/AboutModal.module.scss +0 -233
  40. package/vitepress/components/Layout/ImagePreview.module.scss +0 -201
  41. package/vitepress/components/Layout/Layout.module.scss +0 -661
  42. package/vitepress/components/Layout/ToggleFullContent.module.scss +0 -11
  43. package/vitepress/components/Layout/ToggleSidebar.module.scss +0 -11
  44. package/vitepress/components/MarkMap/MarkMap.module.scss +0 -159
  45. package/vitepress/components/Mermaid/Mermaid.module.scss +0 -275
  46. package/vitepress/components/NotesTable/NotesTable.module.scss +0 -77
  47. package/vitepress/components/Settings/Settings.module.scss +0 -375
@@ -222,7 +222,6 @@ function addLevelControl(toolbar) {
222
222
  levelInput.style.borderBottom = '.5px solid var(--vp-c-tip-1)'
223
223
  levelInput.style.color = 'var(--vp-c-tip-1)'
224
224
  levelInput.title = '展开层级'
225
- levelInput.setAttribute('aria-label', 'markmap-expand-level')
226
225
 
227
226
  toolbarLevelInput = levelInput
228
227
 
@@ -408,37 +407,38 @@ onBeforeUnmount(() => {
408
407
  padding: 1rem 0;
409
408
  display: flex;
410
409
  flex-direction: column;
411
- }
412
-
413
- .mindmap-container {
414
- width: 100%;
415
- height: 500px;
416
- position: relative;
417
- overflow: hidden;
418
- border-radius: 8px;
419
- padding: 1rem;
420
- transition: all 0.3s ease;
421
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
422
- box-sizing: border-box;
423
-
424
- &:hover {
425
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
426
- }
427
-
428
- svg {
410
+
411
+ .mindmap-container {
429
412
  width: 100%;
430
- height: 100%;
431
- display: block;
432
- transition: height 0.3s ease;
433
- }
434
-
435
- /* 鼠标悬停显示 toolbar */
436
- &:hover :deep(.mm-toolbar) {
437
- opacity: 1;
438
- pointer-events: auto;
413
+ height: 500px;
414
+ position: relative;
415
+ overflow: hidden;
416
+ border-radius: 8px;
417
+ padding: 1rem;
418
+ transition: all 0.3s ease;
419
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
420
+ box-sizing: border-box;
421
+
422
+ &:hover {
423
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
424
+ }
425
+
426
+ svg {
427
+ width: 100%;
428
+ height: 100%;
429
+ display: block;
430
+ transition: height 0.3s ease;
431
+ }
432
+
433
+ /* 鼠标悬停显示 toolbar */
434
+ &:hover :deep(.mm-toolbar) {
435
+ opacity: 1;
436
+ pointer-events: auto;
437
+ }
439
438
  }
440
439
  }
441
440
 
441
+
442
442
  /* 暗色主题 */
443
443
  :global(.dark) .mindmap-container,
444
444
  :global(.markmap-dark) .mindmap-container {
@@ -13,12 +13,11 @@ import {
13
13
  icon__number_purple,
14
14
  } from '../../assets/icons'
15
15
  import { NOTES_DIR_KEY, REPO_NAME, AUTHOR, ROOT_ITEM } from '../constants.ts'
16
+ import MindMapView from './MindMapView.vue'
17
+ import NotesTrendChart from './NotesTrendChart.vue'
16
18
  import { useSettingsDialog } from '../Settings/composables/useSettingsDialog'
17
19
  import { data as sidebarConfig } from '../sidebar.data'
18
20
  import { formatDate } from '../utils.ts'
19
- // @ts-expect-error - VitePress Data Loader
20
- import MindMapView from './MindMapView.vue'
21
- import NotesTrendChart from './NotesTrendChart.vue'
22
21
 
23
22
  // #region props
24
23
  const props = defineProps({
@@ -294,7 +293,7 @@ function openVSCodeArticle(article) {
294
293
  </script>
295
294
 
296
295
  <template>
297
- <div class="sidebar-view-container">
296
+ <div>
298
297
  <!-- 控制栏区域 -->
299
298
  <div class="control-bar">
300
299
  <!-- 左侧视图切换按钮 -->
@@ -22,39 +22,39 @@ defineProps({
22
22
  const showTooltip = ref(false)
23
23
  </script>
24
24
 
25
- <style scoped>
25
+ <style scoped lang="scss">
26
26
  .tooltip-wrapper {
27
27
  position: relative;
28
28
  display: inline-block;
29
- }
30
29
 
31
- .tooltip {
32
- position: absolute;
33
- bottom: 100%;
34
- left: 50%;
35
- transform: translateX(-50%) translateY(-8px);
36
- background-color: var(--vp-c-bg-elv);
37
- color: var(--vp-c-text-1);
38
- padding: 6px 12px;
39
- border-radius: 6px;
40
- font-size: 14px;
41
- font-weight: 500;
42
- white-space: nowrap;
43
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
44
- border: 1px solid var(--vp-c-divider);
45
- z-index: 100;
46
- animation: tooltipFadeIn 0.15s ease-out;
47
- pointer-events: none;
48
- }
30
+ .tooltip {
31
+ position: absolute;
32
+ bottom: 100%;
33
+ left: 50%;
34
+ transform: translateX(-50%) translateY(-8px);
35
+ background-color: var(--vp-c-bg-elv);
36
+ color: var(--vp-c-text-1);
37
+ padding: 6px 12px;
38
+ border-radius: 6px;
39
+ font-size: 14px;
40
+ font-weight: 500;
41
+ white-space: nowrap;
42
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
43
+ border: 1px solid var(--vp-c-divider);
44
+ z-index: 100;
45
+ animation: tooltipFadeIn 0.15s ease-out;
46
+ pointer-events: none;
49
47
 
50
- .tooltip::after {
51
- content: '';
52
- position: absolute;
53
- top: 100%;
54
- left: 50%;
55
- transform: translateX(-50%);
56
- border: 6px solid transparent;
57
- border-top-color: var(--vp-c-bg-elv);
48
+ &::after {
49
+ content: '';
50
+ position: absolute;
51
+ top: 100%;
52
+ left: 50%;
53
+ transform: translateX(-50%);
54
+ border: 6px solid transparent;
55
+ border-top-color: var(--vp-c-bg-elv);
56
+ }
57
+ }
58
58
  }
59
59
 
60
60
  @keyframes tooltipFadeIn {
@@ -4,15 +4,16 @@
4
4
  * Markdown 配置
5
5
  */
6
6
  import fs from 'fs'
7
- import MarkdownIt from 'markdown-it'
8
7
  import markdownItContainer from 'markdown-it-container'
9
8
  import mila from 'markdown-it-link-attributes'
10
9
  import markdownItTaskLists from 'markdown-it-task-lists'
11
10
  import path from 'path'
12
- import { MarkdownOptions } from 'vitepress'
13
11
 
14
12
  import { generateAnchor } from '../../utils'
15
13
 
14
+ import type MarkdownIt from 'markdown-it'
15
+ import type { MarkdownOptions } from 'vitepress'
16
+
16
17
  /**
17
18
  * 辅助函数:HTML 转义
18
19
  */
@@ -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
- }
@@ -1,233 +0,0 @@
1
- // AboutModal 组件样式
2
-
3
- // 模态框背景遮罩
4
- .modalBackdrop {
5
- position: fixed;
6
- inset: 0;
7
- background: rgba(0, 0, 0, 0.75);
8
- backdrop-filter: blur(4px);
9
- display: flex;
10
- align-items: center;
11
- justify-content: center;
12
- z-index: 1200;
13
- padding: 1rem;
14
- animation: fadeIn 0.2s ease-out;
15
- }
16
-
17
- @keyframes fadeIn {
18
- from {
19
- opacity: 0;
20
- }
21
- to {
22
- opacity: 1;
23
- }
24
- }
25
-
26
- @keyframes slideUp {
27
- from {
28
- opacity: 0;
29
- transform: translateY(20px);
30
- }
31
- to {
32
- opacity: 1;
33
- transform: translateY(0);
34
- }
35
- }
36
-
37
- // 模态框主体
38
- .modal {
39
- background: var(--vp-c-bg);
40
- color: var(--vp-c-text-1);
41
- border-radius: 16px;
42
- max-width: 580px;
43
- width: 100%;
44
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
45
- 0 0 0 1px rgba(255, 255, 255, 0.05);
46
- overflow: hidden;
47
- outline: none;
48
- animation: slideUp 0.3s ease-out;
49
-
50
- // 暗色模式优化
51
- :global(.dark) & {
52
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
53
- 0 0 0 1px rgba(255, 255, 255, 0.08);
54
- }
55
- }
56
-
57
- // 模态框头部
58
- .modalHeader {
59
- display: flex;
60
- align-items: center;
61
- justify-content: space-between;
62
- padding: 1.25rem 1.5rem;
63
- border-bottom: 1px solid var(--vp-c-divider);
64
- background: linear-gradient(
65
- 180deg,
66
- var(--vp-c-bg-soft) 0%,
67
- var(--vp-c-bg) 100%
68
- );
69
- position: relative;
70
-
71
- // 添加顶部装饰条
72
- &::before {
73
- content: '';
74
- position: absolute;
75
- top: 0;
76
- left: 0;
77
- right: 0;
78
- height: 3px;
79
- background: linear-gradient(
80
- 90deg,
81
- var(--vp-c-brand-1),
82
- var(--vp-c-brand-2)
83
- );
84
- }
85
- }
86
-
87
- // 模态框标题
88
- .modalTitle {
89
- margin: 0;
90
- font-size: 1.125rem;
91
- font-weight: 600;
92
- color: var(--vp-c-text-1);
93
- letter-spacing: -0.01em;
94
- display: flex;
95
- align-items: center;
96
- gap: 0.5rem;
97
-
98
- // 添加图标装饰(可选,如果标题前有 emoji)
99
- &::before {
100
- content: '📝';
101
- font-size: 1.25rem;
102
- }
103
- }
104
-
105
- // 关闭按钮
106
- .closeBtn {
107
- background: transparent;
108
- border: none;
109
- cursor: pointer;
110
- font-size: 1.25rem;
111
- line-height: 1;
112
- padding: 0.5rem;
113
- border-radius: 8px;
114
- color: var(--vp-c-text-2);
115
- transition: all 0.2s ease;
116
- display: flex;
117
- align-items: center;
118
- justify-content: center;
119
- width: 32px;
120
- height: 32px;
121
-
122
- &:hover {
123
- background: var(--vp-c-bg-soft);
124
- color: var(--vp-c-text-1);
125
- transform: rotate(90deg);
126
- }
127
-
128
- &:active {
129
- transform: rotate(90deg) scale(0.95);
130
- }
131
- }
132
-
133
- // 模态框主体内容
134
- .modalBody {
135
- padding: 1.5rem;
136
- font-size: 0.95rem;
137
- color: var(--vp-c-text-2);
138
- line-height: 1.7;
139
- max-height: 60vh;
140
- overflow-y: auto;
141
-
142
- // 美化滚动条
143
- &::-webkit-scrollbar {
144
- width: 6px;
145
- }
146
-
147
- &::-webkit-scrollbar-track {
148
- background: transparent;
149
- }
150
-
151
- &::-webkit-scrollbar-thumb {
152
- background: var(--vp-c-divider);
153
- border-radius: 3px;
154
-
155
- &:hover {
156
- background: var(--vp-c-text-3);
157
- }
158
- }
159
-
160
- // 优化内容样式
161
- p {
162
- margin: 0.75rem 0;
163
-
164
- &:first-child {
165
- margin-top: 0;
166
- }
167
-
168
- &:last-child {
169
- margin-bottom: 0;
170
- }
171
- }
172
-
173
- // 如果内容中有图标,增加间距
174
- :deep(span) {
175
- margin-right: 0.25rem;
176
- }
177
-
178
- // 强调文本
179
- strong {
180
- color: var(--vp-c-text-1);
181
- font-weight: 600;
182
- }
183
-
184
- // 链接样式
185
- a {
186
- color: var(--vp-c-brand-1);
187
- text-decoration: none;
188
- transition: color 0.2s;
189
-
190
- &:hover {
191
- color: var(--vp-c-brand-2);
192
- text-decoration: underline;
193
- }
194
- }
195
- }
196
-
197
- // 模态框底部(可选)
198
- .modalFooter {
199
- padding: 1rem 1.5rem;
200
- border-top: 1px solid var(--vp-c-divider);
201
- background: var(--vp-c-bg-soft);
202
- text-align: right;
203
- display: flex;
204
- gap: 0.75rem;
205
- justify-content: flex-end;
206
- align-items: center;
207
- }
208
-
209
- // 响应式优化
210
- @media (max-width: 640px) {
211
- .modal {
212
- max-width: 100%;
213
- margin: 1rem;
214
- border-radius: 12px;
215
- }
216
-
217
- .modalHeader {
218
- padding: 1rem 1.25rem;
219
- }
220
-
221
- .modalTitle {
222
- font-size: 1rem;
223
- }
224
-
225
- .modalBody {
226
- padding: 1.25rem;
227
- max-height: 50vh;
228
- }
229
-
230
- .modalFooter {
231
- padding: 0.875rem 1.25rem;
232
- }
233
- }