@underlayerdev/ui 0.20.0 → 0.21.1

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.
@@ -10,7 +10,6 @@ import { CdkMenu, CdkMenuItem, CdkMenuTrigger } from "@angular/cdk/menu";
10
10
  import { CdkTrapFocus } from "@angular/cdk/a11y";
11
11
  import { fromEvent, map } from "rxjs";
12
12
  import { debounceTime } from "rxjs/operators";
13
- import { ImageCropperComponent as ImageCropperComponent$1 } from "ngx-image-cropper";
14
13
  import { DomSanitizer } from "@angular/platform-browser";
15
14
  import { BreakpointObserver } from "@angular/cdk/layout";
16
15
  var AccordionItemComponent = class AccordionItemComponent {
@@ -7741,7 +7740,7 @@ var ImageCropperComponent = class ImageCropperComponent {
7741
7740
  cropped = output();
7742
7741
  cancelled = output();
7743
7742
  loadFailed = output();
7744
- cropperRef = viewChild(ImageCropperComponent$1, ...ngDevMode ? [{ debugName: "cropperRef" }] : /* istanbul ignore next */ []);
7743
+ cropperRef = viewChild("cropper", ...ngDevMode ? [{ debugName: "cropperRef" }] : /* istanbul ignore next */ []);
7745
7744
  cropperImageFile = computed(() => this.imageFile() ?? void 0, ...ngDevMode ? [{ debugName: "cropperImageFile" }] : /* istanbul ignore next */ []);
7746
7745
  isRound = computed(() => this.shape() === "round", ...ngDevMode ? [{ debugName: "isRound" }] : /* istanbul ignore next */ []);
7747
7746
  isLocked = computed(() => this.aspectRatio() != null, ...ngDevMode ? [{ debugName: "isLocked" }] : /* istanbul ignore next */ []);
@@ -7924,218 +7923,167 @@ var ImageCropperComponent = class ImageCropperComponent {
7924
7923
  viewQueries: [{
7925
7924
  propertyName: "cropperRef",
7926
7925
  first: true,
7927
- predicate: ImageCropperComponent$1,
7926
+ predicate: ["cropper"],
7928
7927
  descendants: true,
7929
7928
  isSignal: true
7930
7929
  }],
7931
7930
  ngImport: i0,
7932
- template: "<ul-modal [(open)]=\"open\" variant=\"custom\" [title]=\"title()\" (closed)=\"onClosed()\">\n @if (imageFile()) {\n <div class=\"ul-image-cropper\">\n <image-cropper\n class=\"ul-image-cropper__frame\"\n [imageFile]=\"cropperImageFile()\"\n [maintainAspectRatio]=\"isLocked()\"\n [aspectRatio]=\"effectiveAspectRatio()\"\n [roundCropper]=\"isRound()\"\n [cropperStaticWidth]=\"frameWidth()\"\n [cropperStaticHeight]=\"frameHeight()\"\n [allowMoveImage]=\"isLocked()\"\n [transform]=\"transform()\"\n [resizeToWidth]=\"maxOutputSize()\"\n [resizeToHeight]=\"maxOutputSize()\"\n [onlyScaleDown]=\"true\"\n [cropperFrameAriaLabel]=\"frameAriaLabel()\"\n format=\"jpeg\"\n output=\"blob\"\n (cropperReady)=\"onCropperReady($event)\"\n (transformChange)=\"onTransformChange($event)\"\n (loadImageFailed)=\"loadFailed.emit()\"\n />\n\n @if (isLocked()) {\n <label class=\"ul-image-cropper__zoom\">\n <span class=\"ul-image-cropper__zoom-label\">{{ zoomLabel() }}</span>\n <input\n type=\"range\"\n class=\"ul-image-cropper__zoom-input\"\n [min]=\"minZoom\"\n [max]=\"maxZoom\"\n [step]=\"zoomStep\"\n [value]=\"zoom()\"\n (input)=\"onZoomInput($event)\"\n />\n </label>\n }\n </div>\n }\n\n <div class=\"ul-modal__foter-content\" ul-modal-footer>\n <ul-button\n theme=\"fill-purple\"\n size=\"md\"\n [disabled]=\"!cropperReady()\"\n (buttonClick)=\"onConfirm()\"\n >\n {{ confirmLabel() }}\n </ul-button>\n </div>\n</ul-modal>\n",
7931
+ template: "<ul-modal [(open)]=\"open\" variant=\"custom\" [title]=\"title()\" (closed)=\"onClosed()\">\n @if (imageFile()) {\n <div class=\"ul-image-cropper\">\n <!-- Loaded when a photo is picked, not with the app: see the import in image-cropper.ts.\n Until it is in, the frame's box holds the space it will take. -->\n @defer (on immediate) {\n <image-cropper\n #cropper\n class=\"ul-image-cropper__frame\"\n [imageFile]=\"cropperImageFile()\"\n [maintainAspectRatio]=\"isLocked()\"\n [aspectRatio]=\"effectiveAspectRatio()\"\n [roundCropper]=\"isRound()\"\n [cropperStaticWidth]=\"frameWidth()\"\n [cropperStaticHeight]=\"frameHeight()\"\n [allowMoveImage]=\"isLocked()\"\n [transform]=\"transform()\"\n [resizeToWidth]=\"maxOutputSize()\"\n [resizeToHeight]=\"maxOutputSize()\"\n [onlyScaleDown]=\"true\"\n [cropperFrameAriaLabel]=\"frameAriaLabel()\"\n format=\"jpeg\"\n output=\"blob\"\n (cropperReady)=\"onCropperReady($event)\"\n (transformChange)=\"onTransformChange($event)\"\n (loadImageFailed)=\"loadFailed.emit()\"\n />\n } @placeholder {\n <div class=\"ul-image-cropper__frame\"></div>\n }\n\n @if (isLocked()) {\n <label class=\"ul-image-cropper__zoom\">\n <span class=\"ul-image-cropper__zoom-label\">{{ zoomLabel() }}</span>\n <input\n type=\"range\"\n class=\"ul-image-cropper__zoom-input\"\n [min]=\"minZoom\"\n [max]=\"maxZoom\"\n [step]=\"zoomStep\"\n [value]=\"zoom()\"\n (input)=\"onZoomInput($event)\"\n />\n </label>\n }\n </div>\n }\n\n <div class=\"ul-modal__foter-content\" ul-modal-footer>\n <ul-button\n theme=\"fill-purple\"\n size=\"md\"\n [disabled]=\"!cropperReady()\"\n (buttonClick)=\"onConfirm()\"\n >\n {{ confirmLabel() }}\n </ul-button>\n </div>\n</ul-modal>\n",
7933
7932
  styles: [".ul-image-cropper{display:flex;flex-direction:column;align-items:center;gap:16px}.ul-image-cropper__frame{display:block;width:100%;height:320px;--cropper-overlay-color: rgba(10, 10, 10, .85);--cropper-outline-color: rgba(10, 10, 10, .85);--cropper-color: #6f3de0;--cropper-border: 2px solid #6f3de0;--cropper-hover-border: 2px solid #6f3de0;--cropper-focus-border: 2px solid #6f3de0;--cropper-resize-square-bg: #6f3de0;--cropper-resize-square-border: 1px solid #0a0a0a}.ul-image-cropper__zoom{display:flex;align-items:center;gap:12px;width:100%}.ul-image-cropper__zoom-label{font-family:Underlayer Nunito Sans;line-height:20px;font-size:14px;letter-spacing:.14px;font-weight:400;color:#ffffffb3;flex-shrink:0}.ul-image-cropper__zoom-input{flex:1;accent-color:#6f3de0}.ul-modal__foter-content{width:100%;margin-top:32px}\n"],
7934
- dependencies: [
7935
- {
7936
- kind: "component",
7937
- type: ImageCropperComponent$1,
7938
- selector: "image-cropper",
7939
- inputs: [
7940
- "imageChangedEvent",
7941
- "imageURL",
7942
- "imageBase64",
7943
- "imageFile",
7944
- "imageAltText",
7945
- "options",
7946
- "cropperFrameAriaLabel",
7947
- "output",
7948
- "format",
7949
- "autoCrop",
7950
- "cropper",
7951
- "transform",
7952
- "maintainAspectRatio",
7953
- "aspectRatio",
7954
- "resetCropOnAspectRatioChange",
7955
- "resizeToWidth",
7956
- "resizeToHeight",
7957
- "cropperMinWidth",
7958
- "cropperMinHeight",
7959
- "cropperMaxHeight",
7960
- "cropperMaxWidth",
7961
- "cropperStaticWidth",
7962
- "cropperStaticHeight",
7963
- "canvasRotation",
7964
- "initialStepSize",
7965
- "roundCropper",
7966
- "onlyScaleDown",
7967
- "imageQuality",
7968
- "backgroundColor",
7969
- "containWithinAspectRatio",
7970
- "hideResizeSquares",
7971
- "allowMoveImage",
7972
- "checkImageType",
7973
- "alignImage",
7974
- "disabled",
7975
- "hidden"
7976
- ],
7977
- outputs: [
7978
- "imageCropped",
7979
- "startCropImage",
7980
- "imageLoaded",
7981
- "cropperReady",
7982
- "loadImageFailed",
7983
- "transformChange",
7984
- "cropperChange"
7985
- ]
7986
- },
7987
- {
7988
- kind: "component",
7989
- type: ModalComponent,
7990
- selector: "ul-modal",
7991
- inputs: [
7992
- "open",
7993
- "variant",
7994
- "title",
7995
- "closeOnBackdropClick",
7996
- "showCloseButton",
7997
- "confirmLabel",
7998
- "cancelLabel",
7999
- "customClass",
8000
- "fullScreenInMobile"
8001
- ],
8002
- outputs: [
8003
- "openChange",
8004
- "closed",
8005
- "confirmed",
8006
- "cancelled"
8007
- ]
8008
- },
8009
- {
8010
- kind: "component",
8011
- type: ButtonComponent,
8012
- selector: "ul-button",
8013
- inputs: [
8014
- "size",
8015
- "theme",
8016
- "iconOnly",
8017
- "vertical",
8018
- "disabled",
8019
- "type",
8020
- "ariaLabel"
8021
- ],
8022
- outputs: ["buttonClick"]
8023
- }
8024
- ]
7933
+ dependencies: [{
7934
+ kind: "component",
7935
+ type: ModalComponent,
7936
+ selector: "ul-modal",
7937
+ inputs: [
7938
+ "open",
7939
+ "variant",
7940
+ "title",
7941
+ "closeOnBackdropClick",
7942
+ "showCloseButton",
7943
+ "confirmLabel",
7944
+ "cancelLabel",
7945
+ "customClass",
7946
+ "fullScreenInMobile"
7947
+ ],
7948
+ outputs: [
7949
+ "openChange",
7950
+ "closed",
7951
+ "confirmed",
7952
+ "cancelled"
7953
+ ]
7954
+ }, {
7955
+ kind: "component",
7956
+ type: ButtonComponent,
7957
+ selector: "ul-button",
7958
+ inputs: [
7959
+ "size",
7960
+ "theme",
7961
+ "iconOnly",
7962
+ "vertical",
7963
+ "disabled",
7964
+ "type",
7965
+ "ariaLabel"
7966
+ ],
7967
+ outputs: ["buttonClick"]
7968
+ }],
7969
+ deferBlockDependencies: [() => [import("ngx-image-cropper").then((m) => m.ImageCropperComponent)]]
8025
7970
  });
8026
7971
  };
