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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +423 -0
  2. package/cjs/components/eb-sortable/EbDraggable.js +42 -33
  3. package/cjs/components/eb-sortable/EbDroppable.js +27 -20
  4. package/cjs/components/markdown-editor/index.d.ts +1 -2
  5. package/cjs/components/markdown-editor/index.js +19 -10
  6. package/cjs/components/material-quiz/MaterialQuiz.js +114 -83
  7. package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +36 -29
  8. package/cjs/components/material-quiz/MaterialQuizInfo.js +151 -149
  9. package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +175 -127
  10. package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +360 -286
  11. package/cjs/components/material-quiz/MaterialQuizSelectOne.js +172 -126
  12. package/cjs/components/material-quiz/MaterialQuizShimmer.js +46 -39
  13. package/cjs/components/material-quiz/MaterialQuizText.js +163 -115
  14. package/cjs/components/material-quiz/QuizResultBadge.js +32 -22
  15. package/cjs/components/material-quiz/QuizSubmitStatusText.js +21 -16
  16. package/cjs/components/material-quiz/constants/color.js +5 -5
  17. package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  18. package/cjs/components/material-quiz/context/MaterialQuizContext.js +156 -93
  19. package/cjs/components/material-quiz/index.js +9 -0
  20. package/cjs/components/material-quiz/locales/index.js +13 -0
  21. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +259 -161
  22. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +134 -100
  23. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +130 -101
  24. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +64 -52
  25. package/cjs/components/material-quiz/material-quiz-group/context/context.js +5 -1
  26. package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +47 -36
  27. package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +280 -232
  28. package/cjs/components/material-quiz-edit/context.js +8 -2
  29. package/cjs/components/material-quiz-edit/index.js +7 -0
  30. package/cjs/components/material-quiz-edit/locales/index.js +13 -0
  31. package/cjs/components/material-quiz-edit/options/OptionEditor.js +70 -46
  32. package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +174 -148
  33. package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +175 -149
  34. package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +164 -144
  35. package/cjs/components/material-quiz-edit/options/OptionText.js +90 -82
  36. package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
  37. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +156 -112
  38. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +288 -196
  39. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +88 -75
  40. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +108 -92
  41. package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
  42. package/cjs/components/material-quiz-edit/utils/editValue.js +21 -12
  43. package/cjs/components/shared/QuestionBox.js +198 -165
  44. package/cjs/components/shared/QuizDraggbleDroppedOption.js +11 -12
  45. package/cjs/components/shared/QuizDraggbleDummyOption.js +23 -16
  46. package/cjs/components/shared/QuizDraggbleOption.js +65 -59
  47. package/cjs/components/shared/StyledMarkdown.js +5 -1
  48. package/cjs/components/shared/index.js +19 -0
  49. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
  50. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  51. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
  52. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +59 -68
  53. package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
  54. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  55. package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
  56. package/cjs/components/shared/question-radio/QuestionRadioOption.js +52 -59
  57. package/cjs/components/shared/utils/getQuestionStatusStyle.js +7 -9
  58. package/cjs/components/shared/utils/mergeRefs.js +15 -6
  59. package/cjs/constant/element.js +3 -3
  60. package/cjs/constant/index.js +9 -0
  61. package/cjs/helpers/index.js +8 -10
  62. package/cjs/hooks/index.js +7 -0
  63. package/cjs/hooks/useCaculatePassage.js +21 -20
  64. package/es/_virtual/_rollupPluginBabelHelpers.js +408 -0
  65. package/es/components/eb-sortable/EbDraggable.js +37 -33
  66. package/es/components/eb-sortable/EbDroppable.js +22 -20
  67. package/es/components/markdown-editor/index.d.ts +1 -2
  68. package/es/components/markdown-editor/index.js +15 -10
  69. package/es/components/material-quiz/MaterialQuiz.js +109 -83
  70. package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +32 -29
  71. package/es/components/material-quiz/MaterialQuizInfo.js +148 -150
  72. package/es/components/material-quiz/MaterialQuizSelectMultiple.js +171 -127
  73. package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +356 -287
  74. package/es/components/material-quiz/MaterialQuizSelectOne.js +168 -126
  75. package/es/components/material-quiz/MaterialQuizShimmer.js +42 -39
  76. package/es/components/material-quiz/MaterialQuizText.js +158 -115
  77. package/es/components/material-quiz/QuizResultBadge.js +27 -22
  78. package/es/components/material-quiz/QuizSubmitStatusText.js +17 -16
  79. package/es/components/material-quiz/constants/color.js +5 -5
  80. package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  81. package/es/components/material-quiz/context/MaterialQuizContext.js +153 -94
  82. package/es/components/material-quiz/index.js +2 -0
  83. package/es/components/material-quiz/locales/index.js +4 -0
  84. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +253 -161
  85. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +129 -100
  86. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +125 -101
  87. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +60 -52
  88. package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
  89. package/es/components/material-quiz-edit/MaterialQuizEdit.js +43 -36
  90. package/es/components/material-quiz-edit/MaterialQuizEditContent.js +272 -229
  91. package/es/components/material-quiz-edit/context.js +4 -2
  92. package/es/components/material-quiz-edit/index.js +1 -0
  93. package/es/components/material-quiz-edit/locales/index.js +4 -0
  94. package/es/components/material-quiz-edit/options/OptionEditor.js +64 -46
  95. package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +170 -148
  96. package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +171 -149
  97. package/es/components/material-quiz-edit/options/OptionSelectOne.js +159 -144
  98. package/es/components/material-quiz-edit/options/OptionText.js +86 -82
  99. package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
  100. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +151 -112
  101. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +283 -197
  102. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +83 -75
  103. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +103 -92
  104. package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
  105. package/es/components/material-quiz-edit/utils/editValue.js +17 -12
  106. package/es/components/shared/QuestionBox.js +192 -165
  107. package/es/components/shared/QuizDraggbleDroppedOption.js +11 -12
  108. package/es/components/shared/QuizDraggbleDummyOption.js +19 -16
  109. package/es/components/shared/QuizDraggbleOption.js +61 -59
  110. package/es/components/shared/StyledMarkdown.js +1 -1
  111. package/es/components/shared/index.js +7 -0
  112. package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
  113. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  114. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
  115. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +54 -68
  116. package/es/components/shared/question-radio/QuestionRadio.js +9 -7
  117. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  118. package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
  119. package/es/components/shared/question-radio/QuestionRadioOption.js +47 -59
  120. package/es/components/shared/utils/getQuestionStatusStyle.js +7 -9
  121. package/es/components/shared/utils/mergeRefs.js +15 -6
  122. package/es/constant/element.js +3 -3
  123. package/es/constant/index.js +1 -0
  124. package/es/helpers/index.js +8 -10
  125. package/es/hooks/index.js +1 -0
  126. package/es/hooks/useCaculatePassage.js +21 -20
  127. package/package.json +12 -15
