@atlaskit/media-card 77.4.6 → 77.4.7

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 (35) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/card/card.js +4 -7
  3. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  4. package/dist/cjs/card/v2/cardV2.js +1 -1
  5. package/dist/cjs/card/v2/fileCard.js +2 -2
  6. package/dist/cjs/card/v2/useFilePreview.js +5 -12
  7. package/dist/cjs/inline/loader.js +1 -1
  8. package/dist/cjs/utils/globalScope/globalScope.js +4 -10
  9. package/dist/cjs/utils/globalScope/index.js +2 -2
  10. package/dist/cjs/utils/ufoExperiences.js +1 -1
  11. package/dist/es2019/card/card.js +5 -8
  12. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  13. package/dist/es2019/card/v2/cardV2.js +1 -1
  14. package/dist/es2019/card/v2/fileCard.js +3 -3
  15. package/dist/es2019/card/v2/useFilePreview.js +6 -12
  16. package/dist/es2019/inline/loader.js +1 -1
  17. package/dist/es2019/utils/globalScope/globalScope.js +1 -7
  18. package/dist/es2019/utils/globalScope/index.js +1 -1
  19. package/dist/es2019/utils/ufoExperiences.js +1 -1
  20. package/dist/esm/card/card.js +5 -8
  21. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  22. package/dist/esm/card/v2/cardV2.js +1 -1
  23. package/dist/esm/card/v2/fileCard.js +3 -3
  24. package/dist/esm/card/v2/useFilePreview.js +6 -12
  25. package/dist/esm/inline/loader.js +1 -1
  26. package/dist/esm/utils/globalScope/globalScope.js +3 -8
  27. package/dist/esm/utils/globalScope/index.js +1 -1
  28. package/dist/esm/utils/ufoExperiences.js +1 -1
  29. package/dist/types/card/v2/useFilePreview.d.ts +5 -6
  30. package/dist/types/utils/globalScope/globalScope.d.ts +1 -7
  31. package/dist/types/utils/globalScope/index.d.ts +1 -1
  32. package/dist/types-ts4.5/card/v2/useFilePreview.d.ts +5 -6
  33. package/dist/types-ts4.5/utils/globalScope/globalScope.d.ts +1 -7
  34. package/dist/types-ts4.5/utils/globalScope/index.d.ts +1 -1
  35. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/media-card
2
2
 
3
+ ## 77.4.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#57119](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57119) [`c64d6ef23ba4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c64d6ef23ba4) - Replaces the return type of internal preview hook to include the attributes for the ssr script
8
+ - Updated dependencies
9
+
3
10
  ## 77.4.6
4
11
 
5
12
  ### Patch Changes
@@ -49,7 +49,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
49
49
  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); }; }
50
50
  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; } }
51
51
  var packageName = "@atlaskit/media-card";
52
- var packageVersion = "77.4.6";
52
+ var packageVersion = "77.4.7";
53
53
  var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
54
54
  (0, _inherits2.default)(CardBase, _Component);
55
55
  var _super = _createSuper(CardBase);
@@ -611,12 +611,9 @@ var CardBase = exports.CardBase = /*#__PURE__*/function (_Component) {
611
611
  var _this$state$cardPrevi = _this.state.cardPreview,
612
612
  _this$state$cardPrevi2 = _this$state$cardPrevi === void 0 ? {} : _this$state$cardPrevi,
613
613
  dataURI = _this$state$cardPrevi2.dataURI;
614
- return (0, _mediaClient2.isFileIdentifier)(identifier) && ssr === 'server' && /*#__PURE__*/_react.default.createElement(_globalScope.StoreSSRDataScript, {
615
- identifier: identifier,
616
- dataURI: dataURI,
617
- dimensions: _this.requestedDimensions,
618
- error: ((_this$ssrReliability$ = _this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? _this.ssrReliability.server : undefined
619
- });
614
+ return (0, _mediaClient2.isFileIdentifier)(identifier) &&
615
+ // Print the SSR result to be used during hydration
616
+ ssr === 'server' && /*#__PURE__*/_react.default.createElement("script", (0, _globalScope.generateScriptProps)(identifier, dataURI, _this.requestedDimensions, ((_this$ssrReliability$ = _this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? _this.ssrReliability.server : undefined));
620
617
  });
621
618
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onCardInViewport", function () {
622
619
  _this.setState({
@@ -90,7 +90,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
90
90
  }(_react.default.Component);
91
91
  (0, _defineProperty2.default)(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
92
92
  var packageName = "@atlaskit/media-card";
93
- var packageVersion = "77.4.6";
93
+ var packageVersion = "77.4.7";
94
94
  var MediaCardAnalyticsErrorBoundary = (0, _mediaCommon.withMediaAnalyticsContext)({
95
95
  packageVersion: packageVersion,
96
96
  packageName: packageName,
@@ -16,7 +16,7 @@ var _externalImageCard = require("./externalImageCard");
16
16
  var _fileCard = require("./fileCard");
17
17
  var _excluded = ["identifier"];
18
18
  var packageName = "@atlaskit/media-card";
19
- var packageVersion = "77.4.6";
19
+ var packageVersion = "77.4.7";
20
20
  var CardV2Base = exports.CardV2Base = function CardV2Base(_ref) {
21
21
  var identifier = _ref.identifier,
22
22
  otherProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
@@ -186,7 +186,7 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
186
186
  ssrReliabilityRef = _useFilePreview.ssrReliabilityRef,
187
187
  onImageErrorBase = _useFilePreview.onImageError,
188
188
  onImageLoadBase = _useFilePreview.onImageLoad,
189
- StoreSSRDataScript = _useFilePreview.StoreSSRDataScript;
189
+ getScriptProps = _useFilePreview.getScriptProps;
190
190
  var _useState15 = (0, _react.useState)(),
191
191
  _useState16 = (0, _slicedToArray2.default)(_useState15, 2),
192
192
  error = _useState16[0],
@@ -601,5 +601,5 @@ var FileCard = exports.FileCard = function FileCard(_ref) {
601
601
  },
602
602
  contextId: contextId,
603
603
  featureFlags: featureFlags
604
- }), document.body) : null, ssr === 'server' && /*#__PURE__*/_react.default.createElement(StoreSSRDataScript, null));
604
+ }), document.body) : null, ssr === 'server' && /*#__PURE__*/_react.default.createElement("script", getScriptProps()));
605
605
  };
