@ethlete/core 0.2.0-next.7 → 0.2.0-next.9

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.
Files changed (81) hide show
  1. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  2. package/esm2020/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
  3. package/esm2020/lib/directives/destroy/destroy.directive.mjs +3 -3
  4. package/esm2020/lib/directives/let/let.directive.mjs +3 -3
  5. package/esm2020/lib/directives/observe-content/observe-content.directive.mjs +3 -3
  6. package/esm2020/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
  7. package/esm2020/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
  8. package/esm2020/lib/directives/public-api.mjs +2 -1
  9. package/esm2020/lib/directives/repeat/repeat.directive.mjs +3 -3
  10. package/esm2020/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
  11. package/esm2020/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
  12. package/esm2020/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
  13. package/esm2020/lib/directives/seo/public-api.mjs +5 -0
  14. package/esm2020/lib/directives/seo/seo.directive.constants.mjs +3 -0
  15. package/esm2020/lib/directives/seo/seo.directive.mjs +166 -0
  16. package/esm2020/lib/directives/seo/seo.directive.types.mjs +2 -0
  17. package/esm2020/lib/directives/seo/seo.directive.utils.mjs +7 -0
  18. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +15 -0
  19. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.mjs +2 -0
  20. package/esm2020/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.mjs +34 -0
  21. package/esm2020/lib/pipes/normalize-game-result-type/public-api.mjs +4 -0
  22. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +15 -0
  23. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.types.mjs +2 -0
  24. package/esm2020/lib/pipes/normalize-match-participants/normalize-match-participants.util.mjs +47 -0
  25. package/esm2020/lib/pipes/normalize-match-participants/public-api.mjs +4 -0
  26. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +15 -0
  27. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.types.mjs +2 -0
  28. package/esm2020/lib/pipes/normalize-match-score/normalize-match-score.util.mjs +126 -0
  29. package/esm2020/lib/pipes/normalize-match-score/public-api.mjs +4 -0
  30. package/esm2020/lib/pipes/normalize-match-state/index.mjs +2 -0
  31. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.constants.mjs +2 -0
  32. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +15 -0
  33. package/esm2020/lib/pipes/normalize-match-state/normalize-match-state.util.mjs +19 -0
  34. package/esm2020/lib/pipes/normalize-match-state/public-api.mjs +4 -0
  35. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +15 -0
  36. package/esm2020/lib/pipes/normalize-match-type/normalize-match-type.util.mjs +38 -0
  37. package/esm2020/lib/pipes/normalize-match-type/public-api.mjs +3 -0
  38. package/esm2020/lib/pipes/public-api.mjs +6 -1
  39. package/esm2020/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  40. package/esm2020/lib/services/click-observer.service.mjs +6 -6
  41. package/esm2020/lib/services/content-observer.service.mjs +6 -6
  42. package/esm2020/lib/services/destroy.service.mjs +3 -3
  43. package/esm2020/lib/services/focus-visible.service.mjs +3 -3
  44. package/esm2020/lib/services/resize-observer.service.mjs +6 -6
  45. package/esm2020/lib/services/viewport.service.mjs +3 -3
  46. package/esm2020/lib/types/i18n.types.mjs +2 -0
  47. package/esm2020/lib/types/public-api.mjs +3 -2
  48. package/fesm2015/ethlete-core.mjs +549 -64
  49. package/fesm2015/ethlete-core.mjs.map +1 -1
  50. package/fesm2020/ethlete-core.mjs +556 -64
  51. package/fesm2020/ethlete-core.mjs.map +1 -1
  52. package/lib/directives/public-api.d.ts +1 -0
  53. package/lib/directives/seo/public-api.d.ts +4 -0
  54. package/lib/directives/seo/seo.directive.constants.d.ts +3 -0
  55. package/lib/directives/seo/seo.directive.d.ts +21 -0
  56. package/lib/directives/seo/seo.directive.types.d.ts +51 -0
  57. package/lib/directives/seo/seo.directive.utils.d.ts +2 -0
  58. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.d.ts +7 -0
  59. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.types.d.ts +4 -0
  60. package/lib/pipes/normalize-game-result-type/normalize-game-result-type.util.d.ts +2 -0
  61. package/lib/pipes/normalize-game-result-type/public-api.d.ts +3 -0
  62. package/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.d.ts +7 -0
  63. package/lib/pipes/normalize-match-participants/normalize-match-participants.types.d.ts +21 -0
  64. package/lib/pipes/normalize-match-participants/normalize-match-participants.util.d.ts +4 -0
  65. package/lib/pipes/normalize-match-participants/public-api.d.ts +3 -0
  66. package/lib/pipes/normalize-match-score/normalize-match-score.pipe.d.ts +7 -0
  67. package/lib/pipes/normalize-match-score/normalize-match-score.types.d.ts +12 -0
  68. package/lib/pipes/normalize-match-score/normalize-match-score.util.d.ts +27 -0
  69. package/lib/pipes/normalize-match-score/public-api.d.ts +3 -0
  70. package/lib/pipes/normalize-match-state/index.d.ts +1 -0
  71. package/lib/pipes/normalize-match-state/normalize-match-state.constants.d.ts +7 -0
  72. package/lib/pipes/normalize-match-state/normalize-match-state.pipe.d.ts +7 -0
  73. package/lib/pipes/normalize-match-state/normalize-match-state.util.d.ts +3 -0
  74. package/lib/pipes/normalize-match-state/public-api.d.ts +3 -0
  75. package/lib/pipes/normalize-match-type/normalize-match-type.pipe.d.ts +7 -0
  76. package/lib/pipes/normalize-match-type/normalize-match-type.util.d.ts +3 -0
  77. package/lib/pipes/normalize-match-type/public-api.d.ts +2 -0
  78. package/lib/pipes/public-api.d.ts +5 -0
  79. package/lib/types/i18n.types.d.ts +4 -0
  80. package/lib/types/public-api.d.ts +2 -1
  81. package/package.json +4 -2
