@atlaskit/editor-plugin-media 0.3.0 → 0.3.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 +7 -0
- package/dist/cjs/plugin.js +1 -1
- package/dist/cjs/pm-plugins/keymap.js +5 -5
- package/dist/es2019/plugin.js +1 -1
- package/dist/es2019/pm-plugins/keymap.js +5 -5
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/pm-plugins/keymap.js +5 -5
- package/dist/types/next-plugin-type.d.ts +3 -1
- package/dist/types/pm-plugins/keymap.d.ts +2 -1
- package/package.json +2 -2
- package/dist/types-ts4.5/commands/captions.d.ts +0 -5
- package/dist/types-ts4.5/commands/helpers.d.ts +0 -15
- package/dist/types-ts4.5/commands/index.d.ts +0 -1
- package/dist/types-ts4.5/commands/linking.d.ts +0 -9
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/media-plugin-options.d.ts +0 -17
- package/dist/types-ts4.5/next-plugin-type.d.ts +0 -31
- package/dist/types-ts4.5/nodeviews/__mocks__/mediaNodeUpdater.d.ts +0 -24
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +0 -33
- package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +0 -50
- package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +0 -45
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +0 -28
- package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +0 -44
- package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +0 -62
- package/dist/types-ts4.5/nodeviews/messages.d.ts +0 -7
- package/dist/types-ts4.5/nodeviews/styles.d.ts +0 -16
- package/dist/types-ts4.5/nodeviews/types.d.ts +0 -42
- package/dist/types-ts4.5/picker-facade.d.ts +0 -44
- package/dist/types-ts4.5/plugin.d.ts +0 -7
- package/dist/types-ts4.5/pm-plugins/alt-text/actions.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +0 -7
- package/dist/types-ts4.5/pm-plugins/alt-text/keymap.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/alt-text/messages.d.ts +0 -37
- package/dist/types-ts4.5/pm-plugins/alt-text/reducer.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/alt-text/types.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +0 -41
- package/dist/types-ts4.5/pm-plugins/keymap-media-single.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -5
- package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +0 -20
- package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/linking/keymap.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/linking/reducer.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/linking/types.d.ts +0 -12
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -120
- package/dist/types-ts4.5/pm-plugins/media-editor-plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/mediaTaskManager.d.ts +0 -9
- package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/pm-plugins/types.d.ts +0 -65
- package/dist/types-ts4.5/toolbar/alt-text.d.ts +0 -13
- package/dist/types-ts4.5/toolbar/commands.d.ts +0 -12
- package/dist/types-ts4.5/toolbar/filePreviewItem.d.ts +0 -9
- package/dist/types-ts4.5/toolbar/imageBorder.d.ts +0 -2
- package/dist/types-ts4.5/toolbar/index.d.ts +0 -6
- package/dist/types-ts4.5/toolbar/linking-toolbar-appearance.d.ts +0 -14
- package/dist/types-ts4.5/toolbar/linking.d.ts +0 -10
- package/dist/types-ts4.5/toolbar/utils.d.ts +0 -11
- package/dist/types-ts4.5/types.d.ts +0 -119
- package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +0 -6
- package/dist/types-ts4.5/ui/CaptionPlaceholder/messages.d.ts +0 -7
- package/dist/types-ts4.5/ui/ImageBorder/index.d.ts +0 -11
- package/dist/types-ts4.5/ui/ImageBorder/messages.d.ts +0 -42
- package/dist/types-ts4.5/ui/ImageBorder/styles.d.ts +0 -15
- package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +0 -8
- package/dist/types-ts4.5/ui/Media/drop-placeholder-messages.d.ts +0 -7
- package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +0 -35
- package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +0 -11
- package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +0 -10
- package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +0 -13
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +0 -28
- package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +0 -23
- package/dist/types-ts4.5/ui/PixelEntry/constants.d.ts +0 -1
- package/dist/types-ts4.5/ui/PixelEntry/index.d.ts +0 -8
- package/dist/types-ts4.5/ui/PixelEntry/messages.d.ts +0 -47
- package/dist/types-ts4.5/ui/PixelEntry/styles.d.ts +0 -8
- package/dist/types-ts4.5/ui/PixelEntry/types.d.ts +0 -58
- package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +0 -3
- package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +0 -59
- package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +0 -45
- package/dist/types-ts4.5/ui/ResizableMediaSingle/styled.d.ts +0 -2
- package/dist/types-ts4.5/ui/ResizableMediaSingle/styles.d.ts +0 -1
- package/dist/types-ts4.5/ui/ResizableMediaSingle/types.d.ts +0 -27
- package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +0 -13
- package/dist/types-ts4.5/ui/ToolbarMedia/toolbar-media-messages.d.ts +0 -7
- package/dist/types-ts4.5/ui/media-linking-toolbar-messages.d.ts +0 -7
- package/dist/types-ts4.5/utils/analytics.d.ts +0 -3
- package/dist/types-ts4.5/utils/check-media-type.d.ts +0 -4
- package/dist/types-ts4.5/utils/current-media-node.d.ts +0 -9
- package/dist/types-ts4.5/utils/is-image.d.ts +0 -1
- package/dist/types-ts4.5/utils/media-common.d.ts +0 -20
- package/dist/types-ts4.5/utils/media-files.d.ts +0 -30
- package/dist/types-ts4.5/utils/media-single.d.ts +0 -20
- package/tmp/api-report-tmp.d.ts +0 -390
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#40750](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40750) [`fc19a7b9edd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc19a7b9edd) - [ED-19875] Extraction of Editor Core's Selection Plugin into independent package '@atlaskit/editor-plugin-selection'.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 0.3.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -153,7 +153,7 @@ var mediaPlugin = exports.mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
153
153
|
name: 'mediaKeymap',
|
|
154
154
|
plugin: function plugin() {
|
|
155
155
|
var _api$analytics2;
|
|
156
|
-
return (0, _keymap2.default)(options, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
156
|
+
return (0, _keymap2.default)(options, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, api === null || api === void 0 ? void 0 : api.selection.actions);
|
|
157
157
|
}
|
|
158
158
|
}];
|
|
159
159
|
if (options && options.allowMediaSingle) {
|
|
@@ -12,7 +12,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
12
12
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
13
13
|
var _captions = require("../commands/captions");
|
|
14
14
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
15
|
-
function keymapPlugin(options, editorAnalyticsAPI) {
|
|
15
|
+
function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI) {
|
|
16
16
|
var list = {};
|
|
17
17
|
var _ref = options || {},
|
|
18
18
|
featureFlags = _ref.featureFlags;
|
|
@@ -21,8 +21,8 @@ function keymapPlugin(options, editorAnalyticsAPI) {
|
|
|
21
21
|
if (options !== null && options !== void 0 && options.allowCaptions || (0, _mediaCommon.getMediaFeatureFlag)('captions', featureFlags)) {
|
|
22
22
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
23
23
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
24
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, arrowLeftFromMediaSingle(
|
|
25
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, arrowRightFromMediaSingle(
|
|
24
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
|
25
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, arrowRightFromMediaSingle(editorSelectionAPI), list);
|
|
26
26
|
}
|
|
27
27
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.insertNewLine.common, splitMediaGroup, list);
|
|
28
28
|
return (0, _keymap.keymap)(list);
|
|
@@ -57,7 +57,7 @@ var arrowLeftFromMediaSingle = function arrowLeftFromMediaSingle(editorSelection
|
|
|
57
57
|
return function (state, dispatch) {
|
|
58
58
|
var selection = state.selection;
|
|
59
59
|
if (editorSelectionAPI && selection instanceof _state.NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
60
|
-
var tr = editorSelectionAPI.
|
|
60
|
+
var tr = editorSelectionAPI.selectNearNode({
|
|
61
61
|
selectionRelativeToNode: undefined,
|
|
62
62
|
selection: new _selection.GapCursorSelection(state.doc.resolve(selection.from), _selection.Side.LEFT)
|
|
63
63
|
})(state);
|
|
@@ -73,7 +73,7 @@ var arrowRightFromMediaSingle = function arrowRightFromMediaSingle(editorSelecti
|
|
|
73
73
|
return function (state, dispatch) {
|
|
74
74
|
var selection = state.selection;
|
|
75
75
|
if (editorSelectionAPI && selection instanceof _state.NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
76
|
-
var tr = editorSelectionAPI.
|
|
76
|
+
var tr = editorSelectionAPI.selectNearNode({
|
|
77
77
|
selectionRelativeToNode: undefined,
|
|
78
78
|
selection: new _selection.GapCursorSelection(state.doc.resolve(selection.to), _selection.Side.RIGHT)
|
|
79
79
|
})(state);
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -144,7 +144,7 @@ export const mediaPlugin = ({
|
|
|
144
144
|
name: 'mediaKeymap',
|
|
145
145
|
plugin: () => {
|
|
146
146
|
var _api$analytics2;
|
|
147
|
-
return keymapPlugin(options, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
147
|
+
return keymapPlugin(options, api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, api === null || api === void 0 ? void 0 : api.selection.actions);
|
|
148
148
|
}
|
|
149
149
|
}];
|
|
150
150
|
if (options && options.allowMediaSingle) {
|
|
@@ -5,7 +5,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
6
6
|
import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
7
7
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
8
|
-
export function keymapPlugin(options, editorAnalyticsAPI) {
|
|
8
|
+
export function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI) {
|
|
9
9
|
const list = {};
|
|
10
10
|
const {
|
|
11
11
|
featureFlags
|
|
@@ -15,8 +15,8 @@ export function keymapPlugin(options, editorAnalyticsAPI) {
|
|
|
15
15
|
if (options !== null && options !== void 0 && options.allowCaptions || getMediaFeatureFlag('captions', featureFlags)) {
|
|
16
16
|
bindKeymapWithCommand(moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
17
17
|
bindKeymapWithCommand(tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
18
|
-
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(
|
|
19
|
-
bindKeymapWithCommand(moveRight.common, arrowRightFromMediaSingle(
|
|
18
|
+
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
|
19
|
+
bindKeymapWithCommand(moveRight.common, arrowRightFromMediaSingle(editorSelectionAPI), list);
|
|
20
20
|
}
|
|
21
21
|
bindKeymapWithCommand(insertNewLine.common, splitMediaGroup, list);
|
|
22
22
|
return keymap(list);
|
|
@@ -54,7 +54,7 @@ const arrowLeftFromMediaSingle = editorSelectionAPI => (state, dispatch) => {
|
|
|
54
54
|
selection
|
|
55
55
|
} = state;
|
|
56
56
|
if (editorSelectionAPI && selection instanceof NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
57
|
-
const tr = editorSelectionAPI.
|
|
57
|
+
const tr = editorSelectionAPI.selectNearNode({
|
|
58
58
|
selectionRelativeToNode: undefined,
|
|
59
59
|
selection: new GapCursorSelection(state.doc.resolve(selection.from), Side.LEFT)
|
|
60
60
|
})(state);
|
|
@@ -70,7 +70,7 @@ const arrowRightFromMediaSingle = editorSelectionAPI => (state, dispatch) => {
|
|
|
70
70
|
selection
|
|
71
71
|
} = state;
|
|
72
72
|
if (editorSelectionAPI && selection instanceof NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
73
|
-
const tr = editorSelectionAPI.
|
|
73
|
+
const tr = editorSelectionAPI.selectNearNode({
|
|
74
74
|
selectionRelativeToNode: undefined,
|
|
75
75
|
selection: new GapCursorSelection(state.doc.resolve(selection.to), Side.RIGHT)
|
|
76
76
|
})(state);
|
package/dist/esm/plugin.js
CHANGED
|
@@ -142,7 +142,7 @@ export var mediaPlugin = function mediaPlugin(_ref2) {
|
|
|
142
142
|
name: 'mediaKeymap',
|
|
143
143
|
plugin: function plugin() {
|
|
144
144
|
var _api$analytics2;
|
|
145
|
-
return keymapPlugin(options, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions);
|
|
145
|
+
return keymapPlugin(options, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, api === null || api === void 0 ? void 0 : api.selection.actions);
|
|
146
146
|
}
|
|
147
147
|
}];
|
|
148
148
|
if (options && options.allowMediaSingle) {
|
|
@@ -5,7 +5,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
5
5
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
6
6
|
import { insertAndSelectCaptionFromMediaSinglePos, selectCaptionFromMediaSinglePos } from '../commands/captions';
|
|
7
7
|
import { stateKey } from '../pm-plugins/plugin-key';
|
|
8
|
-
export function keymapPlugin(options, editorAnalyticsAPI) {
|
|
8
|
+
export function keymapPlugin(options, editorAnalyticsAPI, editorSelectionAPI) {
|
|
9
9
|
var list = {};
|
|
10
10
|
var _ref = options || {},
|
|
11
11
|
featureFlags = _ref.featureFlags;
|
|
@@ -14,8 +14,8 @@ export function keymapPlugin(options, editorAnalyticsAPI) {
|
|
|
14
14
|
if (options !== null && options !== void 0 && options.allowCaptions || getMediaFeatureFlag('captions', featureFlags)) {
|
|
15
15
|
bindKeymapWithCommand(moveDown.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
16
16
|
bindKeymapWithCommand(tab.common, insertAndSelectCaption(editorAnalyticsAPI), list);
|
|
17
|
-
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(
|
|
18
|
-
bindKeymapWithCommand(moveRight.common, arrowRightFromMediaSingle(
|
|
17
|
+
bindKeymapWithCommand(moveLeft.common, arrowLeftFromMediaSingle(editorSelectionAPI), list);
|
|
18
|
+
bindKeymapWithCommand(moveRight.common, arrowRightFromMediaSingle(editorSelectionAPI), list);
|
|
19
19
|
}
|
|
20
20
|
bindKeymapWithCommand(insertNewLine.common, splitMediaGroup, list);
|
|
21
21
|
return keymap(list);
|
|
@@ -50,7 +50,7 @@ var arrowLeftFromMediaSingle = function arrowLeftFromMediaSingle(editorSelection
|
|
|
50
50
|
return function (state, dispatch) {
|
|
51
51
|
var selection = state.selection;
|
|
52
52
|
if (editorSelectionAPI && selection instanceof NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
53
|
-
var tr = editorSelectionAPI.
|
|
53
|
+
var tr = editorSelectionAPI.selectNearNode({
|
|
54
54
|
selectionRelativeToNode: undefined,
|
|
55
55
|
selection: new GapCursorSelection(state.doc.resolve(selection.from), Side.LEFT)
|
|
56
56
|
})(state);
|
|
@@ -66,7 +66,7 @@ var arrowRightFromMediaSingle = function arrowRightFromMediaSingle(editorSelecti
|
|
|
66
66
|
return function (state, dispatch) {
|
|
67
67
|
var selection = state.selection;
|
|
68
68
|
if (editorSelectionAPI && selection instanceof NodeSelection && selection.node.type.name === 'mediaSingle') {
|
|
69
|
-
var tr = editorSelectionAPI.
|
|
69
|
+
var tr = editorSelectionAPI.selectNearNode({
|
|
70
70
|
selectionRelativeToNode: undefined,
|
|
71
71
|
selection: new GapCursorSelection(state.doc.resolve(selection.to), Side.RIGHT)
|
|
72
72
|
})(state);
|
|
@@ -7,6 +7,7 @@ import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-too
|
|
|
7
7
|
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
8
8
|
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
9
9
|
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
10
|
+
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
10
11
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
12
|
import type { MediaPluginState } from './pm-plugins/types';
|
|
12
13
|
import type { MediaOptions } from './types';
|
|
@@ -22,7 +23,8 @@ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
|
22
23
|
DecorationsPlugin,
|
|
23
24
|
FloatingToolbarPlugin,
|
|
24
25
|
EditorDisabledPlugin,
|
|
25
|
-
FocusPlugin
|
|
26
|
+
FocusPlugin,
|
|
27
|
+
SelectionPlugin
|
|
26
28
|
];
|
|
27
29
|
sharedState: MediaPluginState | null;
|
|
28
30
|
actions: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-plugin-selection';
|
|
3
4
|
import type { MediaOptions } from '../types';
|
|
4
|
-
export declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): SafePlugin;
|
|
5
|
+
export declare function keymapPlugin(options: MediaOptions | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, editorSelectionAPI: EditorSelectionAPI | undefined): SafePlugin;
|
|
5
6
|
export default keymapPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
38
38
|
"@atlaskit/button": "^16.10.0",
|
|
39
|
-
"@atlaskit/editor-common": "^76.
|
|
39
|
+
"@atlaskit/editor-common": "^76.8.0",
|
|
40
40
|
"@atlaskit/editor-palette": "1.5.1",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^0.2.0",
|
|
42
42
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
export declare const selectCaptionFromMediaSinglePos: (mediaSingleNodePos: number, mediaSingleNode: PMNode) => Command;
|
|
5
|
-
export declare const insertAndSelectCaptionFromMediaSinglePos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { MediaNodeWithPosHandler, MediaPluginState } from '../pm-plugins/types';
|
|
4
|
-
/**
|
|
5
|
-
* Note that Media Inline is inserted like a media single node into the media plugin state.
|
|
6
|
-
* Though it is not of type mediaSingle, it shares the same `findMediaSingleNode` method
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export declare const findMediaSingleNode: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler | null;
|
|
10
|
-
export declare const findAllMediaSingleNodes: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler[];
|
|
11
|
-
export declare const isMediaNode: (pos: number, state: EditorState) => boolean | null;
|
|
12
|
-
export declare const updateAllMediaSingleNodesAttrs: (id: string, attrs: object) => Command;
|
|
13
|
-
export declare const updateCurrentMediaNodeAttrs: (attrs: object, mediaNode: MediaNodeWithPosHandler) => Command;
|
|
14
|
-
export declare const updateMediaSingleNodeAttrs: (id: string, attrs: object) => Command;
|
|
15
|
-
export declare const replaceExternalMedia: (pos: number, attrs: object) => Command;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { updateMediaSingleNodeAttrs, updateAllMediaSingleNodesAttrs, replaceExternalMedia, } from './helpers';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, CommandDispatch } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
export declare const showLinkingToolbar: Command;
|
|
6
|
-
export declare const showLinkingToolbarWithMediaTypeCheck: Command;
|
|
7
|
-
export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch, view?: EditorView, focusFloatingToolbar?: boolean) => void;
|
|
8
|
-
export declare const unlink: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
9
|
-
export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import type { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
import type { CustomMediaPicker, getPosHandler, MediaState } from './types';
|
|
6
|
-
export type MediaPluginOptions = {
|
|
7
|
-
providerFactory: ProviderFactory;
|
|
8
|
-
nodeViews: {
|
|
9
|
-
[name: string]: (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
10
|
-
};
|
|
11
|
-
errorReporter?: ErrorReporter;
|
|
12
|
-
uploadErrorHandler?: (state: MediaState) => void;
|
|
13
|
-
waitForMediaUpload?: boolean;
|
|
14
|
-
customDropzoneContainer?: HTMLElement;
|
|
15
|
-
customMediaPicker?: CustomMediaPicker;
|
|
16
|
-
allowResizing: boolean;
|
|
17
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
|
-
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
5
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
|
-
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
7
|
-
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
8
|
-
import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
9
|
-
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
10
|
-
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
|
-
import type { MediaPluginState } from './pm-plugins/types';
|
|
12
|
-
import type { MediaOptions } from './types';
|
|
13
|
-
import type { InsertMediaAsMediaSingle } from './utils/media-single';
|
|
14
|
-
export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
|
|
15
|
-
pluginConfiguration: MediaOptions | undefined;
|
|
16
|
-
dependencies: [
|
|
17
|
-
FeatureFlagsPlugin,
|
|
18
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
19
|
-
GuidelinePlugin,
|
|
20
|
-
GridPlugin,
|
|
21
|
-
WidthPlugin,
|
|
22
|
-
DecorationsPlugin,
|
|
23
|
-
FloatingToolbarPlugin,
|
|
24
|
-
EditorDisabledPlugin,
|
|
25
|
-
FocusPlugin
|
|
26
|
-
];
|
|
27
|
-
sharedState: MediaPluginState | null;
|
|
28
|
-
actions: {
|
|
29
|
-
insertMediaAsMediaSingle: InsertMediaAsMediaSingle;
|
|
30
|
-
};
|
|
31
|
-
}>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export declare class MediaNodeUpdater {
|
|
2
|
-
static instances: MediaNodeUpdater[];
|
|
3
|
-
static mockOverrides: {};
|
|
4
|
-
static mockReset(): void;
|
|
5
|
-
constructor();
|
|
6
|
-
static setMock(thisKey: string, value: any): void;
|
|
7
|
-
updateContextId(): Promise<void>;
|
|
8
|
-
updateNodeContextId(): Promise<void>;
|
|
9
|
-
getAttrs(): void;
|
|
10
|
-
getObjectId(): Promise<void>;
|
|
11
|
-
getNodeContextId(): void;
|
|
12
|
-
updateDimensions(): void;
|
|
13
|
-
getRemoteDimensions(): Promise<void>;
|
|
14
|
-
isNodeFromDifferentCollection(): Promise<void>;
|
|
15
|
-
hasDifferentContextId(): Promise<void>;
|
|
16
|
-
copyNode(): Promise<void>;
|
|
17
|
-
copyNodeFromPos(): Promise<void>;
|
|
18
|
-
updateMediaSingleFileAttrs(): Promise<void>;
|
|
19
|
-
uploadExternalMedia(): Promise<void>;
|
|
20
|
-
isMediaBlobUrl(): void;
|
|
21
|
-
copyNodeFromBlobUrl(): void;
|
|
22
|
-
updateNodeAttrs(): void;
|
|
23
|
-
handleExternalMedia(): Promise<void>;
|
|
24
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
-
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
7
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
10
|
-
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
11
|
-
import type { getPosHandler, MediaOptions } from '../types';
|
|
12
|
-
export type MediaGroupProps = {
|
|
13
|
-
forwardRef?: (ref: HTMLElement) => void;
|
|
14
|
-
node: PMNode;
|
|
15
|
-
view: EditorView;
|
|
16
|
-
getPos: () => number | undefined;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
allowLazyLoading?: boolean;
|
|
19
|
-
mediaProvider: Promise<MediaProvider>;
|
|
20
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
21
|
-
isCopyPasteEnabled?: boolean;
|
|
22
|
-
anchorPos: number;
|
|
23
|
-
headPos: number;
|
|
24
|
-
mediaOptions: MediaOptions;
|
|
25
|
-
} & WrappedComponentProps;
|
|
26
|
-
export interface MediaGroupState {
|
|
27
|
-
viewMediaClientConfig?: MediaClientConfig;
|
|
28
|
-
}
|
|
29
|
-
declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
|
|
30
|
-
WrappedComponent: React.ComponentType<MediaGroupProps>;
|
|
31
|
-
};
|
|
32
|
-
export default IntlMediaGroup;
|
|
33
|
-
export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
-
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
-
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
-
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
10
|
-
import type { FileIdentifier } from '@atlaskit/media-client';
|
|
11
|
-
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
12
|
-
import type { MediaPluginState } from '../pm-plugins/types';
|
|
13
|
-
import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
14
|
-
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
15
|
-
export interface MediaInlineProps {
|
|
16
|
-
mediaProvider: Promise<MediaProvider>;
|
|
17
|
-
identifier: FileIdentifier;
|
|
18
|
-
node: PMNode;
|
|
19
|
-
isSelected: boolean;
|
|
20
|
-
view: EditorView;
|
|
21
|
-
getPos: ProsemirrorGetPosHandler;
|
|
22
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
23
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
24
|
-
mediaPluginState: MediaPluginState;
|
|
25
|
-
}
|
|
26
|
-
export declare const createMediaNodeUpdater: (props: MediaInlineProps) => MediaNodeUpdater;
|
|
27
|
-
/**
|
|
28
|
-
* Handles updating the media inline node attributes
|
|
29
|
-
* but also handling copy-paste for cross-editor of the same instance
|
|
30
|
-
* using the contextid
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
export declare const updateMediaNodeAttributes: (props: MediaInlineProps, mediaNodeUpdater: MediaNodeUpdater) => Promise<void>;
|
|
34
|
-
export declare const handleNewNode: (props: MediaInlineProps) => void;
|
|
35
|
-
export declare const MediaInline: React.FC<MediaInlineProps>;
|
|
36
|
-
export interface MediaInlineNodeViewProps {
|
|
37
|
-
providerFactory: ProviderFactory;
|
|
38
|
-
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
39
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
40
|
-
}
|
|
41
|
-
export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInlineNodeViewProps> {
|
|
42
|
-
createDomRef(): HTMLSpanElement;
|
|
43
|
-
getContentDOM(): {
|
|
44
|
-
dom: HTMLSpanElement;
|
|
45
|
-
};
|
|
46
|
-
ignoreMutation(): boolean;
|
|
47
|
-
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
48
|
-
render(props: MediaInlineNodeViewProps): JSX.Element;
|
|
49
|
-
}
|
|
50
|
-
export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
7
|
-
import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler } from '../types';
|
|
8
|
-
export type RemoteDimensions = {
|
|
9
|
-
id: string;
|
|
10
|
-
height: number;
|
|
11
|
-
width: number;
|
|
12
|
-
};
|
|
13
|
-
export interface MediaNodeUpdaterProps {
|
|
14
|
-
view: EditorView;
|
|
15
|
-
node: PMNode;
|
|
16
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
17
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
18
|
-
isMediaSingle: boolean;
|
|
19
|
-
mediaOptions?: MediaOptions;
|
|
20
|
-
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
21
|
-
}
|
|
22
|
-
export declare class MediaNodeUpdater {
|
|
23
|
-
props: MediaNodeUpdaterProps;
|
|
24
|
-
constructor(props: MediaNodeUpdaterProps);
|
|
25
|
-
isMediaBlobUrl(): boolean;
|
|
26
|
-
updateContextId: () => Promise<void>;
|
|
27
|
-
updateNodeContextId: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
28
|
-
private hasFileAttributesDefined;
|
|
29
|
-
private getNewFileAttrsForNode;
|
|
30
|
-
updateMediaSingleFileAttrs: () => Promise<void>;
|
|
31
|
-
updateNodeAttrs: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
32
|
-
getAttrs: () => MediaADFAttrs | undefined;
|
|
33
|
-
getObjectId: () => Promise<string | null>;
|
|
34
|
-
uploadExternalMedia: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
35
|
-
getNodeContextId: () => string | null;
|
|
36
|
-
updateDimensions: (dimensions: RemoteDimensions) => void;
|
|
37
|
-
getRemoteDimensions(): Promise<false | RemoteDimensions>;
|
|
38
|
-
hasDifferentContextId: () => Promise<boolean>;
|
|
39
|
-
isNodeFromDifferentCollection: () => Promise<boolean>;
|
|
40
|
-
handleExternalMedia(getPos: ProsemirrorGetPosHandler): Promise<void>;
|
|
41
|
-
copyNodeFromBlobUrl: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
42
|
-
copyNodeFromPos: (getPos: ProsemirrorGetPosHandler, traceContext?: MediaTraceContext) => Promise<void>;
|
|
43
|
-
copyNode: (traceContext?: MediaTraceContext) => Promise<void>;
|
|
44
|
-
private copyFile;
|
|
45
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { MediaADFAttrs } from '@atlaskit/adf-schema';
|
|
3
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
|
-
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
-
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
8
|
-
import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
|
|
9
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
10
|
-
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
11
|
-
import type { MediaNextEditorPluginType } from '../../next-plugin-type';
|
|
12
|
-
import type { getPosHandler, MediaOptions } from '../../types';
|
|
13
|
-
import type { MediaNodeViewProps } from '../types';
|
|
14
|
-
declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
15
|
-
private isSelected;
|
|
16
|
-
createDomRef(): HTMLElement;
|
|
17
|
-
viewShouldUpdate(nextNode: PMNode, decorations: Decoration[]): boolean;
|
|
18
|
-
stopEvent(event: Event): boolean;
|
|
19
|
-
getAttrs(): MediaADFAttrs;
|
|
20
|
-
isMediaBlobUrl(): boolean;
|
|
21
|
-
renderMediaNodeWithState: (mediaProvider?: Promise<MediaProvider>, contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth }: {
|
|
22
|
-
width?: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
|
|
23
|
-
}) => JSX.Element;
|
|
24
|
-
renderMediaNodeWithProviders: ({ mediaProvider, contextIdentifierProvider, }: Providers) => JSX.Element;
|
|
25
|
-
render(): JSX.Element;
|
|
26
|
-
}
|
|
27
|
-
export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
|
|
28
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { ImageLoaderProps } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
import type { CardDimensions, CardOnClickCallback, NumericalCardDimensions } from '@atlaskit/media-card';
|
|
7
|
-
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
8
|
-
import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler, ReactNodeProps } from '../../types';
|
|
9
|
-
export declare const MEDIA_HEIGHT = 125;
|
|
10
|
-
export declare const FILE_WIDTH = 156;
|
|
11
|
-
export interface MediaNodeProps extends ReactNodeProps, ImageLoaderProps {
|
|
12
|
-
view: EditorView;
|
|
13
|
-
node: PMNode;
|
|
14
|
-
getPos: ProsemirrorGetPosHandler;
|
|
15
|
-
contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
|
|
16
|
-
originalDimensions: NumericalCardDimensions;
|
|
17
|
-
maxDimensions: CardDimensions;
|
|
18
|
-
isMediaSingle?: boolean;
|
|
19
|
-
onClick?: CardOnClickCallback;
|
|
20
|
-
mediaProvider?: Promise<MediaProvider>;
|
|
21
|
-
isLoading?: boolean;
|
|
22
|
-
mediaOptions?: MediaOptions;
|
|
23
|
-
}
|
|
24
|
-
interface MediaNodeState {
|
|
25
|
-
viewMediaClientConfig?: MediaClientConfig;
|
|
26
|
-
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
27
|
-
}
|
|
28
|
-
export declare class MediaNode extends Component<MediaNodeProps, MediaNodeState> {
|
|
29
|
-
private mediaPluginState;
|
|
30
|
-
state: MediaNodeState;
|
|
31
|
-
constructor(props: MediaNodeProps);
|
|
32
|
-
shouldComponentUpdate(nextProps: MediaNodeProps, nextState: MediaNodeState): boolean;
|
|
33
|
-
componentDidMount(): Promise<void>;
|
|
34
|
-
componentWillUnmount(): void;
|
|
35
|
-
componentDidUpdate(prevProps: Readonly<MediaNodeProps>): void;
|
|
36
|
-
private setViewMediaClientConfig;
|
|
37
|
-
private selectMediaSingleFromCard;
|
|
38
|
-
private selectMediaSingle;
|
|
39
|
-
render(): JSX.Element;
|
|
40
|
-
private onFullscreenChange;
|
|
41
|
-
private handleNewNode;
|
|
42
|
-
}
|
|
43
|
-
declare const _default: React.ComponentClass<MediaNodeProps & ImageLoaderProps, any>;
|
|
44
|
-
export default _default;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import type { MouseEvent } from 'react';
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
|
-
import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
|
|
6
|
-
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
8
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
9
|
-
import type { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
10
|
-
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
11
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
12
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
|
-
import type { Decoration, DecorationSource, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
14
|
-
import type { CardEvent } from '@atlaskit/media-card';
|
|
15
|
-
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
16
|
-
import type { MediaNextEditorPluginType } from '../next-plugin-type';
|
|
17
|
-
import type { ForwardRef, getPosHandler } from '../types';
|
|
18
|
-
import type { MediaOptions } from '../types';
|
|
19
|
-
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
20
|
-
import type { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
|
|
21
|
-
export interface MediaSingleNodeState {
|
|
22
|
-
width?: number;
|
|
23
|
-
height?: number;
|
|
24
|
-
viewMediaClientConfig?: MediaClientConfig;
|
|
25
|
-
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
26
|
-
isCopying: boolean;
|
|
27
|
-
}
|
|
28
|
-
export default class MediaSingleNode extends Component<MediaSingleNodeProps, MediaSingleNodeState> {
|
|
29
|
-
static defaultProps: Partial<MediaSingleNodeProps>;
|
|
30
|
-
static displayName: string;
|
|
31
|
-
state: MediaSingleNodeState;
|
|
32
|
-
mediaSingleWrapperRef: React.RefObject<HTMLDivElement>;
|
|
33
|
-
captionPlaceHolderRef: React.RefObject<HTMLSpanElement>;
|
|
34
|
-
createMediaNodeUpdater: (props: MediaSingleNodeProps) => MediaNodeUpdater;
|
|
35
|
-
UNSAFE_componentWillReceiveProps(nextProps: MediaSingleNodeProps): void;
|
|
36
|
-
setViewMediaClientConfig: (props: MediaSingleNodeProps) => Promise<void>;
|
|
37
|
-
updateMediaNodeAttributes: (props: MediaSingleNodeProps) => Promise<void>;
|
|
38
|
-
componentDidMount(): Promise<void>;
|
|
39
|
-
selectMediaSingle: ({ event }: CardEvent) => void;
|
|
40
|
-
updateSize: (width: number | null, layout: MediaSingleLayout) => void;
|
|
41
|
-
onMediaSingleClicked: (event: MouseEvent) => void;
|
|
42
|
-
render(): jsx.JSX.Element;
|
|
43
|
-
private clickPlaceholder;
|
|
44
|
-
}
|
|
45
|
-
declare class MediaSingleNodeView extends ReactNodeView<MediaSingleNodeViewProps> {
|
|
46
|
-
lastOffsetLeft: number;
|
|
47
|
-
forceViewUpdate: boolean;
|
|
48
|
-
selectionType: number | null;
|
|
49
|
-
createDomRef(): HTMLElement;
|
|
50
|
-
getContentDOM(): {
|
|
51
|
-
dom: HTMLDivElement;
|
|
52
|
-
};
|
|
53
|
-
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
54
|
-
checkAndUpdateSelectionType: () => import("@atlaskit/editor-common/utils").SelectedState | null;
|
|
55
|
-
isNodeSelected: () => boolean;
|
|
56
|
-
getNodeMediaId(node: PMNode): string | undefined;
|
|
57
|
-
update(node: PMNode, decorations: readonly Decoration[], _innerDecorations?: DecorationSource, isValidUpdate?: (currentNode: PMNode, newNode: PMNode) => boolean): boolean;
|
|
58
|
-
render(props: MediaSingleNodeViewProps, forwardRef?: ForwardRef): jsx.JSX.Element;
|
|
59
|
-
ignoreMutation(): boolean;
|
|
60
|
-
}
|
|
61
|
-
export declare const ReactMediaSingleNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, mediaOptions?: MediaOptions) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaSingleNodeView;
|
|
62
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import type { NumericalCardDimensions } from '@atlaskit/media-card';
|
|
5
|
-
export declare const MediaInlineNodeSelector = "media-inline-node";
|
|
6
|
-
export declare const MediaSingleNodeSelector = "media-single-node";
|
|
7
|
-
export declare const figureWrapper: import("@emotion/react").SerializedStyles;
|
|
8
|
-
type MediaCardWrapperProps = {
|
|
9
|
-
dimensions: NumericalCardDimensions;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
selected?: boolean;
|
|
12
|
-
borderWidth?: number;
|
|
13
|
-
onContextMenu?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
|
14
|
-
};
|
|
15
|
-
export declare const MediaCardWrapper: ({ dimensions, children, selected, borderWidth, onContextMenu, }: MediaCardWrapperProps) => jsx.JSX.Element;
|
|
16
|
-
export {};
|