@vnejs/contracts.canvas.child.fill 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,15 @@
1
+ export declare const ACTIONS: {
2
+ readonly SHOW: "show";
3
+ readonly CHANGE: "change";
4
+ readonly HIDE: "hide";
5
+ };
6
+ export declare const LAYER_CHILD_TYPE: "fill";
7
+ export declare const CONSTANTS: {
8
+ readonly ACTIONS: {
9
+ readonly SHOW: "show";
10
+ readonly CHANGE: "change";
11
+ readonly HIDE: "hide";
12
+ };
13
+ readonly LAYER_CHILD_TYPE: "fill";
14
+ };
15
+ export type Constants = typeof CONSTANTS;
package/dist/const.js ADDED
@@ -0,0 +1,6 @@
1
+ export const ACTIONS = { SHOW: "show", CHANGE: "change", HIDE: "hide" };
2
+ export const LAYER_CHILD_TYPE = "fill";
3
+ export const CONSTANTS = {
4
+ ACTIONS,
5
+ LAYER_CHILD_TYPE,
6
+ };
@@ -0,0 +1,10 @@
1
+ export declare const SUBSCRIBE_EVENTS: {
2
+ readonly SHOW: "vne:layer_fill:show";
3
+ readonly CHANGE: "vne:layer_fill:change";
4
+ readonly HIDE: "vne:layer_fill:hide";
5
+ readonly STATE_UPDATE: "vne:layer_fill:state_update";
6
+ readonly STATE_GET: "vne:layer_fill:state_get";
7
+ readonly STATE_ADD: "vne:layer_fill:state_add";
8
+ readonly STATE_RM: "vne:layer_fill:state_rm";
9
+ };
10
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/dist/events.js ADDED
@@ -0,0 +1,9 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ SHOW: "vne:layer_fill:show",
3
+ CHANGE: "vne:layer_fill:change",
4
+ HIDE: "vne:layer_fill:hide",
5
+ STATE_UPDATE: "vne:layer_fill:state_update",
6
+ STATE_GET: "vne:layer_fill:state_get",
7
+ STATE_ADD: "vne:layer_fill:state_add",
8
+ STATE_RM: "vne:layer_fill:state_rm",
9
+ };
@@ -0,0 +1,20 @@
1
+ import "@vnejs/shared";
2
+ import { CONSTANTS } from "./const.js";
3
+ import { SUBSCRIBE_EVENTS } from "./events.js";
4
+ import { PARAMS } from "./params.js";
5
+ export declare const PLUGIN_NAME: "LAYER_FILL";
6
+ export type PluginName = typeof PLUGIN_NAME;
7
+ export { CONSTANTS, ACTIONS, LAYER_CHILD_TYPE } from "./const.js";
8
+ export type { Constants } from "./const.js";
9
+ export { SUBSCRIBE_EVENTS };
10
+ export type { SubscribeEvents } from "./events.js";
11
+ export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITIONS_CHANGE } from "./params.js";
12
+ export type { Params, FillTransitionProps } from "./params.js";
13
+ declare module "@vnejs/shared" {
14
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
15
+ }
16
+ interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {
17
+ }
18
+ interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {
19
+ }
20
+ }
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import "@vnejs/shared";
2
+ import { SUBSCRIBE_EVENTS } from "./events.js";
3
+ export const PLUGIN_NAME = "LAYER_FILL";
4
+ export { CONSTANTS, ACTIONS, LAYER_CHILD_TYPE } from "./const.js";
5
+ export { SUBSCRIBE_EVENTS };
6
+ export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITIONS_CHANGE } from "./params.js";
@@ -0,0 +1,16 @@
1
+ import type { Widen } from "@vnejs/shared";
2
+ export type FillTransitionProps = {
3
+ initialProps?: Record<string, unknown>;
4
+ finishProps?: Record<string, unknown>;
5
+ };
6
+ export declare const TRANSITIONS_SHOW: Record<string, (duration: number) => FillTransitionProps>;
7
+ export declare const TRANSITIONS_HIDE: Record<string, (duration: number) => FillTransitionProps>;
8
+ export declare const TRANSITIONS_CHANGE: Record<string, (duration: number) => FillTransitionProps>;
9
+ declare const PARAMS_DEFAULT: {
10
+ TRANSITIONS_SHOW: Record<string, (duration: number) => FillTransitionProps>;
11
+ TRANSITIONS_HIDE: Record<string, (duration: number) => FillTransitionProps>;
12
+ TRANSITIONS_CHANGE: Record<string, (duration: number) => FillTransitionProps>;
13
+ };
14
+ export type Params = Widen<typeof PARAMS_DEFAULT>;
15
+ export declare const PARAMS: Params;
16
+ export {};
package/dist/params.js ADDED
@@ -0,0 +1,15 @@
1
+ export const TRANSITIONS_SHOW = {
2
+ opacity: (duration) => ({ initialProps: { opacity: 0, transition: duration }, finishProps: { opacity: 1 } }),
3
+ };
4
+ export const TRANSITIONS_HIDE = {
5
+ opacity: (duration) => ({ initialProps: { transition: duration }, finishProps: { opacity: 0 } }),
6
+ };
7
+ export const TRANSITIONS_CHANGE = {
8
+ opacity: (duration) => ({ initialProps: { transition: duration }, finishProps: {} }),
9
+ };
10
+ const PARAMS_DEFAULT = {
11
+ TRANSITIONS_SHOW,
12
+ TRANSITIONS_HIDE,
13
+ TRANSITIONS_CHANGE,
14
+ };
15
+ export const PARAMS = PARAMS_DEFAULT;
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@vnejs/contracts.canvas.child.fill",
3
+ "version": "0.1.1",
4
+ "description": "Contracts for @vnejs/plugins.canvas.child.fill",
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.1.0"
30
+ },
31
+ "devDependencies": {
32
+ "@vnejs/configs.ts-common": "~0.1.0"
33
+ }
34
+ }
package/src/const.ts ADDED
@@ -0,0 +1,10 @@
1
+ export const ACTIONS = { SHOW: "show", CHANGE: "change", HIDE: "hide" } as const;
2
+
3
+ export const LAYER_CHILD_TYPE = "fill" as const;
4
+
5
+ export const CONSTANTS = {
6
+ ACTIONS,
7
+ LAYER_CHILD_TYPE,
8
+ } as const;
9
+
10
+ export type Constants = typeof CONSTANTS;
package/src/events.ts ADDED
@@ -0,0 +1,12 @@
1
+ export const SUBSCRIBE_EVENTS = {
2
+ SHOW: "vne:layer_fill:show",
3
+ CHANGE: "vne:layer_fill:change",
4
+ HIDE: "vne:layer_fill:hide",
5
+
6
+ STATE_UPDATE: "vne:layer_fill:state_update",
7
+ STATE_GET: "vne:layer_fill:state_get",
8
+ STATE_ADD: "vne:layer_fill:state_add",
9
+ STATE_RM: "vne:layer_fill:state_rm",
10
+ } as const;
11
+
12
+ export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
package/src/index.ts ADDED
@@ -0,0 +1,23 @@
1
+ import "@vnejs/shared";
2
+
3
+ import { CONSTANTS } from "./const.js";
4
+ import { SUBSCRIBE_EVENTS } from "./events.js";
5
+ import { PARAMS } from "./params.js";
6
+
7
+ export const PLUGIN_NAME = "LAYER_FILL" as const;
8
+ export type PluginName = typeof PLUGIN_NAME;
9
+
10
+ export { CONSTANTS, ACTIONS, LAYER_CHILD_TYPE } from "./const.js";
11
+ export type { Constants } from "./const.js";
12
+ export { SUBSCRIBE_EVENTS };
13
+ export type { SubscribeEvents } from "./events.js";
14
+ export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITIONS_CHANGE } from "./params.js";
15
+ export type { Params, FillTransitionProps } from "./params.js";
16
+
17
+ declare module "@vnejs/shared" {
18
+ interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
19
+
20
+ interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {}
21
+
22
+ interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {}
23
+ }
package/src/params.ts ADDED
@@ -0,0 +1,27 @@
1
+ import type { Widen } from "@vnejs/shared";
2
+
3
+ export type FillTransitionProps = {
4
+ initialProps?: Record<string, unknown>;
5
+ finishProps?: Record<string, unknown>;
6
+ };
7
+
8
+ export const TRANSITIONS_SHOW: Record<string, (duration: number) => FillTransitionProps> = {
9
+ opacity: (duration) => ({ initialProps: { opacity: 0, transition: duration }, finishProps: { opacity: 1 } }),
10
+ };
11
+
12
+ export const TRANSITIONS_HIDE: Record<string, (duration: number) => FillTransitionProps> = {
13
+ opacity: (duration) => ({ initialProps: { transition: duration }, finishProps: { opacity: 0 } }),
14
+ };
15
+
16
+ export const TRANSITIONS_CHANGE: Record<string, (duration: number) => FillTransitionProps> = {
17
+ opacity: (duration) => ({ initialProps: { transition: duration }, finishProps: {} }),
18
+ };
19
+
20
+ const PARAMS_DEFAULT = {
21
+ TRANSITIONS_SHOW,
22
+ TRANSITIONS_HIDE,
23
+ TRANSITIONS_CHANGE,
24
+ };
25
+
26
+ export type Params = Widen<typeof PARAMS_DEFAULT>;
27
+ 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
+ }