@underlayerdev/ui 0.10.0 → 0.11.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": "@underlayerdev/ui",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^22.0.0",
6
6
  "@angular/common": "^22.0.0",
@@ -885,14 +885,14 @@ type ImageCropperShape = 'rectangle' | 'round';
885
885
  * third-party crop mechanics never leak outside the design system —
886
886
  * consumers only ever see `ul-image-cropper`.
887
887
  *
888
- * Two interaction modes, chosen by whether `aspectRatio` is set:
889
- * - **Locked** (`aspectRatio` given, e.g. `1` for an avatar): a fixed-size
890
- * frame; the user drags/zooms the photo underneath it. Best when every
891
- * output needs the same ratio (avatars, thumbnails).
892
- * - **Free-form** (`aspectRatio` omitted, the default): a resizable frame
893
- * over a static photo; the user drags its corners to trim/straighten with
894
- * no ratio imposed. Best for listing photos, which keep their own shape
895
- * today (see `um-image-upload`'s auto-width carousel).
888
+ * The frame is always what moves/resizes, never the photo: ngx-image-cropper
889
+ * only bounds-checks that path (`checkCropperWithinMaxSizeBounds`) — its
890
+ * alternative "drag the photo within a fixed frame" mode applies pan
891
+ * offsets with no clamping at all, so the photo could be dragged clean out
892
+ * of the frame. `aspectRatio` just decides whether that frame is locked to
893
+ * a ratio (e.g. `1` for an avatar) or freely resizable (the default — for
894
+ * listing photos, which keep their own shape today, see `um-image-upload`'s
895
+ * auto-width carousel).
896
896
  *
897
897
  * Emits a resized `File`, ready to hand to any upload call that accepts
898
898
  * one — this component only produces the file, it never uploads it.
@@ -922,11 +922,7 @@ declare class ImageCropperComponent {
922
922
  readonly imageFile: _angular_core.InputSignal<File | null>;
923
923
  /** Visual shape of the crop mask. */
924
924
  readonly shape: _angular_core.InputSignal<ImageCropperShape>;
925
- /**
926
- * Locks the crop frame to this width/height ratio and switches to
927
- * pan-and-zoom mode. Omit (or pass null) for a free-form resizable frame
928
- * with no ratio imposed.
929
- */
925
+ /** Locks the crop frame to this width/height ratio. Omit (or pass null) for a free-form frame. */
930
926
  readonly aspectRatio: _angular_core.InputSignal<number | null>;
931
927
  /** Longest side (px) of the final output image; scales down without distorting. */
932
928
  readonly maxOutputSize: _angular_core.InputSignal<number>;
@@ -934,15 +930,11 @@ declare class ImageCropperComponent {
934
930
  readonly title: _angular_core.InputSignal<string>;
935
931
  /** Label for the confirm button. */
936
932
  readonly confirmLabel: _angular_core.InputSignal<string>;
937
- /** Label for the cancel button. */
938
- readonly cancelLabel: _angular_core.InputSignal<string>;
939
- /** Label next to the zoom slider (locked-aspect mode only). */
940
- readonly zoomLabel: _angular_core.InputSignal<string>;
941
933
  /** Accessible label for the crop frame. */
942
934
  readonly frameAriaLabel: _angular_core.InputSignal<string>;
943
935
  /** Emitted with the cropped, resized photo once the user confirms. */
944
936
  readonly cropped: _angular_core.OutputEmitterRef<File>;
945
- /** Emitted when the user cancels or dismisses the modal without cropping. */
937
+ /** Emitted when the user dismisses the modal (backdrop, Escape, close button) without cropping. */
946
938
  readonly cancelled: _angular_core.OutputEmitterRef<void>;
947
939
  /** Emitted when the source photo fails to load in the cropper. */
948
940
  readonly loadFailed: _angular_core.OutputEmitterRef<void>;
@@ -952,22 +944,13 @@ declare class ImageCropperComponent {
952
944
  protected readonly isLocked: _angular_core.Signal<boolean>;
953
945
  /** ngx-image-cropper always wants a number here; unused while isLocked() is false. */
954
946
  protected readonly effectiveAspectRatio: _angular_core.Signal<number>;
955
- protected readonly frameWidth: _angular_core.Signal<number | undefined>;
956
- protected readonly frameHeight: _angular_core.Signal<number | undefined>;
957
- protected readonly minZoom = 1;
958
- protected readonly maxZoom = 3;
959
- protected readonly zoomStep = 0.01;
960
- protected readonly zoom: _angular_core.WritableSignal<number>;
961
- protected readonly transform: _angular_core.Signal<{
962
- scale: number;
963
- }>;
947
+ protected readonly minFrameDimension = 40;
964
948
  protected readonly cropperReady: _angular_core.WritableSignal<boolean>;
965
949
  constructor();
966
- protected onZoomInput(event: Event): void;
967
950
  protected onConfirm(): Promise<void>;
968
- protected onCancel(): void;
951
+ protected onClosed(): void;
969
952
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ImageCropperComponent, never>;
970
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ImageCropperComponent, "ul-image-cropper", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "imageFile": { "alias": "imageFile"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; "isSignal": true; }; "maxOutputSize": { "alias": "maxOutputSize"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; "isSignal": true; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; "isSignal": true; }; "zoomLabel": { "alias": "zoomLabel"; "required": false; "isSignal": true; }; "frameAriaLabel": { "alias": "frameAriaLabel"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "cropped": "cropped"; "cancelled": "cancelled"; "loadFailed": "loadFailed"; }, never, never, true, never>;
953
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ImageCropperComponent, "ul-image-cropper", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "imageFile": { "alias": "imageFile"; "required": false; "isSignal": true; }; "shape": { "alias": "shape"; "required": false; "isSignal": true; }; "aspectRatio": { "alias": "aspectRatio"; "required": false; "isSignal": true; }; "maxOutputSize": { "alias": "maxOutputSize"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "confirmLabel": { "alias": "confirmLabel"; "required": false; "isSignal": true; }; "frameAriaLabel": { "alias": "frameAriaLabel"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "cropped": "cropped"; "cancelled": "cancelled"; "loadFailed": "loadFailed"; }, never, never, true, never>;
971
954
  }
972
955
 
973
956
  type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url';