@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
@@ -1,41 +1,38 @@
1
1
  <template>
2
- <div
3
- :class="$style.timeModalContent"
4
- role="group"
5
- :aria-label="isHomeReadme ? '知识库提交信息' : '笔记提交信息'"
6
- >
2
+ <div class="timeModalContent">
7
3
  <!-- 笔记编号(仅笔记页显示) -->
8
4
  <div
9
- :class="$style.timeLine"
5
+ class="timeLine"
10
6
  v-if="!isHomeReadme && currentNoteId"
11
7
  title="笔记编号"
12
8
  >
13
- <div :class="$style.timeLabel">
9
+ <div class="timeLabel">
14
10
  <strong>🔢 笔记编号</strong>
15
11
  </div>
16
- <div :class="$style.timeValue">{{ currentNoteId }}</div>
12
+ <div class="timeValue">{{ currentNoteId }}</div>
17
13
  </div>
18
14
 
19
15
  <!-- 笔记标题(仅笔记页显示) -->
20
16
  <div
21
- :class="$style.timeLine"
17
+ class="timeLine"
22
18
  v-if="!isHomeReadme && currentNoteId"
23
19
  title="笔记标题"
24
20
  >
25
- <div :class="$style.timeLabel">
21
+ <div class="timeLabel">
26
22
  <strong>📝 笔记标题</strong>
27
23
  </div>
28
- <div :class="$style.timeValue">
24
+ <div class="timeValue">
29
25
  <input
30
26
  v-model="editableNoteTitle"
31
27
  type="text"
32
- :class="[$style.titleInput, { [$style.error]: titleError }]"
28
+ class="titleInput"
29
+ :class="{ error: titleError }"
33
30
  :disabled="!isDev"
34
31
  @input="onTitleInput"
35
32
  @blur="onTitleBlur"
36
33
  placeholder="请输入笔记标题"
37
34
  />
38
- <div v-if="titleError" :class="$style.errorMessage">
35
+ <div v-if="titleError" class="errorMessage">
39
36
  {{ titleError }}
40
37
  </div>
41
38
  </div>
@@ -43,17 +40,17 @@
43
40
 
44
41
  <!-- 笔记简介(仅笔记页显示) -->
45
42
  <div
46
- :class="$style.timeLine"
43
+ class="timeLine"
47
44
  v-if="!isHomeReadme && currentNoteId"
48
45
  title="笔记简介"
49
46
  >
50
- <div :class="$style.timeLabel">
47
+ <div class="timeLabel">
51
48
  <strong>📄 笔记简介</strong>
52
49
  </div>
53
- <div :class="$style.timeValue">
50
+ <div class="timeValue">
54
51
  <textarea
55
52
  v-model="editableDescription"
56
- :class="$style.descriptionInput"
53
+ class="descriptionInput"
57
54
  :disabled="!isDev"
58
55
  @input="onDescriptionInput"
59
56
  placeholder="请输入笔记的一句话简介(可选)"
@@ -64,17 +61,17 @@
64
61
 
65
62
  <!-- 笔记状态(仅笔记页显示且非开发环境只读) -->
66
63
  <div
67
- :class="$style.timeLine"
64
+ class="timeLine"
68
65
  v-if="!isHomeReadme && currentNoteId"
69
66
  title="笔记状态"
70
67
  >
71
- <div :class="$style.timeLabel">
68
+ <div class="timeLabel">
72
69
  <strong>📝 完成状态</strong>
73
70
  </div>
74
- <div :class="$style.timeValue">
71
+ <div class="timeValue">
75
72
  <select
76
73
  v-model="editableNoteStatus"
77
- :class="$style.statusSelect"
74
+ class="statusSelect"
78
75
  :disabled="!isDev"
79
76
  @change="onConfigChange"
80
77
  >
@@ -86,17 +83,17 @@
86
83
 
87
84
  <!-- 评论状态(仅笔记页显示且非开发环境只读) -->
88
85
  <div
