@nualang/nualang-ui-components 0.1.1277 → 0.1.1279

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.
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ResponsiveDialog = _interopRequireDefault(require("../ResponsiveDialog"));
8
+ var _Box = _interopRequireDefault(require("@mui/material/Box"));
9
+ var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
10
+ var _Settings = _interopRequireDefault(require("@mui/icons-material/Settings"));
11
+ var _material = require("@mui/material");
12
+ var _Search = _interopRequireDefault(require("@mui/icons-material/Search"));
13
+ var _East = _interopRequireDefault(require("@mui/icons-material/East"));
14
+ var _owl = _interopRequireDefault(require("./owl.png"));
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
+ // import { useState } from "react";
18
+ // components
19
+
20
+ function DynamicAIWarning({
21
+ t = text => text,
22
+ open = false,
23
+ handleClose,
24
+ handleSubmit,
25
+ dialogTitle
26
+ }) {
27
+ const submit = event => {
28
+ event.preventDefault();
29
+ handleSubmit();
30
+ };
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ResponsiveDialog.default, {
32
+ open: open,
33
+ handleClose: handleClose,
34
+ submitText: t("classroom_settings"),
35
+ dialogTitle: dialogTitle,
36
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
37
+ display: "flex",
38
+ flexDirection: "column",
39
+ alignItems: "stretch",
40
+ width: "100%",
41
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
42
+ variant: "h6",
43
+ component: "h2",
44
+ gutterBottom: true,
45
+ align: "left",
46
+ paddingBottom: 1,
47
+ children: t("chatbot_now_ai")
48
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
49
+ variant: "body2",
50
+ align: "left",
51
+ gutterBottom: true,
52
+ children: t("chatbot_now_ai_desc")
53
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
54
+ variant: "body2",
55
+ align: "left",
56
+ marginTop: 2,
57
+ gutterBottom: true,
58
+ children: t("chatbot_now_ai_benefit")
59
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
60
+ display: "flex",
61
+ alignItems: "center",
62
+ mt: 2,
63
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Search.default, {
64
+ sx: {
65
+ ml: -0.5,
66
+ mr: 0.5,
67
+ color: "text.secondary"
68
+ },
69
+ fontSize: "small"
70
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
71
+ variant: "body2",
72
+ align: "left",
73
+ children: t("ai_learn_more")
74
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_East.default, {
75
+ sx: {
76
+ ml: 0.5,
77
+ color: "text.secondary"
78
+ },
79
+ fontSize: "small"
80
+ })]
81
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
82
+ component: "a",
83
+ href: "https://nualang.com/",
84
+ target: "_blank",
85
+ rel: "noopener noreferrer",
86
+ display: "flex",
87
+ flexDirection: "row",
88
+ alignItems: "center",
89
+ sx: {
90
+ width: "100%",
91
+ borderRadius: 2,
92
+ my: 2,
93
+ backgroundColor: "#f9f0fa",
94
+ border: "1px solid #c2c2c2",
95
+ boxShadow: 1,
96
+ overflow: "hidden",
97
+ textDecoration: "none",
98
+ color: "inherit",
99
+ cursor: "pointer",
100
+ transition: "0.3s",
101
+ "&:hover": {
102
+ boxShadow: 3,
103
+ backgroundColor: "#f3e5f5"
104
+ }
105
+ },
106
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
107
+ flex: 2,
108
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
109
+ variant: "body1",
110
+ gutterBottom: true,
111
+ ml: 1,
112
+ children: t("chatbot_now_ai")
113
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
114
+ variant: "body2",
115
+ ml: 1,
116
+ children: "Link to a blog on AI Chatbots"
117
+ })]
118
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
119
+ flex: 1,
120
+ display: "flex",
121
+ justifyContent: "flex-end",
122
+ alignItems: "center",
123
+ height: "100%",
124
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
125
+ component: "img",
126
+ src: _owl.default,
127
+ alt: "AI Illustration",
128
+ sx: {
129
+ height: 90,
130
+ width: 90,
131
+ objectFit: "cover",
132
+ objectPosition: "center",
133
+ borderTopRightRadius: 8,
134
+ borderBottomRightRadius: 8,
135
+ display: "block"
136
+ }
137
+ })
138
+ })]
139
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
140
+ display: "flex",
141
+ alignItems: "center",
142
+ pt: 1,
143
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Settings.default, {
144
+ sx: {
145
+ ml: -0.5,
146
+ mr: 0.5,
147
+ color: "text.secondary"
148
+ },
149
+ fontSize: "small"
150
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
151
+ variant: "body2",
152
+ align: "left",
153
+ children: t("prefer_original_version")
154
+ })]
155
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
156
+ variant: "body2",
157
+ align: "left",
158
+ children: [t("chatbot_now_ai_revert_settings"), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
159
+ component: "span",
160
+ variant: "body2",
161
+ sx: {
162
+ color: "primary.main",
163
+ cursor: "pointer",
164
+ fontWeight: "bold"
165
+ },
166
+ onClick: submit,
167
+ children: t("classroom_settings")
168
+ }), " ", "for this class."]
169
+ })]
170
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {
171
+ sx: {
172
+ paddingTop: 3,
173
+ marginBottom: -2,
174
+ width: "100%"
175
+ }
176
+ })]
177
+ });
178
+ }
179
+ var _default = exports.default = DynamicAIWarning;
@@ -151,9 +151,13 @@ function Bot({
151
151
  toggleListen(learnLang, speechContexts, model);
152
152
  };
153
153
  let isDynamicResponsesClassroomEnabled = isDynamicResponsesEnabled;
154
- if (courseSettings?.isDynamicResponsesEnabled === "enabled") {
155
- isDynamicResponsesClassroomEnabled = "enable";
156
- } else if (courseSettings?.isDynamicResponsesEnabled === "disabled") {
154
+ if (parentClassroom?.isDynamicResponsesEnabled === "enabled") {
155
+ if (courseSettings?.isDynamicResponsesEnabled === "enabled") {
156
+ isDynamicResponsesClassroomEnabled = "enable";
157
+ } else if (courseSettings?.isDynamicResponsesEnabled === "disabled") {
158
+ isDynamicResponsesClassroomEnabled = "disable";
159
+ }
160
+ } else {
157
161
  isDynamicResponsesClassroomEnabled = "disable";
158
162
  }
159
163
  const exerciseState = (0, _useExerciseState.default)({
@@ -105,11 +105,11 @@ function BotSettings({
105
105
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
106
106
  value: "enable",
107
107
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
108
- label: t("enable")
108
+ label: t("enabled")
109
109
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
110
110
  value: "disable",
111
111
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
112
- label: t("disable")
112
+ label: t("disabled")
113
113
  })]
114
114
  })]
