@syncfusion/ej2-image-editor 25.2.3 → 26.1.35

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 (128) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-image-editor.umd.min.js +2 -2
  3. package/dist/ej2-image-editor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-image-editor.es2015.js +2679 -829
  5. package/dist/es6/ej2-image-editor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-image-editor.es5.js +2762 -872
  7. package/dist/es6/ej2-image-editor.es5.js.map +1 -1
  8. package/dist/global/ej2-image-editor.min.js +2 -2
  9. package/dist/global/ej2-image-editor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +13 -12
  12. package/src/image-editor/action/crop.d.ts +0 -1
  13. package/src/image-editor/action/crop.js +35 -77
  14. package/src/image-editor/action/draw.d.ts +3 -0
  15. package/src/image-editor/action/draw.js +190 -81
  16. package/src/image-editor/action/export.d.ts +3 -0
  17. package/src/image-editor/action/export.js +99 -40
  18. package/src/image-editor/action/filter.d.ts +0 -1
  19. package/src/image-editor/action/filter.js +4 -24
  20. package/src/image-editor/action/freehand-draw.js +30 -8
  21. package/src/image-editor/action/selection.d.ts +10 -0
  22. package/src/image-editor/action/selection.js +444 -99
  23. package/src/image-editor/action/shape.d.ts +11 -1
  24. package/src/image-editor/action/shape.js +520 -127
  25. package/src/image-editor/action/transform.d.ts +0 -1
  26. package/src/image-editor/action/transform.js +53 -69
  27. package/src/image-editor/action/undo-redo.d.ts +2 -0
  28. package/src/image-editor/action/undo-redo.js +114 -29
  29. package/src/image-editor/base/enum.d.ts +5 -1
  30. package/src/image-editor/base/enum.js +4 -0
  31. package/src/image-editor/base/image-editor-model.d.ts +8 -6
  32. package/src/image-editor/base/image-editor.d.ts +116 -7
  33. package/src/image-editor/base/image-editor.js +378 -52
  34. package/src/image-editor/base/interface.d.ts +17 -0
  35. package/src/image-editor/base/interface.js +0 -1
  36. package/src/image-editor/renderer/toolbar.d.ts +14 -1
  37. package/src/image-editor/renderer/toolbar.js +831 -191
  38. package/styles/bootstrap-dark.css +279 -97
  39. package/styles/bootstrap-dark.scss +13 -1
  40. package/styles/bootstrap.css +282 -98
  41. package/styles/bootstrap.scss +13 -1
  42. package/styles/bootstrap4.css +280 -97
  43. package/styles/bootstrap4.scss +13 -1
  44. package/styles/bootstrap5-dark.css +280 -101
  45. package/styles/bootstrap5-dark.scss +13 -1
  46. package/styles/bootstrap5.css +280 -101
  47. package/styles/bootstrap5.scss +13 -1
  48. package/styles/fabric-dark.css +281 -97
  49. package/styles/fabric-dark.scss +13 -1
  50. package/styles/fabric.css +284 -97
  51. package/styles/fabric.scss +13 -1
  52. package/styles/fluent-dark.css +287 -101
  53. package/styles/fluent-dark.scss +13 -1
  54. package/styles/fluent.css +287 -101
  55. package/styles/fluent.scss +13 -1
  56. package/styles/fluent2.css +1851 -0
  57. package/styles/fluent2.scss +13 -0
  58. package/styles/highcontrast-light.css +279 -97
  59. package/styles/highcontrast-light.scss +13 -1
  60. package/styles/highcontrast.css +284 -97
  61. package/styles/highcontrast.scss +13 -1
  62. package/styles/image-editor/_bds-definition.scss +5 -0
  63. package/styles/image-editor/_bootstrap-dark-definition.scss +5 -0
  64. package/styles/image-editor/_bootstrap-definition.scss +5 -0
  65. package/styles/image-editor/_bootstrap4-definition.scss +5 -0
  66. package/styles/image-editor/_bootstrap5-definition.scss +5 -0
  67. package/styles/image-editor/_bootstrap5.3-definition.scss +26 -0
  68. package/styles/image-editor/_fabric-dark-definition.scss +5 -0
  69. package/styles/image-editor/_fabric-definition.scss +5 -0
  70. package/styles/image-editor/_fluent-definition.scss +5 -0
  71. package/styles/image-editor/_fluent2-definition.scss +26 -0
  72. package/styles/image-editor/_fusionnew-definition.scss +5 -0
  73. package/styles/image-editor/_highcontrast-definition.scss +5 -0
  74. package/styles/image-editor/_highcontrast-light-definition.scss +5 -0
  75. package/styles/image-editor/_layout.scss +352 -13
  76. package/styles/image-editor/_material-dark-definition.scss +5 -0
  77. package/styles/image-editor/_material-definition.scss +5 -0
  78. package/styles/image-editor/_material3-definition.scss +5 -0
  79. package/styles/image-editor/_tailwind-definition.scss +5 -0
  80. package/styles/image-editor/bootstrap-dark.css +279 -97
  81. package/styles/image-editor/bootstrap.css +282 -98
  82. package/styles/image-editor/bootstrap4.css +280 -97
  83. package/styles/image-editor/bootstrap5-dark.css +280 -101
  84. package/styles/image-editor/bootstrap5.css +280 -101
  85. package/styles/image-editor/fabric-dark.css +281 -97
  86. package/styles/image-editor/fabric.css +284 -97
  87. package/styles/image-editor/fluent-dark.css +287 -101
  88. package/styles/image-editor/fluent.css +287 -101
  89. package/styles/image-editor/fluent2.css +1851 -0
  90. package/styles/image-editor/fluent2.scss +13 -0
  91. package/styles/image-editor/highcontrast-light.css +279 -97
  92. package/styles/image-editor/highcontrast.css +284 -97
  93. package/styles/image-editor/icons/_bds.scss +1 -162
  94. package/styles/image-editor/icons/_bootstrap-dark.scss +1 -162
  95. package/styles/image-editor/icons/_bootstrap.scss +1 -162
  96. package/styles/image-editor/icons/_bootstrap4.scss +1 -162
  97. package/styles/image-editor/icons/_bootstrap5.3.scss +250 -0
  98. package/styles/image-editor/icons/_bootstrap5.scss +1 -168
  99. package/styles/image-editor/icons/_fabric-dark.scss +1 -162
  100. package/styles/image-editor/icons/_fabric.scss +1 -162
  101. package/styles/image-editor/icons/_fluent.scss +1 -168
  102. package/styles/image-editor/icons/_fluent2.scss +256 -0
  103. package/styles/image-editor/icons/_fusionnew.scss +1 -138
  104. package/styles/image-editor/icons/_highcontrast-light.scss +1 -162
  105. package/styles/image-editor/icons/_highcontrast.scss +1 -162
  106. package/styles/image-editor/icons/_material-dark.scss +2 -163
  107. package/styles/image-editor/icons/_material.scss +1 -162
  108. package/styles/image-editor/icons/_material3.scss +2 -169
  109. package/styles/image-editor/icons/_tailwind.scss +1 -162
  110. package/styles/image-editor/material-dark.css +299 -100
  111. package/styles/image-editor/material.css +302 -100
  112. package/styles/image-editor/material3-dark.css +314 -103
  113. package/styles/image-editor/material3.css +314 -103
  114. package/styles/image-editor/tailwind-dark.css +284 -97
  115. package/styles/image-editor/tailwind.css +284 -97
  116. package/styles/material-dark.css +299 -100
  117. package/styles/material-dark.scss +13 -1
  118. package/styles/material.css +302 -100
  119. package/styles/material.scss +13 -1
  120. package/styles/material3-dark.css +314 -103
  121. package/styles/material3-dark.scss +13 -1
  122. package/styles/material3.css +314 -103
  123. package/styles/material3.scss +13 -1
  124. package/styles/tailwind-dark.css +284 -97
  125. package/styles/tailwind-dark.scss +13 -1
  126. package/styles/tailwind.css +284 -97
  127. package/styles/tailwind.scss +13 -1
  128. package/CHANGELOG.md +0 -281
