@grapesjs/studio-sdk-plugins 1.0.9 → 1.0.10

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.
@@ -1,21 +1,21 @@
1
- function ce(e, t, o) {
2
- let l, s, n, c, a;
3
- const r = t;
1
+ function re(e, t, o) {
2
+ let l, s, n, r, a;
3
+ const c = t;
4
4
  function h() {
5
- const g = Date.now() - c;
6
- g < r && g >= 0 ? l = setTimeout(h, r - g) : (l = null, a = e.apply(n, s), n = s = null);
5
+ const b = Date.now() - r;
6
+ b < c && b >= 0 ? l = setTimeout(h, c - b) : (l = null, a = e.apply(n, s), n = s = null);
7
7
  }
8
- const v = function() {
9
- return n = this, s = arguments, c = Date.now(), l || (l = setTimeout(h, r)), a;
8
+ const d = function() {
9
+ return n = this, s = arguments, r = Date.now(), l || (l = setTimeout(h, c)), a;
10
10
  };
11
- return v.clear = function() {
11
+ return d.clear = function() {
12
12
  l && (clearTimeout(l), l = null);
13
- }, v.flush = function() {
13
+ }, d.flush = function() {
14
14
  l && (a = e.apply(n, s), n = s = null, clearTimeout(l), l = null);
15
- }, v;
15
+ }, d;
16
16
  }
17
- const B = "app.grapesjs.com", O = "app-stage.grapesjs.com", T = [
18
- B,
17
+ const $ = "app.grapesjs.com", O = "app-stage.grapesjs.com", D = [
18
+ $,
19
19
  O,
20
20
  "localhost",
21
21
  "127.0.0.1",
@@ -25,75 +25,99 @@ const B = "app.grapesjs.com", O = "app-stage.grapesjs.com", T = [
25
25
  // For stackblitz.com demos
26
26
  "-sandpack.codesandbox.io"
27
27
  // For Sandpack demos
28
- ], re = "license:check:start", ie = "license:check:end", _ = () => typeof window < "u", he = ({ isDev: e, isStage: t }) => `${e ? "" : `https://${t ? O : B}`}/api`, de = () => {
29
- const e = _() && window.location.hostname;
30
- return !!e && (T.includes(e) || T.some((t) => e.endsWith(t)));
31
- }, ve = () => (_() && window.location.hostname) === B;
32
- function F(e) {
28
+ ], ie = "license:check:start", he = "license:check:end", de = () => typeof window < "u", ve = ({ isDev: e, isStage: t }) => `${e ? "" : `https://${t ? O : $}`}/api`, be = () => {
29
+ const e = de() && window.location.hostname;
30
+ return !!e && (D.includes(e) || D.some((t) => e.endsWith(t)));
31
+ };
32
+ function W(e) {
33
33
  return typeof e == "function";
34
34
  }
35
- var be = {};
36
- const ge = be.NODE_ENV !== "production";
35
+ var y = /* @__PURE__ */ ((e) => (e.free = "free", e.startup = "startup", e.business = "business", e.enterprise = "enterprise", e))(y || {});
37
36
  async function ue({
38
37
  path: e,
39
- method: t = "GET",
40
- headers: o = {},
41
- body: l
38
+ baseApiUrl: t,
39
+ method: o = "GET",
40
+ headers: l = {},
41
+ params: s,
42
+ body: n
42
43
  }) {
43
- const n = `${he({ isDev: ge, isStage: !ve() })}${e}`, c = {
44
- method: t,
44
+ const a = `${t || ve({ isDev: !1, isStage: !1 })}${e}`, c = {
45
+ method: o,
45
46
  headers: {
46
47
  "Content-Type": "application/json",
47
- ...o
48
+ ...l
48
49
  }
49
50
  };
50
- l && (c.body = JSON.stringify(l));
51
- const a = await fetch(n, c);
52
- if (!a.ok)
53
- throw new Error(`HTTP error! status: ${a.status}`);
54
- return a.json();
51
+ n && (c.body = JSON.stringify(n));
52
+ const h = s ? new URLSearchParams(s).toString() : "", d = h ? `?${h}` : "", b = await fetch(`${a}${d}`, c);
53
+ if (!b.ok)
54
+ throw new Error(`HTTP error! status: ${b.status}`);
55
+ return b.json();
55
56
  }
56
- function pe(e) {
57
+ const L = {
58
+ [y.free]: 0,
59
+ [y.startup]: 10,
60
+ [y.business]: 20,
61
+ [y.enterprise]: 30
62
+ };
63
+ function ge(e) {
57
64
  const t = e;
58
65
  return t.init = (o) => (l) => e(l, o), t;
59
66
  }
60
- const fe = (e) => /* @__PURE__ */ pe(e);
61
- async function me({
67
+ const pe = (e) => /* @__PURE__ */ ge(e);
68
+ async function fe({
62
69
  editor: e,
63
- pluginName: t,
64
- licenseKey: o,
65
- cleanup: l
70
+ plan: t,
71
+ pluginName: o,
72
+ licenseKey: l,
73
+ cleanup: s
66
74
  }) {
67
- let s = !1;
68
- const n = de();
69
- e.on(re, () => {
70
- s = !0;
71
- }), e.on(ie, ({ sdkLicense: c }) => {
72
- c || l();
75
+ let n = "", r = !1;
76
+ const a = be(), c = (d) => {
77
+ console.warn("Cleanup plugin:", o, "Reason:", d), s();
78
+ }, h = (d = {}) => {
79
+ var m;
80
+ const { error: b, sdkLicense: f } = d, w = (m = d.plan) == null ? void 0 : m.category;
81
+ if (!(f || d.license) || b)
82
+ c(b || "Invalid license");
83
+ else if (w) {
84
+ const z = L[t], P = L[w];
85
+ z > P && c({ pluginRequiredPlan: t, licensePlan: w });
86
+ }
87
+ };
88
+ e.on(ie, (d) => {
89
+ n = d == null ? void 0 : d.baseApiUrl, r = !0;
90
+ }), e.on(he, (d) => {
91
+ h(d);
73
92
  }), setTimeout(async () => {
74
- if (!s) {
75
- if (n) return;
76
- o && await we({ licenseKey: o, pluginName: t }) || l();
93
+ if (!r) {
94
+ if (a) return;
95
+ if (l) {
96
+ const d = await me({ licenseKey: l, pluginName: o, baseApiUrl: n });
97
+ d && h(d);
98
+ } else
99
+ c("The `licenseKey` option not provided");
77
100
  }
78
101
  }, 2e3);
79
102
  }
80
- async function we({ licenseKey: e, pluginName: t }) {
103
+ async function me(e) {
104
+ const { licenseKey: t, pluginName: o, baseApiUrl: l } = e;
81
105
  try {
82
- const o = await ue({
83
- path: `/sdk/${e}`,
106
+ return (await ue({
107
+ baseApiUrl: l,
108
+ path: `/sdk/${t || "na"}`,
84
109
  method: "POST",
85
- body: JSON.stringify({
110
+ params: {
86
111
  d: window.location.hostname,
87
- pn: t
88
- })
89
- }), { license: l } = o.result || {};
90
- return !!l;
91
- } catch (o) {
92
- return console.error("Error during SDK license check:", o), !1;
112
+ pn: o
113
+ }
114
+ })).result || {};
115
+ } catch (s) {
116
+ return console.error("Error during SDK license check:", s), !1;
93
117
  }
94
118
  }
95
- var W = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.projectFiles = "studio:projectFiles", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e))(W || {}), i = /* @__PURE__ */ ((e) => (e.table = "table", e.tableSettings = "tableSettings", e.tableDelete = "tableDelete", e.tableHead = "tableHead", e.tableFoot = "tableFoot", e.tableCellItems = "tableCellItems", e.tableCellProperties = "tableCellProperties", e.tableCellMerge = "tableCellMerge", e.tableCellSplit = "tableCellSplit", e.tableRowItems = "tableRowItems", e.tableRowInsertBefore = "tableRowInsertBefore", e.tableRowInsertAfter = "tableRowInsertAfter", e.tableRowDelete = "tableRowDelete", e.tableRowProperties = "tableRowProperties", e.tableRowCut = "tableRowCut", e.tableRowCopy = "tableRowCopy", e.tableRowPasteBefore = "tableRowPasteBefore", e.tableRowPasteAfter = "tableRowPasteAfter", e.tableColumn = "tableColumn", e.tableColumnItems = "tableColumnItems", e.tableColumnInsertBefore = "tableColumnInsertBefore", e.tableColumnInsertAfter = "tableColumnInsertAfter", e.tableColumnDelete = "tableColumnDelete", e.tableColumnCut = "tableColumnCut", e.tableColumnCopy = "tableColumnCopy", e.tableColumnPasteBefore = "tableColumnPasteBefore", e.tableColumnPasteAfter = "tableColumnPasteAfter", e))(i || {});
96
- const d = {
119
+ var U = /* @__PURE__ */ ((e) => (e.toastAdd = "studio:toastAdd", e.dialogOpen = "studio:dialogOpen", e.dialogClose = "studio:dialogClose", e.sidebarLeftSet = "studio:sidebarLeft:set", e.sidebarLeftGet = "studio:sidebarLeft:get", e.sidebarLeftToggle = "studio:sidebarLeft:toggle", e.sidebarRightSet = "studio:sidebarRight:set", e.sidebarRightGet = "studio:sidebarRight:get", e.sidebarRightToggle = "studio:sidebarRight:toggle", e.sidebarTopSet = "studio:sidebarTop:set", e.sidebarTopGet = "studio:sidebarTop:get", e.sidebarTopToggle = "studio:sidebarTop:toggle", e.sidebarBottomSet = "studio:sidebarBottom:set", e.sidebarBottomGet = "studio:sidebarBottom:get", e.sidebarBottomToggle = "studio:sidebarBottom:toggle", e.symbolAdd = "studio:symbolAdd", e.symbolDetach = "studio:symbolDetach", e.symbolOverride = "studio:symbolOverride", e.symbolPropagateStyles = "studio:propagateStyles", e.getPagesConfig = "studio:getPagesConfig", e.setPagesConfig = "studio:setPagesConfig", e.getPageSettings = "studio:getPageSettings", e.setPageSettings = "studio:setPageSettings", e.projectFiles = "studio:projectFiles", e.canvasReload = "studio:canvasReload", e.getBlocksPanel = "studio:getBlocksPanel", e.setBlocksPanel = "studio:setBlocksPanel", e.contextMenuComponent = "studio:contextMenuComponent", e.layoutAdd = "studio:layoutAdd", e.layoutRemove = "studio:layoutRemove", e.layoutToggle = "studio:layoutToggle", e))(U || {}), i = /* @__PURE__ */ ((e) => (e.table = "table", e.tableSettings = "tableSettings", e.tableDelete = "tableDelete", e.tableHead = "tableHead", e.tableFoot = "tableFoot", e.tableCellItems = "tableCellItems", e.tableCellProperties = "tableCellProperties", e.tableCellMerge = "tableCellMerge", e.tableCellSplit = "tableCellSplit", e.tableRowItems = "tableRowItems", e.tableRowInsertBefore = "tableRowInsertBefore", e.tableRowInsertAfter = "tableRowInsertAfter", e.tableRowDelete = "tableRowDelete", e.tableRowProperties = "tableRowProperties", e.tableRowCut = "tableRowCut", e.tableRowCopy = "tableRowCopy", e.tableRowPasteBefore = "tableRowPasteBefore", e.tableRowPasteAfter = "tableRowPasteAfter", e.tableColumn = "tableColumn", e.tableColumnItems = "tableColumnItems", e.tableColumnInsertBefore = "tableColumnInsertBefore", e.tableColumnInsertAfter = "tableColumnInsertAfter", e.tableColumnDelete = "tableColumnDelete", e.tableColumnCut = "tableColumnCut", e.tableColumnCopy = "tableColumnCopy", e.tableColumnPasteBefore = "tableColumnPasteBefore", e.tableColumnPasteAfter = "tableColumnPasteAfter", e))(i || {});
120
+ const v = {
97
121
  table: '<svg viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8H5m8 0v4h6V8h-6m-8 6v4h6v-4H5m8 0v4h6v-4h-6Z"/></svg>',
98
122
  tableSettings: '<svg viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8H5m8 0v4h6V8h-6m-8 6v4h6v-4H5m8 0v4h6v-4h-6Z"/></svg>',
99
123
  tableDelete: '<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="m14.4 8.6 1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></svg>',
@@ -121,10 +145,10 @@ const d = {
121
145
  tableColumnCopy: '<svg viewBox="0 0 24 24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',
122
146
  tableColumnPasteBefore: '<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',
123
147
  tableColumnPasteAfter: '<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>'
124
- }, p = "table", G = "thead", $ = "tfoot", P = "tbody", u = "row", b = "cell", k = "clipboardTable", ye = [p, G, $, P, u, b], V = (e) => e.em.get(k) || [], Ce = (e) => e.every((t) => t.is(b)), x = (e, t) => {
125
- const { editor: o, event: l, opts: s } = e, n = l.currentTarget || l.target, { x: c, y: a, width: r, height: h } = n.getBoundingClientRect(), v = {
148
+ }, p = "table", G = "thead", _ = "tfoot", x = "tbody", g = "row", u = "cell", k = "clipboardTable", we = [p, G, _, x, g, u], A = (e) => e.em.get(k) || [], ye = (e) => e.every((t) => t.is(u)), M = (e, t) => {
149
+ const { editor: o, event: l, opts: s } = e, n = l.currentTarget || l.target, { x: r, y: a, width: c, height: h } = n.getBoundingClientRect(), d = {
126
150
  style: { width: 240, height: 300 },
127
- placer: { type: "popover", closeOnClickAway: !0, x: c, y: a, w: r, h },
151
+ placer: { type: "popover", closeOnClickAway: !0, x: r, y: a, w: c, h },
128
152
  layout: {
129
153
  type: "tabs",
130
154
  value: "props",
@@ -143,41 +167,41 @@ const d = {
143
167
  },
144
168
  ...t
145
169
  };
146
- F(s.openSettings) ? s.openSettings({ ...e, layoutProps: v }) : o.runCommand(W.layoutToggle, v);
147
- }, He = (e, {
170
+ W(s.openSettings) ? s.openSettings({ ...e, layoutProps: d }) : o.runCommand(U.layoutToggle, d);
171
+ }, Ce = (e, {
148
172
  rows: t = 1,
149
173
  cells: o = 5,
150
174
  text: l
151
175
  } = {}) => ({
152
176
  type: e,
153
177
  components: Array.from(Array(t).keys()).map((s) => ({
154
- type: u,
178
+ type: g,
155
179
  components: Array.from(Array(o).keys()).map((n) => ({
156
- type: b,
157
- components: l ? { type: "text", content: F(l) ? l({ y: s, x: n }) : l } : void 0
180
+ type: u,
181
+ components: l ? { type: "text", content: W(l) ? l({ y: s, x: n }) : l } : void 0
158
182
  }))
159
183
  }))
160
- }), j = "Table settings", U = (e) => {
184
+ }), K = "Table settings", j = (e) => {
161
185
  const { component: t } = e;
162
186
  return t.is(p) ? t : t.closestType(p);
163
- }, Ve = (e) => {
187
+ }, He = (e) => {
164
188
  var t;
165
- (t = U(e)) == null || t.remove(e.opts);
189
+ (t = j(e)) == null || t.remove(e.opts);
166
190
  }, Re = (e) => {
167
- const t = U(e);
168
- t && (e.editor.select(t), x(e, {
191
+ const t = j(e);
192
+ t && (e.editor.select(t), M(e, {
169
193
  id: "tableSettings",
170
- header: { label: j }
194
+ header: { label: K }
171
195
  }));
172
- }, K = (e) => [{
196
+ }, q = (e) => [{
173
197
  id: i.table,
174
- icon: d[i.table],
198
+ icon: v[i.table],
175
199
  label: "Table",
176
200
  items: [
177
201
  {
178
202
  id: i.tableSettings,
179
- label: j,
180
- icon: d[i.tableSettings],
203
+ label: K,
204
+ icon: v[i.tableSettings],
181
205
  onClick: ({ event: o }) => Re({
182
206
  ...e,
183
207
  // @ts-expect-error workaround for the build
@@ -187,162 +211,162 @@ const d = {
187
211
  {
188
212
  id: i.tableDelete,
189
213
  label: "Delete table",
190
- icon: d[i.tableDelete],
191
- onClick: () => Ve(e)
214
+ icon: v[i.tableDelete],
215
+ onClick: () => He(e)
192
216
  }
193
217
  ]
194
- }], J = ({ editor: e }) => {
195
- const t = V(e);
196
- return t.length && Ce(t);
218
+ }], X = ({ editor: e }) => {
219
+ const t = A(e);
220
+ return t.length && ye(t);
197
221
  }, E = ({ component: e, editor: t, after: o }) => {
198
- if (!e.is(b)) return;
199
- const l = e.closestType(p), s = e.closestType(u), n = e.index() + (o ? 1 : 0);
200
- l == null || l.findType(u).forEach((a) => a.append({ type: b }, { at: n }));
201
- const c = s == null ? void 0 : s.components().at(n);
202
- c && t.select(c);
203
- }, X = ({ component: e, opts: t }) => {
204
- if (!e.is(b)) return;
222
+ if (!e.is(u)) return;
223
+ const l = e.closestType(p), s = e.closestType(g), n = e.index() + (o ? 1 : 0);
224
+ l == null || l.findType(g).forEach((a) => a.append({ type: u }, { at: n }));
225
+ const r = s == null ? void 0 : s.components().at(n);
226
+ r && t.select(r);
227
+ }, Y = ({ component: e, opts: t }) => {
228
+ if (!e.is(u)) return;
205
229
  const o = e.closestType(p), l = e.index();
206
- o == null || o.findType(u).forEach((s) => {
230
+ o == null || o.findType(g).forEach((s) => {
207
231
  var n;
208
232
  return (n = s.components().at(l)) == null ? void 0 : n.remove(t);
209
233
  });
210
- }, Y = ({ component: e, editor: t }) => {
211
- if (!e.is(b)) return;
212
- const o = e.closestType(p), l = e.index(), s = (o == null ? void 0 : o.findType(u).map((n) => n.components().at(l))) || [];
234
+ }, J = ({ component: e, editor: t }) => {
235
+ if (!e.is(u)) return;
236
+ const o = e.closestType(p), l = e.index(), s = (o == null ? void 0 : o.findType(g).map((n) => n.components().at(l))) || [];
213
237
  s.length && t.em.set(k, s);
214
- }, L = (e) => {
238
+ }, Z = (e) => {
215
239
  const { component: t, editor: o, after: l } = e;
216
- if (!t.is(b) || !J(e)) return;
217
- const s = V(o), n = t.closestType(p), c = t.index() + (l ? 1 : 0);
218
- n == null || n.findType(u).forEach((a, r) => {
219
- const h = s[r], v = (h == null ? void 0 : h.clone()) || { type: b };
220
- a.append(v, { at: c });
240
+ if (!t.is(u) || !X(e)) return;
241
+ const s = A(o), n = t.closestType(p), r = t.index() + (l ? 1 : 0);
242
+ n == null || n.findType(g).forEach((a, c) => {
243
+ const h = s[c], d = (h == null ? void 0 : h.clone()) || { type: u };
244
+ a.append(d, { at: r });
221
245
  });
222
- }, ze = (e) => {
246
+ }, Ve = (e) => {
223
247
  const { component: t } = e;
224
- t.is(b) && (Y(e), X({ ...e, opts: { temporary: !0 } }));
225
- }, Pe = (e) => {
226
- const t = J(e);
248
+ t.is(u) && (J(e), Y({ ...e, opts: { temporary: !0 } }));
249
+ }, ze = (e) => {
250
+ const t = X(e);
227
251
  return [{
228
252
  id: i.tableColumnItems,
229
- icon: d[i.tableColumn],
253
+ icon: v[i.tableColumn],
230
254
  label: "Column",
231
255
  items: [
232
256
  {
233
257
  id: i.tableColumnInsertBefore,
234
258
  label: "Insert column before",
235
- icon: d[i.tableColumnInsertBefore],
259
+ icon: v[i.tableColumnInsertBefore],
236
260
  onClick: () => E(e)
237
261
  },
238
262
  {
239
263
  id: i.tableColumnInsertAfter,
240
264
  label: "Insert column after",
241
- icon: d[i.tableColumnInsertAfter],
265
+ icon: v[i.tableColumnInsertAfter],
242
266
  onClick: () => E({ ...e, after: !0 })
243
267
  },
244
268
  {
245
269
  id: i.tableColumnDelete,
246
270
  label: "Delete column",
247
- icon: d[i.tableColumnDelete],
248
- onClick: () => X(e)
271
+ icon: v[i.tableColumnDelete],
272
+ onClick: () => Y(e)
249
273
  },
250
274
  {
251
275
  id: i.tableColumnCut,
252
276
  label: "Cut column",
253
- icon: d[i.tableColumnCut],
254
- onClick: () => ze(e)
277
+ icon: v[i.tableColumnCut],
278
+ onClick: () => Ve(e)
255
279
  },
256
280
  {
257
281
  id: i.tableColumnCopy,
258
282
  label: "Copy column",
259
- icon: d[i.tableColumnCopy],
260
- onClick: () => Y(e)
283
+ icon: v[i.tableColumnCopy],
284
+ onClick: () => J(e)
261
285
  },
262
286
  {
263
287
  id: i.tableColumnPasteBefore,
264
288
  label: "Paste column before",
265
- icon: d[i.tableColumnPasteBefore],
289
+ icon: v[i.tableColumnPasteBefore],
266
290
  disabled: !t,
267
- onClick: () => L(e)
291
+ onClick: () => Z(e)
268
292
  },
269
293
  {
270
294
  id: i.tableColumnPasteAfter,
271
295
  label: "Paste column after",
272
- icon: d[i.tableColumnPasteAfter],
296
+ icon: v[i.tableColumnPasteAfter],
273
297
  disabled: !t,
274
- onClick: () => L({ ...e, after: !0 })
298
+ onClick: () => Z({ ...e, after: !0 })
275
299
  }
276
300
  ]
277
301
  }];
278
- }, q = "Row settings", Ae = (e) => e.every((t) => t.is(u)), C = (e) => {
279
- const { component: t } = e, o = t.is(b), l = t.is(u);
302
+ }, Q = "Row settings", Pe = (e) => e.every((t) => t.is(g)), R = (e) => {
303
+ const { component: t } = e, o = t.is(u), l = t.is(g);
280
304
  if (!(!o && !l))
281
- return l ? t : t.closestType(u);
305
+ return l ? t : t.closestType(g);
282
306
  }, N = (e) => {
283
- const { component: t, editor: o, after: l } = e, s = C(e);
307
+ const { component: t, editor: o, after: l } = e, s = R(e);
284
308
  if (!s) return;
285
- const n = s.index() + (l ? 1 : 0), c = s.components().length, a = Array.from(Array(c).keys()).map(() => ({ type: b })), r = s.parent();
286
- if (r) {
287
- const h = r.append({ type: u, components: a }, { at: n })[0];
288
- if (t.is(b) && h) {
289
- const v = t.index(), g = h.components().at(v);
290
- g && o.select(g);
309
+ const n = s.index() + (l ? 1 : 0), r = s.components().length, a = Array.from(Array(r).keys()).map(() => ({ type: u })), c = s.parent();
310
+ if (c) {
311
+ const h = c.append({ type: g, components: a }, { at: n })[0];
312
+ if (t.is(u) && h) {
313
+ const d = t.index(), b = h.components().at(d);
314
+ b && o.select(b);
291
315
  }
292
316
  }
293
- }, Q = (e) => {
294
- var t;
295
- (t = C(e)) == null || t.remove(e.opts);
296
317
  }, ee = (e) => {
297
- const t = C(e);
318
+ var t;
319
+ (t = R(e)) == null || t.remove(e.opts);
320
+ }, te = (e) => {
321
+ const t = R(e);
298
322
  t && e.editor.em.set(k, [t]);
299
- }, Z = (e) => {
323
+ }, F = (e) => {
300
324
  var a;
301
- const { editor: t, after: o } = e, l = C(e);
302
- if (!l || !te(e)) return;
303
- const n = V(t)[0], c = l.index() + (o ? 1 : 0);
304
- n && ((a = l.parent()) == null || a.append(n.clone(), { at: c }));
325
+ const { editor: t, after: o } = e, l = R(e);
326
+ if (!l || !le(e)) return;
327
+ const n = A(t)[0], r = l.index() + (o ? 1 : 0);
328
+ n && ((a = l.parent()) == null || a.append(n.clone(), { at: r }));
329
+ }, Ae = (e) => {
330
+ R(e) && (te(e), ee({ ...e, opts: { temporary: !0 } }));
331
+ }, le = ({ editor: e }) => {
332
+ const t = A(e);
333
+ return t.length && Pe(t);
305
334
  }, Be = (e) => {
306
- C(e) && (ee(e), Q({ ...e, opts: { temporary: !0 } }));
307
- }, te = ({ editor: e }) => {
308
- const t = V(e);
309
- return t.length && Ae(t);
310
- }, ke = (e) => {
311
- const t = C(e);
312
- t && (e.editor.select(t), x(e, {
335
+ const t = R(e);
336
+ t && (e.editor.select(t), M(e, {
313
337
  id: "tableRowSettings",
314
- header: { label: q }
338
+ header: { label: Q }
315
339
  }));
316
- }, le = (e) => {
317
- const t = te(e);
340
+ }, oe = (e) => {
341
+ const t = le(e);
318
342
  return [{
319
343
  id: i.tableRowItems,
320
- icon: d[i.tableRowProperties],
344
+ icon: v[i.tableRowProperties],
321
345
  label: "Row",
322
346
  items: [
323
347
  {
324
348
  id: i.tableRowInsertBefore,
325
349
  label: "Insert row before",
326
- icon: d[i.tableRowInsertBefore],
350
+ icon: v[i.tableRowInsertBefore],
327
351
  onClick: () => N(e)
328
352
  },
329
353
  {
330
354
  id: i.tableRowInsertAfter,
331
355
  label: "Insert row after",
332
- icon: d[i.tableRowInsertAfter],
356
+ icon: v[i.tableRowInsertAfter],
333
357
  onClick: () => N({ ...e, after: !0 })
334
358
  },
335
359
  {
336
360
  id: i.tableRowDelete,
337
361
  label: "Delete row",
338
- icon: d[i.tableRowDelete],
339
- onClick: () => Q(e)
362
+ icon: v[i.tableRowDelete],
363
+ onClick: () => ee(e)
340
364
  },
341
365
  {
342
366
  id: i.tableRowProperties,
343
- label: q,
344
- icon: d[i.tableRowProperties],
345
- onClick: ({ event: l }) => ke({
367
+ label: Q,
368
+ icon: v[i.tableRowProperties],
369
+ onClick: ({ event: l }) => Be({
346
370
  ...e,
347
371
  // @ts-expect-error workaround for the build
348
372
  event: l
@@ -351,96 +375,96 @@ const d = {
351
375
  {
352
376
  id: i.tableRowCut,
353
377
  label: "Cut row",
354
- icon: d[i.tableRowCut],
355
- onClick: () => Be(e)
378
+ icon: v[i.tableRowCut],
379
+ onClick: () => Ae(e)
356
380
  },
357
381
  {
358
382
  id: i.tableRowCopy,
359
383
  label: "Copy row",
360
- icon: d[i.tableRowCopy],
361
- onClick: () => ee(e)
384
+ icon: v[i.tableRowCopy],
385
+ onClick: () => te(e)
362
386
  },
363
387
  {
364
388
  id: i.tableRowPasteBefore,
365
389
  label: "Paste row before",
366
- icon: d[i.tableRowPasteBefore],
390
+ icon: v[i.tableRowPasteBefore],
367
391
  disabled: !t,
368
- onClick: () => Z(e)
392
+ onClick: () => F(e)
369
393
  },
370
394
  {
371
395
  id: i.tableRowPasteAfter,
372
396
  label: "Paste row after",
373
- icon: d[i.tableRowPasteAfter],
397
+ icon: v[i.tableRowPasteAfter],
374
398
  disabled: !t,
375
- onClick: () => Z({ ...e, after: !0 })
399
+ onClick: () => F({ ...e, after: !0 })
376
400
  }
377
401
  ]
378
- }, ...K(e)];
379
- }, I = (e) => {
402
+ }, ...q(e)];
403
+ }, T = (e) => {
380
404
  const t = e.attributes.attributes || {}, o = parseInt(`${t.rowspan || 1}`, 10), l = parseInt(`${t.colspan || 1}`, 10);
381
405
  return { rowspan: o, colspan: l };
382
406
  };
383
- function oe(e) {
407
+ function ne(e) {
384
408
  const t = [];
385
409
  return e.components().forEach((o, l) => {
386
410
  o.components().each((s, n) => {
387
- const { rowspan: c, colspan: a } = I(s);
411
+ const { rowspan: r, colspan: a } = T(s);
388
412
  if (t[l])
389
413
  for (; t[l][n]; )
390
414
  n++;
391
- for (let r = l; r < l + c; r++) {
392
- t[r] || (t[r] = []);
415
+ for (let c = l; c < l + r; c++) {
416
+ t[c] || (t[c] = []);
393
417
  for (let h = n; h < n + a; h++)
394
- t[r][h] = {
395
- real: r === l && h === n,
418
+ t[c][h] = {
419
+ real: c === l && h === n,
396
420
  cell: s,
397
- rowspan: c,
421
+ rowspan: r,
398
422
  colspan: a
399
423
  };
400
424
  }
401
425
  });
402
426
  }), t;
403
427
  }
404
- function w(e, t, o) {
428
+ function C(e, t, o) {
405
429
  var l;
406
430
  return (l = e[o]) == null ? void 0 : l[t];
407
431
  }
408
- const A = (e) => e.closestType(u);
432
+ const I = (e) => e.closestType(g);
409
433
  function xe(e, { x: t, y: o, rows: l, cols: s }) {
410
434
  var a;
411
- let n = A(e[o][t].cell), c;
412
- for (let r = 1; r <= l; r++)
435
+ let n = I(e[o][t].cell), r;
436
+ for (let c = 1; c <= l; c++)
413
437
  if (n = (a = n == null ? void 0 : n.parent()) == null ? void 0 : a.components().at(n.index() + 1), n) {
414
- for (c = t; c >= 0; c--) {
415
- const { cell: h } = e[o + r][c], v = A(h);
416
- if (v === n) {
417
- for (let g = 1; g <= s; g++) {
438
+ for (r = t; r >= 0; r--) {
439
+ const { cell: h } = e[o + c][r], d = I(h);
440
+ if (d === n) {
441
+ for (let b = 1; b <= s; b++) {
418
442
  const f = h.index();
419
- v.append({ type: b }, { at: f + 1 });
443
+ d.append({ type: u }, { at: f + 1 });
420
444
  }
421
445
  break;
422
446
  }
423
447
  }
424
- if (c === -1) {
425
- const v = n.components().at(0).index();
426
- for (let g = 1; g <= s; g++)
427
- n.append({ type: b }, { at: v });
448
+ if (r === -1) {
449
+ const d = n.components().at(0).index();
450
+ for (let b = 1; b <= s; b++)
451
+ n.append({ type: u }, { at: d });
428
452
  }
429
453
  }
430
454
  }
431
- function ne(e) {
455
+ function se(e) {
432
456
  for (let t = 0; t < e.length; t++)
433
457
  for (let o = 0; o < e[t].length; o++) {
434
458
  const s = e[t][o].cell;
435
459
  if (s.em.selected.hasComponent(s)) {
436
- const { rowspan: n, colspan: c } = I(s);
437
- if (c > 1 || n > 1) {
460
+ const { rowspan: n, colspan: r } = T(s);
461
+ if (r > 1 || n > 1) {
438
462
  s.addAttributes({ colspan: 1, rowspan: 1 });
439
- for (let a = 0; a < c - 1; a++) {
440
- const r = s.index();
441
- A(s).append({ type: b }, { at: r + 1 });
463
+ for (let a = 0; a < r - 1; a++) {
464
+ const c = s.index();
465
+ I(s).append({ type: u }, { at: c + 1 });
442
466
  }
443
- xe(e, { x: o, y: t, rows: n - 1, cols: c });
467
+ xe(e, { x: o, y: t, rows: n - 1, cols: r });
444
468
  }
445
469
  }
446
470
  }
@@ -451,16 +475,16 @@ function Ie(e) {
451
475
  o.components().length || t.push(o);
452
476
  }), t.forEach((o) => o.remove());
453
477
  }
454
- const R = (e, t = {}) => {
455
- var c;
456
- const o = oe(e), { em: l } = e;
478
+ const B = (e, t = {}) => {
479
+ var r;
480
+ const o = ne(e), { em: l } = e;
457
481
  let s, n;
458
482
  for (let a = 0; a < o.length; a++)
459
- for (let r = 0; r < o[a].length; r++) {
460
- const h = o[a][r];
461
- if ((c = t.selected) != null && c.includes(h.cell) || l.selected.hasComponent(h.cell)) {
462
- const v = { x: r, y: a };
463
- s || (s = v), n = v;
483
+ for (let c = 0; c < o[a].length; c++) {
484
+ const h = o[a][c];
485
+ if ((r = t.selected) != null && r.includes(h.cell) || l.selected.hasComponent(h.cell)) {
486
+ const d = { x: c, y: a };
487
+ s || (s = d), n = d;
464
488
  }
465
489
  }
466
490
  return {
@@ -469,76 +493,76 @@ const R = (e, t = {}) => {
469
493
  endPos: n
470
494
  };
471
495
  };
472
- function Me(e, t = {}) {
473
- const o = R(e), { startPos: l, endPos: s } = o;
496
+ function ke(e, t = {}) {
497
+ const o = B(e), { startPos: l, endPos: s } = o;
474
498
  let { grid: n } = o;
475
- const { em: c } = e;
499
+ const { em: r } = e;
476
500
  if (!l || !s)
477
501
  return;
478
- const a = l.x, r = l.y, h = s.x, v = s.y, g = w(n, a, r), f = w(n, h, v);
479
- if (g && f) {
480
- ne(n), n = oe(e);
481
- const M = [], H = w(n, a, r).cell;
482
- H.addAttributes({
502
+ const a = l.x, c = l.y, h = s.x, d = s.y, b = C(n, a, c), f = C(n, h, d);
503
+ if (b && f) {
504
+ se(n), n = ne(e);
505
+ const w = [], V = C(n, a, c).cell;
506
+ V.addAttributes({
483
507
  colspan: h - a + 1,
484
- rowspan: v - r + 1
508
+ rowspan: d - c + 1
485
509
  });
486
- for (let m = r; m <= v; m++)
510
+ for (let m = c; m <= d; m++)
487
511
  for (let z = a; z <= h; z++) {
488
- const S = w(n, z, m);
489
- if (!S) continue;
490
- const { cell: D } = S;
491
- D !== H && M.push(D);
512
+ const P = C(n, z, m);
513
+ if (!P) continue;
514
+ const { cell: S } = P;
515
+ S !== V && w.push(S);
492
516
  }
493
- M.forEach((m) => {
494
- t.mergeContent && H.append(m.components().models), m.remove();
495
- }), c.setSelected(H), Ie(e);
517
+ w.forEach((m) => {
518
+ t.mergeContent && V.append(m.components().models), m.remove();
519
+ }), r.setSelected(V), Ie(e);
496
520
  }
497
521
  }
498
- const se = "Cell settings", Se = "Merge cells", De = "Split cell", Te = (e) => e.closestType(u), y = (e) => {
522
+ const ae = "Cell settings", Me = "Merge cells", Te = "Split cell", Se = (e) => e.closestType(g), H = (e) => {
499
523
  var t;
500
- return (t = Te(e)) == null ? void 0 : t.parent();
501
- }, Ee = (e) => {
502
- const t = e.editor.getSelectedAll(), o = y(t[0]), l = t[0];
503
- if (!o || !(l != null && l.is(b)) || t.length > 1)
524
+ return (t = Se(e)) == null ? void 0 : t.parent();
525
+ }, De = (e) => {
526
+ const t = e.editor.getSelectedAll(), o = H(t[0]), l = t[0];
527
+ if (!o || !(l != null && l.is(u)) || t.length > 1)
504
528
  return !1;
505
- const { rowspan: s, colspan: n } = I(l);
529
+ const { rowspan: s, colspan: n } = T(l);
506
530
  return !(n < 2 && s < 2);
507
531
  }, Le = (e) => {
508
- const o = e.editor.getSelectedAll()[0], l = y(o), { grid: s } = R(l);
509
- ne(s);
510
- }, ae = (e) => {
511
- const t = e.editor.getSelectedAll(), o = y(t[0]);
512
- if (!o || t.length < 2 || t.some((a) => !a.is(b) || y(a) !== o))
532
+ const o = e.editor.getSelectedAll()[0], l = H(o), { grid: s } = B(l);
533
+ se(s);
534
+ }, ce = (e) => {
535
+ const t = e.editor.getSelectedAll(), o = H(t[0]);
536
+ if (!o || t.length < 2 || t.some((a) => !a.is(u) || H(a) !== o))
513
537
  return !1;
514
- const { grid: l, startPos: s, endPos: n } = R(o), { em: c } = o;
538
+ const { grid: l, startPos: s, endPos: n } = B(o), { em: r } = o;
515
539
  if (!s || !n) return !1;
516
540
  for (let a = s.y; a <= n.y; a++)
517
- for (let r = s.x; r <= n.x; r++) {
518
- const h = w(l, r, a);
519
- if (!h || !c.selected.hasComponent(h.cell))
541
+ for (let c = s.x; c <= n.x; c++) {
542
+ const h = C(l, c, a);
543
+ if (!h || !r.selected.hasComponent(h.cell))
520
544
  return !1;
521
545
  }
522
546
  return !0;
523
- }, Ne = (e) => {
547
+ }, Ee = (e) => {
524
548
  const { editor: t } = e;
525
- if (!ae(e)) return;
526
- const o = t.getSelectedAll(), l = y(o[0]);
527
- Me(l, { mergeContent: !0 });
549
+ if (!ce(e)) return;
550
+ const o = t.getSelectedAll(), l = H(o[0]);
551
+ ke(l, { mergeContent: !0 });
528
552
  }, Ze = (e) => {
529
- x(e, {
553
+ M(e, {
530
554
  id: "tableCellSettings",
531
- header: { label: se }
555
+ header: { label: ae }
532
556
  });
533
- }, Oe = (e) => [{
557
+ }, Ne = (e) => [{
534
558
  id: i.tableCellItems,
535
- icon: d[i.tableCellProperties],
559
+ icon: v[i.tableCellProperties],
536
560
  label: "Cell",
537
561
  items: [
538
562
  {
539
563
  id: i.tableCellProperties,
540
- label: se,
541
- icon: d[i.tableCellProperties],
564
+ label: ae,
565
+ icon: v[i.tableCellProperties],
542
566
  onClick: ({ event: o }) => Ze({
543
567
  ...e,
544
568
  // @ts-expect-error workaround for the build
@@ -547,32 +571,32 @@ const se = "Cell settings", Se = "Merge cells", De = "Split cell", Te = (e) => e
547
571
  },
548
572
  {
549
573
  id: i.tableCellMerge,
550
- label: Se,
551
- icon: d[i.tableCellMerge],
552
- onClick: () => Ne(e),
553
- disabled: !ae(e)
574
+ label: Me,
575
+ icon: v[i.tableCellMerge],
576
+ onClick: () => Ee(e),
577
+ disabled: !ce(e)
554
578
  },
555
579
  {
556
580
  id: i.tableCellSplit,
557
- label: De,
558
- icon: d[i.tableCellSplit],
581
+ label: Te,
582
+ icon: v[i.tableCellSplit],
559
583
  onClick: () => Le(e),
560
- disabled: !Ee(e)
584
+ disabled: !De(e)
561
585
  }
562
586
  ]
563
- }, ...Pe(e), ...le(e)], _e = (e) => {
564
- const t = e[0] && y(e[0]);
587
+ }, ...ze(e), ...oe(e)], Fe = (e) => {
588
+ const t = e[0] && H(e[0]);
565
589
  if (!t) return;
566
- const { grid: o, startPos: l, endPos: s } = R(t, { selected: e });
590
+ const { grid: o, startPos: l, endPos: s } = B(t, { selected: e });
567
591
  if (!l || !s) return;
568
592
  const n = [];
569
- for (let c = l.y; c <= s.y; c++)
593
+ for (let r = l.y; r <= s.y; r++)
570
594
  for (let a = l.x; a <= s.x; a++) {
571
- const r = w(o, a, c);
572
- r && n.push(r.cell);
595
+ const c = C(o, a, r);
596
+ c && n.push(c.cell);
573
597
  }
574
598
  n.length && t.em.setSelected(n, { fromCell: !0 });
575
- }, Fe = "tableComponent", We = function(e, t = {}) {
599
+ }, $e = "tableComponent", Oe = function(e, t = {}) {
576
600
  const o = {
577
601
  block: {},
578
602
  ...t
@@ -597,7 +621,7 @@ const se = "Cell settings", Se = "Merge cells", De = "Split cell", Te = (e) => e
597
621
  l.addType(p, {
598
622
  block: o.block && {
599
623
  label: "Table",
600
- media: d.table,
624
+ media: v.table,
601
625
  category: "Extra",
602
626
  content: {
603
627
  type: p,
@@ -610,7 +634,7 @@ const se = "Cell settings", Se = "Merge cells", De = "Split cell", Te = (e) => e
610
634
  defaults: {
611
635
  emptyState: !0,
612
636
  highlightable: !1,
613
- icon: d.table,
637
+ icon: v.table,
614
638
  stylable: [
615
639
  "width",
616
640
  "height",
@@ -644,65 +668,65 @@ const se = "Cell settings", Se = "Merge cells", De = "Split cell", Te = (e) => e
644
668
  id: "tableCaption",
645
669
  type: "checkbox",
646
670
  label: "Caption",
647
- setValue({ component: c, value: a, emitUpdate: r }) {
648
- const h = c.find("caption")[0];
649
- a ? !h && c.append({
671
+ setValue({ component: r, value: a, emitUpdate: c }) {
672
+ const h = r.find("caption")[0];
673
+ a ? !h && r.append({
650
674
  type: "text",
651
675
  tagName: "caption",
652
676
  components: { type: "textnode", content: "Caption" }
653
- }) : h == null || h.remove(), r(), e.refresh({ tools: !0 });
677
+ }) : h == null || h.remove(), c(), e.refresh({ tools: !0 });
654
678
  },
655
- getValue(c) {
656
- return !!c.component.find("caption")[0];
679
+ getValue(r) {
680
+ return !!r.component.find("caption")[0];
657
681
  }
658
682
  }
659
683
  ],
660
- components: He(P, { rows: 5 }),
661
- contextMenu: ({ items: c, editor: a, component: r }) => [
662
- ...K({ editor: a, component: r, opts: o }),
663
- ...c
684
+ components: Ce(x, { rows: 5 }),
685
+ contextMenu: ({ items: r, editor: a, component: c }) => [
686
+ ...q({ editor: a, component: c, opts: o }),
687
+ ...r
664
688
  ]
665
689
  }
666
690
  }
667
691
  }), l.addType(G, {
668
692
  model: {
669
693
  defaults: {
670
- icon: d.tableHead,
694
+ icon: v.tableHead,
671
695
  ...s
672
696
  }
673
697
  }
674
- }), l.addType($, {
698
+ }), l.addType(_, {
675
699
  model: {
676
700
  defaults: {
677
- icon: d.tableFoot,
701
+ icon: v.tableFoot,
678
702
  ...s
679
703
  }
680
704
  }
681
- }), l.addType(P, {
705
+ }), l.addType(x, {
682
706
  model: {
683
707
  defaults: {
684
- icon: d.tableRowProperties,
708
+ icon: v.tableRowProperties,
685
709
  ...s
686
710
  }
687
711
  }
688
- }), l.addType(u, {
712
+ }), l.addType(g, {
689
713
  model: {
690
714
  defaults: {
691
- icon: d.tableRowProperties,
715
+ icon: v.tableRowProperties,
692
716
  emptyState: !0,
693
717
  highlightable: !1,
694
718
  stylable: ["height", "text-align", "border-width", "border-style", "border-color"],
695
719
  traits: [],
696
- contextMenu: ({ items: c, editor: a, component: r }) => [
697
- ...le({ editor: a, component: r, opts: o }),
698
- ...c
720
+ contextMenu: ({ items: r, editor: a, component: c }) => [
721
+ ...oe({ editor: a, component: c, opts: o }),
722
+ ...r
699
723
  ]
700
724
  }
701
725
  }
702
- }), l.addType(b, {
726
+ }), l.addType(u, {
703
727
  model: {
704
728
  defaults: {
705
- icon: d.tableCellProperties,
729
+ icon: v.tableCellProperties,
706
730
  emptyState: {
707
731
  styleOut: "height: 1px"
708
732
  },
@@ -743,29 +767,30 @@ const se = "Cell settings", Se = "Merge cells", De = "Split cell", Te = (e) => e
743
767
  name: "scope"
744
768
  }
745
769
  ],
746
- contextMenu: ({ items: c, editor: a, component: r }) => [
747
- ...Oe({ editor: a, component: r, opts: o }),
748
- ...c
770
+ contextMenu: ({ items: r, editor: a, component: c }) => [
771
+ ...Ne({ editor: a, component: c, opts: o }),
772
+ ...r
749
773
  ]
750
774
  }
751
775
  }
752
776
  });
753
- const n = ce((c, a) => {
754
- var g;
755
- const r = e.getSelectedAll(), h = !!((g = a == null ? void 0 : a.event) != null && g.shiftKey);
756
- if (r.length < 2 || !h || a.fromCell) return;
757
- const v = r.map((f) => f.is(b) ? f : f.closestType(b)).filter(Boolean);
758
- v.length === r.length && _e(v);
777
+ const n = re((r, a) => {
778
+ var b;
779
+ const c = e.getSelectedAll(), h = !!((b = a == null ? void 0 : a.event) != null && b.shiftKey);
780
+ if (c.length < 2 || !h || a.fromCell) return;
781
+ const d = c.map((f) => f.is(u) ? f : f.closestType(u)).filter(Boolean);
782
+ d.length === c.length && Fe(d);
759
783
  }, 0);
760
- e.on("component:select", n), me({
784
+ e.on("component:select", n), fe({
761
785
  editor: e,
786
+ plan: y.free,
762
787
  licenseKey: o.licenseKey,
763
- pluginName: Fe,
788
+ pluginName: $e,
764
789
  cleanup: () => {
765
- e.off("component:select", n), e.Blocks.remove(p), ye.forEach((c) => l.removeType(c));
790
+ e.off("component:select", n), e.Blocks.remove(p), we.forEach((r) => l.removeType(r));
766
791
  }
767
792
  });
768
- }, Ge = fe(We);
793
+ }, We = pe(Oe);
769
794
  export {
770
- Ge as default
795
+ We as default
771
796
  };