tee3apps-cms-sdk-react 0.0.18 → 0.0.20
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/App.css +5 -7
- package/src/PageComponents/RowComponent.tsx +55 -2
- package/src/PageComponents/Visual-Components/CarouselComponent.tsx +363 -365
- package/src/PageComponents/Visual-Components/TabComponent.tsx +53 -47
- package/src/PageComponents/Visual-Components/tab.css +3 -8
- package/src/index.css +9 -9
|
@@ -129,6 +129,24 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
129
129
|
const [activeTab, setActiveTab] = useState(0);
|
|
130
130
|
const [carouselIndex, setCarouselIndex] = useState(0);
|
|
131
131
|
|
|
132
|
+
// Check if tab content contains image/video components for dynamic height
|
|
133
|
+
const hasMediaComponents = (): boolean => {
|
|
134
|
+
if (!props.tabs || props.tabs.length === 0) return false;
|
|
135
|
+
|
|
136
|
+
const activeTabData = props.tabs[activeTab];
|
|
137
|
+
if (!activeTabData) return false;
|
|
138
|
+
|
|
139
|
+
// Check tab content type
|
|
140
|
+
const contentType = activeTabData.tabContentType;
|
|
141
|
+
const mediaContentTypes = ['IMAGE', 'VIDEO', 'GROUPIMAGE', 'GROUPVIDEO'];
|
|
142
|
+
|
|
143
|
+
if (contentType && mediaContentTypes.includes(contentType)) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return false;
|
|
148
|
+
};
|
|
149
|
+
|
|
132
150
|
const buildLinkForSlide = (slide: any) => {
|
|
133
151
|
switch (slide.link_type) {
|
|
134
152
|
case 'NONE':
|
|
@@ -474,7 +492,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
474
492
|
gridTemplateColumns: getGridColumns(),
|
|
475
493
|
gridTemplateRows: getGridRows(),
|
|
476
494
|
gap: '3px',
|
|
477
|
-
|
|
495
|
+
width: '100%',
|
|
478
496
|
overflow: 'hidden'
|
|
479
497
|
};
|
|
480
498
|
|
|
@@ -497,15 +515,14 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
497
515
|
|
|
498
516
|
const imageElement = (
|
|
499
517
|
<div style={contentStyle}>
|
|
500
|
-
<div className="media-box" style={{ width: '100%',
|
|
518
|
+
<div className="media-box" style={{ width: '100%', overflow: 'hidden' }}>
|
|
501
519
|
<img
|
|
502
520
|
src={fullImageUrl}
|
|
503
521
|
alt={imageAlt}
|
|
504
522
|
className="media-content"
|
|
505
523
|
style={{
|
|
506
524
|
width: '100%',
|
|
507
|
-
height: '
|
|
508
|
-
objectFit: 'cover',
|
|
525
|
+
height: 'auto',
|
|
509
526
|
display: 'block'
|
|
510
527
|
}}
|
|
511
528
|
onError={(e) => {
|
|
@@ -537,12 +554,12 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
537
554
|
if (tab.tabContentVideo) {
|
|
538
555
|
return (
|
|
539
556
|
<div style={contentStyle}>
|
|
540
|
-
<div className="media-box">
|
|
557
|
+
<div className="media-box" style={{ width: '100%', overflow: 'hidden' }}>
|
|
541
558
|
<video
|
|
542
559
|
src={getImageUrl(tab.tabContentVideo.video.url)}
|
|
543
560
|
controls
|
|
544
561
|
className="media-content"
|
|
545
|
-
|
|
562
|
+
style={{ width: '100%', height: 'auto', display: 'block' }}
|
|
546
563
|
/>
|
|
547
564
|
</div>
|
|
548
565
|
</div>
|
|
@@ -567,7 +584,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
567
584
|
const linkUrl = currentImage ? buildLinkForSlide(currentImage) : null;
|
|
568
585
|
|
|
569
586
|
const imageElement = currentImage ? (
|
|
570
|
-
<div className="media-box">
|
|
587
|
+
<div className="media-box" style={{ width: '100%', overflow: 'hidden' }}>
|
|
571
588
|
<img
|
|
572
589
|
src={getImageUrl(
|
|
573
590
|
tab.tabContentGroupImage.type === 'DYNAMIC'
|
|
@@ -580,6 +597,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
580
597
|
: currentImage.attr?.alt
|
|
581
598
|
}
|
|
582
599
|
className="media-content"
|
|
600
|
+
style={{ width: '100%', height: 'auto', display: 'block' }}
|
|
583
601
|
/>
|
|
584
602
|
</div>
|
|
585
603
|
) : null;
|
|
@@ -589,11 +607,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
589
607
|
style={{
|
|
590
608
|
position: 'relative',
|
|
591
609
|
width: '100%',
|
|
592
|
-
height: 'auto',
|
|
593
610
|
overflow: 'hidden',
|
|
594
|
-
display: 'flex',
|
|
595
|
-
alignItems: 'center',
|
|
596
|
-
justifyContent: 'center',
|
|
597
611
|
}}
|
|
598
612
|
>
|
|
599
613
|
{linkUrl ? (
|
|
@@ -604,7 +618,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
604
618
|
? currentImage.external_link?.target || '_blank'
|
|
605
619
|
: '_self'
|
|
606
620
|
}
|
|
607
|
-
style={{ width: '100%',
|
|
621
|
+
style={{ width: '100%', display: 'block' }}
|
|
608
622
|
>
|
|
609
623
|
{imageElement}
|
|
610
624
|
</a>
|
|
@@ -738,7 +752,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
738
752
|
gridTemplateColumns: getGridColumns(),
|
|
739
753
|
gridTemplateRows: getGridRows(),
|
|
740
754
|
gap: '3px',
|
|
741
|
-
|
|
755
|
+
width: '100%',
|
|
742
756
|
overflow: 'hidden'
|
|
743
757
|
};
|
|
744
758
|
|
|
@@ -747,11 +761,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
747
761
|
style={{
|
|
748
762
|
position: 'relative',
|
|
749
763
|
width: '100%',
|
|
750
|
-
height: 'auto',
|
|
751
764
|
overflow: 'hidden',
|
|
752
|
-
display: 'flex',
|
|
753
|
-
alignItems: 'center',
|
|
754
|
-
justifyContent: 'center',
|
|
755
765
|
}}
|
|
756
766
|
>
|
|
757
767
|
<div style={groupImageContentStyle} className='media-box'>
|
|
@@ -759,7 +769,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
759
769
|
const originalIndex = displayIndices[displayIndex];
|
|
760
770
|
const linkUrl = buildLinkForSlide(image);
|
|
761
771
|
const imageElement = (
|
|
762
|
-
<div key={originalIndex} className="media-box">
|
|
772
|
+
<div key={originalIndex} className="media-box" style={{ width: '100%', overflow: 'hidden' }}>
|
|
763
773
|
<img
|
|
764
774
|
src={getImageUrl(
|
|
765
775
|
tab.tabContentGroupImage.type === 'DYNAMIC'
|
|
@@ -772,6 +782,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
772
782
|
: image.attr?.alt
|
|
773
783
|
}
|
|
774
784
|
className="media-content"
|
|
785
|
+
style={{ width: '100%', height: 'auto', display: 'block' }}
|
|
775
786
|
/>
|
|
776
787
|
</div>
|
|
777
788
|
);
|
|
@@ -786,11 +797,12 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
786
797
|
: '_self'
|
|
787
798
|
}
|
|
788
799
|
className='media-box'
|
|
800
|
+
style={{ width: '100%', display: 'block' }}
|
|
789
801
|
>
|
|
790
802
|
{imageElement}
|
|
791
803
|
</a>
|
|
792
804
|
) : (
|
|
793
|
-
<div key={originalIndex} style={{ width: '100%'
|
|
805
|
+
<div key={originalIndex} style={{ width: '100%' }}>
|
|
794
806
|
{imageElement}
|
|
795
807
|
</div>
|
|
796
808
|
);
|
|
@@ -907,7 +919,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
907
919
|
const linkUrl = currentVideo ? buildLinkForSlide(currentVideo) : null;
|
|
908
920
|
|
|
909
921
|
const videoElement = currentVideo ? (
|
|
910
|
-
<div className="media-box">
|
|
922
|
+
<div className="media-box" style={{ width: '100%', overflow: 'hidden' }}>
|
|
911
923
|
<video
|
|
912
924
|
src={getImageUrl(
|
|
913
925
|
tab.tabContentGroupVideo.type === 'DYNAMIC'
|
|
@@ -920,7 +932,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
920
932
|
: currentVideo.attr?.alt }
|
|
921
933
|
className="media-content"
|
|
922
934
|
controls
|
|
923
|
-
style={{ width: '100%', height: 'auto',
|
|
935
|
+
style={{ width: '100%', height: 'auto', display: 'block' }}
|
|
924
936
|
/>
|
|
925
937
|
</div>
|
|
926
938
|
) : null;
|
|
@@ -930,15 +942,11 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
930
942
|
style={{
|
|
931
943
|
position: 'relative',
|
|
932
944
|
width: '100%',
|
|
933
|
-
height: 'auto',
|
|
934
945
|
overflow: 'hidden',
|
|
935
|
-
display: 'flex',
|
|
936
|
-
alignItems: 'stretch',
|
|
937
|
-
justifyContent: 'center',
|
|
938
946
|
}}
|
|
939
947
|
>
|
|
940
948
|
{currentVideo && (
|
|
941
|
-
<div style={{ width: '100%'
|
|
949
|
+
<div style={{ width: '100%' }}>
|
|
942
950
|
{linkUrl ? (
|
|
943
951
|
<a
|
|
944
952
|
href={linkUrl}
|
|
@@ -947,7 +955,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
947
955
|
? currentVideo.external_link?.target || '_blank'
|
|
948
956
|
: '_self'
|
|
949
957
|
}
|
|
950
|
-
style={{ textDecoration: 'none', color: 'inherit', display: '
|
|
958
|
+
style={{ textDecoration: 'none', color: 'inherit', display: 'block', width: '100%' }}
|
|
951
959
|
>
|
|
952
960
|
{videoElement}
|
|
953
961
|
</a>
|
|
@@ -1083,7 +1091,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1083
1091
|
gridTemplateColumns: getGridColumns(),
|
|
1084
1092
|
gridTemplateRows: getGridRows(),
|
|
1085
1093
|
gap: '3px',
|
|
1086
|
-
|
|
1094
|
+
width: '100%',
|
|
1087
1095
|
overflow: 'hidden'
|
|
1088
1096
|
};
|
|
1089
1097
|
|
|
@@ -1092,11 +1100,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1092
1100
|
style={{
|
|
1093
1101
|
position: 'relative',
|
|
1094
1102
|
width: '100%',
|
|
1095
|
-
height: 'auto',
|
|
1096
1103
|
overflow: 'hidden',
|
|
1097
|
-
display: 'flex',
|
|
1098
|
-
alignItems: 'center',
|
|
1099
|
-
justifyContent: 'center',
|
|
1100
1104
|
}}
|
|
1101
1105
|
>
|
|
1102
1106
|
<div style={groupVideoContentStyle} className='media-box'>
|
|
@@ -1105,7 +1109,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1105
1109
|
const linkUrl = buildLinkForSlide(video);
|
|
1106
1110
|
|
|
1107
1111
|
const videoElement = (
|
|
1108
|
-
<div key={originalIndex} className="media-box">
|
|
1112
|
+
<div key={originalIndex} className="media-box" style={{ width: '100%', overflow: 'hidden' }}>
|
|
1109
1113
|
<video
|
|
1110
1114
|
src={getImageUrl(
|
|
1111
1115
|
tab.tabContentGroupVideo.type === 'DYNAMIC'
|
|
@@ -1119,7 +1123,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1119
1123
|
}
|
|
1120
1124
|
className="media-content"
|
|
1121
1125
|
controls
|
|
1122
|
-
style={{ width: '100%', height: 'auto',
|
|
1126
|
+
style={{ width: '100%', height: 'auto', display: 'block' }}
|
|
1123
1127
|
/>
|
|
1124
1128
|
</div>
|
|
1125
1129
|
);
|
|
@@ -1134,11 +1138,12 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1134
1138
|
: '_self'
|
|
1135
1139
|
}
|
|
1136
1140
|
className='media-box'
|
|
1141
|
+
style={{ width: '100%', display: 'block' }}
|
|
1137
1142
|
>
|
|
1138
1143
|
{videoElement}
|
|
1139
1144
|
</a>
|
|
1140
1145
|
) : (
|
|
1141
|
-
<div key={originalIndex} style={{ width: '100%'
|
|
1146
|
+
<div key={originalIndex} style={{ width: '100%' }}>
|
|
1142
1147
|
{videoElement}
|
|
1143
1148
|
</div>
|
|
1144
1149
|
);
|
|
@@ -1258,15 +1263,12 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1258
1263
|
style={{
|
|
1259
1264
|
position: 'relative',
|
|
1260
1265
|
width: '100%',
|
|
1261
|
-
height: `${props.height}px`,
|
|
1266
|
+
height: `${props.height}px`,
|
|
1262
1267
|
overflow: 'hidden',
|
|
1263
|
-
display: 'flex',
|
|
1264
|
-
alignItems: 'stretch',
|
|
1265
|
-
justifyContent: 'center',
|
|
1266
1268
|
}}
|
|
1267
1269
|
>
|
|
1268
1270
|
{currentProduct && (
|
|
1269
|
-
<div style={{ width: '100%', height: '100%'
|
|
1271
|
+
<div style={{ width: '100%', height: '100%' }}>
|
|
1270
1272
|
<ProductCard product={currentProduct} layout={layout} />
|
|
1271
1273
|
</div>
|
|
1272
1274
|
)}
|
|
@@ -1424,7 +1426,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1424
1426
|
gridTemplateColumns: getGridColumns(),
|
|
1425
1427
|
gridTemplateRows: getGridRows(),
|
|
1426
1428
|
gap: '12px',
|
|
1427
|
-
height:
|
|
1429
|
+
height: `${props.height}px`, // Use TabComponent height for group products
|
|
1428
1430
|
overflow: 'hidden',
|
|
1429
1431
|
padding: '12px',
|
|
1430
1432
|
alignItems: 'stretch',
|
|
@@ -1435,11 +1437,8 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1435
1437
|
style={{
|
|
1436
1438
|
position: 'relative',
|
|
1437
1439
|
width: '100%',
|
|
1438
|
-
height:
|
|
1440
|
+
height: `${props.height}px`,
|
|
1439
1441
|
overflow: 'hidden',
|
|
1440
|
-
display: 'flex',
|
|
1441
|
-
alignItems: 'center',
|
|
1442
|
-
justifyContent: 'center',
|
|
1443
1442
|
}}
|
|
1444
1443
|
>
|
|
1445
1444
|
<div style={groupProductContentStyle}>
|
|
@@ -1450,7 +1449,6 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1450
1449
|
key={originalIndex}
|
|
1451
1450
|
style={{
|
|
1452
1451
|
width: '100%',
|
|
1453
|
-
height: '100%',
|
|
1454
1452
|
display: 'flex',
|
|
1455
1453
|
alignItems: 'stretch',
|
|
1456
1454
|
justifyContent: 'center',
|
|
@@ -1593,11 +1591,19 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
|
|
|
1593
1591
|
};
|
|
1594
1592
|
|
|
1595
1593
|
const tabs = props.tabs || [];
|
|
1594
|
+
|
|
1595
|
+
// Get dynamic minHeight based on media components
|
|
1596
|
+
const getTabMinHeight = (): string | undefined => {
|
|
1597
|
+
if (hasMediaComponents()) {
|
|
1598
|
+
return undefined; // Remove minHeight constraint for media components
|
|
1599
|
+
}
|
|
1600
|
+
return `${props.height}px`;
|
|
1601
|
+
};
|
|
1596
1602
|
|
|
1597
1603
|
return (
|
|
1598
1604
|
<div style={{
|
|
1599
1605
|
width: '100%',
|
|
1600
|
-
minHeight:
|
|
1606
|
+
minHeight: getTabMinHeight(),
|
|
1601
1607
|
backgroundColor: '#ffffff',
|
|
1602
1608
|
overflow: 'hidden',
|
|
1603
1609
|
boxShadow: '0 4px 20px rgba(0,0,0,0.08)',
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
.media-box {
|
|
2
2
|
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
align-items: center;
|
|
7
|
-
background-color: #f4f4f4;
|
|
8
3
|
overflow: hidden;
|
|
4
|
+
display: block;
|
|
9
5
|
}
|
|
10
6
|
|
|
11
7
|
.media-content {
|
|
12
|
-
height: 100%;
|
|
13
8
|
width: 100%;
|
|
14
|
-
|
|
9
|
+
height: auto;
|
|
10
|
+
display: block;
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
/* Video specific styles */
|
|
18
14
|
video.media-content {
|
|
19
|
-
object-fit: cover;
|
|
20
15
|
background-color: #000;
|
|
21
16
|
}
|
|
22
17
|
|
package/src/index.css
CHANGED
|
@@ -53,22 +53,22 @@ body {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/* -------------- IMAGE STYLES --------------- */
|
|
56
|
-
|
|
57
56
|
.image-box {
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
width: 100%;
|
|
59
|
+
/* height: 280px; */
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
65
64
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
.fitted-image {
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
71
70
|
}
|
|
71
|
+
|
|
72
72
|
.mainpagearea{
|
|
73
73
|
background-color: rgb(205, 205, 205);
|
|
74
74
|
width: 100%;
|