@grapesjs/studio-sdk-plugins 1.0.37 → 1.0.38-rc.0

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