@rive-app/webgl2-advanced 2.38.5 → 2.39.1

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-advanced",
3
- "version": "2.38.5",
3
+ "version": "2.39.1",
4
4
  "description": "Rive's webgl2 low-level canvas based web api.",
5
5
  "main": "webgl2_advanced.mjs",
6
6
  "homepage": "https://rive.app",
package/rive.wasm CHANGED
Binary file
@@ -391,6 +391,12 @@ export declare class File {
391
391
  */
392
392
  enums(): DataEnum[];
393
393
 
394
+ /**
395
+ * Returns the names of the file's global view models, in file order.
396
+ * @returns array of global view model names
397
+ */
398
+ globalViewModelNames(): string[];
399
+
394
400
  unref(): void;
395
401
 
396
402
  /**
@@ -593,6 +599,27 @@ export declare class Artboard {
593
599
  * @param instance - Renderer context to draw with
594
600
  */
595
601
  bindViewModelInstance(instance: ViewModelInstance): void;
602
+ /**
603
+ * Sets the main view model instance without rebinding. Call bind() to apply.
604
+ */
605
+ setViewModelInstance(instance: ViewModelInstance): void;
606
+ /**
607
+ * Applies the current data context (rebinds data binds). No-op if nothing set.
608
+ */
609
+ bind(): void;
610
+ /**
611
+ * Sets/replaces the global view model instance bound under the given global
612
+ * view model name without rebinding, preserving the main instance and the
613
+ * other globals' order. Call bind() to apply.
614
+ * @returns false if the name does not match a global view model in the file.
615
+ */
616
+ setGlobalViewModelInstance(name: string, instance: ViewModelInstance): boolean;
617
+ /**
618
+ * @returns the global view model instance currently bound under the given
619
+ * name (the runtime-seeded default or a previously set instance), or null if
620
+ * the name does not match a global view model in the file.
621
+ */
622
+ globalViewModelInstance(name: string): ViewModelInstance | null;
596
623
 
597
624
  didChange(): boolean;
598
625
  }
