@rdlabo/ionic-angular-photo-editor 22.0.0-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.
Files changed (25) hide show
  1. package/README.md +57 -23
  2. package/css/ios26-header-button-color-scheme.css +114 -0
  3. package/docs/editor.md +65 -18
  4. package/docs/photo-file.md +90 -18
  5. package/docs/theme.md +21 -3
  6. package/docs/viewer.md +58 -23
  7. package/fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs +12 -0
  8. package/fesm2022/rdlabo-ionic-angular-photo-editor-editor-tui.mjs.map +1 -0
  9. package/fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs +301 -0
  10. package/fesm2022/rdlabo-ionic-angular-photo-editor-editor.mjs.map +1 -0
  11. package/fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs +30 -0
  12. package/fesm2022/rdlabo-ionic-angular-photo-editor-file-capacitor.mjs.map +1 -0
  13. package/fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs +193 -0
  14. package/fesm2022/rdlabo-ionic-angular-photo-editor-file.mjs.map +1 -0
  15. package/fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs +126 -0
  16. package/fesm2022/rdlabo-ionic-angular-photo-editor-viewer.mjs.map +1 -0
  17. package/fesm2022/rdlabo-ionic-angular-photo-editor.mjs +32 -520
  18. package/fesm2022/rdlabo-ionic-angular-photo-editor.mjs.map +1 -1
  19. package/package.json +43 -4
  20. package/types/rdlabo-ionic-angular-photo-editor-editor-tui.d.ts +6 -0
  21. package/types/rdlabo-ionic-angular-photo-editor-editor.d.ts +52 -0
  22. package/types/rdlabo-ionic-angular-photo-editor-file-capacitor.d.ts +6 -0
  23. package/types/rdlabo-ionic-angular-photo-editor-file.d.ts +13 -0
  24. package/types/rdlabo-ionic-angular-photo-editor-viewer.d.ts +32 -0
  25. package/types/rdlabo-ionic-angular-photo-editor.d.ts +144 -95
