mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df14bc383b | ||
|
|
b8dc1e5371 | ||
|
|
1196dd4c4e | ||
|
|
06ceb3cdb0 | ||
|
|
acaa12f7fc | ||
|
|
0acf384570 | ||
|
|
97a29acfdc | ||
|
|
5eb5ccfdaa | ||
|
|
edcc2c1320 | ||
|
|
68d8ca44fa | ||
|
|
ee9b83d764 | ||
|
|
187066c2cb | ||
|
|
427d74d14f | ||
|
|
061377432e | ||
|
|
53d7548b15 | ||
|
|
e1a4ca0058 | ||
|
|
83ebd6776d | ||
|
|
75dac6fe64 | ||
|
|
e13c023933 | ||
|
|
95183ff8d5 | ||
|
|
64416e0b4d | ||
|
|
1c6837bf92 | ||
|
|
15330ababe | ||
|
|
af70b8150d | ||
|
|
a984e007f4 | ||
|
|
04d8e01f87 | ||
|
|
44e46c5dee | ||
|
|
323e92e636 | ||
|
|
a07fa02ed6 | ||
|
|
d710e1e4b2 | ||
|
|
d35e9b2805 | ||
|
|
cf44463805 | ||
|
|
f59f44692a | ||
|
|
6ba68fab9e | ||
|
|
982addf163 | ||
|
|
dfd89c7691 | ||
|
|
0247a46c47 | ||
|
|
44626c7450 | ||
|
|
c0eb7d689d | ||
|
|
ff7a6aa676 | ||
|
|
dc89439d84 | ||
|
|
7ebc10a4da | ||
|
|
e8e1a5bc08 | ||
|
|
1bb8885f22 | ||
|
|
00d13badcf | ||
|
|
b9ab7b83d2 | ||
|
|
e0f00174c8 | ||
|
|
200a86a6ba | ||
|
|
26622596c8 | ||
|
|
ac789f0855 | ||
|
|
6ecdc05aea | ||
|
|
f8aa50fa49 | ||
|
|
b59bfdef84 | ||
|
|
948ded25f7 | ||
|
|
27f7f2b250 | ||
|
|
184ba2e110 | ||
|
|
f6d8db323b | ||
|
|
301e58f390 | ||
|
|
4cce3067a7 | ||
|
|
4496eff598 | ||
|
|
5e98586354 |
85
.github/workflows/publish.yml
vendored
85
.github/workflows/publish.yml
vendored
@@ -1,43 +1,28 @@
|
||||
name: Publish to NPM
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
major:
|
||||
description: 'Major'
|
||||
type: boolean
|
||||
default: false
|
||||
minor:
|
||||
description: 'Minor'
|
||||
type: boolean
|
||||
default: false
|
||||
jobs:
|
||||
determine_version:
|
||||
name: Determine the next build version
|
||||
if: github.event.pull_request.merged == true
|
||||
publish_job:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.echo_version.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
working-directory: ./
|
||||
- name: Git config
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Git config
|
||||
run: |
|
||||
git config --local user.email 'hello@rive.app'
|
||||
git config --local user.name ${{ github.actor }}
|
||||
- name: Authenticate with registry
|
||||
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
|
||||
- id: determine_version
|
||||
name: Get Version
|
||||
run: npm run release -- --ci --release-version | tail -n 1 > RELEASE_VERSION
|
||||
working-directory: ./
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
- id: echo_version
|
||||
run: echo "::set-output name=version::$(cat ./RELEASE_VERSION)"
|
||||
|
||||
merge_job:
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-latest
|
||||
needs: [determine_version]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16.x'
|
||||
@@ -50,30 +35,24 @@ jobs:
|
||||
run: npm run lint
|
||||
- name: Run Tests
|
||||
run: npm test
|
||||
- name: Build main dist
|
||||
run: npm run build
|
||||
- name: Copy separated builds
|
||||
run: ./scripts/build.sh
|
||||
- name: Copy package jsons to separate react outputs
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: ./scripts/setup_all_packages.sh
|
||||
- name: Bump Versions of react outputs
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
RELEASE_VERSION: ${{ needs.determine_version.outputs.version }}
|
||||
run: ./scripts/bump_all_versions.sh
|
||||
- name: Git config
|
||||
run: |
|
||||
git config --local user.email 'hello@rive.app'
|
||||
git config --local user.name ${{ github.actor }}
|
||||
- name: Authenticate with registry
|
||||
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
|
||||
- name: Release rive-react
|
||||
- if: ${{ inputs.major == true }}
|
||||
name: Major Release - Bump version number, update changelog, push and tag
|
||||
run: npm run release:major
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
run: npm run release -- --ci
|
||||
- name: Release @rive-app/react-* variants
|
||||
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- if: ${{inputs.major == false && inputs.minor == true}}
|
||||
name: Minor release - Bump version number, update changelog, push and tag
|
||||
run: npm run release:minor
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
run: ./scripts/publish_all.sh
|
||||
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- if: ${{inputs.major == false && inputs.minor == false}}
|
||||
name: Patch release - Bump version number, update changelog, push and tag
|
||||
run: npm run release:patch
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{
|
||||
"git": {
|
||||
"addUntrackedFiles": true,
|
||||
"requireCleanWorkingDir": false,
|
||||
"commitMessage": "chore: release ${version}",
|
||||
"tagName": "v${version}",
|
||||
"changelog": "npx auto-changelog --stdout --commit-limit false --unreleased --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs"
|
||||
@@ -12,6 +14,12 @@
|
||||
"releaseName": "${version}"
|
||||
},
|
||||
"hooks": {
|
||||
"after:bump": ["npx auto-changelog -p", "git add ./CHANGELOG.md"]
|
||||
"after:version:bump": [
|
||||
"npm run build",
|
||||
"npm run setup-builds",
|
||||
"npm run setup-packages",
|
||||
"npx auto-changelog -p",
|
||||
"npm run publish:all"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
248
CHANGELOG.md
248
CHANGELOG.md
@@ -4,10 +4,217 @@ 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.55](https://github.com/rive-app/rive-react/compare/v3.0.53...v3.0.55)
|
||||
#### [v4.6.0](https://github.com/rive-app/rive-react/compare/v4.5.8...v4.6.0)
|
||||
|
||||
- chore: bump rive-wasm to 2.8.0 for GL as a proxy solution to checking lost context [`1196dd4`](https://github.com/rive-app/rive-react/commit/1196dd4c4e21cc9a012616fa04c02a36791336cf)
|
||||
- add webgl to 2.8.0 too [`b8dc1e5`](https://github.com/rive-app/rive-react/commit/b8dc1e53712821bf9896564e7a7c1bf562107a90)
|
||||
|
||||
#### [v4.5.8](https://github.com/rive-app/rive-react/compare/v4.5.7...v4.5.8)
|
||||
|
||||
> 15 December 2023
|
||||
|
||||
- chore: release 4.5.8 [`06ceb3c`](https://github.com/rive-app/rive-react/commit/06ceb3cdb0ba497b3dda75474268c6920c99b2a9)
|
||||
- revert wasm build to 2.7.7 for testing intermediate changes before 2.7.8 [`acaa12f`](https://github.com/rive-app/rive-react/commit/acaa12f7fc7ffb6fa0ea67e0d9fe6b3680ac64f7)
|
||||
|
||||
#### [v4.5.7](https://github.com/rive-app/rive-react/compare/v4.5.6...v4.5.7)
|
||||
|
||||
> 14 December 2023
|
||||
|
||||
- chore: release 4.5.7 [`0acf384`](https://github.com/rive-app/rive-react/commit/0acf384570fee3cf32e42dfe41bee0da21a252b8)
|
||||
- chore: bump rive-wasm to 2.7.8 for texture deletion check [`97a29ac`](https://github.com/rive-app/rive-react/commit/97a29acfdc25eca767a0402095708b110b496dc3)
|
||||
|
||||
#### [v4.5.6](https://github.com/rive-app/rive-react/compare/v4.5.5...v4.5.6)
|
||||
|
||||
> 30 November 2023
|
||||
|
||||
- chore: release 4.5.6 [`5eb5ccf`](https://github.com/rive-app/rive-react/commit/5eb5ccfdaa2fe1e3277dbeff4fd8781b160c1ded)
|
||||
- bump rive-wasm to 2.7.6 [`edcc2c1`](https://github.com/rive-app/rive-react/commit/edcc2c1320027cc116dfa2cd1fc821b630be4403)
|
||||
|
||||
#### [v4.5.5](https://github.com/rive-app/rive-react/compare/v4.5.4...v4.5.5)
|
||||
|
||||
> 29 November 2023
|
||||
|
||||
- chore: release 4.5.5 [`68d8ca4`](https://github.com/rive-app/rive-react/commit/68d8ca44fa61c94d6a5bb04a268015c71f7013d5)
|
||||
- patch: bump wasm to 2.7.5 [`ee9b83d`](https://github.com/rive-app/rive-react/commit/ee9b83d7643fc41ab422e29203d5e241a2a22d98)
|
||||
|
||||
#### [v4.5.4](https://github.com/rive-app/rive-react/compare/v4.5.3...v4.5.4)
|
||||
|
||||
> 21 November 2023
|
||||
|
||||
- chore: release 4.5.4 [`187066c`](https://github.com/rive-app/rive-react/commit/187066c2cbc6240dd8cf46ea9b58ba69d98017c4)
|
||||
- chore: bump rive-wasm to 2.7.4 for bone fixes [`427d74d`](https://github.com/rive-app/rive-react/commit/427d74d14f69f557609c891f3803955c1ffcad12)
|
||||
|
||||
#### [v4.5.3](https://github.com/rive-app/rive-react/compare/v4.5.2...v4.5.3)
|
||||
|
||||
> 9 November 2023
|
||||
|
||||
- chore: release 4.5.3 [`0613774`](https://github.com/rive-app/rive-react/commit/061377432e23e263404ba773ae5aca593edc696a)
|
||||
- patch: bump rive-wasm to 2.7.3 [`53d7548`](https://github.com/rive-app/rive-react/commit/53d7548b15bb445f1c34ff599597ec139e80b0d6)
|
||||
|
||||
#### [v4.5.2](https://github.com/rive-app/rive-react/compare/v4.5.1...v4.5.2)
|
||||
|
||||
> 8 November 2023
|
||||
|
||||
- Add a react-canvas-lite package to build setup [`75dac6f`](https://github.com/rive-app/rive-react/commit/75dac6fe64b4904d22d986299da4c1d8a9941622)
|
||||
- chore: release 4.5.2 [`e1a4ca0`](https://github.com/rive-app/rive-react/commit/e1a4ca005828bf1750d8e6359e29ae635355bb1a)
|
||||
- Tweak copy [`83ebd67`](https://github.com/rive-app/rive-react/commit/83ebd6776da2bcaaea9c98c946f8e941575c9097)
|
||||
|
||||
#### [v4.5.1](https://github.com/rive-app/rive-react/compare/v4.5.0...v4.5.1)
|
||||
|
||||
> 8 November 2023
|
||||
|
||||
- chore: release 4.5.1 [`e13c023`](https://github.com/rive-app/rive-react/commit/e13c023933b85ff0439dfbd467c39b3054699361)
|
||||
- Bump WASM dependency to 2.7.2 for nested input patch [`95183ff`](https://github.com/rive-app/rive-react/commit/95183ff8d58ed20b80979233e423663a8a66ae5e)
|
||||
|
||||
#### [v4.5.0](https://github.com/rive-app/rive-react/compare/v4.4.0...v4.5.0)
|
||||
|
||||
> 26 October 2023
|
||||
|
||||
- chore: release 4.5.0 [`64416e0`](https://github.com/rive-app/rive-react/commit/64416e0b4dc8bbe82fdcd605f8ee1e705c75318d)
|
||||
- chore: bump react to 4.5.0 [`1c6837b`](https://github.com/rive-app/rive-react/commit/1c6837bf92a88eae3f80c71db67de1c19d8840e9)
|
||||
|
||||
#### [v4.4.0](https://github.com/rive-app/rive-react/compare/v4.3.4...v4.4.0)
|
||||
|
||||
> 6 October 2023
|
||||
|
||||
- chore: release 4.4.0 [`15330ab`](https://github.com/rive-app/rive-react/commit/15330ababeaf49897e79fff2c731ee05612cb40e)
|
||||
- bump rive-app versions to 2.5.0 [`af70b81`](https://github.com/rive-app/rive-react/commit/af70b8150dc84cbcfeece2a018084a3d30c0288e)
|
||||
|
||||
#### [v4.3.4](https://github.com/rive-app/rive-react/compare/v4.3.3...v4.3.4)
|
||||
|
||||
> 3 October 2023
|
||||
|
||||
- chore: release 4.3.4 [`a984e00`](https://github.com/rive-app/rive-react/commit/a984e007f480c1b236888a20f7d6d467eecd1dcf)
|
||||
- patch: bump rive-wasm to 2.4.4 [`04d8e01`](https://github.com/rive-app/rive-react/commit/04d8e01f87f20dc084b3de88c1e66d32cdbadeed)
|
||||
|
||||
#### [v4.3.3](https://github.com/rive-app/rive-react/compare/v4.3.2...v4.3.3)
|
||||
|
||||
> 20 September 2023
|
||||
|
||||
- chore: release 4.3.3 [`44e46c5`](https://github.com/rive-app/rive-react/commit/44e46c5dee31df2f0035f00a58955d3b3a83e223)
|
||||
- chore: bump wasm to 2.4.3 for url sanitization [`323e92e`](https://github.com/rive-app/rive-react/commit/323e92e6361aa68b9a749e8466679760cc4a41a1)
|
||||
|
||||
#### [v4.3.2](https://github.com/rive-app/rive-react/compare/v4.3.1...v4.3.2)
|
||||
|
||||
> 19 September 2023
|
||||
|
||||
- chore: release 4.3.2 [`a07fa02`](https://github.com/rive-app/rive-react/commit/a07fa02ed6cebe2661ccee8bd37fdcef18acc981)
|
||||
- chore: bump rive-wasm to 2.4.2 [`d710e1e`](https://github.com/rive-app/rive-react/commit/d710e1e4b24ad2eda66277eb748bdac7e9e48302)
|
||||
|
||||
#### [v4.3.1](https://github.com/rive-app/rive-react/compare/v4.3.0...v4.3.1)
|
||||
|
||||
> 18 September 2023
|
||||
|
||||
- chore: release 4.3.1 [`d35e9b2`](https://github.com/rive-app/rive-react/commit/d35e9b28051ad28528142dbde1f4c5bd7a9814ab)
|
||||
- chore: bump rive-wasm to 2.4.1 for event updates [`cf44463`](https://github.com/rive-app/rive-react/commit/cf44463805e8117ee6f1ac5025b973f35f307b1c)
|
||||
|
||||
#### [v4.3.0](https://github.com/rive-app/rive-react/compare/v4.2.1...v4.3.0)
|
||||
|
||||
> 13 September 2023
|
||||
|
||||
- feature: Bump WASM dependency to support Rive Events [`6ba68fa`](https://github.com/rive-app/rive-react/commit/6ba68fab9e5482a3ab2a92410ebb1b422db9ff9e)
|
||||
- chore: release 4.3.0 [`f59f446`](https://github.com/rive-app/rive-react/commit/f59f44692a9ca62c9c3f98447087647b125ada5d)
|
||||
|
||||
#### [v4.2.1](https://github.com/rive-app/rive-react/compare/v4.2.0...v4.2.1)
|
||||
|
||||
> 7 September 2023
|
||||
|
||||
- chore: release 4.2.1 [`982addf`](https://github.com/rive-app/rive-react/commit/982addf163ad73a8b077c7a1a27d50bdae402260)
|
||||
- chore: bump rive-wasm to 2.3.1 for mesh fix [`dfd89c7`](https://github.com/rive-app/rive-react/commit/dfd89c769193541192718a68a8035e05caa57f07)
|
||||
|
||||
#### [v4.2.0](https://github.com/rive-app/rive-react/compare/v4.1.6...v4.2.0)
|
||||
|
||||
> 1 September 2023
|
||||
|
||||
- chore: release 4.2.0 [`0247a46`](https://github.com/rive-app/rive-react/commit/0247a46c478f53499826fa40b6e03e25e833d969)
|
||||
- Updating rive wasm [`44626c7`](https://github.com/rive-app/rive-react/commit/44626c7450999abe095609b06aeafe240da8ddd5)
|
||||
|
||||
#### [v4.1.6](https://github.com/rive-app/rive-react/compare/v4.1.5...v4.1.6)
|
||||
|
||||
> 26 August 2023
|
||||
|
||||
- chore: release 4.1.6 [`c0eb7d6`](https://github.com/rive-app/rive-react/commit/c0eb7d689dd96e41c19e3f647f30f8f324cf54a8)
|
||||
- chore: bump rive-wasm for follow up solo fix [`ff7a6aa`](https://github.com/rive-app/rive-react/commit/ff7a6aa6761d95ca5ea41f2d34e82a63b5e0ffee)
|
||||
|
||||
#### [v4.1.5](https://github.com/rive-app/rive-react/compare/v4.1.4...v4.1.5)
|
||||
|
||||
> 25 August 2023
|
||||
|
||||
- chore: release 4.1.5 [`dc89439`](https://github.com/rive-app/rive-react/commit/dc89439d84624e44c5e1218a78bf823ed6928695)
|
||||
- chore: bump rive-wasm for follow path constraints on solos [`7ebc10a`](https://github.com/rive-app/rive-react/commit/7ebc10a4da5515ae1350edfe02ce21430de128e6)
|
||||
|
||||
#### [v4.1.4](https://github.com/rive-app/rive-react/compare/v4.1.3...v4.1.4)
|
||||
|
||||
> 14 August 2023
|
||||
|
||||
- chore: release 4.1.4 [`e8e1a5b`](https://github.com/rive-app/rive-react/commit/e8e1a5bc089bbf14307d83b5ef672d74d0f23eb4)
|
||||
- chore: bump rive-wasm to 2.1.5 for follow path fix [`1bb8885`](https://github.com/rive-app/rive-react/commit/1bb8885f22583cccaa4b3b54fcbdf42c366548d3)
|
||||
|
||||
#### [v4.1.3](https://github.com/rive-app/rive-react/compare/v4.1.2...v4.1.3)
|
||||
|
||||
> 10 August 2023
|
||||
|
||||
- chore: release 4.1.3 [`00d13ba`](https://github.com/rive-app/rive-react/commit/00d13badcf230a3879713301ddafffe90cd84557)
|
||||
- chore: bump wasm to 2.1.3 [`b9ab7b8`](https://github.com/rive-app/rive-react/commit/b9ab7b83d288f578385267b22b89a4b8e80508dc)
|
||||
|
||||
#### [v4.1.2](https://github.com/rive-app/rive-react/compare/v4.1.1...v4.1.2)
|
||||
|
||||
> 5 August 2023
|
||||
|
||||
- chore: release 4.1.2 [`e0f0017`](https://github.com/rive-app/rive-react/commit/e0f00174c8a91f26131d3913e076a4e0c1bce343)
|
||||
- chore: bump rive-wasm to 2.1.2 [`200a86a`](https://github.com/rive-app/rive-react/commit/200a86a6bab5cd0e8a31c211df90b9dbf8e7d1be)
|
||||
|
||||
#### [v4.1.1](https://github.com/rive-app/rive-react/compare/v4.1.0...v4.1.1)
|
||||
|
||||
> 3 August 2023
|
||||
|
||||
- chore: release 4.1.1 [`2662259`](https://github.com/rive-app/rive-react/commit/26622596c8a41b2c5cc5b83bb8db42de3e9dcac7)
|
||||
- patch: bump rive-wasm to 2.1.1 [`ac789f0`](https://github.com/rive-app/rive-react/commit/ac789f0855eaada115d84fd35da0030aad6b80e1)
|
||||
|
||||
#### [v4.1.0](https://github.com/rive-app/rive-react/compare/v4.0.0...v4.1.0)
|
||||
|
||||
> 31 July 2023
|
||||
|
||||
- chore: release 4.1.0 [`6ecdc05`](https://github.com/rive-app/rive-react/commit/6ecdc05aea05277557c352601b535b3d16361435)
|
||||
- feature: expose RiveProps type from package [`f8aa50f`](https://github.com/rive-app/rive-react/commit/f8aa50fa498493428a81a169f36daa0e331b4da5)
|
||||
- feature: Add ability to get and set text via wasm runtime bump [`b59bfde`](https://github.com/rive-app/rive-react/commit/b59bfdef8425df26cf14e4e384b60bba812eaeef)
|
||||
|
||||
### [v4.0.0](https://github.com/rive-app/rive-react/compare/v3.0.57...v4.0.0)
|
||||
|
||||
> 26 July 2023
|
||||
|
||||
- chore: release 4.0.0 [`948ded2`](https://github.com/rive-app/rive-react/commit/948ded25f7e0bbfb3a2c4553cc1e73555e3e092f)
|
||||
- Bump to rive wasm 2.0.0 [`27f7f2b`](https://github.com/rive-app/rive-react/commit/27f7f2b250c23f4de3c49c491ea2348534e6e2d9)
|
||||
|
||||
#### [v3.0.57](https://github.com/rive-app/rive-react/compare/v3.0.56...v3.0.57)
|
||||
|
||||
> 25 July 2023
|
||||
|
||||
- chore: move to manual npm publish workflow [`4cce306`](https://github.com/rive-app/rive-react/commit/4cce3067a7bce0d66a17b0347c4d87a9d090da0b)
|
||||
- chore: release 3.0.57 [`184ba2e`](https://github.com/rive-app/rive-react/commit/184ba2e110e055a2923b885f5c627ab30cf1d3d2)
|
||||
- chore: remove dryrun from release it script [`f6d8db3`](https://github.com/rive-app/rive-react/commit/f6d8db323bc57235d1cdce505bb86cb8d05e38fa)
|
||||
|
||||
#### [v3.0.56](https://github.com/rive-app/rive-react/compare/v3.0.55...v3.0.56)
|
||||
|
||||
> 24 July 2023
|
||||
|
||||
- chore: release 3.0.56 [`4496eff`](https://github.com/rive-app/rive-react/commit/4496eff59845a8a30a8dbe26436d4e325629762c)
|
||||
- patch: bump rive-wasm for follow-path patch [`5e98586`](https://github.com/rive-app/rive-react/commit/5e98586354849006152ef25a8b30fe781ef0cca6)
|
||||
|
||||
#### [v3.0.55](https://github.com/rive-app/rive-react/compare/v3.0.54...v3.0.55)
|
||||
|
||||
> 19 July 2023
|
||||
|
||||
- chore: release 3.0.55 [`f19295f`](https://github.com/rive-app/rive-react/commit/f19295f9a5a379a3e8a7c8491f5ccadba6598a28)
|
||||
- feature: add onAdvance callback through wasm bump too 1.2.2 [`7054630`](https://github.com/rive-app/rive-react/commit/70546308b44718e04f5295f60b99f0fc7bbe8172)
|
||||
|
||||
#### [v3.0.54](https://github.com/rive-app/rive-react/compare/v3.0.53...v3.0.54)
|
||||
|
||||
> 26 June 2023
|
||||
|
||||
- chore: release 3.0.54 [`62a425f`](https://github.com/rive-app/rive-react/commit/62a425f30e4e6d6ff7bfd76326fbb93b2241d306)
|
||||
- patch: Bump WASM runtimes for interpolation on states [`4a554dd`](https://github.com/rive-app/rive-react/commit/4a554dd1ad951b17c405096f0a6bcb9ae0600a4f)
|
||||
|
||||
#### [v3.0.53](https://github.com/rive-app/rive-react/compare/v3.0.52...v3.0.53)
|
||||
|
||||
> 9 June 2023
|
||||
@@ -289,13 +496,20 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
- chore: release 3.0.15 [`8175c4a`](https://github.com/rive-app/rive-react/commit/8175c4a4d406ac80703a6df346f3b5562d2e9311)
|
||||
- Patch: Bump js runtime dependencies for nested artboard display patch [`795ee53`](https://github.com/rive-app/rive-react/commit/795ee533405ec98457db074d11730849e1be5c88)
|
||||
|
||||
#### [v3.0.14](https://github.com/rive-app/rive-react/compare/v3.0.12...v3.0.14)
|
||||
#### [v3.0.14](https://github.com/rive-app/rive-react/compare/v3.0.13...v3.0.14)
|
||||
|
||||
> 28 June 2022
|
||||
|
||||
- Deploying to main from @ 3477afdef166251f35f1778a3143ff6c6efecc58 🚀 [`7aee5cf`](https://github.com/rive-app/rive-react/commit/7aee5cfab4eaca1fc9369742639507a770c4f756)
|
||||
- Fix: Intake JS runtime patches for starting animation frames [`3477afd`](https://github.com/rive-app/rive-react/commit/3477afdef166251f35f1778a3143ff6c6efecc58)
|
||||
- chore: release 3.0.14 [`04353db`](https://github.com/rive-app/rive-react/commit/04353db43266f6dcf40f4ef7f3be23afa13c2e0d)
|
||||
- Fix: Bump version because of race condition again [`1f0e511`](https://github.com/rive-app/rive-react/commit/1f0e511f6e047d05ca2783a56c2924a9c1af432a)
|
||||
|
||||
#### [v3.0.13](https://github.com/rive-app/rive-react/compare/v3.0.12...v3.0.13)
|
||||
|
||||
> 27 June 2022
|
||||
|
||||
- Fix: Intake JS runtime patches for starting animation frames [`3477afd`](https://github.com/rive-app/rive-react/commit/3477afdef166251f35f1778a3143ff6c6efecc58)
|
||||
- chore: release 3.0.13 [`3695dd9`](https://github.com/rive-app/rive-react/commit/3695dd99504a05818563b6ba9c89db77a38ff305)
|
||||
|
||||
#### [v3.0.12](https://github.com/rive-app/rive-react/compare/v3.0.11...v3.0.12)
|
||||
|
||||
@@ -312,12 +526,19 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
- chore: release 3.0.11 [`aee7407`](https://github.com/rive-app/rive-react/commit/aee7407f7921c515f3c1d9aabf87387baddb4064)
|
||||
- Docs: Code snippets update to use new React package structure [`b48de9d`](https://github.com/rive-app/rive-react/commit/b48de9db8496be35f29bea87273a7a9fceefdafc)
|
||||
|
||||
#### [v3.0.10](https://github.com/rive-app/rive-react/compare/v3.0.8...v3.0.10)
|
||||
#### [v3.0.10](https://github.com/rive-app/rive-react/compare/v3.0.9...v3.0.10)
|
||||
|
||||
> 20 June 2022
|
||||
|
||||
- Deploying to main from @ 5ad5a957a6e8f10abedc23f46033d4792e29dfe5 🚀 [`802648e`](https://github.com/rive-app/rive-react/commit/802648eda8fa0e5a0a35c66af06e476eac59fe9e)
|
||||
- chore: release 3.0.10 [`6772f16`](https://github.com/rive-app/rive-react/commit/6772f166b7f3e4747ae508a54e2533bb3ea49878)
|
||||
- Maint: roll canvas and webgl dependencies to include updates for rounded corners [`314d7c1`](https://github.com/rive-app/rive-react/commit/314d7c19cc727ad86114f968fa79fbd0be4074af)
|
||||
|
||||
#### [v3.0.9](https://github.com/rive-app/rive-react/compare/v3.0.8...v3.0.9)
|
||||
|
||||
> 9 June 2022
|
||||
|
||||
- chore: release 3.0.9 [`1909218`](https://github.com/rive-app/rive-react/commit/19092189a7253dc38ab0707c1e98de2b31da6306)
|
||||
- Maint: Update docs for storybook link [`5ad5a95`](https://github.com/rive-app/rive-react/commit/5ad5a957a6e8f10abedc23f46033d4792e29dfe5)
|
||||
|
||||
#### [v3.0.8](https://github.com/rive-app/rive-react/compare/v3.0.7...v3.0.8)
|
||||
@@ -572,13 +793,26 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
- chore: release 0.0.15 [`f0b1aeb`](https://github.com/rive-app/rive-react/commit/f0b1aeb7d850103b61310c9251a827f835fadf58)
|
||||
- update rive-js with support for distance and transform constraints [`8612e0b`](https://github.com/rive-app/rive-react/commit/8612e0b15f6c93d4e5c276c95e7f36543466e4d6)
|
||||
|
||||
#### [v0.0.14](https://github.com/rive-app/rive-react/compare/v0.0.11...v0.0.14)
|
||||
#### [v0.0.14](https://github.com/rive-app/rive-react/compare/v0.0.13...v0.0.14)
|
||||
|
||||
> 21 July 2021
|
||||
|
||||
- chore: release 0.0.14 [`d7f7eab`](https://github.com/rive-app/rive-react/commit/d7f7eab65577732fa1e9f792bc14f10d89c0ccaf)
|
||||
- chore: bump to 0.0.13 [`29bd502`](https://github.com/rive-app/rive-react/commit/29bd502208efa6928ffb47f06b5e548f071a8ade)
|
||||
|
||||
#### [v0.0.13](https://github.com/rive-app/rive-react/compare/v0.0.12...v0.0.13)
|
||||
|
||||
> 21 July 2021
|
||||
|
||||
- chore: release 0.0.13 [`4b06d2d`](https://github.com/rive-app/rive-react/commit/4b06d2d8f5c12b0bdff58d9c14d5e41df0a41b48)
|
||||
- chore: bump to 0.0.12 [`7266fc5`](https://github.com/rive-app/rive-react/commit/7266fc5d2fc0404362031ea3d3c760309f6927e6)
|
||||
|
||||
#### [v0.0.12](https://github.com/rive-app/rive-react/compare/v0.0.11...v0.0.12)
|
||||
|
||||
> 21 July 2021
|
||||
|
||||
- Bump rive-js to 0.7.19 with support for IK constraints [`6c80c53`](https://github.com/rive-app/rive-react/commit/6c80c5311e99ee47e9f4fc3c5f35ab908ddfa326)
|
||||
- chore: release 0.0.14 [`d7f7eab`](https://github.com/rive-app/rive-react/commit/d7f7eab65577732fa1e9f792bc14f10d89c0ccaf)
|
||||
- chore: bump to 0.0.13 [`29bd502`](https://github.com/rive-app/rive-react/commit/29bd502208efa6928ffb47f06b5e548f071a8ade)
|
||||
- chore: release 0.0.12 [`6212844`](https://github.com/rive-app/rive-react/commit/621284482538d6b5a4cb16cf845c53528208b0bb)
|
||||
|
||||
#### [v0.0.11](https://github.com/rive-app/rive-react/compare/v0.0.10...v0.0.11)
|
||||
|
||||
|
||||
@@ -52,6 +52,10 @@ Check out our Storybook instance that shows how to use the library in small exam
|
||||
- [Mouse tracking](https://codesandbox.io/s/rive-mouse-track-test-t0y965?file=/src/App.js)
|
||||
- [Accessibility concerns](https://rive.app/blog/accesible-web-animations-aria-live-regions)
|
||||
|
||||
### Awesome Rive
|
||||
|
||||
For even more examples and resources on using Rive at runtime or in other tools, checkout the [awesome-rive](https://github.com/rive-app/awesome-rive) repo.
|
||||
|
||||
## Migration Guides
|
||||
|
||||
Using an older version of the runtime and need to learn how to upgrade to the latest version? Check out the migration guides below in our help center that help guide you through version bumps; breaking changes and all!
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
<!-- RiveTestHook.stories.mdx -->
|
||||
|
||||
import { useState } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
import { Canvas, Meta, Story, ArgsTable } from '@storybook/addon-docs';
|
||||
|
||||
import RiveComponent, { useRive, useStateMachineInput } from '../../src';
|
||||
import RiveComponent, {
|
||||
EventType,
|
||||
useRive,
|
||||
useStateMachineInput,
|
||||
} from '../../src';
|
||||
import { Button } from './components/Button';
|
||||
import './rive-overview.css';
|
||||
|
||||
@@ -160,3 +164,59 @@ Unlike the boolean and number inputs, you invoke the `.fire()` method on a trigg
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Rive Text
|
||||
|
||||
A simple example showing Rive Text rendering. Note that if you are using the `@rive-app/react-canvas-lite` package,
|
||||
the Rive Text bit will not render on the graphic, however, the rest of the Rive content should without issue.
|
||||
|
||||
<Canvas withSource="open">
|
||||
<Story name="Rive Text">
|
||||
{() => {
|
||||
const STATE_MACHINE_NAME = 'State Machine 1';
|
||||
const { rive, RiveComponent } = useRive({
|
||||
src: 'text_test.riv',
|
||||
stateMachines: STATE_MACHINE_NAME,
|
||||
autoplay: true,
|
||||
automaticallyHandleEvents: true,
|
||||
});
|
||||
return (
|
||||
<div className="center">
|
||||
<RiveComponent className="base-canvas-size" />
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Rive Events
|
||||
|
||||
To listen for Rive Events reported during state machine play, use the `on` API to add an event listener.
|
||||
|
||||
<Canvas withSource="open">
|
||||
<Story name="Rive Events">
|
||||
{() => {
|
||||
const STATE_MACHINE_NAME = 'State Machine 1';
|
||||
const { rive, RiveComponent } = useRive({
|
||||
src: 'rating_animation.riv',
|
||||
stateMachines: STATE_MACHINE_NAME,
|
||||
autoplay: true,
|
||||
automaticallyHandleEvents: true,
|
||||
});
|
||||
useEffect(() => {
|
||||
if (rive) {
|
||||
rive.on(EventType.RiveEvent, onRiveEventReceived);
|
||||
}
|
||||
}, [rive]);
|
||||
const onRiveEventReceived = (riveEvent) => {
|
||||
console.log('Rive Event Fired', riveEvent);
|
||||
};
|
||||
return (
|
||||
<div className="center">
|
||||
<RiveComponent className="base-canvas-size" />
|
||||
<p>Click on the 5 star!</p>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
BIN
examples/stories/assets/rating_animation.riv
Normal file
BIN
examples/stories/assets/rating_animation.riv
Normal file
Binary file not shown.
BIN
examples/stories/assets/text_test.riv
Normal file
BIN
examples/stories/assets/text_test.riv
Normal file
Binary file not shown.
9
npm/react-canvas-lite/README.md
Normal file
9
npm/react-canvas-lite/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# @rive-app/react-canvas-lite
|
||||
|
||||
Output for `rive-react` using the backing `@rive-app/canvas-lite` JS runtime.
|
||||
|
||||
## Why Lite?
|
||||
|
||||
The current `@rive-app/react-canvas` dependency supports all Rive features and contains the necessary backing dependencies to render those graphics. This `lite` version has the same API, but does not compile and build with certain dependencies in order to keep the package size as small as possible.
|
||||
|
||||
At this time, this lite version of `@rive-app/react-canvas-lite` will not render [Rive Text](https://help.rive.app/editor/text) onto the canvas. Note however, that even if your Rive file may include Rive Text components when using this package, the canvas will still render the graphic without the Rive Text components.
|
||||
26
npm/react-canvas-lite/package.json
Normal file
26
npm/react-canvas-lite/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@rive-app/react-canvas-lite",
|
||||
"version": "4.6.0",
|
||||
"description": "React wrapper around the @rive-app/canvas-lite library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
"files": [
|
||||
"dist/**"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rive-app/rive-react.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/rive-app/rive-react/issues"
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas-lite": "2.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
}
|
||||
26
npm/react-canvas/package.json
Normal file
26
npm/react-canvas/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@rive-app/react-canvas",
|
||||
"version": "4.6.0",
|
||||
"description": "React wrapper around the @rive-app/canvas library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
"files": [
|
||||
"dist/**"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rive-app/rive-react.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/rive-app/rive-react/issues"
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas": "2.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
}
|
||||
26
npm/react-webgl/package.json
Normal file
26
npm/react-webgl/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@rive-app/react-webgl",
|
||||
"version": "4.6.0",
|
||||
"description": "React wrapper around the @rive-app/webgl library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
"files": [
|
||||
"dist/**"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/rive-app/rive-react.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/rive-app/rive-react/issues"
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/webgl": "2.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
}
|
||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rive-react",
|
||||
"version": "3.0.55",
|
||||
"version": "4.6.0",
|
||||
"description": "React wrapper around the rive-js library",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/types/index.d.ts",
|
||||
@@ -16,7 +16,14 @@
|
||||
"types:check": "tsc --noEmit",
|
||||
"release": "release-it",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook -o docs-build"
|
||||
"build-storybook": "build-storybook -o docs-build",
|
||||
"release:patch": "npm run release -- --ci",
|
||||
"release:minor": "npm run release -- minor --ci",
|
||||
"release:major": "npm run release -- major --ci",
|
||||
"setup-builds": "./scripts/build.sh",
|
||||
"setup-packages": "./scripts/setup_all_packages.sh",
|
||||
"bump-versions": "./scripts/bump_all_versions.sh $npm_package_version",
|
||||
"publish:all": "./scripts/publish_all.sh --access public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -29,8 +36,9 @@
|
||||
},
|
||||
"homepage": "https://github.com/rive-app/rive-react#readme",
|
||||
"dependencies": {
|
||||
"@rive-app/canvas": "1.2.2",
|
||||
"@rive-app/webgl": "1.2.2"
|
||||
"@rive-app/canvas": "2.8.0",
|
||||
"@rive-app/canvas-lite": "2.8.0",
|
||||
"@rive-app/webgl": "2.8.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
|
||||
@@ -5,6 +5,7 @@ set -e
|
||||
# Copy the build to each react-variant build for npm release
|
||||
cp -r ./dist ./npm/react-webgl
|
||||
cp -r ./dist ./npm/react-canvas
|
||||
cp -r ./dist ./npm/react-canvas-lite
|
||||
|
||||
echo "Replacing the canvas with webgl references in react-webgl"
|
||||
pushd ./npm/react-webgl/dist
|
||||
@@ -16,3 +17,14 @@ else
|
||||
find . -type f -name "*.js" -print0 | xargs -0 sed -i -e 's/@rive-app\/canvas/@rive-app\/webgl/g'
|
||||
fi
|
||||
popd
|
||||
|
||||
echo "Replacing the canvas with canvas-lite references in react-canvas-lite"
|
||||
pushd ./npm/react-canvas-lite/dist
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
find . -type f -name "*.ts" -print0 | xargs -0 sed -i '' -e 's/@rive-app\/canvas/@rive-app\/canvas-lite/g'
|
||||
find . -type f -name "*.js" -print0 | xargs -0 sed -i '' -e 's/@rive-app\/canvas/@rive-app\/canvas-lite/g'
|
||||
else
|
||||
find . -type f -name "*.ts" -print0 | xargs -0 sed -i -e 's/@rive-app\/canvas/@rive-app\/canvas-lite/g'
|
||||
find . -type f -name "*.js" -print0 | xargs -0 sed -i -e 's/@rive-app\/canvas/@rive-app\/canvas-lite/g'
|
||||
fi
|
||||
popd
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Bump the version number of every npm module in the npm folder.
|
||||
for dir in ./npm/*; do
|
||||
pushd $dir > /dev/null
|
||||
repo_name=`echo $dir | sed 's:.*/::' | sed 's/_/-/g'`
|
||||
echo Bumping version of $repo_name
|
||||
../../scripts/bump_version.sh $repo_name $RELEASE_VERSION
|
||||
popd > /dev/null
|
||||
done
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Bumps the version of a single npm module found in the current working
|
||||
# directory. Call bump_version.sh from the path with package.json in it.
|
||||
|
||||
set -e
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
# RELEASE_VERSION will come from an env variable passed in from the GH action workflow
|
||||
node $SCRIPT_DIR/nextVersion.js "$RELEASE_VERSION" `pwd`
|
||||
|
||||
# Replace the dist package json with the newly trimmed one
|
||||
cp -f ./package.json ./dist/package.json
|
||||
@@ -1,33 +0,0 @@
|
||||
const fs = require('fs');
|
||||
const path = process.argv[3];
|
||||
const package = require(path + '/package.json');
|
||||
const currentVersion = package.version;
|
||||
const nextVersion = process.argv[2].trim().replace(/\'/g, '"');
|
||||
|
||||
if (!nextVersion || nextVersion === currentVersion) {
|
||||
throw new Error('Next version is not defined or is a version that already exists');
|
||||
}
|
||||
|
||||
// Returns -1 if first is less than second, 1 if first is greater than second, otherwise 0 if equal.
|
||||
function compareVersion(first, second) {
|
||||
// Assumption: only numbers in our versions.
|
||||
const firstParts = first.split('.').map((value) => parseInt(value));
|
||||
const secondParts = second.split('.').map((value) => parseInt(value));
|
||||
|
||||
for (let i = 0; i < Math.max(firstParts.length, secondParts.length); i++) {
|
||||
const first = i < firstParts.length ? firstParts[i] : 0;
|
||||
const second = i < secondParts.length ? secondParts[i] : 0;
|
||||
if (first < second) {
|
||||
return -1;
|
||||
}
|
||||
if (second < first) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (compareVersion(currentVersion, nextVersion) <= 0) {
|
||||
package.version = nextVersion;
|
||||
fs.writeFileSync(path + '/package.json', JSON.stringify(package, null, 2));
|
||||
}
|
||||
@@ -5,6 +5,6 @@ set -e
|
||||
for dir in ./npm/*; do
|
||||
pushd $dir > /dev/null
|
||||
echo Publishing `echo $dir | sed 's:.*/::'`
|
||||
npm publish --access public
|
||||
npm publish $@
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
@@ -3,14 +3,17 @@ set -e
|
||||
|
||||
echo "Copying package.json to rive-react npm package folders"
|
||||
|
||||
cp package.json npm/react-canvas
|
||||
cp package.json npm/react-webgl
|
||||
|
||||
# Bump the version number of every npm module in the npm folder.
|
||||
for dir in ./npm/*; do
|
||||
echo $dir
|
||||
pushd $dir > /dev/null
|
||||
echo $dir
|
||||
if [ -f "./package.json" ]; then
|
||||
echo "Removing existing package.json..."
|
||||
rm "./package.json"
|
||||
echo "package.json deleted from $dir"
|
||||
fi
|
||||
cp ../../package.json ./
|
||||
repo_name=`echo $dir | sed 's:.*/::' | sed 's/_/-/g'`
|
||||
echo Setting package.json on npm packages
|
||||
echo $repo_name
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
const fs = require('fs');
|
||||
const path = process.argv[2];
|
||||
const npmPackageSplit = process.argv[3].split('-');
|
||||
const renderer = npmPackageSplit[npmPackageSplit.length - 1];
|
||||
// extracts "webgl" or "canvas-lite" from the npm package name
|
||||
const renderer = npmPackageSplit.slice(1).join('-');
|
||||
const package = require(path + '/package.json');
|
||||
|
||||
function trimNpmPackage() {
|
||||
|
||||
@@ -36,6 +36,18 @@ export interface RiveProps {
|
||||
* Specify whether to resize the canvas to its container automatically
|
||||
*/
|
||||
shouldResizeCanvasToContainer?: boolean;
|
||||
/**
|
||||
* Enable Rive Events to be handled by the runtime. This means any special Rive Event may have
|
||||
* functionality that can be invoked implicitly when detected.
|
||||
*
|
||||
* For example, if during the render loop an OpenUrlEvent is detected, the
|
||||
* browser may try to open the specified URL in the payload.
|
||||
*
|
||||
* This flag is false by default to prevent any unwanted behaviors from taking place.
|
||||
* This means any special Rive Event will have to be handled manually by subscribing to
|
||||
* EventType.RiveEvent
|
||||
*/
|
||||
automaticallyHandleEvents?: boolean;
|
||||
}
|
||||
|
||||
const Rive = ({
|
||||
@@ -47,6 +59,7 @@ const Rive = ({
|
||||
useOffscreenRenderer = true,
|
||||
shouldDisableRiveListeners = false,
|
||||
shouldResizeCanvasToContainer = true,
|
||||
automaticallyHandleEvents = false,
|
||||
children,
|
||||
...rest
|
||||
}: RiveProps & ComponentProps<'canvas'>) => {
|
||||
@@ -58,6 +71,7 @@ const Rive = ({
|
||||
stateMachines,
|
||||
autoplay: true,
|
||||
shouldDisableRiveListeners,
|
||||
automaticallyHandleEvents,
|
||||
};
|
||||
|
||||
const options = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import Rive from './components/Rive';
|
||||
import Rive, { RiveProps } from './components/Rive';
|
||||
import useRive from './hooks/useRive';
|
||||
import useStateMachineInput from './hooks/useStateMachineInput';
|
||||
import useResizeCanvas from './hooks/useResizeCanvas';
|
||||
|
||||
export default Rive;
|
||||
export { useRive, useStateMachineInput, useResizeCanvas };
|
||||
export { useRive, useStateMachineInput, useResizeCanvas, RiveProps };
|
||||
export { RiveState, UseRiveParameters, UseRiveOptions } from './types';
|
||||
export * from '@rive-app/canvas';
|
||||
|
||||
Reference in New Issue
Block a user