@elice/material-quiz 1.240718.0-trasncript.2 → 1.240718.1

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
@@ -1,6 +1,4 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { __rest } from 'tslib';
3
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
2
  import React, { useEffect } from 'react';
5
3
  import { useIntersection } from 'react-use';
6
4
  import { Button, Flex, Text, Box } from '@elice/blocks';
@@ -13,231 +11,206 @@ import { MATERIAL_QUIZ_ANSWER_ID, MATERIAL_QUIZ_PASSIVE_ID } from '../../constan
13
11
  import { useMaterialQuizState } from '../material-quiz/context/MaterialQuizContext.js';
14
12
  import { mergeRefs } from './utils/mergeRefs.js';
15
13
 
16
- var easeInOutCubic = function easeInOutCubic(t) {
14
+ const easeInOutCubic = t => {
17
15
  return t < 0.5 ? 4 * Math.pow(t, 3) : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
18
16
  };
19
- var StyledQuestionBox = styled.div.withConfig({
17
+ const StyledQuestionBox = styled.div.withConfig({
20
18
  componentId: "sc-6qfyxj-0"
21
- })(["position:relative;display:flex;flex-direction:column;overflow:", ";border-radius:", ";width:100%;background-color:", ";", ";"], function (_ref) {
22
- var vertical = _ref.vertical;
23
- return vertical ? 'auto' : 'hidden';
24
- }, function (_ref2) {
25
- var vertical = _ref2.vertical;
26
- return vertical ? '0' : '8px';
27
- }, base.color.navy8, function (_ref3) {
28
- var vertical = _ref3.vertical;
29
- return vertical ? 'height: 100%' : "\n max-height: 100%;\n min-height: 100%;\n ";
30
- });
31
- var StyledQuestionBoxHeader = styled.div.withConfig({
19
+ })(["position:relative;display:flex;flex-direction:column;overflow:", ";border-radius:", ";width:100%;background-color:", ";", ";"], ({
20
+ vertical
21
+ }) => vertical ? 'auto' : 'hidden', ({
22
+ vertical
23
+ }) => vertical ? '0' : '8px', base.color.navy8, ({
24
+ vertical
25
+ }) => vertical ? 'height: 100%' : `
26
+ max-height: 100%;
27
+ min-height: 100%;
28
+ `);
29
+ const StyledQuestionBoxHeader = styled.div.withConfig({
32
30
  componentId: "sc-6qfyxj-1"
33
- })(["display:flex;justify-content:space-between;background-color:", ";padding:", ";flex:none;", ""], base.color.navy8, function (_ref4) {
34
- var vertical = _ref4.vertical;
35
- return !vertical ? '1.5rem' : '1.5rem 1rem 1rem';
36
- }, function (_ref5) {
37
- var vertical = _ref5.vertical;
38
- return vertical ? "\n position: sticky;\n top: -1px;\n left: 0;\n z-index: 1;\n " : '';
39
- });
40
- var StyledQuestionBoxBody = styled.div.withConfig({
31
+ })(["display:flex;justify-content:space-between;background-color:", ";padding:", ";flex:none;", ""], base.color.navy8, ({
32
+ vertical
33
+ }) => !vertical ? '1.5rem' : '1.5rem 1rem 1rem', ({
34
+ vertical
35
+ }) => vertical ? `
36
+ position: sticky;
37
+ top: -1px;
38
+ left: 0;
39
+ z-index: 1;
40
+ ` : '');
41
+ const StyledQuestionBoxBody = styled.div.withConfig({
41
42
  componentId: "sc-6qfyxj-2"
42
- })(["background-color:", ";flex:auto;", ";"], base.color.navy8, function (_ref6) {
43
- var hasFooter = _ref6.hasFooter,
44
- vertical = _ref6.vertical;
45
- return hasFooter && !vertical ? 'height: 100%; padding: 0 1.5rem 1.5rem; overflow-y: auto;' : 'padding: 0.25rem 1.5rem 1.5rem';
46
- });
47
- var StyledAnchorBox = styled.div.withConfig({
43
+ })(["background-color:", ";flex:auto;", ";"], base.color.navy8, ({
44
+ hasFooter,
45
+ vertical
46
+ }) => hasFooter && !vertical ? 'height: 100%; padding: 0 1.5rem 1.5rem; overflow-y: auto;' : 'padding: 0.25rem 1.5rem 1.5rem');
47
+ const StyledAnchorBox = styled.div.withConfig({
48
48
  componentId: "sc-6qfyxj-3"
49
49
  })(["position:sticky;bottom:0;left:0;display:flex;justify-content:center;background-color:", ";border-top:1px solid ", ";"], base.color.navy8, base.color.gray7);
50
- var StyledQuestionBoxFooter = styled.div.withConfig({
50
+ const StyledQuestionBoxFooter = styled.div.withConfig({
51
51
  componentId: "sc-6qfyxj-4"
52
- })(["flex:none;display:flex;align-items:center;padding:1rem;background-color:", ";", ""], base.color.navy8, function (_ref7) {
53
- var vertical = _ref7.vertical;
54
- return vertical ? "\n flex-direction: column;\n align-items: flex-start;\n " : "\n border-top: 1px solid ".concat(base.color.gray7, ";\n justify-content: end; \n gap: 0.75rem;\n ");
52
+ })(["flex:none;display:flex;align-items:center;padding:1rem;background-color:", ";", ""], base.color.navy8, ({
53
+ vertical
54
+ }) => {
55
+ return vertical ? `
56
+ flex-direction: column;
57
+ align-items: flex-start;
58
+ ` : `
59
+ border-top: 1px solid ${base.color.gray7};
60
+ justify-content: end;
61
+ gap: 0.75rem;
62
+ `;
55
63
  });
56
- var StyledQuestionBoxFooterActions = styled.div.withConfig({
64
+ const StyledQuestionBoxFooterActions = styled.div.withConfig({
57
65
  componentId: "sc-6qfyxj-5"
58
- })(["display:flex;gap:0.75rem;", ";"], function (_ref8) {
59
- var vertical = _ref8.vertical;
66
+ })(["display:flex;gap:0.75rem;", ";"], ({
67
+ vertical
68
+ }) => {
60
69
  return vertical ? 'width: 100%' : '';
61
70
  });
62
- var StyledPrimaryButton = styled(Button).withConfig({
71
+ const StyledPrimaryButton = styled(Button).withConfig({
63
72
  componentId: "sc-6qfyxj-6"
64
73
  })(["background-color:", ";border-color:", ";"], base.color.primary6, base.color.primary6);
65
- var QuestionBox = function QuestionBox(_a) {
66
- var children = _a.children,
67
- _a$footerActions = _a.footerActions,
68
- footerActions = _a$footerActions === void 0 ? [] : _a$footerActions,
69
- title = _a.title,
70
- titlePrefix = _a.titlePrefix,
71
- submitResult = _a.submitResult;
72
- _a.submitStatus;
73
- var onNext = _a.onNext,
74
- isNextActive = _a.isNextActive,
75
- bodyContainerRef = _a.bodyContainerRef,
74
+ const QuestionBox = _a => {
75
+ var {
76
+ children,
77
+ footerActions = [],
78
+ title,
79
+ titlePrefix,
80
+ submitResult,
81
+ submitStatus,
82
+ onNext,
83
+ isNextActive,
84
+ bodyContainerRef
85
+ } = _a,
76
86
  props = __rest(_a, ["children", "footerActions", "title", "titlePrefix", "submitResult", "submitStatus", "onNext", "isNextActive", "bodyContainerRef"]);
77
- var theme = useTheme();
78
- var intl = useRawEliceIntl();
79
- var _useMaterialQuizState = useMaterialQuizState(),
80
- vertical = _useMaterialQuizState.vertical,
81
- isLongPassage = _useMaterialQuizState.isLongPassage;
82
- var intersectionRef = React.useRef(null);
83
- var headerRef = React.useRef(null);
84
- var bodyRef = React.useRef(null);
85
- var currentBodyRef = mergeRefs(bodyContainerRef, bodyRef);
86
- var hasFooter = footerActions.length > 0;
87
- var visibleAnchorSection = vertical && isLongPassage;
88
- var intersection = useIntersection(intersectionRef, {
87
+ const theme = useTheme();
88
+ const intl = useRawEliceIntl();
89
+ const {
90
+ vertical,
91
+ isLongPassage
92
+ } = useMaterialQuizState();
93
+ const intersectionRef = React.useRef(null);
94
+ const headerRef = React.useRef(null);
95
+ const bodyRef = React.useRef(null);
96
+ const currentBodyRef = mergeRefs(bodyContainerRef, bodyRef);
97
+ const hasFooter = footerActions.length > 0;
98
+ const visibleAnchorSection = vertical && isLongPassage;
99
+ const intersection = useIntersection(intersectionRef, {
89
100
  root: null,
90
101
  rootMargin: '0px',
91
102
  threshold: 0.1
92
103
  });
93
- var isViewingAnswerContainer = Boolean(intersection === null || intersection === void 0 ? void 0 : intersection.isIntersecting);
94
- useEffect(function () {
95
- var answerContainer = document.getElementById(MATERIAL_QUIZ_ANSWER_ID);
104
+ const isViewingAnswerContainer = Boolean(intersection === null || intersection === void 0 ? void 0 : intersection.isIntersecting);
105
+ useEffect(() => {
106
+ const answerContainer = document.getElementById(MATERIAL_QUIZ_ANSWER_ID);
96
107
  // only enable for vertical mode
97
108
  if (answerContainer && vertical) intersectionRef.current = answerContainer;
98
109
  }, [intersectionRef, vertical]);
99
- var scrollToElement = /*#__PURE__*/function () {
100
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(elementId) {
101
- var _a, _b, target;
102
- return _regeneratorRuntime().wrap(function _callee$(_context) {
103
- while (1) switch (_context.prev = _context.next) {
104
- case 0:
105
- target = document.getElementById(elementId);
106
- if (!(target && bodyRef.current)) {
107
- _context.next = 4;
108
- break;
109
- }
110
- _context.next = 4;
111
- return animateScrollTo(target.offsetTop, {
112
- elementToScroll: bodyRef.current,
113
- verticalOffset: -((_b = (_a = headerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0),
114
- easing: easeInOutCubic,
115
- minDuration: 50,
116
- speed: 200
117
- });
118
- case 4:
119
- case "end":
120
- return _context.stop();
121
- }
122
- }, _callee);
123
- }));
124
- return function scrollToElement(_x) {
125
- return _ref9.apply(this, arguments);
126
- };
127
- }();
128
- var header = title ? jsxs(StyledQuestionBoxHeader, {
110
+ const scrollToElement = async elementId => {
111
+ var _a, _b;
112
+ const target = document.getElementById(elementId);
113
+ if (target && bodyRef.current) {
114
+ await animateScrollTo(target.offsetTop, {
115
+ elementToScroll: bodyRef.current,
116
+ verticalOffset: -((_b = (_a = headerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0),
117
+ easing: easeInOutCubic,
118
+ minDuration: 50,
119
+ speed: 200
120
+ });
121
+ }
122
+ };
123
+ const header = title ? React.createElement(StyledQuestionBoxHeader, {
129
124
  vertical: vertical,
130
- ref: headerRef,
131
- children: [jsxs(Flex, {
132
- children: [titlePrefix ? jsx(Text, {
133
- bold: true,
134
- size: "large",
135
- customStyles: {
136
- color: base.color.primary3,
137
- marginRight: '0.5rem'
138
- },
139
- children: titlePrefix
140
- }) : null, jsx(Text, {
141
- bold: true,
142
- role: "navy0",
143
- size: "large",
144
- wordBreak: "break-word",
145
- children: title
146
- })]
147
- }), submitResult ? jsx(Box, {
148
- children: submitResult
149
- }) : null]
150
- }) : null;
151
- var body = jsx(StyledQuestionBoxBody, {
125
+ ref: headerRef
126
+ }, React.createElement(Flex, null, titlePrefix ? React.createElement(Text, {
127
+ bold: true,
128
+ size: "large",
129
+ customStyles: {
130
+ color: base.color.primary3,
131
+ marginRight: '0.5rem'
132
+ }
133
+ }, titlePrefix) : null, React.createElement(Text, {
134
+ bold: true,
135
+ role: "navy0",
136
+ size: "large",
137
+ wordBreak: "break-word"
138
+ }, title)), submitResult ? React.createElement(Box, null, submitResult) : null) : null;
139
+ const body = React.createElement(StyledQuestionBoxBody, {
152
140
  ref: !vertical ? currentBodyRef : undefined,
153
141
  hasFooter: hasFooter,
154
- vertical: vertical,
155
- children: children
156
- });
157
- var footer = jsx(StyledQuestionBoxFooter, {
158
- vertical: vertical,
159
- children: jsxs(StyledQuestionBoxFooterActions, {
160
- vertical: vertical,
161
- children: [footerActions.map(function (action, index) {
162
- var Component = action.role === 'lightpurple' ? StyledPrimaryButton : Button;
163
- return jsx(Component, Object.assign({
164
- isFluid: vertical,
165
- size: "small"
166
- }, action, {
167
- children: action.children
168
- }), index);
169
- }), isNextActive ? jsx(StyledPrimaryButton, {
170
- isFluid: vertical,
171
- size: "small",
172
- border: false,
173
- tabIndex: 0,
174
- transparent: false,
175
- onClick: onNext,
176
- customStyles: {
177
- backgroundColor: theme.palette.primary.main,
178
- color: theme.palette.primary.contrastText
179
- },
180
- children: intl.formatMessage({
181
- id: 'materialQuiz.next'
182
- })
183
- }) : null]
184
- })
185
- });
186
- var _renderAnchorSection = function _renderAnchorSection() {
187
- var getCustomStyles = function getCustomStyles(active) {
188
- return {
189
- borderBottom: '3px solid currentColor',
190
- background: 'none',
191
- borderColor: active ? 'currentColor' : 'transparent',
192
- color: active ? theme.palette.primary.main : theme.palette.secondary.light
193
- };
194
- };
195
- return visibleAnchorSection && jsxs(StyledAnchorBox, {
196
- children: [jsx(Button, {
197
- size: "small",
198
- border: false,
199
- hasBorderRadius: false,
200
- tabIndex: 0,
201
- transparent: true,
202
- onClick: scrollToElement.bind(null, MATERIAL_QUIZ_PASSIVE_ID),
203
- customStyles: getCustomStyles(!isViewingAnswerContainer),
204
- children: intl.formatMessage({
205
- id: 'materialQuiz.anchorLabel.question'
206
- })
207
- }), jsx(Button, {
208
- size: "small",
209
- border: false,
210
- hasBorderRadius: false,
211
- tabIndex: 0,
212
- transparent: true,
213
- onClick: scrollToElement.bind(null, MATERIAL_QUIZ_ANSWER_ID),
214
- customStyles: getCustomStyles(isViewingAnswerContainer),
215
- children: intl.formatMessage({
216
- id: 'materialQuiz.anchorLabel.answer'
217
- })
218
- })]
142
+ vertical: vertical
143
+ }, children);
144
+ const footer = React.createElement(StyledQuestionBoxFooter, {
145
+ vertical: vertical
146
+ }, React.createElement(StyledQuestionBoxFooterActions, {
147
+ vertical: vertical
148
+ }, footerActions.map((action, index) => {
149
+ const Component = action.role === 'lightpurple' ? StyledPrimaryButton : Button;
150
+ return React.createElement(Component, Object.assign({
151
+ isFluid: vertical,
152
+ key: index,
153
+ size: "small"
154
+ }, action), action.children);
155
+ }), isNextActive ? React.createElement(StyledPrimaryButton, {
156
+ isFluid: vertical,
157
+ size: "small",
158
+ border: false,
159
+ tabIndex: 0,
160
+ transparent: false,
161
+ onClick: onNext,
162
+ customStyles: {
163
+ backgroundColor: theme.palette.primary.main,
164
+ color: theme.palette.primary.contrastText
165
+ }
166
+ }, intl.formatMessage({
167
+ id: 'materialQuiz.next'
168
+ })) : null));
169
+ const _renderAnchorSection = () => {
170
+ const getCustomStyles = active => ({
171
+ borderBottom: '3px solid currentColor',
172
+ background: 'none',
173
+ borderColor: active ? 'currentColor' : 'transparent',
174
+ color: active ? theme.palette.primary.main : theme.palette.secondary.light
219
175
  });
176
+ return visibleAnchorSection && React.createElement(StyledAnchorBox, null, React.createElement(Button, {
177
+ size: "small",
178
+ border: false,
179
+ hasBorderRadius: false,
180
+ tabIndex: 0,
181
+ transparent: true,
182
+ onClick: scrollToElement.bind(null, MATERIAL_QUIZ_PASSIVE_ID),
183
+ customStyles: getCustomStyles(!isViewingAnswerContainer)
184
+ }, intl.formatMessage({
185
+ id: 'materialQuiz.anchorLabel.question'
186
+ })), React.createElement(Button, {
187
+ size: "small",
188
+ border: false,
189
+ hasBorderRadius: false,
190
+ tabIndex: 0,
191
+ transparent: true,
192
+ onClick: scrollToElement.bind(null, MATERIAL_QUIZ_ANSWER_ID),
193
+ customStyles: getCustomStyles(isViewingAnswerContainer)
194
+ }, intl.formatMessage({
195
+ id: 'materialQuiz.anchorLabel.answer'
196
+ })));
220
197
  };
221
- var renderContent = function renderContent() {
222
- var content = jsxs(Fragment, {
223
- children: [body, footerActions.length > 0 ? footer : null]
224
- });
198
+ const renderContent = () => {
199
+ const content = React.createElement(React.Fragment, null, body, footerActions.length > 0 ? footer : null);
225
200
  if (vertical) {
226
- return jsx("div", {
201
+ return React.createElement("div", {
227
202
  ref: currentBodyRef,
228
203
  style: {
229
204
  height: '100%',
230
205
  overflow: 'auto'
231
- },
232
- children: content
233
- });
206
+ }
207
+ }, content);
234
208
  }
235
209
  return content;
236
210
  };
237
- return jsxs(StyledQuestionBox, Object.assign({}, props, {
238
- vertical: vertical,
239
- children: [header, renderContent(), _renderAnchorSection()]
240
- }));
211
+ return React.createElement(StyledQuestionBox, Object.assign({}, props, {
212
+ vertical: vertical
213
+ }), header, renderContent(), _renderAnchorSection());
241
214
  };
242
215
 
243
216
  export { StyledQuestionBox, QuestionBox as default };
@@ -1,16 +1,17 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import QuizDraggbleOption from './QuizDraggbleOption.js';
3
3
 
4
- var QuizDraggbleDroppedOption = function QuizDraggbleDroppedOption(_ref) {
5
- var id = _ref.id,
6
- content = _ref.content,
7
- _ref$disabled = _ref.disabled,
8
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
9
- role = _ref.role,
10
- indexOrder = _ref.indexOrder,
11
- isMarkdown = _ref.isMarkdown;
12
- return jsx(QuizDraggbleOption, {
4
+ const QuizDraggbleDroppedOption = ({
5
+ id,
6
+ content,
7
+ disabled = false,
8
+ role,
9
+ indexOrder,
10
+ isMarkdown
11
+ }) => {
12
+ return React.createElement(QuizDraggbleOption, {
13
13
  id: id,
14
+ key: id,
14
15
  content: content,
15
16
  className: "quiz-answer",
16
17
  disabled: disabled,
@@ -18,7 +19,7 @@ var QuizDraggbleDroppedOption = function QuizDraggbleDroppedOption(_ref) {
18
19
  indexOrder: indexOrder,
19
20
  clone: true,
20
21
  isMarkdown: isMarkdown
21
- }, id);
22
+ });
22
23
  };
23
24
 
24
25
  export { QuizDraggbleDroppedOption as default };
@@ -1,31 +1,28 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import React from 'react';
2
2
  import { Text } from '@elice/blocks';
3
3
  import { base } from '@elice/design-tokens';
4
4
  import styled from 'styled-components';
5
5
  import EbDroppable from '../eb-sortable/EbDroppable.js';
6
6
 
7
- var StyledQuizDraggbleDummyOption = styled(EbDroppable).withConfig({
7
+ const StyledQuizDraggbleDummyOption = styled(EbDroppable).withConfig({
8
8
  componentId: "sc-1ayp8c1-0"
9
9
  })(["display:flex;justify-content:space-between;align-items:center;border:1px dashed ", ";border-radius:8px;overflow:hidden;background-color:", ";padding:0.875rem 1rem;color:", ";font-size:0.875rem;&:not(:last-of-type){margin-bottom:1rem;}&.ui-droppable-hover{outline:1px dashed ", ";}"], base.color.navy4, base.color.navy5, base.color.navy0, base.color.navy0);
10
- var StyledOrder = styled.div.withConfig({
10
+ const StyledOrder = styled.div.withConfig({
11
11
  componentId: "sc-1ayp8c1-1"
12
12
  })(["width:1.5rem;height:1.5rem;display:flex;border-radius:4px;align-items:center;justify-content:center;color:", ";background-color:", ";flex:none;margin-left:0.5rem;"], base.color.navy0, base.color.navy4);
13
- var QuizDraggbleDummyOption = function QuizDraggbleDummyOption(_ref) {
14
- var children = _ref.children,
15
- indexOrder = _ref.indexOrder,
16
- onDrop = _ref.onDrop;
17
- return jsxs(StyledQuizDraggbleDummyOption, {
18
- onDrop: onDrop,
19
- children: [jsx(Text, {
20
- wordBreak: "break-all",
21
- customStyles: {
22
- color: base.color.navy0
23
- },
24
- children: children !== null && children !== void 0 ? children : 'drag here...'
25
- }), jsx(StyledOrder, {
26
- children: indexOrder
27
- })]
28
- });
13
+ const QuizDraggbleDummyOption = ({
14
+ children,
15
+ indexOrder,
16
+ onDrop
17
+ }) => {
18
+ return React.createElement(StyledQuizDraggbleDummyOption, {
19
+ onDrop: onDrop
20
+ }, React.createElement(Text, {
21
+ wordBreak: "break-all",
22
+ customStyles: {
23
+ color: base.color.navy0
24
+ }
25
+ }, children !== null && children !== void 0 ? children : 'drag here...'), React.createElement(StyledOrder, null, indexOrder));
29
26
  };
30
27
 
31
28
  export { QuizDraggbleDummyOption as default };