@atlaskit/editor-plugin-code-block 5.0.3 → 5.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,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 5.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#191913](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/191913)
|
|
8
|
+
[`6d1e56695e91d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6d1e56695e91d) -
|
|
9
|
+
EDITOR-1131 Bump adf-schema package to 50.0.0
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.0.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#188597](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188597)
|
|
17
|
+
[`4de5a96f3e24c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4de5a96f3e24c) -
|
|
18
|
+
[ED-28523] Enable new editor element toolbars UI for Jira
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 5.0.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -10,13 +10,13 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
12
12
|
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
13
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
13
14
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
14
15
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
15
16
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/migration/copy"));
|
|
16
17
|
var _deleteEditorRemove = _interopRequireDefault(require("@atlaskit/icon/core/migration/delete--editor-remove"));
|
|
17
18
|
var _textWrap = _interopRequireDefault(require("@atlaskit/icon/core/text-wrap"));
|
|
18
19
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
20
20
|
var _editorCommands = require("../editor-commands");
|
|
21
21
|
var _WrapIcon = require("../ui/icons/WrapIcon");
|
|
22
22
|
var _codeBlockCopySelectionPlugin = require("./codeBlockCopySelectionPlugin");
|
|
@@ -82,6 +82,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
82
82
|
var separator = {
|
|
83
83
|
type: 'separator'
|
|
84
84
|
};
|
|
85
|
+
var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
|
|
85
86
|
var copyToClipboardItems = !allowCopyToClipboard ? [] : [{
|
|
86
87
|
id: 'editor.codeBlock.copy',
|
|
87
88
|
type: 'button',
|
|
@@ -103,7 +104,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
103
104
|
tabIndex: null
|
|
104
105
|
}, separator];
|
|
105
106
|
var copyAndDeleteButtonMenuItems = [];
|
|
106
|
-
if (
|
|
107
|
+
if (isNewEditorToolbarEnabled) {
|
|
107
108
|
var overflowMenuOptions = [{
|
|
108
109
|
title: formatMessage(_messages.default.delete),
|
|
109
110
|
icon: (0, _delete.default)({
|
|
@@ -173,7 +174,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
173
174
|
return (0, _utils.findDomRefAtPos)(pos, view.domAtPos.bind(view));
|
|
174
175
|
},
|
|
175
176
|
nodeType: nodeType,
|
|
176
|
-
items: [languageSelect].concat((0, _toConsumableArray2.default)(
|
|
177
|
+
items: [languageSelect].concat((0, _toConsumableArray2.default)(isNewEditorToolbarEnabled ? [] : [separator]), [codeBlockWrapButton], (0, _toConsumableArray2.default)(copyAndDeleteButtonMenuItems)),
|
|
177
178
|
scrollable: true
|
|
178
179
|
};
|
|
179
180
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
|
|
2
2
|
import commonMessages, { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
3
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
3
4
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
4
5
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
5
6
|
import CopyIcon from '@atlaskit/icon/core/migration/copy';
|
|
6
7
|
import RemoveIcon from '@atlaskit/icon/core/migration/delete--editor-remove';
|
|
7
8
|
import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
10
10
|
import { changeLanguage, copyContentToClipboardWithAnalytics, removeCodeBlockWithAnalytics, resetCopiedState, toggleWordWrapStateForCodeBlockNode } from '../editor-commands';
|
|
11
11
|
import { WrapIcon } from '../ui/icons/WrapIcon';
|
|
12
12
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './codeBlockCopySelectionPlugin';
|
|
@@ -58,6 +58,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
|
|
|
58
58
|
const separator = {
|
|
59
59
|
type: 'separator'
|
|
60
60
|
};
|
|
61
|
+
const isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
|
|
61
62
|
const copyToClipboardItems = !allowCopyToClipboard ? [] : [{
|
|
62
63
|
id: 'editor.codeBlock.copy',
|
|
63
64
|
type: 'button',
|
|
@@ -79,7 +80,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
|
|
|
79
80
|
tabIndex: null
|
|
80
81
|
}, separator];
|
|
81
82
|
let copyAndDeleteButtonMenuItems = [];
|
|
82
|
-
if (
|
|
83
|
+
if (isNewEditorToolbarEnabled) {
|
|
83
84
|
const overflowMenuOptions = [{
|
|
84
85
|
title: formatMessage(commonMessages.delete),
|
|
85
86
|
icon: DeleteIcon({
|
|
@@ -147,7 +148,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
|
|
|
147
148
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
148
149
|
getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
|
|
149
150
|
nodeType,
|
|
150
|
-
items: [languageSelect, ...(
|
|
151
|
+
items: [languageSelect, ...(isNewEditorToolbarEnabled ? [] : [separator]), codeBlockWrapButton, ...copyAndDeleteButtonMenuItems],
|
|
151
152
|
scrollable: true
|
|
152
153
|
};
|
|
153
154
|
};
|
|
@@ -4,13 +4,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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) { _defineProperty(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; }
|
|
5
5
|
import { isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
|
|
6
6
|
import commonMessages, { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
7
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
7
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
8
9
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
9
10
|
import CopyIcon from '@atlaskit/icon/core/migration/copy';
|
|
10
11
|
import RemoveIcon from '@atlaskit/icon/core/migration/delete--editor-remove';
|
|
11
12
|
import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
|
|
12
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
14
14
|
import { changeLanguage, copyContentToClipboardWithAnalytics, removeCodeBlockWithAnalytics, resetCopiedState, toggleWordWrapStateForCodeBlockNode } from '../editor-commands';
|
|
15
15
|
import { WrapIcon } from '../ui/icons/WrapIcon';
|
|
16
16
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './codeBlockCopySelectionPlugin';
|
|
@@ -73,6 +73,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
73
73
|
var separator = {
|
|
74
74
|
type: 'separator'
|
|
75
75
|
};
|
|
76
|
+
var isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
|
|
76
77
|
var copyToClipboardItems = !allowCopyToClipboard ? [] : [{
|
|
77
78
|
id: 'editor.codeBlock.copy',
|
|
78
79
|
type: 'button',
|
|
@@ -94,7 +95,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
94
95
|
tabIndex: null
|
|
95
96
|
}, separator];
|
|
96
97
|
var copyAndDeleteButtonMenuItems = [];
|
|
97
|
-
if (
|
|
98
|
+
if (isNewEditorToolbarEnabled) {
|
|
98
99
|
var overflowMenuOptions = [{
|
|
99
100
|
title: formatMessage(commonMessages.delete),
|
|
100
101
|
icon: DeleteIcon({
|
|
@@ -164,7 +165,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
164
165
|
return findDomRefAtPos(pos, view.domAtPos.bind(view));
|
|
165
166
|
},
|
|
166
167
|
nodeType: nodeType,
|
|
167
|
-
items: [languageSelect].concat(_toConsumableArray(
|
|
168
|
+
items: [languageSelect].concat(_toConsumableArray(isNewEditorToolbarEnabled ? [] : [separator]), [codeBlockWrapButton], _toConsumableArray(copyAndDeleteButtonMenuItems)),
|
|
168
169
|
scrollable: true
|
|
169
170
|
};
|
|
170
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.5",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
".": "./src/index.ts"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaskit/adf-schema": "^
|
|
33
|
+
"@atlaskit/adf-schema": "^50.0.1",
|
|
34
34
|
"@atlaskit/code": "^17.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-composition": "^2.0.0",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-interaction": "^4.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
|
-
"@atlaskit/icon": "^27.
|
|
42
|
+
"@atlaskit/icon": "^27.7.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^9.17.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^107.
|
|
49
|
+
"@atlaskit/editor-common": "^107.12.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
52
52
|
},
|