jodit 4.11.14 → 4.12.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 (62) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +86 -7
  5. package/es2015/jodit.min.js +5 -5
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +5 -5
  13. package/es2018/jodit.min.js +5 -5
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +6 -6
  18. package/es2021/jodit.js +86 -7
  19. package/es2021/jodit.min.js +6 -6
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +6 -6
  28. package/es2021.en/jodit.js +86 -7
  29. package/es2021.en/jodit.min.js +7 -7
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +88 -6
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/helpers/utils/config-proto.d.ts +21 -0
  52. package/esm/core/helpers/utils/config-proto.js +32 -0
  53. package/esm/jodit.d.ts +44 -0
  54. package/esm/jodit.js +47 -1
  55. package/esm/modules/widget/file-selector/file-selector.js +2 -1
  56. package/esm/plugins/image-properties/ui/ui-image-main-tab.js +2 -2
  57. package/esm/plugins/link/link.js +2 -1
  58. package/esm/typings.d.ts +1 -0
  59. package/package.json +1 -1
  60. package/types/core/helpers/utils/config-proto.d.ts +21 -0
  61. package/types/jodit.d.ts +44 -0
  62. package/types/typings.d.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.11.14
4
+ * Version: v4.12.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1758,7 +1758,7 @@ __webpack_require__.r(__webpack_exports__);
1758
1758
  * ```
1759
1759
  * @packageDocumentation
1760
1760
  * @module constants
1761
- */ const APP_VERSION = "4.11.14";
1761
+ */ const APP_VERSION = "4.12.2";
1762
1762
  // prettier-ignore
1763
1763
  const ES = "es2021";
1764
1764
  const IS_ES_MODERN = true;
@@ -7512,6 +7512,7 @@ const completeUrl = (url)=>{
7512
7512
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7513
7513
  /* harmony export */ ConfigDeepFlatten: function() { return /* binding */ ConfigDeepFlatten; },
7514
7514
  /* harmony export */ ConfigFlatten: function() { return /* binding */ ConfigFlatten; },
7515
+ /* harmony export */ ConfigMerge: function() { return /* binding */ ConfigMerge; },
7515
7516
  /* harmony export */ ConfigProto: function() { return /* binding */ ConfigProto; }
7516
7517
  /* harmony export */ });
7517
7518
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17312);
@@ -7622,7 +7623,37 @@ function ConfigFlatten(obj) {
7622
7623
  * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
7623
7624
  * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
7624
7625
  * ```
