@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
@@ -1,31 +1,31 @@
1
1
  <template>
2
- <div :class="$style.settingsWrapper">
3
- <section :class="$style.settingsSection">
4
- <div :class="$style.settingItem">
5
- <div :class="$style.settingMeta">
6
- <div :class="$style.labelLine">
7
- <span :class="$style.itemName">本地知识库路径</span>
8
- <span :class="$style.infoWrap">
9
- <span :class="$style.infoIcon">?</span>
10
- <span :class="$style.tooltip">
2
+ <div class="settingsWrapper">
3
+ <section class="settingsSection">
4
+ <div class="settingItem">
5
+ <div class="settingMeta">
6
+ <div class="labelLine">
7
+ <span class="itemName">本地知识库路径</span>
8
+ <span class="infoWrap">
9
+ <span class="infoIcon">?</span>
10
+ <span class="tooltip">
11
11
  适用于 PC 桌面环境,需要本地安装 VS Code。配置后可从页面快速打开本地笔记目录。
12
12
  </span>
13
13
  </span>
14
14
  </div>
15
- <span v-if="path" :class="$style.statusText">已配置</span>
15
+ <span v-if="path" class="statusText">已配置</span>
16
16
  </div>
17
17
 
18
- <div :class="$style.inputGroup">
18
+ <div class="inputGroup">
19
19
  <input
20
20
  v-model="path"
21
21
  type="text"
22
22
  placeholder="/Users/username/notes"
23
- :class="$style.input"
23
+ class="input"
24
24
  />
25
25
  <button
26
26
  v-if="path"
27
27
  @click="clearPath"
28
- :class="$style.clearBtn"
28
+ class="clearBtn"
29
29
  title="清空"
30
30
  type="button"
31
31
  >
@@ -34,39 +34,39 @@
34
34
  </div>
35
35
  </div>
36
36
 
37
- <div :class="$style.settingItem">
38
- <div :class="$style.settingMeta">
39
- <div :class="$style.labelLine">
40
- <span :class="$style.itemName">侧边栏目录</span>
41
- <span :class="$style.infoWrap">
42
- <span :class="$style.infoIcon">?</span>
43
- <span :class="$style.tooltip">
37
+ <div class="settingItem">
38
+ <div class="settingMeta">
39
+ <div class="labelLine">
40
+ <span class="itemName">侧边栏目录</span>
41
+ <span class="infoWrap">
42
+ <span class="infoIcon">?</span>
43
+ <span class="tooltip">
44
44
  控制侧边栏笔记编号显示,以及目录行距密度。保存后会刷新页面以应用侧边栏配置。
45
45
  </span>
46
46
  </span>
47
47
  </div>
48
- <span v-if="showNoteId" :class="$style.statusText">显示编号</span>
48
+ <span v-if="showNoteId" class="statusText">显示编号</span>
49
49
  </div>
50
50
 
51
- <div :class="$style.fieldStack">
52
- <label :class="$style.checkRow">
51
+ <div class="fieldStack">
52
+ <label class="checkRow">
53
53
  <input
54
54
  v-model="showNoteId"
55
55
  type="checkbox"
56
- :class="$style.checkbox"
56
+ class="checkbox"
57
57
  />
58
58
  <span>显示笔记编号</span>
59
59
  </label>
60
60
 
61
- <div :class="$style.controlRow">
62
- <span :class="$style.controlLabel">目录风格</span>
63
- <div :class="$style.segmented">
61
+ <div class="controlRow">
62
+ <span class="controlLabel">目录风格</span>
63
+ <div class="segmented">
64
64
  <label
65
65
  v-for="option in sidebarDensityOptions"
66
66
  :key="option.value"
67
67
  :class="[
68
- $style.segment,
69
- { [$style.activeSegment]: sidebarDensity === option.value },
68
+ 'segment',
69
+ { activeSegment: sidebarDensity === option.value },
70
70
  ]"
71
71
  >
72
72
  <input
@@ -80,77 +80,78 @@
80
80
  </div>
81
81
  </div>
82
82
 
83
- <div :class="$style.prefixGrid">
84
- <label :class="$style.field">
85
- <span :class="$style.controlLabel">已完成笔记的前缀</span>
83
+ <div class="prefixGrid">
84
+ <label class="field">
85
+ <span class="controlLabel">已完成笔记的前缀</span>
86
86
  <input
