@progress/kendo-react-editor 15.2.0-develop.5 → 15.2.0-develop.6

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.mjs CHANGED
@@ -5,339 +5,332 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as c from "react";
9
- import i from "prop-types";
10
- import { ToolbarSeparator as A, ButtonGroup as N, Toolbar as x, toolbarButtons as F } from "@progress/kendo-react-buttons";
11
- import { validatePackage as I, getLicenseMessage as M, classNames as W, WatermarkOverlay as H } from "@progress/kendo-react-common";
12
- import { Plugin as E, PluginKey as S, spacesFix as z, caretColor as j, history as K, dropCursor as V, gapCursor as U, tableEditing as q, cspFix as G, Schema as $, marks as R, nodes as J, EditorState as Q, keymap as T, baseKeymap as X, EditorView as Y, getMark as Z } from "@progress/kendo-editor-common";
13
- import { defaultStyle as tt, tablesStyles as et, rtlStyles as it } from "./config/defaultStyles.mjs";
14
- import { EditorToolsSettings as st } from "./config/toolsSettings.mjs";
15
- import { EditorDialogs as nt } from "./dialogs/index.mjs";
16
- import { EditorUtils as k } from "./utils/index.mjs";
17
- import { editorPropsKey as B } from "./utils/props-key.mjs";
18
- import { updateEditorValue as ot } from "./utils/controlled-value.mjs";
19
- import { packageMetadata as D } from "./package-metadata.mjs";
20
- import { keys as d, messages as w } from "./messages/index.mjs";
21
- import { provideLocalizationService as O, registerForLocalization as rt } from "@progress/kendo-react-intl";
22
- const { link: P, bold: at, italic: lt, underline: ht } = st, _ = class _ extends c.Component {
23
- constructor(l) {
24
- super(l), this.state = {
25
- view: void 0,
26
- linkDialog: !1
27
- }, this._element = null, this._contentElement = null, this.iframe = null, this.trOnChange = null, this.htmlOnChange = null, this.showLicenseWatermark = !1, this.focus = () => {
28
- this.view && this.view.focus();
29
- }, this.renderDialog = (t, e, s) => this.state[s] && /* @__PURE__ */ c.createElement(
30
- t,
31
- {
32
- view: this.view,
33
- settings: e,
34
- dir: this.props.dir,
35
- onClose: () => this.setState({ [s]: !1 })
36
- }
37
- ), this.renderTool = (t, e, s = !1) => {
38
- const h = /* @__PURE__ */ c.createElement(
39
- t,
40
- {
41
- view: this.view,
42
- dir: this.props.dir,
43
- key: e,
44
- className: s ? "k-toolbar-button" : void 0
45
- }
46
- );
47
- return h.type === A ? /* @__PURE__ */ c.createElement(t, { key: e }) : h;
48
- }, this.updateTools = (t, e) => {
49
- this.setState({ view: t });
50
- }, this.filterTransaction = (t, e) => {
51
- const s = { target: this, transaction: t, state: e };
52
- return (this.props.onExecute && this.props.onExecute.call(void 0, s)) !== !1;
53
- }, this.onPasteHtml = (t) => {
54
- if (this.props.onPasteHtml && this.pasteEvent) {
55
- const e = {
56
- target: this,
57
- pastedHtml: t,
58
- nativeEvent: this.pasteEvent
59
- }, s = this.props.onPasteHtml.call(void 0, e);
60
- if (this.pasteEvent = void 0, typeof s == "string")
61
- return s;
62
- }
63
- return t;
64
- }, this.dispatchTransaction = (t) => {
65
- const e = t.docChanged;
66
- if (this.props.onChange && e) {
67
- this.trOnChange = t;
68
- const s = t.doc, h = t.doc.type.schema, p = {
69
- target: this,
70
- value: s,
71
- html: "",
72
- transaction: t,
73
- schema: h
74
- };
75
- Object.defineProperty(p, "html", {
76
- get: () => (this.htmlOnChange = k.getHtml({ doc: s, schema: h }), this.htmlOnChange)
77
- }), this.props.onChange.call(void 0, p);
78
- }
79
- this.view && (this.props.value === void 0 || !e) && this.view.updateState(this.view.state.apply(t));
80
- }, this.onFocus = (t, e) => {
81
- if (this.props.onFocus) {
82
- const s = {
83
- target: this,
84
- nativeEvent: e
85
- };
86
- this.props.onFocus.call(void 0, s);
87
- }
88
- return !1;
89
- }, this.onBlur = (t, e) => {
90
- if (this.props.onBlur) {
91
- const s = {
92
- target: this,
93
- nativeEvent: e
94
- };
95
- this.props.onBlur.call(void 0, s);
96
- }
97
- return !1;
98
- }, this.onPaste = (t, e) => (this.props.onPasteHtml && (this.pasteEvent = e), !1), this.onIFrameInit = (t) => {
99
- if (this.props.onIFrameInit) {
100
- const e = {
101
- target: this,
102
- iframe: t
103
- };
104
- this.props.onIFrameInit.call(void 0, e);
8
+ import * as t from "react";
9
+ import c from "prop-types";
10
+ import { ButtonGroup as ke, Toolbar as Ee, toolbarButtons as Re, ToolbarSeparator as we } from "@progress/kendo-react-buttons";
11
+ import { validatePackage as Ce, getLicenseMessage as Se, useWebMcpRegister as Le, classNames as Ae, WatermarkOverlay as Be } from "@progress/kendo-react-common";
12
+ import { Plugin as W, PluginKey as j, spacesFix as Ne, caretColor as Pe, history as De, dropCursor as Ie, gapCursor as Te, tableEditing as We, cspFix as xe, Schema as He, marks as Me, nodes as _e, EditorState as Fe, keymap as z, baseKeymap as Oe, EditorView as Ve, getMark as je } from "@progress/kendo-editor-common";
13
+ import { defaultStyle as ze, tablesStyles as qe, rtlStyles as Ke } from "./config/defaultStyles.mjs";
14
+ import { EditorToolsSettings as $e } from "./config/toolsSettings.mjs";
15
+ import { EditorDialogs as Ge } from "./dialogs/index.mjs";
16
+ import { EditorUtils as x } from "./utils/index.mjs";
17
+ import { editorPropsKey as q } from "./utils/props-key.mjs";
18
+ import { updateEditorValue as Ue } from "./utils/controlled-value.mjs";
19
+ import { packageMetadata as K } from "./package-metadata.mjs";
20
+ import { keys as b, messages as N } from "./messages/index.mjs";
21
+ import { useLocalization as Je } from "@progress/kendo-react-intl";
22
+ const { link: $, bold: Qe, italic: Xe, underline: Ye } = $e, G = t.forwardRef((d, U) => {
23
+ const { tools: J = [], defaultEditMode: Q = "iframe", preserveWhitespace: X = "full", style: k, className: Y } = d, [Z, E] = t.useState({
24
+ view: void 0,
25
+ linkDialog: !1
26
+ }), P = t.useRef(null), f = t.useRef(null), H = t.useRef(null), i = t.useRef(void 0), v = t.useRef(null), R = t.useRef(null), w = t.useRef(void 0), a = t.useRef(d);
27
+ a.current = d;
28
+ const ee = t.useCallback((e) => {
29
+ P.current = e;
30
+ }, []), te = t.useCallback((e) => {
31
+ H.current = e;
32
+ }, []), re = t.useCallback((e) => {
33
+ f.current = e;
34
+ }, []), [ne] = t.useState(() => !Ce(K, { component: "Editor" })), [ae] = t.useState(() => Se(K)), C = Je(), S = t.useRef(null);
35
+ t.useImperativeHandle(
36
+ S,
37
+ () => ({
38
+ get element() {
39
+ return P.current;
40
+ },
41
+ get contentElement() {
42
+ return f.current;
43
+ },
44
+ get view() {
45
+ return i.current;
46
+ },
47
+ get value() {
48
+ return v.current !== null ? v.current.doc : a.current.value !== void 0 ? a.current.value : i.current ? i.current.state.doc : a.current.defaultContent || "";
49
+ },
50
+ get props() {
51
+ return a.current;
52
+ },
53
+ focus: () => {
54
+ i.current && i.current.focus();
105
55
  }
106
- return !1;
107
- }, this.showLicenseWatermark = !I(D, { component: "Editor" }), this.licenseMessage = M(D);
108
- }
109
- /**
110
- * The value of the Editor.
111
- */
112
- get value() {
113
- return this.trOnChange !== null ? this.trOnChange.doc : this.props.value !== void 0 ? this.props.value : this.view ? this.view.state.doc : this.props.defaultContent || "";
114
- }
115
- /**
116
- * Returns the DOM element of the Editor.
117
- */
118
- get element() {
119
- return this._element;
120
- }
121
- /**
122
- * Returns the content-editable DOM element of the Editor.
123
- */
124
- get contentElement() {
125
- return this._contentElement;
126
- }
127
- /**
128
- * Returns the `view` object of the Editor.
129
- */
130
- get view() {
131
- return this._view;
132
- }
133
- /**
134
- * @hidden
135
- */
136
- componentDidMount() {
137
- this.initialize();
138
- }
139
- /**
140
- * @hidden
141
- */
142
- componentDidUpdate(l) {
143
- const { value: t } = this.props, e = this.view;
144
- t === void 0 || !e || (ot(e, t, l.value, this.trOnChange, this.htmlOnChange), this.trOnChange = null, this.htmlOnChange = null);
145
- }
146
- /**
147
- * @hidden
148
- */
149
- componentWillUnmount() {
150
- var t;
151
- this.view && this.view.destroy(), this._view = void 0;
152
- const l = (t = this.iframe) == null ? void 0 : t.contentWindow;
153
- if (l) {
154
- this._contentElement && this._contentElement.parentNode && this._contentElement.parentNode.removeChild(this._contentElement);
155
- const e = l.document.head;
156
- for (; e && e.firstChild; )
157
- e.removeChild(e.firstChild);
56
+ })
57
+ ), t.useImperativeHandle(U, () => S.current), Le("editor", S, d, d.webMcp);
58
+ const p = () => S.current, oe = t.useRef((e, r) => {
59
+ var s, g;
60
+ const n = { target: p(), transaction: e, state: r };
61
+ return ((g = (s = a.current).onExecute) == null ? void 0 : g.call(s, n)) !== !1;
62
+ }).current, ce = t.useRef((e) => {
63
+ if (a.current.onPasteHtml && w.current) {
64
+ const r = {
65
+ target: p(),
66
+ pastedHtml: e,
67
+ nativeEvent: w.current
68
+ }, n = a.current.onPasteHtml(r);
69
+ if (w.current = void 0, typeof n == "string")
70
+ return n;
158
71
  }
159
- }
160
- /**
161
- * @hidden
162
- */
163
- render() {
164
- const { tools: l = [], defaultEditMode: t = "iframe", preserveWhitespace: e = "full", style: s, className: h } = this.props, p = O(this), u = this.props.ariaLabel || p.toLanguageString(d.contentAreaLabel, w[d.contentAreaLabel]);
165
- if (this.view) {
166
- const o = B.getState(this.view.state);
167
- o.preserveWhitespace = e;
72
+ return e;
73
+ }).current, se = t.useRef((e) => {
74
+ const r = e.docChanged;
75
+ if (a.current.onChange && r) {
76
+ v.current = e;
77
+ const s = e.doc, g = e.doc.type.schema, y = {
78
+ target: p(),
79
+ value: s,
80
+ html: "",
81
+ transaction: e,
82
+ schema: g
83
+ };
84
+ Object.defineProperty(y, "html", {
85
+ get: () => (R.current = x.getHtml({ doc: s, schema: g }), R.current)
86
+ }), a.current.onChange(y);
168
87
  }
169
- let m = this.props.contentStyle;
170
- m === void 0 && (s || {}).height === void 0 && (m = { height: "300px" });
171
- const f = (o, n) => o.displayName || o.name || `tool-${n}`, b = (o, n) => o.map((r, a) => f(r, a)).join("-") || `group-${n}`, y = l.map(
172
- (o, n) => Array.isArray(o) ? /* @__PURE__ */ c.createElement(N, { key: b(o, n), className: "k-toolbar-button-group" }, o.map((r, a) => this.renderTool(r, f(r, a)))) : this.renderTool(o, f(o, n), !0)
173
- );
174
- return /* @__PURE__ */ c.createElement(
175
- "div",
176
- {
177
- ref: (o) => {
178
- this._element = o;
179
- },
180
- className: W("k-editor", h, { "k-editor-resizable": this.props.resizable }),
181
- dir: this.props.dir,
182
- style: s
183
- },
184
- y.length > 0 && /* @__PURE__ */ c.createElement(
185
- x,
186
- {
187
- className: "k-editor-toolbar",
188
- ariaLabel: p.toLanguageString(d.toolbarAriaLabel, w[d.toolbarAriaLabel]),
189
- keyboardNavigation: this.props.keyboardNavigation
190
- },
191
- y
192
- ),
193
- t === "iframe" ? /* @__PURE__ */ c.createElement(
194
- "iframe",
195
- {
196
- ref: (o) => {
197
- this.iframe = o;
198
- },
199
- frameBorder: "0",
200
- title: p.toLanguageString(d.iframeTitle, w[d.iframeTitle]),
201
- style: m,
202
- className: "k-iframe"
203
- }
204
- ) : /* @__PURE__ */ c.createElement(
205
- "div",
206
- {
207
- ref: (o) => {
208
- this._contentElement = o;
209
- },
210
- style: m,
211
- className: "k-editor-content",
212
- role: "textbox",
213
- "aria-labelledby": this.props.ariaLabelledBy,
214
- "aria-describedby": this.props.ariaDescribedBy,
215
- "aria-label": u,
216
- suppressContentEditableWarning: !0
217
- }
218
- ),
219
- this.renderDialog(nt.InsertLinkDialog, P, "linkDialog"),
220
- this.showLicenseWatermark && /* @__PURE__ */ c.createElement(H, { message: this.licenseMessage })
221
- );
222
- }
223
- initialize() {
224
- const l = this.iframe && this.iframe.contentWindow;
225
- if (l) {
226
- const n = l.document, r = n.createElement("meta");
227
- r.setAttribute("charset", "utf-8"), n.head.appendChild(r), this._contentElement = n.createElement("div"), n.body.appendChild(this._contentElement), this._contentElement.classList.add("k-content"), this._contentElement.setAttribute("role", "textbox"), this.props.ariaLabelledBy && this._contentElement.setAttribute("aria-labelledby", this.props.ariaLabelledBy), this.props.ariaDescribedBy && this._contentElement.setAttribute("aria-describedby", this.props.ariaDescribedBy), this._contentElement.setAttribute(
88
+ const n = i.current;
89
+ n && (a.current.value === void 0 || !r) && n.updateState(n.state.apply(e));
90
+ }).current, ie = t.useRef((e, r) => {
91
+ if (a.current.onFocus) {
92
+ const n = {
93
+ target: p(),
94
+ nativeEvent: r
95
+ };
96
+ a.current.onFocus(n);
97
+ }
98
+ return !1;
99
+ }).current, ue = t.useRef((e, r) => {
100
+ if (a.current.onBlur) {
101
+ const n = {
102
+ target: p(),
103
+ nativeEvent: r
104
+ };
105
+ a.current.onBlur(n);
106
+ }
107
+ return !1;
108
+ }).current, le = t.useRef((e, r) => (a.current.onPasteHtml && (w.current = r), !1)).current, de = t.useRef((e) => {
109
+ if (a.current.onIFrameInit) {
110
+ const r = {
111
+ target: p(),
112
+ iframe: e
113
+ };
114
+ a.current.onIFrameInit(r);
115
+ }
116
+ return !1;
117
+ }).current, fe = t.useRef((e, r) => {
118
+ E((n) => ({ ...n, view: e }));
119
+ }).current;
120
+ t.useEffect(() => {
121
+ var V;
122
+ const e = H.current, r = e == null ? void 0 : e.contentWindow;
123
+ if (r) {
124
+ const o = r.document;
125
+ if (!o.head.querySelector("meta[charset]")) {
126
+ const l = o.createElement("meta");
127
+ l.setAttribute("charset", "utf-8"), o.head.appendChild(l);
128
+ }
129
+ const u = o.body.querySelector(".k-content");
130
+ u ? (u.textContent = "", f.current = u) : (f.current = o.createElement("div"), o.body.appendChild(f.current), f.current.classList.add("k-content")), f.current.setAttribute("role", "textbox"), f.current.setAttribute(
228
131
  "aria-label",
229
- this.props.ariaLabel || O(this).toLanguageString(
230
- d.contentAreaLabel,
231
- w[d.contentAreaLabel]
232
- )
233
- ), this.iframe && this.props.onIFrameInit ? this.onIFrameInit(this.iframe) : [tt, et, this.props.dir === "rtl" ? it : void 0].forEach((a) => {
234
- if (a) {
235
- const v = n.createElement("style");
236
- v.appendChild(n.createTextNode(a)), n.head.appendChild(v);
132
+ a.current.ariaLabel || C.toLanguageString(b.contentAreaLabel, N[b.contentAreaLabel])
133
+ ), a.current.ariaLabelledBy && f.current.setAttribute("aria-labelledby", a.current.ariaLabelledBy), a.current.ariaDescribedBy && f.current.setAttribute("aria-describedby", a.current.ariaDescribedBy), e && a.current.onIFrameInit ? de(e) : o.head.querySelector("style") || [ze, qe, a.current.dir === "rtl" ? Ke : void 0].forEach(
134
+ (l) => {
135
+ if (l) {
136
+ const m = o.createElement("style");
137
+ m.appendChild(o.createTextNode(l)), o.head.appendChild(m);
138
+ }
237
139
  }
238
- });
140
+ );
239
141
  }
240
- const t = this._contentElement;
241
- if (!t)
142
+ const n = f.current;
143
+ if (!n)
242
144
  return;
243
- const { preserveWhitespace: e = "full" } = this.props, s = [
145
+ const s = (V = a.current.preserveWhitespace) != null ? V : "full", g = [
244
146
  // https://prosemirror.net/docs/ref/#state.PluginSpec
245
- new E({
246
- view: (() => ({ update: this.updateTools })),
247
- key: new S("toolbar-tools-update-plugin")
147
+ new W({
148
+ view: (() => ({ update: fe })),
149
+ key: new j("toolbar-tools-update-plugin")
248
150
  }),
249
- new E({
250
- filterTransaction: this.filterTransaction,
251
- key: new S("onExecute-event-plugin")
151
+ new W({
152
+ filterTransaction: oe,
153
+ key: new j("onExecute-event-plugin")
252
154
  }),
253
- new E({
254
- key: B,
155
+ new W({
156
+ key: q,
255
157
  state: {
256
- init: () => ({ preserveWhitespace: e }),
257
- apply: (n, r) => r
158
+ init: () => ({ preserveWhitespace: s }),
159
+ apply: (o, u) => u
258
160
  }
259
161
  }),
260
- z(),
261
- j(),
262
- K(),
263
- V(),
264
- U(),
265
- q(),
266
- G()
267
- ], h = {
268
- ...k.getShortcuts({
162
+ Ne(),
163
+ Pe(),
164
+ De(),
165
+ Ie(),
166
+ Te(),
167
+ We(),
168
+ xe()
169
+ ], y = {
170
+ ...x.getShortcuts({
269
171
  types: { listItem: "list_item", hardBreak: "hard_break" },
270
- toolsSettings: { bold: at, italic: lt, underline: ht }
172
+ toolsSettings: { bold: Qe, italic: Xe, underline: Ye }
271
173
  }),
272
174
  "Mod-k": () => {
273
- const { linkDialog: n } = this.state, r = this.view;
274
- if (r) {
275
- const a = r.state, v = a.selection.empty, g = Z(a, a.schema.marks[P.mark]);
276
- !n && !(v && !g) && this.setState({ linkDialog: !0 });
175
+ const o = i.current;
176
+ if (o) {
177
+ const u = o.state, l = u.selection.empty, m = je(u, u.schema.marks[$.mark]);
178
+ l && !m || E((h) => h.linkDialog ? h : { ...h, linkDialog: !0 });
277
179
  }
278
- return !n;
180
+ return !0;
279
181
  },
280
182
  "Alt-F10": () => {
281
- var r;
282
- const n = (r = this.element) == null ? void 0 : r.querySelector(".k-toolbar");
283
- if (n) {
284
- const a = n.querySelector(F.join(","));
285
- if (a)
286
- return a.focus(), !0;
183
+ var u;
184
+ const o = (u = P.current) == null ? void 0 : u.querySelector(".k-toolbar");
185
+ if (o) {
186
+ const l = o.querySelector(Re.join(","));
187
+ if (l)
188
+ return l.focus(), !0;
287
189
  }
288
190
  return !1;
289
191
  }
290
- }, { defaultContent: p = "", value: u, onMount: m } = this.props, f = u && typeof u != "string" ? u : k.createDocument(new $({ nodes: J, marks: R }), u || p, {
291
- preserveWhitespace: e
292
- }), b = {
293
- state: Q.create({
294
- plugins: [...s, T(h), T(X)],
295
- doc: f
192
+ }, { defaultContent: ve = "", value: A, onMount: T } = a.current, ye = A && typeof A != "string" ? A : x.createDocument(new He({ nodes: _e, marks: Me }), A || ve, {
193
+ preserveWhitespace: s
194
+ }), F = {
195
+ state: Fe.create({
196
+ plugins: [...g, z(y), z(Oe)],
197
+ doc: ye
296
198
  }),
297
- transformPastedHTML: this.onPasteHtml,
298
- dispatchTransaction: this.dispatchTransaction,
199
+ transformPastedHTML: ce,
200
+ dispatchTransaction: se,
299
201
  handleDOMEvents: {
300
- focus: this.onFocus,
301
- blur: this.onBlur,
302
- paste: this.onPaste
202
+ focus: ie,
203
+ blur: ue,
204
+ paste: le
303
205
  },
304
- handleDrop: (n, r, a, v) => {
305
- let g = !1;
306
- return a.content.nodesBetween(0, a.content.size, (L) => {
307
- g = g || L.type.name === "table_caption_external";
308
- }), g;
206
+ handleDrop: (o, u, l, m) => {
207
+ let B = !1;
208
+ return l.content.nodesBetween(0, l.content.size, (h) => {
209
+ B = B || h.type.name === "table_caption_external";
210
+ }), B;
309
211
  }
310
- }, y = { plugins: s, shortcuts: h, target: this, viewProps: b, dom: t }, o = this._view = m && m.call(void 0, y) || new Y({ mount: t }, b);
311
- this.setState({
312
- view: o
313
- });
212
+ }, he = { plugins: g, shortcuts: y, target: p(), viewProps: F, dom: n }, O = (T == null ? void 0 : T(he)) || new Ve({ mount: n }, F);
213
+ return i.current = O, E((o) => ({ ...o, view: O })), () => {
214
+ var u, l;
215
+ i.current && i.current.destroy(), i.current = void 0;
216
+ const o = e == null ? void 0 : e.contentWindow;
217
+ if (o != null && o.document) {
218
+ (l = (u = f.current) == null ? void 0 : u.parentNode) == null || l.removeChild(f.current);
219
+ const m = o.document.head;
220
+ for (; m != null && m.firstChild; )
221
+ m.removeChild(m.firstChild);
222
+ }
223
+ };
224
+ }, []);
225
+ const D = t.useRef(d.value);
226
+ if (t.useEffect(() => {
227
+ const { value: e } = a.current, r = i.current;
228
+ if (e === void 0 || !r) {
229
+ D.current = e;
230
+ return;
231
+ }
232
+ Ue(r, e, D.current, v.current, R.current), v.current = null, R.current = null, D.current = e;
233
+ }), i.current) {
234
+ const e = q.getState(i.current.state);
235
+ e.preserveWhitespace = X;
314
236
  }
237
+ let L = d.contentStyle;
238
+ L === void 0 && (k == null ? void 0 : k.height) === void 0 && (L = { height: "300px" });
239
+ const I = (e, r, n) => e.displayName || e.name || `tool-${r}-${n}`, me = (e, r) => e.map((n, s) => I(n, r, s)).join("-") || `group-${r}`, M = (e, r, n = !1) => {
240
+ const s = /* @__PURE__ */ t.createElement(
241
+ e,
242
+ {
243
+ view: i.current,
244
+ dir: d.dir,
245
+ key: r,
246
+ className: n ? "k-toolbar-button" : void 0
247
+ }
248
+ );
249
+ return s.type === we ? /* @__PURE__ */ t.createElement(e, { key: r }) : s;
250
+ }, ge = (e, r, n) => Z[n] && /* @__PURE__ */ t.createElement(
251
+ e,
252
+ {
253
+ view: i.current,
254
+ settings: r,
255
+ dir: d.dir,
256
+ onClose: () => E((s) => ({ ...s, [n]: !1 }))
257
+ }
258
+ ), _ = J.map(
259
+ (e, r) => Array.isArray(e) ? /* @__PURE__ */ t.createElement(ke, { key: me(e, r), className: "k-toolbar-button-group" }, e.map((n, s) => M(n, I(n, r, s)))) : M(e, I(e, r, 0), !0)
260
+ ), be = C.toLanguageString(
261
+ b.toolbarAriaLabel,
262
+ N[b.toolbarAriaLabel]
263
+ ), pe = C.toLanguageString(
264
+ b.contentAreaLabel,
265
+ N[b.contentAreaLabel]
266
+ );
267
+ return /* @__PURE__ */ t.createElement(
268
+ "div",
269
+ {
270
+ ref: ee,
271
+ className: Ae("k-editor", Y, { "k-editor-resizable": d.resizable }),
272
+ dir: d.dir,
273
+ style: k
274
+ },
275
+ _.length > 0 && /* @__PURE__ */ t.createElement(
276
+ Ee,
277
+ {
278
+ className: "k-editor-toolbar",
279
+ keyboardNavigation: d.keyboardNavigation,
280
+ ariaLabel: be
281
+ },
282
+ _
283
+ ),
284
+ Q === "iframe" ? /* @__PURE__ */ t.createElement("div", { className: "k-editor-content" }, /* @__PURE__ */ t.createElement(
285
+ "iframe",
286
+ {
287
+ ref: te,
288
+ frameBorder: "0",
289
+ title: C.toLanguageString(b.iframeTitle, N[b.iframeTitle]),
290
+ style: L,
291
+ className: "k-iframe"
292
+ }
293
+ )) : /* @__PURE__ */ t.createElement(
294
+ "div",
295
+ {
296
+ ref: re,
297
+ style: L,
298
+ className: "k-editor-content",
299
+ role: "textbox",
300
+ "aria-label": pe,
301
+ "aria-labelledby": d.ariaLabelledBy,
302
+ "aria-describedby": d.ariaDescribedBy,
303
+ suppressContentEditableWarning: !0
304
+ }
305
+ ),
306
+ ge(Ge.InsertLinkDialog, $, "linkDialog"),
307
+ ne && /* @__PURE__ */ t.createElement(Be, { message: ae })
308
+ );
309
+ });
310
+ G.propTypes = {
311
+ defaultContent: c.string,
312
+ value: c.oneOfType([c.object, c.string]),
313
+ defaultEditMode: c.oneOf(["iframe", "div"]),
314
+ contentStyle: c.object,
315
+ dir: c.string,
316
+ className: c.string,
317
+ ariaDescribedBy: c.string,
318
+ ariaLabelledBy: c.string,
319
+ ariaLabel: c.string,
320
+ style: c.object,
321
+ tools: c.arrayOf(c.any),
322
+ keyboardNavigation: c.bool,
323
+ resizable: c.bool,
324
+ preserveWhitespace: c.oneOf([!0, !1, "full"]),
325
+ onMount: c.func,
326
+ onFocus: c.func,
327
+ onBlur: c.func,
328
+ onChange: c.func,
329
+ onPasteHtml: c.func,
330
+ onExecute: c.func,
331
+ onIFrameInit: c.func
315
332
  };
316
- _.propTypes = {
317
- defaultContent: i.string,
318
- value: i.oneOfType([i.object, i.string]),
319
- defaultEditMode: i.oneOf(["iframe", "div"]),
320
- contentStyle: i.object,
321
- dir: i.string,
322
- className: i.string,
323
- ariaDescribedBy: i.string,
324
- ariaLabelledBy: i.string,
325
- ariaLabel: i.string,
326
- style: i.object,
327
- tools: i.arrayOf(i.any),
328
- keyboardNavigation: i.bool,
329
- resizable: i.bool,
330
- preserveWhitespace: i.oneOf([!0, !1, "full"]),
331
- onMount: i.func,
332
- onFocus: i.func,
333
- onBlur: i.func,
334
- onChange: i.func,
335
- onPasteHtml: i.func,
336
- onExecute: i.func,
337
- onIFrameInit: i.func
338
- };
339
- let C = _;
340
- rt(C);
333
+ G.displayName = "KendoReactEditor";
341
334
  export {
342
- C as Editor
335
+ G as Editor
343
336
  };
package/EditorProps.d.ts CHANGED
@@ -7,13 +7,13 @@
7
7
  */
8
8
  import { EditorState, Plugin, Transaction, EditorView, Schema, Node } from '@progress/kendo-editor-common';
9
9
  import { EditorUtils } from './utils/index.js';
10
- import { Editor } from './Editor.js';
10
+ import { EditorHandle } from './Editor.js';
11
11
  import { WebMcpProps } from '@progress/kendo-react-common';
12
12
  interface EditorEvent {
13
13
  /**
14
14
  * An event target.
15
15
  */
16
- target: Editor;
16
+ target: EditorHandle;
17
17
  }
18
18
  /**
19
19
  * Represents the object of the `onChange` Editor event.