jodit 4.18.12 → 4.19.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 +46 -0
- package/es2015/jodit.css +10 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +18 -12
- package/es2015/jodit.js +2464 -300
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +18 -12
- 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 +18 -12
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +18 -12
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +10 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +26 -19
- package/es2021/jodit.js +2426 -297
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +26 -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 +10 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +29 -22
- package/es2021.en/jodit.js +2400 -271
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +29 -22
- 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 +11 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +2823 -360
- 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/config.d.ts +44 -1
- package/esm/config.js +2 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.js +4 -2
- package/esm/core/event-emitter/event-emitter.js +1 -0
- package/esm/core/helpers/utils/align.d.ts +6 -1
- package/esm/core/helpers/utils/align.js +22 -12
- package/esm/core/helpers/utils/image-caption.d.ts +24 -0
- package/esm/core/helpers/utils/image-caption.js +43 -0
- package/esm/core/helpers/utils/index.d.ts +1 -0
- package/esm/core/helpers/utils/index.js +1 -0
- package/esm/core/selection/selection.d.ts +3 -0
- package/esm/core/selection/selection.js +20 -5
- package/esm/core/ui/helpers/focus-form-field.d.ts +12 -0
- package/esm/core/ui/helpers/focus-form-field.js +21 -0
- package/esm/jodit.js +18 -2
- package/esm/langs/ar.d.ts +2 -0
- package/esm/langs/ar.js +2 -0
- package/esm/langs/az.d.ts +2 -0
- package/esm/langs/az.js +2 -0
- package/esm/langs/cs_cz.d.ts +2 -0
- package/esm/langs/cs_cz.js +2 -0
- package/esm/langs/de.d.ts +2 -0
- package/esm/langs/de.js +2 -0
- package/esm/langs/es.d.ts +2 -0
- package/esm/langs/es.js +2 -0
- package/esm/langs/fa.d.ts +2 -0
- package/esm/langs/fa.js +2 -0
- package/esm/langs/fi.d.ts +2 -0
- package/esm/langs/fi.js +2 -0
- package/esm/langs/fr.d.ts +2 -0
- package/esm/langs/fr.js +2 -0
- package/esm/langs/he.d.ts +2 -0
- package/esm/langs/he.js +2 -0
- package/esm/langs/hu.d.ts +2 -0
- package/esm/langs/hu.js +2 -0
- package/esm/langs/id.d.ts +2 -0
- package/esm/langs/id.js +2 -0
- package/esm/langs/it.d.ts +2 -0
- package/esm/langs/it.js +2 -0
- package/esm/langs/ja.d.ts +2 -0
- package/esm/langs/ja.js +2 -0
- package/esm/langs/ko.d.ts +2 -0
- package/esm/langs/ko.js +2 -0
- package/esm/langs/mn.d.ts +2 -0
- package/esm/langs/mn.js +2 -0
- package/esm/langs/nl.d.ts +2 -0
- package/esm/langs/nl.js +2 -0
- package/esm/langs/no.d.ts +2 -0
- package/esm/langs/no.js +2 -0
- package/esm/langs/pl.d.ts +2 -0
- package/esm/langs/pl.js +2 -0
- package/esm/langs/pt_br.d.ts +2 -0
- package/esm/langs/pt_br.js +2 -0
- package/esm/langs/ru.d.ts +2 -0
- package/esm/langs/ru.js +2 -0
- package/esm/langs/sk.d.ts +2 -0
- package/esm/langs/sk.js +2 -0
- package/esm/langs/sv.d.ts +2 -0
- package/esm/langs/sv.js +2 -0
- package/esm/langs/tr.d.ts +2 -0
- package/esm/langs/tr.js +2 -0
- package/esm/langs/ua.d.ts +2 -0
- package/esm/langs/ua.js +2 -0
- package/esm/langs/zh_cn.d.ts +2 -0
- package/esm/langs/zh_cn.js +2 -0
- package/esm/langs/zh_tw.d.ts +2 -0
- package/esm/langs/zh_tw.js +2 -0
- package/esm/modules/table/table.d.ts +27 -0
- package/esm/modules/table/table.js +110 -2
- package/esm/modules/toolbar/button/button.js +11 -3
- package/esm/modules/uploader/helpers/send-files.js +3 -1
- package/esm/modules/widget/tabs/tabs.js +2 -0
- package/esm/plugins/all.d.ts +1 -0
- package/esm/plugins/all.js +1 -0
- package/esm/plugins/backspace/backspace.js +17 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +1 -11
- package/esm/plugins/backspace/helpers.d.ts +5 -0
- package/esm/plugins/backspace/helpers.js +11 -0
- package/esm/plugins/clean-html/clean-html.js +2 -2
- package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
- package/esm/plugins/clean-html/helpers/index.js +1 -0
- package/esm/plugins/clean-html/helpers/remove-format/remove-format-for-word.d.ts +16 -0
- package/esm/plugins/clean-html/helpers/remove-format/remove-format-for-word.js +109 -0
- package/esm/plugins/drag-and-drop-element/drag-and-drop-element.js +4 -2
- package/esm/plugins/format-block/config.d.ts +13 -0
- package/esm/plugins/format-block/config.js +38 -1
- package/esm/plugins/format-block/content-fonts.d.ts +17 -0
- package/esm/plugins/format-block/content-fonts.js +156 -0
- package/esm/plugins/image-caption/config.d.ts +31 -0
- package/esm/plugins/image-caption/config.js +11 -0
- package/esm/plugins/image-caption/image-caption.d.ts +140 -0
- package/esm/plugins/image-caption/image-caption.js +799 -0
- package/esm/plugins/image-processor/image-processor.d.ts +2 -1
- package/esm/plugins/image-processor/image-processor.js +9 -4
- package/esm/plugins/image-properties/config.js +1 -0
- package/esm/plugins/image-properties/image-properties.js +19 -5
- package/esm/plugins/image-properties/interface.d.ts +6 -0
- package/esm/plugins/image-properties/readers/align.d.ts +1 -1
- package/esm/plugins/image-properties/readers/index.js +9 -3
- package/esm/plugins/image-properties/readers/margin.d.ts +1 -1
- package/esm/plugins/image-properties/readers/size.d.ts +5 -1
- package/esm/plugins/image-properties/readers/size.js +4 -5
- package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +2 -0
- package/esm/plugins/image-properties/ui/ui-image-main-tab.js +20 -0
- package/esm/plugins/image-properties/writers/caption.d.ts +15 -0
- package/esm/plugins/image-properties/writers/caption.js +18 -0
- package/esm/plugins/image-properties/writers/index.js +15 -10
- package/esm/plugins/image-properties/writers/link.js +7 -2
- package/esm/plugins/image-properties/writers/margin.d.ts +1 -1
- package/esm/plugins/image-properties/writers/size.d.ts +5 -2
- package/esm/plugins/image-properties/writers/size.js +16 -2
- package/esm/plugins/indent/helpers.d.ts +9 -0
- package/esm/plugins/indent/helpers.js +23 -3
- package/esm/plugins/indent/indent.js +2 -20
- package/esm/plugins/index.d.ts +1 -0
- package/esm/plugins/inline-popup/config/config.js +4 -0
- package/esm/plugins/inline-popup/config/items/cells.js +29 -0
- package/esm/plugins/inline-popup/config/items/img.js +35 -5
- package/esm/plugins/inline-popup/icons/caption.svg.js +1 -0
- package/esm/plugins/inline-popup/icons/headerrow.svg.js +1 -0
- package/esm/plugins/inline-popup/inline-popup.js +3 -2
- package/esm/plugins/placeholder/placeholder.js +7 -1
- package/esm/plugins/resize-cells/resize-cells.d.ts +49 -0
- package/esm/plugins/resize-cells/resize-cells.js +247 -13
- package/esm/plugins/resizer/resizer.js +13 -2
- package/esm/plugins/select-cells/select-cells.d.ts +5 -0
- package/esm/plugins/select-cells/select-cells.js +29 -11
- package/esm/plugins/tab/cases/index.d.ts +1 -0
- package/esm/plugins/tab/cases/index.js +1 -0
- package/esm/plugins/tab/cases/on-tab-inside-li.js +3 -1
- package/esm/plugins/tab/cases/tab-spaces.d.ts +32 -0
- package/esm/plugins/tab/cases/tab-spaces.js +263 -0
- package/esm/plugins/tab/config.d.ts +10 -0
- package/esm/plugins/tab/config.js +2 -1
- package/esm/plugins/tab/tab.js +61 -6
- package/esm/types/types.d.ts +16 -0
- package/esm/types/uploader.d.ts +6 -0
- package/package.json +1 -1
- package/types/config.d.ts +44 -1
- package/types/core/helpers/utils/align.d.ts +6 -1
- package/types/core/helpers/utils/image-caption.d.ts +24 -0
- package/types/core/helpers/utils/index.d.ts +1 -0
- package/types/core/selection/selection.d.ts +3 -0
- package/types/core/ui/helpers/focus-form-field.d.ts +12 -0
- package/types/langs/ar.d.ts +2 -0
- package/types/langs/az.d.ts +2 -0
- package/types/langs/cs_cz.d.ts +2 -0
- package/types/langs/de.d.ts +2 -0
- package/types/langs/es.d.ts +2 -0
- package/types/langs/fa.d.ts +2 -0
- package/types/langs/fi.d.ts +2 -0
- package/types/langs/fr.d.ts +2 -0
- package/types/langs/he.d.ts +2 -0
- package/types/langs/hu.d.ts +2 -0
- package/types/langs/id.d.ts +2 -0
- package/types/langs/it.d.ts +2 -0
- package/types/langs/ja.d.ts +2 -0
- package/types/langs/ko.d.ts +2 -0
- package/types/langs/mn.d.ts +2 -0
- package/types/langs/nl.d.ts +2 -0
- package/types/langs/no.d.ts +2 -0
- package/types/langs/pl.d.ts +2 -0
- package/types/langs/pt_br.d.ts +2 -0
- package/types/langs/ru.d.ts +2 -0
- package/types/langs/sk.d.ts +2 -0
- package/types/langs/sv.d.ts +2 -0
- package/types/langs/tr.d.ts +2 -0
- package/types/langs/ua.d.ts +2 -0
- package/types/langs/zh_cn.d.ts +2 -0
- package/types/langs/zh_tw.d.ts +2 -0
- package/types/modules/table/table.d.ts +27 -0
- package/types/plugins/backspace/helpers.d.ts +5 -0
- package/types/plugins/clean-html/helpers/index.d.ts +1 -0
- package/types/plugins/clean-html/helpers/remove-format/remove-format-for-word.d.ts +16 -0
- package/types/plugins/format-block/config.d.ts +13 -0
- package/types/plugins/format-block/content-fonts.d.ts +17 -0
- package/types/plugins/image-caption/config.d.ts +31 -0
- package/types/plugins/image-caption/image-caption.d.ts +140 -0
- package/types/plugins/image-processor/image-processor.d.ts +2 -1
- package/types/plugins/image-properties/interface.d.ts +6 -0
- package/types/plugins/image-properties/readers/align.d.ts +1 -1
- package/types/plugins/image-properties/readers/margin.d.ts +1 -1
- package/types/plugins/image-properties/readers/size.d.ts +5 -1
- package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +2 -0
- package/types/plugins/image-properties/writers/caption.d.ts +15 -0
- package/types/plugins/image-properties/writers/margin.d.ts +1 -1
- package/types/plugins/image-properties/writers/size.d.ts +5 -2
- package/types/plugins/indent/helpers.d.ts +9 -0
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/resize-cells/resize-cells.d.ts +49 -0
- package/types/plugins/select-cells/select-cells.d.ts +5 -0
- package/types/plugins/tab/cases/index.d.ts +1 -0
- package/types/plugins/tab/cases/tab-spaces.d.ts +32 -0
- package/types/plugins/tab/config.d.ts +10 -0
- package/types/types/types.d.ts +16 -0
- package/types/types/uploader.d.ts +6 -0
|
@@ -0,0 +1,140 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* [[include:plugins/image-caption/README.md]]
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
* @module plugins/image-caption
|
|
10
|
+
*/
|
|
11
|
+
import type { IJodit, Nullable } from "../../types/index";
|
|
12
|
+
import { Plugin } from "../../core/plugin/plugin";
|
|
13
|
+
import "./config";
|
|
14
|
+
/**
|
|
15
|
+
* Captions images: wraps an image in `imageCaption`'s elements and back, and
|
|
16
|
+
* keeps the caret in the caption
|
|
17
|
+
*/
|
|
18
|
+
export declare class imageCaption extends Plugin {
|
|
19
|
+
/** @override */
|
|
20
|
+
protected afterInit(jodit: IJodit): void;
|
|
21
|
+
/**
|
|
22
|
+
* Gives `image` a caption, or takes it away, as `on` says, or else the
|
|
23
|
+
* other way round from how it is. Returns the caption it gave, or null
|
|
24
|
+
* when it took one away
|
|
25
|
+
*/
|
|
26
|
+
protected onToggleImageCaption(image: HTMLImageElement, on?: boolean): Nullable<HTMLElement> | void;
|
|
27
|
+
/**
|
|
28
|
+
* The caption given last, while nothing has changed round it and it's
|
|
29
|
+
* still blank, so taking it off can put everything back as it was
|
|
30
|
+
*/
|
|
31
|
+
private __fresh;
|
|
32
|
+
private __freshCaption;
|
|
33
|
+
/**
|
|
34
|
+
* Giving a caption isn't a step in the history of its own, as the first
|
|
35
|
+
* thing typed in it is, so Undo never brings back a blank caption
|
|
36
|
+
*/
|
|
37
|
+
private __caption;
|
|
38
|
+
/**
|
|
39
|
+
* Changes the content with no step in the history of its own, so Undo
|
|
40
|
+
* never brings back a blank caption. A step still open takes it in
|
|
41
|
+
*/
|
|
42
|
+
private __unrecorded;
|
|
43
|
+
private __wrap;
|
|
44
|
+
/**
|
|
45
|
+
* Puts the image back as it was before its caption: in the line the
|
|
46
|
+
* caption split, and with its own alignment, margins and width. The image
|
|
47
|
+
* goes into the part of the line holding the caret, so the caret stays
|
|
48
|
+
*/
|
|
49
|
+
private __restore;
|
|
50
|
+
private __uncaption;
|
|
51
|
+
private __create;
|
|
52
|
+
/**
|
|
53
|
+
* Puts `wrapper` where `target` is. A block can't go in a paragraph, so the
|
|
54
|
+
* paragraph is split round it, and a part left empty goes
|
|
55
|
+
*/
|
|
56
|
+
private __insert;
|
|
57
|
+
/**
|
|
58
|
+
* The wrapper can't be edited, apart from its caption, so typing can't
|
|
59
|
+
* land between the image and the caption
|
|
60
|
+
*/
|
|
61
|
+
private __mark;
|
|
62
|
+
private __placeholder;
|
|
63
|
+
protected onChange(): void;
|
|
64
|
+
/**
|
|
65
|
+
* The placeholder goes with the first letter typed or pasted, and comes
|
|
66
|
+
* back when the last is deleted
|
|
67
|
+
*/
|
|
68
|
+
protected onInput(): void;
|
|
69
|
+
/**
|
|
70
|
+
* The editor's own attributes stay out of the value, as the caption would
|
|
71
|
+
* be editable on the page. So does a caption given and left blank, as
|
|
72
|
+
* leaving it takes it off, so saving at once keeps the image as it was
|
|
73
|
+
*/
|
|
74
|
+
protected onAfterGetValueFromEditor(data: {
|
|
75
|
+
value: string;
|
|
76
|
+
}): void;
|
|
77
|
+
protected onChangePlace(): void;
|
|
78
|
+
private __press;
|
|
79
|
+
private __afterPress;
|
|
80
|
+
private __onMouseDown;
|
|
81
|
+
/**
|
|
82
|
+
* A caption left blank goes when the focus leaves it. That's checked once
|
|
83
|
+
* the focus has landed, as switching windows or opening the editor's own
|
|
84
|
+
* popups keeps it, and once a press that took the focus is over, as the
|
|
85
|
+
* browsers fire no click when its target moves
|
|
86
|
+
*/
|
|
87
|
+
private __onFocusOut;
|
|
88
|
+
private __onMouseUp;
|
|
89
|
+
private __dropBlank;
|
|
90
|
+
/**
|
|
91
|
+
* The caption has the focus, or had it when another window took it, or
|
|
92
|
+
* the editor's own popups and dialogs have it, as the link form
|
|
93
|
+
*/
|
|
94
|
+
private __keepsFocus;
|
|
95
|
+
/**
|
|
96
|
+
* The caption the caret is in
|
|
97
|
+
*/
|
|
98
|
+
private __caretCaption;
|
|
99
|
+
/**
|
|
100
|
+
* Enter in a caption starts a line after the image, and Shift+Enter
|
|
101
|
+
* breaks the caption's line, as everywhere
|
|
102
|
+
*/
|
|
103
|
+
protected onBeforeEnter(event?: KeyboardEvent): false | void;
|
|
104
|
+
/**
|
|
105
|
+
* The caption keeps the focus, as an editable element of its own, and
|
|
106
|
+
* would take the caret back, so the editor takes it before the caret
|
|
107
|
+
* leaves the caption
|
|
108
|
+
*/
|
|
109
|
+
private __focusEditor;
|
|
110
|
+
private __line;
|
|
111
|
+
/**
|
|
112
|
+
* A caption holds text. An image, a table or a block put in it would end
|
|
113
|
+
* the captioned image, so it goes after the image, as Enter would
|
|
114
|
+
*/
|
|
115
|
+
protected onBeforeInsertNode(node: Node): void;
|
|
116
|
+
private __arrow;
|
|
117
|
+
/**
|
|
118
|
+
* A selected captioned image goes as an image on a line of its own does,
|
|
119
|
+
* leaving the line empty, rather than joining the lines either side
|
|
120
|
+
*/
|
|
121
|
+
protected onBeforeCommandDelete(): false | void;
|
|
122
|
+
/**
|
|
123
|
+
* The captioned image the selection holds, as a click on the image selects
|
|
124
|
+
*/
|
|
125
|
+
private __selectedWrapper;
|
|
126
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
127
|
+
/**
|
|
128
|
+
* An arrow key that couldn't move the caret in the caption takes it out,
|
|
129
|
+
* past the image, as the caption is an editable element of its own
|
|
130
|
+
*/
|
|
131
|
+
protected onKeyUp(event: KeyboardEvent): void;
|
|
132
|
+
protected onBeforeCommand(command: string): false | void;
|
|
133
|
+
/**
|
|
134
|
+
* Select all in a caption selects the caption, as the caption is an
|
|
135
|
+
* editable element of its own
|
|
136
|
+
*/
|
|
137
|
+
private __onSelectAll;
|
|
138
|
+
/** @override */
|
|
139
|
+
protected beforeDestruct(jodit: IJodit): void;
|
|
140
|
+
}
|
|
@@ -28,7 +28,8 @@ export declare class imageProcessor extends Plugin {
|
|
|
28
28
|
* paints the rest of a block image's line with its parent's highlight. See #1528.
|
|
29
29
|
* Media in a wrapper (`jodit-media`, the resizer's `jodit` for an embed, or
|
|
30
30
|
* one from `mediaWrappers`) isn't highlighted either, as Safari paints its
|
|
31
|
-
* wrapper's whole line, and its resize frame shows it's selected
|
|
31
|
+
* wrapper's whole line, and its resize frame shows it's selected. Nor is
|
|
32
|
+
* a captioned image's caption
|
|
32
33
|
*/
|
|
33
34
|
private onSelectionChange;
|
|
34
35
|
protected afterChange(data: {
|
|
@@ -13,6 +13,7 @@ export type EditValues = {
|
|
|
13
13
|
borderRadius: number;
|
|
14
14
|
imageTitle: string;
|
|
15
15
|
imageAlt: string;
|
|
16
|
+
imageCaption: boolean;
|
|
16
17
|
imageLink: string;
|
|
17
18
|
imageLinkOpenInNewTab: boolean;
|
|
18
19
|
imageWidth: number | string;
|
|
@@ -59,6 +60,11 @@ export interface ImagePropertiesOptions {
|
|
|
59
60
|
* Show edit 'alt' input
|
|
60
61
|
*/
|
|
61
62
|
editAlt: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Show the Caption checkbox, which gives the image a caption or takes it
|
|
65
|
+
* away (see `imageCaption`). The caption itself is typed under the image
|
|
66
|
+
*/
|
|
67
|
+
showCaptionCheckbox: boolean;
|
|
62
68
|
/**
|
|
63
69
|
* Show edit image link's options
|
|
64
70
|
*/
|
|
@@ -11,4 +11,4 @@ import type { EditValues } from "../interface";
|
|
|
11
11
|
/**
|
|
12
12
|
* @private
|
|
13
13
|
*/
|
|
14
|
-
export declare function readAlign(image:
|
|
14
|
+
export declare function readAlign(image: HTMLElement, values: EditValues, classes?: Nullable<HAlignClasses>): void;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { EditValues, ImagePropertiesState } from "../interface";
|
|
7
7
|
/** @private */
|
|
8
|
-
export declare function readMargins(image:
|
|
8
|
+
export declare function readMargins(image: HTMLElement, values: EditValues, state: ImagePropertiesState): void;
|
|
@@ -3,6 +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
|
+
/**
|
|
7
|
+
* @module plugins/image-properties
|
|
8
|
+
*/
|
|
9
|
+
import type { Nullable } from "../../../types/index";
|
|
6
10
|
import type { EditValues, ImagePropertiesState } from "../interface";
|
|
7
11
|
/** @private */
|
|
8
|
-
export declare function readSizes(image: HTMLImageElement, values: EditValues, state: ImagePropertiesState): Promise<void>;
|
|
12
|
+
export declare function readSizes(image: HTMLImageElement, values: EditValues, state: ImagePropertiesState, captionWrapper?: Nullable<HTMLElement>): Promise<void>;
|
|
@@ -31,6 +31,8 @@ export declare class UIImageMainTab extends UIGroup<IJodit> {
|
|
|
31
31
|
protected onTitleChange(): void;
|
|
32
32
|
protected onStateAltChange(): void;
|
|
33
33
|
protected onAltChange(): void;
|
|
34
|
+
protected onStateCaptionChange(): void;
|
|
35
|
+
protected onCaptionChange(): void;
|
|
34
36
|
protected onStateImageLinkChange(): void;
|
|
35
37
|
protected onImageLinkChange(): void;
|
|
36
38
|
protected onStateImageLinkOpenInNewTabChange(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/image-properties
|
|
8
|
+
*/
|
|
9
|
+
import type { IJodit } from "../../../types/index";
|
|
10
|
+
/**
|
|
11
|
+
* Gives the image a caption or takes it away, and returns the element that
|
|
12
|
+
* holds the image's place on the page: the caption's, or the image
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyCaption(j: IJodit, image: HTMLImageElement, imageCaption: boolean): HTMLElement;
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { IJodit } from "../../../types/index";
|
|
10
10
|
/** @private */
|
|
11
|
-
export declare function applyMargin(j: IJodit, marginTop: number | string, marginRight: number | string, marginBottom: number | string, marginLeft: number | string, image:
|
|
11
|
+
export declare function applyMargin(j: IJodit, marginTop: number | string, marginRight: number | string, marginBottom: number | string, marginLeft: number | string, image: HTMLElement, marginIsLocked: boolean): void;
|
|
@@ -3,5 +3,8 @@
|
|
|
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
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A captioned image fills its caption's element, `box`, which takes the width
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
10
|
+
export declare function applySize(image: HTMLImageElement, imageWidth: number | string, imageHeight: number | string, sizeIsLocked: boolean, box?: HTMLElement): void;
|
|
@@ -3,8 +3,17 @@
|
|
|
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 plugins/indent
|
|
8
|
+
*/
|
|
9
|
+
import type { IJodit } from "../../types/index";
|
|
6
10
|
/**
|
|
7
11
|
* Get style rule key for current direction
|
|
8
12
|
* @internal
|
|
9
13
|
*/
|
|
10
14
|
export declare const getKey: (direction: string, box: HTMLElement) => "marginLeft" | "marginRight" | "paddingLeft" | "paddingRight";
|
|
15
|
+
/**
|
|
16
|
+
* Indents or outdents a box by `indentMargin`
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const applyIndentToBox: (processedElements: Set<HTMLElement>, currentBox: HTMLElement, editor: IJodit, command: string) => void;
|
package/types/plugins/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ import "./hotkeys/hotkeys";
|
|
|
30
30
|
import "./hr/hr";
|
|
31
31
|
import "./iframe/iframe";
|
|
32
32
|
import "./image/image";
|
|
33
|
+
import "./image-caption/image-caption";
|
|
33
34
|
import "./image-processor/image-processor";
|
|
34
35
|
import "./image-properties/image-properties";
|
|
35
36
|
import "./indent/indent";
|
|
@@ -37,6 +37,28 @@ export declare class resizeCells extends Plugin {
|
|
|
37
37
|
private minX;
|
|
38
38
|
private maxX;
|
|
39
39
|
private startX;
|
|
40
|
+
/**
|
|
41
|
+
* The table's and its cells' styles as a column drag started, put back
|
|
42
|
+
* before each new width
|
|
43
|
+
*/
|
|
44
|
+
private startStyles;
|
|
45
|
+
private startLeft;
|
|
46
|
+
private startEdge;
|
|
47
|
+
/**
|
|
48
|
+
* The row whose height the handle sets, or null while it sets a width
|
|
49
|
+
*/
|
|
50
|
+
private workRow;
|
|
51
|
+
private startY;
|
|
52
|
+
private startHeight;
|
|
53
|
+
private rowStyle;
|
|
54
|
+
/**
|
|
55
|
+
* The boxes that scroll the row, with their styles, as a row drag turns
|
|
56
|
+
* off their scroll anchoring, which would move the border off the pointer
|
|
57
|
+
*/
|
|
58
|
+
private anchored;
|
|
59
|
+
private scrolled;
|
|
60
|
+
private scrollFrame;
|
|
61
|
+
private pointerY;
|
|
40
62
|
/**
|
|
41
63
|
* Click on resize handle
|
|
42
64
|
*/
|
|
@@ -49,6 +71,23 @@ export declare class resizeCells extends Plugin {
|
|
|
49
71
|
* Mouse up every where after move and click
|
|
50
72
|
*/
|
|
51
73
|
private onMouseUp;
|
|
74
|
+
private resizeColumnsOrTable;
|
|
75
|
+
private restoreStyles;
|
|
76
|
+
/**
|
|
77
|
+
* Where the border the handle is on lies: the work cell's left side
|
|
78
|
+
* for the table's left edge, otherwise its right side
|
|
79
|
+
*/
|
|
80
|
+
private columnEdge;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the row's height from where the pointer is, and how far the drag
|
|
83
|
+
* has scrolled. The browser keeps the row as tall as its content
|
|
84
|
+
*/
|
|
85
|
+
private resizeRow;
|
|
86
|
+
/**
|
|
87
|
+
* While the pointer is near or past the top or bottom of the part of the
|
|
88
|
+
* row's scroller in view, scrolls it on, and the row's border with it
|
|
89
|
+
*/
|
|
90
|
+
private scrollAlong;
|
|
52
91
|
/**
|
|
53
92
|
* Resize only one column
|
|
54
93
|
*/
|
|
@@ -68,6 +107,16 @@ export declare class resizeCells extends Plugin {
|
|
|
68
107
|
* Calc helper resize handle position
|
|
69
108
|
*/
|
|
70
109
|
private calcHandlePosition;
|
|
110
|
+
/**
|
|
111
|
+
* Shows the handle across the table on the border below a row, near the
|
|
112
|
+
* cell's bottom or near its top, which is the bottom of the row above.
|
|
113
|
+
* The table's top edge has no row above it
|
|
114
|
+
*/
|
|
115
|
+
private calcRowHandlePosition;
|
|
116
|
+
/**
|
|
117
|
+
* Lays the handle across the table on the border below the row
|
|
118
|
+
*/
|
|
119
|
+
private placeRowHandle;
|
|
71
120
|
/** @override */
|
|
72
121
|
afterInit(editor: IJodit): void;
|
|
73
122
|
/**
|
|
@@ -75,6 +75,11 @@ export declare class selectCells extends Plugin {
|
|
|
75
75
|
* Execute custom commands for table
|
|
76
76
|
*/
|
|
77
77
|
private onExecCommand;
|
|
78
|
+
/**
|
|
79
|
+
* Turns the table's header row on or off. The caret and the marked cells
|
|
80
|
+
* move to the cells that replace them
|
|
81
|
+
*/
|
|
82
|
+
private __toggleHeaderRow;
|
|
78
83
|
/**
|
|
79
84
|
* The cell that takes the caret when rows or columns are deleted: the next
|
|
80
85
|
* one in the same column (or row) that is not deleted, else the previous one
|
|
@@ -0,0 +1,32 @@
|
|
|
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @module plugins/tab
|
|
8
|
+
*/
|
|
9
|
+
import type { IJodit } from "../../../types/index";
|
|
10
|
+
/**
|
|
11
|
+
* With `tab.spaces`, outside table cells: Tab at a caret inserts the spaces,
|
|
12
|
+
* or a tab where white space is kept, as in `pre`, and in a list's first item
|
|
13
|
+
* it indents the list, as Word does. Shift+Tab takes them out again. Tab or
|
|
14
|
+
* Shift+Tab with a selection indents or outdents it. Neither moves the focus
|
|
15
|
+
* on: Escape and then Tab does that
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
18
|
+
export declare function onTabSpaces(jodit: IJodit, shift: boolean): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* With `tab.spaces`, Backspace just after that many spaces removes them
|
|
21
|
+
* together, as it would a tab. With `upTo`, as for Shift+Tab, fewer will do,
|
|
22
|
+
* if one of them is non-breaking, so a space between words stays
|
|
23
|
+
* @private
|
|
24
|
+
*/
|
|
25
|
+
export declare function removeTabSpaces(jodit: IJodit, caret: Node, upTo?: boolean): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* With `tab.spaces`, a tab in pasted text becomes the spaces, as HTML would
|
|
28
|
+
* show it as one space. Tabs in white space that's kept, and those that only
|
|
29
|
+
* lay out the HTML, stay as they are
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
export declare function tabsToSpaces(jodit: IJodit, html: string): string | void;
|
|
@@ -10,6 +10,16 @@ declare module 'jodit/config' {
|
|
|
10
10
|
* Pressing Tab inside LI will add an internal list
|
|
11
11
|
*/
|
|
12
12
|
tabInsideLiInsertNewList: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Outside table cells and the list items Tab already nests, Tab at a
|
|
15
|
+
* caret inserts this many non-breaking spaces, and Shift+Tab or
|
|
16
|
+
* Backspace takes them out again. In a list's first item Tab
|
|
17
|
+
* indents the list. Tab and Shift+Tab with a selection indent and
|
|
18
|
+
* outdent it, and a tab in pasted text becomes the same spaces.
|
|
19
|
+
* Neither key moves the focus on: Escape and then Tab does. 0
|
|
20
|
+
* leaves Tab to the browser, which moves the focus on
|
|
21
|
+
*/
|
|
22
|
+
spaces: number;
|
|
13
23
|
};
|
|
14
24
|
}
|
|
15
25
|
}
|
package/types/types/types.d.ts
CHANGED
|
@@ -203,6 +203,22 @@ export interface MediaWrapper {
|
|
|
203
203
|
tag: string;
|
|
204
204
|
className: string;
|
|
205
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* The elements a captioned image is kept in, see `imageCaption`. An empty
|
|
208
|
+
* `className` matches the tag alone
|
|
209
|
+
*/
|
|
210
|
+
export interface ImageCaptionMarkup {
|
|
211
|
+
/**
|
|
212
|
+
* Holds the image, or its link, and the caption
|
|
213
|
+
*/
|
|
214
|
+
wrapper: MediaWrapper;
|
|
215
|
+
/**
|
|
216
|
+
* Inside the wrapper, round the image and the caption, as Froala's
|
|
217
|
+
* `span.fr-img-wrap`
|
|
218
|
+
*/
|
|
219
|
+
inner: Nullable<MediaWrapper>;
|
|
220
|
+
caption: MediaWrapper;
|
|
221
|
+
}
|
|
206
222
|
export interface ImageBox {
|
|
207
223
|
w: number;
|
|
208
224
|
h: number;
|
|
@@ -16,6 +16,12 @@ interface IUploaderData {
|
|
|
16
16
|
path?: string;
|
|
17
17
|
baseurl: string;
|
|
18
18
|
newfilename?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The names the files had on the user's device. Only set when the
|
|
21
|
+
* images were read as base64 (`insertImageAsBase64URI`), where `files`
|
|
22
|
+
* holds data URIs.
|
|
23
|
+
*/
|
|
24
|
+
fileNames?: string[];
|
|
19
25
|
}
|
|
20
26
|
interface IUploaderAnswer {
|
|
21
27
|
success: boolean;
|