87
87
  v-model="donePrefix"
88
88
  type="text"
89
89
  placeholder="可留空"
90
- :class="[$style.input, $style.prefixInput]"
90
+ class="input prefixInput"
91
91
  />
92
92
  </label>
93
93
 
94
- <label :class="$style.field">
95
- <span :class="$style.controlLabel">未完成笔记前缀</span>
94
+ <label class="field">
95
+ <span class="controlLabel">未完成笔记前缀</span>
96
96
  <input
97
97
  v-model="undonePrefix"
98
98
  type="text"
99
99
  placeholder="可留空"
100
- :class="[$style.input, $style.prefixInput]"
100
+ class="input prefixInput"
101
101
  />
102
102
  </label>
103
103
  </div>
104
104
  </div>
105
105
  </div>
106
106
 
107
- <div :class="$style.settingItem">
108
- <div :class="$style.settingMeta">
109
- <div :class="$style.labelLine">
110
- <span :class="$style.itemName">MarkMap 思维导图</span>
111
- <span :class="$style.infoWrap">
112
- <span :class="$style.infoIcon">?</span>
113
- <span :class="$style.tooltip">
107
+ <div class="settingItem">
108
+ <div class="settingMeta">
109
+ <div class="labelLine">
110
+ <span class="itemName">MarkMap 思维导图</span>
111
+ <span class="infoWrap">
112
+ <span class="infoIcon">?</span>
113
+ <span class="tooltip">
114
114
  配置 MarkMap 的默认分支配色和初始展开层级。
115
115
  </span>
116
116
  </span>
117
117
  </div>
118
118
  </div>
119
119
 
120
- <div :class="$style.inlineGrid">
121
- <label :class="$style.field">
122
- <span :class="$style.controlLabel">分支主题</span>
123
- <select v-model="markmapTheme" :class="$style.select">
120
+ <div class="inlineGrid">
121
+ <label class="field">
122
+ <span class="controlLabel">分支主题</span>
123
+ <select v-model="markmapTheme" class="select">
124
124
  <option value="default">默认</option>
125
125
  <option value="colorful">多彩</option>
126
126
  <option value="dark">深色</option>
127
127
  </select>
128
128
  </label>
129
129
 
130
- <label :class="$style.field">
131
- <span :class="$style.controlLabel">展开层级</span>
132
- <div :class="$style.inputWithUnit">
130
+ <label class="field">
131
+ <span class="controlLabel">展开层级</span>
132
+ <div class="inputWithUnit">
133
133
  <input
134
134
  v-model.number="markmapExpandLevel"
135
135
  type="number"
136
136
  min="1"
137
137
  max="100"
138
- :class="$style.input"
138
+ class="input"
139
139
  />
140
- <span :class="$style.unit">层</span>
140
+ <span class="unit">层</span>
141
141
  </div>
142
142
  </label>
143
143
  </div>
144
144
  </div>
145
145
  </section>
146
146
 
147
- <div :class="$style.actionBar">
148
- <button v-if="hasChanges" @click="reset" :class="$style.resetBtn">
147
+ <div class="actionBar">
148
+ <button v-if="hasChanges" @click="reset" class="resetBtn">
149
149
  重置
150
150
  </button>
151
151
  <button
152
152
  @click="save"
153
- :class="[$style.saveBtn, { [$style.disabled]: !hasChanges }]"
153
+ class="saveBtn"
154
+ :class="{ disabled: !hasChanges }"
154
155
  :disabled="!hasChanges"
155
156
  >
156
157
  {{ saveText }}
@@ -158,7 +159,7 @@
158
159
  </div>
159
160
 
160
161
  <Transition name="toast">
161
- <div v-if="showSuccessToast" :class="$style.toast">保存成功</div>
162
+ <div v-if="showSuccessToast" class="toast">保存成功</div>
162
163
  </Transition>
163
164
  </div>
164
165
  </template>
@@ -331,4 +332,380 @@ function reset() {
331
332
  }
332
333
  </script>
333
334
 
