@vnejs/compatibility.views.scenario.point_and_click-with-views.scenario.interface 0.2.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/dist/index.d.ts +6 -0
- package/dist/index.js +9 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -0
- package/package.json +43 -0
- package/src/index.ts +14 -0
- package/src/tests/point_and_click.interface.test.ts +19 -0
- package/src/tests/setup.ts +16 -0
- package/src/types.ts +13 -0
- package/tsconfig.json +9 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
3
|
+
export declare class CompatibilityPointAndClickInterface extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
4
|
+
name: string;
|
|
5
|
+
subscribe: () => void;
|
|
6
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import { regModule } from "@vnejs/shared";
|
|
3
|
+
export class CompatibilityPointAndClickInterface extends ModuleCore {
|
|
4
|
+
name = "compatibility.views.scenario.point_and_click-with-views.scenario.interface";
|
|
5
|
+
subscribe = () => {
|
|
6
|
+
this.on(this.EVENTS.POINT_AND_CLICK_VIEW.SHOW_BEFORE, () => void this.emit(this.EVENTS.INTERFACE.HIDE));
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
regModule(CompatibilityPointAndClickInterface);
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as PointAndClickViewPluginName, SubscribeEvents as PointAndClickViewSubscribeEvents } from "@vnejs/contracts.views.scenario.point_and_click";
|
|
3
|
+
import type { PluginName as InterfacePluginName, SubscribeEvents as InterfaceSubscribeEvents } from "@vnejs/contracts.views.scenario.interface";
|
|
4
|
+
export type PluginEvents = ModuleCoreEvents & Record<PointAndClickViewPluginName, PointAndClickViewSubscribeEvents> & Record<InterfacePluginName, InterfaceSubscribeEvents>;
|
|
5
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
6
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
7
|
+
export type PluginParams = ModuleCoreParams;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/compatibility.views.scenario.point_and_click-with-views.scenario.interface",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src",
|
|
18
|
+
"tsconfig.json"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "npx @vnejs/monorepo test",
|
|
22
|
+
"build": "npx @vnejs/monorepo package",
|
|
23
|
+
"publish:major:plugin": "npm run publish:major",
|
|
24
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
25
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
26
|
+
"publish:major": "npx @vnejs/monorepo publish major --access public",
|
|
27
|
+
"publish:minor": "npx @vnejs/monorepo publish minor --access public",
|
|
28
|
+
"publish:patch": "npx @vnejs/monorepo publish patch --access public"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@vnejs/module.core": "~0.2.0",
|
|
34
|
+
"@vnejs/contracts.views.scenario.point_and_click": "~0.2.0",
|
|
35
|
+
"@vnejs/contracts.views.scenario.interface": "~0.2.0",
|
|
36
|
+
"@vnejs/shared": "~0.2.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@vnejs/configs.ts-common": "~0.2.0",
|
|
40
|
+
"@vnejs/configs.vitest": "~0.2.0",
|
|
41
|
+
"@vnejs/test-utils": "~0.2.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import { regModule } from "@vnejs/shared";
|
|
3
|
+
|
|
4
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "./types.js";
|
|
5
|
+
|
|
6
|
+
export class CompatibilityPointAndClickInterface extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
7
|
+
name = "compatibility.views.scenario.point_and_click-with-views.scenario.interface";
|
|
8
|
+
|
|
9
|
+
subscribe = () => {
|
|
10
|
+
this.on(this.EVENTS.POINT_AND_CLICK_VIEW.SHOW_BEFORE, () => void this.emit(this.EVENTS.INTERFACE.HIDE));
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
regModule(CompatibilityPointAndClickInterface);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { spyEvent } from "@vnejs/test-utils";
|
|
4
|
+
|
|
5
|
+
import { CompatibilityPointAndClickInterface } from "../index.js";
|
|
6
|
+
import { createCompatibilityTestModule, INTERFACE_EVENTS, PAC_EVENTS, registerCompatibilityVne } from "./setup.js";
|
|
7
|
+
|
|
8
|
+
describe("CompatibilityPointAndClickInterface", () => {
|
|
9
|
+
beforeEach(() => registerCompatibilityVne());
|
|
10
|
+
|
|
11
|
+
it("POINT_AND_CLICK_VIEW.SHOW_BEFORE emits INTERFACE.HIDE", async () => {
|
|
12
|
+
const { observer } = createCompatibilityTestModule(CompatibilityPointAndClickInterface);
|
|
13
|
+
const hide = spyEvent(observer, INTERFACE_EVENTS.HIDE);
|
|
14
|
+
|
|
15
|
+
await observer.emit(PAC_EVENTS.SHOW_BEFORE);
|
|
16
|
+
|
|
17
|
+
expect(hide).toHaveBeenCalledOnce();
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PARAMS as PAC_VIEW_PARAMS, PLUGIN_NAME as PAC_VIEW, SUBSCRIBE_EVENTS as PAC_VIEW_EVENTS } from "@vnejs/contracts.views.scenario.point_and_click";
|
|
2
|
+
import { SUBSCRIBE_EVENTS as INTERFACE_EVENTS, PLUGIN_NAME as INTERFACE } from "@vnejs/contracts.views.scenario.interface";
|
|
3
|
+
import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/test-utils";
|
|
4
|
+
|
|
5
|
+
export const registerCompatibilityVne = () => {
|
|
6
|
+
registerCoreVne();
|
|
7
|
+
registerVnePlugin(PAC_VIEW, { events: PAC_VIEW_EVENTS, params: PAC_VIEW_PARAMS });
|
|
8
|
+
registerVnePlugin(INTERFACE, { events: INTERFACE_EVENTS });
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const createCompatibilityTestModule = <T extends Parameters<typeof baseCreateTestModule>[0]>(
|
|
12
|
+
ModuleClass: T,
|
|
13
|
+
options: Parameters<typeof baseCreateTestModule>[1] = {},
|
|
14
|
+
) => baseCreateTestModule(ModuleClass, options);
|
|
15
|
+
|
|
16
|
+
export { PAC_VIEW_EVENTS as PAC_EVENTS, INTERFACE_EVENTS };
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as PointAndClickViewPluginName, SubscribeEvents as PointAndClickViewSubscribeEvents } from "@vnejs/contracts.views.scenario.point_and_click";
|
|
3
|
+
import type { PluginName as InterfacePluginName, SubscribeEvents as InterfaceSubscribeEvents } from "@vnejs/contracts.views.scenario.interface";
|
|
4
|
+
|
|
5
|
+
export type PluginEvents = ModuleCoreEvents &
|
|
6
|
+
Record<PointAndClickViewPluginName, PointAndClickViewSubscribeEvents> &
|
|
7
|
+
Record<InterfacePluginName, InterfaceSubscribeEvents>;
|
|
8
|
+
|
|
9
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
10
|
+
|
|
11
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
12
|
+
|
|
13
|
+
export type PluginParams = ModuleCoreParams;
|