@frybynite/image-cloud 0.4.2 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/ImageCloud.d.ts +99 -0
  2. package/dist/ImageCloud.d.ts.map +1 -0
  3. package/dist/config/adapter.d.ts +50 -0
  4. package/dist/config/adapter.d.ts.map +1 -0
  5. package/dist/config/defaults.d.ts +118 -0
  6. package/dist/config/defaults.d.ts.map +1 -0
  7. package/dist/config/types.d.ts +599 -0
  8. package/dist/config/types.d.ts.map +1 -0
  9. package/dist/engines/AnimationEngine.d.ts +82 -0
  10. package/dist/engines/AnimationEngine.d.ts.map +1 -0
  11. package/dist/engines/EntryAnimationEngine.d.ts +161 -0
  12. package/dist/engines/EntryAnimationEngine.d.ts.map +1 -0
  13. package/dist/engines/LayoutEngine.d.ts +68 -0
  14. package/dist/engines/LayoutEngine.d.ts.map +1 -0
  15. package/dist/engines/PathAnimator.d.ts +50 -0
  16. package/dist/engines/PathAnimator.d.ts.map +1 -0
  17. package/dist/engines/SwipeEngine.d.ts +53 -0
  18. package/dist/engines/SwipeEngine.d.ts.map +1 -0
  19. package/dist/engines/ZoomEngine.d.ts +139 -0
  20. package/dist/engines/ZoomEngine.d.ts.map +1 -0
  21. package/dist/image-cloud-auto-init.d.ts +14 -0
  22. package/dist/image-cloud-auto-init.d.ts.map +1 -0
  23. package/dist/image-cloud-auto-init.js +215 -244
  24. package/dist/image-cloud-auto-init.js.map +1 -1
  25. package/dist/image-cloud.js +235 -264
  26. package/dist/image-cloud.js.map +1 -1
  27. package/dist/image-cloud.umd.js +3 -3
  28. package/dist/image-cloud.umd.js.map +1 -1
  29. package/dist/index.d.ts +23 -1637
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/layouts/ClusterPlacementLayout.d.ts +40 -0
  32. package/dist/layouts/ClusterPlacementLayout.d.ts.map +1 -0
  33. package/dist/layouts/GridPlacementLayout.d.ts +27 -0
  34. package/dist/layouts/GridPlacementLayout.d.ts.map +1 -0
  35. package/dist/layouts/RadialPlacementLayout.d.ts +33 -0
  36. package/dist/layouts/RadialPlacementLayout.d.ts.map +1 -0
  37. package/dist/layouts/RandomPlacementLayout.d.ts +26 -0
  38. package/dist/layouts/RandomPlacementLayout.d.ts.map +1 -0
  39. package/dist/layouts/SpiralPlacementLayout.d.ts +43 -0
  40. package/dist/layouts/SpiralPlacementLayout.d.ts.map +1 -0
  41. package/dist/layouts/WavePlacementLayout.d.ts +48 -0
  42. package/dist/layouts/WavePlacementLayout.d.ts.map +1 -0
  43. package/dist/loaders/CompositeLoader.d.ts +37 -0
  44. package/dist/loaders/CompositeLoader.d.ts.map +1 -0
  45. package/dist/loaders/GoogleDriveLoader.d.ts +90 -0
  46. package/dist/loaders/GoogleDriveLoader.d.ts.map +1 -0
  47. package/dist/loaders/ImageFilter.d.ts +26 -0
  48. package/dist/loaders/ImageFilter.d.ts.map +1 -0
  49. package/dist/loaders/StaticImageLoader.d.ts +85 -0
  50. package/dist/loaders/StaticImageLoader.d.ts.map +1 -0
  51. package/dist/react/index.d.ts +16 -0
  52. package/dist/react/index.d.ts.map +1 -0
  53. package/dist/react.d.ts +1 -0
  54. package/dist/react.js +3227 -0
  55. package/dist/react.js.map +1 -0
  56. package/dist/styles/functionalStyles.d.ts +11 -0
  57. package/dist/styles/functionalStyles.d.ts.map +1 -0
  58. package/dist/utils/styleUtils.d.ts +54 -0
  59. package/dist/utils/styleUtils.d.ts.map +1 -0
  60. package/dist/vue/index.d.ts +18 -0
  61. package/dist/vue/index.d.ts.map +1 -0
  62. package/dist/vue.d.ts +1 -0
  63. package/dist/vue.js +3241 -0
  64. package/dist/vue.js.map +1 -0
  65. package/dist/web-component/index.d.ts +15 -0
  66. package/dist/web-component/index.d.ts.map +1 -0
  67. package/dist/web-component.d.ts +1 -0
  68. package/dist/web-component.js +3265 -0
  69. package/dist/web-component.js.map +1 -0
  70. package/package.json +38 -4
