@motion.page/sdk 1.2.0 → 1.2.2

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.
@@ -18,6 +18,12 @@ import type { ParsedClipPath } from '../utils/ClipPathParser';
18
18
  * Automatically batches during animation tick, writes immediately otherwise
19
19
  */
20
20
  export declare function setCSSProperty(element: Element, property: string, value: number, unit: string): void;
21
+ /**
22
+ * Set a regular CSS property whose explicit start/end values use different
23
+ * units. Endpoints are emitted as authored; intermediate frames use CSS calc()
24
+ * so the browser resolves mixed units natively.
25
+ */
26
+ export declare function setCSSMixedUnitProperty(element: Element, property: string, startValue: number, startUnit: string, endValue: number, endUnit: string, progress: number): void;
21
27
  /**
22
28
  * Set a CSS color property value on an element
23
29
  * Takes RGBA values directly for performance (avoids string formatting in hot path)
@@ -34,6 +34,12 @@ export declare class CursorTrigger extends BaseTrigger<CursorConfig> {
34
34
  private _isHoveringCursorTarget;
35
35
  private _boundHoverTargetMoveHandler;
36
36
  private _hoverPointerMoveTarget;
37
+ private _boundTextAttributeMoveHandler;
38
+ private _textPointerMoveTarget;
39
+ private _activeTextAttributeElement;
40
+ private _hasTextAttributeElements;
41
+ private _textAttributeObserver;
42
+ private _textAttributeObserverActive;
37
43
  private _cursorStyleTag;
38
44
  private _attributeListeners;
39
45
  constructor(timeline: Timeline, config: CursorConfig);
@@ -75,6 +81,27 @@ export declare class CursorTrigger extends BaseTrigger<CursorConfig> {
75
81
  private _setupEventListeners;
76
82
  private _setupHoverTargets;
77
83
  private _setupTextCursor;
84
+ private _setupTextAttributeHitTesting;
85
+ /** Recompute whether any tooltip/text attribute elements currently exist. */
86
+ private _updateHasTextAttributeElements;
87
+ /**
88
+ * Watch the DOM for tooltip/text attribute elements being added, removed, or
89
+ * toggled so the hit-test fast path stays correct without polling. The
90
+ * callback only runs a single querySelector per mutation batch — far cheaper
91
+ * than an elementsFromPoint call on every pointer-move frame.
92
+ */
93
+ private _observeTextAttributeElements;
94
+ private _findTextAttributeTarget;
95
+ private _showTextCursor;
96
+ /**
97
+ * Drop the cursor back to its default state only when neither hover source is
98
+ * active. Both the hover-selector hit-test and the text-attribute hit-test can
99
+ * hold the 'hover' state; releasing requires both to be inactive so the two
100
+ * handlers don't fight each other across pointer-move frames. The `'hover'`
101
+ * guard preserves an in-progress 'click' state.
102
+ */
103
+ private _releaseHoverIfInactive;
104
+ private _hideTextCursor;
78
105
  private _setupMediaCursor;
79
106
  private _removeEventListeners;
80
107
  private _setState;
@@ -174,6 +174,7 @@ export declare class PinManager {
174
174
  * collapsing the spacer below its needed size (GSAP-compatible).
175
175
  */
176
176
  private _resolvePinSpacing;
177
+ private _applyFixedState;
177
178
  /**
178
179
  * Fixed positioning for window scroller (seamless pinning)
179
180
  *
@@ -6,7 +6,7 @@
6
6
  * - RGB/RGBA: rgb(255, 0, 0), rgba(255, 0, 0, 0.5)
7
7
  * - HSL/HSLA: hsl(0, 100%, 50%), hsla(0, 100%, 50%, 0.5)
8
8
  * - Named colors: red, coral, transparent
9
- * - CSS variables: var(--color)
9
+ * - CSS variables: var(--color), --color
10
10
  */
11
11
  /**
12
12
  * Parse any color format to RGBA Float32Array
@@ -24,6 +24,8 @@ export interface ParsedScalarProperty extends ParsedPropertyBase {
24
24
  startValue: number;
25
25
  endValue: number;
26
26
  unit: string;
27
+ startUnit?: string;
28
+ endUnit?: string;
27
29
  }
28
30
  /**
29
31
  * Color property (RGBA values)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@motion.page/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "High-performance CSS animation SDK with scroll, hover, gesture, and cursor triggers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",