@ckeditor/ckeditor5-image 36.0.1 → 37.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 (108) hide show
  1. package/build/image.js +1 -1
  2. package/package.json +40 -35
  3. package/src/augmentation.d.ts +55 -0
  4. package/src/augmentation.js +5 -0
  5. package/src/autoimage.d.ts +48 -0
  6. package/src/autoimage.js +111 -160
  7. package/src/image/converters.d.ts +66 -0
  8. package/src/image/converters.js +200 -261
  9. package/src/image/imageblockediting.d.ts +52 -0
  10. package/src/image/imageblockediting.js +111 -155
  11. package/src/image/imageediting.d.ts +29 -0
  12. package/src/image/imageediting.js +53 -67
  13. package/src/image/imageinlineediting.d.ts +53 -0
  14. package/src/image/imageinlineediting.js +135 -180
  15. package/src/image/imageloadobserver.d.ts +44 -0
  16. package/src/image/imageloadobserver.js +28 -47
  17. package/src/image/imagetypecommand.d.ts +40 -0
  18. package/src/image/imagetypecommand.js +67 -95
  19. package/src/image/insertimagecommand.d.ts +66 -0
  20. package/src/image/insertimagecommand.js +94 -101
  21. package/src/image/replaceimagesourcecommand.d.ts +34 -0
  22. package/src/image/replaceimagesourcecommand.js +28 -33
  23. package/src/image/ui/utils.d.ts +25 -0
  24. package/src/image/ui/utils.js +25 -35
  25. package/src/image/utils.d.ts +52 -0
  26. package/src/image/utils.js +63 -90
  27. package/src/image.d.ts +32 -0
  28. package/src/image.js +12 -43
  29. package/src/imageblock.d.ts +30 -0
  30. package/src/imageblock.js +12 -21
  31. package/src/imagecaption/imagecaptionediting.d.ts +87 -0
  32. package/src/imagecaption/imagecaptionediting.js +203 -262
  33. package/src/imagecaption/imagecaptionui.d.ts +25 -0
  34. package/src/imagecaption/imagecaptionui.js +46 -63
  35. package/src/imagecaption/imagecaptionutils.d.ts +37 -0
  36. package/src/imagecaption/imagecaptionutils.js +51 -78
  37. package/src/imagecaption/toggleimagecaptioncommand.d.ts +66 -0
  38. package/src/imagecaption/toggleimagecaptioncommand.js +112 -138
  39. package/src/imagecaption.d.ts +24 -0
  40. package/src/imagecaption.js +12 -19
  41. package/src/imageconfig.d.ts +713 -0
  42. package/src/imageconfig.js +5 -0
  43. package/src/imageinline.d.ts +30 -0
  44. package/src/imageinline.js +12 -21
  45. package/src/imageinsert/imageinsertui.d.ts +44 -0
  46. package/src/imageinsert/imageinsertui.js +120 -158
  47. package/src/imageinsert/ui/imageinsertformrowview.d.ts +61 -0
  48. package/src/imageinsert/ui/imageinsertformrowview.js +37 -86
  49. package/src/imageinsert/ui/imageinsertpanelview.d.ts +106 -0
  50. package/src/imageinsert/ui/imageinsertpanelview.js +148 -258
  51. package/src/imageinsert/utils.d.ts +25 -0
  52. package/src/imageinsert/utils.js +41 -58
  53. package/src/imageinsert.d.ts +30 -0
  54. package/src/imageinsert.js +13 -84
  55. package/src/imageinsertviaurl.d.ts +29 -0
  56. package/src/imageinsertviaurl.js +12 -18
  57. package/src/imageresize/imageresizebuttons.d.ts +66 -0
  58. package/src/imageresize/imageresizebuttons.js +190 -255
  59. package/src/imageresize/imageresizeediting.d.ts +36 -0
  60. package/src/imageresize/imageresizeediting.js +99 -125
  61. package/src/imageresize/imageresizehandles.d.ts +29 -0
  62. package/src/imageresize/imageresizehandles.js +90 -123
  63. package/src/imageresize/resizeimagecommand.d.ts +42 -0
  64. package/src/imageresize/resizeimagecommand.js +48 -55
  65. package/src/imageresize.d.ts +24 -0
  66. package/src/imageresize.js +12 -209
  67. package/src/imagestyle/converters.d.ts +24 -0
  68. package/src/imagestyle/converters.js +60 -78
  69. package/src/imagestyle/imagestylecommand.d.ts +65 -0
  70. package/src/imagestyle/imagestylecommand.js +88 -124
  71. package/src/imagestyle/imagestyleediting.d.ts +49 -0
  72. package/src/imagestyle/imagestyleediting.js +90 -137
  73. package/src/imagestyle/imagestyleui.d.ts +55 -0
  74. package/src/imagestyle/imagestyleui.js +170 -278
  75. package/src/imagestyle/utils.d.ts +101 -0
  76. package/src/imagestyle/utils.js +256 -309
  77. package/src/imagestyle.d.ts +30 -0
  78. package/src/imagestyle.js +13 -261
  79. package/src/imagetextalternative/imagetextalternativecommand.d.ts +34 -0
  80. package/src/imagetextalternative/imagetextalternativecommand.js +31 -47
  81. package/src/imagetextalternative/imagetextalternativeediting.d.ts +27 -0
  82. package/src/imagetextalternative/imagetextalternativeediting.js +18 -25
  83. package/src/imagetextalternative/imagetextalternativeui.d.ts +67 -0
  84. package/src/imagetextalternative/imagetextalternativeui.js +156 -219
  85. package/src/imagetextalternative/ui/textalternativeformview.d.ts +72 -0
  86. package/src/imagetextalternative/ui/textalternativeformview.js +103 -192
  87. package/src/imagetextalternative.d.ts +27 -0
  88. package/src/imagetextalternative.js +12 -18
  89. package/src/imagetoolbar.d.ts +33 -0
  90. package/src/imagetoolbar.js +31 -77
  91. package/src/imageupload/imageuploadediting.d.ts +108 -0
  92. package/src/imageupload/imageuploadediting.js +307 -427
  93. package/src/imageupload/imageuploadprogress.d.ts +42 -0
  94. package/src/imageupload/imageuploadprogress.js +180 -261
  95. package/src/imageupload/imageuploadui.d.ts +23 -0
  96. package/src/imageupload/imageuploadui.js +40 -57
  97. package/src/imageupload/uploadimagecommand.d.ts +60 -0
  98. package/src/imageupload/uploadimagecommand.js +73 -87
  99. package/src/imageupload/utils.d.ts +33 -0
  100. package/src/imageupload/utils.js +87 -112
  101. package/src/imageupload.d.ts +29 -0
  102. package/src/imageupload.js +12 -61
  103. package/src/imageutils.d.ts +102 -0
  104. package/src/imageutils.js +232 -329
  105. package/src/index.d.ts +47 -0
  106. package/src/index.js +1 -2
  107. package/src/pictureediting.d.ts +86 -0
  108. package/src/pictureediting.js +101 -120
