@tnotesjs/core 0.0.7 → 0.1.14

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 (53) hide show
  1. package/README.md +6 -3
  2. package/dist/{chunk-JDVN2QYW.js → chunk-FVKQPBPP.js} +643 -546
  3. package/dist/{chunk-NASIL5FY.js → chunk-SQVHJR2Z.js} +0 -4
  4. package/dist/cli/index.js +126 -126
  5. package/dist/index.js +1 -1
  6. package/dist/vitepress/config/index.js +229 -208
  7. package/package.json +16 -3
  8. package/types/shims.d.ts +3 -4
  9. package/vitepress/components/CodeBlockFullscreen/CodeBlockFullscreen.vue +2 -1
  10. package/vitepress/components/CodeBlockFullscreen/index.ts +2 -1
  11. package/vitepress/components/Discussions/Discussions.vue +3 -2
  12. package/vitepress/components/EnWordList/EnWordList.vue +2 -1
  13. package/vitepress/components/Layout/AboutModal.vue +1 -1
  14. package/vitepress/components/Layout/AboutPanel.vue +8 -3
  15. package/vitepress/components/Layout/ContentCollapse.vue +2 -1
  16. package/vitepress/components/Layout/CustomSidebar.vue +7 -4
  17. package/vitepress/components/Layout/DocBeforeControls.vue +4 -4
  18. package/vitepress/components/Layout/DocFooter.vue +2 -1
  19. package/vitepress/components/Layout/ImagePreview.vue +2 -1
  20. package/vitepress/components/Layout/Layout.vue +38 -20
  21. package/vitepress/components/Layout/NoteStatus.vue +2 -1
  22. package/vitepress/components/Layout/SidebarItems.vue +7 -2
  23. package/vitepress/components/Layout/SidebarNavBefore.vue +22 -0
  24. package/vitepress/components/Layout/ToggleFullContent.vue +2 -1
  25. package/vitepress/components/Layout/ToggleSidebar.vue +2 -1
  26. package/vitepress/components/Layout/composables/useCollapseControl.ts +1 -1
  27. package/vitepress/components/Layout/composables/useNoteConfig.ts +2 -4
  28. package/vitepress/components/Layout/composables/useNoteSave.ts +23 -18
  29. package/vitepress/components/Layout/composables/useRedirect.ts +8 -5
  30. package/vitepress/components/Layout/composables/useRenameOverlay.ts +33 -0
  31. package/vitepress/components/Layout/composables/useRenameRedirect.ts +59 -0
  32. package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +7 -4
  33. package/vitepress/components/Layout/homeReadme.data.ts +1 -1
  34. package/vitepress/components/LoadingPage/LoadingPage.vue +84 -192
  35. package/vitepress/components/MarkMap/MarkMap.vue +5 -4
  36. package/vitepress/components/Mermaid/Mermaid.vue +4 -2
  37. package/vitepress/components/NotesTable/NotesTable.vue +2 -1
  38. package/vitepress/components/Settings/Settings.vue +2 -1
  39. package/vitepress/components/Settings/SettingsDialog.vue +243 -0
  40. package/vitepress/components/Settings/composables/useSettingsDialog.ts +35 -0
  41. package/vitepress/components/SidebarCard/MindMapView.vue +10 -9
  42. package/vitepress/components/SidebarCard/SidebarCard.vue +12 -14
  43. package/vitepress/config/index.ts +11 -4
  44. package/vitepress/configs/head.config.ts +2 -1
  45. package/vitepress/configs/markdown-it.d.ts +6 -3
  46. package/vitepress/configs/markdown.config.ts +6 -5
  47. package/vitepress/configs/theme.config.ts +1 -1
  48. package/vitepress/plugins/buildProgressPlugin.ts +2 -38
  49. package/vitepress/plugins/fileWatcherBridgePlugin.ts +49 -0
  50. package/vitepress/plugins/getNoteByConfigIdPlugin.ts +3 -2
  51. package/vitepress/plugins/renameNotePlugin.ts +9 -1
  52. package/vitepress/plugins/updateConfigPlugin.ts +2 -1
  53. package/vitepress/theme/index.ts +45 -3
