@progress/kendo-react-editor 9.4.0-develop.23 → 9.4.0-develop.3
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/Editor.js +1 -1
- package/Editor.mjs +1 -0
- package/NOTICE.txt +51 -40
- package/config/defaultStyles.js +1 -1
- package/config/defaultStyles.mjs +1 -0
- package/config/shortcuts.js +1 -1
- package/config/shortcuts.mjs +9 -8
- package/config/toolsSettings.js +1 -1
- package/config/toolsSettings.mjs +1 -0
- package/dialogs/FindReplace.js +1 -1
- package/dialogs/FindReplace.mjs +1 -0
- package/dialogs/index.js +1 -1
- package/dialogs/index.mjs +1 -0
- package/dialogs/insertImage.js +1 -1
- package/dialogs/insertImage.mjs +1 -0
- package/dialogs/insertLink.js +1 -1
- package/dialogs/insertLink.mjs +11 -10
- package/dialogs/viewHtml.js +1 -1
- package/dialogs/viewHtml.mjs +6 -5
- package/dist/cdn/js/kendo-react-editor.js +1 -8
- package/index.js +1 -2
- package/index.mjs +7 -7
- package/messages/index.js +1 -1
- package/messages/index.mjs +1 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +3 -2
- package/package.json +14 -14
- package/tools/align.js +1 -1
- package/tools/align.mjs +5 -4
- package/tools/applyColor.js +1 -1
- package/tools/applyColor.mjs +6 -5
- package/tools/cleanFormatting.js +1 -1
- package/tools/cleanFormatting.mjs +9 -8
- package/tools/findReplace.js +1 -1
- package/tools/findReplace.mjs +10 -9
- package/tools/fontStyle.js +1 -1
- package/tools/fontStyle.mjs +7 -6
- package/tools/formatBlock.js +1 -1
- package/tools/formatBlock.mjs +11 -10
- package/tools/history.js +1 -1
- package/tools/history.mjs +3 -2
- package/tools/indent.js +1 -1
- package/tools/indent.mjs +1 -0
- package/tools/index.js +1 -1
- package/tools/index.mjs +1 -0
- package/tools/inlineFormat.js +1 -1
- package/tools/inlineFormat.mjs +5 -4
- package/tools/insertImage.js +1 -1
- package/tools/insertImage.mjs +5 -4
- package/tools/insertLink.js +1 -1
- package/tools/insertLink.mjs +14 -13
- package/tools/insertTable/popup.js +1 -1
- package/tools/insertTable/popup.mjs +5 -4
- package/tools/insertTable/popupGrid.js +1 -1
- package/tools/insertTable/popupGrid.mjs +1 -0
- package/tools/insertTable/tool.js +1 -1
- package/tools/insertTable/tool.mjs +1 -0
- package/tools/lists-styled.js +1 -1
- package/tools/lists-styled.mjs +1 -0
- package/tools/lists.js +1 -1
- package/tools/lists.mjs +14 -13
- package/tools/outdent.js +1 -1
- package/tools/outdent.mjs +1 -0
- package/tools/pdf.js +1 -1
- package/tools/pdf.mjs +5 -4
- package/tools/print.js +1 -1
- package/tools/print.mjs +5 -4
- package/tools/proseMirrorTool.js +1 -1
- package/tools/proseMirrorTool.mjs +9 -8
- package/tools/selectAll.js +1 -1
- package/tools/selectAll.mjs +6 -5
- package/tools/table-wizard/cellPropsUtils.js +1 -1
- package/tools/table-wizard/cellPropsUtils.mjs +35 -34
- package/tools/table-wizard/tableCellProperties.js +1 -1
- package/tools/table-wizard/tableCellProperties.mjs +1 -0
- package/tools/table-wizard/tableProperties.js +1 -1
- package/tools/table-wizard/tableProperties.mjs +45 -44
- package/tools/table-wizard/tablePropsUtils.js +1 -1
- package/tools/table-wizard/tablePropsUtils.mjs +100 -99
- package/tools/table-wizard/utils.js +1 -1
- package/tools/table-wizard/utils.mjs +18 -17
- package/tools/tableEdit.js +1 -1
- package/tools/tableEdit.mjs +3 -2
- package/tools/unlink.js +1 -1
- package/tools/unlink.mjs +9 -8
- package/tools/utils.js +1 -1
- package/tools/utils.mjs +1 -0
- package/tools/viewHtml.js +1 -1
- package/tools/viewHtml.mjs +12 -11
- package/utils/browser-detection.js +1 -1
- package/utils/browser-detection.mjs +1 -0
- package/utils/controlled-value.js +1 -1
- package/utils/controlled-value.mjs +3 -2
- package/utils/index.js +1 -1
- package/utils/index.mjs +1 -0
- package/utils/props-key.js +1 -1
- package/utils/props-key.mjs +4 -3
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import { pmDocToFragment as F, fragmentToHtml as j, TableMap as A, Selection as O, TextSelection as B, CellSelection as U, addColumnAfter as q, addRowAfter as G, parseContent as J } from "@progress/kendo-editor-common";
|
|
9
10
|
import { deleteColumnCmd as K, deleteRowCmd as L } from "../tableEdit.mjs";
|
|
10
11
|
import { selectedCells as P, parseStyle as S, nodeSize as _, tableCells as Q, setNodeStyle as h } from "./utils.mjs";
|
|
@@ -38,58 +39,58 @@ const N = {
|
|
|
38
39
|
center: { "margin-left": "auto", "margin-right": "auto" },
|
|
39
40
|
right: { "margin-left": "auto", "margin-right": "" },
|
|
40
41
|
"": {}
|
|
41
|
-
}, z = (
|
|
42
|
+
}, z = (n) => {
|
|
42
43
|
const t = [];
|
|
43
|
-
for (let s = 0; s <
|
|
44
|
-
const l = s *
|
|
45
|
-
t.push(
|
|
44
|
+
for (let s = 0; s < n.height; s++) {
|
|
45
|
+
const l = s * n.width, e = l + n.width;
|
|
46
|
+
t.push(n.map.slice(l, e));
|
|
46
47
|
}
|
|
47
48
|
return t;
|
|
48
|
-
}, V = (
|
|
49
|
+
}, V = (n, t) => {
|
|
49
50
|
let s = 0, l = 0;
|
|
50
51
|
const e = z(t);
|
|
51
|
-
e.forEach((
|
|
52
|
+
e.forEach((o) => {
|
|
52
53
|
let i = !0;
|
|
53
|
-
|
|
54
|
-
const c =
|
|
54
|
+
o.forEach((r) => {
|
|
55
|
+
const c = n.nodeAt(r);
|
|
55
56
|
c && c.type.name !== "table_header" && (i = !1);
|
|
56
57
|
}), i && s++;
|
|
57
58
|
});
|
|
58
|
-
for (let
|
|
59
|
+
for (let o = 0; o < t.width; o++) {
|
|
59
60
|
let i = !0;
|
|
60
61
|
for (let r = 0; r < t.height; r++) {
|
|
61
|
-
const c = e[r] && e[r][
|
|
62
|
+
const c = e[r] && e[r][o], u = typeof c == "number" && n.nodeAt(c);
|
|
62
63
|
u && u.type.name !== "table_header" && (i = !1);
|
|
63
64
|
}
|
|
64
65
|
i && l++;
|
|
65
66
|
}
|
|
66
67
|
return { rows: s, columns: l };
|
|
67
|
-
}, X = (
|
|
68
|
+
}, X = (n) => {
|
|
68
69
|
const t = /* @__PURE__ */ new Set();
|
|
69
|
-
return
|
|
70
|
+
return n.content.forEach((s) => {
|
|
70
71
|
s.content.forEach((l) => {
|
|
71
72
|
t.add(S(l.attrs.style).padding || "");
|
|
72
73
|
});
|
|
73
74
|
}), t.size === 1 ? Array.from(t)[0] : "";
|
|
74
|
-
}, Y = (
|
|
75
|
+
}, Y = (n) => {
|
|
75
76
|
let t = !0, s = !0;
|
|
76
|
-
return
|
|
77
|
+
return n.content.forEach((l) => {
|
|
77
78
|
l.content.forEach((e) => {
|
|
78
|
-
const
|
|
79
|
-
|
|
79
|
+
const o = e.type.name === "table_header", i = e.type.name === "table_cell";
|
|
80
|
+
o && !e.attrs.scope && (t = !1), (o && !e.attrs.id || i && !e.attrs.headers) && (s = !1);
|
|
80
81
|
});
|
|
81
82
|
}), t ? "scope" : s ? "id" : "none";
|
|
82
|
-
}, ce = (
|
|
83
|
+
}, ce = (n) => {
|
|
83
84
|
var p, a, b;
|
|
84
|
-
const t = P(
|
|
85
|
+
const t = P(n), s = n.selection.$from, l = t.length ? T(s, (f) => f.type.spec.tableRole === "table") : null;
|
|
85
86
|
if (!l)
|
|
86
87
|
return N;
|
|
87
88
|
const e = T(s, (f) => f.type.name === "table_wrapper");
|
|
88
|
-
let
|
|
89
|
+
let o = "", i = {}, r = {};
|
|
89
90
|
e && (r = S(e.node.attrs.style), e.node.content.forEach((f) => {
|
|
90
91
|
if (f.type.name === "table_caption_external") {
|
|
91
92
|
const y = F(f);
|
|
92
|
-
|
|
93
|
+
o = j(y), o = o === "<img>" ? "" : o, i = S(f.attrs.style);
|
|
93
94
|
}
|
|
94
95
|
}));
|
|
95
96
|
const c = S(((p = l.node.attrs) == null ? void 0 : p.style) || ""), u = A.get(l.node), d = r["margin-left"] === "auto" && r["margin-right"] === "auto" ? "center" : r["margin-right"] === "auto" ? "left" : r["margin-left"] === "auto" ? "right" : null, g = V(l.node, u), m = X(l.node);
|
|
@@ -109,7 +110,7 @@ const N = {
|
|
|
109
110
|
borderColor: c["border-color"],
|
|
110
111
|
borderStyle: c["border-style"] || null,
|
|
111
112
|
collapseBorders: c["border-collapse"] === "collapse",
|
|
112
|
-
caption:
|
|
113
|
+
caption: o || void 0,
|
|
113
114
|
captionAlignment: i["text-align"] || "",
|
|
114
115
|
captionPosition: i["caption-side"] || null,
|
|
115
116
|
headerRows: g.rows,
|
|
@@ -118,23 +119,23 @@ const N = {
|
|
|
118
119
|
id: ((a = l.node.attrs) == null ? void 0 : a.id) || "",
|
|
119
120
|
className: ((b = l.node.attrs) == null ? void 0 : b.class) || ""
|
|
120
121
|
};
|
|
121
|
-
}, $ = (
|
|
122
|
-
const s =
|
|
123
|
-
return { node: s, pos:
|
|
124
|
-
}, R = (
|
|
125
|
-
const
|
|
126
|
-
if (!
|
|
127
|
-
return
|
|
128
|
-
const c =
|
|
129
|
-
let g =
|
|
122
|
+
}, $ = (n) => {
|
|
123
|
+
const s = n.lastChild.lastChild;
|
|
124
|
+
return { node: s, pos: n.content.size - s.nodeSize };
|
|
125
|
+
}, R = (n, t, s, l, e) => {
|
|
126
|
+
const o = $(s), i = t + o.pos;
|
|
127
|
+
if (!n.doc.nodeAt(i))
|
|
128
|
+
return n;
|
|
129
|
+
const c = n.doc.resolve(i), u = new U(c, c), d = n.tr.setSelection(u);
|
|
130
|
+
let g = n.apply(d);
|
|
130
131
|
for (let m = 0; m < l; m++)
|
|
131
132
|
e(g, (p) => {
|
|
132
133
|
g = g.apply(p);
|
|
133
134
|
});
|
|
134
135
|
return g;
|
|
135
|
-
}, x = (
|
|
136
|
-
let e =
|
|
137
|
-
for (let
|
|
136
|
+
}, x = (n, t, s, l) => {
|
|
137
|
+
let e = n;
|
|
138
|
+
for (let o = 0; o < s; o++) {
|
|
138
139
|
const i = e.doc.nodeAt(t);
|
|
139
140
|
if (i) {
|
|
140
141
|
const r = $(i), c = t + r.pos, u = e.doc.resolve(c), d = new U(u, u), g = e.tr.setSelection(d);
|
|
@@ -144,40 +145,40 @@ const N = {
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
return e;
|
|
147
|
-
}, Z = (
|
|
148
|
-
let e =
|
|
149
|
-
if (!
|
|
148
|
+
}, Z = (n, t, s, l) => {
|
|
149
|
+
let e = n, o = e.doc.nodeAt(t);
|
|
150
|
+
if (!o)
|
|
150
151
|
return e;
|
|
151
|
-
let i = A.get(
|
|
152
|
-
return i.width === l && i.height === s || (l > i.width ? e = R(e, t,
|
|
153
|
-
}, W = (
|
|
154
|
-
const l =
|
|
152
|
+
let i = A.get(o);
|
|
153
|
+
return i.width === l && i.height === s || (l > i.width ? e = R(e, t, o, l - i.width, q) : l < i.width && (e = x(e, t, i.width - l, K)), o = e.doc.nodeAt(t), !o) || (i = A.get(o), s > i.height ? e = R(e, t, o, s - i.height, G) : s < i.height && (e = x(e, t, i.height - s, L))), e;
|
|
154
|
+
}, W = (n, t, s) => {
|
|
155
|
+
const l = n.doc.nodeAt(s);
|
|
155
156
|
if (!l)
|
|
156
|
-
return
|
|
157
|
+
return n;
|
|
157
158
|
let e = { ...l.attrs };
|
|
158
|
-
const
|
|
159
|
-
e = h(e, "width",
|
|
159
|
+
const o = t.width !== null && (t.widthUnit !== "%" || !t.caption && !t.position);
|
|
160
|
+
e = h(e, "width", o ? t.width + t.widthUnit : ""), e = h(e, "height", t.height !== null ? t.height + t.heightUnit : ""), e = h(e, "text-align", t.textAlign || ""), e = h(e, "background-color", t.backgroundColor || ""), e = h(e, "border-width", t.borderWidth ? t.borderWidth + "px" : ""), e = h(e, "border-style", t.borderStyle || ""), e = h(e, "border-color", t.borderColor || ""), e = h(e, "border-spacing", t.cellSpacing !== null ? t.cellSpacing + "px" : ""), t.cellSpacing !== null ? e = h(e, "border-collapse", "unset") : e = h(e, "border-collapse", t.collapseBorders ? "collapse" : "");
|
|
160
161
|
const i = k[t.position || ""] || {};
|
|
161
162
|
Object.keys(i).forEach((c) => {
|
|
162
163
|
e = h(e, c, i[c]);
|
|
163
164
|
}), e.id = t.id || null, e.class = t.className || null;
|
|
164
|
-
const r =
|
|
165
|
-
return
|
|
166
|
-
}, H = (
|
|
165
|
+
const r = n.tr.setNodeMarkup(s, null, e);
|
|
166
|
+
return n = n.apply(r), n;
|
|
167
|
+
}, H = (n, t, s, l, e) => {
|
|
167
168
|
if (t.type.name !== l.name || Object.keys(e).length > 0) {
|
|
168
|
-
const
|
|
169
|
-
return
|
|
169
|
+
const o = n.tr.setNodeMarkup(s, l, { ...t.attrs, ...e });
|
|
170
|
+
return n.apply(o);
|
|
170
171
|
}
|
|
171
|
-
return
|
|
172
|
-
}, I = (
|
|
173
|
-
/^cell-[0-9]+-[0-9]+$/.test(
|
|
174
|
-
}, ee = (
|
|
175
|
-
const l =
|
|
172
|
+
return n;
|
|
173
|
+
}, I = (n, t) => {
|
|
174
|
+
/^cell-[0-9]+-[0-9]+$/.test(n.attrs.id || "") && (t.id = null);
|
|
175
|
+
}, ee = (n, t, s) => {
|
|
176
|
+
const l = n.doc.nodeAt(s), e = l && A.get(l);
|
|
176
177
|
if (!l || !e)
|
|
177
|
-
return
|
|
178
|
-
const
|
|
179
|
-
let i =
|
|
180
|
-
const { table_header: r, table_cell: c } =
|
|
178
|
+
return n;
|
|
179
|
+
const o = z(e);
|
|
180
|
+
let i = n;
|
|
181
|
+
const { table_header: r, table_cell: c } = n.schema.nodes, u = String((/* @__PURE__ */ new Date()).getTime()), d = [], g = (p, a) => {
|
|
181
182
|
const b = `cell-${p}${a}-${u}`;
|
|
182
183
|
return d[p] || d.push([]), d[p][a] || d[p].push([]), d[p][a] = b, b;
|
|
183
184
|
}, m = (p, a, b, f) => {
|
|
@@ -190,7 +191,7 @@ const N = {
|
|
|
190
191
|
d[p] && d[p][w] && y.push(d[p][w]);
|
|
191
192
|
return y.join(" ");
|
|
192
193
|
};
|
|
193
|
-
return
|
|
194
|
+
return o.forEach((p, a) => {
|
|
194
195
|
p.forEach((b, f) => {
|
|
195
196
|
const y = l.nodeAt(b);
|
|
196
197
|
if (y) {
|
|
@@ -199,40 +200,40 @@ const N = {
|
|
|
199
200
|
}
|
|
200
201
|
});
|
|
201
202
|
}), i;
|
|
202
|
-
}, te = (
|
|
203
|
+
}, te = (n, t, s, l) => {
|
|
203
204
|
let e = { ...t.attrs };
|
|
204
|
-
return e = h(e, "margin-left", ""), e = h(e, "margin-right", ""), Object.keys(l || {}).forEach((
|
|
205
|
-
e = h(e,
|
|
206
|
-
}),
|
|
207
|
-
}, v = (
|
|
208
|
-
if (!
|
|
205
|
+
return e = h(e, "margin-left", ""), e = h(e, "margin-right", ""), Object.keys(l || {}).forEach((o) => {
|
|
206
|
+
e = h(e, o, (l || {})[o] || "");
|
|
207
|
+
}), n.apply(n.tr.setNodeMarkup(s, null, e));
|
|
208
|
+
}, v = (n, t) => J("<p>" + n + "</p>", t).content.firstChild.content, M = (n, t) => {
|
|
209
|
+
if (!n.caption)
|
|
209
210
|
return;
|
|
210
211
|
let s = { caption: "", style: "display: table-caption" };
|
|
211
|
-
|
|
212
|
-
const l = v(
|
|
212
|
+
n.captionAlignment && (s = h(s, "text-align", n.captionAlignment)), n.captionPosition && (s = h(s, "caption-side", n.captionPosition));
|
|
213
|
+
const l = v(n.caption, t);
|
|
213
214
|
return l && t.nodes.table_caption_external.createAndFill(s, l) || void 0;
|
|
214
|
-
}, D = (
|
|
215
|
-
let e =
|
|
215
|
+
}, D = (n) => n.firstChild && n.firstChild.type.name === "table_caption_external", ne = (n, t, s, l) => {
|
|
216
|
+
let e = n, o;
|
|
216
217
|
const i = s + 2, r = s + 1, c = e.schema;
|
|
217
218
|
if (D(t))
|
|
218
|
-
if (
|
|
219
|
+
if (o = t.firstChild, l.caption) {
|
|
219
220
|
const u = v(l.caption, c);
|
|
220
221
|
if (e = e.apply(
|
|
221
|
-
e.tr.replaceWith(i, i +
|
|
222
|
-
),
|
|
223
|
-
let d = { ...
|
|
222
|
+
e.tr.replaceWith(i, i + o.content.size, u)
|
|
223
|
+
), o = e.doc.nodeAt(r), o) {
|
|
224
|
+
let d = { ...o.attrs };
|
|
224
225
|
d = h(d, "text-align", l.captionAlignment || ""), d = h(d, "caption-side", l.captionPosition || ""), e = e.apply(e.tr.setNodeAttribute(r, "style", d.style));
|
|
225
226
|
}
|
|
226
227
|
} else
|
|
227
228
|
e = e.apply(
|
|
228
|
-
e.tr.deleteRange(i, i +
|
|
229
|
+
e.tr.deleteRange(i, i + o.content.size)
|
|
229
230
|
);
|
|
230
231
|
else
|
|
231
|
-
|
|
232
|
+
o = M(l, c), o && (e = e.apply(e.tr.replaceWith(r, r, o)));
|
|
232
233
|
return e;
|
|
233
|
-
},
|
|
234
|
-
let
|
|
235
|
-
state:
|
|
234
|
+
}, oe = (n, t, s, l, e) => {
|
|
235
|
+
let o = {
|
|
236
|
+
state: n,
|
|
236
237
|
pos: s
|
|
237
238
|
};
|
|
238
239
|
if (!l && (t.position || t.caption)) {
|
|
@@ -241,47 +242,47 @@ const N = {
|
|
|
241
242
|
d && Object.keys(d).forEach((a) => {
|
|
242
243
|
r = h(r, a, d[a] || "");
|
|
243
244
|
}), typeof t.width == "number" && t.widthUnit === "%" && (r = h(r, "width", t.width + t.widthUnit));
|
|
244
|
-
const g = M(t,
|
|
245
|
+
const g = M(t, n.schema);
|
|
245
246
|
g && c.push(g);
|
|
246
|
-
const m =
|
|
247
|
+
const m = n.doc.nodeAt(s);
|
|
247
248
|
c.push(m);
|
|
248
|
-
const p =
|
|
249
|
+
const p = n.schema.nodes.table_wrapper.createAndFill(r, c);
|
|
249
250
|
if (p) {
|
|
250
|
-
const a =
|
|
251
|
-
|
|
251
|
+
const a = n.tr.replaceWith(s, s + m.content.size, p);
|
|
252
|
+
n = n.apply(a), o = { state: n, pos: s };
|
|
252
253
|
}
|
|
253
254
|
} else
|
|
254
|
-
l && (t.position || t.caption || !t.caption && D(l.node)) ? (
|
|
255
|
-
|
|
255
|
+
l && (t.position || t.caption || !t.caption && D(l.node)) ? (n = te(
|
|
256
|
+
n,
|
|
256
257
|
l.node,
|
|
257
258
|
e,
|
|
258
259
|
t.position && k[t.position]
|
|
259
|
-
),
|
|
260
|
-
const i = l &&
|
|
260
|
+
), n = ne(n, l.node, e, t), o = { state: n, pos: e }) : l && !(t.position || t.caption) ? o = { state: n, node: l.node, pos: n.selection.$from.start(l.depth) - 1 } : o = { state: n, pos: s };
|
|
261
|
+
const i = l && o.state.doc.nodeAt(e);
|
|
261
262
|
if (i) {
|
|
262
263
|
let r;
|
|
263
|
-
typeof t.width == "number" && t.widthUnit === "%" ? r = h(i.attrs, "width", t.width + t.widthUnit) : t.widthUnit !== "%" && /%/.test(S(i.attrs.style || "").width || "") && (r = h(i.attrs, "width", "")), r && (
|
|
264
|
+
typeof t.width == "number" && t.widthUnit === "%" ? r = h(i.attrs, "width", t.width + t.widthUnit) : t.widthUnit !== "%" && /%/.test(S(i.attrs.style || "").width || "") && (r = h(i.attrs, "width", "")), r && (o.state = o.state.apply(o.state.tr.setNodeMarkup(e, null, r)));
|
|
264
265
|
}
|
|
265
|
-
return
|
|
266
|
-
}, de = (
|
|
267
|
-
const s =
|
|
266
|
+
return o;
|
|
267
|
+
}, de = (n, t) => {
|
|
268
|
+
const s = n.selection.$from, l = T(s, (f) => f.type.spec.tableRole === "table");
|
|
268
269
|
if (!l)
|
|
269
270
|
return;
|
|
270
271
|
const e = s.start(l.depth) - 1;
|
|
271
|
-
let
|
|
272
|
-
if (!
|
|
272
|
+
let o = Z(n, e, t.rows, t.columns);
|
|
273
|
+
if (!o)
|
|
273
274
|
return;
|
|
274
|
-
const i =
|
|
275
|
-
Q(
|
|
275
|
+
const i = o.tr;
|
|
276
|
+
Q(o).forEach((f) => {
|
|
276
277
|
let y = { ...f.node.attrs };
|
|
277
278
|
y = h(y, "padding", typeof t.cellPadding == "number" ? t.cellPadding + "px" : ""), i.setNodeMarkup(f.pos, null, y);
|
|
278
|
-
}),
|
|
279
|
-
const r = T(s, (f) => f.type.name === "table_wrapper"), c = s.start((r == null ? void 0 : r.depth) || 0) - 1, u =
|
|
280
|
-
|
|
281
|
-
const d = u.pos, g =
|
|
279
|
+
}), o = o.apply(i), o = W(o, t, e), o = ee(o, t, e);
|
|
280
|
+
const r = T(s, (f) => f.type.name === "table_wrapper"), c = s.start((r == null ? void 0 : r.depth) || 0) - 1, u = oe(o, t, e, r, c);
|
|
281
|
+
o = u.state;
|
|
282
|
+
const d = u.pos, g = o.doc.nodeAt(u.pos);
|
|
282
283
|
if (!g)
|
|
283
284
|
return;
|
|
284
|
-
const m = d + (r || l).node.content.size, p =
|
|
285
|
+
const m = d + (r || l).node.content.size, p = n.tr.replaceWith(d, m, g), a = O.atEnd(g), b = B.create(p.doc, d + a.to + 1);
|
|
285
286
|
return p.setSelection(b), p;
|
|
286
287
|
};
|
|
287
288
|
export {
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@progress/kendo-editor-common"),i=require("../utils.js"),d=/[\D]+$/,f=e=>{const t=e.match(d);return t?t[0]:""},b=(e,t)=>{var n;const s=u(((n=e.attrs)==null?void 0:n.style)||"")[t]||"";return{[t]:parseFloat(s)||null,[t+"Unit"]:f(s)}},u=e=>(e||"").split(/\s*;\s*/).filter(Boolean).map(s=>{const n=s.split(/\s*:\s*/);return{[n[0]]:n[1]}}).reduce((s,n)=>({...s,...n}),{}),m=(e,t)=>{const s=t.style,n=t.value,l=t.newValue;if(!e)return{changed:!1,style:null};const o=e.split(/\s*;\s*/).filter(
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@progress/kendo-editor-common"),i=require("../utils.js"),d=/[\D]+$/,f=e=>{const t=e.match(d);return t?t[0]:""},b=(e,t)=>{var n;const s=u(((n=e.attrs)==null?void 0:n.style)||"")[t]||"";return{[t]:parseFloat(s)||null,[t+"Unit"]:f(s)}},u=e=>(e||"").split(/\s*;\s*/).filter(Boolean).map(s=>{const n=s.split(/\s*:\s*/);return{[n[0]]:n[1]}}).reduce((s,n)=>({...s,...n}),{}),m=(e,t)=>{const s=t.style,n=t.value,l=t.newValue;if(!e)return{changed:!1,style:null};const o=e.split(/\s*;\s*/).filter(r=>!!r),c=o.filter(r=>{const a=r.split(/\s*:\s*/);return!(a[0].toLowerCase()===s&&n.test(a[1]))});return l&&c.push(`${s}: ${l}`),{style:c.join("; ")+(c.length?";":""),changed:!!l||c.length!==o.length}},g=/^.+$/;function $(e,t,s){let n;if(new RegExp("[^-]?"+t+":").test(e.style||"")){const{style:l}=m(e.style||"",{style:t,value:g,newValue:s});n={...e,style:l}}else if(e.style){const l=u(e.style);l[t]=s,n={...e,style:Object.keys(l).filter(o=>!!l[o]).reduce((o,c)=>o+c+": "+l[c]+"; ","").trim()}}else s?n={...e,style:t+": "+s+";"}:n={...e};return n}const N=e=>{const{doc:t,selection:s}=e,n=[];return s.ranges.forEach(l=>{const o=l.$from.pos,c=l.$to.pos;t.nodesBetween(o,c,(r,a,p,S)=>{(r.type.name==="table_cell"||r.type.name==="table_header")&&n.push({node:r,pos:a})})}),n},h=e=>{const t=i.parentNode(e.selection.$from,n=>n.type.name==="table"),s=i.parentNode(e.selection.$to,n=>n.type.name==="table");return t&&s&&t.depth===s.depth&&t.node.eq(s.node)?N(e).filter(({pos:l})=>{const o=i.parentNode(e.doc.resolve(l),c=>c.type.name==="table");return o&&o.depth===t.depth&&t.node.eq(o.node)}):[]},C=e=>{const t=[];if(h(e).length){const s=e.selection.$from,n=i.parentNode(s,a=>a.type.spec.tableRole==="table");if(n===null)return t;const l=s.start(n.depth),o=n.node,c=y.TableMap.get(o),r=e.doc;c.map.forEach(a=>{const p=a+l;t.push({pos:p,node:r.nodeAt(p)})})}return t};exports.getUnit=f;exports.nodeSize=b;exports.parseStyle=u;exports.reUnit=d;exports.selectedCells=h;exports.setNodeStyle=$;exports.tableCells=C;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import { TableMap as f } from "@progress/kendo-editor-common";
|
|
9
10
|
import { parentNode as i } from "../utils.mjs";
|
|
10
11
|
const d = /[\D]+$/, h = (e) => {
|
|
@@ -21,32 +22,32 @@ const d = /[\D]+$/, h = (e) => {
|
|
|
21
22
|
const n = s.split(/\s*:\s*/);
|
|
22
23
|
return { [n[0]]: n[1] };
|
|
23
24
|
}).reduce((s, n) => ({ ...s, ...n }), {}), m = (e, t) => {
|
|
24
|
-
const s = t.style, n = t.value,
|
|
25
|
+
const s = t.style, n = t.value, l = t.newValue;
|
|
25
26
|
if (!e)
|
|
26
27
|
return { changed: !1, style: null };
|
|
27
|
-
const
|
|
28
|
+
const o = e.split(/\s*;\s*/).filter((r) => !!r), c = o.filter((r) => {
|
|
28
29
|
const a = r.split(/\s*:\s*/);
|
|
29
30
|
return !(a[0].toLowerCase() === s && n.test(a[1]));
|
|
30
31
|
});
|
|
31
|
-
return
|
|
32
|
+
return l && c.push(`${s}: ${l}`), {
|
|
32
33
|
style: c.join("; ") + (c.length ? ";" : ""),
|
|
33
|
-
changed: !!
|
|
34
|
+
changed: !!l || c.length !== o.length
|
|
34
35
|
};
|
|
35
36
|
}, b = /^.+$/;
|
|
36
37
|
function N(e, t, s) {
|
|
37
38
|
let n;
|
|
38
39
|
if (new RegExp("[^-]?" + t + ":").test(e.style || "")) {
|
|
39
|
-
const { style:
|
|
40
|
+
const { style: l } = m(e.style || "", {
|
|
40
41
|
style: t,
|
|
41
42
|
value: b,
|
|
42
43
|
newValue: s
|
|
43
44
|
});
|
|
44
|
-
n = { ...e, style:
|
|
45
|
+
n = { ...e, style: l };
|
|
45
46
|
} else if (e.style) {
|
|
46
|
-
const
|
|
47
|
-
|
|
47
|
+
const l = u(e.style);
|
|
48
|
+
l[t] = s, n = {
|
|
48
49
|
...e,
|
|
49
|
-
style: Object.keys(
|
|
50
|
+
style: Object.keys(l).filter((o) => !!l[o]).reduce((o, c) => o + c + ": " + l[c] + "; ", "").trim()
|
|
50
51
|
};
|
|
51
52
|
} else
|
|
52
53
|
s ? n = { ...e, style: t + ": " + s + ";" } : n = { ...e };
|
|
@@ -54,17 +55,17 @@ function N(e, t, s) {
|
|
|
54
55
|
}
|
|
55
56
|
const y = (e) => {
|
|
56
57
|
const { doc: t, selection: s } = e, n = [];
|
|
57
|
-
return s.ranges.forEach((
|
|
58
|
-
const
|
|
59
|
-
t.nodesBetween(
|
|
58
|
+
return s.ranges.forEach((l) => {
|
|
59
|
+
const o = l.$from.pos, c = l.$to.pos;
|
|
60
|
+
t.nodesBetween(o, c, (r, a, p, $) => {
|
|
60
61
|
(r.type.name === "table_cell" || r.type.name === "table_header") && n.push({ node: r, pos: a });
|
|
61
62
|
});
|
|
62
63
|
}), n;
|
|
63
64
|
}, g = (e) => {
|
|
64
65
|
const t = i(e.selection.$from, (n) => n.type.name === "table"), s = i(e.selection.$to, (n) => n.type.name === "table");
|
|
65
|
-
return t && s && t.depth === s.depth && t.node.eq(s.node) ? y(e).filter(({ pos:
|
|
66
|
-
const
|
|
67
|
-
return
|
|
66
|
+
return t && s && t.depth === s.depth && t.node.eq(s.node) ? y(e).filter(({ pos: l }) => {
|
|
67
|
+
const o = i(e.doc.resolve(l), (c) => c.type.name === "table");
|
|
68
|
+
return o && o.depth === t.depth && t.node.eq(o.node);
|
|
68
69
|
}) : [];
|
|
69
70
|
}, w = (e) => {
|
|
70
71
|
const t = [];
|
|
@@ -72,9 +73,9 @@ const y = (e) => {
|
|
|
72
73
|
const s = e.selection.$from, n = i(s, (a) => a.type.spec.tableRole === "table");
|
|
73
74
|
if (n === null)
|
|
74
75
|
return t;
|
|
75
|
-
const
|
|
76
|
+
const l = s.start(n.depth), o = n.node, c = f.get(o), r = e.doc;
|
|
76
77
|
c.map.forEach((a) => {
|
|
77
|
-
const p = a +
|
|
78
|
+
const p = a + l;
|
|
78
79
|
t.push({ pos: p, node: r.nodeAt(p) });
|
|
79
80
|
});
|
|
80
81
|
}
|
package/tools/tableEdit.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-editor-common"),t=require("./proseMirrorTool.js"),d=(o,e)=>{const n=r.deleteColumn(o,e);if(n&&!e){const l=r.selectionCell(o),c=l&&l.node(l.depth);if(c&&c.content.childCount===1)return!1}return n},u=(o,e)=>{const n=r.deleteRow(o,e);if(n&&!e){const l=r.selectionCell(o),c=l&&l.node(l.depth-1);if(c&&c.content.childCount===1)return!1}return n};exports.TableEditNS=void 0;(o=>{o.createAddRowBeforeTool=e=>t.createProseMirrorTool(e,r.addRowBefore),o.createAddRowAfterTool=e=>t.createProseMirrorTool(e,r.addRowAfter),o.createAddColumnBeforeTool=e=>t.createProseMirrorTool(e,r.addColumnBefore),o.createAddColumnAfterTool=e=>t.createProseMirrorTool(e,r.addColumnAfter),o.createDeleteRowTool=e=>t.createProseMirrorTool(e,u),o.createDeleteColumnTool=e=>t.createProseMirrorTool(e,d),o.createDeleteTableTool=e=>t.createProseMirrorTool(e,r.deleteTable),o.createMergeCellsTool=e=>t.createProseMirrorTool(e,r.mergeCells),o.createSplitCellTool=e=>t.createProseMirrorTool(e,r.splitCell)})(exports.TableEditNS||(exports.TableEditNS={}));exports.deleteColumnCmd=d;exports.deleteRowCmd=u;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-editor-common"),t=require("./proseMirrorTool.js"),d=(o,e)=>{const n=r.deleteColumn(o,e);if(n&&!e){const l=r.selectionCell(o),c=l&&l.node(l.depth);if(c&&c.content.childCount===1)return!1}return n},u=(o,e)=>{const n=r.deleteRow(o,e);if(n&&!e){const l=r.selectionCell(o),c=l&&l.node(l.depth-1);if(c&&c.content.childCount===1)return!1}return n};exports.TableEditNS=void 0;(o=>{o.createAddRowBeforeTool=e=>t.createProseMirrorTool(e,r.addRowBefore),o.createAddRowAfterTool=e=>t.createProseMirrorTool(e,r.addRowAfter),o.createAddColumnBeforeTool=e=>t.createProseMirrorTool(e,r.addColumnBefore),o.createAddColumnAfterTool=e=>t.createProseMirrorTool(e,r.addColumnAfter),o.createDeleteRowTool=e=>t.createProseMirrorTool(e,u),o.createDeleteColumnTool=e=>t.createProseMirrorTool(e,d),o.createDeleteTableTool=e=>t.createProseMirrorTool(e,r.deleteTable),o.createMergeCellsTool=e=>t.createProseMirrorTool(e,r.mergeCells),o.createSplitCellTool=e=>t.createProseMirrorTool(e,r.splitCell)})(exports.TableEditNS||(exports.TableEditNS={}));exports.deleteColumnCmd=d;exports.deleteRowCmd=u;
|
package/tools/tableEdit.mjs
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
"use client";
|
|
9
|
+
import { addRowBefore as d, addRowAfter as f, addColumnBefore as s, addColumnAfter as C, deleteTable as m, mergeCells as a, splitCell as w, deleteColumn as A, selectionCell as c, deleteRow as p } from "@progress/kendo-editor-common";
|
|
9
10
|
import { createProseMirrorTool as r } from "./proseMirrorTool.mjs";
|
|
10
11
|
const R = (o, e) => {
|
|
11
12
|
const l = A(o, e);
|
|
@@ -26,7 +27,7 @@ const R = (o, e) => {
|
|
|
26
27
|
};
|
|
27
28
|
var u;
|
|
28
29
|
((o) => {
|
|
29
|
-
o.createAddRowBeforeTool = (e) => r(e, d), o.createAddRowAfterTool = (e) => r(e, f), o.createAddColumnBeforeTool = (e) => r(e,
|
|
30
|
+
o.createAddRowBeforeTool = (e) => r(e, d), o.createAddRowAfterTool = (e) => r(e, f), o.createAddColumnBeforeTool = (e) => r(e, s), o.createAddColumnAfterTool = (e) => r(e, C), o.createDeleteRowTool = (e) => r(e, T), o.createDeleteColumnTool = (e) => r(e, R), o.createDeleteTableTool = (e) => r(e, m), o.createMergeCellsTool = (e) => r(e, a), o.createSplitCellTool = (e) => r(e, w);
|
|
30
31
|
})(u || (u = {}));
|
|
31
32
|
export {
|
|
32
33
|
u as TableEditNS,
|
package/tools/unlink.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),v=require("@progress/kendo-react-buttons"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),v=require("@progress/kendo-react-buttons"),d=require("@progress/kendo-editor-common"),N=require("./utils.js"),m=require("@progress/kendo-react-intl"),g=require("../messages/index.js"),S=require("@progress/kendo-react-common");function T(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const p=T(f);exports.UnlinkToolNS=void 0;(t=>{t.createUnlinkTool=e=>{const o=class extends p.Component{render(){const{view:n,render:s,...c}=this.props,i={mark:e.mark},k=n?d.hasMark(n.state,i):!1,b=m.provideLocalizationService(this),l=e.messages.title,a=!k,u=p.createElement(v.Button,{onClick:a?void 0:()=>n&&d.removeLink(i,n.state.tr.setMeta("commandName",e.commandName))(n.state,n.dispatch),"aria-disabled":a?!0:void 0,...N.onDownPreventDefault,title:b.toLanguageString(l,g.messages[l]),...e.props,...c,className:S.classNames(c.className,e.props.className,{"k-disabled":a})});return s?s.call(void 0,u,{view:n}):u}};return m.registerForLocalization(o),o}})(exports.UnlinkToolNS||(exports.UnlinkToolNS={}));
|
package/tools/unlink.mjs
CHANGED
|
@@ -5,32 +5,33 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import * as l from "react";
|
|
9
10
|
import { Button as f } from "@progress/kendo-react-buttons";
|
|
10
|
-
import { hasMark as
|
|
11
|
+
import { hasMark as u, removeLink as v } from "@progress/kendo-editor-common";
|
|
11
12
|
import { onDownPreventDefault as N } from "./utils.mjs";
|
|
12
13
|
import { registerForLocalization as b, provideLocalizationService as h } from "@progress/kendo-react-intl";
|
|
13
14
|
import { messages as L } from "../messages/index.mjs";
|
|
14
15
|
import { classNames as T } from "@progress/kendo-react-common";
|
|
15
16
|
var c;
|
|
16
17
|
((p) => {
|
|
17
|
-
p.createUnlinkTool = (
|
|
18
|
+
p.createUnlinkTool = (e) => {
|
|
18
19
|
const a = class extends l.Component {
|
|
19
20
|
render() {
|
|
20
|
-
const { view: o, render: r, ...s } = this.props, n = { mark:
|
|
21
|
+
const { view: o, render: r, ...s } = this.props, n = { mark: e.mark }, d = o ? u(o.state, n) : !1, k = h(this), i = e.messages.title, t = !d, m = /* @__PURE__ */ l.createElement(
|
|
21
22
|
f,
|
|
22
23
|
{
|
|
23
|
-
onClick:
|
|
24
|
+
onClick: t ? void 0 : () => o && v(n, o.state.tr.setMeta("commandName", e.commandName))(
|
|
24
25
|
o.state,
|
|
25
26
|
o.dispatch
|
|
26
27
|
),
|
|
27
|
-
"aria-disabled":
|
|
28
|
+
"aria-disabled": t ? !0 : void 0,
|
|
28
29
|
...N,
|
|
29
30
|
title: k.toLanguageString(i, L[i]),
|
|
30
|
-
...
|
|
31
|
+
...e.props,
|
|
31
32
|
...s,
|
|
32
|
-
className: T(s.className,
|
|
33
|
-
"k-disabled":
|
|
33
|
+
className: T(s.className, e.props.className, {
|
|
34
|
+
"k-disabled": t
|
|
34
35
|
})
|
|
35
36
|
}
|
|
36
37
|
);
|
package/tools/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),e=require("../messages/index.js");function y(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const n=y(l),d={onMouseDown:t=>t.preventDefault(),onPointerDown:t=>t.preventDefault()},a={userSelect:"none"},u=function(t,...s){return s.forEach((r,o)=>{t=t.replace("{"+o+"}",String(r))}),t},i=(t,s)=>s.dataItem.style?n.cloneElement(t,t.props,n.createElement("span",{style:s.dataItem.style},t.props.children)):t,S=["px","em","%"],c={animate:{openDuration:150,closeDuration:150}},b=[{textKey:e.keys.borderStyleNone,text:e.messages[e.keys.borderStyleNone],value:"none"},{textKey:e.keys.borderStyleSolid,text:e.messages[e.keys.borderStyleSolid],value:"solid"},{textKey:e.keys.borderStyleDotted,text:e.messages[e.keys.borderStyleDotted],value:"dotted"},{textKey:e.keys.borderStyleDashed,text:e.messages[e.keys.borderStyleDashed],value:"dashed"},{textKey:e.keys.borderStyleDouble,text:e.messages[e.keys.borderStyleDouble],value:"double"},{textKey:e.keys.borderStyleGroove,text:e.messages[e.keys.borderStyleGroove],value:"groove"},{textKey:e.keys.borderStyleRidge,text:e.messages[e.keys.borderStyleRidge],value:"ridge"},{textKey:e.keys.borderStyleInset,text:e.messages[e.keys.borderStyleInset],value:"inset"},{textKey:e.keys.borderStyleOutset,text:e.messages[e.keys.borderStyleOutset],value:"outset"},{textKey:e.keys.borderStyleInitial,text:e.messages[e.keys.borderStyleInitial],value:"initial"},{textKey:e.keys.borderStyleInherit,text:e.messages[e.keys.borderStyleInherit],value:"inherit"},{textKey:e.keys.borderStyleHidden,text:e.messages[e.keys.borderStyleHidden],value:"hidden"}];function g(t,s){for(let r=t.depth;r>0;r--){const o=t.node(r);if(s(o))return{node:o,depth:r}}return null}exports.borderStyles=b;exports.formatString=u;exports.itemRender=i;exports.onDownPreventDefault=d;exports.parentNode=g;exports.popupSettings=c;exports.units=S;exports.userSelectNone=a;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),e=require("../messages/index.js");function y(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return s.default=t,Object.freeze(s)}const n=y(l),d={onMouseDown:t=>t.preventDefault(),onPointerDown:t=>t.preventDefault()},a={userSelect:"none"},u=function(t,...s){return s.forEach((r,o)=>{t=t.replace("{"+o+"}",String(r))}),t},i=(t,s)=>s.dataItem.style?n.cloneElement(t,t.props,n.createElement("span",{style:s.dataItem.style},t.props.children)):t,S=["px","em","%"],c={animate:{openDuration:150,closeDuration:150}},b=[{textKey:e.keys.borderStyleNone,text:e.messages[e.keys.borderStyleNone],value:"none"},{textKey:e.keys.borderStyleSolid,text:e.messages[e.keys.borderStyleSolid],value:"solid"},{textKey:e.keys.borderStyleDotted,text:e.messages[e.keys.borderStyleDotted],value:"dotted"},{textKey:e.keys.borderStyleDashed,text:e.messages[e.keys.borderStyleDashed],value:"dashed"},{textKey:e.keys.borderStyleDouble,text:e.messages[e.keys.borderStyleDouble],value:"double"},{textKey:e.keys.borderStyleGroove,text:e.messages[e.keys.borderStyleGroove],value:"groove"},{textKey:e.keys.borderStyleRidge,text:e.messages[e.keys.borderStyleRidge],value:"ridge"},{textKey:e.keys.borderStyleInset,text:e.messages[e.keys.borderStyleInset],value:"inset"},{textKey:e.keys.borderStyleOutset,text:e.messages[e.keys.borderStyleOutset],value:"outset"},{textKey:e.keys.borderStyleInitial,text:e.messages[e.keys.borderStyleInitial],value:"initial"},{textKey:e.keys.borderStyleInherit,text:e.messages[e.keys.borderStyleInherit],value:"inherit"},{textKey:e.keys.borderStyleHidden,text:e.messages[e.keys.borderStyleHidden],value:"hidden"}];function g(t,s){for(let r=t.depth;r>0;r--){const o=t.node(r);if(s(o))return{node:o,depth:r}}return null}exports.borderStyles=b;exports.formatString=u;exports.itemRender=i;exports.onDownPreventDefault=d;exports.parentNode=g;exports.popupSettings=c;exports.units=S;exports.userSelectNone=a;
|
package/tools/utils.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import * as d from "react";
|
|
9
10
|
import { keys as e, messages as r } from "../messages/index.mjs";
|
|
10
11
|
const a = {
|
package/tools/viewHtml.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),m=require("@progress/kendo-react-buttons"),p=require("./utils.js"),D=require("../dialogs/index.js"),u=require("@progress/kendo-react-intl"),f=require("../messages/index.js");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const r=w(d);exports.ViewHtmlToolNS=void 0;(e=>{e.createViewHtmlTool=t=>{const o=class extends r.Component{constructor(){super(...arguments),this.state={openedDialog:!1},this.toggleDialog=()=>{this.setState({openedDialog:!this.state.openedDialog})}}render(){const{view:n,render:l,...s}=this.props,g=u.provideLocalizationService(this),a=t.messages.viewHtml,c=[r.createElement(m.Button,{onClick:this.toggleDialog,key:"viewHtml",...p.onDownPreventDefault,title:g.toLanguageString(a,f.messages[a]),...t.props,...s}),this.state.openedDialog&&n&&r.createElement(D.EditorDialogs.ViewHtmlDialog,{key:"viewHtmlDialog",view:n,settings:t,dir:s.dir,onClose:this.toggleDialog})||null];return l?l.call(void 0,c,{view:n}):c}};return u.registerForLocalization(o),o}})(exports.ViewHtmlToolNS||(exports.ViewHtmlToolNS={}));
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),m=require("@progress/kendo-react-buttons"),p=require("./utils.js"),D=require("../dialogs/index.js"),u=require("@progress/kendo-react-intl"),f=require("../messages/index.js");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const r=w(d);exports.ViewHtmlToolNS=void 0;(e=>{e.createViewHtmlTool=t=>{const o=class extends r.Component{constructor(){super(...arguments),this.state={openedDialog:!1},this.toggleDialog=()=>{this.setState({openedDialog:!this.state.openedDialog})}}render(){const{view:n,render:l,...s}=this.props,g=u.provideLocalizationService(this),a=t.messages.viewHtml,c=[r.createElement(m.Button,{onClick:this.toggleDialog,key:"viewHtml",...p.onDownPreventDefault,title:g.toLanguageString(a,f.messages[a]),...t.props,...s}),this.state.openedDialog&&n&&r.createElement(D.EditorDialogs.ViewHtmlDialog,{key:"viewHtmlDialog",view:n,settings:t,dir:s.dir,onClose:this.toggleDialog})||null];return l?l.call(void 0,c,{view:n}):c}};return u.registerForLocalization(o),o}})(exports.ViewHtmlToolNS||(exports.ViewHtmlToolNS={}));
|
package/tools/viewHtml.mjs
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
+
"use client";
|
|
8
9
|
import * as t from "react";
|
|
9
|
-
import { Button as
|
|
10
|
-
import { onDownPreventDefault as
|
|
10
|
+
import { Button as c } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { onDownPreventDefault as p } from "./utils.mjs";
|
|
11
12
|
import { EditorDialogs as d } from "../dialogs/index.mjs";
|
|
12
13
|
import { registerForLocalization as D, provideLocalizationService as u } from "@progress/kendo-react-intl";
|
|
13
14
|
import { messages as h } from "../messages/index.mjs";
|
|
14
15
|
var n;
|
|
15
16
|
((m) => {
|
|
16
|
-
m.createViewHtmlTool = (
|
|
17
|
+
m.createViewHtmlTool = (e) => {
|
|
17
18
|
const i = class extends t.Component {
|
|
18
19
|
constructor() {
|
|
19
20
|
super(...arguments), this.state = {
|
|
@@ -25,30 +26,30 @@ var n;
|
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
render() {
|
|
28
|
-
const { view:
|
|
29
|
+
const { view: o, render: r, ...l } = this.props, g = u(this), a = e.messages.viewHtml, s = [
|
|
29
30
|
/* @__PURE__ */ t.createElement(
|
|
30
|
-
|
|
31
|
+
c,
|
|
31
32
|
{
|
|
32
33
|
onClick: this.toggleDialog,
|
|
33
34
|
key: "viewHtml",
|
|
34
|
-
...
|
|
35
|
+
...p,
|
|
35
36
|
title: g.toLanguageString(a, h[a]),
|
|
36
|
-
...
|
|
37
|
+
...e.props,
|
|
37
38
|
...l
|
|
38
39
|
}
|
|
39
40
|
),
|
|
40
|
-
this.state.openedDialog &&
|
|
41
|
+
this.state.openedDialog && o && /* @__PURE__ */ t.createElement(
|
|
41
42
|
d.ViewHtmlDialog,
|
|
42
43
|
{
|
|
43
44
|
key: "viewHtmlDialog",
|
|
44
|
-
view:
|
|
45
|
-
settings:
|
|
45
|
+
view: o,
|
|
46
|
+
settings: e,
|
|
46
47
|
dir: l.dir,
|
|
47
48
|
onClose: this.toggleDialog
|
|
48
49
|
}
|
|
49
50
|
) || null
|
|
50
51
|
];
|
|
51
|
-
return r ? r.call(void 0, s, { view:
|
|
52
|
+
return r ? r.call(void 0, s, { view: o }) : s;
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
return D(i), i;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent);exports.firefox=e;
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent);exports.firefox=e;
|