jodit 4.1.14 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +22 -5
  2. package/es2015/jodit.css +82 -31
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +1364 -560
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +82 -31
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +1350 -560
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +82 -31
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +1346 -560
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +82 -31
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +1346 -560
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/jodit.css +131 -35
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +1388 -496
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/core/constants.js +1 -1
  58. package/esm/core/decorators/cache/cache.d.ts +2 -1
  59. package/esm/core/decorators/cache/cache.js +7 -0
  60. package/esm/core/helpers/size/position.js +2 -2
  61. package/esm/core/helpers/utils/selector.d.ts +3 -1
  62. package/esm/core/helpers/utils/selector.js +3 -3
  63. package/esm/core/ui/button/tooltip/tooltip.js +3 -4
  64. package/esm/core/ui/popup/popup.js +1 -1
  65. package/esm/modules/dialog/dialog.js +1 -0
  66. package/esm/modules/file-browser/file-browser.js +8 -1
  67. package/esm/modules/image-editor/templates/form.js +6 -5
  68. package/esm/modules/toolbar/button/button.d.ts +1 -1
  69. package/esm/modules/widget/tabs/tabs.d.ts +4 -4
  70. package/esm/modules/widget/tabs/tabs.js +9 -7
  71. package/esm/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  72. package/esm/plugins/ai-assistant/ai-assistant.js +6 -6
  73. package/esm/plugins/image-properties/config.d.ts +5 -83
  74. package/esm/plugins/image-properties/config.js +0 -3
  75. package/esm/plugins/image-properties/image-properties.d.ts +22 -32
  76. package/esm/plugins/image-properties/image-properties.js +129 -402
  77. package/{types/plugins/image-properties/templates/form.d.ts → esm/plugins/image-properties/readers/align.d.ts} +3 -5
  78. package/esm/plugins/image-properties/readers/align.js +24 -0
  79. package/esm/plugins/image-properties/readers/index.d.ts +12 -0
  80. package/esm/plugins/image-properties/readers/index.js +38 -0
  81. package/esm/plugins/image-properties/readers/link.d.ts +9 -0
  82. package/esm/plugins/image-properties/readers/link.js +19 -0
  83. package/esm/plugins/image-properties/readers/margin.d.ts +8 -0
  84. package/esm/plugins/image-properties/readers/margin.js +28 -0
  85. package/esm/plugins/image-properties/readers/size.d.ts +8 -0
  86. package/esm/plugins/image-properties/readers/size.js +36 -0
  87. package/esm/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  88. package/esm/plugins/image-properties/ui/ui-image-form.js +171 -0
  89. package/esm/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  90. package/esm/plugins/image-properties/ui/ui-image-main-tab.js +179 -0
  91. package/esm/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  92. package/esm/plugins/image-properties/ui/ui-image-position-tab.js +261 -0
  93. package/esm/plugins/image-properties/{templates/main-tab.d.ts → utils/open-image-editor.d.ts} +5 -3
  94. package/esm/plugins/image-properties/utils/open-image-editor.js +52 -0
  95. package/esm/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  96. package/esm/plugins/image-properties/utils/open-image-popup.js +34 -0
  97. package/esm/plugins/image-properties/utils/utils.d.ts +9 -0
  98. package/esm/plugins/image-properties/utils/utils.js +21 -0
  99. package/esm/plugins/image-properties/writers/index.d.ts +12 -0
  100. package/esm/plugins/image-properties/writers/index.js +53 -0
  101. package/esm/plugins/image-properties/{templates/form.d.ts → writers/link.d.ts} +2 -4
  102. package/esm/plugins/image-properties/writers/link.js +24 -0
  103. package/esm/plugins/image-properties/writers/margin.d.ts +8 -0
  104. package/esm/plugins/image-properties/writers/margin.js +33 -0
  105. package/esm/plugins/image-properties/writers/size.d.ts +7 -0
  106. package/esm/plugins/image-properties/writers/size.js +28 -0
  107. package/esm/plugins/select/config.d.ts +7 -0
  108. package/esm/plugins/select/config.js +2 -1
  109. package/esm/plugins/select/select.d.ts +7 -3
  110. package/esm/plugins/select/select.js +21 -4
  111. package/esm/types/ui.d.ts +1 -1
  112. package/package.json +1 -1
  113. package/types/core/decorators/cache/cache.d.ts +2 -1
  114. package/types/core/helpers/utils/selector.d.ts +3 -1
  115. package/types/modules/toolbar/button/button.d.ts +1 -1
  116. package/types/modules/widget/tabs/tabs.d.ts +4 -4
  117. package/types/plugins/ai-assistant/ai-assistant.d.ts +1 -1
  118. package/types/plugins/image-properties/config.d.ts +5 -83
  119. package/types/plugins/image-properties/image-properties.d.ts +22 -32
  120. package/types/plugins/image-properties/{templates/main-tab.d.ts → readers/align.d.ts} +3 -5
  121. package/types/plugins/image-properties/readers/index.d.ts +12 -0
  122. package/types/plugins/image-properties/readers/link.d.ts +9 -0
  123. package/types/plugins/image-properties/readers/margin.d.ts +8 -0
  124. package/types/plugins/image-properties/readers/size.d.ts +8 -0
  125. package/types/plugins/image-properties/ui/ui-image-form.d.ts +29 -0
  126. package/types/plugins/image-properties/ui/ui-image-main-tab.d.ts +36 -0
  127. package/types/plugins/image-properties/ui/ui-image-position-tab.d.ts +36 -0
  128. package/types/plugins/image-properties/utils/open-image-editor.d.ts +12 -0
  129. package/types/plugins/image-properties/utils/open-image-popup.d.ts +9 -0
  130. package/types/plugins/image-properties/utils/utils.d.ts +9 -0
  131. package/types/plugins/image-properties/writers/index.d.ts +12 -0
  132. package/{esm/plugins/image-properties/templates/position-tab.d.ts → types/plugins/image-properties/writers/link.d.ts} +2 -4
  133. package/types/plugins/image-properties/writers/margin.d.ts +8 -0
  134. package/types/plugins/image-properties/writers/size.d.ts +7 -0
  135. package/types/plugins/select/config.d.ts +7 -0
  136. package/types/plugins/select/select.d.ts +7 -3
  137. package/types/types/ui.d.ts +1 -1
  138. package/esm/plugins/image-properties/templates/form.js +0 -26
  139. package/esm/plugins/image-properties/templates/main-tab.js +0 -47
  140. package/esm/plugins/image-properties/templates/position-tab.js +0 -66
  141. package/types/plugins/image-properties/templates/position-tab.d.ts +0 -10
