jodit 4.11.15 → 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 (61) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +84 -5
  5. package/es2015/jodit.min.js +3 -3
  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 +3 -3
  13. package/es2018/jodit.min.js +3 -3
  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 +4 -4
  18. package/es2021/jodit.js +84 -5
  19. package/es2021/jodit.min.js +4 -4
  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 +4 -4
  28. package/es2021.en/jodit.js +84 -5
  29. package/es2021.en/jodit.min.js +5 -5
  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 +87 -5
  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/link/link.js +2 -1
  57. package/esm/typings.d.ts +1 -0
  58. package/package.json +1 -1
  59. package/types/core/helpers/utils/config-proto.d.ts +21 -0
  60. package/types/jodit.d.ts +44 -0
  61. package/types/typings.d.ts +1 -0
package/es2015/jodit.js CHANGED
@@ -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.15
4
+ * Version: v4.12.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1764,7 +1764,7 @@ __webpack_require__.r(__webpack_exports__);
1764
1764
  * ```
1765
1765
  * @packageDocumentation
1766
1766
  * @module constants
1767
- */ const APP_VERSION = "4.11.15";
1767
+ */ const APP_VERSION = "4.12.2";
1768
1768
  // prettier-ignore
1769
1769
  const ES = "es2015";
1770
1770
  const IS_ES_MODERN = true;
@@ -7537,6 +7537,7 @@ const completeUrl = (url)=>{
7537
7537
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7538
7538
  /* harmony export */ ConfigDeepFlatten: function() { return /* binding */ ConfigDeepFlatten; },
7539
7539
  /* harmony export */ ConfigFlatten: function() { return /* binding */ ConfigFlatten; },
7540
+ /* harmony export */ ConfigMerge: function() { return /* binding */ ConfigMerge; },
7540
7541
  /* harmony export */ ConfigProto: function() { return /* binding */ ConfigProto; }
7541
7542
  /* harmony export */ });
7542
7543
  /* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17312);
@@ -7647,7 +7648,37 @@ function ConfigFlatten(obj) {
7647
7648
  * const plain = Jodit.modules.Helpers.ConfigDeepFlatten(editor.o.image);
7648
7649
  * console.log(JSON.stringify(plain)); // {"dialogWidth":500, "openOnDblClick": true, "editSrc": true, ...}
7649
7650
  * ```
