@atlaskit/media-ui 25.9.1 → 25.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/media-ui
2
2
 
3
+ ## 25.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#96985](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/96985)
8
+ [`024d611d1aee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/024d611d1aee) -
9
+ clean up html image dimensions FF
10
+
3
11
  ## 25.9.1
4
12
 
5
13
  ### Patch Changes
@@ -54,7 +54,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
54
54
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // Keep media player components used in media-viewer to use static colors from the new color palette to
55
55
  // support the hybrid theming in media viewer https://product-fabric.atlassian.net/browse/DSP-6067
56
56
  var packageName = "@atlaskit/media-ui";
57
- var packageVersion = "25.9.1";
57
+ var packageVersion = "25.10.0";
58
58
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
59
59
  var SMALL_VIDEO_MAX_WIDTH = 160;
60
60
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -30,7 +30,6 @@ Object.defineProperty(exports, "isRotated", {
30
30
  exports.readImageMetaData = readImageMetaData;
31
31
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
32
32
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
33
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
34
33
  var _types = require("./types");
35
34
  var _metatags = require("./metatags");
36
35
  var _util = require("../util");
@@ -156,7 +155,7 @@ function readImageMetaData(_x3) {
156
155
  }
157
156
  function _readImageMetaData() {
158
157
  _readImageMetaData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(fileInfo) {
159
- var file, src, type, width, height, tags, orientation, isImageRotated, data, img, _readImageNaturalOrie, _width, _height;
158
+ var file, src, type, width, height, tags, data, img, _readImageNaturalOrie, _width, _height;
160
159
  return _regenerator.default.wrap(function _callee3$(_context3) {
161
160
  while (1) switch (_context3.prev = _context3.next) {
162
161
  case 0:
@@ -175,9 +174,6 @@ function _readImageMetaData() {
175
174
  if (tags && tags.PixelXDimension) {
176
175
  height = getMetaTagNumericValue(tags, 'PixelYDimension', 0);
177
176
  }
178
- // otherwise, load the image async (ideally avoid if found above due to being slightly expensive)
179
- orientation = getOrientationFromTags(tags);
180
- isImageRotated = (0, _imageOrientationUtil.isRotated)(orientation);
181
177
  data = {
182
178
  type: type,
183
179
  width: width,
@@ -193,33 +189,29 @@ function _readImageMetaData() {
193
189
  * https://jira.atlassian.com/browse/CONFCLOUD-78275
194
190
  * The best way to get accurate dimensions is by loading images into the HTML, which reflects the actual dimensions the browser will render
195
191
  */
196
- if (!((0, _platformFeatureFlags.getBooleanFF)('platform.corex.html-image-dimensions_18x3l') || isImageRotated || width === 0 && height === 0)) {
197
- _context3.next = 27;
198
- break;
199
- }
200
- _context3.prev = 13;
201
- _context3.next = 16;
192
+ _context3.prev = 10;
193
+ _context3.next = 13;
202
194
  return (0, _util.loadImage)(src);
203
- case 16:
195
+ case 13:
204
196
  img = _context3.sent;
205
197
  _readImageNaturalOrie = (0, _util.readImageNaturalOrientationFromDOM)(img), _width = _readImageNaturalOrie.width, _height = _readImageNaturalOrie.height;
206
198
  data.width = _width;
207
199
  data.height = _height;
208
200
  data.naturalWidth = img.naturalWidth;
209
201
  data.naturalHeight = img.naturalHeight;
210
- _context3.next = 27;
202
+ _context3.next = 24;
211
203
  break;
212
- case 24:
213
- _context3.prev = 24;
214
- _context3.t0 = _context3["catch"](13);
204
+ case 21:
205
+ _context3.prev = 21;
206
+ _context3.t0 = _context3["catch"](10);
215
207
  return _context3.abrupt("return", null);
216
- case 27:
208
+ case 24:
217
209
  return _context3.abrupt("return", data);
218
- case 28:
210
+ case 25:
219
211
  case "end":
220
212
  return _context3.stop();
221
213
  }
222
- }, _callee3, null, [[13, 24]]);
214
+ }, _callee3, null, [[10, 21]]);
223
215
  }));
224
216
  return _readImageMetaData.apply(this, arguments);
225
217
  }
@@ -37,7 +37,7 @@ import { SkipTenBackwardIcon, SkipTenForwardIcon } from './icons';
37
37
  import { getControlsWrapperClassName } from './getControlsWrapperClassName';
38
38
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
39
39
  const packageName = "@atlaskit/media-ui";
40
- const packageVersion = "25.9.1";
40
+ const packageVersion = "25.10.0";
41
41
  const MEDIUM_VIDEO_MAX_WIDTH = 400;
42
42
  const SMALL_VIDEO_MAX_WIDTH = 160;
43
43
  const MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -1,8 +1,6 @@
1
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
2
1
  import { SupportedImageMetaTag, ExifOrientation } from './types';
3
2
  import { readImageMetaTags } from './metatags';
4
3
  import { loadImage, readImageNaturalOrientationFromDOM } from '../util';
5
- import { isRotated } from './imageOrientationUtil';
6
4
  const {
7
5
  Orientation,
8
6
  XResolution
@@ -103,9 +101,6 @@ export async function readImageMetaData(fileInfo) {
103
101
  if (tags && tags.PixelXDimension) {
104
102
  height = getMetaTagNumericValue(tags, 'PixelYDimension', 0);
105
103
  }
106
- // otherwise, load the image async (ideally avoid if found above due to being slightly expensive)
107
- const orientation = getOrientationFromTags(tags);
108
- const isImageRotated = isRotated(orientation);
109
104
  const data = {
110
105
  type,
111
106
  width,
@@ -122,20 +117,18 @@ export async function readImageMetaData(fileInfo) {
122
117
  * https://jira.atlassian.com/browse/CONFCLOUD-78275
123
118
  * The best way to get accurate dimensions is by loading images into the HTML, which reflects the actual dimensions the browser will render
124
119
  */
125
- if (getBooleanFF('platform.corex.html-image-dimensions_18x3l') || isImageRotated || width === 0 && height === 0) {
126
- try {
127
- const img = await loadImage(src);
128
- const {
129
- width,
130
- height
131
- } = readImageNaturalOrientationFromDOM(img);
132
- data.width = width;
133
- data.height = height;
134
- data.naturalWidth = img.naturalWidth;
135
- data.naturalHeight = img.naturalHeight;
136
- } catch (e) {
137
- return null;
138
- }
120
+ try {
121
+ const img = await loadImage(src);
122
+ const {
123
+ width,
124
+ height
125
+ } = readImageNaturalOrientationFromDOM(img);
126
+ data.width = width;
127
+ data.height = height;
128
+ data.naturalWidth = img.naturalWidth;
129
+ data.naturalHeight = img.naturalHeight;
130
+ } catch (e) {
131
+ return null;
139
132
  }
140
133
  return data;
141
134
  }
@@ -47,7 +47,7 @@ import { SkipTenBackwardIcon, SkipTenForwardIcon } from './icons';
47
47
  import { getControlsWrapperClassName } from './getControlsWrapperClassName';
48
48
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
49
49
  var packageName = "@atlaskit/media-ui";
50
- var packageVersion = "25.9.1";
50
+ var packageVersion = "25.10.0";
51
51
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
52
52
  var SMALL_VIDEO_MAX_WIDTH = 160;
53
53
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -1,10 +1,8 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
3
  import { SupportedImageMetaTag, ExifOrientation } from './types';
5
4
  import { readImageMetaTags } from './metatags';
6
5
  import { loadImage, readImageNaturalOrientationFromDOM } from '../util';
7
- import { isRotated } from './imageOrientationUtil';
8
6
  var Orientation = SupportedImageMetaTag.Orientation,
9
7
  XResolution = SupportedImageMetaTag.XResolution;
10
8
 
@@ -127,7 +125,7 @@ export function readImageMetaData(_x3) {
127
125
  }
128
126
  function _readImageMetaData() {
129
127
  _readImageMetaData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileInfo) {
130
- var file, src, type, width, height, tags, orientation, isImageRotated, data, img, _readImageNaturalOrie, _width, _height;
128
+ var file, src, type, width, height, tags, data, img, _readImageNaturalOrie, _width, _height;
131
129
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
132
130
  while (1) switch (_context3.prev = _context3.next) {
133
131
  case 0:
@@ -146,9 +144,6 @@ function _readImageMetaData() {
146
144
  if (tags && tags.PixelXDimension) {
147
145
  height = getMetaTagNumericValue(tags, 'PixelYDimension', 0);
148
146
  }
149
- // otherwise, load the image async (ideally avoid if found above due to being slightly expensive)
150
- orientation = getOrientationFromTags(tags);
151
- isImageRotated = isRotated(orientation);
152
147
  data = {
153
148
  type: type,
154
149
  width: width,
@@ -164,33 +159,29 @@ function _readImageMetaData() {
164
159
  * https://jira.atlassian.com/browse/CONFCLOUD-78275
165
160
  * The best way to get accurate dimensions is by loading images into the HTML, which reflects the actual dimensions the browser will render
166
161
  */
167
- if (!(getBooleanFF('platform.corex.html-image-dimensions_18x3l') || isImageRotated || width === 0 && height === 0)) {
168
- _context3.next = 27;
169
- break;
170
- }
171
- _context3.prev = 13;
172
- _context3.next = 16;
162
+ _context3.prev = 10;
163
+ _context3.next = 13;
173
164
  return loadImage(src);
174
- case 16:
165
+ case 13:
175
166
  img = _context3.sent;
176
167
  _readImageNaturalOrie = readImageNaturalOrientationFromDOM(img), _width = _readImageNaturalOrie.width, _height = _readImageNaturalOrie.height;
177
168
  data.width = _width;
178
169
  data.height = _height;
179
170
  data.naturalWidth = img.naturalWidth;
180
171
  data.naturalHeight = img.naturalHeight;
181
- _context3.next = 27;
172
+ _context3.next = 24;
182
173
  break;
183
- case 24:
184
- _context3.prev = 24;
185
- _context3.t0 = _context3["catch"](13);
174
+ case 21:
175
+ _context3.prev = 21;
176
+ _context3.t0 = _context3["catch"](10);
186
177
  return _context3.abrupt("return", null);
187
- case 27:
178
+ case 24:
188
179
  return _context3.abrupt("return", data);
189
- case 28:
180
+ case 25:
190
181
  case "end":
191
182
  return _context3.stop();
192
183
  }
193
- }, _callee3, null, [[13, 24]]);
184
+ }, _callee3, null, [[10, 21]]);
194
185
  }));
195
186
  return _readImageMetaData.apply(this, arguments);
196
187
  }
@@ -1,4 +1,4 @@
1
- import { ImageInfo, ImageMetaData, ImageMetaDataTags, FileInfo } from './types';
1
+ import { type ImageInfo, type ImageMetaData, type ImageMetaDataTags, type FileInfo } from './types';
2
2
  export { ExifOrientation } from './types';
3
3
  export type { ImageInfo, ImageMetaData, ImageMetaDataTags, FileInfo, } from './types';
4
4
  export declare function getImageInfo(fileInfo: FileInfo): Promise<ImageInfo | null>;
@@ -1,4 +1,4 @@
1
- import { ImageInfo, ImageMetaData, ImageMetaDataTags, FileInfo } from './types';
1
+ import { type ImageInfo, type ImageMetaData, type ImageMetaDataTags, type FileInfo } from './types';
2
2
  export { ExifOrientation } from './types';
3
3
  export type { ImageInfo, ImageMetaData, ImageMetaDataTags, FileInfo, } from './types';
4
4
  export declare function getImageInfo(fileInfo: FileInfo): Promise<ImageInfo | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-ui",
3
- "version": "25.9.1",
3
+ "version": "25.10.0",
4
4
  "description": "Includes common components and utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -115,9 +115,6 @@
115
115
  },
116
116
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
117
117
  "platform-feature-flags": {
118
- "platform.corex.html-image-dimensions_18x3l": {
119
- "type": "boolean"
120
- },
121
118
  "platform.editor.a11y_video_controls_keyboard_support_yhcxh": {
122
119
  "type": "boolean"
123
120
  }