@tnotesjs/core 0.1.14 → 0.1.16

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 (117) hide show
  1. package/README.md +87 -87
  2. package/dist/{chunk-FVKQPBPP.js → chunk-4MO7F7Q4.js} +2005 -1769
  3. package/dist/cli/index.js +1 -1
  4. package/dist/vitepress/config/index.js +212 -4
  5. package/package.json +1 -1
  6. package/types/config.ts +61 -61
  7. package/types/index.ts +11 -11
  8. package/types/note.ts +33 -33
  9. package/vitepress/assets/icons/icon__check.svg +3 -3
  10. package/vitepress/assets/icons/icon__clipboard.svg +7 -7
  11. package/vitepress/assets/icons/icon__close.svg +1 -1
  12. package/vitepress/assets/icons/icon__collapse.svg +1 -1
  13. package/vitepress/assets/icons/icon__confirm.svg +1 -1
  14. package/vitepress/assets/icons/icon__copy.svg +4 -4
  15. package/vitepress/assets/icons/icon__focus.svg +1 -1
  16. package/vitepress/assets/icons/icon__fold.svg +3 -3
  17. package/vitepress/assets/icons/icon__folder.svg +1 -1
  18. package/vitepress/assets/icons/icon__fullscreen.svg +1 -1
  19. package/vitepress/assets/icons/icon__fullscreen_exit.svg +1 -1
  20. package/vitepress/assets/icons/icon__github.svg +3 -3
  21. package/vitepress/assets/icons/icon__mindmap.svg +1 -1
  22. package/vitepress/assets/icons/icon__next.svg +1 -1
  23. package/vitepress/assets/icons/icon__number_gray.svg +1 -1
  24. package/vitepress/assets/icons/icon__number_purple.svg +1 -1
  25. package/vitepress/assets/icons/icon__prev.svg +1 -1
  26. package/vitepress/assets/icons/icon__restore.svg +1 -1
  27. package/vitepress/assets/icons/icon__rotate.svg +4 -4
  28. package/vitepress/assets/icons/icon__search.svg +1 -1
  29. package/vitepress/assets/icons/icon__setting.svg +1 -0
  30. package/vitepress/assets/icons/icon__sidebar_collapsed.svg +1 -1
  31. package/vitepress/assets/icons/icon__sidebar_opened.svg +1 -1
  32. package/vitepress/assets/icons/icon__totop.svg +5 -5
  33. package/vitepress/assets/icons/icon__vscode.svg +5 -5
  34. package/vitepress/assets/icons/icon__zoom_fit.svg +1 -1
  35. package/vitepress/assets/icons/icon__zoom_in.svg +1 -1
  36. package/vitepress/assets/icons/icon__zoom_out.svg +1 -1
  37. package/vitepress/assets/icons/icon__zoom_reset.svg +1 -1
  38. package/vitepress/assets/icons/index.ts +39 -38
  39. package/vitepress/components/BilibiliOutsidePlayer/BilibiliOutsidePlayer.vue +20 -20
  40. package/vitepress/components/CodeBlockFullscreen/CodeBlockFullscreen.vue +373 -373
  41. package/vitepress/components/CodeBlockFullscreen/index.ts +115 -115
  42. package/vitepress/components/CodeBlockFullscreen/styles.css +64 -64
  43. package/vitepress/components/Discussions/Discussions.module.scss +32 -32
  44. package/vitepress/components/Discussions/Discussions.vue +211 -211
  45. package/vitepress/components/EnWordList/EnWordList.module.scss +124 -124
  46. package/vitepress/components/EnWordList/EnWordList.vue +543 -543
  47. package/vitepress/components/EnWordList/RightClickMenu.module.scss +22 -22
  48. package/vitepress/components/EnWordList/RightClickMenu.vue +66 -66
  49. package/vitepress/components/Footprints/Footprints.module.scss +93 -93
  50. package/vitepress/components/Footprints/Footprints.vue +377 -377
  51. package/vitepress/components/Layout/AboutModal.module.scss +233 -233
  52. package/vitepress/components/Layout/AboutModal.vue +105 -105
  53. package/vitepress/components/Layout/AboutPanel.vue +270 -270
  54. package/vitepress/components/Layout/ContentCollapse.vue +603 -603
  55. package/vitepress/components/Layout/CustomSidebar.vue +878 -608
  56. package/vitepress/components/Layout/DocBeforeControls.vue +149 -149
  57. package/vitepress/components/Layout/DocFooter.vue +233 -233
  58. package/vitepress/components/Layout/ImagePreview.module.scss +201 -201
  59. package/vitepress/components/Layout/ImagePreview.vue +281 -281
  60. package/vitepress/components/Layout/Layout.module.scss +661 -661
  61. package/vitepress/components/Layout/Layout.vue +618 -560
  62. package/vitepress/components/Layout/NavBarSettingsTrigger.vue +59 -0
  63. package/vitepress/components/Layout/NoteStatus.vue +140 -140
  64. package/vitepress/components/Layout/SidebarItems.vue +1083 -268
  65. package/vitepress/components/Layout/SidebarNavBefore.vue +171 -114
  66. package/vitepress/components/Layout/Swiper.vue +167 -167
  67. package/vitepress/components/Layout/ToggleFullContent.module.scss +11 -11
  68. package/vitepress/components/Layout/ToggleFullContent.vue +35 -35
  69. package/vitepress/components/Layout/ToggleSidebar.module.scss +11 -11
  70. package/vitepress/components/Layout/ToggleSidebar.vue +36 -36
  71. package/vitepress/components/Layout/composables/useCollapseControl.ts +88 -88
  72. package/vitepress/components/Layout/composables/useNoteConfig.ts +119 -119
  73. package/vitepress/components/Layout/composables/useNoteSave.ts +178 -178
  74. package/vitepress/components/Layout/composables/useNoteValidation.ts +85 -85
  75. package/vitepress/components/Layout/composables/useRedirect.ts +113 -113
  76. package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +85 -85
  77. package/vitepress/components/Layout/homeReadme.data.ts +124 -124
  78. package/vitepress/components/MarkMap/MarkMap.module.scss +159 -159
  79. package/vitepress/components/MarkMap/MarkMap.vue +405 -405
  80. package/vitepress/components/Mermaid/Mermaid.module.scss +275 -275
  81. package/vitepress/components/Mermaid/Mermaid.vue +365 -365
  82. package/vitepress/components/NotesTable/NotesTable.module.scss +77 -77
  83. package/vitepress/components/NotesTable/NotesTable.vue +98 -98
  84. package/vitepress/components/NotesTable/README.md +67 -67
  85. package/vitepress/components/Settings/Settings.module.scss +375 -433
  86. package/vitepress/components/Settings/Settings.vue +376 -306
  87. package/vitepress/components/SidebarCard/MindMapView.vue +484 -484
  88. package/vitepress/components/SidebarCard/NotesTrendChart.vue +108 -108
  89. package/vitepress/components/SidebarCard/SidebarCard.vue +946 -946
  90. package/vitepress/components/Tooltip/Tooltip.vue +70 -70
  91. package/vitepress/components/constants.ts +109 -91
  92. package/vitepress/components/notesConfig.data.ts +73 -73
  93. package/vitepress/components/sidebar.data.ts +59 -59
  94. package/vitepress/components/tnotes-config.data.ts +21 -21
  95. package/vitepress/components/utils.ts +26 -26
  96. package/vitepress/config/index.ts +169 -167
  97. package/vitepress/configs/constants.ts +26 -26
  98. package/vitepress/configs/head.config.ts +25 -25
  99. package/vitepress/configs/index.ts +9 -9
  100. package/vitepress/configs/markdown-it.d.ts +23 -23
  101. package/vitepress/configs/markdown.config.ts +366 -366
  102. package/vitepress/configs/theme.config.ts +108 -108
  103. package/vitepress/plugins/buildProgressPlugin.ts +434 -434
  104. package/vitepress/plugins/getNoteByConfigIdPlugin.ts +107 -107
  105. package/vitepress/plugins/renameNotePlugin.ts +68 -68
  106. package/vitepress/plugins/sidebarStructurePlugin.ts +260 -0
  107. package/vitepress/plugins/updateConfigPlugin.ts +63 -63
  108. package/vitepress/theme/index.ts +137 -137
  109. package/vitepress/theme/styles/base.scss +50 -50
  110. package/vitepress/theme/styles/components/404.scss +31 -31
  111. package/vitepress/theme/styles/components/collapse.scss +175 -175
  112. package/vitepress/theme/styles/components/markmap.scss +101 -101
  113. package/vitepress/theme/styles/components/swiper.scss +255 -255
  114. package/vitepress/theme/styles/index.scss +25 -25
  115. package/vitepress/theme/styles/layout.scss +70 -62
  116. package/vitepress/theme/styles/utilities.scss +39 -39
  117. package/vitepress/theme/styles/vitepress-override.scss +25 -25
@@ -1,275 +1,275 @@
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
+ /* ===================================== */
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
+ /* ===================================== */