jodit 4.1.14 → 4.2.5
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 +22 -5
- package/es2015/jodit.css +82 -31
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +1364 -560
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- 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.css +82 -31
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +1350 -560
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +82 -31
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +1346 -560
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- 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 +82 -31
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +1346 -560
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- 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 +131 -35
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1388 -496
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- 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/esm/core/constants.js +1 -1
- package/esm/core/decorators/cache/cache.d.ts +2 -1
- package/esm/core/decorators/cache/cache.js +7 -0
- package/esm/core/helpers/size/position.js +2 -2
- package/esm/core/helpers/utils/selector.d.ts +3 -1
- package/esm/core/helpers/utils/selector.js +3 -3
- package/esm/core/ui/button/tooltip/tooltip.js +3 -4
- package/esm/core/ui/popup/popup.js +1 -1
- package/esm/modules/dialog/dialog.js +1 -0
- package/esm/modules/file-browser/file-browser.js +8 -1
- package/esm/modules/image-editor/templates/form.js +6 -5
- package/esm/modules/toolbar/button/button.d.ts +1 -1
- package/esm/modules/widget/tabs/tabs.d.ts +4 -4
- package/esm/modules/widget/tabs/tabs.js +9 -7
- package/esm/plugins/ai-assistant/ai-assistant.d.ts +1 -1
- package/esm/plugins/ai-assistant/ai-assistant.js +6 -6
- package/esm/plugins/image-properties/config.d.ts +5 -83
- package/esm/plugins/image-properties/config.js +0 -3
- package/esm/plugins/image-properties/image-properties.d.ts +22 -32
- package/esm/plugins/image-properties/image-properties.js +129 -402
- package/{types/plugins/image-properties/templates/form.d.ts → esm/plugins/image-properties/readers/align.d.ts} +3 -5
- package/esm/plugins/image-properties/readers/align.js +24 -0
- package/esm/plugins/image-properties/readers/index.d.ts +12 -0
- package/esm/plugins/image-properties/readers/index.js +38 -0
- package/esm/plugins/image-properties/readers/link.d.ts +9 -0
- package/esm/plugins/image-properties/readers/link.js +19 -0
- package/esm/plugins/image-properties/readers/margin.d.ts +8 -0
- package/esm/plugins/image-properties/readers/margin.js +28 -0
- package/esm/plugins/image-properties/readers/size.d.ts +8 -0
- package/esm/plugins/image-properties/readers/size.js +36 -0
- package/esm/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
- package/esm/plugins/image-properties/ui/ui-image-form.js +171 -0
- package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
- package/esm/plugins/image-properties/ui/ui-image-main-tab.js +179 -0
- package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
- package/esm/plugins/image-properties/ui/ui-image-position-tab.js +261 -0
- package/esm/plugins/image-properties/{templates/main-tab.d.ts → utils/open-image-editor.d.ts} +5 -3
- package/esm/plugins/image-properties/utils/open-image-editor.js +52 -0
- package/esm/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
- package/esm/plugins/image-properties/utils/open-image-popup.js +34 -0
- package/esm/plugins/image-properties/utils/utils.d.ts +9 -0
- package/esm/plugins/image-properties/utils/utils.js +21 -0
- package/esm/plugins/image-properties/writers/index.d.ts +12 -0
- package/esm/plugins/image-properties/writers/index.js +53 -0
- package/esm/plugins/image-properties/{templates/form.d.ts → writers/link.d.ts} +2 -4
- package/esm/plugins/image-properties/writers/link.js +24 -0
- package/esm/plugins/image-properties/writers/margin.d.ts +8 -0
- package/esm/plugins/image-properties/writers/margin.js +33 -0
- package/esm/plugins/image-properties/writers/size.d.ts +7 -0
- package/esm/plugins/image-properties/writers/size.js +28 -0
- package/esm/plugins/select/config.d.ts +7 -0
- package/esm/plugins/select/config.js +2 -1
- package/esm/plugins/select/select.d.ts +7 -3
- package/esm/plugins/select/select.js +21 -4
- package/esm/types/ui.d.ts +1 -1
- package/package.json +1 -1
- package/types/core/decorators/cache/cache.d.ts +2 -1
- package/types/core/helpers/utils/selector.d.ts +3 -1
- package/types/modules/toolbar/button/button.d.ts +1 -1
- package/types/modules/widget/tabs/tabs.d.ts +4 -4
- package/types/plugins/ai-assistant/ai-assistant.d.ts +1 -1
- package/types/plugins/image-properties/config.d.ts +5 -83
- package/types/plugins/image-properties/image-properties.d.ts +22 -32
- package/types/plugins/image-properties/{templates/main-tab.d.ts → readers/align.d.ts} +3 -5
- package/types/plugins/image-properties/readers/index.d.ts +12 -0
- package/types/plugins/image-properties/readers/link.d.ts +9 -0
- package/types/plugins/image-properties/readers/margin.d.ts +8 -0
- package/types/plugins/image-properties/readers/size.d.ts +8 -0
- package/types/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
- package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
- package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
- package/types/plugins/image-properties/utils/open-image-editor.d.ts +12 -0
- package/types/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
- package/types/plugins/image-properties/utils/utils.d.ts +9 -0
- package/types/plugins/image-properties/writers/index.d.ts +12 -0
- package/{esm/plugins/image-properties/templates/position-tab.d.ts → types/plugins/image-properties/writers/link.d.ts} +2 -4
- package/types/plugins/image-properties/writers/margin.d.ts +8 -0
- package/types/plugins/image-properties/writers/size.d.ts +7 -0
- package/types/plugins/select/config.d.ts +7 -0
- package/types/plugins/select/select.d.ts +7 -3
- package/types/types/ui.d.ts +1 -1
- package/esm/plugins/image-properties/templates/form.js +0 -26
- package/esm/plugins/image-properties/templates/main-tab.js +0 -47
- package/esm/plugins/image-properties/templates/position-tab.js +0 -66
- package/types/plugins/image-properties/templates/position-tab.d.ts +0 -10
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.
|
|
6
|
+
export const APP_VERSION = "4.2.5";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module decorators/cache
|
|
10
10
|
*/
|
|
11
|
-
import type { IDictionary } from "jodit/esm/types";
|
|
11
|
+
import type { IDictionary, Nullable } from "jodit/esm/types";
|
|
12
12
|
export interface CachePropertyDescriptor<T, R> extends PropertyDescriptor {
|
|
13
13
|
get?: (this: T) => R;
|
|
14
14
|
}
|
|
15
|
+
export declare function cached<T>(object: object, property: string): Nullable<T>;
|
|
15
16
|
export declare function cache<T, R>(_: object, name: PropertyKey, descriptor: CachePropertyDescriptor<T, R>): void;
|
|
16
17
|
export declare function cacheHTML<T extends Function, R>(target: IDictionary, _: string, descriptor: CachePropertyDescriptor<T, R>): void;
|
|
@@ -7,6 +7,13 @@ import { STATUSES } from "jodit/esm/core/component/statuses.js";
|
|
|
7
7
|
import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
8
8
|
import { isFunction, isViewObject } from "jodit/esm/core/helpers/checker/index.js";
|
|
9
9
|
import { error } from "jodit/esm/core/helpers/utils/error/error.js";
|
|
10
|
+
export function cached(object, property) {
|
|
11
|
+
const descriptor = Object.getOwnPropertyDescriptor(object, property);
|
|
12
|
+
if (!descriptor || isFunction(descriptor.get)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return descriptor.value;
|
|
16
|
+
}
|
|
10
17
|
export function cache(_, name, descriptor) {
|
|
11
18
|
const getter = descriptor.get;
|
|
12
19
|
if (!getter) {
|
|
@@ -21,7 +21,7 @@ export function position(elm, jodit, recurse = false) {
|
|
|
21
21
|
return {
|
|
22
22
|
left: Math.round(xPos),
|
|
23
23
|
top: Math.round(yPos),
|
|
24
|
-
width: Math.round(elm.offsetWidth),
|
|
25
|
-
height: Math.round(elm.offsetHeight)
|
|
24
|
+
width: Math.round(elm.offsetWidth ?? rect.width),
|
|
25
|
+
height: Math.round(elm.offsetHeight ?? rect.height)
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -31,7 +31,9 @@ export declare const getXPathByElement: (element: HTMLElement, root: HTMLElement
|
|
|
31
31
|
/**
|
|
32
32
|
* Find all `ref` or `data-ref` elements inside HTMLElement
|
|
33
33
|
*/
|
|
34
|
-
export declare const refs: <T extends HTMLElement>(root: HTMLElement
|
|
34
|
+
export declare const refs: <T extends HTMLElement>(root: HTMLElement | {
|
|
35
|
+
container: HTMLElement;
|
|
36
|
+
}) => IDictionary<T>;
|
|
35
37
|
/**
|
|
36
38
|
* Calculate full CSS selector
|
|
37
39
|
*/
|
|
@@ -59,9 +59,9 @@ export const getXPathByElement = (element, root) => {
|
|
|
59
59
|
* Find all `ref` or `data-ref` elements inside HTMLElement
|
|
60
60
|
*/
|
|
61
61
|
export const refs = (root) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
if ('container' in root) {
|
|
63
|
+
root = root.container;
|
|
64
|
+
}
|
|
65
65
|
return $$('[ref],[data-ref]', root).reduce((def, child) => {
|
|
66
66
|
const key = attr(child, '-ref');
|
|
67
67
|
if (key && isString(key)) {
|
|
@@ -39,7 +39,8 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
|
|
|
39
39
|
view.o.showTooltip &&
|
|
40
40
|
!view.o.useNativeTooltip) {
|
|
41
41
|
view.hookStatus(STATUSES.ready, () => {
|
|
42
|
-
|
|
42
|
+
// TODO Move it inside __open method. Now it is here because testcase failed with capturing
|
|
43
|
+
getContainer(this.j, UITooltip_1).appendChild(this.container);
|
|
43
44
|
view.e.on(view.container, 'mouseenter.tooltip', this.__onMouseEnter, {
|
|
44
45
|
capture: true
|
|
45
46
|
});
|
|
@@ -54,6 +55,7 @@ let UITooltip = UITooltip_1 = class UITooltip extends UIElement {
|
|
|
54
55
|
const view = this.j;
|
|
55
56
|
view.e
|
|
56
57
|
.on(view.ow, 'scroll.tooltip', this.__hide)
|
|
58
|
+
.on(view.ow, 'joditCloseDialog', this.__hide)
|
|
57
59
|
.on(view.container, 'mouseleave.tooltip', this.__hide)
|
|
58
60
|
.on([
|
|
59
61
|
'escape.tooltip',
|
|
@@ -168,9 +170,6 @@ __decorate([
|
|
|
168
170
|
__decorate([
|
|
169
171
|
autobind
|
|
170
172
|
], UITooltip.prototype, "__onMouseEnter", null);
|
|
171
|
-
__decorate([
|
|
172
|
-
autobind
|
|
173
|
-
], UITooltip.prototype, "__delayOpen", null);
|
|
174
173
|
__decorate([
|
|
175
174
|
autobind
|
|
176
175
|
], UITooltip.prototype, "__hide", null);
|
|
@@ -153,7 +153,14 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
153
153
|
this.__updateToolbarButtons();
|
|
154
154
|
this._dialog.open(this.browser, header);
|
|
155
155
|
this.e.fire('sort.filebrowser', this.state.sortBy);
|
|
156
|
-
loadTree(this)
|
|
156
|
+
loadTree(this)
|
|
157
|
+
.then(resolve, reject)
|
|
158
|
+
.finally(() => {
|
|
159
|
+
if (this.isInDestruct) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this?.e?.fire('fileBrowserReady.filebrowser');
|
|
163
|
+
});
|
|
157
164
|
})
|
|
158
165
|
.catch((e) => {
|
|
159
166
|
if (!IS_PROD) {
|
|
@@ -10,11 +10,12 @@ const act = (el, className = 'jodti-image-editor_active') => el ? className : ''
|
|
|
10
10
|
export const form = (editor, o) => {
|
|
11
11
|
const i = editor.i18n.bind(editor);
|
|
12
12
|
const switcher = (label, ref, active = true) => `<div class="jodit-form__group">
|
|
13
|
-
<label
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<label class="jodit-switcher-wrapper">
|
|
14
|
+
<span class='jodit-switcher'>
|
|
15
|
+
<input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
|
|
16
|
+
<span class="jodit-switcher__slider"></span>
|
|
17
|
+
</span>
|
|
18
|
+
<span>${i(label)}</span>
|
|
18
19
|
</label>
|
|
19
20
|
</div>`;
|
|
20
21
|
return editor.create.fromHTML(`<form class="${jie} jodit-properties">
|
|
@@ -22,7 +22,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
22
22
|
hasTrigger: boolean;
|
|
23
23
|
size: "small" | "tiny" | "xsmall" | "middle" | "large";
|
|
24
24
|
name: string;
|
|
25
|
-
value: string | number | boolean;
|
|
25
|
+
value: string | number | boolean;
|
|
26
26
|
variant: import("jodit/esm/types").ButtonVariant;
|
|
27
27
|
type: "button" | "submit";
|
|
28
28
|
disabled: boolean;
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @module modules/widget/tabs
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
11
|
+
import type { IViewBased } from "jodit/esm/types";
|
|
12
12
|
import { UIElement } from "jodit/esm/core/ui";
|
|
13
13
|
|
|
14
14
|
export interface TabOption {
|
|
15
15
|
icon?: string;
|
|
16
16
|
name: string;
|
|
17
|
-
content: HTMLElement | ((this:
|
|
17
|
+
content: HTMLElement | ((this: IViewBased) => void) | UIElement;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Build tabs system
|
|
@@ -44,6 +44,6 @@ export interface TabOption {
|
|
|
44
44
|
* ]);
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
export declare const TabsWidget: (jodit:
|
|
48
|
-
|
|
47
|
+
export declare const TabsWidget: (jodit: IViewBased, tabs: TabOption[], state?: {
|
|
48
|
+
activeTab: string;
|
|
49
49
|
}) => HTMLDivElement;
|
|
@@ -46,11 +46,13 @@ export const TabsWidget = (jodit, tabs, state) => {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
buttonList.forEach(b => {
|
|
49
|
+
b.state.variant = 'initial';
|
|
49
50
|
b.state.activated = false;
|
|
50
51
|
});
|
|
51
52
|
$$('.jodit-tab', tabBox).forEach(a => {
|
|
52
53
|
a.classList.remove('jodit-tab_active');
|
|
53
54
|
});
|
|
55
|
+
nameToTab[tab].button.state.variant = 'outline';
|
|
54
56
|
nameToTab[tab].button.state.activated = true;
|
|
55
57
|
nameToTab[tab].tab.classList.add('jodit-tab_active');
|
|
56
58
|
};
|
|
@@ -79,7 +81,7 @@ export const TabsWidget = (jodit, tabs, state) => {
|
|
|
79
81
|
content.call(jodit);
|
|
80
82
|
}
|
|
81
83
|
if (state) {
|
|
82
|
-
state.
|
|
84
|
+
state.activeTab = name;
|
|
83
85
|
}
|
|
84
86
|
return false;
|
|
85
87
|
});
|
|
@@ -95,20 +97,20 @@ export const TabsWidget = (jodit, tabs, state) => {
|
|
|
95
97
|
$$('a', buttons).forEach(a => {
|
|
96
98
|
a.style.width = (100 / tabCount).toFixed(10) + '%';
|
|
97
99
|
});
|
|
98
|
-
const tab = !state || !state.
|
|
100
|
+
const tab = !state || !state.activeTab || !nameToTab[state.activeTab]
|
|
99
101
|
? firstTab
|
|
100
|
-
: state.
|
|
102
|
+
: state.activeTab;
|
|
101
103
|
setActive(tab);
|
|
102
104
|
if (state) {
|
|
103
|
-
let
|
|
104
|
-
Object.defineProperty(state, '
|
|
105
|
+
let activeTab = state.activeTab;
|
|
106
|
+
Object.defineProperty(state, 'activeTab', {
|
|
105
107
|
configurable: true,
|
|
106
108
|
enumerable: false,
|
|
107
109
|
get() {
|
|
108
|
-
return
|
|
110
|
+
return activeTab;
|
|
109
111
|
},
|
|
110
112
|
set(value) {
|
|
111
|
-
|
|
113
|
+
activeTab = value;
|
|
112
114
|
setActive(value);
|
|
113
115
|
}
|
|
114
116
|
});
|
|
@@ -21,7 +21,7 @@ export declare class aiAssistant extends Plugin {
|
|
|
21
21
|
private get __container();
|
|
22
22
|
constructor(jodit: IJodit);
|
|
23
23
|
/** @override */
|
|
24
|
-
afterInit(
|
|
24
|
+
afterInit(): void;
|
|
25
25
|
protected onGenerateAiAssistantForm(prompt: string): void;
|
|
26
26
|
protected onInvokeAiAssistant(prompt: string): void;
|
|
27
27
|
/** @override */
|
|
@@ -13,14 +13,14 @@ 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 { cache } from "jodit/esm/core/decorators/cache/cache.js";
|
|
16
|
+
import { cache, cached } from "jodit/esm/core/decorators/cache/cache.js";
|
|
17
17
|
import { watch } from "jodit/esm/core/decorators/watch/watch.js";
|
|
18
18
|
import { extendLang, pluginSystem } from "jodit/esm/core/global.js";
|
|
19
19
|
import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error.js";
|
|
20
20
|
import { Plugin } from "jodit/esm/core/plugin/plugin.js";
|
|
21
21
|
import "./config";
|
|
22
22
|
import { UiAiAssistant } from "./ui/ui-ai-assistant";
|
|
23
|
-
import * as
|
|
23
|
+
import * as lang from "./langs";
|
|
24
24
|
/**
|
|
25
25
|
* The plugin inserts content generated by AI into the editor.
|
|
26
26
|
*/
|
|
@@ -64,10 +64,10 @@ export class aiAssistant extends Plugin {
|
|
|
64
64
|
group: 'insert'
|
|
65
65
|
}
|
|
66
66
|
];
|
|
67
|
-
extendLang(
|
|
67
|
+
extendLang(lang);
|
|
68
68
|
}
|
|
69
69
|
/** @override */
|
|
70
|
-
afterInit(
|
|
70
|
+
afterInit() { }
|
|
71
71
|
onGenerateAiAssistantForm(prompt) {
|
|
72
72
|
this.__dialog.open(this.__container, 'AI Assistant');
|
|
73
73
|
this.__container.setPrompt(prompt);
|
|
@@ -100,8 +100,8 @@ export class aiAssistant extends Plugin {
|
|
|
100
100
|
}
|
|
101
101
|
/** @override */
|
|
102
102
|
beforeDestruct(_) {
|
|
103
|
-
this
|
|
104
|
-
this
|
|
103
|
+
cached(this, '__container')?.destruct();
|
|
104
|
+
cached(this, '__dialog')?.destruct();
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
__decorate([
|
|
@@ -3,90 +3,12 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/image-properties
|
|
8
|
+
*/
|
|
9
|
+
import type { ImagePropertiesOptions } from "./interface";
|
|
6
10
|
declare module 'jodit/config' {
|
|
7
11
|
interface Config {
|
|
8
|
-
image:
|
|
9
|
-
dialogWidth: number;
|
|
10
|
-
/**
|
|
11
|
-
* Open editing dialog after double click on image
|
|
12
|
-
*/
|
|
13
|
-
openOnDblClick: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Show edit 'src' input
|
|
16
|
-
*/
|
|
17
|
-
editSrc: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Show crop/resize btn
|
|
20
|
-
*/
|
|
21
|
-
useImageEditor: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Show edit 'title' input
|
|
24
|
-
*/
|
|
25
|
-
editTitle: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Show edit 'alt' input
|
|
28
|
-
*/
|
|
29
|
-
editAlt: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Show edit image link's options
|
|
32
|
-
*/
|
|
33
|
-
editLink: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Show edit image size's inputs
|
|
36
|
-
*/
|
|
37
|
-
editSize: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Show edit margin inputs
|
|
40
|
-
*/
|
|
41
|
-
editMargins: boolean;
|
|
42
|
-
editBorderRadius: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Show edit classNames input
|
|
45
|
-
*/
|
|
46
|
-
editClass: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Pre-define available classes to select from
|
|
49
|
-
*
|
|
50
|
-
* Classes can be provided as list of strings or as list of tuples
|
|
51
|
-
* `["classname", "human label"]`.
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```javascript
|
|
55
|
-
* new Jodit('#editor', {
|
|
56
|
-
* image: {
|
|
57
|
-
* availableClasses: [
|
|
58
|
-
* "rte-image-width-50",
|
|
59
|
-
* ["rte-image-width-75", "75 % width"]
|
|
60
|
-
* ]
|
|
61
|
-
* }
|
|
62
|
-
* })
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
availableClasses: [
|
|
66
|
-
string,
|
|
67
|
-
string
|
|
68
|
-
][] | string[];
|
|
69
|
-
/**
|
|
70
|
-
* Show style edit input
|
|
71
|
-
*/
|
|
72
|
-
editStyle: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Show edit ID input
|
|
75
|
-
*/
|
|
76
|
-
editId: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Show Alignment selector
|
|
79
|
-
*/
|
|
80
|
-
editAlign: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Show preview image
|
|
83
|
-
*/
|
|
84
|
-
showPreview: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Select image after close dialog
|
|
87
|
-
*/
|
|
88
|
-
selectImageAfterClose: boolean;
|
|
89
|
-
};
|
|
12
|
+
image: ImagePropertiesOptions;
|
|
90
13
|
}
|
|
91
14
|
}
|
|
92
|
-
export {};
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* @module plugins/image-properties
|
|
8
|
-
*/
|
|
9
6
|
import { Config } from "jodit/esm/config.js";
|
|
10
7
|
Config.prototype.image = {
|
|
11
8
|
dialogWidth: 600,
|
|
@@ -9,27 +9,34 @@
|
|
|
9
9
|
* @module plugins/image-properties
|
|
10
10
|
*/
|
|
11
11
|
import type { IJodit } from "jodit/esm/types";
|
|
12
|
-
import { Plugin } from "jodit/esm/
|
|
12
|
+
import { Plugin } from "jodit/esm/core/plugin/plugin";
|
|
13
13
|
import "./config";
|
|
14
|
-
|
|
14
|
+
import type { ImagePropertiesState } from "./interface";
|
|
15
|
+
/**
|
|
16
|
+
* Plug-in for image editing window
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```javascript
|
|
20
|
+
* const editor = Jodit.make('#editor', {
|
|
21
|
+
* image: {
|
|
22
|
+
* editSrc: false,
|
|
23
|
+
* editLink: false
|
|
24
|
+
* }
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
15
28
|
/**
|
|
16
29
|
* Show dialog with image's options
|
|
17
30
|
*/
|
|
18
31
|
export declare class imageProperties extends Plugin {
|
|
19
|
-
protected state:
|
|
20
|
-
image: HTMLImageElement;
|
|
21
|
-
ratio: number;
|
|
22
|
-
sizeIsLocked: boolean;
|
|
23
|
-
marginIsLocked: boolean;
|
|
24
|
-
};
|
|
32
|
+
protected state: ImagePropertiesState;
|
|
25
33
|
private activeTabState;
|
|
26
|
-
|
|
27
|
-
protected onChangeSizeIsLocked(): void;
|
|
28
|
-
private form;
|
|
34
|
+
private get form();
|
|
29
35
|
/**
|
|
30
36
|
* Dialog for form
|
|
31
37
|
*/
|
|
32
|
-
private dialog;
|
|
38
|
+
private get dialog();
|
|
39
|
+
private get __buttons();
|
|
33
40
|
/**
|
|
34
41
|
* Open dialog editing image properties
|
|
35
42
|
*
|
|
@@ -45,28 +52,11 @@ export declare class imageProperties extends Plugin {
|
|
|
45
52
|
* ```
|
|
46
53
|
*/
|
|
47
54
|
protected open(): void | false;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
private makeForm;
|
|
52
|
-
/**
|
|
53
|
-
* Set input values from image
|
|
54
|
-
*/
|
|
55
|
-
private updateValues;
|
|
56
|
-
/**
|
|
57
|
-
* Apply form's values to image
|
|
58
|
-
*/
|
|
59
|
-
private onApply;
|
|
60
|
-
/**
|
|
61
|
-
* Open image editor dialog
|
|
62
|
-
*/
|
|
63
|
-
private openImageEditor;
|
|
64
|
-
/**
|
|
65
|
-
* Open popup with filebrowser/uploader buttons for image
|
|
66
|
-
*/
|
|
67
|
-
private openImagePopup;
|
|
55
|
+
private __lock;
|
|
56
|
+
private __unlock;
|
|
68
57
|
/** @override **/
|
|
69
58
|
protected afterInit(editor: IJodit): void;
|
|
59
|
+
protected onStateValuesImageSrcChange(): Promise<void>;
|
|
70
60
|
/** @override */
|
|
71
61
|
protected beforeDestruct(editor: IJodit): void;
|
|
72
62
|
}
|