@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.
Files changed (330) hide show
  1. package/Collection.js +271 -514
  2. package/Collection.js.map +1 -1
  3. package/Colors/CmykColor.js +35 -69
  4. package/Colors/CmykColor.js.map +1 -1
  5. package/Colors/Color.js +11 -19
  6. package/Colors/Color.js.map +1 -1
  7. package/Colors/GrayscaleColor.js +23 -45
  8. package/Colors/GrayscaleColor.js.map +1 -1
  9. package/Colors/HsbColor.js +67 -85
  10. package/Colors/HsbColor.js.map +1 -1
  11. package/Colors/Ink.js +20 -35
  12. package/Colors/Ink.js.map +1 -1
  13. package/Colors/LabColor.js +29 -59
  14. package/Colors/LabColor.js.map +1 -1
  15. package/Colors/Palette.js +2 -21
  16. package/Colors/Palette.js.map +1 -1
  17. package/Colors/ProcessColor.js +24 -54
  18. package/Colors/ProcessColor.js.map +1 -1
  19. package/Colors/RgbColor.js +31 -61
  20. package/Colors/RgbColor.js.map +1 -1
  21. package/Colors/RgbColors.js +22 -54
  22. package/Colors/RgbColors.js.map +1 -1
  23. package/Colors/SpotColor.js +34 -68
  24. package/Colors/SpotColor.js.map +1 -1
  25. package/Colors/Swatch.js +16 -40
  26. package/Colors/Swatch.js.map +1 -1
  27. package/Colors/ValidationUtils.js +3 -5
  28. package/Colors/ValidationUtils.js.map +1 -1
  29. package/ColorsOld/CmykColor.js +54 -80
  30. package/ColorsOld/CmykColor.js.map +1 -1
  31. package/ColorsOld/Color.d.ts +1 -1
  32. package/ColorsOld/Color.js +25 -34
  33. package/ColorsOld/Color.js.map +1 -1
  34. package/ColorsOld/ColorFactory.js +30 -40
  35. package/ColorsOld/ColorFactory.js.map +1 -1
  36. package/ColorsOld/GrayscaleColor.js +29 -54
  37. package/ColorsOld/GrayscaleColor.js.map +1 -1
  38. package/ColorsOld/HsbColor.js +29 -35
  39. package/ColorsOld/HsbColor.js.map +1 -1
  40. package/ColorsOld/LabColor.js +35 -56
  41. package/ColorsOld/LabColor.js.map +1 -1
  42. package/ColorsOld/RgbColor.js +73 -114
  43. package/ColorsOld/RgbColor.js.map +1 -1
  44. package/ColorsOld/SpotColor.js +32 -53
  45. package/ColorsOld/SpotColor.js.map +1 -1
  46. package/ColorsOld/Utils.js +9 -13
  47. package/ColorsOld/Utils.js.map +1 -1
  48. package/Configuration/IRenderingConfig.js +1 -0
  49. package/Configuration/WatermarkConfig.js +17 -33
  50. package/Configuration/WatermarkConfig.js.map +1 -1
  51. package/Configuration/index.js +1 -0
  52. package/Configuration/index.js.map +1 -1
  53. package/Configuration.js +7 -11
  54. package/Configuration.js.map +1 -1
  55. package/EquatableKeyDictionary.js +43 -127
  56. package/EquatableKeyDictionary.js.map +1 -1
  57. package/EventObject.js +59 -136
  58. package/EventObject.js.map +1 -1
  59. package/Exception.d.ts +1 -1
  60. package/Exception.js +47 -88
  61. package/Exception.js.map +1 -1
  62. package/INotifyPropertyChanged.d.ts +1 -1
  63. package/INotifyPropertyChanged.js +1 -0
  64. package/Math/Array.js +3 -3
  65. package/Math/Array.js.map +1 -1
  66. package/Math/Common.js +13 -15
  67. package/Math/Common.js.map +1 -1
  68. package/Math/ILtrb.js +1 -0
  69. package/Math/IPoint.js +1 -0
  70. package/Math/ISize.js +1 -0
  71. package/Math/Margin.js +62 -99
  72. package/Math/Margin.js.map +1 -1
  73. package/Math/Matrix.js +63 -94
  74. package/Math/Matrix.js.map +1 -1
  75. package/Math/Path.d.ts +1 -1
  76. package/Math/Path.js +149 -234
  77. package/Math/Path.js.map +1 -1
  78. package/Math/PointF.js +31 -34
  79. package/Math/PointF.js.map +1 -1
  80. package/Math/RectangleF.js +119 -159
  81. package/Math/RectangleF.js.map +1 -1
  82. package/Math/RotatedRectangleF.js +132 -147
  83. package/Math/RotatedRectangleF.js.map +1 -1
  84. package/Math/SizeF.js +10 -12
  85. package/Math/SizeF.js.map +1 -1
  86. package/Math/Transform.js +50 -80
  87. package/Math/Transform.js.map +1 -1
  88. package/Math/index.js +3 -0
  89. package/Math/index.js.map +1 -1
  90. package/Product/Constraints/ContainerConstraints.js +11 -13
  91. package/Product/Constraints/ContainerConstraints.js.map +1 -1
  92. package/Product/Constraints/MaxArtworkSizeConstraints.d.ts +1 -1
  93. package/Product/Constraints/MaxArtworkSizeConstraints.js +10 -12
  94. package/Product/Constraints/MaxArtworkSizeConstraints.js.map +1 -1
  95. package/Product/Constraints/PrintingTechniqueConstraints.js +10 -13
  96. package/Product/Constraints/PrintingTechniqueConstraints.js.map +1 -1
  97. package/Product/Container.d.ts +10 -10
  98. package/Product/Container.js +253 -375
  99. package/Product/Container.js.map +1 -1
  100. package/Product/ContainerVisualization.d.ts +1 -0
  101. package/Product/ContainerVisualization.js +31 -56
  102. package/Product/ContainerVisualization.js.map +1 -1
  103. package/Product/Convert/CornerRadiusConverter.js +32 -34
  104. package/Product/Convert/CornerRadiusConverter.js.map +1 -1
  105. package/Product/CropMark.js +28 -40
  106. package/Product/CropMark.js.map +1 -1
  107. package/Product/Decorators/Factory/AbstractFactory.js +13 -23
  108. package/Product/Decorators/Factory/AbstractFactory.js.map +1 -1
  109. package/Product/Decorators/Factory/CollectionFactory.js +10 -45
  110. package/Product/Decorators/Factory/CollectionFactory.js.map +1 -1
  111. package/Product/Decorators/Factory/ColorFactory.js +13 -35
  112. package/Product/Decorators/Factory/ColorFactory.js.map +1 -1
  113. package/Product/Decorators/Factory/ObjectFactory.js +10 -45
  114. package/Product/Decorators/Factory/ObjectFactory.js.map +1 -1
  115. package/Product/Decorators/Factory/SimpleFactory.js +11 -21
  116. package/Product/Decorators/Factory/SimpleFactory.js.map +1 -1
  117. package/Product/Decorators/Interfaces/IInputPropertyMetadata.d.ts +1 -1
  118. package/Product/Decorators/Interfaces/IInputPropertyMetadata.js +1 -0
  119. package/Product/Decorators/Interfaces/IObjectMetadata.js +1 -0
  120. package/Product/Decorators/Interfaces/IPropertyMetadata.js +1 -0
  121. package/Product/Decorators/ItemsMetadata.js +11 -13
  122. package/Product/Decorators/ItemsMetadata.js.map +1 -1
  123. package/Product/Decorators/Property.js +4 -4
  124. package/Product/Decorators/Property.js.map +1 -1
  125. package/Product/Decorators/PropertyChanged.js +1 -1
  126. package/Product/Decorators/PropertyChanged.js.map +1 -1
  127. package/Product/Decorators/index.js +1 -0
  128. package/Product/Decorators/index.js.map +1 -1
  129. package/Product/Effects/ColorDictionaryEntry.js +3 -5
  130. package/Product/Effects/ColorDictionaryEntry.js.map +1 -1
  131. package/Product/Effects/NDEffectParameters.js +2 -6
  132. package/Product/Effects/NDEffectParameters.js.map +1 -1
  133. package/Product/Effects/NDEffects.d.ts +1 -0
  134. package/Product/Effects/NDEffects.js +20 -27
  135. package/Product/Effects/NDEffects.js.map +1 -1
  136. package/Product/Effects/RecolorEffectParameters.d.ts +1 -0
  137. package/Product/Effects/RecolorEffectParameters.js +44 -89
  138. package/Product/Effects/RecolorEffectParameters.js.map +1 -1
  139. package/Product/IGetAllItemsOptions.js +1 -0
  140. package/Product/InteractiveZone.js +34 -66
  141. package/Product/InteractiveZone.js.map +1 -1
  142. package/Product/Interfaces/IColorWithTitle.js +1 -0
  143. package/Product/Interfaces/IDataSet.js +1 -0
  144. package/Product/Interfaces/IFontSettings.js +1 -0
  145. package/Product/Interfaces/IItemData.js +1 -0
  146. package/Product/Interfaces/IPdfMetadata.js +1 -0
  147. package/Product/Interfaces/IProductThemeConfig.js +1 -0
  148. package/Product/Interfaces/IShadowSettings.js +1 -0
  149. package/Product/Interfaces/IStrokeSettings.js +1 -0
  150. package/Product/Interfaces/index.js +3 -0
  151. package/Product/Interfaces/index.js.map +1 -1
  152. package/Product/ItemMask.js +20 -26
  153. package/Product/ItemMask.js.map +1 -1
  154. package/Product/Items/ArchedTextItem.js +65 -100
  155. package/Product/Items/ArchedTextItem.js.map +1 -1
  156. package/Product/Items/AutoScaledTextItem.js +35 -62
  157. package/Product/Items/AutoScaledTextItem.js.map +1 -1
  158. package/Product/Items/BarcodeData.d.ts +1 -1
  159. package/Product/Items/BarcodeData.js +62 -91
  160. package/Product/Items/BarcodeData.js.map +1 -1
  161. package/Product/Items/BarcodeItem.js +249 -298
  162. package/Product/Items/BarcodeItem.js.map +1 -1
  163. package/Product/Items/BarcodePermissions.js +38 -52
  164. package/Product/Items/BarcodePermissions.js.map +1 -1
  165. package/Product/Items/BaseItem.js +30 -53
  166. package/Product/Items/BaseItem.js.map +1 -1
  167. package/Product/Items/BaseTextItem.d.ts +2 -2
  168. package/Product/Items/BaseTextItem.js +451 -625
  169. package/Product/Items/BaseTextItem.js.map +1 -1
  170. package/Product/Items/BoundedTextItem.js +184 -255
  171. package/Product/Items/BoundedTextItem.js.map +1 -1
  172. package/Product/Items/ClipartItem.js +82 -175
  173. package/Product/Items/ClipartItem.js.map +1 -1
  174. package/Product/Items/ContentItem.js +52 -80
  175. package/Product/Items/ContentItem.js.map +1 -1
  176. package/Product/Items/ContentPermissions.js +36 -47
  177. package/Product/Items/ContentPermissions.js.map +1 -1
  178. package/Product/Items/CurvedTextItem.js +106 -158
  179. package/Product/Items/CurvedTextItem.js.map +1 -1
  180. package/Product/Items/DashedLineItem.js +45 -76
  181. package/Product/Items/DashedLineItem.js.map +1 -1
  182. package/Product/Items/EllipseItem.js +11 -31
  183. package/Product/Items/EllipseItem.js.map +1 -1
  184. package/Product/Items/FrontEndPermissions.js +20 -26
  185. package/Product/Items/FrontEndPermissions.js.map +1 -1
  186. package/Product/Items/GridItem.js +107 -162
  187. package/Product/Items/GridItem.js.map +1 -1
  188. package/Product/Items/GroupItem.js +95 -172
  189. package/Product/Items/GroupItem.js.map +1 -1
  190. package/Product/Items/GroupItemPermissions.js +42 -56
  191. package/Product/Items/GroupItemPermissions.js.map +1 -1
  192. package/Product/Items/ImageItem.d.ts +9 -4
  193. package/Product/Items/ImageItem.js +319 -430
  194. package/Product/Items/ImageItem.js.map +1 -1
  195. package/Product/Items/ImageMetaData.js +14 -15
  196. package/Product/Items/ImageMetaData.js.map +1 -1
  197. package/Product/Items/ImagePermissions.js +42 -56
  198. package/Product/Items/ImagePermissions.js.map +1 -1
  199. package/Product/Items/ImageViolationSettings.js +18 -35
  200. package/Product/Items/ImageViolationSettings.js.map +1 -1
  201. package/Product/Items/InStringPlaceholder.d.ts +2 -1
  202. package/Product/Items/InStringPlaceholder.js +52 -101
  203. package/Product/Items/InStringPlaceholder.js.map +1 -1
  204. package/Product/Items/Item.d.ts +1 -1
  205. package/Product/Items/Item.js +278 -370
  206. package/Product/Items/Item.js.map +1 -1
  207. package/Product/Items/ItemPermissions.js +54 -73
  208. package/Product/Items/ItemPermissions.js.map +1 -1
  209. package/Product/Items/ItemToolbarPermissions.js +61 -80
  210. package/Product/Items/ItemToolbarPermissions.js.map +1 -1
  211. package/Product/Items/LayoutItem.js +241 -326
  212. package/Product/Items/LayoutItem.js.map +1 -1
  213. package/Product/Items/LineItem.js +109 -156
  214. package/Product/Items/LineItem.js.map +1 -1
  215. package/Product/Items/LinePermissions.js +29 -39
  216. package/Product/Items/LinePermissions.js.map +1 -1
  217. package/Product/Items/ManipulationPermissions.d.ts +1 -1
  218. package/Product/Items/ManipulationPermissions.js +94 -135
  219. package/Product/Items/ManipulationPermissions.js.map +1 -1
  220. package/Product/Items/OpenTypeFeature.d.ts +1 -1
  221. package/Product/Items/OpenTypeFeature.js +3 -5
  222. package/Product/Items/OpenTypeFeature.js.map +1 -1
  223. package/Product/Items/OverlayEffect.js +56 -70
  224. package/Product/Items/OverlayEffect.js.map +1 -1
  225. package/Product/Items/ParagraphSettings.js +9 -11
  226. package/Product/Items/ParagraphSettings.js.map +1 -1
  227. package/Product/Items/PathBoundedTextItem.js +116 -166
  228. package/Product/Items/PathBoundedTextItem.js.map +1 -1
  229. package/Product/Items/PathBoundedTextPermissions.js +20 -26
  230. package/Product/Items/PathBoundedTextPermissions.js.map +1 -1
  231. package/Product/Items/PlaceholderItem.d.ts +1 -1
  232. package/Product/Items/PlaceholderItem.js +310 -419
  233. package/Product/Items/PlaceholderItem.js.map +1 -1
  234. package/Product/Items/PlaceholderPermissions.js +38 -47
  235. package/Product/Items/PlaceholderPermissions.js.map +1 -1
  236. package/Product/Items/PlainTextItem.js +45 -74
  237. package/Product/Items/PlainTextItem.js.map +1 -1
  238. package/Product/Items/PolylineItem.js +51 -81
  239. package/Product/Items/PolylineItem.js.map +1 -1
  240. package/Product/Items/RectangleItem.js +10 -30
  241. package/Product/Items/RectangleItem.js.map +1 -1
  242. package/Product/Items/ResizeGripsPermissions.d.ts +5 -4
  243. package/Product/Items/ResizeGripsPermissions.js +75 -94
  244. package/Product/Items/ResizeGripsPermissions.js.map +1 -1
  245. package/Product/Items/ShadowSettings.js +51 -69
  246. package/Product/Items/ShadowSettings.js.map +1 -1
  247. package/Product/Items/ShapeItem.js +182 -250
  248. package/Product/Items/ShapeItem.js.map +1 -1
  249. package/Product/Items/ShapePermissions.js +38 -52
  250. package/Product/Items/ShapePermissions.js.map +1 -1
  251. package/Product/Items/ShapeViolationSettings.js +18 -36
  252. package/Product/Items/ShapeViolationSettings.js.map +1 -1
  253. package/Product/Items/Size.js +7 -11
  254. package/Product/Items/Size.js.map +1 -1
  255. package/Product/Items/SmartItem.js +21 -41
  256. package/Product/Items/SmartItem.js.map +1 -1
  257. package/Product/Items/StrokeSettings.js +48 -62
  258. package/Product/Items/StrokeSettings.js.map +1 -1
  259. package/Product/Items/TextEnums.d.ts +2 -1
  260. package/Product/Items/TextEnums.js +1 -0
  261. package/Product/Items/TextEnums.js.map +1 -1
  262. package/Product/Items/TextPermissions.js +56 -58
  263. package/Product/Items/TextPermissions.js.map +1 -1
  264. package/Product/Items/TextViolationSettings.js +23 -40
  265. package/Product/Items/TextViolationSettings.js.map +1 -1
  266. package/Product/Items/ThemeBinding.d.ts +2 -1
  267. package/Product/Items/ThemeBinding.js +13 -15
  268. package/Product/Items/ThemeBinding.js.map +1 -1
  269. package/Product/Items/ViolationSettings.js +26 -44
  270. package/Product/Items/ViolationSettings.js.map +1 -1
  271. package/Product/Items/VisualizationPermissions.js +29 -39
  272. package/Product/Items/VisualizationPermissions.js.map +1 -1
  273. package/Product/ItemsData/ItemData.js +8 -24
  274. package/Product/ItemsData/ItemData.js.map +1 -1
  275. package/Product/ModelComponent.js +41 -63
  276. package/Product/ModelComponent.js.map +1 -1
  277. package/Product/PrintArea.d.ts +1 -0
  278. package/Product/PrintArea.js +132 -178
  279. package/Product/PrintArea.js.map +1 -1
  280. package/Product/Product.js +67 -105
  281. package/Product/Product.js.map +1 -1
  282. package/Product/SafetyLine.d.ts +1 -1
  283. package/Product/SafetyLine.js +90 -124
  284. package/Product/SafetyLine.js.map +1 -1
  285. package/Product/Surface.d.ts +2 -1
  286. package/Product/Surface.js +193 -287
  287. package/Product/Surface.js.map +1 -1
  288. package/Product/SurfaceMockup.js +40 -73
  289. package/Product/SurfaceMockup.js.map +1 -1
  290. package/Product/Uuid.js +19 -25
  291. package/Product/Uuid.js.map +1 -1
  292. package/Product/Watermark.js +5 -9
  293. package/Product/Watermark.js.map +1 -1
  294. package/Product/index.js +1 -0
  295. package/Product/index.js.map +1 -1
  296. package/Serialization/IProductSerializer.js +1 -0
  297. package/Utils/Environment.d.ts +1 -1
  298. package/Utils/Environment.js +24 -44
  299. package/Utils/Environment.js.map +1 -1
  300. package/Utils/Exceptions.js +5 -5
  301. package/Utils/Exceptions.js.map +1 -1
  302. package/Utils/Items.js +19 -19
  303. package/Utils/Items.js.map +1 -1
  304. package/Utils/Types/Action.d.ts +5 -1
  305. package/Utils/Types/Action.js +1 -0
  306. package/Utils/Types/AnyFunction.d.ts +1 -1
  307. package/Utils/Types/AnyFunction.js +1 -0
  308. package/Utils/Types/Func.d.ts +1 -1
  309. package/Utils/Types/Func.js +1 -0
  310. package/Utils/Types/index.js +3 -0
  311. package/Utils/Types/index.js.map +1 -1
  312. package/Utils/Utils.d.ts +14 -5
  313. package/Utils/Utils.js +185 -298
  314. package/Utils/Utils.js.map +1 -1
  315. package/Utils/debounce.d.ts +29 -0
  316. package/Utils/debounce.js +106 -0
  317. package/Utils/debounce.js.map +1 -0
  318. package/Utils/index.d.ts +2 -0
  319. package/Utils/index.js +3 -0
  320. package/Utils/index.js.map +1 -1
  321. package/Utils/throttle.d.ts +16 -0
  322. package/Utils/throttle.js +25 -0
  323. package/Utils/throttle.js.map +1 -0
  324. package/Validators/CmykComponentValidator.js +13 -15
  325. package/Validators/CmykComponentValidator.js.map +1 -1
  326. package/Version.d.ts +1 -1
  327. package/Version.js +1 -1
  328. package/Version.js.map +1 -1
  329. package/package.json +3 -8
  330. 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, arrayEquals } from "../../Utils/Utils";
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
- var ImageItem = /** @class */ (function (_super) {
53
- __extends(ImageItem, _super);
54
- function ImageItem(sourceStorageId, location, width, height, ratioWidthToHeight) {
55
- var _this = _super.call(this) || this;
56
- _this.ndEffects = new NDEffects();
57
- _this._effect = ImageEffect.None;
58
- _this._overlayEffect = null;
59
- _this.type = ImageItem.type;
60
- _this.mviKeepTemplateTransform = false;
61
- _this.values = [];
62
- _this.allowedSubfolder = null;
63
- _this.allowedTabs = null;
64
- _this.ratioWidthToHeight = null;
65
- _this.isUserImage = false;
66
- _this.unconvertedSource = null;
67
- _this._onSourcePropertyChanged = function (sender, property) {
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
- _this._propertyChanged.notify(_this, "source");
47
+ this._propertyChanged.notify(this, "source");
73
48
  break;
74
49
  case "isVector":
75
- _this.applyPermissionsConstrain();
76
- _this._propertyChanged.notify(_this, "source");
50
+ this.applyPermissionsConstrain();
51
+ this._propertyChanged.notify(this, "source");
77
52
  break;
78
53
  default:
79
54
  }
80
55
  };
81
- _this._onOverlayEffectPropertyChanged = function (s, p) {
82
- _this._propertyChanged.notify(_this, "overlayEffect");
56
+ this._onOverlayEffectPropertyChanged = (s, p) => {
57
+ this._propertyChanged.notify(this, "overlayEffect");
83
58
  };
84
- _this.imagePermissions = new ImagePermissions();
85
- _this._setViolationSettings(new ImageViolationSettings(), true);
86
- _this.manipulationPermissions.resizeGrips = new ResizeGripsPermissions(true, false);
87
- _this.shapePermissions.allowChangeFillColor = false;
88
- _this.imagePermissions.allowKeepOverlayColor = false;
89
- _this.itemPermissions.itemToolbarPermissions.showSelectButton = true;
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
- _this.source = new ImageItem.ImageSource(sourceStorageId);
66
+ this.source = new ImageItem.ImageSource(sourceStorageId);
92
67
  }
93
68
  else {
94
- _this.source = new ImageItem.ImageSource();
69
+ this.source = new ImageItem.ImageSource();
95
70
  }
96
71
  if (ratioWidthToHeight != null)
97
- _this.ratioWidthToHeight = ratioWidthToHeight;
72
+ this.ratioWidthToHeight = ratioWidthToHeight;
98
73
  if (width != null && height != null) {
99
- _this.sourceRectangle = new RectangleF(0, 0, width, height);
74
+ this.sourceRectangle = new RectangleF(0, 0, width, height);
100
75
  }
101
76
  else {
102
77
  if (width != null)
103
- _this.SetWidth(width);
78
+ this.SetWidth(width);
104
79
  if (height != null)
105
- _this.SetHeight(height);
80
+ this.SetHeight(height);
106
81
  }
107
82
  if (location != null) {
108
- _this.sourceRectangle.left = location.x;
109
- _this.sourceRectangle.top = location.y;
83
+ this.sourceRectangle.left = location.x;
84
+ this.sourceRectangle.top = location.y;
110
85
  }
111
- return _this;
112
86
  }
113
- ImageItem.prototype._copy = function (source, destination, generateNewIds, appropriateParentContainer) {
114
- var e_1, _a;
115
- var _b;
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
- try {
126
- for (var _c = __values(source.values), _d = _c.next(); !_d.done; _d = _c.next()) {
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 = (_b = source.originalImageSource) === null || _b === void 0 ? void 0 : _b.clone();
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 = _.clone(source.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
- ImageItem.prototype.equals = function (other) {
148
- return _super.prototype.equals.call(this, other) &&
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
- arrayEquals(this.values, other.values) &&
117
+ arraysIsEqual(this.values, other.values, equals) &&
156
118
  equals(this.allowedSubfolder, other.allowedSubfolder) &&
157
- arrayEquals(this.allowedTabs, other.allowedTabs) &&
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
- ImageItem.prototype.clone = function (generateNewIds, appropriateParentContainer) {
164
- if (generateNewIds === void 0) { generateNewIds = false; }
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
- Object.defineProperty(ImageItem.prototype, "imagePermissions", {
171
- get: function () {
172
- return this._imagePermissions;
173
- },
174
- set: function (value) {
175
- if (value == null)
176
- throw new ArgumentException("imagePermissions cannot be null");
177
- if (equals(this._imagePermissions, value))
178
- return;
179
- if (this._imagePermissions != null)
180
- this._imagePermissions.propertyChanged.remove(this._onPermissionsChanged);
181
- this._imagePermissions = value;
182
- this.applyPermissionsConstrain();
183
- this._imagePermissions.propertyChanged.add(this._onPermissionsChanged);
184
- this._propertyChanged.notify(this, "imagePermissions");
185
- },
186
- enumerable: true,
187
- configurable: true
188
- });
189
- Object.defineProperty(ImageItem.prototype, "violationSettings", {
190
- get: function () {
191
- return this._violationSettings;
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
- _super.prototype._setViolationSettings.call(this, value, skipTypeCheck);
204
- };
205
- ImageItem.prototype.applyPermissionsConstrain = function () {
206
- _super.prototype.applyPermissionsConstrain.call(this);
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
- Object.defineProperty(ImageItem.prototype, "displayName", {
219
- get: function () {
220
- var _this = this;
221
- if (this._displayName == null && this.values != null && this.values.length > 0) {
222
- var selectedValue = this.values.find(function (imageItemValue) { return imageItemValue.value.id === _this.source.id; });
223
- if (selectedValue != null)
224
- this.displayName = selectedValue.name;
225
- }
226
- return this._displayName;
227
- },
228
- set: function (value) {
229
- if (value != this._displayName)
230
- this._displayName = value;
231
- },
232
- enumerable: true,
233
- configurable: true
234
- });
235
- Object.defineProperty(ImageItem.prototype, "source", {
236
- get: function () {
237
- return this._source;
238
- },
239
- set: function (value) {
240
- if (this._source === value || this._source != null && this._source.equals(value))
241
- return;
242
- if (this._source != null)
243
- this._source.removePropertyChanged(this._onSourcePropertyChanged);
244
- this._source = value;
245
- if (this._source != null)
246
- this._source.addPropertyChanged(this._onSourcePropertyChanged);
247
- this._propertyChanged.notify(this, "source");
248
- },
249
- enumerable: true,
250
- configurable: true
251
- });
252
- Object.defineProperty(ImageItem.prototype, "effect", {
253
- get: function () {
254
- return this._effect;
255
- },
256
- set: function (value) {
257
- if (this._effect !== value) {
258
- this._effect = value;
259
- this._propertyChanged.notify(this, "effect");
260
- }
261
- },
262
- enumerable: true,
263
- configurable: true
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
- ImageItem.prototype._unsubscribeOverlayEffectPropertyChanged = function () {
217
+ }
218
+ _unsubscribeOverlayEffectPropertyChanged() {
285
219
  if (this.overlayEffect != null)
286
220
  this.overlayEffect.removePropertyChanged(this._onOverlayEffectPropertyChanged);
287
- };
288
- ImageItem.prototype.SetWidth = function (value, calculateHeight) {
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
- ImageItem.prototype.SetHeight = function (value, calculateWidth) {
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
- ImageItem.prototype.getSource = function () {
235
+ }
236
+ getSource() {
303
237
  throw new NotImplementedException();
304
- };
305
- ImageItem.prototype._calculateHeight = function (width) {
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
- ImageItem.prototype._calculateWidth = function (height) {
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
- ImageItem.prototype.getSimplifiedObject = function (omitProperties) {
248
+ }
249
+ getSimplifiedObject(omitProperties) {
316
250
  var _a, _b;
317
- if (!_.isArray(omitProperties) && !_.isString(omitProperties))
251
+ if (!Array.isArray(omitProperties) && !isString(omitProperties))
318
252
  omitProperties = [];
319
- var simplified = _super.prototype.getSimplifiedObject.call(this, ["imagePermissions"].concat(omitProperties));
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
- ImageItem.prototype.getOriginalImageSize = function () {
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
- ImageItem.type = "ImageItem";
334
- __decorate([
335
- Property({ factory: new SimplePropertyFactory("subfolder"), displayName: "Allowed subfolder" }),
336
- __metadata("design:type", String)
337
- ], ImageItem.prototype, "allowedSubfolder", void 0);
338
- __decorate([
339
- Property({ factory: new CollectionPropertyFactory(Array), displayName: "Allowed tabs", }),
340
- __metadata("design:type", Array)
341
- ], ImageItem.prototype, "allowedTabs", void 0);
342
- __decorate([
343
- Property({ factory: new SimplePropertyFactory("Image"), displayName: "Display name" }),
344
- __metadata("design:type", Object),
345
- __metadata("design:paramtypes", [Object])
346
- ], ImageItem.prototype, "displayName", null);
347
- __decorate([
348
- Property({ ignore: true }),
349
- __metadata("design:type", ImageItem.ImageSource)
350
- ], ImageItem.prototype, "unconvertedSource", void 0);
351
- __decorate([
352
- Property({ enumObject: ImageEffect }),
353
- __metadata("design:type", Number),
354
- __metadata("design:paramtypes", [Number])
355
- ], ImageItem.prototype, "effect", null);
356
- __decorate([
357
- Property({
358
- factory: new ObjectPropertyFactory(OverlayEffect, {
359
- color: new CmykColor(0, 0, 0, 0, 255),
360
- opacity: 1,
361
- blendMode: BlendMode.Normal
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
- __metadata("design:type", OverlayEffect),
366
- __metadata("design:paramtypes", [OverlayEffect])
367
- ], ImageItem.prototype, "overlayEffect", null);
368
- return ImageItem;
369
- }(ContentItem));
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
- var ImageMetaData = /** @class */ (function () {
373
- function ImageMetaData(rawData) {
374
- _.extend(this, rawData);
304
+ class ImageMetaData {
305
+ constructor(rawData) {
306
+ Object.assign(this, rawData);
375
307
  }
376
- ImageMetaData.prototype.clone = function () {
308
+ clone() {
377
309
  return new ImageMetaData(this);
378
- };
379
- ImageMetaData.prototype.equals = function (other) {
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
- return ImageMetaData;
387
- }());
317
+ }
318
+ }
388
319
  ImageItem.ImageMetaData = ImageMetaData;
389
- var ImageItemValue = /** @class */ (function () {
390
- function ImageItemValue(name, value, transformedRectangle) {
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
- ImageItemValue.prototype.clone = function () {
326
+ clone() {
396
327
  return new ImageItemValue(this.name, this.value.clone(), this.transformedRectangle.clone());
397
- };
398
- ImageItemValue.prototype.equals = function (other) {
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
- return ImageItemValue;
405
- }());
334
+ }
335
+ }
406
336
  ImageItem.ImageItemValue = ImageItemValue;
407
- var ImageSourceType;
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
- var ImageSource = /** @class */ (function () {
417
- function ImageSource(storageId, url, sourcePageIndex, actualSize, saveAspectRatio, origin) {
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
- ImageSource.prototype.clone = function () {
445
- var clonedItem = new ImageSource();
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
- ImageSource.prototype.equals = function (other) {
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
- Object.defineProperty(ImageSource.prototype, "id", {
474
- get: function () {
475
- return this._storageId;
476
- },
477
- set: function (value) {
478
- if (this._storageId === value)
479
- return;
480
- this._storageId = value;
481
- this._propertyChanged.notify(this, "id");
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
- Object.defineProperty(ImageSource.prototype, "url", {
491
- get: function () {
492
- return this._url;
493
- },
494
- set: function (value) {
495
- if (this._url === value)
496
- return;
497
- this._url = value;
498
- this._propertyChanged.notify(this, "url");
499
- },
500
- enumerable: true,
501
- configurable: true
502
- });
503
- Object.defineProperty(ImageSource.prototype, "width", {
504
- get: function () {
505
- return this._width;
506
- },
507
- set: function (value) {
508
- if (this._width === value)
509
- return;
510
- this._width = value;
511
- this._propertyChanged.notify(this, "width");
512
- },
513
- enumerable: true,
514
- configurable: true
515
- });
516
- Object.defineProperty(ImageSource.prototype, "height", {
517
- get: function () {
518
- return this._height;
519
- },
520
- set: function (value) {
521
- if (this._height === value)
522
- return;
523
- this._height = value;
524
- this._propertyChanged.notify(this, "height");
525
- },
526
- enumerable: true,
527
- configurable: true
528
- });
529
- Object.defineProperty(ImageSource.prototype, "isVector", {
530
- get: function () {
531
- return this._isVector;
532
- },
533
- set: function (value) {
534
- if (this._isVector === value)
535
- return;
536
- this._isVector = value;
537
- this._propertyChanged.notify(this, "isVector");
538
- },
539
- enumerable: true,
540
- configurable: true
541
- });
542
- Object.defineProperty(ImageSource.prototype, "pageIndex", {
543
- get: function () {
544
- return this._pageIndex;
545
- },
546
- set: function (value) {
547
- if (value === this._pageIndex)
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
- Object.defineProperty(ImageSource.prototype, "type", {
569
- get: function () {
570
- return this._type;
571
- },
572
- enumerable: true,
573
- configurable: true
574
- });
575
- Object.defineProperty(ImageSource.prototype, "actualSize", {
576
- get: function () {
577
- return this._actualSize;
578
- },
579
- set: function (value) {
580
- this._actualSize = value;
581
- },
582
- enumerable: true,
583
- configurable: true
584
- });
585
- Object.defineProperty(ImageSource.prototype, "saveAspectRatio", {
586
- get: function () {
587
- return this._saveAspectRatio;
588
- },
589
- set: function (value) {
590
- this._saveAspectRatio = value;
591
- },
592
- enumerable: true,
593
- configurable: true
594
- });
595
- Object.defineProperty(ImageSource.prototype, "dpiX", {
596
- get: function () {
597
- return this._dpiX;
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
- ImageSource.prototype.removePropertyChanged = function (listener) {
509
+ }
510
+ removePropertyChanged(listener) {
621
511
  this._propertyChanged.remove(listener);
622
- };
623
- ImageSource.prototype.toJSON = function () {
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
- return ImageSource;
637
- }());
526
+ }
527
+ }
638
528
  ImageItem.ImageSource = ImageSource;
639
529
  (function (ImageSource) {
640
- var Origin = /** @class */ (function () {
641
- function Origin(rawData) {
642
- _.extend(this, rawData || {});
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
- Origin.prototype.equals = function (other) {
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
- Origin.prototype.clone = function () {
541
+ }
542
+ clone() {
653
543
  return new Origin(this);
654
- };
655
- return Origin;
656
- }());
544
+ }
545
+ }
657
546
  ImageSource.Origin = Origin;
658
547
  })(ImageSource = ImageItem.ImageSource || (ImageItem.ImageSource = {}));
659
548
  })(ImageItem || (ImageItem = {}));