Skip to content

Commit 73fcc96

Browse files
committed
chore: formatted code with prettier
1 parent da5fc27 commit 73fcc96

47 files changed

Lines changed: 1022 additions & 970 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 4,
3+
"semi": true,
4+
"singleQuote": false,
5+
"trailingComma": "none"
6+
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"scripts": {
2020
"dev": "vite",
2121
"build": "vite build",
22-
"preview": "vite preview"
22+
"preview": "vite preview",
23+
"format": "prettier source --write"
2324
},
2425
"dependencies": {
2526
"@codemirror/autocomplete": "^6.18.4",
@@ -46,6 +47,7 @@
4647
"@vitejs/plugin-vue": "^5.2.1",
4748
"autoprefixer": "^10.4.20",
4849
"postcss": "^8.4.49",
50+
"prettier": "^3.7.4",
4951
"tailwindcss": "^3.4.17",
5052
"vite": "^6.0.4"
5153
}

source/App.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<script setup>
2-
import BaseHeader from '@/components/BaseHeader.vue'
3-
import BaseView from '@/components/BaseView.vue'
4-
import AppPreview from '@/components/AppPreview.vue'
5-
import AppEditor from '@/components/AppEditor.vue'
6-
import Toaster from '@/components/ui/toast/Toaster.vue'
2+
import BaseHeader from "@/components/BaseHeader.vue";
3+
import BaseView from "@/components/BaseView.vue";
4+
import AppPreview from "@/components/AppPreview.vue";
5+
import AppEditor from "@/components/AppEditor.vue";
6+
import Toaster from "@/components/ui/toast/Toaster.vue";
77
</script>
88

99
<template>
10-
<BaseHeader />
11-
<BaseView>
12-
<template #left>
13-
<AppEditor />
14-
</template>
15-
<template #right>
16-
<AppPreview />
17-
</template>
18-
</BaseView>
19-
<Toaster />
20-
</template>
10+
<BaseHeader />
11+
<BaseView>
12+
<template #left>
13+
<AppEditor />
14+
</template>
15+
<template #right>
16+
<AppPreview />
17+
</template>
18+
</BaseView>
19+
<Toaster />
20+
</template>

source/components/BaseLogo.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<div class="flex items-center space-x-2 px-2 group">
3-
<img class="w-6 h-6" src="/logo.svg" />
4-
<span class="hidden lg:inline-block text-blue-600 font-bold">
5-
<b>LiveCode</b>
6-
</span>
7-
</div>
8-
</template>
2+
<div class="flex items-center space-x-2 px-2 group">
3+
<img class="w-6 h-6" src="/logo.svg" />
4+
<span class="hidden lg:inline-block text-blue-600 font-bold">
5+
<b>LiveCode</b>
6+
</span>
7+
</div>
8+
</template>