@@ -0,0 +1,82 @@
1
+ import { AnimationConfig, TransformParams, ImageLayout, AnimationHandle, AnimationSnapshot } from '../config/types';
2
+ export declare class AnimationEngine {
3
+ private config;
4
+ private activeAnimations;
5
+ private animationIdCounter;
6
+ constructor(config: AnimationConfig);
7
+ /**
8
+ * Build transform string from transform params
9
+ * Always starts with centering transform to match image positioning system
10
+ */
11
+ private buildTransformString;
12
+ /**
13
+ * Start a cancellable transform animation using Web Animations API
14
+ * @param element - The element to animate
15
+ * @param from - Starting transform state
16
+ * @param to - Ending transform state
17
+ * @param duration - Animation duration in ms (optional)
18
+ * @param easing - CSS easing function (optional)
19
+ * @returns AnimationHandle that can be used to cancel or query the animation
20
+ */
21
+ animateTransformCancellable(element: HTMLElement, from: TransformParams, to: TransformParams, duration?: number | null, easing?: string | null): AnimationHandle;
22
+ /**
23
+ * Cancel an active animation
24
+ * @param handle - The animation handle to cancel
25
+ * @param commitStyle - If true, keeps current position; if false, no style change
26
+ * @returns Snapshot of where the animation was when cancelled
27
+ */
28
+ cancelAnimation(handle: AnimationHandle, commitStyle?: boolean): AnimationSnapshot;
29
+ /**
30
+ * Cancel all animations on an element
31
+ * Uses Web Animations API to find and cancel ALL animations, not just tracked ones
32
+ * @param element - The element to cancel animations for
33
+ */
34
+ cancelAllAnimations(element: HTMLElement): void;
35
+ /**
36
+ * Get current transform state of an element (works mid-animation)
37
+ * Uses DOMMatrix to parse the computed transform
38
+ * @param element - The element to query
39
+ * @returns Current transform snapshot
40
+ */
41
+ getCurrentTransform(element: HTMLElement): AnimationSnapshot;
42
+ /**
43
+ * Check if an element has an active animation
44
+ * @param element - The element to check
45
+ * @returns True if animation is in progress
46
+ */
47
+ hasActiveAnimation(element: HTMLElement): boolean;
48
+ /**
49
+ * Get animation handle for an element if it exists
50
+ * @param element - The element to query
51
+ * @returns AnimationHandle or undefined
52
+ */
53
+ getAnimationHandle(element: HTMLElement): AnimationHandle | undefined;
54
+ /**
55
+ * Animate element transform with smooth easing (CSS transitions - legacy method)
56
+ * @param element - The element to animate
57
+ * @param properties - Transform properties {x, y, rotation, scale}
58
+ * @param duration - Animation duration in ms (optional)
59
+ * @param easing - CSS easing function (optional)
60
+ * @returns Promise that resolves when animation completes
61
+ */
62
+ animateTransform(element: HTMLElement, properties: TransformParams, duration?: number | null, easing?: string | null): Promise<void>;
63
+ /**
64
+ * Reset element to its original transform
65
+ * @param element - The element to reset
66
+ * @param originalState - Original transform state {x, y, rotation, scale}
67
+ * @returns Promise that resolves when animation completes
68
+ */
69
+ resetTransform(element: HTMLElement, originalState: TransformParams | ImageLayout): Promise<void>;
70
+ /**
71
+ * Remove transition styles from element
72
+ * @param element - The element to clear
73
+ */
74
+ clearTransition(element: HTMLElement): void;
75
+ /**
76
+ * Utility: Wait for a specified duration
77
+ * @param ms - Milliseconds to wait
78
+ * @returns Promise that resolves after the specified duration
79
+ */
80
+ wait(ms: number): Promise<void>;
81
+ }
82
+ //# sourceMappingURL=AnimationEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnimationEngine.d.ts","sourceRoot":"","sources":["../../src/engines/AnimationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,gBAAgB,CAAgD;IACxE,OAAO,CAAC,kBAAkB,CAAK;gBAEnB,MAAM,EAAE,eAAe;IAInC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAoB5B;;;;;;;;OAQG;IACH,2BAA2B,CACzB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,eAAe,EACrB,EAAE,EAAE,eAAe,EACnB,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,MAAM,GAAE,MAAM,GAAG,IAAW,GAC3B,eAAe;IAqDlB;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,WAAW,GAAE,OAAc,GAAG,iBAAiB;IAsBxF;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAc/C;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,iBAAiB;IA6B5D;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAIjD;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,eAAe,GAAG,SAAS;IAIrE;;;;;;;OAOG;IACH,gBAAgB,CACd,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,eAAe,EAC3B,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,MAAM,GAAE,MAAM,GAAG,IAAW,GAC3B,OAAO,CAAC,IAAI,CAAC;IAkBhB;;;;;OAKG;IACH,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjG;;;OAGG;IACH,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAI3C;;;;OAIG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGhC"}
@@ -0,0 +1,161 @@
1
+ import { EntryAnimationConfig, ContainerBounds, LayoutAlgorithm, EntryPathConfig, EntryPathType, EntryRotationConfig, EntryRotationMode, EntryScaleConfig, EntryScaleMode } from '../config/types';
2
+ export interface StartPosition {
3
+ x: number;
4
+ y: number;
5
+ useScale?: boolean;
6
+ }
7
+ export interface AnimationParams {
8
+ startTransform: string;
9
+ duration: number;
10
+ delay: number;
11
+ easing: string;
12
+ }
13
+ export declare class EntryAnimationEngine {
14
+ private config;
15
+ private layoutAlgorithm;
16
+ private resolvedStartPosition;
17
+ private pathConfig;
18
+ private rotationConfig;
19
+ private scaleConfig;
20
+ constructor(config: EntryAnimationConfig, layoutAlgorithm: LayoutAlgorithm);
21
+ /**
22
+ * Get the effective start position, considering layout-aware defaults
23
+ */
24
+ private resolveStartPosition;
25
+ /**
26
+ * Calculate the starting position for an image's entry animation
27
+ */
28
+ calculateStartPosition(finalPosition: {
29
+ x: number;
30
+ y: number;
31
+ }, imageSize: {
32
+ width: number;
33
+ height: number;
34
+ }, containerBounds: ContainerBounds, imageIndex: number, totalImages: number): StartPosition;
35
+ /**
36
+ * Calculate start position from the nearest edge (current default behavior)
37
+ */
38
+ private calculateNearestEdge;
39
+ /**
40
+ * Calculate start position from a specific edge
41
+ */
42
+ private calculateEdgePosition;
43
+ /**
44
+ * Calculate start position from center with scale animation
45
+ */
46
+ private calculateCenterPosition;
47
+ /**
48
+ * Calculate start position from a random edge
49
+ */
50
+ private calculateRandomEdge;
51
+ /**
52
+ * Calculate start position on a circle around the container
53
+ */
54
+ private calculateCircularPosition;
55
+ /**
56
+ * Get animation parameters for an image
57
+ */
58
+ getAnimationParams(_imageIndex: number): AnimationParams;
59
+ /**
60
+ * Build a CSS transform string for the start position
61
+ * Uses pixel-based centering offset for reliable cross-browser behavior
62
+ */
63
+ buildStartTransform(startPosition: StartPosition, finalPosition: {
64
+ x: number;
65
+ y: number;
66
+ }, finalRotation: number, finalScale: number, imageWidth?: number, imageHeight?: number, startRotation?: number, startScale?: number): string;
67
+ /**
68
+ * Build the final CSS transform string
69
+ * Uses pixel-based centering offset for reliable cross-browser behavior
70
+ */
71
+ buildFinalTransform(rotation: number, scale: number, imageWidth?: number, imageHeight?: number): string;
72
+ /**
73
+ * Get the transition CSS for entry animation
74
+ * For JS-animated paths, only animate opacity (transform handled by JS)
75
+ */
76
+ getTransitionCSS(): string;
77
+ /**
78
+ * Check if the current path type requires JavaScript animation
79
+ */
80
+ requiresJSAnimation(): boolean;
81
+ /**
82
+ * Get the path configuration
83
+ */
84
+ getPathConfig(): EntryPathConfig;
85
+ /**
86
+ * Get the path type
87
+ */
88
+ getPathType(): EntryPathType;
89
+ /**
90
+ * Get animation timing configuration
91
+ */
92
+ getTiming(): {
93
+ duration: number;
94
+ };
95
+ /**
96
+ * Get the rotation configuration
97
+ */
98
+ getRotationConfig(): EntryRotationConfig;
99
+ /**
100
+ * Get the rotation mode
101
+ */
102
+ getRotationMode(): EntryRotationMode;
103
+ /**
104
+ * Calculate the starting rotation for an entry animation
105
+ * @param finalRotation - The final rotation from the layout
106
+ * @returns The starting rotation in degrees
107
+ */
108
+ calculateStartRotation(finalRotation: number): number;
109
+ /**
110
+ * Resolve spin direction based on config
111
+ * @returns 1 for clockwise, -1 for counterclockwise
112
+ */
113
+ private resolveSpinDirection;
114
+ /**
115
+ * Check if the current rotation mode requires JavaScript animation
116
+ * (as opposed to CSS transitions)
117
+ */
118
+ requiresJSRotation(): boolean;
119
+ /**
120
+ * Calculate wobble rotation for a given animation progress
121
+ * @param progress - Animation progress from 0 to 1
122
+ * @param finalRotation - The final rotation in degrees
123
+ * @returns The current rotation in degrees
124
+ */
125
+ calculateWobbleRotation(progress: number, finalRotation: number): number;
126
+ /**
127
+ * Get the scale configuration
128
+ */
129
+ getScaleConfig(): EntryScaleConfig;
130
+ /**
131
+ * Get the scale mode
132
+ */
133
+ getScaleMode(): EntryScaleMode;
134
+ /**
135
+ * Calculate the starting scale for an entry animation
136
+ * @param finalScale - The final scale from the layout
137
+ * @returns The starting scale
138
+ */
139
+ calculateStartScale(finalScale: number): number;
140
+ /**
141
+ * Check if the current scale mode requires JavaScript animation
142
+ * (as opposed to CSS transitions)
143
+ */
144
+ requiresJSScale(): boolean;
145
+ /**
146
+ * Calculate pop scale for a given animation progress
147
+ * @param progress - Animation progress from 0 to 1
148
+ * @param finalScale - The final scale value
149
+ * @returns The current scale value with bounce effect
150
+ */
151
+ calculatePopScale(progress: number, finalScale: number): number;
152
+ /**
153
+ * Generate keyframes for scale bounce animation
154
+ */
155
+ private generateScaleBounceKeyframes;
156
+ /**
157
+ * Easing function for smooth transitions
158
+ */
159
+ private easeOutQuad;
160
+ }
161
+ //# sourceMappingURL=EntryAnimationEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntryAnimationEngine.d.ts","sourceRoot":"","sources":["../../src/engines/EntryAnimationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,oBAAoB,EAEpB,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACf,MAAM,iBAAiB,CAAC;AAczB,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,qBAAqB,CAAqB;IAClD,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,WAAW,CAAmB;gBAE1B,MAAM,EAAE,oBAAoB,EAAE,eAAe,EAAE,eAAe;IAiB1E;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,sBAAsB,CACpB,aAAa,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EACvC,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAC5C,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,aAAa;IAwChB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAqC5B;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AAM;IAyBxE;;OAEG;IACH,cAAc,IAAI,gBAAgB;IAIlC;;OAEG;IACH,YAAY,IAAI,cAAc;IAI9B;;;;OAIG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAqC/C;;;OAGG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;OAKG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAiC/D;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAoCpC;;OAEG;IACH,OAAO,CAAC,WAAW;CAGpB"}
@@ -0,0 +1,68 @@
1
+ import { LayoutConfig, ImageLayout, ContainerBounds, AdaptiveSizingResult, ImageConfig } from '../config/types';
2
+ export interface LayoutEngineConfig {
3
+ layout: LayoutConfig;
4
+ image: ImageConfig;
5
+ }
6
+ export declare class LayoutEngine {
7
+ private config;
8
+ private imageConfig;
9
+ private layouts;
10
+ private placementLayout;
11
+ constructor(config: LayoutEngineConfig);
12
+ /**
13
+ * Initialize the appropriate placement layout based on config type
14
+ * @returns Initialized placement layout
15
+ */
16
+ private initLayout;
17
+ /**
18
+ * Generate layout positions for images
19
+ * @param imageCount - Number of images to layout
20
+ * @param containerBounds - Container dimensions {width, height}
21
+ * @param options - Optional overrides for configuration (e.g. fixedHeight)
22
+ * @returns Array of layout objects with position, rotation, scale
23
+ */
24
+ generateLayout(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig>): ImageLayout[];
25
+ /**
26
+ * Get the original layout state for an image
27
+ * @param imageId - The image ID (number or string)
28
+ * @returns Original layout state or undefined if not found
29
+ */
30
+ getOriginalState(imageId: number | string): ImageLayout | undefined;
31
+ /**
32
+ * Reset all stored layouts
33
+ */
34
+ reset(): void;
35
+ /**
36
+ * Update config dynamically (useful for responsive changes)
37
+ * @param newConfig - Updated configuration
38
+ */
39
+ updateConfig(newConfig: Partial<LayoutEngineConfig>): void;
40
+ /**
41
+ * Get responsive breakpoints from layout config
42
+ */
43
+ private getBreakpoints;
44
+ /**
45
+ * Resolve breakpoint name based on viewport width
46
+ */
47
+ resolveBreakpoint(viewportWidth: number): 'mobile' | 'tablet' | 'screen';
48
+ /**
49
+ * Resolve the effective base height based on image config and current viewport
50
+ * @param viewportWidth - Current viewport width
51
+ * @returns Resolved base height or undefined if should auto-calculate (adaptive mode)
52
+ */
53
+ resolveBaseHeight(viewportWidth: number): number | undefined;
54
+ /**
55
+ * Calculate adaptive image size based on container dimensions and image count
56
+ * @param containerBounds - Container dimensions {width, height}
57
+ * @param imageCount - Number of images to display
58
+ * @param maxHeight - Maximum height constraint (upper bound)
59
+ * @param viewportWidth - Current viewport width for baseHeight resolution
60
+ * @returns Calculated sizing result with height
61
+ */
62
+ calculateAdaptiveSize(containerBounds: ContainerBounds, imageCount: number, maxHeight: number, viewportWidth: number): AdaptiveSizingResult;
63
+ /**
64
+ * Utility: Clamp a value between min and max
65
+ */
66
+ private clamp;
67
+ }
68
+ //# sourceMappingURL=LayoutEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutEngine.d.ts","sourceRoot":"","sources":["../../src/engines/LayoutEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAmB,oBAAoB,EAAE,WAAW,EAA0C,MAAM,iBAAiB,CAAC;AAQ9K,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,eAAe,CAAkB;gBAE7B,MAAM,EAAE,kBAAkB;IAUtC;;;OAGG;IACH,OAAO,CAAC,UAAU;IAkBlB;;;;;;OAMG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,WAAW,EAAE;IAWxH;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS;IAInE;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI;IAiB1D;;OAEG;IACH,OAAO,CAAC,cAAc;IAOtB;;OAEG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ;IAYxE;;;;OAIG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAkC5D;;;;;;;OAOG;IACH,qBAAqB,CACnB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,oBAAoB;IAgDvB;;OAEG;IACH,OAAO,CAAC,KAAK;CAGd"}
@@ -0,0 +1,50 @@
1
+ import { BouncePathConfig, ElasticPathConfig, WavePathConfig, EntryPathConfig, EntryPathType, EntryRotationConfig, EntryScaleConfig } from '../config/types';
2
+ export interface Point {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export interface PathAnimationOptions {
7
+ element: HTMLElement;
8
+ startPosition: Point;
9
+ endPosition: Point;
10
+ pathConfig: EntryPathConfig;
11
+ duration: number;
12
+ imageWidth: number;
13
+ imageHeight: number;
14
+ rotation: number;
15
+ scale: number;
16
+ onComplete?: () => void;
17
+ rotationConfig?: EntryRotationConfig;
18
+ startRotation?: number;
19
+ scaleConfig?: EntryScaleConfig;
20
+ startScale?: number;
21
+ }
22
+ /**
23
+ * Calculate position along a bounce path
24
+ * Overshoot and settle animation
25
+ */
26
+ export declare function calculateBouncePosition(t: number, start: Point, end: Point, config: BouncePathConfig): Point;
27
+ /**
28
+ * Calculate position along an elastic path
29
+ * Spring-like oscillation animation
30
+ */
31
+ export declare function calculateElasticPosition(t: number, start: Point, end: Point, config: ElasticPathConfig): Point;
32
+ /**
33
+ * Calculate position along a wave path
34
+ * Sinusoidal path from start to end
35
+ */
36
+ export declare function calculateWavePosition(t: number, start: Point, end: Point, config: WavePathConfig): Point;
37
+ /**
38
+ * Animate an element along a path using requestAnimationFrame
39
+ */
40
+ export declare function animatePath(options: PathAnimationOptions): void;
41
+ /**
42
+ * Check if a path type requires JavaScript animation (vs CSS transitions)
43
+ */
44
+ export declare function requiresJSAnimation(pathType: EntryPathType): boolean;
45
+ /**
46
+ * Get CSS easing for bounce (approximation for simple bounce)
47
+ * Note: This is only used as a fallback; full bounce uses JS animation
48
+ */
49
+ export declare function getBounceCSSEasing(): string;
50
+ //# sourceMappingURL=PathAnimator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PathAnimator.d.ts","sourceRoot":"","sources":["../../src/engines/PathAnimator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,KAAK,CAAC;IACrB,WAAW,EAAE,KAAK,CAAC;IACnB,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IAExB,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,gBAAgB,GACvB,KAAK,CAiDP;AAqCD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,iBAAiB,GACxB,KAAK,CAmCP;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,cAAc,GACrB,KAAK,CAyBP;AAwFD;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CA6H/D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * SwipeEngine.ts
3
+ * Handles touch swipe gestures for navigating between focused images
4
+ *
5
+ * Public API:
6
+ * - enable() - Start listening for touch events
7
+ * - disable() - Stop listening (when no image focused)
8
+ * - destroy() - Clean up all event listeners
9
+ * - setDragCallback(callback) - Set callback for drag offset updates
10
+ */
11
+ declare const SNAP_BACK_DURATION_MS = 150;
12
+ interface SwipeCallbacks {
13
+ onNext: () => void;
14
+ onPrev: () => void;
15
+ onDragOffset: (offset: number) => void;
16
+ onDragEnd: (navigated: boolean) => void;
17
+ }
18
+ export declare class SwipeEngine {
19
+ private container;
20
+ private callbacks;
21
+ private enabled;
22
+ private touchState;
23
+ private recentTouchTimestamp;
24
+ private static readonly TOUCH_CLICK_DELAY;
25
+ private boundTouchStart;
26
+ private boundTouchMove;
27
+ private boundTouchEnd;
28
+ private boundTouchCancel;
29
+ constructor(container: HTMLElement, callbacks: SwipeCallbacks);
30
+ /**
31
+ * Start listening for touch events
32
+ */
33
+ enable(): void;
34
+ /**
35
+ * Stop listening for touch events
36
+ */
37
+ disable(): void;
38
+ /**
39
+ * Clean up all event listeners
40
+ */
41
+ destroy(): void;
42
+ /**
43
+ * Check if a touch interaction happened recently
44
+ * Used to prevent click-outside from unfocusing immediately after touch
45
+ */
46
+ hadRecentTouch(): boolean;
47
+ private handleTouchStart;
48
+ private handleTouchMove;
49
+ private handleTouchEnd;
50
+ private handleTouchCancel;
51
+ }
52
+ export { SNAP_BACK_DURATION_MS };
53
+ //# sourceMappingURL=SwipeEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwipeEngine.d.ts","sourceRoot":"","sources":["../../src/engines/SwipeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,QAAA,MAAM,qBAAqB,MAAM,CAAC;AAGlC,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAWD,qBAAa,WAAW;IACtB,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,UAAU,CAA2B;IAG7C,OAAO,CAAC,oBAAoB,CAAa;IACzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAO;IAGhD,OAAO,CAAC,eAAe,CAA0B;IACjD,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,aAAa,CAA0B;IAC/C,OAAO,CAAC,gBAAgB,CAA0B;gBAEtC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc;IAW7D;;OAEG;IACH,MAAM,IAAI,IAAI;IAad;;OAEG;IACH,OAAO,IAAI,IAAI;IAmBf;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;;OAGG;IACH,cAAc,IAAI,OAAO;IAIzB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,eAAe;IAmCvB,OAAO,CAAC,cAAc;IAwCtB,OAAO,CAAC,iBAAiB;CAM1B;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,139 @@
1
+ import { FocusInteractionConfig, ContainerBounds, ImageLayout, ImageStylingConfig, ZoomState } from '../config/types';
2
+ import { AnimationEngine } from './AnimationEngine';
3
+ export declare class ZoomEngine {
4
+ private config;
5
+ private animationEngine;
6
+ private state;
7
+ private currentFocus;
8
+ private focusData;
9
+ private outgoing;
10
+ private incoming;
11
+ private focusGeneration;
12
+ private defaultStyles;
13
+ private focusedStyles;
14
+ private defaultClassName;
15
+ private focusedClassName;
16
+ constructor(config: FocusInteractionConfig, animationEngine: AnimationEngine, styling?: ImageStylingConfig);
17
+ /**
18
+ * Get current state machine state
19
+ */
20
+ getState(): ZoomState;
21
+ /**
22
+ * Check if any animation is in progress
23
+ */
24
+ isAnimating(): boolean;
25
+ /**
26
+ * Normalize scalePercent value
27
+ */
28
+ private normalizeScalePercent;
29
+ /**
30
+ * Calculate target dimensions for focused image
31
+ * Returns actual pixel dimensions instead of scale factor for sharper rendering
32
+ */
33
+ private calculateFocusDimensions;
34
+ /**
35
+ * Calculate the transform needed to center an image (position only, no scale)
36
+ * Scale is handled by animating actual dimensions for sharper rendering
37
+ */
38
+ private calculateFocusTransform;
39
+ /**
40
+ * Build transform string for dimension-based zoom (no scale in transform)
41
+ */
42
+ private buildDimensionZoomTransform;
43
+ /**
44
+ * Create a Web Animation that animates both transform (position) and dimensions
45
+ * This provides sharper zoom by re-rendering at target size instead of scaling pixels
46
+ */
47
+ private animateWithDimensions;
48
+ /**
49
+ * Apply focused styling to an element
50
+ */
51
+ private applyFocusedStyling;
52
+ /**
53
+ * Remove focused styling from an element
54
+ */
55
+ private removeFocusedStyling;
56
+ /**
57
+ * Start focus animation for an image using dimension-based zoom
58
+ * Animates actual width/height for sharper rendering instead of transform scale
59
+ * @param fromTransform - Optional starting transform (for mid-animation reversals)
60
+ * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
61
+ */
62
+ private startFocusAnimation;
63
+ /**
64
+ * Start unfocus animation for an image using dimension-based zoom
65
+ * Animates back to original dimensions for consistent behavior
66
+ * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
67
+ */
68
+ private startUnfocusAnimation;
69
+ /**
70
+ * Capture the current visual state of an element mid-animation, BEFORE cancelling.
71
+ *
72
+ * The computed matrix.e/f include the -50%/-50% centering offset resolved to pixels.
73
+ * buildDimensionZoomTransform prepends its own translate(-50%,-50%), so passing raw
74
+ * matrix.e/f doubles the centering and produces the wrong starting position.
75
+ *
76
+ * This method extracts the PURE positional offset (pureX = matrix.e + 0.5*midWidth)
77
+ * and commits width/height/transform to inline styles before the animation is cancelled,
78
+ * preventing any visual snap.
79
+ *
80
+ * Must be called while the animation is still running (offsetWidth reflects animated size).
81
+ * Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
82
+ */
83
+ private captureMidAnimationState;
84
+ /**
85
+ * Handle animation completion
86
+ */
87
+ private waitForAnimation;
88
+ /**
89
+ * Reset an element instantly to its original position and dimensions (no animation)
90
+ */
91
+ private resetElementInstantly;
92
+ /**
93
+ * Focus (zoom) an image to center of container
94
+ * Implements cross-animation when swapping focus
95
+ */
96
+ focusImage(imageElement: HTMLElement, containerBounds: ContainerBounds, originalState: ImageLayout): Promise<void>;
97
+ /**
98
+ * Unfocus current image, returning it to original position
99
+ */
100
+ unfocusImage(): Promise<void>;
101
+ /**
102
+ * Swap focus from current image to a new one (alias for focusImage with cross-animation)
103
+ */
104
+ swapFocus(newImageElement: HTMLElement, containerBounds: ContainerBounds, originalState: ImageLayout): Promise<void>;
105
+ /**
106
+ * Get currently focused image element
107
+ */
108
+ getCurrentFocus(): HTMLElement | null;
109
+ /**
110
+ * Check if an image is currently focused (stable state)
111
+ */
112
+ isFocused(imageElement: HTMLElement): boolean;
113
+ /**
114
+ * Check if an image is the target of current focus animation
115
+ */
116
+ isTargetingFocus(imageElement: HTMLElement): boolean;
117
+ /**
118
+ * Check if an image is involved in any focus/animation state
119
+ * Returns true if the image is focused, animating in, or animating out
120
+ * Useful for hover state management - don't apply hover to animating images
121
+ */
122
+ isInvolved(imageElement: HTMLElement): boolean;
123
+ /**
124
+ * Apply a temporary horizontal drag offset to the focused image
125
+ * Used during swipe gestures for visual feedback
126
+ */
127
+ setDragOffset(offset: number): void;
128
+ /**
129
+ * Clear the drag offset, optionally animating back to center
130
+ * @param animate - If true, animate back to center; if false, snap instantly
131
+ * @param duration - Animation duration in ms (default 150)
132
+ */
133
+ clearDragOffset(animate: boolean, duration?: number): void;
134
+ /**
135
+ * Reset zoom state (cancels all animations)
136
+ */
137
+ reset(): void;
138
+ }
139
+ //# sourceMappingURL=ZoomEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomEngine.d.ts","sourceRoot":"","sources":["../../src/engines/ZoomEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,WAAW,EAEX,kBAAkB,EAGnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAsBpD,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,eAAe,CAAkB;IAGzC,OAAO,CAAC,KAAK,CAA6B;IA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,GACzB,OAAO,CAAC,IAAI,CAAC;IAIhB;;OAEG;IACH,eAAe,IAAI,WAAW,GAAG,IAAI;IAIrC;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO;IAI7C;;OAEG;IACH,gBAAgB,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO;IAIpD;;;;OAIG;IACH,UAAU,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO;IAQ9C;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAmBnC;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAY,GAAG,IAAI;IA+B/D;;OAEG;IACH,KAAK,IAAI,IAAI;CAwCd"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Image Cloud Library - Auto-Initialization Entry Point
3
+ *
4
+ * Automatically initializes galleries from HTML data attributes
5
+ * Usage: Include this script and add data-image-cloud attribute to containers
6
+ */
7
+ /**
8
+ * Auto-initialize galleries from data attributes
9
+ */
10
+ declare function autoInitialize(): void;
11
+ export { autoInitialize };
12
+ export { ImageCloud } from './ImageCloud';
13
+ export { ImageCloud as ImageGallery } from './ImageCloud';
14
+ //# sourceMappingURL=image-cloud-auto-init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-cloud-auto-init.d.ts","sourceRoot":"","sources":["../src/image-cloud-auto-init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH;;GAEG;AACH,iBAAS,cAAc,IAAI,IAAI,CA6D9B;AAMD,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC"}