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.
Files changed (133) hide show
  1. package/CHANGELOG.md +15 -5
  2. package/es2015/jodit.css +19 -19
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +633 -529
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +72 -46
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  13. package/es2018/jodit.css +19 -19
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +633 -529
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +72 -46
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  24. package/es2021/jodit.css +19 -19
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +632 -528
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +72 -46
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  35. package/es2021.en/jodit.css +19 -19
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +333 -313
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +3 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  46. package/es5/jodit.css +25 -19
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +646 -542
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +72 -46
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  57. package/esm/core/async/async.d.ts +1 -1
  58. package/esm/core/async/async.js +2 -2
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/create/create.d.ts +1 -1
  61. package/esm/core/helpers/utils/append-script.d.ts +1 -5
  62. package/esm/core/helpers/utils/append-script.js +13 -28
  63. package/esm/core/plugin/helpers/load.d.ts +1 -1
  64. package/esm/core/plugin/helpers/load.js +2 -2
  65. package/esm/core/plugin/plugin-system.js +5 -5
  66. package/esm/core/plugin/plugin.js +5 -1
  67. package/esm/core/ui/popup/popup.js +1 -0
  68. package/esm/core/view/view-with-toolbar.js +4 -1
  69. package/esm/langs/fi.d.ts +218 -0
  70. package/esm/langs/fi.js +231 -0
  71. package/esm/languages.js +2 -0
  72. package/esm/plugins/add-new-line/add-new-line.d.ts +14 -14
  73. package/esm/plugins/add-new-line/add-new-line.js +76 -73
  74. package/esm/plugins/copy-format/langs/fi.d.ts +4 -0
  75. package/esm/plugins/copy-format/langs/fi.js +9 -0
  76. package/esm/plugins/copy-format/langs/index.d.ts +2 -1
  77. package/esm/plugins/copy-format/langs/index.js +2 -1
  78. package/esm/plugins/line-height/langs/fi.d.ts +4 -0
  79. package/esm/plugins/line-height/langs/fi.js +9 -0
  80. package/esm/plugins/line-height/langs/index.d.ts +2 -1
  81. package/esm/plugins/line-height/langs/index.js +2 -1
  82. package/esm/plugins/resizer/resizer.d.ts +2 -2
  83. package/esm/plugins/resizer/resizer.js +12 -13
  84. package/esm/plugins/search/config.d.ts +5 -0
  85. package/esm/plugins/search/config.js +3 -1
  86. package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts} +2 -2
  87. package/esm/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.js → highlight-text-ranges.js} +19 -1
  88. package/esm/plugins/search/helpers/index.d.ts +1 -1
  89. package/esm/plugins/search/helpers/index.js +1 -1
  90. package/esm/plugins/search/search.d.ts +1 -1
  91. package/esm/plugins/search/search.js +4 -4
  92. package/esm/plugins/source/source.js +1 -1
  93. package/esm/plugins/speech-recognize/langs/fi.d.ts +9 -0
  94. package/esm/plugins/speech-recognize/langs/fi.js +14 -0
  95. package/esm/plugins/speech-recognize/langs/index.d.ts +2 -1
  96. package/esm/plugins/speech-recognize/langs/index.js +2 -1
  97. package/esm/plugins/spellcheck/langs/fi.d.ts +1 -0
  98. package/esm/plugins/spellcheck/langs/fi.js +9 -0
  99. package/esm/plugins/spellcheck/langs/index.d.ts +2 -1
  100. package/esm/plugins/spellcheck/langs/index.js +2 -1
  101. package/esm/plugins/symbols/langs/fi.d.ts +1 -0
  102. package/esm/plugins/symbols/langs/fi.js +9 -0
  103. package/esm/plugins/symbols/langs/index.d.ts +2 -1
  104. package/esm/plugins/symbols/langs/index.js +2 -1
  105. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.d.ts +1 -1
  106. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +70 -73
  107. package/esm/tsconfig.json +1 -1
  108. package/esm/types/create.d.ts +1 -1
  109. package/package.json +1 -1
  110. package/types/core/async/async.d.ts +1 -1
  111. package/types/core/create/create.d.ts +1 -1
  112. package/types/core/helpers/utils/append-script.d.ts +1 -5
  113. package/types/core/plugin/helpers/load.d.ts +1 -1
  114. package/types/langs/fi.d.ts +218 -0
  115. package/types/plugins/add-new-line/add-new-line.d.ts +14 -14
  116. package/types/plugins/copy-format/langs/fi.d.ts +4 -0
  117. package/types/plugins/copy-format/langs/index.d.ts +2 -1
  118. package/types/plugins/line-height/langs/fi.d.ts +4 -0
  119. package/types/plugins/line-height/langs/index.d.ts +2 -1
  120. package/types/plugins/resizer/resizer.d.ts +2 -2
  121. package/types/plugins/search/config.d.ts +5 -0
  122. package/types/plugins/search/helpers/{wrap-ranges-texts-in-tmp-span.d.ts → highlight-text-ranges.d.ts} +2 -2
  123. package/types/plugins/search/helpers/index.d.ts +1 -1
  124. package/types/plugins/search/search.d.ts +1 -1
  125. package/types/plugins/speech-recognize/langs/fi.d.ts +9 -0
  126. package/types/plugins/speech-recognize/langs/index.d.ts +2 -1
  127. package/types/plugins/spellcheck/langs/fi.d.ts +1 -0
  128. package/types/plugins/spellcheck/langs/index.d.ts +2 -1
  129. package/types/plugins/symbols/langs/fi.d.ts +1 -0
  130. package/types/plugins/symbols/langs/index.d.ts +2 -1
  131. package/types/plugins/table-keyboard-navigation/table-keyboard-navigation.d.ts +1 -1
  132. package/types/tsconfig.json +1 -1
  133. 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, debounce, watch } from "jodit/esm/core/decorators/index.js";
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.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 &&
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.preview = false;
37
- this.lineInFocus = false;
38
- this.isShown = false;
39
- this.hideForce = () => {
40
- if (!this.isShown) {
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.isShown = false;
44
- this.j.async.clearTimeout(this.timeout);
45
- this.lineInFocus = false;
46
- Dom.safeRemove(this.line);
47
- this.line.style.setProperty('--jd-offset-handle', '0');
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.canGetFocus = (elm) => {
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.onClickLine = (e) => {
54
+ this.__onClickLine = (e) => {
55
55
  const editor = this.j;
56
56
  const p = editor.createInside.element(editor.o.enter);
57
- if (this.preview && this.current && this.current.parentNode) {
58
- if (this.current === editor.editor) {
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.current.parentNode.insertBefore(p, this.current);
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.hideForce();
73
+ this.__hideForce();
72
74
  e.preventDefault();
73
75
  };
74
76
  }
75
- show() {
76
- if (this.isShown || this.j.o.readonly || this.j.isLocked) {
77
+ __show() {
78
+ if (this.j.o.readonly || this.j.isLocked) {
77
79
  return;
78
80
  }
79
- this.isShown = true;
80
- this.j.async.clearTimeout(this.timeout);
81
- this.line.classList.toggle('jodit-add-new-line_after', !this.preview);
82
- this.j.container.appendChild(this.line);
83
- this.line.style.width = this.j.container.clientWidth + 'px';
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.isShown) {
87
- this.hideForce();
90
+ if (isLocked && this.__isShown) {
91
+ this.__hideForce();
88
92
  }
89
93
  }
90
- hide() {
91
- if (!this.isShown || this.lineInFocus) {
94
+ __hide() {
95
+ if (!this.__isShown || this.__lineInFocus) {
92
96
  return;
93
97
  }
94
- this.timeout = this.j.async.setTimeout(this.hideForce, {
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.line, 'mousemove', (e) => {
108
+ .on(this.__line, 'mousemove', (e) => {
105
109
  e.stopPropagation();
106
110
  })
107
- .on(this.line, 'mousedown touchstart', this.onClickLine)
108
- .on('change', this.hideForce)
109
- .on(this.line, 'mouseenter', () => {
110
- this.j.async.clearTimeout(this.timeout);
111
- this.lineInFocus = true;
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.line, 'mouseleave', () => {
114
- this.lineInFocus = false;
117
+ .on(this.__line, 'mouseleave', () => {
118
+ this.__lineInFocus = false;
115
119
  })
116
- .on('changePlace', this.addEventListeners.bind(this));
117
- this.addEventListeners();
120
+ .on('changePlace', this.__addEventListeners.bind(this));
121
+ this.__addEventListeners();
118
122
  }
119
- addEventListeners() {
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.hideForce)
125
- .on(editor.editor, 'click' + '.' + ns, this.hide)
126
- .on(editor.container, 'mouseleave' + '.' + ns, this.hide)
127
- .on(editor.editor, 'mousemove' + '.' + ns, this.onMouseMove);
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.hideForce();
152
+ this.__hideForce();
149
153
  e.preventDefault();
150
154
  }
151
155
  }
152
- onMouseMove(e) {
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(this.line, currentElement)) {
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.isMatchedTag(currentElement)) {
164
- currentElement = Dom.closest(currentElement, this.isMatchedTag, editor.editor);
164
+ !this.__isMatchedTag(currentElement)) {
165
+ currentElement = Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
165
166
  }
166
167
  if (!currentElement) {
167
- this.hide();
168
+ this.__hide();
168
169
  return;
169
170
  }
170
- if (this.isMatchedTag(currentElement)) {
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.preview = true;
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.preview = false;
192
+ this.__isBeforeContent = false;
192
193
  }
194
+ const isEditor = editor.editor === currentElement;
193
195
  if (top !== false &&
194
- ((editor.editor === currentElement && !this.preview) ||
195
- !call(this.preview ? Dom.prev : Dom.next, currentElement, this.canGetFocus, editor.editor))) {
196
- this.line.style.top = top + 'px';
197
- this.current = currentElement;
198
- this.show();
199
- this.line.style.setProperty('--jd-offset-handle', clientX - pos.left - 10 + 'px');
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.current = false;
203
- this.hide();
205
+ this.__current = false;
206
+ this.__hide();
204
207
  }
205
208
  }
206
209
  /** @override */
207
210
  beforeDestruct() {
208
- this.j.async.clearTimeout(this.timeout);
209
- this.j.e.off(this.line).off('changePlace', this.addEventListeners);
210
- Dom.safeRemove(this.line);
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, "hide", null);
224
+ ], addNewLine.prototype, "__hide", null);
222
225
  __decorate([
223
226
  watch(':dblclick')
224
227
  ], addNewLine.prototype, "onDblClickEditor", null);
225
228
  __decorate([
226
- debounce(ctx => ctx.defaultTimeout * 5)
227
- ], addNewLine.prototype, "onMouseMove", null);
229
+ throttle(ctx => ctx.defaultTimeout)
230
+ ], addNewLine.prototype, "__onMouseMove", null);
228
231
  pluginSystem.add('addNewLine', addNewLine);
@@ -0,0 +1,4 @@
1
+ declare const _exports: {
2
+ 'copy-format': string;
3
+ };
4
+ export = _exports;
@@ -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,4 @@
1
+ declare const _exports: {
2
+ 'Line height': string;
3
+ };
4
+ export = _exports;
@@ -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 onChangeEditor;
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 bind;
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, debounce, watch } from "jodit/esm/core/decorators/index.js";
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.onChangeEditor();
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.bind(node);
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
- onChangeEditor() {
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.bind);
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
- bind(element) {
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
- debounce()
455
- ], resizer.prototype, "onChangeEditor", null);
452
+ watch(':change')
453
+ ], resizer.prototype, "__onChangeEditor", null);
456
454
  __decorate([
457
455
  autobind
458
- ], resizer.prototype, "bind", null);
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 = {
@@ -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 wrapRangesTextsInTmpSpan(rng: ISelectionRange, restRanges: ISelectionRange[], ci: ICreate, root: HTMLElement): void;
13
+ export declare function highlightTextRanges(jodit: IJodit, rng: ISelectionRange, restRanges: ISelectionRange[], ci: ICreate, root: HTMLElement): void;
14
14
  /**
15
15
  * @private
16
16
  */
@@ -12,11 +12,29 @@ const TMP_ATTR = 'jd-tmp-selection';
12
12
  /**
13
13
  * @private
14
14
  */
15
- export function wrapRangesTextsInTmpSpan(rng, restRanges, ci, root) {
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
  });
@@ -7,4 +7,4 @@
7
7
  * @module plugins/search
8
8
  */
9
9
  export * from "./sentence-finder";
10
- export * from "./wrap-ranges-texts-in-tmp-span";
10
+ export * from "./highlight-text-ranges";
@@ -7,4 +7,4 @@
7
7
  * @module plugins/search
8
8
  */
9
9
  export * from "./sentence-finder";
10
- export * from "./wrap-ranges-texts-in-tmp-span";
10
+ export * from "./highlight-text-ranges";
@@ -46,7 +46,7 @@ export declare class search extends Plugin {
46
46
  private isValidCache;
47
47
  private find;
48
48
  private wrapFrameRequest;
49
- private drawSelectionRanges;
49
+ private __drawSelectionRanges;
50
50
  protected onAfterGetValueFromEditor(data: {
51
51
  value: string;
52
52
  }): void;
@@ -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, wrapRangesTextsInTmpSpan } from "./helpers";
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.drawSelectionRanges(bounds);
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
- drawSelectionRanges(ranges) {
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
- wrapRangesTextsInTmpSpan(sRange, parts, ci, editor);
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,9 @@
1
+ declare const _exports: {
2
+ 'Speech Recognize': string;
3
+ newline: string;
4
+ delete: string;
5
+ space: string;
6
+ Sound: string;
7
+ 'Interim Results': string;
8
+ };
9
+ export = _exports;
@@ -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
+ };