@vnejs/plugins.views.achievement 0.2.3 → 0.2.4
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/modules/achievement.d.ts +3 -3
- package/dist/modules/controller.d.ts +2 -1
- package/dist/modules/exec.d.ts +7 -7
- package/dist/modules/logs.d.ts +1 -1
- package/dist/modules/view.d.ts +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/utils/achievement.d.ts +0 -27
- package/dist/view/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/modules/achievement.ts +1 -1
- package/src/modules/controller.ts +3 -1
- package/src/modules/logs.ts +1 -1
- package/src/modules/view.ts +1 -2
- package/src/types.ts +9 -0
- package/src/utils/achievement.ts +0 -34
- package/src/view/index.tsx +2 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
3
|
-
import type { AchievementLockPayload, AchievementUnlockPayload } from "
|
|
3
|
+
import type { AchievementLockPayload, AchievementUnlockPayload } from "@vnejs/contracts.views.achievement";
|
|
4
4
|
export declare class Achievement extends ModuleCore<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
|
-
onAchievementClear: () => Promise<
|
|
7
|
+
onAchievementClear: () => Promise<void | undefined> | undefined;
|
|
8
8
|
onAchievementLock: ({ id }?: AchievementLockPayload) => Promise<void>;
|
|
9
|
-
onAchievementUnlock: ({ id, isSkipIfPossible }?: AchievementUnlockPayload) => Promise<
|
|
9
|
+
onAchievementUnlock: ({ id, isSkipIfPossible }?: AchievementUnlockPayload) => Promise<import("@vnejs/shared").EmitResults<"vne:achievement:append"> | undefined>;
|
|
10
10
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModuleController } from "@vnejs/module.components";
|
|
2
2
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { AchievementPluginState } from "../types.js";
|
|
4
|
+
import type { AchievementAppendPayload, AchievementLoadPayload } from "@vnejs/contracts.views.achievement";
|
|
4
5
|
export declare class AchievementController extends ModuleController<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams, AchievementPluginState> {
|
|
5
6
|
name: string;
|
|
6
7
|
EVENT_UPDATE_VIEW: "vne:achievement:update";
|
package/dist/modules/exec.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { LineExecHandlerArg, LineLoadHandlerArg } from "@vnejs/module.core"
|
|
|
3
3
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
4
4
|
export declare class AchievementExec extends ModuleCore<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams> {
|
|
5
5
|
name: string;
|
|
6
|
-
init: () => Promise<[
|
|
6
|
+
init: () => Promise<[import("@vnejs/shared").EmitResults<"vne:scenario:line_exec_reg"> | undefined, import("@vnejs/shared").EmitResults<"vne:scenario:line_load_reg"> | undefined]>;
|
|
7
7
|
onLineExec: ({ keywords, line }?: LineExecHandlerArg) => Promise<void>;
|
|
8
|
-
onLineLoad: ({ line, priority }?: LineLoadHandlerArg) => Promise<
|
|
9
|
-
emitActionExec: (action?: string, tokens?: string[], keywords?: string[]) => Promise<
|
|
10
|
-
emitLockExec: (id?: string, isSkipIfPossible?: boolean) => Promise<
|
|
11
|
-
emitUnlockExec: (id?: string, isSkipIfPossible?: boolean) => Promise<
|
|
12
|
-
emitActionLoad: (action?: string, tokens?: string[], priority?: number) => Promise<
|
|
13
|
-
emitUnlockLoad: (id?: string, priority?: number) => Promise<
|
|
8
|
+
onLineLoad: ({ line, priority }?: LineLoadHandlerArg) => Promise<void | undefined> | undefined;
|
|
9
|
+
emitActionExec: (action?: string, tokens?: string[], keywords?: string[]) => Promise<void | undefined> | undefined;
|
|
10
|
+
emitLockExec: (id?: string, isSkipIfPossible?: boolean) => Promise<void | undefined> | undefined;
|
|
11
|
+
emitUnlockExec: (id?: string, isSkipIfPossible?: boolean) => Promise<void | undefined> | undefined;
|
|
12
|
+
emitActionLoad: (action?: string, tokens?: string[], priority?: number) => Promise<void | undefined> | undefined;
|
|
13
|
+
emitUnlockLoad: (id?: string, priority?: number) => Promise<void | undefined> | undefined;
|
|
14
14
|
}
|
package/dist/modules/logs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
3
|
-
import type { AchievementLockedPayload, AchievementUnlockedPayload } from "
|
|
3
|
+
import type { AchievementLockedPayload, AchievementUnlockedPayload } from "@vnejs/contracts.views.achievement";
|
|
4
4
|
export declare class AchievementLogs extends ModuleCore<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
package/dist/modules/view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleView } from "@vnejs/module.components";
|
|
2
2
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
3
|
-
import type { AchievementPluginState } from "../
|
|
3
|
+
import type { AchievementPluginState } from "../types.js";
|
|
4
4
|
export declare class AchievementView extends ModuleView<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams, AchievementPluginState> {
|
|
5
5
|
name: string;
|
|
6
6
|
EVENT_UPDATE_VIEW: "vne:achievement:update";
|
package/dist/types.d.ts
CHANGED
|
@@ -3,7 +3,14 @@ import type { Constants as LogsConstants, PluginName as LogsPluginName, Subscrib
|
|
|
3
3
|
import type { Constants as ScenarioConstants, PluginName as ScenarioPluginName, SubscribeEvents as ScenarioSubscribeEvents } from "@vnejs/contracts.core.scenario";
|
|
4
4
|
import type { PluginName as StoragePluginName, SubscribeEvents as StorageSubscribeEvents } from "@vnejs/contracts.core.storage";
|
|
5
5
|
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.achievement";
|
|
6
|
+
import type { AchievementItem } from "./utils/achievement.js";
|
|
6
7
|
export type AchievementPluginEvents = ModuleComponentsEvents & Record<PluginName, SubscribeEvents> & Record<StoragePluginName, StorageSubscribeEvents> & Record<ScenarioPluginName, ScenarioSubscribeEvents> & Record<LogsPluginName, LogsSubscribeEvents>;
|
|
7
8
|
export type AchievementPluginConstants = ModuleComponentsConstants & Record<PluginName, Constants> & Record<ScenarioPluginName, ScenarioConstants> & Record<LogsPluginName, LogsConstants>;
|
|
8
9
|
export type AchievementPluginSettings = ModuleComponentsSettings;
|
|
9
10
|
export type AchievementPluginParams = ModuleComponentsParams & Record<PluginName, Params>;
|
|
11
|
+
export type AchievementPluginState = {
|
|
12
|
+
isShow: boolean;
|
|
13
|
+
isForce: boolean;
|
|
14
|
+
array?: AchievementItem[];
|
|
15
|
+
locs?: Record<string, string>;
|
|
16
|
+
};
|
|
@@ -4,30 +4,3 @@ export type AchievementItem = {
|
|
|
4
4
|
isNotShowed: boolean;
|
|
5
5
|
icon?: string;
|
|
6
6
|
};
|
|
7
|
-
export type AchievementPluginState = {
|
|
8
|
-
isShow: boolean;
|
|
9
|
-
isForce: boolean;
|
|
10
|
-
array?: AchievementItem[];
|
|
11
|
-
locs?: Record<string, string>;
|
|
12
|
-
};
|
|
13
|
-
export type AchievementLockPayload = {
|
|
14
|
-
id?: string;
|
|
15
|
-
isSkipIfPossible?: boolean;
|
|
16
|
-
};
|
|
17
|
-
export type AchievementUnlockPayload = {
|
|
18
|
-
id?: string;
|
|
19
|
-
isSkipIfPossible?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export type AchievementAppendPayload = {
|
|
22
|
-
id?: string;
|
|
23
|
-
};
|
|
24
|
-
export type AchievementLoadPayload = {
|
|
25
|
-
id?: string;
|
|
26
|
-
priority?: number;
|
|
27
|
-
};
|
|
28
|
-
export type AchievementLockedPayload = {
|
|
29
|
-
id?: string;
|
|
30
|
-
};
|
|
31
|
-
export type AchievementUnlockedPayload = {
|
|
32
|
-
id?: string;
|
|
33
|
-
};
|
package/dist/view/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
|
|
3
3
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
4
|
-
import type { AchievementLockPayload, AchievementUnlockPayload } from "
|
|
4
|
+
import type { AchievementLockPayload, AchievementUnlockPayload } from "@vnejs/contracts.views.achievement";
|
|
5
5
|
|
|
6
6
|
const STORAGE_VALUE = 1;
|
|
7
7
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ModuleController } from "@vnejs/module.components";
|
|
2
2
|
|
|
3
3
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { AchievementPluginState } from "../types.js";
|
|
5
|
+
import type { AchievementItem } from "../utils/achievement.js";
|
|
6
|
+
import type { AchievementAppendPayload, AchievementLoadPayload } from "@vnejs/contracts.views.achievement";
|
|
5
7
|
|
|
6
8
|
export class AchievementController extends ModuleController<
|
|
7
9
|
AchievementPluginEvents,
|
package/src/modules/logs.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
|
|
3
3
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
4
|
-
import type { AchievementLockedPayload, AchievementUnlockedPayload } from "
|
|
4
|
+
import type { AchievementLockedPayload, AchievementUnlockedPayload } from "@vnejs/contracts.views.achievement";
|
|
5
5
|
|
|
6
6
|
export class AchievementLogs extends ModuleCore<AchievementPluginEvents, AchievementPluginConstants, AchievementPluginSettings, AchievementPluginParams> {
|
|
7
7
|
name = "achievement.logs";
|
package/src/modules/view.ts
CHANGED
|
@@ -2,8 +2,7 @@ import { ModuleView } from "@vnejs/module.components";
|
|
|
2
2
|
|
|
3
3
|
import { render } from "../view/index.js";
|
|
4
4
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
5
|
-
import type { AchievementPluginState } from "../
|
|
6
|
-
|
|
5
|
+
import type { AchievementPluginState } from "../types.js";
|
|
7
6
|
export class AchievementView extends ModuleView<
|
|
8
7
|
AchievementPluginEvents,
|
|
9
8
|
AchievementPluginConstants,
|
package/src/types.ts
CHANGED
|
@@ -8,6 +8,8 @@ import type {
|
|
|
8
8
|
import type { PluginName as StoragePluginName, SubscribeEvents as StorageSubscribeEvents } from "@vnejs/contracts.core.storage";
|
|
9
9
|
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.achievement";
|
|
10
10
|
|
|
11
|
+
import type { AchievementItem } from "./utils/achievement.js";
|
|
12
|
+
|
|
11
13
|
export type AchievementPluginEvents = ModuleComponentsEvents &
|
|
12
14
|
Record<PluginName, SubscribeEvents> &
|
|
13
15
|
Record<StoragePluginName, StorageSubscribeEvents> &
|
|
@@ -22,3 +24,10 @@ export type AchievementPluginConstants = ModuleComponentsConstants &
|
|
|
22
24
|
export type AchievementPluginSettings = ModuleComponentsSettings;
|
|
23
25
|
|
|
24
26
|
export type AchievementPluginParams = ModuleComponentsParams & Record<PluginName, Params>;
|
|
27
|
+
|
|
28
|
+
export type AchievementPluginState = {
|
|
29
|
+
isShow: boolean;
|
|
30
|
+
isForce: boolean;
|
|
31
|
+
array?: AchievementItem[];
|
|
32
|
+
locs?: Record<string, string>;
|
|
33
|
+
};
|
package/src/utils/achievement.ts
CHANGED
|
@@ -4,37 +4,3 @@ export type AchievementItem = {
|
|
|
4
4
|
isNotShowed: boolean;
|
|
5
5
|
icon?: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
export type AchievementPluginState = {
|
|
9
|
-
isShow: boolean;
|
|
10
|
-
isForce: boolean;
|
|
11
|
-
array?: AchievementItem[];
|
|
12
|
-
locs?: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type AchievementLockPayload = {
|
|
16
|
-
id?: string;
|
|
17
|
-
isSkipIfPossible?: boolean;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type AchievementUnlockPayload = {
|
|
21
|
-
id?: string;
|
|
22
|
-
isSkipIfPossible?: boolean;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export type AchievementAppendPayload = {
|
|
26
|
-
id?: string;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export type AchievementLoadPayload = {
|
|
30
|
-
id?: string;
|
|
31
|
-
priority?: number;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type AchievementLockedPayload = {
|
|
35
|
-
id?: string;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type AchievementUnlockedPayload = {
|
|
39
|
-
id?: string;
|
|
40
|
-
};
|
package/src/view/index.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import { Flex, Icon, Text, View, Wrap, createRenderFunc, useMemo, useStoreState
|
|
|
4
4
|
import { getVneLength } from "@vnejs/uis.utils";
|
|
5
5
|
|
|
6
6
|
import type { AchievementPluginConstants, AchievementPluginEvents, AchievementPluginParams, AchievementPluginSettings } from "../types.js";
|
|
7
|
-
import type { AchievementPluginState
|
|
8
|
-
|
|
7
|
+
import type { AchievementPluginState } from "../types.js";
|
|
8
|
+
import type { AchievementItem } from "../utils/achievement.js";
|
|
9
9
|
type AchievementComponentProps = ReactComponentProps<
|
|
10
10
|
AchievementPluginEvents,
|
|
11
11
|
AchievementPluginConstants,
|