@syncfusion/ej2-image-editor 21.2.6 → 22.1.34

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 (105) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +6 -24
  3. package/dist/ej2-image-editor.umd.min.js +2 -2
  4. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-image-editor.es2015.js +19186 -12390
  6. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-image-editor.es5.js +19217 -12390
  8. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  9. package/dist/global/ej2-image-editor.min.js +2 -2
  10. package/dist/global/ej2-image-editor.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/image-editor/action/crop.d.ts +35 -0
  14. package/src/image-editor/action/crop.js +818 -0
  15. package/src/image-editor/action/draw.d.ts +122 -0
  16. package/src/image-editor/action/draw.js +3253 -0
  17. package/src/image-editor/action/export.d.ts +23 -0
  18. package/src/image-editor/action/export.js +364 -0
  19. package/src/image-editor/action/filter.d.ts +35 -0
  20. package/src/image-editor/action/filter.js +699 -0
  21. package/src/image-editor/action/freehand-draw.d.ts +61 -0
  22. package/src/image-editor/action/freehand-draw.js +1015 -0
  23. package/src/image-editor/action/index.d.ts +9 -0
  24. package/src/image-editor/action/index.js +9 -0
  25. package/src/image-editor/action/selection.d.ts +140 -0
  26. package/src/image-editor/action/selection.js +4689 -0
  27. package/src/image-editor/action/shape.d.ts +93 -0
  28. package/src/image-editor/action/shape.js +2657 -0
  29. package/src/image-editor/action/transform.d.ts +67 -0
  30. package/src/image-editor/action/transform.js +1670 -0
  31. package/src/image-editor/action/undo-redo.d.ts +43 -0
  32. package/src/image-editor/action/undo-redo.js +800 -0
  33. package/src/image-editor/base/enum.d.ts +189 -0
  34. package/src/image-editor/base/enum.js +198 -0
  35. package/src/image-editor/{image-editor-model.d.ts → base/image-editor-model.d.ts} +131 -43
  36. package/src/image-editor/{image-editor.d.ts → base/image-editor.d.ts} +425 -1108
  37. package/src/image-editor/base/image-editor.js +2458 -0
  38. package/src/image-editor/base/index.d.ts +4 -0
  39. package/src/image-editor/base/index.js +2 -0
  40. package/src/image-editor/base/interface.d.ts +1120 -0
  41. package/src/image-editor/base/interface.js +1 -0
  42. package/src/image-editor/index.d.ts +3 -5
  43. package/src/image-editor/index.js +3 -4
  44. package/src/image-editor/renderer/index.d.ts +1 -0
  45. package/src/image-editor/renderer/index.js +1 -0
  46. package/src/image-editor/renderer/toolbar.d.ts +105 -0
  47. package/src/image-editor/renderer/toolbar.js +3019 -0
  48. package/styles/bootstrap-dark.css +69 -3
  49. package/styles/bootstrap.css +69 -3
  50. package/styles/bootstrap4.css +69 -3
  51. package/styles/bootstrap5-dark.css +69 -3
  52. package/styles/bootstrap5.css +69 -3
  53. package/styles/fabric-dark.css +69 -3
  54. package/styles/fabric.css +69 -3
  55. package/styles/fluent-dark.css +69 -3
  56. package/styles/fluent.css +69 -3
  57. package/styles/highcontrast-light.css +69 -3
  58. package/styles/highcontrast.css +69 -7
  59. package/styles/image-editor/_layout.scss +21 -7
  60. package/styles/image-editor/_material3-dark-definition.scss +1 -0
  61. package/styles/image-editor/_material3-definition.scss +11 -0
  62. package/styles/image-editor/_theme.scss +9 -2
  63. package/styles/image-editor/bootstrap-dark.css +69 -3
  64. package/styles/image-editor/bootstrap.css +69 -3
  65. package/styles/image-editor/bootstrap4.css +69 -3
  66. package/styles/image-editor/bootstrap5-dark.css +69 -3
  67. package/styles/image-editor/bootstrap5.css +69 -3
  68. package/styles/image-editor/fabric-dark.css +69 -3
  69. package/styles/image-editor/fabric.css +69 -3
  70. package/styles/image-editor/fluent-dark.css +69 -3
  71. package/styles/image-editor/fluent.css +69 -3
  72. package/styles/image-editor/highcontrast-light.css +69 -3
  73. package/styles/image-editor/highcontrast.css +69 -7
  74. package/styles/image-editor/icons/_bootstrap-dark.scss +132 -0
  75. package/styles/image-editor/icons/_bootstrap.scss +132 -0
  76. package/styles/image-editor/icons/_bootstrap4.scss +132 -0
  77. package/styles/image-editor/icons/_bootstrap5.scss +132 -0
  78. package/styles/image-editor/icons/_fabric-dark.scss +132 -0
  79. package/styles/image-editor/icons/_fabric.scss +132 -0
  80. package/styles/image-editor/icons/_fluent.scss +132 -0
  81. package/styles/image-editor/icons/_fusionnew.scss +132 -0
  82. package/styles/image-editor/icons/_highcontrast-light.scss +132 -0
  83. package/styles/image-editor/icons/_highcontrast.scss +132 -0
  84. package/styles/image-editor/icons/_material-dark.scss +132 -0
  85. package/styles/image-editor/icons/_material.scss +132 -0
  86. package/styles/image-editor/icons/_material3-dark.scss +1 -0
  87. package/styles/image-editor/icons/_material3.scss +133 -1
  88. package/styles/image-editor/icons/_tailwind.scss +132 -0
  89. package/styles/image-editor/material-dark.css +69 -3
  90. package/styles/image-editor/material.css +69 -3
  91. package/styles/image-editor/material3-dark.css +453 -0
  92. package/styles/image-editor/material3-dark.scss +14 -0
  93. package/styles/image-editor/material3.css +509 -0
  94. package/styles/image-editor/material3.scss +14 -0
  95. package/styles/image-editor/tailwind-dark.css +69 -3
  96. package/styles/image-editor/tailwind.css +69 -3
  97. package/styles/material-dark.css +69 -3
  98. package/styles/material.css +69 -3
  99. package/styles/material3-dark.css +453 -0
  100. package/styles/material3-dark.scss +3 -0
  101. package/styles/material3.css +509 -0
  102. package/styles/material3.scss +3 -0
  103. package/styles/tailwind-dark.css +69 -3
  104. package/styles/tailwind.css +69 -3
  105. package/src/image-editor/image-editor.js +0 -14784
