@tnotesjs/core 0.2.2 → 0.4.0

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/README.md +0 -1
  2. package/config/defaultConfig.ts +33 -4
  3. package/config/index.ts +6 -0
  4. package/core/NoteIndexCache.ts +7 -1
  5. package/core/NoteManager.ts +18 -30
  6. package/dist/{chunk-5Y5IYS6C.js → chunk-UJG3UU5X.js} +21 -5
  7. package/dist/{chunk-5QN44ES5.js → chunk-XCWFZLER.js} +48 -368
  8. package/dist/cli/index.js +26 -78
  9. package/dist/index.js +1 -1
  10. package/dist/vitepress/config/index.js +159 -18
  11. package/package.json +3 -6
  12. package/services/index.ts +0 -1
  13. package/services/init-sub-repo/initSubRepoLogic.ts +0 -1
  14. package/services/note/service.ts +0 -1
  15. package/types/config.ts +0 -3
  16. package/types/note.ts +0 -2
  17. package/vitepress/assets/icons/icon__cursor.svg +4 -0
  18. package/vitepress/assets/icons/index.ts +1 -0
  19. package/vitepress/components/Layout/AboutPanel.vue +0 -24
  20. package/vitepress/components/Layout/DocBeforeControls.vue +6 -14
  21. package/vitepress/components/Layout/DocFooter.vue +3 -3
  22. package/vitepress/components/Layout/Layout.vue +0 -30
  23. package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +20 -11
  24. package/vitepress/components/Layout/homeReadme.data.ts +0 -48
  25. package/vitepress/components/MindmapPreview/InlineRuns.ts +25 -0
  26. package/vitepress/components/MindmapPreview/MindmapOutlineNode.vue +62 -0
  27. package/vitepress/components/MindmapPreview/MindmapPreview.vue +287 -0
  28. package/vitepress/components/MindmapPreview/compat.test.ts +93 -0
  29. package/vitepress/components/MindmapPreview/compat.ts +128 -0
  30. package/vitepress/components/MindmapPreview/expandLevel.test.ts +40 -0
  31. package/vitepress/components/MindmapPreview/expandLevel.ts +28 -0
  32. package/vitepress/components/MindmapPreview/legacyCorpus.test.ts +57 -0
  33. package/vitepress/components/Settings/Settings.vue +76 -73
  34. package/vitepress/components/SidebarCard/FolderTreeItems.vue +16 -6
  35. package/vitepress/components/SidebarCard/SidebarCard.vue +21 -27
  36. package/vitepress/components/composables/useLocalIde.ts +83 -0
  37. package/vitepress/components/constants.ts +5 -6
  38. package/vitepress/components/utils/vscodePaths.test.ts +22 -0
  39. package/vitepress/components/utils/vscodePaths.ts +24 -2
  40. package/vitepress/configs/markdown.config.ts +77 -20
  41. package/vitepress/theme/index.ts +4 -2
  42. package/vitepress/theme/styles/doc-layout.scss +4 -4
  43. package/vitepress/theme/styles/index.scss +0 -1
  44. package/services/timestamp/index.ts +0 -7
  45. package/services/timestamp/service.ts +0 -465
  46. package/vitepress/components/MarkMap/MarkMap.vue +0 -625
  47. package/vitepress/theme/styles/components/markmap.scss +0 -122
