@atlaskit/reactions 22.2.8 → 22.2.9
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 +6 -0
- package/dist/cjs/MockReactionsClient.js +112 -121
- package/dist/cjs/analytics/ufo.js +12 -12
- package/dist/cjs/client/ReactionServiceClient.js +5 -6
- package/dist/cjs/components/Reaction/Reaction.js +21 -21
- package/dist/cjs/components/ReactionDialog/ReactionView.js +24 -25
- package/dist/cjs/components/UfoErrorBoundary/UfoErrorBoundary.js +1 -1
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +13 -16
- package/dist/cjs/containers/ConnectedReactionsView/ConnectedReactionsView.js +43 -49
- package/dist/cjs/store/MemoryReactionsStore.js +10 -14
- package/dist/cjs/store/ReactionConsumer.js +22 -25
- package/dist/cjs/types/reaction.js +8 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/ufo.js +11 -11
- package/dist/es2019/client/ReactionServiceClient.js +5 -7
- package/dist/es2019/store/MemoryReactionsStore.js +10 -15
- package/dist/es2019/store/ReactionConsumer.js +11 -15
- package/dist/es2019/types/reaction.js +8 -7
- package/dist/es2019/version.json +1 -1
- package/dist/esm/MockReactionsClient.js +112 -121
- package/dist/esm/analytics/ufo.js +11 -11
- package/dist/esm/client/ReactionServiceClient.js +5 -6
- package/dist/esm/components/Reaction/Reaction.js +19 -22
- package/dist/esm/components/ReactionDialog/ReactionView.js +22 -25
- package/dist/esm/components/UfoErrorBoundary/UfoErrorBoundary.js +1 -1
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +13 -16
- package/dist/esm/containers/ConnectedReactionsView/ConnectedReactionsView.js +43 -50
- package/dist/esm/store/MemoryReactionsStore.js +10 -14
- package/dist/esm/store/ReactionConsumer.js +22 -25
- package/dist/esm/types/reaction.js +8 -7
- package/dist/esm/version.json +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,16 @@
|
|
|
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.ConnectedReactionPicker = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _components = require("../../components");
|
|
13
13
|
var _analytics = require("../../analytics");
|
|
14
|
-
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; }
|
|
15
14
|
/**
|
|
16
15
|
* Reaction Picker component
|
|
17
16
|
*/
|
|
@@ -24,21 +23,19 @@ var ConnectedReactionPicker = function ConnectedReactionPicker(props) {
|
|
|
24
23
|
* @param emojiId unique id for the reaction emoji
|
|
25
24
|
*/
|
|
26
25
|
var onSelection = function onSelection(emojiId) {
|
|
27
|
-
(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
26
|
+
(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
28
27
|
var _store;
|
|
29
|
-
return
|
|
30
|
-
while (1) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return _context.stop();
|
|
41
|
-
}
|
|
28
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
_context.next = 2;
|
|
32
|
+
return Promise.resolve(store);
|
|
33
|
+
case 2:
|
|
34
|
+
_store = _context.sent;
|
|
35
|
+
_store.addReaction(containerAri, ari, emojiId);
|
|
36
|
+
case 4:
|
|
37
|
+
case "end":
|
|
38
|
+
return _context.stop();
|
|
42
39
|
}
|
|
43
40
|
}, _callee);
|
|
44
41
|
}))();
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.mapStateToPropsHelper = exports.mapDispatchToPropsHelper = exports.ConnectedReactionsView = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -19,7 +20,6 @@ var _types = require("../../types");
|
|
|
19
20
|
var _excluded = ["ari", "containerAri", "store"];
|
|
20
21
|
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); }
|
|
21
22
|
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; }
|
|
22
|
-
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; }
|
|
23
23
|
/**
|
|
24
24
|
* State Props required for <Reactions />
|
|
25
25
|
*/
|
|
@@ -135,27 +135,25 @@ var ConnectedReactionsView = function ConnectedReactionsView(props) {
|
|
|
135
135
|
return mapDispatchToPropsHelper(actions, containerAri, ari);
|
|
136
136
|
}, [ari, containerAri]);
|
|
137
137
|
(0, _react.useEffect)(function () {
|
|
138
|
-
(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
138
|
+
(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
139
139
|
var _store, state, dispatch;
|
|
140
|
-
return
|
|
141
|
-
while (1) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return _context.stop();
|
|
158
|
-
}
|
|
140
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
141
|
+
while (1) switch (_context.prev = _context.next) {
|
|
142
|
+
case 0:
|
|
143
|
+
_context.next = 2;
|
|
144
|
+
return Promise.resolve(store);
|
|
145
|
+
case 2:
|
|
146
|
+
_store = _context.sent;
|
|
147
|
+
if (_store.setCreateAnalyticsEvent && createAnalyticsEvent) {
|
|
148
|
+
_store.setCreateAnalyticsEvent(createAnalyticsEvent);
|
|
149
|
+
}
|
|
150
|
+
state = mapStateToProps(_store.getState());
|
|
151
|
+
dispatch = mapDispatchToProps(_store);
|
|
152
|
+
setStateData(state);
|
|
153
|
+
setDispatchData(dispatch);
|
|
154
|
+
case 8:
|
|
155
|
+
case "end":
|
|
156
|
+
return _context.stop();
|
|
159
157
|
}
|
|
160
158
|
}, _callee);
|
|
161
159
|
}))();
|
|
@@ -171,40 +169,36 @@ var ConnectedReactionsView = function ConnectedReactionsView(props) {
|
|
|
171
169
|
var stateProps = mapStateToProps(state);
|
|
172
170
|
setStateData(stateProps);
|
|
173
171
|
};
|
|
174
|
-
(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
172
|
+
(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
175
173
|
var _store;
|
|
176
|
-
return
|
|
177
|
-
while (1) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return _context2.stop();
|
|
188
|
-
}
|
|
174
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
175
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
176
|
+
case 0:
|
|
177
|
+
_context2.next = 2;
|
|
178
|
+
return Promise.resolve(store);
|
|
179
|
+
case 2:
|
|
180
|
+
_store = _context2.sent;
|
|
181
|
+
_store.onChange(onChangeCallback);
|
|
182
|
+
case 4:
|
|
183
|
+
case "end":
|
|
184
|
+
return _context2.stop();
|
|
189
185
|
}
|
|
190
186
|
}, _callee2);
|
|
191
187
|
}))();
|
|
192
188
|
return function cleanup() {
|
|
193
|
-
(0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
189
|
+
(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
194
190
|
var _store;
|
|
195
|
-
return
|
|
196
|
-
while (1) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
return _context3.stop();
|
|
207
|
-
}
|
|
191
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
192
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
193
|
+
case 0:
|
|
194
|
+
_context3.next = 2;
|
|
195
|
+
return Promise.resolve(store);
|
|
196
|
+
case 2:
|
|
197
|
+
_store = _context3.sent;
|
|
198
|
+
_store.removeOnChangeListener(onChangeCallback);
|
|
199
|
+
case 4:
|
|
200
|
+
case "end":
|
|
201
|
+
return _context3.stop();
|
|
208
202
|
}
|
|
209
203
|
}, _callee3);
|
|
210
204
|
}))();
|
|
@@ -49,22 +49,28 @@ var ufoExperiences = {
|
|
|
49
49
|
*/
|
|
50
50
|
exports.ufoExperiences = ufoExperiences;
|
|
51
51
|
var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
52
|
-
/**
|
|
53
|
-
* default initial store data
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
52
|
function MemoryReactionsStore(client, state, metadata) {
|
|
57
53
|
var _this = this;
|
|
58
54
|
(0, _classCallCheck2.default)(this, MemoryReactionsStore);
|
|
59
55
|
(0, _defineProperty2.default)(this, "callbacks", []);
|
|
56
|
+
/**
|
|
57
|
+
* default initial store data
|
|
58
|
+
*/
|
|
60
59
|
(0, _defineProperty2.default)(this, "initialState", {
|
|
61
60
|
reactions: {},
|
|
62
61
|
flash: {}
|
|
63
62
|
});
|
|
63
|
+
/**
|
|
64
|
+
* Update the store state data with a new data
|
|
65
|
+
* @param newState new store data
|
|
66
|
+
*/
|
|
64
67
|
(0, _defineProperty2.default)(this, "setState", function (newState) {
|
|
65
68
|
_this.state = _objectSpread(_objectSpread({}, _this.state), newState);
|
|
66
69
|
_this.triggerOnChange();
|
|
67
70
|
});
|
|
71
|
+
/**
|
|
72
|
+
* Calls any onChange callbacks in the store using latest state data.
|
|
73
|
+
*/
|
|
68
74
|
(0, _defineProperty2.default)(this, "triggerOnChange", (0, _batched.batch)(function () {
|
|
69
75
|
return _this.callbacks.forEach(function (callback) {
|
|
70
76
|
return callback(_this.state);
|
|
@@ -243,7 +249,6 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
243
249
|
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
244
250
|
reactions: _objectSpread(_objectSpread({}, _this.state.reactions), reactionsState)
|
|
245
251
|
}));
|
|
246
|
-
return Promise.reject(error);
|
|
247
252
|
});
|
|
248
253
|
}));
|
|
249
254
|
(0, _defineProperty2.default)(this, "toggleReaction", this.withReaction(this.doRemoveReaction, this.doAddReaction));
|
|
@@ -287,15 +292,6 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
287
292
|
this.state = state !== null && state !== void 0 ? state : this.initialState;
|
|
288
293
|
this.metadata = metadata;
|
|
289
294
|
}
|
|
290
|
-
|
|
291
|
-
/**
|
|
292
|
-
* Update the store state data with a new data
|
|
293
|
-
* @param newState new store data
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Calls any onChange callbacks in the store using latest state data.
|
|
298
|
-
*/
|
|
299
295
|
(0, _createClass2.default)(MemoryReactionsStore, [{
|
|
300
296
|
key: "getReactionsState",
|
|
301
297
|
value: function getReactionsState(containerAri, ari) {
|
|
@@ -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.ReactionConsumer = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -15,7 +15,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
15
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
|
-
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; }
|
|
19
18
|
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); }; }
|
|
20
19
|
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; } }
|
|
21
20
|
/**
|
|
@@ -35,6 +34,9 @@ var ReactionConsumer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
35
34
|
var _this;
|
|
36
35
|
(0, _classCallCheck2.default)(this, ReactionConsumer);
|
|
37
36
|
_this = _super.call(this, props);
|
|
37
|
+
/**
|
|
38
|
+
* Get the actions the child component might need to dispatch from its props
|
|
39
|
+
*/
|
|
38
40
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPropsFromActions", function (actions) {
|
|
39
41
|
var mapActionsToProps = _this.props.mapActionsToProps;
|
|
40
42
|
if (mapActionsToProps) {
|
|
@@ -45,10 +47,18 @@ var ReactionConsumer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
45
47
|
_this.previousActions = actions;
|
|
46
48
|
return _this.propsFromActions;
|
|
47
49
|
});
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @param state Internal state data
|
|
53
|
+
* @returns object containing the data that the connected component needs
|
|
54
|
+
*/
|
|
48
55
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPropsFromState", function (state) {
|
|
49
56
|
var mapStateToProps = _this.props.mapStateToProps;
|
|
50
57
|
return mapStateToProps ? mapStateToProps(state) : undefined;
|
|
51
58
|
});
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
*/
|
|
52
62
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOnChange", function () {
|
|
53
63
|
_this.forceUpdate();
|
|
54
64
|
});
|
|
@@ -71,18 +81,16 @@ var ReactionConsumer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
71
81
|
}, {
|
|
72
82
|
key: "componentWillUnmount",
|
|
73
83
|
value: function () {
|
|
74
|
-
var _componentWillUnmount = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
75
|
-
return
|
|
76
|
-
while (1) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return _context.stop();
|
|
85
|
-
}
|
|
84
|
+
var _componentWillUnmount = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
85
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
86
|
+
while (1) switch (_context.prev = _context.next) {
|
|
87
|
+
case 0:
|
|
88
|
+
if (this.state.store) {
|
|
89
|
+
this.state.store.removeOnChangeListener(this.handleOnChange);
|
|
90
|
+
}
|
|
91
|
+
case 1:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
86
94
|
}
|
|
87
95
|
}, _callee, this);
|
|
88
96
|
}));
|
|
@@ -91,17 +99,6 @@ var ReactionConsumer = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
91
99
|
}
|
|
92
100
|
return componentWillUnmount;
|
|
93
101
|
}()
|
|
94
|
-
/**
|
|
95
|
-
* Get the actions the child component might need to dispatch from its props
|
|
96
|
-
*/
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* @param state Internal state data
|
|
100
|
-
* @returns object containing the data that the connected component needs
|
|
101
|
-
*/
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
102
|
}, {
|
|
106
103
|
key: "render",
|
|
107
104
|
value: function render() {
|
|
@@ -36,18 +36,18 @@ exports.ReactionStatus = void 0;
|
|
|
36
36
|
/**
|
|
37
37
|
* Condition of the reaction when gets loaded from the store
|
|
38
38
|
*/
|
|
39
|
-
var ReactionStatus
|
|
40
|
-
/**
|
|
41
|
-
* state in which the reaction is at
|
|
42
|
-
*/
|
|
43
|
-
exports.ReactionStatus = ReactionStatus;
|
|
44
|
-
(function (ReactionStatus) {
|
|
39
|
+
var ReactionStatus = /*#__PURE__*/function (ReactionStatus) {
|
|
45
40
|
ReactionStatus["ready"] = "READY";
|
|
46
41
|
ReactionStatus["loading"] = "LOADING";
|
|
47
42
|
ReactionStatus["error"] = "ERROR";
|
|
48
43
|
ReactionStatus["notLoaded"] = "NOT_LOADED";
|
|
49
44
|
ReactionStatus["disabled"] = "DISABLED";
|
|
50
|
-
|
|
45
|
+
return ReactionStatus;
|
|
46
|
+
}({});
|
|
47
|
+
/**
|
|
48
|
+
* state in which the reaction is at
|
|
49
|
+
*/
|
|
51
50
|
/**
|
|
52
51
|
* Source where the emoji selected from ("quickSelector" -> default list, "emojiPicker" -> custom emoji list)
|
|
53
|
-
*/
|
|
52
|
+
*/
|
|
53
|
+
exports.ReactionStatus = ReactionStatus;
|
package/dist/cjs/version.json
CHANGED
|
@@ -22,12 +22,7 @@ const createExperienceConfig = (componentName, type, performanceType) => {
|
|
|
22
22
|
/**
|
|
23
23
|
* Types of experiences
|
|
24
24
|
*/
|
|
25
|
-
export let ExperienceName
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* UFO types of components been instrumented
|
|
29
|
-
*/
|
|
30
|
-
(function (ExperienceName) {
|
|
25
|
+
export let ExperienceName = /*#__PURE__*/function (ExperienceName) {
|
|
31
26
|
ExperienceName["REACTIONS_RENDERED"] = "reactions-rendered";
|
|
32
27
|
ExperienceName["PICKER_OPENED"] = "reactions-picker-opened";
|
|
33
28
|
ExperienceName["REACTION_ADDED"] = "reaction-added";
|
|
@@ -36,18 +31,23 @@ export let ExperienceName;
|
|
|
36
31
|
ExperienceName["REACTION_DIALOG_OPENED"] = "reaction-dialog-opened";
|
|
37
32
|
ExperienceName["REACTION_DIALOG_CLOSED"] = "reaction-dialog-closed";
|
|
38
33
|
ExperienceName["REACTION_DIALOG_SELECTED_REACTION_CHANGED"] = "reaction-dialog-selected-reaction-changed";
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
return ExperienceName;
|
|
35
|
+
}({});
|
|
41
36
|
|
|
42
37
|
/**
|
|
43
|
-
*
|
|
38
|
+
* UFO types of components been instrumented
|
|
44
39
|
*/
|
|
45
|
-
|
|
40
|
+
export let ComponentName = /*#__PURE__*/function (ComponentName) {
|
|
46
41
|
ComponentName["PICKER_RENDERED"] = "reactions-picker";
|
|
47
42
|
ComponentName["REACTIONS"] = "reactions-list";
|
|
48
43
|
ComponentName["REACTION_ITEM"] = "reaction-item";
|
|
49
44
|
ComponentName["REACTION_DIALOG"] = "reaction-dialog";
|
|
50
|
-
|
|
45
|
+
return ComponentName;
|
|
46
|
+
}({});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Experience when the emoji picker is opened
|
|
50
|
+
*/
|
|
51
51
|
export const PickerRender = new UFOExperience(ExperienceName.PICKER_OPENED, createExperienceConfig(ComponentName.PICKER_RENDERED, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
52
52
|
|
|
53
53
|
/**
|
|
@@ -18,6 +18,11 @@ export class ReactionServiceClient {
|
|
|
18
18
|
* @param sessionToken oAuth token for reactions emoji services
|
|
19
19
|
*/
|
|
20
20
|
constructor(baseUrl, sessionToken) {
|
|
21
|
+
/**
|
|
22
|
+
* Send a request to remote service
|
|
23
|
+
* @param path endpoint api url
|
|
24
|
+
* @param options Optional custom params
|
|
25
|
+
*/
|
|
21
26
|
_defineProperty(this, "requestService", (path, options) => utils.requestService(this.serviceConfig, {
|
|
22
27
|
...options,
|
|
23
28
|
path
|
|
@@ -41,13 +46,6 @@ export class ReactionServiceClient {
|
|
|
41
46
|
}
|
|
42
47
|
return headers;
|
|
43
48
|
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Send a request to remote service
|
|
47
|
-
* @param path endpoint api url
|
|
48
|
-
* @param options Optional custom params
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
49
|
getReactions(containerAri, aris) {
|
|
52
50
|
if (aris.length === 0) {
|
|
53
51
|
return Promise.resolve({});
|
|
@@ -35,16 +35,19 @@ export const ufoExperiences = {
|
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
37
|
export class MemoryReactionsStore {
|
|
38
|
-
/**
|
|
39
|
-
* default initial store data
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
38
|
constructor(client, state, metadata) {
|
|
43
39
|
_defineProperty(this, "callbacks", []);
|
|
40
|
+
/**
|
|
41
|
+
* default initial store data
|
|
42
|
+
*/
|
|
44
43
|
_defineProperty(this, "initialState", {
|
|
45
44
|
reactions: {},
|
|
46
45
|
flash: {}
|
|
47
46
|
});
|
|
47
|
+
/**
|
|
48
|
+
* Update the store state data with a new data
|
|
49
|
+
* @param newState new store data
|
|
50
|
+
*/
|
|
48
51
|
_defineProperty(this, "setState", newState => {
|
|
49
52
|
this.state = {
|
|
50
53
|
...this.state,
|
|
@@ -52,6 +55,9 @@ export class MemoryReactionsStore {
|
|
|
52
55
|
};
|
|
53
56
|
this.triggerOnChange();
|
|
54
57
|
});
|
|
58
|
+
/**
|
|
59
|
+
* Calls any onChange callbacks in the store using latest state data.
|
|
60
|
+
*/
|
|
55
61
|
_defineProperty(this, "triggerOnChange", batch(() => this.callbacks.forEach(callback => callback(this.state))));
|
|
56
62
|
_defineProperty(this, "setReactions", (containerAri, ari, reactions) => {
|
|
57
63
|
this.setState({
|
|
@@ -237,7 +243,6 @@ export class MemoryReactionsStore {
|
|
|
237
243
|
...reactionsState
|
|
238
244
|
}
|
|
239
245
|
});
|
|
240
|
-
return Promise.reject(error);
|
|
241
246
|
});
|
|
242
247
|
}));
|
|
243
248
|
_defineProperty(this, "toggleReaction", this.withReaction(this.doRemoveReaction, this.doAddReaction));
|
|
@@ -277,16 +282,6 @@ export class MemoryReactionsStore {
|
|
|
277
282
|
this.state = state !== null && state !== void 0 ? state : this.initialState;
|
|
278
283
|
this.metadata = metadata;
|
|
279
284
|
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Update the store state data with a new data
|
|
283
|
-
* @param newState new store data
|
|
284
|
-
*/
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Calls any onChange callbacks in the store using latest state data.
|
|
288
|
-
*/
|
|
289
|
-
|
|
290
285
|
getReactionsState(containerAri, ari) {
|
|
291
286
|
return this.state.reactions[`${containerAri}|${ari}`];
|
|
292
287
|
}
|
|
@@ -16,6 +16,9 @@ import React from 'react';
|
|
|
16
16
|
export class ReactionConsumer extends React.PureComponent {
|
|
17
17
|
constructor(props) {
|
|
18
18
|
super(props);
|
|
19
|
+
/**
|
|
20
|
+
* Get the actions the child component might need to dispatch from its props
|
|
21
|
+
*/
|
|
19
22
|
_defineProperty(this, "getPropsFromActions", actions => {
|
|
20
23
|
const {
|
|
21
24
|
mapActionsToProps
|
|
@@ -28,12 +31,20 @@ export class ReactionConsumer extends React.PureComponent {
|
|
|
28
31
|
this.previousActions = actions;
|
|
29
32
|
return this.propsFromActions;
|
|
30
33
|
});
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param state Internal state data
|
|
37
|
+
* @returns object containing the data that the connected component needs
|
|
38
|
+
*/
|
|
31
39
|
_defineProperty(this, "getPropsFromState", state => {
|
|
32
40
|
const {
|
|
33
41
|
mapStateToProps
|
|
34
42
|
} = this.props;
|
|
35
43
|
return mapStateToProps ? mapStateToProps(state) : undefined;
|
|
36
44
|
});
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
37
48
|
_defineProperty(this, "handleOnChange", () => {
|
|
38
49
|
this.forceUpdate();
|
|
39
50
|
});
|
|
@@ -54,21 +65,6 @@ export class ReactionConsumer extends React.PureComponent {
|
|
|
54
65
|
this.state.store.removeOnChangeListener(this.handleOnChange);
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Get the actions the child component might need to dispatch from its props
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
* @param state Internal state data
|
|
65
|
-
* @returns object containing the data that the connected component needs
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
68
|
render() {
|
|
73
69
|
if (!this.state.store) {
|
|
74
70
|
return null;
|