@atlaskit/media-card 74.7.3 → 74.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/card/card.js +99 -108
  3. package/dist/cjs/card/cardLoader.js +3 -3
  4. package/dist/cjs/card/cardView.js +6 -7
  5. package/dist/cjs/card/getCardPreview/helpers.js +108 -117
  6. package/dist/cjs/card/getCardPreview/index.js +99 -104
  7. package/dist/cjs/card/inlinePlayer.js +92 -97
  8. package/dist/cjs/card/inlinePlayerLazy.js +19 -20
  9. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  10. package/dist/cjs/card/ui/common.js +4 -4
  11. package/dist/cjs/inline/loader.js +50 -52
  12. package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +59 -9
  13. package/dist/cjs/types.js +4 -4
  14. package/dist/cjs/utils/cardActions/cardActionIconButton.js +2 -3
  15. package/dist/cjs/utils/cardActions/styles.js +4 -4
  16. package/dist/cjs/utils/ufoExperiences.js +1 -1
  17. package/dist/cjs/utils/videoSnapshot.js +41 -44
  18. package/dist/cjs/utils/viewportDetector.js +1 -1
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/card/card.js +6 -7
  21. package/dist/es2019/card/cardView.js +2 -3
  22. package/dist/es2019/card/inlinePlayer.js +1 -3
  23. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  24. package/dist/es2019/card/ui/common.js +3 -3
  25. package/dist/es2019/inline/loader.js +3 -1
  26. package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +60 -7
  27. package/dist/es2019/types.js +3 -3
  28. package/dist/es2019/utils/cardActions/cardActionIconButton.js +2 -3
  29. package/dist/es2019/utils/cardActions/styles.js +3 -3
  30. package/dist/es2019/utils/ufoExperiences.js +1 -1
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/card/card.js +99 -109
  33. package/dist/esm/card/cardView.js +6 -7
  34. package/dist/esm/card/getCardPreview/helpers.js +108 -117
  35. package/dist/esm/card/getCardPreview/index.js +99 -104
  36. package/dist/esm/card/inlinePlayer.js +92 -98
  37. package/dist/esm/card/inlinePlayerLazy.js +17 -20
  38. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  39. package/dist/esm/card/ui/common.js +3 -3
  40. package/dist/esm/inline/loader.js +44 -47
  41. package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +59 -9
  42. package/dist/esm/types.js +3 -3
  43. package/dist/esm/utils/cardActions/cardActionIconButton.js +2 -3
  44. package/dist/esm/utils/cardActions/styles.js +3 -3
  45. package/dist/esm/utils/ufoExperiences.js +1 -1
  46. package/dist/esm/utils/videoSnapshot.js +41 -44
  47. package/dist/esm/utils/viewportDetector.js +1 -1
  48. package/dist/esm/version.json +1 -1
  49. package/dist/types/inline/loader.d.ts +1 -0
  50. package/dist/types/inline/mediaInlineAnalyticsErrorBoundary.d.ts +1 -0
  51. package/package.json +4 -4
  52. package/report.api.md +1 -0
@@ -1,4 +1,3 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -8,7 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
- 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; }
10
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
12
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
12
  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; } }
14
13
  import React from 'react';
