@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36
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/accordionComponent/index.cjs.js +7 -7
- package/dist/accordionComponent/index.es.js +175 -162
- package/dist/accordionComponent/index.umd.js +7 -7
- package/dist/aiChat/index.cjs.js +64 -64
- package/dist/aiChat/index.es.js +5785 -5757
- package/dist/aiChat/index.js +64 -64
- package/dist/aiChat/index.umd.js +63 -63
- package/dist/animationComponent/index.cjs.js +3 -3
- package/dist/animationComponent/index.es.js +204 -191
- package/dist/animationComponent/index.umd.js +3 -3
- package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
- package/dist/canvasAbsoluteMode/index.es.js +183 -170
- package/dist/canvasAbsoluteMode/index.umd.js +1 -1
- package/dist/canvasEmptyState/index.cjs.js +1 -1
- package/dist/canvasEmptyState/index.es.js +134 -121
- package/dist/canvasEmptyState/index.umd.js +1 -1
- package/dist/canvasFullSize/index.cjs.js +9 -9
- package/dist/canvasFullSize/index.es.js +165 -152
- package/dist/canvasFullSize/index.umd.js +9 -9
- package/dist/canvasGridMode/index.cjs.js +5 -5
- package/dist/canvasGridMode/index.es.js +245 -232
- package/dist/canvasGridMode/index.umd.js +4 -4
- package/dist/canvasScreenshot/index.cjs.js +1 -1
- package/dist/canvasScreenshot/index.es.js +155 -142
- package/dist/canvasScreenshot/index.umd.js +1 -1
- package/dist/dataSourceEjs/index.cjs.js +9 -9
- package/dist/dataSourceEjs/index.es.js +257 -244
- package/dist/dataSourceEjs/index.umd.js +9 -9
- package/dist/dataSourceHandlebars/index.cjs.js +8 -8
- package/dist/dataSourceHandlebars/index.es.js +216 -203
- package/dist/dataSourceHandlebars/index.umd.js +7 -7
- package/dist/dialogComponent/index.cjs.js +14 -14
- package/dist/dialogComponent/index.es.js +141 -128
- package/dist/dialogComponent/index.umd.js +14 -14
- package/dist/flexComponent/index.cjs.js +13 -13
- package/dist/flexComponent/index.es.js +484 -471
- package/dist/flexComponent/index.umd.js +13 -13
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +173 -160
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
- package/dist/googleFontsAssetProvider/index.es.js +160 -147
- package/dist/googleFontsAssetProvider/index.umd.js +1 -1
- package/dist/iconifyComponent/index.cjs.js +2 -2
- package/dist/iconifyComponent/index.es.js +196 -183
- package/dist/iconifyComponent/index.umd.js +2 -2
- package/dist/index.cjs.js +25 -25
- package/dist/index.es.js +121 -108
- package/dist/index.umd.js +18 -18
- package/dist/layoutSidebarButtons/index.cjs.js +1 -1
- package/dist/layoutSidebarButtons/index.es.js +157 -144
- package/dist/layoutSidebarButtons/index.umd.js +1 -1
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -232
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/linkImageComponent/index.cjs.js +2 -2
- package/dist/linkImageComponent/index.es.js +106 -93
- package/dist/linkImageComponent/index.umd.js +2 -2
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +157 -144
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/presetPrintable/index.cjs.js +3 -3
- package/dist/presetPrintable/index.es.js +181 -168
- package/dist/presetPrintable/index.umd.js +3 -3
- package/dist/prosemirror/index.cjs.js +7 -7
- package/dist/prosemirror/index.es.js +385 -372
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/rendererReact/index.cjs.js +1 -1
- package/dist/rendererReact/index.es.js +200 -187
- package/dist/rendererReact/index.js +1 -1
- package/dist/rendererReact/index.umd.js +1 -1
- package/dist/rteTinyMce/index.cjs.js +2 -2
- package/dist/rteTinyMce/index.es.js +118 -105
- package/dist/rteTinyMce/index.umd.js +2 -2
- package/dist/shapeDividerComponent/index.cjs.js +4 -4
- package/dist/shapeDividerComponent/index.es.js +129 -116
- package/dist/shapeDividerComponent/index.umd.js +4 -4
- package/dist/swiperComponent/index.cjs.js +9 -9
- package/dist/swiperComponent/index.es.js +203 -190
- package/dist/swiperComponent/index.umd.js +7 -7
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +257 -244
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/youtubeAssetProvider/index.cjs.js +1 -1
- package/dist/youtubeAssetProvider/index.es.js +121 -108
- package/dist/youtubeAssetProvider/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const
|
|
2
|
-
se,
|
|
3
|
-
ue,
|
|
1
|
+
const re = "app.grapesjs.com", ce = "app-stage.grapesjs.com", ge = "app2.grapesjs.com", he = "app-stage2.grapesjs.com", ee = [
|
|
4
2
|
re,
|
|
3
|
+
ge,
|
|
4
|
+
ce,
|
|
5
5
|
he,
|
|
6
6
|
"localhost",
|
|
7
7
|
"127.0.0.1",
|
|
@@ -11,151 +11,164 @@ const se = "app.grapesjs.com", re = "app-stage.grapesjs.com", ue = "app2.grapesj
|
|
|
11
11
|
// For stackblitz.com demos
|
|
12
12
|
"-sandpack.codesandbox.io"
|
|
13
13
|
// For Sandpack demos
|
|
14
|
-
],
|
|
14
|
+
], be = "license:check:end", de = () => typeof window < "u", ye = ({
|
|
15
15
|
isDev: e,
|
|
16
|
-
isStage:
|
|
16
|
+
isStage: l,
|
|
17
17
|
isPlatform: t
|
|
18
|
-
}) => `${e ? "" : `https://${
|
|
19
|
-
const e =
|
|
20
|
-
return !!e && (
|
|
18
|
+
}) => `${e ? "" : `https://${l ? ce : re}`}/${t ? "platform-api" : "api"}`, me = () => {
|
|
19
|
+
const e = de() && window.location.hostname;
|
|
20
|
+
return !!e && (ee.includes(e) || ee.some((l) => e.endsWith(l)));
|
|
21
21
|
};
|
|
22
22
|
async function ve({
|
|
23
23
|
path: e,
|
|
24
|
-
baseApiUrl:
|
|
24
|
+
baseApiUrl: l,
|
|
25
25
|
method: t = "GET",
|
|
26
|
-
headers:
|
|
27
|
-
params:
|
|
28
|
-
body:
|
|
26
|
+
headers: o = {},
|
|
27
|
+
params: i,
|
|
28
|
+
body: g
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
30
|
+
const n = `${l || ye({ isDev: !1, isStage: !1 })}${e}`, u = {
|
|
31
31
|
method: t,
|
|
32
32
|
headers: {
|
|
33
33
|
"Content-Type": "application/json",
|
|
34
|
-
...
|
|
34
|
+
...o
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
throw new Error(`HTTP error! status: ${
|
|
41
|
-
return
|
|
37
|
+
g && (u.body = JSON.stringify(g));
|
|
38
|
+
const p = i ? new URLSearchParams(i).toString() : "", b = p ? `?${p}` : "", r = await fetch(`${n}${b}`, u);
|
|
39
|
+
if (!r.ok)
|
|
40
|
+
throw new Error(`HTTP error! status: ${r.status}`);
|
|
41
|
+
return r.json();
|
|
42
42
|
}
|
|
43
|
-
var
|
|
44
|
-
const
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
43
|
+
var E = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(E || {}), Z = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.toastRemove = "studio:toastRemove", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.dialogExportCode = "studio:dialogExportCode", e.dialogImportCode = "studio:dialogImportCode", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.clearPage = "studio:clearPage", e.projectFiles = "studio:projectFiles", e.validateCode = "studio:validateCode", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.getStateContextMenu = "studio:getStateContextMenu", e.setStateContextMenu = "studio:setStateContextMenu", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e.layoutUpdate = "studio:layoutUpdate", e.layoutGet = "studio:layoutGet", e.layoutConfigGet = "studio:layoutConfigGet", e.layoutConfigSet = "studio:layoutConfigSet", e.layoutComponentAdd = "studio:layoutComponentAdd", e.layoutComponentGet = "studio:layoutComponentGet", e.layoutComponentRemove = "studio:layoutComponentRemove", e.layoutComponentRender = "studio:layoutComponentRender", e.getStateTheme = "studio:getStateTheme", e.setStateTheme = "studio:setStateTheme", e.settings = "studio:settings", e.assetProviderGet = "studio:assetProviderGet", e.assetProviderAdd = "studio:assetProviderAdd", e.assetProviderRemove = "studio:assetProviderRemove", e.fontGet = "studio:fontGet", e.fontAdd = "studio:fontAdd", e.fontRemove = "studio:fontRemove", e.fontManagerOpen = "studio:fontManagerOpen", e.menuFontLoad = "studio:menuFontLoad", e.toggleStateDataSource = "studio:toggleStateDataSource", e.getStateDataSource = "studio:getStateDataSource", e.dataSourceSetGlobalData = "studio:dataSourceSetGlobalData", e.dataSourceSetImporter = "studio:dataSourceSetImporter", e.dataSourceSetExporter = "studio:dataSourceSetExporter", e.setDragAbsolute = "studio:setDragAbsolute", e))(Z || {});
|
|
44
|
+
const te = {
|
|
45
|
+
[E.free]: 0,
|
|
46
|
+
[E.startup]: 10,
|
|
47
|
+
[E.business]: 20,
|
|
48
|
+
[E.enterprise]: 30
|
|
49
49
|
};
|
|
50
50
|
function fe(e) {
|
|
51
|
-
const
|
|
52
|
-
return
|
|
51
|
+
const l = e;
|
|
52
|
+
return l.init = (t) => (o) => e(o, t), l;
|
|
53
53
|
}
|
|
54
54
|
const Te = (e) => /* @__PURE__ */ fe(e);
|
|
55
55
|
async function we({
|
|
56
56
|
editor: e,
|
|
57
|
-
plan:
|
|
57
|
+
plan: l,
|
|
58
58
|
pluginName: t,
|
|
59
|
-
licenseKey:
|
|
60
|
-
onLicenseCheckResponse:
|
|
61
|
-
cleanup:
|
|
59
|
+
licenseKey: o,
|
|
60
|
+
onLicenseCheckResponse: i,
|
|
61
|
+
cleanup: g
|
|
62
62
|
}) {
|
|
63
|
-
let
|
|
64
|
-
const
|
|
65
|
-
console.warn("Cleanup plugin:", t, "Reason:",
|
|
66
|
-
},
|
|
67
|
-
var
|
|
68
|
-
const { error:
|
|
69
|
-
if (!(
|
|
70
|
-
|
|
63
|
+
let c = "", n;
|
|
64
|
+
const u = (r) => {
|
|
65
|
+
console.warn("Cleanup plugin:", t, "Reason:", r), g();
|
|
66
|
+
}, p = (r = {}) => {
|
|
67
|
+
var G;
|
|
68
|
+
const { error: I, sdkLicense: O } = r, T = (G = r.plan) == null ? void 0 : G.category;
|
|
69
|
+
if (!(O || r.license) || I)
|
|
70
|
+
u(I || "Invalid license");
|
|
71
71
|
else if (T) {
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const M = te[l], _ = te[T];
|
|
73
|
+
M > _ && u({ pluginRequiredPlan: l, licensePlan: T });
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
e.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
76
|
+
e.Commands.has(Z.settings) && (n = e.runCommand(Z.settings), c = (n == null ? void 0 : n.baseUrl) || "");
|
|
77
|
+
const b = (r) => {
|
|
78
|
+
i == null || i(r), r && p(r);
|
|
79
|
+
};
|
|
80
|
+
if (!n) {
|
|
81
|
+
e.onReady(async () => {
|
|
82
|
+
if (!me())
|
|
83
|
+
if (o) {
|
|
84
|
+
const r = await Pe({ licenseKey: o, pluginName: t, baseApiUrl: c });
|
|
85
|
+
b(r);
|
|
86
|
+
} else
|
|
87
|
+
u("The `licenseKey` option not provided");
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (n.licensePlan || n.licenseError) {
|
|
92
|
+
const r = xe(n);
|
|
93
|
+
b(r);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
e.on(be, (r) => b(r));
|
|
90
97
|
}
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
const xe = (e) => ({
|
|
99
|
+
sdkLicense: e.license,
|
|
100
|
+
license: e.license,
|
|
101
|
+
error: e.licenseError,
|
|
102
|
+
plan: e.licensePlan
|
|
103
|
+
});
|
|
104
|
+
async function Pe(e) {
|
|
105
|
+
const { licenseKey: l, pluginName: t, baseApiUrl: o } = e;
|
|
93
106
|
try {
|
|
94
107
|
return (await ve({
|
|
95
|
-
baseApiUrl:
|
|
96
|
-
path: `/sdk/${
|
|
108
|
+
baseApiUrl: o,
|
|
109
|
+
path: `/sdk/${l || "na"}`,
|
|
97
110
|
method: "POST",
|
|
98
111
|
params: {
|
|
99
112
|
d: window.location.hostname,
|
|
100
113
|
pn: t
|
|
101
114
|
}
|
|
102
115
|
})).result || {};
|
|
103
|
-
} catch (
|
|
104
|
-
return console.error("Error during SDK license check:",
|
|
116
|
+
} catch (i) {
|
|
117
|
+
return console.error("Error during SDK license check:", i), !1;
|
|
105
118
|
}
|
|
106
119
|
}
|
|
107
|
-
const
|
|
120
|
+
const z = (e, l) => {
|
|
108
121
|
var t;
|
|
109
|
-
return !!((t = e == null ? void 0 : e.hasAttribute) != null && t.call(e,
|
|
110
|
-
},
|
|
111
|
-
var
|
|
112
|
-
const
|
|
122
|
+
return !!((t = e == null ? void 0 : e.hasAttribute) != null && t.call(e, l));
|
|
123
|
+
}, Ae = "lightGalleryComponent", Le = E.startup;
|
|
124
|
+
var S = /* @__PURE__ */ ((e) => (e.image = "image", e.video = "video", e.external = "external", e))(S || {});
|
|
125
|
+
const A = "lightGallery", ae = `${A}-item`, j = "data-lightgallery", oe = `${j}-item`, N = "toggle", L = {
|
|
113
126
|
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>',
|
|
114
127
|
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>',
|
|
115
128
|
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>',
|
|
116
129
|
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>',
|
|
117
130
|
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>',
|
|
118
131
|
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>'
|
|
119
|
-
},
|
|
120
|
-
var
|
|
121
|
-
const t = {},
|
|
122
|
-
for (const
|
|
123
|
-
const { value:
|
|
124
|
-
|
|
125
|
-
const { subTraits:
|
|
126
|
-
for (const
|
|
127
|
-
(
|
|
128
|
-
const
|
|
129
|
-
t[
|
|
132
|
+
}, F = { propKeys: [], props: {}, traits: [] }, V = (e, l = {}) => {
|
|
133
|
+
var i;
|
|
134
|
+
const t = {}, o = [];
|
|
135
|
+
for (const g in e) {
|
|
136
|
+
const { value: c, ...n } = e[g];
|
|
137
|
+
o.push({ id: g, name: g, changeProp: !0, category: l.category, ...n }), t[g] = c;
|
|
138
|
+
const { subTraits: u = {} } = n;
|
|
139
|
+
for (const p in n.subTraits)
|
|
140
|
+
(i = u[p]) == null || i.forEach((b) => {
|
|
141
|
+
const r = b.id || b.name;
|
|
142
|
+
t[r] = b.value;
|
|
130
143
|
});
|
|
131
144
|
}
|
|
132
145
|
return {
|
|
133
146
|
propKeys: Object.keys(t),
|
|
134
147
|
props: t,
|
|
135
|
-
traits:
|
|
148
|
+
traits: o
|
|
136
149
|
};
|
|
137
|
-
},
|
|
138
|
-
const t = e.getTrait(
|
|
139
|
-
e.removeTrait(
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
{ at:
|
|
150
|
+
}, q = (e, l) => {
|
|
151
|
+
const t = e.getTrait(l), o = t.get("category"), i = t.get("subTraits") || {}, c = (Object.values(i).flat() || []).map((p) => p.id || p.name);
|
|
152
|
+
e.removeTrait(c);
|
|
153
|
+
const n = i[t.getValue()], u = e.getTraitIndex(l) + 1;
|
|
154
|
+
n && e.addTrait(
|
|
155
|
+
n.map((p) => ({ category: o, ...p })),
|
|
156
|
+
{ at: u }
|
|
144
157
|
);
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
149
|
-
const
|
|
150
|
-
e.on(
|
|
158
|
+
}, W = (e, l) => {
|
|
159
|
+
l.forEach((t) => {
|
|
160
|
+
const o = e.getTrait(t);
|
|
161
|
+
if (!o || !o.get("subTraits")) return;
|
|
162
|
+
const i = o.changeProp ? `change:${t}` : `change:attributes:${t}`;
|
|
163
|
+
e.on(i, () => q(e, t)), q(e, t);
|
|
151
164
|
});
|
|
152
|
-
},
|
|
153
|
-
const
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
}),
|
|
157
|
-
|
|
158
|
-
},
|
|
165
|
+
}, Ie = (e, l, t) => {
|
|
166
|
+
const i = e.getTrait(l).get("subTraits") || {}, c = (Object.values(i).flat() || []).map((u) => {
|
|
167
|
+
const p = u.name || u.id;
|
|
168
|
+
return u.changeProp ? `change:${p}` : `change:attributes:${p}`;
|
|
169
|
+
}), n = Array.from(new Set(c));
|
|
170
|
+
n.length && e.on(n.join(" "), t);
|
|
171
|
+
}, Ge = {
|
|
159
172
|
// startAnimationDuration: {
|
|
160
173
|
// type: 'number',
|
|
161
174
|
// label: 'Start duration',
|
|
@@ -164,12 +177,12 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
164
177
|
// step: 50,
|
|
165
178
|
// min: 0
|
|
166
179
|
// },
|
|
167
|
-
[
|
|
180
|
+
[N]: {
|
|
168
181
|
type: "button",
|
|
169
182
|
label: "Toggle Gallery",
|
|
170
|
-
command: (e,
|
|
171
|
-
var t,
|
|
172
|
-
return (
|
|
183
|
+
command: (e, l) => {
|
|
184
|
+
var t, o;
|
|
185
|
+
return (o = (t = l.target) == null ? void 0 : t.getView()) == null ? void 0 : o.toggleGallery();
|
|
173
186
|
}
|
|
174
187
|
},
|
|
175
188
|
speed: {
|
|
@@ -371,7 +384,7 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
371
384
|
]
|
|
372
385
|
}
|
|
373
386
|
}
|
|
374
|
-
},
|
|
387
|
+
}, Se = {
|
|
375
388
|
autoplay: {
|
|
376
389
|
category: { id: "autoplay-options", label: "Autoplay options" },
|
|
377
390
|
type: "checkbox",
|
|
@@ -477,15 +490,15 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
477
490
|
]
|
|
478
491
|
}
|
|
479
492
|
}
|
|
480
|
-
}, f = "sourceType",
|
|
493
|
+
}, f = "sourceType", U = "data-iframe", J = {
|
|
481
494
|
name: "href",
|
|
482
495
|
type: "file",
|
|
483
496
|
label: "Image Source"
|
|
484
|
-
},
|
|
497
|
+
}, K = {
|
|
485
498
|
name: "data-src",
|
|
486
499
|
label: "Video Source",
|
|
487
500
|
placeholder: "https://www.youtube.com/watch?v=..."
|
|
488
|
-
},
|
|
501
|
+
}, C = {
|
|
489
502
|
name: "data-poster",
|
|
490
503
|
label: "Video Poster",
|
|
491
504
|
type: "file"
|
|
@@ -493,21 +506,21 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
493
506
|
name: "data-src",
|
|
494
507
|
label: "External Source",
|
|
495
508
|
placeholder: "https://some-external-source.com/...."
|
|
496
|
-
},
|
|
509
|
+
}, pe = {
|
|
497
510
|
label: "Caption",
|
|
498
511
|
name: "data-sub-html",
|
|
499
512
|
placeholder: "My caption",
|
|
500
513
|
changeProp: !1
|
|
501
|
-
},
|
|
502
|
-
[
|
|
514
|
+
}, Oe = {
|
|
515
|
+
[N]: {
|
|
503
516
|
type: "button",
|
|
504
517
|
label: "Toggle Gallery",
|
|
505
|
-
command: (e,
|
|
506
|
-
var
|
|
507
|
-
const t =
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
510
|
-
|
|
518
|
+
command: (e, l) => {
|
|
519
|
+
var i, g;
|
|
520
|
+
const t = l.target, o = (i = t == null ? void 0 : t.closestType(A)) == null ? void 0 : i.getView();
|
|
521
|
+
if (o && t) {
|
|
522
|
+
const c = ((g = o.getLightGallery()) == null ? void 0 : g.items) || [], n = Array.from(c).indexOf(t.getEl());
|
|
523
|
+
n >= 0 && o.toggleGallery(n);
|
|
511
524
|
}
|
|
512
525
|
}
|
|
513
526
|
},
|
|
@@ -517,107 +530,107 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
517
530
|
labelToTitle: !0,
|
|
518
531
|
value: "image",
|
|
519
532
|
subTraits: {
|
|
520
|
-
image: [
|
|
521
|
-
video: [
|
|
533
|
+
image: [J],
|
|
534
|
+
video: [K, C],
|
|
522
535
|
external: [le]
|
|
523
536
|
},
|
|
524
537
|
options: [
|
|
525
|
-
{ id: "image", label:
|
|
526
|
-
{ id: "video", label:
|
|
527
|
-
{ id: "external", label: le.label || "", icon:
|
|
538
|
+
{ id: "image", label: J.label || "", icon: L.image },
|
|
539
|
+
{ id: "video", label: K.label || "", icon: L.video },
|
|
540
|
+
{ id: "external", label: le.label || "", icon: L.external }
|
|
528
541
|
]
|
|
529
542
|
},
|
|
530
|
-
subHtml:
|
|
543
|
+
subHtml: pe
|
|
531
544
|
// This unfortuntaly breaks other thumbnails
|
|
532
545
|
// customThumb: traitCustomThumb
|
|
533
|
-
},
|
|
534
|
-
const { Blocks: t, Components:
|
|
535
|
-
toolbarIconOpen:
|
|
546
|
+
}, se = "lgThumbnail", Me = "lgVideo", ie = "lgAutoplay", ne = "lgZoom", k = "https://cdn.jsdelivr.net/npm/lightgallery@2.8.2", De = function(e, l = {}) {
|
|
547
|
+
const { Blocks: t, Components: o } = e, i = "LightGallery", g = "LightGallery Item", c = {
|
|
548
|
+
toolbarIconOpen: L.eye,
|
|
536
549
|
block: {},
|
|
537
550
|
lgLicenseKey: "92DE1DB8-7986-4F02-B908-514F97678D28",
|
|
538
551
|
defaultSrc: "https://placehold.co/200/777/white.png?text=Image",
|
|
539
|
-
plugins: [
|
|
552
|
+
plugins: [se, Me, ie, ne],
|
|
540
553
|
cdnScript: [
|
|
541
|
-
`${
|
|
542
|
-
`${
|
|
543
|
-
`${
|
|
544
|
-
`${
|
|
545
|
-
`${
|
|
554
|
+
`${k}/lightgallery.min.js`,
|
|
555
|
+
`${k}/plugins/thumbnail/lg-thumbnail.min.js`,
|
|
556
|
+
`${k}/plugins/video/lg-video.min.js`,
|
|
557
|
+
`${k}/plugins/autoplay/lg-autoplay.min.js`,
|
|
558
|
+
`${k}/plugins/zoom/lg-zoom.min.js`
|
|
546
559
|
],
|
|
547
|
-
cdnStyle: `${
|
|
548
|
-
...
|
|
549
|
-
}, { block:
|
|
550
|
-
const
|
|
551
|
-
var
|
|
552
|
-
const
|
|
553
|
-
...
|
|
554
|
-
licenseKey:
|
|
555
|
-
speed:
|
|
556
|
-
startAnimationDuration:
|
|
557
|
-
thumbMargin:
|
|
558
|
-
thumbWidth:
|
|
559
|
-
slideShowInterval:
|
|
560
|
-
scale:
|
|
561
|
-
enableZoomAfter:
|
|
562
|
-
plugins: (
|
|
560
|
+
cdnStyle: `${k}/css/lightgallery-bundle.min.css`,
|
|
561
|
+
...l
|
|
562
|
+
}, { block: n, toolbarIconOpen: u, defaultSrc: p } = c, b = function(a) {
|
|
563
|
+
const s = this, h = window, { plugins: y, cdnScript: w, cdnStyle: D, inline: Q, lgLicenseKey: ue, ...m } = a || {}, x = (d) => isNaN(d) ? void 0 : parseInt(d, 10), X = () => {
|
|
564
|
+
var B;
|
|
565
|
+
const d = {
|
|
566
|
+
...m,
|
|
567
|
+
licenseKey: ue,
|
|
568
|
+
speed: x(m.speed),
|
|
569
|
+
startAnimationDuration: x(m.startAnimationDuration),
|
|
570
|
+
thumbMargin: x(m.thumbMargin),
|
|
571
|
+
thumbWidth: x(m.thumbWidth),
|
|
572
|
+
slideShowInterval: x(m.slideShowInterval),
|
|
573
|
+
scale: x(m.scale),
|
|
574
|
+
enableZoomAfter: x(m.enableZoomAfter),
|
|
575
|
+
plugins: (y || []).map(($) => h[$])
|
|
563
576
|
};
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
|
|
577
|
+
Q && (d.container = s, d.closable = !1);
|
|
578
|
+
const H = (B = h.lightGallery) == null ? void 0 : B.call(h, s, d);
|
|
579
|
+
Q && H.openGallery();
|
|
567
580
|
};
|
|
568
|
-
if (
|
|
569
|
-
|
|
581
|
+
if (h.lightGallery)
|
|
582
|
+
X();
|
|
570
583
|
else {
|
|
571
|
-
const { head:
|
|
572
|
-
if (
|
|
584
|
+
const { head: d } = document, H = Array.isArray(w) ? [...w] : [w], B = Array.isArray(D) ? [...D] : [D], $ = (P) => {
|
|
585
|
+
if (P.length) {
|
|
573
586
|
const v = document.createElement("link");
|
|
574
|
-
v.href =
|
|
587
|
+
v.href = P.shift(), v.rel = "stylesheet", d.appendChild(v), $(P);
|
|
575
588
|
}
|
|
576
|
-
},
|
|
577
|
-
if (
|
|
589
|
+
}, Y = (P) => {
|
|
590
|
+
if (P.length) {
|
|
578
591
|
const v = document.createElement("script");
|
|
579
|
-
v.src =
|
|
592
|
+
v.src = P.shift(), v.onerror = v.onload = Y.bind(null, P), d.appendChild(v);
|
|
580
593
|
} else
|
|
581
|
-
|
|
594
|
+
X();
|
|
582
595
|
};
|
|
583
|
-
|
|
596
|
+
$(B), Y(H);
|
|
584
597
|
}
|
|
585
|
-
},
|
|
586
|
-
const
|
|
587
|
-
if (!
|
|
588
|
-
const { toolbar:
|
|
589
|
-
id:
|
|
590
|
-
label:
|
|
591
|
-
command: () => setTimeout(() =>
|
|
598
|
+
}, r = (a) => {
|
|
599
|
+
const s = a.getTrait(N);
|
|
600
|
+
if (!u || !s) return;
|
|
601
|
+
const { toolbar: h } = a, y = {
|
|
602
|
+
id: N,
|
|
603
|
+
label: u,
|
|
604
|
+
command: () => setTimeout(() => s.runCommand(), 100)
|
|
592
605
|
};
|
|
593
|
-
!
|
|
606
|
+
!h.find((D) => D.id === y.id) && (h == null || h.unshift(y));
|
|
594
607
|
};
|
|
595
|
-
let
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
block:
|
|
599
|
-
label:
|
|
600
|
-
media:
|
|
608
|
+
let I = [];
|
|
609
|
+
const O = c.plugins || [], T = V(Ge), R = O.includes(se) ? V(ke) : F, G = O.includes(ie) ? V(Se) : F, M = O.includes(ne) ? V(Ee) : F;
|
|
610
|
+
o.addType(A, {
|
|
611
|
+
block: n && {
|
|
612
|
+
label: i,
|
|
613
|
+
media: L.gallery,
|
|
601
614
|
category: "Extra",
|
|
602
615
|
select: !0,
|
|
603
|
-
...
|
|
616
|
+
...c.block
|
|
604
617
|
},
|
|
605
|
-
isComponent: (a) =>
|
|
618
|
+
isComponent: (a) => z(a, j),
|
|
606
619
|
extendFn: ["init", "initToolbar"],
|
|
607
620
|
model: {
|
|
608
621
|
defaults: {
|
|
609
|
-
name:
|
|
610
|
-
icon:
|
|
611
|
-
draggable: (a,
|
|
612
|
-
attributes: { [
|
|
613
|
-
components: { type:
|
|
622
|
+
name: i,
|
|
623
|
+
icon: L.gallery,
|
|
624
|
+
draggable: (a, s) => !s.is(A),
|
|
625
|
+
attributes: { [j]: !0 },
|
|
626
|
+
components: { type: ae },
|
|
614
627
|
script: b,
|
|
615
628
|
selector: "",
|
|
616
629
|
exThumbImage: "",
|
|
617
|
-
cdnScript:
|
|
618
|
-
cdnStyle:
|
|
619
|
-
plugins:
|
|
620
|
-
lgLicenseKey:
|
|
630
|
+
cdnScript: c.cdnScript,
|
|
631
|
+
cdnStyle: c.cdnStyle,
|
|
632
|
+
plugins: c.plugins,
|
|
633
|
+
lgLicenseKey: c.lgLicenseKey,
|
|
621
634
|
"script-props": [
|
|
622
635
|
"lgLicenseKey",
|
|
623
636
|
"cdnScript",
|
|
@@ -626,21 +639,21 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
626
639
|
"selector",
|
|
627
640
|
"exThumbImage",
|
|
628
641
|
...T.propKeys,
|
|
629
|
-
...
|
|
630
|
-
...
|
|
631
|
-
...
|
|
642
|
+
...R.propKeys,
|
|
643
|
+
...G.propKeys,
|
|
644
|
+
...M.propKeys
|
|
632
645
|
],
|
|
633
646
|
...T.props,
|
|
647
|
+
...R.props,
|
|
648
|
+
...G.props,
|
|
634
649
|
...M.props,
|
|
635
|
-
...
|
|
636
|
-
...O.props,
|
|
637
|
-
traits: [...T.traits, ...M.traits, ...k.traits, ...O.traits]
|
|
650
|
+
traits: [...T.traits, ...R.traits, ...G.traits, ...M.traits]
|
|
638
651
|
},
|
|
639
652
|
init() {
|
|
640
|
-
|
|
653
|
+
W(this, ["thumbnail"]), W(this, ["autoplay"]), W(this, ["zoom"]);
|
|
641
654
|
},
|
|
642
655
|
initToolbar() {
|
|
643
|
-
|
|
656
|
+
r(this);
|
|
644
657
|
}
|
|
645
658
|
},
|
|
646
659
|
extendFnView: ["init"],
|
|
@@ -652,7 +665,7 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
652
665
|
lgAfterClose: "onLgClose"
|
|
653
666
|
}),
|
|
654
667
|
init() {
|
|
655
|
-
this.listenTo(this.model,
|
|
668
|
+
this.listenTo(this.model, o.events.scriptUnmount, this.destroyLightGallery);
|
|
656
669
|
},
|
|
657
670
|
getLightGallery() {
|
|
658
671
|
return this.el.__lg;
|
|
@@ -666,84 +679,84 @@ const I = "lightGallery", te = `${I}-item`, U = "data-lightgallery", ae = `${U}-
|
|
|
666
679
|
a.lgOpened = !0;
|
|
667
680
|
},
|
|
668
681
|
isInlineGallery() {
|
|
669
|
-
var
|
|
682
|
+
var s;
|
|
670
683
|
const a = this.getLightGallery();
|
|
671
|
-
return ((
|
|
684
|
+
return ((s = a == null ? void 0 : a.settings) == null ? void 0 : s.container) === this.el;
|
|
672
685
|
},
|
|
673
686
|
onLgInit(a) {
|
|
674
687
|
this.el.__lg = a.detail.instance, !this.isInlineGallery() && this.disableLgInCanvas();
|
|
675
688
|
},
|
|
676
689
|
onLgOpen() {
|
|
677
|
-
const { em: a } = this, { Canvas:
|
|
678
|
-
|
|
690
|
+
const { em: a } = this, { Canvas: s } = a, h = this.getLightGallery();
|
|
691
|
+
I = s.getSpots(), setTimeout(() => s.removeSpots()), h.__lgOpened = !0;
|
|
679
692
|
},
|
|
680
693
|
onLgClose() {
|
|
681
694
|
const a = this.getLightGallery();
|
|
682
|
-
|
|
695
|
+
I.forEach((s) => this.em.Canvas.addSpot(s.attributes)), I = [], a.__lgOpened = !1, setTimeout(() => this.disableLgInCanvas());
|
|
683
696
|
},
|
|
684
697
|
toggleGallery(a) {
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
|
|
698
|
+
const s = this.getLightGallery();
|
|
699
|
+
if (s.__lgOpened) return s.closeGallery(!0);
|
|
700
|
+
s.lgOpened = !1, s.openGallery(a);
|
|
688
701
|
}
|
|
689
702
|
}
|
|
690
703
|
});
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
isComponent: (a) =>
|
|
704
|
+
const _ = V(Oe);
|
|
705
|
+
o.addType(ae, {
|
|
706
|
+
isComponent: (a) => z(a, oe) || a.tagName === "A" && z(a.parentElement, j),
|
|
694
707
|
extendFn: ["init", "initToolbar"],
|
|
695
708
|
model: {
|
|
696
709
|
defaults: {
|
|
697
710
|
tagName: "a",
|
|
698
|
-
name:
|
|
699
|
-
icon:
|
|
700
|
-
attributes: { [
|
|
701
|
-
components: { type: "image", attributes: { alt: "Image", src:
|
|
702
|
-
|
|
703
|
-
traits: [
|
|
711
|
+
name: g,
|
|
712
|
+
icon: L.galleryItem,
|
|
713
|
+
attributes: { [oe]: !0, href: p },
|
|
714
|
+
components: { type: "image", attributes: { alt: "Image", src: p } },
|
|
715
|
+
..._.props,
|
|
716
|
+
traits: [..._.traits]
|
|
704
717
|
},
|
|
705
718
|
init() {
|
|
706
|
-
const a = [f].map((
|
|
707
|
-
this.initSourceType(), this.on(a, this.updateTraits), this.updateTraits({ init: !0 }), this.initScriptUpdate(),
|
|
719
|
+
const a = [f].map((s) => `change:${s}`).join(" ");
|
|
720
|
+
this.initSourceType(), this.on(a, this.updateTraits), this.updateTraits({ init: !0 }), this.initScriptUpdate(), Ie(this, f, this.triggerGalleryUpdate);
|
|
708
721
|
},
|
|
709
722
|
initToolbar() {
|
|
710
|
-
|
|
723
|
+
r(this);
|
|
711
724
|
},
|
|
712
725
|
initScriptUpdate() {
|
|
713
|
-
const a = [
|
|
726
|
+
const a = [pe.name].map((s) => `change:attributes:${s}`).join(" ");
|
|
714
727
|
this.on(a, this.triggerGalleryUpdate);
|
|
715
728
|
},
|
|
716
729
|
triggerGalleryUpdate(...a) {
|
|
717
|
-
var
|
|
718
|
-
(
|
|
730
|
+
var s;
|
|
731
|
+
(s = this.closestType(A)) == null || s.__scriptPropsChange(...a);
|
|
719
732
|
},
|
|
720
733
|
updateTraits(a = {}) {
|
|
721
|
-
const { changed:
|
|
722
|
-
if (
|
|
723
|
-
|
|
724
|
-
const
|
|
725
|
-
if (
|
|
726
|
-
this.removeAttributes([
|
|
727
|
-
const w = this.getTrait(
|
|
728
|
-
w.setValue(w.getValue() ||
|
|
729
|
-
} else
|
|
734
|
+
const { changed: s } = this, { init: h } = a;
|
|
735
|
+
if (s[f] || h) {
|
|
736
|
+
q(this, f);
|
|
737
|
+
const y = this.getTrait(f).getValue();
|
|
738
|
+
if (y === S.image) {
|
|
739
|
+
this.removeAttributes([K.name, C.name, U]);
|
|
740
|
+
const w = this.getTrait(J.name);
|
|
741
|
+
w.setValue(w.getValue() || p);
|
|
742
|
+
} else y === S.video ? this.removeAttributes([U]) : y === S.external && this.addAttributes({ [U]: !0 });
|
|
730
743
|
}
|
|
731
744
|
},
|
|
732
745
|
initSourceType() {
|
|
733
746
|
const a = this.getAttributes({ noClass: !0, noStyle: !0 });
|
|
734
|
-
a[
|
|
747
|
+
a[U] ? this.set(f, S.external) : (a[K.name] || a[C.name]) && this.set(f, S.video);
|
|
735
748
|
}
|
|
736
749
|
}
|
|
737
750
|
}), we({
|
|
738
751
|
editor: e,
|
|
739
|
-
plan:
|
|
740
|
-
licenseKey:
|
|
741
|
-
pluginName:
|
|
752
|
+
plan: Le,
|
|
753
|
+
licenseKey: c.licenseKey,
|
|
754
|
+
pluginName: Ae,
|
|
742
755
|
cleanup: () => {
|
|
743
|
-
t.remove(
|
|
756
|
+
t.remove(A), o.removeType(A);
|
|
744
757
|
}
|
|
745
758
|
});
|
|
746
|
-
},
|
|
759
|
+
}, Ve = Te(De);
|
|
747
760
|
export {
|
|
748
|
-
|
|
761
|
+
Ve as default
|
|
749
762
|
};
|