@rive-app/webgl 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/webgl",
3
- "version": "2.35.3",
3
+ "version": "2.36.0",
4
4
  "description": "Rive's webgl 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
@@ -393,7 +393,7 @@ function Ra(a, b) {
393
393
  return Qa(c, a, b);
394
394
  }));
395
395
  }
396
- var Sa, Ta, Xa = {727842:(a, b, c, d, e) => {
396
+ var Sa, Ta, Xa = {728434:(a, b, c, d, e) => {
397
397
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
398
398
  return 0;
399
399
  }
@@ -456,11 +456,11 @@ var Sa, Ta, Xa = {727842:(a, b, c, d, e) => {
456
456
  }
457
457
  window.h.Ca += 1;
458
458
  return 1;
459
- }, 730020:() => {
459
+ }, 730612:() => {
460
460
  "undefined" !== typeof window.h && (window.h.Ra.map(function(a) {
461
461
  document.removeEventListener(a, window.h.unlock, !0);
462
462
  }), --window.h.Ca, 0 === window.h.Ca && delete window.h);
463
- }, 730324:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 730428:() => {
463
+ }, 730916:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 731020:() => {
464
464
  try {
465
465
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
466
466
  a.close();
@@ -468,7 +468,7 @@ var Sa, Ta, Xa = {727842:(a, b, c, d, e) => {
468
468
  } catch (c) {
469
469
  return 0;
470
470
  }
471
- }, 730599:(a, b, c, d, e, f) => {
471
+ }, 731191:(a, b, c, d, e, f) => {
472
472
  if ("undefined" === typeof window.h) {
473
473
  return -1;
474
474
  }
@@ -514,7 +514,7 @@ var Sa, Ta, Xa = {727842:(a, b, c, d, e) => {
514
514
  a == window.h.H.Aa && g.W.connect(g.J.destination);
515
515
  g.kb = f;
516
516
  return window.h.fc(g);
517
- }, 733476:a => window.h.ra(a).J.sampleRate, 733549:a => {
517
+ }, 734068:a => window.h.ra(a).J.sampleRate, 734141:a => {
518
518
  a = window.h.ra(a);
519
519
  void 0 !== a.W && (a.W.onaudioprocess = function() {
520
520
  }, a.W.disconnect(), a.W = void 0);
@@ -522,13 +522,13 @@ var Sa, Ta, Xa = {727842:(a, b, c, d, e) => {
522
522
  a.J.close();
523
523
  a.J = void 0;
524
524
  a.kb = void 0;
525
- }, 733949:a => {
525
+ }, 734541:a => {
526
526
  window.h.ub(a);
527
- }, 733999:a => {
527
+ }, 734591:a => {
528
528
  a = window.h.ra(a);
529
529
  a.J.resume();
530
530
  a.state = window.h.ga.qb;
531
- }, 734138:a => {
531
+ }, 734730:a => {
532
532
  a = window.h.ra(a);
533
533
  a.J.suspend();
534
534
  a.state = window.h.ga.stopped;
@@ -3935,7 +3935,7 @@ moduleRtn = ca;
3935
3935
  /* 2 */
3936
3936
  /***/ ((module) => {
3937
3937
 
3938
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl","version":"2.35.3","description":"Rive\'s webgl 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.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3938
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl","version":"2.36.0","description":"Rive\'s webgl 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.wasm","rive_fallback.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3939
3939
 
3940
3940
  /***/ }),
3941
3941
  /* 3 */
@@ -4750,6 +4750,7 @@ __webpack_require__.r(__webpack_exports__);
4750
4750
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4751
4751
  /* harmony export */ Alignment: () => (/* binding */ Alignment),
4752
4752
  /* harmony export */ DataEnum: () => (/* binding */ DataEnum),
4753
+ /* harmony export */ DataType: () => (/* binding */ DataType),
4753
4754
  /* harmony export */ DrawOptimizationOptions: () => (/* binding */ DrawOptimizationOptions),
4754
4755
  /* harmony export */ EventType: () => (/* binding */ EventType),
4755
4756
  /* harmony export */ Fit: () => (/* binding */ Fit),
@@ -4998,12 +4999,18 @@ var RuntimeLoader = /** @class */ (function () {
4998
4999
  }
4999
5000
  // Loads the runtime
5000
5001
  RuntimeLoader.loadRuntime = function () {
5002
+ if (RuntimeLoader.enablePerfMarks)
5003
+ performance.mark('rive:wasm-init:start');
5001
5004
  _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
5002
5005
  // Loads Wasm bundle
5003
5006
  locateFile: function () { return RuntimeLoader.wasmURL; },
5004
5007
  })
5005
5008
  .then(function (rive) {
5006
5009
  var _a;
5010
+ if (RuntimeLoader.enablePerfMarks) {
5011
+ performance.mark('rive:wasm-init:end');
5012
+ performance.measure('rive:wasm-init', 'rive:wasm-init:start', 'rive:wasm-init:end');
5013
+ }
5007
5014
  RuntimeLoader.runtime = rive;
5008
5015
  // Fire all the callbacks
5009
5016
  while (RuntimeLoader.callBackQueue.length > 0) {
@@ -5086,6 +5093,11 @@ var RuntimeLoader = /** @class */ (function () {
5086
5093
  // Path to the Wasm file; default path works for testing only;
5087
5094
  // if embedded wasm is used then this is never used.
5088
5095
  RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
5096
+ /**
5097
+ * When true, performance.mark / performance.measure entries are emitted for
5098
+ * WASM initialization.
5099
+ */
5100
+ RuntimeLoader.enablePerfMarks = false;
5089
5101
  return RuntimeLoader;
5090
5102
  }());
5091
5103
 
@@ -6023,6 +6035,8 @@ var RiveFile = /** @class */ (function () {
6023
6035
  function RiveFile(params) {
6024
6036
  // Allow the runtime to automatically load assets hosted in Rive's runtime.
6025
6037
  this.enableRiveAssetCDN = true;
6038
+ // When true, emits performance.mark/measure entries during RiveFile load.
6039
+ this.enablePerfMarks = false;
6026
6040
  this.referenceCount = 0;
6027
6041
  this.destroyed = false;
6028
6042
  this.selfUnref = false;
@@ -6035,6 +6049,9 @@ var RiveFile = /** @class */ (function () {
6035
6049
  typeof params.enableRiveAssetCDN == "boolean"
6036
6050
  ? params.enableRiveAssetCDN
6037
6051
  : true;
6052
+ this.enablePerfMarks = !!params.enablePerfMarks;
6053
+ if (this.enablePerfMarks)
6054
+ RuntimeLoader.enablePerfMarks = true;
6038
6055
  // New event management system
6039
6056
  this.eventManager = new EventManager();
6040
6057
  if (params.onLoad)
@@ -6060,7 +6077,7 @@ var RiveFile = /** @class */ (function () {
6060
6077
  return __generator(this, function (_c) {
6061
6078
  switch (_c.label) {
6062
6079
  case 0:
6063
- if (!this.src) return [3 /*break*/, 2];
6080
+ if (!(this.src && !this.buffer)) return [3 /*break*/, 2];
6064
6081
  _a = this;
6065
6082
  return [4 /*yield*/, loadRiveFile(this.src)];
6066
6083
  case 1:
@@ -6075,11 +6092,16 @@ var RiveFile = /** @class */ (function () {
6075
6092
  loader = loaderWrapper.assetLoader;
6076
6093
  }
6077
6094
  // Load the Rive file
6095
+ if (this.enablePerfMarks)
6096
+ performance.mark('rive:file-load:start');
6078
6097
  _b = this;
6079
6098
  return [4 /*yield*/, this.runtime.load(new Uint8Array(this.buffer), loader, this.enableRiveAssetCDN)];
6080
6099
  case 3:
6081
- // Load the Rive file
6082
6100
  _b.file = _c.sent();
6101
+ if (this.enablePerfMarks) {
6102
+ performance.mark('rive:file-load:end');
6103
+ performance.measure('rive:file-load', 'rive:file-load:start', 'rive:file-load:end');
6104
+ }
6083
6105
  fileFinalizer = new _utils__WEBPACK_IMPORTED_MODULE_3__.FileFinalizer(this.file);
6084
6106
  _utils__WEBPACK_IMPORTED_MODULE_3__.finalizationRegistry.register(this, fileFinalizer);
6085
6107
  if (this.destroyed) {
@@ -6100,9 +6122,45 @@ var RiveFile = /** @class */ (function () {
6100
6122
  });
6101
6123
  });
6102
6124
  };
6125
+ RiveFile.prototype.loadRiveFileBytes = function () {
6126
+ return __awaiter(this, void 0, void 0, function () {
6127
+ var bufferPromise;
6128
+ return __generator(this, function (_a) {
6129
+ if (this.enablePerfMarks)
6130
+ performance.mark('rive:fetch-riv:start');
6131
+ bufferPromise = this.src
6132
+ ? loadRiveFile(this.src)
6133
+ : Promise.resolve(this.buffer);
6134
+ if (this.enablePerfMarks && this.src) {
6135
+ bufferPromise.then(function () {
6136
+ performance.mark('rive:fetch-riv:end');
6137
+ performance.measure('rive:fetch-riv', 'rive:fetch-riv:start', 'rive:fetch-riv:end');
6138
+ });
6139
+ }
6140
+ return [2 /*return*/, bufferPromise];
6141
+ });
6142
+ });
6143
+ };
6144
+ RiveFile.prototype.loadRuntime = function () {
6145
+ return __awaiter(this, void 0, void 0, function () {
6146
+ var runtimePromise;
6147
+ return __generator(this, function (_a) {
6148
+ if (this.enablePerfMarks)
6149
+ performance.mark('rive:await-wasm:start');
6150
+ runtimePromise = RuntimeLoader.awaitInstance();
6151
+ if (this.enablePerfMarks) {
6152
+ runtimePromise.then(function () {
6153
+ performance.mark('rive:await-wasm:end');
6154
+ performance.measure('rive:await-wasm', 'rive:await-wasm:start', 'rive:await-wasm:end');
6155
+ });
6156
+ }
6157
+ return [2 /*return*/, runtimePromise];
6158
+ });
6159
+ });
6160
+ };
6103
6161
  RiveFile.prototype.init = function () {
6104
6162
  return __awaiter(this, void 0, void 0, function () {
6105
- var _a, error_1;
6163
+ var _a, bufferResolved, runtimeResolved, error_1;
6106
6164
  return __generator(this, function (_b) {
6107
6165
  switch (_b.label) {
6108
6166
  case 0:
@@ -6114,16 +6172,24 @@ var RiveFile = /** @class */ (function () {
6114
6172
  _b.label = 1;
6115
6173
  case 1:
6116
6174
  _b.trys.push([1, 4, , 5]);
6117
- _a = this;
6118
- return [4 /*yield*/, RuntimeLoader.awaitInstance()];
6175
+ return [4 /*yield*/, Promise.all([this.loadRiveFileBytes(), this.loadRuntime()])];
6119
6176
  case 2:
6120
- _a.runtime = _b.sent();
6177
+ _a = _b.sent(), bufferResolved = _a[0], runtimeResolved = _a[1];
6121
6178
  if (this.destroyed) {
6122
6179
  return [2 /*return*/];
6123
6180
  }
6181
+ // .riv file buffer and WASM runtime instance
6182
+ this.buffer = bufferResolved;
6183
+ this.runtime = runtimeResolved;
6184
+ if (this.enablePerfMarks)
6185
+ performance.mark('rive:init-data:start');
6124
6186
  return [4 /*yield*/, this.initData()];
6125
6187
  case 3:
6126
6188
  _b.sent();
6189
+ if (this.enablePerfMarks) {
6190
+ performance.mark('rive:init-data:end');
6191
+ performance.measure('rive:init-data', 'rive:init-data:start', 'rive:init-data:end');
6192
+ }
6127
6193
  return [3 /*break*/, 5];
6128
6194
  case 4:
6129
6195
  error_1 = _b.sent();
@@ -6291,6 +6357,8 @@ var Rive = /** @class */ (function () {
6291
6357
  this._viewModelInstance = null;
6292
6358
  this._dataEnums = null;
6293
6359
  this.drawOptimization = DrawOptimizationOptions.DrawOnChanged;
6360
+ // When true, emits performance.mark/measure entries for load and render.
6361
+ this.enablePerfMarks = false;
6294
6362
  // Durations to generate a frame for the last second. Used for performance profiling.
6295
6363
  this.durations = [];
6296
6364
  this.frameTimes = [];
@@ -6337,6 +6405,9 @@ var Rive = /** @class */ (function () {
6337
6405
  params.enableRiveAssetCDN === undefined
6338
6406
  ? true
6339
6407
  : params.enableRiveAssetCDN;
6408
+ this.enablePerfMarks = !!params.enablePerfMarks;
6409
+ if (this.enablePerfMarks)
6410
+ RuntimeLoader.enablePerfMarks = true;
6340
6411
  // New event management system
6341
6412
  this.eventManager = new EventManager();
6342
6413
  if (params.onLoad)
@@ -6438,7 +6509,13 @@ var Rive = /** @class */ (function () {
6438
6509
  _this.removeRiveListeners();
6439
6510
  _this.deleteRiveRenderer();
6440
6511
  // Get the canvas where you want to render the animation and create a renderer
6512
+ if (_this.enablePerfMarks)
6513
+ performance.mark('rive:make-renderer:start');
6441
6514
  _this.renderer = _this.runtime.makeRenderer(_this.canvas, useOffscreenRenderer);
6515
+ if (_this.enablePerfMarks) {
6516
+ performance.mark('rive:make-renderer:end');
6517
+ performance.measure('rive:make-renderer', 'rive:make-renderer:start', 'rive:make-renderer:end');
6518
+ }
6442
6519
  // Initial size adjustment based on devicePixelRatio if no width/height are
6443
6520
  // specified explicitly
6444
6521
  if (!(_this.canvas.width || _this.canvas.height)) {
@@ -6550,6 +6627,7 @@ var Rive = /** @class */ (function () {
6550
6627
  buffer: this.buffer,
6551
6628
  enableRiveAssetCDN: this.enableRiveAssetCDN,
6552
6629
  assetLoader: this.assetLoader,
6630
+ enablePerfMarks: this.enablePerfMarks,
6553
6631
  });
6554
6632
  this.riveFile = riveFile;
6555
6633
  return [4 /*yield*/, riveFile.init()];
@@ -6716,6 +6794,9 @@ var Rive = /** @class */ (function () {
6716
6794
  // - Advance non-paused state machines by the elapsed number of seconds
6717
6795
  // - Advance to the first frame even when autoplay is false
6718
6796
  var activeStateMachines = this.animator.stateMachines.filter(function (a) { return a.playing; });
6797
+ // Instrument the first 3 frames so the Performance timeline shows precise
6798
+ // per-call latency for advance, draw, and flush without polluting the trace.
6799
+ var _perfFrame = this.enablePerfMarks && this.frameCount < 3 ? this.frameCount : -1;
6719
6800
  for (var _b = 0, activeStateMachines_1 = activeStateMachines; _b < activeStateMachines_1.length; _b++) {
6720
6801
  var stateMachine = activeStateMachines_1[_b];
6721
6802
  // Check for events before the current frame's state machine advance
@@ -6750,7 +6831,13 @@ var Rive = /** @class */ (function () {
6750
6831
  }
6751
6832
  }
6752
6833
  }
6834
+ if (_perfFrame >= 0)
6835
+ performance.mark("rive:sm-advance:start:f".concat(_perfFrame));
6753
6836
  stateMachine.advanceAndApply(elapsedTime);
6837
+ if (_perfFrame >= 0) {
6838
+ performance.mark("rive:sm-advance:end:f".concat(_perfFrame));
6839
+ performance.measure("rive:sm-advance:f".concat(_perfFrame), "rive:sm-advance:start:f".concat(_perfFrame), "rive:sm-advance:end:f".concat(_perfFrame));
6840
+ }
6754
6841
  // stateMachine.instance.apply(this.artboard);
6755
6842
  }
6756
6843
  // Once the animations have been applied to the artboard, advance it
@@ -6770,10 +6857,28 @@ var Rive = /** @class */ (function () {
6770
6857
  renderer.clear();
6771
6858
  renderer.save();
6772
6859
  // Update the renderer alignment if necessary
6860
+ if (_perfFrame >= 0)
6861
+ performance.mark("rive:align-renderer:start:f".concat(_perfFrame));
6773
6862
  this.alignRenderer();
6863
+ if (_perfFrame >= 0) {
6864
+ performance.mark("rive:align-renderer:end:f".concat(_perfFrame));
6865
+ performance.measure("rive:align-renderer:f".concat(_perfFrame), "rive:align-renderer:start:f".concat(_perfFrame), "rive:align-renderer:end:f".concat(_perfFrame));
6866
+ }
6867
+ if (_perfFrame >= 0)
6868
+ performance.mark("rive:artboard-draw:start:f".concat(_perfFrame));
6774
6869
  this.artboard.draw(renderer);
6870
+ if (_perfFrame >= 0) {
6871
+ performance.mark("rive:artboard-draw:end:f".concat(_perfFrame));
6872
+ performance.measure("rive:artboard-draw:f".concat(_perfFrame), "rive:artboard-draw:start:f".concat(_perfFrame), "rive:artboard-draw:end:f".concat(_perfFrame));
6873
+ }
6775
6874
  renderer.restore();
6875
+ if (_perfFrame >= 0)
6876
+ performance.mark("rive:renderer-flush:start:f".concat(_perfFrame));
6776
6877
  renderer.flush();
6878
+ if (_perfFrame >= 0) {
6879
+ performance.mark("rive:renderer-flush:end:f".concat(_perfFrame));
6880
+ performance.measure("rive:renderer-flush:f".concat(_perfFrame), "rive:renderer-flush:start:f".concat(_perfFrame), "rive:renderer-flush:end:f".concat(_perfFrame));
6881
+ }
6777
6882
  this._needsRedraw = false;
6778
6883
  }
6779
6884
  }
@@ -7745,6 +7850,22 @@ var Rive = /** @class */ (function () {
7745
7850
  return Rive;
7746
7851
  }());
7747
7852
 
7853
+ var DataType;
7854
+ (function (DataType) {
7855
+ DataType["none"] = "none";
7856
+ DataType["string"] = "string";
7857
+ DataType["number"] = "number";
7858
+ DataType["boolean"] = "boolean";
7859
+ DataType["color"] = "color";
7860
+ DataType["list"] = "list";
7861
+ DataType["enumType"] = "enumType";
7862
+ DataType["trigger"] = "trigger";
7863
+ DataType["viewModel"] = "viewModel";
7864
+ DataType["integer"] = "integer";
7865
+ DataType["listIndex"] = "listIndex";
7866
+ DataType["image"] = "image";
7867
+ DataType["artboard"] = "artboard";
7868
+ })(DataType || (DataType = {}));
7748
7869
  var ViewModel = /** @class */ (function () {
7749
7870
  function ViewModel(viewModel) {
7750
7871
  this._viewModel = viewModel;
@@ -8223,6 +8344,17 @@ var ViewModelInstance = /** @class */ (function () {
8223
8344
  enumerable: false,
8224
8345
  configurable: true
8225
8346
  });
8347
+ Object.defineProperty(ViewModelInstance.prototype, "viewModelName", {
8348
+ /**
8349
+ * Get the name of the ViewModel definition this instance was created from.
8350
+ */
8351
+ get: function () {
8352
+ var _a, _b;
8353
+ return (_b = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.getViewModelName()) !== null && _b !== void 0 ? _b : "";
8354
+ },
8355
+ enumerable: false,
8356
+ configurable: true
8357
+ });
8226
8358
  ViewModelInstance.prototype.internalIncrementReferenceCount = function () {
8227
8359
  this._referenceCount++;
8228
8360
  };