@atlaskit/editor-plugin-block-type 25.0.3 → 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 +38 -0
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/blocktype-button.js +4 -4
- package/dist/cjs/ui/quick-insert/BlockTypeQuickInsertMenuItem.js +26 -15
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/blocktype-button.js +4 -4
- package/dist/es2019/ui/quick-insert/BlockTypeQuickInsertMenuItem.js +24 -15
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/blocktype-button.js +4 -4
- package/dist/esm/ui/quick-insert/BlockTypeQuickInsertMenuItem.js +26 -15
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
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
|
+
|
|
30
|
+
## 25.0.4
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- [`e339b127f827a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e339b127f827a) -
|
|
35
|
+
Route `platform_editor_controls` checks that used `expValEquals` / `expValEqualsNoExposure`
|
|
36
|
+
through `editorExperiment`, so they respect the per-product experiment key (Confluence
|
|
37
|
+
`platform_editor_controls`, Jira `platform_editor_controls_jira`). Previously these checks always
|
|
38
|
+
read the Confluence experiment, which evaluated to control in Jira.
|
|
39
|
+
- Updated dependencies
|
|
40
|
+
|
|
3
41
|
## 25.0.3
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -14,7 +14,7 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
14
14
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
15
15
|
var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
|
|
16
16
|
var _primitives = require("@atlaskit/primitives");
|
|
17
|
-
var
|
|
17
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
18
18
|
var _blockTypes = require("../../block-types");
|
|
19
19
|
var _styled = require("./styled");
|
|
20
20
|
/**
|
|
@@ -41,13 +41,13 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
|
|
|
41
41
|
blockTypeName: blockTypeName
|
|
42
42
|
});
|
|
43
43
|
var toolipTextStyles = props.formatMessage(_messages.toolbarMessages.textStylesTooltip);
|
|
44
|
-
var icon = (0,
|
|
44
|
+
var icon = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && props.blockTypeIcon ? props.blockTypeIcon : (0, _react2.jsx)(_text.default, {
|
|
45
45
|
label: labelTextStyles,
|
|
46
46
|
spacing: "spacious",
|
|
47
47
|
color: "currentColor"
|
|
48
48
|
});
|
|
49
|
-
var chevronIconSpacing = (0,
|
|
50
|
-
var shouldUseIconAsButton = props.isSmall || (0,
|
|
49
|
+
var chevronIconSpacing = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? 'spacious' : 'none';
|
|
50
|
+
var shouldUseIconAsButton = props.isSmall || (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1');
|
|
51
51
|
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
52
52
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
|
53
53
|
selected: props.selected
|
|
@@ -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/
|
|
61
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
65
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
69
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
73
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
77
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
81
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
85
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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
|
-
|
|
183
|
+
preview: preview,
|
|
173
184
|
shortcut: shortcut,
|
|
174
185
|
title: title
|
|
175
186
|
});
|
|
@@ -13,7 +13,7 @@ import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
|
13
13
|
import TextIcon from '@atlaskit/icon/core/text';
|
|
14
14
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
15
15
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
16
|
-
import {
|
|
16
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
17
17
|
import { NORMAL_TEXT } from '../../block-types';
|
|
18
18
|
import { wrapperSmallStyle } from './styled';
|
|
19
19
|
const buttonContentStyle = xcss({
|
|
@@ -31,13 +31,13 @@ export const BlockTypeButton = props => {
|
|
|
31
31
|
blockTypeName
|
|
32
32
|
});
|
|
33
33
|
const toolipTextStyles = props.formatMessage(toolbarMessages.textStylesTooltip);
|
|
34
|
-
const icon =
|
|
34
|
+
const icon = editorExperiment('platform_editor_controls', 'variant1') && props.blockTypeIcon ? props.blockTypeIcon : jsx(TextIcon, {
|
|
35
35
|
label: labelTextStyles,
|
|
36
36
|
spacing: "spacious",
|
|
37
37
|
color: "currentColor"
|
|
38
38
|
});
|
|
39
|
-
const chevronIconSpacing =
|
|
40
|
-
const shouldUseIconAsButton = props.isSmall ||
|
|
39
|
+
const chevronIconSpacing = editorExperiment('platform_editor_controls', 'variant1') ? 'spacious' : 'none';
|
|
40
|
+
const shouldUseIconAsButton = props.isSmall || editorExperiment('platform_editor_controls', 'variant1');
|
|
41
41
|
return jsx(ToolbarButton, {
|
|
42
42
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
|
43
43
|
selected: props.selected
|
|
@@ -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/
|
|
52
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
56
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
60
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
64
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
68
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
72
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
76
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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
|
-
|
|
171
|
+
preview: preview,
|
|
163
172
|
shortcut: shortcut,
|
|
164
173
|
title: title
|
|
165
174
|
});
|
|
@@ -13,7 +13,7 @@ import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
|
13
13
|
import TextIcon from '@atlaskit/icon/core/text';
|
|
14
14
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
15
15
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
16
|
-
import {
|
|
16
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
17
17
|
import { NORMAL_TEXT } from '../../block-types';
|
|
18
18
|
import { wrapperSmallStyle } from './styled';
|
|
19
19
|
var buttonContentStyle = xcss({
|
|
@@ -31,13 +31,13 @@ export var BlockTypeButton = function BlockTypeButton(props) {
|
|
|
31
31
|
blockTypeName: blockTypeName
|
|
32
32
|
});
|
|
33
33
|
var toolipTextStyles = props.formatMessage(toolbarMessages.textStylesTooltip);
|
|
34
|
-
var icon =
|
|
34
|
+
var icon = editorExperiment('platform_editor_controls', 'variant1') && props.blockTypeIcon ? props.blockTypeIcon : jsx(TextIcon, {
|
|
35
35
|
label: labelTextStyles,
|
|
36
36
|
spacing: "spacious",
|
|
37
37
|
color: "currentColor"
|
|
38
38
|
});
|
|
39
|
-
var chevronIconSpacing =
|
|
40
|
-
var shouldUseIconAsButton = props.isSmall ||
|
|
39
|
+
var chevronIconSpacing = editorExperiment('platform_editor_controls', 'variant1') ? 'spacious' : 'none';
|
|
40
|
+
var shouldUseIconAsButton = props.isSmall || editorExperiment('platform_editor_controls', 'variant1');
|
|
41
41
|
return jsx(ToolbarButton, {
|
|
42
42
|
spacing: props.isReducedSpacing ? 'none' : 'default',
|
|
43
43
|
selected: props.selected
|
|
@@ -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/
|
|
52
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
56
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
60
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
64
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
68
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
72
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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/
|
|
76
|
-
light: 'https://dam-cdn.atl.orangelogic.com/
|
|
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
|
-
|
|
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.
|
|
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",
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
35
35
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
36
36
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
37
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
37
|
+
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
38
38
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
39
39
|
"@atlaskit/icon": "^38.0.0",
|
|
40
|
-
"@atlaskit/icon-lab": "^7.
|
|
40
|
+
"@atlaskit/icon-lab": "^7.10.0",
|
|
41
41
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
42
42
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
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": "^
|
|
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.
|
|
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"
|