@qwanyx/carousel 0.1.5 → 0.1.6

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.js CHANGED
@@ -749,11 +749,21 @@ function Thumbnails({
749
749
  // src/components/Carousel.tsx
750
750
  var import_jsx_runtime3 = require("react/jsx-runtime");
751
751
  function extractSlideUrl(slide) {
752
- const layer = slide.layers?.[0];
753
- if (!layer) return void 0;
754
- const imageObj = layer.objects?.find((obj) => obj.type === "image");
755
- if (imageObj && "src" in imageObj) {
756
- return imageObj.src;
752
+ for (const layer of slide.layers || []) {
753
+ for (const obj of layer.objects || []) {
754
+ if ("src" in obj && typeof obj.src === "string") {
755
+ return obj.src;
756
+ }
757
+ if ("url" in obj && typeof obj.url === "string") {
758
+ return obj.url;
759
+ }
760
+ }
761
+ }
762
+ if (slide.url) {
763
+ return slide.url;
764
+ }
765
+ if (slide.src) {
766
+ return slide.src;
757
767
  }
758
768
  return void 0;
759
769
  }
package/dist/index.mjs CHANGED
@@ -714,11 +714,21 @@ function Thumbnails({
714
714
  // src/components/Carousel.tsx
715
715
  import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
716
716
  function extractSlideUrl(slide) {
717
- const layer = slide.layers?.[0];
718
- if (!layer) return void 0;
719
- const imageObj = layer.objects?.find((obj) => obj.type === "image");
720
- if (imageObj && "src" in imageObj) {
721
- return imageObj.src;
717
+ for (const layer of slide.layers || []) {
718
+ for (const obj of layer.objects || []) {
719
+ if ("src" in obj && typeof obj.src === "string") {
720
+ return obj.src;
721
+ }
722
+ if ("url" in obj && typeof obj.url === "string") {
723
+ return obj.url;
724
+ }
725
+ }
726
+ }
727
+ if (slide.url) {
728
+ return slide.url;
729
+ }
730
+ if (slide.src) {
731
+ return slide.src;
722
732
  }
723
733
  return void 0;
724
734
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwanyx/carousel",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"