7625
- */ function ConfigDeepFlatten(obj) {
7626
+ */ /**
7627
+ * Deep-merges `source` into `target` in-place.
7628
+ * Uses the same merge semantics as {@link ConfigProto}:
7629
+ * - Nested plain objects are merged recursively
7630
+ * - {@link isAtom | Atomic} values replace the target entirely
7631
+ * - Everything else (primitives, arrays, class instances) replaces the target value
7632
+ *
7633
+ * Designed for patching `Config.defaultOptions` without losing existing keys:
7634
+ *
7635
+ * ```js
7636
+ * Jodit.configure({
7637
+ * controls: {
7638
+ * someButton: { group: 'custom' }
7639
+ * }
7640
+ * });
7641
+ * // Only `controls.someButton` is touched — all other controls remain intact.
7642
+ * ```
7643
+ *
7644
+ * @see {@link ConfigProto} for the prototype-chain variant used at editor creation time
7645
+ */ function ConfigMerge(target, source) {
7646
+ Object.keys(source).forEach((key)=>{
7647
+ const srcVal = source[key];
7648
+ const tgtVal = target[key];
7649
+ if ((0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(srcVal) && (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(tgtVal) && !(0,_extend__WEBPACK_IMPORTED_MODULE_5__.isAtom)(srcVal)) {
7650
+ ConfigMerge(tgtVal, srcVal);
7651
+ } else {
7652
+ target[key] = srcVal;
7653
+ }
7654
+ });
7655
+ }
7656
+ function ConfigDeepFlatten(obj) {
7626
7657
  return (0,_utils__WEBPACK_IMPORTED_MODULE_6__.keys)(obj, false).reduce((app, key)=>{
7627
7658
  app[key] = (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(obj[key]) ? ConfigDeepFlatten(obj[key]) : obj[key];
7628
7659
  return app;
@@ -8207,6 +8238,7 @@ __webpack_require__.r(__webpack_exports__);
8207
8238
  /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_23__.$$; },
8208
8239
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
8209
8240
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
8241
+ /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
8210
8242
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
8211
8243
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
8212
8244
  /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_25__.LimitedStack; },
@@ -16532,6 +16564,51 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_9__.ViewWithToolbar {
16532
16564
  */ static get defaultOptions() {
16533
16565
  return jodit_config__WEBPACK_IMPORTED_MODULE_8__.Config.defaultOptions;
16534
16566
  }
16567
+ /**
16568
+ * Deep-merges partial options into the global defaults without replacing
16569
+ * top-level objects. This lets you patch nested settings (e.g. a single
16570
+ * button inside `controls`) without losing the rest:
16571
+ *
16572
+ * ```js
16573
+ * // Add a custom button — all existing controls remain untouched
16574
+ * Jodit.configure({
16575
+ * controls: {
16576
+ * myButton: {
16577
+ * icon: 'pencil',
16578
+ * command: 'selectall'
16579
+ * }
16580
+ * }
16581
+ * });
16582
+ *
16583
+ * // Override only the `group` of an existing button
16584
+ * Jodit.configure({
16585
+ * controls: {
16586
+ * someButton: { group: 'custom' }
16587
+ * }
16588
+ * });
16589
+ *
16590
+ * // Works with any nested option
16591
+ * Jodit.configure({
16592
+ * createAttributes: {
16593
+ * div: { class: 'my-class' }
16594
+ * }
16595
+ * });
16596
+ *
16597
+ * // Use Jodit.atom() to replace a nested value entirely instead of merging
16598
+ * Jodit.configure({
16599
+ * controls: {
16600
+ * fontsize: {
16601
+ * list: Jodit.atom([8, 9, 10])
16602
+ * }
16603
+ * }
16604
+ * });
16605
+ * ```
16606
+ *
16607
+ * @see {@link ConfigMerge} for the merge algorithm
16608
+ * @see {@link ConfigProto} for per-instance prototype-based merge used at editor creation time
16609
+ */ static configure(options) {
16610
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.ConfigMerge)(Jodit.defaultOptions, options);
16611
+ }
16535
16612
  get createInside() {
16536
16613
  return new jodit_modules__WEBPACK_IMPORTED_MODULE_9__.Create(()=>this.ed, this.o.createAttributes);
16537
16614
  }
@@ -24613,7 +24690,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
24613
24690
  type: 'submit',
24614
24691
  variant: 'primary',
24615
24692
  text: 'Insert'
24616
- }), form = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIForm(editor, [
24693
+ });
24694
+ const form = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIForm(editor, [
24617
24695
  new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIInput(editor, {
24618
24696
  required: true,
24619
24697
  label: 'URL',
@@ -31543,8 +31621,8 @@ class UIImageMainTab extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_
31543
31621
  <div class="jodit-input_group">
31544
31622
  <input class="jodit-input &__imageSrc" type="text"/>
31545
31623
  <div class="jodit-input_group-buttons &__fixImage">
31546
- <a class="jodit-button &__changeImage">*image*</a>
31547
- <a class="jodit-button &__editImage">*crop*</a>
31624
+ <a class="jodit-button &__changeImage" data-ref="changeImage">*image*</a>
31625
+ <a class="jodit-button &__editImage" data-ref="editImage">*crop*</a>
31548
31626
  </div>
31549
31627
  </div>
31550
31628
  </div>
@@ -34061,7 +34139,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
34061
34139
  }
34062
34140
  __generateForm(current, close) {
34063
34141
  const { jodit } = this;
34064
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
34142
+ const i18n = jodit.i18n.bind(jodit);
34143
+ const { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
34065
34144
  const html = formTemplate(jodit);
34066
34145
  const form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(html) ? jodit.c.fromHTML(html, {
34067
34146
  target_checkbox_box: openInNewTabCheckbox,