@progress/kendo-react-editor 6.1.1 → 7.0.0-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/es/Editor.d.ts → Editor.d.ts} +5 -1
- package/{dist/npm/EditorProps.d.ts → EditorProps.d.ts} +4 -1
- package/LICENSE.md +1 -1
- package/{dist/es/config → config}/defaultStyles.d.ts +4 -0
- package/config/pasteSettings.d.ts +10 -0
- package/config/schema.d.ts +5 -0
- package/{dist/es/config → config}/shortcuts.d.ts +10 -6
- package/{dist/es/config → config}/toolsSettings.d.ts +4 -1
- package/{dist/npm/dialogs → dialogs}/EditorDialogProps.d.ts +4 -1
- package/{dist/npm/dialogs → dialogs}/FindReplace.d.ts +5 -1
- package/{dist/npm/dialogs/main.d.ts → dialogs/index.d.ts} +4 -0
- package/{dist/npm/dialogs → dialogs}/insertImage.d.ts +5 -1
- package/{dist/es/dialogs → dialogs}/insertLink.d.ts +5 -1
- package/{dist/npm/dialogs → dialogs}/viewHtml.d.ts +5 -1
- package/dist/cdn/js/kendo-react-editor.js +226 -1
- package/{dist/es/main.d.ts → index.d.ts} +10 -6
- package/index.js +226 -0
- package/index.mjs +4133 -0
- package/{dist/npm/messages → messages}/index.d.ts +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +37 -52
- package/{dist/es/tools → tools}/ToolProps.d.ts +4 -1
- package/tools/align.d.ts +11 -0
- package/{dist/es/tools → tools}/applyColor.d.ts +4 -0
- package/{dist/npm/tools → tools}/cleanFormatting.d.ts +4 -0
- package/{dist/npm/tools → tools}/findReplace.d.ts +5 -1
- package/{dist/npm/tools → tools}/fontStyle.d.ts +4 -0
- package/{dist/es/tools → tools}/formatBlock.d.ts +4 -0
- package/{dist/npm/tools → tools}/history.d.ts +4 -0
- package/{dist/npm/tools → tools}/indent.d.ts +4 -0
- package/{dist/npm/tools/main.d.ts → tools/index.d.ts} +6 -2
- package/{dist/es/tools → tools}/inlineFormat.d.ts +4 -0
- package/tools/insertImage.d.ts +17 -0
- package/{dist/npm/tools → tools}/insertLink.d.ts +4 -0
- package/tools/insertTable/index.d.ts +7 -0
- package/{dist/npm/tools → tools}/insertTable/popup.d.ts +5 -1
- package/{dist/npm/tools → tools}/insertTable/popupGrid.d.ts +6 -2
- package/{dist/es/tools → tools}/insertTable/tool.d.ts +4 -0
- package/tools/lists-styled.d.ts +8 -0
- package/{dist/es/tools → tools}/lists.d.ts +4 -0
- package/{dist/es/tools → tools}/outdent.d.ts +4 -0
- package/{dist/npm/tools → tools}/pdf.d.ts +4 -0
- package/{dist/npm/tools → tools}/print.d.ts +4 -0
- package/{dist/npm/tools → tools}/proseMirrorTool.d.ts +4 -0
- package/{dist/npm/tools → tools}/selectAll.d.ts +4 -0
- package/{dist/npm/tools → tools}/table-wizard/cellPropsUtils.d.ts +4 -0
- package/{dist/npm/tools → tools}/table-wizard/tableCellProperties.d.ts +5 -1
- package/tools/table-wizard/tableProperties.d.ts +15 -0
- package/{dist/es/tools → tools}/table-wizard/tablePropsUtils.d.ts +5 -1
- package/{dist/es/tools → tools}/table-wizard/utils.d.ts +4 -0
- package/{dist/npm/tools → tools}/tableEdit.d.ts +4 -0
- package/{dist/npm/tools → tools}/unlink.d.ts +4 -0
- package/{dist/npm/tools → tools}/utils.d.ts +4 -0
- package/{dist/es/tools → tools}/viewHtml.d.ts +4 -0
- package/utils/browser-detection.d.ts +8 -0
- package/utils/controlled-value.d.ts +9 -0
- package/{dist/npm/utils → utils}/index.d.ts +4 -0
- package/utils/props-key.d.ts +9 -0
- package/about.md +0 -3
- package/dist/es/Editor.js +0 -441
- package/dist/es/EditorProps.d.ts +0 -197
- package/dist/es/EditorProps.js +0 -1
- package/dist/es/config/defaultStyles.js +0 -12
- package/dist/es/config/pasteSettings.d.ts +0 -6
- package/dist/es/config/pasteSettings.js +0 -1
- package/dist/es/config/schema.d.ts +0 -1
- package/dist/es/config/schema.js +0 -1
- package/dist/es/config/shortcuts.js +0 -34
- package/dist/es/config/toolsSettings.js +0 -522
- package/dist/es/dialogs/EditorDialogProps.d.ts +0 -27
- package/dist/es/dialogs/EditorDialogProps.js +0 -1
- package/dist/es/dialogs/FindReplace.d.ts +0 -71
- package/dist/es/dialogs/FindReplace.js +0 -248
- package/dist/es/dialogs/insertImage.d.ts +0 -28
- package/dist/es/dialogs/insertImage.js +0 -119
- package/dist/es/dialogs/insertLink.js +0 -94
- package/dist/es/dialogs/main.d.ts +0 -49
- package/dist/es/dialogs/main.js +0 -69
- package/dist/es/dialogs/viewHtml.d.ts +0 -25
- package/dist/es/dialogs/viewHtml.js +0 -79
- package/dist/es/main.js +0 -201
- package/dist/es/messages/index.d.ts +0 -334
- package/dist/es/messages/index.js +0 -989
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/tools/ToolProps.js +0 -1
- package/dist/es/tools/align.d.ts +0 -7
- package/dist/es/tools/align.js +0 -70
- package/dist/es/tools/applyColor.js +0 -34
- package/dist/es/tools/cleanFormatting.d.ts +0 -16
- package/dist/es/tools/cleanFormatting.js +0 -50
- package/dist/es/tools/findReplace.d.ts +0 -29
- package/dist/es/tools/findReplace.js +0 -76
- package/dist/es/tools/fontStyle.d.ts +0 -28
- package/dist/es/tools/fontStyle.js +0 -91
- package/dist/es/tools/formatBlock.js +0 -89
- package/dist/es/tools/history.d.ts +0 -26
- package/dist/es/tools/history.js +0 -16
- package/dist/es/tools/indent.d.ts +0 -17
- package/dist/es/tools/indent.js +0 -90
- package/dist/es/tools/inlineFormat.js +0 -75
- package/dist/es/tools/insertImage.d.ts +0 -13
- package/dist/es/tools/insertImage.js +0 -78
- package/dist/es/tools/insertLink.d.ts +0 -24
- package/dist/es/tools/insertLink.js +0 -85
- package/dist/es/tools/insertTable/index.d.ts +0 -3
- package/dist/es/tools/insertTable/index.js +0 -3
- package/dist/es/tools/insertTable/popup.d.ts +0 -93
- package/dist/es/tools/insertTable/popup.js +0 -102
- package/dist/es/tools/insertTable/popupGrid.d.ts +0 -31
- package/dist/es/tools/insertTable/popupGrid.js +0 -54
- package/dist/es/tools/insertTable/tool.js +0 -106
- package/dist/es/tools/lists-styled.d.ts +0 -5
- package/dist/es/tools/lists-styled.js +0 -80
- package/dist/es/tools/lists.js +0 -84
- package/dist/es/tools/main.d.ts +0 -714
- package/dist/es/tools/main.js +0 -740
- package/dist/es/tools/outdent.js +0 -85
- package/dist/es/tools/pdf.d.ts +0 -25
- package/dist/es/tools/pdf.js +0 -44
- package/dist/es/tools/print.d.ts +0 -16
- package/dist/es/tools/print.js +0 -48
- package/dist/es/tools/proseMirrorTool.d.ts +0 -12
- package/dist/es/tools/proseMirrorTool.js +0 -67
- package/dist/es/tools/selectAll.d.ts +0 -16
- package/dist/es/tools/selectAll.js +0 -45
- package/dist/es/tools/table-wizard/cellPropsUtils.d.ts +0 -36
- package/dist/es/tools/table-wizard/cellPropsUtils.js +0 -203
- package/dist/es/tools/table-wizard/tableCellProperties.d.ts +0 -20
- package/dist/es/tools/table-wizard/tableCellProperties.js +0 -247
- package/dist/es/tools/table-wizard/tableProperties.d.ts +0 -11
- package/dist/es/tools/table-wizard/tableProperties.js +0 -294
- package/dist/es/tools/table-wizard/tablePropsUtils.js +0 -498
- package/dist/es/tools/table-wizard/utils.js +0 -144
- package/dist/es/tools/tableEdit.d.ts +0 -98
- package/dist/es/tools/tableEdit.js +0 -90
- package/dist/es/tools/unlink.d.ts +0 -17
- package/dist/es/tools/unlink.js +0 -77
- package/dist/es/tools/utils.d.ts +0 -50
- package/dist/es/tools/utils.js +0 -72
- package/dist/es/tools/viewHtml.js +0 -79
- package/dist/es/utils/browser-detection.d.ts +0 -4
- package/dist/es/utils/browser-detection.js +0 -5
- package/dist/es/utils/controlled-value.d.ts +0 -5
- package/dist/es/utils/controlled-value.js +0 -31
- package/dist/es/utils/index.d.ts +0 -363
- package/dist/es/utils/index.js +0 -431
- package/dist/es/utils/props-key.d.ts +0 -5
- package/dist/es/utils/props-key.js +0 -5
- package/dist/npm/Editor.d.ts +0 -118
- package/dist/npm/Editor.js +0 -444
- package/dist/npm/EditorProps.js +0 -2
- package/dist/npm/config/defaultStyles.d.ts +0 -12
- package/dist/npm/config/defaultStyles.js +0 -15
- package/dist/npm/config/pasteSettings.d.ts +0 -6
- package/dist/npm/config/pasteSettings.js +0 -2
- package/dist/npm/config/schema.d.ts +0 -1
- package/dist/npm/config/schema.js +0 -6
- package/dist/npm/config/shortcuts.d.ts +0 -24
- package/dist/npm/config/shortcuts.js +0 -38
- package/dist/npm/config/toolsSettings.d.ts +0 -490
- package/dist/npm/config/toolsSettings.js +0 -525
- package/dist/npm/dialogs/EditorDialogProps.js +0 -2
- package/dist/npm/dialogs/FindReplace.js +0 -251
- package/dist/npm/dialogs/insertImage.js +0 -122
- package/dist/npm/dialogs/insertLink.d.ts +0 -26
- package/dist/npm/dialogs/insertLink.js +0 -97
- package/dist/npm/dialogs/main.js +0 -72
- package/dist/npm/dialogs/viewHtml.js +0 -82
- package/dist/npm/main.d.ts +0 -176
- package/dist/npm/main.js +0 -189
- package/dist/npm/messages/index.js +0 -992
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/tools/ToolProps.d.ts +0 -38
- package/dist/npm/tools/ToolProps.js +0 -2
- package/dist/npm/tools/align.d.ts +0 -7
- package/dist/npm/tools/align.js +0 -74
- package/dist/npm/tools/applyColor.d.ts +0 -12
- package/dist/npm/tools/applyColor.js +0 -38
- package/dist/npm/tools/cleanFormatting.js +0 -54
- package/dist/npm/tools/findReplace.js +0 -79
- package/dist/npm/tools/fontStyle.js +0 -94
- package/dist/npm/tools/formatBlock.d.ts +0 -18
- package/dist/npm/tools/formatBlock.js +0 -92
- package/dist/npm/tools/history.js +0 -19
- package/dist/npm/tools/indent.js +0 -93
- package/dist/npm/tools/inlineFormat.d.ts +0 -47
- package/dist/npm/tools/inlineFormat.js +0 -78
- package/dist/npm/tools/insertImage.d.ts +0 -13
- package/dist/npm/tools/insertImage.js +0 -82
- package/dist/npm/tools/insertLink.js +0 -88
- package/dist/npm/tools/insertTable/index.d.ts +0 -3
- package/dist/npm/tools/insertTable/index.js +0 -7
- package/dist/npm/tools/insertTable/popup.js +0 -105
- package/dist/npm/tools/insertTable/popupGrid.js +0 -56
- package/dist/npm/tools/insertTable/tool.d.ts +0 -24
- package/dist/npm/tools/insertTable/tool.js +0 -109
- package/dist/npm/tools/lists-styled.d.ts +0 -5
- package/dist/npm/tools/lists-styled.js +0 -84
- package/dist/npm/tools/lists.d.ts +0 -27
- package/dist/npm/tools/lists.js +0 -87
- package/dist/npm/tools/main.js +0 -743
- package/dist/npm/tools/outdent.d.ts +0 -17
- package/dist/npm/tools/outdent.js +0 -88
- package/dist/npm/tools/pdf.js +0 -48
- package/dist/npm/tools/print.js +0 -52
- package/dist/npm/tools/proseMirrorTool.js +0 -71
- package/dist/npm/tools/selectAll.js +0 -49
- package/dist/npm/tools/table-wizard/cellPropsUtils.js +0 -208
- package/dist/npm/tools/table-wizard/tableCellProperties.js +0 -253
- package/dist/npm/tools/table-wizard/tableProperties.d.ts +0 -11
- package/dist/npm/tools/table-wizard/tableProperties.js +0 -298
- package/dist/npm/tools/table-wizard/tablePropsUtils.d.ts +0 -52
- package/dist/npm/tools/table-wizard/tablePropsUtils.js +0 -504
- package/dist/npm/tools/table-wizard/utils.d.ts +0 -39
- package/dist/npm/tools/table-wizard/utils.js +0 -153
- package/dist/npm/tools/tableEdit.js +0 -95
- package/dist/npm/tools/unlink.js +0 -80
- package/dist/npm/tools/utils.js +0 -82
- package/dist/npm/tools/viewHtml.d.ts +0 -24
- package/dist/npm/tools/viewHtml.js +0 -82
- package/dist/npm/utils/browser-detection.d.ts +0 -4
- package/dist/npm/utils/browser-detection.js +0 -8
- package/dist/npm/utils/controlled-value.d.ts +0 -5
- package/dist/npm/utils/controlled-value.js +0 -35
- package/dist/npm/utils/index.js +0 -434
- package/dist/npm/utils/props-key.d.ts +0 -5
- package/dist/npm/utils/props-key.js +0 -8
- package/dist/systemjs/kendo-react-editor.js +0 -1
- package/e2e-next/editor.basic.tests.ts +0 -24
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
|
-
import * as React from 'react';
|
|
28
|
-
import { Button } from '@progress/kendo-react-buttons';
|
|
29
|
-
import { Window } from '@progress/kendo-react-dialogs';
|
|
30
|
-
import { TabStrip, TabStripTab } from '@progress/kendo-react-layout';
|
|
31
|
-
import { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
32
|
-
import { messages } from './../messages';
|
|
33
|
-
import { EditorToolsSettings } from './../config/toolsSettings';
|
|
34
|
-
import { formatString } from './../tools/utils';
|
|
35
|
-
import { find, replace, replaceAll, findAll, TextSelection, textHighlightKey, selectedLineTextOnly } from '@progress/kendo-editor-common';
|
|
36
|
-
import { IconWrap } from '@progress/kendo-react-common';
|
|
37
|
-
import { Input, Checkbox } from '@progress/kendo-react-inputs';
|
|
38
|
-
import { Form, FormElement, FieldWrapper } from '@progress/kendo-react-form';
|
|
39
|
-
import { chevronLeftIcon, chevronRightIcon } from '@progress/kendo-svg-icons';
|
|
40
|
-
var enter = 13, esc = 27;
|
|
41
|
-
var settings = EditorToolsSettings.findAndReplace;
|
|
42
|
-
/**
|
|
43
|
-
* @hidden
|
|
44
|
-
*/
|
|
45
|
-
var FindAndReplaceDialog = /** @class */ (function (_super) {
|
|
46
|
-
__extends(FindAndReplaceDialog, _super);
|
|
47
|
-
function FindAndReplaceDialog(props) {
|
|
48
|
-
var _this = _super.call(this, props) || this;
|
|
49
|
-
_this.onTabSelect = function (event) {
|
|
50
|
-
_this.setState({ selectedTab: event.selected });
|
|
51
|
-
};
|
|
52
|
-
_this.onClose = function () {
|
|
53
|
-
var view = _this.props.view;
|
|
54
|
-
var state = view.state;
|
|
55
|
-
var transaction = state.tr.setSelection(TextSelection.create(state.doc, state.selection.from, state.selection.to));
|
|
56
|
-
view.updateState(state.apply(transaction));
|
|
57
|
-
view.focus();
|
|
58
|
-
_this.props.onClose.call(undefined);
|
|
59
|
-
};
|
|
60
|
-
_this.matchesMessage = function (locMessage) {
|
|
61
|
-
var matches = _this.state.matches;
|
|
62
|
-
var nextMatch = _this.state.nextMatch;
|
|
63
|
-
var cur = 0, all = 0;
|
|
64
|
-
if (matches && nextMatch) {
|
|
65
|
-
var current = matches.findIndex(function (s) { return s.eq(nextMatch); });
|
|
66
|
-
cur = current === -1 ? matches.length : current + 1;
|
|
67
|
-
all = matches.length;
|
|
68
|
-
}
|
|
69
|
-
return formatString(locMessage, cur, all);
|
|
70
|
-
};
|
|
71
|
-
_this.onFindNext = function () {
|
|
72
|
-
_this.onFind();
|
|
73
|
-
};
|
|
74
|
-
_this.onFindPrev = function () {
|
|
75
|
-
_this.onFind(true);
|
|
76
|
-
};
|
|
77
|
-
_this.onFind = function (backward) {
|
|
78
|
-
if (backward === void 0) { backward = false; }
|
|
79
|
-
var view = _this.props.view;
|
|
80
|
-
var _a = _this.state, text = _a.searchText, matchCase = _a.matchCase, matchCyclic = _a.matchCyclic, matchWord = _a.matchWord, useRegExp = _a.useRegExp;
|
|
81
|
-
var searchOptions = { text: text, matchWord: matchWord, matchCase: matchCase, useRegExp: useRegExp, backward: backward, matchCyclic: matchCyclic };
|
|
82
|
-
var selectionResult = find(view.state, searchOptions);
|
|
83
|
-
if (selectionResult) {
|
|
84
|
-
var transaction = view.state.tr.setSelection(selectionResult);
|
|
85
|
-
transaction.scrollIntoView();
|
|
86
|
-
view.updateState(view.state.apply(transaction));
|
|
87
|
-
_this.setState({ nextMatch: selectionResult });
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
_this.onReplace = function () {
|
|
91
|
-
var view = _this.props.view;
|
|
92
|
-
var selection = view.state.selection;
|
|
93
|
-
var replaceText = _this.state.replaceText;
|
|
94
|
-
if (!selection.empty) {
|
|
95
|
-
var start = selection.from;
|
|
96
|
-
var end = start + replaceText.length;
|
|
97
|
-
var transaction = replace(selection, replaceText, view.state.tr);
|
|
98
|
-
transaction.setSelection(TextSelection.create(transaction.doc, start, end));
|
|
99
|
-
transaction.scrollIntoView();
|
|
100
|
-
view.dispatch(transaction);
|
|
101
|
-
_this.setNextState({});
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
_this.onReplaceAll = function () {
|
|
105
|
-
var view = _this.props.view;
|
|
106
|
-
var _a = _this.state, searchText = _a.searchText, replaceText = _a.replaceText, matchCase = _a.matchCase, matchWord = _a.matchWord, useRegExp = _a.useRegExp;
|
|
107
|
-
var searchOptions = { text: searchText, matchWord: matchWord, matchCase: matchCase, useRegExp: useRegExp };
|
|
108
|
-
var tr = replaceAll(view.state, replaceText, searchOptions);
|
|
109
|
-
if (tr) {
|
|
110
|
-
view.dispatch(tr);
|
|
111
|
-
}
|
|
112
|
-
_this.setNextState({});
|
|
113
|
-
};
|
|
114
|
-
_this.onKeyDown = function (event) {
|
|
115
|
-
if (event.keyCode === enter) {
|
|
116
|
-
_this.onFindNext();
|
|
117
|
-
}
|
|
118
|
-
else if (event.keyCode === esc) {
|
|
119
|
-
_this.onClose();
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
_this.onMatchCaseChecked = function (e) { return _this.setNextState({ matchCase: e.value }); };
|
|
123
|
-
_this.onMatchWordChecked = function (e) { return _this.setNextState({ matchWord: e.value }); };
|
|
124
|
-
_this.onMatchCyclicChecked = function (e) { return _this.setNextState({ matchCyclic: e.value }); };
|
|
125
|
-
_this.onUseRegExpChecked = function (e) { return _this.setNextState({ useRegExp: e.value }); };
|
|
126
|
-
_this.onSearchChange = function (e) { return _this.setNextState({ searchText: e.target.value }); };
|
|
127
|
-
_this.onReplaceChange = function (e) { return _this.setNextState({ replaceText: e.target.value }); };
|
|
128
|
-
_this.setNextState = function (next) {
|
|
129
|
-
var nextState = __assign(__assign(__assign({}, _this.state), next), { matches: undefined, nextMatch: undefined });
|
|
130
|
-
var view = _this.props.view;
|
|
131
|
-
if (nextState.searchText) {
|
|
132
|
-
var text = nextState.searchText, matchWord = nextState.matchWord, matchCase = nextState.matchCase, useRegExp = nextState.useRegExp, matchCyclic = nextState.matchCyclic;
|
|
133
|
-
var searchOptions = { text: text, matchWord: matchWord, matchCase: matchCase, useRegExp: useRegExp };
|
|
134
|
-
var selection_1 = view.state.selection;
|
|
135
|
-
var matches = findAll(view.state.doc, searchOptions);
|
|
136
|
-
var nextMatch = (!_this.state.searchText && matches[0]) ||
|
|
137
|
-
matches.find(function (match) { return match.from >= selection_1.from; }) ||
|
|
138
|
-
(matchCyclic && matches[0]) ||
|
|
139
|
-
undefined;
|
|
140
|
-
_this.setState(__assign(__assign({}, nextState), { matches: matches, nextMatch: nextMatch }));
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
_this.setState(nextState);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
_this.state = {
|
|
147
|
-
selectedTab: 0,
|
|
148
|
-
searchText: selectedLineTextOnly(props.view.state),
|
|
149
|
-
replaceText: '',
|
|
150
|
-
matchCase: false,
|
|
151
|
-
matchWord: false,
|
|
152
|
-
matchCyclic: false,
|
|
153
|
-
useRegExp: false
|
|
154
|
-
};
|
|
155
|
-
return _this;
|
|
156
|
-
}
|
|
157
|
-
Object.defineProperty(FindAndReplaceDialog.prototype, "settings", {
|
|
158
|
-
get: function () {
|
|
159
|
-
return this.props.settings || settings;
|
|
160
|
-
},
|
|
161
|
-
enumerable: false,
|
|
162
|
-
configurable: true
|
|
163
|
-
});
|
|
164
|
-
/**
|
|
165
|
-
* @hidden
|
|
166
|
-
*/
|
|
167
|
-
FindAndReplaceDialog.prototype.componentDidUpdate = function (_, prevState) {
|
|
168
|
-
var view = this.props.view;
|
|
169
|
-
var _a = this.state, _b = _a.matches, matches = _b === void 0 ? [] : _b, nextMatch = _a.nextMatch;
|
|
170
|
-
if (prevState.nextMatch !== nextMatch) {
|
|
171
|
-
var state = view.state;
|
|
172
|
-
// highlight selection
|
|
173
|
-
var tr = state.tr;
|
|
174
|
-
var highlights_1 = [];
|
|
175
|
-
matches.forEach(function (m) {
|
|
176
|
-
highlights_1.push({
|
|
177
|
-
from: m.from,
|
|
178
|
-
to: m.to,
|
|
179
|
-
attrs: {
|
|
180
|
-
class: (nextMatch && m.eq(nextMatch)) ?
|
|
181
|
-
'k-text-selected' :
|
|
182
|
-
'k-text-highlighted'
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
tr.setMeta(textHighlightKey, highlights_1);
|
|
187
|
-
tr.setSelection(nextMatch || TextSelection.create(state.doc, state.selection.from));
|
|
188
|
-
view.dispatch(tr);
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* @hidden
|
|
193
|
-
*/
|
|
194
|
-
FindAndReplaceDialog.prototype.render = function () {
|
|
195
|
-
var _this = this;
|
|
196
|
-
var localization = provideLocalizationService(this);
|
|
197
|
-
var _a = this.settings.messages, findReplaceDialogTitle = _a.findReplaceDialogTitle, findReplaceTabFind = _a.findReplaceTabFind, findReplaceTabReplace = _a.findReplaceTabReplace, findReplaceFindWhat = _a.findReplaceFindWhat, findReplaceReplaceWith = _a.findReplaceReplaceWith, findReplaceReplace = _a.findReplaceReplace, findReplaceReplaceAll = _a.findReplaceReplaceAll, findReplaceMatchCase = _a.findReplaceMatchCase, findReplaceMatchWord = _a.findReplaceMatchWord, findReplaceMatchCyclic = _a.findReplaceMatchCyclic, findReplaceUseRegExp = _a.findReplaceUseRegExp, findReplacePrevMatch = _a.findReplacePrevMatch, findReplaceNextMatch = _a.findReplaceNextMatch, findReplaceMatches = _a.findReplaceMatches;
|
|
198
|
-
var _b = this.state, matchCase = _b.matchCase, matchWord = _b.matchWord, matchCyclic = _b.matchCyclic, useRegExp = _b.useRegExp, searchText = _b.searchText, replaceText = _b.replaceText, nextMatch = _b.nextMatch;
|
|
199
|
-
var checkboxes = (React.createElement("div", { className: "k-search-options" },
|
|
200
|
-
React.createElement("span", null,
|
|
201
|
-
React.createElement(Checkbox, { id: "match-case", checked: matchCase, onChange: this.onMatchCaseChecked }),
|
|
202
|
-
React.createElement("label", { htmlFor: "match-case", className: "k-checkbox-label" }, localization.toLanguageString(findReplaceMatchCase, messages[findReplaceMatchCase]))),
|
|
203
|
-
React.createElement("span", null,
|
|
204
|
-
React.createElement(Checkbox, { id: "match-whole", checked: matchWord, onChange: this.onMatchWordChecked }),
|
|
205
|
-
React.createElement("label", { htmlFor: "match-whole", className: "k-checkbox-label" }, localization.toLanguageString(findReplaceMatchWord, messages[findReplaceMatchWord]))),
|
|
206
|
-
React.createElement("span", null,
|
|
207
|
-
React.createElement(Checkbox, { id: "match-cyclic", checked: matchCyclic, onChange: this.onMatchCyclicChecked }),
|
|
208
|
-
React.createElement("label", { htmlFor: "match-cyclic", className: "k-checkbox-label" }, localization.toLanguageString(findReplaceMatchCyclic, messages[findReplaceMatchCyclic]))),
|
|
209
|
-
React.createElement("span", null,
|
|
210
|
-
React.createElement(Checkbox, { id: "regular-expression", checked: useRegExp, onChange: this.onUseRegExpChecked }),
|
|
211
|
-
React.createElement("label", { htmlFor: "regular-expression", className: "k-checkbox-label" }, localization.toLanguageString(findReplaceUseRegExp, messages[findReplaceUseRegExp])))));
|
|
212
|
-
var navigation = (React.createElement("div", { className: "k-matches-container" },
|
|
213
|
-
React.createElement(Button, { fillMode: 'flat', themeColor: 'primary', onClick: this.onFindPrev },
|
|
214
|
-
React.createElement(IconWrap, { name: "chevron-left", icon: chevronLeftIcon }),
|
|
215
|
-
localization.toLanguageString(findReplacePrevMatch, messages[findReplacePrevMatch])),
|
|
216
|
-
React.createElement("span", null, this.matchesMessage(localization.toLanguageString(findReplaceMatches, messages[findReplaceMatches]))),
|
|
217
|
-
React.createElement(Button, { fillMode: 'flat', themeColor: 'primary', onClick: this.onFindNext },
|
|
218
|
-
localization.toLanguageString(findReplaceNextMatch, messages[findReplaceNextMatch]),
|
|
219
|
-
React.createElement(IconWrap, { name: "chevron-right", icon: chevronRightIcon }))));
|
|
220
|
-
var findWhat = (React.createElement(Form, { render: function () { return (React.createElement(FormElement, { horizontal: true },
|
|
221
|
-
React.createElement(FieldWrapper, null,
|
|
222
|
-
React.createElement("label", { htmlFor: "findWhat", className: 'k-form-label' }, localization.toLanguageString(findReplaceFindWhat, messages[findReplaceFindWhat])),
|
|
223
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
224
|
-
React.createElement(Input, { id: 'findWhat', type: "text", value: searchText, onChange: _this.onSearchChange, onFocus: _this.onSearchChange, onKeyDown: _this.onKeyDown, autoFocus: true }))))); } }));
|
|
225
|
-
var replaceWith = (React.createElement(Form, { render: function () { return (React.createElement(FormElement, { horizontal: true },
|
|
226
|
-
React.createElement(FieldWrapper, null,
|
|
227
|
-
React.createElement("label", { htmlFor: 'replaceWith', className: 'k-form-label' }, localization.toLanguageString(findReplaceReplaceWith, messages[findReplaceReplaceWith])),
|
|
228
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
229
|
-
React.createElement(Input, { id: 'replaceWith', type: "text", value: replaceText, onChange: _this.onReplaceChange }))))); } }));
|
|
230
|
-
return (React.createElement(Window, { title: localization.toLanguageString(findReplaceDialogTitle, messages[findReplaceDialogTitle]), onClose: this.onClose, style: { width: 'auto', height: 'auto', userSelect: 'none' }, resizable: false, minimizeButton: function () { return null; }, maximizeButton: function () { return null; } },
|
|
231
|
-
React.createElement(TabStrip, { selected: this.state.selectedTab, className: "k-editor-find-replace", onSelect: this.onTabSelect, animation: false },
|
|
232
|
-
React.createElement(TabStripTab, { title: localization.toLanguageString(findReplaceTabFind, messages[findReplaceTabFind]) },
|
|
233
|
-
findWhat,
|
|
234
|
-
checkboxes,
|
|
235
|
-
navigation),
|
|
236
|
-
React.createElement(TabStripTab, { title: localization.toLanguageString(findReplaceTabReplace, messages[findReplaceTabReplace]) },
|
|
237
|
-
findWhat,
|
|
238
|
-
replaceWith,
|
|
239
|
-
React.createElement("div", { className: "k-actions k-hstack k-justify-content-end" },
|
|
240
|
-
React.createElement(Button, { disabled: !Boolean(nextMatch), onClick: this.onReplace }, localization.toLanguageString(findReplaceReplace, messages[findReplaceReplace])),
|
|
241
|
-
React.createElement(Button, { disabled: !Boolean(nextMatch), onClick: this.onReplaceAll }, localization.toLanguageString(findReplaceReplaceAll, messages[findReplaceReplaceAll]))),
|
|
242
|
-
checkboxes,
|
|
243
|
-
navigation))));
|
|
244
|
-
};
|
|
245
|
-
return FindAndReplaceDialog;
|
|
246
|
-
}(React.Component));
|
|
247
|
-
export { FindAndReplaceDialog };
|
|
248
|
-
registerForLocalization(FindAndReplaceDialog);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { EditorToolsSettings } from '../config/toolsSettings';
|
|
3
|
-
import { EditorDialogProps } from './EditorDialogProps';
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
export interface InsertImageDialogProps extends EditorDialogProps {
|
|
8
|
-
/**
|
|
9
|
-
* The `ImageSettings` object.
|
|
10
|
-
*/
|
|
11
|
-
settings: EditorToolsSettings.ImageSettings;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export declare class InsertImageDialog extends React.Component<InsertImageDialogProps> {
|
|
17
|
-
private src;
|
|
18
|
-
private altText;
|
|
19
|
-
private title;
|
|
20
|
-
private width;
|
|
21
|
-
private height;
|
|
22
|
-
/**
|
|
23
|
-
* @hidden
|
|
24
|
-
*/
|
|
25
|
-
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
26
|
-
private onClose;
|
|
27
|
-
private onInsert;
|
|
28
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
17
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
18
|
-
if (ar || !(i in from)) {
|
|
19
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
20
|
-
ar[i] = from[i];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
24
|
-
};
|
|
25
|
-
import * as React from 'react';
|
|
26
|
-
import { Window, WindowActionsBar } from '@progress/kendo-react-dialogs';
|
|
27
|
-
import { Button } from '@progress/kendo-react-buttons';
|
|
28
|
-
import { NodeSelection, insertNode } from '@progress/kendo-editor-common';
|
|
29
|
-
import { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
30
|
-
import { messages } from './../messages';
|
|
31
|
-
import { Input } from '@progress/kendo-react-inputs';
|
|
32
|
-
import { Form, FormElement, FieldWrapper } from '@progress/kendo-react-form';
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
var InsertImageDialog = /** @class */ (function (_super) {
|
|
37
|
-
__extends(InsertImageDialog, _super);
|
|
38
|
-
function InsertImageDialog() {
|
|
39
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
-
_this.src = null;
|
|
41
|
-
_this.altText = null;
|
|
42
|
-
_this.title = null;
|
|
43
|
-
_this.width = null;
|
|
44
|
-
_this.height = null;
|
|
45
|
-
_this.onClose = function () {
|
|
46
|
-
_this.props.view.focus();
|
|
47
|
-
_this.props.onClose();
|
|
48
|
-
};
|
|
49
|
-
_this.onInsert = function () {
|
|
50
|
-
var _a = _this.props, view = _a.view, settings = _a.settings;
|
|
51
|
-
var nodes = view.state.schema.nodes;
|
|
52
|
-
var nodeType = nodes[settings.node];
|
|
53
|
-
var data = {
|
|
54
|
-
src: _this.src ? _this.src.value : null,
|
|
55
|
-
title: _this.title ? _this.title.value : null,
|
|
56
|
-
alt: _this.altText ? _this.altText.value : null,
|
|
57
|
-
width: _this.width ? _this.width.value : null,
|
|
58
|
-
height: _this.height ? _this.height.value : null
|
|
59
|
-
};
|
|
60
|
-
var attrs = Object.keys(data)
|
|
61
|
-
.filter(function (key) { return data[key] !== null && data[key] !== ''; })
|
|
62
|
-
.reduce(function (acc, curr) {
|
|
63
|
-
var _a;
|
|
64
|
-
return Object.assign(acc, (_a = {}, _a[curr] = data[curr], _a));
|
|
65
|
-
}, {});
|
|
66
|
-
var newImage = nodeType.createAndFill(attrs);
|
|
67
|
-
if (newImage) {
|
|
68
|
-
var insertImageCmd = insertNode(newImage, true);
|
|
69
|
-
insertImageCmd(view.state, function (tr) { return view.dispatch(tr.setMeta('commandName', settings.commandName).setMeta('args', attrs)); });
|
|
70
|
-
}
|
|
71
|
-
_this.onClose();
|
|
72
|
-
};
|
|
73
|
-
return _this;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* @hidden
|
|
77
|
-
*/
|
|
78
|
-
InsertImageDialog.prototype.render = function () {
|
|
79
|
-
var _this = this;
|
|
80
|
-
var _a = this.props, view = _a.view, settings = _a.settings, dir = _a.dir, render = _a.render;
|
|
81
|
-
var _b = settings.messages, insertImageDialogTitle = _b.insertImageDialogTitle, insertImageAddress = _b.insertImageAddress, insertImageTitle = _b.insertImageTitle, insertImageAltText = _b.insertImageAltText, insertImageWidth = _b.insertImageWidth, insertImageHeight = _b.insertImageHeight, insertImageCancel = _b.insertImageCancel, insertImageInsert = _b.insertImageInsert;
|
|
82
|
-
var localization = provideLocalizationService(this);
|
|
83
|
-
var state = view && view.state;
|
|
84
|
-
var attrs = {};
|
|
85
|
-
if (state && state.selection instanceof NodeSelection &&
|
|
86
|
-
state.selection.node.type === state.schema.nodes[settings.node]) {
|
|
87
|
-
attrs = state.selection.node.attrs;
|
|
88
|
-
}
|
|
89
|
-
var content = (React.createElement(Form, { render: function () { return (React.createElement(FormElement, { horizontal: true },
|
|
90
|
-
React.createElement(FieldWrapper, null,
|
|
91
|
-
React.createElement("label", { htmlFor: 'k-editor-image-url', className: 'k-form-label' }, localization.toLanguageString(insertImageAddress, messages[insertImageAddress])),
|
|
92
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
93
|
-
React.createElement(Input, { type: "text", id: 'k-editor-image-url', defaultValue: attrs.src, ref: function (e) { return _this.src = e; }, autoFocus: true }))),
|
|
94
|
-
React.createElement(FieldWrapper, null,
|
|
95
|
-
React.createElement("label", { htmlFor: 'k-editor-image-url', className: 'k-form-label' }, localization.toLanguageString(insertImageAltText, messages[insertImageAltText])),
|
|
96
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
97
|
-
React.createElement(Input, { type: 'text', id: "k-editor-image-alt", defaultValue: attrs.alt, ref: function (e) { return _this.altText = e; } }))),
|
|
98
|
-
React.createElement(FieldWrapper, null,
|
|
99
|
-
React.createElement("label", { htmlFor: 'k-editor-image-title', className: 'k-form-label' }, localization.toLanguageString(insertImageTitle, messages[insertImageTitle])),
|
|
100
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
101
|
-
React.createElement(Input, { type: 'text', id: "k-editor-image-title", defaultValue: attrs.title, ref: function (e) { return _this.title = e; } }))),
|
|
102
|
-
React.createElement(FieldWrapper, null,
|
|
103
|
-
React.createElement("label", { htmlFor: 'k-editor-image-width', className: 'k-form-label' }, localization.toLanguageString(insertImageWidth, messages[insertImageWidth])),
|
|
104
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
105
|
-
React.createElement(Input, { type: 'text', id: "k-editor-image-width", defaultValue: attrs.width, ref: function (e) { return _this.width = e; } }))),
|
|
106
|
-
React.createElement(FieldWrapper, null,
|
|
107
|
-
React.createElement("label", { htmlFor: 'k-editor-image-height', className: 'k-form-label' }, localization.toLanguageString(insertImageHeight, messages[insertImageHeight])),
|
|
108
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
109
|
-
React.createElement(Input, { id: "k-editor-image-height", defaultValue: attrs.height, ref: function (e) { return _this.height = e; } }))))); } }));
|
|
110
|
-
var actionButtons = [(React.createElement(Button, { onClick: this.onClose, dir: dir, key: "cancel" }, localization.toLanguageString(insertImageCancel, messages[insertImageCancel]))), (React.createElement(Button, { onClick: this.onInsert, themeColor: 'primary', dir: dir, key: "insert" }, localization.toLanguageString(insertImageInsert, messages[insertImageInsert])))];
|
|
111
|
-
var dialog = (React.createElement(Window, { initialWidth: 500, initialHeight: 350, className: 'k-editor-window', title: localization.toLanguageString(insertImageDialogTitle, messages[insertImageDialogTitle]), onClose: this.onClose, key: "dialog", style: dir === 'rtl' ? { textAlign: 'right' } : undefined, modal: true, minimizeButton: function () { return null; }, maximizeButton: function () { return null; }, resizable: false },
|
|
112
|
-
content,
|
|
113
|
-
React.createElement.apply(React, __spreadArray([WindowActionsBar, null], actionButtons, false))));
|
|
114
|
-
return render ? render(dialog, { content: content, actionButtons: actionButtons }) : dialog;
|
|
115
|
-
};
|
|
116
|
-
return InsertImageDialog;
|
|
117
|
-
}(React.Component));
|
|
118
|
-
export { InsertImageDialog };
|
|
119
|
-
registerForLocalization(InsertImageDialog);
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
17
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
18
|
-
if (ar || !(i in from)) {
|
|
19
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
20
|
-
ar[i] = from[i];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
24
|
-
};
|
|
25
|
-
import * as React from 'react';
|
|
26
|
-
import { Window, WindowActionsBar } from '@progress/kendo-react-dialogs';
|
|
27
|
-
import { Button } from '@progress/kendo-react-buttons';
|
|
28
|
-
import { Input, Checkbox } from '@progress/kendo-react-inputs';
|
|
29
|
-
import { Form, FormElement, FieldWrapper } from '@progress/kendo-react-form';
|
|
30
|
-
import { getMark, applyLink } from '@progress/kendo-editor-common';
|
|
31
|
-
import { registerForLocalization, provideLocalizationService } from '@progress/kendo-react-intl';
|
|
32
|
-
import { messages } from './../messages';
|
|
33
|
-
/**
|
|
34
|
-
* @hidden
|
|
35
|
-
*/
|
|
36
|
-
var InsertLinkDialog = /** @class */ (function (_super) {
|
|
37
|
-
__extends(InsertLinkDialog, _super);
|
|
38
|
-
function InsertLinkDialog() {
|
|
39
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
40
|
-
_this.href = null;
|
|
41
|
-
_this.title = null;
|
|
42
|
-
_this.target = null;
|
|
43
|
-
_this.onClose = function () {
|
|
44
|
-
_this.props.view.focus();
|
|
45
|
-
_this.props.onClose();
|
|
46
|
-
};
|
|
47
|
-
_this.onInsert = function () {
|
|
48
|
-
var view = _this.props.view;
|
|
49
|
-
var mark = _this.props.settings.mark;
|
|
50
|
-
var attrs = {
|
|
51
|
-
href: _this.href ? _this.href.value : undefined,
|
|
52
|
-
title: _this.title ? _this.title.value : undefined,
|
|
53
|
-
target: _this.target && _this.target.element && _this.target.element.checked ? '_blank' : undefined
|
|
54
|
-
};
|
|
55
|
-
applyLink({ mark: mark, attrs: attrs }, _this.props.settings.commandName)(view.state, view.dispatch);
|
|
56
|
-
_this.onClose();
|
|
57
|
-
};
|
|
58
|
-
return _this;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* @hidden
|
|
62
|
-
*/
|
|
63
|
-
InsertLinkDialog.prototype.render = function () {
|
|
64
|
-
var _this = this;
|
|
65
|
-
var _a = this.props, view = _a.view, settings = _a.settings, dir = _a.dir, render = _a.render;
|
|
66
|
-
var localization = provideLocalizationService(this);
|
|
67
|
-
var _b = settings.messages, insertHyperlinkDialogTitle = _b.insertHyperlinkDialogTitle, insertHyperlinkAddress = _b.insertHyperlinkAddress, insertHyperlinkTitle = _b.insertHyperlinkTitle, insertHyperlinkNewWindow = _b.insertHyperlinkNewWindow, insertHyperlinkCancel = _b.insertHyperlinkCancel, insertHyperlinkInsert = _b.insertHyperlinkInsert;
|
|
68
|
-
var linkMark = view ?
|
|
69
|
-
getMark(view.state, view.state.schema.marks[settings.mark])
|
|
70
|
-
: false;
|
|
71
|
-
var content = (React.createElement(Form, { render: function () { return (React.createElement(FormElement, { horizontal: true },
|
|
72
|
-
React.createElement(FieldWrapper, null,
|
|
73
|
-
React.createElement("label", { htmlFor: 'k-editor-link-url', className: 'k-form-label' }, localization.toLanguageString(insertHyperlinkAddress, messages[insertHyperlinkAddress])),
|
|
74
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
75
|
-
React.createElement(Input, { type: "text", id: 'k-editor-link-url', ref: function (e) { return _this.href = e; }, defaultValue: (linkMark && linkMark.attrs.href) || undefined, autoFocus: true }))),
|
|
76
|
-
React.createElement(FieldWrapper, null,
|
|
77
|
-
React.createElement("label", { htmlFor: 'k-editor-link-text', className: 'k-form-label' }, localization.toLanguageString(insertHyperlinkTitle, messages[insertHyperlinkTitle])),
|
|
78
|
-
React.createElement("div", { className: 'k-form-field-wrap' },
|
|
79
|
-
React.createElement(Input, { type: "text", id: 'k-editor-link-text', ref: function (e) { return _this.title = e; }, defaultValue: (linkMark && linkMark.attrs.title) || undefined }))),
|
|
80
|
-
settings.linkTarget !== false && React.createElement(FieldWrapper, null,
|
|
81
|
-
React.createElement("label", { htmlFor: 'k-editor-link-target', className: 'k-checkbox-label' },
|
|
82
|
-
React.createElement(Checkbox, { id: 'k-editor-link-target', ref: function (e) { return _this.target = e; }, defaultChecked: (linkMark && !!linkMark.attrs.target) || undefined }),
|
|
83
|
-
localization.toLanguageString(insertHyperlinkNewWindow, messages[insertHyperlinkNewWindow]))))); } }));
|
|
84
|
-
var actionButtons = [(React.createElement(Button, { onClick: this.onClose, dir: dir, key: "cancel" }, localization.toLanguageString(insertHyperlinkCancel, messages[insertHyperlinkCancel]))), (React.createElement(Button, { onClick: this.onInsert, themeColor: 'primary', dir: dir, key: "insert" }, localization.toLanguageString(insertHyperlinkInsert, messages[insertHyperlinkInsert])))
|
|
85
|
-
];
|
|
86
|
-
var dialog = (React.createElement(Window, { initialWidth: 450, initialHeight: 250, className: 'k-editor-window', title: localization.toLanguageString(insertHyperlinkDialogTitle, messages[insertHyperlinkDialogTitle]), onClose: this.onClose, style: dir === 'rtl' ? { textAlign: 'right' } : undefined, modal: true, minimizeButton: function () { return null; }, maximizeButton: function () { return null; }, resizable: false },
|
|
87
|
-
content,
|
|
88
|
-
React.createElement.apply(React, __spreadArray([WindowActionsBar, null], actionButtons, false))));
|
|
89
|
-
return render ? render(dialog, { content: content, actionButtons: actionButtons }) : dialog;
|
|
90
|
-
};
|
|
91
|
-
return InsertLinkDialog;
|
|
92
|
-
}(React.Component));
|
|
93
|
-
export { InsertLinkDialog };
|
|
94
|
-
registerForLocalization(InsertLinkDialog);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { InsertLinkDialog as LinkDialog, InsertLinkDialogProps as LinkDialogProps } from './insertLink';
|
|
2
|
-
import { InsertImageDialog as ImageDialog, InsertImageDialogProps as ImageDialogProps } from './insertImage';
|
|
3
|
-
import { ViewHtmlDialog as ViewHtmlDialogX, ViewHtmlDialogProps as ViewHtmlDialogPropsX } from './viewHtml';
|
|
4
|
-
import { FindAndReplaceDialog as FindAndReplaceDialogX, FindAndReplaceDialogProps as FindAndReplaceDialogPropsX } from './FindReplace';
|
|
5
|
-
/**
|
|
6
|
-
* Represents a wrapping namespace for the dialog components and props of the Editor.
|
|
7
|
-
*/
|
|
8
|
-
export declare namespace EditorDialogs {
|
|
9
|
-
/**
|
|
10
|
-
* The InsertLinkDialog component.
|
|
11
|
-
*/
|
|
12
|
-
class InsertLinkDialog extends LinkDialog {
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The props for the InsertLinkDialog component.
|
|
16
|
-
*/
|
|
17
|
-
interface InsertLinkDialogProps extends LinkDialogProps {
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The InsertImageDialog component.
|
|
21
|
-
*/
|
|
22
|
-
class InsertImageDialog extends ImageDialog {
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The props for the InsertImageDialog component.
|
|
26
|
-
*/
|
|
27
|
-
interface InsertImageDialogProps extends ImageDialogProps {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The ViewHtmlDialog component.
|
|
31
|
-
*/
|
|
32
|
-
class ViewHtmlDialog extends ViewHtmlDialogX {
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* The props for the ViewHtmlDialog component.
|
|
36
|
-
*/
|
|
37
|
-
interface ViewHtmlDialogProps extends ViewHtmlDialogPropsX {
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The FindAndReplaceDialog component.
|
|
41
|
-
*/
|
|
42
|
-
class FindAndReplaceDialog extends FindAndReplaceDialogX {
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The props for the FindAndReplaceDialog component.
|
|
46
|
-
*/
|
|
47
|
-
interface FindAndReplaceDialogProps extends FindAndReplaceDialogPropsX {
|
|
48
|
-
}
|
|
49
|
-
}
|
package/dist/es/dialogs/main.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
import { InsertLinkDialog as LinkDialog } from './insertLink';
|
|
17
|
-
import { InsertImageDialog as ImageDialog } from './insertImage';
|
|
18
|
-
import { ViewHtmlDialog as ViewHtmlDialogX } from './viewHtml';
|
|
19
|
-
import { FindAndReplaceDialog as FindAndReplaceDialogX } from './FindReplace';
|
|
20
|
-
/**
|
|
21
|
-
* Represents a wrapping namespace for the dialog components and props of the Editor.
|
|
22
|
-
*/
|
|
23
|
-
export var EditorDialogs;
|
|
24
|
-
(function (EditorDialogs) {
|
|
25
|
-
/**
|
|
26
|
-
* The InsertLinkDialog component.
|
|
27
|
-
*/
|
|
28
|
-
var InsertLinkDialog = /** @class */ (function (_super) {
|
|
29
|
-
__extends(InsertLinkDialog, _super);
|
|
30
|
-
function InsertLinkDialog() {
|
|
31
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
|
-
}
|
|
33
|
-
return InsertLinkDialog;
|
|
34
|
-
}(LinkDialog));
|
|
35
|
-
EditorDialogs.InsertLinkDialog = InsertLinkDialog;
|
|
36
|
-
/**
|
|
37
|
-
* The InsertImageDialog component.
|
|
38
|
-
*/
|
|
39
|
-
var InsertImageDialog = /** @class */ (function (_super) {
|
|
40
|
-
__extends(InsertImageDialog, _super);
|
|
41
|
-
function InsertImageDialog() {
|
|
42
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
43
|
-
}
|
|
44
|
-
return InsertImageDialog;
|
|
45
|
-
}(ImageDialog));
|
|
46
|
-
EditorDialogs.InsertImageDialog = InsertImageDialog;
|
|
47
|
-
/**
|
|
48
|
-
* The ViewHtmlDialog component.
|
|
49
|
-
*/
|
|
50
|
-
var ViewHtmlDialog = /** @class */ (function (_super) {
|
|
51
|
-
__extends(ViewHtmlDialog, _super);
|
|
52
|
-
function ViewHtmlDialog() {
|
|
53
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
54
|
-
}
|
|
55
|
-
return ViewHtmlDialog;
|
|
56
|
-
}(ViewHtmlDialogX));
|
|
57
|
-
EditorDialogs.ViewHtmlDialog = ViewHtmlDialog;
|
|
58
|
-
/**
|
|
59
|
-
* The FindAndReplaceDialog component.
|
|
60
|
-
*/
|
|
61
|
-
var FindAndReplaceDialog = /** @class */ (function (_super) {
|
|
62
|
-
__extends(FindAndReplaceDialog, _super);
|
|
63
|
-
function FindAndReplaceDialog() {
|
|
64
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
65
|
-
}
|
|
66
|
-
return FindAndReplaceDialog;
|
|
67
|
-
}(FindAndReplaceDialogX));
|
|
68
|
-
EditorDialogs.FindAndReplaceDialog = FindAndReplaceDialog;
|
|
69
|
-
})(EditorDialogs || (EditorDialogs = {}));
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { EditorToolsSettings } from '../config/toolsSettings';
|
|
3
|
-
import { EditorDialogProps } from './EditorDialogProps';
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
export interface ViewHtmlDialogProps extends EditorDialogProps {
|
|
8
|
-
/**
|
|
9
|
-
* The `ViewHtmlSettings` object.
|
|
10
|
-
*/
|
|
11
|
-
settings: EditorToolsSettings.ViewHtmlSettings;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
*/
|
|
16
|
-
export declare class ViewHtmlDialog extends React.Component<ViewHtmlDialogProps> {
|
|
17
|
-
private htmlArea;
|
|
18
|
-
/**
|
|
19
|
-
* @hidden
|
|
20
|
-
*/
|
|
21
|
-
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
22
|
-
private textAreaRef;
|
|
23
|
-
private onUpdate;
|
|
24
|
-
private onClose;
|
|
25
|
-
}
|