@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.
- package/README.md +43 -38
- package/dist/image-cloud-auto-init.js +47 -46
- package/dist/image-cloud-auto-init.js.map +1 -1
- package/dist/image-cloud.js +79 -74
- 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 +2 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +101 -101
- package/dist/react.js.map +1 -1
- package/dist/vue.d.ts +2 -0
- package/dist/vue.js +53 -53
- package/dist/vue.js.map +1 -1
- package/dist/web-component.d.ts +2 -0
- package/dist/web-component.js +3 -3
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
package/dist/web-component.d.ts
CHANGED
|
@@ -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;
|
package/dist/web-component.js
CHANGED
|
@@ -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(
|
|
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() {
|