@atlaskit/editor-plugin-block-type 25.0.4 → 25.0.5

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,32 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 25.0.5
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
+
3
30
  ## 25.0.4
4
31
 
5
32
  ### Patch Changes
@@ -12,6 +12,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _keymaps = require("@atlaskit/editor-common/keymaps");
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 _textHeadingFive = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-five"));
16
17
  var _textHeadingFour = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-four"));
17
18
  var _textHeadingOne = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-one"));
@@ -57,32 +58,32 @@ var headingQuickInsertShortcuts = {
57
58
  };
58
59
  var previewImageUrls = {
59
60
  blockquote: {
60
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/d4te57pv7j85c6xr1vui6q708733gfc3.png',
61
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/284qt5g0c4mqi24osl0df4s3ra301mpx.png'
61
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIC.png',
62
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVL6.png'
62
63
  },
63
64
  1: {
64
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/hw6qyn044721b2m7v3102xik2llkf6qb.png',
65
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/1i1ff4is6g200qb6a4181fjecydch0kc.png'
65
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJH.png',
66
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLN.png'
66
67
  },
67
68
  2: {
68
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8abbo27edjqrle6c78u8qj2j67707abu.png',
69
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8rt7x7u7765v72l0ngw65em701u4s58l.png'
69
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVI2.png',
70
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVMW.png'
70
71
  },
71
72
  3: {
72
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/350xa31s48b471rf57xhr344rx8qs17a.png',
73
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/gyt13k2542x5bgq284m10n1hc4baf85j.png'
73
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVID.png',
74
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLC.png'
74
75
  },
75
76
  4: {
76
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/26goi016hs18n0r5243bdh8260ucp58n.png',
77
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/78356r6s0xwe71o13mfj381gpyqt4niq.png'
77
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIT.png',
78
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVM2.png'
78
79
  },
79
80
  5: {
80
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/1uou5866vounmn58aunwxkfo20kk871o.png',
81
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/584t6547t6h570unr3v581oi154625lo.png'
81
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHK.png',
82
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLZ.png'
82
83
  },
83
84
  6: {
84
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/5h60y538ycf7d7646t0k644iau08027l.png',
85
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/g3o407j1432fc405m45r82ygbfv44323.png'
85
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIB.png',
86
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVN0.png'
86
87
  }
87
88
  };
88
89
  var getHeadingQuickInsertMessages = exports.getHeadingQuickInsertMessages = function getHeadingQuickInsertMessages(level) {
@@ -133,6 +134,15 @@ var BlockTypeQuickInsertMenuItem = exports.BlockTypeQuickInsertMenuItem = functi
133
134
  return isBlockquote ? '>' : getHeadingQuickInsertShortcut(item);
134
135
  }, [isBlockquote, item]);
135
136
  var title = formatMessage(item === 'blockquote' ? _messages.blockTypeMessages.blockquote : getHeadingQuickInsertMessages(item).title);
137
+ var description = formatMessage(item === 'blockquote' ? _messages.blockTypeMessages.blockquoteDescription : getHeadingQuickInsertMessages(item).description);
138
+ var preview = (0, _react.useMemo)(function () {
139
+ return {
140
+ image: previewImageUrls[item],
141
+ attribution: {
142
+ name: formatMessage(_messages2.messages.previewAttributionAtlassian)
143
+ }
144
+ };
145
+ }, [formatMessage, item]);
136
146
  var onSelect = (0, _react.useCallback)(function (_ref2) {
137
147
  var editorView = _ref2.editorView,
138
148
  insert = _ref2.insert;
@@ -167,9 +177,10 @@ var BlockTypeQuickInsertMenuItem = exports.BlockTypeQuickInsertMenuItem = functi
167
177
  return tr;
168
178
  }, [api, isBlockquote, item]);
169
179
  return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
180
+ description: description,
170
181
  iconBefore: getBlockTypeQuickInsertIcon(item),
171
182
  onSelect: onSelect,
172
- previewImageUrls: previewImageUrls[item],
183
+ preview: preview,
173
184
  shortcut: shortcut,
174
185
  title: title
175
186
  });
@@ -5,6 +5,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
5
5
  import { toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, tooltip } from '@atlaskit/editor-common/keymaps';
6
6
  import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
