@frybynite/image-cloud 0.1.2 → 0.2.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/dist/index.d.ts CHANGED
@@ -1,9 +1,3 @@
1
- declare interface AdaptiveSizingConfig {
2
- enabled: boolean;
3
- minSize: number;
4
- maxSize: number;
5
- }
6
-
7
1
  declare interface AdaptiveSizingResult {
8
2
  height: number;
9
3
  }
@@ -530,12 +524,28 @@ declare interface FilterConfig {
530
524
  dropShadow?: DropShadowConfig | string;
531
525
  }
532
526
 
527
+ /**
528
+ * Fixed mode height configuration with responsive breakpoints
529
+ * At least one of mobile, tablet, or screen is required
530
+ */
531
+ declare interface FixedModeHeight {
532
+ mobile?: number;
533
+ tablet?: number;
534
+ screen?: number;
535
+ }
536
+
533
537
  declare interface FocusInteractionConfig {
534
538
  scalePercent: number;
535
539
  zIndex: number;
536
540
  animationDuration?: number;
537
541
  }
538
542
 
543
+ /**
544
+ * Minimal functional CSS required for the library to work.
545
+ * Injected automatically - no external CSS file needed.
546
+ */
547
+ export declare const FUNCTIONAL_CSS = "\n.fbn-ic-gallery {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: hidden;\n perspective: 1000px;\n}\n\n.fbn-ic-image {\n position: absolute;\n cursor: pointer;\n transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),\n box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),\n filter 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n border 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n outline 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n z-index 0s 0.6s;\n will-change: transform;\n user-select: none;\n backface-visibility: hidden;\n -webkit-backface-visibility: hidden;\n}\n\n.fbn-ic-image.fbn-ic-focused {\n z-index: 1000;\n transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),\n box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),\n filter 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n border 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n outline 0.3s cubic-bezier(0.4, 0, 0.2, 1),\n z-index 0s 0s;\n will-change: auto;\n}\n\n.fbn-ic-hidden {\n display: none !important;\n}\n";
548
+
539
549
  export declare type GalleryConfig = ImageCloudConfig;
540
550
 
