@atlaskit/editor-plugin-media 3.0.5 → 3.0.7
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 +18 -0
- package/dist/cjs/nodeviews/mediaNodeView/index.js +8 -3
- package/dist/cjs/nodeviews/mediaSingle.js +5 -4
- package/dist/es2019/nodeviews/mediaNodeView/index.js +8 -3
- package/dist/es2019/nodeviews/mediaSingle.js +4 -3
- package/dist/esm/nodeviews/mediaNodeView/index.js +8 -3
- package/dist/esm/nodeviews/mediaSingle.js +5 -4
- package/dist/types/nodeviews/mediaNodeView/index.d.ts +3 -1
- package/dist/types/pm-plugins/pixel-resizing/index.d.ts +1 -1
- package/dist/types/pm-plugins/pixel-resizing/ui/index.d.ts +2 -2
- package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +2 -2
- package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +2 -2
- package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +1 -1
- package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +2 -2
- package/dist/types/ui/toolbar/pixel-resizing.d.ts +4 -4
- package/dist/types/ui/toolbar/utils.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/pixel-resizing/ui/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +1 -1
- package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +2 -2
- package/dist/types-ts4.5/ui/toolbar/pixel-resizing.d.ts +4 -4
- package/dist/types-ts4.5/ui/toolbar/utils.d.ts +1 -1
- package/package.json +19 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 3.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159390](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159390)
|
|
8
|
+
[`cc1d530fb6ed2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc1d530fb6ed2) -
|
|
9
|
+
[ux] [ED-28074] Fix media selection state and remove css-based targeting
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.0.6
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#157322](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157322)
|
|
17
|
+
[`0e61040734cef`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e61040734cef) -
|
|
18
|
+
[ED-27842] Consolidate extraneous no_cursor flags into one flag for full rollout
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 3.0.5
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -20,6 +20,7 @@ var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
|
20
20
|
var _selectionBasedNodeView = require("@atlaskit/editor-common/selection-based-node-view");
|
|
21
21
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
22
22
|
var _mediaClient = require("@atlaskit/media-client");
|
|
23
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
24
|
var _helpers = require("../../pm-plugins/commands/helpers");
|
|
24
25
|
var _mediaCommon = require("../../pm-plugins/utils/media-common");
|
|
25
26
|
var _media = _interopRequireDefault(require("./media"));
|
|
@@ -51,10 +52,12 @@ var MediaNodeWithProviders = function MediaNodeWithProviders(_ref) {
|
|
|
51
52
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
52
53
|
mediaProvider = _useSharedState.mediaProvider,
|
|
53
54
|
widthState = _useSharedState.widthState;
|
|
55
|
+
var interactionState = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.interactionState');
|
|
54
56
|
return innerComponent({
|
|
55
57
|
width: widthState,
|
|
56
58
|
// Remove when platform_editor_usesharedpluginstateselector is cleaned up
|
|
57
|
-
mediaProvider: mediaProvider ? Promise.resolve(mediaProvider) : undefined
|
|
59
|
+
mediaProvider: mediaProvider ? Promise.resolve(mediaProvider) : undefined,
|
|
60
|
+
interactionState: interactionState
|
|
58
61
|
});
|
|
59
62
|
};
|
|
60
63
|
function isMediaDecorationSpec(decoration) {
|
|
@@ -89,7 +92,8 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
89
92
|
return function (_ref2) {
|
|
90
93
|
var _this$reactComponentP;
|
|
91
94
|
var editorWidth = _ref2.width,
|
|
92
|
-
mediaProvider = _ref2.mediaProvider
|
|
95
|
+
mediaProvider = _ref2.mediaProvider,
|
|
96
|
+
interactionState = _ref2.interactionState;
|
|
93
97
|
var getPos = _this.getPos;
|
|
94
98
|
var mediaOptions = _this.reactComponentProps.mediaOptions;
|
|
95
99
|
var attrs = _this.getAttrs();
|
|
@@ -117,11 +121,12 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
117
121
|
width: width,
|
|
118
122
|
height: height
|
|
119
123
|
};
|
|
124
|
+
var isSelectedAndInteracted = _this.nodeInsideSelection() && (!(0, _platformFeatureFlags.fg)('platform_editor_interaction_api_refactor') || interactionState !== 'hasNotHadInteraction');
|
|
120
125
|
return /*#__PURE__*/_react.default.createElement(_media.default, {
|
|
121
126
|
view: _this.view,
|
|
122
127
|
node: _this.node,
|
|
123
128
|
getPos: getPos,
|
|
124
|
-
selected:
|
|
129
|
+
selected: isSelectedAndInteracted,
|
|
125
130
|
originalDimensions: originalDimensions,
|
|
126
131
|
maxDimensions: maxDimensions,
|
|
127
132
|
url: url,
|
|
@@ -612,12 +612,13 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
612
612
|
editorDisabled = _useSharedState.editorDisabled,
|
|
613
613
|
viewMode = _useSharedState.viewMode;
|
|
614
614
|
var hasHadInteraction = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.hasHadInteraction');
|
|
615
|
+
var interactionState = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.interactionState');
|
|
615
616
|
var mediaProvider = (0, _react.useMemo)(function () {
|
|
616
617
|
return mediaProviderPromise ? Promise.resolve(mediaProviderPromise) : undefined;
|
|
617
618
|
}, [mediaProviderPromise]);
|
|
618
619
|
var isSelectedAndInteracted = (0, _react.useCallback)(function () {
|
|
619
|
-
return Boolean(selected() && hasHadInteraction !== false);
|
|
620
|
-
}, [hasHadInteraction, selected]);
|
|
620
|
+
return Boolean(selected() && ((0, _platformFeatureFlags.fg)('platform_editor_interaction_api_refactor') ? interactionState !== 'hasNotHadInteraction' : hasHadInteraction !== false));
|
|
621
|
+
}, [hasHadInteraction, interactionState, selected]);
|
|
621
622
|
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single') || (0, _platformFeatureFlags.fg)('platform_editor_react18_phase2__media_single_jira')) {
|
|
622
623
|
return (0, _react2.jsx)(_mediaSingleNext.MediaSingleNodeNext, {
|
|
623
624
|
width: width || 0,
|
|
@@ -629,7 +630,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
629
630
|
mediaOptions: mediaOptions,
|
|
630
631
|
view: view,
|
|
631
632
|
fullWidthMode: fullWidthMode,
|
|
632
|
-
selected: (0, _platformFeatureFlags.fg)('
|
|
633
|
+
selected: (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init') ? isSelectedAndInteracted : selected,
|
|
633
634
|
eventDispatcher: eventDispatcher,
|
|
634
635
|
addPendingTask: addPendingTask,
|
|
635
636
|
isDrafting: isDrafting,
|
|
@@ -652,7 +653,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
652
653
|
mediaOptions: mediaOptions,
|
|
653
654
|
view: view,
|
|
654
655
|
fullWidthMode: fullWidthMode,
|
|
655
|
-
selected: (0, _platformFeatureFlags.fg)('
|
|
656
|
+
selected: (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init') ? isSelectedAndInteracted : selected,
|
|
656
657
|
eventDispatcher: eventDispatcher,
|
|
657
658
|
addPendingTask: addPendingTask,
|
|
658
659
|
isDrafting: isDrafting,
|
|
@@ -6,6 +6,7 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
7
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
8
8
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { updateCurrentMediaNodeAttrs } from '../../pm-plugins/commands/helpers';
|
|
10
11
|
import { isMediaBlobUrlFromAttrs } from '../../pm-plugins/utils/media-common';
|
|
11
12
|
// Ignored via go/ees005
|
|
@@ -35,10 +36,12 @@ const MediaNodeWithProviders = ({
|
|
|
35
36
|
mediaProvider,
|
|
36
37
|
widthState
|
|
37
38
|
} = useSharedState(pluginInjectionApi);
|
|
39
|
+
const interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
|
|
38
40
|
return innerComponent({
|
|
39
41
|
width: widthState,
|
|
40
42
|
// Remove when platform_editor_usesharedpluginstateselector is cleaned up
|
|
41
|
-
mediaProvider: mediaProvider ? Promise.resolve(mediaProvider) : undefined
|
|
43
|
+
mediaProvider: mediaProvider ? Promise.resolve(mediaProvider) : undefined,
|
|
44
|
+
interactionState
|
|
42
45
|
});
|
|
43
46
|
};
|
|
44
47
|
function isMediaDecorationSpec(decoration) {
|
|
@@ -69,7 +72,8 @@ class MediaNodeView extends SelectionBasedNodeView {
|
|
|
69
72
|
_defineProperty(this, "renderMediaNodeWithState", contextIdentifierProvider => {
|
|
70
73
|
return ({
|
|
71
74
|
width: editorWidth,
|
|
72
|
-
mediaProvider
|
|
75
|
+
mediaProvider,
|
|
76
|
+
interactionState
|
|
73
77
|
}) => {
|
|
74
78
|
var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3;
|
|
75
79
|
const getPos = this.getPos;
|
|
@@ -105,11 +109,12 @@ class MediaNodeView extends SelectionBasedNodeView {
|
|
|
105
109
|
width,
|
|
106
110
|
height
|
|
107
111
|
};
|
|
112
|
+
const isSelectedAndInteracted = this.nodeInsideSelection() && (!fg('platform_editor_interaction_api_refactor') || interactionState !== 'hasNotHadInteraction');
|
|
108
113
|
return /*#__PURE__*/React.createElement(MediaNode, {
|
|
109
114
|
view: this.view,
|
|
110
115
|
node: this.node,
|
|
111
116
|
getPos: getPos,
|
|
112
|
-
selected:
|
|
117
|
+
selected: isSelectedAndInteracted,
|
|
113
118
|
originalDimensions: originalDimensions,
|
|
114
119
|
maxDimensions: maxDimensions,
|
|
115
120
|
url: url,
|
|
@@ -526,8 +526,9 @@ const MediaSingleNodeWrapper = ({
|
|
|
526
526
|
viewMode
|
|
527
527
|
} = useSharedState(pluginInjectionApi);
|
|
528
528
|
const hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
|
|
529
|
+
const interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
|
|
529
530
|
const mediaProvider = useMemo(() => mediaProviderPromise ? Promise.resolve(mediaProviderPromise) : undefined, [mediaProviderPromise]);
|
|
530
|
-
const isSelectedAndInteracted = useCallback(() => Boolean(selected() && hasHadInteraction !== false), [hasHadInteraction, selected]);
|
|
531
|
+
const isSelectedAndInteracted = useCallback(() => Boolean(selected() && (fg('platform_editor_interaction_api_refactor') ? interactionState !== 'hasNotHadInteraction' : hasHadInteraction !== false)), [hasHadInteraction, interactionState, selected]);
|
|
531
532
|
if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
|
|
532
533
|
return jsx(MediaSingleNodeNext, {
|
|
533
534
|
width: width || 0,
|
|
@@ -539,7 +540,7 @@ const MediaSingleNodeWrapper = ({
|
|
|
539
540
|
mediaOptions: mediaOptions,
|
|
540
541
|
view: view,
|
|
541
542
|
fullWidthMode: fullWidthMode,
|
|
542
|
-
selected: fg('
|
|
543
|
+
selected: fg('platform_editor_no_cursor_on_live_doc_init') ? isSelectedAndInteracted : selected,
|
|
543
544
|
eventDispatcher: eventDispatcher,
|
|
544
545
|
addPendingTask: addPendingTask,
|
|
545
546
|
isDrafting: isDrafting,
|
|
@@ -562,7 +563,7 @@ const MediaSingleNodeWrapper = ({
|
|
|
562
563
|
mediaOptions: mediaOptions,
|
|
563
564
|
view: view,
|
|
564
565
|
fullWidthMode: fullWidthMode,
|
|
565
|
-
selected: fg('
|
|
566
|
+
selected: fg('platform_editor_no_cursor_on_live_doc_init') ? isSelectedAndInteracted : selected,
|
|
566
567
|
eventDispatcher: eventDispatcher,
|
|
567
568
|
addPendingTask: addPendingTask,
|
|
568
569
|
isDrafting: isDrafting,
|
|
@@ -19,6 +19,7 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
19
19
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
20
20
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
21
21
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
22
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
23
|
import { updateCurrentMediaNodeAttrs } from '../../pm-plugins/commands/helpers';
|
|
23
24
|
import { isMediaBlobUrlFromAttrs } from '../../pm-plugins/utils/media-common';
|
|
24
25
|
// Ignored via go/ees005
|
|
@@ -45,10 +46,12 @@ var MediaNodeWithProviders = function MediaNodeWithProviders(_ref) {
|
|
|
45
46
|
var _useSharedState = useSharedState(pluginInjectionApi),
|
|
46
47
|
mediaProvider = _useSharedState.mediaProvider,
|
|
47
48
|
widthState = _useSharedState.widthState;
|
|
49
|
+
var interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
|
|
48
50
|
return innerComponent({
|
|
49
51
|
width: widthState,
|
|
50
52
|
// Remove when platform_editor_usesharedpluginstateselector is cleaned up
|
|
51
|
-
mediaProvider: mediaProvider ? Promise.resolve(mediaProvider) : undefined
|
|
53
|
+
mediaProvider: mediaProvider ? Promise.resolve(mediaProvider) : undefined,
|
|
54
|
+
interactionState: interactionState
|
|
52
55
|
});
|
|
53
56
|
};
|
|
54
57
|
function isMediaDecorationSpec(decoration) {
|
|
@@ -83,7 +86,8 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
83
86
|
return function (_ref2) {
|
|
84
87
|
var _this$reactComponentP;
|
|
85
88
|
var editorWidth = _ref2.width,
|
|
86
|
-
mediaProvider = _ref2.mediaProvider
|
|
89
|
+
mediaProvider = _ref2.mediaProvider,
|
|
90
|
+
interactionState = _ref2.interactionState;
|
|
87
91
|
var getPos = _this.getPos;
|
|
88
92
|
var mediaOptions = _this.reactComponentProps.mediaOptions;
|
|
89
93
|
var attrs = _this.getAttrs();
|
|
@@ -111,11 +115,12 @@ var MediaNodeView = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
111
115
|
width: width,
|
|
112
116
|
height: height
|
|
113
117
|
};
|
|
118
|
+
var isSelectedAndInteracted = _this.nodeInsideSelection() && (!fg('platform_editor_interaction_api_refactor') || interactionState !== 'hasNotHadInteraction');
|
|
114
119
|
return /*#__PURE__*/React.createElement(MediaNode, {
|
|
115
120
|
view: _this.view,
|
|
116
121
|
node: _this.node,
|
|
117
122
|
getPos: getPos,
|
|
118
|
-
selected:
|
|
123
|
+
selected: isSelectedAndInteracted,
|
|
119
124
|
originalDimensions: originalDimensions,
|
|
120
125
|
maxDimensions: maxDimensions,
|
|
121
126
|
url: url,
|
|
@@ -607,12 +607,13 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
607
607
|
editorDisabled = _useSharedState.editorDisabled,
|
|
608
608
|
viewMode = _useSharedState.viewMode;
|
|
609
609
|
var hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
|
|
610
|
+
var interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
|
|
610
611
|
var mediaProvider = useMemo(function () {
|
|
611
612
|
return mediaProviderPromise ? Promise.resolve(mediaProviderPromise) : undefined;
|
|
612
613
|
}, [mediaProviderPromise]);
|
|
613
614
|
var isSelectedAndInteracted = useCallback(function () {
|
|
614
|
-
return Boolean(selected() && hasHadInteraction !== false);
|
|
615
|
-
}, [hasHadInteraction, selected]);
|
|
615
|
+
return Boolean(selected() && (fg('platform_editor_interaction_api_refactor') ? interactionState !== 'hasNotHadInteraction' : hasHadInteraction !== false));
|
|
616
|
+
}, [hasHadInteraction, interactionState, selected]);
|
|
616
617
|
if (fg('platform_editor_react18_phase2__media_single') || fg('platform_editor_react18_phase2__media_single_jira')) {
|
|
617
618
|
return jsx(MediaSingleNodeNext, {
|
|
618
619
|
width: width || 0,
|
|
@@ -624,7 +625,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
624
625
|
mediaOptions: mediaOptions,
|
|
625
626
|
view: view,
|
|
626
627
|
fullWidthMode: fullWidthMode,
|
|
627
|
-
selected: fg('
|
|
628
|
+
selected: fg('platform_editor_no_cursor_on_live_doc_init') ? isSelectedAndInteracted : selected,
|
|
628
629
|
eventDispatcher: eventDispatcher,
|
|
629
630
|
addPendingTask: addPendingTask,
|
|
630
631
|
isDrafting: isDrafting,
|
|
@@ -647,7 +648,7 @@ var MediaSingleNodeWrapper = function MediaSingleNodeWrapper(_ref6) {
|
|
|
647
648
|
mediaOptions: mediaOptions,
|
|
648
649
|
view: view,
|
|
649
650
|
fullWidthMode: fullWidthMode,
|
|
650
|
-
selected: fg('
|
|
651
|
+
selected: fg('platform_editor_no_cursor_on_live_doc_init') ? isSelectedAndInteracted : selected,
|
|
651
652
|
eventDispatcher: eventDispatcher,
|
|
652
653
|
addPendingTask: addPendingTask,
|
|
653
654
|
isDrafting: isDrafting,
|
|
@@ -5,6 +5,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
6
6
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
7
|
import type { ExtractInjectionAPI, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
|
|
8
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
11
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
@@ -13,6 +14,7 @@ import type { MediaNodeViewProps } from '../types';
|
|
|
13
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
14
15
|
width?: WidthPluginState;
|
|
15
16
|
mediaProvider?: Promise<MediaProvider>;
|
|
17
|
+
interactionState?: SharedInteractionState['interactionState'];
|
|
16
18
|
}
|
|
17
19
|
declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
18
20
|
private isSelected;
|
|
@@ -25,7 +27,7 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
25
27
|
width: number;
|
|
26
28
|
height: number;
|
|
27
29
|
}) => void;
|
|
28
|
-
renderMediaNodeWithState: (contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth, mediaProvider }: MediaNodeWithPluginStateComponentProps) => React.JSX.Element;
|
|
30
|
+
renderMediaNodeWithState: (contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth, mediaProvider, interactionState, }: MediaNodeWithPluginStateComponentProps) => React.JSX.Element;
|
|
29
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
30
32
|
render(): React.JSX.Element;
|
|
31
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
3
|
declare const createCommand: <A = {
|
|
4
4
|
type: "openPixelEditor";
|
|
5
5
|
} | {
|
|
@@ -4,8 +4,8 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
5
5
|
import { type ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
8
|
-
import { MediaPluginState } from '../../../types';
|
|
7
|
+
import type { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
8
|
+
import type { MediaPluginState } from '../../../types';
|
|
9
9
|
export type Props = {
|
|
10
10
|
editorView: EditorView;
|
|
11
11
|
selectedMediaSingleNode: ContentNodeWithPos;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
6
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
isOpen?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
6
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
6
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
isActive: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
4
|
import type { BrowserConfig, ClipboardConfig, DropzoneConfig } from '@atlaskit/media-picker/types';
|
|
5
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
6
6
|
import PickerFacade from '../../pm-plugins/picker-facade';
|
|
7
7
|
interface ChildrenProps {
|
|
8
8
|
config: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { FloatingToolbarConfig, FloatingToolbarOverflowDropdownOptions, Command } from '@atlaskit/editor-common/types';
|
|
1
|
+
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type FloatingToolbarConfig, type FloatingToolbarOverflowDropdownOptions, type Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
|
-
import { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
5
|
+
import { type Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
|
+
import type { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
7
7
|
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props, 'editorView' | 'selectedMediaSingleNode'>) => FloatingToolbarConfig;
|
|
8
8
|
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape['formatMessage'], selectedNodeType?: NodeType) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { LayoutIcon } from '@atlaskit/editor-common/card';
|
|
3
|
-
import { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -5,6 +5,7 @@ import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
|
5
5
|
import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
|
|
6
6
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
7
7
|
import type { ExtractInjectionAPI, EditorContainerWidth as WidthPluginState } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { SharedInteractionState } from '@atlaskit/editor-plugin-interaction';
|
|
8
9
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
10
11
|
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
@@ -13,6 +14,7 @@ import type { MediaNodeViewProps } from '../types';
|
|
|
13
14
|
interface MediaNodeWithPluginStateComponentProps {
|
|
14
15
|
width?: WidthPluginState;
|
|
15
16
|
mediaProvider?: Promise<MediaProvider>;
|
|
17
|
+
interactionState?: SharedInteractionState['interactionState'];
|
|
16
18
|
}
|
|
17
19
|
declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
18
20
|
private isSelected;
|
|
@@ -25,7 +27,7 @@ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
|
|
|
25
27
|
width: number;
|
|
26
28
|
height: number;
|
|
27
29
|
}) => void;
|
|
28
|
-
renderMediaNodeWithState: (contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth, mediaProvider }: MediaNodeWithPluginStateComponentProps) => React.JSX.Element;
|
|
30
|
+
renderMediaNodeWithState: (contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth, mediaProvider, interactionState, }: MediaNodeWithPluginStateComponentProps) => React.JSX.Element;
|
|
29
31
|
renderMediaNodeWithProviders: ({ contextIdentifierProvider }: Providers) => React.JSX.Element;
|
|
30
32
|
render(): React.JSX.Element;
|
|
31
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { PMPluginFactoryParams } from '@atlaskit/editor-common/types';
|
|
3
3
|
declare const createCommand: <A = {
|
|
4
4
|
type: "openPixelEditor";
|
|
5
5
|
} | {
|
|
@@ -4,8 +4,8 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
|
|
5
5
|
import { type ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
8
|
-
import { MediaPluginState } from '../../../types';
|
|
7
|
+
import type { MediaNextEditorPluginType } from '../../../mediaPluginType';
|
|
8
|
+
import type { MediaPluginState } from '../../../types';
|
|
9
9
|
export type Props = {
|
|
10
10
|
editorView: EditorView;
|
|
11
11
|
selectedMediaSingleNode: ContentNodeWithPos;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
6
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
isOpen?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
6
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaFeatureFlags } from '@atlaskit/media-common/mediaFeatureFlags';
|
|
4
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
4
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
5
|
type Props = {
|
|
6
6
|
api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
|
|
7
7
|
isActive: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
4
4
|
import type { BrowserConfig, ClipboardConfig, DropzoneConfig } from '@atlaskit/media-picker/types';
|
|
5
|
-
import { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
5
|
+
import type { MediaNextEditorPluginType } from '../../mediaPluginType';
|
|
6
6
|
import PickerFacade from '../../pm-plugins/picker-facade';
|
|
7
7
|
interface ChildrenProps {
|
|
8
8
|
config: ClipboardConfig | BrowserConfig | DropzoneConfig;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { FloatingToolbarConfig, FloatingToolbarOverflowDropdownOptions, Command } from '@atlaskit/editor-common/types';
|
|
1
|
+
import { type IntlShape } from 'react-intl-next';
|
|
2
|
+
import { type FloatingToolbarConfig, type FloatingToolbarOverflowDropdownOptions, type Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
|
-
import { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
5
|
+
import { type Props } from '../../pm-plugins/pixel-resizing/ui';
|
|
6
|
+
import type { MediaOptions, MediaToolbarBaseConfig } from '../../types';
|
|
7
7
|
export declare const getPixelResizingToolbar: (toolbarBaseConfig: MediaToolbarBaseConfig, { pluginInjectionApi, intl, pluginState, hoverDecoration, isEditorFullWidthEnabled, triggerButtonSelector, }: Omit<Props, 'editorView' | 'selectedMediaSingleNode'>) => FloatingToolbarConfig;
|
|
8
8
|
export declare const getResizeDropdownOption: (mediaOptions: MediaOptions, state: EditorState, formatMessage: IntlShape['formatMessage'], selectedNodeType?: NodeType) => FloatingToolbarOverflowDropdownOptions<Command>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExternalMediaAttributes, MediaADFAttrs, RichMediaLayout } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { LayoutIcon } from '@atlaskit/editor-common/card';
|
|
3
|
-
import { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Command, FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
38
38
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
|
-
"@atlaskit/button": "^23.
|
|
41
|
-
"@atlaskit/editor-common": "^105.
|
|
40
|
+
"@atlaskit/button": "^23.2.0",
|
|
41
|
+
"@atlaskit/editor-common": "^105.9.0",
|
|
42
42
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
44
44
|
"@atlaskit/editor-plugin-annotation": "^2.8.0",
|
|
@@ -50,28 +50,28 @@
|
|
|
50
50
|
"@atlaskit/editor-plugin-focus": "^1.5.0",
|
|
51
51
|
"@atlaskit/editor-plugin-grid": "^2.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
53
|
-
"@atlaskit/editor-plugin-interaction": "^1.
|
|
53
|
+
"@atlaskit/editor-plugin-interaction": "^1.1.0",
|
|
54
54
|
"@atlaskit/editor-plugin-selection": "^2.2.0",
|
|
55
55
|
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
56
56
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
57
57
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
58
58
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
59
59
|
"@atlaskit/form": "^12.0.0",
|
|
60
|
-
"@atlaskit/icon": "^26.
|
|
61
|
-
"@atlaskit/media-card": "^79.
|
|
62
|
-
"@atlaskit/media-client": "^33.
|
|
63
|
-
"@atlaskit/media-client-react": "^4.
|
|
64
|
-
"@atlaskit/media-common": "^12.
|
|
65
|
-
"@atlaskit/media-filmstrip": "^50.
|
|
60
|
+
"@atlaskit/icon": "^26.2.0",
|
|
61
|
+
"@atlaskit/media-card": "^79.3.0",
|
|
62
|
+
"@atlaskit/media-client": "^33.3.0",
|
|
63
|
+
"@atlaskit/media-client-react": "^4.1.0",
|
|
64
|
+
"@atlaskit/media-common": "^12.1.0",
|
|
65
|
+
"@atlaskit/media-filmstrip": "^50.1.0",
|
|
66
66
|
"@atlaskit/media-picker": "^69.0.0",
|
|
67
|
-
"@atlaskit/media-ui": "^28.
|
|
68
|
-
"@atlaskit/media-viewer": "^52.
|
|
67
|
+
"@atlaskit/media-ui": "^28.2.0",
|
|
68
|
+
"@atlaskit/media-viewer": "^52.2.0",
|
|
69
69
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
70
|
-
"@atlaskit/primitives": "^14.
|
|
70
|
+
"@atlaskit/primitives": "^14.8.0",
|
|
71
71
|
"@atlaskit/textfield": "^8.0.0",
|
|
72
72
|
"@atlaskit/theme": "^18.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
74
|
-
"@atlaskit/tokens": "^4.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^4.25.0",
|
|
74
|
+
"@atlaskit/tokens": "^4.9.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.0.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|
|
77
77
|
"@emotion/react": "^11.7.1",
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"platform_editor_fix_image_size_diff_during_ssr": {
|
|
185
185
|
"type": "boolean"
|
|
186
186
|
},
|
|
187
|
-
"
|
|
187
|
+
"platform_editor_no_cursor_on_live_doc_init": {
|
|
188
188
|
"type": "boolean"
|
|
189
189
|
},
|
|
190
190
|
"platform_editor_controls_patch_7": {
|
|
@@ -204,6 +204,9 @@
|
|
|
204
204
|
},
|
|
205
205
|
"platform_editor_controls_patch_9": {
|
|
206
206
|
"type": "boolean"
|
|
207
|
+
},
|
|
208
|
+
"platform_editor_interaction_api_refactor": {
|
|
209
|
+
"type": "boolean"
|
|
207
210
|
}
|
|
208
211
|
},
|
|
209
212
|
"stricter": {
|