@crystaldesign/widget-image-carousel 25.8.0-beta.10

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.
@@ -0,0 +1,428 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import { useState, useEffect } from 'react';
3
+ import { useCss, useProductData, useConfiguration } from '@crystaldesign/widget-library';
4
+ import { Swiper, SwiperSlide } from 'swiper/react';
5
+ import { Navigation } from 'swiper/modules';
6
+ import 'swiper/css';
7
+ import 'swiper/css/navigation';
8
+ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
9
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
10
+ import _regeneratorRuntime from '@babel/runtime/regenerator';
11
+ import classNames from 'classnames';
12
+ import { jsx, jsxs } from 'react/jsx-runtime';
13
+
14
+ (function() {
15
+ const env = {"STAGE":"production"};
16
+ try {
17
+ if (process) {
18
+ process.env = Object.assign({}, process.env);
19
+ Object.assign(process.env, env);
20
+ return;
21
+ }
22
+ } catch (e) {} // avoid ReferenceError: process is not defined
23
+ globalThis.process = { env:env };
24
+ })();
25
+
26
+ function useImageCarousel(_ref) {
27
+ var productId = _ref.productId,
28
+ settings = _ref.settings;
29
+ var _useState = useState([]),
30
+ _useState2 = _slicedToArray(_useState, 2),
31
+ media = _useState2[0],
32
+ setMedia = _useState2[1];
33
+ var _useState3 = useState(true),
34
+ _useState4 = _slicedToArray(_useState3, 2),
35
+ loading = _useState4[0],
36
+ setLoading = _useState4[1];
37
+ var _useState5 = useState(undefined),
38
+ _useState6 = _slicedToArray(_useState5, 2),
39
+ error = _useState6[0],
40
+ setError = _useState6[1];
41
+ useCss(settings);
42
+ var _useProductData = useProductData({
43
+ productIds: productId,
44
+ widgetType: 'IMAGECAROUSEL'
45
+ }),
46
+ getProductsByDivaNrs = _useProductData.getProductsByDivaNrs,
47
+ getProductByDivaNrAndVariantId = _useProductData.getProductByDivaNrAndVariantId,
48
+ setSelectedProductId = _useProductData.setSelectedProductId,
49
+ selectedProduct = _useProductData.selectedProduct,
50
+ setProductCache = _useProductData.setProductCache;
51
+ useEffect(function () {
52
+ var loadMockups = /*#__PURE__*/function () {
53
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
54
+ var _settings$mediaFuncti, mediaFunctionType, foundMedia, _foundMedia;
55
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
56
+ while (1) switch (_context.prev = _context.next) {
57
+ case 0:
58
+ _context.prev = 0;
59
+ setLoading(true);
60
+ if (!selectedProduct) {
61
+ _context.next = 19;
62
+ break;
63
+ }
64
+ mediaFunctionType = (_settings$mediaFuncti = settings.mediaFunctionType) !== null && _settings$mediaFuncti !== void 0 ? _settings$mediaFuncti : 'SHO';
65
+ if (!(settings.type === 'WALL_MOCKUPS')) {
66
+ _context.next = 11;
67
+ break;
68
+ }
69
+ _context.next = 7;
70
+ return getWallMockups(selectedProduct, mediaFunctionType);
71
+ case 7:
72
+ foundMedia = _context.sent;
73
+ if (foundMedia) {
74
+ setMedia(foundMedia);
75
+ }
76
+ _context.next = 19;
77
+ break;
78
+ case 11:
79
+ if (!(settings.type === 'SIMILAR_PRODUCTS')) {
80
+ _context.next = 18;
81
+ break;
82
+ }
83
+ _context.next = 14;
84
+ return getSimilarProductMedia(selectedProduct, mediaFunctionType, settings.description);
85
+ case 14:
86
+ _foundMedia = _context.sent;
87
+ if (_foundMedia) {
88
+ setMedia(_foundMedia);
89
+ }
90
+ _context.next = 19;
91
+ break;
92
+ case 18:
93
+ throw new Error('Invalid type');
94
+ case 19:
95
+ _context.next = 25;
96
+ break;
97
+ case 21:
98
+ _context.prev = 21;
99
+ _context.t0 = _context["catch"](0);
100
+ console.error(_context.t0);
101
+ setError(_context.t0);
102
+ case 25:
103
+ _context.prev = 25;
104
+ setLoading(false);
105
+ return _context.finish(25);
106
+ case 28:
107
+ case "end":
108
+ return _context.stop();
109
+ }
110
+ }, _callee, null, [[0, 21, 25, 28]]);
111
+ }));
112
+ return function loadMockups() {
113
+ return _ref2.apply(this, arguments);
114
+ };
115
+ }();
116
+ if (selectedProduct && productId) {
117
+ loadMockups();
118
+ }
119
+ }, [selectedProduct, productId]);
120
+ return {
121
+ media: media,
122
+ error: error,
123
+ loading: loading,
124
+ setSelectedProductId: setSelectedProductId
125
+ };
126
+ function getWallMockups(_x, _x2) {
127
+ return _getWallMockups.apply(this, arguments);
128
+ }
129
+ function _getWallMockups() {
130
+ _getWallMockups = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(product, wallMockupFunctionType) {
131
+ var _product$customData, _product$customData2;
132
+ var wallMockupDivaNrs, wallMockupProducts, optCodex, optOpvPairsToSearch, media, _loop, i;
133
+ return _regeneratorRuntime.wrap(function _callee2$(_context4) {
134
+ while (1) switch (_context4.prev = _context4.next) {
135
+ case 0:
136
+ wallMockupDivaNrs = (_product$customData = product.customData) === null || _product$customData === void 0 || (_product$customData = _product$customData['WALL_MOCKUP_DIVANRS']) === null || _product$customData === void 0 ? void 0 : _product$customData.value;
137
+ if (wallMockupDivaNrs) {
138
+ _context4.next = 3;
139
+ break;
140
+ }
141
+ return _context4.abrupt("return", undefined);
142
+ case 3:
143
+ _context4.next = 5;
144
+ return getProductsByDivaNrs(wallMockupDivaNrs);
145
+ case 5:
146
+ wallMockupProducts = _context4.sent;
147
+ optCodex = (_product$customData2 = product.customData) === null || _product$customData2 === void 0 || (_product$customData2 = _product$customData2['OPT_TO_CHECK']) === null || _product$customData2 === void 0 ? void 0 : _product$customData2.value;
148
+ if (optCodex) {
149
+ _context4.next = 9;
150
+ break;
151
+ }
152
+ throw new Error('OPT_TO_CHECK is not set- ProductId: ' + product._id);
153
+ case 9:
154
+ optOpvPairsToSearch = [];
155
+ optCodex.forEach(function (opt) {
156
+ var _product$configuratio;
157
+ optOpvPairsToSearch.push((_product$configuratio = product.configuration) === null || _product$configuratio === void 0 || (_product$configuratio = _product$configuratio.OrderSets[0].Variant) === null || _product$configuratio === void 0 ? void 0 : _product$configuratio[opt]);
158
+ });
159
+ media = [];
160
+ _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
161
+ var currentDivaNr, currentMockupVariants, _loop2, j;
162
+ return _regeneratorRuntime.wrap(function _loop$(_context3) {
163
+ while (1) switch (_context3.prev = _context3.next) {
164
+ case 0:
165
+ currentDivaNr = wallMockupDivaNrs[i];
166
+ currentMockupVariants = wallMockupProducts.data.filter(function (wmp) {
167
+ return wmp.divaNr === currentDivaNr && wmp.baseProduct === false;
168
+ });
169
+ _loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
170
+ var variant, allMatch, _variant$media, mediaUrl;
171
+ return _regeneratorRuntime.wrap(function _loop2$(_context2) {
172
+ while (1) switch (_context2.prev = _context2.next) {
173
+ case 0:
174
+ variant = currentMockupVariants[j]; // check if all opt-opv-pairs match
175
+ allMatch = optCodex.every(function (opt) {
176
+ var _product$configuratio2, _variant$configuratio;
177
+ var mainProductOPV = (_product$configuratio2 = product.configuration) === null || _product$configuratio2 === void 0 || (_product$configuratio2 = _product$configuratio2.OrderSets[0].Variant) === null || _product$configuratio2 === void 0 ? void 0 : _product$configuratio2[opt];
178
+ var variantOPV = (_variant$configuratio = variant.configuration) === null || _variant$configuratio === void 0 || (_variant$configuratio = _variant$configuratio.OrderSets[0].Variant) === null || _variant$configuratio === void 0 ? void 0 : _variant$configuratio[opt];
179
+ return variantOPV === mainProductOPV;
180
+ });
181
+ if (!allMatch) {
182
+ _context2.next = 8;
183
+ break;
184
+ }
185
+ setProductCache(variant._id, wallMockupProducts.data.filter(function (wmp) {
186
+ return wmp.divaNr === currentDivaNr;
187
+ }));
188
+ mediaUrl = variant === null || variant === void 0 || (_variant$media = variant.media) === null || _variant$media === void 0 || (_variant$media = _variant$media.find(function (m) {
189
+ return m.functionType === wallMockupFunctionType;
190
+ })) === null || _variant$media === void 0 ? void 0 : _variant$media.url;
191
+ media.push({
192
+ url: mediaUrl,
193
+ productId: variant._id
194
+ });
195
+ return _context2.abrupt("return", 1);
196
+ case 8:
197
+ case "end":
198
+ return _context2.stop();
199
+ }
200
+ }, _loop2);
201
+ });
202
+ j = 0;
203
+ case 5:
204
+ if (!(j < currentMockupVariants.length)) {
205
+ _context3.next = 12;
206
+ break;
207
+ }
208
+ return _context3.delegateYield(_loop2(), "t0", 7);
209
+ case 7:
210
+ if (!_context3.t0) {
211
+ _context3.next = 9;
212
+ break;
213
+ }
214
+ return _context3.abrupt("break", 12);
215
+ case 9:
216
+ j++;
217
+ _context3.next = 5;
218
+ break;
219
+ case 12:
220
+ case "end":
221
+ return _context3.stop();
222
+ }
223
+ }, _loop);
224
+ });
225
+ i = 0;
226
+ case 14:
227
+ if (!(i < wallMockupDivaNrs.length)) {
228
+ _context4.next = 19;
229
+ break;
230
+ }
231
+ return _context4.delegateYield(_loop(), "t0", 16);
232
+ case 16:
233
+ i++;
234
+ _context4.next = 14;
235
+ break;
236
+ case 19:
237
+ return _context4.abrupt("return", media);
238
+ case 20:
239
+ case "end":
240
+ return _context4.stop();
241
+ }
242
+ }, _callee2);
243
+ }));
244
+ return _getWallMockups.apply(this, arguments);
245
+ }
246
+ function getSimilarProductMedia(_x3, _x4, _x5) {
247
+ return _getSimilarProductMedia.apply(this, arguments);
248
+ }
249
+ function _getSimilarProductMedia() {
250
+ _getSimilarProductMedia = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(product, mediaFunctionType, description) {
251
+ var _product$customData3;
252
+ var similarProductsDivaNr, similarProducts, media, i, _similarProduct$media, _similarProduct$media2, similarProduct, mediaUrl, desc, _similarProduct$descr;
253
+ return _regeneratorRuntime.wrap(function _callee4$(_context6) {
254
+ while (1) switch (_context6.prev = _context6.next) {
255
+ case 0:
256
+ similarProductsDivaNr = (_product$customData3 = product.customData) === null || _product$customData3 === void 0 || (_product$customData3 = _product$customData3['SIMILAR_PRODUCTS_DIVANRS']) === null || _product$customData3 === void 0 ? void 0 : _product$customData3.value;
257
+ if (!(!Array.isArray(similarProductsDivaNr) || similarProductsDivaNr.length === 0)) {
258
+ _context6.next = 3;
259
+ break;
260
+ }
261
+ return _context6.abrupt("return", []);
262
+ case 3:
263
+ _context6.next = 5;
264
+ return Promise.all(similarProductsDivaNr.map(/*#__PURE__*/function () {
265
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(divaNr) {
266
+ var _divaNrParts$;
267
+ var divaNrParts;
268
+ return _regeneratorRuntime.wrap(function _callee3$(_context5) {
269
+ while (1) switch (_context5.prev = _context5.next) {
270
+ case 0:
271
+ divaNrParts = divaNr.split('-');
272
+ _context5.next = 3;
273
+ return getProductByDivaNrAndVariantId('DIVA-' + divaNrParts[1], (_divaNrParts$ = divaNrParts[2]) !== null && _divaNrParts$ !== void 0 ? _divaNrParts$ : undefined);
274
+ case 3:
275
+ return _context5.abrupt("return", _context5.sent);
276
+ case 4:
277
+ case "end":
278
+ return _context5.stop();
279
+ }
280
+ }, _callee3);
281
+ }));
282
+ return function (_x6) {
283
+ return _ref3.apply(this, arguments);
284
+ };
285
+ }()));
286
+ case 5:
287
+ similarProducts = _context6.sent;
288
+ media = [];
289
+ for (i = 0; i < similarProducts.length; i++) {
290
+ similarProduct = similarProducts[i].data[0];
291
+ setProductCache(similarProduct._id, similarProduct);
292
+ mediaUrl = (_similarProduct$media = similarProduct === null || similarProduct === void 0 || (_similarProduct$media2 = similarProduct.media) === null || _similarProduct$media2 === void 0 || (_similarProduct$media2 = _similarProduct$media2.find(function (m) {
293
+ return m.functionType === mediaFunctionType;
294
+ })) === null || _similarProduct$media2 === void 0 ? void 0 : _similarProduct$media2.url) !== null && _similarProduct$media !== void 0 ? _similarProduct$media : similarProduct.image;
295
+ desc = undefined;
296
+ if (mediaUrl) {
297
+ if (description) {
298
+ desc = (_similarProduct$descr = similarProduct[description]) !== null && _similarProduct$descr !== void 0 ? _similarProduct$descr : description;
299
+ }
300
+ media.push({
301
+ url: mediaUrl,
302
+ description: desc,
303
+ productId: similarProduct._id
304
+ });
305
+ }
306
+ }
307
+ return _context6.abrupt("return", media);
308
+ case 9:
309
+ case "end":
310
+ return _context6.stop();
311
+ }
312
+ }, _callee4);
313
+ }));
314
+ return _getSimilarProductMedia.apply(this, arguments);
315
+ }
316
+ }
317
+
318
+ function styleInject(css, ref) {
319
+ if ( ref === void 0 ) ref = {};
320
+ var insertAt = ref.insertAt;
321
+
322
+ if (!css || typeof document === 'undefined') { return; }
323
+
324
+ var head = document.head || document.getElementsByTagName('head')[0];
325
+ var style = document.createElement('style');
326
+ style.type = 'text/css';
327
+
328
+ if (insertAt === 'top') {
329
+ if (head.firstChild) {
330
+ head.insertBefore(style, head.firstChild);
331
+ } else {
332
+ head.appendChild(style);
333
+ }
334
+ } else {
335
+ head.appendChild(style);
336
+ }
337
+
338
+ if (style.styleSheet) {
339
+ style.styleSheet.cssText = css;
340
+ } else {
341
+ style.appendChild(document.createTextNode(css));
342
+ }
343
+ }
344
+
345
+ var imageCarouselContainer = "imageCarouselContainer-5xR1Z";
346
+ var imageCarousel = "imageCarousel-doGe7";
347
+ var slide = "slide-kzTjO";
348
+ var slideImage = "slideImage-25uCG";
349
+ var slideDescriptionImage = "slideDescriptionImage-qebF3";
350
+ var slideDescription = "slideDescription-UOsb1";
351
+ var css_248z = ".imageCarouselContainer-5xR1Z {\n width: 100%;\n overflow: hidden;\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 20px;\n}\n\n.imageCarousel-doGe7 {\n height: 100%;\n width: 100%;\n}\n\n.slide-kzTjO {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n\n.slideImage-25uCG {\n max-height: 100%;\n max-width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n cursor: pointer;\n}\n\n.slideDescriptionImage-qebF3 {\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100%;\n}\n\n.slideDescriptionImage-qebF3 img {\n cursor: pointer;\n display: block;\n width: 100%;\n max-height: 75%;\n height: auto;\n -o-object-fit: contain;\n object-fit: contain;\n}\n\n.slideDescription-UOsb1 {\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 25%;\n background: lightgrey;\n color: black;\n text-align: center;\n}\n\n.slideDescription-UOsb1 span {\n font-size: 26px;\n}\n";
352
+ styleInject(css_248z);
353
+
354
+ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
355
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
356
+ function MainComponent(props) {
357
+ var _useImageCarousel = useImageCarousel(props),
358
+ media = _useImageCarousel.media,
359
+ error = _useImageCarousel.error,
360
+ loading = _useImageCarousel.loading,
361
+ setSelectedProductId = _useImageCarousel.setSelectedProductId;
362
+ if (loading) return /*#__PURE__*/jsx("div", {
363
+ children: "Loading..."
364
+ });
365
+ if (error) return /*#__PURE__*/jsx("div", {
366
+ children: "Error"
367
+ });
368
+ return /*#__PURE__*/jsx("div", {
369
+ className: classNames([imageCarouselContainer, 'diva-widget-image-carousel-container']),
370
+ children: /*#__PURE__*/jsx(Swiper, _objectSpread$1(_objectSpread$1({
371
+ modules: [Navigation],
372
+ navigation: true,
373
+ className: classNames([imageCarousel, 'diva-widget-image-carousel-swiper'])
374
+ }, props.settings.sliderProp), {}, {
375
+ children: media.map(function (m, i) {
376
+ return /*#__PURE__*/jsx(SwiperSlide, {
377
+ className: classNames([slide, 'diva-widget-image-carousel-slide']),
378
+ children: props.settings.description ? /*#__PURE__*/jsxs("div", {
379
+ className: classNames([slideDescriptionImage, 'diva-widget-image-carousel-slide-description-image']),
380
+ onClick: function onClick() {
381
+ return setSelectedProductId(m.productId);
382
+ },
383
+ children: [/*#__PURE__*/jsx("img", {
384
+ src: m.url,
385
+ alt: "carousel image"
386
+ }), /*#__PURE__*/jsx("div", {
387
+ className: classNames([slideDescription, 'diva-widget-image-carousel-slide-description']),
388
+ children: /*#__PURE__*/jsx("span", {
389
+ children: m.description
390
+ })
391
+ })]
392
+ }) : /*#__PURE__*/jsx("img", {
393
+ src: m.url,
394
+ alt: "carousel image",
395
+ className: classNames([slideImage, 'diva-widget-image-carousel-slide-image']),
396
+ onClick: function onClick() {
397
+ return setSelectedProductId(m.productId);
398
+ }
399
+ }, m.productId + 'img')
400
+ }, m.productId);
401
+ })
402
+ }))
403
+ });
404
+ }
405
+
406
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
407
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
408
+ var Main = function Main(_ref) {
409
+ var _parameters$productId;
410
+ var settings = _ref.settings,
411
+ parameters = _ref.parameters;
412
+ return /*#__PURE__*/jsx(ImageCarouselComponent, {
413
+ settings: settings,
414
+ productId: (_parameters$productId = parameters === null || parameters === void 0 ? void 0 : parameters.productId) !== null && _parameters$productId !== void 0 ? _parameters$productId : ''
415
+ });
416
+ };
417
+ var ImageCarouselComponent = function ImageCarouselComponent(props) {
418
+ var settings = useConfiguration(ImageCarousel.name, props.settings);
419
+ return /*#__PURE__*/jsx(MainComponent, _objectSpread(_objectSpread({}, props), {}, {
420
+ settings: settings
421
+ }));
422
+ };
423
+ var ImageCarousel = {
424
+ name: 'IMAGE_CAROUSEL',
425
+ renderFunction: Main
426
+ };
427
+
428
+ export { ImageCarouselComponent, ImageCarousel as default };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import 'swiper/css';
3
+ import 'swiper/css/navigation';
4
+ import { ImageCarouselProps } from '../types';
5
+ export default function MainComponent(props: ImageCarouselProps): React.JSX.Element;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,YAAY,CAAC;AACpB,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAM9C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAwC9D"}
@@ -0,0 +1,11 @@
1
+
2
+
3
+ export * from './types';
4
+ import React from 'react';
5
+ import { ComponentDefinition } from '@crystaldesign/diva-core';
6
+ import { Configuration, ImageCarouselProps } from './types';
7
+ export declare const ImageCarouselComponent: React.FC<ImageCarouselProps>;
8
+ declare const ImageCarousel: ComponentDefinition<Configuration>;
9
+ export default ImageCarousel;
10
+ //# sourceMappingURL=index.d.ts.map
11
+
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAkB,MAAM,0BAA0B,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM5D,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAG/D,CAAC;AAEF,QAAA,MAAM,aAAa,EAAE,mBAAmB,CAAC,aAAa,CAGrD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { WithDivaMock } from '@crystaldesign/diva-core';
3
+ import { ImageCarouselProps } from '../../types';
4
+ declare const meta: Meta<WithDivaMock<ImageCarouselProps>>;
5
+ export default meta;
6
+ type Story = StoryObj<WithDivaMock<ImageCarouselProps>>;
7
+ export declare const ImageCarousel: Story;
8
+ //# sourceMappingURL=default.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/stories/SimilarProducts/default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAqB,MAAM,0BAA0B,CAAC;AAG3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAmBhD,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAwCxD,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { WithDivaMock } from '@crystaldesign/diva-core';
3
+ import { ImageCarouselProps } from '../../types';
4
+ declare const meta: Meta<WithDivaMock<ImageCarouselProps>>;
5
+ export default meta;
6
+ type Story = StoryObj<WithDivaMock<ImageCarouselProps>>;
7
+ export declare const ImageCarousel: Story;
8
+ //# sourceMappingURL=default.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.stories.d.ts","sourceRoot":"","sources":["../../../../../../src/stories/WallMockup/default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAqB,MAAM,0BAA0B,CAAC;AAG3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAmBhD,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAuCxD,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { BaseConfiguration } from '@crystaldesign/widget-library';
2
+ import { SwiperProps } from 'swiper/react';
3
+ export interface ImageCarouselProps {
4
+ settings: Configuration;
5
+ productId: string;
6
+ }
7
+ export interface Configuration extends BaseConfiguration {
8
+ type: 'WALL_MOCKUPS' | 'SIMILAR_PRODUCTS';
9
+ mediaFunctionType?: string;
10
+ description?: string;
11
+ sliderProp?: SwiperProps;
12
+ }
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,IAAI,EAAE,cAAc,GAAG,kBAAkB,CAAC;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B"}
@@ -0,0 +1,14 @@
1
+ import { ImageCarouselProps } from './types';
2
+ interface Media {
3
+ url: string;
4
+ description?: string;
5
+ productId: string;
6
+ }
7
+ export declare function useImageCarousel({ productId, settings }: ImageCarouselProps): {
8
+ media: Media[];
9
+ error: Error | undefined;
10
+ loading: boolean;
11
+ setSelectedProductId: (productId: string) => Promise<void>;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=useImageCarousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImageCarousel.d.ts","sourceRoot":"","sources":["../../../../src/useImageCarousel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,UAAU,KAAK;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,kBAAkB;;;;;EAkI3E"}