jodit 4.2.15 → 4.2.17

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +64 -5
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +406 -382
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.js +1 -1
  7. package/es2015/plugins/debug/debug.min.js +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.js +11 -11
  10. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  11. package/es2018/jodit.css +1 -1
  12. package/es2018/jodit.fat.min.js +2 -2
  13. package/es2018/jodit.js +406 -384
  14. package/es2018/jodit.min.js +2 -2
  15. package/es2018/plugins/debug/debug.js +1 -1
  16. package/es2018/plugins/debug/debug.min.js +1 -1
  17. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.js +11 -11
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  20. package/es2021/jodit.css +1 -1
  21. package/es2021/jodit.fat.min.js +2 -2
  22. package/es2021/jodit.js +406 -382
  23. package/es2021/jodit.min.js +2 -2
  24. package/es2021/plugins/debug/debug.js +1 -1
  25. package/es2021/plugins/debug/debug.min.js +1 -1
  26. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.js +11 -11
  28. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  29. package/es2021.en/jodit.css +1 -1
  30. package/es2021.en/jodit.fat.min.js +2 -2
  31. package/es2021.en/jodit.js +406 -382
  32. package/es2021.en/jodit.min.js +2 -2
  33. package/es2021.en/plugins/debug/debug.js +1 -1
  34. package/es2021.en/plugins/debug/debug.min.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.js +11 -11
  37. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  38. package/es5/jodit.css +2 -2
  39. package/es5/jodit.fat.min.js +2 -2
  40. package/es5/jodit.js +411 -387
  41. package/es5/jodit.min.css +2 -2
  42. package/es5/jodit.min.js +2 -2
  43. package/es5/plugins/debug/debug.js +1 -1
  44. package/es5/plugins/debug/debug.min.js +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.js +11 -11
  47. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  48. package/esm/core/constants.js +1 -1
  49. package/esm/core/helpers/utils/config-proto.js +1 -1
  50. package/esm/core/request/ajax.js +1 -1
  51. package/esm/core/ui/helpers/get-control-type.js +15 -9
  52. package/esm/core/ui/helpers/get-strong-control-types.js +1 -1
  53. package/esm/jodit.d.ts +1 -1
  54. package/esm/jodit.js +1 -1
  55. package/esm/modules/file-browser/file-browser.js +1 -1
  56. package/esm/modules/history/history.js +1 -1
  57. package/esm/modules/image-editor/config.js +1 -1
  58. package/esm/modules/image-editor/image-editor.js +1 -1
  59. package/esm/modules/toolbar/button/button.js +2 -1
  60. package/esm/modules/toolbar/button/select/select.js +2 -1
  61. package/esm/modules/uploader/uploader.js +1 -1
  62. package/esm/plugins/about/about.js +1 -1
  63. package/esm/plugins/add-new-line/config.js +1 -1
  64. package/esm/plugins/ai-assistant/config.js +1 -1
  65. package/esm/plugins/backspace/cases/check-remove-char.js +4 -0
  66. package/esm/plugins/bold/bold.js +1 -1
  67. package/esm/plugins/class-span/class-span.js +1 -1
  68. package/esm/plugins/clean-html/config.js +1 -1
  69. package/esm/plugins/clipboard/config.js +1 -1
  70. package/esm/plugins/color/config.js +1 -1
  71. package/esm/plugins/copy-format/copy-format.js +1 -1
  72. package/esm/plugins/file/file.js +1 -1
  73. package/esm/plugins/font/config.js +1 -1
  74. package/esm/plugins/format-block/config.js +6 -4
  75. package/esm/plugins/fullsize/config.js +1 -1
  76. package/esm/plugins/hr/hr.js +1 -1
  77. package/esm/plugins/image/image.js +1 -1
  78. package/esm/plugins/image-properties/config.d.ts +0 -3
  79. package/esm/plugins/image-properties/config.js +3 -0
  80. package/esm/plugins/image-properties/interface.d.ts +121 -0
  81. package/esm/plugins/indent/config.js +1 -1
  82. package/esm/plugins/inline-popup/config/config.js +1 -1
  83. package/esm/plugins/justify/justify.js +10 -6
  84. package/esm/plugins/line-height/config.js +1 -1
  85. package/esm/plugins/link/config.js +1 -1
  86. package/esm/plugins/mobile/config.js +1 -1
  87. package/esm/plugins/ordered-list/config.js +1 -1
  88. package/esm/plugins/paste/config.js +1 -1
  89. package/esm/plugins/print/print.js +1 -1
  90. package/esm/plugins/redo-undo/redo-undo.js +1 -1
  91. package/esm/plugins/search/config.js +1 -1
  92. package/esm/plugins/source/config.js +1 -1
  93. package/esm/plugins/speech-recognize/config.js +1 -1
  94. package/esm/plugins/spellcheck/config.js +1 -1
  95. package/esm/plugins/symbols/config.js +1 -1
  96. package/esm/plugins/table/config.js +1 -1
  97. package/esm/plugins/video/config.js +1 -1
  98. package/esm/types/toolbar.d.ts +1 -2
  99. package/package.json +1 -1
  100. package/types/jodit.d.ts +1 -1
  101. package/types/plugins/image-properties/config.d.ts +0 -3
  102. package/types/plugins/image-properties/interface.d.ts +121 -0
  103. package/types/types/toolbar.d.ts +1 -2
