@atlaskit/editor-plugin-media-insert 39.0.2 → 39.0.4
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
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media-insert
|
|
2
2
|
|
|
3
|
+
## 39.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a034f535638cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a034f535638cc) -
|
|
8
|
+
Add structured Quick Insert previews with localised title, description and attribution under
|
|
9
|
+
platform_editor_slash_command.
|
|
10
|
+
|
|
11
|
+
Exclude footer and category navigation actions from previews. Left-align attribution, use subtle
|
|
12
|
+
title and attribution text, and default description text.
|
|
13
|
+
|
|
14
|
+
Show text previews even without preview metadata, and reserve a fixed image area while images load
|
|
15
|
+
or when they fail. Keep previews within the viewport, flipping left when needed, with compact
|
|
16
|
+
panel dimensions and typography.
|
|
17
|
+
|
|
18
|
+
Replace baked panel screenshots with image-only assets. Remove image fields from text-only legacy
|
|
19
|
+
previews while preserving their attribution.
|
|
20
|
+
|
|
21
|
+
Let extension providers own their preview images and attribution. Pass preview metadata through
|
|
22
|
+
the Company Hub manifest factory and remove Editor's fallback preview registry.
|
|
23
|
+
|
|
24
|
+
Localize provider attribution names and display Confluence and Jira product icons instead of the
|
|
25
|
+
attribution prefix when an icon is present. Allow the Dropbox manifest to receive the host's
|
|
26
|
+
message formatter.
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
30
|
+
## 39.0.3
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 39.0.2
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -12,12 +12,13 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
12
12
|
var _rank = require("@atlaskit/editor-common/media-insert/rank");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
|
|
15
|
+
var _messages2 = require("@atlaskit/editor-common/quick-insert/messages");
|
|
15
16
|
var _useQuickInsertContext = require("@atlaskit/editor-common/quick-insert/use-quick-insert-context");
|
|
16
17
|
var _image = _interopRequireDefault(require("@atlaskit/icon/core/image"));
|
|
17
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
19
|
var previewImageUrls = {
|
|
19
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
20
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
20
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVK4.png',
|
|
21
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNH.png'
|
|
21
22
|
};
|
|
22
23
|
var MediaInsertQuickInsertMenuItem = exports.MediaInsertQuickInsertMenuItem = function MediaInsertQuickInsertMenuItem(_ref) {
|
|
23
24
|
var api = _ref.api,
|
|
@@ -26,6 +27,14 @@ var MediaInsertQuickInsertMenuItem = exports.MediaInsertQuickInsertMenuItem = fu
|
|
|
26
27
|
formatMessage = _useIntl.formatMessage;
|
|
27
28
|
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
28
29
|
isOffline = _useQuickInsertContex.isOffline;
|
|
30
|
+
var preview = (0, _react.useMemo)(function () {
|
|
31
|
+
return {
|
|
32
|
+
image: previewImageUrls,
|
|
33
|
+
attribution: {
|
|
34
|
+
name: formatMessage(_messages2.messages.previewAttributionAtlassian)
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, [formatMessage]);
|
|
29
38
|
var onSelect = (0, _react.useCallback)(function (_ref2) {
|
|
30
39
|
var _api$mediaInsert, _api$mediaInsert2, _api$analytics, _firstRegisteredTab$r;
|
|
31
40
|
var insert = _ref2.insert;
|
|
@@ -52,12 +61,13 @@ var MediaInsertQuickInsertMenuItem = exports.MediaInsertQuickInsertMenuItem = fu
|
|
|
52
61
|
return tr;
|
|
53
62
|
}, [api, config]);
|
|
54
63
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
64
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.mediaFilesDescription),
|
|
55
65
|
iconBefore: /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
56
66
|
label: ""
|
|
57
67
|
}),
|
|
58
68
|
isDisabled: isOffline,
|
|
59
69
|
onSelect: onSelect,
|
|
60
|
-
|
|
70
|
+
preview: preview,
|
|
61
71
|
title: formatMessage(_messages.toolbarInsertBlockMessages.mediaFiles)
|
|
62
72
|
});
|
|
63
73
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, MEDIA_INSERT_TAB } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { DEFAULT_MEDIA_INSERT_TAB_RANK, MEDIA_INSERT_TAB_RANK } from '@atlaskit/editor-common/media-insert/rank';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
|
+
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
7
8
|
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
8
9
|
import ImageIcon from '@atlaskit/icon/core/image';
|
|
9
10
|
const previewImageUrls = {
|
|
10
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
11
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
11
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVK4.png',
|
|
12
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNH.png'
|
|
12
13
|
};
|
|
13
14
|
export const MediaInsertQuickInsertMenuItem = ({
|
|
14
15
|
api,
|
|
@@ -20,6 +21,12 @@ export const MediaInsertQuickInsertMenuItem = ({
|
|
|
20
21
|
const {
|
|
21
22
|
isOffline
|
|
22
23
|
} = useQuickInsertContext();
|
|
24
|
+
const preview = useMemo(() => ({
|
|
25
|
+
image: previewImageUrls,
|
|
26
|
+
attribution: {
|
|
27
|
+
name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
|
|
28
|
+
}
|
|
29
|
+
}), [formatMessage]);
|
|
23
30
|
const onSelect = useCallback(({
|
|
24
31
|
insert
|
|
25
32
|
}) => {
|
|
@@ -47,12 +54,13 @@ export const MediaInsertQuickInsertMenuItem = ({
|
|
|
47
54
|
return tr;
|
|
48
55
|
}, [api, config]);
|
|
49
56
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
57
|
+
description: formatMessage(messages.mediaFilesDescription),
|
|
50
58
|
iconBefore: /*#__PURE__*/React.createElement(ImageIcon, {
|
|
51
59
|
label: ""
|
|
52
60
|
}),
|
|
53
61
|
isDisabled: isOffline,
|
|
54
62
|
onSelect: onSelect,
|
|
55
|
-
|
|
63
|
+
preview: preview,
|
|
56
64
|
title: formatMessage(messages.mediaFiles)
|
|
57
65
|
});
|
|
58
66
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, MEDIA_INSERT_TAB } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { DEFAULT_MEDIA_INSERT_TAB_RANK, MEDIA_INSERT_TAB_RANK } from '@atlaskit/editor-common/media-insert/rank';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
|
|
7
|
+
import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
|
|
7
8
|
import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
|
|
8
9
|
import ImageIcon from '@atlaskit/icon/core/image';
|
|
9
10
|
var previewImageUrls = {
|
|
10
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
11
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
11
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVK4.png',
|
|
12
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVNH.png'
|
|
12
13
|
};
|
|
13
14
|
export var MediaInsertQuickInsertMenuItem = function MediaInsertQuickInsertMenuItem(_ref) {
|
|
14
15
|
var api = _ref.api,
|
|
@@ -17,6 +18,14 @@ export var MediaInsertQuickInsertMenuItem = function MediaInsertQuickInsertMenuI
|
|
|
17
18
|
formatMessage = _useIntl.formatMessage;
|
|
18
19
|
var _useQuickInsertContex = useQuickInsertContext(),
|
|
19
20
|
isOffline = _useQuickInsertContex.isOffline;
|
|
21
|
+
var preview = useMemo(function () {
|
|
22
|
+
return {
|
|
23
|
+
image: previewImageUrls,
|
|
24
|
+
attribution: {
|
|
25
|
+
name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}, [formatMessage]);
|
|
20
29
|
var onSelect = useCallback(function (_ref2) {
|
|
21
30
|
var _api$mediaInsert, _api$mediaInsert2, _api$analytics, _firstRegisteredTab$r;
|
|
22
31
|
var insert = _ref2.insert;
|
|
@@ -43,12 +52,13 @@ export var MediaInsertQuickInsertMenuItem = function MediaInsertQuickInsertMenuI
|
|
|
43
52
|
return tr;
|
|
44
53
|
}, [api, config]);
|
|
45
54
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
55
|
+
description: formatMessage(messages.mediaFilesDescription),
|
|
46
56
|
iconBefore: /*#__PURE__*/React.createElement(ImageIcon, {
|
|
47
57
|
label: ""
|
|
48
58
|
}),
|
|
49
59
|
isDisabled: isOffline,
|
|
50
60
|
onSelect: onSelect,
|
|
51
|
-
|
|
61
|
+
preview: preview,
|
|
52
62
|
title: formatMessage(messages.mediaFiles)
|
|
53
63
|
});
|
|
54
64
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media-insert",
|
|
3
|
-
"version": "39.0.
|
|
3
|
+
"version": "39.0.4",
|
|
4
4
|
"description": "Media Insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@atlaskit/section-message": "^10.2.0",
|
|
43
43
|
"@atlaskit/tabs": "^21.2.0",
|
|
44
44
|
"@atlaskit/textfield": "^10.2.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^209.0.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^125.
|
|
49
|
+
"@atlaskit/editor-common": "^125.4.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
51
51
|
"@atlaskit/tokens": "^20.0.0",
|
|
52
52
|
"react": "^18.2.0 || ^19.2.0",
|