@rdlabo/ionic-angular-photo-editor 19.0.3 → 20.0.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.
@@ -1,17 +1,17 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, signal, inject, Component, Input, ViewChild, ElementRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
- import { CommonModule, NgOptimizedImage, NgFor, NgIf } from '@angular/common';
2
+ import { Injectable, signal, inject, ViewChild, Input, Component, ElementRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
+ import { CommonModule } from '@angular/common';
4
4
  import { FormsModule } from '@angular/forms';
5
5
  import * as i1 from '@ionic/angular/standalone';
6
6
  import { IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonText, IonRange, ModalController, IonicSlides, ActionSheetController, Platform } from '@ionic/angular/standalone';
7
7
  import ImageEditor from 'tui-image-editor';
8
8
  import { toObservable } from '@angular/core/rxjs-interop';
9
9
  import { addIcons } from 'ionicons';
10
- import { closeOutline, removeOutline, send, cropOutline, colorFilterOutline, sunnyOutline, expandOutline, tabletLandscapeOutline, squareOutline, refreshOutline, checkmarkOutline } from 'ionicons/icons';
10
+ import { removeOutline, closeOutline, checkmarkOutline, refreshOutline, squareOutline, tabletLandscapeOutline, expandOutline, sunnyOutline, colorFilterOutline, cropOutline, send } from 'ionicons/icons';
11
11
  import { Navigation, Zoom } from 'swiper/modules';
12
12
  import { fromEvent, zipWith, withLatestFrom, throttleTime } from 'rxjs';
13
13
  import { register } from 'swiper/element/bundle';
14
- import { CameraResultType, CameraSource, Camera } from '@capacitor/camera';
14
+ import { CameraSource, CameraResultType, Camera } from '@capacitor/camera';
15
15
 
16
16
  const filterPreset = (dictionary) => [
17
17
  {
@@ -89,10 +89,10 @@ class HelperService {
89
89
  });
90
90
  });
91
91
  }
92
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: HelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: HelperService }); }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HelperService }); }
94
94
  }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: HelperService, decorators: [{
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: HelperService, decorators: [{
96
96
  type: Injectable
97
97
  }], ctorParameters: () => [] });
98
98
 
@@ -280,12 +280,12 @@ class PhotoEditorPage {
280
280
  await this.editorInstance.applyFilter(filter.type, filter.option);
281
281
  this.$adoptFilter.set(filter);
282
282
  }
283
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoEditorPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
284
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: PhotoEditorPage, isStandalone: true, selector: "app-editor-image", inputs: { requireSquare: "requireSquare", value: "value", labels: "labels" }, providers: [HelperService], viewQueries: [{ propertyName: "editorRef", first: true, predicate: ["imageEditor"], descendants: true, static: true }, { propertyName: "ionContent", first: true, predicate: IonContent, descendants: true }], ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button (click)=\"modalCtrl.dismiss()\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"outline\"\n [disabled]=\"!['menu', 'filter'].includes($footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary.save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.$footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button (click)=\"$footerMenu.set('crop')\">\n <ion-text>{{ dictionary.crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('filter')\">\n <ion-text>{{ dictionary.filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('brightness')\">\n <ion-text>{{ dictionary.brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n }\n\n @if (this.$footerMenu() === 'filter') {\n <aside>\n @for (item of $filters(); track item) {\n <button (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n }\n\n @if (this.$footerMenu() === 'crop' && !requireSquare) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button (click)=\"changeCrop('cover')\" [color]=\"$currentCrop() === 'cover' ? 'success' : undefined\">\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('16/9')\" [color]=\"$currentCrop() === '16/9' ? 'success' : undefined\">\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('1')\" [color]=\"$currentCrop() === '1' ? 'success' : undefined\">\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('auto')\" [color]=\"$currentCrop() === 'auto' ? 'success' : undefined\">\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"rotate()\"><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n </ion-buttons>\n }\n\n @if (['brightness'].includes(this.$footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range [pin]=\"true\" [min]=\"-100\" [max]=\"100\" (ionChange)=\"changeRange($any($event))\"></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.$footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.$footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.$footerMenu.set('menu')\">\u623B\u308B</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare || $isCropped()) {\n <ion-button (click)=\"closeCrop('cancel')\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if ($footerMenu() === 'crop') {\n {{ dictionary.crop }}\n } @else if ($footerMenu() === 'brightness') {\n {{ dictionary.brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-content{--background: var(--editor-background)}ion-content>div{width:100%;height:100%;max-width:100%;max-height:100%;display:grid;align-items:center;justify-items:center}aside{display:flex;overflow-x:scroll;margin-top:16px;min-height:120px}aside ion-icon{color:var(--editor-color);border:1px solid var(--editor-background-tint);border-radius:50%;padding:16px}aside button{width:120px;display:block;flex:1;background:transparent;margin:0 8px 16px}aside button ion-text{display:block;color:var(--editor-color);margin-bottom:8px;font-size:.8rem}aside button span.image-filter-box{width:96px;height:64px;border-radius:8px;overflow:hidden;display:block;background-position:center,center;background-size:cover}ion-header ion-button,ion-footer ion-button{--color: var(--editor-color) !important}ion-footer ion-toolbar ion-text.footer-title{color:var(--editor-color)!important;display:block;text-align:center}ion-footer ion-toolbar ion-range{--bar-background: var(--editor-color);--bar-background-active: var(--editor-color);--bar-height: 2px;--bar-border-radius: 8px;--knob-background: var(--editor-color);--knob-size: 20px;--pin-background: none;--pin-color: var(--editor-color)}ion-footer ion-toolbar ion-buttons[slot=start] ion-button,ion-footer ion-toolbar ion-buttons[slot=end] ion-button{--background: var(--editor-background-tint) !important;--border-radius: 50%;margin:0 8px;min-width:32px;min-height:32px}ion-footer ion-toolbar ion-buttons.submenu-icon-buttons ion-button{margin:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i1.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonRange, selector: "ion-range", inputs: ["activeBarStart", "color", "debounce", "disabled", "dualKnobs", "label", "labelPlacement", "max", "min", "mode", "name", "pin", "pinFormatter", "snaps", "step", "ticks", "value"] }] }); }
283
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoEditorPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
284
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: PhotoEditorPage, isStandalone: true, selector: "app-editor-image", inputs: { requireSquare: "requireSquare", value: "value", labels: "labels" }, providers: [HelperService], viewQueries: [{ propertyName: "editorRef", first: true, predicate: ["imageEditor"], descendants: true, static: true }, { propertyName: "ionContent", first: true, predicate: IonContent, descendants: true }], ngImport: i0, template: "<ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button (click)=\"modalCtrl.dismiss()\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"outline\"\n [disabled]=\"!['menu', 'filter'].includes($footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary.save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.$footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button (click)=\"$footerMenu.set('crop')\">\n <ion-text>{{ dictionary.crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('filter')\">\n <ion-text>{{ dictionary.filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('brightness')\">\n <ion-text>{{ dictionary.brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n }\n\n @if (this.$footerMenu() === 'filter') {\n <aside>\n @for (item of $filters(); track item) {\n <button (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n }\n\n @if (this.$footerMenu() === 'crop' && !requireSquare) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button (click)=\"changeCrop('cover')\" [color]=\"$currentCrop() === 'cover' ? 'success' : undefined\">\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('16/9')\" [color]=\"$currentCrop() === '16/9' ? 'success' : undefined\">\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('1')\" [color]=\"$currentCrop() === '1' ? 'success' : undefined\">\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('auto')\" [color]=\"$currentCrop() === 'auto' ? 'success' : undefined\">\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"rotate()\"><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n </ion-buttons>\n }\n\n @if (['brightness'].includes(this.$footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range [pin]=\"true\" [min]=\"-100\" [max]=\"100\" (ionChange)=\"changeRange($any($event))\"></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.$footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.$footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.$footerMenu.set('menu')\">\u623B\u308B</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare || $isCropped()) {\n <ion-button (click)=\"closeCrop('cancel')\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if ($footerMenu() === 'crop') {\n {{ dictionary.crop }}\n } @else if ($footerMenu() === 'brightness') {\n {{ dictionary.brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-content{--background: var(--editor-background)}ion-content>div{width:100%;height:100%;max-width:100%;max-height:100%;display:grid;align-items:center;justify-items:center}aside{display:flex;overflow-x:scroll;margin-top:16px;min-height:120px}aside ion-icon{color:var(--editor-color);border:1px solid var(--editor-background-tint);border-radius:50%;padding:16px}aside button{width:120px;display:block;flex:1;background:transparent;margin:0 8px 16px}aside button ion-text{display:block;color:var(--editor-color);margin-bottom:8px;font-size:.8rem}aside button span.image-filter-box{width:96px;height:64px;border-radius:8px;overflow:hidden;display:block;background-position:center,center;background-size:cover}ion-header ion-button,ion-footer ion-button{--color: var(--editor-color) !important}ion-footer ion-toolbar ion-text.footer-title{color:var(--editor-color)!important;display:block;text-align:center}ion-footer ion-toolbar ion-range{--bar-background: var(--editor-color);--bar-background-active: var(--editor-color);--bar-height: 2px;--bar-border-radius: 8px;--knob-background: var(--editor-color);--knob-size: 20px;--pin-background: none;--pin-color: var(--editor-color)}ion-footer ion-toolbar ion-buttons[slot=start] ion-button,ion-footer ion-toolbar ion-buttons[slot=end] ion-button{--background: var(--editor-background-tint) !important;--border-radius: 50%;margin:0 8px;min-width:32px;min-height:32px}ion-footer ion-toolbar ion-buttons.submenu-icon-buttons ion-button{margin:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i1.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonText, selector: "ion-text", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonRange, selector: "ion-range", inputs: ["activeBarStart", "color", "debounce", "disabled", "dualKnobs", "label", "labelPlacement", "max", "min", "mode", "name", "pin", "pinFormatter", "snaps", "step", "ticks", "value"] }] }); }
285
285
  }
