@atlaskit/media-common 13.2.0 → 13.3.1

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,23 @@
1
1
  # @atlaskit/media-common
2
2
 
3
+ ## 13.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2fe9a9909d2ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2fe9a9909d2ac) -
8
+ Enrol media packages into the React Compiler with platform gating via
9
+ isReactCompilerActivePlatform
10
+
11
+ ## 13.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`34c40eb233aa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34c40eb233aa4) -
16
+ isUxChange: true
17
+
18
+ Lazy-append document pages for MS Excel previews behind platform_media_excel_lazy_load gate to fix
19
+ initial-render freeze on very large documents
20
+
3
21
  ## 13.2.0
4
22
 
5
23
  ### Minor Changes
@@ -28,6 +28,12 @@ Object.defineProperty(exports, "isDocumentMimeTypeSupportedByServer", {
28
28
  return _isMimeTypeSupportedByServer.isDocumentMimeTypeSupportedByServer;
29
29
  }
30
30
  });
31
+ Object.defineProperty(exports, "isExcelFile", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _isExcelFile.isExcelFile;
35
+ }
36
+ });
31
37
  Object.defineProperty(exports, "isImageMimeTypeSupportedByBrowser", {
32
38
  enumerable: true,
33
39
  get: function get() {
@@ -73,6 +79,7 @@ Object.defineProperty(exports, "isVideoMimeTypeSupportedByServer", {
73
79
  var _isArchive = require("./isArchive");
74
80
  var _isMimeTypeSupportedByBrowser = require("./isMimeTypeSupportedByBrowser");
75
81
  var _isMimeTypeSupportedByServer = require("./isMimeTypeSupportedByServer");
82
+ var _isExcelFile = require("./isExcelFile");
76
83
  var getMediaTypeFromMimeType = exports.getMediaTypeFromMimeType = function getMediaTypeFromMimeType(mimeType) {
77
84
  if ((0, _isArchive.isArchive)(mimeType)) {
78
85
  return 'archive';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isExcelFile = void 0;
7
+ // MS Excel MIME types — covers all native Microsoft spreadsheet formats.
8
+ // Stored in their canonical form (RFC 4288 mimetypes are case-sensitive;
9
+ // the media backend always sends them in this exact casing).
10
+ var EXCEL_MIME_TYPES = new Set(['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'application/vnd.ms-excel.sheet.macroEnabled.12']);
11
+ var isExcelFile = exports.isExcelFile = function isExcelFile(mimeType) {
12
+ return EXCEL_MIME_TYPES.has(mimeType);
13
+ };
@@ -2,6 +2,7 @@ import { isArchive } from './isArchive';
2
2
  import { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from './isMimeTypeSupportedByBrowser';
3
3
  import { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer } from './isMimeTypeSupportedByServer';
4
4
  export { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser } from './isMimeTypeSupportedByBrowser';
5
+ export { isExcelFile } from './isExcelFile';
5
6
  export { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './isMimeTypeSupportedByServer';
6
7
  export const getMediaTypeFromMimeType = mimeType => {
7
8
  if (isArchive(mimeType)) {
@@ -0,0 +1,5 @@
1
+ // MS Excel MIME types — covers all native Microsoft spreadsheet formats.
2
+ // Stored in their canonical form (RFC 4288 mimetypes are case-sensitive;
3
+ // the media backend always sends them in this exact casing).
4
+ const EXCEL_MIME_TYPES = new Set(['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'application/vnd.ms-excel.sheet.macroEnabled.12']);
5
+ export const isExcelFile = mimeType => EXCEL_MIME_TYPES.has(mimeType);
@@ -2,6 +2,7 @@ import { isArchive } from './isArchive';
2
2
  import { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser } from './isMimeTypeSupportedByBrowser';
3
3
  import { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer } from './isMimeTypeSupportedByServer';
4
4
  export { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser } from './isMimeTypeSupportedByBrowser';
5
+ export { isExcelFile } from './isExcelFile';
5
6
  export { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer } from './isMimeTypeSupportedByServer';
6
7
  export var getMediaTypeFromMimeType = function getMediaTypeFromMimeType(mimeType) {
7
8
  if (isArchive(mimeType)) {
@@ -0,0 +1,7 @@
1
+ // MS Excel MIME types — covers all native Microsoft spreadsheet formats.
2
+ // Stored in their canonical form (RFC 4288 mimetypes are case-sensitive;
3
+ // the media backend always sends them in this exact casing).
4
+ var EXCEL_MIME_TYPES = new Set(['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'application/vnd.ms-excel.sheet.macroEnabled.12']);
5
+ export var isExcelFile = function isExcelFile(mimeType) {
6
+ return EXCEL_MIME_TYPES.has(mimeType);
7
+ };
@@ -1,4 +1,5 @@
1
1
  import { type MediaType } from '..';
2
2
  export { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, } from './isMimeTypeSupportedByBrowser';
3
+ export { isExcelFile } from './isExcelFile';
3
4
  export { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './isMimeTypeSupportedByServer';
4
5
  export declare const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
@@ -0,0 +1 @@
1
+ export declare const isExcelFile: (mimeType: string) => boolean;
@@ -1,4 +1,5 @@
1
1
  import { type MediaType } from '..';
2
2
  export { isImageMimeTypeSupportedByBrowser, isDocumentMimeTypeSupportedByBrowser, isAudioMimeTypeSupportedByBrowser, isVideoMimeTypeSupportedByBrowser, isMimeTypeSupportedByBrowser, } from './isMimeTypeSupportedByBrowser';
3
+ export { isExcelFile } from './isExcelFile';
3
4
  export { isImageMimeTypeSupportedByServer, isDocumentMimeTypeSupportedByServer, isAudioMimeTypeSupportedByServer, isVideoMimeTypeSupportedByServer, isUnknownMimeTypeSupportedByServer, isMimeTypeSupportedByServer, } from './isMimeTypeSupportedByServer';
4
5
  export declare const getMediaTypeFromMimeType: (mimeType: string) => MediaType;
@@ -0,0 +1 @@
1
+ export declare const isExcelFile: (mimeType: string) => boolean;
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/media-common/isExcelFile",
3
+ "main": "../dist/cjs/mediaTypeUtils/isExcelFile.js",
4
+ "module": "../dist/esm/mediaTypeUtils/isExcelFile.js",
5
+ "module:es2019": "../dist/es2019/mediaTypeUtils/isExcelFile.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/mediaTypeUtils/isExcelFile.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/mediaTypeUtils/isExcelFile.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "13.2.0",
3
+ "version": "13.3.1",
4
4
  "description": "Includes common utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,6 +23,13 @@
23
23
  "sideEffects": false,
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
+ "react-compiler": {
27
+ "enabled": true,
28
+ "gating": {
29
+ "source": "@atlassian/react-compiler-gating",
30
+ "importSpecifierName": "isReactCompilerActivePlatform"
31
+ }
32
+ },
26
33
  "team": "Media Exif",
27
34
  "website": {
28
35
  "name": "Media Common"
@@ -48,6 +55,7 @@
48
55
  }
49
56
  },
50
57
  "devDependencies": {
58
+ "@atlassian/react-compiler-gating": "workspace:^",
51
59
  "enzyme": "^3.10.0",
52
60
  "react": "^18.2.0",
53
61
  "react-dom": "^18.2.0"