@capytale/meta-player 0.3.5 → 0.3.7
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/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { useAppDispatch } from "../../app/hooks";
|
|
2
|
-
import { setIsPlayerDirty } from "./activityDataSlice";
|
|
2
|
+
import { setIsPlayerDirty, setSaveState } from "./activityDataSlice";
|
|
3
3
|
|
|
4
4
|
const useNotifyIsDirty = (isDirty: boolean = true) => {
|
|
5
5
|
const dispatch = useAppDispatch();
|
|
6
6
|
return () => dispatch(setIsPlayerDirty(isDirty));
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const useSave = () => {
|
|
10
|
+
const dispatch = useAppDispatch();
|
|
11
|
+
return () => dispatch(setSaveState("should-save"));
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export { useNotifyIsDirty, useSave };
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ActivityMode } from "@capytale/activity.js/activity/activitySession";
|
|
2
2
|
import { useAppSelector } from "../app/hooks";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
selectMode,
|
|
5
|
+
selectWorkflow,
|
|
6
|
+
} from "../features/activityData/activityDataSlice";
|
|
4
7
|
|
|
5
8
|
export const useMode = () => {
|
|
6
9
|
const mode: ActivityMode = useAppSelector(selectMode);
|
|
7
10
|
return mode;
|
|
8
11
|
};
|
|
12
|
+
|
|
13
|
+
export const useWorkflow = () => {
|
|
14
|
+
const workflow = useAppSelector(selectWorkflow);
|
|
15
|
+
return workflow;
|
|
16
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -6,12 +6,12 @@ import MetaPlayerOptionsSetter from "./features/activityData/MetaPlayerOptionsSe
|
|
|
6
6
|
import BeforeSaveAction from "./features/activityJS/BeforeSaveAction";
|
|
7
7
|
import BeforeResetAction from "./features/activityJS/BeforeResetAction";
|
|
8
8
|
import AfterSaveAction from "./features/activityJS/AfterSaveAction";
|
|
9
|
-
import { useMode } from "./hooks";
|
|
9
|
+
import { useMode, useWorkflow } from "./hooks";
|
|
10
10
|
import {
|
|
11
11
|
useActivityJS,
|
|
12
12
|
useActivityJsEssentials,
|
|
13
13
|
} from "./features/activityJS/ActivityJSProvider";
|
|
14
|
-
import { useNotifyIsDirty } from "./features/activityData/hooks";
|
|
14
|
+
import { useNotifyIsDirty, useSave } from "./features/activityData/hooks";
|
|
15
15
|
import { useOrientation } from "./features/layout/hooks";
|
|
16
16
|
import { ActivitySidebarActionsSetter } from "./features/navbar/ActivitySidebarActions";
|
|
17
17
|
import { ActivityQuickActionsSetter } from "./features/navbar/ActivityQuickActions";
|
|
@@ -27,9 +27,11 @@ export {
|
|
|
27
27
|
BeforeResetAction,
|
|
28
28
|
AfterSaveAction,
|
|
29
29
|
useMode,
|
|
30
|
+
useWorkflow,
|
|
30
31
|
useActivityJS,
|
|
31
32
|
useActivityJsEssentials,
|
|
32
33
|
useNotifyIsDirty,
|
|
34
|
+
useSave,
|
|
33
35
|
useOrientation,
|
|
34
36
|
ActivitySidebarActionsSetter,
|
|
35
37
|
ActivityQuickActionsSetter,
|