angular-movement 0.0.2 → 0.1.0

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/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "angular-movement",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
+ "type": "module",
4
5
  "description": "Angular animation directives — presets, custom keyframes, spring physics, scroll & parallax.",
5
6
  "keywords": [
6
7
  "angular",
@@ -16,7 +17,7 @@
16
17
  "license": "MIT",
17
18
  "repository": {
18
19
  "type": "git",
19
- "url": "https://github.com/Andersseen/angular-movement.git"
20
+ "url": "git+https://github.com/Andersseen/angular-movement.git"
20
21
  },
21
22
  "homepage": "https://github.com/Andersseen/angular-movement#readme",
22
23
  "bugs": {
@@ -1,7 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, OnDestroy, OnInit, EnvironmentProviders } from '@angular/core';
3
3
 
4
- type MovePreset = 'fade-up' | 'fade-down' | 'fade-left' | 'fade-right' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'zoom-in' | 'zoom-out' | 'flip-x' | 'flip-y' | 'bounce-in' | 'blur-in' | 'spin' | 'pulse' | 'none';
4
+ type MovePreset = 'fade-up' | 'fade-down' | 'fade-left' | 'fade-right' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'zoom-in' | 'zoom-out' | 'flip-x' | 'flip-y' | 'bounce-in' | 'blur-in' | 'spin' | 'pulse' | 'shake' | 'swing' | 'wobble' | 'rubber-band' | 'heart-beat' | 'tada' | 'jello' | 'light-speed' | 'roll-in' | 'none';
5
5
  type MoveValuePair = readonly number[];
6
6
  interface MoveSpring {
7
7
  stiffness?: number;
@@ -365,6 +365,22 @@ declare class MoveLoopDirective implements OnDestroy, OnInit {
365
365
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MoveLoopDirective, "[moveLoop]", never, { "moveLoop": { "alias": "moveLoop"; "required": false; "isSignal": true; }; "moveDuration": { "alias": "moveDuration"; "required": false; "isSignal": true; }; "moveEasing": { "alias": "moveEasing"; "required": false; "isSignal": true; }; "moveDelay": { "alias": "moveDelay"; "required": false; "isSignal": true; }; "moveDisabled": { "alias": "moveDisabled"; "required": false; "isSignal": true; }; "moveSpring": { "alias": "moveSpring"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
366
366
  }
367
367
 
368
+ declare class MoveTargetDirective implements OnDestroy {
369
+ #private;
370
+ readonly moveTarget: _angular_core.InputSignal<boolean>;
371
+ readonly moveFrames: _angular_core.InputSignal<MoveKeyframes>;
372
+ readonly moveDuration: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
373
+ readonly moveEasing: _angular_core.InputSignal<string | undefined>;
374
+ readonly moveDelay: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
375
+ readonly moveSpring: _angular_core.InputSignal<MoveSpring | undefined>;
376
+ readonly moveDisabled: _angular_core.InputSignal<boolean | undefined>;
377
+ readonly moveReverseDuration: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
378
+ readonly moveReverseEasing: _angular_core.InputSignal<string | undefined>;
379
+ ngOnDestroy(): void;
380
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<MoveTargetDirective, never>;
381
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MoveTargetDirective, "[moveTarget]", never, { "moveTarget": { "alias": "moveTarget"; "required": true; "isSignal": true; }; "moveFrames": { "alias": "moveFrames"; "required": true; "isSignal": true; }; "moveDuration": { "alias": "moveDuration"; "required": false; "isSignal": true; }; "moveEasing": { "alias": "moveEasing"; "required": false; "isSignal": true; }; "moveDelay": { "alias": "moveDelay"; "required": false; "isSignal": true; }; "moveSpring": { "alias": "moveSpring"; "required": false; "isSignal": true; }; "moveDisabled": { "alias": "moveDisabled"; "required": false; "isSignal": true; }; "moveReverseDuration": { "alias": "moveReverseDuration"; "required": false; "isSignal": true; }; "moveReverseEasing": { "alias": "moveReverseEasing"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
382
+ }
383
+
368
384
  interface MovementConfig {
369
385
  duration: number;
370
386
  easing: string;
@@ -403,6 +419,20 @@ declare function applyInitialStyles(el: HTMLElement, frames: MoveKeyframes): voi
403
419
  * Called just before WAAPI animates so it can take full control.
404
420
  */
405
421
  declare function clearInitialStyles(el: HTMLElement): void;
422
+ /**
423
+ * Validates MoveSpring configuration and returns sanitized values.
424
+ * Warns in development mode for invalid values.
425
+ */
426
+ declare function validateSpring(spring: MoveSpring | undefined): MoveSpring | undefined;
427
+ /**
428
+ * Validates scroll offset string format "elFraction viewFraction".
429
+ * Returns true if valid, warns in dev mode if invalid.
430
+ */
431
+ declare function isValidScrollOffset(offset: string): boolean;
432
+ /**
433
+ * Validates drag elastic factor. Must be between 0 and 1.
434
+ */
435
+ declare function validateDragElastic(elastic: number): number;
406
436
 
407
437
  /**
408
438
  * SmoothScrollService — Lenis-inspired smooth scroll for Angular.
@@ -498,7 +528,7 @@ declare const MOVE_PRESETS: Record<MovePreset, MovePresetDefinition>;
498
528
  type MovementConfigInput = Partial<MovementConfig>;
499
529
  declare function provideMovement(config?: MovementConfigInput): EnvironmentProviders;
500
530
 
501
- declare const MOVEMENT_DIRECTIVES: readonly [typeof MoveEnterDirective, typeof MoveLeaveDirective, typeof MoveAnimateDirective, typeof MoveHoverDirective, typeof MoveTapDirective, typeof MoveVariantsDirective, typeof MoveStaggerDirective, typeof MoveLayoutDirective, typeof MoveScrollDirective, typeof MovePresenceDirective, typeof MoveDragDirective, typeof MoveInViewDirective, typeof MoveTextDirective, typeof MoveSmoothScrollDirective, typeof MoveFocusDirective, typeof MoveParallaxDirective, typeof MoveAnimationDirective, typeof MoveLoopDirective];
531
+ declare const MOVEMENT_DIRECTIVES: readonly [typeof MoveEnterDirective, typeof MoveLeaveDirective, typeof MoveAnimateDirective, typeof MoveHoverDirective, typeof MoveTapDirective, typeof MoveVariantsDirective, typeof MoveStaggerDirective, typeof MoveLayoutDirective, typeof MoveScrollDirective, typeof MovePresenceDirective, typeof MoveDragDirective, typeof MoveInViewDirective, typeof MoveTextDirective, typeof MoveSmoothScrollDirective, typeof MoveFocusDirective, typeof MoveParallaxDirective, typeof MoveAnimationDirective, typeof MoveLoopDirective, typeof MoveTargetDirective];
502
532
 
503
- export { AnimationEngine, MOVEMENT_CONFIG, MOVEMENT_DEFAULTS, MOVEMENT_DIRECTIVES, MOVE_PRESENCE_PARENT, MOVE_PRESETS, MOVE_STAGGER_PARENT, MOVE_VARIANTS_PARENT, MoveAnimateDirective, MoveAnimationDirective, MoveDragDirective, MoveEnterDirective, MoveFocusDirective, MoveHoverDirective, MoveInViewDirective, MoveLayoutDirective, MoveLeaveDirective, MoveLoopDirective, MoveParallaxDirective, MovePresenceDirective, MoveScrollDirective, MoveSmoothScrollDirective, MoveStaggerDirective, MoveTapDirective, MoveTextDirective, MoveVariantsDirective, SmoothScrollService, SpringPlayer, WaapiPlayer, applyInitialStyles, clearInitialStyles, prefersReducedMotion, provideMovement, resolveMoveFrames, resolveMovementConfig, reverseFrames };
533
+ export { AnimationEngine, MOVEMENT_CONFIG, MOVEMENT_DEFAULTS, MOVEMENT_DIRECTIVES, MOVE_PRESENCE_PARENT, MOVE_PRESETS, MOVE_STAGGER_PARENT, MOVE_VARIANTS_PARENT, MoveAnimateDirective, MoveAnimationDirective, MoveDragDirective, MoveEnterDirective, MoveFocusDirective, MoveHoverDirective, MoveInViewDirective, MoveLayoutDirective, MoveLeaveDirective, MoveLoopDirective, MoveParallaxDirective, MovePresenceDirective, MoveScrollDirective, MoveSmoothScrollDirective, MoveStaggerDirective, MoveTapDirective, MoveTargetDirective, MoveTextDirective, MoveVariantsDirective, SmoothScrollService, SpringPlayer, WaapiPlayer, applyInitialStyles, clearInitialStyles, isValidScrollOffset, prefersReducedMotion, provideMovement, resolveMoveFrames, resolveMovementConfig, reverseFrames, validateDragElastic, validateSpring };
504
534
  export type { AnimationControls, MoveAnimationConfig, MoveDirectiveInput, MoveDragConstraints, MoveInputOverrides, MoveKeyframeState, MoveKeyframes, MovePhase, MovePresenceChild, MovePresenceProvider, MovePreset, MovePresetDefinition, MoveSpring, MoveStaggerDirection, MoveStaggerProvider, MoveValuePair, MoveVariant, MoveVariantsProvider, MovementConfig, MovementConfigInput, PlayAnimationOptions };