@vnejs/bridge.plugins.views.scenario.choose.plugins.views.scenario.interface.fastforward 0.0.0-stage → 0.2.6
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 +1 -0
- package/dist/index.js +4 -0
- package/dist/modules/bridge_plugin_choose_view_plugin_interface_fastforward_view.d.ts +8 -0
- package/dist/modules/bridge_plugin_choose_view_plugin_interface_fastforward_view.js +11 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.js +1 -0
- package/package.json +43 -4
- package/src/index.ts +6 -0
- package/src/modules/bridge_plugin_choose_view_plugin_interface_fastforward_view.ts +17 -0
- package/src/tests/choose.interface.fastforward.test.ts +30 -0
- package/src/tests/setup.ts +16 -0
- package/src/types.ts +16 -0
- package/tsconfig.json +9 -0
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PLUGIN_NAME } from "@vnejs/contracts.bridge.plugins.views.scenario.choose.plugins.views.scenario.interface.fastforward";
|
|
2
|
+
import { regPlugin } from "@vnejs/registry";
|
|
3
|
+
import { BridgePluginChooseViewPluginInterfaceFastforwardView } from "./modules/bridge_plugin_choose_view_plugin_interface_fastforward_view.js";
|
|
4
|
+
regPlugin(PLUGIN_NAME, {}, [BridgePluginChooseViewPluginInterfaceFastforwardView]);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "../types.js";
|
|
3
|
+
export declare class BridgePluginChooseViewPluginInterfaceFastforwardView extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
4
|
+
name: string;
|
|
5
|
+
subscribe: () => void;
|
|
6
|
+
onChooseViewShow: () => undefined;
|
|
7
|
+
onChooseViewHide: () => undefined;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
export class BridgePluginChooseViewPluginInterfaceFastforwardView extends ModuleCore {
|
|
3
|
+
name = "bridge_plugin_choose_view_plugin_interface_fastforward_view";
|
|
4
|
+
subscribe = () => {
|
|
5
|
+
const { SHOW, HIDE } = this.CONST.COMPONENTS.LIFECYCLE_PRIORITY;
|
|
6
|
+
this.on(this.EVENTS.CHOOSE_VIEW.SHOW, this.onChooseViewShow, { priority: SHOW.MAIN });
|
|
7
|
+
this.on(this.EVENTS.CHOOSE_VIEW.HIDE, this.onChooseViewHide, { priority: HIDE.MAIN });
|
|
8
|
+
};
|
|
9
|
+
onChooseViewShow = () => void this.emit(this.EVENTS.INTERFACE_FASTFORWARD_VIEW.DISABLE_ANIMATION, { isDisabled: true });
|
|
10
|
+
onChooseViewHide = () => void this.emit(this.EVENTS.INTERFACE_FASTFORWARD_VIEW.DISABLE_ANIMATION, { isDisabled: false });
|
|
11
|
+
}
|
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 ChooseViewPluginName, SubscribeEvents as ChooseViewSubscribeEvents } from "@vnejs/contracts.views.scenario.choose";
|
|
3
|
+
import type { PluginName as InterfaceFastforwardPluginName, SubscribeEvents as InterfaceFastforwardSubscribeEvents } from "@vnejs/contracts.views.scenario.interface.fastforward";
|
|
4
|
+
export type PluginEvents = ModuleCoreEvents & Record<ChooseViewPluginName, ChooseViewSubscribeEvents> & Record<InterfaceFastforwardPluginName, InterfaceFastforwardSubscribeEvents>;
|
|
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
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/bridge.plugins.views.scenario.choose.plugins.views.scenario.interface.fastforward",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.6",
|
|
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.choose": "~0.2.0",
|
|
35
|
+
"@vnejs/contracts.views.scenario.interface.fastforward": "~0.2.0",
|
|
36
|
+
"@vnejs/registry": "~0.2.0",
|
|
37
|
+
"@vnejs/contracts.bridge.plugins.views.scenario.choose.plugins.views.scenario.interface.fastforward": "~0.2.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@vnejs/configs.ts-common": "~0.2.0",
|
|
41
|
+
"@vnejs/configs.vitest": "~0.2.0",
|
|
42
|
+
"@vnejs/test-utils": "~0.2.0",
|
|
43
|
+
"@vnejs/contracts.bridge.plugins.views.scenario.choose.plugins.views.scenario.interface.fastforward": "~0.2.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PLUGIN_NAME } from "@vnejs/contracts.bridge.plugins.views.scenario.choose.plugins.views.scenario.interface.fastforward";
|
|
2
|
+
import { regPlugin } from "@vnejs/registry";
|
|
3
|
+
|
|
4
|
+
import { BridgePluginChooseViewPluginInterfaceFastforwardView } from "./modules/bridge_plugin_choose_view_plugin_interface_fastforward_view.js";
|
|
5
|
+
|
|
6
|
+
regPlugin(PLUGIN_NAME, {}, [BridgePluginChooseViewPluginInterfaceFastforwardView]);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
|
|
3
|
+
import type { PluginConstants, PluginEvents, PluginParams, PluginSettings } from "../types.js";
|
|
4
|
+
|
|
5
|
+
export class BridgePluginChooseViewPluginInterfaceFastforwardView extends ModuleCore<PluginEvents, PluginConstants, PluginSettings, PluginParams> {
|
|
6
|
+
name = "bridge_plugin_choose_view_plugin_interface_fastforward_view";
|
|
7
|
+
|
|
8
|
+
subscribe = () => {
|
|
9
|
+
const { SHOW, HIDE } = this.CONST.COMPONENTS.LIFECYCLE_PRIORITY;
|
|
10
|
+
|
|
11
|
+
this.on(this.EVENTS.CHOOSE_VIEW.SHOW, this.onChooseViewShow, { priority: SHOW.MAIN });
|
|
12
|
+
this.on(this.EVENTS.CHOOSE_VIEW.HIDE, this.onChooseViewHide, { priority: HIDE.MAIN });
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
onChooseViewShow = () => void this.emit(this.EVENTS.INTERFACE_FASTFORWARD_VIEW.DISABLE_ANIMATION, { isDisabled: true });
|
|
16
|
+
onChooseViewHide = () => void this.emit(this.EVENTS.INTERFACE_FASTFORWARD_VIEW.DISABLE_ANIMATION, { isDisabled: false });
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { spyEvent } from "@vnejs/test-utils";
|
|
4
|
+
|
|
5
|
+
import { BridgePluginChooseViewPluginInterfaceFastforwardView } from "../modules/bridge_plugin_choose_view_plugin_interface_fastforward_view.js";
|
|
6
|
+
import { CHOOSE_EVENTS, createCompatibilityTestModule, INTERFACE_FF_EVENTS, registerCompatibilityVne } from "./setup.js";
|
|
7
|
+
|
|
8
|
+
describe("BridgePluginChooseViewPluginInterfaceFastforwardView", () => {
|
|
9
|
+
beforeEach(() => registerCompatibilityVne());
|
|
10
|
+
|
|
11
|
+
it("CHOOSE_VIEW.SHOW disables interface fastforward animation", async () => {
|
|
12
|
+
const { observer } = createCompatibilityTestModule(BridgePluginChooseViewPluginInterfaceFastforwardView);
|
|
13
|
+
const disable = spyEvent(observer, INTERFACE_FF_EVENTS.DISABLE_ANIMATION);
|
|
14
|
+
|
|
15
|
+
await observer.emit(CHOOSE_EVENTS.SHOW);
|
|
16
|
+
|
|
17
|
+
expect(disable).toHaveBeenCalledOnce();
|
|
18
|
+
expect(disable).toHaveBeenCalledWith({ isDisabled: true });
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("CHOOSE_VIEW.HIDE re-enables interface fastforward animation", async () => {
|
|
22
|
+
const { observer } = createCompatibilityTestModule(BridgePluginChooseViewPluginInterfaceFastforwardView);
|
|
23
|
+
const disable = spyEvent(observer, INTERFACE_FF_EVENTS.DISABLE_ANIMATION);
|
|
24
|
+
|
|
25
|
+
await observer.emit(CHOOSE_EVENTS.HIDE);
|
|
26
|
+
|
|
27
|
+
expect(disable).toHaveBeenCalledOnce();
|
|
28
|
+
expect(disable).toHaveBeenCalledWith({ isDisabled: false });
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PARAMS as CHOOSE_VIEW_PARAMS, PLUGIN_NAME as CHOOSE_VIEW, SUBSCRIBE_EVENTS as CHOOSE_VIEW_EVENTS } from "@vnejs/contracts.views.scenario.choose";
|
|
2
|
+
import { SUBSCRIBE_EVENTS as INTERFACE_FF_EVENTS, PLUGIN_NAME as INTERFACE_FF } from "@vnejs/contracts.views.scenario.interface.fastforward";
|
|
3
|
+
import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin } from "@vnejs/test-utils";
|
|
4
|
+
|
|
5
|
+
export const registerCompatibilityVne = () => {
|
|
6
|
+
registerCoreVne();
|
|
7
|
+
registerVnePlugin(CHOOSE_VIEW, { events: CHOOSE_VIEW_EVENTS, params: CHOOSE_VIEW_PARAMS });
|
|
8
|
+
registerVnePlugin(INTERFACE_FF, { events: INTERFACE_FF_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 { CHOOSE_VIEW_EVENTS as CHOOSE_EVENTS, INTERFACE_FF_EVENTS };
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
2
|
+
import type { PluginName as ChooseViewPluginName, SubscribeEvents as ChooseViewSubscribeEvents } from "@vnejs/contracts.views.scenario.choose";
|
|
3
|
+
import type {
|
|
4
|
+
PluginName as InterfaceFastforwardPluginName,
|
|
5
|
+
SubscribeEvents as InterfaceFastforwardSubscribeEvents,
|
|
6
|
+
} from "@vnejs/contracts.views.scenario.interface.fastforward";
|
|
7
|
+
|
|
8
|
+
export type PluginEvents = ModuleCoreEvents &
|
|
9
|
+
Record<ChooseViewPluginName, ChooseViewSubscribeEvents> &
|
|
10
|
+
Record<InterfaceFastforwardPluginName, InterfaceFastforwardSubscribeEvents>;
|
|
11
|
+
|
|
12
|
+
export type PluginConstants = ModuleCoreConstants;
|
|
13
|
+
|
|
14
|
+
export type PluginSettings = ModuleCoreSettings;
|
|
15
|
+
|
|
16
|
+
export type PluginParams = ModuleCoreParams;
|
package/tsconfig.json
ADDED
package/README.md
DELETED