@fluid-topics/ft-app-context 2.2.17 → 2.2.19
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 +3 -3
- package/build/ft-app-context.min.js +17 -17
- package/build/mixins/withDateFormat.js +3 -2
- package/build/redux-stores/FtUserAssetsStore.js +1 -2
- package/build/services/DateService.js +4 -3
- package/build/services/FtI18nService.js +2 -1
- package/build/services/SearchPlaceConverterProvider.js +4 -3
- package/build/services/history/HistoryService.js +4 -2
- package/package.json +4 -4
|
@@ -26,7 +26,8 @@ export const withDateFormat = applyMixinOnce(Symbol("withDateFormat"), function
|
|
|
26
26
|
|| props.has("uiLocale");
|
|
27
27
|
}
|
|
28
28
|
getDateFormatter(metadataKey) {
|
|
29
|
-
var _a
|
|
29
|
+
var _a;
|
|
30
|
+
var _b;
|
|
30
31
|
const isDateMetadata = (_b = (_a = this.metadataDescriptors.find((descriptor) => descriptor.key === metadataKey)) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : false;
|
|
31
32
|
return isDateMetadata ? (value) => DateFormatter.format(value, this.uiLocale, this.useLongDateFormat, this.useDateTimeFormat) : undefined;
|
|
32
33
|
}
|
|
@@ -38,7 +39,7 @@ export const withDateFormat = applyMixinOnce(Symbol("withDateFormat"), function
|
|
|
38
39
|
property({ type: Boolean })
|
|
39
40
|
], FtLitElementWithDateFormatClass.prototype, "useDateTimeFormat", void 0);
|
|
40
41
|
__decorate([
|
|
41
|
-
redux({ store: ftAppInfoStore.name, selector: (s) => { var _a
|
|
42
|
+
redux({ store: ftAppInfoStore.name, selector: (s) => { var _a; var _b; return (_b = (_a = s.metadataConfiguration) === null || _a === void 0 ? void 0 : _a.descriptors) !== null && _b !== void 0 ? _b : []; } })
|
|
42
43
|
], FtLitElementWithDateFormatClass.prototype, "metadataDescriptors", void 0);
|
|
43
44
|
__decorate([
|
|
44
45
|
redux({ store: ftAppInfoStore.name })
|
|
@@ -51,8 +51,7 @@ const getAssetsByType = (state, assetType) => {
|
|
|
51
51
|
var _a;
|
|
52
52
|
const stateKey = assetTypeToStateKey[assetType];
|
|
53
53
|
return stateKey
|
|
54
|
-
? (_a = state[stateKey]) !== null && _a !== void 0 ? _a : []
|
|
55
|
-
: [];
|
|
54
|
+
? (_a = state[stateKey]) !== null && _a !== void 0 ? _a : [] : [];
|
|
56
55
|
};
|
|
57
56
|
const updateAssetsByType = (state, assetType, assets) => {
|
|
58
57
|
const stateKey = assetTypeToStateKey[assetType];
|
|
@@ -2,9 +2,10 @@ import { DateFormatter, } from "@fluid-topics/ft-wc-utils";
|
|
|
2
2
|
import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
|
|
3
3
|
export class DateService {
|
|
4
4
|
isDate(metadataKey) {
|
|
5
|
-
var _a, _b
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var _a, _b;
|
|
6
|
+
var _c, _d;
|
|
7
|
+
const descriptors = (_c = (_a = ftAppInfoStore.getState().metadataConfiguration) === null || _a === void 0 ? void 0 : _a.descriptors) !== null && _c !== void 0 ? _c : [];
|
|
8
|
+
return (_d = (_b = descriptors.find((descriptor) => descriptor.key === metadataKey)) === null || _b === void 0 ? void 0 : _b.date) !== null && _d !== void 0 ? _d : false;
|
|
8
9
|
}
|
|
9
10
|
format(date, options) {
|
|
10
11
|
var _a, _b, _c, _d;
|
|
@@ -59,7 +59,8 @@ export class FtI18nServiceInternalClass extends withEventBus(FtServiceWithCache)
|
|
|
59
59
|
return this.fetchContext(name);
|
|
60
60
|
}
|
|
61
61
|
resolveContext(contextName) {
|
|
62
|
-
var _b
|
|
62
|
+
var _b;
|
|
63
|
+
var _c;
|
|
63
64
|
this.fetchContext(contextName);
|
|
64
65
|
return (_c = (_b = this.cache.getNow(contextName)) === null || _b === void 0 ? void 0 : _b.messages) !== null && _c !== void 0 ? _c : {};
|
|
65
66
|
}
|
|
@@ -2,9 +2,10 @@ 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, _c
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
var _d;
|
|
6
7
|
const appInfo = ftAppInfoStore.getState();
|
|
7
|
-
const { lang, region } = (
|
|
8
|
-
return new SearchPlaceConverter(appInfo.baseUrl, defaultPerPage !== null && defaultPerPage !== void 0 ? defaultPerPage : 20, (
|
|
8
|
+
const { lang, region } = (_d = (_b = (_a = appInfo.localesConfiguration) === null || _a === void 0 ? void 0 : _a.defaultLocales) === null || _b === void 0 ? void 0 : _b.defaultContentLocale) !== null && _d !== void 0 ? _d : { lang: "en", region: "US" };
|
|
9
|
+
return new SearchPlaceConverter(appInfo.baseUrl, defaultPerPage !== null && defaultPerPage !== void 0 ? defaultPerPage : 20, (_c = appInfo.localesConfiguration) === null || _c === void 0 ? void 0 : _c.allLanguagesAllowed, defaultContentLocale !== null && defaultContentLocale !== void 0 ? defaultContentLocale : `${lang}-${region}`);
|
|
9
10
|
}
|
|
10
11
|
}
|
|
@@ -6,7 +6,8 @@ export class HistoryService extends WithEventBus {
|
|
|
6
6
|
return new HistoryService(window.history, historyStorage, () => window.location, false);
|
|
7
7
|
}
|
|
8
8
|
constructor(history, historyStorage, windowLocation, initDataInstantly) {
|
|
9
|
-
var _a
|
|
9
|
+
var _a;
|
|
10
|
+
var _b;
|
|
10
11
|
super();
|
|
11
12
|
this.history = history;
|
|
12
13
|
this.historyStorage = historyStorage;
|
|
@@ -170,7 +171,8 @@ export class HistoryService extends WithEventBus {
|
|
|
170
171
|
return higherDefinedStatePositionInTheSameMajorState;
|
|
171
172
|
}
|
|
172
173
|
buildCurrentState() {
|
|
173
|
-
var _a
|
|
174
|
+
var _a;
|
|
175
|
+
var _b;
|
|
174
176
|
return {
|
|
175
177
|
...this.history.state,
|
|
176
178
|
index: this.currentIndex,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-app-context",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.19",
|
|
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.2.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "2.2.19",
|
|
23
23
|
"@lit/context": "1.1.6",
|
|
24
24
|
"lit": "3.3.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@fluid-topics/public-api": "1.0.
|
|
27
|
+
"@fluid-topics/public-api": "1.0.143"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "1ae520afe5e3697dee3c95ba254b53a8f7850594"
|
|
30
30
|
}
|