|
|
|
@ -16,7 +16,7 @@ withDefaults(defineProps<Props>(), {
|
|
|
|
|
|
|
|
|
|
const { eventBus, getExtensionAssetsUrl, duplicateExtension, showExtensionDetails } = useExtensions() |
|
|
|
|
|
|
|
|
|
const { fullscreen, collapsed, extension, extensionManifest, activeError } = useExtensionHelperOrThrow() |
|
|
|
|
const { fullscreen, collapsed, extension, extensionManifest, activeError, showExpandBtn } = useExtensionHelperOrThrow() |
|
|
|
|
|
|
|
|
|
const titleInput = ref<HTMLInputElement | null>(null) |
|
|
|
|
|
|
|
|
@ -24,6 +24,10 @@ const titleEditMode = ref<boolean>(false)
|
|
|
|
|
|
|
|
|
|
const tempTitle = ref<string>(extension.value.title) |
|
|
|
|
|
|
|
|
|
const showExpandButton = computed(() => { |
|
|
|
|
return showExpandBtn.value && !activeError.value |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const enableEditMode = () => { |
|
|
|
|
titleEditMode.value = true |
|
|
|
|
tempTitle.value = extension.value.title |
|
|
|
@ -82,13 +86,22 @@ const handleDuplicateExtension = async (id: string, open: boolean = false) => {
|
|
|
|
|
:src="getExtensionAssetsUrl(extensionManifest.iconUrl)" |
|
|
|
|
alt="icon" |
|
|
|
|
class="h-8 w-8 object-contain flex-none" |
|
|
|
|
:class="{ |
|
|
|
|
'mx-1': !isFullscreen, |
|
|
|
|
}" |
|
|
|
|
/> |
|
|
|
|
<div v-if="titleEditMode" class="flex-1"> |
|
|
|
|
<div |
|
|
|
|
v-if="titleEditMode" |
|
|
|
|
class="flex-1" |
|
|
|
|
:class="{ |
|
|
|
|
'mr-1': !isFullscreen, |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<a-input |
|
|
|
|
ref="titleInput" |
|
|
|
|
v-model:value="tempTitle" |
|
|
|
|
type="text" |
|
|
|
|
class="flex-1 !h-8 !px-1 !py-1 !-ml-1 !rounded-lg extension-title" |
|
|
|
|
class="!h-8 !px-1 !py-1 !-ml-1 !rounded-lg extension-title" |
|
|
|
|
:class="{ |
|
|
|
|
'w-4/5': !isFullscreen, |
|
|
|
|
'!text-lg !font-semibold max-w-[420px]': isFullscreen, |
|
|
|
@ -109,6 +122,7 @@ const handleDuplicateExtension = async (id: string, open: boolean = false) => {
|
|
|
|
|
class="extension-title cursor-pointer" |
|
|
|
|
:class="{ |
|
|
|
|
'text-lg font-semibold ': isFullscreen, |
|
|
|
|
'mr-1': !isFullscreen, |
|
|
|
|
}" |
|
|
|
|
@dblclick.stop="enableEditMode" |
|
|
|
|
@click.stop |
|
|
|
@ -126,19 +140,24 @@ const handleDuplicateExtension = async (id: string, open: boolean = false) => {
|
|
|
|
|
@clear-data="extension.clear()" |
|
|
|
|
@delete="extension.delete()" |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
<template v-if="!isFullscreen"> |
|
|
|
|
<NcButton v-if="!activeError" size="xs" type="text" class="nc-extension-expand-btn !px-1" @click.stop="fullscreen = true"> |
|
|
|
|
<NcButton |
|
|
|
|
v-if="showExpandButton" |
|
|
|
|
size="xs" |
|
|
|
|
type="text" |
|
|
|
|
class="nc-extension-expand-btn !px-1" |
|
|
|
|
@click.stop="fullscreen = true" |
|
|
|
|
> |
|
|
|
|
<GeneralIcon icon="ncMaximize2" class="h-3.5 w-3.5" /> |
|
|
|
|
</NcButton> |
|
|
|
|
<NcButton size="xs" type="text" class="!px-1" @click.stop="collapsed = !collapsed"> |
|
|
|
|
<GeneralIcon :icon="collapsed ? 'arrowDown' : 'arrowUp'" class="flex-none" /> |
|
|
|
|
</NcButton> |
|
|
|
|
</template> |
|
|
|
|
<template v-else> |
|
|
|
|
<NcButton :size="isFullscreen ? 'small' : 'xs'" type="text" class="flex-none !px-1" @click="fullscreen = false"> |
|
|
|
|
<GeneralIcon icon="close" /> |
|
|
|
|
</NcButton> |
|
|
|
|
</template> |
|
|
|
|
<NcButton v-else :size="isFullscreen ? 'small' : 'xs'" type="text" class="flex-none !px-1" @click="fullscreen = false"> |
|
|
|
|
<GeneralIcon icon="close" /> |
|
|
|
|
</NcButton> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|