89
- :class="$style.timeLine"
86
+ class="timeLine"
90
87
  v-if="!isHomeReadme && currentNoteId"
91
88
  title="评论状态"
92
89
  >
93
- <div :class="$style.timeLabel">
90
+ <div class="timeLabel">
94
91
  <strong>🫧 评论状态</strong>
95
92
  </div>
96
- <div :class="$style.timeValue">
93
+ <div class="timeValue">
97
94
  <select
98
95
  v-model="editableDiscussionsEnabled"
99
- :class="$style.statusSelect"
96
+ class="statusSelect"
100
97
  :disabled="!isDev"
101
98
  @change="onConfigChange"
102
99
  >
@@ -107,38 +104,38 @@
107
104
  </div>
108
105
 
109
106
  <!-- 首次提交时间 -->
110
- <div :class="$style.timeLine" title="首次提交时间">
111
- <div :class="$style.timeLabel"><strong>⌛️ 首次提交</strong></div>
112
- <div :class="$style.timeValue">
107
+ <div class="timeLine" title="首次提交时间">
108
+ <div class="timeLabel"><strong>⌛️ 首次提交</strong></div>
109
+ <div class="timeValue">
113
110
  {{ formatOptionalDate(modalCreatedAt) }}
114
111
  </div>
115
112
  </div>
116
113
 
117
114
  <!-- 最近提交时间 -->
118
- <div :class="$style.timeLine" title="最近提交时间">
119
- <div :class="$style.timeLabel"><strong>⌛️ 最近提交</strong></div>
120
- <div :class="$style.timeValue">
115
+ <div class="timeLine" title="最近提交时间">
116
+ <div class="timeLabel"><strong>⌛️ 最近提交</strong></div>
117
+ <div class="timeValue">
121
118
  {{ formatOptionalDate(modalUpdatedAt) }}
122
119
  </div>
123
120
  </div>
124
121
 
125
122
  <!-- GitHub -->
126
123
  <div
127
- :class="$style.timeLine"
124
+ class="timeLine"
128
125
  v-if="modalGithubUrl"
129
126
  :title="
130
127
  isHomeReadme ? '在 GitHub 中打开知识库' : '在 GitHub 中打开当前笔记'
131
128
  "
132
129
  >
133
- <div :class="$style.timeLabel">
130
+ <div class="timeLabel">
134
131
  <strong>🔗 GitHub</strong>
135
132
  </div>
136
- <div :class="$style.timeValue">
133
+ <div class="timeValue">
137
134
  <a
138
135
  :href="modalGithubUrl"
139
136
  target="_blank"
140
137
  rel="noopener"
141
- :class="$style.githubLink"
138
+ class="githubLink"
142
139
  >
