@drincs/nqtr 0.1.14 → 0.1.16
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/ActivityProps-B1IaFbGD.d.ts +124 -0
- package/dist/ActivityProps-BmIzqtXr.d.mts +124 -0
- package/dist/{index-Cu8ZAiqF.d.ts → Commitment-BjkhJtTx.d.ts} +227 -220
- package/dist/{index-DhsRZJ3g.d.mts → Commitment-BxUQoZST.d.mts} +227 -220
- package/dist/{index-gJ26gdgL.d.mts → Quest-Bdm0R9LA.d.mts} +7 -12
- package/dist/{index-BjOzVDyw.d.ts → Quest-CxJcXETG.d.ts} +7 -12
- package/dist/classes/Activity.d.mts +41 -127
- package/dist/classes/Activity.d.ts +41 -127
- package/dist/classes/Activity.js +2 -151
- package/dist/classes/Activity.js.map +1 -1
- package/dist/classes/Activity.mjs +2 -148
- package/dist/classes/Activity.mjs.map +1 -1
- package/dist/classes/ActivityStoredAbstract.d.mts +3 -0
- package/dist/classes/ActivityStoredAbstract.d.ts +3 -0
- package/dist/classes/ActivityStoredAbstract.js +399 -0
- package/dist/classes/ActivityStoredAbstract.js.map +1 -0
- package/dist/classes/ActivityStoredAbstract.mjs +397 -0
- package/dist/classes/ActivityStoredAbstract.mjs.map +1 -0
- package/dist/classes/Commitment.d.mts +4 -1
- package/dist/classes/Commitment.d.ts +4 -1
- package/dist/classes/Commitment.js +5 -4
- package/dist/classes/Commitment.js.map +1 -1
- package/dist/classes/Commitment.mjs +5 -4
- package/dist/classes/Commitment.mjs.map +1 -1
- package/dist/classes/index.d.mts +9 -2
- package/dist/classes/index.d.ts +9 -2
- package/dist/classes/index.js +868 -5
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +863 -6
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/ActivityRoom.d.mts +5 -2
- package/dist/classes/navigation/ActivityRoom.d.ts +5 -2
- package/dist/classes/navigation/ActivityRoom.js +3 -3
- package/dist/classes/navigation/ActivityRoom.js.map +1 -1
- package/dist/classes/navigation/ActivityRoom.mjs +3 -3
- package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
- package/dist/classes/navigation/Location.d.mts +5 -2
- package/dist/classes/navigation/Location.d.ts +5 -2
- package/dist/classes/navigation/Location.js.map +1 -1
- package/dist/classes/navigation/Location.mjs.map +1 -1
- package/dist/classes/navigation/Map.d.mts +5 -2
- package/dist/classes/navigation/Map.d.ts +5 -2
- package/dist/classes/navigation/Map.js.map +1 -1
- package/dist/classes/navigation/Map.mjs.map +1 -1
- package/dist/classes/navigation/Room.d.mts +4 -1
- package/dist/classes/navigation/Room.d.ts +4 -1
- package/dist/classes/navigation/Room.js +3 -3
- package/dist/classes/navigation/Room.js.map +1 -1
- package/dist/classes/navigation/Room.mjs +3 -3
- package/dist/classes/navigation/Room.mjs.map +1 -1
- package/dist/classes/quest/Goal.d.mts +3 -6
- package/dist/classes/quest/Goal.d.ts +3 -6
- package/dist/classes/quest/Goal.js.map +1 -1
- package/dist/classes/quest/Goal.mjs.map +1 -1
- package/dist/classes/quest/Quest.d.mts +3 -1
- package/dist/classes/quest/Quest.d.ts +3 -1
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +3 -1
- package/dist/classes/quest/Stage.d.ts +3 -1
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/decorators/ActivityDecorator.d.mts +16 -0
- package/dist/decorators/ActivityDecorator.d.ts +16 -0
- package/dist/decorators/ActivityDecorator.js.map +1 -1
- package/dist/decorators/ActivityDecorator.mjs.map +1 -1
- package/dist/decorators/CommitmentDecorator.d.mts +5 -2
- package/dist/decorators/CommitmentDecorator.d.ts +5 -2
- package/dist/decorators/CommitmentDecorator.js +3 -3
- package/dist/decorators/CommitmentDecorator.js.map +1 -1
- package/dist/decorators/CommitmentDecorator.mjs +3 -3
- package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
- package/dist/decorators/RoomDecorator.d.mts +9 -2
- package/dist/decorators/RoomDecorator.d.ts +9 -2
- package/dist/decorators/RoomDecorator.js.map +1 -1
- package/dist/decorators/RoomDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +4 -1
- package/dist/decorators/index.d.ts +4 -1
- package/dist/decorators/index.js +3 -3
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +3 -3
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/ActivityFunctions.d.mts +5 -2
- package/dist/functions/ActivityFunctions.d.ts +5 -2
- package/dist/functions/ActivityFunctions.js.map +1 -1
- package/dist/functions/ActivityFunctions.mjs.map +1 -1
- package/dist/functions/NavigationFunctions.d.mts +5 -2
- package/dist/functions/NavigationFunctions.d.ts +5 -2
- package/dist/functions/NavigationFunctions.js.map +1 -1
- package/dist/functions/NavigationFunctions.mjs.map +1 -1
- package/dist/functions/RoutineFunctions.d.mts +5 -2
- package/dist/functions/RoutineFunctions.d.ts +5 -2
- package/dist/functions/RoutineFunctions.js.map +1 -1
- package/dist/functions/RoutineFunctions.mjs.map +1 -1
- package/dist/functions/index.d.mts +5 -2
- package/dist/functions/index.d.ts +5 -2
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +155 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +155 -154
- package/dist/index.mjs.map +1 -1
- package/dist/interface/ActivityProps.d.mts +3 -0
- package/dist/interface/ActivityProps.d.ts +3 -0
- package/dist/{override/GraphicHTMLElement.js → interface/ActivityProps.js} +1 -1
- package/dist/interface/ActivityProps.mjs +3 -0
- package/dist/interface/CommitmentProps.d.mts +8 -0
- package/dist/interface/CommitmentProps.d.ts +8 -0
- package/dist/{override/OnRunActivityProps.js → interface/CommitmentProps.js} +1 -1
- package/dist/interface/CommitmentProps.mjs +3 -0
- package/dist/interface/RoomActivityMemory.d.mts +9 -0
- package/dist/interface/RoomActivityMemory.d.ts +9 -0
- package/dist/interface/RoomActivityMemory.js +4 -0
- package/dist/interface/RoomActivityMemory.js.map +1 -0
- package/dist/interface/RoomActivityMemory.mjs +3 -0
- package/dist/interface/RoomActivityMemory.mjs.map +1 -0
- package/dist/interface/RoomProps.d.mts +8 -0
- package/dist/interface/RoomProps.d.ts +8 -0
- package/dist/interface/RoomProps.js +4 -0
- package/dist/interface/RoomProps.js.map +1 -0
- package/dist/interface/RoomProps.mjs +3 -0
- package/dist/interface/RoomProps.mjs.map +1 -0
- package/dist/interface/index.d.mts +12 -0
- package/dist/interface/index.d.ts +12 -0
- package/dist/interface/index.js +4 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/index.mjs +3 -0
- package/dist/interface/index.mjs.map +1 -0
- package/dist/interface/navigation/LocationProps.d.mts +8 -0
- package/dist/interface/navigation/LocationProps.d.ts +8 -0
- package/dist/interface/navigation/LocationProps.js +4 -0
- package/dist/interface/navigation/LocationProps.js.map +1 -0
- package/dist/interface/navigation/LocationProps.mjs +3 -0
- package/dist/interface/navigation/LocationProps.mjs.map +1 -0
- package/dist/interface/navigation/MapProps.d.mts +8 -0
- package/dist/interface/navigation/MapProps.d.ts +8 -0
- package/dist/interface/navigation/MapProps.js +4 -0
- package/dist/interface/navigation/MapProps.js.map +1 -0
- package/dist/interface/navigation/MapProps.mjs +3 -0
- package/dist/interface/navigation/MapProps.mjs.map +1 -0
- package/dist/interface/quest/GoalProps.d.mts +7 -0
- package/dist/interface/quest/GoalProps.d.ts +7 -0
- package/dist/interface/quest/GoalProps.js +4 -0
- package/dist/interface/quest/GoalProps.js.map +1 -0
- package/dist/interface/quest/GoalProps.mjs +3 -0
- package/dist/interface/quest/GoalProps.mjs.map +1 -0
- package/dist/interface/quest/QuestProps.d.mts +9 -0
- package/dist/interface/quest/QuestProps.d.ts +9 -0
- package/dist/interface/quest/QuestProps.js +4 -0
- package/dist/interface/quest/QuestProps.js.map +1 -0
- package/dist/interface/quest/QuestProps.mjs +3 -0
- package/dist/interface/quest/QuestProps.mjs.map +1 -0
- package/dist/interface/quest/StageProps.d.mts +5 -0
- package/dist/interface/quest/StageProps.d.ts +5 -0
- package/dist/interface/quest/StageProps.js +4 -0
- package/dist/interface/quest/StageProps.js.map +1 -0
- package/dist/interface/quest/StageProps.mjs +3 -0
- package/dist/interface/quest/StageProps.mjs.map +1 -0
- package/dist/managers/TimeManager.d.mts +1 -1
- package/dist/managers/TimeManager.d.ts +1 -1
- package/dist/managers/TimeManager.js +1 -1
- package/dist/managers/TimeManager.js.map +1 -1
- package/dist/managers/TimeManager.mjs +1 -1
- package/dist/managers/TimeManager.mjs.map +1 -1
- package/dist/managers/index.js +1 -1
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +1 -1
- package/dist/managers/index.mjs.map +1 -1
- package/dist/override/GraphicItemType.d.mts +3 -4
- package/dist/override/GraphicItemType.d.ts +3 -4
- package/dist/override/{OnRunActivityProps.d.mts → OnRunProps.d.mts} +3 -3
- package/dist/override/{OnRunActivityProps.d.ts → OnRunProps.d.ts} +3 -3
- package/dist/override/OnRunProps.js +4 -0
- package/dist/override/OnRunProps.js.map +1 -0
- package/dist/override/OnRunProps.mjs +3 -0
- package/dist/override/OnRunProps.mjs.map +1 -0
- package/dist/override/index.d.mts +1 -2
- package/dist/override/index.d.ts +1 -2
- package/dist/types/OnRunActivityEvent.d.mts +8 -0
- package/dist/types/OnRunActivityEvent.d.ts +8 -0
- package/dist/types/OnRunActivityEvent.js +4 -0
- package/dist/types/OnRunActivityEvent.js.map +1 -0
- package/dist/types/OnRunActivityEvent.mjs +3 -0
- package/dist/types/OnRunActivityEvent.mjs.map +1 -0
- package/dist/types/OnRunCommitmentEvent.d.mts +8 -0
- package/dist/types/OnRunCommitmentEvent.d.ts +8 -0
- package/dist/types/OnRunCommitmentEvent.js +4 -0
- package/dist/types/OnRunCommitmentEvent.js.map +1 -0
- package/dist/types/OnRunCommitmentEvent.mjs +3 -0
- package/dist/types/OnRunCommitmentEvent.mjs.map +1 -0
- package/dist/types/QuestsRequired.d.mts +4 -2
- package/dist/types/QuestsRequired.d.ts +4 -2
- package/dist/types/index.d.mts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/dist/classes/navigation/index.d.mts +0 -5
- package/dist/classes/navigation/index.d.ts +0 -5
- package/dist/classes/navigation/index.js +0 -987
- package/dist/classes/navigation/index.js.map +0 -1
- package/dist/classes/navigation/index.mjs +0 -983
- package/dist/classes/navigation/index.mjs.map +0 -1
- package/dist/classes/quest/index.d.mts +0 -3
- package/dist/classes/quest/index.d.ts +0 -3
- package/dist/classes/quest/index.js +0 -133
- package/dist/classes/quest/index.js.map +0 -1
- package/dist/classes/quest/index.mjs +0 -129
- package/dist/classes/quest/index.mjs.map +0 -1
- package/dist/override/GraphicHTMLElement.d.mts +0 -7
- package/dist/override/GraphicHTMLElement.d.ts +0 -7
- package/dist/override/GraphicHTMLElement.mjs +0 -3
- package/dist/override/OnRunActivityProps.mjs +0 -3
- /package/dist/{override/GraphicHTMLElement.js.map → interface/ActivityProps.js.map} +0 -0
- /package/dist/{override/GraphicHTMLElement.mjs.map → interface/ActivityProps.mjs.map} +0 -0
- /package/dist/{override/OnRunActivityProps.js.map → interface/CommitmentProps.js.map} +0 -0
- /package/dist/{override/OnRunActivityProps.mjs.map → interface/CommitmentProps.mjs.map} +0 -0
|
@@ -1,129 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnRenderGraphicItemProps, GraphicItemType, OnRunActivityProps } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { A as ActivityProps, a as ActivityStoredAbstract } from '../ActivityProps-BmIzqtXr.mjs';
|
|
3
|
+
import { OnRunActivityEvent } from '../types/OnRunActivityEvent.mjs';
|
|
2
4
|
|
|
3
|
-
interface ActivityProps {
|
|
4
|
-
/**
|
|
5
|
-
* The name
|
|
6
|
-
* @default ""
|
|
7
|
-
*/
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
11
|
-
* If you set 3, the activity will be hidden into hours 1 and 2, and will be shown from hour 3.
|
|
12
|
-
* @default TimeManager.minDayHours
|
|
13
|
-
*/
|
|
14
|
-
fromHour?: number;
|
|
15
|
-
/**
|
|
16
|
-
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
17
|
-
* If you set 3, the activity will be shown into hours 1 and 2 and will be hidden from hour 3.
|
|
18
|
-
* @default TimeManager.maxDayHours + 1
|
|
19
|
-
*/
|
|
20
|
-
toHour?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
23
|
-
* If you set 3, the activity will be hidden into days 1 and 2, and will be shown from day 3.
|
|
24
|
-
* @default undefined
|
|
25
|
-
*/
|
|
26
|
-
fromDay?: number;
|
|
27
|
-
/**
|
|
28
|
-
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
29
|
-
* If you set 3, the activity will be shown into days 1 and 2 and will be deleted or hidden from day 3.
|
|
30
|
-
* @default undefined
|
|
31
|
-
*/
|
|
32
|
-
toDay?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
disabled?: boolean | string;
|
|
38
|
-
/**
|
|
39
|
-
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
hidden?: boolean | string;
|
|
43
|
-
/**
|
|
44
|
-
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
45
|
-
* @default undefined
|
|
46
|
-
*/
|
|
47
|
-
renderIcon?: GraphicItemType | ((activity: ActivityStoredAbstract, props?: OnRenderGraphicItemProps) => GraphicItemType);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* The function that is called when the activity is runned.
|
|
51
|
-
*/
|
|
52
|
-
type OnRunActivityEvent<T> = (activity: T, props?: OnRunActivityProps) => void;
|
|
53
|
-
declare abstract class ActivityStoredAbstract {
|
|
54
|
-
/**
|
|
55
|
-
* @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
|
|
56
|
-
* @param props The activity properties.
|
|
57
|
-
*/
|
|
58
|
-
constructor(onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
|
|
59
|
-
abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
|
|
60
|
-
abstract getStorageProperty<T>(propertyName: string): T | undefined;
|
|
61
|
-
abstract get id(): string;
|
|
62
|
-
private defaultName?;
|
|
63
|
-
/**
|
|
64
|
-
* The name
|
|
65
|
-
*/
|
|
66
|
-
get name(): string;
|
|
67
|
-
set name(value: string | undefined);
|
|
68
|
-
private defaultFromHour?;
|
|
69
|
-
/**
|
|
70
|
-
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
71
|
-
*/
|
|
72
|
-
get fromHour(): number;
|
|
73
|
-
set fromHour(value: number | undefined);
|
|
74
|
-
private defaultToHour?;
|
|
75
|
-
/**
|
|
76
|
-
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
77
|
-
*/
|
|
78
|
-
get toHour(): number;
|
|
79
|
-
set toHour(value: number | undefined);
|
|
80
|
-
private defaultFromDay?;
|
|
81
|
-
/**
|
|
82
|
-
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
83
|
-
*/
|
|
84
|
-
get fromDay(): number | undefined;
|
|
85
|
-
set fromDay(value: number | undefined);
|
|
86
|
-
private defaultToDay?;
|
|
87
|
-
/**
|
|
88
|
-
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
89
|
-
*/
|
|
90
|
-
get toDay(): number | undefined;
|
|
91
|
-
set toDay(value: number | undefined);
|
|
92
|
-
private defaultDisabled;
|
|
93
|
-
/**
|
|
94
|
-
* Whether is disabled.
|
|
95
|
-
*/
|
|
96
|
-
get disabled(): boolean;
|
|
97
|
-
set disabled(value: boolean | string);
|
|
98
|
-
private defaultHidden;
|
|
99
|
-
/**
|
|
100
|
-
* Whether is hidden. If the activity is not started yet, it will be hidden.
|
|
101
|
-
*/
|
|
102
|
-
get hidden(): boolean;
|
|
103
|
-
set hidden(value: boolean | string);
|
|
104
|
-
private _renderIcon?;
|
|
105
|
-
/**
|
|
106
|
-
* The function for rendering the icon of the activity.
|
|
107
|
-
*/
|
|
108
|
-
get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
109
|
-
private _onRun;
|
|
110
|
-
/**
|
|
111
|
-
* The function that is called when the activity is runned.
|
|
112
|
-
*/
|
|
113
|
-
get onRun(): (props?: OnRunActivityProps) => void;
|
|
114
|
-
/**
|
|
115
|
-
* Whether the activity is a deadline.
|
|
116
|
-
* @returns Whether the activity is a deadline.
|
|
117
|
-
*/
|
|
118
|
-
isExpired(): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Export the activity properties.
|
|
121
|
-
* @returns The activity properties.
|
|
122
|
-
*/
|
|
123
|
-
export(): ActivityProps;
|
|
124
|
-
}
|
|
125
5
|
/**
|
|
126
|
-
* The activity model.
|
|
6
|
+
* The activity model. It is used to create an activity.
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* export const nap = new ActivityModel("nap",
|
|
10
|
+
* (_, event) => {
|
|
11
|
+
* if (event) {
|
|
12
|
+
* event.navigate("/game")
|
|
13
|
+
* callLabelWithGoNavigationCallBack(napLabel, event)
|
|
14
|
+
* }
|
|
15
|
+
* else {
|
|
16
|
+
* console.error("Event is undefined")
|
|
17
|
+
* }
|
|
18
|
+
* },
|
|
19
|
+
* {
|
|
20
|
+
* name: "Nap",
|
|
21
|
+
* fromHour: 5,
|
|
22
|
+
* toHour: 23,
|
|
23
|
+
* renderIcon: (activity, props) => {
|
|
24
|
+
* return <Button
|
|
25
|
+
* disabled={activity.disabled}
|
|
26
|
+
* onClick={() => {
|
|
27
|
+
* if (!props) {
|
|
28
|
+
* console.error("Props is undefined")
|
|
29
|
+
* return
|
|
30
|
+
* }
|
|
31
|
+
* activity.onRun(props)
|
|
32
|
+
* }}
|
|
33
|
+
* ariaLabel={activity.name}
|
|
34
|
+
* >
|
|
35
|
+
* <BedIcon />
|
|
36
|
+
* </Button>
|
|
37
|
+
* },
|
|
38
|
+
* }
|
|
39
|
+
* )
|
|
40
|
+
* ```
|
|
127
41
|
*/
|
|
128
42
|
declare class ActivityModel {
|
|
129
43
|
/**
|
|
@@ -176,13 +90,13 @@ declare class ActivityModel {
|
|
|
176
90
|
/**
|
|
177
91
|
* The function for rendering the icon of the activity.
|
|
178
92
|
*/
|
|
179
|
-
get renderIcon(): ((props
|
|
93
|
+
get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
180
94
|
private _onRun;
|
|
181
95
|
get _initialOnRun(): OnRunActivityEvent<ActivityStoredAbstract>;
|
|
182
96
|
/**
|
|
183
97
|
* The function that is called when the activity is runned.
|
|
184
98
|
*/
|
|
185
|
-
get onRun(): (props
|
|
99
|
+
get onRun(): (props: OnRunActivityProps) => void;
|
|
186
100
|
/**
|
|
187
101
|
* Whether the activity is a deadline.
|
|
188
102
|
* @returns Whether the activity is a deadline.
|
|
@@ -195,4 +109,4 @@ declare class ActivityModel {
|
|
|
195
109
|
export(): ActivityProps;
|
|
196
110
|
}
|
|
197
111
|
|
|
198
|
-
export {
|
|
112
|
+
export { ActivityModel as default };
|
|
@@ -1,129 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnRenderGraphicItemProps, GraphicItemType, OnRunActivityProps } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { A as ActivityProps, a as ActivityStoredAbstract } from '../ActivityProps-B1IaFbGD.js';
|
|
3
|
+
import { OnRunActivityEvent } from '../types/OnRunActivityEvent.js';
|
|
2
4
|
|
|
3
|
-
interface ActivityProps {
|
|
4
|
-
/**
|
|
5
|
-
* The name
|
|
6
|
-
* @default ""
|
|
7
|
-
*/
|
|
8
|
-
name?: string;
|
|
9
|
-
/**
|
|
10
|
-
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
11
|
-
* If you set 3, the activity will be hidden into hours 1 and 2, and will be shown from hour 3.
|
|
12
|
-
* @default TimeManager.minDayHours
|
|
13
|
-
*/
|
|
14
|
-
fromHour?: number;
|
|
15
|
-
/**
|
|
16
|
-
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
17
|
-
* If you set 3, the activity will be shown into hours 1 and 2 and will be hidden from hour 3.
|
|
18
|
-
* @default TimeManager.maxDayHours + 1
|
|
19
|
-
*/
|
|
20
|
-
toHour?: number;
|
|
21
|
-
/**
|
|
22
|
-
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
23
|
-
* If you set 3, the activity will be hidden into days 1 and 2, and will be shown from day 3.
|
|
24
|
-
* @default undefined
|
|
25
|
-
*/
|
|
26
|
-
fromDay?: number;
|
|
27
|
-
/**
|
|
28
|
-
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
29
|
-
* If you set 3, the activity will be shown into days 1 and 2 and will be deleted or hidden from day 3.
|
|
30
|
-
* @default undefined
|
|
31
|
-
*/
|
|
32
|
-
toDay?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Whether is disabled. You can also pass a Pixi'VN flag name.
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
disabled?: boolean | string;
|
|
38
|
-
/**
|
|
39
|
-
* Whether is hidden. You can also pass a Pixi'VN flag name.
|
|
40
|
-
* @default false
|
|
41
|
-
*/
|
|
42
|
-
hidden?: boolean | string;
|
|
43
|
-
/**
|
|
44
|
-
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
45
|
-
* @default undefined
|
|
46
|
-
*/
|
|
47
|
-
renderIcon?: GraphicItemType | ((activity: ActivityStoredAbstract, props?: OnRenderGraphicItemProps) => GraphicItemType);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* The function that is called when the activity is runned.
|
|
51
|
-
*/
|
|
52
|
-
type OnRunActivityEvent<T> = (activity: T, props?: OnRunActivityProps) => void;
|
|
53
|
-
declare abstract class ActivityStoredAbstract {
|
|
54
|
-
/**
|
|
55
|
-
* @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
|
|
56
|
-
* @param props The activity properties.
|
|
57
|
-
*/
|
|
58
|
-
constructor(onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
|
|
59
|
-
abstract setStorageProperty<T>(propertyName: string, value: T | undefined): void;
|
|
60
|
-
abstract getStorageProperty<T>(propertyName: string): T | undefined;
|
|
61
|
-
abstract get id(): string;
|
|
62
|
-
private defaultName?;
|
|
63
|
-
/**
|
|
64
|
-
* The name
|
|
65
|
-
*/
|
|
66
|
-
get name(): string;
|
|
67
|
-
set name(value: string | undefined);
|
|
68
|
-
private defaultFromHour?;
|
|
69
|
-
/**
|
|
70
|
-
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
71
|
-
*/
|
|
72
|
-
get fromHour(): number;
|
|
73
|
-
set fromHour(value: number | undefined);
|
|
74
|
-
private defaultToHour?;
|
|
75
|
-
/**
|
|
76
|
-
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
77
|
-
*/
|
|
78
|
-
get toHour(): number;
|
|
79
|
-
set toHour(value: number | undefined);
|
|
80
|
-
private defaultFromDay?;
|
|
81
|
-
/**
|
|
82
|
-
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
83
|
-
*/
|
|
84
|
-
get fromDay(): number | undefined;
|
|
85
|
-
set fromDay(value: number | undefined);
|
|
86
|
-
private defaultToDay?;
|
|
87
|
-
/**
|
|
88
|
-
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
89
|
-
*/
|
|
90
|
-
get toDay(): number | undefined;
|
|
91
|
-
set toDay(value: number | undefined);
|
|
92
|
-
private defaultDisabled;
|
|
93
|
-
/**
|
|
94
|
-
* Whether is disabled.
|
|
95
|
-
*/
|
|
96
|
-
get disabled(): boolean;
|
|
97
|
-
set disabled(value: boolean | string);
|
|
98
|
-
private defaultHidden;
|
|
99
|
-
/**
|
|
100
|
-
* Whether is hidden. If the activity is not started yet, it will be hidden.
|
|
101
|
-
*/
|
|
102
|
-
get hidden(): boolean;
|
|
103
|
-
set hidden(value: boolean | string);
|
|
104
|
-
private _renderIcon?;
|
|
105
|
-
/**
|
|
106
|
-
* The function for rendering the icon of the activity.
|
|
107
|
-
*/
|
|
108
|
-
get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
109
|
-
private _onRun;
|
|
110
|
-
/**
|
|
111
|
-
* The function that is called when the activity is runned.
|
|
112
|
-
*/
|
|
113
|
-
get onRun(): (props?: OnRunActivityProps) => void;
|
|
114
|
-
/**
|
|
115
|
-
* Whether the activity is a deadline.
|
|
116
|
-
* @returns Whether the activity is a deadline.
|
|
117
|
-
*/
|
|
118
|
-
isExpired(): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Export the activity properties.
|
|
121
|
-
* @returns The activity properties.
|
|
122
|
-
*/
|
|
123
|
-
export(): ActivityProps;
|
|
124
|
-
}
|
|
125
5
|
/**
|
|
126
|
-
* The activity model.
|
|
6
|
+
* The activity model. It is used to create an activity.
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* export const nap = new ActivityModel("nap",
|
|
10
|
+
* (_, event) => {
|
|
11
|
+
* if (event) {
|
|
12
|
+
* event.navigate("/game")
|
|
13
|
+
* callLabelWithGoNavigationCallBack(napLabel, event)
|
|
14
|
+
* }
|
|
15
|
+
* else {
|
|
16
|
+
* console.error("Event is undefined")
|
|
17
|
+
* }
|
|
18
|
+
* },
|
|
19
|
+
* {
|
|
20
|
+
* name: "Nap",
|
|
21
|
+
* fromHour: 5,
|
|
22
|
+
* toHour: 23,
|
|
23
|
+
* renderIcon: (activity, props) => {
|
|
24
|
+
* return <Button
|
|
25
|
+
* disabled={activity.disabled}
|
|
26
|
+
* onClick={() => {
|
|
27
|
+
* if (!props) {
|
|
28
|
+
* console.error("Props is undefined")
|
|
29
|
+
* return
|
|
30
|
+
* }
|
|
31
|
+
* activity.onRun(props)
|
|
32
|
+
* }}
|
|
33
|
+
* ariaLabel={activity.name}
|
|
34
|
+
* >
|
|
35
|
+
* <BedIcon />
|
|
36
|
+
* </Button>
|
|
37
|
+
* },
|
|
38
|
+
* }
|
|
39
|
+
* )
|
|
40
|
+
* ```
|
|
127
41
|
*/
|
|
128
42
|
declare class ActivityModel {
|
|
129
43
|
/**
|
|
@@ -176,13 +90,13 @@ declare class ActivityModel {
|
|
|
176
90
|
/**
|
|
177
91
|
* The function for rendering the icon of the activity.
|
|
178
92
|
*/
|
|
179
|
-
get renderIcon(): ((props
|
|
93
|
+
get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
180
94
|
private _onRun;
|
|
181
95
|
get _initialOnRun(): OnRunActivityEvent<ActivityStoredAbstract>;
|
|
182
96
|
/**
|
|
183
97
|
* The function that is called when the activity is runned.
|
|
184
98
|
*/
|
|
185
|
-
get onRun(): (props
|
|
99
|
+
get onRun(): (props: OnRunActivityProps) => void;
|
|
186
100
|
/**
|
|
187
101
|
* Whether the activity is a deadline.
|
|
188
102
|
* @returns Whether the activity is a deadline.
|
|
@@ -195,4 +109,4 @@ declare class ActivityModel {
|
|
|
195
109
|
export(): ActivityProps;
|
|
196
110
|
}
|
|
197
111
|
|
|
198
|
-
export {
|
|
112
|
+
export { ActivityModel as default };
|
package/dist/classes/Activity.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var pixiVn = require('@drincs/pixi-vn');
|
|
6
4
|
|
|
7
5
|
// src/classes/Activity.ts
|
|
@@ -182,7 +180,7 @@ var TimeManager = class _TimeManager {
|
|
|
182
180
|
* Get the current TimeManager.timeSlots index.
|
|
183
181
|
* You can use this property to create "Image that changes based on the time period":
|
|
184
182
|
* @example
|
|
185
|
-
* ```
|
|
183
|
+
* ```tsx
|
|
186
184
|
* import { TimeManager } from '@drincs/nqtr';
|
|
187
185
|
*
|
|
188
186
|
* function changeBackground() {
|
|
@@ -249,152 +247,6 @@ var TimeManager = class _TimeManager {
|
|
|
249
247
|
};
|
|
250
248
|
|
|
251
249
|
// src/classes/Activity.ts
|
|
252
|
-
var ActivityStoredAbstract = class {
|
|
253
|
-
/**
|
|
254
|
-
* @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
|
|
255
|
-
* @param props The activity properties.
|
|
256
|
-
*/
|
|
257
|
-
constructor(onRun, props) {
|
|
258
|
-
this.defaultName = props.name;
|
|
259
|
-
this.defaultFromHour = props.fromHour;
|
|
260
|
-
this.defaultToHour = props.toHour;
|
|
261
|
-
this.defaultFromDay = props.fromDay;
|
|
262
|
-
this.defaultToDay = props.toDay;
|
|
263
|
-
this.defaultDisabled = props.disabled || false;
|
|
264
|
-
this.defaultHidden = props.hidden || false;
|
|
265
|
-
this._renderIcon = props.renderIcon;
|
|
266
|
-
this._onRun = onRun;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* The name
|
|
270
|
-
*/
|
|
271
|
-
get name() {
|
|
272
|
-
return this.getStorageProperty("name") || this.defaultName || "";
|
|
273
|
-
}
|
|
274
|
-
set name(value) {
|
|
275
|
-
this.setStorageProperty("name", value);
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
279
|
-
*/
|
|
280
|
-
get fromHour() {
|
|
281
|
-
return this.getStorageProperty("fromHour") || this.defaultFromHour || TimeManager.minDayHours;
|
|
282
|
-
}
|
|
283
|
-
set fromHour(value) {
|
|
284
|
-
this.setStorageProperty("fromHour", value);
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
288
|
-
*/
|
|
289
|
-
get toHour() {
|
|
290
|
-
return this.getStorageProperty("toHour") || this.defaultToHour || TimeManager.maxDayHours + 1;
|
|
291
|
-
}
|
|
292
|
-
set toHour(value) {
|
|
293
|
-
this.setStorageProperty("toHour", value);
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
297
|
-
*/
|
|
298
|
-
get fromDay() {
|
|
299
|
-
return this.getStorageProperty("fromDay") || this.defaultFromDay;
|
|
300
|
-
}
|
|
301
|
-
set fromDay(value) {
|
|
302
|
-
this.setStorageProperty("fromDay", value);
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
306
|
-
*/
|
|
307
|
-
get toDay() {
|
|
308
|
-
return this.getStorageProperty("toDay") || this.defaultToDay;
|
|
309
|
-
}
|
|
310
|
-
set toDay(value) {
|
|
311
|
-
this.setStorageProperty("toDay", value);
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Whether is disabled.
|
|
315
|
-
*/
|
|
316
|
-
get disabled() {
|
|
317
|
-
let value = this.getStorageProperty("disabled") || this.defaultDisabled;
|
|
318
|
-
if (typeof value === "string") {
|
|
319
|
-
return pixiVn.getFlag(value);
|
|
320
|
-
}
|
|
321
|
-
return value;
|
|
322
|
-
}
|
|
323
|
-
set disabled(value) {
|
|
324
|
-
this.setStorageProperty("disabled", value);
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Whether is hidden. If the activity is not started yet, it will be hidden.
|
|
328
|
-
*/
|
|
329
|
-
get hidden() {
|
|
330
|
-
if (this.fromDay && this.fromDay > TimeManager.currentDay) {
|
|
331
|
-
return true;
|
|
332
|
-
}
|
|
333
|
-
if (!TimeManager.nowIsBetween(this.fromHour, this.toHour)) {
|
|
334
|
-
return true;
|
|
335
|
-
}
|
|
336
|
-
if (!this.isExpired) {
|
|
337
|
-
return true;
|
|
338
|
-
}
|
|
339
|
-
let value = this.getStorageProperty("hidden") || this.defaultHidden;
|
|
340
|
-
if (typeof value === "string") {
|
|
341
|
-
return pixiVn.getFlag(value);
|
|
342
|
-
}
|
|
343
|
-
return value;
|
|
344
|
-
}
|
|
345
|
-
set hidden(value) {
|
|
346
|
-
this.setStorageProperty("hidden", value);
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* The function for rendering the icon of the activity.
|
|
350
|
-
*/
|
|
351
|
-
get renderIcon() {
|
|
352
|
-
let render = this._renderIcon;
|
|
353
|
-
if (render === void 0) {
|
|
354
|
-
return void 0;
|
|
355
|
-
}
|
|
356
|
-
if (typeof render === "function") {
|
|
357
|
-
return (props) => {
|
|
358
|
-
return render(this, props);
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
return (props) => render;
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* The function that is called when the activity is runned.
|
|
365
|
-
*/
|
|
366
|
-
get onRun() {
|
|
367
|
-
return (props) => {
|
|
368
|
-
return this._onRun(this, props);
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Whether the activity is a deadline.
|
|
373
|
-
* @returns Whether the activity is a deadline.
|
|
374
|
-
*/
|
|
375
|
-
isExpired() {
|
|
376
|
-
if (this.toDay && this.toDay <= TimeManager.currentDay) {
|
|
377
|
-
return true;
|
|
378
|
-
}
|
|
379
|
-
return false;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Export the activity properties.
|
|
383
|
-
* @returns The activity properties.
|
|
384
|
-
*/
|
|
385
|
-
export() {
|
|
386
|
-
return {
|
|
387
|
-
name: this.getStorageProperty("name") || this.defaultName,
|
|
388
|
-
fromHour: this.getStorageProperty("fromHour") || this.defaultFromHour,
|
|
389
|
-
toHour: this.getStorageProperty("toHour") || this.defaultToHour,
|
|
390
|
-
fromDay: this.getStorageProperty("fromDay") || this.defaultFromDay,
|
|
391
|
-
toDay: this.getStorageProperty("toDay") || this.defaultToDay,
|
|
392
|
-
disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
|
|
393
|
-
hidden: this.getStorageProperty("hidden") || this.defaultHidden,
|
|
394
|
-
renderIcon: this._renderIcon
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
250
|
var ActivityModel = class {
|
|
399
251
|
/**
|
|
400
252
|
* @param id The activity id, that must be unique.
|
|
@@ -525,7 +377,6 @@ var ActivityModel = class {
|
|
|
525
377
|
}
|
|
526
378
|
};
|
|
527
379
|
|
|
528
|
-
exports
|
|
529
|
-
exports.default = ActivityModel;
|
|
380
|
+
module.exports = ActivityModel;
|
|
530
381
|
//# sourceMappingURL=out.js.map
|
|
531
382
|
//# sourceMappingURL=Activity.js.map
|