tee3apps-cms-sdk-react 0.0.25 → 0.0.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tee3apps-cms-sdk-react",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "Uses JSON to dynamically generate and render UI pages in a website",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -460,7 +460,7 @@ const CarouselComponent: React.FC<CarouselComponentMainProps> = ({
460
460
  alignItems: 'center',
461
461
  flexDirection: props.vertical ? 'column' : 'row',
462
462
  gap: '8px',
463
- zIndex: 100
463
+ zIndex: 10
464
464
  }}
465
465
  >
466
466
  {Array.from({ length: getTotalGroups() }).map((_, groupIndex) => {
@@ -475,14 +475,14 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
475
475
 
476
476
  // Inline Product Card Component
477
477
  const ProductCard: React.FC<{ product: any; layout?: string }> = ({ product, layout = '1x1' }) => {
478
- // Helper function to get product name (handles both string and object formats)
479
- const getProductName = (name: any): string => {
480
- if (!name) return '';
481
- if (typeof name === 'string') return name;
482
- if (typeof name === 'object') {
483
- return name.displayName || name.all || name.en || '';
478
+ // Helper: display displayName for object, else string (never render object as React child)
479
+ const getDisplayText = (value: any): string => {
480
+ if (value == null) return '';
481
+ if (typeof value === 'string') return value;
482
+ if (typeof value === 'object') {
483
+ return value.displayName || value.all || value['en-IN'] || value.en || '';
484
484
  }
485
- return '';
485
+ return String(value);
486
486
  };
487
487
 
488
488
  const formatPrice = (price: any) => {
@@ -534,7 +534,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
534
534
  };
535
535
 
536
536
  const getVariantText = (variant: any) => {
537
- return variant.valueId?.name || '';
537
+ return getDisplayText(variant.valueId?.name) || '';
538
538
  };
539
539
 
540
540
  const mrp = product.price?.MRP;
@@ -549,7 +549,7 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
549
549
  <div className="product-image-container">
550
550
  <img
551
551
  src={getImageUrl(product.image?.url || '')}
552
- alt={getProductName(product.name) || product.image?.alt || ''}
552
+ alt={getDisplayText(product.name) || getDisplayText(product.image?.alt) || ''}
553
553
  className="product-image"
554
554
  />
555
555
  </div>
@@ -557,8 +557,8 @@ const TabComponent: React.FC<TabComponentMainProps> = ({ props, deviceMode = 'we
557
557
  {/* Product Details */}
558
558
  <div className="product-details">
559
559
  <div className="product-header">
560
- <div className="product-brand">{product.brand?.name || ''}</div>
561
- <div className="product-name">{getProductName(product.name)}</div>
560
+ <div className="product-brand">{getDisplayText(product.brand?.name) || ''}</div>
561
+ <div className="product-name">{getDisplayText(product.name)}</div>
562
562
  <div className="product-code">Code: {product.sku || product.code || ''}</div>
563
563
  </div>
564
564