@ethlete/core 4.5.0 → 4.5.1

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 (60) hide show
  1. package/esm2022/lib/components/structured-data/structured-data.component.mjs +3 -3
  2. package/esm2022/lib/directives/animatable/animatable.directive.mjs +3 -3
  3. package/esm2022/lib/directives/animated-if/animated-if.directive.mjs +3 -3
  4. package/esm2022/lib/directives/animated-lifecycle/animated-lifecycle.directive.mjs +3 -3
  5. package/esm2022/lib/directives/animated-overlay/animated-overlay.directive.mjs +3 -3
  6. package/esm2022/lib/directives/click-outside/click-outside.directive.mjs +3 -3
  7. package/esm2022/lib/directives/cursor-drag-scroll/cursor-drag-scroll.directive.mjs +3 -3
  8. package/esm2022/lib/directives/debug/debug.directive.mjs +3 -3
  9. package/esm2022/lib/directives/delayable/delayable.directive.mjs +3 -3
  10. package/esm2022/lib/directives/is-active-element/is-active-element.directive.mjs +3 -3
  11. package/esm2022/lib/directives/is-element/is-element.directive.mjs +3 -3
  12. package/esm2022/lib/directives/let/let.directive.mjs +3 -3
  13. package/esm2022/lib/directives/observe-content/observe-content.directive.mjs +3 -3
  14. package/esm2022/lib/directives/observe-resize/observe-resize.directive.mjs +3 -3
  15. package/esm2022/lib/directives/observe-scroll-state/observe-scroll-state.directive.mjs +3 -3
  16. package/esm2022/lib/directives/observe-visibility/observe-visibility.directive.mjs +3 -3
  17. package/esm2022/lib/directives/repeat/repeat.directive.mjs +3 -3
  18. package/esm2022/lib/directives/root-boundary/root-boundary.directive.mjs +3 -3
  19. package/esm2022/lib/directives/scroll-observer-first-element/scroll-observer-first-element.directive.mjs +3 -3
  20. package/esm2022/lib/directives/scroll-observer-ignore-target/scroll-observer-ignore-target.directive.mjs +3 -3
  21. package/esm2022/lib/directives/scroll-observer-last-element/scroll-observer-last-element.directive.mjs +3 -3
  22. package/esm2022/lib/directives/seo/seo.directive.mjs +3 -3
  23. package/esm2022/lib/pipes/infer-mime-type/infer-mime-type.pipe.mjs +3 -3
  24. package/esm2022/lib/pipes/normalize-game-result-type/normalize-game-result-type.pipe.mjs +3 -3
  25. package/esm2022/lib/pipes/normalize-match-participants/normalize-match-participants.pipe.mjs +3 -3
  26. package/esm2022/lib/pipes/normalize-match-score/normalize-match-score.pipe.mjs +3 -3
  27. package/esm2022/lib/pipes/normalize-match-state/normalize-match-state.pipe.mjs +3 -3
  28. package/esm2022/lib/pipes/normalize-match-type/normalize-match-type.pipe.mjs +3 -3
  29. package/esm2022/lib/pipes/to-array/to-array.pipe.mjs +3 -3
  30. package/esm2022/lib/props/create-prop-handlers.mjs +17 -0
  31. package/esm2022/lib/props/create-props.mjs +51 -0
  32. package/esm2022/lib/props/create-setup.mjs +19 -0
  33. package/esm2022/lib/props/dependency-stash.mjs +20 -0
  34. package/esm2022/lib/props/element-dictionary.mjs +44 -0
  35. package/esm2022/lib/props/index.mjs +9 -0
  36. package/esm2022/lib/props/props-binding.mjs +53 -0
  37. package/esm2022/lib/props/props.directive.mjs +33 -0
  38. package/esm2022/lib/props/template-input.mjs +41 -0
  39. package/esm2022/lib/public-api.mjs +2 -1
  40. package/esm2022/lib/services/click-observer.service.mjs +6 -6
  41. package/esm2022/lib/services/content-observer.service.mjs +6 -6
  42. package/esm2022/lib/services/focus-visible.service.mjs +3 -3
  43. package/esm2022/lib/services/intersection-observer.service.mjs +6 -6
  44. package/esm2022/lib/services/resize-observer.service.mjs +6 -6
  45. package/esm2022/lib/services/router-state.service.mjs +3 -3
  46. package/esm2022/lib/services/viewport.service.mjs +4 -4
  47. package/fesm2022/ethlete-core.mjs +386 -122
  48. package/fesm2022/ethlete-core.mjs.map +1 -1
  49. package/lib/props/create-prop-handlers.d.ts +27 -0
  50. package/lib/props/create-props.d.ts +54 -0
  51. package/lib/props/create-setup.d.ts +4 -0
  52. package/lib/props/dependency-stash.d.ts +11 -0
  53. package/lib/props/element-dictionary.d.ts +11 -0
  54. package/lib/props/index.d.ts +8 -0
  55. package/lib/props/props-binding.d.ts +12 -0
  56. package/lib/props/props.directive.d.ts +38 -0
  57. package/lib/props/template-input.d.ts +30 -0
  58. package/lib/public-api.d.ts +1 -0
  59. package/lib/services/viewport.service.d.ts +1 -2
  60. package/package.json +7 -7
