@atlaskit/editor-plugin-media 1.31.4 → 1.31.6
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 +20 -0
- package/dist/cjs/nodeviews/mediaSingle.js +2 -1
- package/dist/cjs/ui/CommentBadge/index.js +10 -2
- package/dist/es2019/nodeviews/mediaSingle.js +2 -1
- package/dist/es2019/ui/CommentBadge/index.js +10 -2
- package/dist/esm/nodeviews/mediaSingle.js +2 -1
- package/dist/esm/ui/CommentBadge/index.js +10 -2
- package/dist/types/picker-facade.d.ts +1 -4
- package/dist/types/pm-plugins/main.d.ts +1 -2
- package/dist/types/pm-plugins/types.d.ts +1 -2
- package/dist/types/types.d.ts +3 -0
- package/dist/types-ts4.5/picker-facade.d.ts +1 -4
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -2
- package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -2
- package/dist/types-ts4.5/types.d.ts +3 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.31.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 1.31.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#140146](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/140146)
|
|
14
|
+
[`1d9fce7fc2523`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1d9fce7fc2523) -
|
|
15
|
+
[ux] [ED-24912] **@atlaskit/editor-plugin-media-insert**: Makes sure that users can upload
|
|
16
|
+
non-media files, users can also select multiple files from their local media browser to upload at
|
|
17
|
+
once **@atlaskit/editor-plugin-media**: Adds a type export for `MediaStateEventListener` &
|
|
18
|
+
`MediaStateEventSubscriber`
|
|
19
|
+
- [#139475](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139475)
|
|
20
|
+
[`6402db241c334`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6402db241c334) -
|
|
21
|
+
ED-24899 fix media disappears after dnd
|
|
22
|
+
|
|
3
23
|
## 1.31.4
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -454,7 +454,8 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
454
454
|
var isInsideTable = pos !== undefined && (0, _utils2.findParentNodeOfTypeClosestToPos)(state.doc.resolve(pos), [state.schema.nodes.table]);
|
|
455
455
|
var currentMediaElement = function currentMediaElement() {
|
|
456
456
|
if (pos !== undefined) {
|
|
457
|
-
|
|
457
|
+
var mediaNode = view.domAtPos(pos + 1).node;
|
|
458
|
+
return mediaNode instanceof HTMLElement ? mediaNode : null;
|
|
458
459
|
}
|
|
459
460
|
return null;
|
|
460
461
|
};
|
|
@@ -57,7 +57,14 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref) {
|
|
|
57
57
|
if (!isDrafting && hasNoComments || !mediaNode) {
|
|
58
58
|
return null;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* After performing certain operations like drag and drop,
|
|
63
|
+
* the position may momentarily shift. It will NOT always be an HTML element;
|
|
64
|
+
* it could also be plain text.
|
|
65
|
+
*/
|
|
66
|
+
var maybeMediaSingleElement = view.domAtPos(pos + 1).node;
|
|
67
|
+
var mediaSingleElement = maybeMediaSingleElement instanceof HTMLElement ? maybeMediaSingleElement : null;
|
|
61
68
|
return /*#__PURE__*/_react.default.createElement(_mediaSingle.CommentBadge, {
|
|
62
69
|
commentsOnMediaBugFixEnabled: commentsOnMediaBugFixEnabled,
|
|
63
70
|
badgeOffsetRight: badgeOffsetRight,
|
|
@@ -124,7 +131,8 @@ var CommentBadgeNextWrapper = exports.CommentBadgeNextWrapper = function Comment
|
|
|
124
131
|
if (!isDrafting && hasNoComments || !mediaNode) {
|
|
125
132
|
return null;
|
|
126
133
|
}
|
|
127
|
-
var
|
|
134
|
+
var maybeMediaSingleElement = view.domAtPos(pos + 1).node;
|
|
135
|
+
var mediaSingleElement = maybeMediaSingleElement instanceof HTMLElement ? maybeMediaSingleElement : null;
|
|
128
136
|
return /*#__PURE__*/_react.default.createElement(_mediaSingle.CommentBadgeNext, {
|
|
129
137
|
onClick: onClick,
|
|
130
138
|
mediaSingleElement: mediaSingleElement,
|
|
@@ -372,7 +372,8 @@ export default class MediaSingleNode extends Component {
|
|
|
372
372
|
const isInsideTable = pos !== undefined && findParentNodeOfTypeClosestToPos(state.doc.resolve(pos), [state.schema.nodes.table]);
|
|
373
373
|
const currentMediaElement = () => {
|
|
374
374
|
if (pos !== undefined) {
|
|
375
|
-
|
|
375
|
+
const mediaNode = view.domAtPos(pos + 1).node;
|
|
376
|
+
return mediaNode instanceof HTMLElement ? mediaNode : null;
|
|
376
377
|
}
|
|
377
378
|
return null;
|
|
378
379
|
};
|
|
@@ -50,7 +50,14 @@ const CommentBadgeWrapper = ({
|
|
|
50
50
|
if (!isDrafting && hasNoComments || !mediaNode) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* After performing certain operations like drag and drop,
|
|
56
|
+
* the position may momentarily shift. It will NOT always be an HTML element;
|
|
57
|
+
* it could also be plain text.
|
|
58
|
+
*/
|
|
59
|
+
const maybeMediaSingleElement = view.domAtPos(pos + 1).node;
|
|
60
|
+
const mediaSingleElement = maybeMediaSingleElement instanceof HTMLElement ? maybeMediaSingleElement : null;
|
|
54
61
|
return /*#__PURE__*/React.createElement(CommentBadgeComponent, {
|
|
55
62
|
commentsOnMediaBugFixEnabled: commentsOnMediaBugFixEnabled,
|
|
56
63
|
badgeOffsetRight: badgeOffsetRight,
|
|
@@ -117,7 +124,8 @@ export const CommentBadgeNextWrapper = ({
|
|
|
117
124
|
if (!isDrafting && hasNoComments || !mediaNode) {
|
|
118
125
|
return null;
|
|
119
126
|
}
|
|
120
|
-
const
|
|
127
|
+
const maybeMediaSingleElement = view.domAtPos(pos + 1).node;
|
|
128
|
+
const mediaSingleElement = maybeMediaSingleElement instanceof HTMLElement ? maybeMediaSingleElement : null;
|
|
121
129
|
return /*#__PURE__*/React.createElement(CommentBadgeNext, {
|
|
122
130
|
onClick: onClick,
|
|
123
131
|
mediaSingleElement: mediaSingleElement,
|
|
@@ -449,7 +449,8 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
449
449
|
var isInsideTable = pos !== undefined && findParentNodeOfTypeClosestToPos(state.doc.resolve(pos), [state.schema.nodes.table]);
|
|
450
450
|
var currentMediaElement = function currentMediaElement() {
|
|
451
451
|
if (pos !== undefined) {
|
|
452
|
-
|
|
452
|
+
var mediaNode = view.domAtPos(pos + 1).node;
|
|
453
|
+
return mediaNode instanceof HTMLElement ? mediaNode : null;
|
|
453
454
|
}
|
|
454
455
|
return null;
|
|
455
456
|
};
|
|
@@ -47,7 +47,14 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref) {
|
|
|
47
47
|
if (!isDrafting && hasNoComments || !mediaNode) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* After performing certain operations like drag and drop,
|
|
53
|
+
* the position may momentarily shift. It will NOT always be an HTML element;
|
|
54
|
+
* it could also be plain text.
|
|
55
|
+
*/
|
|
56
|
+
var maybeMediaSingleElement = view.domAtPos(pos + 1).node;
|
|
57
|
+
var mediaSingleElement = maybeMediaSingleElement instanceof HTMLElement ? maybeMediaSingleElement : null;
|
|
51
58
|
return /*#__PURE__*/React.createElement(CommentBadgeComponent, {
|
|
52
59
|
commentsOnMediaBugFixEnabled: commentsOnMediaBugFixEnabled,
|
|
53
60
|
badgeOffsetRight: badgeOffsetRight,
|
|
@@ -114,7 +121,8 @@ export var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref2) {
|
|
|
114
121
|
if (!isDrafting && hasNoComments || !mediaNode) {
|
|
115
122
|
return null;
|
|
116
123
|
}
|
|
117
|
-
var
|
|
124
|
+
var maybeMediaSingleElement = view.domAtPos(pos + 1).node;
|
|
125
|
+
var mediaSingleElement = maybeMediaSingleElement instanceof HTMLElement ? maybeMediaSingleElement : null;
|
|
118
126
|
return /*#__PURE__*/React.createElement(CommentBadgeNext, {
|
|
119
127
|
onClick: onClick,
|
|
120
128
|
mediaSingleElement: mediaSingleElement,
|
|
@@ -2,16 +2,13 @@ import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
|
2
2
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
4
|
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
|
-
import type { CustomMediaPicker, MediaState, MobileUploadEndEventPayload } from './types';
|
|
5
|
+
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from './types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
7
|
export type PickerFacadeConfig = {
|
|
8
8
|
mediaClientConfig: MediaClientConfig;
|
|
9
9
|
errorReporter: ErrorReportingHandler;
|
|
10
10
|
featureFlags?: MediaFeatureFlags;
|
|
11
11
|
};
|
|
12
|
-
type MediaStateEvent = MediaState;
|
|
13
|
-
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
14
|
-
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
|
15
12
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
16
13
|
export default class PickerFacade {
|
|
17
14
|
readonly config: PickerFacadeConfig;
|
|
@@ -10,9 +10,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
10
10
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
11
11
|
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
12
12
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
13
|
-
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
14
13
|
import PickerFacade from '../picker-facade';
|
|
15
|
-
import type { MediaOptions, MediaState, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
14
|
+
import type { MediaOptions, MediaState, MediaStateEventSubscriber, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
16
15
|
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
16
|
export type { MediaState };
|
|
18
17
|
export { stateKey } from './plugin-key';
|
|
@@ -5,9 +5,8 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
7
|
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
8
|
-
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
9
8
|
import type PickerFacade from '../picker-facade';
|
|
10
|
-
import type { MediaOptions, MediaState, ProsemirrorGetPosHandler } from '../types';
|
|
9
|
+
import type { MediaOptions, MediaState, MediaStateEventSubscriber, ProsemirrorGetPosHandler } from '../types';
|
|
11
10
|
export interface MediaNodeWithPosHandler {
|
|
12
11
|
node: PMNode;
|
|
13
12
|
getPos: ProsemirrorGetPosHandler;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -131,3 +131,6 @@ export interface ReactNodeProps {
|
|
|
131
131
|
export type ForwardRef = (node: HTMLElement | null) => void;
|
|
132
132
|
export type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
133
133
|
export type { MediaPluginState } from './pm-plugins/types';
|
|
134
|
+
type MediaStateEvent = MediaState;
|
|
135
|
+
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
136
|
+
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
|
@@ -2,16 +2,13 @@ import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
|
2
2
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
4
|
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
|
-
import type { CustomMediaPicker, MediaState, MobileUploadEndEventPayload } from './types';
|
|
5
|
+
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from './types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
7
|
export type PickerFacadeConfig = {
|
|
8
8
|
mediaClientConfig: MediaClientConfig;
|
|
9
9
|
errorReporter: ErrorReportingHandler;
|
|
10
10
|
featureFlags?: MediaFeatureFlags;
|
|
11
11
|
};
|
|
12
|
-
type MediaStateEvent = MediaState;
|
|
13
|
-
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
14
|
-
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
|
15
12
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
16
13
|
export default class PickerFacade {
|
|
17
14
|
readonly config: PickerFacadeConfig;
|
|
@@ -10,9 +10,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
10
10
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
11
11
|
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
12
12
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
13
|
-
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
14
13
|
import PickerFacade from '../picker-facade';
|
|
15
|
-
import type { MediaOptions, MediaState, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
14
|
+
import type { MediaOptions, MediaState, MediaStateEventSubscriber, getPosHandlerNode as ProsemirrorGetPosHandler } from '../types';
|
|
16
15
|
import type { MediaNodeWithPosHandler, MediaPluginState } from './types';
|
|
17
16
|
export type { MediaState };
|
|
18
17
|
export { stateKey } from './plugin-key';
|
|
@@ -5,9 +5,8 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
7
|
import type { MediaPluginOptions } from '../media-plugin-options';
|
|
8
|
-
import type { MediaStateEventSubscriber } from '../picker-facade';
|
|
9
8
|
import type PickerFacade from '../picker-facade';
|
|
10
|
-
import type { MediaOptions, MediaState, ProsemirrorGetPosHandler } from '../types';
|
|
9
|
+
import type { MediaOptions, MediaState, MediaStateEventSubscriber, ProsemirrorGetPosHandler } from '../types';
|
|
11
10
|
export interface MediaNodeWithPosHandler {
|
|
12
11
|
node: PMNode;
|
|
13
12
|
getPos: ProsemirrorGetPosHandler;
|
|
@@ -131,3 +131,6 @@ export interface ReactNodeProps {
|
|
|
131
131
|
export type ForwardRef = (node: HTMLElement | null) => void;
|
|
132
132
|
export type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
133
133
|
export type { MediaPluginState } from './pm-plugins/types';
|
|
134
|
+
type MediaStateEvent = MediaState;
|
|
135
|
+
export type MediaStateEventListener = (evt: MediaStateEvent) => void;
|
|
136
|
+
export type MediaStateEventSubscriber = (listener: MediaStateEventListener) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.31.
|
|
3
|
+
"version": "1.31.6",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^6.12.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
38
38
|
"@atlaskit/button": "^20.1.0",
|
|
39
|
-
"@atlaskit/editor-common": "^89.
|
|
39
|
+
"@atlaskit/editor-common": "^89.1.0",
|
|
40
40
|
"@atlaskit/editor-palette": "1.6.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
|
42
42
|
"@atlaskit/editor-plugin-annotation": "1.19.6",
|
|
43
43
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
44
44
|
"@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
|
|
45
45
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
46
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^1.
|
|
46
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^1.13.0",
|
|
47
47
|
"@atlaskit/editor-plugin-focus": "^1.3.0",
|
|
48
48
|
"@atlaskit/editor-plugin-grid": "^1.2.0",
|
|
49
49
|
"@atlaskit/editor-plugin-guideline": "^1.2.0",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
54
54
|
"@atlaskit/editor-tables": "^2.8.0",
|
|
55
55
|
"@atlaskit/form": "^10.5.0",
|
|
56
|
-
"@atlaskit/icon": "^22.
|
|
57
|
-
"@atlaskit/media-card": "^78.
|
|
58
|
-
"@atlaskit/media-client": "^
|
|
56
|
+
"@atlaskit/icon": "^22.17.0",
|
|
57
|
+
"@atlaskit/media-card": "^78.3.0",
|
|
58
|
+
"@atlaskit/media-client": "^28.0.0",
|
|
59
59
|
"@atlaskit/media-client-react": "^2.2.0",
|
|
60
60
|
"@atlaskit/media-common": "^11.4.0",
|
|
61
61
|
"@atlaskit/media-filmstrip": "^47.2.0",
|
|
62
62
|
"@atlaskit/media-picker": "^66.5.0",
|
|
63
63
|
"@atlaskit/media-ui": "^25.11.0",
|
|
64
|
-
"@atlaskit/media-viewer": "^48.
|
|
64
|
+
"@atlaskit/media-viewer": "^48.8.0",
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
66
66
|
"@atlaskit/primitives": "^12.1.0",
|
|
67
67
|
"@atlaskit/textfield": "^6.5.0",
|