@progress/kendo-react-editor 7.2.4-develop.3 → 7.2.4-develop.4
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 +8 -0
- package/Editor.mjs +327 -0
- package/config/defaultStyles.js +229 -0
- package/config/defaultStyles.mjs +235 -0
- package/config/shortcuts.js +8 -0
- package/config/shortcuts.mjs +34 -0
- package/config/toolsSettings.js +8 -0
- package/config/toolsSettings.mjs +549 -0
- package/dialogs/FindReplace.js +8 -0
- package/dialogs/FindReplace.mjs +214 -0
- package/dialogs/index.js +8 -0
- package/dialogs/index.mjs +30 -0
- package/dialogs/insertImage.js +8 -0
- package/dialogs/insertImage.mjs +117 -0
- package/dialogs/insertLink.js +8 -0
- package/dialogs/insertLink.mjs +96 -0
- package/dialogs/viewHtml.js +8 -0
- package/dialogs/viewHtml.mjs +70 -0
- package/dist/cdn/js/kendo-react-editor.js +8 -226
- package/index.d.mts +2943 -5
- package/index.d.ts +2941 -178
- package/index.js +8 -226
- package/index.mjs +165 -4118
- package/messages/index.js +8 -0
- package/messages/index.mjs +345 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +11 -11
- package/tools/align.js +8 -0
- package/tools/align.mjs +38 -0
- package/tools/applyColor.js +8 -0
- package/tools/applyColor.mjs +34 -0
- package/tools/cleanFormatting.js +8 -0
- package/tools/cleanFormatting.mjs +41 -0
- package/tools/findReplace.js +8 -0
- package/tools/findReplace.mjs +53 -0
- package/tools/fontStyle.js +8 -0
- package/tools/fontStyle.mjs +61 -0
- package/tools/formatBlock.js +8 -0
- package/tools/formatBlock.mjs +60 -0
- package/tools/history.js +8 -0
- package/tools/history.mjs +17 -0
- package/tools/indent.js +8 -0
- package/tools/indent.mjs +43 -0
- package/tools/index.js +8 -0
- package/tools/index.mjs +278 -0
- package/tools/inlineFormat.js +8 -0
- package/tools/inlineFormat.mjs +43 -0
- package/tools/insertImage.js +8 -0
- package/tools/insertImage.mjs +58 -0
- package/tools/insertLink.js +8 -0
- package/tools/insertLink.mjs +61 -0
- package/tools/insertTable/popup.js +8 -0
- package/tools/insertTable/popup.mjs +94 -0
- package/tools/insertTable/popupGrid.js +8 -0
- package/tools/insertTable/popupGrid.mjs +58 -0
- package/tools/insertTable/tool.js +8 -0
- package/tools/insertTable/tool.mjs +73 -0
- package/tools/lists-styled.js +8 -0
- package/tools/lists-styled.mjs +61 -0
- package/tools/lists.js +8 -0
- package/tools/lists.mjs +47 -0
- package/tools/outdent.js +8 -0
- package/tools/outdent.mjs +43 -0
- package/tools/pdf.js +8 -0
- package/tools/pdf.mjs +36 -0
- package/tools/print.js +8 -0
- package/tools/print.mjs +38 -0
- package/tools/proseMirrorTool.js +8 -0
- package/tools/proseMirrorTool.mjs +37 -0
- package/tools/selectAll.js +8 -0
- package/tools/selectAll.mjs +36 -0
- package/tools/table-wizard/cellPropsUtils.js +8 -0
- package/tools/table-wizard/cellPropsUtils.mjs +124 -0
- package/tools/table-wizard/tableCellProperties.js +8 -0
- package/tools/table-wizard/tableCellProperties.mjs +238 -0
- package/tools/table-wizard/tableProperties.js +8 -0
- package/tools/table-wizard/tableProperties.mjs +292 -0
- package/tools/table-wizard/tablePropsUtils.js +8 -0
- package/tools/table-wizard/tablePropsUtils.mjs +288 -0
- package/tools/table-wizard/utils.js +8 -0
- package/tools/table-wizard/utils.mjs +91 -0
- package/tools/tableEdit.js +8 -0
- package/tools/tableEdit.mjs +36 -0
- package/tools/unlink.js +8 -0
- package/tools/unlink.mjs +41 -0
- package/tools/utils.js +8 -0
- package/tools/utils.mjs +51 -0
- package/tools/viewHtml.js +8 -0
- package/tools/viewHtml.mjs +57 -0
- package/utils/browser-detection.js +8 -0
- package/utils/browser-detection.mjs +12 -0
- package/utils/controlled-value.js +8 -0
- package/utils/controlled-value.mjs +19 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +162 -0
- package/utils/props-key.js +8 -0
- package/utils/props-key.mjs +13 -0
- package/Editor.d.ts +0 -122
- package/EditorProps.d.ts +0 -200
- package/config/defaultStyles.d.ts +0 -16
- package/config/pasteSettings.d.ts +0 -10
- package/config/schema.d.ts +0 -5
- package/config/shortcuts.d.ts +0 -28
- package/config/toolsSettings.d.ts +0 -493
- package/dialogs/EditorDialogProps.d.ts +0 -30
- package/dialogs/FindReplace.d.ts +0 -75
- package/dialogs/index.d.ts +0 -53
- package/dialogs/insertImage.d.ts +0 -32
- package/dialogs/insertLink.d.ts +0 -30
- package/dialogs/viewHtml.d.ts +0 -29
- package/messages/index.d.ts +0 -338
- package/package-metadata.d.ts +0 -9
- package/tools/ToolProps.d.ts +0 -41
- package/tools/align.d.ts +0 -11
- package/tools/applyColor.d.ts +0 -16
- package/tools/cleanFormatting.d.ts +0 -20
- package/tools/findReplace.d.ts +0 -33
- package/tools/fontStyle.d.ts +0 -32
- package/tools/formatBlock.d.ts +0 -22
- package/tools/history.d.ts +0 -30
- package/tools/indent.d.ts +0 -21
- package/tools/index.d.ts +0 -718
- package/tools/inlineFormat.d.ts +0 -51
- package/tools/insertImage.d.ts +0 -17
- package/tools/insertLink.d.ts +0 -28
- package/tools/insertTable/index.d.ts +0 -7
- package/tools/insertTable/popup.d.ts +0 -97
- package/tools/insertTable/popupGrid.d.ts +0 -35
- package/tools/insertTable/tool.d.ts +0 -28
- package/tools/lists-styled.d.ts +0 -8
- package/tools/lists.d.ts +0 -31
- package/tools/outdent.d.ts +0 -21
- package/tools/pdf.d.ts +0 -29
- package/tools/print.d.ts +0 -20
- package/tools/proseMirrorTool.d.ts +0 -16
- package/tools/selectAll.d.ts +0 -20
- package/tools/table-wizard/cellPropsUtils.d.ts +0 -40
- package/tools/table-wizard/tableCellProperties.d.ts +0 -24
- package/tools/table-wizard/tableProperties.d.ts +0 -15
- package/tools/table-wizard/tablePropsUtils.d.ts +0 -56
- package/tools/table-wizard/utils.d.ts +0 -43
- package/tools/tableEdit.d.ts +0 -102
- package/tools/unlink.d.ts +0 -21
- package/tools/utils.d.ts +0 -54
- package/tools/viewHtml.d.ts +0 -28
- package/utils/browser-detection.d.ts +0 -8
- package/utils/controlled-value.d.ts +0 -9
- package/utils/index.d.ts +0 -367
- package/utils/props-key.d.ts +0 -9
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { Button as u } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { Window as B } from "@progress/kendo-react-dialogs";
|
|
12
|
+
import { TabStrip as K, TabStripTab as b } from "@progress/kendo-react-layout";
|
|
13
|
+
import { provideLocalizationService as O, registerForLocalization as U } from "@progress/kendo-react-intl";
|
|
14
|
+
import { messages as l } from "../messages/index.mjs";
|
|
15
|
+
import { EditorToolsSettings as P } from "../config/toolsSettings.mjs";
|
|
16
|
+
import { formatString as q } from "../tools/utils.mjs";
|
|
17
|
+
import { TextSelection as C, find as V, replace as j, replaceAll as H, findAll as _, selectedLineTextOnly as $, textHighlightKey as G } from "@progress/kendo-editor-common";
|
|
18
|
+
import { IconWrap as T } from "@progress/kendo-react-common";
|
|
19
|
+
import { Checkbox as x, Input as y } from "@progress/kendo-react-inputs";
|
|
20
|
+
import { Form as F, FormElement as M, FieldWrapper as N } from "@progress/kendo-react-form";
|
|
21
|
+
import { chevronLeftIcon as J, chevronRightIcon as Q } from "@progress/kendo-svg-icons";
|
|
22
|
+
const X = 13, Y = 27, Z = P.findAndReplace;
|
|
23
|
+
let ee = class extends e.Component {
|
|
24
|
+
constructor(o) {
|
|
25
|
+
super(o), this.onTabSelect = (t) => {
|
|
26
|
+
this.setState({ selectedTab: t.selected });
|
|
27
|
+
}, this.onClose = () => {
|
|
28
|
+
const t = this.props.view, a = t.state, n = a.tr.setSelection(C.create(a.doc, a.selection.from, a.selection.to));
|
|
29
|
+
t.updateState(a.apply(n)), t.focus(), this.props.onClose.call(void 0);
|
|
30
|
+
}, this.matchesMessage = (t) => {
|
|
31
|
+
const a = this.state.matches, n = this.state.nextMatch;
|
|
32
|
+
let s = 0, i = 0;
|
|
33
|
+
if (a && n) {
|
|
34
|
+
const c = a.findIndex((r) => r.eq(n));
|
|
35
|
+
s = c === -1 ? a.length : c + 1, i = a.length;
|
|
36
|
+
}
|
|
37
|
+
return q(t, s, i);
|
|
38
|
+
}, this.onFindNext = () => {
|
|
39
|
+
this.onFind();
|
|
40
|
+
}, this.onFindPrev = () => {
|
|
41
|
+
this.onFind(!0);
|
|
42
|
+
}, this.onFind = (t = !1) => {
|
|
43
|
+
const a = this.props.view, { searchText: n, matchCase: s, matchCyclic: i, matchWord: c, useRegExp: r } = this.state, h = { text: n, matchWord: c, matchCase: s, useRegExp: r, backward: t, matchCyclic: i }, m = V(a.state, h);
|
|
44
|
+
if (m) {
|
|
45
|
+
const d = a.state.tr.setSelection(m);
|
|
46
|
+
d.scrollIntoView(), a.updateState(a.state.apply(d)), this.setState({ nextMatch: m });
|
|
47
|
+
}
|
|
48
|
+
}, this.onReplace = () => {
|
|
49
|
+
const t = this.props.view, a = t.state.selection, { replaceText: n } = this.state;
|
|
50
|
+
if (!a.empty) {
|
|
51
|
+
const s = a.from, i = s + n.length, c = j(a, n, t.state.tr);
|
|
52
|
+
c.setSelection(C.create(c.doc, s, i)), c.scrollIntoView(), t.dispatch(c), this.setNextState({});
|
|
53
|
+
}
|
|
54
|
+
}, this.onReplaceAll = () => {
|
|
55
|
+
const t = this.props.view, { searchText: a, replaceText: n, matchCase: s, matchWord: i, useRegExp: c } = this.state, r = { text: a, matchWord: i, matchCase: s, useRegExp: c }, h = H(t.state, n, r);
|
|
56
|
+
h && t.dispatch(h), this.setNextState({});
|
|
57
|
+
}, this.onKeyDown = (t) => {
|
|
58
|
+
t.keyCode === X ? this.onFindNext() : t.keyCode === Y && this.onClose();
|
|
59
|
+
}, this.onMatchCaseChecked = (t) => this.setNextState({ matchCase: t.value }), this.onMatchWordChecked = (t) => this.setNextState({ matchWord: t.value }), this.onMatchCyclicChecked = (t) => this.setNextState({ matchCyclic: t.value }), this.onUseRegExpChecked = (t) => this.setNextState({ useRegExp: t.value }), this.onSearchChange = (t) => this.setNextState({ searchText: t.target.value }), this.onReplaceChange = (t) => this.setNextState({ replaceText: t.target.value }), this.setNextState = (t) => {
|
|
60
|
+
const a = { ...this.state, ...t, matches: void 0, nextMatch: void 0 }, n = this.props.view;
|
|
61
|
+
if (a.searchText) {
|
|
62
|
+
const { searchText: s, matchWord: i, matchCase: c, useRegExp: r, matchCyclic: h } = a, m = { text: s, matchWord: i, matchCase: c, useRegExp: r }, d = n.state.selection, p = _(n.state.doc, m);
|
|
63
|
+
let g = !this.state.searchText && p[0] || p.find((f) => f.from >= d.from) || h && p[0] || void 0;
|
|
64
|
+
this.setState({
|
|
65
|
+
...a,
|
|
66
|
+
matches: p,
|
|
67
|
+
nextMatch: g
|
|
68
|
+
});
|
|
69
|
+
} else
|
|
70
|
+
this.setState(a);
|
|
71
|
+
}, this.state = {
|
|
72
|
+
selectedTab: 0,
|
|
73
|
+
searchText: $(o.view.state),
|
|
74
|
+
replaceText: "",
|
|
75
|
+
matchCase: !1,
|
|
76
|
+
matchWord: !1,
|
|
77
|
+
matchCyclic: !1,
|
|
78
|
+
useRegExp: !1
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
get settings() {
|
|
82
|
+
return this.props.settings || Z;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @hidden
|
|
86
|
+
*/
|
|
87
|
+
componentDidUpdate(o, t) {
|
|
88
|
+
const a = this.props.view, { matches: n = [], nextMatch: s } = this.state;
|
|
89
|
+
if (t.nextMatch !== s) {
|
|
90
|
+
const i = a.state, c = i.tr, r = [];
|
|
91
|
+
n.forEach((h) => {
|
|
92
|
+
r.push({
|
|
93
|
+
from: h.from,
|
|
94
|
+
to: h.to,
|
|
95
|
+
attrs: {
|
|
96
|
+
class: s && h.eq(s) ? "k-text-selected" : "k-text-highlighted"
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}), c.setMeta(G, r), c.setSelection(s || C.create(i.doc, i.selection.from)), a.dispatch(c);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @hidden
|
|
104
|
+
*/
|
|
105
|
+
render() {
|
|
106
|
+
const o = O(this), {
|
|
107
|
+
findReplaceDialogTitle: t,
|
|
108
|
+
findReplaceTabFind: a,
|
|
109
|
+
findReplaceTabReplace: n,
|
|
110
|
+
findReplaceFindWhat: s,
|
|
111
|
+
findReplaceReplaceWith: i,
|
|
112
|
+
findReplaceReplace: c,
|
|
113
|
+
findReplaceReplaceAll: r,
|
|
114
|
+
findReplaceMatchCase: h,
|
|
115
|
+
findReplaceMatchWord: m,
|
|
116
|
+
findReplaceMatchCyclic: d,
|
|
117
|
+
findReplaceUseRegExp: p,
|
|
118
|
+
findReplacePrevMatch: g,
|
|
119
|
+
findReplaceNextMatch: f,
|
|
120
|
+
findReplaceMatches: E
|
|
121
|
+
} = this.settings.messages, { matchCase: w, matchWord: W, matchCyclic: L, useRegExp: A, searchText: z, replaceText: D, nextMatch: S } = this.state, k = /* @__PURE__ */ e.createElement("div", { className: "k-search-options" }, /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement(x, { id: "match-case", checked: w, onChange: this.onMatchCaseChecked }), /* @__PURE__ */ e.createElement("label", { htmlFor: "match-case", className: "k-checkbox-label" }, o.toLanguageString(h, l[h]))), /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement(x, { id: "match-whole", checked: W, onChange: this.onMatchWordChecked }), /* @__PURE__ */ e.createElement("label", { htmlFor: "match-whole", className: "k-checkbox-label" }, o.toLanguageString(m, l[m]))), /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement(x, { id: "match-cyclic", checked: L, onChange: this.onMatchCyclicChecked }), /* @__PURE__ */ e.createElement("label", { htmlFor: "match-cyclic", className: "k-checkbox-label" }, o.toLanguageString(d, l[d]))), /* @__PURE__ */ e.createElement("span", null, /* @__PURE__ */ e.createElement(x, { id: "regular-expression", checked: A, onChange: this.onUseRegExpChecked }), /* @__PURE__ */ e.createElement("label", { htmlFor: "regular-expression", className: "k-checkbox-label" }, o.toLanguageString(p, l[p])))), R = /* @__PURE__ */ e.createElement("div", { className: "k-matches-container" }, /* @__PURE__ */ e.createElement(
|
|
122
|
+
u,
|
|
123
|
+
{
|
|
124
|
+
fillMode: "flat",
|
|
125
|
+
themeColor: "primary",
|
|
126
|
+
onClick: this.onFindPrev
|
|
127
|
+
},
|
|
128
|
+
/* @__PURE__ */ e.createElement(T, { name: "chevron-left", icon: J }),
|
|
129
|
+
o.toLanguageString(g, l[g])
|
|
130
|
+
), /* @__PURE__ */ e.createElement("span", null, this.matchesMessage(o.toLanguageString(E, l[E]))), /* @__PURE__ */ e.createElement(
|
|
131
|
+
u,
|
|
132
|
+
{
|
|
133
|
+
fillMode: "flat",
|
|
134
|
+
themeColor: "primary",
|
|
135
|
+
onClick: this.onFindNext
|
|
136
|
+
},
|
|
137
|
+
o.toLanguageString(f, l[f]),
|
|
138
|
+
/* @__PURE__ */ e.createElement(T, { name: "chevron-right", icon: Q })
|
|
139
|
+
)), v = /* @__PURE__ */ e.createElement(
|
|
140
|
+
F,
|
|
141
|
+
{
|
|
142
|
+
render: () => /* @__PURE__ */ e.createElement(M, { horizontal: !0 }, /* @__PURE__ */ e.createElement(N, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "findWhat", className: "k-form-label" }, o.toLanguageString(s, l[s])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
143
|
+
y,
|
|
144
|
+
{
|
|
145
|
+
id: "findWhat",
|
|
146
|
+
type: "text",
|
|
147
|
+
value: z,
|
|
148
|
+
onChange: this.onSearchChange,
|
|
149
|
+
onFocus: this.onSearchChange,
|
|
150
|
+
onKeyDown: this.onKeyDown,
|
|
151
|
+
autoFocus: !0
|
|
152
|
+
}
|
|
153
|
+
))))
|
|
154
|
+
}
|
|
155
|
+
), I = /* @__PURE__ */ e.createElement(
|
|
156
|
+
F,
|
|
157
|
+
{
|
|
158
|
+
render: () => /* @__PURE__ */ e.createElement(M, { horizontal: !0 }, /* @__PURE__ */ e.createElement(N, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "replaceWith", className: "k-form-label" }, o.toLanguageString(i, l[i])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
159
|
+
y,
|
|
160
|
+
{
|
|
161
|
+
id: "replaceWith",
|
|
162
|
+
type: "text",
|
|
163
|
+
value: D,
|
|
164
|
+
onChange: this.onReplaceChange
|
|
165
|
+
}
|
|
166
|
+
))))
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
return /* @__PURE__ */ e.createElement(
|
|
170
|
+
B,
|
|
171
|
+
{
|
|
172
|
+
title: o.toLanguageString(t, l[t]),
|
|
173
|
+
onClose: this.onClose,
|
|
174
|
+
style: { width: "auto", height: "auto", userSelect: "none" },
|
|
175
|
+
resizable: !1,
|
|
176
|
+
minimizeButton: () => null,
|
|
177
|
+
maximizeButton: () => null
|
|
178
|
+
},
|
|
179
|
+
/* @__PURE__ */ e.createElement(
|
|
180
|
+
K,
|
|
181
|
+
{
|
|
182
|
+
selected: this.state.selectedTab,
|
|
183
|
+
className: "k-editor-find-replace",
|
|
184
|
+
onSelect: this.onTabSelect,
|
|
185
|
+
animation: !1
|
|
186
|
+
},
|
|
187
|
+
/* @__PURE__ */ e.createElement(
|
|
188
|
+
b,
|
|
189
|
+
{
|
|
190
|
+
title: o.toLanguageString(a, l[a])
|
|
191
|
+
},
|
|
192
|
+
v,
|
|
193
|
+
k,
|
|
194
|
+
R
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ e.createElement(
|
|
197
|
+
b,
|
|
198
|
+
{
|
|
199
|
+
title: o.toLanguageString(n, l[n])
|
|
200
|
+
},
|
|
201
|
+
v,
|
|
202
|
+
I,
|
|
203
|
+
/* @__PURE__ */ e.createElement("div", { className: "k-actions k-hstack k-justify-content-end" }, /* @__PURE__ */ e.createElement(u, { disabled: !S, onClick: this.onReplace }, o.toLanguageString(c, l[c])), /* @__PURE__ */ e.createElement(u, { disabled: !S, onClick: this.onReplaceAll }, o.toLanguageString(r, l[r]))),
|
|
204
|
+
k,
|
|
205
|
+
R
|
|
206
|
+
)
|
|
207
|
+
)
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
U(ee);
|
|
212
|
+
export {
|
|
213
|
+
ee as FindAndReplaceDialog
|
|
214
|
+
};
|
package/dialogs/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./insertLink.js"),o=require("./insertImage.js"),r=require("./viewHtml.js"),g=require("./FindReplace.js");exports.EditorDialogs=void 0;(e=>{class n extends a.InsertLinkDialog{}e.InsertLinkDialog=n;class l extends o.InsertImageDialog{}e.InsertImageDialog=l;class s extends r.ViewHtmlDialog{}e.ViewHtmlDialog=s;class t extends g.FindAndReplaceDialog{}e.FindAndReplaceDialog=t})(exports.EditorDialogs||(exports.EditorDialogs={}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { InsertLinkDialog as t } from "./insertLink.mjs";
|
|
10
|
+
import { InsertImageDialog as g } from "./insertImage.mjs";
|
|
11
|
+
import { ViewHtmlDialog as m } from "./viewHtml.mjs";
|
|
12
|
+
import { FindAndReplaceDialog as r } from "./FindReplace.mjs";
|
|
13
|
+
var i;
|
|
14
|
+
((e) => {
|
|
15
|
+
class l extends t {
|
|
16
|
+
}
|
|
17
|
+
e.InsertLinkDialog = l;
|
|
18
|
+
class n extends g {
|
|
19
|
+
}
|
|
20
|
+
e.InsertImageDialog = n;
|
|
21
|
+
class s extends m {
|
|
22
|
+
}
|
|
23
|
+
e.ViewHtmlDialog = s;
|
|
24
|
+
class o extends r {
|
|
25
|
+
}
|
|
26
|
+
e.FindAndReplaceDialog = o;
|
|
27
|
+
})(i || (i = {}));
|
|
28
|
+
export {
|
|
29
|
+
i as EditorDialogs
|
|
30
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),F=require("@progress/kendo-react-dialogs"),N=require("@progress/kendo-react-buttons"),C=require("@progress/kendo-editor-common"),S=require("@progress/kendo-react-intl"),s=require("../messages/index.js"),f=require("@progress/kendo-react-inputs"),m=require("@progress/kendo-react-form");function T(d){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const a in d)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(d,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>d[a]})}}return t.default=d,Object.freeze(t)}const e=T(L);let x=class extends e.Component{constructor(){super(...arguments),this.src=null,this.altText=null,this.title=null,this.width=null,this.height=null,this.onClose=()=>{this.props.view.focus(),this.props.onClose()},this.onInsert=()=>{const{view:t,settings:a}=this.props,k=t.state.schema.nodes[a.node],o={src:this.src?this.src.value:null,title:this.title?this.title.value:null,alt:this.altText?this.altText.value:null,width:this.width?this.width.value:null,height:this.height?this.height.value:null},g=Object.keys(o).filter(i=>o[i]!==null&&o[i]!=="").reduce((i,c)=>Object.assign(i,{[c]:o[c]}),{}),h=k.createAndFill(g);h&&C.insertNode(h,!0)(t.state,c=>t.dispatch(c.setMeta("commandName",a.commandName).setMeta("args",g))),this.onClose()}}render(){const{view:t,settings:a,dir:r,render:k}=this.props,{insertImageDialogTitle:o,insertImageAddress:g,insertImageTitle:h,insertImageAltText:i,insertImageWidth:c,insertImageHeight:E,insertImageCancel:I,insertImageInsert:w}=a.messages,n=S.provideLocalizationService(this),p=t&&t.state;let u={};p&&p.selection instanceof C.NodeSelection&&p.selection.node.type===p.schema.nodes[a.node]&&(u=p.selection.node.attrs);const b=e.createElement(m.Form,{render:()=>e.createElement(m.FormElement,{horizontal:!0},e.createElement(m.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-image-url",className:"k-form-label"},n.toLanguageString(g,s.messages[g])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(f.Input,{type:"text",id:"k-editor-image-url",defaultValue:u.src,ref:l=>this.src=l,autoFocus:!0}))),e.createElement(m.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-image-url",className:"k-form-label"},n.toLanguageString(i,s.messages[i])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(f.Input,{type:"text",id:"k-editor-image-alt",defaultValue:u.alt,ref:l=>this.altText=l}))),e.createElement(m.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-image-title",className:"k-form-label"},n.toLanguageString(h,s.messages[h])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(f.Input,{type:"text",id:"k-editor-image-title",defaultValue:u.title,ref:l=>this.title=l}))),e.createElement(m.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-image-width",className:"k-form-label"},n.toLanguageString(c,s.messages[c])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(f.Input,{type:"text",id:"k-editor-image-width",defaultValue:u.width,ref:l=>this.width=l}))),e.createElement(m.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-image-height",className:"k-form-label"},n.toLanguageString(E,s.messages[E])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(f.Input,{id:"k-editor-image-height",defaultValue:u.height,ref:l=>this.height=l}))))}),v=[e.createElement(N.Button,{onClick:this.onClose,dir:r,key:"cancel"},n.toLanguageString(I,s.messages[I])),e.createElement(N.Button,{onClick:this.onInsert,themeColor:"primary",dir:r,key:"insert"},n.toLanguageString(w,s.messages[w]))],y=e.createElement(F.Window,{initialWidth:500,initialHeight:350,className:"k-editor-window",title:n.toLanguageString(o,s.messages[o]),onClose:this.onClose,key:"dialog",style:r==="rtl"?{textAlign:"right"}:void 0,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},b,e.createElement(F.WindowActionsBar,null,...v));return k?k(y,{content:b,actionButtons:v}):y}};S.registerForLocalization(x);exports.InsertImageDialog=x;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { Window as x, WindowActionsBar as C } from "@progress/kendo-react-dialogs";
|
|
11
|
+
import { Button as b } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { insertNode as y, NodeSelection as F } from "@progress/kendo-editor-common";
|
|
13
|
+
import { provideLocalizationService as L, registerForLocalization as S } from "@progress/kendo-react-intl";
|
|
14
|
+
import { messages as a } from "../messages/index.mjs";
|
|
15
|
+
import { Input as h } from "@progress/kendo-react-inputs";
|
|
16
|
+
import { Form as T, FormElement as z, FieldWrapper as u } from "@progress/kendo-react-form";
|
|
17
|
+
let A = class extends e.Component {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.src = null, this.altText = null, this.title = null, this.width = null, this.height = null, this.onClose = () => {
|
|
20
|
+
this.props.view.focus(), this.props.onClose();
|
|
21
|
+
}, this.onInsert = () => {
|
|
22
|
+
const { view: s, settings: m } = this.props, p = s.state.schema.nodes[m.node], n = {
|
|
23
|
+
src: this.src ? this.src.value : null,
|
|
24
|
+
title: this.title ? this.title.value : null,
|
|
25
|
+
alt: this.altText ? this.altText.value : null,
|
|
26
|
+
width: this.width ? this.width.value : null,
|
|
27
|
+
height: this.height ? this.height.value : null
|
|
28
|
+
}, c = Object.keys(n).filter((l) => n[l] !== null && n[l] !== "").reduce((l, r) => Object.assign(l, { [r]: n[r] }), {}), d = p.createAndFill(c);
|
|
29
|
+
d && y(d, !0)(s.state, (r) => s.dispatch(r.setMeta("commandName", m.commandName).setMeta("args", c))), this.onClose();
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
render() {
|
|
36
|
+
const { view: s, settings: m, dir: f, render: p } = this.props, {
|
|
37
|
+
insertImageDialogTitle: n,
|
|
38
|
+
insertImageAddress: c,
|
|
39
|
+
insertImageTitle: d,
|
|
40
|
+
insertImageAltText: l,
|
|
41
|
+
insertImageWidth: r,
|
|
42
|
+
insertImageHeight: E,
|
|
43
|
+
insertImageCancel: k,
|
|
44
|
+
insertImageInsert: w
|
|
45
|
+
} = m.messages, i = L(this), g = s && s.state;
|
|
46
|
+
let o = {};
|
|
47
|
+
g && g.selection instanceof F && g.selection.node.type === g.schema.nodes[m.node] && (o = g.selection.node.attrs);
|
|
48
|
+
const I = /* @__PURE__ */ e.createElement(
|
|
49
|
+
T,
|
|
50
|
+
{
|
|
51
|
+
render: () => /* @__PURE__ */ e.createElement(z, { horizontal: !0 }, /* @__PURE__ */ e.createElement(u, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-image-url", className: "k-form-label" }, i.toLanguageString(c, a[c])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
52
|
+
h,
|
|
53
|
+
{
|
|
54
|
+
type: "text",
|
|
55
|
+
id: "k-editor-image-url",
|
|
56
|
+
defaultValue: o.src,
|
|
57
|
+
ref: (t) => this.src = t,
|
|
58
|
+
autoFocus: !0
|
|
59
|
+
}
|
|
60
|
+
))), /* @__PURE__ */ e.createElement(u, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-image-url", className: "k-form-label" }, i.toLanguageString(l, a[l])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
61
|
+
h,
|
|
62
|
+
{
|
|
63
|
+
type: "text",
|
|
64
|
+
id: "k-editor-image-alt",
|
|
65
|
+
defaultValue: o.alt,
|
|
66
|
+
ref: (t) => this.altText = t
|
|
67
|
+
}
|
|
68
|
+
))), /* @__PURE__ */ e.createElement(u, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-image-title", className: "k-form-label" }, i.toLanguageString(d, a[d])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
69
|
+
h,
|
|
70
|
+
{
|
|
71
|
+
type: "text",
|
|
72
|
+
id: "k-editor-image-title",
|
|
73
|
+
defaultValue: o.title,
|
|
74
|
+
ref: (t) => this.title = t
|
|
75
|
+
}
|
|
76
|
+
))), /* @__PURE__ */ e.createElement(u, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-image-width", className: "k-form-label" }, i.toLanguageString(r, a[r])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
77
|
+
h,
|
|
78
|
+
{
|
|
79
|
+
type: "text",
|
|
80
|
+
id: "k-editor-image-width",
|
|
81
|
+
defaultValue: o.width,
|
|
82
|
+
ref: (t) => this.width = t
|
|
83
|
+
}
|
|
84
|
+
))), /* @__PURE__ */ e.createElement(u, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-image-height", className: "k-form-label" }, i.toLanguageString(E, a[E])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
85
|
+
h,
|
|
86
|
+
{
|
|
87
|
+
id: "k-editor-image-height",
|
|
88
|
+
defaultValue: o.height,
|
|
89
|
+
ref: (t) => this.height = t
|
|
90
|
+
}
|
|
91
|
+
))))
|
|
92
|
+
}
|
|
93
|
+
), v = [/* @__PURE__ */ e.createElement(b, { onClick: this.onClose, dir: f, key: "cancel" }, i.toLanguageString(k, a[k])), /* @__PURE__ */ e.createElement(b, { onClick: this.onInsert, themeColor: "primary", dir: f, key: "insert" }, i.toLanguageString(w, a[w]))], N = /* @__PURE__ */ e.createElement(
|
|
94
|
+
x,
|
|
95
|
+
{
|
|
96
|
+
initialWidth: 500,
|
|
97
|
+
initialHeight: 350,
|
|
98
|
+
className: "k-editor-window",
|
|
99
|
+
title: i.toLanguageString(n, a[n]),
|
|
100
|
+
onClose: this.onClose,
|
|
101
|
+
key: "dialog",
|
|
102
|
+
style: f === "rtl" ? { textAlign: "right" } : void 0,
|
|
103
|
+
modal: !0,
|
|
104
|
+
minimizeButton: () => null,
|
|
105
|
+
maximizeButton: () => null,
|
|
106
|
+
resizable: !1
|
|
107
|
+
},
|
|
108
|
+
I,
|
|
109
|
+
/* @__PURE__ */ e.createElement(C, null, ...v)
|
|
110
|
+
);
|
|
111
|
+
return p ? p(N, { content: I, actionButtons: v }) : N;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
S(A);
|
|
115
|
+
export {
|
|
116
|
+
A as InsertImageDialog
|
|
117
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),y=require("@progress/kendo-react-dialogs"),C=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-react-inputs"),c=require("@progress/kendo-react-form"),w=require("@progress/kendo-editor-common"),L=require("@progress/kendo-react-intl"),a=require("../messages/index.js");function x(i){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const r in i)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(i,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>i[r]})}}return t.default=i,Object.freeze(t)}const e=x(S);let F=class extends e.Component{constructor(){super(...arguments),this.href=null,this.title=null,this.target=null,this.onClose=()=>{this.props.view.focus(),this.props.onClose()},this.onInsert=()=>{const t=this.props.view,r=this.props.settings.mark,n={href:this.href?this.href.value:void 0,title:this.title?this.title.value:void 0,target:this.target&&this.target.element&&this.target.element.checked?"_blank":void 0};w.applyLink({mark:r,attrs:n},this.props.settings.commandName)(t.state,t.dispatch),this.onClose()}}render(){const{view:t,settings:r,dir:n,render:u}=this.props,s=L.provideLocalizationService(this),{insertHyperlinkDialogTitle:d,insertHyperlinkAddress:g,insertHyperlinkTitle:k,insertHyperlinkNewWindow:h,insertHyperlinkCancel:p,insertHyperlinkInsert:f}=r.messages,l=t?w.getMark(t.state,t.state.schema.marks[r.mark]):!1,v=e.createElement(c.Form,{render:()=>e.createElement(c.FormElement,{horizontal:!0},e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-url",className:"k-form-label"},s.toLanguageString(g,a.messages[g])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(m.Input,{type:"text",id:"k-editor-link-url",ref:o=>this.href=o,defaultValue:l&&l.attrs.href||void 0,autoFocus:!0}))),e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-text",className:"k-form-label"},s.toLanguageString(k,a.messages[k])),e.createElement("div",{className:"k-form-field-wrap"},e.createElement(m.Input,{type:"text",id:"k-editor-link-text",ref:o=>this.title=o,defaultValue:l&&l.attrs.title||void 0}))),r.linkTarget!==!1&&e.createElement(c.FieldWrapper,null,e.createElement("label",{htmlFor:"k-editor-link-target",className:"k-checkbox-label"},e.createElement(m.Checkbox,{id:"k-editor-link-target",ref:o=>this.target=o,defaultChecked:l&&!!l.attrs.target||void 0}),s.toLanguageString(h,a.messages[h]))))}),E=[e.createElement(C.Button,{onClick:this.onClose,dir:n,key:"cancel"},s.toLanguageString(p,a.messages[p])),e.createElement(C.Button,{onClick:this.onInsert,themeColor:"primary",dir:n,key:"insert"},s.toLanguageString(f,a.messages[f]))],b=e.createElement(y.Window,{initialWidth:450,initialHeight:250,className:"k-editor-window",title:s.toLanguageString(d,a.messages[d]),onClose:this.onClose,style:n==="rtl"?{textAlign:"right"}:void 0,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!1},v,e.createElement(y.WindowActionsBar,null,...E));return u?u(b,{content:v,actionButtons:E}):b}};L.registerForLocalization(F);exports.InsertLinkDialog=F;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { Window as C, WindowActionsBar as w } from "@progress/kendo-react-dialogs";
|
|
11
|
+
import { Button as v } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { Input as y, Checkbox as L } from "@progress/kendo-react-inputs";
|
|
13
|
+
import { Form as b, FormElement as x, FieldWrapper as s } from "@progress/kendo-react-form";
|
|
14
|
+
import { applyLink as F, getMark as N } from "@progress/kendo-editor-common";
|
|
15
|
+
import { provideLocalizationService as z, registerForLocalization as H } from "@progress/kendo-react-intl";
|
|
16
|
+
import { messages as l } from "../messages/index.mjs";
|
|
17
|
+
let I = class extends e.Component {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.href = null, this.title = null, this.target = null, this.onClose = () => {
|
|
20
|
+
this.props.view.focus(), this.props.onClose();
|
|
21
|
+
}, this.onInsert = () => {
|
|
22
|
+
const t = this.props.view, n = this.props.settings.mark, a = {
|
|
23
|
+
href: this.href ? this.href.value : void 0,
|
|
24
|
+
title: this.title ? this.title.value : void 0,
|
|
25
|
+
target: this.target && this.target.element && this.target.element.checked ? "_blank" : void 0
|
|
26
|
+
};
|
|
27
|
+
F({ mark: n, attrs: a }, this.props.settings.commandName)(t.state, t.dispatch), this.onClose();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
render() {
|
|
34
|
+
const { view: t, settings: n, dir: a, render: m } = this.props, i = z(this), {
|
|
35
|
+
insertHyperlinkDialogTitle: c,
|
|
36
|
+
insertHyperlinkAddress: h,
|
|
37
|
+
insertHyperlinkTitle: k,
|
|
38
|
+
insertHyperlinkNewWindow: d,
|
|
39
|
+
insertHyperlinkCancel: g,
|
|
40
|
+
insertHyperlinkInsert: p
|
|
41
|
+
} = n.messages, r = t ? N(t.state, t.state.schema.marks[n.mark]) : !1, u = /* @__PURE__ */ e.createElement(
|
|
42
|
+
b,
|
|
43
|
+
{
|
|
44
|
+
render: () => /* @__PURE__ */ e.createElement(x, { horizontal: !0 }, /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-url", className: "k-form-label" }, i.toLanguageString(h, l[h])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
45
|
+
y,
|
|
46
|
+
{
|
|
47
|
+
type: "text",
|
|
48
|
+
id: "k-editor-link-url",
|
|
49
|
+
ref: (o) => this.href = o,
|
|
50
|
+
defaultValue: r && r.attrs.href || void 0,
|
|
51
|
+
autoFocus: !0
|
|
52
|
+
}
|
|
53
|
+
))), /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-text", className: "k-form-label" }, i.toLanguageString(k, l[k])), /* @__PURE__ */ e.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ e.createElement(
|
|
54
|
+
y,
|
|
55
|
+
{
|
|
56
|
+
type: "text",
|
|
57
|
+
id: "k-editor-link-text",
|
|
58
|
+
ref: (o) => this.title = o,
|
|
59
|
+
defaultValue: r && r.attrs.title || void 0
|
|
60
|
+
}
|
|
61
|
+
))), n.linkTarget !== !1 && /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement("label", { htmlFor: "k-editor-link-target", className: "k-checkbox-label" }, /* @__PURE__ */ e.createElement(
|
|
62
|
+
L,
|
|
63
|
+
{
|
|
64
|
+
id: "k-editor-link-target",
|
|
65
|
+
ref: (o) => this.target = o,
|
|
66
|
+
defaultChecked: r && !!r.attrs.target || void 0
|
|
67
|
+
}
|
|
68
|
+
), i.toLanguageString(d, l[d]))))
|
|
69
|
+
}
|
|
70
|
+
), f = [
|
|
71
|
+
/* @__PURE__ */ e.createElement(v, { onClick: this.onClose, dir: a, key: "cancel" }, i.toLanguageString(g, l[g])),
|
|
72
|
+
/* @__PURE__ */ e.createElement(v, { onClick: this.onInsert, themeColor: "primary", dir: a, key: "insert" }, i.toLanguageString(p, l[p]))
|
|
73
|
+
], E = /* @__PURE__ */ e.createElement(
|
|
74
|
+
C,
|
|
75
|
+
{
|
|
76
|
+
initialWidth: 450,
|
|
77
|
+
initialHeight: 250,
|
|
78
|
+
className: "k-editor-window",
|
|
79
|
+
title: i.toLanguageString(c, l[c]),
|
|
80
|
+
onClose: this.onClose,
|
|
81
|
+
style: a === "rtl" ? { textAlign: "right" } : void 0,
|
|
82
|
+
modal: !0,
|
|
83
|
+
minimizeButton: () => null,
|
|
84
|
+
maximizeButton: () => null,
|
|
85
|
+
resizable: !1
|
|
86
|
+
},
|
|
87
|
+
u,
|
|
88
|
+
/* @__PURE__ */ e.createElement(w, null, ...f)
|
|
89
|
+
);
|
|
90
|
+
return m ? m(E, { content: u, actionButtons: f }) : E;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
H(I);
|
|
94
|
+
export {
|
|
95
|
+
I as InsertLinkDialog
|
|
96
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),h=require("@progress/kendo-react-dialogs"),f=require("@progress/kendo-react-buttons"),r=require("@progress/kendo-editor-common"),w=require("@progress/kendo-react-intl"),l=require("../messages/index.js"),y=require("../utils/props-key.js"),C=require("@progress/kendo-react-inputs");function A(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const i=A(v);let k=class extends i.Component{constructor(){super(...arguments),this.htmlArea=null,this.textAreaRef=e=>{this.htmlArea=e;const t=e&&e.element.current;t&&(t.style.resize="none")},this.onUpdate=()=>{const{view:e,settings:t}=this.props,o=r.trimWhitespace(this.htmlArea&&this.htmlArea.value||""),{preserveWhitespace:s}=y.editorPropsKey.getState(e.state);r.setHtml(o,t.commandName,{preserveWhitespace:s})(e.state,e.dispatch),this.onClose()},this.onClose=()=>{this.props.view.focus(),this.props.onClose()}}render(){const{view:e,settings:t,dir:o,render:s}=this.props,a=w.provideLocalizationService(this),{viewHtmlDialogTitle:c,viewHtmlCancel:u,viewHtmlUpdate:m}=t.messages,d=i.createElement(C.TextArea,{className:"k-editor-textarea",defaultValue:r.indentHtml(r.getHtml(e.state)),autoFocus:!0,autoSize:!1,ref:this.textAreaRef}),g=[i.createElement(f.Button,{onClick:this.onClose,dir:o,key:"cancel"},a.toLanguageString(u,l.messages[u])),i.createElement(f.Button,{onClick:this.onUpdate,themeColor:"primary",dir:o,key:"update"},a.toLanguageString(m,l.messages[m]))],p=i.createElement(h.Window,{className:"k-editor-window",title:a.toLanguageString(c,l.messages[c]),onClose:this.onClose,key:"dialog",style:o==="rtl"?{textAlign:"right"}:void 0,modal:!0,minimizeButton:()=>null,maximizeButton:()=>null,resizable:!0,initialHeight:400,initialWidth:500},d,i.createElement(h.WindowActionsBar,null,...g));return s?s(p,{content:d,actionButtons:g}):p}};w.registerForLocalization(k);exports.ViewHtmlDialog=k;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as i from "react";
|
|
10
|
+
import { Window as g, WindowActionsBar as d } from "@progress/kendo-react-dialogs";
|
|
11
|
+
import { Button as u } from "@progress/kendo-react-buttons";
|
|
12
|
+
import { trimWhitespace as f, setHtml as w, indentHtml as v, getHtml as C } from "@progress/kendo-editor-common";
|
|
13
|
+
import { provideLocalizationService as A, registerForLocalization as H } from "@progress/kendo-react-intl";
|
|
14
|
+
import { messages as r } from "../messages/index.mjs";
|
|
15
|
+
import { editorPropsKey as x } from "../utils/props-key.mjs";
|
|
16
|
+
import { TextArea as z } from "@progress/kendo-react-inputs";
|
|
17
|
+
let k = class extends i.Component {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.htmlArea = null, this.textAreaRef = (t) => {
|
|
20
|
+
this.htmlArea = t;
|
|
21
|
+
const e = t && t.element.current;
|
|
22
|
+
e && (e.style.resize = "none");
|
|
23
|
+
}, this.onUpdate = () => {
|
|
24
|
+
const { view: t, settings: e } = this.props, o = f(this.htmlArea && this.htmlArea.value || ""), { preserveWhitespace: s } = x.getState(t.state);
|
|
25
|
+
w(o, e.commandName, { preserveWhitespace: s })(t.state, t.dispatch), this.onClose();
|
|
26
|
+
}, this.onClose = () => {
|
|
27
|
+
this.props.view.focus(), this.props.onClose();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
render() {
|
|
34
|
+
const { view: t, settings: e, dir: o, render: s } = this.props, n = A(this), { viewHtmlDialogTitle: a, viewHtmlCancel: l, viewHtmlUpdate: m } = e.messages, c = /* @__PURE__ */ i.createElement(
|
|
35
|
+
z,
|
|
36
|
+
{
|
|
37
|
+
className: "k-editor-textarea",
|
|
38
|
+
defaultValue: v(C(t.state)),
|
|
39
|
+
autoFocus: !0,
|
|
40
|
+
autoSize: !1,
|
|
41
|
+
ref: this.textAreaRef
|
|
42
|
+
}
|
|
43
|
+
), h = [
|
|
44
|
+
/* @__PURE__ */ i.createElement(u, { onClick: this.onClose, dir: o, key: "cancel" }, n.toLanguageString(l, r[l])),
|
|
45
|
+
/* @__PURE__ */ i.createElement(u, { onClick: this.onUpdate, themeColor: "primary", dir: o, key: "update" }, n.toLanguageString(m, r[m]))
|
|
46
|
+
], p = /* @__PURE__ */ i.createElement(
|
|
47
|
+
g,
|
|
48
|
+
{
|
|
49
|
+
className: "k-editor-window",
|
|
50
|
+
title: n.toLanguageString(a, r[a]),
|
|
51
|
+
onClose: this.onClose,
|
|
52
|
+
key: "dialog",
|
|
53
|
+
style: o === "rtl" ? { textAlign: "right" } : void 0,
|
|
54
|
+
modal: !0,
|
|
55
|
+
minimizeButton: () => null,
|
|
56
|
+
maximizeButton: () => null,
|
|
57
|
+
resizable: !0,
|
|
58
|
+
initialHeight: 400,
|
|
59
|
+
initialWidth: 500
|
|
60
|
+
},
|
|
61
|
+
c,
|
|
62
|
+
/* @__PURE__ */ i.createElement(d, null, ...h)
|
|
63
|
+
);
|
|
64
|
+
return s ? s(p, { content: c, actionButtons: h }) : p;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
H(k);
|
|
68
|
+
export {
|
|
69
|
+
k as ViewHtmlDialog
|
|
70
|
+
};
|