source/components/BaseView.vue

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,80 @@
11
<script setup>
22
import {
3-
ResizableHandle,
4-
ResizablePanel,
5-
ResizablePanelGroup,
6-
} from './ui/resizable'
7-
import { ref, watchEffect } from 'vue'
8-
import { useAppStore } from '@/store'
3+
ResizableHandle,
4+
ResizablePanel,
5+
ResizablePanelGroup
6+
} from "./ui/resizable";
7+
import { ref, watchEffect } from "vue";
8+
import { useAppStore } from "@/store";
99
10-
const store = useAppStore()
10+
const store = useAppStore();
1111
12-
const panelLeft = ref()
13-
const panelRight = ref()
12+
const panelLeft = ref();
13+
const panelRight = ref();
1414
15-
const verticalAlign = ref(false)
15+
const verticalAlign = ref(false);
1616
1717
watchEffect(() => {
18-
const view = store.layout
19-
if (view === 'left') viewLeft()
20-
else if (view === 'right') viewRight()
21-
else if (view === 'row') splitView(true)
22-
else splitView(false)
23-
})
18+
const view = store.layout;
19+
if (view === "left") viewLeft();
20+
else if (view === "right") viewRight();
21+
else if (view === "row") splitView(true);
22+
else splitView(false);
23+
});
2424
2525
function splitView(column = false) {
26-
panelLeft.value?.expand()
27-
panelRight.value?.expand()
28-
verticalAlign.value = !!column
26+
panelLeft.value?.expand();
27+
panelRight.value?.expand();
28+
verticalAlign.value = !!column;
2929
}
3030
3131
function viewLeft() {
32-
!panelRight.value?.isCollapsed && panelRight.value?.collapse()
32+
!panelRight.value?.isCollapsed && panelRight.value?.collapse();
3333
}
3434
3535
function viewRight() {
36-
!panelLeft.value?.isCollapsed && panelLeft.value?.collapse()
36+
!panelLeft.value?.isCollapsed && panelLeft.value?.collapse();
3737
}
38-
3938
</script>
4039
4140
<template>
42-
<ResizablePanelGroup id="demo-group-1" :direction="verticalAlign ? 'vertical' : 'horizontal'" class="box">
43-
<ResizablePanel ref="panelLeft" id="demo-panel-1" :default-size="50" collapsible :collapsed-size="0"
44-
:min-size="35" class="overflow-y-auto">
45-
<slot name="left"></slot>
46-
</ResizablePanel>
47-
<ResizableHandle with-handle id="demo-handle-1" :class="{ 'hover:w-1': !verticalAlign }" />
48-
<ResizablePanel ref="panelRight" id="demo-panel-2" :default-size="50" collapsible :collapsed-size="0"
49-
:min-size="35" class="overflow-y-auto">
50-
<slot name="right"></slot>
51-
</ResizablePanel>
52-
</ResizablePanelGroup>
41+
<ResizablePanelGroup
42+
id="demo-group-1"
43+
:direction="verticalAlign ? 'vertical' : 'horizontal'"
44+
class="box"
45+
>
46+
<ResizablePanel
47+
ref="panelLeft"
48+
id="demo-panel-1"
49+
:default-size="50"
50+
collapsible
51+
:collapsed-size="0"
52+
:min-size="35"
53+
class="overflow-y-auto"
54+
>
55+
<slot name="left"></slot>
56+
</ResizablePanel>
57+
<ResizableHandle
58+
with-handle
59+
id="demo-handle-1"
60+
:class="{ 'hover:w-1': !verticalAlign }"
61+
/>
62+
<ResizablePanel
63+
ref="panelRight"
64+
id="demo-panel-2"
65+
:default-size="50"
66+
collapsible
67+
:collapsed-size="0"
68+
:min-size="35"
69+
class="overflow-y-auto"
70+
>
71+
<slot name="right"></slot>
72+
</ResizablePanel>
73+
</ResizablePanelGroup>
5374
</template>
5475
5576
<style scoped>
5677
.box {
57-
height: calc(100dvh - 40px) !important;
78+
height: calc(100dvh - 40px) !important;
5879
}
59-
</style>
80+
</style>

source/components/IconButton.vue

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
<script setup>
22
import {
3-
Tooltip,
4-
TooltipContent,
5-
TooltipProvider,
6-
TooltipTrigger,
7-
} from './ui/tooltip'
8-
import { Button } from './ui/button'
3+
Tooltip,
4+
TooltipContent,
5+
TooltipProvider,
6+
TooltipTrigger
7+
} from "./ui/tooltip";
8+
import { Button } from "./ui/button";
99
10-
defineProps(['text', 'active', 'mobile'])
10+
defineProps(["text", "active", "mobile"]);
1111
12-
const emit = defineEmits(['trigger'])
12+
const emit = defineEmits(["trigger"]);
1313
</script>
1414

