@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.37

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 (92) hide show
  1. package/dist/accordionComponent/index.cjs.js +7 -7
  2. package/dist/accordionComponent/index.es.js +185 -159
  3. package/dist/accordionComponent/index.umd.js +7 -7
  4. package/dist/aiChat/clientToolsProcessors.d.ts +1 -2
  5. package/dist/aiChat/components/utils.d.ts +1 -0
  6. package/dist/aiChat/components/utilsTw.d.ts +11 -0
  7. package/dist/aiChat/index.cjs.js +75 -75
  8. package/dist/aiChat/index.es.js +9122 -8628
  9. package/dist/aiChat/index.js +75 -75
  10. package/dist/aiChat/index.umd.js +75 -75
  11. package/dist/aiChat/projectGeneration.d.ts +17 -0
  12. package/dist/animationComponent/index.cjs.js +3 -3
  13. package/dist/animationComponent/index.es.js +221 -195
  14. package/dist/animationComponent/index.umd.js +3 -3
  15. package/dist/canvasAbsoluteMode/index.cjs.js +1 -1
  16. package/dist/canvasAbsoluteMode/index.es.js +199 -173
  17. package/dist/canvasAbsoluteMode/index.umd.js +1 -1
  18. package/dist/canvasEmptyState/index.cjs.js +1 -1
  19. package/dist/canvasEmptyState/index.es.js +149 -123
  20. package/dist/canvasEmptyState/index.umd.js +1 -1
  21. package/dist/canvasFullSize/index.cjs.js +9 -9
  22. package/dist/canvasFullSize/index.es.js +186 -160
  23. package/dist/canvasFullSize/index.umd.js +9 -9
  24. package/dist/canvasGridMode/index.cjs.js +5 -5
  25. package/dist/canvasGridMode/index.es.js +263 -237
  26. package/dist/canvasGridMode/index.umd.js +2 -2
  27. package/dist/canvasScreenshot/index.cjs.js +1 -1
  28. package/dist/canvasScreenshot/index.es.js +168 -142
  29. package/dist/canvasScreenshot/index.umd.js +1 -1
  30. package/dist/dataSourceEjs/index.cjs.js +9 -9
  31. package/dist/dataSourceEjs/index.es.js +271 -245
  32. package/dist/dataSourceEjs/index.umd.js +9 -9
  33. package/dist/dataSourceHandlebars/index.cjs.js +8 -8
  34. package/dist/dataSourceHandlebars/index.es.js +232 -206
  35. package/dist/dataSourceHandlebars/index.umd.js +8 -8
  36. package/dist/dialogComponent/index.cjs.js +14 -14
  37. package/dist/dialogComponent/index.es.js +157 -131
  38. package/dist/dialogComponent/index.umd.js +14 -14
  39. package/dist/flexComponent/index.cjs.js +13 -13
  40. package/dist/flexComponent/index.es.js +497 -471
  41. package/dist/flexComponent/index.umd.js +13 -13
  42. package/dist/fsLightboxComponent/index.cjs.js +3 -3
  43. package/dist/fsLightboxComponent/index.es.js +189 -163
  44. package/dist/fsLightboxComponent/index.umd.js +3 -3
  45. package/dist/googleFontsAssetProvider/index.cjs.js +1 -1
  46. package/dist/googleFontsAssetProvider/index.es.js +175 -149
  47. package/dist/googleFontsAssetProvider/index.umd.js +1 -1
  48. package/dist/iconifyComponent/index.cjs.js +2 -2
  49. package/dist/iconifyComponent/index.es.js +207 -181
  50. package/dist/iconifyComponent/index.umd.js +2 -2
  51. package/dist/index.cjs.js +36 -36
  52. package/dist/index.es.js +917 -891
  53. package/dist/index.umd.js +36 -36
  54. package/dist/layoutSidebarButtons/index.cjs.js +1 -1
  55. package/dist/layoutSidebarButtons/index.es.js +192 -166
  56. package/dist/layoutSidebarButtons/index.umd.js +1 -1
  57. package/dist/lightGalleryComponent/index.cjs.js +1 -1
  58. package/dist/lightGalleryComponent/index.es.js +265 -239
  59. package/dist/lightGalleryComponent/index.umd.js +1 -1
  60. package/dist/linkImageComponent/index.cjs.js +2 -2
  61. package/dist/linkImageComponent/index.es.js +121 -95
  62. package/dist/linkImageComponent/index.umd.js +2 -2
  63. package/dist/listPagesComponent/index.cjs.js +5 -5
  64. package/dist/listPagesComponent/index.es.js +171 -145
  65. package/dist/listPagesComponent/index.umd.js +5 -5
  66. package/dist/presetPrintable/index.cjs.js +3 -3
  67. package/dist/presetPrintable/index.es.js +227 -201
  68. package/dist/presetPrintable/index.umd.js +3 -3
  69. package/dist/prosemirror/index.cjs.js +7 -7
  70. package/dist/prosemirror/index.es.js +457 -431
  71. package/dist/prosemirror/index.umd.js +8 -8
  72. package/dist/rendererReact/index.cjs.js +1 -1
  73. package/dist/rendererReact/index.es.js +248 -223
  74. package/dist/rendererReact/index.js +1 -1
  75. package/dist/rendererReact/index.umd.js +1 -1
  76. package/dist/rteTinyMce/index.cjs.js +2 -2
  77. package/dist/rteTinyMce/index.es.js +150 -124
  78. package/dist/rteTinyMce/index.umd.js +2 -2
  79. package/dist/shapeDividerComponent/index.cjs.js +4 -4
  80. package/dist/shapeDividerComponent/index.es.js +143 -117
  81. package/dist/shapeDividerComponent/index.umd.js +4 -4
  82. package/dist/swiperComponent/index.cjs.js +9 -9
  83. package/dist/swiperComponent/index.es.js +218 -192
  84. package/dist/swiperComponent/index.umd.js +7 -7
  85. package/dist/tableComponent/index.cjs.js +1 -1
  86. package/dist/tableComponent/index.es.js +275 -249
  87. package/dist/tableComponent/index.umd.js +1 -1
  88. package/dist/types.d.ts +1 -1
  89. package/dist/youtubeAssetProvider/index.cjs.js +1 -1
  90. package/dist/youtubeAssetProvider/index.es.js +134 -108
  91. package/dist/youtubeAssetProvider/index.umd.js +1 -1
  92. package/package.json +2 -2
