diff --git a/.changeset/pre.json b/.changeset/pre.json index 8870af06de..d56315de40 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -9,14 +9,10 @@ "@react-spring/mock-raf": "10.1.1", "@react-spring/parallax": "10.1.1", "@react-spring/rafz": "10.1.1", - "react-spring": "10.0.4", "@react-spring/shared": "10.1.1", "@react-spring/types": "10.1.1", - "@react-spring/konva": "10.1.1", - "@react-spring/native": "10.1.1", "@react-spring/three": "10.1.1", - "@react-spring/web": "10.1.1", - "@react-spring/zdog": "10.1.1" + "@react-spring/web": "10.1.1" }, "changesets": [] } diff --git a/.changeset/remove-deprecated-targets.md b/.changeset/remove-deprecated-targets.md new file mode 100644 index 0000000000..dc7186d238 --- /dev/null +++ b/.changeset/remove-deprecated-targets.md @@ -0,0 +1,9 @@ +--- +'@react-spring/web': major +--- + +refactor!: remove deprecated targets and the `react-spring` umbrella + +Removes the deprecated `@react-spring/native`, `@react-spring/konva`, and `@react-spring/zdog` targets (along with the React Native hook variants), plus the `react-spring` umbrella package. Install a target directly — `@react-spring/web` or `@react-spring/three`. + +For React Native, use [Reanimated](https://docs.swmansion.com/react-native-reanimated/) — its springs run on the UI thread, unlike react-spring's JS-thread engine. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5f82150675..ec5725c4ad 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -29,9 +29,6 @@ body: options: - label: '`@react-spring/web`' - label: '`@react-spring/three`' - - label: '`@react-spring/native`' - - label: '`@react-spring/konva`' - - label: '`@react-spring/zdog`' - type: input attributes: label: What version of react-spring are you using? diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index 00f143142f..6def1180ac 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -55,7 +55,7 @@ The library is organised in strict bottom-up layers: - The umbrella package MUST contain only re-exports — no logic. **Rationale**: This is the load-bearing contract that lets the same animation engine -power web, native, three, konva, and zdog without bifurcating code. Any cross-layer +power web and three without bifurcating code. Any cross-layer shortcut taken once propagates indefinitely. ### II. Target-Agnostic Core diff --git a/CLAUDE.md b/CLAUDE.md index d8299fafc1..f67456bc04 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -39,15 +39,12 @@ Strict isolation: `node_modules` is non-hoisted, so a workspace can only `import ## Architecture -The library is a layered monorepo. Read packages bottom-up — each layer is target-agnostic until you reach `targets/*`. +The library is a layered monorepo. Read packages bottom-up — each layer is target-agnostic until you reach `targets/*`. There is no umbrella package: consumers install a target directly (`@react-spring/web` or `@react-spring/three`). ``` - react-spring (umbrella, re-exports all targets) - │ - ┌───────────────┼───────────────┬─────────┬─────────┐ - targets/web targets/native targets/three konva zdog - │ │ │ - └──────────────┴───────────────┘ + targets/web targets/three + │ │ + └────────┬────────┘ │ packages/core ─── declarative API: hooks, components, SpringValue, Controller, SpringRef │ @@ -68,9 +65,8 @@ The library is a layered monorepo. Read packages bottom-up — each layer is tar - `applyAnimatedValues(node, props)` — push the latest values to the platform's native node. - `createAnimatedStyle(style)` — wrap the `style` prop. - `getComponentProps(props)` — filter props before forwarding (e.g. web drops `scrollTop`/`scrollLeft`). -- **`@react-spring/core`** — platform-agnostic spring engine. `SpringValue` (single animated value), `Controller` (group of springs), `SpringRef` (imperative handle), `Interpolation`. Public hooks/components live under `src/hooks` and `src/components`. Hooks with native variants ship a `.native.ts` sibling (`useInView.native.ts`, `useResize.native.ts`, `useScroll.native.ts`) that React Native picks up via Metro's platform extensions. +- **`@react-spring/core`** — platform-agnostic spring engine. `SpringValue` (single animated value), `Controller` (group of springs), `SpringRef` (imperative handle), `Interpolation`. Public hooks/components live under `src/hooks` and `src/components`. - **Targets** — thin adapters. Each `targets//src/index.ts` follows the same template: `Globals.assign(...)`, define `primitives`, build a host via `createHost(primitives, { applyAnimatedValues, ... })`, then `export const animated = host.animated` and `export * from '@react-spring/core'`. To add an `animated.X` shorthand for a new element, add it to that target's `primitives.ts`. -- **`react-spring`** (umbrella) — depends on every target and only re-exports. Don't add logic here. - **`@react-spring/parallax`** — extra component layered on `@react-spring/web`. Its `test/` folder is the Vite app the E2E project serves and drives (`tests/e2e/parallax.spec.ts`). ### Where animation values flow diff --git a/README.md b/README.md index 2ee1c33c08..9a325784af 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@

- - + + - - + + Chat on Discord @@ -42,7 +42,7 @@ const styles = useSpring({ Just a small bit about us: -- **Cross-Platform**: We support `react-dom`, `react-native`, `react-three-fiber`, `react-konva` & `react-zdog`. +- **Cross-Platform**: We support `react-dom` and `react-three-fiber`. - **Versatile**: Be declarative with your animations or if you prefer, imperative. - **Spring-Physics First**: By default animation use springs for fluid interactivity, but we support durations with easings as well. @@ -53,10 +53,10 @@ There's a lot more to be had! Give it a try and find out. ### ⚡️ Jump Start ```shell -# Install the entire library -npm install react-spring -# or just install your specific target (recommended) +# Install the target you need npm install @react-spring/web +# or, for react-three-fiber +npm install @react-spring/three ``` ```jsx diff --git a/docs/app/components/HomeBlocks/HomeBlockTarget.tsx b/docs/app/components/HomeBlocks/HomeBlockTarget.tsx index b056caa530..ce93412eaf 100644 --- a/docs/app/components/HomeBlocks/HomeBlockTarget.tsx +++ b/docs/app/components/HomeBlocks/HomeBlockTarget.tsx @@ -24,22 +24,6 @@ const webHtml = /* html */ `

` -const nativeHtml = /* html */ `
import { animated, useSpring } from '@react-spring/native' -
-
export const MyComponent = () => { -
const { x } = useSpring({ -
from: { -
x: 0, -
}, -
to: { -
x: 1, -
}, -
}) -
-
return <animated.View style={{ x }} /> -
} -
` - const threeHtml = /* html */ `
import { animated, useSpring } from '@react-spring/three'
export const MyComponent = () => { @@ -56,39 +40,7 @@ const threeHtml = /* html */ `
}
` -const konvaHtml = /* html */ `
import { animated, useSpring } from '@react-spring/konva' -
-
export const MyComponent = () => { -
const { x } = useSpring({ -
from: { -
x: 0, -
}, -
to: { -
x: 1, -
}, -
}) -
-
return <animated.Rect x={x} /> -
} -
` - -const zdogHtml = /* html */ `
import { animated, useSpring } from '@react-spring/zdog' -
-
export const MyComponent = () => { -
const { x } = useSpring({ -
from: { -
x: 0, -
}, -
to: { -
x: 1, -
}, -
}) -
-
return <animated.Ellipse diameter={x} /> -
} -
` - -const dataFixtures = [webHtml, nativeHtml, threeHtml, konvaHtml, zdogHtml] +const dataFixtures = [webHtml, threeHtml] export const HomeBlockTarget = () => { const [index, setIndex] = useState(0) @@ -129,13 +81,10 @@ export const HomeBlockTarget = () => { href: '/docs/concepts/targets', }} > -

Choose from our five targets:

+

Choose from our active targets:

  • web
  • -
  • native
  • three
  • -
  • konva
  • -
  • zdog

Missing a target you want? Request we add it or create it yourself diff --git a/docs/app/routes/docs._index.mdx b/docs/app/routes/docs._index.mdx index a99112928d..72af45567b 100644 --- a/docs/app/routes/docs._index.mdx +++ b/docs/app/routes/docs._index.mdx @@ -54,7 +54,7 @@ v10 introduced the move to React 19 and brought a breaking change to the SpringC before: ```tsx -import { SpringContext } from 'react-spring' +import { SpringContext } from '@react-spring/web' ... @@ -63,7 +63,7 @@ import { SpringContext } from 'react-spring' now: ```tsx -import { SpringContextProvider } from 'react-spring' +import { SpringContextProvider } from '@react-spring/web' ... diff --git a/docs/app/routes/docs.concepts.targets.mdx b/docs/app/routes/docs.concepts.targets.mdx index f4c8e90643..b018a22c05 100644 --- a/docs/app/routes/docs.concepts.targets.mdx +++ b/docs/app/routes/docs.concepts.targets.mdx @@ -21,7 +21,7 @@ export const meta = formatFrontmatterToRemixMeta(frontmatter) When a target is discussed it is sometimes in reference to the platform, e.g. you create a client side react application chances are it's targeted at the browser. However, if you write a server-side application then you're targeting node. -Whilst `react-spring` does support the targets `web` and `native` and _can_ be server-side rendered. This is not the type +Whilst `react-spring` does support the targets `web` and `three` and _can_ be server-side rendered. This is not the type of target we're referring to. A target in `react-spring` is a `react reconciler` a.k.a `react renderer`. That is, a custom renderer that can process different @@ -31,10 +31,7 @@ a `reconciler`, it handles DOM elements _exclusively_ and understands how to app Therefore, in `react-spring` we have the following targets that correspond to their respective reconcilers: - `web` - `react-dom` -- `native` - `react-native` - `three` - `react-three-fiber` -- `konva` - `react-konva` -- `zdog` - `react-zdog` To download a target you can use the `@react-spring/[target]` format: @@ -80,7 +77,7 @@ interface HostConfig { Whilst the entire config object is wrapped in `Partial`, meaning that the keys are optional, realistically `applyAnimatedValues` is required. This is the logic for how the `Animated` components apply their `SpringValues`, this typically would come from the reconciler -either attached to the `instance` in the case of `react-konva` or an exported function like in `@react-three/fiber`. +either attached to the `instance` or an exported function like in `@react-three/fiber`. The `createAnimatedStyle` key of the config object by default takes wraps the `style` prop in an `AnimatedObject` instance which has generic rules on applying keys. In the case of `@react-spring/web`, we pass a custom function which is how we support shorthands for diff --git a/docs/app/routes/docs.guides.testing.mdx b/docs/app/routes/docs.guides.testing.mdx index 6dea832b4c..0303a598ab 100644 --- a/docs/app/routes/docs.guides.testing.mdx +++ b/docs/app/routes/docs.guides.testing.mdx @@ -219,4 +219,4 @@ module.exports = { } ``` -This could be applicable to any target you're using e.g. `@react-spring/native`. +This could be applicable to any target you're using e.g. `@react-spring/three`. diff --git a/package.json b/package.json index eeccde8712..96f089bda4 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" @@ -74,15 +73,11 @@ "@vitest/coverage-v8": "^4.1.7", "flush-microtasks": "1.0.1", "husky": "9.1.7", - "konva": "10.3.0", "oxfmt": "0.51.0", "oxlint": "1.66.0", "playwright": "^1.60.0", "react": "^19.2.6", "react-dom": "^19.2.6", - "react-konva": "^19.2.4", - "react-native": ">=0.85.3", - "react-zdog": "1.2.2", "spec.ts": "1.1.3", "three": "0.184.0", "tsdown": "0.22.0", @@ -90,8 +85,7 @@ "typescript": "6.0.3", "vite": "8.0.14", "vitest": "^4.1.7", - "vitest-browser-react": "^2.2.0", - "zdog": "1.1.3" + "vitest-browser-react": "^2.2.0" }, "publishConfig": { "access": "public" diff --git a/packages/animated/package.json b/packages/animated/package.json index 948418a3ae..98dc12082c 100644 --- a/packages/animated/package.json +++ b/packages/animated/package.json @@ -34,7 +34,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/packages/core/package.json b/packages/core/package.json index 59f63d44d9..ee58c2d947 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -37,7 +37,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/packages/core/src/hooks/index.ts b/packages/core/src/hooks/index.ts index 9333b37baa..6d6fb2bc20 100644 --- a/packages/core/src/hooks/index.ts +++ b/packages/core/src/hooks/index.ts @@ -8,7 +8,7 @@ export * from './useTransition' /** * This doesn't feel the right place for this? Should it be isolated to the `web` package? - * But then it wouldn't be available in `konva` or `three`... + * But then it wouldn't be available in `three`... */ export * from './useScroll' export * from './useResize' diff --git a/packages/core/src/hooks/useInView.native.ts b/packages/core/src/hooks/useInView.native.ts deleted file mode 100644 index 37132b4982..0000000000 --- a/packages/core/src/hooks/useInView.native.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { once, prefix } from '@react-spring/shared' - -const warnImplementation = once(console.warn) - -export const useInView = () => { - warnImplementation( - `${prefix}useInView is not implemented on native platforms. Consider submitting a PR to resolve this – https://github.com/pmndrs/react-spring` - ) - - return null -} diff --git a/packages/core/src/hooks/useResize.native.ts b/packages/core/src/hooks/useResize.native.ts deleted file mode 100644 index 2baae3cdee..0000000000 --- a/packages/core/src/hooks/useResize.native.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { once, prefix } from '@react-spring/shared' - -const warnImplementation = once(console.warn) - -export const useResize = () => { - warnImplementation( - `${prefix} useResize is not implemented on native platforms. Consider submitting a PR to resolve this – https://github.com/pmndrs/react-spring` - ) - - return null -} diff --git a/packages/core/src/hooks/useScroll.native.ts b/packages/core/src/hooks/useScroll.native.ts deleted file mode 100644 index de25811591..0000000000 --- a/packages/core/src/hooks/useScroll.native.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { once, prefix } from '@react-spring/shared' - -const warnImplementation = once(console.warn) - -export const useScroll = () => { - warnImplementation( - `${prefix}useScroll is not implemented on native platforms. Consider submitting a PR to resolve this – https://github.com/pmndrs/react-spring` - ) - - return null -} diff --git a/packages/parallax/package.json b/packages/parallax/package.json index 1cd4c0b308..3ee0708544 100644 --- a/packages/parallax/package.json +++ b/packages/parallax/package.json @@ -33,7 +33,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/packages/rafz/package.json b/packages/rafz/package.json index 2fa38ae9dc..b28ce472e9 100644 --- a/packages/rafz/package.json +++ b/packages/rafz/package.json @@ -34,7 +34,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/packages/react-spring/LICENSE b/packages/react-spring/LICENSE deleted file mode 100644 index a926771a85..0000000000 --- a/packages/react-spring/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-present Paul Henschel, react-spring, all contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/react-spring/README.md b/packages/react-spring/README.md deleted file mode 100644 index e3614ea095..0000000000 --- a/packages/react-spring/README.md +++ /dev/null @@ -1,115 +0,0 @@ -

- -

- -
- -

react-spring

-

A spring-physics first animation library
giving you flexible tools to confidently cast your ideas

- -
- -

- - - - - - - - Chat on Discord - -

- -
- -`react-spring` is a cross-platform spring-physics first animation library. - -It's as simple as: - -```jsx -const styles = useSpring({ - from: { - opacity: 0 - }, - to: { - opacity: 1 - } -}) - - -``` - -Just a small bit about us: - -- **Cross-Platform**: We support `react-dom`, `react-native`, `react-three-fiber`, `react-konva` & `react-zdog`. -- **Versatile**: Be declarative with your animations or if you prefer, imperative. -- **Spring-Physics First**: By default animation use springs for fluid interactivity, but we support durations with easings as well. - -There's a lot more to be had! Give it a try and find out. - -## Getting Started - -### ⚡️ Jump Start - -```shell -# Install the entire library -npm install react-spring -# or just install your specific target (recommended) -npm install @react-spring/web -``` - -```jsx -import { animated, useSpring } from '@react-spring/web' - -const FadeIn = ({ isVisible, children }) => { - const styles = useSpring({ - opacity: isVisible ? 1 : 0, - y: isVisible ? 0 : 24, - }) - - return {children} -} -``` - -It's as simple as that to create scroll-in animations when value of `isVisible` is toggled. - -### 📖 Documentation and Examples - -More documentation on the project can be found [here](https://www.react-spring.dev). - -Pages contain their own [examples](https://react-spring.dev/hooks/use-spring#demos) which you can check out there, or [open in codesandbox](https://codesandbox.io/s/github/pmndrs/react-spring/tree/main/demo/src/sandboxes/card) for a more in-depth view! - ---- - -## 📣 What others say - -

- -

- -## Used by - -

- - - -

- -And [many others...](https://github.com/pmndrs/react-spring/network/dependents) - -## Backers - -Thank you to all our backers! 🙏 If you want to join them here, then consider contributing to our [Opencollective](https://opencollective.com/react-spring). - - - - - -## Contributors - -This project exists thanks to all the people who contribute. - - - - diff --git a/packages/react-spring/package.json b/packages/react-spring/package.json deleted file mode 100644 index 31cb0904f6..0000000000 --- a/packages/react-spring/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "react-spring", - "version": "10.0.4", - "module": "./dist/react-spring.legacy-esm.js", - "main": "./dist/cjs/index.js", - "types": "./dist/react-spring.modern.d.mts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./dist/react-spring.modern.d.mts", - "default": "./dist/react-spring.modern.mjs" - }, - "require": { - "types": "./dist/cjs/react-spring.development.d.ts", - "default": "./dist/cjs/index.js" - } - } - }, - "files": [ - "dist/**/*", - "README.md", - "LICENSE" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/pmndrs/react-spring.git" - }, - "homepage": "https://github.com/pmndrs/react-spring#readme", - "keywords": [ - "animated", - "animation", - "hooks", - "motion", - "react", - "react-native", - "spring", - "typescript", - "velocity" - ], - "license": "MIT", - "author": "Paul Henschel", - "maintainers": [ - "Josh Ellis (https://github.com/joshuaellis)" - ], - "publishConfig": { - "provenance": true - }, - "dependencies": { - "@react-spring/core": "workspace:~", - "@react-spring/konva": "workspace:~", - "@react-spring/native": "workspace:~", - "@react-spring/three": "workspace:~", - "@react-spring/web": "workspace:~", - "@react-spring/zdog": "workspace:~" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "scripts": { - "build": "rm -rf dist && tsdown", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", - "dev": "tsdown --watch", - "pack": "pnpm pack && mv *.tgz package.tgz" - } -} diff --git a/packages/react-spring/src/index.ts b/packages/react-spring/src/index.ts deleted file mode 100644 index 9427774898..0000000000 --- a/packages/react-spring/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -export * from '@react-spring/web' diff --git a/packages/react-spring/src/konva.ts b/packages/react-spring/src/konva.ts deleted file mode 100644 index decb003997..0000000000 --- a/packages/react-spring/src/konva.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@react-spring/konva' diff --git a/packages/react-spring/src/native.ts b/packages/react-spring/src/native.ts deleted file mode 100644 index 702f965b49..0000000000 --- a/packages/react-spring/src/native.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@react-spring/native' diff --git a/packages/react-spring/src/three.ts b/packages/react-spring/src/three.ts deleted file mode 100644 index 6653ad0d7b..0000000000 --- a/packages/react-spring/src/three.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@react-spring/three' diff --git a/packages/react-spring/src/universal.ts b/packages/react-spring/src/universal.ts deleted file mode 100644 index 1704cfa57f..0000000000 --- a/packages/react-spring/src/universal.ts +++ /dev/null @@ -1,3 +0,0 @@ -// Note: You must make your own `animated` function, and you'll need to -// inject some globals too. For examples, look at the other platforms. -export * from '@react-spring/core' diff --git a/packages/react-spring/src/web.ts b/packages/react-spring/src/web.ts deleted file mode 100644 index 9427774898..0000000000 --- a/packages/react-spring/src/web.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -export * from '@react-spring/web' diff --git a/packages/react-spring/src/zdog.ts b/packages/react-spring/src/zdog.ts deleted file mode 100644 index cda3a295f7..0000000000 --- a/packages/react-spring/src/zdog.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@react-spring/zdog' diff --git a/packages/react-spring/tsdown.config.ts b/packages/react-spring/tsdown.config.ts deleted file mode 100644 index 0250bc8888..0000000000 --- a/packages/react-spring/tsdown.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsdown' -import { defaultConfig } from '../../tsdown.config.base.mjs' - -export default defineConfig( - defaultConfig({ - entry: 'src/index.ts', - name: 'react-spring', - }) -) diff --git a/packages/shared/package.json b/packages/shared/package.json index 240de587e2..fe81042600 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -34,7 +34,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/packages/shared/src/hooks/useIsomorphicLayoutEffect.native.ts b/packages/shared/src/hooks/useIsomorphicLayoutEffect.native.ts deleted file mode 100644 index 223e6b0fa0..0000000000 --- a/packages/shared/src/hooks/useIsomorphicLayoutEffect.native.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { useLayoutEffect } from 'react' - -export { useLayoutEffect as useIsomorphicLayoutEffect } diff --git a/packages/shared/src/hooks/useReducedMotion.native.ts b/packages/shared/src/hooks/useReducedMotion.native.ts deleted file mode 100644 index 0eca15e5cb..0000000000 --- a/packages/shared/src/hooks/useReducedMotion.native.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { useState } from 'react' -import { AccessibilityInfo } from 'react-native' - -import { assign } from '../globals' - -import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.native' - -/** - * Returns `boolean` or `null`, used to automatically - * set skipAnimations to the value of the user's - * `prefers-reduced-motion` query. - * - * The return value, post-effect, is the value of their prefered setting - */ -export const useReducedMotion = () => { - const [reducedMotion, setReducedMotion] = useState(null) - - useIsomorphicLayoutEffect(() => { - const handleMediaChange = (isReducedMotion: boolean) => { - setReducedMotion(isReducedMotion) - - assign({ - skipAnimation: isReducedMotion, - }) - } - - AccessibilityInfo.isReduceMotionEnabled().then(handleMediaChange) - - const motionSubscription = AccessibilityInfo.addEventListener( - 'reduceMotionChanged', - handleMediaChange - ) - - return () => { - motionSubscription.remove() - } - }, []) - - return reducedMotion -} diff --git a/packages/types/package.json b/packages/types/package.json index 194be2a6eb..492fd91223 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -34,7 +34,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 732ecae6fd..38703c0e36 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,9 +62,6 @@ importers: husky: specifier: 9.1.7 version: 9.1.7 - konva: - specifier: 10.3.0 - version: 10.3.0 oxfmt: specifier: 0.51.0 version: 0.51.0 @@ -80,15 +77,6 @@ importers: react-dom: specifier: ^19.2.6 version: 19.2.6(react@19.2.6) - react-konva: - specifier: ^19.2.4 - version: 19.2.4(@types/react@19.2.15)(konva@10.3.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6) - react-native: - specifier: '>=0.85.3' - version: 0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6) - react-zdog: - specifier: 1.2.2 - version: 1.2.2 spec.ts: specifier: 1.1.3 version: 1.1.3 @@ -113,9 +101,6 @@ importers: vitest-browser-react: specifier: ^2.2.0 version: 2.2.0(@types/react-dom@19.2.3(@types/react@19.2.15))(@types/react@19.2.15)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(vitest@4.1.7) - zdog: - specifier: 1.1.3 - version: 1.1.3 demo: dependencies: @@ -410,33 +395,6 @@ importers: packages/rafz: {} - packages/react-spring: - dependencies: - '@react-spring/core': - specifier: workspace:~ - version: link:../core - '@react-spring/konva': - specifier: workspace:~ - version: link:../../targets/konva - '@react-spring/native': - specifier: workspace:~ - version: link:../../targets/native - '@react-spring/three': - specifier: workspace:~ - version: link:../../targets/three - '@react-spring/web': - specifier: workspace:~ - version: link:../../targets/web - '@react-spring/zdog': - specifier: workspace:~ - version: link:../../targets/zdog - react: - specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - version: 19.2.6 - react-dom: - specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - version: 19.2.6(react@19.2.6) - packages/shared: dependencies: '@react-spring/rafz': @@ -451,51 +409,6 @@ importers: packages/types: {} - targets/konva: - dependencies: - '@react-spring/animated': - specifier: workspace:~ - version: link:../../packages/animated - '@react-spring/core': - specifier: workspace:~ - version: link:../../packages/core - '@react-spring/shared': - specifier: workspace:~ - version: link:../../packages/shared - '@react-spring/types': - specifier: workspace:~ - version: link:../../packages/types - konva: - specifier: '>=2.6' - version: 10.3.0 - react: - specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - version: 19.2.6 - react-konva: - specifier: ^19 - version: 19.2.4(@types/react@19.2.15)(konva@10.3.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6) - - targets/native: - dependencies: - '@react-spring/animated': - specifier: workspace:~ - version: link:../../packages/animated - '@react-spring/core': - specifier: workspace:~ - version: link:../../packages/core - '@react-spring/shared': - specifier: workspace:~ - version: link:../../packages/shared - '@react-spring/types': - specifier: workspace:~ - version: link:../../packages/types - react: - specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 - version: 19.2.6 - react-native: - specifier: '>=0.78' - version: 0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6) - targets/three: dependencies: '@react-spring/animated': @@ -544,33 +457,6 @@ importers: specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 version: 19.2.6(react@19.2.6) - targets/zdog: - dependencies: - '@react-spring/animated': - specifier: workspace:~ - version: link:../../packages/animated - '@react-spring/core': - specifier: workspace:~ - version: link:../../packages/core - '@react-spring/shared': - specifier: workspace:~ - version: link:../../packages/shared - '@react-spring/types': - specifier: workspace:~ - version: link:../../packages/types - react: - specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 - version: 18.3.1 - react-dom: - specifier: ^16.8.0 || ^17.0.0 || ^18.0.0 - version: 18.3.1(react@18.3.1) - react-zdog: - specifier: '>=1.0' - version: 1.2.2 - zdog: - specifier: '>=1.0' - version: 1.1.3 - packages: '@algolia/abtesting@1.18.1': @@ -2870,11 +2756,6 @@ packages: peerDependencies: '@types/react': '*' - '@types/react-reconciler@0.33.0': - resolution: {integrity: sha512-HZOXsKT0tGI9LlUw2LuedXsVeB88wFa536vVL0M6vE8zN63nI+sSr1ByxmPToP5K5bukaVscyeCJcF9guVNJ1g==} - peerDependencies: - '@types/react': '*' - '@types/react-transition-group@4.4.12': resolution: {integrity: sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==} peerDependencies: @@ -4220,9 +4101,6 @@ packages: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} - konva@10.3.0: - resolution: {integrity: sha512-gt19K2gzY4lHbnkvsku7eSmB+A9PTS2jG4F9coBMsdjM1UKfJNxJbDbXVpeCW1wjEGRwBD3nBamcHnqJhAeKlg==} - leva@0.10.1: resolution: {integrity: sha512-BcjnfUX8jpmwZUz2L7AfBtF9vn4ggTH33hmeufDULbP3YgNZ/C+ss/oO3stbrqRQyaOmRwy70y7BGTGO81S3rA==} peerDependencies: @@ -4971,11 +4849,6 @@ packages: react-devtools-inline@4.4.0: resolution: {integrity: sha512-ES0GolSrKO8wsKbsEkVeiR/ZAaHQTY4zDh1UW8DImVmm8oaGLl3ijJDvSGe+qDRKPZdPRnDtWWnSvvrgxXdThQ==} - react-dom@18.3.1: - resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==} - peerDependencies: - react: ^18.3.1 - react-dom@19.2.6: resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==} peerDependencies: @@ -5001,13 +4874,6 @@ packages: react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} - react-konva@19.2.4: - resolution: {integrity: sha512-AjRT4CwGprm/DV7fTXAjLCjYgNKZlwL+ghhw1pb1RSL7E0BKOlXeiiUSfF/ajd7OdSJOhkf9iuVUNlFk1PvlzQ==} - peerDependencies: - konva: ^8.0.1 || ^7.2.5 || ^9.0.0 || ^10.0.0 - react: ^19.2.0 - react-dom: ^19.2.0 - react-native@0.85.3: resolution: {integrity: sha512-HN/fGC+3nZVcDNcw7gfbM/DuqZAvI9Mz+/SxuhODaua4JY0BPzhfTzWXRyTR4mRgMHmShTPpH2PYMTxvZrsdZA==} engines: {node: ^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0} @@ -5022,12 +4888,6 @@ packages: '@types/react': optional: true - react-reconciler@0.33.0: - resolution: {integrity: sha512-KetWRytFv1epdpJc3J4G75I4WrplZE5jOL7Yq0p34+OVOKF4Se7WrdIdVC45XsSSmUTlht2FM/fM1FZb1mfQeA==} - engines: {node: '>=0.10.0'} - peerDependencies: - react: ^19.2.0 - react-refresh@0.14.2: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} @@ -5093,9 +4953,6 @@ packages: react-dom: optional: true - react-zdog@1.2.2: - resolution: {integrity: sha512-Ix7ALha91aOEwiHuxumCeYbARS5XNpc/w0v145oGkM6poF/CvhKJwzLhM5sEZbtrghMA+psAhOJkCTzJoseicA==} - react95@4.0.0: resolution: {integrity: sha512-C/2Ecws+ShHMJa3/ki6d3ufCukEYyZ+up45NJhX+uecFh5sXNdkEX8bPZ4pKTGl0mSTMkiCJTGOJB1Gmf1W3dA==} peerDependencies: @@ -5103,10 +4960,6 @@ packages: react-dom: '>= 16.8.0' styled-components: '>= 5.3.3' - react@18.3.1: - resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} - engines: {node: '>=0.10.0'} - react@19.2.6: resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} engines: {node: '>=0.10.0'} @@ -5188,9 +5041,6 @@ packages: require-like@0.1.2: resolution: {integrity: sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==} - resize-observer-polyfill@1.5.1: - resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} - resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -5260,9 +5110,6 @@ packages: engines: {node: '>=20.19.0'} hasBin: true - scheduler@0.23.2: - resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==} - scheduler@0.27.0: resolution: {integrity: sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==} @@ -6044,9 +5891,6 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zdog@1.1.3: - resolution: {integrity: sha512-raRj6r0gPzopFm5XWBJZr/NuV4EEnT4iE+U3dp5FV5pCb588Gmm3zLIp/j9yqqcMiHH8VNQlerLTgOqL7krh6w==} - zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} @@ -7091,11 +6935,13 @@ snapshots: optionalDependencies: '@types/node': 25.9.1 - '@isaacs/ttlcache@1.4.1': {} + '@isaacs/ttlcache@1.4.1': + optional: true '@jest/schemas@29.6.3': dependencies: '@sinclair/typebox': 0.27.10 + optional: true '@jest/types@29.6.3': dependencies: @@ -7105,6 +6951,7 @@ snapshots: '@types/node': 25.9.1 '@types/yargs': 17.0.35 chalk: 4.1.2 + optional: true '@jridgewell/gen-mapping@0.3.13': dependencies: @@ -7122,6 +6969,7 @@ snapshots: dependencies: '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 + optional: true '@jridgewell/sourcemap-codec@1.5.5': {} @@ -7827,7 +7675,8 @@ snapshots: dependencies: react: 19.2.6 - '@react-native/assets-registry@0.85.3': {} + '@react-native/assets-registry@0.85.3': + optional: true '@react-native/codegen@0.85.3(@babel/core@7.29.0)': dependencies: @@ -7838,6 +7687,7 @@ snapshots: nullthrows: 1.1.1 tinyglobby: 0.2.16 yargs: 17.7.2 + optional: true '@react-native/community-cli-plugin@0.85.3': dependencies: @@ -7852,8 +7702,10 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true - '@react-native/debugger-frontend@0.85.3': {} + '@react-native/debugger-frontend@0.85.3': + optional: true '@react-native/debugger-shell@0.85.3': dependencies: @@ -7862,6 +7714,7 @@ snapshots: fb-dotslash: 0.5.8 transitivePeerDependencies: - supports-color + optional: true '@react-native/dev-middleware@0.85.3': dependencies: @@ -7881,12 +7734,16 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true - '@react-native/gradle-plugin@0.85.3': {} + '@react-native/gradle-plugin@0.85.3': + optional: true - '@react-native/js-polyfills@0.85.3': {} + '@react-native/js-polyfills@0.85.3': + optional: true - '@react-native/normalize-colors@0.85.3': {} + '@react-native/normalize-colors@0.85.3': + optional: true '@react-native/virtualized-lists@0.85.3(@types/react@19.2.15)(react-native@0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6))(react@19.2.6)': dependencies: @@ -7896,6 +7753,7 @@ snapshots: react-native: 0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6) optionalDependencies: '@types/react': 19.2.15 + optional: true '@react-router/dev@7.15.1(@react-router/serve@7.15.1(react-router@7.15.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(typescript@5.7.2))(@types/node@25.9.1)(babel-plugin-macros@3.1.0)(jiti@2.6.1)(lightningcss@1.32.0)(react-router@7.15.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6))(sass@1.100.0)(terser@5.48.0)(tsx@4.22.3)(typescript@5.7.2)(vite@8.0.14(@types/node@25.9.1)(esbuild@0.28.0)(jiti@2.6.1)(sass@1.100.0)(terser@5.48.0)(tsx@4.22.3)(yaml@2.9.0))(yaml@2.9.0)': dependencies: @@ -8182,7 +8040,8 @@ snapshots: '@simple-libs/stream-utils@1.2.0': {} - '@sinclair/typebox@0.27.10': {} + '@sinclair/typebox@0.27.10': + optional: true '@standard-schema/spec@1.1.0': {} @@ -8307,15 +8166,18 @@ snapshots: dependencies: '@types/unist': 3.0.3 - '@types/istanbul-lib-coverage@2.0.6': {} + '@types/istanbul-lib-coverage@2.0.6': + optional: true '@types/istanbul-lib-report@3.0.3': dependencies: '@types/istanbul-lib-coverage': 2.0.6 + optional: true '@types/istanbul-reports@3.0.4': dependencies: '@types/istanbul-lib-report': 3.0.3 + optional: true '@types/jsesc@2.5.1': {} @@ -8361,10 +8223,6 @@ snapshots: dependencies: '@types/react': 19.2.15 - '@types/react-reconciler@0.33.0(@types/react@19.2.15)': - dependencies: - '@types/react': 19.2.15 - '@types/react-transition-group@4.4.12(@types/react@19.2.15)': dependencies: '@types/react': 19.2.15 @@ -8390,11 +8248,13 @@ snapshots: '@types/webxr@0.5.24': {} - '@types/yargs-parser@21.0.3': {} + '@types/yargs-parser@21.0.3': + optional: true '@types/yargs@17.0.35': dependencies: '@types/yargs-parser': 21.0.3 + optional: true '@ungap/structured-clone@1.3.1': {} @@ -8591,6 +8451,7 @@ snapshots: abort-controller@3.0.0: dependencies: event-target-shim: 5.0.1 + optional: true accepts@1.3.8: dependencies: @@ -8601,6 +8462,7 @@ snapshots: dependencies: mime-types: 3.0.2 negotiator: 1.0.0 + optional: true acorn-jsx@5.3.2(acorn@8.16.0): dependencies: @@ -8608,7 +8470,8 @@ snapshots: acorn@8.16.0: {} - agent-base@7.1.4: {} + agent-base@7.1.4: + optional: true ajv@8.20.0: dependencies: @@ -8634,7 +8497,8 @@ snapshots: '@algolia/requester-fetch': 5.52.1 '@algolia/requester-node-http': 5.52.1 - anser@1.4.10: {} + anser@1.4.10: + optional: true anser@2.3.5: {} @@ -8648,7 +8512,8 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@5.2.0: {} + ansi-styles@5.2.0: + optional: true ansi-styles@6.2.3: {} @@ -8672,7 +8537,8 @@ snapshots: array-union@2.1.0: {} - asap@2.0.6: {} + asap@2.0.6: + optional: true assertion-error@2.0.1: {} @@ -8712,6 +8578,7 @@ snapshots: babel-plugin-syntax-hermes-parser@0.33.3: dependencies: hermes-parser: 0.33.3 + optional: true bail@2.0.2: {} @@ -8771,6 +8638,7 @@ snapshots: bser@2.1.1: dependencies: node-int64: 0.4.0 + optional: true buffer-from@1.1.2: {} @@ -8797,7 +8665,8 @@ snapshots: callsites@3.1.0: {} - camelcase@6.3.0: {} + camelcase@6.3.0: + optional: true camera-controls@3.1.2(three@0.184.0): dependencies: @@ -8840,6 +8709,7 @@ snapshots: lighthouse-logger: 1.4.2 transitivePeerDependencies: - supports-color + optional: true chromium-edge-launcher@0.3.0: dependencies: @@ -8850,10 +8720,13 @@ snapshots: mkdirp: 1.0.4 transitivePeerDependencies: - supports-color + optional: true - ci-info@2.0.0: {} + ci-info@2.0.0: + optional: true - ci-info@3.9.0: {} + ci-info@3.9.0: + optional: true clean-set@1.1.2: {} @@ -8883,9 +8756,11 @@ snapshots: comma-separated-tokens@2.0.3: {} - commander@12.1.0: {} + commander@12.1.0: + optional: true - commander@2.20.3: {} + commander@2.20.3: + optional: true compare-func@2.0.0: dependencies: @@ -8929,6 +8804,7 @@ snapshots: utils-merge: 1.0.1 transitivePeerDependencies: - supports-color + optional: true content-disposition@0.5.4: dependencies: @@ -9087,7 +8963,8 @@ snapshots: empathic@2.0.1: {} - encodeurl@1.0.2: {} + encodeurl@1.0.2: + optional: true encodeurl@2.0.0: {} @@ -9107,6 +8984,7 @@ snapshots: error-stack-parser@2.1.4: dependencies: stackframe: 1.3.4 + optional: true es-define-property@1.0.1: {} @@ -9282,13 +9160,15 @@ snapshots: d: 1.0.2 es5-ext: 0.10.64 - event-target-shim@5.0.1: {} + event-target-shim@5.0.1: + optional: true exit-hook@2.2.1: {} expect-type@1.3.0: {} - exponential-backoff@3.1.3: {} + exponential-backoff@3.1.3: + optional: true express@4.22.2: dependencies: @@ -9365,11 +9245,13 @@ snapshots: dependencies: format: 0.2.2 - fb-dotslash@0.5.8: {} + fb-dotslash@0.5.8: + optional: true fb-watchman@2.0.2: dependencies: bser: 2.1.1 + optional: true fdir@6.5.0(picomatch@4.0.4): optionalDependencies: @@ -9398,6 +9280,7 @@ snapshots: unpipe: 1.0.0 transitivePeerDependencies: - supports-color + optional: true finalhandler@1.3.2: dependencies: @@ -9423,7 +9306,8 @@ snapshots: locate-path: 6.0.0 path-exists: 4.0.0 - flow-enums-runtime@0.0.6: {} + flow-enums-runtime@0.0.6: + optional: true flush-microtasks@1.0.1: {} @@ -9648,19 +9532,24 @@ snapshots: property-information: 7.1.0 space-separated-tokens: 2.0.2 - hermes-compiler@250829098.0.10: {} + hermes-compiler@250829098.0.10: + optional: true - hermes-estree@0.33.3: {} + hermes-estree@0.33.3: + optional: true - hermes-estree@0.35.0: {} + hermes-estree@0.35.0: + optional: true hermes-parser@0.33.3: dependencies: hermes-estree: 0.33.3 + optional: true hermes-parser@0.35.0: dependencies: hermes-estree: 0.35.0 + optional: true hls.js@1.6.16: {} @@ -9688,6 +9577,7 @@ snapshots: debug: 4.4.3 transitivePeerDependencies: - supports-color + optional: true human-id@4.1.3: {} @@ -9708,6 +9598,7 @@ snapshots: image-size@1.2.1: dependencies: queue: 6.0.2 + optional: true immediate@3.0.6: {} @@ -9731,6 +9622,7 @@ snapshots: invariant@2.2.4: dependencies: loose-envify: 1.4.0 + optional: true ipaddr.js@1.9.1: {} @@ -9749,7 +9641,8 @@ snapshots: is-decimal@2.0.1: {} - is-docker@2.2.1: {} + is-docker@2.2.1: + optional: true is-extendable@0.1.1: {} @@ -9788,6 +9681,7 @@ snapshots: is-wsl@2.2.0: dependencies: is-docker: 2.2.1 + optional: true isbot@5.1.40: {} @@ -9817,7 +9711,8 @@ snapshots: javascript-stringify@2.1.0: {} - jest-get-type@29.6.3: {} + jest-get-type@29.6.3: + optional: true jest-util@29.7.0: dependencies: @@ -9827,6 +9722,7 @@ snapshots: ci-info: 3.9.0 graceful-fs: 4.2.11 picomatch: 2.3.2 + optional: true jest-validate@29.7.0: dependencies: @@ -9836,6 +9732,7 @@ snapshots: jest-get-type: 29.6.3 leven: 3.1.0 pretty-format: 29.7.0 + optional: true jest-worker@29.7.0: dependencies: @@ -9843,6 +9740,7 @@ snapshots: jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 + optional: true jiti@2.6.1: {} @@ -9859,7 +9757,8 @@ snapshots: dependencies: argparse: 2.0.1 - jsc-safe-url@0.2.4: {} + jsc-safe-url@0.2.4: + optional: true jsesc@3.0.2: {} @@ -9881,8 +9780,6 @@ snapshots: kind-of@6.0.3: {} - konva@10.3.0: {} - leva@0.10.1(@types/react-dom@19.2.3(@types/react@19.2.15))(@types/react@19.2.15)(react-dom@19.2.6(react@19.2.6))(react@19.2.6): dependencies: '@radix-ui/react-portal': 1.1.10(@types/react-dom@19.2.3(@types/react@19.2.15))(@types/react@19.2.15)(react-dom@19.2.6(react@19.2.6))(react@19.2.6) @@ -9902,7 +9799,8 @@ snapshots: - '@types/react' - '@types/react-dom' - leven@3.1.0: {} + leven@3.1.0: + optional: true lie@3.3.0: dependencies: @@ -9914,6 +9812,7 @@ snapshots: marky: 1.3.0 transitivePeerDependencies: - supports-color + optional: true lightningcss-android-arm64@1.32.0: optional: true @@ -9984,7 +9883,8 @@ snapshots: lodash.startcase@4.4.0: {} - lodash.throttle@4.1.1: {} + lodash.throttle@4.1.1: + optional: true lodash@4.18.1: {} @@ -10026,10 +9926,12 @@ snapshots: makeerror@1.0.12: dependencies: tmpl: 1.0.5 + optional: true markdown-extensions@2.0.0: {} - marky@1.3.0: {} + marky@1.3.0: + optional: true math-intrinsics@1.1.0: {} @@ -10163,7 +10065,8 @@ snapshots: media-typer@0.3.0: {} - memoize-one@5.2.1: {} + memoize-one@5.2.1: + optional: true memoize-one@6.0.0: {} @@ -10171,7 +10074,8 @@ snapshots: merge-descriptors@1.0.3: {} - merge-stream@2.0.0: {} + merge-stream@2.0.0: + optional: true merge-value@1.0.0: dependencies: @@ -10199,10 +10103,12 @@ snapshots: nullthrows: 1.1.1 transitivePeerDependencies: - supports-color + optional: true metro-cache-key@0.84.4: dependencies: flow-enums-runtime: 0.0.6 + optional: true metro-cache@0.84.4: dependencies: @@ -10212,6 +10118,7 @@ snapshots: metro-core: 0.84.4 transitivePeerDependencies: - supports-color + optional: true metro-config@0.84.4: dependencies: @@ -10227,12 +10134,14 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true metro-core@0.84.4: dependencies: flow-enums-runtime: 0.0.6 lodash.throttle: 4.1.1 metro-resolver: 0.84.4 + optional: true metro-file-map@0.84.4: dependencies: @@ -10247,20 +10156,24 @@ snapshots: walker: 1.0.8 transitivePeerDependencies: - supports-color + optional: true metro-minify-terser@0.84.4: dependencies: flow-enums-runtime: 0.0.6 terser: 5.48.0 + optional: true metro-resolver@0.84.4: dependencies: flow-enums-runtime: 0.0.6 + optional: true metro-runtime@0.84.4: dependencies: '@babel/runtime': 7.29.2 flow-enums-runtime: 0.0.6 + optional: true metro-source-map@0.84.4: dependencies: @@ -10275,6 +10188,7 @@ snapshots: vlq: 1.0.1 transitivePeerDependencies: - supports-color + optional: true metro-symbolicate@0.84.4: dependencies: @@ -10286,6 +10200,7 @@ snapshots: vlq: 1.0.1 transitivePeerDependencies: - supports-color + optional: true metro-transform-plugins@0.84.4: dependencies: @@ -10297,6 +10212,7 @@ snapshots: nullthrows: 1.1.1 transitivePeerDependencies: - supports-color + optional: true metro-transform-worker@0.84.4: dependencies: @@ -10317,6 +10233,7 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true metro@0.84.4: dependencies: @@ -10363,6 +10280,7 @@ snapshots: - bufferutil - supports-color - utf-8-validate + optional: true micromark-core-commonmark@2.0.3: dependencies: @@ -10603,6 +10521,7 @@ snapshots: mime-types@3.0.2: dependencies: mime-db: 1.54.0 + optional: true mime@1.6.0: {} @@ -10617,7 +10536,8 @@ snapshots: for-in: 1.0.2 is-extendable: 1.0.1 - mkdirp@1.0.4: {} + mkdirp@1.0.4: + optional: true mlly@1.8.2: dependencies: @@ -10652,7 +10572,8 @@ snapshots: negotiator@0.6.4: {} - negotiator@1.0.0: {} + negotiator@1.0.0: + optional: true next-tick@1.1.0: {} @@ -10663,15 +10584,18 @@ snapshots: dependencies: whatwg-url: 5.0.0 - node-int64@0.4.0: {} + node-int64@0.4.0: + optional: true node-releases@2.0.46: {} - nullthrows@1.1.1: {} + nullthrows@1.1.1: + optional: true ob1@0.84.4: dependencies: flow-enums-runtime: 0.0.6 + optional: true object-assign@4.1.1: {} @@ -10693,6 +10617,7 @@ snapshots: dependencies: is-docker: 2.2.1 is-wsl: 2.2.0 + optional: true outdent@0.5.0: {} @@ -10868,6 +10793,7 @@ snapshots: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 react-is: 18.3.1 + optional: true promise-worker-transferable@1.0.4: dependencies: @@ -10877,6 +10803,7 @@ snapshots: promise@8.3.0: dependencies: asap: 2.0.6 + optional: true prop-types@15.8.1: dependencies: @@ -10904,6 +10831,7 @@ snapshots: queue@6.0.2: dependencies: inherits: 2.0.4 + optional: true range-parser@1.2.1: {} @@ -10926,17 +10854,12 @@ snapshots: transitivePeerDependencies: - bufferutil - utf-8-validate + optional: true react-devtools-inline@4.4.0: dependencies: es6-symbol: 3.1.4 - react-dom@18.3.1(react@18.3.1): - dependencies: - loose-envify: 1.4.0 - react: 18.3.1 - scheduler: 0.23.2 - react-dom@19.2.6(react@19.2.6): dependencies: react: 19.2.6 @@ -10958,19 +10881,8 @@ snapshots: react-is@17.0.2: {} - react-is@18.3.1: {} - - react-konva@19.2.4(@types/react@19.2.15)(konva@10.3.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6): - dependencies: - '@types/react-reconciler': 0.33.0(@types/react@19.2.15) - its-fine: 2.0.0(@types/react@19.2.15)(react@19.2.6) - konva: 10.3.0 - react: 19.2.6 - react-dom: 19.2.6(react@19.2.6) - react-reconciler: 0.33.0(react@19.2.6) - scheduler: 0.27.0 - transitivePeerDependencies: - - '@types/react' + react-is@18.3.1: + optional: true react-native@0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6): dependencies: @@ -11016,11 +10928,7 @@ snapshots: - bufferutil - supports-color - utf-8-validate - - react-reconciler@0.33.0(react@19.2.6): - dependencies: - react: 19.2.6 - scheduler: 0.27.0 + optional: true react-refresh@0.14.2: {} @@ -11091,22 +10999,12 @@ snapshots: optionalDependencies: react-dom: 19.2.6(react@19.2.6) - react-zdog@1.2.2: - dependencies: - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - resize-observer-polyfill: 1.5.1 - react95@4.0.0(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(styled-components@6.4.2(react-dom@19.2.6(react@19.2.6))(react-native@0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6))(react@19.2.6)): dependencies: react: 19.2.6 react-dom: 19.2.6(react@19.2.6) styled-components: 6.4.2(react-dom@19.2.6(react@19.2.6))(react-native@0.85.3(@babel/core@7.29.0)(@types/react@19.2.15)(react@19.2.6))(react@19.2.6) - react@18.3.1: - dependencies: - loose-envify: 1.4.0 - react@19.2.6: {} read-yaml-file@1.1.0: @@ -11156,7 +11054,8 @@ snapshots: hastscript: 9.0.1 parse-entities: 4.0.2 - regenerator-runtime@0.13.11: {} + regenerator-runtime@0.13.11: + optional: true regexparam@3.0.0: {} @@ -11248,8 +11147,6 @@ snapshots: require-like@0.1.2: {} - resize-observer-polyfill@1.5.1: {} - resolve-from@4.0.0: {} resolve-from@5.0.0: {} @@ -11355,10 +11252,6 @@ snapshots: optionalDependencies: '@parcel/watcher': 2.5.6 - scheduler@0.23.2: - dependencies: - loose-envify: 1.4.0 - scheduler@0.27.0: {} search-insights@2.17.3: {} @@ -11390,7 +11283,8 @@ snapshots: transitivePeerDependencies: - supports-color - serialize-error@2.1.0: {} + serialize-error@2.1.0: + optional: true serve-static@1.16.3: dependencies: @@ -11490,11 +11384,13 @@ snapshots: stackback@0.0.2: {} - stackframe@1.3.4: {} + stackframe@1.3.4: + optional: true stacktrace-parser@0.1.11: dependencies: type-fest: 0.7.1 + optional: true static-browser-server@1.0.3: dependencies: @@ -11510,7 +11406,8 @@ snapshots: stats.js@0.17.0: {} - statuses@1.5.0: {} + statuses@1.5.0: + optional: true statuses@2.0.2: {} @@ -11593,6 +11490,7 @@ snapshots: acorn: 8.16.0 commander: 2.20.3 source-map-support: 0.5.21 + optional: true three-mesh-bvh@0.8.3(three@0.184.0): dependencies: @@ -11610,7 +11508,8 @@ snapshots: three@0.184.0: {} - throat@5.0.0: {} + throat@5.0.0: + optional: true tinybench@2.9.0: {} @@ -11625,7 +11524,8 @@ snapshots: tinyrainbow@3.1.0: {} - tmpl@1.0.5: {} + tmpl@1.0.5: + optional: true to-regex-range@5.0.1: dependencies: @@ -11714,7 +11614,8 @@ snapshots: '@turbo/windows-64': 2.9.16 '@turbo/windows-arm64': 2.9.16 - type-fest@0.7.1: {} + type-fest@0.7.1: + optional: true type-is@1.6.18: dependencies: @@ -11974,13 +11875,15 @@ snapshots: transitivePeerDependencies: - msw - vlq@1.0.1: {} + vlq@1.0.1: + optional: true w3c-keyname@2.2.8: {} walker@1.0.8: dependencies: makeerror: 1.0.12 + optional: true web-namespaces@2.0.1: {} @@ -11990,7 +11893,8 @@ snapshots: webidl-conversions@3.0.1: {} - whatwg-fetch@3.6.20: {} + whatwg-fetch@3.6.20: + optional: true whatwg-url@5.0.0: dependencies: @@ -12025,7 +11929,8 @@ snapshots: string-width: 7.2.0 strip-ansi: 7.2.0 - ws@7.5.10: {} + ws@7.5.10: + optional: true ws@8.20.1: {} @@ -12062,8 +11967,6 @@ snapshots: yocto-queue@0.1.0: {} - zdog@1.1.3: {} - zod@4.4.3: {} zustand@3.7.2(react@19.2.6): diff --git a/renovate.json b/renovate.json index 23b9f2db27..c7fb12aec7 100644 --- a/renovate.json +++ b/renovate.json @@ -21,10 +21,6 @@ "@types/react-dom" ] }, - { - "groupName": "react-native", - "matchPackageNames": ["react-native"] - }, { "groupName": "react-three", "matchPackageNames": [ @@ -35,14 +31,6 @@ "three-stdlib" ] }, - { - "groupName": "konva", - "matchPackageNames": ["konva", "react-konva"] - }, - { - "groupName": "zdog", - "matchPackageNames": ["zdog", "react-zdog"] - }, { "groupName": "remix", "matchPackageNames": ["@remix-run/**", "@vercel/remix"] diff --git a/scripts/remove-dist-tag.sh b/scripts/remove-dist-tag.sh index 35050d2a92..ea6969e4cf 100755 --- a/scripts/remove-dist-tag.sh +++ b/scripts/remove-dist-tag.sh @@ -13,7 +13,7 @@ if [[ -z "$tag" ]]; then fi # This is the list of packages to remove the tag from -packages=('react-spring' '@react-spring/animated' '@react-spring/core' '@react-spring/parallax' '@react-spring/rafz' '@react-spring/shared' '@react-spring/types' '@react-spring/web' '@react-spring/konva' '@react-spring/native' '@react-spring/three' '@react-spring/zdog') +packages=('@react-spring/animated' '@react-spring/core' '@react-spring/parallax' '@react-spring/rafz' '@react-spring/shared' '@react-spring/types' '@react-spring/web' '@react-spring/three') # Loop over the packages for package in "${packages[@]}"; do diff --git a/targets/konva/LICENSE b/targets/konva/LICENSE deleted file mode 100644 index a926771a85..0000000000 --- a/targets/konva/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-present Paul Henschel, react-spring, all contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/targets/konva/README.md b/targets/konva/README.md deleted file mode 100644 index 23a8e6c166..0000000000 --- a/targets/konva/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @react-spring/konva - -[`konva`](https://github.com/konvajs/konva) support diff --git a/targets/konva/package.json b/targets/konva/package.json deleted file mode 100644 index 89a28d98fc..0000000000 --- a/targets/konva/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "@react-spring/konva", - "version": "10.1.1", - "module": "./dist/react-spring_konva.legacy-esm.js", - "main": "./dist/cjs/index.js", - "types": "./dist/react-spring_konva.modern.d.mts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./dist/react-spring_konva.modern.d.mts", - "default": "./dist/react-spring_konva.modern.mjs" - }, - "require": { - "types": "./dist/cjs/react-spring_konva.development.d.ts", - "default": "./dist/cjs/index.js" - } - } - }, - "files": [ - "dist/**/*", - "README.md", - "LICENSE" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/pmndrs/react-spring.git" - }, - "homepage": "https://github.com/pmndrs/react-spring#readme", - "keywords": [ - "animated", - "animation", - "hooks", - "motion", - "react", - "react-native", - "spring", - "typescript", - "velocity" - ], - "license": "MIT", - "author": "Paul Henschel", - "maintainers": [ - "Josh Ellis (https://github.com/joshuaellis)" - ], - "publishConfig": { - "provenance": true - }, - "dependencies": { - "@react-spring/animated": "workspace:~", - "@react-spring/core": "workspace:~", - "@react-spring/shared": "workspace:~", - "@react-spring/types": "workspace:~" - }, - "peerDependencies": { - "konva": ">=2.6", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-konva": "^19" - }, - "scripts": { - "build": "rm -rf dist && tsdown", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", - "dev": "tsdown --watch", - "pack": "pnpm pack && mv *.tgz package.tgz" - } -} diff --git a/targets/konva/src/animated.ts b/targets/konva/src/animated.ts deleted file mode 100644 index 92c4c8eac4..0000000000 --- a/targets/konva/src/animated.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { CSSProperties, ForwardRefExoticComponent } from 'react' -import { - AssignableKeys, - ComponentPropsWithRef, - ElementType, -} from '@react-spring/types' -import { FluidValue } from '@react-spring/shared' -import { KonvaExports, Primitives } from './primitives' - -type AnimatedPrimitives = { - [P in Primitives]: AnimatedComponent -} - -/** The type of the `animated()` function */ -export type WithAnimated = { - (wrappedComponent: T): AnimatedComponent -} & AnimatedPrimitives - -/** The type of an `animated()` component */ -export type AnimatedComponent = - ForwardRefExoticComponent>> - -/** The props of an `animated()` component */ -export type AnimatedProps = { - [P in keyof Props]: P extends 'ref' | 'key' - ? Props[P] - : AnimatedProp -} - -// The animated prop value of a React element -type AnimatedProp = [T, T] extends [infer T, infer DT] - ? [DT] extends [never] - ? never - : DT extends void - ? undefined - : DT extends object - ? [AssignableKeys] extends [never] - ? DT extends ReadonlyArray - ? AnimatedStyles
- : DT - : AnimatedStyle - : DT | AnimatedLeaf - : never - -// An animated array of style objects -type AnimatedStyles> = { - [P in keyof T]: [T[P]] extends [infer DT] - ? DT extends object - ? [AssignableKeys] extends [never] - ? DT extends ReadonlyArray - ? AnimatedStyles
- : DT - : { [P in keyof DT]: AnimatedProp } - : DT - : never -} - -// An animated object of style attributes -type AnimatedStyle = [T, T] extends [infer T, infer DT] - ? DT extends void - ? undefined - : [DT] extends [never] - ? never - : DT extends object - ? { [P in keyof DT]: AnimatedStyle } - : DT | AnimatedLeaf - : never - -// An animated primitive (or an array of them) -type AnimatedLeaf = - | Exclude - | Extract> extends infer U - ? [U] extends [never] - ? never - : FluidValue> - : never diff --git a/targets/konva/src/index.ts b/targets/konva/src/index.ts deleted file mode 100644 index acc79aaf28..0000000000 --- a/targets/konva/src/index.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Globals, createStringInterpolator, colors } from '@react-spring/shared' -import { createHost } from '@react-spring/animated' -import { primitives } from './primitives' -import { WithAnimated } from './animated' - -Globals.assign({ - createStringInterpolator, - colors, -}) - -const host = createHost(primitives, { - applyAnimatedValues(instance, props) { - if (!instance.nodeType) return false - instance._applyProps(instance, props) - }, -}) - -export const animated = host.animated as WithAnimated -export { animated as a } - -export * from './animated' -export * from '@react-spring/core' diff --git a/targets/konva/src/primitives.ts b/targets/konva/src/primitives.ts deleted file mode 100644 index 586c371393..0000000000 --- a/targets/konva/src/primitives.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { ElementType } from 'react' -import * as konva from 'react-konva' - -export type KonvaExports = typeof konva - -export type Primitives = { - [P in keyof KonvaExports]: KonvaExports[P] extends ElementType ? P : never -}[keyof KonvaExports] - -export const primitives: Primitives[] = [ - 'Arc', - 'Arrow', - 'Circle', - 'Ellipse', - 'FastLayer', - 'Group', - 'Image', - 'Label', - 'Layer', - 'Line', - 'Path', - 'Rect', - 'RegularPolygon', - 'Ring', - 'Shape', - 'Sprite', - 'Star', - 'Tag', - 'Text', - 'TextPath', - 'Transformer', - 'Wedge', -] diff --git a/targets/konva/tsdown.config.ts b/targets/konva/tsdown.config.ts deleted file mode 100644 index 401893236f..0000000000 --- a/targets/konva/tsdown.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsdown' -import { defaultConfig } from '../../tsdown.config.base.mjs' - -export default defineConfig( - defaultConfig({ - entry: 'src/index.ts', - name: 'react-spring_konva', - }) -) diff --git a/targets/native/LICENSE b/targets/native/LICENSE deleted file mode 100644 index a926771a85..0000000000 --- a/targets/native/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-present Paul Henschel, react-spring, all contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/targets/native/README.md b/targets/native/README.md deleted file mode 100644 index 7f4bdc88a6..0000000000 --- a/targets/native/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# @react-spring/native - -[`react-native`](https://github.com/facebook/react-native) support - -**Note:** This package is not compiled before being published, because [Metro](https://github.com/facebook/metro) -handles that for us, which means we get proper sourcemap support! diff --git a/targets/native/package.json b/targets/native/package.json deleted file mode 100644 index 4e899f6c19..0000000000 --- a/targets/native/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@react-spring/native", - "version": "10.1.1", - "module": "./dist/react-spring_native.legacy-esm.js", - "main": "./dist/cjs/index.js", - "types": "./dist/react-spring_native.modern.d.mts", - "exports": { - "./package.json": "./package.json", - ".": { - "types": "./dist/cjs/react-spring_native.development.d.ts", - "default": "./dist/cjs/index.js" - } - }, - "files": [ - "dist/**/*", - "README.md", - "LICENSE" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/pmndrs/react-spring.git" - }, - "homepage": "https://github.com/pmndrs/react-spring#readme", - "keywords": [ - "animated", - "animation", - "hooks", - "motion", - "react", - "react-native", - "spring", - "typescript", - "velocity" - ], - "license": "MIT", - "author": "Paul Henschel", - "maintainers": [ - "Josh Ellis (https://github.com/joshuaellis)" - ], - "publishConfig": { - "provenance": true - }, - "dependencies": { - "@react-spring/animated": "workspace:~", - "@react-spring/core": "workspace:~", - "@react-spring/shared": "workspace:~", - "@react-spring/types": "workspace:~" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-native": ">=0.78" - }, - "scripts": { - "build": "rm -rf dist && tsdown", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", - "dev": "tsdown --watch", - "pack": "pnpm pack && mv *.tgz package.tgz" - } -} diff --git a/targets/native/src/AnimatedStyle.ts b/targets/native/src/AnimatedStyle.ts deleted file mode 100644 index f30647c145..0000000000 --- a/targets/native/src/AnimatedStyle.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AnimatedObject } from '@react-spring/animated' -import { AnimatedTransform } from './AnimatedTransform' - -type Style = object & { transform?: any } - -export class AnimatedStyle extends AnimatedObject { - constructor(style: Style) { - super(style) - } - - setValue(style: Style) { - super.setValue( - style && style.transform - ? { ...style, transform: new AnimatedTransform(style.transform) } - : style - ) - } -} diff --git a/targets/native/src/AnimatedTransform.ts b/targets/native/src/AnimatedTransform.ts deleted file mode 100644 index 340305b929..0000000000 --- a/targets/native/src/AnimatedTransform.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { each, eachProp, getFluidValue } from '@react-spring/shared' -import { Animated, AnimatedValue, AnimatedObject } from '@react-spring/animated' - -type Transform = { [key: string]: string | number | Animated } - -type Source = Transform[] - -export class AnimatedTransform extends AnimatedObject { - declare protected source: Source - constructor(source: Source) { - super(source) - } - - getValue() { - return this.source - ? this.source.map(source => { - const transform: any = {} - eachProp(source, (source, key) => { - transform[key] = getFluidValue(source) - }) - return transform - }) - : [] - } - - setValue(source: Source) { - this.source = source - this.payload = this._makePayload(source) - } - - protected _makePayload(source: Source) { - if (!source) return [] - const payload = new Set() - each(source, transform => eachProp(transform, this._addToPayload, payload)) - return Array.from(payload) - } -} diff --git a/targets/native/src/animated.ts b/targets/native/src/animated.ts deleted file mode 100644 index 628a67fc2a..0000000000 --- a/targets/native/src/animated.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { ForwardRefExoticComponent, ReactNode } from 'react' -import { ViewStyle, RecursiveArray } from 'react-native' -import { - AssignableKeys, - ComponentPropsWithRef, - ElementType, -} from '@react-spring/types' -import { FluidValue } from '@react-spring/shared' -import { primitives } from './primitives' - -type Primitives = typeof primitives -type AnimatedPrimitives = { - [P in keyof Primitives]: AnimatedComponent -} - -/** The type of the `animated()` function */ -export type WithAnimated = { - (wrappedComponent: T): AnimatedComponent -} & AnimatedPrimitives - -/** The type of an `animated()` component */ -export type AnimatedComponent = - ForwardRefExoticComponent< - AnimatedProps> & { children?: ReactNode } - > - -/** The props of an `animated()` component */ -export type AnimatedProps = { - [P in keyof Props]: P extends 'ref' | 'key' - ? Props[P] - : AnimatedProp -} - -// The animated prop value of a React element -type AnimatedProp = [T, T] extends [infer T, infer DT] // T is a union, DT is a distributed union - ? [DT] extends [never] - ? never - : DT extends void - ? undefined - : DT extends ReadonlyArray - ? AnimatedArray
| AnimatedLeaf - : DT extends ReadonlyArray - ? TransformArray extends DT - ? AnimatedTransform - : AnimatedStyles
- : [AssignableKeys] extends [never] - ? DT | AnimatedLeaf - : AnimatedStyle
- : never - -type AnimatedArray> = { - [P in keyof T]: T[P] | FluidValue -} - -// An animated array of style objects -type AnimatedStyles> = - unknown & T extends RecursiveArray - ? { [P in keyof T]: RecursiveArray> }[keyof T] - : { - [P in keyof T]: [T[P]] extends [infer DT] // DT is a distributed union - ? DT extends ReadonlyArray - ? AnimatedStyles
- : DT extends object - ? [AssignableKeys] extends [never] - ? AnimatedProp
- : { [P in keyof DT]: AnimatedProp } - : DT - : never - } - -// An animated object of style attributes -export type AnimatedStyle = [T, T] extends [infer T, infer DT] // T is a union, DT is a distributed union - ? DT extends void - ? undefined - : [DT] extends [never] - ? never - : DT extends object - ? { - [P in keyof T]: P extends 'transform' - ? AnimatedTransform - : AnimatedStyle - } - : DT | AnimatedLeaf - : never - -type TransformArray = Exclude - -// An animated array of transform objects -export type AnimatedTransform = Array< - TransformArray[number] extends infer T - ? { [P in keyof T]: T[P] | FluidValue } - : never -> - -// An animated primitive (or an array of them) -type AnimatedLeaf = - | Exclude - | Extract> extends infer U - ? [U] extends [never] - ? never - : FluidValue> - : never diff --git a/targets/native/src/index.ts b/targets/native/src/index.ts deleted file mode 100644 index 20a1622915..0000000000 --- a/targets/native/src/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { StyleSheet } from 'react-native' -import { createHost, AnimatedObject } from '@react-spring/animated' -import { - is, - Globals, - createStringInterpolator, - colors, -} from '@react-spring/shared' -import { primitives } from './primitives' -import { WithAnimated } from './animated' -import { AnimatedStyle } from './AnimatedStyle' - -Globals.assign({ - batchedUpdates: require('react-native').unstable_batchedUpdates, - createStringInterpolator, - colors, -}) - -const host = createHost(primitives, { - applyAnimatedValues(instance, props) { - if (is.und(props.children) && instance.setNativeProps) { - instance.setNativeProps(props) - return true - } - return false - }, - createAnimatedStyle(styles) { - styles = StyleSheet.flatten(styles) - if (is.obj(styles.shadowOffset)) { - styles.shadowOffset = new AnimatedObject(styles.shadowOffset) - } - return new AnimatedStyle(styles) - }, -}) - -export const animated = host.animated as WithAnimated -export { animated as a } - -export * from './animated' -export * from '@react-spring/core' diff --git a/targets/native/src/primitives.ts b/targets/native/src/primitives.ts deleted file mode 100644 index 9b1184a1b3..0000000000 --- a/targets/native/src/primitives.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { - Text, - View, - Image, - ImageProps, - ViewProps, - TextProps, -} from 'react-native' -import { ComponentClass, ReactNode } from 'react' - -export const primitives = { - View: View as ComponentClass, - Text: Text as ComponentClass, - Image: Image as ComponentClass, -} diff --git a/targets/native/src/types/__tests__/index.ts b/targets/native/src/types/__tests__/index.ts deleted file mode 100644 index ec6150c817..0000000000 --- a/targets/native/src/types/__tests__/index.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { assert, _, test, describe } from 'spec.ts' -import { AnimatedProps, AnimatedTransform } from '../../animated' -import { FluidProps, FluidValue } from '@react-spring/shared' -import { ViewStyle } from 'react-native' - -describe('AnimatedProps', () => { - test('width prop', () => { - type Props = AnimatedProps<{ - style?: { width?: number | string } - }> - assert( - _ as Props, - _ as { - style?: FluidProps<{ - width?: number | string - }> - } - ) - }) - - test('ref prop', () => { - type Props = AnimatedProps<{ - ref: { current: any } - foo: number - }> - assert( - _ as Props, - _ as { - ref: { current: any } - foo: number | FluidValue - } - ) - }) - - test('transform prop', () => { - type Props = AnimatedProps<{ - style?: { - transform: ViewStyle['transform'] - } - }> - assert( - _ as Props, - _ as { - style?: { - transform: AnimatedTransform - } - } - ) - }) - - test('non-style object prop', () => { - type Props = AnimatedProps<{ - foo: { bar: number } - bar?: number | { foo: number } - }> - assert( - _ as Props, - _ as { - foo: { bar: number } - bar?: number | { foo: number } | FluidValue - } - ) - }) - - test('array of mixed numbers/strings', () => { - type Props = AnimatedProps<{ - path: Array - }> - assert( - _ as Props, - _ as { - path: - | FluidValue> - | Array> - } - ) - }) - - test('one number or array of numbers', () => { - type Props = AnimatedProps<{ - path: number | number[] - }> - assert( - _ as Props, - _ as { - path: - | number - | FluidValue - | Array> - } - ) - }) - - test('array of numbers or array of strings', () => { - type Props = AnimatedProps<{ - path: number[] | string[] - }> - assert( - _ as Props, - _ as { - path: - | FluidValue - | Array> - | Array> - } - ) - }) - - // FIXME: not yet supported - // test('nested style array prop', () => { - // type Props = AnimatedProps<{ - // style: StyleProp<{ width?: number }>; - // }>; - // assert(_ as Props, _ as {}); - // }); - - test('with any', () => { - type Props = AnimatedProps - assert(_ as Props, _ as { [key: string]: any }) - }) -}) diff --git a/targets/native/tsdown.config.ts b/targets/native/tsdown.config.ts deleted file mode 100644 index 573323f1d5..0000000000 --- a/targets/native/tsdown.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from 'tsdown' -import { defaultConfig } from '../../tsdown.config.base.mjs' - -export default defineConfig( - defaultConfig({ - entry: 'src/index.ts', - name: 'react-spring_native', - buildFilter: ['development', 'production.min'], - }) -) diff --git a/targets/three/package.json b/targets/three/package.json index 534d8b769e..3d7fd1a5f1 100644 --- a/targets/three/package.json +++ b/targets/three/package.json @@ -33,7 +33,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/targets/web/package.json b/targets/web/package.json index 42935585bc..dc26fcb9db 100644 --- a/targets/web/package.json +++ b/targets/web/package.json @@ -33,7 +33,6 @@ "hooks", "motion", "react", - "react-native", "spring", "typescript", "velocity" diff --git a/targets/zdog/@types/react-zdog/index.d.ts b/targets/zdog/@types/react-zdog/index.d.ts deleted file mode 100644 index 5ec7ffa7fc..0000000000 --- a/targets/zdog/@types/react-zdog/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -declare module 'react-zdog' { - export const addEffect: (cb: () => void) => void - export const applyProps: ( - instance: any, - newProps: any, - oldProps?: any, - accumulative?: boolean - ) => void - export const invalidate: () => void - export const useRender: (fn: () => void, deps?: any[]) => void - - // Elements - type ElementType = import('react').ElementType - export const Illustration: ElementType - export const Anchor: ElementType - export const Shape: ElementType - export const Group: ElementType - export const Rect: ElementType - export const RoundedRect: ElementType - export const Ellipse: ElementType - export const Polygon: ElementType - export const Hemisphere: ElementType - export const Cylinder: ElementType - export const Cone: ElementType - export const Box: ElementType -} diff --git a/targets/zdog/LICENSE b/targets/zdog/LICENSE deleted file mode 100644 index a926771a85..0000000000 --- a/targets/zdog/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-present Paul Henschel, react-spring, all contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/targets/zdog/README.md b/targets/zdog/README.md deleted file mode 100644 index cbde5f6589..0000000000 --- a/targets/zdog/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# @react-spring/zdog - -> [!WARNING] -> This package uses react-zdog which does not support React 19 yet. - -[`zdog`](https://github.com/metafizzy/zdog) support diff --git a/targets/zdog/package.json b/targets/zdog/package.json deleted file mode 100644 index e5df939efa..0000000000 --- a/targets/zdog/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@react-spring/zdog", - "version": "10.1.1", - "module": "./dist/react-spring_zdog.legacy-esm.js", - "main": "./dist/cjs/index.js", - "types": "./dist/react-spring_zdog.modern.d.mts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./dist/react-spring_zdog.modern.d.mts", - "default": "./dist/react-spring_zdog.modern.mjs" - }, - "require": { - "types": "./dist/cjs/react-spring_zdog.development.d.ts", - "default": "./dist/cjs/index.js" - } - } - }, - "files": [ - "dist/**/*", - "README.md", - "LICENSE" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/pmndrs/react-spring.git" - }, - "homepage": "https://github.com/pmndrs/react-spring#readme", - "keywords": [ - "animated", - "animation", - "hooks", - "motion", - "react", - "react-native", - "spring", - "typescript", - "velocity" - ], - "license": "MIT", - "author": "Paul Henschel", - "maintainers": [ - "Josh Ellis (https://github.com/joshuaellis)" - ], - "publishConfig": { - "provenance": true - }, - "dependencies": { - "@react-spring/animated": "workspace:~", - "@react-spring/core": "workspace:~", - "@react-spring/shared": "workspace:~", - "@react-spring/types": "workspace:~" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-zdog": ">=1.0", - "zdog": ">=1.0" - }, - "scripts": { - "build": "rm -rf dist && tsdown", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", - "dev": "tsdown --watch", - "pack": "pnpm pack && mv *.tgz package.tgz" - } -} diff --git a/targets/zdog/src/animated.ts b/targets/zdog/src/animated.ts deleted file mode 100644 index 391dc38e65..0000000000 --- a/targets/zdog/src/animated.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - ElementType, - ComponentPropsWithRef, - ForwardRefExoticComponent, -} from 'react' -import { FluidValue } from '@react-spring/shared' -import { primitives } from './primitives' - -type Primitives = typeof primitives -type AnimatedPrimitives = { - [P in keyof Primitives]: AnimatedComponent -} - -/** The type of the `animated()` function */ -export type WithAnimated = { - (wrappedComponent: T): AnimatedComponent -} & AnimatedPrimitives - -/** The type of an `animated()` component */ -export type AnimatedComponent = - ForwardRefExoticComponent>> - -/** The props of an `animated()` component */ -export type AnimatedProps = { - [P in keyof Props]: P extends 'ref' | 'key' - ? Props[P] - : AnimatedProp -} - -// The animated prop value of a React element -type AnimatedProp = [T, T] extends [infer T, infer DT] - ? [DT] extends [never] - ? never - : DT extends void - ? undefined - : DT extends object - ? AnimatedStyle - : DT | AnimatedLeaf - : never - -// An animated object of style attributes -type AnimatedStyle = [T, T] extends [infer T, infer DT] - ? DT extends void - ? undefined - : [DT] extends [never] - ? never - : DT extends object - ? { [P in keyof DT]: AnimatedStyle } - : DT | AnimatedLeaf - : never - -// An animated primitive (or an array of them) -type AnimatedLeaf = - | Exclude - | Extract> extends infer U - ? [U] extends [never] - ? never - : FluidValue> - : never diff --git a/targets/zdog/src/index.ts b/targets/zdog/src/index.ts deleted file mode 100644 index 16ee8175eb..0000000000 --- a/targets/zdog/src/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { applyProps } from 'react-zdog' -import { Globals } from '@react-spring/core' -import { createStringInterpolator, colors } from '@react-spring/shared' -import { createHost } from '@react-spring/animated' -import { primitives } from './primitives' -import { WithAnimated } from './animated' - -Globals.assign({ - createStringInterpolator, - colors, -}) - -const host = createHost(primitives, { - applyAnimatedValues: applyProps, -}) - -export const animated = host.animated as WithAnimated -export { animated as a } - -export * from './animated' -export * from '@react-spring/core' diff --git a/targets/zdog/src/primitives.ts b/targets/zdog/src/primitives.ts deleted file mode 100644 index 717e07f569..0000000000 --- a/targets/zdog/src/primitives.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ElementType } from 'react' -import * as Zdog from 'react-zdog' - -type ZdogExports = typeof Zdog -type ZdogElements = { - [P in keyof ZdogExports]: P extends 'Illustration' - ? never - : ZdogExports[P] extends ElementType - ? P - : never -}[keyof ZdogExports] - -export const primitives: { [key in ZdogElements]: ElementType } = { - Anchor: Zdog.Anchor, - Shape: Zdog.Shape, - Group: Zdog.Group, - Rect: Zdog.Rect, - RoundedRect: Zdog.RoundedRect, - Ellipse: Zdog.Ellipse, - Polygon: Zdog.Polygon, - Hemisphere: Zdog.Hemisphere, - Cylinder: Zdog.Cylinder, - Cone: Zdog.Cone, - Box: Zdog.Box, -} diff --git a/targets/zdog/tsdown.config.ts b/targets/zdog/tsdown.config.ts deleted file mode 100644 index 14f7dc106f..0000000000 --- a/targets/zdog/tsdown.config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { defineConfig } from 'tsdown' -import { defaultConfig } from '../../tsdown.config.base.mjs' - -export default defineConfig( - defaultConfig({ - entry: 'src/index.ts', - name: 'react-spring_zdog', - }) -) diff --git a/tsconfig.json b/tsconfig.json index 951e8412e4..818a4c5719 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,7 @@ "**/*.test.ts", "**/*.test.tsx", "tests/**/*", - "vitest.config.ts", - "targets/zdog/@types/**/*" + "vitest.config.ts" ], "exclude": [ "packages/*/src/types/**/*", diff --git a/tsdown.config.base.mjs b/tsdown.config.base.mjs index 48d77ce641..eb3217cc85 100644 --- a/tsdown.config.base.mjs +++ b/tsdown.config.base.mjs @@ -96,13 +96,8 @@ if (process.env.NODE_ENV === 'production') { const sharedExternal = [ 'react', 'react-dom', - 'react-native', '@react-three/fiber', 'three', - 'react-konva', - 'konva', - 'react-zdog', - 'zdog', ] /** diff --git a/vitest.config.ts b/vitest.config.ts index f56c1a2127..2fc93523eb 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -16,7 +16,7 @@ export default defineConfig({ replacement: path.join(repoRoot, 'packages/parallax/src/index.tsx'), }, { - find: /^@react-spring\/(web|native|three|konva|zdog)$/, + find: /^@react-spring\/(web|three)$/, replacement: path.join(repoRoot, 'targets/$1/src/index.ts'), }, { @@ -50,8 +50,8 @@ export default defineConfig({ '**/node_modules/**', 'demo/**', 'docs/**', - 'targets/{native,three,konva,zdog}/**', - 'packages/{eslint-config,mock-raf,parallax,react-spring,types}/**', + 'targets/three/**', + 'packages/{eslint-config,mock-raf,parallax,types}/**', 'tests/**', ], thresholds: {