jodit 3.22.1 → 3.23.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.
Files changed (57) hide show
  1. package/README.md +4 -4
  2. package/build/jodit.css +2 -2
  3. package/build/jodit.es2018.css +1 -1
  4. package/build/jodit.es2018.en.css +1 -1
  5. package/build/jodit.es2018.en.js +155 -77
  6. package/build/jodit.es2018.en.min.js +1 -1
  7. package/build/jodit.es2018.js +155 -77
  8. package/build/jodit.es2018.min.js +1 -1
  9. package/build/jodit.js +208 -117
  10. package/build/jodit.min.css +1 -1
  11. package/build/jodit.min.js +1 -1
  12. package/build/plugins/debug/debug.es2018.en.js +1 -1
  13. package/build/plugins/debug/debug.es2018.js +1 -1
  14. package/build/plugins/debug/debug.js +1 -1
  15. package/build/plugins/speech-recognize/speech-recognize.css +1 -1
  16. package/build/plugins/speech-recognize/speech-recognize.es2018.css +1 -1
  17. package/build/plugins/speech-recognize/speech-recognize.es2018.en.css +1 -1
  18. package/build/plugins/speech-recognize/speech-recognize.es2018.en.js +1 -1
  19. package/build/plugins/speech-recognize/speech-recognize.es2018.js +1 -1
  20. package/build/plugins/speech-recognize/speech-recognize.js +1 -1
  21. package/build/vdom.css +1 -1
  22. package/build/vdom.js +1 -1
  23. package/package.json +1 -1
  24. package/src/config.ts +64 -21
  25. package/src/core/request/ajax.ts +44 -29
  26. package/src/core/request/config.ts +0 -1
  27. package/src/core/selection/selection.test.js +168 -0
  28. package/src/core/selection/style/style.test.js +14 -0
  29. package/src/jodit.ts +106 -39
  30. package/src/modules/file-browser/README.md +0 -3
  31. package/src/modules/file-browser/config.ts +0 -2
  32. package/src/modules/file-browser/data-provider.ts +1 -1
  33. package/src/modules/history/snapshot.ts +1 -3
  34. package/src/modules/uploader/helpers/send.ts +4 -2
  35. package/src/plugins/add-new-line/add-new-line.ts +1 -1
  36. package/src/plugins/bold/README.md +11 -1
  37. package/src/plugins/bold/bold.test.js +35 -0
  38. package/src/plugins/bold/bold.ts +19 -49
  39. package/src/plugins/bold/config.ts +54 -0
  40. package/src/plugins/bold/interface.ts +39 -0
  41. package/src/plugins/font/font.ts +1 -1
  42. package/src/plugins/placeholder/placeholder.test.js +24 -7
  43. package/src/plugins/placeholder/placeholder.ts +4 -0
  44. package/src/plugins/search/search.test.screenshot.js +4 -2
  45. package/src/plugins/source/source.ts +5 -5
  46. package/src/types/ajax.d.ts +0 -9
  47. package/src/types/file-browser.d.ts +0 -2
  48. package/src/types/jodit.d.ts +15 -0
  49. package/types/config.d.ts +60 -20
  50. package/types/core/request/ajax.d.ts +6 -9
  51. package/types/jodit.d.ts +16 -13
  52. package/types/plugins/bold/bold.d.ts +2 -0
  53. package/types/plugins/bold/config.d.ts +6 -0
  54. package/types/plugins/bold/interface.d.ts +33 -0
  55. package/types/types/ajax.d.ts +0 -9
  56. package/types/types/file-browser.d.ts +0 -2
  57. package/types/types/jodit.d.ts +15 -0
@@ -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.22.1
4
+ * Version: v3.23.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -930,7 +930,6 @@ class Config {
930
930
  ? window
931
931
  : null);
932
932
  this.shadowRoot = null;
933
- this.styleValues = {};
934
933
  this.zIndex = 0;
935
934
  this.readonly = false;
936
935
  this.disabled = false;
@@ -948,8 +947,12 @@ class Config {
948
947
  this.inline = false;
949
948
  this.theme = 'default';
950
949
  this.saveModeInStorage = false;
950
+ this.editorClassName = false;
951
951
  this.editorCssClass = false;
952
+ this.className = false;
952
953
  this.style = false;
954
+ this.containerStyle = false;
955
+ this.styleValues = {};
953
956
  this.triggerChangeEvent = true;
954
957
  this.direction = '';
955
958
  this.language = 'auto';
@@ -7731,6 +7734,8 @@ __webpack_require__.d(__webpack_exports__, {
7731
7734
  "H": function() { return /* reexport */ Response; }
7732
7735
  });
7733
7736
 
7737
+ // EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.js
7738
+ var tslib_es6 = __webpack_require__(20255);
7734
7739
  // EXTERNAL MODULE: ./src/config.ts
7735
7740
  var config = __webpack_require__(80031);
7736
7741
  // EXTERNAL MODULE: ./src/core/helpers/index.ts
@@ -7764,6 +7769,10 @@ class Response {
7764
7769
  }
7765
7770
  }
