@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,5 @@
1
+ import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
1
3
  import React from 'react';
2
4
  import { useMeasure } from 'react-use';
3
5
  import { base } from '@elice/design-tokens';
@@ -13,123 +15,147 @@ import messageKo from './locales/ko.json.js';
13
15
  import MaterialQuizShimmer from './MaterialQuizShimmer.js';
14
16
  import MaterialQuizInfo from './MaterialQuizInfo.js';
15
17
 
16
- const eliceTheme = createEliceTheme({
18
+ var eliceTheme = createEliceTheme({
17
19
  paletteMode: 'dark',
18
20
  paletteName: 'purple'
19
21
  });
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'));
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
+ });
25
37
  // 746px
26
- const MAX_CONTENT_WIDTH = '46.625rem';
27
- const StyledMaterialQuizInfo = styled.div.withConfig({
38
+ var MAX_CONTENT_WIDTH = '46.625rem';
39
+ var StyledMaterialQuizInfo = styled.div.withConfig({
28
40
  componentId: "sc-1eyn8fb-0"
29
41
  })([""]);
30
- const StyledMaterialQuizContent = styled.div.withConfig({
42
+ var StyledMaterialQuizContent = styled.div.withConfig({
31
43
  componentId: "sc-1eyn8fb-1"
32
- })(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], ({
33
- vertical
34
- }) => vertical ? 'unset' : 'auto');
35
- const LoadingContainer = styled.div.withConfig({
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({
36
49
  componentId: "sc-1eyn8fb-2"
37
50
  })(["position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;max-width:none !important;background-color:", ";"], base.color.navy8);
38
- const StyledMaterialQuizWrapper = styled.div.withConfig({
51
+ var StyledMaterialQuizWrapper = styled.div.withConfig({
39
52
  componentId: "sc-1eyn8fb-3"
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(() => {
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 () {
73
90
  if (width > 0) {
74
91
  setVertical(width <= base.screen.medium);
75
92
  }
76
93
  }, [width, setVertical]);
77
- const renderQuestionOption = () => {
94
+ var renderQuestionOption = function renderQuestionOption() {
78
95
  if (isFetchingData) {
79
96
  return null;
80
97
  }
81
98
  switch (materialQuiz.optionType) {
82
99
  case enums.QuizOptionType.SelectOne:
83
- return React.createElement(AsyncMaterialQuizSelectOne, {
100
+ return jsx(AsyncMaterialQuizSelectOne, {
84
101
  hasInlinePassage: isRenderQuestionWithPassage
85
102
  });
86
103
  case enums.QuizOptionType.SelectMultiple:
87
- return React.createElement(AsyncMaterialQuizSelectMultiple, {
104
+ return jsx(AsyncMaterialQuizSelectMultiple, {
88
105
  hasInlinePassage: isRenderQuestionWithPassage
89
106
  });
90
107
  case enums.QuizOptionType.Text:
91
- return React.createElement(AsyncMaterialQuizText, {
108
+ return jsx(AsyncMaterialQuizText, {
92
109
  hasInlinePassage: isRenderQuestionWithPassage
93
110
  });
94
111
  case enums.QuizOptionType.SelectMultipleOrder:
95
- return React.createElement(AsyncMaterialQuizSelectMultipleOrder, {
112
+ return jsx(AsyncMaterialQuizSelectMultipleOrder, {
96
113
  hasInlinePassage: isRenderQuestionWithPassage
97
114
  });
98
115
  case enums.QuizOptionType.Group:
99
- return React.createElement(AsyncMaterialQuizGroup, null);
116
+ return jsx(AsyncMaterialQuizGroup, {});
100
117
  }
101
118
  };
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())));
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
+ });
113
137
  };
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))));
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
+ });
133
159
  };
134
160
  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();
135
161
 
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx } from 'react/jsx-runtime';
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,42 +8,45 @@ import { EliceWysiwygEditorTheme } from '@elice/wysiwyg';
8
8
  import styled from 'styled-components';
9
9
  import { useMaterialQuizState } from './context/MaterialQuizContext.js';
10
10
 
11
- const StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
11
+ var StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
12
12
  componentId: "sc-18kg5i5-0"
13
13
  })(["p{margin:0 !important;}", ""], EliceWysiwygEditorTheme.resetMarkdownSSR);
14
- const StyledAccordion = styled(Accordion).withConfig({
14
+ var 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
- const MaterialQuizAnswerExplanation = () => {
18
- const {
19
- lecture,
20
- materialQuiz
21
- } = useMaterialQuizState();
22
- const intl = useRawEliceIntl();
17
+ var MaterialQuizAnswerExplanation = function MaterialQuizAnswerExplanation() {
18
+ var _useMaterialQuizState = useMaterialQuizState(),
19
+ lecture = _useMaterialQuizState.lecture,
20
+ materialQuiz = _useMaterialQuizState.materialQuiz;
21
+ var intl = useRawEliceIntl();
23
22
  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) {
24
23
  return null;
25
24
  }
26
- return React.createElement(Flex, {
25
+ return jsx(Flex, {
27
26
  column: true,
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
- }))));
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
+ });
47
50
  };
48
51
 
49
52
  export { MaterialQuizAnswerExplanation as default };