@vnejs/plugins.views.screens.settings.contract 0.0.2

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,8 @@
1
+ export declare const SUBSCRIBE_EVENTS: {
2
+ readonly SHOW: "vne:settings_view:show";
3
+ readonly HIDE: "vne:settings_view:hide";
4
+ readonly UPDATE: "vne:settings_view:update";
5
+ readonly PRELOAD: "vne:settings_view:preload";
6
+ readonly TAB_SET: "vne:settings_view:tab_set";
7
+ };
8
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/dist/events.js ADDED
@@ -0,0 +1,7 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ SHOW: "vne:settings_view:show",
3
+ HIDE: "vne:settings_view:hide",
4
+ UPDATE: "vne:settings_view:update",
5
+ PRELOAD: "vne:settings_view:preload",
6
+ TAB_SET: "vne:settings_view:tab_set",
7
+ };
@@ -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: "SETTINGS_VIEW";
5
+ export type PluginName = typeof PLUGIN_NAME;
6
+ export { SUBSCRIBE_EVENTS };
7
+ export type { SubscribeEvents } from "./events.js";
8
+ export { PARAMS };
9
+ export type { Params, SettingsAction, SettingsActionContext, SettingsField, SettingsFieldOption, SettingsTab, SettingsValueMap, 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 = "SETTINGS_VIEW";
5
+ export { SUBSCRIBE_EVENTS };
6
+ export { PARAMS };
@@ -0,0 +1,160 @@
1
+ import type { Module } from "@vnejs/module";
2
+ import type { Widen } from "@vnejs/shared";
3
+ export type SettingsValueMap = (value: number) => string;
4
+ export type SettingsActionContext = Pick<Module, "emit" | "emitOne" | "emitReal">;
5
+ export type SettingsAction = (context: SettingsActionContext, locs: Record<string, string>) => void;
6
+ export type SettingsFieldOption = {
7
+ locKey?: string;
8
+ text?: string;
9
+ value?: unknown;
10
+ action?: string;
11
+ };
12
+ export type SettingsField = {
13
+ locKey?: string;
14
+ type?: string;
15
+ settingKey?: string;
16
+ options?: SettingsFieldOption[];
17
+ titleToggledLocKey?: string;
18
+ titleUntoggledLocKey?: string;
19
+ valueMap?: string;
20
+ step?: number;
21
+ min?: number;
22
+ max?: number;
23
+ [key: string]: unknown;
24
+ };
25
+ export type SettingsTab = {
26
+ titleLocKey: string;
27
+ acceptLocKey?: string;
28
+ showInSettings?: boolean;
29
+ showTextExample?: boolean;
30
+ fields: SettingsField[];
31
+ };
32
+ export declare const TRANSITION: number;
33
+ export declare const ZINDEX: number;
34
+ export declare const LOC_LABEL: string;
35
+ export declare const BACKGROUND: string;
36
+ export declare const TABS: Record<string, SettingsTab>;
37
+ export declare const VALUE_MAPS: Record<string, SettingsValueMap>;
38
+ export declare const ACTIONS: Record<string, SettingsAction>;
39
+ declare const VIEW_PROPS_DEFAULT: {
40
+ readonly screen: {
41
+ readonly withBackgroundDark: true;
42
+ readonly withBackgroundBlur: false;
43
+ readonly transition: number;
44
+ readonly zIndex: number;
45
+ };
46
+ readonly background: {
47
+ readonly withDark: true;
48
+ readonly withBlur: false;
49
+ };
50
+ readonly cross: {
51
+ readonly position: {
52
+ readonly bottom: 90;
53
+ readonly right: 120;
54
+ };
55
+ readonly svg: {
56
+ readonly size: 60;
57
+ };
58
+ };
59
+ readonly exampleText: {
60
+ readonly size: 60;
61
+ readonly height: 300;
62
+ readonly color: "var(--vne-color-active)";
63
+ readonly transition: 300;
64
+ };
65
+ readonly fieldsGap: 48;
66
+ readonly fieldProps: {
67
+ readonly widthTitle: 1440;
68
+ readonly width: 3120;
69
+ readonly sizeTitle: 96;
70
+ readonly sizeText: 72;
71
+ readonly gapBetweenItems: 48;
72
+ readonly gapBetweenTitleAndContent: 120;
73
+ readonly gapBetweenInnerItems: 120;
74
+ readonly rangeHeight: 24;
75
+ readonly widthInnerLeft: 960;
76
+ readonly widthInnerRight: 240;
77
+ };
78
+ readonly controls: {
79
+ readonly position: {
80
+ readonly top: 90;
81
+ readonly left: 120;
82
+ };
83
+ readonly props: {
84
+ readonly textWidth: 660;
85
+ readonly wrapWidth: 3600;
86
+ readonly flexGap: 36;
87
+ readonly flexWithWrap: false;
88
+ readonly textSize: 96;
89
+ readonly textAlign: "center";
90
+ };
91
+ };
92
+ };
93
+ export type ViewProps = Widen<typeof VIEW_PROPS_DEFAULT>;
94
+ export declare const VIEW_PROPS: ViewProps;
95
+ declare const PARAMS_DEFAULT: {
96
+ TRANSITION: number;
97
+ ZINDEX: number;
98
+ LOC_LABEL: string;
99
+ BACKGROUND: string;
100
+ TABS: Record<string, SettingsTab>;
101
+ VALUE_MAPS: Record<string, SettingsValueMap>;
102
+ ACTIONS: Record<string, SettingsAction>;
103
+ VIEW_PROPS: {
104
+ screen: {
105
+ withBackgroundDark: boolean;
106
+ withBackgroundBlur: boolean;
107
+ transition: number;
108
+ zIndex: number;
109
+ };
110
+ background: {
111
+ withDark: boolean;
112
+ withBlur: boolean;
113
+ };
114
+ cross: {
115
+ position: {
116
+ bottom: number;
117
+ right: number;
118
+ };
119
+ svg: {
120
+ size: number;
121
+ };
122
+ };
123
+ exampleText: {
124
+ size: number;
125
+ height: number;
126
+ color: "var(--vne-color-active)";
127
+ transition: number;
128
+ };
129
+ fieldsGap: number;
130
+ fieldProps: {
131
+ widthTitle: number;
132
+ width: number;
133
+ sizeTitle: number;
134
+ sizeText: number;
135
+ gapBetweenItems: number;
136
+ gapBetweenTitleAndContent: number;
137
+ gapBetweenInnerItems: number;
138
+ rangeHeight: number;
139
+ widthInnerLeft: number;
140
+ widthInnerRight: number;
141
+ };
142
+ controls: {
143
+ position: {
144
+ top: number;
145
+ left: number;
146
+ };
147
+ props: {
148
+ textWidth: number;
149
+ wrapWidth: number;
150
+ flexGap: number;
151
+ flexWithWrap: boolean;
152
+ textSize: number;
153
+ textAlign: "center";
154
+ };
155
+ };
156
+ };
157
+ };
158
+ export type Params = Widen<typeof PARAMS_DEFAULT>;
159
+ export declare const PARAMS: Params;
160
+ export {};
package/dist/params.js ADDED
@@ -0,0 +1,33 @@
1
+ export const TRANSITION = 500;
2
+ export const ZINDEX = 4000;
3
+ export const LOC_LABEL = "settings";
4
+ export const BACKGROUND = "save";
5
+ export const TABS = {};
6
+ export const VALUE_MAPS = {};
7
+ export const ACTIONS = {};
8
+ const VIEW_PROPS_DEFAULT = {
9
+ screen: { withBackgroundDark: true, withBackgroundBlur: false, transition: TRANSITION, zIndex: ZINDEX },
10
+ background: { withDark: true, withBlur: false },
11
+ cross: { position: { bottom: 90, right: 120 }, svg: { size: 60 } },
12
+ exampleText: { size: 60, height: 300, color: "var(--vne-color-active)", transition: 300 },
13
+ fieldsGap: 48,
14
+ fieldProps: {
15
+ widthTitle: 1440,
16
+ width: 3120,
17
+ sizeTitle: 96,
18
+ sizeText: 72,
19
+ gapBetweenItems: 48,
20
+ gapBetweenTitleAndContent: 120,
21
+ gapBetweenInnerItems: 120,
22
+ rangeHeight: 24,
23
+ widthInnerLeft: 960,
24
+ widthInnerRight: 240,
25
+ },
26
+ controls: {
27
+ position: { top: 90, left: 120 },
28
+ props: { textWidth: 660, wrapWidth: 3600, flexGap: 36, flexWithWrap: false, textSize: 96, textAlign: "center" },
29
+ },
30
+ };
31
+ export const VIEW_PROPS = VIEW_PROPS_DEFAULT;
32
+ const PARAMS_DEFAULT = { TRANSITION, ZINDEX, LOC_LABEL, BACKGROUND, TABS, VALUE_MAPS, ACTIONS, VIEW_PROPS };
33
+ export const PARAMS = PARAMS_DEFAULT;
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@vnejs/plugins.views.screens.settings.contract",
3
+ "version": "0.0.2",
4
+ "description": "Contracts for @vnejs/plugins.views.screens.settings",
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/shared": "~0.0.9",
30
+ "@vnejs/module": "~0.0.1"
31
+ },
32
+ "devDependencies": {
33
+ "@vnejs/configs.ts-common": "~0.0.1"
34
+ }
35
+ }
package/src/events.ts ADDED
@@ -0,0 +1,9 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ SHOW: "vne:settings_view:show",
3
+ HIDE: "vne:settings_view:hide",
4
+ UPDATE: "vne:settings_view:update",
5
+ PRELOAD: "vne:settings_view:preload",
6
+ TAB_SET: "vne:settings_view:tab_set",
7
+ } as const;
8
+
9
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/src/index.ts ADDED
@@ -0,0 +1,24 @@
1
+ import "@vnejs/shared";
2
+ import { SUBSCRIBE_EVENTS } from "./events.js";
3
+ import { PARAMS } from "./params.js";
4
+
5
+ export const PLUGIN_NAME = "SETTINGS_VIEW" as const;
6
+ export type PluginName = typeof PLUGIN_NAME;
7
+ export { SUBSCRIBE_EVENTS };
8
+ export type { SubscribeEvents } from "./events.js";
9
+ export { PARAMS };
10
+ export type {
11
+ Params,
12
+ SettingsAction,
13
+ SettingsActionContext,
14
+ SettingsField,
15
+ SettingsFieldOption,
16
+ SettingsTab,
17
+ SettingsValueMap,
18
+ ViewProps,
19
+ } from "./params.js";
20
+
21
+ declare module "@vnejs/shared" {
22
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
23
+ interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {}
24
+ }
package/src/params.ts ADDED
@@ -0,0 +1,76 @@
1
+ import type { Module } from "@vnejs/module";
2
+ import type { Widen } from "@vnejs/shared";
3
+
4
+ export type SettingsValueMap = (value: number) => string;
5
+
6
+ export type SettingsActionContext = Pick<Module, "emit" | "emitOne" | "emitReal">;
7
+ export type SettingsAction = (context: SettingsActionContext, locs: Record<string, string>) => void;
8
+
9
+ export type SettingsFieldOption = {
10
+ locKey?: string;
11
+ text?: string;
12
+ value?: unknown;
13
+ action?: string;
14
+ };
15
+
16
+ export type SettingsField = {
17
+ locKey?: string;
18
+ type?: string;
19
+ settingKey?: string;
20
+ options?: SettingsFieldOption[];
21
+ titleToggledLocKey?: string;
22
+ titleUntoggledLocKey?: string;
23
+ valueMap?: string;
24
+ step?: number;
25
+ min?: number;
26
+ max?: number;
27
+ [key: string]: unknown;
28
+ };
29
+
30
+ export type SettingsTab = {
31
+ titleLocKey: string;
32
+ acceptLocKey?: string;
33
+ showInSettings?: boolean;
34
+ showTextExample?: boolean;
35
+ fields: SettingsField[];
36
+ };
37
+
38
+ export const TRANSITION: number = 500;
39
+ export const ZINDEX: number = 4000;
40
+ export const LOC_LABEL: string = "settings";
41
+ export const BACKGROUND: string = "save";
42
+
43
+ export const TABS: Record<string, SettingsTab> = {};
44
+ export const VALUE_MAPS: Record<string, SettingsValueMap> = {};
45
+ export const ACTIONS: Record<string, SettingsAction> = {};
46
+
47
+ const VIEW_PROPS_DEFAULT = {
48
+ screen: { withBackgroundDark: true, withBackgroundBlur: false, transition: TRANSITION, zIndex: ZINDEX },
49
+ background: { withDark: true, withBlur: false },
50
+ cross: { position: { bottom: 90, right: 120 }, svg: { size: 60 } },
51
+ exampleText: { size: 60, height: 300, color: "var(--vne-color-active)", transition: 300 },
52
+ fieldsGap: 48,
53
+ fieldProps: {
54
+ widthTitle: 1440,
55
+ width: 3120,
56
+ sizeTitle: 96,
57
+ sizeText: 72,
58
+ gapBetweenItems: 48,
59
+ gapBetweenTitleAndContent: 120,
60
+ gapBetweenInnerItems: 120,
61
+ rangeHeight: 24,
62
+ widthInnerLeft: 960,
63
+ widthInnerRight: 240,
64
+ },
65
+ controls: {
66
+ position: { top: 90, left: 120 },
67
+ props: { textWidth: 660, wrapWidth: 3600, flexGap: 36, flexWithWrap: false, textSize: 96, textAlign: "center" as const },
68
+ },
69
+ } as const;
70
+
71
+ export type ViewProps = Widen<typeof VIEW_PROPS_DEFAULT>;
72
+ export const VIEW_PROPS: ViewProps = VIEW_PROPS_DEFAULT;
73
+
74
+ const PARAMS_DEFAULT = { TRANSITION, ZINDEX, LOC_LABEL, BACKGROUND, TABS, VALUE_MAPS, ACTIONS, VIEW_PROPS };
75
+ export type Params = Widen<typeof PARAMS_DEFAULT>;
76
+ 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
+ }