@rive-app/canvas-lite 2.49.3 → 2.49.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/package.json +7 -3
- package/rive.d.ts +1 -1
- package/rive.js +8 -8
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +2 -0
- package/rive_fallback.wasm +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
# Rive
|
|
3
3
|
A lite high-level Rive API using CanvasRenderingContext2D. Please see https://rive.app/community/doc/canvas-vs-webgl/docanjXoQ1uT for a list of all the available web runtimes and their details.
|
|
4
4
|
|
|
5
|
+
[Rive](https://rive.app) is an agent-native 2D and 3D engine for games, apps, and interactive UI. Use it as your whole engine, or add it to the products you already have. Build with your coding agent through the [Rive CLI](https://rive.app/agents), or draw, rig, and animate by hand with the professional design and animation tools in the [Rive Editor](https://rive.app/editor). Both work on the same files. Open-source runtimes, no royalties or runtime fees. Rive files (`.riv`) play natively on web, mobile, desktop, game engines, consoles, smart TVs, and cars.
|
|
6
|
+
|
|
5
7
|
## Canvas Lite
|
|
6
8
|
```
|
|
7
9
|
npm install @rive-app/canvas-lite
|
|
@@ -19,3 +21,13 @@ An easy-to-use high-level Rive API using a backing [CanvasRenderingContext2D](ht
|
|
|
19
21
|
The current `@rive-app/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.
|
|
20
22
|
|
|
21
23
|
At this time, this lite version of `@rive-app/canvas-lite` will not render Rive Text onto the canvas or play Rive Audio. Note however, that even if your Rive file may include Rive Text components, rendering the graphic should not cause any app errors, or cease to render. The same is true for playing audio.
|
|
24
|
+
|
|
25
|
+
## Build with your agent
|
|
26
|
+
|
|
27
|
+
Paste this into Claude Code, Codex, Cursor, or any agent that runs commands on your computer:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Install the Rive CLI from rive.app/cli. Build an interactive hero for my website as a Rive file and add it to the page with the Rive web runtime.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Your agent installs the [Rive CLI](https://rive.app/agents), writes the scene, and opens a preview window that rebuilds every time it saves. Keep giving it notes, or open the same file in the [Rive Editor](https://editor.rive.app/) and shape it by hand. Trying it needs no account. Writing the `.riv` that ships on your site needs a free Rive account. Free exports play a short Rive splash screen; [paid plans](https://rive.app/pricing) export without it. See [Getting started with the Rive CLI](https://rive.app/docs/cli/getting-started).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rive-app/canvas-lite",
|
|
3
|
-
"version": "2.49.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.49.4",
|
|
4
|
+
"description": "Rive web runtime, lite version, canvas renderer. Rive is an agent-native 2D and 3D engine for games, apps, and interactive UI.",
|
|
5
5
|
"main": "rive.js",
|
|
6
6
|
"homepage": "https://rive.app",
|
|
7
7
|
"repository": {
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
12
|
"rive",
|
|
13
|
-
"animation"
|
|
13
|
+
"animation",
|
|
14
|
+
"interactive",
|
|
15
|
+
"ui",
|
|
16
|
+
"game-engine",
|
|
17
|
+
"graphics"
|
|
14
18
|
],
|
|
15
19
|
"author": "Rive",
|
|
16
20
|
"contributors": [
|
package/rive.d.ts
CHANGED
|
@@ -837,7 +837,7 @@ export declare class Rive {
|
|
|
837
837
|
private ensureKeyboardInteractions;
|
|
838
838
|
/** Runs inside touchend/mouseup so focusing the proxy raises the mobile keyboard. */
|
|
839
839
|
private summonKeyboardForGesture;
|
|
840
|
-
/**
|
|
840
|
+
/** expectsTextInput (not key listeners alone), and with semantics on a textField. */
|
|
841
841
|
private wantsTextInputSession;
|
|
842
842
|
private advanceAndDrainForPointer;
|
|
843
843
|
private cleanupKeyboardInteractions;
|
package/rive.js
CHANGED
|
@@ -626,7 +626,7 @@ Lc=await (async function(){function b(c){c=Lc=c.exports;pb=c.free;Jc=c.malloc;ob
|
|
|
626
626
|
/***/ ((module) => {
|
|
627
627
|
|
|
628
628
|
"use strict";
|
|
629
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.49.
|
|
629
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.49.4","description":"Rive web runtime, lite version, canvas renderer. Rive is an agent-native 2D and 3D engine for games, apps, and interactive UI.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation","interactive","ui","game-engine","graphics"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils","semantics"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
630
630
|
|
|
631
631
|
/***/ }),
|
|
632
632
|
/* 7 */
|
|
@@ -5960,7 +5960,7 @@ var StateMachine = /** @class */ (function () {
|
|
|
5960
5960
|
};
|
|
5961
5961
|
/**
|
|
5962
5962
|
* Get metadata about the state of focus if applicable for this state machine.
|
|
5963
|
-
* @returns FocusState - { hasFocus: boolean, expectsKeyboardInput: boolean }
|
|
5963
|
+
* @returns FocusState - { hasFocus: boolean, expectsKeyboardInput: boolean, expectsTextInput: boolean }
|
|
5964
5964
|
*/
|
|
5965
5965
|
StateMachine.prototype.focusState = function () {
|
|
5966
5966
|
return this.instance.focusState();
|
|
@@ -7829,14 +7829,14 @@ var Rive = /** @class */ (function () {
|
|
|
7829
7829
|
var activeSm = this.focusStateMachine;
|
|
7830
7830
|
if (!activeSm)
|
|
7831
7831
|
return;
|
|
7832
|
-
if (this.wantsTextInputSession(activeSm.focusState().
|
|
7832
|
+
if (this.wantsTextInputSession(activeSm.focusState().expectsTextInput)) {
|
|
7833
7833
|
this._keyboardInteractions.summonForPointer();
|
|
7834
7834
|
}
|
|
7835
7835
|
};
|
|
7836
|
-
/**
|
|
7837
|
-
Rive.prototype.wantsTextInputSession = function (
|
|
7836
|
+
/** expectsTextInput (not key listeners alone), and with semantics on a textField. */
|
|
7837
|
+
Rive.prototype.wantsTextInputSession = function (expectsTextInput) {
|
|
7838
7838
|
var _a;
|
|
7839
|
-
if (!
|
|
7839
|
+
if (!expectsTextInput)
|
|
7840
7840
|
return false;
|
|
7841
7841
|
var node = (_a = this._semanticTree) === null || _a === void 0 ? void 0 : _a.focusedNode();
|
|
7842
7842
|
return node === undefined || node.role === _semantics__WEBPACK_IMPORTED_MODULE_2__.SemanticRole.textField;
|
|
@@ -8298,8 +8298,8 @@ var Rive = /** @class */ (function () {
|
|
|
8298
8298
|
this._prevWantsTextInputSession = false;
|
|
8299
8299
|
return;
|
|
8300
8300
|
}
|
|
8301
|
-
var _a = activeSm.focusState(), hasFocus = _a.hasFocus,
|
|
8302
|
-
this.syncTextInputSession(ki, this.wantsTextInputSession(
|
|
8301
|
+
var _a = activeSm.focusState(), hasFocus = _a.hasFocus, expectsTextInput = _a.expectsTextInput;
|
|
8302
|
+
this.syncTextInputSession(ki, this.wantsTextInputSession(expectsTextInput));
|
|
8303
8303
|
this.syncRiveFocus(ki, this.canvas, hasFocus);
|
|
8304
8304
|
};
|
|
8305
8305
|
/** Begin/end the text session on wantsSession edges; decorate the proxy while it has DOM focus. */
|