|
|
|
@ -17,8 +17,6 @@ const {
|
|
|
|
|
|
|
|
|
|
const { $e } = useNuxtApp() |
|
|
|
|
|
|
|
|
|
const isReady = ref(false) |
|
|
|
|
|
|
|
|
|
const searchExtensionRef = ref<HTMLInputElement>() |
|
|
|
|
|
|
|
|
|
const extensionHeaderRef = ref<HTMLDivElement>() |
|
|
|
@ -27,6 +25,13 @@ const searchQuery = ref<string>('')
|
|
|
|
|
|
|
|
|
|
const showSearchBox = ref(false) |
|
|
|
|
|
|
|
|
|
const panelSize = computed(() => { |
|
|
|
|
if (isPanelExpanded.value) { |
|
|
|
|
return extensionPanelSize.value |
|
|
|
|
} |
|
|
|
|
return 0 |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const { width } = useElementSize(extensionHeaderRef) |
|
|
|
|
|
|
|
|
|
const isOpenSearchBox = computed(() => { |
|
|
|
@ -54,14 +59,6 @@ const toggleMarket = () => {
|
|
|
|
|
isMarketVisible.value = !isMarketVisible.value |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const normalizePaneMaxWidth = computed(() => { |
|
|
|
|
if (isReady.value) { |
|
|
|
|
return 60 |
|
|
|
|
} else { |
|
|
|
|
return extensionPanelSize.value |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; element: ExtensionType } }) => { |
|
|
|
|
let { |
|
|
|
|
moved: { newIndex = 0, oldIndex = 0, element }, |
|
|
|
@ -100,20 +97,6 @@ const onMove = async (_event: { moved: { newIndex: number; oldIndex: number; ele
|
|
|
|
|
$e('a:extension:reorder') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
defineExpose({ |
|
|
|
|
onReady: () => { |
|
|
|
|
isReady.value = true |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
watch(isPanelExpanded, (newValue) => { |
|
|
|
|
if (newValue && !isReady.value) { |
|
|
|
|
setTimeout(() => { |
|
|
|
|
isReady.value = true |
|
|
|
|
}, 300) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
onClickOutside(searchExtensionRef, () => { |
|
|
|
|
if (searchQuery.value) { |
|
|
|
|
return |
|
|
|
@ -130,17 +113,9 @@ onMounted(() => {
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<Pane |
|
|
|
|
v-if="isPanelExpanded" |
|
|
|
|
:size="extensionPanelSize" |
|
|
|
|
min-size="10%" |
|
|
|
|
max-size="60%" |
|
|
|
|
class="nc-extension-pane" |
|
|
|
|
:style="{ |
|
|
|
|
minWidth: isReady ? '300px' : `${normalizePaneMaxWidth}%`, |
|
|
|
|
maxWidth: `${normalizePaneMaxWidth}%`, |
|
|
|
|
}" |
|
|
|
|
> |
|
|
|
|
<Pane :size="panelSize" max-size="60%" class="nc-extension-pane"> |
|
|
|
|
<Transition name="layout" :duration="150"> |
|
|
|
|
<div v-if="isPanelExpanded" class="flex flex-col"> |
|
|
|
|
<div |
|
|
|
|
ref="extensionHeaderRef" |
|
|
|
|
class="h-[var(--toolbar-height)] flex items-center gap-3 px-4 py-2 border-b-1 border-gray-200 bg-white" |
|
|
|
@ -249,6 +224,8 @@ onMounted(() => {
|
|
|
|
|
:extension-id="detailsExtensionId" |
|
|
|
|
:from="detailsFrom" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</Transition> |
|
|
|
|
</Pane> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|