@rdlabo/ionic-angular-photo-editor 22.0.0-7 → 22.0.0-beta.pr94.sha870257bc2bf6
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.
|
@@ -109,11 +109,11 @@ class PhotoViewerPage {
|
|
|
109
109
|
return typeof alt === 'function' ? alt(url, index) : alt;
|
|
110
110
|
}
|
|
111
111
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoViewerPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
112
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: PhotoViewerPage, isStandalone: true, selector: "rdlabo-photo-viewer", inputs: { imageUrls: { classPropertyName: "imageUrls", publicName: "imageUrls", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, isCircle: { classPropertyName: "isCircle", publicName: "isCircle", isSignal: true, isRequired: false, transformFunction: null }, enableDelete: { classPropertyName: "enableDelete", publicName: "enableDelete", isSignal: true, isRequired: false, transformFunction: null }, enableFooterSafeArea: { classPropertyName: "enableFooterSafeArea", publicName: "enableFooterSafeArea", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, imageAlt: { classPropertyName: "imageAlt", publicName: "imageAlt", isSignal: true, isRequired: false, transformFunction: null }, toolbarColorScheme: { classPropertyName: "toolbarColorScheme", publicName: "toolbarColorScheme", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "swiper", first: true, predicate: ["swiper"], descendants: true, isSignal: true }], ngImport: i0, template: "<ion-header\n [translucent]=\"true\"\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete() && imageUrls().length > 0) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"solid\" type=\"
|
|
112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.3", type: PhotoViewerPage, isStandalone: true, selector: "rdlabo-photo-viewer", inputs: { imageUrls: { classPropertyName: "imageUrls", publicName: "imageUrls", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, isCircle: { classPropertyName: "isCircle", publicName: "isCircle", isSignal: true, isRequired: false, transformFunction: null }, enableDelete: { classPropertyName: "enableDelete", publicName: "enableDelete", isSignal: true, isRequired: false, transformFunction: null }, enableFooterSafeArea: { classPropertyName: "enableFooterSafeArea", publicName: "enableFooterSafeArea", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, imageAlt: { classPropertyName: "imageAlt", publicName: "imageAlt", isSignal: true, isRequired: false, transformFunction: null }, toolbarColorScheme: { classPropertyName: "toolbarColorScheme", publicName: "toolbarColorScheme", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "swiper", first: true, predicate: ["swiper"], descendants: true, isSignal: true }], ngImport: i0, template: "<ion-header\n [translucent]=\"true\"\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete() && imageUrls().length > 0) {\n <ion-buttons slot=\"end\">\n <ion-button class=\"button-submit\" color=\"photo-editor-danger\" fill=\"solid\" type=\"button\" (click)=\"remove()\"\n >{{ dictionary().delete }}</ion-button\n >\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 $index; let index = $index) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" [alt]=\"resolveImageAlt(url, index)\" [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, var(--ion-color-step-100, #2a2a2a));--editor-background-tint: var(--ion-photo-editor-background-tint, var(--ion-color-step-200, #414141));--editor-color: var(--ion-photo-editor-color, var(--ion-color-step-950, #f0f0f0));--editor-color-tint: var(--ion-photo-editor-color-tint, var(--ion-color-step-850, #dbdbdb));--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, var(--ion-color-primary, #4d8dff));--ion-color-photo-editor-primary-rgb: var(--ion-photo-editor-primary-rgb, var(--ion-color-primary-rgb, 77, 141, 255));--ion-color-photo-editor-primary-contrast: var(--ion-photo-editor-primary-contrast, var(--ion-color-primary-contrast, #000));--ion-color-photo-editor-primary-contrast-rgb: var( --ion-photo-editor-primary-contrast-rgb, var(--ion-color-primary-contrast-rgb, 0, 0, 0) );--ion-color-photo-editor-primary-shade: var(--ion-photo-editor-primary-shade, var(--ion-color-primary-shade, #447ce0));--ion-color-photo-editor-primary-tint: var(--ion-photo-editor-primary-tint, var(--ion-color-primary-tint, #5f98ff));--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-danger-rgb: var(--ion-photo-editor-danger-rgb, 242, 76, 88);--ion-color-photo-editor-danger-contrast: var(--ion-photo-editor-danger-contrast, #000);--ion-color-photo-editor-danger-contrast-rgb: var(--ion-photo-editor-danger-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-danger-shade: var(--ion-photo-editor-danger-shade, #d5434d);--ion-color-photo-editor-danger-tint: var(--ion-photo-editor-danger-tint, #f35e69);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b);--ion-color-photo-editor-success-rgb: var(--ion-photo-editor-success-rgb, 45, 213, 91);--ion-color-photo-editor-success-contrast: var(--ion-photo-editor-success-contrast, #000);--ion-color-photo-editor-success-contrast-rgb: var(--ion-photo-editor-success-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-success-shade: var(--ion-photo-editor-success-shade, #28bb50);--ion-color-photo-editor-success-tint: var(--ion-photo-editor-success-tint, #42d96b)}ion-header.photo-editor-header-buttons-light ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-light, #222428)}ion-header.photo-editor-header-buttons-dark ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-dark, #f4f5f8)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary);--ion-color-base-rgb: var(--ion-color-photo-editor-primary-rgb);--ion-color-contrast: var(--ion-color-photo-editor-primary-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-primary-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-primary-shade);--ion-color-tint: var(--ion-color-photo-editor-primary-tint)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger);--ion-color-base-rgb: var(--ion-color-photo-editor-danger-rgb);--ion-color-contrast: var(--ion-color-photo-editor-danger-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-danger-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-danger-shade);--ion-color-tint: var(--ion-color-photo-editor-danger-tint)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success);--ion-color-base-rgb: var(--ion-color-photo-editor-success-rgb);--ion-color-contrast: var(--ion-color-photo-editor-success-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-success-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-success-shade);--ion-color-tint: var(--ion-color-photo-editor-success-tint)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "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"], outputs: ["ionFocus", "ionBlur"] }, { 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"], outputs: ["ionScrollStart", "ionScroll", "ionScrollEnd"] }, { kind: "component", type: i1.IonFooter, selector: "ion-footer", inputs: ["collapse", "mode", "translucent"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
113
113
|
}
|
|
114
114
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoViewerPage, decorators: [{
|
|
115
115
|
type: Component,
|
|
116
|
-
args: [{ selector: 'rdlabo-photo-viewer', imports: [...ionComponents], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-header\n [translucent]=\"true\"\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete() && imageUrls().length > 0) {\n <ion-buttons slot=\"end\">\n <ion-button color=\"photo-editor-danger\" fill=\"solid\" type=\"
|
|
116
|
+
args: [{ selector: 'rdlabo-photo-viewer', imports: [...ionComponents], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ion-header\n [translucent]=\"true\"\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete() && imageUrls().length > 0) {\n <ion-buttons slot=\"end\">\n <ion-button class=\"button-submit\" color=\"photo-editor-danger\" fill=\"solid\" type=\"button\" (click)=\"remove()\"\n >{{ dictionary().delete }}</ion-button\n >\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 $index; let index = $index) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" [alt]=\"resolveImageAlt(url, index)\" [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, var(--ion-color-step-100, #2a2a2a));--editor-background-tint: var(--ion-photo-editor-background-tint, var(--ion-color-step-200, #414141));--editor-color: var(--ion-photo-editor-color, var(--ion-color-step-950, #f0f0f0));--editor-color-tint: var(--ion-photo-editor-color-tint, var(--ion-color-step-850, #dbdbdb));--ion-color-photo-editor-primary: var(--ion-photo-editor-primary, var(--ion-color-primary, #4d8dff));--ion-color-photo-editor-primary-rgb: var(--ion-photo-editor-primary-rgb, var(--ion-color-primary-rgb, 77, 141, 255));--ion-color-photo-editor-primary-contrast: var(--ion-photo-editor-primary-contrast, var(--ion-color-primary-contrast, #000));--ion-color-photo-editor-primary-contrast-rgb: var( --ion-photo-editor-primary-contrast-rgb, var(--ion-color-primary-contrast-rgb, 0, 0, 0) );--ion-color-photo-editor-primary-shade: var(--ion-photo-editor-primary-shade, var(--ion-color-primary-shade, #447ce0));--ion-color-photo-editor-primary-tint: var(--ion-photo-editor-primary-tint, var(--ion-color-primary-tint, #5f98ff));--ion-color-photo-editor-danger: var(--ion-photo-editor-danger, #f24c58);--ion-color-photo-editor-danger-rgb: var(--ion-photo-editor-danger-rgb, 242, 76, 88);--ion-color-photo-editor-danger-contrast: var(--ion-photo-editor-danger-contrast, #000);--ion-color-photo-editor-danger-contrast-rgb: var(--ion-photo-editor-danger-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-danger-shade: var(--ion-photo-editor-danger-shade, #d5434d);--ion-color-photo-editor-danger-tint: var(--ion-photo-editor-danger-tint, #f35e69);--ion-color-photo-editor-success: var(--ion-photo-editor-success, #2dd55b);--ion-color-photo-editor-success-rgb: var(--ion-photo-editor-success-rgb, 45, 213, 91);--ion-color-photo-editor-success-contrast: var(--ion-photo-editor-success-contrast, #000);--ion-color-photo-editor-success-contrast-rgb: var(--ion-photo-editor-success-contrast-rgb, 0, 0, 0);--ion-color-photo-editor-success-shade: var(--ion-photo-editor-success-shade, #28bb50);--ion-color-photo-editor-success-tint: var(--ion-photo-editor-success-tint, #42d96b)}ion-header.photo-editor-header-buttons-light ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-light, #222428)}ion-header.photo-editor-header-buttons-dark ion-button:not(.ion-color){--color: var(--ion-photo-editor-header-button-color-on-dark, #f4f5f8)}.ion-color-photo-editor-primary{--ion-color-base: var(--ion-color-photo-editor-primary);--ion-color-base-rgb: var(--ion-color-photo-editor-primary-rgb);--ion-color-contrast: var(--ion-color-photo-editor-primary-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-primary-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-primary-shade);--ion-color-tint: var(--ion-color-photo-editor-primary-tint)}.ion-color-photo-editor-danger{--ion-color-base: var(--ion-color-photo-editor-danger);--ion-color-base-rgb: var(--ion-color-photo-editor-danger-rgb);--ion-color-contrast: var(--ion-color-photo-editor-danger-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-danger-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-danger-shade);--ion-color-tint: var(--ion-color-photo-editor-danger-tint)}.ion-color-photo-editor-success{--ion-color-base: var(--ion-color-photo-editor-success);--ion-color-base-rgb: var(--ion-color-photo-editor-success-rgb);--ion-color-contrast: var(--ion-color-photo-editor-success-contrast);--ion-color-contrast-rgb: var(--ion-color-photo-editor-success-contrast-rgb);--ion-color-shade: var(--ion-color-photo-editor-success-shade);--ion-color-tint: var(--ion-color-photo-editor-success-tint)}ion-content,ion-toolbar,ion-header,ion-footer{background:var(--editor-background)!important;--background: var(--editor-background) !important}\n", "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"] }]
|
|
117
117
|
}], ctorParameters: () => [], propDecorators: { imageUrls: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUrls", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], isCircle: [{ type: i0.Input, args: [{ isSignal: true, alias: "isCircle", required: false }] }], enableDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableDelete", required: false }] }], enableFooterSafeArea: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableFooterSafeArea", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], imageAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageAlt", required: false }] }], toolbarColorScheme: [{ type: i0.Input, args: [{ isSignal: true, alias: "toolbarColorScheme", required: true }] }], swiper: [{ type: i0.ViewChild, args: ['swiper', { isSignal: true }] }] } });
|
|
118
118
|
|
|
119
119
|
/** Photo viewing modal entry point. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rdlabo-ionic-angular-photo-editor-viewer.mjs","sources":["../../../projects/photo-editor/viewer/src/lib/internals.ts","../../../projects/photo-editor/viewer/src/lib/photo-viewer.page.ts","../../../projects/photo-editor/viewer/src/lib/photo-viewer.page.html","../../../projects/photo-editor/viewer/src/public-api.ts","../../../projects/photo-editor/viewer/src/rdlabo-ionic-angular-photo-editor-viewer.ts"],"sourcesContent":["import { PhotoViewerLabels } from '@rdlabo/ionic-angular-photo-editor';\nimport { IonButton, IonButtons, IonContent, IonFooter, IonHeader, IonIcon, IonToolbar } from '@ionic/angular';\nimport { addIcons } from 'ionicons';\nimport { closeOutline, removeOutline } from 'ionicons/icons';\n\nexport const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter];\n\nexport const dictionaryForViewer = (): PhotoViewerLabels => ({\n close: '閉じる',\n delete: '削除',\n});\n\nexport const initializeViewerIcons = (): void => {\n addIcons({ closeOutline, removeOutline });\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n viewChild,\n} from '@angular/core';\nimport { IonicSlides, ModalController } from '@ionic/angular';\nimport { Navigation, Zoom } from 'swiper/modules';\nimport { fromEvent, Subscription, throttleTime, withLatestFrom, zipWith } from 'rxjs';\nimport { SwiperContainer } from 'swiper/element';\nimport { PhotoToolbarColorScheme, PhotoViewerLabels, PhotoViewerResult } from '@rdlabo/ionic-angular-photo-editor';\nimport { register } from 'swiper/element/bundle';\nimport { BooleanInput, coerceBooleanProperty, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion';\nimport { dictionaryForViewer, initializeViewerIcons, ionComponents } from './internals';\n\n@Component({\n selector: 'rdlabo-photo-viewer',\n templateUrl: './photo-viewer.page.html',\n styleUrls: ['../../../src/lib/pages/core.scss', './photo-viewer.page.scss'],\n imports: [...ionComponents],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/** Ionic modal page for zooming, browsing, and optionally deleting photos. */\nexport class PhotoViewerPage implements OnInit, OnDestroy {\n declare static modalReturn: PhotoViewerResult;\n\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<PhotoViewerLabels>>();\n readonly imageAlt = input<string | ((url: string, index: number) => string)>('');\n readonly toolbarColorScheme = input.required<PhotoToolbarColorScheme>();\n\n private readonly swiper = viewChild<ElementRef<SwiperContainer>>('swiper');\n protected readonly dictionary = computed<PhotoViewerLabels>(() => ({ ...dictionaryForViewer(), ...this.labels() }));\n\n private readonly watchSwipe$ = new Subscription();\n protected readonly modalCtrl = inject(ModalController);\n private readonly el = inject(ElementRef);\n private swiperInitialized = false;\n\n private readonly initializeSwiper = effect(() => {\n const swiper = this.swiper()?.nativeElement;\n if (!swiper || this.swiperInitialized) {\n return;\n }\n this.swiperInitialized = true;\n const index = this.index();\n Object.assign(swiper, {\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.initialize();\n swiper.swiper.zoom.enable();\n swiper.swiper.activeIndex = index;\n swiper.swiper.update();\n });\n\n constructor() {\n register();\n initializeViewerIcons();\n }\n\n ngOnInit() {\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()?.nativeElement.querySelectorAll('swiper-slide') ?? [];\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 const imageUrls = this.imageUrls();\n if (imageUrls.length === 0) {\n return;\n }\n const activeIndex = this.swiper()?.nativeElement.swiper.activeIndex ?? this.index();\n const index = Math.min(imageUrls.length - 1, Math.max(0, Math.trunc(activeIndex)));\n void this.modalCtrl.dismiss({\n action: 'delete',\n index,\n value: imageUrls[index],\n } satisfies PhotoViewerResult);\n }\n\n protected resolveImageAlt(url: string, index: number): string {\n const alt = this.imageAlt();\n return typeof alt === 'function' ? alt(url, index) : alt;\n }\n}\n","<ion-header\n [translucent]=\"true\"\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete() && imageUrls().length > 0) {\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 $index; let index = $index) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" [alt]=\"resolveImageAlt(url, index)\" [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","/** Photo viewing modal entry point. */\nexport * from './lib/photo-viewer.page';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAKO,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;AAEpG,MAAM,mBAAmB,GAAG,OAA0B;AAC3D,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE,IAAI;AACb,CAAA,CAAC;AAEK,MAAM,qBAAqB,GAAG,MAAW;AAC9C,IAAA,QAAQ,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC;AAC3C,CAAC;;ACgBD;MACa,eAAe,CAAA;AAmD1B,IAAA,WAAA,GAAA;QAhDS,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,QAAQ;sFAAY;QACtC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAsB,CAAC,6EAC3C,SAAS,EAAE,oBAAoB,EAAA,CAC/B;QACO,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFACpD,SAAS,EAAE,qBAAqB,EAAA,CAChC;QACO,IAAA,CAAA,YAAY,GAAG,KAAK,CAAwB,KAAK,oFACxD,SAAS,EAAE,qBAAqB,EAAA,CAChC;QACO,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAAwB,KAAK,4FAChE,SAAS,EAAE,qBAAqB,EAAA,CAChC;AACO,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK;8FAA8B;QAC5C,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAoD,EAAE;qFAAC;QACvE,IAAA,CAAA,kBAAkB,GAAG,KAAK,CAAC,QAAQ;+FAA2B;QAEtD,IAAA,CAAA,MAAM,GAAG,SAAS,CAA8B,QAAQ;mFAAC;AACvD,Q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AChB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,mzCAAA,EAAA,MAAA,EAAA,CAAA,8uHAAA,EAAA,0RAAA,CAAA,EAAA;w4BAuBkB,QAAQ,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnD3E;;ACAA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rdlabo-ionic-angular-photo-editor-viewer.mjs","sources":["../../../projects/photo-editor/viewer/src/lib/internals.ts","../../../projects/photo-editor/viewer/src/lib/photo-viewer.page.ts","../../../projects/photo-editor/viewer/src/lib/photo-viewer.page.html","../../../projects/photo-editor/viewer/src/public-api.ts","../../../projects/photo-editor/viewer/src/rdlabo-ionic-angular-photo-editor-viewer.ts"],"sourcesContent":["import { PhotoViewerLabels } from '@rdlabo/ionic-angular-photo-editor';\nimport { IonButton, IonButtons, IonContent, IonFooter, IonHeader, IonIcon, IonToolbar } from '@ionic/angular';\nimport { addIcons } from 'ionicons';\nimport { closeOutline, removeOutline } from 'ionicons/icons';\n\nexport const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter];\n\nexport const dictionaryForViewer = (): PhotoViewerLabels => ({\n close: '閉じる',\n delete: '削除',\n});\n\nexport const initializeViewerIcons = (): void => {\n addIcons({ closeOutline, removeOutline });\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n CUSTOM_ELEMENTS_SCHEMA,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n OnInit,\n viewChild,\n} from '@angular/core';\nimport { IonicSlides, ModalController } from '@ionic/angular';\nimport { Navigation, Zoom } from 'swiper/modules';\nimport { fromEvent, Subscription, throttleTime, withLatestFrom, zipWith } from 'rxjs';\nimport { SwiperContainer } from 'swiper/element';\nimport { PhotoToolbarColorScheme, PhotoViewerLabels, PhotoViewerResult } from '@rdlabo/ionic-angular-photo-editor';\nimport { register } from 'swiper/element/bundle';\nimport { BooleanInput, coerceBooleanProperty, coerceNumberProperty, NumberInput } from '@angular/cdk/coercion';\nimport { dictionaryForViewer, initializeViewerIcons, ionComponents } from './internals';\n\n@Component({\n selector: 'rdlabo-photo-viewer',\n templateUrl: './photo-viewer.page.html',\n styleUrls: ['../../../src/lib/pages/core.scss', './photo-viewer.page.scss'],\n imports: [...ionComponents],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\n/** Ionic modal page for zooming, browsing, and optionally deleting photos. */\nexport class PhotoViewerPage implements OnInit, OnDestroy {\n declare static modalReturn: PhotoViewerResult;\n\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<PhotoViewerLabels>>();\n readonly imageAlt = input<string | ((url: string, index: number) => string)>('');\n readonly toolbarColorScheme = input.required<PhotoToolbarColorScheme>();\n\n private readonly swiper = viewChild<ElementRef<SwiperContainer>>('swiper');\n protected readonly dictionary = computed<PhotoViewerLabels>(() => ({ ...dictionaryForViewer(), ...this.labels() }));\n\n private readonly watchSwipe$ = new Subscription();\n protected readonly modalCtrl = inject(ModalController);\n private readonly el = inject(ElementRef);\n private swiperInitialized = false;\n\n private readonly initializeSwiper = effect(() => {\n const swiper = this.swiper()?.nativeElement;\n if (!swiper || this.swiperInitialized) {\n return;\n }\n this.swiperInitialized = true;\n const index = this.index();\n Object.assign(swiper, {\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.initialize();\n swiper.swiper.zoom.enable();\n swiper.swiper.activeIndex = index;\n swiper.swiper.update();\n });\n\n constructor() {\n register();\n initializeViewerIcons();\n }\n\n ngOnInit() {\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()?.nativeElement.querySelectorAll('swiper-slide') ?? [];\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 const imageUrls = this.imageUrls();\n if (imageUrls.length === 0) {\n return;\n }\n const activeIndex = this.swiper()?.nativeElement.swiper.activeIndex ?? this.index();\n const index = Math.min(imageUrls.length - 1, Math.max(0, Math.trunc(activeIndex)));\n void this.modalCtrl.dismiss({\n action: 'delete',\n index,\n value: imageUrls[index],\n } satisfies PhotoViewerResult);\n }\n\n protected resolveImageAlt(url: string, index: number): string {\n const alt = this.imageAlt();\n return typeof alt === 'function' ? alt(url, index) : alt;\n }\n}\n","<ion-header\n [translucent]=\"true\"\n [class.photo-editor-header-buttons-dark]=\"toolbarColorScheme() === 'dark'\"\n [class.photo-editor-header-buttons-light]=\"toolbarColorScheme() === 'light'\"\n [style.color-scheme]=\"toolbarColorScheme()\"\n>\n <ion-toolbar>\n <ion-buttons slot=\"start\">\n <ion-button [attr.aria-label]=\"dictionary().close\" (click)=\"modalCtrl.dismiss()\">\n <ion-icon name=\"close-outline\" slot=\"icon-only\"></ion-icon>\n </ion-button>\n </ion-buttons>\n @if (enableDelete() && imageUrls().length > 0) {\n <ion-buttons slot=\"end\">\n <ion-button class=\"button-submit\" color=\"photo-editor-danger\" fill=\"solid\" type=\"button\" (click)=\"remove()\"\n >{{ dictionary().delete }}</ion-button\n >\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 $index; let index = $index) {\n <swiper-slide>\n <div class=\"swiper-zoom-container\"><img [src]=\"url\" [alt]=\"resolveImageAlt(url, index)\" [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","/** Photo viewing modal entry point. */\nexport * from './lib/photo-viewer.page';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAKO,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;AAEpG,MAAM,mBAAmB,GAAG,OAA0B;AAC3D,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE,IAAI;AACb,CAAA,CAAC;AAEK,MAAM,qBAAqB,GAAG,MAAW;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