@bagelink/vue 1.15.352 → 1.15.356

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.15.352",
4
+ "version": "1.15.356",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -31,7 +31,7 @@
31
31
  "require": "./dist/index.cjs",
32
32
  "import": "./dist/index.mjs"
33
33
  },
34
- "./style.css": "./dist/style.css",
34
+ "./style.css": "./src/styles/bagel.css",
35
35
  "./styles/core.css": "./src/styles/core.css",
36
36
  "./styles/fonts/admin.css": "./src/styles/fonts/admin.css",
37
37
  "./styles/fonts/ploni.css": "./src/styles/fonts/Ploni.css",
@@ -2,10 +2,11 @@
2
2
  import type { LightboxItem } from './lightbox.types'
3
3
 
4
4
  import { BglVideo, Btn, Icon, Zoomer, Image, normalizeURL, Swiper, downloadFile, useEscapeKey } from '@bagelink/vue'
5
- import { computed, ref, watch } from 'vue'
5
+ import { computed, nextTick, ref, watch } from 'vue'
6
6
  import LightboxImage from './LightboxImage.vue'
7
7
 
8
8
  const isOpen = ref(false)
9
+ const dialogRef = ref<HTMLDialogElement | null>(null)
9
10
  const group = ref<LightboxItem[]>([])
10
11
  const currentIndex = ref(0)
11
12
  const currentItem = computed<LightboxItem>(() => group.value[currentIndex.value])
@@ -46,11 +47,14 @@ function selectItem(index: number) {
46
47
  // The v-model will handle updating the swiper
47
48
  }
48
49
 
49
- watch(() => isOpen.value, (val) => {
50
+ watch(() => isOpen.value, async (val) => {
50
51
  if (val) {
51
52
  document.body.style.overflow = 'hidden'
53
+ await nextTick()
54
+ if (!dialogRef.value?.open) dialogRef.value?.showModal()
52
55
  } else {
53
56
  document.body.style.overflow = ''
57
+ if (dialogRef.value?.open) dialogRef.value.close()
54
58
  }
55
59
  })
56
60
 
@@ -64,7 +68,12 @@ defineExpose({ open, close })
64
68
 
65
69
  <template>
66
70
  <transition name="fade">
67
- <div v-if="isOpen" class="bgl-lightbox-overlay" @keydown.esc="close">
71
+ <dialog
72
+ v-if="isOpen"
73
+ ref="dialogRef"
74
+ class="bgl-lightbox-overlay"
75
+ @cancel.prevent="close"
76
+ >
68
77
  <div class="flex start w-100 space-between p-025 z-9" @click="close">
69
78
  <Btn flat class="color-white" icon="close" @click="close" />
70
79
  <div v-if="currentItem?.enableZoom && currentItem?.type === 'image'" class="center">
@@ -137,7 +146,7 @@ defineExpose({ open, close })
137
146
  :class="{ active: currentIndex === index }" @click.stop="selectItem(index)" />
138
147
  </template>
139
148
  </div>
140
- </div>
149
+ </dialog>
141
150
  </transition>
142
151
  </template>
143
152
 
@@ -166,6 +175,11 @@ width: fit-content;
166
175
  position: fixed;
167
176
  width: 100vw;
168
177
  height: 100vh;
178
+ max-width: none;
179
+ max-height: none;
180
+ margin: 0;
181
+ padding: 0;
182
+ border: 0;
169
183
  display: grid;
170
184
  grid-template-rows: 50px 1fr 100px;
171
185
  z-index: 9999;
@@ -174,6 +188,10 @@ background: rgba(0, 0, 0, 0.8);
174
188
  overflow: hidden;
175
189
  }
176
190
 
191
+ .bgl-lightbox-overlay::backdrop {
192
+ background: transparent;
193
+ }
194
+
177
195
  /* Top controls row */
178
196
  .bgl-lightbox-overlay>.flex:first-child {
179
197
  grid-row: 1;