@@ -64,7 +64,7 @@ export class select extends Plugin {
64
64
  }
65
65
  }
66
66
  /**
67
- * @event outsideClick(e) - when user clicked in the outside of editor
67
+ * @event outsideClick(e) - when user clicked on the outside of editor
68
68
  */
69
69
  onOutsideClick(e) {
70
70
  const node = e.target;
@@ -76,7 +76,7 @@ export class select extends Plugin {
76
76
  this.j.e.fire('outsideClick', e);
77
77
  }
78
78
  }
79
- beforeCommandCut(command) {
79
+ beforeCommandCut() {
80
80
  const { s } = this.j;
81
81
  if (!s.isCollapsed()) {
82
82
  const current = s.current();
@@ -85,13 +85,27 @@ export class select extends Plugin {
85
85
  }
86
86
  }
87
87
  }
88
- beforeCommandSelectall(command) {
88
+ beforeCommandSelectAll() {
89
89
  const { s } = this.j;
90
90
  s.focus();
91
91
  s.select(this.j.editor, true);
92
92
  s.expandSelection();
93
93
  return false;
94
94
  }
95
+ /**
96
+ * Normalize selection after triple click
97
+ */
98
+ onTripleClickNormalizeSelection(e) {
99
+ if (e.detail !== 3 || !this.j.o.select.normalizeTripleClick) {
100
+ return;
101
+ }
102
+ const { s } = this.j;
103
+ const { startContainer, startOffset } = s.range;
104
+ if (startOffset === 0 && Dom.isText(startContainer)) {
105
+ s.select(Dom.closest(startContainer, Dom.isBlock, this.j.editor) ||
106
+ startContainer, true);
107
+ }
108
+ }
95
109
  onCopyNormalizeSelectionBound(e) {
96
110
  const { s, editor, o } = this.j;
97
111
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -117,7 +131,10 @@ __decorate([
117
131
  ], select.prototype, "beforeCommandCut", null);
118
132
  __decorate([
119
133
  watch([':beforeCommandSelectall'])
120
- ], select.prototype, "beforeCommandSelectall", null);
134
+ ], select.prototype, "beforeCommandSelectAll", null);
135
+ __decorate([
136
+ watch([':click'])
137
+ ], select.prototype, "onTripleClickNormalizeSelection", null);
121
138
  __decorate([
122
139
  watch([':copy', ':cut'])
123
140
  ], select.prototype, "onCopyNormalizeSelectionBound", null);
package/esm/types/ui.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface IUIIconState {
30
30
  iconURL: string;
31
31
  fill: string;
32
32
  }
33
- export type ButtonVariant = 'initial' | 'default' | 'primary' | 'secondary' | 'success' | 'danger';
33
+ export type ButtonVariant = 'initial' | 'outline' | 'default' | 'primary' | 'secondary' | 'success' | 'danger';
34
34
  export interface IUIButtonState {
35
35
  size: 'tiny' | 'xsmall' | 'small' | 'middle' | 'large';
36
36
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.1.14",
3
+ "version": "4.2.5",
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",
@@ -8,9 +8,10 @@
8
8
  * @packageDocumentation
9
9
  * @module decorators/cache
10
10
  */
11
- import type { IDictionary } from "jodit/esm/types";
11
+ import type { IDictionary, Nullable } from "jodit/esm/types";
12
12
  export interface CachePropertyDescriptor<T, R> extends PropertyDescriptor {
13
13
  get?: (this: T) => R;
14
14
  }
15
+ export declare function cached<T>(object: object, property: string): Nullable<T>;
15
16
  export declare function cache<T, R>(_: object, name: PropertyKey, descriptor: CachePropertyDescriptor<T, R>): void;
16
17
  export declare function cacheHTML<T extends Function, R>(target: IDictionary, _: string, descriptor: CachePropertyDescriptor<T, R>): void;
@@ -31,7 +31,9 @@ export declare const getXPathByElement: (element: HTMLElement, root: HTMLElement
31
31
  /**
32
32
  * Find all `ref` or `data-ref` elements inside HTMLElement
33
33
  */
34
- export declare const refs: <T extends HTMLElement>(root: HTMLElement) => IDictionary<T>;
34
+ export declare const refs: <T extends HTMLElement>(root: HTMLElement | {
35
+ container: HTMLElement;
36
+ }) => IDictionary<T>;
35
37
  /**
36
38
  * Calculate full CSS selector
37
39
  */
@@ -22,7 +22,7 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
22
22
  hasTrigger: boolean;
23
23
  size: "small" | "tiny" | "xsmall" | "middle" | "large";
24
24
  name: string;
25
- value: string | number | boolean; /** @override */
25
+ value: string | number | boolean;
26
26
  variant: import("jodit/esm/types").ButtonVariant;
27
27
  type: "button" | "submit";
28
28
  disabled: boolean;
@@ -8,13 +8,13 @@
8
8
  * @packageDocumentation
9
9
  * @module modules/widget/tabs
10
10
  */
11
- import type { IJodit } from "jodit/esm/types";
11
+ import type { IViewBased } from "jodit/esm/types";
12
12
  import { UIElement } from "jodit/esm/core/ui";
13
13
 
14
14
  export interface TabOption {
15
15
  icon?: string;
16
16
  name: string;
17
- content: HTMLElement | ((this: IJodit) => void) | UIElement;
17
+ content: HTMLElement | ((this: IViewBased) => void) | UIElement;
18
18
  }
19
19
  /**
20
20
  * Build tabs system
@@ -44,6 +44,6 @@ export interface TabOption {
44
44
  * ]);
45
45
  * ```
46
46
  */
47
- export declare const TabsWidget: (jodit: IJodit, tabs: TabOption[], state?: {
48
- __activeTab: string;
47
+ export declare const TabsWidget: (jodit: IViewBased, tabs: TabOption[], state?: {
48
+ activeTab: string;
49
49
  }) => HTMLDivElement;
@@ -21,7 +21,7 @@ export declare class aiAssistant extends Plugin {
21
21
  private get __container();
22
22
  constructor(jodit: IJodit);
23
23
  /** @override */
24
- afterInit(jodit: IJodit): void;
24
+ afterInit(): void;
25
25
  protected onGenerateAiAssistantForm(prompt: string): void;
26
26
  protected onInvokeAiAssistant(prompt: string): void;
27
27
  /** @override */
@@ -3,90 +3,12 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
+ /**
7
+ * @module plugins/image-properties
8
+ */
9
+ import type { ImagePropertiesOptions } from "./interface";
6
10
  declare module 'jodit/config' {
7
11
  interface Config {
8
- image: {
9
- dialogWidth: number;
10
- /**
11
- * Open editing dialog after double click on image
12
- */
13
- openOnDblClick: boolean;
14
- /**
15
- * Show edit 'src' input
16
- */
17
- editSrc: boolean;
18
- /**
19
- * Show crop/resize btn
20
- */
21
- useImageEditor: boolean;
22
- /**
23
- * Show edit 'title' input
24
- */
25
- editTitle: boolean;
26
- /**
27
- * Show edit 'alt' input
28
- */
29
- editAlt: boolean;
30
- /**
31
- * Show edit image link's options
32
- */
33
- editLink: boolean;
34
- /**
35
- * Show edit image size's inputs
36
- */
37
- editSize: boolean;
38
- /**
39
- * Show edit margin inputs
40
- */
41
- editMargins: boolean;
42
- editBorderRadius: boolean;
43
- /**
44
- * Show edit classNames input
45
- */
46
- editClass: boolean;
47
- /**
48
- * Pre-define available classes to select from
49
- *
50
- * Classes can be provided as list of strings or as list of tuples
51
- * `["classname", "human label"]`.
52
- *
53
- * @example
54
- * ```javascript
55
- * new Jodit('#editor', {
56
- * image: {
57
- * availableClasses: [
58
- * "rte-image-width-50",
59
- * ["rte-image-width-75", "75 % width"]
60
- * ]
61
- * }
62
- * })
63
- * ```
64
- */
65
- availableClasses: [
66
- string,
67
- string
68
- ][] | string[];
69
- /**
70
- * Show style edit input
71
- */
72
- editStyle: boolean;
73
- /**
74
- * Show edit ID input
75
- */
76
- editId: boolean;
77
- /**
78
- * Show Alignment selector
79
- */
80
- editAlign: boolean;
81
- /**
82
- * Show preview image
83
- */
84
- showPreview: boolean;
85
- /**
86
- * Select image after close dialog
87
- */
88
- selectImageAfterClose: boolean;
89
- };
12
+ image: ImagePropertiesOptions;
90
13
  }
91
14
  }
92
- export {};
@@ -9,27 +9,34 @@
9
9
  * @module plugins/image-properties
10
10
  */
11
11
  import type { IJodit } from "jodit/esm/types";
12
- import { Plugin } from "jodit/esm/modules";
12
+ import { Plugin } from "jodit/esm/core/plugin/plugin";
13
13
  import "./config";
14
-
14
+ import type { ImagePropertiesState } from "./interface";
15
+ /**
16
+ * Plug-in for image editing window
17
+ *
18
+ * @example
19
+ * ```javascript
20
+ * const editor = Jodit.make('#editor', {
21
+ * image: {
22
+ * editSrc: false,
23
+ * editLink: false
24
+ * }
25
+ * });
26
+ * ```
27
+ */
15
28
  /**
16
29
  * Show dialog with image's options
17
30
  */
18
31
  export declare class imageProperties extends Plugin {
19
- protected state: {
20
- image: HTMLImageElement;
21
- ratio: number;
22
- sizeIsLocked: boolean;
23
- marginIsLocked: boolean;
24
- };
32
+ protected state: ImagePropertiesState;
25
33
  private activeTabState;
26
- protected onChangeMarginIsLocked(): void;
27
- protected onChangeSizeIsLocked(): void;
28
- private form;
34
+ private get form();
29
35
  /**
30
36
  * Dialog for form
31
37
  */
32
- private dialog;
38
+ private get dialog();
39
+ private get __buttons();
33
40
  /**
34
41
  * Open dialog editing image properties
35
42
  *
@@ -45,28 +52,11 @@ export declare class imageProperties extends Plugin {
45
52
  * ```
46
53
  */
47
54
  protected open(): void | false;
48
- /**
49
- * Create form for edit image properties
50
- */
51
- private makeForm;
52
- /**
53
- * Set input values from image
54
- */
55
- private updateValues;
56
- /**
57
- * Apply form's values to image
58
- */
59
- private onApply;
60
- /**
61
- * Open image editor dialog
62
- */
63
- private openImageEditor;
64
- /**
65
- * Open popup with filebrowser/uploader buttons for image
66
- */
67
- private openImagePopup;
55
+ private __lock;
56
+ private __unlock;
68
57
  /** @override **/
69
58
  protected afterInit(editor: IJodit): void;
59
+ protected onStateValuesImageSrcChange(): Promise<void>;
70
60
  /** @override */
71
61
  protected beforeDestruct(editor: IJodit): void;
72
62
  }
@@ -3,8 +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
- import type { IJodit } from "jodit/esm/types";
10
- export declare function mainTab(editor: IJodit): HTMLElement;
6
+ import type { EditValues } from "../interface";
7
+ /** @private */
8
+ export declare function readAlign(image: HTMLImageElement, values: EditValues): void;
@@ -0,0 +1,12 @@
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
+ import type { IJodit } from "jodit/esm/types";
7
+ import type { ImagePropertiesState } from "../interface";
8
+ /**
9
+ * Read values from image and set it to state
10
+ * @private
11
+ */
12
+ export declare function readValuesFromImage(j: IJodit, state: ImagePropertiesState): Promise<void>;
@@ -0,0 +1,9 @@
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
+ import type { IJodit } from "jodit/esm/types";
7
+ import type { EditValues, ImagePropertiesState } from "../interface";
8
+ /** @private */
9
+ export declare function readLink(state: ImagePropertiesState, j: IJodit, values: EditValues): void;
@@ -0,0 +1,8 @@
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
+ import type { EditValues, ImagePropertiesState } from "../interface";
7
+ /** @private */
8
+ export declare function readMargins(image: HTMLImageElement, values: EditValues, state: ImagePropertiesState): void;
@@ -0,0 +1,8 @@
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
+ import type { EditValues, ImagePropertiesState } from "../interface";
7
+ /** @private */
8
+ export declare function readSizes(image: HTMLImageElement, values: EditValues, state: ImagePropertiesState): Promise<void>;
@@ -0,0 +1,29 @@
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
+ import type { IComponent, IContainer, IElms, IJodit, Nullable } from "jodit/esm/types";
7
+ import { UIGroup } from "jodit/esm/core/ui/group/group";
8
+ import type { ImagePropertiesAPI, ImagePropertiesState } from "../interface";
9
+
10
+ /** @private */
11
+ export declare class UIImagePropertiesForm extends UIGroup<IJodit> {
12
+ private state;
13
+ private handlers;
14
+ className(): string;
15
+ appendChildToContainer(): void;
16
+ getElm<T extends IComponent & IContainer & IElms>(elementName: string): Nullable<HTMLElement>;
17
+ private __mainTab;
18
+ private __positionTab;
19
+ constructor(jodit: IJodit, state: ImagePropertiesState, activeTabState: {
20
+ activeTab: 'Image' | 'Advanced';
21
+ }, handlers: ImagePropertiesAPI);
22
+ protected render(): string;
23
+ protected onChangeSizeIsLocked(): void;
24
+ protected onLockSizeClick(): void;
25
+ protected onStateValuesSizeChange(): void;
26
+ protected onImageWidthChange(e: Event): void;
27
+ protected onStateValuesImageSrcChange(): void;
28
+ protected hideFieldByOptions(): void;
29
+ }
@@ -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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ import type { IJodit } from "jodit/esm/types";
7
+ import { UIGroup } from "jodit/esm/core/ui/group/group";
8
+ import type { ImagePropertiesAPI, ImagePropertiesState } from "../interface";
9
+ /** @private */
10
+ export declare class UIImageMainTab extends UIGroup<IJodit> {
11
+ private state;
12
+ private handlers;
13
+ className(): string;
14
+ appendChildToContainer(): void;
15
+ constructor(view: IJodit, state: ImagePropertiesState, handlers: ImagePropertiesAPI);
16
+ protected render(): string;
17
+ protected onStateImageSrcChange(): Promise<void>;
18
+ protected onImageSrcChange(): void;
19
+ /**
20
+ * Open image editor
21
+ */
22
+ protected onEditImageClick(e: MouseEvent): void;
23
+ /**
24
+ * Open popup with filebrowser/uploader buttons for image
25
+ */
26
+ protected onChangeImageClick(e: MouseEvent): void;
27
+ protected onStateTitleChange(): void;
28
+ protected onTitleChange(): void;
29
+ protected onStateAltChange(): void;
30
+ protected onAltChange(): void;
31
+ protected onStateImageLinkChange(): void;
32
+ protected onImageLinkChange(): void;
33
+ protected onStateImageLinkOpenInNewTabChange(): void;
34
+ protected onImageLinkOpenInNewTabChange(): void;
35
+ protected hideFieldByOptions(): void;
36
+ }
@@ -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-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ import type { IJodit } from "jodit/esm/types";
7
+ import { UIElement } from "jodit/esm/core/ui/element";
8
+ import type { ImagePropertiesAPI, ImagePropertiesState } from "../interface";
9
+ /** @private */
10
+ export declare class UIImagePositionTab extends UIElement<IJodit> {
11
+ private state;
12
+ protected handlers: ImagePropertiesAPI;
13
+ className(): string;
14
+ constructor(jodit: IJodit, state: ImagePropertiesState, handlers: ImagePropertiesAPI);
15
+ protected render({ availableClasses }: {
16
+ availableClasses?: string[] | Array<[
17
+ string,
18
+ string
19
+ ]>;
20
+ }): string;
21
+ protected onStateAlignChange(): void;
22
+ protected onChangeAlign(): void;
23
+ protected onStateValuesBorderRadiusChange(): void;
24
+ protected onChangeBorderRadius(): void;
25
+ protected onStateValuesIdChange(): void;
26
+ protected onChangeId(): void;
27
+ protected onStateValuesStyleChange(): void;
28
+ protected onChangeStyle(): void;
29
+ protected onStateValuesClassesChange(): void;
30
+ protected onChangClasses(): void;
31
+ protected onLockMarginClick(e: MouseEvent): void;
32
+ protected onChangeMarginIsLocked(): void;
33
+ protected onStateValuesMarginChange(): void;
34
+ protected onChangeMargin(): void;
35
+ protected hideFieldByOptions(): void;
36
+ }
@@ -0,0 +1,12 @@
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
+ import type { IJodit } from "jodit/esm/types";
7
+ import type { ImagePropertiesState } from "../interface";
8
+ /**
9
+ * Open image editor dialog
10
+ * @private
11
+ */
12
+ export declare function openImageEditorDialog(j: IJodit, state: ImagePropertiesState): void;
@@ -0,0 +1,9 @@
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
+ import type { IDialog, IJodit } from "jodit/esm/types";
7
+ import type { ImagePropertiesState } from "../interface";
8
+ /** @private */
9
+ export declare function openImagePopup(j: IJodit, dialog: IDialog, state: ImagePropertiesState, button: HTMLElement): void;
@@ -0,0 +1,9 @@
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
+ /** @private */
7
+ export declare const normalSizeFromString: (value: string | number) => string | number;
8
+ /** @private */
9
+ export declare const normalSizeToString: (value: string | number) => string;
@@ -0,0 +1,12 @@
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
+ import type { IJodit } from "jodit/esm/types";
7
+ import type { ImagePropertiesState } from "../interface";
8
+ /**
9
+ * Apply form's values to image
10
+ * @private
11
+ */
12
+ export declare function applyValuesToImage(j: IJodit, state: ImagePropertiesState, image: HTMLImageElement): void;
@@ -3,8 +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 { IJodit } from "jodit/esm/types";
10
- export declare function positionTab(editor: IJodit): HTMLElement;
7
+ /** @private */
8
+ export declare function applyLink(j: IJodit, image: HTMLImageElement, imageLink: string, imageLinkOpenInNewTab: boolean): void;
@@ -0,0 +1,8 @@
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
+ import type { IJodit } from "jodit/esm/types";
7
+ /** @private */
8
+ export declare function applyMargin(j: IJodit, marginTop: number | string, marginRight: number | string, marginBottom: number | string, marginLeft: number | string, image: HTMLImageElement, marginIsLocked: boolean): void;
@@ -0,0 +1,7 @@
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
+ /** @private */
7
+ export declare function applySize(image: HTMLImageElement, imageWidth: number | string, imageHeight: number | string, sizeIsLocked: boolean): void;
@@ -15,6 +15,13 @@ declare module 'jodit/config' {
15
15
  * `<ul><li>|test|</li><li>|test</li></ul>` will be `<ul>|<li>test</li><li>|test</li></ul>`
16
16
  */
17
17
  normalizeSelectionBeforeCutAndCopy: boolean;
18
+ /**
19
+ * Normalize selection after triple click
20
+ * @example
21
+ *
22
+ * `<ul><li>|test</li><li>|pop</li></ul>` will be `<ul><li>|test|</li><li>pop</li</ul>|`
23
+ */
24
+ normalizeTripleClick: boolean;
18
25
  };
19
26
  }
20
27
  }
@@ -28,10 +28,14 @@ export declare class select extends Plugin {
28
28
  protected beforeDestruct(jodit: IJodit): void;
29
29
  private onStartSelection;
30
30
  /**
31
- * @event outsideClick(e) - when user clicked in the outside of editor
31
+ * @event outsideClick(e) - when user clicked on the outside of editor
32
32
  */
33
33
  protected onOutsideClick(e: MouseEvent): void;
34
- protected beforeCommandCut(command: string): void | false;
35
- protected beforeCommandSelectall(command: string): false;
34
+ protected beforeCommandCut(): void | false;
35
+ protected beforeCommandSelectAll(): false;
36
+ /**
37
+ * Normalize selection after triple click
38
+ */
39
+ protected onTripleClickNormalizeSelection(e: MouseEvent): void;
36
40
  protected onCopyNormalizeSelectionBound(e?: ClipboardEvent): void;
37
41
  }
@@ -30,7 +30,7 @@ export interface IUIIconState {
30
30
  iconURL: string;
31
31
  fill: string;
32
32
  }
33
- export type ButtonVariant = 'initial' | 'default' | 'primary' | 'secondary' | 'success' | 'danger';
33
+ export type ButtonVariant = 'initial' | 'outline' | 'default' | 'primary' | 'secondary' | 'success' | 'danger';
34
34
  export interface IUIButtonState {
35
35
  size: 'tiny' | 'xsmall' | 'small' | 'middle' | 'large';
36
36
  name: string;
@@ -1,26 +0,0 @@
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
- import { Icon } from "jodit/esm/core/ui/icon.js";
7
- export function form(editor) {
8
- const { showPreview, editSize } = editor.o.image, gi = Icon.get.bind(Icon);
9
- return editor.c.fromHTML(`<form class="jodit-properties">
10
- <div class="jodit-grid jodit-grid_xs-column">
11
- <div class="jodit_col-lg-2-5 jodit_col-xs-5-5">
12
- <div class="jodit-properties_view_box">
13
- <div style="${!showPreview ? 'display:none' : ''}" class="jodit-properties_image_view">
14
- <img data-ref="imageViewSrc" src="" alt=""/>
15
- </div>
16
- <div style="${!editSize ? 'display:none' : ''}" class="jodit-form__group jodit-properties_image_sizes">
17
- <input data-ref="imageWidth" type="text" class="jodit-input"/>
18
- <a data-ref="lockSize" class="jodit-properties__lock">${gi('lock')}</a>
19
- <input data-ref="imageHeight" type="text" class="imageHeight jodit-input"/>
20
- </div>
21
- </div>
22
- </div>
23
- <div data-ref="tabsBox" class="jodit_col-lg-3-5 jodit_col-xs-5-5"></div>
24
- </div>
25
- </form>`);
26
- }