@atlaskit/editor-plugin-code-block 8.1.25 → 8.1.27

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
+ ## 8.1.27
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3693402165994`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3693402165994) -
8
+ ENGHEALTH-47506: fix a11y lint warning
9
+ - Updated dependencies
10
+
11
+ ## 8.1.26
12
+
13
+ ### Patch Changes
14
+
15
+ - [`9cb0ce7857313`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9cb0ce7857313) -
16
+ Fix const name.
17
+ - Updated dependencies
18
+
3
19
  ## 8.1.25
4
20
 
5
21
  ### Patch Changes
@@ -11,7 +11,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _messages = require("@atlaskit/editor-common/messages");
12
12
  var _editorToolbar = require("@atlaskit/editor-toolbar");
13
13
  var _angleBrackets = _interopRequireDefault(require("@atlaskit/icon/core/angle-brackets"));
14
- var nodeName = 'codeBlock';
14
+ var NODE_NAME = 'codeBlock';
15
15
  var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
16
16
  var _api$blockMenu2;
17
17
  var api = _ref.api;
@@ -26,14 +26,14 @@ var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
26
26
  var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.codeBlock, {
27
27
  inputMethod: inputMethod,
28
28
  triggeredFrom: triggeredFrom,
29
- targetTypeName: nodeName
29
+ targetTypeName: NODE_NAME
30
30
  });
31
31
  return command ? command({
32
32
  tr: tr
33
33
  }) : null;
34
34
  });
35
35
  };
36
- var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(nodeName);
36
+ var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
37
37
  if (isTransfromToPanelDisabled) {
38
38
  return null;
39
39
  }
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.WrapIcon = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
+ var _reactIntlNext = require("react-intl-next");
10
+ var _messages = require("@atlaskit/editor-common/messages");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
12
  var CustomGlyph = function CustomGlyph() {
10
13
  return /*#__PURE__*/_react.default.createElement("svg", {
11
14
  width: "24",
@@ -22,8 +25,9 @@ var CustomGlyph = function CustomGlyph() {
22
25
  })));
23
26
  };
24
27
  var WrapIcon = exports.WrapIcon = function WrapIcon() {
25
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
28
+ var intl = (0, _reactIntlNext.useIntl)();
29
+ var wrapIconLabel = (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? intl.formatMessage(_messages.blockMenuMessages.wrapIcon) : 'wrapIcon';
26
30
  return /*#__PURE__*/_react.default.createElement(CustomGlyph, {
27
- "aria-label": "wrapIcon"
31
+ "aria-label": wrapIconLabel
28
32
  });
29
33
  };
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { blockMenuMessages } from '@atlaskit/editor-common/messages';
5
5
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
6
6
  import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
7
- const nodeName = 'codeBlock';
7
+ const NODE_NAME = 'codeBlock';
8
8
  const CodeBlockMenuItem = ({
9
9
  api
10
10
  }) => {
@@ -22,14 +22,14 @@ const CodeBlockMenuItem = ({
22
22
  const command = api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.codeBlock, {
23
23
  inputMethod,
24
24
  triggeredFrom,
25
- targetTypeName: nodeName
25
+ targetTypeName: NODE_NAME
26
26
  });
27
27
  return command ? command({
28
28
  tr
29
29
  }) : null;
30
30
  });
31
31
  };
32
- const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(nodeName);
32
+ const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
33
33
  if (isTransfromToPanelDisabled) {
34
34
  return null;
35
35
  }
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockMenuMessages } from '@atlaskit/editor-common/messages';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
2
5
  const CustomGlyph = () => /*#__PURE__*/React.createElement("svg", {
3
6
  width: "24",
4
7
  height: "24",
@@ -13,8 +16,9 @@ const CustomGlyph = () => /*#__PURE__*/React.createElement("svg", {
13
16
  fillRule: "evenodd"
14
17
  })));
15
18
  export const WrapIcon = () => {
16
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
19
+ const intl = useIntl();
20
+ const wrapIconLabel = fg('platform_editor_dec_a11y_fixes') ? intl.formatMessage(blockMenuMessages.wrapIcon) : 'wrapIcon';
17
21
  return /*#__PURE__*/React.createElement(CustomGlyph, {
18
- "aria-label": "wrapIcon"
22
+ "aria-label": wrapIconLabel
19
23
  });
20
24
  };
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
4
  import { blockMenuMessages } from '@atlaskit/editor-common/messages';
5
5
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
6
6
  import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
7
- var nodeName = 'codeBlock';
7
+ var NODE_NAME = 'codeBlock';
8
8
  var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
9
9
  var _api$blockMenu2;
10
10
  var api = _ref.api;
@@ -19,14 +19,14 @@ var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
19
19
  var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.codeBlock, {
20
20
  inputMethod: inputMethod,
21
21
  triggeredFrom: triggeredFrom,
22
- targetTypeName: nodeName
22
+ targetTypeName: NODE_NAME
23
23
  });
24
24
  return command ? command({
25
25
  tr: tr
26
26
  }) : null;
27
27
  });
28
28
  };
29
- var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(nodeName);
29
+ var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
30
30
  if (isTransfromToPanelDisabled) {
31
31
  return null;
32
32
  }
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
+ import { useIntl } from 'react-intl-next';
3
+ import { blockMenuMessages } from '@atlaskit/editor-common/messages';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
2
5
  var CustomGlyph = function CustomGlyph() {
3
6
  return /*#__PURE__*/React.createElement("svg", {
4
7
  width: "24",
@@ -15,8 +18,9 @@ var CustomGlyph = function CustomGlyph() {
15
18
  })));
16
19
  };
17
20
  export var WrapIcon = function WrapIcon() {
18
- // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-jsx
21
+ var intl = useIntl();
22
+ var wrapIconLabel = fg('platform_editor_dec_a11y_fixes') ? intl.formatMessage(blockMenuMessages.wrapIcon) : 'wrapIcon';
19
23
  return /*#__PURE__*/React.createElement(CustomGlyph, {
20
- "aria-label": "wrapIcon"
24
+ "aria-label": wrapIconLabel
21
25
  });
22
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "8.1.25",
3
+ "version": "8.1.27",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,11 +43,11 @@
43
43
  "@atlaskit/icon": "^29.3.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/prosemirror-input-rules": "^3.6.0",
46
- "@atlaskit/tmp-editor-statsig": "^16.1.0",
46
+ "@atlaskit/tmp-editor-statsig": "^16.3.0",
47
47
  "@babel/runtime": "^7.0.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@atlaskit/editor-common": "^110.48.0",
50
+ "@atlaskit/editor-common": "^110.50.0",
51
51
  "react": "^18.2.0",
52
52
  "react-intl-next": "npm:react-intl@^5.18.1"
53
53
  },
@@ -101,6 +101,9 @@
101
101
  },
102
102
  "platform_editor_adf_with_localid": {
103
103
  "type": "boolean"
104
+ },
105
+ "platform_editor_dec_a11y_fixes": {
106
+ "type": "boolean"
104
107
  }
105
108
  }
106
109
  }