@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.
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +423 -0
- package/cjs/components/eb-sortable/EbDraggable.js +42 -33
- package/cjs/components/eb-sortable/EbDroppable.js +27 -20
- package/cjs/components/markdown-editor/index.d.ts +1 -2
- package/cjs/components/markdown-editor/index.js +19 -10
- package/cjs/components/material-quiz/MaterialQuiz.js +114 -83
- package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +36 -29
- package/cjs/components/material-quiz/MaterialQuizInfo.js +151 -149
- package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +175 -127
- package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +360 -286
- package/cjs/components/material-quiz/MaterialQuizSelectOne.js +172 -126
- package/cjs/components/material-quiz/MaterialQuizShimmer.js +46 -39
- package/cjs/components/material-quiz/MaterialQuizText.js +163 -115
- package/cjs/components/material-quiz/QuizResultBadge.js +32 -22
- package/cjs/components/material-quiz/QuizSubmitStatusText.js +21 -16
- package/cjs/components/material-quiz/constants/color.js +5 -5
- package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
- package/cjs/components/material-quiz/context/MaterialQuizContext.js +156 -93
- package/cjs/components/material-quiz/index.js +9 -0
- package/cjs/components/material-quiz/locales/index.js +13 -0
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +259 -161
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +134 -100
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +130 -101
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +64 -52
- package/cjs/components/material-quiz/material-quiz-group/context/context.js +5 -1
- package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +47 -36
- package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +280 -232
- package/cjs/components/material-quiz-edit/context.js +8 -2
- package/cjs/components/material-quiz-edit/index.js +7 -0
- package/cjs/components/material-quiz-edit/locales/index.js +13 -0
- package/cjs/components/material-quiz-edit/options/OptionEditor.js +70 -46
- package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +174 -148
- package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +175 -149
- package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +164 -144
- package/cjs/components/material-quiz-edit/options/OptionText.js +90 -82
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +156 -112
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +288 -196
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +88 -75
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +108 -92
- package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
- package/cjs/components/material-quiz-edit/utils/editValue.js +21 -12
- package/cjs/components/shared/QuestionBox.js +198 -165
- package/cjs/components/shared/QuizDraggbleDroppedOption.js +11 -12
- package/cjs/components/shared/QuizDraggbleDummyOption.js +23 -16
- package/cjs/components/shared/QuizDraggbleOption.js +65 -59
- package/cjs/components/shared/StyledMarkdown.js +5 -1
- package/cjs/components/shared/index.js +19 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
- package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +59 -68
- package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
- package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
- package/cjs/components/shared/question-radio/QuestionRadioOption.js +52 -59
- package/cjs/components/shared/utils/getQuestionStatusStyle.js +7 -9
- package/cjs/components/shared/utils/mergeRefs.js +15 -6
- package/cjs/constant/element.js +3 -3
- package/cjs/constant/index.js +9 -0
- package/cjs/helpers/index.js +8 -10
- package/cjs/hooks/index.js +7 -0
- package/cjs/hooks/useCaculatePassage.js +21 -20
- package/es/_virtual/_rollupPluginBabelHelpers.js +408 -0
- package/es/components/eb-sortable/EbDraggable.js +37 -33
- package/es/components/eb-sortable/EbDroppable.js +22 -20
- package/es/components/markdown-editor/index.d.ts +1 -2
- package/es/components/markdown-editor/index.js +15 -10
- package/es/components/material-quiz/MaterialQuiz.js +109 -83
- package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +32 -29
- package/es/components/material-quiz/MaterialQuizInfo.js +148 -150
- package/es/components/material-quiz/MaterialQuizSelectMultiple.js +171 -127
- package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +356 -287
- package/es/components/material-quiz/MaterialQuizSelectOne.js +168 -126
- package/es/components/material-quiz/MaterialQuizShimmer.js +42 -39
- package/es/components/material-quiz/MaterialQuizText.js +158 -115
- package/es/components/material-quiz/QuizResultBadge.js +27 -22
- package/es/components/material-quiz/QuizSubmitStatusText.js +17 -16
- package/es/components/material-quiz/constants/color.js +5 -5
- package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
- package/es/components/material-quiz/context/MaterialQuizContext.js +153 -94
- package/es/components/material-quiz/index.js +2 -0
- package/es/components/material-quiz/locales/index.js +4 -0
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +253 -161
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +129 -100
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +125 -101
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +60 -52
- package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
- package/es/components/material-quiz-edit/MaterialQuizEdit.js +43 -36
- package/es/components/material-quiz-edit/MaterialQuizEditContent.js +272 -229
- package/es/components/material-quiz-edit/context.js +4 -2
- package/es/components/material-quiz-edit/index.js +1 -0
- package/es/components/material-quiz-edit/locales/index.js +4 -0
- package/es/components/material-quiz-edit/options/OptionEditor.js +64 -46
- package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +170 -148
- package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +171 -149
- package/es/components/material-quiz-edit/options/OptionSelectOne.js +159 -144
- package/es/components/material-quiz-edit/options/OptionText.js +86 -82
- package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
- package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +151 -112
- package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +283 -197
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +83 -75
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +103 -92
- package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
- package/es/components/material-quiz-edit/utils/editValue.js +17 -12
- package/es/components/shared/QuestionBox.js +192 -165
- package/es/components/shared/QuizDraggbleDroppedOption.js +11 -12
- package/es/components/shared/QuizDraggbleDummyOption.js +19 -16
- package/es/components/shared/QuizDraggbleOption.js +61 -59
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/es/components/shared/index.js +7 -0
- package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
- package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +54 -68
- package/es/components/shared/question-radio/QuestionRadio.js +9 -7
- package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
- package/es/components/shared/question-radio/QuestionRadioOption.js +47 -59
- package/es/components/shared/utils/getQuestionStatusStyle.js +7 -9
- package/es/components/shared/utils/mergeRefs.js +15 -6
- package/es/constant/element.js +3 -3
- package/es/constant/index.js +1 -0
- package/es/helpers/index.js +8 -10
- package/es/hooks/index.js +1 -0
- package/es/hooks/useCaculatePassage.js +21 -20
- package/package.json +12 -15
|
@@ -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 blocks = require('@elice/blocks');
|
|
@@ -14,183 +16,183 @@ var QuestionBox = require('../shared/QuestionBox.js');
|
|
|
14
16
|
var mergeRefs = require('../shared/utils/mergeRefs.js');
|
|
15
17
|
var MaterialQuizContext = require('./context/MaterialQuizContext.js');
|
|
16
18
|
|
|
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;
|
|
17
24
|
//
|
|
18
25
|
//
|
|
19
26
|
//
|
|
20
|
-
|
|
27
|
+
var StyledMarkdownSSR = styled__default.default(markdown.MarkdownSSR).withConfig({
|
|
21
28
|
componentId: "sc-1s7jbf9-0"
|
|
22
29
|
})([".elicemd--theme-dark{pre{border:0;}table td,table th{border-bottom-color:rgba(255,255,255,0.16);}}", ""], wysiwyg.EliceWysiwygEditorTheme.resetMarkdownSSR);
|
|
23
30
|
//
|
|
24
31
|
//
|
|
25
32
|
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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(() => {
|
|
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 () {
|
|
70
63
|
if (!(materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription) || !isRenderFinish || !containerRef.current) return;
|
|
71
64
|
// append zoom icon for image html render by MarkdownSSR
|
|
72
|
-
containerRef.current.querySelectorAll('img').forEach(img
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
`;
|
|
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 ";
|
|
79
68
|
if (parent) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
+
});
|
|
85
76
|
// restyle the zoom position when chaging the width instead of recreate it
|
|
86
77
|
if (zoomIcons.length === totalImages.length && idx !== -1) {
|
|
87
|
-
zoomIcons[idx].style.top =
|
|
88
|
-
zoomIcons[idx].style.right =
|
|
78
|
+
zoomIcons[idx].style.top = "".concat(imageRect.top - parentRect.top, "px");
|
|
79
|
+
zoomIcons[idx].style.right = "".concat(parentRect.right - imageRect.right, "px");
|
|
89
80
|
return;
|
|
90
81
|
}
|
|
91
82
|
parent.classList.add(IMAGE_CONTAINER_CLASSNAME);
|
|
92
83
|
parent.style.position = 'relative';
|
|
93
|
-
|
|
84
|
+
var span = document.createElement('span');
|
|
94
85
|
span.innerHTML = zoomIconStr;
|
|
95
86
|
span.classList.add(ZOOM_ICON_CLASSNAME);
|
|
96
|
-
span.style.top =
|
|
97
|
-
span.style.right =
|
|
98
|
-
span.onclick = ()
|
|
87
|
+
span.style.top = "".concat(imageRect.top - parentRect.top, "px");
|
|
88
|
+
span.style.right = "".concat(parentRect.right - imageRect.right, "px");
|
|
89
|
+
span.onclick = function () {
|
|
99
90
|
setZoomImageUrl(img.src);
|
|
100
91
|
};
|
|
101
92
|
parent.appendChild(span);
|
|
102
93
|
}
|
|
103
94
|
});
|
|
104
95
|
}, [materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionDescription, isRenderFinish, width]);
|
|
105
|
-
|
|
96
|
+
var onCloseImageModal = function onCloseImageModal() {
|
|
106
97
|
setZoomImageUrl('');
|
|
107
98
|
};
|
|
108
|
-
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
+
});
|
|
191
189
|
};
|
|
192
|
-
if (renderWithBox) return
|
|
193
|
-
|
|
190
|
+
if (renderWithBox) return jsxRuntime.jsx(QuestionBox.default, {
|
|
191
|
+
children: _renderQuiz()
|
|
192
|
+
});
|
|
193
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
194
|
+
children: _renderQuiz()
|
|
195
|
+
});
|
|
194
196
|
};
|
|
195
197
|
|
|
196
198
|
exports.default = MaterialQuizInfo;
|