@atlaskit/editor-plugin-media 13.3.1 → 13.4.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 +13 -0
- package/dist/cjs/pm-plugins/commands.js +2 -2
- package/dist/cjs/pm-plugins/utils/media-single.js +5 -2
- package/dist/es2019/pm-plugins/commands.js +1 -1
- package/dist/es2019/pm-plugins/utils/media-single.js +5 -2
- package/dist/esm/pm-plugins/commands.js +2 -2
- package/dist/esm/pm-plugins/utils/media-single.js +5 -2
- package/dist/types/mediaPluginType.d.ts +1 -1
- package/dist/types/pm-plugins/commands.d.ts +1 -1
- package/dist/types/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/mediaPluginType.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/commands.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 13.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 13.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`1b0c575cc96b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1b0c575cc96b6) -
|
|
14
|
+
make remix generated images identifiable from regular images
|
|
15
|
+
|
|
3
16
|
## 13.3.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -66,7 +66,7 @@ var clearAIGenerating = exports.clearAIGenerating = function clearAIGenerating(m
|
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
var insertMediaAsMediaSingleCommand = exports.insertMediaAsMediaSingleCommand = function insertMediaAsMediaSingleCommand(editorAnalyticsAPI, allowPixelResizing) {
|
|
69
|
-
return function (mediaAttrs, inputMethod, insertMediaVia, positions) {
|
|
70
|
-
return (0, _mediaSingle.createInsertMediaAsMediaSingleCommand)(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions);
|
|
69
|
+
return function (mediaAttrs, inputMethod, insertMediaVia, positions, dataConsumerSource) {
|
|
70
|
+
return (0, _mediaSingle.createInsertMediaAsMediaSingleCommand)(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions, dataConsumerSource);
|
|
71
71
|
};
|
|
72
72
|
};
|
|
@@ -183,7 +183,7 @@ var insertMediaAsMediaSingle = exports.insertMediaAsMediaSingle = function inser
|
|
|
183
183
|
insertMediaVia: insertMediaVia
|
|
184
184
|
})(state, dispatch);
|
|
185
185
|
};
|
|
186
|
-
var createInsertMediaAsMediaSingleCommand = exports.createInsertMediaAsMediaSingleCommand = function createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions) {
|
|
186
|
+
var createInsertMediaAsMediaSingleCommand = exports.createInsertMediaAsMediaSingleCommand = function createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions, dataConsumerSource) {
|
|
187
187
|
return function (_ref4) {
|
|
188
188
|
var _mediaAttrs$__fileMim, _mediaAttrs$width, _mediaAttrs$__fileMim2;
|
|
189
189
|
var tr = _ref4.tr;
|
|
@@ -201,7 +201,10 @@ var createInsertMediaAsMediaSingleCommand = exports.createInsertMediaAsMediaSing
|
|
|
201
201
|
width: (0, _mediaSingle.getMediaSingleInitialWidth)((_mediaAttrs$width = mediaAttrs.width) !== null && _mediaAttrs$width !== void 0 ? _mediaAttrs$width : _mediaSingle.DEFAULT_IMAGE_WIDTH),
|
|
202
202
|
layout: 'center'
|
|
203
203
|
} : {};
|
|
204
|
-
var
|
|
204
|
+
var dataConsumerMarkType = dataConsumerSource ? tr.doc.type.schema.marks.dataConsumer : undefined;
|
|
205
|
+
var mediaNode = dataConsumerSource && dataConsumerMarkType ? media.create(mediaAttrs, undefined, [dataConsumerMarkType.create({
|
|
206
|
+
sources: [dataConsumerSource]
|
|
207
|
+
})]) : media.create(mediaAttrs);
|
|
205
208
|
var mediaSingleNode = mediaSingle.create(mediaSingleAttrs, mediaNode);
|
|
206
209
|
var nodes = [mediaSingleNode];
|
|
207
210
|
var analyticsAttributes = {
|
|
@@ -52,4 +52,4 @@ export const setAIGenerating = (mediaId, source) => ({
|
|
|
52
52
|
export const clearAIGenerating = mediaId => ({
|
|
53
53
|
tr
|
|
54
54
|
}) => clearAIGeneratingMeta(tr, mediaId);
|
|
55
|
-
export const insertMediaAsMediaSingleCommand = (editorAnalyticsAPI, allowPixelResizing) => (mediaAttrs, inputMethod, insertMediaVia, positions) => createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions);
|
|
55
|
+
export const insertMediaAsMediaSingleCommand = (editorAnalyticsAPI, allowPixelResizing) => (mediaAttrs, inputMethod, insertMediaVia, positions, dataConsumerSource) => createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions, dataConsumerSource);
|
|
@@ -181,7 +181,7 @@ export const insertMediaAsMediaSingle = (view, node, inputMethod, editorAnalytic
|
|
|
181
181
|
insertMediaVia
|
|
182
182
|
})(state, dispatch);
|
|
183
183
|
};
|
|
184
|
-
export const createInsertMediaAsMediaSingleCommand = (mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions) => {
|
|
184
|
+
export const createInsertMediaAsMediaSingleCommand = (mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions, dataConsumerSource) => {
|
|
185
185
|
return ({
|
|
186
186
|
tr
|
|
187
187
|
}) => {
|
|
@@ -201,7 +201,10 @@ export const createInsertMediaAsMediaSingleCommand = (mediaAttrs, inputMethod, e
|
|
|
201
201
|
width: getMediaSingleInitialWidth((_mediaAttrs$width = mediaAttrs.width) !== null && _mediaAttrs$width !== void 0 ? _mediaAttrs$width : DEFAULT_IMAGE_WIDTH),
|
|
202
202
|
layout: 'center'
|
|
203
203
|
} : {};
|
|
204
|
-
const
|
|
204
|
+
const dataConsumerMarkType = dataConsumerSource ? tr.doc.type.schema.marks.dataConsumer : undefined;
|
|
205
|
+
const mediaNode = dataConsumerSource && dataConsumerMarkType ? media.create(mediaAttrs, undefined, [dataConsumerMarkType.create({
|
|
206
|
+
sources: [dataConsumerSource]
|
|
207
|
+
})]) : media.create(mediaAttrs);
|
|
205
208
|
const mediaSingleNode = mediaSingle.create(mediaSingleAttrs, mediaNode);
|
|
206
209
|
const nodes = [mediaSingleNode];
|
|
207
210
|
const analyticsAttributes = {
|
|
@@ -60,7 +60,7 @@ export var clearAIGenerating = function clearAIGenerating(mediaId) {
|
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
export var insertMediaAsMediaSingleCommand = function insertMediaAsMediaSingleCommand(editorAnalyticsAPI, allowPixelResizing) {
|
|
63
|
-
return function (mediaAttrs, inputMethod, insertMediaVia, positions) {
|
|
64
|
-
return createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions);
|
|
63
|
+
return function (mediaAttrs, inputMethod, insertMediaVia, positions, dataConsumerSource) {
|
|
64
|
+
return createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions, dataConsumerSource);
|
|
65
65
|
};
|
|
66
66
|
};
|
|
@@ -176,7 +176,7 @@ export var insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, no
|
|
|
176
176
|
insertMediaVia: insertMediaVia
|
|
177
177
|
})(state, dispatch);
|
|
178
178
|
};
|
|
179
|
-
export var createInsertMediaAsMediaSingleCommand = function createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions) {
|
|
179
|
+
export var createInsertMediaAsMediaSingleCommand = function createInsertMediaAsMediaSingleCommand(mediaAttrs, inputMethod, editorAnalyticsAPI, insertMediaVia, allowPixelResizing, positions, dataConsumerSource) {
|
|
180
180
|
return function (_ref4) {
|
|
181
181
|
var _mediaAttrs$__fileMim, _mediaAttrs$width, _mediaAttrs$__fileMim2;
|
|
182
182
|
var tr = _ref4.tr;
|
|
@@ -194,7 +194,10 @@ export var createInsertMediaAsMediaSingleCommand = function createInsertMediaAsM
|
|
|
194
194
|
width: getMediaSingleInitialWidth((_mediaAttrs$width = mediaAttrs.width) !== null && _mediaAttrs$width !== void 0 ? _mediaAttrs$width : DEFAULT_IMAGE_WIDTH),
|
|
195
195
|
layout: 'center'
|
|
196
196
|
} : {};
|
|
197
|
-
var
|
|
197
|
+
var dataConsumerMarkType = dataConsumerSource ? tr.doc.type.schema.marks.dataConsumer : undefined;
|
|
198
|
+
var mediaNode = dataConsumerSource && dataConsumerMarkType ? media.create(mediaAttrs, undefined, [dataConsumerMarkType.create({
|
|
199
|
+
sources: [dataConsumerSource]
|
|
200
|
+
})]) : media.create(mediaAttrs);
|
|
198
201
|
var mediaSingleNode = mediaSingle.create(mediaSingleAttrs, mediaNode);
|
|
199
202
|
var nodes = [mediaSingleNode];
|
|
200
203
|
var analyticsAttributes = {
|
|
@@ -85,7 +85,7 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
85
85
|
* @param insertMediaVia - Optional parameter indicating how the media was inserted
|
|
86
86
|
* @param positions - Optional parameter indicating the positions for the insertion
|
|
87
87
|
*/
|
|
88
|
-
insertMediaSingle: (attrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [number, number]) => EditorCommand;
|
|
88
|
+
insertMediaSingle: (attrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [number, number], dataConsumerSource?: string) => EditorCommand;
|
|
89
89
|
/**
|
|
90
90
|
* Sets the AI-generating decoration on a media node identified by `mediaId`.
|
|
91
91
|
* Renders an AI border around the media node while AI is generating/replacing it.
|
|
@@ -18,4 +18,4 @@ export declare const setAIGenerating: (mediaId: string, source?: AIGeneratingSou
|
|
|
18
18
|
* `mediaId`. Removes the AI border visual from that media's NodeView.
|
|
19
19
|
*/
|
|
20
20
|
export declare const clearAIGenerating: (mediaId: string) => EditorCommand;
|
|
21
|
-
export declare const insertMediaAsMediaSingleCommand: (editorAnalyticsAPI?: EditorAnalyticsAPI, allowPixelResizing?: boolean) => (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [number, number]) => EditorCommand;
|
|
21
|
+
export declare const insertMediaAsMediaSingleCommand: (editorAnalyticsAPI?: EditorAnalyticsAPI, allowPixelResizing?: boolean) => (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [number, number], dataConsumerSource?: string) => EditorCommand;
|
|
@@ -9,7 +9,7 @@ import type { MediaState } from '../../types';
|
|
|
9
9
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
10
10
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
11
11
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
12
|
-
export declare const createInsertMediaAsMediaSingleCommand: (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean, positions?: [number, number]) => EditorCommand;
|
|
12
|
+
export declare const createInsertMediaAsMediaSingleCommand: (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean, positions?: [number, number], dataConsumerSource?: string) => EditorCommand;
|
|
13
13
|
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (id: string, selectionPosition: number) => void, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
14
14
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
15
15
|
export declare const isVideo: MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -88,7 +88,7 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
88
88
|
insertMediaSingle: (attrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [
|
|
89
89
|
number,
|
|
90
90
|
number
|
|
91
|
-
]) => EditorCommand;
|
|
91
|
+
], dataConsumerSource?: string) => EditorCommand;
|
|
92
92
|
/**
|
|
93
93
|
* Sets the AI-generating decoration on a media node identified by `mediaId`.
|
|
94
94
|
* Renders an AI border around the media node while AI is generating/replacing it.
|
|
@@ -21,4 +21,4 @@ export declare const clearAIGenerating: (mediaId: string) => EditorCommand;
|
|
|
21
21
|
export declare const insertMediaAsMediaSingleCommand: (editorAnalyticsAPI?: EditorAnalyticsAPI, allowPixelResizing?: boolean) => (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, positions?: [
|
|
22
22
|
number,
|
|
23
23
|
number
|
|
24
|
-
]) => EditorCommand;
|
|
24
|
+
], dataConsumerSource?: string) => EditorCommand;
|
|
@@ -12,7 +12,7 @@ export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode,
|
|
|
12
12
|
export declare const createInsertMediaAsMediaSingleCommand: (mediaAttrs: MediaADFAttrs, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean, positions?: [
|
|
13
13
|
number,
|
|
14
14
|
number
|
|
15
|
-
]) => EditorCommand;
|
|
15
|
+
], dataConsumerSource?: string) => EditorCommand;
|
|
16
16
|
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (id: string, selectionPosition: number) => void, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
17
17
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
18
18
|
export declare const isVideo: MemoizedFn<(fileType?: string) => boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.4.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
66
66
|
"@atlaskit/primitives": "^19.0.0",
|
|
67
67
|
"@atlaskit/textfield": "^8.3.0",
|
|
68
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
68
|
+
"@atlaskit/tmp-editor-statsig": "^91.0.0",
|
|
69
69
|
"@atlaskit/tokens": "^13.3.0",
|
|
70
70
|
"@atlaskit/tooltip": "^22.6.0",
|
|
71
71
|
"@babel/runtime": "^7.0.0",
|