@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,28 +1,41 @@
1
- const H = "app.grapesjs.com", Y = "app-stage.grapesjs.com", nt = "app2.grapesjs.com", rt = "app-stage2.grapesjs.com", W = [
1
+ const H = "app.grapesjs.com", Y = "app-stage.grapesjs.com", rt = "app2.grapesjs.com", st = "app-stage2.grapesjs.com", j = [
2
2
  H,
3
- nt,
4
- Y,
5
3
  rt,
4
+ Y,
5
+ st,
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
- ], st = "license:check:start", at = "license:check:end", it = () => typeof window < "u", lt = ({
14
+ ".claudemcpcontent.com",
15
+ // For Claude mcp app
16
+ ".web-sandbox.oaiusercontent.com"
17
+ // For OpenAI mcp app
18
+ ], at = "license:check:end", it = () => typeof window < "u", lt = ({
15
19
  isDev: t,
16
20
  isStage: e,
17
21
  isPlatform: r
18
22
  }) => `${t ? "" : `https://${e ? Y : H}`}/${r ? "platform-api" : "api"}`, ct = () => {
19
- const t = it() && window.location.hostname;
20
- return !!t && (W.includes(t) || W.some((e) => t.endsWith(e)));
23
+ if (!it()) return "";
24
+ const { hostname: t } = window.location;
25
+ if (t) return t;
26
+ try {
27
+ return window.parent.location.hostname || "";
28
+ } catch {
29
+ return "";
30
+ }
31
+ }, pt = () => {
32
+ const t = ct();
33
+ return !!t && (j.includes(t) || j.some((e) => t.endsWith(e)));
21
34
  };
22
- function K(t) {
35
+ function X(t) {
23
36
  return typeof t == "function";
24
37
  }
25
- async function pt({
38
+ async function dt({
26
39
  path: t,
27
40
  baseApiUrl: e,
28
41
  method: r = "GET",
@@ -30,32 +43,32 @@ async function pt({
30
43
  params: o,
31
44
  body: i
32
45
  }) {
33
- const l = `${e || lt({ isDev: !1, isStage: !1 })}${t}`, d = {
46
+ const a = `${e || lt({ isDev: !1, isStage: !1 })}${t}`, p = {
34
47
  method: r,
35
48
  headers: {
36
49
  "Content-Type": "application/json",
37
50
  ...n
38
51
  }
39
52
  };
40
- i && (d.body = JSON.stringify(i));
41
- const c = o ? new URLSearchParams(o).toString() : "", p = c ? `?${c}` : "", a = await fetch(`${l}${p}`, d);
42
- if (!a.ok)
43
- throw new Error(`HTTP error! status: ${a.status}`);
44
- return a.json();
53
+ i && (p.body = JSON.stringify(i));
54
+ const d = o ? new URLSearchParams(o).toString() : "", c = d ? `?${d}` : "", l = await fetch(`${a}${c}`, p);
55
+ if (!l.ok)
56
+ throw new Error(`HTTP error! status: ${l.status}`);
57
+ return l.json();
45
58
  }
46
- var G = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(G || {});
47
- const j = {
59
+ var G = /* @__PURE__ */ ((t) => (t.free = "free", t.startup = "startup", t.business = "business", t.enterprise = "enterprise", t))(G || {}), _ = /* @__PURE__ */ ((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.settings = "studio:settings", 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))(_ || {});
60
+ const W = {
48
61
  [G.free]: 0,
49
62
  [G.startup]: 10,
50
63
  [G.business]: 20,
51
64
  [G.enterprise]: 30
52
65
  };
53
- function dt(t) {
66
+ function gt(t) {
54
67
  const e = t;
55
68
  return e.init = (r) => (n) => t(n, r), e;
56
69
  }
57
- const ut = (t) => /* @__PURE__ */ dt(t);
58
- async function mt({
70
+ const ut = (t) => /* @__PURE__ */ gt(t);
71
+ async function ft({
59
72
  editor: t,
60
73
  plan: e,
61
74
  pluginName: r,
@@ -63,38 +76,51 @@ async function mt({
63
76
  onLicenseCheckResponse: o,
64
77
  cleanup: i
65
78
  }) {
66
- let s = "", l = !1;
67
- const d = ct(), c = (a) => {
68
- console.warn("Cleanup plugin:", r, "Reason:", a), i();
69
- }, p = (a = {}) => {
79
+ let s = "", a;
80
+ const p = (l) => {
81
+ console.warn("Cleanup plugin:", r, "Reason:", l), i();
82
+ }, d = (l = {}) => {
70
83
  var w;
71
- const { error: u, sdkLicense: m } = a, h = (w = a.plan) == null ? void 0 : w.category;
72
- if (!(m || a.license) || u)
73
- c(u || "Invalid license");
84
+ const { error: g, sdkLicense: u } = l, h = (w = l.plan) == null ? void 0 : w.category;
85
+ if (!(u || l.license) || g)
86
+ p(g || "Invalid license");
74
87
  else if (h) {
75
- const b = j[e], v = j[h];
76
- b > v && c({ pluginRequiredPlan: e, licensePlan: h });
88
+ const v = W[e], R = W[h];
89
+ v > R && p({ pluginRequiredPlan: e, licensePlan: h });
77
90
  }
78
91
  };
79
- t.on(st, (a) => {
80
- s = a == null ? void 0 : a.baseApiUrl, l = !0;
81
- }), t.on(at, (a) => {
82
- o == null || o(a), p(a);
83
- }), setTimeout(async () => {
84
- if (!l) {
85
- if (d) return;
86
- if (n) {
87
- const a = await gt({ licenseKey: n, pluginName: r, baseApiUrl: s });
88
- o == null || o(a), a && p(a);
89
- } else
90
- c("The `licenseKey` option not provided");
91
- }
92
- }, 2e3);
92
+ t.Commands.has(_.settings) && (a = t.runCommand(_.settings), s = (a == null ? void 0 : a.baseUrl) || "");
93
+ const c = (l) => {
94
+ o == null || o(l), l && d(l);
95
+ };
96
+ if (!a) {
97
+ t.onReady(async () => {
98
+ if (!pt())
99
+ if (n) {
100
+ const l = await yt({ licenseKey: n, pluginName: r, baseApiUrl: s });
101
+ c(l);
102
+ } else
103
+ p("The `licenseKey` option not provided");
104
+ });
105
+ return;
106
+ }
107
+ if (a.licensePlan || a.licenseError) {
108
+ const l = mt(a);
109
+ c(l);
110
+ return;
111
+ }
112
+ t.on(at, (l) => c(l));
93
113
  }
94
- async function gt(t) {
114
+ const mt = (t) => ({
115
+ sdkLicense: t.license,
116
+ license: t.license,
117
+ error: t.licenseError,
118
+ plan: t.licensePlan
119
+ });
120
+ async function yt(t) {
95
121
  const { licenseKey: e, pluginName: r, baseApiUrl: n } = t;
96
122
  try {
97
- return (await pt({
123
+ return (await dt({
98
124
  baseApiUrl: n,
99
125
  path: `/sdk/${e || "na"}`,
100
126
  method: "POST",
@@ -107,10 +133,10 @@ async function gt(t) {
107
133
  return console.error("Error during SDK license check:", o), !1;
108
134
  }
109
135
  }
110
- const N = "canvasGridMode", ft = G.startup, F = "component-grid-mode", A = "grid-mode", D = "gjs-drag-grid-spot", X = `${D}__grid-item`, k = `${D}__grid-target`, J = `${D}__snapped`, yt = `${D}__container`, ht = () => {
136
+ const N = "canvasGridMode", ht = G.startup, F = "component-grid-mode", D = "grid-mode", M = "gjs-drag-grid-spot", K = `${M}__grid-item`, J = `${M}__grid-target`, Q = `${M}__snapped`, wt = `${M}__container`, bt = () => {
111
137
  const t = "data-gjs-drag-grid-style", e = document, r = "var(--gs-theme-cl-cmp-bg1, var(--gjs-color-highlight))", n = "var(--gs-theme-cl-cmp-bg2, var(--gjs-color-blue))", o = e.querySelector(`style[${t}]`) || e.createElement("style");
112
138
  o.setAttribute(t, "true"), o.innerHTML = `
113
- .${X} {
139
+ .${K} {
114
140
  outline: 2px solid ${n};
115
141
  background: ${r};
116
142
  outline-offset: -2px;
@@ -119,14 +145,14 @@ const N = "canvasGridMode", ft = G.startup, F = "component-grid-mode", A = "grid
119
145
  height: 100%;
120
146
  opacity: 0.1;
121
147
  }
122
- .${J} {
148
+ .${Q} {
123
149
  width: 100%;
124
150
  height: 100%;
125
151
  outline: 2px solid ${n};
126
152
  outline-offset: -2px;
127
153
  position: absolute;
128
154
  }
129
- .${k} {
155
+ .${J} {
130
156
  position: absolute;
131
157
  z-index: -1;
132
158
  background: ${r};
@@ -136,41 +162,41 @@ const N = "canvasGridMode", ft = G.startup, F = "component-grid-mode", A = "grid
136
162
  }
137
163
  `, e.head.appendChild(o);
138
164
  };
139
- function Q(t) {
140
- const { editor: e, type: r } = t, n = Ct(e, t.component), o = L(e, n.component);
141
- if (!vt(e, n, o, r))
165
+ function Z(t) {
166
+ const { editor: e, type: r } = t, n = xt(e, t.component), o = O(e, n.component);
167
+ if (!Tt(e, n, o, r))
142
168
  return {
143
169
  target: n,
144
170
  container: o,
145
- startScroll: et(e).scroll,
171
+ startScroll: ot(e).scroll,
146
172
  shadowContainerEl: document.createElement("div"),
147
173
  shadowSnappedEl: document.createElement("div"),
148
174
  shadowTargetEl: document.createElement("div"),
149
175
  spot: e.Canvas.addSpot({
150
- type: A,
176
+ type: D,
151
177
  component: o.component
152
178
  })
153
179
  };
154
180
  }
155
- function Z(t) {
156
- const { editor: e, shadowTargetEl: r, shadowSnappedEl: n, shadowContainerEl: o, spotEl: i, target: s, container: l } = t, { Canvas: d } = e, c = e.config.stylePrefix;
157
- i == null || i.appendChild(o), o == null || o.appendChild(r), o == null || o.appendChild(n), wt(o, l), St(r, s, l), bt(n, s), $t(o, l.el), s.el.style.opacity = "0";
158
- const p = d.getSpots().filter((a) => a.type !== A);
159
- e.em.stopDefault({ preserveSelected: !0 }), d.removeSpots(p), d.startAutoscroll(), d.getBody().classList.add(`${c}is__grabbing`);
160
- }
161
181
  function V(t) {
162
- const { editor: e, shadowSnappedEl: r, shadowContainerEl: n, target: o, cancelled: i } = t, { Canvas: s } = e, l = e.config.stylePrefix, { component: d } = o;
182
+ const { editor: e, shadowTargetEl: r, shadowSnappedEl: n, shadowContainerEl: o, spotEl: i, target: s, container: a } = t, { Canvas: p } = e, d = e.config.stylePrefix;
183
+ i == null || i.appendChild(o), o == null || o.appendChild(r), o == null || o.appendChild(n), vt(o, a), $t(r, s, a), St(n, s), Rt(o, a.el), s.el.style.opacity = "0";
184
+ const c = p.getSpots().filter((l) => l.type !== D);
185
+ e.em.stopDefault({ preserveSelected: !0 }), p.removeSpots(c), p.startAutoscroll(), p.getBody().classList.add(`${d}is__grabbing`);
186
+ }
187
+ function tt(t) {
188
+ const { editor: e, shadowSnappedEl: r, shadowContainerEl: n, target: o, cancelled: i } = t, { Canvas: s } = e, a = e.config.stylePrefix, { component: p } = o;
163
189
  if (!i) {
164
- const c = window.getComputedStyle(r);
165
- d.addStyle({
166
- "grid-area": c.gridArea,
190
+ const d = window.getComputedStyle(r);
191
+ p.addStyle({
192
+ "grid-area": d.gridArea,
167
193
  width: "",
168
194
  height: ""
169
195
  });
170
196
  }
171
- o.el.style.opacity = "", n.contains(r) && (n == null || n.removeChild(r)), e.getModel().runDefault({ preserveSelected: 1 }), s.stopAutoscroll(), s.getBody().classList.remove(`${l}is__grabbing`), s.removeSpots({ type: A }), e.select(d);
197
+ o.el.style.opacity = "", n.contains(r) && (n == null || n.removeChild(r)), e.getModel().runDefault({ preserveSelected: 1 }), s.stopAutoscroll(), s.getBody().classList.remove(`${a}is__grabbing`), s.removeSpots({ type: D }), e.select(p);
172
198
  }
173
- function wt(t, {
199
+ function vt(t, {
174
200
  rows: e,
175
201
  columns: r
176
202
  }) {
@@ -179,31 +205,31 @@ function wt(t, {
179
205
  n[o] = [];
180
206
  for (let i = 0; i < e.length; i++) {
181
207
  const s = document.createElement("div");
182
- s.className = X, s.style.gridArea = `${i + 1} / ${o + 1}`, n[o][i] = s, t.appendChild(s);
208
+ s.className = K, s.style.gridArea = `${i + 1} / ${o + 1}`, n[o][i] = s, t.appendChild(s);
183
209
  }
184
210
  }
185
211
  return n;
186
212
  }
187
- function St(t, e, r) {
188
- return t.className = k, t.style.top = `${e.offset.top - r.offset.top}px`, t.style.left = `${e.offset.left - r.offset.left}px`, t.style.width = `${e.offset.width + e.margin.left + e.margin.right}px`, t.style.height = `${e.offset.height + e.margin.top + e.margin.bottom}px`, t;
213
+ function $t(t, e, r) {
214
+ return t.className = J, t.style.top = `${e.offset.top - r.offset.top}px`, t.style.left = `${e.offset.left - r.offset.left}px`, t.style.width = `${e.offset.width + e.margin.left + e.margin.right}px`, t.style.height = `${e.offset.height + e.margin.top + e.margin.bottom}px`, t;
189
215
  }
190
- function bt(t, e) {
191
- const r = ot(e.el, e.computedStyles);
192
- return t.className = J, t.style.gridArea = `${r.row.start} / ${r.column.start} / ${r.row.end} / ${r.column.end}`, t;
216
+ function St(t, e) {
217
+ const r = nt(e.el, e.computedStyles);
218
+ return t.className = Q, t.style.gridArea = `${r.row.start} / ${r.column.start} / ${r.row.end} / ${r.column.end}`, t;
193
219
  }
194
- function $t(t, e) {
220
+ function Rt(t, e) {
195
221
  const r = window.getComputedStyle(e);
196
- t.className = yt, t.style.position = "relative", t.style.display = r.display, t.style.gap = r.gap, t.style.padding = r.padding, t.style.border = r.border, t.style.gridTemplateColumns = r.gridTemplateColumns, t.style.gridTemplateRows = r.gridTemplateRows;
222
+ t.className = wt, t.style.position = "relative", t.style.display = r.display, t.style.gap = r.gap, t.style.padding = r.padding, t.style.border = r.border, t.style.gridTemplateColumns = r.gridTemplateColumns, t.style.gridTemplateRows = r.gridTemplateRows;
197
223
  }
198
- function tt(t, e) {
224
+ function et(t, e) {
199
225
  if (e) {
200
226
  if (Array.isArray(e))
201
227
  return [...e].pop();
202
228
  } else return [...t.getSelectedAll()].pop();
203
229
  return e;
204
230
  }
205
- function Ct(t, e) {
206
- const r = tt(t, e), n = r.getEl(), o = window.getComputedStyle(n);
231
+ function xt(t, e) {
232
+ const r = et(t, e), n = r.getEl(), o = window.getComputedStyle(n);
207
233
  return {
208
234
  component: r,
209
235
  el: n,
@@ -217,7 +243,7 @@ function Ct(t, e) {
217
243
  computedStyles: o
218
244
  };
219
245
  }
220
- function L(t, e) {
246
+ function O(t, e) {
221
247
  const r = e.parent(), n = r.getEl(), o = window.getComputedStyle(n);
222
248
  return {
223
249
  component: r,
@@ -238,7 +264,7 @@ function L(t, e) {
238
264
  }
239
265
  };
240
266
  }
241
- function E(t, e, r, n, o = 1) {
267
+ function x(t, e, r, n, o = 1) {
242
268
  let i = 0;
243
269
  for (let s = e; s <= t.length; s++) {
244
270
  if (i + (t[s - 1] + n) * o > r)
@@ -247,7 +273,7 @@ function E(t, e, r, n, o = 1) {
247
273
  }
248
274
  return t.length + 1;
249
275
  }
250
- function et(t) {
276
+ function ot(t) {
251
277
  const { scrollY: e, scrollX: r } = t.Canvas.getWindow();
252
278
  return {
253
279
  scroll: {
@@ -256,20 +282,20 @@ function et(t) {
256
282
  }
257
283
  };
258
284
  }
259
- function vt(t, e, r, n) {
285
+ function Tt(t, e, r, n) {
260
286
  const o = (i) => t.em.logWarning(i);
261
287
  return n === "draggable" && e.component.get(n) === !1 ? (o(`[${N}] The element is not ${n}`), !0) : r.computedStyles.display !== "grid" ? (o(`[${N}] The container does not have style display:grid`), !0) : !1;
262
288
  }
263
- function _(t, e, r = {}) {
264
- const n = tt(t, e), o = n == null ? void 0 : n.parent(), i = o == null ? void 0 : o.getEl();
289
+ function L(t, e, r = {}) {
290
+ const n = et(t, e), o = n == null ? void 0 : n.parent(), i = o == null ? void 0 : o.getEl();
265
291
  if (!o || !i)
266
292
  return !1;
267
- const { enableGrid: s } = r, l = window.getComputedStyle(i).display === "grid";
268
- return K(s) ? s({ component: n, parent: o, isParentGrid: l }) : l;
293
+ const { enableGrid: s } = r, a = window.getComputedStyle(i).display === "grid";
294
+ return X(s) ? s({ component: n, parent: o, isParentGrid: a }) : a;
269
295
  }
270
- const B = (t) => t.split(" ").map((e) => parseFloat(e));
271
- function ot(t, e) {
272
- const r = t.ownerDocument.defaultView, n = e || r.getComputedStyle(t), o = n.gridArea.split("/").some((S) => isNaN(parseInt(S.trim()))), i = {
296
+ const U = (t) => t.split(" ").map((e) => parseFloat(e));
297
+ function nt(t, e) {
298
+ const r = t.ownerDocument.defaultView, n = e || r.getComputedStyle(t), o = n.gridArea.split("/").some((b) => isNaN(parseInt(b.trim()))), i = {
273
299
  isComputed: o,
274
300
  raw: n.gridArea
275
301
  };
@@ -285,144 +311,144 @@ function ot(t, e) {
285
311
  end: parseInt(n.gridColumnEnd)
286
312
  }
287
313
  };
288
- const s = t.parentElement, l = r.getComputedStyle(s), d = parseFloat(l.columnGap) || 0, c = parseFloat(l.rowGap) || 0, p = B(l.gridTemplateColumns), a = B(l.gridTemplateRows), u = parseFloat(l.paddingLeft) || 0, m = parseFloat(l.paddingTop) || 0, h = s.getBoundingClientRect(), f = t.getBoundingClientRect(), w = (S, $, x, C, M) => {
289
- let P = 1, T = C + M;
290
- for (let R = 0; R < $.length; R++) {
291
- const I = $[R], O = T + I;
292
- if (S >= T && S < O)
293
- return P;
294
- T = O + x, P++;
314
+ const s = t.parentElement, a = r.getComputedStyle(s), p = parseFloat(a.columnGap) || 0, d = parseFloat(a.rowGap) || 0, c = U(a.gridTemplateColumns), l = U(a.gridTemplateRows), g = parseFloat(a.paddingLeft) || 0, u = parseFloat(a.paddingTop) || 0, h = s.getBoundingClientRect(), m = t.getBoundingClientRect(), w = (b, $, T, S, C) => {
315
+ let E = 1, P = S + C;
316
+ for (let A = 0; A < $.length; A++) {
317
+ const I = $[A], z = P + I;
318
+ if (b >= P && b < z)
319
+ return E;
320
+ P = z + T, E++;
295
321
  }
296
322
  return -1;
297
- }, b = w(f.left, p, d, h.left, u), v = w(f.right - 1, p, d, h.left, u) + 1, y = w(f.top, a, c, h.top, m), g = w(f.bottom - 1, a, c, h.top, m) + 1;
323
+ }, v = w(m.left, c, p, h.left, g), R = w(m.right - 1, c, p, h.left, g) + 1, y = w(m.top, l, d, h.top, u), f = w(m.bottom - 1, l, d, h.top, u) + 1;
298
324
  return {
299
325
  ...i,
300
326
  row: {
301
327
  start: y,
302
- end: g
328
+ end: f
303
329
  },
304
330
  column: {
305
- start: b,
306
- end: v
331
+ start: v,
332
+ end: R
307
333
  }
308
334
  };
309
335
  }
310
- function Et(t) {
336
+ function Pt(t) {
311
337
  t.Commands.add(F, {
312
338
  stop() {
313
339
  },
314
340
  run(e, r, n = {}) {
315
- const o = Q({ editor: e, component: n.target, type: "draggable" });
341
+ const o = Z({ editor: e, component: n.target, type: "draggable" });
316
342
  if (!o) {
317
343
  this.stopCommand();
318
344
  return;
319
345
  }
320
- const { spot: i, target: s, shadowContainerEl: l, shadowSnappedEl: d, shadowTargetEl: c, startScroll: p } = o;
321
- let { container: a } = o, u;
346
+ const { spot: i, target: s, shadowContainerEl: a, shadowSnappedEl: p, shadowTargetEl: d, startScroll: c } = o;
347
+ let { container: l } = o, g;
322
348
  new e.Utils.Dragger({
323
349
  doc: s.el.ownerDocument,
324
350
  onStart: () => {
325
- u = setTimeout(() => {
326
- Z({
351
+ g = setTimeout(() => {
352
+ V({
327
353
  editor: e,
328
- shadowTargetEl: c,
329
- shadowSnappedEl: d,
330
- shadowContainerEl: l,
354
+ shadowTargetEl: d,
355
+ shadowSnappedEl: p,
356
+ shadowContainerEl: a,
331
357
  spotEl: i.attributes.spotEl,
332
358
  target: s,
333
- container: a
334
- }), a = L(e, s.component);
359
+ container: l
360
+ }), l = O(e, s.component);
335
361
  }, 10);
336
362
  },
337
- onEnd: (h, f, { cancelled: w }) => {
338
- clearTimeout(u), V({
363
+ onEnd: (h, m, { cancelled: w }) => {
364
+ clearTimeout(g), tt({
339
365
  editor: e,
340
- shadowSnappedEl: d,
341
- shadowContainerEl: l,
366
+ shadowSnappedEl: p,
367
+ shadowContainerEl: a,
342
368
  target: s,
343
369
  cancelled: w
344
370
  }), this.stopCommand(), e.em.set("_cmpDrag", 1);
345
371
  },
346
- setPosition: ({ x: h, y: f }) => {
347
- const { scroll: w } = et(e), { columns: b, rows: v, gap: y, offset: g, padding: S } = a, { offset: $, margin: x } = s, C = $.top - g.top - S.top - x.top + f - p.top + w.top, M = $.left - g.left - S.left - x.left + h - p.left + w.left, P = Math.min(E(b, 1, M, y.column, 0.5), b.length), T = Math.min(E(v, 1, C, y.row, 0.5), v.length), R = Math.min(
348
- E(b, P, $.width, y.column) + 1,
349
- b.length + 1
350
- ), I = Math.min(E(v, T, $.height, y.row) + 1, v.length + 1);
351
- d.style.gridArea = `${T} / ${P} / ${I} / ${R}`, c.style.top = `${C + S.top}px`, c.style.left = `${M + S.left}px`;
372
+ setPosition: ({ x: h, y: m }) => {
373
+ const { scroll: w } = ot(e), { columns: v, rows: R, gap: y, offset: f, padding: b } = l, { offset: $, margin: T } = s, S = $.top - f.top - b.top - T.top + m - c.top + w.top, C = $.left - f.left - b.left - T.left + h - c.left + w.left, E = Math.min(x(v, 1, C, y.column, 0.5), v.length), P = Math.min(x(R, 1, S, y.row, 0.5), R.length), A = Math.min(
374
+ x(v, E, $.width, y.column) + 1,
375
+ v.length + 1
376
+ ), I = Math.min(x(R, P, $.height, y.row) + 1, R.length + 1);
377
+ p.style.gridArea = `${P} / ${E} / ${I} / ${A}`, d.style.top = `${S + b.top}px`, d.style.left = `${C + b.left}px`;
352
378
  }
353
379
  }).start(n.event);
354
380
  }
355
381
  });
356
382
  }
357
- function xt(t, e) {
358
- const r = Q({ editor: t, component: e.component, type: "resizable" });
383
+ function Gt(t, e) {
384
+ const r = Z({ editor: t, component: e.component, type: "resizable" });
359
385
  if (!r)
360
386
  return;
361
- const { onMove: n, onEnd: o } = e.options || {}, { spot: i, target: s, shadowContainerEl: l, shadowSnappedEl: d, shadowTargetEl: c } = r;
362
- let { container: p } = r, a = "", u;
387
+ const { onMove: n, onEnd: o } = e.options || {}, { spot: i, target: s, shadowContainerEl: a, shadowSnappedEl: p, shadowTargetEl: d } = r;
388
+ let { container: c } = r, l = "", g;
363
389
  return {
364
- onStart: (m) => {
365
- a = m.target.dataset.gjsHandler || "", u = setTimeout(() => {
366
- Z({
390
+ onStart: (u) => {
391
+ l = u.target.dataset.gjsHandler || "", g = setTimeout(() => {
392
+ V({
367
393
  editor: t,
368
- shadowTargetEl: c,
369
- shadowSnappedEl: d,
370
- shadowContainerEl: l,
394
+ shadowTargetEl: d,
395
+ shadowSnappedEl: p,
396
+ shadowContainerEl: a,
371
397
  spotEl: i.attributes.spotEl,
372
398
  target: s,
373
- container: p
374
- }), p = L(t, s.component);
375
- }, 10), t.trigger("component:resize", { ...s, type: "start" });
399
+ container: c
400
+ }), c = O(t, s.component);
401
+ }, 10), t.trigger("component:resize", { ...s || {}, type: "start" });
376
402
  },
377
- onEnd: (m, h) => {
378
- const { startDim: f, rectDim: w } = h.resizer, b = JSON.stringify(f) === JSON.stringify(w);
379
- clearTimeout(u), V({ editor: t, shadowSnappedEl: d, shadowContainerEl: l, target: s, cancelled: b }), o == null || o(m, h);
403
+ onEnd: (u, h) => {
404
+ const { startDim: m, rectDim: w } = h.resizer, v = JSON.stringify(m) === JSON.stringify(w);
405
+ clearTimeout(g), tt({ editor: t, shadowSnappedEl: p, shadowContainerEl: a, target: s, cancelled: v }), o == null || o(u, h);
380
406
  },
381
- onMove: (m, h) => {
382
- const f = ot(d), w = s.margin.left, b = s.margin.top, v = s.margin.bottom, y = s.margin.right, { w: g, t: S, l: $, h: x } = h.resizer.rectDim, C = {
383
- t: S - b,
407
+ onMove: (u, h) => {
408
+ const m = nt(p), w = s.margin.left, v = s.margin.top, R = s.margin.bottom, y = s.margin.right, { w: f, t: b, l: $, h: T } = h.resizer.rectDim, S = {
409
+ t: b - v,
384
410
  l: $ - w,
385
- h: x + b + v,
386
- w: g + w + y
411
+ h: T + v + R,
412
+ w: f + w + y
387
413
  };
388
- a.endsWith("l") && (f.column.start = E(
389
- p.columns,
414
+ l.endsWith("l") && (m.column.start = x(
415
+ c.columns,
390
416
  1,
391
- C.l - p.offset.left - p.padding.left,
392
- p.gap.column,
417
+ S.l - c.offset.left - c.padding.left,
418
+ c.gap.column,
393
419
  0.5
394
- )), a.startsWith("t") && (f.row.start = E(
395
- p.rows,
420
+ )), l.startsWith("t") && (m.row.start = x(
421
+ c.rows,
396
422
  1,
397
- C.t - p.offset.top - p.padding.top,
398
- p.gap.row,
423
+ S.t - c.offset.top - c.padding.top,
424
+ c.gap.row,
399
425
  0.5
400
- )), a.endsWith("r") && (f.column.end = Math.max(
401
- E(p.columns, f.column.start, C.w, p.gap.column, 0.5),
402
- f.column.start + 1
403
- )), a.startsWith("b") && (f.row.end = Math.max(
404
- E(p.rows, f.row.start, C.h, p.gap.row, 0.5),
405
- f.row.start + 1
406
- )), d.style.gridArea = `${f.row.start} / ${f.column.start} / ${f.row.end} / ${f.column.end}`, c.style.width = `${C.w}px`, c.style.height = `${C.h}px`, c.style.left = `${C.l - p.offset.left}px`, c.style.top = `${C.t - p.offset.top}px`, n == null || n(m, h);
426
+ )), l.endsWith("r") && (m.column.end = Math.max(
427
+ x(c.columns, m.column.start, S.w, c.gap.column, 0.5),
428
+ m.column.start + 1
429
+ )), l.startsWith("b") && (m.row.end = Math.max(
430
+ x(c.rows, m.row.start, S.h, c.gap.row, 0.5),
431
+ m.row.start + 1
432
+ )), p.style.gridArea = `${m.row.start} / ${m.column.start} / ${m.row.end} / ${m.column.end}`, d.style.width = `${S.w}px`, d.style.height = `${S.h}px`, d.style.left = `${S.l - c.offset.left}px`, d.style.top = `${S.t - c.offset.top}px`, n == null || n(u, h);
407
433
  }
408
434
  };
409
435
  }
410
- const U = ["px", "%", "em", "rem", "vw", "vh"], Tt = (t, e) => {
436
+ const k = ["px", "%", "em", "rem", "vw", "vh"], Et = (t, e) => {
411
437
  const r = t.Styles.getSectors().find((n) => !!n.getProperty(e));
412
438
  return {
413
439
  sector: r,
414
440
  property: r ? r.getProperty(e) : void 0
415
441
  };
416
- }, Gt = (t, e) => Tt(t, e), Pt = (t, { x: e, y: r, mergable: n } = {}) => {
442
+ }, At = (t, e) => Et(t, e), Dt = (t, { x: e, y: r, mergable: n } = {}) => {
417
443
  const o = {
418
444
  property: `${t}-x`,
419
445
  type: "integer",
420
- units: U,
446
+ units: k,
421
447
  ...e
422
448
  }, i = {
423
449
  property: `${t}-y`,
424
450
  type: "integer",
425
- units: U,
451
+ units: k,
426
452
  ...r
427
453
  };
428
454
  return {
@@ -430,39 +456,39 @@ const U = ["px", "%", "em", "rem", "vw", "vh"], Tt = (t, e) => {
430
456
  type: "composite",
431
457
  properties: [o, i],
432
458
  ...n && {
433
- fromStyle(s, { name: l, separator: d, property: c }) {
434
- const [p, a] = c.getProperties(), [u, m] = (s[l] || "").split(d);
459
+ fromStyle(s, { name: a, separator: p, property: d }) {
460
+ const [c, l] = d.getProperties(), [g, u] = (s[a] || "").split(p);
435
461
  return {
436
- [p.getId()]: s[p.getName()] || u || "",
437
- [a.getId()]: s[a.getName()] || m || u || ""
462
+ [c.getId()]: s[c.getName()] || g || "",
463
+ [l.getId()]: s[l.getName()] || u || g || ""
438
464
  };
439
465
  },
440
- toStyle(s, { name: l, property: d }) {
441
- const [c, p] = d.getProperties(), a = s[c.getId()], u = s[p.getId()];
466
+ toStyle(s, { name: a, property: p }) {
467
+ const [d, c] = p.getProperties(), l = s[d.getId()], g = s[c.getId()];
442
468
  return {
443
- [l]: a === u ? a : `${a} ${u}`
469
+ [a]: l === g ? l : `${l} ${g}`
444
470
  };
445
471
  }
446
472
  }
447
473
  };
448
- }, z = { display: ["grid"] };
449
- function Rt(t = "") {
474
+ }, B = { display: ["grid"] };
475
+ function Mt(t = "") {
450
476
  const e = /^repeat\(\s*(\d+)\s*,\s*(.+)\s*\)$/i, r = /^minmax\(\s*(.+?)\s*,\s*(.+?)\s*\)$/i, n = t.match(e);
451
477
  if (!n)
452
478
  return null;
453
479
  const o = parseInt(n[1], 10), i = n[2];
454
- let s = i, l = i;
455
- const d = i.match(r);
456
- return d && (s = d[1], l = d[2]), {
480
+ let s = i, a = i;
481
+ const p = i.match(r);
482
+ return p && (s = p[1], a = p[2]), {
457
483
  total: o,
458
- min: s === l ? "" : s,
459
- max: l
484
+ min: s === a ? "" : s,
485
+ max: a
460
486
  };
461
487
  }
462
- function At(t = {}) {
488
+ function Ct(t = {}) {
463
489
  let e = "", r = "", n = "", o = "";
464
- const i = (f) => f.split("/").map((w) => w.trim()).filter(Boolean), s = t["grid-area"] || "", l = t["grid-column"] || "", d = t["grid-row"] || "", c = i(s), p = i(l), a = i(d), u = c.length, m = p.length, h = a.length;
465
- return u === 4 ? (n = c[0], e = c[1], o = c[2], r = c[3]) : u === 3 ? (n = c[0], e = c[1], o = c[2]) : u === 2 ? (n = c[0], e = c[1]) : u === 1 && (n = c[0]), m === 2 ? (e = p[0], r = p[1]) : m === 1 && (e = p[0]), h === 2 ? (n = a[0], o = a[1]) : h === 1 && (n = a[0]), {
490
+ const i = (m) => m.split("/").map((w) => w.trim()).filter(Boolean), s = t["grid-area"] || "", a = t["grid-column"] || "", p = t["grid-row"] || "", d = i(s), c = i(a), l = i(p), g = d.length, u = c.length, h = l.length;
491
+ return g === 4 ? (n = d[0], e = d[1], o = d[2], r = d[3]) : g === 3 ? (n = d[0], e = d[1], o = d[2]) : g === 2 ? (n = d[0], e = d[1]) : g === 1 && (n = d[0]), u === 2 ? (e = c[0], r = c[1]) : u === 1 && (e = c[0]), h === 2 ? (n = l[0], o = l[1]) : h === 1 && (n = l[0]), {
466
492
  columnStart: e,
467
493
  columnEnd: r,
468
494
  rowStart: n,
@@ -475,7 +501,7 @@ function q(t) {
475
501
  property: e,
476
502
  label: r,
477
503
  type: "composite",
478
- requires: z,
504
+ requires: B,
479
505
  generic: !0,
480
506
  properties: [
481
507
  {
@@ -504,24 +530,24 @@ function q(t) {
504
530
  }
505
531
  ],
506
532
  fromStyle(i, s) {
507
- const { name: l, property: d } = s, [c, p, a] = d.getProperties(), u = i[l], m = Rt(u), h = (m == null ? void 0 : m.max) ?? o;
533
+ const { name: a, property: p } = s, [d, c, l] = p.getProperties(), g = i[a], u = Mt(g), h = (u == null ? void 0 : u.max) ?? o;
508
534
  return {
509
- [c.id]: (m == null ? void 0 : m.total) ?? n,
510
- [p.id]: (m == null ? void 0 : m.min) ?? "",
511
- [a.id]: h === o ? "" : h
535
+ [d.id]: (u == null ? void 0 : u.total) ?? n,
536
+ [c.id]: (u == null ? void 0 : u.min) ?? "",
537
+ [l.id]: h === o ? "" : h
512
538
  };
513
539
  },
514
- toStyle(i, { name: s, property: l }) {
515
- const [d, c, p] = l.getProperties(), a = i[d.id], u = i[c.id], m = i[p.id] || o, h = u && m ? `minmax(${u}, ${m})` : m;
540
+ toStyle(i, { name: s, property: a }) {
541
+ const [p, d, c] = a.getProperties(), l = i[p.id], g = i[d.id], u = i[c.id] || o, h = g && u ? `minmax(${g}, ${u})` : u;
516
542
  return {
517
- [s]: `repeat(${a || n}, ${h})`
543
+ [s]: `repeat(${l || n}, ${h})`
518
544
  };
519
545
  }
520
546
  };
521
547
  }
522
- function Dt(t, e) {
548
+ function It(t, e) {
523
549
  if (!e.styleableGrid) return;
524
- const { property: r, ...n } = Gt(t, "display");
550
+ const { property: r, ...n } = At(t, "display");
525
551
  if (!r) return;
526
552
  const o = r.getOption("grid"), i = n.sector;
527
553
  o || r.addOption({ id: "grid", label: "Grid" }), i.addProperty(
@@ -539,8 +565,8 @@ function Dt(t, e) {
539
565
  ), i.addProperty(
540
566
  {
541
567
  id: "grid-gap",
542
- requires: z,
543
- ...Pt("gap", {
568
+ requires: B,
569
+ ...Dt("gap", {
544
570
  x: { id: "grid-row-gap", label: "Row", property: "row-gap", min: 0, default: "0" },
545
571
  y: { id: "grid-column-gap", label: "Column", property: "column-gap", min: 0, default: "0" },
546
572
  mergable: !0
@@ -552,7 +578,7 @@ function Dt(t, e) {
552
578
  type: "composite",
553
579
  property: "grid-area",
554
580
  label: "Grid area",
555
- requiresParent: z,
581
+ requiresParent: B,
556
582
  // detached: true,
557
583
  generic: !0,
558
584
  properties: [
@@ -582,51 +608,51 @@ function Dt(t, e) {
582
608
  }
583
609
  ],
584
610
  fromStyle(s) {
585
- const l = At(s);
611
+ const a = Ct(s);
586
612
  return {
587
- "grid-column-start": s["grid-column-start"] || l.columnStart,
588
- "grid-column-end": s["grid-column-end"] || l.columnEnd,
589
- "grid-row-start": s["grid-row-start"] || l.rowStart,
590
- "grid-row-end": s["grid-row-end"] || l.rowEnd
613
+ "grid-column-start": s["grid-column-start"] || a.columnStart,
614
+ "grid-column-end": s["grid-column-end"] || a.columnEnd,
615
+ "grid-row-start": s["grid-row-start"] || a.rowStart,
616
+ "grid-row-end": s["grid-row-end"] || a.rowEnd
591
617
  };
592
618
  },
593
- toStyle(s, { name: l }) {
594
- const d = s["grid-row-start"] || "auto", c = s["grid-row-end"] || "auto", p = s["grid-column-start"] || "auto", a = s["grid-column-end"] || "auto";
619
+ toStyle(s, { name: a }) {
620
+ const p = s["grid-row-start"] || "auto", d = s["grid-row-end"] || "auto", c = s["grid-column-start"] || "auto", l = s["grid-column-end"] || "auto";
595
621
  return {
596
- [l]: `${d} / ${p} / ${c} / ${a}`
622
+ [a]: `${p} / ${c} / ${d} / ${l}`
597
623
  };
598
624
  }
599
625
  },
600
626
  {}
601
627
  );
602
628
  }
603
- const Mt = function(t, e = {}) {
629
+ const Lt = function(t, e = {}) {
604
630
  const r = {
605
631
  itemResizable: !0,
606
632
  ...e
607
- }, { Canvas: n, Commands: o, Components: i } = t, { itemResizable: s } = r, l = n.events, d = o.events, c = i.events, p = `${d.runBeforeCommand}tlb-move`, a = `${d.runBeforeCommand}resize`;
608
- let u;
609
- Et(t);
610
- const m = ({ options: y }) => {
611
- _(t, y.target, r) && (t.runCommand(F, { ...y }), y.abort = !0);
633
+ }, { Canvas: n, Commands: o, Components: i } = t, { itemResizable: s } = r, a = n.events, p = o.events, d = i.events, c = `${p.runBeforeCommand}tlb-move`, l = `${p.runBeforeCommand}resize`;
634
+ let g;
635
+ Pt(t);
636
+ const u = ({ options: y }) => {
637
+ L(t, y.target, r) && (t.runCommand(F, { ...y }), y.abort = !0);
612
638
  }, h = (y) => {
613
- const { options: g } = y;
614
- _(t, g.component, r) && (g.options = Object.assign(g.options || {}, xt(t, g)));
615
- }, f = () => {
639
+ const { options: f } = y;
640
+ L(t, f.component, r) && (f.options = Object.assign(f.options || {}, Gt(t, f)));
641
+ }, m = () => {
616
642
  const y = n.getSpots({
617
- type: A
643
+ type: D
618
644
  }).pop();
619
645
  if (!y) return;
620
- let g = y.attributes.spotEl;
621
- g || (g = document.createElement("div"), g.className = D, y.set({ spotEl: g })), Object.entries(y.getStyle()).forEach(([S, $]) => g.style.setProperty(S, $)), u == null || u.appendChild(g);
646
+ let f = y.attributes.spotEl;
647
+ f || (f = document.createElement("div"), f.className = M, y.set({ spotEl: f })), Object.entries(y.getStyle()).forEach(([b, $]) => f.style.setProperty(b, $)), g == null || g.appendChild(f);
622
648
  }, w = ({ spot: y }) => {
623
- const g = y.attributes.spotEl;
624
- y.type !== A || !g || u == null || u.removeChild(g);
649
+ const f = y.attributes.spotEl;
650
+ y.type !== D || !f || g == null || g.removeChild(f);
625
651
  };
626
652
  if (s) {
627
- const y = (g) => {
628
- const S = K(s) ? s({ component: g }) : s;
629
- return typeof S == "boolean" ? S : {
653
+ const y = (f) => {
654
+ const b = X(s) ? s({ component: f }) : s;
655
+ return typeof b == "boolean" ? b : {
630
656
  tl: !1,
631
657
  tc: !1,
632
658
  tr: !1,
@@ -635,41 +661,41 @@ const Mt = function(t, e = {}) {
635
661
  bl: !1,
636
662
  bc: !1,
637
663
  br: !1,
638
- ...S
664
+ ...b
639
665
  };
640
666
  };
641
- t.on(c.resizeInit, (g) => {
642
- const { component: S } = g;
643
- if (_(t, S, r)) {
644
- const $ = y(S);
645
- g.resizable = $;
667
+ t.on(d.resizeInit, (f) => {
668
+ const { component: b } = f;
669
+ if (L(t, b, r)) {
670
+ const $ = y(b);
671
+ f.resizable = $;
646
672
  }
647
673
  });
648
674
  }
649
- const b = [
650
- [p, m],
651
- [a, h],
652
- [l.spot, f],
653
- [l.spotRemove, w]
675
+ const v = [
676
+ [c, u],
677
+ [l, h],
678
+ [a.spot, m],
679
+ [a.spotRemove, w]
654
680
  ];
655
- b.forEach(([y, g]) => {
656
- t.on(y, g);
681
+ v.forEach(([y, f]) => {
682
+ t.on(y, f);
657
683
  }), t.onReady(() => {
658
- u = n.getSpotsEl(), ht(), Dt(t, r);
684
+ g = n.getSpotsEl(), bt(), It(t, r);
659
685
  });
660
- const v = () => {
661
- delete t.Commands.commands[F], b.forEach(([y, g]) => {
662
- t.off(y, g);
686
+ const R = () => {
687
+ delete t.Commands.commands[F], v.forEach(([y, f]) => {
688
+ t.off(y, f);
663
689
  });
664
690
  };
665
- mt({
691
+ ft({
666
692
  editor: t,
667
693
  licenseKey: r.licenseKey,
668
- plan: ft,
694
+ plan: ht,
669
695
  pluginName: N,
670
- cleanup: v
696
+ cleanup: R
671
697
  });
672
- }, It = ut(Mt);
698
+ }, _t = ut(Lt);
673
699
  export {
674
- It as default
700
+ _t as default
675
701
  };