@@ -33,43 +32,41 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
33
32
  _createClass(MediaInlineCardLoader, [{
34
33
  key: "componentDidMount",
35
34
  value: function () {
36
- var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
35
+ var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
37
36
  var _yield$Promise$all, _yield$Promise$all2, mediaClient, cardModule, mediaInlineErrorBoundaryModule;
38
- return _regeneratorRuntime().wrap(function _callee$(_context) {
39
- while (1) {
40
- switch (_context.prev = _context.next) {
41
- case 0:
42
- this.isMounted = true;
43
- if (this.state.MediaInlineCard) {
44
- _context.next = 17;
45
- break;
46
- }
47
- _context.prev = 2;
48
- _context.next = 5;
49
- return Promise.all([import( /* webpackChunkName: "@atlaskit-internal_media-client" */'@atlaskit/media-client'), import( /* webpackChunkName: "@atlaskit-internal_inline-media-card" */'./mediaInlineCard'), import( /* webpackChunkName: "@atlaskit-internal_media-inline-error-boundary" */'./mediaInlineAnalyticsErrorBoundary')]);
50
- case 5:
51
- _yield$Promise$all = _context.sent;
52
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
53
- mediaClient = _yield$Promise$all2[0];
54
- cardModule = _yield$Promise$all2[1];
55
- mediaInlineErrorBoundaryModule = _yield$Promise$all2[2];
56
- MediaInlineCardLoader.MediaInlineCard = mediaClient.withMediaClient(cardModule.MediaInlineCard);
57
- MediaInlineCardLoader.ErrorBoundary = mediaInlineErrorBoundaryModule.default;
58
- if (this.isMounted) {
59
- this.setState({
60
- MediaInlineCard: MediaInlineCardLoader.MediaInlineCard,
61
- ErrorBoundary: MediaInlineCardLoader.ErrorBoundary
62
- });
63
- }
37
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
38
+ while (1) switch (_context.prev = _context.next) {
39
+ case 0:
40
+ this.isMounted = true;
41
+ if (this.state.MediaInlineCard) {
64
42
  _context.next = 17;
65
43
  break;
66
- case 15:
67
- _context.prev = 15;
68
- _context.t0 = _context["catch"](2);
69
- case 17:
70
- case "end":
71
- return _context.stop();
72
- }
44
+ }
45
+ _context.prev = 2;
46
+ _context.next = 5;
47
+ return Promise.all([import( /* webpackChunkName: "@atlaskit-internal_media-client" */'@atlaskit/media-client'), import( /* webpackChunkName: "@atlaskit-internal_inline-media-card" */'./mediaInlineCard'), import( /* webpackChunkName: "@atlaskit-internal_media-inline-error-boundary" */'./mediaInlineAnalyticsErrorBoundary')]);
48
+ case 5:
49
+ _yield$Promise$all = _context.sent;
50
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);
51
+ mediaClient = _yield$Promise$all2[0];
52
+ cardModule = _yield$Promise$all2[1];
53
+ mediaInlineErrorBoundaryModule = _yield$Promise$all2[2];
54
+ MediaInlineCardLoader.MediaInlineCard = mediaClient.withMediaClient(cardModule.MediaInlineCard);
55
+ MediaInlineCardLoader.ErrorBoundary = mediaInlineErrorBoundaryModule.default;
56
+ if (this.isMounted) {
57
+ this.setState({
58
+ MediaInlineCard: MediaInlineCardLoader.MediaInlineCard,
59
+ ErrorBoundary: MediaInlineCardLoader.ErrorBoundary
60
+ });
61
+ }
62
+ _context.next = 17;
63
+ break;
64
+ case 15:
65
+ _context.prev = 15;
66
+ _context.t0 = _context["catch"](2);
67
+ case 17:
68
+ case "end":
69
+ return _context.stop();
73
70
  }
74
71
  }, _callee, this, [[2, 15]]);
75
72
  }));
@@ -81,16 +78,14 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
81
78
  }, {
82
79
  key: "componentWillUnmount",
83
80
  value: function () {
84
- var _componentWillUnmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
85
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
86
- while (1) {
87
- switch (_context2.prev = _context2.next) {
88
- case 0:
89
- this.isMounted = false;
90
- case 1:
91
- case "end":
92
- return _context2.stop();
93
- }
81
+ var _componentWillUnmount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
82
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
83
+ while (1) switch (_context2.prev = _context2.next) {
84
+ case 0:
85
+ this.isMounted = false;
86
+ case 1:
87
+ case "end":
88
+ return _context2.stop();
94
89
  }
95
90
  }, _callee2, this);
96
91
  }));
@@ -110,7 +105,9 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
110
105
  message: ""
111
106
  });
112
107
  }
113
- return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(MediaInlineCard, this.props));
108
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
109
+ isSelected: this.props.isSelected
110
+ }, /*#__PURE__*/React.createElement(MediaInlineCard, this.props));
114
111
  }
115
112
  }]);
116
113
  return MediaInlineCardLoader;
@@ -5,14 +5,63 @@ import _inherits from "@babel/runtime/helpers/inherits";
5
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- 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; }
9
- 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) { _defineProperty(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; }
10
8
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
9
  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; } }
