@fluid-topics/ft-app-context 2.1.15 → 2.1.16
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/ft-app-context.light.js +2 -2
- package/build/ft-app-context.min.js +7 -7
- package/build/redux-stores/FtAppInfoStore.d.ts +2 -7
- package/build/redux-stores/FtAppInfoStore.js +1 -6
- package/build/redux-stores/FtAppStateManager.d.ts +1 -2
- package/build/redux-stores/FtAppStateManager.js +2 -10
- package/build/services/SearchPlaceConverterProvider.js +3 -3
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FtReduxStore, Optional } from "@fluid-topics/ft-wc-utils";
|
|
2
|
-
import {
|
|
2
|
+
import { FtLocalesConfiguration, FtMetadataConfiguration, FtPrivacyPolicyConfiguration, FtSearchLocale, FtSession, FtUserLocaleSummary } from "@fluid-topics/public-api";
|
|
3
3
|
import { PayloadAction } from "@reduxjs/toolkit";
|
|
4
4
|
export declare const FtAppInfoStoreName = "ft-app-info";
|
|
5
5
|
export interface FtAppInfoState {
|
|
@@ -7,13 +7,8 @@ export interface FtAppInfoState {
|
|
|
7
7
|
apiIntegrationIdentifier: Optional<string>;
|
|
8
8
|
apiIntegrationAppVersion: Optional<string>;
|
|
9
9
|
uiLocale: string;
|
|
10
|
-
availableUiLocales: Array<FtUiLocale>;
|
|
11
10
|
availableContentLocales: Array<FtSearchLocale>;
|
|
12
|
-
|
|
13
|
-
searchInAllLanguagesAllowed: boolean;
|
|
14
|
-
searchLanguageSetsUiLanguage: boolean;
|
|
15
|
-
uiLanguageSetsSearchLanguage: boolean;
|
|
16
|
-
uiLanguageSetsReaderLanguage: boolean;
|
|
11
|
+
localesConfiguration: Optional<FtLocalesConfiguration>;
|
|
17
12
|
metadataConfiguration: Optional<FtMetadataConfiguration>;
|
|
18
13
|
privacyPolicyConfiguration: Optional<FtPrivacyPolicyConfiguration>;
|
|
19
14
|
editorMode: boolean;
|
|
@@ -28,13 +28,8 @@ export const ftAppInfoStore = FtReduxStore.get({
|
|
|
28
28
|
apiIntegrationIdentifier: undefined,
|
|
29
29
|
apiIntegrationAppVersion: undefined,
|
|
30
30
|
uiLocale: document.documentElement.lang || "en-US",
|
|
31
|
-
availableUiLocales: [],
|
|
32
31
|
availableContentLocales: [],
|
|
33
|
-
|
|
34
|
-
searchInAllLanguagesAllowed: false,
|
|
35
|
-
searchLanguageSetsUiLanguage: false,
|
|
36
|
-
uiLanguageSetsSearchLanguage: false,
|
|
37
|
-
uiLanguageSetsReaderLanguage: false,
|
|
32
|
+
localesConfiguration: undefined,
|
|
38
33
|
metadataConfiguration: undefined,
|
|
39
34
|
privacyPolicyConfiguration: undefined,
|
|
40
35
|
editorMode: false,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Debouncer, FtReduxStore, FtStateManager } from "@fluid-topics/ft-wc-utils";
|
|
2
2
|
import { FtAppInfoState, FtAppInfoStateReducers } from "./FtAppInfoStore";
|
|
3
|
-
import { FluidTopicsApi,
|
|
3
|
+
import { FluidTopicsApi, FtMetadataConfiguration, FtSession } from "@fluid-topics/public-api";
|
|
4
4
|
import { UserLocaleService } from "../services/user/UserLocaleService";
|
|
5
5
|
export declare class FtAppStateManager extends FtStateManager {
|
|
6
6
|
readonly store: FtReduxStore<FtAppInfoState, FtAppInfoStateReducers>;
|
|
@@ -8,7 +8,6 @@ export declare class FtAppStateManager extends FtStateManager {
|
|
|
8
8
|
readonly apiProvider: () => FluidTopicsApi | undefined;
|
|
9
9
|
private cache;
|
|
10
10
|
withManualResources: boolean;
|
|
11
|
-
localesConfiguration: FtLocalesConfiguration | null;
|
|
12
11
|
userLocaleService: UserLocaleService;
|
|
13
12
|
constructor(store: FtReduxStore<FtAppInfoState, FtAppInfoStateReducers>, apiProvider?: () => FluidTopicsApi | undefined);
|
|
14
13
|
setWithManualResources(withManualResources: boolean): void;
|
|
@@ -12,7 +12,6 @@ export class FtAppStateManager extends FtStateManager {
|
|
|
12
12
|
this.store = store;
|
|
13
13
|
this.cache = new CacheRegistry();
|
|
14
14
|
this.withManualResources = true;
|
|
15
|
-
this.localesConfiguration = null;
|
|
16
15
|
this.userLocaleService = new UserLocaleService();
|
|
17
16
|
this.cleanSessionDebouncer = new Debouncer();
|
|
18
17
|
this.reloadDebouncer = new Debouncer(500);
|
|
@@ -35,7 +34,7 @@ export class FtAppStateManager extends FtStateManager {
|
|
|
35
34
|
this.updateMetadataConfiguration();
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
if (this.localesConfiguration == null) {
|
|
37
|
+
if (this.store.getState().localesConfiguration == null) {
|
|
39
38
|
this.updateLocalesConfiguration();
|
|
40
39
|
}
|
|
41
40
|
if (this.store.getState().availableContentLocales == null || this.store.getState().availableContentLocales.length == 0) {
|
|
@@ -88,14 +87,7 @@ export class FtAppStateManager extends FtStateManager {
|
|
|
88
87
|
this.store.actions.uiLocale(uiLocale);
|
|
89
88
|
}
|
|
90
89
|
setLocalesConfiguration(localesConfiguration) {
|
|
91
|
-
|
|
92
|
-
this.localesConfiguration = localesConfiguration;
|
|
93
|
-
this.store.actions.defaultLocales(this.localesConfiguration.defaultLocales);
|
|
94
|
-
this.store.actions.availableUiLocales((_a = this.localesConfiguration.availableUiLocales) !== null && _a !== void 0 ? _a : []);
|
|
95
|
-
this.store.actions.searchInAllLanguagesAllowed((_b = this.localesConfiguration.allLanguagesAllowed) !== null && _b !== void 0 ? _b : false);
|
|
96
|
-
this.store.actions.searchLanguageSetsUiLanguage((_c = this.localesConfiguration.searchLanguageSetsUiLanguage) !== null && _c !== void 0 ? _c : false);
|
|
97
|
-
this.store.actions.uiLanguageSetsSearchLanguage((_d = this.localesConfiguration.uiLanguageSetsSearchLanguage) !== null && _d !== void 0 ? _d : false);
|
|
98
|
-
this.store.actions.uiLanguageSetsReaderLanguage((_e = this.localesConfiguration.uiLanguageSetsReaderLanguage) !== null && _e !== void 0 ? _e : false);
|
|
90
|
+
this.store.actions.localesConfiguration(localesConfiguration);
|
|
99
91
|
setTimeout(() => this.updateIfNeeded());
|
|
100
92
|
}
|
|
101
93
|
setAvailableContentLocales(availableContentLocales) {
|
|
@@ -2,9 +2,9 @@ import { SearchPlaceConverter } from "@fluid-topics/ft-wc-utils";
|
|
|
2
2
|
import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
|
|
3
3
|
export class SearchPlaceConverterProvider {
|
|
4
4
|
static get(defaultPerPage, defaultContentLocale) {
|
|
5
|
-
var _a, _b;
|
|
5
|
+
var _a, _b, _c, _d;
|
|
6
6
|
const appInfo = ftAppInfoStore.getState();
|
|
7
|
-
const { lang, region } = (_b = (_a = appInfo.
|
|
8
|
-
return new SearchPlaceConverter(appInfo.baseUrl, defaultPerPage !== null && defaultPerPage !== void 0 ? defaultPerPage : 20, appInfo.
|
|
7
|
+
const { lang, region } = (_c = (_b = (_a = appInfo.localesConfiguration) === null || _a === void 0 ? void 0 : _a.defaultLocales) === null || _b === void 0 ? void 0 : _b.defaultContentLocale) !== null && _c !== void 0 ? _c : { lang: "en", region: "US" };
|
|
8
|
+
return new SearchPlaceConverter(appInfo.baseUrl, defaultPerPage !== null && defaultPerPage !== void 0 ? defaultPerPage : 20, (_d = appInfo.localesConfiguration) === null || _d === void 0 ? void 0 : _d.allLanguagesAllowed, defaultContentLocale !== null && defaultContentLocale !== void 0 ? defaultContentLocale : `${lang}-${region}`);
|
|
9
9
|
}
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-app-context",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.16",
|
|
4
4
|
"description": "Global application context for Fluid Topics integrations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "2.1.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "2.1.16",
|
|
23
23
|
"@lit/context": "1.1.6",
|
|
24
24
|
"lit": "3.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@fluid-topics/public-api": "1.0.129"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "64057d048f5055bec9279a012204c826d10bc8fc"
|
|
30
30
|
}
|