7650
- */ function ConfigDeepFlatten(obj) {
7651
+ */ /**
7652
+ * Deep-merges `source` into `target` in-place.
7653
+ * Uses the same merge semantics as {@link ConfigProto}:
7654
+ * - Nested plain objects are merged recursively
7655
+ * - {@link isAtom | Atomic} values replace the target entirely
7656
+ * - Everything else (primitives, arrays, class instances) replaces the target value
7657
+ *
7658
+ * Designed for patching `Config.defaultOptions` without losing existing keys:
7659
+ *
7660
+ * ```js
7661
+ * Jodit.configure({
7662
+ * controls: {
7663
+ * someButton: { group: 'custom' }
7664
+ * }
7665
+ * });
7666
+ * // Only `controls.someButton` is touched — all other controls remain intact.
7667
+ * ```
7668
+ *
7669
+ * @see {@link ConfigProto} for the prototype-chain variant used at editor creation time
7670
+ */ function ConfigMerge(target, source) {
7671
+ Object.keys(source).forEach((key)=>{
7672
+ const srcVal = source[key];
7673
+ const tgtVal = target[key];
7674
+ 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)) {
7675
+ ConfigMerge(tgtVal, srcVal);
7676
+ } else {
7677
+ target[key] = srcVal;
7678
+ }
7679
+ });
7680
+ }
7681
+ function ConfigDeepFlatten(obj) {
7651
7682
  return (0,_utils__WEBPACK_IMPORTED_MODULE_6__.keys)(obj, false).reduce((app, key)=>{
7652
7683
  app[key] = (0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(obj[key]) ? ConfigDeepFlatten(obj[key]) : obj[key];
7653
7684
  return app;
@@ -8233,6 +8264,7 @@ __webpack_require__.r(__webpack_exports__);
8233
8264
  /* harmony export */ $$: function() { return /* reexport safe */ _selector__WEBPACK_IMPORTED_MODULE_23__.$$; },
8234
8265
  /* harmony export */ ConfigDeepFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigDeepFlatten; },
8235
8266
  /* harmony export */ ConfigFlatten: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigFlatten; },
8267
+ /* harmony export */ ConfigMerge: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigMerge; },
8236
8268
  /* harmony export */ ConfigProto: function() { return /* reexport safe */ _config_proto__WEBPACK_IMPORTED_MODULE_7__.ConfigProto; },
8237
8269
  /* harmony export */ ConnectionError: function() { return /* reexport safe */ _error__WEBPACK_IMPORTED_MODULE_13__.ConnectionError; },
8238
8270
  /* harmony export */ LimitedStack: function() { return /* reexport safe */ _stack__WEBPACK_IMPORTED_MODULE_25__.LimitedStack; },
@@ -16662,6 +16694,51 @@ class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE_10__.ViewWithToolbar
16662
16694
  */ static get defaultOptions() {
16663
16695
  return jodit_config__WEBPACK_IMPORTED_MODULE_9__.Config.defaultOptions;
16664
16696
  }
16697
+ /**
16698
+ * Deep-merges partial options into the global defaults without replacing
16699
+ * top-level objects. This lets you patch nested settings (e.g. a single
16700
+ * button inside `controls`) without losing the rest:
16701
+ *
16702
+ * ```js
16703
+ * // Add a custom button — all existing controls remain untouched
16704
+ * Jodit.configure({
16705
+ * controls: {
16706
+ * myButton: {
16707
+ * icon: 'pencil',
16708
+ * command: 'selectall'
16709
+ * }
16710
+ * }
16711
+ * });
16712
+ *
16713
+ * // Override only the `group` of an existing button
16714
+ * Jodit.configure({
16715
+ * controls: {
16716
+ * someButton: { group: 'custom' }
16717
+ * }
16718
+ * });
16719
+ *
16720
+ * // Works with any nested option
16721
+ * Jodit.configure({
16722
+ * createAttributes: {
16723
+ * div: { class: 'my-class' }
16724
+ * }
16725
+ * });
16726
+ *
16727
+ * // Use Jodit.atom() to replace a nested value entirely instead of merging
16728
+ * Jodit.configure({
16729
+ * controls: {
16730
+ * fontsize: {
16731
+ * list: Jodit.atom([8, 9, 10])
16732
+ * }
16733
+ * }
16734
+ * });
16735
+ * ```
16736
+ *
16737
+ * @see {@link ConfigMerge} for the merge algorithm
16738
+ * @see {@link ConfigProto} for per-instance prototype-based merge used at editor creation time
16739
+ */ static configure(options) {
16740
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.ConfigMerge)(Jodit.defaultOptions, options);
16741
+ }
16665
16742
  get createInside() {
16666
16743
  return new jodit_modules__WEBPACK_IMPORTED_MODULE_10__.Create(()=>this.ed, this.o.createAttributes);
16667
16744
  }
@@ -24817,7 +24894,8 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
24817
24894
  type: 'submit',
24818
24895
  variant: 'primary',
24819
24896
  text: 'Insert'
24820
- }), form = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIForm(editor, [
24897
+ });
24898
+ const form = new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIForm(editor, [
24821
24899
  new jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.UIInput(editor, {
24822
24900
  required: true,
24823
24901
  label: 'URL',
@@ -35058,7 +35136,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
35058
35136
  }
35059
35137
  __generateForm(current, close) {
35060
35138
  const { jodit } = this;
35061
- const i18n = jodit.i18n.bind(jodit), { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
35139
+ const i18n = jodit.i18n.bind(jodit);
35140
+ const { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
35062
35141
  const html = formTemplate(jodit);
35063
35142
  const form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(html) ? jodit.c.fromHTML(html, {
35064
35143
  target_checkbox_box: openInNewTabCheckbox,