@@ -940,6 +967,105 @@ export declare class StateMachineInstance {
940
967
  * @param instance - Renderer context to draw with
941
968
  */
942
969
  bindViewModelInstance(instance: ViewModelInstance): void;
970
+ /**
971
+ * Sets the main view model instance without rebinding. Call bind() to apply.
972
+ */
973
+ setViewModelInstance(instance: ViewModelInstance): void;
974
+ /**
975
+ * Applies the current data context (rebinds data binds). No-op if nothing set.
976
+ */
977
+ bind(): void;
978
+ /**
979
+ * Sets/replaces the global view model instance bound under the given global
980
+ * view model name without rebinding, preserving the main instance and the
981
+ * other globals' order. Call bind() to apply.
982
+ * @returns false if the name does not match a global view model in the file.
983
+ */
984
+ setGlobalViewModelInstance(name: string, instance: ViewModelInstance): boolean;
985
+ /**
986
+ * @returns the global view model instance currently bound under the given
987
+ * name (the runtime-seeded default or a previously set instance), or null if
988
+ * the name does not match a global view model in the file.
989
+ */
990
+ globalViewModelInstance(name: string): ViewModelInstance | null;
991
+
992
+ /**
993
+ * Enables semantic tree tracking for this state machine instance.
994
+ * Once enabled, the runtime builds and maintains a semantic tree that
995
+ * describes the accessible structure of the artboard (roles, labels,
996
+ * states, bounds). Call this before using drainSemanticsDiff().
997
+ */
998
+ enableSemantics(): void;
999
+
1000
+ /**
1001
+ * Returns the incremental semantic diff since the last call, or null if
1002
+ * nothing changed. Each diff contains arrays of added/removed/moved nodes,
1003
+ * updated semantic properties, updated geometry, and children reorderings.
1004
+ */
1005
+ drainSemanticsDiff(): SemanticsDiff | null;
1006
+
1007
+ /**
1008
+ * Fire a semantic action on the node with the given ID.
1009
+ * @param nodeId - The semantic node ID to target
1010
+ * @param actionType - 0 = tap, 1 = increase, 2 = decrease
1011
+ */
1012
+ fireSemanticAction(nodeId: number, actionType: number): void;
1013
+
1014
+ /**
1015
+ * Request focus on the semantic node with the given ID.
1016
+ * Routes through SemanticManager to focus the FocusData sibling of the
1017
+ * SemanticData that owns the node. Returns true if focus was set.
1018
+ * @param nodeId - The semantic node ID to focus
1019
+ * @returns boolean - True if focus was set, false otherwise
1020
+ */
1021
+ focusSemanticNode(nodeId: number): boolean;
1022
+
1023
+ /**
1024
+ * Clears focus from the currently focused node in the focus tree.
1025
+ */
1026
+ clearFocus(): void;
1027
+ }
1028
+
1029
+ export interface SemanticsDiffNode {
1030
+ id: number;
1031
+ role: number;
1032
+ label: string;
1033
+ value: string;
1034
+ hint: string;
1035
+ stateFlags: number;
1036
+ traitFlags: number;
1037
+ headingLevel: number;
1038
+ minX: number;
1039
+ minY: number;
1040
+ maxX: number;
1041
+ maxY: number;
1042
+ parentId: number;
1043
+ siblingIndex: number;
1044
+ }
1045
+
1046
+ export interface SemanticsBoundsUpdate {
1047
+ id: number;
1048
+ minX: number;
1049
+ minY: number;
1050
+ maxX: number;
1051
+ maxY: number;
1052
+ }
1053
+
1054
+ export interface SemanticsChildrenUpdate {
1055
+ parentId: number;
1056
+ childIds: number[];
1057
+ }
1058
+
1059
+ export interface SemanticsDiff {
1060
+ frameNumber: number;
1061
+ treeVersion: number;
1062
+ rootId: number;
1063
+ removed: number[];
1064
+ added: SemanticsDiffNode[];
1065
+ moved: SemanticsDiffNode[];
1066
+ childrenUpdated: SemanticsChildrenUpdate[];
1067
+ updatedSemantic: SemanticsDiffNode[];
1068
+ updatedGeometry: SemanticsBoundsUpdate[];
943
1069
  }
944
1070
 
