touchstudy-core 0.1.37 → 0.1.39
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.
- package/dist/index.js +207 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +207 -11
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -154,11 +154,165 @@ var AuthenticationMessage;
|
|
154
154
|
})(exports.Role || (exports.Role = {}));
|
155
155
|
|
156
156
|
// A type of promise-like that resolves synchronously and supports only one observer
|
157
|
+
const _Pact = /*#__PURE__*/(function() {
|
158
|
+
function _Pact() {}
|
159
|
+
_Pact.prototype.then = function(onFulfilled, onRejected) {
|
160
|
+
const result = new _Pact();
|
161
|
+
const state = this.s;
|
162
|
+
if (state) {
|
163
|
+
const callback = state & 1 ? onFulfilled : onRejected;
|
164
|
+
if (callback) {
|
165
|
+
try {
|
166
|
+
_settle(result, 1, callback(this.v));
|
167
|
+
} catch (e) {
|
168
|
+
_settle(result, 2, e);
|
169
|
+
}
|
170
|
+
return result;
|
171
|
+
} else {
|
172
|
+
return this;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
this.o = function(_this) {
|
176
|
+
try {
|
177
|
+
const value = _this.v;
|
178
|
+
if (_this.s & 1) {
|
179
|
+
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
180
|
+
} else if (onRejected) {
|
181
|
+
_settle(result, 1, onRejected(value));
|
182
|
+
} else {
|
183
|
+
_settle(result, 2, value);
|
184
|
+
}
|
185
|
+
} catch (e) {
|
186
|
+
_settle(result, 2, e);
|
187
|
+
}
|
188
|
+
};
|
189
|
+
return result;
|
190
|
+
};
|
191
|
+
return _Pact;
|
192
|
+
})();
|
193
|
+
|
194
|
+
// Settles a pact synchronously
|
195
|
+
function _settle(pact, state, value) {
|
196
|
+
if (!pact.s) {
|
197
|
+
if (value instanceof _Pact) {
|
198
|
+
if (value.s) {
|
199
|
+
if (state & 1) {
|
200
|
+
state = value.s;
|
201
|
+
}
|
202
|
+
value = value.v;
|
203
|
+
} else {
|
204
|
+
value.o = _settle.bind(null, pact, state);
|
205
|
+
return;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
if (value && value.then) {
|
209
|
+
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
210
|
+
return;
|
211
|
+
}
|
212
|
+
pact.s = state;
|
213
|
+
pact.v = value;
|
214
|
+
const observer = pact.o;
|
215
|
+
if (observer) {
|
216
|
+
observer(pact);
|
217
|
+
}
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
221
|
+
function _isSettledPact(thenable) {
|
222
|
+
return thenable instanceof _Pact && thenable.s & 1;
|
223
|
+
}
|
157
224
|
|
158
225
|
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
159
226
|
|
160
227
|
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
161
228
|
|
229
|
+
// Asynchronously implement a generic for loop
|
230
|
+
function _for(test, update, body) {
|
231
|
+
var stage;
|
232
|
+
for (;;) {
|
233
|
+
var shouldContinue = test();
|
234
|
+
if (_isSettledPact(shouldContinue)) {
|
235
|
+
shouldContinue = shouldContinue.v;
|
236
|
+
}
|
237
|
+
if (!shouldContinue) {
|
238
|
+
return result;
|
239
|
+
}
|
240
|
+
if (shouldContinue.then) {
|
241
|
+
stage = 0;
|
242
|
+
break;
|
243
|
+
}
|
244
|
+
var result = body();
|
245
|
+
if (result && result.then) {
|
246
|
+
if (_isSettledPact(result)) {
|
247
|
+
result = result.s;
|
248
|
+
} else {
|
249
|
+
stage = 1;
|
250
|
+
break;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
if (update) {
|
254
|
+
var updateValue = update();
|
255
|
+
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
256
|
+
stage = 2;
|
257
|
+
break;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
}
|
261
|
+
var pact = new _Pact();
|
262
|
+
var reject = _settle.bind(null, pact, 2);
|
263
|
+
(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
|
264
|
+
return pact;
|
265
|
+
function _resumeAfterBody(value) {
|
266
|
+
result = value;
|
267
|
+
do {
|
268
|
+
if (update) {
|
269
|
+
updateValue = update();
|
270
|
+
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
271
|
+
updateValue.then(_resumeAfterUpdate).then(void 0, reject);
|
272
|
+
return;
|
273
|
+
}
|
274
|
+
}
|
275
|
+
shouldContinue = test();
|
276
|
+
if (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {
|
277
|
+
_settle(pact, 1, result);
|
278
|
+
return;
|
279
|
+
}
|
280
|
+
if (shouldContinue.then) {
|
281
|
+
shouldContinue.then(_resumeAfterTest).then(void 0, reject);
|
282
|
+
return;
|
283
|
+
}
|
284
|
+
result = body();
|
285
|
+
if (_isSettledPact(result)) {
|
286
|
+
result = result.v;
|
287
|
+
}
|
288
|
+
} while (!result || !result.then);
|
289
|
+
result.then(_resumeAfterBody).then(void 0, reject);
|
290
|
+
}
|
291
|
+
function _resumeAfterTest(shouldContinue) {
|
292
|
+
if (shouldContinue) {
|
293
|
+
result = body();
|
294
|
+
if (result && result.then) {
|
295
|
+
result.then(_resumeAfterBody).then(void 0, reject);
|
296
|
+
} else {
|
297
|
+
_resumeAfterBody(result);
|
298
|
+
}
|
299
|
+
} else {
|
300
|
+
_settle(pact, 1, result);
|
301
|
+
}
|
302
|
+
}
|
303
|
+
function _resumeAfterUpdate() {
|
304
|
+
if (shouldContinue = test()) {
|
305
|
+
if (shouldContinue.then) {
|
306
|
+
shouldContinue.then(_resumeAfterTest).then(void 0, reject);
|
307
|
+
} else {
|
308
|
+
_resumeAfterTest(shouldContinue);
|
309
|
+
}
|
310
|
+
} else {
|
311
|
+
_settle(pact, 1, result);
|
312
|
+
}
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
162
316
|
// Asynchronously call a function and send errors to recovery continuation
|
163
317
|
function _catch(body, recover) {
|
164
318
|
try {
|
@@ -1613,6 +1767,8 @@ var problem_analysis = "문제 분석";
|
|
1613
1767
|
var class_information = "수업정보";
|
1614
1768
|
var teachers = "교사";
|
1615
1769
|
var lessons = "수업";
|
1770
|
+
var update_class = "수업 업데이트";
|
1771
|
+
var create_class = "수업 만들기";
|
1616
1772
|
var lang_ko = {
|
1617
1773
|
problem_solving: problem_solving,
|
1618
1774
|
my_story: my_story,
|
@@ -1919,7 +2075,9 @@ var lang_ko = {
|
|
1919
2075
|
problem_analysis: problem_analysis,
|
1920
2076
|
class_information: class_information,
|
1921
2077
|
teachers: teachers,
|
1922
|
-
lessons: lessons
|
2078
|
+
lessons: lessons,
|
2079
|
+
update_class: update_class,
|
2080
|
+
create_class: create_class
|
1923
2081
|
};
|
1924
2082
|
|
1925
2083
|
var problem_solving$1 = "Problem Solving";
|
@@ -2274,6 +2432,8 @@ var problem_analysis$1 = "Problem analysis";
|
|
2274
2432
|
var class_information$1 = "Class Information";
|
2275
2433
|
var teachers$1 = "Teachers";
|
2276
2434
|
var lessons$1 = "Lessons";
|
2435
|
+
var update_class$1 = "Update class";
|
2436
|
+
var create_class$1 = "Create class";
|
2277
2437
|
var lang_en = {
|
2278
2438
|
problem_solving: problem_solving$1,
|
2279
2439
|
my_story: my_story$1,
|
@@ -2615,7 +2775,9 @@ var lang_en = {
|
|
2615
2775
|
problem_analysis: problem_analysis$1,
|
2616
2776
|
class_information: class_information$1,
|
2617
2777
|
teachers: teachers$1,
|
2618
|
-
lessons: lessons$1
|
2778
|
+
lessons: lessons$1,
|
2779
|
+
update_class: update_class$1,
|
2780
|
+
create_class: create_class$1
|
2619
2781
|
};
|
2620
2782
|
|
2621
2783
|
i18n.use(reactI18next.initReactI18next).init({
|
@@ -9227,19 +9389,53 @@ var useExamResult = function useExamResult(searchParam, navigate, examSessionId,
|
|
9227
9389
|
var canvas = document.querySelector("#canvas");
|
9228
9390
|
var headerCanvas = document.querySelector("#header-canvas");
|
9229
9391
|
if (!canvas || !headerCanvas) return Promise.resolve();
|
9230
|
-
var doc = new jspdf.jsPDF(
|
9231
|
-
|
9232
|
-
|
9392
|
+
var doc = new jspdf.jsPDF({
|
9393
|
+
orientation: "p",
|
9394
|
+
unit: "px",
|
9395
|
+
format: "a4"
|
9396
|
+
});
|
9397
|
+
var WIDTH_PAPER = doc.internal.pageSize.width;
|
9398
|
+
var HEIGHT_PAPER = doc.internal.pageSize.height;
|
9399
|
+
var line = 0;
|
9400
|
+
var imgWidth = WIDTH_PAPER;
|
9401
|
+
var chartWidth = WIDTH_PAPER - 20;
|
9233
9402
|
return Promise.resolve(html2canvas(headerCanvas)).then(function (header) {
|
9403
|
+
function _temp11() {
|
9404
|
+
doc.save("download.pdf");
|
9405
|
+
}
|
9234
9406
|
var imgHeaderHeight = header.height * imgWidth / header.width;
|
9235
9407
|
var imgHeaderData = header.toDataURL('image/png');
|
9236
9408
|
doc.addImage(imgHeaderData, 'PNG', 0, 0, imgWidth, imgHeaderHeight);
|
9237
|
-
|
9238
|
-
|
9239
|
-
|
9240
|
-
|
9241
|
-
|
9242
|
-
|
9409
|
+
line += imgHeaderHeight;
|
9410
|
+
if (line > HEIGHT_PAPER) {
|
9411
|
+
doc.addPage();
|
9412
|
+
line = 20;
|
9413
|
+
}
|
9414
|
+
var _temp10 = function () {
|
9415
|
+
if (canvas && canvas.childElementCount > 0) {
|
9416
|
+
var _index = 0;
|
9417
|
+
var _temp9 = _for(function () {
|
9418
|
+
return _index < canvas.childElementCount;
|
9419
|
+
}, function () {
|
9420
|
+
return _index++;
|
9421
|
+
}, function () {
|
9422
|
+
var chart = canvas.children.item(_index);
|
9423
|
+
return Promise.resolve(html2canvas(chart)).then(function (chartCanvas) {
|
9424
|
+
var imgBodyHeight = chartCanvas.height * chartWidth / chartCanvas.width;
|
9425
|
+
var imgBodyData = chartCanvas.toDataURL('image/png');
|
9426
|
+
line += 10;
|
9427
|
+
if (line + imgBodyHeight > HEIGHT_PAPER) {
|
9428
|
+
doc.addPage();
|
9429
|
+
line = 20;
|
9430
|
+
}
|
9431
|
+
doc.addImage(imgBodyData, 'PNG', 10, line, chartWidth, imgBodyHeight);
|
9432
|
+
line += imgBodyHeight;
|
9433
|
+
});
|
9434
|
+
});
|
9435
|
+
if (_temp9 && _temp9.then) return _temp9.then(function () {});
|
9436
|
+
}
|
9437
|
+
}();
|
9438
|
+
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
|
9243
9439
|
});
|
9244
9440
|
} catch (e) {
|
9245
9441
|
return Promise.reject(e);
|