@atlaskit/editor-plugin-code-block 1.5.2 → 2.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,19 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`d9b562bd66f8e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d9b562bd66f8e) -
8
+ [ux] [ED-23947] restoring the original order of the typeahead menu so that actions, media,
9
+ mentions and emojis are above the fold (in the top 5 results). this change is a major because it
10
+ removes the `getEditorFeatureFlags prop` for plugins. if any consumers who have adopted these
11
+ changes to the public API, they should remove them on their side too.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 1.5.2
4
18
 
5
19
  ### Patch Changes
@@ -85,14 +85,13 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
85
85
  },
86
86
  pluginsOptions: {
87
87
  quickInsert: function quickInsert(_ref5) {
88
- var _options$getEditorFea;
89
88
  var formatMessage = _ref5.formatMessage;
90
89
  return [{
91
90
  id: 'codeblock',
92
91
  title: formatMessage(_messages.blockTypeMessages.codeblock),
93
92
  description: formatMessage(_messages.blockTypeMessages.codeblockDescription),
94
93
  keywords: ['code block'],
95
- priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 400 : 700,
94
+ priority: 700,
96
95
  keyshortcut: '```',
97
96
  icon: function icon() {
98
97
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconCode, null);
@@ -74,34 +74,31 @@ const codeBlockPlugin = ({
74
74
  pluginsOptions: {
75
75
  quickInsert: ({
76
76
  formatMessage
77
- }) => {
78
- var _options$getEditorFea;
79
- return [{
80
- id: 'codeblock',
81
- title: formatMessage(blockTypeMessages.codeblock),
82
- description: formatMessage(blockTypeMessages.codeblockDescription),
83
- keywords: ['code block'],
84
- priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 400 : 700,
85
- keyshortcut: '```',
86
- icon: () => /*#__PURE__*/React.createElement(IconCode, null),
87
- action(_insert, state) {
88
- var _api$analytics3;
89
- const tr = createInsertCodeBlockTransaction({
90
- state
91
- });
92
- api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
93
- action: ACTION.INSERTED,
94
- actionSubject: ACTION_SUBJECT.DOCUMENT,
95
- actionSubjectId: ACTION_SUBJECT_ID.CODE_BLOCK,
96
- attributes: {
97
- inputMethod: INPUT_METHOD.QUICK_INSERT
98
- },
99
- eventType: EVENT_TYPE.TRACK
100
- })(tr);
101
- return tr;
102
- }
103
- }];
104
- },
77
+ }) => [{
78
+ id: 'codeblock',
79
+ title: formatMessage(blockTypeMessages.codeblock),
80
+ description: formatMessage(blockTypeMessages.codeblockDescription),
81
+ keywords: ['code block'],
82
+ priority: 700,
83
+ keyshortcut: '```',
84
+ icon: () => /*#__PURE__*/React.createElement(IconCode, null),
85
+ action(_insert, state) {
86
+ var _api$analytics3;
87
+ const tr = createInsertCodeBlockTransaction({
88
+ state
89
+ });
90
+ api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
91
+ action: ACTION.INSERTED,
92
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
93
+ actionSubjectId: ACTION_SUBJECT_ID.CODE_BLOCK,
94
+ attributes: {
95
+ inputMethod: INPUT_METHOD.QUICK_INSERT
96
+ },
97
+ eventType: EVENT_TYPE.TRACK
98
+ })(tr);
99
+ return tr;
100
+ }
101
+ }],
105
102
  floatingToolbar: getToolbarConfig(options === null || options === void 0 ? void 0 : options.allowCopyToClipboard, api)
106
103
  }
107
104
  });
@@ -78,14 +78,13 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
78
78
  },
79
79
  pluginsOptions: {
80
80
  quickInsert: function quickInsert(_ref5) {
81
- var _options$getEditorFea;
82
81
  var formatMessage = _ref5.formatMessage;
83
82
  return [{
84
83
  id: 'codeblock',
85
84
  title: formatMessage(blockTypeMessages.codeblock),
86
85
  description: formatMessage(blockTypeMessages.codeblockDescription),
87
86
  keywords: ['code block'],
88
- priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 400 : 700,
87
+ priority: 700,
89
88
  keyshortcut: '```',
90
89
  icon: function icon() {
91
90
  return /*#__PURE__*/React.createElement(IconCode, null);
@@ -1,7 +1,6 @@
1
- import type { EditorAppearance, GetEditorFeatureFlags, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
1
+ import type { EditorAppearance, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
2
  export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
3
3
  allowCopyToClipboard?: boolean;
4
4
  allowCompositionInputOverride?: boolean;
5
5
  appearance?: EditorAppearance | undefined;
6
- getEditorFeatureFlags?: GetEditorFeatureFlags;
7
6
  }
@@ -1,7 +1,6 @@
1
- import type { EditorAppearance, GetEditorFeatureFlags, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
1
+ import type { EditorAppearance, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
2
  export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
3
3
  allowCopyToClipboard?: boolean;
4
4
  allowCompositionInputOverride?: boolean;
5
5
  appearance?: EditorAppearance | undefined;
6
- getEditorFeatureFlags?: GetEditorFeatureFlags;
7
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "1.5.2",
3
+ "version": "2.0.0",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^39.0.3",
37
37
  "@atlaskit/code": "^15.3.0",
38
- "@atlaskit/editor-common": "^83.5.0",
38
+ "@atlaskit/editor-common": "^84.0.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
40
40
  "@atlaskit/editor-plugin-composition": "^1.1.0",
41
41
  "@atlaskit/editor-plugin-decorations": "^1.1.0",