jodit 4.12.2 → 4.12.4

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 +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +4 -4
  4. package/es2015/jodit.js +69 -11
  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 +50 -8
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  12. package/es2018/jodit.fat.min.js +4 -4
  13. package/es2018/jodit.min.js +24 -24
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +4 -4
  18. package/es2021/jodit.js +69 -11
  19. package/es2021/jodit.min.js +3 -3
  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 +50 -8
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +4 -4
  28. package/es2021.en/jodit.js +69 -11
  29. package/es2021.en/jodit.min.js +3 -3
  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 +50 -8
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +72 -11
  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 +51 -9
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  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 +48 -4
  51. package/esm/config.js +28 -3
  52. package/esm/core/constants.js +1 -1
  53. package/esm/core/ui/icon.d.ts +10 -0
  54. package/esm/core/ui/icon.js +17 -1
  55. package/esm/plugins/speech-recognize/config.js +4 -1
  56. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +3 -2
  57. package/esm/plugins/speech-recognize/helpers/sound.d.ts +8 -1
  58. package/esm/plugins/speech-recognize/helpers/sound.js +45 -8
  59. package/package.json +1 -1
  60. package/types/config.d.ts +48 -4
  61. package/types/core/ui/icon.d.ts +10 -0
  62. package/types/plugins/speech-recognize/helpers/sound.d.ts +8 -1
package/types/config.d.ts CHANGED
@@ -619,18 +619,62 @@ declare class Config implements IViewOptions {
619
619
  */
620
620
  disablePlugins: string[] | string;
621
621
  /**
622
- * Init and download extra plugins
622
+ * Init and download extra plugins that are **not** already bundled/registered.
623
+ *
624
+ * For every name in this list that is not found in the plugin registry, Jodit
625
+ * loads it **at runtime over the network** from:
626
+ *
627
+ * ```text
628
+ * <basePath>plugins/<name>/<name>(.min).js
629
+ * ```
630
+ *
631
+ * (see {@link Config.basePath} and {@link Config.minified}). If the plugin is
632
+ * already registered — e.g. you imported it statically, or you use a bundle
633
+ * that ships it (such as the `jodit-pro` / `jodit-pro-react` "all plugins"
634
+ * build) — it is **skipped** and no request is made; in that case you don't
635
+ * need `extraPlugins` at all, just add the plugin's button.
623
636
  *
624
637
  * ```typescript
625
- * var editor = Jodit.make('.editor', {
638
+ * // Dynamic loading: fetches <basePath>plugins/emoji/emoji.js
639
+ * const editor = Jodit.make('.editor', {
626
640
  * extraPlugins: ['emoji']
627
641
  * });
628
642
  * ```
629
- * It will try load %SCRIPT_PATH%/plugins/emoji/emoji.js and after load will try init it
643
+ *
644
+ * You can also pass an explicit URL to bypass the `basePath` convention:
645
+ *
646
+ * ```typescript
647
+ * const editor = Jodit.make('.editor', {
648
+ * extraPlugins: [{ name: 'emoji', url: 'https://cdn.example.com/emoji.js' }]
649
+ * });
650
+ * ```
651
+ *
652
+ * Note: if you see a request to a malformed URL (e.g. `.../src/main.tsx?t=...plugins/emoji/emoji.js`),
653
+ * it means `basePath` was auto-detected incorrectly under your bundler — set
654
+ * {@link Config.basePath} explicitly. See the Plugin System docs for details.
630
655
  */
631
656
  extraPlugins: Array<string | IExtraPlugin>;
632
657
  /**
633
- * Base path for download extra plugins
658
+ * Base path used to build the URL for dynamically loaded {@link Config.extraPlugins}
659
+ * (and their styles): `<basePath>plugins/<name>/<name>(.min).js`.
660
+ *
661
+ * When not set, Jodit auto-detects it from `document.currentScript`, then the
662
+ * last `<script src>` on the page, then `location.href`. That detection works
663
+ * for classic `<script>` includes, but **fails under ESM bundlers / dev
664
+ * servers** (Vite, Webpack dev, etc.) where there is no script tag for the
665
+ * bundle — it falls back to the entry module URL (e.g. `main.tsx`) and produces
666
+ * a broken plugin URL.
667
+ *
668
+ * Fix: host the plugin files at a public location and point `basePath` there
669
+ * (note the trailing slash):
670
+ *
671
+ * ```typescript
672
+ * const editor = Jodit.make('.editor', {
673
+ * basePath: 'https://your-site.com/jodit-assets/',
674
+ * extraPlugins: ['emoji']
675
+ * // → loads https://your-site.com/jodit-assets/plugins/emoji/emoji.js
676
+ * });
677
+ * ```
634
678
  */
635
679
  basePath?: string;
636
680
  /**
@@ -27,4 +27,14 @@ export declare class Icon {
27
27
  * Make icon html element
28
28
  */
29
29
  static makeIcon(jodit: IViewBased, icon: IUIIconState): CanUndef<Node>;
30
+ /**
31
+ * Turn a raw icon string into an element with a `classList`.
32
+ *
33
+ * A plain-text icon (e.g. an emoji/text glyph) makes `fromHTML` return a
34
+ * Text node, which has no `classList`; wrap it in a span so classes/styles
35
+ * can be applied and `makeIcon` never crashes on `iconElement.classList`.
36
+ * Note: SVG icons are `SVGElement` (not `HTMLElement`) but are still Element
37
+ * nodes with a `classList`, so we check `isElement`, not `isHTMLElement`.
38
+ */
39
+ private static toIconElement;
30
40
  }
@@ -4,11 +4,18 @@
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  /**
7
+ * Play a short beep on the owner's (lazily created, reused) AudioContext.
7
8
  * @internal
8
9
  */
9
- export declare function sound({ sec, frequency, gain, type }?: {
10
+ export declare function sound(owner: object, { sec, frequency, gain, type }?: {
10
11
  sec?: number;
11
12
  frequency?: number;
12
13
  gain?: number;
13
14
  type?: 'sine' | 'square' | 'sawtooth' | 'triangle';
14
15
  }): void;
16
+ /**
17
+ * Close and forget the owner's AudioContext. Call this when the owner is
18
+ * destroyed so the context does not leak.
19
+ * @internal
20
+ */
21
+ export declare function closeSound(owner: object): void;