Skip to content

Commit a752211

Browse files
committed
docs: replace vue-resizable-panels with splitpanes
1 parent d3d83da commit a752211

File tree

17 files changed

+1600
-2162
lines changed

17 files changed

+1600
-2162
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"shikijs",
3737
"tspan",
3838
"unplugin",
39+
"unrs",
3940
"vite",
4041
"vitepress",
4142
"vitest",

docs/.vitepress/components/DropZone.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ function onDragOver(evt: DragEvent) {
3838
evt.preventDefault()
3939
}
4040
async function onImportFile(files?: FileList | null) {
41-
if (!files) return
41+
if (!files) {
42+
return
43+
}
4244
4345
const file = files[0]
4446
const fileExt = file.name.split('.').pop()?.toLowerCase()
@@ -56,6 +58,7 @@ async function onImportFile(files?: FileList | null) {
5658
}
5759
async function onDrop(evt: DragEvent) {
5860
evt.preventDefault()
61+
5962
if (!isFileDrag(evt)) {
6063
return
6164
}

docs/.vitepress/components/Editor/index.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { Codemirror } from 'vue-codemirror'
55
import { languages } from './language'
66
import { githubDark, githubLight } from './theme'
77
import type { Extension } from '@codemirror/state'
8-
import type { SupportLanguage } from './language'
8+
import type { SupportedLanguage } from './language'
99
1010
const props = withDefaults(
1111
defineProps<{
12-
language?: SupportLanguage
12+
language?: SupportedLanguage
1313
extensions?: Extension[]
1414
placeholder?: string
1515
disabled?: boolean
@@ -32,7 +32,6 @@ const resolvedExtensions = computed(() => {
3232
const extentions: Extension[] = [
3333
// External extension
3434
...props.extensions,
35-
3635
// Theme extension
3736
isDark.value ? githubDark : githubLight,
3837
]

docs/.vitepress/components/Editor/language.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export interface Language {
99
extension: () => LanguageSupport | Extension[]
1010
}
1111

12-
export type SupportLanguage = 'xml' | 'json'
12+
export type SupportedLanguage = 'xml' | 'json'
1313

1414
export const languages: Language[] = [
1515
{

docs/.vitepress/components/Playground/ActionContainer.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const {
1515
const { parseCost, setCode, resetPlayground } = useSharedPlaygroundState()
1616
1717
handleFileDialogChange(files => {
18-
if (!files?.length) return
18+
if (!files?.length) {
19+
return
20+
}
1921
tryLoadFile(files[0])
2022
})
2123
@@ -25,7 +27,9 @@ function tryLoadFile(file: File) {
2527
reader.addEventListener('load', (event: ProgressEvent<FileReader>) => {
2628
const content = event.target?.result ?? ''
2729
28-
if (typeof content !== 'string') return
30+
if (typeof content !== 'string') {
31+
return
32+
}
2933
3034
setCode(content)
3135
resetSelectedFiles()

docs/.vitepress/components/Playground/index.vue

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,27 @@
11
<script lang="ts" setup>
22
import './style.css'
3-
import { Panel, PanelGroup, PanelResizeHandle } from 'vue-resizable-panels'
3+
import 'splitpanes/dist/splitpanes.css'
4+
import { Pane, Splitpanes } from 'splitpanes'
45
</script>
56

67
<template>
78
<div class="page-playground-core relative px-4">
89
<ClientOnly>
9-
<PanelGroup
10-
direction="horizontal"
11-
class="panel-group"
12-
>
13-
<Panel
14-
class="panel-column"
15-
collapsible
16-
>
10+
<Splitpanes class="default-theme">
11+
<Pane :min-size="30">
1712
<InputContainer />
18-
</Panel>
19-
<PanelResizeHandle class="panel-resize-handle" />
20-
<Panel
21-
class="panel-column"
22-
collapsible
23-
>
13+
</Pane>
14+
<Pane :min-size="30">
2415
<OutputContainer />
25-
</Panel>
26-
<PanelResizeHandle class="panel-resize-handle" />
27-
<Panel
16+
</Pane>
17+
<Pane
2818
:min-size="12"
2919
:max-size="24"
30-
:default-size="18"
31-
class="panel-column"
32-
collapsible
20+
:size="18"
3321
>
3422
<ActionContainer />
35-
</Panel>
36-
</PanelGroup>
37-
23+
</Pane>
24+
</Splitpanes>
3825
<DropZone />
3926
</ClientOnly>
4027
</div>

docs/.vitepress/components/ast/RenderExpandableObject.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ const isActive = computed(
2929
)
3030
3131
function handleHoverItem(isHovering: boolean) {
32-
if (isNil(props.onHover) || !isFunction(props.onHover)) return
32+
if (isNil(props.onHover) || !isFunction(props.onHover)) {
33+
return
34+
}
3335
3436
if (isHovering) {
3537
props.onHover?.()

docs/.vitepress/composables/playground.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export function usePlaygroundState() {
1515
const error = shallowRef<unknown>()
1616

1717
const astJson = computed(() => {
18-
if (!ast.value) return ''
18+
if (!ast.value) {
19+
return ''
20+
}
1921
try {
2022
return JSON.stringify(ast.value, null, 2)
2123
} catch {

docs/components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// @ts-nocheck
33
// Generated by unplugin-vue-components
44
// Read more: https://github.com/vuejs/core/pull/3399
5+
// biome-ignore lint: disable
56
export {}
67

78
/* prettier-ignore */

docs/package.json

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,31 @@
66
"build": "vitepress build .",
77
"dev": "vitepress dev ."
88
},
9-
"dependencies": {
10-
"@codemirror/lang-json": "catalog:",
11-
"@codemirror/lang-xml": "catalog:",
12-
"@codemirror/language": "catalog:",
13-
"@codemirror/state": "catalog:",
14-
"@codemirror/view": "catalog:",
15-
"@lezer/highlight": "catalog:",
16-
"@ntnyq/utils": "catalog:",
17-
"@uiw/codemirror-themes": "catalog:",
18-
"@vueuse/core": "catalog:",
19-
"codemirror": "catalog:",
20-
"floating-vue": "catalog:",
21-
"svg-eslint-parser": "workspace:*",
22-
"vue-codemirror": "catalog:",
23-
"vue-resizable-panels": "catalog:"
24-
},
259
"devDependencies": {
26-
"@iconify-json/carbon": "catalog:",
27-
"@iconify-json/lucide": "catalog:",
28-
"@shikijs/transformers": "catalog:",
29-
"@shikijs/vitepress-twoslash": "catalog:",
30-
"twoslash": "catalog:",
31-
"unocss": "catalog:",
32-
"unplugin-vue-components": "catalog:",
33-
"vite": "catalog:",
34-
"vitepress": "catalog:",
35-
"vitepress-plugin-group-icons": "catalog:",
36-
"vue": "catalog:"
10+
"@codemirror/lang-json": "^6.0.1",
11+
"@codemirror/lang-xml": "^6.1.0",
12+
"@codemirror/language": "^6.11.0",
13+
"@codemirror/state": "^6.5.2",
14+
"@codemirror/view": "^6.36.8",
15+
"@iconify-json/carbon": "^1.2.8",
16+
"@iconify-json/lucide": "^1.2.43",
17+
"@lezer/highlight": "^1.2.1",
18+
"@ntnyq/utils": "^0.7.0",
19+
"@shikijs/transformers": "^3.4.0",
20+
"@shikijs/vitepress-twoslash": "^3.4.0",
21+
"@uiw/codemirror-themes": "^4.23.12",
22+
"@vueuse/core": "^13.2.0",
23+
"codemirror": "^6.0.1",
24+
"floating-vue": "^5.2.2",
25+
"splitpanes": "^4.0.3",
26+
"svg-eslint-parser": "workspace:*",
27+
"twoslash": "^0.3.1",
28+
"unocss": "^66.1.1",
29+
"unplugin-vue-components": "^28.5.0",
30+
"vite": "^6.3.5",
31+
"vitepress": "^1.6.3",
32+
"vitepress-plugin-group-icons": "^1.5.3",
33+
"vue": "^3.5.13",
34+
"vue-codemirror": "^6.1.1"
3735
}
3836
}

0 commit comments

Comments
 (0)