jodit 3.6.16 → 3.7.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 (107) hide show
  1. package/.eslintrc.js +1 -1
  2. package/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
  3. package/{PULL_REQUEST_TEMPLATE.md → .github/PULL_REQUEST_TEMPLATE.md} +0 -0
  4. package/CHANGELOG.MD +76 -5
  5. package/build/jodit.css +23 -19
  6. package/build/jodit.es2018.css +22 -18
  7. package/build/jodit.es2018.en.css +22 -18
  8. package/build/jodit.es2018.en.js +153 -99
  9. package/build/jodit.es2018.en.min.css +1 -1
  10. package/build/jodit.es2018.en.min.js +2 -2
  11. package/build/jodit.es2018.js +153 -99
  12. package/build/jodit.es2018.min.css +1 -1
  13. package/build/jodit.es2018.min.js +2 -2
  14. package/build/jodit.js +884 -809
  15. package/build/jodit.min.css +2 -2
  16. package/build/jodit.min.js +2 -2
  17. package/package.json +24 -24
  18. package/src/core/async.ts +22 -8
  19. package/src/core/component/component.ts +4 -2
  20. package/src/core/component/view-component.ts +1 -1
  21. package/src/core/decorators/cache.ts +1 -1
  22. package/src/core/decorators/component.ts +1 -1
  23. package/src/core/decorators/debounce.ts +5 -4
  24. package/src/core/decorators/idle.ts +40 -0
  25. package/src/core/decorators/index.ts +1 -0
  26. package/src/core/decorators/nonenumerable.ts +1 -1
  27. package/src/core/decorators/spy.ts +2 -3
  28. package/src/core/decorators/watch.ts +9 -5
  29. package/src/core/events/events-native.ts +1 -1
  30. package/src/core/global.ts +7 -3
  31. package/src/core/helpers/checker/is-plain-object.ts +1 -2
  32. package/src/core/helpers/checker/is-url.ts +4 -1
  33. package/src/core/helpers/scroll-into-view.ts +1 -1
  34. package/src/core/helpers/size/position.ts +1 -22
  35. package/src/core/helpers/string/stringify.ts +2 -2
  36. package/src/core/helpers/type.ts +0 -44
  37. package/src/core/helpers/utils/utils.ts +1 -1
  38. package/src/core/plugin.ts +3 -1
  39. package/src/core/ui/button/button/button.ts +2 -2
  40. package/src/core/ui/button/group/group.ts +6 -4
  41. package/src/core/ui/element.ts +2 -2
  42. package/src/core/ui/form/block/block.ts +1 -1
  43. package/src/core/ui/form/form.ts +5 -5
  44. package/src/core/ui/form/inputs/area/area.ts +3 -3
  45. package/src/core/ui/form/inputs/checkbox/checkbox.ts +2 -2
  46. package/src/core/ui/form/inputs/file/file.ts +6 -4
  47. package/src/core/ui/form/inputs/input/input.ts +7 -5
  48. package/src/core/ui/form/inputs/select/select.ts +9 -7
  49. package/src/core/ui/list/group.ts +4 -4
  50. package/src/core/ui/list/list.ts +2 -2
  51. package/src/core/ui/popup/popup.ts +3 -3
  52. package/src/core/ui/progress-bar/progress-bar.ts +3 -3
  53. package/src/core/view/view-with-toolbar.ts +5 -2
  54. package/src/core/view/view.ts +2 -2
  55. package/src/jodit.ts +37 -15
  56. package/src/modules/context-menu/context-menu.ts +1 -1
  57. package/src/modules/dialog/dialog.ts +4 -4
  58. package/src/modules/file-browser/builders/context-menu.ts +1 -1
  59. package/src/modules/file-browser/data-provider.ts +1 -1
  60. package/src/modules/file-browser/file-browser.ts +3 -3
  61. package/src/modules/image-editor/image-editor.ts +1 -1
  62. package/src/modules/observer/observer.ts +1 -1
  63. package/src/modules/observer/snapshot.ts +1 -1
  64. package/src/modules/status-bar/status-bar.ts +1 -1
  65. package/src/modules/table.ts +3 -1
  66. package/src/modules/toolbar/button/button.ts +13 -10
  67. package/src/modules/toolbar/button/content.ts +3 -3
  68. package/src/modules/toolbar/collection/collection.ts +9 -6
  69. package/src/modules/toolbar/collection/editor-collection.ts +26 -4
  70. package/src/modules/uploader/uploader.ts +1 -1
  71. package/src/modules/widget/file-selector/file-selector.ts +1 -1
  72. package/src/plugins/about/about.ts +1 -1
  73. package/src/plugins/class-span/class-span.ts +3 -3
  74. package/src/plugins/clipboard/clipboard.ts +28 -24
  75. package/src/plugins/clipboard/paste/helpers.ts +5 -8
  76. package/src/plugins/clipboard/paste/paste.ts +3 -3
  77. package/src/plugins/fix/clean-html.ts +3 -3
  78. package/src/plugins/image/helpers.ts +1 -1
  79. package/src/plugins/inline-popup/inline-popup.ts +1 -1
  80. package/src/plugins/keyboard/delete.ts +1 -1
  81. package/src/plugins/keyboard/enter.ts +26 -26
  82. package/src/plugins/limit.ts +2 -2
  83. package/src/plugins/link/link.ts +3 -3
  84. package/src/plugins/media/video/index.ts +1 -1
  85. package/src/plugins/ordered-list.ts +64 -61
  86. package/src/plugins/redo-undo.ts +3 -3
  87. package/src/plugins/search/search.ts +2 -2
  88. package/src/plugins/select.ts +3 -2
  89. package/src/plugins/size/resize-handler.ts +2 -2
  90. package/src/plugins/size/size.ts +2 -2
  91. package/src/plugins/source/editor/engines/ace.ts +8 -8
  92. package/src/plugins/source/editor/engines/area.ts +15 -13
  93. package/src/plugins/source/source.ts +1 -1
  94. package/src/plugins/symbols/symbols.ts +3 -3
  95. package/src/plugins/table/config.ts +3 -1
  96. package/src/plugins/table/resize-cells.ts +21 -16
  97. package/src/plugins/table/select-cells.ts +44 -6
  98. package/src/plugins/table/table-keyboard-navigation.ts +134 -131
  99. package/src/plugins/table/table.less +24 -17
  100. package/src/types/async.d.ts +2 -0
  101. package/src/types/core.ts +13 -0
  102. package/src/types/index.d.ts +1 -0
  103. package/src/types/jodit.d.ts +2 -0
  104. package/test/tests/acceptance/editorTest.js +37 -0
  105. package/test/tests/acceptance/tableTest.js +23 -14
  106. package/tsconfig.json +1 -0
  107. package/webpack.config.js +1 -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.6.16