@@ -1,5 +1,4 @@
1
- import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, extend } from '@syncfusion/ej2-base';
2
- import {ImageFinetuneValue,ZoomTrigger,Point,Theme,ImageEditorCommand,SaveEventArgs,BeforeSaveEventArgs,ZoomEventArgs,PanEventArgs,CropEventArgs,RotateEventArgs,FlipEventArgs,ShapeChangeEventArgs,OpenEventArgs,ToolbarEventArgs,ImageFilterEventArgs,FinetuneEventArgs,ImageEditorClickEventArgs,QuickAccessToolbarEventArgs} from "./image-editor";
1
+ import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, ModuleDeclaration, extend, isBlazor, BlazorDotnetObject } from '@syncfusion/ej2-base';
3
2
  import {ComponentModel} from '@syncfusion/ej2-base';
4
3
 
5
4
  /**
@@ -110,8 +109,8 @@ export interface ZoomSettingsModel {
110
109
  *
111
110
  * By default, this property is set to `null`, which enables all types of zooming.
112
111
  *
113
- * @aspNumberEnum
114
112
  * @default null
113
+ * @aspNumberEnum
115
114
  */
116
115
  zoomTrigger?: ZoomTrigger;
117
116
 
@@ -119,7 +118,6 @@ export interface ZoomSettingsModel {
119
118
  * Specifies the minimum zooming level to limit the zooming.
120
119
  * An integer value that specifies the minimum zooming level. And the default value is 1 (100%).
121
120
  *
122
- * @private
123
121
  * @remarks
124
122
  * The given value is considered as percentage.
125
123
  *
@@ -159,6 +157,40 @@ export interface ZoomSettingsModel {
159
157
 
160
158
  }
161
159
 
160
+ /**
161
+ * Interface for a class SelectionSettings
162
+ */
163
+ export interface SelectionSettingsModel {
164
+
165
+ /**
166
+ * Specifies a boolean value whether to show circle on selection in the image editor.
167
+ *
168
+ * @type {boolean}
169
+ *
170
+ * @default true
171
+ */
172
+ showCircle?: boolean;
173
+
174
+ /**
175
+ * Represents stroke color of circle selection in the image editor.
176
+ *
177
+ * @type {string}
178
+ *
179
+ * @default null
180
+ */
181
+ strokeColor?: string;
182
+
183
+ /**
184
+ * Represents fill color of circle selection in the image editor.
185
+ *
186
+ * @type {string}
187
+ *
188
+ * @default null
189
+ */
190
+ fillColor?: string;
191
+
192
+ }
193
+
162
194
  /**
163
195
  * Interface for a class ImageEditor
164
196
  */
@@ -229,7 +261,7 @@ export interface ImageEditorModel extends ComponentModel{
229
261
  * If the property is defined as empty collection, the toolbar will not be rendered.
230
262
  * The preconfigured toolbar commands are
231
263
  * - Crop: helps to crop an image as ellipse, square, various ratio aspects, custom selection with resize, drag and drop.
232
- * - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, text and freehand drawing with resize, drag and drop, and customize its appearance.
264
+ * - Annotate: help to insert a shape on image that supports rectangle, ellipse, line, arrow, path, text and freehand drawing with resize, drag and drop, and customize its appearance.
233
265
  * - Transform: helps to rotate and flip an image.
234
266
  * - Finetunes: helps to perform adjustments on an image.
235
267
  * - Filters: helps to perform predefined color filters.
@@ -238,21 +270,13 @@ export interface ImageEditorModel extends ComponentModel{
238
270
  * - Save: save the modified image.
239
271
  * - Open: open an image to perform editing.
240
272
  * - Reset: reset the modification and restore the original image.
241
- *
242
- * @example
243
- * // Define toolbar items as an array of strings
244
- * var toolbarItems = ["Crop", "Annotate", "Transform", "ZoomIn", "ZoomOut", "Pan", "Move", "Save", "Open", "Reset"];
245
- *
246
- * // Define toolbar items as an array of ItemModel objects
247
- * var toolbarItems = [
248
- * { text: "Crop", tooltipText: "Crop", prefixIcon: "e-icon e-crop-icon" }
249
- * ]
273
+ *
274
+ * {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
250
275
  *
251
276
  * @remarks
252
277
  * If the toolbarTemplate property is defined in the control, the toolbar will be rendered based on the toolbarTemplate property.
253
278
  * @default null
254
279
  *
255
- * {% codeBlock src='image-editor/toolbar/index.md' %}{% endcodeBlock %}
256
280
  */
257
281
  toolbar?: (string | ImageEditorCommand | ItemModel)[];
258
282
 
@@ -260,15 +284,17 @@ export interface ImageEditorModel extends ComponentModel{
260
284
  * Specifies a custom template for the toolbar of an image editor control.
261
285
  * 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.
262
286
  *
287
+ * {% codeBlock src='image-editor/toolbarTemplate/index.md' %}{% endcodeBlock %}
288
+ *
263
289
  * @remarks
264
290
  * 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.
265
291
  *
266
292
  * @default null
293
+ * @aspType string
267
294
  *
268
- * {% codeBlock src='image-editor/toolbarTemplate/index.md' %}{% endcodeBlock %}
269
295
  *
270
296
  */
271
- toolbarTemplate?: string;
297
+ toolbarTemplate?: string | Function;
272
298
 
273
299
  /**
274
300
  * Specifies the width of an Image Editor.
@@ -294,33 +320,54 @@ export interface ImageEditorModel extends ComponentModel{
294
320
  allowUndoRedo?: boolean;
295
321
 
296
322
  /**
297
- * Specifies whether to show/hide the Quick Access Toolbar while select the shapes.
298
- *
299
- * @remarks
300
- * The Quick Access Toolbar is a small customizable toolbar that shows commonly used commands while select the shapes.
301
- * Set this property to true to show the Quick Access Toolbar, and false to hide it.
323
+ * Specifies whether to show/hide the quick access toolbar.
302
324
  *
303
- * @default false
304
- * @private
325
+ * @default true
305
326
  *
306
327
  * @remarks
307
328
  * Set this property to true to show the quick access toolbar, and false to hide it.
329
+ * ```html
330
+ * <div id='imageeditor'></div>
331
+ * ```
332
+ * ```typescript
333
+ * <script>
334
+ * var imageObj = new ImageEditor({
335
+ * showQuickAccessToolbar : true
336
+ * });
337
+ * imageObj.appendTo("#imageeditor");
338
+ * </script>
339
+ * ```
308
340
  */
309
341
  showQuickAccessToolbar?: boolean;
310
342
 
311
343
  /**
312
- * Specifies a custom template content for the quick access toolbar of an Image Editor control.
344
+ * Specifies a template for the quick access toolbar.
345
+ * Use this property to customize the quick access toolbar.
313
346
  *
314
347
  * @default null
315
- * @private
348
+ * @aspType string
316
349
  *
317
350
  * @remarks
318
- * This property only works if the "showQuickAccessToolbar" property is set to true.
319
- *
320
- * {% codeBlock src='image-editor/quickAccessToolbarTemplate/index.md' %}{% endcodeBlock %}
321
- *
322
- */
323
- quickAccessToolbarTemplate?: string;
351
+ * This property only works if the "showQuickToolbar" property is set to true.
352
+ * ```html
353
+ * <div id='imageeditor'></div>
354
+ * ```
355
+ * ```typescript
356
+ * <script>
357
+ * var imageObj = new ImageEditor({
358
+ * showQuickAccessToolbar : true,
359
+ * quickAccessToolbarTemplate: '#toolbarTemplate'
360
+ * });
361
+ * imageObj.appendTo("#imageeditor");
362
+ * </script>
363
+ * <script id="toolbarTemplate" type="text/x-template">
364
+ * <div class = 'e-toolbar'>
365
+ * <button id= 'dltbtn'></button>
366
+ * </div>
367
+ * </script>
368
+ * ```
369
+ */
370
+ quickAccessToolbarTemplate?: string | Function;
324
371
 
325
372
  /**
326
373
  * Specifies whether to prevent user interaction with the image editor control.
@@ -358,6 +405,8 @@ export interface ImageEditorModel extends ComponentModel{
358
405
  /**
359
406
  * Specifies the finetune settings option which can be used to perform color adjustments in the image editor control.
360
407
  *
408
+ * {% codeBlock src='image-editor/finetuneSettings/index.md' %}{% endcodeBlock %}
409
+ *
361
410
  * @remarks
362
411
  * A 'FinetuneSettingsModel' value that specifies the the finetune options which are enabled in image editor control.
363
412
  * If the property is not specified, then the default values will be applied for minimum, maximum, and value properties for all finetune options.
@@ -371,8 +420,6 @@ export interface ImageEditorModel extends ComponentModel{
371
420
  * - 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.
372
421
  * - Blur : Adjusting the blur can make an image unfocused or unclear. Blur can be controlled by blur property.
373
422
  *
374
- * {% codeBlock src='image-editor/finetuneSettings/index.md' %}{% endcodeBlock %}
375
- *
376
423
  */
377
424
  finetuneSettings?: FinetuneSettingsModel;
378
425
 
@@ -380,6 +427,8 @@ export interface ImageEditorModel extends ComponentModel{
380
427
  * Specifies the zoom settings to perform zooming action.
381
428
  * A 'ZoomSettingsModel' value that specifies the the zoom related options which are enabled in image editor control. The default value is null.
382
429
  *
430
+ * {% codeBlock src='image-editor/zoomSettings/index.md' %}{% endcodeBlock %}
431
+ *
383
432
  * @remarks
384
433
  * If the property is not specified, then the default settings will be applied for all the properties available in zoom settings.
385
434
  *
@@ -390,11 +439,24 @@ export interface ImageEditorModel extends ComponentModel{
390
439
  * - zoomTrigger: Specifies the types of zooming to be supported in the image editor.
391
440
  * - zoomPoint: Specifies the x and y coordinates in which the zooming performed on initial load.
392
441
  *
393
- * {% codeBlock src='image-editor/zoomSettings/index.md' %}{% endcodeBlock %}
394
- *
395
442
  */
396
443
  zoomSettings?: ZoomSettingsModel;
397
444
 
445
+ /**
446
+ * Specifies the selection settings to customize selection.
447
+ * A 'SelectionSettingsModel' value that specifies the the customization related options which are enabled in image editor control. The default value is null.
448
+ *
449
+ * @remarks
450
+ * If the property is not specified, then the default settings will be applied for all the properties available in selection settings.
451
+ *
452
+ * The following options are available in `selectionSettings`.
453
+ * - showCircle: Specifies whether to show / hide circles on selection.
454
+ * - strokeColor: Specifies the stroke color of circle selection.
455
+ * - fillColor: Specifies the fill color of circle selection.
456
+ *
457
+ */
458
+ selectionSettings?: SelectionSettingsModel;
459
+
398
460
  /**
399
461
  * Event callback that is raised before an image is saved.
400
462
  *
@@ -458,6 +520,13 @@ export interface ImageEditorModel extends ComponentModel{
458
520
  */
459
521
  shapeChanging?: EmitType<ShapeChangeEventArgs>
460
522
 
523
+ /**
524
+ * Event callback that is raised while changing selection in an Image Editor.
525
+ *
526
+ * @event selectionChanging
527
+ */
528
+ selectionChanging?: EmitType<SelectionChangeEventArgs>
529
+
461
530
  /**
462
531
  * Event callback that is raised once an image is opened in an Image Editor.
463
532
  *
@@ -481,11 +550,11 @@ export interface ImageEditorModel extends ComponentModel{
481
550
 
482
551
  /**
483
552
  * Event callback that is raised while updating/refreshing the toolbar
553
+ *
554
+ * {% codeBlock src='image-editor/toolbarUpdating/index.md' %}{% endcodeBlock %}
484
555
  *
485
556
  * @event toolbarUpdating
486
557
  *
487
- * {% codeBlock src='image-editor/toolbarUpdating/index.md' %}{% endcodeBlock %}
488
- *
489
558
  */
490
559
  toolbarUpdating?: EmitType<ToolbarEventArgs>
491
560
 
@@ -518,10 +587,9 @@ export interface ImageEditorModel extends ComponentModel{
518
587
  click?: EmitType<ImageEditorClickEventArgs>
519
588
 
520
589
  /**
521
- * Event callback that is triggered when the quick access toolbar is opening.
590
+ * Event callback that is raised when opening the quick access toolbar.
522
591
  *
523
- * @event quickAccessToolbarOpening
524
- * @private
592
+ * @event quickAccessToolbarOpen
525
593
  *
526
594
  * @remarks
527
595
  * Use this event to customize the toolbar items that appear in the quick access toolbar.
@@ -530,9 +598,29 @@ export interface ImageEditorModel extends ComponentModel{
530
598
  * The string values representing the names of the built-in toolbar items to display.
531
599
  * The ItemModel values representing the ItemModel of custom toolbar items to display.
532
600
  *
533
- * {% codeBlock src='image-editor/quickAccessToolbarOpening/index.md' %}{% endcodeBlock %}
601
+ * ```html
602
+ * <div id='imageeditor'></div>
603
+ * ```
604
+ * ```typescript
605
+ * <script>
606
+ * var imageObj = new ImageEditor({
607
+ * showQuickAccessToolbar : true,
608
+ * quickAccessToolbarOpen: (args: QuickAccessToolbarEventArgs)=> {
609
+ * args.toolbarItems = [“Delete”, {text: “custom”}];
610
+ * }
611
+ *
612
+ * });
613
+ * imageObj.appendTo("#imageeditor");
614
+ * </script>
615
+ */
616
+ quickAccessToolbarOpen?: EmitType<QuickAccessToolbarEventArgs>
617
+
618
+ /**
619
+ * Event callback that is raised once the quick access toolbar item is clicked.
620
+ *
621
+ * @event quickAccessToolbarItemClick
534
622
  *
535
623
  */
536
- quickAccessToolbarOpening?: EmitType<QuickAccessToolbarEventArgs>
624
+ quickAccessToolbarItemClick?: EmitType<ClickEventArgs>
537
625
 
538
626
  }