@frybynite/image-cloud 0.3.7 → 0.4.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/dist/index.d.ts CHANGED
@@ -179,7 +179,7 @@ declare interface ClusterLayoutOptions extends Partial<LayoutConfig> {
179
179
  fixedHeight?: number;
180
180
  }
181
181
 
182
- export declare class ClusterPlacementGenerator implements PlacementGenerator {
182
+ export declare class ClusterPlacementLayout implements PlacementLayout {
183
183
  private config;
184
184
  private imageConfig;
185
185
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -688,7 +688,7 @@ declare interface GridLayoutOptions extends Partial<LayoutConfig> {
688
688
  fixedHeight?: number;
689
689
  }
690
690
 
691
- export declare class GridPlacementGenerator implements PlacementGenerator {
691
+ export declare class GridPlacementLayout implements PlacementLayout {
692
692
  private config;
693
693
  private imageConfig;
694
694
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1020,13 +1020,13 @@ export declare class LayoutEngine {
1020
1020
  private config;
1021
1021
  private imageConfig;
1022
1022
  private layouts;
1023
- private generator;
1023
+ private placementLayout;
1024
1024
  constructor(config: LayoutEngineConfig);
1025
1025
  /**
1026
- * Initialize the appropriate generator based on config type
1027
- * @returns Initialized placement generator
1026
+ * Initialize the appropriate placement layout based on config type
1027
+ * @returns Initialized placement layout
1028
1028
  */
1029
- private initGenerator;
1029
+ private initLayout;
1030
1030
  /**
1031
1031
  * Generate layout positions for images
1032
1032
  * @param imageCount - Number of images to layout
@@ -1127,7 +1127,7 @@ declare interface PerformanceRenderingConfig {
1127
1127
  imageQuality?: 'auto' | 'high' | 'medium' | 'low';
1128
1128
  }
1129
1129
 
1130
- export declare interface PlacementGenerator {
1130
+ export declare interface PlacementLayout {
1131
1131
  generate(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig>): ImageLayout[];
1132
1132
  }
1133
1133
 
@@ -1140,7 +1140,7 @@ declare interface RadialLayoutOptions extends Partial<LayoutConfig> {
1140
1140
  fixedHeight?: number;
1141
1141
  }
1142
1142
 
1143
- export declare class RadialPlacementGenerator implements PlacementGenerator {
1143
+ export declare class RadialPlacementLayout implements PlacementLayout {
1144
1144
  private config;
1145
1145
  private imageConfig;
1146
1146
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1172,7 +1172,7 @@ declare interface RandomLayoutOptions extends Partial<LayoutConfig> {
1172
1172
  fixedHeight?: number;
1173
1173
  }
1174
1174
 
1175
- export declare class RandomPlacementGenerator implements PlacementGenerator {
1175
+ export declare class RandomPlacementLayout implements PlacementLayout {
1176
1176
  private config;
1177
1177
  private imageConfig;
1178
1178
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1237,7 +1237,6 @@ export declare interface SharedLoaderConfig {
1237
1237
  validateUrls?: boolean;
1238
1238
  validationTimeout?: number;
1239
1239
  validationMethod?: 'head' | 'simple' | 'none';
1240
- failOnAllMissing?: boolean;
1241
1240
  allowedExtensions?: string[];
1242
1241
  }
1243
1242
 
@@ -1261,7 +1260,7 @@ declare interface SpiralLayoutOptions extends Partial<LayoutConfig> {
1261
1260
  fixedHeight?: number;
1262
1261
  }
1263
1262
 
1264
- export declare class SpiralPlacementGenerator implements PlacementGenerator {
1263
+ export declare class SpiralPlacementLayout implements PlacementLayout {
1265
1264
  private config;
1266
1265
  private imageConfig;
1267
1266
  constructor(config: LayoutConfig, imageConfig?: ImageConfig);
@@ -1402,7 +1401,6 @@ export declare interface StaticLoaderInnerConfig {
1402
1401
  validateUrls?: boolean;
1403
1402
  validationTimeout?: number;
1404
1403
  validationMethod?: 'head' | 'simple' | 'none';
1405
- failOnAllMissing?: boolean;
1406
1404
  allowedExtensions?: string[];
1407
1405
  debugLogging?: boolean;
1408
1406
  }
@@ -1448,6 +1446,10 @@ declare interface WaveAlgorithmConfig {
1448
1446
  synchronization: 'offset' | 'synchronized' | 'alternating';
1449
1447
  }
1450
1448
 
1449
+ declare interface WaveLayoutOptions extends Partial<LayoutConfig> {
1450
+ fixedHeight?: number;
1451
+ }
1452
+
1451
1453
  export declare interface WavePathConfig {
1452
1454
  amplitude: number;
1453
1455
  frequency: number;
@@ -1458,6 +1460,49 @@ export declare interface WavePathConfig {
1458
1460
 
1459
1461
  export declare type WavePathPreset = 'gentle' | 'playful' | 'serpentine' | 'flutter';
1460
1462
 
1463
+ export declare class WavePlacementLayout implements PlacementLayout {
1464
+ private config;
1465
+ private imageConfig;
1466
+ constructor(config: LayoutConfig, imageConfig?: ImageConfig);
1467
+ /**
1468
+ * Generate wave layout positions for images
1469
+ * @param imageCount - Number of images to layout
1470
+ * @param containerBounds - Container dimensions {width, height}
1471
+ * @param options - Optional overrides
1472
+ * @returns Array of layout objects with position, rotation, scale
1473
+ */
1474
+ generate(imageCount: number, containerBounds: ContainerBounds, options?: WaveLayoutOptions): ImageLayout[];
1475
+ /**
1476
+ * Calculate Y position displacement on wave curve
1477
+ * @param x - Horizontal position
1478
+ * @param containerWidth - Container width
1479
+ * @param amplitude - Wave amplitude
1480
+ * @param frequency - Wave frequency
1481
+ * @param phase - Phase offset
1482
+ * @returns Y displacement from baseline
1483
+ */
1484
+ private calculateWaveY;
1485
+ /**
1486
+ * Calculate rotation based on wave tangent
1487
+ * @param x - Horizontal position
1488
+ * @param containerWidth - Container width
1489
+ * @param amplitude - Wave amplitude
1490
+ * @param frequency - Wave frequency
1491
+ * @param phase - Phase offset
1492
+ * @returns Rotation angle in degrees
1493
+ */
1494
+ private calculateRotation;
1495
+ /**
1496
+ * Estimate image width based on height
1497
+ /**
1498
+ * Utility: Generate random number between min and max
1499
+ * @param min - Minimum value
1500
+ * @param max - Maximum value
1501
+ * @returns Random number in range
1502
+ */
1503
+ private random;
1504
+ }
1505
+
1461
1506
  export declare class ZoomEngine {
1462
1507
  private config;
1463
1508
  private animationEngine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frybynite/image-cloud",
3
- "version": "0.3.7",
3
+ "version": "0.4.1",
4
4
  "description": "Javascript/TypeScript image cloud library with custom loaders, various layouts, full images styling, with animation and zoom effects",
5
5
  "type": "module",
6
6
  "main": "./dist/image-cloud.umd.js",
@@ -8,9 +8,9 @@
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/index.d.ts",
11
12
  "import": "./dist/image-cloud.js",
12
- "require": "./dist/image-cloud.umd.js",
13
- "types": "./dist/index.d.ts"
13
+ "require": "./dist/image-cloud.umd.js"
14
14
  },
15
15
  "./style.css": "./dist/style.css",
16
16
  "./auto-init": "./dist/image-cloud-auto-init.js"
@@ -64,7 +64,7 @@
64
64
  "devDependencies": {
65
65
  "@playwright/test": "^1.57.0",
66
66
  "typescript": "^5.3.3",
67
- "vite": "^5.0.11",
68
- "vite-plugin-dts": "^3.7.1"
67
+ "vite": "^7.3.1",
68
+ "vite-plugin-dts": "^4.5.4"
69
69
  }
70
70
  }