@mframework/ui 0.1.0-beta.5 → 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.1.0-beta.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Opiniated UI module for the M Framework.",
|
|
6
6
|
"keywords": [
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
"mframework",
|
|
12
12
|
"meeovi"
|
|
13
13
|
],
|
|
14
|
-
"main": "dist/module.
|
|
14
|
+
"main": "dist/module.mjs",
|
|
15
15
|
"module": "dist/module.mjs",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"import": "./dist/module.mjs"
|
|
18
|
+
"import": "./dist/module.mjs",
|
|
19
|
+
"require": "./dist/module.mjs"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
"files": [
|