@@ -2,7 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
5
6
  var tslib = require('tslib');
7
+ var jsxRuntime = require('react/jsx-runtime');
6
8
  var React = require('react');
7
9
  var reactUse = require('react-use');
8
10
  var blocks = require('@elice/blocks');
@@ -15,206 +17,237 @@ var element = require('../../constant/element.js');
15
17
  var MaterialQuizContext = require('../material-quiz/context/MaterialQuizContext.js');
16
18
  var mergeRefs = require('./utils/mergeRefs.js');
17
19
 
18
- const easeInOutCubic = t => {
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) {
19
27
  return t < 0.5 ? 4 * Math.pow(t, 3) : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
20
28
  };
21
- const StyledQuestionBox = styled.div.withConfig({
29
+ var StyledQuestionBox = styled__default.default.div.withConfig({
22
30
  componentId: "sc-6qfyxj-0"
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({
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({
34
42
  componentId: "sc-6qfyxj-1"
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({
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({
46
51
  componentId: "sc-6qfyxj-2"
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({
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({
52
58
  componentId: "sc-6qfyxj-3"
53
59
  })(["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);
54
- const StyledQuestionBoxFooter = styled.div.withConfig({
60
+ var StyledQuestionBoxFooter = styled__default.default.div.withConfig({
55
61
  componentId: "sc-6qfyxj-4"
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
- `;
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 ");
67
65
  });
68
- const StyledQuestionBoxFooterActions = styled.div.withConfig({
66
+ var StyledQuestionBoxFooterActions = styled__default.default.div.withConfig({
69
67
  componentId: "sc-6qfyxj-5"
70
- })(["display:flex;gap:0.75rem;", ";"], ({
71
- vertical
72
- }) => {
68
+ })(["display:flex;gap:0.75rem;", ";"], function (_ref8) {
69
+ var vertical = _ref8.vertical;
73
70
  return vertical ? 'width: 100%' : '';
74
71
  });
75
- const StyledPrimaryButton = styled(blocks.Button).withConfig({
72
+ var StyledPrimaryButton = styled__default.default(blocks.Button).withConfig({
76
73
  componentId: "sc-6qfyxj-6"
77
74
  })(["background-color:", ";border-color:", ";"], designTokens.base.color.primary6, designTokens.base.color.primary6);
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,
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,
90
86
  props = tslib.__rest(_a, ["children", "footerActions", "title", "titlePrefix", "submitResult", "submitStatus", "onNext", "isNextActive", "bodyContainerRef"]);
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, {
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, {
104
99
  root: null,
105
100
  rootMargin: '0px',
106
101
  threshold: 0.1
107
102
  });
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);
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);
111
106
  // only enable for vertical mode
112
107
  if (answerContainer && vertical) intersectionRef.current = answerContainer;
113
108
  }, [intersectionRef, vertical]);
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, {
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, {
128
139
  vertical: vertical,
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, {
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, {
144
162
  ref: !vertical ? currentBodyRef : undefined,
145
163
  hasFooter: hasFooter,
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
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
+ })]
179
229
  });
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
- })));
201
230
  };
202
- const renderContent = () => {
203
- const content = React.createElement(React.Fragment, null, body, footerActions.length > 0 ? footer : null);
231
+ var renderContent = function renderContent() {
232
+ var content = jsxRuntime.jsxs(jsxRuntime.Fragment, {
233
+ children: [body, footerActions.length > 0 ? footer : null]
234
+ });
204
235
  if (vertical) {
205
- return React.createElement("div", {
236
+ return jsxRuntime.jsx("div", {
206
237
  ref: currentBodyRef,
207
238
  style: {
208
239
  height: '100%',
209
240
  overflow: 'auto'
210
- }
211
- }, content);
241
+ },
242
+ children: content
243
+ });
212
244
  }
213
245
  return content;
214
246
  };
215
- return React.createElement(StyledQuestionBox, Object.assign({}, props, {
216
- vertical: vertical
217
- }), header, renderContent(), _renderAnchorSection());
247
+ return jsxRuntime.jsxs(StyledQuestionBox, Object.assign({}, props, {
248
+ vertical: vertical,
249
+ children: [header, renderContent(), _renderAnchorSection()]
250
+ }));
218
251
  };
219
252
 
220
253
  exports.StyledQuestionBox = StyledQuestionBox;
@@ -2,20 +2,19 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
6
  var QuizDraggbleOption = require('./QuizDraggbleOption.js');
7
7
 
8
- const QuizDraggbleDroppedOption = ({
9
- id,
10
- content,
11
- disabled = false,
12
- role,
13
- indexOrder,
14
- isMarkdown
15
- }) => {
16
- return React.createElement(QuizDraggbleOption.default, {
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, {
17
17
  id: id,
18
- key: id,
19
18
  content: content,
20
19
  className: "quiz-answer",
21
20
  disabled: disabled,
@@ -23,7 +22,7 @@ const QuizDraggbleDroppedOption = ({
23
22
  indexOrder: indexOrder,
24
23
  clone: true,
25
24
  isMarkdown: isMarkdown
26
- });
25
+ }, id);
27
26
  };
28
27
 
29
28
  exports.default = QuizDraggbleDroppedOption;
@@ -2,31 +2,38 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var React = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
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
- const StyledQuizDraggbleDummyOption = styled(EbDroppable.default).withConfig({
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({
12
16
  componentId: "sc-1ayp8c1-0"
13
17
  })(["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);
14
- const StyledOrder = styled.div.withConfig({
18
+ var StyledOrder = styled__default.default.div.withConfig({
15
19
  componentId: "sc-1ayp8c1-1"
16
20
  })(["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);
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));
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
+ });
30
37
  };
31
38
 
32
39
  exports.default = QuizDraggbleDummyOption;