touchstudy-core 0.1.6 → 0.1.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.
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const CustomSelect: ({ defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
3
+ export default CustomSelect;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare const historyCore: import("history").History<unknown>;
2
2
  import { setLoading, setAlert, setUser, setLanguage } from "./redux/commons/action";
3
- import { BASE_URL, ACCESS_TOKEN, PUSHER_CONFIG, EXAM_CHANNEL, DATE_MIN_VALUE } from "./utils/constants";
3
+ import { BASE_URL, ACCESS_TOKEN, PUSHER_CONFIG, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, DATE_MIN_VALUE } from "./utils/constants";
4
4
  import utcToLocalTime from "./utils/utcToLocalTime";
5
5
  import Login from "./containers/Login/views/Login";
6
6
  import store from "./store";
@@ -22,4 +22,6 @@ import { useTranslation, I18nextProvider } from "react-i18next";
22
22
  import minutesToTimeSpan from "./utils/minutesToTimeSpan";
23
23
  import toISOString from "./utils/toISOString";
24
24
  import canAccessRoute from "./utils/canAccessRoute";
25
- export { diffFromNow, formatTime, utcToLocalTime, setLoading, BASE_URL, ACCESS_TOKEN, Login, store, historyCore, setAlert, setUser, Loading, NotFound, LayoutContext, api, ConfirmDialog, CommonDialog, CommonAlert, CustomPagination, useGoogleSignOut, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, setLanguage, i18n, TheLanguageDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, minutesToTimeSpan, toISOString, canAccessRoute };
25
+ import CustomSelect from "./components/Selects/CustomSelect";
26
+ import getAccessToken from "./utils/getAccessToken";
27
+ export { diffFromNow, formatTime, utcToLocalTime, setLoading, BASE_URL, ACCESS_TOKEN, Login, store, historyCore, setAlert, setUser, Loading, NotFound, LayoutContext, api, ConfirmDialog, CommonDialog, CommonAlert, CustomPagination, useGoogleSignOut, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, getAccessToken };
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ var gapiScript = require('gapi-script');
16
16
  var i18n = _interopDefault(require('i18next'));
17
17
  var reactI18next = require('react-i18next');
18
18
  var io5 = require('react-icons/io5');
19
+ var Select = _interopDefault(require('react-select'));
19
20
 
20
21
  var setLoading = toolkit.createAction("common/setLoading");
21
22
  var setAlert = toolkit.createAction("common/setAlert");
@@ -35,7 +36,8 @@ var PUSHER_CONFIG = {
35
36
  cluster: "ap1",
36
37
  key: "9018c77328885a14150b"
37
38
  };
38
- var EXAM_CHANNEL = "EXAM-CHANNEL";
39
+ var EXAM_CHANNEL = "presence-exam-channel";
40
+ var EXAM_STUDENT_CHANNEL = "EXAM-CHANNEL-{examCode}-STUDENT-{studentId}";
39
41
  var getAccessToken = function getAccessToken() {
40
42
  try {
41
43
  return localStorage.getItem(ACCESS_TOKEN);
@@ -961,10 +963,8 @@ var CustomPagination = function CustomPagination(_ref) {
961
963
  (function (ExamEvent) {
962
964
  ExamEvent["StartExam"] = "start-exam";
963
965
  ExamEvent["TerminateExam"] = "terminate-exam";
964
- ExamEvent["JoinExam"] = "join-exam";
965
966
  ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
966
- ExamEvent["TeacherDisconnectChannel"] = "teacher-disconnect-channel";
967
- ExamEvent["StudentDisconnectChannel"] = "student-disconnect-channel";
967
+ ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
968
968
  })(exports.ExamEvent || (exports.ExamEvent = {}));
969
969
 
970
970
  var problem_solving = "문제풀기";
@@ -1023,6 +1023,7 @@ var internet_connection_was_lost = "인터넷 연결이 끊어졌습니다";
1023
1023
  var problem = "문제";
1024
1024
  var problem_solving_time = "문제풀이 시간";
1025
1025
  var minutes = "분";
1026
+ var correct_rate = "정확한 비율";
1026
1027
  var lang_ko = {
1027
1028
  problem_solving: problem_solving,
1028
1029
  my_story: my_story,
@@ -1079,7 +1080,8 @@ var lang_ko = {
1079
1080
  internet_connection_was_lost: internet_connection_was_lost,
1080
1081
  problem: problem,
1081
1082
  problem_solving_time: problem_solving_time,
1082
- minutes: minutes
1083
+ minutes: minutes,
1084
+ correct_rate: correct_rate
1083
1085
  };
1084
1086
 
1085
1087
  var problem_solving$1 = "Problem Solving";
@@ -1138,6 +1140,7 @@ var internet_connection_was_lost$1 = "Internet connection was lost";
1138
1140
  var problem$1 = "Problem ";
1139
1141
  var problem_solving_time$1 = "Problem solving time";
1140
1142
  var minutes$1 = "m";
1143
+ var correct_rate$1 = "Correct rate";
1141
1144
  var lang_en = {
1142
1145
  problem_solving: problem_solving$1,
1143
1146
  my_story: my_story$1,
@@ -1194,7 +1197,8 @@ var lang_en = {
1194
1197
  internet_connection_was_lost: internet_connection_was_lost$1,
1195
1198
  problem: problem$1,
1196
1199
  problem_solving_time: problem_solving_time$1,
1197
- minutes: minutes$1
1200
+ minutes: minutes$1,
1201
+ correct_rate: correct_rate$1
1198
1202
  };
1199
1203
 
1200
1204
  i18n.use(reactI18next.initReactI18next).init({
@@ -1339,6 +1343,43 @@ var canAccess = function canAccess(userRoles, componentRoles) {
1339
1343
  return true;
1340
1344
  };
1341
1345
 
1346
+ function _objectWithoutPropertiesLoose(source, excluded) {
1347
+ if (source == null) return {};
1348
+ var target = {};
1349
+ var sourceKeys = Object.keys(source);
1350
+ var key, i;
1351
+ for (i = 0; i < sourceKeys.length; i++) {
1352
+ key = sourceKeys[i];
1353
+ if (excluded.indexOf(key) >= 0) continue;
1354
+ target[key] = source[key];
1355
+ }
1356
+ return target;
1357
+ }
1358
+
1359
+ var _excluded = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
1360
+ var CustomSelect = function CustomSelect(_ref) {
1361
+ var options = _ref.options,
1362
+ isDisabled = _ref.isDisabled,
1363
+ scrollBottom = _ref.scrollBottom,
1364
+ value = _ref.value,
1365
+ isMulti = _ref.isMulti,
1366
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
1367
+ var initialValues = Array.isArray(value) ? options.filter(function (i) {
1368
+ return value.includes(i.value);
1369
+ }) : isMulti ? options.filter(function (i) {
1370
+ return i.value == value;
1371
+ }) : options.find(function (i) {
1372
+ return i.value == value;
1373
+ });
1374
+ return React__default.createElement(Select, Object.assign({
1375
+ isDisabled: isDisabled,
1376
+ options: options,
1377
+ value: initialValues,
1378
+ menuPlacement: scrollBottom ? "top" : "auto",
1379
+ isMulti: isMulti
1380
+ }, rest));
1381
+ };
1382
+
1342
1383
  var historyCore = history.createBrowserHistory();
1343
1384
 
1344
1385
  Object.defineProperty(exports, 'I18nextProvider', {
@@ -1359,8 +1400,10 @@ exports.CommonAlert = CommonAlert;
1359
1400
  exports.CommonDialog = CommonDialog;
1360
1401
  exports.ConfirmDialog = ConfirmDialog;
1361
1402
  exports.CustomPagination = CustomPagination;
1403
+ exports.CustomSelect = CustomSelect;
1362
1404
  exports.DATE_MIN_VALUE = DATE_MIN_VALUE;
1363
1405
  exports.EXAM_CHANNEL = EXAM_CHANNEL;
1406
+ exports.EXAM_STUDENT_CHANNEL = EXAM_STUDENT_CHANNEL;
1364
1407
  exports.LayoutContext = LayoutContext;
1365
1408
  exports.Loading = Loading;
1366
1409
  exports.Login = Login;
@@ -1371,6 +1414,7 @@ exports.api = api$1;
1371
1414
  exports.canAccessRoute = canAccess;
1372
1415
  exports.diffFromNow = diffFromNow;
1373
1416
  exports.formatTime = formatTime;
1417
+ exports.getAccessToken = getAccessToken$1;
1374
1418
  exports.historyCore = historyCore;
1375
1419
  exports.i18n = i18n;
1376
1420
  exports.minutesToTimeSpan = minutesToTimeSpan;