@@ -1,4 +1,4 @@
1
- import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, ModuleDeclaration, extend } from '@syncfusion/ej2-base';
1
+ import { Component, NotifyPropertyChanges, INotifyPropertyChanged, Property, addClass, removeClass, ModuleDeclaration, extend } from '@syncfusion/ej2-base';
2
2
  import {ComponentModel} from '@syncfusion/ej2-base';
3
3
 
4
4
  /**
@@ -265,6 +265,7 @@ export interface ImageEditorModel extends ComponentModel{
265
265
  * - `MaterialDark`
266
266
  * - `FabricDark`
267
267
  * - `HighContrastDark`
268
+ * - `Fluent2`
268
269
  *
269
270
  * The default value is set to `Theme.Bootstrap5`.
270
271
  *
@@ -618,8 +619,9 @@ export interface ImageEditorModel extends ComponentModel{
618
619
  click?: EmitType<ImageEditorClickEventArgs>
619
620
 
620
621
  /**
621
- * Event callback that is raised after shape changing action is performed in an image editor.
622
- * @remarks
622
+ * Event callback that is raised after shape changing action is performed in an image editor.
623
+ *
624
+ * @remarks
623
625
  * 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.
624
626
  *
625
627
  * @event shapeChange
@@ -656,10 +658,10 @@ export interface ImageEditorModel extends ComponentModel{
656
658
  quickAccessToolbarOpen?: EmitType<QuickAccessToolbarEventArgs>
657
659
 
658
660
  /**
659
- * Event callback that is raised while resizing an image.
661
+ * Event callback that is raised while resizing an image.
660
662
  *
661
- * @event resizing
662
- */
663
+ * @event resizing
664
+ */
663
665
  resizing?: EmitType<ResizeEventArgs>