@@ -0,0 +1,121 @@
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module plugins/image-properties
8
+ */
9
+ import type { ImageHAlign } from "../../types";
10
+ export type EditValues = {
11
+ style: string;
12
+ imageSrc: string;
13
+ borderRadius: number;
14
+ imageTitle: string;
15
+ imageAlt: string;
16
+ imageLink: string;
17
+ imageLinkOpenInNewTab: boolean;
18
+ imageWidth: number | string;
19
+ imageHeight: number | string;
20
+ marginTop: number | string;
21
+ marginRight: number | string;
22
+ marginBottom: number | string;
23
+ marginLeft: number | string;
24
+ classes: string;
25
+ id: string;
26
+ align: ImageHAlign;
27
+ };
28
+ export interface ImagePropertiesState {
29
+ image: HTMLImageElement;
30
+ sourceImage: HTMLImageElement;
31
+ ratio: number;
32
+ sizeIsLocked: boolean;
33
+ marginIsLocked: boolean;
34
+ values: EditValues;
35
+ }
36
+ export interface ImagePropertiesAPI {
37
+ openImageEditor: () => void;
38
+ openImagePopup: (target: HTMLElement) => void;
39
+ }
40
+ export interface ImagePropertiesOptions {
41
+ dialogWidth: number;
42
+ /**
43
+ * Open editing dialog after double click on image
44
+ */
45
+ openOnDblClick: boolean;
46
+ /**
47
+ * Show edit 'src' input
48
+ */
49
+ editSrc: boolean;
50
+ /**
51
+ * Show crop/resize btn
52
+ */
53
+ useImageEditor: boolean;
54
+ /**
55
+ * Show edit 'title' input
56
+ */
57
+ editTitle: boolean;
58
+ /**
59
+ * Show edit 'alt' input
60
+ */
61
+ editAlt: boolean;
62
+ /**
63
+ * Show edit image link's options
64
+ */
65
+ editLink: boolean;
66
+ /**
67
+ * Show edit image size's inputs
68
+ */
69
+ editSize: boolean;
70
+ /**
71
+ * Show edit margin inputs
72
+ */
73
+ editMargins: boolean;
74
+ editBorderRadius: boolean;
75
+ /**
76
+ * Show edit classNames input
77
+ */
78
+ editClass: boolean;
79
+ /**
80
+ * Pre-define available classes to select from
81
+ *
82
+ * Classes can be provided as list of strings or as list of tuples
83
+ * `["classname", "human label"]`.
84
+ *
85
+ * @example
86
+ * ```javascript
87
+ * new Jodit('#editor', {
88
+ * image: {
89
+ * availableClasses: [
90
+ * "rte-image-width-50",
91
+ * ["rte-image-width-75", "75 % width"]
92
+ * ]
93
+ * }
94
+ * })
95
+ * ```
96
+ */
97
+ availableClasses: [
98
+ string,
99
+ string
100
+ ][] | string[];
101
+ /**
102
+ * Show style edit input
103
+ */
104
+ editStyle: boolean;
105
+ /**
106
+ * Show edit ID input
107
+ */
108
+ editId: boolean;
109
+ /**
110
+ * Show Alignment selector
111
+ */
112
+ editAlign: boolean;
113
+ /**
114
+ * Show preview image
115
+ */
116
+ showPreview: boolean;
117
+ /**
118
+ * Select image after close dialog
119
+ */
120
+ selectImageAfterClose: boolean;
121
+ }
@@ -5,10 +5,10 @@
5
5
  */
