@vnejs/contracts.views.screens.mainmenu 0.1.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.
@@ -0,0 +1,9 @@
1
+ export declare const SUBSCRIBE_EVENTS: {
2
+ readonly HIDE: "vne:mainmenu:hide";
3
+ readonly SHOW: "vne:mainmenu:show";
4
+ readonly ITEMS: "vne:mainmenu:items";
5
+ readonly CLICK: "vne:mainmenu:click";
6
+ readonly ACCEPT: "vne:mainmenu:accept";
7
+ readonly UPDATE: "vne:mainmenu:update";
8
+ };
9
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/dist/events.js ADDED
@@ -0,0 +1,8 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ HIDE: "vne:mainmenu:hide",
3
+ SHOW: "vne:mainmenu:show",
4
+ ITEMS: "vne:mainmenu:items",
5
+ CLICK: "vne:mainmenu:click",
6
+ ACCEPT: "vne:mainmenu:accept",
7
+ UPDATE: "vne:mainmenu:update",
8
+ };
@@ -0,0 +1,15 @@
1
+ import "@vnejs/shared";
2
+ import { SUBSCRIBE_EVENTS } from "./events.js";
3
+ import { PARAMS } from "./params.js";
4
+ export declare const PLUGIN_NAME: "MAINMENU";
5
+ export type PluginName = typeof PLUGIN_NAME;
6
+ export { SUBSCRIBE_EVENTS };
7
+ export type { SubscribeEvents } from "./events.js";
8
+ export { PARAMS };
9
+ export type { MainMenuItem, MainMenuItemFactory, Params, ViewProps } from "./params.js";
10
+ declare module "@vnejs/shared" {
11
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
12
+ }
13
+ interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {
14
+ }
15
+ }
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import "@vnejs/shared";
2
+ import { SUBSCRIBE_EVENTS } from "./events.js";
3
+ import { PARAMS } from "./params.js";
4
+ export const PLUGIN_NAME = "MAINMENU";
5
+ export { SUBSCRIBE_EVENTS };
6
+ export { PARAMS };
@@ -0,0 +1,66 @@
1
+ import type { Module } from "@vnejs/module";
2
+ import type { PositionBoxProps, WidenViewProps } from "@vnejs/uis.react.position-box";
3
+ export type MainMenuItem = {
4
+ locKey: string;
5
+ onClick?: () => void | Promise<void>;
6
+ isDisabled?: boolean;
7
+ isHided?: boolean;
8
+ };
9
+ export type MainMenuItemFactory = (module: Module) => MainMenuItem;
10
+ export declare const PRELOAD_LABELS: string[];
11
+ export declare const PRELOAD_EVENTS: string[];
12
+ export declare const ITEMS: MainMenuItemFactory[];
13
+ export declare const BACKGROUND: string;
14
+ export declare const BACKGROUNDS: string[];
15
+ export declare const BACKGROUNDS_INTERVAL: number;
16
+ export declare const TRANSITION: number;
17
+ export declare const ZINDEX: number;
18
+ export declare const LOC_LABEL: string;
19
+ declare const VIEW_PROPS_DEFAULT: {
20
+ readonly screen: {
21
+ readonly withBackgroundDark: false;
22
+ readonly withBackgroundBlur: false;
23
+ readonly zIndex: number;
24
+ readonly transition: number;
25
+ };
26
+ readonly controls: {
27
+ readonly position: PositionBoxProps;
28
+ readonly props: {
29
+ readonly textSize: 96;
30
+ readonly flexGap: 60;
31
+ readonly flexDirection: "column";
32
+ };
33
+ };
34
+ };
35
+ export type ViewProps = WidenViewProps<typeof VIEW_PROPS_DEFAULT>;
36
+ export declare const VIEW_PROPS: ViewProps;
37
+ declare const PARAMS_DEFAULT: {
38
+ PRELOAD_LABELS: string[];
39
+ PRELOAD_EVENTS: string[];
40
+ ITEMS: MainMenuItemFactory[];
41
+ BACKGROUND: string;
42
+ BACKGROUNDS: string[];
43
+ BACKGROUNDS_INTERVAL: number;
44
+ TRANSITION: number;
45
+ ZINDEX: number;
46
+ LOC_LABEL: string;
47
+ VIEW_PROPS: {
48
+ screen: {
49
+ withBackgroundDark: boolean;
50
+ withBackgroundBlur: boolean;
51
+ zIndex: number;
52
+ transition: number;
53
+ };
54
+ controls: {
55
+ position: PositionBoxProps<unknown>;
56
+ props: {
57
+ textSize: number;
58
+ flexGap: number;
59
+ flexDirection: "column";
60
+ };
61
+ };
62
+ };
63
+ };
64
+ export type Params = WidenViewProps<typeof PARAMS_DEFAULT>;
65
+ export declare const PARAMS: Params;
66
+ export {};
package/dist/params.js ADDED
@@ -0,0 +1,30 @@
1
+ export const PRELOAD_LABELS = [];
2
+ export const PRELOAD_EVENTS = [];
3
+ export const ITEMS = [];
4
+ export const BACKGROUND = "loading";
5
+ export const BACKGROUNDS = [];
6
+ export const BACKGROUNDS_INTERVAL = 0;
7
+ export const TRANSITION = 500;
8
+ export const ZINDEX = 3000;
9
+ export const LOC_LABEL = "mainMenu";
10
+ const VIEW_PROPS_DEFAULT = {
11
+ screen: { withBackgroundDark: false, withBackgroundBlur: false, zIndex: ZINDEX, transition: TRANSITION },
12
+ controls: {
13
+ position: { bottom: 240, left: 240 },
14
+ props: { textSize: 96, flexGap: 60, flexDirection: "column" },
15
+ },
16
+ };
17
+ export const VIEW_PROPS = VIEW_PROPS_DEFAULT;
18
+ const PARAMS_DEFAULT = {
19
+ PRELOAD_LABELS,
20
+ PRELOAD_EVENTS,
21
+ ITEMS,
22
+ BACKGROUND,
23
+ BACKGROUNDS,
24
+ BACKGROUNDS_INTERVAL,
25
+ TRANSITION,
26
+ ZINDEX,
27
+ LOC_LABEL,
28
+ VIEW_PROPS,
29
+ };
30
+ export const PARAMS = PARAMS_DEFAULT;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@vnejs/contracts.views.screens.mainmenu",
3
+ "version": "0.1.1",
4
+ "description": "Contracts for @vnejs/plugins.views.screens.mainmenu",
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
+ "build": "npx @vnejs/monorepo package",
22
+ "publish:major": "npx @vnejs/monorepo publish major --access public",
23
+ "publish:minor": "npx @vnejs/monorepo publish minor --access public",
24
+ "publish:patch": "npx @vnejs/monorepo publish patch --access public"
25
+ },
26
+ "author": "",
27
+ "license": "ISC",
28
+ "peerDependencies": {
29
+ "@vnejs/module": "~0.1.0",
30
+ "@vnejs/shared": "~0.1.0",
31
+ "@vnejs/uis.react.position-box": "~0.1.0"
32
+ },
33
+ "devDependencies": {
34
+ "@vnejs/configs.ts-common": "~0.1.0"
35
+ }
36
+ }
package/src/events.ts ADDED
@@ -0,0 +1,11 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ HIDE: "vne:mainmenu:hide",
3
+ SHOW: "vne:mainmenu:show",
4
+ ITEMS: "vne:mainmenu:items",
5
+
6
+ CLICK: "vne:mainmenu:click",
7
+ ACCEPT: "vne:mainmenu:accept",
8
+ UPDATE: "vne:mainmenu:update",
9
+ } as const;
10
+
11
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/src/index.ts ADDED
@@ -0,0 +1,18 @@
1
+ import "@vnejs/shared";
2
+
3
+ import { SUBSCRIBE_EVENTS } from "./events.js";
4
+ import { PARAMS } from "./params.js";
5
+
6
+ export const PLUGIN_NAME = "MAINMENU" as const;
7
+ export type PluginName = typeof PLUGIN_NAME;
8
+
9
+ export { SUBSCRIBE_EVENTS };
10
+ export type { SubscribeEvents } from "./events.js";
11
+ export { PARAMS };
12
+ export type { MainMenuItem, MainMenuItemFactory, Params, ViewProps } from "./params.js";
13
+
14
+ declare module "@vnejs/shared" {
15
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
16
+
17
+ interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {}
18
+ }
package/src/params.ts ADDED
@@ -0,0 +1,52 @@
1
+ import type { Module } from "@vnejs/module";
2
+ import type { PositionBoxProps, WidenViewProps } from "@vnejs/uis.react.position-box";
3
+
4
+ export type MainMenuItem = {
5
+ locKey: string;
6
+ onClick?: () => void | Promise<void>;
7
+ isDisabled?: boolean;
8
+ isHided?: boolean;
9
+ };
10
+
11
+ export type MainMenuItemFactory = (module: Module) => MainMenuItem;
12
+
13
+ export const PRELOAD_LABELS: string[] = [];
14
+ export const PRELOAD_EVENTS: string[] = [];
15
+
16
+ export const ITEMS: MainMenuItemFactory[] = [];
17
+
18
+ export const BACKGROUND: string = "loading";
19
+
20
+ export const BACKGROUNDS: string[] = [];
21
+ export const BACKGROUNDS_INTERVAL: number = 0;
22
+
23
+ export const TRANSITION: number = 500;
24
+ export const ZINDEX: number = 3000;
25
+ export const LOC_LABEL: string = "mainMenu";
26
+
27
+ const VIEW_PROPS_DEFAULT = {
28
+ screen: { withBackgroundDark: false, withBackgroundBlur: false, zIndex: ZINDEX, transition: TRANSITION },
29
+ controls: {
30
+ position: { bottom: 240, left: 240 } as PositionBoxProps,
31
+ props: { textSize: 96, flexGap: 60, flexDirection: "column" as const },
32
+ },
33
+ } as const;
34
+
35
+ export type ViewProps = WidenViewProps<typeof VIEW_PROPS_DEFAULT>;
36
+ export const VIEW_PROPS: ViewProps = VIEW_PROPS_DEFAULT;
37
+
38
+ const PARAMS_DEFAULT = {
39
+ PRELOAD_LABELS,
40
+ PRELOAD_EVENTS,
41
+ ITEMS,
42
+ BACKGROUND,
43
+ BACKGROUNDS,
44
+ BACKGROUNDS_INTERVAL,
45
+ TRANSITION,
46
+ ZINDEX,
47
+ LOC_LABEL,
48
+ VIEW_PROPS,
49
+ };
50
+
51
+ export type Params = WidenViewProps<typeof PARAMS_DEFAULT>;
52
+ export const PARAMS: Params = PARAMS_DEFAULT;
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@vnejs/configs.ts-common/tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["dist", "node_modules"]
9
+ }