541
551
  declare interface GestureInteractionConfig {
@@ -917,9 +927,11 @@ declare interface ImageRotationRange {
917
927
  * Image sizing configuration
918
928
  */
919
929
  declare interface ImageSizingConfig {
920
- baseHeight?: number | ResponsiveBaseHeight;
930
+ mode: SizingMode;
931
+ height?: number | FixedModeHeight;
932
+ minSize?: number;
933
+ maxSize?: number;
921
934
  variance?: ImageVarianceConfig;
922
- scaleDecay?: number;
923
935
  }
924
936
 
925
937
  declare interface ImageStyleState {
@@ -957,6 +969,12 @@ declare interface ImageVarianceConfig {
957
969
  max: number;
958
970
  }
959
971
 
972
+ /**
973
+ * Inject functional styles into document head.
974
+ * Idempotent - safe to call multiple times.
975
+ */
976
+ export declare function injectFunctionalStyles(): void;
977
+
960
978
  declare interface InteractionConfig {
961
979
  focus: FocusInteractionConfig;
962
980
  navigation?: NavigationInteractionConfig;
@@ -967,8 +985,9 @@ export declare type LayoutAlgorithm = 'random' | 'radial' | 'grid' | 'spiral' |
967
985
 
968
986
  export declare interface LayoutConfig {
969
987
  algorithm: LayoutAlgorithm;
970
- sizing: LayoutSizingConfig;
971
988
  spacing: LayoutSpacingConfig;
989
+ scaleDecay?: number;
990
+ responsive?: ResponsiveBreakpoints;
972
991
  targetCoverage?: number;
973
992
  densityFactor?: number;
974
993
  debugRadials?: boolean;
@@ -982,7 +1001,6 @@ export declare interface LayoutConfig {
982
1001
  export declare class LayoutEngine {
983
1002
  private config;
984
1003
  private imageConfig;
985
- private breakpoints;
986
1004
  private layouts;
987
1005
  private generator;
988
1006
  constructor(config: LayoutEngineConfig);
@@ -1014,21 +1032,29 @@ export declare class LayoutEngine {
1014
1032
  * @param newConfig - Updated configuration
1015
1033
  */
1016
1034
  updateConfig(newConfig: Partial<LayoutEngineConfig>): void;
1035
+ /**
1036
+ * Get responsive breakpoints from layout config
1037
+ */
1038
+ private getBreakpoints;
1039
+ /**
1040
+ * Resolve breakpoint name based on viewport width
1041
+ */
1042
+ resolveBreakpoint(viewportWidth: number): 'mobile' | 'tablet' | 'screen';
1017
1043
  /**
1018
1044
  * Resolve the effective base height based on image config and current viewport
1019
1045
  * @param viewportWidth - Current viewport width
1020
- * @returns Resolved base height or undefined if should auto-calculate
1046
+ * @returns Resolved base height or undefined if should auto-calculate (adaptive mode)
1021
1047
  */
1022
1048
  resolveBaseHeight(viewportWidth: number): number | undefined;
1023
1049
  /**
1024
1050
  * Calculate adaptive image size based on container dimensions and image count
1025
1051
  * @param containerBounds - Container dimensions {width, height}
1026
1052
  * @param imageCount - Number of images to display
1027
- * @param responsiveHeight - Current responsive breakpoint height (upper bound)
1053
+ * @param maxHeight - Maximum height constraint (upper bound)
1028
1054
  * @param viewportWidth - Current viewport width for baseHeight resolution
1029
1055
  * @returns Calculated sizing result with height
1030
1056
  */
1031
- calculateAdaptiveSize(containerBounds: ContainerBounds, imageCount: number, responsiveHeight: number, viewportWidth: number): AdaptiveSizingResult;
1057
+ calculateAdaptiveSize(containerBounds: ContainerBounds, imageCount: number, maxHeight: number, viewportWidth: number): AdaptiveSizingResult;
1032
1058
  /**
1033
1059
  * Utility: Clamp a value between min and max
1034
1060
  */
@@ -1038,16 +1064,6 @@ export declare class LayoutEngine {
1038
1064
  declare interface LayoutEngineConfig {
1039
1065
  layout: LayoutConfig;
1040
1066
  image: ImageConfig;
1041
- breakpoints?: {
1042
- mobile: number;
1043
- tablet?: number;
1044
- };
1045
- }
1046
-
1047
- declare interface LayoutSizingConfig {
1048
- base: number;
1049
- responsive: ResponsiveHeight[];
1050
- adaptive?: AdaptiveSizingConfig;
1051
1067
  }
1052
1068
 
1053
1069
  declare interface LayoutSpacingConfig {
@@ -1176,13 +1192,16 @@ declare interface RenderingConfig {
1176
1192
  export declare function requiresJSAnimation(pathType: EntryPathType): boolean;
1177
1193
 
1178
1194
  /**
1179
- * Responsive base height configuration
1180
- * Can be a simple number or responsive breakpoint object
1195
+ * Responsive breakpoints configuration for layout
1196
+ * Defines viewport width thresholds for mobile and tablet
1181
1197
  */
1182
- declare interface ResponsiveBaseHeight {
1183
- default: number;
1184
- tablet?: number;
1185
- mobile?: number;
1198
+ declare interface ResponsiveBreakpoints {
1199
+ mobile: {
1200
+ maxWidth: number;
1201
+ };
1202
+ tablet: {
1203
+ maxWidth: number;
1204
+ };
1186
1205
  }
1187
1206
 
1188
1207
  export declare interface ResponsiveHeight {
@@ -1201,6 +1220,14 @@ export declare interface ResponsiveRenderingConfig {
1201
1220
 
1202
1221
  declare type ShadowPreset = 'none' | 'sm' | 'md' | 'lg' | 'glow';
1203
1222
 
1223
+ /**
1224
+ * Sizing mode:
1225
+ * - 'fixed': single explicit height for all breakpoints
1226
+ * - 'responsive': different heights per breakpoint (mobile/tablet/screen)
1227
+ * - 'adaptive': auto-calculates based on container size and image count
1228
+ */
1229
+ declare type SizingMode = 'fixed' | 'responsive' | 'adaptive';
1230
+
1204
1231
  export declare interface SpiralAlgorithmConfig {
1205
1232
  spiralType: 'golden' | 'archimedean' | 'logarithmic';
1206
1233
  direction: 'clockwise' | 'counterclockwise';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frybynite/image-cloud",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "TypeScript image cloud library with custom loaders, various layouts, full images styling, what animation and zoom effects",
5
5
  "type": "module",
6
6
  "main": "./dist/image-cloud.umd.js",