@rive-app/canvas-lite 2.27.1 → 2.27.3

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-lite",
3
- "version": "2.27.1",
3
+ "version": "2.27.3",
4
4
  "description": "A lite version of Rive's canvas based web api.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.d.ts CHANGED
@@ -799,6 +799,12 @@ export declare class ViewModelInstance {
799
799
  * @param path - path to the enum property
800
800
  */
801
801
  enum(path: string): ViewModelInstanceEnum | null;
802
+ /**
803
+ * method to access a property instance of type list belonging
804
+ * to the view model instance or to a nested view model instance
805
+ * @param path - path to the list property
806
+ */
807
+ list(path: string): ViewModelInstanceList | null;
802
808
  /**
803
809
  * method to access a view model property instance belonging
804
810
  * to the view model instance or to a nested view model instance
@@ -863,6 +869,15 @@ export declare class ViewModelInstanceEnum extends ViewModelInstanceValue {
863
869
  get values(): string[];
864
870
  internalHandleCallback(callback: Function): void;
865
871
  }
872
+ export declare class ViewModelInstanceList extends ViewModelInstanceValue {
873
+ constructor(instance: rc.ViewModelInstanceList, parent: ViewModelInstance);
874
+ get length(): number;
875
+ addInstance(instance: ViewModelInstance): void;
876
+ removeInstance(instance: ViewModelInstance): void;
877
+ removeInstanceAt(index: number): void;
878
+ instanceAt(index: number): ViewModelInstance | null;
879
+ internalHandleCallback(callback: Function): void;
880
+ }
866
881
  export declare class ViewModelInstanceColor extends ViewModelInstanceValue {
867
882
  constructor(instance: rc.ViewModelInstanceColor, parent: ViewModelInstance);
868
883
  get value(): number;
package/rive.js CHANGED
@@ -2271,7 +2271,7 @@ Qc();
2271
2271
  /* 2 */
2272
2272
  /***/ ((module) => {
2273
2273
 
2274
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.27.1","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}}');
2274
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.27.3","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}}');
2275
2275
 
2276
2276
  /***/ }),
2277
2277
  /* 3 */
@@ -2747,6 +2747,7 @@ __webpack_require__.r(__webpack_exports__);
2747
2747
  /* harmony export */ ViewModelInstanceBoolean: () => (/* binding */ ViewModelInstanceBoolean),
2748
2748
  /* harmony export */ ViewModelInstanceColor: () => (/* binding */ ViewModelInstanceColor),
2749
2749
  /* harmony export */ ViewModelInstanceEnum: () => (/* binding */ ViewModelInstanceEnum),
2750
+ /* harmony export */ ViewModelInstanceList: () => (/* binding */ ViewModelInstanceList),
2750
2751
  /* harmony export */ ViewModelInstanceNumber: () => (/* binding */ ViewModelInstanceNumber),
2751
2752
  /* harmony export */ ViewModelInstanceString: () => (/* binding */ ViewModelInstanceString),
2752
2753
  /* harmony export */ ViewModelInstanceTrigger: () => (/* binding */ ViewModelInstanceTrigger),
@@ -5621,6 +5622,7 @@ var PropertyType;
5621
5622
  PropertyType["Color"] = "color";
5622
5623
  PropertyType["Trigger"] = "trigger";
5623
5624
  PropertyType["Enum"] = "enum";
5625
+ PropertyType["List"] = "list";
5624
5626
  })(PropertyType || (PropertyType = {}));