286
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoEditorPage, decorators: [{
286
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoEditorPage, decorators: [{
287
287
  type: Component,
288
- args: [{ selector: 'app-editor-image', imports: [CommonModule, FormsModule, NgOptimizedImage, ...ionComponents], providers: [HelperService], template: "<ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button (click)=\"modalCtrl.dismiss()\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"outline\"\n [disabled]=\"!['menu', 'filter'].includes($footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary.save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.$footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button (click)=\"$footerMenu.set('crop')\">\n <ion-text>{{ dictionary.crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('filter')\">\n <ion-text>{{ dictionary.filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('brightness')\">\n <ion-text>{{ dictionary.brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n }\n\n @if (this.$footerMenu() === 'filter') {\n <aside>\n @for (item of $filters(); track item) {\n <button (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n }\n\n @if (this.$footerMenu() === 'crop' && !requireSquare) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button (click)=\"changeCrop('cover')\" [color]=\"$currentCrop() === 'cover' ? 'success' : undefined\">\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('16/9')\" [color]=\"$currentCrop() === '16/9' ? 'success' : undefined\">\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('1')\" [color]=\"$currentCrop() === '1' ? 'success' : undefined\">\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('auto')\" [color]=\"$currentCrop() === 'auto' ? 'success' : undefined\">\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"rotate()\"><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n </ion-buttons>\n }\n\n @if (['brightness'].includes(this.$footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range [pin]=\"true\" [min]=\"-100\" [max]=\"100\" (ionChange)=\"changeRange($any($event))\"></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.$footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.$footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.$footerMenu.set('menu')\">\u623B\u308B</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare || $isCropped()) {\n <ion-button (click)=\"closeCrop('cancel')\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if ($footerMenu() === 'crop') {\n {{ dictionary.crop }}\n } @else if ($footerMenu() === 'brightness') {\n {{ dictionary.brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-content{--background: var(--editor-background)}ion-content>div{width:100%;height:100%;max-width:100%;max-height:100%;display:grid;align-items:center;justify-items:center}aside{display:flex;overflow-x:scroll;margin-top:16px;min-height:120px}aside ion-icon{color:var(--editor-color);border:1px solid var(--editor-background-tint);border-radius:50%;padding:16px}aside button{width:120px;display:block;flex:1;background:transparent;margin:0 8px 16px}aside button ion-text{display:block;color:var(--editor-color);margin-bottom:8px;font-size:.8rem}aside button span.image-filter-box{width:96px;height:64px;border-radius:8px;overflow:hidden;display:block;background-position:center,center;background-size:cover}ion-header ion-button,ion-footer ion-button{--color: var(--editor-color) !important}ion-footer ion-toolbar ion-text.footer-title{color:var(--editor-color)!important;display:block;text-align:center}ion-footer ion-toolbar ion-range{--bar-background: var(--editor-color);--bar-background-active: var(--editor-color);--bar-height: 2px;--bar-border-radius: 8px;--knob-background: var(--editor-color);--knob-size: 20px;--pin-background: none;--pin-color: var(--editor-color)}ion-footer ion-toolbar ion-buttons[slot=start] ion-button,ion-footer ion-toolbar ion-buttons[slot=end] ion-button{--background: var(--editor-background-tint) !important;--border-radius: 50%;margin:0 8px;min-width:32px;min-height:32px}ion-footer ion-toolbar ion-buttons.submenu-icon-buttons ion-button{margin:16px}\n"] }]
288
+ args: [{ selector: 'app-editor-image', imports: [CommonModule, FormsModule, ...ionComponents], providers: [HelperService], template: "<ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button (click)=\"modalCtrl.dismiss()\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"outline\"\n [disabled]=\"!['menu', 'filter'].includes($footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary.save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.$footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button (click)=\"$footerMenu.set('crop')\">\n <ion-text>{{ dictionary.crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('filter')\">\n <ion-text>{{ dictionary.filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('brightness')\">\n <ion-text>{{ dictionary.brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n }\n\n @if (this.$footerMenu() === 'filter') {\n <aside>\n @for (item of $filters(); track item) {\n <button (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n }\n\n @if (this.$footerMenu() === 'crop' && !requireSquare) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button (click)=\"changeCrop('cover')\" [color]=\"$currentCrop() === 'cover' ? 'success' : undefined\">\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('16/9')\" [color]=\"$currentCrop() === '16/9' ? 'success' : undefined\">\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('1')\" [color]=\"$currentCrop() === '1' ? 'success' : undefined\">\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('auto')\" [color]=\"$currentCrop() === 'auto' ? 'success' : undefined\">\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"rotate()\"><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n </ion-buttons>\n }\n\n @if (['brightness'].includes(this.$footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range [pin]=\"true\" [min]=\"-100\" [max]=\"100\" (ionChange)=\"changeRange($any($event))\"></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.$footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.$footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.$footerMenu.set('menu')\">\u623B\u308B</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare || $isCropped()) {\n <ion-button (click)=\"closeCrop('cancel')\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if ($footerMenu() === 'crop') {\n {{ dictionary.crop }}\n } @else if ($footerMenu() === 'brightness') {\n {{ dictionary.brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-content{--background: var(--editor-background)}ion-content>div{width:100%;height:100%;max-width:100%;max-height:100%;display:grid;align-items:center;justify-items:center}aside{display:flex;overflow-x:scroll;margin-top:16px;min-height:120px}aside ion-icon{color:var(--editor-color);border:1px solid var(--editor-background-tint);border-radius:50%;padding:16px}aside button{width:120px;display:block;flex:1;background:transparent;margin:0 8px 16px}aside button ion-text{display:block;color:var(--editor-color);margin-bottom:8px;font-size:.8rem}aside button span.image-filter-box{width:96px;height:64px;border-radius:8px;overflow:hidden;display:block;background-position:center,center;background-size:cover}ion-header ion-button,ion-footer ion-button{--color: var(--editor-color) !important}ion-footer ion-toolbar ion-text.footer-title{color:var(--editor-color)!important;display:block;text-align:center}ion-footer ion-toolbar ion-range{--bar-background: var(--editor-color);--bar-background-active: var(--editor-color);--bar-height: 2px;--bar-border-radius: 8px;--knob-background: var(--editor-color);--knob-size: 20px;--pin-background: none;--pin-color: var(--editor-color)}ion-footer ion-toolbar ion-buttons[slot=start] ion-button,ion-footer ion-toolbar ion-buttons[slot=end] ion-button{--background: var(--editor-background-tint) !important;--border-radius: 50%;margin:0 8px;min-width:32px;min-height:32px}ion-footer ion-toolbar ion-buttons.submenu-icon-buttons ion-button{margin:16px}\n"] }]
289
289
  }], ctorParameters: () => [], propDecorators: { requireSquare: [{
290
290
  type: Input
291
291
  }], value: [{
@@ -367,12 +367,12 @@ class PhotoViewerPage {
367
367
  },
368
368
  });
369
369
  }
370
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoViewerPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
371
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", type: PhotoViewerPage, isStandalone: true, selector: "app-photo-image", inputs: { imageUrls: "imageUrls", index: "index", isCircle: "isCircle", enableDelete: "enableDelete", enableFooterSafeArea: "enableFooterSafeArea", labels: "labels" }, providers: [HelperService], viewQueries: [{ propertyName: "swiper", first: true, predicate: ["swiper"], descendants: true }], ngImport: i0, template: "<ion-header [translucent]=\"true\">\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button (click)=\"modalCtrl.dismiss()\" class=\"viewer-close-button\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"outline\" (click)=\"remove()\">{{ dictionary.delete }}</ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\">\n <swiper-container #swiper>\n @for (url of imageUrls; track url) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" alt=\"\" [class.circle]=\"isCircle\" /></div>\n </swiper-slide>\n }\n </swiper-container>\n</ion-content>\n\n@if (enableFooterSafeArea) {\n <!-- use for safe area-->\n <ion-footer>\n <ion-toolbar style=\"--border-width: 0; --min-height: 0\"></ion-toolbar>\n </ion-footer>\n}\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-button.viewer-close-button{--color: var(--editor-color) !important}img.circle{border-radius:50%;display:block;padding:16px}swiper-container{height:100%;max-height:100%}swiper-slide{height:100%;max-height:100%;display:flex;justify-content:center;align-items:center}swiper-slide img{display:block;object-fit:contain;max-width:100%;max-height:100%}\n"], dependencies: [{ kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i1.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }] }); }
370
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoViewerPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
371
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.0", type: PhotoViewerPage, isStandalone: true, selector: "app-photo-image", inputs: { imageUrls: "imageUrls", index: "index", isCircle: "isCircle", enableDelete: "enableDelete", enableFooterSafeArea: "enableFooterSafeArea", labels: "labels" }, providers: [HelperService], viewQueries: [{ propertyName: "swiper", first: true, predicate: ["swiper"], descendants: true }], ngImport: i0, template: "<ion-header [translucent]=\"true\">\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button (click)=\"modalCtrl.dismiss()\" class=\"viewer-close-button\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"outline\" (click)=\"remove()\">{{ dictionary.delete }}</ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\">\n <swiper-container #swiper>\n @for (url of imageUrls; track url) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" alt=\"\" [class.circle]=\"isCircle\" /></div>\n </swiper-slide>\n }\n </swiper-container>\n</ion-content>\n\n@if (enableFooterSafeArea) {\n <!-- use for safe area-->\n <ion-footer>\n <ion-toolbar style=\"--border-width: 0; --min-height: 0\"></ion-toolbar>\n </ion-footer>\n}\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-button.viewer-close-button{--color: var(--editor-color) !important}img.circle{border-radius:50%;display:block;padding:16px}swiper-container{height:100%;max-height:100%}swiper-slide{height:100%;max-height:100%;display:flex;justify-content:center;align-items:center}swiper-slide img{display:block;object-fit:contain;max-width:100%;max-height:100%}\n"], dependencies: [{ kind: "component", type: i1.IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: i1.IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: i1.IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: i1.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: i1.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i1.IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: i1.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }] }); }
372
372
  }
