@grapesjs/studio-sdk-plugins 1.0.35 → 1.0.36

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