jodit 3.15.2 → 3.16.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/.idea/workspace.xml +301 -299
- package/CHANGELOG.MD +88 -7
- package/CONTRIBUTING.md +97 -0
- package/README.md +7 -7
- package/build/jodit.css +38 -32
- package/build/jodit.es2018.css +37 -31
- package/build/jodit.es2018.en.css +37 -31
- package/build/jodit.es2018.en.js +1981 -1393
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +1 -1
- package/build/jodit.es2018.js +2053 -1447
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +1 -1
- package/build/jodit.js +3475 -2625
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +1 -1
- package/build/vdom.css +1 -1
- package/build/vdom.js +32 -20
- package/package.json +13 -13
- package/src/README.md +1 -1
- package/src/config.ts +69 -36
- package/src/core/async/async.ts +46 -24
- package/src/core/constants.ts +1 -0
- package/src/core/decorators/README.md +35 -0
- package/src/core/decorators/cache/cache.ts +1 -1
- package/src/core/decorators/debounce/debounce.ts +20 -9
- package/src/core/decorators/idle/README.md +14 -0
- package/src/core/decorators/idle/idle.ts +1 -1
- package/src/core/decorators/watch/watch.ts +8 -7
- package/src/core/dom/README.md +42 -0
- package/src/core/dom/dom.ts +37 -23
- package/src/core/dom/index.ts +1 -0
- package/src/core/dom/lazy-walker.ts +133 -0
- package/src/core/event-emitter/event-emitter.ts +8 -8
- package/src/core/event-emitter/eventify.ts +73 -0
- package/src/core/event-emitter/index.ts +1 -0
- package/src/core/helpers/html/apply-styles.ts +1 -1
- package/src/core/helpers/html/strip-tags.ts +3 -2
- package/src/core/helpers/string/fuzzy-search-index.ts +58 -0
- package/src/core/helpers/string/i18n.ts +1 -1
- package/src/core/helpers/string/index.ts +3 -2
- package/src/core/helpers/utils/append-script.ts +1 -1
- package/src/core/helpers/utils/css.ts +1 -1
- package/src/core/helpers/utils/selector.ts +1 -1
- package/src/core/helpers/utils/utils.ts +3 -3
- package/src/core/plugin/plugin-system.ts +14 -8
- package/src/core/request/ajax.ts +3 -3
- package/src/core/selection/select.ts +10 -10
- package/src/core/selection/style/api/toggle/toggle-css.ts +5 -2
- package/src/core/selection/style/api/wrap-unwrapped-text.ts +1 -1
- package/src/core/selection/style/apply-style.ts +4 -4
- package/src/core/storage/engines/local-storage-provider.ts +20 -19
- package/src/core/ui/button/button/button.ts +5 -5
- package/src/core/ui/element.ts +2 -2
- package/src/core/ui/form/inputs/input/input.ts +1 -1
- package/src/core/ui/form/inputs/select/select.ts +1 -1
- package/src/core/ui/group/list.ts +2 -2
- package/src/core/vdom/render/index.ts +12 -8
- package/src/core/vdom/v-dom-jodit.ts +1 -1
- package/src/core/view/view.ts +1 -1
- package/src/index.ts +3 -3
- package/src/jodit.ts +72 -55
- package/src/langs/README.md +1 -1
- package/src/langs/ar.js +2 -1
- package/src/langs/cs_cz.js +2 -1
- package/src/langs/de.js +2 -1
- package/src/langs/es.js +2 -1
- package/src/langs/fa.js +2 -1
- package/src/langs/fr.js +2 -1
- package/src/langs/he.js +2 -1
- package/src/langs/hu.js +2 -1
- package/src/langs/id.js +2 -1
- package/src/langs/index.ts +1 -1
- package/src/langs/it.js +2 -1
- package/src/langs/ja.js +2 -1
- package/src/langs/ko.js +2 -1
- package/src/langs/nl.js +2 -1
- package/src/langs/pl.js +2 -1
- package/src/langs/pt_br.js +2 -1
- package/src/langs/ru.js +2 -1
- package/src/langs/tr.js +2 -1
- package/src/langs/zh_cn.js +2 -1
- package/src/langs/zh_tw.js +2 -1
- package/src/modules/dialog/dialog.ts +6 -6
- package/src/modules/dialog/prompt.ts +1 -1
- package/src/modules/file-browser/README.md +2 -2
- package/src/modules/file-browser/builders/context-menu.ts +12 -13
- package/src/modules/file-browser/fetch/load-tree.ts +1 -1
- package/src/modules/file-browser/file-browser.ts +10 -7
- package/src/modules/history/README.md +5 -0
- package/src/modules/{observer → history}/command.ts +5 -5
- package/src/modules/{observer/observer.ts → history/history.ts} +97 -55
- package/src/modules/{observer → history}/snapshot.ts +3 -4
- package/src/modules/{observer → history}/stack.ts +4 -4
- package/src/modules/image-editor/image-editor.ts +8 -8
- package/src/modules/image-editor/templates/form.ts +2 -2
- package/src/modules/index.ts +3 -3
- package/src/modules/status-bar/status-bar.ts +4 -0
- package/src/modules/table/table.ts +2 -2
- package/src/modules/toolbar/button/button.ts +2 -2
- package/src/modules/toolbar/collection/collection.ts +1 -1
- package/src/modules/uploader/helpers/process-old-browser-drag.ts +1 -1
- package/src/modules/uploader/helpers/send-files.ts +1 -1
- package/src/modules/uploader/helpers/send.ts +1 -1
- package/src/modules/uploader/uploader.ts +3 -3
- package/src/modules/widget/color-picker/color-picker.ts +2 -3
- package/src/modules/widget/tabs/tabs.ts +17 -12
- package/src/plugins/add-new-line/add-new-line.ts +8 -8
- package/src/plugins/class-span/class-span.ts +1 -1
- package/src/plugins/clipboard/copy-format.ts +1 -1
- package/src/plugins/clipboard/drag-and-drop-element.ts +4 -2
- package/src/plugins/clipboard/paste/config.ts +19 -3
- package/src/plugins/clipboard/paste/helpers.ts +17 -50
- package/src/plugins/clipboard/paste/interface.ts +6 -0
- package/src/plugins/clipboard/paste/paste.ts +22 -8
- package/src/plugins/clipboard/paste-from-word/config.ts +17 -0
- package/src/plugins/clipboard/paste-from-word/paste-from-word.ts +15 -6
- package/src/plugins/clipboard/paste-storage/paste-storage.ts +6 -6
- package/src/plugins/color/color.ts +2 -2
- package/src/plugins/error-messages/error-messages.ts +2 -2
- package/src/plugins/fix/clean-html/README.md +26 -0
- package/src/plugins/fix/{clean-html.ts → clean-html/clean-html.ts} +59 -142
- package/src/plugins/fix/clean-html/config.ts +106 -0
- package/src/plugins/fix/index.ts +12 -0
- package/src/plugins/fix/wrap-nodes/README.md +27 -0
- package/src/plugins/fix/wrap-nodes/config.ts +24 -0
- package/src/plugins/fix/{wrap-text-nodes.ts → wrap-nodes/wrap-nodes.ts} +9 -4
- package/src/plugins/focus/focus.ts +1 -1
- package/src/plugins/format-block/format-block.ts +1 -1
- package/src/plugins/fullsize/fullsize.ts +4 -4
- package/src/plugins/iframe/iframe.ts +3 -3
- package/src/plugins/image/image-properties/image-properties.ts +12 -13
- package/src/plugins/indent/indent.ts +1 -1
- package/src/plugins/index.ts +2 -2
- package/src/plugins/inline-popup/config/items/a.ts +2 -2
- package/src/plugins/inline-popup/config/items/cells.ts +11 -11
- package/src/plugins/inline-popup/config/items/iframe.ts +1 -1
- package/src/plugins/inline-popup/config/items/img.ts +7 -7
- package/src/plugins/inline-popup/inline-popup.ts +5 -5
- package/src/plugins/keyboard/backspace/backspace.ts +1 -1
- package/src/plugins/keyboard/backspace/cases/check-join-neighbors.ts +1 -1
- package/src/plugins/keyboard/helpers.ts +1 -1
- package/src/plugins/keyboard/hotkeys.ts +1 -1
- package/src/plugins/limit/limit.ts +3 -3
- package/src/plugins/line-height/line-height.ts +1 -1
- package/src/plugins/link/link.ts +8 -8
- package/src/plugins/link/template.ts +2 -2
- package/src/plugins/media/file.ts +1 -1
- package/src/plugins/media/media.ts +1 -1
- package/src/plugins/media/video/config.ts +1 -1
- package/src/plugins/mobile/config.ts +1 -1
- package/src/plugins/mobile/mobile.ts +1 -1
- package/src/plugins/ordered-list/config.ts +61 -0
- package/src/plugins/ordered-list/ordered-list.ts +3 -153
- package/src/plugins/placeholder/placeholder.ts +3 -3
- package/src/plugins/print/helpers.ts +14 -7
- package/src/plugins/print/index.ts +1 -1
- package/src/plugins/print/{preview.less → preview/preview.less} +1 -1
- package/src/plugins/print/{preview.ts → preview/preview.ts} +9 -8
- package/src/plugins/print/print.ts +19 -10
- package/src/plugins/redo-undo/redo-undo.ts +3 -3
- package/src/plugins/resizer/resizer.ts +11 -11
- package/src/plugins/search/README.md +38 -0
- package/src/plugins/search/config.ts +82 -0
- package/src/plugins/search/helpers/index.ts +12 -0
- package/src/plugins/search/helpers/sentence-finder.ts +103 -0
- package/src/plugins/search/helpers/wrap-ranges-texts-in-tmp-span.ts +120 -0
- package/src/plugins/search/search.ts +269 -615
- package/src/plugins/search/ui/search.less +159 -0
- package/src/plugins/search/ui/search.ts +256 -0
- package/src/plugins/select/select.ts +1 -1
- package/src/plugins/size/config.ts +8 -8
- package/src/plugins/size/resize-handler.ts +3 -3
- package/src/plugins/size/size.ts +4 -4
- package/src/plugins/source/editor/engines/ace.ts +9 -9
- package/src/plugins/source/editor/engines/area.ts +3 -3
- package/src/plugins/source/source.ts +6 -6
- package/src/plugins/spellcheck/README.md +1 -0
- package/src/plugins/spellcheck/config.ts +34 -0
- package/src/plugins/spellcheck/spellcheck.svg +4 -0
- package/src/plugins/spellcheck/spellcheck.ts +48 -0
- package/src/plugins/sticky/sticky.ts +3 -3
- package/src/plugins/table/resize-cells.ts +11 -11
- package/src/plugins/table/select-cells.ts +2 -2
- package/src/plugins/tooltip/tooltip.ts +1 -1
- package/src/plugins/xpath/xpath.ts +8 -8
- package/src/polyfills.ts +5 -4
- package/src/styles/icons/README.md +2 -2
- package/src/types/async.d.ts +12 -2
- package/src/types/core.ts +1 -1
- package/src/types/events.d.ts +6 -2
- package/src/types/file-browser.d.ts +1 -2
- package/{types/types/observer.d.ts → src/types/history.d.ts} +11 -7
- package/src/types/index.d.ts +1 -1
- package/src/types/jodit.d.ts +12 -4
- package/src/types/toolbar.d.ts +5 -5
- package/src/types/types.d.ts +11 -4
- package/types/config.d.ts +68 -35
- package/types/core/async/async.d.ts +11 -4
- package/types/core/constants.d.ts +1 -0
- package/types/core/dom/dom.d.ts +3 -5
- package/types/core/dom/index.d.ts +1 -0
- package/types/core/dom/lazy-walker.d.ts +37 -0
- package/types/core/event-emitter/eventify.d.ts +39 -0
- package/types/core/event-emitter/index.d.ts +1 -0
- package/types/core/helpers/string/fuzzy-search-index.d.ts +10 -0
- package/types/core/helpers/string/i18n.d.ts +1 -1
- package/types/core/helpers/string/index.d.ts +3 -2
- package/types/core/helpers/utils/utils.d.ts +1 -1
- package/types/core/selection/select.d.ts +1 -1
- package/types/core/ui/button/button/button.d.ts +4 -4
- package/types/core/view/view.d.ts +1 -1
- package/types/jodit.d.ts +19 -6
- package/types/modules/{observer → history}/command.d.ts +4 -4
- package/types/modules/{observer/observer.d.ts → history/history.d.ts} +17 -9
- package/types/modules/{observer → history}/snapshot.d.ts +1 -1
- package/types/modules/{observer → history}/stack.d.ts +3 -3
- package/types/modules/image-editor/image-editor.d.ts +1 -1
- package/types/modules/index.d.ts +3 -3
- package/types/modules/toolbar/button/button.d.ts +2 -5
- package/types/modules/widget/tabs/tabs.d.ts +1 -1
- package/types/plugins/class-span/class-span.d.ts +1 -1
- package/types/plugins/clipboard/paste/config.d.ts +8 -0
- package/types/plugins/clipboard/paste/helpers.d.ts +2 -2
- package/types/plugins/clipboard/paste/interface.d.ts +5 -0
- package/types/plugins/clipboard/paste-from-word/config.d.ts +5 -0
- package/types/plugins/clipboard/paste-from-word/paste-from-word.d.ts +3 -2
- package/types/plugins/fix/clean-html/clean-html.d.ts +70 -0
- package/types/plugins/fix/{clean-html.d.ts → clean-html/config.d.ts} +2 -57
- package/types/plugins/fix/index.d.ts +10 -0
- package/types/plugins/fix/wrap-nodes/config.d.ts +16 -0
- package/types/plugins/fix/{wrap-text-nodes.d.ts → wrap-nodes/wrap-nodes.d.ts} +5 -2
- package/types/plugins/fullsize/fullsize.d.ts +2 -2
- package/types/plugins/index.d.ts +2 -2
- package/types/plugins/ordered-list/config.d.ts +6 -0
- package/types/plugins/ordered-list/ordered-list.d.ts +1 -1
- package/types/plugins/print/helpers.d.ts +2 -2
- package/types/plugins/print/index.d.ts +1 -1
- package/types/plugins/print/{preview.d.ts → preview/preview.d.ts} +1 -1
- package/types/plugins/search/config.d.ts +36 -0
- package/types/plugins/search/helpers/index.d.ts +10 -0
- package/types/plugins/search/helpers/sentence-finder.d.ts +21 -0
- package/types/plugins/search/helpers/wrap-ranges-texts-in-tmp-span.d.ts +14 -0
- package/types/plugins/search/search.d.ts +25 -39
- package/types/plugins/search/ui/search.d.ts +37 -0
- package/types/plugins/spellcheck/config.d.ts +15 -0
- package/types/plugins/spellcheck/spellcheck.d.ts +19 -0
- package/types/plugins/sticky/sticky.d.ts +2 -2
- package/types/types/async.d.ts +12 -2
- package/types/types/core.d.ts +1 -1
- package/types/types/core.ts +1 -1
- package/types/types/events.d.ts +6 -2
- package/types/types/file-browser.d.ts +1 -2
- package/{src/types/observer.d.ts → types/types/history.d.ts} +11 -7
- package/types/types/index.d.ts +1 -1
- package/types/types/jodit.d.ts +12 -4
- package/types/types/toolbar.d.ts +5 -5
- package/types/types/types.d.ts +11 -4
- package/src/modules/observer/README.md +0 -0
- package/src/plugins/search/search.less +0 -152
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* [[include:modules/
|
|
7
|
+
* [[include:modules/history/README.md]]
|
|
8
8
|
* @packageDocumentation
|
|
9
|
-
* @module modules/
|
|
9
|
+
* @module modules/history
|
|
10
10
|
*/
|
|
11
|
-
import type { IJodit, SnapshotType,
|
|
11
|
+
import type { IJodit, SnapshotType, IHistory, ISnapshot, IDestructible } from 'jodit/types';
|
|
12
12
|
import { ViewComponent } from 'jodit/core/component';
|
|
13
13
|
import { Snapshot } from './snapshot';
|
|
14
14
|
import { Stack } from './stack';
|
|
15
15
|
declare module 'jodit/config' {
|
|
16
16
|
interface Config {
|
|
17
|
-
|
|
17
|
+
history: {
|
|
18
|
+
enable: boolean;
|
|
18
19
|
/**
|
|
19
20
|
* Limit of history length
|
|
20
21
|
*/
|
|
@@ -24,25 +25,31 @@ declare module 'jodit/config' {
|
|
|
24
25
|
*/
|
|
25
26
|
timeout: number;
|
|
26
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Instead use `history`
|
|
30
|
+
*/
|
|
31
|
+
observer: this['history'];
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
35
|
* The module monitors the status of the editor and creates / deletes the required number of Undo / Redo shots .
|
|
31
36
|
*/
|
|
32
|
-
export declare class
|
|
37
|
+
export declare class History extends ViewComponent<IJodit> implements IHistory {
|
|
33
38
|
/** @override */
|
|
34
39
|
className(): string;
|
|
35
40
|
private __startValue;
|
|
36
41
|
protected get startValue(): SnapshotType;
|
|
37
42
|
protected set startValue(value: SnapshotType);
|
|
38
|
-
stack
|
|
39
|
-
snapshot:
|
|
43
|
+
private readonly stack;
|
|
44
|
+
snapshot: ISnapshot & IDestructible;
|
|
45
|
+
constructor(editor: IJodit, stack?: Stack, snapshot?: Snapshot);
|
|
40
46
|
private updateTick;
|
|
41
47
|
upTick(): void;
|
|
42
48
|
/**
|
|
43
49
|
* Push new command in stack on some changes
|
|
44
50
|
*/
|
|
45
51
|
private onChange;
|
|
52
|
+
processChanges(): void;
|
|
46
53
|
/**
|
|
47
54
|
* Update history stack
|
|
48
55
|
*/
|
|
@@ -51,13 +58,14 @@ export declare class Observer extends ViewComponent<IJodit> implements IObserver
|
|
|
51
58
|
* Return state of the WYSIWYG editor to step back
|
|
52
59
|
*/
|
|
53
60
|
redo(): void;
|
|
61
|
+
canRedo(): boolean;
|
|
54
62
|
/**
|
|
55
63
|
* Return the state of the WYSIWYG editor to step forward
|
|
56
64
|
*/
|
|
57
65
|
undo(): void;
|
|
66
|
+
canUndo(): boolean;
|
|
58
67
|
clear(): void;
|
|
59
|
-
|
|
68
|
+
get length(): number;
|
|
60
69
|
private fireChangeStack;
|
|
61
|
-
constructor(editor: IJodit);
|
|
62
70
|
destruct(): void;
|
|
63
71
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* @module modules/
|
|
7
|
+
* @module modules/history
|
|
8
8
|
*/
|
|
9
9
|
import type { IJodit, ISnapshot, SnapshotType } from 'jodit/types';
|
|
10
10
|
import { ViewComponent } from 'jodit/core/component';
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* @module modules/
|
|
7
|
+
* @module modules/history
|
|
8
8
|
*/
|
|
9
9
|
import type { CanUndef, IStack } from 'jodit/types';
|
|
10
10
|
import type { Command } from './command';
|
|
11
11
|
export declare class Stack implements IStack {
|
|
12
|
-
private size;
|
|
13
|
-
private commands;
|
|
12
|
+
private readonly size;
|
|
13
|
+
private readonly commands;
|
|
14
14
|
private stackPosition;
|
|
15
15
|
constructor(size: number);
|
|
16
16
|
get length(): number;
|
package/types/modules/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export * from '../core/request';
|
|
|
14
14
|
export { Component, ViewComponent, STATUSES } from '../core/component';
|
|
15
15
|
export { ContextMenu } from './context-menu/context-menu';
|
|
16
16
|
export * from './dialog/';
|
|
17
|
-
export { Dom } from '../core/dom';
|
|
17
|
+
export { Dom, LazyWalker } from '../core/dom';
|
|
18
18
|
export { Plugin } from '../core/plugin';
|
|
19
19
|
export { Create } from '../core/create';
|
|
20
20
|
export { UIElement, UIButton, Popup, UISeparator, UIGroup, UIList, UIForm, UIInput, UITextArea, UICheckbox, UIBlock, ProgressBar, Icon } from '../core/ui';
|
|
@@ -24,9 +24,9 @@ export * from './file-browser';
|
|
|
24
24
|
import * as Helpers from '../core/helpers/';
|
|
25
25
|
export { Helpers };
|
|
26
26
|
export { ImageEditor } from './image-editor/image-editor';
|
|
27
|
-
export {
|
|
27
|
+
export { History } from './history/history';
|
|
28
|
+
export { Snapshot } from './history/snapshot';
|
|
28
29
|
export { Select, CommitStyle } from '../core/selection';
|
|
29
|
-
export { Snapshot } from './observer/snapshot';
|
|
30
30
|
export { StatusBar } from './status-bar/status-bar';
|
|
31
31
|
export { Table } from './table/table';
|
|
32
32
|
export { ToolbarEditorCollection } from './toolbar/collection/editor-collection';
|
|
@@ -16,7 +16,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
16
16
|
readonly target: Nullable<HTMLElement>;
|
|
17
17
|
/** @override */
|
|
18
18
|
className(): string;
|
|
19
|
-
state: {
|
|
19
|
+
readonly state: {
|
|
20
20
|
theme: string;
|
|
21
21
|
currentValue: string;
|
|
22
22
|
hasTrigger: boolean;
|
|
@@ -27,9 +27,6 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
27
27
|
type: "button" | "submit";
|
|
28
28
|
disabled: boolean;
|
|
29
29
|
activated: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Get parent toolbar
|
|
32
|
-
*/
|
|
33
30
|
icon: import("jodit/types").IUIIconState;
|
|
34
31
|
text: string;
|
|
35
32
|
tooltip: string;
|
|
@@ -59,7 +56,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
|
|
|
59
56
|
/** @override */
|
|
60
57
|
protected onChangeText(): void;
|
|
61
58
|
/** @override */
|
|
62
|
-
onChangeTabIndex(): void;
|
|
59
|
+
protected onChangeTabIndex(): void;
|
|
63
60
|
protected onChangeTooltip(): void;
|
|
64
61
|
/** @override */
|
|
65
62
|
protected createContainer(): HTMLElement;
|
|
@@ -33,6 +33,6 @@ export interface TabOption {
|
|
|
33
33
|
* ]);
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export declare const TabsWidget: (
|
|
36
|
+
export declare const TabsWidget: (jodit: IJodit, tabs: TabOption[], state?: {
|
|
37
37
|
__activeTab: string;
|
|
38
38
|
} | undefined) => HTMLDivElement;
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/clipboard/paste
|
|
8
|
+
*/
|
|
9
|
+
import type { IUIOption } from 'jodit/types';
|
|
6
10
|
import type { InsertMode } from 'jodit/plugins/clipboard/paste/interface';
|
|
7
11
|
declare module 'jodit/config' {
|
|
8
12
|
interface Config {
|
|
@@ -32,5 +36,9 @@ declare module 'jodit/config' {
|
|
|
32
36
|
* Draggable elements
|
|
33
37
|
*/
|
|
34
38
|
draggableTags: string | string[];
|
|
39
|
+
/**
|
|
40
|
+
* Options when inserting HTML string
|
|
41
|
+
*/
|
|
42
|
+
pasteHTMLActionList: IUIOption[];
|
|
35
43
|
}
|
|
36
44
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugins/clipboard/paste
|
|
8
8
|
*/
|
|
9
|
-
import type { IJodit, Nullable } from 'jodit/types';
|
|
9
|
+
import type { IJodit, IUIOption, Nullable } from 'jodit/types';
|
|
10
10
|
import type { PasteEvent, InsertMode } from 'jodit/plugins/clipboard/paste/interface';
|
|
11
11
|
import { Dialog } from 'jodit/modules';
|
|
12
12
|
/**
|
|
@@ -24,4 +24,4 @@ export declare function getAllTypes(dt: DataTransfer): string;
|
|
|
24
24
|
/**
|
|
25
25
|
* Make command dialog
|
|
26
26
|
*/
|
|
27
|
-
export declare function askInsertTypeDialog(jodit: IJodit, msg: string, title: string, callback: (yes: InsertMode) => void,
|
|
27
|
+
export declare function askInsertTypeDialog(jodit: IJodit, msg: string, title: string, callback: (yes: InsertMode) => void, buttonList: IUIOption[]): Dialog | void;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module plugins/clipboard/paste-from-word
|
|
8
8
|
*/
|
|
9
9
|
import type { InsertMode } from 'jodit/plugins/clipboard/paste/interface';
|
|
10
|
+
import type { IUIOption } from 'jodit/types';
|
|
10
11
|
declare module 'jodit/config' {
|
|
11
12
|
interface Config {
|
|
12
13
|
/**
|
|
@@ -27,5 +28,9 @@ declare module 'jodit/config' {
|
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
30
|
defaultActionOnPasteFromWord: InsertMode | null;
|
|
31
|
+
/**
|
|
32
|
+
* Options when inserting data from Word
|
|
33
|
+
*/
|
|
34
|
+
pasteFromWordActionList: IUIOption[];
|
|
30
35
|
}
|
|
31
36
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import type { IJodit } from 'jodit/types';
|
|
12
12
|
import type { PasteEvent, InsertMode } from 'jodit/plugins/clipboard/paste/interface';
|
|
13
13
|
import { Plugin } from 'jodit/core/plugin';
|
|
14
|
+
import type { PastedData } from 'jodit/plugins/clipboard/paste/interface';
|
|
14
15
|
import './config';
|
|
15
16
|
export declare class PasteFromWord extends Plugin {
|
|
16
17
|
protected afterInit(jodit: IJodit): void;
|
|
@@ -18,9 +19,9 @@ export declare class PasteFromWord extends Plugin {
|
|
|
18
19
|
/**
|
|
19
20
|
* Try if text is Word's document fragment and try process this
|
|
20
21
|
*/
|
|
21
|
-
protected processWordHTML(e: PasteEvent, text: string): boolean;
|
|
22
|
+
protected processWordHTML(e: PasteEvent, text: string, texts: PastedData): boolean;
|
|
22
23
|
/**
|
|
23
24
|
* Clear extra styles and tags from Word's pasted text
|
|
24
25
|
*/
|
|
25
|
-
protected insertFromWordByType(e: PasteEvent, html: string, insertType: InsertMode): void;
|
|
26
|
+
protected insertFromWordByType(e: PasteEvent, html: string, insertType: InsertMode, texts: PastedData): void;
|
|
26
27
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* [[include:src/plugins/fix/clean-html/README.md]]
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
* @module plugins/fix/clean-html
|
|
10
|
+
*/
|
|
11
|
+
import type { IJodit } from 'jodit/types';
|
|
12
|
+
import { Plugin } from 'jodit/core/plugin';
|
|
13
|
+
import './config';
|
|
14
|
+
/**
|
|
15
|
+
* Clean HTML after removeFormat and insertHorizontalRule command
|
|
16
|
+
*/
|
|
17
|
+
export declare class cleanHtml extends Plugin {
|
|
18
|
+
/** @override */
|
|
19
|
+
buttons: Plugin['buttons'];
|
|
20
|
+
/** @override */
|
|
21
|
+
protected afterInit(jodit: IJodit): void;
|
|
22
|
+
/**
|
|
23
|
+
* Replaces an element with a newer one if specified in the configuration match
|
|
24
|
+
*/
|
|
25
|
+
private replaceIfMatched;
|
|
26
|
+
/**
|
|
27
|
+
* Clean HTML code on every change
|
|
28
|
+
*/
|
|
29
|
+
private onChangeCleanHTML;
|
|
30
|
+
private currentSelectionNode;
|
|
31
|
+
private walker;
|
|
32
|
+
protected startWalker(): void;
|
|
33
|
+
private visitNode;
|
|
34
|
+
private allowEdit;
|
|
35
|
+
private static getHash;
|
|
36
|
+
private allowTagsHash;
|
|
37
|
+
private denyTagsHash;
|
|
38
|
+
/**
|
|
39
|
+
* Remove invisible chars if node has another chars
|
|
40
|
+
*/
|
|
41
|
+
private onKeyUpCleanUp;
|
|
42
|
+
private beforeCommand;
|
|
43
|
+
/**
|
|
44
|
+
* Command: removeFormat
|
|
45
|
+
*/
|
|
46
|
+
private onRemoveFormat;
|
|
47
|
+
/**
|
|
48
|
+
* For collapsed selection move cursor outside or split inline block
|
|
49
|
+
*/
|
|
50
|
+
private removeFormatForCollapsedSelection;
|
|
51
|
+
/**
|
|
52
|
+
* Element has inline display mode
|
|
53
|
+
*/
|
|
54
|
+
private isInlineBlock;
|
|
55
|
+
/**
|
|
56
|
+
* Remove formatting for all selected elements
|
|
57
|
+
*/
|
|
58
|
+
private removeFormatForSelection;
|
|
59
|
+
private isRemovableNode;
|
|
60
|
+
private static hasNotEmptyTextSibling;
|
|
61
|
+
/**
|
|
62
|
+
* Event handler when manually assigning a value to the HTML editor.
|
|
63
|
+
*/
|
|
64
|
+
protected onBeforeSetNativeEditorValue(data: {
|
|
65
|
+
value: string;
|
|
66
|
+
}): boolean;
|
|
67
|
+
protected onSafeHTML(sandBox: HTMLElement): void;
|
|
68
|
+
/** @override */
|
|
69
|
+
protected beforeDestruct(): void;
|
|
70
|
+
}
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* @module plugins/fix
|
|
7
|
+
* @module plugins/fix/clean-html
|
|
8
8
|
*/
|
|
9
|
-
import type { HTMLTagNames, IDictionary
|
|
10
|
-
import { Plugin } from 'jodit/core/plugin';
|
|
9
|
+
import type { HTMLTagNames, IDictionary } from 'jodit/types';
|
|
11
10
|
declare module 'jodit/config' {
|
|
12
11
|
interface Config {
|
|
13
12
|
cleanHTML: {
|
|
@@ -76,57 +75,3 @@ declare module 'jodit/config' {
|
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
77
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Clean HTML after removeFormat and insertHorizontalRule command
|
|
81
|
-
*/
|
|
82
|
-
export declare class cleanHtml extends Plugin {
|
|
83
|
-
/** @override */
|
|
84
|
-
buttons: Plugin['buttons'];
|
|
85
|
-
/** @override */
|
|
86
|
-
protected afterInit(jodit: IJodit): void;
|
|
87
|
-
/**
|
|
88
|
-
* Replaces an element with a newer one if specified in the configuration match
|
|
89
|
-
*/
|
|
90
|
-
private replaceIfMatched;
|
|
91
|
-
/**
|
|
92
|
-
* Clean HTML code on every change
|
|
93
|
-
*/
|
|
94
|
-
private onChangeCleanHTML;
|
|
95
|
-
private allowEdit;
|
|
96
|
-
private visitNode;
|
|
97
|
-
private static getHash;
|
|
98
|
-
private allowTagsHash;
|
|
99
|
-
private denyTagsHash;
|
|
100
|
-
/**
|
|
101
|
-
* Remove invisible chars if node has another chars
|
|
102
|
-
*/
|
|
103
|
-
private onKeyUpCleanUp;
|
|
104
|
-
private beforeCommand;
|
|
105
|
-
/**
|
|
106
|
-
* Command: removeFormat
|
|
107
|
-
*/
|
|
108
|
-
private onRemoveFormat;
|
|
109
|
-
/**
|
|
110
|
-
* For collapsed selection move cursor outside or split inline block
|
|
111
|
-
*/
|
|
112
|
-
private removeFormatForCollapsedSelection;
|
|
113
|
-
/**
|
|
114
|
-
* Element has inline display mode
|
|
115
|
-
*/
|
|
116
|
-
private isInlineBlock;
|
|
117
|
-
/**
|
|
118
|
-
* Remove formatting for all selected elements
|
|
119
|
-
*/
|
|
120
|
-
private removeFormatForSelection;
|
|
121
|
-
private isRemovableNode;
|
|
122
|
-
private static hasNotEmptyTextSibling;
|
|
123
|
-
/**
|
|
124
|
-
* Event handler when manually assigning a value to the HTML editor.
|
|
125
|
-
*/
|
|
126
|
-
protected onBeforeSetNativeEditorValue(data: {
|
|
127
|
-
value: string;
|
|
128
|
-
}): boolean;
|
|
129
|
-
protected onSafeHTML(sandBox: HTMLElement): void;
|
|
130
|
-
/** @override */
|
|
131
|
-
protected beforeDestruct(): void;
|
|
132
|
-
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/fix
|
|
8
|
+
*/
|
|
9
|
+
export * from './clean-html/clean-html';
|
|
10
|
+
export * from './wrap-nodes/wrap-nodes';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/fix/wrap-nodes
|
|
8
|
+
*/
|
|
9
|
+
import type { HTMLTagNames } from 'jodit/types';
|
|
10
|
+
declare module 'jodit/config' {
|
|
11
|
+
interface Config {
|
|
12
|
+
wrapNodes: {
|
|
13
|
+
exclude: HTMLTagNames[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -4,14 +4,17 @@
|
|
|
4
4
|
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* [[include:plugins/fix/wrap-nodes/README.md]]
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
* @module plugins/fix/wrap-nodes
|
|
8
10
|
*/
|
|
9
11
|
import type { IJodit } from 'jodit/types';
|
|
10
12
|
import { Plugin } from 'jodit/core/plugin';
|
|
13
|
+
import './config';
|
|
11
14
|
/**
|
|
12
15
|
* Wrap single text nodes in block wrapper
|
|
13
16
|
*/
|
|
14
|
-
export declare class
|
|
17
|
+
export declare class WrapNodes extends Plugin {
|
|
15
18
|
/** @override **/
|
|
16
19
|
protected afterInit(jodit: IJodit): void;
|
|
17
20
|
/** @override **/
|
|
@@ -14,13 +14,13 @@ declare module 'jodit/config' {
|
|
|
14
14
|
* Open WYSIWYG in full screen
|
|
15
15
|
* @example
|
|
16
16
|
* ```javascript
|
|
17
|
-
* var editor =
|
|
17
|
+
* var editor = Jodit.make({
|
|
18
18
|
* fullsize: true // fullsize editor
|
|
19
19
|
* });
|
|
20
20
|
* ```
|
|
21
21
|
* @example
|
|
22
22
|
* ```javascript
|
|
23
|
-
* var editor =
|
|
23
|
+
* var editor = Jodit.make();
|
|
24
24
|
* editor.e.fire('toggleFullSize');
|
|
25
25
|
* editor.e.fire('toggleFullSize', true); // fullsize
|
|
26
26
|
* editor.e.fire('toggleFullSize', false); // usual mode
|
package/types/plugins/index.d.ts
CHANGED
|
@@ -14,8 +14,7 @@ export { focus } from './focus/focus';
|
|
|
14
14
|
export { classSpan } from './class-span/class-span';
|
|
15
15
|
export { Backspace } from './keyboard/backspace/backspace';
|
|
16
16
|
export { bold } from './bold/bold';
|
|
17
|
-
export { cleanHtml } from './fix
|
|
18
|
-
export { WrapTextNodes } from './fix/wrap-text-nodes';
|
|
17
|
+
export { WrapNodes, cleanHtml } from './fix';
|
|
19
18
|
export { copyFormat, clipboard, paste, pasteStorage, PasteFromWord } from './clipboard';
|
|
20
19
|
export { color } from './color/color';
|
|
21
20
|
export { DragAndDrop } from './clipboard/drag-and-drop';
|
|
@@ -49,6 +48,7 @@ export { size, resizeHandler } from './size';
|
|
|
49
48
|
export { source } from './source';
|
|
50
49
|
export { stat } from './stat/stat';
|
|
51
50
|
export { sticky } from './sticky/sticky';
|
|
51
|
+
export { spellcheck } from './spellcheck/spellcheck';
|
|
52
52
|
export { symbols } from './symbols/symbols';
|
|
53
53
|
export * from './table';
|
|
54
54
|
export { tooltip } from './tooltip/tooltip';
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { IJodit } from 'jodit/types';
|
|
10
10
|
import { Plugin } from 'jodit/core/plugin';
|
|
11
|
+
import './config';
|
|
11
12
|
/**
|
|
12
13
|
* Process commands insertOrderedList and insertUnOrderedList
|
|
13
14
|
*/
|
|
@@ -17,4 +18,3 @@ export declare class orderedList extends Plugin {
|
|
|
17
18
|
private onCommand;
|
|
18
19
|
protected beforeDestruct(jodit: IJodit): void;
|
|
19
20
|
}
|
|
20
|
-
export declare function orderedList1(editor: IJodit): void;
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module plugins/print
|
|
8
8
|
*/
|
|
9
|
-
import type { IJodit } from 'jodit/types';
|
|
9
|
+
import type { IJodit, Nullable } from 'jodit/types';
|
|
10
10
|
/**
|
|
11
11
|
* Generates a copy of an HTML document, resizes images, executes JS
|
|
12
12
|
*
|
|
13
13
|
* @event beforePreviewBox(string | undefined, 'pt' | 'px' | '')
|
|
14
14
|
* @event afterPreviewBox(HTMLElement)
|
|
15
15
|
*/
|
|
16
|
-
export declare function previewBox(editor: IJodit, defaultValue?: string, points?: 'pt' | 'px' | ''): HTMLElement;
|
|
16
|
+
export declare function previewBox(editor: IJodit, defaultValue?: string, points?: 'pt' | 'px' | '', container?: Nullable<HTMLElement>): HTMLElement;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/search
|
|
8
|
+
*/
|
|
9
|
+
import type { FuzzySearch } from 'jodit/types';
|
|
10
|
+
declare module 'jodit/config' {
|
|
11
|
+
interface Config {
|
|
12
|
+
/**
|
|
13
|
+
* Enable custom search plugin
|
|
14
|
+
* 
|
|
15
|
+
*/
|
|
16
|
+
useSearch: boolean;
|
|
17
|
+
search: {
|
|
18
|
+
lazyIdleTimeout: number;
|
|
19
|
+
/**
|
|
20
|
+
* Function to search for a string within a substring. The default implementation is [[fuzzySearchIndex]]
|
|
21
|
+
* But you can write your own. It must implement the [[FuzzySearch]] interface.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* Jodit.make('#editor', {
|
|
25
|
+
* search: {
|
|
26
|
+
* fuzzySearch: (needle, haystack, offset) => {
|
|
27
|
+
* return [haystack.indexOf(needle, offset), needle.length];
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
fuzzySearch?: FuzzySearch;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/search
|
|
8
|
+
*/
|
|
9
|
+
export * from './sentence-finder';
|
|
10
|
+
export * from './wrap-ranges-texts-in-tmp-span';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/search
|
|
8
|
+
*/
|
|
9
|
+
import type { FuzzySearch, ISelectionRange, Nullable } from 'jodit/types';
|
|
10
|
+
export interface State {
|
|
11
|
+
query: string;
|
|
12
|
+
sentence: SentenceFinder;
|
|
13
|
+
}
|
|
14
|
+
export declare class SentenceFinder {
|
|
15
|
+
private readonly searchIndex;
|
|
16
|
+
private queue;
|
|
17
|
+
private value;
|
|
18
|
+
constructor(searchIndex?: FuzzySearch);
|
|
19
|
+
add(node: Text): void;
|
|
20
|
+
ranges(needle: string, position?: number): Nullable<ISelectionRange[]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/search
|
|
8
|
+
*/
|
|
9
|
+
import type { ICreate, ISelectionRange } from 'jodit/types';
|
|
10
|
+
export declare function wrapRangesTextsInTmpSpan(rng: ISelectionRange, restRanges: ISelectionRange[], ci: ICreate, root: HTMLElement): void;
|
|
11
|
+
export declare function getSelectionWrappers(root: HTMLElement): HTMLElement[];
|
|
12
|
+
export declare function clearSelectionWrappers(root: HTMLElement): void;
|
|
13
|
+
export declare function clearSelectionWrappersFromHTML(root: string): string;
|
|
14
|
+
export declare function isSelectionWrapper(node: unknown): boolean;
|