@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260625120328 → 0.8.1-dev.20260625120809
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 +85 -32
- package/dist/index.mjs +85 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5373,11 +5373,9 @@ var deviceToMediaQuery = (device) => {
|
|
|
5373
5373
|
case "sm":
|
|
5374
5374
|
return "(max-width: 480px)";
|
|
5375
5375
|
case "md":
|
|
5376
|
-
return "(max-width: 768px)";
|
|
5376
|
+
return "(min-width: 481px) and (max-width: 768px)";
|
|
5377
5377
|
case "lg":
|
|
5378
5378
|
return "(min-width: 769px)";
|
|
5379
|
-
// case "tv":
|
|
5380
|
-
// return "(min-width: 1920px)";
|
|
5381
5379
|
default:
|
|
5382
5380
|
return null;
|
|
5383
5381
|
}
|
|
@@ -5491,7 +5489,7 @@ var ImageGalleryNode = (props) => {
|
|
|
5491
5489
|
if (primaryHls?.width) hlsStyles.width = primaryHls.width;
|
|
5492
5490
|
if (primaryHls?.borderRadius) hlsStyles.borderRadius = primaryHls.borderRadius;
|
|
5493
5491
|
const staticSources = staticImages.filter((img) => !!img.device);
|
|
5494
|
-
const staticFallback = staticImages.find((img) => !img.device) ??
|
|
5492
|
+
const staticFallback = staticImages.find((img) => !img.device) ?? null;
|
|
5495
5493
|
const FormatClass = {
|
|
5496
5494
|
center: "justify-center",
|
|
5497
5495
|
left: "justify-start",
|
|
@@ -5514,17 +5512,22 @@ var ImageGalleryNode = (props) => {
|
|
|
5514
5512
|
styles: hlsStyles
|
|
5515
5513
|
}
|
|
5516
5514
|
) }),
|
|
5517
|
-
staticFallback && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("picture", { children: [
|
|
5515
|
+
(staticFallback || staticSources.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: staticFallback ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("picture", { children: [
|
|
5518
5516
|
DEVICE_ORDER.map((deviceKey) => {
|
|
5519
|
-
const match = staticSources.find(
|
|
5520
|
-
|
|
5517
|
+
const match = staticSources.find(
|
|
5518
|
+
(img) => img.device === deviceKey
|
|
5519
|
+
);
|
|
5520
|
+
if (!match) {
|
|
5521
|
+
return null;
|
|
5522
|
+
}
|
|
5521
5523
|
const srcUrl = resolveImageUrl(match);
|
|
5522
|
-
if (!srcUrl)
|
|
5523
|
-
|
|
5524
|
+
if (!srcUrl) {
|
|
5525
|
+
return null;
|
|
5526
|
+
}
|
|
5524
5527
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5525
5528
|
"source",
|
|
5526
5529
|
{
|
|
5527
|
-
media:
|
|
5530
|
+
media: deviceToMediaQuery(match.device),
|
|
5528
5531
|
srcSet: srcUrl,
|
|
5529
5532
|
width: parseMaybeNumber(match.intrinsicWidth),
|
|
5530
5533
|
height: parseMaybeNumber(match.intrinsicHeight)
|
|
@@ -5535,31 +5538,81 @@ var ImageGalleryNode = (props) => {
|
|
|
5535
5538
|
(() => {
|
|
5536
5539
|
const img = staticFallback;
|
|
5537
5540
|
const imageUrl = resolveImageUrl(img);
|
|
5538
|
-
if (!imageUrl)
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
const alt = img.title || "Gallery image";
|
|
5541
|
+
if (!imageUrl) {
|
|
5542
|
+
return null;
|
|
5543
|
+
}
|
|
5542
5544
|
const styles = {};
|
|
5543
|
-
if (img.height)
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5545
|
+
if (img.height) {
|
|
5546
|
+
styles.height = img.height;
|
|
5547
|
+
}
|
|
5548
|
+
if (img.width) {
|
|
5549
|
+
styles.width = img.width;
|
|
5550
|
+
}
|
|
5551
|
+
if (img.borderRadius) {
|
|
5552
|
+
styles.borderRadius = img.borderRadius;
|
|
5553
|
+
}
|
|
5554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5555
|
+
"img",
|
|
5556
|
+
{
|
|
5557
|
+
loading: "lazy",
|
|
5558
|
+
style: styles,
|
|
5559
|
+
className: "object-cover max-w-full",
|
|
5560
|
+
src: imageUrl,
|
|
5561
|
+
width: parseMaybeNumber(img.intrinsicWidth),
|
|
5562
|
+
height: parseMaybeNumber(img.intrinsicHeight),
|
|
5563
|
+
alt: img.title ?? "Gallery image"
|
|
5564
|
+
}
|
|
5560
5565
|
);
|
|
5561
5566
|
})()
|
|
5562
|
-
] })
|
|
5567
|
+
] }) : (
|
|
5568
|
+
/* Case 2: Only device-specific images exist */
|
|
5569
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_jsx_runtime69.Fragment, { children: staticSources.map((img, index) => {
|
|
5570
|
+
const imageUrl = resolveImageUrl(img);
|
|
5571
|
+
if (!imageUrl) {
|
|
5572
|
+
return null;
|
|
5573
|
+
}
|
|
5574
|
+
const styles = {};
|
|
5575
|
+
if (img.height) {
|
|
5576
|
+
styles.height = img.height;
|
|
5577
|
+
}
|
|
5578
|
+
if (img.width) {
|
|
5579
|
+
styles.width = img.width;
|
|
5580
|
+
}
|
|
5581
|
+
if (img.borderRadius) {
|
|
5582
|
+
styles.borderRadius = img.borderRadius;
|
|
5583
|
+
}
|
|
5584
|
+
let display = "none";
|
|
5585
|
+
switch (img.device) {
|
|
5586
|
+
case "sm":
|
|
5587
|
+
display = props.device === "sm" ? "block" : "none";
|
|
5588
|
+
break;
|
|
5589
|
+
case "md":
|
|
5590
|
+
display = props.device === "md" ? "block" : "none";
|
|
5591
|
+
break;
|
|
5592
|
+
case "lg":
|
|
5593
|
+
display = props.device === "lg" ? "block" : "none";
|
|
5594
|
+
break;
|
|
5595
|
+
default:
|
|
5596
|
+
display = "block";
|
|
5597
|
+
}
|
|
5598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
5599
|
+
"img",
|
|
5600
|
+
{
|
|
5601
|
+
loading: "lazy",
|
|
5602
|
+
src: imageUrl,
|
|
5603
|
+
style: {
|
|
5604
|
+
...styles,
|
|
5605
|
+
display
|
|
5606
|
+
},
|
|
5607
|
+
className: "object-cover max-w-full",
|
|
5608
|
+
width: parseMaybeNumber(img.intrinsicWidth),
|
|
5609
|
+
height: parseMaybeNumber(img.intrinsicHeight),
|
|
5610
|
+
alt: img.title ?? "Gallery image"
|
|
5611
|
+
},
|
|
5612
|
+
index
|
|
5613
|
+
);
|
|
5614
|
+
}) })
|
|
5615
|
+
) })
|
|
5563
5616
|
] });
|
|
5564
5617
|
};
|
|
5565
5618
|
var ImageGalleryNode_default = ImageGalleryNode;
|
package/dist/index.mjs
CHANGED
|
@@ -3767,11 +3767,9 @@ var deviceToMediaQuery = (device) => {
|
|
|
3767
3767
|
case "sm":
|
|
3768
3768
|
return "(max-width: 480px)";
|
|
3769
3769
|
case "md":
|
|
3770
|
-
return "(max-width: 768px)";
|
|
3770
|
+
return "(min-width: 481px) and (max-width: 768px)";
|
|
3771
3771
|
case "lg":
|
|
3772
3772
|
return "(min-width: 769px)";
|
|
3773
|
-
// case "tv":
|
|
3774
|
-
// return "(min-width: 1920px)";
|
|
3775
3773
|
default:
|
|
3776
3774
|
return null;
|
|
3777
3775
|
}
|
|
@@ -3885,7 +3883,7 @@ var ImageGalleryNode = (props) => {
|
|
|
3885
3883
|
if (primaryHls?.width) hlsStyles.width = primaryHls.width;
|
|
3886
3884
|
if (primaryHls?.borderRadius) hlsStyles.borderRadius = primaryHls.borderRadius;
|
|
3887
3885
|
const staticSources = staticImages.filter((img) => !!img.device);
|
|
3888
|
-
const staticFallback = staticImages.find((img) => !img.device) ??
|
|
3886
|
+
const staticFallback = staticImages.find((img) => !img.device) ?? null;
|
|
3889
3887
|
const FormatClass = {
|
|
3890
3888
|
center: "justify-center",
|
|
3891
3889
|
left: "justify-start",
|
|
@@ -3908,17 +3906,22 @@ var ImageGalleryNode = (props) => {
|
|
|
3908
3906
|
styles: hlsStyles
|
|
3909
3907
|
}
|
|
3910
3908
|
) }),
|
|
3911
|
-
staticFallback && /* @__PURE__ */ jsx58(Fragment8, { children: /* @__PURE__ */ jsxs31("picture", { children: [
|
|
3909
|
+
(staticFallback || staticSources.length > 0) && /* @__PURE__ */ jsx58(Fragment8, { children: staticFallback ? /* @__PURE__ */ jsxs31("picture", { children: [
|
|
3912
3910
|
DEVICE_ORDER.map((deviceKey) => {
|
|
3913
|
-
const match = staticSources.find(
|
|
3914
|
-
|
|
3911
|
+
const match = staticSources.find(
|
|
3912
|
+
(img) => img.device === deviceKey
|
|
3913
|
+
);
|
|
3914
|
+
if (!match) {
|
|
3915
|
+
return null;
|
|
3916
|
+
}
|
|
3915
3917
|
const srcUrl = resolveImageUrl(match);
|
|
3916
|
-
if (!srcUrl)
|
|
3917
|
-
|
|
3918
|
+
if (!srcUrl) {
|
|
3919
|
+
return null;
|
|
3920
|
+
}
|
|
3918
3921
|
return /* @__PURE__ */ jsx58(
|
|
3919
3922
|
"source",
|
|
3920
3923
|
{
|
|
3921
|
-
media:
|
|
3924
|
+
media: deviceToMediaQuery(match.device),
|
|
3922
3925
|
srcSet: srcUrl,
|
|
3923
3926
|
width: parseMaybeNumber(match.intrinsicWidth),
|
|
3924
3927
|
height: parseMaybeNumber(match.intrinsicHeight)
|
|
@@ -3929,31 +3932,81 @@ var ImageGalleryNode = (props) => {
|
|
|
3929
3932
|
(() => {
|
|
3930
3933
|
const img = staticFallback;
|
|
3931
3934
|
const imageUrl = resolveImageUrl(img);
|
|
3932
|
-
if (!imageUrl)
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
const alt = img.title || "Gallery image";
|
|
3935
|
+
if (!imageUrl) {
|
|
3936
|
+
return null;
|
|
3937
|
+
}
|
|
3936
3938
|
const styles = {};
|
|
3937
|
-
if (img.height)
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3939
|
+
if (img.height) {
|
|
3940
|
+
styles.height = img.height;
|
|
3941
|
+
}
|
|
3942
|
+
if (img.width) {
|
|
3943
|
+
styles.width = img.width;
|
|
3944
|
+
}
|
|
3945
|
+
if (img.borderRadius) {
|
|
3946
|
+
styles.borderRadius = img.borderRadius;
|
|
3947
|
+
}
|
|
3948
|
+
return /* @__PURE__ */ jsx58(
|
|
3949
|
+
"img",
|
|
3950
|
+
{
|
|
3951
|
+
loading: "lazy",
|
|
3952
|
+
style: styles,
|
|
3953
|
+
className: "object-cover max-w-full",
|
|
3954
|
+
src: imageUrl,
|
|
3955
|
+
width: parseMaybeNumber(img.intrinsicWidth),
|
|
3956
|
+
height: parseMaybeNumber(img.intrinsicHeight),
|
|
3957
|
+
alt: img.title ?? "Gallery image"
|
|
3958
|
+
}
|
|
3954
3959
|
);
|
|
3955
3960
|
})()
|
|
3956
|
-
] })
|
|
3961
|
+
] }) : (
|
|
3962
|
+
/* Case 2: Only device-specific images exist */
|
|
3963
|
+
/* @__PURE__ */ jsx58(Fragment8, { children: staticSources.map((img, index) => {
|
|
3964
|
+
const imageUrl = resolveImageUrl(img);
|
|
3965
|
+
if (!imageUrl) {
|
|
3966
|
+
return null;
|
|
3967
|
+
}
|
|
3968
|
+
const styles = {};
|
|
3969
|
+
if (img.height) {
|
|
3970
|
+
styles.height = img.height;
|
|
3971
|
+
}
|
|
3972
|
+
if (img.width) {
|
|
3973
|
+
styles.width = img.width;
|
|
3974
|
+
}
|
|
3975
|
+
if (img.borderRadius) {
|
|
3976
|
+
styles.borderRadius = img.borderRadius;
|
|
3977
|
+
}
|
|
3978
|
+
let display = "none";
|
|
3979
|
+
switch (img.device) {
|
|
3980
|
+
case "sm":
|
|
3981
|
+
display = props.device === "sm" ? "block" : "none";
|
|
3982
|
+
break;
|
|
3983
|
+
case "md":
|
|
3984
|
+
display = props.device === "md" ? "block" : "none";
|
|
3985
|
+
break;
|
|
3986
|
+
case "lg":
|
|
3987
|
+
display = props.device === "lg" ? "block" : "none";
|
|
3988
|
+
break;
|
|
3989
|
+
default:
|
|
3990
|
+
display = "block";
|
|
3991
|
+
}
|
|
3992
|
+
return /* @__PURE__ */ jsx58(
|
|
3993
|
+
"img",
|
|
3994
|
+
{
|
|
3995
|
+
loading: "lazy",
|
|
3996
|
+
src: imageUrl,
|
|
3997
|
+
style: {
|
|
3998
|
+
...styles,
|
|
3999
|
+
display
|
|
4000
|
+
},
|
|
4001
|
+
className: "object-cover max-w-full",
|
|
4002
|
+
width: parseMaybeNumber(img.intrinsicWidth),
|
|
4003
|
+
height: parseMaybeNumber(img.intrinsicHeight),
|
|
4004
|
+
alt: img.title ?? "Gallery image"
|
|
4005
|
+
},
|
|
4006
|
+
index
|
|
4007
|
+
);
|
|
4008
|
+
}) })
|
|
4009
|
+
) })
|
|
3957
4010
|
] });
|
|
3958
4011
|
};
|
|
3959
4012
|
var ImageGalleryNode_default = ImageGalleryNode;
|
package/package.json
CHANGED