@rive-app/canvas-single 1.0.24 → 1.0.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas-single",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Rive's high-level canvas based web api all in one js file.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.d.ts CHANGED
@@ -178,6 +178,7 @@ export interface RiveParameters {
178
178
  stateMachines?: string | string[];
179
179
  layout?: Layout;
180
180
  autoplay?: boolean;
181
+ useOffscreenRenderer?: boolean;
181
182
  onLoad?: EventCallback;
182
183
  onLoadError?: EventCallback;
183
184
  onPlay?: EventCallback;
@@ -221,6 +222,7 @@ export interface RiveLoadParameters {
221
222
  artboard?: string;
222
223
  animations?: string | string[];
223
224
  stateMachines?: string | string[];
225
+ useOffscreenRenderer?: boolean;
224
226
  }
225
227
  export interface RiveResetParameters {
226
228
  artboard?: string;
package/rive.js CHANGED
@@ -124,7 +124,7 @@ if(h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0<h.preIn
124
124
  /* 2 */
125
125
  /***/ ((module) => {
126
126
 
127
- module.exports = JSON.parse('{"name":"@rive-app/canvas-single","version":"1.0.24","description":"Rive\'s high-level canvas based web api all in one js file.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"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.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
127
+ module.exports = JSON.parse('{"name":"@rive-app/canvas-single","version":"1.0.25","description":"Rive\'s high-level canvas based web api all in one js file.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"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.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
128
128
 
129
129
  /***/ })
130
130
  /******/ ]);
@@ -1072,6 +1072,7 @@ var Rive = /** @class */ (function () {
1072
1072
  animations: params.animations,
1073
1073
  stateMachines: params.stateMachines,
1074
1074
  artboard: params.artboard,
1075
+ useOffscreenRenderer: params.useOffscreenRenderer,
1075
1076
  });
1076
1077
  }
1077
1078
  // Alternative constructor to build a Rive instance from an interface/object
@@ -1082,7 +1083,7 @@ var Rive = /** @class */ (function () {
1082
1083
  // Initializes the Rive object either from constructor or load()
1083
1084
  Rive.prototype.init = function (_a) {
1084
1085
  var _this = this;
1085
- var src = _a.src, buffer = _a.buffer, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b;
1086
+ var src = _a.src, buffer = _a.buffer, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c;
1086
1087
  this.src = src;
1087
1088
  this.buffer = buffer;
1088
1089
  // If no source file url specified, it's a bust
@@ -1100,7 +1101,7 @@ var Rive = /** @class */ (function () {
1100
1101
  RuntimeLoader.awaitInstance().then(function (runtime) {
1101
1102
  _this.runtime = runtime;
1102
1103
  // Get the canvas where you want to render the animation and create a renderer
1103
- _this.renderer = _this.runtime.makeRenderer(_this.canvas);
1104
+ _this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
1104
1105
  // Initial size adjustment based on devicePixelRatio if no width/height are specified explicitly
1105
1106
  if (!(_this.canvas.width || _this.canvas.height)) {
1106
1107
  _this.resizeDrawingSurfaceToCanvas();