@fluid-topics/ft-app-context 1.3.26 → 1.3.28

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.
@@ -6,5 +6,5 @@ export type FtLitElementWithDateFormatInterface = {
6
6
  getDateFormatter(metadataKey: string): ((value: string) => string) | undefined;
7
7
  };
8
8
  type FtLitElementWithDateFormatType<T extends Constructor<FtLitElementRedux>> = T & Constructor<FtLitElementWithDateFormatInterface>;
9
- export declare function withDateFormat<T extends Constructor<FtLitElementRedux>>(Class: T): FtLitElementWithDateFormatType<T>;
9
+ export declare const withDateFormat: <T extends Constructor<FtLitElementRedux>>(c: T) => FtLitElementWithDateFormatType<T>;
10
10
  export {};
@@ -8,7 +8,8 @@ import { property } from "lit/decorators.js";
8
8
  import { redux } from "@fluid-topics/ft-wc-utils/build/redux";
9
9
  import { DateFormatter } from "@fluid-topics/ft-wc-utils/build/DateFormatter";
10
10
  import { ftAppInfoStore } from "../redux-stores/FtAppInfoStore";
11
- export function withDateFormat(Class) {
11
+ import { applyMixinOnce } from "@fluid-topics/ft-wc-utils";
12
+ export const withDateFormat = applyMixinOnce(Symbol("withDateFormat"), function (Class) {
12
13
  class FtLitElementWithDateFormatClass extends Class {
13
14
  constructor(...props) {
14
15
  super(props);
@@ -26,7 +27,7 @@ export function withDateFormat(Class) {
26
27
  }
27
28
  getDateFormatter(metadataKey) {
28
29
  var _a, _b;
29
- 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;
30
+ 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;
30
31
  return isDateMetadata ? (value) => DateFormatter.format(value, this.uiLocale, this.useLongDateFormat, this.useDateTimeFormat) : undefined;
31
32
  }
32
33
  }
@@ -43,4 +44,4 @@ export function withDateFormat(Class) {
43
44
  redux({ store: ftAppInfoStore.name })
44
45
  ], FtLitElementWithDateFormatClass.prototype, "uiLocale", void 0);
45
46
  return FtLitElementWithDateFormatClass;
46
- }
47
+ });
@@ -6,7 +6,7 @@ export interface WithHistoryInterface extends EventTarget {
6
6
  forwardItem?: HistoryState;
7
7
  }
8
8
  export type WithHistoryComponentType<T extends Constructor<FtLitElement>> = T & Constructor<WithHistoryInterface>;
9
- export declare function withHistory<T extends Constructor<FtLitElement>>(ReduxClass: T): WithHistoryComponentType<T>;
9
+ export declare const withHistory: <T extends Constructor<FtLitElement>>(c: T) => WithHistoryComponentType<T>;
10
10
  declare const WithHistory_base: WithHistoryComponentType<typeof FtLitElement>;
11
11
  export declare class WithHistory extends WithHistory_base {
12
12
  }
@@ -4,9 +4,9 @@ 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 { 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
- export function withHistory(ReduxClass) {
9
+ export const withHistory = applyMixinOnce(Symbol("withHistory"), function (ReduxClass) {
10
10
  class WithHistoryClass extends ReduxClass {
11
11
  constructor() {
12
12
  super(...arguments);
@@ -36,6 +36,6 @@ export function withHistory(ReduxClass) {
36
36
  state()
37
37
  ], WithHistoryClass.prototype, "currentItem", void 0);
38
38
  return WithHistoryClass;
39
- }
39
+ });
40
40
  export class WithHistory extends withHistory(FtLitElement) {
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-app-context",
3
- "version": "1.3.26",
3
+ "version": "1.3.28",
4
4
  "description": "Global application context for Fluid Topics integrations",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
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": "1.3.26",
22
+ "@fluid-topics/ft-wc-utils": "1.3.28",
23
23
  "lit": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-topics/public-api": "1.0.105"
26
+ "@fluid-topics/public-api": "1.0.106"
27
27
  },
28
- "gitHead": "2801b1f3a132753af33d5d62b8001164737e2a4f"
28
+ "gitHead": "face2509aeead24e78a16af4ffd2123ef281dac2"
29
29
  }