@crystaldesign/diva-seller 24.15.0-beta.43 → 24.15.0-beta.44

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.
@@ -17,7 +17,7 @@ import CardMedia from '@mui/material/CardMedia';
17
17
  import Typography$1 from '@mui/material/Typography';
18
18
  import createStyles from '@mui/styles/createStyles';
19
19
  import makeStyles from '@mui/styles/makeStyles';
20
- import { styled, Typography, Card as Card$1, CardActionArea as CardActionArea$1, CardMedia as CardMedia$1, Button as Button$1, TextField, ButtonGroup as ButtonGroup$1, Tooltip, Stack, Paper as Paper$1, IconButton as IconButton$1, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, Divider as Divider$1, Alert, AlertTitle, Link, InputBase, Accordion, AccordionSummary, Tabs, Tab, AccordionDetails, Table as Table$1, TableBody as TableBody$1, TableRow as TableRow$1, TableCell as TableCell$1, CardHeader, CardContent, FormControl as FormControl$1, FormHelperText, TextareaAutosize, Box as Box$1, Select as Select$1, MenuItem as MenuItem$1, ListItemButton, ListItemIcon } from '@mui/material';
20
+ import { styled, Typography, Card as Card$1, CardActionArea as CardActionArea$1, CardMedia as CardMedia$1, Button as Button$1, TextField, ButtonGroup as ButtonGroup$1, Tooltip, Stack, Paper as Paper$1, Skeleton, IconButton as IconButton$1, FormControlLabel as FormControlLabel$1, Checkbox as Checkbox$1, Divider as Divider$1, Alert, AlertTitle, Link, InputBase, Accordion, AccordionSummary, Tabs, Tab, AccordionDetails, Table as Table$1, TableBody as TableBody$1, TableRow as TableRow$1, TableCell as TableCell$1, CardHeader, CardContent, FormControl as FormControl$1, FormHelperText, TextareaAutosize, Box as Box$1, Select as Select$1, MenuItem as MenuItem$1, ListItemButton, ListItemIcon } from '@mui/material';
21
21
  import { Histogram, useFilterState, FilterComponent, AnalyticsComponent } from '@crystaldesign/analytics';
22
22
  import Button from '@mui/material/Button';
23
23
  import ButtonGroup from '@mui/material/ButtonGroup';
@@ -5894,9 +5894,10 @@ var favoriteCheckbox = "favoriteCheckbox-JYnH-";
5894
5894
  var actionButtonContainer = "actionButtonContainer-WfYfD";
5895
5895
  var productDetailsPaper = "productDetailsPaper-VsWfW";
5896
5896
  var productDetailText = "productDetailText-wkk6U";
5897
+ var productDetailSkeleton = "productDetailSkeleton-3-RLq";
5897
5898
  var productDetailDivider = "productDetailDivider-C1Cdh";
5898
5899
  var alertTitle = "alertTitle-Bm1NO";
