@mframework/ui 0.1.0-beta.6 → 0.1.0-beta.7

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.
@@ -1,21 +1,27 @@
1
1
  import { defineNuxtPlugin } from 'nuxt/app'
2
- import lightGallery from 'lightgallery'
3
- import lgZoom from 'lg-zoom'
4
- import lgVideo from 'lg-video'
5
- import lgThumbnail from 'lg-thumbnail'
6
- import 'lightgallery/css/lightgallery.css'
7
- import 'lightgallery/css/lg-zoom.css'
8
- import 'lightgallery/css/lg-thumbnail.css'
9
- import 'lightgallery/css/lg-video.css'
10
2
 
11
- export default defineNuxtPlugin(() => {
12
- // You can expose a composable or directive later if you want.
13
- // For now, this ensures CSS + plugins are bundled.
14
- // Example directive could be added here if needed.
3
+ export default defineNuxtPlugin(async () => {
4
+ if (typeof window === 'undefined' || !window.document) return
5
+
6
+ await Promise.all([
7
+ import('lightgallery/css/lightgallery.css'),
8
+ import('lightgallery/css/lg-zoom.css'),
9
+ import('lightgallery/css/lg-thumbnail.css'),
10
+ import('lightgallery/css/lg-video.css')
11
+ ])
12
+
13
+ const [{ default: lightGallery }, { default: lgZoom }, { default: lgVideo }, { default: lgThumbnail }] = await Promise.all([
14
+ import('lightgallery'),
15
+ import('lg-zoom'),
16
+ import('lg-video'),
17
+ import('lg-thumbnail')
18
+ ])
19
+
15
20
  document.querySelectorAll('.lightgallery').forEach((element) => {
16
- lightGallery(element as HTMLElement, {
21
+ if (!(element instanceof HTMLElement)) return
22
+ lightGallery(element, {
17
23
  plugins: [lgZoom, lgVideo, lgThumbnail],
18
- speed: 500,
24
+ speed: 500
19
25
  })
20
26
  })
21
27
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mframework/ui",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.7",
4
4
  "type": "module",
5
5
  "description": "Opiniated UI module for the M Framework.",
6
6
  "keywords": [