8027
- i0.ɵɵngDeclareClassMetadata({
8028
- minVersion: "12.0.0",
7972
+ i0.ɵɵngDeclareClassMetadataAsync({
7973
+ minVersion: "18.0.0",
8029
7974
  version: "22.2.2",
8030
7975
  ngImport: i0,
8031
7976
  type: ImageCropperComponent,
8032
- decorators: [{
8033
- type: Component,
8034
- args: [{
8035
- selector: "ul-image-cropper",
8036
- imports: [
8037
- ImageCropperComponent$1,
8038
- ModalComponent,
8039
- ButtonComponent
8040
- ],
8041
- template: "<ul-modal [(open)]=\"open\" variant=\"custom\" [title]=\"title()\" (closed)=\"onClosed()\">\n @if (imageFile()) {\n <div class=\"ul-image-cropper\">\n <image-cropper\n class=\"ul-image-cropper__frame\"\n [imageFile]=\"cropperImageFile()\"\n [maintainAspectRatio]=\"isLocked()\"\n [aspectRatio]=\"effectiveAspectRatio()\"\n [roundCropper]=\"isRound()\"\n [cropperStaticWidth]=\"frameWidth()\"\n [cropperStaticHeight]=\"frameHeight()\"\n [allowMoveImage]=\"isLocked()\"\n [transform]=\"transform()\"\n [resizeToWidth]=\"maxOutputSize()\"\n [resizeToHeight]=\"maxOutputSize()\"\n [onlyScaleDown]=\"true\"\n [cropperFrameAriaLabel]=\"frameAriaLabel()\"\n format=\"jpeg\"\n output=\"blob\"\n (cropperReady)=\"onCropperReady($event)\"\n (transformChange)=\"onTransformChange($event)\"\n (loadImageFailed)=\"loadFailed.emit()\"\n />\n\n @if (isLocked()) {\n <label class=\"ul-image-cropper__zoom\">\n <span class=\"ul-image-cropper__zoom-label\">{{ zoomLabel() }}</span>\n <input\n type=\"range\"\n class=\"ul-image-cropper__zoom-input\"\n [min]=\"minZoom\"\n [max]=\"maxZoom\"\n [step]=\"zoomStep\"\n [value]=\"zoom()\"\n (input)=\"onZoomInput($event)\"\n />\n </label>\n }\n </div>\n }\n\n <div class=\"ul-modal__foter-content\" ul-modal-footer>\n <ul-button\n theme=\"fill-purple\"\n size=\"md\"\n [disabled]=\"!cropperReady()\"\n (buttonClick)=\"onConfirm()\"\n >\n {{ confirmLabel() }}\n </ul-button>\n </div>\n</ul-modal>\n",
8042
- styles: [".ul-image-cropper{display:flex;flex-direction:column;align-items:center;gap:16px}.ul-image-cropper__frame{display:block;width:100%;height:320px;--cropper-overlay-color: rgba(10, 10, 10, .85);--cropper-outline-color: rgba(10, 10, 10, .85);--cropper-color: #6f3de0;--cropper-border: 2px solid #6f3de0;--cropper-hover-border: 2px solid #6f3de0;--cropper-focus-border: 2px solid #6f3de0;--cropper-resize-square-bg: #6f3de0;--cropper-resize-square-border: 1px solid #0a0a0a}.ul-image-cropper__zoom{display:flex;align-items:center;gap:12px;width:100%}.ul-image-cropper__zoom-label{font-family:Underlayer Nunito Sans;line-height:20px;font-size:14px;letter-spacing:.14px;font-weight:400;color:#ffffffb3;flex-shrink:0}.ul-image-cropper__zoom-input{flex:1;accent-color:#6f3de0}.ul-modal__foter-content{width:100%;margin-top:32px}\n"]
8043
- }]
8044
- }],
8045
- ctorParameters: () => [],
8046
- propDecorators: {
8047
- open: [{
8048
- type: i0.Input,
8049
- args: [{
8050
- isSignal: true,
8051
- alias: "open",
8052
- required: false
8053
- }]
8054
- }, {
8055
- type: i0.Output,
8056
- args: ["openChange"]
8057
- }],
8058
- imageFile: [{
8059
- type: i0.Input,
8060
- args: [{
8061
- isSignal: true,
8062
- alias: "imageFile",
8063
- required: false
8064
- }]
8065
- }],
8066
- shape: [{
8067
- type: i0.Input,
8068
- args: [{
8069
- isSignal: true,
8070
- alias: "shape",
8071
- required: false
8072
- }]
8073
- }],
8074
- aspectRatio: [{
8075
- type: i0.Input,
8076
- args: [{
8077
- isSignal: true,
8078
- alias: "aspectRatio",
8079
- required: false
8080
- }]
8081
- }],
8082
- maxOutputSize: [{
8083
- type: i0.Input,
8084
- args: [{
8085
- isSignal: true,
8086
- alias: "maxOutputSize",
8087
- required: false
8088
- }]
8089
- }],
8090
- title: [{
8091
- type: i0.Input,
8092
- args: [{
8093
- isSignal: true,
8094
- alias: "title",
8095
- required: false
8096
- }]
8097
- }],
8098
- confirmLabel: [{
8099
- type: i0.Input,
8100
- args: [{
8101
- isSignal: true,
8102
- alias: "confirmLabel",
8103
- required: false
8104
- }]
8105
- }],
8106
- zoomLabel: [{
8107
- type: i0.Input,
8108
- args: [{
8109
- isSignal: true,
8110
- alias: "zoomLabel",
8111
- required: false
8112
- }]
8113
- }],
8114
- frameAriaLabel: [{
8115
- type: i0.Input,
8116
- args: [{
8117
- isSignal: true,
8118
- alias: "frameAriaLabel",
8119
- required: false
7977
+ resolveDeferredDeps: () => [import("ngx-image-cropper").then((m) => m.ImageCropperComponent)],
7978
+ resolveMetadata: (ImageCropperComponent) => ({
7979
+ decorators: [{
7980
+ type: Component,
7981
+ args: [{
7982
+ selector: "ul-image-cropper",
7983
+ imports: [
7984
+ NgxImageCropperComponent,
7985
+ ModalComponent,
7986
+ ButtonComponent
7987
+ ],
7988
+ template: "<ul-modal [(open)]=\"open\" variant=\"custom\" [title]=\"title()\" (closed)=\"onClosed()\">\n @if (imageFile()) {\n <div class=\"ul-image-cropper\">\n <!-- Loaded when a photo is picked, not with the app: see the import in image-cropper.ts.\n Until it is in, the frame's box holds the space it will take. -->\n @defer (on immediate) {\n <image-cropper\n #cropper\n class=\"ul-image-cropper__frame\"\n [imageFile]=\"cropperImageFile()\"\n [maintainAspectRatio]=\"isLocked()\"\n [aspectRatio]=\"effectiveAspectRatio()\"\n [roundCropper]=\"isRound()\"\n [cropperStaticWidth]=\"frameWidth()\"\n [cropperStaticHeight]=\"frameHeight()\"\n [allowMoveImage]=\"isLocked()\"\n [transform]=\"transform()\"\n [resizeToWidth]=\"maxOutputSize()\"\n [resizeToHeight]=\"maxOutputSize()\"\n [onlyScaleDown]=\"true\"\n [cropperFrameAriaLabel]=\"frameAriaLabel()\"\n format=\"jpeg\"\n output=\"blob\"\n (cropperReady)=\"onCropperReady($event)\"\n (transformChange)=\"onTransformChange($event)\"\n (loadImageFailed)=\"loadFailed.emit()\"\n />\n } @placeholder {\n <div class=\"ul-image-cropper__frame\"></div>\n }\n\n @if (isLocked()) {\n <label class=\"ul-image-cropper__zoom\">\n <span class=\"ul-image-cropper__zoom-label\">{{ zoomLabel() }}</span>\n <input\n type=\"range\"\n class=\"ul-image-cropper__zoom-input\"\n [min]=\"minZoom\"\n [max]=\"maxZoom\"\n [step]=\"zoomStep\"\n [value]=\"zoom()\"\n (input)=\"onZoomInput($event)\"\n />\n </label>\n }\n </div>\n }\n\n <div class=\"ul-modal__foter-content\" ul-modal-footer>\n <ul-button\n theme=\"fill-purple\"\n size=\"md\"\n [disabled]=\"!cropperReady()\"\n (buttonClick)=\"onConfirm()\"\n >\n {{ confirmLabel() }}\n </ul-button>\n </div>\n</ul-modal>\n",
7989
+ styles: [".ul-image-cropper{display:flex;flex-direction:column;align-items:center;gap:16px}.ul-image-cropper__frame{display:block;width:100%;height:320px;--cropper-overlay-color: rgba(10, 10, 10, .85);--cropper-outline-color: rgba(10, 10, 10, .85);--cropper-color: #6f3de0;--cropper-border: 2px solid #6f3de0;--cropper-hover-border: 2px solid #6f3de0;--cropper-focus-border: 2px solid #6f3de0;--cropper-resize-square-bg: #6f3de0;--cropper-resize-square-border: 1px solid #0a0a0a}.ul-image-cropper__zoom{display:flex;align-items:center;gap:12px;width:100%}.ul-image-cropper__zoom-label{font-family:Underlayer Nunito Sans;line-height:20px;font-size:14px;letter-spacing:.14px;font-weight:400;color:#ffffffb3;flex-shrink:0}.ul-image-cropper__zoom-input{flex:1;accent-color:#6f3de0}.ul-modal__foter-content{width:100%;margin-top:32px}\n"]
7990
+ }]
7991
+ }],
7992
+ ctorParameters: () => [],
7993
+ propDecorators: {
7994
+ open: [{
7995
+ type: i0.Input,
7996
+ args: [{
7997
+ isSignal: true,
7998
+ alias: "open",
7999
+ required: false
8000
+ }]
8001
+ }, {
8002
+ type: i0.Output,
8003
+ args: ["openChange"]
8004
+ }],
8005
+ imageFile: [{
8006
+ type: i0.Input,
8007
+ args: [{
8008
+ isSignal: true,
8009
+ alias: "imageFile",
8010
+ required: false
8011
+ }]
8012
+ }],
8013
+ shape: [{
8014
+ type: i0.Input,
8015
+ args: [{
8016
+ isSignal: true,
8017
+ alias: "shape",
8018
+ required: false
8019
+ }]
8020
+ }],
8021
+ aspectRatio: [{
8022
+ type: i0.Input,
8023
+ args: [{
8024
+ isSignal: true,
8025
+ alias: "aspectRatio",
8026
+ required: false
8027
+ }]
8028
+ }],
8029
+ maxOutputSize: [{
8030
+ type: i0.Input,
8031
+ args: [{
8032
+ isSignal: true,
8033
+ alias: "maxOutputSize",
8034
+ required: false
8035
+ }]
8036
+ }],
8037
+ title: [{
8038
+ type: i0.Input,
8039
+ args: [{
8040
+ isSignal: true,
8041
+ alias: "title",
8042
+ required: false
8043
+ }]
8044
+ }],
8045
+ confirmLabel: [{
8046
+ type: i0.Input,
8047
+ args: [{
8048
+ isSignal: true,
8049
+ alias: "confirmLabel",
8050
+ required: false
8051
+ }]
8052
+ }],
8053
+ zoomLabel: [{
8054
+ type: i0.Input,
8055
+ args: [{
8056
+ isSignal: true,
8057
+ alias: "zoomLabel",
8058
+ required: false
8059
+ }]
8060
+ }],
8061
+ frameAriaLabel: [{
8062
+ type: i0.Input,
8063
+ args: [{
8064
+ isSignal: true,
8065
+ alias: "frameAriaLabel",
8066
+ required: false
8067
+ }]
8068
+ }],
8069
+ cropped: [{
8070
+ type: i0.Output,
8071
+ args: ["cropped"]
8072
+ }],
8073
+ cancelled: [{
8074
+ type: i0.Output,
8075
+ args: ["cancelled"]
8076
+ }],
8077
+ loadFailed: [{
8078
+ type: i0.Output,
8079
+ args: ["loadFailed"]
8080
+ }],
8081
+ cropperRef: [{
8082
+ type: i0.ViewChild,
8083
+ args: ["cropper", { isSignal: true }]
8120
8084
  }]
8121
- }],
8122
- cropped: [{
8123
- type: i0.Output,
8124
- args: ["cropped"]
8125
- }],
8126
- cancelled: [{
8127
- type: i0.Output,
8128
- args: ["cancelled"]
8129
- }],
8130
- loadFailed: [{
8131
- type: i0.Output,
8132
- args: ["loadFailed"]
8133
- }],
8134
- cropperRef: [{
8135
- type: i0.ViewChild,
8136
- args: [i0.forwardRef(() => ImageCropperComponent$1), { isSignal: true }]
8137
- }]
8138
- }
8085
+ }
8086
+ })
8139
8087
  });
8140
8088
  const DEFAULT_DURATION_MS = 500;
8141
8089
  const MOVE_CANCEL_THRESHOLD_PX = 10;