jodit 4.12.2 → 4.12.3
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.
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +69 -11
- package/es2015/jodit.min.js +3 -3
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +3 -3
- package/es2018/jodit.min.js +24 -24
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +3 -3
- package/es2021/jodit.js +69 -11
- package/es2021/jodit.min.js +3 -3
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +3 -3
- package/es2021.en/jodit.js +69 -11
- package/es2021.en/jodit.min.js +3 -3
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +72 -11
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +48 -4
- package/esm/config.js +28 -3
- package/esm/core/constants.js +1 -1
- package/esm/core/ui/icon.d.ts +10 -0
- package/esm/core/ui/icon.js +17 -1
- package/package.json +1 -1
- package/types/config.d.ts +48 -4
- package/types/core/ui/icon.d.ts +10 -0
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/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
|
-
*
|
|
638
|
+
* // Dynamic loading: fetches <basePath>plugins/emoji/emoji.js
|
|
639
|
+
* const editor = Jodit.make('.editor', {
|
|
626
640
|
* extraPlugins: ['emoji']
|
|
627
641
|
* });
|
|
628
642
|
* ```
|
|
629
|
-
*
|
|
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
|
|
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
|
/**
|
package/esm/config.js
CHANGED
|
@@ -729,14 +729,39 @@ class Config {
|
|
|
729
729
|
*/
|
|
730
730
|
this.disablePlugins = [];
|
|
731
731
|
/**
|
|
732
|
-
* Init and download extra plugins
|
|
732
|
+
* Init and download extra plugins that are **not** already bundled/registered.
|
|
733
|
+
*
|
|
734
|
+
* For every name in this list that is not found in the plugin registry, Jodit
|
|
735
|
+
* loads it **at runtime over the network** from:
|
|
736
|
+
*
|
|
737
|
+
* ```text
|
|
738
|
+
* <basePath>plugins/<name>/<name>(.min).js
|
|
739
|
+
* ```
|
|
740
|
+
*
|
|
741
|
+
* (see {@link Config.basePath} and {@link Config.minified}). If the plugin is
|
|
742
|
+
* already registered — e.g. you imported it statically, or you use a bundle
|
|
743
|
+
* that ships it (such as the `jodit-pro` / `jodit-pro-react` "all plugins"
|
|
744
|
+
* build) — it is **skipped** and no request is made; in that case you don't
|
|
745
|
+
* need `extraPlugins` at all, just add the plugin's button.
|
|
733
746
|
*
|
|
734
747
|
* ```typescript
|
|
735
|
-
*
|
|
748
|
+
* // Dynamic loading: fetches <basePath>plugins/emoji/emoji.js
|
|
749
|
+
* const editor = Jodit.make('.editor', {
|
|
736
750
|
* extraPlugins: ['emoji']
|
|
737
751
|
* });
|
|
738
752
|
* ```
|
|
739
|
-
*
|
|
753
|
+
*
|
|
754
|
+
* You can also pass an explicit URL to bypass the `basePath` convention:
|
|
755
|
+
*
|
|
756
|
+
* ```typescript
|
|
757
|
+
* const editor = Jodit.make('.editor', {
|
|
758
|
+
* extraPlugins: [{ name: 'emoji', url: 'https://cdn.example.com/emoji.js' }]
|
|
759
|
+
* });
|
|
760
|
+
* ```
|
|
761
|
+
*
|
|
762
|
+
* Note: if you see a request to a malformed URL (e.g. `.../src/main.tsx?t=...plugins/emoji/emoji.js`),
|
|
763
|
+
* it means `basePath` was auto-detected incorrectly under your bundler — set
|
|
764
|
+
* {@link Config.basePath} explicitly. See the Plugin System docs for details.
|
|
740
765
|
*/
|
|
741
766
|
this.extraPlugins = [];
|
|
742
767
|
/**
|
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.12.
|
|
6
|
+
export const APP_VERSION = "4.12.3";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
package/esm/core/ui/icon.d.ts
CHANGED
|
@@ -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
|
}
|
package/esm/core/ui/icon.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import { IS_PROD } from "../constants.js";
|
|
7
|
+
import { Dom } from "../dom/dom.js";
|
|
7
8
|
import { camelCase, kebabCase } from "../helpers/index.js";
|
|
8
9
|
import { css } from "../helpers/utils/css.js";
|
|
9
10
|
export class Icon {
|
|
@@ -71,7 +72,7 @@ export class Icon {
|
|
|
71
72
|
Icon.get(name, '') ||
|
|
72
73
|
((_d = jodit.o.extraIcons) === null || _d === void 0 ? void 0 : _d[name]);
|
|
73
74
|
if (svg) {
|
|
74
|
-
iconElement =
|
|
75
|
+
iconElement = Icon.toIconElement(jodit, svg.trim());
|
|
75
76
|
if (!/^<svg/i.test(name)) {
|
|
76
77
|
iconElement.classList.add('jodit-icon_' + clearName);
|
|
77
78
|
}
|
|
@@ -88,6 +89,21 @@ export class Icon {
|
|
|
88
89
|
}
|
|
89
90
|
return iconElement;
|
|
90
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Turn a raw icon string into an element with a `classList`.
|
|
94
|
+
*
|
|
95
|
+
* A plain-text icon (e.g. an emoji/text glyph) makes `fromHTML` return a
|
|
96
|
+
* Text node, which has no `classList`; wrap it in a span so classes/styles
|
|
97
|
+
* can be applied and `makeIcon` never crashes on `iconElement.classList`.
|
|
98
|
+
* Note: SVG icons are `SVGElement` (not `HTMLElement`) but are still Element
|
|
99
|
+
* nodes with a `classList`, so we check `isElement`, not `isHTMLElement`.
|
|
100
|
+
*/
|
|
101
|
+
static toIconElement(jodit, svg) {
|
|
102
|
+
const node = jodit.c.fromHTML(svg);
|
|
103
|
+
return Dom.isElement(node)
|
|
104
|
+
? node
|
|
105
|
+
: jodit.c.span('jodit-icon_text', node);
|
|
106
|
+
}
|
|
91
107
|
}
|
|
92
108
|
Icon.icons = {};
|
|
93
109
|
Icon.__cache = new Map();
|
package/package.json
CHANGED
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
|
-
*
|
|
638
|
+
* // Dynamic loading: fetches <basePath>plugins/emoji/emoji.js
|
|
639
|
+
* const editor = Jodit.make('.editor', {
|
|
626
640
|
* extraPlugins: ['emoji']
|
|
627
641
|
* });
|
|
628
642
|
* ```
|
|
629
|
-
*
|
|
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
|
|
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
|
/**
|
package/types/core/ui/icon.d.ts
CHANGED
|
@@ -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
|
}
|