jodit 4.12.35 → 4.12.37

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 (79) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +110 -49
  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 +109 -47
  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 +109 -47
  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 +259 -195
  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/config.d.ts +14 -6
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/dom/dom.d.ts +35 -12
  53. package/esm/core/dom/dom.js +42 -20
  54. package/esm/core/dom/lazy-walker.d.ts +18 -1
  55. package/esm/core/dom/lazy-walker.js +23 -3
  56. package/esm/core/selection/helpers/index.d.ts +3 -1
  57. package/esm/core/selection/helpers/index.js +3 -1
  58. package/esm/core/selection/selection.d.ts +14 -0
  59. package/esm/core/selection/selection.js +19 -8
  60. package/esm/core/selection/style/api/is-same-attributes.d.ts +4 -2
  61. package/esm/core/selection/style/api/is-same-attributes.js +3 -4
  62. package/esm/core/selection/style/api/is-suit-element.d.ts +2 -1
  63. package/esm/core/selection/style/api/is-suit-element.js +2 -1
  64. package/esm/core/selection/style/api/list/toggle-ordered-list.js +7 -0
  65. package/esm/core/selection/style/api/toggle-attributes.js +3 -1
  66. package/esm/core/selection/style/commit-style.d.ts +1 -1
  67. package/esm/core/selection/style/commit-style.js +2 -2
  68. package/esm/plugins/source/config.d.ts +14 -6
  69. package/esm/plugins/source/editor/engines/ace.js +5 -0
  70. package/package.json +1 -1
  71. package/types/config.d.ts +14 -6
  72. package/types/core/dom/dom.d.ts +35 -12
  73. package/types/core/dom/lazy-walker.d.ts +18 -1
  74. package/types/core/selection/helpers/index.d.ts +3 -1
  75. package/types/core/selection/selection.d.ts +14 -0
  76. package/types/core/selection/style/api/is-same-attributes.d.ts +4 -2
  77. package/types/core/selection/style/api/is-suit-element.d.ts +2 -1
  78. package/types/core/selection/style/commit-style.d.ts +1 -1
  79. package/types/plugins/source/config.d.ts +14 -6
package/CHANGELOG.md CHANGED
@@ -9,6 +9,34 @@
9
9
  > - :house: [Internal]
10
10
  > - :nail_care: [Polish]
11
11
 
