jodit 4.0.0-beta.44 → 4.0.0-beta.49

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 (81) hide show
  1. package/README.md +4 -4
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.js +414 -333
  4. package/es2015/jodit.min.js +2 -2
  5. package/es2015/plugins/debug/debug.js +1 -1
  6. package/es2015/plugins/debug/debug.min.js +1 -1
  7. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.js +781 -761
  9. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  10. package/es2018/jodit.css +1 -1
  11. package/es2018/jodit.js +412 -331
  12. package/es2018/jodit.min.js +2 -2
  13. package/es2018/plugins/debug/debug.js +1 -1
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  16. package/es2018/plugins/speech-recognize/speech-recognize.js +781 -761
  17. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  18. package/es2021/jodit.css +1 -1
  19. package/es2021/jodit.js +412 -331
  20. package/es2021/jodit.min.js +2 -2
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +780 -760
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.js +12 -11
  28. package/es2021.en/jodit.min.js +2 -2
  29. package/es2021.en/plugins/debug/debug.js +1 -1
  30. package/es2021.en/plugins/debug/debug.min.js +1 -1
  31. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  32. package/es2021.en/plugins/speech-recognize/speech-recognize.js +3 -3
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  34. package/es5/jodit.css +2 -2
  35. package/es5/jodit.js +1103 -1023
  36. package/es5/jodit.min.css +1 -1
  37. package/es5/jodit.min.js +2 -2
  38. package/es5/plugins/debug/debug.js +2 -2
  39. package/es5/plugins/debug/debug.min.js +2 -2
  40. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  41. package/es5/plugins/speech-recognize/speech-recognize.js +798 -778
  42. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  43. package/esm/config.js +2 -1
  44. package/esm/core/constants.js +1 -1
  45. package/esm/plugins/preview/preview.js +1 -1
  46. package/package.json +1 -1
  47. package/types/config.d.ts +2 -1
  48. package/types/tsconfig.json +2 -20
  49. package/esm/plugins/source/editor/engines/custom.js +0 -34
  50. package/esm/plugins/speech-recognize/config.js +0 -92
  51. package/esm/plugins/speech-recognize/constants.js +0 -11
  52. package/esm/plugins/speech-recognize/helpers/api.js +0 -7
  53. package/esm/plugins/speech-recognize/helpers/exec-spell-command.js +0 -9
  54. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +0 -168
  55. package/esm/plugins/speech-recognize/helpers/sound.js +0 -30
  56. package/esm/plugins/speech-recognize/interface.js +0 -6
  57. package/esm/plugins/speech-recognize/langs/ar.js +0 -14
  58. package/esm/plugins/speech-recognize/langs/cs_cz.js +0 -14
  59. package/esm/plugins/speech-recognize/langs/de.js +0 -14
  60. package/esm/plugins/speech-recognize/langs/es.js +0 -14
  61. package/esm/plugins/speech-recognize/langs/fa.js +0 -14
  62. package/esm/plugins/speech-recognize/langs/fr.js +0 -14
  63. package/esm/plugins/speech-recognize/langs/he.js +0 -14
  64. package/esm/plugins/speech-recognize/langs/hu.js +0 -14
  65. package/esm/plugins/speech-recognize/langs/id.js +0 -14
  66. package/esm/plugins/speech-recognize/langs/index.js +0 -1
  67. package/esm/plugins/speech-recognize/langs/it.js +0 -14
  68. package/esm/plugins/speech-recognize/langs/ja.js +0 -14
  69. package/esm/plugins/speech-recognize/langs/ko.js +0 -14
  70. package/esm/plugins/speech-recognize/langs/mn.js +0 -14
  71. package/esm/plugins/speech-recognize/langs/nl.js +0 -14
  72. package/esm/plugins/speech-recognize/langs/pl.js +0 -14
  73. package/esm/plugins/speech-recognize/langs/pt_br.js +0 -14
  74. package/esm/plugins/speech-recognize/langs/ru.js +0 -14
  75. package/esm/plugins/speech-recognize/langs/tr.js +0 -14
  76. package/esm/plugins/speech-recognize/langs/zh_cn.js +0 -14
  77. package/esm/plugins/speech-recognize/langs/zh_tw.js +0 -14
  78. package/esm/plugins/speech-recognize/speech-recognize.js +0 -115
  79. package/esm/polyfills.js +0 -54
  80. package/types/plugins/source/editor/engines/custom.d.ts +0 -27
  81. package/types/polyfills.d.ts +0 -10
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'újsor',
9
- delete: 'törlés',
10
- space: 'tér',
11
- 'Speech Recognize': 'A Beszéd Felismeri',
12
- Sound: 'Hang',
13
- 'Interim Results': 'Időközi Eredmények'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'newline',
9
- delete: 'Hapus',
10
- space: 'ruang',
11
- 'Speech Recognize': 'Pidato Mengenali',
12
- Sound: 'Suara',
13
- 'Interim Results': 'Hasil Sementara'
14
- };
@@ -1 +0,0 @@
1
- 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 };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'nuova riga',
9
- delete: 'eliminare',
10
- space: 'spazio',
11
- 'Speech Recognize': 'Discorso Riconoscere',
12
- Sound: 'Suono',
13
- 'Interim Results': 'Risultati intermedi'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: '改行',
9
- delete: '削除',
10
- space: 'スペース',
11
- 'Speech Recognize': '音声認識',
12
- Sound: '音',
13
- 'Interim Results': '中間結果'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: '줄 바꿈',
9
- delete: '삭제',
10
- space: '공간',
11
- 'Speech Recognize': '음성 인식',
12
- Sound: '소리',
13
- 'Interim Results': '중간 결과'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'Шинэ мөр',
9
- delete: 'Устгах',
10
- space: 'Зай',
11
- 'Speech Recognize': 'Дуу хоолой таних',
12
- Sound: 'Дуу',
13
- 'Interim Results': 'Түр зуурын үр дүн'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'regel',
9
- delete: 'verwijderen',
10
- space: 'ruimte',
11
- 'Speech Recognize': 'Spraak Herkennen',
12
- Sound: 'Geluid',
13
- 'Interim Results': 'Tussentijdse Resultaten'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'newline',
9
- delete: 'usunąć',
10
- space: 'przestrzeń',
11
- 'Speech Recognize': 'Rozpoznawanie Mowy',
12
- Sound: 'Dźwięk',
13
- 'Interim Results': 'Wyniki Okresowe'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'linha',
9
- delete: 'excluir',
10
- space: 'espaco',
11
- 'Speech Recognize': 'Discurso Reconhecer',
12
- Sound: 'Som',
13
- 'Interim Results': 'Resultados Provisórios'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'новая строка|перенос|энтер',
9
- delete: 'удалить',
10
- space: 'пробел',
11
- 'Speech Recognize': 'Распознавание речи',
12
- Sound: 'Звук',
13
- 'Interim Results': 'Промежуточные результаты'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'yeni satır',
9
- delete: 'silmek',
10
- space: 'uzay',
11
- 'Speech Recognize': 'Konuşma Tanıma',
12
- Sound: 'Ses',
13
- 'Interim Results': 'Ara Sonuçlar'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: '新行',
9
- delete: '删除',
10
- space: '空间',
11
- 'Speech Recognize': '言语识别',
12
- Sound: '声音',
13
- 'Interim Results': '中期业绩'
14
- };
@@ -1,14 +0,0 @@
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-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
6
- */
7
- export default {
8
- newline: 'นิวไลน์',
9
- delete: 'ลบ',
10
- space: 'พื้นที่',
11
- 'Speech Recognize': 'การรับรู้คำพูด',
12
- Sound: 'เสียง',
13
- 'Interim Results': 'ผลระหว่างกาล'
14
- };
@@ -1,115 +0,0 @@
1
- /*!
2
- * Jodit Editor (https://xdsoft.net/jodit/)
3
- * Released under MIT see LICENSE.txt in the project root for license information.
4
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
9
- r = Reflect.decorate(decorators, target, key, desc);
10
- else
11
- for (var i = decorators.length - 1; i >= 0; i--)
12
- if (d = decorators[i])
13
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15
- };
16
- /**
17
- * [[include:plugins/speech-recognize/README.md]]
18
- * @packageDocumentation
19
- * @module plugins/speech-recognize
20
- */
21
- import { Plugin } from "../../core/plugin/index.js";
22
- import { watch } from "../../core/decorators/watch/watch.js";
23
- import { keys } from "../../core/helpers/utils/utils.js";
24
- import { extendLang } from "../../core/global.js";
25
- import { Dom } from "../../core/dom/dom.js";
26
- import { debounce } from "../../core/decorators/debounce/debounce.js";
27
- import { execSpellCommand } from "./helpers/exec-spell-command.js";
28
- import * as langs from "./langs/index.js";
29
- import "./config.js";
30
- export class SpeechRecognizeNative extends Plugin {
31
- constructor(j) {
32
- super(j);
33
- this._commandToWord = {};
34
- if (j.o.speechRecognize.api) {
35
- j.registerButton({
36
- group: 'state',
37
- name: 'speechRecognize'
38
- });
39
- }
40
- }
41
- afterInit(jodit) {
42
- const { commands } = jodit.o.speechRecognize;
43
- if (commands) {
44
- extendLang(langs);
45
- keys(commands, false).forEach(words => {
46
- const keys = words.split('|');
47
- keys.forEach(key => {
48
- key = key.trim().toLowerCase();
49
- this._commandToWord[key] = commands[words];
50
- const translatedKeys = jodit.i18n(key);
51
- if (translatedKeys !== key) {
52
- translatedKeys.split('|').forEach(translatedKey => {
53
- this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
54
- });
55
- }
56
- });
57
- });
58
- }
59
- }
60
- beforeDestruct(jodit) { }
61
- onSpeechRecognizeProgressResult(text) {
62
- if (!this.messagePopup) {
63
- this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
64
- }
65
- this.j.workplace.appendChild(this.messagePopup);
66
- this.j.async.setTimeout(() => {
67
- Dom.safeRemove(this.messagePopup);
68
- }, {
69
- label: 'onSpeechRecognizeProgressResult',
70
- timeout: 1000
71
- });
72
- this.messagePopup.innerText = text + '|';
73
- }
74
- onSpeechRecognizeResult(text) {
75
- const { j } = this, { s } = j;
76
- Dom.safeRemove(this.messagePopup);
77
- if (!this._checkCommand(text)) {
78
- const { range } = s, node = s.current();
79
- if (s.isCollapsed() &&
80
- Dom.isText(node) &&
81
- Dom.isOrContains(j.editor, node) &&
82
- node.nodeValue) {
83
- const sentence = node.nodeValue;
84
- node.nodeValue =
85
- sentence +
86
- (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') +
87
- text;
88
- range.setStartAfter(node);
89
- s.selectRange(range);
90
- j.synchronizeValues();
91
- }
92
- else {
93
- s.insertHTML(text);
94
- }
95
- }
96
- }
97
- _checkCommand(command) {
98
- command = command.toLowerCase().replace(/\./g, '');
99
- if (this._commandToWord[command]) {
100
- execSpellCommand(this.j, this._commandToWord[command]);
101
- return true;
102
- }
103
- return false;
104
- }
105
- }
106
- __decorate([
107
- watch(':speechRecognizeProgressResult'),
108
- debounce()
109
- ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
110
- __decorate([
111
- watch(':speechRecognizeResult')
112
- ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
113
- if (typeof Jodit !== 'undefined') {
114
- Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
115
- }
package/esm/polyfills.js DELETED
@@ -1,54 +0,0 @@
1
- /*!
2
- * Jodit Editor (https://xdsoft.net/jodit/)
3
- * Released under MIT see LICENSE.txt in the project root for license information.
4
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- import "classlist-polyfill";
7
- import "es6-promise/auto";
8
- import "core-js/es/symbol";
9
- import "core-js/es/array/find-index";
10
- import "core-js/es/array/from";
11
- // for ie11
12
- if (!Array.prototype.includes) {
13
- Array.prototype.includes = function (value) {
14
- return this.indexOf(value) > -1;
15
- };
16
- }
17
- // for ie11
18
- if (typeof Object.assign !== 'function') {
19
- // Must be writable: true, enumerable: false, configurable: true
20
- Object.defineProperty(Object, 'assign', {
21
- value: function assign(target, varArgs) {
22
- // .length of function is 2
23
- if (target == null) {
24
- throw new TypeError('Cannot convert undefined or null to object');
25
- }
26
- const to = Object(target);
27
- for (let index = 1; index < arguments.length; index++) {
28
- // eslint-disable-next-line prefer-rest-params
29
- const nextSource = arguments[index];
30
- if (nextSource != null) {
31
- for (const nextKey in nextSource) {
32
- // Avoid bugs when hasOwnProperty is shadowed
33
- if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
34
- to[nextKey] = nextSource[nextKey];
35
- }
36
- }
37
- }
38
- }
39
- return to;
40
- },
41
- writable: true,
42
- configurable: true
43
- });
44
- }
45
- if (!Array.prototype.find) {
46
- Array.prototype.find = function (value) {
47
- return this.indexOf(value) > -1 ? value : undefined;
48
- };
49
- }
50
- if (!String.prototype.endsWith) {
51
- String.prototype.endsWith = function (value) {
52
- return this[this.length - 1] === value;
53
- };
54
- }
@@ -1,27 +0,0 @@
1
- /*!
2
- * Jodit Editor (https://xdsoft.net/jodit/)
3
- * Released under MIT see LICENSE.txt in the project root for license information.
4
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- /**
7
- * @module plugins/source
8
- */
9
- import type { ISourceEditor } from "../../../../types";
10
- import { SourceEditor } from "../sourceEditor";
11
- export declare class CustomEditor extends SourceEditor<HTMLTextAreaElement> implements ISourceEditor {
12
- isFocused: boolean;
13
- blur(): void;
14
- init(): any;
15
- destruct(): any;
16
- getValue(): string;
17
- setValue(raw: string): void;
18
- insertRaw(raw: string): void;
19
- getSelectionStart(): number;
20
- getSelectionEnd(): number;
21
- setSelectionRange(start: number, end: number): void;
22
- focus(): void;
23
- setPlaceHolder(title: string): void;
24
- setReadOnly(isReadOnly: boolean): void;
25
- selectAll(): void;
26
- replaceUndoManager(): void;
27
- }
@@ -1,10 +0,0 @@
1
- /*!
2
- * Jodit Editor (https://xdsoft.net/jodit/)
3
- * Released under MIT see LICENSE.txt in the project root for license information.
4
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
- */
6
- import "classlist-polyfill";
7
- import "es6-promise/auto";
8
- import "core-js/es/symbol";
9
- import "core-js/es/array/find-index";
10
- import "core-js/es/array/from";