@atlaskit/editor-plugin-code-block 21.0.0 → 21.0.2

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,21 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 21.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 21.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8d37dc7e55d62`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d37dc7e55d62) -
14
+ Clean up shipped experiment `platform_editor_block_menu`
15
+ - [`8864ef7070f02`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8864ef7070f02) -
16
+ Use the precise code-block copy accessible name behind platform_editor_a11y_codeblock_copy_name.
17
+ - Updated dependencies
18
+
3
19
  ## 21.0.0
4
20
 
5
21
  ### Patch Changes
@@ -10,13 +10,12 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _codeBlock = require("@atlaskit/adf-schema/code-block");
12
12
  var _analytics = require("@atlaskit/editor-common/analytics");
13
+ var _assets = require("@atlaskit/editor-common/assets");
13
14
  var _blockMenu = require("@atlaskit/editor-common/block-menu");
14
15
  var _messages = require("@atlaskit/editor-common/messages");
15
- var _assets = require("@atlaskit/editor-common/assets");
16
16
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
17
17
  var _fg = require("@atlaskit/platform-feature-flags/fg");
18
18
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
19
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
20
19
  var _editorCommands = require("./editor-commands");
21
20
  var _autoDetect = require("./pm-plugins/auto-detect");
22
21
  var _codeBlockAutoFullStopTransformPlugin = require("./pm-plugins/codeBlockAutoFullStopTransformPlugin");
@@ -35,26 +34,24 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
35
34
  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) { (0, _defineProperty2.default)(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; }
36
35
  var CODE_BLOCK_NODE_NAME = 'codeBlock';
37
36
  var codeBlockPlugin = function codeBlockPlugin(_ref) {
37
+ var _api$blockMenu;
38
38
  var options = _ref.config,
39
39
  api = _ref.api;
40
40
  var isRegisteredSlashCommandEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command');
41
- if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
42
- var _api$blockMenu;
43
- api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
44
- type: 'block-menu-item',
45
- key: _blockMenu.TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key,
46
- parent: {
47
- type: 'block-menu-section',
48
- key: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION.key,
49
- rank: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION_RANK[_blockMenu.TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]
50
- },
51
- component: (0, _CodeBlockMenuItem.createCodeBlockMenuItem)(api),
52
- isHidden: function isHidden() {
53
- var _api$blockMenu2;
54
- return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(CODE_BLOCK_NODE_NAME));
55
- }
56
- }]);
57
- }
41
+ api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
42
+ type: 'block-menu-item',
43
+ key: _blockMenu.TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key,
44
+ parent: {
45
+ type: 'block-menu-section',
46
+ key: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION.key,
47
+ rank: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION_RANK[_blockMenu.TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]
48
+ },
49
+ component: (0, _CodeBlockMenuItem.createCodeBlockMenuItem)(api),
50
+ isHidden: function isHidden() {
51
+ var _api$blockMenu2;
52
+ return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(CODE_BLOCK_NODE_NAME));
53
+ }
54
+ }]);
58
55
  if (isRegisteredSlashCommandEnabled) {
59
56
  var _api$uiControlRegistr;
60
57
  api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register((0, _getCodeBlockQuickInsertComponents.getCodeBlockQuickInsertComponents)({
@@ -18,6 +18,7 @@ var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
18
18
  var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
19
19
  var _listNumbered = _interopRequireDefault(require("@atlaskit/icon/core/list-numbered"));
20
20
  var _textWrap = _interopRequireDefault(require("@atlaskit/icon/core/text-wrap"));
21
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
21
22
  var _fg = require("@atlaskit/platform-feature-flags/fg");
22
23
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
24
  var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
@@ -188,7 +189,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
188
189
  // note: copyContentToClipboardWithAnalytics contains logic that also removes the
189
190
  // visual feedback for the copy button
190
191
  onClick: (0, _editorCommands.copyContentToClipboardWithAnalytics)(editorAnalyticsAPI),
191
- title: formatMessage(codeBlockState.contentCopied ? _messages.codeBlockButtonMessages.copiedCodeToClipboard : _messages.codeBlockButtonMessages.copyCodeToClipboard),
192
+ title: formatMessage(codeBlockState.contentCopied ? _messages.codeBlockButtonMessages.copiedCodeToClipboard : (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_a11y_codeblock_copy_name') ? _messages.codeBlockButtonMessages.copyCodeSnippetToClipboard : _messages.codeBlockButtonMessages.copyCodeToClipboard),
192
193
  onMouseEnter: _codeBlockCopySelectionPlugin.provideVisualFeedbackForCopyButton,
193
194
  // note: resetCopiedState contains logic that also removes the
194
195
  // visual feedback for the copy button
@@ -214,7 +215,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
214
215
  }];
215
216
  if (allowCopyToClipboard) {
216
217
  overflowMenuOptions.unshift({
217
- title: formatMessage(_messages.default.copyToClipboard),
218
+ title: formatMessage((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_a11y_codeblock_copy_name') ? _messages.codeBlockButtonMessages.copyCodeSnippetToClipboard : _messages.default.copyToClipboard),
218
219
  onClick: (0, _editorCommands.copyContentToClipboardWithAnalytics)(editorAnalyticsAPI),
219
220
  icon: (0, _copy.default)({
220
221
  label: ''
@@ -17,8 +17,8 @@ var _messages = require("@atlaskit/editor-common/messages");
17
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
18
  var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
19
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
- var _popupSelect = require("@atlaskit/select/popup-select");
21
20
  var _components = require("@atlaskit/react-select/components");
21
+ var _popupSelect = require("@atlaskit/select/popup-select");
22
22
  var _languagePickerOptions = require("./language-picker-options");
23
23
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
24
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
@@ -1,13 +1,12 @@
1
1
  import React from 'react';
2
2
  import { codeBlock, codeBlockWithLocalId } from '@atlaskit/adf-schema/code-block';
3
3
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
+ import { IconCode } from '@atlaskit/editor-common/assets';
4
5
  import { TRANSFORM_STRUCTURE_MENU_SECTION, TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM, TRANSFORM_STRUCTURE_MENU_SECTION_RANK } from '@atlaskit/editor-common/block-menu';
5
6
  import { blockTypeMessages } from '@atlaskit/editor-common/messages';
6
- import { IconCode } from '@atlaskit/editor-common/assets';
7
7
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
9
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
10
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
11
10
  import { createInsertCodeBlockTransaction, insertCodeBlockWithAnalytics } from './editor-commands';
12
11
  import { createAutoDetectPlugin } from './pm-plugins/auto-detect';
13
12
  import { codeBlockAutoFullStopTransformPlugin } from './pm-plugins/codeBlockAutoFullStopTransformPlugin';
@@ -27,24 +26,22 @@ const codeBlockPlugin = ({
27
26
  config: options,
28
27
  api
29
28
  }) => {
29
+ var _api$blockMenu;
30
30
  const isRegisteredSlashCommandEnabled = isExperimentEnabled('platform_editor_slash_command');
31
- if (editorExperiment('platform_editor_block_menu', true)) {
32
- var _api$blockMenu;
33
- api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents([{
34
- type: 'block-menu-item',
35
- key: TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key,
36
- parent: {
37
- type: 'block-menu-section',
38
- key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
39
- rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]
40
- },
41
- component: createCodeBlockMenuItem(api),
42
- isHidden: () => {
43
- var _api$blockMenu2;
44
- return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(CODE_BLOCK_NODE_NAME));
45
- }
46
- }]);
47
- }
31
+ api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents([{
32
+ type: 'block-menu-item',
33
+ key: TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key,
34
+ parent: {
35
+ type: 'block-menu-section',
36
+ key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
37
+ rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]
38
+ },
39
+ component: createCodeBlockMenuItem(api),
40
+ isHidden: () => {
41
+ var _api$blockMenu2;
42
+ return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(CODE_BLOCK_NODE_NAME));
43
+ }
44
+ }]);
48
45
  if (isRegisteredSlashCommandEnabled) {
49
46
  var _api$uiControlRegistr;
50
47
  api === null || api === void 0 ? void 0 : (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 ? void 0 : _api$uiControlRegistr.actions.register(getCodeBlockQuickInsertComponents({
@@ -1,2 +1,3 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
+
2
3
  export { default as codeBlockPlugin } from '../codeBlockPlugin';
@@ -8,6 +8,7 @@ import CopyIcon from '@atlaskit/icon/core/copy';
8
8
  import DeleteIcon from '@atlaskit/icon/core/delete';
9
9
  import ListNumberedIcon from '@atlaskit/icon/core/list-numbered';
10
10
  import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
11
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
11
12
  import { fg } from '@atlaskit/platform-feature-flags/fg';
12
13
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
14
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -158,7 +159,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
158
159
  // note: copyContentToClipboardWithAnalytics contains logic that also removes the
159
160
  // visual feedback for the copy button
160
161
  onClick: copyContentToClipboardWithAnalytics(editorAnalyticsAPI),
161
- title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
162
+ title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : isExperimentEnabled('platform_editor_a11y_codeblock_copy_name') ? codeBlockButtonMessages.copyCodeSnippetToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
162
163
  onMouseEnter: provideVisualFeedbackForCopyButton,
163
164
  // note: resetCopiedState contains logic that also removes the
164
165
  // visual feedback for the copy button
@@ -184,7 +185,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
184
185
  }];
185
186
  if (allowCopyToClipboard) {
186
187
  overflowMenuOptions.unshift({
187
- title: formatMessage(commonMessages.copyToClipboard),
188
+ title: formatMessage(isExperimentEnabled('platform_editor_a11y_codeblock_copy_name') ? codeBlockButtonMessages.copyCodeSnippetToClipboard : commonMessages.copyToClipboard),
188
189
  onClick: copyContentToClipboardWithAnalytics(editorAnalyticsAPI),
189
190
  icon: CopyIcon({
190
191
  label: ''
@@ -7,8 +7,8 @@ import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
7
7
  import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
8
8
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
9
9
  import { Box } from '@atlaskit/primitives/compiled';
10
- import { PopupSelect } from '@atlaskit/select/popup-select';
11
10
  import { components } from '@atlaskit/react-select/components';
11
+ import { PopupSelect } from '@atlaskit/select/popup-select';
12
12
  import { createGroupedLanguageOptions } from './language-picker-options';
13
13
  const pickerOptionStyles = null;
14
14
  const styles = {
@@ -5,13 +5,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
5
5
  import React from 'react';
6
6
  import { codeBlock, codeBlockWithLocalId } from '@atlaskit/adf-schema/code-block';
7
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
8
+ import { IconCode } from '@atlaskit/editor-common/assets';
8
9
  import { TRANSFORM_STRUCTURE_MENU_SECTION, TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM, TRANSFORM_STRUCTURE_MENU_SECTION_RANK } from '@atlaskit/editor-common/block-menu';
9
10
  import { blockTypeMessages } from '@atlaskit/editor-common/messages';
10
- import { IconCode } from '@atlaskit/editor-common/assets';
11
11
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
12
12
  import { fg } from '@atlaskit/platform-feature-flags/fg';
13
13
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
14
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
15
14
  import { createInsertCodeBlockTransaction, insertCodeBlockWithAnalytics } from './editor-commands';
16
15
  import { createAutoDetectPlugin } from './pm-plugins/auto-detect';
17
16
  import { codeBlockAutoFullStopTransformPlugin } from './pm-plugins/codeBlockAutoFullStopTransformPlugin';
@@ -28,26 +27,24 @@ import { FormatCodeErrorFlag } from './ui/FormatCodeErrorFlag';
28
27
  import { getCodeBlockQuickInsertComponents } from './ui/quick-insert/getCodeBlockQuickInsertComponents';
29
28
  var CODE_BLOCK_NODE_NAME = 'codeBlock';
30
29
  var codeBlockPlugin = function codeBlockPlugin(_ref) {
30
+ var _api$blockMenu;
31
31
  var options = _ref.config,
32
32
  api = _ref.api;
33
33
  var isRegisteredSlashCommandEnabled = isExperimentEnabled('platform_editor_slash_command');
34
- if (editorExperiment('platform_editor_block_menu', true)) {
35
- var _api$blockMenu;
36
- api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
37
- type: 'block-menu-item',
38
- key: TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key,
39
- parent: {
40
- type: 'block-menu-section',
41
- key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
42
- rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]
43
- },
44
- component: createCodeBlockMenuItem(api),
45
- isHidden: function isHidden() {
46
- var _api$blockMenu2;
47
- return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(CODE_BLOCK_NODE_NAME));
48
- }
49
- }]);
50
- }
34
+ api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
35
+ type: 'block-menu-item',
36
+ key: TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key,
37
+ parent: {
38
+ type: 'block-menu-section',
39
+ key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
40
+ rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_CODE_BLOCK_MENU_ITEM.key]
41
+ },
42
+ component: createCodeBlockMenuItem(api),
43
+ isHidden: function isHidden() {
44
+ var _api$blockMenu2;
45
+ return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(CODE_BLOCK_NODE_NAME));
46
+ }
47
+ }]);
51
48
  if (isRegisteredSlashCommandEnabled) {
52
49
  var _api$uiControlRegistr;
53
50
  api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getCodeBlockQuickInsertComponents({
@@ -1,2 +1,3 @@
1
1
  /* eslint-disable @atlaskit/editor/no-re-export */
2
+
2
3
  export { default as codeBlockPlugin } from '../codeBlockPlugin';
@@ -12,6 +12,7 @@ import CopyIcon from '@atlaskit/icon/core/copy';
12
12
  import DeleteIcon from '@atlaskit/icon/core/delete';
13
13
  import ListNumberedIcon from '@atlaskit/icon/core/list-numbered';
14
14
  import TextWrapIcon from '@atlaskit/icon/core/text-wrap';
15
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
15
16
  import { fg } from '@atlaskit/platform-feature-flags/fg';
16
17
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
18
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -179,7 +180,7 @@ export var getToolbarConfig = function getToolbarConfig() {
179
180
  // note: copyContentToClipboardWithAnalytics contains logic that also removes the
180
181
  // visual feedback for the copy button
181
182
  onClick: copyContentToClipboardWithAnalytics(editorAnalyticsAPI),
182
- title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
183
+ title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : isExperimentEnabled('platform_editor_a11y_codeblock_copy_name') ? codeBlockButtonMessages.copyCodeSnippetToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
183
184
  onMouseEnter: provideVisualFeedbackForCopyButton,
184
185
  // note: resetCopiedState contains logic that also removes the
185
186
  // visual feedback for the copy button
@@ -205,7 +206,7 @@ export var getToolbarConfig = function getToolbarConfig() {
205
206
  }];
206
207
  if (allowCopyToClipboard) {
207
208
  overflowMenuOptions.unshift({
208
- title: formatMessage(commonMessages.copyToClipboard),
209
+ title: formatMessage(isExperimentEnabled('platform_editor_a11y_codeblock_copy_name') ? codeBlockButtonMessages.copyCodeSnippetToClipboard : commonMessages.copyToClipboard),
209
210
  onClick: copyContentToClipboardWithAnalytics(editorAnalyticsAPI),
210
211
  icon: CopyIcon({
211
212
  label: ''
@@ -12,8 +12,8 @@ import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
12
12
  import { akEditorLineHeight } from '@atlaskit/editor-shared-styles';
13
13
  import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
14
14
  import { Box } from '@atlaskit/primitives/compiled';
15
- import { PopupSelect } from '@atlaskit/select/popup-select';
16
15
  import { components } from '@atlaskit/react-select/components';
16
+ import { PopupSelect } from '@atlaskit/select/popup-select';
17
17
  import { createGroupedLanguageOptions } from './language-picker-options';
18
18
  var pickerOptionStyles = null;
19
19
  var styles = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "21.0.0",
3
+ "version": "21.0.2",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/editor-plugin-toolbar": "^16.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^9.0.0",
36
36
  "@atlaskit/editor-shared-styles": "^4.3.0",
37
- "@atlaskit/editor-toolbar": "^2.6.0",
37
+ "@atlaskit/editor-toolbar": "^2.7.0",
38
38
  "@atlaskit/editor-ui-control-model": "^2.9.0",
39
39
  "@atlaskit/flag": "^18.5.0",
40
40
  "@atlaskit/frontend-utilities": "^4.5.0",
@@ -45,13 +45,13 @@
45
45
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
46
46
  "@atlaskit/react-select": "^4.9.0",
47
47
  "@atlaskit/select": "^22.11.0",
48
- "@atlaskit/tmp-editor-statsig": "^199.0.0",
48
+ "@atlaskit/tmp-editor-statsig": "^201.0.0",
49
49
  "@atlaskit/tokens": "^18.2.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@compiled/react": "^1.0.2"
52
52
  },
53
53
  "peerDependencies": {
54
- "@atlaskit/editor-common": "^123.0.0",
54
+ "@atlaskit/editor-common": "^123.2.0",
55
55
  "react": "^18.2.0 || ^19.2.0",
56
56
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
57
57
  },