7766
7771
 
7772
+ // EXTERNAL MODULE: ./src/core/async/index.ts + 1 modules
7773
+ var core_async = __webpack_require__(83735);
7774
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
7775
+ var decorators = __webpack_require__(63945);
7767
7776
  ;// CONCATENATED MODULE: ./src/core/request/config.ts
7768
7777
  /*!
7769
7778
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -7773,7 +7782,6 @@ class Response {
7773
7782
 
7774
7783
  config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions = {
7775
7784
  successStatuses: [200, 201, 202],
7776
- dataType: 'json',
7777
7785
  method: 'GET',
7778
7786
  url: '',
7779
7787
  data: null,
@@ -7798,22 +7806,30 @@ config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions =
7798
7806
 
7799
7807
 
7800
7808
 
7809
+
7810
+
7811
+
7801
7812
  class Ajax {
7802
- constructor(jodit, options) {
7803
- this.jodit = jodit;
7804
- this.isFulfilled = false;
7805
- this.activated = false;
7806
- this.options = (0,helpers.ConfigProto)(options || {}, config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions);
7813
+ constructor(options, defaultAjaxOptions = config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions) {
7814
+ this.__async = new core_async/* Async */.e();
7815
+ this.__isFulfilled = false;
7816
+ this.__activated = false;
7817
+ this.__isDestructed = false;
7818
+ this.options = (0,helpers.ConfigProto)(options || {}, defaultAjaxOptions);
7807
7819
  this.xhr = this.o.xhr ? this.o.xhr() : new XMLHttpRequest();
7808
- jodit && jodit.e && jodit.e.on('beforeDestruct', () => this.destruct());
7809
7820
  }