664
666
 
665
667
  /**
@@ -3,7 +3,7 @@ import { EmitType } from '@syncfusion/ej2-base';
3
3
  import { ItemModel, ClickEventArgs } from '@syncfusion/ej2-navigations';
4
4
  import { ChildProperty } from '@syncfusion/ej2-base';
5
5
  import { ImageEditorModel, FinetuneSettingsModel, ZoomSettingsModel, SelectionSettingsModel, FontFamilyModel } from './image-editor-model';
6
- import { SelectionChangeEventArgs, Transition, ArrowheadType, ResizeEventArgs, FrameType, FrameLineStyle, FrameChangeEventArgs } from './../index';
6
+ import { SelectionChangeEventArgs, Transition, ArrowheadType, ResizeEventArgs, FrameType, FrameLineStyle, FrameChangeEventArgs, ShapeType } from './../index';
7
7
  import { ZoomEventArgs, PanEventArgs, CropEventArgs, RotateEventArgs, FlipEventArgs, ShapeChangeEventArgs } from './../index';
8
8
  import { ToolbarEventArgs, OpenEventArgs, SaveEventArgs, BeforeSaveEventArgs, Point, ShapeSettings, ImageFilterEventArgs } from './../index';
9
9
  import { FinetuneEventArgs, QuickAccessToolbarEventArgs, CurrentObject, ImageDimension, TransformValue, PanPoint } from './../index';
@@ -362,6 +362,18 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
362
362
  curFrameObjEvent: object;
363
363
  /** @hidden */
364
364
  isChangesSaved: boolean;
365
+ /** @hidden */
366
+ drawingShape: string;
367
+ /** @hidden */
368
+ isShapeDrawing: boolean;
369
+ /** @hidden */
370
+ noPushUndo: boolean;
371
+ /** @hidden */
372
+ isUndoRedoStack: boolean;
373
+ /** @hidden */
374
+ shapeColl: any;
375
+ /** @hidden */
376
+ imgSrc: string;
365
377
  private lowerContext;
