@atlaskit/editor-plugin-media-insert 9.2.4 → 9.2.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 +16 -0
- package/dist/types/mediaInsertPluginType.d.ts +6 -6
- package/dist/types/pm-plugins/actions.d.ts +1 -1
- package/dist/types/types/index.d.ts +7 -7
- package/dist/types/ui/LocalMedia.d.ts +2 -2
- package/dist/types/ui/MediaFromURL.d.ts +5 -5
- package/dist/types/ui/types.d.ts +3 -3
- package/dist/types-ts4.5/mediaInsertPluginType.d.ts +6 -6
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +1 -1
- package/dist/types-ts4.5/types/index.d.ts +7 -7
- package/dist/types-ts4.5/ui/LocalMedia.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaFromURL.d.ts +5 -5
- package/dist/types-ts4.5/ui/types.d.ts +3 -3
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media-insert
|
|
2
2
|
|
|
3
|
+
## 9.2.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
|
|
8
|
+
EDITOR-1442 Bump adf-schema
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 9.2.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
16
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 9.2.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -6,8 +6,8 @@ import type { CustomizedHelperMessage } from './types';
|
|
|
6
6
|
export type MediaInsertPluginState = {
|
|
7
7
|
isOpen?: boolean;
|
|
8
8
|
mountInfo?: {
|
|
9
|
-
ref: HTMLElement;
|
|
10
9
|
mountPoint: HTMLElement;
|
|
10
|
+
ref: HTMLElement;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export type MediaInsertPluginDependencies = [
|
|
@@ -17,11 +17,13 @@ export type MediaInsertPluginDependencies = [
|
|
|
17
17
|
];
|
|
18
18
|
export type MediaInsertPluginCommands = {
|
|
19
19
|
showMediaInsertPopup: (mountInfo?: {
|
|
20
|
-
ref: HTMLElement;
|
|
21
20
|
mountPoint: HTMLElement;
|
|
21
|
+
ref: HTMLElement;
|
|
22
22
|
}) => EditorCommand;
|
|
23
23
|
};
|
|
24
24
|
export type MediaInsertPluginConfig = {
|
|
25
|
+
customizedHelperMessage?: CustomizedHelperMessage;
|
|
26
|
+
customizedUrlValidation?: (input: string) => boolean;
|
|
25
27
|
/**
|
|
26
28
|
* This will only allow users to insert media using URLs, they cannot insert media using files from their computer.
|
|
27
29
|
* Files that are inserted with a URL will attempt to be uploaded using `editor-plugin-media`
|
|
@@ -51,12 +53,10 @@ export type MediaInsertPluginConfig = {
|
|
|
51
53
|
* ```
|
|
52
54
|
*/
|
|
53
55
|
isOnlyExternalLinks?: boolean;
|
|
54
|
-
customizedUrlValidation?: (input: string) => boolean;
|
|
55
|
-
customizedHelperMessage?: CustomizedHelperMessage;
|
|
56
56
|
};
|
|
57
57
|
export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
58
|
-
dependencies: MediaInsertPluginDependencies;
|
|
59
|
-
sharedState: MediaInsertPluginState;
|
|
60
58
|
commands: MediaInsertPluginCommands;
|
|
59
|
+
dependencies: MediaInsertPluginDependencies;
|
|
61
60
|
pluginConfiguration: MediaInsertPluginConfig | undefined;
|
|
61
|
+
sharedState: MediaInsertPluginState;
|
|
62
62
|
}>;
|
|
@@ -3,7 +3,7 @@ export type MediaInsertPluginAction = typeof ACTION_OPEN_POPUP | typeof ACTION_C
|
|
|
3
3
|
export declare const ACTION_OPEN_POPUP = "OPEN_POPUP";
|
|
4
4
|
export declare const ACTION_CLOSE_POPUP = "CLOSE_POPUP";
|
|
5
5
|
export declare const showMediaInsertPopup: (tr: Transaction, mountInfo?: {
|
|
6
|
-
ref: HTMLElement;
|
|
7
6
|
mountPoint: HTMLElement;
|
|
7
|
+
ref: HTMLElement;
|
|
8
8
|
}) => Transaction;
|
|
9
9
|
export declare const closeMediaInsertPicker: (tr: Transaction) => Transaction;
|
|
@@ -4,28 +4,28 @@ import type { UiComponentFactoryParams, ExtractInjectionAPI } from '@atlaskit/ed
|
|
|
4
4
|
import { type MediaState, type MediaStateEventSubscriber } from '@atlaskit/editor-plugin-media/types';
|
|
5
5
|
import type { MediaInsertPlugin, MediaInsertPluginConfig } from '../mediaInsertPluginType';
|
|
6
6
|
export type InsertMediaSingle = (props: {
|
|
7
|
-
mediaState: MediaState;
|
|
8
7
|
inputMethod: InputMethodInsertMedia;
|
|
8
|
+
mediaState: MediaState;
|
|
9
9
|
}) => boolean;
|
|
10
10
|
export type CustomizedHelperMessage = string;
|
|
11
11
|
export type InsertExternalMediaSingle = (props: {
|
|
12
|
-
url: string;
|
|
13
12
|
alt: string;
|
|
14
13
|
inputMethod: InputMethodInsertMedia;
|
|
14
|
+
url: string;
|
|
15
15
|
}) => boolean;
|
|
16
16
|
export type InsertFile = (props: {
|
|
17
|
-
mediaState: MediaState;
|
|
18
17
|
inputMethod: InputMethodInsertMedia;
|
|
18
|
+
mediaState: MediaState;
|
|
19
19
|
onMediaStateChanged: MediaStateEventSubscriber;
|
|
20
20
|
}) => boolean;
|
|
21
21
|
export type MediaInsertPickerProps = Pick<UiComponentFactoryParams, 'editorView' | 'dispatchAnalyticsEvent' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement'> & {
|
|
22
22
|
api?: ExtractInjectionAPI<MediaInsertPlugin>;
|
|
23
23
|
closeMediaInsertPicker: () => void;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
customizedHelperMessage?: MediaInsertPluginConfig['customizedHelperMessage'];
|
|
25
|
+
customizedUrlValidation?: MediaInsertPluginConfig['customizedUrlValidation'];
|
|
26
26
|
insertExternalMediaSingle: InsertExternalMediaSingle;
|
|
27
27
|
insertFile: InsertFile;
|
|
28
|
+
insertMediaSingle: InsertMediaSingle;
|
|
28
29
|
isOnlyExternalLinks: MediaInsertPluginConfig['isOnlyExternalLinks'];
|
|
29
|
-
|
|
30
|
-
customizedHelperMessage?: MediaInsertPluginConfig['customizedHelperMessage'];
|
|
30
|
+
mediaProvider?: Providers['mediaProvider'];
|
|
31
31
|
};
|
|
@@ -3,10 +3,10 @@ import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { type InsertFile } from '../types';
|
|
5
5
|
type Props = {
|
|
6
|
-
mediaProvider: MediaProvider;
|
|
7
|
-
insertFile: InsertFile;
|
|
8
6
|
closeMediaInsertPicker: () => void;
|
|
9
7
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
8
|
+
insertFile: InsertFile;
|
|
9
|
+
mediaProvider: MediaProvider;
|
|
10
10
|
};
|
|
11
11
|
export declare const LocalMedia: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
export {};
|
|
@@ -4,14 +4,14 @@ import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
|
4
4
|
import { type CustomizedHelperMessage, type InsertExternalMediaSingle, type InsertMediaSingle } from '../types';
|
|
5
5
|
export declare const isValidUrl: (value: string) => boolean;
|
|
6
6
|
type Props = {
|
|
7
|
-
mediaProvider: MediaProvider;
|
|
8
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
9
7
|
closeMediaInsertPicker: () => void;
|
|
10
|
-
|
|
8
|
+
customizedHelperMessage?: CustomizedHelperMessage;
|
|
9
|
+
customizedUrlValidation?: (input: string) => boolean;
|
|
10
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
11
11
|
insertExternalMediaSingle: InsertExternalMediaSingle;
|
|
12
|
+
insertMediaSingle: InsertMediaSingle;
|
|
12
13
|
isOnlyExternalLinks: boolean;
|
|
13
|
-
|
|
14
|
-
customizedHelperMessage?: CustomizedHelperMessage;
|
|
14
|
+
mediaProvider: MediaProvider;
|
|
15
15
|
};
|
|
16
16
|
export declare function MediaFromURL({ mediaProvider, dispatchAnalyticsEvent, closeMediaInsertPicker, insertMediaSingle, insertExternalMediaSingle, isOnlyExternalLinks, customizedUrlValidation, customizedHelperMessage, }: Props): React.JSX.Element;
|
|
17
17
|
export {};
|
package/dist/types/ui/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type OnInsertAttrs = {
|
|
2
|
-
id: string;
|
|
3
2
|
collection: string | undefined;
|
|
4
3
|
dimensions?: {
|
|
5
|
-
width: number;
|
|
6
4
|
height: number;
|
|
5
|
+
width: number;
|
|
7
6
|
};
|
|
8
|
-
occurrenceKey: string | undefined;
|
|
9
7
|
fileMimeType: string;
|
|
8
|
+
id: string;
|
|
9
|
+
occurrenceKey: string | undefined;
|
|
10
10
|
};
|
|
@@ -6,8 +6,8 @@ import type { CustomizedHelperMessage } from './types';
|
|
|
6
6
|
export type MediaInsertPluginState = {
|
|
7
7
|
isOpen?: boolean;
|
|
8
8
|
mountInfo?: {
|
|
9
|
-
ref: HTMLElement;
|
|
10
9
|
mountPoint: HTMLElement;
|
|
10
|
+
ref: HTMLElement;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export type MediaInsertPluginDependencies = [
|
|
@@ -17,11 +17,13 @@ export type MediaInsertPluginDependencies = [
|
|
|
17
17
|
];
|
|
18
18
|
export type MediaInsertPluginCommands = {
|
|
19
19
|
showMediaInsertPopup: (mountInfo?: {
|
|
20
|
-
ref: HTMLElement;
|
|
21
20
|
mountPoint: HTMLElement;
|
|
21
|
+
ref: HTMLElement;
|
|
22
22
|
}) => EditorCommand;
|
|
23
23
|
};
|
|
24
24
|
export type MediaInsertPluginConfig = {
|
|
25
|
+
customizedHelperMessage?: CustomizedHelperMessage;
|
|
26
|
+
customizedUrlValidation?: (input: string) => boolean;
|
|
25
27
|
/**
|
|
26
28
|
* This will only allow users to insert media using URLs, they cannot insert media using files from their computer.
|
|
27
29
|
* Files that are inserted with a URL will attempt to be uploaded using `editor-plugin-media`
|
|
@@ -51,12 +53,10 @@ export type MediaInsertPluginConfig = {
|
|
|
51
53
|
* ```
|
|
52
54
|
*/
|
|
53
55
|
isOnlyExternalLinks?: boolean;
|
|
54
|
-
customizedUrlValidation?: (input: string) => boolean;
|
|
55
|
-
customizedHelperMessage?: CustomizedHelperMessage;
|
|
56
56
|
};
|
|
57
57
|
export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
58
|
-
dependencies: MediaInsertPluginDependencies;
|
|
59
|
-
sharedState: MediaInsertPluginState;
|
|
60
58
|
commands: MediaInsertPluginCommands;
|
|
59
|
+
dependencies: MediaInsertPluginDependencies;
|
|
61
60
|
pluginConfiguration: MediaInsertPluginConfig | undefined;
|
|
61
|
+
sharedState: MediaInsertPluginState;
|
|
62
62
|
}>;
|
|
@@ -3,7 +3,7 @@ export type MediaInsertPluginAction = typeof ACTION_OPEN_POPUP | typeof ACTION_C
|
|
|
3
3
|
export declare const ACTION_OPEN_POPUP = "OPEN_POPUP";
|
|
4
4
|
export declare const ACTION_CLOSE_POPUP = "CLOSE_POPUP";
|
|
5
5
|
export declare const showMediaInsertPopup: (tr: Transaction, mountInfo?: {
|
|
6
|
-
ref: HTMLElement;
|
|
7
6
|
mountPoint: HTMLElement;
|
|
7
|
+
ref: HTMLElement;
|
|
8
8
|
}) => Transaction;
|
|
9
9
|
export declare const closeMediaInsertPicker: (tr: Transaction) => Transaction;
|
|
@@ -4,28 +4,28 @@ import type { UiComponentFactoryParams, ExtractInjectionAPI } from '@atlaskit/ed
|
|
|
4
4
|
import { type MediaState, type MediaStateEventSubscriber } from '@atlaskit/editor-plugin-media/types';
|
|
5
5
|
import type { MediaInsertPlugin, MediaInsertPluginConfig } from '../mediaInsertPluginType';
|
|
6
6
|
export type InsertMediaSingle = (props: {
|
|
7
|
-
mediaState: MediaState;
|
|
8
7
|
inputMethod: InputMethodInsertMedia;
|
|
8
|
+
mediaState: MediaState;
|
|
9
9
|
}) => boolean;
|
|
10
10
|
export type CustomizedHelperMessage = string;
|
|
11
11
|
export type InsertExternalMediaSingle = (props: {
|
|
12
|
-
url: string;
|
|
13
12
|
alt: string;
|
|
14
13
|
inputMethod: InputMethodInsertMedia;
|
|
14
|
+
url: string;
|
|
15
15
|
}) => boolean;
|
|
16
16
|
export type InsertFile = (props: {
|
|
17
|
-
mediaState: MediaState;
|
|
18
17
|
inputMethod: InputMethodInsertMedia;
|
|
18
|
+
mediaState: MediaState;
|
|
19
19
|
onMediaStateChanged: MediaStateEventSubscriber;
|
|
20
20
|
}) => boolean;
|
|
21
21
|
export type MediaInsertPickerProps = Pick<UiComponentFactoryParams, 'editorView' | 'dispatchAnalyticsEvent' | 'popupsMountPoint' | 'popupsBoundariesElement' | 'popupsScrollableElement'> & {
|
|
22
22
|
api?: ExtractInjectionAPI<MediaInsertPlugin>;
|
|
23
23
|
closeMediaInsertPicker: () => void;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
customizedHelperMessage?: MediaInsertPluginConfig['customizedHelperMessage'];
|
|
25
|
+
customizedUrlValidation?: MediaInsertPluginConfig['customizedUrlValidation'];
|
|
26
26
|
insertExternalMediaSingle: InsertExternalMediaSingle;
|
|
27
27
|
insertFile: InsertFile;
|
|
28
|
+
insertMediaSingle: InsertMediaSingle;
|
|
28
29
|
isOnlyExternalLinks: MediaInsertPluginConfig['isOnlyExternalLinks'];
|
|
29
|
-
|
|
30
|
-
customizedHelperMessage?: MediaInsertPluginConfig['customizedHelperMessage'];
|
|
30
|
+
mediaProvider?: Providers['mediaProvider'];
|
|
31
31
|
};
|
|
@@ -3,10 +3,10 @@ import { type DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { type InsertFile } from '../types';
|
|
5
5
|
type Props = {
|
|
6
|
-
mediaProvider: MediaProvider;
|
|
7
|
-
insertFile: InsertFile;
|
|
8
6
|
closeMediaInsertPicker: () => void;
|
|
9
7
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
8
|
+
insertFile: InsertFile;
|
|
9
|
+
mediaProvider: MediaProvider;
|
|
10
10
|
};
|
|
11
11
|
export declare const LocalMedia: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
export {};
|
|
@@ -4,14 +4,14 @@ import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
|
4
4
|
import { type CustomizedHelperMessage, type InsertExternalMediaSingle, type InsertMediaSingle } from '../types';
|
|
5
5
|
export declare const isValidUrl: (value: string) => boolean;
|
|
6
6
|
type Props = {
|
|
7
|
-
mediaProvider: MediaProvider;
|
|
8
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
9
7
|
closeMediaInsertPicker: () => void;
|
|
10
|
-
|
|
8
|
+
customizedHelperMessage?: CustomizedHelperMessage;
|
|
9
|
+
customizedUrlValidation?: (input: string) => boolean;
|
|
10
|
+
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
11
11
|
insertExternalMediaSingle: InsertExternalMediaSingle;
|
|
12
|
+
insertMediaSingle: InsertMediaSingle;
|
|
12
13
|
isOnlyExternalLinks: boolean;
|
|
13
|
-
|
|
14
|
-
customizedHelperMessage?: CustomizedHelperMessage;
|
|
14
|
+
mediaProvider: MediaProvider;
|
|
15
15
|
};
|
|
16
16
|
export declare function MediaFromURL({ mediaProvider, dispatchAnalyticsEvent, closeMediaInsertPicker, insertMediaSingle, insertExternalMediaSingle, isOnlyExternalLinks, customizedUrlValidation, customizedHelperMessage, }: Props): React.JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export type OnInsertAttrs = {
|
|
2
|
-
id: string;
|
|
3
2
|
collection: string | undefined;
|
|
4
3
|
dimensions?: {
|
|
5
|
-
width: number;
|
|
6
4
|
height: number;
|
|
5
|
+
width: number;
|
|
7
6
|
};
|
|
8
|
-
occurrenceKey: string | undefined;
|
|
9
7
|
fileMimeType: string;
|
|
8
|
+
id: string;
|
|
9
|
+
occurrenceKey: string | undefined;
|
|
10
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media-insert",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.6",
|
|
4
4
|
"description": "Media Insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,34 +20,31 @@
|
|
|
20
20
|
"*.compiled.css"
|
|
21
21
|
],
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
|
-
"af:exports": {
|
|
24
|
-
".": "./src/index.ts"
|
|
25
|
-
},
|
|
26
23
|
"dependencies": {
|
|
27
|
-
"@atlaskit/adf-schema": "^50.2.
|
|
24
|
+
"@atlaskit/adf-schema": "^50.2.3",
|
|
28
25
|
"@atlaskit/button": "^23.4.0",
|
|
29
26
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
30
|
-
"@atlaskit/editor-plugin-media": "^5.
|
|
27
|
+
"@atlaskit/editor-plugin-media": "^5.4.0",
|
|
31
28
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
32
29
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
33
|
-
"@atlaskit/form": "^12.
|
|
34
|
-
"@atlaskit/icon": "^28.
|
|
30
|
+
"@atlaskit/form": "^12.2.0",
|
|
31
|
+
"@atlaskit/icon": "^28.1.0",
|
|
35
32
|
"@atlaskit/media-card": "^79.5.0",
|
|
36
33
|
"@atlaskit/media-client": "^35.3.0",
|
|
37
34
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
38
35
|
"@atlaskit/media-picker": "^70.0.0",
|
|
39
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
|
-
"@atlaskit/primitives": "^14.
|
|
41
|
-
"@atlaskit/section-message": "^8.
|
|
37
|
+
"@atlaskit/primitives": "^14.12.0",
|
|
38
|
+
"@atlaskit/section-message": "^8.6.0",
|
|
42
39
|
"@atlaskit/tabs": "^18.1.0",
|
|
43
40
|
"@atlaskit/textfield": "^8.0.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^11.9.0",
|
|
45
42
|
"@babel/runtime": "^7.0.0",
|
|
46
43
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
47
44
|
},
|
|
48
45
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^107.
|
|
50
|
-
"@atlaskit/tokens": "^6.
|
|
46
|
+
"@atlaskit/editor-common": "^107.33.0",
|
|
47
|
+
"@atlaskit/tokens": "^6.1.0",
|
|
51
48
|
"react": "^18.2.0",
|
|
52
49
|
"react-dom": "^18.2.0"
|
|
53
50
|
},
|