narraleaf-react 0.1.6 → 0.1.7
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, Font } from "../../types";
|
|
1
|
+
import { Color, color, Font } from "../../types";
|
|
2
2
|
import { DynamicWord } from "../../elements/character/sentence";
|
|
3
3
|
import { Pausing } from "../../elements/character/pause";
|
|
4
4
|
export type WordConfig = {
|
|
@@ -7,5 +7,8 @@ export type WordConfig = {
|
|
|
7
7
|
} & Color & Font;
|
|
8
8
|
export declare class Word<T extends string | DynamicWord | Pausing = string | DynamicWord | Pausing> {
|
|
9
9
|
static isWord(obj: any): obj is Word;
|
|
10
|
+
static color(text: string | Word, color: color): Word;
|
|
11
|
+
static bold(text: string | Word): Word;
|
|
12
|
+
static italic(text: string | Word): Word;
|
|
10
13
|
constructor(text: T, config?: Partial<WordConfig>);
|
|
11
14
|
}
|
|
@@ -3,7 +3,7 @@ import { Color } from "../types";
|
|
|
3
3
|
import { DeepPartial } from "../../../util/data";
|
|
4
4
|
import { Actionable } from "../action/actionable";
|
|
5
5
|
import { Chained, Proxied } from "../action/chain";
|
|
6
|
-
import { Sentence, SentencePrompt, SentenceUserConfig } from "../elements/character/sentence";
|
|
6
|
+
import { Sentence, SentencePrompt, SentenceUserConfig, SingleWord } from "../elements/character/sentence";
|
|
7
7
|
export type CharacterConfig = {} & Color;
|
|
8
8
|
export type CharacterStateData = {
|
|
9
9
|
name: string;
|
|
@@ -31,10 +31,15 @@ export declare class Character extends Actionable<CharacterStateData, Character>
|
|
|
31
31
|
* "Hello, ",
|
|
32
32
|
* new Word("world", {color: "#f00"}), // Some words can be colored
|
|
33
33
|
* ]));
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* character.say`Hello, ${Word.color("world", "#f00")}!`;
|
|
37
|
+
* ```
|
|
34
38
|
* @chainable
|
|
35
39
|
*/
|
|
36
40
|
say(content: string, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
|
|
37
41
|
say(content: Sentence): Proxied<Character, Chained<LogicAction.Actions>>;
|
|
38
42
|
say(content: SentencePrompt, config?: SentenceUserConfig): Proxied<Character, Chained<LogicAction.Actions>>;
|
|
43
|
+
say(texts: TemplateStringsArray, ...words: SingleWord[]): Proxied<Character, Chained<LogicAction.Actions>>;
|
|
39
44
|
setName(name: string): Proxied<Character, Chained<LogicAction.Actions>>;
|
|
40
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
export default function Isolated({ children, className, props,
|
|
2
|
+
export default function Isolated({ children, className, props, style }: Readonly<{
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
props?: Record<any, any>;
|
|
6
|
-
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
7
|
}>): React.JSX.Element;
|