Compare commits

...

10 Commits

Author SHA1 Message Date
zplata
90c6d1edb1 chore: release 3.0.6 2022-06-06 21:37:22 +00:00
Zach Plata
0480dc92c8 Maint: Roll canvas and webgl dependencies forward to support nested state machines 2022-06-06 16:35:08 -05:00
zplata
de24fa5641 chore: release 3.0.5 2022-05-26 19:54:00 +00:00
Zach Plata
1a49e89c33 Fix: A recent Bunchee patch version kind of breaks npm run build 2022-05-26 14:51:28 -05:00
Zach Plata
805afd5dff Maint: Bump wasm for another listener patch 2022-05-26 11:24:56 -05:00
Zach Plata
84d9730767 Feat: Add stateMachines param to the default Rive component 2022-05-25 10:27:13 -05:00
zplata
9abee34d12 chore: release 3.0.4 2022-05-23 21:24:05 +00:00
Zach Plata
12801b10cc Maint: Bump rive-wasm dependency for listener patches 2022-05-23 16:21:58 -05:00
zplata
da11387558 chore: release 3.0.3 2022-05-17 15:23:15 +00:00
Zach Plata
3902948a2e Feat: Bump wasm and add examples to support touch feature 2022-05-17 10:20:56 -05:00
7 changed files with 55 additions and 12 deletions

View File

@@ -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)

View File

@@ -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._

View File

@@ -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": {

View File

Binary file not shown.

View File

@@ -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>
</>
);
}

View File

@@ -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",

View File

@@ -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,
};