@eagami/ui 5.88.3 → 5.89.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "5.88.3",
3
+ "version": "5.89.0",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -76,6 +76,7 @@ export interface EagamiMessages {
76
76
  remove: string;
77
77
  invalidType: string;
78
78
  tooLarge: (maxMb: number) => string;
79
+ lowResolution: string;
79
80
  };
80
81
  breadcrumbs: {
81
82
  label: string;
@@ -1204,6 +1205,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
1204
1205
  protected readonly i18n: EagamiI18nService;
1205
1206
  readonly shape: import("@angular/core").InputSignal<AvatarEditorShape>;
1206
1207
  readonly canvasSize: import("@angular/core").InputSignal<number>;
1208
+ readonly aspectRatio: import("@angular/core").InputSignal<number>;
1207
1209
  readonly currentSrc: import("@angular/core").InputSignal<string | undefined>;
1208
1210
  readonly loading: import("@angular/core").InputSignal<boolean>;
1209
1211
  readonly accept: import("@angular/core").InputSignal<string>;
@@ -1212,6 +1214,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
1212
1214
  readonly maxZoom: import("@angular/core").InputSignal<number>;
1213
1215
  readonly exportQuality: import("@angular/core").InputSignal<number>;
1214
1216
  readonly exportType: import("@angular/core").InputSignal<string>;
1217
+ readonly displayWidth: import("@angular/core").InputSignal<number | undefined>;
1215
1218
  readonly cropState: import("@angular/core").InputSignal<AvatarEditorCropState | null | undefined>;
1216
1219
  /** Fires when the user finalises a crop via {@link exportCrop}; payload contains both `Blob` and data URL. */
1217
1220
  readonly cropped: import("@angular/core").OutputEmitterRef<AvatarEditorCropEvent>;
@@ -1231,9 +1234,14 @@ export declare class AvatarEditorComponent implements OnDestroy {
1231
1234
  readonly isLoading: import("@angular/core").Signal<boolean>;
1232
1235
  readonly zoom: import("@angular/core").WritableSignal<number>;
1233
1236
  readonly canRevert: import("@angular/core").Signal<boolean>;
1237
+ /** Height of the crop frame, from `canvasSize` as its width and `aspectRatio`. */
1238
+ readonly frameHeight: import("@angular/core").Signal<number>;
1239
+ /** True when the part of the image inside the frame is narrower than `displayWidth`, so the exported crop would be upscaled. */
1240
+ readonly isLowResolution: import("@angular/core").Signal<boolean>;
1234
1241
  /** True when the visible crop is darker than mid-grey; drives the `--on-light` class on the overlay so the "Change photo" affordance stays readable. */
1235
1242
  readonly isImageDark: import("@angular/core").WritableSignal<boolean>;
1236
1243
  private image;
1244
+ private readonly imageSize;
1237
1245
  private offsetX;
1238
1246
  private offsetY;
1239
1247
  private dragStartX;
@@ -1287,14 +1295,20 @@ export declare class AvatarEditorComponent implements OnDestroy {
1287
1295
  captureOriginal(): void;
1288
1296
  /** Restores the image and crop state captured by the most recent {@link captureOriginal}. */
1289
1297
  revertImage(): void;
1290
- /** Renders the current crop to an offscreen canvas, emits `cropped`, and resolves with the resulting `Blob`. */
1291
- exportCrop(): Promise<Blob>;
1298
+ /**
1299
+ * Renders the current crop to an offscreen canvas, emits `cropped`, and resolves with the resulting `Blob`.
1300
+ * Pass `width` to export at a different width than the frame, keeping its aspect ratio.
1301
+ */
1302
+ exportCrop(width?: number): Promise<Blob>;
1292
1303
  private loadFromUrl;
1293
1304
  private loadFile;
1294
1305
  private scheduleDrawAfterRender;
1295
1306
  private drawLoadedImage;
1296
1307
  private centerImage;
1308
+ private setImage;
1297
1309
  private getScale;
1310
+ private scaleFor;
1311
+ private traceEllipse;
1298
1312
  private getDrawParams;
1299
1313
  private applyZoom;
1300
1314
  private clampOffset;
@@ -1304,7 +1318,7 @@ export declare class AvatarEditorComponent implements OnDestroy {
1304
1318
  * mid-grey, so the hover overlay can flip its label and icon between
1305
1319
  * white (on dark photos) and black (on light photos).
1306
1320
  *
1307
- * Restricts sampling to the inscribed circle for circle crops to ignore
1321
+ * Restricts sampling to the inscribed ellipse for circle crops to ignore
1308
1322
  * the soon-to-be-masked corners. Uses Rec. 601 perceptual luminance
1309
1323
  * weights; transparent pixels and CORS-tainted canvases default to a
1310
1324
  * "dark" assumption (white ink).
@@ -1324,6 +1338,11 @@ export declare class AvatarEditorComponent implements OnDestroy {
1324
1338
  "required": false;
1325
1339
  "isSignal": true;
1326
1340
  };
1341
+ "aspectRatio": {
1342
+ "alias": "aspectRatio";
1343
+ "required": false;
1344
+ "isSignal": true;
1345
+ };
1327
1346
  "currentSrc": {
1328
1347
  "alias": "currentSrc";
1329
1348
  "required": false;
@@ -1364,6 +1383,11 @@ export declare class AvatarEditorComponent implements OnDestroy {
1364
1383
  "required": false;
1365
1384
  "isSignal": true;
1366
1385
  };
1386
+ "displayWidth": {
1387
+ "alias": "displayWidth";
1388
+ "required": false;
1389
+ "isSignal": true;
1390
+ };
1367
1391
  "cropState": {
1368
1392
  "alias": "cropState";
1369
1393
  "required": false;
@@ -3687,6 +3711,7 @@ export declare class CodeInputComponent extends LabelledFieldControlBase impleme
3687
3711
  handleBlur(): void;
3688
3712
  /** Moves keyboard focus to the next empty digit (or the last one when full). */
3689
3713
  focus(): void;
3714
+ private fillFrom;
3690
3715
  private sanitize;
3691
3716
  private focusDigit;
3692
3717
  static ɵfac: i0.ɵɵFactoryDeclaration<CodeInputComponent, never>;