12
+ ## 4.12.37
13
+
14
+ #### :bug: Bug Fix
15
+
16
+ - **Source mode / ACE options**: only a fixed set of `sourceEditorNativeOptions` (`theme`, `mode`, `wrap`, `showGutter`, `highlightActiveLine`) was applied to the ACE editor — any other native option, such as `fontSize`, `tabSize` or `useSoftTabs`, was silently dropped, so `sourceEditorNativeOptions: { fontSize: '30px' }` had no effect. The whole options object is now forwarded to ACE's `editor.setOptions()`, and the type accepts arbitrary native keys. Fixes [#1285](https://github.com/xdan/jodit/issues/1285).
17
+
18
+ ## 4.12.36
19
+
20
+ #### :bug: Bug Fix
21
+
22
+ - **Lists / `enter: 'br'` mode**: converting a list type (`ul ↔ ol`, or applying a class/style that forces the REPLACE path) destroyed the list — `unwrapList` extracted the `li` content into a `DocumentFragment` that was dissolved on insertion, so `wrapList` received an empty detached node and the new `<ol>`/`<ul>` was never inserted into the document; the content was left as bare inline nodes. In the REPLACE path the `li` now stays in the document and is re-wrapped directly.
23
+ - **commitStyle / attributes**: a `number`/`boolean` attribute value (e.g. `commitStyle({ element: 'a', attributes: { tabindex: 2 } })`) could never be toggled off — the `attr()` getter returns a string, so the strict comparison against the raw value always failed and every re-apply took the CHANGE branch instead of UNSET. The value is normalized to a string before comparison now.
24
+ - **Selection**: `cursorInTheEdge()` (and its `cursorOnTheLeft`/`cursorOnTheRight` wrappers) threw `IndexSizeError` when the document had no selection ranges — `getRangeAt(0)` was called without checking `rangeCount`. It returns `null` now, as documented.
25
+ - **Selection**: `eachSelection()` threw `TypeError` when the selection root was an empty editor (`childNodes[-1]` produced an `undefined` start node).
26
+ - **Dom.isFragment**: fragments belonging to an inert document (`template.content`, `DOMParser` output) were not recognized because of a stale `defaultView` requirement — same class of problem already fixed for `Dom.isElement` earlier.
27
+ - **Dom.between**: when `end` was an ancestor of `start`, the ascent skipped over it and the callback kept firing for nodes far outside the intended range, up to the end of the tree.
28
+ - **Dom.replaceTemporaryFromString**: the regular expression hardcoded the `data-jodit-temp` attribute name instead of using the `TEMP_ATTR` constant and did not match a temporary element whose marker attribute has no value (`<span data-jodit-temp>`).
29
+ - **LazyWalker**: stopping a walk did not really cancel it — `stop()` called `cancelIdleCallback` with an id that was never assigned (dead code left from the pre-`scheduler.postTask` implementation) and the scheduler's `AbortController` was never aborted. Also, `setWork()` called before the first chunk had started did not cancel the previously scheduled pass. Repeated `setWork()` calls (the `clean-html` plugin does this on every change) piled up concurrent loops pumping the same generator, defeating the chunked-walk throttling. The pending task is now aborted in `stop()`.
30
+ - **LazyWalker**: the `affect` flag was not reset when a pass was interrupted via `break()`, so the next pass reported `end(affect = true)` even if it had not changed anything (a false `synchronizeValues` trigger for `clean-html`). It also processed `timeoutChunkSize + 1` nodes per chunk instead of the configured size.
31
+
32
+ #### :house: Internal
33
+
34
+ - **Dom**: the `Dom.replace(elm, 'p')` overload without a `create` instance is removed from the type surface — it always failed at runtime on an assertion (`Need create instance for new tag`); `create` is now required whenever the replacement is defined by a tag name or an HTML string. `Dom.isList` is honestly typed as `HTMLUListElement | HTMLOListElement`, `Dom.isComment` accepts `Nullable<Node>`, `isSameAttributes` no longer pretends to be a type predicate, `CommitStyle.isApplied` returns a real boolean.
35
+ - **Dom**: `nextGen` builds its sibling stack with `push` + `reverse` instead of `unshift` in a loop (was O(n²) on wide sibling lists); `isTag` computes the upper-case tag name lazily; the temporary-element regexp is compiled once at the module level.
36
+ - **Docs**: fixed the misleading/inverted JSDoc for `Dom.between`, `Dom.up` (root-check asymmetry), `Dom.safeInsertNode`, `LazyWalker` options and events, `cursorInTheEdgeOfString`, `isSuitElement` (`strictStyle` description was inverted), the `LazyWalker` example in the DOM module README (options object, not a number), and the `Dom.replace` example (missing `create` argument).
37
+ - **Tests**: new coverage for `Dom.between`, `Dom.isFragment` (inert documents), `Dom.replace`, `Dom.replaceTemporaryFromString`, wide sibling traversal order in `Dom.find`, `LazyWalker` restart/affect-flag reset, `cursorInTheEdge` without a selection, `eachSelection` on an empty editor, `ul → ol` conversion in `enter: 'br'` mode, and toggling a numeric attribute via `commitStyle`.
38
+ - **Tests / hermetic images**: the resize, image-editor and image-properties karma tests that wait for a real image load no longer fetch `https://xdsoft.net/jodit/files/artio.jpg`/`th.jpg` from the live server — they use the byte-identical `tests/artio.jpg` already served by karma, so a slow or unreachable xdsoft.net can't time these tests out anymore (~17 tests were flaking on degraded networks). The `onLoadImage` test helper now also rejects with a clear `failed to load "<src>"` message on an image `error` event instead of hanging until the mocha timeout.
39
+
12
40
  ## 4.12.35
13
41
 
14
42
  #### :bug: Bug Fix
package/es2015/jodit.css 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.12.35
4
+ * Version: v4.12.37
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */