@frybynite/image-cloud 0.9.6 → 0.10.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.
@@ -883,6 +883,8 @@ declare class ImageCloud {
883
883
  export { ImageCloud }
884
884
  export { ImageCloud as ImageGallery }
885
885
 
886
+ export declare function imageCloud(options: ImageCloudOptions): Promise<ImageCloud>;
887
+
886
888
  export declare interface ImageCloudConfig {
887
889
  loaders: LoaderEntry[];
888
890
  config: ConfigSection;
@@ -3292,7 +3292,7 @@ class ei {
3292
3292
  createLoader() {
3293
3293
  const t = this.fullConfig.loaders, i = this.fullConfig.config.loaders ?? {};
3294
3294
  if (!t || t.length === 0)
3295
- throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
3295
+ throw new Error("No loaders configured. Provide `images`, `loaders`, or both.\n Example: imageCloud({ container: 'id', images: ['https://...'] })");
3296
3296
  const e = t.map((n) => this.createLoaderFromEntry(n, i));
3297
3297
  return e.length === 1 ? e[0] : new Ke({
3298
3298
  loaders: e,
@@ -3331,7 +3331,7 @@ class ei {
3331
3331
  if (ti(), this.containerRef)
3332
3332
  this.containerEl = this.containerRef;
3333
3333
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
3334
- throw new Error(`Container #${this.containerId} not found`);
3334
+ throw new Error(`Container "#${this.containerId}" not found. Ensure an element with id="${this.containerId}" exists in the DOM before calling imageCloud().`);
3335
3335
  this.containerEl.classList.add("fbn-ic-gallery"), this.containerEl.setAttribute("tabindex", "0"), this.fullConfig.interaction.navigation?.swipe !== !1 && (this.swipeEngine = new bt(this.containerEl, {
3336
3336
  onNext: () => this.navigateToNextImage(),
3337
3337
  onPrev: () => this.navigateToPreviousImage(),
@@ -3341,7 +3341,7 @@ class ei {
3341
3341
  }
3342
3342
  })), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
3343
3343
  } catch (t) {
3344
- console.error("Gallery initialization failed:", t), this.errorEl && t instanceof Error && this.showError("Gallery failed to initialize: " + t.message);
3344
+ console.error(`ImageCloud initialization failed (container: "${this.containerId ?? "element"}"):`, t), this.errorEl && t instanceof Error && this.showError("Gallery failed to initialize: " + t.message);
3345
3345
  }
3346
3346
  }
3347
3347
  setupUI() {