|
|
@ -14,6 +14,7 @@ import MsFormatQuote from '~icons/material-symbols/format-quote' |
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
editor: Editor |
|
|
|
editor: Editor |
|
|
|
embedMode?: boolean |
|
|
|
embedMode?: boolean |
|
|
|
|
|
|
|
isFormField?: boolean |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<Props>() |
|
|
|
const props = defineProps<Props>() |
|
|
@ -83,9 +84,10 @@ const onToggleLink = () => { |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'embed-mode': embedMode, |
|
|
|
'embed-mode': embedMode, |
|
|
|
'full-mode': !embedMode, |
|
|
|
'full-mode': !embedMode, |
|
|
|
|
|
|
|
'form-field-mode': isFormField, |
|
|
|
}" |
|
|
|
}" |
|
|
|
> |
|
|
|
> |
|
|
|
<NcTooltip :disabled="editor.isActive('codeBlock')"> |
|
|
|
<NcTooltip :placement="isFormField ? 'bottom' : undefined" :disabled="editor.isActive('codeBlock')"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
@ -105,7 +107,7 @@ const onToggleLink = () => { |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
|
|
|
|
<NcTooltip :disabled="editor.isActive('codeBlock')"> |
|
|
|
<NcTooltip :placement="isFormField ? 'bottom' : undefined" :disabled="editor.isActive('codeBlock')"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
@ -124,7 +126,7 @@ const onToggleLink = () => { |
|
|
|
<MdiFormatItalic /> |
|
|
|
<MdiFormatItalic /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
<NcTooltip :disabled="editor.isActive('codeBlock')"> |
|
|
|
<NcTooltip :placement="isFormField ? 'bottom' : undefined" :disabled="editor.isActive('codeBlock')"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
@ -144,7 +146,7 @@ const onToggleLink = () => { |
|
|
|
<MdiFormatUnderline /> |
|
|
|
<MdiFormatUnderline /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
<NcTooltip :disabled="editor.isActive('codeBlock')"> |
|
|
|
<NcTooltip :placement="isFormField ? 'bottom' : undefined" :disabled="editor.isActive('codeBlock')"> |
|
|
|
<template #title> |
|
|
|
<template #title> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div class="flex flex-col items-center"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
@ -163,6 +165,7 @@ const onToggleLink = () => { |
|
|
|
<MdiFormatStrikeThrough /> |
|
|
|
<MdiFormatStrikeThrough /> |
|
|
|
</NcButton> |
|
|
|
</NcButton> |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
<template v-if="!isFormField"> |
|
|
|
<NcTooltip v-if="embedMode"> |
|
|
|
<NcTooltip v-if="embedMode"> |
|
|
|
<template #title> {{ $t('general.code') }}</template> |
|
|
|
<template #title> {{ $t('general.code') }}</template> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
@ -296,8 +299,9 @@ const onToggleLink = () => { |
|
|
|
</NcTooltip> |
|
|
|
</NcTooltip> |
|
|
|
|
|
|
|
|
|
|
|
<div class="divider"></div> |
|
|
|
<div class="divider"></div> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<NcTooltip :disabled="editor.isActive('codeBlock')"> |
|
|
|
<NcTooltip :placement="isFormField ? 'bottom' : undefined" :disabled="editor.isActive('codeBlock')"> |
|
|
|
<template #title> {{ $t('general.link') }}</template> |
|
|
|
<template #title> {{ $t('general.link') }}</template> |
|
|
|
<NcButton |
|
|
|
<NcButton |
|
|
|
size="small" |
|
|
|
size="small" |
|
|
@ -306,7 +310,8 @@ const onToggleLink = () => { |
|
|
|
:disabled="editor.isActive('codeBlock')" |
|
|
|
:disabled="editor.isActive('codeBlock')" |
|
|
|
@click="onToggleLink" |
|
|
|
@click="onToggleLink" |
|
|
|
> |
|
|
|
> |
|
|
|
<div class="flex flex-row items-center px-0.5"> |
|
|
|
<GeneralIcon v-if="isFormField" icon="link2"></GeneralIcon> |
|
|
|
|
|
|
|
<div v-else class="flex flex-row items-center px-0.5"> |
|
|
|
<MdiLink /> |
|
|
|
<MdiLink /> |
|
|
|
<div class="!text-xs !ml-1">{{ $t('general.link') }}</div> |
|
|
|
<div class="!text-xs !ml-1">{{ $t('general.link') }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -343,6 +348,9 @@ const onToggleLink = () => { |
|
|
|
.bubble-menu.embed-mode { |
|
|
|
.bubble-menu.embed-mode { |
|
|
|
@apply border-transparent !shadow-none; |
|
|
|
@apply border-transparent !shadow-none; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.bubble-menu.form-field-mode { |
|
|
|
|
|
|
|
@apply bg-transparent px-0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.embed-mode.bubble-menu { |
|
|
|
.embed-mode.bubble-menu { |
|
|
|
@apply !py-0 !my-0 !border-0; |
|
|
|
@apply !py-0 !my-0 !border-0; |
|
|
|