jodit 3.18.3 → 3.18.4

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.
@@ -11,37 +11,24 @@
11
11
  <select />
12
12
  </component>
13
13
  <component name="ChangeListManager">
14
- <list default="true" id="5da7ff7f-03a8-49de-9fbb-8f8640d83b83" name="Default Changelist" comment="Merge">
15
- <change afterPath="$PROJECT_DIR$/build-system/utils/include-plugins.js" afterDir="false" />
16
- <change afterPath="$PROJECT_DIR$/src/plugins/speech/speech-recognize/README.md" afterDir="false" />
17
- <change afterPath="$PROJECT_DIR$/src/plugins/speech/speech-recognize/config.ts" afterDir="false" />
18
- <change afterPath="$PROJECT_DIR$/src/plugins/speech/speech-recognize/helpers/microphone-input.ts" afterDir="false" />
19
- <change afterPath="$PROJECT_DIR$/src/plugins/speech/speech-recognize/helpers/voice-command.ts" afterDir="false" />
20
- <change afterPath="$PROJECT_DIR$/src/plugins/speech/speech-recognize/icon.svg" afterDir="false" />
21
- <change afterPath="$PROJECT_DIR$/src/plugins/speech/speech-recognize/speech-recognize.ts" afterDir="false" />
14
+ <list default="true" id="5da7ff7f-03a8-49de-9fbb-8f8640d83b83" name="Default Changelist" comment="">
22
15
  <change beforePath="$PROJECT_DIR$/CHANGELOG.MD" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.MD" afterDir="false" />
23
- <change beforePath="$PROJECT_DIR$/build-system/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/build-system/index.js" afterDir="false" />
24
16
  <change beforePath="$PROJECT_DIR$/build/jodit.css" beforeDir="false" />
25
17
  <change beforePath="$PROJECT_DIR$/build/jodit.es2018.css" beforeDir="false" />
26
18
  <change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.css" beforeDir="false" />
27
- <change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/jodit.es2018.en.js" afterDir="false" />
19
+ <change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.js" beforeDir="false" />
28
20
  <change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.min.css" beforeDir="false" />
29
- <change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.min.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/jodit.es2018.en.min.js" afterDir="false" />
30
- <change beforePath="$PROJECT_DIR$/build/jodit.es2018.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/jodit.es2018.js" afterDir="false" />
21
+ <change beforePath="$PROJECT_DIR$/build/jodit.es2018.en.min.js" beforeDir="false" />
22
+ <change beforePath="$PROJECT_DIR$/build/jodit.es2018.js" beforeDir="false" />
31
23
  <change beforePath="$PROJECT_DIR$/build/jodit.es2018.min.css" beforeDir="false" />
32
- <change beforePath="$PROJECT_DIR$/build/jodit.es2018.min.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/jodit.es2018.min.js" afterDir="false" />
24
+ <change beforePath="$PROJECT_DIR$/build/jodit.es2018.min.js" beforeDir="false" />
33
25
  <change beforePath="$PROJECT_DIR$/build/jodit.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/jodit.js" afterDir="false" />
34
26
  <change beforePath="$PROJECT_DIR$/build/jodit.min.css" beforeDir="false" />
35
- <change beforePath="$PROJECT_DIR$/build/jodit.min.js" beforeDir="false" afterPath="$PROJECT_DIR$/build/jodit.min.js" afterDir="false" />
27
+ <change beforePath="$PROJECT_DIR$/build/jodit.min.js" beforeDir="false" />
36
28
  <change beforePath="$PROJECT_DIR$/build/vdom.css" beforeDir="false" />
37
- <change beforePath="$PROJECT_DIR$/make.js" beforeDir="false" afterPath="$PROJECT_DIR$/make.js" afterDir="false" />
38
- <change beforePath="$PROJECT_DIR$/src/plugins/clipboard/paste/helpers.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/plugins/clipboard/paste/helpers.ts" afterDir="false" />
39
- <change beforePath="$PROJECT_DIR$/src/plugins/source/editor/engines/ace.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/plugins/source/editor/engines/ace.ts" afterDir="false" />
40
- <change beforePath="$PROJECT_DIR$/src/plugins/source/editor/engines/area.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/plugins/source/editor/engines/area.ts" afterDir="false" />
41
- <change beforePath="$PROJECT_DIR$/src/plugins/source/source.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/plugins/source/source.ts" afterDir="false" />
42
- <change beforePath="$PROJECT_DIR$/src/styles/mixins.less" beforeDir="false" afterPath="$PROJECT_DIR$/src/styles/mixins.less" afterDir="false" />
43
- <change beforePath="$PROJECT_DIR$/src/types/events.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/events.d.ts" afterDir="false" />
44
- <change beforePath="$PROJECT_DIR$/src/types/source.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/source.d.ts" afterDir="false" />
29
+ <change beforePath="$PROJECT_DIR$/build/vdom.js" beforeDir="false" />
30
+ <change beforePath="$PROJECT_DIR$/src/modules/file-browser/file-browser.test.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/modules/file-browser/file-browser.test.js" afterDir="false" />
31
+ <change beforePath="$PROJECT_DIR$/src/modules/uploader/helpers/send-files.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/modules/uploader/helpers/send-files.ts" afterDir="false" />
45
32
  </list>