366
378
  private upperContext;
367
379
  private inMemoryContext;
@@ -412,6 +424,7 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
412
424
  * - `MaterialDark`
413
425
  * - `FabricDark`
414
426
  * - `HighContrastDark`
427
+ * - `Fluent2`
415
428
  *
416
429
  * The default value is set to `Theme.Bootstrap5`.
417
430
  *
@@ -734,6 +747,7 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
734
747
  click: EmitType<ImageEditorClickEventArgs>;
735
748
  /**
736
749
  * Event callback that is raised after shape changing action is performed in an image editor.
750
+ *
737
751
  * @remarks
738
752
  * 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.
739
753
  *
@@ -1119,10 +1133,11 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1119
1133
  * @param {boolean} italic - Specifies whether the text is italic or not.
1120
1134
  * @param {string} color - Specifies font color of the text.
1121
1135
  * @param {boolean} isSelected - Specifies to show the text in the selected state.
1136
+ * @param {number} degree - Specifies the degree to rotate the text.
1122
1137
  * @returns {boolean}.
1123
1138
  *
1124
1139
  */
1125
- drawText(x?: number, y?: number, text?: string, fontFamily?: string, fontSize?: number, bold?: boolean, italic?: boolean, color?: string, isSelected?: boolean): boolean;
1140
+ drawText(x?: number, y?: number, text?: string, fontFamily?: string, fontSize?: number, bold?: boolean, italic?: boolean, color?: string, isSelected?: boolean, degree?: number): boolean;
1126
1141
  /**
1127
1142
  * Draw an image as annotation on an image.
1128
1143
  *
@@ -1320,6 +1335,79 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1320
1335
  *
1321
1336
  */
1322
1337
  canRedo(): boolean;
1338
+ /**
1339
+ * Applies the operations performed in the Image Editor, such as annotation drawings.
1340
+ *
1341
+ * @returns{void}
1342
+ * @remarks
1343
+ * This method applies the actions performed after enabling annotation drawings, ensuring that the drawn annotations are applied to the image.
1344
+ */
1345
+ apply(): void;
1346
+ /**
1347
+ * Discards the operations performed in the Image Editor, such as annotation drawings.
1348
+ *
1349
+ * @returns{void}
1350
+ * @remarks
1351
+ * This method discards the actions performed after enabling annotation drawings, ensuring that the drawn annotations are not applied to the image.
1352
+ */
1353
+ discard(): void;
1354
+ /**
1355
+ * Enable or disable a shape drawing option in an Image Editor.
1356
+ *
1357
+ * @param {ShapeType} shapeType - Specifies the type of shape to be enabled or disabled for drawing.
1358
+ * @param {boolean} isEnabled - Optional. Specifies a value to indicate whether to enable or disable shape drawing. The default value is true.
1359
+ *
1360
+ * @remarks This function allows the user to toggle the shape drawing feature in the Image Editor. When enabled, users can draw shapes on the image. When disabled, the shape drawing functionality is not available.
1361
+ *
1362
+ * @returns {void}.
1363
+ */
1364
+ enableShapeDrawing(shapeType: ShapeType, isEnabled: boolean): void;
1365
+ /**
1366
+ * Moves a shape to the front of all other shapes based on the given shape id.
1367
+ * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1368
+ *
1369
+ * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1370
+ * @returns {void}.
1371
+ *
1372
+ */
1373
+ bringToFront(shapeId: string): void;
1374
+ /**
1375
+ * Moves a shape to ahead of one shape based on the given shape id.
1376
+ * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1377
+ *
1378
+ * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1379
+ * @returns {void}.
1380
+ *
1381
+ */
1382
+ bringForward(shapeId: string): void;
1383
+ /**
1384
+ * Moves a shape to behind all other shapes based on the given shape id.
1385
+ * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1386
+ *
1387
+ * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1388
+ * @returns {void}.
1389
+ *
1390
+ */
1391
+ sendToBack(shapeId: string): void;
1392
+ /**
1393
+ * Moves a shape to behind one shape based on the given shape id.
1394
+ * Use 'getShapeSettings' method to get the shape id which is then passed to perform moving.
1395
+ *
1396
+ * @param {string} shapeId - Specifies the shape id to move the shape on an image.
1397
+ * @returns {void}.
1398
+ *
1399
+ */
1400
+ sendBackward(shapeId: string): void;
1401
+ /**
1402
+ * Clears the loaded image in the Image Editor.
1403
+ *
1404
+ * @returns{void}
1405
+ * @remarks
1406
+ * This method clears the loaded image and updates the component's user interface to its initial state (the initial user interface without a loaded image).
1407
+ */
1408
+ clearImage(): void;
1409
+ private applyShapes;
1410
+ private closeOverlayTbar;
1323
1411
  private toolbarTemplateFn;
