@rive-app/canvas-lite 2.30.1 → 2.30.2
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 +1 -1
- package/rive.d.ts +17 -0
- package/rive.js +54 -2
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +4 -0
- package/rive_fallback.wasm +0 -0
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -112,6 +112,10 @@ export declare enum RiveEventType {
|
|
|
112
112
|
General = 128,
|
|
113
113
|
OpenUrl = 131
|
|
114
114
|
}
|
|
115
|
+
declare class Artboard {
|
|
116
|
+
nativeArtboard: rc.Artboard;
|
|
117
|
+
constructor(artboard: rc.Artboard);
|
|
118
|
+
}
|
|
115
119
|
/**
|
|
116
120
|
* Supported event types triggered in Rive
|
|
117
121
|
*/
|
|
@@ -340,6 +344,7 @@ export declare class RiveFile {
|
|
|
340
344
|
removeAllRiveEventListeners(type?: EventType): void;
|
|
341
345
|
getInstance(): rc.File;
|
|
342
346
|
destroyIfUnused(): void;
|
|
347
|
+
getArtboard(name: string): Artboard | null;
|
|
343
348
|
}
|
|
344
349
|
export declare class Rive {
|
|
345
350
|
private readonly canvas;
|
|
@@ -725,6 +730,7 @@ export declare class Rive {
|
|
|
725
730
|
viewModelByName(name: string): ViewModel | null;
|
|
726
731
|
enums(): DataEnum[];
|
|
727
732
|
defaultViewModel(): ViewModel | null;
|
|
733
|
+
getArtboard(name: string): Artboard | null;
|
|
728
734
|
}
|
|
729
735
|
export declare class ViewModel {
|
|
730
736
|
private _viewModel;
|
|
@@ -813,6 +819,12 @@ export declare class ViewModelInstance {
|
|
|
813
819
|
* @param path - path to the image property
|
|
814
820
|
*/
|
|
815
821
|
image(path: string): ViewModelInstanceAssetImage | null;
|
|
822
|
+
/**
|
|
823
|
+
* method to access an artboard property instance belonging
|
|
824
|
+
* to the view model instance or to a nested view model instance
|
|
825
|
+
* @param path - path to the image property
|
|
826
|
+
*/
|
|
827
|
+
artboard(path: string): ViewModelInstanceArtboard | null;
|
|
816
828
|
/**
|
|
817
829
|
* method to access a view model property instance belonging
|
|
818
830
|
* to the view model instance or to a nested view model instance
|
|
@@ -904,6 +916,11 @@ export declare class ViewModelInstanceAssetImage extends ViewModelInstanceValue
|
|
|
904
916
|
set value(image: rc.Image | null);
|
|
905
917
|
internalHandleCallback(callback: Function): void;
|
|
906
918
|
}
|
|
919
|
+
export declare class ViewModelInstanceArtboard extends ViewModelInstanceValue {
|
|
920
|
+
constructor(instance: rc.ViewModelInstanceArtboard, root: ViewModelInstance);
|
|
921
|
+
set value(artboard: Artboard | null);
|
|
922
|
+
internalHandleCallback(callback: Function): void;
|
|
923
|
+
}
|
|
907
924
|
/**
|
|
908
925
|
* Contents of a state machine input
|
|
909
926
|
*/
|
package/rive.js
CHANGED
|
@@ -2272,7 +2272,7 @@ Qc();
|
|
|
2272
2272
|
/* 2 */
|
|
2273
2273
|
/***/ ((module) => {
|
|
2274
2274
|
|
|
2275
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.30.
|
|
2275
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.30.2","description":"A lite version of Rive\'s canvas based web api.","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.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
2276
2276
|
|
|
2277
2277
|
/***/ }),
|
|
2278
2278
|
/* 3 */
|
|
@@ -3009,6 +3009,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3009
3009
|
/* harmony export */ Testing: () => (/* binding */ Testing),
|
|
3010
3010
|
/* harmony export */ ViewModel: () => (/* binding */ ViewModel),
|
|
3011
3011
|
/* harmony export */ ViewModelInstance: () => (/* binding */ ViewModelInstance),
|
|
3012
|
+
/* harmony export */ ViewModelInstanceArtboard: () => (/* binding */ ViewModelInstanceArtboard),
|
|
3012
3013
|
/* harmony export */ ViewModelInstanceAssetImage: () => (/* binding */ ViewModelInstanceAssetImage),
|
|
3013
3014
|
/* harmony export */ ViewModelInstanceBoolean: () => (/* binding */ ViewModelInstanceBoolean),
|
|
3014
3015
|
/* harmony export */ ViewModelInstanceColor: () => (/* binding */ ViewModelInstanceColor),
|
|
@@ -3391,6 +3392,12 @@ var RiveEventType;
|
|
|
3391
3392
|
RiveEventType[RiveEventType["General"] = 128] = "General";
|
|
3392
3393
|
RiveEventType[RiveEventType["OpenUrl"] = 131] = "OpenUrl";
|
|
3393
3394
|
})(RiveEventType || (RiveEventType = {}));
|
|
3395
|
+
var Artboard = /** @class */ (function () {
|
|
3396
|
+
function Artboard(artboard) {
|
|
3397
|
+
this.nativeArtboard = artboard;
|
|
3398
|
+
}
|
|
3399
|
+
return Artboard;
|
|
3400
|
+
}());
|
|
3394
3401
|
var StateMachine = /** @class */ (function () {
|
|
3395
3402
|
/**
|
|
3396
3403
|
* @constructor
|
|
@@ -4369,6 +4376,13 @@ var RiveFile = /** @class */ (function () {
|
|
|
4369
4376
|
this.cleanup();
|
|
4370
4377
|
}
|
|
4371
4378
|
};
|
|
4379
|
+
RiveFile.prototype.getArtboard = function (name) {
|
|
4380
|
+
var nativeArtboard = this.file.artboardByName(name);
|
|
4381
|
+
if (nativeArtboard != null) {
|
|
4382
|
+
return new Artboard(nativeArtboard);
|
|
4383
|
+
}
|
|
4384
|
+
return null;
|
|
4385
|
+
};
|
|
4372
4386
|
// Error message for missing source or buffer
|
|
4373
4387
|
RiveFile.missingErrorMessage = "Rive source file or data buffer required";
|
|
4374
4388
|
// Error message for file load error
|
|
@@ -5813,6 +5827,10 @@ var Rive = /** @class */ (function () {
|
|
|
5813
5827
|
}
|
|
5814
5828
|
return null;
|
|
5815
5829
|
};
|
|
5830
|
+
Rive.prototype.getArtboard = function (name) {
|
|
5831
|
+
var _a, _b;
|
|
5832
|
+
return (_b = (_a = this.riveFile) === null || _a === void 0 ? void 0 : _a.getArtboard(name)) !== null && _b !== void 0 ? _b : null;
|
|
5833
|
+
};
|
|
5816
5834
|
// Error message for missing source or buffer
|
|
5817
5835
|
Rive.missingErrorMessage = "Rive source file or data buffer required";
|
|
5818
5836
|
// Error message for removed rive file
|
|
@@ -5914,6 +5932,7 @@ var PropertyType;
|
|
|
5914
5932
|
PropertyType["Enum"] = "enum";
|
|
5915
5933
|
PropertyType["List"] = "list";
|
|
5916
5934
|
PropertyType["Image"] = "image";
|
|
5935
|
+
PropertyType["Artboard"] = "artboard";
|
|
5917
5936
|
})(PropertyType || (PropertyType = {}));
|
|
5918
5937
|
var ViewModelInstance = /** @class */ (function () {
|
|
5919
5938
|
function ViewModelInstance(runtimeInstance, parent) {
|
|
@@ -6040,7 +6059,7 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6040
6059
|
return null;
|
|
6041
6060
|
};
|
|
6042
6061
|
ViewModelInstance.prototype.propertyFromPathSegments = function (pathSegments, index, type) {
|
|
6043
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
6062
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
6044
6063
|
if (index < pathSegments.length - 1) {
|
|
6045
6064
|
var viewModelInstance = this.internalViewModelInstance(pathSegments[index]);
|
|
6046
6065
|
if (viewModelInstance !== null) {
|
|
@@ -6100,6 +6119,12 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6100
6119
|
return new ViewModelInstanceAssetImage(instance, this);
|
|
6101
6120
|
}
|
|
6102
6121
|
break;
|
|
6122
|
+
case PropertyType.Artboard:
|
|
6123
|
+
instance = (_t = (_s = this._runtimeInstance) === null || _s === void 0 ? void 0 : _s.artboard(pathSegments[index])) !== null && _t !== void 0 ? _t : null;
|
|
6124
|
+
if (instance !== null) {
|
|
6125
|
+
return new ViewModelInstanceArtboard(instance, this);
|
|
6126
|
+
}
|
|
6127
|
+
break;
|
|
6103
6128
|
}
|
|
6104
6129
|
return null;
|
|
6105
6130
|
};
|
|
@@ -6189,6 +6214,15 @@ var ViewModelInstance = /** @class */ (function () {
|
|
|
6189
6214
|
var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.Image);
|
|
6190
6215
|
return viewmodelInstanceValue;
|
|
6191
6216
|
};
|
|
6217
|
+
/**
|
|
6218
|
+
* method to access an artboard property instance belonging
|
|
6219
|
+
* to the view model instance or to a nested view model instance
|
|
6220
|
+
* @param path - path to the image property
|
|
6221
|
+
*/
|
|
6222
|
+
ViewModelInstance.prototype.artboard = function (path) {
|
|
6223
|
+
var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.Artboard);
|
|
6224
|
+
return viewmodelInstanceValue;
|
|
6225
|
+
};
|
|
6192
6226
|
/**
|
|
6193
6227
|
* method to access a view model property instance belonging
|
|
6194
6228
|
* to the view model instance or to a nested view model instance
|
|
@@ -6573,6 +6607,24 @@ var ViewModelInstanceAssetImage = /** @class */ (function (_super) {
|
|
|
6573
6607
|
return ViewModelInstanceAssetImage;
|
|
6574
6608
|
}(ViewModelInstanceValue));
|
|
6575
6609
|
|
|
6610
|
+
var ViewModelInstanceArtboard = /** @class */ (function (_super) {
|
|
6611
|
+
__extends(ViewModelInstanceArtboard, _super);
|
|
6612
|
+
function ViewModelInstanceArtboard(instance, root) {
|
|
6613
|
+
return _super.call(this, instance, root) || this;
|
|
6614
|
+
}
|
|
6615
|
+
Object.defineProperty(ViewModelInstanceArtboard.prototype, "value", {
|
|
6616
|
+
set: function (artboard) {
|
|
6617
|
+
this._viewModelInstanceValue.value(artboard.nativeArtboard);
|
|
6618
|
+
},
|
|
6619
|
+
enumerable: false,
|
|
6620
|
+
configurable: true
|
|
6621
|
+
});
|
|
6622
|
+
ViewModelInstanceArtboard.prototype.internalHandleCallback = function (callback) {
|
|
6623
|
+
callback();
|
|
6624
|
+
};
|
|
6625
|
+
return ViewModelInstanceArtboard;
|
|
6626
|
+
}(ViewModelInstanceValue));
|
|
6627
|
+
|
|
6576
6628
|
// Loads Rive data from a URI via fetch.
|
|
6577
6629
|
var loadRiveFile = function (src) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6578
6630
|
var req, res, buffer;
|