@elice/material-quiz 1.240718.0-trasncript.2 → 1.240718.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/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
@@ -2,8 +2,6 @@
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');
7
5
  var React = require('react');
8
6
  var reactUse = require('react-use');
9
7
  var blocks = require('@elice/blocks');
@@ -16,183 +14,183 @@ var QuestionBox = require('../shared/QuestionBox.js');
16
14
  var mergeRefs = require('../shared/utils/mergeRefs.js');
17
15
  var MaterialQuizContext = require('./context/MaterialQuizContext.js');
18
16
 
19
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
20
-
21
- var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
22
-
23
- var _templateObject;
24
17
  //
25
18
  //
26
19
  //
27
- var StyledMarkdownSSR = styled__default.default(markdown.MarkdownSSR).withConfig({
20
+ const StyledMarkdownSSR = styled(markdown.MarkdownSSR).withConfig({
28
21
  componentId: "sc-1s7jbf9-0"
29
22
  })([".elicemd--theme-dark{pre{border:0;}table td,table th{border-bottom-color:rgba(255,255,255,0.16);}}", ""], wysiwyg.EliceWysiwygEditorTheme.resetMarkdownSSR);
30
23
  //
31
24
  //
32
25
  //
33
- var IMAGE_CONTAINER_CLASSNAME = 'markdown-zoomable-image-container';
34
- var ZOOM_ICON_CLASSNAME = 'markdown-zoom-icon';
35
- var MarkdownContainer = material.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers.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) {
36
- var vertical = _ref.vertical;
37
- return vertical ? '0!important' : '0';
38
- }, function (_ref2) {
39
- var theme = _ref2.theme;
40
- return theme.palette.common.white;
41
- });
42
- var MaterialQuizInfo = function MaterialQuizInfo(_ref3) {
43
- var _ref3$renderWithBox = _ref3.renderWithBox,
44
- renderWithBox = _ref3$renderWithBox === void 0 ? true : _ref3$renderWithBox;
45
- var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
46
- materialQuiz = _useMaterialQuizState.materialQuiz,
47
- vertical = _useMaterialQuizState.vertical;
48
- var _useState = React.useState(false),
49
- _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
50
- isRenderFinish = _useState2[0],
51
- setIsRenderFinish = _useState2[1];
52
- var containerRef = React.useRef(null);
53
- var _useMeasure = reactUse.useMeasure(),
54
- _useMeasure2 = _rollupPluginBabelHelpers.slicedToArray(_useMeasure, 2),
55
- markdownMeasueRef = _useMeasure2[0],
56
- width = _useMeasure2[1].width;
57
- var ref = mergeRefs.mergeRefs(containerRef, markdownMeasueRef);
58
- var _useState3 = React.useState(''),
59
- _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
60
- zoomImageUrl = _useState4[0],
61
- setZoomImageUrl = _useState4[1];
62
- React.useEffect(function () {
26
+ const IMAGE_CONTAINER_CLASSNAME = 'markdown-zoomable-image-container';
27
+ const ZOOM_ICON_CLASSNAME = 'markdown-zoom-icon';
28
+ const MarkdownContainer = material.styled('div')`
29
+ .${IMAGE_CONTAINER_CLASSNAME} {
30
+ position: relative;
31
+
32
+ span.${ZOOM_ICON_CLASSNAME} {
33
+ cursor: pointer;
34
+
35
+ position: absolute;
36
+ top: 0;
37
+ right: ${({
38
+ vertical
39
+ }) => vertical ? '0!important' : '0'};
40
+
41
+ width: 2rem;
42
+ aspect-ratio: 1;
43
+ background-color: ${({
44
+ theme
45
+ }) => theme.palette.inverse.main};
46
+ margin: 0.5rem;
47
+ border-radius: 50%;
48
+
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ }
53
+ }
54
+ `;
55
+ const MaterialQuizInfo = ({
56
+ renderWithBox = true
57
+ }) => {
58
+ const {
59
+ materialQuiz,
60
+ vertical
61
+ } = MaterialQuizContext.useMaterialQuizState();
62
+ const [isRenderFinish, setIsRenderFinish] = React.useState(false);
63
+ const containerRef = React.useRef(null);
64
+ const [markdownMeasueRef, {
65
+ width
66
+ }] = reactUse.useMeasure();
67
+ const ref = mergeRefs.mergeRefs(containerRef, markdownMeasueRef);
68
+ const [zoomImageUrl, setZoomImageUrl] = React.useState('');
69
+ React.useEffect(() => {
63
70
  if (!(materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription) || !isRenderFinish || !containerRef.current) return;
64
71
  // append zoom icon for image html render by MarkdownSSR
65
- containerRef.current.querySelectorAll('img').forEach(function (img) {
66
- var parent = img.parentElement;
67
- 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 ";
72
+ containerRef.current.querySelectorAll('img').forEach(img => {
73
+ const parent = img.parentElement;
74
+ const zoomIconStr = `
75
+ <svg width="25" height="25" viewBox="0 0 25 25" fill="white" xmlns="http://www.w3.org/2000/svg">
76
+ <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"/>
77
+ </svg>
78
+ `;
68
79
  if (parent) {
69
- var imageRect = img.getBoundingClientRect();
70
- var parentRect = parent.getBoundingClientRect();
71
- var zoomIcons = parent.querySelectorAll(".".concat(ZOOM_ICON_CLASSNAME));
72
- var totalImages = Array.from(parent.querySelectorAll("img"));
73
- var idx = totalImages.findIndex(function (item) {
74
- return item === img;
75
- });
80
+ const imageRect = img.getBoundingClientRect();
81
+ const parentRect = parent.getBoundingClientRect();
82
+ const zoomIcons = parent.querySelectorAll(`.${ZOOM_ICON_CLASSNAME}`);
83
+ const totalImages = Array.from(parent.querySelectorAll(`img`));
84
+ const idx = totalImages.findIndex(item => item === img);
76
85
  // restyle the zoom position when chaging the width instead of recreate it
77
86
  if (zoomIcons.length === totalImages.length && idx !== -1) {
78
- zoomIcons[idx].style.top = "".concat(imageRect.top - parentRect.top, "px");
79
- zoomIcons[idx].style.right = "".concat(parentRect.right - imageRect.right, "px");
87
+ zoomIcons[idx].style.top = `${imageRect.top - parentRect.top}px`;
88
+ zoomIcons[idx].style.right = `${parentRect.right - imageRect.right}px`;
80
89
  return;
81
90
  }
82
91
  parent.classList.add(IMAGE_CONTAINER_CLASSNAME);
83
92
  parent.style.position = 'relative';
84
- var span = document.createElement('span');
93
+ const span = document.createElement('span');
85
94
  span.innerHTML = zoomIconStr;
86
95
  span.classList.add(ZOOM_ICON_CLASSNAME);
87
- span.style.top = "".concat(imageRect.top - parentRect.top, "px");
88
- span.style.right = "".concat(parentRect.right - imageRect.right, "px");
89
- span.onclick = function () {
96
+ span.style.top = `${imageRect.top - parentRect.top}px`;
97
+ span.style.right = `${parentRect.right - imageRect.right}px`;
98
+ span.onclick = () => {
90
99
  setZoomImageUrl(img.src);
91
100
  };
92
101
  parent.appendChild(span);
93
102
  }
94
103
  });
95
104
  }, [materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription, isRenderFinish, width]);
96
- var onCloseImageModal = function onCloseImageModal() {
105
+ const onCloseImageModal = () => {
97
106
  setZoomImageUrl('');
98
107
  };
99
- var _renderQuiz = function _renderQuiz() {
100
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
101
- children: [materialQuiz ? jsxRuntime.jsx(MarkdownContainer, {
102
- ref: ref,
103
- vertical: vertical,
104
- children: jsxRuntime.jsx(StyledMarkdownSSR, {
105
- onRender: function onRender() {
106
- // set timeout for waiting time to the image can render
107
- setTimeout(function () {
108
- setIsRenderFinish(true);
109
- }, 300);
110
- },
111
- children: materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription,
112
- dark: true,
113
- paddingx: 0,
114
- paddingy: 0
115
- })
116
- }) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
117
- children: [jsxRuntime.jsx(blocks.Vspace, {
118
- height: 1
119
- }), jsxRuntime.jsx(blocks.Shimmer, {
120
- dark: true,
121
- borderRadius: '4px',
122
- width: "80%",
123
- height: '40px'
124
- }), jsxRuntime.jsx(blocks.Vspace, {
125
- height: 1
126
- }), jsxRuntime.jsx(blocks.Shimmer, {
127
- dark: true,
128
- borderRadius: '4px',
129
- width: "100%",
130
- height: '40px'
131
- }), jsxRuntime.jsx(blocks.Vspace, {
132
- height: 1
133
- }), jsxRuntime.jsx(blocks.Shimmer, {
134
- dark: true,
135
- borderRadius: '4px',
136
- width: "100%",
137
- height: '40px'
138
- }), jsxRuntime.jsx(blocks.Vspace, {
139
- height: 1
140
- }), jsxRuntime.jsx(blocks.Shimmer, {
141
- dark: true,
142
- borderRadius: '4px',
143
- width: "100%",
144
- height: '40px'
145
- })]
146
- }), jsxRuntime.jsx(material.Modal, {
147
- open: !!zoomImageUrl,
148
- sx: {
149
- border: 'none',
150
- outline: '0',
151
- display: 'flex',
152
- justifyContent: 'center',
153
- alignItems: 'center'
154
- },
155
- children: jsxRuntime.jsxs(material.Box, {
156
- width: "70%",
157
- height: "70%",
158
- display: "flex",
159
- alignItems: "center",
160
- justifyContent: "center",
161
- position: "relative",
162
- sx: {
163
- outline: 'none'
164
- },
165
- children: [jsxRuntime.jsx("img", {
166
- src: zoomImageUrl,
167
- "aria-hidden": true,
168
- alt: "zoom image",
169
- style: {
170
- maxWidth: '100%',
171
- maxHeight: '100%'
172
- }
173
- }), jsxRuntime.jsx(blocks.IconButton, {
174
- icon: icons.eilMathsignMultiplyBasic,
175
- role: "white",
176
- size: "micro",
177
- border: false,
178
- transparent: true,
179
- style: {
180
- position: 'absolute',
181
- right: '-10%',
182
- top: '-10%'
183
- },
184
- onClick: onCloseImageModal
185
- })]
186
- })
187
- })]
188
- });
108
+ const _renderQuiz = () => {
109
+ return React.createElement(React.Fragment, null, materialQuiz ? React.createElement(MarkdownContainer, {
110
+ ref: ref,
111
+ vertical: vertical
112
+ }, React.createElement(StyledMarkdownSSR, {
113
+ onRender: () => {
114
+ // set timeout for waiting time to the image can render
115
+ setTimeout(() => {
116
+ setIsRenderFinish(true);
117
+ }, 300);
118
+ },
119
+ children: materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription,
120
+ dark: true,
121
+ paddingx: 0,
122
+ paddingy: 0
123
+ })) : React.createElement(React.Fragment, null, React.createElement(blocks.Vspace, {
124
+ height: 1
125
+ }), React.createElement(blocks.Shimmer, {
126
+ dark: true,
127
+ borderRadius: '4px',
128
+ width: "80%",
129
+ height: '40px'
130
+ }), React.createElement(blocks.Vspace, {
131
+ height: 1
132
+ }), React.createElement(blocks.Shimmer, {
133
+ dark: true,
134
+ borderRadius: '4px',
135
+ width: "100%",
136
+ height: '40px'
137
+ }), React.createElement(blocks.Vspace, {
138
+ height: 1
139
+ }), React.createElement(blocks.Shimmer, {
140
+ dark: true,
141
+ borderRadius: '4px',
142
+ width: "100%",
143
+ height: '40px'
144
+ }), React.createElement(blocks.Vspace, {
145
+ height: 1
146
+ }), React.createElement(blocks.Shimmer, {
147
+ dark: true,
148
+ borderRadius: '4px',
149
+ width: "100%",
150
+ height: '40px'
151
+ })), React.createElement(material.Modal, {
152
+ open: !!zoomImageUrl,
153
+ sx: {
154
+ border: 'none',
155
+ outline: '0',
156
+ display: 'flex',
157
+ justifyContent: 'center',
158
+ alignItems: 'center'
159
+ }
160
+ }, React.createElement(material.Box, {
161
+ width: "70%",
162
+ height: "70%",
163
+ display: "flex",
164
+ alignItems: "center",
165
+ justifyContent: "center",
166
+ position: "relative",
167
+ sx: {
168
+ outline: 'none'
169
+ }
170
+ }, React.createElement("img", {
171
+ src: zoomImageUrl,
172
+ "aria-hidden": true,
173
+ alt: "zoom image",
174
+ style: {
175
+ maxWidth: '100%',
176
+ maxHeight: '100%'
177
+ }
178
+ }), React.createElement(blocks.IconButton, {
179
+ icon: icons.eilMathsignMultiplyBasic,
180
+ role: "white",
181
+ size: "micro",
182
+ border: false,
183
+ transparent: true,
184
+ style: {
185
+ position: 'absolute',
186
+ right: '-10%',
187
+ top: '-10%'
188
+ },
189
+ onClick: onCloseImageModal
190
+ }))));
189
191
  };
190
- if (renderWithBox) return jsxRuntime.jsx(QuestionBox.default, {
191
- children: _renderQuiz()
192
- });
193
- return jsxRuntime.jsx(jsxRuntime.Fragment, {
194
- children: _renderQuiz()
195
- });
192
+ if (renderWithBox) return React.createElement(QuestionBox.default, null, _renderQuiz());
193
+ return React.createElement(React.Fragment, null, _renderQuiz());
196
194
  };
197
195
 
198
196
  exports.default = MaterialQuizInfo;