@rive-app/canvas-advanced-single 2.43.0 → 2.44.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/canvas-advanced-single",
3
- "version": "2.43.0",
3
+ "version": "2.44.0",
4
4
  "description": "Rive's lightweight low-level canvas based web api all in one js file.",
5
5
  "main": "canvas_advanced_single.mjs",
6
6
  "homepage": "https://rive.app",
@@ -1036,6 +1036,30 @@ export declare class StateMachineInstance {
1036
1036
  */
1037
1037
  focusPrevious(): boolean;
1038
1038
 
1039
+ /**
1040
+ * Move focus to the nearest focusable node to the left of the current focus, by on-screen position.
1041
+ * @returns false if nothing is focused or no node lies in that direction
1042
+ */
1043
+ focusLeft(): boolean;
1044
+
1045
+ /**
1046
+ * Move focus to the nearest focusable node to the right of the current focus, by on-screen position.
1047
+ * @returns false if nothing is focused or no node lies in that direction
1048
+ */
1049
+ focusRight(): boolean;
1050
+
1051
+ /**
1052
+ * Move focus to the nearest focusable node above the current focus, by on-screen position.
1053
+ * @returns false if nothing is focused or no node lies in that direction
1054
+ */
1055
+ focusUp(): boolean;
1056
+
1057
+ /**
1058
+ * Move focus to the nearest focusable node below the current focus, by on-screen position.
1059
+ * @returns false if nothing is focused or no node lies in that direction
1060
+ */
1061
+ focusDown(): boolean;
1062
+
1039
1063
  /**
1040
1064
  * Clear focus from the Rive focus tree.
1041
1065
  */
@@ -1048,6 +1072,35 @@ export declare class StateMachineInstance {
1048
1072
  */
1049
1073
  focusState(): FocusState;
1050
1074
 
1075
+ /**
1076
+ * Forward a key press/release to the focus tree via the state machine's focus manager.
1077
+ * The event bubbles from the primary focus node up its ancestors until a handler consumes it.
1078
+ * Modifier keys are sent as keys too; held modifiers also go in the `modifiers` bitmask.
1079
+ * @param key - GLFW-style key code (see js/src/utils/keyMap.ts)
1080
+ * @param modifiers - KeyModifiers bitmask (shift=1, ctrl=2, alt=4, meta=8)
1081
+ * @param isPressed - true for keydown, false for keyup
1082
+ * @param isRepeat - true if this is an auto-repeat keydown
1083
+ * @returns true if a node in the focus chain consumed the event
1084
+ */
1085
+ keyInput(key: number, modifiers: number, isPressed: boolean, isRepeat: boolean): boolean;
1086
+
1087
+ /**
1088
+ * Forward committed text (a printable stroke, IME composition result, or paste) to the focus
1089
+ * tree. This is the only way characters get inserted into a focused text field; `keyInput`
1090
+ * never inserts text. For a printable stroke, hosts typically call both: `keyInput` so
1091
+ * keyboard listeners on that key fire, then `textInput` for the characters.
1092
+ * @param text - the committed text
1093
+ * @returns true if a node in the focus chain consumed the text
1094
+ */
1095
+ textInput(text: string): boolean;
1096
+
1097
+ /**
1098
+ * The selected text of the focused element, or an empty string when nothing with a
1099
+ * selection is focused. Used to fill the clipboard on copy/cut. An obscured field
1100
+ * (i.e. a password) reports empty string.
1101
+ */
1102
+ selectedText(): string;
1103
+
1051
1104
  /**
1052
1105
  * Deletes the underlying instance created via the WASM. It's important to clean up this instance
1053
1106
  * when no longer in use
@@ -1354,6 +1407,7 @@ export enum StrokeJoin {
1354
1407
 
1355
1408
  export enum BlendMode {
1356
1409
  srcOver = 3,
1410
+ additive = 12,
1357
1411
  screen = 14,
1358
1412
  overlay = 15,
1359
1413
  darken = 16,