7810
7821
  __buildParams(obj, prefix) {
7822
+ if ((0,helpers.isPlainObject)(obj) &&
7823
+ this.options.contentType &&
7824
+ this.options.contentType.includes('application/json')) {
7825
+ return JSON.stringify(obj);
7826
+ }
7811
7827
  if ((0,helpers.isFunction)(this.o.queryBuild)) {
7812
7828
  return this.o.queryBuild.call(this, obj, prefix);
7813
7829
  }
7814
7830
  if ((0,helpers.isString)(obj) ||
7815
- (this.j.ow.FormData &&
7816
- obj instanceof this.j.ow.FormData)) {
7831
+ obj instanceof window.FormData ||
7832
+ (typeof obj === 'object' && obj != null && (0,helpers.isFunction)(obj.append))) {
7817
7833
  return obj;
7818
7834
  }
7819
7835
  return (0,helpers.buildQuery)(obj);
@@ -7821,37 +7837,34 @@ class Ajax {
7821
7837
  get o() {
7822
7838
  return this.options;
7823
7839
  }
7824
- get j() {
7825
- return this.jodit;
7826
- }
7827
7840
  abort() {
7828
- if (this.isFulfilled) {
7841
+ if (this.__isFulfilled) {
7829
7842
  return this;
7830
7843
  }
7831
7844
  try {
7832
- this.isFulfilled = true;
7845
+ this.__isFulfilled = true;
7833
7846
  this.xhr.abort();
7834
7847
  }
7835
7848
  catch (_a) { }
7836
7849
  return this;
7837
7850
  }
7838
7851
  send() {
7839
- this.activated = true;
7852
+ this.__activated = true;
7840
7853
  const { xhr, o } = this;
7841
7854
  const request = this.prepareRequest();
7842
- return this.j.async.promise(async (resolve, reject) => {
7855
+ return this.__async.promise(async (resolve, reject) => {
7843
7856
  var _a;
7844
7857
  const onReject = () => {
7845
- this.isFulfilled = true;
7858
+ this.__isFulfilled = true;
7846
7859
  reject(error/* connection */.ZI('Connection error'));
7847
7860
  };
7848
7861
  const onResolve = () => {
7849
- this.isFulfilled = true;
7862
+ this.__isFulfilled = true;
7850
7863
  resolve(new Response(request, xhr.status, xhr.statusText, !xhr.responseType ? xhr.responseText : xhr.response));
7851
7864
  };
7852
7865
  xhr.onload = onResolve;
7853
7866
  xhr.onabort = () => {
7854
- this.isFulfilled = true;
7867
+ this.__isFulfilled = true;
7855
7868
  reject(error/* abort */.JG('Abort connection'));
7856
7869
  };
7857
7870
  xhr.onerror = onReject;
@@ -7875,7 +7888,7 @@ class Ajax {
7875
7888
  onResolve();
7876
7889
  }
7877
7890
  else if (xhr.statusText) {
7878
- this.isFulfilled = true;
7891
+ this.__isFulfilled = true;
7879
7892
  reject(error/* connection */.ZI(xhr.statusText));
7880
7893
  }
7881
7894
  }
@@ -7895,7 +7908,7 @@ class Ajax {
7895
7908
  xhr.setRequestHeader(key, headers[key]);
7896
7909
  });
7897
7910
  }
7898
- this.j.async.setTimeout(() => {
7911
+ this.__async.setTimeout(() => {
7899
7912
  xhr.send(data ? this.__buildParams(data) : undefined);
7900
7913
  }, 0);
7901
7914
  });
@@ -7930,13 +7943,20 @@ class Ajax {
7930
7943
  return request;
7931
7944
  }
7932
7945
  destruct() {
7933
- if (this.activated && !this.isFulfilled) {
7934
- this.abort();
7935
- this.isFulfilled = true;
7946
+ if (!this.__isDestructed) {
7947
+ this.__isDestructed = true;
7948
+ if (this.__activated && !this.__isFulfilled) {
7949
+ this.abort();
7950
+ this.__isFulfilled = true;
7951
+ }
7952
+ this.__async.destruct();
7936
7953
  }
7937
7954
  }
7938
7955
  }
7939
7956
  Ajax.log = [];
7957
+ (0,tslib_es6/* __decorate */.gn)([
7958
+ decorators.autobind
7959
+ ], Ajax.prototype, "destruct", null);
7940
7960
 
7941
7961
  ;// CONCATENATED MODULE: ./src/core/request/index.ts
7942
7962
  /*!
@@ -12466,7 +12486,7 @@ let View = View_1 = class View extends jodit_modules__WEBPACK_IMPORTED_MODULE_3_
12466
12486
  this.parent = null;
12467
12487
  this.mods = {};
12468
12488
  this.components = new Set();
12469
- this.version = "3.22.1";
12489
+ this.version = "3.23.2";
12470
12490
  this.buffer = _storage__WEBPACK_IMPORTED_MODULE_0__/* .Storage.makeStorage */ .Ke.makeStorage();
12471
12491
  this.storage = _storage__WEBPACK_IMPORTED_MODULE_0__/* .Storage.makeStorage */ .Ke.makeStorage(true, this.componentName);
12472
12492
  this.OPTIONS = View_1.defaultOptions;
@@ -12548,10 +12568,10 @@ let View = View_1 = class View extends jodit_modules__WEBPACK_IMPORTED_MODULE_3_
12548
12568
  return this.__isFullSize;
12549
12569
  }
12550
12570
  getVersion() {
12551
- return "3.22.1";
12571
+ return "3.23.2";
12552
12572
  }
12553
12573
  static getVersion() {
12554
- return "3.22.1";
12574
+ return "3.23.2";
12555
12575
  }
12556
12576
  initOptions(options) {
12557
12577
  this.options = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigProto)(options || {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.ConfigProto)(this.options || {}, View_1.defaultOptions));
@@ -12846,7 +12866,7 @@ let DataProvider = class DataProvider {
12846
12866
  if (opts.prepareData) {
12847
12867
  opts.data = opts.prepareData.call(this, opts.data);
12848
12868
  }
12849
- const ajax = new request/* Ajax */.t(this.parent, opts);
12869
+ const ajax = new request/* Ajax */.t(opts);
12850
12870
  ai.set(name, ajax);
12851
12871
  const promise = ajax.send();
12852
12872
  promise
@@ -13922,13 +13942,11 @@ config/* Config.prototype.filebrowser */.D.prototype.filebrowser = {
13922
13942
  ajax: {
13923
13943
  ...config/* Config.prototype.defaultAjaxOptions */.D.prototype.defaultAjaxOptions,
13924
13944
  url: '',
13925
- async: true,
13926
13945
  data: {},
13927
13946
  cache: true,
13928
13947
  contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
13929
13948
  method: 'POST',
13930
13949
  processData: true,
13931
- dataType: 'json',
13932
13950
  headers: {},
13933
13951
  prepareData(data) {
13934
13952
  return data;
@@ -15923,9 +15941,7 @@ class Snapshot extends component/* ViewComponent */.Hr {
15923
15941
  if (value !== snapshot.html) {
15924
15942
  this.j.value = snapshot.html;
15925
15943
  }
15926
- if (this.j.s.isFocused()) {
15927
- this.restoreOnlySelection(snapshot);
15928
- }
15944
+ this.restoreOnlySelection(snapshot);
15929
15945
  this.restoreScrollState(scroll);
15930
15946
  });
15931
15947
  }
@@ -16363,7 +16379,7 @@ const ajaxInstances = new WeakMap();
16363
16379
  function send(uploader, data) {
16364
16380
  const requestData = buildData(uploader, data);
16365
16381
  const sendData = (request) => {
16366
- const ajax = new core_request/* Ajax */.t(uploader.j, {
16382
+ const ajax = new core_request/* Ajax */.t({
16367
16383
  xhr: () => {
16368
16384
  const xhr = new XMLHttpRequest();
16369
16385
  if (uploader.j.ow.FormData !== undefined &&
@@ -16396,7 +16412,6 @@ function send(uploader, data) {
16396
16412
  headers: uploader.o.headers,
16397
16413
  queryBuild: uploader.o.queryBuild,
16398
16414
  contentType: uploader.o.contentType.call(uploader, request),
16399
- dataType: uploader.o.format || 'json',
16400
16415
  withCredentials: uploader.o.withCredentials || false
16401
16416
  });
16402
16417
  let instances = ajaxInstances.get(uploader);
@@ -16405,6 +16420,7 @@ function send(uploader, data) {
16405
16420
  ajaxInstances.set(uploader, instances);
16406
16421
  }
16407
16422
  instances.add(ajax);
16423
+ uploader.j.e.one('beforeDestruct', ajax.destruct);
16408
16424
  return ajax
16409
16425
  .send()
16410
16426
  .then(resp => resp.json())
@@ -16412,6 +16428,7 @@ function send(uploader, data) {
16412
16428
  uploader.o.error.call(uploader, error);
16413
16429
  })
16414
16430
  .finally(() => {
16431
+ ajax.destruct();
16415
16432
  instances === null || instances === void 0 ? void 0 : instances.delete(ajax);
16416
16433
  });
16417
16434
  };
@@ -20619,6 +20636,8 @@ var global = __webpack_require__(16672);
20619
20636
  var decorators = __webpack_require__(63945);
20620
20637
  // EXTERNAL MODULE: ./src/core/traits/index.ts + 3 modules
20621
20638
  var traits = __webpack_require__(63711);
20639
+ // EXTERNAL MODULE: ./src/core/request/index.ts + 3 modules
20640
+ var request = __webpack_require__(5887);
20622
20641
  ;// CONCATENATED MODULE: ./src/jodit.ts
20623
20642
  /*!
20624
20643
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -20636,6 +20655,7 @@ var Jodit_1;
20636
20655
 
20637
20656
 
20638
20657
 
20658
+
20639
20659
  const __defaultStyleDisplayKey = 'data-jodit-default-style-display';
20640
20660
  const __defaultClassesKey = 'data-jodit-default-classes';
20641
20661
  let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
@@ -20649,8 +20669,8 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20649
20669
  this.editorIsActive = false;
20650
20670
  this.__mode = constants.MODE_WYSIWYG;
20651
20671
  this.__callChangeCount = 0;
20652
- this.isSilentChange = false;
20653
- this.elementToPlace = new Map();
20672
+ this.__isSilentChange = false;
20673
+ this.__elementToPlace = new Map();
20654
20674
  try {
20655
20675
  const elementSource = (0,helpers.resolveElement)(element, this.o.shadowRoot || this.od);
20656
20676
  if (Jodit_1.isJoditAssigned(elementSource)) {
@@ -20673,7 +20693,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20673
20693
  this.e.fire('resize');
20674
20694
  }
20675
20695
  });
20676
- this.e.on('prepareWYSIWYGEditor', this.prepareWYSIWYGEditor);
20696
+ this.e.on('prepareWYSIWYGEditor', this.__prepareWYSIWYGEditor);
20677
20697
  this.selection = new modules.Select(this);
20678
20698
  const beforeInitHookResult = this.beforeInitHook();
20679
20699
  (0,helpers.callPromise)(beforeInitHookResult, () => {
@@ -20743,7 +20763,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20743
20763
  static get defaultOptions() {
20744
20764
  return config/* Config.defaultOptions */.D.defaultOptions;
20745
20765
  }
20746
- setPlaceField(field, value) {
20766
+ __setPlaceField(field, value) {
20747
20767
  if (!this.currentPlace) {
20748
20768
  this.currentPlace = {};
20749
20769
  this.places = [this.currentPlace];
@@ -20757,13 +20777,13 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20757
20777
  return this.currentPlace.editor;
20758
20778
  }
20759
20779
  set editor(editor) {
20760
- this.setPlaceField('editor', editor);
20780
+ this.__setPlaceField('editor', editor);
20761
20781
  }
20762
20782
  get container() {
20763
20783
  return this.currentPlace.container;
20764
20784
  }
20765
20785
  set container(container) {
20766
- this.setPlaceField('container', container);
20786
+ this.__setPlaceField('container', container);
20767
20787
  }
20768
20788
  get workplace() {
20769
20789
  return this.currentPlace.workplace;
@@ -20775,7 +20795,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20775
20795
  return this.currentPlace.iframe;
20776
20796
  }
20777
20797
  set iframe(iframe) {
20778
- this.setPlaceField('iframe', iframe);
20798
+ this.__setPlaceField('iframe', iframe);
20779
20799
  }
20780
20800
  get history() {
20781
20801
  return this.currentPlace.history;
@@ -20787,7 +20807,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20787
20807
  return this.currentPlace.editorWindow;
20788
20808
  }
20789
20809
  set editorWindow(win) {
20790
- this.setPlaceField('editorWindow', win);
20810
+ this.__setPlaceField('editorWindow', win);
20791
20811
  }
20792
20812
  get ew() {
20793
20813
  return this.editorWindow;
@@ -20802,7 +20822,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20802
20822
  return this.currentPlace.options;
20803
20823
  }
20804
20824
  set options(opt) {
20805
- this.setPlaceField('options', opt);
20825
+ this.__setPlaceField('options', opt);
20806
20826
  }
20807
20827
  get s() {
20808
20828
  return this.selection;
@@ -20917,7 +20937,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
20917
20937
  }
20918
20938
  this.e.fire('postProcessSetEditorValue');
20919
20939
  const old_value = this.getElementValue(), new_value = this.getEditorValue();
20920
- if (!this.isSilentChange &&
20940
+ if (!this.__isSilentChange &&
20921
20941
  old_value !== new_value &&
20922
20942
  this.__callChangeCount < constants.SAFE_COUNT_CHANGE_CALL) {
20923
20943
  this.__setElementValue(new_value);
@@ -21014,7 +21034,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21014
21034
  command = command.toLowerCase();
21015
21035
  result = this.e.fire('beforeCommand', command, showUI, value, ...args);
21016
21036
  if (result !== false) {
21017
- result = this.execCustomCommands(command, showUI, value, ...args);
21037
+ result = this.__execCustomCommands(command, showUI, value, ...args);
21018
21038
  }
21019
21039
  if (result !== false) {
21020
21040
  this.s.focus();
@@ -21036,15 +21056,15 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21036
21056
  return result;
21037
21057
  }
21038
21058
  nativeExecCommand(command, showUI, value) {
21039
- this.isSilentChange = true;
21059
+ this.__isSilentChange = true;
21040
21060
  try {
21041
21061
  return this.ed.execCommand(command, showUI, value);
21042
21062
  }
21043
21063
  finally {
21044
- this.isSilentChange = false;
21064
+ this.__isSilentChange = false;
21045
21065
  }
21046
21066
  }
21047
- execCustomCommands(commandName, second, third, ...args) {
21067
+ __execCustomCommands(commandName, second, third, ...args) {
21048
21068
  commandName = commandName.toLowerCase();
21049
21069
  const commands = this.commands.get(commandName);
21050
21070
  if (commands !== undefined) {
@@ -21180,6 +21200,14 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21180
21200
  getReadOnly() {
21181
21201
  return this.o.readonly;
21182
21202
  }
21203
+ focus() {
21204
+ if (this.getMode() !== constants.MODE_SOURCE) {
21205
+ this.s.focus();
21206
+ }
21207
+ }
21208
+ get isFocused() {
21209
+ return this.s.isFocused();
21210
+ }
21183
21211
  beforeInitHook() {
21184
21212
  }
21185
21213
  afterInitHook() {
@@ -21214,6 +21242,10 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21214
21242
  container.classList.add('jodit');
21215
21243
  container.classList.add('jodit-container');
21216
21244
  container.classList.add(`jodit_theme_${this.o.theme || 'default'}`);
21245
+ addClassNames(this.o.className, container);
21246
+ if (this.o.containerStyle) {
21247
+ (0,helpers.css)(container, this.o.containerStyle);
21248
+ }
21217
21249
  const { styleValues } = this.o;
21218
21250
  Object.keys(styleValues).forEach(key => {
21219
21251
  const property = (0,helpers.kebabCase)(key);
@@ -21267,11 +21299,11 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21267
21299
  history: new modules.History(this),
21268
21300
  editorWindow: this.ow
21269
21301
  };
21270
- this.elementToPlace.set(editor, currentPlace);
21302
+ this.__elementToPlace.set(editor, currentPlace);
21271
21303
  this.setCurrentPlace(currentPlace);
21272
21304
  this.places.push(currentPlace);
21273
21305
  this.setNativeEditorValue(this.getElementValue());
21274
- const initResult = this.initEditor(buffer);
21306
+ const initResult = this.__initEditor(buffer);
21275
21307
  const opt = this.options;
21276
21308
  const init = () => {
21277
21309
  if (opt.enableDragAndDropFileToEditor &&
@@ -21279,8 +21311,8 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21279
21311
  (opt.uploader.url || opt.uploader.insertImageAsBase64URI)) {
21280
21312
  this.uploader.bind(this.editor);
21281
21313
  }
21282
- if (!this.elementToPlace.get(this.editor)) {
21283
- this.elementToPlace.set(this.editor, currentPlace);
21314
+ if (!this.__elementToPlace.get(this.editor)) {
21315
+ this.__elementToPlace.set(this.editor, currentPlace);
21284
21316
  }
21285
21317
  this.e.fire('afterAddPlace', currentPlace);
21286
21318
  };
@@ -21302,8 +21334,8 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21302
21334
  this.e.fire('changePlace', place);
21303
21335
  }
21304
21336
  }
21305
- initEditor(buffer) {
21306
- const result = this.createEditor();
21337
+ __initEditor(buffer) {
21338
+ const result = this.__createEditor();
21307
21339
  return (0,helpers.callPromise)(result, () => {
21308
21340
  if (this.isInDestruct) {
21309
21341
  return;
@@ -21346,7 +21378,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21346
21378
  catch (_c) { }
21347
21379
  });
21348
21380
  }
21349
- createEditor() {
21381
+ __createEditor() {
21350
21382
  const defaultEditorArea = this.editor;
21351
21383
  const stayDefault = this.e.fire('createEditor', this);
21352
21384
  return (0,helpers.callPromise)(stayDefault, () => {
@@ -21356,6 +21388,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21356
21388
  if (stayDefault === false || (0,helpers.isPromise)(stayDefault)) {
21357
21389
  modules.Dom.safeRemove(defaultEditorArea);
21358
21390
  }
21391
+ addClassNames(this.o.editorClassName || this.o.editorCssClass, this.editor);
21359
21392
  if (this.o.editorCssClass) {
21360
21393
  this.editor.classList.add(this.o.editorCssClass);
21361
21394
  }
@@ -21370,7 +21403,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21370
21403
  this.editorIsActive = true;
21371
21404
  })
21372
21405
  .on('blur', () => (this.editorIsActive = false));
21373
- this.prepareWYSIWYGEditor();
21406
+ this.__prepareWYSIWYGEditor();
21374
21407
  if (this.o.direction) {
21375
21408
  const direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
21376
21409
  this.container.style.direction = direction;
@@ -21384,7 +21417,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21384
21417
  }
21385
21418
  });
21386
21419
  }
21387
- prepareWYSIWYGEditor() {
21420
+ __prepareWYSIWYGEditor() {
21388
21421
  const { editor } = this;
21389
21422
  if (this.o.direction) {
21390
21423
  const direction = this.o.direction.toLowerCase() === 'rtl' ? 'rtl' : 'ltr';
@@ -21393,7 +21426,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21393
21426
  }
21394
21427
  this.e
21395
21428
  .on(editor, 'mousedown touchstart focus', () => {
21396
- const place = this.elementToPlace.get(editor);
21429
+ const place = this.__elementToPlace.get(editor);
21397
21430
  if (place) {
21398
21431
  this.setCurrentPlace(place);
21399
21432
  }
@@ -21401,7 +21434,7 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21401
21434
  .on(editor, 'compositionend', this.synchronizeValues)
21402
21435
  .on(editor, 'selectionchange selectionstart keydown keyup input keypress dblclick mousedown mouseup ' +
21403
21436
  'click copy cut dragstart drop dragover paste resize touchstart touchend focus blur', (event) => {
21404
- if (this.o.readonly || this.isSilentChange) {
21437
+ if (this.o.readonly || this.__isSilentChange) {
21405
21438
  return;
21406
21439
  }
21407
21440
  const w = this.ew;
@@ -21417,12 +21450,28 @@ let Jodit = Jodit_1 = class Jodit extends modules.ViewWithToolbar {
21417
21450
  }
21418
21451
  });
21419
21452
  }
21453
+ fetch(url, options) {
21454
+ const ajax = new request/* Ajax */.t({
21455
+ url,
21456
+ ...options
21457
+ }, this.o.defaultAjaxOptions);
21458
+ const destroy = () => {
21459
+ this.e.off('beforeDestruct', destroy);
21460
+ this.progressbar.progress(100).hide();
21461
+ ajax.destruct();
21462
+ };
21463
+ this.e.one('beforeDestruct', destroy);
21464
+ this.progressbar.show().progress(30);
21465
+ const promise = ajax.send();
21466
+ promise.finally(destroy).catch(() => null);
21467
+ return promise;
21468
+ }
21420
21469
  destruct() {
21421
21470
  if (this.isInDestruct) {
21422
21471
  return;
21423
21472
  }
21424
21473
  this.setStatus(modules.STATUSES.beforeDestruct);
21425
- this.elementToPlace.clear();
21474
+ this.__elementToPlace.clear();
21426
21475
  if (!this.editor) {
21427
21476
  return;
21428
21477
  }
@@ -21509,11 +21558,16 @@ Jodit.core = {
21509
21558
  ], Jodit.prototype, "updateElementValue", null);
21510
21559
  (0,tslib_es6/* __decorate */.gn)([
21511
21560
  decorators.autobind
21512
- ], Jodit.prototype, "prepareWYSIWYGEditor", null);
21561
+ ], Jodit.prototype, "__prepareWYSIWYGEditor", null);
21513
21562
  Jodit = Jodit_1 = (0,tslib_es6/* __decorate */.gn)([
21514
21563
  (0,decorators.derive)(traits/* Dlgs */.lf)
21515
21564
  ], Jodit);
21516
21565
 
21566
+ function addClassNames(className, elm) {
21567
+ if (className) {
21568
+ className.split(/\s+/).forEach(cn => elm.classList.add(cn));
21569
+ }
21570
+ }
21517
21571
 
21518
21572
  // EXTERNAL MODULE: ./src/core/helpers/checker/index.ts + 7 modules
21519
21573
  var checker = __webpack_require__(43435);
@@ -21765,7 +21819,7 @@ class addNewLine extends modules.Plugin {
21765
21819
  }
21766
21820
  editor.s.setCursorIn(p);
21767
21821
  (0,helpers.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
21768
- editor.e.fire('synchro');
21822
+ editor.synchronizeValues();
21769
21823
  this.hideForce();
21770
21824
  e.preventDefault();
21771
21825
  };
@@ -22528,16 +22582,13 @@ class backspace extends core_plugin/* Plugin */.S {
22528
22582
  }
22529
22583
  global/* pluginSystem.add */.pw.add('backspace', backspace);
22530
22584
 
22531
- ;// CONCATENATED MODULE: ./src/plugins/bold/bold.ts
22585
+ ;// CONCATENATED MODULE: ./src/plugins/bold/config.ts
22532
22586
  /*!
22533
22587
  * Jodit Editor (https://xdsoft.net/jodit/)
22534
22588
  * Released under MIT see LICENSE.txt in the project root for license information.
22535
22589
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
22536
22590
  */
22537
22591
 
22538
-
22539
-
22540
-
22541
22592
  config/* Config.prototype.controls.subscript */.D.prototype.controls.subscript = {
22542
22593
  tags: ['sub'],
22543
22594
  tooltip: 'subscript'
@@ -22578,12 +22629,29 @@ config/* Config.prototype.controls.strikethrough */.D.prototype.controls.striket
22578
22629
  },
22579
22630
  tooltip: 'Strike through'
22580
22631
  };
22632
+
22633
+ ;// CONCATENATED MODULE: ./src/plugins/bold/bold.ts
22634
+ /*!
22635
+ * Jodit Editor (https://xdsoft.net/jodit/)
22636
+ * Released under MIT see LICENSE.txt in the project root for license information.
22637
+ * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
22638
+ */
22639
+
22640
+
22641
+
22642
+
22643
+
22644
+
22581
22645
  function bold(editor) {
22582
22646
  const callBack = (command) => {
22583
22647
  const control = config/* Config.defaultOptions.controls */.D.defaultOptions.controls[command], cssOptions = {
22584
22648
  ...control.css
22585
- }, cssRules = {};
22649
+ };
22650
+ let cssRules;
22586
22651
  Object.keys(cssOptions).forEach((key) => {
22652
+ if (!cssRules) {
22653
+ cssRules = {};
22654
+ }
22587
22655
  cssRules[key] = (0,helpers.isArray)(cssOptions[key])
22588
22656
  ? cssOptions[key][0]
22589
22657
  : cssOptions[key];
@@ -22591,7 +22659,7 @@ function bold(editor) {
22591
22659
  editor.s.applyStyle(cssRules, {
22592
22660
  element: control.tags ? control.tags[0] : undefined
22593
22661
  });
22594
- editor.e.fire('synchro');
22662
+ editor.synchronizeValues();
22595
22663
  return false;
22596
22664
  };
22597
22665
  ['bold', 'italic', 'underline', 'strikethrough'].forEach(name => {
@@ -22621,6 +22689,12 @@ function bold(editor) {
22621
22689
  })
22622
22690
  .registerCommand('strikethrough', {
22623
22691
  exec: callBack
22692
+ })
22693
+ .registerCommand('subscript', {
22694
+ exec: callBack
22695
+ })
22696
+ .registerCommand('superscript', {
22697
+ exec: callBack
22624
22698
  });
22625
22699
  }
22626
22700
  global/* pluginSystem.add */.pw.add('bold', bold);
@@ -24498,7 +24572,7 @@ function font(editor) {
24498
24572
  });
24499
24573
  break;
24500
24574
  }
24501
- editor.e.fire('synchro');
24575
+ editor.synchronizeValues();
24502
24576
  return false;
24503
24577
  };
24504
24578
  editor
@@ -28037,6 +28111,7 @@ class placeholder extends plugin_plugin/* Plugin */.S {
28037
28111
  const current = editor.s.current(), wrapper = (current && dom/* Dom.closest */.i.closest(current, dom/* Dom.isBlock */.i.isBlock, editor.editor)) ||
28038
28112
  editor.editor;
28039
28113
  const style = editor.ew.getComputedStyle(wrapper);
28114
+ const styleEditor = editor.ew.getComputedStyle(editor.editor);
28040
28115
  editor.workplace.appendChild(this.placeholderElm);
28041
28116
  const { firstChild } = editor.editor;
28042
28117
  if (dom/* Dom.isElement */.i.isElement(firstChild) && !selection/* Select.isMarker */.Ph.isMarker(firstChild)) {
@@ -28057,6 +28132,9 @@ class placeholder extends plugin_plugin/* Plugin */.S {
28057
28132
  (0,helpers.css)(this.placeholderElm, {
28058
28133
  display: 'block',
28059
28134
  textAlign: style.getPropertyValue('text-align'),
28135
+ paddingTop: parseInt(styleEditor.paddingTop, 10) + 'px',
28136
+ paddingLeft: parseInt(styleEditor.paddingLeft, 10) + 'px',
28137
+ paddingRight: parseInt(styleEditor.paddingRight, 10) + 'px',
28060
28138
  marginTop: Math.max(parseInt(style.getPropertyValue('margin-top'), 10), marginTop),
28061
28139
  marginLeft: Math.max(parseInt(style.getPropertyValue('margin-left'), 10), marginLeft)
28062
28140
  });
@@ -31024,20 +31102,20 @@ class source extends core_plugin/* Plugin */.S {
31024
31102
  if (this.getSelectionStart() === this.getSelectionEnd()) {
31025
31103
  const marker = this.j.s.marker(true);
31026
31104
  const selectionStart = this.getNormalPosition(this.getSelectionStart(), this.getMirrorValue());
31027
- this.setMirrorValue(value.substr(0, selectionStart) +
31105
+ this.setMirrorValue(value.substring(0, selectionStart) +
31028
31106
  this.clnInv(marker.outerHTML) +
31029
- value.substr(selectionStart));
31107
+ value.substring(selectionStart));
31030
31108
  }
31031
31109
  else {
31032
31110
  const markerStart = this.j.s.marker(true);
31033
31111
  const markerEnd = this.j.s.marker(false);
31034
31112
  const selectionStart = this.getNormalPosition(this.getSelectionStart(), value);
31035
31113
  const selectionEnd = this.getNormalPosition(this.getSelectionEnd(), value);
31036
- this.setMirrorValue(value.substr(0, selectionStart) +
31114
+ this.setMirrorValue(value.substring(0, selectionStart) +
31037
31115
  this.clnInv(markerStart.outerHTML) +
31038
- value.substr(selectionStart, selectionEnd - selectionStart) +
31116
+ value.substring(selectionStart, selectionEnd - selectionStart) +
31039
31117
  this.clnInv(markerEnd.outerHTML) +
31040
- value.substr(selectionEnd));
31118
+ value.substring(selectionEnd));
31041
31119
  }
31042
31120
  this.toWYSIWYG();
31043
31121
  }