@rive-app/canvas 2.27.1 → 2.27.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas",
3
- "version": "2.27.1",
3
+ "version": "2.27.2",
4
4
  "description": "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
@@ -746,7 +746,7 @@ function Ya(a, b) {
746
746
  return Xa(c, a, b);
747
747
  }));
748
748
  }
749
- var Za, $a, db = {450700:(a, b, c, d, e) => {
749
+ var Za, $a, db = {452588:(a, b, c, d, e) => {
750
750
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
751
751
  return 0;
752
752
  }
@@ -809,9 +809,9 @@ var Za, $a, db = {450700:(a, b, c, d, e) => {
809
809
  }
810
810
  window.h.Aa += 1;
811
811
  return 1;
812
- }, 452878:() => {
812
+ }, 454766:() => {
813
813
  "undefined" !== typeof window.h && (--window.h.Aa, 0 === window.h.Aa && delete window.h);
814
- }, 453042:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 453146:() => {
814
+ }, 454930:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 455034:() => {
815
815
  try {
816
816
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
817
817
  a.close();
@@ -819,7 +819,7 @@ var Za, $a, db = {450700:(a, b, c, d, e) => {
819
819
  } catch (c) {
820
820
  return 0;
821
821
  }
822
- }, 453317:(a, b, c, d, e, f) => {
822
+ }, 455205:(a, b, c, d, e, f) => {
823
823
  if ("undefined" === typeof window.h) {
824
824
  return -1;
825
825
  }
@@ -865,7 +865,7 @@ var Za, $a, db = {450700:(a, b, c, d, e) => {
865
865
  a == window.h.I.ya && g.Z.connect(g.J.destination);
866
866
  g.pb = f;
867
867
  return window.h.yc(g);
868
- }, 456194:a => window.h.ra(a).J.sampleRate, 456267:a => {
868
+ }, 458082:a => window.h.ra(a).J.sampleRate, 458155:a => {
869
869
  a = window.h.ra(a);
870
870
  void 0 !== a.Z && (a.Z.onaudioprocess = function() {
871
871
  }, a.Z.disconnect(), a.Z = void 0);
@@ -873,13 +873,13 @@ var Za, $a, db = {450700:(a, b, c, d, e) => {
873
873
  a.J.close();
874
874
  a.J = void 0;
875
875
  a.pb = void 0;
876
- }, 456667:a => {
876
+ }, 458555:a => {
877
877
  window.h.Cb(a);
878
- }, 456717:a => {
878
+ }, 458605:a => {
879
879
  a = window.h.ra(a);
880
880
  a.J.resume();
881
881
  a.state = window.h.ga.xb;
882
- }, 456856:a => {
882
+ }, 458744:a => {
883
883
  a = window.h.ra(a);
884
884
  a.J.suspend();
885
885
  a.state = window.h.ga.stopped;
@@ -3367,7 +3367,7 @@ $d();
3367
3367
  /* 2 */
3368
3368
  /***/ ((module) => {
3369
3369
 
3370
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.27.1","description":"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}}');
3370
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas","version":"2.27.2","description":"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}}');
3371
3371
 
3372
3372
  /***/ }),
3373
3373
  /* 3 */
@@ -3843,6 +3843,7 @@ __webpack_require__.r(__webpack_exports__);
3843
3843
  /* harmony export */ ViewModelInstanceBoolean: () => (/* binding */ ViewModelInstanceBoolean),
3844
3844
  /* harmony export */ ViewModelInstanceColor: () => (/* binding */ ViewModelInstanceColor),
3845
3845
  /* harmony export */ ViewModelInstanceEnum: () => (/* binding */ ViewModelInstanceEnum),
3846
+ /* harmony export */ ViewModelInstanceList: () => (/* binding */ ViewModelInstanceList),
3846
3847
  /* harmony export */ ViewModelInstanceNumber: () => (/* binding */ ViewModelInstanceNumber),
3847
3848
  /* harmony export */ ViewModelInstanceString: () => (/* binding */ ViewModelInstanceString),
3848
3849
  /* harmony export */ ViewModelInstanceTrigger: () => (/* binding */ ViewModelInstanceTrigger),
@@ -6717,6 +6718,7 @@ var PropertyType;
6717
6718
  PropertyType["Color"] = "color";
6718
6719
  PropertyType["Trigger"] = "trigger";
6719
6720
  PropertyType["Enum"] = "enum";
6721
+ PropertyType["List"] = "list";
6720
6722
  })(PropertyType || (PropertyType = {}));
6721
6723
  var ViewModelInstance = /** @class */ (function () {
6722
6724
  function ViewModelInstance(runtimeInstance, parent) {
@@ -6840,7 +6842,7 @@ var ViewModelInstance = /** @class */ (function () {
6840
6842
  return null;
6841
6843
  };
6842
6844
  ViewModelInstance.prototype.propertyFromPathSegments = function (pathSegments, index, type) {
6843
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
6845
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
6844
6846
  if (index < pathSegments.length - 1) {
6845
6847
  var viewModelInstance = this.internalViewModelInstance(pathSegments[index]);
6846
6848
  if (viewModelInstance !== null) {
@@ -6888,6 +6890,12 @@ var ViewModelInstance = /** @class */ (function () {
6888
6890
  return new ViewModelInstanceEnum(instance, this);
6889
6891
  }
6890
6892
  break;
6893
+ case PropertyType.List:
6894
+ instance = (_p = (_o = this._runtimeInstance) === null || _o === void 0 ? void 0 : _o.list(pathSegments[index])) !== null && _p !== void 0 ? _p : null;
6895
+ if (instance !== null) {
6896
+ return new ViewModelInstanceList(instance, this);
6897
+ }
6898
+ break;
6891
6899
  }
6892
6900
  return null;
6893
6901
  };
@@ -6959,6 +6967,15 @@ var ViewModelInstance = /** @class */ (function () {
6959
6967
  var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.Enum);
6960
6968
  return viewmodelInstanceValue;
6961
6969
  };
6970
+ /**
6971
+ * method to access a property instance of type list belonging
6972
+ * to the view model instance or to a nested view model instance
6973
+ * @param path - path to the list property
6974
+ */
6975
+ ViewModelInstance.prototype.list = function (path) {
6976
+ var viewmodelInstanceValue = this.propertyFromPath(path, PropertyType.List);
6977
+ return viewmodelInstanceValue;
6978
+ };
6962
6979
  /**
6963
6980
  * method to access a view model property instance belonging
6964
6981
  * to the view model instance or to a nested view model instance
@@ -7233,6 +7250,45 @@ var ViewModelInstanceEnum = /** @class */ (function (_super) {
7233
7250
  return ViewModelInstanceEnum;
7234
7251
  }(ViewModelInstanceValue));
7235
7252
 
7253
+ var ViewModelInstanceList = /** @class */ (function (_super) {
7254
+ __extends(ViewModelInstanceList, _super);
7255
+ function ViewModelInstanceList(instance, parent) {
7256
+ return _super.call(this, instance, parent) || this;
7257
+ }
7258
+ Object.defineProperty(ViewModelInstanceList.prototype, "length", {
7259
+ get: function () {
7260
+ return this._viewModelInstanceValue.size;
7261
+ },
7262
+ enumerable: false,
7263
+ configurable: true
7264
+ });
7265
+ ViewModelInstanceList.prototype.addInstance = function (instance) {
7266
+ if (instance.runtimeInstance != null) {
7267
+ this._viewModelInstanceValue.addInstance(instance.runtimeInstance);
7268
+ }
7269
+ };
7270
+ ViewModelInstanceList.prototype.removeInstance = function (instance) {
7271
+ if (instance.runtimeInstance != null) {
7272
+ this._viewModelInstanceValue.removeInstance(instance.runtimeInstance);
7273
+ }
7274
+ };
7275
+ ViewModelInstanceList.prototype.removeInstanceAt = function (index) {
7276
+ this._viewModelInstanceValue.removeInstanceAt(index);
7277
+ };
7278
+ ViewModelInstanceList.prototype.instanceAt = function (index) {
7279
+ var runtimeInstance = this._viewModelInstanceValue.instanceAt(index);
7280
+ if (runtimeInstance != null) {
7281
+ var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
7282
+ return viewModelInstance;
7283
+ }
7284
+ return null;
7285
+ };
7286
+ ViewModelInstanceList.prototype.internalHandleCallback = function (callback) {
7287
+ callback();
7288
+ };
7289
+ return ViewModelInstanceList;
7290
+ }(ViewModelInstanceValue));
7291
+
7236
7292
  var ViewModelInstanceColor = /** @class */ (function (_super) {
7237
7293
  __extends(ViewModelInstanceColor, _super);
7238
7294
  function ViewModelInstanceColor(instance, parent) {