@aurigma/design-atoms-model 7.0.34 → 7.0.37
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/Collection.js +271 -514
- package/Collection.js.map +1 -1
- package/Colors/CmykColor.js +35 -69
- package/Colors/CmykColor.js.map +1 -1
- package/Colors/Color.js +11 -19
- package/Colors/Color.js.map +1 -1
- package/Colors/GrayscaleColor.js +23 -45
- package/Colors/GrayscaleColor.js.map +1 -1
- package/Colors/HsbColor.js +67 -85
- package/Colors/HsbColor.js.map +1 -1
- package/Colors/Ink.js +20 -35
- package/Colors/Ink.js.map +1 -1
- package/Colors/LabColor.js +29 -59
- package/Colors/LabColor.js.map +1 -1
- package/Colors/Palette.js +2 -21
- package/Colors/Palette.js.map +1 -1
- package/Colors/ProcessColor.js +24 -54
- package/Colors/ProcessColor.js.map +1 -1
- package/Colors/RgbColor.js +31 -61
- package/Colors/RgbColor.js.map +1 -1
- package/Colors/RgbColors.js +22 -54
- package/Colors/RgbColors.js.map +1 -1
- package/Colors/SpotColor.js +34 -68
- package/Colors/SpotColor.js.map +1 -1
- package/Colors/Swatch.js +16 -40
- package/Colors/Swatch.js.map +1 -1
- package/Colors/ValidationUtils.js +3 -5
- package/Colors/ValidationUtils.js.map +1 -1
- package/ColorsOld/CmykColor.js +54 -80
- package/ColorsOld/CmykColor.js.map +1 -1
- package/ColorsOld/Color.d.ts +1 -1
- package/ColorsOld/Color.js +25 -34
- package/ColorsOld/Color.js.map +1 -1
- package/ColorsOld/ColorFactory.js +30 -40
- package/ColorsOld/ColorFactory.js.map +1 -1
- package/ColorsOld/GrayscaleColor.js +29 -54
- package/ColorsOld/GrayscaleColor.js.map +1 -1
- package/ColorsOld/HsbColor.js +29 -35
- package/ColorsOld/HsbColor.js.map +1 -1
- package/ColorsOld/LabColor.js +35 -56
- package/ColorsOld/LabColor.js.map +1 -1
- package/ColorsOld/RgbColor.js +73 -114
- package/ColorsOld/RgbColor.js.map +1 -1
- package/ColorsOld/SpotColor.js +32 -53
- package/ColorsOld/SpotColor.js.map +1 -1
- package/ColorsOld/Utils.js +9 -13
- package/ColorsOld/Utils.js.map +1 -1
- package/Configuration/IRenderingConfig.js +1 -0
- package/Configuration/WatermarkConfig.js +17 -33
- package/Configuration/WatermarkConfig.js.map +1 -1
- package/Configuration/index.js +1 -0
- package/Configuration/index.js.map +1 -1
- package/Configuration.js +7 -11
- package/Configuration.js.map +1 -1
- package/EquatableKeyDictionary.js +43 -127
- package/EquatableKeyDictionary.js.map +1 -1
- package/EventObject.js +59 -136
- package/EventObject.js.map +1 -1
- package/Exception.d.ts +1 -1
- package/Exception.js +47 -88
- package/Exception.js.map +1 -1
- package/INotifyPropertyChanged.d.ts +1 -1
- package/INotifyPropertyChanged.js +1 -0
- package/Math/Array.js +3 -3
- package/Math/Array.js.map +1 -1
- package/Math/Common.js +13 -15
- package/Math/Common.js.map +1 -1
- package/Math/ILtrb.js +1 -0
- package/Math/IPoint.js +1 -0
- package/Math/ISize.js +1 -0
- package/Math/Margin.js +62 -99
- package/Math/Margin.js.map +1 -1
- package/Math/Matrix.js +63 -94
- package/Math/Matrix.js.map +1 -1
- package/Math/Path.d.ts +1 -1
- package/Math/Path.js +149 -234
- package/Math/Path.js.map +1 -1
- package/Math/PointF.js +31 -34
- package/Math/PointF.js.map +1 -1
- package/Math/RectangleF.js +119 -159
- package/Math/RectangleF.js.map +1 -1
- package/Math/RotatedRectangleF.js +132 -147
- package/Math/RotatedRectangleF.js.map +1 -1
- package/Math/SizeF.js +10 -12
- package/Math/SizeF.js.map +1 -1
- package/Math/Transform.js +50 -80
- package/Math/Transform.js.map +1 -1
- package/Math/index.js +3 -0
- package/Math/index.js.map +1 -1
- package/Product/Constraints/ContainerConstraints.js +11 -13
- package/Product/Constraints/ContainerConstraints.js.map +1 -1
- package/Product/Constraints/MaxArtworkSizeConstraints.d.ts +1 -1
- package/Product/Constraints/MaxArtworkSizeConstraints.js +10 -12
- package/Product/Constraints/MaxArtworkSizeConstraints.js.map +1 -1
- package/Product/Constraints/PrintingTechniqueConstraints.js +10 -13
- package/Product/Constraints/PrintingTechniqueConstraints.js.map +1 -1
- package/Product/Container.d.ts +10 -10
- package/Product/Container.js +253 -375
- package/Product/Container.js.map +1 -1
- package/Product/ContainerVisualization.d.ts +1 -0
- package/Product/ContainerVisualization.js +31 -56
- package/Product/ContainerVisualization.js.map +1 -1
- package/Product/Convert/CornerRadiusConverter.js +32 -34
- package/Product/Convert/CornerRadiusConverter.js.map +1 -1
- package/Product/CropMark.js +28 -40
- package/Product/CropMark.js.map +1 -1
- package/Product/Decorators/Factory/AbstractFactory.js +13 -23
- package/Product/Decorators/Factory/AbstractFactory.js.map +1 -1
- package/Product/Decorators/Factory/CollectionFactory.js +10 -45
- package/Product/Decorators/Factory/CollectionFactory.js.map +1 -1
- package/Product/Decorators/Factory/ColorFactory.js +13 -35
- package/Product/Decorators/Factory/ColorFactory.js.map +1 -1
- package/Product/Decorators/Factory/ObjectFactory.js +10 -45
- package/Product/Decorators/Factory/ObjectFactory.js.map +1 -1
- package/Product/Decorators/Factory/SimpleFactory.js +11 -21
- package/Product/Decorators/Factory/SimpleFactory.js.map +1 -1
- package/Product/Decorators/Interfaces/IInputPropertyMetadata.d.ts +1 -1
- package/Product/Decorators/Interfaces/IInputPropertyMetadata.js +1 -0
- package/Product/Decorators/Interfaces/IObjectMetadata.js +1 -0
- package/Product/Decorators/Interfaces/IPropertyMetadata.js +1 -0
- package/Product/Decorators/ItemsMetadata.js +11 -13
- package/Product/Decorators/ItemsMetadata.js.map +1 -1
- package/Product/Decorators/Property.js +4 -4
- package/Product/Decorators/Property.js.map +1 -1
- package/Product/Decorators/PropertyChanged.js +1 -1
- package/Product/Decorators/PropertyChanged.js.map +1 -1
- package/Product/Decorators/index.js +1 -0
- package/Product/Decorators/index.js.map +1 -1
- package/Product/Effects/ColorDictionaryEntry.js +3 -5
- package/Product/Effects/ColorDictionaryEntry.js.map +1 -1
- package/Product/Effects/NDEffectParameters.js +2 -6
- package/Product/Effects/NDEffectParameters.js.map +1 -1
- package/Product/Effects/NDEffects.d.ts +1 -0
- package/Product/Effects/NDEffects.js +20 -27
- package/Product/Effects/NDEffects.js.map +1 -1
- package/Product/Effects/RecolorEffectParameters.d.ts +1 -0
- package/Product/Effects/RecolorEffectParameters.js +44 -89
- package/Product/Effects/RecolorEffectParameters.js.map +1 -1
- package/Product/IGetAllItemsOptions.js +1 -0
- package/Product/InteractiveZone.js +34 -66
- package/Product/InteractiveZone.js.map +1 -1
- package/Product/Interfaces/IColorWithTitle.js +1 -0
- package/Product/Interfaces/IDataSet.js +1 -0
- package/Product/Interfaces/IFontSettings.js +1 -0
- package/Product/Interfaces/IItemData.js +1 -0
- package/Product/Interfaces/IPdfMetadata.js +1 -0
- package/Product/Interfaces/IProductThemeConfig.js +1 -0
- package/Product/Interfaces/IShadowSettings.js +1 -0
- package/Product/Interfaces/IStrokeSettings.js +1 -0
- package/Product/Interfaces/index.js +3 -0
- package/Product/Interfaces/index.js.map +1 -1
- package/Product/ItemMask.js +20 -26
- package/Product/ItemMask.js.map +1 -1
- package/Product/Items/ArchedTextItem.js +65 -100
- package/Product/Items/ArchedTextItem.js.map +1 -1
- package/Product/Items/AutoScaledTextItem.js +35 -62
- package/Product/Items/AutoScaledTextItem.js.map +1 -1
- package/Product/Items/BarcodeData.d.ts +1 -1
- package/Product/Items/BarcodeData.js +62 -91
- package/Product/Items/BarcodeData.js.map +1 -1
- package/Product/Items/BarcodeItem.js +249 -298
- package/Product/Items/BarcodeItem.js.map +1 -1
- package/Product/Items/BarcodePermissions.js +38 -52
- package/Product/Items/BarcodePermissions.js.map +1 -1
- package/Product/Items/BaseItem.js +30 -53
- package/Product/Items/BaseItem.js.map +1 -1
- package/Product/Items/BaseTextItem.d.ts +2 -2
- package/Product/Items/BaseTextItem.js +451 -625
- package/Product/Items/BaseTextItem.js.map +1 -1
- package/Product/Items/BoundedTextItem.js +184 -255
- package/Product/Items/BoundedTextItem.js.map +1 -1
- package/Product/Items/ClipartItem.js +82 -175
- package/Product/Items/ClipartItem.js.map +1 -1
- package/Product/Items/ContentItem.js +52 -80
- package/Product/Items/ContentItem.js.map +1 -1
- package/Product/Items/ContentPermissions.js +36 -47
- package/Product/Items/ContentPermissions.js.map +1 -1
- package/Product/Items/CurvedTextItem.js +106 -158
- package/Product/Items/CurvedTextItem.js.map +1 -1
- package/Product/Items/DashedLineItem.js +45 -76
- package/Product/Items/DashedLineItem.js.map +1 -1
- package/Product/Items/EllipseItem.js +11 -31
- package/Product/Items/EllipseItem.js.map +1 -1
- package/Product/Items/FrontEndPermissions.js +20 -26
- package/Product/Items/FrontEndPermissions.js.map +1 -1
- package/Product/Items/GridItem.js +107 -162
- package/Product/Items/GridItem.js.map +1 -1
- package/Product/Items/GroupItem.js +95 -172
- package/Product/Items/GroupItem.js.map +1 -1
- package/Product/Items/GroupItemPermissions.js +42 -56
- package/Product/Items/GroupItemPermissions.js.map +1 -1
- package/Product/Items/ImageItem.d.ts +9 -4
- package/Product/Items/ImageItem.js +319 -430
- package/Product/Items/ImageItem.js.map +1 -1
- package/Product/Items/ImageMetaData.js +14 -15
- package/Product/Items/ImageMetaData.js.map +1 -1
- package/Product/Items/ImagePermissions.js +42 -56
- package/Product/Items/ImagePermissions.js.map +1 -1
- package/Product/Items/ImageViolationSettings.js +18 -35
- package/Product/Items/ImageViolationSettings.js.map +1 -1
- package/Product/Items/InStringPlaceholder.d.ts +2 -1
- package/Product/Items/InStringPlaceholder.js +52 -101
- package/Product/Items/InStringPlaceholder.js.map +1 -1
- package/Product/Items/Item.d.ts +1 -1
- package/Product/Items/Item.js +278 -370
- package/Product/Items/Item.js.map +1 -1
- package/Product/Items/ItemPermissions.js +54 -73
- package/Product/Items/ItemPermissions.js.map +1 -1
- package/Product/Items/ItemToolbarPermissions.js +61 -80
- package/Product/Items/ItemToolbarPermissions.js.map +1 -1
- package/Product/Items/LayoutItem.js +241 -326
- package/Product/Items/LayoutItem.js.map +1 -1
- package/Product/Items/LineItem.js +109 -156
- package/Product/Items/LineItem.js.map +1 -1
- package/Product/Items/LinePermissions.js +29 -39
- package/Product/Items/LinePermissions.js.map +1 -1
- package/Product/Items/ManipulationPermissions.d.ts +1 -1
- package/Product/Items/ManipulationPermissions.js +94 -135
- package/Product/Items/ManipulationPermissions.js.map +1 -1
- package/Product/Items/OpenTypeFeature.d.ts +1 -1
- package/Product/Items/OpenTypeFeature.js +3 -5
- package/Product/Items/OpenTypeFeature.js.map +1 -1
- package/Product/Items/OverlayEffect.js +56 -70
- package/Product/Items/OverlayEffect.js.map +1 -1
- package/Product/Items/ParagraphSettings.js +9 -11
- package/Product/Items/ParagraphSettings.js.map +1 -1
- package/Product/Items/PathBoundedTextItem.js +116 -166
- package/Product/Items/PathBoundedTextItem.js.map +1 -1
- package/Product/Items/PathBoundedTextPermissions.js +20 -26
- package/Product/Items/PathBoundedTextPermissions.js.map +1 -1
- package/Product/Items/PlaceholderItem.d.ts +1 -1
- package/Product/Items/PlaceholderItem.js +310 -419
- package/Product/Items/PlaceholderItem.js.map +1 -1
- package/Product/Items/PlaceholderPermissions.js +38 -47
- package/Product/Items/PlaceholderPermissions.js.map +1 -1
- package/Product/Items/PlainTextItem.js +45 -74
- package/Product/Items/PlainTextItem.js.map +1 -1
- package/Product/Items/PolylineItem.js +51 -81
- package/Product/Items/PolylineItem.js.map +1 -1
- package/Product/Items/RectangleItem.js +10 -30
- package/Product/Items/RectangleItem.js.map +1 -1
- package/Product/Items/ResizeGripsPermissions.d.ts +5 -4
- package/Product/Items/ResizeGripsPermissions.js +75 -94
- package/Product/Items/ResizeGripsPermissions.js.map +1 -1
- package/Product/Items/ShadowSettings.js +51 -69
- package/Product/Items/ShadowSettings.js.map +1 -1
- package/Product/Items/ShapeItem.js +182 -250
- package/Product/Items/ShapeItem.js.map +1 -1
- package/Product/Items/ShapePermissions.js +38 -52
- package/Product/Items/ShapePermissions.js.map +1 -1
- package/Product/Items/ShapeViolationSettings.js +18 -36
- package/Product/Items/ShapeViolationSettings.js.map +1 -1
- package/Product/Items/Size.js +7 -11
- package/Product/Items/Size.js.map +1 -1
- package/Product/Items/SmartItem.js +21 -41
- package/Product/Items/SmartItem.js.map +1 -1
- package/Product/Items/StrokeSettings.js +48 -62
- package/Product/Items/StrokeSettings.js.map +1 -1
- package/Product/Items/TextEnums.d.ts +2 -1
- package/Product/Items/TextEnums.js +1 -0
- package/Product/Items/TextEnums.js.map +1 -1
- package/Product/Items/TextPermissions.js +56 -58
- package/Product/Items/TextPermissions.js.map +1 -1
- package/Product/Items/TextViolationSettings.js +23 -40
- package/Product/Items/TextViolationSettings.js.map +1 -1
- package/Product/Items/ThemeBinding.d.ts +2 -1
- package/Product/Items/ThemeBinding.js +13 -15
- package/Product/Items/ThemeBinding.js.map +1 -1
- package/Product/Items/ViolationSettings.js +26 -44
- package/Product/Items/ViolationSettings.js.map +1 -1
- package/Product/Items/VisualizationPermissions.js +29 -39
- package/Product/Items/VisualizationPermissions.js.map +1 -1
- package/Product/ItemsData/ItemData.js +8 -24
- package/Product/ItemsData/ItemData.js.map +1 -1
- package/Product/ModelComponent.js +41 -63
- package/Product/ModelComponent.js.map +1 -1
- package/Product/PrintArea.d.ts +1 -0
- package/Product/PrintArea.js +132 -178
- package/Product/PrintArea.js.map +1 -1
- package/Product/Product.js +67 -105
- package/Product/Product.js.map +1 -1
- package/Product/SafetyLine.d.ts +1 -1
- package/Product/SafetyLine.js +90 -124
- package/Product/SafetyLine.js.map +1 -1
- package/Product/Surface.d.ts +2 -1
- package/Product/Surface.js +193 -287
- package/Product/Surface.js.map +1 -1
- package/Product/SurfaceMockup.js +40 -73
- package/Product/SurfaceMockup.js.map +1 -1
- package/Product/Uuid.js +19 -25
- package/Product/Uuid.js.map +1 -1
- package/Product/Watermark.js +5 -9
- package/Product/Watermark.js.map +1 -1
- package/Product/index.js +1 -0
- package/Product/index.js.map +1 -1
- package/Serialization/IProductSerializer.js +1 -0
- package/Utils/Environment.d.ts +1 -1
- package/Utils/Environment.js +24 -44
- package/Utils/Environment.js.map +1 -1
- package/Utils/Exceptions.js +5 -5
- package/Utils/Exceptions.js.map +1 -1
- package/Utils/Items.js +19 -19
- package/Utils/Items.js.map +1 -1
- package/Utils/Types/Action.d.ts +5 -1
- package/Utils/Types/Action.js +1 -0
- package/Utils/Types/AnyFunction.d.ts +1 -1
- package/Utils/Types/AnyFunction.js +1 -0
- package/Utils/Types/Func.d.ts +1 -1
- package/Utils/Types/Func.js +1 -0
- package/Utils/Types/index.js +3 -0
- package/Utils/Types/index.js.map +1 -1
- package/Utils/Utils.d.ts +14 -5
- package/Utils/Utils.js +185 -298
- package/Utils/Utils.js.map +1 -1
- package/Utils/debounce.d.ts +29 -0
- package/Utils/debounce.js +106 -0
- package/Utils/debounce.js.map +1 -0
- package/Utils/index.d.ts +2 -0
- package/Utils/index.js +3 -0
- package/Utils/index.js.map +1 -1
- package/Utils/throttle.d.ts +16 -0
- package/Utils/throttle.js +25 -0
- package/Utils/throttle.js.map +1 -0
- package/Validators/CmykComponentValidator.js +13 -15
- package/Validators/CmykComponentValidator.js.map +1 -1
- package/Version.d.ts +1 -1
- package/Version.js +1 -1
- package/Version.js.map +1 -1
- package/package.json +3 -8
- package/typings/structured-clone.d.ts +5 -0
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
15
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -20,28 +7,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
21
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
22
9
|
};
|
|
23
|
-
var __values = (this && this.__values) || function(o) {
|
|
24
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
25
|
-
if (m) return m.call(o);
|
|
26
|
-
if (o && typeof o.length === "number") return {
|
|
27
|
-
next: function () {
|
|
28
|
-
if (o && i >= o.length) o = void 0;
|
|
29
|
-
return { value: o && o[i++], done: !o };
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
33
|
-
};
|
|
34
10
|
import { ContentItem } from "./ContentItem";
|
|
35
11
|
import { ImagePermissions } from "./ImagePermissions";
|
|
36
12
|
import { ResizeGripsPermissions } from "./ResizeGripsPermissions";
|
|
37
13
|
import { RectangleF } from "../../Math/RectangleF";
|
|
38
14
|
import { ArgumentException, NotImplementedException, Exception } from "../../Exception";
|
|
39
15
|
import { EventWithSenderArg } from "../../EventObject";
|
|
40
|
-
import * as _ from "underscore";
|
|
41
16
|
import { ImageEffect } from "./ImageEffect";
|
|
42
17
|
import { pixelsToPoints } from "../../Utils/Convert";
|
|
43
18
|
import { OverlayEffect } from "./OverlayEffect";
|
|
44
|
-
import { equals,
|
|
19
|
+
import { equals, isString } from "../../Utils/Utils";
|
|
45
20
|
import { Size } from "./Size";
|
|
46
21
|
import { Property } from "../Decorators/Property";
|
|
47
22
|
import { BlendMode } from "./BlendMode";
|
|
@@ -49,71 +24,69 @@ import { CmykColor } from "../../Colors";
|
|
|
49
24
|
import { ImageViolationSettings } from "./ImageViolationSettings";
|
|
50
25
|
import { CollectionPropertyFactory, ObjectPropertyFactory, SimplePropertyFactory } from "../Decorators/Factory";
|
|
51
26
|
import { NDEffects } from "../Effects/NDEffects";
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
27
|
+
import { arraysIsEqual } from "@aurigma/utils-js/algorithms/array";
|
|
28
|
+
export class ImageItem extends ContentItem {
|
|
29
|
+
constructor(sourceStorageId, location, width, height, ratioWidthToHeight) {
|
|
30
|
+
super();
|
|
31
|
+
this.ndEffects = new NDEffects();
|
|
32
|
+
this._effect = ImageEffect.None;
|
|
33
|
+
this._overlayEffect = null;
|
|
34
|
+
this.type = ImageItem.type;
|
|
35
|
+
this.mviKeepTemplateTransform = false;
|
|
36
|
+
this.values = [];
|
|
37
|
+
this.allowedSubfolder = null;
|
|
38
|
+
this.allowedTabs = null;
|
|
39
|
+
this.ratioWidthToHeight = null;
|
|
40
|
+
this.isUserImage = false;
|
|
41
|
+
this.unconvertedSource = null;
|
|
42
|
+
this._onSourcePropertyChanged = (sender, property) => {
|
|
68
43
|
switch (property) {
|
|
69
44
|
case "url":
|
|
70
45
|
case "id":
|
|
71
46
|
case "pageIndex":
|
|
72
|
-
|
|
47
|
+
this._propertyChanged.notify(this, "source");
|
|
73
48
|
break;
|
|
74
49
|
case "isVector":
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
this.applyPermissionsConstrain();
|
|
51
|
+
this._propertyChanged.notify(this, "source");
|
|
77
52
|
break;
|
|
78
53
|
default:
|
|
79
54
|
}
|
|
80
55
|
};
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
this._onOverlayEffectPropertyChanged = (s, p) => {
|
|
57
|
+
this._propertyChanged.notify(this, "overlayEffect");
|
|
83
58
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
59
|
+
this.imagePermissions = new ImagePermissions();
|
|
60
|
+
this._setViolationSettings(new ImageViolationSettings(), true);
|
|
61
|
+
this.manipulationPermissions.resizeGrips = new ResizeGripsPermissions(true, false);
|
|
62
|
+
this.shapePermissions.allowChangeFillColor = false;
|
|
63
|
+
this.imagePermissions.allowKeepOverlayColor = false;
|
|
64
|
+
this.itemPermissions.itemToolbarPermissions.showSelectButton = true;
|
|
90
65
|
if (sourceStorageId != null) {
|
|
91
|
-
|
|
66
|
+
this.source = new ImageItem.ImageSource(sourceStorageId);
|
|
92
67
|
}
|
|
93
68
|
else {
|
|
94
|
-
|
|
69
|
+
this.source = new ImageItem.ImageSource();
|
|
95
70
|
}
|
|
96
71
|
if (ratioWidthToHeight != null)
|
|
97
|
-
|
|
72
|
+
this.ratioWidthToHeight = ratioWidthToHeight;
|
|
98
73
|
if (width != null && height != null) {
|
|
99
|
-
|
|
74
|
+
this.sourceRectangle = new RectangleF(0, 0, width, height);
|
|
100
75
|
}
|
|
101
76
|
else {
|
|
102
77
|
if (width != null)
|
|
103
|
-
|
|
78
|
+
this.SetWidth(width);
|
|
104
79
|
if (height != null)
|
|
105
|
-
|
|
80
|
+
this.SetHeight(height);
|
|
106
81
|
}
|
|
107
82
|
if (location != null) {
|
|
108
|
-
|
|
109
|
-
|
|
83
|
+
this.sourceRectangle.left = location.x;
|
|
84
|
+
this.sourceRectangle.top = location.y;
|
|
110
85
|
}
|
|
111
|
-
return _this;
|
|
112
86
|
}
|
|
113
|
-
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
_super.prototype._copy.call(this, source, destination, generateNewIds, appropriateParentContainer);
|
|
87
|
+
_copy(source, destination, generateNewIds, appropriateParentContainer) {
|
|
88
|
+
var _a;
|
|
89
|
+
super._copy(source, destination, generateNewIds, appropriateParentContainer);
|
|
117
90
|
destination.imagePermissions = source._imagePermissions != null ? source._imagePermissions.clone() : null;
|
|
118
91
|
destination.effect = source._effect;
|
|
119
92
|
destination.overlayEffect = source.overlayEffect != null ? source.overlayEffect.clone() : null;
|
|
@@ -122,88 +95,66 @@ var ImageItem = /** @class */ (function (_super) {
|
|
|
122
95
|
destination.mviKeepTemplateTransform = source.mviKeepTemplateTransform;
|
|
123
96
|
if (source.values != null) {
|
|
124
97
|
destination.values = [];
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
var i = _d.value;
|
|
128
|
-
destination.values.push(i.clone());
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
132
|
-
finally {
|
|
133
|
-
try {
|
|
134
|
-
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
135
|
-
}
|
|
136
|
-
finally { if (e_1) throw e_1.error; }
|
|
137
|
-
}
|
|
98
|
+
for (var i of source.values)
|
|
99
|
+
destination.values.push(i.clone());
|
|
138
100
|
}
|
|
139
|
-
destination.originalImageSource = (
|
|
101
|
+
destination.originalImageSource = (_a = source.originalImageSource) === null || _a === void 0 ? void 0 : _a.clone();
|
|
140
102
|
destination.ndEffects = source.ndEffects.clone();
|
|
141
103
|
destination.allowedSubfolder = source.allowedSubfolder;
|
|
142
|
-
destination.allowedTabs =
|
|
104
|
+
destination.allowedTabs = structuredClone(source.allowedTabs);
|
|
143
105
|
destination.ratioWidthToHeight = source.ratioWidthToHeight;
|
|
144
106
|
destination.isUserImage = source.isUserImage;
|
|
145
107
|
destination.displayName = source.displayName;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return
|
|
108
|
+
}
|
|
109
|
+
equals(other) {
|
|
110
|
+
return super.equals(other) &&
|
|
149
111
|
equals(this._imagePermissions, other._imagePermissions) &&
|
|
150
112
|
equals(this._effect, other._effect) &&
|
|
151
113
|
equals(this.unconvertedSource, other.unconvertedSource) &&
|
|
152
114
|
equals(this._source, other._source) &&
|
|
153
115
|
equals(this.mviKeepTemplateTransform, other.mviKeepTemplateTransform) &&
|
|
154
116
|
equals(this.overlayEffect, other.overlayEffect) &&
|
|
155
|
-
|
|
117
|
+
arraysIsEqual(this.values, other.values, equals) &&
|
|
156
118
|
equals(this.allowedSubfolder, other.allowedSubfolder) &&
|
|
157
|
-
|
|
119
|
+
arraysIsEqual(this.allowedTabs, other.allowedTabs) &&
|
|
158
120
|
equals(this.ratioWidthToHeight, other.ratioWidthToHeight) &&
|
|
159
121
|
equals(this.isUserImage, other.isUserImage) &&
|
|
160
122
|
equals(this.originalImageSource, other.originalImageSource) &&
|
|
161
123
|
equals(this.ndEffects, other.ndEffects);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (appropriateParentContainer === void 0) { appropriateParentContainer = false; }
|
|
166
|
-
var item = new ImageItem();
|
|
124
|
+
}
|
|
125
|
+
clone(generateNewIds = false, appropriateParentContainer = false) {
|
|
126
|
+
const item = new ImageItem();
|
|
167
127
|
this._copy(this, item, generateNewIds, appropriateParentContainer);
|
|
168
128
|
return item;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
set: function (value) {
|
|
194
|
-
this._setViolationSettings(value);
|
|
195
|
-
},
|
|
196
|
-
enumerable: true,
|
|
197
|
-
configurable: true
|
|
198
|
-
});
|
|
199
|
-
ImageItem.prototype._setViolationSettings = function (value, skipTypeCheck) {
|
|
200
|
-
if (skipTypeCheck === void 0) { skipTypeCheck = false; }
|
|
129
|
+
}
|
|
130
|
+
get imagePermissions() {
|
|
131
|
+
return this._imagePermissions;
|
|
132
|
+
}
|
|
133
|
+
set imagePermissions(value) {
|
|
134
|
+
if (value == null)
|
|
135
|
+
throw new ArgumentException("imagePermissions cannot be null");
|
|
136
|
+
if (equals(this._imagePermissions, value))
|
|
137
|
+
return;
|
|
138
|
+
if (this._imagePermissions != null)
|
|
139
|
+
this._imagePermissions.propertyChanged.remove(this._onPermissionsChanged);
|
|
140
|
+
this._imagePermissions = value;
|
|
141
|
+
this.applyPermissionsConstrain();
|
|
142
|
+
this._imagePermissions.propertyChanged.add(this._onPermissionsChanged);
|
|
143
|
+
this._propertyChanged.notify(this, "imagePermissions");
|
|
144
|
+
}
|
|
145
|
+
get violationSettings() {
|
|
146
|
+
return this._violationSettings;
|
|
147
|
+
}
|
|
148
|
+
set violationSettings(value) {
|
|
149
|
+
this._setViolationSettings(value);
|
|
150
|
+
}
|
|
151
|
+
_setViolationSettings(value, skipTypeCheck = false) {
|
|
201
152
|
if (!skipTypeCheck && !(value instanceof ImageViolationSettings))
|
|
202
153
|
throw new ArgumentException("Shape ViolationSettings property must has ImageViolationSettings type!");
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
154
|
+
super._setViolationSettings(value, skipTypeCheck);
|
|
155
|
+
}
|
|
156
|
+
applyPermissionsConstrain() {
|
|
157
|
+
super.applyPermissionsConstrain();
|
|
207
158
|
if (this.imagePermissions != null && !this.imagePermissions.allowEditImage)
|
|
208
159
|
this.itemPermissions.itemToolbarPermissions.showEditButtonConstraint = false;
|
|
209
160
|
else if (this.source != null && this.source.isVector)
|
|
@@ -214,197 +165,176 @@ var ImageItem = /** @class */ (function (_super) {
|
|
|
214
165
|
this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint = false;
|
|
215
166
|
else
|
|
216
167
|
this.itemPermissions.itemToolbarPermissions.showSelectButtonConstraint = null;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
});
|
|
265
|
-
Object.defineProperty(ImageItem.prototype, "overlayEffect", {
|
|
266
|
-
get: function () {
|
|
267
|
-
return this._overlayEffect;
|
|
268
|
-
},
|
|
269
|
-
set: function (value) {
|
|
270
|
-
if (OverlayEffect.equals(this.overlayEffect, value))
|
|
271
|
-
return;
|
|
272
|
-
this._unsubscribeOverlayEffectPropertyChanged();
|
|
273
|
-
this._overlayEffect = value;
|
|
274
|
-
this._subscribeOverlayEffectPropertyChanged();
|
|
275
|
-
this._propertyChanged.notify(this, "overlayEffect");
|
|
276
|
-
},
|
|
277
|
-
enumerable: true,
|
|
278
|
-
configurable: true
|
|
279
|
-
});
|
|
280
|
-
ImageItem.prototype._subscribeOverlayEffectPropertyChanged = function () {
|
|
168
|
+
}
|
|
169
|
+
get displayName() {
|
|
170
|
+
if (this._displayName == null && this.values != null && this.values.length > 0) {
|
|
171
|
+
const selectedValue = this.values.find((imageItemValue) => imageItemValue.value.id === this.source.id);
|
|
172
|
+
if (selectedValue != null)
|
|
173
|
+
this.displayName = selectedValue.name;
|
|
174
|
+
}
|
|
175
|
+
return this._displayName;
|
|
176
|
+
}
|
|
177
|
+
set displayName(value) {
|
|
178
|
+
if (value != this._displayName)
|
|
179
|
+
this._displayName = value;
|
|
180
|
+
}
|
|
181
|
+
get source() {
|
|
182
|
+
return this._source;
|
|
183
|
+
}
|
|
184
|
+
set source(value) {
|
|
185
|
+
if (this._source === value || this._source != null && this._source.equals(value))
|
|
186
|
+
return;
|
|
187
|
+
if (this._source != null)
|
|
188
|
+
this._source.removePropertyChanged(this._onSourcePropertyChanged);
|
|
189
|
+
this._source = value;
|
|
190
|
+
if (this._source != null)
|
|
191
|
+
this._source.addPropertyChanged(this._onSourcePropertyChanged);
|
|
192
|
+
this._propertyChanged.notify(this, "source");
|
|
193
|
+
}
|
|
194
|
+
get effect() {
|
|
195
|
+
return this._effect;
|
|
196
|
+
}
|
|
197
|
+
set effect(value) {
|
|
198
|
+
if (this._effect !== value) {
|
|
199
|
+
this._effect = value;
|
|
200
|
+
this._propertyChanged.notify(this, "effect");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
get overlayEffect() {
|
|
204
|
+
return this._overlayEffect;
|
|
205
|
+
}
|
|
206
|
+
set overlayEffect(value) {
|
|
207
|
+
if (OverlayEffect.equals(this.overlayEffect, value))
|
|
208
|
+
return;
|
|
209
|
+
this._unsubscribeOverlayEffectPropertyChanged();
|
|
210
|
+
this._overlayEffect = value;
|
|
211
|
+
this._subscribeOverlayEffectPropertyChanged();
|
|
212
|
+
this._propertyChanged.notify(this, "overlayEffect");
|
|
213
|
+
}
|
|
214
|
+
_subscribeOverlayEffectPropertyChanged() {
|
|
281
215
|
if (this.overlayEffect != null)
|
|
282
216
|
this.overlayEffect.addPropertyChanged(this._onOverlayEffectPropertyChanged);
|
|
283
|
-
}
|
|
284
|
-
|
|
217
|
+
}
|
|
218
|
+
_unsubscribeOverlayEffectPropertyChanged() {
|
|
285
219
|
if (this.overlayEffect != null)
|
|
286
220
|
this.overlayEffect.removePropertyChanged(this._onOverlayEffectPropertyChanged);
|
|
287
|
-
}
|
|
288
|
-
|
|
221
|
+
}
|
|
222
|
+
SetWidth(value, calculateHeight) {
|
|
289
223
|
this.sourceRectangle.width = value;
|
|
290
224
|
if (calculateHeight != null)
|
|
291
225
|
calculateHeight = true;
|
|
292
226
|
if (this.source.id != null && calculateHeight)
|
|
293
227
|
this.sourceRectangle.height = this._calculateHeight(value);
|
|
294
|
-
}
|
|
295
|
-
|
|
228
|
+
}
|
|
229
|
+
SetHeight(value, calculateWidth) {
|
|
296
230
|
this.sourceRectangle.height = value;
|
|
297
231
|
if (calculateWidth != null)
|
|
298
232
|
calculateWidth = true;
|
|
299
233
|
if (this.source.id != null && calculateWidth)
|
|
300
234
|
this.sourceRectangle.width = this._calculateWidth(value);
|
|
301
|
-
}
|
|
302
|
-
|
|
235
|
+
}
|
|
236
|
+
getSource() {
|
|
303
237
|
throw new NotImplementedException();
|
|
304
|
-
}
|
|
305
|
-
|
|
238
|
+
}
|
|
239
|
+
_calculateHeight(width) {
|
|
306
240
|
if (this.ratioWidthToHeight == null)
|
|
307
241
|
throw new Exception("Field ratioWidthToHeight is not set!");
|
|
308
242
|
return width / this.ratioWidthToHeight;
|
|
309
|
-
}
|
|
310
|
-
|
|
243
|
+
}
|
|
244
|
+
_calculateWidth(height) {
|
|
311
245
|
if (this.ratioWidthToHeight == null)
|
|
312
246
|
throw new Exception("Field ratioWidthToHeight is not set!");
|
|
313
247
|
return height * this.ratioWidthToHeight;
|
|
314
|
-
}
|
|
315
|
-
|
|
248
|
+
}
|
|
249
|
+
getSimplifiedObject(omitProperties) {
|
|
316
250
|
var _a, _b;
|
|
317
|
-
if (!
|
|
251
|
+
if (!Array.isArray(omitProperties) && !isString(omitProperties))
|
|
318
252
|
omitProperties = [];
|
|
319
|
-
|
|
253
|
+
const simplified = super.getSimplifiedObject(["imagePermissions"].concat(omitProperties));
|
|
320
254
|
simplified["source"] = this.source.toJSON();
|
|
321
255
|
simplified["originalImageSource"] = (_a = this.originalImageSource) === null || _a === void 0 ? void 0 : _a.toJSON();
|
|
322
256
|
simplified["unconvertedSource"] = (_b = this.unconvertedSource) === null || _b === void 0 ? void 0 : _b.toJSON();
|
|
323
257
|
simplified["ndEffects"] = this.ndEffects.toJSON();
|
|
324
258
|
simplified["imagePermissions"] = this.imagePermissions.getSimplifiedObject();
|
|
325
259
|
return simplified;
|
|
326
|
-
}
|
|
327
|
-
|
|
260
|
+
}
|
|
261
|
+
getOriginalImageSize() {
|
|
328
262
|
return {
|
|
329
263
|
width: pixelsToPoints(this.source.width, this.source.dpiX || 72),
|
|
330
264
|
height: pixelsToPoints(this.source.height, this.source.dpiY || 72)
|
|
331
265
|
};
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
displayName: "Overlay effect"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
ImageItem.type = "ImageItem";
|
|
269
|
+
__decorate([
|
|
270
|
+
Property({ factory: new SimplePropertyFactory("subfolder"), displayName: "Allowed subfolder" }),
|
|
271
|
+
__metadata("design:type", String)
|
|
272
|
+
], ImageItem.prototype, "allowedSubfolder", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
Property({ factory: new CollectionPropertyFactory(Array), displayName: "Allowed tabs", }),
|
|
275
|
+
__metadata("design:type", Array)
|
|
276
|
+
], ImageItem.prototype, "allowedTabs", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
Property({ factory: new SimplePropertyFactory("Image"), displayName: "Display name" }),
|
|
279
|
+
__metadata("design:type", Object),
|
|
280
|
+
__metadata("design:paramtypes", [Object])
|
|
281
|
+
], ImageItem.prototype, "displayName", null);
|
|
282
|
+
__decorate([
|
|
283
|
+
Property({ ignore: true }),
|
|
284
|
+
__metadata("design:type", ImageItem.ImageSource)
|
|
285
|
+
], ImageItem.prototype, "unconvertedSource", void 0);
|
|
286
|
+
__decorate([
|
|
287
|
+
Property({ enumObject: ImageEffect }),
|
|
288
|
+
__metadata("design:type", Number),
|
|
289
|
+
__metadata("design:paramtypes", [Number])
|
|
290
|
+
], ImageItem.prototype, "effect", null);
|
|
291
|
+
__decorate([
|
|
292
|
+
Property({
|
|
293
|
+
factory: new ObjectPropertyFactory(OverlayEffect, {
|
|
294
|
+
color: new CmykColor(0, 0, 0, 0, 255),
|
|
295
|
+
opacity: 1,
|
|
296
|
+
blendMode: BlendMode.Normal
|
|
364
297
|
}),
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
export { ImageItem };
|
|
298
|
+
displayName: "Overlay effect"
|
|
299
|
+
}),
|
|
300
|
+
__metadata("design:type", OverlayEffect),
|
|
301
|
+
__metadata("design:paramtypes", [OverlayEffect])
|
|
302
|
+
], ImageItem.prototype, "overlayEffect", null);
|
|
371
303
|
(function (ImageItem) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
304
|
+
class ImageMetaData {
|
|
305
|
+
constructor(rawData) {
|
|
306
|
+
Object.assign(this, rawData);
|
|
375
307
|
}
|
|
376
|
-
|
|
308
|
+
clone() {
|
|
377
309
|
return new ImageMetaData(this);
|
|
378
|
-
}
|
|
379
|
-
|
|
310
|
+
}
|
|
311
|
+
equals(other) {
|
|
380
312
|
return other != null &&
|
|
381
313
|
equals(this.id, other.id) &&
|
|
382
314
|
equals(this.width, other.width) &&
|
|
383
315
|
equals(this.height, other.height) &&
|
|
384
316
|
equals(this.isVector, other.isVector);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
}());
|
|
317
|
+
}
|
|
318
|
+
}
|
|
388
319
|
ImageItem.ImageMetaData = ImageMetaData;
|
|
389
|
-
|
|
390
|
-
|
|
320
|
+
class ImageItemValue {
|
|
321
|
+
constructor(name, value, transformedRectangle) {
|
|
391
322
|
this.name = name;
|
|
392
323
|
this.value = value;
|
|
393
324
|
this.transformedRectangle = transformedRectangle;
|
|
394
325
|
}
|
|
395
|
-
|
|
326
|
+
clone() {
|
|
396
327
|
return new ImageItemValue(this.name, this.value.clone(), this.transformedRectangle.clone());
|
|
397
|
-
}
|
|
398
|
-
|
|
328
|
+
}
|
|
329
|
+
equals(other) {
|
|
399
330
|
return other != null &&
|
|
400
331
|
equals(this.name, other.name) &&
|
|
401
332
|
equals(this.value, other.value) &&
|
|
402
333
|
equals(this.transformedRectangle, other.transformedRectangle);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
}());
|
|
334
|
+
}
|
|
335
|
+
}
|
|
406
336
|
ImageItem.ImageItemValue = ImageItemValue;
|
|
407
|
-
|
|
337
|
+
let ImageSourceType;
|
|
408
338
|
(function (ImageSourceType) {
|
|
409
339
|
ImageSourceType[ImageSourceType["None"] = 0] = "None";
|
|
410
340
|
ImageSourceType[ImageSourceType["File"] = 1] = "File";
|
|
@@ -413,15 +343,13 @@ export { ImageItem };
|
|
|
413
343
|
ImageSourceType[ImageSourceType["PublicImage"] = 5] = "PublicImage";
|
|
414
344
|
ImageSourceType[ImageSourceType["UserImage"] = 6] = "UserImage";
|
|
415
345
|
})(ImageSourceType = ImageItem.ImageSourceType || (ImageItem.ImageSourceType = {}));
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (sourcePageIndex === void 0) { sourcePageIndex = 0; }
|
|
419
|
-
if (actualSize === void 0) { actualSize = false; }
|
|
420
|
-
if (saveAspectRatio === void 0) { saveAspectRatio = true; }
|
|
346
|
+
class ImageSource {
|
|
347
|
+
constructor(storageId, url, sourcePageIndex = 0, actualSize = false, saveAspectRatio = true, origin) {
|
|
421
348
|
this._storageId = null;
|
|
422
349
|
this._url = null;
|
|
423
350
|
this._type = ImageSourceType.None;
|
|
424
351
|
this._isVector = false;
|
|
352
|
+
this._containsOnlyVectorElements = false;
|
|
425
353
|
this._pageIndex = 0;
|
|
426
354
|
this._origin = null;
|
|
427
355
|
this._actualSize = false;
|
|
@@ -441,14 +369,15 @@ export { ImageItem };
|
|
|
441
369
|
this._saveAspectRatio = saveAspectRatio;
|
|
442
370
|
}
|
|
443
371
|
}
|
|
444
|
-
|
|
445
|
-
|
|
372
|
+
clone() {
|
|
373
|
+
const clonedItem = new ImageSource();
|
|
446
374
|
clonedItem.id = this.id;
|
|
447
375
|
clonedItem.url = this.url;
|
|
448
376
|
clonedItem._type = this._type;
|
|
449
377
|
clonedItem._width = this._width;
|
|
450
378
|
clonedItem._height = this._height;
|
|
451
379
|
clonedItem._isVector = this._isVector;
|
|
380
|
+
clonedItem._containsOnlyVectorElements = this._containsOnlyVectorElements;
|
|
452
381
|
clonedItem._pageIndex = this._pageIndex;
|
|
453
382
|
clonedItem._origin = this._origin != null ? this._origin.clone() : null;
|
|
454
383
|
clonedItem._actualSize = this._actualSize;
|
|
@@ -456,8 +385,8 @@ export { ImageItem };
|
|
|
456
385
|
clonedItem._dpiX = this._dpiX;
|
|
457
386
|
clonedItem._dpiY = this._dpiY;
|
|
458
387
|
return clonedItem;
|
|
459
|
-
}
|
|
460
|
-
|
|
388
|
+
}
|
|
389
|
+
equals(other) {
|
|
461
390
|
return equals(this.id, other.id) &&
|
|
462
391
|
equals(this.url, other.url) &&
|
|
463
392
|
equals(this._type, other._type) &&
|
|
@@ -469,191 +398,151 @@ export { ImageItem };
|
|
|
469
398
|
JSON.stringify(other._origin) === JSON.stringify(this._origin) &&
|
|
470
399
|
other._actualSize === this._actualSize &&
|
|
471
400
|
other._saveAspectRatio === this._saveAspectRatio;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
enumerable: true,
|
|
484
|
-
configurable: true
|
|
485
|
-
});
|
|
486
|
-
ImageSource.prototype.setIdWithOrigin = function (id, origin) {
|
|
401
|
+
}
|
|
402
|
+
get id() {
|
|
403
|
+
return this._storageId;
|
|
404
|
+
}
|
|
405
|
+
set id(value) {
|
|
406
|
+
if (this._storageId === value)
|
|
407
|
+
return;
|
|
408
|
+
this._storageId = value;
|
|
409
|
+
this._propertyChanged.notify(this, "id");
|
|
410
|
+
}
|
|
411
|
+
setIdWithOrigin(id, origin) {
|
|
487
412
|
this.id = id;
|
|
488
413
|
this._setOrigin(origin);
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
return
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
return;
|
|
549
|
-
this._pageIndex = value;
|
|
550
|
-
this._propertyChanged.notify(this, "pageIndex");
|
|
551
|
-
},
|
|
552
|
-
enumerable: true,
|
|
553
|
-
configurable: true
|
|
554
|
-
});
|
|
555
|
-
Object.defineProperty(ImageSource.prototype, "origin", {
|
|
556
|
-
get: function () {
|
|
557
|
-
return this._origin;
|
|
558
|
-
},
|
|
559
|
-
enumerable: true,
|
|
560
|
-
configurable: true
|
|
561
|
-
});
|
|
562
|
-
ImageSource.prototype._setOrigin = function (value) {
|
|
414
|
+
}
|
|
415
|
+
get url() {
|
|
416
|
+
return this._url;
|
|
417
|
+
}
|
|
418
|
+
set url(value) {
|
|
419
|
+
if (this._url === value)
|
|
420
|
+
return;
|
|
421
|
+
this._url = value;
|
|
422
|
+
this._propertyChanged.notify(this, "url");
|
|
423
|
+
}
|
|
424
|
+
get width() {
|
|
425
|
+
return this._width;
|
|
426
|
+
}
|
|
427
|
+
set width(value) {
|
|
428
|
+
if (this._width === value)
|
|
429
|
+
return;
|
|
430
|
+
this._width = value;
|
|
431
|
+
this._propertyChanged.notify(this, "width");
|
|
432
|
+
}
|
|
433
|
+
get height() {
|
|
434
|
+
return this._height;
|
|
435
|
+
}
|
|
436
|
+
set height(value) {
|
|
437
|
+
if (this._height === value)
|
|
438
|
+
return;
|
|
439
|
+
this._height = value;
|
|
440
|
+
this._propertyChanged.notify(this, "height");
|
|
441
|
+
}
|
|
442
|
+
get isVector() {
|
|
443
|
+
return this._isVector;
|
|
444
|
+
}
|
|
445
|
+
set isVector(value) {
|
|
446
|
+
if (this._isVector === value)
|
|
447
|
+
return;
|
|
448
|
+
this._isVector = value;
|
|
449
|
+
this._propertyChanged.notify(this, "isVector");
|
|
450
|
+
}
|
|
451
|
+
get containsOnlyVectorElements() {
|
|
452
|
+
return this._containsOnlyVectorElements;
|
|
453
|
+
}
|
|
454
|
+
set containsOnlyVectorElements(value) {
|
|
455
|
+
if (this._containsOnlyVectorElements === value)
|
|
456
|
+
return;
|
|
457
|
+
this._containsOnlyVectorElements = value;
|
|
458
|
+
this._propertyChanged.notify(this, "containsOnlyVectorElements");
|
|
459
|
+
}
|
|
460
|
+
get pageIndex() {
|
|
461
|
+
return this._pageIndex;
|
|
462
|
+
}
|
|
463
|
+
set pageIndex(value) {
|
|
464
|
+
if (value === this._pageIndex)
|
|
465
|
+
return;
|
|
466
|
+
this._pageIndex = value;
|
|
467
|
+
this._propertyChanged.notify(this, "pageIndex");
|
|
468
|
+
}
|
|
469
|
+
get origin() {
|
|
470
|
+
return this._origin;
|
|
471
|
+
}
|
|
472
|
+
_setOrigin(value) {
|
|
563
473
|
if (value === this._origin)
|
|
564
474
|
return;
|
|
565
475
|
this._origin = value;
|
|
566
476
|
this._propertyChanged.notify(this, "origin");
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
},
|
|
599
|
-
set: function (dpi) {
|
|
600
|
-
if (dpi > 0)
|
|
601
|
-
this._dpiX = dpi;
|
|
602
|
-
},
|
|
603
|
-
enumerable: true,
|
|
604
|
-
configurable: true
|
|
605
|
-
});
|
|
606
|
-
Object.defineProperty(ImageSource.prototype, "dpiY", {
|
|
607
|
-
get: function () {
|
|
608
|
-
return this._dpiY;
|
|
609
|
-
},
|
|
610
|
-
set: function (dpi) {
|
|
611
|
-
if (dpi > 0)
|
|
612
|
-
this._dpiY = dpi;
|
|
613
|
-
},
|
|
614
|
-
enumerable: true,
|
|
615
|
-
configurable: true
|
|
616
|
-
});
|
|
617
|
-
ImageSource.prototype.addPropertyChanged = function (listener) {
|
|
477
|
+
}
|
|
478
|
+
get type() {
|
|
479
|
+
return this._type;
|
|
480
|
+
}
|
|
481
|
+
get actualSize() {
|
|
482
|
+
return this._actualSize;
|
|
483
|
+
}
|
|
484
|
+
set actualSize(value) {
|
|
485
|
+
this._actualSize = value;
|
|
486
|
+
}
|
|
487
|
+
get saveAspectRatio() {
|
|
488
|
+
return this._saveAspectRatio;
|
|
489
|
+
}
|
|
490
|
+
set saveAspectRatio(value) {
|
|
491
|
+
this._saveAspectRatio = value;
|
|
492
|
+
}
|
|
493
|
+
get dpiX() {
|
|
494
|
+
return this._dpiX;
|
|
495
|
+
}
|
|
496
|
+
set dpiX(dpi) {
|
|
497
|
+
if (dpi > 0)
|
|
498
|
+
this._dpiX = dpi;
|
|
499
|
+
}
|
|
500
|
+
get dpiY() {
|
|
501
|
+
return this._dpiY;
|
|
502
|
+
}
|
|
503
|
+
set dpiY(dpi) {
|
|
504
|
+
if (dpi > 0)
|
|
505
|
+
this._dpiY = dpi;
|
|
506
|
+
}
|
|
507
|
+
addPropertyChanged(listener) {
|
|
618
508
|
this._propertyChanged.add(listener);
|
|
619
|
-
}
|
|
620
|
-
|
|
509
|
+
}
|
|
510
|
+
removePropertyChanged(listener) {
|
|
621
511
|
this._propertyChanged.remove(listener);
|
|
622
|
-
}
|
|
623
|
-
|
|
512
|
+
}
|
|
513
|
+
toJSON() {
|
|
624
514
|
return {
|
|
625
515
|
"id": this.id,
|
|
626
516
|
"width": this.width,
|
|
627
517
|
"height": this.height,
|
|
628
518
|
"isVector": this.isVector,
|
|
519
|
+
"containsOnlyVectorElements": this.containsOnlyVectorElements,
|
|
629
520
|
"pageIndex": this.pageIndex,
|
|
630
521
|
"url": this.url,
|
|
631
522
|
"actualSize": this.actualSize,
|
|
632
523
|
"saveAspectRatio": this.saveAspectRatio,
|
|
633
524
|
"origin": this.origin
|
|
634
525
|
};
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
}());
|
|
526
|
+
}
|
|
527
|
+
}
|
|
638
528
|
ImageItem.ImageSource = ImageSource;
|
|
639
529
|
(function (ImageSource) {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
530
|
+
class Origin {
|
|
531
|
+
constructor(rawData) {
|
|
532
|
+
Object.assign(this, rawData || {});
|
|
643
533
|
if (rawData != null && rawData["originalSize"] != null)
|
|
644
534
|
this.originalSize = new Size(rawData["originalSize"]["width"], rawData["originalSize"]["height"]);
|
|
645
535
|
}
|
|
646
|
-
|
|
536
|
+
equals(other) {
|
|
647
537
|
return other == null &&
|
|
648
538
|
equals(this.type, other.type) &&
|
|
649
539
|
equals(this.data, other.data) &&
|
|
650
540
|
equals(this.originalSize, other.originalSize);
|
|
651
|
-
}
|
|
652
|
-
|
|
541
|
+
}
|
|
542
|
+
clone() {
|
|
653
543
|
return new Origin(this);
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
}());
|
|
544
|
+
}
|
|
545
|
+
}
|
|
657
546
|
ImageSource.Origin = Origin;
|
|
658
547
|
})(ImageSource = ImageItem.ImageSource || (ImageItem.ImageSource = {}));
|
|
659
548
|
})(ImageItem || (ImageItem = {}));
|