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

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/components/eb-sortable/EbDraggable.js +33 -42
  2. package/cjs/components/eb-sortable/EbDroppable.js +20 -27
  3. package/cjs/components/markdown-editor/index.d.ts +2 -1
  4. package/cjs/components/markdown-editor/index.js +10 -19
  5. package/cjs/components/material-quiz/MaterialQuiz.js +83 -114
  6. package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +29 -36
  7. package/cjs/components/material-quiz/MaterialQuizInfo.js +149 -151
  8. package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +127 -175
  9. package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +286 -360
  10. package/cjs/components/material-quiz/MaterialQuizSelectOne.js +126 -172
  11. package/cjs/components/material-quiz/MaterialQuizShimmer.js +39 -46
  12. package/cjs/components/material-quiz/MaterialQuizText.js +115 -163
  13. package/cjs/components/material-quiz/QuizResultBadge.js +22 -32
  14. package/cjs/components/material-quiz/QuizSubmitStatusText.js +16 -21
  15. package/cjs/components/material-quiz/constants/color.js +5 -5
  16. package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  17. package/cjs/components/material-quiz/context/MaterialQuizContext.js +93 -156
  18. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +161 -259
  19. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +100 -134
  20. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +101 -130
  21. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +52 -64
  22. package/cjs/components/material-quiz/material-quiz-group/context/context.js +1 -5
  23. package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +36 -47
  24. package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +232 -280
  25. package/cjs/components/material-quiz-edit/context.js +2 -8
  26. package/cjs/components/material-quiz-edit/options/OptionEditor.js +46 -70
  27. package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +148 -174
  28. package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +149 -175
  29. package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +144 -164
  30. package/cjs/components/material-quiz-edit/options/OptionText.js +82 -90
  31. package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +8 -9
  32. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +112 -156
  33. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +196 -288
  34. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +75 -88
  35. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +92 -108
  36. package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +1 -5
  37. package/cjs/components/material-quiz-edit/utils/editValue.js +12 -21
  38. package/cjs/components/shared/QuestionBox.js +165 -198
  39. package/cjs/components/shared/QuizDraggbleDroppedOption.js +12 -11
  40. package/cjs/components/shared/QuizDraggbleDummyOption.js +16 -23
  41. package/cjs/components/shared/QuizDraggbleOption.js +59 -65
  42. package/cjs/components/shared/StyledMarkdown.js +1 -5
  43. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +7 -13
  44. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  45. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +17 -24
  46. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +68 -59
  47. package/cjs/components/shared/question-radio/QuestionRadio.js +7 -13
  48. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  49. package/cjs/components/shared/question-radio/QuestionRadioContext.js +17 -24
  50. package/cjs/components/shared/question-radio/QuestionRadioOption.js +59 -52
  51. package/cjs/components/shared/utils/getQuestionStatusStyle.js +9 -7
  52. package/cjs/components/shared/utils/mergeRefs.js +6 -15
  53. package/cjs/constant/element.js +3 -3
  54. package/cjs/helpers/index.js +10 -8
  55. package/cjs/hooks/useCaculatePassage.js +20 -21
  56. package/es/components/eb-sortable/EbDraggable.js +33 -37
  57. package/es/components/eb-sortable/EbDroppable.js +20 -22
  58. package/es/components/markdown-editor/index.d.ts +2 -1
  59. package/es/components/markdown-editor/index.js +10 -15
  60. package/es/components/material-quiz/MaterialQuiz.js +83 -109
  61. package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +29 -32
  62. package/es/components/material-quiz/MaterialQuizInfo.js +150 -148
  63. package/es/components/material-quiz/MaterialQuizSelectMultiple.js +127 -171
  64. package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +287 -356
  65. package/es/components/material-quiz/MaterialQuizSelectOne.js +126 -168
  66. package/es/components/material-quiz/MaterialQuizShimmer.js +39 -42
  67. package/es/components/material-quiz/MaterialQuizText.js +115 -158
  68. package/es/components/material-quiz/QuizResultBadge.js +22 -27
  69. package/es/components/material-quiz/QuizSubmitStatusText.js +16 -17
  70. package/es/components/material-quiz/constants/color.js +5 -5
  71. package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  72. package/es/components/material-quiz/context/MaterialQuizContext.js +94 -153
  73. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +161 -253
  74. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +100 -129
  75. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +101 -125
  76. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +52 -60
  77. package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
  78. package/es/components/material-quiz-edit/MaterialQuizEdit.js +36 -43
  79. package/es/components/material-quiz-edit/MaterialQuizEditContent.js +229 -272
  80. package/es/components/material-quiz-edit/context.js +2 -4
  81. package/es/components/material-quiz-edit/options/OptionEditor.js +46 -64
  82. package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +148 -170
  83. package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +149 -171
  84. package/es/components/material-quiz-edit/options/OptionSelectOne.js +144 -159
  85. package/es/components/material-quiz-edit/options/OptionText.js +82 -86
  86. package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +8 -9
  87. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +112 -151
  88. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +197 -283
  89. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +75 -83
  90. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +92 -103
  91. package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +1 -5
  92. package/es/components/material-quiz-edit/utils/editValue.js +12 -17
  93. package/es/components/shared/QuestionBox.js +165 -192
  94. package/es/components/shared/QuizDraggbleDroppedOption.js +12 -11
  95. package/es/components/shared/QuizDraggbleDummyOption.js +16 -19
  96. package/es/components/shared/QuizDraggbleOption.js +59 -61
  97. package/es/components/shared/StyledMarkdown.js +1 -1
  98. package/es/components/shared/question-checkbox/QuestionCheckbox.js +7 -9
  99. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  100. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +17 -20
  101. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +68 -54
  102. package/es/components/shared/question-radio/QuestionRadio.js +7 -9
  103. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  104. package/es/components/shared/question-radio/QuestionRadioContext.js +17 -20
  105. package/es/components/shared/question-radio/QuestionRadioOption.js +59 -47
  106. package/es/components/shared/utils/getQuestionStatusStyle.js +9 -7
  107. package/es/components/shared/utils/mergeRefs.js +6 -15
  108. package/es/constant/element.js +3 -3
  109. package/es/helpers/index.js +10 -8
  110. package/es/hooks/useCaculatePassage.js +20 -21
  111. package/package.json +15 -12
  112. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -423
  113. package/cjs/components/material-quiz/index.js +0 -9
  114. package/cjs/components/material-quiz/locales/index.js +0 -13
  115. package/cjs/components/material-quiz-edit/index.js +0 -7
  116. package/cjs/components/material-quiz-edit/locales/index.js +0 -13
  117. package/cjs/components/shared/index.js +0 -19
  118. package/cjs/constant/index.js +0 -9
  119. package/cjs/hooks/index.js +0 -7
  120. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -408
  121. package/es/components/material-quiz/index.js +0 -2
  122. package/es/components/material-quiz/locales/index.js +0 -4
  123. package/es/components/material-quiz-edit/index.js +0 -1
  124. package/es/components/material-quiz-edit/locales/index.js +0 -4
  125. package/es/components/shared/index.js +0 -7
  126. package/es/constant/index.js +0 -1
  127. package/es/hooks/index.js +0 -1