5899
- var css_248z$b = ".container-3kPdM {\n padding-bottom: 10px;\n margin-top: 2px;\n}\n\n.mainStack-1xE4c {\n width: 100%;\n margin-top: 16px;\n}\n\n.productContainer-JcVn0 {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding-bottom: 16px;\n width: 100%;\n}\n\n.productNameContainer-35ZZc {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n}\n\n.productNameField-hPNbW {\n margin: 8px;\n width: 70%;\n}\n\n.productImage-Vn0l- {\n width: 70%;\n display: block;\n}\n\n.productImage-Vn0l-.hidden-zZ8fS {\n display: none;\n}\n\n.productDetailsContainer-5c-V9 {\n margin: 20px;\n max-height: 100%;\n}\n\n.productDetailRow-9KtDG {\n display: flex;\n}\n\n.productDetailLabel-t7Mn7 {\n font-weight: 600;\n width: 40%;\n}\n\n.favoriteContainer-ka7lC {\n display: flex;\n align-items: center;\n margin-top: 16px;\n}\n.favoriteCheckbox-JYnH- {\n margin-left: 10px;\n}\n\n.actionButtonContainer-WfYfD {\n display: flex;\n gap: 16px;\n margin-top: 16px;\n justify-content: right;\n}\n@media (max-width: 768px) {\n .actionButtonContainer-WfYfD {\n display: flex;\n justify-content: space-between;\n }\n}\n\n.productDetailsPaper-VsWfW {\n width: 100%;\n max-height: 100%;\n overflow: auto;\n}\n\n.productDetailText-wkk6U {\n white-space: pre-wrap;\n}\n\n.productDetailDivider-C1Cdh {\n margin-bottom: 16px;\n}\n\n.alertTitle-Bm1NO {\n font-weight: 600;\n}\n\n/* Responsive styles */\n@media (min-width: 900px) {\n .productDetailsPaper-VsWfW {\n width: 60%;\n }\n}\n";
5900
+ var css_248z$b = ".container-3kPdM {\n padding-bottom: 10px;\n margin-top: 2px;\n}\n\n.mainStack-1xE4c {\n width: 100%;\n margin-top: 16px;\n}\n\n.productContainer-JcVn0 {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding-bottom: 16px;\n width: 100%;\n}\n\n.productNameContainer-35ZZc {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n}\n\n.productNameField-hPNbW {\n margin: 8px;\n width: 70%;\n}\n\n.productImage-Vn0l- {\n width: 70%;\n display: block;\n}\n\n.productImage-Vn0l-.hidden-zZ8fS {\n display: none;\n}\n\n.productDetailsContainer-5c-V9 {\n margin: 20px;\n max-height: 100%;\n}\n\n.productDetailRow-9KtDG {\n display: flex;\n}\n\n.productDetailLabel-t7Mn7 {\n font-weight: 600;\n width: 40%;\n}\n\n.favoriteContainer-ka7lC {\n display: flex;\n align-items: center;\n margin-top: 16px;\n}\n.favoriteCheckbox-JYnH- {\n margin-left: 10px;\n}\n\n.actionButtonContainer-WfYfD {\n display: flex;\n gap: 16px;\n margin-top: 16px;\n justify-content: right;\n}\n@media (max-width: 768px) {\n .actionButtonContainer-WfYfD {\n display: flex;\n justify-content: space-between;\n }\n}\n\n.productDetailsPaper-VsWfW {\n width: 100%;\n max-height: 100%;\n overflow: auto;\n}\n\n.productDetailText-wkk6U {\n white-space: pre-wrap;\n}\n\n.productDetailSkeleton-3-RLq {\n margin-left: 30px;\n height: 28px;\n}\n\n.productDetailDivider-C1Cdh {\n margin-bottom: 16px;\n}\n\n.alertTitle-Bm1NO {\n font-weight: 600;\n}\n\n/* Responsive styles */\n@media (min-width: 900px) {\n .productDetailsPaper-VsWfW {\n width: 60%;\n }\n}\n";
5900
5901
  styleInject(css_248z$b);
5901
5902
 
