@elice/material-survey 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 (67) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +399 -0
  2. package/cjs/components/markdown-editor/index.d.ts +1 -2
  3. package/cjs/components/markdown-editor/index.js +19 -10
  4. package/cjs/components/material-survey/MaterialSurvey.js +82 -57
  5. package/cjs/components/material-survey/MaterialSurveyInfo.js +69 -59
  6. package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +131 -90
  7. package/cjs/components/material-survey/MaterialSurveySelectOne.js +125 -86
  8. package/cjs/components/material-survey/MaterialSurveyShimmer.js +47 -40
  9. package/cjs/components/material-survey/MaterialSurveyText.js +114 -75
  10. package/cjs/components/material-survey/SurveyResultBadge.js +17 -10
  11. package/cjs/components/material-survey/SurveySubmitStatusText.js +21 -16
  12. package/cjs/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
  13. package/cjs/components/material-survey/context/MaterialSurveyContext.js +115 -74
  14. package/cjs/components/material-survey/index.js +9 -0
  15. package/cjs/components/material-survey/locales/index.js +13 -0
  16. package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +49 -36
  17. package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +113 -91
  18. package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +100 -87
  19. package/cjs/components/material-survey-edit/context.js +8 -2
  20. package/cjs/components/material-survey-edit/index.js +7 -0
  21. package/cjs/components/material-survey-edit/locales/index.js +13 -0
  22. package/cjs/components/material-survey-edit/utils/editValue.js +17 -11
  23. package/cjs/components/shared/StyledMarkdown.js +5 -1
  24. package/cjs/components/shared/SurveyContentBox.js +85 -74
  25. package/cjs/components/shared/index.js +13 -0
  26. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
  27. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  28. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
  29. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +66 -89
  30. package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
  31. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  32. package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
  33. package/cjs/components/shared/question-radio/QuestionRadioOption.js +59 -80
  34. package/es/_virtual/_rollupPluginBabelHelpers.js +386 -0
  35. package/es/components/markdown-editor/index.d.ts +1 -2
  36. package/es/components/markdown-editor/index.js +15 -10
  37. package/es/components/material-survey/MaterialSurvey.js +77 -57
  38. package/es/components/material-survey/MaterialSurveyInfo.js +65 -59
  39. package/es/components/material-survey/MaterialSurveySelectMultiple.js +127 -90
  40. package/es/components/material-survey/MaterialSurveySelectOne.js +121 -86
  41. package/es/components/material-survey/MaterialSurveyShimmer.js +43 -40
  42. package/es/components/material-survey/MaterialSurveyText.js +109 -75
  43. package/es/components/material-survey/SurveyResultBadge.js +13 -10
  44. package/es/components/material-survey/SurveySubmitStatusText.js +17 -16
  45. package/es/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
  46. package/es/components/material-survey/context/MaterialSurveyContext.js +112 -75
  47. package/es/components/material-survey/index.js +2 -0
  48. package/es/components/material-survey/locales/index.js +4 -0
  49. package/es/components/material-survey-edit/MaterialSurveyEdit.js +45 -36
  50. package/es/components/material-survey-edit/MaterialSurveyEditContent.js +107 -90
  51. package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +96 -87
  52. package/es/components/material-survey-edit/context.js +4 -2
  53. package/es/components/material-survey-edit/index.js +1 -0
  54. package/es/components/material-survey-edit/locales/index.js +4 -0
  55. package/es/components/material-survey-edit/utils/editValue.js +17 -11
  56. package/es/components/shared/StyledMarkdown.js +1 -1
  57. package/es/components/shared/SurveyContentBox.js +81 -74
  58. package/es/components/shared/index.js +4 -0
  59. package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
  60. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  61. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
  62. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +61 -89
  63. package/es/components/shared/question-radio/QuestionRadio.js +9 -7
  64. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  65. package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
  66. package/es/components/shared/question-radio/QuestionRadioOption.js +54 -80
  67. package/package.json +9 -12
@@ -2,17 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var jsxRuntime = require('react/jsx-runtime');
5
6
  var React = require('react');
6
7
  var designTokens = require('@elice/design-tokens');
7
8
  var styled = require('styled-components');
8
9
  var QuestionRadioContext = require('./QuestionRadioContext.js');
9
10
 
