@frybynite/image-cloud 0.3.6 → 0.4.0
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 +6 -2
- package/dist/image-cloud-auto-init.js +843 -838
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +841 -835
- package/dist/image-cloud.js.map +1 -1
- package/dist/image-cloud.umd.js +3 -3
- package/dist/image-cloud.umd.js.map +1 -1
- package/dist/index.d.ts +64 -16
- package/package.json +1 -1
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
|
|
182
|
+
export declare class ClusterPlacementLayout implements PlacementLayout {
|
|
183
183
|
private config;
|
|
184
184
|
private imageConfig;
|
|
185
185
|
constructor(config: LayoutConfig, imageConfig?: ImageConfig);
|
|
@@ -253,6 +253,7 @@ export declare interface CompositeLoaderConfig {
|
|
|
253
253
|
|
|
254
254
|
export declare interface ConfigSection {
|
|
255
255
|
loaders?: SharedLoaderConfig;
|
|
256
|
+
debug?: DebugConfig;
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
export declare interface ContainerBounds {
|
|
@@ -260,6 +261,12 @@ export declare interface ContainerBounds {
|
|
|
260
261
|
height: number;
|
|
261
262
|
}
|
|
262
263
|
|
|
264
|
+
export declare interface DebugConfig {
|
|
265
|
+
enabled?: boolean;
|
|
266
|
+
centers?: boolean;
|
|
267
|
+
loaders?: boolean;
|
|
268
|
+
}
|
|
269
|
+
|
|
263
270
|
export declare const DEFAULT_CONFIG: ImageCloudConfig;
|
|
264
271
|
|
|
265
272
|
/**
|
|
@@ -681,7 +688,7 @@ declare interface GridLayoutOptions extends Partial<LayoutConfig> {
|
|
|
681
688
|
fixedHeight?: number;
|
|
682
689
|
}
|
|
683
690
|
|
|
684
|
-
export declare class
|
|
691
|
+
export declare class GridPlacementLayout implements PlacementLayout {
|
|
685
692
|
private config;
|
|
686
693
|
private imageConfig;
|
|
687
694
|
constructor(config: LayoutConfig, imageConfig?: ImageConfig);
|
|
@@ -821,7 +828,6 @@ export declare interface ImageCloudConfig {
|
|
|
821
828
|
interaction: InteractionConfig;
|
|
822
829
|
rendering: RenderingConfig;
|
|
823
830
|
styling?: ImageStylingConfig;
|
|
824
|
-
debug: boolean;
|
|
825
831
|
}
|
|
826
832
|
|
|
827
833
|
export declare interface ImageCloudOptions {
|
|
@@ -835,7 +841,6 @@ export declare interface ImageCloudOptions {
|
|
|
835
841
|
interaction?: Partial<InteractionConfig>;
|
|
836
842
|
rendering?: Partial<RenderingConfig>;
|
|
837
843
|
styling?: Partial<ImageStylingConfig>;
|
|
838
|
-
debug?: boolean;
|
|
839
844
|
}
|
|
840
845
|
|
|
841
846
|
/**
|
|
@@ -885,7 +890,6 @@ export declare interface ImageLayout {
|
|
|
885
890
|
scale: number;
|
|
886
891
|
baseSize: number;
|
|
887
892
|
zIndex?: number;
|
|
888
|
-
borderColor?: string;
|
|
889
893
|
}
|
|
890
894
|
|
|
891
895
|
/**
|
|
@@ -1006,8 +1010,6 @@ export declare interface LayoutConfig {
|
|
|
1006
1010
|
responsive?: ResponsiveBreakpoints;
|
|
1007
1011
|
targetCoverage?: number;
|
|
1008
1012
|
densityFactor?: number;
|
|
1009
|
-
debugRadials?: boolean;
|
|
1010
|
-
debugCenters?: boolean;
|
|
1011
1013
|
grid?: GridAlgorithmConfig;
|
|
1012
1014
|
spiral?: SpiralAlgorithmConfig;
|
|
1013
1015
|
cluster?: ClusterAlgorithmConfig;
|
|
@@ -1018,13 +1020,13 @@ export declare class LayoutEngine {
|
|
|
1018
1020
|
private config;
|
|
1019
1021
|
private imageConfig;
|
|
1020
1022
|
private layouts;
|
|
1021
|
-
private
|
|
1023
|
+
private placementLayout;
|
|
1022
1024
|
constructor(config: LayoutEngineConfig);
|
|
1023
1025
|
/**
|
|
1024
|
-
* Initialize the appropriate
|
|
1025
|
-
* @returns Initialized placement
|
|
1026
|
+
* Initialize the appropriate placement layout based on config type
|
|
1027
|
+
* @returns Initialized placement layout
|
|
1026
1028
|
*/
|
|
1027
|
-
private
|
|
1029
|
+
private initLayout;
|
|
1028
1030
|
/**
|
|
1029
1031
|
* Generate layout positions for images
|
|
1030
1032
|
* @param imageCount - Number of images to layout
|
|
@@ -1125,7 +1127,7 @@ declare interface PerformanceRenderingConfig {
|
|
|
1125
1127
|
imageQuality?: 'auto' | 'high' | 'medium' | 'low';
|
|
1126
1128
|
}
|
|
1127
1129
|
|
|
1128
|
-
export declare interface
|
|
1130
|
+
export declare interface PlacementLayout {
|
|
1129
1131
|
generate(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig>): ImageLayout[];
|
|
1130
1132
|
}
|
|
1131
1133
|
|
|
@@ -1138,7 +1140,7 @@ declare interface RadialLayoutOptions extends Partial<LayoutConfig> {
|
|
|
1138
1140
|
fixedHeight?: number;
|
|
1139
1141
|
}
|
|
1140
1142
|
|
|
1141
|
-
export declare class
|
|
1143
|
+
export declare class RadialPlacementLayout implements PlacementLayout {
|
|
1142
1144
|
private config;
|
|
1143
1145
|
private imageConfig;
|
|
1144
1146
|
constructor(config: LayoutConfig, imageConfig?: ImageConfig);
|
|
@@ -1170,7 +1172,7 @@ declare interface RandomLayoutOptions extends Partial<LayoutConfig> {
|
|
|
1170
1172
|
fixedHeight?: number;
|
|
1171
1173
|
}
|
|
1172
1174
|
|
|
1173
|
-
export declare class
|
|
1175
|
+
export declare class RandomPlacementLayout implements PlacementLayout {
|
|
1174
1176
|
private config;
|
|
1175
1177
|
private imageConfig;
|
|
1176
1178
|
constructor(config: LayoutConfig, imageConfig?: ImageConfig);
|
|
@@ -1237,7 +1239,6 @@ export declare interface SharedLoaderConfig {
|
|
|
1237
1239
|
validationMethod?: 'head' | 'simple' | 'none';
|
|
1238
1240
|
failOnAllMissing?: boolean;
|
|
1239
1241
|
allowedExtensions?: string[];
|
|
1240
|
-
debugLogging?: boolean;
|
|
1241
1242
|
}
|
|
1242
1243
|
|
|
1243
1244
|
/**
|
|
@@ -1260,7 +1261,7 @@ declare interface SpiralLayoutOptions extends Partial<LayoutConfig> {
|
|
|
1260
1261
|
fixedHeight?: number;
|
|
1261
1262
|
}
|
|
1262
1263
|
|
|
1263
|
-
export declare class
|
|
1264
|
+
export declare class SpiralPlacementLayout implements PlacementLayout {
|
|
1264
1265
|
private config;
|
|
1265
1266
|
private imageConfig;
|
|
1266
1267
|
constructor(config: LayoutConfig, imageConfig?: ImageConfig);
|
|
@@ -1447,6 +1448,10 @@ declare interface WaveAlgorithmConfig {
|
|
|
1447
1448
|
synchronization: 'offset' | 'synchronized' | 'alternating';
|
|
1448
1449
|
}
|
|
1449
1450
|
|
|
1451
|
+
declare interface WaveLayoutOptions extends Partial<LayoutConfig> {
|
|
1452
|
+
fixedHeight?: number;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1450
1455
|
export declare interface WavePathConfig {
|
|
1451
1456
|
amplitude: number;
|
|
1452
1457
|
frequency: number;
|
|
@@ -1457,6 +1462,49 @@ export declare interface WavePathConfig {
|
|
|
1457
1462
|
|
|
1458
1463
|
export declare type WavePathPreset = 'gentle' | 'playful' | 'serpentine' | 'flutter';
|
|
1459
1464
|
|
|
1465
|
+
export declare class WavePlacementLayout implements PlacementLayout {
|
|
1466
|
+
private config;
|
|
1467
|
+
private imageConfig;
|
|
1468
|
+
constructor(config: LayoutConfig, imageConfig?: ImageConfig);
|
|
1469
|
+
/**
|
|
1470
|
+
* Generate wave layout positions for images
|
|
1471
|
+
* @param imageCount - Number of images to layout
|
|
1472
|
+
* @param containerBounds - Container dimensions {width, height}
|
|
1473
|
+
* @param options - Optional overrides
|
|
1474
|
+
* @returns Array of layout objects with position, rotation, scale
|
|
1475
|
+
*/
|
|
1476
|
+
generate(imageCount: number, containerBounds: ContainerBounds, options?: WaveLayoutOptions): ImageLayout[];
|
|
1477
|
+
/**
|
|
1478
|
+
* Calculate Y position displacement on wave curve
|
|
1479
|
+
* @param x - Horizontal position
|
|
1480
|
+
* @param containerWidth - Container width
|
|
1481
|
+
* @param amplitude - Wave amplitude
|
|
1482
|
+
* @param frequency - Wave frequency
|
|
1483
|
+
* @param phase - Phase offset
|
|
1484
|
+
* @returns Y displacement from baseline
|
|
1485
|
+
*/
|
|
1486
|
+
private calculateWaveY;
|
|
1487
|
+
/**
|
|
1488
|
+
* Calculate rotation based on wave tangent
|
|
1489
|
+
* @param x - Horizontal position
|
|
1490
|
+
* @param containerWidth - Container width
|
|
1491
|
+
* @param amplitude - Wave amplitude
|
|
1492
|
+
* @param frequency - Wave frequency
|
|
1493
|
+
* @param phase - Phase offset
|
|
1494
|
+
* @returns Rotation angle in degrees
|
|
1495
|
+
*/
|
|
1496
|
+
private calculateRotation;
|
|
1497
|
+
/**
|
|
1498
|
+
* Estimate image width based on height
|
|
1499
|
+
/**
|
|
1500
|
+
* Utility: Generate random number between min and max
|
|
1501
|
+
* @param min - Minimum value
|
|
1502
|
+
* @param max - Maximum value
|
|
1503
|
+
* @returns Random number in range
|
|
1504
|
+
*/
|
|
1505
|
+
private random;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1460
1508
|
export declare class ZoomEngine {
|
|
1461
1509
|
private config;
|
|
1462
1510
|
private animationEngine;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frybynite/image-cloud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|