@atlaskit/editor-plugin-media 1.5.0 → 1.6.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 +23 -0
- package/dist/cjs/nodeviews/mediaSingle.js +4 -2
- package/dist/cjs/toolbar/index.js +4 -4
- package/dist/cjs/toolbar/mediaInline.js +8 -0
- package/dist/es2019/nodeviews/mediaSingle.js +4 -2
- package/dist/es2019/toolbar/index.js +3 -3
- package/dist/es2019/toolbar/mediaInline.js +8 -0
- package/dist/esm/nodeviews/mediaSingle.js +4 -2
- package/dist/esm/toolbar/index.js +3 -3
- package/dist/esm/toolbar/mediaInline.js +8 -0
- package/dist/types/next-plugin-type.d.ts +3 -1
- package/dist/types/nodeviews/types.d.ts +2 -0
- package/dist/types/toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/next-plugin-type.d.ts +3 -1
- package/dist/types-ts4.5/nodeviews/types.d.ts +2 -0
- package/dist/types-ts4.5/toolbar/index.d.ts +3 -1
- package/package.json +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#78224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78224) [`6b4c9dd4ad34`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b4c9dd4ad34) - ED-22219: adf-schema updated to 35.5.2
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 1.6.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [#78166](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78166) [`8055c8ca1c32`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8055c8ca1c32) - [ux] Add support for preview button in floating toolbar to mediaInline nodes
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#78326](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/78326) [`4adb95539d29`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4adb95539d29) - Added logic to allow media single to access annotation state
|
|
19
|
+
|
|
20
|
+
## 1.5.1
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 1.5.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -462,9 +462,10 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref5) {
|
|
|
462
462
|
eventDispatcher = _ref5.eventDispatcher,
|
|
463
463
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent,
|
|
464
464
|
forwardRef = _ref5.forwardRef;
|
|
465
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width', 'media']),
|
|
465
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width', 'media', 'annotation']),
|
|
466
466
|
widthState = _useSharedPluginState.widthState,
|
|
467
|
-
mediaState = _useSharedPluginState.mediaState
|
|
467
|
+
mediaState = _useSharedPluginState.mediaState,
|
|
468
|
+
annotationState = _useSharedPluginState.annotationState;
|
|
468
469
|
return (0, _react2.jsx)(MediaSingleNode, {
|
|
469
470
|
width: widthState.width,
|
|
470
471
|
lineLength: widthState.lineLength,
|
|
@@ -478,6 +479,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref5) {
|
|
|
478
479
|
selected: selected,
|
|
479
480
|
eventDispatcher: eventDispatcher,
|
|
480
481
|
mediaPluginState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
482
|
+
annotationPluginState: annotationState !== null && annotationState !== void 0 ? annotationState : undefined,
|
|
481
483
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
482
484
|
forwardRef: forwardRef,
|
|
483
485
|
pluginInjectionApi: pluginInjectionApi
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.floatingToolbar = void 0;
|
|
8
|
+
exports.generateFilePreviewItem = exports.floatingToolbar = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -67,7 +67,7 @@ var handleRemoveMediaGroup = function handleRemoveMediaGroup(state, dispatch) {
|
|
|
67
67
|
}
|
|
68
68
|
return true;
|
|
69
69
|
};
|
|
70
|
-
var generateFilePreviewItem = function generateFilePreviewItem(mediaPluginState, intl
|
|
70
|
+
var generateFilePreviewItem = exports.generateFilePreviewItem = function generateFilePreviewItem(mediaPluginState, intl) {
|
|
71
71
|
return {
|
|
72
72
|
type: 'custom',
|
|
73
73
|
fallback: [],
|
|
@@ -454,12 +454,12 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
// Preview Support
|
|
457
|
-
if (allowImagePreview
|
|
457
|
+
if (allowImagePreview) {
|
|
458
458
|
var _mediaNode$attrs;
|
|
459
459
|
var _selectedMediaSingleNode = (0, _utils2.getSelectedMediaSingle)(state);
|
|
460
460
|
var mediaNode = _selectedMediaSingleNode === null || _selectedMediaSingleNode === void 0 ? void 0 : _selectedMediaSingleNode.node.content.firstChild;
|
|
461
461
|
if (!(0, _mediaSingle2.isVideo)(mediaNode === null || mediaNode === void 0 || (_mediaNode$attrs = mediaNode.attrs) === null || _mediaNode$attrs === void 0 ? void 0 : _mediaNode$attrs.__fileMimeType)) {
|
|
462
|
-
toolbarButtons.push(generateFilePreviewItem(pluginState, intl
|
|
462
|
+
toolbarButtons.push(generateFilePreviewItem(pluginState, intl), {
|
|
463
463
|
type: 'separator'
|
|
464
464
|
});
|
|
465
465
|
}
|
|
@@ -26,6 +26,7 @@ var _filePreviewItem = require("./filePreviewItem");
|
|
|
26
26
|
var _imageBorder = require("./imageBorder");
|
|
27
27
|
var _linkingToolbarAppearance = require("./linking-toolbar-appearance");
|
|
28
28
|
var _utils = require("./utils");
|
|
29
|
+
var _index = require("./index");
|
|
29
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
31
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
32
|
var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi) {
|
|
@@ -246,6 +247,13 @@ var getMediaInlineImageToolbar = exports.getMediaInlineImageToolbar = function g
|
|
|
246
247
|
return null;
|
|
247
248
|
}
|
|
248
249
|
});
|
|
250
|
+
|
|
251
|
+
//Image Preview
|
|
252
|
+
if (options.allowImagePreview) {
|
|
253
|
+
inlineImageItems.push((0, _index.generateFilePreviewItem)(mediaPluginState, intl), {
|
|
254
|
+
type: 'separator'
|
|
255
|
+
});
|
|
256
|
+
}
|
|
249
257
|
if (options.allowAltTextOnImages) {
|
|
250
258
|
var _pluginInjectionApi$a5;
|
|
251
259
|
inlineImageItems.push((0, _altText.altTextButton)(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions), {
|
|
@@ -376,8 +376,9 @@ const MediaSingleNodeWrapper = ({
|
|
|
376
376
|
}) => {
|
|
377
377
|
const {
|
|
378
378
|
widthState,
|
|
379
|
-
mediaState
|
|
380
|
-
|
|
379
|
+
mediaState,
|
|
380
|
+
annotationState
|
|
381
|
+
} = useSharedPluginState(pluginInjectionApi, ['width', 'media', 'annotation']);
|
|
381
382
|
return jsx(MediaSingleNode, {
|
|
382
383
|
width: widthState.width,
|
|
383
384
|
lineLength: widthState.lineLength,
|
|
@@ -391,6 +392,7 @@ const MediaSingleNodeWrapper = ({
|
|
|
391
392
|
selected: selected,
|
|
392
393
|
eventDispatcher: eventDispatcher,
|
|
393
394
|
mediaPluginState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
395
|
+
annotationPluginState: annotationState !== null && annotationState !== void 0 ? annotationState : undefined,
|
|
394
396
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
395
397
|
forwardRef: forwardRef,
|
|
396
398
|
pluginInjectionApi: pluginInjectionApi
|
|
@@ -53,7 +53,7 @@ const handleRemoveMediaGroup = (state, dispatch) => {
|
|
|
53
53
|
}
|
|
54
54
|
return true;
|
|
55
55
|
};
|
|
56
|
-
const generateFilePreviewItem = (mediaPluginState, intl
|
|
56
|
+
export const generateFilePreviewItem = (mediaPluginState, intl) => {
|
|
57
57
|
return {
|
|
58
58
|
type: 'custom',
|
|
59
59
|
fallback: [],
|
|
@@ -457,12 +457,12 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
459
|
// Preview Support
|
|
460
|
-
if (allowImagePreview
|
|
460
|
+
if (allowImagePreview) {
|
|
461
461
|
var _mediaNode$attrs;
|
|
462
462
|
const selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
463
463
|
const mediaNode = selectedMediaSingleNode === null || selectedMediaSingleNode === void 0 ? void 0 : selectedMediaSingleNode.node.content.firstChild;
|
|
464
464
|
if (!isVideo(mediaNode === null || mediaNode === void 0 ? void 0 : (_mediaNode$attrs = mediaNode.attrs) === null || _mediaNode$attrs === void 0 ? void 0 : _mediaNode$attrs.__fileMimeType)) {
|
|
465
|
-
toolbarButtons.push(generateFilePreviewItem(pluginState, intl
|
|
465
|
+
toolbarButtons.push(generateFilePreviewItem(pluginState, intl), {
|
|
466
466
|
type: 'separator'
|
|
467
467
|
});
|
|
468
468
|
}
|
|
@@ -18,6 +18,7 @@ import { FilePreviewItem } from './filePreviewItem';
|
|
|
18
18
|
import { shouldShowImageBorder } from './imageBorder';
|
|
19
19
|
import { LinkToolbarAppearance } from './linking-toolbar-appearance';
|
|
20
20
|
import { downloadMedia } from './utils';
|
|
21
|
+
import { generateFilePreviewItem } from './index';
|
|
21
22
|
export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options = {}) => {
|
|
22
23
|
var _pluginInjectionApi$a, _pluginInjectionApi$f, _pluginInjectionApi$f2;
|
|
23
24
|
const editorAnalyticsAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
@@ -240,6 +241,13 @@ export const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverD
|
|
|
240
241
|
return null;
|
|
241
242
|
}
|
|
242
243
|
});
|
|
244
|
+
|
|
245
|
+
//Image Preview
|
|
246
|
+
if (options.allowImagePreview) {
|
|
247
|
+
inlineImageItems.push(generateFilePreviewItem(mediaPluginState, intl), {
|
|
248
|
+
type: 'separator'
|
|
249
|
+
});
|
|
250
|
+
}
|
|
243
251
|
if (options.allowAltTextOnImages) {
|
|
244
252
|
var _pluginInjectionApi$a5;
|
|
245
253
|
inlineImageItems.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions), {
|
|
@@ -455,9 +455,10 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref5) {
|
|
|
455
455
|
eventDispatcher = _ref5.eventDispatcher,
|
|
456
456
|
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent,
|
|
457
457
|
forwardRef = _ref5.forwardRef;
|
|
458
|
-
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width', 'media']),
|
|
458
|
+
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['width', 'media', 'annotation']),
|
|
459
459
|
widthState = _useSharedPluginState.widthState,
|
|
460
|
-
mediaState = _useSharedPluginState.mediaState
|
|
460
|
+
mediaState = _useSharedPluginState.mediaState,
|
|
461
|
+
annotationState = _useSharedPluginState.annotationState;
|
|
461
462
|
return jsx(MediaSingleNode, {
|
|
462
463
|
width: widthState.width,
|
|
463
464
|
lineLength: widthState.lineLength,
|
|
@@ -471,6 +472,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref5) {
|
|
|
471
472
|
selected: selected,
|
|
472
473
|
eventDispatcher: eventDispatcher,
|
|
473
474
|
mediaPluginState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
475
|
+
annotationPluginState: annotationState !== null && annotationState !== void 0 ? annotationState : undefined,
|
|
474
476
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
475
477
|
forwardRef: forwardRef,
|
|
476
478
|
pluginInjectionApi: pluginInjectionApi
|
|
@@ -57,7 +57,7 @@ var handleRemoveMediaGroup = function handleRemoveMediaGroup(state, dispatch) {
|
|
|
57
57
|
}
|
|
58
58
|
return true;
|
|
59
59
|
};
|
|
60
|
-
var generateFilePreviewItem = function generateFilePreviewItem(mediaPluginState, intl
|
|
60
|
+
export var generateFilePreviewItem = function generateFilePreviewItem(mediaPluginState, intl) {
|
|
61
61
|
return {
|
|
62
62
|
type: 'custom',
|
|
63
63
|
fallback: [],
|
|
@@ -444,12 +444,12 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
// Preview Support
|
|
447
|
-
if (allowImagePreview
|
|
447
|
+
if (allowImagePreview) {
|
|
448
448
|
var _mediaNode$attrs;
|
|
449
449
|
var _selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
450
450
|
var mediaNode = _selectedMediaSingleNode === null || _selectedMediaSingleNode === void 0 ? void 0 : _selectedMediaSingleNode.node.content.firstChild;
|
|
451
451
|
if (!isVideo(mediaNode === null || mediaNode === void 0 || (_mediaNode$attrs = mediaNode.attrs) === null || _mediaNode$attrs === void 0 ? void 0 : _mediaNode$attrs.__fileMimeType)) {
|
|
452
|
-
toolbarButtons.push(generateFilePreviewItem(pluginState, intl
|
|
452
|
+
toolbarButtons.push(generateFilePreviewItem(pluginState, intl), {
|
|
453
453
|
type: 'separator'
|
|
454
454
|
});
|
|
455
455
|
}
|
|
@@ -18,6 +18,7 @@ import { FilePreviewItem } from './filePreviewItem';
|
|
|
18
18
|
import { shouldShowImageBorder } from './imageBorder';
|
|
19
19
|
import { LinkToolbarAppearance } from './linking-toolbar-appearance';
|
|
20
20
|
import { downloadMedia } from './utils';
|
|
21
|
+
import { generateFilePreviewItem } from './index';
|
|
21
22
|
export var generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi) {
|
|
22
23
|
var _pluginInjectionApi$a, _pluginInjectionApi$f;
|
|
23
24
|
var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
@@ -236,6 +237,13 @@ export var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(stat
|
|
|
236
237
|
return null;
|
|
237
238
|
}
|
|
238
239
|
});
|
|
240
|
+
|
|
241
|
+
//Image Preview
|
|
242
|
+
if (options.allowImagePreview) {
|
|
243
|
+
inlineImageItems.push(generateFilePreviewItem(mediaPluginState, intl), {
|
|
244
|
+
type: 'separator'
|
|
245
|
+
});
|
|
246
|
+
}
|
|
239
247
|
if (options.allowAltTextOnImages) {
|
|
240
248
|
var _pluginInjectionApi$a5;
|
|
241
249
|
inlineImageItems.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions), {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { AnnotationPlugin } from '@atlaskit/editor-plugin-annotation';
|
|
3
4
|
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
4
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
6
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
@@ -24,7 +25,8 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
24
25
|
FloatingToolbarPlugin,
|
|
25
26
|
EditorDisabledPlugin,
|
|
26
27
|
FocusPlugin,
|
|
27
|
-
SelectionPlugin
|
|
28
|
+
SelectionPlugin,
|
|
29
|
+
AnnotationPlugin
|
|
28
30
|
];
|
|
29
31
|
sharedState: MediaPluginState | null;
|
|
30
32
|
actions: {
|
|
@@ -2,6 +2,7 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { InlineCommentPluginState } from '@atlaskit/editor-plugin-annotation';
|
|
5
6
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
8
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
@@ -20,6 +21,7 @@ export interface MediaSingleNodeProps {
|
|
|
20
21
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
21
22
|
fullWidthMode?: boolean;
|
|
22
23
|
mediaPluginState: MediaPluginState;
|
|
24
|
+
annotationPluginState: InlineCommentPluginState;
|
|
23
25
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
24
26
|
isCopyPasteEnabled?: boolean;
|
|
25
27
|
forwardRef: ForwardRef;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { ExtractInjectionAPI, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
5
|
+
import type { MediaPluginState } from '../pm-plugins/types';
|
|
5
6
|
import type { MediaFloatingToolbarOptions } from '../types';
|
|
7
|
+
export declare const generateFilePreviewItem: (mediaPluginState: MediaPluginState, intl: IntlShape) => FloatingToolbarItem<Command>;
|
|
6
8
|
export declare const floatingToolbar: (state: EditorState, intl: IntlShape, options: MediaFloatingToolbarOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { AnnotationPlugin } from '@atlaskit/editor-plugin-annotation';
|
|
3
4
|
import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
|
|
4
5
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
6
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
@@ -24,7 +25,8 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
24
25
|
FloatingToolbarPlugin,
|
|
25
26
|
EditorDisabledPlugin,
|
|
26
27
|
FocusPlugin,
|
|
27
|
-
SelectionPlugin
|
|
28
|
+
SelectionPlugin,
|
|
29
|
+
AnnotationPlugin
|
|
28
30
|
];
|
|
29
31
|
sharedState: MediaPluginState | null;
|
|
30
32
|
actions: {
|
|
@@ -2,6 +2,7 @@ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
|
2
2
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type { InlineCommentPluginState } from '@atlaskit/editor-plugin-annotation';
|
|
5
6
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
7
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
8
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
@@ -20,6 +21,7 @@ export interface MediaSingleNodeProps {
|
|
|
20
21
|
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
21
22
|
fullWidthMode?: boolean;
|
|
22
23
|
mediaPluginState: MediaPluginState;
|
|
24
|
+
annotationPluginState: InlineCommentPluginState;
|
|
23
25
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
24
26
|
isCopyPasteEnabled?: boolean;
|
|
25
27
|
forwardRef: ForwardRef;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { ExtractInjectionAPI, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, ExtractInjectionAPI, FloatingToolbarConfig, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
5
|
+
import type { MediaPluginState } from '../pm-plugins/types';
|
|
5
6
|
import type { MediaFloatingToolbarOptions } from '../types';
|
|
7
|
+
export declare const generateFilePreviewItem: (mediaPluginState: MediaPluginState, intl: IntlShape) => FloatingToolbarItem<Command>;
|
|
6
8
|
export declare const floatingToolbar: (state: EditorState, intl: IntlShape, options: MediaFloatingToolbarOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => FloatingToolbarConfig | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,17 +33,18 @@
|
|
|
33
33
|
"./types": "./src/types.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/adf-schema": "^35.5.
|
|
36
|
+
"@atlaskit/adf-schema": "^35.5.2",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
39
39
|
"@atlaskit/button": "^17.6.0",
|
|
40
|
-
"@atlaskit/editor-common": "^78.
|
|
40
|
+
"@atlaskit/editor-common": "^78.10.0",
|
|
41
41
|
"@atlaskit/editor-palette": "1.5.2",
|
|
42
42
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
43
|
+
"@atlaskit/editor-plugin-annotation": "1.0.2",
|
|
43
44
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
44
45
|
"@atlaskit/editor-plugin-editor-disabled": "^1.0.0",
|
|
45
46
|
"@atlaskit/editor-plugin-floating-toolbar": "^1.2.0",
|
|
46
|
-
"@atlaskit/editor-plugin-focus": "^1.
|
|
47
|
+
"@atlaskit/editor-plugin-focus": "^1.1.0",
|
|
47
48
|
"@atlaskit/editor-plugin-grid": "^1.0.0",
|
|
48
49
|
"@atlaskit/editor-plugin-guideline": "^1.0.0",
|
|
49
50
|
"@atlaskit/editor-plugin-selection": "^1.1.0",
|
|
@@ -62,10 +63,10 @@
|
|
|
62
63
|
"@atlaskit/media-ui": "^25.3.0",
|
|
63
64
|
"@atlaskit/media-viewer": "^48.3.0",
|
|
64
65
|
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
65
|
-
"@atlaskit/primitives": "^
|
|
66
|
+
"@atlaskit/primitives": "^4.0.0",
|
|
66
67
|
"@atlaskit/textfield": "^6.0.0",
|
|
67
68
|
"@atlaskit/theme": "^12.6.0",
|
|
68
|
-
"@atlaskit/tokens": "^1.
|
|
69
|
+
"@atlaskit/tokens": "^1.39.0",
|
|
69
70
|
"@atlaskit/tooltip": "^18.1.0",
|
|
70
71
|
"@babel/runtime": "^7.0.0",
|
|
71
72
|
"@emotion/react": "^11.7.1",
|
|
@@ -146,9 +147,6 @@
|
|
|
146
147
|
},
|
|
147
148
|
"platform.editor.media.autoselect-inserted-image_oumto": {
|
|
148
149
|
"type": "boolean"
|
|
149
|
-
},
|
|
150
|
-
"platform.editor.media.preview-in-full-page": {
|
|
151
|
-
"type": "boolean"
|
|
152
150
|
}
|
|
153
151
|
},
|
|
154
152
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|