1324
1412
  private quickAccessToolbarTemplateFn;
1325
1413
  private templateParser;
@@ -1359,10 +1447,19 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1359
1447
  * Handles the OK button operation
1360
1448
  *
1361
1449
  * @param { boolean } isMouseDown - Specifies whether it is a mouse down.
1450
+ * @param { boolean } isFinalApply - Specifies whether it is a final apply.
1362
1451
  * @hidden
1363
1452
  * @returns {void}.
1364
1453
  */
1365
- okBtn(isMouseDown?: boolean): void;
1454
+ okBtn(isMouseDown?: boolean, isFinalApply?: boolean): void;
1455
+ /**
1456
+ * Handles the OK button operation
1457
+ *
1458
+ * @param { string } id - Specifies shape id to return.
1459
+ * @hidden
1460
+ * @returns {SelectionPoint | Object}.
1461
+ */
1462
+ getObjFromId(id: string): SelectionPoint | Object;
1366
1463
  /**
1367
1464
  * Set the temporary filter properties.
1368
1465
  *
@@ -1514,7 +1611,6 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1514
1611
  * Apply rotate image.
1515
1612
  *
1516
1613
  * @param { string } rotate - Specifies the direction of rotation.
1517
- * @param { boolean } isPreventURC - Specifies to update undo redo collection.
1518
1614
  * @hidden
1519
1615
  * @returns {void}.
1520
1616
  */
@@ -1553,10 +1649,11 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1553
1649
  /**
1554
1650
  * Performs Straightening action.
1555
1651
  *
1652
+ * @param { number } value - Specifies the degree of straightening.
1556
1653
  * @hidden
1557
- * @returns {void}.
1654
+ * @returns {void} .
1558
1655
  */
1559
- setStraighten(value: number, isMethod?: boolean): void;
1656
+ setStraighten(value: number): void;
1560
1657
  private duplicateImage;
1561
1658
  private performStraighten;
1562
1659
  /**
@@ -1569,10 +1666,22 @@ export declare class ImageEditor extends Component<HTMLDivElement> implements IN
1569
1666
  /**
1570
1667
  * Returns rotated canvas dimension.
1571
1668
  *
1669
+ * @param { number } width - Specifies the width of the canvas.
1670
+ * @param { number } height - Specifies the height of the canvas.
1671
+ * @param { number } angle - Specifies the angle of rotation in degrees.
1572
1672
  * @hidden
1573
- * @returns {void}.
1673
+ * @returns {void} .
1574
1674
  */
1575
1675
  getRotatedCanvasDim(width: number, height: number, angle: number): Dimension;
1676
+ /**
1677
+ * Apply Shape order.
1678
+ *
1679
+ * @param { string } id - Specifies the id of the shape to change the order.
1680
+ * @param { string } value - Specifies the order of the shapes.
1681
+ * @hidden
1682
+ * @returns {void}.
1683
+ */
1684
+ updateShapeOrder(id: string, value: string): void;
1576
1685
  private getStraightenFlipState;
1577
1686
  private initializeZoomSettings;
1578
1687
  private initializeThemeColl;