@crystaldesign/widget-library 25.11.0-beta.8 → 25.11.0-rc.0
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/build/esm/index.js +105 -29
- package/build/types/widget-library/src/components/Gallery/useGallery.d.ts +1 -1
- package/build/types/widget-library/src/components/Gallery/useGallery.d.ts.map +1 -1
- package/build/types/widget-library/src/components/MediaItem/ImageItem/index.d.ts +2 -1
- package/build/types/widget-library/src/components/MediaItem/ImageItem/index.d.ts.map +1 -1
- package/build/types/widget-library/src/components/MediaItem/index.d.ts +1 -0
- package/build/types/widget-library/src/components/MediaItem/index.d.ts.map +1 -1
- package/build/types/widget-library/src/hooks/useProductData.d.ts +3 -1
- package/build/types/widget-library/src/hooks/useProductData.d.ts.map +1 -1
- package/build/types/widget-library/src/utils/replaceActions.d.ts.map +1 -1
- package/package.json +2 -2
package/build/esm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
6
|
import DivaUtils from '@crystaldesign/diva-utils';
|
|
7
7
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
|
-
import { Navigation, Thumbs, Pagination } from 'swiper/modules';
|
|
8
|
+
import { Navigation, Thumbs, Pagination, Autoplay } from 'swiper/modules';
|
|
9
9
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
10
10
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -266,7 +266,8 @@ function useProductData(_ref) {
|
|
|
266
266
|
var productIds = _ref.productIds,
|
|
267
267
|
variants = _ref.variants,
|
|
268
268
|
widgetType = _ref.widgetType,
|
|
269
|
-
noGlobalCache = _ref.noGlobalCache
|
|
269
|
+
noGlobalCache = _ref.noGlobalCache,
|
|
270
|
+
standaloneWidget = _ref.standaloneWidget;
|
|
270
271
|
// Generate stable widget ID that persists for the lifetime of this hook instance
|
|
271
272
|
// Function to handle selectedProduct changes
|
|
272
273
|
|
|
@@ -418,6 +419,10 @@ function useProductData(_ref) {
|
|
|
418
419
|
|
|
419
420
|
// Main effect for loading products when productIds or variants change
|
|
420
421
|
useEffect(function () {
|
|
422
|
+
if (standaloneWidget) {
|
|
423
|
+
LOG.debug("[".concat(widgetType, ":").concat(widgetId, "] Standalone widget, skipping main effect"));
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
421
426
|
LOG.debug("[".concat(widgetType, ":").concat(widgetId, "] Main effect triggered with normalizedProductIds: ").concat(normalizedProductIds.join(', ')));
|
|
422
427
|
if (!normalizedProductIds.length) {
|
|
423
428
|
LOG.error(new DivaError("[".concat(widgetType, ":").concat(widgetId, "] ProductIds array is required and cannot be empty")));
|
|
@@ -581,8 +586,9 @@ function useProductData(_ref) {
|
|
|
581
586
|
});
|
|
582
587
|
case 3:
|
|
583
588
|
products = _context6.sent;
|
|
589
|
+
setProductVariants(products.data);
|
|
584
590
|
return _context6.abrupt("return", products);
|
|
585
|
-
case
|
|
591
|
+
case 6:
|
|
586
592
|
case "end":
|
|
587
593
|
return _context6.stop();
|
|
588
594
|
}
|
|
@@ -621,8 +627,9 @@ function useProductData(_ref) {
|
|
|
621
627
|
});
|
|
622
628
|
case 4:
|
|
623
629
|
product = _context7.sent;
|
|
630
|
+
setProductVariants(product.data);
|
|
624
631
|
return _context7.abrupt("return", product);
|
|
625
|
-
case
|
|
632
|
+
case 7:
|
|
626
633
|
case "end":
|
|
627
634
|
return _context7.stop();
|
|
628
635
|
}
|
|
@@ -630,23 +637,56 @@ function useProductData(_ref) {
|
|
|
630
637
|
}));
|
|
631
638
|
return _getProductByDivaNrAndVariantId.apply(this, arguments);
|
|
632
639
|
}
|
|
640
|
+
function getSimpleProductListByIds(_x9) {
|
|
641
|
+
return _getSimpleProductListByIds.apply(this, arguments);
|
|
642
|
+
}
|
|
643
|
+
function _getSimpleProductListByIds() {
|
|
644
|
+
_getSimpleProductListByIds = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(productIds) {
|
|
645
|
+
var products;
|
|
646
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
647
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
648
|
+
case 0:
|
|
649
|
+
_context8.next = 2;
|
|
650
|
+
return getOrFetch('simpleProductListByIds' + productIds.join(','), function () {
|
|
651
|
+
return handler.productHandler.apiGetProductByQuery([{
|
|
652
|
+
id: '_id',
|
|
653
|
+
op: 'in',
|
|
654
|
+
value: productIds.join(',').replaceAll('"', '')
|
|
655
|
+
}, {
|
|
656
|
+
id: 'baseProduct',
|
|
657
|
+
op: 'eq',
|
|
658
|
+
value: false
|
|
659
|
+
}], 1000, false);
|
|
660
|
+
});
|
|
661
|
+
case 2:
|
|
662
|
+
products = _context8.sent;
|
|
663
|
+
setProductVariants(products.data);
|
|
664
|
+
return _context8.abrupt("return", products);
|
|
665
|
+
case 5:
|
|
666
|
+
case "end":
|
|
667
|
+
return _context8.stop();
|
|
668
|
+
}
|
|
669
|
+
}, _callee8);
|
|
670
|
+
}));
|
|
671
|
+
return _getSimpleProductListByIds.apply(this, arguments);
|
|
672
|
+
}
|
|
633
673
|
function setProductCache(key, data) {
|
|
634
674
|
setCache(key, {
|
|
635
675
|
data: data,
|
|
636
676
|
timestamp: Date.now()
|
|
637
677
|
});
|
|
638
678
|
}
|
|
639
|
-
function logSelectedProduct(
|
|
679
|
+
function logSelectedProduct(_x10, _x11, _x12, _x13, _x14, _x15) {
|
|
640
680
|
return _logSelectedProduct.apply(this, arguments);
|
|
641
681
|
}
|
|
642
682
|
function _logSelectedProduct() {
|
|
643
|
-
_logSelectedProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
683
|
+
_logSelectedProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(productId, widgetType, variantId, catalogName, catalogCodex, supplierId) {
|
|
644
684
|
var event,
|
|
645
|
-
|
|
646
|
-
return _regeneratorRuntime.wrap(function
|
|
647
|
-
while (1) switch (
|
|
685
|
+
_args9 = arguments;
|
|
686
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
687
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
648
688
|
case 0:
|
|
649
|
-
event =
|
|
689
|
+
event = _args9.length > 6 && _args9[6] !== undefined ? _args9[6] : 'onWidgetProductSelected';
|
|
650
690
|
LOG.businessEvent(event, 'DivaWidget', "Product ".concat(productId, " selected in widget ").concat(widgetType), {
|
|
651
691
|
productId: productId,
|
|
652
692
|
variantId: variantId,
|
|
@@ -657,9 +697,9 @@ function useProductData(_ref) {
|
|
|
657
697
|
});
|
|
658
698
|
case 2:
|
|
659
699
|
case "end":
|
|
660
|
-
return
|
|
700
|
+
return _context9.stop();
|
|
661
701
|
}
|
|
662
|
-
},
|
|
702
|
+
}, _callee9);
|
|
663
703
|
}));
|
|
664
704
|
return _logSelectedProduct.apply(this, arguments);
|
|
665
705
|
}
|
|
@@ -671,7 +711,8 @@ function useProductData(_ref) {
|
|
|
671
711
|
getProductByDivaNrAndVariantId: getProductByDivaNrAndVariantId,
|
|
672
712
|
selectedProduct: selectedProduct,
|
|
673
713
|
setSelectedProductId: setSelectedProductId,
|
|
674
|
-
setProductCache: setProductCache
|
|
714
|
+
setProductCache: setProductCache,
|
|
715
|
+
getSimpleProductListByIds: getSimpleProductListByIds
|
|
675
716
|
};
|
|
676
717
|
}
|
|
677
718
|
|
|
@@ -780,7 +821,8 @@ function useGallery(_ref) {
|
|
|
780
821
|
add2DImage = _ref$config.add2DImage,
|
|
781
822
|
add3DImageAsFallback = _ref$config.add3DImageAsFallback,
|
|
782
823
|
currentProductId = _ref.currentProductId,
|
|
783
|
-
setCurrentProductId = _ref.setCurrentProductId
|
|
824
|
+
setCurrentProductId = _ref.setCurrentProductId,
|
|
825
|
+
disableAnimation = _ref.disableAnimation;
|
|
784
826
|
var _useDivaCore = useDivaCore(),
|
|
785
827
|
baseSirvUrls = _useDivaCore.state.apiConfig.baseSirvUrls;
|
|
786
828
|
var _useState = useState(null),
|
|
@@ -826,6 +868,18 @@ function useGallery(_ref) {
|
|
|
826
868
|
}
|
|
827
869
|
}
|
|
828
870
|
}, [currentProductId, swiper]);
|
|
871
|
+
useEffect(function () {
|
|
872
|
+
var _swiper$params2;
|
|
873
|
+
if (!swiper || !(swiper !== null && swiper !== void 0 && (_swiper$params2 = swiper.params) !== null && _swiper$params2 !== void 0 && _swiper$params2.autoplay)) {
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
if (swiper.autoplay.running && disableAnimation) {
|
|
877
|
+
swiper.autoplay.pause();
|
|
878
|
+
}
|
|
879
|
+
if (swiper.autoplay.paused && !disableAnimation) {
|
|
880
|
+
swiper.autoplay.start();
|
|
881
|
+
}
|
|
882
|
+
}, [swiper, disableAnimation]);
|
|
829
883
|
var hasSirvMedia = useMemo(function () {
|
|
830
884
|
var _loop = function _loop(i) {
|
|
831
885
|
if (medias.find(function (m) {
|
|
@@ -947,8 +1001,8 @@ function styleInject(css, ref) {
|
|
|
947
1001
|
}
|
|
948
1002
|
|
|
949
1003
|
var divaAr = "diva-ar-NDv-7";
|
|
950
|
-
var css_248z$
|
|
951
|
-
styleInject(css_248z$
|
|
1004
|
+
var css_248z$3 = "/* This keeps child nodes hidden while the element loads */\n.diva-ar-NDv-7 :not(:defined) > * {\n display: none;\n}\n\nmodel-viewer.diva-ar-NDv-7 {\n overflow-x: hidden;\n}\n\n@keyframes circle-j3-4E {\n from {\n transform: translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg);\n }\n to {\n transform: translateX(-50%) rotate(360deg) translateX(50px) rotate(-360deg);\n }\n}\n\n@keyframes elongate-eNbHO {\n from {\n transform: translateX(100px);\n }\n to {\n transform: translateX(-100px);\n }\n}\n\nmodel-viewer.diva-ar-NDv-7 > #ar-prompt {\n position: absolute;\n left: 50%;\n bottom: 175px;\n animation: elongate-eNbHO 2s infinite ease-in-out alternate;\n display: none;\n}\n\nmodel-viewer.diva-ar-NDv-7[ar-status='session-started'] > #ar-prompt {\n display: block;\n}\n\nmodel-viewer.diva-ar-NDv-7 > #ar-prompt > img {\n animation: circle-j3-4E 4s linear infinite;\n}\n\nmodel-viewer.diva-ar-NDv-7 > #ar-failure {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n bottom: 175px;\n display: none;\n}\n\nmodel-viewer.diva-ar-NDv-7[ar-tracking='not-tracking'] > #ar-failure {\n display: block;\n}\n";
|
|
1005
|
+
styleInject(css_248z$3);
|
|
952
1006
|
|
|
953
1007
|
var ArViewer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
954
1008
|
var media = _ref.media;
|
|
@@ -991,11 +1045,18 @@ var ArViewer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
991
1045
|
});
|
|
992
1046
|
});
|
|
993
1047
|
|
|
1048
|
+
var divaWidgetMediaitemContainer = "divaWidgetMediaitemContainer-K-Tal";
|
|
1049
|
+
var divaWidgetMediaitem = "divaWidgetMediaitem-Mt-0w";
|
|
1050
|
+
var divaWidgetMediaitemOverlay = "divaWidgetMediaitemOverlay-X6zee";
|
|
1051
|
+
var css_248z$2 = ".divaWidgetMediaitemContainer-K-Tal {\n position: relative;\n display: inline-block;\n cursor: pointer;\n}\n\n.divaWidgetMediaitem-Mt-0w {\n display: block;\n width: 100%;\n height: auto;\n}\n\n.divaWidgetMediaitemOverlay-X6zee {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(128, 128, 128, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.3s ease;\n pointer-events: none;\n}\n";
|
|
1052
|
+
styleInject(css_248z$2);
|
|
1053
|
+
|
|
994
1054
|
var ImageItem = function ImageItem(_ref) {
|
|
995
1055
|
var url = _ref.url,
|
|
996
|
-
|
|
1056
|
+
sirvProps = _ref.sirvProps,
|
|
1057
|
+
overlay = _ref.overlay,
|
|
997
1058
|
className = _ref.className,
|
|
998
|
-
|
|
1059
|
+
onClick = _ref.onClick;
|
|
999
1060
|
var _useState = useState(''),
|
|
1000
1061
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1001
1062
|
loadedMediaUrl = _useState2[0],
|
|
@@ -1079,17 +1140,30 @@ var ImageItem = function ImageItem(_ref) {
|
|
|
1079
1140
|
|
|
1080
1141
|
// Only render the image if we have a loaded URL
|
|
1081
1142
|
if (loadedMediaUrl) {
|
|
1082
|
-
return /*#__PURE__*/
|
|
1083
|
-
className: classNames('diva-widget-mediaitem'
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1143
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1144
|
+
className: classNames(divaWidgetMediaitemContainer, 'diva-widget-mediaitem-container'),
|
|
1145
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
1146
|
+
if (overlay) {
|
|
1147
|
+
var overlayElement = e.currentTarget.querySelector('.diva-widget-mediaitem-overlay');
|
|
1148
|
+
if (overlayElement) overlayElement.style.opacity = '1';
|
|
1149
|
+
}
|
|
1087
1150
|
},
|
|
1088
|
-
|
|
1151
|
+
onMouseLeave: function onMouseLeave(e) {
|
|
1152
|
+
if (overlay) {
|
|
1153
|
+
var overlayElement = e.currentTarget.querySelector('.diva-widget-mediaitem-overlay');
|
|
1154
|
+
if (overlayElement) overlayElement.style.opacity = '0';
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
children: [/*#__PURE__*/jsx("img", {
|
|
1158
|
+
className: classNames(divaWidgetMediaitem, 'diva-widget-mediaitem', className),
|
|
1159
|
+
src: loadedMediaUrl,
|
|
1160
|
+
onClick: !overlay ? onClick : undefined
|
|
1161
|
+
}), overlay && /*#__PURE__*/jsx("div", {
|
|
1162
|
+
className: classNames(divaWidgetMediaitemOverlay, 'diva-widget-mediaitem-overlay'),
|
|
1163
|
+
children: overlay
|
|
1164
|
+
})]
|
|
1089
1165
|
});
|
|
1090
1166
|
}
|
|
1091
|
-
|
|
1092
|
-
// Fallback: render nothing if we don't have a loaded image
|
|
1093
1167
|
return null;
|
|
1094
1168
|
};
|
|
1095
1169
|
|
|
@@ -1101,7 +1175,8 @@ var MediaItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1101
1175
|
config = _ref.config,
|
|
1102
1176
|
isCurrentlyVisible = _ref.isCurrentlyVisible,
|
|
1103
1177
|
onClick = _ref.onClick,
|
|
1104
|
-
className = _ref.className
|
|
1178
|
+
className = _ref.className,
|
|
1179
|
+
overlay = _ref.overlay;
|
|
1105
1180
|
var useSirv = false;
|
|
1106
1181
|
var _useDivaCore = useDivaCore(),
|
|
1107
1182
|
baseSirvUrls = _useDivaCore.state.apiConfig.baseSirvUrls;
|
|
@@ -1174,7 +1249,8 @@ var MediaItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1174
1249
|
url: url,
|
|
1175
1250
|
onClick: onClick,
|
|
1176
1251
|
className: classNames('diva-widget-mediaitem', className),
|
|
1177
|
-
sirvProps: config.sirvProps
|
|
1252
|
+
sirvProps: config.sirvProps,
|
|
1253
|
+
overlay: overlay
|
|
1178
1254
|
});
|
|
1179
1255
|
});
|
|
1180
1256
|
|
|
@@ -1355,7 +1431,7 @@ var Gallery = function Gallery(props) {
|
|
|
1355
1431
|
thumbs: {
|
|
1356
1432
|
swiper: thumbsSwiper && !thumbsSwiper.destroyed ? thumbsSwiper : null
|
|
1357
1433
|
},
|
|
1358
|
-
modules: [Navigation, Thumbs, Pagination],
|
|
1434
|
+
modules: [Navigation, Thumbs, Pagination, Autoplay],
|
|
1359
1435
|
className: classNames('gallery-main', props.nestedSwiper ? 'gallery-main-popup-swiper' : ''),
|
|
1360
1436
|
speed: props.disableAnimation ? 0 : 500
|
|
1361
1437
|
}, props.config.sliderProp), {}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GalleryProps, MediaWithProductIndex } from './types';
|
|
2
2
|
import { SwiperClass } from 'swiper/react';
|
|
3
|
-
export default function useGallery({ products, config: { functionTypes, add2DImage, add3DImageAsFallback }, currentProductId, setCurrentProductId, }: GalleryProps): {
|
|
3
|
+
export default function useGallery({ products, config: { functionTypes, add2DImage, add3DImageAsFallback }, currentProductId, setCurrentProductId, disableAnimation, }: GalleryProps): {
|
|
4
4
|
medias: MediaWithProductIndex[];
|
|
5
5
|
sirvLoaded: boolean;
|
|
6
6
|
thumbsSwiper: SwiperClass | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGallery.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Gallery/useGallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,QAAQ,EACR,MAAM,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAC3D,gBAAgB,EAChB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useGallery.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Gallery/useGallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,QAAQ,EACR,MAAM,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAC3D,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,EAAE,YAAY;;;;;;;;4BAoDkB,WAAW;uCAoBA,GAAG;EA8B9C"}
|
|
@@ -6,7 +6,8 @@ type Props = {
|
|
|
6
6
|
sirvProps?: {
|
|
7
7
|
[data: string]: string;
|
|
8
8
|
};
|
|
9
|
+
overlay?: React.ReactNode;
|
|
9
10
|
};
|
|
10
|
-
declare const ImageItem: ({ url,
|
|
11
|
+
declare const ImageItem: ({ url, sirvProps, overlay, className, onClick }: Props) => React.JSX.Element | null;
|
|
11
12
|
export default ImageItem;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/MediaItem/ImageItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/MediaItem/ImageItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,KAAK,KAAK,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;AAE1I,QAAA,MAAM,SAAS,oDAAqD,KAAK,6BA4ExE,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/MediaItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIzD,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/MediaItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAIzD,KAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,SAAS,mFAoFrB,CAAC"}
|
|
@@ -11,8 +11,9 @@ export interface UseProductDataProps {
|
|
|
11
11
|
* This is used in the product list, where we always want to fetch the latest data
|
|
12
12
|
*/
|
|
13
13
|
noGlobalCache?: boolean;
|
|
14
|
+
standaloneWidget?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare function useProductData({ productIds, variants, widgetType, noGlobalCache }: UseProductDataProps): {
|
|
16
|
+
export declare function useProductData({ productIds, variants, widgetType, noGlobalCache, standaloneWidget }: UseProductDataProps): {
|
|
16
17
|
productVariants: ProductData[];
|
|
17
18
|
error: boolean;
|
|
18
19
|
loading: boolean;
|
|
@@ -21,5 +22,6 @@ export declare function useProductData({ productIds, variants, widgetType, noGlo
|
|
|
21
22
|
selectedProduct: ProductData | undefined;
|
|
22
23
|
setSelectedProductId: (productId: string) => Promise<void>;
|
|
23
24
|
setProductCache: (key: string, data: any) => void;
|
|
25
|
+
getSimpleProductListByIds: (productIds: string[]) => Promise<any>;
|
|
24
26
|
};
|
|
25
27
|
//# sourceMappingURL=useProductData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProductData.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useProductData.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAQ1F,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useProductData.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useProductData.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAQ1F,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAKD,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,mBAAmB;;;;oCA6L1E,MAAM,EAAE,KAAG,OAAO,CAAC,GAAG,CAAC;6CA0Bd,MAAM,cAAc,MAAM,KAAG,OAAO,CAAC,GAAG,CAAC;;sCAzF3E,MAAM;2BAoII,MAAM,QAAQ,GAAG;4CAfM,MAAM,EAAE,KAAG,OAAO,CAAC,GAAG,CAAC;EAoD7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceActions.d.ts","sourceRoot":"","sources":["../../../../../src/utils/replaceActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"replaceActions.d.ts","sourceRoot":"","sources":["../../../../../src/utils/replaceActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAItE;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1D,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,WAAW,EAAE,EAC9B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,MAAM,EAChB,qBAAqB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,EAC/C,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GACtC,CAAC,CAGH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crystaldesign/widget-library",
|
|
3
|
-
"version": "25.11.0-
|
|
3
|
+
"version": "25.11.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"storybook": "storybook dev -p 6006",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"suiteName": "widget-library",
|
|
37
37
|
"outputDirectory": "./test-reports"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "1b26a1f843e380ce57d92a97014381e58a6238a2"
|
|
40
40
|
}
|