@atlaskit/media-table 10.0.1 → 11.0.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 +97 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/example-helpers/helpers.tsx +5 -1
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
# @atlaskit/media-table
|
|
2
2
|
|
|
3
|
+
## 11.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f862d5ae7aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f862d5ae7aa) - remove RxJs peer dependency
|
|
8
|
+
- [`118f3af101f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/118f3af101f) - Media Client APIs has been updated to use MediaSubscribable which provides subscription functionality (similar to RxJs observables).
|
|
9
|
+
It exposes subscribe method that is called with MediaObserver as an argument and returns MediaSubscription.
|
|
10
|
+
MediaSubscription exposes unsubscribe method.
|
|
11
|
+
|
|
12
|
+
getFileState:
|
|
13
|
+
The returned type of this function has changed from RxJs ReplaySubject to MediaSubscribable.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
import { MediaClient, MediaObserver, MediaSubscribable, MediaSubscription } from '@atlaskit/media-client';
|
|
17
|
+
|
|
18
|
+
const mediaClient = new MediaClient({ authProvider });
|
|
19
|
+
|
|
20
|
+
const fileStateSubscribable: MediaSubscribable<FileState> = mediaClient.file.getFileState(id);
|
|
21
|
+
|
|
22
|
+
const mediaObserver: MediaObserver<FileState> = {
|
|
23
|
+
next: (fileState) => {
|
|
24
|
+
nextCallback(fileState)
|
|
25
|
+
},
|
|
26
|
+
error: (error) => {
|
|
27
|
+
errorCallback(error)
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const subscription: MediaSubscription = fileStateSubscribable.subscribe(mediaObserver);
|
|
32
|
+
|
|
33
|
+
subscription.unsubscribe();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
upload:
|
|
37
|
+
The returned type of this function has changed from RxJs ReplaySubject to MediaSubscribable.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
import { MediaClient, MediaObserver, MediaSubscribable, MediaSubscription } from '@atlaskit/media-client';
|
|
41
|
+
|
|
42
|
+
const mediaClient = new MediaClient({ authProvider });
|
|
43
|
+
|
|
44
|
+
const uploadFileSubscribable: MediaSubscribable<FileState> = mediaClient.file.upload(uploadableFile);
|
|
45
|
+
|
|
46
|
+
const mediaObserver: MediaObserver<FileState> = {
|
|
47
|
+
next: (fileState) => {
|
|
48
|
+
nextCallback(fileState)
|
|
49
|
+
},
|
|
50
|
+
error: (error) => {
|
|
51
|
+
errorCallback(error)
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const subscription: MediaSubscription = uploadFileSubscribable.subscribe(mediaObserver);
|
|
56
|
+
|
|
57
|
+
subscription.unsubscribe();
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
getItems:
|
|
61
|
+
The returned type of this function has changed from RxJs ReplaySubject to MediaSubscribable.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
import { MediaClient, MediaObserver, MediaSubscribable, MediaSubscription } from '@atlaskit/media-client';
|
|
65
|
+
|
|
66
|
+
const mediaClient = new MediaClient({ authProvider });
|
|
67
|
+
|
|
68
|
+
const collectionItemsSubscribable: MediaSubscribable<MediaCollectionItem[]> = mediaClient.collection.getItems(collectionName);
|
|
69
|
+
|
|
70
|
+
const mediaObserver: MediaObserver<MediaCollectionItem[]> = {
|
|
71
|
+
next: (items) => {
|
|
72
|
+
nextCallback(items)
|
|
73
|
+
},
|
|
74
|
+
error: (error) => {
|
|
75
|
+
errorCallback(error)
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const subscription: MediaSubscription = collectionItemsSubscribable.subscribe(mediaObserver);
|
|
80
|
+
|
|
81
|
+
subscription.unsubscribe();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- Updated dependencies
|
|
87
|
+
|
|
88
|
+
## 10.0.3
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- Updated dependencies
|
|
93
|
+
|
|
94
|
+
## 10.0.2
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- [`6a5dc78b511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a5dc78b511) - Remove dateformat from media packages
|
|
99
|
+
|
|
3
100
|
## 10.0.1
|
|
4
101
|
|
|
5
102
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/version.json
CHANGED
package/dist/esm/version.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import dateFnsFormat from 'date-fns/format';
|
|
3
3
|
import { MediaType } from '@atlaskit/media-client';
|
|
4
4
|
import { ExampleWrapper, ROW_HIGHLIGHT_CLASSNAME } from './styled';
|
|
5
5
|
import Range from '@atlaskit/range';
|
|
@@ -21,6 +21,10 @@ export const createMockFileData = (name: string, mediaType: MediaType) => {
|
|
|
21
21
|
return <NameCell text={name} mediaType={mediaType} endFixedChars={4} />;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
const dateformat = (date: number, format = 'E MMM dd yyyy kk:mm:ss') => {
|
|
25
|
+
return dateFnsFormat(date, format);
|
|
26
|
+
};
|
|
27
|
+
|
|
24
28
|
export const RenderMediaTableWithFieldRange = (
|
|
25
29
|
MediaTableNode: React.ReactNode,
|
|
26
30
|
) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Table UI component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,40 +27,37 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atlaskit/analytics-next": "^8.0.0",
|
|
30
|
-
"@atlaskit/button": "^16.
|
|
30
|
+
"@atlaskit/button": "^16.2.0",
|
|
31
31
|
"@atlaskit/dynamic-table": "^14.5.0",
|
|
32
32
|
"@atlaskit/icon": "^21.10.0",
|
|
33
|
-
"@atlaskit/media-client": "^
|
|
34
|
-
"@atlaskit/media-ui": "^
|
|
35
|
-
"@atlaskit/media-viewer": "^46.
|
|
33
|
+
"@atlaskit/media-client": "^15.0.0",
|
|
34
|
+
"@atlaskit/media-ui": "^21.0.0",
|
|
35
|
+
"@atlaskit/media-viewer": "^46.2.0",
|
|
36
36
|
"@atlaskit/theme": "^12.1.0",
|
|
37
37
|
"@atlaskit/tooltip": "^17.5.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0",
|
|
39
39
|
"memoize-one": "^6.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/media-core": "^32.
|
|
42
|
+
"@atlaskit/media-core": "^32.3.0",
|
|
43
43
|
"react": "^16.8.0",
|
|
44
44
|
"react-dom": "^16.8.0",
|
|
45
45
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
46
|
-
"rxjs": "^5.5.0",
|
|
47
46
|
"styled-components": "^3.2.6"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
49
|
"@atlaskit/docs": "^9.0.0",
|
|
51
50
|
"@atlaskit/icon-file-type": "^6.3.0",
|
|
52
|
-
"@atlaskit/media-common": "^2.
|
|
53
|
-
"@atlaskit/media-core": "^32.
|
|
54
|
-
"@atlaskit/media-test-helpers": "^29.
|
|
51
|
+
"@atlaskit/media-common": "^2.11.0",
|
|
52
|
+
"@atlaskit/media-core": "^32.3.0",
|
|
53
|
+
"@atlaskit/media-test-helpers": "^29.3.0",
|
|
55
54
|
"@atlaskit/range": "^6.0.0",
|
|
56
55
|
"@atlaskit/ssr": "*",
|
|
57
56
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
58
|
-
"
|
|
59
|
-
"dateformat": "^4.5.1",
|
|
57
|
+
"date-fns": "^2.17.0",
|
|
60
58
|
"enzyme": "^3.10.0",
|
|
61
59
|
"react": "^16.8.0",
|
|
62
60
|
"react-dom": "^16.8.0",
|
|
63
|
-
"rxjs": "^5.5.0",
|
|
64
61
|
"styled-components": "^3.2.6",
|
|
65
62
|
"typescript": "3.9.6"
|
|
66
63
|
},
|