@vnejs/plugins.scenario.point_and_click 0.2.2 → 0.2.4
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/index.js +3 -3
- package/dist/modules/exec.js +1 -1
- package/dist/modules/point_and_click.d.ts +1 -1
- package/dist/modules/point_and_click.js +1 -1
- package/dist/modules/{scenario.block.js → scenario.js} +1 -1
- package/dist/modules/scenario.module.js +1 -1
- package/dist/modules/scenario.option.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -3
- package/src/modules/exec.ts +1 -1
- package/src/modules/point_and_click.ts +1 -1
- package/src/modules/scenario.module.ts +1 -1
- package/src/modules/scenario.option.ts +1 -1
- package/src/modules/{scenario.block.ts → scenario.ts} +1 -1
- package/src/tests/point_and_click.test.ts +6 -12
- package/src/tests/scenario.test.ts +1 -1
- package/src/tests/setup.ts +3 -3
- package/src/types.ts +1 -3
- /package/dist/modules/{scenario.block.d.ts → scenario.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -5,13 +5,13 @@ import { PointAndClickEmit } from "./modules/emit.js";
|
|
|
5
5
|
import { PointAndClickExec } from "./modules/exec.js";
|
|
6
6
|
import { PointAndClickLogs } from "./modules/logs.js";
|
|
7
7
|
import { PointAndClickOption } from "./modules/option.js";
|
|
8
|
-
import {
|
|
9
|
-
import { PointAndClickScenario } from "./modules/scenario.
|
|
8
|
+
import { PointAndClick } from "./modules/point_and_click.js";
|
|
9
|
+
import { PointAndClickScenario } from "./modules/scenario.js";
|
|
10
10
|
import { PointAndClickScenarioModule } from "./modules/scenario.module.js";
|
|
11
11
|
import { PointAndClickScenarioOption } from "./modules/scenario.option.js";
|
|
12
12
|
import { PointAndClickSkip } from "./modules/skip.js";
|
|
13
13
|
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [
|
|
14
|
-
|
|
14
|
+
PointAndClick,
|
|
15
15
|
PointAndClickEmit,
|
|
16
16
|
PointAndClickOption,
|
|
17
17
|
PointAndClickSkip,
|
package/dist/modules/exec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleReplaceExec } from "@vnejs/module.replace.exec";
|
|
2
2
|
export class PointAndClickExec extends ModuleReplaceExec {
|
|
3
|
-
name = "
|
|
3
|
+
name = "point_and_click.exec";
|
|
4
4
|
EXEC_REG_EVENT = this.EVENTS.POINT_AND_CLICK.EXEC_REG;
|
|
5
5
|
EXEC_GET_EVENT = this.EVENTS.POINT_AND_CLICK.EXEC_GET;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleCore, type ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
2
2
|
import type { PointAndClickPluginConstants, PointAndClickPluginEvents, PointAndClickPluginParams, PointAndClickPluginSettings } from "../types.js";
|
|
3
3
|
import type { PointAndClickPluginModelState } from "../utils/point-and-click.js";
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class PointAndClick extends ModuleCore<PointAndClickPluginEvents, PointAndClickPluginConstants, PointAndClickPluginSettings, PointAndClickPluginParams, PointAndClickPluginModelState> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
7
|
onStateUpdate: (state?: Partial<PointAndClickPluginModelState>) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
-
export class
|
|
2
|
+
export class PointAndClick extends ModuleCore {
|
|
3
3
|
name = "point_and_click";
|
|
4
4
|
subscribe = () => {
|
|
5
5
|
this.on(this.EVENTS.POINT_AND_CLICK.STATE_UPDATE, this.onStateUpdate);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
export class PointAndClickScenario extends ModuleCore {
|
|
3
|
-
name = "
|
|
3
|
+
name = "point_and_click.scenario";
|
|
4
4
|
execName = "point-and-click";
|
|
5
5
|
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { block: this.execName, handler: this.onLineExec });
|
|
6
6
|
onLineExec = async ({ args = {} } = {}) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tokenizeExecLine } from "@vnejs/helpers";
|
|
2
2
|
import { ModuleCore } from "@vnejs/module.core";
|
|
3
3
|
export class PointAndClickScenarioModule extends ModuleCore {
|
|
4
|
-
name = "
|
|
4
|
+
name = "point_and_click.scenario.module";
|
|
5
5
|
execName = "point-and-click";
|
|
6
6
|
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { module: this.execName, handler: this.onLineExec });
|
|
7
7
|
onLineExec = async ({ line = "" } = {}) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getOptionExecShift } from "@vnejs/helpers";
|
|
2
2
|
import { ModuleCore } from "@vnejs/module.core";
|
|
3
3
|
export class PointAndClickScenarioOption extends ModuleCore {
|
|
4
|
-
name = "
|
|
4
|
+
name = "point_and_click.scenario.option";
|
|
5
5
|
execName = "point-and-click";
|
|
6
6
|
init = () => this.emit(this.EVENTS.SCENARIO.LINE_EXEC_REG, { block: `${this.execName}.option`, handler: this.onLineExec });
|
|
7
7
|
onLineExec = async () => {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -7,14 +7,14 @@ import { PointAndClickEmit } from "./modules/emit.js";
|
|
|
7
7
|
import { PointAndClickExec } from "./modules/exec.js";
|
|
8
8
|
import { PointAndClickLogs } from "./modules/logs.js";
|
|
9
9
|
import { PointAndClickOption } from "./modules/option.js";
|
|
10
|
-
import {
|
|
11
|
-
import { PointAndClickScenario } from "./modules/scenario.
|
|
10
|
+
import { PointAndClick } from "./modules/point_and_click.js";
|
|
11
|
+
import { PointAndClickScenario } from "./modules/scenario.js";
|
|
12
12
|
import { PointAndClickScenarioModule } from "./modules/scenario.module.js";
|
|
13
13
|
import { PointAndClickScenarioOption } from "./modules/scenario.option.js";
|
|
14
14
|
import { PointAndClickSkip } from "./modules/skip.js";
|
|
15
15
|
|
|
16
16
|
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [
|
|
17
|
-
|
|
17
|
+
PointAndClick,
|
|
18
18
|
PointAndClickEmit,
|
|
19
19
|
PointAndClickOption,
|
|
20
20
|
PointAndClickSkip,
|
package/src/modules/exec.ts
CHANGED
|
@@ -10,7 +10,7 @@ export class PointAndClickExec extends ModuleReplaceExec<
|
|
|
10
10
|
PointAndClickPluginParams,
|
|
11
11
|
PointAndClickExecGetPayload
|
|
12
12
|
> {
|
|
13
|
-
name = "
|
|
13
|
+
name = "point_and_click.exec";
|
|
14
14
|
|
|
15
15
|
EXEC_REG_EVENT = this.EVENTS.POINT_AND_CLICK.EXEC_REG;
|
|
16
16
|
EXEC_GET_EVENT = this.EVENTS.POINT_AND_CLICK.EXEC_GET;
|
|
@@ -3,7 +3,7 @@ import { ModuleCore, type ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
|
3
3
|
import type { PointAndClickPluginConstants, PointAndClickPluginEvents, PointAndClickPluginParams, PointAndClickPluginSettings } from "../types.js";
|
|
4
4
|
import type { PointAndClickPluginModelState, PointAndClickVisibilityPayload } from "../utils/point-and-click.js";
|
|
5
5
|
|
|
6
|
-
export class
|
|
6
|
+
export class PointAndClick extends ModuleCore<
|
|
7
7
|
PointAndClickPluginEvents,
|
|
8
8
|
PointAndClickPluginConstants,
|
|
9
9
|
PointAndClickPluginSettings,
|
|
@@ -2,26 +2,20 @@ import { beforeEach, describe, expect, it } from "vitest";
|
|
|
2
2
|
|
|
3
3
|
import { spyEvent } from "@vnejs/test-utils";
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
registerPointAndClickPluginVne,
|
|
10
|
-
SCENARIO_EVENTS,
|
|
11
|
-
SUBSCRIBE_EVENTS,
|
|
12
|
-
} from "./setup.js";
|
|
13
|
-
|
|
14
|
-
describe("PointAndClickState", () => {
|
|
5
|
+
import { PointAndClick } from "../modules/point_and_click.js";
|
|
6
|
+
import { createPointAndClickFlowModules, createPointAndClickTestModule, registerPointAndClickPluginVne, SCENARIO_EVENTS, SUBSCRIBE_EVENTS } from "./setup.js";
|
|
7
|
+
|
|
8
|
+
describe("PointAndClick", () => {
|
|
15
9
|
beforeEach(() => {
|
|
16
10
|
registerPointAndClickPluginVne();
|
|
17
11
|
});
|
|
18
12
|
|
|
19
13
|
it("STATE_UPDATE merges partial point_and_click state", async () => {
|
|
20
|
-
const { module, observer } = createPointAndClickTestModule(
|
|
14
|
+
const { module, observer } = createPointAndClickTestModule(PointAndClick);
|
|
21
15
|
|
|
22
16
|
await observer.emit(SUBSCRIBE_EVENTS.STATE_UPDATE, { isShow: true });
|
|
23
17
|
|
|
24
|
-
expect((module as
|
|
18
|
+
expect((module as PointAndClick).state.isShow).toBe(true);
|
|
25
19
|
});
|
|
26
20
|
});
|
|
27
21
|
|
|
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
2
2
|
|
|
3
3
|
import { spyEvent } from "@vnejs/test-utils";
|
|
4
4
|
|
|
5
|
-
import { PointAndClickScenario } from "../modules/scenario.
|
|
5
|
+
import { PointAndClickScenario } from "../modules/scenario.js";
|
|
6
6
|
import { PointAndClickScenarioModule } from "../modules/scenario.module.js";
|
|
7
7
|
import { PointAndClickScenarioOption } from "../modules/scenario.option.js";
|
|
8
8
|
import { createPointAndClickTestModule, registerPointAndClickPluginVne, SCENARIO_EVENTS, SUBSCRIBE_EVENTS } from "./setup.js";
|
package/src/tests/setup.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { createTestModule as baseCreateTestModule, registerCoreVne, registerVneP
|
|
|
5
5
|
|
|
6
6
|
import { PointAndClickEmit } from "../modules/emit.js";
|
|
7
7
|
import { PointAndClickOption } from "../modules/option.js";
|
|
8
|
-
import {
|
|
8
|
+
import { PointAndClick } from "../modules/point_and_click.js";
|
|
9
9
|
import { PointAndClickSkip } from "../modules/skip.js";
|
|
10
10
|
|
|
11
11
|
export const registerPointAndClickPluginVne = () => {
|
|
@@ -37,7 +37,7 @@ export const createPointAndClickTestModule = <T extends Parameters<typeof baseCr
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const createPointAndClickFlowModules = (options: Parameters<typeof baseCreateTestModule>[1] = {}) => {
|
|
40
|
-
const { module: stateModule, observer, state, shared } = createPointAndClickTestModule(
|
|
40
|
+
const { module: stateModule, observer, state, shared } = createPointAndClickTestModule(PointAndClick, options);
|
|
41
41
|
|
|
42
42
|
const attach = <T extends new () => InstanceType<T>>(ModuleClass: T) => {
|
|
43
43
|
const module = new ModuleClass();
|
|
@@ -47,7 +47,7 @@ export const createPointAndClickFlowModules = (options: Parameters<typeof baseCr
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
return {
|
|
50
|
-
stateModule: stateModule as
|
|
50
|
+
stateModule: stateModule as PointAndClick,
|
|
51
51
|
emitModule: attach(PointAndClickEmit),
|
|
52
52
|
optionModule: attach(PointAndClickOption),
|
|
53
53
|
skipModule: attach(PointAndClickSkip),
|
package/src/types.ts
CHANGED
|
@@ -17,9 +17,7 @@ export type PointAndClickPluginEvents = ModuleCoreEvents &
|
|
|
17
17
|
Record<VendorsPluginName, VendorsSubscribeEvents> &
|
|
18
18
|
Record<LogsPluginName, LogsSubscribeEvents>;
|
|
19
19
|
|
|
20
|
-
export type PointAndClickPluginConstants = ModuleCoreConstants &
|
|
21
|
-
Record<PluginName, PointAndClickConstants> &
|
|
22
|
-
Record<ScenarioPluginName, ScenarioConstants>;
|
|
20
|
+
export type PointAndClickPluginConstants = ModuleCoreConstants & Record<PluginName, PointAndClickConstants> & Record<ScenarioPluginName, ScenarioConstants>;
|
|
23
21
|
|
|
24
22
|
export type PointAndClickPluginSettings = ModuleCoreSettings;
|
|
25
23
|
|
|
File without changes
|