@fy-/fws-vue 2.3.27 → 2.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,36 +129,29 @@ const currentImage = computed(() => {
129
129
  const imageCount = computed(() => props.images.length)
130
130
  const currentIndex = computed(() => modelValue.value + 1)
131
131
 
132
- // Simple direct approach that correctly handles the info panel
132
+ // Simple image sizing that relies on flexbox layout to handle the info panel
133
133
  const updateImageSizes = useDebounceFn(() => {
134
134
  // Get the main image
135
135
  const mainImage = document.querySelector('.image-display img') as HTMLImageElement
136
136
  if (!mainImage) return
137
137
 
138
- // Get exact measurements of all UI elements
139
- const topHeight = topControlsRef.value?.offsetHeight || 0
140
-
141
- // CRITICAL: Always include the info panel height when visible
142
- const infoHeight = infoPanel.value && infoPanelRef.value
143
- ? infoPanelRef.value.offsetHeight
144
- : 0
145
-
146
138
  // Standard padding
147
139
  const padding = 24
148
140
 
149
- // Calculate available height by subtracting ALL elements
150
- const availableHeight = windowHeight.value - topHeight - infoHeight - padding
151
-
152
- // Apply the exact height constraint to the image
153
- mainImage.style.maxHeight = `${availableHeight}px`
154
- mainImage.style.width = 'auto'
155
-
156
141
  // Handle width constraints
157
142
  const sidebarWidth = sidePanel.value ? 256 : 0
158
143
  const availableWidth = windowWidth.value - sidebarWidth - padding * 2
144
+
145
+ // Set width constraints
159
146
  mainImage.style.maxWidth = windowWidth.value <= 768
160
147
  ? '90vw'
161
148
  : `${availableWidth}px`
149
+
150
+ // Let height be auto to preserve aspect ratio and fit in flexbox container
151
+ mainImage.style.height = 'auto'
152
+
153
+ // Set a reasonable max-height if needed
154
+ mainImage.style.maxHeight = '75vh'
162
155
  }, 50)
163
156
 
164
157
  // Modal controls
@@ -261,9 +254,16 @@ function toggleInfoPanel() {
261
254
  infoPanel.value = !infoPanel.value
262
255
  resetControlsTimer()
263
256
 
264
- // Update layout after panel toggle
257
+ // Update layout immediately AND after nextTick to ensure DOM updates
258
+ updateImageSizes()
259
+
260
+ // Schedule multiple updates to handle any transition effects
265
261
  nextTick(() => {
266
262
  updateImageSizes()
263
+
264
+ // Additional delayed updates to catch transitions
265
+ setTimeout(() => updateImageSizes(), 50)
266
+ setTimeout(() => updateImageSizes(), 300)
267
267
  })
268
268
  }
269
269
 
@@ -556,9 +556,9 @@ onUnmounted(() => {
556
556
  ref="galleryContentRef"
557
557
  class="w-full h-full flex flex-col lg:flex-row"
558
558
  >
559
- <!-- Main Image Area - Fills available space -->
559
+ <!-- Main Image Area with flex column layout -->
560
560
  <div
561
- class="relative flex-1 h-full flex items-center justify-center"
561
+ class="relative flex-1 h-full flex flex-col"
562
562
  :style="{ paddingTop: `${topControlsHeight}px` }"
563
563
  :class="{ 'lg:pr-64': sidePanel, 'lg:max-w-[calc(100%-16rem)]': sidePanel }"
564
564
  style="max-width: 100%;"
@@ -586,10 +586,10 @@ onUnmounted(() => {
586
586
  </div>
587
587
  </transition>
588
588
 
589
- <!-- Image Display Container -->
589
+ <!-- Image Container - flex-grow to fill available space -->
590
590
  <div
591
591
  ref="imageContainerRef"
592
- class="image-container flex-grow flex items-center justify-center"
592
+ class="flex-grow flex items-center justify-center"
593
593
  @touchstart="touchStart"
594
594
  @touchend="touchEnd"
595
595
  >
@@ -659,7 +659,7 @@ onUnmounted(() => {
659
659
  </div>
660
660
  </transition>
661
661
 
662
- <!-- Info Panel Below Image -->
662
+ <!-- Info Panel directly in flex column flow -->
663
663
  <transition
664
664
  enter-active-class="transition-all duration-300 ease-out"
665
665
  enter-from-class="opacity-0 transform translate-y-4"
@@ -671,9 +671,7 @@ onUnmounted(() => {
671
671
  <div
672
672
  v-if="infoPanel && images[modelValue]"
673
673
  ref="infoPanelRef"
674
- class="info-panel absolute bottom-0 left-0 right-0 px-4 py-3 backdrop-blur-md bg-fv-neutral-900/70 z-45"
675
- @transitionend="updateImageSizes"
676
- @resize="updateImageSizes"
674
+ class="w-full px-4 py-3 backdrop-blur-md bg-fv-neutral-900/80 border-t border-fv-neutral-800"
677
675
  >
678
676
  <slot :value="images[modelValue]" />
679
677
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "2.3.27",
3
+ "version": "2.3.29",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/fy-to/FWJS#readme",