@momoyu-ink/kit 0.2.0 → 0.4.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.
Files changed (178) hide show
  1. package/dist/bindings/AnimationFormat.js +0 -1
  2. package/dist/bindings/AnimationFrameCallbackEvent.js +0 -1
  3. package/dist/bindings/AnimationProps.js +0 -1
  4. package/dist/bindings/AudioCommand.d.ts +1 -0
  5. package/dist/bindings/AudioCommand.js +0 -1
  6. package/dist/bindings/AudioSettings.js +0 -1
  7. package/dist/bindings/BackdropProps.js +0 -1
  8. package/dist/bindings/BeforeUnloadEvent.d.ts +1 -1
  9. package/dist/bindings/BeforeUnloadEvent.js +0 -1
  10. package/dist/bindings/ClipProps.js +0 -1
  11. package/dist/bindings/CustomEvent.js +0 -1
  12. package/dist/bindings/EffectParams.js +0 -1
  13. package/dist/bindings/FilterKind.js +0 -1
  14. package/dist/bindings/FilterProps.js +0 -1
  15. package/dist/bindings/FocusEvent.js +0 -1
  16. package/dist/bindings/FocusEventKind.js +0 -1
  17. package/dist/bindings/FullScreenEvent.js +0 -1
  18. package/dist/bindings/FullscreenEventKind.js +0 -1
  19. package/dist/bindings/GameEvent.js +0 -1
  20. package/dist/bindings/Gamepad.js +0 -1
  21. package/dist/bindings/GamepadButton.js +0 -1
  22. package/dist/bindings/GamepadCommand.js +0 -1
  23. package/dist/bindings/GamepadEvent.js +0 -1
  24. package/dist/bindings/GamepadHapticActuator.js +0 -1
  25. package/dist/bindings/KeyboardEventKind.js +0 -1
  26. package/dist/bindings/KeyboardLocation.js +0 -1
  27. package/dist/bindings/Literal.d.ts +1 -1
  28. package/dist/bindings/Literal.js +0 -1
  29. package/dist/bindings/MouseEventKind.js +0 -1
  30. package/dist/bindings/MoyuCursor.js +0 -1
  31. package/dist/bindings/NineSliceMode.js +0 -1
  32. package/dist/bindings/NodeEvent.js +0 -1
  33. package/dist/bindings/NodeProps.js +0 -1
  34. package/dist/bindings/RawKeyboardEvent.js +0 -1
  35. package/dist/bindings/RawMouseEvent.js +0 -1
  36. package/dist/bindings/RawTouchEvent.js +0 -1
  37. package/dist/bindings/RawWheelEvent.d.ts +1 -0
  38. package/dist/bindings/RawWheelEvent.js +0 -1
  39. package/dist/bindings/ResizeEvent.js +0 -1
  40. package/dist/bindings/ResolvedArgument.js +0 -1
  41. package/dist/bindings/ResolvedCommandLine.js +0 -1
  42. package/dist/bindings/ResolvedSystemCallLine.js +0 -1
  43. package/dist/bindings/ScenarioCommand.d.ts +15 -2
  44. package/dist/bindings/ScenarioCommand.js +0 -1
  45. package/dist/bindings/ScenarioEvent.js +0 -1
  46. package/dist/bindings/SpriteMode.js +0 -1
  47. package/dist/bindings/SpriteProps.js +0 -1
  48. package/dist/bindings/SystemCommand.d.ts +2 -0
  49. package/dist/bindings/SystemCommand.js +0 -1
  50. package/dist/bindings/TextCommand.js +0 -1
  51. package/dist/bindings/TextEvent.js +0 -1
  52. package/dist/bindings/TextLine.js +0 -1
  53. package/dist/bindings/TextPrintMode.js +0 -1
  54. package/dist/bindings/TextProps.js +0 -1
  55. package/dist/bindings/TouchEventKind.js +0 -1
  56. package/dist/bindings/VideoCommand.d.ts +21 -0
  57. package/dist/bindings/VideoCommand.js +3 -0
  58. package/dist/bindings/VideoEvent.d.ts +1 -0
  59. package/dist/bindings/VideoEvent.js +3 -0
  60. package/dist/bindings/VideoProps.d.ts +7 -0
  61. package/dist/bindings/VideoProps.js +3 -0
  62. package/dist/bindings/WheelEventDeltaMode.js +0 -1
  63. package/dist/bindings/WindowState.js +0 -1
  64. package/dist/bindings/serde_json/JsonValue.d.ts +1 -1
  65. package/dist/bindings/serde_json/JsonValue.js +0 -1
  66. package/dist/commands.js +0 -1
  67. package/dist/components/navigation.js +0 -1
  68. package/dist/declaration.d.ts +6 -0
  69. package/dist/declaration.js +0 -1
  70. package/dist/events/base.js +0 -1
  71. package/dist/events/globals.js +2 -3
  72. package/dist/events/keyboard.js +0 -1
  73. package/dist/events/listener.js +0 -1
  74. package/dist/events/mouse.js +0 -1
  75. package/dist/events/touch.js +0 -1
  76. package/dist/events/wheel.d.ts +9 -0
  77. package/dist/events/wheel.js +2 -0
  78. package/dist/events.d.ts +1 -0
  79. package/dist/events.js +1 -1
  80. package/dist/hooks/useFadeInOut.js +0 -1
  81. package/dist/hooks/useScenario.js +0 -1
  82. package/dist/hooks/useSoundEffect.js +0 -1
  83. package/dist/hooks/useStage.d.ts +45 -4
  84. package/dist/hooks/useStage.js +335 -38
  85. package/dist/hooks.js +0 -1
  86. package/dist/lib.d.ts +1 -0
  87. package/dist/lib.js +1 -1
  88. package/dist/moyu.d.ts +1 -0
  89. package/dist/moyu.js +0 -1
  90. package/dist/node.js +0 -1
  91. package/dist/react.js +0 -1
  92. package/dist/runtime-globals.d.ts +2 -0
  93. package/dist/runtime-globals.js +0 -1
  94. package/dist/sandbox.d.ts +1 -0
  95. package/dist/sandbox.js +88 -0
  96. package/dist/spring/animated.js +0 -1
  97. package/dist/spring/index.js +0 -1
  98. package/dist/spring/primitives.js +10 -2
  99. package/dist/state.js +0 -1
  100. package/dist/utils.js +0 -1
  101. package/package.json +5 -3
  102. package/dist/bindings/AnimationFormat.js.map +0 -1
  103. package/dist/bindings/AnimationFrameCallbackEvent.js.map +0 -1
  104. package/dist/bindings/AnimationProps.js.map +0 -1
  105. package/dist/bindings/AudioCommand.js.map +0 -1
  106. package/dist/bindings/AudioSettings.js.map +0 -1
  107. package/dist/bindings/BackdropProps.js.map +0 -1
  108. package/dist/bindings/BeforeUnloadEvent.js.map +0 -1
  109. package/dist/bindings/ClipProps.js.map +0 -1
  110. package/dist/bindings/CustomEvent.js.map +0 -1
  111. package/dist/bindings/EffectParams.js.map +0 -1
  112. package/dist/bindings/FilterKind.js.map +0 -1
  113. package/dist/bindings/FilterProps.js.map +0 -1
  114. package/dist/bindings/FocusEvent.js.map +0 -1
  115. package/dist/bindings/FocusEventKind.js.map +0 -1
  116. package/dist/bindings/FullScreenEvent.js.map +0 -1
  117. package/dist/bindings/FullscreenEventKind.js.map +0 -1
  118. package/dist/bindings/GameEvent.js.map +0 -1
  119. package/dist/bindings/Gamepad.js.map +0 -1
  120. package/dist/bindings/GamepadButton.js.map +0 -1
  121. package/dist/bindings/GamepadCommand.js.map +0 -1
  122. package/dist/bindings/GamepadEvent.js.map +0 -1
  123. package/dist/bindings/GamepadHapticActuator.js.map +0 -1
  124. package/dist/bindings/KeyboardEventKind.js.map +0 -1
  125. package/dist/bindings/KeyboardLocation.js.map +0 -1
  126. package/dist/bindings/Literal.js.map +0 -1
  127. package/dist/bindings/MouseEventKind.js.map +0 -1
  128. package/dist/bindings/MoyuCursor.js.map +0 -1
  129. package/dist/bindings/NineSliceMode.js.map +0 -1
  130. package/dist/bindings/NodeEvent.js.map +0 -1
  131. package/dist/bindings/NodeProps.js.map +0 -1
  132. package/dist/bindings/RawKeyboardEvent.js.map +0 -1
  133. package/dist/bindings/RawMouseEvent.js.map +0 -1
  134. package/dist/bindings/RawTouchEvent.js.map +0 -1
  135. package/dist/bindings/RawWheelEvent.js.map +0 -1
  136. package/dist/bindings/ResizeEvent.js.map +0 -1
  137. package/dist/bindings/ResolvedArgument.js.map +0 -1
  138. package/dist/bindings/ResolvedCommandLine.js.map +0 -1
  139. package/dist/bindings/ResolvedSystemCallLine.js.map +0 -1
  140. package/dist/bindings/ScenarioCommand.js.map +0 -1
  141. package/dist/bindings/ScenarioEvent.js.map +0 -1
  142. package/dist/bindings/SpriteMode.js.map +0 -1
  143. package/dist/bindings/SpriteProps.js.map +0 -1
  144. package/dist/bindings/SystemCommand.js.map +0 -1
  145. package/dist/bindings/TextCommand.js.map +0 -1
  146. package/dist/bindings/TextEvent.js.map +0 -1
  147. package/dist/bindings/TextLine.js.map +0 -1
  148. package/dist/bindings/TextPrintMode.js.map +0 -1
  149. package/dist/bindings/TextProps.js.map +0 -1
  150. package/dist/bindings/TouchEventKind.js.map +0 -1
  151. package/dist/bindings/WheelEventDeltaMode.js.map +0 -1
  152. package/dist/bindings/WindowState.js.map +0 -1
  153. package/dist/bindings/serde_json/JsonValue.js.map +0 -1
  154. package/dist/commands.js.map +0 -1
  155. package/dist/components/navigation.js.map +0 -1
  156. package/dist/declaration.js.map +0 -1
  157. package/dist/events/base.js.map +0 -1
  158. package/dist/events/globals.js.map +0 -1
  159. package/dist/events/keyboard.js.map +0 -1
  160. package/dist/events/listener.js.map +0 -1
  161. package/dist/events/mouse.js.map +0 -1
  162. package/dist/events/touch.js.map +0 -1
  163. package/dist/events.js.map +0 -1
  164. package/dist/hooks/useFadeInOut.js.map +0 -1
  165. package/dist/hooks/useScenario.js.map +0 -1
  166. package/dist/hooks/useSoundEffect.js.map +0 -1
  167. package/dist/hooks/useStage.js.map +0 -1
  168. package/dist/hooks.js.map +0 -1
  169. package/dist/lib.js.map +0 -1
  170. package/dist/moyu.js.map +0 -1
  171. package/dist/node.js.map +0 -1
  172. package/dist/react.js.map +0 -1
  173. package/dist/runtime-globals.js.map +0 -1
  174. package/dist/spring/animated.js.map +0 -1
  175. package/dist/spring/index.js.map +0 -1
  176. package/dist/spring/primitives.js.map +0 -1
  177. package/dist/state.js.map +0 -1
  178. package/dist/utils.js.map +0 -1
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=AnimationFormat.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=AnimationFrameCallbackEvent.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AnimationProps.js.map
@@ -12,6 +12,7 @@ export type AudioCommand = {
12
12
  subCommand: 'play';
13
13
  name: string;
14
14
  fadeTime?: number;
15
+ waitForEnd?: boolean;
15
16
  } | {
16
17
  subCommand: 'stop';
17
18
  name: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=AudioCommand.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=AudioSettings.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=BackdropProps.js.map
@@ -1 +1 @@
1
- export type BeforeUnloadEvent = Record<string, never>;
1
+ export type BeforeUnloadEvent = Record<symbol, never>;
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=BeforeUnloadEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=ClipProps.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=CustomEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=EffectParams.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=FilterKind.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FilterProps.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FocusEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=FocusEventKind.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=FullScreenEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=FullscreenEventKind.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=GameEvent.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=Gamepad.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=GamepadButton.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=GamepadCommand.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=GamepadEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=GamepadHapticActuator.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=KeyboardEventKind.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=KeyboardLocation.js.map
@@ -1,3 +1,3 @@
1
1
  export type Literal = null | string | bigint | number | boolean | Array<Literal> | {
2
- [key in string]?: Literal;
2
+ [key in string]: Literal;
3
3
  };
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=Literal.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=MouseEventKind.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=MoyuCursor.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=NineSliceMode.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=NodeEvent.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=NodeProps.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=RawKeyboardEvent.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=RawMouseEvent.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=RawTouchEvent.js.map
@@ -1,5 +1,6 @@
1
1
  import type { WheelEventDeltaMode } from './WheelEventDeltaMode';
2
2
  export type RawWheelEvent = {
3
+ kind: string;
3
4
  targetId: number;
4
5
  bubbleTargetIds: Array<number>;
5
6
  deltaX: number;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=RawWheelEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=ResizeEvent.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ResolvedArgument.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ResolvedCommandLine.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ResolvedSystemCallLine.js.map
@@ -28,6 +28,7 @@ export type ScenarioCommand = {
28
28
  subCommand: 'setWaiting';
29
29
  /**
30
30
  * waiting time in milliseconds
31
+ * use f64 to avoid conversion issues with JavaScript numbers
31
32
  */
32
33
  time: number;
33
34
  /**
@@ -44,7 +45,7 @@ export type ScenarioCommand = {
44
45
  } | {
45
46
  subCommand: 'setVariables';
46
47
  variables: {
47
- [key in string]?: JsonValue;
48
+ [key in string]: JsonValue;
48
49
  };
49
50
  } | {
50
51
  subCommand: 'getVariables';
@@ -58,7 +59,7 @@ export type ScenarioCommand = {
58
59
  } | {
59
60
  subCommand: 'setPermanentVariables';
60
61
  variables: {
61
- [key in string]?: JsonValue;
62
+ [key in string]: JsonValue;
62
63
  };
63
64
  } | {
64
65
  subCommand: 'getPermanentVariables';
@@ -68,6 +69,18 @@ export type ScenarioCommand = {
68
69
  subCommand: 'saveGame';
69
70
  name: string;
70
71
  extra?: JsonValue;
72
+ } | {
73
+ subCommand: 'record';
74
+ meta: {
75
+ [key in string]: JsonValue;
76
+ };
77
+ } | {
78
+ subCommand: 'getRecords';
79
+ offset?: number;
80
+ limit?: number;
81
+ } | {
82
+ subCommand: 'jumpToRecord';
83
+ recordId: string;
71
84
  } | {
72
85
  subCommand: 'loadGame';
73
86
  name: string;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ScenarioCommand.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ScenarioEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=SpriteMode.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=SpriteProps.js.map
@@ -23,6 +23,8 @@ export type SystemCommand = {
23
23
  width?: number;
24
24
  height?: number;
25
25
  keepAspectRatio?: boolean;
26
+ } | {
27
+ subCommand: 'getParams';
26
28
  } | {
27
29
  subCommand: 'quit';
28
30
  };
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=SystemCommand.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=TextCommand.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=TextEvent.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=TextLine.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=TextPrintMode.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=TextProps.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=TouchEventKind.js.map
@@ -0,0 +1,21 @@
1
+ export type VideoCommand = {
2
+ subCommand: 'play';
3
+ } | {
4
+ subCommand: 'pause';
5
+ } | {
6
+ subCommand: 'resume';
7
+ } | {
8
+ subCommand: 'stop';
9
+ } | {
10
+ subCommand: 'seek';
11
+ time: number;
12
+ } | {
13
+ subCommand: 'setVolume';
14
+ volume: number;
15
+ } | {
16
+ subCommand: 'setMuted';
17
+ muted: boolean;
18
+ } | {
19
+ subCommand: 'setLoop';
20
+ enabled: boolean;
21
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type VideoEvent = null | string;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export type VideoProps = {
2
+ src: string | null;
3
+ loop?: boolean;
4
+ autoPlay?: boolean;
5
+ volume?: number;
6
+ muted?: boolean;
7
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=WheelEventDeltaMode.js.map
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=WindowState.js.map
@@ -1,3 +1,3 @@
1
1
  export type JsonValue = number | string | boolean | Array<JsonValue> | {
2
- [key in string]?: JsonValue;
2
+ [key in string]: JsonValue;
3
3
  } | null;
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
2
  // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=JsonValue.js.map
package/dist/commands.js CHANGED
@@ -22,4 +22,3 @@ __exportStar(require("./bindings/TextCommand"), exports);
22
22
  __exportStar(require("./bindings/AudioSettings"), exports);
23
23
  __exportStar(require("./bindings/EffectParams"), exports);
24
24
  __exportStar(require("./bindings/WindowState"), exports);
25
- //# sourceMappingURL=commands.js.map
@@ -250,4 +250,3 @@ function useNavigationParams() {
250
250
  // Default to empty object if both are undefined
251
251
  return (overlayParams ?? pageParams ?? {});
252
252
  }
253
- //# sourceMappingURL=navigation.js.map
@@ -11,6 +11,7 @@ import { BackdropProps } from './bindings/BackdropProps';
11
11
  import { SpriteProps } from './bindings/SpriteProps';
12
12
  import { TextProps } from './bindings/TextProps';
13
13
  import { AnimationProps } from './bindings/AnimationProps';
14
+ import { VideoProps } from './bindings/VideoProps';
14
15
  export type Tuple2 = [number, number];
15
16
  export type Tuple3 = [number, number, number];
16
17
  export type Tuple4 = [number, number, number, number];
@@ -39,6 +40,10 @@ export type MoyuClipAttributes = ClipProps & MoyuNodeAttributes;
39
40
  export type MoyuFilterAttributes = FilterProps & MoyuNodeAttributes;
40
41
  export type MoyuBackdropAttributes = BackdropProps & MoyuNodeAttributes;
41
42
  export type MoyuAnimationAttributes = AnimationProps & MoyuNodeAttributes;
43
+ export type MoyuVideoAttributes = VideoProps & MoyuNodeAttributes & {
44
+ onEnded?: () => void;
45
+ onStateChange?: (state: string) => void;
46
+ };
42
47
  export type MoyuSpriteAttributes = SpriteProps & MoyuNodeAttributes;
43
48
  export type MoyuTextAttributes = TextProps & MoyuNodeAttributes & {
44
49
  onStart?: () => void;
@@ -70,5 +75,6 @@ export declare namespace JSX {
70
75
  filter: DetailedMoyuProps<MoyuFilterAttributes>;
71
76
  backdrop: DetailedMoyuProps<MoyuBackdropAttributes>;
72
77
  animation: DetailedMoyuProps<MoyuAnimationAttributes>;
78
+ video: DetailedMoyuProps<MoyuVideoAttributes>;
73
79
  }
74
80
  }
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=declaration.js.map
@@ -17,4 +17,3 @@ function createBubbleEvent(body, targetId) {
17
17
  };
18
18
  return event;
19
19
  }
20
- //# sourceMappingURL=base.js.map
@@ -5,7 +5,7 @@ const state_1 = require("../state");
5
5
  const base_1 = require("./base");
6
6
  exports.globalEventListeners = {};
7
7
  exports.globalRequestAnimationFrameListeners = [];
8
- const BUBBLE_EVENT_NAMES = ['mouseevent', 'touchevent', 'keyboardevent'];
8
+ const BUBBLE_EVENT_NAMES = ['mouseevent', 'touchevent', 'keyboardevent', 'wheelevent'];
9
9
  globalThis.__moyu_receive_event = (raw_event) => {
10
10
  const { name, body } = raw_event;
11
11
  if (BUBBLE_EVENT_NAMES.includes(name)) {
@@ -57,7 +57,7 @@ function handleBubbleEvent(name, body) {
57
57
  if (!node) {
58
58
  return;
59
59
  }
60
- if (['mouseevent', 'keyboardevent'].includes(name)) {
60
+ if (['mouseevent', 'keyboardevent', 'wheelevent'].includes(name)) {
61
61
  node?.listeners?.[`on${kind}`]?.(event);
62
62
  while (event.bubbles && bubbleTargetIds.length) {
63
63
  // biome-ignore lint/style/noNonNullAssertion: we are sure that the array is not empty, it is a bug of biomejs
@@ -120,4 +120,3 @@ if (globalThis.__moyu_native) {
120
120
  exports.globalRequestAnimationFrameListeners.splice(handle, 1);
121
121
  };
122
122
  }
123
- //# sourceMappingURL=globals.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=keyboard.js.map
@@ -11,4 +11,3 @@ function addEventListener(name, callback) {
11
11
  globals_1.globalEventListeners[name] = globals_1.globalEventListeners[name].filter((cb) => cb !== callback);
12
12
  };
13
13
  }
14
- //# sourceMappingURL=listener.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=mouse.js.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=touch.js.map
@@ -0,0 +1,9 @@
1
+ import { WheelEventDeltaMode } from '../events';
2
+ import type { MouseEvent } from './mouse';
3
+ export interface WheelEvent extends Omit<MouseEvent, 'kind'> {
4
+ kind: 'wheel';
5
+ deltaX: number;
6
+ deltaY: number;
7
+ deltaZ: number;
8
+ deltaMode: WheelEventDeltaMode;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/events.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './events/keyboard';
4
4
  export * from './events/listener';
5
5
  export * from './events/mouse';
6
6
  export * from './events/touch';
7
+ export * from './events/wheel';
7
8
  export * from './bindings/AnimationFrameCallbackEvent';
8
9
  export * from './bindings/BeforeUnloadEvent';
9
10
  export * from './bindings/CustomEvent';
package/dist/events.js CHANGED
@@ -20,6 +20,7 @@ __exportStar(require("./events/keyboard"), exports);
20
20
  __exportStar(require("./events/listener"), exports);
21
21
  __exportStar(require("./events/mouse"), exports);
22
22
  __exportStar(require("./events/touch"), exports);
23
+ __exportStar(require("./events/wheel"), exports);
23
24
  __exportStar(require("./bindings/AnimationFrameCallbackEvent"), exports);
24
25
  __exportStar(require("./bindings/BeforeUnloadEvent"), exports);
25
26
  __exportStar(require("./bindings/CustomEvent"), exports);
@@ -46,4 +47,3 @@ __exportStar(require("./bindings/ScenarioEvent"), exports);
46
47
  __exportStar(require("./bindings/TextEvent"), exports);
47
48
  __exportStar(require("./bindings/TouchEventKind"), exports);
48
49
  __exportStar(require("./bindings/WheelEventDeltaMode"), exports);
49
- //# sourceMappingURL=events.js.map
@@ -60,4 +60,3 @@ function useFadeOut(outTime, pause = false, onFinished) {
60
60
  };
61
61
  return [style, api, skip];
62
62
  }
63
- //# sourceMappingURL=useFadeInOut.js.map
@@ -62,4 +62,3 @@ function useScenario(stories, startName, entryName, goNextOnLoad = false) {
62
62
  };
63
63
  }, [stories, startName, entryName, goNextOnLoad]);
64
64
  }
65
- //# sourceMappingURL=useScenario.js.map
@@ -61,4 +61,3 @@ function useSoundEffect(src) {
61
61
  }
62
62
  }, [src]);
63
63
  }
64
- //# sourceMappingURL=useSoundEffect.js.map