@atlaskit/editor-plugin-synced-block 19.0.2 → 19.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 +33 -0
- package/dist/cjs/ui/quick-insert/SyncedBlockQuickInsertMenuItem.js +11 -1
- package/dist/cjs/ui/quick-insert/getSyncedBlockQuickInsertComponents.js +2 -2
- package/dist/es2019/ui/quick-insert/SyncedBlockQuickInsertMenuItem.js +10 -2
- package/dist/es2019/ui/quick-insert/getSyncedBlockQuickInsertComponents.js +2 -2
- package/dist/esm/ui/quick-insert/SyncedBlockQuickInsertMenuItem.js +12 -2
- package/dist/esm/ui/quick-insert/getSyncedBlockQuickInsertComponents.js +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 19.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
|
+
## 19.0.3
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
|
|
3
36
|
## 19.0.2
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
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 _blockSynced = _interopRequireDefault(require("@atlaskit/icon-lab/core/block-synced"));
|
|
16
17
|
var _editorCommands = require("../../editor-commands");
|
|
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); }
|
|
@@ -21,6 +22,14 @@ var SyncedBlockQuickInsertMenuItem = exports.SyncedBlockQuickInsertMenuItem = fu
|
|
|
21
22
|
syncBlockStore = _ref.syncBlockStore;
|
|
22
23
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
23
24
|
formatMessage = _useIntl.formatMessage;
|
|
25
|
+
var preview = (0, _react.useMemo)(function () {
|
|
26
|
+
return previewImageUrls ? {
|
|
27
|
+
image: previewImageUrls,
|
|
28
|
+
attribution: {
|
|
29
|
+
name: formatMessage(_messages2.messages.previewAttributionAtlassian)
|
|
30
|
+
}
|
|
31
|
+
} : undefined;
|
|
32
|
+
}, [formatMessage, previewImageUrls]);
|
|
24
33
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['editorDisabled'], function (states) {
|
|
25
34
|
var _states$editorDisable;
|
|
26
35
|
return {
|
|
@@ -42,12 +51,13 @@ var SyncedBlockQuickInsertMenuItem = exports.SyncedBlockQuickInsertMenuItem = fu
|
|
|
42
51
|
});
|
|
43
52
|
}, [api, syncBlockStore]);
|
|
44
53
|
return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
|
|
54
|
+
description: formatMessage(_messages.blockTypeMessages.syncedBlockDescription),
|
|
45
55
|
iconBefore: /*#__PURE__*/_react.default.createElement(_blockSynced.default, {
|
|
46
56
|
label: ""
|
|
47
57
|
}),
|
|
48
58
|
isDisabled: editorDisabled,
|
|
49
59
|
onSelect: onSelect,
|
|
50
|
-
|
|
60
|
+
preview: preview,
|
|
51
61
|
title: formatMessage(_messages.blockTypeMessages.syncedBlockQuickInsertTitle)
|
|
52
62
|
});
|
|
53
63
|
};
|
|
@@ -12,8 +12,8 @@ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
|
12
12
|
var _rank = require("@atlaskit/editor-common/quick-insert/rank");
|
|
13
13
|
var _SyncedBlockQuickInsertMenuItem = require("./SyncedBlockQuickInsertMenuItem");
|
|
14
14
|
var previewImageUrls = {
|
|
15
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
16
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
15
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKD.png',
|
|
16
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH3.png'
|
|
17
17
|
};
|
|
18
18
|
var getSyncedBlockQuickInsertComponents = exports.getSyncedBlockQuickInsertComponents = function getSyncedBlockQuickInsertComponents(_ref) {
|
|
19
19
|
var api = _ref.api,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { blockTypeMessages } 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 BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
8
9
|
import { createSyncedBlock } from '../../editor-commands';
|
|
9
10
|
export const SyncedBlockQuickInsertMenuItem = ({
|
|
@@ -14,6 +15,12 @@ export const SyncedBlockQuickInsertMenuItem = ({
|
|
|
14
15
|
const {
|
|
15
16
|
formatMessage
|
|
16
17
|
} = useIntl();
|
|
18
|
+
const preview = useMemo(() => previewImageUrls ? {
|
|
19
|
+
image: previewImageUrls,
|
|
20
|
+
attribution: {
|
|
21
|
+
name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
|
|
22
|
+
}
|
|
23
|
+
} : undefined, [formatMessage, previewImageUrls]);
|
|
17
24
|
const {
|
|
18
25
|
editorDisabled
|
|
19
26
|
} = useSharedPluginStateWithSelector(api, ['editorDisabled'], states => {
|
|
@@ -37,12 +44,13 @@ export const SyncedBlockQuickInsertMenuItem = ({
|
|
|
37
44
|
});
|
|
38
45
|
}, [api, syncBlockStore]);
|
|
39
46
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
47
|
+
description: formatMessage(blockTypeMessages.syncedBlockDescription),
|
|
40
48
|
iconBefore: /*#__PURE__*/React.createElement(BlockSyncedIcon, {
|
|
41
49
|
label: ""
|
|
42
50
|
}),
|
|
43
51
|
isDisabled: editorDisabled,
|
|
44
52
|
onSelect: onSelect,
|
|
45
|
-
|
|
53
|
+
preview: preview,
|
|
46
54
|
title: formatMessage(blockTypeMessages.syncedBlockQuickInsertTitle)
|
|
47
55
|
});
|
|
48
56
|
};
|
|
@@ -5,8 +5,8 @@ import { STRUCTURE_SECTION, SYNCED_BLOCK_MENU_ITEM } from '@atlaskit/editor-comm
|
|
|
5
5
|
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
6
6
|
import { SyncedBlockQuickInsertMenuItem } from './SyncedBlockQuickInsertMenuItem';
|
|
7
7
|
const previewImageUrls = {
|
|
8
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
9
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
8
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKD.png',
|
|
9
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH3.png'
|
|
10
10
|
};
|
|
11
11
|
export const getSyncedBlockQuickInsertComponents = ({
|
|
12
12
|
api,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { blockTypeMessages } 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 BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
8
9
|
import { createSyncedBlock } from '../../editor-commands';
|
|
9
10
|
export var SyncedBlockQuickInsertMenuItem = function SyncedBlockQuickInsertMenuItem(_ref) {
|
|
@@ -12,6 +13,14 @@ export var SyncedBlockQuickInsertMenuItem = function SyncedBlockQuickInsertMenuI
|
|
|
12
13
|
syncBlockStore = _ref.syncBlockStore;
|
|
13
14
|
var _useIntl = useIntl(),
|
|
14
15
|
formatMessage = _useIntl.formatMessage;
|
|
16
|
+
var preview = useMemo(function () {
|
|
17
|
+
return previewImageUrls ? {
|
|
18
|
+
image: previewImageUrls,
|
|
19
|
+
attribution: {
|
|
20
|
+
name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
|
|
21
|
+
}
|
|
22
|
+
} : undefined;
|
|
23
|
+
}, [formatMessage, previewImageUrls]);
|
|
15
24
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['editorDisabled'], function (states) {
|
|
16
25
|
var _states$editorDisable;
|
|
17
26
|
return {
|
|
@@ -33,12 +42,13 @@ export var SyncedBlockQuickInsertMenuItem = function SyncedBlockQuickInsertMenuI
|
|
|
33
42
|
});
|
|
34
43
|
}, [api, syncBlockStore]);
|
|
35
44
|
return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
|
|
45
|
+
description: formatMessage(blockTypeMessages.syncedBlockDescription),
|
|
36
46
|
iconBefore: /*#__PURE__*/React.createElement(BlockSyncedIcon, {
|
|
37
47
|
label: ""
|
|
38
48
|
}),
|
|
39
49
|
isDisabled: editorDisabled,
|
|
40
50
|
onSelect: onSelect,
|
|
41
|
-
|
|
51
|
+
preview: preview,
|
|
42
52
|
title: formatMessage(blockTypeMessages.syncedBlockQuickInsertTitle)
|
|
43
53
|
});
|
|
44
54
|
};
|
|
@@ -5,8 +5,8 @@ import { STRUCTURE_SECTION, SYNCED_BLOCK_MENU_ITEM } from '@atlaskit/editor-comm
|
|
|
5
5
|
import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
|
|
6
6
|
import { SyncedBlockQuickInsertMenuItem } from './SyncedBlockQuickInsertMenuItem';
|
|
7
7
|
var previewImageUrls = {
|
|
8
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
9
|
-
dark: 'https://dam-cdn.atl.orangelogic.com/
|
|
8
|
+
light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVKD.png',
|
|
9
|
+
dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVH3.png'
|
|
10
10
|
};
|
|
11
11
|
export var getSyncedBlockQuickInsertComponents = function getSyncedBlockQuickInsertComponents(_ref) {
|
|
12
12
|
var api = _ref.api,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.4",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
44
44
|
"@atlaskit/editor-synced-block-provider": "^17.0.0",
|
|
45
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
45
|
+
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
46
46
|
"@atlaskit/flag": "^19.0.0",
|
|
47
47
|
"@atlaskit/icon": "38.0.1",
|
|
48
|
-
"@atlaskit/icon-lab": "^7.
|
|
48
|
+
"@atlaskit/icon-lab": "^7.10.0",
|
|
49
49
|
"@atlaskit/logo": "^23.3.0",
|
|
50
50
|
"@atlaskit/lozenge": "^15.4.0",
|
|
51
51
|
"@atlaskit/modal-dialog": "^17.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
54
54
|
"@atlaskit/primitives": "^22.5.0",
|
|
55
55
|
"@atlaskit/spinner": "20.4.4",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^209.0.0",
|
|
57
57
|
"@atlaskit/tokens": "20.0.0",
|
|
58
58
|
"@atlaskit/tooltip": "^24.3.0",
|
|
59
59
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"memoize-one": "^6.0.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@atlaskit/editor-common": "^125.
|
|
68
|
+
"@atlaskit/editor-common": "^125.4.0",
|
|
69
69
|
"react": "^18.2.0 || ^19.2.0",
|
|
70
70
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
71
71
|
},
|