@syncfusion/ej2-image-editor 30.2.4 → 31.1.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.
- package/dist/ej2-image-editor.umd.min.js +2 -2
- package/dist/ej2-image-editor.umd.min.js.map +1 -1
- package/dist/es6/ej2-image-editor.es2015.js +3 -3
- package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
- package/dist/es6/ej2-image-editor.es5.js +3 -3
- package/dist/es6/ej2-image-editor.es5.js.map +1 -1
- package/dist/global/ej2-image-editor.min.js +2 -2
- package/dist/global/ej2-image-editor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/image-editor/action/crop.d.ts +44 -0
- package/dist/ts/image-editor/action/crop.ts +867 -0
- package/dist/ts/image-editor/action/draw.d.ts +187 -0
- package/dist/ts/image-editor/action/draw.ts +4924 -0
- package/dist/ts/image-editor/action/export.d.ts +29 -0
- package/dist/ts/image-editor/action/export.ts +509 -0
- package/dist/ts/image-editor/action/filter.d.ts +48 -0
- package/dist/ts/image-editor/action/filter.ts +872 -0
- package/dist/ts/image-editor/action/freehand-draw.d.ts +68 -0
- package/dist/ts/image-editor/action/freehand-draw.ts +1135 -0
- package/dist/ts/image-editor/action/index.d.ts +9 -0
- package/dist/ts/image-editor/action/index.ts +9 -0
- package/dist/ts/image-editor/action/selection.d.ts +178 -0
- package/dist/ts/image-editor/action/selection.ts +5241 -0
- package/dist/ts/image-editor/action/shape.d.ts +130 -0
- package/dist/ts/image-editor/action/shape.ts +3917 -0
- package/dist/ts/image-editor/action/transform.d.ts +77 -0
- package/dist/ts/image-editor/action/transform.ts +2008 -0
- package/dist/ts/image-editor/action/undo-redo.d.ts +52 -0
- package/dist/ts/image-editor/action/undo-redo.ts +1169 -0
- package/dist/ts/image-editor/base/enum.d.ts +277 -0
- package/dist/ts/image-editor/base/enum.ts +288 -0
- package/dist/ts/image-editor/base/image-editor-model.d.ts +770 -0
- package/dist/ts/image-editor/base/image-editor.d.ts +1928 -0
- package/dist/ts/image-editor/base/image-editor.ts +5496 -0
- package/dist/ts/image-editor/base/index.d.ts +4 -0
- package/dist/ts/image-editor/base/index.ts +4 -0
- package/dist/ts/image-editor/base/interface.d.ts +1637 -0
- package/dist/ts/image-editor/base/interface.ts +1709 -0
- package/dist/ts/image-editor/index.d.ts +3 -0
- package/dist/ts/image-editor/index.ts +3 -0
- package/dist/ts/image-editor/renderer/index.d.ts +1 -0
- package/dist/ts/image-editor/renderer/index.ts +1 -0
- package/dist/ts/image-editor/renderer/toolbar.d.ts +171 -0
- package/dist/ts/image-editor/renderer/toolbar.ts +6356 -0
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/package.json +47 -15
- package/src/image-editor/action/undo-redo.js +3 -3
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, ModuleDeclaration, extend } from '@syncfusion/ej2-base';
|
|
2
|
+
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface for a class UploadSettings
|
|
6
|
+
*/
|
|
7
|
+
export interface UploadSettingsModel {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the allowed file extensions for uploaded images.
|
|
11
|
+
*
|
|
12
|
+
* @type {string}
|
|
13
|
+
* @default null
|
|
14
|
+
* @remarks
|
|
15
|
+
* Example: '.jpg, .png, .gif'
|
|
16
|
+
* This property restricts the types of image files that can be uploaded based on their file extensions. Only files with the specified extensions will be allowed.
|
|
17
|
+
*/
|
|
18
|
+
allowedExtensions?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Specifies the minimum size (in bytes) for the uploaded image.
|
|
22
|
+
*
|
|
23
|
+
* @type {number}
|
|
24
|
+
* @default null
|
|
25
|
+
* @remarks
|
|
26
|
+
* The value represents the file size in bytes. Any file smaller than this size will be rejected during the upload process. Use this property to ensure that images meet a certain quality or resolution standard.
|
|
27
|
+
*/
|
|
28
|
+
minFileSize?: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Specifies the maximum size (in bytes) for the uploaded image.
|
|
32
|
+
*
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @default null
|
|
35
|
+
* @remarks
|
|
36
|
+
* The value represents the file size in bytes. Any file larger than this size will be rejected during the upload process. This property helps prevent the upload of excessively large files that may impact performance.
|
|
37
|
+
*/
|
|
38
|
+
maxFileSize?: number;
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Interface for a class FinetuneSettings
|
|
44
|
+
*/
|
|
45
|
+
export interface FinetuneSettingsModel {
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Represents a finetune setting for adjusting the brightness of an image.
|
|
49
|
+
*
|
|
50
|
+
* @type {ImageFinetuneValue}
|
|
51
|
+
*
|
|
52
|
+
* @property {number} value - The brightness level of the image, from -100 to 100.
|
|
53
|
+
* @property {number} min - The minimum brightness value allowed, typically -100.
|
|
54
|
+
* @property {number} max - The maximum brightness value allowed, typically 100.
|
|
55
|
+
* @default null
|
|
56
|
+
*/
|
|
57
|
+
brightness?: ImageFinetuneValue;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Represents a finetune setting for adjusting the contrast of an image.
|
|
61
|
+
*
|
|
62
|
+
* @type {ImageFinetuneValue}
|
|
63
|
+
*
|
|
64
|
+
* @property {number} value - The contrast level of the image, from -100 to 100.
|
|
65
|
+
* @property {number} min - The minimum contrast value allowed, typically -100.
|
|
66
|
+
* @property {number} max - The maximum contrast value allowed, typically 100.
|
|
67
|
+
* @default null
|
|
68
|
+
*/
|
|
69
|
+
contrast?: ImageFinetuneValue;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Represents a finetune setting for adjusting the hue of an image.
|
|
73
|
+
*
|
|
74
|
+
* @type {ImageFinetuneValue}
|
|
75
|
+
*
|
|
76
|
+
* @property {number} value - The hue level of the image, from 0 to 100.
|
|
77
|
+
* @property {number} min - The minimum hue value allowed, typically 0.
|
|
78
|
+
* @property {number} max - The maximum hue value allowed, typically 100.
|
|
79
|
+
* @default null
|
|
80
|
+
*/
|
|
81
|
+
hue?: ImageFinetuneValue;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Represents a finetune setting for adjusting the saturation of an image.
|
|
85
|
+
*
|
|
86
|
+
* @type {ImageFinetuneValue}
|
|
87
|
+
*
|
|
88
|
+
* @property {number} value - The saturation level of the image, from -100 to 100.
|
|
89
|
+
* @property {number} min - The minimum saturation value allowed, typically -100.
|
|
90
|
+
* @property {number} max - The maximum saturation value allowed, typically 100.
|
|
91
|
+
* @default null
|
|
92
|
+
*/
|
|
93
|
+
saturation?: ImageFinetuneValue;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Represents a finetune setting for adjusting the exposure of an image.
|
|
97
|
+
*
|
|
98
|
+
* @type {ImageFinetuneValue}
|
|
99
|
+
*
|
|
100
|
+
* @property {number} value - The exposure level of the image, from -100 to 100.
|
|
101
|
+
* @property {number} min - The minimum exposure value allowed, typically -100.
|
|
102
|
+
* @property {number} max - The maximum exposure value allowed, typically 100.
|
|
103
|
+
* @default null
|
|
104
|
+
*/
|
|
105
|
+
exposure?: ImageFinetuneValue;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Represents a finetune setting for adjusting the opacity of an image.
|
|
109
|
+
*
|
|
110
|
+
* @type {ImageFinetuneValue}
|
|
111
|
+
*
|
|
112
|
+
* @property {number} value - The opacity level of the image, from 0 to 100.
|
|
113
|
+
* @property {number} min - The minimum opacity value allowed, typically 0.
|
|
114
|
+
* @property {number} max - The maximum opacity value allowed, typically 100.
|
|
115
|
+
* @default null
|
|
116
|
+
*/
|
|
117
|
+
opacity?: ImageFinetuneValue;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Represents a finetune setting for adjusting the blur of an image.
|
|
121
|
+
*
|
|
122
|
+
* @type {ImageFinetuneValue}
|
|
123
|
+
*
|
|
124
|
+
* @property {number} value - The blur level of the image, from 0 to 100.
|
|
125
|
+
* @property {number} min - The minimum blur value allowed, typically 0.
|
|
126
|
+
* @property {number} max - The maximum blur value allowed, typically 100.
|
|
127
|
+
* @default null
|
|
128
|
+
*/
|
|
129
|
+
blur?: ImageFinetuneValue;
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Interface for a class ZoomSettings
|
|
135
|
+
*/
|
|
136
|
+
export interface ZoomSettingsModel {
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Specifies the available options for zooming in an image editor control.
|
|
140
|
+
*
|
|
141
|
+
* @remarks
|
|
142
|
+
* Use this property to enable or disable specific types of zooming in the image editor. The following zooming options are available:
|
|
143
|
+
* MouseWheel: Zooming is performed by scrolling the mouse wheel up and down.
|
|
144
|
+
* Pinch: Zooming is performed using pinch gestures on touch-enabled devices.
|
|
145
|
+
* Commands: Zooming is performed by clicking the CTRL key and either the plus (+) or minus (-) buttons on the keyboard.
|
|
146
|
+
* Toolbar: Zooming is performed using toolbar buttons.
|
|
147
|
+
*
|
|
148
|
+
* By default, this property is set to `null`, which enables all types of zooming.
|
|
149
|
+
*
|
|
150
|
+
* @default null
|
|
151
|
+
* @aspNumberEnum
|
|
152
|
+
*/
|
|
153
|
+
zoomTrigger?: ZoomTrigger;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Specifies the minimum zooming level to limit the zooming.
|
|
157
|
+
* An integer value that specifies the minimum zooming level. And the default value is 1 (100%).
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* The given value is considered as percentage.
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
minZoomFactor?: number;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Specifies the maximum zooming level to limit the zooming.
|
|
167
|
+
* An integer value that specifies the maximum zooming level. And the default value is 10 (1000 percent).
|
|
168
|
+
*
|
|
169
|
+
* @remarks
|
|
170
|
+
* The given value is considered as percentage.
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
maxZoomFactor?: number;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Specifies the default zoom factor to be applied on initial loading of image.
|
|
177
|
+
* An integer value that specifies the current zooming level. And the default value is 1 (100 percent).
|
|
178
|
+
*
|
|
179
|
+
* @remarks
|
|
180
|
+
* The given value is considered as percentage.
|
|
181
|
+
*
|
|
182
|
+
*/
|
|
183
|
+
zoomFactor?: number;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Specifies the point in which the zooming has been performed in the image editor.
|
|
187
|
+
* A point value that specifies the current zooming point.
|
|
188
|
+
* And the default value is null, and it can be considered as center point of the image editor.
|
|
189
|
+
*
|
|
190
|
+
* @remarks
|
|
191
|
+
* The given value is a point object which has x and y coordinates.
|
|
192
|
+
*
|
|
193
|
+
*/
|
|
194
|
+
zoomPoint?: Point;
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Interface for a class SelectionSettings
|
|
200
|
+
*/
|
|
201
|
+
export interface SelectionSettingsModel {
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Specifies a boolean value whether to show circle on selection in the image editor.
|
|
205
|
+
*
|
|
206
|
+
* @type {boolean}
|
|
207
|
+
*
|
|
208
|
+
* @default true
|
|
209
|
+
*/
|
|
210
|
+
showCircle?: boolean;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Represents stroke color of circle selection in the image editor.
|
|
214
|
+
*
|
|
215
|
+
* @type {string}
|
|
216
|
+
*
|
|
217
|
+
* @default null
|
|
218
|
+
*/
|
|
219
|
+
strokeColor?: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Represents fill color of circle selection in the image editor.
|
|
223
|
+
*
|
|
224
|
+
* @type {string}
|
|
225
|
+
*
|
|
226
|
+
* @default null
|
|
227
|
+
*/
|
|
228
|
+
fillColor?: string;
|
|
229
|
+
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Interface for a class FontFamily
|
|
234
|
+
*/
|
|
235
|
+
export interface FontFamilyModel {
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Specifies default font family selection
|
|
239
|
+
*
|
|
240
|
+
* @default 'Arial'
|
|
241
|
+
*/
|
|
242
|
+
default?: string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Specifies default font family items
|
|
246
|
+
*
|
|
247
|
+
* @default null
|
|
248
|
+
*/
|
|
249
|
+
items?: DropDownButtonItemModel[];
|
|
250
|
+
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Interface for a class ImageEditor
|
|
255
|
+
*/
|
|
256
|
+
export interface ImageEditorModel extends ComponentModel{
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Defines one or more CSS classes that can be used to customize the appearance of an Image Editor component.
|
|
260
|
+
*
|
|
261
|
+
* @remarks
|
|
262
|
+
* One or more CSS classes to customize the appearance of the Image Editor component, such as by changing its toolbar appearance, borders, sizes, or other visual aspects.
|
|
263
|
+
*
|
|
264
|
+
* @default ''
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
cssClass?: string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Defines whether an Image Editor component is enabled or disabled.
|
|
271
|
+
*
|
|
272
|
+
* @remarks
|
|
273
|
+
* A disabled Image Editor component may have a different visual appearance than an enabled one. When set to “true”, the Image Editor component will be disabled, and the user will not be able to interact with it.
|
|
274
|
+
*
|
|
275
|
+
* @default false
|
|
276
|
+
*/
|
|
277
|
+
disabled?: boolean;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Specifies the height of the Image Editor.
|
|
281
|
+
*
|
|
282
|
+
* @remarks
|
|
283
|
+
* The value of height is specified either as a percentage (e.g. '100%') or as a fixed pixel value (e.g. '100px').
|
|
284
|
+
*
|
|
285
|
+
* @default '100%'
|
|
286
|
+
*/
|
|
287
|
+
height?: string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Specifies the theme of the Image Editor. The appearance of the shape selection in Image Editor is determined by this property.
|
|
291
|
+
*
|
|
292
|
+
* @remarks
|
|
293
|
+
* The `theme` property supports all the built-in themes of Syncfusion, including:
|
|
294
|
+
* - `Bootstrap5`
|
|
295
|
+
* - `Fluent`
|
|
296
|
+
* - `Tailwind`
|
|
297
|
+
* - `Bootstrap4`
|
|
298
|
+
* - `Material`
|
|
299
|
+
* - `Fabric`
|
|
300
|
+
* - `HighContrast`
|
|
301
|
+
* - `Bootstrap5Dark`
|
|
302
|
+
* - `Bootstrap4Dark`
|
|
303
|
+
* - `MaterialDark`
|
|
304
|
+
* - `FabricDark`
|
|
305
|
+
* - `HighContrastDark`
|
|
306
|
+
* - `Fluent2`
|
|
307
|
+
*
|
|
308
|
+
* The default value is set to `Theme.Bootstrap5`.
|
|
309
|
+
*
|
|
310
|
+
* @isenumeration true
|
|
311
|
+
* @default Theme.Bootstrap5
|
|
312
|
+
* @asptype Theme
|
|
313
|
+
*
|
|
314
|
+
*/
|
|
315
|
+
theme?: string | Theme;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Specifies the toolbar items to perform UI interactions.
|
|
319
|
+
* It accepts both string[] and ItemModel[] to configure its toolbar items. The default value is null.
|
|
320
|
+
* If the property is not defined in the control, the default toolbar will be rendered with preconfigured toolbar commands.
|
|
321
|
+
* If the property is defined as empty collection, the toolbar will not be rendered.
|
|
322
|
+
* The preconfigured toolbar commands are
|
|
323
|
+
* - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
|
|
324
|
+
* - Straightening: helps to rotate an image by a specified angle.
|
|
325
|
+
* - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text, image and freehand drawing with resize, drag and drop, and customize its appearance.
|
|
326
|
+
* - Transform: helps to rotate and flip an image.
|
|
327
|
+
* - Finetunes: helps to perform adjustments on an image.
|
|
328
|
+
* - Filters: helps to perform predefined color filters.
|
|
329
|
+
* - Frame: helps to add decorative borders or frames around images.
|
|
330
|
+
* - Resize: helps to modify the dimensions of an image.
|
|
331
|
+
* - ZoomIn: performs zoom-in an image.
|
|
332
|
+
* - ZoomOut: performs zoom-out an image.
|
|
333
|
+
* - Save: save the modified image.
|
|
334
|
+
* - Open: open an image to perform editing.
|
|
335
|
+
* - Undo: helps to revert the last action.
|
|
336
|
+
* - Redo: helps to redo the last action.
|
|
337
|
+
* - Reset: reset the modification and restore the original image.
|
|
338
|
+
*
|
|
339
|
+
* {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
|
|
340
|
+
*
|
|
341
|
+
* @remarks
|
|
342
|
+
* If the toolbarTemplate property is defined in the control, the toolbar will be rendered based on the toolbarTemplate property.
|
|
343
|
+
* @default null
|
|
344
|
+
*
|
|
345
|
+
*/
|
|
346
|
+
toolbar?: (string | ImageEditorCommand | ItemModel)[];
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Specifies a custom template for the toolbar of an image editor control.
|
|
350
|
+
* A string that specifies a custom template for the toolbar of the image editor. If this property is defined, the 'toolbar' property will not have any effect.
|
|
351
|
+
*
|
|
352
|
+
* {% codeBlock src='image-editor/toolbarTemplate/index.md' %}{% endcodeBlock %}
|
|
353
|
+
*
|
|
354
|
+
* @remarks
|
|
355
|
+
* Use this property if you want to customize the entire toolbar in your own way. The template should be a string that contains the HTML markup for the custom toolbar.
|
|
356
|
+
*
|
|
357
|
+
* @default null
|
|
358
|
+
* @aspType string
|
|
359
|
+
*
|
|
360
|
+
*
|
|
361
|
+
*/
|
|
362
|
+
toolbarTemplate?: string | Function;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Specifies the width of an Image Editor.
|
|
366
|
+
*
|
|
367
|
+
* @remarks
|
|
368
|
+
* The value of width is specified either as a percentage (e.g. '100%') or as a fixed pixel value (e.g. '100px').
|
|
369
|
+
*
|
|
370
|
+
* @default '100%'
|
|
371
|
+
*/
|
|
372
|
+
width?: string;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Specifies a boolean value whether enable undo/redo operations in the image editor.
|
|
376
|
+
*
|
|
377
|
+
* @remarks
|
|
378
|
+
* If this property is true, the undo redo options will be enabled in toolbar and can also be accessed via keyboard shortcuts.
|
|
379
|
+
* If set to false, both options will be disabled.
|
|
380
|
+
* The undo redo history is limited to 16. Once the maximum limit is reached, the oldest history item will be removed to make space for the new item.
|
|
381
|
+
*
|
|
382
|
+
* @default true
|
|
383
|
+
*
|
|
384
|
+
*/
|
|
385
|
+
allowUndoRedo?: boolean;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Specifies whether to show/hide the quick access toolbar.
|
|
389
|
+
*
|
|
390
|
+
* @default true
|
|
391
|
+
*
|
|
392
|
+
* @remarks
|
|
393
|
+
* Set this property to true to show the quick access toolbar, and false to hide it.
|
|
394
|
+
* ```html
|
|
395
|
+
* <div id='imageeditor'></div>
|
|
396
|
+
* ```
|
|
397
|
+
* ```typescript
|
|
398
|
+
* <script>
|
|
399
|
+
* var imageObj = new ImageEditor({
|
|
400
|
+
* showQuickAccessToolbar : true
|
|
401
|
+
* });
|
|
402
|
+
* imageObj.appendTo("#imageeditor");
|
|
403
|
+
* </script>
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
showQuickAccessToolbar?: boolean;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Specifies a template for the quick access toolbar.
|
|
410
|
+
* Use this property to customize the quick access toolbar.
|
|
411
|
+
*
|
|
412
|
+
* @default null
|
|
413
|
+
* @aspType string
|
|
414
|
+
*
|
|
415
|
+
* @remarks
|
|
416
|
+
* This property only works if the "showQuickToolbar" property is set to true.
|
|
417
|
+
* ```html
|
|
418
|
+
* <div id='imageeditor'></div>
|
|
419
|
+
* ```
|
|
420
|
+
* ```typescript
|
|
421
|
+
* <script>
|
|
422
|
+
* var imageObj = new ImageEditor({
|
|
423
|
+
* showQuickAccessToolbar : true,
|
|
424
|
+
* quickAccessToolbarTemplate: '#toolbarTemplate'
|
|
425
|
+
* });
|
|
426
|
+
* imageObj.appendTo("#imageeditor");
|
|
427
|
+
* </script>
|
|
428
|
+
* <script id="toolbarTemplate" type="text/x-template">
|
|
429
|
+
* <div class = 'e-toolbar'>
|
|
430
|
+
* <button id= 'dltbtn'></button>
|
|
431
|
+
* </div>
|
|
432
|
+
* </script>
|
|
433
|
+
* ```
|
|
434
|
+
*/
|
|
435
|
+
quickAccessToolbarTemplate?: string | Function;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Determines whether high-quality images should be smoothed when rendered.
|
|
439
|
+
*
|
|
440
|
+
* @default false
|
|
441
|
+
*
|
|
442
|
+
* @remarks
|
|
443
|
+
*
|
|
444
|
+
* When enabled (`true`), the image will be smoothed, reducing pixelation at the cost of sharpness.
|
|
445
|
+
*
|
|
446
|
+
* When disabled (`false`), the image will be rendered with crisp, unaltered pixels.
|
|
447
|
+
*
|
|
448
|
+
* ```html
|
|
449
|
+
* <div id='imageeditor'></div>
|
|
450
|
+
* ```
|
|
451
|
+
* ```typescript
|
|
452
|
+
* <script>
|
|
453
|
+
* var imageObj = new ImageEditor({
|
|
454
|
+
* imageSmoothingEnabled: true
|
|
455
|
+
* });
|
|
456
|
+
* imageObj.appendTo("#imageeditor");
|
|
457
|
+
* </script>
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
imageSmoothingEnabled?: boolean;
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Specifies whether to prevent user interaction with the image editor control.
|
|
464
|
+
* A boolean that specifies whether to prevent the interaction in image editor control. The default value is false.
|
|
465
|
+
*
|
|
466
|
+
* @remarks
|
|
467
|
+
* If the property is true, the image editor control becomes read-only, and the user interaction will be prevented.
|
|
468
|
+
*
|
|
469
|
+
* @default false
|
|
470
|
+
* @private
|
|
471
|
+
*/
|
|
472
|
+
isReadOnly?: boolean;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Specifies whether to enable RTL mode in image editor control that displays the content in the right-to-left direction.
|
|
476
|
+
* A boolean that specifies whether to enable RTL mode in image editor control. The default value is false.
|
|
477
|
+
*
|
|
478
|
+
* @default false
|
|
479
|
+
* @private
|
|
480
|
+
*/
|
|
481
|
+
enableRtl?: boolean;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Specifies a bool value whether enable or disable persist component's state between page reloads. The default value is false.
|
|
485
|
+
*
|
|
486
|
+
* @remarks
|
|
487
|
+
* If this property is true, the controls's state persistence will be enabled.
|
|
488
|
+
* Control's property will be stored in browser local storage to persist control's state when page reloads.
|
|
489
|
+
*
|
|
490
|
+
* @default false
|
|
491
|
+
* @private
|
|
492
|
+
*/
|
|
493
|
+
enablePersistence?: boolean;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Specifies the finetune settings option which can be used to perform color adjustments in the image editor control.
|
|
497
|
+
*
|
|
498
|
+
* {% codeBlock src='image-editor/finetuneSettings/index.md' %}{% endcodeBlock %}
|
|
499
|
+
*
|
|
500
|
+
* @remarks
|
|
501
|
+
* A 'FinetuneSettingsModel' value that specifies the the finetune options which are enabled in image editor control.
|
|
502
|
+
* If the property is not specified, then the default values will be applied for minimum, maximum, and value properties for all finetune options.
|
|
503
|
+
*
|
|
504
|
+
* The possible values are:
|
|
505
|
+
* - Brightness: The intensity of the primary colors grows with increased brightness, but the color itself does not change. It can be done by changing brightness and opacity property.
|
|
506
|
+
* - Contrast: The contrast of an image refers to the difference between the light pixels and dark pixels. Low contrast images contain either a narrow range of colors while high contrast images have bright highlights and dark shadows. It can be done by changing contrast property.
|
|
507
|
+
* - Hue: Hue distinguishes one color from another and is described using common color names such as green, blue, red, yellow, etc. Value refers to the lightness or darkness of a color. It can be controlled by hue-rotate property.
|
|
508
|
+
* - Saturation: If saturation increases, colors appear sharper or purer. As saturation decreases, colors appear more washed-out or faded. It can be controlled by saturation and brightness property.
|
|
509
|
+
* - Exposure: If exposure increases, intensity of light appears brighter. As exposure decreases, intensity of light decreases. Exposure can be controlled by brightness property.
|
|
510
|
+
* - Opacity: The state or quality of being opaque or transparent, not allowing light to pass through the image. Opacity can be controlled by opacity property.
|
|
511
|
+
* - Blur : Adjusting the blur can make an image unfocused or unclear. Blur can be controlled by blur property.
|
|
512
|
+
*
|
|
513
|
+
*/
|
|
514
|
+
finetuneSettings?: FinetuneSettingsModel;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Specifies the zoom settings to perform zooming action.
|
|
518
|
+
* A 'ZoomSettingsModel' value that specifies the the zoom related options which are enabled in image editor control. The default value is null.
|
|
519
|
+
*
|
|
520
|
+
* {% codeBlock src='image-editor/zoomSettings/index.md' %}{% endcodeBlock %}
|
|
521
|
+
*
|
|
522
|
+
* @remarks
|
|
523
|
+
* If the property is not specified, then the default settings will be applied for all the properties available in zoom settings.
|
|
524
|
+
*
|
|
525
|
+
* The following options are available in `zoomSettings`.
|
|
526
|
+
* - minZoomFactor: Specifies the minimum zoom factor level to control the zoom.
|
|
527
|
+
* - maxZoomFactor: Specifies the maximum zoom factor level to control the zoom.
|
|
528
|
+
* - zoomFactor: Specifies the zoom factor to be applied to the image.
|
|
529
|
+
* - zoomTrigger: Specifies the types of zooming to be supported in the image editor.
|
|
530
|
+
* - zoomPoint: Specifies the x and y coordinates in which the zooming performed on initial load.
|
|
531
|
+
*
|
|
532
|
+
*/
|
|
533
|
+
zoomSettings?: ZoomSettingsModel;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Specifies the selection settings to customize selection.
|
|
537
|
+
* A 'SelectionSettingsModel' value that specifies the the customization related options which are enabled in image editor control. The default value is null.
|
|
538
|
+
*
|
|
539
|
+
* @remarks
|
|
540
|
+
* If the property is not specified, then the default settings will be applied for all the properties available in selection settings.
|
|
541
|
+
*
|
|
542
|
+
* The following options are available in `selectionSettings`.
|
|
543
|
+
* - showCircle: Specifies whether to show / hide circles on selection.
|
|
544
|
+
* - strokeColor: Specifies the stroke color of circle selection.
|
|
545
|
+
* - fillColor: Specifies the fill color of circle selection.
|
|
546
|
+
*
|
|
547
|
+
*/
|
|
548
|
+
selectionSettings?: SelectionSettingsModel;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Predefine the font families that populate in font family dropdown list from the toolbar.
|
|
552
|
+
*/
|
|
553
|
+
fontFamily?: FontFamilyModel;
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Represents the settings for configuring image uploads.
|
|
557
|
+
*
|
|
558
|
+
* This object allows you to specify restrictions on the types and sizes of images that can be uploaded, ensuring that only valid files are accepted according to the defined criteria.
|
|
559
|
+
*
|
|
560
|
+
* The following options are available in `uploadSettings`.
|
|
561
|
+
* - allowedExtensions: Specifies the allowed file extensions for uploaded images. The default value is null.
|
|
562
|
+
* - minFileSize: Specifies the minimum size (in bytes) for the uploaded image. The default value is null.
|
|
563
|
+
* - maxFileSize: Specifies the maximum size (in bytes) for the uploaded image. The default value is null.
|
|
564
|
+
*
|
|
565
|
+
*/
|
|
566
|
+
uploadSettings?: UploadSettingsModel;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Event callback that is raised before an image is saved.
|
|
570
|
+
*
|
|
571
|
+
* @event beforeSave
|
|
572
|
+
*/
|
|
573
|
+
beforeSave?: EmitType<BeforeSaveEventArgs>;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Event callback that is raised after rendering the Image Editor component.
|
|
577
|
+
*
|
|
578
|
+
* @event created
|
|
579
|
+
*/
|
|
580
|
+
created?: EmitType<Event>
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Event callback that is raised once the component is destroyed with its elements and bound events.
|
|
584
|
+
*
|
|
585
|
+
* @event destroyed
|
|
586
|
+
*/
|
|
587
|
+
destroyed?: EmitType<Event>
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Event callback that is raised while zooming an image.
|
|
591
|
+
*
|
|
592
|
+
* @event zooming
|
|
593
|
+
*/
|
|
594
|
+
zooming?: EmitType<ZoomEventArgs>
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Event callback that is raised while panning an image.
|
|
598
|
+
*
|
|
599
|
+
* @event panning
|
|
600
|
+
*/
|
|
601
|
+
panning?: EmitType<PanEventArgs>
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Event callback that is raised while cropping an image.
|
|
605
|
+
*
|
|
606
|
+
* @event cropping
|
|
607
|
+
*/
|
|
608
|
+
cropping?: EmitType<CropEventArgs>
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Event callback that is raised while rotating an image.
|
|
612
|
+
*
|
|
613
|
+
* @event rotating
|
|
614
|
+
*/
|
|
615
|
+
rotating?: EmitType<RotateEventArgs>
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Event callback that is raised while flipping an image.
|
|
619
|
+
*
|
|
620
|
+
* @event flipping
|
|
621
|
+
*/
|
|
622
|
+
flipping?: EmitType<FlipEventArgs>
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Event callback that is raised while changing shapes in an Image Editor.
|
|
626
|
+
*
|
|
627
|
+
* @event shapeChanging
|
|
628
|
+
*/
|
|
629
|
+
shapeChanging?: EmitType<ShapeChangeEventArgs>
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Event callback that is raised while changing selection in an Image Editor.
|
|
633
|
+
*
|
|
634
|
+
* @event selectionChanging
|
|
635
|
+
*/
|
|
636
|
+
selectionChanging?: EmitType<SelectionChangeEventArgs>
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Event callback that is raised once an image is opened in an Image Editor.
|
|
640
|
+
*
|
|
641
|
+
* @event fileOpened
|
|
642
|
+
*/
|
|
643
|
+
fileOpened?: EmitType<OpenEventArgs>
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Event callback that is raised once an image is saved.
|
|
647
|
+
*
|
|
648
|
+
* @event saved
|
|
649
|
+
*/
|
|
650
|
+
saved?: EmitType<SaveEventArgs>;
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Event callback that is raised once the toolbar is created.
|
|
654
|
+
*
|
|
655
|
+
* @event toolbarCreated
|
|
656
|
+
*/
|
|
657
|
+
toolbarCreated?: EmitType<ToolbarEventArgs>
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Event callback that is raised while updating/refreshing the toolbar
|
|
661
|
+
*
|
|
662
|
+
* {% codeBlock src='image-editor/toolbarUpdating/index.md' %}{% endcodeBlock %}
|
|
663
|
+
*
|
|
664
|
+
* @event toolbarUpdating
|
|
665
|
+
*
|
|
666
|
+
*/
|
|
667
|
+
toolbarUpdating?: EmitType<ToolbarEventArgs>
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Event callback that is raised once the toolbar item is clicked.
|
|
671
|
+
*
|
|
672
|
+
* @event toolbarItemClicked
|
|
673
|
+
*/
|
|
674
|
+
toolbarItemClicked?: EmitType<ClickEventArgs>
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Event callback that is raised when applying filter to an image.
|
|
678
|
+
*
|
|
679
|
+
* @event imageFiltering
|
|
680
|
+
*/
|
|
681
|
+
imageFiltering?: EmitType<ImageFilterEventArgs>;
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Event callback that is raised when applying fine tune to an image.
|
|
685
|
+
*
|
|
686
|
+
* @event finetuneValueChanging
|
|
687
|
+
*/
|
|
688
|
+
finetuneValueChanging?: EmitType<FinetuneEventArgs>
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Event callback that is raised while clicking on an image in the Image Editor.
|
|
692
|
+
*
|
|
693
|
+
* @event click
|
|
694
|
+
*/
|
|
695
|
+
click?: EmitType<ImageEditorClickEventArgs>
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Event callback that is raised after shape changing action is performed in an image editor.
|
|
699
|
+
*
|
|
700
|
+
* @remarks
|
|
701
|
+
* This event is triggered after changing stroke color, fill Color, and stroke width property for the shapes and after the shape is applied to the canvas while clicking the OK button in toolbar.
|
|
702
|
+
*
|
|
703
|
+
* @event shapeChange
|
|
704
|
+
*/
|
|
705
|
+
shapeChange?: EmitType<ShapeChangeEventArgs>
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Event callback that is raised when opening the quick access toolbar.
|
|
709
|
+
*
|
|
710
|
+
* @event quickAccessToolbarOpen
|
|
711
|
+
*
|
|
712
|
+
* @remarks
|
|
713
|
+
* Use this event to customize the toolbar items that appear in the quick access toolbar.
|
|
714
|
+
* To customize the toolbar items, modify the "toolbarItems" collection property of the event arguments.
|
|
715
|
+
* The "toolbarItems" collection contains string and ItemModel values.
|
|
716
|
+
* The string values representing the names of the built-in toolbar items to display.
|
|
717
|
+
* The ItemModel values representing the ItemModel of custom toolbar items to display.
|
|
718
|
+
*
|
|
719
|
+
* ```html
|
|
720
|
+
* <div id='imageeditor'></div>
|
|
721
|
+
* ```
|
|
722
|
+
* ```typescript
|
|
723
|
+
* <script>
|
|
724
|
+
* var imageObj = new ImageEditor({
|
|
725
|
+
* showQuickAccessToolbar : true,
|
|
726
|
+
* quickAccessToolbarOpen: (args: QuickAccessToolbarEventArgs)=> {
|
|
727
|
+
* args.toolbarItems = [“Delete”, {text: “custom”}];
|
|
728
|
+
* }
|
|
729
|
+
*
|
|
730
|
+
* });
|
|
731
|
+
* imageObj.appendTo("#imageeditor");
|
|
732
|
+
* </script>
|
|
733
|
+
*/
|
|
734
|
+
quickAccessToolbarOpen?: EmitType<QuickAccessToolbarEventArgs>
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Event callback that is raised while resizing an image.
|
|
738
|
+
*
|
|
739
|
+
* @event resizing
|
|
740
|
+
*/
|
|
741
|
+
resizing?: EmitType<ResizeEventArgs>
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Event callback that is raised once the quick access toolbar item is clicked.
|
|
745
|
+
*
|
|
746
|
+
* @event quickAccessToolbarItemClick
|
|
747
|
+
*
|
|
748
|
+
*/
|
|
749
|
+
quickAccessToolbarItemClick?: EmitType<ClickEventArgs>
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Event callback that is raised while applying frames on an image.
|
|
753
|
+
*
|
|
754
|
+
* @event frameChange
|
|
755
|
+
*/
|
|
756
|
+
frameChange?: EmitType<FrameChangeEventArgs>
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Event callback that is triggered after the completion of an editing action in the image editor.
|
|
760
|
+
*
|
|
761
|
+
* This event occurs after the image editor canvas has been updated through following actions such as cropping, drawing annotations, applying filters, fine-tuning, or other customizations.
|
|
762
|
+
*
|
|
763
|
+
* It provides an opportunity to perform additional tasks, such as comparing the current image data with previous states or triggering further processing based on the changes.
|
|
764
|
+
*
|
|
765
|
+
* @event editComplete
|
|
766
|
+
*
|
|
767
|
+
*/
|
|
768
|
+
editComplete?: EmitType<EditCompleteEventArgs >
|
|
769
|
+
|
|
770
|
+
}
|