@motion.page/sdk 1.2.1 → 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.
- package/README.md +0 -49
- package/dist/core/Animation.d.ts +2 -2
- package/dist/core/PropTween.d.ts +3 -1
- package/dist/core/Timeline.d.ts +6 -1
- package/dist/index.cjs +16 -16
- package/dist/index.js +16 -16
- package/dist/render/CSSRenderer.d.ts +6 -0
- package/dist/triggers/CursorTrigger.d.ts +27 -0
- package/dist/triggers/PinManager.d.ts +1 -0
- package/dist/utils/ColorParser.d.ts +1 -1
- package/dist/utils/PropertyParser/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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
|