jodit 4.8.9 → 4.9.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.
- package/CHANGELOG.md +44 -0
- package/es2015/jodit.css +1663 -1663
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +14 -14
- package/es2015/jodit.js +496 -381
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +14 -14
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +25 -25
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +14 -14
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1663 -1663
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +19 -19
- package/es2021/jodit.js +496 -381
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +19 -19
- 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 +1663 -1663
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +19 -19
- package/es2021.en/jodit.js +496 -381
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +29 -29
- 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 +2009 -2009
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +506 -390
- package/es5/jodit.min.css +3 -3
- 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/core/constants.js +1 -1
- package/esm/core/decorators/component/component.d.ts +4 -3
- package/esm/core/decorators/component/component.js +11 -0
- package/esm/core/decorators/watch/watch.d.ts +1 -2
- package/esm/core/decorators/watch/watch.js +1 -8
- package/esm/core/dom/dom.d.ts +5 -0
- package/esm/core/dom/dom.js +24 -5
- package/esm/core/dom/lazy-walker.js +1 -1
- package/esm/core/event-emitter/global.d.ts +2 -0
- package/esm/core/event-emitter/global.js +2 -0
- package/esm/core/event-emitter/observable.js +1 -1
- package/esm/core/global.d.ts +2 -2
- package/esm/core/global.js +7 -4
- package/esm/core/helpers/checker/is-marker.d.ts +1 -0
- package/esm/core/helpers/checker/is-marker.js +2 -4
- package/esm/core/helpers/utils/attr.js +3 -1
- package/esm/core/helpers/utils/error/errors/abort-error.d.ts +0 -5
- package/esm/core/helpers/utils/error/errors/abort-error.js +0 -8
- package/esm/core/helpers/utils/selector.js +2 -1
- package/esm/core/helpers/utils/utils.d.ts +2 -1
- package/esm/core/helpers/utils/utils.js +8 -0
- package/esm/core/plugin/helpers/init-instance.d.ts +2 -2
- package/esm/core/plugin/helpers/init-instance.js +2 -3
- package/esm/core/plugin/plugin-system.d.ts +5 -1
- package/esm/core/plugin/plugin-system.js +8 -5
- package/esm/core/selection/style/api/list/wrap-list.js +3 -2
- package/esm/core/selection/style/transactions.js +1 -1
- package/esm/core/ui/button/button/button.js +6 -3
- package/esm/core/ui/element.d.ts +2 -3
- package/esm/core/ui/group/list.d.ts +0 -1
- package/esm/core/ui/group/list.js +8 -6
- package/esm/modules/file-browser/builders/context-menu.js +3 -2
- package/esm/modules/file-browser/builders/utils.d.ts +12 -0
- package/esm/modules/file-browser/builders/utils.js +12 -0
- package/esm/modules/file-browser/listeners/native-listeners.d.ts +1 -12
- package/esm/modules/file-browser/listeners/native-listeners.js +3 -13
- package/esm/modules/history/command.d.ts +2 -3
- package/esm/modules/history/history.d.ts +1 -1
- package/esm/modules/history/history.js +2 -2
- package/esm/modules/toolbar/button/button.d.ts +0 -5
- package/esm/modules/toolbar/button/button.js +21 -11
- package/esm/modules/toolbar/collection/collection.d.ts +1 -2
- package/esm/modules/toolbar/collection/collection.js +6 -3
- package/esm/modules/toolbar/factory.js +8 -6
- package/esm/plugins/about/about.js +2 -2
- package/package.json +1 -1
- package/types/core/decorators/component/component.d.ts +4 -3
- package/types/core/decorators/watch/watch.d.ts +1 -2
- package/types/core/dom/dom.d.ts +5 -0
- package/types/core/event-emitter/global.d.ts +2 -0
- package/types/core/global.d.ts +2 -2
- package/types/core/helpers/checker/is-marker.d.ts +1 -0
- package/types/core/helpers/utils/error/errors/abort-error.d.ts +0 -5
- package/types/core/helpers/utils/utils.d.ts +2 -1
- package/types/core/plugin/helpers/init-instance.d.ts +2 -2
- package/types/core/plugin/plugin-system.d.ts +5 -1
- package/types/core/ui/element.d.ts +2 -3
- package/types/core/ui/group/list.d.ts +0 -1
- package/types/modules/file-browser/builders/utils.d.ts +12 -0
- package/types/modules/file-browser/listeners/native-listeners.d.ts +1 -12
- package/types/modules/history/command.d.ts +2 -3
- package/types/modules/history/history.d.ts +1 -1
- package/types/modules/toolbar/button/button.d.ts +0 -5
- package/types/modules/toolbar/collection/collection.d.ts +1 -2
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
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.
|
|
6
|
+
export const APP_VERSION = "4.9.4";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -3,17 +3,18 @@
|
|
|
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
|
+
import type { IComponent } from "../../../types/index";
|
|
6
7
|
/**
|
|
7
8
|
* [[include:core/decorators/component/README.md]]
|
|
8
9
|
* @packageDocumentation
|
|
9
10
|
* @module decorators/component
|
|
10
11
|
*/
|
|
11
|
-
interface ComponentCompatible {
|
|
12
|
-
new (...constructorArgs: any[]):
|
|
12
|
+
export interface ComponentCompatible<T = IComponent> {
|
|
13
|
+
new (...constructorArgs: any[]): T;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Decorate components and set status isReady after constructor
|
|
16
17
|
* @param constructorFunction - Component constructor class
|
|
17
18
|
*/
|
|
18
19
|
export declare function component<T extends ComponentCompatible>(constructorFunction: T): T;
|
|
19
|
-
export
|
|
20
|
+
export declare function getComponentClass<T extends IComponent>(name: string): ComponentCompatible<T>;
|
|
@@ -3,6 +3,9 @@
|
|
|
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
|
+
import { IS_PROD } from "../../constants.js";
|
|
7
|
+
import { getClassName } from "../../helpers/utils/get-class-name.js";
|
|
8
|
+
const componentRegistry = new Map();
|
|
6
9
|
/**
|
|
7
10
|
* Decorate components and set status isReady after constructor
|
|
8
11
|
* @param constructorFunction - Component constructor class
|
|
@@ -23,5 +26,13 @@ export function component(constructorFunction) {
|
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
}
|
|
29
|
+
const name = getClassName(constructorFunction.prototype);
|
|
30
|
+
if (componentRegistry.has(name) && !IS_PROD) {
|
|
31
|
+
throw new Error(`Component with name "${name}" is already registered`);
|
|
32
|
+
}
|
|
33
|
+
componentRegistry.set(name, newConstructorFunction);
|
|
26
34
|
return newConstructorFunction;
|
|
27
35
|
}
|
|
36
|
+
export function getComponentClass(name) {
|
|
37
|
+
return componentRegistry.get(name);
|
|
38
|
+
}
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module decorators/watch
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
12
|
-
export declare function getPropertyDescriptor(obj: unknown, prop: string): CanUndef<PropertyDescriptor>;
|
|
11
|
+
import type { DecoratorHandler, IDictionary } from "../../../types/index";
|
|
13
12
|
/**
|
|
14
13
|
* Watch decorator. Added observer for some change in field value
|
|
15
14
|
*/
|
|
@@ -10,14 +10,7 @@ import { isFunction } from "../../helpers/checker/is-function.js";
|
|
|
10
10
|
import { isPlainObject } from "../../helpers/checker/is-plain-object.js";
|
|
11
11
|
import { isViewObject } from "../../helpers/checker/is-view-object.js";
|
|
12
12
|
import { error } from "../../helpers/utils/error/index.js";
|
|
13
|
-
|
|
14
|
-
let desc;
|
|
15
|
-
do {
|
|
16
|
-
desc = Object.getOwnPropertyDescriptor(obj, prop);
|
|
17
|
-
obj = Object.getPrototypeOf(obj);
|
|
18
|
-
} while (!desc && obj);
|
|
19
|
-
return desc;
|
|
20
|
-
}
|
|
13
|
+
import { getPropertyDescriptor } from "../../helpers/utils/utils.js";
|
|
21
14
|
/**
|
|
22
15
|
* Watch decorator. Added observer for some change in field value
|
|
23
16
|
*/
|
package/esm/core/dom/dom.d.ts
CHANGED
|
@@ -249,12 +249,17 @@ export declare class Dom {
|
|
|
249
249
|
* Check if element is temporary
|
|
250
250
|
*/
|
|
251
251
|
static isTemporary(element: unknown): boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Define element is selection helper
|
|
254
|
+
*/
|
|
255
|
+
static isMarker(elm: Nullable<Node>): elm is HTMLElement;
|
|
252
256
|
/**
|
|
253
257
|
* Replace temporary elements from string
|
|
254
258
|
*/
|
|
255
259
|
static replaceTemporaryFromString(value: string): string;
|
|
256
260
|
/**
|
|
257
261
|
* Get temporary list
|
|
262
|
+
* @deprecated
|
|
258
263
|
*/
|
|
259
264
|
static temporaryList(root: HTMLElement): HTMLElement[];
|
|
260
265
|
}
|
package/esm/core/dom/dom.js
CHANGED
|
@@ -4,11 +4,21 @@
|
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import * as consts from "../constants.js";
|
|
7
|
-
import { globalDocument, INSEPARABLE_TAGS, LIST_TAGS, NO_EMPTY_TAGS, TEMP_ATTR } from "../constants.js";
|
|
7
|
+
import { globalDocument, INSEPARABLE_TAGS, LIST_TAGS, MARKER_CLASS, NO_EMPTY_TAGS, TEMP_ATTR } from "../constants.js";
|
|
8
8
|
import { toArray } from "../helpers/array/to-array.js";
|
|
9
|
-
import { isArray
|
|
9
|
+
import { isArray } from "../helpers/checker/is-array.js";
|
|
10
|
+
import { isFunction } from "../helpers/checker/is-function.js";
|
|
11
|
+
import { isHTML } from "../helpers/checker/is-html.js";
|
|
12
|
+
import { isSet } from "../helpers/checker/is-set.js";
|
|
13
|
+
import { isString } from "../helpers/checker/is-string.js";
|
|
14
|
+
import { isVoid } from "../helpers/checker/is-void.js";
|
|
10
15
|
import { trim } from "../helpers/string/trim.js";
|
|
11
|
-
import {
|
|
16
|
+
import { assert } from "../helpers/utils/assert.js";
|
|
17
|
+
import { attr } from "../helpers/utils/attr.js";
|
|
18
|
+
import { css } from "../helpers/utils/css.js";
|
|
19
|
+
import { dataBind } from "../helpers/utils/data-bind.js";
|
|
20
|
+
import { error } from "../helpers/utils/error/index.js";
|
|
21
|
+
import { call } from "../helpers/utils/utils.js";
|
|
12
22
|
/**
|
|
13
23
|
* Module for working with DOM
|
|
14
24
|
*/
|
|
@@ -722,7 +732,15 @@ export class Dom {
|
|
|
722
732
|
if (!Dom.isElement(element)) {
|
|
723
733
|
return false;
|
|
724
734
|
}
|
|
725
|
-
return isMarker(element) || attr(element, TEMP_ATTR) === 'true';
|
|
735
|
+
return Dom.isMarker(element) || attr(element, TEMP_ATTR) === 'true';
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Define element is selection helper
|
|
739
|
+
*/
|
|
740
|
+
static isMarker(elm) {
|
|
741
|
+
return (Dom.isNode(elm) &&
|
|
742
|
+
Dom.isTag(elm, 'span') &&
|
|
743
|
+
elm.hasAttribute('data-' + MARKER_CLASS));
|
|
726
744
|
}
|
|
727
745
|
/**
|
|
728
746
|
* Replace temporary elements from string
|
|
@@ -732,8 +750,9 @@ export class Dom {
|
|
|
732
750
|
}
|
|
733
751
|
/**
|
|
734
752
|
* Get temporary list
|
|
753
|
+
* @deprecated
|
|
735
754
|
*/
|
|
736
755
|
static temporaryList(root) {
|
|
737
|
-
return
|
|
756
|
+
return toArray(root.querySelectorAll(`[${TEMP_ATTR}]`));
|
|
738
757
|
}
|
|
739
758
|
}
|
|
@@ -13,7 +13,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
|
-
import { autobind } from "../decorators/
|
|
16
|
+
import { autobind } from "../decorators/autobind/autobind.js";
|
|
17
17
|
import { Dom } from "./dom.js";
|
|
18
18
|
import { Eventify } from "../event-emitter/eventify.js";
|
|
19
19
|
export class LazyWalker extends Eventify {
|
|
@@ -3,10 +3,10 @@
|
|
|
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
|
-
import { getPropertyDescriptor } from "../decorators/watch/watch.js";
|
|
7
6
|
import { isArray } from "../helpers/checker/is-array.js";
|
|
8
7
|
import { isFastEqual } from "../helpers/checker/is-equal.js";
|
|
9
8
|
import { isPlainObject } from "../helpers/checker/is-plain-object.js";
|
|
9
|
+
import { getPropertyDescriptor } from "../helpers/utils/utils.js";
|
|
10
10
|
const OBSERVABLE_OBJECT = Symbol('observable-object');
|
|
11
11
|
function isObservableObject(obj) {
|
|
12
12
|
return obj[OBSERVABLE_OBJECT] !== undefined;
|
package/esm/core/global.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { HTMLTagNames, IDictionary, IJodit, IViewBased, IViewComponent, IViewOptions } from "../types/index";
|
|
10
10
|
import { PluginSystem } from "./plugin/plugin-system";
|
|
11
|
-
import { EventEmitter } from "./event-emitter/index";
|
|
12
11
|
export declare const instances: IDictionary<IJodit>;
|
|
13
12
|
/**
|
|
14
13
|
* Generate global unique uid
|
|
@@ -28,5 +27,6 @@ export declare function getContainer<T extends HTMLTagNames = HTMLTagNames>(jodi
|
|
|
28
27
|
export declare function getPopupViewRoot(o: IViewOptions, container: HTMLElement, defaultRoot: HTMLElement): HTMLElement;
|
|
29
28
|
/**
|
|
30
29
|
* Global event emitter
|
|
30
|
+
* @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
|
|
31
31
|
*/
|
|
32
|
-
export declare const eventEmitter: EventEmitter;
|
|
32
|
+
export declare const eventEmitter: import("./event-emitter/index").EventEmitter;
|
package/esm/core/global.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
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
|
-
import { css } from "./helpers/index.js";
|
|
7
6
|
import { isJoditObject } from "./helpers/checker/is-jodit-object.js";
|
|
8
7
|
import { isString } from "./helpers/checker/is-string.js";
|
|
9
8
|
import { isViewObject } from "./helpers/checker/is-view-object.js";
|
|
10
9
|
import { kebabCase } from "./helpers/string/kebab-case.js";
|
|
10
|
+
import { css } from "./helpers/utils/css.js";
|
|
11
11
|
import { getClassName } from "./helpers/utils/get-class-name.js";
|
|
12
12
|
import { PluginSystem } from "./plugin/plugin-system.js";
|
|
13
|
+
import { eventEmitter as globalEventEmitter } from "./event-emitter/global.js";
|
|
13
14
|
import { lang } from "./constants.js";
|
|
14
15
|
import { Dom } from "./dom/index.js";
|
|
15
|
-
import { EventEmitter } from "./event-emitter/index.js";
|
|
16
16
|
export const instances = {};
|
|
17
17
|
let counter = 1;
|
|
18
18
|
const uuids = new Set();
|
|
@@ -31,7 +31,9 @@ export function uniqueUid() {
|
|
|
31
31
|
uuids.add(uid);
|
|
32
32
|
return uid;
|
|
33
33
|
}
|
|
34
|
-
export const pluginSystem = new PluginSystem(
|
|
34
|
+
export const pluginSystem = new PluginSystem({
|
|
35
|
+
getContainer
|
|
36
|
+
});
|
|
35
37
|
export const modules = {};
|
|
36
38
|
export const extendLang = (langs) => {
|
|
37
39
|
Object.keys(langs).forEach(key => {
|
|
@@ -102,5 +104,6 @@ export function getPopupViewRoot(o, container, defaultRoot) {
|
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
104
106
|
* Global event emitter
|
|
107
|
+
* @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
|
|
105
108
|
*/
|
|
106
|
-
export const eventEmitter =
|
|
109
|
+
export const eventEmitter = globalEventEmitter;
|
|
@@ -3,13 +3,11 @@
|
|
|
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
|
-
import { MARKER_CLASS } from "../../constants.js";
|
|
7
6
|
import { Dom } from "../../dom/dom.js";
|
|
8
7
|
/**
|
|
9
8
|
* Define element is selection helper
|
|
9
|
+
* @deprecated use Dom.isMarker instead
|
|
10
10
|
*/
|
|
11
11
|
export function isMarker(elm) {
|
|
12
|
-
return
|
|
13
|
-
Dom.isTag(elm, 'span') &&
|
|
14
|
-
elm.hasAttribute('data-' + MARKER_CLASS));
|
|
12
|
+
return Dom.isMarker(elm);
|
|
15
13
|
}
|
|
@@ -3,7 +3,9 @@
|
|
|
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
|
-
import { isFunction
|
|
6
|
+
import { isFunction } from "../checker/is-function.js";
|
|
7
|
+
import { isPlainObject } from "../checker/is-plain-object.js";
|
|
8
|
+
import { isString } from "../checker/is-string.js";
|
|
7
9
|
import { CamelCaseToKebabCase } from "../string/kebab-case.js";
|
|
8
10
|
import { css } from "./css.js";
|
|
9
11
|
/**
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module helpers/utils
|
|
8
8
|
*/
|
|
9
|
-
import { isAbortError } from "../../../checker/is-abort-error";
|
|
10
9
|
/**
|
|
11
10
|
* `AbortError` is not a separate exception, but rather a {@link DOMException} with a special `name`.
|
|
12
11
|
* https://webidl.spec.whatwg.org/#aborterror
|
|
@@ -15,7 +14,3 @@ export type AbortError = DOMException & {
|
|
|
15
14
|
name: 'AbortError';
|
|
16
15
|
};
|
|
17
16
|
export declare function abort(message?: string): Error;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated use `isAbortError` instead
|
|
20
|
-
*/
|
|
21
|
-
export declare const isAbort: typeof isAbortError;
|
|
@@ -3,14 +3,6 @@
|
|
|
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
|
-
/**
|
|
7
|
-
* @module helpers/utils
|
|
8
|
-
*/
|
|
9
|
-
import { isAbortError } from "../../../checker/is-abort-error.js";
|
|
10
6
|
export function abort(message = 'Aborted') {
|
|
11
7
|
return new DOMException(message, 'AbortError');
|
|
12
8
|
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated use `isAbortError` instead
|
|
15
|
-
*/
|
|
16
|
-
export const isAbort = isAbortError;
|
|
@@ -8,7 +8,8 @@ import { Dom } from "../../dom/dom.js";
|
|
|
8
8
|
import { toArray } from "../array/to-array.js";
|
|
9
9
|
import { isString } from "../checker/is-string.js";
|
|
10
10
|
import { camelCase } from "../string/camel-case.js";
|
|
11
|
-
import { attr
|
|
11
|
+
import { attr } from "./attr.js";
|
|
12
|
+
import { error } from "./error/index.js";
|
|
12
13
|
let temp = 1;
|
|
13
14
|
const $$temp = () => {
|
|
14
15
|
temp++;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module helpers/utils
|
|
8
8
|
*/
|
|
9
|
-
import type { CanPromise, IControlType, IJodit, IViewBased, Nullable, RejectablePromise } from "../../../types/index";
|
|
9
|
+
import type { CanPromise, CanUndef, IControlType, IJodit, IViewBased, Nullable, RejectablePromise } from "../../../types/index";
|
|
10
10
|
/**
|
|
11
11
|
* Call function with parameters
|
|
12
12
|
*
|
|
@@ -37,3 +37,4 @@ export declare const memorizeExec: <T extends IJodit = IJodit>(editor: T, _: unk
|
|
|
37
37
|
* Get DataTransfer from different event types
|
|
38
38
|
*/
|
|
39
39
|
export declare const getDataTransfer: (event: ClipboardEvent | DragEvent) => Nullable<DataTransfer>;
|
|
40
|
+
export declare function getPropertyDescriptor(obj: unknown, prop: string): CanUndef<PropertyDescriptor>;
|
|
@@ -97,3 +97,11 @@ export const getDataTransfer = (event) => {
|
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
+
export function getPropertyDescriptor(obj, prop) {
|
|
101
|
+
let desc;
|
|
102
|
+
do {
|
|
103
|
+
desc = Object.getOwnPropertyDescriptor(obj, prop);
|
|
104
|
+
obj = Object.getPrototypeOf(obj);
|
|
105
|
+
} while (!desc && obj);
|
|
106
|
+
return desc;
|
|
107
|
+
}
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugin
|
|
8
8
|
*/
|
|
9
|
-
import type { IJodit, Nullable, PluginInstance, PluginType } from "../../../types/index";
|
|
9
|
+
import type { HTMLTagNames, IJodit, IViewBased, IViewComponent, Nullable, PluginInstance, PluginType } from "../../../types/index";
|
|
10
10
|
/**
|
|
11
11
|
* Init plugin if it has no dependencies, in another case wait requires plugins will be init
|
|
12
12
|
* @private
|
|
13
13
|
*/
|
|
14
|
-
export declare function init(jodit: IJodit, pluginName: string, plugin: PluginType, instance: PluginInstance, doneList: Map<string, Nullable<PluginInstance>>, waitingList: Set<string>): void;
|
|
14
|
+
export declare function init(jodit: IJodit, pluginName: string, plugin: PluginType, instance: PluginInstance, doneList: Map<string, Nullable<PluginInstance>>, waitingList: Set<string>, getContainer: <T extends HTMLTagNames = HTMLTagNames>(jodit: IViewBased | IViewComponent, classFunc?: Function | string, tag?: T, createInsideEditor?: boolean) => HTMLElementTagNameMap[T]): void;
|
|
@@ -4,14 +4,13 @@
|
|
|
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 {
|
|
8
|
-
import { isInitable } from "../../helpers/checker/index.js";
|
|
7
|
+
import { isInitable } from "../../helpers/checker/is-imp-interface.js";
|
|
9
8
|
import { loadStyle } from "./load.js";
|
|
10
9
|
/**
|
|
11
10
|
* Init plugin if it has no dependencies, in another case wait requires plugins will be init
|
|
12
11
|
* @private
|
|
13
12
|
*/
|
|
14
|
-
export function init(jodit, pluginName, plugin, instance, doneList, waitingList) {
|
|
13
|
+
export function init(jodit, pluginName, plugin, instance, doneList, waitingList, getContainer) {
|
|
15
14
|
if (isInitable(instance)) {
|
|
16
15
|
try {
|
|
17
16
|
instance.init(jodit);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugin
|
|
8
8
|
*/
|
|
9
|
-
import type { IJodit, IPluginSystem, PluginType } from "../../types/index";
|
|
9
|
+
import type { HTMLTagNames, IJodit, IPluginSystem, IViewBased, IViewComponent, PluginType } from "../../types/index";
|
|
10
10
|
import "./interface";
|
|
11
11
|
/**
|
|
12
12
|
* Jodit plugin system
|
|
@@ -21,6 +21,10 @@ import "./interface";
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export declare class PluginSystem implements IPluginSystem {
|
|
24
|
+
private readonly opts;
|
|
25
|
+
constructor(opts: {
|
|
26
|
+
getContainer<T extends HTMLTagNames = HTMLTagNames>(jodit: IViewBased | IViewComponent, classFunc?: Function | string, tag?: T, createInsideEditor?: boolean): HTMLElementTagNameMap[T];
|
|
27
|
+
});
|
|
24
28
|
private __items;
|
|
25
29
|
get size(): number;
|
|
26
30
|
/**
|
|
@@ -4,9 +4,11 @@
|
|
|
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 { eventEmitter } from "../global.js";
|
|
8
|
-
import { splitArray } from "../helpers/array/
|
|
9
|
-
import { isArray
|
|
7
|
+
import { eventEmitter } from "../event-emitter/global.js";
|
|
8
|
+
import { splitArray } from "../helpers/array/split-array.js";
|
|
9
|
+
import { isArray } from "../helpers/checker/is-array.js";
|
|
10
|
+
import { isDestructable } from "../helpers/checker/is-imp-interface.js";
|
|
11
|
+
import { isString } from "../helpers/checker/is-string.js";
|
|
10
12
|
import { init } from "./helpers/init-instance.js";
|
|
11
13
|
import { loadExtras } from "./helpers/load.js";
|
|
12
14
|
import { makeInstance } from "./helpers/make-instance.js";
|
|
@@ -25,7 +27,8 @@ import "./interface.js";
|
|
|
25
27
|
* ```
|
|
26
28
|
*/
|
|
27
29
|
export class PluginSystem {
|
|
28
|
-
constructor() {
|
|
30
|
+
constructor(opts) {
|
|
31
|
+
this.opts = opts;
|
|
29
32
|
this.__items = new Map();
|
|
30
33
|
}
|
|
31
34
|
get size() {
|
|
@@ -94,7 +97,7 @@ export class PluginSystem {
|
|
|
94
97
|
waitingList.delete(name);
|
|
95
98
|
return;
|
|
96
99
|
}
|
|
97
|
-
init(jodit, name, plugin, instance, doneList, waitingList);
|
|
100
|
+
init(jodit, name, plugin, instance, doneList, waitingList, this.opts.getContainer);
|
|
98
101
|
pluginsMap[name] = instance;
|
|
99
102
|
});
|
|
100
103
|
if (commit) {
|
|
@@ -3,8 +3,9 @@
|
|
|
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
|
-
import { Dom } from "../../../../dom/
|
|
7
|
-
import { elementsEqualAttributes, isSameAttributes
|
|
6
|
+
import { Dom } from "../../../../dom/dom.js";
|
|
7
|
+
import { elementsEqualAttributes, isSameAttributes } from "../is-same-attributes.js";
|
|
8
|
+
import { toggleAttributes } from "../toggle-attributes.js";
|
|
8
9
|
import { _PREFIX, INITIAL, REPLACE, WRAP } from "../../constants.js";
|
|
9
10
|
/**
|
|
10
11
|
* Replaces non-leaf items with leaf items and either creates a new list or
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
import { LIST_TAGS } from "../../constants.js";
|
|
7
7
|
import { Dom } from "../../dom/dom.js";
|
|
8
8
|
import { assert } from "../../helpers/utils/assert.js";
|
|
9
|
-
import { INITIAL, REPLACE, UNSET, UNWRAP, WRAP } from "../index.js";
|
|
10
9
|
import { extractSelectedPart, getSuitChild, getSuitParent, isInsideInvisibleElement, suitableClosest, toggleAttributes, toggleOrderedList, unwrapChildren, wrap } from "./api/index.js";
|
|
10
|
+
import { INITIAL, REPLACE, UNSET, UNWRAP, WRAP } from "./constants.js";
|
|
11
11
|
export const states = {
|
|
12
12
|
START: 'START',
|
|
13
13
|
ELEMENT: 'ELEMENT',
|
|
@@ -14,13 +14,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
16
|
import { STATUSES } from "../../../component/statuses.js";
|
|
17
|
-
import { cache, cacheHTML
|
|
17
|
+
import { cache, cacheHTML } from "../../../decorators/cache/cache.js";
|
|
18
|
+
import { component, getComponentClass } from "../../../decorators/component/component.js";
|
|
19
|
+
import { watch } from "../../../decorators/watch/watch.js";
|
|
18
20
|
import { Dom } from "../../../dom/dom.js";
|
|
19
21
|
import { isFunction } from "../../../helpers/checker/is-function.js";
|
|
20
22
|
import { isString } from "../../../helpers/checker/is-string.js";
|
|
21
|
-
import { assert
|
|
23
|
+
import { assert } from "../../../helpers/utils/assert.js";
|
|
24
|
+
import { attr } from "../../../helpers/utils/attr.js";
|
|
22
25
|
import { UIElement } from "../../element.js";
|
|
23
|
-
import { UIList } from "../../group/list.js";
|
|
24
26
|
import { Icon } from "../../icon.js";
|
|
25
27
|
export const UIButtonState = () => ({
|
|
26
28
|
size: 'middle',
|
|
@@ -81,6 +83,7 @@ let UIButton = class UIButton extends UIElement {
|
|
|
81
83
|
* Set size from a parent list
|
|
82
84
|
*/
|
|
83
85
|
updateSize() {
|
|
86
|
+
const UIList = getComponentClass('UIList');
|
|
84
87
|
const pe = this.closest(UIList);
|
|
85
88
|
if (pe) {
|
|
86
89
|
this.state.size = pe.buttonSize;
|
package/esm/core/ui/element.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module ui
|
|
8
8
|
*/
|
|
9
9
|
import type { IDictionary, IUIElement, IViewBased, Nullable } from "../../types/index";
|
|
10
|
+
import type { ComponentCompatible } from "../decorators/component/component";
|
|
10
11
|
import { ViewComponent } from "../component/index";
|
|
11
12
|
import { Elms } from "../traits/elms";
|
|
12
13
|
import { Mods } from "../traits/mods";
|
|
@@ -22,9 +23,7 @@ export declare abstract class UIElement<T extends IViewBased = IViewBased> exten
|
|
|
22
23
|
updateParentElement(target: IUIElement): this;
|
|
23
24
|
/** @override */
|
|
24
25
|
get<T>(chain: string, obj?: IDictionary): Nullable<T>;
|
|
25
|
-
|
|
26
|
-
* Find match parent
|
|
27
|
-
*/
|
|
26
|
+
closest<T>(ctor: ComponentCompatible<T>): Nullable<T>;
|
|
28
27
|
closest<T extends UIElement | typeof UIElement>(type: UIElement | Function): Nullable<T extends typeof UIElement ? InstanceType<T> : T>;
|
|
29
28
|
/**
|
|
30
29
|
* Find closest UIElement in DOM
|