@atlaskit/emoji 67.3.2 → 67.4.0
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/CHANGELOG.md +10 -0
- package/dist/cjs/api/EmojiResource.js +192 -203
- package/dist/cjs/api/media/SiteEmojiResource.js +27 -30
- package/dist/cjs/components/common/EmojiUploadPicker.js +23 -23
- package/dist/cjs/components/common/ResourcedEmoji.js +1 -1
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +51 -53
- package/dist/cjs/components/common/Scrollable.js +2 -1
- package/dist/cjs/components/common/UfoErrorBoundary.js +1 -1
- package/dist/cjs/components/common/internal-types.js +4 -4
- package/dist/cjs/components/picker/EmojiPicker.js +3 -4
- package/dist/cjs/components/picker/EmojiPickerList.js +11 -13
- package/dist/cjs/components/typeahead/EmojiTypeAhead.js +3 -4
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +1 -1
- package/dist/cjs/components/typeahead/EmojiTypeAheadItem.js +2 -1
- package/dist/cjs/components/typeahead/EmojiTypeAheadList.js +1 -2
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +41 -42
- package/dist/cjs/components/uploader/EmojiUploader.js +3 -4
- package/dist/cjs/context/EmojiContextProvider.js +18 -20
- package/dist/cjs/hooks/useEmoji.js +20 -23
- package/dist/cjs/types.js +28 -28
- package/dist/cjs/util/analytics/samplingUfo.js +74 -83
- package/dist/cjs/util/constants.js +8 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +3 -3
- package/dist/es2019/components/common/Scrollable.js +2 -1
- package/dist/es2019/components/common/internal-types.js +3 -3
- package/dist/es2019/components/picker/EmojiPicker.js +2 -3
- package/dist/es2019/components/picker/EmojiPickerList.js +11 -14
- package/dist/es2019/components/typeahead/EmojiTypeAhead.js +2 -3
- package/dist/es2019/components/typeahead/EmojiTypeAheadItem.js +2 -1
- package/dist/es2019/components/typeahead/EmojiTypeAheadList.js +1 -3
- package/dist/es2019/components/uploader/EmojiUploader.js +2 -3
- package/dist/es2019/types.js +21 -21
- package/dist/es2019/util/constants.js +8 -8
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiResource.js +192 -203
- package/dist/esm/api/media/SiteEmojiResource.js +27 -30
- package/dist/esm/components/common/EmojiUploadPicker.js +21 -24
- package/dist/esm/components/common/ResourcedEmojiComponent.js +51 -54
- package/dist/esm/components/common/Scrollable.js +2 -1
- package/dist/esm/components/common/UfoErrorBoundary.js +1 -1
- package/dist/esm/components/common/internal-types.js +3 -3
- package/dist/esm/components/picker/EmojiPicker.js +2 -3
- package/dist/esm/components/picker/EmojiPickerList.js +11 -13
- package/dist/esm/components/typeahead/EmojiTypeAhead.js +2 -3
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +1 -1
- package/dist/esm/components/typeahead/EmojiTypeAheadItem.js +2 -1
- package/dist/esm/components/typeahead/EmojiTypeAheadList.js +1 -2
- package/dist/esm/components/uploader/EmojiUploadComponent.js +39 -42
- package/dist/esm/components/uploader/EmojiUploader.js +2 -3
- package/dist/esm/context/EmojiContextProvider.js +18 -21
- package/dist/esm/hooks/useEmoji.js +20 -23
- package/dist/esm/types.js +21 -21
- package/dist/esm/util/analytics/samplingUfo.js +74 -83
- package/dist/esm/util/constants.js +8 -8
- package/dist/esm/version.json +1 -1
- package/package.json +18 -18
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.uploadEmojiNameInputTestId = exports.uploadEmojiComponentTestId = exports.default = exports.cancelEmojiUploadPickerTestId = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _react = require("react");
|
|
@@ -25,7 +26,8 @@ var _internalTypes = require("./internal-types");
|
|
|
25
26
|
var _styles = require("./styles");
|
|
26
27
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { 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); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } /** @jsx jsx */
|
|
29
|
+
/** @jsx jsx */
|
|
30
|
+
|
|
29
31
|
var uploadEmojiNameInputTestId = 'upload-emoji-name-input';
|
|
30
32
|
exports.uploadEmojiNameInputTestId = uploadEmojiNameInputTestId;
|
|
31
33
|
var uploadEmojiComponentTestId = 'upload-emoji-component';
|
|
@@ -235,28 +237,26 @@ var EmojiUploadPicker = function EmojiUploadPicker(props) {
|
|
|
235
237
|
}, [cancelChooseFile]);
|
|
236
238
|
var onFileLoad = (0, _react.useCallback)(function (file) {
|
|
237
239
|
return /*#__PURE__*/function () {
|
|
238
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
239
|
-
return
|
|
240
|
-
while (1) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
return _context.stop();
|
|
259
|
-
}
|
|
240
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(f) {
|
|
241
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
242
|
+
while (1) switch (_context.prev = _context.next) {
|
|
243
|
+
case 0:
|
|
244
|
+
_context.prev = 0;
|
|
245
|
+
setFilename(file.name);
|
|
246
|
+
_context.next = 4;
|
|
247
|
+
return ImageUtil.parseImage(f.target.result);
|
|
248
|
+
case 4:
|
|
249
|
+
setPreviewImage(f.target.result);
|
|
250
|
+
_context.next = 11;
|
|
251
|
+
break;
|
|
252
|
+
case 7:
|
|
253
|
+
_context.prev = 7;
|
|
254
|
+
_context.t0 = _context["catch"](0);
|
|
255
|
+
setChooseEmojiErrorMessage((0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.emojiInvalidImage));
|
|
256
|
+
cancelChooseFile();
|
|
257
|
+
case 11:
|
|
258
|
+
case "end":
|
|
259
|
+
return _context.stop();
|
|
260
260
|
}
|
|
261
261
|
}, _callee, null, [[0, 7]]);
|
|
262
262
|
}));
|
|
@@ -16,7 +16,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
16
16
|
var ResourcedEmojiComponent = (0, _reactLoadable.default)({
|
|
17
17
|
loader: function loader() {
|
|
18
18
|
return Promise.resolve().then(function () {
|
|
19
|
-
return _interopRequireWildcard(require('./ResourcedEmojiComponent'));
|
|
19
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_resourcedEmojiComponent" */'./ResourcedEmojiComponent'));
|
|
20
20
|
}).then(function (component) {
|
|
21
21
|
return component.ResourcedEmojiComponent;
|
|
22
22
|
});
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.ResourcedEmojiComponent = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -22,13 +23,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
22
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
24
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { 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); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
26
|
-
var ResourcedEmojiComponentRenderStatesEnum;
|
|
27
|
-
(function (ResourcedEmojiComponentRenderStatesEnum) {
|
|
26
|
+
var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEmojiComponentRenderStatesEnum) {
|
|
28
27
|
ResourcedEmojiComponentRenderStatesEnum["INITIAL"] = "INITIAL";
|
|
29
28
|
ResourcedEmojiComponentRenderStatesEnum["FALLBACK"] = "FALLBACK";
|
|
30
29
|
ResourcedEmojiComponentRenderStatesEnum["EMOJI"] = "EMOJI";
|
|
31
|
-
|
|
30
|
+
return ResourcedEmojiComponentRenderStatesEnum;
|
|
31
|
+
}(ResourcedEmojiComponentRenderStatesEnum || {});
|
|
32
32
|
var ResourcedEmojiComponent = function ResourcedEmojiComponent(props) {
|
|
33
33
|
var emojiProvider = props.emojiProvider,
|
|
34
34
|
emojiId = props.emojiId,
|
|
@@ -62,50 +62,34 @@ var ResourcedEmojiComponent = function ResourcedEmojiComponent(props) {
|
|
|
62
62
|
resolvedEmojiProvider = _useState8[0],
|
|
63
63
|
setResolvedEmojiProvider = _useState8[1];
|
|
64
64
|
var fetchOrGetEmoji = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
65
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
65
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_emojiProvider, emojiId) {
|
|
66
66
|
var optimisticFetch,
|
|
67
67
|
foundEmoji,
|
|
68
68
|
_args = arguments;
|
|
69
|
-
return
|
|
70
|
-
while (1) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
// emoji is undefined
|
|
91
|
-
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).failure({
|
|
92
|
-
metadata: {
|
|
93
|
-
reason: 'failed to find',
|
|
94
|
-
source: 'ResourcedEmojiComponent',
|
|
95
|
-
data: {
|
|
96
|
-
emoji: {
|
|
97
|
-
id: emojiId.id,
|
|
98
|
-
shortName: emojiId.shortName
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}).catch(function () {
|
|
105
|
-
setEmoji(undefined);
|
|
69
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
70
|
+
while (1) switch (_context.prev = _context.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
optimisticFetch = _args.length > 2 && _args[2] !== undefined ? _args[2] : false;
|
|
73
|
+
if (!_emojiProvider.fetchByEmojiId) {
|
|
74
|
+
setEmoji(undefined);
|
|
75
|
+
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).failure({
|
|
76
|
+
metadata: {
|
|
77
|
+
reason: 'missing fetchByEmojiId interface',
|
|
78
|
+
source: 'ResourcedEmojiComponent'
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
foundEmoji = _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
83
|
+
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).mark(_types.UfoEmojiTimings.METADATA_START);
|
|
84
|
+
if ((0, _typeHelpers.isPromise)(foundEmoji)) {
|
|
85
|
+
setLoaded(false);
|
|
86
|
+
foundEmoji.then(function (emoji) {
|
|
87
|
+
setEmoji(emoji);
|
|
88
|
+
if (!emoji) {
|
|
89
|
+
// emoji is undefined
|
|
106
90
|
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).failure({
|
|
107
91
|
metadata: {
|
|
108
|
-
reason: 'failed to
|
|
92
|
+
reason: 'failed to find',
|
|
109
93
|
source: 'ResourcedEmojiComponent',
|
|
110
94
|
data: {
|
|
111
95
|
emoji: {
|
|
@@ -115,19 +99,33 @@ var ResourcedEmojiComponent = function ResourcedEmojiComponent(props) {
|
|
|
115
99
|
}
|
|
116
100
|
}
|
|
117
101
|
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
102
|
+
}
|
|
103
|
+
}).catch(function () {
|
|
104
|
+
setEmoji(undefined);
|
|
105
|
+
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).failure({
|
|
106
|
+
metadata: {
|
|
107
|
+
reason: 'failed to load',
|
|
108
|
+
source: 'ResourcedEmojiComponent',
|
|
109
|
+
data: {
|
|
110
|
+
emoji: {
|
|
111
|
+
id: emojiId.id,
|
|
112
|
+
shortName: emojiId.shortName
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
121
116
|
});
|
|
122
|
-
}
|
|
123
|
-
setEmoji(foundEmoji);
|
|
117
|
+
}).finally(function () {
|
|
124
118
|
setLoaded(true);
|
|
125
119
|
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).mark(_types.UfoEmojiTimings.METADATA_END);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
120
|
+
});
|
|
121
|
+
} else {
|
|
122
|
+
setEmoji(foundEmoji);
|
|
123
|
+
setLoaded(true);
|
|
124
|
+
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).mark(_types.UfoEmojiTimings.METADATA_END);
|
|
125
|
+
}
|
|
126
|
+
case 5:
|
|
127
|
+
case "end":
|
|
128
|
+
return _context.stop();
|
|
131
129
|
}
|
|
132
130
|
}, _callee);
|
|
133
131
|
}));
|
|
@@ -33,6 +33,7 @@ var Scrollable = /*#__PURE__*/function (_PureComponent) {
|
|
|
33
33
|
}
|
|
34
34
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
35
35
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scrollableDiv", null);
|
|
36
|
+
// API
|
|
36
37
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "reveal", function (child, forceToTop) {
|
|
37
38
|
if (child && _this.scrollableDiv) {
|
|
38
39
|
var childNode = (0, _reactDom.findDOMNode)(child);
|
|
@@ -67,7 +68,7 @@ var Scrollable = /*#__PURE__*/function (_PureComponent) {
|
|
|
67
68
|
_this.scrollableDiv = ref;
|
|
68
69
|
});
|
|
69
70
|
return _this;
|
|
70
|
-
}
|
|
71
|
+
}
|
|
71
72
|
(0, _createClass2.default)(Scrollable, [{
|
|
72
73
|
key: "render",
|
|
73
74
|
value: function render() {
|
|
@@ -13,7 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
16
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
19
|
var UfoErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UploadStatus = void 0;
|
|
7
|
-
var UploadStatus
|
|
8
|
-
exports.UploadStatus = UploadStatus;
|
|
9
|
-
(function (UploadStatus) {
|
|
7
|
+
var UploadStatus = /*#__PURE__*/function (UploadStatus) {
|
|
10
8
|
UploadStatus[UploadStatus["Waiting"] = 0] = "Waiting";
|
|
11
9
|
UploadStatus[UploadStatus["Uploading"] = 1] = "Uploading";
|
|
12
10
|
UploadStatus[UploadStatus["Error"] = 2] = "Error";
|
|
13
|
-
|
|
11
|
+
return UploadStatus;
|
|
12
|
+
}({});
|
|
13
|
+
exports.UploadStatus = UploadStatus;
|
|
@@ -30,7 +30,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /** @jsx jsx */
|
|
31
31
|
var emojiPickerModuleLoader = function emojiPickerModuleLoader() {
|
|
32
32
|
return Promise.resolve().then(function () {
|
|
33
|
-
return _interopRequireWildcard(require('./EmojiPickerComponent'));
|
|
33
|
+
return _interopRequireWildcard(require( /* webpackChunkName:"@atlaskit-internal_emojiPickerComponent" */'./EmojiPickerComponent'));
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
var emojiPickerLoader = function emojiPickerLoader() {
|
|
@@ -41,9 +41,6 @@ var emojiPickerLoader = function emojiPickerLoader() {
|
|
|
41
41
|
var EmojiPickerInternal = /*#__PURE__*/function (_LoadingEmojiComponen) {
|
|
42
42
|
(0, _inherits2.default)(EmojiPickerInternal, _LoadingEmojiComponen);
|
|
43
43
|
var _super = _createSuper(EmojiPickerInternal);
|
|
44
|
-
// state initialised with static component to prevent
|
|
45
|
-
// rerender when the module has already been loaded
|
|
46
|
-
|
|
47
44
|
function EmojiPickerInternal(props) {
|
|
48
45
|
var _this;
|
|
49
46
|
(0, _classCallCheck2.default)(this, EmojiPickerInternal);
|
|
@@ -95,6 +92,8 @@ var EmojiPickerInternal = /*#__PURE__*/function (_LoadingEmojiComponen) {
|
|
|
95
92
|
return EmojiPickerInternal;
|
|
96
93
|
}(_LoadingEmojiComponent.default);
|
|
97
94
|
exports.EmojiPickerInternal = EmojiPickerInternal;
|
|
95
|
+
// state initialised with static component to prevent
|
|
96
|
+
// rerender when the module has already been loaded
|
|
98
97
|
(0, _defineProperty2.default)(EmojiPickerInternal, "defaultProps", {
|
|
99
98
|
size: _constants.defaultEmojiPickerSize
|
|
100
99
|
});
|
|
@@ -240,6 +240,12 @@ var EmojiPickerVirtualListInternal = /*#__PURE__*/function (_PureComponent2) {
|
|
|
240
240
|
}
|
|
241
241
|
return category;
|
|
242
242
|
});
|
|
243
|
+
/**
|
|
244
|
+
* onRowsRendered callback function
|
|
245
|
+
*
|
|
246
|
+
* Check the category of top of rendered row and inform category selector to change active category
|
|
247
|
+
* Rove index of emoji picker list
|
|
248
|
+
*/
|
|
243
249
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onRowsRendered", function (indexes) {
|
|
244
250
|
var startIndex = indexes.startIndex;
|
|
245
251
|
var rowItem = _this.virtualItems[startIndex];
|
|
@@ -270,6 +276,11 @@ var EmojiPickerVirtualListInternal = /*#__PURE__*/function (_PureComponent2) {
|
|
|
270
276
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderRow", function (context) {
|
|
271
277
|
return (0, _EmojiPickerVirtualItems.virtualItemRenderer)(_this.virtualItems, context);
|
|
272
278
|
});
|
|
279
|
+
/**
|
|
280
|
+
* After deleting emoji, we'll update the focus index to the first emoji of last row of your uploads, so when user navigate back focus will still work
|
|
281
|
+
* if last emoji in your uploads is deleted, the updated focus index will be outdated, as there will be no your uploads section
|
|
282
|
+
* however, it'll trigger onChange from VirtualList, which will update focus index automatically for us
|
|
283
|
+
*/
|
|
273
284
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOnCloseDelete", function () {
|
|
274
285
|
var list = _this.listRef.current;
|
|
275
286
|
list === null || list === void 0 ? void 0 : list.updateFocusIndex(_this.lastYourUploadsRow);
|
|
@@ -338,19 +349,6 @@ var EmojiPickerVirtualListInternal = /*#__PURE__*/function (_PureComponent2) {
|
|
|
338
349
|
}
|
|
339
350
|
}
|
|
340
351
|
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* onRowsRendered callback function
|
|
344
|
-
*
|
|
345
|
-
* Check the category of top of rendered row and inform category selector to change active category
|
|
346
|
-
* Rove index of emoji picker list
|
|
347
|
-
*/
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* After deleting emoji, we'll update the focus index to the first emoji of last row of your uploads, so when user navigate back focus will still work
|
|
351
|
-
* if last emoji in your uploads is deleted, the updated focus index will be outdated, as there will be no your uploads section
|
|
352
|
-
* however, it'll trigger onChange from VirtualList, which will update focus index automatically for us
|
|
353
|
-
*/
|
|
354
352
|
}, {
|
|
355
353
|
key: "render",
|
|
356
354
|
value: function render() {
|
|
@@ -26,7 +26,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
var emojiTypeAheadModuleLoader = function emojiTypeAheadModuleLoader() {
|
|
28
28
|
return Promise.resolve().then(function () {
|
|
29
|
-
return _interopRequireWildcard(require('./EmojiTypeAheadComponent'));
|
|
29
|
+
return _interopRequireWildcard(require( /* webpackChunkName:"@atlaskit-internal_emojiTypeAheadComponent" */'./EmojiTypeAheadComponent'));
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
var emojiTypeAheadComponentLoader = function emojiTypeAheadComponentLoader() {
|
|
@@ -37,13 +37,12 @@ var emojiTypeAheadComponentLoader = function emojiTypeAheadComponentLoader() {
|
|
|
37
37
|
var EmojiTypeahead = /*#__PURE__*/function (_LoadingEmojiComponen) {
|
|
38
38
|
(0, _inherits2.default)(EmojiTypeahead, _LoadingEmojiComponen);
|
|
39
39
|
var _super = _createSuper(EmojiTypeahead);
|
|
40
|
-
// state initialised with static component to prevent
|
|
41
|
-
// rerender when the module has already been loaded
|
|
42
|
-
|
|
43
40
|
function EmojiTypeahead(props) {
|
|
44
41
|
var _this;
|
|
45
42
|
(0, _classCallCheck2.default)(this, EmojiTypeahead);
|
|
46
43
|
_this = _super.call(this, props, {});
|
|
44
|
+
// state initialised with static component to prevent
|
|
45
|
+
// rerender when the module has already been loaded
|
|
47
46
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
48
47
|
asyncLoadedComponent: EmojiTypeahead.AsyncLoadedComponent
|
|
49
48
|
});
|
|
@@ -28,7 +28,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
28
28
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
29
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
30
30
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
31
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /** @jsx jsx */
|
|
32
32
|
var isFullShortName = function isFullShortName(query) {
|
|
33
33
|
return query && query.length > 1 && query.charAt(0) === ':' && query.charAt(query.length - 1) === ':';
|
|
34
34
|
};
|
|
@@ -34,6 +34,7 @@ var EmojiTypeAheadItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
34
34
|
args[_key] = arguments[_key];
|
|
35
35
|
}
|
|
36
36
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
37
|
+
// internal, used for callbacks
|
|
37
38
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEmojiSelected", function (event) {
|
|
38
39
|
var _this$props = _this.props,
|
|
39
40
|
emoji = _this$props.emoji,
|
|
@@ -52,7 +53,7 @@ var EmojiTypeAheadItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
52
53
|
}
|
|
53
54
|
});
|
|
54
55
|
return _this;
|
|
55
|
-
}
|
|
56
|
+
}
|
|
56
57
|
(0, _createClass2.default)(EmojiTypeAheadItem, [{
|
|
57
58
|
key: "render",
|
|
58
59
|
value: function render() {
|
|
@@ -52,6 +52,7 @@ var EmojiTypeAheadList = /*#__PURE__*/function (_PureComponent) {
|
|
|
52
52
|
var _this;
|
|
53
53
|
(0, _classCallCheck2.default)(this, EmojiTypeAheadList);
|
|
54
54
|
_this = _super.call(this, props);
|
|
55
|
+
// API
|
|
55
56
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectNext", function () {
|
|
56
57
|
var newIndex = wrapIndex(_this.props.emojis, _this.state.selectedIndex + 1);
|
|
57
58
|
_this.selectIndex(newIndex);
|
|
@@ -127,8 +128,6 @@ var EmojiTypeAheadList = /*#__PURE__*/function (_PureComponent) {
|
|
|
127
128
|
this.revealItem(selectedEmoji.id || selectedEmoji.shortName);
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
-
// API
|
|
132
131
|
}, {
|
|
133
132
|
key: "revealItem",
|
|
134
133
|
value:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = require("react");
|
|
@@ -18,7 +18,8 @@ var _analytics = require("../../util/analytics");
|
|
|
18
18
|
var _styles = require("./styles");
|
|
19
19
|
var _ufoExperiences = require("../../util/analytics/ufoExperiences");
|
|
20
20
|
var _i18n = require("../i18n");
|
|
21
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; 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; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; 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); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { 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); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; 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; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } /** @jsx jsx */
|
|
21
|
+
/** @jsx jsx */
|
|
22
|
+
|
|
22
23
|
var EmojiUploadComponent = function EmojiUploadComponent(props) {
|
|
23
24
|
var emojiProvider = props.emojiProvider,
|
|
24
25
|
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
@@ -43,49 +44,47 @@ var EmojiUploadComponent = function EmojiUploadComponent(props) {
|
|
|
43
44
|
};
|
|
44
45
|
}, []);
|
|
45
46
|
var onUploadEmoji = /*#__PURE__*/function () {
|
|
46
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
47
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(upload, retry, onSuccessHandler) {
|
|
47
48
|
var errorSetter, message;
|
|
48
|
-
return
|
|
49
|
-
while (1) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (!(0, _EmojiResource.supportsUploadFeature)(emojiProvider)) {
|
|
57
|
-
_context.next = 16;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
fireAnalytics((0, _analytics.uploadConfirmButton)({
|
|
61
|
-
retry: retry
|
|
62
|
-
}));
|
|
63
|
-
_context.prev = 4;
|
|
64
|
-
_context.next = 7;
|
|
65
|
-
return emojiProvider.prepareForUpload();
|
|
66
|
-
case 7:
|
|
67
|
-
errorSetter = function errorSetter(message) {
|
|
68
|
-
setUploadErrorMessage(message);
|
|
69
|
-
}; // internally handled error from upload callback
|
|
70
|
-
(0, _UploadEmoji.uploadEmoji)(upload, emojiProvider, errorSetter, onUploaded(onSuccessHandler), fireAnalytics, retry);
|
|
49
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
50
|
+
while (1) switch (_context.prev = _context.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
_ufoExperiences.ufoExperiences['emoji-uploaded'].start();
|
|
53
|
+
_ufoExperiences.ufoExperiences['emoji-uploaded'].addMetadata({
|
|
54
|
+
retry: retry
|
|
55
|
+
});
|
|
56
|
+
if (!(0, _EmojiResource.supportsUploadFeature)(emojiProvider)) {
|
|
71
57
|
_context.next = 16;
|
|
72
58
|
break;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
59
|
+
}
|
|
60
|
+
fireAnalytics((0, _analytics.uploadConfirmButton)({
|
|
61
|
+
retry: retry
|
|
62
|
+
}));
|
|
63
|
+
_context.prev = 4;
|
|
64
|
+
_context.next = 7;
|
|
65
|
+
return emojiProvider.prepareForUpload();
|
|
66
|
+
case 7:
|
|
67
|
+
errorSetter = function errorSetter(message) {
|
|
68
|
+
setUploadErrorMessage(message);
|
|
69
|
+
}; // internally handled error from upload callback
|
|
70
|
+
(0, _UploadEmoji.uploadEmoji)(upload, emojiProvider, errorSetter, onUploaded(onSuccessHandler), fireAnalytics, retry);
|
|
71
|
+
_context.next = 16;
|
|
72
|
+
break;
|
|
73
|
+
case 11:
|
|
74
|
+
_context.prev = 11;
|
|
75
|
+
_context.t0 = _context["catch"](4);
|
|
76
|
+
// error from upload token generation
|
|
77
|
+
message = _context.t0 instanceof Error ? _context.t0.message : 'Issue with generating upload token';
|
|
78
|
+
_ufoExperiences.ufoExperiences['emoji-uploaded'].failure({
|
|
79
|
+
metadata: {
|
|
80
|
+
source: 'EmojiUploadComponent',
|
|
81
|
+
error: message
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
setUploadErrorMessage(_i18n.messages.emojiUploadFailed);
|
|
85
|
+
case 16:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context.stop();
|
|
89
88
|
}
|
|
90
89
|
}, _callee, null, [[4, 11]]);
|
|
91
90
|
}));
|