@grapesjs/studio-sdk-plugins 1.0.9 → 1.0.10
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/dist/api.d.ts +3 -1
- package/dist/dialogComponent/index.cjs.js +15 -15
- package/dist/dialogComponent/index.es.js +136 -111
- package/dist/dialogComponent/index.umd.js +15 -15
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +168 -143
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/index.cjs.js +14 -14
- package/dist/index.es.js +1886 -1856
- package/dist/index.umd.js +14 -14
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -220
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/lightGalleryComponent/types.d.ts +3 -3
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +136 -111
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/prosemirror/index.cjs.js +9 -9
- package/dist/prosemirror/index.es.js +1267 -1242
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +315 -290
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/utils.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
F,
|
|
1
|
+
const ie = "app.grapesjs.com", re = "app-stage.grapesjs.com", Y = [
|
|
3
2
|
ie,
|
|
3
|
+
re,
|
|
4
4
|
"localhost",
|
|
5
5
|
"127.0.0.1",
|
|
6
6
|
".local-credentialless.webcontainer.io",
|
|
@@ -9,122 +9,146 @@ const F = "app.grapesjs.com", ie = "app-stage.grapesjs.com", Y = [
|
|
|
9
9
|
// For stackblitz.com demos
|
|
10
10
|
"-sandpack.codesandbox.io"
|
|
11
11
|
// For Sandpack demos
|
|
12
|
-
],
|
|
13
|
-
const e =
|
|
14
|
-
return !!e && (Y.includes(e) || Y.some((
|
|
15
|
-
}
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
async function ye({
|
|
12
|
+
], ue = "license:check:start", he = "license:check:end", ge = () => typeof window < "u", be = ({ isDev: e, isStage: l }) => `${e ? "" : `https://${l ? re : ie}`}/api`, de = () => {
|
|
13
|
+
const e = ge() && window.location.hostname;
|
|
14
|
+
return !!e && (Y.includes(e) || Y.some((l) => e.endsWith(l)));
|
|
15
|
+
};
|
|
16
|
+
var E = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(E || {});
|
|
17
|
+
async function me({
|
|
19
18
|
path: e,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
baseApiUrl: l,
|
|
20
|
+
method: a = "GET",
|
|
21
|
+
headers: n = {},
|
|
22
|
+
params: s,
|
|
23
|
+
body: u
|
|
23
24
|
}) {
|
|
24
|
-
const
|
|
25
|
-
method:
|
|
25
|
+
const p = `${l || be({ isDev: !1, isStage: !1 })}${e}`, h = {
|
|
26
|
+
method: a,
|
|
26
27
|
headers: {
|
|
27
28
|
"Content-Type": "application/json",
|
|
28
|
-
...
|
|
29
|
+
...n
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
34
|
-
throw new Error(`HTTP error! status: ${
|
|
35
|
-
return
|
|
32
|
+
u && (h.body = JSON.stringify(u));
|
|
33
|
+
const c = s ? new URLSearchParams(s).toString() : "", i = c ? `?${c}` : "", b = await fetch(`${p}${i}`, h);
|
|
34
|
+
if (!b.ok)
|
|
35
|
+
throw new Error(`HTTP error! status: ${b.status}`);
|
|
36
|
+
return b.json();
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const ee = {
|
|
39
|
+
[E.free]: 0,
|
|
40
|
+
[E.startup]: 10,
|
|
41
|
+
[E.business]: 20,
|
|
42
|
+
[E.enterprise]: 30
|
|
43
|
+
};
|
|
44
|
+
function ye(e) {
|
|
45
|
+
const l = e;
|
|
46
|
+
return l.init = (a) => (n) => e(n, a), l;
|
|
40
47
|
}
|
|
41
|
-
const
|
|
42
|
-
async function
|
|
48
|
+
const ve = (e) => /* @__PURE__ */ ye(e);
|
|
49
|
+
async function fe({
|
|
43
50
|
editor: e,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
plan: l,
|
|
52
|
+
pluginName: a,
|
|
53
|
+
licenseKey: n,
|
|
54
|
+
cleanup: s
|
|
47
55
|
}) {
|
|
48
|
-
let
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
i
|
|
56
|
+
let u = "", r = !1;
|
|
57
|
+
const p = de(), h = (i) => {
|
|
58
|
+
console.warn("Cleanup plugin:", a, "Reason:", i), s();
|
|
59
|
+
}, c = (i = {}) => {
|
|
60
|
+
var L;
|
|
61
|
+
const { error: b, sdkLicense: C } = i, T = (L = i.plan) == null ? void 0 : L.category;
|
|
62
|
+
if (!(C || i.license) || b)
|
|
63
|
+
h(b || "Invalid license");
|
|
64
|
+
else if (T) {
|
|
65
|
+
const G = ee[l], V = ee[T];
|
|
66
|
+
G > V && h({ pluginRequiredPlan: l, licensePlan: T });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
e.on(ue, (i) => {
|
|
70
|
+
u = i == null ? void 0 : i.baseApiUrl, r = !0;
|
|
71
|
+
}), e.on(he, (i) => {
|
|
72
|
+
c(i);
|
|
54
73
|
}), setTimeout(async () => {
|
|
55
|
-
if (!
|
|
56
|
-
if (
|
|
57
|
-
|
|
74
|
+
if (!r) {
|
|
75
|
+
if (p) return;
|
|
76
|
+
if (n) {
|
|
77
|
+
const i = await Te({ licenseKey: n, pluginName: a, baseApiUrl: u });
|
|
78
|
+
i && c(i);
|
|
79
|
+
} else
|
|
80
|
+
h("The `licenseKey` option not provided");
|
|
58
81
|
}
|
|
59
82
|
}, 2e3);
|
|
60
83
|
}
|
|
61
|
-
async function
|
|
84
|
+
async function Te(e) {
|
|
85
|
+
const { licenseKey: l, pluginName: a, baseApiUrl: n } = e;
|
|
62
86
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
87
|
+
return (await me({
|
|
88
|
+
baseApiUrl: n,
|
|
89
|
+
path: `/sdk/${l || "na"}`,
|
|
65
90
|
method: "POST",
|
|
66
|
-
|
|
91
|
+
params: {
|
|
67
92
|
d: window.location.hostname,
|
|
68
|
-
pn:
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return console.error("Error during SDK license check:", a), !1;
|
|
93
|
+
pn: a
|
|
94
|
+
}
|
|
95
|
+
})).result || {};
|
|
96
|
+
} catch (s) {
|
|
97
|
+
return console.error("Error during SDK license check:", s), !1;
|
|
74
98
|
}
|
|
75
99
|
}
|
|
76
|
-
const z = (e,
|
|
100
|
+
const z = (e, l) => {
|
|
77
101
|
var a;
|
|
78
|
-
return !!((a = e == null ? void 0 : e.hasAttribute) != null && a.call(e,
|
|
102
|
+
return !!((a = e == null ? void 0 : e.hasAttribute) != null && a.call(e, l));
|
|
79
103
|
};
|
|
80
|
-
var
|
|
81
|
-
const
|
|
104
|
+
var P = /* @__PURE__ */ ((e) => (e.image = "image", e.video = "video", e.external = "external", e))(P || {});
|
|
105
|
+
const k = "lightGallery", te = `${k}-item`, D = "data-lightgallery", ae = `${D}-item`, H = "toggle", I = {
|
|
82
106
|
image: '<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',
|
|
83
107
|
video: '<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',
|
|
84
108
|
gallery: '<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',
|
|
85
109
|
galleryItem: '<svg viewBox="0 0 24 24"><path d="M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2M8 14H6v-2h2v2m0-3H6V9h2v2m0-3H6V6h2v2m7 6h-5v-2h5v2m3-3h-8V9h8v2m0-3h-8V6h8v2Z"/></svg>',
|
|
86
110
|
external: '<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',
|
|
87
111
|
eye: '<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'
|
|
88
|
-
},
|
|
112
|
+
}, B = { propKeys: [], props: {}, traits: [] }, M = (e, l = {}) => {
|
|
89
113
|
var s;
|
|
90
|
-
const a = {},
|
|
91
|
-
for (const
|
|
92
|
-
const { value:
|
|
93
|
-
|
|
94
|
-
const { subTraits: h = {} } =
|
|
95
|
-
for (const
|
|
96
|
-
(s = h[
|
|
97
|
-
const
|
|
98
|
-
a[
|
|
114
|
+
const a = {}, n = [];
|
|
115
|
+
for (const u in e) {
|
|
116
|
+
const { value: r, ...p } = e[u];
|
|
117
|
+
n.push({ id: u, name: u, changeProp: !0, category: l.category, ...p }), a[u] = r;
|
|
118
|
+
const { subTraits: h = {} } = p;
|
|
119
|
+
for (const c in p.subTraits)
|
|
120
|
+
(s = h[c]) == null || s.forEach((i) => {
|
|
121
|
+
const b = i.id || i.name;
|
|
122
|
+
a[b] = i.value;
|
|
99
123
|
});
|
|
100
124
|
}
|
|
101
125
|
return {
|
|
102
126
|
propKeys: Object.keys(a),
|
|
103
127
|
props: a,
|
|
104
|
-
traits:
|
|
128
|
+
traits: n
|
|
105
129
|
};
|
|
106
|
-
}, Z = (e,
|
|
107
|
-
const a = e.getTrait(
|
|
108
|
-
e.removeTrait(
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
130
|
+
}, Z = (e, l) => {
|
|
131
|
+
const a = e.getTrait(l), n = a.get("category"), s = a.get("subTraits") || {}, r = (Object.values(s).flat() || []).map((c) => c.id || c.name);
|
|
132
|
+
e.removeTrait(r);
|
|
133
|
+
const p = s[a.getValue()], h = e.getTraitIndex(l) + 1;
|
|
134
|
+
p && e.addTrait(
|
|
135
|
+
p.map((c) => ({ category: n, ...c })),
|
|
112
136
|
{ at: h }
|
|
113
137
|
);
|
|
114
|
-
}, W = (e,
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
const s =
|
|
138
|
+
}, W = (e, l) => {
|
|
139
|
+
l.forEach((a) => {
|
|
140
|
+
const n = e.getTrait(a);
|
|
141
|
+
if (!n || !n.get("subTraits")) return;
|
|
142
|
+
const s = n.changeProp ? `change:${a}` : `change:attributes:${a}`;
|
|
119
143
|
e.on(s, () => Z(e, a)), Z(e, a);
|
|
120
144
|
});
|
|
121
|
-
},
|
|
122
|
-
const s = e.getTrait(
|
|
123
|
-
const
|
|
124
|
-
return h.changeProp ? `change:${
|
|
125
|
-
}),
|
|
126
|
-
|
|
127
|
-
},
|
|
145
|
+
}, we = (e, l, a) => {
|
|
146
|
+
const s = e.getTrait(l).get("subTraits") || {}, r = (Object.values(s).flat() || []).map((h) => {
|
|
147
|
+
const c = h.name || h.id;
|
|
148
|
+
return h.changeProp ? `change:${c}` : `change:attributes:${c}`;
|
|
149
|
+
}), p = Array.from(new Set(r));
|
|
150
|
+
p.length && e.on(p.join(" "), a);
|
|
151
|
+
}, Se = {
|
|
128
152
|
// startAnimationDuration: {
|
|
129
153
|
// type: 'number',
|
|
130
154
|
// label: 'Start duration',
|
|
@@ -133,12 +157,12 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
133
157
|
// step: 50,
|
|
134
158
|
// min: 0
|
|
135
159
|
// },
|
|
136
|
-
[
|
|
160
|
+
[H]: {
|
|
137
161
|
type: "button",
|
|
138
162
|
label: "Toggle Gallery",
|
|
139
|
-
command: (e,
|
|
140
|
-
var a,
|
|
141
|
-
return (
|
|
163
|
+
command: (e, l) => {
|
|
164
|
+
var a, n;
|
|
165
|
+
return (n = (a = l.target) == null ? void 0 : a.getView()) == null ? void 0 : n.toggleGallery();
|
|
142
166
|
}
|
|
143
167
|
},
|
|
144
168
|
speed: {
|
|
@@ -238,7 +262,7 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
238
262
|
visible: ({ component: e }) => !!e.getTrait("closable").getValue(),
|
|
239
263
|
value: !0
|
|
240
264
|
}
|
|
241
|
-
},
|
|
265
|
+
}, xe = {
|
|
242
266
|
thumbnail: {
|
|
243
267
|
category: { id: "thumbnail-options", label: "Thumbnail Options" },
|
|
244
268
|
type: "checkbox",
|
|
@@ -340,7 +364,7 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
340
364
|
]
|
|
341
365
|
}
|
|
342
366
|
}
|
|
343
|
-
},
|
|
367
|
+
}, ke = {
|
|
344
368
|
autoplay: {
|
|
345
369
|
category: { id: "autoplay-options", label: "Autoplay options" },
|
|
346
370
|
type: "checkbox",
|
|
@@ -394,7 +418,7 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
394
418
|
]
|
|
395
419
|
}
|
|
396
420
|
}
|
|
397
|
-
},
|
|
421
|
+
}, Ie = {
|
|
398
422
|
zoom: {
|
|
399
423
|
category: { id: "zoom-options", label: "Zoom options" },
|
|
400
424
|
type: "checkbox",
|
|
@@ -446,147 +470,147 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
446
470
|
]
|
|
447
471
|
}
|
|
448
472
|
}
|
|
449
|
-
},
|
|
473
|
+
}, f = "sourceType", U = "data-iframe", R = {
|
|
450
474
|
name: "href",
|
|
451
475
|
type: "file",
|
|
452
476
|
label: "Image Source"
|
|
453
|
-
},
|
|
477
|
+
}, N = {
|
|
454
478
|
name: "data-src",
|
|
455
479
|
label: "Video Source",
|
|
456
480
|
placeholder: "https://www.youtube.com/watch?v=..."
|
|
457
|
-
},
|
|
481
|
+
}, F = {
|
|
458
482
|
name: "data-poster",
|
|
459
483
|
label: "Video Poster",
|
|
460
484
|
type: "file"
|
|
461
|
-
},
|
|
485
|
+
}, ne = {
|
|
462
486
|
name: "data-src",
|
|
463
487
|
label: "External Source",
|
|
464
488
|
placeholder: "https://some-external-source.com/...."
|
|
465
|
-
},
|
|
489
|
+
}, ce = {
|
|
466
490
|
label: "Caption",
|
|
467
491
|
name: "data-sub-html",
|
|
468
492
|
placeholder: "My caption",
|
|
469
493
|
changeProp: !1
|
|
470
|
-
},
|
|
471
|
-
[
|
|
494
|
+
}, Le = {
|
|
495
|
+
[H]: {
|
|
472
496
|
type: "button",
|
|
473
497
|
label: "Toggle Gallery",
|
|
474
|
-
command: (e,
|
|
475
|
-
var s,
|
|
476
|
-
const a =
|
|
477
|
-
if (
|
|
478
|
-
const
|
|
479
|
-
|
|
498
|
+
command: (e, l) => {
|
|
499
|
+
var s, u;
|
|
500
|
+
const a = l.target, n = (s = a == null ? void 0 : a.closestType(k)) == null ? void 0 : s.getView();
|
|
501
|
+
if (n && a) {
|
|
502
|
+
const r = ((u = n.getLightGallery()) == null ? void 0 : u.items) || [], p = Array.from(r).indexOf(a.getEl());
|
|
503
|
+
p >= 0 && n.toggleGallery(p);
|
|
480
504
|
}
|
|
481
505
|
}
|
|
482
506
|
},
|
|
483
|
-
[
|
|
507
|
+
[f]: {
|
|
484
508
|
type: "radio",
|
|
485
509
|
label: "Source type",
|
|
486
510
|
labelToTitle: !0,
|
|
487
511
|
value: "image",
|
|
488
512
|
subTraits: {
|
|
489
|
-
image: [
|
|
490
|
-
video: [
|
|
491
|
-
external: [
|
|
513
|
+
image: [R],
|
|
514
|
+
video: [N, F],
|
|
515
|
+
external: [ne]
|
|
492
516
|
},
|
|
493
517
|
options: [
|
|
494
|
-
{ id: "image", label:
|
|
495
|
-
{ id: "video", label:
|
|
496
|
-
{ id: "external", label:
|
|
518
|
+
{ id: "image", label: R.label || "", icon: I.image },
|
|
519
|
+
{ id: "video", label: N.label || "", icon: I.video },
|
|
520
|
+
{ id: "external", label: ne.label || "", icon: I.external }
|
|
497
521
|
]
|
|
498
522
|
},
|
|
499
|
-
subHtml:
|
|
523
|
+
subHtml: ce
|
|
500
524
|
// This unfortuntaly breaks other thumbnails
|
|
501
525
|
// customThumb: traitCustomThumb
|
|
502
|
-
},
|
|
503
|
-
const { Blocks: a, Components:
|
|
504
|
-
toolbarIconOpen:
|
|
526
|
+
}, Ae = "lightGalleryComponent", le = "lgThumbnail", Pe = "lgVideo", oe = "lgAutoplay", se = "lgZoom", A = "https://cdn.jsdelivr.net/npm/lightgallery@2.8.2", Ee = function(e, l = {}) {
|
|
527
|
+
const { Blocks: a, Components: n } = e, s = "LightGallery", u = "LightGallery Item", r = {
|
|
528
|
+
toolbarIconOpen: I.eye,
|
|
505
529
|
block: {},
|
|
506
|
-
lgLicenseKey: "
|
|
530
|
+
lgLicenseKey: "92DE1DB8-7986-4F02-B908-514F97678D28",
|
|
507
531
|
defaultSrc: "https://placehold.co/200/777/white.png?text=Image",
|
|
508
|
-
plugins: [
|
|
532
|
+
plugins: [le, Pe, oe, se],
|
|
509
533
|
cdnScript: [
|
|
510
|
-
`${
|
|
511
|
-
`${
|
|
512
|
-
`${
|
|
513
|
-
`${
|
|
514
|
-
`${
|
|
534
|
+
`${A}/lightgallery.min.js`,
|
|
535
|
+
`${A}/plugins/thumbnail/lg-thumbnail.min.js`,
|
|
536
|
+
`${A}/plugins/video/lg-video.min.js`,
|
|
537
|
+
`${A}/plugins/autoplay/lg-autoplay.min.js`,
|
|
538
|
+
`${A}/plugins/zoom/lg-zoom.min.js`
|
|
515
539
|
],
|
|
516
|
-
cdnStyle: `${
|
|
517
|
-
...
|
|
518
|
-
}, { block:
|
|
519
|
-
const
|
|
520
|
-
var
|
|
521
|
-
const
|
|
522
|
-
...
|
|
523
|
-
licenseKey:
|
|
524
|
-
speed:
|
|
525
|
-
startAnimationDuration:
|
|
526
|
-
thumbMargin:
|
|
527
|
-
thumbWidth:
|
|
528
|
-
slideShowInterval:
|
|
529
|
-
scale:
|
|
530
|
-
enableZoomAfter:
|
|
531
|
-
plugins: (
|
|
540
|
+
cdnStyle: `${A}/css/lightgallery-bundle.min.css`,
|
|
541
|
+
...l
|
|
542
|
+
}, { block: p, toolbarIconOpen: h, defaultSrc: c } = r, i = function(t) {
|
|
543
|
+
const o = this, g = window, { plugins: m, cdnScript: w, cdnStyle: O, inline: J, lgLicenseKey: pe, ...y } = t || {}, S = (d) => isNaN(d) ? void 0 : parseInt(d, 10), Q = () => {
|
|
544
|
+
var $;
|
|
545
|
+
const d = {
|
|
546
|
+
...y,
|
|
547
|
+
licenseKey: pe,
|
|
548
|
+
speed: S(y.speed),
|
|
549
|
+
startAnimationDuration: S(y.startAnimationDuration),
|
|
550
|
+
thumbMargin: S(y.thumbMargin),
|
|
551
|
+
thumbWidth: S(y.thumbWidth),
|
|
552
|
+
slideShowInterval: S(y.slideShowInterval),
|
|
553
|
+
scale: S(y.scale),
|
|
554
|
+
enableZoomAfter: S(y.enableZoomAfter),
|
|
555
|
+
plugins: (m || []).map((K) => g[K])
|
|
532
556
|
};
|
|
533
|
-
|
|
534
|
-
const j = (
|
|
535
|
-
|
|
557
|
+
J && (d.container = o, d.closable = !1);
|
|
558
|
+
const j = ($ = g.lightGallery) == null ? void 0 : $.call(g, o, d);
|
|
559
|
+
J && j.openGallery();
|
|
536
560
|
};
|
|
537
|
-
if (
|
|
561
|
+
if (g.lightGallery)
|
|
538
562
|
Q();
|
|
539
563
|
else {
|
|
540
|
-
const { head:
|
|
541
|
-
if (
|
|
542
|
-
const
|
|
543
|
-
|
|
564
|
+
const { head: d } = document, j = Array.isArray(w) ? [...w] : [w], $ = Array.isArray(O) ? [...O] : [O], K = (x) => {
|
|
565
|
+
if (x.length) {
|
|
566
|
+
const v = document.createElement("link");
|
|
567
|
+
v.href = x.shift(), v.rel = "stylesheet", d.appendChild(v), K(x);
|
|
544
568
|
}
|
|
545
|
-
}, X = (
|
|
546
|
-
if (
|
|
547
|
-
const
|
|
548
|
-
|
|
569
|
+
}, X = (x) => {
|
|
570
|
+
if (x.length) {
|
|
571
|
+
const v = document.createElement("script");
|
|
572
|
+
v.src = x.shift(), v.onerror = v.onload = X.bind(null, x), d.appendChild(v);
|
|
549
573
|
} else
|
|
550
574
|
Q();
|
|
551
575
|
};
|
|
552
|
-
|
|
576
|
+
K($), X(j);
|
|
553
577
|
}
|
|
554
|
-
},
|
|
555
|
-
const
|
|
556
|
-
if (!h || !
|
|
557
|
-
const { toolbar:
|
|
558
|
-
id:
|
|
578
|
+
}, b = (t) => {
|
|
579
|
+
const o = t.getTrait(H);
|
|
580
|
+
if (!h || !o) return;
|
|
581
|
+
const { toolbar: g } = t, m = {
|
|
582
|
+
id: H,
|
|
559
583
|
label: h,
|
|
560
|
-
command: () => setTimeout(() =>
|
|
584
|
+
command: () => setTimeout(() => o.runCommand(), 100)
|
|
561
585
|
};
|
|
562
|
-
!
|
|
586
|
+
!g.find((O) => O.id === m.id) && (g == null || g.unshift(m));
|
|
563
587
|
};
|
|
564
|
-
let
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
block:
|
|
588
|
+
let C = [];
|
|
589
|
+
const T = r.plugins || [], _ = M(Se), L = T.includes(le) ? M(xe) : B, G = T.includes(oe) ? M(ke) : B, V = T.includes(se) ? M(Ie) : B;
|
|
590
|
+
n.addType(k, {
|
|
591
|
+
block: p && {
|
|
568
592
|
label: s,
|
|
569
|
-
media:
|
|
593
|
+
media: I.gallery,
|
|
570
594
|
category: "Extra",
|
|
571
595
|
select: !0,
|
|
572
|
-
...
|
|
596
|
+
...r.block
|
|
573
597
|
},
|
|
574
|
-
isComponent: (t) => z(t,
|
|
598
|
+
isComponent: (t) => z(t, D),
|
|
575
599
|
extendFn: ["init", "initToolbar"],
|
|
576
600
|
model: {
|
|
577
601
|
defaults: {
|
|
578
602
|
name: s,
|
|
579
|
-
icon:
|
|
580
|
-
draggable: (t,
|
|
581
|
-
attributes: { [
|
|
582
|
-
components: { type:
|
|
583
|
-
script:
|
|
603
|
+
icon: I.gallery,
|
|
604
|
+
draggable: (t, o) => !o.is(k),
|
|
605
|
+
attributes: { [D]: !0 },
|
|
606
|
+
components: { type: te },
|
|
607
|
+
script: i,
|
|
584
608
|
selector: "",
|
|
585
609
|
exThumbImage: "",
|
|
586
|
-
cdnScript:
|
|
587
|
-
cdnStyle:
|
|
588
|
-
plugins:
|
|
589
|
-
lgLicenseKey:
|
|
610
|
+
cdnScript: r.cdnScript,
|
|
611
|
+
cdnStyle: r.cdnStyle,
|
|
612
|
+
plugins: r.plugins,
|
|
613
|
+
lgLicenseKey: r.lgLicenseKey,
|
|
590
614
|
"script-props": [
|
|
591
615
|
"lgLicenseKey",
|
|
592
616
|
"cdnScript",
|
|
@@ -594,22 +618,22 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
594
618
|
"plugins",
|
|
595
619
|
"selector",
|
|
596
620
|
"exThumbImage",
|
|
597
|
-
|
|
598
|
-
...
|
|
599
|
-
...
|
|
600
|
-
...
|
|
621
|
+
..._.propKeys,
|
|
622
|
+
...L.propKeys,
|
|
623
|
+
...G.propKeys,
|
|
624
|
+
...V.propKeys
|
|
601
625
|
],
|
|
602
|
-
|
|
603
|
-
...
|
|
604
|
-
...
|
|
605
|
-
...
|
|
606
|
-
traits: [
|
|
626
|
+
..._.props,
|
|
627
|
+
...L.props,
|
|
628
|
+
...G.props,
|
|
629
|
+
...V.props,
|
|
630
|
+
traits: [..._.traits, ...L.traits, ...G.traits, ...V.traits]
|
|
607
631
|
},
|
|
608
632
|
init() {
|
|
609
633
|
W(this, ["thumbnail"]), W(this, ["autoplay"]), W(this, ["zoom"]);
|
|
610
634
|
},
|
|
611
635
|
initToolbar() {
|
|
612
|
-
|
|
636
|
+
b(this);
|
|
613
637
|
}
|
|
614
638
|
},
|
|
615
639
|
extendFnView: ["init"],
|
|
@@ -621,7 +645,7 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
621
645
|
lgAfterClose: "onLgClose"
|
|
622
646
|
}),
|
|
623
647
|
init() {
|
|
624
|
-
const t =
|
|
648
|
+
const t = n.events.scriptUnmount;
|
|
625
649
|
t && this.listenTo(this.model, t, this.destroyLightGallery);
|
|
626
650
|
},
|
|
627
651
|
getLightGallery() {
|
|
@@ -636,83 +660,84 @@ const w = "lightGallery", ee = `${w}-item`, V = "data-lightgallery", te = `${V}-
|
|
|
636
660
|
t.lgOpened = !0;
|
|
637
661
|
},
|
|
638
662
|
isInlineGallery() {
|
|
639
|
-
var
|
|
663
|
+
var o;
|
|
640
664
|
const t = this.getLightGallery();
|
|
641
|
-
return ((
|
|
665
|
+
return ((o = t == null ? void 0 : t.settings) == null ? void 0 : o.container) === this.el;
|
|
642
666
|
},
|
|
643
667
|
onLgInit(t) {
|
|
644
668
|
this.el.__lg = t.detail.instance, !this.isInlineGallery() && this.disableLgInCanvas();
|
|
645
669
|
},
|
|
646
670
|
onLgOpen() {
|
|
647
|
-
const { em: t } = this, { Canvas:
|
|
648
|
-
|
|
671
|
+
const { em: t } = this, { Canvas: o } = t, g = this.getLightGallery();
|
|
672
|
+
C = o.getSpots(), setTimeout(() => o.removeSpots()), g.__lgOpened = !0;
|
|
649
673
|
},
|
|
650
674
|
onLgClose() {
|
|
651
675
|
const t = this.getLightGallery();
|
|
652
|
-
|
|
676
|
+
C.forEach((o) => this.em.Canvas.addSpot(o.attributes)), C = [], t.__lgOpened = !1, setTimeout(() => this.disableLgInCanvas());
|
|
653
677
|
},
|
|
654
678
|
toggleGallery(t) {
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
|
|
679
|
+
const o = this.getLightGallery();
|
|
680
|
+
if (o.__lgOpened) return o.closeGallery(!0);
|
|
681
|
+
o.lgOpened = !1, o.openGallery(t);
|
|
658
682
|
}
|
|
659
683
|
}
|
|
660
684
|
});
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
isComponent: (t) => z(t,
|
|
685
|
+
const q = M(Le);
|
|
686
|
+
n.addType(te, {
|
|
687
|
+
isComponent: (t) => z(t, ae) || t.tagName === "A" && z(t.parentElement, D),
|
|
664
688
|
extendFn: ["init", "initToolbar"],
|
|
665
689
|
model: {
|
|
666
690
|
defaults: {
|
|
667
691
|
tagName: "a",
|
|
668
|
-
name:
|
|
669
|
-
icon:
|
|
670
|
-
attributes: { [
|
|
671
|
-
components: { type: "image", attributes: { alt: "Image", src:
|
|
672
|
-
...
|
|
673
|
-
traits: [...
|
|
692
|
+
name: u,
|
|
693
|
+
icon: I.galleryItem,
|
|
694
|
+
attributes: { [ae]: !0, href: c },
|
|
695
|
+
components: { type: "image", attributes: { alt: "Image", src: c } },
|
|
696
|
+
...q.props,
|
|
697
|
+
traits: [...q.traits]
|
|
674
698
|
},
|
|
675
699
|
init() {
|
|
676
|
-
const t = [
|
|
677
|
-
this.initSourceType(), this.on(t, this.updateTraits), this.updateTraits({ init: !0 }), this.initScriptUpdate(),
|
|
700
|
+
const t = [f].map((o) => `change:${o}`).join(" ");
|
|
701
|
+
this.initSourceType(), this.on(t, this.updateTraits), this.updateTraits({ init: !0 }), this.initScriptUpdate(), we(this, f, this.triggerGalleryUpdate);
|
|
678
702
|
},
|
|
679
703
|
initToolbar() {
|
|
680
|
-
|
|
704
|
+
b(this);
|
|
681
705
|
},
|
|
682
706
|
initScriptUpdate() {
|
|
683
|
-
const t = [
|
|
707
|
+
const t = [ce.name].map((o) => `change:attributes:${o}`).join(" ");
|
|
684
708
|
this.on(t, this.triggerGalleryUpdate);
|
|
685
709
|
},
|
|
686
710
|
triggerGalleryUpdate(...t) {
|
|
687
|
-
var
|
|
688
|
-
(
|
|
711
|
+
var o;
|
|
712
|
+
(o = this.closestType(k)) == null || o.__scriptPropsChange(...t);
|
|
689
713
|
},
|
|
690
714
|
updateTraits(t = {}) {
|
|
691
|
-
const { changed:
|
|
692
|
-
if (
|
|
693
|
-
Z(this,
|
|
694
|
-
const
|
|
695
|
-
if (
|
|
696
|
-
this.removeAttributes([
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
} else
|
|
715
|
+
const { changed: o } = this, { init: g } = t;
|
|
716
|
+
if (o[f] || g) {
|
|
717
|
+
Z(this, f);
|
|
718
|
+
const m = this.getTrait(f).getValue();
|
|
719
|
+
if (m === P.image) {
|
|
720
|
+
this.removeAttributes([N.name, F.name, U]);
|
|
721
|
+
const w = this.getTrait(R.name);
|
|
722
|
+
w.setValue(w.getValue() || c);
|
|
723
|
+
} else m === P.video ? this.removeAttributes([U]) : m === P.external && this.addAttributes({ [U]: !0 });
|
|
700
724
|
}
|
|
701
725
|
},
|
|
702
726
|
initSourceType() {
|
|
703
727
|
const t = this.getAttributes({ noClass: !0, noStyle: !0 });
|
|
704
|
-
t[
|
|
728
|
+
t[U] ? this.set(f, P.external) : (t[N.name] || t[F.name]) && this.set(f, P.video);
|
|
705
729
|
}
|
|
706
730
|
}
|
|
707
|
-
}),
|
|
731
|
+
}), fe({
|
|
708
732
|
editor: e,
|
|
709
|
-
|
|
710
|
-
|
|
733
|
+
plan: E.free,
|
|
734
|
+
licenseKey: r.licenseKey,
|
|
735
|
+
pluginName: Ae,
|
|
711
736
|
cleanup: () => {
|
|
712
|
-
a.remove(
|
|
737
|
+
a.remove(k), n.removeType(k);
|
|
713
738
|
}
|
|
714
739
|
});
|
|
715
|
-
},
|
|
740
|
+
}, Ce = ve(Ee);
|
|
716
741
|
export {
|
|
717
|
-
|
|
742
|
+
Ce as default
|
|
718
743
|
};
|