mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90c6d1edb1 | ||
|
|
0480dc92c8 | ||
|
|
de24fa5641 | ||
|
|
1a49e89c33 | ||
|
|
805afd5dff | ||
|
|
84d9730767 | ||
|
|
9abee34d12 | ||
|
|
12801b10cc | ||
|
|
da11387558 | ||
|
|
3902948a2e |
29
CHANGELOG.md
29
CHANGELOG.md
@@ -4,8 +4,37 @@ All notable changes to this project will be documented in this file. Dates are d
|
||||
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
|
||||
#### [v3.0.6](https://github.com/rive-app/rive-react/compare/v3.0.5...v3.0.6)
|
||||
|
||||
- Maint: Roll canvas and webgl dependencies forward to support nested state machines [`0480dc9`](https://github.com/rive-app/rive-react/commit/0480dc92c842265d601d08b60fb49392969cfd9e)
|
||||
|
||||
#### [v3.0.5](https://github.com/rive-app/rive-react/compare/v3.0.4...v3.0.5)
|
||||
|
||||
> 26 May 2022
|
||||
|
||||
- chore: release 3.0.5 [`de24fa5`](https://github.com/rive-app/rive-react/commit/de24fa564117d4acbe60b4cf734abd9e951b30f1)
|
||||
- Feat: Add stateMachines param to the default Rive component [`84d9730`](https://github.com/rive-app/rive-react/commit/84d9730767a62c63e743d5a04bba5b3d480ea38d)
|
||||
- Maint: Bump wasm for another listener patch [`805afd5`](https://github.com/rive-app/rive-react/commit/805afd5dff2888294926c32ec07f5e24db804d09)
|
||||
|
||||
#### [v3.0.4](https://github.com/rive-app/rive-react/compare/v3.0.3...v3.0.4)
|
||||
|
||||
> 23 May 2022
|
||||
|
||||
- chore: release 3.0.4 [`9abee34`](https://github.com/rive-app/rive-react/commit/9abee34d12641f845b93febf438df0f77f72153f)
|
||||
- Maint: Bump rive-wasm dependency for listener patches [`12801b1`](https://github.com/rive-app/rive-react/commit/12801b10cc8980339e5856d71d96da3c612cb291)
|
||||
|
||||
#### [v3.0.3](https://github.com/rive-app/rive-react/compare/v3.0.2...v3.0.3)
|
||||
|
||||
> 17 May 2022
|
||||
|
||||
- Feat: Bump wasm and add examples to support touch feature [`3902948`](https://github.com/rive-app/rive-react/commit/3902948a2ef8af6955ef12124207edee29eb0be8)
|
||||
- chore: release 3.0.3 [`da11387`](https://github.com/rive-app/rive-react/commit/da1138755861aadb9e7c6cb0028f2120d610a6c5)
|
||||
|
||||
#### [v3.0.2](https://github.com/rive-app/rive-react/compare/v3.0.1...v3.0.2)
|
||||
|
||||
> 17 May 2022
|
||||
|
||||
- chore: release 3.0.2 [`21a17ed`](https://github.com/rive-app/rive-react/commit/21a17ed40ee51263c666dde48b6c55e958eceeb8)
|
||||
- Maint: Bump wasm dependencies [`f0e7092`](https://github.com/rive-app/rive-react/commit/f0e70924ec9849f45ecddda801ad63e1d87b1bdb)
|
||||
|
||||
#### [v3.0.1](https://github.com/rive-app/rive-react/compare/v3.0.0...v3.0.1)
|
||||
|
||||
@@ -26,7 +26,7 @@ _Note: This library is using React hooks so the minimum version required for bot
|
||||
|
||||
### Component
|
||||
|
||||
Rive React provides a basic component as it's default import for displaying simple animations.
|
||||
Rive React provides a basic component as it's default import for displaying simple animations. Note that any animations or state machines instantiated through this component will autoplay.
|
||||
|
||||
```js
|
||||
import Rive from 'rive-react';
|
||||
@@ -43,6 +43,7 @@ export default Example;
|
||||
- `src`: File path or URL to the .riv file to display.
|
||||
- `artboard`: _(optional)_ Name to display.
|
||||
- `animations`: _(optional)_ Name or list of names of animtions to play.
|
||||
- `stateMachines`: _(optional)_ Name of state machine to play.
|
||||
- `layout`: _(optional)_ Layout object to define how animations are displayed on the canvas. See [Rive.js](https://github.com/rive-app/rive-wasm#layout) for more details.
|
||||
- _All attributes and eventHandlers that can be passed to a `canvas` element can also be passed to the `Rive` component and used in the same manner._
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
"@testing-library/jest-dom": "^5.13.0",
|
||||
"@testing-library/react": "^11.2.7",
|
||||
"@testing-library/user-event": "^12.8.3",
|
||||
"react": "^17.0.2",
|
||||
"react": "file:../../node_modules/react",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-scripts": "4.0.3",
|
||||
"rive-react": "latest",
|
||||
"rive-react": "file:../..",
|
||||
"web-vitals": "^1.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
BIN
examples/basic-with-hook/public/magic-ball.riv
Normal file
BIN
examples/basic-with-hook/public/magic-ball.riv
Normal file
Binary file not shown.
@@ -6,13 +6,23 @@ function App() {
|
||||
autoplay: true,
|
||||
};
|
||||
|
||||
const { RiveComponent } = useRive(params);
|
||||
const { RiveComponent: RiveComponentBasic } = useRive(params);
|
||||
|
||||
const { RiveComponent: RiveComponentTouch } = useRive({
|
||||
src: 'magic-ball.riv',
|
||||
autoplay: true,
|
||||
stateMachines: "Main State Machine",
|
||||
});
|
||||
|
||||
return (
|
||||
// The animation will fit to the parent element.
|
||||
<div style={{ height: '500px', width: '500px' }}>
|
||||
<RiveComponent />
|
||||
</div>
|
||||
<>
|
||||
<div style={{ height: '500px', width: '500px' }}>
|
||||
<RiveComponentBasic />
|
||||
</div>
|
||||
<div style={{ height: '300px', width: '300px' }}>
|
||||
<RiveComponentTouch />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rive-react",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.6",
|
||||
"description": "React wrapper around the rive-js library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -27,8 +27,8 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas": "1.0.59",
|
||||
"@rive-app/webgl": "1.0.56"
|
||||
"@rive-app/canvas": "1.0.65",
|
||||
"@rive-app/webgl": "1.0.62"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
@@ -44,7 +44,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
||||
"@typescript-eslint/parser": "^5.7.0",
|
||||
"auto-changelog": "^2.3.0",
|
||||
"bunchee": "^1.7.3",
|
||||
"bunchee": "1.8.3",
|
||||
"eslint": "^7.28.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
|
||||
@@ -6,6 +6,7 @@ export type RiveProps = {
|
||||
src: string;
|
||||
artboard?: string;
|
||||
animations?: string | string[];
|
||||
stateMachines?: string | string[];
|
||||
layout?: Layout;
|
||||
useOffscreenRenderer?: boolean;
|
||||
};
|
||||
@@ -14,6 +15,7 @@ const Rive = ({
|
||||
src,
|
||||
artboard,
|
||||
animations,
|
||||
stateMachines,
|
||||
layout,
|
||||
useOffscreenRenderer = true,
|
||||
...rest
|
||||
@@ -23,6 +25,7 @@ const Rive = ({
|
||||
artboard,
|
||||
animations,
|
||||
layout,
|
||||
stateMachines,
|
||||
autoplay: true,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user