115
115
  })
@@ -136,11 +136,11 @@ function BotSettings({
136
136
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
137
137
  value: true,
138
138
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
139
- label: t("enable")
139
+ label: t("enabled")
140
140
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
141
141
  value: false,
142
142
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
143
- label: t("disable")
143
+ label: t("disabled")
144
144
  })]
145
145
  })]
146
146
  })
@@ -179,11 +179,11 @@ function BotSettings({
179
179
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
180
180
  value: "enable",
181
181
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
182
- label: t("enable")
182
+ label: t("enabled")
183
183
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
184
184
  value: "disable",
185
185
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
186
- label: t("disable")
186
+ label: t("disabled")
187
187
  })]
188
188
  })]
189
189
  })
@@ -37,6 +37,7 @@ function CreateClassroom({
37
37
  visibility: "private",
38
38
  vchatEnabled: true,
39
39
  vchatEnabledInSettings: true,
40
+ isDynamicResponsesEnabled: 'enabled',
40
41
  enrolmentKey: "",
41
42
  allowedDomains: [],
42
43
  collaborators: [],
@@ -10,6 +10,7 @@ var Yup = _interopRequireWildcard(require("yup"));
10
10
  var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
11
11
  var _ChipInput = _interopRequireDefault(require("../../../../Forms/ChipInput"));
12
12
  var _index = require("../../../../utils/index");
13
+ var _Help = _interopRequireDefault(require("@mui/icons-material/Help"));
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
16
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -25,6 +26,8 @@ function ClassroomSettings({
25
26
  isUpdateClassroom = false,
26
27
  scrollToDiscuss = false,
27
28
  setScrollToDiscuss,
29
+ scrollToDynamicResponses = false,
30
+ setScrollToDynamicResponses,
28
31
  isVideoChatEnabled
29
32
  }) {
30
33
  const {
@@ -32,9 +35,11 @@ function ClassroomSettings({
32
35
  enrolmentKey,
33
36
  allowedDomains,
34
37
  collaborators,
35
- vchatEnabledInSettings
38
+ vchatEnabledInSettings,
39
+ isDynamicResponsesEnabled
36
40
  } = values;
37
41
  const vchatEnabledInSettingsRef = (0, _react.useRef)(null);
42
+ const dynamicResponsesRef = (0, _react.useRef)(null);
38
43
  const generateRandomEnrolmentKey = () => {
39
44
  return String(Math.floor(Math.random() * 90000) + 10000);
40
45
  };
@@ -55,6 +60,15 @@ function ClassroomSettings({
55
60
  setScrollToDiscuss(false);
56
61
  }
57
62
  }, [scrollToDiscuss]);
63
+ (0, _react.useEffect)(() => {
64
+ if (scrollToDynamicResponses) {
65
+ dynamicResponsesRef.current.scrollIntoView({
66
+ behavior: "smooth",
67
+ block: "center"
68
+ });
69
+ setScrollToDynamicResponses(false);
70
+ }
71
+ }, [scrollToDynamicResponses]);
58
72
  const isInviteFeatureDisabled = classroomId && classroomId.toLowerCase().includes("wayside");
59
73
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
60
74
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
@@ -271,6 +285,54 @@ function ClassroomSettings({
271
285
  })]
272
286
  })]
