@atlaskit/editor-plugin-code-block 6.0.0 → 6.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,17 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 6.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 6.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 6.0.0
4
16
 
5
17
  ### Patch Changes
@@ -11,9 +11,12 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
11
11
  var _browser = require("@atlaskit/editor-common/browser");
12
12
  var _codeBlock = require("@atlaskit/editor-common/code-block");
13
13
  var _model = require("@atlaskit/editor-prosemirror/model");
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _editorCommands = require("../editor-commands");
15
16
  var _mainState = require("../pm-plugins/main-state");
16
17
  var _classNames = require("../ui/class-names");
18
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
+ 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; }
17
20
  // Ignored via go/ees005
18
21
  // eslint-disable-next-line require-unicode-regexp
19
22
  var MATCH_NEWLINES = new RegExp('\n', 'g');
@@ -30,13 +33,15 @@ var toDOM = function toDOM(node, contentEditable, formattedAriaLabel) {
30
33
  contenteditable: 'false'
31
34
  }], ['div', {
32
35
  class: _classNames.codeBlockClassNames.content
33
- }, ['code', {
36
+ }, ['code', _objectSpread({
34
37
  'data-language': node.attrs.language || '',
35
38
  spellcheck: 'false',
36
39
  contenteditable: contentEditable ? 'true' : 'false',
37
40
  'data-testid': 'code-block--code',
38
41
  'aria-label': formattedAriaLabel
39
- }, 0]]], ['div', {
42
+ }, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') && {
43
+ 'data-local-id': node.attrs.localId
44
+ }), 0]]], ['div', {
40
45
  class: _classNames.codeBlockClassNames.end,
41
46
  contenteditable: 'false'
42
47
  }]];
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { browser } from '@atlaskit/editor-common/browser';
3
3
  import { codeBlockWrappedStates, defaultWordWrapState } from '@atlaskit/editor-common/code-block';
4
4
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { resetShouldIgnoreFollowingMutations } from '../editor-commands';
6
7
  import { getPluginState } from '../pm-plugins/main-state';
7
8
  import { codeBlockClassNames } from '../ui/class-names';
@@ -26,7 +27,10 @@ const toDOM = (node, contentEditable, formattedAriaLabel) => ['div', {
26
27
  spellcheck: 'false',
27
28
  contenteditable: contentEditable ? 'true' : 'false',
28
29
  'data-testid': 'code-block--code',
29
- 'aria-label': formattedAriaLabel
30
+ 'aria-label': formattedAriaLabel,
31
+ ...(fg('platform_editor_adf_with_localid') && {
32
+ 'data-local-id': node.attrs.localId
33
+ })
30
34
  }, 0]]], ['div', {
31
35
  class: codeBlockClassNames.end,
32
36
  contenteditable: 'false'
@@ -1,9 +1,12 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ 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; }
4
6
  import { browser } from '@atlaskit/editor-common/browser';
5
7
  import { codeBlockWrappedStates, defaultWordWrapState } from '@atlaskit/editor-common/code-block';
6
8
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
7
10
  import { resetShouldIgnoreFollowingMutations } from '../editor-commands';
8
11
  import { getPluginState } from '../pm-plugins/main-state';
9
12
  import { codeBlockClassNames } from '../ui/class-names';
@@ -24,13 +27,15 @@ var toDOM = function toDOM(node, contentEditable, formattedAriaLabel) {
24
27
  contenteditable: 'false'
25
28
  }], ['div', {
26
29
  class: codeBlockClassNames.content
27
- }, ['code', {
30
+ }, ['code', _objectSpread({
28
31
  'data-language': node.attrs.language || '',
29
32
  spellcheck: 'false',
30
33
  contenteditable: contentEditable ? 'true' : 'false',
31
34
  'data-testid': 'code-block--code',
32
35
  'aria-label': formattedAriaLabel
33
- }, 0]]], ['div', {
36
+ }, fg('platform_editor_adf_with_localid') && {
37
+ 'data-local-id': node.attrs.localId
38
+ }), 0]]], ['div', {
34
39
  class: codeBlockClassNames.end,
35
40
  contenteditable: 'false'
36
41
  }]];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,15 +38,15 @@
38
38
  "@atlaskit/editor-plugin-interaction": "^6.0.0",
39
39
  "@atlaskit/editor-plugin-selection": "^4.0.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
- "@atlaskit/editor-toolbar": "^0.6.0",
41
+ "@atlaskit/editor-toolbar": "^0.8.0",
42
42
  "@atlaskit/icon": "^28.1.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
45
- "@atlaskit/tmp-editor-statsig": "^12.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^12.4.0",
46
46
  "@babel/runtime": "^7.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^108.0.0",
49
+ "@atlaskit/editor-common": "^108.2.0",
50
50
  "react": "^18.2.0",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1"
52
52
  },