5902
5903
  function Step3Product(_ref) {
@@ -5916,12 +5917,16 @@ function Step3Product(_ref) {
5916
5917
  setIsFavorite = _useState4[1];
5917
5918
  var _useState5 = useState(false),
5918
5919
  _useState6 = _slicedToArray(_useState5, 2),
5919
- editProductName = _useState6[0],
5920
- setEditProductName = _useState6[1];
5921
- var _useState7 = useState((_currentProduct$short = currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription) !== null && _currentProduct$short !== void 0 ? _currentProduct$short : ''),
5920
+ dataIsReady = _useState6[0],
5921
+ setDataIsReady = _useState6[1];
5922
+ var _useState7 = useState(false),
5922
5923
  _useState8 = _slicedToArray(_useState7, 2),
5923
- text = _useState8[0],
5924
- setText = _useState8[1];
5924
+ editProductName = _useState8[0],
5925
+ setEditProductName = _useState8[1];
5926
+ var _useState9 = useState((_currentProduct$short = currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription) !== null && _currentProduct$short !== void 0 ? _currentProduct$short : ''),
5927
+ _useState10 = _slicedToArray(_useState9, 2),
5928
+ text = _useState10[0],
5929
+ setText = _useState10[1];
5925
5930
  useEffect(function () {
5926
5931
  setText(currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.shortDescription);
5927
5932
  }, [currentProduct]);
@@ -5938,6 +5943,9 @@ function Step3Product(_ref) {
5938
5943
  var handleFavoriteToggle = function handleFavoriteToggle() {
5939
5944
  setIsFavorite(!isFavorite);
5940
5945
  };
5946
+ useEffect(function () {
5947
+ setDataIsReady(currentProduct && imgIsLoaded);
5948
+ }, [currentProduct, imgIsLoaded]);
5941
5949
  return /*#__PURE__*/jsxs(Box, {
5942
5950
  className: container$1,
5943
5951
  children: [/*#__PURE__*/jsx(InfoAlert$1, {
@@ -5972,8 +5980,13 @@ function Step3Product(_ref) {
5972
5980
  onBlur: handleBlur,
5973
5981
  autoFocus: true,
5974
5982
  className: productNameField
5975
- }) : /*#__PURE__*/jsx("h2", {
5983
+ }) : dataIsReady ? /*#__PURE__*/jsx("h2", {
5976
5984
  children: text
5985
+ }) : /*#__PURE__*/jsx(Skeleton, {
5986
+ animation: "wave",
5987
+ variant: "text",
5988
+ width: "50%",
5989
+ height: 50
5977
5990
  }), !editProductName && /*#__PURE__*/jsx(IconButton$1, {
5978
5991
  size: "small",
5979
5992
  onClick: handleEditProductName,
@@ -5983,11 +5996,16 @@ function Step3Product(_ref) {
5983
5996
  })]
5984
5997
  }), /*#__PURE__*/jsx("img", {
5985
5998
  src: (_currentProduct$image = currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image) !== null && _currentProduct$image !== void 0 ? _currentProduct$image : currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.image2D,
5986
- className: "".concat(productImage, " ").concat(!imgIsLoaded ? hidden$1 : ''),
5999
+ className: "".concat(productImage, " ").concat(!dataIsReady ? hidden$1 : ''),
5987
6000
  alt: "Product",
5988
6001
  onLoad: function onLoad() {
5989
6002
  return setImgIsLoaded(true);
5990
6003
  }
6004
+ }), !dataIsReady && /*#__PURE__*/jsx(Skeleton, {
6005
+ animation: "wave",
6006
+ variant: "text",
6007
+ width: "75%",
6008
+ height: 300
5991
6009
  })]
5992
6010
  })
5993
6011
  }), /*#__PURE__*/jsx(Box, {
@@ -6001,6 +6019,7 @@ function Step3Product(_ref) {
6001
6019
  mb: 1,
6002
6020
  children: t('basket.checkout.step4.favoriteinfo')
6003
6021
  }), /*#__PURE__*/jsx(FormControlLabel$1, {
6022
+ disabled: !dataIsReady,
6004
6023
  control: /*#__PURE__*/jsx(Checkbox$1, {
6005
6024
  className: favoriteCheckbox,
6006
6025
  checked: isFavorite,
@@ -6017,10 +6036,12 @@ function Step3Product(_ref) {
6017
6036
  onClick: function onClick() {
6018
6037
  return handleSave(undefined, false, isFavorite);
6019
6038
  },
6039
+ disabled: !dataIsReady,
6020
6040
  children: t('basket.checkout.step4.saveproduct')
6021
6041
  }), /*#__PURE__*/jsx(Button$1, {
6022
6042
  onClick: startWithEmptyBasket,
6023
6043
  variant: "outlined",
6044
+ disabled: !dataIsReady,
6024
6045
  children: t('basket.checkout.step4.cancel')
6025
6046
  })]
6026
6047
  })]