6
6
  import { Dom } from "../../core/dom/index.js";
7
7
  import { Icon } from "../../core/ui/icon.js";
8
+ import { Config } from "../../config.js";
8
9
  import indentIcon from "./icons/indent.svg.js";
9
10
  import outdentIcon from "./icons/outdent.svg.js";
10
11
  import { getKey } from "./helpers.js";
11
- import { Config } from "../../config.js";
12
12
  Icon.set('indent', indentIcon).set('outdent', outdentIcon);
13
13
  Config.prototype.controls.indent = {
14
14
  tooltip: 'Increase Indent'
@@ -4,12 +4,12 @@
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { Icon } from "../../../core/ui/icon.js";
7
+ import { Config } from "../../../config.js";
7
8
  import a from "./items/a.js";
8
9
  import cells from "./items/cells.js";
9
10
  import jodit from "./items/iframe.js";
10
11
  import img from "./items/img.js";
11
12
  import toolbar from "./items/toolbar.js";
12
- import { Config } from "../../../config.js";
13
13
  import * as addcolumn from "../icons/addcolumn.svg.js";
14
14
  import * as addrow from "../icons/addrow.svg.js";
15
15
  import * as merge from "../icons/merge.svg.js";
@@ -5,11 +5,12 @@
5
5
  */
6
6
  import { Dom } from "../../core/dom/dom.js";
7
7
  import { pluginSystem } from "../../core/global.js";
8
+ import { isPlainObject } from "../../core/helpers/index.js";
8
9
  import { alignElement } from "../../core/helpers/utils/align.js";
9
10
  import { css } from "../../core/helpers/utils/css.js";
10
11
  import { Icon } from "../../core/ui/icon.js";
11
- import justifyIcon from "./justify.svg.js";
12
12
  import { Config } from "../../config.js";
13
+ import justifyIcon from "./justify.svg.js";
13
14
  Icon.set('justify', justifyIcon);
14
15
  Config.prototype.controls.align = {
15
16
  name: 'left',
@@ -24,17 +25,20 @@ Config.prototype.controls.align = {
24
25
  control.defaultValue.indexOf(currentValue) !== -1) {
25
26
  currentValue = 'left';
26
27
  }
27
- if (control.data &&
28
- control.data.currentValue !== currentValue &&
29
- control.list &&
30
- control.list[currentValue]) {
28
+ const { list, data } = control;
29
+ if (data &&
30
+ data.currentValue !== currentValue &&
31
+ list &&
32
+ (isPlainObject(list)
33
+ ? list[currentValue]
34
+ : list.includes(currentValue))) {
31
35
  if (editor.o.textIcons || control.component === 'select') {
32
36
  button.state.text = currentValue;
33
37
  }
34
38
  else {
35
39
  button.state.icon.name = currentValue;
36
40
  }
37
- control.data.currentValue = currentValue;
41
+ data.currentValue = currentValue;
38
42
  }
39
43
  }
40
44
  },
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { memorizeExec } from "../../core/helpers/index.js";
7
7
  import { Icon } from "../../core/ui/icon.js";
8
- import lineHeightIcon from "./line-height.svg.js";
9
8
  import { Config } from "../../config.js";
9
+ import lineHeightIcon from "./line-height.svg.js";
10
10
  Config.prototype.defaultLineHeight = null;
11
11
  Icon.set('line-height', lineHeightIcon);
12
12
  Config.prototype.controls.lineHeight = {
@@ -5,10 +5,10 @@
5
5
  */
6
6
  import { Dom } from "../../core/dom/dom.js";
7
7
  import { Icon } from "../../core/ui/icon.js";
8
+ import { Config } from "../../config.js";
8
9
  import linkIcon from "./icons/link.svg.js";
9
10
  import unlinkIcon from "./icons/unlink.svg.js";
10
11
  import { formTemplate } from "./template.js";
11
- import { Config } from "../../config.js";
12
12
  Config.prototype.link = {
13
13
  formTemplate,
14
14
  followOnDblClick: false,
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import * as consts from "../../core/constants.js";
7
7
  import { splitArray } from "../../core/helpers/index.js";
8
+ import { Config } from "../../config.js";
8
9
  import { ToolbarCollection } from "../../modules/toolbar/collection/collection.js";
9
10
  import { makeCollection } from "../../modules/toolbar/factory.js";
10
- import { Config } from "../../config.js";
11
11
  Config.prototype.mobileTapTimeout = 300;
12
12
  Config.prototype.toolbarAdaptive = true;
13
13
  Config.prototype.buttonsMD = [
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { dataBind } from "../../core/helpers/utils/data-bind.js";
7
7
  import { Icon } from "../../core/ui/icon.js";
8
+ import { Config } from "../../config.js";
8
9
  import olIcon from "./icons/ol.svg.js";
9
10
  import ulIcon from "./icons/ul.svg.js";
10
- import { Config } from "../../config.js";
11
11
  const memoExec = (jodit, _, { control }) => {
12
12
  const key = `button${control.command}`;
13
13
  const value = (control.args && control.args[0]) ?? dataBind(jodit, key);
@@ -4,8 +4,8 @@
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { CLIPBOARD_ID, INSERT_AS_HTML, INSERT_AS_TEXT, INSERT_ONLY_TEXT, IS_PROD, TEXT_PLAIN } from "../../core/constants.js";
7
- import { pasteInsertHtml } from "./helpers.js";
8
7
  import { Config } from "../../config.js";
8
+ import { pasteInsertHtml } from "./helpers.js";
9
9
  Config.prototype.askBeforePasteHTML = true;
10
10
  Config.prototype.processPasteHTML = true;
11
11
  Config.prototype.scrollToPastedContent = true;
@@ -9,9 +9,9 @@ import { getContainer, pluginSystem } from "../../core/global.js";
9
9
  import { defaultLanguage } from "../../core/helpers/utils/default-language.js";
10
10
  import { previewBox } from "../../core/helpers/utils/print.js";
11
11
  import { Icon } from "../../core/ui/icon.js";
12
+ import { Config } from "../../config.js";
12
13
  import { generateCriticalCSS } from "./lib/generate-critical-css.js";
13
14
  import printIcon from "./print.svg.js";
14
- import { Config } from "../../config.js";
15
15
  Icon.set('print', printIcon);
16
16
  Config.prototype.controls.print = {
17
17
  exec: (editor) => {
@@ -7,9 +7,9 @@ import * as consts from "../../core/constants.js";
7
7
  import { pluginSystem } from "../../core/global.js";
8
8
  import { Plugin } from "../../core/plugin/plugin.js";
9
9
  import { Icon } from "../../core/ui/icon.js";
10
+ import { Config } from "../../config.js";
10
11
  import redoIcon from "./icons/redo.svg.js";
11
12
  import undoIcon from "./icons/undo.svg.js";
12
- import { Config } from "../../config.js";
13
13
  Icon.set('redo', redoIcon).set('undo', undoIcon);
14
14
  Config.prototype.controls.redo = {
15
15
  mode: consts.MODE_SPLIT,
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { Icon } from "../../core/ui/icon.js";
7
+ import { Config } from "../../config.js";
7
8
  import "./interface.js";
8
9
  import searchIcon from "./search.svg.js";
9
- import { Config } from "../../config.js";
10
10
  Config.prototype.useSearch = true;
11
11
  Config.prototype.search = {
12
12
  lazyIdleTimeout: 0,
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { IS_IE, MODE_SOURCE, MODE_SPLIT } from "../../core/constants.js";
7
7
  import { Icon } from "../../core/ui/icon.js";
8
- import sourceIcon from "./source.svg.js";
9
8
  import { Config } from "../../config.js";
9
+ import sourceIcon from "./source.svg.js";
10
10
  Config.prototype.beautifyHTML = !IS_IE;
11
11
  Config.prototype.sourceEditor = 'ace';
12
12
  Config.prototype.sourceEditorNativeOptions = {
@@ -6,10 +6,10 @@
6
6
  import { isBoolean } from "../../core/helpers/checker/is-boolean.js";
7
7
  import { dataBind } from "../../core/helpers/utils/data-bind.js";
8
8
  import { Icon } from "../../core/ui/icon.js";
9
+ import { Config } from "../../config.js";
9
10
  import { SpeechRecognition } from "./helpers/api.js";
10
11
  import { RecognizeManager } from "./helpers/recognize-manager.js";
11
12
  import speechRecognizeIcon from "./speech-recognize.svg.js";
12
- import { Config } from "../../config.js";
13
13
  Config.prototype.speechRecognize = {
14
14
  api: SpeechRecognition,
15
15
  sound: true,
@@ -4,8 +4,8 @@
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { Icon } from "../../core/ui/icon.js";
7
- import spellcheckIcon from "./spellcheck.svg.js";
8
7
  import { Config } from "../../config.js";
8
+ import spellcheckIcon from "./spellcheck.svg.js";
9
9
  Config.prototype.spellcheck = false;
10
10
  Icon.set('spellcheck', spellcheckIcon);
11
11
  Config.prototype.controls.spellcheck = {
@@ -4,8 +4,8 @@
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { Icon } from "../../core/ui/icon.js";
7
- import symbolsIcon from "./symbols.svg.js";
8
7
  import { Config } from "../../config.js";
8
+ import symbolsIcon from "./symbols.svg.js";
9
9
  Config.prototype.usePopupForSpecialCharacters = false;
10
10
  Config.prototype.specialCharacters = [
11
11
  '!',
@@ -7,8 +7,8 @@ import { Dom } from "../../core/dom/index.js";
7
7
  import { $$, css, scrollIntoViewIfNeeded } from "../../core/helpers/index.js";
8
8
  import { attr } from "../../core/helpers/utils/index.js";
9
9
  import { Icon } from "../../core/ui/icon.js";
10
- import tableIcon from "./table.svg.js";
11
10
  import { Config } from "../../config.js";
11
+ import tableIcon from "./table.svg.js";
12
12
  Config.prototype.table = {
13
13
  selectionCellStyle: 'border: 1px double #1e88e5 !important;',
14
14
  useExtraClassesOptions: false
@@ -7,9 +7,9 @@ import { convertMediaUrlToVideoEmbed } from "../../core/helpers/index.js";
7
7
  import { Button } from "../../core/ui/button/index.js";
8
8
  import { UIBlock, UIForm, UIInput, UITextArea } from "../../core/ui/form/index.js";
9
9
  import { Icon } from "../../core/ui/icon.js";
10
+ import { Config } from "../../config.js";
10
11
  import { TabsWidget } from "../../modules/widget/index.js";
11
12
  import videoIcon from "./video.svg.js";
12
- import { Config } from "../../config.js";
13
13
  Icon.set('video', videoIcon);
14
14
  Config.prototype.controls.video = {
15
15
  popup: (editor, current, close) => {
@@ -12,7 +12,7 @@ import type { IViewBased } from "./view";
12
12
  import type { IJodit } from "./jodit";
13
13
  import type { Modes, IDictionary, HTMLTagNames, Nullable, IContainer, IComponent, IBound } from "./types";
14
14
  import type { IMods } from "./traits";
15
- interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser, B = IToolbarButton> {
15
+ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser, B extends IToolbarButton = IToolbarButton> {
16
16
  name?: string;
17
17
  text?: string;
18
18
  textTemplate?: (jodit: T, value: string) => string;
@@ -228,7 +228,6 @@ interface IControlListItem {
228
228
  }
229
229
  interface IControlTypeStrong extends IControlType {
230
230
  name: NonNullable<IControlType['name']>;
231
- list?: IDictionary<string | number>;
232
231
  }
233
232
  interface IControlTypeContent extends IControlTypeStrong {
234
233
  getContent: NonNullable<IControlTypeStrong['getContent']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.2.15",
3
+ "version": "4.2.17",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
package/types/jodit.d.ts CHANGED
@@ -12,8 +12,8 @@ import type { AjaxOptions, CanPromise, CustomCommand, ICreate, IDictionary, IFil
12
12
  import type * as Modules from "./modules";
13
13
  import * as constants from "./core/constants";
14
14
  import { Dlgs } from "./core/traits/dlgs";
15
- import { Selection, ViewWithToolbar } from "./modules";
16
15
  import { Config } from "./config";
16
+ import { Selection, ViewWithToolbar } from "./modules";
17
17
  /**
18
18
  * Class Jodit. Main class
19
19
  */
@@ -3,9 +3,6 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- /**
7
- * @module plugins/image-properties
8
- */
9
6
  import type { ImagePropertiesOptions } from "./interface";
10
7
  declare module 'jodit/config' {
11
8
  interface Config {
@@ -0,0 +1,121 @@
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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module plugins/image-properties
8
+ */
9
+ import type { ImageHAlign } from "../../types";
10
+ export type EditValues = {
11
+ style: string;
12
+ imageSrc: string;
13
+ borderRadius: number;
14
+ imageTitle: string;
15
+ imageAlt: string;
16
+ imageLink: string;
17
+ imageLinkOpenInNewTab: boolean;
18
+ imageWidth: number | string;
19
+ imageHeight: number | string;
20
+ marginTop: number | string;
21
+ marginRight: number | string;
22
+ marginBottom: number | string;
23
+ marginLeft: number | string;
24
+ classes: string;
25
+ id: string;
26
+ align: ImageHAlign;
27
+ };
28
+ export interface ImagePropertiesState {
29
+ image: HTMLImageElement;
30
+ sourceImage: HTMLImageElement;
31
+ ratio: number;
32
+ sizeIsLocked: boolean;
33
+ marginIsLocked: boolean;
34
+ values: EditValues;
35
+ }
36
+ export interface ImagePropertiesAPI {
37
+ openImageEditor: () => void;
38
+ openImagePopup: (target: HTMLElement) => void;
39
+ }
40
+ export interface ImagePropertiesOptions {
41
+ dialogWidth: number;
42
+ /**
43
+ * Open editing dialog after double click on image
44
+ */
45
+ openOnDblClick: boolean;
46
+ /**
47
+ * Show edit 'src' input
48
+ */
49
+ editSrc: boolean;
50
+ /**
51
+ * Show crop/resize btn
52
+ */
53
+ useImageEditor: boolean;
54
+ /**
55
+ * Show edit 'title' input
56
+ */
57
+ editTitle: boolean;
58
+ /**
59
+ * Show edit 'alt' input
60
+ */
61
+ editAlt: boolean;
62
+ /**
63
+ * Show edit image link's options
64
+ */
65
+ editLink: boolean;
66
+ /**
67
+ * Show edit image size's inputs
68
+ */
69
+ editSize: boolean;
70
+ /**
71
+ * Show edit margin inputs
72
+ */
73
+ editMargins: boolean;
74
+ editBorderRadius: boolean;
75
+ /**
76
+ * Show edit classNames input
77
+ */
78
+ editClass: boolean;
79
+ /**
80
+ * Pre-define available classes to select from
81
+ *
82
+ * Classes can be provided as list of strings or as list of tuples
83
+ * `["classname", "human label"]`.
84
+ *
85
+ * @example
86
+ * ```javascript
87
+ * new Jodit('#editor', {
88
+ * image: {
89
+ * availableClasses: [
90
+ * "rte-image-width-50",
91
+ * ["rte-image-width-75", "75 % width"]
92
+ * ]
93
+ * }
94
+ * })
95
+ * ```
96
+ */
97
+ availableClasses: [
98
+ string,
99
+ string
100
+ ][] | string[];
101
+ /**
102
+ * Show style edit input
103
+ */
104
+ editStyle: boolean;
105
+ /**
106
+ * Show edit ID input
107
+ */
108
+ editId: boolean;
109
+ /**
110
+ * Show Alignment selector
111
+ */
112
+ editAlign: boolean;
113
+ /**
114
+ * Show preview image
115
+ */
116
+ showPreview: boolean;
117
+ /**
118
+ * Select image after close dialog
119
+ */
120
+ selectImageAfterClose: boolean;
121
+ }
@@ -12,7 +12,7 @@ import type { IViewBased } from "./view";
12
12
  import type { IJodit } from "./jodit";
13
13
  import type { Modes, IDictionary, HTMLTagNames, Nullable, IContainer, IComponent, IBound } from "./types";
14
14
  import type { IMods } from "./traits";
15
- interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser, B = IToolbarButton> {
15
+ interface IControlType<T extends IViewBased = IJodit | IViewBased | IFileBrowser, B extends IToolbarButton = IToolbarButton> {
16
16
  name?: string;
17
17
  text?: string;
18
18
  textTemplate?: (jodit: T, value: string) => string;
@@ -228,7 +228,6 @@ interface IControlListItem {
228
228
  }
229
229
  interface IControlTypeStrong extends IControlType {
230
230
  name: NonNullable<IControlType['name']>;
231
- list?: IDictionary<string | number>;
232
231
  }
233
232
  interface IControlTypeContent extends IControlTypeStrong {
234
233
  getContent: NonNullable<IControlTypeStrong['getContent']>;