Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update button #477

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/components/CodemirrorEditor/EditorHeader/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ function copy() {
// 公众号不支持 position, 转换为等价的 translateY
.replace(/top:(.*?)em/g, `transform: translateY($1em)`)
// 适配主题中的颜色变量
.replaceAll(`hsl(var(--foreground))`, `#3f3f3f`)
.replaceAll(`var(--blockquote-background)`, `#f7f7f7`)
.replaceAll(`var(--md-primary-color)`, primaryColor.value)
.replaceAll(/--md-primary-color:.+?;/g, ``)
.replace(/hsl\(var\(--foreground\)\)/g, `#3f3f3f`)
.replace(/var\(--blockquote-background\)/g, `#f7f7f7`)
.replace(/var\(--md-primary-color\)/g, primaryColor.value)
.replace(/--md-primary-color:.+?;/g, ``)
.replace(/<span class="nodeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g, `<span class="nodeLabel"$1>$2</span>`)

clipboardDiv.focus()
Expand Down Expand Up @@ -219,10 +219,10 @@ const formatOptions = ref<Format[]>([`rgb`, `hex`, `hsl`, `hsv`])
<HelpDropdown />
</Menubar>

<Button v-if="!store.isOpenPostSlider" variant="outline" @click="store.isOpenPostSlider = true" class="mr-2">
<Button v-if="!store.isOpenPostSlider" variant="outline" class="mr-2" @click="store.isOpenPostSlider = true">
<PanelLeftOpen class="size-4" />
</Button>
<Button v-else variant="outline" @click="store.isOpenPostSlider = false" class="mr-2">
<Button v-else variant="outline" class="mr-2" @click="store.isOpenPostSlider = false">
<PanelLeftClose class="size-4" />
</Button>
<Popover>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CodemirrorEditor/PostSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function delPost() {
:class="{
'bg-primary text-primary-foreground': store.currentPostIndex === index,
}"
class="hover:text-primary-foreground hover:bg-primary/90 dark:bg-muted dark:hover:bg-muted h-8 w-full inline-flex items-center justify-start gap-2 whitespace-nowrap rounded px-2 text-sm transition-colors dark:text-white dark:hover:text-white"
class="hover:bg-primary/90 hover:text-primary-foreground dark:bg-muted dark:hover:bg-muted h-8 w-full inline-flex items-center justify-start gap-2 whitespace-nowrap rounded px-2 text-sm transition-colors dark:text-white dark:hover:text-white"
@click="store.currentPostIndex = index"
>
<span class="line-clamp-1">{{ post.title }}</span>
Expand Down
1 change: 1 addition & 0 deletions src/components/CodemirrorEditor/UploadImgDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ function onDrop(e: DragEvent) {
<Button
variant="link"
class="p-0"
as="a"
href="https://mpmd.pages.dev/tutorial/"
target="_blank"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/FormItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const props = defineProps<{
<template>
<div>
<Label class="flex items-center">
<span class="mr-4 w-[150px] text-right font-bold min-h-4 flex-shrink-0" :class="{ required: props.required }">
<span class="mr-4 min-h-4 w-[150px] flex-shrink-0 text-right font-bold" :class="{ required: props.required }">
{{ props.label }}
</span>
<slot />
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/alert/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { cn } from '@/lib/utils'
import { type AlertVariants, alertVariants } from '.'

const props = defineProps<{
class?: HTMLAttributes['class']
variant?: AlertVariants['variant']
class?: HTMLAttributes[`class`]
variant?: AlertVariants[`variant`]
}>()
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/alert/AlertDescription.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'

const props = defineProps<{
class?: HTMLAttributes['class']
class?: HTMLAttributes[`class`]
}>()
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/alert/AlertTitle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
class?: HTMLAttributes[`class`]
}>()
</script>

Expand Down
8 changes: 4 additions & 4 deletions src/components/ui/alert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ export { default as AlertDescription } from './AlertDescription.vue'
export { default as AlertTitle } from './AlertTitle.vue'

export const alertVariants = cva(
'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',
`relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,
{
variants: {
variant: {
default: 'bg-background text-foreground',
default: `bg-background text-foreground`,
destructive:
'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',
`border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`,
},
},
defaultVariants: {
variant: 'default',
variant: `default`,
},
},
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/label/Label.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { Label, type LabelProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'

const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<LabelProps & { class?: HTMLAttributes[`class`] }>()

const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/number-field/NumberField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cn } from '@/lib/utils'
import { NumberFieldRoot, useForwardPropsEmits } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'

const props = defineProps<NumberFieldRootProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<NumberFieldRootProps & { class?: HTMLAttributes[`class`] }>()
const emits = defineEmits<NumberFieldRootEmits>()

const delegatedProps = computed(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/number-field/NumberFieldContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'

const props = defineProps<{
class?: HTMLAttributes['class']
class?: HTMLAttributes[`class`]
}>()
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/number-field/NumberFieldDecrement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Minus } from 'lucide-vue-next'
import { NumberFieldDecrement, useForwardProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'

const props = defineProps<NumberFieldDecrementProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<NumberFieldDecrementProps & { class?: HTMLAttributes[`class`] }>()

const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/number-field/NumberFieldIncrement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Plus } from 'lucide-vue-next'
import { NumberFieldIncrement, useForwardProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'

const props = defineProps<NumberFieldIncrementProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<NumberFieldIncrementProps & { class?: HTMLAttributes[`class`] }>()

const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/number-field/NumberFieldInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cn } from '@/lib/utils'
import { NumberFieldInput } from 'radix-vue'

const props = defineProps<{
class?: HTMLAttributes['class']
class?: HTMLAttributes[`class`]
}>()
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/switch/Switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<SwitchRootProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<SwitchRootProps & { class?: HTMLAttributes[`class`] }>()
const emits = defineEmits<SwitchRootEmits>()
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/tabs/TabsContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { TabsContent, type TabsContentProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'

const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<TabsContentProps & { class?: HTMLAttributes[`class`] }>()

const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/tabs/TabsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { TabsList, type TabsListProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'

const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<TabsListProps & { class?: HTMLAttributes[`class`] }>()

const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/tabs/TabsTrigger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>()
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
Expand Down
6 changes: 3 additions & 3 deletions src/components/ui/textarea/Textarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { cn } from '@/lib/utils'
import { useVModel } from '@vueuse/core'

const props = defineProps<{
class?: HTMLAttributes['class']
class?: HTMLAttributes[`class`]
defaultValue?: string | number
modelValue?: string | number
}>()

const emits = defineEmits<{
(e: 'update:modelValue', payload: string | number): void
(e: `update:modelValue`, payload: string | number): void
}>()

const modelValue = useVModel(props, 'modelValue', emits, {
const modelValue = useVModel(props, `modelValue`, emits, {
passive: true,
defaultValue: props.defaultValue,
})
Expand Down
Loading