46
33
  <list id="5049e1d4-15bc-4e3a-b46b-d2ce7537fc13" name="Revert &quot;Some small fixes&quot;" comment="Revert &quot;Some small fixes&quot;&#10;&#10;This reverts commit bc391ec6" />
47
34
  <option name="SHOW_DIALOG" value="false" />
@@ -855,21 +842,9 @@
855
842
  <workItem from="1652278073818" duration="2863000" />
856
843
  <workItem from="1652284339282" duration="529000" />
857
844
  <workItem from="1652288722754" duration="1515000" />
858
- <workItem from="1652290653496" duration="512000" />
859
- </task>
860
- <task id="LOCAL-01075" summary="The preview popup has double scrollbars #808&#10;Issue: https://github.com/xdan/jodit/issues/808">
861
- <created>1648376761158</created>
862
- <option name="number" value="01075" />
863
- <option name="presentableId" value="LOCAL-01075" />
864
- <option name="project" value="LOCAL" />
865
- <updated>1648376761158</updated>
866
- </task>
867
- <task id="LOCAL-01076" summary="Fixed bug with sync editor size with iframe mode (Works only with [ResizeObserver](https://caniuse.com/resizeobserver))">
868
- <created>1648381830154</created>
869
- <option name="number" value="01076" />
870
- <option name="presentableId" value="LOCAL-01076" />
871
- <option name="project" value="LOCAL" />
872
- <updated>1648381830154</updated>
845
+ <workItem from="1652290653496" duration="1875000" />
846
+ <workItem from="1652357632395" duration="2336000" />
847
+ <workItem from="1652375698652" duration="2440000" />
873
848
  </task>
874
849
  <task id="LOCAL-01077" summary="Fixed bug with sync editor size with iframe mode (Works only with [ResizeObserver](https://caniuse.com/resizeobserver))">
875
850
  <created>1648381838293</created>
@@ -1200,17 +1175,25 @@
1200
1175
  <option name="project" value="LOCAL" />
1201
1176
  <updated>1652218824618</updated>
1202
1177
  </task>
1203
- <option name="localTasksCounter" value="1124" />
1178
+ <task id="LOCAL-01124" summary="Fixed a bug where pressing `Esc` did not close the dialog">
1179
+ <created>1652298901561</created>
1180
+ <option name="number" value="01124" />
1181
+ <option name="presentableId" value="LOCAL-01124" />
1182
+ <option name="project" value="LOCAL" />
1183
+ <updated>1652298901562</updated>
1184
+ </task>
1185
+ <task id="LOCAL-01125" summary="Added option `uploader.processFileName` - The method can be used to change the name of the uploaded file">
1186
+ <created>1652377125784</created>
1187
+ <option name="number" value="01125" />
1188
+ <option name="presentableId" value="LOCAL-01125" />
1189
+ <option name="project" value="LOCAL" />
1190
+ <updated>1652377125784</updated>
1191
+ </task>
1192
+ <option name="localTasksCounter" value="1126" />
1204
1193
  <servers />
1205
1194
  </component>
1206
1195
  <component name="TypeScriptGeneratedFilesManager">
1207
1196
  <option name="version" value="3" />
1208
- <option name="exactExcludedFiles">
1209
- <list>
1210
- <option value="$PROJECT_DIR$/types/types/core.d.ts" />
1211
- <option value="$PROJECT_DIR$/types/types/storage.d.ts" />
1212
- </list>
1213
- </option>
1214
1197
  </component>
1215
1198
  <component name="UnknownFeatures">
1216
1199
  <option featureType="com.intellij.configurationType" implementationName="BashConfigurationType" />
@@ -1346,8 +1329,6 @@
1346
1329
  </component>
1347
1330
  <component name="VcsManagerConfiguration">
1348
1331
  <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