273
287
  })
288
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
289
+ ref: dynamicResponsesRef,
290
+ size: {
291
+ xs: 12,
292
+ md: 12
293
+ },
294
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormControl, {
295
+ component: "fieldset",
296
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormLabel, {
297
+ component: "legend",
298
+ children: [t("dynamic_response"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
299
+ title: t("dynamic_responses_info"),
300
+ placement: "right",
301
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
302
+ sx: {
303
+ padding: 0,
304
+ marginLeft: 1
305
+ },
306
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Help.default, {
307
+ fontSize: "small"
308
+ })
309
+ })
310
+ })]
311
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
312
+ color: "textSecondary",
313
+ children: t("dynamic_response_desc")
314
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.RadioGroup, {
315
+ row: true,
316
+ "aria-label": "isDynamicResponsesEnabled",
317
+ name: "isDynamicResponsesEnabled",
318
+ value: isDynamicResponsesEnabled || 'enabled',
319
+ onChange: handleChange,
320
+ onBlur: handleBlur,
321
+ helperText: touched.isDynamicResponsesEnabled ? errors.isDynamicResponsesEnabled : "",
322
+ error: touched.isDynamicResponsesEnabled && Boolean(errors.isDynamicResponsesEnabled),
323
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
324
+ value: 'enabled',
325
+ control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
326
+ label: t("enabled"),
327
+ "data-cy": "enable-dynamic-responses-in-settings"
328
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
329
+ value: 'disabled',
330
+ control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
331
+ label: t("disabled"),
332
+ "data-cy": "disable-dynamic-responses-in-settings"
333
+ })]
334
+ })]
335
+ })
274
336
  })]
275
337
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
276
338
  children: t("add_collaborators")
@@ -18,7 +18,8 @@ function Settings({
18
18
  errors,
19
19
  handleBlur,
20
20
  courseId,
21
- setFieldValue
21
+ setFieldValue,
22
+ classroomIsDynamicResponsesEnabled
22
23
  }) {
23
24
  const {
24
25
  courseSettings
@@ -68,11 +69,11 @@ function Settings({
68
69
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
69
70
  value: "enabled",
70
71
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
71
- label: t("enable")
72
+ label: t("enabled")
72
73
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
73
74
  value: "disabled",
74
75
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
75
- label: t("disable")
76
+ label: t("disabled")
76
77
  })]
77
78
  })]