@@ -0,0 +1,27 @@
1
+ import { ElementRef } from '@angular/core';
2
+ export declare const createPropHandlers: () => {
3
+ classes: {
4
+ remove: (...tokens: string[]) => void;
5
+ removeMany: (tokens: string[]) => void;
6
+ has: (token: string) => boolean;
7
+ push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
8
+ pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
9
+ };
10
+ attributes: {
11
+ remove: (...tokens: string[]) => void;
12
+ removeMany: (tokens: string[]) => void;
13
+ has: (token: string) => boolean;
14
+ push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
15
+ pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
16
+ };
17
+ styles: {
18
+ remove: (...tokens: string[]) => void;
19
+ removeMany: (tokens: string[]) => void;
20
+ has: (token: string) => boolean;
21
+ push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
22
+ pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
23
+ };
24
+ id: string;
25
+ elementRef: ElementRef<HTMLElement>;
26
+ };
27
+ export type PropHandlers = ReturnType<typeof createPropHandlers>;
@@ -0,0 +1,54 @@
1
+ import { Signal } from '@angular/core';
2
+ import { PropHandlers } from './create-prop-handlers';
3
+ export type Props = Readonly<{
4
+ attached: Signal<boolean>;
5
+ attachedElements: PropsAttachedElements;
6
+ }>;
7
+ export interface PropsAttachedElements {
8
+ first: Signal<HTMLElement | null>;
9
+ firstId: Signal<string | null>;
10
+ get(id: string): HTMLElement | null;
11
+ }
12
+ export interface PropsAttachedElementsInternal extends PropsAttachedElements {
13
+ has: (id: string) => boolean;
14
+ push: (id: string, element: HTMLElement) => void;
15
+ remove: (id: string) => void;
16
+ }
17
+ export interface PropsInternal {
18
+ single: boolean;
19
+ name: string;
20
+ bindId: boolean;
21
+ attached: Signal<boolean>;
22
+ attachedElements: PropsAttachedElementsInternal;
23
+ classBindings: Record<string, Signal<unknown>> | null;
24
+ attributeBindings: Record<string, Signal<unknown>> | null;
25
+ styleBindings: Record<string, Signal<unknown>> | null;
26
+ staticClassBindings: string[] | null;
27
+ staticAttributeBindings: Record<string, unknown> | null;
28
+ staticStyleBindings: Record<string, unknown> | null;
29
+ attachEventListeners: ((context: {
30
+ on: HTMLElement['addEventListener'];
31
+ element: HTMLElement;
32
+ }) => void) | null;
33
+ }
34
+ export interface CreatePropsOptions {
35
+ name: string;
36
+ bindId?: boolean;
37
+ single?: boolean;
38
+ classes?: Record<string, Signal<unknown>>;
39
+ attributes?: Record<string, Signal<unknown>>;
40
+ styles?: Record<string, Signal<unknown>>;
41
+ staticClasses?: string[];
42
+ staticAttributes?: Record<string, unknown>;
43
+ staticStyles?: Record<string, unknown>;
44
+ listeners?: (context: {
45
+ on: HTMLElement['addEventListener'];
46
+ element: HTMLElement;
47
+ }) => void;
48
+ }
49
+ export declare const createProps: (props: CreatePropsOptions) => Props;
50
+ export interface HostProps {
51
+ props: Props;
52
+ handlers: PropHandlers;
53
+ }
54
+ export declare const createHostProps: (props: CreatePropsOptions) => HostProps;
@@ -0,0 +1,4 @@
1
+ export declare const createSetup: <T extends Record<string, unknown>>(config: {
2
+ setupFn: (params: T) => void;
3
+ this: ThisType<unknown>;
4
+ }) => (params: T) => void;
@@ -0,0 +1,11 @@
1
+ import { Signal, WritableSignal } from '@angular/core';
2
+ export declare const createDependencyStash: <T extends Record<string, WritableSignal<unknown>>>(stash: T) => T & {
3
+ provideSignal: <K extends keyof T>(data: {
4
+ signal: Signal<ReturnType<T[K]>>;
5
+ for: K;
6
+ }) => void;
7
+ provideValue: <K_1 extends keyof T>(data: {
8
+ value: ReturnType<T[K_1]>;
9
+ for: K_1;
10
+ }) => void;
11
+ };
@@ -0,0 +1,11 @@
1
+ export declare const createElementDictionary: () => {
2
+ ids: import("@angular/core").Signal<string[]>;
3
+ elements: import("@angular/core").Signal<HTMLElement[]>;
4
+ has: (id: string) => boolean;
5
+ get: (id: string) => HTMLElement | null;
6
+ push: (id: string, element: HTMLElement) => void;
7
+ remove: (id: string) => void;
8
+ isEmpty: import("@angular/core").Signal<boolean>;
9
+ firstElement: import("@angular/core").Signal<HTMLElement | null>;
10
+ firstId: import("@angular/core").Signal<string | null>;
11
+ };
@@ -0,0 +1,8 @@
1
+ export * from './create-prop-handlers';
2
+ export * from './create-props';
3
+ export * from './create-setup';
4
+ export * from './dependency-stash';
5
+ export * from './element-dictionary';
6
+ export * from './props-binding';
7
+ export * from './props.directive';
8
+ export * from './template-input';
@@ -0,0 +1,12 @@
1
+ import { PropHandlers } from './create-prop-handlers';
2
+ import { Props, PropsInternal } from './create-props';
3
+ export interface BindPropsOptions {
4
+ props: Props | PropsInternal;
5
+ handlers: PropHandlers;
6
+ }
7
+ export declare const bindProps: (config: BindPropsOptions) => void;
8
+ export interface UnbindPropsOptions {
9
+ props: Props | PropsInternal;
10
+ handlers: PropHandlers;
11
+ }
12
+ export declare const unbindProps: (config: UnbindPropsOptions) => void;
@@ -0,0 +1,38 @@
1
+ import { DestroyRef } from '@angular/core';
2
+ import { PropsInternal } from './create-props';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PropsDirective {
5
+ destroyRef: DestroyRef;
6
+ props: import("@angular/core").InputSignal<PropsInternal, Readonly<{
7
+ attached: import("@angular/core").Signal<boolean>;
8
+ attachedElements: import("./create-props").PropsAttachedElements;
9
+ }>>;
10
+ propHandlers: {
11
+ classes: {
12
+ remove: (...tokens: string[]) => void;
13
+ removeMany: (tokens: string[]) => void;
14
+ has: (token: string) => boolean;
15
+ push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
16
+ pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
17
+ };
18
+ attributes: {
19
+ remove: (...tokens: string[]) => void;
20
+ removeMany: (tokens: string[]) => void;
21
+ has: (token: string) => boolean;
22
+ push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
23
+ pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
24
+ };
25
+ styles: {
26
+ remove: (...tokens: string[]) => void;
27
+ removeMany: (tokens: string[]) => void;
28
+ has: (token: string) => boolean;
29
+ push: (tokenString: string, signal: import("@angular/core").Signal<unknown>) => void;
30
+ pushMany: (map: Record<string, import("@angular/core").Signal<unknown>>) => void;
31
+ };
32
+ id: string;
33
+ elementRef: import("@angular/core").ElementRef<HTMLElement>;
34
+ };
35
+ constructor();
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<PropsDirective, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<PropsDirective, "[etProps]", never, { "props": { "alias": "etProps"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
38
+ }
@@ -0,0 +1,30 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ import { Injector, Signal, TemplateRef } from '@angular/core';
3
+ export type AnyTemplateType = string | TemplateRef<unknown> | ComponentType<unknown> | TemplateRefWithContext | ComponentTypeWithInputs;
4
+ export type TemplateRefWithContext<T = Record<string, unknown> | undefined, J = unknown> = {
5
+ template: TemplateRef<J>;
6
+ context?: T;
7
+ injector?: Injector;
8
+ };
9
+ export type ComponentTypeWithInputs<T = Record<string, unknown> | undefined, J = unknown> = {
10
+ component: ComponentType<J>;
11
+ inputs?: T;
12
+ injector?: Injector;
13
+ };
14
+ export type StringTemplate = {
15
+ type: 'string';
16
+ value: string;
17
+ };
18
+ export type NgTemplateTemplate = {
19
+ type: 'template';
20
+ value: TemplateRef<unknown>;
21
+ context?: Record<string, unknown>;
22
+ injector: Injector | null;
23
+ };
24
+ export type ComponentTemplate = {
25
+ type: 'component';
26
+ value: ComponentType<unknown>;
27
+ inputs?: Record<string, unknown>;
28
+ injector: Injector | null;
29
+ };
30
+ export declare const templateComputed: (templateSignal: Signal<AnyTemplateType | null>) => Signal<StringTemplate | NgTemplateTemplate | ComponentTemplate | null>;
@@ -3,6 +3,7 @@ export * from './constants/public-api';
3
3
  export * from './decorators/public-api';
4
4
  export * from './directives/public-api';
5
5
  export * from './pipes/public-api';
6
+ export * from './props';
6
7
  export * from './services/public-api';
7
8
  export * from './types/public-api';
8
9
  export * from './utils/public-api';
@@ -1,7 +1,7 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { Breakpoint } from '../types';
3
3
  import * as i0 from "@angular/core";
4
- interface Size {
4
+ export interface Size {
5
5
  width: number;
6
6
  height: number;
7
7
  }
@@ -62,4 +62,3 @@ export declare class ViewportService {
62
62
  static ɵfac: i0.ɵɵFactoryDeclaration<ViewportService, never>;
63
63
  static ɵprov: i0.ɵɵInjectableDeclaration<ViewportService>;
64
64
  }
65
- export {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@ethlete/core",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "peerDependencies": {
5
- "@angular/cdk": "17.1.0",
6
- "@angular/common": "17.1.0",
7
- "@angular/core": "17.1.0",
8
- "@angular/forms": "17.1.0",
9
- "@angular/platform-browser": "17.1.0",
10
- "@angular/router": "17.1.0",
5
+ "@angular/cdk": "17.1.1",
6
+ "@angular/common": "17.1.1",
7
+ "@angular/core": "17.1.1",
8
+ "@angular/forms": "17.1.1",
9
+ "@angular/platform-browser": "17.1.1",
10
+ "@angular/router": "17.1.1",
11
11
  "@ethlete/theming": "^2.3.1",
12
12
  "@ethlete/types": "^1.6.2",
13
13
  "@floating-ui/dom": "^1.5.3",