@ckeditor/ckeditor5-image 45.2.1 → 46.0.0-alpha.1

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 (127) hide show
  1. package/build/image.js +1 -1
  2. package/dist/index-content.css +18 -17
  3. package/dist/index-editor.css +96 -96
  4. package/dist/index.css +164 -163
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.js +93 -44
  7. package/dist/index.js.map +1 -1
  8. package/package.json +13 -13
  9. package/src/autoimage.d.ts +2 -2
  10. package/src/autoimage.js +8 -8
  11. package/src/image/converters.d.ts +1 -1
  12. package/src/image/imageblockediting.d.ts +5 -5
  13. package/src/image/imageblockediting.js +8 -8
  14. package/src/image/imageediting.d.ts +2 -2
  15. package/src/image/imageediting.js +5 -5
  16. package/src/image/imageinlineediting.d.ts +5 -5
  17. package/src/image/imageinlineediting.js +8 -8
  18. package/src/image/imageloadobserver.d.ts +7 -7
  19. package/src/image/imageloadobserver.js +6 -6
  20. package/src/image/imageplaceholder.d.ts +2 -2
  21. package/src/image/imageplaceholder.js +3 -3
  22. package/src/image/imagetypecommand.d.ts +4 -4
  23. package/src/image/imagetypecommand.js +1 -1
  24. package/src/image/insertimagecommand.d.ts +1 -1
  25. package/src/image/insertimagecommand.js +1 -1
  26. package/src/image/replaceimagesourcecommand.d.ts +3 -3
  27. package/src/image/replaceimagesourcecommand.js +1 -1
  28. package/src/image/ui/utils.d.ts +4 -2
  29. package/src/image/ui/utils.js +2 -0
  30. package/src/image/utils.d.ts +8 -4
  31. package/src/image/utils.js +4 -0
  32. package/src/image.d.ts +3 -3
  33. package/src/image.js +3 -3
  34. package/src/imageblock.d.ts +4 -4
  35. package/src/imageblock.js +4 -4
  36. package/src/imagecaption/imagecaptionediting.d.ts +8 -8
  37. package/src/imagecaption/imagecaptionediting.js +9 -9
  38. package/src/imagecaption/imagecaptionui.d.ts +2 -2
  39. package/src/imagecaption/imagecaptionui.js +2 -2
  40. package/src/imagecaption/imagecaptionutils.d.ts +5 -5
  41. package/src/imagecaption/imagecaptionutils.js +2 -2
  42. package/src/imagecaption/toggleimagecaptioncommand.d.ts +1 -1
  43. package/src/imagecaption/toggleimagecaptioncommand.js +2 -2
  44. package/src/imagecaption.d.ts +3 -3
  45. package/src/imagecaption.js +3 -3
  46. package/src/imageinline.d.ts +4 -4
  47. package/src/imageinline.js +4 -4
  48. package/src/imageinsert/imageinsertui.d.ts +2 -2
  49. package/src/imageinsert/imageinsertui.js +3 -3
  50. package/src/imageinsert/imageinsertviaurlui.d.ts +2 -2
  51. package/src/imageinsert/imageinsertviaurlui.js +3 -3
  52. package/src/imageinsert/ui/imageinsertformview.d.ts +3 -1
  53. package/src/imageinsert/ui/imageinsertformview.js +3 -1
  54. package/src/imageinsert/ui/imageinserturlview.d.ts +3 -1
  55. package/src/imageinsert/ui/imageinserturlview.js +3 -1
  56. package/src/imageinsert.d.ts +4 -4
  57. package/src/imageinsert.js +4 -4
  58. package/src/imageinsertviaurl.d.ts +3 -3
  59. package/src/imageinsertviaurl.js +3 -3
  60. package/src/imageresize/imagecustomresizeui.d.ts +1 -1
  61. package/src/imageresize/imagecustomresizeui.js +2 -2
  62. package/src/imageresize/imageresizebuttons.d.ts +2 -2
  63. package/src/imageresize/imageresizebuttons.js +5 -5
  64. package/src/imageresize/imageresizeediting.d.ts +2 -2
  65. package/src/imageresize/imageresizeediting.js +10 -5
  66. package/src/imageresize/imageresizehandles.d.ts +2 -2
  67. package/src/imageresize/imageresizehandles.js +3 -3
  68. package/src/imageresize/resizeimagecommand.d.ts +1 -1
  69. package/src/imageresize/resizeimagecommand.js +1 -1
  70. package/src/imageresize/ui/imagecustomresizeformview.d.ts +5 -1
  71. package/src/imageresize/ui/imagecustomresizeformview.js +3 -1
  72. package/src/imageresize/utils/getselectedimageeditornodes.d.ts +3 -2
  73. package/src/imageresize/utils/getselectedimageeditornodes.js +1 -0
  74. package/src/imageresize/utils/getselectedimagepossibleresizerange.d.ts +1 -0
  75. package/src/imageresize/utils/getselectedimagepossibleresizerange.js +1 -0
  76. package/src/imageresize/utils/getselectedimagewidthinunits.d.ts +1 -0
  77. package/src/imageresize/utils/getselectedimagewidthinunits.js +1 -0
  78. package/src/imageresize/utils/tryparsedimensionwithunit.d.ts +2 -0
  79. package/src/imageresize/utils/tryparsedimensionwithunit.js +2 -0
  80. package/src/imageresize.d.ts +5 -5
  81. package/src/imageresize.js +5 -5
  82. package/src/imagesizeattributes.d.ts +2 -2
  83. package/src/imagesizeattributes.js +5 -4
  84. package/src/imagestyle/converters.d.ts +2 -0
  85. package/src/imagestyle/converters.js +2 -0
  86. package/src/imagestyle/imagestylecommand.d.ts +3 -3
  87. package/src/imagestyle/imagestylecommand.js +1 -1
  88. package/src/imagestyle/imagestyleediting.d.ts +2 -2
  89. package/src/imagestyle/imagestyleediting.js +8 -7
  90. package/src/imagestyle/imagestyleui.d.ts +2 -2
  91. package/src/imagestyle/imagestyleui.js +3 -3
  92. package/src/imagestyle/utils.d.ts +11 -5
  93. package/src/imagestyle/utils.js +11 -5
  94. package/src/imagestyle.d.ts +3 -3
  95. package/src/imagestyle.js +3 -3
  96. package/src/imagetextalternative/imagetextalternativecommand.d.ts +1 -1
  97. package/src/imagetextalternative/imagetextalternativecommand.js +1 -1
  98. package/src/imagetextalternative/imagetextalternativeediting.d.ts +2 -2
  99. package/src/imagetextalternative/imagetextalternativeediting.js +3 -3
  100. package/src/imagetextalternative/imagetextalternativeui.d.ts +1 -1
  101. package/src/imagetextalternative/imagetextalternativeui.js +2 -2
  102. package/src/imagetextalternative/ui/textalternativeformview.d.ts +5 -1
  103. package/src/imagetextalternative/ui/textalternativeformview.js +3 -1
  104. package/src/imagetextalternative.d.ts +3 -3
  105. package/src/imagetextalternative.js +3 -3
  106. package/src/imagetoolbar.d.ts +2 -2
  107. package/src/imagetoolbar.js +2 -2
  108. package/src/imageupload/imageuploadediting.d.ts +11 -9
  109. package/src/imageupload/imageuploadediting.js +10 -8
  110. package/src/imageupload/imageuploadprogress.d.ts +1 -1
  111. package/src/imageupload/imageuploadprogress.js +5 -5
  112. package/src/imageupload/imageuploadui.d.ts +1 -1
  113. package/src/imageupload/imageuploadui.js +1 -1
  114. package/src/imageupload/uploadimagecommand.d.ts +1 -1
  115. package/src/imageupload/uploadimagecommand.js +1 -1
  116. package/src/imageupload/utils.d.ts +3 -1
  117. package/src/imageupload/utils.js +2 -0
  118. package/src/imageupload.d.ts +4 -4
  119. package/src/imageupload.js +4 -4
  120. package/src/imageutils.d.ts +13 -13
  121. package/src/imageutils.js +4 -4
  122. package/src/index.d.ts +63 -42
  123. package/src/index.js +58 -32
  124. package/src/pictureediting.d.ts +3 -3
  125. package/src/pictureediting.js +3 -3
  126. package/theme/imagecaption.css +7 -6
  127. package/theme/imagestyle.css +12 -12