8
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
8
9
  import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
9
10
  import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
10
11
  import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
@@ -48,32 +49,32 @@ const headingQuickInsertShortcuts = {
48
49
  };
49
50
  const previewImageUrls = {
50
51
  blockquote: {
51
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/d4te57pv7j85c6xr1vui6q708733gfc3.png',
52
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/284qt5g0c4mqi24osl0df4s3ra301mpx.png'
52
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIC.png',
53
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVL6.png'
53
54
  },
54
55
  1: {
55
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/hw6qyn044721b2m7v3102xik2llkf6qb.png',
56
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/1i1ff4is6g200qb6a4181fjecydch0kc.png'
56
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJH.png',
57
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLN.png'
57
58
  },
58
59
  2: {
59
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8abbo27edjqrle6c78u8qj2j67707abu.png',
60
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8rt7x7u7765v72l0ngw65em701u4s58l.png'
60
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVI2.png',
61
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVMW.png'
61
62
  },
62
63
  3: {
63
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/350xa31s48b471rf57xhr344rx8qs17a.png',
64
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/gyt13k2542x5bgq284m10n1hc4baf85j.png'
64
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVID.png',
65
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLC.png'
65
66
  },
66
67
  4: {
67
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/26goi016hs18n0r5243bdh8260ucp58n.png',
68
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/78356r6s0xwe71o13mfj381gpyqt4niq.png'
68
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIT.png',
69
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVM2.png'
69
70
  },
70
71
  5: {
71
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/1uou5866vounmn58aunwxkfo20kk871o.png',
72
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/584t6547t6h570unr3v581oi154625lo.png'
72
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHK.png',
73
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLZ.png'
73
74
  },
74
75
  6: {
75
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/5h60y538ycf7d7646t0k644iau08027l.png',
76
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/g3o407j1432fc405m45r82ygbfv44323.png'
76
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIB.png',
77
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVN0.png'
77
78
  }
78
79
  };
79
80
  export const getHeadingQuickInsertMessages = level => headingQuickInsertMessages[level];