@@ -1,7 +1,6 @@
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
  });
@@ -10,11 +9,11 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
10
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
- var _react = _interopRequireWildcard(require("react"));
14
12
  var _mediaClient = require("@atlaskit/media-client");
15
13
  var _mediaClientReact = require("@atlaskit/media-client-react");
16
14
  var _mediaCommon = require("@atlaskit/media-common");
17
15
  var _mediaUi = require("@atlaskit/media-ui");
16
+ var _react = require("react");
18
17
  var _errors = require("../../errors");
19
18
  var _analytics = require("../../utils/analytics");
20
19
  var _dimensionComparer = require("../../utils/dimensionComparer");
@@ -24,8 +23,6 @@ var _usePrevious = require("../../utils/usePrevious");
24
23
  var _videoSnapshot = require("../../utils/videoSnapshot");
25
24
  var _getCardPreview = require("../getCardPreview");
26
25
  var _cache = _interopRequireDefault(require("../getCardPreview/cache"));
27
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
28
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
26
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
30
27
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
28
  var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
@@ -568,14 +565,10 @@ var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
568
565
  // RETURN
569
566
  //----------------------------------------------------------------//
570
567
 
571
- var StoreSSRDataScriptComponent = function StoreSSRDataScriptComponent() {
568
+ // FOR SSR
569
+ var getScriptProps = function getScriptProps() {
572
570
  var _ssrReliabilityRef$cu;
573
- return /*#__PURE__*/_react.default.createElement(_globalScope.StoreSSRDataScript, {
574
- identifier: identifier,
575
- dataURI: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI,
576
- dimensions: requestedDimensions,
577
- error: ((_ssrReliabilityRef$cu = ssrReliabilityRef.current.server) === null || _ssrReliabilityRef$cu === void 0 ? void 0 : _ssrReliabilityRef$cu.status) === 'fail' ? ssrReliabilityRef.current.server : undefined
578
- });
571
+ return (0, _globalScope.generateScriptProps)(identifier, cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI, requestedDimensions, ((_ssrReliabilityRef$cu = ssrReliabilityRef.current.server) === null || _ssrReliabilityRef$cu === void 0 ? void 0 : _ssrReliabilityRef$cu.status) === 'fail' ? ssrReliabilityRef.current.server : undefined);
579
572
  };
580
573
 
581
574
  // CXP-2723 TODO: should consider simplifying our analytics, and how
@@ -587,6 +580,6 @@ var useFilePreview = exports.useFilePreview = function useFilePreview(_ref) {
587
580
  ssrReliabilityRef: ssrReliabilityRef,
588
581
  onImageError: onImageError,
589
582
  onImageLoad: onImageLoad,
590
- StoreSSRDataScript: StoreSSRDataScriptComponent
583
+ getScriptProps: getScriptProps
591
584
  };
592
585
  };