1349
- <MESSAGE value="Fixed component inheritance error after component decorator" />
1350
- <MESSAGE value="Fixed processing of inserting videos from YouTube. Now you can start playing the video." />
1351
1332
  <MESSAGE value="selection.insertHTML causes infinite blur loop when Jodit editor not active&#10;Added `insertCursorAfter` argument.&#10;&#10;Issue: https://github.com/xdan/jodit/issues/819" />
1352
1333
  <MESSAGE value="Preview missing non styled content in a paragraph when there is any styled text in that paragraph #823&#10;Issue: https://github.com/xdan/jodit/issues/823" />
1353
1334
  <MESSAGE value="Image hyperlink is not working without https:// #821&#10;Issue: https://github.com/xdan/jodit/issues/821" />
@@ -1371,7 +1352,9 @@
1371
1352
  <MESSAGE value="Moved the test files to the appropriate directories" />
1372
1353
  <MESSAGE value="Added event `applyLink` for issue &#10;change default target for all links #841&#10;Issue: https://github.com/xdan/jodit/issues/841" />
1373
1354
  <MESSAGE value="Merge" />
1374
- <option name="LAST_COMMIT_MESSAGE" value="Merge" />
1355
+ <MESSAGE value="Fixed a bug where pressing `Esc` did not close the dialog" />
1356
+ <MESSAGE value="Added option `uploader.processFileName` - The method can be used to change the name of the uploaded file" />
1357
+ <option name="LAST_COMMIT_MESSAGE" value="Added option `uploader.processFileName` - The method can be used to change the name of the uploaded file" />
1375
1358
  </component>
1376
1359
  <component name="XDebuggerManager">
1377
1360
  <breakpoint-manager>
package/CHANGELOG.MD CHANGED
@@ -9,6 +9,25 @@
9
9
  > - :house: [Internal]
10
10
  > - :nail_care: [Polish]
11
11
 
12
+ ## 3.18.4
13
+
14
+ #### :rocket: New Feature
15
+
16
+ - Added option `uploader.processFileName` - The method can be used to change the name of the uploaded file
17
+
18
+ ```js
19
+ Jodit.make('#editor', {
20
+ uploader: {
21
+ url: 'some-connector.php',
22
+ processFileName: (key, file, name) => {
23
+ return [key, file, 'some-prefix_' + name];
24
+ }
25
+ }
26
+ });
27
+ ```
28
+
29
+ - Fixed file naming error when uploading to server
30
+
12
31
  ## 3.18.3
13
32
 
14
33
  #### :bug: Bug Fix
@@ -640,34 +659,28 @@ console.log(Jodit.modules.UIButton.componentName); // jodit-ui-button
640
659
  - [Remember last opened folder with FileBrowser #675](https://github.com/xdan/jodit/issues/675)
641
660
  Boolean option `filebrowser.saveStateInStorage` split to dictionary:
642
661
 
643
- ```ts
644
- interface IFileBrowserOptions
645
-
646
- :
647
- {
648
- }
649
- saveStateInStorage: false | {
650
- storeLastOpenedFolder? : boolean;
651
- storeView? : boolean;
652
- storeSortBy? : boolean;
653
- };
662
+ ```typescript
663
+ interface IFileBrowserOptions {
664
+ saveStateInStorage:
665
+ | false
666
+ | {
667
+ storeLastOpenedFolder?: boolean;
668
+ storeView?: boolean;
669
+ storeSortBy?: boolean;
670
+ };
654
671
  }
655
672
  ```
656
673
 
657
674
  By default:
658
675
 
659
676
  ```js
660
- {
677
+ opt = {
661
678
  saveStateInStorage: {
662
679
  storeLastOpenedFolder: true,
663
- storeView
664
- :
665
- true,
666
- storeSortBy
667
- :
668
- true
680
+ storeView: true,
681
+ storeSortBy: true
669
682
  }
670
- }
683
+ };
671
684
  ```
672
685
 
673
686
  Disable it:
@@ -769,9 +782,8 @@ await new Ajax(editor, {
769
782
  await new Ajax(editor, {
770
783
  url: 'index.php'
771
784
  })
772
- .send()˚
773
- .
774
- then(resp => resp.json()); // {success: true, data: ...}
785
+ .send()
786
+ .then(resp => resp.json()); // {success: true, data: ...}
775
787
  ```
776
788
 
777
789
  - In `.npmignore` added:
@@ -1438,11 +1450,11 @@ Related with https://github.com/xdan/jodit/issues/574. In some cases need to lim
1438
1450
  - @property {IUIOption[]} link.selectOptionsClassName=[] The list of the option for the select (to use with
1439
1451
  modeClassName="select")
1440
1452
  - ex: [
1441
- - { value: "", text: "" },
1442
- - { value: "val1", text: "text1" },
1443
- - { value: "val2", text: "text2" },
1444
- - { value: "val3", text: "text3" }
1445
- - ]
1453
+ - { value: "", text: "" },
1454
+ - { value: "val1", text: "text1" },
1455
+ - { value: "val2", text: "text2" },
1456
+ - { value: "val3", text: "text3" }
1457
+ - ]
1446
1458
  PR: https://github.com/xdan/jodit/pull/577 Thanks @s-renier-taonix-fr