@@ -120,6 +121,13 @@ export const BlockTypeQuickInsertMenuItem = ({
120
121
  const isBlockquote = item === 'blockquote';
121
122
  const shortcut = useMemo(() => isBlockquote ? '>' : getHeadingQuickInsertShortcut(item), [isBlockquote, item]);
122
123
  const title = formatMessage(item === 'blockquote' ? messages.blockquote : getHeadingQuickInsertMessages(item).title);
124
+ const description = formatMessage(item === 'blockquote' ? messages.blockquoteDescription : getHeadingQuickInsertMessages(item).description);
125
+ const preview = useMemo(() => ({
126
+ image: previewImageUrls[item],
127
+ attribution: {
128
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
129
+ }
130
+ }), [formatMessage, item]);
123
131
  const onSelect = useCallback(({
124
132
  editorView,
125
133
  insert
@@ -157,9 +165,10 @@ export const BlockTypeQuickInsertMenuItem = ({
157
165
  return tr;
158
166
  }, [api, isBlockquote, item]);
159
167
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
168
+ description: description,
160
169
  iconBefore: getBlockTypeQuickInsertIcon(item),
161
170
  onSelect: onSelect,
162
- previewImageUrls: previewImageUrls[item],
171
+ preview: preview,
163
172
  shortcut: shortcut,
164
173
  title: title
165
174
  });
@@ -5,6 +5,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
5
5
  import { toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, tooltip } from '@atlaskit/editor-common/keymaps';
6
6
  import { blockTypeMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
8
+ import { messages as quickInsertMessages } from '@atlaskit/editor-common/quick-insert/messages';
8
9
  import TextHeadingFiveIcon from '@atlaskit/icon-lab/core/text-heading-five';
9
10
  import TextHeadingFourIcon from '@atlaskit/icon-lab/core/text-heading-four';
10
11
  import TextHeadingOneIcon from '@atlaskit/icon-lab/core/text-heading-one';
@@ -48,32 +49,32 @@ var headingQuickInsertShortcuts = {
48
49
  };
49
50
  var previewImageUrls = {
50
51
  blockquote: {
51
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/d4te57pv7j85c6xr1vui6q708733gfc3.png',
52
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/284qt5g0c4mqi24osl0df4s3ra301mpx.png'
52
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIC.png',
53
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVL6.png'
53
54
  },
54
55
  1: {
55
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/hw6qyn044721b2m7v3102xik2llkf6qb.png',
56
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/1i1ff4is6g200qb6a4181fjecydch0kc.png'
56
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVJH.png',
57
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLN.png'
57
58
  },
58
59
  2: {
59
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8abbo27edjqrle6c78u8qj2j67707abu.png',
60
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/8rt7x7u7765v72l0ngw65em701u4s58l.png'
60
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVI2.png',
61
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVMW.png'
61
62
  },
62
63
  3: {
63
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/350xa31s48b471rf57xhr344rx8qs17a.png',
64
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/gyt13k2542x5bgq284m10n1hc4baf85j.png'
64
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVID.png',
65
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLC.png'
65
66
  },
66
67
  4: {
67
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/26goi016hs18n0r5243bdh8260ucp58n.png',
68
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/78356r6s0xwe71o13mfj381gpyqt4niq.png'
68
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIT.png',
69
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVM2.png'
69
70
  },
70
71
  5: {
71
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/1uou5866vounmn58aunwxkfo20kk871o.png',
72
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/584t6547t6h570unr3v581oi154625lo.png'
72
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVHK.png',
73
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVLZ.png'
73
74
  },
74
75
  6: {
75
- dark: 'https://dam-cdn.atl.orangelogic.com/AssetLink/5h60y538ycf7d7646t0k644iau08027l.png',
76
- light: 'https://dam-cdn.atl.orangelogic.com/AssetLink/g3o407j1432fc405m45r82ygbfv44323.png'
76
+ dark: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVIB.png',
77
+ light: 'https://dam-cdn.atl.orangelogic.com/CDNLink/AT12OVN0.png'
77
78
  }
78
79
  };
79
80
  export var getHeadingQuickInsertMessages = function getHeadingQuickInsertMessages(level) {
@@ -124,6 +125,15 @@ export var BlockTypeQuickInsertMenuItem = function BlockTypeQuickInsertMenuItem(
124
125
  return isBlockquote ? '>' : getHeadingQuickInsertShortcut(item);
125
126
  }, [isBlockquote, item]);
126
127
  var title = formatMessage(item === 'blockquote' ? messages.blockquote : getHeadingQuickInsertMessages(item).title);
128
+ var description = formatMessage(item === 'blockquote' ? messages.blockquoteDescription : getHeadingQuickInsertMessages(item).description);
129
+ var preview = useMemo(function () {
130
+ return {
131
+ image: previewImageUrls[item],
132
+ attribution: {
133
+ name: formatMessage(quickInsertMessages.previewAttributionAtlassian)
134
+ }
135
+ };
136
+ }, [formatMessage, item]);
127
137
  var onSelect = useCallback(function (_ref2) {
128
138
  var editorView = _ref2.editorView,
129
139
  insert = _ref2.insert;
@@ -158,9 +168,10 @@ export var BlockTypeQuickInsertMenuItem = function BlockTypeQuickInsertMenuItem(
158
168
  return tr;
159
169
  }, [api, isBlockquote, item]);
160
170
  return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
171
+ description: description,
161
172
  iconBefore: getBlockTypeQuickInsertIcon(item),
162
173
  onSelect: onSelect,
163
- previewImageUrls: previewImageUrls[item],
174
+ preview: preview,
164
175
  shortcut: shortcut,
165
176
  title: title
166
177
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "25.0.4",
3
+ "version": "25.0.5",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,14 +43,14 @@
43
43
  "@atlaskit/primitives": "^22.5.0",
44
44
  "@atlaskit/prosemirror-history": "^1.2.0",
45
45
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
46
- "@atlaskit/tmp-editor-statsig": "^208.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^209.0.0",
47
47
  "@atlaskit/tokens": "^20.0.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^1.0.2",
50
50
  "@emotion/react": "^11.7.1"
51
51
  },
52
52
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^125.3.0",
53
+ "@atlaskit/editor-common": "^125.4.0",
54
54
  "react": "^18.2.0 || ^19.2.0",
55
55
  "react-dom": "^18.2.0 || ^19.2.0",
56
56
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"