945
1071
  export declare class SMIInput {
@@ -973,6 +1099,7 @@ export declare class SMIInput {
973
1099
  export declare type ViewModelProperty = {
974
1100
  name: string;
975
1101
  type: DataType;
1102
+ enumName?: string;
976
1103
  };
977
1104
 
978
1105
  export declare class ViewModelInstanceValue {
@@ -1028,6 +1155,9 @@ export declare class ViewModelInstanceList extends ViewModelInstanceValue {
1028
1155
  export declare class ViewModelInstanceAssetImage extends ViewModelInstanceValue {
1029
1156
  value(image: ImageInternal | null): void;
1030
1157
  }
1158
+ export declare class ViewModelInstanceAssetFont extends ViewModelInstanceValue {
1159
+ value(font: FontInternal | null): void;
1160
+ }
1031
1161
  export declare class ViewModelInstanceArtboard extends ViewModelInstanceValue {
1032
1162
  value(artboard: BindableArtboard | Artboard): void;
1033
1163
  viewModelInstance(viewModelInstance: ViewModelInstance): void;
@@ -1044,6 +1174,7 @@ export declare class ViewModelInstance {
1044
1174
  list(path: string): ViewModelInstanceList;
1045
1175
  viewModel(path: string): ViewModelInstance;
1046
1176
  image(path: string): ViewModelInstanceAssetImage;
1177
+ font(path: string): ViewModelInstanceAssetFont;
1047
1178
  artboard(path: string): ViewModelInstanceArtboard;
1048
1179
  replaceViewModel(path: string, value: ViewModelInstance): boolean;
1049
1180
  incrementReferenceCount(): void;
@@ -426,7 +426,7 @@ function Ma(a, b) {
426
426
  return La(c, a, b);
427
427
  }));
428
428
  }
429
- var Na, Oa, Sa = {571903:(a, b, c, d, e) => {
429
+ var Na, Oa, Sa = {573663:(a, b, c, d, e) => {
430
430
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
431
431
  return 0;
432
432
  }
@@ -489,11 +489,11 @@ var Na, Oa, Sa = {571903:(a, b, c, d, e) => {
489
489
  }
490
490
  window.miniaudio.referenceCount += 1;
491
491
  return 1;
492
- }, 574081:() => {
492
+ }, 575841:() => {
493
493
  "undefined" !== typeof window.miniaudio && (window.miniaudio.unlock_event_types.map(function(a) {
494
494
  document.removeEventListener(a, window.miniaudio.unlock, !0);
495
495
  }), --window.miniaudio.referenceCount, 0 === window.miniaudio.referenceCount && delete window.miniaudio);
496
- }, 574385:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 574489:() => {
496
+ }, 576145:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 576249:() => {
497
497
  try {
498
498
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
499
499
  a.close();
@@ -501,7 +501,7 @@ var Na, Oa, Sa = {571903:(a, b, c, d, e) => {
501
501
  } catch (c) {
502
502
  return 0;
503
503
  }
504
- }, 574660:(a, b, c, d, e, f) => {
504
+ }, 576420:(a, b, c, d, e, f) => {
505
505
  if ("undefined" === typeof window.miniaudio) {
506
506
  return -1;
507
507
  }
@@ -547,7 +547,7 @@ var Na, Oa, Sa = {571903:(a, b, c, d, e) => {
547
547
  a == window.miniaudio.device_type.playback && g.V.connect(g.H.destination);
548
548
  g.gb = f;
549
549
  return window.miniaudio.track_device(g);
550
- }, 577537:a => window.miniaudio.get_device_by_index(a).H.sampleRate, 577610:a => {
550
+ }, 579297:a => window.miniaudio.get_device_by_index(a).H.sampleRate, 579370:a => {
551
551
  a = window.miniaudio.get_device_by_index(a);
552
552
  void 0 !== a.V && (a.V.onaudioprocess = function() {
553
553
  }, a.V.disconnect(), a.V = void 0);
@@ -555,13 +555,13 @@ var Na, Oa, Sa = {571903:(a, b, c, d, e) => {
555
555
  a.H.close();
556
556
  a.H = void 0;
557
557
  a.gb = void 0;
558
- }, 578010:a => {
558
+ }, 579770:a => {
559
559
  window.miniaudio.untrack_device_by_index(a);
560
- }, 578060:a => {
560
+ }, 579820:a => {
561
561
  a = window.miniaudio.get_device_by_index(a);
562
562
  a.H.resume();
563
563
  a.state = window.miniaudio.device_state.started;
564
- }, 578199:a => {
564
+ }, 579959:a => {
565
565
  a = window.miniaudio.get_device_by_index(a);
566
566
  a.H.suspend();
567
567
  a.state = window.miniaudio.device_state.stopped;
@@ -3244,8 +3244,6 @@ var de = {__syscall_fcntl64:function(a, b, c) {
3244
3244
  c[d] = F[b + 4 * d >> 2];
3245
3245
  }
3246
3246
  W.drawBuffers(c);
3247
- }, glDrawElements:(a, b, c, d) => {
3248
- W.drawElements(a, b, c, d);
3249
3247
  }, glDrawElementsInstanced:(a, b, c, d, e) => {
3250
3248
  W.drawElementsInstanced(a, b, c, d, e);
3251
3249
  }, glEnable:a => W.enable(a), glEnableVertexAttribArray:a => {