10
- const StyledQuestionRadioOption = styled.div.withConfig({
11
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
12
+
13
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
14
+ var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
15
+
16
+ var StyledQuestionRadioOption = styled__default.default.div.withConfig({
11
17
  componentId: "sc-zgbv8k-0"
12
- })(["display:flex;align-items:center;padding:1.125rem;border-radius:8px;background-color:", ";&:not(:last-of-type){margin-bottom:1rem;}&:hover,& *:hover{cursor:", ";}", ""], ({
13
- checked,
14
- status
15
- }) => {
18
+ })(["display:flex;align-items:center;padding:1.125rem;border-radius:8px;background-color:", ";&:not(:last-of-type){margin-bottom:1rem;}&:hover,& *:hover{cursor:", ";}", ""], function (_ref) {
19
+ var checked = _ref.checked,
20
+ status = _ref.status;
16
21
  if (checked) {
17
22
  return designTokens.base.color.primary1;
18
23
  }
@@ -24,17 +29,18 @@ const StyledQuestionRadioOption = styled.div.withConfig({
24
29
  default:
25
30
  return designTokens.base.color.navy5;
26
31
  }
27
- }, ({
28
- disabled
29
- }) => disabled ? 'not-allowed' : 'pointer', ({
30
- isAnswer
31
- }) => isAnswer ? `border: 3px solid ${designTokens.base.color.green5}` : '');
32
- const StyledQuestionRadioInput = styled.input.withConfig({
32
+ }, function (_ref2) {
33
+ var disabled = _ref2.disabled;
34
+ return disabled ? 'not-allowed' : 'pointer';
35
+ }, function (_ref3) {
36
+ var isAnswer = _ref3.isAnswer;
37
+ return isAnswer ? "border: 3px solid ".concat(designTokens.base.color.green5) : '';
38
+ });
39
+ var StyledQuestionRadioInput = styled__default.default.input.withConfig({
33
40
  componentId: "sc-zgbv8k-1"
34
- })(["flex:none;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;border-radius:50%;width:1.25rem;height:1.25rem;margin-right:0.875rem;border:2px solid ", ";", ""], ({
35
- checked,
36
- status
37
- }) => {
41
+ })(["flex:none;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;position:relative;border-radius:50%;width:1.25rem;height:1.25rem;margin-right:0.875rem;border:2px solid ", ";", ""], function (_ref4) {
42
+ var checked = _ref4.checked,
43
+ status = _ref4.status;
38
44
  if (checked) {
39
45
  return designTokens.base.color.primary6;
40
46
  }
@@ -46,27 +52,14 @@ const StyledQuestionRadioInput = styled.input.withConfig({
46
52
  default:
47
53
  return designTokens.base.color.gray3;
48
54
  }
49
- }, ({
50
- status,
51
- checked
52
- }) => {
55
+ }, function (_ref5) {
56
+ var status = _ref5.status,
57
+ checked = _ref5.checked;
53
58
  if (checked) {
54
- return `
55
- &:after {
56
- content: '';
57
- position: absolute;
58
- top: 50%;
59
- left: 50%;
60
- transform: translate(-50%, -50%);
61
- width: 70%;
62
- height: 70%;
63
- border-radius: 50%;
64
- background-color: ${designTokens.base.color.primary6};
65
- }
66
- `;
59
+ return "\n &:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 70%;\n height: 70%;\n border-radius: 50%;\n background-color: ".concat(designTokens.base.color.primary6, ";\n }\n ");
67
60
  }
68
61
  if (status) {
69
- let bgColor;
62
+ var bgColor;
70
63
  switch (status) {
71
64
  case 'correct':
72
65
  bgColor = designTokens.base.color.green9;
@@ -78,27 +71,14 @@ const StyledQuestionRadioInput = styled.input.withConfig({
78
71
  bgColor = designTokens.base.color.gray3;
79
72
  break;
80
73
  }
81
- return `
82
- &:after {
83
- content: '';
84
- position: absolute;
85
- top: 50%;
86
- left: 50%;
87
- transform: translate(-50%, -50%);
88
- width: 70%;
89
- height: 70%;
90
- border-radius: 50%;
91
- background-color: ${bgColor};
92
- }
93
- `;
74
+ return "\n &:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 70%;\n height: 70%;\n border-radius: 50%;\n background-color: ".concat(bgColor, ";\n }\n ");
94
75
  }
95
76
  });
96
- const StyledLabel = styled.label.withConfig({
77
+ var StyledLabel = styled__default.default.label.withConfig({
97
78
  componentId: "sc-zgbv8k-2"
98
- })(["word-break:break-all;margin-right:0.875rem;font-size:", ";color:", ";& p{color:", ";}"], designTokens.base.size.body3, ({
99
- checked,
100
- status
101
- }) => {
79
+ })(["word-break:break-all;margin-right:0.875rem;font-size:", ";color:", ";& p{color:", ";}"], designTokens.base.size.body3, function (_ref6) {
80
+ var checked = _ref6.checked,
81
+ status = _ref6.status;
102
82
  if (checked) {
103
83
  return designTokens.base.color.primary6;
104
84
  }
@@ -110,10 +90,9 @@ const StyledLabel = styled.label.withConfig({
110
90
  default:
111
91
  return designTokens.base.color.navy0;
112
92
  }
113
- }, ({
114
- checked,
115
- status
116
- }) => {
93
+ }, function (_ref7) {
94
+ var checked = _ref7.checked,
95
+ status = _ref7.status;
117
96
  if (checked) {
118
97
  return designTokens.base.color.primary6;
119
98
  }
@@ -126,40 +105,40 @@ const StyledLabel = styled.label.withConfig({
126
105
  return designTokens.base.color.navy0;
127
106
  }
128
107
  });
129
- const QuestionRadioOption = React.memo(({
130
- value,
131
- status,
132
- isAnswer,
133
- children
134
- }) => {
135
- const {
136
- selectedValue,
137
- disabled,
138
- onSelect
139
- } = QuestionRadioContext.useQuestionRadioContext();
140
- return React.createElement(StyledQuestionRadioOption, {
108
+ var QuestionRadioOption = React__default.default.memo(function (_ref8) {
109
+ var value = _ref8.value,
110
+ status = _ref8.status,
111
+ isAnswer = _ref8.isAnswer,
112
+ children = _ref8.children;
113
+ var _useQuestionRadioCont = QuestionRadioContext.useQuestionRadioContext(),
114
+ selectedValue = _useQuestionRadioCont.selectedValue,
115
+ disabled = _useQuestionRadioCont.disabled,
116
+ onSelect = _useQuestionRadioCont.onSelect;
117
+ return jsxRuntime.jsxs(StyledQuestionRadioOption, {
141
118
  isAnswer: isAnswer,
142
119
  disabled: disabled,
143
120
  checked: selectedValue === value,
144
- onClick: e => {
121
+ onClick: function onClick(e) {
145
122
  e.preventDefault();
146
123
  if (disabled) {
147
124
  return;
148
125
  }
149
126
  onSelect(value);
150
127
  },
151
- status: status
152
- }, React.createElement(StyledQuestionRadioInput, {
153
- id: value,
154
- type: "radio",
155
- readOnly: true,
156
- checked: selectedValue === value,
157
- status: status
158
- }), React.createElement(StyledLabel, {
159
- htmlFor: value,
160
- checked: selectedValue === value,
161
- status: status
162
- }, children));
128
+ status: status,
129
+ children: [jsxRuntime.jsx(StyledQuestionRadioInput, {
130
+ id: value,
131
+ type: "radio",
132
+ readOnly: true,
133
+ checked: selectedValue === value,
134
+ status: status
135
+ }), jsxRuntime.jsx(StyledLabel, {
136
+ htmlFor: value,
137
+ checked: selectedValue === value,
138
+ status: status,
139
+ children: children
140
+ })]
141
+ });
163
142
  });
164
143
 
165
144
  exports.default = QuestionRadioOption;
@@ -0,0 +1,386 @@
1
+ function _iterableToArrayLimit(arr, i) {
2
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
3
+ if (null != _i) {
4
+ var _s,
5
+ _e,
6
+ _x,
7
+ _r,
8
+ _arr = [],
9
+ _n = !0,
10
+ _d = !1;
11
+ try {
12
+ if (_x = (_i = _i.call(arr)).next, 0 === i) ; else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
13
+ } catch (err) {
14
+ _d = !0, _e = err;
15
+ } finally {
16
+ try {
17
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
18
+ } finally {
19
+ if (_d) throw _e;
20
+ }
21
+ }
22
+ return _arr;
23
+ }
24
+ }
25
+ function _regeneratorRuntime() {
26
+ _regeneratorRuntime = function () {
27
+ return exports;
28
+ };
29
+ var exports = {},
30
+ Op = Object.prototype,
31
+ hasOwn = Op.hasOwnProperty,
32
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
33
+ obj[key] = desc.value;
34
+ },
35
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
36
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
37
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
38
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
39
+ function define(obj, key, value) {
40
+ return Object.defineProperty(obj, key, {
41
+ value: value,
42
+ enumerable: !0,
43
+ configurable: !0,
44
+ writable: !0
45
+ }), obj[key];
46
+ }
47
+ try {
48
+ define({}, "");
49
+ } catch (err) {
50
+ define = function (obj, key, value) {
51
+ return obj[key] = value;
52
+ };
53
+ }
54
+ function wrap(innerFn, outerFn, self, tryLocsList) {
55
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
56
+ generator = Object.create(protoGenerator.prototype),
57
+ context = new Context(tryLocsList || []);
58
+ return defineProperty(generator, "_invoke", {
59
+ value: makeInvokeMethod(innerFn, self, context)
60
+ }), generator;
61
+ }
62
+ function tryCatch(fn, obj, arg) {
63
+ try {
64
+ return {
65
+ type: "normal",
66
+ arg: fn.call(obj, arg)
67
+ };
68
+ } catch (err) {
69
+ return {
70
+ type: "throw",
71
+ arg: err
72
+ };
73
+ }
74
+ }
75
+ exports.wrap = wrap;
76
+ var ContinueSentinel = {};
77
+ function Generator() {}
78
+ function GeneratorFunction() {}
79
+ function GeneratorFunctionPrototype() {}
80
+ var IteratorPrototype = {};
81
+ define(IteratorPrototype, iteratorSymbol, function () {
82
+ return this;
83
+ });
84
+ var getProto = Object.getPrototypeOf,
85
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
86
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
87
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
88
+ function defineIteratorMethods(prototype) {
89
+ ["next", "throw", "return"].forEach(function (method) {
90
+ define(prototype, method, function (arg) {
91
+ return this._invoke(method, arg);
92
+ });
93
+ });
94
+ }
95
+ function AsyncIterator(generator, PromiseImpl) {
96
+ function invoke(method, arg, resolve, reject) {
97
+ var record = tryCatch(generator[method], generator, arg);
98
+ if ("throw" !== record.type) {
99
+ var result = record.arg,
100
+ value = result.value;
101
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
102
+ invoke("next", value, resolve, reject);
103
+ }, function (err) {
104
+ invoke("throw", err, resolve, reject);
105
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
106
+ result.value = unwrapped, resolve(result);
107
+ }, function (error) {
108
+ return invoke("throw", error, resolve, reject);
109
+ });
110
+ }
111
+ reject(record.arg);
112
+ }
113
+ var previousPromise;
114
+ defineProperty(this, "_invoke", {
115
+ value: function (method, arg) {
116
+ function callInvokeWithMethodAndArg() {
117
+ return new PromiseImpl(function (resolve, reject) {
118
+ invoke(method, arg, resolve, reject);
119
+ });
120
+ }
121
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
122
+ }
123
+ });
124
+ }
125
+ function makeInvokeMethod(innerFn, self, context) {
126
+ var state = "suspendedStart";
127
+ return function (method, arg) {
128
+ if ("executing" === state) throw new Error("Generator is already running");
129
+ if ("completed" === state) {
130
+ if ("throw" === method) throw arg;
131
+ return {
132
+ value: void 0,
133
+ done: !0
134
+ };
135
+ }
136
+ for (context.method = method, context.arg = arg;;) {
137
+ var delegate = context.delegate;
138
+ if (delegate) {
139
+ var delegateResult = maybeInvokeDelegate(delegate, context);
140
+ if (delegateResult) {
141
+ if (delegateResult === ContinueSentinel) continue;
142
+ return delegateResult;
143
+ }
144
+ }
145
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
146
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
147
+ context.dispatchException(context.arg);
148
+ } else "return" === context.method && context.abrupt("return", context.arg);
149
+ state = "executing";
150
+ var record = tryCatch(innerFn, self, context);
151
+ if ("normal" === record.type) {
152
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
153
+ return {
154
+ value: record.arg,
155
+ done: context.done
156
+ };
157
+ }
158
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
159
+ }
160
+ };
161
+ }
162
+ function maybeInvokeDelegate(delegate, context) {
163
+ var methodName = context.method,
164
+ method = delegate.iterator[methodName];
165
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
166
+ var record = tryCatch(method, delegate.iterator, context.arg);
167
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
168
+ var info = record.arg;
169
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
170
+ }
171
+ function pushTryEntry(locs) {
172
+ var entry = {
173
+ tryLoc: locs[0]
174
+ };
175
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
176
+ }
177
+ function resetTryEntry(entry) {
178
+ var record = entry.completion || {};
179
+ record.type = "normal", delete record.arg, entry.completion = record;
180
+ }
181
+ function Context(tryLocsList) {
182
+ this.tryEntries = [{
183
+ tryLoc: "root"
184
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
185
+ }
186
+ function values(iterable) {
187
+ if (iterable || "" === iterable) {
188
+ var iteratorMethod = iterable[iteratorSymbol];
189
+ if (iteratorMethod) return iteratorMethod.call(iterable);
190
+ if ("function" == typeof iterable.next) return iterable;
191
+ if (!isNaN(iterable.length)) {
192
+ var i = -1,
193
+ next = function next() {
194
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
195
+ return next.value = undefined, next.done = !0, next;
196
+ };
197
+ return next.next = next;
198
+ }
199
+ }
200
+ throw new TypeError(typeof iterable + " is not iterable");
201
+ }
202
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
203
+ value: GeneratorFunctionPrototype,
204
+ configurable: !0
205
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
206
+ value: GeneratorFunction,
207
+ configurable: !0
208
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
209
+ var ctor = "function" == typeof genFun && genFun.constructor;
210
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
211
+ }, exports.mark = function (genFun) {
212
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
213
+ }, exports.awrap = function (arg) {
214
+ return {
215
+ __await: arg
216
+ };
217
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
218
+ return this;
219
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
220
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
221
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
222
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
223
+ return result.done ? result.value : iter.next();
224
+ });
225
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
226
+ return this;
227
+ }), define(Gp, "toString", function () {
228
+ return "[object Generator]";
229
+ }), exports.keys = function (val) {
230
+ var object = Object(val),
231
+ keys = [];
232
+ for (var key in object) keys.push(key);
233
+ return keys.reverse(), function next() {
234
+ for (; keys.length;) {
235
+ var key = keys.pop();
236
+ if (key in object) return next.value = key, next.done = !1, next;
237
+ }
238
+ return next.done = !0, next;
239
+ };
240
+ }, exports.values = values, Context.prototype = {
241
+ constructor: Context,
242
+ reset: function (skipTempReset) {
243
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
244
+ },
245
+ stop: function () {
246
+ this.done = !0;
247
+ var rootRecord = this.tryEntries[0].completion;
248
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
249
+ return this.rval;
250
+ },
251
+ dispatchException: function (exception) {
252
+ if (this.done) throw exception;
253
+ var context = this;
254
+ function handle(loc, caught) {
255
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
256
+ }
257
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
258
+ var entry = this.tryEntries[i],
259
+ record = entry.completion;
260
+ if ("root" === entry.tryLoc) return handle("end");
261
+ if (entry.tryLoc <= this.prev) {
262
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
263
+ hasFinally = hasOwn.call(entry, "finallyLoc");
264
+ if (hasCatch && hasFinally) {
265
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
266
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
267
+ } else if (hasCatch) {
268
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
269
+ } else {
270
+ if (!hasFinally) throw new Error("try statement without catch or finally");
271
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
272
+ }
273
+ }
274
+ }
275
+ },
276
+ abrupt: function (type, arg) {
277
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
278
+ var entry = this.tryEntries[i];
279
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
280
+ var finallyEntry = entry;
281
+ break;
282
+ }
283
+ }
284
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
285
+ var record = finallyEntry ? finallyEntry.completion : {};
286
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
287
+ },
288
+ complete: function (record, afterLoc) {
289
+ if ("throw" === record.type) throw record.arg;
290
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
291
+ },
292
+ finish: function (finallyLoc) {
293
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
294
+ var entry = this.tryEntries[i];
295
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
296
+ }
297
+ },
298
+ catch: function (tryLoc) {
299
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
300
+ var entry = this.tryEntries[i];
301
+ if (entry.tryLoc === tryLoc) {
302
+ var record = entry.completion;
303
+ if ("throw" === record.type) {
304
+ var thrown = record.arg;
305
+ resetTryEntry(entry);
306
+ }
307
+ return thrown;
308
+ }
309
+ }
310
+ throw new Error("illegal catch attempt");
311
+ },
312
+ delegateYield: function (iterable, resultName, nextLoc) {
313
+ return this.delegate = {
314
+ iterator: values(iterable),
315
+ resultName: resultName,
316
+ nextLoc: nextLoc
317
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
318
+ }
319
+ }, exports;
320
+ }
321
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
322
+ try {
323
+ var info = gen[key](arg);
324
+ var value = info.value;
325
+ } catch (error) {
326
+ reject(error);
327
+ return;
328
+ }
329
+ if (info.done) {
330
+ resolve(value);
331
+ } else {
332
+ Promise.resolve(value).then(_next, _throw);
333
+ }
334
+ }
335
+ function _asyncToGenerator(fn) {
336
+ return function () {
337
+ var self = this,
338
+ args = arguments;
339
+ return new Promise(function (resolve, reject) {
340
+ var gen = fn.apply(self, args);
341
+ function _next(value) {
342
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
343
+ }
344
+ function _throw(err) {
345
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
346
+ }
347
+ _next(undefined);
348
+ });
349
+ };
350
+ }
351
+ function _slicedToArray(arr, i) {
352
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
353
+ }
354
+ function _toConsumableArray(arr) {
355
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
356
+ }
357
+ function _arrayWithoutHoles(arr) {
358
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
359
+ }
360
+ function _arrayWithHoles(arr) {
361
+ if (Array.isArray(arr)) return arr;
362
+ }
363
+ function _iterableToArray(iter) {
364
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
365
+ }
366
+ function _unsupportedIterableToArray(o, minLen) {
367
+ if (!o) return;
368
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
369
+ var n = Object.prototype.toString.call(o).slice(8, -1);
370
+ if (n === "Object" && o.constructor) n = o.constructor.name;
371
+ if (n === "Map" || n === "Set") return Array.from(o);
372
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
373
+ }
374
+ function _arrayLikeToArray(arr, len) {
375
+ if (len == null || len > arr.length) len = arr.length;
376
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
377
+ return arr2;
378
+ }
379
+ function _nonIterableSpread() {
380
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
381
+ }
382
+ function _nonIterableRest() {
383
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
384
+ }
385
+
386
+ export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _regeneratorRuntime as regeneratorRuntime, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _unsupportedIterableToArray as unsupportedIterableToArray };
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
1
  import type { EliceWysiwygEditorProps } from '@elice/wysiwyg';
3
- export declare const MarkdownEditor: ({ value, onChange, ...props }: EliceWysiwygEditorProps) => React.JSX.Element;
2
+ export declare const MarkdownEditor: ({ value, onChange, ...props }: EliceWysiwygEditorProps) => JSX.Element;
@@ -1,23 +1,28 @@
1
+ import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
2
  import { __rest } from 'tslib';
3
+ import { jsx } from 'react/jsx-runtime';
2
4
  import React from 'react';
3
5
  import { useDebounce } from 'react-use';
4
6
  import { EliceWysiwygEditor } from '@elice/wysiwyg';
5
7
 
6
- const STATE_SYNC_DEBOUNCE_TIME = 50;
7
- const MarkdownEditor = _a => {
8
- var {
9
- value,
10
- onChange
11
- } = _a,
8
+ var STATE_SYNC_DEBOUNCE_TIME = 50;
9
+ var MarkdownEditor = function MarkdownEditor(_a) {
10
+ var value = _a.value,
11
+ onChange = _a.onChange,
12
12
  props = __rest(_a, ["value", "onChange"]);
13
- const [__value, __setValue] = React.useState(value);
14
- useDebounce(() => __setValue(value), STATE_SYNC_DEBOUNCE_TIME, [value]);
15
- useDebounce(() => {
13
+ var _React$useState = React.useState(value),
14
+ _React$useState2 = _slicedToArray(_React$useState, 2),
15
+ __value = _React$useState2[0],
16
+ __setValue = _React$useState2[1];
17
+ useDebounce(function () {
18
+ return __setValue(value);
19
+ }, STATE_SYNC_DEBOUNCE_TIME, [value]);
20
+ useDebounce(function () {
16
21
  if (__value !== value && typeof onChange === 'function') {
17
22
  onChange(__value !== null && __value !== void 0 ? __value : '');
18
23
  }
19
24
  }, STATE_SYNC_DEBOUNCE_TIME, [__value]);
20
- return React.createElement(EliceWysiwygEditor, Object.assign({
25
+ return jsx(EliceWysiwygEditor, Object.assign({
21
26
  value: value,
22
27
  onChange: __setValue
23
28
  }, props));