@@ -24,6 +24,8 @@ import { IconObjectCenter, IconObjectFullWidth, IconObjectInline, IconObjectInli
24
24
  * * **`'inline'`** is an inline image without any CSS class,
25
25
  * * **`'block'`** is a block image without any CSS class,
26
26
  * * **`'side'`** is a block image styled with the `image-style-side` CSS class.
27
+ *
28
+ * @internal
27
29
  */
28
30
  export const DEFAULT_OPTIONS = {
29
31
  // This style represents an image placed in the line of text.
@@ -114,6 +116,8 @@ export const DEFAULT_OPTIONS = {
114
116
  * See {@link module:image/imageconfig~ImageStyleOptionDefinition#icon} to learn more.
115
117
  *
116
118
  * There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.
119
+ *
120
+ * @internal
117
121
  */
118
122
  export const DEFAULT_ICONS = /* #__PURE__ */ (() => ({
119
123
  full: IconObjectFullWidth,
@@ -134,6 +138,8 @@ export const DEFAULT_ICONS = /* #__PURE__ */ (() => ({
134
138
  * those that wraps the text around the image,
135
139
  * * **`'imageStyle:breakText'`**, which contains the `alignBlockLeft`, `alignCenter` and `alignBlockRight` options, that is,
136
140
  * those that breaks the text around the image.
141
+ *
142
+ * @internal
137
143
  */
138
144
  export const DEFAULT_DROPDOWN_DEFINITIONS = [{
139
145
  name: 'imageStyle:wrapText',
@@ -316,12 +322,12 @@ function warnInvalidStyle(info) {
316
322
  */
317
323
  logWarning('image-style-configuration-definition-invalid', info);
318
324
  }
319
- export default {
325
+ /**
326
+ * @internal
327
+ */
328
+ export const utils = {
320
329
  normalizeStyles,
321
330
  getDefaultStylesConfiguration,
322
331
  getDefaultDropdownDefinitions,
323
- warnInvalidStyle,
324
- DEFAULT_OPTIONS,
325
- DEFAULT_ICONS,
326
- DEFAULT_DROPDOWN_DEFINITIONS
332
+ warnInvalidStyle
327
333
  };
@@ -6,8 +6,8 @@
6
6
  * @module image/imagestyle
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageStyleEditing from './imagestyle/imagestyleediting.js';
10
- import ImageStyleUI from './imagestyle/imagestyleui.js';
9
+ import { ImageStyleEditing } from './imagestyle/imagestyleediting.js';
10
+ import { ImageStyleUI } from './imagestyle/imagestyleui.js';
11
11
  /**
12
12
  * The image style plugin.
13
13
  *
@@ -20,7 +20,7 @@ import ImageStyleUI from './imagestyle/imagestyleui.js';
20
20
  * It provides a default configuration, which can be extended or overwritten.
21
21
  * Read more about the {@link module:image/imageconfig~ImageConfig#styles image styles configuration}.
22
22
  */
23
- export default class ImageStyle extends Plugin {
23
+ export declare class ImageStyle extends Plugin {
24
24
  /**
25
25
  * @inheritDoc
26
26
  */
package/src/imagestyle.js CHANGED
@@ -6,8 +6,8 @@
6
6
  * @module image/imagestyle
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageStyleEditing from './imagestyle/imagestyleediting.js';
10
- import ImageStyleUI from './imagestyle/imagestyleui.js';
9
+ import { ImageStyleEditing } from './imagestyle/imagestyleediting.js';
10
+ import { ImageStyleUI } from './imagestyle/imagestyleui.js';
11
11
  /**
12
12
  * The image style plugin.
13
13
  *
@@ -20,7 +20,7 @@ import ImageStyleUI from './imagestyle/imagestyleui.js';
20
20
  * It provides a default configuration, which can be extended or overwritten.
21
21
  * Read more about the {@link module:image/imageconfig~ImageConfig#styles image styles configuration}.
22
22
  */
23
- export default class ImageStyle extends Plugin {
23
+ export class ImageStyle extends Plugin {
24
24
  /**
25
25
  * @inheritDoc
26
26
  */
@@ -9,7 +9,7 @@ import { Command } from 'ckeditor5/src/core.js';
9
9
  /**
10
10
  * The image text alternative command. It is used to change the `alt` attribute of `<imageBlock>` and `<imageInline>` model elements.
11
11
  */
12
- export default class ImageTextAlternativeCommand extends Command {
12
+ export declare class ImageTextAlternativeCommand extends Command {
13
13
  /**
14
14
  * The command value: `false` if there is no `alt` attribute, otherwise the value of the `alt` attribute.
15
15
  *
@@ -9,7 +9,7 @@ import { Command } from 'ckeditor5/src/core.js';
9
9
  /**
10
10
  * The image text alternative command. It is used to change the `alt` attribute of `<imageBlock>` and `<imageInline>` model elements.
11
11
  */
12
- export default class ImageTextAlternativeCommand extends Command {
12
+ export class ImageTextAlternativeCommand extends Command {
13
13
  /**
14
14
  * @inheritDoc
15
15
  */
@@ -6,13 +6,13 @@
6
6
  * @module image/imagetextalternative/imagetextalternativeediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageUtils from '../imageutils.js';
9
+ import { ImageUtils } from '../imageutils.js';
10
10
  /**
11
11
  * The image text alternative editing plugin.
12
12
  *
13
13
  * Registers the `'imageTextAlternative'` command.
14
14
  */
15
- export default class ImageTextAlternativeEditing extends Plugin {
15
+ export declare class ImageTextAlternativeEditing extends Plugin {
16
16
  /**
17
17
  * @inheritDoc
18
18
  */
@@ -6,14 +6,14 @@
6
6
  * @module image/imagetextalternative/imagetextalternativeediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageTextAlternativeCommand from './imagetextalternativecommand.js';
10
- import ImageUtils from '../imageutils.js';
9
+ import { ImageTextAlternativeCommand } from './imagetextalternativecommand.js';
10
+ import { ImageUtils } from '../imageutils.js';
11
11
  /**
12
12
  * The image text alternative editing plugin.
13
13
  *
14
14
  * Registers the `'imageTextAlternative'` command.
15
15
  */
16
- export default class ImageTextAlternativeEditing extends Plugin {
16
+ export class ImageTextAlternativeEditing extends Plugin {
17
17
  /**
18
18
  * @inheritDoc
19
19
  */
@@ -12,7 +12,7 @@ import { ContextualBalloon } from 'ckeditor5/src/ui.js';
12
12
  *
13
13
  * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
14
14
  */
15
- export default class ImageTextAlternativeUI extends Plugin {
15
+ export declare class ImageTextAlternativeUI extends Plugin {
16
16
  /**
17
17
  * The contextual balloon plugin instance.
18
18
  */
@@ -8,14 +8,14 @@
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { ButtonView, ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui.js';
10
10
  import { IconTextAlternative } from 'ckeditor5/src/icons.js';
11
- import TextAlternativeFormView from './ui/textalternativeformview.js';
11
+ import { TextAlternativeFormView } from './ui/textalternativeformview.js';
12
12
  import { repositionContextualBalloon, getBalloonPositionData } from '../image/ui/utils.js';
13
13
  /**
14
14
  * The image text alternative UI plugin.
15
15
  *
16
16
  * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
17
17
  */
18
- export default class ImageTextAlternativeUI extends Plugin {
18
+ export class ImageTextAlternativeUI extends Plugin {
19
19
  /**
20
20
  * The contextual balloon plugin instance.
21
21
  */
@@ -12,8 +12,10 @@ import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.c
12
12
  import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
13
13
  /**
14
14
  * The TextAlternativeFormView class.
15
+ *
16
+ * @internal
15
17
  */
16
- export default class TextAlternativeFormView extends View {
18
+ export declare class TextAlternativeFormView extends View {
17
19
  /**
18
20
  * Tracks information about the DOM focus in the form.
19
21
  */
@@ -81,6 +83,7 @@ export default class TextAlternativeFormView extends View {
81
83
  * Fired when the form view is submitted.
82
84
  *
83
85
  * @eventName ~TextAlternativeFormView#submit
86
+ * @internal
84
87
  */
85
88
  export type TextAlternativeFormViewSubmitEvent = {
86
89
  name: 'submit';
@@ -90,6 +93,7 @@ export type TextAlternativeFormViewSubmitEvent = {
90
93
  * Fired when the form view is canceled.
91
94
  *
92
95
  * @eventName ~TextAlternativeFormView#cancel
96
+ * @internal
93
97
  */
94
98
  export type TextAlternativeFormViewCancelEvent = {
95
99
  name: 'cancel';
@@ -16,8 +16,10 @@ import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.c
16
16
  import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
17
17
  /**
18
18
  * The TextAlternativeFormView class.
19
+ *
20
+ * @internal
19
21
  */
20
- export default class TextAlternativeFormView extends View {
22
+ export class TextAlternativeFormView extends View {
21
23
  /**
22
24
  * Tracks information about the DOM focus in the form.
23
25
  */
@@ -6,8 +6,8 @@
6
6
  * @module image/imagetextalternative
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageTextAlternativeEditing from './imagetextalternative/imagetextalternativeediting.js';
10
- import ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeui.js';
9
+ import { ImageTextAlternativeEditing } from './imagetextalternative/imagetextalternativeediting.js';
10
+ import { ImageTextAlternativeUI } from './imagetextalternative/imagetextalternativeui.js';
11
11
  /**
12
12
  * The image text alternative plugin.
13
13
  *
@@ -17,7 +17,7 @@ import ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeu
17
17
  * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
18
18
  * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
19
19
  */
20
- export default class ImageTextAlternative extends Plugin {
20
+ export declare class ImageTextAlternative extends Plugin {
21
21
  /**
22
22
  * @inheritDoc
23
23
  */
@@ -6,8 +6,8 @@
6
6
  * @module image/imagetextalternative
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageTextAlternativeEditing from './imagetextalternative/imagetextalternativeediting.js';
10
- import ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeui.js';
9
+ import { ImageTextAlternativeEditing } from './imagetextalternative/imagetextalternativeediting.js';
10
+ import { ImageTextAlternativeUI } from './imagetextalternative/imagetextalternativeui.js';
11
11
  /**
12
12
  * The image text alternative plugin.
13
13
  *
@@ -17,7 +17,7 @@ import ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeu
17
17
  * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
18
18
  * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
19
19
  */
20
- export default class ImageTextAlternative extends Plugin {
20
+ export class ImageTextAlternative extends Plugin {
21
21
  /**
22
22
  * @inheritDoc
23
23
  */
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';
10
- import ImageUtils from './imageutils.js';
10
+ import { ImageUtils } from './imageutils.js';
11
11
  /**
12
12
  * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
13
13
  *
@@ -19,7 +19,7 @@ import ImageUtils from './imageutils.js';
19
19
  *
20
20
  * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
21
21
  */
22
- export default class ImageToolbar extends Plugin {
22
+ export declare class ImageToolbar extends Plugin {
23
23
  /**
24
24
  * @inheritDoc
25
25
  */
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';
10
- import ImageUtils from './imageutils.js';
10
+ import { ImageUtils } from './imageutils.js';
11
11
  import { isObject } from 'es-toolkit/compat';
12
12
  /**
13
13
  * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
@@ -20,7 +20,7 @@ import { isObject } from 'es-toolkit/compat';
20
20
  *
21
21
  * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
22
22
  */
23
- export default class ImageToolbar extends Plugin {
23
+ export class ImageToolbar extends Plugin {
24
24
  /**
25
25
  * @inheritDoc
26
26
  */
@@ -6,19 +6,19 @@
6
6
  * @module image/imageupload/imageuploadediting
7
7
  */
8
8
  import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
- import { type Element, type Writer, type DataTransfer } from 'ckeditor5/src/engine.js';
9
+ import { type ModelElement, type ModelWriter, type ViewDataTransfer } from 'ckeditor5/src/engine.js';
10
10
  import { Notification } from 'ckeditor5/src/ui.js';
11
11
  import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
12
12
  import { FileRepository, type UploadResponse, type FileLoader } from 'ckeditor5/src/upload.js';
13
- import ImageUtils from '../imageutils.js';
13
+ import { ImageUtils } from '../imageutils.js';
14
14
  /**
15
15
  * The editing part of the image upload feature. It registers the `'uploadImage'` command
16
16
  * and the `imageUpload` command as an aliased name.
17
17
  *
18
18
  * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete`} event
19
- * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.
19
+ * that allows adding custom attributes to the {@link module:engine/model/element~ModelElement image element}.
20
20
  */
21
- export default class ImageUploadEditing extends Plugin {
21
+ export declare class ImageUploadEditing extends Plugin {
22
22
  /**
23
23
  * @inheritDoc
24
24
  */
@@ -71,7 +71,7 @@ export default class ImageUploadEditing extends Plugin {
71
71
  * @param data Data object from which `srcset` will be created.
72
72
  * @param image The image element on which the `srcset` attribute will be set.
73
73
  */
74
- protected _parseAndSetSrcsetAttributeOnImage(data: Record<string, unknown>, image: Element, writer: Writer): void;
74
+ protected _parseAndSetSrcsetAttributeOnImage(data: Record<string, unknown>, image: ModelElement, writer: ModelWriter): void;
75
75
  /**
76
76
  * Registers image upload converters.
77
77
  *
@@ -80,12 +80,14 @@ export default class ImageUploadEditing extends Plugin {
80
80
  private _registerConverters;
81
81
  }
82
82
  /**
83
+ * TODO move this to the clipboard package.
84
+ *
83
85
  * Returns `true` if non-empty `text/html` is included in the data transfer.
84
86
  */
85
- export declare function isHtmlIncluded(dataTransfer: DataTransfer): boolean;
87
+ export declare function isHtmlInDataTransfer(dataTransfer: ViewDataTransfer): boolean;
86
88
  /**
87
89
  * An event fired when an image is uploaded. You can hook into this event to provide
88
- * custom attributes to the {@link module:engine/model/element~Element image element} based on the data from
90
+ * custom attributes to the {@link module:engine/model/element~ModelElement image element} based on the data from
89
91
  * the server.
90
92
  *
91
93
  * ```ts
@@ -122,7 +124,7 @@ export type ImageUploadCompleteData = {
122
124
  */
123
125
  data: UploadResponse;
124
126
  /**
125
- * The model {@link module:engine/model/element~Element image element} that can be customized.
127
+ * The model {@link module:engine/model/element~ModelElement image element} that can be customized.
126
128
  */
127
- imageElement: Element;
129
+ imageElement: ModelElement;
128
130
  };
@@ -6,13 +6,13 @@
6
6
  * @module image/imageupload/imageuploadediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { UpcastWriter } from 'ckeditor5/src/engine.js';
9
+ import { ViewUpcastWriter } from 'ckeditor5/src/engine.js';
10
10
  import { Notification } from 'ckeditor5/src/ui.js';
11
11
  import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
12
12
  import { FileRepository } from 'ckeditor5/src/upload.js';
13
13
  import { env } from 'ckeditor5/src/utils.js';
14
- import ImageUtils from '../imageutils.js';
15
- import UploadImageCommand from './uploadimagecommand.js';
14
+ import { ImageUtils } from '../imageutils.js';
15
+ import { UploadImageCommand } from './uploadimagecommand.js';
16
16
  import { fetchLocalImage, isLocalImage } from '../../src/imageupload/utils.js';
17
17
  import { createImageTypeRegExp } from './utils.js';
18
18
  /**
@@ -20,9 +20,9 @@ import { createImageTypeRegExp } from './utils.js';
20
20
  * and the `imageUpload` command as an aliased name.
21
21
  *
22
22
  * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete`} event
23
- * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.
23
+ * that allows adding custom attributes to the {@link module:engine/model/element~ModelElement image element}.
24
24
  */
25
- export default class ImageUploadEditing extends Plugin {
25
+ export class ImageUploadEditing extends Plugin {
26
26
  /**
27
27
  * @inheritDoc
28
28
  */
@@ -121,7 +121,7 @@ export default class ImageUploadEditing extends Plugin {
121
121
  this.listenTo(editor.editing.view.document, 'clipboardInput', (evt, data) => {
122
122
  // Skip if non empty HTML data is included.
123
123
  // https://github.com/ckeditor/ckeditor5-upload/issues/68
124
- if (isHtmlIncluded(data.dataTransfer)) {
124
+ if (isHtmlInDataTransfer(data.dataTransfer)) {
125
125
  return;
126
126
  }
127
127
  const images = Array.from(data.dataTransfer.files).filter(file => {
@@ -164,7 +164,7 @@ export default class ImageUploadEditing extends Plugin {
164
164
  if (!fetchableImages.length) {
165
165
  return;
166
166
  }
167
- const writer = new UpcastWriter(editor.editing.view.document);
167
+ const writer = new ViewUpcastWriter(editor.editing.view.document);
168
168
  for (const fetchableImage of fetchableImages) {
169
169
  // Set attribute marking that the image was processed already.
170
170
  writer.setAttribute('uploadProcessed', true, fetchableImage.imageElement);
@@ -462,9 +462,11 @@ export default class ImageUploadEditing extends Plugin {
462
462
  }
463
463
  }
464
464
  /**
465
+ * TODO move this to the clipboard package.
466
+ *
465
467
  * Returns `true` if non-empty `text/html` is included in the data transfer.
466
468
  */
467
- export function isHtmlIncluded(dataTransfer) {
469
+ export function isHtmlInDataTransfer(dataTransfer) {
468
470
  return Array.from(dataTransfer.types).includes('text/html') && dataTransfer.getData('text/html') !== '';
469
471
  }
470
472
  function getImagesFromChangeItem(editor, item) {
@@ -13,7 +13,7 @@ import '../../theme/imageuploadloader.css';
13
13
  * The image upload progress plugin.
14
14
  * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
15
15
  */
16
- export default class ImageUploadProgress extends Plugin {
16
+ export declare class ImageUploadProgress extends Plugin {
17
17
  /**
18
18
  * @inheritDoc
19
19
  */
@@ -14,7 +14,7 @@ import '../../theme/imageuploadloader.css';
14
14
  * The image upload progress plugin.
15
15
  * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
16
16
  */
17
- export default class ImageUploadProgress extends Plugin {
17
+ export class ImageUploadProgress extends Plugin {
18
18
  /**
19
19
  * @inheritDoc
20
20
  */
@@ -176,7 +176,7 @@ function _showCompleteIcon(viewFigure, writer, view) {
176
176
  }, 3000);
177
177
  }
178
178
  /**
179
- * Create progress bar element using {@link module:engine/view/uielement~UIElement}.
179
+ * Create progress bar element using {@link module:engine/view/uielement~ViewUIElement}.
180
180
  */
181
181
  function _createProgressBar(writer) {
182
182
  const progressBar = writer.createUIElement('div', { class: 'ck-progress-bar' });
@@ -184,7 +184,7 @@ function _createProgressBar(writer) {
184
184
  return progressBar;
185
185
  }
186
186
  /**
187
- * Create placeholder element using {@link module:engine/view/uielement~UIElement}.
187
+ * Create placeholder element using {@link module:engine/view/uielement~ViewUIElement}.
188
188
  */
189
189
  function _createPlaceholder(writer) {
190
190
  const placeholder = writer.createUIElement('div', { class: 'ck-upload-placeholder-loader' });
@@ -192,7 +192,7 @@ function _createPlaceholder(writer) {
192
192
  return placeholder;
193
193
  }
194
194
  /**
195
- * Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
195
+ * Returns {@link module:engine/view/uielement~ViewUIElement} of given unique property from image figure element.
196
196
  * Returns `undefined` if element is not found.
197
197
  */
198
198
  function _getUIElement(imageFigure, uniqueProperty) {
@@ -203,7 +203,7 @@ function _getUIElement(imageFigure, uniqueProperty) {
203
203
  }
204
204
  }
205
205
  /**
206
- * Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.
206
+ * Removes {@link module:engine/view/uielement~ViewUIElement} of given unique property from image figure element.
207
207
  */
208
208
  function _removeUIElement(viewFigure, writer, uniqueProperty) {
209
209
  const element = _getUIElement(viewFigure, uniqueProperty);
@@ -19,7 +19,7 @@ import { Plugin } from 'ckeditor5/src/core.js';
19
19
  * It also integrates with the `insertImage` toolbar component and `menuBar:insertImage` menu component, which are the default components
20
20
  * through which image upload is available.
21
21
  */
22
- export default class ImageUploadUI extends Plugin {
22
+ export declare class ImageUploadUI extends Plugin {
23
23
  /**
24
24
  * @inheritDoc
25
25
  */
@@ -22,7 +22,7 @@ import { createImageTypeRegExp } from './utils.js';
22
22
  * It also integrates with the `insertImage` toolbar component and `menuBar:insertImage` menu component, which are the default components
23
23
  * through which image upload is available.
24
24
  */
25
- export default class ImageUploadUI extends Plugin {
25
+ export class ImageUploadUI extends Plugin {
26
26
  /**
27
27
  * @inheritDoc
28
28
  */
@@ -38,7 +38,7 @@ import { type ArrayOrItem } from 'ckeditor5/src/utils.js';
38
38
  * } );
39
39
  * ```
40
40
  */
41
- export default class UploadImageCommand extends Command {
41
+ export declare class UploadImageCommand extends Command {
42
42
  /**
43
43
  * The command property: `false` if there is no permission on image upload, otherwise `true`.
44
44
  *
@@ -39,7 +39,7 @@ import { toArray } from 'ckeditor5/src/utils.js';
39
39
  * } );
40
40
  * ```
41
41
  */
42
- export default class UploadImageCommand extends Command {
42
+ export class UploadImageCommand extends Command {
43
43
  /**
44
44
  * Creates an instance of the `imageUlpoad` command. When executed, the command upload one of
45
45
  * the currently selected image from computer.
@@ -6,7 +6,7 @@
6
6
  * @module image/imageupload/utils
7
7
  */
8
8
  import type { ViewElement } from 'ckeditor5/src/engine.js';
9
- import type ImageUtils from '../imageutils.js';
9
+ import { type ImageUtils } from '../imageutils.js';
10
10
  /**
11
11
  * Creates a regular expression used to test for image files.
12
12
  *
@@ -20,6 +20,7 @@ export declare function createImageTypeRegExp(types: Array<string>): RegExp;
20
20
  /**
21
21
  * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
22
22
  *
23
+ * @internal
23
24
  * @param image Image whose source to fetch.
24
25
  * @returns A promise which resolves when an image source is fetched and converted to a `File` instance.
25
26
  * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
@@ -29,5 +30,6 @@ export declare function fetchLocalImage(image: ViewElement): Promise<File>;
29
30
  * Checks whether a given node is an image element with a local source (Base64 or blob).
30
31
  *
31
32
  * @param node The node to check.
33
+ * @internal
32
34
  */
33
35
  export declare function isLocalImage(imageUtils: ImageUtils, node: ViewElement): boolean;
@@ -20,6 +20,7 @@ export function createImageTypeRegExp(types) {
20
20
  /**
21
21
  * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
22
22
  *
23
+ * @internal
23
24
  * @param image Image whose source to fetch.
24
25
  * @returns A promise which resolves when an image source is fetched and converted to a `File` instance.
25
26
  * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
@@ -51,6 +52,7 @@ export function fetchLocalImage(image) {
51
52
  * Checks whether a given node is an image element with a local source (Base64 or blob).
52
53
  *
53
54
  * @param node The node to check.
55
+ * @internal
54
56
  */
55
57
  export function isLocalImage(imageUtils, node) {
56
58
  if (!imageUtils.isInlineImageView(node) || !node.getAttribute('src')) {
@@ -6,9 +6,9 @@
6
6
  * @module image/imageupload
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageUploadUI from './imageupload/imageuploadui.js';
10
- import ImageUploadProgress from './imageupload/imageuploadprogress.js';
11
- import ImageUploadEditing from './imageupload/imageuploadediting.js';
9
+ import { ImageUploadUI } from './imageupload/imageuploadui.js';
10
+ import { ImageUploadProgress } from './imageupload/imageuploadprogress.js';
11
+ import { ImageUploadEditing } from './imageupload/imageuploadediting.js';
12
12
  /**
13
13
  * The image upload plugin.
14
14
  *
@@ -20,7 +20,7 @@ import ImageUploadEditing from './imageupload/imageuploadediting.js';
20
20
  * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},
21
21
  * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.
22
22
  */
23
- export default class ImageUpload extends Plugin {
23
+ export declare class ImageUpload extends Plugin {
24
24
  /**
25
25
  * @inheritDoc
26
26
  */
@@ -6,9 +6,9 @@
6
6
  * @module image/imageupload
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import ImageUploadUI from './imageupload/imageuploadui.js';
10
- import ImageUploadProgress from './imageupload/imageuploadprogress.js';
11
- import ImageUploadEditing from './imageupload/imageuploadediting.js';
9
+ import { ImageUploadUI } from './imageupload/imageuploadui.js';
10
+ import { ImageUploadProgress } from './imageupload/imageuploadprogress.js';
11
+ import { ImageUploadEditing } from './imageupload/imageuploadediting.js';
12
12
  /**
13
13
  * The image upload plugin.
14
14
  *
@@ -20,7 +20,7 @@ import ImageUploadEditing from './imageupload/imageuploadediting.js';
20
20
  * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},
21
21
  * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.
22
22
  */
23
- export default class ImageUpload extends Plugin {
23
+ export class ImageUpload extends Plugin {
24
24
  /**
25
25
  * @inheritDoc
26
26
  */