@@ -1,264 +1,290 @@
1
- const k = "app.grapesjs.com", U = "app-stage.grapesjs.com", B = "app2.grapesjs.com", C = "app-stage2.grapesjs.com", D = [
2
- k,
3
- B,
1
+ const N = "app.grapesjs.com", S = "app-stage.grapesjs.com", H = "app2.grapesjs.com", U = "app-stage2.grapesjs.com", $ = [
2
+ N,
3
+ H,
4
+ S,
4
5
  U,
5
- C,
6
6
  "localhost",
7
7
  "127.0.0.1",
8
8
  ".local-credentialless.webcontainer.io",
9
9
  // For stackblitz.com demos
10
10
  ".local.webcontainer.io",
11
11
  // For stackblitz.com demos
12
- "-sandpack.codesandbox.io"
12
+ "-sandpack.codesandbox.io",
13
13
  // For Sandpack demos
14
- ], W = "license:check:start", F = "license:check:end", G = () => typeof window < "u", K = ({
15
- isDev: s,
16
- isStage: c,
17
- isPlatform: r
18
- }) => `${s ? "" : `https://${c ? U : k}`}/${r ? "platform-api" : "api"}`, Z = () => {
19
- const s = G() && window.location.hostname;
20
- return !!s && (D.includes(s) || D.some((c) => s.endsWith(c)));
14
+ ".claudemcpcontent.com",
15
+ // For Claude mcp app
16
+ ".web-sandbox.oaiusercontent.com"
17
+ // For OpenAI mcp app
18
+ ], F = "license:check:end", W = () => typeof window < "u", K = ({
19
+ isDev: e,
20
+ isStage: a,
21
+ isPlatform: c
22
+ }) => `${e ? "" : `https://${a ? S : N}`}/${c ? "platform-api" : "api"}`, Z = () => {
23
+ if (!W()) return "";
24
+ const { hostname: e } = window.location;
25
+ if (e) return e;
26
+ try {
27
+ return window.parent.location.hostname || "";
28
+ } catch {
29
+ return "";
30
+ }
31
+ }, q = () => {
32
+ const e = Z();
33
+ return !!e && ($.includes(e) || $.some((a) => e.endsWith(a)));
21
34
  };