334
- <style module src="./Settings.module.scss"></style>
335
+ <style scoped lang="scss">
336
+ .settingsWrapper {
337
+ max-width: 680px;
338
+ margin: 0 auto;
339
+ padding: 12px 4px 0;
340
+ }
341
+
342
+ .settingsSection {
343
+ border-top: 1px solid var(--vp-c-divider);
344
+ }
345
+
346
+ .settingItem {
347
+ display: grid;
348
+ grid-template-columns: minmax(150px, 0.42fr) minmax(220px, 1fr);
349
+ gap: 18px;
350
+ padding: 18px 0;
351
+ border-bottom: 1px solid var(--vp-c-divider);
352
+ }
353
+
354
+ .settingMeta {
355
+ min-width: 0;
356
+ }
357
+
358
+ .labelLine {
359
+ display: flex;
360
+ align-items: center;
361
+ gap: 6px;
362
+ }
363
+
364
+ .itemName {
365
+ color: var(--vp-c-text-1);
366
+ font-size: 14px;
367
+ font-weight: 600;
368
+ line-height: 22px;
369
+ }
370
+
371
+ .statusText {
372
+ display: inline-block;
373
+ margin-top: 4px;
374
+ color: var(--vp-c-text-3);
375
+ font-size: 12px;
376
+ line-height: 18px;
377
+ }
378
+
379
+ .infoWrap {
380
+ position: relative;
381
+ display: inline-flex;
382
+ }
383
+
384
+ .infoIcon {
385
+ display: inline-flex;
386
+ align-items: center;
387
+ justify-content: center;
388
+ width: 16px;
389
+ height: 16px;
390
+ color: var(--vp-c-text-3);
391
+ border: 1px solid var(--vp-c-divider);
392
+ border-radius: 50%;
393
+ cursor: help;
394
+ font-size: 11px;
395
+ line-height: 1;
396
+ }
397
+
398
+ .tooltip {
399
+ position: absolute;
400
+ left: 50%;
401
+ bottom: calc(100% + 8px);
402
+ z-index: 10;
403
+ width: 240px;
404
+ padding: 8px 10px;
405
+ color: var(--vp-c-text-1);
406
+ background: var(--vp-c-bg-elv);
407
+ border: 1px solid var(--vp-c-divider);
408
+ border-radius: 6px;
409
+ box-shadow: var(--vp-shadow-2);
410
+ font-size: 12px;
411
+ line-height: 18px;
412
+ opacity: 0;
413
+ pointer-events: none;
414
+ transform: translate(-50%, 4px);
415
+ transition:
416
+ opacity 0.15s ease,
417
+ transform 0.15s ease;
418
+ }
419
+
420
+ .infoWrap:hover .tooltip,
421
+ .infoWrap:focus-within .tooltip {
422
+ opacity: 1;
423
+ transform: translate(-50%, 0);
424
+ }
425
+
426
+ .inputGroup {
427
+ position: relative;
428
+ }
429
+
430
+ .input,
431
+ .select {
432
+ width: 100%;
433
+ height: 34px;
434
+ box-sizing: border-box;
435
+ color: var(--vp-c-text-1);
436
+ background: var(--vp-c-bg);
437
+ border: 1px solid var(--vp-c-divider);
438
+ border-radius: 6px;
439
+ font-size: 13px;
440
+ outline: none;
441
+ }
442
+
443
+ .input {
444
+ padding: 0 34px 0 10px;
445
+ font-family: var(--vp-font-family-mono);
446
+ }
447
+
448
+ .select {
449
+ padding: 0 10px;
450
+ cursor: pointer;
451
+ }
452
+
453
+ .input::placeholder {
454
+ color: var(--vp-c-text-3);
455
+ }
456
+
457
+ .input:focus,
458
+ .select:focus {
459
+ border-color: var(--vp-c-brand-1);
460
+ }
461
+
462
+ .clearBtn {
463
+ position: absolute;
464
+ top: 50%;
465
+ right: 7px;
466
+ display: inline-flex;
467
+ align-items: center;
468
+ justify-content: center;
469
+ width: 20px;
470
+ height: 20px;
471
+ padding: 0;
472
+ color: var(--vp-c-text-3);
473
+ background: transparent;
474
+ border: none;
475
+ border-radius: 4px;
476
+ cursor: pointer;
477
+ font-size: 16px;
478
+ transform: translateY(-50%);
479
+ }
480
+
481
+ .clearBtn:hover {
482
+ color: var(--vp-c-danger-1);
483
+ background: var(--vp-c-danger-soft);
484
+ }
485
+
486
+ .fieldStack {
487
+ display: flex;
488
+ flex-direction: column;
489
+ gap: 12px;
490
+ }
491
+
492
+ .checkRow {
493
+ display: inline-flex;
494
+ align-items: center;
495
+ gap: 8px;
496
+ width: max-content;
497
+ color: var(--vp-c-text-1);
498
+ cursor: pointer;
499
+ font-size: 13px;
500
+ line-height: 20px;
501
+ user-select: none;
502
+ }
503
+
504
+ .checkbox {
505
+ width: 16px;
506
+ height: 16px;
507
+ margin: 0;
508
+ accent-color: var(--vp-c-brand-1);
509
+ cursor: pointer;
510
+ }
511
+
512
+ .controlRow,
513
+ .field {
514
+ display: flex;
515
+ flex-direction: column;
516
+ gap: 6px;
517
+ }
518
+
519
+ .controlLabel {
520
+ color: var(--vp-c-text-2);
521
+ font-size: 12px;
522
+ line-height: 18px;
523
+ }
524
+
525
+ .segmented {
526
+ display: grid;
527
+ grid-template-columns: repeat(3, 1fr);
528
+ overflow: hidden;
529
+ border: 1px solid var(--vp-c-divider);
530
+ border-radius: 6px;
531
+ }
532
+
533
+ .segment {
534
+ display: inline-flex;
535
+ align-items: center;
536
+ justify-content: center;
537
+ min-width: 0;
538
+ height: 32px;
539
+ color: var(--vp-c-text-2);
540
+ border-right: 1px solid var(--vp-c-divider);
541
+ cursor: pointer;
542
+ font-size: 13px;
543
+ user-select: none;
544
+ }
545
+
546
+ .segment:last-child {
547
+ border-right: none;
548
+ }
549
+
550
+ .segment input {
551
+ position: absolute;
552
+ opacity: 0;
553
+ pointer-events: none;
554
+ }
555
+
556
+ .segment:hover,
557
+ .activeSegment {
558
+ color: var(--vp-c-brand-1);
559
+ background: var(--vp-c-default-soft);
560
+ }
561
+
562
+ .activeSegment {
563
+ font-weight: 600;
564
+ }
565
+
566
+ .inlineGrid {
567
+ display: grid;
568
+ grid-template-columns: 1fr 120px;
569
+ gap: 12px;
570
+ }
571
+
572
+ .prefixGrid {
573
+ display: grid;
574
+ grid-template-columns: repeat(2, minmax(0, 1fr));
575
+ gap: 12px;
576
+ }
577
+
578
+ .prefixInput {
579
+ padding-right: 10px;
580
+ font-family: var(--vp-font-family-base);
581
+ }
582
+
583
+ .inputWithUnit {
584
+ position: relative;
585
+ }
586
+
587
+ .inputWithUnit .input {
588
+ padding-right: 34px;
589
+ }
590
+
591
+ .unit {
592
+ position: absolute;
593
+ top: 50%;
594
+ right: 10px;
595
+ color: var(--vp-c-text-3);
596
+ font-size: 12px;
597
+ pointer-events: none;
598
+ transform: translateY(-50%);
599
+ }
600
+
601
+ .actionBar {
602
+ display: flex;
603
+ justify-content: flex-end;
604
+ gap: 8px;
605
+ padding-top: 16px;
606
+ }
607
+
608
+ .saveBtn,
609
+ .resetBtn {
610
+ display: inline-flex;
611
+ align-items: center;
612
+ justify-content: center;
613
+ min-width: 72px;
614
+ height: 34px;
615
+ padding: 0 14px;
616
+ border-radius: 6px;
617
+ cursor: pointer;
618
+ font-size: 13px;
619
+ font-weight: 500;
620
+ }
621
+
622
+ .saveBtn {
623
+ color: #fff;
624
+ background: var(--vp-c-brand-1);
625
+ border: 1px solid var(--vp-c-brand-1);
626
+ }
627
+
628
+ .saveBtn:hover:not(.disabled) {
629
+ background: var(--vp-c-brand-2);
630
+ }
631
+
632
+ .saveBtn.disabled {
633
+ opacity: 0.45;
634
+ cursor: not-allowed;
635
+ }
636
+
637
+ .resetBtn {
638
+ color: var(--vp-c-text-1);
639
+ background: var(--vp-c-bg);
640
+ border: 1px solid var(--vp-c-divider);
641
+ }
642
+
643
+ .resetBtn:hover {
644
+ border-color: var(--vp-c-brand-1);
645
+ }
646
+
647
+ .toast {
648
+ position: fixed;
649
+ top: 78px;
650
+ left: 50%;
651
+ z-index: 1000;
652
+ padding: 8px 12px;
653
+ color: #fff;
654
+ background: var(--vp-c-brand-1);
655
+ border-radius: 6px;
656
+ box-shadow: var(--vp-shadow-2);
657
+ font-size: 13px;
658
+ transform: translateX(-50%);
659
+ }
660
+
661
+ :global(.toast-enter-active),
662
+ :global(.toast-leave-active) {
663
+ transition: all 0.2s ease;
664
+ }
665
+
666
+ :global(.toast-enter-from),
667
+ :global(.toast-leave-to) {
668
+ opacity: 0;
669
+ transform: translate(-50%, -8px);
670
+ }
671
+
672
+ @media (max-width: 768px) {
673
+ .settingsWrapper {
674
+ padding: 0;
675
+ }
676
+
677
+ .settingItem {
678
+ grid-template-columns: 1fr;
679
+ gap: 10px;
680
+ padding: 16px 0;
681
+ }
682
+
683
+ .inlineGrid {
684
+ grid-template-columns: 1fr;
685
+ }
686
+
687
+ .prefixGrid {
688
+ grid-template-columns: 1fr;
689
+ }
690
+
691
+ .tooltip {
692
+ left: 0;
693
+ width: min(260px, calc(100vw - 48px));
694
+ transform: translate(0, 4px);
695
+ }
696
+
697
+ .infoWrap:hover .tooltip,
698
+ .infoWrap:focus-within .tooltip {
699
+ transform: translate(0, 0);
700
+ }
701
+
702
+ .actionBar {
703
+ flex-direction: column-reverse;
704
+ }
705
+
706
+ .saveBtn,
707
+ .resetBtn {
708
+ width: 100%;
709
+ }
710
+ }
711
+ </style>
@@ -5,9 +5,6 @@
5
5
  <div