4
+ * Version: v3.7.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -648,7 +648,7 @@ class EventsNative {
648
648
  }
649
649
  getStore(subject) {
650
650
  if (!subject) {
651
- throw (0,type/* error */.vU)('Need subject');
651
+ throw (0,type/* error */.v)('Need subject');
652
652
  }
653
653
  if (subject[this.__key] === undefined) {
654
654
  const store = new EventHandlersStore();
@@ -710,10 +710,10 @@ class EventsNative {
710
710
  }
711
711
  const store = this.getStore(subject);
712
712
  if (!(0,is_string/* isString */.H)(events) || events === '') {
713
- throw (0,type/* error */.vU)('Need events names');
713
+ throw (0,type/* error */.v)('Need events names');
714
714
  }
715
715
  if (!(0,is_function/* isFunction */.m)(callback)) {
716
- throw (0,type/* error */.vU)('Need event handler');
716
+ throw (0,type/* error */.v)('Need event handler');
717
717
  }
718
718
  if ((0,is_array/* isArray */.k)(subject)) {
719
719
  subject.forEach((subj) => {
@@ -738,7 +738,7 @@ class EventsNative {
738
738
  }
739
739
  this.eachEvent(events, (event, namespace) => {
740
740
  if (event === '') {
741
- throw (0,type/* error */.vU)('Need event name');
741
+ throw (0,type/* error */.v)('Need event name');
742
742
  }
743
743
  if (store.indexOf(event, namespace, callback) === false) {
744
744
  const block = {
@@ -850,7 +850,7 @@ class EventsNative {
850
850
  ? subjectOrEvents
851
851
  : eventsList;
852
852
  if (typeof events !== 'string') {
853
- throw (0,type/* error */.vU)('Need event names');
853
+ throw (0,type/* error */.v)('Need event names');
854
854
  }
855
855
  const store = this.getStore(subject);
856
856
  this.eachEvent(events, (event, namespace) => {
@@ -888,7 +888,7 @@ class EventsNative {
888
888
  : args;
889
889
  const isDOMElement = (0,is_function/* isFunction */.m)(subject.dispatchEvent);
890
890
  if (!isDOMElement && !(0,is_string/* isString */.H)(events)) {
891
- throw (0,type/* error */.vU)('Need events names');
891
+ throw (0,type/* error */.v)('Need events names');
892
892
  }
893
893
  const store = this.getStore(subject);
894
894
  if (!(0,is_string/* isString */.H)(events) && isDOMElement) {
@@ -956,7 +956,7 @@ class EventsNative {
956
956
  var tslib_es6 = __webpack_require__(36);
957
957
  // EXTERNAL MODULE: ./src/core/helpers/index.ts + 32 modules
958
958
  var helpers = __webpack_require__(8);
959
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
959
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 9 modules
960
960
  var decorators = __webpack_require__(33);
961
961
  ;// CONCATENATED MODULE: ./src/core/events/observe-object.ts
962
962
  /*!
@@ -1081,48 +1081,13 @@ class ObserveObject {
1081
1081
 
1082
1082
  "use strict";
1083
1083
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1084
- /* harmony export */ "RI": () => (/* binding */ hasOwn),
1085
- /* harmony export */ "dt": () => (/* binding */ type),
1086
- /* harmony export */ "vU": () => (/* binding */ error)
1084
+ /* harmony export */ "v": () => (/* binding */ error)
1087
1085
  /* harmony export */ });
1088
1086
  /*!
1089
1087
  * Jodit Editor (https://xdsoft.net/jodit/)
1090
1088
  * Released under MIT see LICENSE.txt in the project root for license information.
1091
1089
  * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1092
1090
  */
1093
- const class2type = {};
1094
- const toString = class2type.toString;
1095
- const hasOwn = class2type.hasOwnProperty;
1096
- [
1097
- 'Boolean',
1098
- 'Number',
1099
- 'String',
1100
- 'Function',
1101
- 'Array',
1102
- 'Date',
1103
- 'RegExp',
1104
- 'Object',
1105
- 'Error',
1106
- 'Symbol',
1107
- 'HTMLDocument',
1108
- 'Window',
1109
- 'HTMLElement',
1110
- 'HTMLBodyElement',
1111
- 'Text',
1112
- 'DocumentFragment',
1113
- 'DOMStringList',
1114
- 'HTMLCollection'
1115
- ].forEach(name => {
1116
- class2type['[object ' + name + ']'] = name.toLowerCase();
1117
- });
1118
- const type = (obj) => {
1119
- if (obj === null) {
1120
- return 'null';
1121
- }
1122
- return typeof obj === 'object' || typeof obj === 'function'
1123
- ? class2type[toString.call(obj)] || 'object'
1124
- : typeof obj;
1125
- };
1126
1091
  function error(message) {
1127
1092
  return new TypeError(message);
1128
1093
  }
@@ -1220,7 +1185,7 @@ __webpack_require__.d(__webpack_exports__, {
1220
1185
  "dataBind": () => (/* reexport */ data_bind/* dataBind */.q),
1221
1186
  "defaultLanguage": () => (/* reexport */ default_language/* defaultLanguage */.X),
1222
1187
  "each": () => (/* reexport */ each),
1223
- "error": () => (/* reexport */ type/* error */.vU),
1188
+ "error": () => (/* reexport */ type/* error */.v),
1224
1189
  "fastClone": () => (/* reexport */ fastClone),
1225
1190
  "get": () => (/* reexport */ utils/* get */.U2),
1226
1191
  "getClassName": () => (/* reexport */ utils/* getClassName */.gj),
@@ -1228,7 +1193,6 @@ __webpack_require__.d(__webpack_exports__, {
1228
1193
  "getXPathByElement": () => (/* reexport */ getXPathByElement),
1229
1194
  "hasBrowserColorPicker": () => (/* reexport */ checker/* hasBrowserColorPicker */.EO),
1230
1195
  "hasContainer": () => (/* reexport */ checker/* hasContainer */.Zt),
1231
- "hasOwn": () => (/* reexport */ type/* hasOwn */.RI),
1232
1196
  "htmlspecialchars": () => (/* reexport */ htmlspecialchars),
1233
1197
  "humanSizeToBytes": () => (/* reexport */ humanSizeToBytes),
1234
1198
  "i18n": () => (/* reexport */ string/* i18n */.ag),
@@ -1293,7 +1257,6 @@ __webpack_require__.d(__webpack_exports__, {
1293
1257
  "toArray": () => (/* reexport */ toArray),
1294
1258
  "trim": () => (/* reexport */ string/* trim */.fy),
1295
1259
  "trimInv": () => (/* reexport */ string/* trimInv */.as),
1296
- "type": () => (/* reexport */ type/* type */.dt),
1297
1260
  "ucfirst": () => (/* reexport */ string/* ucfirst */.Ps),
1298
1261
  "val": () => (/* reexport */ val)
1299
1262
  });
@@ -1569,14 +1532,14 @@ function resolveElement(element, od) {
1569
1532
  resolved = od.querySelector(element);
1570
1533
  }
1571
1534
  catch (_a) {
1572
- throw (0,type/* error */.vU)('String "' + element + '" should be valid HTML selector');
1535
+ throw (0,type/* error */.v)('String "' + element + '" should be valid HTML selector');
1573
1536
  }
1574
1537
  }
1575
1538
  if (!resolved ||
1576
1539
  typeof resolved !== 'object' ||
1577
1540
  !dom/* Dom.isElement */.i.isElement(resolved) ||
1578
1541
  !resolved.cloneNode) {
1579
- throw (0,type/* error */.vU)('Element "' + element + '" should be string or HTMLElement instance');
1542
+ throw (0,type/* error */.v)('Element "' + element + '" should be string or HTMLElement instance');
1580
1543
  }
1581
1544
  return resolved;
1582
1545
  }
@@ -2818,13 +2781,15 @@ const extendLang = (langs) => {
2818
2781
  });
2819
2782
  };
2820
2783
  const boxes = new WeakMap();
2821
- function getContainer(jodit, classFunc, tag = 'div', inside = false) {
2784
+ function getContainer(jodit, classFunc, tag = 'div', createInsideEditor = false) {
2822
2785
  const name = (0,_helpers___WEBPACK_IMPORTED_MODULE_2__.getClassName)(classFunc.prototype);
2823
2786
  const data = boxes.get(jodit) || {}, key = name + tag;
2824
2787
  const view = (0,_helpers___WEBPACK_IMPORTED_MODULE_2__.isViewObject)(jodit) ? jodit : jodit.j;
2825
2788
  if (!data[key]) {
2826
2789
  let c = view.c, body = jodit.od.body;
2827
- if (inside && (0,_helpers___WEBPACK_IMPORTED_MODULE_2__.isJoditObject)(jodit) && jodit.od !== jodit.ed) {
2790
+ if (createInsideEditor &&
2791
+ (0,_helpers___WEBPACK_IMPORTED_MODULE_2__.isJoditObject)(jodit) &&
2792
+ jodit.od !== jodit.ed) {
2828
2793
  c = jodit.createInside;
2829
2794
  body = tag === 'style' ? jodit.ed.head : jodit.ed.body;
2830
2795
  }
@@ -3652,8 +3617,6 @@ function isWindow(obj) {
3652
3617
  return obj != null && obj === obj.window;
3653
3618
  }
3654
3619
 
3655
- // EXTERNAL MODULE: ./src/core/helpers/type.ts
3656
- var type = __webpack_require__(4);
3657
3620
  ;// CONCATENATED MODULE: ./src/core/helpers/checker/is-plain-object.ts
3658
3621
  /*!
3659
3622
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -3661,13 +3624,12 @@ var type = __webpack_require__(4);
3661
3624
  * Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3662
3625
  */
3663
3626
 
3664
-
3665
3627
  function isPlainObject(obj) {
3666
3628
  if (!obj || typeof obj !== 'object' || obj.nodeType || isWindow(obj)) {
3667
3629
  return false;
3668
3630
  }
3669
3631
  return !(obj.constructor &&
3670
- !type/* hasOwn.call */.RI.call(obj.constructor.prototype, 'isPrototypeOf'));
3632
+ !{}.hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'));
3671
3633
  }
3672
3634
 
3673
3635
  // EXTERNAL MODULE: ./src/core/helpers/checker/is-promise.ts
@@ -3685,7 +3647,7 @@ function isURL(str) {
3685
3647
  if (typeof URL !== 'undefined') {
3686
3648
  try {
3687
3649
  const url = new URL(str);
3688
- return ['https:', 'http:', 'ftp:', 'file:'].includes(url.protocol);
3650
+ return ['https:', 'http:', 'ftp:', 'file:', 'rtmp:'].includes(url.protocol);
3689
3651
  }
3690
3652
  catch (e) {
3691
3653
  return false;
@@ -3756,7 +3718,7 @@ function isValidName(name) {
3756
3718
  */
3757
3719
  function stringify(value, options = {}) {
3758
3720
  if (typeof value !== 'object') {
3759
- return value.toString ? value.toString() : value;
3721
+ return String(value);
3760
3722
  }
3761
3723
  const excludeKeys = new Set(options.excludeKeys);
3762
3724
  const map = new WeakMap();
@@ -4825,7 +4787,7 @@ var helpers = __webpack_require__(8);
4825
4787
  var icon = __webpack_require__(27);
4826
4788
  // EXTERNAL MODULE: ./src/core/ui/list/list.ts + 1 modules
4827
4789
  var list = __webpack_require__(31);
4828
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
4790
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 9 modules
4829
4791
  var decorators = __webpack_require__(33);
4830
4792
  // EXTERNAL MODULE: ./src/core/component/index.ts + 3 modules
4831
4793
  var component = __webpack_require__(11);
@@ -5157,7 +5119,7 @@ function getStrongControlTypes(items, controls) {
5157
5119
  return elements.map(item => (0,get_control_type/* getControlType */.Y)(item, controls || config/* Config.defaultOptions.controls */.D.defaultOptions.controls));
5158
5120
  }
5159
5121
 
5160
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
5122
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 9 modules
5161
5123
  var decorators = __webpack_require__(33);
5162
5124
  // EXTERNAL MODULE: ./src/core/ui/list/group.ts
5163
5125
  var group = __webpack_require__(35);
@@ -5353,6 +5315,7 @@ __webpack_require__.d(__webpack_exports__, {
5353
5315
  "debounce": () => (/* reexport */ debounce),
5354
5316
  "getPropertyDescriptor": () => (/* reexport */ getPropertyDescriptor),
5355
5317
  "hook": () => (/* reexport */ hook),
5318
+ "idle": () => (/* reexport */ idle),
5356
5319
  "nonenumerable": () => (/* reexport */ nonenumerable),
5357
5320
  "persistent": () => (/* reexport */ persistent),
5358
5321
  "throttle": () => (/* reexport */ throttle),
@@ -5449,6 +5412,24 @@ function throttle(timeout, firstCallImmediately = false) {
5449
5412
  return debounce(timeout, firstCallImmediately, 'throttle');
5450
5413
  }
5451
5414
 
5415
+ ;// CONCATENATED MODULE: ./src/core/decorators/idle.ts
5416
+
5417
+
5418
+ function idle() {
5419
+ return (target, propertyKey) => {
5420
+ if (!(0,helpers.isFunction)(target[propertyKey])) {
5421
+ throw (0,helpers.error)('Handler must be a Function');
5422
+ }
5423
+ target.hookStatus(core_component/* STATUSES.ready */.n$.ready, (component) => {
5424
+ const view = (0,helpers.isViewObject)(component)
5425
+ ? component
5426
+ : component.jodit;
5427
+ const originalMethod = component[propertyKey];
5428
+ component[propertyKey] = (...args) => view.async.requestIdleCallback(originalMethod.bind(component, ...args));
5429
+ });
5430
+ };
5431
+ }
5432
+
5452
5433
  ;// CONCATENATED MODULE: ./src/core/decorators/hook.ts
5453
5434
  /*!
5454
5435
  * Jodit Editor (https://xdsoft.net/jodit/)
@@ -5588,9 +5569,10 @@ function watch(observeFields, context) {
5588
5569
  if ((0,helpers.isFunction)(context)) {
5589
5570
  context = context(component);
5590
5571
  }
5591
- view.events
5592
- .on(context || component, eventName, callback)
5593
- .on(eventName, callback);
5572
+ view.events.on(context || component, eventName, callback);
5573
+ if (!context) {
5574
+ view.events.on(eventName, callback);
5575
+ }
5594
5576
  view.hookStatus('beforeDestruct', () => {
5595
5577
  view.events
5596
5578
  .off(context || component, eventName, callback)
@@ -5666,6 +5648,7 @@ var esm = __webpack_require__(34);
5666
5648
 
5667
5649
 
5668
5650
 
5651
+
5669
5652
  /***/ }),
5670
5653
  /* 34 */
5671
5654
  /***/ ((__unused_webpack_module, exports) => {
@@ -6108,10 +6091,16 @@ function __spreadArrays() {
6108
6091
  return r;
6109
6092
  }
6110
6093
  exports.__spreadArrays = __spreadArrays;
6111
- function __spreadArray(to, from) {
6112
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
6113
- to[j] = from[i];
6114
- return to;
6094
+ function __spreadArray(to, from, pack) {
6095
+ if (pack || arguments.length === 2)
6096
+ for (var i = 0, l = from.length, ar; i < l; i++) {
6097
+ if (ar || !(i in from)) {
6098
+ if (!ar)
6099
+ ar = Array.prototype.slice.call(from, 0, i);
6100
+ ar[i] = from[i];
6101
+ }
6102
+ }
6103
+ return to.concat(ar || from);
6115
6104
  }
6116
6105
  exports.__spreadArray = __spreadArray;
6117
6106
  function __await(v) {
@@ -6286,7 +6275,7 @@ var helpers = __webpack_require__(8);
6286
6275
  var global = __webpack_require__(12);
6287
6276
  // EXTERNAL MODULE: ./src/core/ui/element.ts
6288
6277
  var ui_element = __webpack_require__(25);
6289
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
6278
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 9 modules
6290
6279
  var decorators = __webpack_require__(33);
6291
6280
  ;// CONCATENATED MODULE: ./src/core/ui/popup/popup.ts
6292
6281
  /*!
@@ -6569,7 +6558,7 @@ var ui_element = __webpack_require__(25);
6569
6558
  var helpers = __webpack_require__(8);
6570
6559
  // EXTERNAL MODULE: ./src/core/dom.ts
6571
6560
  var dom = __webpack_require__(14);
6572
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
6561
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 9 modules
6573
6562
  var decorators = __webpack_require__(33);
6574
6563
  // EXTERNAL MODULE: ./src/core/ui/icon.ts
6575
6564
  var ui_icon = __webpack_require__(27);
@@ -7374,7 +7363,7 @@ const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true) => {
7374
7363
  required: true,
7375
7364
  label: 'URL',
7376
7365
  name: 'url',
7377
- type: 'url',
7366
+ type: 'text',
7378
7367
  placeholder: 'https://'
7379
7368
  }),
7380
7369
  new ui/* UIInput */.u3(editor, {
@@ -8555,21 +8544,29 @@ class Async {
8555
8544
  return 0;
8556
8545
  }
8557
8546
  let options = {};
8558
- if (typeof timeout !== 'number') {
8547
+ if (!(0,helpers.isNumber)(timeout)) {
8559
8548
  options = timeout;
8560
8549
  timeout = options.timeout || 0;
8561
8550
  }
8562
- if (options.label && this.timers.has(options.label)) {
8563
- (0,helpers.clearTimeout)(this.timers.get(options.label));
8564
- this.timers.delete(options.label);
8551
+ if (options.label) {
8552
+ this.clearLabel(options.label);
8565
8553
  }
8566
8554
  const timer = (0,helpers.setTimeout)(callback, timeout, ...args), key = options.label || timer;
8567
8555
  this.timers.set(key, timer);
8568
8556
  return timer;
8569
8557
  }
8570
- clearTimeout(timer) {
8571
- (0,helpers.clearTimeout)(timer);
8572
- this.timers.delete(timer);
8558
+ clearLabel(label) {
8559
+ if (label && this.timers.has(label)) {
8560
+ (0,helpers.clearTimeout)(this.timers.get(label));
8561
+ this.timers.delete(label);
8562
+ }
8563
+ }
8564
+ clearTimeout(timerOrLabel) {
8565
+ if ((0,helpers.isString)(timerOrLabel)) {
8566
+ return this.clearLabel(timerOrLabel);
8567
+ }
8568
+ (0,helpers.clearTimeout)(timerOrLabel);
8569
+ this.timers.delete(timerOrLabel);
8573
8570
  }
8574
8571
  debounce(fn, timeout, firstCallImmediately = false) {
8575
8572
  let timer = 0, fired = false;
@@ -9073,7 +9070,7 @@ class Storage {
9073
9070
 
9074
9071
  // EXTERNAL MODULE: ./src/core/global.ts
9075
9072
  var global = __webpack_require__(12);
9076
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
9073
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 9 modules
9077
9074
  var decorators = __webpack_require__(33);
9078
9075
  // EXTERNAL MODULE: ./src/core/traits/index.ts + 2 modules
9079
9076
  var traits = __webpack_require__(26);
@@ -9099,7 +9096,7 @@ class View extends component/* Component */.wA {
9099
9096
  this.isView = true;
9100
9097
  this.mods = {};
9101
9098
  this.components = new Set();
9102
- this.version = "3.6.16";
9099
+ this.version = "3.7.2";
9103
9100
  this.async = new Async();
9104
9101
  this.buffer = Storage.makeStorage();
9105
9102
  this.storage = Storage.makeStorage(true, this.componentName);
@@ -9197,10 +9194,10 @@ class View extends component/* Component */.wA {
9197
9194
  return this.__isFullSize;
9198
9195
  }
9199
9196
  getVersion() {
9200
- return "3.6.16";
9197
+ return "3.7.2";
9201
9198
  }
9202
9199
  static getVersion() {
9203
- return "3.6.16";
9200
+ return "3.7.2";
9204
9201
  }
9205
9202
  initOptions(options) {
9206
9203
  this.options = (0,helpers.ConfigProto)(options || {}, (0,helpers.ConfigProto)(this.options || {}, View.defaultOptions));
@@ -9396,8 +9393,8 @@ ToolbarCollection = (0,tslib_es6.__decorate)([
9396
9393
 
9397
9394
 
9398
9395
  let ToolbarEditorCollection = class ToolbarEditorCollection extends ToolbarCollection {
9399
- constructor() {
9400
- super(...arguments);
9396
+ constructor(jodit) {
9397
+ super(jodit);
9401
9398
  this.checkActiveStatus = (cssObject, node) => {
9402
9399
  let matches = 0, total = 0;
9403
9400
  Object.keys(cssObject).forEach((cssProperty) => {
@@ -9416,6 +9413,7 @@ let ToolbarEditorCollection = class ToolbarEditorCollection extends ToolbarColle
9416
9413
  });
9417
9414
  return total === matches;
9418
9415
  };
9416
+ this.prependInvisibleInput(this.container);
9419
9417
  }
9420
9418
  className() {
9421
9419
  return 'ToolbarEditorCollection';
@@ -9468,6 +9466,13 @@ let ToolbarEditorCollection = class ToolbarEditorCollection extends ToolbarColle
9468
9466
  getTarget(button) {
9469
9467
  return button.target || this.j.s.current() || null;
9470
9468
  }
9469
+ prependInvisibleInput(container) {
9470
+ const input = this.j.create.element('input', {
9471
+ tabIndex: -1,
9472
+ style: 'width: 0; height:0; position: absolute; visibility: hidden;'
9473
+ });
9474
+ dom/* Dom.appendChildFirst */.i.appendChildFirst(container, input);
9475
+ }
9471
9476
  };
9472
9477
  ToolbarEditorCollection = (0,tslib_es6.__decorate)([
9473
9478
  decorators.component
@@ -9717,12 +9722,14 @@ let ToolbarButton = class ToolbarButton extends ui_button/* UIButton */.y3 {
9717
9722
  originalEvent,
9718
9723
  button: this
9719
9724
  });
9720
- if (result !== false) {
9725
+ if (result !== false && result !== true) {
9721
9726
  (_e = (_d = this.j) === null || _d === void 0 ? void 0 : _d.e) === null || _e === void 0 ? void 0 : _e.fire('synchro');
9722
9727
  if (this.parentElement) {
9723
9728
  this.parentElement.update();
9724
9729
  }
9725
9730
  (_g = (_f = this.j) === null || _f === void 0 ? void 0 : _f.e) === null || _g === void 0 ? void 0 : _g.fire('closeAllPopups afterExec');
9731
+ }
9732
+ if (result !== false) {
9726
9733
  return;
9727
9734
  }
9728
9735
  }
@@ -9843,11 +9850,12 @@ var helpers_buttons = __webpack_require__(38);
9843
9850
  class ViewWithToolbar extends View {
9844
9851
  constructor(options, isJodit = false) {
9845
9852
  super(options, isJodit);
9846
- this.isJodit = isJodit;
9847
9853
  this.toolbar = makeCollection(this);
9848
9854
  this.defaultToolbarContainer = this.c.div('jodit-toolbar__box');
9849
9855
  this.registeredButtons = new Set();
9850
9856
  this.groupToButtons = {};
9857
+ this.isJodit = false;
9858
+ this.isJodit = isJodit;
9851
9859
  this.e.on('beforeToolbarBuild', this.beforeToolbarBuild);
9852
9860
  }
9853
9861
  get toolbarContainer() {
@@ -10510,6 +10518,7 @@ const Confirm = (msg, title, callback) => {
10510
10518
  class Plugin extends component/* ViewComponent */.Hr {
10511
10519
  constructor(jodit) {
10512
10520
  super(jodit);
10521
+ this.requires = [];
10513
10522
  this.buttons = [];
10514
10523
  this.hasStyle = false;
10515
10524
  jodit.e
@@ -15448,6 +15457,14 @@ class Jodit extends ViewWithToolbar {
15448
15457
  className() {
15449
15458
  return 'Jodit';
15450
15459
  }
15460
+ waitForReady() {
15461
+ if (this.isReady) {
15462
+ return Promise.resolve(this);
15463
+ }
15464
+ return this.async.promise(resolve => {
15465
+ this.hookStatus('ready', () => resolve(this));
15466
+ });
15467
+ }
15451
15468
  get text() {
15452
15469
  if (this.editor) {
15453
15470
  return this.editor.innerText || '';
@@ -16441,7 +16458,7 @@ config/* Config.prototype.controls.about */.D.prototype.controls.about = {
16441
16458
  ? 'MIT'
16442
16459
  : (0,helpers.normalizeLicense)(editor.o.license))}</div>
16443
16460
  <div>
16444
- <a href="https://xdsoft.net/jodit/" target="_blank">http://xdsoft.net/jodit/</a>
16461
+ <a href="${"https://xdsoft.net/jodit/"}" target="_blank">${"https://xdsoft.net/jodit/"}</a>
16445
16462
  </div>
16446
16463
  <div>
16447
16464
  <a href="https://xdsoft.net/jodit/doc/" target="_blank">${i18n("Jodit User's Guide")}</a>
@@ -17655,7 +17672,8 @@ function pasteInsertHtml(e, editor, html) {
17655
17672
  function getAllTypes(dt) {
17656
17673
  const types = dt.types;
17657
17674
  let types_str = '';
17658
- if ((0,helpers.isArray)(types) || (0,helpers.type)(types) === 'domstringlist') {
17675
+ if ((0,helpers.isArray)(types) ||
17676
+ {}.toString.call(types) === '[object DOMStringList]') {
17659
17677
  for (let i = 0; i < types.length; i += 1) {
17660
17678
  types_str += types[i] + ';';
17661
17679
  }
@@ -18865,7 +18883,9 @@ class enter extends Plugin {
18865
18883
  ? constants.PARAGRAPH
18866
18884
  : this.defaultTag;
18867
18885
  }
18868
- editor.e.off('.enter').on('keydown.enter', (event) => {
18886
+ editor.e
18887
+ .off('.enter')
18888
+ .on('keydown.enter', (event) => {
18869
18889
  if (event.key === constants.KEY_ENTER) {
18870
18890
  const beforeEnter = editor.e.fire('beforeEnter', event);
18871
18891
  if (beforeEnter !== undefined) {
@@ -21776,7 +21796,8 @@ function orderedList(editor) {
21776
21796
  if (isOurCommand(command) && listStyleType) {
21777
21797
  const ul = getListWrapper();
21778
21798
  if (ul && !listStyleTypeEqual(ul, listStyleType)) {
21779
- if ((dom/* Dom.isTag */.i.isTag(ul, 'ul') && /unordered/i.test(command)) ||
21799
+ if ((dom/* Dom.isTag */.i.isTag(ul, 'ul') &&
21800
+ /unordered/i.test(command)) ||
21780
21801
  (dom/* Dom.isTag */.i.isTag(ul, 'ol') && !/unordered/i.test(command))) {
21781
21802
  setListStyleType(ul, listStyleType);
21782
21803
  return false;
@@ -22860,12 +22881,12 @@ class select_select extends Plugin {
22860
22881
  }
22861
22882
  afterInit(jodit) {
22862
22883
  this.proxyEventsList.forEach(eventName => {
22863
- jodit.e.on(eventName + '.inline-popup', this.onStartSelection);
22884
+ jodit.e.on(eventName + '.select', this.onStartSelection);
22864
22885
  });
22865
22886
  }
22866
22887
  beforeDestruct(jodit) {
22867
22888
  this.proxyEventsList.forEach(eventName => {
22868
- jodit.e.on(eventName + '.inline-popup', this.onStartSelection);
22889
+ jodit.e.on(eventName + '.select', this.onStartSelection);
22869
22890
  });
22870
22891
  }
22871
22892
  onStartSelection(e) {
@@ -24329,7 +24350,8 @@ class symbols extends Plugin {
24329
24350
 
24330
24351
  config/* Config.prototype.table */.D.prototype.table = {
24331
24352
  allowCellSelection: true,
24332
- selectionCellStyle: 'border: 1px double #1e88e5 !important;',
24353
+ selectionCellStyle: 'border: 1px double #1e88e5 !important;' +
24354
+ 'background-color: rgba(158, 207, 250, 0.3)!important',
24333
24355
  allowCellResize: true,
24334
24356
  useExtraClassesOptions: false
24335
24357
  };
@@ -24693,7 +24715,7 @@ class resizeCells extends Plugin {
24693
24715
  this.hideResizeHandle();
24694
24716
  }
24695
24717
  })
24696
- .on(table, 'mousemove.resize-cells touchmove.resize-cells', (event) => {
24718
+ .on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle((event) => {
24697
24719
  if (this.j.isLocked) {
24698
24720
  return;
24699
24721
  }
@@ -24702,7 +24724,9 @@ class resizeCells extends Plugin {
24702
24724
  return;
24703
24725
  }
24704
24726
  this.calcHandlePosition(table, cell, event.offsetX);
24705
- });
24727
+ }, {
24728
+ timeout: this.j.defaultTimeout
24729
+ }));
24706
24730
  this.createResizeHandle();
24707
24731
  }
24708
24732
  beforeDestruct(jodit) {
@@ -24739,11 +24763,13 @@ class resizeCells extends Plugin {
24739
24763
 
24740
24764
 
24741
24765
  const select_cells_key = 'table_processor_observer';
24766
+ const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
24742
24767
  class selectCells extends Plugin {
24743
24768
  constructor() {
24744
24769
  super(...arguments);
24745
24770
  this.requires = ['select'];
24746
24771
  this.selectedCell = null;
24772
+ this.isSelectionMode = false;
24747
24773
  }
24748
24774
  get module() {
24749
24775
  return this.j.getInstance('Table', this.j.o);
@@ -24769,8 +24795,13 @@ class selectCells extends Plugin {
24769
24795
  ]
24770
24796
  .map(e => e + '.select-cells')
24771
24797
  .join(' '), this.onStartSelection)
24772
- .on('clickTr', () => {
24773
- if (this.module.getAllSelectedCells().length) {
24798
+ .on('clickTr clickTbody', () => {
24799
+ var _a;
24800
+ const cellsCount = this.module.getAllSelectedCells().length;
24801
+ if (cellsCount) {
24802
+ if (cellsCount > 1) {
24803
+ (_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
24804
+ }
24774
24805
  return false;
24775
24806
  }
24776
24807
  });
@@ -24790,17 +24821,28 @@ class selectCells extends Plugin {
24790
24821
  if (!cell.firstChild) {
24791
24822
  cell.appendChild(this.j.createInside.element('br'));
24792
24823
  }
24824
+ this.isSelectionMode = true;
24793
24825
  this.selectedCell = cell;
24794
24826
  this.module.addSelection(cell);
24795
24827
  this.j.e
24796
- .on(table, 'mousemove.select-cells touchmove.select-cells', this.onMove.bind(this, table))
24828
+ .on(table, 'mousemove.select-cells touchmove.select-cells', this.j.async.throttle(this.onMove.bind(this, table), {
24829
+ label: MOUSE_MOVE_LABEL,
24830
+ timeout: this.j.defaultTimeout / 2
24831
+ }))
24797
24832
  .on(table, 'mouseup.select-cells touchend.select-cells', this.onStopSelection.bind(this, table));
24798
24833
  return false;
24799
24834
  }
24800
- onOutsideClick(e) {
24801
- this.unselectCells();
24835
+ onOutsideClick() {
24836
+ this.selectedCell = null;
24837
+ this.onRemoveSelection();
24838
+ }
24839
+ onChange() {
24840
+ if (!this.j.isLocked && !this.isSelectionMode) {
24841
+ this.onRemoveSelection();
24842
+ }
24802
24843
  }
24803
24844
  onMove(table, e) {
24845
+ var _a;
24804
24846
  if (this.j.o.readonly) {
24805
24847
  return;
24806
24848
  }
@@ -24825,6 +24867,10 @@ class selectCells extends Plugin {
24825
24867
  this.module.addSelection(box[i][j]);
24826
24868
  }
24827
24869
  }
24870
+ const cellsCount = this.module.getAllSelectedCells().length;
24871
+ if (cellsCount > 1) {
24872
+ (_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
24873
+ }
24828
24874
  this.j.e.fire('hidePopup');
24829
24875
  e.stopPropagation();
24830
24876
  (() => {
@@ -24846,12 +24892,14 @@ class selectCells extends Plugin {
24846
24892
  this.j.e.fire('hidePopup', 'cells');
24847
24893
  return;
24848
24894
  }
24895
+ this.isSelectionMode = false;
24849
24896
  this.selectedCell = null;
24850
24897
  }
24851
24898
  onStopSelection(table, e) {
24852
24899
  if (!this.selectedCell) {
24853
24900
  return;
24854
24901
  }
24902
+ this.isSelectionMode = false;
24855
24903
  this.j.unlock();
24856
24904
  const node = this.j.ed.elementFromPoint(e.clientX, e.clientY);
24857
24905
  if (!node) {
@@ -24879,6 +24927,7 @@ class selectCells extends Plugin {
24879
24927
  (0,helpers.$$)('table', this.j.editor).forEach(table => {
24880
24928
  this.j.e.off(table, 'mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells');
24881
24929
  });
24930
+ this.j.async.clearTimeout(MOUSE_MOVE_LABEL);
24882
24931
  }
24883
24932
  unselectCells(table, currentCell) {
24884
24933
  const module = this.module;
@@ -24957,6 +25006,9 @@ class selectCells extends Plugin {
24957
25006
  (0,tslib_es6.__decorate)([
24958
25007
  (0,decorators.watch)(':outsideClick')
24959
25008
  ], selectCells.prototype, "onOutsideClick", null);
25009
+ (0,tslib_es6.__decorate)([
25010
+ (0,decorators.watch)(':change')
25011
+ ], selectCells.prototype, "onChange", null);
24960
25012
  (0,tslib_es6.__decorate)([
24961
25013
  decorators.autobind
24962
25014
  ], selectCells.prototype, "onRemoveSelection", null);
@@ -24990,7 +25042,9 @@ function tableKeyboardNavigation(editor) {
24990
25042
  event.key === constants.KEY_UP ||
24991
25043
  event.key === constants.KEY_DOWN) {
24992
25044
  current = editor.s.current();
24993
- block = dom/* Dom.up */.i.up(current, (elm) => elm && elm.nodeName && /^td|th$/i.test(elm.nodeName), editor.editor);
25045
+ block = dom/* Dom.up */.i.up(current, (elm) => elm &&
25046
+ elm.nodeName &&
25047
+ /^td|th$/i.test(elm.nodeName), editor.editor);
24994
25048
  if (!block) {
24995
25049
  return;
24996
25050
  }