78
79
  })
@@ -115,11 +116,11 @@ function Settings({
115
116
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
116
117
  value: "enabled",
117
118
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
118
- label: t("enable")
119
+ label: t("enabled")
119
120
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
120
121
  value: "disabled",
121
122
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
122
- label: t("disable")
123
+ label: t("disabled")
123
124
  })]
124
125
  })]
125
126
  })
@@ -162,11 +163,11 @@ function Settings({
162
163
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
163
164
  value: "enabled",
164
165
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
165
- label: t("enable")
166
+ label: t("enabled")
166
167
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
167
168
  value: "disabled",
168
169
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
169
- label: t("disable")
170
+ label: t("disabled")
170
171
  })]
171
172
  })]
172
173
  })
@@ -200,7 +201,7 @@ function Settings({
200
201
  row: true,
201
202
  "aria-label": "Dynamic Responses",
202
203
  name: `courseSettings.${courseId}.isDynamicResponsesEnabled`,
203
- value: thisCoursesSettings.isDynamicResponsesEnabled || "default",
204
+ value: classroomIsDynamicResponsesEnabled === 'disabled' ? 'disabled' : thisCoursesSettings.isDynamicResponsesEnabled || "default",
204
205
  onChange: event => {
205
206
  const newCourseSettings = {
206
207
  ...courseSettings,
@@ -217,11 +218,12 @@ function Settings({
217
218
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
218
219
  value: "default",
219
220
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
220
- label: t("course_default")
221
+ label: t("course_default"),
222
+ disabled: classroomIsDynamicResponsesEnabled === 'disabled'
221
223
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
222
224
  value: "disabled",
223
225
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
224
- label: t("disable")
226
+ label: t("disabled")
225
227
  })]
226
228
  })]
227
229
  })
@@ -237,7 +239,8 @@ function Course({
237
239
  errors,
238
240
  handleChange,
239
241
  handleBlur,
240
- setFieldValue
242
+ setFieldValue,
243
+ classroomIsDynamicResponsesEnabled
241
244
  }) {
242
245
  const [open, setOpen] = (0, _react.useState)(false);
243
246
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.List, {
@@ -289,7 +292,8 @@ function Course({
289
292
  handleChange: handleChange,
290
293
  handleBlur: handleBlur,
291
294
  courseId: course.courseId,
292
- setFieldValue: setFieldValue
295
+ setFieldValue: setFieldValue,
296
+ classroomIsDynamicResponsesEnabled: classroomIsDynamicResponsesEnabled
293
297
  })
294
298
  })
295
299
  })]
@@ -303,7 +307,8 @@ function CourseSettings({
303
307
  touched,
304
308
  handleChange,
305
309
  handleBlur,
306
- setFieldValue
310
+ setFieldValue,
311
+ classroomIsDynamicResponsesEnabled
307
312
  }) {
308
313
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
309
314
  children: courses.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
@@ -318,7 +323,8 @@ function CourseSettings({
318
323
  errors: errors,
319
324
  handleChange: handleChange,
320
325
  handleBlur: handleBlur,
321
- setFieldValue: setFieldValue
326
+ setFieldValue: setFieldValue,
327
+ classroomIsDynamicResponsesEnabled: classroomIsDynamicResponsesEnabled
322
328
  }))]
323
329
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
324
330
  children: t("classroom_courses_not_found_desc")
@@ -103,11 +103,11 @@ function RoleplaySettings({
103
103
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
104
104
  value: "enable",
105
105
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
106
- label: t("enable")
106
+ label: t("enabled")
107
107
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
108
108
  value: "disable",
109
109
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
110
- label: t("disable")
110
+ label: t("disabled")
111
111
  })]
112
112
  })]
113
113
  })]
@@ -135,11 +135,11 @@ function RoleplaySettings({
135
135
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
136
136
  value: false,
137
137
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
138
- label: t("enable")
138
+ label: t("enabled")
139
139
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
140
140
  value: true,
141
141
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
142
- label: t("disable")
142
+ label: t("disabled")
143
143
  })]
