jodit 4.0.5 → 4.0.13
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/CHANGELOG.md +15 -5
- package/es2015/jodit.css +19 -19
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +633 -529
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +72 -46
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.css +19 -19
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +633 -529
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +72 -46
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +19 -19
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +632 -528
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +72 -46
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +19 -19
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +333 -313
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +3 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/jodit.css +25 -19
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +646 -542
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +72 -46
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/esm/core/async/async.d.ts +1 -1
- package/esm/core/async/async.js +2 -2
- package/esm/core/constants.js +1 -1
- package/esm/core/create/create.d.ts +1 -1
- package/esm/core/helpers/utils/append-script.d.ts +1 -5
- package/esm/core/helpers/utils/append-script.js +13 -28
- package/esm/core/plugin/helpers/load.d.ts +1 -1
- package/esm/core/plugin/helpers/load.js +2 -2
- package/esm/core/plugin/plugin-system.js +5 -5
- package/esm/core/plugin/plugin.js +5 -1
- package/esm/core/ui/popup/popup.js +1 -0
- package/esm/core/view/view-with-toolbar.js +4 -1
- package/esm/langs/fi.d.ts +218 -0
- package/esm/langs/fi.js +231 -0
- package/esm/languages.js +2 -0
- package/esm/plugins/add-new-line/add-new-line.d.ts +14 -14
- package/esm/plugins/add-new-line/add-new-line.js +76 -73
- package/esm/plugins/copy-format/langs/fi.d.ts +4 -0
- package/esm/plugins/copy-format/langs/fi.js +9 -0
- package/esm/plugins/copy-format/langs/index.d.ts +2 -1
- package/esm/plugins/copy-format/langs/index.js +2 -1
- package/esm/plugins/line-height/langs/fi.d.ts +4 -0
- package/esm/plugins/line-height/langs/fi.js +9 -0
- package/esm/plugins/line-height/langs/index.d.ts +2 -1
- package/esm/plugins/line-height/langs/index.js +2 -1
- package/esm/plugins/resizer/resizer.d.ts +2 -2
- package/esm/plugins/resizer/resizer.js +12 -13
- package/esm/plugins/search/config.d.ts +5 -0
- package/esm/plugins/search/config.js +3 -1
- package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts} +2 -2
- package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.js → highlight-text-ranges.js} +19 -1
- package/esm/plugins/search/helpers/index.d.ts +1 -1
- package/esm/plugins/search/helpers/index.js +1 -1
- package/esm/plugins/search/search.d.ts +1 -1
- package/esm/plugins/search/search.js +4 -4
- package/esm/plugins/source/source.js +1 -1
- package/esm/plugins/speech-recognize/langs/fi.d.ts +9 -0
- package/esm/plugins/speech-recognize/langs/fi.js +14 -0
- package/esm/plugins/speech-recognize/langs/index.d.ts +2 -1
- package/esm/plugins/speech-recognize/langs/index.js +2 -1
- package/esm/plugins/spellcheck/langs/fi.d.ts +1 -0
- package/esm/plugins/spellcheck/langs/fi.js +9 -0
- package/esm/plugins/spellcheck/langs/index.d.ts +2 -1
- package/esm/plugins/spellcheck/langs/index.js +2 -1
- package/esm/plugins/symbols/langs/fi.d.ts +1 -0
- package/esm/plugins/symbols/langs/fi.js +9 -0
- package/esm/plugins/symbols/langs/index.d.ts +2 -1
- package/esm/plugins/symbols/langs/index.js +2 -1
- package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.d.ts +1 -1
- package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +70 -73
- package/esm/tsconfig.json +1 -1
- package/esm/types/create.d.ts +1 -1
- package/package.json +1 -1
- package/types/core/async/async.d.ts +1 -1
- package/types/core/create/create.d.ts +1 -1
- package/types/core/helpers/utils/append-script.d.ts +1 -5
- package/types/core/plugin/helpers/load.d.ts +1 -1
- package/types/langs/fi.d.ts +218 -0
- package/types/plugins/add-new-line/add-new-line.d.ts +14 -14
- package/types/plugins/copy-format/langs/fi.d.ts +4 -0
- package/types/plugins/copy-format/langs/index.d.ts +2 -1
- package/types/plugins/line-height/langs/fi.d.ts +4 -0
- package/types/plugins/line-height/langs/index.d.ts +2 -1
- package/types/plugins/resizer/resizer.d.ts +2 -2
- package/types/plugins/search/config.d.ts +5 -0
- package/types/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts} +2 -2
- package/types/plugins/search/helpers/index.d.ts +1 -1
- package/types/plugins/search/search.d.ts +1 -1
- package/types/plugins/speech-recognize/langs/fi.d.ts +9 -0
- package/types/plugins/speech-recognize/langs/index.d.ts +2 -1
- package/types/plugins/spellcheck/langs/fi.d.ts +1 -0
- package/types/plugins/spellcheck/langs/index.d.ts +2 -1
- package/types/plugins/symbols/langs/fi.d.ts +1 -0
- package/types/plugins/symbols/langs/index.d.ts +2 -1
- package/types/plugins/table-keyboard-navigation/table-keyboard-navigation.d.ts +1 -1
- package/types/tsconfig.json +1 -1
- package/types/types/create.d.ts +1 -1
|
@@ -20,7 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
20
|
*/
|
|
21
21
|
import { Dom, Icon, Plugin } from "jodit/esm/modules/index.js";
|
|
22
22
|
import { offset, position, call, scrollIntoViewIfNeeded } from "jodit/esm/core/helpers/index.js";
|
|
23
|
-
import { autobind,
|
|
23
|
+
import { autobind, throttle, watch } from "jodit/esm/core/decorators/index.js";
|
|
24
24
|
import { pluginSystem } from "jodit/esm/core/global.js";
|
|
25
25
|
import "./config";
|
|
26
26
|
const ns = 'addnewline';
|
|
@@ -30,36 +30,38 @@ const ns = 'addnewline';
|
|
|
30
30
|
export class addNewLine extends Plugin {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
33
|
+
this.__line = this.j.c.fromHTML(`<div role="button" tabindex="-1" title="${this.j.i18n('Break')}" class="jodit-add-new-line"><span>${Icon.get('enter')}</span></div>`);
|
|
34
|
+
this.__isMatchedTag = (node) => Boolean(node &&
|
|
35
35
|
this.j.o.addNewLineTagsTriggers.includes(node.nodeName.toLowerCase()));
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
if (!this.
|
|
36
|
+
this.__isBeforeContent = false;
|
|
37
|
+
this.__lineInFocus = false;
|
|
38
|
+
this.__isShown = false;
|
|
39
|
+
this.__hideForce = () => {
|
|
40
|
+
if (!this.__isShown) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
this.
|
|
44
|
-
this.j.async.clearTimeout(this.
|
|
45
|
-
this.
|
|
46
|
-
Dom.safeRemove(this.
|
|
47
|
-
this.
|
|
43
|
+
this.__isShown = false;
|
|
44
|
+
this.j.async.clearTimeout(this.__timeout);
|
|
45
|
+
this.__lineInFocus = false;
|
|
46
|
+
Dom.safeRemove(this.__line);
|
|
47
|
+
this.__line.style.setProperty('--jd-anl-handle-offset', '0');
|
|
48
48
|
};
|
|
49
|
-
this.
|
|
49
|
+
this.__canGetFocus = (elm) => {
|
|
50
50
|
return (elm != null &&
|
|
51
51
|
Dom.isBlock(elm) &&
|
|
52
52
|
!/^(img|table|iframe|hr)$/i.test(elm.nodeName));
|
|
53
53
|
};
|
|
54
|
-
this.
|
|
54
|
+
this.__onClickLine = (e) => {
|
|
55
55
|
const editor = this.j;
|
|
56
56
|
const p = editor.createInside.element(editor.o.enter);
|
|
57
|
-
if (this.
|
|
58
|
-
|
|
57
|
+
if (this.__isBeforeContent &&
|
|
58
|
+
this.__current &&
|
|
59
|
+
this.__current.parentNode) {
|
|
60
|
+
if (this.__current === editor.editor) {
|
|
59
61
|
Dom.prepend(editor.editor, p);
|
|
60
62
|
}
|
|
61
63
|
else {
|
|
62
|
-
this.
|
|
64
|
+
this.__current.parentNode.insertBefore(p, this.__current);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
else {
|
|
@@ -68,30 +70,32 @@ export class addNewLine extends Plugin {
|
|
|
68
70
|
editor.s.setCursorIn(p);
|
|
69
71
|
scrollIntoViewIfNeeded(p, editor.editor, editor.ed);
|
|
70
72
|
editor.synchronizeValues();
|
|
71
|
-
this.
|
|
73
|
+
this.__hideForce();
|
|
72
74
|
e.preventDefault();
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
|
-
|
|
76
|
-
if (this.
|
|
77
|
+
__show() {
|
|
78
|
+
if (this.j.o.readonly || this.j.isLocked) {
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.
|
|
81
|
+
this.j.async.clearTimeout(this.__timeout);
|
|
82
|
+
if (this.__isShown) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.__isShown = true;
|
|
86
|
+
this.j.container.appendChild(this.__line);
|
|
87
|
+
this.__line.style.width = this.j.container.clientWidth + 'px';
|
|
84
88
|
}
|
|
85
89
|
onLock(isLocked) {
|
|
86
|
-
if (isLocked && this.
|
|
87
|
-
this.
|
|
90
|
+
if (isLocked && this.__isShown) {
|
|
91
|
+
this.__hideForce();
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
|
-
|
|
91
|
-
if (!this.
|
|
94
|
+
__hide() {
|
|
95
|
+
if (!this.__isShown || this.__lineInFocus) {
|
|
92
96
|
return;
|
|
93
97
|
}
|
|
94
|
-
this.
|
|
98
|
+
this.__timeout = this.j.async.setTimeout(this.__hideForce, {
|
|
95
99
|
timeout: 500,
|
|
96
100
|
label: 'add-new-line-hide'
|
|
97
101
|
});
|
|
@@ -101,30 +105,30 @@ export class addNewLine extends Plugin {
|
|
|
101
105
|
return;
|
|
102
106
|
}
|
|
103
107
|
editor.e
|
|
104
|
-
.on(this.
|
|
108
|
+
.on(this.__line, 'mousemove', (e) => {
|
|
105
109
|
e.stopPropagation();
|
|
106
110
|
})
|
|
107
|
-
.on(this.
|
|
108
|
-
.on('change', this.
|
|
109
|
-
.on(this.
|
|
110
|
-
this.j.async.clearTimeout(this.
|
|
111
|
-
this.
|
|
111
|
+
.on(this.__line, 'mousedown touchstart', this.__onClickLine)
|
|
112
|
+
.on('change', this.__hideForce)
|
|
113
|
+
.on(this.__line, 'mouseenter', () => {
|
|
114
|
+
this.j.async.clearTimeout(this.__timeout);
|
|
115
|
+
this.__lineInFocus = true;
|
|
112
116
|
})
|
|
113
|
-
.on(this.
|
|
114
|
-
this.
|
|
117
|
+
.on(this.__line, 'mouseleave', () => {
|
|
118
|
+
this.__lineInFocus = false;
|
|
115
119
|
})
|
|
116
|
-
.on('changePlace', this.
|
|
117
|
-
this.
|
|
120
|
+
.on('changePlace', this.__addEventListeners.bind(this));
|
|
121
|
+
this.__addEventListeners();
|
|
118
122
|
}
|
|
119
|
-
|
|
123
|
+
__addEventListeners() {
|
|
120
124
|
const editor = this.j;
|
|
121
125
|
editor.e
|
|
122
126
|
.off(editor.editor, '.' + ns)
|
|
123
127
|
.off(editor.container, '.' + ns)
|
|
124
|
-
.on([editor.ow, editor.ew, editor.editor], 'scroll' + '.' + ns, this.
|
|
125
|
-
.on(editor.editor, 'click' + '.' + ns, this.
|
|
126
|
-
.on(editor.container, 'mouseleave' + '.' + ns, this.
|
|
127
|
-
.on(editor.editor, 'mousemove' + '.' + ns, this.
|
|
128
|
+
.on([editor.ow, editor.ew, editor.editor], 'scroll' + '.' + ns, this.__hideForce)
|
|
129
|
+
.on(editor.editor, 'click' + '.' + ns, this.__hide)
|
|
130
|
+
.on(editor.container, 'mouseleave' + '.' + ns, this.__hide)
|
|
131
|
+
.on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
|
|
128
132
|
}
|
|
129
133
|
onDblClickEditor(e) {
|
|
130
134
|
const editor = this.j;
|
|
@@ -145,29 +149,26 @@ export class addNewLine extends Plugin {
|
|
|
145
149
|
}
|
|
146
150
|
editor.s.setCursorIn(p);
|
|
147
151
|
editor.synchronizeValues();
|
|
148
|
-
this.
|
|
152
|
+
this.__hideForce();
|
|
149
153
|
e.preventDefault();
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
|
-
|
|
156
|
+
__onMouseMove(e) {
|
|
153
157
|
const editor = this.j;
|
|
154
158
|
let currentElement = editor.ed.elementFromPoint(e.clientX, e.clientY);
|
|
155
159
|
if (!Dom.isHTMLElement(currentElement) ||
|
|
156
|
-
Dom.isOrContains(
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if (!Dom.isOrContains(editor.editor, currentElement)) {
|
|
160
|
+
!Dom.isOrContains(editor.editor, currentElement)) {
|
|
160
161
|
return;
|
|
161
162
|
}
|
|
162
163
|
if (editor.editor !== currentElement &&
|
|
163
|
-
!this.
|
|
164
|
-
currentElement = Dom.closest(currentElement, this.
|
|
164
|
+
!this.__isMatchedTag(currentElement)) {
|
|
165
|
+
currentElement = Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
|
|
165
166
|
}
|
|
166
167
|
if (!currentElement) {
|
|
167
|
-
this.
|
|
168
|
+
this.__hide();
|
|
168
169
|
return;
|
|
169
170
|
}
|
|
170
|
-
if (this.
|
|
171
|
+
if (this.__isMatchedTag(currentElement)) {
|
|
171
172
|
const parentBox = Dom.up(currentElement, Dom.isBlock, editor.editor);
|
|
172
173
|
if (parentBox && parentBox !== editor.editor) {
|
|
173
174
|
currentElement = parentBox;
|
|
@@ -184,30 +185,32 @@ export class addNewLine extends Plugin {
|
|
|
184
185
|
const delta = this.j.o.addNewLineDeltaShow;
|
|
185
186
|
if (Math.abs(clientY - pos.top) <= delta) {
|
|
186
187
|
top = pos.top;
|
|
187
|
-
this.
|
|
188
|
+
this.__isBeforeContent = true;
|
|
188
189
|
}
|
|
189
|
-
if (Math.abs(clientY - (pos.top + pos.height)) <= delta) {
|
|
190
|
+
else if (Math.abs(clientY - (pos.top + pos.height)) <= delta) {
|
|
190
191
|
top = pos.top + pos.height;
|
|
191
|
-
this.
|
|
192
|
+
this.__isBeforeContent = false;
|
|
192
193
|
}
|
|
194
|
+
const isEditor = editor.editor === currentElement;
|
|
193
195
|
if (top !== false &&
|
|
194
|
-
((
|
|
195
|
-
!
|
|
196
|
-
|
|
197
|
-
this.
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
196
|
+
((isEditor && !this.__isBeforeContent) ||
|
|
197
|
+
(!isEditor &&
|
|
198
|
+
!call(this.__isBeforeContent ? Dom.prev : Dom.next, currentElement, this.__canGetFocus, editor.editor)))) {
|
|
199
|
+
this.__line.style.top = top + 'px';
|
|
200
|
+
this.__current = currentElement;
|
|
201
|
+
this.__show();
|
|
202
|
+
this.__line.style.setProperty('--jd-anl-handle-offset', clientX - pos.left - 10 + 'px');
|
|
200
203
|
}
|
|
201
204
|
else {
|
|
202
|
-
this.
|
|
203
|
-
this.
|
|
205
|
+
this.__current = false;
|
|
206
|
+
this.__hide();
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
209
|
/** @override */
|
|
207
210
|
beforeDestruct() {
|
|
208
|
-
this.j.async.clearTimeout(this.
|
|
209
|
-
this.j.e.off(this.
|
|
210
|
-
Dom.safeRemove(this.
|
|
211
|
+
this.j.async.clearTimeout(this.__timeout);
|
|
212
|
+
this.j.e.off(this.__line).off('changePlace', this.__addEventListeners);
|
|
213
|
+
Dom.safeRemove(this.__line);
|
|
211
214
|
this.j.e
|
|
212
215
|
.off([this.j.ow, this.j.ew, this.j.editor], '.' + ns)
|
|
213
216
|
.off(this.j.container, '.' + ns);
|
|
@@ -218,11 +221,11 @@ __decorate([
|
|
|
218
221
|
], addNewLine.prototype, "onLock", null);
|
|
219
222
|
__decorate([
|
|
220
223
|
autobind
|
|
221
|
-
], addNewLine.prototype, "
|
|
224
|
+
], addNewLine.prototype, "__hide", null);
|
|
222
225
|
__decorate([
|
|
223
226
|
watch(':dblclick')
|
|
224
227
|
], addNewLine.prototype, "onDblClickEditor", null);
|
|
225
228
|
__decorate([
|
|
226
|
-
|
|
227
|
-
], addNewLine.prototype, "
|
|
229
|
+
throttle(ctx => ctx.defaultTimeout)
|
|
230
|
+
], addNewLine.prototype, "__onMouseMove", null);
|
|
228
231
|
pluginSystem.add('addNewLine', addNewLine);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
5
|
+
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
'copy-format': 'Kopioi muotoilu'
|
|
9
|
+
};
|
|
@@ -8,6 +8,7 @@ import cs_cz from "./cs_cz.js";
|
|
|
8
8
|
import de from "./de.js";
|
|
9
9
|
import es from "./es.js";
|
|
10
10
|
import fa from "./fa.js";
|
|
11
|
+
import fi from "./fi.js";
|
|
11
12
|
import fr from "./fr.js";
|
|
12
13
|
import he from "./he.js";
|
|
13
14
|
import hu from "./hu.js";
|
|
@@ -23,4 +24,4 @@ import ru from "./ru.js";
|
|
|
23
24
|
import tr from "./tr.js";
|
|
24
25
|
import zh_cn from "./zh_cn.js";
|
|
25
26
|
import zh_tw from "./zh_tw.js";
|
|
26
|
-
export { ar, cs_cz, de, es, fa, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
27
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
@@ -8,6 +8,7 @@ import cs_cz from "./cs_cz.js";
|
|
|
8
8
|
import de from "./de.js";
|
|
9
9
|
import es from "./es.js";
|
|
10
10
|
import fa from "./fa.js";
|
|
11
|
+
import fi from "./fi.js";
|
|
11
12
|
import fr from "./fr.js";
|
|
12
13
|
import he from "./he.js";
|
|
13
14
|
import hu from "./hu.js";
|
|
@@ -23,4 +24,4 @@ import ru from "./ru.js";
|
|
|
23
24
|
import tr from "./tr.js";
|
|
24
25
|
import zh_cn from "./zh_cn.js";
|
|
25
26
|
import zh_tw from "./zh_tw.js";
|
|
26
|
-
export { ar, cs_cz, de, es, fa, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
27
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
5
|
+
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
'Line height': 'Rivin korkeus'
|
|
9
|
+
};
|
|
@@ -8,6 +8,7 @@ import * as cs_cz from "./cs_cz.js";
|
|
|
8
8
|
import * as de from "./de.js";
|
|
9
9
|
import * as es from "./es.js";
|
|
10
10
|
import * as fa from "./fa.js";
|
|
11
|
+
import * as fi from "./fi.js";
|
|
11
12
|
import * as fr from "./fr.js";
|
|
12
13
|
import * as he from "./he.js";
|
|
13
14
|
import * as hu from "./hu.js";
|
|
@@ -23,4 +24,4 @@ import * as ru from "./ru.js";
|
|
|
23
24
|
import * as tr from "./tr.js";
|
|
24
25
|
import * as zh_cn from "./zh_cn.js";
|
|
25
26
|
import * as zh_tw from "./zh_tw.js";
|
|
26
|
-
export { ar, cs_cz, de, es, fa, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
27
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
@@ -8,6 +8,7 @@ import * as cs_cz from "./cs_cz.js";
|
|
|
8
8
|
import * as de from "./de.js";
|
|
9
9
|
import * as es from "./es.js";
|
|
10
10
|
import * as fa from "./fa.js";
|
|
11
|
+
import * as fi from "./fi.js";
|
|
11
12
|
import * as fr from "./fr.js";
|
|
12
13
|
import * as he from "./he.js";
|
|
13
14
|
import * as hu from "./hu.js";
|
|
@@ -23,4 +24,4 @@ import * as ru from "./ru.js";
|
|
|
23
24
|
import * as tr from "./tr.js";
|
|
24
25
|
import * as zh_cn from "./zh_cn.js";
|
|
25
26
|
import * as zh_tw from "./zh_tw.js";
|
|
26
|
-
export { ar, cs_cz, de, es, fa, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
27
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
@@ -47,12 +47,12 @@ export declare class resizer extends Plugin {
|
|
|
47
47
|
private getWorkplacePosition;
|
|
48
48
|
private applySize;
|
|
49
49
|
private onDelete;
|
|
50
|
-
private
|
|
50
|
+
private __onChangeEditor;
|
|
51
51
|
/**
|
|
52
52
|
* Bind an edit element to element
|
|
53
53
|
* @param element - The element that you want to add a function to resize
|
|
54
54
|
*/
|
|
55
|
-
private
|
|
55
|
+
private __bind;
|
|
56
56
|
private onClickElement;
|
|
57
57
|
private updateSize;
|
|
58
58
|
private showSizeViewer;
|
|
@@ -24,7 +24,7 @@ import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
|
24
24
|
import { $$, attr, css, offset, innerWidth, markOwner, dataBind } from "jodit/esm/core/helpers/index.js";
|
|
25
25
|
import { Plugin } from "jodit/esm/core/plugin/plugin.js";
|
|
26
26
|
import { eventEmitter } from "jodit/esm/core/global.js";
|
|
27
|
-
import { autobind,
|
|
27
|
+
import { autobind, watch } from "jodit/esm/core/decorators/index.js";
|
|
28
28
|
import { pluginSystem } from "jodit/esm/core/global.js";
|
|
29
29
|
import "./config";
|
|
30
30
|
const keyBInd = '__jodit-resizer_binded';
|
|
@@ -116,11 +116,9 @@ export class resizer extends Plugin {
|
|
|
116
116
|
if (rgx.test(data.value)) {
|
|
117
117
|
data.value = data.value.replace(rgx, '$1');
|
|
118
118
|
}
|
|
119
|
-
})
|
|
120
|
-
.on('hideResizer', this.hide)
|
|
121
|
-
.on('change afterInit afterSetMode', this.onChangeEditor);
|
|
119
|
+
});
|
|
122
120
|
this.addEventListeners();
|
|
123
|
-
this.
|
|
121
|
+
this.__onChangeEditor();
|
|
124
122
|
}
|
|
125
123
|
/**
|
|
126
124
|
* Click in the editor area
|
|
@@ -130,7 +128,7 @@ export class resizer extends Plugin {
|
|
|
130
128
|
const { editor, options: { allowResizeTags } } = this.j;
|
|
131
129
|
while (node && node !== editor) {
|
|
132
130
|
if (Dom.isTag(node, allowResizeTags)) {
|
|
133
|
-
this.
|
|
131
|
+
this.__bind(node);
|
|
134
132
|
this.onClickElement(node);
|
|
135
133
|
return;
|
|
136
134
|
}
|
|
@@ -304,7 +302,7 @@ export class resizer extends Plugin {
|
|
|
304
302
|
e.preventDefault();
|
|
305
303
|
}
|
|
306
304
|
}
|
|
307
|
-
|
|
305
|
+
__onChangeEditor() {
|
|
308
306
|
if (this.isShown) {
|
|
309
307
|
if (!this.element || !this.element.parentNode) {
|
|
310
308
|
this.hide();
|
|
@@ -313,13 +311,13 @@ export class resizer extends Plugin {
|
|
|
313
311
|
this.updateSize();
|
|
314
312
|
}
|
|
315
313
|
}
|
|
316
|
-
$$('iframe', this.j.editor).forEach(this.
|
|
314
|
+
$$('iframe', this.j.editor).forEach(this.__bind);
|
|
317
315
|
}
|
|
318
316
|
/**
|
|
319
317
|
* Bind an edit element to element
|
|
320
318
|
* @param element - The element that you want to add a function to resize
|
|
321
319
|
*/
|
|
322
|
-
|
|
320
|
+
__bind(element) {
|
|
323
321
|
if (!Dom.isHTMLElement(element) ||
|
|
324
322
|
!this.j.o.allowResizeTags.has(element.tagName.toLowerCase()) ||
|
|
325
323
|
dataBind(element, keyBInd)) {
|
|
@@ -451,12 +449,13 @@ __decorate([
|
|
|
451
449
|
autobind
|
|
452
450
|
], resizer.prototype, "onClickOutside", null);
|
|
453
451
|
__decorate([
|
|
454
|
-
|
|
455
|
-
], resizer.prototype, "
|
|
452
|
+
watch(':change')
|
|
453
|
+
], resizer.prototype, "__onChangeEditor", null);
|
|
456
454
|
__decorate([
|
|
457
455
|
autobind
|
|
458
|
-
], resizer.prototype, "
|
|
456
|
+
], resizer.prototype, "__bind", null);
|
|
459
457
|
__decorate([
|
|
460
|
-
autobind
|
|
458
|
+
autobind,
|
|
459
|
+
watch(':hideResizer')
|
|
461
460
|
], resizer.prototype, "hide", null);
|
|
462
461
|
pluginSystem.add('resizer', resizer);
|
|
@@ -17,6 +17,11 @@ declare module 'jodit/config' {
|
|
|
17
17
|
useSearch: boolean;
|
|
18
18
|
search: {
|
|
19
19
|
lazyIdleTimeout: number;
|
|
20
|
+
/**
|
|
21
|
+
* Use custom highlight API https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
|
|
22
|
+
* or use default implementation (wrap text in span and attribute jd-tmp-selection)
|
|
23
|
+
*/
|
|
24
|
+
useCustomHighlightAPI: boolean;
|
|
20
25
|
/**
|
|
21
26
|
* Function to search for a string within a substring. The default implementation is [[fuzzySearchIndex]]
|
|
22
27
|
* But you can write your own. It must implement the [[FuzzySearch]] interface.
|
|
@@ -9,7 +9,9 @@ import searchIcon from "./search.svg.js";
|
|
|
9
9
|
import "./interface";
|
|
10
10
|
Config.prototype.useSearch = true;
|
|
11
11
|
Config.prototype.search = {
|
|
12
|
-
lazyIdleTimeout: 0
|
|
12
|
+
lazyIdleTimeout: 0,
|
|
13
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
14
|
+
useCustomHighlightAPI: typeof window.Highlight !== 'undefined'
|
|
13
15
|
};
|
|
14
16
|
Icon.set('search', searchIcon);
|
|
15
17
|
Config.prototype.controls.find = {
|
package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts}
RENAMED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugins/search
|
|
8
8
|
*/
|
|
9
|
-
import type { ICreate, ISelectionRange } from "jodit/esm/types";
|
|
9
|
+
import type { ICreate, IJodit, ISelectionRange } from "jodit/esm/types";
|
|
10
10
|
/**
|
|
11
11
|
* @private
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function highlightTextRanges(jodit: IJodit, rng: ISelectionRange, restRanges: ISelectionRange[], ci: ICreate, root: HTMLElement): void;
|
|
14
14
|
/**
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.js → highlight-text-ranges.js}
RENAMED
|
@@ -12,11 +12,29 @@ const TMP_ATTR = 'jd-tmp-selection';
|
|
|
12
12
|
/**
|
|
13
13
|
* @private
|
|
14
14
|
*/
|
|
15
|
-
export function
|
|
15
|
+
export function highlightTextRanges(jodit, rng, restRanges, ci, root) {
|
|
16
16
|
if (rng.startContainer.nodeValue == null ||
|
|
17
17
|
rng.endContainer.nodeValue == null) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
+
if (jodit.o.search.useCustomHighlightAPI &&
|
|
21
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
22
|
+
typeof window.Highlight !== 'undefined') {
|
|
23
|
+
const ranges = [rng, ...restRanges].map(rng => {
|
|
24
|
+
const range = jodit.selection.createRange();
|
|
25
|
+
range.setStart(rng.startContainer, rng.startOffset);
|
|
26
|
+
range.setEnd(rng.endContainer, rng.endOffset);
|
|
27
|
+
return range;
|
|
28
|
+
});
|
|
29
|
+
// @ts-ignore Because Highlight is not defined in the types TS 5.3.3
|
|
30
|
+
const searchHighlight = new Highlight(...ranges);
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
CSS.highlights.clear();
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
CSS.highlights.set('jodit-search-result', searchHighlight);
|
|
35
|
+
restRanges.length = 0;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
20
38
|
const span = ci.element('span', {
|
|
21
39
|
[TMP_ATTR]: true
|
|
22
40
|
});
|
|
@@ -19,7 +19,7 @@ import { autobind, cache, watch } from "jodit/esm/core/decorators/index.js";
|
|
|
19
19
|
import { UISearch } from "jodit/esm/plugins/search/ui/search.js";
|
|
20
20
|
import { scrollIntoViewIfNeeded } from "jodit/esm/core/helpers/index.js";
|
|
21
21
|
import { pluginSystem } from "jodit/esm/core/global.js";
|
|
22
|
-
import { clearSelectionWrappers, clearSelectionWrappersFromHTML, getSelectionWrappers, SentenceFinder,
|
|
22
|
+
import { clearSelectionWrappers, clearSelectionWrappersFromHTML, getSelectionWrappers, SentenceFinder, highlightTextRanges } from "./helpers";
|
|
23
23
|
import "./config";
|
|
24
24
|
import { IS_PROD } from "jodit/esm/core/constants.js";
|
|
25
25
|
/**
|
|
@@ -139,7 +139,7 @@ export class search extends Plugin {
|
|
|
139
139
|
this.drawPromise?.rejectCallback();
|
|
140
140
|
this.j.async.cancelAnimationFrame(this.wrapFrameRequest);
|
|
141
141
|
clearSelectionWrappers(this.j.editor);
|
|
142
|
-
this.drawPromise = this.
|
|
142
|
+
this.drawPromise = this.__drawSelectionRanges(bounds);
|
|
143
143
|
}
|
|
144
144
|
this.previousQuery = query;
|
|
145
145
|
let currentIndex = this.ui.currentIndex - 1;
|
|
@@ -214,7 +214,7 @@ export class search extends Plugin {
|
|
|
214
214
|
});
|
|
215
215
|
return this.cache[query];
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
__drawSelectionRanges(ranges) {
|
|
218
218
|
const { async, createInside: ci, editor } = this.j;
|
|
219
219
|
async.cancelAnimationFrame(this.wrapFrameRequest);
|
|
220
220
|
const parts = [...ranges];
|
|
@@ -224,7 +224,7 @@ export class search extends Plugin {
|
|
|
224
224
|
do {
|
|
225
225
|
sRange = parts.shift();
|
|
226
226
|
if (sRange) {
|
|
227
|
-
|
|
227
|
+
highlightTextRanges(this.j, sRange, parts, ci, editor);
|
|
228
228
|
}
|
|
229
229
|
total += 1;
|
|
230
230
|
} while (sRange && total <= 5);
|
|
@@ -247,7 +247,7 @@ export class source extends Plugin {
|
|
|
247
247
|
return false;
|
|
248
248
|
};
|
|
249
249
|
if (!addEventListener()) {
|
|
250
|
-
loadNext(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener);
|
|
250
|
+
loadNext(editor, editor.o.beautifyHTMLCDNUrlsJS).then(addEventListener, () => null);
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
this.syncValueFromWYSIWYG(true);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
5
|
+
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
'Speech Recognize': 'Puheentunnistus',
|
|
9
|
+
newline: 'uusi rivi',
|
|
10
|
+
delete: 'poistaa',
|
|
11
|
+
space: 'tilaa',
|
|
12
|
+
Sound: 'Ääni',
|
|
13
|
+
'Interim Results': 'Välitulokset'
|
|
14
|
+
};
|
|
@@ -8,6 +8,7 @@ import * as cs_cz from "./cs_cz.js";
|
|
|
8
8
|
import * as de from "./de.js";
|
|
9
9
|
import * as es from "./es.js";
|
|
10
10
|
import * as fa from "./fa.js";
|
|
11
|
+
import * as fi from "./fi.js";
|
|
11
12
|
import * as fr from "./fr.js";
|
|
12
13
|
import * as he from "./he.js";
|
|
13
14
|
import * as hu from "./hu.js";
|
|
@@ -23,4 +24,4 @@ import * as ru from "./ru.js";
|
|
|
23
24
|
import * as tr from "./tr.js";
|
|
24
25
|
import * as zh_cn from "./zh_cn.js";
|
|
25
26
|
import * as zh_tw from "./zh_tw.js";
|
|
26
|
-
export { ar, cs_cz, de, es, fa, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
27
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
@@ -9,6 +9,7 @@ import * as cs_cz from "./cs_cz.js";
|
|
|
9
9
|
import * as de from "./de.js";
|
|
10
10
|
import * as es from "./es.js";
|
|
11
11
|
import * as fa from "./fa.js";
|
|
12
|
+
import * as fi from "./fi.js";
|
|
12
13
|
import * as fr from "./fr.js";
|
|
13
14
|
import * as he from "./he.js";
|
|
14
15
|
import * as hu from "./hu.js";
|
|
@@ -24,4 +25,4 @@ import * as ru from "./ru.js";
|
|
|
24
25
|
import * as tr from "./tr.js";
|
|
25
26
|
import * as zh_cn from "./zh_cn.js";
|
|
26
27
|
import * as zh_tw from "./zh_tw.js";
|
|
27
|
-
export { ar, cs_cz, de, es, fa, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
28
|
+
export { ar, cs_cz, de, es, fa, fi, fr, he, hu, id, it, ja, ko, mn, nl, pl, pt_br, ru, tr, zh_cn, zh_tw };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export let Spellcheck: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
4
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
5
|
+
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
Spellcheck: 'Oikeinkirjoituksen tarkistus'
|
|
9
|
+
};
|