10
+ 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; }
11
+ 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) { _defineProperty(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; }
12
12
  import React from 'react';
13
13
  import { withMediaAnalyticsContext } from '@atlaskit/media-common';
14
14
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
15
+ import { B300, R300, N30A, N900 } from '@atlaskit/theme/colors';
16
+ import WarningIcon from '@atlaskit/icon/glyph/warning';
15
17
  import { fireMediaCardEvent } from '../utils/analytics';
18
+ var ErrorBoundaryComponent = function ErrorBoundaryComponent(_ref) {
19
+ var message = _ref.message,
20
+ isSelected = _ref.isSelected;
21
+ var selectedStyle = {
22
+ cursor: 'pointer',
23
+ boxShadow: "0 0 0 1px ".concat("var(--ds-border-selected, ".concat(B300, ")")),
24
+ outline: 'none',
25
+ userSelect: 'none',
26
+ borderColor: 'transparent'
27
+ };
28
+
29
+ /* Note:
30
+ - styling is borrowed from packages/media/media-ui/src/MediaInlineCard/Frame/styled.ts
31
+ - because we are not using styled components, we are not able to use themed(), here is the "themed" property of color and backgroundColor
32
+ color: `${themed({
33
+ light: token('color.text', N900),
34
+ dark: token('color.text', DN600),
35
+ })}`,
36
+ backgroundColor: `${themed({
37
+ light: token('color.background.neutral', N30A),
38
+ dark: token('color.background.neutral', DN80),
39
+ })}`,
40
+ */
41
+
42
+ var style = _objectSpread({
43
+ lineHeight: '16px',
44
+ padding: '2px 4px',
45
+ marginRight: '-2px',
46
+ WebkitBoxDecorationBreak: 'clone',
47
+ display: 'inline',
48
+ borderRadius: '3px',
49
+ color: "var(--ds-text, ".concat(N900, ")"),
50
+ backgroundColor: "var(--ds-background-neutral, ".concat(N30A, ")"),
51
+ userSelect: 'text',
52
+ transition: 'all 0.1s ease-in-out 0s',
53
+ cursor: 'pointer'
54
+ }, isSelected ? _objectSpread({}, selectedStyle) : {
55
+ userSelect: 'text'
56
+ });
57
+ return /*#__PURE__*/React.createElement("span", {
58
+ style: style
59
+ }, /*#__PURE__*/React.createElement(WarningIcon, {
60
+ label: "error",
61
+ size: "small",
62
+ primaryColor: "var(--ds-icon-danger, ".concat(R300, ")")
63
+ }), message);
64
+ };
16
65
  var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Component) {
17
66
  _inherits(WrappedMediaInlineAnalyticsErrorBoundary, _React$Component);
18
67
  var _super = _createSuper(WrappedMediaInlineAnalyticsErrorBoundary);
@@ -58,19 +107,20 @@ var WrappedMediaInlineAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Com
58
107
  key: "render",
59
108
  value: function render() {
60
109
  var hasError = this.state.hasError;
61
- var children = this.props.children;
62
- if (hasError) {
63
- // TODO refactor error boundary for inline card https://product-fabric.atlassian.net/browse/MEX-2140
64
- return /*#__PURE__*/React.createElement(React.Fragment, null);
65
- }
66
- return children;
110
+ var _this$props2 = this.props,
111
+ children = _this$props2.children,
112
+ isSelected = _this$props2.isSelected;
113
+ return hasError ? /*#__PURE__*/React.createElement(ErrorBoundaryComponent, {
114
+ message: "We couldn't load this content",
115
+ isSelected: isSelected
116
+ }) : children;
67
117
  }
68
118
  }]);
69
119
  return WrappedMediaInlineAnalyticsErrorBoundary;
70
120
  }(React.Component);
71
121
  _defineProperty(WrappedMediaInlineAnalyticsErrorBoundary, "displayName", 'MediaInlineAnalyticsErrorBoundary');
72
122
  var packageName = "@atlaskit/media-card";
73
- var packageVersion = "74.7.3";
123
+ var packageVersion = "74.7.4";
74
124
  var MediaInlineAnalyticsErrorBoundary = withMediaAnalyticsContext({
75
125
  packageVersion: packageVersion,
76
126
  packageName: packageName,
package/dist/esm/types.js CHANGED
@@ -3,8 +3,8 @@
3
3
  * tsconfig.entry-points.json
4
4
  */
5
5
 
6
- export var MediaCardCursor;
7
- (function (MediaCardCursor) {
6
+ export var MediaCardCursor = /*#__PURE__*/function (MediaCardCursor) {
8
7
  MediaCardCursor["Action"] = "pointer";
9
8
  MediaCardCursor["NotReady"] = "wait";
10
- })(MediaCardCursor || (MediaCardCursor = {}));
9
+ return MediaCardCursor;
10
+ }({});
@@ -20,6 +20,8 @@ export var CardActionIconButton = /*#__PURE__*/function (_Component) {
20
20
  args[_key] = arguments[_key];
21
21
  }
22
22
  _this = _super.call.apply(_super, [this].concat(args));
23
+ // this is to prevent currently focused text to loose cursor on clicking card action
24
+ // this does not prevent onclick behavior
23
25
  _defineProperty(_assertThisInitialized(_this), "onMouseDown", function (event) {
24
26
  event.preventDefault();
25
27
  });
@@ -42,9 +44,6 @@ export var CardActionIconButton = /*#__PURE__*/function (_Component) {
42
44
  variant: variant
43
45
  }, icon);
44
46
  }
