@capytale/meta-player 0.6.16 → 0.6.18
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capytale/meta-player",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@capytale/activity.js": "^3.1.
|
|
19
|
+
"@capytale/activity.js": "^3.1.29",
|
|
20
20
|
"@capytale/capytale-anti-triche": "^0.2.1",
|
|
21
21
|
"@capytale/capytale-rich-text-editor": "^0.4.3",
|
|
22
22
|
"@reduxjs/toolkit": "^2.0.1",
|
|
@@ -6,11 +6,13 @@ import {
|
|
|
6
6
|
defaultMetaPlayerOptions,
|
|
7
7
|
} from "./metaPlayerOptions";
|
|
8
8
|
import { wf } from "@capytale/activity.js/activity/field/workflow";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ActivityJSData,
|
|
11
|
+
defaultActivityJSData,
|
|
12
|
+
EditorType,
|
|
13
|
+
} from "./activityJsData";
|
|
10
14
|
import { defaultUIState, SaveState, UIState } from "./uiState";
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
16
|
export type ActivityDataState = ActivityJSData & MetaPlayerOptions & UIState;
|
|
15
17
|
|
|
16
18
|
const initialState: ActivityDataState = {
|
|
@@ -63,7 +65,9 @@ export const activityDataSlice = createAppSlice({
|
|
|
63
65
|
state.pedagoLayout = action.payload.pedagoLayout;
|
|
64
66
|
state.supportsLightTheme = action.payload.supportsLightTheme;
|
|
65
67
|
state.supportsDarkTheme = action.payload.supportsDarkTheme;
|
|
66
|
-
state.preventEditIfHasEvaluations =
|
|
68
|
+
state.preventEditIfHasEvaluations =
|
|
69
|
+
action.payload.preventEditIfHasEvaluations;
|
|
70
|
+
state.hideSaveButton = action.payload.hideSaveButton;
|
|
67
71
|
},
|
|
68
72
|
),
|
|
69
73
|
setCanSaveInstructions: create.reducer(
|
|
@@ -154,7 +158,8 @@ export const activityDataSlice = createAppSlice({
|
|
|
154
158
|
selectCanReset: (data) => data.canReset,
|
|
155
159
|
selectPedagoLayout: (data) => data.pedagoLayout,
|
|
156
160
|
selectHasGradingOrComments: (data) => !!(data.grading || data.comments),
|
|
157
|
-
selectPreventEditIfHasEvaluations: (data) =>
|
|
161
|
+
selectPreventEditIfHasEvaluations: (data) =>
|
|
162
|
+
data.preventEditIfHasEvaluations,
|
|
158
163
|
selectSaveState: (data) => data.saveState,
|
|
159
164
|
selectReturnUrl: (data) => data.returnUrl,
|
|
160
165
|
selectNid: (data) => data.nid,
|
|
@@ -173,9 +178,10 @@ export const activityDataSlice = createAppSlice({
|
|
|
173
178
|
data.supportsDarkTheme && data.supportsLightTheme,
|
|
174
179
|
|
|
175
180
|
selectShowSaveButton: (data) =>
|
|
176
|
-
data.
|
|
177
|
-
data.mode === "
|
|
178
|
-
|
|
181
|
+
!data.hideSaveButton &&
|
|
182
|
+
(data.mode === "create" ||
|
|
183
|
+
data.mode === "review" ||
|
|
184
|
+
(data.mode === "assignment" && data.workflow === "current")),
|
|
179
185
|
|
|
180
186
|
selectAntiCheat: (data) => data.antiCheat,
|
|
181
187
|
selectHasAntiCheat: (data) =>
|
|
@@ -9,6 +9,7 @@ export type MetaPlayerOptions = {
|
|
|
9
9
|
| "default-vertical";
|
|
10
10
|
supportsLightTheme: boolean;
|
|
11
11
|
supportsDarkTheme: boolean;
|
|
12
|
+
hideSaveButton: boolean;
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export const defaultMetaPlayerOptions: MetaPlayerOptions = {
|
|
@@ -18,4 +19,5 @@ export const defaultMetaPlayerOptions: MetaPlayerOptions = {
|
|
|
18
19
|
pedagoLayout: "default-horizontal",
|
|
19
20
|
supportsLightTheme: true,
|
|
20
21
|
supportsDarkTheme: false,
|
|
22
|
+
hideSaveButton: false,
|
|
21
23
|
};
|