suneditor 2.46.0 → 2.46.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suneditor",
3
- "version": "2.46.0",
3
+ "version": "2.46.2",
4
4
  "description": "Vanilla javascript based WYSIWYG web editor, with no dependencies",
5
5
  "author": "JiHong.Lee",
6
6
  "license": "MIT",
@@ -29,31 +29,30 @@
29
29
  "bower_components"
30
30
  ],
31
31
  "devDependencies": {
32
- "@babel/core": "^7.21.3",
33
- "@octokit/rest": "^20.1.0",
34
- "@webpack-cli/init": "^0.2.2",
35
- "babel-loader": "^8.1.0",
36
- "clean-webpack-plugin": "^0.1.19",
37
- "codemirror": "^5.61.0",
38
- "css-loader": "^1.0.1",
39
- "csstype": "^2.6.13",
40
- "dotenv": "^16.4.5",
41
- "file-loader": "^2.0.0",
42
- "html-webpack-plugin": "^3.2.0",
43
- "jasmine": "^2.99.0",
44
- "jasmine-core": "^2.99.1",
45
- "jshint": "^2.13.4",
46
- "karma": "^6.3.19",
47
- "karma-chrome-launcher": "^2.2.0",
48
- "karma-jasmine": "^1.1.2",
49
- "katex": "^0.16.10",
50
- "mini-css-extract-plugin": "^0.4.5",
51
- "optimize-css-assets-webpack-plugin": "^5.0.4",
52
- "url-loader": "^1.1.2",
53
- "webpack": "^4.44.1",
54
- "webpack-cli": "^3.3.12",
55
- "webpack-dev-server": "^3.11.0",
56
- "webpack-merge": "^4.2.2"
32
+ "@babel/core": "~7.21.3",
33
+ "@octokit/rest": "~20.1.0",
34
+ "@webpack-cli/init": "~1.1.3",
35
+ "babel-loader": "~8.1.0",
36
+ "clean-webpack-plugin": "~0.1.19",
37
+ "codemirror": "~5.61.0",
38
+ "css-loader": "~1.0.1",
39
+ "csstype": "~2.6.13",
40
+ "file-loader": "~2.0.0",
41
+ "html-webpack-plugin": "~3.2.0",
42
+ "jasmine": "~2.99.0",
43
+ "jasmine-core": "~2.99.1",
44
+ "jshint": "~2.13.4",
45
+ "karma": "~6.3.19",
46
+ "karma-chrome-launcher": "~2.2.0",
47
+ "karma-jasmine": "~1.1.2",
48
+ "katex": "~0.16.10",
49
+ "mini-css-extract-plugin": "~0.4.5",
50
+ "optimize-css-assets-webpack-plugin": "~5.0.4",
51
+ "url-loader": "~1.1.2",
52
+ "webpack": "~4.44.1",
53
+ "webpack-cli": "~3.3.12",
54
+ "webpack-dev-server": "~3.11.0",
55
+ "webpack-merge": "~4.2.2"
57
56
  },
