ng-images-preview 2.0.0 → 2.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
CHANGED
|
@@ -114,12 +114,33 @@ export class AppModule {}
|
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
**Option C: Gallery Mode**
|
|
117
|
-
Pass a list of images to `previewImages` to enable gallery navigation
|
|
117
|
+
Pass a list of images to `previewImages` to enable gallery navigation and the automatic **Thumbnail Strip**.
|
|
118
118
|
```html
|
|
119
119
|
<img
|
|
120
120
|
src="item1.jpg"
|
|
121
121
|
[ngImagesPreview]="'item1-highres.jpg'"
|
|
122
|
-
[previewImages]="['item1
|
|
122
|
+
[previewImages]="['item1.jpg', 'item2.jpg', 'item3.jpg']">
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Option D: Toolbar Extensions**
|
|
126
|
+
Add custom buttons (like Download) using an `ng-template`.
|
|
127
|
+
```html
|
|
128
|
+
<ng-template #myExtraButtons>
|
|
129
|
+
<button class="toolbar-btn" (click)="download()">
|
|
130
|
+
<svg>...</svg>
|
|
131
|
+
</button>
|
|
132
|
+
</ng-template>
|
|
133
|
+
|
|
134
|
+
<img src="pic.jpg" ngImagesPreview [toolbarExtensions]="myExtraButtons">
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Option E: Performance (Srcsets)**
|
|
138
|
+
Support responsive images for faster loading on mobile.
|
|
139
|
+
```html
|
|
140
|
+
<img
|
|
141
|
+
src="thumb.jpg"
|
|
142
|
+
ngImagesPreview
|
|
143
|
+
[previewSrcsets]="['image-400w.jpg 400w, image-800w.jpg 800w']">
|
|
123
144
|
```
|
|
124
145
|
|
|
125
146
|
### 3. Custom Template
|
|
@@ -147,6 +168,10 @@ Take full control of the UI by providing a template.
|
|
|
147
168
|
| `ngImagesPreview` | `string` | `''` | High-res URL. If empty, tries to read `src` from host or child `img`. |
|
|
148
169
|
| `previewImages` | `string[]` | `[]` | List of image URLs for gallery navigation. |
|
|
149
170
|
| `previewTemplate` | `TemplateRef` | `undefined` | Custom template to render instead of the default viewer. |
|
|
171
|
+
| `previewSrcsets` | `string[]` | `[]` | List of `srcset` strings for gallery navigation. |
|
|
172
|
+
| `showThumbnails` | `boolean` | `true` | Whether to show the thumbnail strip. |
|
|
173
|
+
| `showToolbar` | `boolean` | `true` | Whether to show the top toolbar. |
|
|
174
|
+
| `toolbarExtensions`| `TemplateRef` | `undefined` | Custom template for toolbar buttons. |
|
|
150
175
|
|
|
151
176
|
### Component Inputs (`ImagesPreviewComponent`)
|
|
152
177
|
|
|
@@ -158,6 +183,10 @@ If you use the component directly:
|
|
|
158
183
|
| `images` | `string[]` | `[]` | List of images for gallery. |
|
|
159
184
|
| `initialIndex` | `number` | `0` | Initial image index in gallery. |
|
|
160
185
|
| `customTemplate` | `TemplateRef` | `undefined` | Custom template for the overlay content. |
|
|
186
|
+
| `srcsets` | `string[]` | `[]` | List of `srcset` strings for images. |
|
|
187
|
+
| `showThumbnails` | `boolean` | `true` | Whether to show the thumbnail strip. |
|
|
188
|
+
| `showToolbar` | `boolean` | `true` | Whether to show the top toolbar. |
|
|
189
|
+
| `toolbarExtensions`| `TemplateRef` | `undefined` | Custom template for toolbar buttons. |
|
|
161
190
|
|
|
162
191
|
### Template Context (for Custom Templates)
|
|
163
192
|
|
|
@@ -173,6 +202,8 @@ When using `previewTemplate`, you get access to:
|
|
|
173
202
|
| `flipV` | `boolean` | Vertical flip state. |
|
|
174
203
|
| `isLoading` | `boolean` | True if image is loading. |
|
|
175
204
|
| `hasError` | `boolean` | True if image failed to load. |
|
|
205
|
+
| `currentIndex` | `number` | Current index in gallery (0-based). |
|
|
206
|
+
| `total` | `number` | Total number of images in gallery. |
|
|
176
207
|
|
|
177
208
|
#### `actions`
|
|
178
209
|
| Method | Description |
|
|
@@ -187,6 +218,7 @@ When using `previewTemplate`, you get access to:
|
|
|
187
218
|
| `close()` | Close the preview. |
|
|
188
219
|
| `next()` | Go to next image (if gallery). |
|
|
189
220
|
| `prev()` | Go to previous image (if gallery). |
|
|
221
|
+
| `jumpTo(index)` | Jump to a specific index in gallery. |
|
|
190
222
|
|
|
191
223
|
### CSS Variables (Theming)
|
|
192
224
|
|
|
@@ -194,13 +226,9 @@ You can customize the look and feel by overriding these CSS variables in your `s
|
|
|
194
226
|
|
|
195
227
|
```css
|
|
196
228
|
:root {
|
|
197
|
-
/* Overlay
|
|
229
|
+
/* Overlay */
|
|
198
230
|
--ng-img-background: rgba(0, 0, 0, 0.95);
|
|
199
|
-
|
|
200
|
-
/* Text & Icons */
|
|
201
231
|
--ng-img-text-color: rgba(255, 255, 255, 0.8);
|
|
202
|
-
|
|
203
|
-
/* Z-Index */
|
|
204
232
|
--ng-img-z-index: 50;
|
|
205
233
|
|
|
206
234
|
/* Toolbar */
|
|
@@ -208,7 +236,15 @@ You can customize the look and feel by overriding these CSS variables in your `s
|
|
|
208
236
|
--ng-img-toolbar-hover: rgba(255, 255, 255, 0.2);
|
|
209
237
|
--ng-img-gap: 16px;
|
|
210
238
|
|
|
211
|
-
/*
|
|
239
|
+
/* Thumbnails */
|
|
240
|
+
--ng-img-thumb-strip-bg: rgba(0, 0, 0, 0.4);
|
|
241
|
+
--ng-img-thumb-width: 60px;
|
|
242
|
+
--ng-img-thumb-height: 40px;
|
|
243
|
+
--ng-img-thumb-gap: 8px;
|
|
244
|
+
--ng-img-thumb-border-radius: 6px;
|
|
245
|
+
--ng-img-thumb-active-border: white;
|
|
246
|
+
|
|
247
|
+
/* Misc */
|
|
212
248
|
--ng-img-item-bg: rgba(0, 0, 0, 0.3);
|
|
213
249
|
}
|
|
214
250
|
```
|
|
@@ -216,6 +216,8 @@ class ImagesPreviewComponent {
|
|
|
216
216
|
flipV: this.flipV(),
|
|
217
217
|
isLoading: !this.loadedImages().has(this.src() || '') && !this.hasError(),
|
|
218
218
|
hasError: this.hasError(),
|
|
219
|
+
currentIndex: this.currentIndex(),
|
|
220
|
+
total: this.images()?.length ?? 1,
|
|
219
221
|
}), ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
220
222
|
// Actions object for template
|
|
221
223
|
actions = {
|
|
@@ -227,6 +229,9 @@ class ImagesPreviewComponent {
|
|
|
227
229
|
flipVertical: () => this.flipVertical(),
|
|
228
230
|
reset: () => this.reset(),
|
|
229
231
|
close: () => this.close(),
|
|
232
|
+
next: () => this.next(),
|
|
233
|
+
prev: () => this.prev(),
|
|
234
|
+
jumpTo: (index) => this.jumpTo(index),
|
|
230
235
|
};
|
|
231
236
|
MIN_SCALE = 0.5;
|
|
232
237
|
MAX_SCALE = 5;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ng-images-preview.mjs","sources":["../../../projects/ng-images-preview/src/lib/icons.ts","../../../projects/ng-images-preview/src/lib/images-preview.component.ts","../../../projects/ng-images-preview/src/lib/images-preview.directive.ts","../../../projects/ng-images-preview/src/lib/images-preview.module.ts","../../../projects/ng-images-preview/src/public-api.ts","../../../projects/ng-images-preview/src/ng-images-preview.ts"],"sourcesContent":["export const PREVIEW_ICONS = {\n close: '<svg viewBox=\"0 0 24 24\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>',\n prev: '<svg viewBox=\"0 0 24 24\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg>',\n next: '<svg viewBox=\"0 0 24 24\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg>',\n flipH: '<svg viewBox=\"0 0 24 24\"><path d=\"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z\"/></svg>',\n flipV: '<svg viewBox=\"0 0 24 24\"><path d=\"M7 21h2v-2H7v2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-12h2V7h-2v2zm-4 4h2v-4h-2v4zm-8-8h2V3H7v2zm8 0h2V3h-2v2zm-4 8h4v-4h-4v4zM3 15h2v-2H3v2zm12-4h2v-4H3v4h2v-2h10v2zM7 3v2h2V3H7zm8 20h2v-2h-2v2zm-4 0h2v-2h-2v2zm4-12h2v-2h-2v2zM3 19c0 1.1.9 2 2 2h2v-2H5v-2H3v2zm16-6h2v-2h-2v2zm0 4v2c0 1.1-.9 2-2 2h-2v-2h2v-2h2zM5 3c-1.1 0-2 .9-2 2h2V3z\"/></svg>',\n rotateLeft: '<svg viewBox=\"0 0 24 24\"><path d=\"M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z\"/></svg>',\n rotateRight: '<svg viewBox=\"0 0 24 24\"><path d=\"M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z\"/></svg>',\n zoomOut: '<svg viewBox=\"0 0 24 24\"><path d=\"M19 13H5v-2h14v2z\"/></svg>',\n zoomIn: '<svg viewBox=\"0 0 24 24\"><path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/></svg>'\n};\n","import {\n Component,\n ElementRef,\n HostListener,\n computed,\n input,\n signal,\n viewChildren,\n ChangeDetectionStrategy,\n TemplateRef,\n inject,\n effect,\n PLATFORM_ID,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { PREVIEW_ICONS } from './icons';\n\nexport interface ImagesPreviewState {\n src: string;\n scale: number;\n rotate: number;\n flipH: boolean;\n flipV: boolean;\n isLoading: boolean;\n hasError: boolean;\n}\n\nexport interface ImagesPreviewActions {\n zoomIn: () => void;\n zoomOut: () => void;\n rotateLeft: () => void;\n rotateRight: () => void;\n flipHorizontal: () => void;\n flipVertical: () => void;\n reset: () => void;\n close: () => void;\n}\n\n/**\n * Configuration for the toolbar.\n */\nexport interface ToolbarConfig {\n showZoom?: boolean;\n showRotate?: boolean;\n showFlip?: boolean;\n}\n\n/**\n * Context passed to the custom template.\n */\nexport interface ImagesPreviewContext {\n $implicit: ImagesPreviewState;\n actions: ImagesPreviewActions;\n}\n\ninterface TrackingPoint {\n x: number;\n y: number;\n time: number;\n}\n\ninterface ImageBufferItem {\n src: string;\n index: number;\n offset: number; // -1 (prev), 0 (curr), 1 (next)\n srcset?: string;\n}\n\n/**\n * Image Preview Overlay Component.\n * Displays images in a full-screen overlay with zoom, rotate, and pan capabilities.\n */\n@Component({\n selector: 'ng-images-preview',\n standalone: true,\n imports: [CommonModule],\n template: `\n <div\n class=\"overlay\"\n [@fadeInOut]\n (click)=\"close()\"\n (keydown)=\"onOverlayKey($event)\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Close preview overlay\"\n [style.background-color]=\"overlayBackground()\"\n >\n <!-- Custom Template Support -->\n @if (customTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: { $implicit: state(), actions: actions }\"\n ></ng-container>\n } @else {\n <!-- Loading -->\n @if (!loadedImages().has(src()) && !hasError()) {\n <div class=\"loader\">Loading...</div>\n }\n\n <!-- Error -->\n @if (hasError()) {\n <div class=\"error\">Failed to load image</div>\n }\n\n <!-- Image Container -->\n <div\n class=\"image-container\"\n (keydown)=\"onContainerKey($event)\"\n (touchstart)=\"onTouchStart($event)\"\n tabindex=\"-1\"\n >\n @for (item of activeBuffer(); track item.src) {\n <img\n #imgRef\n [src]=\"item.src\"\n [srcset]=\"item.srcset || ''\"\n [class.opacity-0]=\"item.offset === 0 && (!loadedImages().has(item.src) || hasError())\"\n class=\"preview-image\"\n [class.dragging]=\"isDragging()\"\n [class.inertia]=\"isInertia()\"\n [class.pinching]=\"isPinching()\"\n [class.zoom-in]=\"scale() === 1\"\n [class.zoom-out]=\"scale() > 1\"\n [class.hidden]=\"item.offset !== 0 && scale() > 1\"\n [style.transform]=\"getTransform(item.offset)\"\n (load)=\"onImageLoad(item.src)\"\n (error)=\"onImageError(item.src)\"\n (mousedown)=\"onMouseDown($event)\"\n (click)=\"$event.stopPropagation()\"\n draggable=\"false\"\n alt=\"Preview\"\n />\n }\n </div>\n\n <!-- Close Button -->\n <button class=\"close-btn\" (click)=\"close()\" aria-label=\"Close preview\" [innerHTML]=\"icons.close\">\n </button>\n\n <!-- Navigation -->\n @if (images() && images()!.length > 1) {\n <!-- Check if not first -->\n @if (currentIndex() > 0) {\n <button\n class=\"nav-btn prev\"\n (click)=\"prev(); $event.stopPropagation()\"\n (mousedown)=\"$event.stopPropagation()\"\n aria-label=\"Previous image\"\n [innerHTML]=\"icons.prev\"\n >\n </button>\n }\n <!-- Check if not last -->\n @if (currentIndex() < images()!.length - 1) {\n <button\n class=\"nav-btn next\"\n (click)=\"next(); $event.stopPropagation()\"\n (mousedown)=\"$event.stopPropagation()\"\n aria-label=\"Next image\"\n [innerHTML]=\"icons.next\"\n >\n </button>\n }\n\n <!-- Counter -->\n <div class=\"counter\">{{ currentIndex() + 1 }} / {{ images()!.length }}</div>\n }\n\n <!-- Toolbar -->\n <!-- Toolbar -->\n @if (showToolbar()) {\n <div\n class=\"toolbar\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onToolbarKey($event)\"\n tabindex=\"0\"\n >\n <!-- Flip -->\n @if (toolbarConfig().showFlip) {\n <button class=\"toolbar-btn\" (click)=\"flipHorizontal()\" aria-label=\"Flip Horizontal\" [innerHTML]=\"icons.flipH\">\n </button>\n <button class=\"toolbar-btn\" (click)=\"flipVertical()\" aria-label=\"Flip Vertical\" [innerHTML]=\"icons.flipV\">\n </button>\n }\n \n <!-- Extensions (Custom Buttons) -->\n @if (toolbarExtensions()) {\n <ng-container *ngTemplateOutlet=\"toolbarExtensions(); context: { $implicit: images()![currentIndex()] }\"></ng-container>\n }\n <!-- Rotate -->\n @if (toolbarConfig().showRotate) {\n <button class=\"toolbar-btn\" (click)=\"rotateLeft()\" aria-label=\"Rotate Left\" [innerHTML]=\"icons.rotateLeft\">\n </button>\n <button class=\"toolbar-btn\" (click)=\"rotateRight()\" aria-label=\"Rotate Right\" [innerHTML]=\"icons.rotateRight\">\n </button>\n }\n <!-- Zoom -->\n @if (toolbarConfig().showZoom) {\n <button class=\"toolbar-btn\" (click)=\"zoomOut()\" aria-label=\"Zoom Out\" [innerHTML]=\"icons.zoomOut\">\n </button>\n <button class=\"toolbar-btn\" (click)=\"zoomIn()\" aria-label=\"Zoom In\" [innerHTML]=\"icons.zoomIn\">\n </button>\n }\n </div>\n }\n }\n \n <!-- Thumbnails -->\n @if (images() && images()!.length > 1 && showThumbnails()) {\n <div class=\"thumbnail-strip\" (click)=\"$event.stopPropagation()\">\n @for (img of images(); track img; let i = $index) {\n <div \n #thumbRef\n class=\"thumbnail-item\" \n [class.active]=\"i === currentIndex()\"\n (click)=\"jumpTo(i)\"\n >\n <img [src]=\"img\" loading=\"lazy\" alt=\"Thumbnail\">\n </div>\n }\n </div>\n }\n </div>\n `,\n styleUrls: ['./images-preview.component.css'],\n animations: [\n trigger('fadeInOut', [\n transition(':enter', [\n style({ opacity: 0 }),\n animate('200ms ease-out', style({ opacity: 1 })),\n ]),\n transition(':leave', [animate('200ms ease-in', style({ opacity: 0 }))]),\n ]),\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:mouseup)': 'onMouseUp()',\n '(document:touchmove)': 'onTouchMove($event)',\n '(document:touchend)': 'onTouchEnd($event)',\n '(document:keydown.arrowleft)': 'prev()',\n '(document:keydown.arrowright)': 'next()',\n '(document:keydown.escape)': 'close()',\n },\n})\nexport class ImagesPreviewComponent {\n /**\n * The image source to display.\n * @required\n */\n src = input.required<string>();\n\n /**\n * List of image URLs for gallery navigation.\n */\n images = input<string[]>();\n\n /**\n * Optional srcset for the single image `src`.\n */\n srcset = input<string>();\n\n /**\n * List of srcsets corresponding to the `images` array.\n * Must be 1:1 mapped with `images`.\n */\n srcsets = input<string[]>();\n\n /**\n * Initial index for gallery navigation.\n * @default 0\n */\n initialIndex = input(0);\n\n /**\n * DOMRect of the element that opened the preview.\n * Used for FLIP animation calculation.\n */\n openerRect = input<DOMRect | undefined>(undefined);\n\n /**\n * Custom template to render instead of the default viewer.\n * Exposes `ImagesPreviewContext`.\n */\n customTemplate = input<TemplateRef<ImagesPreviewContext>>();\n\n /**\n * Configuration for the toolbar buttons.\n */\n toolbarConfig = input<ToolbarConfig>({\n showZoom: true,\n showRotate: true,\n showFlip: true,\n });\n\n /**\n * Callback function called when the preview is closed.\n */\n closeCallback: () => void = () => {\n /* noop */\n };\n\n imgRefs = viewChildren<ElementRef<HTMLImageElement>>('imgRef');\n\n thumbRefs = viewChildren<ElementRef<HTMLElement>>('thumbRef');\n\n // State signals\n currentIndex = signal(0);\n // isLoading = signal(true); // Replaced by per-image tracking\n hasError = signal(false);\n\n // Track loaded state for each image source\n loadedImages = signal<Set<string>>(new Set());\n\n // Toggle thumbnails\n showThumbnails = input(true);\n\n // Toggle toolbar\n showToolbar = input(true);\n\n // Toolbar custom extensions\n toolbarExtensions = input<TemplateRef<any> | null>(null);\n\n activeBuffer = computed<ImageBufferItem[]>(() => {\n const imgs = this.images();\n const srcsets = this.srcsets();\n const current = this.currentIndex();\n\n // Single image or fallback\n if (!imgs || imgs.length === 0) {\n return [{ src: this.src(), index: 0, offset: 0, srcset: this.srcset() }];\n }\n\n const buffer: ImageBufferItem[] = [];\n const total = imgs.length;\n\n // Helper to get srcset safely\n const getSrcset = (i: number) => (srcsets && srcsets[i]) ? srcsets[i] : undefined;\n\n // Prev (-1)\n if (current > 0) {\n buffer.push({\n src: imgs[current - 1],\n index: current - 1,\n offset: -1,\n srcset: getSrcset(current - 1)\n });\n }\n\n // Current (0)\n buffer.push({\n src: imgs[current],\n index: current,\n offset: 0,\n srcset: getSrcset(current)\n });\n\n // Next (+1)\n if (current < total - 1) {\n buffer.push({\n src: imgs[current + 1],\n index: current + 1,\n offset: 1,\n srcset: getSrcset(current + 1)\n });\n }\n\n return buffer;\n });\n\n private platformId = inject(PLATFORM_ID);\n private sanitizer = inject(DomSanitizer);\n\n // Icons map with SafeHtml\n icons: { [key in keyof typeof PREVIEW_ICONS]: SafeHtml };\n\n constructor() {\n // Sanitize icons once\n this.icons = Object.keys(PREVIEW_ICONS).reduce((acc, key) => {\n acc[key as keyof typeof PREVIEW_ICONS] = this.sanitizer.bypassSecurityTrustHtml(\n PREVIEW_ICONS[key as keyof typeof PREVIEW_ICONS]\n );\n return acc;\n }, {} as { [key in keyof typeof PREVIEW_ICONS]: SafeHtml });\n\n\n // defined in class body usually, but here to show logical grouping\n effect(\n () => {\n // Initialize index from input\n this.currentIndex.set(this.initialIndex());\n },\n { allowSignalWrites: true },\n );\n\n effect(\n () => {\n // Reset state when index changes\n this.currentIndex();\n this.hasError.set(false);\n this.reset(); // Reset zoom/rotate\n },\n { allowSignalWrites: true },\n );\n\n // Preload next/prev images\n effect(() => {\n const index = this.currentIndex();\n const images = this.images();\n\n if (isPlatformBrowser(this.platformId) && images && images.length > 0) {\n const srcsets = this.srcsets();\n const getSrcset = (i: number) => (srcsets && srcsets[i]) ? srcsets[i] : undefined;\n\n // Next\n if (index < images.length - 1) {\n const img = new Image();\n const s = getSrcset(index + 1);\n if (s) img.srcset = s;\n img.src = images[index + 1];\n }\n // Prev\n if (index > 0) {\n const img = new Image();\n const s = getSrcset(index - 1);\n if (s) img.srcset = s;\n img.src = images[index - 1];\n }\n }\n });\n\n effect(() => {\n // Handle FLIP on open\n const opener = this.openerRect();\n if (opener && !this.flipAnimDone) {\n // Defer to let the view render so we know final position\n setTimeout(() => this.runFlipAnimation(opener));\n }\n });\n\n // Auto-scroll thumbnails\n effect(() => {\n const index = this.currentIndex();\n const show = this.showThumbnails();\n const refs = this.thumbRefs();\n\n if (show && refs && refs[index]) {\n const el = refs[index].nativeElement;\n const container = el.parentElement;\n\n if (container) {\n const scrollLeft = el.offsetLeft + el.offsetWidth / 2 - container.offsetWidth / 2;\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth'\n });\n }\n }\n });\n }\n\n private flipAnimDone = false;\n\n scale = signal(1);\n translateX = signal(0);\n translateY = signal(0);\n rotate = signal(0);\n flipH = signal(false);\n flipV = signal(false);\n\n isDragging = signal(false);\n isInertia = signal(false);\n\n // Touch state\n private initialPinchDistance = 0;\n private initialScale = 1;\n isPinching = signal(false);\n\n // Computed state object for template\n state = computed<ImagesPreviewState>(() => ({\n src: this.src(),\n scale: this.scale(),\n rotate: this.rotate(),\n flipH: this.flipH(),\n flipV: this.flipV(),\n isLoading: !this.loadedImages().has(this.src() || '') && !this.hasError(),\n hasError: this.hasError(),\n }));\n\n // Actions object for template\n actions: ImagesPreviewActions = {\n zoomIn: () => this.zoomIn(),\n zoomOut: () => this.zoomOut(),\n rotateLeft: () => this.rotateLeft(),\n rotateRight: () => this.rotateRight(),\n flipHorizontal: () => this.flipHorizontal(),\n flipVertical: () => this.flipVertical(),\n reset: () => this.reset(),\n close: () => this.close(),\n };\n\n private readonly MIN_SCALE = 0.5;\n private readonly MAX_SCALE = 5;\n private readonly ZOOM_STEP = 0.5;\n\n private startX = 0;\n private startY = 0;\n private lastTranslateX = 0;\n private lastTranslateY = 0;\n\n // Physics state\n private velocityX = 0;\n private velocityY = 0;\n private touchHistory: TrackingPoint[] = [];\n private cachedConstraints: { maxX: number; maxY: number } | null = null;\n private lastTimestamp = 0;\n private rafId: number | null = null;\n private readonly FRICTION = 0.95; // Super smooth glide\n private readonly VELOCITY_THRESHOLD = 0.01;\n private readonly MAX_VELOCITY = 3; // Cap speed to prevent teleporting\n\n // Updated transform logic for slide buffer\n getTransform(offset: number) {\n const viewportWidth = window.innerWidth;\n const spacing = 16; // Gap between images\n const baseOffset = offset * (viewportWidth + spacing);\n\n // Dynamic movement from touch/inertia\n // Global translateX applies to the whole \"track\"\n const x = this.translateX() + baseOffset;\n\n // Y-axis drag (Pull-to-Close) usually only affects the active image visually,\n // but moving the whole track is acceptable and simpler.\n // Ideally, neighbors stay at Y=0.\n const effectiveY = offset === 0 ? this.translateY() : 0;\n\n const effectiveScale = offset === 0 ? this.scale() : 1;\n const effectiveRotate = offset === 0 ? this.rotate() : 0;\n const flipH = offset === 0 ? this.flipH() : false;\n const flipV = offset === 0 ? this.flipV() : false;\n\n const scaleX = flipH ? -1 : 1;\n const scaleY = flipV ? -1 : 1;\n\n // FLIP override\n if (offset === 0) {\n const flip = this.flipTransform();\n if (flip) return flip;\n }\n\n return `translate3d(${x}px, ${effectiveY}px, 0) scale(${effectiveScale}) rotate(${effectiveRotate}deg) scaleX(${scaleX}) scaleY(${scaleY})`;\n }\n\n // FLIP State\n private flipTransform = signal('');\n\n // Helper to get current active image element\n private getCurrentImageElement(): HTMLImageElement | undefined {\n const buffer = this.activeBuffer();\n const index = buffer.findIndex((item) => item.offset === 0);\n if (index === -1) return undefined;\n return this.imgRefs()[index]?.nativeElement;\n }\n\n private runFlipAnimation(opener: DOMRect) {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const imgEl = this.getCurrentImageElement();\n if (!imgEl) return;\n\n // 1. First: Final state is already rendered (centered, max fit)\n const finalRect = imgEl.getBoundingClientRect();\n\n // 2. Invert: Calculate scale and translate to match opener\n const scaleX = opener.width / finalRect.width;\n const scaleY = opener.height / finalRect.height;\n // Note: we use the larger scale to crop? \n // Or fit? \n // Usually we want to fit.\n // Let's matching fitting.\n\n // Actually, most simple FLIP matches dimensions exactly.\n // But aspect ratios might differ.\n // Let's just match the rect exactly.\n\n const deltaX = opener.left - finalRect.left + (opener.width - finalRect.width) / 2;\n const deltaY = opener.top - finalRect.top + (opener.height - finalRect.height) / 2;\n\n // Apply Invert Transform immediately (no transition)\n imgEl.style.transition = 'none';\n this.flipTransform.set(`translate3d(${deltaX}px, ${deltaY}px, 0) scale(${scaleX}, ${scaleY})`);\n\n // Force Reflow\n imgEl.offsetHeight;\n\n // 3. Play\n requestAnimationFrame(() => {\n // Enable transition\n imgEl.style.transition = 'transform 300ms cubic-bezier(0.2, 0, 0.2, 1)';\n // Remove override (animates to Final)\n this.flipTransform.set('');\n this.flipAnimDone = true;\n\n // CLEANUP: Remove transition after animation wraps up so dragging/panning is instant\n setTimeout(() => {\n imgEl.style.transition = '';\n }, 300);\n });\n }\n\n overlayBackground = computed(() => {\n const y = Math.abs(this.translateY());\n const scale = this.scale();\n if (scale === 1 && y > 0) {\n const opacity = Math.max(0, 0.95 - y / 400); // Fade out as we drag down\n return `rgba(0, 0, 0, ${opacity})`;\n }\n return 'var(--ng-img-background)';\n });\n\n @HostListener('document:keydown.escape')\n onEscape() {\n this.close();\n }\n\n @HostListener('document:mousemove', ['$event'])\n onMouseMove(event: MouseEvent) {\n if (!this.isDragging()) return;\n event.preventDefault();\n\n const deltaX = event.clientX - this.startX;\n const deltaY = event.clientY - this.startY;\n\n let nextX = this.lastTranslateX + deltaX;\n let nextY = this.lastTranslateY + deltaY;\n\n // Apply strict clamping during move\n this.applyMoveConstraints(nextX, nextY);\n }\n\n private applyMoveConstraints(nextX: number, nextY: number) {\n if (!isPlatformBrowser(this.platformId)) {\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n return;\n }\n\n const img = this.getCurrentImageElement();\n if (!img) {\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n return;\n }\n\n const scale = this.scale();\n\n // If scale is 1, we allow free movement for Pull-to-Close and Swipe Nav\n if (scale === 1) {\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n return;\n }\n\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n const currentWidth = (isRotated ? baseHeight : baseWidth) * scale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * scale;\n\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const maxTranslateX = Math.max(0, (currentWidth - viewportWidth) / 2);\n const maxTranslateY = Math.max(0, (currentHeight - viewportHeight) / 2);\n\n // Clamp\n const clampedX = Math.max(-maxTranslateX, Math.min(maxTranslateX, nextX));\n const clampedY = Math.max(-maxTranslateY, Math.min(maxTranslateY, nextY));\n\n this.translateX.set(clampedX);\n this.translateY.set(clampedY);\n }\n\n onTouchMove(event: TouchEvent) {\n if (!this.isDragging() && !this.isPinching()) return;\n\n // Prevent default to stop page scrolling/zooming\n if (event.cancelable) {\n event.preventDefault();\n }\n\n const touches = event.touches;\n\n // One finger: Pan\n if (touches.length === 1 && this.isDragging() && !this.isPinching()) {\n const now = Date.now();\n\n // Add point to history\n this.touchHistory.push({\n x: touches[0].clientX,\n y: touches[0].clientY,\n time: now,\n });\n\n // Prune history (keep last 100ms)\n const cutoff = now - 100;\n while (this.touchHistory.length > 0 && this.touchHistory[0].time < cutoff) {\n this.touchHistory.shift();\n }\n\n const deltaX = touches[0].clientX - this.lastTouchX;\n const deltaY = touches[0].clientY - this.lastTouchY;\n\n // Note: We do NOT calculate velocity here anymore to avoid noise.\n // We verify velocity at TouchEnd using history.\n\n const currentX = this.translateX();\n const currentY = this.translateY();\n\n let nextX = currentX + deltaX;\n let nextY = currentY + deltaY;\n\n // Apply rubber banding if out of bounds\n // Use cached constraints to avoid reflows\n const constraints = this.cachedConstraints || this.getConstraints();\n\n // At scale 1, we want linear drag for pull-to-close (Y) and swipe (X)\n // But we can keep rubber banding if it feels good.\n // For Pull-to-Close, standard is 1:1 or slightly resisted. \n // Let's stick to the current logic which applies resistance if \"out of bounds\".\n // Since at scale 1 bounds are 0, it will apply resistance immediately.\n // We want easier pull.\n\n if (this.scale() === 1) {\n // Reduce resistance\n nextY = currentY + deltaY;\n nextX = currentX + deltaX;\n } else {\n if (nextX > constraints.maxX) {\n nextX = constraints.maxX + (nextX - constraints.maxX) * 0.5;\n } else if (nextX < -constraints.maxX) {\n nextX = -constraints.maxX + (nextX + constraints.maxX) * 0.5;\n }\n\n if (nextY > constraints.maxY) {\n nextY = constraints.maxY + (nextY - constraints.maxY) * 0.5;\n } else if (nextY < -constraints.maxY) {\n nextY = -constraints.maxY + (nextY + constraints.maxY) * 0.5;\n }\n }\n\n if (nextY > constraints.maxY) {\n nextY = constraints.maxY + (nextY - constraints.maxY) * 0.5;\n } else if (nextY < -constraints.maxY) {\n nextY = -constraints.maxY + (nextY + constraints.maxY) * 0.5;\n }\n\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n\n this.lastTouchX = touches[0].clientX;\n this.lastTouchY = touches[0].clientY;\n }\n\n // Two fingers: Pinch Zoom\n if (touches.length === 2 && this.initialPinchDistance > 0) {\n const distance = this.getDistance(touches);\n const scaleFactor = distance / this.initialPinchDistance;\n\n // Calculate new scale with limits\n const rawNewScale = this.initialScale * scaleFactor;\n const newScale = Math.min(Math.max(rawNewScale, this.MIN_SCALE), this.MAX_SCALE);\n\n // Calculate new translation to keep focal point fixed\n const effectiveRatio = newScale / this.initialScale;\n const currentCenter = this.getCenter(touches);\n const cx = currentCenter.x - window.innerWidth / 2;\n const cy = currentCenter.y - window.innerHeight / 2;\n\n const sx = this.initialPinchCenter.x - window.innerWidth / 2;\n const sy = this.initialPinchCenter.y - window.innerHeight / 2;\n\n let newTx = cx - (sx - this.initialTranslateX) * effectiveRatio;\n let newTy = cy - (sy - this.initialTranslateY) * effectiveRatio;\n\n // --- Clamp Logic (Inline for atomicity) ---\n const img = this.getCurrentImageElement();\n if (img) {\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n const currentWidth = (isRotated ? baseHeight : baseWidth) * newScale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * newScale;\n\n const maxTx = Math.max(0, (currentWidth - window.innerWidth) / 2);\n const maxTy = Math.max(0, (currentHeight - window.innerHeight) / 2);\n\n if (currentWidth <= window.innerWidth) newTx = 0;\n else if (Math.abs(newTx) > maxTx) newTx = Math.sign(newTx) * maxTx;\n\n if (currentHeight <= window.innerHeight) newTy = 0;\n else if (Math.abs(newTy) > maxTy) newTy = Math.sign(newTy) * maxTy;\n }\n\n this.scale.set(newScale);\n this.translateX.set(newTx);\n this.translateY.set(newTy);\n }\n }\n\n private getConstraints() {\n // If we have a valid cache during interaction, use it to avoid reflows\n // The instruction says: \"So `getConstraints` stays as is (calculates fresh).\"\n // So, this method should always calculate fresh.\n // The `cachedConstraints` property is used *outside* this method.\n\n if (!isPlatformBrowser(this.platformId)) return { maxX: 0, maxY: 0 };\n\n const img = this.getCurrentImageElement();\n if (!img) return { maxX: 0, maxY: 0 };\n\n const scale = this.scale();\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n const currentWidth = (isRotated ? baseHeight : baseWidth) * scale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * scale;\n\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n return {\n maxX: Math.max(0, (currentWidth - viewportWidth) / 2),\n maxY: Math.max(0, (currentHeight - viewportHeight) / 2),\n };\n }\n\n private clampPosition() {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const img = this.getCurrentImageElement();\n if (!img) return;\n\n const scale = this.scale();\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n // Effective dimensions after rotation\n const currentWidth = (isRotated ? baseHeight : baseWidth) * scale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * scale;\n\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const maxTranslateX = Math.max(0, (currentWidth - viewportWidth) / 2);\n const maxTranslateY = Math.max(0, (currentHeight - viewportHeight) / 2);\n\n // Clamp logic\n const currentX = this.translateX();\n const currentY = this.translateY();\n\n let newX = currentX;\n let newY = currentY;\n\n if (Math.abs(currentX) > maxTranslateX) {\n newX = Math.sign(currentX) * maxTranslateX;\n }\n if (Math.abs(currentY) > maxTranslateY) {\n newY = Math.sign(currentY) * maxTranslateY;\n }\n\n // If image is smaller than viewport, force center (0)\n if (currentWidth <= viewportWidth) newX = 0;\n if (currentHeight <= viewportHeight) newY = 0;\n\n if (newX !== currentX) this.translateX.set(newX);\n if (newY !== currentY) this.translateY.set(newY);\n }\n\n private startInertia() {\n this.isInertia.set(true); // Disable CSS transition\n let lastTime = Date.now();\n\n const step = () => {\n if (\n !this.isDragging() &&\n (Math.abs(this.velocityX) > this.VELOCITY_THRESHOLD ||\n Math.abs(this.velocityY) > this.VELOCITY_THRESHOLD)\n ) {\n const now = Date.now();\n const dt = Math.min(now - lastTime, 64); // Cap dt to avoid huge jumps if lag\n lastTime = now;\n\n if (dt === 0) {\n this.rafId = requestAnimationFrame(step);\n return;\n }\n\n // Clamp max velocity (just in case)\n this.velocityX = Math.max(-this.MAX_VELOCITY, Math.min(this.MAX_VELOCITY, this.velocityX));\n this.velocityY = Math.max(-this.MAX_VELOCITY, Math.min(this.MAX_VELOCITY, this.velocityY));\n\n // Time-based friction\n const frictionFactor = Math.pow(this.FRICTION, dt / 16);\n\n this.velocityX *= frictionFactor;\n this.velocityY *= frictionFactor;\n\n let nextX = this.translateX() + this.velocityX * dt;\n let nextY = this.translateY() + this.velocityY * dt;\n\n // Check bounds during inertia\n const constraints = this.cachedConstraints || this.getConstraints();\n\n if (nextX > constraints.maxX) {\n nextX = constraints.maxX;\n this.velocityX = 0;\n } else if (nextX < -constraints.maxX) {\n nextX = -constraints.maxX;\n this.velocityX = 0;\n }\n\n if (nextY > constraints.maxY) {\n nextY = constraints.maxY;\n this.velocityY = 0;\n } else if (nextY < -constraints.maxY) {\n nextY = -constraints.maxY;\n this.velocityY = 0;\n }\n\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n\n this.rafId = requestAnimationFrame(step);\n } else {\n this.stopInertia();\n }\n };\n this.rafId = requestAnimationFrame(step);\n }\n\n private stopInertia() {\n this.isInertia.set(false); // Re-enable CSS transition\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n }\n\n private snapBack() {\n const constraints = this.cachedConstraints || this.getConstraints();\n const currentX = this.translateX();\n const currentY = this.translateY();\n\n let targetX = currentX;\n let targetY = currentY;\n\n if (currentX > constraints.maxX) targetX = constraints.maxX;\n if (currentX < -constraints.maxX) targetX = -constraints.maxX;\n if (currentY > constraints.maxY) targetY = constraints.maxY;\n if (currentY < -constraints.maxY) targetY = -constraints.maxY;\n\n if (targetX !== currentX || targetY !== currentY) {\n // Animate snap back? For now, we rely on CSS transition if not dragging\n // But we turned off transition for .dragging.\n // We need to ensure .dragging is removed (it is in onTouchEnd).\n // CSS transition handles the snap if we just set the value.\n this.translateX.set(targetX);\n this.translateY.set(targetY);\n }\n }\n\n onToolbarKey(event: KeyboardEvent) {\n event.stopPropagation();\n }\n\n onOverlayKey(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n this.close();\n }\n }\n\n onContainerKey(event: KeyboardEvent) {\n // Prevent closing when interacting with image container via keyboard if needed\n event.stopPropagation();\n }\n\n onMouseUp() {\n if (this.isDragging()) {\n // Check Pull to Close for Mouse\n if (this.scale() === 1) {\n const y = this.translateY();\n if (Math.abs(y) > 100) {\n this.close();\n return;\n }\n // Reset position if not closed\n if (y !== 0) {\n this.translateY.set(0);\n }\n const x = this.translateX();\n if (x !== 0) {\n this.translateX.set(0);\n }\n } else {\n this.snapBack();\n }\n }\n this.isDragging.set(false);\n }\n\n onTouchEnd(event: TouchEvent) {\n const touches = event.touches;\n if (touches.length === 0) {\n this.isDragging.set(false);\n\n // Calculate Release Velocity from History\n const now = Date.now();\n const lastPoint = this.touchHistory[this.touchHistory.length - 1];\n // We want a point from roughly 30-50ms ago to get \"launch\" direction,\n // but tracking last 100ms.\n // A simple approach: compare last point with oldest point in our (pruned) buffer.\n const oldestPoint = this.touchHistory[0];\n\n if (lastPoint && oldestPoint && lastPoint !== oldestPoint) {\n const dt = lastPoint.time - oldestPoint.time;\n if (dt > 0) {\n this.velocityX = (lastPoint.x - oldestPoint.x) / dt;\n this.velocityY = (lastPoint.y - oldestPoint.y) / dt;\n }\n } else {\n this.velocityX = 0;\n this.velocityY = 0;\n }\n\n this.isDragging.set(false);\n this.isPinching.set(false);\n this.initialPinchDistance = 0;\n\n // Swipe Navigation (at 1x scale)\n if (this.scale() === 1) {\n const x = this.translateX();\n const y = this.translateY();\n\n // Pull to Close\n if (Math.abs(y) > 100) {\n this.close();\n return;\n }\n\n const threshold = window.innerWidth * 0.25;\n const images = this.images();\n const total = images ? images.length : 0;\n const index = this.currentIndex();\n\n if (x < -threshold) {\n // NEXT (Slide Left)\n if (index < total - 1) {\n this.animateSlide(-1);\n } else {\n this.translateX.set(0);\n this.translateY.set(0);\n }\n return;\n } else if (x > threshold) {\n // PREV (Slide Right)\n if (index > 0) {\n this.animateSlide(1);\n } else {\n this.translateX.set(0);\n this.translateY.set(0);\n }\n return;\n }\n\n // Snap back\n this.translateX.set(0);\n this.translateY.set(0);\n } else {\n this.startInertia();\n }\n return;\n }\n\n else if (touches.length === 1 && this.isPinching()) {\n // Transition from pinch to pan\n this.isPinching.set(false);\n this.isDragging.set(true);\n this.lastTouchX = touches[0].clientX;\n this.lastTouchY = touches[0].clientY;\n // Reset velocity on transition\n this.velocityX = 0;\n this.velocityY = 0;\n this.lastTimestamp = Date.now();\n // Re-cache constraints for new pan interaction\n this.cachedConstraints = this.getConstraints();\n }\n }\n\n private lastTouchX = 0;\n private lastTouchY = 0;\n private initialPinchCenter = { x: 0, y: 0 };\n private initialTranslateX = 0;\n private initialTranslateY = 0;\n\n private getDistance(touches: TouchList): number {\n return Math.hypot(\n touches[0].clientX - touches[1].clientX,\n touches[0].clientY - touches[1].clientY,\n );\n }\n\n private getCenter(touches: TouchList) {\n return {\n x: (touches[0].clientX + touches[1].clientX) / 2,\n y: (touches[0].clientY + touches[1].clientY) / 2,\n };\n }\n\n close() {\n this.closeCallback();\n }\n\n onImageLoad(src: string) {\n this.loadedImages.update(set => {\n const newSet = new Set(set);\n newSet.add(src);\n return newSet;\n });\n this.hasError.set(false);\n }\n\n onImageError(src: string) {\n // this.loadedImages.update... (maybe not mark as loaded? or separate error tracking)\n // For now, keep error simple\n this.hasError.set(true);\n }\n\n // Zoom\n zoomIn() {\n this.scale.update((s) => Math.min(s + this.ZOOM_STEP, this.MAX_SCALE));\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on zoom\n }\n\n zoomOut() {\n this.scale.update((s) => Math.max(s - this.ZOOM_STEP, this.MIN_SCALE));\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on zoom\n }\n\n // Rotate\n rotateLeft() {\n this.rotate.update((r) => r - 90);\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on rotate\n }\n\n rotateRight() {\n this.rotate.update((r) => r + 90);\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on rotate\n }\n\n // Flip\n flipHorizontal() {\n this.flipH.update((f) => !f);\n this.cachedConstraints = null; // Invalidate cache on flip\n }\n\n flipVertical() {\n this.flipV.update((f) => !f);\n this.cachedConstraints = null; // Invalidate cache on flip\n }\n\n reset() {\n this.scale.set(1);\n this.translateX.set(0);\n this.translateY.set(0);\n this.rotate.set(0);\n this.flipH.set(false);\n this.flipV.set(false);\n this.cachedConstraints = null; // Invalidate cache on reset\n }\n\n next() {\n const imgs = this.images();\n if (!imgs) return;\n if (this.currentIndex() < imgs.length - 1) {\n this.currentIndex.update((i) => i + 1);\n }\n }\n\n prev() {\n if (this.currentIndex() > 0) {\n this.currentIndex.update((i) => i - 1);\n }\n }\n\n jumpTo(index: number) {\n this.currentIndex.set(index);\n this.reset();\n }\n\n // Slide Animation\n private animateSlide(direction: -1 | 1) {\n const spacing = 16;\n const width = window.innerWidth + spacing;\n // direction -1 (Next) -> move to -width\n // direction 1 (Prev) -> move to width\n // Wait. If I swipe Left (Next), x is negative. Target should be -width.\n // If I swipe Right (Prev), x is positive. Target should be width.\n // So target = direction * width? No.\n // If direction is \"Next\" (index + 1), I want to slide to the Left (-X).\n // Let's pass the sign of movement explicitly.\n\n const target = direction === -1 ? -width : width;\n\n this.translateX.set(target);\n\n // Wait for CSS transition (0.3s)\n setTimeout(() => {\n // Update Index (silent swap)\n this.isInertia.set(true); // Disable transition\n\n if (direction === -1) this.next();\n else this.prev();\n\n this.translateX.set(0);\n\n // Re-enable transition\n setTimeout(() => {\n this.isInertia.set(false);\n }, 50);\n }, 300);\n }\n\n // Mouse Interaction\n onMouseDown(event: MouseEvent) {\n // Allow dragging even at scale 1 for Pull-to-Close and Swipe-like nav (if intended)\n if (this.isDragging()) return;\n\n // Only trigger on Left Click\n if (event.button !== 0) return;\n\n this.isDragging.set(true);\n this.startX = event.clientX;\n this.startY = event.clientY;\n this.lastTranslateX = this.translateX();\n this.lastTranslateY = this.translateY();\n event.preventDefault();\n }\n\n // Touch Interaction (bound in template)\n onTouchStart(event: TouchEvent) {\n this.stopInertia(); // Cancel any ongoing movement\n\n // if (event.cancelable) event.preventDefault(); // Removed to restore Tap-to-Close (click events)\n // touch-action: none in CSS handles scroll prevention.\n\n const touches = event.touches;\n\n if (touches.length === 1) {\n // Single touch: Pan.\n // Allow dragging from anywhere in the container (better UX for Pull-to-Close)\n this.isDragging.set(true);\n this.lastTouchX = touches[0].clientX;\n this.lastTouchY = touches[0].clientY;\n this.lastTimestamp = Date.now();\n\n // Initialize physics state\n this.velocityX = 0;\n this.velocityY = 0;\n this.touchHistory = [\n {\n x: touches[0].clientX,\n y: touches[0].clientY,\n time: Date.now(),\n },\n ];\n // Cache layout to prevent thrashing\n this.cachedConstraints = this.getConstraints();\n } else if (touches.length === 2) {\n // Two fingers: Pinch\n this.isPinching.set(true);\n this.isDragging.set(false); // Stop panning\n this.initialPinchDistance = this.getDistance(touches);\n this.initialScale = this.scale();\n this.initialPinchCenter = this.getCenter(touches);\n this.initialTranslateX = this.translateX();\n this.initialTranslateY = this.translateY();\n\n // Clear caching on pinch (scale changes will invalidate limits)\n this.cachedConstraints = null;\n\n // Prevent default to avoid browser zoom\n if (event.cancelable) event.preventDefault();\n }\n }\n}\n","\nimport {\n Directive,\n ElementRef,\n HostListener,\n Input,\n TemplateRef,\n ApplicationRef,\n EnvironmentInjector,\n createComponent,\n ComponentRef,\n inject,\n OnDestroy,\n PLATFORM_ID\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { ImagesPreviewComponent, ImagesPreviewContext, ToolbarConfig } from './images-preview.component';\n\n/**\n * Directive to open the image preview.\n * Can be used on any element, but auto-detects `src` on `img` or nested `img`.\n */\n@Directive({\n selector: '[ngImagesPreview]',\n standalone: true\n})\nexport class ImagesPreviewDirective implements OnDestroy {\n /**\n * High resolution image source to display in preview.\n * If empty, tries to read `src` from host element or first child `img`.\n */\n @Input('ngImagesPreview') highResSrc = '';\n\n /**\n * List of images for gallery navigation.\n * If provided, enables previous/next navigation buttons.\n */\n @Input() previewImages: string[] = [];\n\n /**\n * Custom template to use for the preview.\n * If provided, overrides the default viewer UI.\n */\n @Input() previewTemplate?: TemplateRef<ImagesPreviewContext>;\n\n /**\n * Configuration for the toolbar buttons.\n */\n @Input() toolbarConfig?: ToolbarConfig;\n\n /**\n * Optional srcset for the single image.\n */\n @Input() srcset?: string;\n\n /**\n * List of srcsets corresponding to the `previewImages` array.\n */\n /**\n * List of srcsets corresponding to the `previewImages` array.\n */\n @Input() srcsets?: string[];\n\n /**\n * Whether to show the thumbnail strip.\n * @default true\n */\n @Input() showThumbnails = true;\n\n /**\n * Whether to show the toolbar.\n * @default true\n */\n @Input() showToolbar = true;\n\n /**\n * Custom template to render in the toolbar (e.g. for download buttons).\n */\n @Input() toolbarExtensions: TemplateRef<any> | null = null;\n\n /**\n * Type guard helper for strict template type checking.\n * Allows Angular Language Service to infer types in `previewTemplate`.\n */\n static ngTemplateContextGuard(\n directive: ImagesPreviewDirective,\n context: unknown\n ): context is ImagesPreviewContext {\n return true;\n }\n\n private componentRef: ComponentRef<ImagesPreviewComponent> | null = null;\n\n private appRef = inject(ApplicationRef);\n private injector = inject(EnvironmentInjector);\n private el = inject(ElementRef<HTMLElement>);\n private platformId = inject(PLATFORM_ID);\n\n @HostListener('click', ['$event'])\n onClick(event: Event): void {\n event.stopPropagation();\n\n // Prevent duplicate open\n if (this.componentRef) return;\n\n // Determine Source\n const hostEl = this.el.nativeElement;\n let src = this.highResSrc || hostEl.getAttribute('src') || (hostEl as HTMLImageElement).src;\n\n // If no src found on host, try to find an img child\n if (!src) {\n const imgChild = hostEl.querySelector('img');\n if (imgChild) {\n src = imgChild.getAttribute('src') || imgChild.src;\n }\n }\n\n src = src || '';\n\n if (src) {\n const rect = hostEl.getBoundingClientRect();\n this.openPreview(src, rect);\n }\n }\n\n @HostListener('style.cursor')\n readonly cursor = 'pointer';\n\n private openPreview(src: string, rect: DOMRect): void {\n if (!isPlatformBrowser(this.platformId)) return;\n\n // Create Component\n this.componentRef = createComponent(ImagesPreviewComponent, {\n environmentInjector: this.injector\n });\n\n // Set Inputs\n this.componentRef.setInput('src', src);\n this.componentRef.setInput('openerRect', rect);\n\n if (this.previewImages.length > 0) {\n this.componentRef.setInput('images', this.previewImages);\n const index = this.previewImages.indexOf(src);\n this.componentRef.setInput('initialIndex', index >= 0 ? index : 0);\n }\n\n if (this.previewTemplate) {\n this.componentRef.setInput('customTemplate', this.previewTemplate);\n }\n\n if (this.toolbarConfig) {\n this.componentRef.setInput('toolbarConfig', this.toolbarConfig);\n }\n\n if (this.srcset) {\n this.componentRef.setInput('srcset', this.srcset);\n }\n\n if (this.srcsets) {\n this.componentRef.setInput('srcsets', this.srcsets);\n }\n this.componentRef.setInput('showThumbnails', this.showThumbnails);\n this.componentRef.setInput('showToolbar', this.showToolbar);\n this.componentRef.setInput('toolbarExtensions', this.toolbarExtensions);\n\n // Set Callbacks\n this.componentRef.instance.closeCallback = () => this.destroyPreview();\n\n // Attach to App\n this.appRef.attachView(this.componentRef.hostView);\n\n // Append to Body\n const domElem = (this.componentRef.hostView as unknown as { rootNodes: HTMLElement[] }).rootNodes[0];\n document.body.appendChild(domElem);\n }\n\n private destroyPreview(): void {\n if (this.componentRef) {\n this.appRef.detachView(this.componentRef.hostView);\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n\n ngOnDestroy(): void {\n this.destroyPreview();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ImagesPreviewComponent } from './images-preview.component';\nimport { ImagesPreviewDirective } from './images-preview.directive';\n\n@NgModule({\n imports: [ImagesPreviewComponent, ImagesPreviewDirective],\n exports: [ImagesPreviewComponent, ImagesPreviewDirective]\n})\nexport class NgImagesPreviewModule { }\n","\n/*\n * Public API Surface of ng-images-preview\n */\n\nexport * from './lib/images-preview.component';\nexport * from './lib/images-preview.directive';\nexport * from './lib/images-preview.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAO,M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A,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAHpB,sBAAsB,EAAE,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAC9C,sBAAsB,EAAE,sBAAsB,CAAA,EAAA,CAAA;AAE/C,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAHpB,sBAAsB,CAAA,EAAA,CAAA;;2FAGvB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;AACzD,oBAAA,OAAO,EAAE,CAAC,sBAAsB,EAAE,sBAAsB;AAC3D,iBAAA;;;ACND;;AAEG;;ACHH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ng-images-preview.mjs","sources":["../../../projects/ng-images-preview/src/lib/icons.ts","../../../projects/ng-images-preview/src/lib/images-preview.component.ts","../../../projects/ng-images-preview/src/lib/images-preview.directive.ts","../../../projects/ng-images-preview/src/lib/images-preview.module.ts","../../../projects/ng-images-preview/src/public-api.ts","../../../projects/ng-images-preview/src/ng-images-preview.ts"],"sourcesContent":["export const PREVIEW_ICONS = {\n close: '<svg viewBox=\"0 0 24 24\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/></svg>',\n prev: '<svg viewBox=\"0 0 24 24\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg>',\n next: '<svg viewBox=\"0 0 24 24\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg>',\n flipH: '<svg viewBox=\"0 0 24 24\"><path d=\"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z\"/></svg>',\n flipV: '<svg viewBox=\"0 0 24 24\"><path d=\"M7 21h2v-2H7v2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-12h2V7h-2v2zm-4 4h2v-4h-2v4zm-8-8h2V3H7v2zm8 0h2V3h-2v2zm-4 8h4v-4h-4v4zM3 15h2v-2H3v2zm12-4h2v-4H3v4h2v-2h10v2zM7 3v2h2V3H7zm8 20h2v-2h-2v2zm-4 0h2v-2h-2v2zm4-12h2v-2h-2v2zM3 19c0 1.1.9 2 2 2h2v-2H5v-2H3v2zm16-6h2v-2h-2v2zm0 4v2c0 1.1-.9 2-2 2h-2v-2h2v-2h2zM5 3c-1.1 0-2 .9-2 2h2V3z\"/></svg>',\n rotateLeft: '<svg viewBox=\"0 0 24 24\"><path d=\"M7.11 8.53L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z\"/></svg>',\n rotateRight: '<svg viewBox=\"0 0 24 24\"><path d=\"M15.55 5.55L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42l1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z\"/></svg>',\n zoomOut: '<svg viewBox=\"0 0 24 24\"><path d=\"M19 13H5v-2h14v2z\"/></svg>',\n zoomIn: '<svg viewBox=\"0 0 24 24\"><path d=\"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\"/></svg>'\n};\n","import {\n Component,\n ElementRef,\n HostListener,\n computed,\n input,\n signal,\n viewChildren,\n ChangeDetectionStrategy,\n TemplateRef,\n inject,\n effect,\n PLATFORM_ID,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { animate, style, transition, trigger } from '@angular/animations';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { PREVIEW_ICONS } from './icons';\n\nexport interface ImagesPreviewState {\n src: string;\n scale: number;\n rotate: number;\n flipH: boolean;\n flipV: boolean;\n isLoading: boolean;\n hasError: boolean;\n currentIndex: number;\n total: number;\n}\n\nexport interface ImagesPreviewActions {\n zoomIn: () => void;\n zoomOut: () => void;\n rotateLeft: () => void;\n rotateRight: () => void;\n flipHorizontal: () => void;\n flipVertical: () => void;\n reset: () => void;\n close: () => void;\n next: () => void;\n prev: () => void;\n jumpTo: (index: number) => void;\n}\n\n/**\n * Configuration for the toolbar.\n */\nexport interface ToolbarConfig {\n showZoom?: boolean;\n showRotate?: boolean;\n showFlip?: boolean;\n}\n\n/**\n * Context passed to the custom template.\n */\nexport interface ImagesPreviewContext {\n $implicit: ImagesPreviewState;\n actions: ImagesPreviewActions;\n}\n\ninterface TrackingPoint {\n x: number;\n y: number;\n time: number;\n}\n\ninterface ImageBufferItem {\n src: string;\n index: number;\n offset: number; // -1 (prev), 0 (curr), 1 (next)\n srcset?: string;\n}\n\n/**\n * Image Preview Overlay Component.\n * Displays images in a full-screen overlay with zoom, rotate, and pan capabilities.\n */\n@Component({\n selector: 'ng-images-preview',\n standalone: true,\n imports: [CommonModule],\n template: `\n <div\n class=\"overlay\"\n [@fadeInOut]\n (click)=\"close()\"\n (keydown)=\"onOverlayKey($event)\"\n tabindex=\"0\"\n role=\"button\"\n aria-label=\"Close preview overlay\"\n [style.background-color]=\"overlayBackground()\"\n >\n <!-- Custom Template Support -->\n @if (customTemplate(); as template) {\n <ng-container\n *ngTemplateOutlet=\"template; context: { $implicit: state(), actions: actions }\"\n ></ng-container>\n } @else {\n <!-- Loading -->\n @if (!loadedImages().has(src()) && !hasError()) {\n <div class=\"loader\">Loading...</div>\n }\n\n <!-- Error -->\n @if (hasError()) {\n <div class=\"error\">Failed to load image</div>\n }\n\n <!-- Image Container -->\n <div\n class=\"image-container\"\n (keydown)=\"onContainerKey($event)\"\n (touchstart)=\"onTouchStart($event)\"\n tabindex=\"-1\"\n >\n @for (item of activeBuffer(); track item.src) {\n <img\n #imgRef\n [src]=\"item.src\"\n [srcset]=\"item.srcset || ''\"\n [class.opacity-0]=\"item.offset === 0 && (!loadedImages().has(item.src) || hasError())\"\n class=\"preview-image\"\n [class.dragging]=\"isDragging()\"\n [class.inertia]=\"isInertia()\"\n [class.pinching]=\"isPinching()\"\n [class.zoom-in]=\"scale() === 1\"\n [class.zoom-out]=\"scale() > 1\"\n [class.hidden]=\"item.offset !== 0 && scale() > 1\"\n [style.transform]=\"getTransform(item.offset)\"\n (load)=\"onImageLoad(item.src)\"\n (error)=\"onImageError(item.src)\"\n (mousedown)=\"onMouseDown($event)\"\n (click)=\"$event.stopPropagation()\"\n draggable=\"false\"\n alt=\"Preview\"\n />\n }\n </div>\n\n <!-- Close Button -->\n <button class=\"close-btn\" (click)=\"close()\" aria-label=\"Close preview\" [innerHTML]=\"icons.close\">\n </button>\n\n <!-- Navigation -->\n @if (images() && images()!.length > 1) {\n <!-- Check if not first -->\n @if (currentIndex() > 0) {\n <button\n class=\"nav-btn prev\"\n (click)=\"prev(); $event.stopPropagation()\"\n (mousedown)=\"$event.stopPropagation()\"\n aria-label=\"Previous image\"\n [innerHTML]=\"icons.prev\"\n >\n </button>\n }\n <!-- Check if not last -->\n @if (currentIndex() < images()!.length - 1) {\n <button\n class=\"nav-btn next\"\n (click)=\"next(); $event.stopPropagation()\"\n (mousedown)=\"$event.stopPropagation()\"\n aria-label=\"Next image\"\n [innerHTML]=\"icons.next\"\n >\n </button>\n }\n\n <!-- Counter -->\n <div class=\"counter\">{{ currentIndex() + 1 }} / {{ images()!.length }}</div>\n }\n\n <!-- Toolbar -->\n <!-- Toolbar -->\n @if (showToolbar()) {\n <div\n class=\"toolbar\"\n (click)=\"$event.stopPropagation()\"\n (keydown)=\"onToolbarKey($event)\"\n tabindex=\"0\"\n >\n <!-- Flip -->\n @if (toolbarConfig().showFlip) {\n <button class=\"toolbar-btn\" (click)=\"flipHorizontal()\" aria-label=\"Flip Horizontal\" [innerHTML]=\"icons.flipH\">\n </button>\n <button class=\"toolbar-btn\" (click)=\"flipVertical()\" aria-label=\"Flip Vertical\" [innerHTML]=\"icons.flipV\">\n </button>\n }\n \n <!-- Extensions (Custom Buttons) -->\n @if (toolbarExtensions()) {\n <ng-container *ngTemplateOutlet=\"toolbarExtensions(); context: { $implicit: images()![currentIndex()] }\"></ng-container>\n }\n <!-- Rotate -->\n @if (toolbarConfig().showRotate) {\n <button class=\"toolbar-btn\" (click)=\"rotateLeft()\" aria-label=\"Rotate Left\" [innerHTML]=\"icons.rotateLeft\">\n </button>\n <button class=\"toolbar-btn\" (click)=\"rotateRight()\" aria-label=\"Rotate Right\" [innerHTML]=\"icons.rotateRight\">\n </button>\n }\n <!-- Zoom -->\n @if (toolbarConfig().showZoom) {\n <button class=\"toolbar-btn\" (click)=\"zoomOut()\" aria-label=\"Zoom Out\" [innerHTML]=\"icons.zoomOut\">\n </button>\n <button class=\"toolbar-btn\" (click)=\"zoomIn()\" aria-label=\"Zoom In\" [innerHTML]=\"icons.zoomIn\">\n </button>\n }\n </div>\n }\n }\n \n <!-- Thumbnails -->\n @if (images() && images()!.length > 1 && showThumbnails()) {\n <div class=\"thumbnail-strip\" (click)=\"$event.stopPropagation()\">\n @for (img of images(); track img; let i = $index) {\n <div \n #thumbRef\n class=\"thumbnail-item\" \n [class.active]=\"i === currentIndex()\"\n (click)=\"jumpTo(i)\"\n >\n <img [src]=\"img\" loading=\"lazy\" alt=\"Thumbnail\">\n </div>\n }\n </div>\n }\n </div>\n `,\n styleUrls: ['./images-preview.component.css'],\n animations: [\n trigger('fadeInOut', [\n transition(':enter', [\n style({ opacity: 0 }),\n animate('200ms ease-out', style({ opacity: 1 })),\n ]),\n transition(':leave', [animate('200ms ease-in', style({ opacity: 0 }))]),\n ]),\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '(document:mouseup)': 'onMouseUp()',\n '(document:touchmove)': 'onTouchMove($event)',\n '(document:touchend)': 'onTouchEnd($event)',\n '(document:keydown.arrowleft)': 'prev()',\n '(document:keydown.arrowright)': 'next()',\n '(document:keydown.escape)': 'close()',\n },\n})\nexport class ImagesPreviewComponent {\n /**\n * The image source to display.\n * @required\n */\n src = input.required<string>();\n\n /**\n * List of image URLs for gallery navigation.\n */\n images = input<string[]>();\n\n /**\n * Optional srcset for the single image `src`.\n */\n srcset = input<string>();\n\n /**\n * List of srcsets corresponding to the `images` array.\n * Must be 1:1 mapped with `images`.\n */\n srcsets = input<string[]>();\n\n /**\n * Initial index for gallery navigation.\n * @default 0\n */\n initialIndex = input(0);\n\n /**\n * DOMRect of the element that opened the preview.\n * Used for FLIP animation calculation.\n */\n openerRect = input<DOMRect | undefined>(undefined);\n\n /**\n * Custom template to render instead of the default viewer.\n * Exposes `ImagesPreviewContext`.\n */\n customTemplate = input<TemplateRef<ImagesPreviewContext>>();\n\n /**\n * Configuration for the toolbar buttons.\n */\n toolbarConfig = input<ToolbarConfig>({\n showZoom: true,\n showRotate: true,\n showFlip: true,\n });\n\n /**\n * Callback function called when the preview is closed.\n */\n closeCallback: () => void = () => {\n /* noop */\n };\n\n imgRefs = viewChildren<ElementRef<HTMLImageElement>>('imgRef');\n\n thumbRefs = viewChildren<ElementRef<HTMLElement>>('thumbRef');\n\n // State signals\n currentIndex = signal(0);\n // isLoading = signal(true); // Replaced by per-image tracking\n hasError = signal(false);\n\n // Track loaded state for each image source\n loadedImages = signal<Set<string>>(new Set());\n\n // Toggle thumbnails\n showThumbnails = input(true);\n\n // Toggle toolbar\n showToolbar = input(true);\n\n // Toolbar custom extensions\n toolbarExtensions = input<TemplateRef<any> | null>(null);\n\n activeBuffer = computed<ImageBufferItem[]>(() => {\n const imgs = this.images();\n const srcsets = this.srcsets();\n const current = this.currentIndex();\n\n // Single image or fallback\n if (!imgs || imgs.length === 0) {\n return [{ src: this.src(), index: 0, offset: 0, srcset: this.srcset() }];\n }\n\n const buffer: ImageBufferItem[] = [];\n const total = imgs.length;\n\n // Helper to get srcset safely\n const getSrcset = (i: number) => (srcsets && srcsets[i]) ? srcsets[i] : undefined;\n\n // Prev (-1)\n if (current > 0) {\n buffer.push({\n src: imgs[current - 1],\n index: current - 1,\n offset: -1,\n srcset: getSrcset(current - 1)\n });\n }\n\n // Current (0)\n buffer.push({\n src: imgs[current],\n index: current,\n offset: 0,\n srcset: getSrcset(current)\n });\n\n // Next (+1)\n if (current < total - 1) {\n buffer.push({\n src: imgs[current + 1],\n index: current + 1,\n offset: 1,\n srcset: getSrcset(current + 1)\n });\n }\n\n return buffer;\n });\n\n private platformId = inject(PLATFORM_ID);\n private sanitizer = inject(DomSanitizer);\n\n // Icons map with SafeHtml\n icons: { [key in keyof typeof PREVIEW_ICONS]: SafeHtml };\n\n constructor() {\n // Sanitize icons once\n this.icons = Object.keys(PREVIEW_ICONS).reduce((acc, key) => {\n acc[key as keyof typeof PREVIEW_ICONS] = this.sanitizer.bypassSecurityTrustHtml(\n PREVIEW_ICONS[key as keyof typeof PREVIEW_ICONS]\n );\n return acc;\n }, {} as { [key in keyof typeof PREVIEW_ICONS]: SafeHtml });\n\n\n // defined in class body usually, but here to show logical grouping\n effect(\n () => {\n // Initialize index from input\n this.currentIndex.set(this.initialIndex());\n },\n { allowSignalWrites: true },\n );\n\n effect(\n () => {\n // Reset state when index changes\n this.currentIndex();\n this.hasError.set(false);\n this.reset(); // Reset zoom/rotate\n },\n { allowSignalWrites: true },\n );\n\n // Preload next/prev images\n effect(() => {\n const index = this.currentIndex();\n const images = this.images();\n\n if (isPlatformBrowser(this.platformId) && images && images.length > 0) {\n const srcsets = this.srcsets();\n const getSrcset = (i: number) => (srcsets && srcsets[i]) ? srcsets[i] : undefined;\n\n // Next\n if (index < images.length - 1) {\n const img = new Image();\n const s = getSrcset(index + 1);\n if (s) img.srcset = s;\n img.src = images[index + 1];\n }\n // Prev\n if (index > 0) {\n const img = new Image();\n const s = getSrcset(index - 1);\n if (s) img.srcset = s;\n img.src = images[index - 1];\n }\n }\n });\n\n effect(() => {\n // Handle FLIP on open\n const opener = this.openerRect();\n if (opener && !this.flipAnimDone) {\n // Defer to let the view render so we know final position\n setTimeout(() => this.runFlipAnimation(opener));\n }\n });\n\n // Auto-scroll thumbnails\n effect(() => {\n const index = this.currentIndex();\n const show = this.showThumbnails();\n const refs = this.thumbRefs();\n\n if (show && refs && refs[index]) {\n const el = refs[index].nativeElement;\n const container = el.parentElement;\n\n if (container) {\n const scrollLeft = el.offsetLeft + el.offsetWidth / 2 - container.offsetWidth / 2;\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth'\n });\n }\n }\n });\n }\n\n private flipAnimDone = false;\n\n scale = signal(1);\n translateX = signal(0);\n translateY = signal(0);\n rotate = signal(0);\n flipH = signal(false);\n flipV = signal(false);\n\n isDragging = signal(false);\n isInertia = signal(false);\n\n // Touch state\n private initialPinchDistance = 0;\n private initialScale = 1;\n isPinching = signal(false);\n\n // Computed state object for template\n state = computed<ImagesPreviewState>(() => ({\n src: this.src(),\n scale: this.scale(),\n rotate: this.rotate(),\n flipH: this.flipH(),\n flipV: this.flipV(),\n isLoading: !this.loadedImages().has(this.src() || '') && !this.hasError(),\n hasError: this.hasError(),\n currentIndex: this.currentIndex(),\n total: this.images()?.length ?? 1,\n }));\n\n // Actions object for template\n actions: ImagesPreviewActions = {\n zoomIn: () => this.zoomIn(),\n zoomOut: () => this.zoomOut(),\n rotateLeft: () => this.rotateLeft(),\n rotateRight: () => this.rotateRight(),\n flipHorizontal: () => this.flipHorizontal(),\n flipVertical: () => this.flipVertical(),\n reset: () => this.reset(),\n close: () => this.close(),\n next: () => this.next(),\n prev: () => this.prev(),\n jumpTo: (index: number) => this.jumpTo(index),\n };\n\n private readonly MIN_SCALE = 0.5;\n private readonly MAX_SCALE = 5;\n private readonly ZOOM_STEP = 0.5;\n\n private startX = 0;\n private startY = 0;\n private lastTranslateX = 0;\n private lastTranslateY = 0;\n\n // Physics state\n private velocityX = 0;\n private velocityY = 0;\n private touchHistory: TrackingPoint[] = [];\n private cachedConstraints: { maxX: number; maxY: number } | null = null;\n private lastTimestamp = 0;\n private rafId: number | null = null;\n private readonly FRICTION = 0.95; // Super smooth glide\n private readonly VELOCITY_THRESHOLD = 0.01;\n private readonly MAX_VELOCITY = 3; // Cap speed to prevent teleporting\n\n // Updated transform logic for slide buffer\n getTransform(offset: number) {\n const viewportWidth = window.innerWidth;\n const spacing = 16; // Gap between images\n const baseOffset = offset * (viewportWidth + spacing);\n\n // Dynamic movement from touch/inertia\n // Global translateX applies to the whole \"track\"\n const x = this.translateX() + baseOffset;\n\n // Y-axis drag (Pull-to-Close) usually only affects the active image visually,\n // but moving the whole track is acceptable and simpler.\n // Ideally, neighbors stay at Y=0.\n const effectiveY = offset === 0 ? this.translateY() : 0;\n\n const effectiveScale = offset === 0 ? this.scale() : 1;\n const effectiveRotate = offset === 0 ? this.rotate() : 0;\n const flipH = offset === 0 ? this.flipH() : false;\n const flipV = offset === 0 ? this.flipV() : false;\n\n const scaleX = flipH ? -1 : 1;\n const scaleY = flipV ? -1 : 1;\n\n // FLIP override\n if (offset === 0) {\n const flip = this.flipTransform();\n if (flip) return flip;\n }\n\n return `translate3d(${x}px, ${effectiveY}px, 0) scale(${effectiveScale}) rotate(${effectiveRotate}deg) scaleX(${scaleX}) scaleY(${scaleY})`;\n }\n\n // FLIP State\n private flipTransform = signal('');\n\n // Helper to get current active image element\n private getCurrentImageElement(): HTMLImageElement | undefined {\n const buffer = this.activeBuffer();\n const index = buffer.findIndex((item) => item.offset === 0);\n if (index === -1) return undefined;\n return this.imgRefs()[index]?.nativeElement;\n }\n\n private runFlipAnimation(opener: DOMRect) {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const imgEl = this.getCurrentImageElement();\n if (!imgEl) return;\n\n // 1. First: Final state is already rendered (centered, max fit)\n const finalRect = imgEl.getBoundingClientRect();\n\n // 2. Invert: Calculate scale and translate to match opener\n const scaleX = opener.width / finalRect.width;\n const scaleY = opener.height / finalRect.height;\n // Note: we use the larger scale to crop? \n // Or fit? \n // Usually we want to fit.\n // Let's matching fitting.\n\n // Actually, most simple FLIP matches dimensions exactly.\n // But aspect ratios might differ.\n // Let's just match the rect exactly.\n\n const deltaX = opener.left - finalRect.left + (opener.width - finalRect.width) / 2;\n const deltaY = opener.top - finalRect.top + (opener.height - finalRect.height) / 2;\n\n // Apply Invert Transform immediately (no transition)\n imgEl.style.transition = 'none';\n this.flipTransform.set(`translate3d(${deltaX}px, ${deltaY}px, 0) scale(${scaleX}, ${scaleY})`);\n\n // Force Reflow\n imgEl.offsetHeight;\n\n // 3. Play\n requestAnimationFrame(() => {\n // Enable transition\n imgEl.style.transition = 'transform 300ms cubic-bezier(0.2, 0, 0.2, 1)';\n // Remove override (animates to Final)\n this.flipTransform.set('');\n this.flipAnimDone = true;\n\n // CLEANUP: Remove transition after animation wraps up so dragging/panning is instant\n setTimeout(() => {\n imgEl.style.transition = '';\n }, 300);\n });\n }\n\n overlayBackground = computed(() => {\n const y = Math.abs(this.translateY());\n const scale = this.scale();\n if (scale === 1 && y > 0) {\n const opacity = Math.max(0, 0.95 - y / 400); // Fade out as we drag down\n return `rgba(0, 0, 0, ${opacity})`;\n }\n return 'var(--ng-img-background)';\n });\n\n @HostListener('document:keydown.escape')\n onEscape() {\n this.close();\n }\n\n @HostListener('document:mousemove', ['$event'])\n onMouseMove(event: MouseEvent) {\n if (!this.isDragging()) return;\n event.preventDefault();\n\n const deltaX = event.clientX - this.startX;\n const deltaY = event.clientY - this.startY;\n\n let nextX = this.lastTranslateX + deltaX;\n let nextY = this.lastTranslateY + deltaY;\n\n // Apply strict clamping during move\n this.applyMoveConstraints(nextX, nextY);\n }\n\n private applyMoveConstraints(nextX: number, nextY: number) {\n if (!isPlatformBrowser(this.platformId)) {\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n return;\n }\n\n const img = this.getCurrentImageElement();\n if (!img) {\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n return;\n }\n\n const scale = this.scale();\n\n // If scale is 1, we allow free movement for Pull-to-Close and Swipe Nav\n if (scale === 1) {\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n return;\n }\n\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n const currentWidth = (isRotated ? baseHeight : baseWidth) * scale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * scale;\n\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const maxTranslateX = Math.max(0, (currentWidth - viewportWidth) / 2);\n const maxTranslateY = Math.max(0, (currentHeight - viewportHeight) / 2);\n\n // Clamp\n const clampedX = Math.max(-maxTranslateX, Math.min(maxTranslateX, nextX));\n const clampedY = Math.max(-maxTranslateY, Math.min(maxTranslateY, nextY));\n\n this.translateX.set(clampedX);\n this.translateY.set(clampedY);\n }\n\n onTouchMove(event: TouchEvent) {\n if (!this.isDragging() && !this.isPinching()) return;\n\n // Prevent default to stop page scrolling/zooming\n if (event.cancelable) {\n event.preventDefault();\n }\n\n const touches = event.touches;\n\n // One finger: Pan\n if (touches.length === 1 && this.isDragging() && !this.isPinching()) {\n const now = Date.now();\n\n // Add point to history\n this.touchHistory.push({\n x: touches[0].clientX,\n y: touches[0].clientY,\n time: now,\n });\n\n // Prune history (keep last 100ms)\n const cutoff = now - 100;\n while (this.touchHistory.length > 0 && this.touchHistory[0].time < cutoff) {\n this.touchHistory.shift();\n }\n\n const deltaX = touches[0].clientX - this.lastTouchX;\n const deltaY = touches[0].clientY - this.lastTouchY;\n\n // Note: We do NOT calculate velocity here anymore to avoid noise.\n // We verify velocity at TouchEnd using history.\n\n const currentX = this.translateX();\n const currentY = this.translateY();\n\n let nextX = currentX + deltaX;\n let nextY = currentY + deltaY;\n\n // Apply rubber banding if out of bounds\n // Use cached constraints to avoid reflows\n const constraints = this.cachedConstraints || this.getConstraints();\n\n // At scale 1, we want linear drag for pull-to-close (Y) and swipe (X)\n // But we can keep rubber banding if it feels good.\n // For Pull-to-Close, standard is 1:1 or slightly resisted. \n // Let's stick to the current logic which applies resistance if \"out of bounds\".\n // Since at scale 1 bounds are 0, it will apply resistance immediately.\n // We want easier pull.\n\n if (this.scale() === 1) {\n // Reduce resistance\n nextY = currentY + deltaY;\n nextX = currentX + deltaX;\n } else {\n if (nextX > constraints.maxX) {\n nextX = constraints.maxX + (nextX - constraints.maxX) * 0.5;\n } else if (nextX < -constraints.maxX) {\n nextX = -constraints.maxX + (nextX + constraints.maxX) * 0.5;\n }\n\n if (nextY > constraints.maxY) {\n nextY = constraints.maxY + (nextY - constraints.maxY) * 0.5;\n } else if (nextY < -constraints.maxY) {\n nextY = -constraints.maxY + (nextY + constraints.maxY) * 0.5;\n }\n }\n\n if (nextY > constraints.maxY) {\n nextY = constraints.maxY + (nextY - constraints.maxY) * 0.5;\n } else if (nextY < -constraints.maxY) {\n nextY = -constraints.maxY + (nextY + constraints.maxY) * 0.5;\n }\n\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n\n this.lastTouchX = touches[0].clientX;\n this.lastTouchY = touches[0].clientY;\n }\n\n // Two fingers: Pinch Zoom\n if (touches.length === 2 && this.initialPinchDistance > 0) {\n const distance = this.getDistance(touches);\n const scaleFactor = distance / this.initialPinchDistance;\n\n // Calculate new scale with limits\n const rawNewScale = this.initialScale * scaleFactor;\n const newScale = Math.min(Math.max(rawNewScale, this.MIN_SCALE), this.MAX_SCALE);\n\n // Calculate new translation to keep focal point fixed\n const effectiveRatio = newScale / this.initialScale;\n const currentCenter = this.getCenter(touches);\n const cx = currentCenter.x - window.innerWidth / 2;\n const cy = currentCenter.y - window.innerHeight / 2;\n\n const sx = this.initialPinchCenter.x - window.innerWidth / 2;\n const sy = this.initialPinchCenter.y - window.innerHeight / 2;\n\n let newTx = cx - (sx - this.initialTranslateX) * effectiveRatio;\n let newTy = cy - (sy - this.initialTranslateY) * effectiveRatio;\n\n // --- Clamp Logic (Inline for atomicity) ---\n const img = this.getCurrentImageElement();\n if (img) {\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n const currentWidth = (isRotated ? baseHeight : baseWidth) * newScale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * newScale;\n\n const maxTx = Math.max(0, (currentWidth - window.innerWidth) / 2);\n const maxTy = Math.max(0, (currentHeight - window.innerHeight) / 2);\n\n if (currentWidth <= window.innerWidth) newTx = 0;\n else if (Math.abs(newTx) > maxTx) newTx = Math.sign(newTx) * maxTx;\n\n if (currentHeight <= window.innerHeight) newTy = 0;\n else if (Math.abs(newTy) > maxTy) newTy = Math.sign(newTy) * maxTy;\n }\n\n this.scale.set(newScale);\n this.translateX.set(newTx);\n this.translateY.set(newTy);\n }\n }\n\n private getConstraints() {\n // If we have a valid cache during interaction, use it to avoid reflows\n // The instruction says: \"So `getConstraints` stays as is (calculates fresh).\"\n // So, this method should always calculate fresh.\n // The `cachedConstraints` property is used *outside* this method.\n\n if (!isPlatformBrowser(this.platformId)) return { maxX: 0, maxY: 0 };\n\n const img = this.getCurrentImageElement();\n if (!img) return { maxX: 0, maxY: 0 };\n\n const scale = this.scale();\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n const currentWidth = (isRotated ? baseHeight : baseWidth) * scale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * scale;\n\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n return {\n maxX: Math.max(0, (currentWidth - viewportWidth) / 2),\n maxY: Math.max(0, (currentHeight - viewportHeight) / 2),\n };\n }\n\n private clampPosition() {\n if (!isPlatformBrowser(this.platformId)) return;\n\n const img = this.getCurrentImageElement();\n if (!img) return;\n\n const scale = this.scale();\n const rotate = Math.abs(this.rotate() % 180);\n const isRotated = rotate === 90;\n\n const baseWidth = img.offsetWidth;\n const baseHeight = img.offsetHeight;\n\n // Effective dimensions after rotation\n const currentWidth = (isRotated ? baseHeight : baseWidth) * scale;\n const currentHeight = (isRotated ? baseWidth : baseHeight) * scale;\n\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const maxTranslateX = Math.max(0, (currentWidth - viewportWidth) / 2);\n const maxTranslateY = Math.max(0, (currentHeight - viewportHeight) / 2);\n\n // Clamp logic\n const currentX = this.translateX();\n const currentY = this.translateY();\n\n let newX = currentX;\n let newY = currentY;\n\n if (Math.abs(currentX) > maxTranslateX) {\n newX = Math.sign(currentX) * maxTranslateX;\n }\n if (Math.abs(currentY) > maxTranslateY) {\n newY = Math.sign(currentY) * maxTranslateY;\n }\n\n // If image is smaller than viewport, force center (0)\n if (currentWidth <= viewportWidth) newX = 0;\n if (currentHeight <= viewportHeight) newY = 0;\n\n if (newX !== currentX) this.translateX.set(newX);\n if (newY !== currentY) this.translateY.set(newY);\n }\n\n private startInertia() {\n this.isInertia.set(true); // Disable CSS transition\n let lastTime = Date.now();\n\n const step = () => {\n if (\n !this.isDragging() &&\n (Math.abs(this.velocityX) > this.VELOCITY_THRESHOLD ||\n Math.abs(this.velocityY) > this.VELOCITY_THRESHOLD)\n ) {\n const now = Date.now();\n const dt = Math.min(now - lastTime, 64); // Cap dt to avoid huge jumps if lag\n lastTime = now;\n\n if (dt === 0) {\n this.rafId = requestAnimationFrame(step);\n return;\n }\n\n // Clamp max velocity (just in case)\n this.velocityX = Math.max(-this.MAX_VELOCITY, Math.min(this.MAX_VELOCITY, this.velocityX));\n this.velocityY = Math.max(-this.MAX_VELOCITY, Math.min(this.MAX_VELOCITY, this.velocityY));\n\n // Time-based friction\n const frictionFactor = Math.pow(this.FRICTION, dt / 16);\n\n this.velocityX *= frictionFactor;\n this.velocityY *= frictionFactor;\n\n let nextX = this.translateX() + this.velocityX * dt;\n let nextY = this.translateY() + this.velocityY * dt;\n\n // Check bounds during inertia\n const constraints = this.cachedConstraints || this.getConstraints();\n\n if (nextX > constraints.maxX) {\n nextX = constraints.maxX;\n this.velocityX = 0;\n } else if (nextX < -constraints.maxX) {\n nextX = -constraints.maxX;\n this.velocityX = 0;\n }\n\n if (nextY > constraints.maxY) {\n nextY = constraints.maxY;\n this.velocityY = 0;\n } else if (nextY < -constraints.maxY) {\n nextY = -constraints.maxY;\n this.velocityY = 0;\n }\n\n this.translateX.set(nextX);\n this.translateY.set(nextY);\n\n this.rafId = requestAnimationFrame(step);\n } else {\n this.stopInertia();\n }\n };\n this.rafId = requestAnimationFrame(step);\n }\n\n private stopInertia() {\n this.isInertia.set(false); // Re-enable CSS transition\n if (this.rafId) {\n cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n }\n\n private snapBack() {\n const constraints = this.cachedConstraints || this.getConstraints();\n const currentX = this.translateX();\n const currentY = this.translateY();\n\n let targetX = currentX;\n let targetY = currentY;\n\n if (currentX > constraints.maxX) targetX = constraints.maxX;\n if (currentX < -constraints.maxX) targetX = -constraints.maxX;\n if (currentY > constraints.maxY) targetY = constraints.maxY;\n if (currentY < -constraints.maxY) targetY = -constraints.maxY;\n\n if (targetX !== currentX || targetY !== currentY) {\n // Animate snap back? For now, we rely on CSS transition if not dragging\n // But we turned off transition for .dragging.\n // We need to ensure .dragging is removed (it is in onTouchEnd).\n // CSS transition handles the snap if we just set the value.\n this.translateX.set(targetX);\n this.translateY.set(targetY);\n }\n }\n\n onToolbarKey(event: KeyboardEvent) {\n event.stopPropagation();\n }\n\n onOverlayKey(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n this.close();\n }\n }\n\n onContainerKey(event: KeyboardEvent) {\n // Prevent closing when interacting with image container via keyboard if needed\n event.stopPropagation();\n }\n\n onMouseUp() {\n if (this.isDragging()) {\n // Check Pull to Close for Mouse\n if (this.scale() === 1) {\n const y = this.translateY();\n if (Math.abs(y) > 100) {\n this.close();\n return;\n }\n // Reset position if not closed\n if (y !== 0) {\n this.translateY.set(0);\n }\n const x = this.translateX();\n if (x !== 0) {\n this.translateX.set(0);\n }\n } else {\n this.snapBack();\n }\n }\n this.isDragging.set(false);\n }\n\n onTouchEnd(event: TouchEvent) {\n const touches = event.touches;\n if (touches.length === 0) {\n this.isDragging.set(false);\n\n // Calculate Release Velocity from History\n const now = Date.now();\n const lastPoint = this.touchHistory[this.touchHistory.length - 1];\n // We want a point from roughly 30-50ms ago to get \"launch\" direction,\n // but tracking last 100ms.\n // A simple approach: compare last point with oldest point in our (pruned) buffer.\n const oldestPoint = this.touchHistory[0];\n\n if (lastPoint && oldestPoint && lastPoint !== oldestPoint) {\n const dt = lastPoint.time - oldestPoint.time;\n if (dt > 0) {\n this.velocityX = (lastPoint.x - oldestPoint.x) / dt;\n this.velocityY = (lastPoint.y - oldestPoint.y) / dt;\n }\n } else {\n this.velocityX = 0;\n this.velocityY = 0;\n }\n\n this.isDragging.set(false);\n this.isPinching.set(false);\n this.initialPinchDistance = 0;\n\n // Swipe Navigation (at 1x scale)\n if (this.scale() === 1) {\n const x = this.translateX();\n const y = this.translateY();\n\n // Pull to Close\n if (Math.abs(y) > 100) {\n this.close();\n return;\n }\n\n const threshold = window.innerWidth * 0.25;\n const images = this.images();\n const total = images ? images.length : 0;\n const index = this.currentIndex();\n\n if (x < -threshold) {\n // NEXT (Slide Left)\n if (index < total - 1) {\n this.animateSlide(-1);\n } else {\n this.translateX.set(0);\n this.translateY.set(0);\n }\n return;\n } else if (x > threshold) {\n // PREV (Slide Right)\n if (index > 0) {\n this.animateSlide(1);\n } else {\n this.translateX.set(0);\n this.translateY.set(0);\n }\n return;\n }\n\n // Snap back\n this.translateX.set(0);\n this.translateY.set(0);\n } else {\n this.startInertia();\n }\n return;\n }\n\n else if (touches.length === 1 && this.isPinching()) {\n // Transition from pinch to pan\n this.isPinching.set(false);\n this.isDragging.set(true);\n this.lastTouchX = touches[0].clientX;\n this.lastTouchY = touches[0].clientY;\n // Reset velocity on transition\n this.velocityX = 0;\n this.velocityY = 0;\n this.lastTimestamp = Date.now();\n // Re-cache constraints for new pan interaction\n this.cachedConstraints = this.getConstraints();\n }\n }\n\n private lastTouchX = 0;\n private lastTouchY = 0;\n private initialPinchCenter = { x: 0, y: 0 };\n private initialTranslateX = 0;\n private initialTranslateY = 0;\n\n private getDistance(touches: TouchList): number {\n return Math.hypot(\n touches[0].clientX - touches[1].clientX,\n touches[0].clientY - touches[1].clientY,\n );\n }\n\n private getCenter(touches: TouchList) {\n return {\n x: (touches[0].clientX + touches[1].clientX) / 2,\n y: (touches[0].clientY + touches[1].clientY) / 2,\n };\n }\n\n close() {\n this.closeCallback();\n }\n\n onImageLoad(src: string) {\n this.loadedImages.update(set => {\n const newSet = new Set(set);\n newSet.add(src);\n return newSet;\n });\n this.hasError.set(false);\n }\n\n onImageError(src: string) {\n // this.loadedImages.update... (maybe not mark as loaded? or separate error tracking)\n // For now, keep error simple\n this.hasError.set(true);\n }\n\n // Zoom\n zoomIn() {\n this.scale.update((s) => Math.min(s + this.ZOOM_STEP, this.MAX_SCALE));\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on zoom\n }\n\n zoomOut() {\n this.scale.update((s) => Math.max(s - this.ZOOM_STEP, this.MIN_SCALE));\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on zoom\n }\n\n // Rotate\n rotateLeft() {\n this.rotate.update((r) => r - 90);\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on rotate\n }\n\n rotateRight() {\n this.rotate.update((r) => r + 90);\n setTimeout(() => this.clampPosition());\n this.cachedConstraints = null; // Invalidate cache on rotate\n }\n\n // Flip\n flipHorizontal() {\n this.flipH.update((f) => !f);\n this.cachedConstraints = null; // Invalidate cache on flip\n }\n\n flipVertical() {\n this.flipV.update((f) => !f);\n this.cachedConstraints = null; // Invalidate cache on flip\n }\n\n reset() {\n this.scale.set(1);\n this.translateX.set(0);\n this.translateY.set(0);\n this.rotate.set(0);\n this.flipH.set(false);\n this.flipV.set(false);\n this.cachedConstraints = null; // Invalidate cache on reset\n }\n\n next() {\n const imgs = this.images();\n if (!imgs) return;\n if (this.currentIndex() < imgs.length - 1) {\n this.currentIndex.update((i) => i + 1);\n }\n }\n\n prev() {\n if (this.currentIndex() > 0) {\n this.currentIndex.update((i) => i - 1);\n }\n }\n\n jumpTo(index: number) {\n this.currentIndex.set(index);\n this.reset();\n }\n\n // Slide Animation\n private animateSlide(direction: -1 | 1) {\n const spacing = 16;\n const width = window.innerWidth + spacing;\n // direction -1 (Next) -> move to -width\n // direction 1 (Prev) -> move to width\n // Wait. If I swipe Left (Next), x is negative. Target should be -width.\n // If I swipe Right (Prev), x is positive. Target should be width.\n // So target = direction * width? No.\n // If direction is \"Next\" (index + 1), I want to slide to the Left (-X).\n // Let's pass the sign of movement explicitly.\n\n const target = direction === -1 ? -width : width;\n\n this.translateX.set(target);\n\n // Wait for CSS transition (0.3s)\n setTimeout(() => {\n // Update Index (silent swap)\n this.isInertia.set(true); // Disable transition\n\n if (direction === -1) this.next();\n else this.prev();\n\n this.translateX.set(0);\n\n // Re-enable transition\n setTimeout(() => {\n this.isInertia.set(false);\n }, 50);\n }, 300);\n }\n\n // Mouse Interaction\n onMouseDown(event: MouseEvent) {\n // Allow dragging even at scale 1 for Pull-to-Close and Swipe-like nav (if intended)\n if (this.isDragging()) return;\n\n // Only trigger on Left Click\n if (event.button !== 0) return;\n\n this.isDragging.set(true);\n this.startX = event.clientX;\n this.startY = event.clientY;\n this.lastTranslateX = this.translateX();\n this.lastTranslateY = this.translateY();\n event.preventDefault();\n }\n\n // Touch Interaction (bound in template)\n onTouchStart(event: TouchEvent) {\n this.stopInertia(); // Cancel any ongoing movement\n\n // if (event.cancelable) event.preventDefault(); // Removed to restore Tap-to-Close (click events)\n // touch-action: none in CSS handles scroll prevention.\n\n const touches = event.touches;\n\n if (touches.length === 1) {\n // Single touch: Pan.\n // Allow dragging from anywhere in the container (better UX for Pull-to-Close)\n this.isDragging.set(true);\n this.lastTouchX = touches[0].clientX;\n this.lastTouchY = touches[0].clientY;\n this.lastTimestamp = Date.now();\n\n // Initialize physics state\n this.velocityX = 0;\n this.velocityY = 0;\n this.touchHistory = [\n {\n x: touches[0].clientX,\n y: touches[0].clientY,\n time: Date.now(),\n },\n ];\n // Cache layout to prevent thrashing\n this.cachedConstraints = this.getConstraints();\n } else if (touches.length === 2) {\n // Two fingers: Pinch\n this.isPinching.set(true);\n this.isDragging.set(false); // Stop panning\n this.initialPinchDistance = this.getDistance(touches);\n this.initialScale = this.scale();\n this.initialPinchCenter = this.getCenter(touches);\n this.initialTranslateX = this.translateX();\n this.initialTranslateY = this.translateY();\n\n // Clear caching on pinch (scale changes will invalidate limits)\n this.cachedConstraints = null;\n\n // Prevent default to avoid browser zoom\n if (event.cancelable) event.preventDefault();\n }\n }\n}\n","\nimport {\n Directive,\n ElementRef,\n HostListener,\n Input,\n TemplateRef,\n ApplicationRef,\n EnvironmentInjector,\n createComponent,\n ComponentRef,\n inject,\n OnDestroy,\n PLATFORM_ID\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { ImagesPreviewComponent, ImagesPreviewContext, ToolbarConfig } from './images-preview.component';\n\n/**\n * Directive to open the image preview.\n * Can be used on any element, but auto-detects `src` on `img` or nested `img`.\n */\n@Directive({\n selector: '[ngImagesPreview]',\n standalone: true\n})\nexport class ImagesPreviewDirective implements OnDestroy {\n /**\n * High resolution image source to display in preview.\n * If empty, tries to read `src` from host element or first child `img`.\n */\n @Input('ngImagesPreview') highResSrc = '';\n\n /**\n * List of images for gallery navigation.\n * If provided, enables previous/next navigation buttons.\n */\n @Input() previewImages: string[] = [];\n\n /**\n * Custom template to use for the preview.\n * If provided, overrides the default viewer UI.\n */\n @Input() previewTemplate?: TemplateRef<ImagesPreviewContext>;\n\n /**\n * Configuration for the toolbar buttons.\n */\n @Input() toolbarConfig?: ToolbarConfig;\n\n /**\n * Optional srcset for the single image.\n */\n @Input() srcset?: string;\n\n /**\n * List of srcsets corresponding to the `previewImages` array.\n */\n /**\n * List of srcsets corresponding to the `previewImages` array.\n */\n @Input() srcsets?: string[];\n\n /**\n * Whether to show the thumbnail strip.\n * @default true\n */\n @Input() showThumbnails = true;\n\n /**\n * Whether to show the toolbar.\n * @default true\n */\n @Input() showToolbar = true;\n\n /**\n * Custom template to render in the toolbar (e.g. for download buttons).\n */\n @Input() toolbarExtensions: TemplateRef<any> | null = null;\n\n /**\n * Type guard helper for strict template type checking.\n * Allows Angular Language Service to infer types in `previewTemplate`.\n */\n static ngTemplateContextGuard(\n directive: ImagesPreviewDirective,\n context: unknown\n ): context is ImagesPreviewContext {\n return true;\n }\n\n private componentRef: ComponentRef<ImagesPreviewComponent> | null = null;\n\n private appRef = inject(ApplicationRef);\n private injector = inject(EnvironmentInjector);\n private el = inject(ElementRef<HTMLElement>);\n private platformId = inject(PLATFORM_ID);\n\n @HostListener('click', ['$event'])\n onClick(event: Event): void {\n event.stopPropagation();\n\n // Prevent duplicate open\n if (this.componentRef) return;\n\n // Determine Source\n const hostEl = this.el.nativeElement;\n let src = this.highResSrc || hostEl.getAttribute('src') || (hostEl as HTMLImageElement).src;\n\n // If no src found on host, try to find an img child\n if (!src) {\n const imgChild = hostEl.querySelector('img');\n if (imgChild) {\n src = imgChild.getAttribute('src') || imgChild.src;\n }\n }\n\n src = src || '';\n\n if (src) {\n const rect = hostEl.getBoundingClientRect();\n this.openPreview(src, rect);\n }\n }\n\n @HostListener('style.cursor')\n readonly cursor = 'pointer';\n\n private openPreview(src: string, rect: DOMRect): void {\n if (!isPlatformBrowser(this.platformId)) return;\n\n // Create Component\n this.componentRef = createComponent(ImagesPreviewComponent, {\n environmentInjector: this.injector\n });\n\n // Set Inputs\n this.componentRef.setInput('src', src);\n this.componentRef.setInput('openerRect', rect);\n\n if (this.previewImages.length > 0) {\n this.componentRef.setInput('images', this.previewImages);\n const index = this.previewImages.indexOf(src);\n this.componentRef.setInput('initialIndex', index >= 0 ? index : 0);\n }\n\n if (this.previewTemplate) {\n this.componentRef.setInput('customTemplate', this.previewTemplate);\n }\n\n if (this.toolbarConfig) {\n this.componentRef.setInput('toolbarConfig', this.toolbarConfig);\n }\n\n if (this.srcset) {\n this.componentRef.setInput('srcset', this.srcset);\n }\n\n if (this.srcsets) {\n this.componentRef.setInput('srcsets', this.srcsets);\n }\n this.componentRef.setInput('showThumbnails', this.showThumbnails);\n this.componentRef.setInput('showToolbar', this.showToolbar);\n this.componentRef.setInput('toolbarExtensions', this.toolbarExtensions);\n\n // Set Callbacks\n this.componentRef.instance.closeCallback = () => this.destroyPreview();\n\n // Attach to App\n this.appRef.attachView(this.componentRef.hostView);\n\n // Append to Body\n const domElem = (this.componentRef.hostView as unknown as { rootNodes: HTMLElement[] }).rootNodes[0];\n document.body.appendChild(domElem);\n }\n\n private destroyPreview(): void {\n if (this.componentRef) {\n this.appRef.detachView(this.componentRef.hostView);\n this.componentRef.destroy();\n this.componentRef = null;\n }\n }\n\n ngOnDestroy(): void {\n this.destroyPreview();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { ImagesPreviewComponent } from './images-preview.component';\nimport { ImagesPreviewDirective } from './images-preview.directive';\n\n@NgModule({\n imports: [ImagesPreviewComponent, ImagesPreviewDirective],\n exports: [ImagesPreviewComponent, ImagesPreviewDirective]\n})\nexport class NgImagesPreviewModule { }\n","\n/*\n * Public API Surface of ng-images-preview\n */\n\nexport * from './lib/images-preview.component';\nexport * from './lib/images-preview.directive';\nexport * from './lib/images-preview.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAO,MAAM,aAAa,GAAG;AACzB,IAAA,KAAK,EAAE,kJAAkJ;AACzJ,IAAA,IAAI,EAAE,0FAA0F;AAChG,IAAA,IAAI,EAAE,2FAA2F;AACjG,IAAA,KAAK,EAAE,kPAAkP;AACzP,IAAA,KAAK,EAAE,wXAAwX;AAC/X,IAAA,UAAU,EAAE,gZAAgZ;AAC5Z,IAAA,WAAW,EAAE,oZAAoZ;AACja,IAAA,OAAO,EAAE,8DAA8D;AACvE,IAAA,MAAM,EAAE;CACX;;ACkED;;;AAGG;MA4KU,sBAAsB,CAAA;AAC/B;;;AAGG;AACH,IAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,8CAAU;AAE9B;;AAEG;IACH,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAY;AAE1B;;AAEG;IACH,MAAM,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,QAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAExB;;;AAGG;IACH,OAAO,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAY;AAE3B;;;AAGG;AACH,IAAA,YAAY,GAAG,KAAK,CAAC,CA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package.json
CHANGED
|
@@ -22,6 +22,8 @@ interface ImagesPreviewState {
|
|
|
22
22
|
flipV: boolean;
|
|
23
23
|
isLoading: boolean;
|
|
24
24
|
hasError: boolean;
|
|
25
|
+
currentIndex: number;
|
|
26
|
+
total: number;
|
|
25
27
|
}
|
|
26
28
|
interface ImagesPreviewActions {
|
|
27
29
|
zoomIn: () => void;
|
|
@@ -32,6 +34,9 @@ interface ImagesPreviewActions {
|
|
|
32
34
|
flipVertical: () => void;
|
|
33
35
|
reset: () => void;
|
|
34
36
|
close: () => void;
|
|
37
|
+
next: () => void;
|
|
38
|
+
prev: () => void;
|
|
39
|
+
jumpTo: (index: number) => void;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
42
|
* Configuration for the toolbar.
|