1447
1459
 
1448
1460
  ##### New option `statusbar: boolean = true`
@@ -2593,11 +2605,7 @@ var editor = new Jodit('#example2_0', {
2593
2605
  Dom Module is now compatible with jQuery objects
2594
2606
 
2595
2607
  ```javascript
2596
- var a = jQuery("<a href="
2597
- #link
2598
- ">Link</a>"
2599
- )
2600
- ;
2608
+ var a = jQuery("<a href=\"#link\">Link</a>");
2601
2609
  jodit.modules.Dom('.selector').append(a);
2602
2610
  jodit.modules.Dom(jQuery("#someid")).val();
2603
2611
  jodit.modules.Dom("#someid").val();
package/build/jodit.css CHANGED
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.18.3
4
+ * Version: v3.18.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
11
- * Version: v3.18.3
11
+ * Version: v3.18.4
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.18.3
4
+ * Version: v3.18.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.18.3
4
+ * Version: v3.18.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/)
4
- * Version: v3.18.3
4
+ * Version: v3.18.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -12177,7 +12177,7 @@ class View extends component/* Component */.wA {
12177
12177
  this.isView = true;
12178
12178
  this.mods = {};
12179
12179
  this.components = new Set();
12180
- this.version = "3.18.3";
12180
+ this.version = "3.18.4";
12181
12181
  this.buffer = Storage.makeStorage();
12182
12182
  this.storage = Storage.makeStorage(true, this.componentName);
12183
12183
  this.OPTIONS = View.defaultOptions;
@@ -12274,10 +12274,10 @@ class View extends component/* Component */.wA {
12274
12274
  return this.__isFullSize;
12275
12275
  }
12276
12276
  getVersion() {
12277
- return "3.18.3";
12277
+ return "3.18.4";
12278
12278
  }
12279
12279
  static getVersion() {
12280
- return "3.18.3";
12280
+ return "3.18.4";
12281
12281
  }
12282
12282
  initOptions(options) {
12283
12283
  this.options = (0,helpers.ConfigProto)(options || {}, (0,helpers.ConfigProto)(this.options || {}, View.defaultOptions));
@@ -17349,11 +17349,12 @@ function send_files_sendFiles(uploader, files, handlerSuccess, handlerError, pro
17349
17349
  for (let i = 0; i < fileList.length; i += 1) {
17350
17350
  file = fileList[i];
17351
17351
  if (file) {
17352
+ const hasRealExtension = /\.[\d\w]+$/.test(file.name);
17352
17353
  const mime = file.type.match(/\/([a-z0-9]+)/i);
17353
17354
  const extension = mime && mime[1] ? mime[1].toLowerCase() : '';
17354
17355
  let newName = fileList[i].name ||
17355
17356
  Math.random().toString().replace('.', '');
17356
- if (extension) {
17357
+ if (!hasRealExtension && extension) {
17357
17358
  let extForReg = extension;
17358
17359
  if (['jpeg', 'jpg'].includes(extForReg)) {
17359
17360
  extForReg = 'jpeg|jpg';
@@ -17363,7 +17364,8 @@ function send_files_sendFiles(uploader, files, handlerSuccess, handlerError, pro
17363
17364
  newName += '.' + extension;
17364
17365
  }
17365
17366
  }
17366
- form.append(o.filesVariableName(i), fileList[i], newName);
17367
+ const [key, iFile, name] = o.processFileName.call(uploader, o.filesVariableName(i), fileList[i], newName);
17368
+ form.append(key, iFile, name);
17367
17369
  }
17368
17370
  }
17369
17371
  if (process) {
@@ -17453,6 +17455,9 @@ config/* Config.prototype.uploader */.D.prototype.uploader = {
17453
17455
  ? resp.data.messages.join(' ')
17454
17456
  : '';
17455
17457
  },
17458
+ processFileName(key, file, name) {
17459
+ return [key, file, name];
17460
+ },
17456
17461
  process(resp) {
17457
17462
  return resp.data;
17458
17463
  },