@rive-app/webgl2 2.35.3 → 2.36.0

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/webgl2",
3
- "version": "2.35.3",
3
+ "version": "2.36.0",
4
4
  "description": "Rive's webgl2 based web api.",
5
5
  "main": "rive.js",
6
6
  "homepage": "https://rive.app",
package/rive.d.ts CHANGED
@@ -73,6 +73,11 @@ export declare class RuntimeLoader {
73
73
  private static rive;
74
74
  private static wasmURL;
75
75
  private constructor();
76
+ /**
77
+ * When true, performance.mark / performance.measure entries are emitted for
78
+ * WASM initialization.
79
+ */
80
+ static enablePerfMarks: boolean;
76
81
  private static loadRuntime;
77
82
  static getInstance(callback: RuntimeCallback): void;
78
83
  static awaitInstance(): Promise<rc.RiveCanvas>;
@@ -270,6 +275,13 @@ export interface RiveParameters {
270
275
  * Enum with drawing options for optimizations
271
276
  */
272
277
  drawingOptions?: DrawOptimizationOptions;
278
+ /**
279
+ * Emit performance.mark / performance.measure entries for load lifecycle
280
+ * events and the first 3 render frames. Useful for profiling Rive's
281
+ * contribution to load and render time in browser devtools.
282
+ * False by default.
283
+ */
284
+ enablePerfMarks?: boolean;
273
285
  onLoad?: EventCallback;
274
286
  onLoadError?: EventCallback;
275
287
  onPlay?: EventCallback;
@@ -334,6 +346,11 @@ export interface RiveFileParameters {
334
346
  enableRiveAssetCDN?: boolean;
335
347
  onLoad?: EventCallback;
336
348
  onLoadError?: EventCallback;
349
+ /**
350
+ * Emit performance.mark / performance.measure entries for load lifecycle
351
+ * events. False by default.
352
+ */
353
+ enablePerfMarks?: boolean;
337
354
  }
338
355
  export declare class RiveFile implements rc.FinalizableTarget {
339
356
  private static readonly missingErrorMessage;
@@ -344,6 +361,7 @@ export declare class RiveFile implements rc.FinalizableTarget {
344
361
  private file;
345
362
  private assetLoader;
346
363
  private enableRiveAssetCDN;
364
+ private enablePerfMarks;
347
365
  private eventManager;
348
366
  private referenceCount;
349
367
  private destroyed;
@@ -353,6 +371,8 @@ export declare class RiveFile implements rc.FinalizableTarget {
353
371
  private releaseFile;
354
372
  private releaseBindableArtboards;
355
373
  private initData;
374
+ private loadRiveFileBytes;
375
+ private loadRuntime;
356
376
  init(): Promise<void>;
357
377
  private fireLoadError;
358
378
  /**
@@ -436,6 +456,7 @@ export declare class Rive {
436
456
  private _viewModelInstance;
437
457
  private _dataEnums;
438
458
  private drawOptimization;
459
+ private enablePerfMarks;
439
460
  durations: number[];
440
461
  frameTimes: number[];
441
462
  frameCount: number;
@@ -792,6 +813,21 @@ export declare class Rive {
792
813
  getBindableArtboard(name: string): BindableArtboard | null;
793
814
  getDefaultBindableArtboard(): BindableArtboard | null;
794
815
  }
816
+ export declare enum DataType {
817
+ none = "none",
818
+ string = "string",
819
+ number = "number",
820
+ boolean = "boolean",
821
+ color = "color",
822
+ list = "list",
823
+ enumType = "enumType",
824
+ trigger = "trigger",
825
+ viewModel = "viewModel",
826
+ integer = "integer",
827
+ listIndex = "listIndex",
828
+ image = "image",
829
+ artboard = "artboard"
830
+ }
795
831
  export declare class ViewModel {
796
832
  private _viewModel;
797
833
  constructor(viewModel: rc.ViewModel);
@@ -800,7 +836,7 @@ export declare class ViewModel {
800
836
  instanceByIndex(index: number): ViewModelInstance | null;
801
837
  instanceByName(name: string): ViewModelInstance | null;
802
838
  defaultInstance(): ViewModelInstance | null;
803
- instance(): ViewModelInstance | null;
839
+ instance(): ViewModelInstance;
804
840
  get properties(): rc.ViewModelProperty[];
805
841
  get instanceNames(): string[];
806
842
  }
@@ -903,6 +939,10 @@ export declare class ViewModelInstance {
903
939
  incrementReferenceCount(): void;
904
940
  decrementReferenceCount(): void;
905
941
  get properties(): rc.ViewModelProperty[];
942
+ /**
943
+ * Get the name of the ViewModel definition this instance was created from.
944
+ */
945
+ get viewModelName(): string;
906
946
  internalIncrementReferenceCount(): void;
907
947
  cleanup(): void;
908
948
  }
package/rive.js CHANGED
@@ -427,7 +427,7 @@ function Na(a, b) {
427
427
  return Ma(c, a, b);
428
428
  }));
429
429
  }
430
- var Oa, Pa, Ta = {562193:(a, b, c, d, e) => {
430
+ var Oa, Pa, Ta = {563121:(a, b, c, d, e) => {
431
431
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
432
432
  return 0;
433
433
  }
@@ -490,11 +490,11 @@ var Oa, Pa, Ta = {562193:(a, b, c, d, e) => {
490
490
  }
491
491
  window.h.Ea += 1;
492
492
  return 1;
493
- }, 564371:() => {
493
+ }, 565299:() => {
494
494
  "undefined" !== typeof window.h && (window.h.Xa.map(function(a) {
495
495
  document.removeEventListener(a, window.h.unlock, !0);
496
496
  }), --window.h.Ea, 0 === window.h.Ea && delete window.h);
497
- }, 564675:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 564779:() => {
497
+ }, 565603:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 565707:() => {
498
498
  try {
499
499
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
500
500
  a.close();
@@ -502,7 +502,7 @@ var Oa, Pa, Ta = {562193:(a, b, c, d, e) => {
502
502
  } catch (c) {
503
503
  return 0;
504
504
  }
505
- }, 564950:(a, b, c, d, e, f) => {
505
+ }, 565878:(a, b, c, d, e, f) => {
506
506
  if ("undefined" === typeof window.h) {
507
507
  return -1;
508
508
  }
@@ -548,7 +548,7 @@ var Oa, Pa, Ta = {562193:(a, b, c, d, e) => {
548
548
  a == window.h.I.Ca && g.Y.connect(g.K.destination);
549
549
  g.nb = f;
550
550
  return window.h.lc(g);
551
- }, 567827:a => window.h.ta(a).K.sampleRate, 567900:a => {
551
+ }, 568755:a => window.h.ta(a).K.sampleRate, 568828:a => {
552
552
  a = window.h.ta(a);
553
553
  void 0 !== a.Y && (a.Y.onaudioprocess = function() {
554
554
  }, a.Y.disconnect(), a.Y = void 0);
@@ -556,13 +556,13 @@ var Oa, Pa, Ta = {562193:(a, b, c, d, e) => {
556
556
  a.K.close();
557
557
  a.K = void 0;
558
558
  a.nb = void 0;
559
- }, 568300:a => {
559
+ }, 569228:a => {
560
560
  window.h.yb(a);
561
- }, 568350:a => {
561
+ }, 569278:a => {
562
562
  a = window.h.ta(a);
563
563
  a.K.resume();
564
564
  a.state = window.h.ia.ub;
565
- }, 568489:a => {
565
+ }, 569417:a => {
566
566
  a = window.h.ta(a);
567
567
  a.K.suspend();
568
568
  a.state = window.h.ia.stopped;
@@ -3546,7 +3546,7 @@ moduleRtn = ca;
3546
3546
  /* 2 */
3547
3547
  /***/ ((module) => {
3548
3548
 
3549
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.35.3","description":"Rive\'s webgl2 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)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3549
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.36.0","description":"Rive\'s webgl2 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)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3550
3550
 
3551
3551
  /***/ }),
3552
3552
  /* 3 */
@@ -4361,6 +4361,7 @@ __webpack_require__.r(__webpack_exports__);
4361
4361
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4362
4362
  /* harmony export */ Alignment: () => (/* binding */ Alignment),
4363
4363
  /* harmony export */ DataEnum: () => (/* binding */ DataEnum),
4364
+ /* harmony export */ DataType: () => (/* binding */ DataType),
4364
4365
  /* harmony export */ DrawOptimizationOptions: () => (/* binding */ DrawOptimizationOptions),
4365
4366
  /* harmony export */ EventType: () => (/* binding */ EventType),
4366
4367
  /* harmony export */ Fit: () => (/* binding */ Fit),
@@ -4609,12 +4610,18 @@ var RuntimeLoader = /** @class */ (function () {
4609
4610
  }
4610
4611
  // Loads the runtime
4611
4612
  RuntimeLoader.loadRuntime = function () {
4613
+ if (RuntimeLoader.enablePerfMarks)
4614
+ performance.mark('rive:wasm-init:start');
4612
4615
  _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
4613
4616
  // Loads Wasm bundle
4614
4617
  locateFile: function () { return RuntimeLoader.wasmURL; },
4615
4618
  })
4616
4619
  .then(function (rive) {
4617
4620
  var _a;
4621
+ if (RuntimeLoader.enablePerfMarks) {
4622
+ performance.mark('rive:wasm-init:end');
4623
+ performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');
4624
+ }
4618
4625
  RuntimeLoader.runtime = rive;
4619
4626
  // Fire all the callbacks
4620
4627
  while (RuntimeLoader.callBackQueue.length > 0) {
@@ -4697,6 +4704,11 @@ var RuntimeLoader = /** @class */ (function () {
4697
4704
  // Path to the Wasm file; default path works for testing only;
4698
4705
  // if embedded wasm is used then this is never used.
4699
4706
  RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
4707
+ /**
4708
+ * When true, performance.mark / performance.measure entries are emitted for
4709
+ * WASM initialization.
4710
+ */
4711
+ RuntimeLoader.enablePerfMarks = false;
4700
4712
  return RuntimeLoader;
4701
4713
  }());
4702
4714
 
@@ -5634,6 +5646,8 @@ var RiveFile = /** @class */ (function () {
5634
5646
  function RiveFile(params) {
5635
5647
  // Allow the runtime to automatically load assets hosted in Rive's runtime.
5636
5648
  this.enableRiveAssetCDN = true;
5649
+ // When true, emits performance.mark/measure entries during RiveFile load.
5650
+ this.enablePerfMarks = false;
5637
5651
  this.referenceCount = 0;
5638
5652
  this.destroyed = false;
5639
5653
  this.selfUnref = false;
@@ -5646,6 +5660,9 @@ var RiveFile = /** @class */ (function () {
5646
5660
  typeof params.enableRiveAssetCDN == "boolean"
5647
5661
  ? params.enableRiveAssetCDN
5648
5662
  : true;
5663
+ this.enablePerfMarks = !!params.enablePerfMarks;
5664
+ if (this.enablePerfMarks)
5665
+ RuntimeLoader.enablePerfMarks = true;
5649
5666
  // New event management system
5650
5667
  this.eventManager = new EventManager();
5651
5668
  if (params.onLoad)
@@ -5671,7 +5688,7 @@ var RiveFile = /** @class */ (function () {
5671
5688
  return __generator(this, function (_c) {
5672
5689
  switch (_c.label) {
5673
5690
  case 0:
5674
- if (!this.src) return [3 /*break*/, 2];
5691
+ if (!(this.src && !this.buffer)) return [3 /*break*/, 2];
5675
5692
  _a = this;
5676
5693
  return [4 /*yield*/, loadRiveFile(this.src)];
5677
5694
  case 1:
@@ -5686,11 +5703,16 @@ var RiveFile = /** @class */ (function () {
5686
5703
  loader = loaderWrapper.assetLoader;
5687
5704
  }
5688
5705
  // Load the Rive file
5706
+ if (this.enablePerfMarks)
5707
+ performance.mark('rive:file-load:start');
5689
5708
  _b = this;
5690
5709
  return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN)];
5691
5710
  case 3:
5692
- // Load the Rive file
5693
5711
  _b.file = _c.sent();
5712
+ if (this.enablePerfMarks) {
5713
+ performance.mark('rive:file-load:end');
5714
+ performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');
5715
+ }
5694
5716
  fileFinalizer = new _utils__WEBPACK_IMPORTED_MODULE_3__.FileFinalizer(this.file);
5695
5717
  _utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(this, fileFinalizer);
5696
5718
  if (this.destroyed) {
@@ -5711,9 +5733,45 @@ var RiveFile = /** @class */ (function () {
5711
5733
  });
5712
5734
  });
5713
5735
  };
5736
+ RiveFile.prototype.loadRiveFileBytes = function () {
5737
+ return __awaiter(this, void 0, void 0, function () {
5738
+ var bufferPromise;
5739
+ return __generator(this, function (_a) {
5740
+ if (this.enablePerfMarks)
5741
+ performance.mark('rive:fetch-riv:start');
5742
+ bufferPromise = this.src
5743
+ ? loadRiveFile(this.src)
5744
+ : Promise.resolve(this.buffer);
5745
+ if (this.enablePerfMarks && this.src) {
5746
+ bufferPromise.then(function () {
5747
+ performance.mark('rive:fetch-riv:end');
5748
+ performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');
5749
+ });
5750
+ }
5751
+ return [2 /*return*/, bufferPromise];
5752
+ });
5753
+ });
5754
+ };
5755
+ RiveFile.prototype.loadRuntime = function () {
5756
+ return __awaiter(this, void 0, void 0, function () {
5757
+ var runtimePromise;
5758
+ return __generator(this, function (_a) {
5759
+ if (this.enablePerfMarks)
5760
+ performance.mark('rive:await-wasm:start');
5761
+ runtimePromise = RuntimeLoader.awaitInstance();
5762
+ if (this.enablePerfMarks) {
5763
+ runtimePromise.then(function () {
5764
+ performance.mark('rive:await-wasm:end');
5765
+ performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');
5766
+ });
5767
+ }
5768
+ return [2 /*return*/, runtimePromise];
5769
+ });
5770
+ });
5771
+ };
5714
5772
  RiveFile.prototype.init = function () {
5715
5773
  return __awaiter(this, void 0, void 0, function () {
5716
- var _a, error_1;
5774
+ var _a, bufferResolved, runtimeResolved, error_1;
5717
5775
  return __generator(this, function (_b) {
5718
5776
  switch (_b.label) {
5719
5777
  case 0:
@@ -5725,16 +5783,24 @@ var RiveFile = /** @class */ (function () {
5725
5783
  _b.label = 1;
5726
5784
  case 1:
5727
5785
  _b.trys.push([1, 4, , 5]);
5728
- _a = this;
5729
- return [4 /*yield*/, RuntimeLoader.awaitInstance()];
5786
+ return [4 /*yield*/, Promise.all([this.loadRiveFileBytes(), this.loadRuntime()])];
5730
5787
  case 2:
5731
- _a.runtime = _b.sent();
5788
+ _a = _b.sent(), bufferResolved = _a[0], runtimeResolved = _a[1];
5732
5789
  if (this.destroyed) {
5733
5790
  return [2 /*return*/];
5734
5791
  }
5792
+ // .riv file buffer and WASM runtime instance
5793
+ this.buffer = bufferResolved;
5794
+ this.runtime = runtimeResolved;
5795
+ if (this.enablePerfMarks)
5796
+ performance.mark('rive:init-data:start');
5735
5797
  return [4 /*yield*/, this.initData()];
5736
5798
  case 3:
5737
5799
  _b.sent();
5800
+ if (this.enablePerfMarks) {
5801
+ performance.mark('rive:init-data:end');
5802
+ performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');
5803
+ }
5738
5804
  return [3 /*break*/, 5];
5739
5805
  case 4:
5740
5806
  error_1 = _b.sent();
@@ -5902,6 +5968,8 @@ var Rive = /** @class */ (function () {
5902
5968
  this._viewModelInstance = null;
5903
5969
  this._dataEnums = null;
5904
5970
  this.drawOptimization = DrawOptimizationOptions.DrawOnChanged;
5971
+ // When true, emits performance.mark/measure entries for load and render.
5972
+ this.enablePerfMarks = false;
5905
5973
  // Durations to generate a frame for the last second. Used for performance profiling.
5906
5974
  this.durations = [];
5907
5975
  this.frameTimes = [];
@@ -5948,6 +6016,9 @@ var Rive = /** @class */ (function () {
5948
6016
  params.enableRiveAssetCDN === undefined
5949
6017
  ? true
5950
6018
  : params.enableRiveAssetCDN;
6019
+ this.enablePerfMarks = !!params.enablePerfMarks;
6020
+ if (this.enablePerfMarks)
6021
+ RuntimeLoader.enablePerfMarks = true;
5951
6022
  // New event management system
5952
6023
  this.eventManager = new EventManager();
5953
6024
  if (params.onLoad)
@@ -6049,7 +6120,13 @@ var Rive = /** @class */ (function () {
6049
6120
  _this.removeRiveListeners();
6050
6121
  _this.deleteRiveRenderer();
6051
6122
  // Get the canvas where you want to render the animation and create a renderer
6123
+ if (_this.enablePerfMarks)
6124
+ performance.mark('rive:make-renderer:start');
6052
6125
  _this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
6126
+ if (_this.enablePerfMarks) {
6127
+ performance.mark('rive:make-renderer:end');
6128
+ performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');
6129
+ }
6053
6130
  // Initial size adjustment based on devicePixelRatio if no width/height are
6054
6131
  // specified explicitly
6055
6132
  if (!(_this.canvas.width || _this.canvas.height)) {
@@ -6161,6 +6238,7 @@ var Rive = /** @class */ (function () {
6161
6238
  buffer: this.buffer,
6162
6239
  enableRiveAssetCDN: this.enableRiveAssetCDN,
6163
6240
  assetLoader: this.assetLoader,
6241
+ enablePerfMarks: this.enablePerfMarks,
6164
6242
  });
6165
6243
  this.riveFile = riveFile;
6166
6244
  return [4 /*yield*/, riveFile.init()];
@@ -6327,6 +6405,9 @@ var Rive = /** @class */ (function () {
6327
6405
  // - Advance non-paused state machines by the elapsed number of seconds
6328
6406
  // - Advance to the first frame even when autoplay is false
6329
6407
  var activeStateMachines = this.animator.stateMachines.filter(function (a) { return a.playing; });
6408
+ // Instrument the first 3 frames so the Performance timeline shows precise
6409
+ // per-call latency for advance, draw, and flush without polluting the trace.
6410
+ var _perfFrame = this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;
6330
6411
  for (var _b = 0, activeStateMachines_1 = activeStateMachines; _b < activeStateMachines_1.length; _b++) {
6331
6412
  var stateMachine = activeStateMachines_1[_b];
6332
6413
  // Check for events before the current frame's state machine advance
@@ -6361,7 +6442,13 @@ var Rive = /** @class */ (function () {
6361
6442
  }
6362
6443
  }
6363
6444
  }
6445
+ if (_perfFrame >= 0)
6446
+ performance.mark("rive:sm-advance:start:f".concat(_perfFrame));
6364
6447
  stateMachine.advanceAndApply(elapsedTime);
6448
+ if (_perfFrame >= 0) {
6449
+ performance.mark("rive:sm-advance:end:f".concat(_perfFrame));
6450
+ performance.measure("rive:sm-advance:f".concat(_perfFrame), "rive:sm-advance:start:f".concat(_perfFrame), "rive:sm-advance:end:f".concat(_perfFrame));
6451
+ }
6365
6452
  // stateMachine.instance.apply(this.artboard);
6366
6453
  }
6367
6454
  // Once the animations have been applied to the artboard, advance it
@@ -6381,10 +6468,28 @@ var Rive = /** @class */ (function () {
6381
6468
  renderer.clear();
6382
6469
  renderer.save();
6383
6470
  // Update the renderer alignment if necessary
6471
+ if (_perfFrame >= 0)
6472
+ performance.mark("rive:align-renderer:start:f".concat(_perfFrame));
6384
6473
  this.alignRenderer();
6474
+ if (_perfFrame >= 0) {
6475
+ performance.mark("rive:align-renderer:end:f".concat(_perfFrame));
6476
+ performance.measure("rive:align-renderer:f".concat(_perfFrame), "rive:align-renderer:start:f".concat(_perfFrame), "rive:align-renderer:end:f".concat(_perfFrame));
6477
+ }
6478
+ if (_perfFrame >= 0)
6479
+ performance.mark("rive:artboard-draw:start:f".concat(_perfFrame));
6385
6480
  this.artboard.draw(renderer);
6481
+ if (_perfFrame >= 0) {
6482
+ performance.mark("rive:artboard-draw:end:f".concat(_perfFrame));
6483
+ performance.measure("rive:artboard-draw:f".concat(_perfFrame), "rive:artboard-draw:start:f".concat(_perfFrame), "rive:artboard-draw:end:f".concat(_perfFrame));
6484
+ }
6386
6485
  renderer.restore();
6486
+ if (_perfFrame >= 0)
6487
+ performance.mark("rive:renderer-flush:start:f".concat(_perfFrame));
6387
6488
  renderer.flush();
6489
+ if (_perfFrame >= 0) {
6490
+ performance.mark("rive:renderer-flush:end:f".concat(_perfFrame));
6491
+ performance.measure("rive:renderer-flush:f".concat(_perfFrame), "rive:renderer-flush:start:f".concat(_perfFrame), "rive:renderer-flush:end:f".concat(_perfFrame));
6492
+ }
6388
6493
  this._needsRedraw = false;
6389
6494
  }
6390
6495
  }
@@ -7356,6 +7461,22 @@ var Rive = /** @class */ (function () {
7356
7461
  return Rive;
7357
7462
  }());
7358
7463
 
7464
+ var DataType;
7465
+ (function (DataType) {
7466
+ DataType["none"] = "none";
7467
+ DataType["string"] = "string";
7468
+ DataType["number"] = "number";
7469
+ DataType["boolean"] = "boolean";
7470
+ DataType["color"] = "color";
7471
+ DataType["list"] = "list";
7472
+ DataType["enumType"] = "enumType";
7473
+ DataType["trigger"] = "trigger";
7474
+ DataType["viewModel"] = "viewModel";
7475
+ DataType["integer"] = "integer";
7476
+ DataType["listIndex"] = "listIndex";
7477
+ DataType["image"] = "image";
7478
+ DataType["artboard"] = "artboard";
7479
+ })(DataType || (DataType = {}));
7359
7480
  var ViewModel = /** @class */ (function () {
7360
7481
  function ViewModel(viewModel) {
7361
7482
  this._viewModel = viewModel;
@@ -7834,6 +7955,17 @@ var ViewModelInstance = /** @class */ (function () {
7834
7955
  enumerable: false,
7835
7956
  configurable: true
7836
7957
  });
7958
+ Object.defineProperty(ViewModelInstance.prototype, "viewModelName", {
7959
+ /**
7960
+ * Get the name of the ViewModel definition this instance was created from.
7961
+ */
7962
+ get: function () {
7963
+ var _a, _b;
7964
+ return (_b = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.getViewModelName()) !== null && _b !== void 0 ? _b : "";
7965
+ },
7966
+ enumerable: false,
7967
+ configurable: true
7968
+ });
7837
7969
  ViewModelInstance.prototype.internalIncrementReferenceCount = function () {
7838
7970
  this._referenceCount++;
7839
7971
  };