@@ -1,192 +1,84 @@
1
- <template>
2
- <div class="loading-page">
3
- <div class="loading-container">
4
- <div class="spinner"></div>
5
- <h2>{{ message }}</h2>
6
- <p class="tip">{{ tip }}</p>
7
- <p v-if="!error" class="countdown">{{ countdown }}秒后自动跳转</p>
8
- <p v-if="error" class="error-msg">{{ error }}</p>
9
- <button class="back-home-btn" @click="goHome">返回首页</button>
10
- </div>
11
- </div>
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import { ref, onMounted, onUnmounted } from 'vue'
16
- import { useData } from 'vitepress'
17
-
18
- const props = defineProps<{
19
- targetUrl?: string
20
- message?: string
21
- }>()
22
-
23
- const message = ref(props.message || '正在处理笔记更新')
24
- const tip = ref('请稍候,正在处理中...')
25
- const countdown = ref(2)
26
- const error = ref('')
27
- const { site } = useData()
28
-
29
- let timer: NodeJS.Timeout | null = null
30
- let countdownTimer: NodeJS.Timeout | null = null
31
-
32
- function goHome() {
33
- const base = site.value.base || '/'
34
- window.location.href = base
35
- }
36
-
37
- async function fetchNoteInfo(configId: string) {
38
- try {
39
- const response = await fetch(
40
- `/__tnotes_get_note?configId=${encodeURIComponent(configId)}`
41
- )
42
- const result = await response.json()
43
-
44
- if (!result.success) {
45
- throw new Error(result.error || '查询笔记信息失败')
46
- }
47
-
48
- if (!result.found) {
49
- // 笔记不存在或已被删除,跳转到首页
50
- tip.value = '笔记不存在或已被删除,即将跳转到首页'
51
- const base = site.value.base || '/'
52
- return base + 'README'
53
- }
54
-
55
- // 返回笔记的 URL
56
- const base = site.value.base || '/'
57
- return base + result.data.url.slice(1) // 移除开头的 /
58
- } catch (err) {
59
- error.value = err instanceof Error ? err.message : String(err)
60
- tip.value = '获取笔记信息失败'
61
- throw err
62
- }
63
- }
64
-
65
- onMounted(async () => {
66
- try {
67
- // URL 参数获取 configId 或直接的 target
68
- const params = new URLSearchParams(window.location.search)
69
- const configId = params.get('configId')
70
- const target = params.get('target')
71
-
72
- let targetUrl: string
73
-
74
- if (configId) {
75
- // 使用 configId 查询笔记信息
76
- tip.value = '正在查询笔记信息...'
77
- targetUrl = await fetchNoteInfo(configId)
78
- } else if (target) {
79
- // 使用直接提供的 target URL
80
- targetUrl = decodeURIComponent(target)
81
- } else if (props.targetUrl) {
82
- // 使用 props 传入的 URL
83
- targetUrl = props.targetUrl
84
- } else {
85
- // 没有提供任何参数,直接跳转到首页
86
- const base = site.value.base || '/'
87
- targetUrl = base + 'README'
88
- tip.value = '参数缺失,即将跳转到首页'
89
- }
90
-
91
- // 倒计时
92
- countdownTimer = setInterval(() => {
93
- countdown.value--
94
- if (countdown.value <= 0 && countdownTimer) {
95
- clearInterval(countdownTimer)
96
- }
97
- }, 1000)
98
-
99
- // 等待2秒后跳转到目标页面
100
- timer = setTimeout(() => {
101
- window.location.href = targetUrl
102
- }, 2000)
103
- } catch (err) {
104
- console.error('Loading page error:', err)
105
- // 发生错误时,延迟跳转到首页
106
- setTimeout(() => {
107
- goHome()
108
- }, 3000)
109
- }
110
- })
111
-
112
- onUnmounted(() => {
113
- if (timer) clearTimeout(timer)
114
- if (countdownTimer) clearInterval(countdownTimer)
115
- })
116
- </script>
117
-
118
- <style scoped>
119
- .loading-page {
120
- position: fixed;
121
- top: 0;
122
- left: 0;
123
- right: 0;
124
- bottom: 0;
125
- background: var(--vp-c-bg);
126
- display: flex;
127
- align-items: center;
128
- justify-content: center;
129
- z-index: 9999;
130
- }
131
-
132
- .loading-container {
133
- text-align: center;
134
- padding: 2rem;
135
- }
136
-
137
- .spinner {
138
- width: 60px;
139
- height: 60px;
140
- margin: 0 auto 2rem;
141
- border: 4px solid var(--vp-c-divider);
142
- border-top-color: var(--vp-c-brand-1);
143
- border-radius: 50%;
144
- animation: spin 1s linear infinite;
145
- }
146
-
147
- @keyframes spin {
148
- to {
149
- transform: rotate(360deg);
150
- }
151
- }
152
-
153
- h2 {
154
- font-size: 1.5rem;
155
- color: var(--vp-c-text-1);
156
- margin-bottom: 0.5rem;
157
- }
158
-
159
- .tip {
160
- color: var(--vp-c-text-2);
161
- font-size: 0.9rem;
162
- margin-bottom: 1rem;
163
- }
164
-
165
- .countdown {
166
- color: var(--vp-c-brand-1);
167
- font-size: 1rem;
168
- margin-bottom: 1.5rem;
169
- font-weight: 500;
170
- }
171
-
172
- .error-msg {
173
- color: var(--vp-c-danger-1);
174
- font-size: 0.9rem;
175
- margin-bottom: 1.5rem;
176
- }
177
-
178
- .back-home-btn {
179
- padding: 0.5rem 1.5rem;
180
- background-color: var(--vp-c-brand-1);
181
- color: white;
182
- border: none;
183
- border-radius: 4px;
184
- cursor: pointer;
185
- font-size: 0.9rem;
186
- transition: background-color 0.2s;
187
- }
188
-
189
- .back-home-btn:hover {
190
- background-color: var(--vp-c-brand-2);
191
- }
192
- </style>
1
+ <template>
2
+ <ClientOnly>
3
+ <Teleport to="body">
4
+ <div
5
+ v-if="visible"
6
+ class="tnotes-loading-overlay"
7
+ role="alert"
8
+ aria-live="polite"
9
+ >
10
+ <div class="loading-container">
11
+ <div class="spinner"></div>
12
+ <h2>{{ message }}</h2>
13
+ <p v-if="tip" class="tip">{{ tip }}</p>
14
+ </div>
15
+ </div>
16
+ </Teleport>
17
+ </ClientOnly>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ withDefaults(
22
+ defineProps<{
23
+ /** 是否显示遮罩,默认显示 */
24
+ visible?: boolean
25
+ /** 主标题 */
26
+ message?: string
27
+ /** 副提示文本 */
28
+ tip?: string
29
+ }>(),
30
+ {
31
+ visible: true,
32
+ message: '正在处理...',
33
+ tip: '',
34
+ },
35
+ )
36
+ </script>
37
+
38
+ <style scoped>
39
+ .tnotes-loading-overlay {
40
+ position: fixed;
41
+ top: 0;
42
+ left: 0;
43
+ right: 0;
44
+ bottom: 0;
45
+ background: var(--vp-c-bg);
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ z-index: 9999;
50
+ }
51
+
52
+ .loading-container {
53
+ text-align: center;
54
+ padding: 2rem;
55
+ }
56
+
57
+ .spinner {
58
+ width: 60px;
59
+ height: 60px;
60
+ margin: 0 auto 2rem;
61
+ border: 4px solid var(--vp-c-divider);
62
+ border-top-color: var(--vp-c-brand-1);
63
+ border-radius: 50%;
64
+ animation: tnotes-loading-spin 1s linear infinite;
65
+ }
66
+
67
+ @keyframes tnotes-loading-spin {
68
+ to {
69
+ transform: rotate(360deg);
70
+ }
71
+ }
72
+
73
+ h2 {
74
+ font-size: 1.5rem;
75
+ color: var(--vp-c-text-1);
76
+ margin-bottom: 0.5rem;
77
+ }
78
+
79
+ .tip {
80
+ color: var(--vp-c-text-2);
81
+ font-size: 0.9rem;
82
+ margin-bottom: 0;
83
+ }
84
+ </style>
@@ -1,14 +1,15 @@
1
1
  <script setup lang="ts">
