@atlaskit/editor-plugin-synced-block 19.0.3 → 20.0.0

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-synced-block
2
2
 
3
+ ## 20.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 19.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - [`a034f535638cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a034f535638cc) -
14
+ Add structured Quick Insert previews with localised title, description and attribution under
15
+ platform_editor_slash_command.
16
+
17
+ Exclude footer and category navigation actions from previews. Left-align attribution, use subtle
18
+ title and attribution text, and default description text.
19
+
20
+ Show text previews even without preview metadata, and reserve a fixed image area while images load
21
+ or when they fail. Keep previews within the viewport, flipping left when needed, with compact
22
+ panel dimensions and typography.
23
+
24
+ Replace baked panel screenshots with image-only assets. Remove image fields from text-only legacy
25
+ previews while preserving their attribution.
26
+
27
+ Let extension providers own their preview images and attribution. Pass preview metadata through
28
+ the Company Hub manifest factory and remove Editor's fallback preview registry.
29
+
30
+ Localize provider attribution names and display Confluence and Jira product icons instead of the
31
+ attribution prefix when an icon is present. Allow the Dropbox manifest to receive the host's
32
+ message formatter.
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 19.0.3
4
37
 
5
38
  ### Patch Changes
@@ -32,6 +32,8 @@ var _main = require("../pm-plugins/main");
32
32
  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 _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
33
33
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
34
34
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
35
+ // oxlint-disable-next-line eslint/no-redeclare
36
+
35
37
  var modalContentMap = {
36
38
  'source-block-deleted': {
37
39
  titleMultiple: _messages.syncBlockMessages.deleteConfirmationModalTitleMultiple,
@@ -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
- previewImageUrls: previewImageUrls,
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/AssetLink/3xy4v4e4736r7nghty67s6wxw08opr7p.png',
16
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/n185dd3113dx4146baa3dm3427woq1d6.png'
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,
@@ -17,6 +17,9 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
17
17
  import { Text, Box } from '@atlaskit/primitives/compiled';
18
18
  import Spinner from '@atlaskit/spinner/spinner';
19
19
  import { syncedBlockPluginKey } from '../pm-plugins/main';
20
+
21
+ // oxlint-disable-next-line eslint/no-redeclare
22
+
20
23
  const modalContentMap = {
21
24
  'source-block-deleted': {
22
25
  titleMultiple: messages.deleteConfirmationModalTitleMultiple,
@@ -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
- previewImageUrls: previewImageUrls,
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/AssetLink/3xy4v4e4736r7nghty67s6wxw08opr7p.png',
9
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/n185dd3113dx4146baa3dm3427woq1d6.png'
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,
@@ -23,6 +23,9 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
23
23
  import { Text, Box } from '@atlaskit/primitives/compiled';
24
24
  import Spinner from '@atlaskit/spinner/spinner';
25
25
  import { syncedBlockPluginKey } from '../pm-plugins/main';
26
+
27
+ // oxlint-disable-next-line eslint/no-redeclare
28
+
26
29
  var modalContentMap = {
27
30
  'source-block-deleted': {
28
31
  titleMultiple: messages.deleteConfirmationModalTitleMultiple,
@@ -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
- previewImageUrls: previewImageUrls,
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/AssetLink/3xy4v4e4736r7nghty67s6wxw08opr7p.png',
9
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/n185dd3113dx4146baa3dm3427woq1d6.png'
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",
3
+ "version": "20.0.0",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -24,28 +24,28 @@
24
24
  "@atlaskit/button": "25.4.2",
25
25
  "@atlaskit/dropdown-menu": "18.3.7",
26
26
  "@atlaskit/editor-json-transformer": "^10.0.0",
27
- "@atlaskit/editor-plugin-analytics": "^21.0.0",
28
- "@atlaskit/editor-plugin-block-controls": "^22.0.0",
29
- "@atlaskit/editor-plugin-block-menu": "^20.0.0",
30
- "@atlaskit/editor-plugin-connectivity": "21.0.0",
31
- "@atlaskit/editor-plugin-content-format": "^15.0.0",
32
- "@atlaskit/editor-plugin-decorations": "^21.0.0",
33
- "@atlaskit/editor-plugin-editor-disabled": "^21.0.0",
34
- "@atlaskit/editor-plugin-editor-viewmode": "^23.0.0",
35
- "@atlaskit/editor-plugin-floating-toolbar": "^23.0.0",
36
- "@atlaskit/editor-plugin-focus": "^20.0.0",
37
- "@atlaskit/editor-plugin-history": "^21.0.0",
38
- "@atlaskit/editor-plugin-selection": "^21.0.0",
39
- "@atlaskit/editor-plugin-toolbar": "^18.0.0",
40
- "@atlaskit/editor-plugin-ui-control-registry": "^15.0.0",
41
- "@atlaskit/editor-plugin-user-intent": "^19.0.0",
27
+ "@atlaskit/editor-plugin-analytics": "^22.0.0",
28
+ "@atlaskit/editor-plugin-block-controls": "^23.0.0",
29
+ "@atlaskit/editor-plugin-block-menu": "^21.0.0",
30
+ "@atlaskit/editor-plugin-connectivity": "22.0.0",
31
+ "@atlaskit/editor-plugin-content-format": "^16.0.0",
32
+ "@atlaskit/editor-plugin-decorations": "^22.0.0",
33
+ "@atlaskit/editor-plugin-editor-disabled": "^22.0.0",
34
+ "@atlaskit/editor-plugin-editor-viewmode": "^24.0.0",
35
+ "@atlaskit/editor-plugin-floating-toolbar": "^24.0.0",
36
+ "@atlaskit/editor-plugin-focus": "^21.0.0",
37
+ "@atlaskit/editor-plugin-history": "^22.0.0",
38
+ "@atlaskit/editor-plugin-selection": "^22.0.0",
39
+ "@atlaskit/editor-plugin-toolbar": "^19.0.0",
40
+ "@atlaskit/editor-plugin-ui-control-registry": "^16.0.0",
41
+ "@atlaskit/editor-plugin-user-intent": "^20.0.0",
42
42
  "@atlaskit/editor-prosemirror": "^9.0.0",
43
43
  "@atlaskit/editor-shared-styles": "^4.3.0",
44
- "@atlaskit/editor-synced-block-provider": "^17.0.0",
45
- "@atlaskit/editor-toolbar": "^2.7.0",
44
+ "@atlaskit/editor-synced-block-provider": "^18.0.0",
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.9.0",
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": "^208.0.0",
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.2.0",
68
+ "@atlaskit/editor-common": "^126.0.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
  },