@frybynite/image-cloud 0.9.0 → 0.9.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.
package/dist/index.d.ts CHANGED
@@ -11,7 +11,6 @@ export declare interface AnimationConfig {
11
11
  duration: number;
12
12
  easing: AnimationEasingConfig;
13
13
  queue: AnimationQueueConfig;
14
- performance?: AnimationPerformanceConfig;
15
14
  entry?: EntryAnimationConfig;
16
15
  idle?: IdleAnimationConfig;
17
16
  }
@@ -123,15 +122,9 @@ declare interface AnimationParams {
123
122
  easing: string;
124
123
  }
125
124
 
126
- declare interface AnimationPerformanceConfig {
127
- useGPU?: boolean;
128
- reduceMotion?: boolean;
129
- }
130
-
131
125
  declare interface AnimationQueueConfig {
132
126
  enabled: boolean;
133
127
  interval: number;
134
- maxConcurrent?: number;
135
128
  }
136
129
 
137
130
  /**
@@ -563,11 +556,6 @@ export declare const FUNCTIONAL_CSS = "\n.fbn-ic-gallery {\n position: relative
563
556
 
564
557
  export declare type GalleryConfig = ImageCloudConfig;
565
558
 
566
- declare interface GestureInteractionConfig {
567
- pinchToZoom?: boolean;
568
- doubleTapToFocus?: boolean;
569
- }
570
-
571
559
  export declare interface GoogleDriveFilesSource {
572
560
  files: string[];
573
561
  }
@@ -722,6 +710,14 @@ declare interface HoneycombAlgorithmConfig {
722
710
  spacing?: number;
723
711
  }
724
712
 
713
+ export declare class HoneycombPlacementLayout implements PlacementLayout {
714
+ private config;
715
+ constructor(config: LayoutConfig, _imageConfig?: ImageConfig);
716
+ generate(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig> & {
717
+ fixedHeight?: number;
718
+ }): ImageLayout[];
719
+ }
720
+
725
721
  declare interface IdleAnimationConfig {
726
722
  type: IdleAnimationType;
727
723
  wiggle?: IdleWiggleConfig;
@@ -1057,7 +1053,7 @@ export declare function injectFunctionalStyles(): void;
1057
1053
  declare interface InteractionConfig {
1058
1054
  focus: FocusInteractionConfig;
1059
1055
  navigation?: NavigationInteractionConfig;
1060
- gestures?: GestureInteractionConfig;
1056
+ dragging?: boolean;
1061
1057
  }
1062
1058
 
1063
1059
  export declare type LayoutAlgorithm = 'random' | 'radial' | 'grid' | 'spiral' | 'cluster' | 'wave' | 'honeycomb';
@@ -1153,7 +1149,6 @@ declare interface LayoutEngineConfig {
1153
1149
 
1154
1150
  declare interface LayoutSpacingConfig {
1155
1151
  padding: number;
1156
- minGap: number;
1157
1152
  }
1158
1153
 
1159
1154
  export declare type LoaderEntry = StaticLoaderEntry | GoogleDriveLoaderEntry;
package/dist/react.d.ts CHANGED
@@ -11,7 +11,6 @@ export declare interface AnimationConfig {
11
11
  duration: number;
12
12
  easing: AnimationEasingConfig;
13
13
  queue: AnimationQueueConfig;
14
- performance?: AnimationPerformanceConfig;
15
14
  entry?: EntryAnimationConfig;
16
15
  idle?: IdleAnimationConfig;
17
16
  }
@@ -123,15 +122,9 @@ declare interface AnimationParams {
123
122
  easing: string;
124
123
  }
125
124
 
126
- declare interface AnimationPerformanceConfig {
127
- useGPU?: boolean;
128
- reduceMotion?: boolean;
129
- }
130
-
131
125
  declare interface AnimationQueueConfig {
132
126
  enabled: boolean;
133
127
  interval: number;
134
- maxConcurrent?: number;
135
128
  }
136
129
 
137
130
  /**
@@ -563,11 +556,6 @@ export declare const FUNCTIONAL_CSS = "\n.fbn-ic-gallery {\n position: relative
563
556
 
564
557
  export declare type GalleryConfig = ImageCloudConfig;
565
558
 
566
- declare interface GestureInteractionConfig {
567
- pinchToZoom?: boolean;
568
- doubleTapToFocus?: boolean;
569
- }
570
-
571
559
  export declare interface GoogleDriveFilesSource {
572
560
  files: string[];
573
561
  }
@@ -722,6 +710,14 @@ declare interface HoneycombAlgorithmConfig {
722
710
  spacing?: number;
723
711
  }
724
712
 
713
+ export declare class HoneycombPlacementLayout implements PlacementLayout {
714
+ private config;
715
+ constructor(config: LayoutConfig, _imageConfig?: ImageConfig);
716
+ generate(imageCount: number, containerBounds: ContainerBounds, options?: Partial<LayoutConfig> & {
717
+ fixedHeight?: number;
718
+ }): ImageLayout[];
719
+ }
720
+
725
721
  declare interface IdleAnimationConfig {
726
722
  type: IdleAnimationType;
727
723
  wiggle?: IdleWiggleConfig;
@@ -1057,7 +1053,7 @@ export declare function injectFunctionalStyles(): void;
1057
1053
  declare interface InteractionConfig {
1058
1054
  focus: FocusInteractionConfig;
1059
1055
  navigation?: NavigationInteractionConfig;
1060
- gestures?: GestureInteractionConfig;
1056
+ dragging?: boolean;
1061
1057
  }
1062
1058
 
1063
1059
  export declare type LayoutAlgorithm = 'random' | 'radial' | 'grid' | 'spiral' | 'cluster' | 'wave' | 'honeycomb';
@@ -1153,7 +1149,6 @@ declare interface LayoutEngineConfig {
1153
1149
 
1154
1150
  declare interface LayoutSpacingConfig {
1155
1151
  padding: number;
1156
- minGap: number;
1157
1152
  }
1158
1153
 
1159
1154
  export declare type LoaderEntry = StaticLoaderEntry | GoogleDriveLoaderEntry;
package/dist/react.js CHANGED
@@ -117,10 +117,8 @@ const mt = Object.freeze({
117
117
  densityFactor: 1,
118
118
  // Default density
119
119
  spacing: Object.freeze({
120
- padding: 50,
120
+ padding: 50
121
121
  // padding from viewport edges
122
- minGap: 20
123
- // minimum spacing between images
124
122
  })
125
123
  }),
126
124
  // Pattern-based animation configuration
@@ -138,16 +136,8 @@ const mt = Object.freeze({
138
136
  queue: Object.freeze({
139
137
  enabled: !0,
140
138
  // When false, all images display simultaneously
141
- interval: 150,
139
+ interval: 150
142
140
  // ms between processing queue items (when enabled)
143
- maxConcurrent: void 0
144
- // STUB: Not implemented yet
145
- }),
146
- performance: Object.freeze({
147
- useGPU: void 0,
148
- // STUB: Not implemented yet
149
- reduceMotion: void 0
150
- // STUB: Not implemented yet
151
141
  }),
152
142
  entry: Object.freeze({
153
143
  start: Object.freeze({
@@ -183,19 +173,12 @@ const mt = Object.freeze({
183
173
  // Use default animation duration
184
174
  }),
185
175
  navigation: Object.freeze({
186
- keyboard: void 0,
187
- // STUB: Not implemented yet
188
- swipe: void 0,
189
- // STUB: Not implemented yet
176
+ keyboard: !0,
177
+ swipe: !0,
190
178
  mouseWheel: void 0
191
179
  // STUB: Not implemented yet
192
180
  }),
193
- gestures: Object.freeze({
194
- pinchToZoom: void 0,
195
- // STUB: Not implemented yet
196
- doubleTapToFocus: void 0
197
- // STUB: Not implemented yet
198
- })
181
+ dragging: !0
199
182
  }),
200
183
  // Pattern-based rendering configuration
201
184
  rendering: Object.freeze({
@@ -329,9 +312,6 @@ function ne(o = {}) {
329
312
  }), o.animation.queue && (s.animation.queue = {
330
313
  ...E.animation.queue,
331
314
  ...o.animation.queue
332
- }), o.animation.performance && (s.animation.performance = {
333
- ...E.animation.performance,
334
- ...o.animation.performance
335
315
  }), o.animation.entry && (s.animation.entry = {
336
316
  ...E.animation.entry,
337
317
  ...o.animation.entry,
@@ -356,9 +336,6 @@ function ne(o = {}) {
356
336
  }), o.interaction.navigation && (s.interaction.navigation = {
357
337
  ...E.interaction.navigation,
358
338
  ...o.interaction.navigation
359
- }), o.interaction.gestures && (s.interaction.gestures = {
360
- ...E.interaction.gestures,
361
- ...o.interaction.gestures
362
339
  })), o.rendering && (s.rendering = {
363
340
  ...E.rendering,
364
341
  ...o.rendering
@@ -3331,14 +3308,14 @@ let oi = class {
3331
3308
  this.containerEl = this.containerRef;
3332
3309
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
3333
3310
  throw new Error(`Container #${this.containerId} not found`);
3334
- this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new bt(this.containerEl, {
3311
+ this.containerEl.classList.add("fbn-ic-gallery"), this.containerEl.setAttribute("tabindex", "0"), this.fullConfig.interaction.navigation?.swipe !== !1 && (this.swipeEngine = new bt(this.containerEl, {
3335
3312
  onNext: () => this.navigateToNextImage(),
3336
3313
  onPrev: () => this.navigateToPreviousImage(),
3337
3314
  onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
3338
3315
  onDragEnd: (t) => {
3339
3316
  t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Je);
3340
3317
  }
3341
- }), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
3318
+ })), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
3342
3319
  } catch (t) {
3343
3320
  console.error("Gallery initialization failed:", t), this.errorEl && t instanceof Error && this.showError("Gallery failed to initialize: " + t.message);
3344
3321
  }
@@ -3367,7 +3344,7 @@ let oi = class {
3367
3344
  return t.className = "fbn-ic-counter fbn-ic-hidden", this.containerEl.appendChild(t), t;
3368
3345
  }
3369
3346
  setupEventListeners() {
3370
- document.addEventListener("keydown", (t) => {
3347
+ this.fullConfig.interaction.navigation?.keyboard !== !1 && this.containerEl.addEventListener("keydown", (t) => {
3371
3348
  t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
3372
3349
  }), document.addEventListener("click", (t) => {
3373
3350
  this.swipeEngine?.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter());
@@ -3541,7 +3518,7 @@ let oi = class {
3541
3518
  h.style.left = `${d - 6}px`, h.style.top = `${f - 6}px`, h.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(h);
3542
3519
  })), t.forEach((l, u) => {
3543
3520
  const h = document.createElement("img");
3544
- h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
3521
+ h.referrerPolicy = "no-referrer", h.classList.add("fbn-ic-image"), this.fullConfig.interaction.dragging === !1 && (h.draggable = !1), h.dataset.imageId = String(u), h.dataset.createdFlag = "true";
3545
3522
  const d = a[u];
3546
3523
  h.style.position = "absolute", h.style.width = "auto", h.style.height = `${i}px`, h.style.left = `${d.x}px`, h.style.top = `${d.y}px`, d.zIndex && (h.style.zIndex = String(d.zIndex)), st(h, this.defaultClassName), h.addEventListener("mouseenter", () => {
3547
3524
  if (this.hoveredImage = { element: h, layout: d }, !this.zoomEngine.isInvolved(h)) {