@vnejs/plugins.canvas.child.fill 0.2.0 → 0.2.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.
- package/dist/index.js +1 -6
- package/dist/modules/change.d.ts +3 -3
- package/dist/modules/hide.d.ts +2 -3
- package/dist/modules/show.d.ts +2 -3
- package/dist/modules/state.d.ts +4 -4
- package/dist/utils/fill.d.ts +1 -30
- package/package.json +1 -1
- package/src/index.ts +1 -6
- package/src/modules/change.ts +2 -3
- package/src/modules/hide.ts +1 -2
- package/src/modules/show.ts +2 -4
- package/src/modules/state.ts +1 -1
- package/src/types.ts +1 -3
- package/src/utils/fill.ts +1 -35
- package/tsconfig.json +2 -8
package/dist/index.js
CHANGED
|
@@ -5,9 +5,4 @@ import { LayerFillChange } from "./modules/change.js";
|
|
|
5
5
|
import { LayerFillHide } from "./modules/hide.js";
|
|
6
6
|
import { LayerFillShow } from "./modules/show.js";
|
|
7
7
|
import { LayerFillState } from "./modules/state.js";
|
|
8
|
-
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [
|
|
9
|
-
LayerFillShow,
|
|
10
|
-
LayerFillHide,
|
|
11
|
-
LayerFillChange,
|
|
12
|
-
LayerFillState,
|
|
13
|
-
]);
|
|
8
|
+
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [LayerFillShow, LayerFillHide, LayerFillChange, LayerFillState]);
|
package/dist/modules/change.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
3
|
-
import type { FillChangePayload } from "
|
|
3
|
+
import type { FillChangePayload } from "@vnejs/contracts.canvas.child.fill";
|
|
4
4
|
export declare class LayerFillChange extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
|
-
onChange: ({ id, layer, color, duration }?: FillChangePayload) => Promise<
|
|
8
|
-
emitChildChange: (layer: string, childId: string, duration: number, props: Record<string, unknown>) => Promise<
|
|
7
|
+
onChange: ({ id, layer, color, duration }?: FillChangePayload) => Promise<import("@vnejs/shared").EmitResults<"vne:interact:push_pop"> | undefined>;
|
|
8
|
+
emitChildChange: (layer: string, childId: string, duration: number, props: Record<string, unknown>) => Promise<import("@vnejs/shared").EmitResults<"vne:layer:child_change">> | undefined;
|
|
9
9
|
}
|
package/dist/modules/hide.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
-
import type { FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
2
|
+
import type { FillHidePayload, FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
3
3
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
4
|
-
import type { FillHidePayload } from "../utils/fill.js";
|
|
5
4
|
export declare class LayerFillHide extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams> {
|
|
6
5
|
name: string;
|
|
7
6
|
subscribe: () => void;
|
|
8
|
-
onHide: ({ id, layer, duration }?: FillHidePayload) => Promise<
|
|
7
|
+
onHide: ({ id, layer, duration }?: FillHidePayload) => Promise<import("@vnejs/shared").EmitResults<"vne:layer:child_rm"> | undefined>;
|
|
9
8
|
getTransitionProps: (duration: number) => FillTransitionProps;
|
|
10
9
|
}
|
package/dist/modules/show.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
-
import type { FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
2
|
+
import type { FillShowPayload, FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
3
3
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
4
|
-
import type { FillShowPayload } from "../utils/fill.js";
|
|
5
4
|
export declare class LayerFillShow extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams> {
|
|
6
5
|
name: string;
|
|
7
6
|
subscribe: () => void;
|
|
8
|
-
onShow: ({ id, layer, color, duration }?: FillShowPayload) => Promise<
|
|
7
|
+
onShow: ({ id, layer, color, duration }?: FillShowPayload) => Promise<import("@vnejs/shared").EmitResults<"vne:layer:child_add"> | undefined>;
|
|
9
8
|
getTransitionProps: (duration: number) => FillTransitionProps;
|
|
10
9
|
}
|
package/dist/modules/state.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore, type ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
2
2
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
3
|
-
import type { FillRecord, FillState, FillStateIdPayload } from "
|
|
3
|
+
import type { FillRecord, FillState, FillStateIdPayload } from "@vnejs/contracts.canvas.child.fill";
|
|
4
4
|
export declare class LayerFillState extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams, FillState> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
@@ -14,9 +14,9 @@ export declare class LayerFillState extends ModuleCore<FillPluginEvents, FillPlu
|
|
|
14
14
|
cloneFillAndChange: (fill: FillRecord) => Promise<unknown>;
|
|
15
15
|
cloneFillAndHide: (fill: FillRecord) => Promise<unknown>;
|
|
16
16
|
cloneFillAndShow: (fill: FillRecord) => Promise<unknown>;
|
|
17
|
-
emitFillChange: (fill: FillRecord) => Promise<
|
|
18
|
-
emitFillHide: (fill: FillRecord) => Promise<
|
|
19
|
-
emitFillShow: (fill: FillRecord) => Promise<
|
|
17
|
+
emitFillChange: (fill: FillRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_fill:change">> | undefined;
|
|
18
|
+
emitFillHide: (fill: FillRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_fill:hide">> | undefined;
|
|
19
|
+
emitFillShow: (fill: FillRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_fill:show">> | undefined;
|
|
20
20
|
emitEventWithFill: (fill: FillRecord, cb: (fill: FillRecord) => unknown) => unknown;
|
|
21
21
|
getFillsByLayerFromState: (acc: Record<string, FillRecord[]>, fill: FillRecord) => Record<string, FillRecord[]>;
|
|
22
22
|
getDefaultState: () => FillState;
|
package/dist/utils/fill.d.ts
CHANGED
|
@@ -1,33 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
id: string;
|
|
3
|
-
layer?: string;
|
|
4
|
-
color?: string;
|
|
5
|
-
};
|
|
6
|
-
export type FillState = {
|
|
7
|
-
fills: FillRecord[];
|
|
8
|
-
};
|
|
9
|
-
export type FillShowPayload = {
|
|
10
|
-
id?: string;
|
|
11
|
-
layer?: string;
|
|
12
|
-
color?: string;
|
|
13
|
-
duration?: number;
|
|
14
|
-
};
|
|
15
|
-
export type FillHidePayload = {
|
|
16
|
-
id?: string;
|
|
17
|
-
layer?: string;
|
|
18
|
-
duration?: number;
|
|
19
|
-
};
|
|
20
|
-
export type FillChangePayload = {
|
|
21
|
-
id?: string;
|
|
22
|
-
layer?: string;
|
|
23
|
-
color?: string;
|
|
24
|
-
duration?: number;
|
|
25
|
-
};
|
|
26
|
-
export type FillStateIdPayload = {
|
|
27
|
-
id?: string;
|
|
28
|
-
layer?: string;
|
|
29
|
-
color?: string;
|
|
30
|
-
};
|
|
1
|
+
import type { FillRecord } from "@vnejs/contracts.canvas.child.fill";
|
|
31
2
|
export type LayerFillChild = {
|
|
32
3
|
type: string;
|
|
33
4
|
id: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,9 +8,4 @@ import { LayerFillHide } from "./modules/hide.js";
|
|
|
8
8
|
import { LayerFillShow } from "./modules/show.js";
|
|
9
9
|
import { LayerFillState } from "./modules/state.js";
|
|
10
10
|
|
|
11
|
-
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [
|
|
12
|
-
LayerFillShow,
|
|
13
|
-
LayerFillHide,
|
|
14
|
-
LayerFillChange,
|
|
15
|
-
LayerFillState,
|
|
16
|
-
]);
|
|
11
|
+
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [LayerFillShow, LayerFillHide, LayerFillChange, LayerFillState]);
|
package/src/modules/change.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { createPromiseResolve } from "@vnejs/helpers";
|
|
|
2
2
|
import { ModuleCore } from "@vnejs/module.core";
|
|
3
3
|
|
|
4
4
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
5
|
-
import type { FillChangePayload, FillRecord } from "
|
|
5
|
+
import type { FillChangePayload, FillRecord } from "@vnejs/contracts.canvas.child.fill";
|
|
6
6
|
|
|
7
7
|
export class LayerFillChange extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams> {
|
|
8
8
|
name = "layer.fill.change";
|
|
@@ -22,8 +22,7 @@ export class LayerFillChange extends ModuleCore<FillPluginEvents, FillPluginCons
|
|
|
22
22
|
|
|
23
23
|
await this.emit(this.EVENTS.LAYER_FILL.STATE_UPDATE, { id, color });
|
|
24
24
|
|
|
25
|
-
if (!duration || this.shared.viewForceAnimationSources.isNotEmpty())
|
|
26
|
-
return this.emitChildChange(layer, id, 0, { ...changeArgs, transition: 0 });
|
|
25
|
+
if (!duration || this.shared.viewForceAnimationSources.isNotEmpty()) return this.emitChildChange(layer, id, 0, { ...changeArgs, transition: 0 });
|
|
27
26
|
|
|
28
27
|
const { resolve: skipResolve, promise: skipPromise } = createPromiseResolve();
|
|
29
28
|
|
package/src/modules/hide.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createPromiseResolve } from "@vnejs/helpers";
|
|
2
2
|
import { ModuleCore } from "@vnejs/module.core";
|
|
3
|
-
import type { FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
3
|
+
import type { FillHidePayload, FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
4
4
|
|
|
5
5
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
6
|
-
import type { FillHidePayload } from "../utils/fill.js";
|
|
7
6
|
|
|
8
7
|
export class LayerFillHide extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams> {
|
|
9
8
|
name = "layer.fill.hide";
|
package/src/modules/show.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createPromiseResolve } from "@vnejs/helpers";
|
|
2
2
|
import { ModuleCore } from "@vnejs/module.core";
|
|
3
|
-
import type { FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
3
|
+
import type { FillRecord, FillShowPayload, FillTransitionProps } from "@vnejs/contracts.canvas.child.fill";
|
|
4
4
|
|
|
5
5
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
6
|
-
import type { FillRecord, FillShowPayload } from "../utils/fill.js";
|
|
7
6
|
import { assertIdNotExists, buildChild } from "../utils/fill.js";
|
|
8
7
|
|
|
9
8
|
export class LayerFillShow extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams> {
|
|
@@ -24,8 +23,7 @@ export class LayerFillShow extends ModuleCore<FillPluginEvents, FillPluginConsta
|
|
|
24
23
|
|
|
25
24
|
await this.emit(this.EVENTS.LAYER_FILL.STATE_ADD, { id, layer, color });
|
|
26
25
|
|
|
27
|
-
if (!duration || this.shared.viewForceAnimationSources.isNotEmpty())
|
|
28
|
-
return this.emit(this.EVENTS.LAYER.CHILD_ADD, { layer, child: childCommon });
|
|
26
|
+
if (!duration || this.shared.viewForceAnimationSources.isNotEmpty()) return this.emit(this.EVENTS.LAYER.CHILD_ADD, { layer, child: childCommon });
|
|
29
27
|
|
|
30
28
|
const { initialProps = {}, finishProps = {} } = this.getTransitionProps(Number(duration));
|
|
31
29
|
const { resolve: skipResolve, promise: skipPromise } = createPromiseResolve();
|
package/src/modules/state.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleCore, type ModuleGlobalStateRegistry } from "@vnejs/module.core";
|
|
2
2
|
|
|
3
3
|
import type { FillPluginConstants, FillPluginEvents, FillPluginParams, FillPluginSettings } from "../types.js";
|
|
4
|
-
import type { FillRecord, FillState, FillStateIdPayload } from "
|
|
4
|
+
import type { FillRecord, FillState, FillStateIdPayload } from "@vnejs/contracts.canvas.child.fill";
|
|
5
5
|
|
|
6
6
|
export class LayerFillState extends ModuleCore<FillPluginEvents, FillPluginConstants, FillPluginSettings, FillPluginParams, FillState> {
|
|
7
7
|
name = "layer.fill.state";
|
package/src/types.ts
CHANGED
|
@@ -2,9 +2,7 @@ import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCor
|
|
|
2
2
|
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.canvas.child.fill";
|
|
3
3
|
import type { PluginName as LayerPluginName, SettingsKeys as LayerSettingsKeys, SubscribeEvents as LayerSubscribeEvents } from "@vnejs/contracts.canvas.layer";
|
|
4
4
|
|
|
5
|
-
export type FillPluginEvents = ModuleCoreEvents &
|
|
6
|
-
Record<PluginName, SubscribeEvents> &
|
|
7
|
-
Record<LayerPluginName, LayerSubscribeEvents>;
|
|
5
|
+
export type FillPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents> & Record<LayerPluginName, LayerSubscribeEvents>;
|
|
8
6
|
|
|
9
7
|
export type FillPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
|
|
10
8
|
|
package/src/utils/fill.ts
CHANGED
|
@@ -1,38 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
id: string;
|
|
3
|
-
layer?: string;
|
|
4
|
-
color?: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type FillState = {
|
|
8
|
-
fills: FillRecord[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type FillShowPayload = {
|
|
12
|
-
id?: string;
|
|
13
|
-
layer?: string;
|
|
14
|
-
color?: string;
|
|
15
|
-
duration?: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type FillHidePayload = {
|
|
19
|
-
id?: string;
|
|
20
|
-
layer?: string;
|
|
21
|
-
duration?: number;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type FillChangePayload = {
|
|
25
|
-
id?: string;
|
|
26
|
-
layer?: string;
|
|
27
|
-
color?: string;
|
|
28
|
-
duration?: number;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type FillStateIdPayload = {
|
|
32
|
-
id?: string;
|
|
33
|
-
layer?: string;
|
|
34
|
-
color?: string;
|
|
35
|
-
};
|
|
1
|
+
import type { FillRecord } from "@vnejs/contracts.canvas.child.fill";
|
|
36
2
|
|
|
37
3
|
export type LayerFillChild = {
|
|
38
4
|
type: string;
|
package/tsconfig.json
CHANGED