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