@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.
- package/dist/api.d.ts +3 -1
- package/dist/dialogComponent/index.cjs.js +15 -15
- package/dist/dialogComponent/index.es.js +136 -111
- package/dist/dialogComponent/index.umd.js +15 -15
- package/dist/fsLightboxComponent/index.cjs.js +3 -3
- package/dist/fsLightboxComponent/index.es.js +168 -143
- package/dist/fsLightboxComponent/index.umd.js +3 -3
- package/dist/index.cjs.js +14 -14
- package/dist/index.es.js +1886 -1856
- package/dist/index.umd.js +14 -14
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +245 -220
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/lightGalleryComponent/types.d.ts +3 -3
- package/dist/listPagesComponent/index.cjs.js +5 -5
- package/dist/listPagesComponent/index.es.js +136 -111
- package/dist/listPagesComponent/index.umd.js +5 -5
- package/dist/prosemirror/index.cjs.js +9 -9
- package/dist/prosemirror/index.es.js +1267 -1242
- package/dist/prosemirror/index.umd.js +8 -8
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +315 -290
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/utils.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
function
|
|
2
|
-
let l, s, n,
|
|
3
|
-
const
|
|
1
|
+
function re(e, t, o) {
|
|
2
|
+
let l, s, n, r, a;
|
|
3
|
+
const c = t;
|
|
4
4
|
function h() {
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
|
9
|
-
return n = this, s = arguments,
|
|
8
|
+
const d = function() {
|
|
9
|
+
return n = this, s = arguments, r = Date.now(), l || (l = setTimeout(h, c)), a;
|
|
10
10
|
};
|
|
11
|
-
return
|
|
11
|
+
return d.clear = function() {
|
|
12
12
|
l && (clearTimeout(l), l = null);
|
|
13
|
-
},
|
|
13
|
+
}, d.flush = function() {
|
|
14
14
|
l && (a = e.apply(n, s), n = s = null, clearTimeout(l), l = null);
|
|
15
|
-
},
|
|
15
|
+
}, d;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
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
|
-
],
|
|
29
|
-
const e =
|
|
30
|
-
return !!e && (
|
|
31
|
-
}
|
|
32
|
-
function
|
|
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
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
baseApiUrl: t,
|
|
39
|
+
method: o = "GET",
|
|
40
|
+
headers: l = {},
|
|
41
|
+
params: s,
|
|
42
|
+
body: n
|
|
42
43
|
}) {
|
|
43
|
-
const
|
|
44
|
-
method:
|
|
44
|
+
const a = `${t || ve({ isDev: !1, isStage: !1 })}${e}`, c = {
|
|
45
|
+
method: o,
|
|
45
46
|
headers: {
|
|
46
47
|
"Content-Type": "application/json",
|
|
47
|
-
...
|
|
48
|
+
...l
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
53
|
-
throw new Error(`HTTP error! status: ${
|
|
54
|
-
return
|
|
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
|
-
|
|
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
|
|
61
|
-
async function
|
|
67
|
+
const pe = (e) => /* @__PURE__ */ ge(e);
|
|
68
|
+
async function fe({
|
|
62
69
|
editor: e,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
plan: t,
|
|
71
|
+
pluginName: o,
|
|
72
|
+
licenseKey: l,
|
|
73
|
+
cleanup: s
|
|
66
74
|
}) {
|
|
67
|
-
let
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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 (!
|
|
75
|
-
if (
|
|
76
|
-
|
|
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
|
|
103
|
+
async function me(e) {
|
|
104
|
+
const { licenseKey: t, pluginName: o, baseApiUrl: l } = e;
|
|
81
105
|
try {
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
return (await ue({
|
|
107
|
+
baseApiUrl: l,
|
|
108
|
+
path: `/sdk/${t || "na"}`,
|
|
84
109
|
method: "POST",
|
|
85
|
-
|
|
110
|
+
params: {
|
|
86
111
|
d: window.location.hostname,
|
|
87
|
-
pn:
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
|
|
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
|
|
96
|
-
const
|
|
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",
|
|
125
|
-
const { editor: o, event: l, opts: s } = e, n = l.currentTarget || l.target, { x:
|
|
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:
|
|
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
|
-
|
|
147
|
-
},
|
|
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:
|
|
178
|
+
type: g,
|
|
155
179
|
components: Array.from(Array(o).keys()).map((n) => ({
|
|
156
|
-
type:
|
|
157
|
-
components: l ? { type: "text", content:
|
|
180
|
+
type: u,
|
|
181
|
+
components: l ? { type: "text", content: W(l) ? l({ y: s, x: n }) : l } : void 0
|
|
158
182
|
}))
|
|
159
183
|
}))
|
|
160
|
-
}),
|
|
184
|
+
}), K = "Table settings", j = (e) => {
|
|
161
185
|
const { component: t } = e;
|
|
162
186
|
return t.is(p) ? t : t.closestType(p);
|
|
163
|
-
},
|
|
187
|
+
}, He = (e) => {
|
|
164
188
|
var t;
|
|
165
|
-
(t =
|
|
189
|
+
(t = j(e)) == null || t.remove(e.opts);
|
|
166
190
|
}, Re = (e) => {
|
|
167
|
-
const t =
|
|
168
|
-
t && (e.editor.select(t),
|
|
191
|
+
const t = j(e);
|
|
192
|
+
t && (e.editor.select(t), M(e, {
|
|
169
193
|
id: "tableSettings",
|
|
170
|
-
header: { label:
|
|
194
|
+
header: { label: K }
|
|
171
195
|
}));
|
|
172
|
-
},
|
|
196
|
+
}, q = (e) => [{
|
|
173
197
|
id: i.table,
|
|
174
|
-
icon:
|
|
198
|
+
icon: v[i.table],
|
|
175
199
|
label: "Table",
|
|
176
200
|
items: [
|
|
177
201
|
{
|
|
178
202
|
id: i.tableSettings,
|
|
179
|
-
label:
|
|
180
|
-
icon:
|
|
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:
|
|
191
|
-
onClick: () =>
|
|
214
|
+
icon: v[i.tableDelete],
|
|
215
|
+
onClick: () => He(e)
|
|
192
216
|
}
|
|
193
217
|
]
|
|
194
|
-
}],
|
|
195
|
-
const t =
|
|
196
|
-
return t.length &&
|
|
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(
|
|
199
|
-
const l = e.closestType(p), s = e.closestType(
|
|
200
|
-
l == null || l.findType(
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
if (!e.is(
|
|
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(
|
|
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
|
-
},
|
|
211
|
-
if (!e.is(
|
|
212
|
-
const o = e.closestType(p), l = e.index(), s = (o == null ? void 0 : o.findType(
|
|
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
|
-
},
|
|
238
|
+
}, Z = (e) => {
|
|
215
239
|
const { component: t, editor: o, after: l } = e;
|
|
216
|
-
if (!t.is(
|
|
217
|
-
const s =
|
|
218
|
-
n == null || n.findType(
|
|
219
|
-
const h = s[
|
|
220
|
-
a.append(
|
|
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
|
-
},
|
|
246
|
+
}, Ve = (e) => {
|
|
223
247
|
const { component: t } = e;
|
|
224
|
-
t.is(
|
|
225
|
-
},
|
|
226
|
-
const t =
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
248
|
-
onClick: () =>
|
|
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:
|
|
254
|
-
onClick: () =>
|
|
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:
|
|
260
|
-
onClick: () =>
|
|
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:
|
|
289
|
+
icon: v[i.tableColumnPasteBefore],
|
|
266
290
|
disabled: !t,
|
|
267
|
-
onClick: () =>
|
|
291
|
+
onClick: () => Z(e)
|
|
268
292
|
},
|
|
269
293
|
{
|
|
270
294
|
id: i.tableColumnPasteAfter,
|
|
271
295
|
label: "Paste column after",
|
|
272
|
-
icon:
|
|
296
|
+
icon: v[i.tableColumnPasteAfter],
|
|
273
297
|
disabled: !t,
|
|
274
|
-
onClick: () =>
|
|
298
|
+
onClick: () => Z({ ...e, after: !0 })
|
|
275
299
|
}
|
|
276
300
|
]
|
|
277
301
|
}];
|
|
278
|
-
},
|
|
279
|
-
const { component: t } = e, o = t.is(
|
|
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(
|
|
305
|
+
return l ? t : t.closestType(g);
|
|
282
306
|
}, N = (e) => {
|
|
283
|
-
const { component: t, editor: o, after: l } = e, s =
|
|
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),
|
|
286
|
-
if (
|
|
287
|
-
const h =
|
|
288
|
-
if (t.is(
|
|
289
|
-
const
|
|
290
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
323
|
+
}, F = (e) => {
|
|
300
324
|
var a;
|
|
301
|
-
const { editor: t, after: o } = e, l =
|
|
302
|
-
if (!l || !
|
|
303
|
-
const n =
|
|
304
|
-
n && ((a = l.parent()) == null || a.append(n.clone(), { at:
|
|
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
|
-
|
|
307
|
-
|
|
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:
|
|
338
|
+
header: { label: Q }
|
|
315
339
|
}));
|
|
316
|
-
},
|
|
317
|
-
const t =
|
|
340
|
+
}, oe = (e) => {
|
|
341
|
+
const t = le(e);
|
|
318
342
|
return [{
|
|
319
343
|
id: i.tableRowItems,
|
|
320
|
-
icon:
|
|
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:
|
|
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:
|
|
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:
|
|
339
|
-
onClick: () =>
|
|
362
|
+
icon: v[i.tableRowDelete],
|
|
363
|
+
onClick: () => ee(e)
|
|
340
364
|
},
|
|
341
365
|
{
|
|
342
366
|
id: i.tableRowProperties,
|
|
343
|
-
label:
|
|
344
|
-
icon:
|
|
345
|
-
onClick: ({ event: l }) =>
|
|
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:
|
|
355
|
-
onClick: () =>
|
|
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:
|
|
361
|
-
onClick: () =>
|
|
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:
|
|
390
|
+
icon: v[i.tableRowPasteBefore],
|
|
367
391
|
disabled: !t,
|
|
368
|
-
onClick: () =>
|
|
392
|
+
onClick: () => F(e)
|
|
369
393
|
},
|
|
370
394
|
{
|
|
371
395
|
id: i.tableRowPasteAfter,
|
|
372
396
|
label: "Paste row after",
|
|
373
|
-
icon:
|
|
397
|
+
icon: v[i.tableRowPasteAfter],
|
|
374
398
|
disabled: !t,
|
|
375
|
-
onClick: () =>
|
|
399
|
+
onClick: () => F({ ...e, after: !0 })
|
|
376
400
|
}
|
|
377
401
|
]
|
|
378
|
-
}, ...
|
|
379
|
-
},
|
|
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
|
|
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:
|
|
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
|
|
392
|
-
t[
|
|
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[
|
|
395
|
-
real:
|
|
418
|
+
t[c][h] = {
|
|
419
|
+
real: c === l && h === n,
|
|
396
420
|
cell: s,
|
|
397
|
-
rowspan:
|
|
421
|
+
rowspan: r,
|
|
398
422
|
colspan: a
|
|
399
423
|
};
|
|
400
424
|
}
|
|
401
425
|
});
|
|
402
426
|
}), t;
|
|
403
427
|
}
|
|
404
|
-
function
|
|
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
|
|
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 =
|
|
412
|
-
for (let
|
|
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 (
|
|
415
|
-
const { cell: h } = e[o +
|
|
416
|
-
if (
|
|
417
|
-
for (let
|
|
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
|
-
|
|
443
|
+
d.append({ type: u }, { at: f + 1 });
|
|
420
444
|
}
|
|
421
445
|
break;
|
|
422
446
|
}
|
|
423
447
|
}
|
|
424
|
-
if (
|
|
425
|
-
const
|
|
426
|
-
for (let
|
|
427
|
-
n.append({ type:
|
|
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
|
|
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:
|
|
437
|
-
if (
|
|
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 <
|
|
440
|
-
const
|
|
441
|
-
|
|
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:
|
|
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
|
|
455
|
-
var
|
|
456
|
-
const o =
|
|
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
|
|
460
|
-
const h = o[a][
|
|
461
|
-
if ((
|
|
462
|
-
const
|
|
463
|
-
s || (s =
|
|
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
|
|
473
|
-
const 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:
|
|
499
|
+
const { em: r } = e;
|
|
476
500
|
if (!l || !s)
|
|
477
501
|
return;
|
|
478
|
-
const a = l.x,
|
|
479
|
-
if (
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
|
|
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:
|
|
508
|
+
rowspan: d - c + 1
|
|
485
509
|
});
|
|
486
|
-
for (let m =
|
|
510
|
+
for (let m = c; m <= d; m++)
|
|
487
511
|
for (let z = a; z <= h; z++) {
|
|
488
|
-
const
|
|
489
|
-
if (!
|
|
490
|
-
const { cell:
|
|
491
|
-
|
|
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
|
-
|
|
494
|
-
t.mergeContent &&
|
|
495
|
-
}),
|
|
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
|
|
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 =
|
|
501
|
-
},
|
|
502
|
-
const t = e.editor.getSelectedAll(), o =
|
|
503
|
-
if (!o || !(l != null && l.is(
|
|
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 } =
|
|
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 =
|
|
509
|
-
|
|
510
|
-
},
|
|
511
|
-
const t = e.editor.getSelectedAll(), o =
|
|
512
|
-
if (!o || t.length < 2 || t.some((a) => !a.is(
|
|
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 } =
|
|
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
|
|
518
|
-
const h =
|
|
519
|
-
if (!h || !
|
|
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
|
-
},
|
|
547
|
+
}, Ee = (e) => {
|
|
524
548
|
const { editor: t } = e;
|
|
525
|
-
if (!
|
|
526
|
-
const o = t.getSelectedAll(), l =
|
|
527
|
-
|
|
549
|
+
if (!ce(e)) return;
|
|
550
|
+
const o = t.getSelectedAll(), l = H(o[0]);
|
|
551
|
+
ke(l, { mergeContent: !0 });
|
|
528
552
|
}, Ze = (e) => {
|
|
529
|
-
|
|
553
|
+
M(e, {
|
|
530
554
|
id: "tableCellSettings",
|
|
531
|
-
header: { label:
|
|
555
|
+
header: { label: ae }
|
|
532
556
|
});
|
|
533
|
-
},
|
|
557
|
+
}, Ne = (e) => [{
|
|
534
558
|
id: i.tableCellItems,
|
|
535
|
-
icon:
|
|
559
|
+
icon: v[i.tableCellProperties],
|
|
536
560
|
label: "Cell",
|
|
537
561
|
items: [
|
|
538
562
|
{
|
|
539
563
|
id: i.tableCellProperties,
|
|
540
|
-
label:
|
|
541
|
-
icon:
|
|
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:
|
|
551
|
-
icon:
|
|
552
|
-
onClick: () =>
|
|
553
|
-
disabled: !
|
|
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:
|
|
558
|
-
icon:
|
|
581
|
+
label: Te,
|
|
582
|
+
icon: v[i.tableCellSplit],
|
|
559
583
|
onClick: () => Le(e),
|
|
560
|
-
disabled: !
|
|
584
|
+
disabled: !De(e)
|
|
561
585
|
}
|
|
562
586
|
]
|
|
563
|
-
}, ...
|
|
564
|
-
const t = 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 } =
|
|
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
|
|
593
|
+
for (let r = l.y; r <= s.y; r++)
|
|
570
594
|
for (let a = l.x; a <= s.x; a++) {
|
|
571
|
-
const
|
|
572
|
-
|
|
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
|
-
},
|
|
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:
|
|
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:
|
|
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:
|
|
648
|
-
const h =
|
|
649
|
-
a ? !h &&
|
|
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(),
|
|
677
|
+
}) : h == null || h.remove(), c(), e.refresh({ tools: !0 });
|
|
654
678
|
},
|
|
655
|
-
getValue(
|
|
656
|
-
return !!
|
|
679
|
+
getValue(r) {
|
|
680
|
+
return !!r.component.find("caption")[0];
|
|
657
681
|
}
|
|
658
682
|
}
|
|
659
683
|
],
|
|
660
|
-
components:
|
|
661
|
-
contextMenu: ({ items:
|
|
662
|
-
...
|
|
663
|
-
...
|
|
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:
|
|
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:
|
|
701
|
+
icon: v.tableFoot,
|
|
678
702
|
...s
|
|
679
703
|
}
|
|
680
704
|
}
|
|
681
|
-
}), l.addType(
|
|
705
|
+
}), l.addType(x, {
|
|
682
706
|
model: {
|
|
683
707
|
defaults: {
|
|
684
|
-
icon:
|
|
708
|
+
icon: v.tableRowProperties,
|
|
685
709
|
...s
|
|
686
710
|
}
|
|
687
711
|
}
|
|
688
|
-
}), l.addType(
|
|
712
|
+
}), l.addType(g, {
|
|
689
713
|
model: {
|
|
690
714
|
defaults: {
|
|
691
|
-
icon:
|
|
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:
|
|
697
|
-
...
|
|
698
|
-
...
|
|
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(
|
|
726
|
+
}), l.addType(u, {
|
|
703
727
|
model: {
|
|
704
728
|
defaults: {
|
|
705
|
-
icon:
|
|
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:
|
|
747
|
-
...
|
|
748
|
-
...
|
|
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 =
|
|
754
|
-
var
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
const
|
|
758
|
-
|
|
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),
|
|
784
|
+
e.on("component:select", n), fe({
|
|
761
785
|
editor: e,
|
|
786
|
+
plan: y.free,
|
|
762
787
|
licenseKey: o.licenseKey,
|
|
763
|
-
pluginName:
|
|
788
|
+
pluginName: $e,
|
|
764
789
|
cleanup: () => {
|
|
765
|
-
e.off("component:select", n), e.Blocks.remove(p),
|
|
790
|
+
e.off("component:select", n), e.Blocks.remove(p), we.forEach((r) => l.removeType(r));
|
|
766
791
|
}
|
|
767
792
|
});
|
|
768
|
-
},
|
|
793
|
+
}, We = pe(Oe);
|
|
769
794
|
export {
|
|
770
|
-
|
|
795
|
+
We as default
|
|
771
796
|
};
|