@atlaskit/editor-plugin-media 3.0.3 → 3.0.4
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 +9 -0
- package/dist/cjs/mediaPlugin.js +43 -22
- package/dist/cjs/nodeviews/mediaGroup.js +22 -20
- package/dist/cjs/nodeviews/mediaInline.js +43 -38
- package/dist/cjs/nodeviews/mediaNodeView/index.js +20 -11
- package/dist/cjs/nodeviews/mediaSingle.js +48 -43
- package/dist/cjs/ui/CommentBadge/index.js +26 -33
- package/dist/cjs/ui/MediaPicker/BrowserWrapper.js +2 -2
- package/dist/cjs/ui/MediaPicker/ClipboardWrapper.js +4 -4
- package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +72 -31
- package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +37 -9
- package/dist/cjs/ui/MediaPicker/index.js +32 -25
- package/dist/cjs/ui/ToolbarMedia/index.js +18 -13
- package/dist/cjs/ui/hooks/useMediaProvider.js +14 -9
- package/dist/es2019/mediaPlugin.js +47 -24
- package/dist/es2019/nodeviews/mediaGroup.js +23 -20
- package/dist/es2019/nodeviews/mediaInline.js +45 -39
- package/dist/es2019/nodeviews/mediaNodeView/index.js +22 -12
- package/dist/es2019/nodeviews/mediaSingle.js +49 -43
- package/dist/es2019/ui/CommentBadge/index.js +29 -35
- package/dist/es2019/ui/MediaPicker/BrowserWrapper.js +2 -2
- package/dist/es2019/ui/MediaPicker/ClipboardWrapper.js +4 -4
- package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +53 -14
- package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +37 -7
- package/dist/es2019/ui/MediaPicker/index.js +34 -26
- package/dist/es2019/ui/ToolbarMedia/index.js +20 -14
- package/dist/es2019/ui/hooks/useMediaProvider.js +16 -10
- package/dist/esm/mediaPlugin.js +44 -23
- package/dist/esm/nodeviews/mediaGroup.js +23 -21
- package/dist/esm/nodeviews/mediaInline.js +44 -39
- package/dist/esm/nodeviews/mediaNodeView/index.js +21 -12
- package/dist/esm/nodeviews/mediaSingle.js +49 -44
- package/dist/esm/ui/CommentBadge/index.js +27 -34
- package/dist/esm/ui/MediaPicker/BrowserWrapper.js +2 -2
- package/dist/esm/ui/MediaPicker/ClipboardWrapper.js +4 -4
- package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +72 -31
- package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +37 -9
- package/dist/esm/ui/MediaPicker/index.js +33 -26
- package/dist/esm/ui/ToolbarMedia/index.js +19 -14
- package/dist/esm/ui/hooks/useMediaProvider.js +15 -10
- package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +4 -3
- package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +4 -3
- package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +4 -4
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +4 -3
- package/dist/types/ui/MediaPicker/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +4 -3
- package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +4 -3
- package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +4 -4
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +4 -3
- package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
2
|
+
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var useSharedState = sharedPluginStateHookMigratorFactory(function (pluginInjectionApi) {
|
|
5
|
+
var mediaProvider = useSharedPluginStateSelector(pluginInjectionApi, 'media.mediaProvider');
|
|
6
|
+
return {
|
|
7
|
+
mediaProvider: mediaProvider
|
|
8
|
+
};
|
|
9
|
+
}, function (pluginInjectionApi) {
|
|
10
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['media']),
|
|
9
11
|
mediaState = _useSharedPluginState.mediaState;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
12
|
+
return {
|
|
13
|
+
mediaProvider: mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaProvider
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
export var useMediaProvider = function useMediaProvider(pluginInjectionApi) {
|
|
17
|
+
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
18
|
+
mediaProvider = _useSharedState.mediaProvider;
|
|
14
19
|
var provider = useMemo(function () {
|
|
15
20
|
return mediaProvider;
|
|
16
21
|
}, [mediaProvider]);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
-
import
|
|
4
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
5
|
type Props = {
|
|
5
|
-
|
|
6
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
6
7
|
isOpen?: boolean;
|
|
7
8
|
onBrowseFn: (browse: () => void) => void;
|
|
8
9
|
featureFlags?: MediaFeatureFlags;
|
|
9
10
|
};
|
|
10
|
-
export declare const BrowserWrapper: ({
|
|
11
|
+
export declare const BrowserWrapper: ({ api, isOpen, onBrowseFn, featureFlags }: Props) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
-
import
|
|
4
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
5
|
type Props = {
|
|
5
|
-
|
|
6
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
6
7
|
featureFlags?: MediaFeatureFlags;
|
|
7
8
|
container?: HTMLElement;
|
|
8
9
|
};
|
|
9
|
-
export declare const ClipboardWrapper: ({
|
|
10
|
+
export declare const ClipboardWrapper: ({ api, container, featureFlags }: Props) => React.JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import
|
|
4
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
|
-
|
|
6
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
isActive: boolean;
|
|
8
8
|
featureFlags?: MediaFeatureFlags;
|
|
9
9
|
editorDomElement: Element;
|
|
10
10
|
appearance: EditorAppearance;
|
|
11
11
|
};
|
|
12
|
-
export declare const DropzoneWrapper: ({
|
|
12
|
+
export declare const DropzoneWrapper: ({ api, isActive, featureFlags, editorDomElement, appearance, }: Props) => React.JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
3
4
|
import type { BrowserConfig, ClipboardConfig, DropzoneConfig } from '@atlaskit/media-picker/types';
|
|
5
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
6
|
import PickerFacade from '../../pm-plugins/picker-facade';
|
|
5
|
-
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
6
7
|
interface ChildrenProps {
|
|
7
8
|
config: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
8
9
|
mediaClientConfig: MediaClientConfig;
|
|
9
10
|
pickerFacadeInstance: PickerFacade;
|
|
10
11
|
}
|
|
11
12
|
export type Props = {
|
|
12
|
-
|
|
13
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
13
14
|
analyticsName: string;
|
|
14
15
|
children: (props: ChildrenProps) => React.ReactElement | null;
|
|
15
16
|
};
|
|
16
|
-
export default function PickerFacadeProvider({
|
|
17
|
+
export default function PickerFacadeProvider({ api, analyticsName, children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
17
18
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
-
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
5
4
|
type Props = {
|
|
6
|
-
mediaState: MediaPluginState;
|
|
7
5
|
editorDomElement: Element;
|
|
8
6
|
appearance: EditorAppearance;
|
|
9
7
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
8
|
+
onPopupToggle: (onPopupToggle: (isPopupOpened: boolean) => void) => void;
|
|
9
|
+
setBrowseFn: (nativeBrowseFn: () => void) => void;
|
|
10
10
|
};
|
|
11
11
|
type State = {
|
|
12
12
|
isPopupOpened: boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
-
import
|
|
4
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
5
|
type Props = {
|
|
5
|
-
|
|
6
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
6
7
|
isOpen?: boolean;
|
|
7
8
|
onBrowseFn: (browse: () => void) => void;
|
|
8
9
|
featureFlags?: MediaFeatureFlags;
|
|
9
10
|
};
|
|
10
|
-
export declare const BrowserWrapper: ({
|
|
11
|
+
export declare const BrowserWrapper: ({ api, isOpen, onBrowseFn, featureFlags }: Props) => React.JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
3
|
-
import
|
|
4
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
5
|
type Props = {
|
|
5
|
-
|
|
6
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
6
7
|
featureFlags?: MediaFeatureFlags;
|
|
7
8
|
container?: HTMLElement;
|
|
8
9
|
};
|
|
9
|
-
export declare const ClipboardWrapper: ({
|
|
10
|
+
export declare const ClipboardWrapper: ({ api, container, featureFlags }: Props) => React.JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import
|
|
4
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
|
-
|
|
6
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
isActive: boolean;
|
|
8
8
|
featureFlags?: MediaFeatureFlags;
|
|
9
9
|
editorDomElement: Element;
|
|
10
10
|
appearance: EditorAppearance;
|
|
11
11
|
};
|
|
12
|
-
export declare const DropzoneWrapper: ({
|
|
12
|
+
export declare const DropzoneWrapper: ({ api, isActive, featureFlags, editorDomElement, appearance, }: Props) => React.JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
3
4
|
import type { BrowserConfig, ClipboardConfig, DropzoneConfig } from '@atlaskit/media-picker/types';
|
|
5
|
+
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
6
|
import PickerFacade from '../../pm-plugins/picker-facade';
|
|
5
|
-
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
6
7
|
interface ChildrenProps {
|
|
7
8
|
config: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
8
9
|
mediaClientConfig: MediaClientConfig;
|
|
9
10
|
pickerFacadeInstance: PickerFacade;
|
|
10
11
|
}
|
|
11
12
|
export type Props = {
|
|
12
|
-
|
|
13
|
+
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
13
14
|
analyticsName: string;
|
|
14
15
|
children: (props: ChildrenProps) => React.ReactElement | null;
|
|
15
16
|
};
|
|
16
|
-
export default function PickerFacadeProvider({
|
|
17
|
+
export default function PickerFacadeProvider({ api, analyticsName, children }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
17
18
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
-
import type { MediaPluginState } from '../../pm-plugins/types';
|
|
5
4
|
type Props = {
|
|
6
|
-
mediaState: MediaPluginState;
|
|
7
5
|
editorDomElement: Element;
|
|
8
6
|
appearance: EditorAppearance;
|
|
9
7
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
8
|
+
onPopupToggle: (onPopupToggle: (isPopupOpened: boolean) => void) => void;
|
|
9
|
+
setBrowseFn: (nativeBrowseFn: () => void) => void;
|
|
10
10
|
};
|
|
11
11
|
type State = {
|
|
12
12
|
isPopupOpened: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.4",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
40
|
"@atlaskit/button": "^23.0.0",
|
|
41
|
-
"@atlaskit/editor-common": "^105.
|
|
41
|
+
"@atlaskit/editor-common": "^105.2.0",
|
|
42
42
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
43
|
-
"@atlaskit/editor-plugin-analytics": "^2.
|
|
43
|
+
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
44
44
|
"@atlaskit/editor-plugin-annotation": "^2.8.0",
|
|
45
45
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
46
46
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/primitives": "^14.7.0",
|
|
71
71
|
"@atlaskit/textfield": "^8.0.0",
|
|
72
72
|
"@atlaskit/theme": "^18.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^4.21.0",
|
|
74
74
|
"@atlaskit/tokens": "^4.8.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.0.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|