373
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoViewerPage, decorators: [{
373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoViewerPage, decorators: [{
374
374
  type: Component,
375
- args: [{ selector: 'app-photo-image', imports: [NgFor, NgIf, ...ionComponents], schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [HelperService], template: "<ion-header [translucent]=\"true\">\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button (click)=\"modalCtrl.dismiss()\" class=\"viewer-close-button\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"outline\" (click)=\"remove()\">{{ dictionary.delete }}</ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\">\n <swiper-container #swiper>\n @for (url of imageUrls; track url) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" alt=\"\" [class.circle]=\"isCircle\" /></div>\n </swiper-slide>\n }\n </swiper-container>\n</ion-content>\n\n@if (enableFooterSafeArea) {\n <!-- use for safe area-->\n <ion-footer>\n <ion-toolbar style=\"--border-width: 0; --min-height: 0\"></ion-toolbar>\n </ion-footer>\n}\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-button.viewer-close-button{--color: var(--editor-color) !important}img.circle{border-radius:50%;display:block;padding:16px}swiper-container{height:100%;max-height:100%}swiper-slide{height:100%;max-height:100%;display:flex;justify-content:center;align-items:center}swiper-slide img{display:block;object-fit:contain;max-width:100%;max-height:100%}\n"] }]
375
+ args: [{ selector: 'app-photo-image', imports: [...ionComponents], schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [HelperService], template: "<ion-header [translucent]=\"true\">\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button (click)=\"modalCtrl.dismiss()\" class=\"viewer-close-button\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"outline\" (click)=\"remove()\">{{ dictionary.delete }}</ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\">\n <swiper-container #swiper>\n @for (url of imageUrls; track url) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" alt=\"\" [class.circle]=\"isCircle\" /></div>\n </swiper-slide>\n }\n </swiper-container>\n</ion-content>\n\n@if (enableFooterSafeArea) {\n <!-- use for safe area-->\n <ion-footer>\n <ion-toolbar style=\"--border-width: 0; --min-height: 0\"></ion-toolbar>\n </ion-footer>\n}\n", styles: [":host{--editor-background: var(--ion-photo-editor-background, --ion-color-step-100, #2a2a2a);--editor-background-tint: var(--ion-photo-editor-background-tint, --ion-color-step-200, #414141);--editor-color: var(--ion-photo-editor-color, --ion-color-step-950, #f0f0f0);--editor-color-tint: var(--ion-photo-editor-color-tint, --ion-color-step-850, #dbdbdb);--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, --ion-color-primary, #4d8dff);--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "ion-button.viewer-close-button{--color: var(--editor-color) !important}img.circle{border-radius:50%;display:block;padding:16px}swiper-container{height:100%;max-height:100%}swiper-slide{height:100%;max-height:100%;display:flex;justify-content:center;align-items:center}swiper-slide img{display:block;object-fit:contain;max-width:100%;max-height:100%}\n"] }]
376
376
  }], ctorParameters: () => [], propDecorators: { imageUrls: [{
377
377
  type: Input
378
378
  }], index: [{
@@ -526,10 +526,10 @@ class PhotoFileService {
526
526
  defaultInstance.destroy();
527
527
  return dataUrl;
528
528
  }
529
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
530
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoFileService, providedIn: 'root' }); }
529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
530
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoFileService, providedIn: 'root' }); }
531
531
  }
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: PhotoFileService, decorators: [{
532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0", ngImport: i0, type: PhotoFileService, decorators: [{
533
533
  type: Injectable,
534
534
  args: [{
535
535
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"rdlabo-ionic-angular-photo-editor.mjs","sources":["../../../projects/photo-editor/src/lib/filter-preset.ts","../../../projects/photo-editor/src/lib/service/helper.service.ts","../../../projects/photo-editor/src/lib/ion-components.ts","../../../projects/photo-editor/src/lib/dictionaries.ts","../../../projects/photo-editor/src/lib/pages/photo-editor.page.ts","../../../projects/photo-editor/src/lib/pages/photo-editor.page.html","../../../projects/photo-editor/src/lib/pages/photo-viewer.page.ts","../../../projects/photo-editor/src/lib/pages/photo-viewer.page.html","../../../projects/photo-editor/src/lib/photoEditorErrors.ts","../../../projects/photo-editor/src/lib/service/photo-file.service.ts","../../../projects/photo-editor/src/public-api.ts","../../../projects/photo-editor/src/rdlabo-ionic-angular-photo-editor.ts"],"sourcesContent":["import { IDictionaryForEditor, IFilterPreset } from './types';\n\nexport const filterPreset = (dictionary: IDictionaryForEditor): IFilterPreset[] => [\n {\n name: dictionary.original,\n type: 'Default',\n option: null,\n },\n // {\n // name: dictionary.invert,\n // type: 'Invert',\n // option: null,\n // },\n {\n name: dictionary.sepia,\n type: 'Sepia',\n option: null,\n },\n {\n name: dictionary.vintage,\n type: 'vintage',\n option: null,\n },\n {\n name: 'ぼかし',\n type: 'Blur',\n option: { blur: 0.1 },\n },\n {\n name: dictionary.grayscale,\n type: 'Grayscale',\n option: null,\n },\n // {\n // name: dictionary.sharpen,\n // type: 'Sharpen',\n // option: null,\n // },\n // {\n // name: dictionary.emboss,\n // type: 'Emboss',\n // option: null,\n // },\n];\n","import { Injectable } from '@angular/core';\nimport { addIcons } from 'ionicons';\nimport {\n checkmarkOutline,\n closeOutline,\n colorFilterOutline,\n cropOutline,\n expandOutline,\n refreshOutline,\n removeOutline,\n send,\n squareOutline,\n sunnyOutline,\n tabletLandscapeOutline,\n} from 'ionicons/icons';\n\n@Injectable()\nexport class HelperService {\n constructor() {}\n\n initializeViewerIcons(): void {\n addIcons({\n closeOutline,\n removeOutline,\n });\n }\n\n initializeEditorIcons(): void {\n addIcons({\n closeOutline,\n send,\n cropOutline,\n colorFilterOutline,\n sunnyOutline,\n expandOutline,\n tabletLandscapeOutline,\n squareOutline,\n refreshOutline,\n checkmarkOutline,\n });\n }\n\n waitToFindDom(nativeElement: HTMLElement, selector: string): Promise<void> {\n return new Promise<void>((resolve) => {\n const interval = setInterval(() => {\n const find = nativeElement.querySelector(selector);\n if (find) {\n clearInterval(interval);\n resolve();\n }\n });\n });\n }\n}\n","import { IonButton, IonButtons, IonContent, IonFooter, IonHeader, IonIcon, IonRange, IonText, IonToolbar } from '@ionic/angular/standalone';\n\nexport const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonText, IonRange];\n","import { IDictionaryForEditor, IDictionaryForService, IDictionaryForViewer } from './types';\n\nexport const dictionaryForEditor = (): IDictionaryForEditor => ({\n // UI labels\n save: '保存',\n crop: '切り抜き・回転',\n filter: 'フィルター',\n brightness: '明るさ',\n\n // Filter labels\n original: 'オリジナル',\n invert: '反転',\n sepia: 'セピア',\n vintage: 'ヴィンテージ',\n blur: 'ぼかし',\n grayscale: 'グレースケール',\n sharpen: '輪郭',\n emboss: 'エンボス',\n});\n\nexport const dictionaryForViewer = (): IDictionaryForViewer => ({\n // UI labels\n delete: '削除',\n});\n\nexport const dictionaryForService = (): IDictionaryForService => ({\n // UI labels\n camera: 'カメラ撮影',\n album: 'アルバムから選択',\n cancel: 'キャンセル',\n});\n","import { Component, ElementRef, inject, Input, OnDestroy, OnInit, signal, ViewChild } from '@angular/core';\nimport { CommonModule, NgOptimizedImage } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { IonContent, ModalController, RangeCustomEvent, ViewDidEnter, ViewDidLeave } from '@ionic/angular/standalone';\nimport ImageEditor from 'tui-image-editor';\nimport { filterPreset } from '../filter-preset';\nimport { Subscription } from 'rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { IDictionaryForEditor, IFilter, IPhotoEditorDismiss, ISize } from '../types';\nimport { HelperService } from '../service/helper.service';\nimport { ionComponents } from '../ion-components';\nimport { dictionaryForEditor } from '../dictionaries';\n\n@Component({\n selector: 'app-editor-image',\n templateUrl: './photo-editor.page.html',\n styleUrls: ['./core.scss', './photo-editor.page.scss'],\n imports: [CommonModule, FormsModule, NgOptimizedImage, ...ionComponents],\n providers: [HelperService],\n})\nexport class PhotoEditorPage implements OnInit, OnDestroy, ViewDidEnter, ViewDidLeave {\n protected dictionary: IDictionaryForEditor = dictionaryForEditor();\n protected filterPreset = filterPreset(this.dictionary);\n\n @Input() requireSquare: boolean = false;\n @Input() value!: string;\n @Input() set labels(d: IDictionaryForEditor) {\n this.dictionary = Object.assign(this.dictionary, d);\n this.filterPreset = filterPreset(this.dictionary);\n }\n\n @ViewChild('imageEditor', { static: true }) editorRef!: ElementRef;\n @ViewChild(IonContent) ionContent!: {\n el: IonContent & HTMLElement;\n };\n\n $filters = signal<IFilter[]>([]);\n $footerMenu = signal<'filter' | 'menu' | 'crop' | 'brightness'>('menu');\n $currentCrop = signal<'cover' | '16/9' | '1' | 'auto'>('cover');\n $currentRotate = signal<number>(0);\n $photoCrop = signal<ISize>({\n width: 0,\n height: 0,\n });\n $isCropped = signal<boolean>(false);\n\n private footerMenu$ = toObservable(this.$footerMenu);\n private $adoptFilter = signal<IFilter | undefined>(undefined);\n private editorInstance!: ImageEditor;\n private initSubscription$: Subscription[] = [];\n private readonly filterImageSize = 240;\n private readonly service = inject(HelperService);\n\n modalCtrl = inject(ModalController);\n\n private canvasContainerObserver: MutationObserver = new MutationObserver((mutationsList: MutationRecord[]) => {\n if (mutationsList.find((mutation) => mutation.type === 'attributes' && mutation.attributeName === 'style')) {\n // Cover the image editor with the parent element\n this.editorRef.nativeElement.style.minWidth = mutationsList[0].target.parentElement!.style.maxWidth;\n this.editorRef.nativeElement.style.minHeight = mutationsList[0].target.parentElement!.style.maxHeight;\n\n this.$photoCrop.set({\n width: mutationsList[0].target.parentElement!.querySelector('canvas')!.width,\n height: mutationsList[0].target.parentElement!.querySelector('canvas')!.height,\n });\n }\n });\n\n constructor() {\n this.service.initializeEditorIcons();\n }\n\n ngOnInit() {\n this.initSubscription$.push(\n this.footerMenu$.subscribe((value) => {\n if (value === 'filter') {\n this.initializeFilterMenu().then();\n }\n if (value === 'crop') {\n this.editorInstance.startDrawingMode('CROPPER');\n this.changeCrop(this.requireSquare ? '1' : 'cover');\n }\n }),\n );\n }\n\n ngOnDestroy() {\n this.initSubscription$.forEach((subscription) => subscription.unsubscribe());\n }\n\n async ionViewDidEnter() {\n this.editorInstance = new ImageEditor(this.editorRef.nativeElement, {\n cssMaxWidth: this.ionContent.el.clientWidth - 32,\n cssMaxHeight: this.ionContent.el.clientHeight - 32,\n });\n this.service.waitToFindDom(this.editorRef.nativeElement, '.tui-image-editor-canvas-container').then(() => {\n this.canvasContainerObserver.observe(this.editorRef.nativeElement.querySelector('.tui-image-editor-canvas-container'), {\n attributes: true,\n childList: false,\n subtree: true,\n });\n });\n const blob = await fetch(this.value).then((res) => res.blob());\n await this.editorInstance.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));\n this.$footerMenu.set(this.requireSquare ? 'crop' : 'menu');\n }\n\n ionViewDidLeave() {\n this.editorInstance.destroy();\n this.canvasContainerObserver.disconnect();\n }\n\n changeCrop(crop: 'cover' | '16/9' | '1' | 'auto') {\n const rect = crop === 'cover' ? this.$photoCrop().width / this.$photoCrop().height : crop === '16/9' ? 16 / 9 : 1;\n this.editorInstance.setCropzoneRect(crop !== 'auto' ? rect : undefined);\n this.$currentCrop.set(crop);\n }\n\n async rotate() {\n this.editorInstance.stopDrawingMode();\n await this.editorInstance.rotate(90);\n this.$currentRotate.update((value) => value + 90);\n this.editorInstance.startDrawingMode('CROPPER');\n requestAnimationFrame(() => this.changeCrop(this.$currentCrop()));\n }\n\n async closeCrop(type: 'cancel' | 'apply') {\n if (this.$footerMenu() === 'crop') {\n if (type === 'cancel') {\n await this.editorInstance.rotate(this.$currentRotate() * -1);\n } else {\n await this.editorInstance.crop(this.editorInstance.getCropzoneRect());\n this.$isCropped.set(true);\n }\n this.$currentRotate.set(0);\n this.$currentCrop.set('cover');\n this.editorInstance.stopDrawingMode();\n } else if (this.$footerMenu() === 'brightness') {\n if (type === 'cancel' && this.editorInstance.hasFilter('brightness')) {\n await this.editorInstance.removeFilter('brightness');\n }\n }\n this.$footerMenu.set('menu');\n }\n\n async changeRange(event: RangeCustomEvent) {\n if (this.editorInstance.hasFilter('brightness')) {\n await this.editorInstance.removeFilter('brightness');\n }\n this.editorInstance.applyFilter('brightness', {\n brightness: Number(event.detail.value) / 255,\n });\n }\n\n imageSave() {\n const value = this.editorInstance.toDataURL();\n this.modalCtrl.dismiss({ value } as IPhotoEditorDismiss);\n }\n\n private async initializeFilterMenu() {\n const filters: IFilter[] = [];\n\n const defaultInstance = new ImageEditor(document.createElement('div'), {\n cssMaxWidth: this.filterImageSize,\n cssMaxHeight: (this.$photoCrop().height * this.filterImageSize) / this.$photoCrop().width,\n });\n const blob = await fetch(\n this.editorInstance.toDataURL({\n multiplier: this.filterImageSize / this.$photoCrop().width,\n }),\n ).then((res) => res.blob());\n await defaultInstance.loadImageFromFile(new File([blob], 'defaultInstance.png', { type: blob.type }));\n\n for (const filter of this.filterPreset) {\n if (filter.type !== 'Default') {\n await defaultInstance.applyFilter(filter.type, filter.option);\n }\n filters.push({\n name: filter.name,\n type: filter.type,\n option: filter.option,\n data: defaultInstance.toDataURL(),\n width: this.filterImageSize,\n height: (this.$photoCrop().height * this.filterImageSize) / this.$photoCrop().width,\n });\n if (filter.type !== 'Default') {\n await defaultInstance.removeFilter(filter.type);\n }\n }\n this.$filters.set(filters);\n defaultInstance.destroy();\n }\n\n async filterImage(filter: IFilter) {\n if (this.$adoptFilter()) {\n await this.editorInstance.removeFilter(this.$adoptFilter()!.type);\n }\n if (filter.type === 'Default') {\n this.$adoptFilter.set(undefined);\n return;\n }\n await this.editorInstance.applyFilter(filter.type, filter.option);\n this.$adoptFilter.set(filter);\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button (click)=\"modalCtrl.dismiss()\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"outline\"\n [disabled]=\"!['menu', 'filter'].includes($footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary.save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.$footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button (click)=\"$footerMenu.set('crop')\">\n <ion-text>{{ dictionary.crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('filter')\">\n <ion-text>{{ dictionary.filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('brightness')\">\n <ion-text>{{ dictionary.brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n }\n\n @if (this.$footerMenu() === 'filter') {\n <aside>\n @for (item of $filters(); track item) {\n <button (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n }\n\n @if (this.$footerMenu() === 'crop' && !requireSquare) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button (click)=\"changeCrop('cover')\" [color]=\"$currentCrop() === 'cover' ? 'success' : undefined\">\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('16/9')\" [color]=\"$currentCrop() === '16/9' ? 'success' : undefined\">\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('1')\" [color]=\"$currentCrop() === '1' ? 'success' : undefined\">\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('auto')\" [color]=\"$currentCrop() === 'auto' ? 'success' : undefined\">\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"rotate()\"><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n </ion-buttons>\n }\n\n @if (['brightness'].includes(this.$footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range [pin]=\"true\" [min]=\"-100\" [max]=\"100\" (ionChange)=\"changeRange($any($event))\"></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.$footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.$footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.$footerMenu.set('menu')\">戻る</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare || $isCropped()) {\n <ion-button (click)=\"closeCrop('cancel')\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if ($footerMenu() === 'crop') {\n {{ dictionary.crop }}\n } @else if ($footerMenu() === 'brightness') {\n {{ dictionary.brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n","import { Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, inject, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { IonicSlides, ModalController } from '@ionic/angular/standalone';\nimport { Navigation, Zoom } from 'swiper/modules';\nimport { fromEvent, Subscription, throttleTime, withLatestFrom, zipWith } from 'rxjs';\nimport { NgFor, NgIf } from '@angular/common';\nimport { SwiperContainer } from 'swiper/element';\nimport { ionComponents } from '../ion-components';\nimport { HelperService } from '../service/helper.service';\nimport { IDictionaryForViewer, IPhotoViewerDismiss } from '../types';\nimport { register } from 'swiper/element/bundle';\nimport { dictionaryForViewer } from '../dictionaries';\n\n@Component({\n selector: 'app-photo-image',\n templateUrl: './photo-viewer.page.html',\n styleUrls: ['./core.scss', './photo-viewer.page.scss'],\n imports: [NgFor, NgIf, ...ionComponents],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n providers: [HelperService],\n})\nexport class PhotoViewerPage implements OnInit, OnDestroy {\n protected dictionary: IDictionaryForViewer = dictionaryForViewer();\n\n @Input() imageUrls: string[] = [];\n @Input() index: number = 0;\n @Input() isCircle = false;\n @Input() enableDelete = false;\n @Input() enableFooterSafeArea = false;\n @Input() set labels(d: IDictionaryForViewer) {\n this.dictionary = Object.assign(this.dictionary, d);\n }\n\n @ViewChild('swiper') swiper!: ElementRef<SwiperContainer>;\n\n watchSwipe$!: Subscription;\n readonly modalCtrl = inject(ModalController);\n private readonly el = inject(ElementRef);\n private readonly service = inject(HelperService);\n\n constructor() {\n register();\n this.service.initializeViewerIcons();\n }\n\n async ngOnInit() {\n this.service.waitToFindDom(this.el.nativeElement, 'swiper-container').then(() => {\n Object.assign(this.swiper.nativeElement, {\n modules: [Navigation, Zoom, IonicSlides],\n initialSlide: this.index,\n slidesPerView: 1,\n pagination: {\n enabled: true,\n clickable: true,\n },\n zoom: true,\n });\n this.swiper.nativeElement.initialize();\n this.swiper.nativeElement.swiper.zoom.enable();\n\n this.swiper.nativeElement.swiper.activeIndex = this.index;\n this.swiper.nativeElement.swiper.update();\n });\n\n this.watchSwipe$ = fromEvent<TouchEvent>(this.el.nativeElement, 'touchstart')\n .pipe(\n zipWith(\n fromEvent<TouchEvent>(this.el.nativeElement, 'touchend').pipe(\n withLatestFrom(fromEvent<TouchEvent>(this.el.nativeElement, 'touchmove')),\n ),\n ),\n throttleTime(1),\n )\n .subscribe(([touchstart, [_, touchmove]]) => {\n const touchstartClientX = touchstart.touches ? touchstart.touches[0].clientX : (touchstart as any).detail[1].clientX;\n const touchmoveClientX = touchmove.touches ? touchmove.touches[0].clientX : (touchmove as any).detail[1].clientX;\n\n const touchstartClientY = touchstart.touches ? touchstart.touches[0].clientY : (touchstart as any).detail[1].clientY;\n const touchmoveClientY = touchmove.touches ? touchmove.touches[0].clientY : (touchmove as any).detail[1].clientY;\n\n const xDiff = touchstartClientX - touchmoveClientX;\n const yDiff = touchstartClientY - touchmoveClientY;\n\n const slides = (this.swiper as any).nativeElement.querySelectorAll('swiper-slide') as HTMLElement[];\n const isZoomed = Array.from(slides).find((slide: HTMLElement) => {\n return ['swiper-slide-zoomed', 'swiper-slide-active'].every((c) => slide.classList.contains(c));\n });\n\n const threshold = touchmove.touches ? -50 : -5;\n\n if (!isZoomed && Math.abs(xDiff) < Math.abs(threshold) && yDiff < threshold && touchstart.timeStamp <= touchmove.timeStamp) {\n this.watchSwipe$.unsubscribe();\n this.modalCtrl.dismiss();\n }\n });\n }\n\n ngOnDestroy() {\n if (this.watchSwipe$ && !this.watchSwipe$.closed) {\n this.watchSwipe$.unsubscribe();\n }\n }\n\n remove() {\n this.modalCtrl.dismiss({\n delete: {\n index: this.swiper.nativeElement.swiper.activeIndex,\n value: this.imageUrls[this.swiper.nativeElement.swiper.activeIndex],\n },\n } as IPhotoViewerDismiss);\n }\n}\n","<ion-header [translucent]=\"true\">\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button (click)=\"modalCtrl.dismiss()\" class=\"viewer-close-button\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"outline\" (click)=\"remove()\">{{ dictionary.delete }}</ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\">\n <swiper-container #swiper>\n @for (url of imageUrls; track url) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" alt=\"\" [class.circle]=\"isCircle\" /></div>\n </swiper-slide>\n }\n </swiper-container>\n</ion-content>\n\n@if (enableFooterSafeArea) {\n <!-- use for safe area-->\n <ion-footer>\n <ion-toolbar style=\"--border-width: 0; --min-height: 0\"></ion-toolbar>\n </ion-footer>\n}\n","export enum PhotoEditorErrors {\n 'initialize' = 'input dom is not found',\n 'cancel' = 'user canceled',\n 'type' = 'upload file is not image.',\n}\n","import { inject, Injectable, signal } from '@angular/core';\nimport { ActionSheetController, Platform } from '@ionic/angular/standalone';\nimport { Camera, CameraResultType, CameraSource, ImageOptions } from '@capacitor/camera';\nimport ImageEditor from 'tui-image-editor';\nimport { PhotoEditorErrors } from '../photoEditorErrors';\nimport { dictionaryForService } from '../dictionaries';\nimport { IDictionaryForService } from '../types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PhotoFileService {\n private readonly $photoMaxSize = signal<number>(1000);\n private readonly actionSheetCtrl = inject(ActionSheetController);\n private readonly platform = inject(Platform);\n private dictionary: IDictionaryForService = dictionaryForService();\n\n constructor() {}\n\n set photoMaxSize(value: number) {\n this.$photoMaxSize.set(value);\n }\n\n set labels(d: IDictionaryForService) {\n this.dictionary = Object.assign(this.dictionary, d);\n }\n\n async loadPhoto(limit: number): Promise<string[]> {\n /**\n * Using Input for browser\n */\n if (!this.platform.is('capacitor')) {\n return this.getPictureFromBrowser();\n }\n\n const actionSheet = await this.actionSheetCtrl.create({\n buttons: [\n {\n text: this.dictionary.camera,\n handler: () => {\n actionSheet.dismiss('camera');\n },\n },\n {\n text: this.dictionary.album,\n handler: () => {\n actionSheet.dismiss('album');\n },\n },\n {\n text: this.dictionary.cancel,\n role: 'cancel',\n },\n ],\n });\n await actionSheet.present();\n const { data } = await actionSheet.onDidDismiss<'camera' | 'album'>();\n if (!data) {\n return Promise.reject(PhotoEditorErrors.cancel);\n }\n\n if (data === 'camera') {\n const defaultCamera: ImageOptions = {\n quality: 100,\n width: this.$photoMaxSize(),\n allowEditing: false,\n resultType: CameraResultType.DataUrl,\n source: CameraSource.Camera,\n presentationStyle: 'popover',\n };\n const image = await Camera.getPhoto(defaultCamera).catch(() => undefined);\n if (!image?.dataUrl) {\n return Promise.reject(PhotoEditorErrors.cancel);\n }\n\n if (!image.dataUrl.includes('capacitor://localhost')) {\n return [image.dataUrl];\n }\n return Promise.all([image.dataUrl].map(async (image) => await this.loadPhotoFromFilePath(image)));\n }\n\n if (data === 'album') {\n const images = await Camera.pickImages({\n quality: 100,\n width: this.$photoMaxSize(),\n limit,\n presentationStyle: 'popover',\n }).catch(() => undefined);\n\n if (!images) {\n return Promise.reject(PhotoEditorErrors.cancel);\n }\n\n return Promise.all(images.photos.map(async (image) => await this.loadPhotoFromFilePath(image.webPath)));\n }\n\n // Not run on this line. This is for lint\n return [];\n }\n\n private getPictureFromBrowser(): Promise<string[]> {\n const inputFile: HTMLInputElement | null = document.querySelector('input#browserPhotoUploader');\n\n if (!inputFile) {\n return Promise.reject(PhotoEditorErrors.initialize);\n }\n\n return new Promise((resolve, reject) => {\n const cancelMethod = (e: Event) => {\n inputFile!.removeEventListener('cancel', cancelMethod, false);\n inputFile!.removeEventListener('change', changeMethod, false);\n\n reject(PhotoEditorErrors.cancel);\n };\n const changeMethod = (e: Event) => {\n inputFile!.removeEventListener('cancel', cancelMethod, false);\n inputFile!.removeEventListener('change', changeMethod, false);\n\n if (!(e.target as HTMLInputElement).files || !(e.target as HTMLInputElement).files![0]) {\n reject(PhotoEditorErrors.cancel);\n }\n const file = (e.target as HTMLInputElement).files![0];\n const reader = new FileReader();\n\n reader.onload = (() => {\n if (file.type.indexOf('image') < 0) {\n reject(PhotoEditorErrors.type);\n }\n\n return async (event) => {\n inputFile.value = '';\n const result = event.target!.result as string;\n const data = await this.loadPhotoFromFilePath(result);\n resolve([data]);\n };\n })();\n\n reader.readAsDataURL(file);\n };\n\n inputFile!.addEventListener('cancel', cancelMethod, false);\n inputFile!.addEventListener('change', changeMethod, false);\n inputFile.click();\n });\n }\n\n private async loadPhotoFromFilePath(filePath: string): Promise<string> {\n const defaultInstance = new ImageEditor(document.createElement('div'), {\n cssMaxWidth: this.$photoMaxSize(),\n cssMaxHeight: this.$photoMaxSize(),\n });\n const blob = await fetch(filePath).then((res) => res.blob());\n const loaded = await defaultInstance.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));\n\n const maxSize = Math.max(loaded.newWidth, loaded.newHeight);\n const dataUrl = defaultInstance.toDataURL({\n multiplier: this.$photoMaxSize() / maxSize,\n });\n defaultInstance.destroy();\n\n return dataUrl;\n }\n}\n","/*\n * Public API Surface of photo-editor\n */\n\nexport * from './lib/pages/photo-editor.page';\nexport * from './lib/pages/photo-viewer.page';\nexport * from './lib/service/photo-file.service';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEO,MAAM,YAAY,GAAG,CAAC,UAAgC,KAAsB;AACjF,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,QAAQ;AACzB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;;;;;;AAMD,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,KAAK;AACtB,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;AACD,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,OAAO;AACxB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;AACtB,KAAA;AACD,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,SAAS;AAC1B,QAAA,IAAI,EAAE,WAAW;AACjB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GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC;AAC3D,QAAA,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,CAAC;AACxC,YAAA,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,OAAO;AAC3C,SAAA,CAAC;QACF,eAAe,CAAC,OAAO,EAAE;AAEzB,QAAA,OAAO,OAAO;;8GArJL,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"rdlabo-ionic-angular-photo-editor.mjs","sources":["../../../projects/photo-editor/src/lib/filter-preset.ts","../../../projects/photo-editor/src/lib/service/helper.service.ts","../../../projects/photo-editor/src/lib/ion-components.ts","../../../projects/photo-editor/src/lib/dictionaries.ts","../../../projects/photo-editor/src/lib/pages/photo-editor.page.ts","../../../projects/photo-editor/src/lib/pages/photo-editor.page.html","../../../projects/photo-editor/src/lib/pages/photo-viewer.page.ts","../../../projects/photo-editor/src/lib/pages/photo-viewer.page.html","../../../projects/photo-editor/src/lib/photoEditorErrors.ts","../../../projects/photo-editor/src/lib/service/photo-file.service.ts","../../../projects/photo-editor/src/public-api.ts","../../../projects/photo-editor/src/rdlabo-ionic-angular-photo-editor.ts"],"sourcesContent":["import { IDictionaryForEditor, IFilterPreset } from './types';\n\nexport const filterPreset = (dictionary: IDictionaryForEditor): IFilterPreset[] => [\n {\n name: dictionary.original,\n type: 'Default',\n option: null,\n },\n // {\n // name: dictionary.invert,\n // type: 'Invert',\n // option: null,\n // },\n {\n name: dictionary.sepia,\n type: 'Sepia',\n option: null,\n },\n {\n name: dictionary.vintage,\n type: 'vintage',\n option: null,\n },\n {\n name: 'ぼかし',\n type: 'Blur',\n option: { blur: 0.1 },\n },\n {\n name: dictionary.grayscale,\n type: 'Grayscale',\n option: null,\n },\n // {\n // name: dictionary.sharpen,\n // type: 'Sharpen',\n // option: null,\n // },\n // {\n // name: dictionary.emboss,\n // type: 'Emboss',\n // option: null,\n // },\n];\n","import { Injectable } from '@angular/core';\nimport { addIcons } from 'ionicons';\nimport {\n checkmarkOutline,\n closeOutline,\n colorFilterOutline,\n cropOutline,\n expandOutline,\n refreshOutline,\n removeOutline,\n send,\n squareOutline,\n sunnyOutline,\n tabletLandscapeOutline,\n} from 'ionicons/icons';\n\n@Injectable()\nexport class HelperService {\n constructor() {}\n\n initializeViewerIcons(): void {\n addIcons({\n closeOutline,\n removeOutline,\n });\n }\n\n initializeEditorIcons(): void {\n addIcons({\n closeOutline,\n send,\n cropOutline,\n colorFilterOutline,\n sunnyOutline,\n expandOutline,\n tabletLandscapeOutline,\n squareOutline,\n refreshOutline,\n checkmarkOutline,\n });\n }\n\n waitToFindDom(nativeElement: HTMLElement, selector: string): Promise<void> {\n return new Promise<void>((resolve) => {\n const interval = setInterval(() => {\n const find = nativeElement.querySelector(selector);\n if (find) {\n clearInterval(interval);\n resolve();\n }\n });\n });\n }\n}\n","import { IonButton, IonButtons, IonContent, IonFooter, IonHeader, IonIcon, IonRange, IonText, IonToolbar } from '@ionic/angular/standalone';\n\nexport const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, IonText, IonRange];\n","import { IDictionaryForEditor, IDictionaryForService, IDictionaryForViewer } from './types';\n\nexport const dictionaryForEditor = (): IDictionaryForEditor => ({\n // UI labels\n save: '保存',\n crop: '切り抜き・回転',\n filter: 'フィルター',\n brightness: '明るさ',\n\n // Filter labels\n original: 'オリジナル',\n invert: '反転',\n sepia: 'セピア',\n vintage: 'ヴィンテージ',\n blur: 'ぼかし',\n grayscale: 'グレースケール',\n sharpen: '輪郭',\n emboss: 'エンボス',\n});\n\nexport const dictionaryForViewer = (): IDictionaryForViewer => ({\n // UI labels\n delete: '削除',\n});\n\nexport const dictionaryForService = (): IDictionaryForService => ({\n // UI labels\n camera: 'カメラ撮影',\n album: 'アルバムから選択',\n cancel: 'キャンセル',\n});\n","import { Component, ElementRef, inject, Input, OnDestroy, OnInit, signal, ViewChild } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { IonContent, ModalController, RangeCustomEvent, ViewDidEnter, ViewDidLeave } from '@ionic/angular/standalone';\nimport ImageEditor from 'tui-image-editor';\nimport { filterPreset } from '../filter-preset';\nimport { Subscription } from 'rxjs';\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { IDictionaryForEditor, IFilter, IPhotoEditorDismiss, ISize } from '../types';\nimport { HelperService } from '../service/helper.service';\nimport { ionComponents } from '../ion-components';\nimport { dictionaryForEditor } from '../dictionaries';\n\n@Component({\n selector: 'app-editor-image',\n templateUrl: './photo-editor.page.html',\n styleUrls: ['./core.scss', './photo-editor.page.scss'],\n imports: [CommonModule, FormsModule, ...ionComponents],\n providers: [HelperService],\n})\nexport class PhotoEditorPage implements OnInit, OnDestroy, ViewDidEnter, ViewDidLeave {\n protected dictionary: IDictionaryForEditor = dictionaryForEditor();\n protected filterPreset = filterPreset(this.dictionary);\n\n @Input() requireSquare: boolean = false;\n @Input() value!: string;\n @Input() set labels(d: IDictionaryForEditor) {\n this.dictionary = Object.assign(this.dictionary, d);\n this.filterPreset = filterPreset(this.dictionary);\n }\n\n @ViewChild('imageEditor', { static: true }) editorRef!: ElementRef;\n @ViewChild(IonContent) ionContent!: {\n el: IonContent & HTMLElement;\n };\n\n $filters = signal<IFilter[]>([]);\n $footerMenu = signal<'filter' | 'menu' | 'crop' | 'brightness'>('menu');\n $currentCrop = signal<'cover' | '16/9' | '1' | 'auto'>('cover');\n $currentRotate = signal<number>(0);\n $photoCrop = signal<ISize>({\n width: 0,\n height: 0,\n });\n $isCropped = signal<boolean>(false);\n\n private footerMenu$ = toObservable(this.$footerMenu);\n private $adoptFilter = signal<IFilter | undefined>(undefined);\n private editorInstance!: ImageEditor;\n private initSubscription$: Subscription[] = [];\n private readonly filterImageSize = 240;\n private readonly service = inject(HelperService);\n\n modalCtrl = inject(ModalController);\n\n private canvasContainerObserver: MutationObserver = new MutationObserver((mutationsList: MutationRecord[]) => {\n if (mutationsList.find((mutation) => mutation.type === 'attributes' && mutation.attributeName === 'style')) {\n // Cover the image editor with the parent element\n this.editorRef.nativeElement.style.minWidth = mutationsList[0].target.parentElement!.style.maxWidth;\n this.editorRef.nativeElement.style.minHeight = mutationsList[0].target.parentElement!.style.maxHeight;\n\n this.$photoCrop.set({\n width: mutationsList[0].target.parentElement!.querySelector('canvas')!.width,\n height: mutationsList[0].target.parentElement!.querySelector('canvas')!.height,\n });\n }\n });\n\n constructor() {\n this.service.initializeEditorIcons();\n }\n\n ngOnInit() {\n this.initSubscription$.push(\n this.footerMenu$.subscribe((value) => {\n if (value === 'filter') {\n this.initializeFilterMenu().then();\n }\n if (value === 'crop') {\n this.editorInstance.startDrawingMode('CROPPER');\n this.changeCrop(this.requireSquare ? '1' : 'cover');\n }\n }),\n );\n }\n\n ngOnDestroy() {\n this.initSubscription$.forEach((subscription) => subscription.unsubscribe());\n }\n\n async ionViewDidEnter() {\n this.editorInstance = new ImageEditor(this.editorRef.nativeElement, {\n cssMaxWidth: this.ionContent.el.clientWidth - 32,\n cssMaxHeight: this.ionContent.el.clientHeight - 32,\n });\n this.service.waitToFindDom(this.editorRef.nativeElement, '.tui-image-editor-canvas-container').then(() => {\n this.canvasContainerObserver.observe(this.editorRef.nativeElement.querySelector('.tui-image-editor-canvas-container'), {\n attributes: true,\n childList: false,\n subtree: true,\n });\n });\n const blob = await fetch(this.value).then((res) => res.blob());\n await this.editorInstance.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));\n this.$footerMenu.set(this.requireSquare ? 'crop' : 'menu');\n }\n\n ionViewDidLeave() {\n this.editorInstance.destroy();\n this.canvasContainerObserver.disconnect();\n }\n\n changeCrop(crop: 'cover' | '16/9' | '1' | 'auto') {\n const rect = crop === 'cover' ? this.$photoCrop().width / this.$photoCrop().height : crop === '16/9' ? 16 / 9 : 1;\n this.editorInstance.setCropzoneRect(crop !== 'auto' ? rect : undefined);\n this.$currentCrop.set(crop);\n }\n\n async rotate() {\n this.editorInstance.stopDrawingMode();\n await this.editorInstance.rotate(90);\n this.$currentRotate.update((value) => value + 90);\n this.editorInstance.startDrawingMode('CROPPER');\n requestAnimationFrame(() => this.changeCrop(this.$currentCrop()));\n }\n\n async closeCrop(type: 'cancel' | 'apply') {\n if (this.$footerMenu() === 'crop') {\n if (type === 'cancel') {\n await this.editorInstance.rotate(this.$currentRotate() * -1);\n } else {\n await this.editorInstance.crop(this.editorInstance.getCropzoneRect());\n this.$isCropped.set(true);\n }\n this.$currentRotate.set(0);\n this.$currentCrop.set('cover');\n this.editorInstance.stopDrawingMode();\n } else if (this.$footerMenu() === 'brightness') {\n if (type === 'cancel' && this.editorInstance.hasFilter('brightness')) {\n await this.editorInstance.removeFilter('brightness');\n }\n }\n this.$footerMenu.set('menu');\n }\n\n async changeRange(event: RangeCustomEvent) {\n if (this.editorInstance.hasFilter('brightness')) {\n await this.editorInstance.removeFilter('brightness');\n }\n this.editorInstance.applyFilter('brightness', {\n brightness: Number(event.detail.value) / 255,\n });\n }\n\n imageSave() {\n const value = this.editorInstance.toDataURL();\n this.modalCtrl.dismiss({ value } as IPhotoEditorDismiss);\n }\n\n private async initializeFilterMenu() {\n const filters: IFilter[] = [];\n\n const defaultInstance = new ImageEditor(document.createElement('div'), {\n cssMaxWidth: this.filterImageSize,\n cssMaxHeight: (this.$photoCrop().height * this.filterImageSize) / this.$photoCrop().width,\n });\n const blob = await fetch(\n this.editorInstance.toDataURL({\n multiplier: this.filterImageSize / this.$photoCrop().width,\n }),\n ).then((res) => res.blob());\n await defaultInstance.loadImageFromFile(new File([blob], 'defaultInstance.png', { type: blob.type }));\n\n for (const filter of this.filterPreset) {\n if (filter.type !== 'Default') {\n await defaultInstance.applyFilter(filter.type, filter.option);\n }\n filters.push({\n name: filter.name,\n type: filter.type,\n option: filter.option,\n data: defaultInstance.toDataURL(),\n width: this.filterImageSize,\n height: (this.$photoCrop().height * this.filterImageSize) / this.$photoCrop().width,\n });\n if (filter.type !== 'Default') {\n await defaultInstance.removeFilter(filter.type);\n }\n }\n this.$filters.set(filters);\n defaultInstance.destroy();\n }\n\n async filterImage(filter: IFilter) {\n if (this.$adoptFilter()) {\n await this.editorInstance.removeFilter(this.$adoptFilter()!.type);\n }\n if (filter.type === 'Default') {\n this.$adoptFilter.set(undefined);\n return;\n }\n await this.editorInstance.applyFilter(filter.type, filter.option);\n this.$adoptFilter.set(filter);\n }\n}\n","<ion-header>\n <ion-toolbar>\n <ion-buttons slot=\"start\"\n ><ion-button (click)=\"modalCtrl.dismiss()\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n <ion-buttons slot=\"end\">\n <ion-button\n color=\"photo-editor-primary\"\n fill=\"outline\"\n [disabled]=\"!['menu', 'filter'].includes($footerMenu())\"\n (click)=\"imageSave()\"\n >\n {{ dictionary.save }}\n </ion-button>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\" [scrollY]=\"false\">\n <div #imageEditor></div>\n</ion-content>\n<ion-footer>\n <ion-toolbar>\n @if (this.$footerMenu() === 'menu') {\n <aside class=\"ion-justify-content-center\">\n <button (click)=\"$footerMenu.set('crop')\">\n <ion-text>{{ dictionary.crop }}</ion-text>\n <ion-icon name=\"crop-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('filter')\">\n <ion-text>{{ dictionary.filter }}</ion-text>\n <ion-icon name=\"color-filter-outline\" size=\"large\"></ion-icon>\n </button>\n <button (click)=\"$footerMenu.set('brightness')\">\n <ion-text>{{ dictionary.brightness }}</ion-text>\n <ion-icon name=\"sunny-outline\" size=\"large\"></ion-icon>\n </button>\n </aside>\n }\n\n @if (this.$footerMenu() === 'filter') {\n <aside>\n @for (item of $filters(); track item) {\n <button (click)=\"filterImage(item)\">\n <ion-text>{{ item.name }}</ion-text>\n <span class=\"image-filter-box\" [style.background-image]=\"'url(' + item.data + ')'\"></span>\n </button>\n }\n </aside>\n }\n\n @if (this.$footerMenu() === 'crop' && !requireSquare) {\n <ion-buttons class=\"ion-justify-content-center submenu-icon-buttons\">\n <ion-button (click)=\"changeCrop('cover')\" [color]=\"$currentCrop() === 'cover' ? 'success' : undefined\">\n <ion-icon name=\"expand-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('16/9')\" [color]=\"$currentCrop() === '16/9' ? 'success' : undefined\">\n <ion-icon name=\"tablet-landscape-outline\" slot=\"icon-only\" style=\"transform: scale(1, 0.8)\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('1')\" [color]=\"$currentCrop() === '1' ? 'success' : undefined\">\n <ion-icon name=\"square-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"changeCrop('auto')\" [color]=\"$currentCrop() === 'auto' ? 'success' : undefined\">\n <ion-icon name=\"crop-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n <ion-button (click)=\"rotate()\"><ion-icon name=\"refresh-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n </ion-buttons>\n }\n\n @if (['brightness'].includes(this.$footerMenu())) {\n <div class=\"ion-padding ion-margin\">\n <ion-range [pin]=\"true\" [min]=\"-100\" [max]=\"100\" (ionChange)=\"changeRange($any($event))\"></ion-range>\n </div>\n }\n </ion-toolbar>\n @if (this.$footerMenu() !== 'menu') {\n <ion-toolbar mode=\"md\">\n @if (this.$footerMenu() === 'filter') {\n <ion-buttons class=\"ion-justify-content-center\" style=\"margin: 0 8px\">\n <ion-button fill=\"outline\" shape=\"round\" (click)=\"this.$footerMenu.set('menu')\">戻る</ion-button>\n </ion-buttons>\n } @else {\n <ion-buttons slot=\"start\" style=\"min-width: 60px\">\n @if (!requireSquare || $isCropped()) {\n <ion-button (click)=\"closeCrop('cancel')\"><ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon></ion-button>\n }</ion-buttons\n ><ion-text class=\"footer-title\">\n @if ($footerMenu() === 'crop') {\n {{ dictionary.crop }}\n } @else if ($footerMenu() === 'brightness') {\n {{ dictionary.brightness }}\n }</ion-text\n ><ion-buttons slot=\"end\"\n ><ion-button (click)=\"closeCrop('apply')\"\n ><ion-icon name=\"checkmark-outline\" color=\"photo-editor-success\" slot=\"icon-only\"></ion-icon></ion-button\n ></ion-buttons>\n }\n </ion-toolbar>\n }\n</ion-footer>\n","import { Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, inject, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';\nimport { IonicSlides, ModalController } from '@ionic/angular/standalone';\nimport { Navigation, Zoom } from 'swiper/modules';\nimport { fromEvent, Subscription, throttleTime, withLatestFrom, zipWith } from 'rxjs';\nimport { SwiperContainer } from 'swiper/element';\nimport { ionComponents } from '../ion-components';\nimport { HelperService } from '../service/helper.service';\nimport { IDictionaryForViewer, IPhotoViewerDismiss } from '../types';\nimport { register } from 'swiper/element/bundle';\nimport { dictionaryForViewer } from '../dictionaries';\n\n@Component({\n selector: 'app-photo-image',\n templateUrl: './photo-viewer.page.html',\n styleUrls: ['./core.scss', './photo-viewer.page.scss'],\n imports: [...ionComponents],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n providers: [HelperService],\n})\nexport class PhotoViewerPage implements OnInit, OnDestroy {\n protected dictionary: IDictionaryForViewer = dictionaryForViewer();\n\n @Input() imageUrls: string[] = [];\n @Input() index: number = 0;\n @Input() isCircle = false;\n @Input() enableDelete = false;\n @Input() enableFooterSafeArea = false;\n @Input() set labels(d: IDictionaryForViewer) {\n this.dictionary = Object.assign(this.dictionary, d);\n }\n\n @ViewChild('swiper') swiper!: ElementRef<SwiperContainer>;\n\n watchSwipe$!: Subscription;\n readonly modalCtrl = inject(ModalController);\n private readonly el = inject(ElementRef);\n private readonly service = inject(HelperService);\n\n constructor() {\n register();\n this.service.initializeViewerIcons();\n }\n\n async ngOnInit() {\n this.service.waitToFindDom(this.el.nativeElement, 'swiper-container').then(() => {\n Object.assign(this.swiper.nativeElement, {\n modules: [Navigation, Zoom, IonicSlides],\n initialSlide: this.index,\n slidesPerView: 1,\n pagination: {\n enabled: true,\n clickable: true,\n },\n zoom: true,\n });\n this.swiper.nativeElement.initialize();\n this.swiper.nativeElement.swiper.zoom.enable();\n\n this.swiper.nativeElement.swiper.activeIndex = this.index;\n this.swiper.nativeElement.swiper.update();\n });\n\n this.watchSwipe$ = fromEvent<TouchEvent>(this.el.nativeElement, 'touchstart')\n .pipe(\n zipWith(\n fromEvent<TouchEvent>(this.el.nativeElement, 'touchend').pipe(\n withLatestFrom(fromEvent<TouchEvent>(this.el.nativeElement, 'touchmove')),\n ),\n ),\n throttleTime(1),\n )\n .subscribe(([touchstart, [_, touchmove]]) => {\n const touchstartClientX = touchstart.touches ? touchstart.touches[0].clientX : (touchstart as any).detail[1].clientX;\n const touchmoveClientX = touchmove.touches ? touchmove.touches[0].clientX : (touchmove as any).detail[1].clientX;\n\n const touchstartClientY = touchstart.touches ? touchstart.touches[0].clientY : (touchstart as any).detail[1].clientY;\n const touchmoveClientY = touchmove.touches ? touchmove.touches[0].clientY : (touchmove as any).detail[1].clientY;\n\n const xDiff = touchstartClientX - touchmoveClientX;\n const yDiff = touchstartClientY - touchmoveClientY;\n\n const slides = (this.swiper as any).nativeElement.querySelectorAll('swiper-slide') as HTMLElement[];\n const isZoomed = Array.from(slides).find((slide: HTMLElement) => {\n return ['swiper-slide-zoomed', 'swiper-slide-active'].every((c) => slide.classList.contains(c));\n });\n\n const threshold = touchmove.touches ? -50 : -5;\n\n if (!isZoomed && Math.abs(xDiff) < Math.abs(threshold) && yDiff < threshold && touchstart.timeStamp <= touchmove.timeStamp) {\n this.watchSwipe$.unsubscribe();\n this.modalCtrl.dismiss();\n }\n });\n }\n\n ngOnDestroy() {\n if (this.watchSwipe$ && !this.watchSwipe$.closed) {\n this.watchSwipe$.unsubscribe();\n }\n }\n\n remove() {\n this.modalCtrl.dismiss({\n delete: {\n index: this.swiper.nativeElement.swiper.activeIndex,\n value: this.imageUrls[this.swiper.nativeElement.swiper.activeIndex],\n },\n } as IPhotoViewerDismiss);\n }\n}\n","<ion-header [translucent]=\"true\">\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button (click)=\"modalCtrl.dismiss()\" class=\"viewer-close-button\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"outline\" (click)=\"remove()\">{{ dictionary.delete }}</ion-button>\n </ion-buttons>\n }\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\">\n <swiper-container #swiper>\n @for (url of imageUrls; track url) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" alt=\"\" [class.circle]=\"isCircle\" /></div>\n </swiper-slide>\n }\n </swiper-container>\n</ion-content>\n\n@if (enableFooterSafeArea) {\n <!-- use for safe area-->\n <ion-footer>\n <ion-toolbar style=\"--border-width: 0; --min-height: 0\"></ion-toolbar>\n </ion-footer>\n}\n","export enum PhotoEditorErrors {\n 'initialize' = 'input dom is not found',\n 'cancel' = 'user canceled',\n 'type' = 'upload file is not image.',\n}\n","import { inject, Injectable, signal } from '@angular/core';\nimport { ActionSheetController, Platform } from '@ionic/angular/standalone';\nimport { Camera, CameraResultType, CameraSource, ImageOptions } from '@capacitor/camera';\nimport ImageEditor from 'tui-image-editor';\nimport { PhotoEditorErrors } from '../photoEditorErrors';\nimport { dictionaryForService } from '../dictionaries';\nimport { IDictionaryForService } from '../types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PhotoFileService {\n private readonly $photoMaxSize = signal<number>(1000);\n private readonly actionSheetCtrl = inject(ActionSheetController);\n private readonly platform = inject(Platform);\n private dictionary: IDictionaryForService = dictionaryForService();\n\n constructor() {}\n\n set photoMaxSize(value: number) {\n this.$photoMaxSize.set(value);\n }\n\n set labels(d: IDictionaryForService) {\n this.dictionary = Object.assign(this.dictionary, d);\n }\n\n async loadPhoto(limit: number): Promise<string[]> {\n /**\n * Using Input for browser\n */\n if (!this.platform.is('capacitor')) {\n return this.getPictureFromBrowser();\n }\n\n const actionSheet = await this.actionSheetCtrl.create({\n buttons: [\n {\n text: this.dictionary.camera,\n handler: () => {\n actionSheet.dismiss('camera');\n },\n },\n {\n text: this.dictionary.album,\n handler: () => {\n actionSheet.dismiss('album');\n },\n },\n {\n text: this.dictionary.cancel,\n role: 'cancel',\n },\n ],\n });\n await actionSheet.present();\n const { data } = await actionSheet.onDidDismiss<'camera' | 'album'>();\n if (!data) {\n return Promise.reject(PhotoEditorErrors.cancel);\n }\n\n if (data === 'camera') {\n const defaultCamera: ImageOptions = {\n quality: 100,\n width: this.$photoMaxSize(),\n allowEditing: false,\n resultType: CameraResultType.DataUrl,\n source: CameraSource.Camera,\n presentationStyle: 'popover',\n };\n const image = await Camera.getPhoto(defaultCamera).catch(() => undefined);\n if (!image?.dataUrl) {\n return Promise.reject(PhotoEditorErrors.cancel);\n }\n\n if (!image.dataUrl.includes('capacitor://localhost')) {\n return [image.dataUrl];\n }\n return Promise.all([image.dataUrl].map(async (image) => await this.loadPhotoFromFilePath(image)));\n }\n\n if (data === 'album') {\n const images = await Camera.pickImages({\n quality: 100,\n width: this.$photoMaxSize(),\n limit,\n presentationStyle: 'popover',\n }).catch(() => undefined);\n\n if (!images) {\n return Promise.reject(PhotoEditorErrors.cancel);\n }\n\n return Promise.all(images.photos.map(async (image) => await this.loadPhotoFromFilePath(image.webPath)));\n }\n\n // Not run on this line. This is for lint\n return [];\n }\n\n private getPictureFromBrowser(): Promise<string[]> {\n const inputFile: HTMLInputElement | null = document.querySelector('input#browserPhotoUploader');\n\n if (!inputFile) {\n return Promise.reject(PhotoEditorErrors.initialize);\n }\n\n return new Promise((resolve, reject) => {\n const cancelMethod = (e: Event) => {\n inputFile!.removeEventListener('cancel', cancelMethod, false);\n inputFile!.removeEventListener('change', changeMethod, false);\n\n reject(PhotoEditorErrors.cancel);\n };\n const changeMethod = (e: Event) => {\n inputFile!.removeEventListener('cancel', cancelMethod, false);\n inputFile!.removeEventListener('change', changeMethod, false);\n\n if (!(e.target as HTMLInputElement).files || !(e.target as HTMLInputElement).files![0]) {\n reject(PhotoEditorErrors.cancel);\n }\n const file = (e.target as HTMLInputElement).files![0];\n const reader = new FileReader();\n\n reader.onload = (() => {\n if (file.type.indexOf('image') < 0) {\n reject(PhotoEditorErrors.type);\n }\n\n return async (event) => {\n inputFile.value = '';\n const result = event.target!.result as string;\n const data = await this.loadPhotoFromFilePath(result);\n resolve([data]);\n };\n })();\n\n reader.readAsDataURL(file);\n };\n\n inputFile!.addEventListener('cancel', cancelMethod, false);\n inputFile!.addEventListener('change', changeMethod, false);\n inputFile.click();\n });\n }\n\n private async loadPhotoFromFilePath(filePath: string): Promise<string> {\n const defaultInstance = new ImageEditor(document.createElement('div'), {\n cssMaxWidth: this.$photoMaxSize(),\n cssMaxHeight: this.$photoMaxSize(),\n });\n const blob = await fetch(filePath).then((res) => res.blob());\n const loaded = await defaultInstance.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));\n\n const maxSize = Math.max(loaded.newWidth, loaded.newHeight);\n const dataUrl = defaultInstance.toDataURL({\n multiplier: this.$photoMaxSize() / maxSize,\n });\n defaultInstance.destroy();\n\n return dataUrl;\n }\n}\n","/*\n * Public API Surface of photo-editor\n */\n\nexport * from './lib/pages/photo-editor.page';\nexport * from './lib/pages/photo-viewer.page';\nexport * from './lib/service/photo-file.service';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEO,MAAM,YAAY,GAAG,CAAC,UAAgC,KAAsB;AACjF,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,QAAQ;AACzB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;;;;;;AAMD,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,KAAK;AACtB,QAAA,IAAI,EAAE,OAAO;AACb,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;AACD,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,OAAO;AACxB,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,KAAK;AACX,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;AACtB,KAAA;AACD,IAAA;QACE,IAAI,EAAE,UAAU,CAAC,SAAS;AAC1B,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,MAAM,EAAE,IAAI;AACb,KAAA;;;;;;;;;;;CAWF;;MC1BY,aAAa,CAAA;AACxB,IAAA,WAAA,GAAA;IAEA,qBAAqB,GAAA;AACnB,QAAA,QAAQ,CAAC;YACP,YAAY;YACZ,aAAa;AACd,SAAA,CAAC;;IAGJ,qBAAqB,GAAA;AACnB,QAAA,QAAQ,CAAC;YACP,YAAY;YACZ,IAAI;YACJ,WAAW;YACX,kBAAkB;YAClB,YAAY;YACZ,aAAa;YACb,sBAAsB;YACtB,aAAa;YACb,cAAc;YACd,gBAAgB;AACjB,SAAA,CAAC;;IAGJ,aAAa,CAAC,aAA0B,EAAE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,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACVD;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,134 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@rdlabo/ionic-angular-photo-editor" />
5
- export * from './public-api';
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnInit, OnDestroy, ElementRef } from '@angular/core';
3
+ import * as _rdlabo_ionic_angular_photo_editor from '@rdlabo/ionic-angular-photo-editor';
4
+ import { ViewDidEnter, ViewDidLeave, IonContent, ModalController, RangeCustomEvent } from '@ionic/angular/standalone';
5
+ import { Subscription } from 'rxjs';
6
+ import { SwiperContainer } from 'swiper/element';
7
+
8
+ interface IFilter {
9
+ name: string;
10
+ type: string;
11
+ option: any;
12
+ data: string;
13
+ width: number;
14
+ height: number;
15
+ }
16
+ interface ISize {
17
+ width: number;
18
+ height: number;
19
+ }
20
+ interface IDictionaryForEditor {
21
+ save: string;
22
+ crop: string;
23
+ filter: string;
24
+ brightness: string;
25
+ original: string;
26
+ invert: string;
27
+ sepia: string;
28
+ vintage: string;
29
+ blur: string;
30
+ grayscale: string;
31
+ sharpen: string;
32
+ emboss: string;
33
+ }
34
+ interface IFilterPreset {
35
+ name: string;
36
+ type: string;
37
+ option: any;
38
+ }
39
+ interface IPhotoEditorDismiss {
40
+ value: string;
41
+ }
42
+ interface IPhotoViewerDismiss {
43
+ delete: {
44
+ index: number;
45
+ value: string;
46
+ };
47
+ }
48
+ interface IDictionaryForViewer {
49
+ delete: string;
50
+ }
51
+ interface IDictionaryForService {
52
+ camera: string;
53
+ album: string;
54
+ cancel: string;
55
+ }
56
+
57
+ declare class PhotoEditorPage implements OnInit, OnDestroy, ViewDidEnter, ViewDidLeave {
58
+ protected dictionary: IDictionaryForEditor;
59
+ protected filterPreset: _rdlabo_ionic_angular_photo_editor.IFilterPreset[];
60
+ requireSquare: boolean;
61
+ value: string;
62
+ set labels(d: IDictionaryForEditor);
63
+ editorRef: ElementRef;
64
+ ionContent: {
65
+ el: IonContent & HTMLElement;
66
+ };
67
+ $filters: _angular_core.WritableSignal<IFilter[]>;
68
+ $footerMenu: _angular_core.WritableSignal<"filter" | "menu" | "crop" | "brightness">;
69
+ $currentCrop: _angular_core.WritableSignal<"cover" | "16/9" | "1" | "auto">;
70
+ $currentRotate: _angular_core.WritableSignal<number>;
71
+ $photoCrop: _angular_core.WritableSignal<ISize>;
72
+ $isCropped: _angular_core.WritableSignal<boolean>;
73
+ private footerMenu$;
74
+ private $adoptFilter;
75
+ private editorInstance;
76
+ private initSubscription$;
77
+ private readonly filterImageSize;
78
+ private readonly service;
79
+ modalCtrl: ModalController;
80
+ private canvasContainerObserver;
81
+ constructor();
82
+ ngOnInit(): void;
83
+ ngOnDestroy(): void;
84
+ ionViewDidEnter(): Promise<void>;
85
+ ionViewDidLeave(): void;
86
+ changeCrop(crop: 'cover' | '16/9' | '1' | 'auto'): void;
87
+ rotate(): Promise<void>;
88
+ closeCrop(type: 'cancel' | 'apply'): Promise<void>;
89
+ changeRange(event: RangeCustomEvent): Promise<void>;
90
+ imageSave(): void;
91
+ private initializeFilterMenu;
92
+ filterImage(filter: IFilter): Promise<void>;
93
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PhotoEditorPage, never>;
94
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PhotoEditorPage, "app-editor-image", never, { "requireSquare": { "alias": "requireSquare"; "required": false; }; "value": { "alias": "value"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, {}, never, never, true, never>;
95
+ }
96
+
97
+ declare class PhotoViewerPage implements OnInit, OnDestroy {
98
+ protected dictionary: IDictionaryForViewer;
99
+ imageUrls: string[];
100
+ index: number;
101
+ isCircle: boolean;
102
+ enableDelete: boolean;
103
+ enableFooterSafeArea: boolean;
104
+ set labels(d: IDictionaryForViewer);
105
+ swiper: ElementRef<SwiperContainer>;
106
+ watchSwipe$: Subscription;
107
+ readonly modalCtrl: ModalController;
108
+ private readonly el;
109
+ private readonly service;
110
+ constructor();
111
+ ngOnInit(): Promise<void>;
112
+ ngOnDestroy(): void;
113
+ remove(): void;
114
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PhotoViewerPage, never>;
115
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<PhotoViewerPage, "app-photo-image", never, { "imageUrls": { "alias": "imageUrls"; "required": false; }; "index": { "alias": "index"; "required": false; }; "isCircle": { "alias": "isCircle"; "required": false; }; "enableDelete": { "alias": "enableDelete"; "required": false; }; "enableFooterSafeArea": { "alias": "enableFooterSafeArea"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, {}, never, never, true, never>;
116
+ }
117
+
118
+ declare class PhotoFileService {
119
+ private readonly $photoMaxSize;
120
+ private readonly actionSheetCtrl;
121
+ private readonly platform;
122
+ private dictionary;
123
+ constructor();
124
+ set photoMaxSize(value: number);
125
+ set labels(d: IDictionaryForService);
126
+ loadPhoto(limit: number): Promise<string[]>;
127
+ private getPictureFromBrowser;
128
+ private loadPhotoFromFilePath;
129
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<PhotoFileService, never>;
130
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<PhotoFileService>;
131
+ }
132
+
133
+ export { PhotoEditorPage, PhotoFileService, PhotoViewerPage };
134
+ export type { IDictionaryForEditor, IDictionaryForService, IDictionaryForViewer, IFilter, IFilterPreset, IPhotoEditorDismiss, IPhotoViewerDismiss, ISize };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-angular-photo-editor",
3
- "version": "19.0.3",
3
+ "version": "20.0.0",
4
4
  "peerDependencies": {
5
- "@angular/common": "^19.0.0",
6
- "@angular/core": "^19.0.0",
5
+ "@angular/common": "^20.0.0",
6
+ "@angular/core": "^20.0.0",
7
7
  "@capacitor/camera": ">=6.0.0 <8.0.0",
8
8
  "@capacitor/core": ">=6.0.0 <8.0.0",
9
9
  "@ionic/angular": "^8.0.0",
@@ -1,4 +0,0 @@
1
- import { IDictionaryForEditor, IDictionaryForService, IDictionaryForViewer } from './types';
2
- export declare const dictionaryForEditor: () => IDictionaryForEditor;
3
- export declare const dictionaryForViewer: () => IDictionaryForViewer;
4
- export declare const dictionaryForService: () => IDictionaryForService;
@@ -1,2 +0,0 @@
1
- import { IDictionaryForEditor, IFilterPreset } from './types';
2
- export declare const filterPreset: (dictionary: IDictionaryForEditor) => IFilterPreset[];
@@ -1,2 +0,0 @@
1
- import { IonButton, IonButtons, IonContent, IonFooter, IonHeader, IonIcon, IonRange, IonText, IonToolbar } from '@ionic/angular/standalone';
2
- export declare const ionComponents: (typeof IonButton | typeof IonButtons | typeof IonContent | typeof IonFooter | typeof IonHeader | typeof IonText | typeof IonToolbar | typeof IonIcon | typeof IonRange)[];
@@ -1,43 +0,0 @@
1
- import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
- import { IonContent, ModalController, RangeCustomEvent, ViewDidEnter, ViewDidLeave } from '@ionic/angular/standalone';
3
- import { IDictionaryForEditor, IFilter, ISize } from '../types';
4
- import * as i0 from "@angular/core";
5
- export declare class PhotoEditorPage implements OnInit, OnDestroy, ViewDidEnter, ViewDidLeave {
6
- protected dictionary: IDictionaryForEditor;
7
- protected filterPreset: import("../types").IFilterPreset[];
8
- requireSquare: boolean;
9
- value: string;
10
- set labels(d: IDictionaryForEditor);
11
- editorRef: ElementRef;
12
- ionContent: {
13
- el: IonContent & HTMLElement;
14
- };
15
- $filters: import("@angular/core").WritableSignal<IFilter[]>;
16
- $footerMenu: import("@angular/core").WritableSignal<"filter" | "menu" | "crop" | "brightness">;
17
- $currentCrop: import("@angular/core").WritableSignal<"auto" | "1" | "cover" | "16/9">;
18
- $currentRotate: import("@angular/core").WritableSignal<number>;
19
- $photoCrop: import("@angular/core").WritableSignal<ISize>;
20
- $isCropped: import("@angular/core").WritableSignal<boolean>;
21
- private footerMenu$;
22
- private $adoptFilter;
23
- private editorInstance;
24
- private initSubscription$;
25
- private readonly filterImageSize;
26
- private readonly service;
27
- modalCtrl: ModalController;
28
- private canvasContainerObserver;
29
- constructor();
30
- ngOnInit(): void;
31
- ngOnDestroy(): void;
32
- ionViewDidEnter(): Promise<void>;
33
- ionViewDidLeave(): void;
34
- changeCrop(crop: 'cover' | '16/9' | '1' | 'auto'): void;
35
- rotate(): Promise<void>;
36
- closeCrop(type: 'cancel' | 'apply'): Promise<void>;
37
- changeRange(event: RangeCustomEvent): Promise<void>;
38
- imageSave(): void;
39
- private initializeFilterMenu;
40
- filterImage(filter: IFilter): Promise<void>;
41
- static ɵfac: i0.ɵɵFactoryDeclaration<PhotoEditorPage, never>;
42
- static ɵcmp: i0.ɵɵComponentDeclaration<PhotoEditorPage, "app-editor-image", never, { "requireSquare": { "alias": "requireSquare"; "required": false; }; "value": { "alias": "value"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, {}, never, never, true, never>;
43
- }
@@ -1,26 +0,0 @@
1
- import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
- import { ModalController } from '@ionic/angular/standalone';
3
- import { Subscription } from 'rxjs';
4
- import { SwiperContainer } from 'swiper/element';
5
- import { IDictionaryForViewer } from '../types';
6
- import * as i0 from "@angular/core";
7
- export declare class PhotoViewerPage implements OnInit, OnDestroy {
8
- protected dictionary: IDictionaryForViewer;
9
- imageUrls: string[];
10
- index: number;
11
- isCircle: boolean;
12
- enableDelete: boolean;
13
- enableFooterSafeArea: boolean;
14
- set labels(d: IDictionaryForViewer);
15
- swiper: ElementRef<SwiperContainer>;
16
- watchSwipe$: Subscription;
17
- readonly modalCtrl: ModalController;
18
- private readonly el;
19
- private readonly service;
20
- constructor();
21
- ngOnInit(): Promise<void>;
22
- ngOnDestroy(): void;
23
- remove(): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<PhotoViewerPage, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<PhotoViewerPage, "app-photo-image", never, { "imageUrls": { "alias": "imageUrls"; "required": false; }; "index": { "alias": "index"; "required": false; }; "isCircle": { "alias": "isCircle"; "required": false; }; "enableDelete": { "alias": "enableDelete"; "required": false; }; "enableFooterSafeArea": { "alias": "enableFooterSafeArea"; "required": false; }; "labels": { "alias": "labels"; "required": false; }; }, {}, never, never, true, never>;
26
- }
@@ -1,5 +0,0 @@
1
- export declare enum PhotoEditorErrors {
2
- 'initialize' = "input dom is not found",
3
- 'cancel' = "user canceled",
4
- 'type' = "upload file is not image."
5
- }
@@ -1,9 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- export declare class HelperService {
3
- constructor();
4
- initializeViewerIcons(): void;
5
- initializeEditorIcons(): void;
6
- waitToFindDom(nativeElement: HTMLElement, selector: string): Promise<void>;
7
- static ɵfac: i0.ɵɵFactoryDeclaration<HelperService, never>;
8
- static ɵprov: i0.ɵɵInjectableDeclaration<HelperService>;
9
- }
@@ -1,16 +0,0 @@
1
- import { IDictionaryForService } from '../types';
2
- import * as i0 from "@angular/core";
3
- export declare class PhotoFileService {
4
- private readonly $photoMaxSize;
5
- private readonly actionSheetCtrl;
6
- private readonly platform;
7
- private dictionary;
8
- constructor();
9
- set photoMaxSize(value: number);
10
- set labels(d: IDictionaryForService);
11
- loadPhoto(limit: number): Promise<string[]>;
12
- private getPictureFromBrowser;
13
- private loadPhotoFromFilePath;
14
- static ɵfac: i0.ɵɵFactoryDeclaration<PhotoFileService, never>;
15
- static ɵprov: i0.ɵɵInjectableDeclaration<PhotoFileService>;
16
- }
package/lib/types.d.ts DELETED
@@ -1,48 +0,0 @@
1
- export interface IFilter {
2
- name: string;
3
- type: string;
4
- option: any;
5
- data: string;
6
- width: number;
7
- height: number;
8
- }
9
- export interface ISize {
10
- width: number;
11
- height: number;
12
- }
13
- export interface IDictionaryForEditor {
14
- save: string;
15
- crop: string;
16
- filter: string;
17
- brightness: string;
18
- original: string;
19
- invert: string;
20
- sepia: string;
21
- vintage: string;
22
- blur: string;
23
- grayscale: string;
24
- sharpen: string;
25
- emboss: string;
26
- }
27
- export interface IFilterPreset {
28
- name: string;
29
- type: string;
30
- option: any;
31
- }
32
- export interface IPhotoEditorDismiss {
33
- value: string;
34
- }
35
- export interface IPhotoViewerDismiss {
36
- delete: {
37
- index: number;
38
- value: string;
39
- };
40
- }
41
- export interface IDictionaryForViewer {
42
- delete: string;
43
- }
44
- export interface IDictionaryForService {
45
- camera: string;
46
- album: string;
47
- cancel: string;
48
- }
package/public-api.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './lib/pages/photo-editor.page';
2
- export * from './lib/pages/photo-viewer.page';
3
- export * from './lib/service/photo-file.service';
4
- export * from './lib/types';