143
140
  {{
144
141
  isHomeReadme ? '在 GitHub 中打开知识库' : '在 GitHub 中打开当前笔记'
@@ -149,7 +146,7 @@
149
146
 
150
147
  <!-- GitHub Page -->
151
148
  <div
152
- :class="$style.timeLine"
149
+ class="timeLine"
153
150
  v-if="modalGithubPageUrl"
154
151
  :title="
155
152
  isHomeReadme
@@ -157,15 +154,15 @@
157
154
  : '在 GitHub Page 中打开当前笔记'
158
155
  "
159
156
  >
160
- <div :class="$style.timeLabel">
157
+ <div class="timeLabel">
161
158
  <strong>🔗 GitHub Page</strong>
162
159
  </div>
163
- <div :class="$style.timeValue">
160
+ <div class="timeValue">
164
161
  <a
165
162
  :href="modalGithubPageUrl"
166
163
  target="_blank"
167
164
  rel="noopener"
168
- :class="$style.githubLink"
165
+ class="githubLink"
169
166
  >
170
167
  {{
171
168
  isHomeReadme
@@ -178,14 +175,14 @@
178
175
 
179
176
  <!-- 完成进度(仅首页显示) -->
180
177
  <div
181
- :class="$style.timeLine"
178
+ class="timeLine"
182
179
  v-if="isHomeReadme && completionPercentage !== null"
183
180
  title="笔记完成进度"
184
181
  >
185
- <div :class="$style.timeLabel">
182
+ <div class="timeLabel">
186
183
  <strong>📊 完成进度</strong>
187
184
  </div>
188
- <div :class="$style.timeValue">
185
+ <div class="timeValue">
189
186
  {{ completionPercentage }}% ({{ doneNotesLen }} / {{ totalNotesLen }})
190
187
  </div>
191
188
  </div>
@@ -193,7 +190,7 @@
193
190
  </template>
194
191
 
195
192
  <script setup lang="ts">
196
- import { computed } from 'vue'
193
+ import { computed } from 'vue'
197
194
 
198
195
  import { formatDate } from '../utils'
199
196
 
@@ -268,4 +265,221 @@ function formatOptionalDate(timestamp: number | undefined) {
268
265
  }
269
266
  </script>
270
267
 
271
- <style module src="./Layout.module.scss"></style>
268
+ <style scoped lang="scss">
269
+ /* time-modal-content: 通用容器 */
270
+ .timeModalContent {
271
+ display: flex;
272
+ flex-direction: column;
273
+ gap: 0.75rem;
274
+ padding: 0.25rem 0;
275
+ font-size: 0.95rem;
276
+
277
+ /* 每一行:移动端默认纵向排列(标签在上,值在下),在宽屏时变成左右两栏 */
278
+ .timeLine {
279
+ display: flex;
280
+ flex-direction: column;
281
+ gap: 0.25rem;
282
+ align-items: flex-start;
283
+ padding: 0.5rem;
284
+ border-radius: 8px;
285
+ transition: background-color 0.2s ease;
286
+
287
+ &:hover {
288
+ background-color: var(--vp-c-bg-soft);
289
+ }
290
+ }
291
+
292
+ /* 标签(左侧) */
293
+ .timeLabel {
294
+ font-weight: 700;
295
+ color: var(--vp-c-text);
296
+ font-size: 0.98rem;
297
+
298
+ strong {
299
+ display: inline-flex;
300
+ align-items: center;
301
+ gap: 0.25rem;
302
+ }
303
+ }
304
+
305
+ /* 值(右侧/下方) */
306
+ .timeValue {
307
+ color: var(--vp-c-text-2);
308
+ font-size: 0.88rem;
309
+ line-height: 1.35;
310
+ word-break: break-word;
311
+ font-family: var(--vp-font-family-mono);
312
+ }
313
+
314
+ /* GitHub 链接样式 */
315
+ .githubLink {
316
+ color: var(--vp-c-brand-1);
317
+ text-decoration: none;
318
+ transition: all 0.2s ease;
319
+ display: inline-flex;
320
+ align-items: center;
321
+ gap: 0.25rem;
322
+
323
+ &:hover {
324
+ color: var(--vp-c-brand-2);
325
+ text-decoration: underline;
326
+ }
327
+ }
328
+
329
+ /* 状态选择框样式 */
330
+ .statusSelect {
331
+ padding: 0.375rem 0.75rem;
332
+ border: 1px solid var(--vp-c-divider);
333
+ border-radius: 6px;
334
+ background-color: var(--vp-c-bg);
335
+ color: var(--vp-c-text-1);
336
+ font-size: 0.875rem;
337
+ font-family: inherit;
338
+ cursor: pointer;
339
+ transition: all 0.2s ease;
340
+ min-width: 120px;
341
+
342
+ &:hover:not(:disabled) {
343
+ border-color: var(--vp-c-brand-1);
344
+ background-color: var(--vp-c-bg-soft);
345
+ }
346
+
347
+ &:focus {
348
+ outline: none;
349
+ border-color: var(--vp-c-brand-1);
350
+ box-shadow: 0 0 0 3px rgba(var(--vp-c-brand-rgb), 0.1);
351
+ }
352
+
353
+ &:disabled {
354
+ opacity: 0.6;
355
+ cursor: not-allowed;
356
+ }
357
+
358
+ option {
359
+ padding: 0.5rem;
360
+ background-color: var(--vp-c-bg);
361
+ color: var(--vp-c-text-1);
362
+ }
363
+ }
364
+
365
+ /* 标题输入框样式 */
366
+ .titleInput {
367
+ width: 100%;
368
+ padding: 0.5rem 0.75rem;
369
+ border: 1px solid var(--vp-c-divider);
370
+ border-radius: 6px;
371
+ background-color: var(--vp-c-bg);
372
+ color: var(--vp-c-text-1);
373
+ font-size: 0.875rem;
374
+ font-family: inherit;
375
+ transition: all 0.2s ease;
376
+
377
+ &:hover:not(:disabled) {
378
+ border-color: var(--vp-c-brand-1);
379
+ background-color: var(--vp-c-bg-soft);
380
+ }
381
+
382
+ &:focus {
383
+ outline: none;
384
+ border-color: var(--vp-c-brand-1);
385
+ box-shadow: 0 0 0 3px rgba(var(--vp-c-brand-rgb), 0.1);
386
+ }
387
+
388
+ &:disabled {
389
+ opacity: 0.6;
390
+ cursor: not-allowed;
391
+ background-color: var(--vp-c-bg-soft);
392
+ }
393
+
394
+ &.error {
395
+ border-color: var(--vp-c-danger-1);
396
+
397
+ &:focus {
398
+ box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
399
+ }
400
+ }
401
+ }
402
+
403
+ /* 错误提示样式 */
404
+ .errorMessage {
405
+ margin-top: 0.25rem;
406
+ color: var(--vp-c-danger-1);
407
+ font-size: 0.75rem;
408
+ }
409
+
410
+ /* 简介文本框样式 */
411
+ .descriptionInput {
412
+ width: 100%;
413
+ padding: 0.5rem 0.75rem;
414
+ border: 1px solid var(--vp-c-divider);
415
+ border-radius: 6px;
416
+ background-color: var(--vp-c-bg);
417
+ color: var(--vp-c-text-1);
418
+ font-size: 0.875rem;
419
+ font-family: inherit;
420
+ line-height: 1.5;
421
+ resize: vertical;
422
+ min-height: 3rem;
423
+ transition: all 0.2s ease;
424
+
425
+ &:hover:not(:disabled) {
426
+ border-color: var(--vp-c-brand-1);
427
+ background-color: var(--vp-c-bg-soft);
428
+ }
429
+
430
+ &:focus {
431
+ outline: none;
432
+ border-color: var(--vp-c-brand-1);
433
+ box-shadow: 0 0 0 3px rgba(var(--vp-c-brand-rgb), 0.1);
434
+ }
435
+
436
+ &:disabled {
437
+ opacity: 0.6;
438
+ cursor: not-allowed;
439
+ background-color: var(--vp-c-bg-soft);
440
+ }
441
+ }
442
+ }
443
+
444
+ /* 宽屏样式:在 >=720px 时,改为左右两栏布局 */
445
+ @media (min-width: 720px) {
446
+ .timeModalContent {
447
+ gap: 1rem;
448
+
449
+ .timeLine {
450
+ flex-direction: row;
451
+ align-items: center;
452
+ justify-content: flex-start;
453
+ gap: 1rem;
454
+ }
455
+
456
+ .timeLabel {
457
+ width: 9.5rem;
458
+ text-align: left;
459
+ font-size: 1rem;
460
+ }
461
+
462
+ .timeValue {
463
+ flex: 1;
464
+ white-space: nowrap;
465
+ overflow: hidden;
466
+ text-overflow: ellipsis;
467
+ }
468
+ }
469
+ }
470
+
471
+ /* 更明显的可触控目标(移动端) */
472
+ @media (max-width: 520px) {
473
+ .timeModalContent {
474
+ gap: 0.9rem;
475
+
476
+ .timeLabel {
477
+ font-size: 1.02rem;
478
+ }
479
+
480
+ .timeValue {
481
+ font-size: 1rem;
482
+ }
483
+ }
484
+ }
485
+ </style>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <script setup lang="ts">
6
6
  import { useRoute, onContentUpdated } from 'vitepress'
7
- import { onMounted, onUnmounted } from 'vue'
7
+ import { onMounted, onUnmounted } from 'vue'
8
8
 
9
9
  import { icon__collapse } from '../../assets/icons'
10
10
 
@@ -115,8 +115,6 @@ function initTocCollapseByComments(
115
115
  // 创建折叠头部(可点击区域)
116
116
  const collapseHeader = document.createElement('div')
117
117
  collapseHeader.className = 'collapse-header toc-collapse-header'
118
- collapseHeader.setAttribute('role', 'button')
119
- collapseHeader.setAttribute('aria-label', '折叠/展开目录')
120
118
  collapseHeader.setAttribute('title', '点击折叠/展开目录')
121
119
 
122
120
  // 创建标签(折叠时显示)
@@ -127,7 +125,6 @@ function initTocCollapseByComments(
127
125
  // 创建折叠按钮
128
126
  const collapseButton = document.createElement('button')
129
127
  collapseButton.className = 'collapse-toggle toc-collapse-toggle'
130
- collapseButton.setAttribute('aria-hidden', 'true') // 装饰性,实际点击区域是 header
131
128
 
132
129
  // 使用 SVG 图标
133
130
  const collapseIcon = document.createElement('img')
@@ -249,8 +246,6 @@ function initTocCollapseByStructure(vpDoc: Element): boolean {
249
246
  // 创建折叠头部
250
247
  const collapseHeader = document.createElement('div')
251
248
  collapseHeader.className = 'collapse-header toc-collapse-header'
252
- collapseHeader.setAttribute('role', 'button')
253
- collapseHeader.setAttribute('aria-label', '折叠/展开目录')
254
249
  collapseHeader.setAttribute('title', '点击折叠/展开目录')
255
250
 
256
251
  // 创建标签
@@ -261,7 +256,6 @@ function initTocCollapseByStructure(vpDoc: Element): boolean {
261
256
  // 创建折叠按钮
262
257
  const collapseButton = document.createElement('button')
263
258
  collapseButton.className = 'collapse-toggle toc-collapse-toggle'
264
- collapseButton.setAttribute('aria-hidden', 'true')
265
259
 
266
260
  // 使用 SVG 图标
267
261
  const collapseIcon = document.createElement('img')
@@ -346,20 +340,15 @@ function initH2Collapse() {
346
340
 
347
341
  // 先清除可能存在的旧状态(避免状态冲突)
348
342
  h2.classList.remove('collapsible-h2', 'collapsed')
349
- h2.removeAttribute('role')
350
- h2.removeAttribute('aria-label')
351
343
  h2.removeAttribute('title')
352
344
 
353
345
  // 为 h2 添加可点击的类
354
346
  h2.classList.add('collapsible-h2')
355
- h2.setAttribute('role', 'button')
356
- h2.setAttribute('aria-label', '折叠/展开章节')
357
347
  h2.setAttribute('title', '点击折叠/展开章节')
358
348
 
359
349
  // 创建折叠按钮
360
350
  const collapseButton = document.createElement('button')
361
351
  collapseButton.className = 'collapse-toggle h2-collapse-toggle'
362
- collapseButton.setAttribute('aria-hidden', 'true') // 装饰性
363
352
 
364
353
  // 使用 SVG 图标
365
354
  const collapseIcon = document.createElement('img')
@@ -531,8 +520,6 @@ function cleanupCollapse() {
531
520
  // 清理 H2 标题上的类名和属性
532
521
  document.querySelectorAll('h2.collapsible-h2').forEach((h2) => {
533
522
  h2.classList.remove('collapsible-h2', 'collapsed')
534
- h2.removeAttribute('role')
535
- h2.removeAttribute('aria-label')
536
523
  h2.removeAttribute('title')
537
524
  })
538
525