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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -0,0 +1,408 @@
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) {
13
+ if (Object(_i) !== _i) return;
14
+ _n = !1;
15
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
16
+ } catch (err) {
17
+ _d = !0, _e = err;
18
+ } finally {
19
+ try {
20
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
21
+ } finally {
22
+ if (_d) throw _e;
23
+ }
24
+ }
25
+ return _arr;
26
+ }
27
+ }
28
+ function _regeneratorRuntime() {
29
+ _regeneratorRuntime = function () {
30
+ return exports;
31
+ };
32
+ var exports = {},
33
+ Op = Object.prototype,
34
+ hasOwn = Op.hasOwnProperty,
35
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
36
+ obj[key] = desc.value;
37
+ },
38
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
39
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
40
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
41
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
42
+ function define(obj, key, value) {
43
+ return Object.defineProperty(obj, key, {
44
+ value: value,
45
+ enumerable: !0,
46
+ configurable: !0,
47
+ writable: !0
48
+ }), obj[key];
49
+ }
50
+ try {
51
+ define({}, "");
52
+ } catch (err) {
53
+ define = function (obj, key, value) {
54
+ return obj[key] = value;
55
+ };
56
+ }
57
+ function wrap(innerFn, outerFn, self, tryLocsList) {
58
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
59
+ generator = Object.create(protoGenerator.prototype),
60
+ context = new Context(tryLocsList || []);
61
+ return defineProperty(generator, "_invoke", {
62
+ value: makeInvokeMethod(innerFn, self, context)
63
+ }), generator;
64
+ }
65
+ function tryCatch(fn, obj, arg) {
66
+ try {
67
+ return {
68
+ type: "normal",
69
+ arg: fn.call(obj, arg)
70
+ };
71
+ } catch (err) {
72
+ return {
73
+ type: "throw",
74
+ arg: err
75
+ };
76
+ }
77
+ }
78
+ exports.wrap = wrap;
79
+ var ContinueSentinel = {};
80
+ function Generator() {}
81
+ function GeneratorFunction() {}
82
+ function GeneratorFunctionPrototype() {}
83
+ var IteratorPrototype = {};
84
+ define(IteratorPrototype, iteratorSymbol, function () {
85
+ return this;
86
+ });
87
+ var getProto = Object.getPrototypeOf,
88
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
89
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
90
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
91
+ function defineIteratorMethods(prototype) {
92
+ ["next", "throw", "return"].forEach(function (method) {
93
+ define(prototype, method, function (arg) {
94
+ return this._invoke(method, arg);
95
+ });
96
+ });
97
+ }
98
+ function AsyncIterator(generator, PromiseImpl) {
99
+ function invoke(method, arg, resolve, reject) {
100
+ var record = tryCatch(generator[method], generator, arg);
101
+ if ("throw" !== record.type) {
102
+ var result = record.arg,
103
+ value = result.value;
104
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
105
+ invoke("next", value, resolve, reject);
106
+ }, function (err) {
107
+ invoke("throw", err, resolve, reject);
108
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
109
+ result.value = unwrapped, resolve(result);
110
+ }, function (error) {
111
+ return invoke("throw", error, resolve, reject);
112
+ });
113
+ }
114
+ reject(record.arg);
115
+ }
116
+ var previousPromise;
117
+ defineProperty(this, "_invoke", {
118
+ value: function (method, arg) {
119
+ function callInvokeWithMethodAndArg() {
120
+ return new PromiseImpl(function (resolve, reject) {
121
+ invoke(method, arg, resolve, reject);
122
+ });
123
+ }
124
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
125
+ }
126
+ });
127
+ }
128
+ function makeInvokeMethod(innerFn, self, context) {
129
+ var state = "suspendedStart";
130
+ return function (method, arg) {
131
+ if ("executing" === state) throw new Error("Generator is already running");
132
+ if ("completed" === state) {
133
+ if ("throw" === method) throw arg;
134
+ return {
135
+ value: void 0,
136
+ done: !0
137
+ };
138
+ }
139
+ for (context.method = method, context.arg = arg;;) {
140
+ var delegate = context.delegate;
141
+ if (delegate) {
142
+ var delegateResult = maybeInvokeDelegate(delegate, context);
143
+ if (delegateResult) {
144
+ if (delegateResult === ContinueSentinel) continue;
145
+ return delegateResult;
146
+ }
147
+ }
148
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
149
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
150
+ context.dispatchException(context.arg);
151
+ } else "return" === context.method && context.abrupt("return", context.arg);
152
+ state = "executing";
153
+ var record = tryCatch(innerFn, self, context);
154
+ if ("normal" === record.type) {
155
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
156
+ return {
157
+ value: record.arg,
158
+ done: context.done
159
+ };
160
+ }
161
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
162
+ }
163
+ };
164
+ }
165
+ function maybeInvokeDelegate(delegate, context) {
166
+ var methodName = context.method,
167
+ method = delegate.iterator[methodName];
168
+ 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;
169
+ var record = tryCatch(method, delegate.iterator, context.arg);
170
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
171
+ var info = record.arg;
172
+ 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);
173
+ }
174
+ function pushTryEntry(locs) {
175
+ var entry = {
176
+ tryLoc: locs[0]
177
+ };
178
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
179
+ }
180
+ function resetTryEntry(entry) {
181
+ var record = entry.completion || {};
182
+ record.type = "normal", delete record.arg, entry.completion = record;
183
+ }
184
+ function Context(tryLocsList) {
185
+ this.tryEntries = [{
186
+ tryLoc: "root"
187
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
188
+ }
189
+ function values(iterable) {
190
+ if (iterable || "" === iterable) {
191
+ var iteratorMethod = iterable[iteratorSymbol];
192
+ if (iteratorMethod) return iteratorMethod.call(iterable);
193
+ if ("function" == typeof iterable.next) return iterable;
194
+ if (!isNaN(iterable.length)) {
195
+ var i = -1,
196
+ next = function next() {
197
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
198
+ return next.value = undefined, next.done = !0, next;
199
+ };
200
+ return next.next = next;
201
+ }
202
+ }
203
+ throw new TypeError(typeof iterable + " is not iterable");
204
+ }
205
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
206
+ value: GeneratorFunctionPrototype,
207
+ configurable: !0
208
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
209
+ value: GeneratorFunction,
210
+ configurable: !0
211
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
212
+ var ctor = "function" == typeof genFun && genFun.constructor;
213
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
214
+ }, exports.mark = function (genFun) {
215
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
216
+ }, exports.awrap = function (arg) {
217
+ return {
218
+ __await: arg
219
+ };
220
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
221
+ return this;
222
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
223
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
224
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
225
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
226
+ return result.done ? result.value : iter.next();
227
+ });
228
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
229
+ return this;
230
+ }), define(Gp, "toString", function () {
231
+ return "[object Generator]";
232
+ }), exports.keys = function (val) {
233
+ var object = Object(val),
234
+ keys = [];
235
+ for (var key in object) keys.push(key);
236
+ return keys.reverse(), function next() {
237
+ for (; keys.length;) {
238
+ var key = keys.pop();
239
+ if (key in object) return next.value = key, next.done = !1, next;
240
+ }
241
+ return next.done = !0, next;
242
+ };
243
+ }, exports.values = values, Context.prototype = {
244
+ constructor: Context,
245
+ reset: function (skipTempReset) {
246
+ 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);
247
+ },
248
+ stop: function () {
249
+ this.done = !0;
250
+ var rootRecord = this.tryEntries[0].completion;
251
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
252
+ return this.rval;
253
+ },
254
+ dispatchException: function (exception) {
255
+ if (this.done) throw exception;
256
+ var context = this;
257
+ function handle(loc, caught) {
258
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
259
+ }
260
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
261
+ var entry = this.tryEntries[i],
262
+ record = entry.completion;
263
+ if ("root" === entry.tryLoc) return handle("end");
264
+ if (entry.tryLoc <= this.prev) {
265
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
266
+ hasFinally = hasOwn.call(entry, "finallyLoc");
267
+ if (hasCatch && hasFinally) {
268
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
269
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
270
+ } else if (hasCatch) {
271
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
272
+ } else {
273
+ if (!hasFinally) throw new Error("try statement without catch or finally");
274
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
275
+ }
276
+ }
277
+ }
278
+ },
279
+ abrupt: function (type, arg) {
280
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
281
+ var entry = this.tryEntries[i];
282
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
283
+ var finallyEntry = entry;
284
+ break;
285
+ }
286
+ }
287
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
288
+ var record = finallyEntry ? finallyEntry.completion : {};
289
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
290
+ },
291
+ complete: function (record, afterLoc) {
292
+ if ("throw" === record.type) throw record.arg;
293
+ 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;
294
+ },
295
+ finish: function (finallyLoc) {
296
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
297
+ var entry = this.tryEntries[i];
298
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
299
+ }
300
+ },
301
+ catch: function (tryLoc) {
302
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
303
+ var entry = this.tryEntries[i];
304
+ if (entry.tryLoc === tryLoc) {
305
+ var record = entry.completion;
306
+ if ("throw" === record.type) {
307
+ var thrown = record.arg;
308
+ resetTryEntry(entry);
309
+ }
310
+ return thrown;
311
+ }
312
+ }
313
+ throw new Error("illegal catch attempt");
314
+ },
315
+ delegateYield: function (iterable, resultName, nextLoc) {
316
+ return this.delegate = {
317
+ iterator: values(iterable),
318
+ resultName: resultName,
319
+ nextLoc: nextLoc
320
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
321
+ }
322
+ }, exports;
323
+ }
324
+ function _typeof(obj) {
325
+ "@babel/helpers - typeof";
326
+
327
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
328
+ return typeof obj;
329
+ } : function (obj) {
330
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
331
+ }, _typeof(obj);
332
+ }
333
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
334
+ try {
335
+ var info = gen[key](arg);
336
+ var value = info.value;
337
+ } catch (error) {
338
+ reject(error);
339
+ return;
340
+ }
341
+ if (info.done) {
342
+ resolve(value);
343
+ } else {
344
+ Promise.resolve(value).then(_next, _throw);
345
+ }
346
+ }
347
+ function _asyncToGenerator(fn) {
348
+ return function () {
349
+ var self = this,
350
+ args = arguments;
351
+ return new Promise(function (resolve, reject) {
352
+ var gen = fn.apply(self, args);
353
+ function _next(value) {
354
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
355
+ }
356
+ function _throw(err) {
357
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
358
+ }
359
+ _next(undefined);
360
+ });
361
+ };
362
+ }
363
+ function _taggedTemplateLiteral(strings, raw) {
364
+ if (!raw) {
365
+ raw = strings.slice(0);
366
+ }
367
+ return Object.freeze(Object.defineProperties(strings, {
368
+ raw: {
369
+ value: Object.freeze(raw)
370
+ }
371
+ }));
372
+ }
373
+ function _slicedToArray(arr, i) {
374
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
375
+ }
376
+ function _toConsumableArray(arr) {
377
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
378
+ }
379
+ function _arrayWithoutHoles(arr) {
380
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
381
+ }
382
+ function _arrayWithHoles(arr) {
383
+ if (Array.isArray(arr)) return arr;
384
+ }
385
+ function _iterableToArray(iter) {
386
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
387
+ }
388
+ function _unsupportedIterableToArray(o, minLen) {
389
+ if (!o) return;
390
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
391
+ var n = Object.prototype.toString.call(o).slice(8, -1);
392
+ if (n === "Object" && o.constructor) n = o.constructor.name;
393
+ if (n === "Map" || n === "Set") return Array.from(o);
394
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
395
+ }
396
+ function _arrayLikeToArray(arr, len) {
397
+ if (len == null || len > arr.length) len = arr.length;
398
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
399
+ return arr2;
400
+ }
401
+ function _nonIterableSpread() {
402
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
403
+ }
404
+ function _nonIterableRest() {
405
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
406
+ }
407
+
408
+ 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, _taggedTemplateLiteral as taggedTemplateLiteral, _toConsumableArray as toConsumableArray, _typeof as typeof, _unsupportedIterableToArray as unsupportedIterableToArray };
@@ -1,102 +1,106 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import $ from 'jquery';
3
4
  import 'jquery-ui/ui/widgets/draggable';
