@vnejs/plugins.text.wall 0.1.2 → 0.1.3
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/dist/modules/wall.d.ts +1 -1
- package/dist/modules/wall.js +5 -2
- package/package.json +1 -1
- package/src/modules/wall.ts +5 -2
package/dist/modules/wall.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare class TextWall extends ModuleCore<TextWallPluginEvents, TextWallP
|
|
|
20
20
|
texts: import("@vnejs/contracts.text").TextItem[];
|
|
21
21
|
uid: string;
|
|
22
22
|
speaker: string;
|
|
23
|
-
|
|
23
|
+
speakerInfo: import("@vnejs/contracts.text").TextSpeakerEntry;
|
|
24
24
|
}>;
|
|
25
25
|
getDefaultState: () => ModuleGlobalStateTextWall;
|
|
26
26
|
}
|
package/dist/modules/wall.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import { tokenizeExecLine, tokenizeText } from "@vnejs/helpers";
|
|
3
|
+
import { getTextSpeakerInfo } from "@vnejs/contracts.text";
|
|
3
4
|
export class TextWall extends ModuleCore {
|
|
4
5
|
name = "text.wall";
|
|
5
6
|
subscribe = () => {
|
|
@@ -29,9 +30,11 @@ export class TextWall extends ModuleCore {
|
|
|
29
30
|
if (this.state.shouldSkip)
|
|
30
31
|
return this.updateState({ shouldSkip: false });
|
|
31
32
|
const { texts, tokens, uid } = this.globalState.text;
|
|
32
|
-
const
|
|
33
|
+
const speakerState = this.globalState["text.speaker"];
|
|
34
|
+
const { speaker } = speakerState;
|
|
35
|
+
const speakerInfo = await this.emitClone(getTextSpeakerInfo(speakerState, speaker));
|
|
33
36
|
const wall = await this.emitClone(this.state.wall);
|
|
34
|
-
const wallElement = await this.emitClone({ texts, tokens, uid, speaker,
|
|
37
|
+
const wallElement = await this.emitClone({ texts, tokens, uid, speaker, speakerInfo });
|
|
35
38
|
this.updateState({ wall: [...wall, wallElement] });
|
|
36
39
|
await this.emitWallChanged();
|
|
37
40
|
};
|
package/package.json
CHANGED
package/src/modules/wall.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
|
3
3
|
import { tokenizeExecLine, tokenizeText } from "@vnejs/helpers";
|
|
4
4
|
|
|
5
5
|
import type { TextEmitBeforePayload, TokenizedChar } from "@vnejs/contracts.text";
|
|
6
|
+
import { getTextSpeakerInfo } from "@vnejs/contracts.text";
|
|
6
7
|
import type { ModuleGlobalStateTextWall, WallElement } from "@vnejs/contracts.text.wall";
|
|
7
8
|
import type { LineExecHandlerArg } from "@vnejs/module.core";
|
|
8
9
|
|
|
@@ -49,10 +50,12 @@ export class TextWall extends ModuleCore<
|
|
|
49
50
|
if (this.state.shouldSkip) return this.updateState({ shouldSkip: false });
|
|
50
51
|
|
|
51
52
|
const { texts, tokens, uid } = this.globalState.text;
|
|
52
|
-
const
|
|
53
|
+
const speakerState = this.globalState["text.speaker"];
|
|
54
|
+
const { speaker } = speakerState;
|
|
55
|
+
const speakerInfo = await this.emitClone(getTextSpeakerInfo(speakerState, speaker));
|
|
53
56
|
|
|
54
57
|
const wall = await this.emitClone<WallElement[]>(this.state.wall);
|
|
55
|
-
const wallElement = await this.emitClone<WallElement>({ texts, tokens, uid, speaker,
|
|
58
|
+
const wallElement = await this.emitClone<WallElement>({ texts, tokens, uid, speaker, speakerInfo });
|
|
56
59
|
|
|
57
60
|
this.updateState({ wall: [...wall, wallElement] });
|
|
58
61
|
|