58
57
  "keywords": [
59
58
  "wysiwyg",
@@ -0,0 +1,5 @@
1
+ import { Lang } from './Lang';
2
+
3
+ declare const cs: Lang;
4
+
5
+ export default cs;
package/src/lang/cs.js ADDED
@@ -0,0 +1,188 @@
1
+ /*
2
+ * wysiwyg web editor
3
+ *
4
+ * suneditor.js
5
+ * Copyright 2017 JiHong Lee.
6
+ * MIT license.
7
+ */
8
+ 'use strict';
9
+
10
+ (function (global, factory) {
11
+ if (typeof module === 'object' && typeof module.exports === 'object') {
12
+ module.exports = global.document ?
13
+ factory(global, true) :
14
+ function (w) {
15
+ if (!w.document) {
16
+ throw new Error('SUNEDITOR_LANG a window with a document');
17
+ }
18
+ return factory(w);
19
+ };
20
+ } else {
21
+ factory(global);
22
+ }
23
+ }(typeof window !== 'undefined' ? window : this, function (window, noGlobal) {
24
+ const lang = {
25
+ code: 'cs',
26
+ toolbar: {
27
+ default: 'Výchozí',
28
+ save: 'Uložit',
29
+ font: 'Písmo',
30
+ formats: 'Formáty',
31
+ fontSize: 'Velikost',
32
+ bold: 'Tučné',
33
+ underline: 'Podtržení',
34
+ italic: 'Kurzíva',
35
+ strike: 'Přeškrtnutí',
36
+ subscript: 'Dolní index',
37
+ superscript: 'Horní index',
38
+ removeFormat: 'Odebrat formát',
39
+ fontColor: 'Barva písma',
40
+ hiliteColor: 'Barva zvýraznění',
41
+ indent: 'Odsadit',
42
+ outdent: 'Předsadit',
43
+ align: 'Zarovnat',
44
+ alignLeft: 'Zarovnat vlevo',
45
+ alignRight: 'Zarovnat vpravo',
46
+ alignCenter: 'Zarovnat na střed',
47
+ alignJustify: 'Zarovnat do bloku',
48
+ list: 'Seznam',
49
+ orderList: 'Seřazený seznam',
50
+ unorderList: 'Neřazený seznam',
51
+ horizontalRule: 'Vodorovná čára',
52
+ hr_solid: 'Nepřerušovaná',
53
+ hr_dotted: 'Tečkovaná',
54
+ hr_dashed: 'Čárkovaná',
55
+ table: 'Tabulka',
56
+ link: 'Odkaz',
57
+ math: 'Matematika',
58
+ image: 'Obrázek',
59
+ video: 'Video',
60
+ audio: 'Zvuk',
61
+ fullScreen: 'Celá obrazovka',
62
+ showBlocks: 'Zobrazit bloky',
63
+ codeView: 'Zobrazení kódu',
64
+ undo: 'Zpět',
65
+ redo: 'Opakovat',
66
+ preview: 'Náhled',
67
+ print: 'tisk',
68
+ tag_p: 'Odstavec',
69
+ tag_div: 'Normální (DIV)',
70
+ tag_h: 'Záhlaví',
71
+ tag_blockquote: 'Citovat',
72
+ tag_pre: 'Kód',
73
+ template: 'Šablona',
74
+ lineHeight: 'Výška řádku',
75
+ paragraphStyle: 'Styl odstavce',
76
+ textStyle: 'Styl textu',
77
+ imageGallery: 'Obrázková galerie',
78
+ dir_ltr: 'Zleva doprava',
79
+ dir_rtl: 'Zprava doleva',
80
+ mention: 'Zmínka'
81
+ },
82
+ dialogBox: {
83
+ linkBox: {
84
+ title: 'Vložit odkaz',
85
+ url: 'URL pro odkaz',
86
+ text: 'Text k zobrazení',
87
+ newWindowCheck: 'Otevřít v novém okně',
88
+ downloadLinkCheck: 'Odkaz ke stažení',
89
+ bookmark: 'Záložka'
90
+ },
91
+ mathBox: {
92
+ title: 'Matematika',
93
+ inputLabel: 'Matematická notace',
94
+ fontSizeLabel: 'Velikost písma',
95
+ previewLabel: 'Náhled'
96
+ },
97
+ imageBox: {
98
+ title: 'Vložit obrázek',
99
+ file: 'Vybrat ze souborů',
100
+ url: 'URL obrázku',
101
+ altText: 'Alternativní text'
102
+ },
103
+ videoBox: {
104
+ title: 'Vložit video',
105
+ file: 'Vybrat ze souborů',
106
+ url: 'URL pro vložení médií, YouTube/Vimeo'
107
+ },
108
+ audioBox: {
109
+ title: 'Vložit zvuk',
110
+ file: 'Vybrat ze souborů',
111
+ url: 'Adresa URL zvuku'
112
+ },
113
+ browser: {
114
+ tags: 'Štítky',
115
+ search: 'Hledat',
116
+ },
117
+ caption: 'Vložit popis',
118
+ close: 'Zavřít',
119
+ submitButton: 'Odeslat',
120
+ revertButton: 'Vrátit zpět',
121
+ proportion: 'Omezení proporcí',
122
+ basic: 'Základní',
123
+ left: 'Vlevo',
124
+ right: 'Vpravo',
125
+ center: 'Střed',
126
+ width: 'Šířka',
127
+ height: 'Výška',
128
+ size: 'Velikost',
129
+ ratio: 'Poměr'
130
+ },
131
+ controller: {
132
+ edit: 'Upravit',
133
+ unlink: 'Odpojit',
134
+ remove: 'Odebrat',
135
+ insertRowAbove: 'Vložit řádek výše',
136
+ insertRowBelow: 'Vložit řádek níže',
137
+ deleteRow: 'Smazat řádek',
138
+ insertColumnBefore: 'Vložit sloupec před',
139
+ insertColumnAfter: 'Vložit sloupec za',
140
+ deleteColumn: 'Smazat sloupec',
141
+ fixedColumnWidth: 'Pevná šířka sloupce',
142
+ resize100: 'Změnit velikost 100%',
143
+ resize75: 'Změnit velikost 75%',
144
+ resize50: 'Změnit velikost 50%',
145
+ resize25: 'Změnit velikost 25%',
146
+ autoSize: 'Automatická velikost',
147
+ mirrorHorizontal: 'Zrcadlo, horizontální',
148
+ mirrorVertical: 'Zrcadlo, vertikální',
149
+ rotateLeft: 'Otočit doleva',
150
+ rotateRight: 'Otočit doprava',
151
+ maxSize: 'Max. velikost',
152
+ minSize: 'Min. velikost',
153
+ tableHeader: 'Záhlaví tabulky',
154
+ mergeCells: 'Spojit buňky',
155
+ splitCells: 'Rozdělit buňky',
156
+ HorizontalSplit: 'Vodorovné rozdělení',
157
+ VerticalSplit: 'Svislé rozdělení'
158
+ },
159
+ menu: {
160
+ spaced: 'Rozložené',
161
+ bordered: 'Ohraničené',
162
+ neon: 'Neon',
163
+ translucent: 'Průsvitné',
164
+ shadow: 'Stín',
165
+ code: 'Kód'
166
+ }
167
+ };
168
+
169
+ if (typeof noGlobal === typeof undefined) {
170
+ if (!window.SUNEDITOR_LANG) {
171
+ Object.defineProperty(window, 'SUNEDITOR_LANG', {
172
+ enumerable: true,
173
+ writable: false,
174
+ configurable: false,
175
+ value: {}
176
+ });
177
+ }
178
+
179
+ Object.defineProperty(window.SUNEDITOR_LANG, 'cs', {
180
+ enumerable: true,
181
+ writable: true,
182
+ configurable: true,
183
+ value: lang
184
+ });
185
+ }
186
+
187
+ return lang;
188
+ }));
@@ -1,4 +1,5 @@
1
1
  import ckb from './ckb';
2
+ import cs from './cs';
2
3
  import da from './da';
3
4
  import de from './de';
4
5
  import en from './en';
@@ -19,4 +20,4 @@ import ua from './ua';
19
20
  import ur from './ur';
20
21
  import zh_cn from './zh_cn';
21
22
 
22
- export { ckb, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
23
+ export { ckb, cs, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
package/src/lang/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  import ckb from './ckb';
4
+ import cs from './cs';
4
5
  import da from './da';
5
6
  import de from './de';
6
7
  import en from './en';
@@ -21,5 +22,5 @@ import ua from './ua';
21
22
  import ur from './ur';
22
23
  import zh_cn from './zh_cn';
23
24
 
24
- export { ckb, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
25
- export default { ckb, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
25
+ export { ckb, cs, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
26
+ export default { ckb, cs, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
@@ -87,8 +87,7 @@ export default {
87
87
  /// focus temp
88
88
  const focusTemp = doc.createElement('INPUT');
89
89
  focusTemp.tabIndex = -1;
90
- focusTemp.style.width = '0 !important';
91
- focusTemp.style.height = '0 !important';
90
+ focusTemp.style.cssText = 'position: absolute !important; top: -10000px !important; display: block !important; width: 0 !important; height: 0 !important; margin: 0 !important; padding: 0 !important;';
92
91
 
93
92
  // toolbar container
94
93
  const toolbarContainer = options.toolbarContainer;
package/src/lib/core.js CHANGED
@@ -477,7 +477,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
477
477
  _cleanStyleRegExp: {
478
478
  div: new _w.RegExp('\\s*[^-a-zA-Z](.+)\\s*:[^;]+(?!;)*', 'ig'),
479
479
  span: new _w.RegExp('\\s*[^-a-zA-Z](font-family|font-size|color|background-color)\\s*:[^;]+(?!;)*', 'ig'),
480
- format: new _w.RegExp('\\s*[^-a-zA-Z](text-align|margin-left|margin-right|width|height)\\s*:[^;]+(?!;)*', 'ig'),
480
+ format: new _w.RegExp('\\s*[^-a-zA-Z](text-align|margin-left|margin-right|width|height|line-height)\\s*:[^;]+(?!;)*', 'ig'),
481
481
  fontSizeUnit: new _w.RegExp('\\d+' + options.fontSizeUnit + '$', 'i'),
482
482
  },
483
483
 
@@ -88,7 +88,7 @@ export default {
88
88
 
89
89
  if (currentFont !== fontContext.currentFont) {
90
90
  for (let i = 0, len = fontList.length; i < len; i++) {
91
- if (currentFont === fontList[i].getAttribute('data-value')) {
91
+ if (currentFont === (fontList[i].getAttribute('data-value') || '').replace(/'|"/g, '')) {
92
92
  this.util.addClass(fontList[i], 'active');
93
93
  } else {
94
94
  this.util.removeClass(fontList[i], 'active');
@@ -105,10 +105,13 @@ export default {
105
105
  e.preventDefault();
106
106
  e.stopPropagation();
107
107
 
108
- const value = e.target.getAttribute('data-value');
108
+ let value = e.target.getAttribute('data-value');
109
109
 
110
110
  if (value) {
111
111
  const newNode = this.util.createElement('SPAN');
112
+ if (/[\s\d\W]/.test(value) && !/^['"].*['"]$/.test(value)) {
113
+ value = '"' + value + '"';
114
+ }
112
115
  newNode.style.fontFamily = value;
113
116
  this.nodeChange(newNode, ['font-family'], null, null);
114
117
  } else {