6
6
  v-if="state.visible"
7
7
  class="tnotes-settings-overlay"
8
- role="dialog"
9
- aria-modal="true"
10
- aria-labelledby="tnotes-settings-title"
11
8
  @click.self="close"
12
9
  >
13
10
  <div
@@ -15,15 +12,12 @@
15
12
  :class="{ 'is-fullscreen': state.fullscreen }"
16
13
  >
17
14
  <header class="tnotes-settings-header">
18
- <h2 id="tnotes-settings-title" class="tnotes-settings-title">
19
- ⚙️ 设置
20
- </h2>
15
+ <h2 class="tnotes-settings-title">⚙️ 设置</h2>
21
16
  <div class="tnotes-settings-actions">
22
17
  <button
23
18
  type="button"
24
19
  class="tnotes-settings-icon-btn"
25
20
  :title="state.fullscreen ? '退出全屏' : '全屏'"
26
- :aria-label="state.fullscreen ? '退出全屏' : '全屏'"
27
21
  @click="toggleFullscreen"
28
22
  >
29
23
  <svg
@@ -36,7 +30,6 @@
36
30
  stroke-width="2"
37
31
  stroke-linecap="round"
38
32
  stroke-linejoin="round"
39
- aria-hidden="true"
40
33
  >
41
34
  <path d="M4 9V4h5" />
42
35
  <path d="M20 9V4h-5" />
@@ -53,7 +46,6 @@
53
46
  stroke-width="2"
54
47
  stroke-linecap="round"
55
48
  stroke-linejoin="round"
56
- aria-hidden="true"
57
49
  >
58
50
  <path d="M9 4v5H4" />
59
51
  <path d="M15 4v5h5" />
@@ -65,7 +57,6 @@
65
57
  type="button"
66
58
  class="tnotes-settings-icon-btn"
67
59
  title="关闭"
68
- aria-label="关闭"
69
60
  @click="close"
70
61
  >
71
62
  <svg
@@ -77,7 +68,6 @@
77
68
  stroke-width="2"
78
69
  stroke-linecap="round"
79
70
  stroke-linejoin="round"
80
- aria-hidden="true"
81
71
  >
82
72
  <line x1="18" y1="6" x2="6" y2="18" />
83
73
  <line x1="6" y1="6" x2="18" y2="18" />