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 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 Element Support** — Preserves inline HTML elements (`<a>`, `<em>`, `<strong>`, etc.) with all attributes intact
11
- - **Natural Line Wrapping** — Detects lines based on Y-position clustering, works with any container width
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
- - **Viewport Detection** — Built-in IntersectionObserver support for scroll-triggered animations
14
+ - **Auto-Revert** — Restore original HTML after animations
15
15
  - **Masking** — Wrap elements in clip containers for reveal animations
16
- - **Animation Agnostic** — Works with Motion, GSAP, or any animation library
17
- - **React Component** — First-class React support with hooks and cleanup
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
@@ -594,7 +594,7 @@ function splitText(element, {
594
594
  onSplit,
595
595
  revertOnComplete = false,
596
596
  propIndex = false,
597
- willChange = false
597
+ willChange = true
598
598
  } = {}) {
599
599
  var _a;
600
600
  if (!(element instanceof HTMLElement)) {
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-NLTQZ6B6.js';
1
+ export { splitText } from './chunk-G5P33GJE.js';
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { splitText, __spreadProps, __spreadValues, normalizeToPromise } from './chunk-NLTQZ6B6.js';
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fetta",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Text splitting library with kerning compensation for animations",
5
5
  "type": "module",
6
6
  "sideEffects": false,