@@ -0,0 +1,193 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { ActionSheetController, Platform } from '@ionic/angular';
4
+ import { PHOTO_EDITOR_CONFIG, PhotoLoadError } from '@rdlabo/ionic-angular-photo-editor';
5
+
6
+ /** Selects and normalizes photos from browser and Capacitor sources. */
7
+ class PhotoFileService {
8
+ #actionSheetCtrl = inject(ActionSheetController);
9
+ #platform = inject(Platform);
10
+ #config = inject(PHOTO_EDITOR_CONFIG);
11
+ /** Opens the platform photo picker and returns normalized data URLs. */
12
+ async loadPhoto(options = {}) {
13
+ const limit = Math.max(1, Math.trunc(options.limit ?? 1));
14
+ const maxSize = Math.max(1, Math.trunc(options.maxSize ?? this.#config.maxSize));
15
+ const labels = { ...this.#config.labels, ...options.labels };
16
+ if (!this.#platform.is('capacitor')) {
17
+ return this.#getPictureFromBrowser(limit, maxSize);
18
+ }
19
+ const source = await this.#chooseNativeSource(labels);
20
+ if (source === 'camera') {
21
+ return this.#getPictureFromCamera(maxSize);
22
+ }
23
+ return this.#getPicturesFromAlbum(limit, maxSize);
24
+ }
25
+ async #chooseNativeSource(labels) {
26
+ const actionSheet = await this.#actionSheetCtrl.create({
27
+ buttons: [
28
+ {
29
+ text: labels.camera,
30
+ handler: () => {
31
+ void actionSheet.dismiss('camera');
32
+ },
33
+ },
34
+ {
35
+ text: labels.album,
36
+ handler: () => {
37
+ void actionSheet.dismiss('album');
38
+ },
39
+ },
40
+ {
41
+ text: labels.cancel,
42
+ role: 'cancel',
43
+ },
44
+ ],
45
+ });
46
+ await actionSheet.present();
47
+ const { data } = await actionSheet.onDidDismiss();
48
+ if (!data) {
49
+ throw new PhotoLoadError('cancelled');
50
+ }
51
+ return data;
52
+ }
53
+ async #getPictureFromCamera(maxSize) {
54
+ const camera = await this.#config.loadCamera();
55
+ const image = await camera
56
+ .getPhoto({
57
+ quality: 100,
58
+ width: maxSize,
59
+ source: 'camera',
60
+ })
61
+ .catch((error) => {
62
+ throw this.#nativePickerError(error);
63
+ });
64
+ if (!image?.dataUrl) {
65
+ throw new PhotoLoadError('unavailable');
66
+ }
67
+ if (!image.dataUrl.includes('capacitor://localhost')) {
68
+ return [image.dataUrl];
69
+ }
70
+ return [await this.#loadPhotoFromFilePath(image.dataUrl, maxSize)];
71
+ }
72
+ async #getPicturesFromAlbum(limit, maxSize) {
73
+ const camera = await this.#config.loadCamera();
74
+ const images = await camera.pickImages({ quality: 100, width: maxSize, limit }).catch((error) => {
75
+ throw this.#nativePickerError(error);
76
+ });
77
+ return Promise.all(images.photos.slice(0, limit).map(({ webPath }) => {
78
+ if (!webPath) {
79
+ throw new PhotoLoadError('unavailable');
80
+ }
81
+ return this.#loadPhotoFromFilePath(webPath, maxSize);
82
+ }));
83
+ }
84
+ #getPictureFromBrowser(limit, maxSize) {
85
+ const input = document.createElement('input');
86
+ input.type = 'file';
87
+ input.accept = 'image/*';
88
+ input.multiple = limit > 1;
89
+ input.tabIndex = -1;
90
+ input.setAttribute('aria-hidden', 'true');
91
+ input.style.position = 'fixed';
92
+ input.style.inset = '0 auto auto -10000px';
93
+ document.body.append(input);
94
+ return new Promise((resolve, reject) => {
95
+ const cleanup = () => {
96
+ input.removeEventListener('cancel', cancel);
97
+ input.removeEventListener('change', change);
98
+ input.remove();
99
+ };
100
+ const cancel = () => {
101
+ cleanup();
102
+ reject(new PhotoLoadError('cancelled'));
103
+ };
104
+ const change = () => {
105
+ const files = Array.from(input.files ?? []).slice(0, limit);
106
+ input.value = '';
107
+ cleanup();
108
+ if (files.length === 0) {
109
+ reject(new PhotoLoadError('cancelled'));
110
+ return;
111
+ }
112
+ if (files.some(({ type }) => !type.startsWith('image/'))) {
113
+ reject(new PhotoLoadError('invalid-type'));
114
+ return;
115
+ }
116
+ void Promise.all(files.map((file) => this.#readBrowserFile(file, maxSize))).then(resolve, reject);
117
+ };
118
+ input.addEventListener('cancel', cancel);
119
+ input.addEventListener('change', change);
120
+ // Keep this synchronous with the caller's click/tap so WebKit retains transient user activation.
121
+ try {
122
+ input.click();
123
+ }
124
+ catch (error) {
125
+ cleanup();
126
+ reject(new PhotoLoadError('unavailable', { cause: error }));
127
+ }
128
+ });
129
+ }
130
+ #readBrowserFile(file, maxSize) {
131
+ return new Promise((resolve, reject) => {
132
+ const reader = new FileReader();
133
+ reader.onload = (event) => {
134
+ const result = event.target?.result;
135
+ if (typeof result !== 'string') {
136
+ reject(new PhotoLoadError('unavailable'));
137
+ return;
138
+ }
139
+ void this.#loadPhotoFromFilePath(result, maxSize).then(resolve, reject);
140
+ };
141
+ reader.onerror = () => reject(new PhotoLoadError('unavailable', { cause: reader.error }));
142
+ reader.onabort = () => reject(new PhotoLoadError('cancelled'));
143
+ reader.readAsDataURL(file);
144
+ });
145
+ }
146
+ async #loadPhotoFromFilePath(filePath, maxSize) {
147
+ const editor = await this.#config.createImageEditor(document.createElement('div'), {
148
+ cssMaxWidth: maxSize,
149
+ cssMaxHeight: maxSize,
150
+ });
151
+ return this.#resizePhoto(editor, filePath, maxSize)
152
+ .catch((error) => {
153
+ throw error instanceof PhotoLoadError ? error : new PhotoLoadError('unavailable', { cause: error });
154
+ })
155
+ .finally(() => editor.destroy());
156
+ }
157
+ #nativePickerError(error) {
158
+ if (error instanceof PhotoLoadError) {
159
+ return error;
160
+ }
161
+ const message = error instanceof Error ? error.message : String(error);
162
+ return new PhotoLoadError(/cancelled|canceled/i.test(message) ? 'cancelled' : 'unavailable', { cause: error });
163
+ }
164
+ async #resizePhoto(editor, filePath, maxSize) {
165
+ const response = await fetch(filePath);
166
+ if (!response.ok) {
167
+ throw new Error(`Unable to load photo: ${response.status}`);
168
+ }
169
+ const blob = await response.blob();
170
+ const loaded = await editor.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));
171
+ const longestEdge = Math.max(loaded.newWidth, loaded.newHeight);
172
+ return editor.toDataURL({
173
+ multiplier: longestEdge > 0 ? Math.min(1, maxSize / longestEdge) : 1,
174
+ });
175
+ }
176
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
177
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoFileService, providedIn: 'root' }); }
178
+ }
179
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoFileService, decorators: [{
180
+ type: Injectable,
181
+ args: [{
182
+ providedIn: 'root',
183
+ }]
184
+ }] });
185
+
186
+ /** Photo source selection and normalization entry point. */
187
+
188
+ /**
189
+ * Generated bundle index. Do not edit.
190
+ */
191
+
192
+ export { PhotoFileService };
193
+ //# sourceMappingURL=rdlabo-ionic-angular-photo-editor-file.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rdlabo-ionic-angular-photo-editor-file.mjs","sources":["../../../projects/photo-editor/file/src/lib/photo-file.service.ts","../../../projects/photo-editor/file/src/public-api.ts","../../../projects/photo-editor/file/src/rdlabo-ionic-angular-photo-editor-file.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { ActionSheetController, Platform } from '@ionic/angular';\nimport {\n PHOTO_EDITOR_CONFIG,\n PhotoFileLabels,\n PhotoImageEditorFactory,\n PhotoLoadError,\n PhotoLoadOptions,\n} from '@rdlabo/ionic-angular-photo-editor';\n\n/** Selects and normalizes photos from browser and Capacitor sources. */\n@Injectable({\n providedIn: 'root',\n})\nexport class PhotoFileService {\n readonly #actionSheetCtrl = inject(ActionSheetController);\n readonly #platform = inject(Platform);\n readonly #config = inject(PHOTO_EDITOR_CONFIG);\n\n /** Opens the platform photo picker and returns normalized data URLs. */\n async loadPhoto(options: PhotoLoadOptions = {}): Promise<string[]> {\n const limit = Math.max(1, Math.trunc(options.limit ?? 1));\n const maxSize = Math.max(1, Math.trunc(options.maxSize ?? this.#config.maxSize));\n const labels = { ...this.#config.labels, ...options.labels } satisfies PhotoFileLabels;\n\n if (!this.#platform.is('capacitor')) {\n return this.#getPictureFromBrowser(limit, maxSize);\n }\n\n const source = await this.#chooseNativeSource(labels);\n if (source === 'camera') {\n return this.#getPictureFromCamera(maxSize);\n }\n return this.#getPicturesFromAlbum(limit, maxSize);\n }\n\n async #chooseNativeSource(labels: PhotoFileLabels): Promise<'camera' | 'album'> {\n const actionSheet = await this.#actionSheetCtrl.create({\n buttons: [\n {\n text: labels.camera,\n handler: () => {\n void actionSheet.dismiss('camera');\n },\n },\n {\n text: labels.album,\n handler: () => {\n void actionSheet.dismiss('album');\n },\n },\n {\n text: labels.cancel,\n role: 'cancel',\n },\n ],\n });\n await actionSheet.present();\n const { data } = await actionSheet.onDidDismiss<'camera' | 'album'>();\n if (!data) {\n throw new PhotoLoadError('cancelled');\n }\n return data;\n }\n\n async #getPictureFromCamera(maxSize: number): Promise<string[]> {\n const camera = await this.#config.loadCamera();\n const image = await camera\n .getPhoto({\n quality: 100,\n width: maxSize,\n source: 'camera',\n })\n .catch((error: unknown) => {\n throw this.#nativePickerError(error);\n });\n if (!image?.dataUrl) {\n throw new PhotoLoadError('unavailable');\n }\n if (!image.dataUrl.includes('capacitor://localhost')) {\n return [image.dataUrl];\n }\n return [await this.#loadPhotoFromFilePath(image.dataUrl, maxSize)];\n }\n\n async #getPicturesFromAlbum(limit: number, maxSize: number): Promise<string[]> {\n const camera = await this.#config.loadCamera();\n const images = await camera.pickImages({ quality: 100, width: maxSize, limit }).catch((error: unknown) => {\n throw this.#nativePickerError(error);\n });\n return Promise.all(\n images.photos.slice(0, limit).map(({ webPath }) => {\n if (!webPath) {\n throw new PhotoLoadError('unavailable');\n }\n return this.#loadPhotoFromFilePath(webPath, maxSize);\n }),\n );\n }\n\n #getPictureFromBrowser(limit: number, maxSize: number): Promise<string[]> {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = 'image/*';\n input.multiple = limit > 1;\n input.tabIndex = -1;\n input.setAttribute('aria-hidden', 'true');\n input.style.position = 'fixed';\n input.style.inset = '0 auto auto -10000px';\n document.body.append(input);\n\n return new Promise((resolve, reject) => {\n const cleanup = () => {\n input.removeEventListener('cancel', cancel);\n input.removeEventListener('change', change);\n input.remove();\n };\n const cancel = () => {\n cleanup();\n reject(new PhotoLoadError('cancelled'));\n };\n const change = () => {\n const files = Array.from(input.files ?? []).slice(0, limit);\n input.value = '';\n cleanup();\n if (files.length === 0) {\n reject(new PhotoLoadError('cancelled'));\n return;\n }\n if (files.some(({ type }) => !type.startsWith('image/'))) {\n reject(new PhotoLoadError('invalid-type'));\n return;\n }\n void Promise.all(files.map((file) => this.#readBrowserFile(file, maxSize))).then(resolve, reject);\n };\n\n input.addEventListener('cancel', cancel);\n input.addEventListener('change', change);\n // Keep this synchronous with the caller's click/tap so WebKit retains transient user activation.\n try {\n input.click();\n } catch (error) {\n cleanup();\n reject(new PhotoLoadError('unavailable', { cause: error }));\n }\n });\n }\n\n #readBrowserFile(file: File, maxSize: number): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (event) => {\n const result = event.target?.result;\n if (typeof result !== 'string') {\n reject(new PhotoLoadError('unavailable'));\n return;\n }\n void this.#loadPhotoFromFilePath(result, maxSize).then(resolve, reject);\n };\n reader.onerror = () => reject(new PhotoLoadError('unavailable', { cause: reader.error }));\n reader.onabort = () => reject(new PhotoLoadError('cancelled'));\n reader.readAsDataURL(file);\n });\n }\n\n async #loadPhotoFromFilePath(filePath: string, maxSize: number): Promise<string> {\n const editor = await this.#config.createImageEditor(document.createElement('div'), {\n cssMaxWidth: maxSize,\n cssMaxHeight: maxSize,\n });\n return this.#resizePhoto(editor, filePath, maxSize)\n .catch((error: unknown) => {\n throw error instanceof PhotoLoadError ? error : new PhotoLoadError('unavailable', { cause: error });\n })\n .finally(() => editor.destroy());\n }\n\n #nativePickerError(error: unknown): PhotoLoadError {\n if (error instanceof PhotoLoadError) {\n return error;\n }\n const message = error instanceof Error ? error.message : String(error);\n return new PhotoLoadError(/cancelled|canceled/i.test(message) ? 'cancelled' : 'unavailable', { cause: error });\n }\n\n async #resizePhoto(editor: Awaited<ReturnType<PhotoImageEditorFactory>>, filePath: string, maxSize: number): Promise<string> {\n const response = await fetch(filePath);\n if (!response.ok) {\n throw new Error(`Unable to load photo: ${response.status}`);\n }\n const blob = await response.blob();\n const loaded = await editor.loadImageFromFile(new File([blob], 'data.png', { type: blob.type }));\n const longestEdge = Math.max(loaded.newWidth, loaded.newHeight);\n return editor.toDataURL({\n multiplier: longestEdge > 0 ? Math.min(1, maxSize / longestEdge) : 1,\n });\n }\n}\n","/** Photo source selection and normalization entry point. */\nexport * from './lib/photo-file.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAUA;MAIa,gBAAgB,CAAA;AAClB,IAAA,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAChD,IAAA,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC5B,IAAA,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC;;AAG9C,IAAA,MAAM,SAAS,CAAC,OAAA,GAA4B,EAAE,EAAA;AAC5C,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAChF,QAAA,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAA4B;QAEtF,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE;YACnC,OAAO,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC;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,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACbD;;ACAA;;AAEG;;;;"}
@@ -0,0 +1,126 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, viewChild, computed, inject, ElementRef, effect, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
3
+ import * as i1 from '@ionic/angular';
4
+ import { IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter, ModalController, IonicSlides } from '@ionic/angular';
5
+ import { Navigation, Zoom } from 'swiper/modules';
6
+ import { Subscription, fromEvent, zipWith, withLatestFrom, throttleTime } from 'rxjs';
7
+ import { register } from 'swiper/element/bundle';
8
+ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
9
+ import { addIcons } from 'ionicons';
10
+ import { removeOutline, closeOutline } from 'ionicons/icons';
11
+
12
+ const ionComponents = [IonHeader, IonToolbar, IonButtons, IonButton, IonIcon, IonContent, IonFooter];
13
+ const dictionaryForViewer = () => ({
14
+ close: '閉じる',
15
+ delete: '削除',
16
+ });
17
+ const initializeViewerIcons = () => {
18
+ addIcons({ closeOutline, removeOutline });
19
+ };
20
+
21
+ /** Ionic modal page for zooming, browsing, and optionally deleting photos. */
22
+ class PhotoViewerPage {
23
+ constructor() {
24
+ this.imageUrls = input.required(/* @ts-ignore */
25
+ ...(ngDevMode ? [{ debugName: "imageUrls" }] : /* istanbul ignore next */ []));
26
+ this.index = input(0, { ...(ngDevMode ? { debugName: "index" } : /* istanbul ignore next */ {}), transform: coerceNumberProperty });
27
+ this.isCircle = input(false, { ...(ngDevMode ? { debugName: "isCircle" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
28
+ this.enableDelete = input(false, { ...(ngDevMode ? { debugName: "enableDelete" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
29
+ this.enableFooterSafeArea = input(false, { ...(ngDevMode ? { debugName: "enableFooterSafeArea" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
30
+ this.labels = input(/* @ts-ignore */
31
+ ...(ngDevMode ? [undefined, { debugName: "labels" }] : /* istanbul ignore next */ []));
32
+ this.imageAlt = input('', /* @ts-ignore */
33
+ ...(ngDevMode ? [{ debugName: "imageAlt" }] : /* istanbul ignore next */ []));
34
+ this.toolbarColorScheme = input.required(/* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "toolbarColorScheme" }] : /* istanbul ignore next */ []));
36
+ this.swiper = viewChild('swiper', /* @ts-ignore */
37
+ ...(ngDevMode ? [{ debugName: "swiper" }] : /* istanbul ignore next */ []));
38
+ this.dictionary = computed(() => ({ ...dictionaryForViewer(), ...this.labels() }), /* @ts-ignore */
39
+ ...(ngDevMode ? [{ debugName: "dictionary" }] : /* istanbul ignore next */ []));
40
+ this.watchSwipe$ = new Subscription();
41
+ this.modalCtrl = inject(ModalController);
42
+ this.el = inject(ElementRef);
43
+ this.swiperInitialized = false;
44
+ this.initializeSwiper = effect(() => {
45
+ const swiper = this.swiper()?.nativeElement;
46
+ if (!swiper || this.swiperInitialized) {
47
+ return;
48
+ }
49
+ this.swiperInitialized = true;
50
+ const index = this.index();
51
+ Object.assign(swiper, {
52
+ modules: [Navigation, Zoom, IonicSlides],
53
+ initialSlide: index,
54
+ slidesPerView: 1,
55
+ pagination: {
56
+ enabled: true,
57
+ clickable: true,
58
+ },
59
+ zoom: true,
60
+ });
61
+ swiper.initialize();
62
+ swiper.swiper.zoom.enable();
63
+ swiper.swiper.activeIndex = index;
64
+ swiper.swiper.update();
65
+ }, /* @ts-ignore */
66
+ ...(ngDevMode ? [{ debugName: "initializeSwiper" }] : /* istanbul ignore next */ []));
67
+ register();
68
+ initializeViewerIcons();
69
+ }
70
+ ngOnInit() {
71
+ this.watchSwipe$.add(fromEvent(this.el.nativeElement, 'touchstart')
72
+ .pipe(zipWith(fromEvent(this.el.nativeElement, 'touchend').pipe(withLatestFrom(fromEvent(this.el.nativeElement, 'touchmove')))), throttleTime(1))
73
+ .subscribe(([touchstart, [_, touchmove]]) => {
74
+ const touchstartClientX = touchstart.touches ? touchstart.touches[0].clientX : touchstart.detail[1].clientX;
75
+ const touchmoveClientX = touchmove.touches ? touchmove.touches[0].clientX : touchmove.detail[1].clientX;
76
+ const touchstartClientY = touchstart.touches ? touchstart.touches[0].clientY : touchstart.detail[1].clientY;
77
+ const touchmoveClientY = touchmove.touches ? touchmove.touches[0].clientY : touchmove.detail[1].clientY;
78
+ const xDiff = touchstartClientX - touchmoveClientX;
79
+ const yDiff = touchstartClientY - touchmoveClientY;
80
+ const slides = this.swiper()?.nativeElement.querySelectorAll('swiper-slide') ?? [];
81
+ const isZoomed = Array.from(slides).find((slide) => {
82
+ return ['swiper-slide-zoomed', 'swiper-slide-active'].every((c) => slide.classList.contains(c));
83
+ });
84
+ const threshold = touchmove.touches ? -50 : -5;
85
+ if (!isZoomed && Math.abs(xDiff) < Math.abs(threshold) && yDiff < threshold && touchstart.timeStamp <= touchmove.timeStamp) {
86
+ this.watchSwipe$.unsubscribe();
87
+ this.modalCtrl.dismiss();
88
+ }
89
+ }));
90
+ }
91
+ ngOnDestroy() {
92
+ this.watchSwipe$.unsubscribe();
93
+ }
94
+ remove() {
95
+ const imageUrls = this.imageUrls();
96
+ if (imageUrls.length === 0) {
97
+ return;
98
+ }
99
+ const activeIndex = this.swiper()?.nativeElement.swiper.activeIndex ?? this.index();
100
+ const index = Math.min(imageUrls.length - 1, Math.max(0, Math.trunc(activeIndex)));
101
+ void this.modalCtrl.dismiss({
102
+ action: 'delete',
103
+ index,
104
+ value: imageUrls[index],
105
+ });
106
+ }
107
+ resolveImageAlt(url, index) {
108
+ const alt = this.imageAlt();
109
+ return typeof alt === 'function' ? alt(url, index) : alt;
110
+ }
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=\"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", 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
+ }
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: PhotoViewerPage, decorators: [{
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=\"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", 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
+ }], 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
+
119
+ /** Photo viewing modal entry point. */
120
+
121
+ /**
122
+ * Generated bundle index. Do not edit.
123
+ */
124
+
125
+ export { PhotoViewerPage };
126
+ //# sourceMappingURL=rdlabo-ionic-angular-photo-editor-viewer.mjs.map
@@ -0,0 +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 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;AAiD1B,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,I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