@elice/material-quiz 1.240718.0-trasncript.1 → 1.240718.0-trasncript.2

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.
Files changed (127) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +423 -0
  2. package/cjs/components/eb-sortable/EbDraggable.js +42 -33
  3. package/cjs/components/eb-sortable/EbDroppable.js +27 -20
  4. package/cjs/components/markdown-editor/index.d.ts +1 -2
  5. package/cjs/components/markdown-editor/index.js +19 -10
  6. package/cjs/components/material-quiz/MaterialQuiz.js +114 -83
  7. package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +36 -29
  8. package/cjs/components/material-quiz/MaterialQuizInfo.js +151 -149
  9. package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +175 -127
  10. package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +360 -286
  11. package/cjs/components/material-quiz/MaterialQuizSelectOne.js +172 -126
  12. package/cjs/components/material-quiz/MaterialQuizShimmer.js +46 -39
  13. package/cjs/components/material-quiz/MaterialQuizText.js +163 -115
  14. package/cjs/components/material-quiz/QuizResultBadge.js +32 -22
  15. package/cjs/components/material-quiz/QuizSubmitStatusText.js +21 -16
  16. package/cjs/components/material-quiz/constants/color.js +5 -5
  17. package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  18. package/cjs/components/material-quiz/context/MaterialQuizContext.js +156 -93
  19. package/cjs/components/material-quiz/index.js +9 -0
  20. package/cjs/components/material-quiz/locales/index.js +13 -0
  21. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +259 -161
  22. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +134 -100
  23. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +130 -101
  24. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +64 -52
  25. package/cjs/components/material-quiz/material-quiz-group/context/context.js +5 -1
  26. package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +47 -36
  27. package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +280 -232
  28. package/cjs/components/material-quiz-edit/context.js +8 -2
  29. package/cjs/components/material-quiz-edit/index.js +7 -0
  30. package/cjs/components/material-quiz-edit/locales/index.js +13 -0
  31. package/cjs/components/material-quiz-edit/options/OptionEditor.js +70 -46
  32. package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +174 -148
  33. package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +175 -149
  34. package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +164 -144
  35. package/cjs/components/material-quiz-edit/options/OptionText.js +90 -82
  36. package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
  37. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +156 -112
  38. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +288 -196
  39. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +88 -75
  40. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +108 -92
  41. package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
  42. package/cjs/components/material-quiz-edit/utils/editValue.js +21 -12
  43. package/cjs/components/shared/QuestionBox.js +198 -165
  44. package/cjs/components/shared/QuizDraggbleDroppedOption.js +11 -12
  45. package/cjs/components/shared/QuizDraggbleDummyOption.js +23 -16
  46. package/cjs/components/shared/QuizDraggbleOption.js +65 -59
  47. package/cjs/components/shared/StyledMarkdown.js +5 -1
  48. package/cjs/components/shared/index.js +19 -0
  49. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
  50. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  51. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
  52. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +59 -68
  53. package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
  54. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  55. package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
  56. package/cjs/components/shared/question-radio/QuestionRadioOption.js +52 -59
  57. package/cjs/components/shared/utils/getQuestionStatusStyle.js +7 -9
  58. package/cjs/components/shared/utils/mergeRefs.js +15 -6
  59. package/cjs/constant/element.js +3 -3
  60. package/cjs/constant/index.js +9 -0
  61. package/cjs/helpers/index.js +8 -10
  62. package/cjs/hooks/index.js +7 -0
  63. package/cjs/hooks/useCaculatePassage.js +21 -20
  64. package/es/_virtual/_rollupPluginBabelHelpers.js +408 -0
  65. package/es/components/eb-sortable/EbDraggable.js +37 -33
  66. package/es/components/eb-sortable/EbDroppable.js +22 -20
  67. package/es/components/markdown-editor/index.d.ts +1 -2
  68. package/es/components/markdown-editor/index.js +15 -10
  69. package/es/components/material-quiz/MaterialQuiz.js +109 -83
  70. package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +32 -29
  71. package/es/components/material-quiz/MaterialQuizInfo.js +148 -150
  72. package/es/components/material-quiz/MaterialQuizSelectMultiple.js +171 -127
  73. package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +356 -287
  74. package/es/components/material-quiz/MaterialQuizSelectOne.js +168 -126
  75. package/es/components/material-quiz/MaterialQuizShimmer.js +42 -39
  76. package/es/components/material-quiz/MaterialQuizText.js +158 -115
  77. package/es/components/material-quiz/QuizResultBadge.js +27 -22
  78. package/es/components/material-quiz/QuizSubmitStatusText.js +17 -16
  79. package/es/components/material-quiz/constants/color.js +5 -5
  80. package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  81. package/es/components/material-quiz/context/MaterialQuizContext.js +153 -94
  82. package/es/components/material-quiz/index.js +2 -0
  83. package/es/components/material-quiz/locales/index.js +4 -0
  84. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +253 -161
  85. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +129 -100
  86. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +125 -101
  87. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +60 -52
  88. package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
  89. package/es/components/material-quiz-edit/MaterialQuizEdit.js +43 -36
  90. package/es/components/material-quiz-edit/MaterialQuizEditContent.js +272 -229
  91. package/es/components/material-quiz-edit/context.js +4 -2
  92. package/es/components/material-quiz-edit/index.js +1 -0
  93. package/es/components/material-quiz-edit/locales/index.js +4 -0
  94. package/es/components/material-quiz-edit/options/OptionEditor.js +64 -46
  95. package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +170 -148
  96. package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +171 -149
  97. package/es/components/material-quiz-edit/options/OptionSelectOne.js +159 -144
  98. package/es/components/material-quiz-edit/options/OptionText.js +86 -82
  99. package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
  100. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +151 -112
  101. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +283 -197
  102. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +83 -75
  103. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +103 -92
  104. package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
  105. package/es/components/material-quiz-edit/utils/editValue.js +17 -12
  106. package/es/components/shared/QuestionBox.js +192 -165
  107. package/es/components/shared/QuizDraggbleDroppedOption.js +11 -12
  108. package/es/components/shared/QuizDraggbleDummyOption.js +19 -16
  109. package/es/components/shared/QuizDraggbleOption.js +61 -59
  110. package/es/components/shared/StyledMarkdown.js +1 -1
  111. package/es/components/shared/index.js +7 -0
  112. package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
  113. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  114. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
  115. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +54 -68
  116. package/es/components/shared/question-radio/QuestionRadio.js +9 -7
  117. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  118. package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
  119. package/es/components/shared/question-radio/QuestionRadioOption.js +47 -59
  120. package/es/components/shared/utils/getQuestionStatusStyle.js +7 -9
  121. package/es/components/shared/utils/mergeRefs.js +15 -6
  122. package/es/constant/element.js +3 -3
  123. package/es/constant/index.js +1 -0
  124. package/es/helpers/index.js +8 -10
  125. package/es/hooks/index.js +1 -0
  126. package/es/hooks/useCaculatePassage.js +21 -20
  127. package/package.json +12 -15
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import { base } from '@elice/design-tokens';
3
4
  import styled from 'styled-components';
