+
@@ -104,17 +138,21 @@ const detailsBody = activeExtension.value?.description ? marked.parse(activeExte
+
+
diff --git a/packages/nc-gui/components/extensions/Extension.vue b/packages/nc-gui/components/extensions/Extension.vue
index 39fbbbdcc3..e3f1096938 100644
--- a/packages/nc-gui/components/extensions/Extension.vue
+++ b/packages/nc-gui/components/extensions/Extension.vue
@@ -11,7 +11,7 @@ const {
extensionsLoaded,
availableExtensions,
eventBus,
- getExtensionIcon,
+ getExtensionAssetsUrl,
duplicateExtension,
showExtensionDetails,
} = useExtensions()
@@ -56,26 +56,34 @@ const { fullscreen, collapsed } = useProvideExtensionHelper(extension)
const component = ref
(null)
-const extensionManifest = ref(null)
+const extensionManifest = ref()
-const extensionMinHeight = computed(() => {
- switch (extension.value.extensionId) {
- case 'nc-data-exporter':
- return 'min-h-[300px] h-[300px]'
- case 'nc-json-exporter':
- return 'min-h-[194px] h-[194px]'
- case 'nc-csv-import':
- return 'min-h-[180px] h-[180px]'
+const fullscreenModalMaxWidth = computed(() => {
+ const modalMaxWidth = {
+ xs: 'min(calc(100vw - 32px), 448px)',
+ sm: 'min(calc(100vw - 32px), 640px)',
+ md: 'min(calc(100vw - 48px), 900px)',
+ lg: 'min(calc(100vw - 48px), 1280px)',
}
+
+ return extensionManifest.value?.config?.modalMaxWith
+ ? modalMaxWidth[extensionManifest.value?.config?.modalMaxWith] || modalMaxWidth.lg
+ : modalMaxWidth.lg
})
+const expandExtension = () => {
+ if (!collapsed.value) return
+
+ collapsed.value = false
+}
+
onMounted(() => {
until(extensionsLoaded)
.toMatch((v) => v)
.then(() => {
extensionManifest.value = availableExtensions.value.find((ext) => ext.id === extension.value.extensionId)
- if (!extensionManifest) {
+ if (!extensionManifest.value) {
return
}
@@ -94,7 +102,11 @@ onMounted(() => {
// close fullscreen on escape key press
useEventListener('keydown', (e) => {
- if (e.key === 'Escape') {
+ // Check if the event target or its closest parent is an input, select, or textarea
+ const isFormElement = (e?.target as HTMLElement)?.closest('input, select, textarea')
+
+ // If the target is not a form element and the key is 'Escape', close fullscreen
+ if (e.key === 'Escape' && !isFormElement) {
fullscreen.value = false
}
})
@@ -132,78 +144,103 @@ eventBus.on((event, payload) => {
-