45
-
46
- // this is to prevent currently focused text to loose cursor on clicking card action
47
- // this does not prevent onclick behavior
48
47
  }]);
49
48
  return CardActionIconButton;
50
49
  }(Component);
@@ -6,11 +6,11 @@ import { borderRadius, size, center } from '@atlaskit/media-ui';
6
6
  import { rootStyles } from '../../card/styles';
7
7
  import { rgba } from '../../card/styles/mixins';
8
8
  export var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n display: flex;\n position: relative;\n line-height: 0;\n"])), rootStyles());
9
- export var CardActionIconButtonVariant;
10
- (function (CardActionIconButtonVariant) {
9
+ export var CardActionIconButtonVariant = /*#__PURE__*/function (CardActionIconButtonVariant) {
11
10
  CardActionIconButtonVariant["default"] = "default";
12
11
  CardActionIconButtonVariant["filled"] = "filled";
13
- })(CardActionIconButtonVariant || (CardActionIconButtonVariant = {}));
12
+ return CardActionIconButtonVariant;
13
+ }({});
14
14
  var getVariantStyles = function getVariantStyles(variant) {
15
15
  return variant === 'filled' ? "\n background-color: ".concat("var(--ds-surface-overlay, ".concat(rgba(N0, 0.8), ")"), ";\n margin-right: 8px;\n\n &:last-child {\n margin-right: 0;\n }\n\n &:hover {\n background-color: ", "var(--ds-surface-overlay-hovered, ".concat(rgba(N0, 0.6), ")"), "\n }\n ") : "\n &:hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, rgba(9, 30, 66, 0.06))", ";\n }\n ");
16
16
  };
@@ -7,7 +7,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
7
7
  import { MediaCardError } from '../errors';
8
8
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
9
9
  var packageName = "@atlaskit/media-card";
10
- var packageVersion = "74.7.3";
10
+ var packageVersion = "74.7.4";
11
11
  var concurrentExperience;
