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