5625
5627
  var ViewModelInstance = /** @class */ (function () {
5626
5628
  function ViewModelInstance(runtimeInstance, parent) {
@@ -5744,7 +5746,7 @@ var ViewModelInstance = /** @class */ (function () {
5744
5746
  return null;
5745
5747
  };
5746
5748
  ViewModelInstance.prototype.propertyFromPathSegments = function (pathSegments, index, type) {
5747
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
5749
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
5748
5750
  if (index < pathSegments.length - 1) {
5749
5751
  var viewModelInstance = this.internalViewModelInstance(pathSegments[index]);
5750
5752
  if (viewModelInstance !== null) {
@@ -5792,6 +5794,12 @@ var ViewModelInstance = /** @class */ (function () {
5792
5794
  return new ViewModelInstanceEnum(instance, this);
5793
5795
  }
5794
5796
  break;
5797
+ case PropertyType.List:
5798
+ instance = (_p = (_o = this._runtimeInstance) === null || _o === void 0 ? void 0 : _o.list(pathSegments[index])) !== null && _p !== void 0 ? _p : null;
5799
+ if (instance !== null) {
5800
+ return new ViewModelInstanceList(instance, this);
5801
+ }
5802
+ break;
5795
5803
  }
5796
5804
  return null;
5797
5805
  };
@@ -5863,6 +5871,15 @@ var ViewModelInstance = /** @class */ (function () {
5863
5871
  var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.Enum);
5864
5872
  return viewmodelInstanceValue;
5865
5873
  };
5874
+ /**
5875
+ * method to access a property instance of type list belonging
5876
+ * to the view model instance or to a nested view model instance
5877
+ * @param path - path to the list property
5878
+ */
5879
+ ViewModelInstance.prototype.list = function (path) {
5880
+ var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.List);
5881
+ return viewmodelInstanceValue;
5882
+ };
5866
5883
  /**
5867
5884
  * method to access a view model property instance belonging
5868
5885
  * to the view model instance or to a nested view model instance
@@ -6137,6 +6154,45 @@ var ViewModelInstanceEnum = /** @class */ (function (_super) {
6137
6154
  return ViewModelInstanceEnum;
6138
6155
  }(ViewModelInstanceValue));
6139
6156
 
6157
+ var ViewModelInstanceList = /** @class */ (function (_super) {
6158
+ __extends(ViewModelInstanceList, _super);
6159
+ function ViewModelInstanceList(instance, parent) {
6160
+ return _super.call(this, instance, parent) || this;
6161
+ }
6162
+ Object.defineProperty(ViewModelInstanceList.prototype, "length", {
6163
+ get: function () {
6164
+ return this._viewModelInstanceValue.size;
6165
+ },
6166
+ enumerable: false,
6167
+ configurable: true
6168
+ });
6169
+ ViewModelInstanceList.prototype.addInstance = function (instance) {
6170
+ if (instance.runtimeInstance != null) {
6171
+ this._viewModelInstanceValue.addInstance(instance.runtimeInstance);
6172
+ }
6173
+ };
6174
+ ViewModelInstanceList.prototype.removeInstance = function (instance) {
6175
+ if (instance.runtimeInstance != null) {
6176
+ this._viewModelInstanceValue.removeInstance(instance.runtimeInstance);
6177
+ }
6178
+ };
6179
+ ViewModelInstanceList.prototype.removeInstanceAt = function (index) {
6180
+ this._viewModelInstanceValue.removeInstanceAt(index);
6181
+ };
6182
+ ViewModelInstanceList.prototype.instanceAt = function (index) {
6183
+ var runtimeInstance = this._viewModelInstanceValue.instanceAt(index);
6184
+ if (runtimeInstance != null) {
6185
+ var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
6186
+ return viewModelInstance;
6187
+ }
6188
+ return null;
6189
+ };
6190
+ ViewModelInstanceList.prototype.internalHandleCallback = function (callback) {
6191
+ callback();
6192
+ };
6193
+ return ViewModelInstanceList;
6194
+ }(ViewModelInstanceValue));
6195
+
6140
6196
  var ViewModelInstanceColor = /** @class */ (function (_super) {
6141
6197
  __extends(ViewModelInstanceColor, _super);
6142
6198
  function ViewModelInstanceColor(instance, parent) {