@@ -5,12 +6,11 @@ import { WRONG_BACKGROUND_COLOR, CORRECT_BACKGROUND_COLOR } from '../../material
5
6
  import { getQuestionStatusStyle } from '../utils/getQuestionStatusStyle.js';
6
7
  import { useQuestionRadioContext } from './QuestionRadioContext.js';
7
8
 
8
- const StyledQuestionRadioOption = styled.div.withConfig({
9
+ var StyledQuestionRadioOption = styled.div.withConfig({
9
10
  componentId: "sc-cy66me-0"
10
- })(["display:flex;align-items:center;padding:0.875rem 1rem;border-radius:8px;background-color:", ";overflow-x:auto;&:not(:last-of-type){margin-bottom:1rem;}&:hover,& *:hover{cursor:", ";}", ""], ({
11
- checked,
12
- status
13
- }) => {
11
+ })(["display:flex;align-items:center;padding:0.875rem 1rem;border-radius:8px;background-color:", ";overflow-x:auto;&:not(:last-of-type){margin-bottom:1rem;}&:hover,& *:hover{cursor:", ";}", ""], function (_ref) {
12
+ var checked = _ref.checked,
13
+ status = _ref.status;
14
14
  switch (status) {
15
15
  case 'correct':
16
16
  return CORRECT_BACKGROUND_COLOR;
@@ -21,17 +21,18 @@ const StyledQuestionRadioOption = styled.div.withConfig({
21
21
  default:
22
22
  return checked ? base.color.primary1 : base.color.navy6;
23
23
  }
24
- }, ({
25
- disabled
26
- }) => disabled ? 'not-allowed' : 'pointer', ({
27
- isAnswer
28
- }) => isAnswer ? `border: 3px solid ${base.color.green5}` : '');
29
- const StyledQuestionRadioInput = styled.input.withConfig({
24
+ }, function (_ref2) {
25
+ var disabled = _ref2.disabled;
26
+ return disabled ? 'not-allowed' : 'pointer';
27
+ }, function (_ref3) {
28
+ var isAnswer = _ref3.isAnswer;
29
+ return isAnswer ? "border: 3px solid ".concat(base.color.green5) : '';
30
+ });
31
+ var StyledQuestionRadioInput = styled.input.withConfig({
30
32
  componentId: "sc-cy66me-1"
31
- })(["flex:none;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;border-radius:50%;width:1rem;height:1rem;margin-right:0.875rem;border:2px solid ", ";", ""], ({
32
- checked,
33
- status
34
- }) => {
33
+ })(["flex:none;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;border-radius:50%;width:1rem;height:1rem;margin-right:0.875rem;border:2px solid ", ";", ""], function (_ref4) {
34
+ var checked = _ref4.checked,
35
+ status = _ref4.status;
35
36
  switch (status) {
36
37
  case 'correct':
37
38
  return base.color.green9;
@@ -40,11 +41,10 @@ const StyledQuestionRadioInput = styled.input.withConfig({
40
41
  default:
41
42
  return checked ? base.color.primary6 : base.color.gray3;
42
43
  }
43
- }, ({
44
- status,
45
- checked
46
- }) => {
47
- let bgColor;
44
+ }, function (_ref5) {
45
+ var status = _ref5.status,
46
+ checked = _ref5.checked;
47
+ var bgColor;
48
48
  switch (status) {
49
49
  case 'correct':
50
50
  bgColor = base.color.green9;
@@ -56,57 +56,45 @@ const StyledQuestionRadioInput = styled.input.withConfig({
56
56
  bgColor = checked ? base.color.primary6 : status ? base.color.gray3 : 'transparent';
57
57
  break;
58
58
  }
59
- return `
60
- &:after {
61
- content: '';
62
- position: absolute;
63
- top: 50%;
64
- left: 50%;
65
- transform: translate(-50%, -50%);
66
- width: 70%;
67
- height: 70%;
68
- border-radius: 50%;
69
- background-color: ${bgColor};
70
- }
71
- `;
59
+ return "\n &:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 70%;\n height: 70%;\n border-radius: 50%;\n background-color: ".concat(bgColor, ";\n }\n ");
72
60
  });
73
- const StyledLabel = styled.label.withConfig({
61
+ var StyledLabel = styled.label.withConfig({
74
62
  componentId: "sc-cy66me-2"
75
63
  })(["word-break:break-all;margin-right:0.875rem;font-size:", ";line-height:24px;", ""], base.size.body3, getQuestionStatusStyle());
76
- const QuestionRadioOption = React.memo(({
77
- value,
78
- status,
79
- isAnswer,
80
- children
81
- }) => {
82
- const {
83
- selectedValue,
84
- disabled,
85
- onSelect
86
- } = useQuestionRadioContext();
87
- return React.createElement(StyledQuestionRadioOption, {
64
+ var QuestionRadioOption = React.memo(function (_ref6) {
65
+ var value = _ref6.value,
66
+ status = _ref6.status,
67
+ isAnswer = _ref6.isAnswer,
68
+ children = _ref6.children;
69
+ var _useQuestionRadioCont = useQuestionRadioContext(),
70
+ selectedValue = _useQuestionRadioCont.selectedValue,
71
+ disabled = _useQuestionRadioCont.disabled,
72
+ onSelect = _useQuestionRadioCont.onSelect;
73
+ return jsxs(StyledQuestionRadioOption, {
88
74
  isAnswer: isAnswer,
89
75
  disabled: disabled,
90
76
  checked: selectedValue === value,
91
- onClick: e => {
77
+ onClick: function onClick(e) {
92
78
  e.preventDefault();
93
79
  if (disabled) {
94
80
  return;
95
81
  }
96
82
  onSelect(value);
97
83
  },
98
- status: status
99
- }, React.createElement(StyledQuestionRadioInput, {
100
- id: value,
101
- type: "radio",
102
- readOnly: true,
103
- checked: selectedValue === value,
104
- status: status
105
- }), React.createElement(StyledLabel, {
106
- htmlFor: value,
107
- checked: selectedValue === value,
108
- status: status
109
- }, children));
84
+ status: status,
85
+ children: [jsx(StyledQuestionRadioInput, {
86
+ id: value,
87
+ type: "radio",
88
+ readOnly: true,
89
+ checked: selectedValue === value,
90
+ status: status
91
+ }), jsx(StyledLabel, {
92
+ htmlFor: value,
93
+ checked: selectedValue === value,
94
+ status: status,
95
+ children: children
96
+ })]
97
+ });
110
98
  });
111
99
 
112
100
  export { QuestionRadioOption as default };
@@ -6,10 +6,9 @@ import { WRONG_TEXT_COLOR, CORRECT_TEXT_COLOR } from '../../material-quiz/consta
6
6
  * Get shared question custom style depend on checked, status values.
7
7
  */
8
8
  function getQuestionStatusStyle() {
9
- return css(["&,& p,& p.elicemd.elicemd--theme-dark{color:", ";table tbody > tr:nth-child(odd) > td{background-color:", ";}}"], ({
10
- checked,
11
- status
12
- }) => {
9
+ return css(["&,& p,& p.elicemd.elicemd--theme-dark{color:", ";table tbody > tr:nth-child(odd) > td{background-color:", ";}}"], function (_ref) {
10
+ var checked = _ref.checked,
11
+ status = _ref.status;
13
12
  switch (status) {
14
13
  case 'correct':
15
14
  return CORRECT_TEXT_COLOR;
@@ -18,11 +17,10 @@ function getQuestionStatusStyle() {
18
17
  default:
19
18
  return checked ? base.color.primary6 : base.color.navy0;
20
19
  }
21
- }, ({
22
- checked,
23
- status
24
- }) => {
25
- return checked || status !== 'answer' ? `rgba(0, 0, 0, 0.08);` : null;
20
+ }, function (_ref2) {
21
+ var checked = _ref2.checked,
22
+ status = _ref2.status;
23
+ return checked || status !== 'answer' ? "rgba(0, 0, 0, 0.08);" : null;
26
24
  });
27
25
  }
28
26
 
@@ -1,9 +1,18 @@
1
- const mergeRefs = (...refs) => element => refs.forEach(ref => {
2
- if (typeof ref === 'function') {
3
- ref(element);
4
- } else if (ref && typeof ref === 'object') {
5
- ref.current = element;
1
+ import { typeof as _typeof } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+
3
+ var mergeRefs = function mergeRefs() {
4
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
5
+ refs[_key] = arguments[_key];
6
6
  }
7
- });
7
+ return function (element) {
8
+ return refs.forEach(function (ref) {
9
+ if (typeof ref === 'function') {
10
+ ref(element);
11
+ } else if (ref && _typeof(ref) === 'object') {
12
+ ref.current = element;
13
+ }
14
+ });
15
+ };
16
+ };
8
17
 
9
18
  export { mergeRefs };
@@ -1,5 +1,5 @@
1
- const MATERIAL_QUIZ_CONTAINER_ID = 'MATERIAL_QUIZ_CONTAINER_ID';
2
- const MATERIAL_QUIZ_PASSIVE_ID = 'MATERIAL_QUIZ_PASSIVE_ID';
3
- const MATERIAL_QUIZ_ANSWER_ID = 'MATERIAL_QUIZ_ANSWER_ID';
1
+ var MATERIAL_QUIZ_CONTAINER_ID = 'MATERIAL_QUIZ_CONTAINER_ID';
2
+ var MATERIAL_QUIZ_PASSIVE_ID = 'MATERIAL_QUIZ_PASSIVE_ID';
3
+ var MATERIAL_QUIZ_ANSWER_ID = 'MATERIAL_QUIZ_ANSWER_ID';
4
4
 
5
5
  export { MATERIAL_QUIZ_ANSWER_ID, MATERIAL_QUIZ_CONTAINER_ID, MATERIAL_QUIZ_PASSIVE_ID };
@@ -0,0 +1 @@
1
+ export { MATERIAL_QUIZ_ANSWER_ID, MATERIAL_QUIZ_CONTAINER_ID, MATERIAL_QUIZ_PASSIVE_ID } from './element.js';
@@ -20,12 +20,11 @@ function getQuizResultStatus(materialQuizResponse) {
20
20
  }
21
21
  return QuizResultStatus.NotSubmitted;
22
22
  }
23
- const getOptionStatus = ({
24
- isSelected,
25
- isActive,
26
- materialQuizResponse
27
- }) => {
28
- const status = getQuizResultStatus(materialQuizResponse);
23
+ var getOptionStatus = function getOptionStatus(_ref) {
24
+ var isSelected = _ref.isSelected,
25
+ isActive = _ref.isActive,
26
+ materialQuizResponse = _ref.materialQuizResponse;
27
+ var status = getQuizResultStatus(materialQuizResponse);
29
28
  if (isActive) {
30
29
  return;
31
30
  }
@@ -42,9 +41,8 @@ const getOptionStatus = ({
42
41
  function checkUserLectureTestEnded(lecture) {
43
42
  return (lecture === null || lecture === void 0 ? void 0 : lecture.testAdmissionStatus) === enums.TestAdmissionStatus.Completed;
44
43
  }
45
- function shouldResetOptions({
46
- materialQuizResponse
47
- }) {
44
+ function shouldResetOptions(_ref2) {
45
+ var materialQuizResponse = _ref2.materialQuizResponse;
48
46
  // when score is given(correct, wrong), reset selected option in order to select options from scratch
49
47
  // score condition
50
48
  // normal quiz - score is always given(not a null) as long as a user submits the answer
@@ -52,7 +50,7 @@ function shouldResetOptions({
52
50
  return [(materialQuizResponse === null || materialQuizResponse === void 0 ? void 0 : materialQuizResponse.score) !== null].every(Boolean);
53
51
  }
54
52
  function getQuizResult(materialQuizResponse) {
55
- const status = getQuizResultStatus(materialQuizResponse);
53
+ var status = getQuizResultStatus(materialQuizResponse);
56
54
  switch (status) {
57
55
  case QuizResultStatus.Correct:
58
56
  return true;
@@ -0,0 +1 @@
1
+ export { useCaculatePassage } from './useCaculatePassage.js';
@@ -1,31 +1,32 @@
1
+ import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { useEffect } from 'react';
2
3
  import { useMeasure } from 'react-use';
3
4
  import { useMaterialQuizState, useMaterialQuizDispatch } from '../components/material-quiz/context/MaterialQuizContext.js';
4
5
  import { MATERIAL_QUIZ_CONTAINER_ID } from '../constant/element.js';
5
6
 
6
- const useCaculatePassage = () => {
7
- const {
8
- materialQuiz,
9
- vertical
10
- } = useMaterialQuizState();
11
- const {
12
- setIsLongPassage,
13
- setIsInitialLoading
14
- } = useMaterialQuizDispatch();
15
- const [questionRef, {
16
- height: questionDetailHeight
17
- }] = useMeasure();
18
- const [containerRef, {
19
- height: containerHeight
20
- }] = useMeasure();
21
- useEffect(() => {
7
+ var useCaculatePassage = function useCaculatePassage() {
8
+ var _useMaterialQuizState = useMaterialQuizState(),
9
+ materialQuiz = _useMaterialQuizState.materialQuiz,
10
+ vertical = _useMaterialQuizState.vertical;
11
+ var _useMaterialQuizDispa = useMaterialQuizDispatch(),
12
+ setIsLongPassage = _useMaterialQuizDispa.setIsLongPassage,
13
+ setIsInitialLoading = _useMaterialQuizDispa.setIsInitialLoading;
14
+ var _useMeasure = useMeasure(),
15
+ _useMeasure2 = _slicedToArray(_useMeasure, 2),
16
+ questionRef = _useMeasure2[0],
17
+ questionDetailHeight = _useMeasure2[1].height;
18
+ var _useMeasure3 = useMeasure(),
19
+ _useMeasure4 = _slicedToArray(_useMeasure3, 2),
20
+ containerRef = _useMeasure4[0],
21
+ containerHeight = _useMeasure4[1].height;
22
+ useEffect(function () {
22
23
  var _a, _b;
23
- const currentContainerHeight = vertical ? (_b = (_a = document.getElementById(MATERIAL_QUIZ_CONTAINER_ID)) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0 : containerHeight;
24
+ var currentContainerHeight = vertical ? (_b = (_a = document.getElementById(MATERIAL_QUIZ_CONTAINER_ID)) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0 : containerHeight;
24
25
  if (currentContainerHeight && questionDetailHeight && materialQuiz) {
25
26
  setIsLongPassage(questionDetailHeight > currentContainerHeight);
26
27
  // add timeout for forcing caculate layout and render in the parent
27
28
  // finish before turning off loading
28
- setTimeout(() => {
29
+ setTimeout(function () {
29
30
  setIsInitialLoading(false);
30
31
  }, 300);
31
32
  } else if (materialQuiz && !materialQuiz.questionDescription) {
@@ -33,8 +34,8 @@ const useCaculatePassage = () => {
33
34
  }
34
35
  }, [containerHeight, questionDetailHeight, materialQuiz, setIsLongPassage, vertical, setIsInitialLoading]);
35
36
  return {
36
- questionRef,
37
- containerRef
37
+ questionRef: questionRef,
38
+ containerRef: containerRef
38
39
  };
39
40
  };
40
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-quiz",
3
- "version": "1.240718.0-trasncript.1",
3
+ "version": "1.240718.0-trasncript.2",
4
4
  "description": "User view and editing components of Elice material quiz",
5
5
  "repository": "https://git.elicer.io/elice/frontend/library/elice-material",
6
6
  "license": "UNLICENSED",
@@ -17,10 +17,8 @@
17
17
  "scripts": {
18
18
  "start": "run-s watch",
19
19
  "prebuild": "run-s clean",
20
- "build": "run-p build:es build:cjs",
21
- "build:es": "rollup -c ../../rollup.config.ts --configPlugin typescript -f es",
22
- "build:cjs": "rollup -c ../../rollup.config.ts --configPlugin typescript -f cjs",
23
- "watch": "rollup -c ../../rollup.config.ts --configPlugin typescript -f es -w",
20
+ "build": "cross-env NODE_ENV=production rollup -c ../../rollup.config.ts --configPlugin typescript -f es -f cjs",
21
+ "watch": "rollup -c ../../rollup.config.ts --configPlugin typescript -f es -f cjs -w",
24
22
  "lint": "eslint --ext .ts,.tsx ./src --max-warnings=0",
25
23
  "clean": "del-cli \"es/*\" \"cjs/*\" \"dist/*\""
26
24
  },
@@ -41,7 +39,7 @@
41
39
  "@fortawesome/pro-regular-svg-icons": "^6",
42
40
  "@fortawesome/pro-solid-svg-icons": "^6",
43
41
  "@mui/lab": "^5.0.0-alpha.112",
44
- "@mui/material": "^5.14.17",
42
+ "@mui/material": "^5.10.16",
45
43
  "@mui/x-data-grid": "^6.7.0",
46
44
  "@mui/x-date-pickers": "^6.7.0",
47
45
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
@@ -60,23 +58,23 @@
60
58
  },
61
59
  "devDependencies": {
62
60
  "@elice/api-client": "^1.240619.0",
63
- "@elice/blocks": "^1.240514.0",
61
+ "@elice/blocks": "^1.240529.0",
64
62
  "@elice/design-tokens": "^1.220803.0",
65
63
  "@elice/icons": "^1.230814.0",
66
64
  "@elice/icons-legacy": "npm:@elice/icons@0.230814.0",
67
65
  "@elice/intl": "0.240425.0-rc.2",
68
66
  "@elice/markdown": "^1.240124.0",
69
- "@elice/material-shared-types": "1.240718.0-trasncript.1",
70
- "@elice/material-shared-utils": "1.240718.0-trasncript.1",
67
+ "@elice/material-shared-types": "1.240718.0-trasncript.2",
68
+ "@elice/material-shared-utils": "1.240718.0-trasncript.2",
71
69
  "@elice/mui-system": "^5.240108.1",
72
- "@elice/types": "^1.240619.0",
70
+ "@elice/types": "1.240709.0",
73
71
  "@elice/wysiwyg": "1.240716.1",
74
- "@emotion/react": "^11.10.0",
75
- "@emotion/styled": "^11.10.0",
72
+ "@emotion/react": "^11.10.5",
73
+ "@emotion/styled": "^11.10.5",
76
74
  "@fortawesome/pro-regular-svg-icons": "^6.4.2",
77
75
  "@fortawesome/pro-solid-svg-icons": "^6.4.2",
78
76
  "@mui/lab": "^5.0.0-alpha.112",
79
- "@mui/material": "^5.14.17",
77
+ "@mui/material": "^5.10.16",
80
78
  "@mui/x-data-grid": "^6.7.0",
81
79
  "@mui/x-date-pickers": "^6.7.0",
82
80
  "@types/classnames": "^2.3.1",
@@ -89,6 +87,5 @@
89
87
  "react": "^17.0.2",
90
88
  "react-use": "^17.2.4",
91
89
  "styled-components": "^5.3.0"
92
- },
93
- "gitHead": "8d0acefda30430959f8f115ad467d2449f86d8a7"
90
+ }
94
91
  }