@@ -1,625 +0,0 @@
1
- <!--
2
- vitepress/components/MarkMap/MarkMap.vue
3
- -->
4
-
5
- <script setup lang="ts">
6
- import { scaleOrdinal, schemePastel2, schemeSet3, schemeTableau10 } from 'd3'
7
- import { Transformer } from 'markmap-lib'
8
- import { Toolbar } from 'markmap-toolbar'
9
- import 'markmap-toolbar/dist/style.css'
10
- import { Markmap, IMarkmapOptions } from 'markmap-view'
11
- import { onContentUpdated } from 'vitepress'
12
- import { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
13
-
14
- import { icon__fullscreen, icon__fullscreen_exit, icon__confirm } from '../../assets/icons'
15
- import { MARKMAP_THEME_KEY, MARKMAP_EXPAND_LEVEL_KEY } from '../constants'
16
-
17
- // doc: https://github.com/markmap/markmap/blob/205367a24603dc187f67da1658940c6cade20dce/packages/markmap-view/src/constants.ts#L15
18
-
19
- const props = defineProps({
20
- content: { type: String, default: '' },
21
- duration: { type: Number, default: 100 },
22
- spacingVertical: { type: Number, default: 10 },
23
- spacingHorizontal: { type: Number, default: 20 },
24
- nodeMinHeight: { type: Number, default: 24 },
25
- initialExpandLevel: { type: Number, default: 5 },
26
- })
27
-
28
- const svgRef = ref<SVGSVGElement | null>(null)
29
- const containerRef = ref<HTMLDivElement | null>(null)
30
-
31
- let markmapInstance: Markmap | null = null
32
- let observer: MutationObserver | null = null
33
- let toolbarEl: HTMLElement | null = null
34
- let toolbarReinitTimer: ReturnType<typeof setTimeout> | null = null
35
- let darkClassObserver: MutationObserver | null = null
36
-
37
- const isMarkmapDark = ref(false)
38
-
39
- // 从 localStorage 读取配置,如果没有则使用 props 或默认值
40
- const getInitialExpandLevel = () => {
41
- if (typeof window !== 'undefined') {
42
- const saved = localStorage.getItem(MARKMAP_EXPAND_LEVEL_KEY)
43
- if (saved) return parseInt(saved)
44
- }
45
- return props.initialExpandLevel
46
- }
47
-
48
- const getThemeColorFn = () => {
49
- if (typeof window !== 'undefined') {
50
- if (document.documentElement.classList.contains('markmap-dark')) {
51
- return scaleOrdinal(schemeSet3)
52
- }
53
- const theme = localStorage.getItem(MARKMAP_THEME_KEY) || 'default'
54
- switch (theme) {
55
- case 'colorful':
56
- return scaleOrdinal(schemeTableau10)
57
- case 'dark':
58
- return scaleOrdinal(schemeSet3)
59
- default:
60
- return scaleOrdinal(schemePastel2)
61
- }
62
- }
63
- return scaleOrdinal(schemePastel2)
64
- }
65
-
66
- // 可由配置/props 初始化,也可以通过工具栏改动
67
- const expandLevel = ref(getInitialExpandLevel())
68
- const transformer = new Transformer()
69
- const isFullscreen = ref(false)
70
-
71
- // 保存工具栏中层级输入框的引用,方便同步显示与绑定事件
72
- let toolbarLevelInput: HTMLInputElement | null = null
73
-
74
- function renderMarkmap(content: string, level = expandLevel.value) {
75
- if (!svgRef.value) return
76
-
77
- nextTick().then(() => {
78
- if (markmapInstance) {
79
- try {
80
- markmapInstance.destroy()
81
- } catch {}
82
- markmapInstance = null
83
- }
84
-
85
- if (!content.trim()) {
86
- svgRef.value!.innerHTML = '<text x="20" y="30" fill="#999">空内容</text>'
87
- return
88
- }
89
-
90
- try {
91
- const { root } = transformer.transform(content)
92
- const colorFn = getThemeColorFn()
93
- const options: Partial<IMarkmapOptions> = {
94
- // autoFit 会自动调整 scale 和 position 来适配当前容器大小,在阅读大量节点内容的时候,会放大某块区域阅读,每次展开节点或者收起节点,都会自动触发 autoFit,导致阅读体验不佳,因此不启用。
95
- // autoFit: true,
96
- initialExpandLevel: level,
97
- duration: props.duration,
98
- nodeMinHeight: props.nodeMinHeight,
99
- spacingVertical: props.spacingVertical,
100
- spacingHorizontal: props.spacingHorizontal,
101
- maxInitialScale: 2,
102
- maxWidth: 400,
103
- // 使用配置的主题颜色
104
- color: (node): string => colorFn(`${node.state?.path || ''}`),
105
- }
106
-
107
- markmapInstance = Markmap.create(svgRef.value!, options, root)
108
-
109
- setTimeout(() => {
110
- try {
111
- markmapInstance?.fit() // 确保居中
112
- } catch (e) {
113
- console.warn('fit failed', e)
114
- }
115
- }, 0)
116
-
117
- initToolbar()
118
- setupObserver()
119
- } catch (error: any) {
120
- console.error('Markmap render error:', error)
121
- svgRef.value!.innerHTML = `<text x="20" y="30" fill="red">Markmap 错误: ${error.message}</text>`
122
- }
123
- })
124
- }
125
-
126
- function initToolbar() {
127
- if (!markmapInstance || !containerRef.value) return
128
-
129
- // 移除现有的工具栏
130
- if (toolbarEl) {
131
- toolbarEl.remove()
132
- toolbarEl = null
133
- toolbarLevelInput = null
134
- }
135
-
136
- // 创建新工具栏
137
- const { el } = Toolbar.create(markmapInstance)
138
- toolbarEl = el
139
- toolbarEl.style.position = 'absolute'
140
- toolbarEl.style.top = '1rem'
141
- toolbarEl.style.right = '.5rem'
142
- toolbarEl.style.zIndex = '10'
143
- toolbarEl.style.scale = '.8'
144
- const brand = toolbarEl.querySelector('.mm-toolbar-brand')
145
- if (brand) toolbarEl.removeChild(brand)
146
- containerRef.value.appendChild(toolbarEl)
147
-
148
- // 添加自定义全屏按钮
149
- addFullscreenButton(toolbarEl)
150
-
151
- // 在工具栏中添加更新按钮 + 层级输入(并支持 Enter 键触发)
152
- addUpdateButton(toolbarEl)
153
- }
154
-
155
- function addFullscreenButton(toolbar: HTMLElement) {
156
- const fullscreenBtn = document.createElement('div')
157
- fullscreenBtn.className = 'mm-toolbar-item'
158
- fullscreenBtn.title = isFullscreen.value ? '退出全屏' : '全屏'
159
- fullscreenBtn.innerHTML = isFullscreen.value
160
- ? `<img src="${icon__fullscreen_exit}" alt="退出全屏" style="width:18px;height:18px;display:block" />`
161
- : `<img src="${icon__fullscreen}" alt="全屏" style="width:18px;height:18px;display:block" />`
162
- fullscreenBtn.addEventListener('click', toggleFullscreen)
163
- toolbar.appendChild(fullscreenBtn)
164
- }
165
-
166
- function addUpdateButton(toolbar: HTMLElement) {
167
- // 创建更新按钮容器
168
- const updateContainer = document.createElement('div')
169
- updateContainer.style.display = 'flex'
170
- updateContainer.style.alignItems = 'center'
171
- updateContainer.style.gap = '8px'
172
- updateContainer.style.marginRight = '5px'
173
-
174
- // 创建输入框(确保具有 id/name,且样式能在工具栏中清晰可见)
175
- const levelInput = document.createElement('input')
176
- levelInput.type = 'number'
177
- levelInput.id = 'markmap-expand-level'
178
- levelInput.name = 'markmap-expand-level'
179
- levelInput.min = '1'
180
- levelInput.max = '100'
181
- levelInput.value = expandLevel.value.toString()
182
- levelInput.style.width = '2.4rem'
183
- levelInput.style.height = '1.6rem'
184
- levelInput.style.padding = '2px 6px'
185
- levelInput.style.fontSize = '12px'
186
- levelInput.style.lineHeight = '1.2'
187
- levelInput.style.textAlign = 'center'
188
- levelInput.style.boxSizing = 'border-box'
189
- levelInput.style.borderBottom = '.5px solid var(--vp-c-tip-1)'
190
- // levelInput.style.borderRadius = '4px'
191
- // levelInput.style.background = 'var(--vp-c-bg)'
192
- levelInput.style.color = 'var(--vp-c-tip-1)'
193
- levelInput.title = '展开层级'
194
-
195
- // 保存引用,供外部(props 改变)同步输入值
196
- toolbarLevelInput = levelInput
197
-
198
- // 实时限制输入范围(1-100)
199
- levelInput.addEventListener('input', (e) => {
200
- const input = e.target as HTMLInputElement
201
- let value = parseInt(input.value)
202
-
203
- // 如果输入为空或非数字,不做处理
204
- if (input.value === '' || isNaN(value)) return
205
-
206
- // 限制范围:1-100
207
- if (value < 1) {
208
- input.value = '1'
209
- value = 1
210
- } else if (value > 100) {
211
- input.value = '100'
212
- value = 100
213
- }
214
- })
215
-
216
- // 当输入框值变化时仅更新内部 expandLevel(不自动渲染)
217
- levelInput.addEventListener('change', (e) => {
218
- const value = parseInt((e.target as HTMLInputElement).value)
219
- if (!isNaN(value) && value >= 1 && value <= 100) {
220
- expandLevel.value = value
221
- } else {
222
- // 回退到之前的值(避免非法输入)
223
- levelInput.value = expandLevel.value.toString()
224
- }
225
- })
226
-
227
- // 按键监听:按 Enter 时触发更新(相当于点击确认按钮)
228
- levelInput.addEventListener('keydown', (e) => {
229
- if (e.key === 'Enter') {
230
- // 同步输入框值到 expandLevel(防止未触发 change)
231
- const val = parseInt((e.target as HTMLInputElement).value)
232
- if (!isNaN(val) && val >= 1 && val <= 100) {
233
- expandLevel.value = val
234
- } else {
235
- // 如果超出范围,重置为有效值
236
- levelInput.value = expandLevel.value.toString()
237
- }
238
- onUpdateClick()
239
- }
240
- })
241
-
242
- // 创建按钮
243
- const updateBtn = document.createElement('button')
244
- updateBtn.type = 'button'
245
- updateBtn.title = '确定层级并更新'
246
- updateBtn.innerHTML = `<img src="${icon__confirm}" alt="确定" style="width:16px;height:16px;display:block" />`
247
- updateBtn.addEventListener('click', onUpdateClick)
248
-
249
- updateContainer.appendChild(levelInput)
250
- updateContainer.appendChild(updateBtn)
251
-
252
- // 将更新按钮插入到工具栏开头
253
- toolbar.insertBefore(updateContainer, toolbar.firstChild)
254
- }
255
-
256
- // 切换全屏(保持原来的实现)
257
- function toggleFullscreen() {
258
- if (!containerRef.value) return
259
-
260
- if (!isFullscreen.value) {
261
- // 进入全屏
262
- if (containerRef.value.requestFullscreen) {
263
- containerRef.value.requestFullscreen().catch((err) => {
264
- console.error('全屏请求失败:', err)
265
- })
266
- } else if ((containerRef.value as any).webkitRequestFullscreen) {
267
- ;(containerRef.value as any).webkitRequestFullscreen()
268
- } else if ((containerRef.value as any).msRequestFullscreen) {
269
- ;(containerRef.value as any).msRequestFullscreen()
270
- }
271
- } else {
272
- // 退出全屏
273
- if (document.exitFullscreen) {
274
- document.exitFullscreen()
275
- } else if ((document as any).webkitExitFullscreen) {
276
- ;(document as any).webkitExitFullscreen()
277
- } else if ((document as any).msExitFullscreen) {
278
- ;(document as any).msExitFullscreen()
279
- }
280
- }
281
- }
282
-
283
- // 监听全屏状态变化
284
- function handleFullscreenChange() {
285
- isFullscreen.value = !!(
286
- document.fullscreenElement ||
287
- (document as any).webkitFullscreenElement ||
288
- (document as any).msFullscreenElement
289
- )
290
-
291
- // 更新工具栏中的全屏按钮(若存在)
292
- if (toolbarEl) {
293
- const fullscreenBtn = toolbarEl.querySelector(
294
- '.mm-toolbar-item:last-child'
295
- ) as HTMLButtonElement
296
- if (fullscreenBtn) {
297
- fullscreenBtn.title = isFullscreen.value
298
- ? '退出全屏(Exit Fullscreen)'
299
- : '全屏(Fullscreen)'
300
- fullscreenBtn.innerHTML = isFullscreen.value
301
- ? `<img src="${icon__fullscreen_exit}" alt="退出全屏" style="width:18px;height:18px;display:block" />`
302
- : `<img src="${icon__fullscreen}" alt="全屏" style="width:18px;height:18px;display:block" />`
303
- }
304
- }
305
-
306
- // 全屏模式下调整SVG高度
307
- if (svgRef.value) {
308
- if (isFullscreen.value) {
309
- svgRef.value.style.height = 'calc(100vh - 100px)'
310
- } else {
311
- svgRef.value.style.height = '400px'
312
- }
313
-
314
- // 确保居中 - 无论进入还是退出全屏都执行居中
315
- setTimeout(() => {
316
- if (markmapInstance) {
317
- try {
318
- markmapInstance.fit()
319
- } catch (e) {
320
- console.warn('居中失败', e)
321
- }
322
- }
323
- }, 300)
324
- }
325
- }
326
-
327
- function setupObserver() {
328
- if (!svgRef.value) return
329
- if (observer !== null) {
330
- observer.disconnect()
331
- }
332
- observer = new MutationObserver(() => {
333
- // DOM 变动后处理(保留扩展点)
334
- })
335
- observer.observe(svgRef.value, {
336
- childList: true,
337
- subtree: true,
338
- attributes: true,
339
- })
340
- }
341
-
342
- // 只监听内容变化,expandLevel 改动不自动渲染(点击/Enter 确认渲染)
343
- watch(
344
- () => props.content,
345
- (newVal) => {
346
- renderMarkmap(decodeURIComponent(newVal || ''))
347
- }
348
- )
349
-
350
- // 新增:当外部传入的 initialExpandLevel 改变时,组件应同步并重新渲染
351
- watch(
352
- () => props.initialExpandLevel,
353
- (newVal) => {
354
- if (typeof newVal === 'number' && !isNaN(newVal)) {
355
- expandLevel.value = newVal
356
- // 更新输入框显示(如果已创建)
357
- if (toolbarLevelInput) toolbarLevelInput.value = newVal.toString()
358
- // 重新渲染使用新的层级(保持对外部 prop 改动的即时响应)
359
- renderMarkmap(decodeURIComponent(props.content || ''), newVal)
360
- }
361
- }
362
- )
363
-
364
- // 同步:当内部 expandLevel 变更时(例如通过输入框 change 事件),更新工具栏输入显示
365
- watch(expandLevel, (v) => {
366
- if (toolbarLevelInput) {
367
- const asStr = (v || 0).toString()
368
- if (toolbarLevelInput.value !== asStr) {
369
- toolbarLevelInput.value = asStr
370
- }
371
- }
372
- })
373
-
374
- // 点击更新按钮才用当前 expandLevel 渲染
375
- function onUpdateClick() {
376
- renderMarkmap(decodeURIComponent(props.content || ''), expandLevel.value)
377
- }
378
-
379
- function syncMarkmapDarkState(reRender = false) {
380
- const dark = document.documentElement.classList.contains('markmap-dark')
381
- const changed = isMarkmapDark.value !== dark
382
- isMarkmapDark.value = dark
383
- if (typeof window !== 'undefined') {
384
- localStorage.setItem(MARKMAP_THEME_KEY, dark ? 'dark' : 'default')
385
- }
386
- if (reRender && changed && markmapInstance && props.content) {
387
- renderMarkmap(decodeURIComponent(props.content || ''), expandLevel.value)
388
- }
389
- }
390
-
391
- function ensureToolbarAfterContentUpdate() {
392
- if (toolbarReinitTimer) clearTimeout(toolbarReinitTimer)
393
- // ContentCollapse.onContentUpdated 会在 ~150ms 后重组 DOM,稍晚再补挂工具栏
394
- toolbarReinitTimer = setTimeout(() => {
395
- toolbarReinitTimer = null
396
- if (!containerRef.value || !markmapInstance) return
397
- if (!containerRef.value.querySelector('.mm-toolbar')) {
398
- initToolbar()
399
- }
400
- }, 350)
401
- }
402
-
403
- onMounted(() => {
404
- if (typeof window !== 'undefined') {
405
- if (localStorage.getItem(MARKMAP_THEME_KEY) === 'dark') {
406
- document.documentElement.classList.add('markmap-dark')
407
- }
408
- syncMarkmapDarkState(false)
409
- darkClassObserver = new MutationObserver(() => syncMarkmapDarkState(true))
410
- darkClassObserver.observe(document.documentElement, {
411
- attributes: true,
412
- attributeFilter: ['class'],
413
- })
414
- }
415
-
416
- renderMarkmap(decodeURIComponent(props.content || ''))
417
-
418
- // 添加全屏事件监听
419
- document.addEventListener('fullscreenchange', handleFullscreenChange)
420
- document.addEventListener('webkitfullscreenchange', handleFullscreenChange)
421
- document.addEventListener('MSFullscreenChange', handleFullscreenChange)
422
- })
423
-
424
- onContentUpdated(() => {
425
- ensureToolbarAfterContentUpdate()
426
- })
427
-
428
- onBeforeUnmount(() => {
429
- if (darkClassObserver) {
430
- darkClassObserver.disconnect()
431
- darkClassObserver = null
432
- }
433
- if (toolbarReinitTimer) {
434
- clearTimeout(toolbarReinitTimer)
435
- toolbarReinitTimer = null
436
- }
437
- if (toolbarEl) {
438
- toolbarEl.remove()
439
- toolbarEl = null
440
- toolbarLevelInput = null
441
- }
442
- if (markmapInstance) {
443
- try {
444
- markmapInstance.destroy()
445
- } catch {}
446
- markmapInstance = null
447
- }
448
- if (observer !== null) {
449
- observer.disconnect()
450
- observer = null
451
- }
452
-
453
- // 移除全屏事件监听
454
- document.removeEventListener('fullscreenchange', handleFullscreenChange)
455
- document.removeEventListener('webkitfullscreenchange', handleFullscreenChange)
456
- document.removeEventListener('MSFullscreenChange', handleFullscreenChange)
457
- })
458
- </script>
459
-
460
- <template>
461
- <div
462
- class="markmapContainer"
463
- :class="{ 'is-markmap-dark': isMarkmapDark }"
464
- ref="containerRef"
465
- style="position: relative"
466
- >
467
- <svg ref="svgRef" style="width: 100%; height: 400px"></svg>
468
- </div>
469
- </template>
470
-
471
- <style scoped lang="scss">
472
- /**
473
- * MarkMap 组件样式
474
- * 全局样式(.mm-toolbar, .mm-toolbar-item 等)已移至 global-components.css
475
- */
476
-
477
- .markmapContainer {
478
- border-radius: 8px;
479
- padding: 1rem;
480
- overflow: auto;
481
- position: relative;
482
- margin: 1.5rem 0;
483
- transition: all 0.3s ease;
484
- background-color: #fff;
485
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
486
-
487
- &:hover {
488
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
489
- }
490
-
491
- svg {
492
- min-width: 100%;
493
- display: block;
494
- transition: height 0.3s ease;
495
-
496
- text:empty {
497
- animation: pulse 1.5s ease-in-out infinite;
498
- }
499
- }
500
- }
501
-
502
- /* dark background */
503
- .markmapContainer.is-markmap-dark {
504
- background-color: #1d1d1d;
505
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
506
-
507
- &:hover {
508
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
509
- }
510
- }
511
-
512
- /* 按钮组样式 */
513
- .btnGroup {
514
- color: var(--vp-c-brand-1);
515
-
516
- input {
517
- display: inline-block;
518
- width: 2rem;
519
- text-align: center;
520
- border: 1px solid var(--vp-c-divider);
521
- border-radius: 4px;
522
- padding: 2px 4px;
523
- background: var(--vp-c-bg);
524
- color: var(--vp-c-text-1);
525
- transition: all 0.2s ease;
526
-
527
- &:focus {
528
- outline: none;
529
- border-color: var(--vp-c-brand-1);
530
- box-shadow: 0 0 0 2px rgba(var(--vp-c-brand-1), 0.1);
531
- }
532
-
533
- &:hover {
534
- border-color: var(--vp-c-brand-2);
535
- }
536
- }
537
-
538
- button {
539
- outline: none;
540
- border: none;
541
- cursor: pointer;
542
- padding: 4px 8px;
543
- border-radius: 4px;
544
- background-color: #f0f0f0;
545
- transition: all 0.2s ease;
546
- font-weight: 500;
547
-
548
- &:hover {
549
- background-color: #e0e0e0;
550
- transform: translateY(-1px);
551
- }
552
-
553
- &:active {
554
- transform: translateY(0);
555
- }
556
- }
557
- }
558
-
559
- :global(.markmap-dark) .btnGroup {
560
- button {
561
- background-color: #333;
562
- color: #fff;
563
-
564
- &:hover {
565
- background-color: #444;
566
- }
567
- }
568
-
569
- input {
570
- background-color: #2a2a2a;
571
- border-color: #444;
572
- color: #fff;
573
-
574
- &:focus {
575
- border-color: var(--vp-c-brand-1);
576
- }
577
- }
578
- }
579
-
580
- /* 全屏样式 */
581
- .markmapContainer:fullscreen,
582
- .markmapContainer:-ms-fullscreen,
583
- .markmapContainer:-webkit-full-screen {
584
- width: 100%;
585
- height: 100%;
586
- padding: 20px;
587
- background: white;
588
- display: flex;
589
- flex-direction: column;
590
- justify-content: center;
591
- box-shadow: none;
592
- }
593
-
594
- .markmapContainer.is-markmap-dark:fullscreen,
595
- .markmapContainer.is-markmap-dark:-ms-fullscreen,
596
- .markmapContainer.is-markmap-dark:-webkit-full-screen {
597
- background: #1d1d1d;
598
- }
599
-
600
- /* 响应式设计 */
601
- @media (max-width: 768px) {
602
- .markmapContainer {
603
- padding: 0.75rem;
604
- margin: 1rem 0;
605
- }
606
- }
607
-
608
- @media (max-width: 480px) {
609
- .markmapContainer {
610
- padding: 0.5rem;
611
- margin: 0.75rem 0;
612
- }
613
- }
614
-
615
- /* 加载动画 */
616
- @keyframes pulse {
617
- 0%,
618
- 100% {
619
- opacity: 1;
620
- }
621
- 50% {
622
- opacity: 0.5;
623
- }
624
- }
625
- </style>