@fluid-topics/ft-app-context 2.1.19 → 2.1.20

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.
@@ -5,9 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { property } from "lit/decorators.js";
8
- import { redux } from "@fluid-topics/ft-wc-utils/build/redux";
8
+ import { redux, } from "@fluid-topics/ft-wc-utils/build/redux";
9
9
  import { DateFormatter } from "@fluid-topics/ft-wc-utils/build/DateFormatter";
10
- import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
10
+ import { ftAppInfoStore, } from "../redux-stores/FtAppInfoStore";
11
11
  import { applyMixinOnce } from "@fluid-topics/ft-wc-utils";
12
12
  export const withDateFormat = applyMixinOnce(Symbol("withDateFormat"), function (Class) {
13
13
  class FtLitElementWithDateFormatClass extends Class {
@@ -28,7 +28,7 @@ export declare class FtAppStateManager extends FtStateManager {
28
28
  private setAvailableContentLocales;
29
29
  reloadDebouncer: Debouncer;
30
30
  stopReloadDebouncer(): void;
31
- requestUiLocaleUpdate(uiLocale: string): void;
31
+ requestUiLocaleUpdate(uiLocale: string, contentLocale?: string): void;
32
32
  setMetadataConfiguration(metadataConfiguration?: FtMetadataConfiguration): void;
33
33
  setNoCustom(noCustom: boolean): void;
34
34
  setEditorMode(editorMode: boolean): void;
@@ -100,8 +100,8 @@ export class FtAppStateManager extends FtStateManager {
100
100
  stopReloadDebouncer() {
101
101
  this.reloadDebouncer.cancel();
102
102
  }
103
- requestUiLocaleUpdate(uiLocale) {
104
- this.userLocaleService.updateUiLocale({ uiLocale })
103
+ requestUiLocaleUpdate(uiLocale, contentLocale) {
104
+ this.userLocaleService.updateUiLocale({ uiLocale, contentLocale })
105
105
  .then((response) => {
106
106
  if (!response.uiLocaleChanged) {
107
107
  return;
@@ -122,6 +122,7 @@ export class UserAssetsActions {
122
122
  this.clearMySearches();
123
123
  this.clearMyBookmarks();
124
124
  }
125
+ // Used in GWT -> JsUserAssetAction
125
126
  clearMySearches() {
126
127
  this.savedSearchesService.clearCache();
127
128
  ftUserAssetsStore.actions.savedSearches(undefined);
@@ -139,6 +140,7 @@ export class UserAssetsActions {
139
140
  this.bookmarksService.clearCache();
140
141
  await this.updateBookmarksIfUsed();
141
142
  }
143
+ // Used in GWT -> JsUserAssetAction
142
144
  async reloadAssetLabels() {
143
145
  this.assetLabelsService.clearCache();
144
146
  const assetLabels = await this.assetLabelsService.getUserAssetLabels();
@@ -156,7 +158,7 @@ export class UserAssetsActions {
156
158
  ftUserAssetsStore.actions.setBookmarkCountByMap({ count: bookmarkCount.count, mapId: mapId });
157
159
  }
158
160
  }
159
- // Used in GWT
161
+ // Used in GWT -> JsUserAssetAction
160
162
  async reloadAssetCount(assetType) {
161
163
  this.assetCountsService.clearCache();
162
164
  const isBookmarkByMapStored = Object.keys(ftUserAssetsStore.getState().assetCounts.bookmarkByMap).length !== 0;
@@ -2,7 +2,7 @@ import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
2
2
  import { FtServiceWithCache } from "./FtServiceWithCache";
3
3
  export class BookmarksService extends FtServiceWithCache {
4
4
  async listMyBookmarks() {
5
- let session = ftAppInfoStore.getState().session;
5
+ const session = ftAppInfoStore.getState().session;
6
6
  if (!(session === null || session === void 0 ? void 0 : session.sessionAuthenticated)) {
7
7
  return [];
8
8
  }
@@ -52,12 +52,12 @@ export class FtAnalyticsEventsService extends FtServiceWithCache {
52
52
  sortEventArrays(object) {
53
53
  const entries = Object.entries(object).map(([key, value]) => {
54
54
  if (Array.isArray(value)) {
55
- return [key, value.map((val) => typeof val === 'object' && val != null && !Array.isArray(val) ? this.sortEventArrays(val) : val)
55
+ return [key, value.map((val) => typeof val === "object" && val != null && !Array.isArray(val) ? this.sortEventArrays(val) : val)
56
56
  .sort((a, b) => {
57
- if (typeof a === 'object' && a !== null && 'key' in a) {
57
+ if (typeof a === "object" && a !== null && "key" in a) {
58
58
  return a.key.localeCompare(b.key);
59
59
  }
60
- else if (typeof a === 'string' && typeof b === 'string') {
60
+ else if (typeof a === "string" && typeof b === "string") {
61
61
  return a.localeCompare(b);
62
62
  }
63
63
  else {
@@ -65,7 +65,7 @@ export class FtAnalyticsEventsService extends FtServiceWithCache {
65
65
  }
66
66
  })];
67
67
  }
68
- else if (typeof value === 'object' && value !== null) {
68
+ else if (typeof value === "object" && value !== null) {
69
69
  return [key, this.sortEventArrays(value)];
70
70
  }
71
71
  else {
@@ -79,7 +79,7 @@ export class FtAnalyticsEventsService extends FtServiceWithCache {
79
79
  return this.cache.get("analytics-event-" + this.hash(events), async () => {
80
80
  return (await this.awaitApi).sendEvents(events)
81
81
  .then(() => fakeResponse)
82
- .catch(reason => {
82
+ .catch((reason) => {
83
83
  console.info(errorMessage);
84
84
  console.debug(reason);
85
85
  return fakeResponse;
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
3
- import { CacheRegistry, CanceledPromiseError, deepEqual, delay, ParametrizedLabelResolver, withEventBus } from "@fluid-topics/ft-wc-utils";
3
+ import { CacheRegistry, CanceledPromiseError, deepEqual, delay, ParametrizedLabelResolver, withEventBus, } from "@fluid-topics/ft-wc-utils";
4
4
  import { FtServiceWithCache } from "./FtServiceWithCache";
5
5
  export class I18nContextLoadedEvent extends CustomEvent {
6
6
  constructor(detail) {
@@ -12,7 +12,7 @@ export class FtServiceWithCache extends FtService {
12
12
  .sort(([ka], [kb]) => ka.localeCompare(kb)));
13
13
  };
14
14
  // Have a different cache for each child class
15
- let constructor = this.constructor;
15
+ const constructor = this.constructor;
16
16
  constructor.commonCache = (_a = constructor.commonCache) !== null && _a !== void 0 ? _a : new CacheRegistry();
17
17
  this.cache = withCommonCache ? constructor.commonCache : new CacheRegistry();
18
18
  }
@@ -1,4 +1,4 @@
1
- import { highlightHtml } from "@fluid-topics/ft-wc-utils";
1
+ import { highlightHtml, } from "@fluid-topics/ft-wc-utils";
2
2
  export class HighlightHtmlService {
3
3
  highlightHtml(container, query, options) {
4
4
  highlightHtml(container, query, options);
@@ -1,9 +1,9 @@
1
1
  import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
2
- import { FtUserRole, userHasRole } from "@fluid-topics/public-api";
2
+ import { FtUserRole, userHasRole, } from "@fluid-topics/public-api";
3
3
  import { FtServiceWithCache } from "./FtServiceWithCache";
4
4
  export class SavedSearchesService extends FtServiceWithCache {
5
5
  async listMySearches() {
6
- let { session } = ftAppInfoStore.getState();
6
+ const { session } = ftAppInfoStore.getState();
7
7
  if (!userHasRole(session, FtUserRole.SAVED_SEARCH_USER)) {
8
8
  return [];
9
9
  }
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { applyMixinOnce, FtLitElement } from "@fluid-topics/ft-wc-utils";
7
+ import { applyMixinOnce, FtLitElement, } from "@fluid-topics/ft-wc-utils";
8
8
  import { state } from "lit/decorators.js";
9
9
  export const withHistory = applyMixinOnce(Symbol("withHistory"), function (ReduxClass) {
10
10
  class WithHistoryClass extends ReduxClass {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-app-context",
3
- "version": "2.1.19",
3
+ "version": "2.1.20",
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.19",
22
+ "@fluid-topics/ft-wc-utils": "2.1.20",
23
23
  "@lit/context": "1.1.6",
24
24
  "lit": "3.1.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@fluid-topics/public-api": "1.0.133"
27
+ "@fluid-topics/public-api": "1.0.136"
28
28
  },
29
- "gitHead": "c2c202986d05fbee1378d8dbb74fa609e89260ec"
29
+ "gitHead": "77e9f03085f977dde887e175b964bf66b862253f"
30
30
  }