@crystaldesign/diva-core 24.15.0-beta.40 → 24.15.0-beta.42

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.
@@ -1,4 +1,4 @@
1
- import { i as styleInject, u as useDivaCoreContext } from './index-600e89eb.js';
1
+ import { i as styleInject, u as useDivaCoreContext } from './index-db072047.js';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@mui/material/Button';
@@ -1,4 +1,4 @@
1
- import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, a as getLogger, e as error, b as separator, I as Input, r as resetInput, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-600e89eb.js';
1
+ import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, a as getLogger, e as error, b as separator, I as Input, r as resetInput, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-db072047.js';
2
2
  import { useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -623,84 +623,49 @@ function WelcomeScreen (_ref) {
623
623
  setInvitationError = _useState2[1];
624
624
  var _useTranslation = useTranslation(),
625
625
  t = _useTranslation.t;
626
- var _useState3 = useState(''),
627
- _useState4 = _slicedToArray(_useState3, 2),
628
- userFound = _useState4[0],
629
- setUserFound = _useState4[1];
630
- useEffect(function () {
631
- function getInvitation() {
632
- return _getInvitation.apply(this, arguments);
633
- }
634
- function _getInvitation() {
635
- _getInvitation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
636
- var _authorizationStore$s;
637
- var data;
638
- return _regeneratorRuntime.wrap(function _callee$(_context) {
639
- while (1) switch (_context.prev = _context.next) {
640
- case 0:
641
- _context.next = 2;
642
- return authorizationHandler.getInvitationValue('user-check', (_authorizationStore$s = authorizationStore.state) === null || _authorizationStore$s === void 0 ? void 0 : _authorizationStore$s.invitationId);
643
- case 2:
644
- data = _context.sent;
645
- if (data) {
646
- setUserFound(data.exists);
647
- } else {
648
- setInvitationError('Invitation not found');
649
- }
650
- return _context.abrupt("return");
651
- case 5:
652
- case "end":
653
- return _context.stop();
654
- }
655
- }, _callee);
656
- }));
657
- return _getInvitation.apply(this, arguments);
658
- }
659
- getInvitation();
660
- }, [invitationId]);
661
626
  var toLogin = /*#__PURE__*/function () {
662
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
627
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
663
628
  var invitationMail;
664
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
665
- while (1) switch (_context2.prev = _context2.next) {
629
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
630
+ while (1) switch (_context.prev = _context.next) {
666
631
  case 0:
667
- _context2.next = 2;
632
+ _context.next = 2;
668
633
  return checkInvitation();
669
634
  case 2:
670
- invitationMail = _context2.sent;
635
+ invitationMail = _context.sent;
671
636
  if (invitationMail) {
672
637
  authorizationStore.close();
673
638
  authorizationStore.showLogin(undefined, undefined, invitationOrgId, invitationId, invitationMail);
674
639
  }
675
640
  case 4:
676
641
  case "end":
677
- return _context2.stop();
642
+ return _context.stop();
678
643
  }
679
- }, _callee2);
644
+ }, _callee);
680
645
  }));
681
646
  return function toLogin() {
682
647
  return _ref2.apply(this, arguments);
683
648
  };
684
649
  }();
685
650
  var toRegister = /*#__PURE__*/function () {
686
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
651
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
687
652
  var invitationMail;
688
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
689
- while (1) switch (_context3.prev = _context3.next) {
653
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
654
+ while (1) switch (_context2.prev = _context2.next) {
690
655
  case 0:
691
- _context3.next = 2;
656
+ _context2.next = 2;
692
657
  return checkInvitation();
693
658
  case 2:
694
- invitationMail = _context3.sent;
659
+ invitationMail = _context2.sent;
695
660
  if (invitationMail) {
696
661
  authorizationStore.close();
697
662
  authorizationStore.showRegister(invitationId, invitationMail);
698
663
  }
699
664
  case 4:
700
665
  case "end":
701
- return _context3.stop();
666
+ return _context2.stop();
702
667
  }
703
- }, _callee3);
668
+ }, _callee2);
704
669
  }));