1515
<template>
16-
<TooltipProvider :delay-duration="0">
17-
<Tooltip>
18-
<TooltipTrigger>
19-
<Button variant="ghost" size="icon" @click="emit('trigger')"
20-
:class="[active ? 'text-blue-600' : 'text-muted-foreground', mobile ? '' : 'hidden sm:inline-flex']">
21-
<slot></slot>
22-
</Button>
23-
</TooltipTrigger>
24-
<TooltipContent>
25-
<p>{{ text }}</p>
26-
</TooltipContent>
27-
</Tooltip>
28-
</TooltipProvider>
29-
</template>
16+
<TooltipProvider :delay-duration="0">
17+
<Tooltip>
18+
<TooltipTrigger>
19+
<Button
20+
variant="ghost"
21+
size="icon"
22+
@click="emit('trigger')"
23+
:class="[
24+
active ? 'text-blue-600' : 'text-muted-foreground',
25+
mobile ? '' : 'hidden sm:inline-flex'
26+
]"
27+
>
28+
<slot></slot>
29+
</Button>
30+
</TooltipTrigger>
31+
<TooltipContent>
32+
<p>{{ text }}</p>
33+
</TooltipContent>
34+
</Tooltip>
35+
</TooltipProvider>
36+
</template>
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<script setup>
2-
import { cn } from '@/lib/utils';
3-
import { Primitive } from 'radix-vue';
4-
import { buttonVariants } from '.';
2+
import { cn } from "@/lib/utils";
3+
import { Primitive } from "radix-vue";
4+
import { buttonVariants } from ".";
55
66
const props = defineProps({
7-
variant: { type: null, required: false },
8-
size: { type: null, required: false },
9-
class: { type: null, required: false },
10-
asChild: { type: Boolean, required: false },
11-
as: { type: null, required: false, default: 'button' },
7+
variant: { type: null, required: false },
8+
size: { type: null, required: false },
9+
class: { type: null, required: false },
10+
asChild: { type: Boolean, required: false },
11+
as: { type: null, required: false, default: "button" }
1212
});
1313
</script>
1414

1515
<template>
16-
<Primitive
17-
:as="as"
18-
:as-child="asChild"
19-
:class="cn(buttonVariants({ variant, size }), props.class)"
20-
>
21-
<slot />
22-
</Primitive>
16+
<Primitive
17+
:as="as"
18+
:as-child="asChild"
19+
:class="cn(buttonVariants({ variant, size }), props.class)"
20+
>
21+
<slot />
22+
</Primitive>
2323
</template>
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import { cva } from 'class-variance-authority';
1+
import { cva } from "class-variance-authority";
22

3-
export { default as Button } from './Button.vue';
3+
export { default as Button } from "./Button.vue";
44

55
export const buttonVariants = cva(
6-
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
7-
{
8-
variants: {
9-
variant: {
10-
default:
11-
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
12-
destructive:
13-
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
14-
outline:
15-
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
16-
secondary:
17-
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
18-
ghost: 'hover:bg-accent hover:text-accent-foreground',
19-
link: 'text-primary underline-offset-4 hover:underline',
20-
},
21-
size: {
22-
default: 'h-9 px-4 py-2',
23-
sm: 'h-8 rounded-md px-3 text-xs',
24-
lg: 'h-10 rounded-md px-8',
25-
icon: 'h-9 w-9',
26-
},
27-
},
28-
defaultVariants: {
29-
variant: 'default',
30-
size: 'default',
31-
},
32-
},
6+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
7+
{
8+
variants: {
9+
variant: {
10+
default:
11+
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
12+
destructive:
13+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
14+
outline:
15+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
16+
secondary:
17+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
18+
ghost: "hover:bg-accent hover:text-accent-foreground",
19+
link: "text-primary underline-offset-4 hover:underline"
20+
},
21+
size: {
22+
default: "h-9 px-4 py-2",
23+
sm: "h-8 rounded-md px-3 text-xs",
24+
lg: "h-10 rounded-md px-8",
25+
icon: "h-9 w-9"
26+
}
27+
},
28+
defaultVariants: {
29+
variant: "default",
30+
size: "default"
31+
}
32+
}
3333
);

0 commit comments

Comments
 (0)