@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,159 +0,0 @@
1
- /**
2
- * MarkMap 组件样式
3
- * 全局样式(.mm-toolbar, .mm-toolbar-item 等)已移至 global-components.css
4
- */
5
-
6
- .markmapContainer {
7
- border-radius: 8px;
8
- padding: 1rem;
9
- overflow: auto;
10
- position: relative;
11
- margin: 1.5rem 0;
12
- transition: all 0.3s ease;
13
- background-color: #fff;
14
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
15
-
16
- &:hover {
17
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
18
- }
19
-
20
- svg {
21
- min-width: 100%;
22
- display: block;
23
- transition: height 0.3s ease;
24
-
25
- text:empty {
26
- animation: pulse 1.5s ease-in-out infinite;
27
- }
28
- }
29
-
30
- /* 鼠标悬停显示 toolbar */
31
- &:hover :global(.mm-toolbar) {
32
- opacity: 1;
33
- pointer-events: auto;
34
- }
35
- }
36
-
37
- /* dark background */
38
- :global(.markmap-dark) .markmapContainer {
39
- background-color: #1d1d1d;
40
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
41
-
42
- &:hover {
43
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
44
- }
45
- }
46
-
47
- /* 按钮组样式 */
48
- .btnGroup {
49
- color: var(--vp-c-brand-1);
50
-
51
- input {
52
- display: inline-block;
53
- width: 2rem;
54
- text-align: center;
55
- border: 1px solid var(--vp-c-divider);
56
- border-radius: 4px;
57
- padding: 2px 4px;
58
- background: var(--vp-c-bg);
59
- color: var(--vp-c-text-1);
60
- transition: all 0.2s ease;
61
-
62
- &:focus {
63
- outline: none;
64
- border-color: var(--vp-c-brand-1);
65
- box-shadow: 0 0 0 2px rgba(var(--vp-c-brand-1), 0.1);
66
- }
67
-
68
- &:hover {
69
- border-color: var(--vp-c-brand-2);
70
- }
71
- }
72
-
73
- button {
74
- outline: none;
75
- border: none;
76
- cursor: pointer;
77
- padding: 4px 8px;
78
- border-radius: 4px;
79
- background-color: #f0f0f0;
80
- transition: all 0.2s ease;
81
- font-weight: 500;
82
-
83
- &:hover {
84
- background-color: #e0e0e0;
85
- transform: translateY(-1px);
86
- }
87
-
88
- &:active {
89
- transform: translateY(0);
90
- }
91
- }
92
- }
93
-
94
- :global(.markmap-dark) .btnGroup {
95
- button {
96
- background-color: #333;
97
- color: #fff;
98
-
99
- &:hover {
100
- background-color: #444;
101
- }
102
- }
103
-
104
- input {
105
- background-color: #2a2a2a;
106
- border-color: #444;
107
- color: #fff;
108
-
109
- &:focus {
110
- border-color: var(--vp-c-brand-1);
111
- }
112
- }
113
- }
114
-
115
- /* 全屏样式 */
116
- .markmapContainer:fullscreen,
117
- .markmapContainer:-ms-fullscreen,
118
- .markmapContainer:-webkit-full-screen {
119
- width: 100%;
120
- height: 100%;
121
- padding: 20px;
122
- background: white;
123
- display: flex;
124
- flex-direction: column;
125
- justify-content: center;
126
- box-shadow: none;
127
- }
128
-
129
- :global(.markmap-dark) .markmapContainer:fullscreen,
130
- :global(.markmap-dark) .markmapContainer:-ms-fullscreen,
131
- :global(.markmap-dark) .markmapContainer:-webkit-full-screen {
132
- background: #1d1d1d;
133
- }
134
-
135
- /* 响应式设计 */
136
- @media (max-width: 768px) {
137
- .markmapContainer {
138
- padding: 0.75rem;
139
- margin: 1rem 0;
140
- }
141
- }
142
-
143
- @media (max-width: 480px) {
144
- .markmapContainer {
145
- padding: 0.5rem;
146
- margin: 0.75rem 0;
147
- }
148
- }
149
-
150
- /* 加载动画 */
151
- @keyframes pulse {
152
- 0%,
153
- 100% {
154
- opacity: 1;
155
- }
156
- 50% {
157
- opacity: 0.5;
158
- }
159
- }
@@ -1,275 +0,0 @@
1
- /* ===================================== */
2
- /* #region 容器布局 */
3
- /* ===================================== */
4
- .mermaidWrapper {
5
- position: relative;
6
- margin: 1rem 0;
7
- border: 1px solid var(--vp-c-divider);
8
- border-radius: 8px;
9
- background: var(--vp-c-bg-soft);
10
- overflow: hidden;
11
- }
12
- /* ===================================== */
13
- /* #endregion 容器布局 */
14
- /* ===================================== */
15
-
16
- /* ===================================== */
17
- /* #region 工具栏 */
18
- /* ===================================== */
19
- .toolbar {
20
- position: absolute;
21
- top: 0;
22
- left: 0;
23
- right: 0;
24
- display: flex;
25
- align-items: center;
26
- gap: 2px;
27
- padding: 6px 8px;
28
- background: var(--vp-c-bg);
29
- border-bottom: 1px solid var(--vp-c-divider);
30
- flex-wrap: wrap;
31
- transform: translateY(-100%);
32
- transition: transform 0.3s ease, opacity 0.3s ease;
33
- opacity: 0;
34
- z-index: 10;
35
- pointer-events: none;
36
-
37
- &.visible {
38
- transform: translateY(0);
39
- opacity: 1;
40
- pointer-events: auto;
41
- }
42
- }
43
-
44
- .toolbarBtn {
45
- display: inline-flex;
46
- align-items: center;
47
- justify-content: center;
48
- width: 28px;
49
- height: 28px;
50
- padding: 0;
51
- font-size: 12px;
52
- background: transparent;
53
- border: none;
54
- border-radius: 4px;
55
- cursor: pointer;
56
- transition: all 0.2s ease;
57
- opacity: 0.6;
58
-
59
- &:hover {
60
- background: var(--vp-c-brand-soft);
61
- opacity: 1;
62
- }
63
-
64
- &:active {
65
- transform: scale(0.95);
66
- }
67
- }
68
-
69
- .iconBtn {
70
- padding: 4px;
71
-
72
- .btnIcon {
73
- width: 16px;
74
- height: 16px;
75
- display: block;
76
- pointer-events: none;
77
- }
78
- }
79
-
80
- .zoomLevel {
81
- margin-left: auto;
82
- padding: 0 6px;
83
- font-size: 11px;
84
- font-weight: 500;
85
- color: var(--vp-c-text-3);
86
- user-select: none;
87
- }
88
- /* ===================================== */
89
- /* #endregion 工具栏 */
90
- /* ===================================== */
91
-
92
- /* ===================================== */
93
- /* #region 图表容器 */
94
- /* ===================================== */
95
- .mermaidContainer {
96
- position: relative;
97
- min-height: 200px;
98
- max-height: 600px;
99
- overflow: auto;
100
- display: flex;
101
- align-items: center;
102
- justify-content: center;
103
- padding: 20px;
104
- background: var(--vp-c-bg);
105
-
106
- &.fullscreen {
107
- position: fixed;
108
- top: 0;
109
- left: 0;
110
- right: 0;
111
- bottom: 0;
112
- max-height: none;
113
- z-index: 9999;
114
- background: var(--vp-c-bg);
115
- padding: 40px;
116
- }
117
-
118
- /* 自定义滚动条 */
119
- &::-webkit-scrollbar {
120
- width: 8px;
121
- height: 8px;
122
- }
123
-
124
- &::-webkit-scrollbar-track {
125
- background: var(--vp-c-bg-soft);
126
- }
127
-
128
- &::-webkit-scrollbar-thumb {
129
- background: var(--vp-c-divider);
130
- border-radius: 4px;
131
-
132
- &:hover {
133
- background: var(--vp-c-text-3);
134
- }
135
- }
136
- }
137
- /* ===================================== */
138
- /* #endregion 图表容器 */
139
- /* ===================================== */
140
-
141
- /* ===================================== */
142
- /* #region 加载和错误状态 */
143
- /* ===================================== */
144
- .mermaidLoading {
145
- display: flex;
146
- flex-direction: column;
147
- align-items: center;
148
- gap: 12px;
149
- padding: 2rem;
150
- color: var(--vp-c-text-2);
151
-
152
- p {
153
- margin: 0;
154
- font-size: 14px;
155
- }
156
- }
157
-
158
- .spinner {
159
- width: 40px;
160
- height: 40px;
161
- border: 3px solid var(--vp-c-divider);
162
- border-top-color: var(--vp-c-brand-1);
163
- border-radius: 50%;
164
- animation: spin 0.8s linear infinite;
165
- }
166
-
167
- @keyframes spin {
168
- to {
169
- transform: rotate(360deg);
170
- }
171
- }
172
-
173
- .mermaidError {
174
- display: flex;
175
- flex-direction: column;
176
- align-items: center;
177
- gap: 8px;
178
- padding: 2rem;
179
- color: var(--vp-c-danger-1);
180
-
181
- p {
182
- margin: 0;
183
- font-size: 14px;
184
- text-align: center;
185
- }
186
- }
187
-
188
- .errorIcon {
189
- font-size: 32px;
190
- }
191
- /* ===================================== */
192
- /* #endregion 加载和错误状态 */
193
- /* ===================================== */
194
-
195
- /* ===================================== */
196
- /* #region 图表样式 */
197
- /* ===================================== */
198
- .mermaidDiagram {
199
- width: 100%;
200
- display: flex;
201
- align-items: center;
202
- justify-content: center;
203
- transition: transform 0.2s ease;
204
- cursor: grab;
205
-
206
- &:active {
207
- cursor: grabbing;
208
- }
209
-
210
- :global(svg) {
211
- max-width: 100%;
212
- height: auto;
213
- }
214
- }
215
- /* ===================================== */
216
- /* #endregion 图表样式 */
217
- /* ===================================== */
218
-
219
- /* ===================================== */
220
- /* #region 暗色主题优化 */
221
- /* ===================================== */
222
- :global(html.dark) .mermaidWrapper {
223
- background: var(--vp-code-block-bg);
224
- border-color: var(--vp-c-divider);
225
- }
226
-
227
- :global(html.dark) .toolbar {
228
- background: var(--vp-code-block-bg);
229
- }
230
-
231
- :global(html.dark) .mermaidContainer {
232
- background: var(--vp-code-block-bg);
233
- }
234
- /* ===================================== */
235
- /* #endregion 暗色主题优化 */
236
- /* ===================================== */
237
-
238
- /* ===================================== */
239
- /* #region 响应式设计 */
240
- /* ===================================== */
241
- @media (max-width: 768px) {
242
- .toolbar {
243
- padding: 4px 6px;
244
- }
245
-
246
- .toolbarBtn {
247
- width: 24px;
248
- height: 24px;
249
- }
250
-
251
- .iconBtn {
252
- padding: 3px;
253
-
254
- .btnIcon {
255
- width: 14px;
256
- height: 14px;
257
- }
258
- }
259
-
260
- .zoomLevel {
261
- font-size: 10px;
262
- }
263
-
264
- .mermaidContainer {
265
- padding: 12px;
266
- max-height: 400px;
267
-
268
- &.fullscreen {
269
- padding: 20px;
270
- }
271
- }
272
- }
273
- /* ===================================== */
274
- /* #endregion 响应式设计 */
275
- /* ===================================== */
@@ -1,77 +0,0 @@
1
- .notesTable {
2
- width: 100%;
3
- border-collapse: collapse;
4
- margin: 1.5rem 0;
5
- font-size: 0.95rem;
6
-
7
- th,
8
- td {
9
- padding: 0.75rem 1rem;
10
- text-align: left;
11
- border: 1px solid var(--vp-c-divider);
12
- }
13
-
14
- th {
15
- background-color: var(--vp-c-bg-soft);
16
- font-weight: 600;
17
- color: var(--vp-c-text-1);
18
- }
19
-
20
- tbody tr {
21
- transition: background-color 0.2s;
22
-
23
- &:hover {
24
- background-color: var(--vp-c-bg-soft);
25
- }
26
- }
27
-
28
- td {
29
- color: var(--vp-c-text-2);
30
- }
31
-
32
- .noteLink {
33
- color: var(--vp-c-brand-1);
34
- text-decoration: none;
35
- font-weight: 500;
36
- transition: color 0.2s;
37
-
38
- &:hover {
39
- color: var(--vp-c-brand-2);
40
- text-decoration: underline;
41
- }
42
- }
43
-
44
- .noteId {
45
- font-family: var(--vp-font-family-mono);
46
- font-size: 0.9em;
47
- color: var(--vp-c-text-3);
48
- margin-right: 0.5rem;
49
- }
50
-
51
- .description {
52
- line-height: 1.6;
53
-
54
- &.empty {
55
- color: var(--vp-c-text-3);
56
- font-style: italic;
57
- }
58
- }
59
- }
60
-
61
- .error {
62
- padding: 1rem;
63
- margin: 1rem 0;
64
- border-left: 4px solid var(--vp-c-danger-1);
65
- background-color: var(--vp-c-danger-soft);
66
- color: var(--vp-c-danger-1);
67
- border-radius: 4px;
68
- }
69
-
70
- .warning {
71
- padding: 1rem;
72
- margin: 1rem 0;
73
- border-left: 4px solid var(--vp-c-warning-1);
74
- background-color: var(--vp-c-warning-soft);
75
- color: var(--vp-c-warning-1);
76
- border-radius: 4px;
77
- }