@rdlabo/ionic-angular-photo-editor 21.7.0 → 22.0.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -23
- package/css/ios26-header-button-color-scheme.css +114 -0
- package/docs/editor.md +65 -18
- package/docs/photo-file.md +90 -18
- package/docs/theme.md +21 -3
- package/docs/viewer.md +58 -23
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs +12 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs +301 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs +30 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs +193 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs +126 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs.map +1 -0
- package/fesm2022/rdlabo-ionic-angular-photo-editor.mjs +32 -500
- package/fesm2022/rdlabo-ionic-angular-photo-editor.mjs.map +1 -1
- package/package.json +49 -10
- package/types/rdlabo-ionic-angular-photo-editor-editor-tui.d.ts +6 -0
- package/types/rdlabo-ionic-angular-photo-editor-editor.d.ts +52 -0
- package/types/rdlabo-ionic-angular-photo-editor-file-capacitor.d.ts +6 -0
- package/types/rdlabo-ionic-angular-photo-editor-file.d.ts +13 -0
- package/types/rdlabo-ionic-angular-photo-editor-viewer.d.ts +32 -0
- package/types/rdlabo-ionic-angular-photo-editor.d.ts +144 -95
|
@@ -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/ion-components.ts","../../../projects/photo-editor/src/lib/dictionaries.ts","../../../projects/photo-editor/src/lib/pages/util.ts","../../../projects/photo-editor/src/lib/pages/photo-editor/photo-editor.page.ts","../../../projects/photo-editor/src/lib/pages/photo-editor/photo-editor.page.html","../../../projects/photo-editor/src/lib/pages/photo-viewer/photo-viewer.page.ts","../../../projects/photo-editor/src/lib/pages/photo-viewer/photo-viewer.page.html","../../../projects/photo-editor/src/lib/photoEditorErrors.ts","../../../projects/photo-editor/src/lib/services/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 { 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 { 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\nexport const initializeViewerIcons = (): void => {\n addIcons({\n closeOutline,\n removeOutline,\n });\n};\n\nexport const 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\nexport const 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","import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n signal,\n viewChild,\n} 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 { ionComponents } from '../../ion-components';\nimport { dictionaryForEditor } from '../../dictionaries';\nimport { initializeEditorIcons, waitToFindDom } from '../util';\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 changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PhotoEditorPage implements OnInit, OnDestroy, ViewDidEnter, ViewDidLeave {\n readonly modalCtrl = inject(ModalController);\n\n protected readonly dictionary = signal<IDictionaryForEditor>(dictionaryForEditor());\n\n readonly requireSquare = input<boolean, BooleanInput>(false, {\n transform: coerceBooleanProperty,\n });\n readonly labels = input<Partial<IDictionaryForEditor> | undefined>(undefined);\n readonly setLabels = effect(() => {\n if (this.labels()) {\n this.dictionary.update((value) => ({ ...value, ...this.labels() }));\n }\n });\n readonly value = input.required<string>();\n\n readonly editorRef = viewChild.required<ElementRef>('imageEditor');\n readonly ionContent = viewChild.required(IonContent, { read: ElementRef });\n\n readonly filters = signal<IFilter[]>([]);\n readonly footerMenu = signal<'filter' | 'menu' | 'crop' | 'brightness'>('menu');\n readonly currentCrop = signal<'cover' | '16/9' | '1' | 'auto'>('cover');\n readonly currentRotate = signal<number>(0);\n readonly photoCrop = signal<ISize>({\n width: 0,\n height: 0,\n });\n readonly isCropped = signal<boolean>(false);\n private readonly adoptFilter = signal<IFilter | undefined>(undefined);\n protected readonly filterPreset = computed(() => filterPreset(this.dictionary()));\n\n private readonly footerMenu$ = toObservable(this.footerMenu);\n\n private readonly initSubscription$: Subscription[] = [];\n private readonly filterImageSize = 240;\n private editorInstance!: ImageEditor;\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 const editorRef = this.editorRef();\n editorRef.nativeElement.style.minWidth = mutationsList[0].target.parentElement!.style.maxWidth;\n 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 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().nativeElement.clientWidth - 32,\n cssMaxHeight: this.ionContent().nativeElement.clientHeight - 32,\n });\n 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 await 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 color=\"photo-editor-primary\" fill=\"solid\" type=\"submit\" [disabled]=\"!['menu', 'filter'].includes(footerMenu())\" (click)=\"imageSave()\">\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 {\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n signal,\n viewChild,\n} 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 { IDictionaryForViewer, IPhotoViewerDismiss } from '../../types';\nimport { register } from 'swiper/element/bundle';\nimport { dictionaryForViewer } from '../../dictionaries';\nimport { BooleanInput, coerceBooleanProperty, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion';\nimport { initializeViewerIcons, waitToFindDom } from '../util';\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 changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PhotoViewerPage implements OnInit, OnDestroy {\n readonly imageUrls = input.required<string[]>();\n readonly index = input<number, NumberInput>(0, {\n transform: coerceNumberProperty,\n });\n readonly isCircle = input<boolean, BooleanInput>(false, {\n transform: coerceBooleanProperty,\n });\n readonly enableDelete = input<boolean, BooleanInput>(false, {\n transform: coerceBooleanProperty,\n });\n readonly enableFooterSafeArea = input<boolean, BooleanInput>(false, {\n transform: coerceBooleanProperty,\n });\n readonly labels = input<Partial<IDictionaryForViewer>>();\n readonly setLabels = effect(() => {\n if (this.labels()) {\n this.dictionary.update((value) => ({ ...value, ...this.labels() }));\n }\n });\n\n readonly swiper = viewChild.required<ElementRef<SwiperContainer>>('swiper');\n protected readonly dictionary = signal<IDictionaryForViewer>(dictionaryForViewer());\n\n readonly watchSwipe$ = new Subscription();\n readonly modalCtrl = inject(ModalController);\n private readonly el = inject(ElementRef);\n\n constructor() {\n register();\n initializeViewerIcons();\n }\n\n async ngOnInit() {\n waitToFindDom(this.el.nativeElement, 'swiper-container').then(() => {\n const index = this.index();\n const swiper = this.swiper();\n Object.assign(swiper.nativeElement, {\n modules: [Navigation, Zoom, IonicSlides],\n initialSlide: index,\n slidesPerView: 1,\n pagination: {\n enabled: true,\n clickable: true,\n },\n zoom: true,\n });\n swiper.nativeElement.initialize();\n swiper.nativeElement.swiper.zoom.enable();\n\n swiper.nativeElement.swiper.activeIndex = index;\n swiper.nativeElement.swiper.update();\n });\n\n this.watchSwipe$.add(\n 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\n ngOnDestroy() {\n this.watchSwipe$.unsubscribe();\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=\"solid\" type=\"submit\" (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 readonly dictionary = signal<IDictionaryForService>(dictionaryForService());\n\n set photoMaxSize(value: number) {\n this.$photoMaxSize.set(value);\n }\n\n set labels(d: IDictionaryForService) {\n this.dictionary.update((value) => ({ ...value, ...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 = () => {\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/photo-editor.page';\nexport * from './lib/pages/photo-viewer/photo-viewer.page';\nexport * from './lib/services/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,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YAAA,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,OAAO;AAC3C,SAAA,CAAC;QACF,eAAe,CAAC,OAAO,EAAE;AAEzB,QAAA,OAAO,OAAO;IAChB;+GApJW,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,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;4FAEP,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/dictionaries.ts","../../../projects/photo-editor/src/lib/types.ts","../../../projects/photo-editor/src/lib/photo-editor.config.ts","../../../projects/photo-editor/src/public-api.ts","../../../projects/photo-editor/src/rdlabo-ionic-angular-photo-editor.ts"],"sourcesContent":["import { PhotoFileLabels } from './types';\n\nexport const dictionaryForService = (): PhotoFileLabels => ({\n // UI labels\n camera: 'カメラ撮影',\n album: 'アルバムから選択',\n cancel: 'キャンセル',\n});\n","/** Filter options supported by the bundled photo editor presets. */\nexport type PhotoFilterOptions =\n | { blur: number }\n | { brightness: number }\n | { noise: number }\n | { blocksize: number }\n | { color: string; distance: number; useAlpha?: boolean }\n | { mode: string; color: string; alpha?: number }\n | { maskObjId: number }\n | null;\n\n/** Rendered filter preview and the operation applied when it is selected. */\nexport interface PhotoFilter {\n name: string;\n type: string;\n option: PhotoFilterOptions;\n data: string;\n width: number;\n height: number;\n}\n\n/** Two-dimensional pixel size. */\nexport interface PhotoSize {\n width: number;\n height: number;\n}\n\n/** Localized labels rendered by {@link PhotoEditorPage}. */\nexport interface PhotoEditorLabels {\n save: string;\n close: string;\n back: string;\n apply: string;\n crop: string;\n rotate: string;\n cropCover: string;\n crop16x9: string;\n cropSquare: string;\n cropFree: string;\n filter: string;\n brightness: string;\n original: string;\n invert: string;\n sepia: string;\n vintage: string;\n blur: string;\n grayscale: string;\n sharpen: string;\n emboss: string;\n}\n\n/** A filter offered in the editor's preset menu. */\nexport interface PhotoFilterPreset {\n name: string;\n type: string;\n option: PhotoFilterOptions;\n}\n\n/** Successful result returned when the editor saves an image. */\nexport interface PhotoEditorResult {\n action: 'save';\n value: string;\n}\n\n/** Result returned when the viewer asks the consumer to delete an image. */\nexport interface PhotoViewerResult {\n action: 'delete';\n index: number;\n value: string;\n}\n\n/** Localized labels rendered by {@link PhotoViewerPage}. */\nexport interface PhotoViewerLabels {\n close: string;\n delete: string;\n}\n\n/** Localized labels used by the native photo source chooser. */\nexport interface PhotoFileLabels {\n camera: string;\n album: string;\n cancel: string;\n}\n\n/** Color scheme of the toolbar behind photo editor and viewer header buttons. */\nexport type PhotoToolbarColorScheme = 'light' | 'dark';\n\n/** Props for presenting {@link PhotoViewerPage} via Ionic Modal `componentProps`. */\nexport interface PhotoViewerProps {\n imageUrls: string[];\n index?: number;\n isCircle?: boolean;\n enableDelete?: boolean;\n enableFooterSafeArea?: boolean;\n labels?: Partial<PhotoViewerLabels>;\n imageAlt?: string | ((url: string, index: number) => string);\n toolbarColorScheme: PhotoToolbarColorScheme;\n}\n\n/** Props for presenting {@link PhotoEditorPage} via Ionic Modal `componentProps`. */\nexport interface PhotoEditorProps {\n requireSquare?: boolean;\n value: string;\n labels?: Partial<PhotoEditorLabels>;\n toolbarColorScheme: PhotoToolbarColorScheme;\n}\n\n/** Per-request options for {@link PhotoFileService.loadPhoto}. */\nexport interface PhotoLoadOptions {\n limit?: number;\n maxSize?: number;\n labels?: Partial<PhotoFileLabels>;\n}\n\n/** Error codes produced by expected photo selection failures. */\nexport type PhotoLoadErrorCode = 'cancelled' | 'invalid-type' | 'unavailable';\n\n/** Typed error produced by expected photo selection failures. */\nexport class PhotoLoadError extends Error {\n constructor(\n readonly code: PhotoLoadErrorCode,\n options?: ErrorOptions,\n ) {\n super(code, options);\n this.name = 'PhotoLoadError';\n }\n}\n","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport { dictionaryForService } from './dictionaries';\nimport { PhotoFileLabels, PhotoFilterOptions, PhotoLoadError } from './types';\n\n/** Canvas bounds passed to the underlying image editor implementation. */\nexport interface PhotoImageEditorOptions {\n cssMaxWidth: number;\n cssMaxHeight: number;\n}\n\n/** Rectangle returned by the editor crop tool. */\nexport interface PhotoCropRect {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\n/** Minimal image-editor contract required by the library entry points. */\nexport interface PhotoImageEditor {\n applyFilter(type: string, options?: Exclude<PhotoFilterOptions, null>): Promise<unknown>;\n crop(rect: PhotoCropRect): Promise<unknown>;\n destroy(): void;\n getCropzoneRect(): PhotoCropRect;\n hasFilter(type: string): boolean;\n loadImageFromFile(file: File): Promise<{ newWidth: number; newHeight: number }>;\n removeFilter(type: string): Promise<unknown>;\n rotate(angle: number): Promise<unknown>;\n setCropzoneRect(ratio?: number): void;\n startDrawingMode(mode: string): void;\n stopDrawingMode(): void;\n toDataURL(options?: { multiplier?: number }): string;\n}\n\n/** Lazily creates the image editor used for editing and resizing. */\nexport type PhotoImageEditorFactory = (host: Element, options: PhotoImageEditorOptions) => Promise<PhotoImageEditor>;\n\n/** Options passed to a native camera adapter. */\nexport interface PhotoCameraOptions {\n quality: number;\n width: number;\n limit?: number;\n source?: 'camera';\n}\n\n/** Image metadata returned by a native camera adapter. */\nexport interface PhotoCameraImage {\n dataUrl?: string;\n webPath?: string;\n}\n\n/** Minimal native camera contract required by {@link PhotoFileService}. */\nexport interface PhotoCameraAdapter {\n getPhoto(options: PhotoCameraOptions): Promise<PhotoCameraImage>;\n pickImages(options: PhotoCameraOptions): Promise<{ photos: PhotoCameraImage[] }>;\n}\n\n/** Lazily creates the native camera adapter used on Capacitor platforms. */\nexport type PhotoCameraLoader = () => Promise<PhotoCameraAdapter>;\n\n/** Global defaults for photo selection and image editor construction. */\nexport interface PhotoEditorConfig {\n maxSize?: number;\n labels?: Partial<PhotoFileLabels>;\n createImageEditor?: PhotoImageEditorFactory;\n loadCamera?: PhotoCameraLoader;\n}\n\ninterface ResolvedPhotoEditorConfig {\n maxSize: number;\n labels: PhotoFileLabels;\n createImageEditor: PhotoImageEditorFactory;\n loadCamera: PhotoCameraLoader;\n}\n\nconst missingImageEditor: PhotoImageEditorFactory = () =>\n Promise.reject(new PhotoLoadError('unavailable', { cause: new Error('Configure createImageEditor with the editor adapter.') }));\nconst missingCamera: PhotoCameraLoader = () =>\n Promise.reject(new PhotoLoadError('unavailable', { cause: new Error('Configure loadCamera with the Capacitor adapter.') }));\n\n/** Resolved photo editor configuration used by library services and components. */\nexport const PHOTO_EDITOR_CONFIG = new InjectionToken<ResolvedPhotoEditorConfig>('PHOTO_EDITOR_CONFIG', {\n providedIn: 'root',\n factory: () => ({\n maxSize: 1000,\n labels: dictionaryForService(),\n createImageEditor: missingImageEditor,\n loadCamera: missingCamera,\n }),\n});\n\n/** Provides application-wide photo editor defaults and an optional editor adapter. */\nexport function providePhotoEditor(config: PhotoEditorConfig = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: PHOTO_EDITOR_CONFIG,\n useValue: {\n maxSize: config.maxSize ?? 1000,\n labels: { ...dictionaryForService(), ...config.labels },\n createImageEditor: config.createImageEditor ?? missingImageEditor,\n loadCamera: config.loadCamera ?? missingCamera,\n } satisfies ResolvedPhotoEditorConfig,\n },\n ]);\n}\n","/*\n * Public API Surface of photo-editor\n */\n\nexport * from './lib/photo-editor.config';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],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,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE;AACvD,gBAAA,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,kBAAkB;AACjE,gBAAA,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,aAAa;AACX,aAAA;AACtC,SAAA;AACF,KAAA,CAAC;AACJ;;ACxGA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,34 +1,73 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rdlabo/ionic-angular-photo-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git@github.com:rdlabo-dev/ionic-angular-library.git"
|
|
7
7
|
},
|
|
8
|
+
"homepage": "https://docs.rdlabo.dev/projects/ionic-angular-photo-editor",
|
|
8
9
|
"peerDependencies": {
|
|
9
|
-
"@angular/cdk": "
|
|
10
|
-
"@angular/common": "
|
|
11
|
-
"@angular/core": "
|
|
12
|
-
"@
|
|
13
|
-
"@capacitor/
|
|
14
|
-
"@
|
|
10
|
+
"@angular/cdk": ">=21.0.0 <23.0.0",
|
|
11
|
+
"@angular/common": ">=21.0.0 <23.0.0",
|
|
12
|
+
"@angular/core": ">=21.0.0 <23.0.0",
|
|
13
|
+
"@angular/forms": ">=21.0.0 <23.0.0",
|
|
14
|
+
"@capacitor/camera": ">=7.0.0 <9.0.0",
|
|
15
|
+
"@capacitor/core": ">=7.0.0 <9.0.0",
|
|
16
|
+
"@ionic/angular": "^9.0.0",
|
|
17
|
+
"ionicons": ">=7.0.0 <9.0.0",
|
|
18
|
+
"rxjs": "^7.8.0",
|
|
15
19
|
"swiper": "^11.1.3",
|
|
16
20
|
"tui-image-editor": "^3.15.3"
|
|
17
21
|
},
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"@capacitor/camera": {
|
|
24
|
+
"optional": true
|
|
25
|
+
},
|
|
26
|
+
"swiper": {
|
|
27
|
+
"optional": true
|
|
28
|
+
},
|
|
29
|
+
"tui-image-editor": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
18
33
|
"dependencies": {
|
|
19
34
|
"tslib": "^2.3.0"
|
|
20
35
|
},
|
|
21
|
-
"sideEffects": false,
|
|
22
|
-
"module": "fesm2022/rdlabo-ionic-angular-photo-editor.mjs",
|
|
23
|
-
"typings": "types/rdlabo-ionic-angular-photo-editor.d.ts",
|
|
24
36
|
"exports": {
|
|
37
|
+
"./css/ios26-header-button-color-scheme.css": {
|
|
38
|
+
"style": "./css/ios26-header-button-color-scheme.css",
|
|
39
|
+
"default": "./css/ios26-header-button-color-scheme.css"
|
|
40
|
+
},
|
|
25
41
|
"./package.json": {
|
|
26
42
|
"default": "./package.json"
|
|
27
43
|
},
|
|
28
44
|
".": {
|
|
29
45
|
"types": "./types/rdlabo-ionic-angular-photo-editor.d.ts",
|
|
30
46
|
"default": "./fesm2022/rdlabo-ionic-angular-photo-editor.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./editor": {
|
|
49
|
+
"types": "./types/rdlabo-ionic-angular-photo-editor-editor.d.ts",
|
|
50
|
+
"default": "./fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./editor/tui": {
|
|
53
|
+
"types": "./types/rdlabo-ionic-angular-photo-editor-editor-tui.d.ts",
|
|
54
|
+
"default": "./fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./file": {
|
|
57
|
+
"types": "./types/rdlabo-ionic-angular-photo-editor-file.d.ts",
|
|
58
|
+
"default": "./fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs"
|
|
59
|
+
},
|
|
60
|
+
"./file/capacitor": {
|
|
61
|
+
"types": "./types/rdlabo-ionic-angular-photo-editor-file-capacitor.d.ts",
|
|
62
|
+
"default": "./fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs"
|
|
63
|
+
},
|
|
64
|
+
"./viewer": {
|
|
65
|
+
"types": "./types/rdlabo-ionic-angular-photo-editor-viewer.d.ts",
|
|
66
|
+
"default": "./fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs"
|
|
31
67
|
}
|
|
32
68
|
},
|
|
69
|
+
"sideEffects": false,
|
|
70
|
+
"module": "fesm2022/rdlabo-ionic-angular-photo-editor.mjs",
|
|
71
|
+
"typings": "types/rdlabo-ionic-angular-photo-editor.d.ts",
|
|
33
72
|
"type": "module"
|
|
34
73
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as _rdlabo_ionic_angular_photo_editor from '@rdlabo/ionic-angular-photo-editor';
|
|
2
|
+
import { PhotoEditorLabels, PhotoToolbarColorScheme, PhotoFilter, PhotoSize } from '@rdlabo/ionic-angular-photo-editor';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { OnDestroy } from '@angular/core';
|
|
5
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
|
+
import { ViewDidEnter, ViewDidLeave, ModalController, RangeCustomEvent } from '@ionic/angular';
|
|
7
|
+
|
|
8
|
+
declare class PhotoEditorPage implements OnDestroy, ViewDidEnter, ViewDidLeave {
|
|
9
|
+
#private;
|
|
10
|
+
protected readonly modalCtrl: ModalController;
|
|
11
|
+
readonly requireSquare: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
12
|
+
readonly labels: _angular_core.InputSignal<Partial<PhotoEditorLabels> | undefined>;
|
|
13
|
+
readonly toolbarColorScheme: _angular_core.InputSignal<PhotoToolbarColorScheme>;
|
|
14
|
+
readonly value: _angular_core.InputSignal<string>;
|
|
15
|
+
protected readonly dictionary: _angular_core.Signal<PhotoEditorLabels>;
|
|
16
|
+
private readonly editorRef;
|
|
17
|
+
private readonly ionContent;
|
|
18
|
+
protected readonly filters: _angular_core.WritableSignal<PhotoFilter[]>;
|
|
19
|
+
protected readonly footerMenu: _angular_core.WritableSignal<"crop" | "filter" | "brightness" | "menu">;
|
|
20
|
+
protected readonly currentCrop: _angular_core.WritableSignal<"1" | "cover" | "16/9" | "auto">;
|
|
21
|
+
protected readonly currentRotate: _angular_core.WritableSignal<number>;
|
|
22
|
+
protected readonly photoCrop: _angular_core.WritableSignal<PhotoSize>;
|
|
23
|
+
protected readonly isCropped: _angular_core.WritableSignal<boolean>;
|
|
24
|
+
private readonly adoptFilter;
|
|
25
|
+
protected readonly filterPreset: _angular_core.Signal<_rdlabo_ionic_angular_photo_editor.PhotoFilterPreset[]>;
|
|
26
|
+
private readonly filterImageSize;
|
|
27
|
+
private editorInstance;
|
|
28
|
+
private initializationGeneration;
|
|
29
|
+
private readonly footerMenuEffect;
|
|
30
|
+
private canvasContainer;
|
|
31
|
+
private readonly canvasContainerObserver;
|
|
32
|
+
constructor();
|
|
33
|
+
ngOnDestroy(): void;
|
|
34
|
+
ionViewDidEnter(): Promise<void>;
|
|
35
|
+
private initializeEditor;
|
|
36
|
+
ionViewDidLeave(): void;
|
|
37
|
+
changeCrop(crop: 'cover' | '16/9' | '1' | 'auto'): void;
|
|
38
|
+
rotate(): Promise<void>;
|
|
39
|
+
closeCrop(type: 'cancel' | 'apply'): Promise<void>;
|
|
40
|
+
changeRange(event: RangeCustomEvent): Promise<void>;
|
|
41
|
+
imageSave(): void;
|
|
42
|
+
private initializeFilterMenu;
|
|
43
|
+
filterImage(filter: PhotoFilter): Promise<void>;
|
|
44
|
+
private requireEditor;
|
|
45
|
+
private destroyEditor;
|
|
46
|
+
private isCurrentEditor;
|
|
47
|
+
private syncCanvasSize;
|
|
48
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PhotoEditorPage, never>;
|
|
49
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PhotoEditorPage, "rdlabo-photo-editor", never, { "requireSquare": { "alias": "requireSquare"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "toolbarColorScheme": { "alias": "toolbarColorScheme"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { PhotoEditorPage };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PhotoLoadOptions } from '@rdlabo/ionic-angular-photo-editor';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Selects and normalizes photos from browser and Capacitor sources. */
|
|
5
|
+
declare class PhotoFileService {
|
|
6
|
+
#private;
|
|
7
|
+
/** Opens the platform photo picker and returns normalized data URLs. */
|
|
8
|
+
loadPhoto(options?: PhotoLoadOptions): Promise<string[]>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PhotoFileService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PhotoFileService>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { PhotoFileService };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
3
|
+
import { ModalController } from '@ionic/angular';
|
|
4
|
+
import { PhotoViewerLabels, PhotoToolbarColorScheme } from '@rdlabo/ionic-angular-photo-editor';
|
|
5
|
+
import { NumberInput, BooleanInput } from '@angular/cdk/coercion';
|
|
6
|
+
|
|
7
|
+
declare class PhotoViewerPage implements OnInit, OnDestroy {
|
|
8
|
+
readonly imageUrls: _angular_core.InputSignal<string[]>;
|
|
9
|
+
readonly index: _angular_core.InputSignalWithTransform<number, NumberInput>;
|
|
10
|
+
readonly isCircle: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
11
|
+
readonly enableDelete: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
12
|
+
readonly enableFooterSafeArea: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
13
|
+
readonly labels: _angular_core.InputSignal<Partial<PhotoViewerLabels> | undefined>;
|
|
14
|
+
readonly imageAlt: _angular_core.InputSignal<string | ((url: string, index: number) => string)>;
|
|
15
|
+
readonly toolbarColorScheme: _angular_core.InputSignal<PhotoToolbarColorScheme>;
|
|
16
|
+
private readonly swiper;
|
|
17
|
+
protected readonly dictionary: _angular_core.Signal<PhotoViewerLabels>;
|
|
18
|
+
private readonly watchSwipe$;
|
|
19
|
+
protected readonly modalCtrl: ModalController;
|
|
20
|
+
private readonly el;
|
|
21
|
+
private swiperInitialized;
|
|
22
|
+
private readonly initializeSwiper;
|
|
23
|
+
constructor();
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
ngOnDestroy(): void;
|
|
26
|
+
remove(): void;
|
|
27
|
+
protected resolveImageAlt(url: string, index: number): string;
|
|
28
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PhotoViewerPage, never>;
|
|
29
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PhotoViewerPage, "rdlabo-photo-viewer", never, { "imageUrls": { "alias": "imageUrls"; "required": true; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; "isCircle": { "alias": "isCircle"; "required": false; "isSignal": true; }; "enableDelete": { "alias": "enableDelete"; "required": false; "isSignal": true; }; "enableFooterSafeArea": { "alias": "enableFooterSafeArea"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "imageAlt": { "alias": "imageAlt"; "required": false; "isSignal": true; }; "toolbarColorScheme": { "alias": "toolbarColorScheme"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { PhotoViewerPage };
|