@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,4 +1,6 @@
1
- import React, { useState, useRef, useEffect } from 'react';
1
+ import { taggedTemplateLiteral as _taggedTemplateLiteral, slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
+ import { useState, useRef, useEffect } from 'react';
2
4
  import { useMeasure } from 'react-use';
3
5
  import { Vspace, Shimmer, IconButton } from '@elice/blocks';
4
6
  import { eilMathsignMultiplyBasic } from '@elice/icons';
@@ -10,183 +12,179 @@ import QuestionBox from '../shared/QuestionBox.js';
10
12
  import { mergeRefs } from '../shared/utils/mergeRefs.js';
11
13
  import { useMaterialQuizState } from './context/MaterialQuizContext.js';
12
14
 
15
+ var _templateObject;
13
16
  //
14
17
  //
15
18
  //
16
- const StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
19
+ var StyledMarkdownSSR = styled(MarkdownSSR).withConfig({
17
20
  componentId: "sc-1s7jbf9-0"
18
21
  })([".elicemd--theme-dark{pre{border:0;}table td,table th{border-bottom-color:rgba(255,255,255,0.16);}}", ""], EliceWysiwygEditorTheme.resetMarkdownSSR);
19
22
  //
20
23
  //
21
24
  //
22
- const IMAGE_CONTAINER_CLASSNAME = 'markdown-zoomable-image-container';
23
- const ZOOM_ICON_CLASSNAME = 'markdown-zoom-icon';
24
- const MarkdownContainer = styled$1('div')`
25
- .${IMAGE_CONTAINER_CLASSNAME} {
26
- position: relative;
27
-
28
- span.${ZOOM_ICON_CLASSNAME} {
29
- cursor: pointer;
30
-
31
- position: absolute;
32
- top: 0;
33
- right: ${({
34
- vertical
35
- }) => vertical ? '0!important' : '0'};
36
-
37
- width: 2rem;
38
- aspect-ratio: 1;
39
- background-color: ${({
40
- theme
41
- }) => theme.palette.inverse.main};
42
- margin: 0.5rem;
43
- border-radius: 50%;
44
-
45
- display: flex;
46
- align-items: center;
47
- justify-content: center;
48
- }
49
- }
50
- `;
51
- const MaterialQuizInfo = ({
52
- renderWithBox = true
53
- }) => {
54
- const {
55
- materialQuiz,
56
- vertical
57
- } = useMaterialQuizState();
58
- const [isRenderFinish, setIsRenderFinish] = useState(false);
59
- const containerRef = useRef(null);
60
- const [markdownMeasueRef, {
61
- width
62
- }] = useMeasure();
63
- const ref = mergeRefs(containerRef, markdownMeasueRef);
64
- const [zoomImageUrl, setZoomImageUrl] = useState('');
65
- useEffect(() => {
25
+ var IMAGE_CONTAINER_CLASSNAME = 'markdown-zoomable-image-container';
26
+ var ZOOM_ICON_CLASSNAME = 'markdown-zoom-icon';
27
+ var MarkdownContainer = styled$1('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n position: relative;\n\n span.", " {\n cursor: pointer;\n\n position: absolute;\n top: 0;\n right: ", ";\n\n width: 2rem;\n aspect-ratio: 1;\n background-color: ", ";\n margin: 0.5rem;\n border-radius: 50%;\n\n display: flex;\n align-items: center;\n justify-content: center;\n }\n }\n"])), IMAGE_CONTAINER_CLASSNAME, ZOOM_ICON_CLASSNAME, function (_ref) {
28
+ var vertical = _ref.vertical;
29
+ return vertical ? '0!important' : '0';
30
+ }, function (_ref2) {
31
+ var theme = _ref2.theme;
32
+ return theme.palette.common.white;
33
+ });
34
+ var MaterialQuizInfo = function MaterialQuizInfo(_ref3) {
35
+ var _ref3$renderWithBox = _ref3.renderWithBox,
36
+ renderWithBox = _ref3$renderWithBox === void 0 ? true : _ref3$renderWithBox;
37
+ var _useMaterialQuizState = useMaterialQuizState(),
38
+ materialQuiz = _useMaterialQuizState.materialQuiz,
39
+ vertical = _useMaterialQuizState.vertical;
40
+ var _useState = useState(false),
41
+ _useState2 = _slicedToArray(_useState, 2),
42
+ isRenderFinish = _useState2[0],
43
+ setIsRenderFinish = _useState2[1];
44
+ var containerRef = useRef(null);
45
+ var _useMeasure = useMeasure(),
46
+ _useMeasure2 = _slicedToArray(_useMeasure, 2),
47
+ markdownMeasueRef = _useMeasure2[0],
48
+ width = _useMeasure2[1].width;
49
+ var ref = mergeRefs(containerRef, markdownMeasueRef);
50
+ var _useState3 = useState(''),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ zoomImageUrl = _useState4[0],
53
+ setZoomImageUrl = _useState4[1];
54
+ useEffect(function () {
66
55
  if (!(materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription) || !isRenderFinish || !containerRef.current) return;
67
56
  // append zoom icon for image html render by MarkdownSSR
68
- containerRef.current.querySelectorAll('img').forEach(img => {
69
- const parent = img.parentElement;
70
- const zoomIconStr = `
71
- <svg width="25" height="25" viewBox="0 0 25 25" fill="white" xmlns="http://www.w3.org/2000/svg">
72
- <path d="M5.75 4.875H9.125C9.72266 4.875 10.25 5.40234 10.25 6C10.25 6.63281 9.72266 7.125 9.125 7.125H6.875V9.375C6.875 10.0078 6.34766 10.5 5.75 10.5C5.11719 10.5 4.625 10.0078 4.625 9.375V6C4.625 5.40234 5.11719 4.875 5.75 4.875ZM6.875 16.125V18.375H9.125C9.72266 18.375 10.25 18.9023 10.25 19.5C10.25 20.1328 9.72266 20.625 9.125 20.625H5.75C5.11719 20.625 4.625 20.1328 4.625 19.5V16.125C4.625 15.5273 5.11719 15 5.75 15C6.34766 15 6.875 15.5273 6.875 16.125ZM15.875 4.875H19.25C19.8477 4.875 20.375 5.40234 20.375 6V9.375C20.375 10.0078 19.8477 10.5 19.25 10.5C18.6172 10.5 18.125 10.0078 18.125 9.375V7.125H15.875C15.2422 7.125 14.75 6.63281 14.75 6C14.75 5.40234 15.2422 4.875 15.875 4.875ZM20.375 16.125V19.5C20.375 20.1328 19.8477 20.625 19.25 20.625H15.875C15.2422 20.625 14.75 20.1328 14.75 19.5C14.75 18.9023 15.2422 18.375 15.875 18.375H18.125V16.125C18.125 15.5273 18.6172 15 19.25 15C19.8477 15 20.375 15.5273 20.375 16.125Z" fill="#D6DAE1"/>
73
- </svg>
74
- `;
57
+ containerRef.current.querySelectorAll('img').forEach(function (img) {
58
+ var parent = img.parentElement;
59
+ var zoomIconStr = "\n <svg width=\"25\" height=\"25\" viewBox=\"0 0 25 25\" fill=\"white\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.75 4.875H9.125C9.72266 4.875 10.25 5.40234 10.25 6C10.25 6.63281 9.72266 7.125 9.125 7.125H6.875V9.375C6.875 10.0078 6.34766 10.5 5.75 10.5C5.11719 10.5 4.625 10.0078 4.625 9.375V6C4.625 5.40234 5.11719 4.875 5.75 4.875ZM6.875 16.125V18.375H9.125C9.72266 18.375 10.25 18.9023 10.25 19.5C10.25 20.1328 9.72266 20.625 9.125 20.625H5.75C5.11719 20.625 4.625 20.1328 4.625 19.5V16.125C4.625 15.5273 5.11719 15 5.75 15C6.34766 15 6.875 15.5273 6.875 16.125ZM15.875 4.875H19.25C19.8477 4.875 20.375 5.40234 20.375 6V9.375C20.375 10.0078 19.8477 10.5 19.25 10.5C18.6172 10.5 18.125 10.0078 18.125 9.375V7.125H15.875C15.2422 7.125 14.75 6.63281 14.75 6C14.75 5.40234 15.2422 4.875 15.875 4.875ZM20.375 16.125V19.5C20.375 20.1328 19.8477 20.625 19.25 20.625H15.875C15.2422 20.625 14.75 20.1328 14.75 19.5C14.75 18.9023 15.2422 18.375 15.875 18.375H18.125V16.125C18.125 15.5273 18.6172 15 19.25 15C19.8477 15 20.375 15.5273 20.375 16.125Z\" fill=\"#D6DAE1\"/>\n </svg>\n ";
75
60
  if (parent) {
76
- const imageRect = img.getBoundingClientRect();
77
- const parentRect = parent.getBoundingClientRect();
78
- const zoomIcons = parent.querySelectorAll(`.${ZOOM_ICON_CLASSNAME}`);
79
- const totalImages = Array.from(parent.querySelectorAll(`img`));
80
- const idx = totalImages.findIndex(item => item === img);
61
+ var imageRect = img.getBoundingClientRect();
62
+ var parentRect = parent.getBoundingClientRect();
63
+ var zoomIcons = parent.querySelectorAll(".".concat(ZOOM_ICON_CLASSNAME));
64
+ var totalImages = Array.from(parent.querySelectorAll("img"));
65
+ var idx = totalImages.findIndex(function (item) {
66
+ return item === img;
67
+ });
81
68
  // restyle the zoom position when chaging the width instead of recreate it
82
69
  if (zoomIcons.length === totalImages.length && idx !== -1) {
83
- zoomIcons[idx].style.top = `${imageRect.top - parentRect.top}px`;
84
- zoomIcons[idx].style.right = `${parentRect.right - imageRect.right}px`;
70
+ zoomIcons[idx].style.top = "".concat(imageRect.top - parentRect.top, "px");
71
+ zoomIcons[idx].style.right = "".concat(parentRect.right - imageRect.right, "px");
85
72
  return;
86
73
  }
87
74
  parent.classList.add(IMAGE_CONTAINER_CLASSNAME);
88
75
  parent.style.position = 'relative';
89
- const span = document.createElement('span');
76
+ var span = document.createElement('span');
90
77
  span.innerHTML = zoomIconStr;
91
78
  span.classList.add(ZOOM_ICON_CLASSNAME);
92
- span.style.top = `${imageRect.top - parentRect.top}px`;
93
- span.style.right = `${parentRect.right - imageRect.right}px`;
94
- span.onclick = () => {
79
+ span.style.top = "".concat(imageRect.top - parentRect.top, "px");
80
+ span.style.right = "".concat(parentRect.right - imageRect.right, "px");
81
+ span.onclick = function () {
95
82
  setZoomImageUrl(img.src);
96
83
  };
97
84
  parent.appendChild(span);
98
85
  }
99
86
  });
100
87
  }, [materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription, isRenderFinish, width]);
101
- const onCloseImageModal = () => {
88
+ var onCloseImageModal = function onCloseImageModal() {
102
89
  setZoomImageUrl('');
103
90
  };
104
- const _renderQuiz = () => {
105
- return React.createElement(React.Fragment, null, materialQuiz ? React.createElement(MarkdownContainer, {
106
- ref: ref,
107
- vertical: vertical
108
- }, React.createElement(StyledMarkdownSSR, {
109
- onRender: () => {
110
- // set timeout for waiting time to the image can render
111
- setTimeout(() => {
112
- setIsRenderFinish(true);
113
- }, 300);
114
- },
115
- children: materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription,
116
- dark: true,
117
- paddingx: 0,
118
- paddingy: 0
119
- })) : React.createElement(React.Fragment, null, React.createElement(Vspace, {
120
- height: 1
121
- }), React.createElement(Shimmer, {
122
- dark: true,
123
- borderRadius: '4px',
124
- width: "80%",
125
- height: '40px'
126
- }), React.createElement(Vspace, {
127
- height: 1
128
- }), React.createElement(Shimmer, {
129
- dark: true,
130
- borderRadius: '4px',
131
- width: "100%",
132
- height: '40px'
133
- }), React.createElement(Vspace, {
134
- height: 1
135
- }), React.createElement(Shimmer, {
136
- dark: true,
137
- borderRadius: '4px',
138
- width: "100%",
139
- height: '40px'
140
- }), React.createElement(Vspace, {
141
- height: 1
142
- }), React.createElement(Shimmer, {
143
- dark: true,
144
- borderRadius: '4px',
145
- width: "100%",
146
- height: '40px'
147
- })), React.createElement(Modal, {
148
- open: !!zoomImageUrl,
149
- sx: {
150
- border: 'none',
151
- outline: '0',
152
- display: 'flex',
153
- justifyContent: 'center',
154
- alignItems: 'center'
155
- }
156
- }, React.createElement(Box, {
157
- width: "70%",
158
- height: "70%",
159
- display: "flex",
160
- alignItems: "center",
161
- justifyContent: "center",
162
- position: "relative",
163
- sx: {
164
- outline: 'none'
165
- }
166
- }, React.createElement("img", {
167
- src: zoomImageUrl,
168
- "aria-hidden": true,
169
- alt: "zoom image",
170
- style: {
171
- maxWidth: '100%',
172
- maxHeight: '100%'
173
- }
174
- }), React.createElement(IconButton, {
175
- icon: eilMathsignMultiplyBasic,
176
- role: "white",
177
- size: "micro",
178
- border: false,
179
- transparent: true,
180
- style: {
181
- position: 'absolute',
182
- right: '-10%',
183
- top: '-10%'
184
- },
185
- onClick: onCloseImageModal
186
- }))));
91
+ var _renderQuiz = function _renderQuiz() {
92
+ return jsxs(Fragment, {
93
+ children: [materialQuiz ? jsx(MarkdownContainer, {
94
+ ref: ref,
95
+ vertical: vertical,
96
+ children: jsx(StyledMarkdownSSR, {
97
+ onRender: function onRender() {
98
+ // set timeout for waiting time to the image can render
99
+ setTimeout(function () {
100
+ setIsRenderFinish(true);
101
+ }, 300);
102
+ },
103
+ children: materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription,
104
+ dark: true,
105
+ paddingx: 0,
106
+ paddingy: 0
107
+ })
108
+ }) : jsxs(Fragment, {
109
+ children: [jsx(Vspace, {
110
+ height: 1
111
+ }), jsx(Shimmer, {
112
+ dark: true,
113
+ borderRadius: '4px',
114
+ width: "80%",
115
+ height: '40px'
116
+ }), jsx(Vspace, {
117
+ height: 1
118
+ }), jsx(Shimmer, {
119
+ dark: true,
120
+ borderRadius: '4px',
121
+ width: "100%",
122
+ height: '40px'
123
+ }), jsx(Vspace, {
124
+ height: 1
125
+ }), jsx(Shimmer, {
126
+ dark: true,
127
+ borderRadius: '4px',
128
+ width: "100%",
129
+ height: '40px'
130
+ }), jsx(Vspace, {
131
+ height: 1
132
+ }), jsx(Shimmer, {
133
+ dark: true,
134
+ borderRadius: '4px',
135
+ width: "100%",
136
+ height: '40px'
137
+ })]
138
+ }), jsx(Modal, {
139
+ open: !!zoomImageUrl,
140
+ sx: {
141
+ border: 'none',
142
+ outline: '0',
143
+ display: 'flex',
144
+ justifyContent: 'center',
145
+ alignItems: 'center'
146
+ },
147
+ children: jsxs(Box, {
148
+ width: "70%",
149
+ height: "70%",
150
+ display: "flex",
151
+ alignItems: "center",
152
+ justifyContent: "center",
153
+ position: "relative",
154
+ sx: {
155
+ outline: 'none'
156
+ },
157
+ children: [jsx("img", {
158
+ src: zoomImageUrl,
159
+ "aria-hidden": true,
160
+ alt: "zoom image",
161
+ style: {
162
+ maxWidth: '100%',
163
+ maxHeight: '100%'
164
+ }
165
+ }), jsx(IconButton, {
166
+ icon: eilMathsignMultiplyBasic,
167
+ role: "white",
168
+ size: "micro",
169
+ border: false,
170
+ transparent: true,
171
+ style: {
172
+ position: 'absolute',
173
+ right: '-10%',
174
+ top: '-10%'
175
+ },
176
+ onClick: onCloseImageModal
177
+ })]
178
+ })
179
+ })]
180
+ });
187
181
  };
188
- if (renderWithBox) return React.createElement(QuestionBox, null, _renderQuiz());
189
- return React.createElement(React.Fragment, null, _renderQuiz());
182
+ if (renderWithBox) return jsx(QuestionBox, {
183
+ children: _renderQuiz()
184
+ });
185
+ return jsx(Fragment, {
186
+ children: _renderQuiz()
187
+ });
190
188
  };
191
189
 
192
190
  export { MaterialQuizInfo as default };