12
12
  var getExperience = function getExperience(id) {
13
13
  if (!concurrentExperience) {
@@ -1,50 +1,47 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- 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; }
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
3
  export var takeSnapshot = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(blob) {
6
- return _regeneratorRuntime().wrap(function _callee$(_context) {
7
- while (1) {
8
- switch (_context.prev = _context.next) {
9
- case 0:
10
- return _context.abrupt("return", new Promise(function (resolve, reject) {
11
- var url = URL.createObjectURL(blob);
12
- var video = document.createElement('video');
13
- video.preload = 'metadata';
14
- video.src = url;
15
- video.muted = true;
16
- video.play().catch(function () {
17
- return reject(new Error('failed to play video'));
18
- });
19
- video.addEventListener('timeupdate', function timeUpdateHandler() {
20
- video.removeEventListener('timeupdate', timeUpdateHandler);
21
- video.pause();
22
- URL.revokeObjectURL(url);
23
- //create canvas to draw our first frame on.
4
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(blob) {
5
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
6
+ while (1) switch (_context.prev = _context.next) {
7
+ case 0:
8
+ return _context.abrupt("return", new Promise(function (resolve, reject) {
9
+ var url = URL.createObjectURL(blob);
10
+ var video = document.createElement('video');
11
+ video.preload = 'metadata';
12
+ video.src = url;
13
+ video.muted = true;
14
+ video.play().catch(function () {
15
+ return reject(new Error('failed to play video'));
16
+ });
17
+ video.addEventListener('timeupdate', function timeUpdateHandler() {
18
+ video.removeEventListener('timeupdate', timeUpdateHandler);
19
+ video.pause();
20
+ URL.revokeObjectURL(url);
21
+ //create canvas to draw our first frame on.
24
22
 
25
- if (!video.videoWidth && !video.videoHeight) {
26
- return reject(new Error('error retrieving video dimensions'));
27
- }
28
- var canvas = document.createElement('canvas');
29
- canvas.width = video.videoWidth;
30
- canvas.height = video.videoHeight;
31
- var context = canvas.getContext('2d');
32
- if (!context) {
33
- return reject(new Error('error creating canvas context'));
34
- }
35
- context.drawImage(video, 0, 0, canvas.width, canvas.height);
36
- var dataURL = canvas.toDataURL('image/jpeg', 0.85);
37
- resolve(dataURL);
38
- });
39
- video.addEventListener('error', function () {
40
- reject(new Error('failed to load video'));
41
- URL.revokeObjectURL(url);
42
- });
43
- }));
44
- case 1:
45
- case "end":
46
- return _context.stop();
47
- }
23
+ if (!video.videoWidth && !video.videoHeight) {
24
+ return reject(new Error('error retrieving video dimensions'));
25
+ }
26
+ var canvas = document.createElement('canvas');
27
+ canvas.width = video.videoWidth;
28
+ canvas.height = video.videoHeight;
29
+ var context = canvas.getContext('2d');
30
+ if (!context) {
31
+ return reject(new Error('error creating canvas context'));
32
+ }
33
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
34
+ var dataURL = canvas.toDataURL('image/jpeg', 0.85);
35
+ resolve(dataURL);
36
+ });
37
+ video.addEventListener('error', function () {
38
+ reject(new Error('failed to load video'));
39
+ URL.revokeObjectURL(url);
40
+ });
41
+ }));
42
+ case 1:
43
+ case "end":
44
+ return _context.stop();
48
45
  }
49
46
  }, _callee);
50
47
  }));
@@ -1,6 +1,6 @@
1
1
  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; } } }; }
2
2
  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); }
3
- 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; }
3
+ 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; }
4
4
  import React, { useEffect } from 'react';
5
5
  import getDocument from './document';
6
6
  var ABS_VIEWPORT_ANCHOR_OFFSET_TOP = 900; //px
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.7.3",
3
+ "version": "74.7.4",
4
4
  "sideEffects": false
5
5
  }
@@ -7,6 +7,7 @@ declare type ErrorBoundaryComponent = React.ComponentType<{
7
7
  data?: {
8
8
  [k: string]: any;
9
9
  };
10
+ isSelected?: boolean;
10
11
  }>;
11
12
  export interface MediaInlineCardLoaderState {
12
13
  MediaInlineCard?: MediaInlineCardWithMediaClientConfigComponent;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { MediaFeatureFlags } from '@atlaskit/media-common';
3
3
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
4
  export declare type MediaInlineAnalyticsErrorBoundaryProps = {
5
+ isSelected?: boolean;
5
6
  data?: {
6
7
  [k: string]: any;
7
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "74.7.3",
3
+ "version": "74.7.4",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/dropdown-menu": "^11.7.0",
33
33
  "@atlaskit/editor-shared-styles": "^2.3.0",
34
34
  "@atlaskit/icon": "^21.11.0",
35
- "@atlaskit/media-client": "^21.0.0",
35
+ "@atlaskit/media-client": "^21.1.0",
36
36
  "@atlaskit/media-common": "^4.0.0",
37
37
  "@atlaskit/media-ui": "^22.3.0",
38
38
  "@atlaskit/media-viewer": "^47.5.0",
@@ -61,8 +61,8 @@
61
61
  "@atlaskit/docs": "*",
62
62
  "@atlaskit/inline-message": "^11.4.0",
63
63
  "@atlaskit/media-core": "^34.0.0",
64
- "@atlaskit/media-picker": "^64.3.0",
65
- "@atlaskit/media-test-helpers": "^32.0.0",
64
+ "@atlaskit/media-picker": "^64.4.0",
65
+ "@atlaskit/media-test-helpers": "^32.1.0",
66
66
  "@atlaskit/radio": "^5.4.0",
67
67
  "@atlaskit/range": "^7.0.0",
68
68
  "@atlaskit/section-message": "^6.3.0",
package/report.api.md CHANGED
@@ -216,6 +216,7 @@ type ErrorBoundaryComponent = React_2.ComponentType<{
216
216
  data?: {
217
217
  [k: string]: any;
218
218
  };
219
+ isSelected?: boolean;
219
220
  }>;
220
221
 
221
222
  // @public (undocumented)