2
- import { ref, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'
2
+ import { scaleOrdinal, schemePastel2, schemeSet3, schemeTableau10 } from 'd3'
3
3
  import { Transformer } from 'markmap-lib'
4
- import { Markmap, IMarkmapOptions } from 'markmap-view'
5
4
  import { Toolbar } from 'markmap-toolbar'
6
5
  import 'markmap-toolbar/dist/style.css'
7
- import { MARKMAP_THEME_KEY, MARKMAP_EXPAND_LEVEL_KEY } from '../constants'
6
+ import { Markmap, IMarkmapOptions } from 'markmap-view'
7
+ import { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
8
+
8
9
  import { icon__fullscreen, icon__fullscreen_exit, icon__confirm } from '../../assets/icons'
10
+ import { MARKMAP_THEME_KEY, MARKMAP_EXPAND_LEVEL_KEY } from '../constants'
9
11
 
10
12
  // doc: https://github.com/markmap/markmap/blob/205367a24603dc187f67da1658940c6cade20dce/packages/markmap-view/src/constants.ts#L15
11
- import { scaleOrdinal, schemePastel2, schemeSet3, schemeTableau10 } from 'd3'
12
13
 
13
14
  const props = defineProps({
14
15
  content: { type: String, default: '' },
@@ -88,7 +88,8 @@
88
88
 
89
89
  <script setup lang="ts">
90
90
  import mermaid from 'mermaid'
91
- import { nextTick, onMounted, onBeforeUnmount, ref, watch } from 'vue'
91
+ import { nextTick, onMounted, onBeforeUnmount, ref, watch } from 'vue'
92
+
92
93
  import {
93
94
  icon__zoom_in,
94
95
  icon__zoom_out,
@@ -293,7 +294,8 @@ const renderDiagram = async () => {
293
294
  bindFunctions(diagramRef.value)
294
295
  }
295
296
  } catch (err) {
296
- error.value = `Failed to render diagram: ${err.message}`
297
+ const message = err instanceof Error ? err.message : String(err)
298
+ error.value = `Failed to render diagram: ${message}`
297
299
  console.error('Mermaid render error:', err)
298
300
  } finally {
299
301
  loading.value = false
@@ -35,8 +35,9 @@
35
35
  </template>
36
36
 
37
37
  <script setup lang="ts">
38
- import { computed } from 'vue'
39
38
  import { useData } from 'vitepress'
39
+ import { computed } from 'vue'
40
+
40
41
  // @ts-expect-error - VitePress data loader exports data at runtime
41
42
  import { data as allNotesConfig } from '../notesConfig.data.ts'
42
43
 
@@ -152,7 +152,8 @@
152
152
  </template>
153
153
 
154
154
  <script setup lang="ts">
155
- import { ref, computed, onMounted } from 'vue'
155
+ import { ref, computed, onMounted } from 'vue'
156
+
156
157
  import {
157
158
  NOTES_DIR_KEY,
158
159
  MARKMAP_THEME_KEY,
@@ -0,0 +1,243 @@
1
+ <template>
2
+ <ClientOnly>
3
+ <Teleport to="body">
4
+ <Transition name="tnotes-settings-dialog">
5
+ <div
6
+ v-if="state.visible"
7
+ class="tnotes-settings-overlay"
8
+ role="dialog"
9
+ aria-modal="true"
10
+ aria-labelledby="tnotes-settings-title"
11
+ @click.self="close"
12
+ >
13
+ <div
14
+ class="tnotes-settings-dialog"
15
+ :class="{ 'is-fullscreen': state.fullscreen }"
16
+ >
17
+ <header class="tnotes-settings-header">
18
+ <h2 id="tnotes-settings-title" class="tnotes-settings-title">
19
+ ⚙️ 设置
20
+ </h2>
21
+ <div class="tnotes-settings-actions">
22
+ <button
23
+ type="button"
24
+ class="tnotes-settings-icon-btn"
25
+ :title="state.fullscreen ? '退出全屏' : '全屏'"
26
+ :aria-label="state.fullscreen ? '退出全屏' : '全屏'"
27
+ @click="toggleFullscreen"
28
+ >
29
+ <svg
30
+ v-if="!state.fullscreen"
31
+ width="18"
32
+ height="18"
33
+ viewBox="0 0 24 24"
34
+ fill="none"
35
+ stroke="currentColor"
36
+ stroke-width="2"
37
+ stroke-linecap="round"
38
+ stroke-linejoin="round"
39
+ aria-hidden="true"
40
+ >
41
+ <path d="M4 9V4h5" />
42
+ <path d="M20 9V4h-5" />
43
+ <path d="M4 15v5h5" />
44
+ <path d="M20 15v5h-5" />
45
+ </svg>
46
+ <svg
47
+ v-else
48
+ width="18"
49
+ height="18"
50
+ viewBox="0 0 24 24"
51
+ fill="none"
52
+ stroke="currentColor"
53
+ stroke-width="2"
54
+ stroke-linecap="round"
55
+ stroke-linejoin="round"
56
+ aria-hidden="true"
57
+ >
58
+ <path d="M9 4v5H4" />
59
+ <path d="M15 4v5h5" />
60
+ <path d="M9 20v-5H4" />
61
+ <path d="M15 20v-5h5" />
62
+ </svg>
63
+ </button>
64
+ <button
65
+ type="button"
66
+ class="tnotes-settings-icon-btn"
67
+ title="关闭"
68
+ aria-label="关闭"
69
+ @click="close"
70
+ >
71
+ <svg
72
+ width="18"
73
+ height="18"
74
+ viewBox="0 0 24 24"
75
+ fill="none"
76
+ stroke="currentColor"
77
+ stroke-width="2"
78
+ stroke-linecap="round"
79
+ stroke-linejoin="round"
80
+ aria-hidden="true"
81
+ >
82
+ <line x1="18" y1="6" x2="6" y2="18" />
83
+ <line x1="6" y1="6" x2="18" y2="18" />
84
+ </svg>
85
+ </button>
86
+ </div>
87
+ </header>
88
+ <div class="tnotes-settings-body">
89
+ <Settings />
90
+ </div>
91
+ </div>
92
+ </div>
93
+ </Transition>
94
+ </Teleport>
95
+ </ClientOnly>
96
+ </template>
97
+
98
+ <script setup lang="ts">
99
+ import { onBeforeUnmount, watch } from 'vue'
100
+
101
+ import { useSettingsDialog } from './composables/useSettingsDialog'
102
+ import Settings from './Settings.vue'
103
+
104
+ const { state, close, toggleFullscreen } = useSettingsDialog()
105
+
106
+ /**
107
+ * 在 dialog 打开期间,捕获阶段拦截 Ctrl/Cmd+K,
108
+ * 阻止 VitePress 本地搜索弹窗在设置面板之上叠加;
109
+ * 同时在捕获阶段处理 Escape 关闭,避免被搜索栏等其它组件吃掉。
110
+ */
111
+ function blockSearchHotkey(e: KeyboardEvent) {
112
+ if (e.key === 'Escape') {
113
+ e.stopImmediatePropagation()
114
+ e.preventDefault()
115
+ close()
116
+ return
117
+ }
118
+ if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'k') {
119
+ e.preventDefault()
120
+ e.stopImmediatePropagation()
121
+ }
122
+ }
123
+
124
+ watch(
125
+ () => state.visible,
126
+ (visible) => {
127
+ if (typeof document === 'undefined') return
128
+ if (visible) {
129
+ document.addEventListener('keydown', blockSearchHotkey, { capture: true })
130
+ document.body.style.overflow = 'hidden'
131
+ } else {
132
+ document.removeEventListener('keydown', blockSearchHotkey, {
133
+ capture: true,
134
+ })
135
+ document.body.style.overflow = ''
136
+ }
137
+ },
138
+ )
139
+
140
+ onBeforeUnmount(() => {
141
+ if (typeof document === 'undefined') return
142
+ document.removeEventListener('keydown', blockSearchHotkey, { capture: true })
143
+ document.body.style.overflow = ''
144
+ })
145
+ </script>
146
+
147
+ <style scoped>
148
+ .tnotes-settings-overlay {
149
+ position: fixed;
150
+ inset: 0;
151
+ background: rgba(0, 0, 0, 0.5);
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: center;
155
+ z-index: 10000;
156
+ padding: 1rem;
157
+ }
158
+
159
+ .tnotes-settings-dialog {
160
+ background: var(--vp-c-bg);
161
+ color: var(--vp-c-text-1);
162
+ border: 1px solid var(--vp-c-divider);
163
+ border-radius: 12px;
164
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
165
+ width: min(720px, 100%);
166
+ max-height: min(80vh, 100%);
167
+ display: flex;
168
+ flex-direction: column;
169
+ overflow: hidden;
170
+ transition:
171
+ width 0.2s ease,
172
+ max-height 0.2s ease,
173
+ border-radius 0.2s ease;
174
+ }
175
+
176
+ .tnotes-settings-dialog.is-fullscreen {
177
+ width: 100vw;
178
+ max-width: 100vw;
179
+ height: 100vh;
180
+ max-height: 100vh;
181
+ border-radius: 0;
182
+ border: none;
183
+ }
184
+
185
+ .tnotes-settings-header {
186
+ display: flex;
187
+ align-items: center;
188
+ justify-content: space-between;
189
+ padding: 0.75rem 1rem;
190
+ border-bottom: 1px solid var(--vp-c-divider);
191
+ flex-shrink: 0;
192
+ }
193
+
194
+ .tnotes-settings-title {
195
+ font-size: 1rem;
196
+ font-weight: 600;
197
+ margin: 0;
198
+ color: var(--vp-c-text-1);
199
+ }
200
+
201
+ .tnotes-settings-actions {
202
+ display: flex;
203
+ gap: 0.25rem;
204
+ }
205
+
206
+ .tnotes-settings-icon-btn {
207
+ display: inline-flex;
208
+ align-items: center;
209
+ justify-content: center;
210
+ width: 32px;
211
+ height: 32px;
212
+ padding: 0;
213
+ border: none;
214
+ border-radius: 6px;
215
+ background: transparent;
216
+ color: var(--vp-c-text-2);
217
+ cursor: pointer;
218
+ transition:
219
+ background 0.15s ease,
220
+ color 0.15s ease;
221
+ }
222
+
223
+ .tnotes-settings-icon-btn:hover {
224
+ background: var(--vp-c-default-soft);
225
+ color: var(--vp-c-text-1);
226
+ }
227
+
228
+ .tnotes-settings-body {
229
+ flex: 1;
230
+ overflow: auto;
231
+ padding: 1rem;
232
+ }
233
+
234
+ /* dialog 进入/离开过渡 */
235
+ .tnotes-settings-dialog-enter-active,
236
+ .tnotes-settings-dialog-leave-active {
237
+ transition: opacity 0.18s ease;
238
+ }
239
+ .tnotes-settings-dialog-enter-from,
240
+ .tnotes-settings-dialog-leave-to {
241
+ opacity: 0;
242
+ }
243
+ </style>
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 全局「设置 Dialog」状态。
3
+ *
4
+ * Layout 顶层渲染 `<SettingsDialog />`,本 store 控制 visible/fullscreen,
5
+ * 任何位置(导航入口、SidebarCard 提示等)调 `open()` 即可弹出,
6
+ * 关闭后停留在当前路由与滚动位置。
7
+ */
8
+ import { reactive } from 'vue'
9
+
10
+ export interface SettingsDialogState {
11
+ visible: boolean
12
+ fullscreen: boolean
13
+ }
14
+
15
+ const state = reactive<SettingsDialogState>({
16
+ visible: false,
17
+ fullscreen: false,
18
+ })
19
+
20
+ export function useSettingsDialog() {
21
+ function open() {
22
+ state.visible = true
23
+ }
24
+
25
+ function close() {
26
+ state.visible = false
27
+ state.fullscreen = false
28
+ }
29
+
30
+ function toggleFullscreen() {
31
+ state.fullscreen = !state.fullscreen
32
+ }
33
+
34
+ return { state, open, close, toggleFullscreen }
35
+ }
@@ -1,21 +1,22 @@
1
1
  <script setup>
2
- import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'
3
- import { withBase, useData } from 'vitepress'
2
+ import { scaleOrdinal, schemePastel2, schemeSet3, schemeTableau10 } from 'd3'
4
3
  import { Transformer } from 'markmap-lib'
5
- import { Markmap } from 'markmap-view'
6
4
  import { Toolbar } from 'markmap-toolbar'
7
5
  import 'markmap-toolbar/dist/style.css'
8
- import { scaleOrdinal, schemePastel2, schemeSet3, schemeTableau10 } from 'd3'
9
- import {
10
- MARKMAP_THEME_KEY,
11
- MARKMAP_EXPAND_LEVEL_KEY,
12
- REPO_NAME,
13
- } from '../constants'
6
+ import { Markmap } from 'markmap-view'
7
+ import { withBase, useData } from 'vitepress'
8
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
9
+
14
10
  import {
15
11
  icon__fullscreen,
16
12
  icon__fullscreen_exit,
17
13
  icon__confirm,
18
14
  } from '../../assets/icons'
15
+ import {
16
+ MARKMAP_THEME_KEY,
17
+ MARKMAP_EXPAND_LEVEL_KEY,
18
+ REPO_NAME,
19
+ } from '../constants'
19
20
 
20
21
  const props = defineProps({
21
22
  sidebarData: {