@@ -119,7 +119,7 @@ var MediaInlineCardLoader = exports.default = /*#__PURE__*/function (_React$Pure
119
119
  ErrorBoundary = _this$state.ErrorBoundary;
120
120
  var analyticsContext = {
121
121
  packageVersion: "@atlaskit/media-card",
122
- packageName: "77.4.6",
122
+ packageName: "77.4.7",
123
123
  componentName: 'mediaInlineCard',
124
124
  component: 'mediaInlineCard'
125
125
  };
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.getKey = exports.StoreSSRDataScript = exports.GLOBAL_MEDIA_NAMESPACE = exports.GLOBAL_MEDIA_CARD_SSR = void 0;
6
+ exports.getKey = exports.generateScriptProps = exports.GLOBAL_MEDIA_NAMESPACE = exports.GLOBAL_MEDIA_CARD_SSR = void 0;
8
7
  exports.getMediaCardSSR = getMediaCardSSR;
9
8
  exports.getMediaGlobalScope = getMediaGlobalScope;
10
9
  exports.storeDataURI = void 0;
11
- var _react = _interopRequireDefault(require("react"));
12
10
  var _printScript = require("../printScript");
13
11
  // ----- WARNING -----
14
12
  // This is a very sensitive fraction of code.
@@ -59,14 +57,10 @@ var generateScript = function generateScript(identifier, dataURI, dimensions, er
59
57
  var functionCall = (0, _printScript.printFunctionCall)(storeDataURI, getKey(identifier), dataURI, dimensions, error);
60
58
  return (0, _printScript.printScript)([getMediaCardSSR.toString(), getMediaGlobalScope.toString(), functionCall]);
61
59
  };
62
- var StoreSSRDataScript = exports.StoreSSRDataScript = function StoreSSRDataScript(_ref2) {
63
- var dataURI = _ref2.dataURI,
64
- identifier = _ref2.identifier,
65
- dimensions = _ref2.dimensions,
66
- error = _ref2.error;
67
- return /*#__PURE__*/_react.default.createElement("script", {
60
+ var generateScriptProps = exports.generateScriptProps = function generateScriptProps(identifier, dataURI, dimensions, error) {
61
+ return {
68
62
  dangerouslySetInnerHTML: {
69
63
  __html: generateScript(identifier, dataURI, dimensions, error)
70
64
  }
71
- });
65
+ };
72
66
  };
@@ -15,10 +15,10 @@ Object.defineProperty(exports, "GLOBAL_MEDIA_NAMESPACE", {
15
15
  return _globalScope.GLOBAL_MEDIA_NAMESPACE;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "StoreSSRDataScript", {
18
+ Object.defineProperty(exports, "generateScriptProps", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _globalScope.StoreSSRDataScript;
21
+ return _globalScope.generateScriptProps;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "getKey", {
@@ -14,7 +14,7 @@ var _mediaClient = require("@atlaskit/media-client");
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
15
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
16
  var packageName = "@atlaskit/media-card";
17
- var packageVersion = "77.4.6";
17
+ var packageVersion = "77.4.7";
18
18
  var concurrentExperience;
19
19
  var getExperience = function getExperience(id) {
20
20
  if (!concurrentExperience) {
@@ -20,14 +20,14 @@ import { getFileAttributes, extractErrorInfo } from '../utils/analytics';
20
20
  import { isLocalPreviewError, MediaCardError, ensureMediaCardError, ImageLoadError } from '../errors';
21
21
  import { fireOperationalEvent, fireCommencedEvent, fireCopiedEvent, fireScreenEvent, fireNonCriticalErrorEvent } from './cardAnalytics';
22
22
  import getDocument from '../utils/document';
23
- import { StoreSSRDataScript, getSSRData } from '../utils/globalScope';
23
+ import { generateScriptProps, getSSRData } from '../utils/globalScope';
24
24
  import { getCardStateFromFileState, createStateUpdater } from './cardState';
25
25
  import { isBigger } from '../utils/dimensionComparer';
26
26
  import { getMediaCardCursor } from '../utils/getMediaCardCursor';
27
27
  import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
28
28
  import { generateUniqueId } from '../utils/generateUniqueId';
29
29
  const packageName = "@atlaskit/media-card";
30
- const packageVersion = "77.4.6";
30
+ const packageVersion = "77.4.7";
31
31
  export class CardBase extends Component {
32
32
  constructor(props) {
33
33
  super(props);
@@ -573,12 +573,9 @@ export class CardBase extends Component {
573
573
  dataURI
574
574
  } = {}
575
575
  } = this.state;
576
- return isFileIdentifier(identifier) && ssr === 'server' && /*#__PURE__*/React.createElement(StoreSSRDataScript, {
577
- identifier: identifier,
578
- dataURI: dataURI,
579
- dimensions: this.requestedDimensions,
580
- error: ((_this$ssrReliability$ = this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? this.ssrReliability.server : undefined
581
- });
576
+ return isFileIdentifier(identifier) &&
577
+ // Print the SSR result to be used during hydration
578
+ ssr === 'server' && /*#__PURE__*/React.createElement("script", generateScriptProps(identifier, dataURI, this.requestedDimensions, ((_this$ssrReliability$ = this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? this.ssrReliability.server : undefined));
582
579
  });
583
580
  _defineProperty(this, "onCardInViewport", () => {
584
581
  this.setState({
@@ -66,7 +66,7 @@ class WrappedMediaCardAnalyticsErrorBoundary extends React.Component {
66
66
  }
67
67
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
68
68
  const packageName = "@atlaskit/media-card";
69
- const packageVersion = "77.4.6";
69
+ const packageVersion = "77.4.7";
70
70
  const MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
71
71
  packageVersion,
72
72
  packageName,
@@ -7,7 +7,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
7
7
  import { ExternalImageCard } from './externalImageCard';
8
8
  import { FileCard } from './fileCard';
9
9
  const packageName = "@atlaskit/media-card";
10
- const packageVersion = "77.4.6";
10
+ const packageVersion = "77.4.7";
11
11
  export const CardV2Base = ({
12
12
  identifier,
13
13
  ...otherProps
@@ -1,5 +1,5 @@
1
1
  import DownloadIcon from '@atlaskit/icon/glyph/download';
2
- import { RECENTS_COLLECTION, globalMediaEventEmitter, isImageRepresentationReady } from '@atlaskit/media-client';
2
+ import { globalMediaEventEmitter, isImageRepresentationReady, RECENTS_COLLECTION } from '@atlaskit/media-client';
3
3
  import { MediaFileStateError, useFileState } from '@atlaskit/media-client-react';
4
4
  import { getRandomHex, isMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
5
5
  import { MediaViewer } from '@atlaskit/media-viewer';
@@ -131,7 +131,7 @@ export const FileCard = ({
131
131
  ssrReliabilityRef,
132
132
  onImageError: onImageErrorBase,
133
133
  onImageLoad: onImageLoadBase,
134
- StoreSSRDataScript
134
+ getScriptProps
135
135
  } = useFilePreview({
136
136
  mediaBlobUrlAttrs,
137
137
  resizeMode,
@@ -551,5 +551,5 @@ export const FileCard = ({
551
551
  },
552
552
  contextId: contextId,
553
553
  featureFlags: featureFlags
554
- }), document.body) : null, ssr === 'server' && /*#__PURE__*/React.createElement(StoreSSRDataScript, null));
554
+ }), document.body) : null, ssr === 'server' && /*#__PURE__*/React.createElement("script", getScriptProps()));
555
555
  };
@@ -1,19 +1,17 @@
1
- import React from 'react';
2
1
  import { addFileAttrsToUrl, imageResizeModeToFileImageMode, isImageRepresentationReady } from '@atlaskit/media-client';
3
2
  import { MediaFileStateError, useFileState } from '@atlaskit/media-client-react';
4
3
  import { getMediaTypeFromMimeType, isMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
5
4
  import { getOrientation } from '@atlaskit/media-ui';
6
5
  import { useEffect, useMemo, useRef, useState } from 'react';
7
- import { ImageLoadError, LocalPreviewError, MediaCardError, ensureMediaCardError, isLocalPreviewError, isUnsupportedLocalPreviewError } from '../../errors';
6
+ import { ensureMediaCardError, ImageLoadError, isLocalPreviewError, isUnsupportedLocalPreviewError, LocalPreviewError, MediaCardError } from '../../errors';
8
7
  import { extractErrorInfo } from '../../utils/analytics';
9
8
  import { isBigger } from '../../utils/dimensionComparer';
10
- import { getSSRData } from '../../utils/globalScope';
9
+ import { generateScriptProps, getSSRData } from '../../utils/globalScope';
11
10
  import { useCurrentValueRef } from '../../utils/useCurrentValueRef';
12
11
  import { usePrevious } from '../../utils/usePrevious';
13
12
  import { takeSnapshot } from '../../utils/videoSnapshot';
14
13
  import { fetchAndCacheRemotePreview, getCardPreviewFromCache, getSSRCardPreview, isLocalPreview, isSSRClientPreview, isSSRDataPreview, removeCardPreviewFromCache, shouldResolvePreview } from '../getCardPreview';
15
14
  import cardPreviewCache from '../getCardPreview/cache';
16
- import { StoreSSRDataScript } from '../../utils/globalScope';
17
15
  export const useFilePreview = ({
18
16
  resizeMode = 'crop',
19
17
  identifier,
@@ -475,14 +473,10 @@ export const useFilePreview = ({
475
473
  // RETURN
476
474
  //----------------------------------------------------------------//
477
475
 
478
- const StoreSSRDataScriptComponent = () => {
476
+ // FOR SSR
477
+ const getScriptProps = () => {
479
478
  var _ssrReliabilityRef$cu;
480
- return /*#__PURE__*/React.createElement(StoreSSRDataScript, {
481
- identifier: identifier,
482
- dataURI: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI,
483
- dimensions: requestedDimensions,
484
- error: ((_ssrReliabilityRef$cu = ssrReliabilityRef.current.server) === null || _ssrReliabilityRef$cu === void 0 ? void 0 : _ssrReliabilityRef$cu.status) === 'fail' ? ssrReliabilityRef.current.server : undefined
485
- });
479
+ return generateScriptProps(identifier, cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI, requestedDimensions, ((_ssrReliabilityRef$cu = ssrReliabilityRef.current.server) === null || _ssrReliabilityRef$cu === void 0 ? void 0 : _ssrReliabilityRef$cu.status) === 'fail' ? ssrReliabilityRef.current.server : undefined);
486
480
  };
487
481
 
488
482
  // CXP-2723 TODO: should consider simplifying our analytics, and how
@@ -494,6 +488,6 @@ export const useFilePreview = ({
494
488
  ssrReliabilityRef,
495
489
  onImageError,
496
490
  onImageLoad,
497
- StoreSSRDataScript: StoreSSRDataScriptComponent
491
+ getScriptProps
498
492
  };
499
493
  };
@@ -37,7 +37,7 @@ export default class MediaInlineCardLoader extends React.PureComponent {
37
37
  } = this.state;
38
38
  const analyticsContext = {
39
39
  packageVersion: "@atlaskit/media-card",
40
- packageName: "77.4.6",
40
+ packageName: "77.4.7",
41
41
  componentName: 'mediaInlineCard',
42
42
  component: 'mediaInlineCard'
43
43
  };
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { printFunctionCall, printScript } from '../printScript';
3
2
  // ----- WARNING -----
4
3
  // This is a very sensitive fraction of code.
@@ -42,12 +41,7 @@ const generateScript = (identifier, dataURI, dimensions, error) => {
42
41
  const functionCall = printFunctionCall(storeDataURI, getKey(identifier), dataURI, dimensions, error);
43
42
  return printScript([getMediaCardSSR.toString(), getMediaGlobalScope.toString(), functionCall]);
44
43
  };
45
- export const StoreSSRDataScript = ({
46
- dataURI,
47
- identifier,
48
- dimensions,
49
- error
50
- }) => /*#__PURE__*/React.createElement("script", {
44
+ export const generateScriptProps = (identifier, dataURI, dimensions, error) => ({
51
45
  dangerouslySetInnerHTML: {
52
46
  __html: generateScript(identifier, dataURI, dimensions, error)
53
47
  }
@@ -1,2 +1,2 @@
1
- export { StoreSSRDataScript, GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, getKey } from './globalScope';
1
+ export { GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, generateScriptProps, getKey } from './globalScope';
2
2
  export { getSSRData } from './getSSRData';
@@ -4,7 +4,7 @@ import { extractErrorInfo, getRenderErrorRequestMetadata } from './analytics';
4
4
  import { MediaCardError } from '../errors';
5
5
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
6
6
  const packageName = "@atlaskit/media-card";
7
- const packageVersion = "77.4.6";
7
+ const packageVersion = "77.4.7";
8
8
  let concurrentExperience;
9
9
  const getExperience = id => {
10
10
  if (!concurrentExperience) {
@@ -33,14 +33,14 @@ import { getFileAttributes, extractErrorInfo } from '../utils/analytics';
33
33
  import { isLocalPreviewError, MediaCardError, ensureMediaCardError, ImageLoadError } from '../errors';
34
34
  import { fireOperationalEvent as _fireOperationalEvent, fireCommencedEvent as _fireCommencedEvent, fireCopiedEvent, fireScreenEvent, fireNonCriticalErrorEvent } from './cardAnalytics';
35
35
  import getDocument from '../utils/document';
36
- import { StoreSSRDataScript, getSSRData } from '../utils/globalScope';
36
+ import { generateScriptProps, getSSRData } from '../utils/globalScope';
37
37
  import { getCardStateFromFileState, createStateUpdater } from './cardState';
38
38
  import { isBigger } from '../utils/dimensionComparer';
39
39
  import { getMediaCardCursor } from '../utils/getMediaCardCursor';
40
40
  import { completeUfoExperience, startUfoExperience, abortUfoExperience } from '../utils/ufoExperiences';
41
41
  import { generateUniqueId } from '../utils/generateUniqueId';
42
42
  var packageName = "@atlaskit/media-card";
43
- var packageVersion = "77.4.6";
43
+ var packageVersion = "77.4.7";
44
44
  export var CardBase = /*#__PURE__*/function (_Component) {
45
45
  _inherits(CardBase, _Component);
46
46
  var _super = _createSuper(CardBase);
@@ -602,12 +602,9 @@ export var CardBase = /*#__PURE__*/function (_Component) {
602
602
  var _this$state$cardPrevi = _this.state.cardPreview,
603
603
  _this$state$cardPrevi2 = _this$state$cardPrevi === void 0 ? {} : _this$state$cardPrevi,
604
604
  dataURI = _this$state$cardPrevi2.dataURI;
605
- return isFileIdentifier(identifier) && ssr === 'server' && /*#__PURE__*/React.createElement(StoreSSRDataScript, {
606
- identifier: identifier,
607
- dataURI: dataURI,
608
- dimensions: _this.requestedDimensions,
609
- error: ((_this$ssrReliability$ = _this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? _this.ssrReliability.server : undefined
610
- });
605
+ return isFileIdentifier(identifier) &&
606
+ // Print the SSR result to be used during hydration
607
+ ssr === 'server' && /*#__PURE__*/React.createElement("script", generateScriptProps(identifier, dataURI, _this.requestedDimensions, ((_this$ssrReliability$ = _this.ssrReliability.server) === null || _this$ssrReliability$ === void 0 ? void 0 : _this$ssrReliability$.status) === 'fail' ? _this.ssrReliability.server : undefined));
611
608
  });
612
609
  _defineProperty(_assertThisInitialized(_this), "onCardInViewport", function () {
613
610
  _this.setState({
@@ -83,7 +83,7 @@ var WrappedMediaCardAnalyticsErrorBoundary = /*#__PURE__*/function (_React$Compo
83
83
  }(React.Component);
84
84
  _defineProperty(WrappedMediaCardAnalyticsErrorBoundary, "displayName", 'MediaCardAnalyticsErrorBoundary');
85
85
  var packageName = "@atlaskit/media-card";
86
- var packageVersion = "77.4.6";
86
+ var packageVersion = "77.4.7";
87
87
  var MediaCardAnalyticsErrorBoundary = withMediaAnalyticsContext({
88
88
  packageVersion: packageVersion,
89
89
  packageName: packageName,
@@ -9,7 +9,7 @@ import { IntlProvider, injectIntl } from 'react-intl-next';
9
9
  import { ExternalImageCard } from './externalImageCard';
10
10
  import { FileCard } from './fileCard';
11
11
  var packageName = "@atlaskit/media-card";
12
- var packageVersion = "77.4.6";
12
+ var packageVersion = "77.4.7";
13
13
  export var CardV2Base = function CardV2Base(_ref) {
14
14
  var identifier = _ref.identifier,
15
15
  otherProps = _objectWithoutProperties(_ref, _excluded);
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import DownloadIcon from '@atlaskit/icon/glyph/download';
7
- import { RECENTS_COLLECTION, globalMediaEventEmitter, isImageRepresentationReady } from '@atlaskit/media-client';
7
+ import { globalMediaEventEmitter, isImageRepresentationReady, RECENTS_COLLECTION } from '@atlaskit/media-client';
8
8
  import { MediaFileStateError, useFileState } from '@atlaskit/media-client-react';
9
9
  import { getRandomHex, isMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
10
10
  import { MediaViewer } from '@atlaskit/media-viewer';
@@ -176,7 +176,7 @@ export var FileCard = function FileCard(_ref) {
176
176
  ssrReliabilityRef = _useFilePreview.ssrReliabilityRef,
177
177
  onImageErrorBase = _useFilePreview.onImageError,
178
178
  onImageLoadBase = _useFilePreview.onImageLoad,
179
- StoreSSRDataScript = _useFilePreview.StoreSSRDataScript;
179
+ getScriptProps = _useFilePreview.getScriptProps;
180
180
  var _useState15 = useState(),
181
181
  _useState16 = _slicedToArray(_useState15, 2),
182
182
  error = _useState16[0],
@@ -591,5 +591,5 @@ export var FileCard = function FileCard(_ref) {
591
591
  },
592
592
  contextId: contextId,
593
593
  featureFlags: featureFlags
594
- }), document.body) : null, ssr === 'server' && /*#__PURE__*/React.createElement(StoreSSRDataScript, null));
594
+ }), document.body) : null, ssr === 'server' && /*#__PURE__*/React.createElement("script", getScriptProps()));
595
595
  };
@@ -4,22 +4,20 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
- import React from 'react';
8
7
  import { addFileAttrsToUrl, imageResizeModeToFileImageMode, isImageRepresentationReady } from '@atlaskit/media-client';
9
8
  import { MediaFileStateError, useFileState } from '@atlaskit/media-client-react';
10
9
  import { getMediaTypeFromMimeType, isMimeTypeSupportedByBrowser } from '@atlaskit/media-common';
11
10
  import { getOrientation } from '@atlaskit/media-ui';
12
11
  import { useEffect, useMemo, useRef, useState } from 'react';
13
- import { ImageLoadError, LocalPreviewError, MediaCardError, ensureMediaCardError, isLocalPreviewError, isUnsupportedLocalPreviewError } from '../../errors';
12
+ import { ensureMediaCardError, ImageLoadError, isLocalPreviewError, isUnsupportedLocalPreviewError, LocalPreviewError, MediaCardError } from '../../errors';
14
13
  import { extractErrorInfo } from '../../utils/analytics';
15
14
  import { isBigger } from '../../utils/dimensionComparer';
16
- import { getSSRData } from '../../utils/globalScope';
15
+ import { generateScriptProps, getSSRData } from '../../utils/globalScope';
17
16
  import { useCurrentValueRef } from '../../utils/useCurrentValueRef';
18
17
  import { usePrevious } from '../../utils/usePrevious';
19
18
  import { takeSnapshot } from '../../utils/videoSnapshot';
20
19
  import { fetchAndCacheRemotePreview, getCardPreviewFromCache, getSSRCardPreview, isLocalPreview, isSSRClientPreview, isSSRDataPreview, removeCardPreviewFromCache, shouldResolvePreview } from '../getCardPreview';
21
20
  import cardPreviewCache from '../getCardPreview/cache';
22
- import { StoreSSRDataScript } from '../../utils/globalScope';
23
21
  export var useFilePreview = function useFilePreview(_ref) {
24
22
  var _ref$resizeMode = _ref.resizeMode,
25
23
  resizeMode = _ref$resizeMode === void 0 ? 'crop' : _ref$resizeMode,
@@ -560,14 +558,10 @@ export var useFilePreview = function useFilePreview(_ref) {
560
558
  // RETURN
561
559
  //----------------------------------------------------------------//
562
560
 
563
- var StoreSSRDataScriptComponent = function StoreSSRDataScriptComponent() {
561
+ // FOR SSR
562
+ var getScriptProps = function getScriptProps() {
564
563
  var _ssrReliabilityRef$cu;
565
- return /*#__PURE__*/React.createElement(StoreSSRDataScript, {
566
- identifier: identifier,
567
- dataURI: cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI,
568
- dimensions: requestedDimensions,
569
- error: ((_ssrReliabilityRef$cu = ssrReliabilityRef.current.server) === null || _ssrReliabilityRef$cu === void 0 ? void 0 : _ssrReliabilityRef$cu.status) === 'fail' ? ssrReliabilityRef.current.server : undefined
570
- });
564
+ return generateScriptProps(identifier, cardPreview === null || cardPreview === void 0 ? void 0 : cardPreview.dataURI, requestedDimensions, ((_ssrReliabilityRef$cu = ssrReliabilityRef.current.server) === null || _ssrReliabilityRef$cu === void 0 ? void 0 : _ssrReliabilityRef$cu.status) === 'fail' ? ssrReliabilityRef.current.server : undefined);
571
565
  };
572
566
 
573
567
  // CXP-2723 TODO: should consider simplifying our analytics, and how
@@ -579,6 +573,6 @@ export var useFilePreview = function useFilePreview(_ref) {
579
573
  ssrReliabilityRef: ssrReliabilityRef,
580
574
  onImageError: onImageError,
581
575
  onImageLoad: onImageLoad,
582
- StoreSSRDataScript: StoreSSRDataScriptComponent
576
+ getScriptProps: getScriptProps
583
577
  };
584
578
  };
@@ -103,7 +103,7 @@ var MediaInlineCardLoader = /*#__PURE__*/function (_React$PureComponent) {
103
103
  ErrorBoundary = _this$state.ErrorBoundary;
104
104
  var analyticsContext = {
105
105
  packageVersion: "@atlaskit/media-card",
106
- packageName: "77.4.6",
106
+ packageName: "77.4.7",
107
107
  componentName: 'mediaInlineCard',
108
108
  component: 'mediaInlineCard'
109
109
  };
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { printFunctionCall, printScript } from '../printScript';
3
2
  // ----- WARNING -----
4
3
  // This is a very sensitive fraction of code.
@@ -48,14 +47,10 @@ var generateScript = function generateScript(identifier, dataURI, dimensions, er
48
47
  var functionCall = printFunctionCall(storeDataURI, getKey(identifier), dataURI, dimensions, error);
49
48
  return printScript([getMediaCardSSR.toString(), getMediaGlobalScope.toString(), functionCall]);
50
49
  };
51
- export var StoreSSRDataScript = function StoreSSRDataScript(_ref2) {
52
- var dataURI = _ref2.dataURI,
53
- identifier = _ref2.identifier,
54
- dimensions = _ref2.dimensions,
55
- error = _ref2.error;
56
- return /*#__PURE__*/React.createElement("script", {
50
+ export var generateScriptProps = function generateScriptProps(identifier, dataURI, dimensions, error) {
51
+ return {
57
52
  dangerouslySetInnerHTML: {
58
53
  __html: generateScript(identifier, dataURI, dimensions, error)
59
54
  }
60
- });
55
+ };
61
56
  };
@@ -1,2 +1,2 @@
1
- export { StoreSSRDataScript, GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, getKey } from './globalScope';
1
+ export { GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, generateScriptProps, getKey } from './globalScope';
2
2
  export { getSSRData } from './getSSRData';
@@ -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 = "77.4.6";
10
+ var packageVersion = "77.4.7";
11
11
  var concurrentExperience;
12
12
  var getExperience = function getExperience(id) {
13
13
  if (!concurrentExperience) {
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
- import { FileIdentifier, MediaClient, ImageResizeMode, MediaBlobUrlAttrs } from '@atlaskit/media-client';
3
- import { MediaTraceContext, SSR } from '@atlaskit/media-common';
1
+ /// <reference types="react" />
2
+ import { FileIdentifier, ImageResizeMode, MediaBlobUrlAttrs, MediaClient } from '@atlaskit/media-client';
3
+ import { MediaTraceContext, NumericalCardDimensions, SSR } from '@atlaskit/media-common';
4
4
  import { MediaCardError } from '../../errors';
5
5
  import { CardDimensions, CardPreview } from '../../types';
6
6
  import { SSRStatus } from '../../utils/analytics';
7
- import { NumericalCardDimensions } from '@atlaskit/media-common';
8
7
  export interface UseFilePreviewParams {
9
8
  /** Instance of file identifier. */
10
9
  readonly identifier: FileIdentifier;
@@ -31,8 +30,8 @@ export declare const useFilePreview: ({ resizeMode, identifier, ssr, mediaClient
31
30
  cardPreview: CardPreview | undefined;
32
31
  error: MediaCardError | undefined;
33
32
  nonCriticalError: MediaCardError | undefined;
34
- ssrReliabilityRef: React.MutableRefObject<SSRStatus>;
33
+ ssrReliabilityRef: import("react").MutableRefObject<SSRStatus>;
35
34
  onImageError: (newCardPreview?: CardPreview) => void;
36
35
  onImageLoad: (newCardPreview?: CardPreview) => void;
37
- StoreSSRDataScript: () => JSX.Element;
36
+ getScriptProps: () => import("react").ScriptHTMLAttributes<HTMLScriptElement>;
38
37
  };
@@ -12,10 +12,4 @@ export declare function getMediaGlobalScope(globalScope?: any): MediaGlobalScope
12
12
  export declare function getMediaCardSSR(globalScope?: any): MediaCardSsr;
13
13
  export declare const getKey: ({ id, collectionName, occurrenceKey }: FileIdentifier) => string;
14
14
  export declare const storeDataURI: (key: string, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo, globalScope?: any) => void;
15
- export type StoreSSRDataScriptProps = {
16
- identifier: FileIdentifier;
17
- dataURI?: string;
18
- dimensions?: NumericalCardDimensions;
19
- error?: MediaCardErrorInfo;
20
- };
21
- export declare const StoreSSRDataScript: React.FC<StoreSSRDataScriptProps>;
15
+ export declare const generateScriptProps: (identifier: FileIdentifier, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo) => React.ScriptHTMLAttributes<HTMLScriptElement>;
@@ -1,4 +1,4 @@
1
- export { StoreSSRDataScript, GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, getKey, } from './globalScope';
1
+ export { GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, generateScriptProps, getKey, } from './globalScope';
2
2
  export { getSSRData } from './getSSRData';
3
3
  export type { MediaCardSsrData, MediaCardSsr } from './types';
4
4
  export type { MediaGlobalScope } from './globalScope';
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
- import { FileIdentifier, MediaClient, ImageResizeMode, MediaBlobUrlAttrs } from '@atlaskit/media-client';
3
- import { MediaTraceContext, SSR } from '@atlaskit/media-common';
1
+ /// <reference types="react" />
2
+ import { FileIdentifier, ImageResizeMode, MediaBlobUrlAttrs, MediaClient } from '@atlaskit/media-client';
3
+ import { MediaTraceContext, NumericalCardDimensions, SSR } from '@atlaskit/media-common';
4
4
  import { MediaCardError } from '../../errors';
5
5
  import { CardDimensions, CardPreview } from '../../types';
6
6
  import { SSRStatus } from '../../utils/analytics';
7
- import { NumericalCardDimensions } from '@atlaskit/media-common';
8
7
  export interface UseFilePreviewParams {
9
8
  /** Instance of file identifier. */
10
9
  readonly identifier: FileIdentifier;
@@ -31,8 +30,8 @@ export declare const useFilePreview: ({ resizeMode, identifier, ssr, mediaClient
31
30
  cardPreview: CardPreview | undefined;
32
31
  error: MediaCardError | undefined;
33
32
  nonCriticalError: MediaCardError | undefined;
34
- ssrReliabilityRef: React.MutableRefObject<SSRStatus>;
33
+ ssrReliabilityRef: import("react").MutableRefObject<SSRStatus>;
35
34
  onImageError: (newCardPreview?: CardPreview) => void;
36
35
  onImageLoad: (newCardPreview?: CardPreview) => void;
37
- StoreSSRDataScript: () => JSX.Element;
36
+ getScriptProps: () => import("react").ScriptHTMLAttributes<HTMLScriptElement>;
38
37
  };
@@ -12,10 +12,4 @@ export declare function getMediaGlobalScope(globalScope?: any): MediaGlobalScope
12
12
  export declare function getMediaCardSSR(globalScope?: any): MediaCardSsr;
13
13
  export declare const getKey: ({ id, collectionName, occurrenceKey }: FileIdentifier) => string;
14
14
  export declare const storeDataURI: (key: string, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo, globalScope?: any) => void;
15
- export type StoreSSRDataScriptProps = {
16
- identifier: FileIdentifier;
17
- dataURI?: string;
18
- dimensions?: NumericalCardDimensions;
19
- error?: MediaCardErrorInfo;
20
- };
21
- export declare const StoreSSRDataScript: React.FC<StoreSSRDataScriptProps>;
15
+ export declare const generateScriptProps: (identifier: FileIdentifier, dataURI?: string, dimensions?: NumericalCardDimensions, error?: MediaCardErrorInfo) => React.ScriptHTMLAttributes<HTMLScriptElement>;
@@ -1,4 +1,4 @@
1
- export { StoreSSRDataScript, GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, getKey, } from './globalScope';
1
+ export { GLOBAL_MEDIA_NAMESPACE, GLOBAL_MEDIA_CARD_SSR, generateScriptProps, getKey, } from './globalScope';
2
2
  export { getSSRData } from './getSSRData';
3
3
  export type { MediaCardSsrData, MediaCardSsr } from './types';
4
4
  export type { MediaGlobalScope } from './globalScope';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-card",
3
- "version": "77.4.6",
3
+ "version": "77.4.7",
4
4
  "description": "Includes all media card related components, CardView, CardViewSmall, Card...",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,7 +41,7 @@
41
41
  "@atlaskit/editor-shared-styles": "^2.8.0",
42
42
  "@atlaskit/icon": "^22.0.0",
43
43
  "@atlaskit/media-client": "^25.1.0",
44
- "@atlaskit/media-client-react": "^1.4.0",
44
+ "@atlaskit/media-client-react": "^2.0.0",
45
45
  "@atlaskit/media-common": "^11.0.0",
46
46
  "@atlaskit/media-ui": "^25.0.0",
47
47
  "@atlaskit/media-viewer": "^48.2.0",
@@ -70,6 +70,7 @@
70
70
  "@atlaskit/media-core": "^34.1.0",
71
71
  "@atlaskit/media-picker": "^66.2.0",
72
72
  "@atlaskit/media-state": "^1.0.0",
73
+ "@atlaskit/media-test-data": "^1.0.0",
73
74
  "@atlaskit/media-test-helpers": "^33.0.0",
74
75
  "@atlaskit/ssr": "*",
75
76
  "@atlaskit/visual-regression": "*",