@atlaskit/media-viewer 48.6.9 → 48.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/media-viewer
2
2
 
3
+ ## 48.6.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#116341](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116341)
8
+ [`d46cfd94ec3e5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d46cfd94ec3e5) -
9
+ Fized SVG zooming for Firefox and Safari
10
+
3
11
  ## 48.6.9
4
12
 
5
13
  ### Patch Changes
@@ -10,7 +10,7 @@ exports.packageVersion = exports.packageName = void 0;
10
10
  var _analytics = require("@atlaskit/media-common/analytics");
11
11
  var componentName = exports.component = exports.componentName = 'mediaViewer';
12
12
  var packageName = exports.packageName = "@atlaskit/media-viewer";
13
- var packageVersion = exports.packageVersion = "48.6.9";
13
+ var packageVersion = exports.packageVersion = "48.6.10";
14
14
  function getFileAttributes(fileState) {
15
15
  if (!fileState) {
16
16
  return {
@@ -12,7 +12,7 @@ var _mediaCommon = require("@atlaskit/media-common");
12
12
  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; }
13
13
  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; }
14
14
  var packageName = "@atlaskit/media-viewer";
15
- var packageVersion = "48.6.9";
15
+ var packageVersion = "48.6.10";
16
16
  var ufoExperience;
17
17
  var getExperience = function getExperience() {
18
18
  if (!ufoExperience) {
@@ -13,9 +13,13 @@ var clientRectangle = exports.clientRectangle = function clientRectangle(el) {
13
13
  return new _mediaUi.Rectangle(clientWidth, clientHeight);
14
14
  };
15
15
  var naturalSizeRectangle = exports.naturalSizeRectangle = function naturalSizeRectangle(el) {
16
+ // Firefox & Safari can't always read the "natural" dimensions correctly.
17
+ // When these are undefined or zero, we replace them with the rendered values
16
18
  var naturalWidth = el.naturalWidth,
17
- naturalHeight = el.naturalHeight;
18
- return new _mediaUi.Rectangle(naturalWidth, naturalHeight);
19
+ naturalHeight = el.naturalHeight,
20
+ width = el.width,
21
+ height = el.height;
22
+ return new _mediaUi.Rectangle(naturalWidth || width, naturalHeight || height);
19
23
  };
20
24
  function zoomLevelAfterResize(newCamera, oldCamera, oldZoomLevel) {
21
25
  var isImgScaledToFit = oldZoomLevel.value === oldCamera.scaleDownToFit;
@@ -1,7 +1,7 @@
1
1
  import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
2
2
  const componentName = 'mediaViewer';
3
3
  const packageName = "@atlaskit/media-viewer";
4
- const packageVersion = "48.6.9";
4
+ const packageVersion = "48.6.10";
5
5
  export { packageName, packageVersion, componentName, componentName as component };
6
6
  export function getFileAttributes(fileState) {
7
7
  if (!fileState) {
@@ -2,7 +2,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
2
2
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
3
3
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
4
4
  const packageName = "@atlaskit/media-viewer";
5
- const packageVersion = "48.6.9";
5
+ const packageVersion = "48.6.10";
6
6
  let ufoExperience;
7
7
  const getExperience = () => {
8
8
  if (!ufoExperience) {
@@ -8,11 +8,15 @@ export const clientRectangle = el => {
8
8
  return new Rectangle(clientWidth, clientHeight);
9
9
  };
10
10
  export const naturalSizeRectangle = el => {
11
+ // Firefox & Safari can't always read the "natural" dimensions correctly.
12
+ // When these are undefined or zero, we replace them with the rendered values
11
13
  const {
12
14
  naturalWidth,
13
- naturalHeight
15
+ naturalHeight,
16
+ width,
17
+ height
14
18
  } = el;
15
- return new Rectangle(naturalWidth, naturalHeight);
19
+ return new Rectangle(naturalWidth || width, naturalHeight || height);
16
20
  };
17
21
  export function zoomLevelAfterResize(newCamera, oldCamera, oldZoomLevel) {
18
22
  const isImgScaledToFit = oldZoomLevel.value === oldCamera.scaleDownToFit;
@@ -1,7 +1,7 @@
1
1
  import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
2
2
  var componentName = 'mediaViewer';
3
3
  var packageName = "@atlaskit/media-viewer";
4
- var packageVersion = "48.6.9";
4
+ var packageVersion = "48.6.10";
5
5
  export { packageName, packageVersion, componentName, componentName as component };
6
6
  export function getFileAttributes(fileState) {
7
7
  if (!fileState) {
@@ -5,7 +5,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
5
5
  import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
6
6
  import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
7
7
  var packageName = "@atlaskit/media-viewer";
8
- var packageVersion = "48.6.9";
8
+ var packageVersion = "48.6.10";
9
9
  var ufoExperience;
10
10
  var getExperience = function getExperience() {
11
11
  if (!ufoExperience) {
@@ -6,9 +6,13 @@ export var clientRectangle = function clientRectangle(el) {
6
6
  return new Rectangle(clientWidth, clientHeight);
7
7
  };
8
8
  export var naturalSizeRectangle = function naturalSizeRectangle(el) {
9
+ // Firefox & Safari can't always read the "natural" dimensions correctly.
10
+ // When these are undefined or zero, we replace them with the rendered values
9
11
  var naturalWidth = el.naturalWidth,
10
- naturalHeight = el.naturalHeight;
11
- return new Rectangle(naturalWidth, naturalHeight);
12
+ naturalHeight = el.naturalHeight,
13
+ width = el.width,
14
+ height = el.height;
15
+ return new Rectangle(naturalWidth || width, naturalHeight || height);
12
16
  };
13
17
  export function zoomLevelAfterResize(newCamera, oldCamera, oldZoomLevel) {
14
18
  var isImgScaledToFit = oldZoomLevel.value === oldCamera.scaleDownToFit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-viewer",
3
- "version": "48.6.9",
3
+ "version": "48.6.10",
4
4
  "description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"