@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,25 +1,34 @@
1
1
  'use strict';
2
2
 
3
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
3
4
  var tslib = require('tslib');
5
+ var jsxRuntime = require('react/jsx-runtime');
4
6
  var React = require('react');
5
7
  var reactUse = require('react-use');
6
8
  var wysiwyg = require('@elice/wysiwyg');
7
9
 
8
- const STATE_SYNC_DEBOUNCE_TIME = 50;
9
- const MarkdownEditor = _a => {
10
- var {
11
- value,
12
- onChange
13
- } = _a,
10
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
13
+
14
+ var STATE_SYNC_DEBOUNCE_TIME = 50;
15
+ var MarkdownEditor = function MarkdownEditor(_a) {
16
+ var value = _a.value,
17
+ onChange = _a.onChange,
14
18
  props = tslib.__rest(_a, ["value", "onChange"]);
15
- const [__value, __setValue] = React.useState(value);
16
- reactUse.useDebounce(() => __setValue(value), STATE_SYNC_DEBOUNCE_TIME, [value]);
17
- reactUse.useDebounce(() => {
19
+ var _React$useState = React__default.default.useState(value),
20
+ _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
21
+ __value = _React$useState2[0],
22
+ __setValue = _React$useState2[1];
23
+ reactUse.useDebounce(function () {
24
+ return __setValue(value);
25
+ }, STATE_SYNC_DEBOUNCE_TIME, [value]);
26
+ reactUse.useDebounce(function () {
18
27
  if (__value !== value && typeof onChange === 'function') {
19
28
  onChange(__value !== null && __value !== void 0 ? __value : '');
20
29
  }
21
30
  }, STATE_SYNC_DEBOUNCE_TIME, [__value]);
22
- return React.createElement(wysiwyg.EliceWysiwygEditor, Object.assign({
31
+ return jsxRuntime.jsx(wysiwyg.EliceWysiwygEditor, Object.assign({
23
32
  value: value,
24
33
  onChange: __setValue
25
34
  }, props));
@@ -2,6 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
+ var jsxRuntime = require('react/jsx-runtime');
5
7
  var React = require('react');
6
8
  var reactUse = require('react-use');
7
9
  var designTokens = require('@elice/design-tokens');
@@ -17,123 +19,152 @@ var ko = require('./locales/ko.json.js');
17
19
  var MaterialQuizShimmer = require('./MaterialQuizShimmer.js');
18
20
  var MaterialQuizInfo = require('./MaterialQuizInfo.js');
19
21
 
20
- const eliceTheme = muiSystem.createEliceTheme({
22
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
23
+
24
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
25
+ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
26
+
27
+ var eliceTheme = muiSystem.createEliceTheme({
21
28
  paletteMode: 'dark',
22
29
  paletteName: 'purple'
23
30
  });
24
- const AsyncMaterialQuizSelectMultiple = React.lazy(() => Promise.resolve().then(function () { return require('./MaterialQuizSelectMultiple.js'); }));
25
- const AsyncMaterialQuizSelectMultipleOrder = React.lazy(() => Promise.resolve().then(function () { return require('./MaterialQuizSelectMultipleOrder.js'); }));
26
- const AsyncMaterialQuizText = React.lazy(() => Promise.resolve().then(function () { return require('./MaterialQuizText.js'); }));
27
- const AsyncMaterialQuizSelectOne = React.lazy(() => Promise.resolve().then(function () { return require('./MaterialQuizSelectOne.js'); }));
28
- const AsyncMaterialQuizGroup = React.lazy(() => Promise.resolve().then(function () { return require('./material-quiz-group/index.js'); }));
31
+ var AsyncMaterialQuizSelectMultiple = React__default.default.lazy(function () {
32
+ return Promise.resolve().then(function () { return require('./MaterialQuizSelectMultiple.js'); });
33
+ });
34
+ var AsyncMaterialQuizSelectMultipleOrder = React__default.default.lazy(function () {
35
+ return Promise.resolve().then(function () { return require('./MaterialQuizSelectMultipleOrder.js'); });
36
+ });
37
+ var AsyncMaterialQuizText = React__default.default.lazy(function () {
38
+ return Promise.resolve().then(function () { return require('./MaterialQuizText.js'); });
39
+ });
40
+ var AsyncMaterialQuizSelectOne = React__default.default.lazy(function () {
41
+ return Promise.resolve().then(function () { return require('./MaterialQuizSelectOne.js'); });
42
+ });
43
+ var AsyncMaterialQuizGroup = React__default.default.lazy(function () {
44
+ return Promise.resolve().then(function () { return require('./material-quiz-group/index.js'); });
45
+ });
29
46
  // 746px
30
- const MAX_CONTENT_WIDTH = '46.625rem';
31
- const StyledMaterialQuizInfo = styled.div.withConfig({
47
+ var MAX_CONTENT_WIDTH = '46.625rem';
48
+ var StyledMaterialQuizInfo = styled__default.default.div.withConfig({
32
49
  componentId: "sc-1eyn8fb-0"
33
50
  })([""]);
34
- const StyledMaterialQuizContent = styled.div.withConfig({
51
+ var StyledMaterialQuizContent = styled__default.default.div.withConfig({
35
52
  componentId: "sc-1eyn8fb-1"
36
- })(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], ({
37
- vertical
38
- }) => vertical ? 'unset' : 'auto');
39
- const LoadingContainer = styled.div.withConfig({
53
+ })(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], function (_ref) {
54
+ var vertical = _ref.vertical;
55
+ return vertical ? 'unset' : 'auto';
56
+ });
57
+ var LoadingContainer = styled__default.default.div.withConfig({
40
58
  componentId: "sc-1eyn8fb-2"
41
59
  })(["position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;max-width:none !important;background-color:", ";"], designTokens.base.color.navy8);
42
- const StyledMaterialQuizWrapper = styled.div.withConfig({
60
+ var StyledMaterialQuizWrapper = styled__default.default.div.withConfig({
43
61
  componentId: "sc-1eyn8fb-3"
44
- })(["-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;}}"], ({
45
- vertical
46
- }) => vertical ? 'column' : 'row', ({
47
- vertical
48
- }) => vertical ? 'auto' : '1', ({
49
- vertical,
50
- isQuizGroupType,
51
- isLongPassage
52
- }) => !isLongPassage && !vertical && !isQuizGroupType ? `${MAX_CONTENT_WIDTH}` : 'unset', StyledMaterialQuizInfo, ({
53
- vertical
54
- }) => vertical ? 'auto' : '100%', ({
55
- vertical
56
- }) => vertical ? 'intial' : 'auto');
57
- const MaterialQuiz = () => {
58
- const {
59
- materialQuiz,
60
- vertical,
61
- course,
62
- isLongPassage,
63
- isInitialLoading
64
- } = MaterialQuizContext.useMaterialQuizState();
65
- const {
66
- setVertical
67
- } = MaterialQuizContext.useMaterialQuizDispatch();
68
- const [ref, {
69
- width
70
- }] = reactUse.useMeasure();
71
- const isQuizGroupType = Boolean((materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.optionType) === types.enums.QuizOptionType.Group);
72
- const isFetchingData = !materialQuiz || !course;
73
- const isLoadingLayout = isFetchingData || isInitialLoading;
74
- const isVisibleSideBySide = !vertical && isLongPassage;
75
- const isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
76
- React.useEffect(() => {
62
+ })(["-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) {
63
+ var vertical = _ref2.vertical;
64
+ return vertical ? 'column' : 'row';
65
+ }, function (_ref3) {
66
+ var vertical = _ref3.vertical;
67
+ return vertical ? 'auto' : '1';
68
+ }, function (_ref4) {
69
+ var vertical = _ref4.vertical,
70
+ isQuizGroupType = _ref4.isQuizGroupType,
71
+ isLongPassage = _ref4.isLongPassage;
72
+ return !isLongPassage && !vertical && !isQuizGroupType ? "".concat(MAX_CONTENT_WIDTH) : 'unset';
73
+ }, StyledMaterialQuizInfo, function (_ref5) {
74
+ var vertical = _ref5.vertical;
75
+ return vertical ? 'auto' : '100%';
76
+ }, function (_ref6) {
77
+ var vertical = _ref6.vertical;
78
+ return vertical ? 'intial' : 'auto';
79
+ });
80
+ var MaterialQuiz = function MaterialQuiz() {
81
+ var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
82
+ materialQuiz = _useMaterialQuizState.materialQuiz,
83
+ vertical = _useMaterialQuizState.vertical,
84
+ course = _useMaterialQuizState.course,
85
+ isLongPassage = _useMaterialQuizState.isLongPassage,
86
+ isInitialLoading = _useMaterialQuizState.isInitialLoading;
87
+ var _useMaterialQuizDispa = MaterialQuizContext.useMaterialQuizDispatch(),
88
+ setVertical = _useMaterialQuizDispa.setVertical;
89
+ var _useMeasure = reactUse.useMeasure(),
90
+ _useMeasure2 = _rollupPluginBabelHelpers.slicedToArray(_useMeasure, 2),
91
+ ref = _useMeasure2[0],
92
+ width = _useMeasure2[1].width;
93
+ var isQuizGroupType = Boolean((materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.optionType) === types.enums.QuizOptionType.Group);
94
+ var isFetchingData = !materialQuiz || !course;
95
+ var isLoadingLayout = isFetchingData || isInitialLoading;
96
+ var isVisibleSideBySide = !vertical && isLongPassage;
97
+ var isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
98
+ React__default.default.useEffect(function () {
77
99
  if (width > 0) {
78
100
  setVertical(width <= designTokens.base.screen.medium);
79
101
  }
80
102
  }, [width, setVertical]);
81
- const renderQuestionOption = () => {
103
+ var renderQuestionOption = function renderQuestionOption() {
82
104
  if (isFetchingData) {
83
105
  return null;
84
106
  }
85
107
  switch (materialQuiz.optionType) {
86
108
  case types.enums.QuizOptionType.SelectOne:
87
- return React.createElement(AsyncMaterialQuizSelectOne, {
109
+ return jsxRuntime.jsx(AsyncMaterialQuizSelectOne, {
88
110
  hasInlinePassage: isRenderQuestionWithPassage
89
111
  });
90
112
  case types.enums.QuizOptionType.SelectMultiple:
91
- return React.createElement(AsyncMaterialQuizSelectMultiple, {
113
+ return jsxRuntime.jsx(AsyncMaterialQuizSelectMultiple, {
92
114
  hasInlinePassage: isRenderQuestionWithPassage
93
115
  });
94
116
  case types.enums.QuizOptionType.Text:
95
- return React.createElement(AsyncMaterialQuizText, {
117
+ return jsxRuntime.jsx(AsyncMaterialQuizText, {
96
118
  hasInlinePassage: isRenderQuestionWithPassage
97
119
  });
98
120
  case types.enums.QuizOptionType.SelectMultipleOrder:
99
- return React.createElement(AsyncMaterialQuizSelectMultipleOrder, {
121
+ return jsxRuntime.jsx(AsyncMaterialQuizSelectMultipleOrder, {
100
122
  hasInlinePassage: isRenderQuestionWithPassage
101
123
  });
102
124
  case types.enums.QuizOptionType.Group:
103
- return React.createElement(AsyncMaterialQuizGroup, null);
125
+ return jsxRuntime.jsx(AsyncMaterialQuizGroup, {});
104
126
  }
105
127
  };
106
- return React.createElement(React.Suspense, {
107
- fallback: null
108
- }, React.createElement(StyledMaterialQuizWrapper, {
109
- ref: ref,
110
- vertical: vertical,
111
- isQuizGroupType: isQuizGroupType,
112
- isLongPassage: isLongPassage
113
- }, isLoadingLayout && React.createElement(LoadingContainer, null, React.createElement(MaterialQuizShimmer.default, null)), isVisibleSideBySide && React.createElement(StyledMaterialQuizInfo, null, React.createElement(MaterialQuizInfo.default, null)), React.createElement(StyledMaterialQuizContent, {
114
- id: element.MATERIAL_QUIZ_CONTAINER_ID,
115
- vertical: vertical
116
- }, renderQuestionOption())));
128
+ return jsxRuntime.jsx(React__default.default.Suspense, {
129
+ fallback: null,
130
+ children: jsxRuntime.jsxs(StyledMaterialQuizWrapper, {
131
+ ref: ref,
132
+ vertical: vertical,
133
+ isQuizGroupType: isQuizGroupType,
134
+ isLongPassage: isLongPassage,
135
+ children: [isLoadingLayout && jsxRuntime.jsx(LoadingContainer, {
136
+ children: jsxRuntime.jsx(MaterialQuizShimmer.default, {})
137
+ }), isVisibleSideBySide && jsxRuntime.jsx(StyledMaterialQuizInfo, {
138
+ children: jsxRuntime.jsx(MaterialQuizInfo.default, {})
139
+ }), jsxRuntime.jsx(StyledMaterialQuizContent, {
140
+ id: element.MATERIAL_QUIZ_CONTAINER_ID,
141
+ vertical: vertical,
142
+ children: renderQuestionOption()
143
+ })]
144
+ })
145
+ });
117
146
  };
118
- const MaterialQuizContainer = ({
119
- materialQuizId,
120
- userId,
121
- onDirty,
122
- onSubmit,
123
- onNext,
124
- __intl
125
- }) => {
126
- return React.createElement(intl.RawEliceIntlProvider, {
127
- value: __intl
128
- }, React.createElement(material.ThemeProvider, {
129
- theme: eliceTheme
130
- }, React.createElement(MaterialQuizContext.MaterialQuizProvider, {
131
- materialQuizId: materialQuizId,
132
- userId: userId,
133
- onDirty: onDirty,
134
- onSubmit: onSubmit,
135
- onNext: onNext
136
- }, React.createElement(MaterialQuiz, null))));
147
+ var MaterialQuizContainer = function MaterialQuizContainer(_ref7) {
148
+ var materialQuizId = _ref7.materialQuizId,
149
+ userId = _ref7.userId,
150
+ onDirty = _ref7.onDirty,
151
+ onSubmit = _ref7.onSubmit,
152
+ onNext = _ref7.onNext,
153
+ __intl = _ref7.__intl;
154
+ return jsxRuntime.jsx(intl.RawEliceIntlProvider, {
155
+ value: __intl,
156
+ children: jsxRuntime.jsx(material.ThemeProvider, {
157
+ theme: eliceTheme,
158
+ children: jsxRuntime.jsx(MaterialQuizContext.MaterialQuizProvider, {
159
+ materialQuizId: materialQuizId,
160
+ userId: userId,
161
+ onDirty: onDirty,
162
+ onSubmit: onSubmit,
163
+ onNext: onNext,
164
+ children: jsxRuntime.jsx(MaterialQuiz, {})
165
+ })
166
+ })
167
+ });
137
168
  };
138
169
  var MaterialQuiz$1 = new intl.IntlComponentBuilder(MaterialQuizContainer).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('./locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('./locales/ja.json.js'); })).build();
139
170
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
6
  var blocks = require('@elice/blocks');
7
7
  var designTokens = require('@elice/design-tokens');
8
8
  var intl = require('@elice/intl');
@@ -12,42 +12,49 @@ var wysiwyg = require('@elice/wysiwyg');
12
12
  var styled = require('styled-components');
13
13
  var MaterialQuizContext = require('./context/MaterialQuizContext.js');
14
14
 
15
- const StyledMarkdownSSR = styled(markdown.MarkdownSSR).withConfig({
15
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
16
+
17
+ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
18
+
19
+ var StyledMarkdownSSR = styled__default.default(markdown.MarkdownSSR).withConfig({
16
20
  componentId: "sc-18kg5i5-0"
17
21
  })(["p{margin:0 !important;}", ""], wysiwyg.EliceWysiwygEditorTheme.resetMarkdownSSR);
18
- const StyledAccordion = styled(blocks.Accordion).withConfig({
22
+ var StyledAccordion = styled__default.default(blocks.Accordion).withConfig({
19
23
  componentId: "sc-18kg5i5-1"
20
24
  })(["border-radius:8px;overflow:hidden;background-color:", " !important;border-radius:8px;overflow:hidden;& > *:first-child{background-color:", " !important;}& > *:last-child{background-color:", " !important;}"], designTokens.base.color.navy5, designTokens.base.color.navy7, designTokens.base.color.navy7);
21
- const MaterialQuizAnswerExplanation = () => {
22
- const {
23
- lecture,
24
- materialQuiz
25
- } = MaterialQuizContext.useMaterialQuizState();
26
- const intl$1 = intl.useRawEliceIntl();
25
+ var MaterialQuizAnswerExplanation = function MaterialQuizAnswerExplanation() {
26
+ var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
27
+ lecture = _useMaterialQuizState.lecture,
28
+ materialQuiz = _useMaterialQuizState.materialQuiz;
29
+ var intl$1 = intl.useRawEliceIntl();
27
30
  if (!materialQuiz || !materialQuiz.explanationInfo.isEnabled || !materialQuiz.isResponded || (lecture === null || lecture === void 0 ? void 0 : lecture.lectureType) === types.enums.LectureType.Test && (lecture === null || lecture === void 0 ? void 0 : lecture.testUserStatus) !== types.enums.LectureTestUserStatus.Completed) {
28
31
  return null;
29
32
  }
30
- return React.createElement(blocks.Flex, {
33
+ return jsxRuntime.jsx(blocks.Flex, {
31
34
  column: true,
32
- margintop: "1rem"
33
- }, React.createElement(StyledAccordion, {
34
- dark: true,
35
- header: React.createElement(blocks.Text, {
36
- bold: true,
37
- role: "navy0"
38
- }, intl$1.formatMessage({
39
- id: 'materialQuiz.explanation.show'
40
- }))
41
- }, materialQuiz.explanationInfo.isEnabled ? React.createElement(StyledMarkdownSSR, {
42
- dark: true,
43
- children: materialQuiz.explanationInfo.value
44
- }) : React.createElement(blocks.Text, {
45
- role: "info",
46
- lineHeight: 1.4,
47
- userSelect: "none"
48
- }, intl$1.formatMessage({
49
- id: 'materialQuiz.explanation.empty'
50
- }))));
35
+ margintop: "1rem",
36
+ children: jsxRuntime.jsx(StyledAccordion, {
37
+ dark: true,
38
+ header: jsxRuntime.jsx(blocks.Text, {
39
+ bold: true,
40
+ role: "navy0",
41
+ children: intl$1.formatMessage({
42
+ id: 'materialQuiz.explanation.show'
43
+ })
44
+ }),
45
+ children: materialQuiz.explanationInfo.isEnabled ? jsxRuntime.jsx(StyledMarkdownSSR, {
46
+ dark: true,
47
+ children: materialQuiz.explanationInfo.value
48
+ }) : jsxRuntime.jsx(blocks.Text, {
49
+ role: "info",
50
+ lineHeight: 1.4,
51
+ userSelect: "none",
52
+ children: intl$1.formatMessage({
53
+ id: 'materialQuiz.explanation.empty'
54
+ })
55
+ })
56
+ })
57
+ });
51
58
  };
52
59
 
53
60
  exports.default = MaterialQuizAnswerExplanation;