144
144
  })]
145
145
  })
@@ -162,11 +162,11 @@ function RoleplaySettings({
162
162
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
163
163
  value: false,
164
164
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
165
- label: t("enable")
165
+ label: t("enabled")
166
166
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
167
167
  value: true,
168
168
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
169
- label: t("disable")
169
+ label: t("disabled")
170
170
  })]
171
171
  })]
172
172
  })
@@ -189,11 +189,11 @@ function RoleplaySettings({
189
189
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
190
190
  value: false,
191
191
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
192
- label: t("enable")
192
+ label: t("enabled")
193
193
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
194
194
  value: true,
195
195
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
196
- label: t("disable")
196
+ label: t("disabled")
197
197
  })]
198
198
  })]
199
199
  })
@@ -216,11 +216,11 @@ function RoleplaySettings({
216
216
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
217
217
  value: false,
218
218
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
219
- label: t("enable")
219
+ label: t("enabled")
220
220
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
221
221
  value: true,
222
222
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
223
- label: t("disable")
223
+ label: t("disabled")
224
224
  })]
225
225
  })]
226
226
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
@@ -242,11 +242,11 @@ function RoleplaySettings({
242
242
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
243
243
  value: false,
244
244
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
245
- label: t("enable")
245
+ label: t("enabled")
246
246
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
247
247
  value: true,
248
248
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
249
- label: t("disable")
249
+ label: t("disabled")
250
250
  })]
251
251
  })]
252
252
  })
@@ -113,11 +113,11 @@ function RoleplaySettings({
113
113
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
114
114
  value: "enable",
115
115
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
116
- label: t("enable")
116
+ label: t("enabled")
117
117
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
118
118
  value: "disable",
119
119
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
120
- label: t("disable")
120
+ label: t("disabled")
121
121
  })]
122
122
  })
123
123
  })]
@@ -157,11 +157,11 @@ function RoleplaySettings({
157
157
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
158
158
  value: false,
159
159
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
160
- label: t("enable")
160
+ label: t("enabled")
161
161
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
162
162
  value: true,
163
163
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
164
- label: t("disable")
164
+ label: t("disabled")
165
165
  })]
166
166
  })
167
167
  })]
@@ -196,11 +196,11 @@ function RoleplaySettings({
196
196
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
197
197
  value: false,
198
198
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
199
- label: t("enable")
199
+ label: t("enabled")
200
200
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
201
201
  value: true,
202
202
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
203
- label: t("disable")
203
+ label: t("disabled")
204
204
  })]
205
205
  })
206
206
  })]
@@ -235,11 +235,11 @@ function RoleplaySettings({
235
235
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
236
236
  value: false,
237
237
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
238
- label: t("enable")
238
+ label: t("enabled")
239
239
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
240
240
  value: true,
241
241
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
242
- label: t("disable")
242
+ label: t("disabled")
243
243
  })]
244
244
  })
245
245
  })]
@@ -274,11 +274,11 @@ function RoleplaySettings({
274
274
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
275
275
  value: false,
276
276
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
277
- label: t("enable")
277
+ label: t("enabled")
278
278
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
279
279
  value: true,
280
280
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
281
- label: t("disable")
281
+ label: t("disabled")
282
282
  })]
283
283
  })
284
284
  })]
@@ -313,11 +313,11 @@ function RoleplaySettings({
313
313
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
314
314
  value: false,
315
315
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
316
- label: t("enable")
316
+ label: t("enabled")
317
317
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
318
318
  value: true,
319
319
  control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
320
- label: t("disable")
320
+ label: t("disabled")
321
321
  })]
322
322
  })
323
323
  })]
