@crystaldesign/diva-core 25.11.0-rc.5 → 25.11.0-rc.7
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/{ModalsWrapper-0ad27e04.js → ModalsWrapper-4f41a458.js} +1 -1
- package/build/esm/{index-6acf64a9.js → index-bb87a892.js} +1 -1
- package/build/esm/{index-a8734e95.js → index-c7312a0e.js} +27 -9
- package/build/esm/index.js +1 -1
- package/build/types/core/src/store/BrowserStateStore.d.ts.map +1 -1
- package/build/types/core/src/utils/i18n.d.ts +2 -1
- package/build/types/core/src/utils/i18n.d.ts.map +1 -1
- package/build/umd/diva-core.umd.min.js +1 -1
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as styleInject, u as useDivaCoreContext } from './index-
|
|
1
|
+
import { s as styleInject, u as useDivaCoreContext } from './index-c7312a0e.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 { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-
|
|
1
|
+
import { s as styleInject, u as useDivaCoreContext, g as getLogger } from './index-c7312a0e.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';
|
|
@@ -46,7 +46,7 @@ import { actions } from '@storybook/addon-actions';
|
|
|
46
46
|
import * as Styles from '@mui/styles';
|
|
47
47
|
|
|
48
48
|
(function() {
|
|
49
|
-
const env = {"STAGE":"production","VERSION":"25.11.0-rc.
|
|
49
|
+
const env = {"STAGE":"production","VERSION":"25.11.0-rc.7"};
|
|
50
50
|
try {
|
|
51
51
|
if (process) {
|
|
52
52
|
process.env = Object.assign({}, process.env);
|
|
@@ -1610,9 +1610,10 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1610
1610
|
}]);
|
|
1611
1611
|
}();
|
|
1612
1612
|
|
|
1613
|
-
var instance = i18n.createInstance().use(HttpApi)
|
|
1613
|
+
var instance = i18n.createInstance().use(HttpApi);
|
|
1614
1614
|
function init(_ref) {
|
|
1615
|
-
var apiConfig = _ref.apiConfig
|
|
1615
|
+
var apiConfig = _ref.apiConfig,
|
|
1616
|
+
language = _ref.language;
|
|
1616
1617
|
if (instance.isInitialized) {
|
|
1617
1618
|
return Promise.resolve();
|
|
1618
1619
|
} else if (instance.isInitializing) {
|
|
@@ -1626,12 +1627,19 @@ function init(_ref) {
|
|
|
1626
1627
|
});
|
|
1627
1628
|
}
|
|
1628
1629
|
var loadPath = "".concat(apiConfig.adminService, "/locales?lng={{lng}}&ns={{ns}}");
|
|
1630
|
+
|
|
1631
|
+
//if the language is not fixed by parameter, use the language detector
|
|
1632
|
+
if (!language) {
|
|
1633
|
+
var languageDetector = new LanguageDetector();
|
|
1634
|
+
instance.use(languageDetector);
|
|
1635
|
+
}
|
|
1629
1636
|
return new Promise(function (resolve, reject) {
|
|
1630
1637
|
instance.on('initialized', function () {
|
|
1631
1638
|
resolve();
|
|
1632
1639
|
});
|
|
1633
1640
|
instance.init({
|
|
1634
1641
|
debug: false,
|
|
1642
|
+
lng: language,
|
|
1635
1643
|
defaultNS: 'default',
|
|
1636
1644
|
fallbackNS: 'default',
|
|
1637
1645
|
ns: ['default'],
|
|
@@ -3659,11 +3667,20 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3659
3667
|
};
|
|
3660
3668
|
state.organization = (_searchParams$get = searchParams.get('organizationId')) !== null && _searchParams$get !== void 0 ? _searchParams$get : undefined;
|
|
3661
3669
|
searchParams["delete"]('organizationId');
|
|
3670
|
+
|
|
3671
|
+
//for backwards compatibilty, if the channelId is set in the url, use that one as organization and update the url in the browser
|
|
3672
|
+
if (searchParams.get('channelId')) {
|
|
3673
|
+
state.organization = searchParams.get('channelId');
|
|
3674
|
+
searchParams["delete"]('channelId');
|
|
3675
|
+
currentUrl.searchParams.set('organizationId', state.organization);
|
|
3676
|
+
currentUrl.searchParams["delete"]('channelId');
|
|
3677
|
+
}
|
|
3662
3678
|
authdataString = searchParams.get('authdata') || undefined;
|
|
3663
3679
|
if (authdataString) {
|
|
3664
3680
|
state.authdata = JSON.parse(atob(authdataString));
|
|
3665
|
-
if ((_state$authdata = state.authdata) !== null && _state$authdata !== void 0 && _state$authdata.organizationId) {
|
|
3681
|
+
if ((_state$authdata = state.authdata) !== null && _state$authdata !== void 0 && _state$authdata.organizationId && state.organization != state.authdata.organizationId) {
|
|
3666
3682
|
state.organization = state.authdata.organizationId;
|
|
3683
|
+
currentUrl.searchParams.set('organizationId', state.organization);
|
|
3667
3684
|
}
|
|
3668
3685
|
}
|
|
3669
3686
|
searchParams["delete"]('lang');
|
|
@@ -3675,7 +3692,7 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3675
3692
|
currentUrl.searchParams["delete"]('authdata');
|
|
3676
3693
|
history.replaceState(null, '', currentUrl.href);
|
|
3677
3694
|
return _context.abrupt("return", state);
|
|
3678
|
-
case
|
|
3695
|
+
case 19:
|
|
3679
3696
|
case "end":
|
|
3680
3697
|
return _context.stop();
|
|
3681
3698
|
}
|
|
@@ -8412,7 +8429,8 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8412
8429
|
eventId: 'LOAD_CONFIG'
|
|
8413
8430
|
});
|
|
8414
8431
|
afterInitPromise = init({
|
|
8415
|
-
apiConfig: this.configurationStore.apiConfig
|
|
8432
|
+
apiConfig: this.configurationStore.apiConfig,
|
|
8433
|
+
language: language
|
|
8416
8434
|
}); //load core configuration based on initaly available information
|
|
8417
8435
|
_context.next = 15;
|
|
8418
8436
|
return this.configurationStore.fetchConfiguration({
|
|
@@ -9444,7 +9462,7 @@ var DrawerMenu = observer(MobileDrawer);
|
|
|
9444
9462
|
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; }
|
|
9445
9463
|
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; }
|
|
9446
9464
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
9447
|
-
return import('./ModalsWrapper-
|
|
9465
|
+
return import('./ModalsWrapper-4f41a458.js');
|
|
9448
9466
|
});
|
|
9449
9467
|
function Fullscreen(_ref) {
|
|
9450
9468
|
var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
|
|
@@ -9902,10 +9920,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
9902
9920
|
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; }
|
|
9903
9921
|
var LOG$2 = getLogger('Framework', 'Root');
|
|
9904
9922
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
9905
|
-
return import('./index-
|
|
9923
|
+
return import('./index-bb87a892.js');
|
|
9906
9924
|
});
|
|
9907
9925
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
9908
|
-
return import('./ModalsWrapper-
|
|
9926
|
+
return import('./ModalsWrapper-4f41a458.js');
|
|
9909
9927
|
});
|
|
9910
9928
|
function ContentComponent() {
|
|
9911
9929
|
var context = useDivaCoreContext();
|
package/build/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as AnalyticsHandler, A as AuthorizationHandler, d as ClientArticleHandler, C as Content, e as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, c as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, g as getLogger, f as storyBookCoreMock, a as useDivaCore } from './index-
|
|
1
|
+
export { b as AnalyticsHandler, A as AuthorizationHandler, d as ClientArticleHandler, C as Content, e as DivaMockProvider, H as HelpButton, O as ONE_DAY_UNIX, c as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, g as getLogger, f as storyBookCoreMock, a as useDivaCore } from './index-c7312a0e.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":"BrowserStateStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/BrowserStateStore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAA2B,MAAM,UAAU,CAAC;AAC5F,OAAO,SAAS,MAAM,aAAa,CAAC;AAUpC,MAAM,WAAW,YAAY;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAExB,OAAO,CAAC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OAAO,CAAC,uBAAuB;IAkC/B;;OAEG;IACH,OAAO,KAAK,gBAAgB,GAE3B;IAED;;OAEG;IACH,OAAO,CAAC,MAAM;IAId;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IAIlC;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;CAI7B"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ApiConfig } from '..';
|
|
2
2
|
declare let instance: import("i18next").i18n;
|
|
3
|
-
export declare function init({ apiConfig }: {
|
|
3
|
+
export declare function init({ apiConfig, language }: {
|
|
4
4
|
apiConfig: ApiConfig;
|
|
5
|
+
language?: string;
|
|
5
6
|
}): Promise<void>;
|
|
6
7
|
export declare function changeNamespace(namespace: string): Promise<void>;
|
|
7
8
|
export default instance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/utils/i18n.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,QAAA,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/utils/i18n.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,QAAA,IAAI,QAAQ,wBAAqC,CAAC;AAElD,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,iBAoDxF;AAED,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,iBAKtD;AAED,eAAe,QAAQ,CAAC"}
|