jodit 3.6.16 → 3.7.2
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/.eslintrc.js +1 -1
- package/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
- package/{PULL_REQUEST_TEMPLATE.md → .github/PULL_REQUEST_TEMPLATE.md} +0 -0
- package/CHANGELOG.MD +76 -5
- package/build/jodit.css +23 -19
- package/build/jodit.es2018.css +22 -18
- package/build/jodit.es2018.en.css +22 -18
- package/build/jodit.es2018.en.js +153 -99
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +2 -2
- package/build/jodit.es2018.js +153 -99
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +2 -2
- package/build/jodit.js +884 -809
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +2 -2
- package/package.json +24 -24
- package/src/core/async.ts +22 -8
- package/src/core/component/component.ts +4 -2
- package/src/core/component/view-component.ts +1 -1
- package/src/core/decorators/cache.ts +1 -1
- package/src/core/decorators/component.ts +1 -1
- package/src/core/decorators/debounce.ts +5 -4
- package/src/core/decorators/idle.ts +40 -0
- package/src/core/decorators/index.ts +1 -0
- package/src/core/decorators/nonenumerable.ts +1 -1
- package/src/core/decorators/spy.ts +2 -3
- package/src/core/decorators/watch.ts +9 -5
- package/src/core/events/events-native.ts +1 -1
- package/src/core/global.ts +7 -3
- package/src/core/helpers/checker/is-plain-object.ts +1 -2
- package/src/core/helpers/checker/is-url.ts +4 -1
- package/src/core/helpers/scroll-into-view.ts +1 -1
- package/src/core/helpers/size/position.ts +1 -22
- package/src/core/helpers/string/stringify.ts +2 -2
- package/src/core/helpers/type.ts +0 -44
- package/src/core/helpers/utils/utils.ts +1 -1
- package/src/core/plugin.ts +3 -1
- package/src/core/ui/button/button/button.ts +2 -2
- package/src/core/ui/button/group/group.ts +6 -4
- package/src/core/ui/element.ts +2 -2
- package/src/core/ui/form/block/block.ts +1 -1
- package/src/core/ui/form/form.ts +5 -5
- package/src/core/ui/form/inputs/area/area.ts +3 -3
- package/src/core/ui/form/inputs/checkbox/checkbox.ts +2 -2
- package/src/core/ui/form/inputs/file/file.ts +6 -4
- package/src/core/ui/form/inputs/input/input.ts +7 -5
- package/src/core/ui/form/inputs/select/select.ts +9 -7
- package/src/core/ui/list/group.ts +4 -4
- package/src/core/ui/list/list.ts +2 -2
- package/src/core/ui/popup/popup.ts +3 -3
- package/src/core/ui/progress-bar/progress-bar.ts +3 -3
- package/src/core/view/view-with-toolbar.ts +5 -2
- package/src/core/view/view.ts +2 -2
- package/src/jodit.ts +37 -15
- package/src/modules/context-menu/context-menu.ts +1 -1
- package/src/modules/dialog/dialog.ts +4 -4
- package/src/modules/file-browser/builders/context-menu.ts +1 -1
- package/src/modules/file-browser/data-provider.ts +1 -1
- package/src/modules/file-browser/file-browser.ts +3 -3
- package/src/modules/image-editor/image-editor.ts +1 -1
- package/src/modules/observer/observer.ts +1 -1
- package/src/modules/observer/snapshot.ts +1 -1
- package/src/modules/status-bar/status-bar.ts +1 -1
- package/src/modules/table.ts +3 -1
- package/src/modules/toolbar/button/button.ts +13 -10
- package/src/modules/toolbar/button/content.ts +3 -3
- package/src/modules/toolbar/collection/collection.ts +9 -6
- package/src/modules/toolbar/collection/editor-collection.ts +26 -4
- package/src/modules/uploader/uploader.ts +1 -1
- package/src/modules/widget/file-selector/file-selector.ts +1 -1
- package/src/plugins/about/about.ts +1 -1
- package/src/plugins/class-span/class-span.ts +3 -3
- package/src/plugins/clipboard/clipboard.ts +28 -24
- package/src/plugins/clipboard/paste/helpers.ts +5 -8
- package/src/plugins/clipboard/paste/paste.ts +3 -3
- package/src/plugins/fix/clean-html.ts +3 -3
- package/src/plugins/image/helpers.ts +1 -1
- package/src/plugins/inline-popup/inline-popup.ts +1 -1
- package/src/plugins/keyboard/delete.ts +1 -1
- package/src/plugins/keyboard/enter.ts +26 -26
- package/src/plugins/limit.ts +2 -2
- package/src/plugins/link/link.ts +3 -3
- package/src/plugins/media/video/index.ts +1 -1
- package/src/plugins/ordered-list.ts +64 -61
- package/src/plugins/redo-undo.ts +3 -3
- package/src/plugins/search/search.ts +2 -2
- package/src/plugins/select.ts +3 -2
- package/src/plugins/size/resize-handler.ts +2 -2
- package/src/plugins/size/size.ts +2 -2
- package/src/plugins/source/editor/engines/ace.ts +8 -8
- package/src/plugins/source/editor/engines/area.ts +15 -13
- package/src/plugins/source/source.ts +1 -1
- package/src/plugins/symbols/symbols.ts +3 -3
- package/src/plugins/table/config.ts +3 -1
- package/src/plugins/table/resize-cells.ts +21 -16
- package/src/plugins/table/select-cells.ts +44 -6
- package/src/plugins/table/table-keyboard-navigation.ts +134 -131
- package/src/plugins/table/table.less +24 -17
- package/src/types/async.d.ts +2 -0
- package/src/types/core.ts +13 -0
- package/src/types/index.d.ts +1 -0
- package/src/types/jodit.d.ts +2 -0
- package/test/tests/acceptance/editorTest.js +37 -0
- package/test/tests/acceptance/tableTest.js +23 -14
- package/tsconfig.json +1 -0
- package/webpack.config.js +1 -0
package/src/core/ui/form/form.ts
CHANGED
|
@@ -13,13 +13,13 @@ import { component } from '../../decorators';
|
|
|
13
13
|
@component
|
|
14
14
|
export class UIForm extends UIGroup implements IUIForm {
|
|
15
15
|
/** @override */
|
|
16
|
-
className(): string {
|
|
16
|
+
override className(): string {
|
|
17
17
|
return 'UIForm';
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
container!: HTMLFormElement;
|
|
20
|
+
override container!: HTMLFormElement;
|
|
21
21
|
|
|
22
|
-
submit() {
|
|
22
|
+
submit(): void {
|
|
23
23
|
this.j.e.fire(this.container, 'submit');
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -47,7 +47,7 @@ export class UIForm extends UIGroup implements IUIForm {
|
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
onSubmit(handler: (data: IDictionary) => false | void) {
|
|
50
|
+
onSubmit(handler: (data: IDictionary) => false | void): void {
|
|
51
51
|
this.j.e.on(this.container, 'submit', (): false => {
|
|
52
52
|
const inputs = this.allChildren.filter(
|
|
53
53
|
elm => elm instanceof UIInput
|
|
@@ -69,7 +69,7 @@ export class UIForm extends UIGroup implements IUIForm {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/** @override */
|
|
72
|
-
protected createContainer(): HTMLElement {
|
|
72
|
+
protected override createContainer(): HTMLElement {
|
|
73
73
|
const form = this.j.c.element('form');
|
|
74
74
|
form.classList.add(this.componentName);
|
|
75
75
|
attr(form, 'dir', this.j.o.direction || 'auto');
|
|
@@ -12,14 +12,14 @@ import { component } from '../../../../decorators';
|
|
|
12
12
|
@component
|
|
13
13
|
export class UITextArea extends UIInput {
|
|
14
14
|
/** @override */
|
|
15
|
-
className(): string {
|
|
15
|
+
override className(): string {
|
|
16
16
|
return 'UITextArea';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
nativeInput!: HTMLTextAreaElement;
|
|
19
|
+
override nativeInput!: HTMLTextAreaElement;
|
|
20
20
|
|
|
21
21
|
/** @override */
|
|
22
|
-
protected createContainer(options: this['state']): HTMLElement {
|
|
22
|
+
protected override createContainer(options: this['state']): HTMLElement {
|
|
23
23
|
this.nativeInput = this.j.create.element('textarea');
|
|
24
24
|
return super.createContainer(options);
|
|
25
25
|
}
|
|
@@ -13,12 +13,12 @@ import { component } from '../../../../decorators';
|
|
|
13
13
|
@component
|
|
14
14
|
export class UICheckbox extends UIInput {
|
|
15
15
|
/** @override */
|
|
16
|
-
className(): string {
|
|
16
|
+
override className(): string {
|
|
17
17
|
return 'UICheckbox';
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/** @override */
|
|
21
|
-
protected render(options?: IDictionary): HTMLElement {
|
|
21
|
+
protected override render(options?: IDictionary): HTMLElement {
|
|
22
22
|
return this.j.c.element('label', {
|
|
23
23
|
className: this.componentName
|
|
24
24
|
});
|
|
@@ -15,7 +15,7 @@ import { UIButton } from '../../../button';
|
|
|
15
15
|
export class UIFileInput extends UIInput {
|
|
16
16
|
private button!: IUIButton;
|
|
17
17
|
|
|
18
|
-
state: UIInput['state'] & {
|
|
18
|
+
override state: UIInput['state'] & {
|
|
19
19
|
onlyImages: boolean;
|
|
20
20
|
} = {
|
|
21
21
|
...UIInput.defaultState,
|
|
@@ -24,11 +24,13 @@ export class UIFileInput extends UIInput {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
/** @override */
|
|
27
|
-
className(): string {
|
|
27
|
+
override className(): string {
|
|
28
28
|
return 'UIFileInput';
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
protected createContainer(
|
|
31
|
+
protected override createContainer(
|
|
32
|
+
options: Partial<this['state']>
|
|
33
|
+
): HTMLElement {
|
|
32
34
|
this.button = new UIButton(this.j, {
|
|
33
35
|
icon: {
|
|
34
36
|
name: 'plus'
|
|
@@ -50,7 +52,7 @@ export class UIFileInput extends UIInput {
|
|
|
50
52
|
return container;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
protected createNativeInput(
|
|
55
|
+
protected override createNativeInput(
|
|
54
56
|
options: Partial<this['state']>
|
|
55
57
|
): IUIInput['nativeInput'] {
|
|
56
58
|
return this.j.create.fromHTML(`<input
|
|
@@ -154,7 +154,7 @@ export class UIInput extends UIElement implements IUIInput {
|
|
|
154
154
|
return this.nativeInput.value;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
set value(value) {
|
|
157
|
+
set value(value: string) {
|
|
158
158
|
if (this.value !== value) {
|
|
159
159
|
this.nativeInput.value = value;
|
|
160
160
|
this.onChangeValue();
|
|
@@ -165,7 +165,7 @@ export class UIInput extends UIElement implements IUIInput {
|
|
|
165
165
|
* Call on every state value changed
|
|
166
166
|
*/
|
|
167
167
|
@watch('state.value')
|
|
168
|
-
protected onChangeStateValue() {
|
|
168
|
+
protected onChangeStateValue(): void {
|
|
169
169
|
this.value = this.state.value;
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -173,7 +173,7 @@ export class UIInput extends UIElement implements IUIInput {
|
|
|
173
173
|
* Call on every native value changed
|
|
174
174
|
*/
|
|
175
175
|
@autobind
|
|
176
|
-
protected onChangeValue() {
|
|
176
|
+
protected onChangeValue(): void {
|
|
177
177
|
const { value } = this;
|
|
178
178
|
|
|
179
179
|
this.state.value = value;
|
|
@@ -190,7 +190,9 @@ export class UIInput extends UIElement implements IUIInput {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/** @override **/
|
|
193
|
-
protected createContainer(
|
|
193
|
+
protected override createContainer(
|
|
194
|
+
options: Partial<this['state']>
|
|
195
|
+
): HTMLElement {
|
|
194
196
|
const container = super.createContainer();
|
|
195
197
|
|
|
196
198
|
this.wrapper = this.j.c.div(this.getFullElName('wrapper'));
|
|
@@ -252,7 +254,7 @@ export class UIInput extends UIElement implements IUIInput {
|
|
|
252
254
|
this.onChangeStateValue();
|
|
253
255
|
}
|
|
254
256
|
|
|
255
|
-
focus() {
|
|
257
|
+
focus(): void {
|
|
256
258
|
this.nativeInput.focus();
|
|
257
259
|
}
|
|
258
260
|
|
|
@@ -15,15 +15,15 @@ import { inputValidators, selectValidators } from '../../validators';
|
|
|
15
15
|
@component
|
|
16
16
|
export class UISelect extends UIInput implements IUISelect {
|
|
17
17
|
/** @override */
|
|
18
|
-
className(): string {
|
|
18
|
+
override className(): string {
|
|
19
19
|
return 'UISelect';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/** @override */
|
|
23
|
-
nativeInput!: IUISelect['nativeInput'];
|
|
23
|
+
override nativeInput!: IUISelect['nativeInput'];
|
|
24
24
|
|
|
25
25
|
/** @override */
|
|
26
|
-
static defaultState: IUISelect['state'] = {
|
|
26
|
+
static override defaultState: IUISelect['state'] = {
|
|
27
27
|
...UIInput.defaultState,
|
|
28
28
|
options: [],
|
|
29
29
|
size: 1,
|
|
@@ -31,10 +31,12 @@ export class UISelect extends UIInput implements IUISelect {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
/** @override */
|
|
34
|
-
state: IUISelect['state'] = { ...UISelect.defaultState };
|
|
34
|
+
override state: IUISelect['state'] = { ...UISelect.defaultState };
|
|
35
35
|
|
|
36
36
|
/** @override **/
|
|
37
|
-
protected createContainer(
|
|
37
|
+
protected override createContainer(
|
|
38
|
+
state: Partial<IUISelect['state']>
|
|
39
|
+
): HTMLElement {
|
|
38
40
|
const container = super.createContainer(state);
|
|
39
41
|
|
|
40
42
|
const { j } = this,
|
|
@@ -68,12 +70,12 @@ export class UISelect extends UIInput implements IUISelect {
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
/** @override **/
|
|
71
|
-
protected createNativeInput(): IUISelect['nativeInput'] {
|
|
73
|
+
protected override createNativeInput(): IUISelect['nativeInput'] {
|
|
72
74
|
return this.j.create.element('select');
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
/** @override **/
|
|
76
|
-
protected updateValidators() {
|
|
78
|
+
protected override updateValidators(): void {
|
|
77
79
|
super.updateValidators();
|
|
78
80
|
|
|
79
81
|
if (this.state.required) {
|
|
@@ -24,7 +24,7 @@ export class UIGroup<T extends IViewBased = IViewBased>
|
|
|
24
24
|
implements IUIGroup
|
|
25
25
|
{
|
|
26
26
|
/** @override */
|
|
27
|
-
className(): string {
|
|
27
|
+
override className(): string {
|
|
28
28
|
return 'UIGroup';
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -66,7 +66,7 @@ export class UIGroup<T extends IViewBased = IViewBased>
|
|
|
66
66
|
* Update all children
|
|
67
67
|
*/
|
|
68
68
|
@watch('buttonSize')
|
|
69
|
-
update(): void {
|
|
69
|
+
override update(): void {
|
|
70
70
|
this.elements.forEach(elm => elm.update());
|
|
71
71
|
this.setMod('size', this.buttonSize);
|
|
72
72
|
}
|
|
@@ -100,7 +100,7 @@ export class UIGroup<T extends IViewBased = IViewBased>
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/** @override */
|
|
103
|
-
setMod(name: string, value: string | boolean | null): this {
|
|
103
|
+
override setMod(name: string, value: string | boolean | null): this {
|
|
104
104
|
if (this.syncMod) {
|
|
105
105
|
this.elements.forEach(elm => elm.setMod(name, value));
|
|
106
106
|
}
|
|
@@ -161,7 +161,7 @@ export class UIGroup<T extends IViewBased = IViewBased>
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
/** @override */
|
|
164
|
-
destruct(): any {
|
|
164
|
+
override destruct(): any {
|
|
165
165
|
this.clear();
|
|
166
166
|
return super.destruct();
|
|
167
167
|
}
|
package/src/core/ui/list/list.ts
CHANGED
|
@@ -32,11 +32,11 @@ export class UIList<T extends IViewBased = IViewBased>
|
|
|
32
32
|
implements IUIList
|
|
33
33
|
{
|
|
34
34
|
/** @override */
|
|
35
|
-
className(): string {
|
|
35
|
+
override className(): string {
|
|
36
36
|
return 'UIList';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
jodit!: T;
|
|
39
|
+
override jodit!: T;
|
|
40
40
|
|
|
41
41
|
mode: IUIList['mode'] = 'horizontal';
|
|
42
42
|
|
|
@@ -54,7 +54,7 @@ export class Popup extends UIElement implements IPopup {
|
|
|
54
54
|
private childrenPopups: Set<IPopup> = new Set();
|
|
55
55
|
|
|
56
56
|
/** @override */
|
|
57
|
-
updateParentElement(target: IUIElement): this {
|
|
57
|
+
override updateParentElement(target: IUIElement): this {
|
|
58
58
|
if (target !== this && target instanceof Popup) {
|
|
59
59
|
this.childrenPopups.forEach(popup => {
|
|
60
60
|
if (!target.closest(popup) && popup.isOpened) {
|
|
@@ -379,7 +379,7 @@ export class Popup extends UIElement implements IPopup {
|
|
|
379
379
|
* Set ZIndex
|
|
380
380
|
* @param index
|
|
381
381
|
*/
|
|
382
|
-
setZIndex(index: number) {
|
|
382
|
+
setZIndex(index: number): void {
|
|
383
383
|
this.container.style.zIndex = index.toString();
|
|
384
384
|
}
|
|
385
385
|
|
|
@@ -389,7 +389,7 @@ export class Popup extends UIElement implements IPopup {
|
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
/** @override **/
|
|
392
|
-
destruct(): any {
|
|
392
|
+
override destruct(): any {
|
|
393
393
|
this.close();
|
|
394
394
|
return super.destruct();
|
|
395
395
|
}
|
|
@@ -12,12 +12,12 @@ import { UIElement } from '../element';
|
|
|
12
12
|
|
|
13
13
|
export class ProgressBar extends UIElement implements IProgressBar {
|
|
14
14
|
/** @override */
|
|
15
|
-
className(): string {
|
|
15
|
+
override className(): string {
|
|
16
16
|
return 'ProgressBar';
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/** @override */
|
|
20
|
-
protected render(): string {
|
|
20
|
+
protected override render(): string {
|
|
21
21
|
return '<div><div></div></div>';
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -40,7 +40,7 @@ export class ProgressBar extends UIElement implements IProgressBar {
|
|
|
40
40
|
return this;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
destruct(): any {
|
|
43
|
+
override destruct(): any {
|
|
44
44
|
this.hide();
|
|
45
45
|
return super.destruct();
|
|
46
46
|
}
|
|
@@ -151,17 +151,20 @@ export abstract class ViewWithToolbar extends View implements IViewWithToolbar {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
override isJodit: boolean = false;
|
|
155
|
+
|
|
154
156
|
/** @override **/
|
|
155
157
|
protected constructor(
|
|
156
158
|
options?: Partial<IViewOptions>,
|
|
157
|
-
|
|
159
|
+
isJodit: boolean = false
|
|
158
160
|
) {
|
|
159
161
|
super(options, isJodit);
|
|
162
|
+
this.isJodit = isJodit;
|
|
160
163
|
|
|
161
164
|
this.e.on('beforeToolbarBuild', this.beforeToolbarBuild);
|
|
162
165
|
}
|
|
163
166
|
|
|
164
|
-
destruct(): void {
|
|
167
|
+
override destruct(): void {
|
|
165
168
|
if (this.isDestructed) {
|
|
166
169
|
return;
|
|
167
170
|
}
|
package/src/core/view/view.ts
CHANGED
|
@@ -331,7 +331,7 @@ export abstract class View extends Component implements IViewBased, Mods, Elms {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
/** Add some element to box */
|
|
334
|
-
protected addDisclaimer(elm: HTMLElement) {
|
|
334
|
+
protected addDisclaimer(elm: HTMLElement): void {
|
|
335
335
|
this.container.appendChild(elm);
|
|
336
336
|
}
|
|
337
337
|
|
|
@@ -352,7 +352,7 @@ export abstract class View extends Component implements IViewBased, Mods, Elms {
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
/** @override */
|
|
355
|
-
destruct() {
|
|
355
|
+
override destruct(): void {
|
|
356
356
|
if (this.isDestructed) {
|
|
357
357
|
return;
|
|
358
358
|
}
|
package/src/jodit.ts
CHANGED
|
@@ -69,10 +69,31 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
69
69
|
return 'Jodit';
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Return promise for ready actions
|
|
74
|
+
* @example
|
|
75
|
+
* ```js
|
|
76
|
+
* const jodit = Jodit.make('#editor');
|
|
77
|
+
* await jodit.waitForReady();
|
|
78
|
+
* jodit.e.fire('someAsyncLoadedPluginEvent', (test) => {
|
|
79
|
+
* alert(test);
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
waitForReady(): Promise<IJodit> {
|
|
84
|
+
if (this.isReady) {
|
|
85
|
+
return Promise.resolve(this);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return this.async.promise(resolve => {
|
|
89
|
+
this.hookStatus('ready', () => resolve(this));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
72
93
|
/**
|
|
73
94
|
* Define if object is Jodit
|
|
74
95
|
*/
|
|
75
|
-
readonly isJodit: true = true;
|
|
96
|
+
override readonly isJodit: true = true;
|
|
76
97
|
|
|
77
98
|
/**
|
|
78
99
|
* Plain text editor's value
|
|
@@ -105,7 +126,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
105
126
|
*
|
|
106
127
|
* @return {number}
|
|
107
128
|
*/
|
|
108
|
-
get defaultTimeout(): number {
|
|
129
|
+
override get defaultTimeout(): number {
|
|
109
130
|
return this.options && this.o.observer
|
|
110
131
|
? this.o.observer.timeout
|
|
111
132
|
: Config.defaultOptions.observer.timeout;
|
|
@@ -132,7 +153,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
132
153
|
/**
|
|
133
154
|
* Default settings
|
|
134
155
|
*/
|
|
135
|
-
static get defaultOptions(): Config {
|
|
156
|
+
static override get defaultOptions(): Config {
|
|
136
157
|
return Config.defaultOptions;
|
|
137
158
|
}
|
|
138
159
|
|
|
@@ -165,7 +186,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
165
186
|
* Container for set/get value
|
|
166
187
|
* @type {Storage}
|
|
167
188
|
*/
|
|
168
|
-
readonly storage!: IStorage;
|
|
189
|
+
override readonly storage!: IStorage;
|
|
169
190
|
|
|
170
191
|
readonly createInside: ICreate = new Create(
|
|
171
192
|
() => this.ed,
|
|
@@ -207,11 +228,11 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
207
228
|
/**
|
|
208
229
|
* Container for all staff
|
|
209
230
|
*/
|
|
210
|
-
get container(): HTMLDivElement {
|
|
231
|
+
override get container(): HTMLDivElement {
|
|
211
232
|
return this.currentPlace.container;
|
|
212
233
|
}
|
|
213
234
|
|
|
214
|
-
set container(container: HTMLDivElement) {
|
|
235
|
+
override set container(container: HTMLDivElement) {
|
|
215
236
|
this.setPlaceField('container', container);
|
|
216
237
|
}
|
|
217
238
|
|
|
@@ -279,11 +300,11 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
279
300
|
/**
|
|
280
301
|
* options All Jodit settings default + second arguments of constructor
|
|
281
302
|
*/
|
|
282
|
-
get options(): Config {
|
|
303
|
+
override get options(): Config {
|
|
283
304
|
return this.currentPlace.options as Config;
|
|
284
305
|
}
|
|
285
306
|
|
|
286
|
-
set options(opt: Config) {
|
|
307
|
+
override set options(opt: Config) {
|
|
287
308
|
this.setPlaceField('options', opt);
|
|
288
309
|
}
|
|
289
310
|
|
|
@@ -820,7 +841,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
820
841
|
/**
|
|
821
842
|
* Disable selecting
|
|
822
843
|
*/
|
|
823
|
-
lock(name = 'any'): boolean {
|
|
844
|
+
override lock(name = 'any'): boolean {
|
|
824
845
|
if (super.lock(name)) {
|
|
825
846
|
this.__selectionLocked = this.s.save();
|
|
826
847
|
this.s.clear();
|
|
@@ -835,7 +856,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
835
856
|
/**
|
|
836
857
|
* Enable selecting
|
|
837
858
|
*/
|
|
838
|
-
unlock(): boolean {
|
|
859
|
+
override unlock(): boolean {
|
|
839
860
|
if (super.unlock()) {
|
|
840
861
|
this.editor.classList.remove('jodit_disabled');
|
|
841
862
|
|
|
@@ -970,7 +991,8 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
970
991
|
* ```
|
|
971
992
|
*/
|
|
972
993
|
toggleMode(): void {
|
|
973
|
-
let mode
|
|
994
|
+
let mode = this.getMode();
|
|
995
|
+
|
|
974
996
|
if (
|
|
975
997
|
[
|
|
976
998
|
consts.MODE_SOURCE,
|
|
@@ -1062,14 +1084,14 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
1062
1084
|
}
|
|
1063
1085
|
|
|
1064
1086
|
/** @override **/
|
|
1065
|
-
protected initOptions(options?: object): void {
|
|
1087
|
+
protected override initOptions(options?: object): void {
|
|
1066
1088
|
this.options = <Config>(
|
|
1067
1089
|
ConfigProto(options || {}, Config.defaultOptions)
|
|
1068
1090
|
);
|
|
1069
1091
|
}
|
|
1070
1092
|
|
|
1071
1093
|
/** @override **/
|
|
1072
|
-
protected initOwners(): void {
|
|
1094
|
+
protected override initOwners(): void {
|
|
1073
1095
|
// in iframe it can be changed
|
|
1074
1096
|
this.editorWindow = this.o.ownerWindow;
|
|
1075
1097
|
this.ownerWindow = this.o.ownerWindow;
|
|
@@ -1305,7 +1327,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
1305
1327
|
}
|
|
1306
1328
|
|
|
1307
1329
|
/** @override */
|
|
1308
|
-
protected addDisclaimer(elm: HTMLElement) {
|
|
1330
|
+
protected override addDisclaimer(elm: HTMLElement): void {
|
|
1309
1331
|
this.workplace.appendChild(elm);
|
|
1310
1332
|
}
|
|
1311
1333
|
|
|
@@ -1515,7 +1537,7 @@ export class Jodit extends ViewWithToolbar implements IJodit {
|
|
|
1515
1537
|
/**
|
|
1516
1538
|
* Jodit's Destructor. Remove editor, and return source input
|
|
1517
1539
|
*/
|
|
1518
|
-
destruct(): void {
|
|
1540
|
+
override destruct(): void {
|
|
1519
1541
|
if (this.isInDestruct) {
|
|
1520
1542
|
return;
|
|
1521
1543
|
}
|
|
@@ -91,7 +91,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
|
|
|
91
91
|
* @property {HTMLDivElement} resizer
|
|
92
92
|
*/
|
|
93
93
|
private resizer!: HTMLElement;
|
|
94
|
-
toolbar!: IToolbarCollection;
|
|
94
|
+
override toolbar!: IToolbarCollection;
|
|
95
95
|
|
|
96
96
|
private offsetX?: number;
|
|
97
97
|
private offsetY?: number;
|
|
@@ -334,7 +334,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
|
|
|
334
334
|
.off(self.ow, 'mouseup', self.onMouseUp);
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
OPTIONS!: IDialogOptions;
|
|
337
|
+
override OPTIONS!: IDialogOptions;
|
|
338
338
|
|
|
339
339
|
/**
|
|
340
340
|
* @property {HTMLDivElement} dialog
|
|
@@ -811,7 +811,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
|
|
|
811
811
|
* Build toolbar after ready
|
|
812
812
|
*/
|
|
813
813
|
@hook('ready')
|
|
814
|
-
protected buildToolbar(): void {
|
|
814
|
+
protected override buildToolbar(): void {
|
|
815
815
|
this.o.buttons &&
|
|
816
816
|
this.toolbar
|
|
817
817
|
.build(splitArray(this.o.buttons))
|
|
@@ -822,7 +822,7 @@ export class Dialog extends ViewWithToolbar implements IDialog {
|
|
|
822
822
|
/**
|
|
823
823
|
* It destroys all objects created for the windows and also includes all the handlers for the window object
|
|
824
824
|
*/
|
|
825
|
-
destruct(): void {
|
|
825
|
+
override destruct(): void {
|
|
826
826
|
if (this.isInDestruct) {
|
|
827
827
|
return;
|
|
828
828
|
}
|
|
@@ -22,7 +22,7 @@ const CLASS_PREVIEW = F_CLASS + '_preview_',
|
|
|
22
22
|
Icon.get('angle-' + right) +
|
|
23
23
|
'</a>';
|
|
24
24
|
|
|
25
|
-
export default (self: FileBrowser) => {
|
|
25
|
+
export default (self: FileBrowser): ((e: DragEvent) => boolean | void) => {
|
|
26
26
|
if (!self.o.contextMenu) {
|
|
27
27
|
return () => {};
|
|
28
28
|
}
|
|
@@ -136,7 +136,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
|
|
|
136
136
|
|
|
137
137
|
private progressHandler = (ignore: number): void => {};
|
|
138
138
|
|
|
139
|
-
onProgress(callback: (percentage: number) => void) {
|
|
139
|
+
onProgress(callback: (percentage: number) => void): void {
|
|
140
140
|
this.progressHandler = callback;
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -183,14 +183,14 @@ export class FileBrowser extends ViewWithToolbar implements IFileBrowser {
|
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
-
OPTIONS!: IFileBrowserOptions;
|
|
186
|
+
override OPTIONS!: IFileBrowserOptions;
|
|
187
187
|
|
|
188
188
|
dialog!: IDialog;
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* Container for set/get value
|
|
192
192
|
*/
|
|
193
|
-
storage!: IStorage;
|
|
193
|
+
override storage!: IStorage;
|
|
194
194
|
|
|
195
195
|
uploader!: IUploader;
|
|
196
196
|
|
|
@@ -439,7 +439,7 @@ export class FileBrowser extends ViewWithToolbar implements IFileBrowser {
|
|
|
439
439
|
self.initUploader(self);
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
destruct(): void {
|
|
442
|
+
override destruct(): void {
|
|
443
443
|
if (this.isInDestruct) {
|
|
444
444
|
return;
|
|
445
445
|
}
|
package/src/modules/table.ts
CHANGED
|
@@ -41,6 +41,7 @@ export class Table extends ViewComponent<IJodit> {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
private selected: Set<HTMLTableCellElement> = new Set();
|
|
44
|
+
|
|
44
45
|
private static selectedByTable: WeakMap<
|
|
45
46
|
HTMLTableElement,
|
|
46
47
|
Set<HTMLTableCellElement>
|
|
@@ -78,6 +79,7 @@ export class Table extends ViewComponent<IJodit> {
|
|
|
78
79
|
|
|
79
80
|
removeSelection(td: HTMLTableCellElement): void {
|
|
80
81
|
this.selected.delete(td);
|
|
82
|
+
|
|
81
83
|
this.recalculateStyles();
|
|
82
84
|
|
|
83
85
|
const table = Dom.closest(td, 'table', this.j.editor);
|
|
@@ -110,7 +112,7 @@ export class Table extends ViewComponent<IJodit> {
|
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
/** @override **/
|
|
113
|
-
destruct(): any {
|
|
115
|
+
override destruct(): any {
|
|
114
116
|
this.selected.clear();
|
|
115
117
|
return super.destruct();
|
|
116
118
|
}
|