@elice/material-shared-utils 1.230328.0 → 1.230418.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +424 -0
- package/cjs/components/MaterialIntlProvider.js +14 -10
- package/cjs/hooks/useCallbackProp.js +3 -3
- package/cjs/index.js +2 -2
- package/cjs/material-config/MaterialConfigContext.js +2 -2
- package/cjs/material-config/MaterialConfigProvider.js +32 -21
- package/cjs/material-config/useMaterialConfig.js +2 -4
- package/cjs/material-config/useMaterialConfigApiClientUpdate.js +8 -7
- package/cjs/material-config/utils.js +0 -1
- package/cjs/material-fetch/useMaterialFetch.d.ts +2 -0
- package/cjs/material-fetch/useMaterialFetch.js +3 -4
- package/cjs/material-fetch/useMaterialFetchRaw.d.ts +2 -1
- package/cjs/material-fetch/useMaterialFetchRaw.js +79 -64
- package/cjs/material-hoc/withMaterial.js +13 -17
- package/es/_virtual/_rollupPluginBabelHelpers.js +410 -0
- package/es/components/MaterialIntlProvider.js +11 -9
- package/es/hooks/useCallbackProp.js +3 -3
- package/es/material-config/MaterialConfigContext.js +2 -2
- package/es/material-config/MaterialConfigProvider.js +29 -20
- package/es/material-config/useMaterialConfig.js +2 -4
- package/es/material-config/useMaterialConfigApiClientUpdate.js +8 -7
- package/es/material-config/utils.js +0 -1
- package/es/material-fetch/useMaterialFetch.d.ts +2 -0
- package/es/material-fetch/useMaterialFetch.js +3 -4
- package/es/material-fetch/useMaterialFetchRaw.d.ts +2 -1
- package/es/material-fetch/useMaterialFetchRaw.js +79 -64
- package/es/material-hoc/withMaterial.js +11 -15
- package/package.json +7 -7
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
function _iterableToArrayLimit(arr, i) {
|
|
6
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
7
|
+
if (null != _i) {
|
|
8
|
+
var _s,
|
|
9
|
+
_e,
|
|
10
|
+
_x,
|
|
11
|
+
_r,
|
|
12
|
+
_arr = [],
|
|
13
|
+
_n = !0,
|
|
14
|
+
_d = !1;
|
|
15
|
+
try {
|
|
16
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
17
|
+
if (Object(_i) !== _i) return;
|
|
18
|
+
_n = !1;
|
|
19
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
20
|
+
} catch (err) {
|
|
21
|
+
_d = !0, _e = err;
|
|
22
|
+
} finally {
|
|
23
|
+
try {
|
|
24
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
25
|
+
} finally {
|
|
26
|
+
if (_d) throw _e;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return _arr;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function _regeneratorRuntime() {
|
|
33
|
+
_regeneratorRuntime = function () {
|
|
34
|
+
return exports;
|
|
35
|
+
};
|
|
36
|
+
var exports = {},
|
|
37
|
+
Op = Object.prototype,
|
|
38
|
+
hasOwn = Op.hasOwnProperty,
|
|
39
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
40
|
+
obj[key] = desc.value;
|
|
41
|
+
},
|
|
42
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
43
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
44
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
45
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
46
|
+
function define(obj, key, value) {
|
|
47
|
+
return Object.defineProperty(obj, key, {
|
|
48
|
+
value: value,
|
|
49
|
+
enumerable: !0,
|
|
50
|
+
configurable: !0,
|
|
51
|
+
writable: !0
|
|
52
|
+
}), obj[key];
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
define({}, "");
|
|
56
|
+
} catch (err) {
|
|
57
|
+
define = function (obj, key, value) {
|
|
58
|
+
return obj[key] = value;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
62
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
63
|
+
generator = Object.create(protoGenerator.prototype),
|
|
64
|
+
context = new Context(tryLocsList || []);
|
|
65
|
+
return defineProperty(generator, "_invoke", {
|
|
66
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
67
|
+
}), generator;
|
|
68
|
+
}
|
|
69
|
+
function tryCatch(fn, obj, arg) {
|
|
70
|
+
try {
|
|
71
|
+
return {
|
|
72
|
+
type: "normal",
|
|
73
|
+
arg: fn.call(obj, arg)
|
|
74
|
+
};
|
|
75
|
+
} catch (err) {
|
|
76
|
+
return {
|
|
77
|
+
type: "throw",
|
|
78
|
+
arg: err
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.wrap = wrap;
|
|
83
|
+
var ContinueSentinel = {};
|
|
84
|
+
function Generator() {}
|
|
85
|
+
function GeneratorFunction() {}
|
|
86
|
+
function GeneratorFunctionPrototype() {}
|
|
87
|
+
var IteratorPrototype = {};
|
|
88
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
89
|
+
return this;
|
|
90
|
+
});
|
|
91
|
+
var getProto = Object.getPrototypeOf,
|
|
92
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
93
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
94
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
95
|
+
function defineIteratorMethods(prototype) {
|
|
96
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
97
|
+
define(prototype, method, function (arg) {
|
|
98
|
+
return this._invoke(method, arg);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
103
|
+
function invoke(method, arg, resolve, reject) {
|
|
104
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
105
|
+
if ("throw" !== record.type) {
|
|
106
|
+
var result = record.arg,
|
|
107
|
+
value = result.value;
|
|
108
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
109
|
+
invoke("next", value, resolve, reject);
|
|
110
|
+
}, function (err) {
|
|
111
|
+
invoke("throw", err, resolve, reject);
|
|
112
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
113
|
+
result.value = unwrapped, resolve(result);
|
|
114
|
+
}, function (error) {
|
|
115
|
+
return invoke("throw", error, resolve, reject);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
reject(record.arg);
|
|
119
|
+
}
|
|
120
|
+
var previousPromise;
|
|
121
|
+
defineProperty(this, "_invoke", {
|
|
122
|
+
value: function (method, arg) {
|
|
123
|
+
function callInvokeWithMethodAndArg() {
|
|
124
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
125
|
+
invoke(method, arg, resolve, reject);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
133
|
+
var state = "suspendedStart";
|
|
134
|
+
return function (method, arg) {
|
|
135
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
136
|
+
if ("completed" === state) {
|
|
137
|
+
if ("throw" === method) throw arg;
|
|
138
|
+
return doneResult();
|
|
139
|
+
}
|
|
140
|
+
for (context.method = method, context.arg = arg;;) {
|
|
141
|
+
var delegate = context.delegate;
|
|
142
|
+
if (delegate) {
|
|
143
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
144
|
+
if (delegateResult) {
|
|
145
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
146
|
+
return delegateResult;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
150
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
151
|
+
context.dispatchException(context.arg);
|
|
152
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
153
|
+
state = "executing";
|
|
154
|
+
var record = tryCatch(innerFn, self, context);
|
|
155
|
+
if ("normal" === record.type) {
|
|
156
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
157
|
+
return {
|
|
158
|
+
value: record.arg,
|
|
159
|
+
done: context.done
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
167
|
+
var methodName = context.method,
|
|
168
|
+
method = delegate.iterator[methodName];
|
|
169
|
+
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;
|
|
170
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
171
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
172
|
+
var info = record.arg;
|
|
173
|
+
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);
|
|
174
|
+
}
|
|
175
|
+
function pushTryEntry(locs) {
|
|
176
|
+
var entry = {
|
|
177
|
+
tryLoc: locs[0]
|
|
178
|
+
};
|
|
179
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
180
|
+
}
|
|
181
|
+
function resetTryEntry(entry) {
|
|
182
|
+
var record = entry.completion || {};
|
|
183
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
184
|
+
}
|
|
185
|
+
function Context(tryLocsList) {
|
|
186
|
+
this.tryEntries = [{
|
|
187
|
+
tryLoc: "root"
|
|
188
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
189
|
+
}
|
|
190
|
+
function values(iterable) {
|
|
191
|
+
if (iterable) {
|
|
192
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
193
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
194
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
195
|
+
if (!isNaN(iterable.length)) {
|
|
196
|
+
var i = -1,
|
|
197
|
+
next = function next() {
|
|
198
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
199
|
+
return next.value = undefined, next.done = !0, next;
|
|
200
|
+
};
|
|
201
|
+
return next.next = next;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
next: doneResult
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function doneResult() {
|
|
209
|
+
return {
|
|
210
|
+
value: undefined,
|
|
211
|
+
done: !0
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
215
|
+
value: GeneratorFunctionPrototype,
|
|
216
|
+
configurable: !0
|
|
217
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
218
|
+
value: GeneratorFunction,
|
|
219
|
+
configurable: !0
|
|
220
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
221
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
222
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
223
|
+
}, exports.mark = function (genFun) {
|
|
224
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
225
|
+
}, exports.awrap = function (arg) {
|
|
226
|
+
return {
|
|
227
|
+
__await: arg
|
|
228
|
+
};
|
|
229
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
230
|
+
return this;
|
|
231
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
232
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
233
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
234
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
235
|
+
return result.done ? result.value : iter.next();
|
|
236
|
+
});
|
|
237
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
238
|
+
return this;
|
|
239
|
+
}), define(Gp, "toString", function () {
|
|
240
|
+
return "[object Generator]";
|
|
241
|
+
}), exports.keys = function (val) {
|
|
242
|
+
var object = Object(val),
|
|
243
|
+
keys = [];
|
|
244
|
+
for (var key in object) keys.push(key);
|
|
245
|
+
return keys.reverse(), function next() {
|
|
246
|
+
for (; keys.length;) {
|
|
247
|
+
var key = keys.pop();
|
|
248
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
249
|
+
}
|
|
250
|
+
return next.done = !0, next;
|
|
251
|
+
};
|
|
252
|
+
}, exports.values = values, Context.prototype = {
|
|
253
|
+
constructor: Context,
|
|
254
|
+
reset: function (skipTempReset) {
|
|
255
|
+
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);
|
|
256
|
+
},
|
|
257
|
+
stop: function () {
|
|
258
|
+
this.done = !0;
|
|
259
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
260
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
261
|
+
return this.rval;
|
|
262
|
+
},
|
|
263
|
+
dispatchException: function (exception) {
|
|
264
|
+
if (this.done) throw exception;
|
|
265
|
+
var context = this;
|
|
266
|
+
function handle(loc, caught) {
|
|
267
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
268
|
+
}
|
|
269
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
270
|
+
var entry = this.tryEntries[i],
|
|
271
|
+
record = entry.completion;
|
|
272
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
273
|
+
if (entry.tryLoc <= this.prev) {
|
|
274
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
275
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
276
|
+
if (hasCatch && hasFinally) {
|
|
277
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
278
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
279
|
+
} else if (hasCatch) {
|
|
280
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
281
|
+
} else {
|
|
282
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
283
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
abrupt: function (type, arg) {
|
|
289
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
290
|
+
var entry = this.tryEntries[i];
|
|
291
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
292
|
+
var finallyEntry = entry;
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
297
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
298
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
299
|
+
},
|
|
300
|
+
complete: function (record, afterLoc) {
|
|
301
|
+
if ("throw" === record.type) throw record.arg;
|
|
302
|
+
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;
|
|
303
|
+
},
|
|
304
|
+
finish: function (finallyLoc) {
|
|
305
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
306
|
+
var entry = this.tryEntries[i];
|
|
307
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
catch: function (tryLoc) {
|
|
311
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
312
|
+
var entry = this.tryEntries[i];
|
|
313
|
+
if (entry.tryLoc === tryLoc) {
|
|
314
|
+
var record = entry.completion;
|
|
315
|
+
if ("throw" === record.type) {
|
|
316
|
+
var thrown = record.arg;
|
|
317
|
+
resetTryEntry(entry);
|
|
318
|
+
}
|
|
319
|
+
return thrown;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
throw new Error("illegal catch attempt");
|
|
323
|
+
},
|
|
324
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
325
|
+
return this.delegate = {
|
|
326
|
+
iterator: values(iterable),
|
|
327
|
+
resultName: resultName,
|
|
328
|
+
nextLoc: nextLoc
|
|
329
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
330
|
+
}
|
|
331
|
+
}, exports;
|
|
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 _defineProperty(obj, key, value) {
|
|
364
|
+
key = _toPropertyKey(key);
|
|
365
|
+
if (key in obj) {
|
|
366
|
+
Object.defineProperty(obj, key, {
|
|
367
|
+
value: value,
|
|
368
|
+
enumerable: true,
|
|
369
|
+
configurable: true,
|
|
370
|
+
writable: true
|
|
371
|
+
});
|
|
372
|
+
} else {
|
|
373
|
+
obj[key] = value;
|
|
374
|
+
}
|
|
375
|
+
return obj;
|
|
376
|
+
}
|
|
377
|
+
function _slicedToArray(arr, i) {
|
|
378
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
379
|
+
}
|
|
380
|
+
function _arrayWithHoles(arr) {
|
|
381
|
+
if (Array.isArray(arr)) return arr;
|
|
382
|
+
}
|
|
383
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
384
|
+
if (!o) return;
|
|
385
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
386
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
387
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
388
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
389
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
390
|
+
}
|
|
391
|
+
function _arrayLikeToArray(arr, len) {
|
|
392
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
393
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
394
|
+
return arr2;
|
|
395
|
+
}
|
|
396
|
+
function _nonIterableRest() {
|
|
397
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
398
|
+
}
|
|
399
|
+
function _toPrimitive(input, hint) {
|
|
400
|
+
if (typeof input !== "object" || input === null) return input;
|
|
401
|
+
var prim = input[Symbol.toPrimitive];
|
|
402
|
+
if (prim !== undefined) {
|
|
403
|
+
var res = prim.call(input, hint || "default");
|
|
404
|
+
if (typeof res !== "object") return res;
|
|
405
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
406
|
+
}
|
|
407
|
+
return (hint === "string" ? String : Number)(input);
|
|
408
|
+
}
|
|
409
|
+
function _toPropertyKey(arg) {
|
|
410
|
+
var key = _toPrimitive(arg, "string");
|
|
411
|
+
return typeof key === "symbol" ? key : String(key);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
exports.arrayLikeToArray = _arrayLikeToArray;
|
|
415
|
+
exports.arrayWithHoles = _arrayWithHoles;
|
|
416
|
+
exports.asyncToGenerator = _asyncToGenerator;
|
|
417
|
+
exports.defineProperty = _defineProperty;
|
|
418
|
+
exports.iterableToArrayLimit = _iterableToArrayLimit;
|
|
419
|
+
exports.nonIterableRest = _nonIterableRest;
|
|
420
|
+
exports.regeneratorRuntime = _regeneratorRuntime;
|
|
421
|
+
exports.slicedToArray = _slicedToArray;
|
|
422
|
+
exports.toPrimitive = _toPrimitive;
|
|
423
|
+
exports.toPropertyKey = _toPropertyKey;
|
|
424
|
+
exports.unsupportedIterableToArray = _unsupportedIterableToArray;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var React = require('react');
|
|
4
6
|
var reactIntl = require('react-intl');
|
|
5
7
|
|
|
@@ -7,18 +9,20 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
9
|
|
|
8
10
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
var INTL_DEFAULT_LOCALE = 'ko';
|
|
13
|
+
var INTL_DEFAULT_PHRASES = {};
|
|
12
14
|
/**
|
|
13
15
|
* IntlProvider for material components.
|
|
14
16
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
var MaterialIntlProvider = function MaterialIntlProvider(_ref) {
|
|
18
|
+
var children = _ref.children,
|
|
19
|
+
_ref$locale = _ref.locale,
|
|
20
|
+
locale = _ref$locale === void 0 ? INTL_DEFAULT_LOCALE : _ref$locale,
|
|
21
|
+
_ref$phrases = _ref.phrases,
|
|
22
|
+
phrases = _ref$phrases === void 0 ? INTL_DEFAULT_PHRASES : _ref$phrases;
|
|
23
|
+
var messages = React__default["default"].useMemo(function () {
|
|
24
|
+
return locale in phrases ? phrases[locale] : phrases[INTL_DEFAULT_LOCALE];
|
|
25
|
+
}, [locale, phrases]);
|
|
22
26
|
return React__default["default"].createElement(reactIntl.IntlProvider, {
|
|
23
27
|
children: children,
|
|
24
28
|
locale: locale,
|
|
@@ -27,4 +31,4 @@ const MaterialIntlProvider = ({
|
|
|
27
31
|
});
|
|
28
32
|
};
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
exports["default"] = MaterialIntlProvider;
|
|
@@ -8,9 +8,9 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
React__default["default"].useEffect(()
|
|
11
|
+
var useCallbackProp = function useCallbackProp(cb) {
|
|
12
|
+
var cbRef = React__default["default"].useRef(cb);
|
|
13
|
+
React__default["default"].useEffect(function () {
|
|
14
14
|
cbRef.current = cb;
|
|
15
15
|
}, [cb]);
|
|
16
16
|
return cbRef;
|
package/cjs/index.js
CHANGED
|
@@ -14,9 +14,9 @@ var withMaterial = require('./material-hoc/withMaterial.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.MaterialIntlProvider = MaterialIntlProvider;
|
|
17
|
+
exports.MaterialIntlProvider = MaterialIntlProvider["default"];
|
|
18
18
|
exports.useCallbackProp = useCallbackProp.useCallbackProp;
|
|
19
|
-
exports.MaterialConfigProvider = MaterialConfigProvider;
|
|
19
|
+
exports.MaterialConfigProvider = MaterialConfigProvider["default"];
|
|
20
20
|
exports.useMaterialConfig = useMaterialConfig.useMaterialConfig;
|
|
21
21
|
exports.useMaterialConfigApiClientUpdate = useMaterialConfigApiClientUpdate.useMaterialConfigApiClientUpdate;
|
|
22
22
|
exports.updateMaterialConfigSessionKey = utils.updateMaterialConfigSessionKey;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var rxjs = require('rxjs');
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
var MaterialConfigContext = React.createContext(null);
|
|
9
|
+
var sessionKeySubject$ = new rxjs.BehaviorSubject(null);
|
|
10
10
|
|
|
11
11
|
exports.MaterialConfigContext = MaterialConfigContext;
|
|
12
12
|
exports.sessionKeySubject$ = sessionKeySubject$;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
3
6
|
var React = require('react');
|
|
4
7
|
var MaterialConfigContext = require('./MaterialConfigContext.js');
|
|
5
8
|
|
|
@@ -7,39 +10,47 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
7
10
|
|
|
8
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
children,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
var MaterialConfigProvider = function MaterialConfigProvider(_ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
apiOriginUrl = _ref.apiOriginUrl,
|
|
16
|
+
apiWsOriginUrl = _ref.apiWsOriginUrl,
|
|
17
|
+
_ref$orgNameShort = _ref.orgNameShort,
|
|
18
|
+
orgNameShortProp = _ref$orgNameShort === void 0 ? 'academy' : _ref$orgNameShort;
|
|
19
|
+
var _React$useState = React__default["default"].useState(orgNameShortProp),
|
|
20
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
21
|
+
orgNameShort = _React$useState2[0],
|
|
22
|
+
setOrgNameShort = _React$useState2[1];
|
|
23
|
+
var _React$useState3 = React__default["default"].useState(null),
|
|
24
|
+
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
25
|
+
sessionKey = _React$useState4[0],
|
|
26
|
+
setSessionKey = _React$useState4[1];
|
|
27
|
+
//
|
|
18
28
|
// Update org name short.
|
|
19
29
|
//
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
React__default["default"].useEffect(function () {
|
|
31
|
+
return setOrgNameShort(orgNameShortProp);
|
|
32
|
+
}, [orgNameShortProp]);
|
|
33
|
+
//
|
|
22
34
|
// Update session key when session key subject emits.
|
|
23
35
|
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return () => {
|
|
36
|
+
React__default["default"].useEffect(function () {
|
|
37
|
+
var sub = MaterialConfigContext.sessionKeySubject$.subscribe(setSessionKey);
|
|
38
|
+
return function () {
|
|
28
39
|
sub.unsubscribe();
|
|
29
40
|
};
|
|
30
|
-
}, []);
|
|
41
|
+
}, []);
|
|
42
|
+
//
|
|
31
43
|
//
|
|
32
44
|
//
|
|
33
|
-
|
|
34
45
|
return React__default["default"].createElement(MaterialConfigContext.MaterialConfigContext.Provider, {
|
|
35
46
|
children: children,
|
|
36
47
|
value: {
|
|
37
|
-
apiOriginUrl,
|
|
38
|
-
apiWsOriginUrl,
|
|
39
|
-
orgNameShort,
|
|
40
|
-
sessionKey
|
|
48
|
+
apiOriginUrl: apiOriginUrl,
|
|
49
|
+
apiWsOriginUrl: apiWsOriginUrl,
|
|
50
|
+
orgNameShort: orgNameShort,
|
|
51
|
+
sessionKey: sessionKey
|
|
41
52
|
}
|
|
42
53
|
});
|
|
43
54
|
};
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
exports["default"] = MaterialConfigProvider;
|
|
@@ -5,13 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var MaterialConfigContext = require('./MaterialConfigContext.js');
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
var useMaterialConfig = function useMaterialConfig() {
|
|
9
|
+
var context = React.useContext(MaterialConfigContext.MaterialConfigContext);
|
|
11
10
|
if (context === undefined) {
|
|
12
11
|
throw new Error('Oops, `useMaterialConfig` must be used within a `MaterialConfigProvider`');
|
|
13
12
|
}
|
|
14
|
-
|
|
15
13
|
return context;
|
|
16
14
|
};
|
|
17
15
|
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var reactUse = require('react-use');
|
|
7
8
|
var MaterialConfigContext = require('./MaterialConfigContext.js');
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
var useMaterialConfigApiClientUpdate = function useMaterialConfigApiClientUpdate(callback) {
|
|
11
|
+
var context = React.useContext(MaterialConfigContext.MaterialConfigContext);
|
|
12
12
|
if (!context) {
|
|
13
13
|
throw new Error('Oops, Elice material component must be used within a `MaterialConfigProvider`');
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
var _useState = React.useState(false),
|
|
16
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
17
|
+
isReady = _useState2[0],
|
|
18
|
+
setReady = _useState2[1];
|
|
19
|
+
reactUse.useDeepCompareEffect(function () {
|
|
18
20
|
var _a;
|
|
19
|
-
|
|
20
21
|
callback({
|
|
21
22
|
apiBaseUrl: context.apiOriginUrl,
|
|
22
23
|
orgNameShort: context.orgNameShort,
|
|
@@ -40,10 +40,12 @@ export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R
|
|
|
40
40
|
isResponded: boolean;
|
|
41
41
|
lectureGroupType: enums.LectureGroupType | null;
|
|
42
42
|
lectureId: number;
|
|
43
|
+
libraryInfo: any;
|
|
43
44
|
mainOrderNo: number;
|
|
44
45
|
materialId: number;
|
|
45
46
|
materialKey: string;
|
|
46
47
|
materialType: enums.LectureMaterialType;
|
|
48
|
+
materialErn: string;
|
|
47
49
|
modifiedDatetime: number;
|
|
48
50
|
openScheduleDatetime: number | null;
|
|
49
51
|
originCourse: {
|
|
@@ -9,7 +9,7 @@ var useMaterialFetchRaw = require('./useMaterialFetchRaw.js');
|
|
|
9
9
|
|
|
10
10
|
//
|
|
11
11
|
//
|
|
12
|
-
|
|
12
|
+
//
|
|
13
13
|
/**
|
|
14
14
|
* Init api client and fetch material for contaner.
|
|
15
15
|
*
|
|
@@ -28,9 +28,8 @@ var useMaterialFetchRaw = require('./useMaterialFetchRaw.js');
|
|
|
28
28
|
* eliceApiClientConfigs.init
|
|
29
29
|
* );
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const isReady = useMaterialConfigApiClientUpdate.useMaterialConfigApiClientUpdate(init);
|
|
31
|
+
var useMaterialFetch = function useMaterialFetch(materialType, materialFetchFn, init) {
|
|
32
|
+
var isReady = useMaterialConfigApiClientUpdate.useMaterialConfigApiClientUpdate(init);
|
|
34
33
|
return useMaterialFetchRaw.useMaterialFetchRaw(materialType, materialFetchFn, isReady);
|
|
35
34
|
};
|
|
36
35
|
|