@atlaskit/editor-plugin-media 5.0.0 → 5.0.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 +9 -0
- package/dist/cjs/nodeviews/mediaNodeUpdater.js +14 -31
- package/dist/es2019/nodeviews/mediaNodeUpdater.js +15 -32
- package/dist/esm/nodeviews/mediaNodeUpdater.js +15 -32
- package/dist/types/nodeviews/lazy-media-group.d.ts +2 -1
- package/dist/types/nodeviews/lazy-media.d.ts +2 -1
- package/dist/types/nodeviews/mediaGroup.d.ts +2 -2
- package/dist/types/nodeviews/mediaGroupNext.d.ts +12 -12
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +2 -2
- package/dist/types/nodeviews/toDOM-fixes/mediaGroup.d.ts +1 -1
- package/dist/types/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -1
- package/dist/types/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/picker-facade.d.ts +7 -2
- package/dist/types/pm-plugins/pixel-resizing/index.d.ts +1 -1
- package/dist/types/pm-plugins/utils/analytics.d.ts +2 -2
- package/dist/types/pm-plugins/utils/check-media-type.d.ts +1 -1
- package/dist/types/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types/ui/toolbar/alt-text.d.ts +1 -1
- package/dist/types/ui/toolbar/pixel-resizing.d.ts +2 -2
- package/dist/types/ui/toolbar/utils.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/lazy-media-group.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/lazy-media.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/mediaGroupNext.d.ts +12 -12
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +2 -2
- package/dist/types-ts4.5/nodeviews/toDOM-fixes/mediaGroup.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/picker-facade.d.ts +7 -2
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/utils/check-media-type.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/utils/media-single.d.ts +1 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/alt-text.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar/pixel-resizing.d.ts +2 -2
- package/dist/types-ts4.5/ui/toolbar/utils.d.ts +1 -1
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#172541](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172541)
|
|
8
|
+
[`6da45cbd2c77f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6da45cbd2c77f) -
|
|
9
|
+
clean up FF for batch media update attributes
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 5.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
@@ -53,18 +53,12 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
53
53
|
return _this.getObjectId();
|
|
54
54
|
case 6:
|
|
55
55
|
objectId = _context.sent;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
nextAttributes: {
|
|
60
|
-
__contextId: objectId
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
} else {
|
|
64
|
-
(0, _helpers.updateAllMediaNodesAttrs)(id, {
|
|
56
|
+
(0, _batchMediaNodeAttrs.batchMediaNodeAttrsUpdate)(_this.props.view, {
|
|
57
|
+
id: id,
|
|
58
|
+
nextAttributes: {
|
|
65
59
|
__contextId: objectId
|
|
66
|
-
}
|
|
67
|
-
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
68
62
|
case 8:
|
|
69
63
|
case "end":
|
|
70
64
|
return _context.stop();
|
|
@@ -188,14 +182,10 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
188
182
|
newAttrs = _context4.sent;
|
|
189
183
|
_ref5 = _this.getAttrs(), id = _ref5.id;
|
|
190
184
|
if (id && newAttrs) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
196
|
-
} else {
|
|
197
|
-
(0, _helpers.updateAllMediaNodesAttrs)(id, newAttrs)(_this.props.view.state, _this.props.view.dispatch);
|
|
198
|
-
}
|
|
185
|
+
(0, _batchMediaNodeAttrs.batchMediaNodeAttrsUpdate)(_this.props.view, {
|
|
186
|
+
id: id,
|
|
187
|
+
nextAttributes: newAttrs
|
|
188
|
+
});
|
|
199
189
|
}
|
|
200
190
|
case 5:
|
|
201
191
|
case "end":
|
|
@@ -333,20 +323,13 @@ var MediaNodeUpdater = exports.MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
333
323
|
return attrs.__contextId || null;
|
|
334
324
|
});
|
|
335
325
|
(0, _defineProperty2.default)(this, "updateDimensions", function (dimensions) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
nextAttributes: {
|
|
340
|
-
height: dimensions.height,
|
|
341
|
-
width: dimensions.width
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
} else {
|
|
345
|
-
(0, _helpers.updateAllMediaNodesAttrs)(dimensions.id, {
|
|
326
|
+
(0, _batchMediaNodeAttrs.batchMediaNodeAttrsUpdate)(_this.props.view, {
|
|
327
|
+
id: dimensions.id,
|
|
328
|
+
nextAttributes: {
|
|
346
329
|
height: dimensions.height,
|
|
347
330
|
width: dimensions.width
|
|
348
|
-
}
|
|
349
|
-
}
|
|
331
|
+
}
|
|
332
|
+
});
|
|
350
333
|
});
|
|
351
334
|
(0, _defineProperty2.default)(this, "shouldNodeBeDeepCopied", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
352
335
|
var _ref0, _this$props$mediaOpti, _this$props$mediaOpti2, _this$mediaPluginStat;
|
|
@@ -5,7 +5,7 @@ import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-comm
|
|
|
5
5
|
import { getAttrsFromUrl, isImageRepresentationReady, isMediaBlobUrl } from '@atlaskit/media-client';
|
|
6
6
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { replaceExternalMedia,
|
|
8
|
+
import { replaceExternalMedia, updateCurrentMediaNodeAttrs, updateMediaNodeAttrs } from '../pm-plugins/commands/helpers';
|
|
9
9
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
10
10
|
import { batchMediaNodeAttrsUpdate } from '../pm-plugins/utils/batchMediaNodeAttrs';
|
|
11
11
|
import { getIdentifier } from '../pm-plugins/utils/media-common';
|
|
@@ -27,18 +27,12 @@ export class MediaNodeUpdater {
|
|
|
27
27
|
id
|
|
28
28
|
} = attrs;
|
|
29
29
|
const objectId = await this.getObjectId();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
nextAttributes: {
|
|
34
|
-
__contextId: objectId
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
updateAllMediaNodesAttrs(id, {
|
|
30
|
+
batchMediaNodeAttrsUpdate(this.props.view, {
|
|
31
|
+
id: id,
|
|
32
|
+
nextAttributes: {
|
|
39
33
|
__contextId: objectId
|
|
40
|
-
}
|
|
41
|
-
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
42
36
|
});
|
|
43
37
|
_defineProperty(this, "updateNodeContextId", async getPos => {
|
|
44
38
|
const attrs = this.getAttrs();
|
|
@@ -102,14 +96,10 @@ export class MediaNodeUpdater {
|
|
|
102
96
|
id
|
|
103
97
|
} = this.getAttrs();
|
|
104
98
|
if (id && newAttrs) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
});
|
|
110
|
-
} else {
|
|
111
|
-
updateAllMediaNodesAttrs(id, newAttrs)(this.props.view.state, this.props.view.dispatch);
|
|
112
|
-
}
|
|
99
|
+
batchMediaNodeAttrsUpdate(this.props.view, {
|
|
100
|
+
id: id,
|
|
101
|
+
nextAttributes: newAttrs
|
|
102
|
+
});
|
|
113
103
|
}
|
|
114
104
|
});
|
|
115
105
|
_defineProperty(this, "updateNodeAttrs", async getPos => {
|
|
@@ -187,20 +177,13 @@ export class MediaNodeUpdater {
|
|
|
187
177
|
return attrs.__contextId || null;
|
|
188
178
|
});
|
|
189
179
|
_defineProperty(this, "updateDimensions", dimensions => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
nextAttributes: {
|
|
194
|
-
height: dimensions.height,
|
|
195
|
-
width: dimensions.width
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
} else {
|
|
199
|
-
updateAllMediaNodesAttrs(dimensions.id, {
|
|
180
|
+
batchMediaNodeAttrsUpdate(this.props.view, {
|
|
181
|
+
id: dimensions.id,
|
|
182
|
+
nextAttributes: {
|
|
200
183
|
height: dimensions.height,
|
|
201
184
|
width: dimensions.width
|
|
202
|
-
}
|
|
203
|
-
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
204
187
|
});
|
|
205
188
|
_defineProperty(this, "shouldNodeBeDeepCopied", async () => {
|
|
206
189
|
var _ref, _this$props$mediaOpti, _this$props$mediaOpti2, _this$mediaPluginStat, _this$mediaPluginStat2;
|
|
@@ -14,7 +14,7 @@ import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-comm
|
|
|
14
14
|
import { getAttrsFromUrl, isImageRepresentationReady, isMediaBlobUrl as _isMediaBlobUrl } from '@atlaskit/media-client';
|
|
15
15
|
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { replaceExternalMedia,
|
|
17
|
+
import { replaceExternalMedia, updateCurrentMediaNodeAttrs, updateMediaNodeAttrs } from '../pm-plugins/commands/helpers';
|
|
18
18
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
19
19
|
import { batchMediaNodeAttrsUpdate } from '../pm-plugins/utils/batchMediaNodeAttrs';
|
|
20
20
|
import { getIdentifier } from '../pm-plugins/utils/media-common';
|
|
@@ -46,18 +46,12 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
46
46
|
return _this.getObjectId();
|
|
47
47
|
case 6:
|
|
48
48
|
objectId = _context.sent;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
nextAttributes: {
|
|
53
|
-
__contextId: objectId
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
} else {
|
|
57
|
-
updateAllMediaNodesAttrs(id, {
|
|
49
|
+
batchMediaNodeAttrsUpdate(_this.props.view, {
|
|
50
|
+
id: id,
|
|
51
|
+
nextAttributes: {
|
|
58
52
|
__contextId: objectId
|
|
59
|
-
}
|
|
60
|
-
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
61
55
|
case 8:
|
|
62
56
|
case "end":
|
|
63
57
|
return _context.stop();
|
|
@@ -181,14 +175,10 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
181
175
|
newAttrs = _context4.sent;
|
|
182
176
|
_ref5 = _this.getAttrs(), id = _ref5.id;
|
|
183
177
|
if (id && newAttrs) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
});
|
|
189
|
-
} else {
|
|
190
|
-
updateAllMediaNodesAttrs(id, newAttrs)(_this.props.view.state, _this.props.view.dispatch);
|
|
191
|
-
}
|
|
178
|
+
batchMediaNodeAttrsUpdate(_this.props.view, {
|
|
179
|
+
id: id,
|
|
180
|
+
nextAttributes: newAttrs
|
|
181
|
+
});
|
|
192
182
|
}
|
|
193
183
|
case 5:
|
|
194
184
|
case "end":
|
|
@@ -326,20 +316,13 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
326
316
|
return attrs.__contextId || null;
|
|
327
317
|
});
|
|
328
318
|
_defineProperty(this, "updateDimensions", function (dimensions) {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
nextAttributes: {
|
|
333
|
-
height: dimensions.height,
|
|
334
|
-
width: dimensions.width
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
} else {
|
|
338
|
-
updateAllMediaNodesAttrs(dimensions.id, {
|
|
319
|
+
batchMediaNodeAttrsUpdate(_this.props.view, {
|
|
320
|
+
id: dimensions.id,
|
|
321
|
+
nextAttributes: {
|
|
339
322
|
height: dimensions.height,
|
|
340
323
|
width: dimensions.width
|
|
341
|
-
}
|
|
342
|
-
}
|
|
324
|
+
}
|
|
325
|
+
});
|
|
343
326
|
});
|
|
344
327
|
_defineProperty(this, "shouldNodeBeDeepCopied", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
345
328
|
var _ref0, _this$props$mediaOpti, _this$props$mediaOpti2, _this$mediaPluginStat;
|
|
@@ -3,4 +3,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
6
|
-
|
|
6
|
+
import type { MediaOptions } from '../types';
|
|
7
|
+
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
@@ -4,4 +4,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
4
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
7
|
-
|
|
7
|
+
import type { MediaOptions } from '../types';
|
|
8
|
+
export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
|
|
@@ -5,5 +5,5 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
8
|
-
import type { getPosHandler } from '../types';
|
|
9
|
-
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
8
|
+
import type { getPosHandler, MediaOptions } from '../types';
|
|
9
|
+
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -5,31 +5,31 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaOptions } from '../types';
|
|
7
7
|
export declare const MediaGroupNext: React.FC<import("react-intl-next").WithIntlProps<{
|
|
8
|
-
forwardRef?: (
|
|
8
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
9
9
|
node: PMNode;
|
|
10
10
|
view: EditorView;
|
|
11
11
|
getPos: () => number | undefined;
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
editorViewMode?: boolean
|
|
14
|
-
allowLazyLoading?: boolean
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
editorViewMode?: boolean;
|
|
14
|
+
allowLazyLoading?: boolean;
|
|
15
15
|
mediaProvider: Promise<MediaProvider>;
|
|
16
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
17
|
-
isCopyPasteEnabled?: boolean
|
|
16
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
17
|
+
isCopyPasteEnabled?: boolean;
|
|
18
18
|
anchorPos: number;
|
|
19
19
|
headPos: number;
|
|
20
20
|
mediaOptions: MediaOptions;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
-
forwardRef?: (
|
|
23
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
24
24
|
node: PMNode;
|
|
25
25
|
view: EditorView;
|
|
26
26
|
getPos: () => number | undefined;
|
|
27
|
-
disabled?: boolean
|
|
28
|
-
editorViewMode?: boolean
|
|
29
|
-
allowLazyLoading?: boolean
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
editorViewMode?: boolean;
|
|
29
|
+
allowLazyLoading?: boolean;
|
|
30
30
|
mediaProvider: Promise<MediaProvider>;
|
|
31
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
32
|
-
isCopyPasteEnabled?: boolean
|
|
31
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
32
|
+
isCopyPasteEnabled?: boolean;
|
|
33
33
|
anchorPos: number;
|
|
34
34
|
headPos: number;
|
|
35
35
|
mediaOptions: MediaOptions;
|
|
@@ -9,7 +9,7 @@ import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction
|
|
|
9
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
12
|
-
import type { getPosHandler } from '../../types';
|
|
12
|
+
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
13
|
import type { MediaNodeViewProps } from '../types';
|
|
14
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
15
15
|
width?: WidthPluginState;
|
|
@@ -31,5 +31,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
31
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
32
32
|
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
34
|
-
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
34
|
+
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
35
35
|
export {};
|
|
@@ -32,5 +32,5 @@ export declare const defaultSquareCardDimensions: {
|
|
|
32
32
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
33
33
|
* case we can consolidate them.
|
|
34
34
|
*/
|
|
35
|
-
export declare const getDefaultCardDimensions: (appearance?:
|
|
35
|
+
export declare const getDefaultCardDimensions: (appearance?: "image" | "square" | "horizontal" | "auto") => Required<typeof defaultImageCardDimensions>;
|
|
36
36
|
export declare const mediaGroupSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
3
|
+
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
4
4
|
export declare const createPlugin: ({ dispatch, providerFactory }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
5
5
|
export { createCommand, getPluginState };
|
|
@@ -41,6 +41,6 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
|
|
|
41
41
|
private handleClearText;
|
|
42
42
|
}
|
|
43
43
|
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Props, "intl"> & {
|
|
44
|
-
forwardedRef?: React.Ref<any
|
|
44
|
+
forwardedRef?: React.Ref<any>;
|
|
45
45
|
}, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
46
46
|
export default _default;
|
|
@@ -4,6 +4,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import type { MediaLinkingActions } from './actions';
|
|
5
5
|
import type { MediaLinkingState } from './types';
|
|
6
6
|
export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
|
|
7
|
-
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getMediaLinkingState: (state: import("prosemirror-state").EditorState) => MediaLinkingState;
|
|
8
8
|
declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
|
|
9
9
|
export default _default;
|
|
@@ -96,7 +96,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
96
96
|
*
|
|
97
97
|
* NOTE: The promise will resolve even if some of the media have failed to process.
|
|
98
98
|
*/
|
|
99
|
-
waitForPendingTasks: (timeout?: number
|
|
99
|
+
waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
|
|
100
100
|
setView(view: EditorView): void;
|
|
101
101
|
/**
|
|
102
102
|
* Called from React UI Component when user clicks on "Delete" icon
|
|
@@ -134,7 +134,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
134
134
|
private handleMediaState;
|
|
135
135
|
removeSelectedMediaContainer: () => boolean;
|
|
136
136
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
137
|
-
handleDrag: (dragState:
|
|
137
|
+
handleDrag: (dragState: "enter" | "leave") => void;
|
|
138
138
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
139
139
|
}
|
|
140
140
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
@@ -4,6 +4,11 @@ import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
|
4
4
|
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
5
|
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from '../types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
|
+
type ExtendedComponentConfigs = {
|
|
8
|
+
customMediaPicker: CustomMediaPicker;
|
|
9
|
+
dropzone: null;
|
|
10
|
+
clipboard: null;
|
|
11
|
+
};
|
|
7
12
|
export type PickerFacadeConfig = {
|
|
8
13
|
mediaClientConfig: MediaClientConfig;
|
|
9
14
|
errorReporter: ErrorReportingHandler;
|
|
@@ -12,7 +17,7 @@ export type PickerFacadeConfig = {
|
|
|
12
17
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
13
18
|
export default class PickerFacade {
|
|
14
19
|
readonly config: PickerFacadeConfig;
|
|
15
|
-
readonly pickerConfig?:
|
|
20
|
+
readonly pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined;
|
|
16
21
|
private picker?;
|
|
17
22
|
private onDragListeners;
|
|
18
23
|
private pickerType;
|
|
@@ -20,7 +25,7 @@ export default class PickerFacade {
|
|
|
20
25
|
private eventListeners;
|
|
21
26
|
private analyticsName;
|
|
22
27
|
erroredFiles: Set<string>;
|
|
23
|
-
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?:
|
|
28
|
+
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined, analyticsName?: string);
|
|
24
29
|
init(): Promise<PickerFacade>;
|
|
25
30
|
get type(): PickerType;
|
|
26
31
|
get mediaPicker(): CustomMediaPicker | undefined;
|
|
@@ -4,7 +4,7 @@ declare const createCommand: <A = {
|
|
|
4
4
|
type: "openPixelEditor";
|
|
5
5
|
} | {
|
|
6
6
|
type: "closePixelEditor";
|
|
7
|
-
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => {
|
|
8
8
|
isPixelEditorOpen: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MediaEventPayload, MediaInputResizeTrackAction, MediaResizeTrackAction, MediaSwitchType } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T[
|
|
4
|
-
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T[
|
|
3
|
+
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
4
|
+
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
5
5
|
export declare const getChangeMediaAnalytics: (previousType: MediaSwitchType, newType: MediaSwitchType, changeFromLocation?: string) => MediaEventPayload;
|
|
6
6
|
export declare function findChangeFromLocation(selection: Selection): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { MediaType } from '@atlaskit/media-client';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
|
-
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType |
|
|
4
|
+
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType | "external" | undefined>;
|
|
@@ -7,6 +7,6 @@ import type { MediaState } from '../../types';
|
|
|
7
7
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
8
8
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
9
9
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
10
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (
|
|
10
|
+
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;
|
|
11
11
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
12
12
|
export declare const isVideo: import("memoize-one").MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -30,7 +30,7 @@ export default class ResizableMediaSingle extends React.Component<Props, State>
|
|
|
30
30
|
width: number | null;
|
|
31
31
|
layout: MediaSingleLayout;
|
|
32
32
|
};
|
|
33
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
33
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
34
34
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
35
35
|
/**
|
|
36
36
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -12,5 +12,5 @@ interface AltTextToolbarOptions {
|
|
|
12
12
|
triggerButtonSelector?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
15
|
-
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape[
|
|
15
|
+
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape["formatMessage"], allowAltTextOnImages?: boolean, selectedNodeType?: NodeType, editorAnalyticsAPI?: EditorAnalyticsAPI) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
16
16
|
export {};
|
|
@@ -4,5 +4,5 @@ import { type NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { type Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
6
|
import type { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
7
|
-
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props,
|
|
8
|
-
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape[
|
|
7
|
+
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props, "editorView" | "selectedMediaSingleNode">) => FloatingToolbarConfig;
|
|
8
|
+
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape["formatMessage"], selectedNodeType?: NodeType) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
@@ -24,4 +24,4 @@ export declare const getSelectedLayoutIcon: (layoutIcons: LayoutIcon[], selected
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const canShowSwitchButtons: (mediaSingleNode?: ProseMirrorNode) => boolean | null;
|
|
26
26
|
export declare const updateToFullHeightSeparator: (items: FloatingToolbarItem<Command>[]) => void;
|
|
27
|
-
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType:
|
|
27
|
+
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType: "inline" | "block", intl: IntlShape, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, hasCaption?: boolean) => FloatingToolbarDropdown<Command>;
|
|
@@ -3,4 +3,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
3
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
6
|
-
|
|
6
|
+
import type { MediaOptions } from '../types';
|
|
7
|
+
export declare const lazyMediaGroupView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => import("@atlaskit/editor-common/lazy-node-view").NodeViewConstructor;
|
|
@@ -4,4 +4,5 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
4
4
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
7
|
-
|
|
7
|
+
import type { MediaOptions } from '../types';
|
|
8
|
+
export declare const lazyMediaView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, options: MediaOptions | undefined, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => NodeViewConstructor;
|
|
@@ -5,5 +5,5 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import type { MediaNextEditorPluginType } from '../mediaPluginType';
|
|
8
|
-
import type { getPosHandler } from '../types';
|
|
9
|
-
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
8
|
+
import type { getPosHandler, MediaOptions } from '../types';
|
|
9
|
+
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -5,31 +5,31 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { MediaOptions } from '../types';
|
|
7
7
|
export declare const MediaGroupNext: React.FC<import("react-intl-next").WithIntlProps<{
|
|
8
|
-
forwardRef?: (
|
|
8
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
9
9
|
node: PMNode;
|
|
10
10
|
view: EditorView;
|
|
11
11
|
getPos: () => number | undefined;
|
|
12
|
-
disabled?: boolean
|
|
13
|
-
editorViewMode?: boolean
|
|
14
|
-
allowLazyLoading?: boolean
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
editorViewMode?: boolean;
|
|
14
|
+
allowLazyLoading?: boolean;
|
|
15
15
|
mediaProvider: Promise<MediaProvider>;
|
|
16
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
17
|
-
isCopyPasteEnabled?: boolean
|
|
16
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
17
|
+
isCopyPasteEnabled?: boolean;
|
|
18
18
|
anchorPos: number;
|
|
19
19
|
headPos: number;
|
|
20
20
|
mediaOptions: MediaOptions;
|
|
21
21
|
} & WrappedComponentProps>> & {
|
|
22
22
|
WrappedComponent: React.ComponentType<{
|
|
23
|
-
forwardRef?: (
|
|
23
|
+
forwardRef?: (ref: HTMLElement) => void;
|
|
24
24
|
node: PMNode;
|
|
25
25
|
view: EditorView;
|
|
26
26
|
getPos: () => number | undefined;
|
|
27
|
-
disabled?: boolean
|
|
28
|
-
editorViewMode?: boolean
|
|
29
|
-
allowLazyLoading?: boolean
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
editorViewMode?: boolean;
|
|
29
|
+
allowLazyLoading?: boolean;
|
|
30
30
|
mediaProvider: Promise<MediaProvider>;
|
|
31
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider
|
|
32
|
-
isCopyPasteEnabled?: boolean
|
|
31
|
+
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
32
|
+
isCopyPasteEnabled?: boolean;
|
|
33
33
|
anchorPos: number;
|
|
34
34
|
headPos: number;
|
|
35
35
|
mediaOptions: MediaOptions;
|
|
@@ -9,7 +9,7 @@ import type { SharedInteractionState } from '@atlaskit/editor-plugin-interaction
|
|
|
9
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
10
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
11
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
12
|
-
import type { getPosHandler } from '../../types';
|
|
12
|
+
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
13
|
import type { MediaNodeViewProps } from '../types';
|
|
14
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
15
15
|
width?: WidthPluginState;
|
|
@@ -31,5 +31,5 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
31
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
32
32
|
render(): React.JSX.Element;
|
|
33
33
|
}
|
|
34
|
-
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions:
|
|
34
|
+
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
35
35
|
export {};
|
|
@@ -32,5 +32,5 @@ export declare const defaultSquareCardDimensions: {
|
|
|
32
32
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
33
33
|
* case we can consolidate them.
|
|
34
34
|
*/
|
|
35
|
-
export declare const getDefaultCardDimensions: (appearance?:
|
|
35
|
+
export declare const getDefaultCardDimensions: (appearance?: "image" | "square" | "horizontal" | "auto") => Required<typeof defaultImageCardDimensions>;
|
|
36
36
|
export declare const mediaGroupSpecWithFixedToDOM: () => import("prosemirror-model").NodeSpec;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
|
-
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
3
|
+
declare const createCommand: <A = import("./actions").MediaAltTextAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").MediaAltTextState;
|
|
4
4
|
export declare const createPlugin: ({ dispatch, providerFactory }: PMPluginFactoryParams) => SafePlugin<import("./types").MediaAltTextState>;
|
|
5
5
|
export { createCommand, getPluginState };
|
|
@@ -41,6 +41,6 @@ export declare class AltTextEditComponent extends React.Component<Props, AltText
|
|
|
41
41
|
private handleClearText;
|
|
42
42
|
}
|
|
43
43
|
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Props, "intl"> & {
|
|
44
|
-
forwardedRef?: React.Ref<any
|
|
44
|
+
forwardedRef?: React.Ref<any>;
|
|
45
45
|
}, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
46
46
|
export default _default;
|
|
@@ -4,6 +4,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import type { MediaLinkingActions } from './actions';
|
|
5
5
|
import type { MediaLinkingState } from './types';
|
|
6
6
|
export declare const mediaLinkingPluginKey: PluginKey<MediaLinkingState>;
|
|
7
|
-
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
export declare const createMediaLinkingCommand: <A = MediaLinkingActions>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getMediaLinkingState: (state: import("prosemirror-state").EditorState) => MediaLinkingState;
|
|
8
8
|
declare const _default: (dispatch: Dispatch) => SafePlugin<MediaLinkingState>;
|
|
9
9
|
export default _default;
|
|
@@ -96,7 +96,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
96
96
|
*
|
|
97
97
|
* NOTE: The promise will resolve even if some of the media have failed to process.
|
|
98
98
|
*/
|
|
99
|
-
waitForPendingTasks: (timeout?: number
|
|
99
|
+
waitForPendingTasks: (timeout?: number, lastTask?: Promise<MediaState | null>) => Promise<MediaState | null>;
|
|
100
100
|
setView(view: EditorView): void;
|
|
101
101
|
/**
|
|
102
102
|
* Called from React UI Component when user clicks on "Delete" icon
|
|
@@ -134,7 +134,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
134
134
|
private handleMediaState;
|
|
135
135
|
removeSelectedMediaContainer: () => boolean;
|
|
136
136
|
selectedMediaContainerNode: () => PMNode | undefined;
|
|
137
|
-
handleDrag: (dragState:
|
|
137
|
+
handleDrag: (dragState: "enter" | "leave") => void;
|
|
138
138
|
updateAndDispatch(props: Partial<Pick<this, 'allowsUploads' | 'allUploadsFinished' | 'isFullscreen'>>): void;
|
|
139
139
|
}
|
|
140
140
|
export declare const getMediaPluginState: (state: EditorState) => MediaPluginState;
|
|
@@ -4,6 +4,11 @@ import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
|
4
4
|
import type { UploadEndEventPayload, UploadErrorEventPayload, UploadParams, UploadPreviewUpdateEventPayload } from '@atlaskit/media-picker/types';
|
|
5
5
|
import type { CustomMediaPicker, MediaState, MediaStateEventSubscriber, MobileUploadEndEventPayload } from '../types';
|
|
6
6
|
type PickerType = 'clipboard' | 'dropzone' | 'customMediaPicker';
|
|
7
|
+
type ExtendedComponentConfigs = {
|
|
8
|
+
customMediaPicker: CustomMediaPicker;
|
|
9
|
+
dropzone: null;
|
|
10
|
+
clipboard: null;
|
|
11
|
+
};
|
|
7
12
|
export type PickerFacadeConfig = {
|
|
8
13
|
mediaClientConfig: MediaClientConfig;
|
|
9
14
|
errorReporter: ErrorReportingHandler;
|
|
@@ -12,7 +17,7 @@ export type PickerFacadeConfig = {
|
|
|
12
17
|
type NewMediaEvent = (state: MediaState, onStateChanged: MediaStateEventSubscriber, pickerType?: string) => void;
|
|
13
18
|
export default class PickerFacade {
|
|
14
19
|
readonly config: PickerFacadeConfig;
|
|
15
|
-
readonly pickerConfig?:
|
|
20
|
+
readonly pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined;
|
|
16
21
|
private picker?;
|
|
17
22
|
private onDragListeners;
|
|
18
23
|
private pickerType;
|
|
@@ -20,7 +25,7 @@ export default class PickerFacade {
|
|
|
20
25
|
private eventListeners;
|
|
21
26
|
private analyticsName;
|
|
22
27
|
erroredFiles: Set<string>;
|
|
23
|
-
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?:
|
|
28
|
+
constructor(pickerType: PickerType, config: PickerFacadeConfig, pickerConfig?: ExtendedComponentConfigs[PickerType] | undefined, analyticsName?: string);
|
|
24
29
|
init(): Promise<PickerFacade>;
|
|
25
30
|
get type(): PickerType;
|
|
26
31
|
get mediaPicker(): CustomMediaPicker | undefined;
|
|
@@ -4,7 +4,7 @@ declare const createCommand: <A = {
|
|
|
4
4
|
type: "openPixelEditor";
|
|
5
5
|
} | {
|
|
6
6
|
type: "closePixelEditor";
|
|
7
|
-
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (
|
|
7
|
+
}>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => {
|
|
8
8
|
isPixelEditorOpen: boolean;
|
|
9
9
|
};
|
|
10
10
|
export declare const createPlugin: ({ dispatch }: PMPluginFactoryParams) => SafePlugin<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MediaEventPayload, MediaInputResizeTrackAction, MediaResizeTrackAction, MediaSwitchType } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T[
|
|
4
|
-
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T[
|
|
3
|
+
export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
4
|
+
export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
|
|
5
5
|
export declare const getChangeMediaAnalytics: (previousType: MediaSwitchType, newType: MediaSwitchType, changeFromLocation?: string) => MediaEventPayload;
|
|
6
6
|
export declare function findChangeFromLocation(selection: Selection): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { MediaType } from '@atlaskit/media-client';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
|
-
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType |
|
|
4
|
+
export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType | "external" | undefined>;
|
|
@@ -7,6 +7,6 @@ import type { MediaState } from '../../types';
|
|
|
7
7
|
export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
|
|
8
8
|
export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
9
9
|
export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, insertMediaVia?: InsertMediaVia, allowPixelResizing?: boolean) => boolean;
|
|
10
|
-
export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, onNodeInserted?: (
|
|
10
|
+
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;
|
|
11
11
|
export declare const changeFromMediaInlineToMediaSingleNode: (view: EditorView, fromNode: PMNode, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined, allowPixelResizing?: boolean) => boolean;
|
|
12
12
|
export declare const isVideo: import("memoize-one").MemoizedFn<(fileType?: string) => boolean>;
|
|
@@ -30,7 +30,7 @@ export default class ResizableMediaSingle extends React.Component<Props, State>
|
|
|
30
30
|
width: number | null;
|
|
31
31
|
layout: MediaSingleLayout;
|
|
32
32
|
};
|
|
33
|
-
calcUnwrappedLayout: (pct: number, width: number) =>
|
|
33
|
+
calcUnwrappedLayout: (pct: number, width: number) => "center" | "wide" | "full-width";
|
|
34
34
|
get $pos(): import("prosemirror-model").ResolvedPos | null;
|
|
35
35
|
/**
|
|
36
36
|
* The maxmimum number of grid columns this node can resize to.
|
|
@@ -12,5 +12,5 @@ interface AltTextToolbarOptions {
|
|
|
12
12
|
triggerButtonSelector?: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const getAltTextToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, options?: AltTextToolbarOptions) => FloatingToolbarConfig;
|
|
15
|
-
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape[
|
|
15
|
+
export declare const getAltTextDropdownOption: (state: EditorState, formatMessage: IntlShape["formatMessage"], allowAltTextOnImages?: boolean, selectedNodeType?: NodeType, editorAnalyticsAPI?: EditorAnalyticsAPI) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
16
16
|
export {};
|
|
@@ -4,5 +4,5 @@ import { type NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { type EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { type Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
6
|
import type { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
7
|
-
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props,
|
|
8
|
-
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape[
|
|
7
|
+
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props, "editorView" | "selectedMediaSingleNode">) => FloatingToolbarConfig;
|
|
8
|
+
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape["formatMessage"], selectedNodeType?: NodeType) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
@@ -24,4 +24,4 @@ export declare const getSelectedLayoutIcon: (layoutIcons: LayoutIcon[], selected
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const canShowSwitchButtons: (mediaSingleNode?: ProseMirrorNode) => boolean | null;
|
|
26
26
|
export declare const updateToFullHeightSeparator: (items: FloatingToolbarItem<Command>[]) => void;
|
|
27
|
-
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType:
|
|
27
|
+
export declare const getMediaSingleAndMediaInlineSwitcherDropdown: (nodeType: "inline" | "block", intl: IntlShape, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, hasCaption?: boolean) => FloatingToolbarDropdown<Command>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@atlaskit/primitives": "^14.10.0",
|
|
70
70
|
"@atlaskit/textfield": "^8.0.0",
|
|
71
71
|
"@atlaskit/theme": "^18.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^8.8.0",
|
|
73
73
|
"@atlaskit/tokens": "^5.4.0",
|
|
74
74
|
"@atlaskit/tooltip": "^20.3.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"typescript": "~5.4.2"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@atlaskit/editor-common": "^107.
|
|
87
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
88
88
|
"@atlaskit/media-core": "^37.0.0",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
@@ -133,9 +133,6 @@
|
|
|
133
133
|
"platform_media_cross_client_copy": {
|
|
134
134
|
"type": "boolean"
|
|
135
135
|
},
|
|
136
|
-
"platform_editor_media_batch_updates": {
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
},
|
|
139
136
|
"platform_editor_typography_ugc": {
|
|
140
137
|
"type": "boolean"
|
|
141
138
|
},
|