@vnejs/plugins.text.wall 0.2.1 → 0.2.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.
|
@@ -4,6 +4,6 @@ import type { ModuleGlobalStateTextWall } from "@vnejs/contracts.text.wall";
|
|
|
4
4
|
import type { TextWallPluginConstants, TextWallPluginEvents, TextWallPluginParams, TextWallPluginSettings } from "../types.js";
|
|
5
5
|
export declare class TextWallEmitBefore extends ModuleCore<TextWallPluginEvents, TextWallPluginConstants, TextWallPluginSettings, TextWallPluginParams, ModuleGlobalStateTextWall> {
|
|
6
6
|
name: string;
|
|
7
|
-
init: () => Promise<
|
|
8
|
-
onTextEmitBefore: ({ isExtend }?: TextEmitBeforePayload) => Promise<
|
|
7
|
+
init: () => Promise<import("@vnejs/shared").EmitResults<"vne:text:emit_before_reg">> | undefined;
|
|
8
|
+
onTextEmitBefore: ({ isExtend }?: TextEmitBeforePayload) => Promise<import("@vnejs/shared").EmitResults<"vne:text_wall:state_update"> | undefined>;
|
|
9
9
|
}
|
package/dist/modules/exec.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { LineExecHandlerArg } from "@vnejs/module.core";
|
|
|
4
4
|
import type { TextWallPluginConstants, TextWallPluginEvents, TextWallPluginParams, TextWallPluginSettings } from "../types.js";
|
|
5
5
|
export declare class TextWallExec extends ModuleCore<TextWallPluginEvents, TextWallPluginConstants, TextWallPluginSettings, TextWallPluginParams, ModuleGlobalStateTextWall> {
|
|
6
6
|
name: string;
|
|
7
|
-
init: () => Promise<
|
|
7
|
+
init: () => Promise<import("@vnejs/shared").EmitResults<"vne:scenario:line_exec_reg">> | undefined;
|
|
8
8
|
onLineExec: ({ line }?: LineExecHandlerArg) => Promise<void>;
|
|
9
|
-
emitAction: (action: string) => Promise<
|
|
9
|
+
emitAction: (action: string) => Promise<import("@vnejs/shared").EmitResults<"vne:text_wall:state_update">> | undefined;
|
|
10
10
|
}
|
package/dist/modules/recalc.js
CHANGED
|
@@ -18,5 +18,5 @@ export class TextWallRecalc extends ModuleCore {
|
|
|
18
18
|
tokens.push(...tokenizeText(await this.getRealText(wallObj.texts[i].text, wallObj.texts[i].args)));
|
|
19
19
|
return { ...wallObj, tokens };
|
|
20
20
|
};
|
|
21
|
-
getRealText = (text, args) => this.emitOne(this.EVENTS.TEXT.REPLACE, { text, args, label: this.globalState.scenario.label, state: this.globalState });
|
|
21
|
+
getRealText = async (text, args) => (await this.emitOne(this.EVENTS.TEXT.REPLACE, { text, args, label: this.globalState.scenario.label, state: this.globalState })) ?? "";
|
|
22
22
|
}
|
package/dist/modules/wall.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
3
|
-
import type { ModuleGlobalStateTextWall } from "@vnejs/contracts.text.wall";
|
|
3
|
+
import type { ModuleGlobalStateTextWall, TextWallStateUpdatePayload } from "@vnejs/contracts.text.wall";
|
|
4
4
|
import type { TextWallPluginConstants, TextWallPluginEvents, TextWallPluginParams, TextWallPluginSettings } from "../types.js";
|
|
5
5
|
export declare class TextWall extends ModuleCore<TextWallPluginEvents, TextWallPluginConstants, TextWallPluginSettings, TextWallPluginParams, ModuleGlobalStateTextWall> {
|
|
6
6
|
name: string;
|
|
7
7
|
subscribe: () => void;
|
|
8
|
-
|
|
9
|
-
onStateUpdate: (payload
|
|
8
|
+
postinject: () => void;
|
|
9
|
+
onStateUpdate: (payload?: TextWallStateUpdatePayload) => void;
|
|
10
10
|
onStateSet: (payload: ModuleGlobalStateRegistry) => Promise<void>;
|
|
11
|
-
onStateClear: () => Promise<
|
|
11
|
+
onStateClear: () => Promise<import("@vnejs/shared").EmitResults<"vne:text_wall:changed"> | undefined>;
|
|
12
12
|
getDefaultState: () => ModuleGlobalStateTextWall;
|
|
13
13
|
}
|
package/dist/modules/wall.js
CHANGED
|
@@ -6,10 +6,10 @@ export class TextWall extends ModuleCore {
|
|
|
6
6
|
this.on(this.EVENTS.STATE.CLEAR, this.onStateClear);
|
|
7
7
|
this.on(this.EVENTS.STATE.SET, this.onStateSet);
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
postinject = () => {
|
|
10
10
|
this.shared.isTextWallSetStateInProcess = false;
|
|
11
11
|
};
|
|
12
|
-
onStateUpdate = (payload) => this.updateState(payload);
|
|
12
|
+
onStateUpdate = (payload = {}) => this.updateState(payload);
|
|
13
13
|
onStateSet = async (payload) => {
|
|
14
14
|
this.shared.isTextWallSetStateInProcess = true;
|
|
15
15
|
await this.onSetStateClone(payload);
|
package/package.json
CHANGED
package/src/modules/recalc.ts
CHANGED
|
@@ -35,6 +35,6 @@ export class TextWallRecalc extends ModuleCore<
|
|
|
35
35
|
|
|
36
36
|
return { ...wallObj, tokens };
|
|
37
37
|
};
|
|
38
|
-
getRealText = (text: string, args: Record<string, unknown>) =>
|
|
39
|
-
this.emitOne(this.EVENTS.TEXT.REPLACE, { text, args, label: this.globalState.scenario.label, state: this.globalState })
|
|
38
|
+
getRealText = async (text: string, args: Record<string, unknown>) =>
|
|
39
|
+
(await this.emitOne(this.EVENTS.TEXT.REPLACE, { text, args, label: this.globalState.scenario.label, state: this.globalState })) ?? "";
|
|
40
40
|
}
|
package/src/modules/wall.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
3
3
|
|
|
4
|
-
import type { ModuleGlobalStateTextWall } from "@vnejs/contracts.text.wall";
|
|
4
|
+
import type { ModuleGlobalStateTextWall, TextWallStateUpdatePayload } from "@vnejs/contracts.text.wall";
|
|
5
5
|
|
|
6
6
|
import type { TextWallPluginConstants, TextWallPluginEvents, TextWallPluginParams, TextWallPluginSettings } from "../types.js";
|
|
7
7
|
|
|
@@ -21,11 +21,11 @@ export class TextWall extends ModuleCore<
|
|
|
21
21
|
this.on(this.EVENTS.STATE.SET, this.onStateSet);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
postinject = () => {
|
|
25
25
|
this.shared.isTextWallSetStateInProcess = false;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
onStateUpdate = (payload:
|
|
28
|
+
onStateUpdate = (payload: TextWallStateUpdatePayload = {}) => this.updateState(payload);
|
|
29
29
|
|
|
30
30
|
onStateSet = async (payload: ModuleGlobalStateRegistry) => {
|
|
31
31
|
this.shared.isTextWallSetStateInProcess = true;
|