@crystaldesign/diva-core 26.11.0-beta.17 → 26.11.0-beta.18

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 { s as styleInject, u as useDivaCoreContext } from './index-41786312.js';
1
+ import { s as styleInject, u as useDivaCoreContext } from './index-0658ef01.js';
2
2
  import { useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@mui/material/Button';
@@ -43,7 +43,7 @@ import HelpOutline from '@mui/icons-material/HelpOutline';
43
43
  import { actions } from '@storybook/addon-actions';
44
44
 
45
45
  (function() {
46
- const env = {"STAGE":"production","VERSION":"26.11.0-beta.17"};
46
+ const env = {"STAGE":"production","VERSION":"26.11.0-beta.18"};
47
47
  try {
48
48
  if (process) {
49
49
  process.env = Object.assign({}, process.env);
@@ -774,11 +774,29 @@ var DivaFramework = /*#__PURE__*/function (_HTMLElement) {
774
774
  }, {
775
775
  key: "connectedCallback",
776
776
  value: function connectedCallback() {
777
+ // A DOM move fires disconnected+connected on the same element — keep the existing tree.
778
+ if (this.mountPoint) {
779
+ this.render();
780
+ return;
781
+ }
777
782
  this.mountPoint = document.createElement('span');
778
783
  this.ref = /*#__PURE__*/React.createRef();
779
784
  this.appendChild(this.mountPoint);
780
785
  this.render();
781
786
  }
787
+ }, {
788
+ key: "disconnectedCallback",
789
+ value: function disconnectedCallback() {
790
+ var _this2 = this;
791
+ // Deferred so a DOM move (disconnected+connected in the same task) doesn't unmount;
792
+ // on a real removal the React tree must go down, or it keeps running detached.
793
+ queueMicrotask(function () {
794
+ if (_this2.isConnected || !_this2.mountPoint) return;
795
+ ReactDOM.unmountComponentAtNode(_this2.mountPoint);
796
+ _this2.mountPoint.remove();
797
+ _this2.mountPoint = undefined;
798
+ });
799
+ }
782
800
  }, {
783
801
  key: "onEvent",
784
802
  value: function onEvent(event) {
@@ -1007,7 +1025,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
1007
1025
  var _this$_configuration5, _organization$type, _organization$type$to, _this$_configuration6;
1008
1026
  var dataStore = this.root.dataStore;
1009
1027
  var organization = dataStore === null || dataStore === void 0 ? void 0 : dataStore.organization;
1010
- if (organization && (_this$_configuration5 = this._configuration) !== null && _this$_configuration5 !== void 0 && _this$_configuration5.components.openSellerDefaultForRetailer && organization.type == 'RETAILER') {
1028
+ if (organization && (_this$_configuration5 = this._configuration) !== null && _this$_configuration5 !== void 0 && (_this$_configuration5 = _this$_configuration5.components) !== null && _this$_configuration5 !== void 0 && _this$_configuration5.openSellerDefaultForRetailer && organization.type == 'RETAILER') {
1011
1029
  if (dataStore.userHasPermission('retail') && !dataStore.userHasPermission('acquisition') && !dataStore.userHasPermission('category_manager')) {
1012
1030
  return {
1013
1031
  type: 'SELLER'
@@ -1021,7 +1039,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
1021
1039
  type: 'ARCHIVE'
1022
1040
  };
1023
1041
  }
1024
- return (_this$_configuration6 = this._configuration) === null || _this$_configuration6 === void 0 ? void 0 : _this$_configuration6.components["default"];
1042
+ return (_this$_configuration6 = this._configuration) === null || _this$_configuration6 === void 0 || (_this$_configuration6 = _this$_configuration6.components) === null || _this$_configuration6 === void 0 ? void 0 : _this$_configuration6["default"];
1025
1043
  }
1026
1044
  }, {
1027
1045
  key: "locales",
@@ -1119,7 +1137,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
1119
1137
  qrCodeScanner: (_this$_configuration25 = this._configuration) === null || _this$_configuration25 === void 0 || (_this$_configuration25 = _this$_configuration25.navigation) === null || _this$_configuration25 === void 0 ? void 0 : _this$_configuration25.qrCodeScanner,
1120
1138
  greetingsText: (_this$_configuration26 = this._configuration) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.navigation) === null || _this$_configuration26 === void 0 ? void 0 : _this$_configuration26.greetingsText,
1121
1139
  showSnow: (_this$_configuration27 = this._configuration) === null || _this$_configuration27 === void 0 || (_this$_configuration27 = _this$_configuration27.navigation) === null || _this$_configuration27 === void 0 ? void 0 : _this$_configuration27.showSnow,
1122
- pricePreviewActive: ((_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.settings) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.pricePreview) && this.root.dataStore.organization.settings.pricePreview !== 'off' || ((_this$_configuration28 = this._configuration) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.components.available) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.find(function (c) {
1140
+ pricePreviewActive: ((_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.settings) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.pricePreview) && this.root.dataStore.organization.settings.pricePreview !== 'off' || ((_this$_configuration28 = this._configuration) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.components) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.available) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.find(function (c) {
1123
1141
  return c.type === 'DIVA_WEBPLANNER';
1124
1142
  })) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.settings) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.ViewConfig) === null || _this$_configuration28 === void 0 ? void 0 : _this$_configuration28.pricePreview)
1125
1143
  };
@@ -11123,7 +11141,7 @@ var DrawerMenu$1 = observer(DrawerMenu);
11123
11141
  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; }
11124
11142
  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; }
11125
11143
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
11126
- return import('./ModalsWrapper-679c664c.js');
11144
+ return import('./ModalsWrapper-044be213.js');
11127
11145
  });
11128
11146
  function Fullscreen(_ref) {
11129
11147
  var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
@@ -11585,10 +11603,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
11585
11603
  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; }
11586
11604
  var LOG$2 = getLogger('Framework', 'Root');
11587
11605
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
11588
- return import('./index-7d0553fb.js');
11606
+ return import('./index-c01d55e9.js');
11589
11607
  });
11590
11608
  var LazyModals = /*#__PURE__*/React.lazy(function () {
11591
- return import('./ModalsWrapper-679c664c.js');
11609
+ return import('./ModalsWrapper-044be213.js');
11592
11610
  });
11593
11611
  function ContentComponent() {
11594
11612
  var context = useDivaCoreContext();
@@ -1,4 +1,4 @@
1
- import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-41786312.js';
1
+ import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-0658ef01.js';
2
2
  import { forwardRef, useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -1,4 +1,4 @@
1
- export { d as AnalyticsHandler, A as AuthorizationHandler, f as ClientArticleHandler, C as Content, h as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, e as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, c as getUserAgentInfo, i as i18n, j as storyBookCoreMock, a as useDivaCore } from './index-41786312.js';
1
+ export { d as AnalyticsHandler, A as AuthorizationHandler, f as ClientArticleHandler, C as Content, h as DivaMockProvider, D as DrawerMenuComponent, H as HelpButton, O as ONE_DAY_UNIX, e as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, b as default, g as getLogger, c as getUserAgentInfo, i as i18n, j as storyBookCoreMock, a as useDivaCore } from './index-0658ef01.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';