@@ -32,7 +32,8 @@ function UpdateClassroom({
32
32
  collaborators: [],
33
33
  tags: [],
34
34
  picture: null,
35
- courseSettings: {}
35
+ courseSettings: {},
36
+ isDynamicResponsesEnabled: 'enabled'
36
37
  },
37
38
  onSubmit,
38
39
  enableReinitialize,
@@ -46,6 +47,8 @@ function UpdateClassroom({
46
47
  courses,
47
48
  scrollToDiscuss,
48
49
  setScrollToDiscuss,
50
+ scrollToDynamicResponses,
51
+ setScrollToDynamicResponses,
49
52
  isClassroomArchived = false,
50
53
  verificationStatus,
51
54
  isVideoChatEnabled
@@ -67,7 +70,8 @@ function UpdateClassroom({
67
70
  picture,
68
71
  banner,
69
72
  tags,
70
- courseSettings
73
+ courseSettings,
74
+ isDynamicResponsesEnabled
71
75
  } = initialValues;
72
76
  const courseIds = courses.map(course => course.courseId);
73
77
  let validatedCourseSettings;
@@ -180,7 +184,8 @@ function UpdateClassroom({
180
184
  allowedDomains,
181
185
  collaborators,
182
186
  vchatEnabled,
183
- vchatEnabledInSettings
187
+ vchatEnabledInSettings,
188
+ isDynamicResponsesEnabled
184
189
  },
185
190
  enableReinitialize: enableReinitialize,
186
191
  validationSchema: _Steps.ClassroomSettings.validationSchema,
@@ -224,6 +229,8 @@ function UpdateClassroom({
224
229
  values: values,
225
230
  scrollToDiscuss: scrollToDiscuss,
226
231
  setScrollToDiscuss: setScrollToDiscuss,
232
+ scrollToDynamicResponses: scrollToDynamicResponses,
233
+ setScrollToDynamicResponses: setScrollToDynamicResponses,
227
234
  isVideoChatEnabled: isVideoChatEnabled,
228
235
  ...otherProps
229
236
  })
@@ -345,6 +352,7 @@ function UpdateClassroom({
345
352
  values: values,
346
353
  handleChange: handleChange,
347
354
  setFieldValue: setFieldValue,
355
+ classroomIsDynamicResponsesEnabled: isDynamicResponsesEnabled,
348
356
  ...otherProps
349
357
  })
350
358
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CardActions, {
@@ -41,7 +41,6 @@ var _index = _interopRequireDefault(require("../../../utils/placeholder-images/i
41
41
  var _CreateMeetingMultiStepForm = _interopRequireDefault(require("../../../Forms/CreateMeetingMultiStepForm/CreateMeetingMultiStepForm"));
42
42
  var _RecordingListCards = _interopRequireDefault(require("../../../Tables/RecordingListCards/RecordingListCards"));
43
43
  var _MeetingPromptsList = _interopRequireDefault(require("../../../Tables/MeetingPrompstList/MeetingPromptsList"));
44
- var _SubmissionsTableCards = _interopRequireDefault(require("../../../Tables/SubmissionsTableCards/SubmissionsTableCards"));
45
44
  var _SelectExercise = _interopRequireDefault(require("../../../Dialogs/SelectExercise"));
46
45
  var _iconsMaterial = require("@mui/icons-material");
47
46
  var _Discussions = _interopRequireDefault(require("../../../Misc/NotFound/Discussions"));
@@ -58,6 +57,7 @@ var _ExitToApp = _interopRequireDefault(require("@mui/icons-material/ExitToApp")
58
57
  var _AssignmentCardsList = _interopRequireDefault(require("../../../Assignments/AssignmentCardsList/AssignmentCardsList"));
59
58
  var _Lightbulb = _interopRequireDefault(require("@mui/icons-material/Lightbulb"));
60
59
  var _CreatorNotSubscribedUpgrade = _interopRequireDefault(require("../../../Dialogs/CreatorNotSubscribedUpgrade/CreatorNotSubscribedUpgrade"));
60
+ var _DynamicAIWarning = _interopRequireDefault(require("../../../Dialogs/DynamicAIWarning/DynamicAIWarning"));
61
61
  var _jsxRuntime = require("react/jsx-runtime");
62
62
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
63
63
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
@@ -552,9 +552,18 @@ function Classroom({
552
552
  const [isPictureDialogOpen, setIsPictureDialogOpen] = (0, _react.useState)(false);
553
553
  const [overwriteValue, setOverwriteValue] = (0, _react.useState)(null);
554
554
  const [scrollToDiscuss, setScrollToDiscuss] = (0, _react.useState)(false);
555
+ const [scrollToDynamicResponses, setScrollToDynamicResponses] = (0, _react.useState)(false);
556
+ const [displayDynamicAiDialog, setDisplayDynamicAiDialog] = (0, _react.useState)(false);
555
557
  const isWaysideClassroom = classroom?.classroomId?.toLowerCase().includes("wayside");
556
558
  const [isSubscriptionExpired, setIsSubscriptionExpired] = (0, _react.useState)(false);
557
559
  let tabs;
560
+ (0, _react.useEffect)(() => {
561
+ const hasDisplayed = localStorage.getItem("displayDynamicAiDialog");
562
+ if (!hasDisplayed && classroom?.isCreator) {
563
+ setDisplayDynamicAiDialog(true);
564
+ localStorage.setItem("displayDynamicAiDialog", "true");
565
+ }
566
+ }, [classroom]);
558
567
  (0, _react.useEffect)(() => {
559
568
  if (creatorSubscription?.isPaidUser === false) {
560
569
  setIsSubscriptionExpired(true);
@@ -864,6 +873,11 @@ function Classroom({
864
873
  window.location.hash = "#Settings";
865
874
  setScrollToDiscuss(true);
866
875
  };
876
+ const handleGoToDynamicResponsesSettings = () => {
877
+ setDisplayDynamicAiDialog(false);
878
+ window.location.hash = "#Settings";
879
+ setScrollToDynamicResponses(true);
880
+ };
867
881
  tabs = [{
868
882
  label: t("courses"),
869
883
  id: "Courses",
@@ -980,7 +994,7 @@ function Classroom({
980
994
  })
981
995
  })
982
996
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
983
- children: createdDiscussions?.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
997
+ children: isCreator && createdDiscussions?.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
984
998
  id: "discussGroupedDiscussions",
985
999
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MeetingPromptsList.default, {
986
1000
  t: t,
@@ -1012,7 +1026,7 @@ function Classroom({
1012
1026
  handleArchiveSubmissions: handleArchiveSubmissions
1013
1027
  })
1014
1028
  })
1015
- }), discussions?.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1029
+ }), !isCreator && discussions?.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1016
1030
  id: "discussScheduled",
1017
1031
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScheduleListCards.default, {
1018
1032
  t: t,
@@ -1023,7 +1037,7 @@ function Classroom({
1023
1037
  getSchedules: getSchedules,
1024
1038
  scheduleListData: discussions
1025
1039
  })
1026
- }), recordingDiscussions?.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1040
+ }), !isCreator && recordingDiscussions?.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1027
1041
  id: "discussRecorded",
1028
1042
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RecordingListCards.default, {
1029
1043
  t: t,
@@ -1144,6 +1158,8 @@ function Classroom({
1144
1158
  courses: courses,
1145
1159
  scrollToDiscuss: scrollToDiscuss,
1146
1160
  setScrollToDiscuss: setScrollToDiscuss,
1161
+ scrollToDynamicResponses: scrollToDynamicResponses,
1162
+ setScrollToDynamicResponses: setScrollToDynamicResponses,
1147
1163
  isClassroomArchived: isArchived,
1148
1164
  classroomMembers: classroomMembers,
1149
1165
  verificationStatus: verificationStatus,
@@ -1514,6 +1530,11 @@ function Classroom({
1514
1530
  itemId: classroomId,
1515
1531
  learnLang: classroom.learnLang,
1516
1532
  isWaysideClassroom: isWaysideClassroom
1533
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DynamicAIWarning.default, {
1534
+ handleSubmit: handleGoToDynamicResponsesSettings,
1535
+ open: displayDynamicAiDialog,
1536
+ handleClose: () => setDisplayDynamicAiDialog(false),
1537
+ t: t
1517
1538
  }), run && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactJoyride.default, {
1518
1539
  callback: handleJoyrideCallback,
1519
1540
  continuous: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1277",
3
+ "version": "0.1.1279",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",