4
5
 
5
- const EbDraggable = ({
6
- children,
7
- id,
8
- disabled = false,
9
- revert = true,
10
- clone = false,
11
- className,
12
- onStart,
13
- onStop,
14
- onDrag,
15
- onCreate
16
- }) => {
17
- const rootEl = React.useRef(null);
18
- const onStartCallback = React.useCallback((event, ui) => {
6
+ var EbDraggable = function EbDraggable(_ref) {
7
+ var children = _ref.children,
8
+ id = _ref.id,
9
+ _ref$disabled = _ref.disabled,
10
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
11
+ _ref$revert = _ref.revert,
12
+ revert = _ref$revert === void 0 ? true : _ref$revert,
13
+ _ref$clone = _ref.clone,
14
+ clone = _ref$clone === void 0 ? false : _ref$clone,
15
+ className = _ref.className,
16
+ onStart = _ref.onStart,
17
+ onStop = _ref.onStop,
18
+ onDrag = _ref.onDrag,
19
+ onCreate = _ref.onCreate;
20
+ var rootEl = React.useRef(null);
21
+ var onStartCallback = React.useCallback(function (event, ui) {
19
22
  if (onStart) {
20
23
  return onStart(event, ui);
21
24
  } else {
22
- return () => {
25
+ return function () {
23
26
  return;
24
27
  };
25
28
  }
26
29
  }, [onStart]);
27
- const onStopCallback = React.useCallback((event, ui) => {
30
+ var onStopCallback = React.useCallback(function (event, ui) {
28
31
  if (onStop) {
29
32
  return onStop(event, ui);
30
33
  } else {
31
- return () => {
34
+ return function () {
32
35
  return;
33
36
  };
34
37
  }
35
38
  }, [onStop]);
36
- const onDragCallback = React.useCallback((event, ui) => {
39
+ var onDragCallback = React.useCallback(function (event, ui) {
37
40
  if (onDrag) {
38
41
  return onDrag(event, ui);
39
42
  } else {
40
- return () => {
43
+ return function () {
41
44
  return;
42
45
  };
43
46
  }
44
47
  }, [onDrag]);
45
- const onCreateCallback = React.useCallback((event, ui) => {
48
+ var onCreateCallback = React.useCallback(function (event, ui) {
46
49
  if (onCreate) {
47
50
  return onCreate(event, ui);
48
51
  } else {
49
- return () => {
52
+ return function () {
50
53
  return;
51
54
  };
52
55
  }
53
56
  }, [onCreate]);
54
- React.useEffect(() => {
57
+ React.useEffect(function () {
55
58
  if (!rootEl.current) {
56
59
  return;
57
60
  }
58
- const draggableEl = $(rootEl.current);
61
+ var draggableEl = $(rootEl.current);
59
62
  draggableEl.draggable(Object.assign(Object.assign(Object.assign(Object.assign({}, disabled ? {
60
- disabled
63
+ disabled: disabled
61
64
  } : null), revert ? {
62
- revert
65
+ revert: revert
63
66
  } : null), clone ? {
64
67
  helper: 'clone'
65
68
  } : null), {
66
69
  zIndex: 200,
67
70
  revertDuration: 0,
68
- start: (event, ui) => {
71
+ start: function start(event, ui) {
69
72
  if (!onStartCallback) {
70
73
  return;
71
74
  }
72
75
  onStartCallback(event, ui);
73
76
  },
74
- stop: (event, ui) => {
77
+ stop: function stop(event, ui) {
75
78
  if (!onStopCallback) {
76
79
  return;
77
80
  }
78
81
  // draggableEl.draggable('cancel');
79
82
  onStopCallback(event, ui);
80
83
  },
81
- drag: (event, ui) => {
84
+ drag: function drag(event, ui) {
82
85
  onDragCallback(event, ui);
83
86
  },
84
- create: (event, ui) => {
87
+ create: function create(event, ui) {
85
88
  onCreateCallback(event, ui);
86
89
  }
87
90
  }));
88
- return () => {
91
+ return function () {
89
92
  draggableEl.draggable('destroy');
90
93
  };
91
94
  }, [clone, disabled, onCreateCallback, onDragCallback, onStartCallback, onStopCallback, revert]);
92
- return React.createElement("div", {
95
+ return jsx("div", {
93
96
  ref: rootEl,
94
97
  id: id,
95
98
  className: className,
96
99
  style: {
97
100
  cursor: disabled ? 'auto' : 'move'
98
- }
99
- }, children);
101
+ },
102
+ children: children
103
+ });
100
104
  };
101
105
 
102
106
  export { EbDraggable as default };
@@ -1,51 +1,53 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
  import $ from 'jquery';
3
4
  import 'jquery-ui/ui/widgets/droppable';
4
5
 
5
- const EbDroppable = ({
6
- children,
7
- id,
8
- disabled = false,
9
- accept,
10
- className,
11
- onDrop
12
- }) => {
13
- const rootEl = React.useRef(null);
14
- const onDropCallback = React.useCallback((event, ui) => {
6
+ var EbDroppable = function EbDroppable(_ref) {
7
+ var children = _ref.children,
8
+ id = _ref.id,
9
+ _ref$disabled = _ref.disabled,
10
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
11
+ accept = _ref.accept,
12
+ className = _ref.className,
13
+ onDrop = _ref.onDrop;
14
+ var rootEl = React.useRef(null);
15
+ var onDropCallback = React.useCallback(function (event, ui) {
15
16
  if (onDrop) {
16
17
  return onDrop(event, ui);
17
18
  } else {
18
- return () => {
19
+ return function () {
19
20
  return;
20
21
  };
21
22
  }
22
23
  }, [onDrop]);
23
- React.useEffect(() => {
24
+ React.useEffect(function () {
24
25
  if (!rootEl.current) {
25
26
  return;
26
27
  }
27
- const draggableEl = $(rootEl.current);
28
+ var draggableEl = $(rootEl.current);
28
29
  draggableEl.droppable(Object.assign(Object.assign(Object.assign({}, disabled ? {
29
- disabled
30
+ disabled: disabled
30
31
  } : null), accept ? {
31
- accept
32
+ accept: accept
32
33
  } : null), {
33
- drop: (event, ui) => {
34
+ drop: function drop(event, ui) {
34
35
  if (!onDropCallback) {
35
36
  return;
36
37
  }
37
38
  onDropCallback(event, ui);
38
39
  }
39
40
  }));
40
- return () => {
41
+ return function () {
41
42
  draggableEl.droppable('destroy');
42
43
  };
43
44
  }, [accept, disabled, onDropCallback]);
44
- return React.createElement("div", {
45
+ return jsx("div", {
45
46
  ref: rootEl,
46
47
  id: id,
47
- className: className
48
- }, children);
48
+ className: className,
49
+ children: children
50
+ });
49
51
  };
50
52
 
51
53
  export { EbDroppable as default };
@@ -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));