narraleaf-react 0.10.1 → 0.12.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/README.md CHANGED
@@ -1,165 +1,165 @@
1
- <picture>
2
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-transparent.png">
3
- <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
4
- <img alt="NarraLeaf Logo" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
5
- </picture>
6
-
7
- <h1 align="center">NarraLeaf-React</h1>
8
-
9
- <h4 align="center">A React visual novel player framework</h4>
10
-
11
- <p align="center">English | <a href="docs/README.zh-CN.md">简体中文</a></p>
12
-
13
-
14
- ## What is NarraLeaf-React?
15
-
16
- NarraLeaf-React is a lightweight front-end visual novel player.
17
- NL focuses on visual novel playing, so the user interface can be customized very easily.
18
-
19
- It doesn't use any rendering libraries and can be used on any web platform (e.g. Electron)
20
-
21
- ## Why NarraLeaf-React?
22
-
23
- - **Lightweight**: NarraLeaf-React is a front-end framework, and it doesn't use any rendering libraries.
24
- - **Customizable**: You can customize the UI as you like, even replace the whole components.
25
- - **Easy to use**: It is easy to use and has a simple API that is built for developers. Based on OOP principles.
26
-
27
- ### Scripting
28
-
29
- NarraLeaf-React uses TypeScript for all scripting, so you don't have to learn a whole new language to use it.
30
-
31
- It also has a highly abstracted and easy-to-use API, for example:
32
-
33
- ```typescript
34
- import {Character, Menu, Scene, c, b} from "narraleaf-react";
35
- ```
36
-
37
- ```typescript
38
- const scene1 = new Scene("Scene1: Hello World", {
39
- background: "/link/to/background.jpg",
40
- });
41
-
42
- const jS = new Character("John Smith");
43
- const jD = new Character("John Doe");
44
-
45
- scene1.action([
46
- jS`Hello, world!`,
47
- jS`This is my first ${b("NarraLeaf")} story.`,
48
- jS`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`,
49
-
50
- jD`Also, don't forget to check out the ${c("documentation", "#00f")}!`,
51
-
52
- "By the way, the documentation is available on https://www.narraleaf.com/docs/narraleaf-react",
53
- "You can also visit the website for demo and more information.",
54
-
55
- Menu.prompt("Start the journey")
56
-
57
- .choose("Yes I will!", [
58
- jS`Great! Let's start the journey!`,
59
- jS`You can open issues on GitHub if you have any questions.`
60
- ])
61
-
62
- .choose("No, I'm going to check the documentation", [
63
- jS`Sure! Take your time!`
64
- ])
65
- ]);
66
- ```
67
-
68
- For more information, please visit the [NarraLeaf-React documentation](https://www.narraleaf.com/docs/narraleaf-react).
69
-
70
- ## Get Started
71
-
72
- ### Install
73
-
74
- ```bash
75
- npm install narraleaf-react
76
- ```
77
-
78
- ### Documentation
79
-
80
- - [Introduction](https://www.narraleaf.com/docs/narraleaf-react)
81
- - [Quick Start](https://www.narraleaf.com/docs/narraleaf-react/quick-start)
82
- - [Installation](https://www.narraleaf.com/docs/narraleaf-react/installation)
83
- - [Basic](https://www.narraleaf.com/docs/narraleaf-react/basic)
84
- - [Create a Scene](https://www.narraleaf.com/docs/narraleaf-react/basic/create-scene)
85
- - [Add Actions](https://www.narraleaf.com/docs/narraleaf-react/basic/add-actions)
86
- - [Show Dialog](https://www.narraleaf.com/docs/narraleaf-react/basic/show-dialog)
87
- - [Show Image](https://www.narraleaf.com/docs/narraleaf-react/basic/show-image)
88
- - [Play Story](https://www.narraleaf.com/docs/narraleaf-react/basic/play-story)
89
- - [Make Choices](https://www.narraleaf.com/docs/narraleaf-react/basic/make-choices)
90
- - [Play Sound](https://www.narraleaf.com/docs/narraleaf-react/basic/sound)
91
- - [Store Data](https://www.narraleaf.com/docs/narraleaf-react/basic/store-data)
92
- - [Conditional](https://www.narraleaf.com/docs/narraleaf-react/basic/conditional)
93
- - [Voice](https://www.narraleaf.com/docs/narraleaf-react/basic/voice)
94
- - [Manage Preferences](https://www.narraleaf.com/docs/narraleaf-react/basic/manage-preferences)
95
- - [Solutions](https://www.narraleaf.com/docs/narraleaf-react/solutions)
96
- - [Customizing the Font](https://www.narraleaf.com/docs/narraleaf-react/solutions/font)
97
- - [Migration from Ren'Py](https://www.narraleaf.com/docs/narraleaf-react/solutions/from-renpy)
98
- - [Quick Menu](https://www.narraleaf.com/docs/narraleaf-react/solutions/quick-menu)
99
- - [Dialog Avatar](https://www.narraleaf.com/docs/narraleaf-react/solutions/dialog-avatar)
100
- - [Custom Dialog](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-dialog)
101
- - [Custom NVL Dialog](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-nvl-dialog)
102
- - [Custom Menu](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-menu)
103
- - [Page Overlay Settings](https://www.narraleaf.com/docs/narraleaf-react/solutions/page-overlay-settings)
104
- - [Save System with localStorage](https://www.narraleaf.com/docs/narraleaf-react/solutions/save-system-localstorage)
105
- - [Custom Notification](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-notification)
106
- - [Gallery Service with localStorage](https://www.narraleaf.com/docs/narraleaf-react/solutions/gallery-service-localstorage)
107
- - [Core](https://www.narraleaf.com/docs/narraleaf-react/core)
108
- - [Elements](https://www.narraleaf.com/docs/narraleaf-react/core/elements)
109
- - [Scene](https://www.narraleaf.com/docs/narraleaf-react/core/elements/scene)
110
- - [Character](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character)
111
- - [Sentence](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character/sentence)
112
- - [Word](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character/word)
113
- - [Pause](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character/pause)
114
- - [Image](https://www.narraleaf.com/docs/narraleaf-react/core/elements/image)
115
- - [Sound](https://www.narraleaf.com/docs/narraleaf-react/core/elements/sound)
116
- - [Menu](https://www.narraleaf.com/docs/narraleaf-react/core/elements/menu)
117
- - [Script](https://www.narraleaf.com/docs/narraleaf-react/core/elements/script)
118
- - [Condition](https://www.narraleaf.com/docs/narraleaf-react/core/elements/condition)
119
- - [Control](https://www.narraleaf.com/docs/narraleaf-react/core/elements/control)
120
- - [Text](https://www.narraleaf.com/docs/narraleaf-react/core/elements/text)
121
- - [Persistent](https://www.narraleaf.com/docs/narraleaf-react/core/elements/persistent)
122
- - [Story](https://www.narraleaf.com/docs/narraleaf-react/core/elements/story)
123
- - [Displayable](https://www.narraleaf.com/docs/narraleaf-react/core/elements/displayable)
124
- - [Layer](https://www.narraleaf.com/docs/narraleaf-react/core/elements/layer)
125
- - [Service](https://www.narraleaf.com/docs/narraleaf-react/core/elements/service)
126
- - [Video](https://www.narraleaf.com/docs/narraleaf-react/core/elements/video)
127
- - [Built-in Gallery](https://www.narraleaf.com/docs/narraleaf-react/core/elements/built-in/gallery)
128
- - [Animation](https://www.narraleaf.com/docs/narraleaf-react/core/animation)
129
- - [Transform](https://www.narraleaf.com/docs/narraleaf-react/core/animation/transform)
130
- - [Transitions](https://www.narraleaf.com/docs/narraleaf-react/core/animation/transition)
131
- - [Game](https://www.narraleaf.com/docs/narraleaf-react/core/game)
132
- - [LiveGame](https://www.narraleaf.com/docs/narraleaf-react/core/game/live-game)
133
- - [Storable](https://www.narraleaf.com/docs/narraleaf-react/core/game/storable)
134
- - [Preference](https://www.narraleaf.com/docs/narraleaf-react/core/game/preference/preference)
135
- - [Key Map](https://www.narraleaf.com/docs/narraleaf-react/core/game/key-map)
136
- - [Hooks](https://www.narraleaf.com/docs/narraleaf-react/core/game/hooks)
137
- - [Plugin](https://www.narraleaf.com/docs/narraleaf-react/core/plugin)
138
- - [Utils](https://www.narraleaf.com/docs/narraleaf-react/core/utils)
139
- - [Player](https://www.narraleaf.com/docs/narraleaf-react/player)
140
- - [Player](https://www.narraleaf.com/docs/narraleaf-react/player/player)
141
- - [FixedAspectRatioContainer](https://www.narraleaf.com/docs/narraleaf-react/player/fixed-aspect-ratio-container)
142
- - [GameProviders](https://www.narraleaf.com/docs/narraleaf-react/player/game-providers)
143
- - [Hooks](https://www.narraleaf.com/docs/narraleaf-react/player/hooks)
144
- - [LayoutRouter](https://www.narraleaf.com/docs/narraleaf-react/player/page-router)
145
- - [Dialog](https://www.narraleaf.com/docs/narraleaf-react/player/dialog)
146
- - [Notification](https://www.narraleaf.com/docs/narraleaf-react/player/notification)
147
- - [Menu](https://www.narraleaf.com/docs/narraleaf-react/player/menu)
148
- - [NvlContainer](https://www.narraleaf.com/docs/narraleaf-react/player/nvl-container)
149
- - About
150
- - [License](https://www.narraleaf.com/docs/narraleaf-react/info/license)
151
- - [Incompatible Changes](https://www.narraleaf.com/docs/narraleaf-react/info/incompatible-changes)
152
-
153
- Read more in the [NarraLeaf-React documentation](https://www.narraleaf.com/docs/narraleaf-react).
154
-
155
- ## License
156
-
157
- > NarraLeaf-React is licensed under the MPL-2.0 License.
158
- >
159
- > We updated the license to MPL-2.0 on 2024-9-24.
160
-
161
- ## Contributing
162
-
163
- We welcome all contributions.
164
- If you have any ideas, just open an issue or a pull request.
165
-
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-transparent.png">
3
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
4
+ <img alt="NarraLeaf Logo" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png">
5
+ </picture>
6
+
7
+ <h1 align="center">NarraLeaf-React</h1>
8
+
9
+ <h4 align="center">A React visual novel player framework</h4>
10
+
11
+ <p align="center">English | <a href="docs/README.zh-CN.md">简体中文</a></p>
12
+
13
+
14
+ ## What is NarraLeaf-React?
15
+
16
+ NarraLeaf-React is a lightweight front-end visual novel player.
17
+ NL focuses on visual novel playing, so the user interface can be customized very easily.
18
+
19
+ It doesn't use any rendering libraries and can be used on any web platform (e.g. Electron)
20
+
21
+ ## Why NarraLeaf-React?
22
+
23
+ - **Lightweight**: NarraLeaf-React is a front-end framework, and it doesn't use any rendering libraries.
24
+ - **Customizable**: You can customize the UI as you like, even replace the whole components.
25
+ - **Easy to use**: It is easy to use and has a simple API that is built for developers. Based on OOP principles.
26
+
27
+ ### Scripting
28
+
29
+ NarraLeaf-React uses TypeScript for all scripting, so you don't have to learn a whole new language to use it.
30
+
31
+ It also has a highly abstracted and easy-to-use API, for example:
32
+
33
+ ```typescript
34
+ import {Character, Menu, Scene, c, b} from "narraleaf-react";
35
+ ```
36
+
37
+ ```typescript
38
+ const scene1 = new Scene("Scene1: Hello World", {
39
+ background: "/link/to/background.jpg",
40
+ });
41
+
42
+ const jS = new Character("John Smith");
43
+ const jD = new Character("John Doe");
44
+
45
+ scene1.action([
46
+ jS`Hello, world!`,
47
+ jS`This is my first ${b("NarraLeaf")} story.`,
48
+ jS`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`,
49
+
50
+ jD`Also, don't forget to check out the ${c("documentation", "#00f")}!`,
51
+
52
+ "By the way, the documentation is available on https://www.narraleaf.com/docs/narraleaf-react",
53
+ "You can also visit the website for demo and more information.",
54
+
55
+ Menu.prompt("Start the journey")
56
+
57
+ .choose("Yes I will!", [
58
+ jS`Great! Let's start the journey!`,
59
+ jS`You can open issues on GitHub if you have any questions.`
60
+ ])
61
+
62
+ .choose("No, I'm going to check the documentation", [
63
+ jS`Sure! Take your time!`
64
+ ])
65
+ ]);
66
+ ```
67
+
68
+ For more information, please visit the [NarraLeaf-React documentation](https://www.narraleaf.com/docs/narraleaf-react).
69
+
70
+ ## Get Started
71
+
72
+ ### Install
73
+
74
+ ```bash
75
+ npm install narraleaf-react
76
+ ```
77
+
78
+ ### Documentation
79
+
80
+ - [Introduction](https://www.narraleaf.com/docs/narraleaf-react)
81
+ - [Quick Start](https://www.narraleaf.com/docs/narraleaf-react/quick-start)
82
+ - [Installation](https://www.narraleaf.com/docs/narraleaf-react/installation)
83
+ - [Basic](https://www.narraleaf.com/docs/narraleaf-react/basic)
84
+ - [Create a Scene](https://www.narraleaf.com/docs/narraleaf-react/basic/create-scene)
85
+ - [Add Actions](https://www.narraleaf.com/docs/narraleaf-react/basic/add-actions)
86
+ - [Show Dialog](https://www.narraleaf.com/docs/narraleaf-react/basic/show-dialog)
87
+ - [Show Image](https://www.narraleaf.com/docs/narraleaf-react/basic/show-image)
88
+ - [Play Story](https://www.narraleaf.com/docs/narraleaf-react/basic/play-story)
89
+ - [Make Choices](https://www.narraleaf.com/docs/narraleaf-react/basic/make-choices)
90
+ - [Play Sound](https://www.narraleaf.com/docs/narraleaf-react/basic/sound)
91
+ - [Store Data](https://www.narraleaf.com/docs/narraleaf-react/basic/store-data)
92
+ - [Conditional](https://www.narraleaf.com/docs/narraleaf-react/basic/conditional)
93
+ - [Voice](https://www.narraleaf.com/docs/narraleaf-react/basic/voice)
94
+ - [Manage Preferences](https://www.narraleaf.com/docs/narraleaf-react/basic/manage-preferences)
95
+ - [Solutions](https://www.narraleaf.com/docs/narraleaf-react/solutions)
96
+ - [Customizing the Font](https://www.narraleaf.com/docs/narraleaf-react/solutions/font)
97
+ - [Migration from Ren'Py](https://www.narraleaf.com/docs/narraleaf-react/solutions/from-renpy)
98
+ - [Quick Menu](https://www.narraleaf.com/docs/narraleaf-react/solutions/quick-menu)
99
+ - [Dialog Avatar](https://www.narraleaf.com/docs/narraleaf-react/solutions/dialog-avatar)
100
+ - [Custom Dialog](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-dialog)
101
+ - [Custom NVL Dialog](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-nvl-dialog)
102
+ - [Custom Menu](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-menu)
103
+ - [Page Overlay Settings](https://www.narraleaf.com/docs/narraleaf-react/solutions/page-overlay-settings)
104
+ - [Save System with localStorage](https://www.narraleaf.com/docs/narraleaf-react/solutions/save-system-localstorage)
105
+ - [Custom Notification](https://www.narraleaf.com/docs/narraleaf-react/solutions/custom-notification)
106
+ - [Gallery Service with localStorage](https://www.narraleaf.com/docs/narraleaf-react/solutions/gallery-service-localstorage)
107
+ - [Core](https://www.narraleaf.com/docs/narraleaf-react/core)
108
+ - [Elements](https://www.narraleaf.com/docs/narraleaf-react/core/elements)
109
+ - [Scene](https://www.narraleaf.com/docs/narraleaf-react/core/elements/scene)
110
+ - [Character](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character)
111
+ - [Sentence](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character/sentence)
112
+ - [Word](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character/word)
113
+ - [Pause](https://www.narraleaf.com/docs/narraleaf-react/core/elements/character/pause)
114
+ - [Image](https://www.narraleaf.com/docs/narraleaf-react/core/elements/image)
115
+ - [Sound](https://www.narraleaf.com/docs/narraleaf-react/core/elements/sound)
116
+ - [Menu](https://www.narraleaf.com/docs/narraleaf-react/core/elements/menu)
117
+ - [Script](https://www.narraleaf.com/docs/narraleaf-react/core/elements/script)
118
+ - [Condition](https://www.narraleaf.com/docs/narraleaf-react/core/elements/condition)
119
+ - [Control](https://www.narraleaf.com/docs/narraleaf-react/core/elements/control)
120
+ - [Text](https://www.narraleaf.com/docs/narraleaf-react/core/elements/text)
121
+ - [Persistent](https://www.narraleaf.com/docs/narraleaf-react/core/elements/persistent)
122
+ - [Story](https://www.narraleaf.com/docs/narraleaf-react/core/elements/story)
123
+ - [Displayable](https://www.narraleaf.com/docs/narraleaf-react/core/elements/displayable)
124
+ - [Layer](https://www.narraleaf.com/docs/narraleaf-react/core/elements/layer)
125
+ - [Service](https://www.narraleaf.com/docs/narraleaf-react/core/elements/service)
126
+ - [Video](https://www.narraleaf.com/docs/narraleaf-react/core/elements/video)
127
+ - [Built-in Gallery](https://www.narraleaf.com/docs/narraleaf-react/core/elements/built-in/gallery)
128
+ - [Animation](https://www.narraleaf.com/docs/narraleaf-react/core/animation)
129
+ - [Transform](https://www.narraleaf.com/docs/narraleaf-react/core/animation/transform)
130
+ - [Transitions](https://www.narraleaf.com/docs/narraleaf-react/core/animation/transition)
131
+ - [Game](https://www.narraleaf.com/docs/narraleaf-react/core/game)
132
+ - [LiveGame](https://www.narraleaf.com/docs/narraleaf-react/core/game/live-game)
133
+ - [Storable](https://www.narraleaf.com/docs/narraleaf-react/core/game/storable)
134
+ - [Preference](https://www.narraleaf.com/docs/narraleaf-react/core/game/preference/preference)
135
+ - [Key Map](https://www.narraleaf.com/docs/narraleaf-react/core/game/key-map)
136
+ - [Hooks](https://www.narraleaf.com/docs/narraleaf-react/core/game/hooks)
137
+ - [Plugin](https://www.narraleaf.com/docs/narraleaf-react/core/plugin)
138
+ - [Utils](https://www.narraleaf.com/docs/narraleaf-react/core/utils)
139
+ - [Player](https://www.narraleaf.com/docs/narraleaf-react/player)
140
+ - [Player](https://www.narraleaf.com/docs/narraleaf-react/player/player)
141
+ - [FixedAspectRatioContainer](https://www.narraleaf.com/docs/narraleaf-react/player/fixed-aspect-ratio-container)
142
+ - [GameProviders](https://www.narraleaf.com/docs/narraleaf-react/player/game-providers)
143
+ - [Hooks](https://www.narraleaf.com/docs/narraleaf-react/player/hooks)
144
+ - [LayoutRouter](https://www.narraleaf.com/docs/narraleaf-react/player/page-router)
145
+ - [Dialog](https://www.narraleaf.com/docs/narraleaf-react/player/dialog)
146
+ - [Notification](https://www.narraleaf.com/docs/narraleaf-react/player/notification)
147
+ - [Menu](https://www.narraleaf.com/docs/narraleaf-react/player/menu)
148
+ - [NvlContainer](https://www.narraleaf.com/docs/narraleaf-react/player/nvl-container)
149
+ - About
150
+ - [License](https://www.narraleaf.com/docs/narraleaf-react/info/license)
151
+ - [Incompatible Changes](https://www.narraleaf.com/docs/narraleaf-react/info/incompatible-changes)
152
+
153
+ Read more in the [NarraLeaf-React documentation](https://www.narraleaf.com/docs/narraleaf-react).
154
+
155
+ ## License
156
+
157
+ > NarraLeaf-React is licensed under the MPL-2.0 License.
158
+ >
159
+ > We updated the license to MPL-2.0 on 2024-9-24.
160
+
161
+ ## Contributing
162
+
163
+ We welcome all contributions.
164
+ If you have any ideas, just open an issue or a pull request.
165
+
@@ -4,4 +4,17 @@ import { MaskTransition } from "../elements/transition/transitions/image/maskTra
4
4
  import { Transition } from "../elements/transition/transition";
5
5
  import { ImageTransition } from "../elements/transition/transitions/image/imageTransition";
6
6
  import { TextTransition } from "../elements/transition/transitions/text/textTransition";
7
- export { Transition, ImageTransition, TextTransition, Dissolve, FadeIn, MaskTransition, };
7
+ import { SoftWipe } from "../elements/transition/transitions/image/softWipe";
8
+ import { Blinds } from "../elements/transition/transitions/image/blinds";
9
+ import { SoftIris } from "../elements/transition/transitions/image/softIris";
10
+ import { BlurDissolve } from "../elements/transition/transitions/image/blurDissolve";
11
+ import { Push } from "../elements/transition/transitions/image/push";
12
+ import { ThroughColor } from "../elements/transition/transitions/image/throughColor";
13
+ export { Transition, ImageTransition, TextTransition, Dissolve, FadeIn, MaskTransition, SoftWipe, Blinds, SoftIris, BlurDissolve, Push, ThroughColor, };
14
+ export type { SoftWipeOptions } from "../elements/transition/transitions/image/softWipe";
15
+ export type { BlindsOptions } from "../elements/transition/transitions/image/blinds";
16
+ export type { SoftIrisOptions } from "../elements/transition/transitions/image/softIris";
17
+ export type { BlurDissolveOptions } from "../elements/transition/transitions/image/blurDissolve";
18
+ export type { PushOptions } from "../elements/transition/transitions/image/push";
19
+ export type { ThroughColorFadeOptions, ThroughColorWipeOptions, ThroughColorBlindsOptions, ThroughColorIrisOptions, } from "../elements/transition/transitions/image/throughColor";
20
+ export type { BlindsOrientation } from "../elements/transition/transitions/image/transitionMaskUtils";
@@ -2,6 +2,7 @@ import { ControlAction } from "../../action/actions/controlAction";
2
2
  import { Chained, Proxied } from "../../action/chain";
3
3
  import { GameState } from "../../common/game";
4
4
  import { LogicAction } from "../../game";
5
+ import { Layer } from "../layer";
5
6
  import { DynamicPersistent, Persistent } from "../persistent";
6
7
  import { Scene } from "../scene";
7
8
  export declare class DevTools {
@@ -13,5 +14,40 @@ export declare class DevTools {
13
14
  static wrapAction(action: LogicAction.Actions[] | Proxied<LogicAction.GameElement, Chained<LogicAction.Actions>>): ControlAction;
14
15
  static getNamespaceName(persistent: Persistent<any>): string;
15
16
  static getCurrentScene(gameState: GameState): Scene | null;
17
+ /**
18
+ * Register a displayable into a scene's render tree without emitting a `displayable:init`
19
+ * action. The element renders immediately at its constructor-config transform state
20
+ * (visibility is governed by `opacity > 0`).
21
+ *
22
+ * Intended for editor hosts that pre-pose a stage: construct elements with their computed
23
+ * state as constructor config (config state survives `element.reset()` / `newGame()`), then
24
+ * register them from a `Script` action or after mount.
25
+ */
26
+ static registerDisplayable(gameState: GameState, displayable: LogicAction.DisplayableElements, scene?: Scene | null, layer?: Layer | null): void;
27
+ /**
28
+ * Assign an explicit element id. Elements reachable from a scene's action tree receive
29
+ * generated ids (`e-0`, `e-1`, ...) at story construction, but elements registered directly
30
+ * via {@link registerDisplayable} are outside the tree and would otherwise share the default
31
+ * id — colliding as React keys. Editor hosts should give those elements unique ids
32
+ * (use a distinct prefix so they never collide with generated ids).
33
+ */
34
+ static setElementId(element: LogicAction.GameElement, id: string): void;
35
+ /**
36
+ * Read a displayable's current transform-state props (position/opacity/zoom/rotation/scale/
37
+ * effects...). Returns a shallow copy. Intended for editor hosts capturing a live pose
38
+ * (e.g. prefilling a motion editor with an element's current stage state).
39
+ */
40
+ static getDisplayableTransformProps(displayable: LogicAction.DisplayableElements): Record<string, unknown>;
41
+ /**
42
+ * Overwrite a displayable's transform-state props with no animation and push the result to
43
+ * the DOM immediately when the element is mounted. With `merge: false` the previous state is
44
+ * discarded entirely; by default the given props are merged over the current state.
45
+ *
46
+ * Throws if the transform state is locked by an in-flight transform — editor hosts should
47
+ * only inject while the stage is idle.
48
+ */
49
+ static setDisplayableTransformProps(gameState: GameState, displayable: LogicAction.DisplayableElements, props: Record<string, unknown>, options?: {
50
+ merge?: boolean;
51
+ }): void;
16
52
  static DynamicPersistent: typeof DynamicPersistent;
17
53
  }
@@ -0,0 +1,28 @@
1
+ import { TransitionAnimationType, TransitionTask } from "../../../../elements/transition/type";
2
+ import { TransformDefinitions } from "../../../../elements/transform/type";
3
+ import { ImageTransition } from "../../../../elements/transition/transitions/image/imageTransition";
4
+ import { BlindsOrientation } from "../../../../elements/transition/transitions/image/transitionMaskUtils";
5
+ type AnimationType = [TransitionAnimationType.Number];
6
+ export type BlindsOptions = {
7
+ /** Duration in milliseconds. */
8
+ duration: number;
9
+ /** Slat orientation. @default "horizontal" */
10
+ orientation?: BlindsOrientation;
11
+ /** Number of slats. @default 8 */
12
+ slats?: number;
13
+ easing?: TransformDefinitions.EasingDefinition;
14
+ };
15
+ /**
16
+ * Venetian "blinds": the target image is revealed over the previous one through
17
+ * a set of hard-edged slats that widen until they cover the frame.
18
+ */
19
+ export declare class Blinds extends ImageTransition<AnimationType> {
20
+ private duration;
21
+ private orientation;
22
+ private slats;
23
+ private easing?;
24
+ constructor(options: BlindsOptions);
25
+ createTask(): TransitionTask<HTMLImageElement, AnimationType>;
26
+ copy(): Blinds;
27
+ }
28
+ export {};
@@ -0,0 +1,24 @@
1
+ import { TransitionAnimationType, TransitionTask } from "../../../../elements/transition/type";
2
+ import { TransformDefinitions } from "../../../../elements/transform/type";
3
+ import { ImageTransition } from "../../../../elements/transition/transitions/image/imageTransition";
4
+ type AnimationType = [TransitionAnimationType.Number];
5
+ export type BlurDissolveOptions = {
6
+ /** Duration in milliseconds. */
7
+ duration: number;
8
+ /** Peak blur radius applied at the crossover, in pixels. @default 16 */
9
+ blur?: number;
10
+ easing?: TransformDefinitions.EasingDefinition;
11
+ };
12
+ /**
13
+ * A blur dissolve: the previous image blurs out and fades while the target one
14
+ * sharpens in — the dreamy crossfade used for flashbacks / dream states.
15
+ */
16
+ export declare class BlurDissolve extends ImageTransition<AnimationType> {
17
+ private duration;
18
+ private blur;
19
+ private easing?;
20
+ constructor(options: BlurDissolveOptions);
21
+ createTask(): TransitionTask<HTMLImageElement, AnimationType>;
22
+ copy(): BlurDissolve;
23
+ }
24
+ export {};
@@ -0,0 +1,31 @@
1
+ import { TransitionAnimationType, TransitionTask } from "../../../../elements/transition/type";
2
+ import { TransformDefinitions } from "../../../../elements/transform/type";
3
+ import { ImageTransition } from "../../../../elements/transition/transitions/image/imageTransition";
4
+ type AnimationType = [TransitionAnimationType.Number];
5
+ export type PushOptions = {
6
+ /** Duration in milliseconds. */
7
+ duration: number;
8
+ /** Direction the previous image travels toward. @default "left" */
9
+ direction?: TransformDefinitions.WipeDirection;
10
+ easing?: TransformDefinitions.EasingDefinition;
11
+ };
12
+ /**
13
+ * A push / slide: the target image slides in from one edge while the previous
14
+ * image slides out the opposite way, as if the camera panned.
15
+ *
16
+ * The offset is applied via the independent CSS `translate` property (not
17
+ * `transform`) in viewport units. That composes additively with the layer's
18
+ * base positioning instead of overriding it, and is the identity at offset `0`,
19
+ * so neither image jumps at the start/end of the slide.
20
+ */
21
+ export declare class Push extends ImageTransition<AnimationType> {
22
+ private duration;
23
+ private direction;
24
+ private easing?;
25
+ constructor(options: PushOptions);
26
+ private axisUnit;
27
+ private translate;
28
+ createTask(): TransitionTask<HTMLImageElement, AnimationType>;
29
+ copy(): Push;
30
+ }
31
+ export {};
@@ -0,0 +1,28 @@
1
+ import { TransitionAnimationType, TransitionTask } from "../../../../elements/transition/type";
2
+ import { TransformDefinitions } from "../../../../elements/transform/type";
3
+ import { ImageTransition } from "../../../../elements/transition/transitions/image/imageTransition";
4
+ type AnimationType = [TransitionAnimationType.Number];
5
+ export type SoftIrisOptions = {
6
+ /** Duration in milliseconds. */
7
+ duration: number;
8
+ /** Centre of the iris, as a CSS position. @default "50% 50%" */
9
+ center?: string;
10
+ /** Width of the soft (feathered) edge band, in percent. @default 12 */
11
+ feather?: number;
12
+ easing?: TransformDefinitions.EasingDefinition;
13
+ };
14
+ /**
15
+ * A soft, feathered iris: the target image is revealed over the previous one
16
+ * through an expanding `radial-gradient` circle with a feathered edge — the
17
+ * soft-edged counterpart of {@link MaskTransition.circle}.
18
+ */
19
+ export declare class SoftIris extends ImageTransition<AnimationType> {
20
+ private duration;
21
+ private center;
22
+ private feather;
23
+ private easing?;
24
+ constructor(options: SoftIrisOptions);
25
+ createTask(): TransitionTask<HTMLImageElement, AnimationType>;
26
+ copy(): SoftIris;
27
+ }
28
+ export {};
@@ -0,0 +1,28 @@
1
+ import { TransitionAnimationType, TransitionTask } from "../../../../elements/transition/type";
2
+ import { TransformDefinitions } from "../../../../elements/transform/type";
3
+ import { ImageTransition } from "../../../../elements/transition/transitions/image/imageTransition";
4
+ type AnimationType = [TransitionAnimationType.Number];
5
+ export type SoftWipeOptions = {
6
+ /** Duration in milliseconds. */
7
+ duration: number;
8
+ /** Direction the wipe travels toward. @default "left" */
9
+ direction?: TransformDefinitions.WipeDirection;
10
+ /** Width of the soft (feathered) edge band, in percent. @default 12 */
11
+ feather?: number;
12
+ easing?: TransformDefinitions.EasingDefinition;
13
+ };
14
+ /**
15
+ * A soft, feathered directional wipe. The target image is revealed over the
16
+ * previous one through a moving `linear-gradient` alpha mask, giving a gradual
17
+ * erase rather than the hard geometric cut of {@link MaskTransition.wipe}.
18
+ */
19
+ export declare class SoftWipe extends ImageTransition<AnimationType> {
20
+ private duration;
21
+ private direction;
22
+ private feather;
23
+ private easing?;
24
+ constructor(options: SoftWipeOptions);
25
+ createTask(): TransitionTask<HTMLImageElement, AnimationType>;
26
+ copy(): SoftWipe;
27
+ }
28
+ export {};
@@ -0,0 +1,67 @@
1
+ import { TransitionAnimationType, TransitionTask } from "../../../../elements/transition/type";
2
+ import { TransformDefinitions } from "../../../../elements/transform/type";
3
+ import { ImageTransition } from "../../../../elements/transition/transitions/image/imageTransition";
4
+ import { BlindsOrientation } from "../../../../elements/transition/transitions/image/transitionMaskUtils";
5
+ type AnimationType = [TransitionAnimationType.Number];
6
+ type ThroughColorBaseOptions = {
7
+ /** Duration in milliseconds. */
8
+ duration: number;
9
+ /** Hold colour. @default "#000000" */
10
+ color?: string;
11
+ /** Fraction (0–1) of the duration spent fully covered by the colour. @default 0.3 */
12
+ hold?: number;
13
+ easing?: TransformDefinitions.EasingDefinition;
14
+ };
15
+ export type ThroughColorFadeOptions = ThroughColorBaseOptions;
16
+ export type ThroughColorWipeOptions = ThroughColorBaseOptions & {
17
+ /** Direction the feathered edge travels toward. @default "left" */
18
+ direction?: TransformDefinitions.WipeDirection;
19
+ /** Width of the soft edge band, in percent. @default 12 */
20
+ feather?: number;
21
+ };
22
+ export type ThroughColorBlindsOptions = ThroughColorBaseOptions & {
23
+ /** Slat orientation. @default "horizontal" */
24
+ orientation?: BlindsOrientation;
25
+ /** Number of slats. @default 8 */
26
+ slats?: number;
27
+ };
28
+ export type ThroughColorIrisOptions = ThroughColorBaseOptions & {
29
+ /** Centre of the iris, as a CSS position. @default "50% 50%" */
30
+ center?: string;
31
+ /** Width of the soft edge band, in percent. @default 12 */
32
+ feather?: number;
33
+ };
34
+ /**
35
+ * The "through colour" engine. A colour overlay covers the frame using the
36
+ * chosen pattern, holds a solid-colour frame, then uncovers to reveal the
37
+ * target image — so the target never appears until *after* the colour hold. The
38
+ * previous/target images simply swap opacity at the midpoint, unseen behind the
39
+ * fully-covered frame.
40
+ *
41
+ * Created through its static factories (mirroring {@link MaskTransition}):
42
+ * - {@link ThroughColor.fade} — the overlay fades in/out (fade-to-black/white; `hold: 0` = flash).
43
+ * - {@link ThroughColor.wipe} — a feathered directional edge (soft wipe through the colour).
44
+ * - {@link ThroughColor.blinds} — venetian slats (blinds through the colour).
45
+ * - {@link ThroughColor.iris} — a circle closing from the rim in (iris to the colour).
46
+ */
47
+ export declare class ThroughColor extends ImageTransition<AnimationType> {
48
+ private duration;
49
+ private color;
50
+ private hold;
51
+ private coverMask;
52
+ private easing?;
53
+ private constructor();
54
+ /** Fade the frame to a solid colour, hold, then fade to the target. */
55
+ static fade(options: ThroughColorFadeOptions): ThroughColor;
56
+ /** Cover the frame with a feathered directional edge, hold, then uncover. */
57
+ static wipe(options: ThroughColorWipeOptions): ThroughColor;
58
+ /** Cover the frame with venetian slats, hold, then uncover. */
59
+ static blinds(options: ThroughColorBlindsOptions): ThroughColor;
60
+ /** Close a circle over the frame from the rim in, hold, then open it. */
61
+ static iris(options: ThroughColorIrisOptions): ThroughColor;
62
+ /** Style for the colour overlay at a given coverage (0 = clear, 1 = fully covered). */
63
+ private coverStyle;
64
+ createTask(): TransitionTask<HTMLImageElement, AnimationType>;
65
+ copy(): ThroughColor;
66
+ }
67
+ export {};