@atlaskit/editor-plugin-code-block 4.2.3 → 4.2.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 +19 -0
- package/dist/cjs/pm-plugins/ide-ux.js +1 -2
- package/dist/cjs/pm-plugins/toolbar.js +2 -1
- package/dist/es2019/pm-plugins/ide-ux.js +1 -2
- package/dist/es2019/pm-plugins/toolbar.js +2 -1
- package/dist/esm/pm-plugins/ide-ux.js +1 -2
- package/dist/esm/pm-plugins/toolbar.js +2 -1
- package/dist/types/pm-plugins/language-list.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/language-list.d.ts +3 -3
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 4.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#133457](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/133457)
|
|
8
|
+
[`3feb915ee0488`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3feb915ee0488) -
|
|
9
|
+
[ux] A11Y-10108 fixing Inappropriate accessible name for code block wrap toggle button
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 4.2.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#134378](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134378)
|
|
17
|
+
[`210a48c778086`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/210a48c778086) -
|
|
18
|
+
EDITOR-546 Cleaned up platform_editor_cmd_a_progressively_select_nodes to revert to control
|
|
19
|
+
behaviour.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 4.2.3
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -9,7 +9,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
9
9
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
12
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
12
|
var _bracketHandling = require("./ide-ux/bracket-handling");
|
|
14
13
|
var _commands = require("./ide-ux/commands");
|
|
15
14
|
var _lineHandling = require("./ide-ux/line-handling");
|
|
@@ -116,7 +115,7 @@ var ideUX = function ideUX(pluginInjectionApi) {
|
|
|
116
115
|
}),
|
|
117
116
|
'Shift-Tab': (0, _utils.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, (0, _commands.outdent)(editorAnalyticsAPI)),
|
|
118
117
|
'Mod-a': function ModA(state, dispatch) {
|
|
119
|
-
if ((0, _lineHandling.isSelectionEntirelyInsideCodeBlock)(state)
|
|
118
|
+
if ((0, _lineHandling.isSelectionEntirelyInsideCodeBlock)(state)) {
|
|
120
119
|
var _state$selection = state.selection,
|
|
121
120
|
$from = _state$selection.$from,
|
|
122
121
|
$to = _state$selection.$to;
|
|
@@ -13,6 +13,7 @@ var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
|
13
13
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/migration/copy"));
|
|
14
14
|
var _deleteEditorRemove = _interopRequireDefault(require("@atlaskit/icon/core/migration/delete--editor-remove"));
|
|
15
15
|
var _textWrap = _interopRequireDefault(require("@atlaskit/icon/core/text-wrap"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _editorCommands = require("../editor-commands");
|
|
17
18
|
var _WrapIcon = require("../ui/icons/WrapIcon");
|
|
18
19
|
var _codeBlockCopySelectionPlugin = require("./codeBlockCopySelectionPlugin");
|
|
@@ -112,7 +113,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
112
113
|
icon: _textWrap.default,
|
|
113
114
|
iconFallback: _WrapIcon.WrapIcon,
|
|
114
115
|
onClick: (0, _editorCommands.toggleWordWrapStateForCodeBlockNode)(editorAnalyticsAPI),
|
|
115
|
-
title: isWrapped ? formatMessage(_messages.codeBlockButtonMessages.unwrapCode) : formatMessage(_messages.codeBlockButtonMessages.wrapCode),
|
|
116
|
+
title: (0, _platformFeatureFlags.fg)('editor_a11y_remove_unwrap_button') ? formatMessage(_messages.codeBlockButtonMessages.wrapCode) : isWrapped ? formatMessage(_messages.codeBlockButtonMessages.unwrapCode) : formatMessage(_messages.codeBlockButtonMessages.wrapCode),
|
|
116
117
|
tabIndex: null,
|
|
117
118
|
selected: isWrapped
|
|
118
119
|
};
|
|
@@ -3,7 +3,6 @@ import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
6
|
import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from './ide-ux/bracket-handling';
|
|
8
7
|
import { indent, insertIndent, insertNewlineWithIndent, outdent } from './ide-ux/commands';
|
|
9
8
|
import { getEndOfCurrentLine, getLineInfo, getStartOfCurrentLine, isCursorInsideCodeBlock, isSelectionEntirelyInsideCodeBlock } from './ide-ux/line-handling';
|
|
@@ -118,7 +117,7 @@ const ideUX = pluginInjectionApi => {
|
|
|
118
117
|
}),
|
|
119
118
|
'Shift-Tab': filter(isSelectionEntirelyInsideCodeBlock, outdent(editorAnalyticsAPI)),
|
|
120
119
|
'Mod-a': (state, dispatch) => {
|
|
121
|
-
if (isSelectionEntirelyInsideCodeBlock(state)
|
|
120
|
+
if (isSelectionEntirelyInsideCodeBlock(state)) {
|
|
122
121
|
const {
|
|
123
122
|
$from,
|
|
124
123
|
$to
|
|
@@ -5,6 +5,7 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
|
5
5
|
import CopyIcon from '@atlaskit/icon/core/migration/copy';
|
|
6
6
|
import RemoveIcon from '@atlaskit/icon/core/migration/delete--editor-remove';
|
|
7
7
|
import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState, toggleWordWrapStateForCodeBlockNode } from '../editor-commands';
|
|
9
10
|
import { WrapIcon } from '../ui/icons/WrapIcon';
|
|
10
11
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './codeBlockCopySelectionPlugin';
|
|
@@ -93,7 +94,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api) => (state, {
|
|
|
93
94
|
icon: TextWrapIcon,
|
|
94
95
|
iconFallback: WrapIcon,
|
|
95
96
|
onClick: toggleWordWrapStateForCodeBlockNode(editorAnalyticsAPI),
|
|
96
|
-
title: isWrapped ? formatMessage(codeBlockButtonMessages.unwrapCode) : formatMessage(codeBlockButtonMessages.wrapCode),
|
|
97
|
+
title: fg('editor_a11y_remove_unwrap_button') ? formatMessage(codeBlockButtonMessages.wrapCode) : isWrapped ? formatMessage(codeBlockButtonMessages.unwrapCode) : formatMessage(codeBlockButtonMessages.wrapCode),
|
|
97
98
|
tabIndex: null,
|
|
98
99
|
selected: isWrapped
|
|
99
100
|
};
|
|
@@ -3,7 +3,6 @@ import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
6
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
6
|
import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from './ide-ux/bracket-handling';
|
|
8
7
|
import { indent, insertIndent, insertNewlineWithIndent, outdent } from './ide-ux/commands';
|
|
9
8
|
import { getEndOfCurrentLine, getLineInfo, getStartOfCurrentLine, isCursorInsideCodeBlock, isSelectionEntirelyInsideCodeBlock } from './ide-ux/line-handling';
|
|
@@ -110,7 +109,7 @@ var ideUX = function ideUX(pluginInjectionApi) {
|
|
|
110
109
|
}),
|
|
111
110
|
'Shift-Tab': filter(isSelectionEntirelyInsideCodeBlock, outdent(editorAnalyticsAPI)),
|
|
112
111
|
'Mod-a': function ModA(state, dispatch) {
|
|
113
|
-
if (isSelectionEntirelyInsideCodeBlock(state)
|
|
112
|
+
if (isSelectionEntirelyInsideCodeBlock(state)) {
|
|
114
113
|
var _state$selection = state.selection,
|
|
115
114
|
$from = _state$selection.$from,
|
|
116
115
|
$to = _state$selection.$to;
|
|
@@ -5,6 +5,7 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
|
5
5
|
import CopyIcon from '@atlaskit/icon/core/migration/copy';
|
|
6
6
|
import RemoveIcon from '@atlaskit/icon/core/migration/delete--editor-remove';
|
|
7
7
|
import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState, toggleWordWrapStateForCodeBlockNode } from '../editor-commands';
|
|
9
10
|
import { WrapIcon } from '../ui/icons/WrapIcon';
|
|
10
11
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './codeBlockCopySelectionPlugin';
|
|
@@ -102,7 +103,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
102
103
|
icon: TextWrapIcon,
|
|
103
104
|
iconFallback: WrapIcon,
|
|
104
105
|
onClick: toggleWordWrapStateForCodeBlockNode(editorAnalyticsAPI),
|
|
105
|
-
title: isWrapped ? formatMessage(codeBlockButtonMessages.unwrapCode) : formatMessage(codeBlockButtonMessages.wrapCode),
|
|
106
|
+
title: fg('editor_a11y_remove_unwrap_button') ? formatMessage(codeBlockButtonMessages.wrapCode) : isWrapped ? formatMessage(codeBlockButtonMessages.unwrapCode) : formatMessage(codeBlockButtonMessages.wrapCode),
|
|
106
107
|
tabIndex: null,
|
|
107
108
|
selected: isWrapped
|
|
108
109
|
};
|
|
@@ -321,7 +321,7 @@ export declare const DEFAULT_LANGUAGES: ({
|
|
|
321
321
|
} | {
|
|
322
322
|
readonly name: "ABAP";
|
|
323
323
|
readonly alias: readonly ["abap"];
|
|
324
|
-
readonly value: "
|
|
324
|
+
readonly value: "abap";
|
|
325
325
|
} | {
|
|
326
326
|
name: string;
|
|
327
327
|
alias: string[];
|
|
@@ -651,7 +651,7 @@ export declare function findMatchedLanguage(supportedLanguages: Language[], lang
|
|
|
651
651
|
} | {
|
|
652
652
|
readonly name: "ABAP";
|
|
653
653
|
readonly alias: readonly ["abap"];
|
|
654
|
-
readonly value: "
|
|
654
|
+
readonly value: "abap";
|
|
655
655
|
} | {
|
|
656
656
|
name: string;
|
|
657
657
|
alias: string[];
|
|
@@ -982,7 +982,7 @@ export declare function createLanguageList(supportedLanguages: Language[]): ({
|
|
|
982
982
|
} | {
|
|
983
983
|
readonly name: "ABAP";
|
|
984
984
|
readonly alias: readonly ["abap"];
|
|
985
|
-
readonly value: "
|
|
985
|
+
readonly value: "abap";
|
|
986
986
|
} | {
|
|
987
987
|
name: string;
|
|
988
988
|
alias: string[];
|
|
@@ -565,7 +565,7 @@ export declare const DEFAULT_LANGUAGES: ({
|
|
|
565
565
|
readonly alias: readonly [
|
|
566
566
|
"abap"
|
|
567
567
|
];
|
|
568
|
-
readonly value: "
|
|
568
|
+
readonly value: "abap";
|
|
569
569
|
} | {
|
|
570
570
|
name: string;
|
|
571
571
|
alias: string[];
|
|
@@ -1139,7 +1139,7 @@ export declare function findMatchedLanguage(supportedLanguages: Language[], lang
|
|
|
1139
1139
|
readonly alias: readonly [
|
|
1140
1140
|
"abap"
|
|
1141
1141
|
];
|
|
1142
|
-
readonly value: "
|
|
1142
|
+
readonly value: "abap";
|
|
1143
1143
|
} | {
|
|
1144
1144
|
name: string;
|
|
1145
1145
|
alias: string[];
|
|
@@ -1714,7 +1714,7 @@ export declare function createLanguageList(supportedLanguages: Language[]): ({
|
|
|
1714
1714
|
readonly alias: readonly [
|
|
1715
1715
|
"abap"
|
|
1716
1716
|
];
|
|
1717
|
-
readonly value: "
|
|
1717
|
+
readonly value: "abap";
|
|
1718
1718
|
} | {
|
|
1719
1719
|
name: string;
|
|
1720
1720
|
alias: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.5",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
35
|
-
"@atlaskit/code": "^16.
|
|
36
|
-
"@atlaskit/editor-common": "^102.
|
|
35
|
+
"@atlaskit/code": "^16.2.0",
|
|
36
|
+
"@atlaskit/editor-common": "^102.18.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
38
38
|
"@atlaskit/editor-plugin-composition": "^1.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
|
-
"@atlaskit/icon": "^25.
|
|
42
|
+
"@atlaskit/icon": "^25.5.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^4.6.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
@@ -99,6 +99,9 @@
|
|
|
99
99
|
},
|
|
100
100
|
"editor_code_wrapping_perf_improvement_ed-25141": {
|
|
101
101
|
"type": "boolean"
|
|
102
|
+
},
|
|
103
|
+
"editor_a11y_remove_unwrap_button": {
|
|
104
|
+
"type": "boolean"
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
107
|
}
|