fetta 1.0.1 → 1.0.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 +15 -5
- package/dist/{chunk-NLTQZ6B6.js → chunk-G5P33GJE.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,14 +7,18 @@ Split text into characters, words, and lines while preserving the original typog
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
9
|
- **Kerning Compensation** — Measures character positions before splitting, then applies margin adjustments to maintain original spacing
|
|
10
|
-
- **Nested
|
|
11
|
-
- **
|
|
10
|
+
- **Nested Elements** — Preserves inline HTML elements (`<a>`, `<em>`, `<strong>`, etc.) with all attributes intact
|
|
11
|
+
- **Line Detection** — Detects lines based on Y-position clustering, works with any container width
|
|
12
12
|
- **Dash Handling** — Allows text to wrap naturally after em-dashes, en-dashes, and hyphens
|
|
13
13
|
- **Auto Re-split** — Automatically re-splits on container resize with debouncing
|
|
14
|
-
- **
|
|
14
|
+
- **Auto-Revert** — Restore original HTML after animations
|
|
15
15
|
- **Masking** — Wrap elements in clip containers for reveal animations
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
16
|
+
- **Emoji Support** — Properly handles compound emojis and complex Unicode characters
|
|
17
|
+
- **Accessible** — Adds `aria-label` with original text for screen readers
|
|
18
|
+
- **TypeScript** — Full type definitions included
|
|
19
|
+
- **React Component** — Declarative wrapper for React projects
|
|
20
|
+
- **Built-in InView** — Viewport detection for scroll-triggered animations in React
|
|
21
|
+
- **Library Agnostic** — Works with Motion, GSAP, or any animation library
|
|
18
22
|
|
|
19
23
|
## Installation
|
|
20
24
|
|
|
@@ -262,6 +266,12 @@ Requires:
|
|
|
262
266
|
- `IntersectionObserver`
|
|
263
267
|
- `Intl.Segmenter`
|
|
264
268
|
|
|
269
|
+
### Safari
|
|
270
|
+
|
|
271
|
+
Kerning compensation is not available in Safari due to its Range API returning integer values instead of sub-pixel precision. Text splitting works normally, just without the margin adjustments.
|
|
272
|
+
|
|
273
|
+
When using `revertOnComplete` with character splitting in Safari, font kerning is automatically disabled to prevent visual shift on revert.
|
|
274
|
+
|
|
265
275
|
## License
|
|
266
276
|
|
|
267
277
|
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface SplitTextOptions {
|
|
|
42
42
|
revertOnComplete?: boolean;
|
|
43
43
|
/** Add CSS custom properties (--char-index, --word-index, --line-index) */
|
|
44
44
|
propIndex?: boolean;
|
|
45
|
-
/** Add will-change: transform, opacity to split elements for better animation performance */
|
|
45
|
+
/** Add will-change: transform, opacity to split elements for better animation performance (default: true) */
|
|
46
46
|
willChange?: boolean;
|
|
47
47
|
}
|
|
48
48
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { splitText } from './chunk-
|
|
1
|
+
export { splitText } from './chunk-G5P33GJE.js';
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { splitText, __spreadProps, __spreadValues, normalizeToPromise } from './chunk-
|
|
1
|
+
import { splitText, __spreadProps, __spreadValues, normalizeToPromise } from './chunk-G5P33GJE.js';
|
|
2
2
|
import { forwardRef, useRef, useCallback, useState, useLayoutEffect, useEffect, isValidElement, cloneElement } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|