@@ -2,276 +2,211 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module image/imageresize/imageresizebuttons
8
7
  */
9
-
10
8
  import { Plugin, icons } from 'ckeditor5/src/core';
11
9
  import { ButtonView, DropdownButtonView, Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';
12
10
  import { CKEditorError, Collection } from 'ckeditor5/src/utils';
13
-
14
11
  import ImageResizeEditing from './imageresizeediting';
15
-
16
12
  const RESIZE_ICONS = {
17
- small: icons.objectSizeSmall,
18
- medium: icons.objectSizeMedium,
19
- large: icons.objectSizeLarge,
20
- original: icons.objectSizeFull
13
+ small: icons.objectSizeSmall,
14
+ medium: icons.objectSizeMedium,
15
+ large: icons.objectSizeLarge,
16
+ original: icons.objectSizeFull
21
17
  };
22
-
23
18
  /**
24
19
  * The image resize buttons plugin.
25
20
  *
26
21
  * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.
27
- *
28
- * @extends module:core/plugin~Plugin
29
22
  */
30
23
  export default class ImageResizeButtons extends Plugin {
31
- /**
32
- * @inheritDoc
33
- */
34
- static get requires() {
35
- return [ ImageResizeEditing ];
36
- }
37
-
38
- /**
39
- * @inheritDoc
40
- */
41
- static get pluginName() {
42
- return 'ImageResizeButtons';
43
- }
44
-
45
- /**
46
- * @inheritDoc
47
- */
48
- constructor( editor ) {
49
- super( editor );
50
-
51
- /**
52
- * The resize unit.
53
- *
54
- * @readonly
55
- * @private
56
- * @type {module:image/image~ImageConfig#resizeUnit}
57
- * @default '%'
58
- */
59
- this._resizeUnit = editor.config.get( 'image.resizeUnit' );
60
- }
61
-
62
- /**
63
- * @inheritDoc
64
- */
65
- init() {
66
- const editor = this.editor;
67
- const options = editor.config.get( 'image.resizeOptions' );
68
- const command = editor.commands.get( 'resizeImage' );
69
-
70
- this.bind( 'isEnabled' ).to( command );
71
-
72
- for ( const option of options ) {
73
- this._registerImageResizeButton( option );
74
- }
75
-
76
- this._registerImageResizeDropdown( options );
77
- }
78
-
79
- /**
80
- * A helper function that creates a standalone button component for the plugin.
81
- *
82
- * @private
83
- * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} resizeOption A model of the resize option.
84
- */
85
- _registerImageResizeButton( option ) {
86
- const editor = this.editor;
87
- const { name, value, icon } = option;
88
- const optionValueWithUnit = value ? value + this._resizeUnit : null;
89
-
90
- editor.ui.componentFactory.add( name, locale => {
91
- const button = new ButtonView( locale );
92
- const command = editor.commands.get( 'resizeImage' );
93
- const labelText = this._getOptionLabelValue( option, true );
94
-
95
- if ( !RESIZE_ICONS[ icon ] ) {
96
- /**
97
- * When configuring {@link module:image/image~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone
98
- * buttons, a valid `icon` token must be set for each option.
99
- *
100
- * See all valid options described in the
101
- * {@link module:image/imageresize/imageresizebuttons~ImageResizeOption plugin configuration}.
102
- *
103
- * @error imageresizebuttons-missing-icon
104
- * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option Invalid image resize option.
105
- */
106
- throw new CKEditorError(
107
- 'imageresizebuttons-missing-icon',
108
- editor,
109
- option
110
- );
111
- }
112
-
113
- button.set( {
114
- // Use the `label` property for a verbose description (because of ARIA).
115
- label: labelText,
116
- icon: RESIZE_ICONS[ icon ],
117
- tooltip: labelText,
118
- isToggleable: true
119
- } );
120
-
121
- // Bind button to the command.
122
- button.bind( 'isEnabled' ).to( this );
123
- button.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
124
-
125
- this.listenTo( button, 'execute', () => {
126
- editor.execute( 'resizeImage', { width: optionValueWithUnit } );
127
- } );
128
-
129
- return button;
130
- } );
131
- }
132
-
133
- /**
134
- * A helper function that creates a dropdown component for the plugin containing all the resize options defined in
135
- * the editor configuration.
136
- *
137
- * @private
138
- * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options An array of configured options.
139
- */
140
- _registerImageResizeDropdown( options ) {
141
- const editor = this.editor;
142
- const t = editor.t;
143
- const originalSizeOption = options.find( option => !option.value );
144
-
145
- const componentCreator = locale => {
146
- const command = editor.commands.get( 'resizeImage' );
147
- const dropdownView = createDropdown( locale, DropdownButtonView );
148
- const dropdownButton = dropdownView.buttonView;
149
-
150
- dropdownButton.set( {
151
- tooltip: t( 'Resize image' ),
152
- commandValue: originalSizeOption.value,
153
- icon: RESIZE_ICONS.medium,
154
- isToggleable: true,
155
- label: this._getOptionLabelValue( originalSizeOption ),
156
- withText: true,
157
- class: 'ck-resize-image-button'
158
- } );
159
-
160
- dropdownButton.bind( 'label' ).to( command, 'value', commandValue => {
161
- if ( commandValue && commandValue.width ) {
162
- return commandValue.width;
163
- } else {
164
- return this._getOptionLabelValue( originalSizeOption );
165
- }
166
- } );
167
- dropdownView.bind( 'isOn' ).to( command );
168
- dropdownView.bind( 'isEnabled' ).to( this );
169
-
170
- addListToDropdown( dropdownView, () => this._getResizeDropdownListItemDefinitions( options, command ), {
171
- ariaLabel: t( 'Image resize list' )
172
- } );
173
-
174
- // Execute command when an item from the dropdown is selected.
175
- this.listenTo( dropdownView, 'execute', evt => {
176
- editor.execute( evt.source.commandName, { width: evt.source.commandValue } );
177
- editor.editing.view.focus();
178
- } );
179
-
180
- return dropdownView;
181
- };
182
-
183
- // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.
184
- editor.ui.componentFactory.add( 'resizeImage', componentCreator );
185
- editor.ui.componentFactory.add( 'imageResize', componentCreator );
186
- }
187
-
188
- /**
189
- * A helper function for creating an option label value string.
190
- *
191
- * @private
192
- * @param {module:image/imageresize/imageresizebuttons~ImageResizeOption} option A resize option object.
193
- * @param {Boolean} [forTooltip] An optional flag for creating a tooltip label.
194
- * @returns {String} A user-defined label combined from the numeric value and the resize unit or the default label
195
- * for reset options (`Original`).
196
- */
197
- _getOptionLabelValue( option, forTooltip ) {
198
- const t = this.editor.t;
199
-
200
- if ( option.label ) {
201
- return option.label;
202
- } else if ( forTooltip ) {
203
- if ( option.value ) {
204
- return t( 'Resize image to %0', option.value + this._resizeUnit );
205
- } else {
206
- return t( 'Resize image to the original size' );
207
- }
208
- } else {
209
- if ( option.value ) {
210
- return option.value + this._resizeUnit;
211
- } else {
212
- return t( 'Original' );
213
- }
214
- }
215
- }
216
-
217
- /**
218
- * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
219
- *
220
- * @private
221
- * @param {Array.<module:image/imageresize/imageresizebuttons~ImageResizeOption>} options The resize options.
222
- * @param {module:image/imageresize/resizeimagecommand~ResizeImageCommand} command The resize image command.
223
- * @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} Dropdown item definitions.
224
- */
225
- _getResizeDropdownListItemDefinitions( options, command ) {
226
- const itemDefinitions = new Collection();
227
-
228
- options.map( option => {
229
- const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;
230
- const definition = {
231
- type: 'button',
232
- model: new Model( {
233
- commandName: 'resizeImage',
234
- commandValue: optionValueWithUnit,
235
- label: this._getOptionLabelValue( option ),
236
- withText: true,
237
- icon: null
238
- } )
239
- };
240
-
241
- definition.model.bind( 'isOn' ).to( command, 'value', getIsOnButtonCallback( optionValueWithUnit ) );
242
-
243
- itemDefinitions.add( definition );
244
- } );
245
-
246
- return itemDefinitions;
247
- }
248
- }
249
-
250
- // A helper function for setting the `isOn` state of buttons in value bindings.
251
- function getIsOnButtonCallback( value ) {
252
- return commandValue => {
253
- if ( value === null && commandValue === value ) {
254
- return true;
255
- }
256
-
257
- return commandValue && commandValue.width === value;
258
- };
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get requires() {
28
+ return [ImageResizeEditing];
29
+ }
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get pluginName() {
34
+ return 'ImageResizeButtons';
35
+ }
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ constructor(editor) {
40
+ super(editor);
41
+ this._resizeUnit = editor.config.get('image.resizeUnit');
42
+ }
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ init() {
47
+ const editor = this.editor;
48
+ const options = editor.config.get('image.resizeOptions');
49
+ const command = editor.commands.get('resizeImage');
50
+ this.bind('isEnabled').to(command);
51
+ for (const option of options) {
52
+ this._registerImageResizeButton(option);
53
+ }
54
+ this._registerImageResizeDropdown(options);
55
+ }
56
+ /**
57
+ * A helper function that creates a standalone button component for the plugin.
58
+ *
59
+ * @param resizeOption A model of the resize option.
60
+ */
61
+ _registerImageResizeButton(option) {
62
+ const editor = this.editor;
63
+ const { name, value, icon } = option;
64
+ const optionValueWithUnit = value ? value + this._resizeUnit : null;
65
+ editor.ui.componentFactory.add(name, locale => {
66
+ const button = new ButtonView(locale);
67
+ const command = editor.commands.get('resizeImage');
68
+ const labelText = this._getOptionLabelValue(option, true);
69
+ if (!RESIZE_ICONS[icon]) {
70
+ /**
71
+ * When configuring {@link module:image/imageconfig~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone
72
+ * buttons, a valid `icon` token must be set for each option.
73
+ *
74
+ * See all valid options described in the
75
+ * {@link module:image/imageconfig~ImageResizeOption plugin configuration}.
76
+ *
77
+ * @error imageresizebuttons-missing-icon
78
+ * @param option Invalid image resize option.
79
+ */
80
+ throw new CKEditorError('imageresizebuttons-missing-icon', editor, option);
81
+ }
82
+ button.set({
83
+ // Use the `label` property for a verbose description (because of ARIA).
84
+ label: labelText,
85
+ icon: RESIZE_ICONS[icon],
86
+ tooltip: labelText,
87
+ isToggleable: true
88
+ });
89
+ // Bind button to the command.
90
+ button.bind('isEnabled').to(this);
91
+ button.bind('isOn').to(command, 'value', getIsOnButtonCallback(optionValueWithUnit));
92
+ this.listenTo(button, 'execute', () => {
93
+ editor.execute('resizeImage', { width: optionValueWithUnit });
94
+ });
95
+ return button;
96
+ });
97
+ }
98
+ /**
99
+ * A helper function that creates a dropdown component for the plugin containing all the resize options defined in
100
+ * the editor configuration.
101
+ *
102
+ * @param options An array of configured options.
103
+ */
104
+ _registerImageResizeDropdown(options) {
105
+ const editor = this.editor;
106
+ const t = editor.t;
107
+ const originalSizeOption = options.find(option => !option.value);
108
+ const componentCreator = (locale) => {
109
+ const command = editor.commands.get('resizeImage');
110
+ const dropdownView = createDropdown(locale, DropdownButtonView);
111
+ const dropdownButton = dropdownView.buttonView;
112
+ dropdownButton.set({
113
+ tooltip: t('Resize image'),
114
+ commandValue: originalSizeOption.value,
115
+ icon: RESIZE_ICONS.medium,
116
+ isToggleable: true,
117
+ label: this._getOptionLabelValue(originalSizeOption),
118
+ withText: true,
119
+ class: 'ck-resize-image-button'
120
+ });
121
+ dropdownButton.bind('label').to(command, 'value', commandValue => {
122
+ if (commandValue && commandValue.width) {
123
+ return commandValue.width;
124
+ }
125
+ else {
126
+ return this._getOptionLabelValue(originalSizeOption);
127
+ }
128
+ });
129
+ dropdownView.bind('isEnabled').to(this);
130
+ addListToDropdown(dropdownView, () => this._getResizeDropdownListItemDefinitions(options, command), {
131
+ ariaLabel: t('Image resize list')
132
+ });
133
+ // Execute command when an item from the dropdown is selected.
134
+ this.listenTo(dropdownView, 'execute', evt => {
135
+ editor.execute(evt.source.commandName, { width: evt.source.commandValue });
136
+ editor.editing.view.focus();
137
+ });
138
+ return dropdownView;
139
+ };
140
+ // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.
141
+ editor.ui.componentFactory.add('resizeImage', componentCreator);
142
+ editor.ui.componentFactory.add('imageResize', componentCreator);
143
+ }
144
+ /**
145
+ * A helper function for creating an option label value string.
146
+ *
147
+ * @param option A resize option object.
148
+ * @param forTooltip An optional flag for creating a tooltip label.
149
+ * @returns A user-defined label combined from the numeric value and the resize unit or the default label
150
+ * for reset options (`Original`).
151
+ */
152
+ _getOptionLabelValue(option, forTooltip = false) {
153
+ const t = this.editor.t;
154
+ if (option.label) {
155
+ return option.label;
156
+ }
157
+ else if (forTooltip) {
158
+ if (option.value) {
159
+ return t('Resize image to %0', option.value + this._resizeUnit);
160
+ }
161
+ else {
162
+ return t('Resize image to the original size');
163
+ }
164
+ }
165
+ else {
166
+ if (option.value) {
167
+ return option.value + this._resizeUnit;
168
+ }
169
+ else {
170
+ return t('Original');
171
+ }
172
+ }
173
+ }
174
+ /**
175
+ * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
176
+ *
177
+ * @param options The resize options.
178
+ * @param command The resize image command.
179
+ * @returns Dropdown item definitions.
180
+ */
181
+ _getResizeDropdownListItemDefinitions(options, command) {
182
+ const itemDefinitions = new Collection();
183
+ options.map(option => {
184
+ const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;
185
+ const definition = {
186
+ type: 'button',
187
+ model: new Model({
188
+ commandName: 'resizeImage',
189
+ commandValue: optionValueWithUnit,
190
+ label: this._getOptionLabelValue(option),
191
+ withText: true,
192
+ icon: null
193
+ })
194
+ };
195
+ definition.model.bind('isOn').to(command, 'value', getIsOnButtonCallback(optionValueWithUnit));
196
+ itemDefinitions.add(definition);
197
+ });
198
+ return itemDefinitions;
199
+ }
259
200
  }
260
-
261
201
  /**
262
- * The image resize option used in the {@link module:image/image~ImageConfig#resizeOptions image resize configuration}.
263
- *
264
- * @typedef {Object} module:image/imageresize/imageresizebuttons~ImageResizeOption
265
- * @property {String} name The name of the UI component that changes the image size.
266
- * * If you configure the feature using individual resize buttons, you can refer to this name in the
267
- * {@link module:image/image~ImageConfig#toolbar image toolbar configuration}.
268
- * * If you configure the feature using the resize dropdown, this name will be used for a list item in the dropdown.
269
- * @property {String} value The value of the resize option without the unit
270
- * ({@link module:image/image~ImageConfig#resizeUnit configured separately}). `null` resets an image to its original size.
271
- * @property {String} [icon] An icon used by an individual resize button (see the `name` property to learn more).
272
- * Available icons are: `'small'`, `'medium'`, `'large'`, `'original'`.
273
- * @property {String} [label] An option label displayed in the dropdown or, if the feature is configured using
274
- * individual buttons, a {@link module:ui/button/buttonview~ButtonView#tooltip} and an ARIA attribute of a button.
275
- * If not specified, the label is generated automatically based on the `value` option and the
276
- * {@link module:image/image~ImageConfig#resizeUnit `config.image.resizeUnit`}.
202
+ * A helper function for setting the `isOn` state of buttons in value bindings.
277
203
  */
204
+ function getIsOnButtonCallback(value) {
205
+ return (commandValue) => {
206
+ const objectCommandValue = commandValue;
207
+ if (value === null && objectCommandValue === value) {
208
+ return true;
209
+ }
210
+ return objectCommandValue !== null && objectCommandValue.width === value;
211
+ };
212
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { type Editor, Plugin, type PluginDependencies } from 'ckeditor5/src/core';
6
+ /**
7
+ * The image resize editing feature.
8
+ *
9
+ * It adds the ability to resize each image using handles or manually by
10
+ * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
11
+ */
12
+ export default class ImageResizeEditing extends Plugin {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get requires(): PluginDependencies;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): 'ImageResizeEditing';
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor(editor: Editor);
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ init(): void;
29
+ private _registerSchema;
30
+ /**
31
+ * Registers image resize converters.
32
+ *
33
+ * @param imageType The type of the image.
34
+ */
35
+ private _registerConverters;
36
+ }