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