@rive-app/canvas-advanced 2.37.8 → 2.38.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.
@@ -733,7 +733,7 @@ function Za(a, b) {
733
733
  return Ya(c, a, b);
734
734
  }));
735
735
  }
736
- var $a, ab, eb = {484269:(a, b, c, d, e) => {
736
+ var $a, ab, eb = {485773:(a, b, c, d, e) => {
737
737
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
738
738
  return 0;
739
739
  }
@@ -796,11 +796,11 @@ var $a, ab, eb = {484269:(a, b, c, d, e) => {
796
796
  }
797
797
  window.h.za += 1;
798
798
  return 1;
799
- }, 486447:() => {
799
+ }, 487951:() => {
800
800
  "undefined" !== typeof window.h && (window.h.Sa.map(function(a) {
801
801
  document.removeEventListener(a, window.h.unlock, !0);
802
802
  }), --window.h.za, 0 === window.h.za && delete window.h);
803
- }, 486751:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 486855:() => {
803
+ }, 488255:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 488359:() => {
804
804
  try {
805
805
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
806
806
  a.close();
@@ -808,7 +808,7 @@ var $a, ab, eb = {484269:(a, b, c, d, e) => {
808
808
  } catch (c) {
809
809
  return 0;
810
810
  }
811
- }, 487026:(a, b, c, d, e, f) => {
811
+ }, 488530:(a, b, c, d, e, f) => {
812
812
  if ("undefined" === typeof window.h) {
813
813
  return -1;
814
814
  }
@@ -854,7 +854,7 @@ var $a, ab, eb = {484269:(a, b, c, d, e) => {
854
854
  a == window.h.J.xa && g.Z.connect(g.L.destination);
855
855
  g.pb = f;
856
856
  return window.h.tc(g);
857
- }, 489903:a => window.h.qa(a).L.sampleRate, 489976:a => {
857
+ }, 491407:a => window.h.qa(a).L.sampleRate, 491480:a => {
858
858
  a = window.h.qa(a);
859
859
  void 0 !== a.Z && (a.Z.onaudioprocess = function() {
860
860
  }, a.Z.disconnect(), a.Z = void 0);
@@ -862,13 +862,13 @@ var $a, ab, eb = {484269:(a, b, c, d, e) => {
862
862
  a.L.close();
863
863
  a.L = void 0;
864
864
  a.pb = void 0;
865
- }, 490376:a => {
865
+ }, 491880:a => {
866
866
  window.h.Ab(a);
867
- }, 490426:a => {
867
+ }, 491930:a => {
868
868
  a = window.h.qa(a);
869
869
  a.L.resume();
870
870
  a.state = window.h.ga.wb;
871
- }, 490565:a => {
871
+ }, 492069:a => {
872
872
  a = window.h.qa(a);
873
873
  a.L.suspend();
874
874
  a.state = window.h.ga.stopped;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rive-app/canvas-advanced",
3
- "version": "2.37.8",
3
+ "version": "2.38.0",
4
4
  "description": "Rive's lightweight low-level canvas based web api.",
5
5
  "main": "canvas_advanced.mjs",
6
6
  "homepage": "https://rive.app",
package/rive.wasm CHANGED
Binary file
@@ -755,6 +755,18 @@ export interface RiveEventCustomProperties {
755
755
  [key: string]: number | boolean | string;
756
756
  }
757
757
 
758
+ /**
759
+ * Snapshot of the focus state returned by StateMachineInstance.focusState().
760
+ * Poll this each frame after advanceAndApply() to detect focus changes and
761
+ * determine whether a virtual keyboard should be shown or hidden.
762
+ */
763
+ export interface FocusState {
764
+ /** True if any element currently holds focus in this state machine's active focus manager. */
765
+ hasFocus: boolean;
766
+ /** True if the focused element accepts keyboard input (e.g. a TextInput node). */
767
+ expectsKeyboardInput: boolean;
768
+ }
769
+
758
770
  export declare class LinearAnimation {
759
771
  /**
760
772
  * The animation's loop type
@@ -894,6 +906,18 @@ export declare class StateMachineInstance {
894
906
  */
895
907
  focusPrevious(): boolean;
896
908
 
909
+ /**
910
+ * Clear focus from the Rive focus tree.
911
+ */
912
+ clearFocus(): void;
913
+
914
+ /**
915
+ * Returns metadata about current focus state:
916
+ * 1. Whether any node in the focus tree is currently focused
917
+ * 2. Whether the currently focused node expects keyboard input (i.e. keyboard/text input listener)
918
+ */
919
+ focusState(): FocusState;
920
+
897
921
  /**
898
922
  * Deletes the underlying instance created via the WASM. It's important to clean up this instance
899
923
  * when no longer in use
Binary file