@atlaskit/editor-plugin-media-insert 2.7.1 → 2.7.2
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 +10 -0
- package/dist/cjs/plugin.js +5 -2
- package/dist/es2019/plugin.js +5 -2
- package/dist/esm/plugin.js +5 -2
- package/dist/types/types.d.ts +6 -1
- package/dist/types-ts4.5/types.d.ts +3 -1
- package/package.json +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media-insert
|
|
2
2
|
|
|
3
|
+
## 2.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#141594](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141594)
|
|
8
|
+
[`3f6b2eb7bd493`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f6b2eb7bd493) -
|
|
9
|
+
[ux] [ED-24867] This change moves nesting codeblocks and media in blockquotes via insertion
|
|
10
|
+
methods behind an experiment gate.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 2.7.1
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -9,12 +9,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
10
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
11
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _actions = require("./actions");
|
|
13
14
|
var _main = require("./pm-plugins/main");
|
|
14
15
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
15
16
|
var _MediaInsertPicker = require("./ui/MediaInsertPicker");
|
|
16
17
|
var mediaInsertPlugin = exports.mediaInsertPlugin = function mediaInsertPlugin(_ref) {
|
|
18
|
+
var _api$featureFlags;
|
|
17
19
|
var api = _ref.api;
|
|
20
|
+
var isNestingInQuoteSupported = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.nestMediaAndCodeblockInQuote) || (0, _platformFeatureFlags.fg)('editor_nest_media_and_codeblock_in_quotes_jira');
|
|
18
21
|
return {
|
|
19
22
|
name: 'mediaInsert',
|
|
20
23
|
pmPlugins: function pmPlugins() {
|
|
@@ -71,7 +74,7 @@ var mediaInsertPlugin = exports.mediaInsertPlugin = function mediaInsertPlugin(_
|
|
|
71
74
|
alt: fileName,
|
|
72
75
|
__fileMimeType: mediaState.fileMimeType
|
|
73
76
|
});
|
|
74
|
-
return (_api$media$actions$in = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod)) !== null && _api$media$actions$in !== void 0 ? _api$media$actions$in : false;
|
|
77
|
+
return (_api$media$actions$in = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod, isNestingInQuoteSupported)) !== null && _api$media$actions$in !== void 0 ? _api$media$actions$in : false;
|
|
75
78
|
};
|
|
76
79
|
var insertExternalMediaSingle = function insertExternalMediaSingle(_ref6) {
|
|
77
80
|
var _api$media$actions$in2;
|
|
@@ -84,7 +87,7 @@ var mediaInsertPlugin = exports.mediaInsertPlugin = function mediaInsertPlugin(_
|
|
|
84
87
|
alt: alt,
|
|
85
88
|
__external: true
|
|
86
89
|
});
|
|
87
|
-
return (_api$media$actions$in2 = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod)) !== null && _api$media$actions$in2 !== void 0 ? _api$media$actions$in2 : false;
|
|
90
|
+
return (_api$media$actions$in2 = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod, isNestingInQuoteSupported)) !== null && _api$media$actions$in2 !== void 0 ? _api$media$actions$in2 : false;
|
|
88
91
|
};
|
|
89
92
|
var insertFile = function insertFile(_ref7) {
|
|
90
93
|
var _api$media$sharedStat, _api$media$sharedStat2;
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { IconImages } from '@atlaskit/editor-common/quick-insert';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { closeMediaInsertPicker, showMediaInsertPopup } from './actions';
|
|
6
7
|
import { createPlugin } from './pm-plugins/main';
|
|
7
8
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -9,6 +10,8 @@ import { MediaInsertPicker } from './ui/MediaInsertPicker';
|
|
|
9
10
|
export const mediaInsertPlugin = ({
|
|
10
11
|
api
|
|
11
12
|
}) => {
|
|
13
|
+
var _api$featureFlags, _api$featureFlags$sha;
|
|
14
|
+
const isNestingInQuoteSupported = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : (_api$featureFlags$sha = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags$sha === void 0 ? void 0 : _api$featureFlags$sha.nestMediaAndCodeblockInQuote) || fg('editor_nest_media_and_codeblock_in_quotes_jira');
|
|
12
15
|
return {
|
|
13
16
|
name: 'mediaInsert',
|
|
14
17
|
pmPlugins() {
|
|
@@ -68,7 +71,7 @@ export const mediaInsertPlugin = ({
|
|
|
68
71
|
alt: fileName,
|
|
69
72
|
__fileMimeType: mediaState.fileMimeType
|
|
70
73
|
});
|
|
71
|
-
return (_api$media$actions$in = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod)) !== null && _api$media$actions$in !== void 0 ? _api$media$actions$in : false;
|
|
74
|
+
return (_api$media$actions$in = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod, isNestingInQuoteSupported)) !== null && _api$media$actions$in !== void 0 ? _api$media$actions$in : false;
|
|
72
75
|
};
|
|
73
76
|
const insertExternalMediaSingle = ({
|
|
74
77
|
url,
|
|
@@ -82,7 +85,7 @@ export const mediaInsertPlugin = ({
|
|
|
82
85
|
alt,
|
|
83
86
|
__external: true
|
|
84
87
|
});
|
|
85
|
-
return (_api$media$actions$in2 = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod)) !== null && _api$media$actions$in2 !== void 0 ? _api$media$actions$in2 : false;
|
|
88
|
+
return (_api$media$actions$in2 = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod, isNestingInQuoteSupported)) !== null && _api$media$actions$in2 !== void 0 ? _api$media$actions$in2 : false;
|
|
86
89
|
};
|
|
87
90
|
const insertFile = ({
|
|
88
91
|
mediaState,
|
package/dist/esm/plugin.js
CHANGED
|
@@ -2,12 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { IconImages } from '@atlaskit/editor-common/quick-insert';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { closeMediaInsertPicker as _closeMediaInsertPicker, showMediaInsertPopup } from './actions';
|
|
6
7
|
import { createPlugin } from './pm-plugins/main';
|
|
7
8
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
8
9
|
import { MediaInsertPicker } from './ui/MediaInsertPicker';
|
|
9
10
|
export var mediaInsertPlugin = function mediaInsertPlugin(_ref) {
|
|
11
|
+
var _api$featureFlags;
|
|
10
12
|
var api = _ref.api;
|
|
13
|
+
var isNestingInQuoteSupported = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 || (_api$featureFlags = _api$featureFlags.sharedState.currentState()) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.nestMediaAndCodeblockInQuote) || fg('editor_nest_media_and_codeblock_in_quotes_jira');
|
|
11
14
|
return {
|
|
12
15
|
name: 'mediaInsert',
|
|
13
16
|
pmPlugins: function pmPlugins() {
|
|
@@ -64,7 +67,7 @@ export var mediaInsertPlugin = function mediaInsertPlugin(_ref) {
|
|
|
64
67
|
alt: fileName,
|
|
65
68
|
__fileMimeType: mediaState.fileMimeType
|
|
66
69
|
});
|
|
67
|
-
return (_api$media$actions$in = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod)) !== null && _api$media$actions$in !== void 0 ? _api$media$actions$in : false;
|
|
70
|
+
return (_api$media$actions$in = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod, isNestingInQuoteSupported)) !== null && _api$media$actions$in !== void 0 ? _api$media$actions$in : false;
|
|
68
71
|
};
|
|
69
72
|
var insertExternalMediaSingle = function insertExternalMediaSingle(_ref6) {
|
|
70
73
|
var _api$media$actions$in2;
|
|
@@ -77,7 +80,7 @@ export var mediaInsertPlugin = function mediaInsertPlugin(_ref) {
|
|
|
77
80
|
alt: alt,
|
|
78
81
|
__external: true
|
|
79
82
|
});
|
|
80
|
-
return (_api$media$actions$in2 = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod)) !== null && _api$media$actions$in2 !== void 0 ? _api$media$actions$in2 : false;
|
|
83
|
+
return (_api$media$actions$in2 = api === null || api === void 0 ? void 0 : api.media.actions.insertMediaAsMediaSingle(editorView, node, inputMethod, isNestingInQuoteSupported)) !== null && _api$media$actions$in2 !== void 0 ? _api$media$actions$in2 : false;
|
|
81
84
|
};
|
|
82
85
|
var insertFile = function insertFile(_ref7) {
|
|
83
86
|
var _api$media$sharedStat, _api$media$sharedStat2;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
|
3
3
|
import type { NextEditorPlugin, OptionalPlugin, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
7
|
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
7
8
|
import { type MediaState, type MediaStateEventSubscriber } from '@atlaskit/editor-plugin-media/types';
|
|
8
9
|
export type MediaInsertPluginState = {
|
|
@@ -13,7 +14,11 @@ export type InsertMediaSingle = (props: {
|
|
|
13
14
|
inputMethod: InputMethodInsertMedia;
|
|
14
15
|
}) => boolean;
|
|
15
16
|
export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
16
|
-
dependencies: [
|
|
17
|
+
dependencies: [
|
|
18
|
+
OptionalPlugin<AnalyticsPlugin>,
|
|
19
|
+
MediaPlugin,
|
|
20
|
+
OptionalPlugin<FeatureFlagsPlugin>
|
|
21
|
+
];
|
|
17
22
|
sharedState: MediaInsertPluginState;
|
|
18
23
|
}>;
|
|
19
24
|
export type InsertExternalMediaSingle = (props: {
|
|
@@ -3,6 +3,7 @@ import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
|
3
3
|
import type { NextEditorPlugin, OptionalPlugin, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
|
+
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
7
|
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
7
8
|
import { type MediaState, type MediaStateEventSubscriber } from '@atlaskit/editor-plugin-media/types';
|
|
8
9
|
export type MediaInsertPluginState = {
|
|
@@ -15,7 +16,8 @@ export type InsertMediaSingle = (props: {
|
|
|
15
16
|
export type MediaInsertPlugin = NextEditorPlugin<'mediaInsert', {
|
|
16
17
|
dependencies: [
|
|
17
18
|
OptionalPlugin<AnalyticsPlugin>,
|
|
18
|
-
MediaPlugin
|
|
19
|
+
MediaPlugin,
|
|
20
|
+
OptionalPlugin<FeatureFlagsPlugin>
|
|
19
21
|
];
|
|
20
22
|
sharedState: MediaInsertPluginState;
|
|
21
23
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media-insert",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "Media Insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,10 +30,11 @@
|
|
|
30
30
|
"@atlaskit/editor-prosemirror": "6.0.0",
|
|
31
31
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
32
32
|
"@atlaskit/icon": "^22.18.0",
|
|
33
|
-
"@atlaskit/media-card": "^78.
|
|
33
|
+
"@atlaskit/media-card": "^78.4.0",
|
|
34
34
|
"@atlaskit/media-client": "^28.0.0",
|
|
35
35
|
"@atlaskit/media-client-react": "^2.2.0",
|
|
36
|
-
"@atlaskit/media-picker": "^66.
|
|
36
|
+
"@atlaskit/media-picker": "^66.6.0",
|
|
37
|
+
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
37
38
|
"@atlaskit/primitives": "^12.1.0",
|
|
38
39
|
"@atlaskit/section-message": "^6.6.0",
|
|
39
40
|
"@atlaskit/tabs": "^16.4.0",
|
|
@@ -88,5 +89,10 @@
|
|
|
88
89
|
"no-unused-dependencies": {
|
|
89
90
|
"checkDevDependencies": true
|
|
90
91
|
}
|
|
92
|
+
},
|
|
93
|
+
"platform-feature-flags": {
|
|
94
|
+
"editor_nest_media_and_codeblock_in_quotes_jira": {
|
|
95
|
+
"type": "boolean"
|
|
96
|
+
}
|
|
91
97
|
}
|
|
92
98
|
}
|