@@ -1,5 +1,3 @@
1
- import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
1
  import React from 'react';
4
2
  import { useMeasure } from 'react-use';
5
3
  import { base } from '@elice/design-tokens';
@@ -15,147 +13,123 @@ import messageKo from './locales/ko.json.js';
15
13
  import MaterialQuizShimmer from './MaterialQuizShimmer.js';
16
14
  import MaterialQuizInfo from './MaterialQuizInfo.js';
17
15
 
18
- var eliceTheme = createEliceTheme({
16
+ const eliceTheme = createEliceTheme({
19
17
  paletteMode: 'dark',
20
18
  paletteName: 'purple'
21
19
  });
22
- var AsyncMaterialQuizSelectMultiple = React.lazy(function () {
23
- return import('./MaterialQuizSelectMultiple.js');
24
- });
25
- var AsyncMaterialQuizSelectMultipleOrder = React.lazy(function () {
26
- return import('./MaterialQuizSelectMultipleOrder.js');
27
- });
28
- var AsyncMaterialQuizText = React.lazy(function () {
29
- return import('./MaterialQuizText.js');
30
- });
31
- var AsyncMaterialQuizSelectOne = React.lazy(function () {
32
- return import('./MaterialQuizSelectOne.js');
33
- });
34
- var AsyncMaterialQuizGroup = React.lazy(function () {
35
- return import('./material-quiz-group/index.js');
36
- });
20
+ const AsyncMaterialQuizSelectMultiple = React.lazy(() => import('./MaterialQuizSelectMultiple.js'));
21
+ const AsyncMaterialQuizSelectMultipleOrder = React.lazy(() => import('./MaterialQuizSelectMultipleOrder.js'));
22
+ const AsyncMaterialQuizText = React.lazy(() => import('./MaterialQuizText.js'));
23
+ const AsyncMaterialQuizSelectOne = React.lazy(() => import('./MaterialQuizSelectOne.js'));
24
+ const AsyncMaterialQuizGroup = React.lazy(() => import('./material-quiz-group/index.js'));
37
25
  // 746px
38
- var MAX_CONTENT_WIDTH = '46.625rem';
39
- var StyledMaterialQuizInfo = styled.div.withConfig({
26
+ const MAX_CONTENT_WIDTH = '46.625rem';
27
+ const StyledMaterialQuizInfo = styled.div.withConfig({
40
28
  componentId: "sc-1eyn8fb-0"
41
29
  })([""]);
42
- var StyledMaterialQuizContent = styled.div.withConfig({
30
+ const StyledMaterialQuizContent = styled.div.withConfig({
43
31
  componentId: "sc-1eyn8fb-1"
44
- })(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], function (_ref) {
45
- var vertical = _ref.vertical;
46
- return vertical ? 'unset' : 'auto';
47
- });
48
- var LoadingContainer = styled.div.withConfig({
32
+ })(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], ({
33
+ vertical
34
+ }) => vertical ? 'unset' : 'auto');
35
+ const LoadingContainer = styled.div.withConfig({
49
36
  componentId: "sc-1eyn8fb-2"
50
37
  })(["position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;max-width:none !important;background-color:", ";"], base.color.navy8);
51
- var StyledMaterialQuizWrapper = styled.div.withConfig({
38
+ const StyledMaterialQuizWrapper = styled.div.withConfig({
52
39
  componentId: "sc-1eyn8fb-3"
53
- })(["-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;width:100%;height:100%;flex-direction:", ";position:relative;& > *{flex:", ";max-width:", ";}gap:1rem;", "{height:", ";overflow-y:", ";& > div{max-height:unset;}}"], function (_ref2) {
54
- var vertical = _ref2.vertical;
55
- return vertical ? 'column' : 'row';
56
- }, function (_ref3) {
57
- var vertical = _ref3.vertical;
58
- return vertical ? 'auto' : '1';
59
- }, function (_ref4) {
60
- var vertical = _ref4.vertical,
61
- isQuizGroupType = _ref4.isQuizGroupType,
62
- isLongPassage = _ref4.isLongPassage;
63
- return !isLongPassage && !vertical && !isQuizGroupType ? "".concat(MAX_CONTENT_WIDTH) : 'unset';
64
- }, StyledMaterialQuizInfo, function (_ref5) {
65
- var vertical = _ref5.vertical;
66
- return vertical ? 'auto' : '100%';
67
- }, function (_ref6) {
68
- var vertical = _ref6.vertical;
69
- return vertical ? 'intial' : 'auto';
70
- });
71
- var MaterialQuiz = function MaterialQuiz() {
72
- var _useMaterialQuizState = useMaterialQuizState(),
73
- materialQuiz = _useMaterialQuizState.materialQuiz,
74
- vertical = _useMaterialQuizState.vertical,
75
- course = _useMaterialQuizState.course,
76
- isLongPassage = _useMaterialQuizState.isLongPassage,
77
- isInitialLoading = _useMaterialQuizState.isInitialLoading;
78
- var _useMaterialQuizDispa = useMaterialQuizDispatch(),
79
- setVertical = _useMaterialQuizDispa.setVertical;
80
- var _useMeasure = useMeasure(),
81
- _useMeasure2 = _slicedToArray(_useMeasure, 2),
82
- ref = _useMeasure2[0],
83
- width = _useMeasure2[1].width;
84
- var isQuizGroupType = Boolean((materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.optionType) === enums.QuizOptionType.Group);
85
- var isFetchingData = !materialQuiz || !course;
86
- var isLoadingLayout = isFetchingData || isInitialLoading;
87
- var isVisibleSideBySide = !vertical && isLongPassage;
88
- var isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
89
- React.useEffect(function () {
40
+ })(["-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;width:100%;height:100%;flex-direction:", ";position:relative;& > *{flex:", ";max-width:", ";}gap:1rem;", "{height:", ";overflow-y:", ";& > div{max-height:unset;}}"], ({
41
+ vertical
42
+ }) => vertical ? 'column' : 'row', ({
43
+ vertical
44
+ }) => vertical ? 'auto' : '1', ({
45
+ vertical,
46
+ isQuizGroupType,
47
+ isLongPassage
48
+ }) => !isLongPassage && !vertical && !isQuizGroupType ? `${MAX_CONTENT_WIDTH}` : 'unset', StyledMaterialQuizInfo, ({
49
+ vertical
50
+ }) => vertical ? 'auto' : '100%', ({
51
+ vertical
52
+ }) => vertical ? 'intial' : 'auto');
53
+ const MaterialQuiz = () => {
54
+ const {
55
+ materialQuiz,
56
+ vertical,
57
+ course,
58
+ isLongPassage,
59
+ isInitialLoading
60
+ } = useMaterialQuizState();
61
+ const {
62
+ setVertical
63
+ } = useMaterialQuizDispatch();
64
+ const [ref, {
65
+ width
66
+ }] = useMeasure();
67
+ const isQuizGroupType = Boolean((materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.optionType) === enums.QuizOptionType.Group);
68
+ const isFetchingData = !materialQuiz || !course;
69
+ const isLoadingLayout = isFetchingData || isInitialLoading;
70
+ const isVisibleSideBySide = !vertical && isLongPassage;
71
+ const isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
72
+ React.useEffect(() => {
90
73
  if (width > 0) {
91
74
  setVertical(width <= base.screen.medium);
92
75
  }
93
76
  }, [width, setVertical]);
94
- var renderQuestionOption = function renderQuestionOption() {
77
+ const renderQuestionOption = () => {
95
78
  if (isFetchingData) {
96
79
  return null;
97
80
  }
98
81
  switch (materialQuiz.optionType) {
99
82
  case enums.QuizOptionType.SelectOne:
100
- return jsx(AsyncMaterialQuizSelectOne, {
83
+ return React.createElement(AsyncMaterialQuizSelectOne, {
101
84
  hasInlinePassage: isRenderQuestionWithPassage
102
85
  });
103
86
  case enums.QuizOptionType.SelectMultiple:
104
- return jsx(AsyncMaterialQuizSelectMultiple, {
87
+ return React.createElement(AsyncMaterialQuizSelectMultiple, {
105
88
  hasInlinePassage: isRenderQuestionWithPassage
106
89
  });
107
90
  case enums.QuizOptionType.Text:
108
- return jsx(AsyncMaterialQuizText, {
91
+ return React.createElement(AsyncMaterialQuizText, {
109
92
  hasInlinePassage: isRenderQuestionWithPassage
110
93
  });
111
94
  case enums.QuizOptionType.SelectMultipleOrder:
112
- return jsx(AsyncMaterialQuizSelectMultipleOrder, {
95
+ return React.createElement(AsyncMaterialQuizSelectMultipleOrder, {
113
96
  hasInlinePassage: isRenderQuestionWithPassage
114
97
  });
115
98
  case enums.QuizOptionType.Group:
116
- return jsx(AsyncMaterialQuizGroup, {});
99
+ return React.createElement(AsyncMaterialQuizGroup, null);
117
100
  }
118
101
  };
119
- return jsx(React.Suspense, {
120
- fallback: null,
121
- children: jsxs(StyledMaterialQuizWrapper, {
122
- ref: ref,
123
- vertical: vertical,
124
- isQuizGroupType: isQuizGroupType,
125
- isLongPassage: isLongPassage,
126
- children: [isLoadingLayout && jsx(LoadingContainer, {
127
- children: jsx(MaterialQuizShimmer, {})
128
- }), isVisibleSideBySide && jsx(StyledMaterialQuizInfo, {
129
- children: jsx(MaterialQuizInfo, {})
130
- }), jsx(StyledMaterialQuizContent, {
131
- id: MATERIAL_QUIZ_CONTAINER_ID,
132
- vertical: vertical,
133
- children: renderQuestionOption()
134
- })]
135
- })
136
- });
102
+ return React.createElement(React.Suspense, {
103
+ fallback: null
104
+ }, React.createElement(StyledMaterialQuizWrapper, {
105
+ ref: ref,
106
+ vertical: vertical,
107
+ isQuizGroupType: isQuizGroupType,
108
+ isLongPassage: isLongPassage
109
+ }, isLoadingLayout && React.createElement(LoadingContainer, null, React.createElement(MaterialQuizShimmer, null)), isVisibleSideBySide && React.createElement(StyledMaterialQuizInfo, null, React.createElement(MaterialQuizInfo, null)), React.createElement(StyledMaterialQuizContent, {
110
+ id: MATERIAL_QUIZ_CONTAINER_ID,
111
+ vertical: vertical
112
+ }, renderQuestionOption())));
137
113
  };
138
- var MaterialQuizContainer = function MaterialQuizContainer(_ref7) {
139
- var materialQuizId = _ref7.materialQuizId,
140
- userId = _ref7.userId,
141
- onDirty = _ref7.onDirty,
142
- onSubmit = _ref7.onSubmit,
143
- onNext = _ref7.onNext,
144
- __intl = _ref7.__intl;
145
- return jsx(RawEliceIntlProvider, {
146
- value: __intl,
147
- children: jsx(ThemeProvider, {
148
- theme: eliceTheme,
149
- children: jsx(MaterialQuizProvider, {
150
- materialQuizId: materialQuizId,
151
- userId: userId,
152
- onDirty: onDirty,
153
- onSubmit: onSubmit,
154
- onNext: onNext,
155
- children: jsx(MaterialQuiz, {})
156
- })
157
- })
158
- });
114
+ const MaterialQuizContainer = ({
115
+ materialQuizId,
116
+ userId,
117
+ onDirty,
118
+ onSubmit,
119
+ onNext,
120
+ __intl
121
+ }) => {
122
+ return React.createElement(RawEliceIntlProvider, {
123
+ value: __intl
124
+ }, React.createElement(ThemeProvider, {
125
+ theme: eliceTheme
126
+ }, React.createElement(MaterialQuizProvider, {
127
+ materialQuizId: materialQuizId,
128
+ userId: userId,
129
+ onDirty: onDirty,
130
+ onSubmit: onSubmit,
131
+ onNext: onNext
132
+ }, React.createElement(MaterialQuiz, null))));
159
133
  };
160
134
  var MaterialQuiz$1 = new IntlComponentBuilder(MaterialQuizContainer).add('en', messageEn).add('ko', messageKo).addAsync('th', import('./locales/th.json.js')).addAsync('ja', import('./locales/ja.json.js')).build();
161
135
 
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import { Accordion, Flex, Text } from '@elice/blocks';
3
3
  import { base } from '@elice/design-tokens';
4
4
  import { useRawEliceIntl } from '@elice/intl';
@@ -8,45 +8,42 @@ import { EliceWysiwygEditorTheme } from '@elice/wysiwyg';
8
8
  import styled from 'styled-components';
9
9
  import { useMaterialQuizState } from './context/MaterialQuizContext.js';
10
10
 
11
- var StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
11
+ const StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
12
12
  componentId: "sc-18kg5i5-0"
13
13
  })(["p{margin:0 !important;}", ""], EliceWysiwygEditorTheme.resetMarkdownSSR);
14
- var StyledAccordion = styled(Accordion).withConfig({
14
+ const StyledAccordion = styled(Accordion).withConfig({
15
15
  componentId: "sc-18kg5i5-1"
16
16
  })(["border-radius:8px;overflow:hidden;background-color:", " !important;border-radius:8px;overflow:hidden;& > *:first-child{background-color:", " !important;}& > *:last-child{background-color:", " !important;}"], base.color.navy5, base.color.navy7, base.color.navy7);
17
- var MaterialQuizAnswerExplanation = function MaterialQuizAnswerExplanation() {
18
- var _useMaterialQuizState = useMaterialQuizState(),
19
- lecture = _useMaterialQuizState.lecture,
20
- materialQuiz = _useMaterialQuizState.materialQuiz;
21
- var intl = useRawEliceIntl();
17
+ const MaterialQuizAnswerExplanation = () => {
18
+ const {
19
+ lecture,
20
+ materialQuiz
21
+ } = useMaterialQuizState();
22
+ const intl = useRawEliceIntl();
22
23
  if (!materialQuiz || !materialQuiz.explanationInfo.isEnabled || !materialQuiz.isResponded || (lecture === null || lecture === void 0 ? void 0 : lecture.lectureType) === enums.LectureType.Test && (lecture === null || lecture === void 0 ? void 0 : lecture.testUserStatus) !== enums.LectureTestUserStatus.Completed) {
23
24
  return null;
24
25
  }
25
- return jsx(Flex, {
26
+ return React.createElement(Flex, {
26
27
  column: true,
27
- margintop: "1rem",
28
- children: jsx(StyledAccordion, {
29
- dark: true,
30
- header: jsx(Text, {
31
- bold: true,
32
- role: "navy0",
33
- children: intl.formatMessage({
34
- id: 'materialQuiz.explanation.show'
35
- })
36
- }),
37
- children: materialQuiz.explanationInfo.isEnabled ? jsx(StyledMarkdownSSR, {
38
- dark: true,
39
- children: materialQuiz.explanationInfo.value
40
- }) : jsx(Text, {
41
- role: "info",
42
- lineHeight: 1.4,
43
- userSelect: "none",
44
- children: intl.formatMessage({
45
- id: 'materialQuiz.explanation.empty'
46
- })
47
- })
48
- })
49
- });
28
+ margintop: "1rem"
29
+ }, React.createElement(StyledAccordion, {
30
+ dark: true,
31
+ header: React.createElement(Text, {
32
+ bold: true,
33
+ role: "navy0"
34
+ }, intl.formatMessage({
35
+ id: 'materialQuiz.explanation.show'
36
+ }))
37
+ }, materialQuiz.explanationInfo.isEnabled ? React.createElement(StyledMarkdownSSR, {
38
+ dark: true,
39
+ children: materialQuiz.explanationInfo.value
40
+ }) : React.createElement(Text, {
41
+ role: "info",
42
+ lineHeight: 1.4,
43
+ userSelect: "none"
44
+ }, intl.formatMessage({
45
+ id: 'materialQuiz.explanation.empty'
46
+ }))));
50
47
  };
51
48
 
52
49
  export { MaterialQuizAnswerExplanation as default };