@@ -6031,7 +6052,26 @@ function Step3Product(_ref) {
6031
6052
  className: productDetailsContainer,
6032
6053
  children: [/*#__PURE__*/jsx("h2", {
6033
6054
  children: t('basket.checkout.step3.productdetails')
6034
- }), currentProduct === null || currentProduct === void 0 || (_currentProduct$techn = currentProduct.technicalDescription) === null || _currentProduct$techn === void 0 ? void 0 : _currentProduct$techn.split('\n').map(function (line, index) {
6055
+ }), !dataIsReady && /*#__PURE__*/jsx(Fragment, {
6056
+ children: _toConsumableArray(Array(13)).map(function (_, index) {
6057
+ return /*#__PURE__*/jsxs(Box, {
6058
+ className: productDetailRow,
6059
+ children: [/*#__PURE__*/jsx(Skeleton, {
6060
+ animation: "wave",
6061
+ variant: "text",
6062
+ width: "40%",
6063
+ className: productDetailSkeleton
6064
+ }), /*#__PURE__*/jsx(Skeleton, {
6065
+ animation: "wave",
6066
+ variant: "text",
6067
+ width: "60%",
6068
+ className: productDetailSkeleton
6069
+ }), index < 12 && /*#__PURE__*/jsx(Divider$1, {
6070
+ className: productDetailDivider
6071
+ })]
6072
+ }, index);
6073
+ })
6074
+ }), dataIsReady && (currentProduct === null || currentProduct === void 0 || (_currentProduct$techn = currentProduct.technicalDescription) === null || _currentProduct$techn === void 0 ? void 0 : _currentProduct$techn.split('\n').map(function (line, index) {
6035
6075
  var _currentProduct$techn2;
6036
6076
  var formattedLine = line.trim().endsWith(',') ? line.slice(0, -1) : line;
6037
6077
  var _formattedLine$split = formattedLine.split(':'),
@@ -6062,7 +6102,7 @@ function Step3Product(_ref) {
6062
6102
  className: productDetailDivider
6063
6103
  })]
6064
6104
  }, index);
6065
- })]
6105
+ }))]
6066
6106
  })
6067
6107
  })]
6068
6108
  })]
@@ -6138,15 +6178,12 @@ function CheckOut(_ref) {
6138
6178
  while (1) switch (_context.prev = _context.next) {
6139
6179
  case 0:
6140
6180
  if (!(status === 'BASE_CONFIGURATION' && !currentProduct)) {
6141
- _context.next = 5;
6181
+ _context.next = 3;
6142
6182
  break;
6143
6183
  }
6144
- toggleLoading('loadProduct');
6145
- _context.next = 4;
6184
+ _context.next = 3;
6146
6185
  return loadProduct(basket);
6147
- case 4:
6148
- toggleLoading('loadProduct');
6149
- case 5:
6186
+ case 3:
6150
6187
  case "end":
6151
6188
  return _context.stop();
6152
6189
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Step3Product.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/Basket/CheckOut/components/Step3Product.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAwBnD,UAAU,KAAK;IACb,cAAc,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/F;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,EAAE,KAAK,qBAoH/F"}
1
+ {"version":3,"file":"Step3Product.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/Basket/CheckOut/components/Step3Product.tsx"],"names":[],"mappings":"AAeA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAyBnD,UAAU,KAAK;IACb,cAAc,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/F;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,EAAE,KAAK,qBA0I/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../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AW,EACX,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,IAAI,EACJ,iBAAiB,EACjB,eAAe,GAChB,EAAE,KAAK,qBAkJP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-seller",
3
- "version": "24.15.0-beta.43",
3
+ "version": "24.15.0-beta.44",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -29,9 +29,9 @@
29
29
  "react-dom": "^18.3.1"
30
30
  },
31
31
  "dependencies": {
32
- "@crystaldesign/analytics": "24.15.0-beta.43",
33
- "@crystaldesign/products-component": "24.15.0-beta.43",
34
- "@crystaldesign/real-time-viewer": "24.15.0-beta.43",
32
+ "@crystaldesign/analytics": "24.15.0-beta.44",
33
+ "@crystaldesign/products-component": "24.15.0-beta.44",
34
+ "@crystaldesign/real-time-viewer": "24.15.0-beta.44",
35
35
  "@emotion/react": "^11.4.1",
36
36
  "@emotion/styled": "^11.3.0",
37
37
  "@mui/icons-material": "^6.1.5",
@@ -43,5 +43,5 @@
43
43
  },
44
44
  "types": "./build/types/seller/src/index.d.ts",
45
45
  "module": "build/esm/index.js",
46
- "gitHead": "67c3f84588d7e31a864a94c8025b8682aae40279"
46
+ "gitHead": "8c0bebe70a221fed0ce3760ba491696fad6fb4ad"
47
47
  }