22
- async function q({
23
- path: s,
24
- baseApiUrl: c,
25
- method: r = "GET",
35
+ async function z({
36
+ path: e,
37
+ baseApiUrl: a,
38
+ method: c = "GET",
26
39
  headers: l = {},
27
- params: a,
28
- body: m
40
+ params: r,
41
+ body: f
29
42
  }) {
30
- const f = `${c || K({ isDev: !1, isStage: !1 })}${s}`, b = {
31
- method: r,
43
+ const g = `${a || K({ isDev: !1, isStage: !1 })}${e}`, u = {
44
+ method: c,
32
45
  headers: {
33
46
  "Content-Type": "application/json",
34
47
  ...l
35
48
  }
36
49
  };
37
- m && (b.body = JSON.stringify(m));
38
- const d = a ? new URLSearchParams(a).toString() : "", v = d ? `?${d}` : "", n = await fetch(`${f}${v}`, b);
39
- if (!n.ok)
40
- throw new Error(`HTTP error! status: ${n.status}`);
41
- return n.json();
50
+ f && (u.body = JSON.stringify(f));
51
+ const y = r ? new URLSearchParams(r).toString() : "", v = y ? `?${y}` : "", s = await fetch(`${g}${v}`, u);
52
+ if (!s.ok)
53
+ throw new Error(`HTTP error! status: ${s.status}`);
54
+ return s.json();
42
55
  }
43
- var w = /* @__PURE__ */ ((s) => (s.free = "free", s.startup = "startup", s.business = "business", s.enterprise = "enterprise", s))(w || {});
44
- const H = {
56
+ var w = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(w || {}), B = /* @__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))(B || {});
57
+ const V = {
45
58
  [w.free]: 0,
46
59
  [w.startup]: 10,
47
60
  [w.business]: 20,
48
61
  [w.enterprise]: 30
49
62
  };
50
- function z(s) {
51
- const c = s;
52
- return c.init = (r) => (l) => s(l, r), c;
63
+ function J(e) {
64
+ const a = e;
65
+ return a.init = (c) => (l) => e(l, c), a;
53
66
  }
54
- const J = (s) => /* @__PURE__ */ z(s);
55
- async function R({
56
- editor: s,
57
- plan: c,
58
- pluginName: r,
67
+ const X = (e) => /* @__PURE__ */ J(e);
68
+ async function Y({
69
+ editor: e,
70
+ plan: a,
71
+ pluginName: c,
59
72
  licenseKey: l,
60
- onLicenseCheckResponse: a,
61
- cleanup: m
73
+ onLicenseCheckResponse: r,
74
+ cleanup: f
62
75
  }) {
63
- let h = "", f = !1;
64
- const b = Z(), d = (n) => {
65
- console.warn("Cleanup plugin:", r, "Reason:", n), m();
66
- }, v = (n = {}) => {
67
- var A;
68
- const { error: p, sdkLicense: E } = n, y = (A = n.plan) == null ? void 0 : A.category;
69
- if (!(E || n.license) || p)
70
- d(p || "Invalid license");
71
- else if (y) {
72
- const j = H[c], t = H[y];
73
- j > t && d({ pluginRequiredPlan: c, licensePlan: y });
76
+ let h = "", g;
77
+ const u = (s) => {
78
+ console.warn("Cleanup plugin:", c, "Reason:", s), f();
79
+ }, y = (s = {}) => {
80
+ var E;
81
+ const { error: p, sdkLicense: I } = s, T = (E = s.plan) == null ? void 0 : E.category;
82
+ if (!(I || s.license) || p)
83
+ u(p || "Invalid license");
84
+ else if (T) {
85
+ const O = V[a], t = V[T];
86
+ O > t && u({ pluginRequiredPlan: a, licensePlan: T });
74
87
  }
75
88
  };
76
- s.on(W, (n) => {
77
- h = n == null ? void 0 : n.baseApiUrl, f = !0;
78
- }), s.on(F, (n) => {
79
- a == null || a(n), v(n);
80
- }), setTimeout(async () => {
81
- if (!f) {
82
- if (b) return;
83
- if (l) {
84
- const n = await X({ licenseKey: l, pluginName: r, baseApiUrl: h });
85
- a == null || a(n), n && v(n);
86
- } else
87
- d("The `licenseKey` option not provided");
88
- }
89
- }, 2e3);
89
+ e.Commands.has(B.settings) && (g = e.runCommand(B.settings), h = (g == null ? void 0 : g.baseUrl) || "");
90
+ const v = (s) => {
91
+ r == null || r(s), s && y(s);
92
+ };
93
+ if (!g) {
94
+ e.onReady(async () => {
95
+ if (!q())
96
+ if (l) {
97
+ const s = await C({ licenseKey: l, pluginName: c, baseApiUrl: h });
98
+ v(s);
99
+ } else
100
+ u("The `licenseKey` option not provided");
101
+ });
102
+ return;
103
+ }
104
+ if (g.licensePlan || g.licenseError) {
105
+ const s = Q(g);
106
+ v(s);
107
+ return;
108
+ }
109
+ e.on(F, (s) => v(s));
90
110
  }
91
- async function X(s) {
92
- const { licenseKey: c, pluginName: r, baseApiUrl: l } = s;
111
+ const Q = (e) => ({
112
+ sdkLicense: e.license,
113
+ license: e.license,
114
+ error: e.licenseError,
115
+ plan: e.licensePlan
116
+ });
117
+ async function C(e) {
118
+ const { licenseKey: a, pluginName: c, baseApiUrl: l } = e;
93
119
  try {
94
- return (await q({
120
+ return (await z({
95
121
  baseApiUrl: l,
96
- path: `/sdk/${c || "na"}`,
122
+ path: `/sdk/${a || "na"}`,
97
123
  method: "POST",
98
124
  params: {
99
125
  d: window.location.hostname,
100
- pn: r
126
+ pn: c
101
127
  }
102
128
  })).result || {};
103
- } catch (a) {
104
- return console.error("Error during SDK license check:", a), !1;
129
+ } catch (r) {
130
+ return console.error("Error during SDK license check:", r), !1;
105
131
  }
106
132
  }
107
- const Y = "gjs-plg-", Q = "fsLightboxComponent", tt = w.startup, $ = "data-fslightbox", N = "data-type", et = "fslightbox-open", L = "fslightbox", x = {
133
+ const ee = "gjs-plg-", te = "fsLightboxComponent", oe = w.startup, D = "data-fslightbox", G = "data-type", se = "fslightbox-open", A = "fslightbox", P = {
108
134
  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
135
  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
136
  imageLightbox: '<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
137
  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>',
112
138
  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>'
113
- }, st = function(s, c = {}) {
114
- const { Blocks: r, Components: l } = s, a = "Lightbox", m = `${Y}${L}`, h = {
115
- toolbarIconOpen: x.eye,
139
+ }, ie = function(e, a = {}) {
140
+ const { Blocks: c, Components: l } = e, r = "Lightbox", f = `${ee}${A}`, h = {
141
+ toolbarIconOpen: P.eye,
116
142
  block: {},
117
143
  defaultSrc: "https://placehold.co/300/777/white.png?text=Image",
118
144
  cdnScript: "https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",
119
- ...c
120
- }, { block: f, toolbarIconOpen: b, defaultSrc: d } = h, v = function(t) {
121
- const e = this, i = "data-fslightbox", o = window, g = () => {
122
- var M;
123
- const u = o.refreshFsLightbox;
124
- u == null || u();
125
- const O = e.getAttribute(i);
126
- if ((M = o.fsLightboxInstances) == null || M[O], !o._isEditor) return;
127
- Array.from(document.querySelectorAll(`[${i}]`)).forEach((T) => {
128
- const S = T.onclick;
129
- T.onclick = function(I) {
130
- I.preventDefault();
131
- const P = T;
132
- !P.__skipLb && (S == null || S(I)), P.__skipLb = !0;
145
+ ...a
146
+ }, { block: g, toolbarIconOpen: u, defaultSrc: y } = h, v = function(t) {
147
+ const o = this, n = "data-fslightbox", i = window, b = () => {
148
+ var m;
149
+ const d = i.refreshFsLightbox;
150
+ d == null || d();
151
+ const k = o.getAttribute(n);
152
+ if ((m = i.fsLightboxInstances) == null || m[k], !i._isEditor) return;
153
+ Array.from(document.querySelectorAll(`[${n}]`)).forEach((L) => {
154
+ const x = L.onclick;
155
+ L.onclick = function(_) {
156
+ _.preventDefault();
157
+ const j = L;
158
+ !j.__skipLb && (x == null || x(_)), j.__skipLb = !0;
133
159
  };
134
160
  });
135
161
  };
136
- if (o.refreshFsLightbox)
137
- g();
162
+ if (i.refreshFsLightbox)
163
+ b();
138
164
  else {
139
- const u = document.createElement("script");
140
- u.src = t.cdnScript, u.onload = g, document.head.appendChild(u);
165
+ const d = document.createElement("script");
166
+ d.src = t.cdnScript, d.onload = b, document.head.appendChild(d);
141
167
  }
142
- }, n = (t) => ({
143
- id: `${L}-open-lb`,
144
- label: b,
168
+ }, s = (t) => ({
169
+ id: `${A}-open-lb`,
170
+ label: u,
145
171
  command: () => {
146
- const e = t.getView();
147
- e == null || e.toggleLightbox();
172
+ const o = t.getView();
173
+ o == null || o.toggleLightbox();
148
174
  }
149
- }), p = "source-type", E = {
175
+ }), p = "source-type", I = {
150
176
  type: "radio",
151
177
  name: p,
152
178
  label: "Source type",
153
179
  changeProp: !0,
154
180
  options: [
155
- { id: "image", label: "Image", icon: x.image },
156
- { id: "video", label: "Video", icon: x.video },
157
- { id: "el", label: "Custom Element", icon: x.external }
181
+ { id: "image", label: "Image", icon: P.image },
182
+ { id: "video", label: "Video", icon: P.video },
183
+ { id: "el", label: "Custom Element", icon: P.external }
158
184
  ],
159
185
  // @ts-expect-error Studio related prop
160
186
  labelToTitle: !0
161
- }, y = {
187
+ }, T = {
162
188
  id: "href-image",
163
189
  name: "href",
164
190
  type: "file",
165
191
  label: "Source Image"
166
- }, V = {
192
+ }, M = {
167
193
  id: "href-video",
168
194
  name: "href",
169
195
  label: "Source Video",
170
196
  placeholder: "https://www.youtube.com/watch?v=..."
171
- }, A = {
197
+ }, E = {
172
198
  id: "href-el",
173
199
  name: "href",
174
200
  label: "Source Element",
175
201
  placeholder: "#custom-element-id"
176
- }, j = {
177
- image: [y],
178
- video: [V],
179
- el: [A]
202
+ }, O = {
203
+ image: [T],
204
+ video: [M],
205
+ el: [E]
180
206
  };
181
- l.addType(L, {
182
- block: f && {
183
- label: a,
184
- media: x.imageLightbox,
207
+ l.addType(A, {
208
+ block: g && {
209
+ label: r,
210
+ media: P.imageLightbox,
185
211
  category: "Extra",
186
212
  select: !0,
187
213
  ...h.block
188
214
  },
189
215
  isComponent: (t) => {
190
- var e;
191
- return (e = t.hasAttribute) == null ? void 0 : e.call(t, $);
216
+ var o;
217
+ return (o = t.hasAttribute) == null ? void 0 : o.call(t, D);
192
218
  },
193
219
  extendFn: ["initToolbar"],
194
220
  model: {
195
221
  defaults: {
196
222
  tagName: "a",
197
- name: a,
198
- icon: x.imageLightbox,
199
- classes: m,
200
- draggable: (t, e) => !e.is(L),
223
+ name: r,
224
+ icon: P.imageLightbox,
225
+ classes: f,
226
+ draggable: (t, o) => !o.is(A),
201
227
  attributes: {
202
- [$]: "lightbox",
203
- [N]: "image",
204
- href: d
228
+ [D]: "lightbox",
229
+ [G]: "image",
230
+ href: y
205
231
  },
206
- components: { type: "image", src: d },
232
+ components: { type: "image", src: y },
207
233
  script: v,
208
234
  cdnScript: h.cdnScript,
209
235
  "script-props": ["attributes", "cdnScript"],
210
236
  [p]: "image",
211
237
  traits: [
212
- E,
238
+ I,
213
239
  {
214
- name: $,
240
+ name: D,
215
241
  label: "Group name"
216
242
  },
217
243
  {
218
244
  type: "button",
219
245
  label: "Toggle Lightbox",
220
- command(t, e) {
221
- var o;
222
- const i = (o = e.target) == null ? void 0 : o.getView();
223
- i == null || i.toggleLightbox();
246
+ command(t, o) {
247
+ var i;
248
+ const n = (i = o.target) == null ? void 0 : i.getView();
249
+ n == null || n.toggleLightbox();
224
250
  }
225
251
  }
226
252
  ],
227
253
  styles: `
228
- .${m} {
254
+ .${f} {
229
255
  display: inline-block;
230
256
  padding: 10px;
231
257
  }
232
258
  `
233
259
  },
234
260
  init() {
235
- const t = [p].map((e) => `change:${e}`).join(" ");
261
+ const t = [p].map((o) => `change:${o}`).join(" ");
236
262
  this.on(t, this.updateTraits), this.on(`change:${p}`, this.onSourceTypeChange), this.on("change:attributes:href", this.adjustSourceType), this.updateTraits({ init: !0 }), this.adjustSourceType();
237
263
  },
238
- onSourceTypeChange(t, e, i) {
239
- if (i.adjust) return;
240
- const g = this.get(p) === "video" ? "video" : "image";
241
- this.addAttributes({ [N]: g, href: "" });
264
+ onSourceTypeChange(t, o, n) {
265
+ if (n.adjust) return;
266
+ const b = this.get(p) === "video" ? "video" : "image";
267
+ this.addAttributes({ [G]: b, href: "" });
242
268
  },
243
269
  adjustSourceType() {
244
- const t = this.get(p), e = this.getAttributes().href || "", i = { adjust: !0 };
270
+ const t = this.get(p), o = this.getAttributes().href || "", n = { adjust: !0 };
245
271
  if (t === "video") {
246
- const o = e.includes("youtube.com") ? "youtube" : "video";
247
- this.addAttributes({ [N]: o }, i);
248
- } else t !== "el" && e.startsWith("#") ? this.set(p, "el", i) : t === "image" && this.addAttributes({ [N]: "image" }, i);
272
+ const i = o.includes("youtube.com") ? "youtube" : "video";
273
+ this.addAttributes({ [G]: i }, n);
274
+ } else t !== "el" && o.startsWith("#") ? this.set(p, "el", n) : t === "image" && this.addAttributes({ [G]: "image" }, n);
249
275
  },
250
276
  updateTraits(t = {}) {
251
- const { changed: e } = this, { init: i } = t;
252
- if (e[E.name] || i) {
253
- this.removeTrait([y.name, V.name, A.name]);
254
- const o = this.get(p) || "image", g = this.getTraitIndex(p) + 1;
255
- this.addTrait(j[o], { at: g });
277
+ const { changed: o } = this, { init: n } = t;
278
+ if (o[I.name] || n) {
279
+ this.removeTrait([T.name, M.name, E.name]);
280
+ const i = this.get(p) || "image", b = this.getTraitIndex(p) + 1;
281
+ this.addTrait(O[i], { at: b });
256
282
  }
257
283
  },
258
284
  initToolbar() {
259
- if (!b) return;
260
- const { toolbar: t } = this, e = n(this);
261
- !t.find((o) => o.id === e.id) && (t == null || t.unshift(e));
285
+ if (!u) return;
286
+ const { toolbar: t } = this, o = s(this);
287
+ !t.find((i) => i.id === o.id) && (t == null || t.unshift(o));
262
288
  }
263
289
  },
264
290
  view: {
@@ -266,31 +292,31 @@ const Y = "gjs-plg-", Q = "fsLightboxComponent", tt = w.startup, $ = "data-fslig
266
292
  this.el.__skipLb = !0;
267
293
  },
268
294
  toggleLightbox() {
269
- var T;
270
- const { em: t, el: e, model: i } = this, { Canvas: o } = t, g = i.getAttributes()[$], { defaultView: u, documentElement: O } = e.ownerDocument, _ = (T = u.fsLightboxInstances) == null ? void 0 : T[g];
271
- if (O.classList.contains(et))
272
- _.close();
295
+ var L;
296
+ const { em: t, el: o, model: n } = this, { Canvas: i } = t, b = n.getAttributes()[D], { defaultView: d, documentElement: k } = o.ownerDocument, R = (L = d.fsLightboxInstances) == null ? void 0 : L[b];
297
+ if (k.classList.contains(se))
298
+ R.close();
273
299
  else {
274
- e.__skipLb = !1;
275
- let S;
276
- _.props.onOpen = () => {
277
- S = o.getSpots(), setTimeout(() => o.removeSpots());
278
- }, _.props.onClose = () => {
279
- S.forEach((I) => o.addSpot(I.attributes));
280
- }, e.click();
300
+ o.__skipLb = !1;
301
+ let x;
302
+ R.props.onOpen = () => {
303
+ x = i.getSpots(), setTimeout(() => i.removeSpots());
304
+ }, R.props.onClose = () => {
305
+ x.forEach((_) => i.addSpot(_.attributes));
306
+ }, o.click();
281
307
  }
282
308
  }
283
309
  }
284
- }), R({
285
- editor: s,
286
- plan: tt,
310
+ }), Y({
311
+ editor: e,
312
+ plan: oe,
287
313
  licenseKey: h.licenseKey,
288
- pluginName: Q,
314
+ pluginName: te,
289
315
  cleanup: () => {
290
- r.remove(L), l.removeType(L);
316
+ c.remove(A), l.removeType(A);
291
317
  }
292
318
  });
293
- }, nt = J(st);
319
+ }, ne = X(ie);
294
320
  export {
295
- nt as default
321
+ ne as default
296
322
  };
@@ -1,6 +1,6 @@
1
- (function(f,v){typeof exports=="object"&&typeof module<"u"?module.exports=v():typeof define=="function"&&define.amd?define(v):(f=typeof globalThis<"u"?globalThis:f||self,f.StudioSdkPlugins_fsLightboxComponent=v())})(this,function(){"use strict";const f="app.grapesjs.com",v="app-stage.grapesjs.com",k=[f,"app2.grapesjs.com",v,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],U="license:check:start",B="license:check:end",W=()=>typeof window<"u",G=({isDev:n,isStage:c,isPlatform:r})=>`${n?"":`https://${c?v:f}`}/${r?"platform-api":"api"}`,F=()=>{const n=W()&&window.location.hostname;return!!n&&(k.includes(n)||k.some(c=>n.endsWith(c)))};async function K({path:n,baseApiUrl:c,method:r="GET",headers:l={},params:a,body:m}){const x=`${c||G({isDev:!1,isStage:!1})}${n}`,b={method:r,headers:{"Content-Type":"application/json",...l}};m&&(b.body=JSON.stringify(m));const p=a?new URLSearchParams(a).toString():"",L=p?`?${p}`:"",s=await fetch(`${x}${L}`,b);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var T=(n=>(n.free="free",n.startup="startup",n.business="business",n.enterprise="enterprise",n))(T||{});const H={[T.free]:0,[T.startup]:10,[T.business]:20,[T.enterprise]:30};function Z(n){const c=n;return c.init=r=>l=>n(l,r),c}const q=n=>Z(n);async function R({editor:n,plan:c,pluginName:r,licenseKey:l,onLicenseCheckResponse:a,cleanup:m}){let h="",x=!1;const b=F(),p=s=>{console.warn("Cleanup plugin:",r,"Reason:",s),m()},L=(s={})=>{var E;const{error:d,sdkLicense:O}=s,A=(E=s.plan)==null?void 0:E.category;if(!(O||s.license)||d)p(d||"Invalid license");else if(A){const M=H[c],t=H[A];M>t&&p({pluginRequiredPlan:c,licensePlan:A})}};n.on(U,s=>{h=s==null?void 0:s.baseApiUrl,x=!0}),n.on(B,s=>{a==null||a(s),L(s)}),setTimeout(async()=>{if(!x){if(b)return;if(l){const s=await z({licenseKey:l,pluginName:r,baseApiUrl:h});a==null||a(s),s&&L(s)}else p("The `licenseKey` option not provided")}},2e3)}async function z(n){const{licenseKey:c,pluginName:r,baseApiUrl:l}=n;try{return(await K({baseApiUrl:l,path:`/sdk/${c||"na"}`,method:"POST",params:{d:window.location.hostname,pn:r}})).result||{}}catch(a){return console.error("Error during SDK license check:",a),!1}}const J="gjs-plg-",X="fsLightboxComponent",Y=T.startup,I="data-fslightbox",N="data-type",Q="fslightbox-open",y="fslightbox",S={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>',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>',imageLightbox:'<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>',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>',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>'};return q(function(n,c={}){const{Blocks:r,Components:l}=n,a="Lightbox",m=`${J}${y}`,h={toolbarIconOpen:S.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...c},{block:x,toolbarIconOpen:b,defaultSrc:p}=h,L=function(t){const e=this,i="data-fslightbox",o=window,g=()=>{var V;const u=o.refreshFsLightbox;u==null||u();const P=e.getAttribute(i);if((V=o.fsLightboxInstances)==null||V[P],!o._isEditor)return;Array.from(document.querySelectorAll(`[${i}]`)).forEach(w=>{const _=w.onclick;w.onclick=function(j){j.preventDefault();const C=w;!C.__skipLb&&(_==null||_(j)),C.__skipLb=!0}})};if(o.refreshFsLightbox)g();else{const u=document.createElement("script");u.src=t.cdnScript,u.onload=g,document.head.appendChild(u)}},s=t=>({id:`${y}-open-lb`,label:b,command:()=>{const e=t.getView();e==null||e.toggleLightbox()}}),d="source-type",O={type:"radio",name:d,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:S.image},{id:"video",label:"Video",icon:S.video},{id:"el",label:"Custom Element",icon:S.external}],labelToTitle:!0},A={id:"href-image",name:"href",type:"file",label:"Source Image"},D={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},E={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},M={image:[A],video:[D],el:[E]};l.addType(y,{block:x&&{label:a,media:S.imageLightbox,category:"Extra",select:!0,...h.block},isComponent:t=>{var e;return(e=t.hasAttribute)==null?void 0:e.call(t,I)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:a,icon:S.imageLightbox,classes:m,draggable:(t,e)=>!e.is(y),attributes:{[I]:"lightbox",[N]:"image",href:p},components:{type:"image",src:p},script:L,cdnScript:h.cdnScript,"script-props":["attributes","cdnScript"],[d]:"image",traits:[O,{name:I,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(t,e){var o;const i=(o=e.target)==null?void 0:o.getView();i==null||i.toggleLightbox()}}],styles:`
2
- .${m} {
1
+ (function(T,L){typeof exports=="object"&&typeof module<"u"?module.exports=L():typeof define=="function"&&define.amd?define(L):(T=typeof globalThis<"u"?globalThis:T||self,T.StudioSdkPlugins_fsLightboxComponent=L())})(this,function(){"use strict";const T="app.grapesjs.com",L="app-stage.grapesjs.com",S=[T,"app2.grapesjs.com",L,"app-stage2.grapesjs.com","localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],H="license:check:end",U=()=>typeof window<"u",F=({isDev:e,isStage:a,isPlatform:c})=>`${e?"":`https://${a?L:T}`}/${c?"platform-api":"api"}`,W=()=>{if(!U())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},K=()=>{const e=W();return!!e&&(S.includes(e)||S.some(a=>e.endsWith(a)))};async function Z({path:e,baseApiUrl:a,method:c="GET",headers:l={},params:r,body:f}){const g=`${a||F({isDev:!1,isStage:!1})}${e}`,p={method:c,headers:{"Content-Type":"application/json",...l}};f&&(p.body=JSON.stringify(f));const y=r?new URLSearchParams(r).toString():"",v=y?`?${y}`:"",s=await fetch(`${g}${v}`,p);if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);return s.json()}var x=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(x||{}),G=(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))(G||{});const $={[x.free]:0,[x.startup]:10,[x.business]:20,[x.enterprise]:30};function q(e){const a=e;return a.init=c=>l=>e(l,c),a}const z=e=>q(e);async function J({editor:e,plan:a,pluginName:c,licenseKey:l,onLicenseCheckResponse:r,cleanup:f}){let h="",g;const p=s=>{console.warn("Cleanup plugin:",c,"Reason:",s),f()},y=(s={})=>{var R;const{error:u,sdkLicense:m}=s,w=(R=s.plan)==null?void 0:R.category;if(!(m||s.license)||u)p(u||"Invalid license");else if(w){const B=$[a],t=$[w];B>t&&p({pluginRequiredPlan:a,licensePlan:w})}};e.Commands.has(G.settings)&&(g=e.runCommand(G.settings),h=(g==null?void 0:g.baseUrl)||"");const v=s=>{r==null||r(s),s&&y(s)};if(!g){e.onReady(async()=>{if(!K())if(l){const s=await Y({licenseKey:l,pluginName:c,baseApiUrl:h});v(s)}else p("The `licenseKey` option not provided")});return}if(g.licensePlan||g.licenseError){const s=X(g);v(s);return}e.on(H,s=>v(s))}const X=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function Y(e){const{licenseKey:a,pluginName:c,baseApiUrl:l}=e;try{return(await Z({baseApiUrl:l,path:`/sdk/${a||"na"}`,method:"POST",params:{d:window.location.hostname,pn:c}})).result||{}}catch(r){return console.error("Error during SDK license check:",r),!1}}const Q="gjs-plg-",C="fsLightboxComponent",ee=x.startup,_="data-fslightbox",D="data-type",te="fslightbox-open",A="fslightbox",P={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>',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>',imageLightbox:'<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>',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>',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>'};return z(function(e,a={}){const{Blocks:c,Components:l}=e,r="Lightbox",f=`${Q}${A}`,h={toolbarIconOpen:P.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...a},{block:g,toolbarIconOpen:p,defaultSrc:y}=h,v=function(t){const o=this,n="data-fslightbox",i=window,b=()=>{var N;const d=i.refreshFsLightbox;d==null||d();const j=o.getAttribute(n);if((N=i.fsLightboxInstances)==null||N[j],!i._isEditor)return;Array.from(document.querySelectorAll(`[${n}]`)).forEach(E=>{const I=E.onclick;E.onclick=function(O){O.preventDefault();const V=E;!V.__skipLb&&(I==null||I(O)),V.__skipLb=!0}})};if(i.refreshFsLightbox)b();else{const d=document.createElement("script");d.src=t.cdnScript,d.onload=b,document.head.appendChild(d)}},s=t=>({id:`${A}-open-lb`,label:p,command:()=>{const o=t.getView();o==null||o.toggleLightbox()}}),u="source-type",m={type:"radio",name:u,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:P.image},{id:"video",label:"Video",icon:P.video},{id:"el",label:"Custom Element",icon:P.external}],labelToTitle:!0},w={id:"href-image",name:"href",type:"file",label:"Source Image"},k={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},R={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},B={image:[w],video:[k],el:[R]};l.addType(A,{block:g&&{label:r,media:P.imageLightbox,category:"Extra",select:!0,...h.block},isComponent:t=>{var o;return(o=t.hasAttribute)==null?void 0:o.call(t,_)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:r,icon:P.imageLightbox,classes:f,draggable:(t,o)=>!o.is(A),attributes:{[_]:"lightbox",[D]:"image",href:y},components:{type:"image",src:y},script:v,cdnScript:h.cdnScript,"script-props":["attributes","cdnScript"],[u]:"image",traits:[m,{name:_,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(t,o){var i;const n=(i=o.target)==null?void 0:i.getView();n==null||n.toggleLightbox()}}],styles:`
2
+ .${f} {
3
3
  display: inline-block;
4
4
  padding: 10px;
5
5
  }
6
- `},init(){const t=[d].map(e=>`change:${e}`).join(" ");this.on(t,this.updateTraits),this.on(`change:${d}`,this.onSourceTypeChange),this.on("change:attributes:href",this.adjustSourceType),this.updateTraits({init:!0}),this.adjustSourceType()},onSourceTypeChange(t,e,i){if(i.adjust)return;const g=this.get(d)==="video"?"video":"image";this.addAttributes({[N]:g,href:""})},adjustSourceType(){const t=this.get(d),e=this.getAttributes().href||"",i={adjust:!0};if(t==="video"){const o=e.includes("youtube.com")?"youtube":"video";this.addAttributes({[N]:o},i)}else t!=="el"&&e.startsWith("#")?this.set(d,"el",i):t==="image"&&this.addAttributes({[N]:"image"},i)},updateTraits(t={}){const{changed:e}=this,{init:i}=t;if(e[O.name]||i){this.removeTrait([A.name,D.name,E.name]);const o=this.get(d)||"image",g=this.getTraitIndex(d)+1;this.addTrait(M[o],{at:g})}},initToolbar(){if(!b)return;const{toolbar:t}=this,e=s(this);!t.find(o=>o.id===e.id)&&(t==null||t.unshift(e))}},view:{onRender(){this.el.__skipLb=!0},toggleLightbox(){var w;const{em:t,el:e,model:i}=this,{Canvas:o}=t,g=i.getAttributes()[I],{defaultView:u,documentElement:P}=e.ownerDocument,$=(w=u.fsLightboxInstances)==null?void 0:w[g];if(P.classList.contains(Q))$.close();else{e.__skipLb=!1;let _;$.props.onOpen=()=>{_=o.getSpots(),setTimeout(()=>o.removeSpots())},$.props.onClose=()=>{_.forEach(j=>o.addSpot(j.attributes))},e.click()}}}}),R({editor:n,plan:Y,licenseKey:h.licenseKey,pluginName:X,cleanup:()=>{r.remove(y),l.removeType(y)}})})});
6
+ `},init(){const t=[u].map(o=>`change:${o}`).join(" ");this.on(t,this.updateTraits),this.on(`change:${u}`,this.onSourceTypeChange),this.on("change:attributes:href",this.adjustSourceType),this.updateTraits({init:!0}),this.adjustSourceType()},onSourceTypeChange(t,o,n){if(n.adjust)return;const b=this.get(u)==="video"?"video":"image";this.addAttributes({[D]:b,href:""})},adjustSourceType(){const t=this.get(u),o=this.getAttributes().href||"",n={adjust:!0};if(t==="video"){const i=o.includes("youtube.com")?"youtube":"video";this.addAttributes({[D]:i},n)}else t!=="el"&&o.startsWith("#")?this.set(u,"el",n):t==="image"&&this.addAttributes({[D]:"image"},n)},updateTraits(t={}){const{changed:o}=this,{init:n}=t;if(o[m.name]||n){this.removeTrait([w.name,k.name,R.name]);const i=this.get(u)||"image",b=this.getTraitIndex(u)+1;this.addTrait(B[i],{at:b})}},initToolbar(){if(!p)return;const{toolbar:t}=this,o=s(this);!t.find(i=>i.id===o.id)&&(t==null||t.unshift(o))}},view:{onRender(){this.el.__skipLb=!0},toggleLightbox(){var E;const{em:t,el:o,model:n}=this,{Canvas:i}=t,b=n.getAttributes()[_],{defaultView:d,documentElement:j}=o.ownerDocument,M=(E=d.fsLightboxInstances)==null?void 0:E[b];if(j.classList.contains(te))M.close();else{o.__skipLb=!1;let I;M.props.onOpen=()=>{I=i.getSpots(),setTimeout(()=>i.removeSpots())},M.props.onClose=()=>{I.forEach(O=>i.addSpot(O.attributes))},o.click()}}}}),J({editor:e,plan:ee,licenseKey:h.licenseKey,pluginName:C,cleanup:()=>{c.remove(A),l.removeType(A)}})})});
@@ -1 +1 @@
1
- "use strict";var p=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(p||{}),v=(t=>(t.toastAdd="studio:toastAdd",t.toastRemove="studio:toastRemove",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.dialogExportCode="studio:dialogExportCode",t.dialogImportCode="studio:dialogImportCode",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.clearPage="studio:clearPage",t.projectFiles="studio:projectFiles",t.validateCode="studio:validateCode",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.layoutUpdate="studio:layoutUpdate",t.layoutGet="studio:layoutGet",t.layoutConfigGet="studio:layoutConfigGet",t.layoutConfigSet="studio:layoutConfigSet",t.layoutComponentAdd="studio:layoutComponentAdd",t.layoutComponentGet="studio:layoutComponentGet",t.layoutComponentRemove="studio:layoutComponentRemove",t.layoutComponentRender="studio:layoutComponentRender",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t.fontGet="studio:fontGet",t.fontAdd="studio:fontAdd",t.fontRemove="studio:fontRemove",t.fontManagerOpen="studio:fontManagerOpen",t.menuFontLoad="studio:menuFontLoad",t.toggleStateDataSource="studio:toggleStateDataSource",t.getStateDataSource="studio:getStateDataSource",t.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",t.dataSourceSetImporter="studio:dataSourceSetImporter",t.dataSourceSetExporter="studio:dataSourceSetExporter",t.setDragAbsolute="studio:setDragAbsolute",t))(v||{});const D="app.grapesjs.com",G="app-stage.grapesjs.com",R="app2.grapesjs.com",$="app-stage2.grapesjs.com",w=[D,R,G,$,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],E="license:check:start",M="license:check:end",U=()=>typeof window<"u",j=({isDev:t,isStage:e,isPlatform:s})=>`${t?"":`https://${e?G:D}`}/${s?"platform-api":"api"}`,N=()=>{const t=U()&&window.location.hostname;return!!t&&(w.includes(t)||w.some(e=>t.endsWith(e)))};async function B({path:t,baseApiUrl:e,method:s="GET",headers:a={},params:o,body:r}){const l=`${e||j({isDev:!1,isStage:!1})}${t}`,c={method:s,headers:{"Content-Type":"application/json",...a}};r&&(c.body=JSON.stringify(r));const u=o?new URLSearchParams(o).toString():"",g=u?`?${u}`:"",n=await fetch(`${l}${g}`,c);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);return n.json()}const F={[p.free]:0,[p.startup]:10,[p.business]:20,[p.enterprise]:30};function k(t){const e=t;return e.init=s=>a=>t(a,s),e}const W=t=>k(t);async function _({editor:t,plan:e,pluginName:s,licenseKey:a,onLicenseCheckResponse:o,cleanup:r}){let i="",l=!1;const c=N(),u=n=>{console.warn("Cleanup plugin:",s,"Reason:",n),r()},g=(n={})=>{var A;const{error:d,sdkLicense:f}=n,b=(A=n.plan)==null?void 0:A.category;if(!(f||n.license)||d)u(d||"Invalid license");else if(b){const O=F[e],I=F[b];O>I&&u({pluginRequiredPlan:e,licensePlan:b})}};t.on(E,n=>{i=n==null?void 0:n.baseApiUrl,l=!0}),t.on(M,n=>{o==null||o(n),g(n)}),setTimeout(async()=>{if(!l){if(c)return;if(a){const n=await K({licenseKey:a,pluginName:s,baseApiUrl:i});o==null||o(n),n&&g(n)}else u("The `licenseKey` option not provided")}},2e3)}async function K(t){const{licenseKey:e,pluginName:s,baseApiUrl:a}=t;try{return(await B({baseApiUrl:a,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:s}})).result||{}}catch(o){return console.error("Error during SDK license check:",o),!1}}const y=t=>t.replaceAll('"',"").replaceAll("'",""),P=t=>t.includes(",")?t:/\s/.test(t)?`'${y(t)}'`:y(t),T=(t,e,s)=>({family:t,variant:e,...s}),L=(t,e)=>{t=P(t);const{menuVariant:s,variants:a}=e;return{family:t,familyLabel:y(t),menuVariant:s&&T(P(`menuFont-${y(t)}`),"regular",s),variants:Object.assign({},...Object.entries(a).map(([o,r])=>({[o]:T(t,o,r)})))}},x=(t,e)=>{var l;const s=L(t.family,t),a=s.menuVariant??((l=Object.values(s.variants))==null?void 0:l[0]);if(!a)return"Arial, Helvetica, sans-serif";const{source:o,descriptors:r}=a,i=y(a.family);if(!e){const c=new FontFace(i,`url("${o}")`,r),u=Array.from(document.fonts.values()).filter(g=>g.family===i);for(const g of u)document.fonts.delete(g);document.fonts.add(c),c.load().catch(()=>{})}return P(i)},V=t=>{const{family:e,menu:s,axes:a}=t,o=!!a,r=Object.assign({},...t.variants.map(i=>{var g,n;let l,c;if(o){const d=a.find(f=>f.tag==="wght");if(d){const{start:f,end:b}=d;l=`${f} ${b}`}}return l||(l=((g=i.match(/\d+/))==null?void 0:g[0])??"400"),c=((n=i.match(/[a-zA-Z]+/))==null?void 0:n[0])==="italic"?"italic":void 0,{[i]:{source:t.files[i],descriptors:{style:c,weight:l}}}}));return L(e,{menuVariant:{source:s},variants:r})},H=t=>({id:`${t.family}/${t.version}`,type:"font",src:t.menu,name:t.family,customData:{font:V(t),needsLoading:!0}}),z=t=>{const{font:e}=t.customData;return t.customData.needsLoading?(t.customData.needsLoading=!1,x(e)):x(e,!0)};let h;const q=t=>{const e=[];for(const s of Object.keys(t)){let a=t[s];a&&(Array.isArray(a)?e.push(...a.map(o=>[s,o.toString()])):(a=a.toString(),e.push([s,a])))}return new URLSearchParams(e)},J=t=>{const{apiKey:e,searchParams:s}=t,a=(o={})=>{const r="https://www.googleapis.com/webfonts/v1/webfonts",i=q(o);return`${r}?${i}`};return{id:"google-fonts",types:["font"],label:({editor:o})=>o.I18n.t("googleFontsAssetProvider.providerLabel"),search:{reloadOnInput:!1},async onLoad(){var u;if(h)return h;const o={key:e,sort:"alpha",subset:"latin",capability:["WOFF2","VF"]},r=s==null?void 0:s(),i={...o,...r},c=await(await fetch(a(i))).json();return(u=c.items)!=null&&u.length?(h=c.items.map(H),h):[]},itemLayout:o=>{const r=h.find(l=>l.id===o.assetProps.id),i=z(r);return{type:"column",onClick:()=>o.onSelect(r),htmlAttrs:{title:r.name},style:{borderWidth:"1px",borderRadius:8,overflow:"hidden",cursor:"pointer"},children:[{type:"text",content:r.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:i,fontSize:"24px",paddingLeft:"8px",paddingRight:"8px"}},{type:"text",content:r.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"16px",paddingLeft:"8px",paddingRight:"8px"}}]}}}},Q={googleFontsAssetProvider:{searchBtn:"Search on Google Fonts",modalTitle:"Select Font",providerLabel:"Google Fonts"}},S="googleFontsAssetProvider",Z=p.startup,X=function(t,e){const{i18n:s={}}=e,a=J(e);t.runCommand(v.assetProviderAdd,{provider:a}),t.I18n.addMessages({en:Q,...s}),_({editor:t,licenseKey:e.licenseKey,plan:Z,pluginName:S,cleanup:()=>{t.runCommand(v.assetProviderRemove,{id:a.id})}})},Y=W(X);module.exports=Y;
1
+ "use strict";var d=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(d||{}),y=(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))(y||{});const x="app.grapesjs.com",T="app-stage.grapesjs.com",I="app2.grapesjs.com",$="app-stage2.grapesjs.com",w=[x,I,T,$,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io",".claudemcpcontent.com",".web-sandbox.oaiusercontent.com"],E="license:check:end",M=()=>typeof window<"u",U=({isDev:e,isStage:t,isPlatform:s})=>`${e?"":`https://${t?T:x}`}/${s?"platform-api":"api"}`,j=()=>{if(!M())return"";const{hostname:e}=window.location;if(e)return e;try{return window.parent.location.hostname||""}catch{return""}},k=()=>{const e=j();return!!e&&(w.includes(e)||w.some(t=>e.endsWith(t)))};async function B({path:e,baseApiUrl:t,method:s="GET",headers:o={},params:n,body:i}){const a=`${t||U({isDev:!1,isStage:!1})}${e}`,l={method:s,headers:{"Content-Type":"application/json",...o}};i&&(l.body=JSON.stringify(i));const p=n?new URLSearchParams(n).toString():"",u=p?`?${p}`:"",r=await fetch(`${a}${u}`,l);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return r.json()}const F={[d.free]:0,[d.startup]:10,[d.business]:20,[d.enterprise]:30};function N(e){const t=e;return t.init=s=>o=>e(o,s),t}const W=e=>N(e);async function _({editor:e,plan:t,pluginName:s,licenseKey:o,onLicenseCheckResponse:n,cleanup:i}){let c="",a;const l=r=>{console.warn("Cleanup plugin:",s,"Reason:",r),i()},p=(r={})=>{var A;const{error:g,sdkLicense:f}=r,b=(A=r.plan)==null?void 0:A.category;if(!(f||r.license)||g)l(g||"Invalid license");else if(b){const G=F[t],O=F[b];G>O&&l({pluginRequiredPlan:t,licensePlan:b})}};e.Commands.has(y.settings)&&(a=e.runCommand(y.settings),c=(a==null?void 0:a.baseUrl)||"");const u=r=>{n==null||n(r),r&&p(r)};if(!a){e.onReady(async()=>{if(!k())if(o){const r=await K({licenseKey:o,pluginName:s,baseApiUrl:c});u(r)}else l("The `licenseKey` option not provided")});return}if(a.licensePlan||a.licenseError){const r=V(a);u(r);return}e.on(E,r=>u(r))}const V=e=>({sdkLicense:e.license,license:e.license,error:e.licenseError,plan:e.licensePlan});async function K(e){const{licenseKey:t,pluginName:s,baseApiUrl:o}=e;try{return(await B({baseApiUrl:o,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:s}})).result||{}}catch(n){return console.error("Error during SDK license check:",n),!1}}const v=e=>e.replaceAll('"',"").replaceAll("'",""),P=e=>e.includes(",")?e:/\s/.test(e)?`'${v(e)}'`:v(e),L=(e,t,s)=>({family:e,variant:t,...s}),D=(e,t)=>{e=P(e);const{menuVariant:s,variants:o}=t;return{family:e,familyLabel:v(e),menuVariant:s&&L(P(`menuFont-${v(e)}`),"regular",s),variants:Object.assign({},...Object.entries(o).map(([n,i])=>({[n]:L(e,n,i)})))}},R=(e,t)=>{var a;const s=D(e.family,e),o=s.menuVariant??((a=Object.values(s.variants))==null?void 0:a[0]);if(!o)return"Arial, Helvetica, sans-serif";const{source:n,descriptors:i}=o,c=v(o.family);if(!t){const l=new FontFace(c,`url("${n}")`,i),p=Array.from(document.fonts.values()).filter(u=>u.family===c);for(const u of p)document.fonts.delete(u);document.fonts.add(l),l.load().catch(()=>{})}return P(c)},H=e=>{const{family:t,menu:s,axes:o}=e,n=!!o,i=Object.assign({},...e.variants.map(c=>{var u,r;let a,l;if(n){const g=o.find(f=>f.tag==="wght");if(g){const{start:f,end:b}=g;a=`${f} ${b}`}}return a||(a=((u=c.match(/\d+/))==null?void 0:u[0])??"400"),l=((r=c.match(/[a-zA-Z]+/))==null?void 0:r[0])==="italic"?"italic":void 0,{[c]:{source:e.files[c],descriptors:{style:l,weight:a}}}}));return D(t,{menuVariant:{source:s},variants:i})},z=e=>({id:`${e.family}/${e.version}`,type:"font",src:e.menu,name:e.family,customData:{font:H(e),needsLoading:!0}}),q=e=>{const{font:t}=e.customData;return e.customData.needsLoading?(e.customData.needsLoading=!1,R(t)):R(t,!0)};let h;const J=e=>{const t=[];for(const s of Object.keys(e)){let o=e[s];o&&(Array.isArray(o)?t.push(...o.map(n=>[s,n.toString()])):(o=o.toString(),t.push([s,o])))}return new URLSearchParams(t)},Q=e=>{const{apiKey:t,searchParams:s}=e,o=(n={})=>{const i="https://www.googleapis.com/webfonts/v1/webfonts",c=J(n);return`${i}?${c}`};return{id:"google-fonts",types:["font"],label:({editor:n})=>n.I18n.t("googleFontsAssetProvider.providerLabel"),search:{reloadOnInput:!1},async onLoad(){var p;if(h)return h;const n={key:t,sort:"alpha",subset:"latin",capability:["WOFF2","VF"]},i=s==null?void 0:s(),c={...n,...i},l=await(await fetch(o(c))).json();return(p=l.items)!=null&&p.length?(h=l.items.map(z),h):[]},itemLayout:n=>{const i=h.find(a=>a.id===n.assetProps.id),c=q(i);return{type:"column",onClick:()=>n.onSelect(i),htmlAttrs:{title:i.name},style:{borderWidth:"1px",borderRadius:8,overflow:"hidden",cursor:"pointer"},children:[{type:"text",content:i.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:c,fontSize:"24px",paddingLeft:"8px",paddingRight:"8px"}},{type:"text",content:i.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"16px",paddingLeft:"8px",paddingRight:"8px"}}]}}}},Z={googleFontsAssetProvider:{searchBtn:"Search on Google Fonts",modalTitle:"Select Font",providerLabel:"Google Fonts"}},X="googleFontsAssetProvider",Y=d.startup,S=function(e,t){const{i18n:s={}}=t,o=Q(t);e.runCommand(y.assetProviderAdd,{provider:o}),e.I18n.addMessages({en:Z,...s}),_({editor:e,licenseKey:t.licenseKey,plan:Y,pluginName:X,cleanup:()=>{e.runCommand(y.assetProviderRemove,{id:o.id})}})},m=W(S);module.exports=m;