@@ -9,3 +9,4 @@ export * from './repeat/public-api';
9
9
  export * from './scroll-observer-first-element/public-api';
10
10
  export * from './scroll-observer-ignore-target/public-api';
11
11
  export * from './scroll-observer-last-element/public-api';
12
+ export * from './seo/public-api';
@@ -0,0 +1,4 @@
1
+ export * from './seo.directive';
2
+ export * from './seo.directive.constants';
3
+ export * from './seo.directive.types';
4
+ export * from './seo.directive.utils';
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { SeoDirective } from './seo.directive';
3
+ export declare const SEO_DIRECTIVE_TOKEN: InjectionToken<SeoDirective>;
@@ -0,0 +1,21 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { SeoConfig } from './seo.directive.types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SeoDirective implements OnInit, OnDestroy {
5
+ private readonly _metaService;
6
+ private readonly _titleService;
7
+ private readonly _onDeactivate$;
8
+ private _isDeactivated;
9
+ readonly parent: SeoDirective | null;
10
+ get config(): SeoConfig;
11
+ private _config;
12
+ ngOnInit(): void;
13
+ ngOnDestroy(): void;
14
+ updateConfig(config: SeoConfig): void;
15
+ _activate(): void;
16
+ _deactivate(): void;
17
+ private _update;
18
+ private _cleanUp;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<SeoDirective, never>;
20
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SeoDirective, never, never, {}, {}, never, never, true, never>;
21
+ }
@@ -0,0 +1,51 @@
1
+ import { Observable } from 'rxjs';
2
+ export declare type MaybeObservable<T> = T | Observable<T>;
3
+ export interface SeoConfig {
4
+ title?: MaybeObservable<string>;
5
+ description?: MaybeObservable<string>;
6
+ keywords?: MaybeObservable<string[]>;
7
+ icon?: MaybeObservable<string>;
8
+ themeColor?: MaybeObservable<string>;
9
+ colorScheme?: MaybeObservable<'light' | 'dark'>;
10
+ robots?: MaybeObservable<string>;
11
+ canonical?: MaybeObservable<string>;
12
+ alternate?: MaybeObservable<AlternateLink>[];
13
+ og?: MaybeObservable<OpenGraph>;
14
+ twitter?: MaybeObservable<TwitterCard>;
15
+ facebook?: MaybeObservable<FacebookCard>;
16
+ [key: string]: MaybeObservable<unknown>;
17
+ }
18
+ export interface AlternateLink {
19
+ href: string;
20
+ hreflang: string;
21
+ }
22
+ export interface OpenGraph {
23
+ title?: MaybeObservable<string>;
24
+ description?: MaybeObservable<string>;
25
+ type?: MaybeObservable<string>;
26
+ url?: MaybeObservable<string>;
27
+ image?: MaybeObservable<string>;
28
+ siteName?: MaybeObservable<string>;
29
+ locale?: MaybeObservable<string>;
30
+ localeAlternate?: MaybeObservable<string[]>;
31
+ }
32
+ export interface TwitterCard {
33
+ card?: MaybeObservable<string>;
34
+ site?: MaybeObservable<string>;
35
+ creator?: MaybeObservable<string>;
36
+ title?: MaybeObservable<string>;
37
+ description?: MaybeObservable<string>;
38
+ image?: MaybeObservable<string>;
39
+ imageAlt?: MaybeObservable<string>;
40
+ }
41
+ export interface FacebookCard {
42
+ title?: MaybeObservable<string>;
43
+ description?: MaybeObservable<string>;
44
+ image?: MaybeObservable<string>;
45
+ imageAlt?: MaybeObservable<string>;
46
+ type?: MaybeObservable<string>;
47
+ url?: MaybeObservable<string>;
48
+ siteName?: MaybeObservable<string>;
49
+ locale?: MaybeObservable<string>;
50
+ localeAlternate?: MaybeObservable<string[]>;
51
+ }
@@ -0,0 +1,2 @@
1
+ import { SeoConfig } from './seo.directive.types';
2
+ export declare const mergeSeoConfig: (config: SeoConfig, parentConfig: SeoConfig) => SeoConfig;
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NormalizeGameResultTypePipe implements PipeTransform {
4
+ transform: (type: string | null) => import("@ethlete/core").NormalizedGameResultType | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeGameResultTypePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<NormalizeGameResultTypePipe, "etNormalizeGameResultType", true>;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { Translatable } from '../../types';
2
+ export interface NormalizedGameResultType extends Translatable {
3
+ shortCode: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ import { NormalizedGameResultType } from './normalize-game-result-type.types';
2
+ export declare const normalizeGameResultType: (type: string | null) => NormalizedGameResultType | null;
@@ -0,0 +1,3 @@
1
+ export * from './normalize-game-result-type.pipe';
2
+ export * from './normalize-game-result-type.types';
3
+ export * from './normalize-game-result-type.util';
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NormalizeMatchParticipantsPipe implements PipeTransform {
4
+ transform: (match: import("@ethlete/types").MatchListView | null) => import("@ethlete/core").NormalizedMatchParticipants | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeMatchParticipantsPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<NormalizeMatchParticipantsPipe, "etNormalizeMatchParticipants", true>;
7
+ }
@@ -0,0 +1,21 @@
1
+ import { ParticipantViewUnion } from '@ethlete/types';
2
+ import { Translatable } from '../../types';
3
+ export interface NormalizedMatchParticipants {
4
+ home: NormalizedMatchParticipant | null;
5
+ away: NormalizedMatchParticipant | null;
6
+ }
7
+ declare type NormalizedParticipantType = 'team' | 'player' | 'unknown';
8
+ export declare type NormalizedMatchParticipant = ({
9
+ type: 'tbd';
10
+ participantType: NormalizedParticipantType;
11
+ data: ParticipantViewUnion | null;
12
+ } & Translatable) | {
13
+ type: 'participant';
14
+ participantType: NormalizedParticipantType;
15
+ data: ParticipantViewUnion;
16
+ } | ({
17
+ type: 'none';
18
+ participantType: NormalizedParticipantType;
19
+ data: ParticipantViewUnion | null;
20
+ } & Translatable);
21
+ export {};
@@ -0,0 +1,4 @@
1
+ import { MatchListView } from '@ethlete/types';
2
+ import { NormalizedMatchParticipant, NormalizedMatchParticipants } from './normalize-match-participants.types';
3
+ export declare const normalizeMatchParticipants: (match: MatchListView | null) => NormalizedMatchParticipants | null;
4
+ export declare const normalizeMatchParticipant: (match: MatchListView | null, side: 'home' | 'away') => NormalizedMatchParticipant | null;
@@ -0,0 +1,3 @@
1
+ export * from './normalize-match-participants.pipe';
2
+ export * from './normalize-match-participants.types';
3
+ export * from './normalize-match-participants.util';
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NormalizeMatchScorePipe implements PipeTransform {
4
+ transform: (match: import("@ethlete/types").MatchListView | null | undefined) => import("@ethlete/core").NormalizedMatchScore | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeMatchScorePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<NormalizeMatchScorePipe, "etNormalizeMatchScore", true>;
7
+ }
@@ -0,0 +1,12 @@
1
+ export interface NormalizedMatchScore {
2
+ home: {
3
+ score: string | number | null;
4
+ isWinner: boolean;
5
+ };
6
+ away: {
7
+ score: string | number | null;
8
+ isWinner: boolean;
9
+ };
10
+ subLine: string | null;
11
+ isNumeric: boolean;
12
+ }
@@ -0,0 +1,27 @@
1
+ import { MatchListView, MatchRankingView } from '@ethlete/types';
2
+ import { NormalizedMatchScore } from './normalize-match-score.types';
3
+ export declare const normalizeMatchScore: (match: MatchListView | null | undefined) => NormalizedMatchScore | null;
4
+ export declare const isKnockoutMatch: (match: MatchListView | null | undefined) => boolean;
5
+ export declare const isGroupMatch: (match: MatchListView | null | undefined) => boolean;
6
+ export declare const getKnockoutMatchScore: (score: MatchRankingView | null | undefined) => "match-score.knockout.won" | "match-score.knockout.lost" | "match-score.knockout.tie" | null;
7
+ export declare const getMatchScoreSubLine: (match: MatchListView | null | undefined) => "match-score.groups.sub-line" | null;
8
+ export declare const getGroupMatchScore: (match: MatchListView | null | undefined) => {
9
+ home: {
10
+ score: number;
11
+ isWinner: boolean;
12
+ };
13
+ away: {
14
+ score: number;
15
+ isWinner: boolean;
16
+ };
17
+ } | null;
18
+ export declare const getGroupMatchPoints: (match: MatchListView | null | undefined) => {
19
+ home: {
20
+ score: number;
21
+ isWinner: boolean;
22
+ };
23
+ away: {
24
+ score: number;
25
+ isWinner: boolean;
26
+ };
27
+ } | null;
@@ -0,0 +1,3 @@
1
+ export * from './normalize-match-score.pipe';
2
+ export * from './normalize-match-score.types';
3
+ export * from './normalize-match-score.util';
@@ -0,0 +1 @@
1
+ export * from './public-api';
@@ -0,0 +1,7 @@
1
+ export declare const enum MatchStateType {
2
+ PREPARING_ROUND = "preparingRound",
3
+ PRE_MATCH = "preMatch",
4
+ LIVE = "live",
5
+ POST_MATCH = "postMatch",
6
+ AUTO_WIN = "autoWin"
7
+ }
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NormalizeMatchStatePipe implements PipeTransform {
4
+ transform: (match: import("@ethlete/types").MatchListView | null | undefined) => import("@ethlete/core").MatchStateType | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeMatchStatePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<NormalizeMatchStatePipe, "etNormalizeMatchState", true>;
7
+ }
@@ -0,0 +1,3 @@
1
+ import { MatchListView } from '@ethlete/types';
2
+ import { MatchStateType } from './normalize-match-state.constants';
3
+ export declare const normalizeMatchState: (match: MatchListView | null | undefined) => MatchStateType | null;
@@ -0,0 +1,3 @@
1
+ export * from './normalize-match-state.constants';
2
+ export * from './normalize-match-state.pipe';
3
+ export * from './normalize-match-state.util';
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NormalizeMatchTypePipe implements PipeTransform {
4
+ transform: (matchType: import("@ethlete/types").StageType | null | undefined) => import("@ethlete/core").Translatable | null;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeMatchTypePipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<NormalizeMatchTypePipe, "etNormalizeMatchType", true>;
7
+ }
@@ -0,0 +1,3 @@
1
+ import { StageType } from '@ethlete/types';
2
+ import { Translatable } from '../../types';
3
+ export declare const normalizeMatchType: (matchType: StageType | null | undefined) => Translatable | null;
@@ -0,0 +1,2 @@
1
+ export * from './normalize-match-type.pipe';
2
+ export * from './normalize-match-type.util';
@@ -1 +1,6 @@
1
+ export * from './normalize-game-result-type/public-api';
2
+ export * from './normalize-match-participants/public-api';
3
+ export * from './normalize-match-score/public-api';
4
+ export * from './normalize-match-state/public-api';
5
+ export * from './normalize-match-type/public-api';
1
6
  export * from './to-array/public-api';
@@ -0,0 +1,4 @@
1
+ export interface Translatable {
2
+ i18n: string;
3
+ text: string;
4
+ }
@@ -1,2 +1,3 @@
1
- export * from './viewport.types';
2
1
  export * from './angular.types';
2
+ export * from './i18n.types';
3
+ export * from './viewport.types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "0.2.0-next.7",
3
+ "version": "0.2.0-next.9",
4
4
  "dependencies": {
5
5
  "tslib": "2.4.1"
6
6
  },
@@ -8,7 +8,9 @@
8
8
  "@angular/common": "^14.0.0 || ^15.0.0",
9
9
  "@angular/core": "^14.0.0 || ^15.0.0",
10
10
  "rxjs": "7.5.7",
11
- "@angular/cdk": "15.0.0"
11
+ "@angular/cdk": "15.0.2",
12
+ "@angular/platform-browser": "15.0.2",
13
+ "@ethlete/types": "0.2.0-next.1"
12
14
  },
13
15
  "module": "fesm2015/ethlete-core.mjs",
14
16
  "es2020": "fesm2020/ethlete-core.mjs",