705
670
  return function toRegister() {
706
671
  return _ref3.apply(this, arguments);
@@ -710,30 +675,30 @@ function WelcomeScreen (_ref) {
710
675
  return _checkInvitation.apply(this, arguments);
711
676
  }
712
677
  function _checkInvitation() {
713
- _checkInvitation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
714
- var _authorizationStore$s2;
678
+ _checkInvitation = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
679
+ var _authorizationStore$s;
715
680
  var invitationId, invitation;
716
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
717
- while (1) switch (_context4.prev = _context4.next) {
681
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
682
+ while (1) switch (_context3.prev = _context3.next) {
718
683
  case 0:
719
- invitationId = (_authorizationStore$s2 = authorizationStore.state) === null || _authorizationStore$s2 === void 0 ? void 0 : _authorizationStore$s2.invitationId;
720
- _context4.next = 3;
684
+ invitationId = (_authorizationStore$s = authorizationStore.state) === null || _authorizationStore$s === void 0 ? void 0 : _authorizationStore$s.invitationId;
685
+ _context3.next = 3;
721
686
  return authorizationHandler.getInvitationValue('email', invitationId);
722
687
  case 3:
723
- invitation = _context4.sent;
688
+ invitation = _context3.sent;
724
689
  if (!invitation) {
725
- _context4.next = 8;
690
+ _context3.next = 8;
726
691
  break;
727
692
  }
728
- return _context4.abrupt("return", invitation.email);
693
+ return _context3.abrupt("return", invitation.email);
729
694
  case 8:
730
695
  setInvitationError('Invitation not found');
731
- return _context4.abrupt("return", undefined);
696
+ return _context3.abrupt("return", undefined);
732
697
  case 10:
733
698
  case "end":
734
- return _context4.stop();
699
+ return _context3.stop();
735
700
  }
736
- }, _callee4);
701
+ }, _callee3);
737
702
  }));
738
703
  return _checkInvitation.apply(this, arguments);
739
704
  }
@@ -747,10 +712,10 @@ function WelcomeScreen (_ref) {
747
712
  children: [/*#__PURE__*/jsx("span", {}), /*#__PURE__*/jsx("div", {
748
713
  children: t(invitationError)
749
714
  })]
750
- }), isNewUser && !userFound && !invitationError && /*#__PURE__*/jsx(Button, {
715
+ }), isNewUser && !invitationError && /*#__PURE__*/jsx(Button, {
751
716
  onClick: toRegister,
752
717
  children: t('auth.title.register')
753
- }), userFound && !invitationError && /*#__PURE__*/jsx(Button, {
718
+ }), !isNewUser && !invitationError && /*#__PURE__*/jsx(Button, {
754
719
  onClick: toLogin,
755
720
  children: t('auth.button.login')
756
721
  })]
@@ -44,7 +44,7 @@ import { actions } from '@storybook/addon-actions';
44
44
  import * as Styles from '@mui/styles';
45
45
 
46
46
  (function() {
47
- const env = {"STAGE":"production","VERSION":"24.15.0-beta.40"};
47
+ const env = {"STAGE":"production","VERSION":"24.15.0-beta.42"};
48
48
  try {
49
49
  if (process) {
50
50
  process.env = Object.assign({}, process.env);
@@ -9470,7 +9470,7 @@ var SideMenu$1 = observer(SideMenu);
9470
9470
  function ownKeys$4(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; }
9471
9471
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9472
9472
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
9473
- return import('./ModalsWrapper-10fce47e.js');
9473
+ return import('./ModalsWrapper-c627b8e9.js');
9474
9474
  });
9475
9475
  function Fullscreen() {
9476
9476
  var _useDivaCoreContext = useDivaCoreContext(),
@@ -9918,10 +9918,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
9918
9918
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9919
9919
  var LOG$2 = getLogger('Framework', 'Root');
9920
9920
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
9921
- return import('./index-4db284a4.js');
9921
+ return import('./index-28ac6cb1.js');
9922
9922
  });
9923
9923
  var LazyModals = /*#__PURE__*/React.lazy(function () {
9924
- return import('./ModalsWrapper-10fce47e.js');
9924
+ return import('./ModalsWrapper-c627b8e9.js');
9925
9925
  });
9926
9926
  function ContentComponent() {
9927
9927
  var context = useDivaCoreContext();
@@ -1,4 +1,4 @@
1
- export { k as AnalyticsHandler, A as AuthorizationHandler, o as ClientArticleHandler, C as Content, p as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, n as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, a as getLogger, q as storyBookCoreMock, j as useDivaCore } from './index-600e89eb.js';
1
+ export { k as AnalyticsHandler, A as AuthorizationHandler, o as ClientArticleHandler, C as Content, p as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, n as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, a as getLogger, q as storyBookCoreMock, j as useDivaCore } from './index-db072047.js';
2
2
  export { DivaError, default as DivaUtils } from '@crystaldesign/diva-utils';
3
3
  export { Trans, useTranslation } from 'react-i18next';
4
4
  export * from '@crystaldesign/basket-model';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/WelcomeScreen/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,MAAM,CAAC,OAAO,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,qBA4D9I"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/elements/Auth/WelcomeScreen/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAKxC,MAAM,CAAC,OAAO,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,qBA4C9I"}