@grapesjs/studio-sdk-plugins 1.0.33-rc.1 → 1.0.33

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